/* THIS IS A GENERATED/BUNDLED FILE BY ESBUILD if you want to view the source, please visit the github repository of this plugin */ var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key2 of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key2) && key2 !== except) __defProp(to, key2, { get: () => from[key2], enumerable: !(desc = __getOwnPropDesc(from, key2)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // node_modules/obsidian-dataview/lib/index.js var require_lib = __commonJS({ "node_modules/obsidian-dataview/lib/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); require("obsidian"); var LuxonError2 = class extends Error { }; var InvalidDateTimeError2 = class extends LuxonError2 { constructor(reason) { super(`Invalid DateTime: ${reason.toMessage()}`); } }; var InvalidIntervalError2 = class extends LuxonError2 { constructor(reason) { super(`Invalid Interval: ${reason.toMessage()}`); } }; var InvalidDurationError2 = class extends LuxonError2 { constructor(reason) { super(`Invalid Duration: ${reason.toMessage()}`); } }; var ConflictingSpecificationError2 = class extends LuxonError2 { }; var InvalidUnitError2 = class extends LuxonError2 { constructor(unit) { super(`Invalid unit ${unit}`); } }; var InvalidArgumentError2 = class extends LuxonError2 { }; var ZoneIsAbstractError2 = class extends LuxonError2 { constructor() { super("Zone is an abstract class"); } }; var n2 = "numeric"; var s2 = "short"; var l2 = "long"; var DATE_SHORT2 = { year: n2, month: n2, day: n2 }; var DATE_MED2 = { year: n2, month: s2, day: n2 }; var DATE_MED_WITH_WEEKDAY2 = { year: n2, month: s2, day: n2, weekday: s2 }; var DATE_FULL2 = { year: n2, month: l2, day: n2 }; var DATE_HUGE2 = { year: n2, month: l2, day: n2, weekday: l2 }; var TIME_SIMPLE2 = { hour: n2, minute: n2 }; var TIME_WITH_SECONDS2 = { hour: n2, minute: n2, second: n2 }; var TIME_WITH_SHORT_OFFSET2 = { hour: n2, minute: n2, second: n2, timeZoneName: s2 }; var TIME_WITH_LONG_OFFSET2 = { hour: n2, minute: n2, second: n2, timeZoneName: l2 }; var TIME_24_SIMPLE2 = { hour: n2, minute: n2, hourCycle: "h23" }; var TIME_24_WITH_SECONDS2 = { hour: n2, minute: n2, second: n2, hourCycle: "h23" }; var TIME_24_WITH_SHORT_OFFSET2 = { hour: n2, minute: n2, second: n2, hourCycle: "h23", timeZoneName: s2 }; var TIME_24_WITH_LONG_OFFSET2 = { hour: n2, minute: n2, second: n2, hourCycle: "h23", timeZoneName: l2 }; var DATETIME_SHORT2 = { year: n2, month: n2, day: n2, hour: n2, minute: n2 }; var DATETIME_SHORT_WITH_SECONDS2 = { year: n2, month: n2, day: n2, hour: n2, minute: n2, second: n2 }; var DATETIME_MED2 = { year: n2, month: s2, day: n2, hour: n2, minute: n2 }; var DATETIME_MED_WITH_SECONDS2 = { year: n2, month: s2, day: n2, hour: n2, minute: n2, second: n2 }; var DATETIME_MED_WITH_WEEKDAY2 = { year: n2, month: s2, day: n2, weekday: s2, hour: n2, minute: n2 }; var DATETIME_FULL2 = { year: n2, month: l2, day: n2, hour: n2, minute: n2, timeZoneName: s2 }; var DATETIME_FULL_WITH_SECONDS2 = { year: n2, month: l2, day: n2, hour: n2, minute: n2, second: n2, timeZoneName: s2 }; var DATETIME_HUGE2 = { year: n2, month: l2, day: n2, weekday: l2, hour: n2, minute: n2, timeZoneName: l2 }; var DATETIME_HUGE_WITH_SECONDS2 = { year: n2, month: l2, day: n2, weekday: l2, hour: n2, minute: n2, second: n2, timeZoneName: l2 }; var Zone2 = class { /** * The type of zone * @abstract * @type {string} */ get type() { throw new ZoneIsAbstractError2(); } /** * The name of this zone. * @abstract * @type {string} */ get name() { throw new ZoneIsAbstractError2(); } get ianaName() { return this.name; } /** * Returns whether the offset is known to be fixed for the whole year. * @abstract * @type {boolean} */ get isUniversal() { throw new ZoneIsAbstractError2(); } /** * Returns the offset's common name (such as EST) at the specified timestamp * @abstract * @param {number} ts - Epoch milliseconds for which to get the name * @param {Object} opts - Options to affect the format * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'. * @param {string} opts.locale - What locale to return the offset name in. * @return {string} */ offsetName(ts, opts) { throw new ZoneIsAbstractError2(); } /** * Returns the offset's value as a string * @abstract * @param {number} ts - Epoch milliseconds for which to get the offset * @param {string} format - What style of offset to return. * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively * @return {string} */ formatOffset(ts, format) { throw new ZoneIsAbstractError2(); } /** * Return the offset in minutes for this zone at the specified timestamp. * @abstract * @param {number} ts - Epoch milliseconds for which to compute the offset * @return {number} */ offset(ts) { throw new ZoneIsAbstractError2(); } /** * Return whether this Zone is equal to another zone * @abstract * @param {Zone} otherZone - the zone to compare * @return {boolean} */ equals(otherZone) { throw new ZoneIsAbstractError2(); } /** * Return whether this Zone is valid. * @abstract * @type {boolean} */ get isValid() { throw new ZoneIsAbstractError2(); } }; var singleton$1 = null; var SystemZone2 = class _SystemZone extends Zone2 { /** * Get a singleton instance of the local zone * @return {SystemZone} */ static get instance() { if (singleton$1 === null) { singleton$1 = new _SystemZone(); } return singleton$1; } /** @override **/ get type() { return "system"; } /** @override **/ get name() { return new Intl.DateTimeFormat().resolvedOptions().timeZone; } /** @override **/ get isUniversal() { return false; } /** @override **/ offsetName(ts, { format, locale }) { return parseZoneInfo2(ts, format, locale); } /** @override **/ formatOffset(ts, format) { return formatOffset2(this.offset(ts), format); } /** @override **/ offset(ts) { return -new Date(ts).getTimezoneOffset(); } /** @override **/ equals(otherZone) { return otherZone.type === "system"; } /** @override **/ get isValid() { return true; } }; var dtfCache2 = {}; function makeDTF2(zone) { if (!dtfCache2[zone]) { dtfCache2[zone] = new Intl.DateTimeFormat("en-US", { hour12: false, timeZone: zone, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", era: "short" }); } return dtfCache2[zone]; } var typeToPos2 = { year: 0, month: 1, day: 2, era: 3, hour: 4, minute: 5, second: 6 }; function hackyOffset2(dtf, date) { const formatted = dtf.format(date).replace(/\u200E/g, ""), parsed = /(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(formatted), [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed; return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond]; } function partsOffset2(dtf, date) { const formatted = dtf.formatToParts(date); const filled = []; for (let i = 0; i < formatted.length; i++) { const { type, value } = formatted[i]; const pos = typeToPos2[type]; if (type === "era") { filled[pos] = value; } else if (!isUndefined2(pos)) { filled[pos] = parseInt(value, 10); } } return filled; } var ianaZoneCache2 = {}; var IANAZone2 = class _IANAZone extends Zone2 { /** * @param {string} name - Zone name * @return {IANAZone} */ static create(name) { if (!ianaZoneCache2[name]) { ianaZoneCache2[name] = new _IANAZone(name); } return ianaZoneCache2[name]; } /** * Reset local caches. Should only be necessary in testing scenarios. * @return {void} */ static resetCache() { ianaZoneCache2 = {}; dtfCache2 = {}; } /** * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that. * @param {string} s - The string to check validity on * @example IANAZone.isValidSpecifier("America/New_York") //=> true * @example IANAZone.isValidSpecifier("Sport~~blorp") //=> false * @deprecated This method returns false for some valid IANA names. Use isValidZone instead. * @return {boolean} */ static isValidSpecifier(s3) { return this.isValidZone(s3); } /** * Returns whether the provided string identifies a real zone * @param {string} zone - The string to check * @example IANAZone.isValidZone("America/New_York") //=> true * @example IANAZone.isValidZone("Fantasia/Castle") //=> false * @example IANAZone.isValidZone("Sport~~blorp") //=> false * @return {boolean} */ static isValidZone(zone) { if (!zone) { return false; } try { new Intl.DateTimeFormat("en-US", { timeZone: zone }).format(); return true; } catch (e) { return false; } } constructor(name) { super(); this.zoneName = name; this.valid = _IANAZone.isValidZone(name); } /** @override **/ get type() { return "iana"; } /** @override **/ get name() { return this.zoneName; } /** @override **/ get isUniversal() { return false; } /** @override **/ offsetName(ts, { format, locale }) { return parseZoneInfo2(ts, format, locale, this.name); } /** @override **/ formatOffset(ts, format) { return formatOffset2(this.offset(ts), format); } /** @override **/ offset(ts) { const date = new Date(ts); if (isNaN(date)) return NaN; const dtf = makeDTF2(this.name); let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts ? partsOffset2(dtf, date) : hackyOffset2(dtf, date); if (adOrBc === "BC") { year = -Math.abs(year) + 1; } const adjustedHour = hour === 24 ? 0 : hour; const asUTC = objToLocalTS2({ year, month, day, hour: adjustedHour, minute, second, millisecond: 0 }); let asTS = +date; const over = asTS % 1e3; asTS -= over >= 0 ? over : 1e3 + over; return (asUTC - asTS) / (60 * 1e3); } /** @override **/ equals(otherZone) { return otherZone.type === "iana" && otherZone.name === this.name; } /** @override **/ get isValid() { return this.valid; } }; var intlLFCache2 = {}; function getCachedLF2(locString, opts = {}) { const key2 = JSON.stringify([locString, opts]); let dtf = intlLFCache2[key2]; if (!dtf) { dtf = new Intl.ListFormat(locString, opts); intlLFCache2[key2] = dtf; } return dtf; } var intlDTCache2 = {}; function getCachedDTF2(locString, opts = {}) { const key2 = JSON.stringify([locString, opts]); let dtf = intlDTCache2[key2]; if (!dtf) { dtf = new Intl.DateTimeFormat(locString, opts); intlDTCache2[key2] = dtf; } return dtf; } var intlNumCache2 = {}; function getCachedINF2(locString, opts = {}) { const key2 = JSON.stringify([locString, opts]); let inf = intlNumCache2[key2]; if (!inf) { inf = new Intl.NumberFormat(locString, opts); intlNumCache2[key2] = inf; } return inf; } var intlRelCache2 = {}; function getCachedRTF2(locString, opts = {}) { const { base, ...cacheKeyOpts } = opts; const key2 = JSON.stringify([locString, cacheKeyOpts]); let inf = intlRelCache2[key2]; if (!inf) { inf = new Intl.RelativeTimeFormat(locString, opts); intlRelCache2[key2] = inf; } return inf; } var sysLocaleCache2 = null; function systemLocale2() { if (sysLocaleCache2) { return sysLocaleCache2; } else { sysLocaleCache2 = new Intl.DateTimeFormat().resolvedOptions().locale; return sysLocaleCache2; } } function parseLocaleString2(localeStr) { const xIndex = localeStr.indexOf("-x-"); if (xIndex !== -1) { localeStr = localeStr.substring(0, xIndex); } const uIndex = localeStr.indexOf("-u-"); if (uIndex === -1) { return [localeStr]; } else { let options; let selectedStr; try { options = getCachedDTF2(localeStr).resolvedOptions(); selectedStr = localeStr; } catch (e) { const smaller = localeStr.substring(0, uIndex); options = getCachedDTF2(smaller).resolvedOptions(); selectedStr = smaller; } const { numberingSystem, calendar } = options; return [selectedStr, numberingSystem, calendar]; } } function intlConfigString2(localeStr, numberingSystem, outputCalendar) { if (outputCalendar || numberingSystem) { if (!localeStr.includes("-u-")) { localeStr += "-u"; } if (outputCalendar) { localeStr += `-ca-${outputCalendar}`; } if (numberingSystem) { localeStr += `-nu-${numberingSystem}`; } return localeStr; } else { return localeStr; } } function mapMonths2(f) { const ms = []; for (let i = 1; i <= 12; i++) { const dt = DateTime2.utc(2009, i, 1); ms.push(f(dt)); } return ms; } function mapWeekdays2(f) { const ms = []; for (let i = 1; i <= 7; i++) { const dt = DateTime2.utc(2016, 11, 13 + i); ms.push(f(dt)); } return ms; } function listStuff2(loc, length, englishFn, intlFn) { const mode = loc.listingMode(); if (mode === "error") { return null; } else if (mode === "en") { return englishFn(length); } else { return intlFn(length); } } function supportsFastNumbers2(loc) { if (loc.numberingSystem && loc.numberingSystem !== "latn") { return false; } else { return loc.numberingSystem === "latn" || !loc.locale || loc.locale.startsWith("en") || new Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem === "latn"; } } var PolyNumberFormatter2 = class { constructor(intl, forceSimple, opts) { this.padTo = opts.padTo || 0; this.floor = opts.floor || false; const { padTo, floor, ...otherOpts } = opts; if (!forceSimple || Object.keys(otherOpts).length > 0) { const intlOpts = { useGrouping: false, ...opts }; if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo; this.inf = getCachedINF2(intl, intlOpts); } } format(i) { if (this.inf) { const fixed = this.floor ? Math.floor(i) : i; return this.inf.format(fixed); } else { const fixed = this.floor ? Math.floor(i) : roundTo2(i, 3); return padStart2(fixed, this.padTo); } } }; var PolyDateFormatter2 = class { constructor(dt, intl, opts) { this.opts = opts; this.originalZone = void 0; let z = void 0; if (this.opts.timeZone) { this.dt = dt; } else if (dt.zone.type === "fixed") { const gmtOffset = -1 * (dt.offset / 60); const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`; if (dt.offset !== 0 && IANAZone2.create(offsetZ).valid) { z = offsetZ; this.dt = dt; } else { z = "UTC"; this.dt = dt.offset === 0 ? dt : dt.setZone("UTC").plus({ minutes: dt.offset }); this.originalZone = dt.zone; } } else if (dt.zone.type === "system") { this.dt = dt; } else if (dt.zone.type === "iana") { this.dt = dt; z = dt.zone.name; } else { z = "UTC"; this.dt = dt.setZone("UTC").plus({ minutes: dt.offset }); this.originalZone = dt.zone; } const intlOpts = { ...this.opts }; intlOpts.timeZone = intlOpts.timeZone || z; this.dtf = getCachedDTF2(intl, intlOpts); } format() { if (this.originalZone) { return this.formatToParts().map(({ value }) => value).join(""); } return this.dtf.format(this.dt.toJSDate()); } formatToParts() { const parts = this.dtf.formatToParts(this.dt.toJSDate()); if (this.originalZone) { return parts.map((part) => { if (part.type === "timeZoneName") { const offsetName = this.originalZone.offsetName(this.dt.ts, { locale: this.dt.locale, format: this.opts.timeZoneName }); return { ...part, value: offsetName }; } else { return part; } }); } return parts; } resolvedOptions() { return this.dtf.resolvedOptions(); } }; var PolyRelFormatter2 = class { constructor(intl, isEnglish, opts) { this.opts = { style: "long", ...opts }; if (!isEnglish && hasRelative2()) { this.rtf = getCachedRTF2(intl, opts); } } format(count, unit) { if (this.rtf) { return this.rtf.format(count, unit); } else { return formatRelativeTime2(unit, count, this.opts.numeric, this.opts.style !== "long"); } } formatToParts(count, unit) { if (this.rtf) { return this.rtf.formatToParts(count, unit); } else { return []; } } }; var Locale2 = class _Locale { static fromOpts(opts) { return _Locale.create(opts.locale, opts.numberingSystem, opts.outputCalendar, opts.defaultToEN); } static create(locale, numberingSystem, outputCalendar, defaultToEN = false) { const specifiedLocale = locale || Settings2.defaultLocale; const localeR = specifiedLocale || (defaultToEN ? "en-US" : systemLocale2()); const numberingSystemR = numberingSystem || Settings2.defaultNumberingSystem; const outputCalendarR = outputCalendar || Settings2.defaultOutputCalendar; return new _Locale(localeR, numberingSystemR, outputCalendarR, specifiedLocale); } static resetCache() { sysLocaleCache2 = null; intlDTCache2 = {}; intlNumCache2 = {}; intlRelCache2 = {}; } static fromObject({ locale, numberingSystem, outputCalendar } = {}) { return _Locale.create(locale, numberingSystem, outputCalendar); } constructor(locale, numbering, outputCalendar, specifiedLocale) { const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString2(locale); this.locale = parsedLocale; this.numberingSystem = numbering || parsedNumberingSystem || null; this.outputCalendar = outputCalendar || parsedOutputCalendar || null; this.intl = intlConfigString2(this.locale, this.numberingSystem, this.outputCalendar); this.weekdaysCache = { format: {}, standalone: {} }; this.monthsCache = { format: {}, standalone: {} }; this.meridiemCache = null; this.eraCache = {}; this.specifiedLocale = specifiedLocale; this.fastNumbersCached = null; } get fastNumbers() { if (this.fastNumbersCached == null) { this.fastNumbersCached = supportsFastNumbers2(this); } return this.fastNumbersCached; } listingMode() { const isActuallyEn = this.isEnglish(); const hasNoWeirdness = (this.numberingSystem === null || this.numberingSystem === "latn") && (this.outputCalendar === null || this.outputCalendar === "gregory"); return isActuallyEn && hasNoWeirdness ? "en" : "intl"; } clone(alts) { if (!alts || Object.getOwnPropertyNames(alts).length === 0) { return this; } else { return _Locale.create( alts.locale || this.specifiedLocale, alts.numberingSystem || this.numberingSystem, alts.outputCalendar || this.outputCalendar, alts.defaultToEN || false ); } } redefaultToEN(alts = {}) { return this.clone({ ...alts, defaultToEN: true }); } redefaultToSystem(alts = {}) { return this.clone({ ...alts, defaultToEN: false }); } months(length, format = false) { return listStuff2(this, length, months2, () => { const intl = format ? { month: length, day: "numeric" } : { month: length }, formatStr = format ? "format" : "standalone"; if (!this.monthsCache[formatStr][length]) { this.monthsCache[formatStr][length] = mapMonths2((dt) => this.extract(dt, intl, "month")); } return this.monthsCache[formatStr][length]; }); } weekdays(length, format = false) { return listStuff2(this, length, weekdays2, () => { const intl = format ? { weekday: length, year: "numeric", month: "long", day: "numeric" } : { weekday: length }, formatStr = format ? "format" : "standalone"; if (!this.weekdaysCache[formatStr][length]) { this.weekdaysCache[formatStr][length] = mapWeekdays2( (dt) => this.extract(dt, intl, "weekday") ); } return this.weekdaysCache[formatStr][length]; }); } meridiems() { return listStuff2( this, void 0, () => meridiems2, () => { if (!this.meridiemCache) { const intl = { hour: "numeric", hourCycle: "h12" }; this.meridiemCache = [DateTime2.utc(2016, 11, 13, 9), DateTime2.utc(2016, 11, 13, 19)].map( (dt) => this.extract(dt, intl, "dayperiod") ); } return this.meridiemCache; } ); } eras(length) { return listStuff2(this, length, eras2, () => { const intl = { era: length }; if (!this.eraCache[length]) { this.eraCache[length] = [DateTime2.utc(-40, 1, 1), DateTime2.utc(2017, 1, 1)].map( (dt) => this.extract(dt, intl, "era") ); } return this.eraCache[length]; }); } extract(dt, intlOpts, field) { const df = this.dtFormatter(dt, intlOpts), results = df.formatToParts(), matching = results.find((m) => m.type.toLowerCase() === field); return matching ? matching.value : null; } numberFormatter(opts = {}) { return new PolyNumberFormatter2(this.intl, opts.forceSimple || this.fastNumbers, opts); } dtFormatter(dt, intlOpts = {}) { return new PolyDateFormatter2(dt, this.intl, intlOpts); } relFormatter(opts = {}) { return new PolyRelFormatter2(this.intl, this.isEnglish(), opts); } listFormatter(opts = {}) { return getCachedLF2(this.intl, opts); } isEnglish() { return this.locale === "en" || this.locale.toLowerCase() === "en-us" || new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us"); } equals(other) { return this.locale === other.locale && this.numberingSystem === other.numberingSystem && this.outputCalendar === other.outputCalendar; } }; var singleton3 = null; var FixedOffsetZone2 = class _FixedOffsetZone extends Zone2 { /** * Get a singleton instance of UTC * @return {FixedOffsetZone} */ static get utcInstance() { if (singleton3 === null) { singleton3 = new _FixedOffsetZone(0); } return singleton3; } /** * Get an instance with a specified offset * @param {number} offset - The offset in minutes * @return {FixedOffsetZone} */ static instance(offset3) { return offset3 === 0 ? _FixedOffsetZone.utcInstance : new _FixedOffsetZone(offset3); } /** * Get an instance of FixedOffsetZone from a UTC offset string, like "UTC+6" * @param {string} s - The offset string to parse * @example FixedOffsetZone.parseSpecifier("UTC+6") * @example FixedOffsetZone.parseSpecifier("UTC+06") * @example FixedOffsetZone.parseSpecifier("UTC-6:00") * @return {FixedOffsetZone} */ static parseSpecifier(s3) { if (s3) { const r = s3.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i); if (r) { return new _FixedOffsetZone(signedOffset2(r[1], r[2])); } } return null; } constructor(offset3) { super(); this.fixed = offset3; } /** @override **/ get type() { return "fixed"; } /** @override **/ get name() { return this.fixed === 0 ? "UTC" : `UTC${formatOffset2(this.fixed, "narrow")}`; } get ianaName() { if (this.fixed === 0) { return "Etc/UTC"; } else { return `Etc/GMT${formatOffset2(-this.fixed, "narrow")}`; } } /** @override **/ offsetName() { return this.name; } /** @override **/ formatOffset(ts, format) { return formatOffset2(this.fixed, format); } /** @override **/ get isUniversal() { return true; } /** @override **/ offset() { return this.fixed; } /** @override **/ equals(otherZone) { return otherZone.type === "fixed" && otherZone.fixed === this.fixed; } /** @override **/ get isValid() { return true; } }; var InvalidZone2 = class extends Zone2 { constructor(zoneName) { super(); this.zoneName = zoneName; } /** @override **/ get type() { return "invalid"; } /** @override **/ get name() { return this.zoneName; } /** @override **/ get isUniversal() { return false; } /** @override **/ offsetName() { return null; } /** @override **/ formatOffset() { return ""; } /** @override **/ offset() { return NaN; } /** @override **/ equals() { return false; } /** @override **/ get isValid() { return false; } }; function normalizeZone2(input, defaultZone3) { if (isUndefined2(input) || input === null) { return defaultZone3; } else if (input instanceof Zone2) { return input; } else if (isString2(input)) { const lowered = input.toLowerCase(); if (lowered === "default") return defaultZone3; else if (lowered === "local" || lowered === "system") return SystemZone2.instance; else if (lowered === "utc" || lowered === "gmt") return FixedOffsetZone2.utcInstance; else return FixedOffsetZone2.parseSpecifier(lowered) || IANAZone2.create(input); } else if (isNumber2(input)) { return FixedOffsetZone2.instance(input); } else if (typeof input === "object" && "offset" in input && typeof input.offset === "function") { return input; } else { return new InvalidZone2(input); } } var now3 = () => Date.now(); var defaultZone2 = "system"; var defaultLocale2 = null; var defaultNumberingSystem2 = null; var defaultOutputCalendar2 = null; var twoDigitCutoffYear2 = 60; var throwOnInvalid2; var Settings2 = class { /** * Get the callback for returning the current timestamp. * @type {function} */ static get now() { return now3; } /** * Set the callback for returning the current timestamp. * The function should return a number, which will be interpreted as an Epoch millisecond count * @type {function} * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time */ static set now(n3) { now3 = n3; } /** * Set the default time zone to create DateTimes in. Does not affect existing instances. * Use the value "system" to reset this value to the system's time zone. * @type {string} */ static set defaultZone(zone) { defaultZone2 = zone; } /** * Get the default time zone object currently used to create DateTimes. Does not affect existing instances. * The default value is the system's time zone (the one set on the machine that runs this code). * @type {Zone} */ static get defaultZone() { return normalizeZone2(defaultZone2, SystemZone2.instance); } /** * Get the default locale to create DateTimes with. Does not affect existing instances. * @type {string} */ static get defaultLocale() { return defaultLocale2; } /** * Set the default locale to create DateTimes with. Does not affect existing instances. * @type {string} */ static set defaultLocale(locale) { defaultLocale2 = locale; } /** * Get the default numbering system to create DateTimes with. Does not affect existing instances. * @type {string} */ static get defaultNumberingSystem() { return defaultNumberingSystem2; } /** * Set the default numbering system to create DateTimes with. Does not affect existing instances. * @type {string} */ static set defaultNumberingSystem(numberingSystem) { defaultNumberingSystem2 = numberingSystem; } /** * Get the default output calendar to create DateTimes with. Does not affect existing instances. * @type {string} */ static get defaultOutputCalendar() { return defaultOutputCalendar2; } /** * Set the default output calendar to create DateTimes with. Does not affect existing instances. * @type {string} */ static set defaultOutputCalendar(outputCalendar) { defaultOutputCalendar2 = outputCalendar; } /** * Get the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century. * @type {number} */ static get twoDigitCutoffYear() { return twoDigitCutoffYear2; } /** * Set the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century. * @type {number} * @example Settings.twoDigitCutoffYear = 0 // cut-off year is 0, so all 'yy' are interpreted as current century * @example Settings.twoDigitCutoffYear = 50 // '49' -> 1949; '50' -> 2050 * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50 * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50 */ static set twoDigitCutoffYear(cutoffYear) { twoDigitCutoffYear2 = cutoffYear % 100; } /** * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals * @type {boolean} */ static get throwOnInvalid() { return throwOnInvalid2; } /** * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals * @type {boolean} */ static set throwOnInvalid(t) { throwOnInvalid2 = t; } /** * Reset Luxon's global caches. Should only be necessary in testing scenarios. * @return {void} */ static resetCaches() { Locale2.resetCache(); IANAZone2.resetCache(); } }; function isUndefined2(o) { return typeof o === "undefined"; } function isNumber2(o) { return typeof o === "number"; } function isInteger2(o) { return typeof o === "number" && o % 1 === 0; } function isString2(o) { return typeof o === "string"; } function isDate2(o) { return Object.prototype.toString.call(o) === "[object Date]"; } function hasRelative2() { try { return typeof Intl !== "undefined" && !!Intl.RelativeTimeFormat; } catch (e) { return false; } } function maybeArray2(thing) { return Array.isArray(thing) ? thing : [thing]; } function bestBy2(arr, by, compare) { if (arr.length === 0) { return void 0; } return arr.reduce((best, next) => { const pair = [by(next), next]; if (!best) { return pair; } else if (compare(best[0], pair[0]) === best[0]) { return best; } else { return pair; } }, null)[1]; } function pick2(obj, keys) { return keys.reduce((a, k) => { a[k] = obj[k]; return a; }, {}); } function hasOwnProperty2(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } function integerBetween2(thing, bottom, top) { return isInteger2(thing) && thing >= bottom && thing <= top; } function floorMod2(x, n3) { return x - n3 * Math.floor(x / n3); } function padStart2(input, n3 = 2) { const isNeg = input < 0; let padded; if (isNeg) { padded = "-" + ("" + -input).padStart(n3, "0"); } else { padded = ("" + input).padStart(n3, "0"); } return padded; } function parseInteger2(string) { if (isUndefined2(string) || string === null || string === "") { return void 0; } else { return parseInt(string, 10); } } function parseFloating2(string) { if (isUndefined2(string) || string === null || string === "") { return void 0; } else { return parseFloat(string); } } function parseMillis2(fraction) { if (isUndefined2(fraction) || fraction === null || fraction === "") { return void 0; } else { const f = parseFloat("0." + fraction) * 1e3; return Math.floor(f); } } function roundTo2(number, digits, towardZero = false) { const factor = 10 ** digits, rounder = towardZero ? Math.trunc : Math.round; return rounder(number * factor) / factor; } function isLeapYear2(year) { return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); } function daysInYear2(year) { return isLeapYear2(year) ? 366 : 365; } function daysInMonth2(year, month) { const modMonth = floorMod2(month - 1, 12) + 1, modYear = year + (month - modMonth) / 12; if (modMonth === 2) { return isLeapYear2(modYear) ? 29 : 28; } else { return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1]; } } function objToLocalTS2(obj) { let d = Date.UTC( obj.year, obj.month - 1, obj.day, obj.hour, obj.minute, obj.second, obj.millisecond ); if (obj.year < 100 && obj.year >= 0) { d = new Date(d); d.setUTCFullYear(obj.year, obj.month - 1, obj.day); } return +d; } function weeksInWeekYear2(weekYear) { const p1 = (weekYear + Math.floor(weekYear / 4) - Math.floor(weekYear / 100) + Math.floor(weekYear / 400)) % 7, last = weekYear - 1, p2 = (last + Math.floor(last / 4) - Math.floor(last / 100) + Math.floor(last / 400)) % 7; return p1 === 4 || p2 === 3 ? 53 : 52; } function untruncateYear2(year) { if (year > 99) { return year; } else return year > Settings2.twoDigitCutoffYear ? 1900 + year : 2e3 + year; } function parseZoneInfo2(ts, offsetFormat, locale, timeZone = null) { const date = new Date(ts), intlOpts = { hourCycle: "h23", year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit" }; if (timeZone) { intlOpts.timeZone = timeZone; } const modified = { timeZoneName: offsetFormat, ...intlOpts }; const parsed = new Intl.DateTimeFormat(locale, modified).formatToParts(date).find((m) => m.type.toLowerCase() === "timezonename"); return parsed ? parsed.value : null; } function signedOffset2(offHourStr, offMinuteStr) { let offHour = parseInt(offHourStr, 10); if (Number.isNaN(offHour)) { offHour = 0; } const offMin = parseInt(offMinuteStr, 10) || 0, offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin; return offHour * 60 + offMinSigned; } function asNumber2(value) { const numericValue = Number(value); if (typeof value === "boolean" || value === "" || Number.isNaN(numericValue)) throw new InvalidArgumentError2(`Invalid unit value ${value}`); return numericValue; } function normalizeObject2(obj, normalizer) { const normalized = {}; for (const u in obj) { if (hasOwnProperty2(obj, u)) { const v = obj[u]; if (v === void 0 || v === null) continue; normalized[normalizer(u)] = asNumber2(v); } } return normalized; } function formatOffset2(offset3, format) { const hours = Math.trunc(Math.abs(offset3 / 60)), minutes = Math.trunc(Math.abs(offset3 % 60)), sign = offset3 >= 0 ? "+" : "-"; switch (format) { case "short": return `${sign}${padStart2(hours, 2)}:${padStart2(minutes, 2)}`; case "narrow": return `${sign}${hours}${minutes > 0 ? `:${minutes}` : ""}`; case "techie": return `${sign}${padStart2(hours, 2)}${padStart2(minutes, 2)}`; default: throw new RangeError(`Value format ${format} is out of range for property format`); } } function timeObject2(obj) { return pick2(obj, ["hour", "minute", "second", "millisecond"]); } var monthsLong2 = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; var monthsShort2 = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ]; var monthsNarrow2 = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"]; function months2(length) { switch (length) { case "narrow": return [...monthsNarrow2]; case "short": return [...monthsShort2]; case "long": return [...monthsLong2]; case "numeric": return ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"]; case "2-digit": return ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]; default: return null; } } var weekdaysLong2 = [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ]; var weekdaysShort2 = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]; var weekdaysNarrow2 = ["M", "T", "W", "T", "F", "S", "S"]; function weekdays2(length) { switch (length) { case "narrow": return [...weekdaysNarrow2]; case "short": return [...weekdaysShort2]; case "long": return [...weekdaysLong2]; case "numeric": return ["1", "2", "3", "4", "5", "6", "7"]; default: return null; } } var meridiems2 = ["AM", "PM"]; var erasLong2 = ["Before Christ", "Anno Domini"]; var erasShort2 = ["BC", "AD"]; var erasNarrow2 = ["B", "A"]; function eras2(length) { switch (length) { case "narrow": return [...erasNarrow2]; case "short": return [...erasShort2]; case "long": return [...erasLong2]; default: return null; } } function meridiemForDateTime2(dt) { return meridiems2[dt.hour < 12 ? 0 : 1]; } function weekdayForDateTime2(dt, length) { return weekdays2(length)[dt.weekday - 1]; } function monthForDateTime2(dt, length) { return months2(length)[dt.month - 1]; } function eraForDateTime2(dt, length) { return eras2(length)[dt.year < 0 ? 0 : 1]; } function formatRelativeTime2(unit, count, numeric = "always", narrow = false) { const units = { years: ["year", "yr."], quarters: ["quarter", "qtr."], months: ["month", "mo."], weeks: ["week", "wk."], days: ["day", "day", "days"], hours: ["hour", "hr."], minutes: ["minute", "min."], seconds: ["second", "sec."] }; const lastable = ["hours", "minutes", "seconds"].indexOf(unit) === -1; if (numeric === "auto" && lastable) { const isDay = unit === "days"; switch (count) { case 1: return isDay ? "tomorrow" : `next ${units[unit][0]}`; case -1: return isDay ? "yesterday" : `last ${units[unit][0]}`; case 0: return isDay ? "today" : `this ${units[unit][0]}`; } } const isInPast = Object.is(count, -0) || count < 0, fmtValue = Math.abs(count), singular = fmtValue === 1, lilUnits = units[unit], fmtUnit = narrow ? singular ? lilUnits[1] : lilUnits[2] || lilUnits[1] : singular ? units[unit][0] : unit; return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`; } function stringifyTokens2(splits, tokenToString) { let s3 = ""; for (const token of splits) { if (token.literal) { s3 += token.val; } else { s3 += tokenToString(token.val); } } return s3; } var macroTokenToFormatOpts2 = { D: DATE_SHORT2, DD: DATE_MED2, DDD: DATE_FULL2, DDDD: DATE_HUGE2, t: TIME_SIMPLE2, tt: TIME_WITH_SECONDS2, ttt: TIME_WITH_SHORT_OFFSET2, tttt: TIME_WITH_LONG_OFFSET2, T: TIME_24_SIMPLE2, TT: TIME_24_WITH_SECONDS2, TTT: TIME_24_WITH_SHORT_OFFSET2, TTTT: TIME_24_WITH_LONG_OFFSET2, f: DATETIME_SHORT2, ff: DATETIME_MED2, fff: DATETIME_FULL2, ffff: DATETIME_HUGE2, F: DATETIME_SHORT_WITH_SECONDS2, FF: DATETIME_MED_WITH_SECONDS2, FFF: DATETIME_FULL_WITH_SECONDS2, FFFF: DATETIME_HUGE_WITH_SECONDS2 }; var Formatter2 = class _Formatter { static create(locale, opts = {}) { return new _Formatter(locale, opts); } static parseFormat(fmt) { let current2 = null, currentFull = "", bracketed = false; const splits = []; for (let i = 0; i < fmt.length; i++) { const c = fmt.charAt(i); if (c === "'") { if (currentFull.length > 0) { splits.push({ literal: bracketed || /^\s+$/.test(currentFull), val: currentFull }); } current2 = null; currentFull = ""; bracketed = !bracketed; } else if (bracketed) { currentFull += c; } else if (c === current2) { currentFull += c; } else { if (currentFull.length > 0) { splits.push({ literal: /^\s+$/.test(currentFull), val: currentFull }); } currentFull = c; current2 = c; } } if (currentFull.length > 0) { splits.push({ literal: bracketed || /^\s+$/.test(currentFull), val: currentFull }); } return splits; } static macroTokenToFormatOpts(token) { return macroTokenToFormatOpts2[token]; } constructor(locale, formatOpts) { this.opts = formatOpts; this.loc = locale; this.systemLoc = null; } formatWithSystemDefault(dt, opts) { if (this.systemLoc === null) { this.systemLoc = this.loc.redefaultToSystem(); } const df = this.systemLoc.dtFormatter(dt, { ...this.opts, ...opts }); return df.format(); } dtFormatter(dt, opts = {}) { return this.loc.dtFormatter(dt, { ...this.opts, ...opts }); } formatDateTime(dt, opts) { return this.dtFormatter(dt, opts).format(); } formatDateTimeParts(dt, opts) { return this.dtFormatter(dt, opts).formatToParts(); } formatInterval(interval, opts) { const df = this.dtFormatter(interval.start, opts); return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate()); } resolvedOptions(dt, opts) { return this.dtFormatter(dt, opts).resolvedOptions(); } num(n3, p = 0) { if (this.opts.forceSimple) { return padStart2(n3, p); } const opts = { ...this.opts }; if (p > 0) { opts.padTo = p; } return this.loc.numberFormatter(opts).format(n3); } formatDateTimeFromString(dt, fmt) { const knownEnglish = this.loc.listingMode() === "en", useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", string = (opts, extract) => this.loc.extract(dt, opts, extract), formatOffset3 = (opts) => { if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) { return "Z"; } return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : ""; }, meridiem = () => knownEnglish ? meridiemForDateTime2(dt) : string({ hour: "numeric", hourCycle: "h12" }, "dayperiod"), month = (length, standalone) => knownEnglish ? monthForDateTime2(dt, length) : string(standalone ? { month: length } : { month: length, day: "numeric" }, "month"), weekday = (length, standalone) => knownEnglish ? weekdayForDateTime2(dt, length) : string( standalone ? { weekday: length } : { weekday: length, month: "long", day: "numeric" }, "weekday" ), maybeMacro = (token) => { const formatOpts = _Formatter.macroTokenToFormatOpts(token); if (formatOpts) { return this.formatWithSystemDefault(dt, formatOpts); } else { return token; } }, era = (length) => knownEnglish ? eraForDateTime2(dt, length) : string({ era: length }, "era"), tokenToString = (token) => { switch (token) { case "S": return this.num(dt.millisecond); case "u": case "SSS": return this.num(dt.millisecond, 3); case "s": return this.num(dt.second); case "ss": return this.num(dt.second, 2); case "uu": return this.num(Math.floor(dt.millisecond / 10), 2); case "uuu": return this.num(Math.floor(dt.millisecond / 100)); case "m": return this.num(dt.minute); case "mm": return this.num(dt.minute, 2); case "h": return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12); case "hh": return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2); case "H": return this.num(dt.hour); case "HH": return this.num(dt.hour, 2); case "Z": return formatOffset3({ format: "narrow", allowZ: this.opts.allowZ }); case "ZZ": return formatOffset3({ format: "short", allowZ: this.opts.allowZ }); case "ZZZ": return formatOffset3({ format: "techie", allowZ: this.opts.allowZ }); case "ZZZZ": return dt.zone.offsetName(dt.ts, { format: "short", locale: this.loc.locale }); case "ZZZZZ": return dt.zone.offsetName(dt.ts, { format: "long", locale: this.loc.locale }); case "z": return dt.zoneName; case "a": return meridiem(); case "d": return useDateTimeFormatter ? string({ day: "numeric" }, "day") : this.num(dt.day); case "dd": return useDateTimeFormatter ? string({ day: "2-digit" }, "day") : this.num(dt.day, 2); case "c": return this.num(dt.weekday); case "ccc": return weekday("short", true); case "cccc": return weekday("long", true); case "ccccc": return weekday("narrow", true); case "E": return this.num(dt.weekday); case "EEE": return weekday("short", false); case "EEEE": return weekday("long", false); case "EEEEE": return weekday("narrow", false); case "L": return useDateTimeFormatter ? string({ month: "numeric", day: "numeric" }, "month") : this.num(dt.month); case "LL": return useDateTimeFormatter ? string({ month: "2-digit", day: "numeric" }, "month") : this.num(dt.month, 2); case "LLL": return month("short", true); case "LLLL": return month("long", true); case "LLLLL": return month("narrow", true); case "M": return useDateTimeFormatter ? string({ month: "numeric" }, "month") : this.num(dt.month); case "MM": return useDateTimeFormatter ? string({ month: "2-digit" }, "month") : this.num(dt.month, 2); case "MMM": return month("short", false); case "MMMM": return month("long", false); case "MMMMM": return month("narrow", false); case "y": return useDateTimeFormatter ? string({ year: "numeric" }, "year") : this.num(dt.year); case "yy": return useDateTimeFormatter ? string({ year: "2-digit" }, "year") : this.num(dt.year.toString().slice(-2), 2); case "yyyy": return useDateTimeFormatter ? string({ year: "numeric" }, "year") : this.num(dt.year, 4); case "yyyyyy": return useDateTimeFormatter ? string({ year: "numeric" }, "year") : this.num(dt.year, 6); case "G": return era("short"); case "GG": return era("long"); case "GGGGG": return era("narrow"); case "kk": return this.num(dt.weekYear.toString().slice(-2), 2); case "kkkk": return this.num(dt.weekYear, 4); case "W": return this.num(dt.weekNumber); case "WW": return this.num(dt.weekNumber, 2); case "o": return this.num(dt.ordinal); case "ooo": return this.num(dt.ordinal, 3); case "q": return this.num(dt.quarter); case "qq": return this.num(dt.quarter, 2); case "X": return this.num(Math.floor(dt.ts / 1e3)); case "x": return this.num(dt.ts); default: return maybeMacro(token); } }; return stringifyTokens2(_Formatter.parseFormat(fmt), tokenToString); } formatDurationFromString(dur, fmt) { const tokenToField = (token) => { switch (token[0]) { case "S": return "millisecond"; case "s": return "second"; case "m": return "minute"; case "h": return "hour"; case "d": return "day"; case "w": return "week"; case "M": return "month"; case "y": return "year"; default: return null; } }, tokenToString = (lildur) => (token) => { const mapped = tokenToField(token); if (mapped) { return this.num(lildur.get(mapped), token.length); } else { return token; } }, tokens = _Formatter.parseFormat(fmt), realTokens = tokens.reduce( (found, { literal, val }) => literal ? found : found.concat(val), [] ), collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t) => t)); return stringifyTokens2(tokens, tokenToString(collapsed)); } }; var Invalid2 = class { constructor(reason, explanation) { this.reason = reason; this.explanation = explanation; } toMessage() { if (this.explanation) { return `${this.reason}: ${this.explanation}`; } else { return this.reason; } } }; var ianaRegex2 = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/; function combineRegexes2(...regexes) { const full = regexes.reduce((f, r) => f + r.source, ""); return RegExp(`^${full}$`); } function combineExtractors2(...extractors) { return (m) => extractors.reduce( ([mergedVals, mergedZone, cursor], ex) => { const [val, zone, next] = ex(m, cursor); return [{ ...mergedVals, ...val }, zone || mergedZone, next]; }, [{}, null, 1] ).slice(0, 2); } function parse2(s3, ...patterns) { if (s3 == null) { return [null, null]; } for (const [regex, extractor] of patterns) { const m = regex.exec(s3); if (m) { return extractor(m); } } return [null, null]; } function simpleParse2(...keys) { return (match3, cursor) => { const ret = {}; let i; for (i = 0; i < keys.length; i++) { ret[keys[i]] = parseInteger2(match3[cursor + i]); } return [ret, null, cursor + i]; }; } var offsetRegex2 = /(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/; var isoExtendedZone2 = `(?:${offsetRegex2.source}?(?:\\[(${ianaRegex2.source})\\])?)?`; var isoTimeBaseRegex2 = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/; var isoTimeRegex2 = RegExp(`${isoTimeBaseRegex2.source}${isoExtendedZone2}`); var isoTimeExtensionRegex2 = RegExp(`(?:T${isoTimeRegex2.source})?`); var isoYmdRegex2 = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/; var isoWeekRegex2 = /(\d{4})-?W(\d\d)(?:-?(\d))?/; var isoOrdinalRegex2 = /(\d{4})-?(\d{3})/; var extractISOWeekData2 = simpleParse2("weekYear", "weekNumber", "weekDay"); var extractISOOrdinalData2 = simpleParse2("year", "ordinal"); var sqlYmdRegex2 = /(\d{4})-(\d\d)-(\d\d)/; var sqlTimeRegex2 = RegExp( `${isoTimeBaseRegex2.source} ?(?:${offsetRegex2.source}|(${ianaRegex2.source}))?` ); var sqlTimeExtensionRegex2 = RegExp(`(?: ${sqlTimeRegex2.source})?`); function int2(match3, pos, fallback) { const m = match3[pos]; return isUndefined2(m) ? fallback : parseInteger2(m); } function extractISOYmd2(match3, cursor) { const item = { year: int2(match3, cursor), month: int2(match3, cursor + 1, 1), day: int2(match3, cursor + 2, 1) }; return [item, null, cursor + 3]; } function extractISOTime2(match3, cursor) { const item = { hours: int2(match3, cursor, 0), minutes: int2(match3, cursor + 1, 0), seconds: int2(match3, cursor + 2, 0), milliseconds: parseMillis2(match3[cursor + 3]) }; return [item, null, cursor + 4]; } function extractISOOffset2(match3, cursor) { const local = !match3[cursor] && !match3[cursor + 1], fullOffset = signedOffset2(match3[cursor + 1], match3[cursor + 2]), zone = local ? null : FixedOffsetZone2.instance(fullOffset); return [{}, zone, cursor + 3]; } function extractIANAZone2(match3, cursor) { const zone = match3[cursor] ? IANAZone2.create(match3[cursor]) : null; return [{}, zone, cursor + 1]; } var isoTimeOnly2 = RegExp(`^T?${isoTimeBaseRegex2.source}$`); var isoDuration2 = /^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/; function extractISODuration2(match3) { const [s3, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] = match3; const hasNegativePrefix = s3[0] === "-"; const negativeSeconds = secondStr && secondStr[0] === "-"; const maybeNegate = (num, force = false) => num !== void 0 && (force || num && hasNegativePrefix) ? -num : num; return [ { years: maybeNegate(parseFloating2(yearStr)), months: maybeNegate(parseFloating2(monthStr)), weeks: maybeNegate(parseFloating2(weekStr)), days: maybeNegate(parseFloating2(dayStr)), hours: maybeNegate(parseFloating2(hourStr)), minutes: maybeNegate(parseFloating2(minuteStr)), seconds: maybeNegate(parseFloating2(secondStr), secondStr === "-0"), milliseconds: maybeNegate(parseMillis2(millisecondsStr), negativeSeconds) } ]; } var obsOffsets2 = { GMT: 0, EDT: -4 * 60, EST: -5 * 60, CDT: -5 * 60, CST: -6 * 60, MDT: -6 * 60, MST: -7 * 60, PDT: -7 * 60, PST: -8 * 60 }; function fromStrings2(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) { const result = { year: yearStr.length === 2 ? untruncateYear2(parseInteger2(yearStr)) : parseInteger2(yearStr), month: monthsShort2.indexOf(monthStr) + 1, day: parseInteger2(dayStr), hour: parseInteger2(hourStr), minute: parseInteger2(minuteStr) }; if (secondStr) result.second = parseInteger2(secondStr); if (weekdayStr) { result.weekday = weekdayStr.length > 3 ? weekdaysLong2.indexOf(weekdayStr) + 1 : weekdaysShort2.indexOf(weekdayStr) + 1; } return result; } var rfc28222 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/; function extractRFC28222(match3) { const [ , weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr, obsOffset, milOffset, offHourStr, offMinuteStr ] = match3, result = fromStrings2(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); let offset3; if (obsOffset) { offset3 = obsOffsets2[obsOffset]; } else if (milOffset) { offset3 = 0; } else { offset3 = signedOffset2(offHourStr, offMinuteStr); } return [result, new FixedOffsetZone2(offset3)]; } function preprocessRFC28222(s3) { return s3.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").trim(); } var rfc11232 = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/; var rfc8502 = /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/; var ascii2 = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/; function extractRFC1123Or8502(match3) { const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match3, result = fromStrings2(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); return [result, FixedOffsetZone2.utcInstance]; } function extractASCII2(match3) { const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match3, result = fromStrings2(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); return [result, FixedOffsetZone2.utcInstance]; } var isoYmdWithTimeExtensionRegex2 = combineRegexes2(isoYmdRegex2, isoTimeExtensionRegex2); var isoWeekWithTimeExtensionRegex2 = combineRegexes2(isoWeekRegex2, isoTimeExtensionRegex2); var isoOrdinalWithTimeExtensionRegex2 = combineRegexes2(isoOrdinalRegex2, isoTimeExtensionRegex2); var isoTimeCombinedRegex2 = combineRegexes2(isoTimeRegex2); var extractISOYmdTimeAndOffset2 = combineExtractors2( extractISOYmd2, extractISOTime2, extractISOOffset2, extractIANAZone2 ); var extractISOWeekTimeAndOffset2 = combineExtractors2( extractISOWeekData2, extractISOTime2, extractISOOffset2, extractIANAZone2 ); var extractISOOrdinalDateAndTime2 = combineExtractors2( extractISOOrdinalData2, extractISOTime2, extractISOOffset2, extractIANAZone2 ); var extractISOTimeAndOffset2 = combineExtractors2( extractISOTime2, extractISOOffset2, extractIANAZone2 ); function parseISODate2(s3) { return parse2( s3, [isoYmdWithTimeExtensionRegex2, extractISOYmdTimeAndOffset2], [isoWeekWithTimeExtensionRegex2, extractISOWeekTimeAndOffset2], [isoOrdinalWithTimeExtensionRegex2, extractISOOrdinalDateAndTime2], [isoTimeCombinedRegex2, extractISOTimeAndOffset2] ); } function parseRFC2822Date2(s3) { return parse2(preprocessRFC28222(s3), [rfc28222, extractRFC28222]); } function parseHTTPDate2(s3) { return parse2( s3, [rfc11232, extractRFC1123Or8502], [rfc8502, extractRFC1123Or8502], [ascii2, extractASCII2] ); } function parseISODuration2(s3) { return parse2(s3, [isoDuration2, extractISODuration2]); } var extractISOTimeOnly2 = combineExtractors2(extractISOTime2); function parseISOTimeOnly2(s3) { return parse2(s3, [isoTimeOnly2, extractISOTimeOnly2]); } var sqlYmdWithTimeExtensionRegex2 = combineRegexes2(sqlYmdRegex2, sqlTimeExtensionRegex2); var sqlTimeCombinedRegex2 = combineRegexes2(sqlTimeRegex2); var extractISOTimeOffsetAndIANAZone2 = combineExtractors2( extractISOTime2, extractISOOffset2, extractIANAZone2 ); function parseSQL2(s3) { return parse2( s3, [sqlYmdWithTimeExtensionRegex2, extractISOYmdTimeAndOffset2], [sqlTimeCombinedRegex2, extractISOTimeOffsetAndIANAZone2] ); } var INVALID$2 = "Invalid Duration"; var lowOrderMatrix2 = { weeks: { days: 7, hours: 7 * 24, minutes: 7 * 24 * 60, seconds: 7 * 24 * 60 * 60, milliseconds: 7 * 24 * 60 * 60 * 1e3 }, days: { hours: 24, minutes: 24 * 60, seconds: 24 * 60 * 60, milliseconds: 24 * 60 * 60 * 1e3 }, hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1e3 }, minutes: { seconds: 60, milliseconds: 60 * 1e3 }, seconds: { milliseconds: 1e3 } }; var casualMatrix2 = { years: { quarters: 4, months: 12, weeks: 52, days: 365, hours: 365 * 24, minutes: 365 * 24 * 60, seconds: 365 * 24 * 60 * 60, milliseconds: 365 * 24 * 60 * 60 * 1e3 }, quarters: { months: 3, weeks: 13, days: 91, hours: 91 * 24, minutes: 91 * 24 * 60, seconds: 91 * 24 * 60 * 60, milliseconds: 91 * 24 * 60 * 60 * 1e3 }, months: { weeks: 4, days: 30, hours: 30 * 24, minutes: 30 * 24 * 60, seconds: 30 * 24 * 60 * 60, milliseconds: 30 * 24 * 60 * 60 * 1e3 }, ...lowOrderMatrix2 }; var daysInYearAccurate2 = 146097 / 400; var daysInMonthAccurate2 = 146097 / 4800; var accurateMatrix2 = { years: { quarters: 4, months: 12, weeks: daysInYearAccurate2 / 7, days: daysInYearAccurate2, hours: daysInYearAccurate2 * 24, minutes: daysInYearAccurate2 * 24 * 60, seconds: daysInYearAccurate2 * 24 * 60 * 60, milliseconds: daysInYearAccurate2 * 24 * 60 * 60 * 1e3 }, quarters: { months: 3, weeks: daysInYearAccurate2 / 28, days: daysInYearAccurate2 / 4, hours: daysInYearAccurate2 * 24 / 4, minutes: daysInYearAccurate2 * 24 * 60 / 4, seconds: daysInYearAccurate2 * 24 * 60 * 60 / 4, milliseconds: daysInYearAccurate2 * 24 * 60 * 60 * 1e3 / 4 }, months: { weeks: daysInMonthAccurate2 / 7, days: daysInMonthAccurate2, hours: daysInMonthAccurate2 * 24, minutes: daysInMonthAccurate2 * 24 * 60, seconds: daysInMonthAccurate2 * 24 * 60 * 60, milliseconds: daysInMonthAccurate2 * 24 * 60 * 60 * 1e3 }, ...lowOrderMatrix2 }; var orderedUnits$1 = [ "years", "quarters", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds" ]; var reverseUnits2 = orderedUnits$1.slice(0).reverse(); function clone$1(dur, alts, clear = false) { const conf = { values: clear ? alts.values : { ...dur.values, ...alts.values || {} }, loc: dur.loc.clone(alts.loc), conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy, matrix: alts.matrix || dur.matrix }; return new Duration3(conf); } function durationToMillis2(matrix, vals) { var _a; let sum = (_a = vals.milliseconds) != null ? _a : 0; for (const unit of reverseUnits2.slice(1)) { if (vals[unit]) { sum += vals[unit] * matrix[unit]["milliseconds"]; } } return sum; } function normalizeValues2(matrix, vals) { const factor = durationToMillis2(matrix, vals) < 0 ? -1 : 1; orderedUnits$1.reduceRight((previous, current2) => { if (!isUndefined2(vals[current2])) { if (previous) { const previousVal = vals[previous] * factor; const conv = matrix[current2][previous]; const rollUp = Math.floor(previousVal / conv); vals[current2] += rollUp * factor; vals[previous] -= rollUp * conv * factor; } return current2; } else { return previous; } }, null); orderedUnits$1.reduce((previous, current2) => { if (!isUndefined2(vals[current2])) { if (previous) { const fraction = vals[previous] % 1; vals[previous] -= fraction; vals[current2] += fraction * matrix[previous][current2]; } return current2; } else { return previous; } }, null); } function removeZeroes2(vals) { const newVals = {}; for (const [key2, value] of Object.entries(vals)) { if (value !== 0) { newVals[key2] = value; } } return newVals; } var Duration3 = class _Duration { /** * @private */ constructor(config) { const accurate = config.conversionAccuracy === "longterm" || false; let matrix = accurate ? accurateMatrix2 : casualMatrix2; if (config.matrix) { matrix = config.matrix; } this.values = config.values; this.loc = config.loc || Locale2.create(); this.conversionAccuracy = accurate ? "longterm" : "casual"; this.invalid = config.invalid || null; this.matrix = matrix; this.isLuxonDuration = true; } /** * Create Duration from a number of milliseconds. * @param {number} count of milliseconds * @param {Object} opts - options for parsing * @param {string} [opts.locale='en-US'] - the locale to use * @param {string} opts.numberingSystem - the numbering system to use * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use * @return {Duration} */ static fromMillis(count, opts) { return _Duration.fromObject({ milliseconds: count }, opts); } /** * Create a Duration from a JavaScript object with keys like 'years' and 'hours'. * If this object is empty then a zero milliseconds duration is returned. * @param {Object} obj - the object to create the DateTime from * @param {number} obj.years * @param {number} obj.quarters * @param {number} obj.months * @param {number} obj.weeks * @param {number} obj.days * @param {number} obj.hours * @param {number} obj.minutes * @param {number} obj.seconds * @param {number} obj.milliseconds * @param {Object} [opts=[]] - options for creating this Duration * @param {string} [opts.locale='en-US'] - the locale to use * @param {string} opts.numberingSystem - the numbering system to use * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use * @param {string} [opts.matrix=Object] - the custom conversion system to use * @return {Duration} */ static fromObject(obj, opts = {}) { if (obj == null || typeof obj !== "object") { throw new InvalidArgumentError2( `Duration.fromObject: argument expected to be an object, got ${obj === null ? "null" : typeof obj}` ); } return new _Duration({ values: normalizeObject2(obj, _Duration.normalizeUnit), loc: Locale2.fromObject(opts), conversionAccuracy: opts.conversionAccuracy, matrix: opts.matrix }); } /** * Create a Duration from DurationLike. * * @param {Object | number | Duration} durationLike * One of: * - object with keys like 'years' and 'hours'. * - number representing milliseconds * - Duration instance * @return {Duration} */ static fromDurationLike(durationLike) { if (isNumber2(durationLike)) { return _Duration.fromMillis(durationLike); } else if (_Duration.isDuration(durationLike)) { return durationLike; } else if (typeof durationLike === "object") { return _Duration.fromObject(durationLike); } else { throw new InvalidArgumentError2( `Unknown duration argument ${durationLike} of type ${typeof durationLike}` ); } } /** * Create a Duration from an ISO 8601 duration string. * @param {string} text - text to parse * @param {Object} opts - options for parsing * @param {string} [opts.locale='en-US'] - the locale to use * @param {string} opts.numberingSystem - the numbering system to use * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use * @param {string} [opts.matrix=Object] - the preset conversion system to use * @see https://en.wikipedia.org/wiki/ISO_8601#Durations * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 } * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 } * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 } * @return {Duration} */ static fromISO(text, opts) { const [parsed] = parseISODuration2(text); if (parsed) { return _Duration.fromObject(parsed, opts); } else { return _Duration.invalid("unparsable", `the input "${text}" can't be parsed as ISO 8601`); } } /** * Create a Duration from an ISO 8601 time string. * @param {string} text - text to parse * @param {Object} opts - options for parsing * @param {string} [opts.locale='en-US'] - the locale to use * @param {string} opts.numberingSystem - the numbering system to use * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use * @param {string} [opts.matrix=Object] - the conversion system to use * @see https://en.wikipedia.org/wiki/ISO_8601#Times * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 } * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } * @return {Duration} */ static fromISOTime(text, opts) { const [parsed] = parseISOTimeOnly2(text); if (parsed) { return _Duration.fromObject(parsed, opts); } else { return _Duration.invalid("unparsable", `the input "${text}" can't be parsed as ISO 8601`); } } /** * Create an invalid Duration. * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information * @return {Duration} */ static invalid(reason, explanation = null) { if (!reason) { throw new InvalidArgumentError2("need to specify a reason the Duration is invalid"); } const invalid = reason instanceof Invalid2 ? reason : new Invalid2(reason, explanation); if (Settings2.throwOnInvalid) { throw new InvalidDurationError2(invalid); } else { return new _Duration({ invalid }); } } /** * @private */ static normalizeUnit(unit) { const normalized = { year: "years", years: "years", quarter: "quarters", quarters: "quarters", month: "months", months: "months", week: "weeks", weeks: "weeks", day: "days", days: "days", hour: "hours", hours: "hours", minute: "minutes", minutes: "minutes", second: "seconds", seconds: "seconds", millisecond: "milliseconds", milliseconds: "milliseconds" }[unit ? unit.toLowerCase() : unit]; if (!normalized) throw new InvalidUnitError2(unit); return normalized; } /** * Check if an object is a Duration. Works across context boundaries * @param {object} o * @return {boolean} */ static isDuration(o) { return o && o.isLuxonDuration || false; } /** * Get the locale of a Duration, such 'en-GB' * @type {string} */ get locale() { return this.isValid ? this.loc.locale : null; } /** * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration * * @type {string} */ get numberingSystem() { return this.isValid ? this.loc.numberingSystem : null; } /** * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens: * * `S` for milliseconds * * `s` for seconds * * `m` for minutes * * `h` for hours * * `d` for days * * `w` for weeks * * `M` for months * * `y` for years * Notes: * * Add padding by repeating the token, e.g. "yy" pads the years to two digits, "hhhh" pads the hours out to four digits * * Tokens can be escaped by wrapping with single quotes. * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting. * @param {string} fmt - the format string * @param {Object} opts - options * @param {boolean} [opts.floor=true] - floor numerical values * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("y d s") //=> "1 6 2" * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("yy dd sss") //=> "01 06 002" * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("M S") //=> "12 518402000" * @return {string} */ toFormat(fmt, opts = {}) { const fmtOpts = { ...opts, floor: opts.round !== false && opts.floor !== false }; return this.isValid ? Formatter2.create(this.loc, fmtOpts).formatDurationFromString(this, fmt) : INVALID$2; } /** * Returns a string representation of a Duration with all units included. * To modify its behavior use the `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant. * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat * @param opts - On option object to override the formatting. Accepts the same keys as the options parameter of the native `Int.NumberFormat` constructor, as well as `listStyle`. * @example * ```js * var dur = Duration.fromObject({ days: 1, hours: 5, minutes: 6 }) * dur.toHuman() //=> '1 day, 5 hours, 6 minutes' * dur.toHuman({ listStyle: "long" }) //=> '1 day, 5 hours, and 6 minutes' * dur.toHuman({ unitDisplay: "short" }) //=> '1 day, 5 hr, 6 min' * ``` */ toHuman(opts = {}) { if (!this.isValid) return INVALID$2; const l3 = orderedUnits$1.map((unit) => { const val = this.values[unit]; if (isUndefined2(val)) { return null; } return this.loc.numberFormatter({ style: "unit", unitDisplay: "long", ...opts, unit: unit.slice(0, -1) }).format(val); }).filter((n3) => n3); return this.loc.listFormatter({ type: "conjunction", style: opts.listStyle || "narrow", ...opts }).format(l3); } /** * Returns a JavaScript object with this Duration's values. * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 } * @return {Object} */ toObject() { if (!this.isValid) return {}; return { ...this.values }; } /** * Returns an ISO 8601-compliant string representation of this Duration. * @see https://en.wikipedia.org/wiki/ISO_8601#Durations * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S' * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S' * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M' * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M' * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S' * @return {string} */ toISO() { if (!this.isValid) return null; let s3 = "P"; if (this.years !== 0) s3 += this.years + "Y"; if (this.months !== 0 || this.quarters !== 0) s3 += this.months + this.quarters * 3 + "M"; if (this.weeks !== 0) s3 += this.weeks + "W"; if (this.days !== 0) s3 += this.days + "D"; if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0) s3 += "T"; if (this.hours !== 0) s3 += this.hours + "H"; if (this.minutes !== 0) s3 += this.minutes + "M"; if (this.seconds !== 0 || this.milliseconds !== 0) s3 += roundTo2(this.seconds + this.milliseconds / 1e3, 3) + "S"; if (s3 === "P") s3 += "T0S"; return s3; } /** * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day. * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours. * @see https://en.wikipedia.org/wiki/ISO_8601#Times * @param {Object} opts - options * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 * @param {boolean} [opts.includePrefix=false] - include the `T` prefix * @param {string} [opts.format='extended'] - choose between the basic and extended format * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000' * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00' * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00' * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000' * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000' * @return {string} */ toISOTime(opts = {}) { if (!this.isValid) return null; const millis = this.toMillis(); if (millis < 0 || millis >= 864e5) return null; opts = { suppressMilliseconds: false, suppressSeconds: false, includePrefix: false, format: "extended", ...opts, includeOffset: false }; const dateTime = DateTime2.fromMillis(millis, { zone: "UTC" }); return dateTime.toISOTime(opts); } /** * Returns an ISO 8601 representation of this Duration appropriate for use in JSON. * @return {string} */ toJSON() { return this.toISO(); } /** * Returns an ISO 8601 representation of this Duration appropriate for use in debugging. * @return {string} */ toString() { return this.toISO(); } /** * Returns an milliseconds value of this Duration. * @return {number} */ toMillis() { if (!this.isValid) return NaN; return durationToMillis2(this.matrix, this.values); } /** * Returns an milliseconds value of this Duration. Alias of {@link toMillis} * @return {number} */ valueOf() { return this.toMillis(); } /** * Make this Duration longer by the specified amount. Return a newly-constructed Duration. * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() * @return {Duration} */ plus(duration) { if (!this.isValid) return this; const dur = _Duration.fromDurationLike(duration), result = {}; for (const k of orderedUnits$1) { if (hasOwnProperty2(dur.values, k) || hasOwnProperty2(this.values, k)) { result[k] = dur.get(k) + this.get(k); } } return clone$1(this, { values: result }, true); } /** * Make this Duration shorter by the specified amount. Return a newly-constructed Duration. * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() * @return {Duration} */ minus(duration) { if (!this.isValid) return this; const dur = _Duration.fromDurationLike(duration); return this.plus(dur.negate()); } /** * Scale this Duration by the specified amount. Return a newly-constructed Duration. * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number. * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 } * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === "hours" ? x * 2 : x) //=> { hours: 2, minutes: 30 } * @return {Duration} */ mapUnits(fn) { if (!this.isValid) return this; const result = {}; for (const k of Object.keys(this.values)) { result[k] = asNumber2(fn(this.values[k], k)); } return clone$1(this, { values: result }, true); } /** * Get the value of unit. * @param {string} unit - a unit such as 'minute' or 'day' * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2 * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0 * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3 * @return {number} */ get(unit) { return this[_Duration.normalizeUnit(unit)]; } /** * "Set" the values of specified units. Return a newly-constructed Duration. * @param {Object} values - a mapping of units to numbers * @example dur.set({ years: 2017 }) * @example dur.set({ hours: 8, minutes: 30 }) * @return {Duration} */ set(values) { if (!this.isValid) return this; const mixed = { ...this.values, ...normalizeObject2(values, _Duration.normalizeUnit) }; return clone$1(this, { values: mixed }); } /** * "Set" the locale and/or numberingSystem. Returns a newly-constructed Duration. * @example dur.reconfigure({ locale: 'en-GB' }) * @return {Duration} */ reconfigure({ locale, numberingSystem, conversionAccuracy, matrix } = {}) { const loc = this.loc.clone({ locale, numberingSystem }); const opts = { loc, matrix, conversionAccuracy }; return clone$1(this, opts); } /** * Return the length of the duration in the specified unit. * @param {string} unit - a unit such as 'minutes' or 'days' * @example Duration.fromObject({years: 1}).as('days') //=> 365 * @example Duration.fromObject({years: 1}).as('months') //=> 12 * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5 * @return {number} */ as(unit) { return this.isValid ? this.shiftTo(unit).get(unit) : NaN; } /** * Reduce this Duration to its canonical representation in its current units. * Assuming the overall value of the Duration is positive, this means: * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example) * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise * the overall value would be negative, see second example) * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example) * * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`. * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 } * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 } * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 } * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 } * @return {Duration} */ normalize() { if (!this.isValid) return this; const vals = this.toObject(); normalizeValues2(this.matrix, vals); return clone$1(this, { values: vals }, true); } /** * Rescale units to its largest representation * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 } * @return {Duration} */ rescale() { if (!this.isValid) return this; const vals = removeZeroes2(this.normalize().shiftToAll().toObject()); return clone$1(this, { values: vals }, true); } /** * Convert this Duration into its representation in a different set of units. * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 } * @return {Duration} */ shiftTo(...units) { if (!this.isValid) return this; if (units.length === 0) { return this; } units = units.map((u) => _Duration.normalizeUnit(u)); const built = {}, accumulated = {}, vals = this.toObject(); let lastUnit; for (const k of orderedUnits$1) { if (units.indexOf(k) >= 0) { lastUnit = k; let own = 0; for (const ak in accumulated) { own += this.matrix[ak][k] * accumulated[ak]; accumulated[ak] = 0; } if (isNumber2(vals[k])) { own += vals[k]; } const i = Math.trunc(own); built[k] = i; accumulated[k] = (own * 1e3 - i * 1e3) / 1e3; } else if (isNumber2(vals[k])) { accumulated[k] = vals[k]; } } for (const key2 in accumulated) { if (accumulated[key2] !== 0) { built[lastUnit] += key2 === lastUnit ? accumulated[key2] : accumulated[key2] / this.matrix[lastUnit][key2]; } } normalizeValues2(this.matrix, built); return clone$1(this, { values: built }, true); } /** * Shift this Duration to all available units. * Same as shiftTo("years", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds") * @return {Duration} */ shiftToAll() { if (!this.isValid) return this; return this.shiftTo( "years", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds" ); } /** * Return the negative of this Duration. * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 } * @return {Duration} */ negate() { if (!this.isValid) return this; const negated = {}; for (const k of Object.keys(this.values)) { negated[k] = this.values[k] === 0 ? 0 : -this.values[k]; } return clone$1(this, { values: negated }, true); } /** * Get the years. * @type {number} */ get years() { return this.isValid ? this.values.years || 0 : NaN; } /** * Get the quarters. * @type {number} */ get quarters() { return this.isValid ? this.values.quarters || 0 : NaN; } /** * Get the months. * @type {number} */ get months() { return this.isValid ? this.values.months || 0 : NaN; } /** * Get the weeks * @type {number} */ get weeks() { return this.isValid ? this.values.weeks || 0 : NaN; } /** * Get the days. * @type {number} */ get days() { return this.isValid ? this.values.days || 0 : NaN; } /** * Get the hours. * @type {number} */ get hours() { return this.isValid ? this.values.hours || 0 : NaN; } /** * Get the minutes. * @type {number} */ get minutes() { return this.isValid ? this.values.minutes || 0 : NaN; } /** * Get the seconds. * @return {number} */ get seconds() { return this.isValid ? this.values.seconds || 0 : NaN; } /** * Get the milliseconds. * @return {number} */ get milliseconds() { return this.isValid ? this.values.milliseconds || 0 : NaN; } /** * Returns whether the Duration is invalid. Invalid durations are returned by diff operations * on invalid DateTimes or Intervals. * @return {boolean} */ get isValid() { return this.invalid === null; } /** * Returns an error code if this Duration became invalid, or null if the Duration is valid * @return {string} */ get invalidReason() { return this.invalid ? this.invalid.reason : null; } /** * Returns an explanation of why this Duration became invalid, or null if the Duration is valid * @type {string} */ get invalidExplanation() { return this.invalid ? this.invalid.explanation : null; } /** * Equality check * Two Durations are equal iff they have the same units and the same values for each unit. * @param {Duration} other * @return {boolean} */ equals(other) { if (!this.isValid || !other.isValid) { return false; } if (!this.loc.equals(other.loc)) { return false; } function eq(v1, v2) { if (v1 === void 0 || v1 === 0) return v2 === void 0 || v2 === 0; return v1 === v2; } for (const u of orderedUnits$1) { if (!eq(this.values[u], other.values[u])) { return false; } } return true; } }; var INVALID$1 = "Invalid Interval"; function validateStartEnd2(start, end) { if (!start || !start.isValid) { return Interval2.invalid("missing or invalid start"); } else if (!end || !end.isValid) { return Interval2.invalid("missing or invalid end"); } else if (end < start) { return Interval2.invalid( "end before start", `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}` ); } else { return null; } } var Interval2 = class _Interval { /** * @private */ constructor(config) { this.s = config.start; this.e = config.end; this.invalid = config.invalid || null; this.isLuxonInterval = true; } /** * Create an invalid Interval. * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information * @return {Interval} */ static invalid(reason, explanation = null) { if (!reason) { throw new InvalidArgumentError2("need to specify a reason the Interval is invalid"); } const invalid = reason instanceof Invalid2 ? reason : new Invalid2(reason, explanation); if (Settings2.throwOnInvalid) { throw new InvalidIntervalError2(invalid); } else { return new _Interval({ invalid }); } } /** * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end. * @param {DateTime|Date|Object} start * @param {DateTime|Date|Object} end * @return {Interval} */ static fromDateTimes(start, end) { const builtStart = friendlyDateTime2(start), builtEnd = friendlyDateTime2(end); const validateError = validateStartEnd2(builtStart, builtEnd); if (validateError == null) { return new _Interval({ start: builtStart, end: builtEnd }); } else { return validateError; } } /** * Create an Interval from a start DateTime and a Duration to extend to. * @param {DateTime|Date|Object} start * @param {Duration|Object|number} duration - the length of the Interval. * @return {Interval} */ static after(start, duration) { const dur = Duration3.fromDurationLike(duration), dt = friendlyDateTime2(start); return _Interval.fromDateTimes(dt, dt.plus(dur)); } /** * Create an Interval from an end DateTime and a Duration to extend backwards to. * @param {DateTime|Date|Object} end * @param {Duration|Object|number} duration - the length of the Interval. * @return {Interval} */ static before(end, duration) { const dur = Duration3.fromDurationLike(duration), dt = friendlyDateTime2(end); return _Interval.fromDateTimes(dt.minus(dur), dt); } /** * Create an Interval from an ISO 8601 string. * Accepts `/`, `/`, and `/` formats. * @param {string} text - the ISO string to parse * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO} * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals * @return {Interval} */ static fromISO(text, opts) { const [s3, e] = (text || "").split("/", 2); if (s3 && e) { let start, startIsValid; try { start = DateTime2.fromISO(s3, opts); startIsValid = start.isValid; } catch (e2) { startIsValid = false; } let end, endIsValid; try { end = DateTime2.fromISO(e, opts); endIsValid = end.isValid; } catch (e2) { endIsValid = false; } if (startIsValid && endIsValid) { return _Interval.fromDateTimes(start, end); } if (startIsValid) { const dur = Duration3.fromISO(e, opts); if (dur.isValid) { return _Interval.after(start, dur); } } else if (endIsValid) { const dur = Duration3.fromISO(s3, opts); if (dur.isValid) { return _Interval.before(end, dur); } } } return _Interval.invalid("unparsable", `the input "${text}" can't be parsed as ISO 8601`); } /** * Check if an object is an Interval. Works across context boundaries * @param {object} o * @return {boolean} */ static isInterval(o) { return o && o.isLuxonInterval || false; } /** * Returns the start of the Interval * @type {DateTime} */ get start() { return this.isValid ? this.s : null; } /** * Returns the end of the Interval * @type {DateTime} */ get end() { return this.isValid ? this.e : null; } /** * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'. * @type {boolean} */ get isValid() { return this.invalidReason === null; } /** * Returns an error code if this Interval is invalid, or null if the Interval is valid * @type {string} */ get invalidReason() { return this.invalid ? this.invalid.reason : null; } /** * Returns an explanation of why this Interval became invalid, or null if the Interval is valid * @type {string} */ get invalidExplanation() { return this.invalid ? this.invalid.explanation : null; } /** * Returns the length of the Interval in the specified unit. * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in. * @return {number} */ length(unit = "milliseconds") { return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN; } /** * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part. * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day' * asks 'what dates are included in this interval?', not 'how many days long is this interval?' * @param {string} [unit='milliseconds'] - the unit of time to count. * @return {number} */ count(unit = "milliseconds") { if (!this.isValid) return NaN; const start = this.start.startOf(unit), end = this.end.startOf(unit); return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf()); } /** * Returns whether this Interval's start and end are both in the same unit of time * @param {string} unit - the unit of time to check sameness on * @return {boolean} */ hasSame(unit) { return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false; } /** * Return whether this Interval has the same start and end DateTimes. * @return {boolean} */ isEmpty() { return this.s.valueOf() === this.e.valueOf(); } /** * Return whether this Interval's start is after the specified DateTime. * @param {DateTime} dateTime * @return {boolean} */ isAfter(dateTime) { if (!this.isValid) return false; return this.s > dateTime; } /** * Return whether this Interval's end is before the specified DateTime. * @param {DateTime} dateTime * @return {boolean} */ isBefore(dateTime) { if (!this.isValid) return false; return this.e <= dateTime; } /** * Return whether this Interval contains the specified DateTime. * @param {DateTime} dateTime * @return {boolean} */ contains(dateTime) { if (!this.isValid) return false; return this.s <= dateTime && this.e > dateTime; } /** * "Sets" the start and/or end dates. Returns a newly-constructed Interval. * @param {Object} values - the values to set * @param {DateTime} values.start - the starting DateTime * @param {DateTime} values.end - the ending DateTime * @return {Interval} */ set({ start, end } = {}) { if (!this.isValid) return this; return _Interval.fromDateTimes(start || this.s, end || this.e); } /** * Split this Interval at each of the specified DateTimes * @param {...DateTime} dateTimes - the unit of time to count. * @return {Array} */ splitAt(...dateTimes) { if (!this.isValid) return []; const sorted = dateTimes.map(friendlyDateTime2).filter((d) => this.contains(d)).sort(), results = []; let { s: s3 } = this, i = 0; while (s3 < this.e) { const added = sorted[i] || this.e, next = +added > +this.e ? this.e : added; results.push(_Interval.fromDateTimes(s3, next)); s3 = next; i += 1; } return results; } /** * Split this Interval into smaller Intervals, each of the specified length. * Left over time is grouped into a smaller interval * @param {Duration|Object|number} duration - The length of each resulting interval. * @return {Array} */ splitBy(duration) { const dur = Duration3.fromDurationLike(duration); if (!this.isValid || !dur.isValid || dur.as("milliseconds") === 0) { return []; } let { s: s3 } = this, idx = 1, next; const results = []; while (s3 < this.e) { const added = this.start.plus(dur.mapUnits((x) => x * idx)); next = +added > +this.e ? this.e : added; results.push(_Interval.fromDateTimes(s3, next)); s3 = next; idx += 1; } return results; } /** * Split this Interval into the specified number of smaller intervals. * @param {number} numberOfParts - The number of Intervals to divide the Interval into. * @return {Array} */ divideEqually(numberOfParts) { if (!this.isValid) return []; return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts); } /** * Return whether this Interval overlaps with the specified Interval * @param {Interval} other * @return {boolean} */ overlaps(other) { return this.e > other.s && this.s < other.e; } /** * Return whether this Interval's end is adjacent to the specified Interval's start. * @param {Interval} other * @return {boolean} */ abutsStart(other) { if (!this.isValid) return false; return +this.e === +other.s; } /** * Return whether this Interval's start is adjacent to the specified Interval's end. * @param {Interval} other * @return {boolean} */ abutsEnd(other) { if (!this.isValid) return false; return +other.e === +this.s; } /** * Return whether this Interval engulfs the start and end of the specified Interval. * @param {Interval} other * @return {boolean} */ engulfs(other) { if (!this.isValid) return false; return this.s <= other.s && this.e >= other.e; } /** * Return whether this Interval has the same start and end as the specified Interval. * @param {Interval} other * @return {boolean} */ equals(other) { if (!this.isValid || !other.isValid) { return false; } return this.s.equals(other.s) && this.e.equals(other.e); } /** * Return an Interval representing the intersection of this Interval and the specified Interval. * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals. * Returns null if the intersection is empty, meaning, the intervals don't intersect. * @param {Interval} other * @return {Interval} */ intersection(other) { if (!this.isValid) return this; const s3 = this.s > other.s ? this.s : other.s, e = this.e < other.e ? this.e : other.e; if (s3 >= e) { return null; } else { return _Interval.fromDateTimes(s3, e); } } /** * Return an Interval representing the union of this Interval and the specified Interval. * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals. * @param {Interval} other * @return {Interval} */ union(other) { if (!this.isValid) return this; const s3 = this.s < other.s ? this.s : other.s, e = this.e > other.e ? this.e : other.e; return _Interval.fromDateTimes(s3, e); } /** * Merge an array of Intervals into a equivalent minimal set of Intervals. * Combines overlapping and adjacent Intervals. * @param {Array} intervals * @return {Array} */ static merge(intervals) { const [found, final] = intervals.sort((a, b) => a.s - b.s).reduce( ([sofar, current2], item) => { if (!current2) { return [sofar, item]; } else if (current2.overlaps(item) || current2.abutsStart(item)) { return [sofar, current2.union(item)]; } else { return [sofar.concat([current2]), item]; } }, [[], null] ); if (final) { found.push(final); } return found; } /** * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals. * @param {Array} intervals * @return {Array} */ static xor(intervals) { let start = null, currentCount = 0; const results = [], ends = intervals.map((i) => [ { time: i.s, type: "s" }, { time: i.e, type: "e" } ]), flattened = Array.prototype.concat(...ends), arr = flattened.sort((a, b) => a.time - b.time); for (const i of arr) { currentCount += i.type === "s" ? 1 : -1; if (currentCount === 1) { start = i.time; } else { if (start && +start !== +i.time) { results.push(_Interval.fromDateTimes(start, i.time)); } start = null; } } return _Interval.merge(results); } /** * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals. * @param {...Interval} intervals * @return {Array} */ difference(...intervals) { return _Interval.xor([this].concat(intervals)).map((i) => this.intersection(i)).filter((i) => i && !i.isEmpty()); } /** * Returns a string representation of this Interval appropriate for debugging. * @return {string} */ toString() { if (!this.isValid) return INVALID$1; return `[${this.s.toISO()} \u2013 ${this.e.toISO()})`; } /** * Returns a localized string representing this Interval. Accepts the same options as the * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method * is browser-specific, but in general it will return an appropriate representation of the * Interval in the assigned locale. Defaults to the system's locale if no locale has been * specified. * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or * Intl.DateTimeFormat constructor options. * @param {Object} opts - Options to override the configuration of the start DateTime. * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022 * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022 * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022 * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p * @return {string} */ toLocaleString(formatOpts = DATE_SHORT2, opts = {}) { return this.isValid ? Formatter2.create(this.s.loc.clone(opts), formatOpts).formatInterval(this) : INVALID$1; } /** * Returns an ISO 8601-compliant string representation of this Interval. * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals * @param {Object} opts - The same options as {@link DateTime#toISO} * @return {string} */ toISO(opts) { if (!this.isValid) return INVALID$1; return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`; } /** * Returns an ISO 8601-compliant string representation of date of this Interval. * The time components are ignored. * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals * @return {string} */ toISODate() { if (!this.isValid) return INVALID$1; return `${this.s.toISODate()}/${this.e.toISODate()}`; } /** * Returns an ISO 8601-compliant string representation of time of this Interval. * The date components are ignored. * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals * @param {Object} opts - The same options as {@link DateTime#toISO} * @return {string} */ toISOTime(opts) { if (!this.isValid) return INVALID$1; return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`; } /** * Returns a string representation of this Interval formatted according to the specified format * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible * formatting tool. * @param {string} dateFormat - The format string. This string formats the start and end time. * See {@link DateTime#toFormat} for details. * @param {Object} opts - Options. * @param {string} [opts.separator = ' – '] - A separator to place between the start and end * representations. * @return {string} */ toFormat(dateFormat, { separator = " \u2013 " } = {}) { if (!this.isValid) return INVALID$1; return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`; } /** * Return a Duration representing the time spanned by this interval. * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration. * @param {Object} opts - options that affect the creation of the Duration * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 } * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 } * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 } * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 } * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 } * @return {Duration} */ toDuration(unit, opts) { if (!this.isValid) { return Duration3.invalid(this.invalidReason); } return this.e.diff(this.s, unit, opts); } /** * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes * @param {function} mapFn * @return {Interval} * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC()) * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 })) */ mapEndpoints(mapFn) { return _Interval.fromDateTimes(mapFn(this.s), mapFn(this.e)); } }; var Info2 = class { /** * Return whether the specified zone contains a DST. * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone. * @return {boolean} */ static hasDST(zone = Settings2.defaultZone) { const proto = DateTime2.now().setZone(zone).set({ month: 12 }); return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset; } /** * Return whether the specified zone is a valid IANA specifier. * @param {string} zone - Zone to check * @return {boolean} */ static isValidIANAZone(zone) { return IANAZone2.isValidZone(zone); } /** * Converts the input into a {@link Zone} instance. * * * If `input` is already a Zone instance, it is returned unchanged. * * If `input` is a string containing a valid time zone name, a Zone instance * with that name is returned. * * If `input` is a string that doesn't refer to a known time zone, a Zone * instance with {@link Zone#isValid} == false is returned. * * If `input is a number, a Zone instance with the specified fixed offset * in minutes is returned. * * If `input` is `null` or `undefined`, the default zone is returned. * @param {string|Zone|number} [input] - the value to be converted * @return {Zone} */ static normalizeZone(input) { return normalizeZone2(input, Settings2.defaultZone); } /** * Return an array of standalone month names. * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat * @param {string} [length='long'] - the length of the month representation, such as "numeric", "2-digit", "narrow", "short", "long" * @param {Object} opts - options * @param {string} [opts.locale] - the locale code * @param {string} [opts.numberingSystem=null] - the numbering system * @param {string} [opts.locObj=null] - an existing locale object to use * @param {string} [opts.outputCalendar='gregory'] - the calendar * @example Info.months()[0] //=> 'January' * @example Info.months('short')[0] //=> 'Jan' * @example Info.months('numeric')[0] //=> '1' * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.' * @example Info.months('numeric', { locale: 'ar' })[0] //=> '١' * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I' * @return {Array} */ static months(length = "long", { locale = null, numberingSystem = null, locObj = null, outputCalendar = "gregory" } = {}) { return (locObj || Locale2.create(locale, numberingSystem, outputCalendar)).months(length); } /** * Return an array of format month names. * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that * changes the string. * See {@link Info#months} * @param {string} [length='long'] - the length of the month representation, such as "numeric", "2-digit", "narrow", "short", "long" * @param {Object} opts - options * @param {string} [opts.locale] - the locale code * @param {string} [opts.numberingSystem=null] - the numbering system * @param {string} [opts.locObj=null] - an existing locale object to use * @param {string} [opts.outputCalendar='gregory'] - the calendar * @return {Array} */ static monthsFormat(length = "long", { locale = null, numberingSystem = null, locObj = null, outputCalendar = "gregory" } = {}) { return (locObj || Locale2.create(locale, numberingSystem, outputCalendar)).months(length, true); } /** * Return an array of standalone week names. * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat * @param {string} [length='long'] - the length of the weekday representation, such as "narrow", "short", "long". * @param {Object} opts - options * @param {string} [opts.locale] - the locale code * @param {string} [opts.numberingSystem=null] - the numbering system * @param {string} [opts.locObj=null] - an existing locale object to use * @example Info.weekdays()[0] //=> 'Monday' * @example Info.weekdays('short')[0] //=> 'Mon' * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.' * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين' * @return {Array} */ static weekdays(length = "long", { locale = null, numberingSystem = null, locObj = null } = {}) { return (locObj || Locale2.create(locale, numberingSystem, null)).weekdays(length); } /** * Return an array of format week names. * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that * changes the string. * See {@link Info#weekdays} * @param {string} [length='long'] - the length of the month representation, such as "narrow", "short", "long". * @param {Object} opts - options * @param {string} [opts.locale=null] - the locale code * @param {string} [opts.numberingSystem=null] - the numbering system * @param {string} [opts.locObj=null] - an existing locale object to use * @return {Array} */ static weekdaysFormat(length = "long", { locale = null, numberingSystem = null, locObj = null } = {}) { return (locObj || Locale2.create(locale, numberingSystem, null)).weekdays(length, true); } /** * Return an array of meridiems. * @param {Object} opts - options * @param {string} [opts.locale] - the locale code * @example Info.meridiems() //=> [ 'AM', 'PM' ] * @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ] * @return {Array} */ static meridiems({ locale = null } = {}) { return Locale2.create(locale).meridiems(); } /** * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian. * @param {string} [length='short'] - the length of the era representation, such as "short" or "long". * @param {Object} opts - options * @param {string} [opts.locale] - the locale code * @example Info.eras() //=> [ 'BC', 'AD' ] * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ] * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ] * @return {Array} */ static eras(length = "short", { locale = null } = {}) { return Locale2.create(locale, null, "gregory").eras(length); } /** * Return the set of available features in this environment. * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case. * Keys: * * `relative`: whether this environment supports relative time formatting * @example Info.features() //=> { relative: false } * @return {Object} */ static features() { return { relative: hasRelative2() }; } }; function dayDiff2(earlier, later) { const utcDayStart = (dt) => dt.toUTC(0, { keepLocalTime: true }).startOf("day").valueOf(), ms = utcDayStart(later) - utcDayStart(earlier); return Math.floor(Duration3.fromMillis(ms).as("days")); } function highOrderDiffs2(cursor, later, units) { const differs = [ ["years", (a, b) => b.year - a.year], ["quarters", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4], ["months", (a, b) => b.month - a.month + (b.year - a.year) * 12], [ "weeks", (a, b) => { const days = dayDiff2(a, b); return (days - days % 7) / 7; } ], ["days", dayDiff2] ]; const results = {}; const earlier = cursor; let lowestOrder, highWater; for (const [unit, differ] of differs) { if (units.indexOf(unit) >= 0) { lowestOrder = unit; results[unit] = differ(cursor, later); highWater = earlier.plus(results); if (highWater > later) { results[unit]--; cursor = earlier.plus(results); if (cursor > later) { highWater = cursor; results[unit]--; cursor = earlier.plus(results); } } else { cursor = highWater; } } } return [cursor, results, highWater, lowestOrder]; } function diff(earlier, later, units, opts) { let [cursor, results, highWater, lowestOrder] = highOrderDiffs2(earlier, later, units); const remainingMillis = later - cursor; const lowerOrderUnits = units.filter( (u) => ["hours", "minutes", "seconds", "milliseconds"].indexOf(u) >= 0 ); if (lowerOrderUnits.length === 0) { if (highWater < later) { highWater = cursor.plus({ [lowestOrder]: 1 }); } if (highWater !== cursor) { results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor); } } const duration = Duration3.fromObject(results, opts); if (lowerOrderUnits.length > 0) { return Duration3.fromMillis(remainingMillis, opts).shiftTo(...lowerOrderUnits).plus(duration); } else { return duration; } } var numberingSystems2 = { arab: "[\u0660-\u0669]", arabext: "[\u06F0-\u06F9]", bali: "[\u1B50-\u1B59]", beng: "[\u09E6-\u09EF]", deva: "[\u0966-\u096F]", fullwide: "[\uFF10-\uFF19]", gujr: "[\u0AE6-\u0AEF]", hanidec: "[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]", khmr: "[\u17E0-\u17E9]", knda: "[\u0CE6-\u0CEF]", laoo: "[\u0ED0-\u0ED9]", limb: "[\u1946-\u194F]", mlym: "[\u0D66-\u0D6F]", mong: "[\u1810-\u1819]", mymr: "[\u1040-\u1049]", orya: "[\u0B66-\u0B6F]", tamldec: "[\u0BE6-\u0BEF]", telu: "[\u0C66-\u0C6F]", thai: "[\u0E50-\u0E59]", tibt: "[\u0F20-\u0F29]", latn: "\\d" }; var numberingSystemsUTF162 = { arab: [1632, 1641], arabext: [1776, 1785], bali: [6992, 7001], beng: [2534, 2543], deva: [2406, 2415], fullwide: [65296, 65303], gujr: [2790, 2799], khmr: [6112, 6121], knda: [3302, 3311], laoo: [3792, 3801], limb: [6470, 6479], mlym: [3430, 3439], mong: [6160, 6169], mymr: [4160, 4169], orya: [2918, 2927], tamldec: [3046, 3055], telu: [3174, 3183], thai: [3664, 3673], tibt: [3872, 3881] }; var hanidecChars2 = numberingSystems2.hanidec.replace(/[\[|\]]/g, "").split(""); function parseDigits2(str) { let value = parseInt(str, 10); if (isNaN(value)) { value = ""; for (let i = 0; i < str.length; i++) { const code = str.charCodeAt(i); if (str[i].search(numberingSystems2.hanidec) !== -1) { value += hanidecChars2.indexOf(str[i]); } else { for (const key2 in numberingSystemsUTF162) { const [min, max] = numberingSystemsUTF162[key2]; if (code >= min && code <= max) { value += code - min; } } } } return parseInt(value, 10); } else { return value; } } function digitRegex2({ numberingSystem }, append = "") { return new RegExp(`${numberingSystems2[numberingSystem || "latn"]}${append}`); } var MISSING_FTP2 = "missing Intl.DateTimeFormat.formatToParts support"; function intUnit2(regex, post = (i) => i) { return { regex, deser: ([s3]) => post(parseDigits2(s3)) }; } var NBSP2 = String.fromCharCode(160); var spaceOrNBSP2 = `[ ${NBSP2}]`; var spaceOrNBSPRegExp2 = new RegExp(spaceOrNBSP2, "g"); function fixListRegex2(s3) { return s3.replace(/\./g, "\\.?").replace(spaceOrNBSPRegExp2, spaceOrNBSP2); } function stripInsensitivities2(s3) { return s3.replace(/\./g, "").replace(spaceOrNBSPRegExp2, " ").toLowerCase(); } function oneOf2(strings, startIndex) { if (strings === null) { return null; } else { return { regex: RegExp(strings.map(fixListRegex2).join("|")), deser: ([s3]) => strings.findIndex((i) => stripInsensitivities2(s3) === stripInsensitivities2(i)) + startIndex }; } } function offset2(regex, groups) { return { regex, deser: ([, h, m]) => signedOffset2(h, m), groups }; } function simple2(regex) { return { regex, deser: ([s3]) => s3 }; } function escapeToken2(value) { return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"); } function unitForToken2(token, loc) { const one = digitRegex2(loc), two = digitRegex2(loc, "{2}"), three = digitRegex2(loc, "{3}"), four = digitRegex2(loc, "{4}"), six = digitRegex2(loc, "{6}"), oneOrTwo = digitRegex2(loc, "{1,2}"), oneToThree = digitRegex2(loc, "{1,3}"), oneToSix = digitRegex2(loc, "{1,6}"), oneToNine = digitRegex2(loc, "{1,9}"), twoToFour = digitRegex2(loc, "{2,4}"), fourToSix = digitRegex2(loc, "{4,6}"), literal = (t) => ({ regex: RegExp(escapeToken2(t.val)), deser: ([s3]) => s3, literal: true }), unitate = (t) => { if (token.literal) { return literal(t); } switch (t.val) { case "G": return oneOf2(loc.eras("short"), 0); case "GG": return oneOf2(loc.eras("long"), 0); case "y": return intUnit2(oneToSix); case "yy": return intUnit2(twoToFour, untruncateYear2); case "yyyy": return intUnit2(four); case "yyyyy": return intUnit2(fourToSix); case "yyyyyy": return intUnit2(six); case "M": return intUnit2(oneOrTwo); case "MM": return intUnit2(two); case "MMM": return oneOf2(loc.months("short", true), 1); case "MMMM": return oneOf2(loc.months("long", true), 1); case "L": return intUnit2(oneOrTwo); case "LL": return intUnit2(two); case "LLL": return oneOf2(loc.months("short", false), 1); case "LLLL": return oneOf2(loc.months("long", false), 1); case "d": return intUnit2(oneOrTwo); case "dd": return intUnit2(two); case "o": return intUnit2(oneToThree); case "ooo": return intUnit2(three); case "HH": return intUnit2(two); case "H": return intUnit2(oneOrTwo); case "hh": return intUnit2(two); case "h": return intUnit2(oneOrTwo); case "mm": return intUnit2(two); case "m": return intUnit2(oneOrTwo); case "q": return intUnit2(oneOrTwo); case "qq": return intUnit2(two); case "s": return intUnit2(oneOrTwo); case "ss": return intUnit2(two); case "S": return intUnit2(oneToThree); case "SSS": return intUnit2(three); case "u": return simple2(oneToNine); case "uu": return simple2(oneOrTwo); case "uuu": return intUnit2(one); case "a": return oneOf2(loc.meridiems(), 0); case "kkkk": return intUnit2(four); case "kk": return intUnit2(twoToFour, untruncateYear2); case "W": return intUnit2(oneOrTwo); case "WW": return intUnit2(two); case "E": case "c": return intUnit2(one); case "EEE": return oneOf2(loc.weekdays("short", false), 1); case "EEEE": return oneOf2(loc.weekdays("long", false), 1); case "ccc": return oneOf2(loc.weekdays("short", true), 1); case "cccc": return oneOf2(loc.weekdays("long", true), 1); case "Z": case "ZZ": return offset2(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2); case "ZZZ": return offset2(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2); case "z": return simple2(/[a-z_+-/]{1,256}?/i); case " ": return simple2(/[^\S\n\r]/); default: return literal(t); } }; const unit = unitate(token) || { invalidReason: MISSING_FTP2 }; unit.token = token; return unit; } var partTypeStyleToTokenVal2 = { year: { "2-digit": "yy", numeric: "yyyyy" }, month: { numeric: "M", "2-digit": "MM", short: "MMM", long: "MMMM" }, day: { numeric: "d", "2-digit": "dd" }, weekday: { short: "EEE", long: "EEEE" }, dayperiod: "a", dayPeriod: "a", hour12: { numeric: "h", "2-digit": "hh" }, hour24: { numeric: "H", "2-digit": "HH" }, minute: { numeric: "m", "2-digit": "mm" }, second: { numeric: "s", "2-digit": "ss" }, timeZoneName: { long: "ZZZZZ", short: "ZZZ" } }; function tokenForPart2(part, formatOpts, resolvedOpts) { const { type, value } = part; if (type === "literal") { const isSpace = /^\s+$/.test(value); return { literal: !isSpace, val: isSpace ? " " : value }; } const style = formatOpts[type]; let actualType = type; if (type === "hour") { if (formatOpts.hour12 != null) { actualType = formatOpts.hour12 ? "hour12" : "hour24"; } else if (formatOpts.hourCycle != null) { if (formatOpts.hourCycle === "h11" || formatOpts.hourCycle === "h12") { actualType = "hour12"; } else { actualType = "hour24"; } } else { actualType = resolvedOpts.hour12 ? "hour12" : "hour24"; } } let val = partTypeStyleToTokenVal2[actualType]; if (typeof val === "object") { val = val[style]; } if (val) { return { literal: false, val }; } return void 0; } function buildRegex2(units) { const re = units.map((u) => u.regex).reduce((f, r) => `${f}(${r.source})`, ""); return [`^${re}$`, units]; } function match2(input, regex, handlers) { const matches = input.match(regex); if (matches) { const all = {}; let matchIndex = 1; for (const i in handlers) { if (hasOwnProperty2(handlers, i)) { const h = handlers[i], groups = h.groups ? h.groups + 1 : 1; if (!h.literal && h.token) { all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups)); } matchIndex += groups; } } return [matches, all]; } else { return [matches, {}]; } } function dateTimeFromMatches2(matches) { const toField = (token) => { switch (token) { case "S": return "millisecond"; case "s": return "second"; case "m": return "minute"; case "h": case "H": return "hour"; case "d": return "day"; case "o": return "ordinal"; case "L": case "M": return "month"; case "y": return "year"; case "E": case "c": return "weekday"; case "W": return "weekNumber"; case "k": return "weekYear"; case "q": return "quarter"; default: return null; } }; let zone = null; let specificOffset; if (!isUndefined2(matches.z)) { zone = IANAZone2.create(matches.z); } if (!isUndefined2(matches.Z)) { if (!zone) { zone = new FixedOffsetZone2(matches.Z); } specificOffset = matches.Z; } if (!isUndefined2(matches.q)) { matches.M = (matches.q - 1) * 3 + 1; } if (!isUndefined2(matches.h)) { if (matches.h < 12 && matches.a === 1) { matches.h += 12; } else if (matches.h === 12 && matches.a === 0) { matches.h = 0; } } if (matches.G === 0 && matches.y) { matches.y = -matches.y; } if (!isUndefined2(matches.u)) { matches.S = parseMillis2(matches.u); } const vals = Object.keys(matches).reduce((r, k) => { const f = toField(k); if (f) { r[f] = matches[k]; } return r; }, {}); return [vals, zone, specificOffset]; } var dummyDateTimeCache2 = null; function getDummyDateTime2() { if (!dummyDateTimeCache2) { dummyDateTimeCache2 = DateTime2.fromMillis(1555555555555); } return dummyDateTimeCache2; } function maybeExpandMacroToken2(token, locale) { if (token.literal) { return token; } const formatOpts = Formatter2.macroTokenToFormatOpts(token.val); const tokens = formatOptsToTokens2(formatOpts, locale); if (tokens == null || tokens.includes(void 0)) { return token; } return tokens; } function expandMacroTokens2(tokens, locale) { return Array.prototype.concat(...tokens.map((t) => maybeExpandMacroToken2(t, locale))); } function explainFromTokens2(locale, input, format) { const tokens = expandMacroTokens2(Formatter2.parseFormat(format), locale), units = tokens.map((t) => unitForToken2(t, locale)), disqualifyingUnit = units.find((t) => t.invalidReason); if (disqualifyingUnit) { return { input, tokens, invalidReason: disqualifyingUnit.invalidReason }; } else { const [regexString, handlers] = buildRegex2(units), regex = RegExp(regexString, "i"), [rawMatches, matches] = match2(input, regex, handlers), [result, zone, specificOffset] = matches ? dateTimeFromMatches2(matches) : [null, null, void 0]; if (hasOwnProperty2(matches, "a") && hasOwnProperty2(matches, "H")) { throw new ConflictingSpecificationError2( "Can't include meridiem when specifying 24-hour format" ); } return { input, tokens, regex, rawMatches, matches, result, zone, specificOffset }; } } function parseFromTokens2(locale, input, format) { const { result, zone, specificOffset, invalidReason } = explainFromTokens2(locale, input, format); return [result, zone, specificOffset, invalidReason]; } function formatOptsToTokens2(formatOpts, locale) { if (!formatOpts) { return null; } const formatter = Formatter2.create(locale, formatOpts); const df = formatter.dtFormatter(getDummyDateTime2()); const parts = df.formatToParts(); const resolvedOpts = df.resolvedOptions(); return parts.map((p) => tokenForPart2(p, formatOpts, resolvedOpts)); } var nonLeapLadder2 = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334]; var leapLadder2 = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335]; function unitOutOfRange2(unit, value) { return new Invalid2( "unit out of range", `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid` ); } function dayOfWeek2(year, month, day) { const d = new Date(Date.UTC(year, month - 1, day)); if (year < 100 && year >= 0) { d.setUTCFullYear(d.getUTCFullYear() - 1900); } const js = d.getUTCDay(); return js === 0 ? 7 : js; } function computeOrdinal2(year, month, day) { return day + (isLeapYear2(year) ? leapLadder2 : nonLeapLadder2)[month - 1]; } function uncomputeOrdinal2(year, ordinal) { const table = isLeapYear2(year) ? leapLadder2 : nonLeapLadder2, month0 = table.findIndex((i) => i < ordinal), day = ordinal - table[month0]; return { month: month0 + 1, day }; } function gregorianToWeek2(gregObj) { const { year, month, day } = gregObj, ordinal = computeOrdinal2(year, month, day), weekday = dayOfWeek2(year, month, day); let weekNumber = Math.floor((ordinal - weekday + 10) / 7), weekYear; if (weekNumber < 1) { weekYear = year - 1; weekNumber = weeksInWeekYear2(weekYear); } else if (weekNumber > weeksInWeekYear2(year)) { weekYear = year + 1; weekNumber = 1; } else { weekYear = year; } return { weekYear, weekNumber, weekday, ...timeObject2(gregObj) }; } function weekToGregorian2(weekData) { const { weekYear, weekNumber, weekday } = weekData, weekdayOfJan4 = dayOfWeek2(weekYear, 1, 4), yearInDays = daysInYear2(weekYear); let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 3, year; if (ordinal < 1) { year = weekYear - 1; ordinal += daysInYear2(year); } else if (ordinal > yearInDays) { year = weekYear + 1; ordinal -= daysInYear2(weekYear); } else { year = weekYear; } const { month, day } = uncomputeOrdinal2(year, ordinal); return { year, month, day, ...timeObject2(weekData) }; } function gregorianToOrdinal2(gregData) { const { year, month, day } = gregData; const ordinal = computeOrdinal2(year, month, day); return { year, ordinal, ...timeObject2(gregData) }; } function ordinalToGregorian2(ordinalData) { const { year, ordinal } = ordinalData; const { month, day } = uncomputeOrdinal2(year, ordinal); return { year, month, day, ...timeObject2(ordinalData) }; } function hasInvalidWeekData2(obj) { const validYear = isInteger2(obj.weekYear), validWeek = integerBetween2(obj.weekNumber, 1, weeksInWeekYear2(obj.weekYear)), validWeekday = integerBetween2(obj.weekday, 1, 7); if (!validYear) { return unitOutOfRange2("weekYear", obj.weekYear); } else if (!validWeek) { return unitOutOfRange2("week", obj.week); } else if (!validWeekday) { return unitOutOfRange2("weekday", obj.weekday); } else return false; } function hasInvalidOrdinalData2(obj) { const validYear = isInteger2(obj.year), validOrdinal = integerBetween2(obj.ordinal, 1, daysInYear2(obj.year)); if (!validYear) { return unitOutOfRange2("year", obj.year); } else if (!validOrdinal) { return unitOutOfRange2("ordinal", obj.ordinal); } else return false; } function hasInvalidGregorianData2(obj) { const validYear = isInteger2(obj.year), validMonth = integerBetween2(obj.month, 1, 12), validDay = integerBetween2(obj.day, 1, daysInMonth2(obj.year, obj.month)); if (!validYear) { return unitOutOfRange2("year", obj.year); } else if (!validMonth) { return unitOutOfRange2("month", obj.month); } else if (!validDay) { return unitOutOfRange2("day", obj.day); } else return false; } function hasInvalidTimeData2(obj) { const { hour, minute, second, millisecond } = obj; const validHour = integerBetween2(hour, 0, 23) || hour === 24 && minute === 0 && second === 0 && millisecond === 0, validMinute = integerBetween2(minute, 0, 59), validSecond = integerBetween2(second, 0, 59), validMillisecond = integerBetween2(millisecond, 0, 999); if (!validHour) { return unitOutOfRange2("hour", hour); } else if (!validMinute) { return unitOutOfRange2("minute", minute); } else if (!validSecond) { return unitOutOfRange2("second", second); } else if (!validMillisecond) { return unitOutOfRange2("millisecond", millisecond); } else return false; } var INVALID4 = "Invalid DateTime"; var MAX_DATE2 = 864e13; function unsupportedZone2(zone) { return new Invalid2("unsupported zone", `the zone "${zone.name}" is not supported`); } function possiblyCachedWeekData2(dt) { if (dt.weekData === null) { dt.weekData = gregorianToWeek2(dt.c); } return dt.weekData; } function clone3(inst, alts) { const current2 = { ts: inst.ts, zone: inst.zone, c: inst.c, o: inst.o, loc: inst.loc, invalid: inst.invalid }; return new DateTime2({ ...current2, ...alts, old: current2 }); } function fixOffset2(localTS, o, tz) { let utcGuess = localTS - o * 60 * 1e3; const o2 = tz.offset(utcGuess); if (o === o2) { return [utcGuess, o]; } utcGuess -= (o2 - o) * 60 * 1e3; const o3 = tz.offset(utcGuess); if (o2 === o3) { return [utcGuess, o2]; } return [localTS - Math.min(o2, o3) * 60 * 1e3, Math.max(o2, o3)]; } function tsToObj2(ts, offset3) { ts += offset3 * 60 * 1e3; const 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() }; } function objToTS2(obj, offset3, zone) { return fixOffset2(objToLocalTS2(obj), offset3, zone); } function adjustTime2(inst, dur) { const 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 = { ...inst.c, year, month, day: Math.min(inst.c.day, daysInMonth2(year, month)) + Math.trunc(dur.days) + Math.trunc(dur.weeks) * 7 }, millisToAdd = Duration3.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 = objToLocalTS2(c); let [ts, o] = fixOffset2(localTS, oPre, inst.zone); if (millisToAdd !== 0) { ts += millisToAdd; o = inst.zone.offset(ts); } return { ts, o }; } function parseDataToDateTime2(parsed, parsedZone, opts, format, text, specificOffset) { const { setZone, zone } = opts; if (parsed && Object.keys(parsed).length !== 0 || parsedZone) { const interpretationZone = parsedZone || zone, inst = DateTime2.fromObject(parsed, { ...opts, zone: interpretationZone, specificOffset }); return setZone ? inst : inst.setZone(zone); } else { return DateTime2.invalid( new Invalid2("unparsable", `the input "${text}" can't be parsed as ${format}`) ); } } function toTechFormat2(dt, format, allowZ = true) { return dt.isValid ? Formatter2.create(Locale2.create("en-US"), { allowZ, forceSimple: true }).formatDateTimeFromString(dt, format) : null; } function toISODate2(o, extended) { const longFormat = o.c.year > 9999 || o.c.year < 0; let c = ""; if (longFormat && o.c.year >= 0) c += "+"; c += padStart2(o.c.year, longFormat ? 6 : 4); if (extended) { c += "-"; c += padStart2(o.c.month); c += "-"; c += padStart2(o.c.day); } else { c += padStart2(o.c.month); c += padStart2(o.c.day); } return c; } function toISOTime2(o, extended, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone) { let c = padStart2(o.c.hour); if (extended) { c += ":"; c += padStart2(o.c.minute); if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) { c += ":"; } } else { c += padStart2(o.c.minute); } if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) { c += padStart2(o.c.second); if (o.c.millisecond !== 0 || !suppressMilliseconds) { c += "."; c += padStart2(o.c.millisecond, 3); } } if (includeOffset) { if (o.isOffsetFixed && o.offset === 0 && !extendedZone) { c += "Z"; } else if (o.o < 0) { c += "-"; c += padStart2(Math.trunc(-o.o / 60)); c += ":"; c += padStart2(Math.trunc(-o.o % 60)); } else { c += "+"; c += padStart2(Math.trunc(o.o / 60)); c += ":"; c += padStart2(Math.trunc(o.o % 60)); } } if (extendedZone) { c += "[" + o.zone.ianaName + "]"; } return c; } var defaultUnitValues2 = { month: 1, day: 1, hour: 0, minute: 0, second: 0, millisecond: 0 }; var defaultWeekUnitValues2 = { weekNumber: 1, weekday: 1, hour: 0, minute: 0, second: 0, millisecond: 0 }; var defaultOrdinalUnitValues2 = { ordinal: 1, hour: 0, minute: 0, second: 0, millisecond: 0 }; var orderedUnits3 = ["year", "month", "day", "hour", "minute", "second", "millisecond"]; var orderedWeekUnits2 = [ "weekYear", "weekNumber", "weekday", "hour", "minute", "second", "millisecond" ]; var orderedOrdinalUnits2 = ["year", "ordinal", "hour", "minute", "second", "millisecond"]; function normalizeUnit2(unit) { const 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 InvalidUnitError2(unit); return normalized; } function quickDT2(obj, opts) { const zone = normalizeZone2(opts.zone, Settings2.defaultZone), loc = Locale2.fromObject(opts), tsNow = Settings2.now(); let ts, o; if (!isUndefined2(obj.year)) { for (const u of orderedUnits3) { if (isUndefined2(obj[u])) { obj[u] = defaultUnitValues2[u]; } } const invalid = hasInvalidGregorianData2(obj) || hasInvalidTimeData2(obj); if (invalid) { return DateTime2.invalid(invalid); } const offsetProvis = zone.offset(tsNow); [ts, o] = objToTS2(obj, offsetProvis, zone); } else { ts = tsNow; } return new DateTime2({ ts, zone, loc, o }); } function diffRelative2(start, end, opts) { const round = isUndefined2(opts.round) ? true : opts.round, format = (c, unit) => { c = roundTo2(c, round || opts.calendary ? 0 : 2, true); const formatter = end.loc.clone(opts).relFormatter(opts); return formatter.format(c, unit); }, 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); } for (const unit of opts.units) { const count = differ(unit); if (Math.abs(count) >= 1) { return format(count, unit); } } return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]); } function lastOpts2(argList) { let 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]; } var DateTime2 = class _DateTime { /** * @access private */ constructor(config) { const zone = config.zone || Settings2.defaultZone; let invalid = config.invalid || (Number.isNaN(config.ts) ? new Invalid2("invalid input") : null) || (!zone.isValid ? unsupportedZone2(zone) : null); this.ts = isUndefined2(config.ts) ? Settings2.now() : config.ts; let c = null, o = null; if (!invalid) { const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone); if (unchanged) { [c, o] = [config.old.c, config.old.o]; } else { const ot = zone.offset(this.ts); c = tsToObj2(this.ts, ot); invalid = Number.isNaN(c.year) ? new Invalid2("invalid input") : null; c = invalid ? null : c; o = invalid ? null : ot; } } this._zone = zone; this.loc = config.loc || Locale2.create(); this.invalid = invalid; this.weekData = null; this.c = c; this.o = o; 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} */ static now() { return new _DateTime({}); } /** * Create a local DateTime * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used * @param {number} [month=1] - The month, 1-indexed * @param {number} [day=1] - The day of the month, 1-indexed * @param {number} [hour=0] - The hour of the day, in 24-hour time * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59 * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59 * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999 * @example DateTime.local() //~> now * @example DateTime.local({ zone: "America/New_York" }) //~> now, in US east coast time * @example DateTime.local(2017) //~> 2017-01-01T00:00:00 * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00 * @example DateTime.local(2017, 3, 12, { locale: "fr" }) //~> 2017-03-12T00:00:00, with a French locale * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00 * @example DateTime.local(2017, 3, 12, 5, { zone: "utc" }) //~> 2017-03-12T05:00:00, in UTC * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00 * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10 * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765 * @return {DateTime} */ static local() { const [opts, args] = lastOpts2(arguments), [year, month, day, hour, minute, second, millisecond] = args; return quickDT2({ year, month, day, hour, minute, second, millisecond }, opts); } /** * Create a DateTime in UTC * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used * @param {number} [month=1] - The month, 1-indexed * @param {number} [day=1] - The day of the month * @param {number} [hour=0] - The hour of the day, in 24-hour time * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59 * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59 * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999 * @param {Object} options - configuration options for the DateTime * @param {string} [options.locale] - a locale to set on the resulting DateTime instance * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance * @example DateTime.utc() //~> now * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: "fr" }) //~> 2017-03-12T05:45:00Z with a French locale * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: "fr" }) //~> 2017-03-12T05:45:10.765Z with a French locale * @return {DateTime} */ static utc() { const [opts, args] = lastOpts2(arguments), [year, month, day, hour, minute, second, millisecond] = args; opts.zone = FixedOffsetZone2.utcInstance; return quickDT2({ year, month, day, hour, minute, second, millisecond }, opts); } /** * Create a DateTime from a JavaScript Date object. Uses the default zone. * @param {Date} date - a JavaScript Date object * @param {Object} options - configuration options for the DateTime * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into * @return {DateTime} */ static fromJSDate(date, options = {}) { const ts = isDate2(date) ? date.valueOf() : NaN; if (Number.isNaN(ts)) { return _DateTime.invalid("invalid input"); } const zoneToUse = normalizeZone2(options.zone, Settings2.defaultZone); if (!zoneToUse.isValid) { return _DateTime.invalid(unsupportedZone2(zoneToUse)); } return new _DateTime({ ts, zone: zoneToUse, loc: Locale2.fromObject(options) }); } /** * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone. * @param {number} milliseconds - a number of milliseconds since 1970 UTC * @param {Object} options - configuration options for the DateTime * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into * @param {string} [options.locale] - a locale to set on the resulting DateTime instance * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance * @return {DateTime} */ static fromMillis(milliseconds, options = {}) { if (!isNumber2(milliseconds)) { throw new InvalidArgumentError2( `fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}` ); } else if (milliseconds < -MAX_DATE2 || milliseconds > MAX_DATE2) { return _DateTime.invalid("Timestamp out of range"); } else { return new _DateTime({ ts: milliseconds, zone: normalizeZone2(options.zone, Settings2.defaultZone), loc: Locale2.fromObject(options) }); } } /** * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone. * @param {number} seconds - a number of seconds since 1970 UTC * @param {Object} options - configuration options for the DateTime * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into * @param {string} [options.locale] - a locale to set on the resulting DateTime instance * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance * @return {DateTime} */ static fromSeconds(seconds, options = {}) { if (!isNumber2(seconds)) { throw new InvalidArgumentError2("fromSeconds requires a numerical input"); } else { return new _DateTime({ ts: seconds * 1e3, zone: normalizeZone2(options.zone, Settings2.defaultZone), loc: Locale2.fromObject(options) }); } } /** * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults. * @param {Object} obj - the object to create the DateTime from * @param {number} obj.year - a year, such as 1987 * @param {number} obj.month - a month, 1-12 * @param {number} obj.day - a day of the month, 1-31, depending on the month * @param {number} obj.ordinal - day of the year, 1-365 or 366 * @param {number} obj.weekYear - an ISO week year * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday * @param {number} obj.hour - hour of the day, 0-23 * @param {number} obj.minute - minute of the hour, 0-59 * @param {number} obj.second - second of the minute, 0-59 * @param {number} obj.millisecond - millisecond of the second, 0-999 * @param {Object} opts - options for creating this DateTime * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone() * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25' * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01' * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06 * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }), * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' }) * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' }) * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13' * @return {DateTime} */ static fromObject(obj, opts = {}) { obj = obj || {}; const zoneToUse = normalizeZone2(opts.zone, Settings2.defaultZone); if (!zoneToUse.isValid) { return _DateTime.invalid(unsupportedZone2(zoneToUse)); } const tsNow = Settings2.now(), offsetProvis = !isUndefined2(opts.specificOffset) ? opts.specificOffset : zoneToUse.offset(tsNow), normalized = normalizeObject2(obj, normalizeUnit2), containsOrdinal = !isUndefined2(normalized.ordinal), containsGregorYear = !isUndefined2(normalized.year), containsGregorMD = !isUndefined2(normalized.month) || !isUndefined2(normalized.day), containsGregor = containsGregorYear || containsGregorMD, definiteWeekDef = normalized.weekYear || normalized.weekNumber, loc = Locale2.fromObject(opts); if ((containsGregor || containsOrdinal) && definiteWeekDef) { throw new ConflictingSpecificationError2( "Can't mix weekYear/weekNumber units with year/month/day or ordinals" ); } if (containsGregorMD && containsOrdinal) { throw new ConflictingSpecificationError2("Can't mix ordinal dates with month/day"); } const useWeekData = definiteWeekDef || normalized.weekday && !containsGregor; let units, defaultValues, objNow = tsToObj2(tsNow, offsetProvis); if (useWeekData) { units = orderedWeekUnits2; defaultValues = defaultWeekUnitValues2; objNow = gregorianToWeek2(objNow); } else if (containsOrdinal) { units = orderedOrdinalUnits2; defaultValues = defaultOrdinalUnitValues2; objNow = gregorianToOrdinal2(objNow); } else { units = orderedUnits3; defaultValues = defaultUnitValues2; } let foundFirst = false; for (const u of units) { const v = normalized[u]; if (!isUndefined2(v)) { foundFirst = true; } else if (foundFirst) { normalized[u] = defaultValues[u]; } else { normalized[u] = objNow[u]; } } const higherOrderInvalid = useWeekData ? hasInvalidWeekData2(normalized) : containsOrdinal ? hasInvalidOrdinalData2(normalized) : hasInvalidGregorianData2(normalized), invalid = higherOrderInvalid || hasInvalidTimeData2(normalized); if (invalid) { return _DateTime.invalid(invalid); } const gregorian = useWeekData ? weekToGregorian2(normalized) : containsOrdinal ? ordinalToGregorian2(normalized) : normalized, [tsFinal, offsetFinal] = objToTS2(gregorian, offsetProvis, zoneToUse), inst = new _DateTime({ ts: tsFinal, zone: zoneToUse, o: offsetFinal, loc }); if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) { return _DateTime.invalid( "mismatched weekday", `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}` ); } return inst; } /** * Create a DateTime from an ISO 8601 string * @param {string} text - the ISO string * @param {Object} opts - options to affect the creation * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance * @example DateTime.fromISO('2016-05-25T09:08:34.123') * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00') * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true}) * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'}) * @example DateTime.fromISO('2016-W05-4') * @return {DateTime} */ static fromISO(text, opts = {}) { const [vals, parsedZone] = parseISODate2(text); return parseDataToDateTime2(vals, parsedZone, opts, "ISO 8601", text); } /** * Create a DateTime from an RFC 2822 string * @param {string} text - the RFC 2822 string * @param {Object} opts - options to affect the creation * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in. * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT') * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600') * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z') * @return {DateTime} */ static fromRFC2822(text, opts = {}) { const [vals, parsedZone] = parseRFC2822Date2(text); return parseDataToDateTime2(vals, parsedZone, opts, "RFC 2822", text); } /** * Create a DateTime from an HTTP header date * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1 * @param {string} text - the HTTP header date * @param {Object} opts - options to affect the creation * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in. * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods. * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT') * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT') * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994') * @return {DateTime} */ static fromHTTP(text, opts = {}) { const [vals, parsedZone] = parseHTTPDate2(text); return parseDataToDateTime2(vals, parsedZone, opts, "HTTP", opts); } /** * Create a DateTime from an input string and format string. * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens). * @param {string} text - the string to parse * @param {string} fmt - the format the string is expected to be in (see the link below for the formats) * @param {Object} opts - options to affect the creation * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance * @return {DateTime} */ static fromFormat(text, fmt, opts = {}) { if (isUndefined2(text) || isUndefined2(fmt)) { throw new InvalidArgumentError2("fromFormat requires an input string and a format"); } const { locale = null, numberingSystem = null } = opts, localeToUse = Locale2.fromOpts({ locale, numberingSystem, defaultToEN: true }), [vals, parsedZone, specificOffset, invalid] = parseFromTokens2(localeToUse, text, fmt); if (invalid) { return _DateTime.invalid(invalid); } else { return parseDataToDateTime2(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset); } } /** * @deprecated use fromFormat instead */ static fromString(text, fmt, opts = {}) { return _DateTime.fromFormat(text, fmt, opts); } /** * Create a DateTime from a SQL date, time, or datetime * Defaults to en-US if no locale has been specified, regardless of the system's locale * @param {string} text - the string to parse * @param {Object} opts - options to affect the creation * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance * @example DateTime.fromSQL('2017-05-15') * @example DateTime.fromSQL('2017-05-15 09:12:34') * @example DateTime.fromSQL('2017-05-15 09:12:34.342') * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00') * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles') * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true }) * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' }) * @example DateTime.fromSQL('09:12:34.342') * @return {DateTime} */ static fromSQL(text, opts = {}) { const [vals, parsedZone] = parseSQL2(text); return parseDataToDateTime2(vals, parsedZone, opts, "SQL", text); } /** * Create an invalid DateTime. * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent. * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information * @return {DateTime} */ static invalid(reason, explanation = null) { if (!reason) { throw new InvalidArgumentError2("need to specify a reason the DateTime is invalid"); } const invalid = reason instanceof Invalid2 ? reason : new Invalid2(reason, explanation); if (Settings2.throwOnInvalid) { throw new InvalidDateTimeError2(invalid); } else { return new _DateTime({ invalid }); } } /** * Check if an object is an instance of DateTime. Works across context boundaries * @param {object} o * @return {boolean} */ static isDateTime(o) { return o && o.isLuxonDateTime || false; } /** * Produce the format string for a set of options * @param formatOpts * @param localeOpts * @returns {string} */ static parseFormatForOpts(formatOpts, localeOpts = {}) { const tokenList = formatOptsToTokens2(formatOpts, Locale2.fromObject(localeOpts)); return !tokenList ? null : tokenList.map((t) => t ? t.val : null).join(""); } /** * Produce the the fully expanded format token for the locale * Does NOT quote characters, so quoted tokens will not round trip correctly * @param fmt * @param localeOpts * @returns {string} */ static expandFormat(fmt, localeOpts = {}) { const expanded = expandMacroTokens2(Formatter2.parseFormat(fmt), Locale2.fromObject(localeOpts)); return expanded.map((t) => t.val).join(""); } // 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} */ 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} */ get isValid() { return this.invalid === null; } /** * Returns an error code if this DateTime is invalid, or null if the DateTime is valid * @type {string} */ get invalidReason() { 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} */ get invalidExplanation() { 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} */ get locale() { 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} */ get numberingSystem() { 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} */ get outputCalendar() { return this.isValid ? this.loc.outputCalendar : null; } /** * Get the time zone associated with this DateTime. * @type {Zone} */ get zone() { return this._zone; } /** * Get the name of the time zone. * @type {string} */ get zoneName() { return this.isValid ? this.zone.name : null; } /** * Get the year * @example DateTime.local(2017, 5, 25).year //=> 2017 * @type {number} */ get year() { return this.isValid ? this.c.year : NaN; } /** * Get the quarter * @example DateTime.local(2017, 5, 25).quarter //=> 2 * @type {number} */ get quarter() { 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} */ get month() { 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} */ get day() { 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} */ get hour() { 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} */ get minute() { 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} */ get second() { 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} */ get millisecond() { 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} */ get weekYear() { return this.isValid ? possiblyCachedWeekData2(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} */ get weekNumber() { return this.isValid ? possiblyCachedWeekData2(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} */ get weekday() { return this.isValid ? possiblyCachedWeekData2(this).weekday : NaN; } /** * Get the ordinal (meaning the day of the year) * @example DateTime.local(2017, 5, 25).ordinal //=> 145 * @type {number|DateTime} */ get ordinal() { return this.isValid ? gregorianToOrdinal2(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} */ get monthShort() { return this.isValid ? Info2.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} */ get monthLong() { return this.isValid ? Info2.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} */ get weekdayShort() { return this.isValid ? Info2.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} */ get weekdayLong() { return this.isValid ? Info2.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} */ get offset() { 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} */ get offsetNameShort() { 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} */ get offsetNameLong() { 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} */ get isOffsetFixed() { return this.isValid ? this.zone.isUniversal : null; } /** * Get whether the DateTime is in a DST. * @type {boolean} */ get isInDST() { if (this.isOffsetFixed) { return false; } else { return this.offset > this.set({ month: 1, day: 1 }).offset || this.offset > this.set({ month: 5 }).offset; } } /** * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC * in this DateTime's zone. During DST changes local time can be ambiguous, for example * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`. * This method will return both possible DateTimes if this DateTime's local time is ambiguous. * @returns {DateTime[]} */ getPossibleOffsets() { if (!this.isValid || this.isOffsetFixed) { return [this]; } const dayMs = 864e5; const minuteMs = 6e4; const localTS = objToLocalTS2(this.c); const oEarlier = this.zone.offset(localTS - dayMs); const oLater = this.zone.offset(localTS + dayMs); const o1 = this.zone.offset(localTS - oEarlier * minuteMs); const o2 = this.zone.offset(localTS - oLater * minuteMs); if (o1 === o2) { return [this]; } const ts1 = localTS - o1 * minuteMs; const ts2 = localTS - o2 * minuteMs; const c1 = tsToObj2(ts1, o1); const c2 = tsToObj2(ts2, o2); if (c1.hour === c2.hour && c1.minute === c2.minute && c1.second === c2.second && c1.millisecond === c2.millisecond) { return [clone3(this, { ts: ts1 }), clone3(this, { ts: ts2 })]; } return [this]; } /** * 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} */ get isInLeapYear() { return isLeapYear2(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} */ get daysInMonth() { return daysInMonth2(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} */ get daysInYear() { return this.isValid ? daysInYear2(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} */ get weeksInWeekYear() { return this.isValid ? weeksInWeekYear2(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} */ resolvedLocaleOptions(opts = {}) { const { locale, numberingSystem, calendar } = Formatter2.create( this.loc.clone(opts), opts ).resolvedOptions(this); return { locale, 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} */ toUTC(offset3 = 0, opts = {}) { return this.setZone(FixedOffsetZone2.instance(offset3), opts); } /** * "Set" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime. * * Equivalent to `setZone('local')` * @return {DateTime} */ toLocal() { return this.setZone(Settings2.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} */ setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) { zone = normalizeZone2(zone, Settings2.defaultZone); if (zone.equals(this.zone)) { return this; } else if (!zone.isValid) { return _DateTime.invalid(unsupportedZone2(zone)); } else { let newTS = this.ts; if (keepLocalTime || keepCalendarTime) { const offsetGuess = zone.offset(this.ts); const asObj = this.toObject(); [newTS] = objToTS2(asObj, offsetGuess, zone); } return clone3(this, { ts: newTS, 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} */ reconfigure({ locale, numberingSystem, outputCalendar } = {}) { const loc = this.loc.clone({ locale, numberingSystem, outputCalendar }); return clone3(this, { 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} */ setLocale(locale) { return this.reconfigure({ 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} */ set(values) { if (!this.isValid) return this; const normalized = normalizeObject2(values, normalizeUnit2), settingWeekStuff = !isUndefined2(normalized.weekYear) || !isUndefined2(normalized.weekNumber) || !isUndefined2(normalized.weekday), containsOrdinal = !isUndefined2(normalized.ordinal), containsGregorYear = !isUndefined2(normalized.year), containsGregorMD = !isUndefined2(normalized.month) || !isUndefined2(normalized.day), containsGregor = containsGregorYear || containsGregorMD, definiteWeekDef = normalized.weekYear || normalized.weekNumber; if ((containsGregor || containsOrdinal) && definiteWeekDef) { throw new ConflictingSpecificationError2( "Can't mix weekYear/weekNumber units with year/month/day or ordinals" ); } if (containsGregorMD && containsOrdinal) { throw new ConflictingSpecificationError2("Can't mix ordinal dates with month/day"); } let mixed; if (settingWeekStuff) { mixed = weekToGregorian2({ ...gregorianToWeek2(this.c), ...normalized }); } else if (!isUndefined2(normalized.ordinal)) { mixed = ordinalToGregorian2({ ...gregorianToOrdinal2(this.c), ...normalized }); } else { mixed = { ...this.toObject(), ...normalized }; if (isUndefined2(normalized.day)) { mixed.day = Math.min(daysInMonth2(mixed.year, mixed.month), mixed.day); } } const [ts, o] = objToTS2(mixed, this.o, this.zone); return clone3(this, { ts, 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 * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min * @return {DateTime} */ plus(duration) { if (!this.isValid) return this; const dur = Duration3.fromDurationLike(duration); return clone3(this, adjustTime2(this, dur)); } /** * Subtract a period of time to this DateTime and return the resulting DateTime * See {@link DateTime#plus} * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() @return {DateTime} */ minus(duration) { if (!this.isValid) return this; const dur = Duration3.fromDurationLike(duration).negate(); return clone3(this, adjustTime2(this, dur)); } /** * "Set" this DateTime to the beginning of a unit of time. * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'. * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01' * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01' * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00' * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00' * @return {DateTime} */ startOf(unit) { if (!this.isValid) return this; const o = {}, normalizedUnit = Duration3.normalizeUnit(unit); switch (normalizedUnit) { case "years": o.month = 1; case "quarters": case "months": o.day = 1; case "weeks": case "days": o.hour = 0; case "hours": o.minute = 0; case "minutes": o.second = 0; case "seconds": o.millisecond = 0; break; } if (normalizedUnit === "weeks") { o.weekday = 1; } if (normalizedUnit === "quarters") { const q = Math.ceil(this.month / 3); o.month = (q - 1) * 3 + 1; } return this.set(o); } /** * "Set" this DateTime to the end (meaning the last millisecond) of a unit of time * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'. * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00' * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00' * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00' * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00' * @return {DateTime} */ endOf(unit) { return this.isValid ? this.plus({ [unit]: 1 }).startOf(unit).minus(1) : this; } // OUTPUT /** * Returns a string representation of this DateTime formatted according to the specified format string. * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens). * Defaults to en-US if no locale has been specified, regardless of the system's locale. * @param {string} fmt - the format string * @param {Object} opts - opts to override the configuration options on this DateTime * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22' * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22' * @example DateTime.now().toFormat('yyyy LLL dd', { locale: "fr" }) //=> '2017 avr. 22' * @example DateTime.now().toFormat("HH 'hours and' mm 'minutes'") //=> '20 hours and 55 minutes' * @return {string} */ toFormat(fmt, opts = {}) { return this.isValid ? Formatter2.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt) : INVALID4; } /** * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`. * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation * of the DateTime in the assigned locale. * Defaults to the system's locale if no locale has been specified * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options * @param {Object} opts - opts to override the configuration options on this DateTime * @example DateTime.now().toLocaleString(); //=> 4/20/2017 * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017' * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017' * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 août 2022' * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM' * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM' * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20' * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM' * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32' * @return {string} */ toLocaleString(formatOpts = DATE_SHORT2, opts = {}) { return this.isValid ? Formatter2.create(this.loc.clone(opts), formatOpts).formatDateTime(this) : INVALID4; } /** * Returns an array of format "parts", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output. * Defaults to the system's locale if no locale has been specified * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`. * @example DateTime.now().toLocaleParts(); //=> [ * //=> { type: 'day', value: '25' }, * //=> { type: 'literal', value: '/' }, * //=> { type: 'month', value: '05' }, * //=> { type: 'literal', value: '/' }, * //=> { type: 'year', value: '1982' } * //=> ] */ toLocaleParts(opts = {}) { return this.isValid ? Formatter2.create(this.loc.clone(opts), opts).formatDateTimeParts(this) : []; } /** * Returns an ISO 8601-compliant string representation of this DateTime * @param {Object} opts - options * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' * @param {boolean} [opts.extendedZone=false] - add the time zone format extension * @param {string} [opts.format='extended'] - choose between the basic and extended format * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z' * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00' * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335' * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400' * @return {string} */ toISO({ format = "extended", suppressSeconds = false, suppressMilliseconds = false, includeOffset = true, extendedZone = false } = {}) { if (!this.isValid) { return null; } const ext = format === "extended"; let c = toISODate2(this, ext); c += "T"; c += toISOTime2(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone); return c; } /** * Returns an ISO 8601-compliant string representation of this DateTime's date component * @param {Object} opts - options * @param {string} [opts.format='extended'] - choose between the basic and extended format * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25' * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525' * @return {string} */ toISODate({ format = "extended" } = {}) { if (!this.isValid) { return null; } return toISODate2(this, format === "extended"); } /** * Returns an ISO 8601-compliant string representation of this DateTime's week date * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2' * @return {string} */ toISOWeekDate() { return toTechFormat2(this, "kkkk-'W'WW-c"); } /** * Returns an ISO 8601-compliant string representation of this DateTime's time component * @param {Object} opts - options * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' * @param {boolean} [opts.extendedZone=true] - add the time zone format extension * @param {boolean} [opts.includePrefix=false] - include the `T` prefix * @param {string} [opts.format='extended'] - choose between the basic and extended format * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z' * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z' * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z' * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z' * @return {string} */ toISOTime({ suppressMilliseconds = false, suppressSeconds = false, includeOffset = true, includePrefix = false, extendedZone = false, format = "extended" } = {}) { if (!this.isValid) { return null; } let c = includePrefix ? "T" : ""; return c + toISOTime2( this, format === "extended", suppressSeconds, suppressMilliseconds, includeOffset, extendedZone ); } /** * Returns an RFC 2822-compatible string representation of this DateTime * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000' * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400' * @return {string} */ toRFC2822() { return toTechFormat2(this, "EEE, dd LLL yyyy HH:mm:ss ZZZ", false); } /** * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT. * Specifically, the string conforms to RFC 1123. * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1 * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT' * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT' * @return {string} */ toHTTP() { return toTechFormat2(this.toUTC(), "EEE, dd LLL yyyy HH:mm:ss 'GMT'"); } /** * Returns a string representation of this DateTime appropriate for use in SQL Date * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13' * @return {string} */ toSQLDate() { if (!this.isValid) { return null; } return toISODate2(this, true); } /** * Returns a string representation of this DateTime appropriate for use in SQL Time * @param {Object} opts - options * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset. * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00' * @example DateTime.utc().toSQL() //=> '05:15:16.345' * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00' * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345' * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York' * @return {string} */ toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) { let fmt = "HH:mm:ss.SSS"; if (includeZone || includeOffset) { if (includeOffsetSpace) { fmt += " "; } if (includeZone) { fmt += "z"; } else if (includeOffset) { fmt += "ZZ"; } } return toTechFormat2(this, fmt, true); } /** * Returns a string representation of this DateTime appropriate for use in SQL DateTime * @param {Object} opts - options * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset. * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00' * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z' * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00' * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000' * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York' * @return {string} */ toSQL(opts = {}) { if (!this.isValid) { return null; } return `${this.toSQLDate()} ${this.toSQLTime(opts)}`; } /** * Returns a string representation of this DateTime appropriate for debugging * @return {string} */ toString() { return this.isValid ? this.toISO() : INVALID4; } /** * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis} * @return {number} */ valueOf() { return this.toMillis(); } /** * Returns the epoch milliseconds of this DateTime. * @return {number} */ toMillis() { return this.isValid ? this.ts : NaN; } /** * Returns the epoch seconds of this DateTime. * @return {number} */ toSeconds() { return this.isValid ? this.ts / 1e3 : NaN; } /** * Returns the epoch seconds (as a whole number) of this DateTime. * @return {number} */ toUnixInteger() { return this.isValid ? Math.floor(this.ts / 1e3) : NaN; } /** * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON. * @return {string} */ toJSON() { return this.toISO(); } /** * Returns a BSON serializable equivalent to this DateTime. * @return {Date} */ toBSON() { return this.toJSDate(); } /** * Returns a JavaScript object with this DateTime's year, month, day, and so on. * @param opts - options for generating the object * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 } * @return {Object} */ toObject(opts = {}) { if (!this.isValid) return {}; const base = { ...this.c }; if (opts.includeConfig) { base.outputCalendar = this.outputCalendar; base.numberingSystem = this.loc.numberingSystem; base.locale = this.loc.locale; } return base; } /** * Returns a JavaScript Date equivalent to this DateTime. * @return {Date} */ toJSDate() { return new Date(this.isValid ? this.ts : NaN); } // COMPARE /** * Return the difference between two DateTimes as a Duration. * @param {DateTime} otherDateTime - the DateTime to compare this one to * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration. * @param {Object} opts - options that affect the creation of the Duration * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use * @example * var i1 = DateTime.fromISO('1982-05-25T09:45'), * i2 = DateTime.fromISO('1983-10-14T10:30'); * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 } * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 } * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 } * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 } * @return {Duration} */ diff(otherDateTime, unit = "milliseconds", opts = {}) { if (!this.isValid || !otherDateTime.isValid) { return Duration3.invalid("created by diffing an invalid DateTime"); } const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts }; const units = maybeArray2(unit).map(Duration3.normalizeUnit), otherIsLater = otherDateTime.valueOf() > this.valueOf(), earlier = otherIsLater ? this : otherDateTime, later = otherIsLater ? otherDateTime : this, diffed = diff(earlier, later, units, durOpts); return otherIsLater ? diffed.negate() : diffed; } /** * Return the difference between this DateTime and right now. * See {@link DateTime#diff} * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration * @param {Object} opts - options that affect the creation of the Duration * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use * @return {Duration} */ diffNow(unit = "milliseconds", opts = {}) { return this.diff(_DateTime.now(), unit, opts); } /** * Return an Interval spanning between this DateTime and another DateTime * @param {DateTime} otherDateTime - the other end point of the Interval * @return {Interval} */ until(otherDateTime) { return this.isValid ? Interval2.fromDateTimes(this, otherDateTime) : this; } /** * Return whether this DateTime is in the same unit of time as another DateTime. * Higher-order units must also be identical for this function to return `true`. * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed. * @param {DateTime} otherDateTime - the other DateTime * @param {string} unit - the unit of time to check sameness on * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day * @return {boolean} */ hasSame(otherDateTime, unit) { if (!this.isValid) return false; const inputMs = otherDateTime.valueOf(); const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true }); return adjustedToZone.startOf(unit) <= inputMs && inputMs <= adjustedToZone.endOf(unit); } /** * Equality check * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid. * To compare just the millisecond values, use `+dt1 === +dt2`. * @param {DateTime} other - the other DateTime * @return {boolean} */ equals(other) { return this.isValid && other.isValid && this.valueOf() === other.valueOf() && this.zone.equals(other.zone) && this.loc.equals(other.loc); } /** * Returns a string representation of a this time relative to now, such as "in two days". Can only internationalize if your * platform supports Intl.RelativeTimeFormat. Rounds down by default. * @param {Object} options - options that affect the output * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now. * @param {string} [options.style="long"] - the style of units, must be "long", "short", or "narrow" * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of "years", "quarters", "months", "weeks", "days", "hours", "minutes", or "seconds" * @param {boolean} [options.round=true] - whether to round the numbers in the output. * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding. * @param {string} options.locale - override the locale of this DateTime * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this * @example DateTime.now().plus({ days: 1 }).toRelative() //=> "in 1 day" * @example DateTime.now().setLocale("es").toRelative({ days: 1 }) //=> "dentro de 1 día" * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: "fr" }) //=> "dans 23 heures" * @example DateTime.now().minus({ days: 2 }).toRelative() //=> "2 days ago" * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: "hours" }) //=> "48 hours ago" * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> "1.5 days ago" */ toRelative(options = {}) { if (!this.isValid) return null; const base = options.base || _DateTime.fromObject({}, { zone: this.zone }), padding = options.padding ? this < base ? -options.padding : options.padding : 0; let units = ["years", "months", "days", "hours", "minutes", "seconds"]; let unit = options.unit; if (Array.isArray(options.unit)) { units = options.unit; unit = void 0; } return diffRelative2(base, this.plus(padding), { ...options, numeric: "always", units, unit }); } /** * Returns a string representation of this date relative to today, such as "yesterday" or "next month". * Only internationalizes on platforms that supports Intl.RelativeTimeFormat. * @param {Object} options - options that affect the output * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now. * @param {string} options.locale - override the locale of this DateTime * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of "years", "quarters", "months", "weeks", or "days" * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> "tomorrow" * @example DateTime.now().setLocale("es").plus({ days: 1 }).toRelative() //=> ""mañana" * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: "fr" }) //=> "demain" * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> "2 days ago" */ toRelativeCalendar(options = {}) { if (!this.isValid) return null; return diffRelative2(options.base || _DateTime.fromObject({}, { zone: this.zone }), this, { ...options, numeric: "auto", units: ["years", "months", "days"], calendary: true }); } /** * Return the min of several date times * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum * @return {DateTime} the min DateTime, or undefined if called with no argument */ static min(...dateTimes) { if (!dateTimes.every(_DateTime.isDateTime)) { throw new InvalidArgumentError2("min requires all arguments be DateTimes"); } return bestBy2(dateTimes, (i) => i.valueOf(), Math.min); } /** * Return the max of several date times * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum * @return {DateTime} the max DateTime, or undefined if called with no argument */ static max(...dateTimes) { if (!dateTimes.every(_DateTime.isDateTime)) { throw new InvalidArgumentError2("max requires all arguments be DateTimes"); } return bestBy2(dateTimes, (i) => i.valueOf(), Math.max); } // MISC /** * Explain how a string would be parsed by fromFormat() * @param {string} text - the string to parse * @param {string} fmt - the format the string is expected to be in (see description) * @param {Object} options - options taken by fromFormat() * @return {Object} */ static fromFormatExplain(text, fmt, options = {}) { const { locale = null, numberingSystem = null } = options, localeToUse = Locale2.fromOpts({ locale, numberingSystem, defaultToEN: true }); return explainFromTokens2(localeToUse, text, fmt); } /** * @deprecated use fromFormatExplain instead */ static fromStringExplain(text, fmt, options = {}) { return _DateTime.fromFormatExplain(text, fmt, options); } // FORMAT PRESETS /** * {@link DateTime#toLocaleString} format like 10/14/1983 * @type {Object} */ static get DATE_SHORT() { return DATE_SHORT2; } /** * {@link DateTime#toLocaleString} format like 'Oct 14, 1983' * @type {Object} */ static get DATE_MED() { return DATE_MED2; } /** * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983' * @type {Object} */ static get DATE_MED_WITH_WEEKDAY() { return DATE_MED_WITH_WEEKDAY2; } /** * {@link DateTime#toLocaleString} format like 'October 14, 1983' * @type {Object} */ static get DATE_FULL() { return DATE_FULL2; } /** * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983' * @type {Object} */ static get DATE_HUGE() { return DATE_HUGE2; } /** * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is. * @type {Object} */ static get TIME_SIMPLE() { return TIME_SIMPLE2; } /** * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is. * @type {Object} */ static get TIME_WITH_SECONDS() { return TIME_WITH_SECONDS2; } /** * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is. * @type {Object} */ static get TIME_WITH_SHORT_OFFSET() { return TIME_WITH_SHORT_OFFSET2; } /** * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is. * @type {Object} */ static get TIME_WITH_LONG_OFFSET() { return TIME_WITH_LONG_OFFSET2; } /** * {@link DateTime#toLocaleString} format like '09:30', always 24-hour. * @type {Object} */ static get TIME_24_SIMPLE() { return TIME_24_SIMPLE2; } /** * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour. * @type {Object} */ static get TIME_24_WITH_SECONDS() { return TIME_24_WITH_SECONDS2; } /** * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour. * @type {Object} */ static get TIME_24_WITH_SHORT_OFFSET() { return TIME_24_WITH_SHORT_OFFSET2; } /** * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour. * @type {Object} */ static get TIME_24_WITH_LONG_OFFSET() { return TIME_24_WITH_LONG_OFFSET2; } /** * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is. * @type {Object} */ static get DATETIME_SHORT() { return DATETIME_SHORT2; } /** * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is. * @type {Object} */ static get DATETIME_SHORT_WITH_SECONDS() { return DATETIME_SHORT_WITH_SECONDS2; } /** * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is. * @type {Object} */ static get DATETIME_MED() { return DATETIME_MED2; } /** * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is. * @type {Object} */ static get DATETIME_MED_WITH_SECONDS() { return DATETIME_MED_WITH_SECONDS2; } /** * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is. * @type {Object} */ static get DATETIME_MED_WITH_WEEKDAY() { return DATETIME_MED_WITH_WEEKDAY2; } /** * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is. * @type {Object} */ static get DATETIME_FULL() { return DATETIME_FULL2; } /** * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is. * @type {Object} */ static get DATETIME_FULL_WITH_SECONDS() { return DATETIME_FULL_WITH_SECONDS2; } /** * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is. * @type {Object} */ static get DATETIME_HUGE() { return DATETIME_HUGE2; } /** * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is. * @type {Object} */ static get DATETIME_HUGE_WITH_SECONDS() { return DATETIME_HUGE_WITH_SECONDS2; } }; function friendlyDateTime2(dateTimeish) { if (DateTime2.isDateTime(dateTimeish)) { return dateTimeish; } else if (dateTimeish && dateTimeish.valueOf && isNumber2(dateTimeish.valueOf())) { return DateTime2.fromJSDate(dateTimeish); } else if (dateTimeish && typeof dateTimeish === "object") { return DateTime2.fromObject(dateTimeish); } else { throw new InvalidArgumentError2( `Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}` ); } } var DEFAULT_QUERY_SETTINGS = { renderNullAs: "\\-", taskCompletionTracking: false, taskCompletionUseEmojiShorthand: false, taskCompletionText: "completion", taskCompletionDateFormat: "yyyy-MM-dd", recursiveSubTaskCompletion: false, warnOnEmptyResult: true, refreshEnabled: true, refreshInterval: 2500, defaultDateFormat: "MMMM dd, yyyy", defaultDateTimeFormat: "h:mm a - MMMM dd, yyyy", maxRecursiveRenderDepth: 4, tableIdColumnName: "File", tableGroupColumnName: "Group", showResultCount: true }; var DEFAULT_EXPORT_SETTINGS = { allowHtml: true }; ({ ...DEFAULT_QUERY_SETTINGS, ...DEFAULT_EXPORT_SETTINGS, ...{ inlineQueryPrefix: "=", inlineJsQueryPrefix: "$=", inlineQueriesInCodeblocks: true, enableInlineDataview: true, enableDataviewJs: false, enableInlineDataviewJs: false, prettyRenderInlineFields: true, dataviewJsKeyword: "dataviewjs" } }); var Success = class _Success { constructor(value) { this.value = value; this.successful = true; } map(f) { return new _Success(f(this.value)); } flatMap(f) { return f(this.value); } mapErr(f) { return this; } bimap(succ, _fail) { return this.map(succ); } orElse(_value) { return this.value; } cast() { return this; } orElseThrow(_message) { return this.value; } }; var Failure = class _Failure { constructor(error) { this.error = error; this.successful = false; } map(_f) { return this; } flatMap(_f) { return this; } mapErr(f) { return new _Failure(f(this.error)); } bimap(_succ, fail) { return this.mapErr(fail); } orElse(value) { return value; } cast() { return this; } orElseThrow(message) { if (message) throw new Error(message(this.error)); else throw new Error("" + this.error); } }; var Result; (function(Result2) { function success(value) { return new Success(value); } Result2.success = success; function failure(error) { return new Failure(error); } Result2.failure = failure; function flatMap2(first, second, f) { if (first.successful) { if (second.successful) return f(first.value, second.value); else return failure(second.error); } else { return failure(first.error); } } Result2.flatMap2 = flatMap2; function map2(first, second, f) { return flatMap2(first, second, (a, b) => success(f(a, b))); } Result2.map2 = map2; })(Result || (Result = {})); var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {}; var parsimmon_umd_min = { exports: {} }; parsimmon_umd_min.exports; (function(module3, exports2) { !function(n3, t) { module3.exports = t(); }("undefined" != typeof self ? self : commonjsGlobal, function() { return function(n3) { var t = {}; function r(e) { if (t[e]) return t[e].exports; var u = t[e] = { i: e, l: false, exports: {} }; return n3[e].call(u.exports, u, u.exports, r), u.l = true, u.exports; } return r.m = n3, r.c = t, r.d = function(n4, t2, e) { r.o(n4, t2) || Object.defineProperty(n4, t2, { configurable: false, enumerable: true, get: e }); }, r.r = function(n4) { Object.defineProperty(n4, "__esModule", { value: true }); }, r.n = function(n4) { var t2 = n4 && n4.__esModule ? function() { return n4.default; } : function() { return n4; }; return r.d(t2, "a", t2), t2; }, r.o = function(n4, t2) { return Object.prototype.hasOwnProperty.call(n4, t2); }, r.p = "", r(r.s = 0); }([function(n3, t, r) { function e(n4) { if (!(this instanceof e)) return new e(n4); this._ = n4; } var u = e.prototype; function o(n4, t2) { for (var r2 = 0; r2 < n4; r2++) t2(r2); } function i(n4, t2, r2) { return function(n5, t3) { o(t3.length, function(r3) { n5(t3[r3], r3, t3); }); }(function(r3, e2, u2) { t2 = n4(t2, r3, e2, u2); }, r2), t2; } function a(n4, t2) { return i(function(t3, r2, e2, u2) { return t3.concat([n4(r2, e2, u2)]); }, [], t2); } function f(n4, t2) { var r2 = { v: 0, buf: t2 }; return o(n4, function() { var n5; r2 = { v: r2.v << 1 | (n5 = r2.buf, n5[0] >> 7), buf: function(n6) { var t3 = i(function(n7, t4, r3, e2) { return n7.concat(r3 === e2.length - 1 ? Buffer.from([t4, 0]).readUInt16BE(0) : e2.readUInt16BE(r3)); }, [], n6); return Buffer.from(a(function(n7) { return (n7 << 1 & 65535) >> 8; }, t3)); }(r2.buf) }; }), r2; } function c() { return "undefined" != typeof Buffer; } function s3() { if (!c()) throw new Error("Buffer global does not exist; please use webpack if you need to parse Buffers in the browser."); } function l3(n4) { s3(); var t2 = i(function(n5, t3) { return n5 + t3; }, 0, n4); if (t2 % 8 != 0) throw new Error("The bits [" + n4.join(", ") + "] add up to " + t2 + " which is not an even number of bytes; the total should be divisible by 8"); var r2, u2 = t2 / 8, o2 = (r2 = function(n5) { return n5 > 48; }, i(function(n5, t3) { return n5 || (r2(t3) ? t3 : n5); }, null, n4)); if (o2) throw new Error(o2 + " bit range requested exceeds 48 bit (6 byte) Number max."); return new e(function(t3, r3) { var e2 = u2 + r3; return e2 > t3.length ? x(r3, u2.toString() + " bytes") : b(e2, i(function(n5, t4) { var r4 = f(t4, n5.buf); return { coll: n5.coll.concat(r4.v), buf: r4.buf }; }, { coll: [], buf: t3.slice(r3, e2) }, n4).coll); }); } function h(n4, t2) { return new e(function(r2, e2) { return s3(), e2 + t2 > r2.length ? x(e2, t2 + " bytes for " + n4) : b(e2 + t2, r2.slice(e2, e2 + t2)); }); } function p(n4, t2) { if ("number" != typeof (r2 = t2) || Math.floor(r2) !== r2 || t2 < 0 || t2 > 6) throw new Error(n4 + " requires integer length in range [0, 6]."); var r2; } function d(n4) { return p("uintBE", n4), h("uintBE(" + n4 + ")", n4).map(function(t2) { return t2.readUIntBE(0, n4); }); } function v(n4) { return p("uintLE", n4), h("uintLE(" + n4 + ")", n4).map(function(t2) { return t2.readUIntLE(0, n4); }); } function g(n4) { return p("intBE", n4), h("intBE(" + n4 + ")", n4).map(function(t2) { return t2.readIntBE(0, n4); }); } function m(n4) { return p("intLE", n4), h("intLE(" + n4 + ")", n4).map(function(t2) { return t2.readIntLE(0, n4); }); } function y(n4) { return n4 instanceof e; } function E(n4) { return "[object Array]" === {}.toString.call(n4); } function w(n4) { return c() && Buffer.isBuffer(n4); } function b(n4, t2) { return { status: true, index: n4, value: t2, furthest: -1, expected: [] }; } function x(n4, t2) { return E(t2) || (t2 = [t2]), { status: false, index: -1, value: null, furthest: n4, expected: t2 }; } function B(n4, t2) { if (!t2) return n4; if (n4.furthest > t2.furthest) return n4; var r2 = n4.furthest === t2.furthest ? function(n5, t3) { if (function() { if (void 0 !== e._supportsSet) return e._supportsSet; var n6 = "undefined" != typeof Set; return e._supportsSet = n6, n6; }() && Array.from) { for (var r3 = new Set(n5), u2 = 0; u2 < t3.length; u2++) r3.add(t3[u2]); var o2 = Array.from(r3); return o2.sort(), o2; } for (var i2 = {}, a2 = 0; a2 < n5.length; a2++) i2[n5[a2]] = true; for (var f2 = 0; f2 < t3.length; f2++) i2[t3[f2]] = true; var c2 = []; for (var s4 in i2) ({}).hasOwnProperty.call(i2, s4) && c2.push(s4); return c2.sort(), c2; }(n4.expected, t2.expected) : t2.expected; return { status: n4.status, index: n4.index, value: n4.value, furthest: t2.furthest, expected: r2 }; } var j = {}; function S(n4, t2) { if (w(n4)) return { offset: t2, line: -1, column: -1 }; n4 in j || (j[n4] = {}); for (var r2 = j[n4], e2 = 0, u2 = 0, o2 = 0, i2 = t2; i2 >= 0; ) { if (i2 in r2) { e2 = r2[i2].line, 0 === o2 && (o2 = r2[i2].lineStart); break; } ("\n" === n4.charAt(i2) || "\r" === n4.charAt(i2) && "\n" !== n4.charAt(i2 + 1)) && (u2++, 0 === o2 && (o2 = i2 + 1)), i2--; } var a2 = e2 + u2, f2 = t2 - o2; return r2[t2] = { line: a2, lineStart: o2 }, { offset: t2, line: a2 + 1, column: f2 + 1 }; } function _18(n4) { if (!y(n4)) throw new Error("not a parser: " + n4); } function L(n4, t2) { return "string" == typeof n4 ? n4.charAt(t2) : n4[t2]; } function O(n4) { if ("number" != typeof n4) throw new Error("not a number: " + n4); } function k(n4) { if ("function" != typeof n4) throw new Error("not a function: " + n4); } function P(n4) { if ("string" != typeof n4) throw new Error("not a string: " + n4); } var q = 2, A = 3, I = 8, F = 5 * I, M = 4 * I, z = " "; function R(n4, t2) { return new Array(t2 + 1).join(n4); } function U(n4, t2, r2) { var e2 = t2 - n4.length; return e2 <= 0 ? n4 : R(r2, e2) + n4; } function W(n4, t2, r2, e2) { return { from: n4 - t2 > 0 ? n4 - t2 : 0, to: n4 + r2 > e2 ? e2 : n4 + r2 }; } function D(n4, t2) { var r2, e2, u2, o2, f2, c2 = t2.index, s4 = c2.offset, l4 = 1; if (s4 === n4.length) return "Got the end of the input"; if (w(n4)) { var h2 = s4 - s4 % I, p2 = s4 - h2, d2 = W(h2, F, M + I, n4.length), v2 = a(function(n5) { return a(function(n6) { return U(n6.toString(16), 2, "0"); }, n5); }, function(n5, t3) { var r3 = n5.length, e3 = [], u3 = 0; if (r3 <= t3) return [n5.slice()]; for (var o3 = 0; o3 < r3; o3++) e3[u3] || e3.push([]), e3[u3].push(n5[o3]), (o3 + 1) % t3 == 0 && u3++; return e3; }(n4.slice(d2.from, d2.to).toJSON().data, I)); o2 = function(n5) { return 0 === n5.from && 1 === n5.to ? { from: n5.from, to: n5.to } : { from: n5.from / I, to: Math.floor(n5.to / I) }; }(d2), e2 = h2 / I, r2 = 3 * p2, p2 >= 4 && (r2 += 1), l4 = 2, u2 = a(function(n5) { return n5.length <= 4 ? n5.join(" ") : n5.slice(0, 4).join(" ") + " " + n5.slice(4).join(" "); }, v2), (f2 = (8 * (o2.to > 0 ? o2.to - 1 : o2.to)).toString(16).length) < 2 && (f2 = 2); } else { var g2 = n4.split(/\r\n|[\n\r\u2028\u2029]/); r2 = c2.column - 1, e2 = c2.line - 1, o2 = W(e2, q, A, g2.length), u2 = g2.slice(o2.from, o2.to), f2 = o2.to.toString().length; } var m2 = e2 - o2.from; return w(n4) && (f2 = (8 * (o2.to > 0 ? o2.to - 1 : o2.to)).toString(16).length) < 2 && (f2 = 2), i(function(t3, e3, u3) { var i2, a2 = u3 === m2, c3 = a2 ? "> " : z; return i2 = w(n4) ? U((8 * (o2.from + u3)).toString(16), f2, "0") : U((o2.from + u3 + 1).toString(), f2, " "), [].concat(t3, [c3 + i2 + " | " + e3], a2 ? [z + R(" ", f2) + " | " + U("", r2, " ") + R("^", l4)] : []); }, [], u2).join("\n"); } function N(n4, t2) { return ["\n", "-- PARSING FAILED " + R("-", 50), "\n\n", D(n4, t2), "\n\n", (r2 = t2.expected, 1 === r2.length ? "Expected:\n\n" + r2[0] : "Expected one of the following: \n\n" + r2.join(", ")), "\n"].join(""); var r2; } function G(n4) { return void 0 !== n4.flags ? n4.flags : [n4.global ? "g" : "", n4.ignoreCase ? "i" : "", n4.multiline ? "m" : "", n4.unicode ? "u" : "", n4.sticky ? "y" : ""].join(""); } function C() { for (var n4 = [].slice.call(arguments), t2 = n4.length, r2 = 0; r2 < t2; r2 += 1) _18(n4[r2]); return e(function(r3, e2) { for (var u2, o2 = new Array(t2), i2 = 0; i2 < t2; i2 += 1) { if (!(u2 = B(n4[i2]._(r3, e2), u2)).status) return u2; o2[i2] = u2.value, e2 = u2.index; } return B(b(e2, o2), u2); }); } function J() { var n4 = [].slice.call(arguments); if (0 === n4.length) throw new Error("seqMap needs at least one argument"); var t2 = n4.pop(); return k(t2), C.apply(null, n4).map(function(n5) { return t2.apply(null, n5); }); } function T() { var n4 = [].slice.call(arguments), t2 = n4.length; if (0 === t2) return Y("zero alternates"); for (var r2 = 0; r2 < t2; r2 += 1) _18(n4[r2]); return e(function(t3, r3) { for (var e2, u2 = 0; u2 < n4.length; u2 += 1) if ((e2 = B(n4[u2]._(t3, r3), e2)).status) return e2; return e2; }); } function V(n4, t2) { return H(n4, t2).or(X([])); } function H(n4, t2) { return _18(n4), _18(t2), J(n4, t2.then(n4).many(), function(n5, t3) { return [n5].concat(t3); }); } function K(n4) { P(n4); var t2 = "'" + n4 + "'"; return e(function(r2, e2) { var u2 = e2 + n4.length, o2 = r2.slice(e2, u2); return o2 === n4 ? b(u2, o2) : x(e2, t2); }); } function Q(n4, t2) { !function(n5) { if (!(n5 instanceof RegExp)) throw new Error("not a regexp: " + n5); for (var t3 = G(n5), r3 = 0; r3 < t3.length; r3++) { var e2 = t3.charAt(r3); if ("i" !== e2 && "m" !== e2 && "u" !== e2 && "s" !== e2) throw new Error('unsupported regexp flag "' + e2 + '": ' + n5); } }(n4), arguments.length >= 2 ? O(t2) : t2 = 0; var r2 = function(n5) { return RegExp("^(?:" + n5.source + ")", G(n5)); }(n4), u2 = "" + n4; return e(function(n5, e2) { var o2 = r2.exec(n5.slice(e2)); if (o2) { if (0 <= t2 && t2 <= o2.length) { var i2 = o2[0], a2 = o2[t2]; return b(e2 + i2.length, a2); } return x(e2, "valid match group (0 to " + o2.length + ") in " + u2); } return x(e2, u2); }); } function X(n4) { return e(function(t2, r2) { return b(r2, n4); }); } function Y(n4) { return e(function(t2, r2) { return x(r2, n4); }); } function Z(n4) { if (y(n4)) return e(function(t2, r2) { var e2 = n4._(t2, r2); return e2.index = r2, e2.value = "", e2; }); if ("string" == typeof n4) return Z(K(n4)); if (n4 instanceof RegExp) return Z(Q(n4)); throw new Error("not a string, regexp, or parser: " + n4); } function $3(n4) { return _18(n4), e(function(t2, r2) { var e2 = n4._(t2, r2), u2 = t2.slice(r2, e2.index); return e2.status ? x(r2, 'not "' + u2 + '"') : b(r2, null); }); } function nn(n4) { return k(n4), e(function(t2, r2) { var e2 = L(t2, r2); return r2 < t2.length && n4(e2) ? b(r2 + 1, e2) : x(r2, "a character/byte matching " + n4); }); } function tn(n4, t2) { arguments.length < 2 && (t2 = n4, n4 = void 0); var r2 = e(function(n5, e2) { return r2._ = t2()._, r2._(n5, e2); }); return n4 ? r2.desc(n4) : r2; } function rn() { return Y("fantasy-land/empty"); } u.parse = function(n4) { if ("string" != typeof n4 && !w(n4)) throw new Error(".parse must be called with a string or Buffer as its argument"); var t2, r2 = this.skip(an)._(n4, 0); return t2 = r2.status ? { status: true, value: r2.value } : { status: false, index: S(n4, r2.furthest), expected: r2.expected }, delete j[n4], t2; }, u.tryParse = function(n4) { var t2 = this.parse(n4); if (t2.status) return t2.value; var r2 = N(n4, t2), e2 = new Error(r2); throw e2.type = "ParsimmonError", e2.result = t2, e2; }, u.assert = function(n4, t2) { return this.chain(function(r2) { return n4(r2) ? X(r2) : Y(t2); }); }, u.or = function(n4) { return T(this, n4); }, u.trim = function(n4) { return this.wrap(n4, n4); }, u.wrap = function(n4, t2) { return J(n4, this, t2, function(n5, t3) { return t3; }); }, u.thru = function(n4) { return n4(this); }, u.then = function(n4) { return _18(n4), C(this, n4).map(function(n5) { return n5[1]; }); }, u.many = function() { var n4 = this; return e(function(t2, r2) { for (var e2 = [], u2 = void 0; ; ) { if (!(u2 = B(n4._(t2, r2), u2)).status) return B(b(r2, e2), u2); if (r2 === u2.index) throw new Error("infinite loop detected in .many() parser --- calling .many() on a parser which can accept zero characters is usually the cause"); r2 = u2.index, e2.push(u2.value); } }); }, u.tieWith = function(n4) { return P(n4), this.map(function(t2) { if (function(n5) { if (!E(n5)) throw new Error("not an array: " + n5); }(t2), t2.length) { P(t2[0]); for (var r2 = t2[0], e2 = 1; e2 < t2.length; e2++) P(t2[e2]), r2 += n4 + t2[e2]; return r2; } return ""; }); }, u.tie = function() { return this.tieWith(""); }, u.times = function(n4, t2) { var r2 = this; return arguments.length < 2 && (t2 = n4), O(n4), O(t2), e(function(e2, u2) { for (var o2 = [], i2 = void 0, a2 = void 0, f2 = 0; f2 < n4; f2 += 1) { if (a2 = B(i2 = r2._(e2, u2), a2), !i2.status) return a2; u2 = i2.index, o2.push(i2.value); } for (; f2 < t2 && (a2 = B(i2 = r2._(e2, u2), a2), i2.status); f2 += 1) u2 = i2.index, o2.push(i2.value); return B(b(u2, o2), a2); }); }, u.result = function(n4) { return this.map(function() { return n4; }); }, u.atMost = function(n4) { return this.times(0, n4); }, u.atLeast = function(n4) { return J(this.times(n4), this.many(), function(n5, t2) { return n5.concat(t2); }); }, u.map = function(n4) { k(n4); var t2 = this; return e(function(r2, e2) { var u2 = t2._(r2, e2); return u2.status ? B(b(u2.index, n4(u2.value)), u2) : u2; }); }, u.contramap = function(n4) { k(n4); var t2 = this; return e(function(r2, e2) { var u2 = t2.parse(n4(r2.slice(e2))); return u2.status ? b(e2 + r2.length, u2.value) : u2; }); }, u.promap = function(n4, t2) { return k(n4), k(t2), this.contramap(n4).map(t2); }, u.skip = function(n4) { return C(this, n4).map(function(n5) { return n5[0]; }); }, u.mark = function() { return J(en, this, en, function(n4, t2, r2) { return { start: n4, value: t2, end: r2 }; }); }, u.node = function(n4) { return J(en, this, en, function(t2, r2, e2) { return { name: n4, value: r2, start: t2, end: e2 }; }); }, u.sepBy = function(n4) { return V(this, n4); }, u.sepBy1 = function(n4) { return H(this, n4); }, u.lookahead = function(n4) { return this.skip(Z(n4)); }, u.notFollowedBy = function(n4) { return this.skip($3(n4)); }, u.desc = function(n4) { E(n4) || (n4 = [n4]); var t2 = this; return e(function(r2, e2) { var u2 = t2._(r2, e2); return u2.status || (u2.expected = n4), u2; }); }, u.fallback = function(n4) { return this.or(X(n4)); }, u.ap = function(n4) { return J(n4, this, function(n5, t2) { return n5(t2); }); }, u.chain = function(n4) { var t2 = this; return e(function(r2, e2) { var u2 = t2._(r2, e2); return u2.status ? B(n4(u2.value)._(r2, u2.index), u2) : u2; }); }, u.concat = u.or, u.empty = rn, u.of = X, u["fantasy-land/ap"] = u.ap, u["fantasy-land/chain"] = u.chain, u["fantasy-land/concat"] = u.concat, u["fantasy-land/empty"] = u.empty, u["fantasy-land/of"] = u.of, u["fantasy-land/map"] = u.map; var en = e(function(n4, t2) { return b(t2, S(n4, t2)); }), un = e(function(n4, t2) { return t2 >= n4.length ? x(t2, "any character/byte") : b(t2 + 1, L(n4, t2)); }), on = e(function(n4, t2) { return b(n4.length, n4.slice(t2)); }), an = e(function(n4, t2) { return t2 < n4.length ? x(t2, "EOF") : b(t2, null); }), fn = Q(/[0-9]/).desc("a digit"), cn = Q(/[0-9]*/).desc("optional digits"), sn = Q(/[a-z]/i).desc("a letter"), ln = Q(/[a-z]*/i).desc("optional letters"), hn = Q(/\s*/).desc("optional whitespace"), pn = Q(/\s+/).desc("whitespace"), dn = K("\r"), vn = K("\n"), gn = K("\r\n"), mn = T(gn, vn, dn).desc("newline"), yn = T(mn, an); e.all = on, e.alt = T, e.any = un, e.cr = dn, e.createLanguage = function(n4) { var t2 = {}; for (var r2 in n4) ({}).hasOwnProperty.call(n4, r2) && function(r3) { t2[r3] = tn(function() { return n4[r3](t2); }); }(r2); return t2; }, e.crlf = gn, e.custom = function(n4) { return e(n4(b, x)); }, e.digit = fn, e.digits = cn, e.empty = rn, e.end = yn, e.eof = an, e.fail = Y, e.formatError = N, e.index = en, e.isParser = y, e.lazy = tn, e.letter = sn, e.letters = ln, e.lf = vn, e.lookahead = Z, e.makeFailure = x, e.makeSuccess = b, e.newline = mn, e.noneOf = function(n4) { return nn(function(t2) { return n4.indexOf(t2) < 0; }).desc("none of '" + n4 + "'"); }, e.notFollowedBy = $3, e.of = X, e.oneOf = function(n4) { for (var t2 = n4.split(""), r2 = 0; r2 < t2.length; r2++) t2[r2] = "'" + t2[r2] + "'"; return nn(function(t3) { return n4.indexOf(t3) >= 0; }).desc(t2); }, e.optWhitespace = hn, e.Parser = e, e.range = function(n4, t2) { return nn(function(r2) { return n4 <= r2 && r2 <= t2; }).desc(n4 + "-" + t2); }, e.regex = Q, e.regexp = Q, e.sepBy = V, e.sepBy1 = H, e.seq = C, e.seqMap = J, e.seqObj = function() { for (var n4, t2 = {}, r2 = 0, u2 = (n4 = arguments, Array.prototype.slice.call(n4)), o2 = u2.length, i2 = 0; i2 < o2; i2 += 1) { var a2 = u2[i2]; if (!y(a2)) { if (E(a2) && 2 === a2.length && "string" == typeof a2[0] && y(a2[1])) { var f2 = a2[0]; if (Object.prototype.hasOwnProperty.call(t2, f2)) throw new Error("seqObj: duplicate key " + f2); t2[f2] = true, r2++; continue; } throw new Error("seqObj arguments must be parsers or [string, parser] array pairs."); } } if (0 === r2) throw new Error("seqObj expects at least one named parser, found zero"); return e(function(n5, t3) { for (var r3, e2 = {}, i3 = 0; i3 < o2; i3 += 1) { var a3, f3; if (E(u2[i3]) ? (a3 = u2[i3][0], f3 = u2[i3][1]) : (a3 = null, f3 = u2[i3]), !(r3 = B(f3._(n5, t3), r3)).status) return r3; a3 && (e2[a3] = r3.value), t3 = r3.index; } return B(b(t3, e2), r3); }); }, e.string = K, e.succeed = X, e.takeWhile = function(n4) { return k(n4), e(function(t2, r2) { for (var e2 = r2; e2 < t2.length && n4(L(t2, e2)); ) e2++; return b(e2, t2.slice(r2, e2)); }); }, e.test = nn, e.whitespace = pn, e["fantasy-land/empty"] = rn, e["fantasy-land/of"] = X, e.Binary = { bitSeq: l3, bitSeqObj: function(n4) { s3(); var t2 = {}, r2 = 0, e2 = a(function(n5) { if (E(n5)) { var e3 = n5; if (2 !== e3.length) throw new Error("[" + e3.join(", ") + "] should be length 2, got length " + e3.length); if (P(e3[0]), O(e3[1]), Object.prototype.hasOwnProperty.call(t2, e3[0])) throw new Error("duplicate key in bitSeqObj: " + e3[0]); return t2[e3[0]] = true, r2++, e3; } return O(n5), [null, n5]; }, n4); if (r2 < 1) throw new Error("bitSeqObj expects at least one named pair, got [" + n4.join(", ") + "]"); var u2 = a(function(n5) { return n5[0]; }, e2); return l3(a(function(n5) { return n5[1]; }, e2)).map(function(n5) { return i(function(n6, t3) { return null !== t3[0] && (n6[t3[0]] = t3[1]), n6; }, {}, a(function(t3, r3) { return [t3, n5[r3]]; }, u2)); }); }, byte: function(n4) { if (s3(), O(n4), n4 > 255) throw new Error("Value specified to byte constructor (" + n4 + "=0x" + n4.toString(16) + ") is larger in value than a single byte."); var t2 = (n4 > 15 ? "0x" : "0x0") + n4.toString(16); return e(function(r2, e2) { var u2 = L(r2, e2); return u2 === n4 ? b(e2 + 1, u2) : x(e2, t2); }); }, buffer: function(n4) { return h("buffer", n4).map(function(n5) { return Buffer.from(n5); }); }, encodedString: function(n4, t2) { return h("string", t2).map(function(t3) { return t3.toString(n4); }); }, uintBE: d, uint8BE: d(1), uint16BE: d(2), uint32BE: d(4), uintLE: v, uint8LE: v(1), uint16LE: v(2), uint32LE: v(4), intBE: g, int8BE: g(1), int16BE: g(2), int32BE: g(4), intLE: m, int8LE: m(1), int16LE: m(2), int32LE: m(4), floatBE: h("floatBE", 4).map(function(n4) { return n4.readFloatBE(0); }), floatLE: h("floatLE", 4).map(function(n4) { return n4.readFloatLE(0); }), doubleBE: h("doubleBE", 8).map(function(n4) { return n4.readDoubleBE(0); }), doubleLE: h("doubleLE", 8).map(function(n4) { return n4.readDoubleLE(0); }) }, n3.exports = e; }]); }); })(parsimmon_umd_min, parsimmon_umd_min.exports); var parsimmon_umd_minExports = parsimmon_umd_min.exports; var emojiRegex = () => { return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g; }; function normalizeDuration(dur) { if (dur === void 0 || dur === null) return dur; return dur.shiftToAll().normalize(); } function getFileTitle(path2) { if (path2.includes("/")) path2 = path2.substring(path2.lastIndexOf("/") + 1); if (path2.endsWith(".md")) path2 = path2.substring(0, path2.length - 3); return path2; } parsimmon_umd_minExports.alt(parsimmon_umd_minExports.regex(new RegExp(emojiRegex(), "")), parsimmon_umd_minExports.regex(/[0-9\p{Letter}_-]+/u).map((str) => str.toLocaleLowerCase()), parsimmon_umd_minExports.whitespace.map((_18) => "-"), parsimmon_umd_minExports.any.map((_18) => "")).many().map((result) => result.join("")); var HEADER_CANONICALIZER = parsimmon_umd_minExports.alt(parsimmon_umd_minExports.regex(new RegExp(emojiRegex(), "")), parsimmon_umd_minExports.regex(/[0-9\p{Letter}_-]+/u), parsimmon_umd_minExports.whitespace.map((_18) => " "), parsimmon_umd_minExports.any.map((_18) => " ")).many().map((result) => { return result.join("").split(/\s+/).join(" ").trim(); }); function normalizeHeaderForLink(header) { return HEADER_CANONICALIZER.tryParse(header); } function renderMinimalDuration(dur) { dur = normalizeDuration(dur); dur = Duration3.fromObject(Object.fromEntries(Object.entries(dur.toObject()).filter(([, quantity]) => quantity != 0))); return dur.toHuman(); } var Values; (function(Values2) { function toString(field, setting = DEFAULT_QUERY_SETTINGS, recursive = false) { let wrapped = wrapValue(field); if (!wrapped) return setting.renderNullAs; switch (wrapped.type) { case "null": return setting.renderNullAs; case "string": return wrapped.value; case "number": case "boolean": return "" + wrapped.value; case "html": return wrapped.value.outerHTML; case "widget": return wrapped.value.markdown(); case "link": return wrapped.value.markdown(); case "function": return ""; case "array": let result = ""; if (recursive) result += "["; result += wrapped.value.map((f) => toString(f, setting, true)).join(", "); if (recursive) result += "]"; return result; case "object": return "{ " + Object.entries(wrapped.value).map((e) => e[0] + ": " + toString(e[1], setting, true)).join(", ") + " }"; case "date": if (wrapped.value.second == 0 && wrapped.value.hour == 0 && wrapped.value.minute == 0) { return wrapped.value.toFormat(setting.defaultDateFormat); } return wrapped.value.toFormat(setting.defaultDateTimeFormat); case "duration": return renderMinimalDuration(wrapped.value); } } Values2.toString = toString; function wrapValue(val) { if (isNull(val)) return { type: "null", value: val }; else if (isNumber3(val)) return { type: "number", value: val }; else if (isString3(val)) return { type: "string", value: val }; else if (isBoolean(val)) return { type: "boolean", value: val }; else if (isDuration(val)) return { type: "duration", value: val }; else if (isDate3(val)) return { type: "date", value: val }; else if (isWidget(val)) return { type: "widget", value: val }; else if (isArray(val)) return { type: "array", value: val }; else if (isLink(val)) return { type: "link", value: val }; else if (isFunction(val)) return { type: "function", value: val }; else if (isHtml(val)) return { type: "html", value: val }; else if (isObject(val)) return { type: "object", value: val }; else return void 0; } Values2.wrapValue = wrapValue; function mapLeaves(val, func) { if (isObject(val)) { let result = {}; for (let [key2, value] of Object.entries(val)) result[key2] = mapLeaves(value, func); return result; } else if (isArray(val)) { let result = []; for (let value of val) result.push(mapLeaves(value, func)); return result; } else { return func(val); } } Values2.mapLeaves = mapLeaves; function compareValue(val1, val2, linkNormalizer) { var _a, _b; if (val1 === void 0) val1 = null; if (val2 === void 0) val2 = null; if (val1 === null && val2 === null) return 0; else if (val1 === null) return -1; else if (val2 === null) return 1; let wrap1 = wrapValue(val1); let wrap2 = wrapValue(val2); if (wrap1 === void 0 && wrap2 === void 0) return 0; else if (wrap1 === void 0) return -1; else if (wrap2 === void 0) return 1; if (wrap1.type != wrap2.type) return wrap1.type.localeCompare(wrap2.type); if (wrap1.value === wrap2.value) return 0; switch (wrap1.type) { case "string": return wrap1.value.localeCompare(wrap2.value); case "number": if (wrap1.value < wrap2.value) return -1; else if (wrap1.value == wrap2.value) return 0; return 1; case "null": return 0; case "boolean": if (wrap1.value == wrap2.value) return 0; else return wrap1.value ? 1 : -1; case "link": let link1 = wrap1.value; let link2 = wrap2.value; let normalize = linkNormalizer !== null && linkNormalizer !== void 0 ? linkNormalizer : (x) => x; let pathCompare = normalize(link1.path).localeCompare(normalize(link2.path)); if (pathCompare != 0) return pathCompare; let typeCompare = link1.type.localeCompare(link2.type); if (typeCompare != 0) return typeCompare; if (link1.subpath && !link2.subpath) return 1; if (!link1.subpath && link2.subpath) return -1; if (!link1.subpath && !link2.subpath) return 0; return ((_a = link1.subpath) !== null && _a !== void 0 ? _a : "").localeCompare((_b = link2.subpath) !== null && _b !== void 0 ? _b : ""); case "date": return wrap1.value < wrap2.value ? -1 : wrap1.value.equals(wrap2.value) ? 0 : 1; case "duration": return wrap1.value < wrap2.value ? -1 : wrap1.value.equals(wrap2.value) ? 0 : 1; case "array": let f1 = wrap1.value; let f2 = wrap2.value; for (let index = 0; index < Math.min(f1.length, f2.length); index++) { let comp = compareValue(f1[index], f2[index]); if (comp != 0) return comp; } return f1.length - f2.length; case "object": let o1 = wrap1.value; let o2 = wrap2.value; let k1 = Array.from(Object.keys(o1)); let k2 = Array.from(Object.keys(o2)); k1.sort(); k2.sort(); let keyCompare = compareValue(k1, k2); if (keyCompare != 0) return keyCompare; for (let key2 of k1) { let comp = compareValue(o1[key2], o2[key2]); if (comp != 0) return comp; } return 0; case "widget": case "html": case "function": return 0; } } Values2.compareValue = compareValue; function typeOf(val) { var _a; return (_a = wrapValue(val)) === null || _a === void 0 ? void 0 : _a.type; } Values2.typeOf = typeOf; function isTruthy(field) { let wrapped = wrapValue(field); if (!wrapped) return false; switch (wrapped.type) { case "number": return wrapped.value != 0; case "string": return wrapped.value.length > 0; case "boolean": return wrapped.value; case "link": return !!wrapped.value.path; case "date": return wrapped.value.toMillis() != 0; case "duration": return wrapped.value.as("seconds") != 0; case "object": return Object.keys(wrapped.value).length > 0; case "array": return wrapped.value.length > 0; case "null": return false; case "html": case "widget": case "function": return true; } } Values2.isTruthy = isTruthy; function deepCopy(field) { if (field === null || field === void 0) return field; if (Values2.isArray(field)) { return [].concat(field.map((v) => deepCopy(v))); } else if (Values2.isObject(field)) { let result = {}; for (let [key2, value] of Object.entries(field)) result[key2] = deepCopy(value); return result; } else { return field; } } Values2.deepCopy = deepCopy; function isString3(val) { return typeof val == "string"; } Values2.isString = isString3; function isNumber3(val) { return typeof val == "number"; } Values2.isNumber = isNumber3; function isDate3(val) { return val instanceof DateTime2; } Values2.isDate = isDate3; function isDuration(val) { return val instanceof Duration3; } Values2.isDuration = isDuration; function isNull(val) { return val === null || val === void 0; } Values2.isNull = isNull; function isArray(val) { return Array.isArray(val); } Values2.isArray = isArray; function isBoolean(val) { return typeof val === "boolean"; } Values2.isBoolean = isBoolean; function isLink(val) { return val instanceof Link; } Values2.isLink = isLink; function isWidget(val) { return val instanceof Widget; } Values2.isWidget = isWidget; function isHtml(val) { if (typeof HTMLElement !== "undefined") { return val instanceof HTMLElement; } else { return false; } } Values2.isHtml = isHtml; function isObject(val) { return typeof val == "object" && !isHtml(val) && !isWidget(val) && !isArray(val) && !isDuration(val) && !isDate3(val) && !isLink(val) && val !== void 0 && !isNull(val); } Values2.isObject = isObject; function isFunction(val) { return typeof val == "function"; } Values2.isFunction = isFunction; })(Values || (Values = {})); var Groupings; (function(Groupings2) { function isElementGroup(entry) { return Values.isObject(entry) && Object.keys(entry).length == 2 && "key" in entry && "rows" in entry; } Groupings2.isElementGroup = isElementGroup; function isGrouping(entry) { for (let element of entry) if (!isElementGroup(element)) return false; return true; } Groupings2.isGrouping = isGrouping; function count(elements) { if (isGrouping(elements)) { let result = 0; for (let subgroup of elements) result += count(subgroup.rows); return result; } else { return elements.length; } } Groupings2.count = count; })(Groupings || (Groupings = {})); var Link = class _Link { /** Create a link to a specific file. */ static file(path2, embed = false, display) { return new _Link({ path: path2, embed, display, subpath: void 0, type: "file" }); } static infer(linkpath, embed = false, display) { if (linkpath.includes("#^")) { let split = linkpath.split("#^"); return _Link.block(split[0], split[1], embed, display); } else if (linkpath.includes("#")) { let split = linkpath.split("#"); return _Link.header(split[0], split[1], embed, display); } else return _Link.file(linkpath, embed, display); } /** Create a link to a specific file and header in that file. */ static header(path2, header, embed, display) { return new _Link({ path: path2, embed, display, subpath: normalizeHeaderForLink(header), type: "header" }); } /** Create a link to a specific file and block in that file. */ static block(path2, blockId, embed, display) { return new _Link({ path: path2, embed, display, subpath: blockId, type: "block" }); } static fromObject(object) { return new _Link(object); } constructor(fields) { Object.assign(this, fields); } /** Checks for link equality (i.e., that the links are pointing to the same exact location). */ equals(other) { if (other == void 0 || other == null) return false; return this.path == other.path && this.type == other.type && this.subpath == other.subpath; } /** Convert this link to it's markdown representation. */ toString() { return this.markdown(); } /** Convert this link to a raw object which is serialization-friendly. */ toObject() { return { path: this.path, type: this.type, subpath: this.subpath, display: this.display, embed: this.embed }; } /** Update this link with a new path. */ //@ts-ignore; error appeared after updating Obsidian to 0.15.4; it also updated other packages but didn't say which withPath(path2) { return new _Link(Object.assign({}, this, { path: path2 })); } /** Return a new link which points to the same location but with a new display value. */ withDisplay(display) { return new _Link(Object.assign({}, this, { display })); } /** Convert a file link into a link to a specific header. */ withHeader(header) { return _Link.header(this.path, header, this.embed, this.display); } /** Convert any link into a link to its file. */ toFile() { return _Link.file(this.path, this.embed, this.display); } /** Convert this link into an embedded link. */ toEmbed() { if (this.embed) { return this; } else { let link = new _Link(this); link.embed = true; return link; } } /** Convert this link into a non-embedded link. */ fromEmbed() { if (!this.embed) { return this; } else { let link = new _Link(this); link.embed = false; return link; } } /** Convert this link to markdown so it can be rendered. */ markdown() { let result = (this.embed ? "!" : "") + "[[" + this.obsidianLink(); if (this.display) { result += "|" + this.display; } else { result += "|" + getFileTitle(this.path); if (this.type == "header" || this.type == "block") result += " > " + this.subpath; } result += "]]"; return result; } /** Convert the inner part of the link to something that Obsidian can open / understand. */ obsidianLink() { var _a, _b; const escaped = this.path.replace("|", "\\|"); if (this.type == "header") return escaped + "#" + ((_a = this.subpath) === null || _a === void 0 ? void 0 : _a.replace("|", "\\|")); if (this.type == "block") return escaped + "#^" + ((_b = this.subpath) === null || _b === void 0 ? void 0 : _b.replace("|", "\\|")); else return escaped; } /** The stripped name of the file this link points to. */ fileName() { return getFileTitle(this.path).replace(".md", ""); } }; var Widget = class { constructor($widget) { this.$widget = $widget; } }; var ListPairWidget = class extends Widget { constructor(key2, value) { super("dataview:list-pair"); this.key = key2; this.value = value; } markdown() { return `${Values.toString(this.key)}: ${Values.toString(this.value)}`; } }; var ExternalLinkWidget = class extends Widget { constructor(url, display) { super("dataview:external-link"); this.url = url; this.display = display; } markdown() { var _a; return `[${(_a = this.display) !== null && _a !== void 0 ? _a : this.url}](${this.url})`; } }; var Widgets; (function(Widgets2) { function listPair(key2, value) { return new ListPairWidget(key2, value); } Widgets2.listPair = listPair; function externalLink(url, display) { return new ExternalLinkWidget(url, display); } Widgets2.externalLink = externalLink; function isListPair(widget) { return widget.$widget === "dataview:list-pair"; } Widgets2.isListPair = isListPair; function isExternalLink(widget) { return widget.$widget === "dataview:external-link"; } Widgets2.isExternalLink = isExternalLink; function isBuiltin(widget) { return isListPair(widget) || isExternalLink(widget); } Widgets2.isBuiltin = isBuiltin; })(Widgets || (Widgets = {})); var Fields; (function(Fields2) { function variable(name) { return { type: "variable", name }; } Fields2.variable = variable; function literal(value) { return { type: "literal", value }; } Fields2.literal = literal; function binaryOp(left, op, right) { return { type: "binaryop", left, op, right }; } Fields2.binaryOp = binaryOp; function index(obj, index2) { return { type: "index", object: obj, index: index2 }; } Fields2.index = index; function indexVariable(name) { let parts = name.split("."); let result = Fields2.variable(parts[0]); for (let index2 = 1; index2 < parts.length; index2++) { result = Fields2.index(result, Fields2.literal(parts[index2])); } return result; } Fields2.indexVariable = indexVariable; function lambda(args, value) { return { type: "lambda", arguments: args, value }; } Fields2.lambda = lambda; function func(func2, args) { return { type: "function", func: func2, arguments: args }; } Fields2.func = func; function list(values) { return { type: "list", values }; } Fields2.list = list; function object(values) { return { type: "object", values }; } Fields2.object = object; function negate(child) { return { type: "negated", child }; } Fields2.negate = negate; function isCompareOp(op) { return op == "<=" || op == "<" || op == ">" || op == ">=" || op == "!=" || op == "="; } Fields2.isCompareOp = isCompareOp; Fields2.NULL = Fields2.literal(null); })(Fields || (Fields = {})); var Sources; (function(Sources2) { function tag(tag2) { return { type: "tag", tag: tag2 }; } Sources2.tag = tag; function csv(path2) { return { type: "csv", path: path2 }; } Sources2.csv = csv; function folder(prefix2) { return { type: "folder", folder: prefix2 }; } Sources2.folder = folder; function link(file, incoming) { return { type: "link", file, direction: incoming ? "incoming" : "outgoing" }; } Sources2.link = link; function binaryOp(left, op, right) { return { type: "binaryop", left, op, right }; } Sources2.binaryOp = binaryOp; function and(left, right) { return { type: "binaryop", left, op: "&", right }; } Sources2.and = and; function or(left, right) { return { type: "binaryop", left, op: "|", right }; } Sources2.or = or; function negate(child) { return { type: "negate", child }; } Sources2.negate = negate; function empty() { return { type: "empty" }; } Sources2.empty = empty; })(Sources || (Sources = {})); var EMOJI_REGEX = new RegExp(emojiRegex(), ""); var DURATION_TYPES = { year: Duration3.fromObject({ years: 1 }), years: Duration3.fromObject({ years: 1 }), yr: Duration3.fromObject({ years: 1 }), yrs: Duration3.fromObject({ years: 1 }), month: Duration3.fromObject({ months: 1 }), months: Duration3.fromObject({ months: 1 }), mo: Duration3.fromObject({ months: 1 }), mos: Duration3.fromObject({ months: 1 }), week: Duration3.fromObject({ weeks: 1 }), weeks: Duration3.fromObject({ weeks: 1 }), wk: Duration3.fromObject({ weeks: 1 }), wks: Duration3.fromObject({ weeks: 1 }), w: Duration3.fromObject({ weeks: 1 }), day: Duration3.fromObject({ days: 1 }), days: Duration3.fromObject({ days: 1 }), d: Duration3.fromObject({ days: 1 }), hour: Duration3.fromObject({ hours: 1 }), hours: Duration3.fromObject({ hours: 1 }), hr: Duration3.fromObject({ hours: 1 }), hrs: Duration3.fromObject({ hours: 1 }), h: Duration3.fromObject({ hours: 1 }), minute: Duration3.fromObject({ minutes: 1 }), minutes: Duration3.fromObject({ minutes: 1 }), min: Duration3.fromObject({ minutes: 1 }), mins: Duration3.fromObject({ minutes: 1 }), m: Duration3.fromObject({ minutes: 1 }), second: Duration3.fromObject({ seconds: 1 }), seconds: Duration3.fromObject({ seconds: 1 }), sec: Duration3.fromObject({ seconds: 1 }), secs: Duration3.fromObject({ seconds: 1 }), s: Duration3.fromObject({ seconds: 1 }) }; var DATE_SHORTHANDS = { now: () => DateTime2.local(), today: () => DateTime2.local().startOf("day"), yesterday: () => DateTime2.local().startOf("day").minus(Duration3.fromObject({ days: 1 })), tomorrow: () => DateTime2.local().startOf("day").plus(Duration3.fromObject({ days: 1 })), sow: () => DateTime2.local().startOf("week"), "start-of-week": () => DateTime2.local().startOf("week"), eow: () => DateTime2.local().endOf("week"), "end-of-week": () => DateTime2.local().endOf("week"), soy: () => DateTime2.local().startOf("year"), "start-of-year": () => DateTime2.local().startOf("year"), eoy: () => DateTime2.local().endOf("year"), "end-of-year": () => DateTime2.local().endOf("year"), som: () => DateTime2.local().startOf("month"), "start-of-month": () => DateTime2.local().startOf("month"), eom: () => DateTime2.local().endOf("month"), "end-of-month": () => DateTime2.local().endOf("month") }; var KEYWORDS = ["FROM", "WHERE", "LIMIT", "GROUP", "FLATTEN"]; function splitOnUnescapedPipe(link) { let pipe = -1; while ((pipe = link.indexOf("|", pipe + 1)) >= 0) { if (pipe > 0 && link[pipe - 1] == "\\") continue; return [link.substring(0, pipe).replace(/\\\|/g, "|"), link.substring(pipe + 1)]; } return [link.replace(/\\\|/g, "|"), void 0]; } function parseInnerLink(rawlink) { let [link, display] = splitOnUnescapedPipe(rawlink); return Link.infer(link, false, display); } function createBinaryParser(child, sep, combine) { return parsimmon_umd_minExports.seqMap(child, parsimmon_umd_minExports.seq(parsimmon_umd_minExports.optWhitespace, sep, parsimmon_umd_minExports.optWhitespace, child).many(), (first, rest) => { if (rest.length == 0) return first; let node = combine(first, rest[0][1], rest[0][3]); for (let index = 1; index < rest.length; index++) { node = combine(node, rest[index][1], rest[index][3]); } return node; }); } function chainOpt(base, ...funcs) { return parsimmon_umd_minExports.custom((success, failure) => { return (input, i) => { let result = base._(input, i); if (!result.status) return result; for (let func of funcs) { let next = func(result.value)._(input, result.index); if (!next.status) return result; result = next; } return result; }; }); } var EXPRESSION = parsimmon_umd_minExports.createLanguage({ // A floating point number; the decimal point is optional. number: (q) => parsimmon_umd_minExports.regexp(/-?[0-9]+(\.[0-9]+)?/).map((str) => Number.parseFloat(str)).desc("number"), // A quote-surrounded string which supports escape characters ('\'). string: (q) => parsimmon_umd_minExports.string('"').then(parsimmon_umd_minExports.alt(q.escapeCharacter, parsimmon_umd_minExports.noneOf('"\\')).atLeast(0).map((chars) => chars.join(""))).skip(parsimmon_umd_minExports.string('"')).desc("string"), escapeCharacter: (_18) => parsimmon_umd_minExports.string("\\").then(parsimmon_umd_minExports.any).map((escaped) => { if (escaped === '"') return '"'; if (escaped === "\\") return "\\"; else return "\\" + escaped; }), // A boolean true/false value. bool: (_18) => parsimmon_umd_minExports.regexp(/true|false|True|False/).map((str) => str.toLowerCase() == "true").desc("boolean ('true' or 'false')"), // A tag of the form '#stuff/hello-there'. tag: (_18) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("#"), parsimmon_umd_minExports.alt(parsimmon_umd_minExports.regexp(/[^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]/).desc("text")).many(), (start, rest) => start + rest.join("")).desc("tag ('#hello/stuff')"), // A variable identifier, which is alphanumeric and must start with a letter or... emoji. identifier: (_18) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.alt(parsimmon_umd_minExports.regexp(/\p{Letter}/u), parsimmon_umd_minExports.regexp(EMOJI_REGEX).desc("text")), parsimmon_umd_minExports.alt(parsimmon_umd_minExports.regexp(/[0-9\p{Letter}_-]/u), parsimmon_umd_minExports.regexp(EMOJI_REGEX).desc("text")).many(), (first, rest) => first + rest.join("")).desc("variable identifier"), // An Obsidian link of the form [[]]. link: (_18) => parsimmon_umd_minExports.regexp(/\[\[([^\[\]]*?)\]\]/u, 1).map((linkInner) => parseInnerLink(linkInner)).desc("file link"), // An embeddable link which can start with '!'. This overlaps with the normal negation operator, so it is only // provided for metadata parsing. embedLink: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("!").atMost(1), q.link, (p, l3) => { if (p.length > 0) l3.embed = true; return l3; }).desc("file link"), // Binary plus or minus operator. binaryPlusMinus: (_18) => parsimmon_umd_minExports.regexp(/\+|-/).map((str) => str).desc("'+' or '-'"), // Binary times or divide operator. binaryMulDiv: (_18) => parsimmon_umd_minExports.regexp(/\*|\/|%/).map((str) => str).desc("'*' or '/' or '%'"), // Binary comparison operator. binaryCompareOp: (_18) => parsimmon_umd_minExports.regexp(/>=|<=|!=|>|<|=/).map((str) => str).desc("'>=' or '<=' or '!=' or '=' or '>' or '<'"), // Binary boolean combination operator. binaryBooleanOp: (_18) => parsimmon_umd_minExports.regexp(/and|or|&|\|/i).map((str) => { if (str.toLowerCase() == "and") return "&"; else if (str.toLowerCase() == "or") return "|"; else return str; }).desc("'and' or 'or'"), // A date which can be YYYY-MM[-DDTHH:mm:ss]. rootDate: (_18) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.regexp(/\d{4}/), parsimmon_umd_minExports.string("-"), parsimmon_umd_minExports.regexp(/\d{2}/), (year, _19, month) => { return DateTime2.fromObject({ year: Number.parseInt(year), month: Number.parseInt(month) }); }).desc("date in format YYYY-MM[-DDTHH-MM-SS.MS]"), dateShorthand: (_18) => parsimmon_umd_minExports.alt(...Object.keys(DATE_SHORTHANDS).sort((a, b) => b.length - a.length).map(parsimmon_umd_minExports.string)), date: (q) => chainOpt(q.rootDate, (ym) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("-"), parsimmon_umd_minExports.regexp(/\d{2}/), (_18, day) => ym.set({ day: Number.parseInt(day) })), (ymd) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("T"), parsimmon_umd_minExports.regexp(/\d{2}/), (_18, hour) => ymd.set({ hour: Number.parseInt(hour) })), (ymdh) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string(":"), parsimmon_umd_minExports.regexp(/\d{2}/), (_18, minute) => ymdh.set({ minute: Number.parseInt(minute) })), (ymdhm) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string(":"), parsimmon_umd_minExports.regexp(/\d{2}/), (_18, second) => ymdhm.set({ second: Number.parseInt(second) })), (ymdhms) => parsimmon_umd_minExports.alt( parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("."), parsimmon_umd_minExports.regexp(/\d{3}/), (_18, millisecond) => ymdhms.set({ millisecond: Number.parseInt(millisecond) })), parsimmon_umd_minExports.succeed(ymdhms) // pass ), (dt) => parsimmon_umd_minExports.alt(parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("+").or(parsimmon_umd_minExports.string("-")), parsimmon_umd_minExports.regexp(/\d{1,2}(:\d{2})?/), (pm, hr) => dt.setZone("UTC" + pm + hr, { keepLocalTime: true })), parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("Z"), () => dt.setZone("utc", { keepLocalTime: true })), parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("["), parsimmon_umd_minExports.regexp(/[0-9A-Za-z+-\/]+/u), parsimmon_umd_minExports.string("]"), (_a, zone, _b) => dt.setZone(zone, { keepLocalTime: true })))).assert((dt) => dt.isValid, "valid date").desc("date in format YYYY-MM[-DDTHH-MM-SS.MS]"), // A date, plus various shorthand times of day it could be. datePlus: (q) => parsimmon_umd_minExports.alt(q.dateShorthand.map((d) => DATE_SHORTHANDS[d]()), q.date).desc("date in format YYYY-MM[-DDTHH-MM-SS.MS] or in shorthand"), // A duration of time. durationType: (_18) => parsimmon_umd_minExports.alt(...Object.keys(DURATION_TYPES).sort((a, b) => b.length - a.length).map(parsimmon_umd_minExports.string)), duration: (q) => parsimmon_umd_minExports.seqMap(q.number, parsimmon_umd_minExports.optWhitespace, q.durationType, (count, _18, t) => DURATION_TYPES[t].mapUnits((x) => x * count)).sepBy1(parsimmon_umd_minExports.string(",").trim(parsimmon_umd_minExports.optWhitespace).or(parsimmon_umd_minExports.optWhitespace)).map((durations) => durations.reduce((p, c) => p.plus(c))).desc("duration like 4hr2min"), // A raw null value. rawNull: (_18) => parsimmon_umd_minExports.string("null"), // Source parsing. tagSource: (q) => q.tag.map((tag) => Sources.tag(tag)), csvSource: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("csv(").skip(parsimmon_umd_minExports.optWhitespace), q.string, parsimmon_umd_minExports.string(")"), (_1, path2, _22) => Sources.csv(path2)), linkIncomingSource: (q) => q.link.map((link) => Sources.link(link.path, true)), linkOutgoingSource: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("outgoing(").skip(parsimmon_umd_minExports.optWhitespace), q.link, parsimmon_umd_minExports.string(")"), (_1, link, _22) => Sources.link(link.path, false)), folderSource: (q) => q.string.map((str) => Sources.folder(str)), parensSource: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("("), parsimmon_umd_minExports.optWhitespace, q.source, parsimmon_umd_minExports.optWhitespace, parsimmon_umd_minExports.string(")"), (_1, _22, field, _32, _42) => field), negateSource: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.alt(parsimmon_umd_minExports.string("-"), parsimmon_umd_minExports.string("!")), q.atomSource, (_18, source) => Sources.negate(source)), atomSource: (q) => parsimmon_umd_minExports.alt(q.parensSource, q.negateSource, q.linkOutgoingSource, q.linkIncomingSource, q.folderSource, q.tagSource, q.csvSource), binaryOpSource: (q) => createBinaryParser(q.atomSource, q.binaryBooleanOp.map((s3) => s3), Sources.binaryOp), source: (q) => q.binaryOpSource, // Field parsing. variableField: (q) => q.identifier.chain((r) => { if (KEYWORDS.includes(r.toUpperCase())) { return parsimmon_umd_minExports.fail("Variable fields cannot be a keyword (" + KEYWORDS.join(" or ") + ")"); } else { return parsimmon_umd_minExports.succeed(Fields.variable(r)); } }).desc("variable"), numberField: (q) => q.number.map((val) => Fields.literal(val)).desc("number"), stringField: (q) => q.string.map((val) => Fields.literal(val)).desc("string"), boolField: (q) => q.bool.map((val) => Fields.literal(val)).desc("boolean"), dateField: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("date("), parsimmon_umd_minExports.optWhitespace, q.datePlus, parsimmon_umd_minExports.optWhitespace, parsimmon_umd_minExports.string(")"), (prefix2, _1, date, _22, postfix) => Fields.literal(date)).desc("date"), durationField: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("dur("), parsimmon_umd_minExports.optWhitespace, q.duration, parsimmon_umd_minExports.optWhitespace, parsimmon_umd_minExports.string(")"), (prefix2, _1, dur, _22, postfix) => Fields.literal(dur)).desc("duration"), nullField: (q) => q.rawNull.map((_18) => Fields.NULL), linkField: (q) => q.link.map((f) => Fields.literal(f)), listField: (q) => q.field.sepBy(parsimmon_umd_minExports.string(",").trim(parsimmon_umd_minExports.optWhitespace)).wrap(parsimmon_umd_minExports.string("[").skip(parsimmon_umd_minExports.optWhitespace), parsimmon_umd_minExports.optWhitespace.then(parsimmon_umd_minExports.string("]"))).map((l3) => Fields.list(l3)).desc("list ('[1, 2, 3]')"), objectField: (q) => parsimmon_umd_minExports.seqMap(q.identifier.or(q.string), parsimmon_umd_minExports.string(":").trim(parsimmon_umd_minExports.optWhitespace), q.field, (name, _sep, value) => { return { name, value }; }).sepBy(parsimmon_umd_minExports.string(",").trim(parsimmon_umd_minExports.optWhitespace)).wrap(parsimmon_umd_minExports.string("{").skip(parsimmon_umd_minExports.optWhitespace), parsimmon_umd_minExports.optWhitespace.then(parsimmon_umd_minExports.string("}"))).map((vals) => { let res = {}; for (let entry of vals) res[entry.name] = entry.value; return Fields.object(res); }).desc("object ('{ a: 1, b: 2 }')"), atomInlineField: (q) => parsimmon_umd_minExports.alt(q.date, q.duration.map((d) => normalizeDuration(d)), q.string, q.tag, q.embedLink, q.bool, q.number, q.rawNull), inlineFieldList: (q) => q.atomInlineField.sepBy(parsimmon_umd_minExports.string(",").trim(parsimmon_umd_minExports.optWhitespace).lookahead(q.atomInlineField)), inlineField: (q) => parsimmon_umd_minExports.alt(parsimmon_umd_minExports.seqMap(q.atomInlineField, parsimmon_umd_minExports.string(",").trim(parsimmon_umd_minExports.optWhitespace), q.inlineFieldList, (f, _s, l3) => [f].concat(l3)), q.atomInlineField), atomField: (q) => parsimmon_umd_minExports.alt( // Place embed links above negated fields as they are the special parser case '![[thing]]' and are generally unambigious. q.embedLink.map((l3) => Fields.literal(l3)), q.negatedField, q.linkField, q.listField, q.objectField, q.lambdaField, q.parensField, q.boolField, q.numberField, q.stringField, q.dateField, q.durationField, q.nullField, q.variableField ), indexField: (q) => parsimmon_umd_minExports.seqMap(q.atomField, parsimmon_umd_minExports.alt(q.dotPostfix, q.indexPostfix, q.functionPostfix).many(), (obj, postfixes) => { let result = obj; for (let post of postfixes) { switch (post.type) { case "dot": result = Fields.index(result, Fields.literal(post.field)); break; case "index": result = Fields.index(result, post.field); break; case "function": result = Fields.func(result, post.fields); break; } } return result; }), negatedField: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("!"), q.indexField, (_18, field) => Fields.negate(field)).desc("negated field"), parensField: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("("), parsimmon_umd_minExports.optWhitespace, q.field, parsimmon_umd_minExports.optWhitespace, parsimmon_umd_minExports.string(")"), (_1, _22, field, _32, _42) => field), lambdaField: (q) => parsimmon_umd_minExports.seqMap(q.identifier.sepBy(parsimmon_umd_minExports.string(",").trim(parsimmon_umd_minExports.optWhitespace)).wrap(parsimmon_umd_minExports.string("(").trim(parsimmon_umd_minExports.optWhitespace), parsimmon_umd_minExports.string(")").trim(parsimmon_umd_minExports.optWhitespace)), parsimmon_umd_minExports.string("=>").trim(parsimmon_umd_minExports.optWhitespace), q.field, (ident, _ignore, value) => { return { type: "lambda", arguments: ident, value }; }), dotPostfix: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("."), q.identifier, (_18, field) => { return { type: "dot", field }; }), indexPostfix: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("["), parsimmon_umd_minExports.optWhitespace, q.field, parsimmon_umd_minExports.optWhitespace, parsimmon_umd_minExports.string("]"), (_18, _22, field, _32, _42) => { return { type: "index", field }; }), functionPostfix: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("("), parsimmon_umd_minExports.optWhitespace, q.field.sepBy(parsimmon_umd_minExports.string(",").trim(parsimmon_umd_minExports.optWhitespace)), parsimmon_umd_minExports.optWhitespace, parsimmon_umd_minExports.string(")"), (_18, _1, fields, _22, _32) => { return { type: "function", fields }; }), // The precedence hierarchy of operators - multiply/divide, add/subtract, compare, and then boolean operations. binaryMulDivField: (q) => createBinaryParser(q.indexField, q.binaryMulDiv, Fields.binaryOp), binaryPlusMinusField: (q) => createBinaryParser(q.binaryMulDivField, q.binaryPlusMinus, Fields.binaryOp), binaryCompareField: (q) => createBinaryParser(q.binaryPlusMinusField, q.binaryCompareOp, Fields.binaryOp), binaryBooleanField: (q) => createBinaryParser(q.binaryCompareField, q.binaryBooleanOp, Fields.binaryOp), binaryOpField: (q) => q.binaryBooleanField, field: (q) => q.binaryOpField }); function parseField(text) { try { return Result.success(EXPRESSION.field.tryParse(text)); } catch (error) { return Result.failure("" + error); } } var QueryFields; (function(QueryFields2) { function named(name, field) { return { name, field }; } QueryFields2.named = named; function sortBy(field, dir) { return { field, direction: dir }; } QueryFields2.sortBy = sortBy; })(QueryFields || (QueryFields = {})); function captureRaw(base) { return parsimmon_umd_minExports.custom((success, failure) => { return (input, i) => { let result = base._(input, i); if (!result.status) return result; return Object.assign({}, result, { value: [result.value, input.substring(i, result.index)] }); }; }); } function stripNewlines(text) { return text.split(/[\r\n]+/).map((t) => t.trim()).join(""); } function precededByWhitespaceIfNotEof(if_eof, parser) { return parsimmon_umd_minExports.eof.map(if_eof).or(parsimmon_umd_minExports.whitespace.then(parser)); } var QUERY_LANGUAGE = parsimmon_umd_minExports.createLanguage({ // Simple atom parsing, like words, identifiers, numbers. queryType: (q) => parsimmon_umd_minExports.alt(parsimmon_umd_minExports.regexp(/TABLE|LIST|TASK|CALENDAR/i)).map((str) => str.toLowerCase()).desc("query type ('TABLE', 'LIST', 'TASK', or 'CALENDAR')"), explicitNamedField: (q) => parsimmon_umd_minExports.seqMap(EXPRESSION.field.skip(parsimmon_umd_minExports.whitespace), parsimmon_umd_minExports.regexp(/AS/i).skip(parsimmon_umd_minExports.whitespace), EXPRESSION.identifier.or(EXPRESSION.string), (field, _as, ident) => QueryFields.named(ident, field)), namedField: (q) => parsimmon_umd_minExports.alt(q.explicitNamedField, captureRaw(EXPRESSION.field).map(([value, text]) => QueryFields.named(stripNewlines(text), value))), sortField: (q) => parsimmon_umd_minExports.seqMap(EXPRESSION.field.skip(parsimmon_umd_minExports.optWhitespace), parsimmon_umd_minExports.regexp(/ASCENDING|DESCENDING|ASC|DESC/i).atMost(1), (field, dir) => { let direction = dir.length == 0 ? "ascending" : dir[0].toLowerCase(); if (direction == "desc") direction = "descending"; if (direction == "asc") direction = "ascending"; return { field, direction }; }), headerClause: (q) => q.queryType.chain((type) => { switch (type) { case "table": { return precededByWhitespaceIfNotEof(() => ({ type, fields: [], showId: true }), parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.regexp(/WITHOUT\s+ID/i).skip(parsimmon_umd_minExports.optWhitespace).atMost(1), parsimmon_umd_minExports.sepBy(q.namedField, parsimmon_umd_minExports.string(",").trim(parsimmon_umd_minExports.optWhitespace)), (withoutId, fields) => { return { type, fields, showId: withoutId.length == 0 }; })); } case "list": return precededByWhitespaceIfNotEof(() => ({ type, format: void 0, showId: true }), parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.regexp(/WITHOUT\s+ID/i).skip(parsimmon_umd_minExports.optWhitespace).atMost(1), EXPRESSION.field.atMost(1), (withoutId, format) => { return { type, format: format.length == 1 ? format[0] : void 0, showId: withoutId.length == 0 }; })); case "task": return parsimmon_umd_minExports.succeed({ type }); case "calendar": return parsimmon_umd_minExports.whitespace.then(parsimmon_umd_minExports.seqMap(q.namedField, (field) => { return { type, showId: true, field }; })); default: return parsimmon_umd_minExports.fail(`Unrecognized query type '${type}'`); } }).desc("TABLE or LIST or TASK or CALENDAR"), fromClause: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.regexp(/FROM/i), parsimmon_umd_minExports.whitespace, EXPRESSION.source, (_1, _22, source) => source), whereClause: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.regexp(/WHERE/i), parsimmon_umd_minExports.whitespace, EXPRESSION.field, (where, _18, field) => { return { type: "where", clause: field }; }).desc("WHERE "), sortByClause: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.regexp(/SORT/i), parsimmon_umd_minExports.whitespace, q.sortField.sepBy1(parsimmon_umd_minExports.string(",").trim(parsimmon_umd_minExports.optWhitespace)), (sort, _1, fields) => { return { type: "sort", fields }; }).desc("SORT field [ASC/DESC]"), limitClause: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.regexp(/LIMIT/i), parsimmon_umd_minExports.whitespace, EXPRESSION.field, (limit, _1, field) => { return { type: "limit", amount: field }; }).desc("LIMIT "), flattenClause: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.regexp(/FLATTEN/i).skip(parsimmon_umd_minExports.whitespace), q.namedField, (_18, field) => { return { type: "flatten", field }; }).desc("FLATTEN [AS ]"), groupByClause: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.regexp(/GROUP BY/i).skip(parsimmon_umd_minExports.whitespace), q.namedField, (_18, field) => { return { type: "group", field }; }).desc("GROUP BY [AS ]"), // Full query parsing. clause: (q) => parsimmon_umd_minExports.alt(q.fromClause, q.whereClause, q.sortByClause, q.limitClause, q.groupByClause, q.flattenClause), query: (q) => parsimmon_umd_minExports.seqMap(q.headerClause.trim(parsimmon_umd_minExports.optWhitespace), q.fromClause.trim(parsimmon_umd_minExports.optWhitespace).atMost(1), q.clause.trim(parsimmon_umd_minExports.optWhitespace).many(), (header, from, clauses) => { return { header, source: from.length == 0 ? Sources.folder("") : from[0], operations: clauses, settings: DEFAULT_QUERY_SETTINGS }; }) }); var getAPI4 = (app2) => { var _a; if (app2) return (_a = app2.plugins.plugins.dataview) === null || _a === void 0 ? void 0 : _a.api; else return window.DataviewAPI; }; var isPluginEnabled = (app2) => app2.plugins.enabledPlugins.has("dataview"); exports.DATE_SHORTHANDS = DATE_SHORTHANDS; exports.DURATION_TYPES = DURATION_TYPES; exports.EXPRESSION = EXPRESSION; exports.KEYWORDS = KEYWORDS; exports.QUERY_LANGUAGE = QUERY_LANGUAGE; exports.getAPI = getAPI4; exports.isPluginEnabled = isPluginEnabled; exports.parseField = parseField; } }); // node_modules/lodash/lodash.js var require_lodash = __commonJS({ "node_modules/lodash/lodash.js"(exports, module2) { (function() { var undefined2; var VERSION = "4.17.21"; var LARGE_ARRAY_SIZE = 200; var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT = "Expected a function", INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`"; var HASH_UNDEFINED = "__lodash_hash_undefined__"; var MAX_MEMOIZE_SIZE = 500; var PLACEHOLDER = "__lodash_placeholder__"; var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4; var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512; var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "..."; var HOT_COUNT = 800, HOT_SPAN = 16; var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3; var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0; var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; var wrapFlags = [ ["ary", WRAP_ARY_FLAG], ["bind", WRAP_BIND_FLAG], ["bindKey", WRAP_BIND_KEY_FLAG], ["curry", WRAP_CURRY_FLAG], ["curryRight", WRAP_CURRY_RIGHT_FLAG], ["flip", WRAP_FLIP_FLAG], ["partial", WRAP_PARTIAL_FLAG], ["partialRight", WRAP_PARTIAL_RIGHT_FLAG], ["rearg", WRAP_REARG_FLAG] ]; var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", domExcTag = "[object DOMException]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]", weakSetTag = "[object WeakSet]"; var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]"; var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source); var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g; var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source); var reTrimStart = /^\s+/; var reWhitespace = /\s/; var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /; var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; var reEscapeChar = /\\(\\)?/g; var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; var reFlags = /\w*$/; var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; var reIsBinary = /^0b[01]+$/i; var reIsHostCtor = /^\[object .+?Constructor\]$/; var reIsOctal = /^0o[0-7]+$/i; var reIsUint = /^(?:0|[1-9]\d*)$/; var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; var reNoMatch = /($^)/; var reUnescapedString = /['\n\r\u2028\u2029\\]/g; var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; var rsApos = "['\u2019]", rsAstral = "[" + rsAstralRange + "]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d"; var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")", rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?", rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq, rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")"; var reApos = RegExp(rsApos, "g"); var reComboMark = RegExp(rsCombo, "g"); var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g"); var reUnicodeWord = RegExp([ rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")", rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")", rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower, rsUpper + "+" + rsOptContrUpper, rsOrdUpper, rsOrdLower, rsDigits, rsEmoji ].join("|"), "g"); var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]"); var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; var contextProps = [ "Array", "Buffer", "DataView", "Date", "Error", "Float32Array", "Float64Array", "Function", "Int8Array", "Int16Array", "Int32Array", "Map", "Math", "Object", "Promise", "RegExp", "Set", "String", "Symbol", "TypeError", "Uint8Array", "Uint8ClampedArray", "Uint16Array", "Uint32Array", "WeakMap", "_", "clearTimeout", "isFinite", "parseInt", "setTimeout" ]; var templateCounter = -1; var typedArrayTags = {}; typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; var cloneableTags = {}; cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false; var deburredLetters = { // Latin-1 Supplement block. "\xC0": "A", "\xC1": "A", "\xC2": "A", "\xC3": "A", "\xC4": "A", "\xC5": "A", "\xE0": "a", "\xE1": "a", "\xE2": "a", "\xE3": "a", "\xE4": "a", "\xE5": "a", "\xC7": "C", "\xE7": "c", "\xD0": "D", "\xF0": "d", "\xC8": "E", "\xC9": "E", "\xCA": "E", "\xCB": "E", "\xE8": "e", "\xE9": "e", "\xEA": "e", "\xEB": "e", "\xCC": "I", "\xCD": "I", "\xCE": "I", "\xCF": "I", "\xEC": "i", "\xED": "i", "\xEE": "i", "\xEF": "i", "\xD1": "N", "\xF1": "n", "\xD2": "O", "\xD3": "O", "\xD4": "O", "\xD5": "O", "\xD6": "O", "\xD8": "O", "\xF2": "o", "\xF3": "o", "\xF4": "o", "\xF5": "o", "\xF6": "o", "\xF8": "o", "\xD9": "U", "\xDA": "U", "\xDB": "U", "\xDC": "U", "\xF9": "u", "\xFA": "u", "\xFB": "u", "\xFC": "u", "\xDD": "Y", "\xFD": "y", "\xFF": "y", "\xC6": "Ae", "\xE6": "ae", "\xDE": "Th", "\xFE": "th", "\xDF": "ss", // Latin Extended-A block. "\u0100": "A", "\u0102": "A", "\u0104": "A", "\u0101": "a", "\u0103": "a", "\u0105": "a", "\u0106": "C", "\u0108": "C", "\u010A": "C", "\u010C": "C", "\u0107": "c", "\u0109": "c", "\u010B": "c", "\u010D": "c", "\u010E": "D", "\u0110": "D", "\u010F": "d", "\u0111": "d", "\u0112": "E", "\u0114": "E", "\u0116": "E", "\u0118": "E", "\u011A": "E", "\u0113": "e", "\u0115": "e", "\u0117": "e", "\u0119": "e", "\u011B": "e", "\u011C": "G", "\u011E": "G", "\u0120": "G", "\u0122": "G", "\u011D": "g", "\u011F": "g", "\u0121": "g", "\u0123": "g", "\u0124": "H", "\u0126": "H", "\u0125": "h", "\u0127": "h", "\u0128": "I", "\u012A": "I", "\u012C": "I", "\u012E": "I", "\u0130": "I", "\u0129": "i", "\u012B": "i", "\u012D": "i", "\u012F": "i", "\u0131": "i", "\u0134": "J", "\u0135": "j", "\u0136": "K", "\u0137": "k", "\u0138": "k", "\u0139": "L", "\u013B": "L", "\u013D": "L", "\u013F": "L", "\u0141": "L", "\u013A": "l", "\u013C": "l", "\u013E": "l", "\u0140": "l", "\u0142": "l", "\u0143": "N", "\u0145": "N", "\u0147": "N", "\u014A": "N", "\u0144": "n", "\u0146": "n", "\u0148": "n", "\u014B": "n", "\u014C": "O", "\u014E": "O", "\u0150": "O", "\u014D": "o", "\u014F": "o", "\u0151": "o", "\u0154": "R", "\u0156": "R", "\u0158": "R", "\u0155": "r", "\u0157": "r", "\u0159": "r", "\u015A": "S", "\u015C": "S", "\u015E": "S", "\u0160": "S", "\u015B": "s", "\u015D": "s", "\u015F": "s", "\u0161": "s", "\u0162": "T", "\u0164": "T", "\u0166": "T", "\u0163": "t", "\u0165": "t", "\u0167": "t", "\u0168": "U", "\u016A": "U", "\u016C": "U", "\u016E": "U", "\u0170": "U", "\u0172": "U", "\u0169": "u", "\u016B": "u", "\u016D": "u", "\u016F": "u", "\u0171": "u", "\u0173": "u", "\u0174": "W", "\u0175": "w", "\u0176": "Y", "\u0177": "y", "\u0178": "Y", "\u0179": "Z", "\u017B": "Z", "\u017D": "Z", "\u017A": "z", "\u017C": "z", "\u017E": "z", "\u0132": "IJ", "\u0133": "ij", "\u0152": "Oe", "\u0153": "oe", "\u0149": "'n", "\u017F": "s" }; var htmlEscapes = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }; var htmlUnescapes = { "&": "&", "<": "<", ">": ">", """: '"', "'": "'" }; var stringEscapes = { "\\": "\\", "'": "'", "\n": "n", "\r": "r", "\u2028": "u2028", "\u2029": "u2029" }; var freeParseFloat = parseFloat, freeParseInt = parseInt; var freeGlobal = typeof global == "object" && global && global.Object === Object && global; var freeSelf = typeof self == "object" && self && self.Object === Object && self; var root = freeGlobal || freeSelf || Function("return this")(); var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports; var freeModule = freeExports && typeof module2 == "object" && module2 && !module2.nodeType && module2; var moduleExports = freeModule && freeModule.exports === freeExports; var freeProcess = moduleExports && freeGlobal.process; var nodeUtil = function() { try { var types = freeModule && freeModule.require && freeModule.require("util").types; if (types) { return types; } return freeProcess && freeProcess.binding && freeProcess.binding("util"); } catch (e) { } }(); var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, nodeIsDate = nodeUtil && nodeUtil.isDate, nodeIsMap = nodeUtil && nodeUtil.isMap, nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, nodeIsSet = nodeUtil && nodeUtil.isSet, nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; function apply(func, thisArg, args) { switch (args.length) { case 0: return func.call(thisArg); case 1: return func.call(thisArg, args[0]); case 2: return func.call(thisArg, args[0], args[1]); case 3: return func.call(thisArg, args[0], args[1], args[2]); } return func.apply(thisArg, args); } function arrayAggregator(array, setter, iteratee, accumulator) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { var value = array[index]; setter(accumulator, value, iteratee(value), array); } return accumulator; } function arrayEach(array, iteratee) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (iteratee(array[index], index, array) === false) { break; } } return array; } function arrayEachRight(array, iteratee) { var length = array == null ? 0 : array.length; while (length--) { if (iteratee(array[length], length, array) === false) { break; } } return array; } function arrayEvery(array, predicate) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (!predicate(array[index], index, array)) { return false; } } return true; } function arrayFilter(array, predicate) { var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (predicate(value, index, array)) { result[resIndex++] = value; } } return result; } function arrayIncludes(array, value) { var length = array == null ? 0 : array.length; return !!length && baseIndexOf(array, value, 0) > -1; } function arrayIncludesWith(array, value, comparator) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (comparator(value, array[index])) { return true; } } return false; } function arrayMap(array, iteratee) { var index = -1, length = array == null ? 0 : array.length, result = Array(length); while (++index < length) { result[index] = iteratee(array[index], index, array); } return result; } function arrayPush(array, values) { var index = -1, length = values.length, offset2 = array.length; while (++index < length) { array[offset2 + index] = values[index]; } return array; } function arrayReduce(array, iteratee, accumulator, initAccum) { var index = -1, length = array == null ? 0 : array.length; if (initAccum && length) { accumulator = array[++index]; } while (++index < length) { accumulator = iteratee(accumulator, array[index], index, array); } return accumulator; } function arrayReduceRight(array, iteratee, accumulator, initAccum) { var length = array == null ? 0 : array.length; if (initAccum && length) { accumulator = array[--length]; } while (length--) { accumulator = iteratee(accumulator, array[length], length, array); } return accumulator; } function arraySome(array, predicate) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (predicate(array[index], index, array)) { return true; } } return false; } var asciiSize = baseProperty("length"); function asciiToArray(string) { return string.split(""); } function asciiWords(string) { return string.match(reAsciiWord) || []; } function baseFindKey(collection, predicate, eachFunc) { var result; eachFunc(collection, function(value, key2, collection2) { if (predicate(value, key2, collection2)) { result = key2; return false; } }); return result; } function baseFindIndex(array, predicate, fromIndex, fromRight) { var length = array.length, index = fromIndex + (fromRight ? 1 : -1); while (fromRight ? index-- : ++index < length) { if (predicate(array[index], index, array)) { return index; } } return -1; } function baseIndexOf(array, value, fromIndex) { return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex); } function baseIndexOfWith(array, value, fromIndex, comparator) { var index = fromIndex - 1, length = array.length; while (++index < length) { if (comparator(array[index], value)) { return index; } } return -1; } function baseIsNaN(value) { return value !== value; } function baseMean(array, iteratee) { var length = array == null ? 0 : array.length; return length ? baseSum(array, iteratee) / length : NAN; } function baseProperty(key2) { return function(object) { return object == null ? undefined2 : object[key2]; }; } function basePropertyOf(object) { return function(key2) { return object == null ? undefined2 : object[key2]; }; } function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { eachFunc(collection, function(value, index, collection2) { accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection2); }); return accumulator; } function baseSortBy(array, comparer) { var length = array.length; array.sort(comparer); while (length--) { array[length] = array[length].value; } return array; } function baseSum(array, iteratee) { var result, index = -1, length = array.length; while (++index < length) { var current2 = iteratee(array[index]); if (current2 !== undefined2) { result = result === undefined2 ? current2 : result + current2; } } return result; } function baseTimes(n2, iteratee) { var index = -1, result = Array(n2); while (++index < n2) { result[index] = iteratee(index); } return result; } function baseToPairs(object, props) { return arrayMap(props, function(key2) { return [key2, object[key2]]; }); } function baseTrim(string) { return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string; } function baseUnary(func) { return function(value) { return func(value); }; } function baseValues(object, props) { return arrayMap(props, function(key2) { return object[key2]; }); } function cacheHas(cache, key2) { return cache.has(key2); } function charsStartIndex(strSymbols, chrSymbols) { var index = -1, length = strSymbols.length; while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) { } return index; } function charsEndIndex(strSymbols, chrSymbols) { var index = strSymbols.length; while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) { } return index; } function countHolders(array, placeholder) { var length = array.length, result = 0; while (length--) { if (array[length] === placeholder) { ++result; } } return result; } var deburrLetter = basePropertyOf(deburredLetters); var escapeHtmlChar = basePropertyOf(htmlEscapes); function escapeStringChar(chr) { return "\\" + stringEscapes[chr]; } function getValue(object, key2) { return object == null ? undefined2 : object[key2]; } function hasUnicode(string) { return reHasUnicode.test(string); } function hasUnicodeWord(string) { return reHasUnicodeWord.test(string); } function iteratorToArray(iterator) { var data, result = []; while (!(data = iterator.next()).done) { result.push(data.value); } return result; } function mapToArray(map) { var index = -1, result = Array(map.size); map.forEach(function(value, key2) { result[++index] = [key2, value]; }); return result; } function overArg(func, transform) { return function(arg) { return func(transform(arg)); }; } function replaceHolders(array, placeholder) { var index = -1, length = array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (value === placeholder || value === PLACEHOLDER) { array[index] = PLACEHOLDER; result[resIndex++] = index; } } return result; } function setToArray(set2) { var index = -1, result = Array(set2.size); set2.forEach(function(value) { result[++index] = value; }); return result; } function setToPairs(set2) { var index = -1, result = Array(set2.size); set2.forEach(function(value) { result[++index] = [value, value]; }); return result; } function strictIndexOf(array, value, fromIndex) { var index = fromIndex - 1, length = array.length; while (++index < length) { if (array[index] === value) { return index; } } return -1; } function strictLastIndexOf(array, value, fromIndex) { var index = fromIndex + 1; while (index--) { if (array[index] === value) { return index; } } return index; } function stringSize(string) { return hasUnicode(string) ? unicodeSize(string) : asciiSize(string); } function stringToArray(string) { return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string); } function trimmedEndIndex(string) { var index = string.length; while (index-- && reWhitespace.test(string.charAt(index))) { } return index; } var unescapeHtmlChar = basePropertyOf(htmlUnescapes); function unicodeSize(string) { var result = reUnicode.lastIndex = 0; while (reUnicode.test(string)) { ++result; } return result; } function unicodeToArray(string) { return string.match(reUnicode) || []; } function unicodeWords(string) { return string.match(reUnicodeWord) || []; } var runInContext = function runInContext2(context) { context = context == null ? root : _18.defaults(root.Object(), context, _18.pick(root, contextProps)); var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function, Math2 = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String2 = context.String, TypeError2 = context.TypeError; var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype; var coreJsData = context["__core-js_shared__"]; var funcToString = funcProto.toString; var hasOwnProperty2 = objectProto.hasOwnProperty; var idCounter = 0; var maskSrcKey = function() { var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ""); return uid ? "Symbol(src)_1." + uid : ""; }(); var nativeObjectToString = objectProto.toString; var objectCtorString2 = funcToString.call(Object2); var oldDash = root._; var reIsNative = RegExp2( "^" + funcToString.call(hasOwnProperty2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" ); var Buffer2 = moduleExports ? context.Buffer : undefined2, Symbol2 = context.Symbol, Uint8Array2 = context.Uint8Array, allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : undefined2, getPrototype = overArg(Object2.getPrototypeOf, Object2), objectCreate = Object2.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : undefined2, symIterator = Symbol2 ? Symbol2.iterator : undefined2, symToStringTag = Symbol2 ? Symbol2.toStringTag : undefined2; var defineProperty = function() { try { var func = getNative(Object2, "defineProperty"); func({}, "", {}); return func; } catch (e) { } }(); var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date2 && Date2.now !== root.Date.now && Date2.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; var nativeCeil = Math2.ceil, nativeFloor = Math2.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : undefined2, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math2.max, nativeMin = Math2.min, nativeNow = Date2.now, nativeParseInt = context.parseInt, nativeRandom = Math2.random, nativeReverse = arrayProto.reverse; var DataView = getNative(context, "DataView"), Map2 = getNative(context, "Map"), Promise2 = getNative(context, "Promise"), Set2 = getNative(context, "Set"), WeakMap2 = getNative(context, "WeakMap"), nativeCreate = getNative(Object2, "create"); var metaMap = WeakMap2 && new WeakMap2(); var realNames = {}; var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap2); var symbolProto = Symbol2 ? Symbol2.prototype : undefined2, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined2, symbolToString = symbolProto ? symbolProto.toString : undefined2; function lodash(value) { if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { if (value instanceof LodashWrapper) { return value; } if (hasOwnProperty2.call(value, "__wrapped__")) { return wrapperClone(value); } } return new LodashWrapper(value); } var baseCreate = function() { function object() { } return function(proto) { if (!isObject(proto)) { return {}; } if (objectCreate) { return objectCreate(proto); } object.prototype = proto; var result2 = new object(); object.prototype = undefined2; return result2; }; }(); function baseLodash() { } function LodashWrapper(value, chainAll) { this.__wrapped__ = value; this.__actions__ = []; this.__chain__ = !!chainAll; this.__index__ = 0; this.__values__ = undefined2; } lodash.templateSettings = { /** * Used to detect `data` property values to be HTML-escaped. * * @memberOf _.templateSettings * @type {RegExp} */ "escape": reEscape, /** * Used to detect code to be evaluated. * * @memberOf _.templateSettings * @type {RegExp} */ "evaluate": reEvaluate, /** * Used to detect `data` property values to inject. * * @memberOf _.templateSettings * @type {RegExp} */ "interpolate": reInterpolate, /** * Used to reference the data object in the template text. * * @memberOf _.templateSettings * @type {string} */ "variable": "", /** * Used to import variables into the compiled template. * * @memberOf _.templateSettings * @type {Object} */ "imports": { /** * A reference to the `lodash` function. * * @memberOf _.templateSettings.imports * @type {Function} */ "_": lodash } }; lodash.prototype = baseLodash.prototype; lodash.prototype.constructor = lodash; LodashWrapper.prototype = baseCreate(baseLodash.prototype); LodashWrapper.prototype.constructor = LodashWrapper; function LazyWrapper(value) { this.__wrapped__ = value; this.__actions__ = []; this.__dir__ = 1; this.__filtered__ = false; this.__iteratees__ = []; this.__takeCount__ = MAX_ARRAY_LENGTH; this.__views__ = []; } function lazyClone() { var result2 = new LazyWrapper(this.__wrapped__); result2.__actions__ = copyArray(this.__actions__); result2.__dir__ = this.__dir__; result2.__filtered__ = this.__filtered__; result2.__iteratees__ = copyArray(this.__iteratees__); result2.__takeCount__ = this.__takeCount__; result2.__views__ = copyArray(this.__views__); return result2; } function lazyReverse() { if (this.__filtered__) { var result2 = new LazyWrapper(this); result2.__dir__ = -1; result2.__filtered__ = true; } else { result2 = this.clone(); result2.__dir__ *= -1; } return result2; } function lazyValue() { var array = this.__wrapped__.value(), dir = this.__dir__, isArr = isArray(array), isRight = dir < 0, arrLength = isArr ? array.length : 0, view = getView(0, arrLength, this.__views__), start = view.start, end = view.end, length = end - start, index = isRight ? end : start - 1, iteratees = this.__iteratees__, iterLength = iteratees.length, resIndex = 0, takeCount = nativeMin(length, this.__takeCount__); if (!isArr || !isRight && arrLength == length && takeCount == length) { return baseWrapperValue(array, this.__actions__); } var result2 = []; outer: while (length-- && resIndex < takeCount) { index += dir; var iterIndex = -1, value = array[index]; while (++iterIndex < iterLength) { var data = iteratees[iterIndex], iteratee2 = data.iteratee, type = data.type, computed = iteratee2(value); if (type == LAZY_MAP_FLAG) { value = computed; } else if (!computed) { if (type == LAZY_FILTER_FLAG) { continue outer; } else { break outer; } } } result2[resIndex++] = value; } return result2; } LazyWrapper.prototype = baseCreate(baseLodash.prototype); LazyWrapper.prototype.constructor = LazyWrapper; function Hash(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; this.size = 0; } function hashDelete(key2) { var result2 = this.has(key2) && delete this.__data__[key2]; this.size -= result2 ? 1 : 0; return result2; } function hashGet(key2) { var data = this.__data__; if (nativeCreate) { var result2 = data[key2]; return result2 === HASH_UNDEFINED ? undefined2 : result2; } return hasOwnProperty2.call(data, key2) ? data[key2] : undefined2; } function hashHas(key2) { var data = this.__data__; return nativeCreate ? data[key2] !== undefined2 : hasOwnProperty2.call(data, key2); } function hashSet(key2, value) { var data = this.__data__; this.size += this.has(key2) ? 0 : 1; data[key2] = nativeCreate && value === undefined2 ? HASH_UNDEFINED : value; return this; } Hash.prototype.clear = hashClear; Hash.prototype["delete"] = hashDelete; Hash.prototype.get = hashGet; Hash.prototype.has = hashHas; Hash.prototype.set = hashSet; function ListCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } function listCacheClear() { this.__data__ = []; this.size = 0; } function listCacheDelete(key2) { var data = this.__data__, index = assocIndexOf(data, key2); if (index < 0) { return false; } var lastIndex = data.length - 1; if (index == lastIndex) { data.pop(); } else { splice.call(data, index, 1); } --this.size; return true; } function listCacheGet(key2) { var data = this.__data__, index = assocIndexOf(data, key2); return index < 0 ? undefined2 : data[index][1]; } function listCacheHas(key2) { return assocIndexOf(this.__data__, key2) > -1; } function listCacheSet(key2, value) { var data = this.__data__, index = assocIndexOf(data, key2); if (index < 0) { ++this.size; data.push([key2, value]); } else { data[index][1] = value; } return this; } ListCache.prototype.clear = listCacheClear; ListCache.prototype["delete"] = listCacheDelete; ListCache.prototype.get = listCacheGet; ListCache.prototype.has = listCacheHas; ListCache.prototype.set = listCacheSet; function MapCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } function mapCacheClear() { this.size = 0; this.__data__ = { "hash": new Hash(), "map": new (Map2 || ListCache)(), "string": new Hash() }; } function mapCacheDelete(key2) { var result2 = getMapData(this, key2)["delete"](key2); this.size -= result2 ? 1 : 0; return result2; } function mapCacheGet(key2) { return getMapData(this, key2).get(key2); } function mapCacheHas(key2) { return getMapData(this, key2).has(key2); } function mapCacheSet(key2, value) { var data = getMapData(this, key2), size2 = data.size; data.set(key2, value); this.size += data.size == size2 ? 0 : 1; return this; } MapCache.prototype.clear = mapCacheClear; MapCache.prototype["delete"] = mapCacheDelete; MapCache.prototype.get = mapCacheGet; MapCache.prototype.has = mapCacheHas; MapCache.prototype.set = mapCacheSet; function SetCache(values2) { var index = -1, length = values2 == null ? 0 : values2.length; this.__data__ = new MapCache(); while (++index < length) { this.add(values2[index]); } } function setCacheAdd(value) { this.__data__.set(value, HASH_UNDEFINED); return this; } function setCacheHas(value) { return this.__data__.has(value); } SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; SetCache.prototype.has = setCacheHas; function Stack(entries) { var data = this.__data__ = new ListCache(entries); this.size = data.size; } function stackClear() { this.__data__ = new ListCache(); this.size = 0; } function stackDelete(key2) { var data = this.__data__, result2 = data["delete"](key2); this.size = data.size; return result2; } function stackGet(key2) { return this.__data__.get(key2); } function stackHas(key2) { return this.__data__.has(key2); } function stackSet(key2, value) { var data = this.__data__; if (data instanceof ListCache) { var pairs = data.__data__; if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) { pairs.push([key2, value]); this.size = ++data.size; return this; } data = this.__data__ = new MapCache(pairs); } data.set(key2, value); this.size = data.size; return this; } Stack.prototype.clear = stackClear; Stack.prototype["delete"] = stackDelete; Stack.prototype.get = stackGet; Stack.prototype.has = stackHas; Stack.prototype.set = stackSet; function arrayLikeKeys(value, inherited) { var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result2 = skipIndexes ? baseTimes(value.length, String2) : [], length = result2.length; for (var key2 in value) { if ((inherited || hasOwnProperty2.call(value, key2)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode. (key2 == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. isBuff && (key2 == "offset" || key2 == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. isType && (key2 == "buffer" || key2 == "byteLength" || key2 == "byteOffset") || // Skip index properties. isIndex(key2, length)))) { result2.push(key2); } } return result2; } function arraySample(array) { var length = array.length; return length ? array[baseRandom(0, length - 1)] : undefined2; } function arraySampleSize(array, n2) { return shuffleSelf(copyArray(array), baseClamp(n2, 0, array.length)); } function arrayShuffle(array) { return shuffleSelf(copyArray(array)); } function assignMergeValue(object, key2, value) { if (value !== undefined2 && !eq(object[key2], value) || value === undefined2 && !(key2 in object)) { baseAssignValue(object, key2, value); } } function assignValue(object, key2, value) { var objValue = object[key2]; if (!(hasOwnProperty2.call(object, key2) && eq(objValue, value)) || value === undefined2 && !(key2 in object)) { baseAssignValue(object, key2, value); } } function assocIndexOf(array, key2) { var length = array.length; while (length--) { if (eq(array[length][0], key2)) { return length; } } return -1; } function baseAggregator(collection, setter, iteratee2, accumulator) { baseEach(collection, function(value, key2, collection2) { setter(accumulator, value, iteratee2(value), collection2); }); return accumulator; } function baseAssign(object, source) { return object && copyObject(source, keys(source), object); } function baseAssignIn(object, source) { return object && copyObject(source, keysIn(source), object); } function baseAssignValue(object, key2, value) { if (key2 == "__proto__" && defineProperty) { defineProperty(object, key2, { "configurable": true, "enumerable": true, "value": value, "writable": true }); } else { object[key2] = value; } } function baseAt(object, paths) { var index = -1, length = paths.length, result2 = Array2(length), skip = object == null; while (++index < length) { result2[index] = skip ? undefined2 : get(object, paths[index]); } return result2; } function baseClamp(number, lower, upper) { if (number === number) { if (upper !== undefined2) { number = number <= upper ? number : upper; } if (lower !== undefined2) { number = number >= lower ? number : lower; } } return number; } function baseClone(value, bitmask, customizer, key2, object, stack) { var result2, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG; if (customizer) { result2 = object ? customizer(value, key2, object, stack) : customizer(value); } if (result2 !== undefined2) { return result2; } if (!isObject(value)) { return value; } var isArr = isArray(value); if (isArr) { result2 = initCloneArray(value); if (!isDeep) { return copyArray(value, result2); } } else { var tag = getTag(value), isFunc = tag == funcTag || tag == genTag; if (isBuffer(value)) { return cloneBuffer(value, isDeep); } if (tag == objectTag || tag == argsTag || isFunc && !object) { result2 = isFlat || isFunc ? {} : initCloneObject(value); if (!isDeep) { return isFlat ? copySymbolsIn(value, baseAssignIn(result2, value)) : copySymbols(value, baseAssign(result2, value)); } } else { if (!cloneableTags[tag]) { return object ? value : {}; } result2 = initCloneByTag(value, tag, isDeep); } } stack || (stack = new Stack()); var stacked = stack.get(value); if (stacked) { return stacked; } stack.set(value, result2); if (isSet2(value)) { value.forEach(function(subValue) { result2.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); }); } else if (isMap2(value)) { value.forEach(function(subValue, key3) { result2.set(key3, baseClone(subValue, bitmask, customizer, key3, value, stack)); }); } var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys; var props = isArr ? undefined2 : keysFunc(value); arrayEach(props || value, function(subValue, key3) { if (props) { key3 = subValue; subValue = value[key3]; } assignValue(result2, key3, baseClone(subValue, bitmask, customizer, key3, value, stack)); }); return result2; } function baseConforms(source) { var props = keys(source); return function(object) { return baseConformsTo(object, source, props); }; } function baseConformsTo(object, source, props) { var length = props.length; if (object == null) { return !length; } object = Object2(object); while (length--) { var key2 = props[length], predicate = source[key2], value = object[key2]; if (value === undefined2 && !(key2 in object) || !predicate(value)) { return false; } } return true; } function baseDelay(func, wait, args) { if (typeof func != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } return setTimeout2(function() { func.apply(undefined2, args); }, wait); } function baseDifference(array, values2, iteratee2, comparator) { var index = -1, includes2 = arrayIncludes, isCommon = true, length = array.length, result2 = [], valuesLength = values2.length; if (!length) { return result2; } if (iteratee2) { values2 = arrayMap(values2, baseUnary(iteratee2)); } if (comparator) { includes2 = arrayIncludesWith; isCommon = false; } else if (values2.length >= LARGE_ARRAY_SIZE) { includes2 = cacheHas; isCommon = false; values2 = new SetCache(values2); } outer: while (++index < length) { var value = array[index], computed = iteratee2 == null ? value : iteratee2(value); value = comparator || value !== 0 ? value : 0; if (isCommon && computed === computed) { var valuesIndex = valuesLength; while (valuesIndex--) { if (values2[valuesIndex] === computed) { continue outer; } } result2.push(value); } else if (!includes2(values2, computed, comparator)) { result2.push(value); } } return result2; } var baseEach = createBaseEach(baseForOwn); var baseEachRight = createBaseEach(baseForOwnRight, true); function baseEvery(collection, predicate) { var result2 = true; baseEach(collection, function(value, index, collection2) { result2 = !!predicate(value, index, collection2); return result2; }); return result2; } function baseExtremum(array, iteratee2, comparator) { var index = -1, length = array.length; while (++index < length) { var value = array[index], current2 = iteratee2(value); if (current2 != null && (computed === undefined2 ? current2 === current2 && !isSymbol(current2) : comparator(current2, computed))) { var computed = current2, result2 = value; } } return result2; } function baseFill(array, value, start, end) { var length = array.length; start = toInteger(start); if (start < 0) { start = -start > length ? 0 : length + start; } end = end === undefined2 || end > length ? length : toInteger(end); if (end < 0) { end += length; } end = start > end ? 0 : toLength(end); while (start < end) { array[start++] = value; } return array; } function baseFilter(collection, predicate) { var result2 = []; baseEach(collection, function(value, index, collection2) { if (predicate(value, index, collection2)) { result2.push(value); } }); return result2; } function baseFlatten(array, depth, predicate, isStrict, result2) { var index = -1, length = array.length; predicate || (predicate = isFlattenable); result2 || (result2 = []); while (++index < length) { var value = array[index]; if (depth > 0 && predicate(value)) { if (depth > 1) { baseFlatten(value, depth - 1, predicate, isStrict, result2); } else { arrayPush(result2, value); } } else if (!isStrict) { result2[result2.length] = value; } } return result2; } var baseFor = createBaseFor(); var baseForRight = createBaseFor(true); function baseForOwn(object, iteratee2) { return object && baseFor(object, iteratee2, keys); } function baseForOwnRight(object, iteratee2) { return object && baseForRight(object, iteratee2, keys); } function baseFunctions(object, props) { return arrayFilter(props, function(key2) { return isFunction(object[key2]); }); } function baseGet(object, path2) { path2 = castPath(path2, object); var index = 0, length = path2.length; while (object != null && index < length) { object = object[toKey(path2[index++])]; } return index && index == length ? object : undefined2; } function baseGetAllKeys(object, keysFunc, symbolsFunc) { var result2 = keysFunc(object); return isArray(object) ? result2 : arrayPush(result2, symbolsFunc(object)); } function baseGetTag(value) { if (value == null) { return value === undefined2 ? undefinedTag : nullTag; } return symToStringTag && symToStringTag in Object2(value) ? getRawTag(value) : objectToString(value); } function baseGt(value, other) { return value > other; } function baseHas(object, key2) { return object != null && hasOwnProperty2.call(object, key2); } function baseHasIn(object, key2) { return object != null && key2 in Object2(object); } function baseInRange(number, start, end) { return number >= nativeMin(start, end) && number < nativeMax(start, end); } function baseIntersection(arrays, iteratee2, comparator) { var includes2 = comparator ? arrayIncludesWith : arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array2(othLength), maxLength = Infinity, result2 = []; while (othIndex--) { var array = arrays[othIndex]; if (othIndex && iteratee2) { array = arrayMap(array, baseUnary(iteratee2)); } maxLength = nativeMin(array.length, maxLength); caches[othIndex] = !comparator && (iteratee2 || length >= 120 && array.length >= 120) ? new SetCache(othIndex && array) : undefined2; } array = arrays[0]; var index = -1, seen = caches[0]; outer: while (++index < length && result2.length < maxLength) { var value = array[index], computed = iteratee2 ? iteratee2(value) : value; value = comparator || value !== 0 ? value : 0; if (!(seen ? cacheHas(seen, computed) : includes2(result2, computed, comparator))) { othIndex = othLength; while (--othIndex) { var cache = caches[othIndex]; if (!(cache ? cacheHas(cache, computed) : includes2(arrays[othIndex], computed, comparator))) { continue outer; } } if (seen) { seen.push(computed); } result2.push(value); } } return result2; } function baseInverter(object, setter, iteratee2, accumulator) { baseForOwn(object, function(value, key2, object2) { setter(accumulator, iteratee2(value), key2, object2); }); return accumulator; } function baseInvoke(object, path2, args) { path2 = castPath(path2, object); object = parent(object, path2); var func = object == null ? object : object[toKey(last(path2))]; return func == null ? undefined2 : apply(func, object, args); } function baseIsArguments(value) { return isObjectLike(value) && baseGetTag(value) == argsTag; } function baseIsArrayBuffer(value) { return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; } function baseIsDate(value) { return isObjectLike(value) && baseGetTag(value) == dateTag; } function baseIsEqual(value, other, bitmask, customizer, stack) { if (value === other) { return true; } if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) { return value !== value && other !== other; } return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); } function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other); objTag = objTag == argsTag ? objectTag : objTag; othTag = othTag == argsTag ? objectTag : othTag; var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag; if (isSameTag && isBuffer(object)) { if (!isBuffer(other)) { return false; } objIsArr = true; objIsObj = false; } if (isSameTag && !objIsObj) { stack || (stack = new Stack()); return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); } if (!(bitmask & COMPARE_PARTIAL_FLAG)) { var objIsWrapped = objIsObj && hasOwnProperty2.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty2.call(other, "__wrapped__"); if (objIsWrapped || othIsWrapped) { var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other; stack || (stack = new Stack()); return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); } } if (!isSameTag) { return false; } stack || (stack = new Stack()); return equalObjects(object, other, bitmask, customizer, equalFunc, stack); } function baseIsMap(value) { return isObjectLike(value) && getTag(value) == mapTag; } function baseIsMatch(object, source, matchData, customizer) { var index = matchData.length, length = index, noCustomizer = !customizer; if (object == null) { return !length; } object = Object2(object); while (index--) { var data = matchData[index]; if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) { return false; } } while (++index < length) { data = matchData[index]; var key2 = data[0], objValue = object[key2], srcValue = data[1]; if (noCustomizer && data[2]) { if (objValue === undefined2 && !(key2 in object)) { return false; } } else { var stack = new Stack(); if (customizer) { var result2 = customizer(objValue, srcValue, key2, object, source, stack); } if (!(result2 === undefined2 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result2)) { return false; } } } return true; } function baseIsNative(value) { if (!isObject(value) || isMasked(value)) { return false; } var pattern = isFunction(value) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } function baseIsRegExp(value) { return isObjectLike(value) && baseGetTag(value) == regexpTag; } function baseIsSet(value) { return isObjectLike(value) && getTag(value) == setTag; } function baseIsTypedArray(value) { return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; } function baseIteratee(value) { if (typeof value == "function") { return value; } if (value == null) { return identity; } if (typeof value == "object") { return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); } return property(value); } function baseKeys(object) { if (!isPrototype(object)) { return nativeKeys(object); } var result2 = []; for (var key2 in Object2(object)) { if (hasOwnProperty2.call(object, key2) && key2 != "constructor") { result2.push(key2); } } return result2; } function baseKeysIn(object) { if (!isObject(object)) { return nativeKeysIn(object); } var isProto = isPrototype(object), result2 = []; for (var key2 in object) { if (!(key2 == "constructor" && (isProto || !hasOwnProperty2.call(object, key2)))) { result2.push(key2); } } return result2; } function baseLt(value, other) { return value < other; } function baseMap(collection, iteratee2) { var index = -1, result2 = isArrayLike(collection) ? Array2(collection.length) : []; baseEach(collection, function(value, key2, collection2) { result2[++index] = iteratee2(value, key2, collection2); }); return result2; } function baseMatches(source) { var matchData = getMatchData(source); if (matchData.length == 1 && matchData[0][2]) { return matchesStrictComparable(matchData[0][0], matchData[0][1]); } return function(object) { return object === source || baseIsMatch(object, source, matchData); }; } function baseMatchesProperty(path2, srcValue) { if (isKey(path2) && isStrictComparable(srcValue)) { return matchesStrictComparable(toKey(path2), srcValue); } return function(object) { var objValue = get(object, path2); return objValue === undefined2 && objValue === srcValue ? hasIn(object, path2) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); }; } function baseMerge(object, source, srcIndex, customizer, stack) { if (object === source) { return; } baseFor(source, function(srcValue, key2) { stack || (stack = new Stack()); if (isObject(srcValue)) { baseMergeDeep(object, source, key2, srcIndex, baseMerge, customizer, stack); } else { var newValue = customizer ? customizer(safeGet(object, key2), srcValue, key2 + "", object, source, stack) : undefined2; if (newValue === undefined2) { newValue = srcValue; } assignMergeValue(object, key2, newValue); } }, keysIn); } function baseMergeDeep(object, source, key2, srcIndex, mergeFunc, customizer, stack) { var objValue = safeGet(object, key2), srcValue = safeGet(source, key2), stacked = stack.get(srcValue); if (stacked) { assignMergeValue(object, key2, stacked); return; } var newValue = customizer ? customizer(objValue, srcValue, key2 + "", object, source, stack) : undefined2; var isCommon = newValue === undefined2; if (isCommon) { var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue); newValue = srcValue; if (isArr || isBuff || isTyped) { if (isArray(objValue)) { newValue = objValue; } else if (isArrayLikeObject(objValue)) { newValue = copyArray(objValue); } else if (isBuff) { isCommon = false; newValue = cloneBuffer(srcValue, true); } else if (isTyped) { isCommon = false; newValue = cloneTypedArray(srcValue, true); } else { newValue = []; } } else if (isPlainObject2(srcValue) || isArguments(srcValue)) { newValue = objValue; if (isArguments(objValue)) { newValue = toPlainObject(objValue); } else if (!isObject(objValue) || isFunction(objValue)) { newValue = initCloneObject(srcValue); } } else { isCommon = false; } } if (isCommon) { stack.set(srcValue, newValue); mergeFunc(newValue, srcValue, srcIndex, customizer, stack); stack["delete"](srcValue); } assignMergeValue(object, key2, newValue); } function baseNth(array, n2) { var length = array.length; if (!length) { return; } n2 += n2 < 0 ? length : 0; return isIndex(n2, length) ? array[n2] : undefined2; } function baseOrderBy(collection, iteratees, orders) { if (iteratees.length) { iteratees = arrayMap(iteratees, function(iteratee2) { if (isArray(iteratee2)) { return function(value) { return baseGet(value, iteratee2.length === 1 ? iteratee2[0] : iteratee2); }; } return iteratee2; }); } else { iteratees = [identity]; } var index = -1; iteratees = arrayMap(iteratees, baseUnary(getIteratee())); var result2 = baseMap(collection, function(value, key2, collection2) { var criteria = arrayMap(iteratees, function(iteratee2) { return iteratee2(value); }); return { "criteria": criteria, "index": ++index, "value": value }; }); return baseSortBy(result2, function(object, other) { return compareMultiple(object, other, orders); }); } function basePick(object, paths) { return basePickBy(object, paths, function(value, path2) { return hasIn(object, path2); }); } function basePickBy(object, paths, predicate) { var index = -1, length = paths.length, result2 = {}; while (++index < length) { var path2 = paths[index], value = baseGet(object, path2); if (predicate(value, path2)) { baseSet(result2, castPath(path2, object), value); } } return result2; } function basePropertyDeep(path2) { return function(object) { return baseGet(object, path2); }; } function basePullAll(array, values2, iteratee2, comparator) { var indexOf2 = comparator ? baseIndexOfWith : baseIndexOf, index = -1, length = values2.length, seen = array; if (array === values2) { values2 = copyArray(values2); } if (iteratee2) { seen = arrayMap(array, baseUnary(iteratee2)); } while (++index < length) { var fromIndex = 0, value = values2[index], computed = iteratee2 ? iteratee2(value) : value; while ((fromIndex = indexOf2(seen, computed, fromIndex, comparator)) > -1) { if (seen !== array) { splice.call(seen, fromIndex, 1); } splice.call(array, fromIndex, 1); } } return array; } function basePullAt(array, indexes) { var length = array ? indexes.length : 0, lastIndex = length - 1; while (length--) { var index = indexes[length]; if (length == lastIndex || index !== previous) { var previous = index; if (isIndex(index)) { splice.call(array, index, 1); } else { baseUnset(array, index); } } } return array; } function baseRandom(lower, upper) { return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); } function baseRange(start, end, step, fromRight) { var index = -1, length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), result2 = Array2(length); while (length--) { result2[fromRight ? length : ++index] = start; start += step; } return result2; } function baseRepeat(string, n2) { var result2 = ""; if (!string || n2 < 1 || n2 > MAX_SAFE_INTEGER) { return result2; } do { if (n2 % 2) { result2 += string; } n2 = nativeFloor(n2 / 2); if (n2) { string += string; } } while (n2); return result2; } function baseRest(func, start) { return setToString(overRest(func, start, identity), func + ""); } function baseSample(collection) { return arraySample(values(collection)); } function baseSampleSize(collection, n2) { var array = values(collection); return shuffleSelf(array, baseClamp(n2, 0, array.length)); } function baseSet(object, path2, value, customizer) { if (!isObject(object)) { return object; } path2 = castPath(path2, object); var index = -1, length = path2.length, lastIndex = length - 1, nested = object; while (nested != null && ++index < length) { var key2 = toKey(path2[index]), newValue = value; if (key2 === "__proto__" || key2 === "constructor" || key2 === "prototype") { return object; } if (index != lastIndex) { var objValue = nested[key2]; newValue = customizer ? customizer(objValue, key2, nested) : undefined2; if (newValue === undefined2) { newValue = isObject(objValue) ? objValue : isIndex(path2[index + 1]) ? [] : {}; } } assignValue(nested, key2, newValue); nested = nested[key2]; } return object; } var baseSetData = !metaMap ? identity : function(func, data) { metaMap.set(func, data); return func; }; var baseSetToString = !defineProperty ? identity : function(func, string) { return defineProperty(func, "toString", { "configurable": true, "enumerable": false, "value": constant(string), "writable": true }); }; function baseShuffle(collection) { return shuffleSelf(values(collection)); } function baseSlice(array, start, end) { var index = -1, length = array.length; if (start < 0) { start = -start > length ? 0 : length + start; } end = end > length ? length : end; if (end < 0) { end += length; } length = start > end ? 0 : end - start >>> 0; start >>>= 0; var result2 = Array2(length); while (++index < length) { result2[index] = array[index + start]; } return result2; } function baseSome(collection, predicate) { var result2; baseEach(collection, function(value, index, collection2) { result2 = predicate(value, index, collection2); return !result2; }); return !!result2; } function baseSortedIndex(array, value, retHighest) { var low = 0, high = array == null ? low : array.length; if (typeof value == "number" && value === value && high <= HALF_MAX_ARRAY_LENGTH) { while (low < high) { var mid = low + high >>> 1, computed = array[mid]; if (computed !== null && !isSymbol(computed) && (retHighest ? computed <= value : computed < value)) { low = mid + 1; } else { high = mid; } } return high; } return baseSortedIndexBy(array, value, identity, retHighest); } function baseSortedIndexBy(array, value, iteratee2, retHighest) { var low = 0, high = array == null ? 0 : array.length; if (high === 0) { return 0; } value = iteratee2(value); var valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol(value), valIsUndefined = value === undefined2; while (low < high) { var mid = nativeFloor((low + high) / 2), computed = iteratee2(array[mid]), othIsDefined = computed !== undefined2, othIsNull = computed === null, othIsReflexive = computed === computed, othIsSymbol = isSymbol(computed); if (valIsNaN) { var setLow = retHighest || othIsReflexive; } else if (valIsUndefined) { setLow = othIsReflexive && (retHighest || othIsDefined); } else if (valIsNull) { setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); } else if (valIsSymbol) { setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); } else if (othIsNull || othIsSymbol) { setLow = false; } else { setLow = retHighest ? computed <= value : computed < value; } if (setLow) { low = mid + 1; } else { high = mid; } } return nativeMin(high, MAX_ARRAY_INDEX); } function baseSortedUniq(array, iteratee2) { var index = -1, length = array.length, resIndex = 0, result2 = []; while (++index < length) { var value = array[index], computed = iteratee2 ? iteratee2(value) : value; if (!index || !eq(computed, seen)) { var seen = computed; result2[resIndex++] = value === 0 ? 0 : value; } } return result2; } function baseToNumber(value) { if (typeof value == "number") { return value; } if (isSymbol(value)) { return NAN; } return +value; } function baseToString(value) { if (typeof value == "string") { return value; } if (isArray(value)) { return arrayMap(value, baseToString) + ""; } if (isSymbol(value)) { return symbolToString ? symbolToString.call(value) : ""; } var result2 = value + ""; return result2 == "0" && 1 / value == -INFINITY ? "-0" : result2; } function baseUniq(array, iteratee2, comparator) { var index = -1, includes2 = arrayIncludes, length = array.length, isCommon = true, result2 = [], seen = result2; if (comparator) { isCommon = false; includes2 = arrayIncludesWith; } else if (length >= LARGE_ARRAY_SIZE) { var set3 = iteratee2 ? null : createSet(array); if (set3) { return setToArray(set3); } isCommon = false; includes2 = cacheHas; seen = new SetCache(); } else { seen = iteratee2 ? [] : result2; } outer: while (++index < length) { var value = array[index], computed = iteratee2 ? iteratee2(value) : value; value = comparator || value !== 0 ? value : 0; if (isCommon && computed === computed) { var seenIndex = seen.length; while (seenIndex--) { if (seen[seenIndex] === computed) { continue outer; } } if (iteratee2) { seen.push(computed); } result2.push(value); } else if (!includes2(seen, computed, comparator)) { if (seen !== result2) { seen.push(computed); } result2.push(value); } } return result2; } function baseUnset(object, path2) { path2 = castPath(path2, object); object = parent(object, path2); return object == null || delete object[toKey(last(path2))]; } function baseUpdate(object, path2, updater, customizer) { return baseSet(object, path2, updater(baseGet(object, path2)), customizer); } function baseWhile(array, predicate, isDrop, fromRight) { var length = array.length, index = fromRight ? length : -1; while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) { } return isDrop ? baseSlice(array, fromRight ? 0 : index, fromRight ? index + 1 : length) : baseSlice(array, fromRight ? index + 1 : 0, fromRight ? length : index); } function baseWrapperValue(value, actions) { var result2 = value; if (result2 instanceof LazyWrapper) { result2 = result2.value(); } return arrayReduce(actions, function(result3, action) { return action.func.apply(action.thisArg, arrayPush([result3], action.args)); }, result2); } function baseXor(arrays, iteratee2, comparator) { var length = arrays.length; if (length < 2) { return length ? baseUniq(arrays[0]) : []; } var index = -1, result2 = Array2(length); while (++index < length) { var array = arrays[index], othIndex = -1; while (++othIndex < length) { if (othIndex != index) { result2[index] = baseDifference(result2[index] || array, arrays[othIndex], iteratee2, comparator); } } } return baseUniq(baseFlatten(result2, 1), iteratee2, comparator); } function baseZipObject(props, values2, assignFunc) { var index = -1, length = props.length, valsLength = values2.length, result2 = {}; while (++index < length) { var value = index < valsLength ? values2[index] : undefined2; assignFunc(result2, props[index], value); } return result2; } function castArrayLikeObject(value) { return isArrayLikeObject(value) ? value : []; } function castFunction(value) { return typeof value == "function" ? value : identity; } function castPath(value, object) { if (isArray(value)) { return value; } return isKey(value, object) ? [value] : stringToPath(toString(value)); } var castRest = baseRest; function castSlice(array, start, end) { var length = array.length; end = end === undefined2 ? length : end; return !start && end >= length ? array : baseSlice(array, start, end); } var clearTimeout2 = ctxClearTimeout || function(id) { return root.clearTimeout(id); }; function cloneBuffer(buffer, isDeep) { if (isDeep) { return buffer.slice(); } var length = buffer.length, result2 = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); buffer.copy(result2); return result2; } function cloneArrayBuffer(arrayBuffer) { var result2 = new arrayBuffer.constructor(arrayBuffer.byteLength); new Uint8Array2(result2).set(new Uint8Array2(arrayBuffer)); return result2; } function cloneDataView(dataView, isDeep) { var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); } function cloneRegExp(regexp) { var result2 = new regexp.constructor(regexp.source, reFlags.exec(regexp)); result2.lastIndex = regexp.lastIndex; return result2; } function cloneSymbol(symbol) { return symbolValueOf ? Object2(symbolValueOf.call(symbol)) : {}; } function cloneTypedArray(typedArray, isDeep) { var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); } function compareAscending(value, other) { if (value !== other) { var valIsDefined = value !== undefined2, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value); var othIsDefined = other !== undefined2, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other); if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) { return 1; } if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) { return -1; } } return 0; } function compareMultiple(object, other, orders) { var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length; while (++index < length) { var result2 = compareAscending(objCriteria[index], othCriteria[index]); if (result2) { if (index >= ordersLength) { return result2; } var order = orders[index]; return result2 * (order == "desc" ? -1 : 1); } } return object.index - other.index; } function composeArgs(args, partials, holders, isCurried) { var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result2 = Array2(leftLength + rangeLength), isUncurried = !isCurried; while (++leftIndex < leftLength) { result2[leftIndex] = partials[leftIndex]; } while (++argsIndex < holdersLength) { if (isUncurried || argsIndex < argsLength) { result2[holders[argsIndex]] = args[argsIndex]; } } while (rangeLength--) { result2[leftIndex++] = args[argsIndex++]; } return result2; } function composeArgsRight(args, partials, holders, isCurried) { var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result2 = Array2(rangeLength + rightLength), isUncurried = !isCurried; while (++argsIndex < rangeLength) { result2[argsIndex] = args[argsIndex]; } var offset2 = argsIndex; while (++rightIndex < rightLength) { result2[offset2 + rightIndex] = partials[rightIndex]; } while (++holdersIndex < holdersLength) { if (isUncurried || argsIndex < argsLength) { result2[offset2 + holders[holdersIndex]] = args[argsIndex++]; } } return result2; } function copyArray(source, array) { var index = -1, length = source.length; array || (array = Array2(length)); while (++index < length) { array[index] = source[index]; } return array; } function copyObject(source, props, object, customizer) { var isNew = !object; object || (object = {}); var index = -1, length = props.length; while (++index < length) { var key2 = props[index]; var newValue = customizer ? customizer(object[key2], source[key2], key2, object, source) : undefined2; if (newValue === undefined2) { newValue = source[key2]; } if (isNew) { baseAssignValue(object, key2, newValue); } else { assignValue(object, key2, newValue); } } return object; } function copySymbols(source, object) { return copyObject(source, getSymbols(source), object); } function copySymbolsIn(source, object) { return copyObject(source, getSymbolsIn(source), object); } function createAggregator(setter, initializer) { return function(collection, iteratee2) { var func = isArray(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {}; return func(collection, setter, getIteratee(iteratee2, 2), accumulator); }; } function createAssigner(assigner) { return baseRest(function(object, sources) { var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined2, guard = length > 2 ? sources[2] : undefined2; customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : undefined2; if (guard && isIterateeCall(sources[0], sources[1], guard)) { customizer = length < 3 ? undefined2 : customizer; length = 1; } object = Object2(object); while (++index < length) { var source = sources[index]; if (source) { assigner(object, source, index, customizer); } } return object; }); } function createBaseEach(eachFunc, fromRight) { return function(collection, iteratee2) { if (collection == null) { return collection; } if (!isArrayLike(collection)) { return eachFunc(collection, iteratee2); } var length = collection.length, index = fromRight ? length : -1, iterable = Object2(collection); while (fromRight ? index-- : ++index < length) { if (iteratee2(iterable[index], index, iterable) === false) { break; } } return collection; }; } function createBaseFor(fromRight) { return function(object, iteratee2, keysFunc) { var index = -1, iterable = Object2(object), props = keysFunc(object), length = props.length; while (length--) { var key2 = props[fromRight ? length : ++index]; if (iteratee2(iterable[key2], key2, iterable) === false) { break; } } return object; }; } function createBind(func, bitmask, thisArg) { var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func); function wrapper() { var fn = this && this !== root && this instanceof wrapper ? Ctor : func; return fn.apply(isBind ? thisArg : this, arguments); } return wrapper; } function createCaseFirst(methodName) { return function(string) { string = toString(string); var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined2; var chr = strSymbols ? strSymbols[0] : string.charAt(0); var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string.slice(1); return chr[methodName]() + trailing; }; } function createCompounder(callback) { return function(string) { return arrayReduce(words(deburr(string).replace(reApos, "")), callback, ""); }; } function createCtor(Ctor) { return function() { var args = arguments; switch (args.length) { case 0: return new Ctor(); case 1: return new Ctor(args[0]); case 2: return new Ctor(args[0], args[1]); case 3: return new Ctor(args[0], args[1], args[2]); case 4: return new Ctor(args[0], args[1], args[2], args[3]); case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); } var thisBinding = baseCreate(Ctor.prototype), result2 = Ctor.apply(thisBinding, args); return isObject(result2) ? result2 : thisBinding; }; } function createCurry(func, bitmask, arity) { var Ctor = createCtor(func); function wrapper() { var length = arguments.length, args = Array2(length), index = length, placeholder = getHolder(wrapper); while (index--) { args[index] = arguments[index]; } var holders = length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder ? [] : replaceHolders(args, placeholder); length -= holders.length; if (length < arity) { return createRecurry( func, bitmask, createHybrid, wrapper.placeholder, undefined2, args, holders, undefined2, undefined2, arity - length ); } var fn = this && this !== root && this instanceof wrapper ? Ctor : func; return apply(fn, this, args); } return wrapper; } function createFind(findIndexFunc) { return function(collection, predicate, fromIndex) { var iterable = Object2(collection); if (!isArrayLike(collection)) { var iteratee2 = getIteratee(predicate, 3); collection = keys(collection); predicate = function(key2) { return iteratee2(iterable[key2], key2, iterable); }; } var index = findIndexFunc(collection, predicate, fromIndex); return index > -1 ? iterable[iteratee2 ? collection[index] : index] : undefined2; }; } function createFlow(fromRight) { return flatRest(function(funcs) { var length = funcs.length, index = length, prereq = LodashWrapper.prototype.thru; if (fromRight) { funcs.reverse(); } while (index--) { var func = funcs[index]; if (typeof func != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } if (prereq && !wrapper && getFuncName(func) == "wrapper") { var wrapper = new LodashWrapper([], true); } } index = wrapper ? index : length; while (++index < length) { func = funcs[index]; var funcName = getFuncName(func), data = funcName == "wrapper" ? getData(func) : undefined2; if (data && isLaziable(data[0]) && data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data[4].length && data[9] == 1) { wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); } else { wrapper = func.length == 1 && isLaziable(func) ? wrapper[funcName]() : wrapper.thru(func); } } return function() { var args = arguments, value = args[0]; if (wrapper && args.length == 1 && isArray(value)) { return wrapper.plant(value).value(); } var index2 = 0, result2 = length ? funcs[index2].apply(this, args) : value; while (++index2 < length) { result2 = funcs[index2].call(this, result2); } return result2; }; }); } function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary2, arity) { var isAry = bitmask & WRAP_ARY_FLAG, isBind = bitmask & WRAP_BIND_FLAG, isBindKey = bitmask & WRAP_BIND_KEY_FLAG, isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), isFlip = bitmask & WRAP_FLIP_FLAG, Ctor = isBindKey ? undefined2 : createCtor(func); function wrapper() { var length = arguments.length, args = Array2(length), index = length; while (index--) { args[index] = arguments[index]; } if (isCurried) { var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder); } if (partials) { args = composeArgs(args, partials, holders, isCurried); } if (partialsRight) { args = composeArgsRight(args, partialsRight, holdersRight, isCurried); } length -= holdersCount; if (isCurried && length < arity) { var newHolders = replaceHolders(args, placeholder); return createRecurry( func, bitmask, createHybrid, wrapper.placeholder, thisArg, args, newHolders, argPos, ary2, arity - length ); } var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func; length = args.length; if (argPos) { args = reorder(args, argPos); } else if (isFlip && length > 1) { args.reverse(); } if (isAry && ary2 < length) { args.length = ary2; } if (this && this !== root && this instanceof wrapper) { fn = Ctor || createCtor(fn); } return fn.apply(thisBinding, args); } return wrapper; } function createInverter(setter, toIteratee) { return function(object, iteratee2) { return baseInverter(object, setter, toIteratee(iteratee2), {}); }; } function createMathOperation(operator, defaultValue2) { return function(value, other) { var result2; if (value === undefined2 && other === undefined2) { return defaultValue2; } if (value !== undefined2) { result2 = value; } if (other !== undefined2) { if (result2 === undefined2) { return other; } if (typeof value == "string" || typeof other == "string") { value = baseToString(value); other = baseToString(other); } else { value = baseToNumber(value); other = baseToNumber(other); } result2 = operator(value, other); } return result2; }; } function createOver(arrayFunc) { return flatRest(function(iteratees) { iteratees = arrayMap(iteratees, baseUnary(getIteratee())); return baseRest(function(args) { var thisArg = this; return arrayFunc(iteratees, function(iteratee2) { return apply(iteratee2, thisArg, args); }); }); }); } function createPadding(length, chars) { chars = chars === undefined2 ? " " : baseToString(chars); var charsLength = chars.length; if (charsLength < 2) { return charsLength ? baseRepeat(chars, length) : chars; } var result2 = baseRepeat(chars, nativeCeil(length / stringSize(chars))); return hasUnicode(chars) ? castSlice(stringToArray(result2), 0, length).join("") : result2.slice(0, length); } function createPartial(func, bitmask, thisArg, partials) { var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func); function wrapper() { var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array2(leftLength + argsLength), fn = this && this !== root && this instanceof wrapper ? Ctor : func; while (++leftIndex < leftLength) { args[leftIndex] = partials[leftIndex]; } while (argsLength--) { args[leftIndex++] = arguments[++argsIndex]; } return apply(fn, isBind ? thisArg : this, args); } return wrapper; } function createRange(fromRight) { return function(start, end, step) { if (step && typeof step != "number" && isIterateeCall(start, end, step)) { end = step = undefined2; } start = toFinite(start); if (end === undefined2) { end = start; start = 0; } else { end = toFinite(end); } step = step === undefined2 ? start < end ? 1 : -1 : toFinite(step); return baseRange(start, end, step, fromRight); }; } function createRelationalOperation(operator) { return function(value, other) { if (!(typeof value == "string" && typeof other == "string")) { value = toNumber(value); other = toNumber(other); } return operator(value, other); }; } function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary2, arity) { var isCurry = bitmask & WRAP_CURRY_FLAG, newHolders = isCurry ? holders : undefined2, newHoldersRight = isCurry ? undefined2 : holders, newPartials = isCurry ? partials : undefined2, newPartialsRight = isCurry ? undefined2 : partials; bitmask |= isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG; bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); } var newData = [ func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, newHoldersRight, argPos, ary2, arity ]; var result2 = wrapFunc.apply(undefined2, newData); if (isLaziable(func)) { setData(result2, newData); } result2.placeholder = placeholder; return setWrapToString(result2, func, bitmask); } function createRound(methodName) { var func = Math2[methodName]; return function(number, precision) { number = toNumber(number); precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); if (precision && nativeIsFinite(number)) { var pair = (toString(number) + "e").split("e"), value = func(pair[0] + "e" + (+pair[1] + precision)); pair = (toString(value) + "e").split("e"); return +(pair[0] + "e" + (+pair[1] - precision)); } return func(number); }; } var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY) ? noop2 : function(values2) { return new Set2(values2); }; function createToPairs(keysFunc) { return function(object) { var tag = getTag(object); if (tag == mapTag) { return mapToArray(object); } if (tag == setTag) { return setToPairs(object); } return baseToPairs(object, keysFunc(object)); }; } function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary2, arity) { var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; if (!isBindKey && typeof func != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } var length = partials ? partials.length : 0; if (!length) { bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); partials = holders = undefined2; } ary2 = ary2 === undefined2 ? ary2 : nativeMax(toInteger(ary2), 0); arity = arity === undefined2 ? arity : toInteger(arity); length -= holders ? holders.length : 0; if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { var partialsRight = partials, holdersRight = holders; partials = holders = undefined2; } var data = isBindKey ? undefined2 : getData(func); var newData = [ func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary2, arity ]; if (data) { mergeData(newData, data); } func = newData[0]; bitmask = newData[1]; thisArg = newData[2]; partials = newData[3]; holders = newData[4]; arity = newData[9] = newData[9] === undefined2 ? isBindKey ? 0 : func.length : nativeMax(newData[9] - length, 0); if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); } if (!bitmask || bitmask == WRAP_BIND_FLAG) { var result2 = createBind(func, bitmask, thisArg); } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { result2 = createCurry(func, bitmask, arity); } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { result2 = createPartial(func, bitmask, thisArg, partials); } else { result2 = createHybrid.apply(undefined2, newData); } var setter = data ? baseSetData : setData; return setWrapToString(setter(result2, newData), func, bitmask); } function customDefaultsAssignIn(objValue, srcValue, key2, object) { if (objValue === undefined2 || eq(objValue, objectProto[key2]) && !hasOwnProperty2.call(object, key2)) { return srcValue; } return objValue; } function customDefaultsMerge(objValue, srcValue, key2, object, source, stack) { if (isObject(objValue) && isObject(srcValue)) { stack.set(srcValue, objValue); baseMerge(objValue, srcValue, undefined2, customDefaultsMerge, stack); stack["delete"](srcValue); } return objValue; } function customOmitClone(value) { return isPlainObject2(value) ? undefined2 : value; } function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length; if (arrLength != othLength && !(isPartial && othLength > arrLength)) { return false; } var arrStacked = stack.get(array); var othStacked = stack.get(other); if (arrStacked && othStacked) { return arrStacked == other && othStacked == array; } var index = -1, result2 = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : undefined2; stack.set(array, other); stack.set(other, array); while (++index < arrLength) { var arrValue = array[index], othValue = other[index]; if (customizer) { var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack); } if (compared !== undefined2) { if (compared) { continue; } result2 = false; break; } if (seen) { if (!arraySome(other, function(othValue2, othIndex) { if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) { return seen.push(othIndex); } })) { result2 = false; break; } } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { result2 = false; break; } } stack["delete"](array); stack["delete"](other); return result2; } function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { switch (tag) { case dataViewTag: if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) { return false; } object = object.buffer; other = other.buffer; case arrayBufferTag: if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) { return false; } return true; case boolTag: case dateTag: case numberTag: return eq(+object, +other); case errorTag: return object.name == other.name && object.message == other.message; case regexpTag: case stringTag: return object == other + ""; case mapTag: var convert = mapToArray; case setTag: var isPartial = bitmask & COMPARE_PARTIAL_FLAG; convert || (convert = setToArray); if (object.size != other.size && !isPartial) { return false; } var stacked = stack.get(object); if (stacked) { return stacked == other; } bitmask |= COMPARE_UNORDERED_FLAG; stack.set(object, other); var result2 = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); stack["delete"](object); return result2; case symbolTag: if (symbolValueOf) { return symbolValueOf.call(object) == symbolValueOf.call(other); } } return false; } function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length; if (objLength != othLength && !isPartial) { return false; } var index = objLength; while (index--) { var key2 = objProps[index]; if (!(isPartial ? key2 in other : hasOwnProperty2.call(other, key2))) { return false; } } var objStacked = stack.get(object); var othStacked = stack.get(other); if (objStacked && othStacked) { return objStacked == other && othStacked == object; } var result2 = true; stack.set(object, other); stack.set(other, object); var skipCtor = isPartial; while (++index < objLength) { key2 = objProps[index]; var objValue = object[key2], othValue = other[key2]; if (customizer) { var compared = isPartial ? customizer(othValue, objValue, key2, other, object, stack) : customizer(objValue, othValue, key2, object, other, stack); } if (!(compared === undefined2 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) { result2 = false; break; } skipCtor || (skipCtor = key2 == "constructor"); } if (result2 && !skipCtor) { var objCtor = object.constructor, othCtor = other.constructor; if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) { result2 = false; } } stack["delete"](object); stack["delete"](other); return result2; } function flatRest(func) { return setToString(overRest(func, undefined2, flatten), func + ""); } function getAllKeys(object) { return baseGetAllKeys(object, keys, getSymbols); } function getAllKeysIn(object) { return baseGetAllKeys(object, keysIn, getSymbolsIn); } var getData = !metaMap ? noop2 : function(func) { return metaMap.get(func); }; function getFuncName(func) { var result2 = func.name + "", array = realNames[result2], length = hasOwnProperty2.call(realNames, result2) ? array.length : 0; while (length--) { var data = array[length], otherFunc = data.func; if (otherFunc == null || otherFunc == func) { return data.name; } } return result2; } function getHolder(func) { var object = hasOwnProperty2.call(lodash, "placeholder") ? lodash : func; return object.placeholder; } function getIteratee() { var result2 = lodash.iteratee || iteratee; result2 = result2 === iteratee ? baseIteratee : result2; return arguments.length ? result2(arguments[0], arguments[1]) : result2; } function getMapData(map2, key2) { var data = map2.__data__; return isKeyable(key2) ? data[typeof key2 == "string" ? "string" : "hash"] : data.map; } function getMatchData(object) { var result2 = keys(object), length = result2.length; while (length--) { var key2 = result2[length], value = object[key2]; result2[length] = [key2, value, isStrictComparable(value)]; } return result2; } function getNative(object, key2) { var value = getValue(object, key2); return baseIsNative(value) ? value : undefined2; } function getRawTag(value) { var isOwn = hasOwnProperty2.call(value, symToStringTag), tag = value[symToStringTag]; try { value[symToStringTag] = undefined2; var unmasked = true; } catch (e) { } var result2 = nativeObjectToString.call(value); if (unmasked) { if (isOwn) { value[symToStringTag] = tag; } else { delete value[symToStringTag]; } } return result2; } var getSymbols = !nativeGetSymbols ? stubArray : function(object) { if (object == null) { return []; } object = Object2(object); return arrayFilter(nativeGetSymbols(object), function(symbol) { return propertyIsEnumerable.call(object, symbol); }); }; var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { var result2 = []; while (object) { arrayPush(result2, getSymbols(object)); object = getPrototype(object); } return result2; }; var getTag = baseGetTag; if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) { getTag = function(value) { var result2 = baseGetTag(value), Ctor = result2 == objectTag ? value.constructor : undefined2, ctorString = Ctor ? toSource(Ctor) : ""; if (ctorString) { switch (ctorString) { case dataViewCtorString: return dataViewTag; case mapCtorString: return mapTag; case promiseCtorString: return promiseTag; case setCtorString: return setTag; case weakMapCtorString: return weakMapTag; } } return result2; }; } function getView(start, end, transforms) { var index = -1, length = transforms.length; while (++index < length) { var data = transforms[index], size2 = data.size; switch (data.type) { case "drop": start += size2; break; case "dropRight": end -= size2; break; case "take": end = nativeMin(end, start + size2); break; case "takeRight": start = nativeMax(start, end - size2); break; } } return { "start": start, "end": end }; } function getWrapDetails(source) { var match2 = source.match(reWrapDetails); return match2 ? match2[1].split(reSplitDetails) : []; } function hasPath(object, path2, hasFunc) { path2 = castPath(path2, object); var index = -1, length = path2.length, result2 = false; while (++index < length) { var key2 = toKey(path2[index]); if (!(result2 = object != null && hasFunc(object, key2))) { break; } object = object[key2]; } if (result2 || ++index != length) { return result2; } length = object == null ? 0 : object.length; return !!length && isLength(length) && isIndex(key2, length) && (isArray(object) || isArguments(object)); } function initCloneArray(array) { var length = array.length, result2 = new array.constructor(length); if (length && typeof array[0] == "string" && hasOwnProperty2.call(array, "index")) { result2.index = array.index; result2.input = array.input; } return result2; } function initCloneObject(object) { return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {}; } function initCloneByTag(object, tag, isDeep) { var Ctor = object.constructor; switch (tag) { case arrayBufferTag: return cloneArrayBuffer(object); case boolTag: case dateTag: return new Ctor(+object); case dataViewTag: return cloneDataView(object, isDeep); case float32Tag: case float64Tag: case int8Tag: case int16Tag: case int32Tag: case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: return cloneTypedArray(object, isDeep); case mapTag: return new Ctor(); case numberTag: case stringTag: return new Ctor(object); case regexpTag: return cloneRegExp(object); case setTag: return new Ctor(); case symbolTag: return cloneSymbol(object); } } function insertWrapDetails(source, details) { var length = details.length; if (!length) { return source; } var lastIndex = length - 1; details[lastIndex] = (length > 1 ? "& " : "") + details[lastIndex]; details = details.join(length > 2 ? ", " : " "); return source.replace(reWrapComment, "{\n/* [wrapped with " + details + "] */\n"); } function isFlattenable(value) { return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]); } function isIndex(value, length) { var type = typeof value; length = length == null ? MAX_SAFE_INTEGER : length; return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length); } function isIterateeCall(value, index, object) { if (!isObject(object)) { return false; } var type = typeof index; if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) { return eq(object[index], value); } return false; } function isKey(value, object) { if (isArray(value)) { return false; } var type = typeof value; if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) { return true; } return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object2(object); } function isKeyable(value) { var type = typeof value; return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null; } function isLaziable(func) { var funcName = getFuncName(func), other = lodash[funcName]; if (typeof other != "function" || !(funcName in LazyWrapper.prototype)) { return false; } if (func === other) { return true; } var data = getData(other); return !!data && func === data[0]; } function isMasked(func) { return !!maskSrcKey && maskSrcKey in func; } var isMaskable = coreJsData ? isFunction : stubFalse; function isPrototype(value) { var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto; return value === proto; } function isStrictComparable(value) { return value === value && !isObject(value); } function matchesStrictComparable(key2, srcValue) { return function(object) { if (object == null) { return false; } return object[key2] === srcValue && (srcValue !== undefined2 || key2 in Object2(object)); }; } function memoizeCapped(func) { var result2 = memoize(func, function(key2) { if (cache.size === MAX_MEMOIZE_SIZE) { cache.clear(); } return key2; }); var cache = result2.cache; return result2; } function mergeData(data, source) { var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); var isCombo = srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_CURRY_FLAG || srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_REARG_FLAG && data[7].length <= source[8] || srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG) && source[7].length <= source[8] && bitmask == WRAP_CURRY_FLAG; if (!(isCommon || isCombo)) { return data; } if (srcBitmask & WRAP_BIND_FLAG) { data[2] = source[2]; newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; } var value = source[3]; if (value) { var partials = data[3]; data[3] = partials ? composeArgs(partials, value, source[4]) : value; data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; } value = source[5]; if (value) { partials = data[5]; data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; } value = source[7]; if (value) { data[7] = value; } if (srcBitmask & WRAP_ARY_FLAG) { data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); } if (data[9] == null) { data[9] = source[9]; } data[0] = source[0]; data[1] = newBitmask; return data; } function nativeKeysIn(object) { var result2 = []; if (object != null) { for (var key2 in Object2(object)) { result2.push(key2); } } return result2; } function objectToString(value) { return nativeObjectToString.call(value); } function overRest(func, start, transform2) { start = nativeMax(start === undefined2 ? func.length - 1 : start, 0); return function() { var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array2(length); while (++index < length) { array[index] = args[start + index]; } index = -1; var otherArgs = Array2(start + 1); while (++index < start) { otherArgs[index] = args[index]; } otherArgs[start] = transform2(array); return apply(func, this, otherArgs); }; } function parent(object, path2) { return path2.length < 2 ? object : baseGet(object, baseSlice(path2, 0, -1)); } function reorder(array, indexes) { var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array); while (length--) { var index = indexes[length]; array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined2; } return array; } function safeGet(object, key2) { if (key2 === "constructor" && typeof object[key2] === "function") { return; } if (key2 == "__proto__") { return; } return object[key2]; } var setData = shortOut(baseSetData); var setTimeout2 = ctxSetTimeout || function(func, wait) { return root.setTimeout(func, wait); }; var setToString = shortOut(baseSetToString); function setWrapToString(wrapper, reference, bitmask) { var source = reference + ""; return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); } function shortOut(func) { var count = 0, lastCalled = 0; return function() { var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); lastCalled = stamp; if (remaining > 0) { if (++count >= HOT_COUNT) { return arguments[0]; } } else { count = 0; } return func.apply(undefined2, arguments); }; } function shuffleSelf(array, size2) { var index = -1, length = array.length, lastIndex = length - 1; size2 = size2 === undefined2 ? length : size2; while (++index < size2) { var rand = baseRandom(index, lastIndex), value = array[rand]; array[rand] = array[index]; array[index] = value; } array.length = size2; return array; } var stringToPath = memoizeCapped(function(string) { var result2 = []; if (string.charCodeAt(0) === 46) { result2.push(""); } string.replace(rePropName, function(match2, number, quote, subString) { result2.push(quote ? subString.replace(reEscapeChar, "$1") : number || match2); }); return result2; }); function toKey(value) { if (typeof value == "string" || isSymbol(value)) { return value; } var result2 = value + ""; return result2 == "0" && 1 / value == -INFINITY ? "-0" : result2; } function toSource(func) { if (func != null) { try { return funcToString.call(func); } catch (e) { } try { return func + ""; } catch (e) { } } return ""; } function updateWrapDetails(details, bitmask) { arrayEach(wrapFlags, function(pair) { var value = "_." + pair[0]; if (bitmask & pair[1] && !arrayIncludes(details, value)) { details.push(value); } }); return details.sort(); } function wrapperClone(wrapper) { if (wrapper instanceof LazyWrapper) { return wrapper.clone(); } var result2 = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); result2.__actions__ = copyArray(wrapper.__actions__); result2.__index__ = wrapper.__index__; result2.__values__ = wrapper.__values__; return result2; } function chunk(array, size2, guard) { if (guard ? isIterateeCall(array, size2, guard) : size2 === undefined2) { size2 = 1; } else { size2 = nativeMax(toInteger(size2), 0); } var length = array == null ? 0 : array.length; if (!length || size2 < 1) { return []; } var index = 0, resIndex = 0, result2 = Array2(nativeCeil(length / size2)); while (index < length) { result2[resIndex++] = baseSlice(array, index, index += size2); } return result2; } function compact(array) { var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result2 = []; while (++index < length) { var value = array[index]; if (value) { result2[resIndex++] = value; } } return result2; } function concat() { var length = arguments.length; if (!length) { return []; } var args = Array2(length - 1), array = arguments[0], index = length; while (index--) { args[index - 1] = arguments[index]; } return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); } var difference = baseRest(function(array, values2) { return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true)) : []; }); var differenceBy = baseRest(function(array, values2) { var iteratee2 = last(values2); if (isArrayLikeObject(iteratee2)) { iteratee2 = undefined2; } return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2)) : []; }); var differenceWith = baseRest(function(array, values2) { var comparator = last(values2); if (isArrayLikeObject(comparator)) { comparator = undefined2; } return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true), undefined2, comparator) : []; }); function drop(array, n2, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } n2 = guard || n2 === undefined2 ? 1 : toInteger(n2); return baseSlice(array, n2 < 0 ? 0 : n2, length); } function dropRight(array, n2, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } n2 = guard || n2 === undefined2 ? 1 : toInteger(n2); n2 = length - n2; return baseSlice(array, 0, n2 < 0 ? 0 : n2); } function dropRightWhile(array, predicate) { return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true, true) : []; } function dropWhile(array, predicate) { return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true) : []; } function fill(array, value, start, end) { var length = array == null ? 0 : array.length; if (!length) { return []; } if (start && typeof start != "number" && isIterateeCall(array, value, start)) { start = 0; end = length; } return baseFill(array, value, start, end); } function findIndex(array, predicate, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = fromIndex == null ? 0 : toInteger(fromIndex); if (index < 0) { index = nativeMax(length + index, 0); } return baseFindIndex(array, getIteratee(predicate, 3), index); } function findLastIndex(array, predicate, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = length - 1; if (fromIndex !== undefined2) { index = toInteger(fromIndex); index = fromIndex < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); } return baseFindIndex(array, getIteratee(predicate, 3), index, true); } function flatten(array) { var length = array == null ? 0 : array.length; return length ? baseFlatten(array, 1) : []; } function flattenDeep(array) { var length = array == null ? 0 : array.length; return length ? baseFlatten(array, INFINITY) : []; } function flattenDepth(array, depth) { var length = array == null ? 0 : array.length; if (!length) { return []; } depth = depth === undefined2 ? 1 : toInteger(depth); return baseFlatten(array, depth); } function fromPairs(pairs) { var index = -1, length = pairs == null ? 0 : pairs.length, result2 = {}; while (++index < length) { var pair = pairs[index]; result2[pair[0]] = pair[1]; } return result2; } function head(array) { return array && array.length ? array[0] : undefined2; } function indexOf(array, value, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = fromIndex == null ? 0 : toInteger(fromIndex); if (index < 0) { index = nativeMax(length + index, 0); } return baseIndexOf(array, value, index); } function initial(array) { var length = array == null ? 0 : array.length; return length ? baseSlice(array, 0, -1) : []; } var intersection = baseRest(function(arrays) { var mapped = arrayMap(arrays, castArrayLikeObject); return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped) : []; }); var intersectionBy = baseRest(function(arrays) { var iteratee2 = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject); if (iteratee2 === last(mapped)) { iteratee2 = undefined2; } else { mapped.pop(); } return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, getIteratee(iteratee2, 2)) : []; }); var intersectionWith = baseRest(function(arrays) { var comparator = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject); comparator = typeof comparator == "function" ? comparator : undefined2; if (comparator) { mapped.pop(); } return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : []; }); function join(array, separator) { return array == null ? "" : nativeJoin.call(array, separator); } function last(array) { var length = array == null ? 0 : array.length; return length ? array[length - 1] : undefined2; } function lastIndexOf(array, value, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = length; if (fromIndex !== undefined2) { index = toInteger(fromIndex); index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); } return value === value ? strictLastIndexOf(array, value, index) : baseFindIndex(array, baseIsNaN, index, true); } function nth(array, n2) { return array && array.length ? baseNth(array, toInteger(n2)) : undefined2; } var pull = baseRest(pullAll); function pullAll(array, values2) { return array && array.length && values2 && values2.length ? basePullAll(array, values2) : array; } function pullAllBy(array, values2, iteratee2) { return array && array.length && values2 && values2.length ? basePullAll(array, values2, getIteratee(iteratee2, 2)) : array; } function pullAllWith(array, values2, comparator) { return array && array.length && values2 && values2.length ? basePullAll(array, values2, undefined2, comparator) : array; } var pullAt = flatRest(function(array, indexes) { var length = array == null ? 0 : array.length, result2 = baseAt(array, indexes); basePullAt(array, arrayMap(indexes, function(index) { return isIndex(index, length) ? +index : index; }).sort(compareAscending)); return result2; }); function remove(array, predicate) { var result2 = []; if (!(array && array.length)) { return result2; } var index = -1, indexes = [], length = array.length; predicate = getIteratee(predicate, 3); while (++index < length) { var value = array[index]; if (predicate(value, index, array)) { result2.push(value); indexes.push(index); } } basePullAt(array, indexes); return result2; } function reverse(array) { return array == null ? array : nativeReverse.call(array); } function slice(array, start, end) { var length = array == null ? 0 : array.length; if (!length) { return []; } if (end && typeof end != "number" && isIterateeCall(array, start, end)) { start = 0; end = length; } else { start = start == null ? 0 : toInteger(start); end = end === undefined2 ? length : toInteger(end); } return baseSlice(array, start, end); } function sortedIndex(array, value) { return baseSortedIndex(array, value); } function sortedIndexBy(array, value, iteratee2) { return baseSortedIndexBy(array, value, getIteratee(iteratee2, 2)); } function sortedIndexOf(array, value) { var length = array == null ? 0 : array.length; if (length) { var index = baseSortedIndex(array, value); if (index < length && eq(array[index], value)) { return index; } } return -1; } function sortedLastIndex(array, value) { return baseSortedIndex(array, value, true); } function sortedLastIndexBy(array, value, iteratee2) { return baseSortedIndexBy(array, value, getIteratee(iteratee2, 2), true); } function sortedLastIndexOf(array, value) { var length = array == null ? 0 : array.length; if (length) { var index = baseSortedIndex(array, value, true) - 1; if (eq(array[index], value)) { return index; } } return -1; } function sortedUniq(array) { return array && array.length ? baseSortedUniq(array) : []; } function sortedUniqBy(array, iteratee2) { return array && array.length ? baseSortedUniq(array, getIteratee(iteratee2, 2)) : []; } function tail(array) { var length = array == null ? 0 : array.length; return length ? baseSlice(array, 1, length) : []; } function take(array, n2, guard) { if (!(array && array.length)) { return []; } n2 = guard || n2 === undefined2 ? 1 : toInteger(n2); return baseSlice(array, 0, n2 < 0 ? 0 : n2); } function takeRight(array, n2, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } n2 = guard || n2 === undefined2 ? 1 : toInteger(n2); n2 = length - n2; return baseSlice(array, n2 < 0 ? 0 : n2, length); } function takeRightWhile(array, predicate) { return array && array.length ? baseWhile(array, getIteratee(predicate, 3), false, true) : []; } function takeWhile(array, predicate) { return array && array.length ? baseWhile(array, getIteratee(predicate, 3)) : []; } var union = baseRest(function(arrays) { return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); }); var unionBy = baseRest(function(arrays) { var iteratee2 = last(arrays); if (isArrayLikeObject(iteratee2)) { iteratee2 = undefined2; } return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2)); }); var unionWith = baseRest(function(arrays) { var comparator = last(arrays); comparator = typeof comparator == "function" ? comparator : undefined2; return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined2, comparator); }); function uniq(array) { return array && array.length ? baseUniq(array) : []; } function uniqBy(array, iteratee2) { return array && array.length ? baseUniq(array, getIteratee(iteratee2, 2)) : []; } function uniqWith(array, comparator) { comparator = typeof comparator == "function" ? comparator : undefined2; return array && array.length ? baseUniq(array, undefined2, comparator) : []; } function unzip(array) { if (!(array && array.length)) { return []; } var length = 0; array = arrayFilter(array, function(group) { if (isArrayLikeObject(group)) { length = nativeMax(group.length, length); return true; } }); return baseTimes(length, function(index) { return arrayMap(array, baseProperty(index)); }); } function unzipWith(array, iteratee2) { if (!(array && array.length)) { return []; } var result2 = unzip(array); if (iteratee2 == null) { return result2; } return arrayMap(result2, function(group) { return apply(iteratee2, undefined2, group); }); } var without = baseRest(function(array, values2) { return isArrayLikeObject(array) ? baseDifference(array, values2) : []; }); var xor = baseRest(function(arrays) { return baseXor(arrayFilter(arrays, isArrayLikeObject)); }); var xorBy = baseRest(function(arrays) { var iteratee2 = last(arrays); if (isArrayLikeObject(iteratee2)) { iteratee2 = undefined2; } return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee2, 2)); }); var xorWith = baseRest(function(arrays) { var comparator = last(arrays); comparator = typeof comparator == "function" ? comparator : undefined2; return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined2, comparator); }); var zip = baseRest(unzip); function zipObject(props, values2) { return baseZipObject(props || [], values2 || [], assignValue); } function zipObjectDeep(props, values2) { return baseZipObject(props || [], values2 || [], baseSet); } var zipWith = baseRest(function(arrays) { var length = arrays.length, iteratee2 = length > 1 ? arrays[length - 1] : undefined2; iteratee2 = typeof iteratee2 == "function" ? (arrays.pop(), iteratee2) : undefined2; return unzipWith(arrays, iteratee2); }); function chain(value) { var result2 = lodash(value); result2.__chain__ = true; return result2; } function tap(value, interceptor) { interceptor(value); return value; } function thru(value, interceptor) { return interceptor(value); } var wrapperAt = flatRest(function(paths) { var length = paths.length, start = length ? paths[0] : 0, value = this.__wrapped__, interceptor = function(object) { return baseAt(object, paths); }; if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) { return this.thru(interceptor); } value = value.slice(start, +start + (length ? 1 : 0)); value.__actions__.push({ "func": thru, "args": [interceptor], "thisArg": undefined2 }); return new LodashWrapper(value, this.__chain__).thru(function(array) { if (length && !array.length) { array.push(undefined2); } return array; }); }); function wrapperChain() { return chain(this); } function wrapperCommit() { return new LodashWrapper(this.value(), this.__chain__); } function wrapperNext() { if (this.__values__ === undefined2) { this.__values__ = toArray(this.value()); } var done = this.__index__ >= this.__values__.length, value = done ? undefined2 : this.__values__[this.__index__++]; return { "done": done, "value": value }; } function wrapperToIterator() { return this; } function wrapperPlant(value) { var result2, parent2 = this; while (parent2 instanceof baseLodash) { var clone4 = wrapperClone(parent2); clone4.__index__ = 0; clone4.__values__ = undefined2; if (result2) { previous.__wrapped__ = clone4; } else { result2 = clone4; } var previous = clone4; parent2 = parent2.__wrapped__; } previous.__wrapped__ = value; return result2; } function wrapperReverse() { var value = this.__wrapped__; if (value instanceof LazyWrapper) { var wrapped = value; if (this.__actions__.length) { wrapped = new LazyWrapper(this); } wrapped = wrapped.reverse(); wrapped.__actions__.push({ "func": thru, "args": [reverse], "thisArg": undefined2 }); return new LodashWrapper(wrapped, this.__chain__); } return this.thru(reverse); } function wrapperValue() { return baseWrapperValue(this.__wrapped__, this.__actions__); } var countBy = createAggregator(function(result2, value, key2) { if (hasOwnProperty2.call(result2, key2)) { ++result2[key2]; } else { baseAssignValue(result2, key2, 1); } }); function every(collection, predicate, guard) { var func = isArray(collection) ? arrayEvery : baseEvery; if (guard && isIterateeCall(collection, predicate, guard)) { predicate = undefined2; } return func(collection, getIteratee(predicate, 3)); } function filter2(collection, predicate) { var func = isArray(collection) ? arrayFilter : baseFilter; return func(collection, getIteratee(predicate, 3)); } var find = createFind(findIndex); var findLast = createFind(findLastIndex); function flatMap(collection, iteratee2) { return baseFlatten(map(collection, iteratee2), 1); } function flatMapDeep(collection, iteratee2) { return baseFlatten(map(collection, iteratee2), INFINITY); } function flatMapDepth(collection, iteratee2, depth) { depth = depth === undefined2 ? 1 : toInteger(depth); return baseFlatten(map(collection, iteratee2), depth); } function forEach(collection, iteratee2) { var func = isArray(collection) ? arrayEach : baseEach; return func(collection, getIteratee(iteratee2, 3)); } function forEachRight(collection, iteratee2) { var func = isArray(collection) ? arrayEachRight : baseEachRight; return func(collection, getIteratee(iteratee2, 3)); } var groupBy = createAggregator(function(result2, value, key2) { if (hasOwnProperty2.call(result2, key2)) { result2[key2].push(value); } else { baseAssignValue(result2, key2, [value]); } }); function includes(collection, value, fromIndex, guard) { collection = isArrayLike(collection) ? collection : values(collection); fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0; var length = collection.length; if (fromIndex < 0) { fromIndex = nativeMax(length + fromIndex, 0); } return isString2(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1; } var invokeMap = baseRest(function(collection, path2, args) { var index = -1, isFunc = typeof path2 == "function", result2 = isArrayLike(collection) ? Array2(collection.length) : []; baseEach(collection, function(value) { result2[++index] = isFunc ? apply(path2, value, args) : baseInvoke(value, path2, args); }); return result2; }); var keyBy = createAggregator(function(result2, value, key2) { baseAssignValue(result2, key2, value); }); function map(collection, iteratee2) { var func = isArray(collection) ? arrayMap : baseMap; return func(collection, getIteratee(iteratee2, 3)); } function orderBy(collection, iteratees, orders, guard) { if (collection == null) { return []; } if (!isArray(iteratees)) { iteratees = iteratees == null ? [] : [iteratees]; } orders = guard ? undefined2 : orders; if (!isArray(orders)) { orders = orders == null ? [] : [orders]; } return baseOrderBy(collection, iteratees, orders); } var partition = createAggregator(function(result2, value, key2) { result2[key2 ? 0 : 1].push(value); }, function() { return [[], []]; }); function reduce(collection, iteratee2, accumulator) { var func = isArray(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3; return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEach); } function reduceRight(collection, iteratee2, accumulator) { var func = isArray(collection) ? arrayReduceRight : baseReduce, initAccum = arguments.length < 3; return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEachRight); } function reject2(collection, predicate) { var func = isArray(collection) ? arrayFilter : baseFilter; return func(collection, negate(getIteratee(predicate, 3))); } function sample(collection) { var func = isArray(collection) ? arraySample : baseSample; return func(collection); } function sampleSize(collection, n2, guard) { if (guard ? isIterateeCall(collection, n2, guard) : n2 === undefined2) { n2 = 1; } else { n2 = toInteger(n2); } var func = isArray(collection) ? arraySampleSize : baseSampleSize; return func(collection, n2); } function shuffle(collection) { var func = isArray(collection) ? arrayShuffle : baseShuffle; return func(collection); } function size(collection) { if (collection == null) { return 0; } if (isArrayLike(collection)) { return isString2(collection) ? stringSize(collection) : collection.length; } var tag = getTag(collection); if (tag == mapTag || tag == setTag) { return collection.size; } return baseKeys(collection).length; } function some(collection, predicate, guard) { var func = isArray(collection) ? arraySome : baseSome; if (guard && isIterateeCall(collection, predicate, guard)) { predicate = undefined2; } return func(collection, getIteratee(predicate, 3)); } var sortBy = baseRest(function(collection, iteratees) { if (collection == null) { return []; } var length = iteratees.length; if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { iteratees = []; } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { iteratees = [iteratees[0]]; } return baseOrderBy(collection, baseFlatten(iteratees, 1), []); }); var now3 = ctxNow || function() { return root.Date.now(); }; function after(n2, func) { if (typeof func != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } n2 = toInteger(n2); return function() { if (--n2 < 1) { return func.apply(this, arguments); } }; } function ary(func, n2, guard) { n2 = guard ? undefined2 : n2; n2 = func && n2 == null ? func.length : n2; return createWrap(func, WRAP_ARY_FLAG, undefined2, undefined2, undefined2, undefined2, n2); } function before(n2, func) { var result2; if (typeof func != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } n2 = toInteger(n2); return function() { if (--n2 > 0) { result2 = func.apply(this, arguments); } if (n2 <= 1) { func = undefined2; } return result2; }; } var bind = baseRest(function(func, thisArg, partials) { var bitmask = WRAP_BIND_FLAG; if (partials.length) { var holders = replaceHolders(partials, getHolder(bind)); bitmask |= WRAP_PARTIAL_FLAG; } return createWrap(func, bitmask, thisArg, partials, holders); }); var bindKey = baseRest(function(object, key2, partials) { var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; if (partials.length) { var holders = replaceHolders(partials, getHolder(bindKey)); bitmask |= WRAP_PARTIAL_FLAG; } return createWrap(key2, bitmask, object, partials, holders); }); function curry(func, arity, guard) { arity = guard ? undefined2 : arity; var result2 = createWrap(func, WRAP_CURRY_FLAG, undefined2, undefined2, undefined2, undefined2, undefined2, arity); result2.placeholder = curry.placeholder; return result2; } function curryRight(func, arity, guard) { arity = guard ? undefined2 : arity; var result2 = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined2, undefined2, undefined2, undefined2, undefined2, arity); result2.placeholder = curryRight.placeholder; return result2; } function debounce(func, wait, options) { var lastArgs, lastThis, maxWait, result2, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true; if (typeof func != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } wait = toNumber(wait) || 0; if (isObject(options)) { leading = !!options.leading; maxing = "maxWait" in options; maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; trailing = "trailing" in options ? !!options.trailing : trailing; } function invokeFunc(time) { var args = lastArgs, thisArg = lastThis; lastArgs = lastThis = undefined2; lastInvokeTime = time; result2 = func.apply(thisArg, args); return result2; } function leadingEdge(time) { lastInvokeTime = time; timerId = setTimeout2(timerExpired, wait); return leading ? invokeFunc(time) : result2; } function remainingWait(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall; return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting; } function shouldInvoke(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime; return lastCallTime === undefined2 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait; } function timerExpired() { var time = now3(); if (shouldInvoke(time)) { return trailingEdge(time); } timerId = setTimeout2(timerExpired, remainingWait(time)); } function trailingEdge(time) { timerId = undefined2; if (trailing && lastArgs) { return invokeFunc(time); } lastArgs = lastThis = undefined2; return result2; } function cancel() { if (timerId !== undefined2) { clearTimeout2(timerId); } lastInvokeTime = 0; lastArgs = lastCallTime = lastThis = timerId = undefined2; } function flush() { return timerId === undefined2 ? result2 : trailingEdge(now3()); } function debounced() { var time = now3(), isInvoking = shouldInvoke(time); lastArgs = arguments; lastThis = this; lastCallTime = time; if (isInvoking) { if (timerId === undefined2) { return leadingEdge(lastCallTime); } if (maxing) { clearTimeout2(timerId); timerId = setTimeout2(timerExpired, wait); return invokeFunc(lastCallTime); } } if (timerId === undefined2) { timerId = setTimeout2(timerExpired, wait); } return result2; } debounced.cancel = cancel; debounced.flush = flush; return debounced; } var defer = baseRest(function(func, args) { return baseDelay(func, 1, args); }); var delay = baseRest(function(func, wait, args) { return baseDelay(func, toNumber(wait) || 0, args); }); function flip(func) { return createWrap(func, WRAP_FLIP_FLAG); } function memoize(func, resolver) { if (typeof func != "function" || resolver != null && typeof resolver != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } var memoized = function() { var args = arguments, key2 = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; if (cache.has(key2)) { return cache.get(key2); } var result2 = func.apply(this, args); memoized.cache = cache.set(key2, result2) || cache; return result2; }; memoized.cache = new (memoize.Cache || MapCache)(); return memoized; } memoize.Cache = MapCache; function negate(predicate) { if (typeof predicate != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } return function() { var args = arguments; switch (args.length) { case 0: return !predicate.call(this); case 1: return !predicate.call(this, args[0]); case 2: return !predicate.call(this, args[0], args[1]); case 3: return !predicate.call(this, args[0], args[1], args[2]); } return !predicate.apply(this, args); }; } function once(func) { return before(2, func); } var overArgs = castRest(function(func, transforms) { transforms = transforms.length == 1 && isArray(transforms[0]) ? arrayMap(transforms[0], baseUnary(getIteratee())) : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); var funcsLength = transforms.length; return baseRest(function(args) { var index = -1, length = nativeMin(args.length, funcsLength); while (++index < length) { args[index] = transforms[index].call(this, args[index]); } return apply(func, this, args); }); }); var partial = baseRest(function(func, partials) { var holders = replaceHolders(partials, getHolder(partial)); return createWrap(func, WRAP_PARTIAL_FLAG, undefined2, partials, holders); }); var partialRight = baseRest(function(func, partials) { var holders = replaceHolders(partials, getHolder(partialRight)); return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined2, partials, holders); }); var rearg = flatRest(function(func, indexes) { return createWrap(func, WRAP_REARG_FLAG, undefined2, undefined2, undefined2, indexes); }); function rest(func, start) { if (typeof func != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } start = start === undefined2 ? start : toInteger(start); return baseRest(func, start); } function spread(func, start) { if (typeof func != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } start = start == null ? 0 : nativeMax(toInteger(start), 0); return baseRest(function(args) { var array = args[start], otherArgs = castSlice(args, 0, start); if (array) { arrayPush(otherArgs, array); } return apply(func, this, otherArgs); }); } function throttle(func, wait, options) { var leading = true, trailing = true; if (typeof func != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } if (isObject(options)) { leading = "leading" in options ? !!options.leading : leading; trailing = "trailing" in options ? !!options.trailing : trailing; } return debounce(func, wait, { "leading": leading, "maxWait": wait, "trailing": trailing }); } function unary(func) { return ary(func, 1); } function wrap(value, wrapper) { return partial(castFunction(wrapper), value); } function castArray() { if (!arguments.length) { return []; } var value = arguments[0]; return isArray(value) ? value : [value]; } function clone3(value) { return baseClone(value, CLONE_SYMBOLS_FLAG); } function cloneWith(value, customizer) { customizer = typeof customizer == "function" ? customizer : undefined2; return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); } function cloneDeep(value) { return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); } function cloneDeepWith(value, customizer) { customizer = typeof customizer == "function" ? customizer : undefined2; return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); } function conformsTo(object, source) { return source == null || baseConformsTo(object, source, keys(source)); } function eq(value, other) { return value === other || value !== value && other !== other; } var gt = createRelationalOperation(baseGt); var gte = createRelationalOperation(function(value, other) { return value >= other; }); var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { return isObjectLike(value) && hasOwnProperty2.call(value, "callee") && !propertyIsEnumerable.call(value, "callee"); }; var isArray = Array2.isArray; var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; function isArrayLike(value) { return value != null && isLength(value.length) && !isFunction(value); } function isArrayLikeObject(value) { return isObjectLike(value) && isArrayLike(value); } function isBoolean(value) { return value === true || value === false || isObjectLike(value) && baseGetTag(value) == boolTag; } var isBuffer = nativeIsBuffer || stubFalse; var isDate2 = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; function isElement(value) { return isObjectLike(value) && value.nodeType === 1 && !isPlainObject2(value); } function isEmpty(value) { if (value == null) { return true; } if (isArrayLike(value) && (isArray(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer(value) || isTypedArray(value) || isArguments(value))) { return !value.length; } var tag = getTag(value); if (tag == mapTag || tag == setTag) { return !value.size; } if (isPrototype(value)) { return !baseKeys(value).length; } for (var key2 in value) { if (hasOwnProperty2.call(value, key2)) { return false; } } return true; } function isEqual(value, other) { return baseIsEqual(value, other); } function isEqualWith(value, other, customizer) { customizer = typeof customizer == "function" ? customizer : undefined2; var result2 = customizer ? customizer(value, other) : undefined2; return result2 === undefined2 ? baseIsEqual(value, other, undefined2, customizer) : !!result2; } function isError(value) { if (!isObjectLike(value)) { return false; } var tag = baseGetTag(value); return tag == errorTag || tag == domExcTag || typeof value.message == "string" && typeof value.name == "string" && !isPlainObject2(value); } function isFinite2(value) { return typeof value == "number" && nativeIsFinite(value); } function isFunction(value) { if (!isObject(value)) { return false; } var tag = baseGetTag(value); return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } function isInteger2(value) { return typeof value == "number" && value == toInteger(value); } function isLength(value) { return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } function isObject(value) { var type = typeof value; return value != null && (type == "object" || type == "function"); } function isObjectLike(value) { return value != null && typeof value == "object"; } var isMap2 = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; function isMatch(object, source) { return object === source || baseIsMatch(object, source, getMatchData(source)); } function isMatchWith(object, source, customizer) { customizer = typeof customizer == "function" ? customizer : undefined2; return baseIsMatch(object, source, getMatchData(source), customizer); } function isNaN2(value) { return isNumber2(value) && value != +value; } function isNative(value) { if (isMaskable(value)) { throw new Error2(CORE_ERROR_TEXT); } return baseIsNative(value); } function isNull(value) { return value === null; } function isNil(value) { return value == null; } function isNumber2(value) { return typeof value == "number" || isObjectLike(value) && baseGetTag(value) == numberTag; } function isPlainObject2(value) { if (!isObjectLike(value) || baseGetTag(value) != objectTag) { return false; } var proto = getPrototype(value); if (proto === null) { return true; } var Ctor = hasOwnProperty2.call(proto, "constructor") && proto.constructor; return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString2; } var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; function isSafeInteger(value) { return isInteger2(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; } var isSet2 = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; function isString2(value) { return typeof value == "string" || !isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag; } function isSymbol(value) { return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag; } var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; function isUndefined2(value) { return value === undefined2; } function isWeakMap(value) { return isObjectLike(value) && getTag(value) == weakMapTag; } function isWeakSet(value) { return isObjectLike(value) && baseGetTag(value) == weakSetTag; } var lt = createRelationalOperation(baseLt); var lte = createRelationalOperation(function(value, other) { return value <= other; }); function toArray(value) { if (!value) { return []; } if (isArrayLike(value)) { return isString2(value) ? stringToArray(value) : copyArray(value); } if (symIterator && value[symIterator]) { return iteratorToArray(value[symIterator]()); } var tag = getTag(value), func = tag == mapTag ? mapToArray : tag == setTag ? setToArray : values; return func(value); } function toFinite(value) { if (!value) { return value === 0 ? value : 0; } value = toNumber(value); if (value === INFINITY || value === -INFINITY) { var sign = value < 0 ? -1 : 1; return sign * MAX_INTEGER; } return value === value ? value : 0; } function toInteger(value) { var result2 = toFinite(value), remainder = result2 % 1; return result2 === result2 ? remainder ? result2 - remainder : result2 : 0; } function toLength(value) { return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; } function toNumber(value) { if (typeof value == "number") { return value; } if (isSymbol(value)) { return NAN; } if (isObject(value)) { var other = typeof value.valueOf == "function" ? value.valueOf() : value; value = isObject(other) ? other + "" : other; } if (typeof value != "string") { return value === 0 ? value : +value; } value = baseTrim(value); var isBinary = reIsBinary.test(value); return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; } function toPlainObject(value) { return copyObject(value, keysIn(value)); } function toSafeInteger(value) { return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : value === 0 ? value : 0; } function toString(value) { return value == null ? "" : baseToString(value); } var assign = createAssigner(function(object, source) { if (isPrototype(source) || isArrayLike(source)) { copyObject(source, keys(source), object); return; } for (var key2 in source) { if (hasOwnProperty2.call(source, key2)) { assignValue(object, key2, source[key2]); } } }); var assignIn = createAssigner(function(object, source) { copyObject(source, keysIn(source), object); }); var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { copyObject(source, keysIn(source), object, customizer); }); var assignWith = createAssigner(function(object, source, srcIndex, customizer) { copyObject(source, keys(source), object, customizer); }); var at = flatRest(baseAt); function create(prototype, properties2) { var result2 = baseCreate(prototype); return properties2 == null ? result2 : baseAssign(result2, properties2); } var defaults = baseRest(function(object, sources) { object = Object2(object); var index = -1; var length = sources.length; var guard = length > 2 ? sources[2] : undefined2; if (guard && isIterateeCall(sources[0], sources[1], guard)) { length = 1; } while (++index < length) { var source = sources[index]; var props = keysIn(source); var propsIndex = -1; var propsLength = props.length; while (++propsIndex < propsLength) { var key2 = props[propsIndex]; var value = object[key2]; if (value === undefined2 || eq(value, objectProto[key2]) && !hasOwnProperty2.call(object, key2)) { object[key2] = source[key2]; } } } return object; }); var defaultsDeep = baseRest(function(args) { args.push(undefined2, customDefaultsMerge); return apply(mergeWith, undefined2, args); }); function findKey(object, predicate) { return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); } function findLastKey(object, predicate) { return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); } function forIn(object, iteratee2) { return object == null ? object : baseFor(object, getIteratee(iteratee2, 3), keysIn); } function forInRight(object, iteratee2) { return object == null ? object : baseForRight(object, getIteratee(iteratee2, 3), keysIn); } function forOwn(object, iteratee2) { return object && baseForOwn(object, getIteratee(iteratee2, 3)); } function forOwnRight(object, iteratee2) { return object && baseForOwnRight(object, getIteratee(iteratee2, 3)); } function functions(object) { return object == null ? [] : baseFunctions(object, keys(object)); } function functionsIn(object) { return object == null ? [] : baseFunctions(object, keysIn(object)); } function get(object, path2, defaultValue2) { var result2 = object == null ? undefined2 : baseGet(object, path2); return result2 === undefined2 ? defaultValue2 : result2; } function has2(object, path2) { return object != null && hasPath(object, path2, baseHas); } function hasIn(object, path2) { return object != null && hasPath(object, path2, baseHasIn); } var invert = createInverter(function(result2, value, key2) { if (value != null && typeof value.toString != "function") { value = nativeObjectToString.call(value); } result2[value] = key2; }, constant(identity)); var invertBy = createInverter(function(result2, value, key2) { if (value != null && typeof value.toString != "function") { value = nativeObjectToString.call(value); } if (hasOwnProperty2.call(result2, value)) { result2[value].push(key2); } else { result2[value] = [key2]; } }, getIteratee); var invoke = baseRest(baseInvoke); function keys(object) { return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); } function keysIn(object) { return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); } function mapKeys(object, iteratee2) { var result2 = {}; iteratee2 = getIteratee(iteratee2, 3); baseForOwn(object, function(value, key2, object2) { baseAssignValue(result2, iteratee2(value, key2, object2), value); }); return result2; } function mapValues(object, iteratee2) { var result2 = {}; iteratee2 = getIteratee(iteratee2, 3); baseForOwn(object, function(value, key2, object2) { baseAssignValue(result2, key2, iteratee2(value, key2, object2)); }); return result2; } var merge = createAssigner(function(object, source, srcIndex) { baseMerge(object, source, srcIndex); }); var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { baseMerge(object, source, srcIndex, customizer); }); var omit = flatRest(function(object, paths) { var result2 = {}; if (object == null) { return result2; } var isDeep = false; paths = arrayMap(paths, function(path2) { path2 = castPath(path2, object); isDeep || (isDeep = path2.length > 1); return path2; }); copyObject(object, getAllKeysIn(object), result2); if (isDeep) { result2 = baseClone(result2, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); } var length = paths.length; while (length--) { baseUnset(result2, paths[length]); } return result2; }); function omitBy(object, predicate) { return pickBy(object, negate(getIteratee(predicate))); } var pick2 = flatRest(function(object, paths) { return object == null ? {} : basePick(object, paths); }); function pickBy(object, predicate) { if (object == null) { return {}; } var props = arrayMap(getAllKeysIn(object), function(prop) { return [prop]; }); predicate = getIteratee(predicate); return basePickBy(object, props, function(value, path2) { return predicate(value, path2[0]); }); } function result(object, path2, defaultValue2) { path2 = castPath(path2, object); var index = -1, length = path2.length; if (!length) { length = 1; object = undefined2; } while (++index < length) { var value = object == null ? undefined2 : object[toKey(path2[index])]; if (value === undefined2) { index = length; value = defaultValue2; } object = isFunction(value) ? value.call(object) : value; } return object; } function set2(object, path2, value) { return object == null ? object : baseSet(object, path2, value); } function setWith(object, path2, value, customizer) { customizer = typeof customizer == "function" ? customizer : undefined2; return object == null ? object : baseSet(object, path2, value, customizer); } var toPairs = createToPairs(keys); var toPairsIn = createToPairs(keysIn); function transform(object, iteratee2, accumulator) { var isArr = isArray(object), isArrLike = isArr || isBuffer(object) || isTypedArray(object); iteratee2 = getIteratee(iteratee2, 4); if (accumulator == null) { var Ctor = object && object.constructor; if (isArrLike) { accumulator = isArr ? new Ctor() : []; } else if (isObject(object)) { accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; } else { accumulator = {}; } } (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object2) { return iteratee2(accumulator, value, index, object2); }); return accumulator; } function unset(object, path2) { return object == null ? true : baseUnset(object, path2); } function update(object, path2, updater) { return object == null ? object : baseUpdate(object, path2, castFunction(updater)); } function updateWith(object, path2, updater, customizer) { customizer = typeof customizer == "function" ? customizer : undefined2; return object == null ? object : baseUpdate(object, path2, castFunction(updater), customizer); } function values(object) { return object == null ? [] : baseValues(object, keys(object)); } function valuesIn(object) { return object == null ? [] : baseValues(object, keysIn(object)); } function clamp(number, lower, upper) { if (upper === undefined2) { upper = lower; lower = undefined2; } if (upper !== undefined2) { upper = toNumber(upper); upper = upper === upper ? upper : 0; } if (lower !== undefined2) { lower = toNumber(lower); lower = lower === lower ? lower : 0; } return baseClamp(toNumber(number), lower, upper); } function inRange(number, start, end) { start = toFinite(start); if (end === undefined2) { end = start; start = 0; } else { end = toFinite(end); } number = toNumber(number); return baseInRange(number, start, end); } function random(lower, upper, floating) { if (floating && typeof floating != "boolean" && isIterateeCall(lower, upper, floating)) { upper = floating = undefined2; } if (floating === undefined2) { if (typeof upper == "boolean") { floating = upper; upper = undefined2; } else if (typeof lower == "boolean") { floating = lower; lower = undefined2; } } if (lower === undefined2 && upper === undefined2) { lower = 0; upper = 1; } else { lower = toFinite(lower); if (upper === undefined2) { upper = lower; lower = 0; } else { upper = toFinite(upper); } } if (lower > upper) { var temp = lower; lower = upper; upper = temp; } if (floating || lower % 1 || upper % 1) { var rand = nativeRandom(); return nativeMin(lower + rand * (upper - lower + freeParseFloat("1e-" + ((rand + "").length - 1))), upper); } return baseRandom(lower, upper); } var camelCase = createCompounder(function(result2, word, index) { word = word.toLowerCase(); return result2 + (index ? capitalize(word) : word); }); function capitalize(string) { return upperFirst(toString(string).toLowerCase()); } function deburr(string) { string = toString(string); return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ""); } function endsWith(string, target, position) { string = toString(string); target = baseToString(target); var length = string.length; position = position === undefined2 ? length : baseClamp(toInteger(position), 0, length); var end = position; position -= target.length; return position >= 0 && string.slice(position, end) == target; } function escape(string) { string = toString(string); return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string; } function escapeRegExp2(string) { string = toString(string); return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar, "\\$&") : string; } var kebabCase = createCompounder(function(result2, word, index) { return result2 + (index ? "-" : "") + word.toLowerCase(); }); var lowerCase = createCompounder(function(result2, word, index) { return result2 + (index ? " " : "") + word.toLowerCase(); }); var lowerFirst = createCaseFirst("toLowerCase"); function pad(string, length, chars) { string = toString(string); length = toInteger(length); var strLength = length ? stringSize(string) : 0; if (!length || strLength >= length) { return string; } var mid = (length - strLength) / 2; return createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars); } function padEnd(string, length, chars) { string = toString(string); length = toInteger(length); var strLength = length ? stringSize(string) : 0; return length && strLength < length ? string + createPadding(length - strLength, chars) : string; } function padStart2(string, length, chars) { string = toString(string); length = toInteger(length); var strLength = length ? stringSize(string) : 0; return length && strLength < length ? createPadding(length - strLength, chars) + string : string; } function parseInt2(string, radix, guard) { if (guard || radix == null) { radix = 0; } else if (radix) { radix = +radix; } return nativeParseInt(toString(string).replace(reTrimStart, ""), radix || 0); } function repeat(string, n2, guard) { if (guard ? isIterateeCall(string, n2, guard) : n2 === undefined2) { n2 = 1; } else { n2 = toInteger(n2); } return baseRepeat(toString(string), n2); } function replace() { var args = arguments, string = toString(args[0]); return args.length < 3 ? string : string.replace(args[1], args[2]); } var snakeCase = createCompounder(function(result2, word, index) { return result2 + (index ? "_" : "") + word.toLowerCase(); }); function split(string, separator, limit) { if (limit && typeof limit != "number" && isIterateeCall(string, separator, limit)) { separator = limit = undefined2; } limit = limit === undefined2 ? MAX_ARRAY_LENGTH : limit >>> 0; if (!limit) { return []; } string = toString(string); if (string && (typeof separator == "string" || separator != null && !isRegExp(separator))) { separator = baseToString(separator); if (!separator && hasUnicode(string)) { return castSlice(stringToArray(string), 0, limit); } } return string.split(separator, limit); } var startCase = createCompounder(function(result2, word, index) { return result2 + (index ? " " : "") + upperFirst(word); }); function startsWith(string, target, position) { string = toString(string); position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length); target = baseToString(target); return string.slice(position, position + target.length) == target; } function template(string, options, guard) { var settings = lodash.templateSettings; if (guard && isIterateeCall(string, options, guard)) { options = undefined2; } string = toString(string); options = assignInWith({}, options, settings, customDefaultsAssignIn); var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn), importsKeys = keys(imports), importsValues = baseValues(imports, importsKeys); var isEscaping, isEvaluating, index = 0, interpolate = options.interpolate || reNoMatch, source = "__p += '"; var reDelimiters = RegExp2( (options.escape || reNoMatch).source + "|" + interpolate.source + "|" + (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + "|" + (options.evaluate || reNoMatch).source + "|$", "g" ); var sourceURL = "//# sourceURL=" + (hasOwnProperty2.call(options, "sourceURL") ? (options.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++templateCounter + "]") + "\n"; string.replace(reDelimiters, function(match2, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset2) { interpolateValue || (interpolateValue = esTemplateValue); source += string.slice(index, offset2).replace(reUnescapedString, escapeStringChar); if (escapeValue) { isEscaping = true; source += "' +\n__e(" + escapeValue + ") +\n'"; } if (evaluateValue) { isEvaluating = true; source += "';\n" + evaluateValue + ";\n__p += '"; } if (interpolateValue) { source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'"; } index = offset2 + match2.length; return match2; }); source += "';\n"; var variable = hasOwnProperty2.call(options, "variable") && options.variable; if (!variable) { source = "with (obj) {\n" + source + "\n}\n"; } else if (reForbiddenIdentifierChars.test(variable)) { throw new Error2(INVALID_TEMPL_VAR_ERROR_TEXT); } source = (isEvaluating ? source.replace(reEmptyStringLeading, "") : source).replace(reEmptyStringMiddle, "$1").replace(reEmptyStringTrailing, "$1;"); source = "function(" + (variable || "obj") + ") {\n" + (variable ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (isEscaping ? ", __e = _.escape" : "") + (isEvaluating ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + source + "return __p\n}"; var result2 = attempt(function() { return Function2(importsKeys, sourceURL + "return " + source).apply(undefined2, importsValues); }); result2.source = source; if (isError(result2)) { throw result2; } return result2; } function toLower(value) { return toString(value).toLowerCase(); } function toUpper(value) { return toString(value).toUpperCase(); } function trim(string, chars, guard) { string = toString(string); if (string && (guard || chars === undefined2)) { return baseTrim(string); } if (!string || !(chars = baseToString(chars))) { return string; } var strSymbols = stringToArray(string), chrSymbols = stringToArray(chars), start = charsStartIndex(strSymbols, chrSymbols), end = charsEndIndex(strSymbols, chrSymbols) + 1; return castSlice(strSymbols, start, end).join(""); } function trimEnd(string, chars, guard) { string = toString(string); if (string && (guard || chars === undefined2)) { return string.slice(0, trimmedEndIndex(string) + 1); } if (!string || !(chars = baseToString(chars))) { return string; } var strSymbols = stringToArray(string), end = charsEndIndex(strSymbols, stringToArray(chars)) + 1; return castSlice(strSymbols, 0, end).join(""); } function trimStart(string, chars, guard) { string = toString(string); if (string && (guard || chars === undefined2)) { return string.replace(reTrimStart, ""); } if (!string || !(chars = baseToString(chars))) { return string; } var strSymbols = stringToArray(string), start = charsStartIndex(strSymbols, stringToArray(chars)); return castSlice(strSymbols, start).join(""); } function truncate(string, options) { var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION; if (isObject(options)) { var separator = "separator" in options ? options.separator : separator; length = "length" in options ? toInteger(options.length) : length; omission = "omission" in options ? baseToString(options.omission) : omission; } string = toString(string); var strLength = string.length; if (hasUnicode(string)) { var strSymbols = stringToArray(string); strLength = strSymbols.length; } if (length >= strLength) { return string; } var end = length - stringSize(omission); if (end < 1) { return omission; } var result2 = strSymbols ? castSlice(strSymbols, 0, end).join("") : string.slice(0, end); if (separator === undefined2) { return result2 + omission; } if (strSymbols) { end += result2.length - end; } if (isRegExp(separator)) { if (string.slice(end).search(separator)) { var match2, substring = result2; if (!separator.global) { separator = RegExp2(separator.source, toString(reFlags.exec(separator)) + "g"); } separator.lastIndex = 0; while (match2 = separator.exec(substring)) { var newEnd = match2.index; } result2 = result2.slice(0, newEnd === undefined2 ? end : newEnd); } } else if (string.indexOf(baseToString(separator), end) != end) { var index = result2.lastIndexOf(separator); if (index > -1) { result2 = result2.slice(0, index); } } return result2 + omission; } function unescape(string) { string = toString(string); return string && reHasEscapedHtml.test(string) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string; } var upperCase = createCompounder(function(result2, word, index) { return result2 + (index ? " " : "") + word.toUpperCase(); }); var upperFirst = createCaseFirst("toUpperCase"); function words(string, pattern, guard) { string = toString(string); pattern = guard ? undefined2 : pattern; if (pattern === undefined2) { return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); } return string.match(pattern) || []; } var attempt = baseRest(function(func, args) { try { return apply(func, undefined2, args); } catch (e) { return isError(e) ? e : new Error2(e); } }); var bindAll = flatRest(function(object, methodNames) { arrayEach(methodNames, function(key2) { key2 = toKey(key2); baseAssignValue(object, key2, bind(object[key2], object)); }); return object; }); function cond(pairs) { var length = pairs == null ? 0 : pairs.length, toIteratee = getIteratee(); pairs = !length ? [] : arrayMap(pairs, function(pair) { if (typeof pair[1] != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } return [toIteratee(pair[0]), pair[1]]; }); return baseRest(function(args) { var index = -1; while (++index < length) { var pair = pairs[index]; if (apply(pair[0], this, args)) { return apply(pair[1], this, args); } } }); } function conforms(source) { return baseConforms(baseClone(source, CLONE_DEEP_FLAG)); } function constant(value) { return function() { return value; }; } function defaultTo(value, defaultValue2) { return value == null || value !== value ? defaultValue2 : value; } var flow = createFlow(); var flowRight = createFlow(true); function identity(value) { return value; } function iteratee(func) { return baseIteratee(typeof func == "function" ? func : baseClone(func, CLONE_DEEP_FLAG)); } function matches(source) { return baseMatches(baseClone(source, CLONE_DEEP_FLAG)); } function matchesProperty(path2, srcValue) { return baseMatchesProperty(path2, baseClone(srcValue, CLONE_DEEP_FLAG)); } var method = baseRest(function(path2, args) { return function(object) { return baseInvoke(object, path2, args); }; }); var methodOf = baseRest(function(object, args) { return function(path2) { return baseInvoke(object, path2, args); }; }); function mixin(object, source, options) { var props = keys(source), methodNames = baseFunctions(source, props); if (options == null && !(isObject(source) && (methodNames.length || !props.length))) { options = source; source = object; object = this; methodNames = baseFunctions(source, keys(source)); } var chain2 = !(isObject(options) && "chain" in options) || !!options.chain, isFunc = isFunction(object); arrayEach(methodNames, function(methodName) { var func = source[methodName]; object[methodName] = func; if (isFunc) { object.prototype[methodName] = function() { var chainAll = this.__chain__; if (chain2 || chainAll) { var result2 = object(this.__wrapped__), actions = result2.__actions__ = copyArray(this.__actions__); actions.push({ "func": func, "args": arguments, "thisArg": object }); result2.__chain__ = chainAll; return result2; } return func.apply(object, arrayPush([this.value()], arguments)); }; } }); return object; } function noConflict() { if (root._ === this) { root._ = oldDash; } return this; } function noop2() { } function nthArg(n2) { n2 = toInteger(n2); return baseRest(function(args) { return baseNth(args, n2); }); } var over = createOver(arrayMap); var overEvery = createOver(arrayEvery); var overSome = createOver(arraySome); function property(path2) { return isKey(path2) ? baseProperty(toKey(path2)) : basePropertyDeep(path2); } function propertyOf(object) { return function(path2) { return object == null ? undefined2 : baseGet(object, path2); }; } var range = createRange(); var rangeRight = createRange(true); function stubArray() { return []; } function stubFalse() { return false; } function stubObject() { return {}; } function stubString() { return ""; } function stubTrue() { return true; } function times(n2, iteratee2) { n2 = toInteger(n2); if (n2 < 1 || n2 > MAX_SAFE_INTEGER) { return []; } var index = MAX_ARRAY_LENGTH, length = nativeMin(n2, MAX_ARRAY_LENGTH); iteratee2 = getIteratee(iteratee2); n2 -= MAX_ARRAY_LENGTH; var result2 = baseTimes(length, iteratee2); while (++index < n2) { iteratee2(index); } return result2; } function toPath(value) { if (isArray(value)) { return arrayMap(value, toKey); } return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value))); } function uniqueId(prefix2) { var id = ++idCounter; return toString(prefix2) + id; } var add2 = createMathOperation(function(augend, addend) { return augend + addend; }, 0); var ceil = createRound("ceil"); var divide = createMathOperation(function(dividend, divisor) { return dividend / divisor; }, 1); var floor = createRound("floor"); function max(array) { return array && array.length ? baseExtremum(array, identity, baseGt) : undefined2; } function maxBy(array, iteratee2) { return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseGt) : undefined2; } function mean(array) { return baseMean(array, identity); } function meanBy(array, iteratee2) { return baseMean(array, getIteratee(iteratee2, 2)); } function min(array) { return array && array.length ? baseExtremum(array, identity, baseLt) : undefined2; } function minBy(array, iteratee2) { return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseLt) : undefined2; } var multiply = createMathOperation(function(multiplier, multiplicand) { return multiplier * multiplicand; }, 1); var round = createRound("round"); var subtract2 = createMathOperation(function(minuend, subtrahend) { return minuend - subtrahend; }, 0); function sum(array) { return array && array.length ? baseSum(array, identity) : 0; } function sumBy(array, iteratee2) { return array && array.length ? baseSum(array, getIteratee(iteratee2, 2)) : 0; } lodash.after = after; lodash.ary = ary; lodash.assign = assign; lodash.assignIn = assignIn; lodash.assignInWith = assignInWith; lodash.assignWith = assignWith; lodash.at = at; lodash.before = before; lodash.bind = bind; lodash.bindAll = bindAll; lodash.bindKey = bindKey; lodash.castArray = castArray; lodash.chain = chain; lodash.chunk = chunk; lodash.compact = compact; lodash.concat = concat; lodash.cond = cond; lodash.conforms = conforms; lodash.constant = constant; lodash.countBy = countBy; lodash.create = create; lodash.curry = curry; lodash.curryRight = curryRight; lodash.debounce = debounce; lodash.defaults = defaults; lodash.defaultsDeep = defaultsDeep; lodash.defer = defer; lodash.delay = delay; lodash.difference = difference; lodash.differenceBy = differenceBy; lodash.differenceWith = differenceWith; lodash.drop = drop; lodash.dropRight = dropRight; lodash.dropRightWhile = dropRightWhile; lodash.dropWhile = dropWhile; lodash.fill = fill; lodash.filter = filter2; lodash.flatMap = flatMap; lodash.flatMapDeep = flatMapDeep; lodash.flatMapDepth = flatMapDepth; lodash.flatten = flatten; lodash.flattenDeep = flattenDeep; lodash.flattenDepth = flattenDepth; lodash.flip = flip; lodash.flow = flow; lodash.flowRight = flowRight; lodash.fromPairs = fromPairs; lodash.functions = functions; lodash.functionsIn = functionsIn; lodash.groupBy = groupBy; lodash.initial = initial; lodash.intersection = intersection; lodash.intersectionBy = intersectionBy; lodash.intersectionWith = intersectionWith; lodash.invert = invert; lodash.invertBy = invertBy; lodash.invokeMap = invokeMap; lodash.iteratee = iteratee; lodash.keyBy = keyBy; lodash.keys = keys; lodash.keysIn = keysIn; lodash.map = map; lodash.mapKeys = mapKeys; lodash.mapValues = mapValues; lodash.matches = matches; lodash.matchesProperty = matchesProperty; lodash.memoize = memoize; lodash.merge = merge; lodash.mergeWith = mergeWith; lodash.method = method; lodash.methodOf = methodOf; lodash.mixin = mixin; lodash.negate = negate; lodash.nthArg = nthArg; lodash.omit = omit; lodash.omitBy = omitBy; lodash.once = once; lodash.orderBy = orderBy; lodash.over = over; lodash.overArgs = overArgs; lodash.overEvery = overEvery; lodash.overSome = overSome; lodash.partial = partial; lodash.partialRight = partialRight; lodash.partition = partition; lodash.pick = pick2; lodash.pickBy = pickBy; lodash.property = property; lodash.propertyOf = propertyOf; lodash.pull = pull; lodash.pullAll = pullAll; lodash.pullAllBy = pullAllBy; lodash.pullAllWith = pullAllWith; lodash.pullAt = pullAt; lodash.range = range; lodash.rangeRight = rangeRight; lodash.rearg = rearg; lodash.reject = reject2; lodash.remove = remove; lodash.rest = rest; lodash.reverse = reverse; lodash.sampleSize = sampleSize; lodash.set = set2; lodash.setWith = setWith; lodash.shuffle = shuffle; lodash.slice = slice; lodash.sortBy = sortBy; lodash.sortedUniq = sortedUniq; lodash.sortedUniqBy = sortedUniqBy; lodash.split = split; lodash.spread = spread; lodash.tail = tail; lodash.take = take; lodash.takeRight = takeRight; lodash.takeRightWhile = takeRightWhile; lodash.takeWhile = takeWhile; lodash.tap = tap; lodash.throttle = throttle; lodash.thru = thru; lodash.toArray = toArray; lodash.toPairs = toPairs; lodash.toPairsIn = toPairsIn; lodash.toPath = toPath; lodash.toPlainObject = toPlainObject; lodash.transform = transform; lodash.unary = unary; lodash.union = union; lodash.unionBy = unionBy; lodash.unionWith = unionWith; lodash.uniq = uniq; lodash.uniqBy = uniqBy; lodash.uniqWith = uniqWith; lodash.unset = unset; lodash.unzip = unzip; lodash.unzipWith = unzipWith; lodash.update = update; lodash.updateWith = updateWith; lodash.values = values; lodash.valuesIn = valuesIn; lodash.without = without; lodash.words = words; lodash.wrap = wrap; lodash.xor = xor; lodash.xorBy = xorBy; lodash.xorWith = xorWith; lodash.zip = zip; lodash.zipObject = zipObject; lodash.zipObjectDeep = zipObjectDeep; lodash.zipWith = zipWith; lodash.entries = toPairs; lodash.entriesIn = toPairsIn; lodash.extend = assignIn; lodash.extendWith = assignInWith; mixin(lodash, lodash); lodash.add = add2; lodash.attempt = attempt; lodash.camelCase = camelCase; lodash.capitalize = capitalize; lodash.ceil = ceil; lodash.clamp = clamp; lodash.clone = clone3; lodash.cloneDeep = cloneDeep; lodash.cloneDeepWith = cloneDeepWith; lodash.cloneWith = cloneWith; lodash.conformsTo = conformsTo; lodash.deburr = deburr; lodash.defaultTo = defaultTo; lodash.divide = divide; lodash.endsWith = endsWith; lodash.eq = eq; lodash.escape = escape; lodash.escapeRegExp = escapeRegExp2; lodash.every = every; lodash.find = find; lodash.findIndex = findIndex; lodash.findKey = findKey; lodash.findLast = findLast; lodash.findLastIndex = findLastIndex; lodash.findLastKey = findLastKey; lodash.floor = floor; lodash.forEach = forEach; lodash.forEachRight = forEachRight; lodash.forIn = forIn; lodash.forInRight = forInRight; lodash.forOwn = forOwn; lodash.forOwnRight = forOwnRight; lodash.get = get; lodash.gt = gt; lodash.gte = gte; lodash.has = has2; lodash.hasIn = hasIn; lodash.head = head; lodash.identity = identity; lodash.includes = includes; lodash.indexOf = indexOf; lodash.inRange = inRange; lodash.invoke = invoke; lodash.isArguments = isArguments; lodash.isArray = isArray; lodash.isArrayBuffer = isArrayBuffer; lodash.isArrayLike = isArrayLike; lodash.isArrayLikeObject = isArrayLikeObject; lodash.isBoolean = isBoolean; lodash.isBuffer = isBuffer; lodash.isDate = isDate2; lodash.isElement = isElement; lodash.isEmpty = isEmpty; lodash.isEqual = isEqual; lodash.isEqualWith = isEqualWith; lodash.isError = isError; lodash.isFinite = isFinite2; lodash.isFunction = isFunction; lodash.isInteger = isInteger2; lodash.isLength = isLength; lodash.isMap = isMap2; lodash.isMatch = isMatch; lodash.isMatchWith = isMatchWith; lodash.isNaN = isNaN2; lodash.isNative = isNative; lodash.isNil = isNil; lodash.isNull = isNull; lodash.isNumber = isNumber2; lodash.isObject = isObject; lodash.isObjectLike = isObjectLike; lodash.isPlainObject = isPlainObject2; lodash.isRegExp = isRegExp; lodash.isSafeInteger = isSafeInteger; lodash.isSet = isSet2; lodash.isString = isString2; lodash.isSymbol = isSymbol; lodash.isTypedArray = isTypedArray; lodash.isUndefined = isUndefined2; lodash.isWeakMap = isWeakMap; lodash.isWeakSet = isWeakSet; lodash.join = join; lodash.kebabCase = kebabCase; lodash.last = last; lodash.lastIndexOf = lastIndexOf; lodash.lowerCase = lowerCase; lodash.lowerFirst = lowerFirst; lodash.lt = lt; lodash.lte = lte; lodash.max = max; lodash.maxBy = maxBy; lodash.mean = mean; lodash.meanBy = meanBy; lodash.min = min; lodash.minBy = minBy; lodash.stubArray = stubArray; lodash.stubFalse = stubFalse; lodash.stubObject = stubObject; lodash.stubString = stubString; lodash.stubTrue = stubTrue; lodash.multiply = multiply; lodash.nth = nth; lodash.noConflict = noConflict; lodash.noop = noop2; lodash.now = now3; lodash.pad = pad; lodash.padEnd = padEnd; lodash.padStart = padStart2; lodash.parseInt = parseInt2; lodash.random = random; lodash.reduce = reduce; lodash.reduceRight = reduceRight; lodash.repeat = repeat; lodash.replace = replace; lodash.result = result; lodash.round = round; lodash.runInContext = runInContext2; lodash.sample = sample; lodash.size = size; lodash.snakeCase = snakeCase; lodash.some = some; lodash.sortedIndex = sortedIndex; lodash.sortedIndexBy = sortedIndexBy; lodash.sortedIndexOf = sortedIndexOf; lodash.sortedLastIndex = sortedLastIndex; lodash.sortedLastIndexBy = sortedLastIndexBy; lodash.sortedLastIndexOf = sortedLastIndexOf; lodash.startCase = startCase; lodash.startsWith = startsWith; lodash.subtract = subtract2; lodash.sum = sum; lodash.sumBy = sumBy; lodash.template = template; lodash.times = times; lodash.toFinite = toFinite; lodash.toInteger = toInteger; lodash.toLength = toLength; lodash.toLower = toLower; lodash.toNumber = toNumber; lodash.toSafeInteger = toSafeInteger; lodash.toString = toString; lodash.toUpper = toUpper; lodash.trim = trim; lodash.trimEnd = trimEnd; lodash.trimStart = trimStart; lodash.truncate = truncate; lodash.unescape = unescape; lodash.uniqueId = uniqueId; lodash.upperCase = upperCase; lodash.upperFirst = upperFirst; lodash.each = forEach; lodash.eachRight = forEachRight; lodash.first = head; mixin(lodash, function() { var source = {}; baseForOwn(lodash, function(func, methodName) { if (!hasOwnProperty2.call(lodash.prototype, methodName)) { source[methodName] = func; } }); return source; }(), { "chain": false }); lodash.VERSION = VERSION; arrayEach(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(methodName) { lodash[methodName].placeholder = lodash; }); arrayEach(["drop", "take"], function(methodName, index) { LazyWrapper.prototype[methodName] = function(n2) { n2 = n2 === undefined2 ? 1 : nativeMax(toInteger(n2), 0); var result2 = this.__filtered__ && !index ? new LazyWrapper(this) : this.clone(); if (result2.__filtered__) { result2.__takeCount__ = nativeMin(n2, result2.__takeCount__); } else { result2.__views__.push({ "size": nativeMin(n2, MAX_ARRAY_LENGTH), "type": methodName + (result2.__dir__ < 0 ? "Right" : "") }); } return result2; }; LazyWrapper.prototype[methodName + "Right"] = function(n2) { return this.reverse()[methodName](n2).reverse(); }; }); arrayEach(["filter", "map", "takeWhile"], function(methodName, index) { var type = index + 1, isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG; LazyWrapper.prototype[methodName] = function(iteratee2) { var result2 = this.clone(); result2.__iteratees__.push({ "iteratee": getIteratee(iteratee2, 3), "type": type }); result2.__filtered__ = result2.__filtered__ || isFilter; return result2; }; }); arrayEach(["head", "last"], function(methodName, index) { var takeName = "take" + (index ? "Right" : ""); LazyWrapper.prototype[methodName] = function() { return this[takeName](1).value()[0]; }; }); arrayEach(["initial", "tail"], function(methodName, index) { var dropName = "drop" + (index ? "" : "Right"); LazyWrapper.prototype[methodName] = function() { return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1); }; }); LazyWrapper.prototype.compact = function() { return this.filter(identity); }; LazyWrapper.prototype.find = function(predicate) { return this.filter(predicate).head(); }; LazyWrapper.prototype.findLast = function(predicate) { return this.reverse().find(predicate); }; LazyWrapper.prototype.invokeMap = baseRest(function(path2, args) { if (typeof path2 == "function") { return new LazyWrapper(this); } return this.map(function(value) { return baseInvoke(value, path2, args); }); }); LazyWrapper.prototype.reject = function(predicate) { return this.filter(negate(getIteratee(predicate))); }; LazyWrapper.prototype.slice = function(start, end) { start = toInteger(start); var result2 = this; if (result2.__filtered__ && (start > 0 || end < 0)) { return new LazyWrapper(result2); } if (start < 0) { result2 = result2.takeRight(-start); } else if (start) { result2 = result2.drop(start); } if (end !== undefined2) { end = toInteger(end); result2 = end < 0 ? result2.dropRight(-end) : result2.take(end - start); } return result2; }; LazyWrapper.prototype.takeRightWhile = function(predicate) { return this.reverse().takeWhile(predicate).reverse(); }; LazyWrapper.prototype.toArray = function() { return this.take(MAX_ARRAY_LENGTH); }; baseForOwn(LazyWrapper.prototype, function(func, methodName) { var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), isTaker = /^(?:head|last)$/.test(methodName), lodashFunc = lodash[isTaker ? "take" + (methodName == "last" ? "Right" : "") : methodName], retUnwrapped = isTaker || /^find/.test(methodName); if (!lodashFunc) { return; } lodash.prototype[methodName] = function() { var value = this.__wrapped__, args = isTaker ? [1] : arguments, isLazy = value instanceof LazyWrapper, iteratee2 = args[0], useLazy = isLazy || isArray(value); var interceptor = function(value2) { var result3 = lodashFunc.apply(lodash, arrayPush([value2], args)); return isTaker && chainAll ? result3[0] : result3; }; if (useLazy && checkIteratee && typeof iteratee2 == "function" && iteratee2.length != 1) { isLazy = useLazy = false; } var chainAll = this.__chain__, isHybrid = !!this.__actions__.length, isUnwrapped = retUnwrapped && !chainAll, onlyLazy = isLazy && !isHybrid; if (!retUnwrapped && useLazy) { value = onlyLazy ? value : new LazyWrapper(this); var result2 = func.apply(value, args); result2.__actions__.push({ "func": thru, "args": [interceptor], "thisArg": undefined2 }); return new LodashWrapper(result2, chainAll); } if (isUnwrapped && onlyLazy) { return func.apply(this, args); } result2 = this.thru(interceptor); return isUnwrapped ? isTaker ? result2.value()[0] : result2.value() : result2; }; }); arrayEach(["pop", "push", "shift", "sort", "splice", "unshift"], function(methodName) { var func = arrayProto[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? "tap" : "thru", retUnwrapped = /^(?:pop|shift)$/.test(methodName); lodash.prototype[methodName] = function() { var args = arguments; if (retUnwrapped && !this.__chain__) { var value = this.value(); return func.apply(isArray(value) ? value : [], args); } return this[chainName](function(value2) { return func.apply(isArray(value2) ? value2 : [], args); }); }; }); baseForOwn(LazyWrapper.prototype, function(func, methodName) { var lodashFunc = lodash[methodName]; if (lodashFunc) { var key2 = lodashFunc.name + ""; if (!hasOwnProperty2.call(realNames, key2)) { realNames[key2] = []; } realNames[key2].push({ "name": methodName, "func": lodashFunc }); } }); realNames[createHybrid(undefined2, WRAP_BIND_KEY_FLAG).name] = [{ "name": "wrapper", "func": undefined2 }]; LazyWrapper.prototype.clone = lazyClone; LazyWrapper.prototype.reverse = lazyReverse; LazyWrapper.prototype.value = lazyValue; lodash.prototype.at = wrapperAt; lodash.prototype.chain = wrapperChain; lodash.prototype.commit = wrapperCommit; lodash.prototype.next = wrapperNext; lodash.prototype.plant = wrapperPlant; lodash.prototype.reverse = wrapperReverse; lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; lodash.prototype.first = lodash.prototype.head; if (symIterator) { lodash.prototype[symIterator] = wrapperToIterator; } return lodash; }; var _18 = runInContext(); if (typeof define == "function" && typeof define.amd == "object" && define.amd) { root._ = _18; define(function() { return _18; }); } else if (freeModule) { (freeModule.exports = _18)._ = _18; freeExports._ = _18; } else { root._ = _18; } }).call(exports); } }); // node_modules/react/cjs/react.development.js var require_react_development = __commonJS({ "node_modules/react/cjs/react.development.js"(exports, module2) { "use strict"; if (true) { (function() { "use strict"; if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") { __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); } var ReactVersion = "18.2.0"; var REACT_ELEMENT_TYPE = Symbol.for("react.element"); var REACT_PORTAL_TYPE = Symbol.for("react.portal"); var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"); var REACT_PROFILER_TYPE = Symbol.for("react.profiler"); var REACT_PROVIDER_TYPE = Symbol.for("react.provider"); var REACT_CONTEXT_TYPE = Symbol.for("react.context"); var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"); var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"); var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"); var REACT_MEMO_TYPE = Symbol.for("react.memo"); var REACT_LAZY_TYPE = Symbol.for("react.lazy"); var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; var FAUX_ITERATOR_SYMBOL = "@@iterator"; function getIteratorFn(maybeIterable) { if (maybeIterable === null || typeof maybeIterable !== "object") { return null; } var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; if (typeof maybeIterator === "function") { return maybeIterator; } return null; } var ReactCurrentDispatcher = { /** * @internal * @type {ReactComponent} */ current: null }; var ReactCurrentBatchConfig = { transition: null }; var ReactCurrentActQueue = { current: null, // Used to reproduce behavior of `batchedUpdates` in legacy mode. isBatchingLegacy: false, didScheduleLegacyUpdate: false }; var ReactCurrentOwner = { /** * @internal * @type {ReactComponent} */ current: null }; var ReactDebugCurrentFrame = {}; var currentExtraStackFrame = null; function setExtraStackFrame(stack) { { currentExtraStackFrame = stack; } } { ReactDebugCurrentFrame.setExtraStackFrame = function(stack) { { currentExtraStackFrame = stack; } }; ReactDebugCurrentFrame.getCurrentStack = null; ReactDebugCurrentFrame.getStackAddendum = function() { var stack = ""; if (currentExtraStackFrame) { stack += currentExtraStackFrame; } var impl = ReactDebugCurrentFrame.getCurrentStack; if (impl) { stack += impl() || ""; } return stack; }; } var enableScopeAPI = false; var enableCacheElement = false; var enableTransitionTracing = false; var enableLegacyHidden = false; var enableDebugTracing = false; var ReactSharedInternals = { ReactCurrentDispatcher, ReactCurrentBatchConfig, ReactCurrentOwner }; { ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame; ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue; } function warn(format) { { { for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } printWarning("warn", format, args); } } } function error(format) { { { for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { args[_key2 - 1] = arguments[_key2]; } printWarning("error", format, args); } } } function printWarning(level, format, args) { { var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame; var stack = ReactDebugCurrentFrame2.getStackAddendum(); if (stack !== "") { format += "%s"; args = args.concat([stack]); } var argsWithFormat = args.map(function(item) { return String(item); }); argsWithFormat.unshift("Warning: " + format); Function.prototype.apply.call(console[level], console, argsWithFormat); } } var didWarnStateUpdateForUnmountedComponent = {}; function warnNoop(publicInstance, callerName) { { var _constructor = publicInstance.constructor; var componentName = _constructor && (_constructor.displayName || _constructor.name) || "ReactClass"; var warningKey = componentName + "." + callerName; if (didWarnStateUpdateForUnmountedComponent[warningKey]) { return; } error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", callerName, componentName); didWarnStateUpdateForUnmountedComponent[warningKey] = true; } } var ReactNoopUpdateQueue = { /** * Checks whether or not this composite component is mounted. * @param {ReactClass} publicInstance The instance we want to test. * @return {boolean} True if mounted, false otherwise. * @protected * @final */ isMounted: function(publicInstance) { return false; }, /** * Forces an update. This should only be invoked when it is known with * certainty that we are **not** in a DOM transaction. * * You may want to call this when you know that some deeper aspect of the * component's state has changed but `setState` was not called. * * This will not invoke `shouldComponentUpdate`, but it will invoke * `componentWillUpdate` and `componentDidUpdate`. * * @param {ReactClass} publicInstance The instance that should rerender. * @param {?function} callback Called after component is updated. * @param {?string} callerName name of the calling function in the public API. * @internal */ enqueueForceUpdate: function(publicInstance, callback, callerName) { warnNoop(publicInstance, "forceUpdate"); }, /** * Replaces all of the state. Always use this or `setState` to mutate state. * You should treat `this.state` as immutable. * * There is no guarantee that `this.state` will be immediately updated, so * accessing `this.state` after calling this method may return the old value. * * @param {ReactClass} publicInstance The instance that should rerender. * @param {object} completeState Next state. * @param {?function} callback Called after component is updated. * @param {?string} callerName name of the calling function in the public API. * @internal */ enqueueReplaceState: function(publicInstance, completeState, callback, callerName) { warnNoop(publicInstance, "replaceState"); }, /** * Sets a subset of the state. This only exists because _pendingState is * internal. This provides a merging strategy that is not available to deep * properties which is confusing. TODO: Expose pendingState or don't use it * during the merge. * * @param {ReactClass} publicInstance The instance that should rerender. * @param {object} partialState Next partial state to be merged with state. * @param {?function} callback Called after component is updated. * @param {?string} Name of the calling function in the public API. * @internal */ enqueueSetState: function(publicInstance, partialState, callback, callerName) { warnNoop(publicInstance, "setState"); } }; var assign = Object.assign; var emptyObject = {}; { Object.freeze(emptyObject); } function Component3(props, context, updater) { this.props = props; this.context = context; this.refs = emptyObject; this.updater = updater || ReactNoopUpdateQueue; } Component3.prototype.isReactComponent = {}; Component3.prototype.setState = function(partialState, callback) { if (typeof partialState !== "object" && typeof partialState !== "function" && partialState != null) { throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables."); } this.updater.enqueueSetState(this, partialState, callback, "setState"); }; Component3.prototype.forceUpdate = function(callback) { this.updater.enqueueForceUpdate(this, callback, "forceUpdate"); }; { var deprecatedAPIs = { isMounted: ["isMounted", "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."], replaceState: ["replaceState", "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."] }; var defineDeprecationWarning = function(methodName, info) { Object.defineProperty(Component3.prototype, methodName, { get: function() { warn("%s(...) is deprecated in plain JavaScript React classes. %s", info[0], info[1]); return void 0; } }); }; for (var fnName in deprecatedAPIs) { if (deprecatedAPIs.hasOwnProperty(fnName)) { defineDeprecationWarning(fnName, deprecatedAPIs[fnName]); } } } function ComponentDummy() { } ComponentDummy.prototype = Component3.prototype; function PureComponent(props, context, updater) { this.props = props; this.context = context; this.refs = emptyObject; this.updater = updater || ReactNoopUpdateQueue; } var pureComponentPrototype = PureComponent.prototype = new ComponentDummy(); pureComponentPrototype.constructor = PureComponent; assign(pureComponentPrototype, Component3.prototype); pureComponentPrototype.isPureReactComponent = true; function createRef() { var refObject = { current: null }; { Object.seal(refObject); } return refObject; } var isArrayImpl = Array.isArray; function isArray(a) { return isArrayImpl(a); } function typeName(value) { { var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag; var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object"; return type; } } function willCoercionThrow(value) { { try { testStringCoercion(value); return false; } catch (e) { return true; } } } function testStringCoercion(value) { return "" + value; } function checkKeyStringCoercion(value) { { if (willCoercionThrow(value)) { error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value)); return testStringCoercion(value); } } } function getWrappedName(outerType, innerType, wrapperName) { var displayName = outerType.displayName; if (displayName) { return displayName; } var functionName = innerType.displayName || innerType.name || ""; return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName; } function getContextName(type) { return type.displayName || "Context"; } function getComponentNameFromType(type) { if (type == null) { return null; } { if (typeof type.tag === "number") { error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."); } } if (typeof type === "function") { return type.displayName || type.name || null; } if (typeof type === "string") { return type; } switch (type) { case REACT_FRAGMENT_TYPE: return "Fragment"; case REACT_PORTAL_TYPE: return "Portal"; case REACT_PROFILER_TYPE: return "Profiler"; case REACT_STRICT_MODE_TYPE: return "StrictMode"; case REACT_SUSPENSE_TYPE: return "Suspense"; case REACT_SUSPENSE_LIST_TYPE: return "SuspenseList"; } if (typeof type === "object") { switch (type.$$typeof) { case REACT_CONTEXT_TYPE: var context = type; return getContextName(context) + ".Consumer"; case REACT_PROVIDER_TYPE: var provider = type; return getContextName(provider._context) + ".Provider"; case REACT_FORWARD_REF_TYPE: return getWrappedName(type, type.render, "ForwardRef"); case REACT_MEMO_TYPE: var outerName = type.displayName || null; if (outerName !== null) { return outerName; } return getComponentNameFromType(type.type) || "Memo"; case REACT_LAZY_TYPE: { var lazyComponent = type; var payload = lazyComponent._payload; var init = lazyComponent._init; try { return getComponentNameFromType(init(payload)); } catch (x) { return null; } } } } return null; } var hasOwnProperty2 = Object.prototype.hasOwnProperty; var RESERVED_PROPS = { key: true, ref: true, __self: true, __source: true }; var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs; { didWarnAboutStringRefs = {}; } function hasValidRef(config) { { if (hasOwnProperty2.call(config, "ref")) { var getter = Object.getOwnPropertyDescriptor(config, "ref").get; if (getter && getter.isReactWarning) { return false; } } } return config.ref !== void 0; } function hasValidKey(config) { { if (hasOwnProperty2.call(config, "key")) { var getter = Object.getOwnPropertyDescriptor(config, "key").get; if (getter && getter.isReactWarning) { return false; } } } return config.key !== void 0; } function defineKeyPropWarningGetter(props, displayName) { var warnAboutAccessingKey = function() { { if (!specialPropKeyWarningShown) { specialPropKeyWarningShown = true; error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName); } } }; warnAboutAccessingKey.isReactWarning = true; Object.defineProperty(props, "key", { get: warnAboutAccessingKey, configurable: true }); } function defineRefPropWarningGetter(props, displayName) { var warnAboutAccessingRef = function() { { if (!specialPropRefWarningShown) { specialPropRefWarningShown = true; error("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName); } } }; warnAboutAccessingRef.isReactWarning = true; Object.defineProperty(props, "ref", { get: warnAboutAccessingRef, configurable: true }); } function warnIfStringRefCannotBeAutoConverted(config) { { if (typeof config.ref === "string" && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) { var componentName = getComponentNameFromType(ReactCurrentOwner.current.type); if (!didWarnAboutStringRefs[componentName]) { error('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref); didWarnAboutStringRefs[componentName] = true; } } } } var ReactElement = function(type, key2, ref, self2, source, owner, props) { var element = { // This tag allows us to uniquely identify this as a React Element $$typeof: REACT_ELEMENT_TYPE, // Built-in properties that belong on the element type, key: key2, ref, props, // Record the component responsible for creating this element. _owner: owner }; { element._store = {}; Object.defineProperty(element._store, "validated", { configurable: false, enumerable: false, writable: true, value: false }); Object.defineProperty(element, "_self", { configurable: false, enumerable: false, writable: false, value: self2 }); Object.defineProperty(element, "_source", { configurable: false, enumerable: false, writable: false, value: source }); if (Object.freeze) { Object.freeze(element.props); Object.freeze(element); } } return element; }; function createElement(type, config, children) { var propName; var props = {}; var key2 = null; var ref = null; var self2 = null; var source = null; if (config != null) { if (hasValidRef(config)) { ref = config.ref; { warnIfStringRefCannotBeAutoConverted(config); } } if (hasValidKey(config)) { { checkKeyStringCoercion(config.key); } key2 = "" + config.key; } self2 = config.__self === void 0 ? null : config.__self; source = config.__source === void 0 ? null : config.__source; for (propName in config) { if (hasOwnProperty2.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { props[propName] = config[propName]; } } } var childrenLength = arguments.length - 2; if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 2]; } { if (Object.freeze) { Object.freeze(childArray); } } props.children = childArray; } if (type && type.defaultProps) { var defaultProps = type.defaultProps; for (propName in defaultProps) { if (props[propName] === void 0) { props[propName] = defaultProps[propName]; } } } { if (key2 || ref) { var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type; if (key2) { defineKeyPropWarningGetter(props, displayName); } if (ref) { defineRefPropWarningGetter(props, displayName); } } } return ReactElement(type, key2, ref, self2, source, ReactCurrentOwner.current, props); } function cloneAndReplaceKey(oldElement, newKey) { var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props); return newElement; } function cloneElement3(element, config, children) { if (element === null || element === void 0) { throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + "."); } var propName; var props = assign({}, element.props); var key2 = element.key; var ref = element.ref; var self2 = element._self; var source = element._source; var owner = element._owner; if (config != null) { if (hasValidRef(config)) { ref = config.ref; owner = ReactCurrentOwner.current; } if (hasValidKey(config)) { { checkKeyStringCoercion(config.key); } key2 = "" + config.key; } var defaultProps; if (element.type && element.type.defaultProps) { defaultProps = element.type.defaultProps; } for (propName in config) { if (hasOwnProperty2.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { if (config[propName] === void 0 && defaultProps !== void 0) { props[propName] = defaultProps[propName]; } else { props[propName] = config[propName]; } } } } var childrenLength = arguments.length - 2; if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 2]; } props.children = childArray; } return ReactElement(element.type, key2, ref, self2, source, owner, props); } function isValidElement(object) { return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; } var SEPARATOR = "."; var SUBSEPARATOR = ":"; function escape(key2) { var escapeRegex = /[=:]/g; var escaperLookup = { "=": "=0", ":": "=2" }; var escapedString = key2.replace(escapeRegex, function(match2) { return escaperLookup[match2]; }); return "$" + escapedString; } var didWarnAboutMaps = false; var userProvidedKeyEscapeRegex = /\/+/g; function escapeUserProvidedKey(text) { return text.replace(userProvidedKeyEscapeRegex, "$&/"); } function getElementKey(element, index) { if (typeof element === "object" && element !== null && element.key != null) { { checkKeyStringCoercion(element.key); } return escape("" + element.key); } return index.toString(36); } function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) { var type = typeof children; if (type === "undefined" || type === "boolean") { children = null; } var invokeCallback = false; if (children === null) { invokeCallback = true; } else { switch (type) { case "string": case "number": invokeCallback = true; break; case "object": switch (children.$$typeof) { case REACT_ELEMENT_TYPE: case REACT_PORTAL_TYPE: invokeCallback = true; } } } if (invokeCallback) { var _child = children; var mappedChild = callback(_child); var childKey = nameSoFar === "" ? SEPARATOR + getElementKey(_child, 0) : nameSoFar; if (isArray(mappedChild)) { var escapedChildKey = ""; if (childKey != null) { escapedChildKey = escapeUserProvidedKey(childKey) + "/"; } mapIntoArray(mappedChild, array, escapedChildKey, "", function(c) { return c; }); } else if (mappedChild != null) { if (isValidElement(mappedChild)) { { if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) { checkKeyStringCoercion(mappedChild.key); } } mappedChild = cloneAndReplaceKey( mappedChild, // Keep both the (mapped) and old keys if they differ, just as // traverseAllChildren used to do for objects as children escapedPrefix + // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key (mappedChild.key && (!_child || _child.key !== mappedChild.key) ? ( // $FlowFixMe Flow incorrectly thinks existing element's key can be a number // eslint-disable-next-line react-internal/safe-string-coercion escapeUserProvidedKey("" + mappedChild.key) + "/" ) : "") + childKey ); } array.push(mappedChild); } return 1; } var child; var nextName; var subtreeCount = 0; var nextNamePrefix = nameSoFar === "" ? SEPARATOR : nameSoFar + SUBSEPARATOR; if (isArray(children)) { for (var i = 0; i < children.length; i++) { child = children[i]; nextName = nextNamePrefix + getElementKey(child, i); subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback); } } else { var iteratorFn = getIteratorFn(children); if (typeof iteratorFn === "function") { var iterableChildren = children; { if (iteratorFn === iterableChildren.entries) { if (!didWarnAboutMaps) { warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."); } didWarnAboutMaps = true; } } var iterator = iteratorFn.call(iterableChildren); var step; var ii = 0; while (!(step = iterator.next()).done) { child = step.value; nextName = nextNamePrefix + getElementKey(child, ii++); subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback); } } else if (type === "object") { var childrenString = String(children); throw new Error("Objects are not valid as a React child (found: " + (childrenString === "[object Object]" ? "object with keys {" + Object.keys(children).join(", ") + "}" : childrenString) + "). If you meant to render a collection of children, use an array instead."); } } return subtreeCount; } function mapChildren(children, func, context) { if (children == null) { return children; } var result = []; var count = 0; mapIntoArray(children, result, "", "", function(child) { return func.call(context, child, count++); }); return result; } function countChildren(children) { var n2 = 0; mapChildren(children, function() { n2++; }); return n2; } function forEachChildren(children, forEachFunc, forEachContext) { mapChildren(children, function() { forEachFunc.apply(this, arguments); }, forEachContext); } function toArray(children) { return mapChildren(children, function(child) { return child; }) || []; } function onlyChild(children) { if (!isValidElement(children)) { throw new Error("React.Children.only expected to receive a single React element child."); } return children; } function createContext2(defaultValue2) { var context = { $$typeof: REACT_CONTEXT_TYPE, // As a workaround to support multiple concurrent renderers, we categorize // some renderers as primary and others as secondary. We only expect // there to be two concurrent renderers at most: React Native (primary) and // Fabric (secondary); React DOM (primary) and React ART (secondary). // Secondary renderers store their context values on separate fields. _currentValue: defaultValue2, _currentValue2: defaultValue2, // Used to track how many concurrent renderers this context currently // supports within in a single renderer. Such as parallel server rendering. _threadCount: 0, // These are circular Provider: null, Consumer: null, // Add these to use same hidden class in VM as ServerContext _defaultValue: null, _globalName: null }; context.Provider = { $$typeof: REACT_PROVIDER_TYPE, _context: context }; var hasWarnedAboutUsingNestedContextConsumers = false; var hasWarnedAboutUsingConsumerProvider = false; var hasWarnedAboutDisplayNameOnConsumer = false; { var Consumer = { $$typeof: REACT_CONTEXT_TYPE, _context: context }; Object.defineProperties(Consumer, { Provider: { get: function() { if (!hasWarnedAboutUsingConsumerProvider) { hasWarnedAboutUsingConsumerProvider = true; error("Rendering is not supported and will be removed in a future major release. Did you mean to render instead?"); } return context.Provider; }, set: function(_Provider) { context.Provider = _Provider; } }, _currentValue: { get: function() { return context._currentValue; }, set: function(_currentValue) { context._currentValue = _currentValue; } }, _currentValue2: { get: function() { return context._currentValue2; }, set: function(_currentValue2) { context._currentValue2 = _currentValue2; } }, _threadCount: { get: function() { return context._threadCount; }, set: function(_threadCount) { context._threadCount = _threadCount; } }, Consumer: { get: function() { if (!hasWarnedAboutUsingNestedContextConsumers) { hasWarnedAboutUsingNestedContextConsumers = true; error("Rendering is not supported and will be removed in a future major release. Did you mean to render instead?"); } return context.Consumer; } }, displayName: { get: function() { return context.displayName; }, set: function(displayName) { if (!hasWarnedAboutDisplayNameOnConsumer) { warn("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.", displayName); hasWarnedAboutDisplayNameOnConsumer = true; } } } }); context.Consumer = Consumer; } { context._currentRenderer = null; context._currentRenderer2 = null; } return context; } var Uninitialized = -1; var Pending = 0; var Resolved = 1; var Rejected = 2; function lazyInitializer(payload) { if (payload._status === Uninitialized) { var ctor = payload._result; var thenable = ctor(); thenable.then(function(moduleObject2) { if (payload._status === Pending || payload._status === Uninitialized) { var resolved = payload; resolved._status = Resolved; resolved._result = moduleObject2; } }, function(error2) { if (payload._status === Pending || payload._status === Uninitialized) { var rejected = payload; rejected._status = Rejected; rejected._result = error2; } }); if (payload._status === Uninitialized) { var pending = payload; pending._status = Pending; pending._result = thenable; } } if (payload._status === Resolved) { var moduleObject = payload._result; { if (moduleObject === void 0) { error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?", moduleObject); } } { if (!("default" in moduleObject)) { error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))", moduleObject); } } return moduleObject.default; } else { throw payload._result; } } function lazy(ctor) { var payload = { // We use these fields to store the result. _status: Uninitialized, _result: ctor }; var lazyType = { $$typeof: REACT_LAZY_TYPE, _payload: payload, _init: lazyInitializer }; { var defaultProps; var propTypes; Object.defineProperties(lazyType, { defaultProps: { configurable: true, get: function() { return defaultProps; }, set: function(newDefaultProps) { error("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."); defaultProps = newDefaultProps; Object.defineProperty(lazyType, "defaultProps", { enumerable: true }); } }, propTypes: { configurable: true, get: function() { return propTypes; }, set: function(newPropTypes) { error("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."); propTypes = newPropTypes; Object.defineProperty(lazyType, "propTypes", { enumerable: true }); } } }); } return lazyType; } function forwardRef3(render) { { if (render != null && render.$$typeof === REACT_MEMO_TYPE) { error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."); } else if (typeof render !== "function") { error("forwardRef requires a render function but was given %s.", render === null ? "null" : typeof render); } else { if (render.length !== 0 && render.length !== 2) { error("forwardRef render functions accept exactly two parameters: props and ref. %s", render.length === 1 ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."); } } if (render != null) { if (render.defaultProps != null || render.propTypes != null) { error("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"); } } } var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render }; { var ownName; Object.defineProperty(elementType, "displayName", { enumerable: false, configurable: true, get: function() { return ownName; }, set: function(name) { ownName = name; if (!render.name && !render.displayName) { render.displayName = name; } } }); } return elementType; } var REACT_MODULE_REFERENCE; { REACT_MODULE_REFERENCE = Symbol.for("react.module.reference"); } function isValidElementType(type) { if (typeof type === "string" || typeof type === "function") { return true; } if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) { return true; } if (typeof type === "object" && type !== null) { if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object // types supported by any Flight configuration anywhere since // we don't know which Flight build this will end up being used // with. type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) { return true; } } return false; } function memo3(type, compare) { { if (!isValidElementType(type)) { error("memo: The first argument must be a component. Instead received: %s", type === null ? "null" : typeof type); } } var elementType = { $$typeof: REACT_MEMO_TYPE, type, compare: compare === void 0 ? null : compare }; { var ownName; Object.defineProperty(elementType, "displayName", { enumerable: false, configurable: true, get: function() { return ownName; }, set: function(name) { ownName = name; if (!type.name && !type.displayName) { type.displayName = name; } } }); } return elementType; } function resolveDispatcher() { var dispatcher = ReactCurrentDispatcher.current; { if (dispatcher === null) { error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem."); } } return dispatcher; } function useContext2(Context) { var dispatcher = resolveDispatcher(); { if (Context._context !== void 0) { var realContext = Context._context; if (realContext.Consumer === Context) { error("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"); } else if (realContext.Provider === Context) { error("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?"); } } } return dispatcher.useContext(Context); } function useState9(initialState) { var dispatcher = resolveDispatcher(); return dispatcher.useState(initialState); } function useReducer2(reducer2, initialArg, init) { var dispatcher = resolveDispatcher(); return dispatcher.useReducer(reducer2, initialArg, init); } function useRef12(initialValue) { var dispatcher = resolveDispatcher(); return dispatcher.useRef(initialValue); } function useEffect13(create, deps) { var dispatcher = resolveDispatcher(); return dispatcher.useEffect(create, deps); } function useInsertionEffect(create, deps) { var dispatcher = resolveDispatcher(); return dispatcher.useInsertionEffect(create, deps); } function useLayoutEffect3(create, deps) { var dispatcher = resolveDispatcher(); return dispatcher.useLayoutEffect(create, deps); } function useCallback4(callback, deps) { var dispatcher = resolveDispatcher(); return dispatcher.useCallback(callback, deps); } function useMemo4(create, deps) { var dispatcher = resolveDispatcher(); return dispatcher.useMemo(create, deps); } function useImperativeHandle(ref, create, deps) { var dispatcher = resolveDispatcher(); return dispatcher.useImperativeHandle(ref, create, deps); } function useDebugValue2(value, formatterFn) { { var dispatcher = resolveDispatcher(); return dispatcher.useDebugValue(value, formatterFn); } } function useTransition() { var dispatcher = resolveDispatcher(); return dispatcher.useTransition(); } function useDeferredValue(value) { var dispatcher = resolveDispatcher(); return dispatcher.useDeferredValue(value); } function useId() { var dispatcher = resolveDispatcher(); return dispatcher.useId(); } function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { var dispatcher = resolveDispatcher(); return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot); } var disabledDepth = 0; var prevLog; var prevInfo; var prevWarn; var prevError; var prevGroup; var prevGroupCollapsed; var prevGroupEnd; function disabledLog() { } disabledLog.__reactDisabledLog = true; function disableLogs() { { if (disabledDepth === 0) { prevLog = console.log; prevInfo = console.info; prevWarn = console.warn; prevError = console.error; prevGroup = console.group; prevGroupCollapsed = console.groupCollapsed; prevGroupEnd = console.groupEnd; var props = { configurable: true, enumerable: true, value: disabledLog, writable: true }; Object.defineProperties(console, { info: props, log: props, warn: props, error: props, group: props, groupCollapsed: props, groupEnd: props }); } disabledDepth++; } } function reenableLogs() { { disabledDepth--; if (disabledDepth === 0) { var props = { configurable: true, enumerable: true, writable: true }; Object.defineProperties(console, { log: assign({}, props, { value: prevLog }), info: assign({}, props, { value: prevInfo }), warn: assign({}, props, { value: prevWarn }), error: assign({}, props, { value: prevError }), group: assign({}, props, { value: prevGroup }), groupCollapsed: assign({}, props, { value: prevGroupCollapsed }), groupEnd: assign({}, props, { value: prevGroupEnd }) }); } if (disabledDepth < 0) { error("disabledDepth fell below zero. This is a bug in React. Please file an issue."); } } } var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher; var prefix2; function describeBuiltInComponentFrame(name, source, ownerFn) { { if (prefix2 === void 0) { try { throw Error(); } catch (x) { var match2 = x.stack.trim().match(/\n( *(at )?)/); prefix2 = match2 && match2[1] || ""; } } return "\n" + prefix2 + name; } } var reentry = false; var componentFrameCache; { var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map; componentFrameCache = new PossiblyWeakMap(); } function describeNativeComponentFrame(fn, construct) { if (!fn || reentry) { return ""; } { var frame = componentFrameCache.get(fn); if (frame !== void 0) { return frame; } } var control; reentry = true; var previousPrepareStackTrace = Error.prepareStackTrace; Error.prepareStackTrace = void 0; var previousDispatcher; { previousDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = null; disableLogs(); } try { if (construct) { var Fake = function() { throw Error(); }; Object.defineProperty(Fake.prototype, "props", { set: function() { throw Error(); } }); if (typeof Reflect === "object" && Reflect.construct) { try { Reflect.construct(Fake, []); } catch (x) { control = x; } Reflect.construct(fn, [], Fake); } else { try { Fake.call(); } catch (x) { control = x; } fn.call(Fake.prototype); } } else { try { throw Error(); } catch (x) { control = x; } fn(); } } catch (sample) { if (sample && control && typeof sample.stack === "string") { var sampleLines = sample.stack.split("\n"); var controlLines = control.stack.split("\n"); var s2 = sampleLines.length - 1; var c = controlLines.length - 1; while (s2 >= 1 && c >= 0 && sampleLines[s2] !== controlLines[c]) { c--; } for (; s2 >= 1 && c >= 0; s2--, c--) { if (sampleLines[s2] !== controlLines[c]) { if (s2 !== 1 || c !== 1) { do { s2--; c--; if (c < 0 || sampleLines[s2] !== controlLines[c]) { var _frame = "\n" + sampleLines[s2].replace(" at new ", " at "); if (fn.displayName && _frame.includes("")) { _frame = _frame.replace("", fn.displayName); } { if (typeof fn === "function") { componentFrameCache.set(fn, _frame); } } return _frame; } } while (s2 >= 1 && c >= 0); } break; } } } } finally { reentry = false; { ReactCurrentDispatcher$1.current = previousDispatcher; reenableLogs(); } Error.prepareStackTrace = previousPrepareStackTrace; } var name = fn ? fn.displayName || fn.name : ""; var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ""; { if (typeof fn === "function") { componentFrameCache.set(fn, syntheticFrame); } } return syntheticFrame; } function describeFunctionComponentFrame(fn, source, ownerFn) { { return describeNativeComponentFrame(fn, false); } } function shouldConstruct(Component4) { var prototype = Component4.prototype; return !!(prototype && prototype.isReactComponent); } function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { if (type == null) { return ""; } if (typeof type === "function") { { return describeNativeComponentFrame(type, shouldConstruct(type)); } } if (typeof type === "string") { return describeBuiltInComponentFrame(type); } switch (type) { case REACT_SUSPENSE_TYPE: return describeBuiltInComponentFrame("Suspense"); case REACT_SUSPENSE_LIST_TYPE: return describeBuiltInComponentFrame("SuspenseList"); } if (typeof type === "object") { switch (type.$$typeof) { case REACT_FORWARD_REF_TYPE: return describeFunctionComponentFrame(type.render); case REACT_MEMO_TYPE: return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); case REACT_LAZY_TYPE: { var lazyComponent = type; var payload = lazyComponent._payload; var init = lazyComponent._init; try { return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); } catch (x) { } } } } return ""; } var loggedTypeFailures = {}; var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; function setCurrentlyValidatingElement(element) { { if (element) { var owner = element._owner; var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); ReactDebugCurrentFrame$1.setExtraStackFrame(stack); } else { ReactDebugCurrentFrame$1.setExtraStackFrame(null); } } } function checkPropTypes(typeSpecs, values, location, componentName, element) { { var has2 = Function.call.bind(hasOwnProperty2); for (var typeSpecName in typeSpecs) { if (has2(typeSpecs, typeSpecName)) { var error$1 = void 0; try { if (typeof typeSpecs[typeSpecName] !== "function") { var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); err.name = "Invariant Violation"; throw err; } error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); } catch (ex) { error$1 = ex; } if (error$1 && !(error$1 instanceof Error)) { setCurrentlyValidatingElement(element); error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1); setCurrentlyValidatingElement(null); } if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { loggedTypeFailures[error$1.message] = true; setCurrentlyValidatingElement(element); error("Failed %s type: %s", location, error$1.message); setCurrentlyValidatingElement(null); } } } } } function setCurrentlyValidatingElement$1(element) { { if (element) { var owner = element._owner; var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); setExtraStackFrame(stack); } else { setExtraStackFrame(null); } } } var propTypesMisspellWarningShown; { propTypesMisspellWarningShown = false; } function getDeclarationErrorAddendum() { if (ReactCurrentOwner.current) { var name = getComponentNameFromType(ReactCurrentOwner.current.type); if (name) { return "\n\nCheck the render method of `" + name + "`."; } } return ""; } function getSourceInfoErrorAddendum(source) { if (source !== void 0) { var fileName = source.fileName.replace(/^.*[\\\/]/, ""); var lineNumber = source.lineNumber; return "\n\nCheck your code at " + fileName + ":" + lineNumber + "."; } return ""; } function getSourceInfoErrorAddendumForProps(elementProps) { if (elementProps !== null && elementProps !== void 0) { return getSourceInfoErrorAddendum(elementProps.__source); } return ""; } var ownerHasKeyUseWarning = {}; function getCurrentComponentErrorInfo(parentType) { var info = getDeclarationErrorAddendum(); if (!info) { var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name; if (parentName) { info = "\n\nCheck the top-level render call using <" + parentName + ">."; } } return info; } function validateExplicitKey(element, parentType) { if (!element._store || element._store.validated || element.key != null) { return; } element._store.validated = true; var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { return; } ownerHasKeyUseWarning[currentComponentErrorInfo] = true; var childOwner = ""; if (element && element._owner && element._owner !== ReactCurrentOwner.current) { childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + "."; } { setCurrentlyValidatingElement$1(element); error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner); setCurrentlyValidatingElement$1(null); } } function validateChildKeys(node, parentType) { if (typeof node !== "object") { return; } if (isArray(node)) { for (var i = 0; i < node.length; i++) { var child = node[i]; if (isValidElement(child)) { validateExplicitKey(child, parentType); } } } else if (isValidElement(node)) { if (node._store) { node._store.validated = true; } } else if (node) { var iteratorFn = getIteratorFn(node); if (typeof iteratorFn === "function") { if (iteratorFn !== node.entries) { var iterator = iteratorFn.call(node); var step; while (!(step = iterator.next()).done) { if (isValidElement(step.value)) { validateExplicitKey(step.value, parentType); } } } } } } function validatePropTypes(element) { { var type = element.type; if (type === null || type === void 0 || typeof type === "string") { return; } var propTypes; if (typeof type === "function") { propTypes = type.propTypes; } else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here. // Inner props are checked in the reconciler. type.$$typeof === REACT_MEMO_TYPE)) { propTypes = type.propTypes; } else { return; } if (propTypes) { var name = getComponentNameFromType(type); checkPropTypes(propTypes, element.props, "prop", name, element); } else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) { propTypesMisspellWarningShown = true; var _name = getComponentNameFromType(type); error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown"); } if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) { error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); } } } function validateFragmentProps(fragment) { { var keys = Object.keys(fragment.props); for (var i = 0; i < keys.length; i++) { var key2 = keys[i]; if (key2 !== "children" && key2 !== "key") { setCurrentlyValidatingElement$1(fragment); error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key2); setCurrentlyValidatingElement$1(null); break; } } if (fragment.ref !== null) { setCurrentlyValidatingElement$1(fragment); error("Invalid attribute `ref` supplied to `React.Fragment`."); setCurrentlyValidatingElement$1(null); } } } function createElementWithValidation(type, props, children) { var validType = isValidElementType(type); if (!validType) { var info = ""; if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) { info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."; } var sourceInfo = getSourceInfoErrorAddendumForProps(props); if (sourceInfo) { info += sourceInfo; } else { info += getDeclarationErrorAddendum(); } var typeString; if (type === null) { typeString = "null"; } else if (isArray(type)) { typeString = "array"; } else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) { typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />"; info = " Did you accidentally export a JSX literal instead of a component?"; } else { typeString = typeof type; } { error("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info); } } var element = createElement.apply(this, arguments); if (element == null) { return element; } if (validType) { for (var i = 2; i < arguments.length; i++) { validateChildKeys(arguments[i], type); } } if (type === REACT_FRAGMENT_TYPE) { validateFragmentProps(element); } else { validatePropTypes(element); } return element; } var didWarnAboutDeprecatedCreateFactory = false; function createFactoryWithValidation(type) { var validatedFactory = createElementWithValidation.bind(null, type); validatedFactory.type = type; { if (!didWarnAboutDeprecatedCreateFactory) { didWarnAboutDeprecatedCreateFactory = true; warn("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead."); } Object.defineProperty(validatedFactory, "type", { enumerable: false, get: function() { warn("Factory.type is deprecated. Access the class directly before passing it to createFactory."); Object.defineProperty(this, "type", { value: type }); return type; } }); } return validatedFactory; } function cloneElementWithValidation(element, props, children) { var newElement = cloneElement3.apply(this, arguments); for (var i = 2; i < arguments.length; i++) { validateChildKeys(arguments[i], newElement.type); } validatePropTypes(newElement); return newElement; } function startTransition(scope, options) { var prevTransition = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = {}; var currentTransition = ReactCurrentBatchConfig.transition; { ReactCurrentBatchConfig.transition._updatedFibers = /* @__PURE__ */ new Set(); } try { scope(); } finally { ReactCurrentBatchConfig.transition = prevTransition; { if (prevTransition === null && currentTransition._updatedFibers) { var updatedFibersCount = currentTransition._updatedFibers.size; if (updatedFibersCount > 10) { warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."); } currentTransition._updatedFibers.clear(); } } } } var didWarnAboutMessageChannel = false; var enqueueTaskImpl = null; function enqueueTask(task) { if (enqueueTaskImpl === null) { try { var requireString = ("require" + Math.random()).slice(0, 7); var nodeRequire = module2 && module2[requireString]; enqueueTaskImpl = nodeRequire.call(module2, "timers").setImmediate; } catch (_err) { enqueueTaskImpl = function(callback) { { if (didWarnAboutMessageChannel === false) { didWarnAboutMessageChannel = true; if (typeof MessageChannel === "undefined") { error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."); } } } var channel = new MessageChannel(); channel.port1.onmessage = callback; channel.port2.postMessage(void 0); }; } } return enqueueTaskImpl(task); } var actScopeDepth = 0; var didWarnNoAwaitAct = false; function act(callback) { { var prevActScopeDepth = actScopeDepth; actScopeDepth++; if (ReactCurrentActQueue.current === null) { ReactCurrentActQueue.current = []; } var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy; var result; try { ReactCurrentActQueue.isBatchingLegacy = true; result = callback(); if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) { var queue = ReactCurrentActQueue.current; if (queue !== null) { ReactCurrentActQueue.didScheduleLegacyUpdate = false; flushActQueue(queue); } } } catch (error2) { popActScope(prevActScopeDepth); throw error2; } finally { ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy; } if (result !== null && typeof result === "object" && typeof result.then === "function") { var thenableResult = result; var wasAwaited = false; var thenable = { then: function(resolve, reject2) { wasAwaited = true; thenableResult.then(function(returnValue2) { popActScope(prevActScopeDepth); if (actScopeDepth === 0) { recursivelyFlushAsyncActWork(returnValue2, resolve, reject2); } else { resolve(returnValue2); } }, function(error2) { popActScope(prevActScopeDepth); reject2(error2); }); } }; { if (!didWarnNoAwaitAct && typeof Promise !== "undefined") { Promise.resolve().then(function() { }).then(function() { if (!wasAwaited) { didWarnNoAwaitAct = true; error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"); } }); } } return thenable; } else { var returnValue = result; popActScope(prevActScopeDepth); if (actScopeDepth === 0) { var _queue = ReactCurrentActQueue.current; if (_queue !== null) { flushActQueue(_queue); ReactCurrentActQueue.current = null; } var _thenable = { then: function(resolve, reject2) { if (ReactCurrentActQueue.current === null) { ReactCurrentActQueue.current = []; recursivelyFlushAsyncActWork(returnValue, resolve, reject2); } else { resolve(returnValue); } } }; return _thenable; } else { var _thenable2 = { then: function(resolve, reject2) { resolve(returnValue); } }; return _thenable2; } } } } function popActScope(prevActScopeDepth) { { if (prevActScopeDepth !== actScopeDepth - 1) { error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "); } actScopeDepth = prevActScopeDepth; } } function recursivelyFlushAsyncActWork(returnValue, resolve, reject2) { { var queue = ReactCurrentActQueue.current; if (queue !== null) { try { flushActQueue(queue); enqueueTask(function() { if (queue.length === 0) { ReactCurrentActQueue.current = null; resolve(returnValue); } else { recursivelyFlushAsyncActWork(returnValue, resolve, reject2); } }); } catch (error2) { reject2(error2); } } else { resolve(returnValue); } } } var isFlushing = false; function flushActQueue(queue) { { if (!isFlushing) { isFlushing = true; var i = 0; try { for (; i < queue.length; i++) { var callback = queue[i]; do { callback = callback(true); } while (callback !== null); } queue.length = 0; } catch (error2) { queue = queue.slice(i + 1); throw error2; } finally { isFlushing = false; } } } } var createElement$1 = createElementWithValidation; var cloneElement$1 = cloneElementWithValidation; var createFactory = createFactoryWithValidation; var Children = { map: mapChildren, forEach: forEachChildren, count: countChildren, toArray, only: onlyChild }; exports.Children = Children; exports.Component = Component3; exports.Fragment = REACT_FRAGMENT_TYPE; exports.Profiler = REACT_PROFILER_TYPE; exports.PureComponent = PureComponent; exports.StrictMode = REACT_STRICT_MODE_TYPE; exports.Suspense = REACT_SUSPENSE_TYPE; exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals; exports.cloneElement = cloneElement$1; exports.createContext = createContext2; exports.createElement = createElement$1; exports.createFactory = createFactory; exports.createRef = createRef; exports.forwardRef = forwardRef3; exports.isValidElement = isValidElement; exports.lazy = lazy; exports.memo = memo3; exports.startTransition = startTransition; exports.unstable_act = act; exports.useCallback = useCallback4; exports.useContext = useContext2; exports.useDebugValue = useDebugValue2; exports.useDeferredValue = useDeferredValue; exports.useEffect = useEffect13; exports.useId = useId; exports.useImperativeHandle = useImperativeHandle; exports.useInsertionEffect = useInsertionEffect; exports.useLayoutEffect = useLayoutEffect3; exports.useMemo = useMemo4; exports.useReducer = useReducer2; exports.useRef = useRef12; exports.useState = useState9; exports.useSyncExternalStore = useSyncExternalStore; exports.useTransition = useTransition; exports.version = ReactVersion; if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") { __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error()); } })(); } } }); // node_modules/react/index.js var require_react = __commonJS({ "node_modules/react/index.js"(exports, module2) { "use strict"; if (false) { module2.exports = null; } else { module2.exports = require_react_development(); } } }); // node_modules/scheduler/cjs/scheduler.development.js var require_scheduler_development = __commonJS({ "node_modules/scheduler/cjs/scheduler.development.js"(exports) { "use strict"; if (true) { (function() { "use strict"; if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") { __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); } var enableSchedulerDebugging = false; var enableProfiling = false; var frameYieldMs = 5; function push(heap, node) { var index = heap.length; heap.push(node); siftUp(heap, node, index); } function peek2(heap) { return heap.length === 0 ? null : heap[0]; } function pop(heap) { if (heap.length === 0) { return null; } var first = heap[0]; var last = heap.pop(); if (last !== first) { heap[0] = last; siftDown(heap, last, 0); } return first; } function siftUp(heap, node, i) { var index = i; while (index > 0) { var parentIndex = index - 1 >>> 1; var parent = heap[parentIndex]; if (compare(parent, node) > 0) { heap[parentIndex] = node; heap[index] = parent; index = parentIndex; } else { return; } } } function siftDown(heap, node, i) { var index = i; var length = heap.length; var halfLength = length >>> 1; while (index < halfLength) { var leftIndex = (index + 1) * 2 - 1; var left = heap[leftIndex]; var rightIndex = leftIndex + 1; var right = heap[rightIndex]; if (compare(left, node) < 0) { if (rightIndex < length && compare(right, left) < 0) { heap[index] = right; heap[rightIndex] = node; index = rightIndex; } else { heap[index] = left; heap[leftIndex] = node; index = leftIndex; } } else if (rightIndex < length && compare(right, node) < 0) { heap[index] = right; heap[rightIndex] = node; index = rightIndex; } else { return; } } } function compare(a, b) { var diff = a.sortIndex - b.sortIndex; return diff !== 0 ? diff : a.id - b.id; } var ImmediatePriority = 1; var UserBlockingPriority = 2; var NormalPriority = 3; var LowPriority = 4; var IdlePriority = 5; function markTaskErrored(task, ms) { } var hasPerformanceNow = typeof performance === "object" && typeof performance.now === "function"; if (hasPerformanceNow) { var localPerformance = performance; exports.unstable_now = function() { return localPerformance.now(); }; } else { var localDate = Date; var initialTime = localDate.now(); exports.unstable_now = function() { return localDate.now() - initialTime; }; } var maxSigned31BitInt = 1073741823; var IMMEDIATE_PRIORITY_TIMEOUT = -1; var USER_BLOCKING_PRIORITY_TIMEOUT = 250; var NORMAL_PRIORITY_TIMEOUT = 5e3; var LOW_PRIORITY_TIMEOUT = 1e4; var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt; var taskQueue = []; var timerQueue = []; var taskIdCounter = 1; var currentTask = null; var currentPriorityLevel = NormalPriority; var isPerformingWork = false; var isHostCallbackScheduled = false; var isHostTimeoutScheduled = false; var localSetTimeout = typeof setTimeout === "function" ? setTimeout : null; var localClearTimeout = typeof clearTimeout === "function" ? clearTimeout : null; var localSetImmediate = typeof setImmediate !== "undefined" ? setImmediate : null; var isInputPending = typeof navigator !== "undefined" && navigator.scheduling !== void 0 && navigator.scheduling.isInputPending !== void 0 ? navigator.scheduling.isInputPending.bind(navigator.scheduling) : null; function advanceTimers(currentTime) { var timer = peek2(timerQueue); while (timer !== null) { if (timer.callback === null) { pop(timerQueue); } else if (timer.startTime <= currentTime) { pop(timerQueue); timer.sortIndex = timer.expirationTime; push(taskQueue, timer); } else { return; } timer = peek2(timerQueue); } } function handleTimeout(currentTime) { isHostTimeoutScheduled = false; advanceTimers(currentTime); if (!isHostCallbackScheduled) { if (peek2(taskQueue) !== null) { isHostCallbackScheduled = true; requestHostCallback(flushWork); } else { var firstTimer = peek2(timerQueue); if (firstTimer !== null) { requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime); } } } } function flushWork(hasTimeRemaining, initialTime2) { isHostCallbackScheduled = false; if (isHostTimeoutScheduled) { isHostTimeoutScheduled = false; cancelHostTimeout(); } isPerformingWork = true; var previousPriorityLevel = currentPriorityLevel; try { if (enableProfiling) { try { return workLoop(hasTimeRemaining, initialTime2); } catch (error) { if (currentTask !== null) { var currentTime = exports.unstable_now(); markTaskErrored(currentTask, currentTime); currentTask.isQueued = false; } throw error; } } else { return workLoop(hasTimeRemaining, initialTime2); } } finally { currentTask = null; currentPriorityLevel = previousPriorityLevel; isPerformingWork = false; } } function workLoop(hasTimeRemaining, initialTime2) { var currentTime = initialTime2; advanceTimers(currentTime); currentTask = peek2(taskQueue); while (currentTask !== null && !enableSchedulerDebugging) { if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) { break; } var callback = currentTask.callback; if (typeof callback === "function") { currentTask.callback = null; currentPriorityLevel = currentTask.priorityLevel; var didUserCallbackTimeout = currentTask.expirationTime <= currentTime; var continuationCallback = callback(didUserCallbackTimeout); currentTime = exports.unstable_now(); if (typeof continuationCallback === "function") { currentTask.callback = continuationCallback; } else { if (currentTask === peek2(taskQueue)) { pop(taskQueue); } } advanceTimers(currentTime); } else { pop(taskQueue); } currentTask = peek2(taskQueue); } if (currentTask !== null) { return true; } else { var firstTimer = peek2(timerQueue); if (firstTimer !== null) { requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime); } return false; } } function unstable_runWithPriority(priorityLevel, eventHandler) { switch (priorityLevel) { case ImmediatePriority: case UserBlockingPriority: case NormalPriority: case LowPriority: case IdlePriority: break; default: priorityLevel = NormalPriority; } var previousPriorityLevel = currentPriorityLevel; currentPriorityLevel = priorityLevel; try { return eventHandler(); } finally { currentPriorityLevel = previousPriorityLevel; } } function unstable_next(eventHandler) { var priorityLevel; switch (currentPriorityLevel) { case ImmediatePriority: case UserBlockingPriority: case NormalPriority: priorityLevel = NormalPriority; break; default: priorityLevel = currentPriorityLevel; break; } var previousPriorityLevel = currentPriorityLevel; currentPriorityLevel = priorityLevel; try { return eventHandler(); } finally { currentPriorityLevel = previousPriorityLevel; } } function unstable_wrapCallback(callback) { var parentPriorityLevel = currentPriorityLevel; return function() { var previousPriorityLevel = currentPriorityLevel; currentPriorityLevel = parentPriorityLevel; try { return callback.apply(this, arguments); } finally { currentPriorityLevel = previousPriorityLevel; } }; } function unstable_scheduleCallback(priorityLevel, callback, options) { var currentTime = exports.unstable_now(); var startTime2; if (typeof options === "object" && options !== null) { var delay = options.delay; if (typeof delay === "number" && delay > 0) { startTime2 = currentTime + delay; } else { startTime2 = currentTime; } } else { startTime2 = currentTime; } var timeout; switch (priorityLevel) { case ImmediatePriority: timeout = IMMEDIATE_PRIORITY_TIMEOUT; break; case UserBlockingPriority: timeout = USER_BLOCKING_PRIORITY_TIMEOUT; break; case IdlePriority: timeout = IDLE_PRIORITY_TIMEOUT; break; case LowPriority: timeout = LOW_PRIORITY_TIMEOUT; break; case NormalPriority: default: timeout = NORMAL_PRIORITY_TIMEOUT; break; } var expirationTime = startTime2 + timeout; var newTask = { id: taskIdCounter++, callback, priorityLevel, startTime: startTime2, expirationTime, sortIndex: -1 }; if (startTime2 > currentTime) { newTask.sortIndex = startTime2; push(timerQueue, newTask); if (peek2(taskQueue) === null && newTask === peek2(timerQueue)) { if (isHostTimeoutScheduled) { cancelHostTimeout(); } else { isHostTimeoutScheduled = true; } requestHostTimeout(handleTimeout, startTime2 - currentTime); } } else { newTask.sortIndex = expirationTime; push(taskQueue, newTask); if (!isHostCallbackScheduled && !isPerformingWork) { isHostCallbackScheduled = true; requestHostCallback(flushWork); } } return newTask; } function unstable_pauseExecution() { } function unstable_continueExecution() { if (!isHostCallbackScheduled && !isPerformingWork) { isHostCallbackScheduled = true; requestHostCallback(flushWork); } } function unstable_getFirstCallbackNode() { return peek2(taskQueue); } function unstable_cancelCallback(task) { task.callback = null; } function unstable_getCurrentPriorityLevel() { return currentPriorityLevel; } var isMessageLoopRunning = false; var scheduledHostCallback = null; var taskTimeoutID = -1; var frameInterval = frameYieldMs; var startTime = -1; function shouldYieldToHost() { var timeElapsed = exports.unstable_now() - startTime; if (timeElapsed < frameInterval) { return false; } return true; } function requestPaint() { } function forceFrameRate(fps) { if (fps < 0 || fps > 125) { console["error"]("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"); return; } if (fps > 0) { frameInterval = Math.floor(1e3 / fps); } else { frameInterval = frameYieldMs; } } var performWorkUntilDeadline = function() { if (scheduledHostCallback !== null) { var currentTime = exports.unstable_now(); startTime = currentTime; var hasTimeRemaining = true; var hasMoreWork = true; try { hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime); } finally { if (hasMoreWork) { schedulePerformWorkUntilDeadline(); } else { isMessageLoopRunning = false; scheduledHostCallback = null; } } } else { isMessageLoopRunning = false; } }; var schedulePerformWorkUntilDeadline; if (typeof localSetImmediate === "function") { schedulePerformWorkUntilDeadline = function() { localSetImmediate(performWorkUntilDeadline); }; } else if (typeof MessageChannel !== "undefined") { var channel = new MessageChannel(); var port = channel.port2; channel.port1.onmessage = performWorkUntilDeadline; schedulePerformWorkUntilDeadline = function() { port.postMessage(null); }; } else { schedulePerformWorkUntilDeadline = function() { localSetTimeout(performWorkUntilDeadline, 0); }; } function requestHostCallback(callback) { scheduledHostCallback = callback; if (!isMessageLoopRunning) { isMessageLoopRunning = true; schedulePerformWorkUntilDeadline(); } } function requestHostTimeout(callback, ms) { taskTimeoutID = localSetTimeout(function() { callback(exports.unstable_now()); }, ms); } function cancelHostTimeout() { localClearTimeout(taskTimeoutID); taskTimeoutID = -1; } var unstable_requestPaint = requestPaint; var unstable_Profiling = null; exports.unstable_IdlePriority = IdlePriority; exports.unstable_ImmediatePriority = ImmediatePriority; exports.unstable_LowPriority = LowPriority; exports.unstable_NormalPriority = NormalPriority; exports.unstable_Profiling = unstable_Profiling; exports.unstable_UserBlockingPriority = UserBlockingPriority; exports.unstable_cancelCallback = unstable_cancelCallback; exports.unstable_continueExecution = unstable_continueExecution; exports.unstable_forceFrameRate = forceFrameRate; exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel; exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode; exports.unstable_next = unstable_next; exports.unstable_pauseExecution = unstable_pauseExecution; exports.unstable_requestPaint = unstable_requestPaint; exports.unstable_runWithPriority = unstable_runWithPriority; exports.unstable_scheduleCallback = unstable_scheduleCallback; exports.unstable_shouldYield = shouldYieldToHost; exports.unstable_wrapCallback = unstable_wrapCallback; if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") { __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error()); } })(); } } }); // node_modules/scheduler/index.js var require_scheduler = __commonJS({ "node_modules/scheduler/index.js"(exports, module2) { "use strict"; if (false) { module2.exports = null; } else { module2.exports = require_scheduler_development(); } } }); // node_modules/react-dom/cjs/react-dom.development.js var require_react_dom_development = __commonJS({ "node_modules/react-dom/cjs/react-dom.development.js"(exports) { "use strict"; if (true) { (function() { "use strict"; if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") { __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); } var React4 = require_react(); var Scheduler = require_scheduler(); var ReactSharedInternals = React4.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; var suppressWarning = false; function setSuppressWarning(newSuppressWarning) { { suppressWarning = newSuppressWarning; } } function warn(format) { { if (!suppressWarning) { for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } printWarning("warn", format, args); } } } function error(format) { { if (!suppressWarning) { for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { args[_key2 - 1] = arguments[_key2]; } printWarning("error", format, args); } } } function printWarning(level, format, args) { { var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame; var stack = ReactDebugCurrentFrame2.getStackAddendum(); if (stack !== "") { format += "%s"; args = args.concat([stack]); } var argsWithFormat = args.map(function(item) { return String(item); }); argsWithFormat.unshift("Warning: " + format); Function.prototype.apply.call(console[level], console, argsWithFormat); } } var FunctionComponent = 0; var ClassComponent = 1; var IndeterminateComponent = 2; var HostRoot = 3; var HostPortal = 4; var HostComponent = 5; var HostText = 6; var Fragment10 = 7; var Mode = 8; var ContextConsumer = 9; var ContextProvider = 10; var ForwardRef = 11; var Profiler = 12; var SuspenseComponent = 13; var MemoComponent = 14; var SimpleMemoComponent = 15; var LazyComponent = 16; var IncompleteClassComponent = 17; var DehydratedFragment = 18; var SuspenseListComponent = 19; var ScopeComponent = 21; var OffscreenComponent = 22; var LegacyHiddenComponent = 23; var CacheComponent = 24; var TracingMarkerComponent = 25; var enableClientRenderFallbackOnTextMismatch = true; var enableNewReconciler = false; var enableLazyContextPropagation = false; var enableLegacyHidden = false; var enableSuspenseAvoidThisFallback = false; var disableCommentsAsDOMContainers = true; var enableCustomElementPropertySupport = false; var warnAboutStringRefs = false; var enableSchedulingProfiler = true; var enableProfilerTimer = true; var enableProfilerCommitHooks = true; var allNativeEvents = /* @__PURE__ */ new Set(); var registrationNameDependencies = {}; var possibleRegistrationNames = {}; function registerTwoPhaseEvent(registrationName, dependencies) { registerDirectEvent(registrationName, dependencies); registerDirectEvent(registrationName + "Capture", dependencies); } function registerDirectEvent(registrationName, dependencies) { { if (registrationNameDependencies[registrationName]) { error("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.", registrationName); } } registrationNameDependencies[registrationName] = dependencies; { var lowerCasedName = registrationName.toLowerCase(); possibleRegistrationNames[lowerCasedName] = registrationName; if (registrationName === "onDoubleClick") { possibleRegistrationNames.ondblclick = registrationName; } } for (var i = 0; i < dependencies.length; i++) { allNativeEvents.add(dependencies[i]); } } var canUseDOM2 = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined"); var hasOwnProperty2 = Object.prototype.hasOwnProperty; function typeName(value) { { var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag; var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object"; return type; } } function willCoercionThrow(value) { { try { testStringCoercion(value); return false; } catch (e) { return true; } } } function testStringCoercion(value) { return "" + value; } function checkAttributeStringCoercion(value, attributeName) { { if (willCoercionThrow(value)) { error("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before before using it here.", attributeName, typeName(value)); return testStringCoercion(value); } } } function checkKeyStringCoercion(value) { { if (willCoercionThrow(value)) { error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value)); return testStringCoercion(value); } } } function checkPropStringCoercion(value, propName) { { if (willCoercionThrow(value)) { error("The provided `%s` prop is an unsupported type %s. This value must be coerced to a string before before using it here.", propName, typeName(value)); return testStringCoercion(value); } } } function checkCSSPropertyStringCoercion(value, propName) { { if (willCoercionThrow(value)) { error("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before before using it here.", propName, typeName(value)); return testStringCoercion(value); } } } function checkHtmlStringCoercion(value) { { if (willCoercionThrow(value)) { error("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value)); return testStringCoercion(value); } } } function checkFormFieldValueStringCoercion(value) { { if (willCoercionThrow(value)) { error("Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before before using it here.", typeName(value)); return testStringCoercion(value); } } } var RESERVED = 0; var STRING = 1; var BOOLEANISH_STRING = 2; var BOOLEAN = 3; var OVERLOADED_BOOLEAN = 4; var NUMERIC = 5; var POSITIVE_NUMERIC = 6; var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"; var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; var VALID_ATTRIBUTE_NAME_REGEX = new RegExp("^[" + ATTRIBUTE_NAME_START_CHAR + "][" + ATTRIBUTE_NAME_CHAR + "]*$"); var illegalAttributeNameCache = {}; var validatedAttributeNameCache = {}; function isAttributeNameSafe(attributeName) { if (hasOwnProperty2.call(validatedAttributeNameCache, attributeName)) { return true; } if (hasOwnProperty2.call(illegalAttributeNameCache, attributeName)) { return false; } if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { validatedAttributeNameCache[attributeName] = true; return true; } illegalAttributeNameCache[attributeName] = true; { error("Invalid attribute name: `%s`", attributeName); } return false; } function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) { if (propertyInfo !== null) { return propertyInfo.type === RESERVED; } if (isCustomComponentTag) { return false; } if (name.length > 2 && (name[0] === "o" || name[0] === "O") && (name[1] === "n" || name[1] === "N")) { return true; } return false; } function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) { if (propertyInfo !== null && propertyInfo.type === RESERVED) { return false; } switch (typeof value) { case "function": case "symbol": return true; case "boolean": { if (isCustomComponentTag) { return false; } if (propertyInfo !== null) { return !propertyInfo.acceptsBooleans; } else { var prefix3 = name.toLowerCase().slice(0, 5); return prefix3 !== "data-" && prefix3 !== "aria-"; } } default: return false; } } function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) { if (value === null || typeof value === "undefined") { return true; } if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) { return true; } if (isCustomComponentTag) { return false; } if (propertyInfo !== null) { switch (propertyInfo.type) { case BOOLEAN: return !value; case OVERLOADED_BOOLEAN: return value === false; case NUMERIC: return isNaN(value); case POSITIVE_NUMERIC: return isNaN(value) || value < 1; } } return false; } function getPropertyInfo(name) { return properties2.hasOwnProperty(name) ? properties2[name] : null; } function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL2, removeEmptyString) { this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN; this.attributeName = attributeName; this.attributeNamespace = attributeNamespace; this.mustUseProperty = mustUseProperty; this.propertyName = name; this.type = type; this.sanitizeURL = sanitizeURL2; this.removeEmptyString = removeEmptyString; } var properties2 = {}; var reservedProps = [ "children", "dangerouslySetInnerHTML", // TODO: This prevents the assignment of defaultValue to regular // elements (not just inputs). Now that ReactDOMInput assigns to the // defaultValue property -- do we need this? "defaultValue", "defaultChecked", "innerHTML", "suppressContentEditableWarning", "suppressHydrationWarning", "style" ]; reservedProps.forEach(function(name) { properties2[name] = new PropertyInfoRecord( name, RESERVED, false, // mustUseProperty name, // attributeName null, // attributeNamespace false, // sanitizeURL false ); }); [["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(_ref) { var name = _ref[0], attributeName = _ref[1]; properties2[name] = new PropertyInfoRecord( name, STRING, false, // mustUseProperty attributeName, // attributeName null, // attributeNamespace false, // sanitizeURL false ); }); ["contentEditable", "draggable", "spellCheck", "value"].forEach(function(name) { properties2[name] = new PropertyInfoRecord( name, BOOLEANISH_STRING, false, // mustUseProperty name.toLowerCase(), // attributeName null, // attributeNamespace false, // sanitizeURL false ); }); ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(name) { properties2[name] = new PropertyInfoRecord( name, BOOLEANISH_STRING, false, // mustUseProperty name, // attributeName null, // attributeNamespace false, // sanitizeURL false ); }); [ "allowFullScreen", "async", // Note: there is a special case that prevents it from being written to the DOM // on the client side because the browsers are inconsistent. Instead we call focus(). "autoFocus", "autoPlay", "controls", "default", "defer", "disabled", "disablePictureInPicture", "disableRemotePlayback", "formNoValidate", "hidden", "loop", "noModule", "noValidate", "open", "playsInline", "readOnly", "required", "reversed", "scoped", "seamless", // Microdata "itemScope" ].forEach(function(name) { properties2[name] = new PropertyInfoRecord( name, BOOLEAN, false, // mustUseProperty name.toLowerCase(), // attributeName null, // attributeNamespace false, // sanitizeURL false ); }); [ "checked", // Note: `option.selected` is not updated if `select.multiple` is // disabled with `removeAttribute`. We have special logic for handling this. "multiple", "muted", "selected" // NOTE: if you add a camelCased prop to this list, // you'll need to set attributeName to name.toLowerCase() // instead in the assignment below. ].forEach(function(name) { properties2[name] = new PropertyInfoRecord( name, BOOLEAN, true, // mustUseProperty name, // attributeName null, // attributeNamespace false, // sanitizeURL false ); }); [ "capture", "download" // NOTE: if you add a camelCased prop to this list, // you'll need to set attributeName to name.toLowerCase() // instead in the assignment below. ].forEach(function(name) { properties2[name] = new PropertyInfoRecord( name, OVERLOADED_BOOLEAN, false, // mustUseProperty name, // attributeName null, // attributeNamespace false, // sanitizeURL false ); }); [ "cols", "rows", "size", "span" // NOTE: if you add a camelCased prop to this list, // you'll need to set attributeName to name.toLowerCase() // instead in the assignment below. ].forEach(function(name) { properties2[name] = new PropertyInfoRecord( name, POSITIVE_NUMERIC, false, // mustUseProperty name, // attributeName null, // attributeNamespace false, // sanitizeURL false ); }); ["rowSpan", "start"].forEach(function(name) { properties2[name] = new PropertyInfoRecord( name, NUMERIC, false, // mustUseProperty name.toLowerCase(), // attributeName null, // attributeNamespace false, // sanitizeURL false ); }); var CAMELIZE = /[\-\:]([a-z])/g; var capitalize = function(token) { return token[1].toUpperCase(); }; [ "accent-height", "alignment-baseline", "arabic-form", "baseline-shift", "cap-height", "clip-path", "clip-rule", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "dominant-baseline", "enable-background", "fill-opacity", "fill-rule", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "glyph-name", "glyph-orientation-horizontal", "glyph-orientation-vertical", "horiz-adv-x", "horiz-origin-x", "image-rendering", "letter-spacing", "lighting-color", "marker-end", "marker-mid", "marker-start", "overline-position", "overline-thickness", "paint-order", "panose-1", "pointer-events", "rendering-intent", "shape-rendering", "stop-color", "stop-opacity", "strikethrough-position", "strikethrough-thickness", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke-width", "text-anchor", "text-decoration", "text-rendering", "underline-position", "underline-thickness", "unicode-bidi", "unicode-range", "units-per-em", "v-alphabetic", "v-hanging", "v-ideographic", "v-mathematical", "vector-effect", "vert-adv-y", "vert-origin-x", "vert-origin-y", "word-spacing", "writing-mode", "xmlns:xlink", "x-height" // NOTE: if you add a camelCased prop to this list, // you'll need to set attributeName to name.toLowerCase() // instead in the assignment below. ].forEach(function(attributeName) { var name = attributeName.replace(CAMELIZE, capitalize); properties2[name] = new PropertyInfoRecord( name, STRING, false, // mustUseProperty attributeName, null, // attributeNamespace false, // sanitizeURL false ); }); [ "xlink:actuate", "xlink:arcrole", "xlink:role", "xlink:show", "xlink:title", "xlink:type" // NOTE: if you add a camelCased prop to this list, // you'll need to set attributeName to name.toLowerCase() // instead in the assignment below. ].forEach(function(attributeName) { var name = attributeName.replace(CAMELIZE, capitalize); properties2[name] = new PropertyInfoRecord( name, STRING, false, // mustUseProperty attributeName, "http://www.w3.org/1999/xlink", false, // sanitizeURL false ); }); [ "xml:base", "xml:lang", "xml:space" // NOTE: if you add a camelCased prop to this list, // you'll need to set attributeName to name.toLowerCase() // instead in the assignment below. ].forEach(function(attributeName) { var name = attributeName.replace(CAMELIZE, capitalize); properties2[name] = new PropertyInfoRecord( name, STRING, false, // mustUseProperty attributeName, "http://www.w3.org/XML/1998/namespace", false, // sanitizeURL false ); }); ["tabIndex", "crossOrigin"].forEach(function(attributeName) { properties2[attributeName] = new PropertyInfoRecord( attributeName, STRING, false, // mustUseProperty attributeName.toLowerCase(), // attributeName null, // attributeNamespace false, // sanitizeURL false ); }); var xlinkHref = "xlinkHref"; properties2[xlinkHref] = new PropertyInfoRecord( "xlinkHref", STRING, false, // mustUseProperty "xlink:href", "http://www.w3.org/1999/xlink", true, // sanitizeURL false ); ["src", "href", "action", "formAction"].forEach(function(attributeName) { properties2[attributeName] = new PropertyInfoRecord( attributeName, STRING, false, // mustUseProperty attributeName.toLowerCase(), // attributeName null, // attributeNamespace true, // sanitizeURL true ); }); var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i; var didWarn = false; function sanitizeURL(url) { { if (!didWarn && isJavaScriptProtocol.test(url)) { didWarn = true; error("A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.", JSON.stringify(url)); } } } function getValueForProperty(node, name, expected, propertyInfo) { { if (propertyInfo.mustUseProperty) { var propertyName = propertyInfo.propertyName; return node[propertyName]; } else { { checkAttributeStringCoercion(expected, name); } if (propertyInfo.sanitizeURL) { sanitizeURL("" + expected); } var attributeName = propertyInfo.attributeName; var stringValue = null; if (propertyInfo.type === OVERLOADED_BOOLEAN) { if (node.hasAttribute(attributeName)) { var value = node.getAttribute(attributeName); if (value === "") { return true; } if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { return value; } if (value === "" + expected) { return expected; } return value; } } else if (node.hasAttribute(attributeName)) { if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { return node.getAttribute(attributeName); } if (propertyInfo.type === BOOLEAN) { return expected; } stringValue = node.getAttribute(attributeName); } if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { return stringValue === null ? expected : stringValue; } else if (stringValue === "" + expected) { return expected; } else { return stringValue; } } } } function getValueForAttribute(node, name, expected, isCustomComponentTag) { { if (!isAttributeNameSafe(name)) { return; } if (!node.hasAttribute(name)) { return expected === void 0 ? void 0 : null; } var value = node.getAttribute(name); { checkAttributeStringCoercion(expected, name); } if (value === "" + expected) { return expected; } return value; } } function setValueForProperty(node, name, value, isCustomComponentTag) { var propertyInfo = getPropertyInfo(name); if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) { return; } if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) { value = null; } if (isCustomComponentTag || propertyInfo === null) { if (isAttributeNameSafe(name)) { var _attributeName = name; if (value === null) { node.removeAttribute(_attributeName); } else { { checkAttributeStringCoercion(value, name); } node.setAttribute(_attributeName, "" + value); } } return; } var mustUseProperty = propertyInfo.mustUseProperty; if (mustUseProperty) { var propertyName = propertyInfo.propertyName; if (value === null) { var type = propertyInfo.type; node[propertyName] = type === BOOLEAN ? false : ""; } else { node[propertyName] = value; } return; } var attributeName = propertyInfo.attributeName, attributeNamespace = propertyInfo.attributeNamespace; if (value === null) { node.removeAttribute(attributeName); } else { var _type = propertyInfo.type; var attributeValue; if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) { attributeValue = ""; } else { { { checkAttributeStringCoercion(value, attributeName); } attributeValue = "" + value; } if (propertyInfo.sanitizeURL) { sanitizeURL(attributeValue.toString()); } } if (attributeNamespace) { node.setAttributeNS(attributeNamespace, attributeName, attributeValue); } else { node.setAttribute(attributeName, attributeValue); } } } var REACT_ELEMENT_TYPE = Symbol.for("react.element"); var REACT_PORTAL_TYPE = Symbol.for("react.portal"); var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"); var REACT_PROFILER_TYPE = Symbol.for("react.profiler"); var REACT_PROVIDER_TYPE = Symbol.for("react.provider"); var REACT_CONTEXT_TYPE = Symbol.for("react.context"); var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"); var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"); var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"); var REACT_MEMO_TYPE = Symbol.for("react.memo"); var REACT_LAZY_TYPE = Symbol.for("react.lazy"); var REACT_SCOPE_TYPE = Symbol.for("react.scope"); var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"); var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); var REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"); var REACT_CACHE_TYPE = Symbol.for("react.cache"); var REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"); var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; var FAUX_ITERATOR_SYMBOL = "@@iterator"; function getIteratorFn(maybeIterable) { if (maybeIterable === null || typeof maybeIterable !== "object") { return null; } var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; if (typeof maybeIterator === "function") { return maybeIterator; } return null; } var assign = Object.assign; var disabledDepth = 0; var prevLog; var prevInfo; var prevWarn; var prevError; var prevGroup; var prevGroupCollapsed; var prevGroupEnd; function disabledLog() { } disabledLog.__reactDisabledLog = true; function disableLogs() { { if (disabledDepth === 0) { prevLog = console.log; prevInfo = console.info; prevWarn = console.warn; prevError = console.error; prevGroup = console.group; prevGroupCollapsed = console.groupCollapsed; prevGroupEnd = console.groupEnd; var props = { configurable: true, enumerable: true, value: disabledLog, writable: true }; Object.defineProperties(console, { info: props, log: props, warn: props, error: props, group: props, groupCollapsed: props, groupEnd: props }); } disabledDepth++; } } function reenableLogs() { { disabledDepth--; if (disabledDepth === 0) { var props = { configurable: true, enumerable: true, writable: true }; Object.defineProperties(console, { log: assign({}, props, { value: prevLog }), info: assign({}, props, { value: prevInfo }), warn: assign({}, props, { value: prevWarn }), error: assign({}, props, { value: prevError }), group: assign({}, props, { value: prevGroup }), groupCollapsed: assign({}, props, { value: prevGroupCollapsed }), groupEnd: assign({}, props, { value: prevGroupEnd }) }); } if (disabledDepth < 0) { error("disabledDepth fell below zero. This is a bug in React. Please file an issue."); } } } var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; var prefix2; function describeBuiltInComponentFrame(name, source, ownerFn) { { if (prefix2 === void 0) { try { throw Error(); } catch (x) { var match2 = x.stack.trim().match(/\n( *(at )?)/); prefix2 = match2 && match2[1] || ""; } } return "\n" + prefix2 + name; } } var reentry = false; var componentFrameCache; { var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map; componentFrameCache = new PossiblyWeakMap(); } function describeNativeComponentFrame(fn, construct) { if (!fn || reentry) { return ""; } { var frame = componentFrameCache.get(fn); if (frame !== void 0) { return frame; } } var control; reentry = true; var previousPrepareStackTrace = Error.prepareStackTrace; Error.prepareStackTrace = void 0; var previousDispatcher; { previousDispatcher = ReactCurrentDispatcher.current; ReactCurrentDispatcher.current = null; disableLogs(); } try { if (construct) { var Fake = function() { throw Error(); }; Object.defineProperty(Fake.prototype, "props", { set: function() { throw Error(); } }); if (typeof Reflect === "object" && Reflect.construct) { try { Reflect.construct(Fake, []); } catch (x) { control = x; } Reflect.construct(fn, [], Fake); } else { try { Fake.call(); } catch (x) { control = x; } fn.call(Fake.prototype); } } else { try { throw Error(); } catch (x) { control = x; } fn(); } } catch (sample) { if (sample && control && typeof sample.stack === "string") { var sampleLines = sample.stack.split("\n"); var controlLines = control.stack.split("\n"); var s2 = sampleLines.length - 1; var c = controlLines.length - 1; while (s2 >= 1 && c >= 0 && sampleLines[s2] !== controlLines[c]) { c--; } for (; s2 >= 1 && c >= 0; s2--, c--) { if (sampleLines[s2] !== controlLines[c]) { if (s2 !== 1 || c !== 1) { do { s2--; c--; if (c < 0 || sampleLines[s2] !== controlLines[c]) { var _frame = "\n" + sampleLines[s2].replace(" at new ", " at "); if (fn.displayName && _frame.includes("")) { _frame = _frame.replace("", fn.displayName); } { if (typeof fn === "function") { componentFrameCache.set(fn, _frame); } } return _frame; } } while (s2 >= 1 && c >= 0); } break; } } } } finally { reentry = false; { ReactCurrentDispatcher.current = previousDispatcher; reenableLogs(); } Error.prepareStackTrace = previousPrepareStackTrace; } var name = fn ? fn.displayName || fn.name : ""; var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ""; { if (typeof fn === "function") { componentFrameCache.set(fn, syntheticFrame); } } return syntheticFrame; } function describeClassComponentFrame(ctor, source, ownerFn) { { return describeNativeComponentFrame(ctor, true); } } function describeFunctionComponentFrame(fn, source, ownerFn) { { return describeNativeComponentFrame(fn, false); } } function shouldConstruct(Component3) { var prototype = Component3.prototype; return !!(prototype && prototype.isReactComponent); } function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { if (type == null) { return ""; } if (typeof type === "function") { { return describeNativeComponentFrame(type, shouldConstruct(type)); } } if (typeof type === "string") { return describeBuiltInComponentFrame(type); } switch (type) { case REACT_SUSPENSE_TYPE: return describeBuiltInComponentFrame("Suspense"); case REACT_SUSPENSE_LIST_TYPE: return describeBuiltInComponentFrame("SuspenseList"); } if (typeof type === "object") { switch (type.$$typeof) { case REACT_FORWARD_REF_TYPE: return describeFunctionComponentFrame(type.render); case REACT_MEMO_TYPE: return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); case REACT_LAZY_TYPE: { var lazyComponent = type; var payload = lazyComponent._payload; var init = lazyComponent._init; try { return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); } catch (x) { } } } } return ""; } function describeFiber(fiber) { var owner = fiber._debugOwner ? fiber._debugOwner.type : null; var source = fiber._debugSource; switch (fiber.tag) { case HostComponent: return describeBuiltInComponentFrame(fiber.type); case LazyComponent: return describeBuiltInComponentFrame("Lazy"); case SuspenseComponent: return describeBuiltInComponentFrame("Suspense"); case SuspenseListComponent: return describeBuiltInComponentFrame("SuspenseList"); case FunctionComponent: case IndeterminateComponent: case SimpleMemoComponent: return describeFunctionComponentFrame(fiber.type); case ForwardRef: return describeFunctionComponentFrame(fiber.type.render); case ClassComponent: return describeClassComponentFrame(fiber.type); default: return ""; } } function getStackByFiberInDevAndProd(workInProgress2) { try { var info = ""; var node = workInProgress2; do { info += describeFiber(node); node = node.return; } while (node); return info; } catch (x) { return "\nError generating stack: " + x.message + "\n" + x.stack; } } function getWrappedName(outerType, innerType, wrapperName) { var displayName = outerType.displayName; if (displayName) { return displayName; } var functionName = innerType.displayName || innerType.name || ""; return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName; } function getContextName(type) { return type.displayName || "Context"; } function getComponentNameFromType(type) { if (type == null) { return null; } { if (typeof type.tag === "number") { error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."); } } if (typeof type === "function") { return type.displayName || type.name || null; } if (typeof type === "string") { return type; } switch (type) { case REACT_FRAGMENT_TYPE: return "Fragment"; case REACT_PORTAL_TYPE: return "Portal"; case REACT_PROFILER_TYPE: return "Profiler"; case REACT_STRICT_MODE_TYPE: return "StrictMode"; case REACT_SUSPENSE_TYPE: return "Suspense"; case REACT_SUSPENSE_LIST_TYPE: return "SuspenseList"; } if (typeof type === "object") { switch (type.$$typeof) { case REACT_CONTEXT_TYPE: var context = type; return getContextName(context) + ".Consumer"; case REACT_PROVIDER_TYPE: var provider = type; return getContextName(provider._context) + ".Provider"; case REACT_FORWARD_REF_TYPE: return getWrappedName(type, type.render, "ForwardRef"); case REACT_MEMO_TYPE: var outerName = type.displayName || null; if (outerName !== null) { return outerName; } return getComponentNameFromType(type.type) || "Memo"; case REACT_LAZY_TYPE: { var lazyComponent = type; var payload = lazyComponent._payload; var init = lazyComponent._init; try { return getComponentNameFromType(init(payload)); } catch (x) { return null; } } } } return null; } function getWrappedName$1(outerType, innerType, wrapperName) { var functionName = innerType.displayName || innerType.name || ""; return outerType.displayName || (functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName); } function getContextName$1(type) { return type.displayName || "Context"; } function getComponentNameFromFiber(fiber) { var tag = fiber.tag, type = fiber.type; switch (tag) { case CacheComponent: return "Cache"; case ContextConsumer: var context = type; return getContextName$1(context) + ".Consumer"; case ContextProvider: var provider = type; return getContextName$1(provider._context) + ".Provider"; case DehydratedFragment: return "DehydratedFragment"; case ForwardRef: return getWrappedName$1(type, type.render, "ForwardRef"); case Fragment10: return "Fragment"; case HostComponent: return type; case HostPortal: return "Portal"; case HostRoot: return "Root"; case HostText: return "Text"; case LazyComponent: return getComponentNameFromType(type); case Mode: if (type === REACT_STRICT_MODE_TYPE) { return "StrictMode"; } return "Mode"; case OffscreenComponent: return "Offscreen"; case Profiler: return "Profiler"; case ScopeComponent: return "Scope"; case SuspenseComponent: return "Suspense"; case SuspenseListComponent: return "SuspenseList"; case TracingMarkerComponent: return "TracingMarker"; case ClassComponent: case FunctionComponent: case IncompleteClassComponent: case IndeterminateComponent: case MemoComponent: case SimpleMemoComponent: if (typeof type === "function") { return type.displayName || type.name || null; } if (typeof type === "string") { return type; } break; } return null; } var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; var current2 = null; var isRendering = false; function getCurrentFiberOwnerNameInDevOrNull() { { if (current2 === null) { return null; } var owner = current2._debugOwner; if (owner !== null && typeof owner !== "undefined") { return getComponentNameFromFiber(owner); } } return null; } function getCurrentFiberStackInDev() { { if (current2 === null) { return ""; } return getStackByFiberInDevAndProd(current2); } } function resetCurrentFiber() { { ReactDebugCurrentFrame.getCurrentStack = null; current2 = null; isRendering = false; } } function setCurrentFiber(fiber) { { ReactDebugCurrentFrame.getCurrentStack = fiber === null ? null : getCurrentFiberStackInDev; current2 = fiber; isRendering = false; } } function getCurrentFiber() { { return current2; } } function setIsRendering(rendering) { { isRendering = rendering; } } function toString(value) { return "" + value; } function getToStringValue(value) { switch (typeof value) { case "boolean": case "number": case "string": case "undefined": return value; case "object": { checkFormFieldValueStringCoercion(value); } return value; default: return ""; } } var hasReadOnlyValue = { button: true, checkbox: true, image: true, hidden: true, radio: true, reset: true, submit: true }; function checkControlledValueProps(tagName, props) { { if (!(hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || props.value == null)) { error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`."); } if (!(props.onChange || props.readOnly || props.disabled || props.checked == null)) { error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`."); } } } function isCheckable(elem) { var type = elem.type; var nodeName = elem.nodeName; return nodeName && nodeName.toLowerCase() === "input" && (type === "checkbox" || type === "radio"); } function getTracker(node) { return node._valueTracker; } function detachTracker(node) { node._valueTracker = null; } function getValueFromNode(node) { var value = ""; if (!node) { return value; } if (isCheckable(node)) { value = node.checked ? "true" : "false"; } else { value = node.value; } return value; } function trackValueOnNode(node) { var valueField = isCheckable(node) ? "checked" : "value"; var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField); { checkFormFieldValueStringCoercion(node[valueField]); } var currentValue = "" + node[valueField]; if (node.hasOwnProperty(valueField) || typeof descriptor === "undefined" || typeof descriptor.get !== "function" || typeof descriptor.set !== "function") { return; } var get2 = descriptor.get, set3 = descriptor.set; Object.defineProperty(node, valueField, { configurable: true, get: function() { return get2.call(this); }, set: function(value) { { checkFormFieldValueStringCoercion(value); } currentValue = "" + value; set3.call(this, value); } }); Object.defineProperty(node, valueField, { enumerable: descriptor.enumerable }); var tracker = { getValue: function() { return currentValue; }, setValue: function(value) { { checkFormFieldValueStringCoercion(value); } currentValue = "" + value; }, stopTracking: function() { detachTracker(node); delete node[valueField]; } }; return tracker; } function track(node) { if (getTracker(node)) { return; } node._valueTracker = trackValueOnNode(node); } function updateValueIfChanged(node) { if (!node) { return false; } var tracker = getTracker(node); if (!tracker) { return true; } var lastValue = tracker.getValue(); var nextValue = getValueFromNode(node); if (nextValue !== lastValue) { tracker.setValue(nextValue); return true; } return false; } function getActiveElement(doc) { doc = doc || (typeof document !== "undefined" ? document : void 0); if (typeof doc === "undefined") { return null; } try { return doc.activeElement || doc.body; } catch (e) { return doc.body; } } var didWarnValueDefaultValue = false; var didWarnCheckedDefaultChecked = false; var didWarnControlledToUncontrolled = false; var didWarnUncontrolledToControlled = false; function isControlled(props) { var usesChecked = props.type === "checkbox" || props.type === "radio"; return usesChecked ? props.checked != null : props.value != null; } function getHostProps(element, props) { var node = element; var checked = props.checked; var hostProps = assign({}, props, { defaultChecked: void 0, defaultValue: void 0, value: void 0, checked: checked != null ? checked : node._wrapperState.initialChecked }); return hostProps; } function initWrapperState(element, props) { { checkControlledValueProps("input", props); if (props.checked !== void 0 && props.defaultChecked !== void 0 && !didWarnCheckedDefaultChecked) { error("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component", props.type); didWarnCheckedDefaultChecked = true; } if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnValueDefaultValue) { error("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component", props.type); didWarnValueDefaultValue = true; } } var node = element; var defaultValue2 = props.defaultValue == null ? "" : props.defaultValue; node._wrapperState = { initialChecked: props.checked != null ? props.checked : props.defaultChecked, initialValue: getToStringValue(props.value != null ? props.value : defaultValue2), controlled: isControlled(props) }; } function updateChecked(element, props) { var node = element; var checked = props.checked; if (checked != null) { setValueForProperty(node, "checked", checked, false); } } function updateWrapper(element, props) { var node = element; { var controlled = isControlled(props); if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) { error("A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"); didWarnUncontrolledToControlled = true; } if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) { error("A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"); didWarnControlledToUncontrolled = true; } } updateChecked(element, props); var value = getToStringValue(props.value); var type = props.type; if (value != null) { if (type === "number") { if (value === 0 && node.value === "" || // We explicitly want to coerce to number here if possible. // eslint-disable-next-line node.value != value) { node.value = toString(value); } } else if (node.value !== toString(value)) { node.value = toString(value); } } else if (type === "submit" || type === "reset") { node.removeAttribute("value"); return; } { if (props.hasOwnProperty("value")) { setDefaultValue(node, props.type, value); } else if (props.hasOwnProperty("defaultValue")) { setDefaultValue(node, props.type, getToStringValue(props.defaultValue)); } } { if (props.checked == null && props.defaultChecked != null) { node.defaultChecked = !!props.defaultChecked; } } } function postMountWrapper(element, props, isHydrating2) { var node = element; if (props.hasOwnProperty("value") || props.hasOwnProperty("defaultValue")) { var type = props.type; var isButton = type === "submit" || type === "reset"; if (isButton && (props.value === void 0 || props.value === null)) { return; } var initialValue = toString(node._wrapperState.initialValue); if (!isHydrating2) { { if (initialValue !== node.value) { node.value = initialValue; } } } { node.defaultValue = initialValue; } } var name = node.name; if (name !== "") { node.name = ""; } { node.defaultChecked = !node.defaultChecked; node.defaultChecked = !!node._wrapperState.initialChecked; } if (name !== "") { node.name = name; } } function restoreControlledState(element, props) { var node = element; updateWrapper(node, props); updateNamedCousins(node, props); } function updateNamedCousins(rootNode, props) { var name = props.name; if (props.type === "radio" && name != null) { var queryRoot = rootNode; while (queryRoot.parentNode) { queryRoot = queryRoot.parentNode; } { checkAttributeStringCoercion(name, "name"); } var group = queryRoot.querySelectorAll("input[name=" + JSON.stringify("" + name) + '][type="radio"]'); for (var i = 0; i < group.length; i++) { var otherNode = group[i]; if (otherNode === rootNode || otherNode.form !== rootNode.form) { continue; } var otherProps = getFiberCurrentPropsFromNode(otherNode); if (!otherProps) { throw new Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported."); } updateValueIfChanged(otherNode); updateWrapper(otherNode, otherProps); } } } function setDefaultValue(node, type, value) { if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js type !== "number" || getActiveElement(node.ownerDocument) !== node ) { if (value == null) { node.defaultValue = toString(node._wrapperState.initialValue); } else if (node.defaultValue !== toString(value)) { node.defaultValue = toString(value); } } } var didWarnSelectedSetOnOption = false; var didWarnInvalidChild = false; var didWarnInvalidInnerHTML = false; function validateProps(element, props) { { if (props.value == null) { if (typeof props.children === "object" && props.children !== null) { React4.Children.forEach(props.children, function(child) { if (child == null) { return; } if (typeof child === "string" || typeof child === "number") { return; } if (!didWarnInvalidChild) { didWarnInvalidChild = true; error("Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to "; support.option = !!div.lastChild; })(); var wrapMap = { // XHTML parsers do not magically insert elements in the // same way that tag soup parsers do. So we cannot shorten // this by omitting or other required elements. thead: [1, "", "
"], col: [2, "", "
"], tr: [2, "", "
"], td: [3, "", "
"], _default: [0, "", ""] }; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; if (!support.option) { wrapMap.optgroup = wrapMap.option = [1, ""]; } function getAll(context, tag) { var ret; if (typeof context.getElementsByTagName !== "undefined") { ret = context.getElementsByTagName(tag || "*"); } else if (typeof context.querySelectorAll !== "undefined") { ret = context.querySelectorAll(tag || "*"); } else { ret = []; } if (tag === void 0 || tag && nodeName(context, tag)) { return jQuery.merge([context], ret); } return ret; } function setGlobalEval(elems, refElements) { var i = 0, l2 = elems.length; for (; i < l2; i++) { dataPriv.set( elems[i], "globalEval", !refElements || dataPriv.get(refElements[i], "globalEval") ); } } var rhtml = /<|&#?\w+;/; function buildFragment(elems, context, scripts, selection, ignored) { var elem, tmp, tag, wrap, attached, j, fragment = context.createDocumentFragment(), nodes = [], i = 0, l2 = elems.length; for (; i < l2; i++) { elem = elems[i]; if (elem || elem === 0) { if (toType(elem) === "object") { jQuery.merge(nodes, elem.nodeType ? [elem] : elem); } else if (!rhtml.test(elem)) { nodes.push(context.createTextNode(elem)); } else { tmp = tmp || fragment.appendChild(context.createElement("div")); tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase(); wrap = wrapMap[tag] || wrapMap._default; tmp.innerHTML = wrap[1] + jQuery.htmlPrefilter(elem) + wrap[2]; j = wrap[0]; while (j--) { tmp = tmp.lastChild; } jQuery.merge(nodes, tmp.childNodes); tmp = fragment.firstChild; tmp.textContent = ""; } } } fragment.textContent = ""; i = 0; while (elem = nodes[i++]) { if (selection && jQuery.inArray(elem, selection) > -1) { if (ignored) { ignored.push(elem); } continue; } attached = isAttached(elem); tmp = getAll(fragment.appendChild(elem), "script"); if (attached) { setGlobalEval(tmp); } if (scripts) { j = 0; while (elem = tmp[j++]) { if (rscriptType.test(elem.type || "")) { scripts.push(elem); } } } } return fragment; } var rtypenamespace = /^([^.]*)(?:\.(.+)|)/; function returnTrue() { return true; } function returnFalse() { return false; } function on(elem, types, selector, data, fn, one) { var origFn, type; if (typeof types === "object") { if (typeof selector !== "string") { data = data || selector; selector = void 0; } for (type in types) { on(elem, type, selector, data, types[type], one); } return elem; } if (data == null && fn == null) { fn = selector; data = selector = void 0; } else if (fn == null) { if (typeof selector === "string") { fn = data; data = void 0; } else { fn = data; data = selector; selector = void 0; } } if (fn === false) { fn = returnFalse; } else if (!fn) { return elem; } if (one === 1) { origFn = fn; fn = function(event) { jQuery().off(event); return origFn.apply(this, arguments); }; fn.guid = origFn.guid || (origFn.guid = jQuery.guid++); } return elem.each(function() { jQuery.event.add(this, types, fn, data, selector); }); } jQuery.event = { global: {}, add: function(elem, types, handler, data, selector) { var handleObjIn, eventHandle, tmp, events2, t, handleObj, special, handlers, type, namespaces, origType, elemData = dataPriv.get(elem); if (!acceptData(elem)) { return; } if (handler.handler) { handleObjIn = handler; handler = handleObjIn.handler; selector = handleObjIn.selector; } if (selector) { jQuery.find.matchesSelector(documentElement, selector); } if (!handler.guid) { handler.guid = jQuery.guid++; } if (!(events2 = elemData.events)) { events2 = elemData.events = /* @__PURE__ */ Object.create(null); } if (!(eventHandle = elemData.handle)) { eventHandle = elemData.handle = function(e) { return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? jQuery.event.dispatch.apply(elem, arguments) : void 0; }; } types = (types || "").match(rnothtmlwhite) || [""]; t = types.length; while (t--) { tmp = rtypenamespace.exec(types[t]) || []; type = origType = tmp[1]; namespaces = (tmp[2] || "").split(".").sort(); if (!type) { continue; } special = jQuery.event.special[type] || {}; type = (selector ? special.delegateType : special.bindType) || type; special = jQuery.event.special[type] || {}; handleObj = jQuery.extend({ type, origType, data, handler, guid: handler.guid, selector, needsContext: selector && jQuery.expr.match.needsContext.test(selector), namespace: namespaces.join(".") }, handleObjIn); if (!(handlers = events2[type])) { handlers = events2[type] = []; handlers.delegateCount = 0; if (!special.setup || special.setup.call(elem, data, namespaces, eventHandle) === false) { if (elem.addEventListener) { elem.addEventListener(type, eventHandle); } } } if (special.add) { special.add.call(elem, handleObj); if (!handleObj.handler.guid) { handleObj.handler.guid = handler.guid; } } if (selector) { handlers.splice(handlers.delegateCount++, 0, handleObj); } else { handlers.push(handleObj); } jQuery.event.global[type] = true; } }, // Detach an event or set of events from an element remove: function(elem, types, handler, selector, mappedTypes) { var j, origCount, tmp, events2, t, handleObj, special, handlers, type, namespaces, origType, elemData = dataPriv.hasData(elem) && dataPriv.get(elem); if (!elemData || !(events2 = elemData.events)) { return; } types = (types || "").match(rnothtmlwhite) || [""]; t = types.length; while (t--) { tmp = rtypenamespace.exec(types[t]) || []; type = origType = tmp[1]; namespaces = (tmp[2] || "").split(".").sort(); if (!type) { for (type in events2) { jQuery.event.remove(elem, type + types[t], handler, selector, true); } continue; } special = jQuery.event.special[type] || {}; type = (selector ? special.delegateType : special.bindType) || type; handlers = events2[type] || []; tmp = tmp[2] && new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)"); origCount = j = handlers.length; while (j--) { handleObj = handlers[j]; if ((mappedTypes || origType === handleObj.origType) && (!handler || handler.guid === handleObj.guid) && (!tmp || tmp.test(handleObj.namespace)) && (!selector || selector === handleObj.selector || selector === "**" && handleObj.selector)) { handlers.splice(j, 1); if (handleObj.selector) { handlers.delegateCount--; } if (special.remove) { special.remove.call(elem, handleObj); } } } if (origCount && !handlers.length) { if (!special.teardown || special.teardown.call(elem, namespaces, elemData.handle) === false) { jQuery.removeEvent(elem, type, elemData.handle); } delete events2[type]; } } if (jQuery.isEmptyObject(events2)) { dataPriv.remove(elem, "handle events"); } }, dispatch: function(nativeEvent) { var i, j, ret, matched, handleObj, handlerQueue, args = new Array(arguments.length), event = jQuery.event.fix(nativeEvent), handlers = (dataPriv.get(this, "events") || /* @__PURE__ */ Object.create(null))[event.type] || [], special = jQuery.event.special[event.type] || {}; args[0] = event; for (i = 1; i < arguments.length; i++) { args[i] = arguments[i]; } event.delegateTarget = this; if (special.preDispatch && special.preDispatch.call(this, event) === false) { return; } handlerQueue = jQuery.event.handlers.call(this, event, handlers); i = 0; while ((matched = handlerQueue[i++]) && !event.isPropagationStopped()) { event.currentTarget = matched.elem; j = 0; while ((handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped()) { if (!event.rnamespace || handleObj.namespace === false || event.rnamespace.test(handleObj.namespace)) { event.handleObj = handleObj; event.data = handleObj.data; ret = ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler).apply(matched.elem, args); if (ret !== void 0) { if ((event.result = ret) === false) { event.preventDefault(); event.stopPropagation(); } } } } } if (special.postDispatch) { special.postDispatch.call(this, event); } return event.result; }, handlers: function(event, handlers) { var i, handleObj, sel, matchedHandlers, matchedSelectors, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target; if (delegateCount && // Support: IE <=9 // Black-hole SVG instance trees (trac-13180) cur.nodeType && // Support: Firefox <=42 // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click // Support: IE 11 only // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) !(event.type === "click" && event.button >= 1)) { for (; cur !== this; cur = cur.parentNode || this) { if (cur.nodeType === 1 && !(event.type === "click" && cur.disabled === true)) { matchedHandlers = []; matchedSelectors = {}; for (i = 0; i < delegateCount; i++) { handleObj = handlers[i]; sel = handleObj.selector + " "; if (matchedSelectors[sel] === void 0) { matchedSelectors[sel] = handleObj.needsContext ? jQuery(sel, this).index(cur) > -1 : jQuery.find(sel, this, null, [cur]).length; } if (matchedSelectors[sel]) { matchedHandlers.push(handleObj); } } if (matchedHandlers.length) { handlerQueue.push({ elem: cur, handlers: matchedHandlers }); } } } } cur = this; if (delegateCount < handlers.length) { handlerQueue.push({ elem: cur, handlers: handlers.slice(delegateCount) }); } return handlerQueue; }, addProp: function(name, hook) { Object.defineProperty(jQuery.Event.prototype, name, { enumerable: true, configurable: true, get: isFunction(hook) ? function() { if (this.originalEvent) { return hook(this.originalEvent); } } : function() { if (this.originalEvent) { return this.originalEvent[name]; } }, set: function(value) { Object.defineProperty(this, name, { enumerable: true, configurable: true, writable: true, value }); } }); }, fix: function(originalEvent) { return originalEvent[jQuery.expando] ? originalEvent : new jQuery.Event(originalEvent); }, special: { load: { // Prevent triggered image.load events from bubbling to window.load noBubble: true }, click: { // Utilize native event to ensure correct state for checkable inputs setup: function(data) { var el = this || data; if (rcheckableType.test(el.type) && el.click && nodeName(el, "input")) { leverageNative(el, "click", true); } return false; }, trigger: function(data) { var el = this || data; if (rcheckableType.test(el.type) && el.click && nodeName(el, "input")) { leverageNative(el, "click"); } return true; }, // For cross-browser consistency, suppress native .click() on links // Also prevent it if we're currently inside a leveraged native-event stack _default: function(event) { var target = event.target; return rcheckableType.test(target.type) && target.click && nodeName(target, "input") && dataPriv.get(target, "click") || nodeName(target, "a"); } }, beforeunload: { postDispatch: function(event) { if (event.result !== void 0 && event.originalEvent) { event.originalEvent.returnValue = event.result; } } } } }; function leverageNative(el, type, isSetup) { if (!isSetup) { if (dataPriv.get(el, type) === void 0) { jQuery.event.add(el, type, returnTrue); } return; } dataPriv.set(el, type, false); jQuery.event.add(el, type, { namespace: false, handler: function(event) { var result, saved = dataPriv.get(this, type); if (event.isTrigger & 1 && this[type]) { if (!saved) { saved = slice.call(arguments); dataPriv.set(this, type, saved); this[type](); result = dataPriv.get(this, type); dataPriv.set(this, type, false); if (saved !== result) { event.stopImmediatePropagation(); event.preventDefault(); return result; } } else if ((jQuery.event.special[type] || {}).delegateType) { event.stopPropagation(); } } else if (saved) { dataPriv.set(this, type, jQuery.event.trigger( saved[0], saved.slice(1), this )); event.stopPropagation(); event.isImmediatePropagationStopped = returnTrue; } } }); } jQuery.removeEvent = function(elem, type, handle) { if (elem.removeEventListener) { elem.removeEventListener(type, handle); } }; jQuery.Event = function(src, props) { if (!(this instanceof jQuery.Event)) { return new jQuery.Event(src, props); } if (src && src.type) { this.originalEvent = src; this.type = src.type; this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === void 0 && // Support: Android <=2.3 only src.returnValue === false ? returnTrue : returnFalse; this.target = src.target && src.target.nodeType === 3 ? src.target.parentNode : src.target; this.currentTarget = src.currentTarget; this.relatedTarget = src.relatedTarget; } else { this.type = src; } if (props) { jQuery.extend(this, props); } this.timeStamp = src && src.timeStamp || Date.now(); this[jQuery.expando] = true; }; jQuery.Event.prototype = { constructor: jQuery.Event, isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, isSimulated: false, preventDefault: function() { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if (e && !this.isSimulated) { e.preventDefault(); } }, stopPropagation: function() { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if (e && !this.isSimulated) { e.stopPropagation(); } }, stopImmediatePropagation: function() { var e = this.originalEvent; this.isImmediatePropagationStopped = returnTrue; if (e && !this.isSimulated) { e.stopImmediatePropagation(); } this.stopPropagation(); } }; jQuery.each({ altKey: true, bubbles: true, cancelable: true, changedTouches: true, ctrlKey: true, detail: true, eventPhase: true, metaKey: true, pageX: true, pageY: true, shiftKey: true, view: true, "char": true, code: true, charCode: true, key: true, keyCode: true, button: true, buttons: true, clientX: true, clientY: true, offsetX: true, offsetY: true, pointerId: true, pointerType: true, screenX: true, screenY: true, targetTouches: true, toElement: true, touches: true, which: true }, jQuery.event.addProp); jQuery.each({ focus: "focusin", blur: "focusout" }, function(type, delegateType) { function focusMappedHandler(nativeEvent) { if (document2.documentMode) { var handle = dataPriv.get(this, "handle"), event = jQuery.event.fix(nativeEvent); event.type = nativeEvent.type === "focusin" ? "focus" : "blur"; event.isSimulated = true; handle(nativeEvent); if (event.target === event.currentTarget) { handle(event); } } else { jQuery.event.simulate( delegateType, nativeEvent.target, jQuery.event.fix(nativeEvent) ); } } jQuery.event.special[type] = { // Utilize native event if possible so blur/focus sequence is correct setup: function() { var attaches; leverageNative(this, type, true); if (document2.documentMode) { attaches = dataPriv.get(this, delegateType); if (!attaches) { this.addEventListener(delegateType, focusMappedHandler); } dataPriv.set(this, delegateType, (attaches || 0) + 1); } else { return false; } }, trigger: function() { leverageNative(this, type); return true; }, teardown: function() { var attaches; if (document2.documentMode) { attaches = dataPriv.get(this, delegateType) - 1; if (!attaches) { this.removeEventListener(delegateType, focusMappedHandler); dataPriv.remove(this, delegateType); } else { dataPriv.set(this, delegateType, attaches); } } else { return false; } }, // Suppress native focus or blur if we're currently inside // a leveraged native-event stack _default: function(event) { return dataPriv.get(event.target, type); }, delegateType }; jQuery.event.special[delegateType] = { setup: function() { var doc = this.ownerDocument || this.document || this, dataHolder = document2.documentMode ? this : doc, attaches = dataPriv.get(dataHolder, delegateType); if (!attaches) { if (document2.documentMode) { this.addEventListener(delegateType, focusMappedHandler); } else { doc.addEventListener(type, focusMappedHandler, true); } } dataPriv.set(dataHolder, delegateType, (attaches || 0) + 1); }, teardown: function() { var doc = this.ownerDocument || this.document || this, dataHolder = document2.documentMode ? this : doc, attaches = dataPriv.get(dataHolder, delegateType) - 1; if (!attaches) { if (document2.documentMode) { this.removeEventListener(delegateType, focusMappedHandler); } else { doc.removeEventListener(type, focusMappedHandler, true); } dataPriv.remove(dataHolder, delegateType); } else { dataPriv.set(dataHolder, delegateType, attaches); } } }; }); jQuery.each({ mouseenter: "mouseover", mouseleave: "mouseout", pointerenter: "pointerover", pointerleave: "pointerout" }, function(orig, fix) { jQuery.event.special[orig] = { delegateType: fix, bindType: fix, handle: function(event) { var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj; if (!related || related !== target && !jQuery.contains(target, related)) { event.type = handleObj.origType; ret = handleObj.handler.apply(this, arguments); event.type = fix; } return ret; } }; }); jQuery.fn.extend({ on: function(types, selector, data, fn) { return on(this, types, selector, data, fn); }, one: function(types, selector, data, fn) { return on(this, types, selector, data, fn, 1); }, off: function(types, selector, fn) { var handleObj, type; if (types && types.preventDefault && types.handleObj) { handleObj = types.handleObj; jQuery(types.delegateTarget).off( handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler ); return this; } if (typeof types === "object") { for (type in types) { this.off(type, selector, types[type]); } return this; } if (selector === false || typeof selector === "function") { fn = selector; selector = void 0; } if (fn === false) { fn = returnFalse; } return this.each(function() { jQuery.event.remove(this, types, fn, selector); }); } }); var rnoInnerhtml = /\s*$/g; function manipulationTarget(elem, content) { if (nodeName(elem, "table") && nodeName(content.nodeType !== 11 ? content : content.firstChild, "tr")) { return jQuery(elem).children("tbody")[0] || elem; } return elem; } function disableScript(elem) { elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type; return elem; } function restoreScript(elem) { if ((elem.type || "").slice(0, 5) === "true/") { elem.type = elem.type.slice(5); } else { elem.removeAttribute("type"); } return elem; } function cloneCopyEvent(src, dest) { var i, l2, type, pdataOld, udataOld, udataCur, events2; if (dest.nodeType !== 1) { return; } if (dataPriv.hasData(src)) { pdataOld = dataPriv.get(src); events2 = pdataOld.events; if (events2) { dataPriv.remove(dest, "handle events"); for (type in events2) { for (i = 0, l2 = events2[type].length; i < l2; i++) { jQuery.event.add(dest, type, events2[type][i]); } } } } if (dataUser.hasData(src)) { udataOld = dataUser.access(src); udataCur = jQuery.extend({}, udataOld); dataUser.set(dest, udataCur); } } function fixInput(src, dest) { var nodeName2 = dest.nodeName.toLowerCase(); if (nodeName2 === "input" && rcheckableType.test(src.type)) { dest.checked = src.checked; } else if (nodeName2 === "input" || nodeName2 === "textarea") { dest.defaultValue = src.defaultValue; } } function domManip(collection, args, callback, ignored) { args = flat(args); var fragment, first, scripts, hasScripts, node, doc, i = 0, l2 = collection.length, iNoClone = l2 - 1, value = args[0], valueIsFunction = isFunction(value); if (valueIsFunction || l2 > 1 && typeof value === "string" && !support.checkClone && rchecked.test(value)) { return collection.each(function(index) { var self2 = collection.eq(index); if (valueIsFunction) { args[0] = value.call(this, index, self2.html()); } domManip(self2, args, callback, ignored); }); } if (l2) { fragment = buildFragment(args, collection[0].ownerDocument, false, collection, ignored); first = fragment.firstChild; if (fragment.childNodes.length === 1) { fragment = first; } if (first || ignored) { scripts = jQuery.map(getAll(fragment, "script"), disableScript); hasScripts = scripts.length; for (; i < l2; i++) { node = fragment; if (i !== iNoClone) { node = jQuery.clone(node, true, true); if (hasScripts) { jQuery.merge(scripts, getAll(node, "script")); } } callback.call(collection[i], node, i); } if (hasScripts) { doc = scripts[scripts.length - 1].ownerDocument; jQuery.map(scripts, restoreScript); for (i = 0; i < hasScripts; i++) { node = scripts[i]; if (rscriptType.test(node.type || "") && !dataPriv.access(node, "globalEval") && jQuery.contains(doc, node)) { if (node.src && (node.type || "").toLowerCase() !== "module") { if (jQuery._evalUrl && !node.noModule) { jQuery._evalUrl(node.src, { nonce: node.nonce || node.getAttribute("nonce") }, doc); } } else { DOMEval(node.textContent.replace(rcleanScript, ""), node, doc); } } } } } } return collection; } function remove(elem, selector, keepData) { var node, nodes = selector ? jQuery.filter(selector, elem) : elem, i = 0; for (; (node = nodes[i]) != null; i++) { if (!keepData && node.nodeType === 1) { jQuery.cleanData(getAll(node)); } if (node.parentNode) { if (keepData && isAttached(node)) { setGlobalEval(getAll(node, "script")); } node.parentNode.removeChild(node); } } return elem; } jQuery.extend({ htmlPrefilter: function(html) { return html; }, clone: function(elem, dataAndEvents, deepDataAndEvents) { var i, l2, srcElements, destElements, clone3 = elem.cloneNode(true), inPage = isAttached(elem); if (!support.noCloneChecked && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem)) { destElements = getAll(clone3); srcElements = getAll(elem); for (i = 0, l2 = srcElements.length; i < l2; i++) { fixInput(srcElements[i], destElements[i]); } } if (dataAndEvents) { if (deepDataAndEvents) { srcElements = srcElements || getAll(elem); destElements = destElements || getAll(clone3); for (i = 0, l2 = srcElements.length; i < l2; i++) { cloneCopyEvent(srcElements[i], destElements[i]); } } else { cloneCopyEvent(elem, clone3); } } destElements = getAll(clone3, "script"); if (destElements.length > 0) { setGlobalEval(destElements, !inPage && getAll(elem, "script")); } return clone3; }, cleanData: function(elems) { var data, elem, type, special = jQuery.event.special, i = 0; for (; (elem = elems[i]) !== void 0; i++) { if (acceptData(elem)) { if (data = elem[dataPriv.expando]) { if (data.events) { for (type in data.events) { if (special[type]) { jQuery.event.remove(elem, type); } else { jQuery.removeEvent(elem, type, data.handle); } } } elem[dataPriv.expando] = void 0; } if (elem[dataUser.expando]) { elem[dataUser.expando] = void 0; } } } } }); jQuery.fn.extend({ detach: function(selector) { return remove(this, selector, true); }, remove: function(selector) { return remove(this, selector); }, text: function(value) { return access(this, function(value2) { return value2 === void 0 ? jQuery.text(this) : this.empty().each(function() { if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) { this.textContent = value2; } }); }, null, value, arguments.length); }, append: function() { return domManip(this, arguments, function(elem) { if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) { var target = manipulationTarget(this, elem); target.appendChild(elem); } }); }, prepend: function() { return domManip(this, arguments, function(elem) { if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) { var target = manipulationTarget(this, elem); target.insertBefore(elem, target.firstChild); } }); }, before: function() { return domManip(this, arguments, function(elem) { if (this.parentNode) { this.parentNode.insertBefore(elem, this); } }); }, after: function() { return domManip(this, arguments, function(elem) { if (this.parentNode) { this.parentNode.insertBefore(elem, this.nextSibling); } }); }, empty: function() { var elem, i = 0; for (; (elem = this[i]) != null; i++) { if (elem.nodeType === 1) { jQuery.cleanData(getAll(elem, false)); elem.textContent = ""; } } return this; }, clone: function(dataAndEvents, deepDataAndEvents) { dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; return this.map(function() { return jQuery.clone(this, dataAndEvents, deepDataAndEvents); }); }, html: function(value) { return access(this, function(value2) { var elem = this[0] || {}, i = 0, l2 = this.length; if (value2 === void 0 && elem.nodeType === 1) { return elem.innerHTML; } if (typeof value2 === "string" && !rnoInnerhtml.test(value2) && !wrapMap[(rtagName.exec(value2) || ["", ""])[1].toLowerCase()]) { value2 = jQuery.htmlPrefilter(value2); try { for (; i < l2; i++) { elem = this[i] || {}; if (elem.nodeType === 1) { jQuery.cleanData(getAll(elem, false)); elem.innerHTML = value2; } } elem = 0; } catch (e) { } } if (elem) { this.empty().append(value2); } }, null, value, arguments.length); }, replaceWith: function() { var ignored = []; return domManip(this, arguments, function(elem) { var parent = this.parentNode; if (jQuery.inArray(this, ignored) < 0) { jQuery.cleanData(getAll(this)); if (parent) { parent.replaceChild(elem, this); } } }, ignored); } }); jQuery.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function(name, original) { jQuery.fn[name] = function(selector) { var elems, ret = [], insert = jQuery(selector), last = insert.length - 1, i = 0; for (; i <= last; i++) { elems = i === last ? this : this.clone(true); jQuery(insert[i])[original](elems); push.apply(ret, elems.get()); } return this.pushStack(ret); }; }); var rnumnonpx = new RegExp("^(" + pnum + ")(?!px)[a-z%]+$", "i"); var rcustomProp = /^--/; var getStyles = function(elem) { var view = elem.ownerDocument.defaultView; if (!view || !view.opener) { view = window2; } return view.getComputedStyle(elem); }; var swap = function(elem, options, callback) { var ret, name, old = {}; for (name in options) { old[name] = elem.style[name]; elem.style[name] = options[name]; } ret = callback.call(elem); for (name in options) { elem.style[name] = old[name]; } return ret; }; var rboxStyle = new RegExp(cssExpand.join("|"), "i"); (function() { function computeStyleTests() { if (!div) { return; } container.style.cssText = "position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0"; div.style.cssText = "position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%"; documentElement.appendChild(container).appendChild(div); var divStyle = window2.getComputedStyle(div); pixelPositionVal = divStyle.top !== "1%"; reliableMarginLeftVal = roundPixelMeasures(divStyle.marginLeft) === 12; div.style.right = "60%"; pixelBoxStylesVal = roundPixelMeasures(divStyle.right) === 36; boxSizingReliableVal = roundPixelMeasures(divStyle.width) === 36; div.style.position = "absolute"; scrollboxSizeVal = roundPixelMeasures(div.offsetWidth / 3) === 12; documentElement.removeChild(container); div = null; } function roundPixelMeasures(measure) { return Math.round(parseFloat(measure)); } var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, reliableTrDimensionsVal, reliableMarginLeftVal, container = document2.createElement("div"), div = document2.createElement("div"); if (!div.style) { return; } div.style.backgroundClip = "content-box"; div.cloneNode(true).style.backgroundClip = ""; support.clearCloneStyle = div.style.backgroundClip === "content-box"; jQuery.extend(support, { boxSizingReliable: function() { computeStyleTests(); return boxSizingReliableVal; }, pixelBoxStyles: function() { computeStyleTests(); return pixelBoxStylesVal; }, pixelPosition: function() { computeStyleTests(); return pixelPositionVal; }, reliableMarginLeft: function() { computeStyleTests(); return reliableMarginLeftVal; }, scrollboxSize: function() { computeStyleTests(); return scrollboxSizeVal; }, // Support: IE 9 - 11+, Edge 15 - 18+ // IE/Edge misreport `getComputedStyle` of table rows with width/height // set in CSS while `offset*` properties report correct values. // Behavior in IE 9 is more subtle than in newer versions & it passes // some versions of this test; make sure not to make it pass there! // // Support: Firefox 70+ // Only Firefox includes border widths // in computed dimensions. (gh-4529) reliableTrDimensions: function() { var table, tr, trChild, trStyle; if (reliableTrDimensionsVal == null) { table = document2.createElement("table"); tr = document2.createElement("tr"); trChild = document2.createElement("div"); table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate"; tr.style.cssText = "box-sizing:content-box;border:1px solid"; tr.style.height = "1px"; trChild.style.height = "9px"; trChild.style.display = "block"; documentElement.appendChild(table).appendChild(tr).appendChild(trChild); trStyle = window2.getComputedStyle(tr); reliableTrDimensionsVal = parseInt(trStyle.height, 10) + parseInt(trStyle.borderTopWidth, 10) + parseInt(trStyle.borderBottomWidth, 10) === tr.offsetHeight; documentElement.removeChild(table); } return reliableTrDimensionsVal; } }); })(); function curCSS(elem, name, computed) { var width, minWidth, maxWidth, ret, isCustomProp = rcustomProp.test(name), style = elem.style; computed = computed || getStyles(elem); if (computed) { ret = computed.getPropertyValue(name) || computed[name]; if (isCustomProp && ret) { ret = ret.replace(rtrimCSS, "$1") || void 0; } if (ret === "" && !isAttached(elem)) { ret = jQuery.style(elem, name); } if (!support.pixelBoxStyles() && rnumnonpx.test(ret) && rboxStyle.test(name)) { width = style.width; minWidth = style.minWidth; maxWidth = style.maxWidth; style.minWidth = style.maxWidth = style.width = ret; ret = computed.width; style.width = width; style.minWidth = minWidth; style.maxWidth = maxWidth; } } return ret !== void 0 ? ( // Support: IE <=9 - 11 only // IE returns zIndex value as an integer. ret + "" ) : ret; } function addGetHookIf(conditionFn, hookFn) { return { get: function() { if (conditionFn()) { delete this.get; return; } return (this.get = hookFn).apply(this, arguments); } }; } var cssPrefixes = ["Webkit", "Moz", "ms"], emptyStyle = document2.createElement("div").style, vendorProps = {}; function vendorPropName(name) { var capName = name[0].toUpperCase() + name.slice(1), i = cssPrefixes.length; while (i--) { name = cssPrefixes[i] + capName; if (name in emptyStyle) { return name; } } } function finalPropName(name) { var final = jQuery.cssProps[name] || vendorProps[name]; if (final) { return final; } if (name in emptyStyle) { return name; } return vendorProps[name] = vendorPropName(name) || name; } var rdisplayswap = /^(none|table(?!-c[ea]).+)/, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = { letterSpacing: "0", fontWeight: "400" }; function setPositiveNumber(_elem, value, subtract2) { var matches = rcssNum.exec(value); return matches ? ( // Guard against undefined "subtract", e.g., when used as in cssHooks Math.max(0, matches[2] - (subtract2 || 0)) + (matches[3] || "px") ) : value; } function boxModelAdjustment(elem, dimension, box, isBorderBox, styles, computedVal) { var i = dimension === "width" ? 1 : 0, extra = 0, delta = 0, marginDelta = 0; if (box === (isBorderBox ? "border" : "content")) { return 0; } for (; i < 4; i += 2) { if (box === "margin") { marginDelta += jQuery.css(elem, box + cssExpand[i], true, styles); } if (!isBorderBox) { delta += jQuery.css(elem, "padding" + cssExpand[i], true, styles); if (box !== "padding") { delta += jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles); } else { extra += jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles); } } else { if (box === "content") { delta -= jQuery.css(elem, "padding" + cssExpand[i], true, styles); } if (box !== "margin") { delta -= jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles); } } } if (!isBorderBox && computedVal >= 0) { delta += Math.max(0, Math.ceil( elem["offset" + dimension[0].toUpperCase() + dimension.slice(1)] - computedVal - delta - extra - 0.5 // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter // Use an explicit zero to avoid NaN (gh-3964) )) || 0; } return delta + marginDelta; } function getWidthOrHeight(elem, dimension, extra) { var styles = getStyles(elem), boxSizingNeeded = !support.boxSizingReliable() || extra, isBorderBox = boxSizingNeeded && jQuery.css(elem, "boxSizing", false, styles) === "border-box", valueIsBorderBox = isBorderBox, val = curCSS(elem, dimension, styles), offsetProp = "offset" + dimension[0].toUpperCase() + dimension.slice(1); if (rnumnonpx.test(val)) { if (!extra) { return val; } val = "auto"; } if ((!support.boxSizingReliable() && isBorderBox || // Support: IE 10 - 11+, Edge 15 - 18+ // IE/Edge misreport `getComputedStyle` of table rows with width/height // set in CSS while `offset*` properties report correct values. // Interestingly, in some cases IE 9 doesn't suffer from this issue. !support.reliableTrDimensions() && nodeName(elem, "tr") || // Fall back to offsetWidth/offsetHeight when value is "auto" // This happens for inline elements with no explicit setting (gh-3571) val === "auto" || // Support: Android <=4.1 - 4.3 only // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) !parseFloat(val) && jQuery.css(elem, "display", false, styles) === "inline") && // Make sure the element is visible & connected elem.getClientRects().length) { isBorderBox = jQuery.css(elem, "boxSizing", false, styles) === "border-box"; valueIsBorderBox = offsetProp in elem; if (valueIsBorderBox) { val = elem[offsetProp]; } } val = parseFloat(val) || 0; return val + boxModelAdjustment( elem, dimension, extra || (isBorderBox ? "border" : "content"), valueIsBorderBox, styles, // Provide the current computed size to request scroll gutter calculation (gh-3589) val ) + "px"; } jQuery.extend({ // Add in style property hooks for overriding the default // behavior of getting and setting a style property cssHooks: { opacity: { get: function(elem, computed) { if (computed) { var ret = curCSS(elem, "opacity"); return ret === "" ? "1" : ret; } } } }, // Don't automatically add "px" to these possibly-unitless properties cssNumber: { animationIterationCount: true, aspectRatio: true, borderImageSlice: true, columnCount: true, flexGrow: true, flexShrink: true, fontWeight: true, gridArea: true, gridColumn: true, gridColumnEnd: true, gridColumnStart: true, gridRow: true, gridRowEnd: true, gridRowStart: true, lineHeight: true, opacity: true, order: true, orphans: true, scale: true, widows: true, zIndex: true, zoom: true, // SVG-related fillOpacity: true, floodOpacity: true, stopOpacity: true, strokeMiterlimit: true, strokeOpacity: true }, // Add in properties whose names you wish to fix before // setting or getting the value cssProps: {}, // Get and set the style property on a DOM Node style: function(elem, name, value, extra) { if (!elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style) { return; } var ret, type, hooks, origName = camelCase(name), isCustomProp = rcustomProp.test(name), style = elem.style; if (!isCustomProp) { name = finalPropName(origName); } hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName]; if (value !== void 0) { type = typeof value; if (type === "string" && (ret = rcssNum.exec(value)) && ret[1]) { value = adjustCSS(elem, name, ret); type = "number"; } if (value == null || value !== value) { return; } if (type === "number" && !isCustomProp) { value += ret && ret[3] || (jQuery.cssNumber[origName] ? "" : "px"); } if (!support.clearCloneStyle && value === "" && name.indexOf("background") === 0) { style[name] = "inherit"; } if (!hooks || !("set" in hooks) || (value = hooks.set(elem, value, extra)) !== void 0) { if (isCustomProp) { style.setProperty(name, value); } else { style[name] = value; } } } else { if (hooks && "get" in hooks && (ret = hooks.get(elem, false, extra)) !== void 0) { return ret; } return style[name]; } }, css: function(elem, name, extra, styles) { var val, num, hooks, origName = camelCase(name), isCustomProp = rcustomProp.test(name); if (!isCustomProp) { name = finalPropName(origName); } hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName]; if (hooks && "get" in hooks) { val = hooks.get(elem, true, extra); } if (val === void 0) { val = curCSS(elem, name, styles); } if (val === "normal" && name in cssNormalTransform) { val = cssNormalTransform[name]; } if (extra === "" || extra) { num = parseFloat(val); return extra === true || isFinite(num) ? num || 0 : val; } return val; } }); jQuery.each(["height", "width"], function(_i, dimension) { jQuery.cssHooks[dimension] = { get: function(elem, computed, extra) { if (computed) { return rdisplayswap.test(jQuery.css(elem, "display")) && // Support: Safari 8+ // Table columns in Safari have non-zero offsetWidth & zero // getBoundingClientRect().width unless display is changed. // Support: IE <=11 only // Running getBoundingClientRect on a disconnected node // in IE throws an error. (!elem.getClientRects().length || !elem.getBoundingClientRect().width) ? swap(elem, cssShow, function() { return getWidthOrHeight(elem, dimension, extra); }) : getWidthOrHeight(elem, dimension, extra); } }, set: function(elem, value, extra) { var matches, styles = getStyles(elem), scrollboxSizeBuggy = !support.scrollboxSize() && styles.position === "absolute", boxSizingNeeded = scrollboxSizeBuggy || extra, isBorderBox = boxSizingNeeded && jQuery.css(elem, "boxSizing", false, styles) === "border-box", subtract2 = extra ? boxModelAdjustment( elem, dimension, extra, isBorderBox, styles ) : 0; if (isBorderBox && scrollboxSizeBuggy) { subtract2 -= Math.ceil( elem["offset" + dimension[0].toUpperCase() + dimension.slice(1)] - parseFloat(styles[dimension]) - boxModelAdjustment(elem, dimension, "border", false, styles) - 0.5 ); } if (subtract2 && (matches = rcssNum.exec(value)) && (matches[3] || "px") !== "px") { elem.style[dimension] = value; value = jQuery.css(elem, dimension); } return setPositiveNumber(elem, value, subtract2); } }; }); jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, function(elem, computed) { if (computed) { return (parseFloat(curCSS(elem, "marginLeft")) || elem.getBoundingClientRect().left - swap(elem, { marginLeft: 0 }, function() { return elem.getBoundingClientRect().left; })) + "px"; } } ); jQuery.each({ margin: "", padding: "", border: "Width" }, function(prefix2, suffix) { jQuery.cssHooks[prefix2 + suffix] = { expand: function(value) { var i = 0, expanded = {}, parts = typeof value === "string" ? value.split(" ") : [value]; for (; i < 4; i++) { expanded[prefix2 + cssExpand[i] + suffix] = parts[i] || parts[i - 2] || parts[0]; } return expanded; } }; if (prefix2 !== "margin") { jQuery.cssHooks[prefix2 + suffix].set = setPositiveNumber; } }); jQuery.fn.extend({ css: function(name, value) { return access(this, function(elem, name2, value2) { var styles, len, map = {}, i = 0; if (Array.isArray(name2)) { styles = getStyles(elem); len = name2.length; for (; i < len; i++) { map[name2[i]] = jQuery.css(elem, name2[i], false, styles); } return map; } return value2 !== void 0 ? jQuery.style(elem, name2, value2) : jQuery.css(elem, name2); }, name, value, arguments.length > 1); } }); function Tween(elem, options, prop, end, easing) { return new Tween.prototype.init(elem, options, prop, end, easing); } jQuery.Tween = Tween; Tween.prototype = { constructor: Tween, init: function(elem, options, prop, end, easing, unit) { this.elem = elem; this.prop = prop; this.easing = easing || jQuery.easing._default; this.options = options; this.start = this.now = this.cur(); this.end = end; this.unit = unit || (jQuery.cssNumber[prop] ? "" : "px"); }, cur: function() { var hooks = Tween.propHooks[this.prop]; return hooks && hooks.get ? hooks.get(this) : Tween.propHooks._default.get(this); }, run: function(percent) { var eased, hooks = Tween.propHooks[this.prop]; if (this.options.duration) { this.pos = eased = jQuery.easing[this.easing]( percent, this.options.duration * percent, 0, 1, this.options.duration ); } else { this.pos = eased = percent; } this.now = (this.end - this.start) * eased + this.start; if (this.options.step) { this.options.step.call(this.elem, this.now, this); } if (hooks && hooks.set) { hooks.set(this); } else { Tween.propHooks._default.set(this); } return this; } }; Tween.prototype.init.prototype = Tween.prototype; Tween.propHooks = { _default: { get: function(tween) { var result; if (tween.elem.nodeType !== 1 || tween.elem[tween.prop] != null && tween.elem.style[tween.prop] == null) { return tween.elem[tween.prop]; } result = jQuery.css(tween.elem, tween.prop, ""); return !result || result === "auto" ? 0 : result; }, set: function(tween) { if (jQuery.fx.step[tween.prop]) { jQuery.fx.step[tween.prop](tween); } else if (tween.elem.nodeType === 1 && (jQuery.cssHooks[tween.prop] || tween.elem.style[finalPropName(tween.prop)] != null)) { jQuery.style(tween.elem, tween.prop, tween.now + tween.unit); } else { tween.elem[tween.prop] = tween.now; } } } }; Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { set: function(tween) { if (tween.elem.nodeType && tween.elem.parentNode) { tween.elem[tween.prop] = tween.now; } } }; jQuery.easing = { linear: function(p) { return p; }, swing: function(p) { return 0.5 - Math.cos(p * Math.PI) / 2; }, _default: "swing" }; jQuery.fx = Tween.prototype.init; jQuery.fx.step = {}; var fxNow, inProgress, rfxtypes = /^(?:toggle|show|hide)$/, rrun = /queueHooks$/; function schedule() { if (inProgress) { if (document2.hidden === false && window2.requestAnimationFrame) { window2.requestAnimationFrame(schedule); } else { window2.setTimeout(schedule, jQuery.fx.interval); } jQuery.fx.tick(); } } function createFxNow() { window2.setTimeout(function() { fxNow = void 0; }); return fxNow = Date.now(); } function genFx(type, includeWidth) { var which, i = 0, attrs = { height: type }; includeWidth = includeWidth ? 1 : 0; for (; i < 4; i += 2 - includeWidth) { which = cssExpand[i]; attrs["margin" + which] = attrs["padding" + which] = type; } if (includeWidth) { attrs.opacity = attrs.width = type; } return attrs; } function createTween(value, prop, animation) { var tween, collection = (Animation.tweeners[prop] || []).concat(Animation.tweeners["*"]), index = 0, length = collection.length; for (; index < length; index++) { if (tween = collection[index].call(animation, prop, value)) { return tween; } } } function defaultPrefilter(elem, props, opts) { var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, isBox = "width" in props || "height" in props, anim = this, orig = {}, style = elem.style, hidden = elem.nodeType && isHiddenWithinTree(elem), dataShow = dataPriv.get(elem, "fxshow"); if (!opts.queue) { hooks = jQuery._queueHooks(elem, "fx"); if (hooks.unqueued == null) { hooks.unqueued = 0; oldfire = hooks.empty.fire; hooks.empty.fire = function() { if (!hooks.unqueued) { oldfire(); } }; } hooks.unqueued++; anim.always(function() { anim.always(function() { hooks.unqueued--; if (!jQuery.queue(elem, "fx").length) { hooks.empty.fire(); } }); }); } for (prop in props) { value = props[prop]; if (rfxtypes.test(value)) { delete props[prop]; toggle = toggle || value === "toggle"; if (value === (hidden ? "hide" : "show")) { if (value === "show" && dataShow && dataShow[prop] !== void 0) { hidden = true; } else { continue; } } orig[prop] = dataShow && dataShow[prop] || jQuery.style(elem, prop); } } propTween = !jQuery.isEmptyObject(props); if (!propTween && jQuery.isEmptyObject(orig)) { return; } if (isBox && elem.nodeType === 1) { opts.overflow = [style.overflow, style.overflowX, style.overflowY]; restoreDisplay = dataShow && dataShow.display; if (restoreDisplay == null) { restoreDisplay = dataPriv.get(elem, "display"); } display = jQuery.css(elem, "display"); if (display === "none") { if (restoreDisplay) { display = restoreDisplay; } else { showHide([elem], true); restoreDisplay = elem.style.display || restoreDisplay; display = jQuery.css(elem, "display"); showHide([elem]); } } if (display === "inline" || display === "inline-block" && restoreDisplay != null) { if (jQuery.css(elem, "float") === "none") { if (!propTween) { anim.done(function() { style.display = restoreDisplay; }); if (restoreDisplay == null) { display = style.display; restoreDisplay = display === "none" ? "" : display; } } style.display = "inline-block"; } } } if (opts.overflow) { style.overflow = "hidden"; anim.always(function() { style.overflow = opts.overflow[0]; style.overflowX = opts.overflow[1]; style.overflowY = opts.overflow[2]; }); } propTween = false; for (prop in orig) { if (!propTween) { if (dataShow) { if ("hidden" in dataShow) { hidden = dataShow.hidden; } } else { dataShow = dataPriv.access(elem, "fxshow", { display: restoreDisplay }); } if (toggle) { dataShow.hidden = !hidden; } if (hidden) { showHide([elem], true); } anim.done(function() { if (!hidden) { showHide([elem]); } dataPriv.remove(elem, "fxshow"); for (prop in orig) { jQuery.style(elem, prop, orig[prop]); } }); } propTween = createTween(hidden ? dataShow[prop] : 0, prop, anim); if (!(prop in dataShow)) { dataShow[prop] = propTween.start; if (hidden) { propTween.end = propTween.start; propTween.start = 0; } } } } function propFilter(props, specialEasing) { var index, name, easing, value, hooks; for (index in props) { name = camelCase(index); easing = specialEasing[name]; value = props[index]; if (Array.isArray(value)) { easing = value[1]; value = props[index] = value[0]; } if (index !== name) { props[name] = value; delete props[index]; } hooks = jQuery.cssHooks[name]; if (hooks && "expand" in hooks) { value = hooks.expand(value); delete props[name]; for (index in value) { if (!(index in props)) { props[index] = value[index]; specialEasing[index] = easing; } } } else { specialEasing[name] = easing; } } } function Animation(elem, properties2, options) { var result, stopped, index = 0, length = Animation.prefilters.length, deferred = jQuery.Deferred().always(function() { delete tick.elem; }), tick = function() { if (stopped) { return false; } var currentTime = fxNow || createFxNow(), remaining = Math.max(0, animation.startTime + animation.duration - currentTime), temp = remaining / animation.duration || 0, percent = 1 - temp, index2 = 0, length2 = animation.tweens.length; for (; index2 < length2; index2++) { animation.tweens[index2].run(percent); } deferred.notifyWith(elem, [animation, percent, remaining]); if (percent < 1 && length2) { return remaining; } if (!length2) { deferred.notifyWith(elem, [animation, 1, 0]); } deferred.resolveWith(elem, [animation]); return false; }, animation = deferred.promise({ elem, props: jQuery.extend({}, properties2), opts: jQuery.extend(true, { specialEasing: {}, easing: jQuery.easing._default }, options), originalProperties: properties2, originalOptions: options, startTime: fxNow || createFxNow(), duration: options.duration, tweens: [], createTween: function(prop, end) { var tween = jQuery.Tween( elem, animation.opts, prop, end, animation.opts.specialEasing[prop] || animation.opts.easing ); animation.tweens.push(tween); return tween; }, stop: function(gotoEnd) { var index2 = 0, length2 = gotoEnd ? animation.tweens.length : 0; if (stopped) { return this; } stopped = true; for (; index2 < length2; index2++) { animation.tweens[index2].run(1); } if (gotoEnd) { deferred.notifyWith(elem, [animation, 1, 0]); deferred.resolveWith(elem, [animation, gotoEnd]); } else { deferred.rejectWith(elem, [animation, gotoEnd]); } return this; } }), props = animation.props; propFilter(props, animation.opts.specialEasing); for (; index < length; index++) { result = Animation.prefilters[index].call(animation, elem, props, animation.opts); if (result) { if (isFunction(result.stop)) { jQuery._queueHooks(animation.elem, animation.opts.queue).stop = result.stop.bind(result); } return result; } } jQuery.map(props, createTween, animation); if (isFunction(animation.opts.start)) { animation.opts.start.call(elem, animation); } animation.progress(animation.opts.progress).done(animation.opts.done, animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always); jQuery.fx.timer( jQuery.extend(tick, { elem, anim: animation, queue: animation.opts.queue }) ); return animation; } jQuery.Animation = jQuery.extend(Animation, { tweeners: { "*": [function(prop, value) { var tween = this.createTween(prop, value); adjustCSS(tween.elem, prop, rcssNum.exec(value), tween); return tween; }] }, tweener: function(props, callback) { if (isFunction(props)) { callback = props; props = ["*"]; } else { props = props.match(rnothtmlwhite); } var prop, index = 0, length = props.length; for (; index < length; index++) { prop = props[index]; Animation.tweeners[prop] = Animation.tweeners[prop] || []; Animation.tweeners[prop].unshift(callback); } }, prefilters: [defaultPrefilter], prefilter: function(callback, prepend) { if (prepend) { Animation.prefilters.unshift(callback); } else { Animation.prefilters.push(callback); } } }); jQuery.speed = function(speed, easing, fn) { var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : { complete: fn || !fn && easing || isFunction(speed) && speed, duration: speed, easing: fn && easing || easing && !isFunction(easing) && easing }; if (jQuery.fx.off) { opt.duration = 0; } else { if (typeof opt.duration !== "number") { if (opt.duration in jQuery.fx.speeds) { opt.duration = jQuery.fx.speeds[opt.duration]; } else { opt.duration = jQuery.fx.speeds._default; } } } if (opt.queue == null || opt.queue === true) { opt.queue = "fx"; } opt.old = opt.complete; opt.complete = function() { if (isFunction(opt.old)) { opt.old.call(this); } if (opt.queue) { jQuery.dequeue(this, opt.queue); } }; return opt; }; jQuery.fn.extend({ fadeTo: function(speed, to, easing, callback) { return this.filter(isHiddenWithinTree).css("opacity", 0).show().end().animate({ opacity: to }, speed, easing, callback); }, animate: function(prop, speed, easing, callback) { var empty = jQuery.isEmptyObject(prop), optall = jQuery.speed(speed, easing, callback), doAnimation = function() { var anim = Animation(this, jQuery.extend({}, prop), optall); if (empty || dataPriv.get(this, "finish")) { anim.stop(true); } }; doAnimation.finish = doAnimation; return empty || optall.queue === false ? this.each(doAnimation) : this.queue(optall.queue, doAnimation); }, stop: function(type, clearQueue, gotoEnd) { var stopQueue = function(hooks) { var stop = hooks.stop; delete hooks.stop; stop(gotoEnd); }; if (typeof type !== "string") { gotoEnd = clearQueue; clearQueue = type; type = void 0; } if (clearQueue) { this.queue(type || "fx", []); } return this.each(function() { var dequeue = true, index = type != null && type + "queueHooks", timers = jQuery.timers, data = dataPriv.get(this); if (index) { if (data[index] && data[index].stop) { stopQueue(data[index]); } } else { for (index in data) { if (data[index] && data[index].stop && rrun.test(index)) { stopQueue(data[index]); } } } for (index = timers.length; index--; ) { if (timers[index].elem === this && (type == null || timers[index].queue === type)) { timers[index].anim.stop(gotoEnd); dequeue = false; timers.splice(index, 1); } } if (dequeue || !gotoEnd) { jQuery.dequeue(this, type); } }); }, finish: function(type) { if (type !== false) { type = type || "fx"; } return this.each(function() { var index, data = dataPriv.get(this), queue = data[type + "queue"], hooks = data[type + "queueHooks"], timers = jQuery.timers, length = queue ? queue.length : 0; data.finish = true; jQuery.queue(this, type, []); if (hooks && hooks.stop) { hooks.stop.call(this, true); } for (index = timers.length; index--; ) { if (timers[index].elem === this && timers[index].queue === type) { timers[index].anim.stop(true); timers.splice(index, 1); } } for (index = 0; index < length; index++) { if (queue[index] && queue[index].finish) { queue[index].finish.call(this); } } delete data.finish; }); } }); jQuery.each(["toggle", "show", "hide"], function(_i, name) { var cssFn = jQuery.fn[name]; jQuery.fn[name] = function(speed, easing, callback) { return speed == null || typeof speed === "boolean" ? cssFn.apply(this, arguments) : this.animate(genFx(name, true), speed, easing, callback); }; }); jQuery.each({ slideDown: genFx("show"), slideUp: genFx("hide"), slideToggle: genFx("toggle"), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function(name, props) { jQuery.fn[name] = function(speed, easing, callback) { return this.animate(props, speed, easing, callback); }; }); jQuery.timers = []; jQuery.fx.tick = function() { var timer, i = 0, timers = jQuery.timers; fxNow = Date.now(); for (; i < timers.length; i++) { timer = timers[i]; if (!timer() && timers[i] === timer) { timers.splice(i--, 1); } } if (!timers.length) { jQuery.fx.stop(); } fxNow = void 0; }; jQuery.fx.timer = function(timer) { jQuery.timers.push(timer); jQuery.fx.start(); }; jQuery.fx.interval = 13; jQuery.fx.start = function() { if (inProgress) { return; } inProgress = true; schedule(); }; jQuery.fx.stop = function() { inProgress = null; }; jQuery.fx.speeds = { slow: 600, fast: 200, // Default speed _default: 400 }; jQuery.fn.delay = function(time, type) { time = jQuery.fx ? jQuery.fx.speeds[time] || time : time; type = type || "fx"; return this.queue(type, function(next, hooks) { var timeout = window2.setTimeout(next, time); hooks.stop = function() { window2.clearTimeout(timeout); }; }); }; (function() { var input = document2.createElement("input"), select = document2.createElement("select"), opt = select.appendChild(document2.createElement("option")); input.type = "checkbox"; support.checkOn = input.value !== ""; support.optSelected = opt.selected; input = document2.createElement("input"); input.value = "t"; input.type = "radio"; support.radioValue = input.value === "t"; })(); var boolHook, attrHandle = jQuery.expr.attrHandle; jQuery.fn.extend({ attr: function(name, value) { return access(this, jQuery.attr, name, value, arguments.length > 1); }, removeAttr: function(name) { return this.each(function() { jQuery.removeAttr(this, name); }); } }); jQuery.extend({ attr: function(elem, name, value) { var ret, hooks, nType = elem.nodeType; if (nType === 3 || nType === 8 || nType === 2) { return; } if (typeof elem.getAttribute === "undefined") { return jQuery.prop(elem, name, value); } if (nType !== 1 || !jQuery.isXMLDoc(elem)) { hooks = jQuery.attrHooks[name.toLowerCase()] || (jQuery.expr.match.bool.test(name) ? boolHook : void 0); } if (value !== void 0) { if (value === null) { jQuery.removeAttr(elem, name); return; } if (hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== void 0) { return ret; } elem.setAttribute(name, value + ""); return value; } if (hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null) { return ret; } ret = jQuery.find.attr(elem, name); return ret == null ? void 0 : ret; }, attrHooks: { type: { set: function(elem, value) { if (!support.radioValue && value === "radio" && nodeName(elem, "input")) { var val = elem.value; elem.setAttribute("type", value); if (val) { elem.value = val; } return value; } } } }, removeAttr: function(elem, value) { var name, i = 0, attrNames = value && value.match(rnothtmlwhite); if (attrNames && elem.nodeType === 1) { while (name = attrNames[i++]) { elem.removeAttribute(name); } } } }); boolHook = { set: function(elem, value, name) { if (value === false) { jQuery.removeAttr(elem, name); } else { elem.setAttribute(name, name); } return name; } }; jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g), function(_i, name) { var getter = attrHandle[name] || jQuery.find.attr; attrHandle[name] = function(elem, name2, isXML) { var ret, handle, lowercaseName = name2.toLowerCase(); if (!isXML) { handle = attrHandle[lowercaseName]; attrHandle[lowercaseName] = ret; ret = getter(elem, name2, isXML) != null ? lowercaseName : null; attrHandle[lowercaseName] = handle; } return ret; }; }); var rfocusable = /^(?:input|select|textarea|button)$/i, rclickable = /^(?:a|area)$/i; jQuery.fn.extend({ prop: function(name, value) { return access(this, jQuery.prop, name, value, arguments.length > 1); }, removeProp: function(name) { return this.each(function() { delete this[jQuery.propFix[name] || name]; }); } }); jQuery.extend({ prop: function(elem, name, value) { var ret, hooks, nType = elem.nodeType; if (nType === 3 || nType === 8 || nType === 2) { return; } if (nType !== 1 || !jQuery.isXMLDoc(elem)) { name = jQuery.propFix[name] || name; hooks = jQuery.propHooks[name]; } if (value !== void 0) { if (hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== void 0) { return ret; } return elem[name] = value; } if (hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null) { return ret; } return elem[name]; }, propHooks: { tabIndex: { get: function(elem) { var tabindex = jQuery.find.attr(elem, "tabindex"); if (tabindex) { return parseInt(tabindex, 10); } if (rfocusable.test(elem.nodeName) || rclickable.test(elem.nodeName) && elem.href) { return 0; } return -1; } } }, propFix: { "for": "htmlFor", "class": "className" } }); if (!support.optSelected) { jQuery.propHooks.selected = { get: function(elem) { var parent = elem.parentNode; if (parent && parent.parentNode) { parent.parentNode.selectedIndex; } return null; }, set: function(elem) { var parent = elem.parentNode; if (parent) { parent.selectedIndex; if (parent.parentNode) { parent.parentNode.selectedIndex; } } } }; } jQuery.each([ "tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable" ], function() { jQuery.propFix[this.toLowerCase()] = this; }); function stripAndCollapse(value) { var tokens = value.match(rnothtmlwhite) || []; return tokens.join(" "); } function getClass(elem) { return elem.getAttribute && elem.getAttribute("class") || ""; } function classesToArray(value) { if (Array.isArray(value)) { return value; } if (typeof value === "string") { return value.match(rnothtmlwhite) || []; } return []; } jQuery.fn.extend({ addClass: function(value) { var classNames, cur, curValue, className, i, finalValue; if (isFunction(value)) { return this.each(function(j) { jQuery(this).addClass(value.call(this, j, getClass(this))); }); } classNames = classesToArray(value); if (classNames.length) { return this.each(function() { curValue = getClass(this); cur = this.nodeType === 1 && " " + stripAndCollapse(curValue) + " "; if (cur) { for (i = 0; i < classNames.length; i++) { className = classNames[i]; if (cur.indexOf(" " + className + " ") < 0) { cur += className + " "; } } finalValue = stripAndCollapse(cur); if (curValue !== finalValue) { this.setAttribute("class", finalValue); } } }); } return this; }, removeClass: function(value) { var classNames, cur, curValue, className, i, finalValue; if (isFunction(value)) { return this.each(function(j) { jQuery(this).removeClass(value.call(this, j, getClass(this))); }); } if (!arguments.length) { return this.attr("class", ""); } classNames = classesToArray(value); if (classNames.length) { return this.each(function() { curValue = getClass(this); cur = this.nodeType === 1 && " " + stripAndCollapse(curValue) + " "; if (cur) { for (i = 0; i < classNames.length; i++) { className = classNames[i]; while (cur.indexOf(" " + className + " ") > -1) { cur = cur.replace(" " + className + " ", " "); } } finalValue = stripAndCollapse(cur); if (curValue !== finalValue) { this.setAttribute("class", finalValue); } } }); } return this; }, toggleClass: function(value, stateVal) { var classNames, className, i, self2, type = typeof value, isValidValue = type === "string" || Array.isArray(value); if (isFunction(value)) { return this.each(function(i2) { jQuery(this).toggleClass( value.call(this, i2, getClass(this), stateVal), stateVal ); }); } if (typeof stateVal === "boolean" && isValidValue) { return stateVal ? this.addClass(value) : this.removeClass(value); } classNames = classesToArray(value); return this.each(function() { if (isValidValue) { self2 = jQuery(this); for (i = 0; i < classNames.length; i++) { className = classNames[i]; if (self2.hasClass(className)) { self2.removeClass(className); } else { self2.addClass(className); } } } else if (value === void 0 || type === "boolean") { className = getClass(this); if (className) { dataPriv.set(this, "__className__", className); } if (this.setAttribute) { this.setAttribute( "class", className || value === false ? "" : dataPriv.get(this, "__className__") || "" ); } } }); }, hasClass: function(selector) { var className, elem, i = 0; className = " " + selector + " "; while (elem = this[i++]) { if (elem.nodeType === 1 && (" " + stripAndCollapse(getClass(elem)) + " ").indexOf(className) > -1) { return true; } } return false; } }); var rreturn = /\r/g; jQuery.fn.extend({ val: function(value) { var hooks, ret, valueIsFunction, elem = this[0]; if (!arguments.length) { if (elem) { hooks = jQuery.valHooks[elem.type] || jQuery.valHooks[elem.nodeName.toLowerCase()]; if (hooks && "get" in hooks && (ret = hooks.get(elem, "value")) !== void 0) { return ret; } ret = elem.value; if (typeof ret === "string") { return ret.replace(rreturn, ""); } return ret == null ? "" : ret; } return; } valueIsFunction = isFunction(value); return this.each(function(i) { var val; if (this.nodeType !== 1) { return; } if (valueIsFunction) { val = value.call(this, i, jQuery(this).val()); } else { val = value; } if (val == null) { val = ""; } else if (typeof val === "number") { val += ""; } else if (Array.isArray(val)) { val = jQuery.map(val, function(value2) { return value2 == null ? "" : value2 + ""; }); } hooks = jQuery.valHooks[this.type] || jQuery.valHooks[this.nodeName.toLowerCase()]; if (!hooks || !("set" in hooks) || hooks.set(this, val, "value") === void 0) { this.value = val; } }); } }); jQuery.extend({ valHooks: { option: { get: function(elem) { var val = jQuery.find.attr(elem, "value"); return val != null ? val : ( // Support: IE <=10 - 11 only // option.text throws exceptions (trac-14686, trac-14858) // Strip and collapse whitespace // https://html.spec.whatwg.org/#strip-and-collapse-whitespace stripAndCollapse(jQuery.text(elem)) ); } }, select: { get: function(elem) { var value, option, i, options = elem.options, index = elem.selectedIndex, one = elem.type === "select-one", values = one ? null : [], max = one ? index + 1 : options.length; if (index < 0) { i = max; } else { i = one ? index : 0; } for (; i < max; i++) { option = options[i]; if ((option.selected || i === index) && // Don't return options that are disabled or in a disabled optgroup !option.disabled && (!option.parentNode.disabled || !nodeName(option.parentNode, "optgroup"))) { value = jQuery(option).val(); if (one) { return value; } values.push(value); } } return values; }, set: function(elem, value) { var optionSet, option, options = elem.options, values = jQuery.makeArray(value), i = options.length; while (i--) { option = options[i]; if (option.selected = jQuery.inArray(jQuery.valHooks.option.get(option), values) > -1) { optionSet = true; } } if (!optionSet) { elem.selectedIndex = -1; } return values; } } } }); jQuery.each(["radio", "checkbox"], function() { jQuery.valHooks[this] = { set: function(elem, value) { if (Array.isArray(value)) { return elem.checked = jQuery.inArray(jQuery(elem).val(), value) > -1; } } }; if (!support.checkOn) { jQuery.valHooks[this].get = function(elem) { return elem.getAttribute("value") === null ? "on" : elem.value; }; } }); var location = window2.location; var nonce = { guid: Date.now() }; var rquery = /\?/; jQuery.parseXML = function(data) { var xml, parserErrorElem; if (!data || typeof data !== "string") { return null; } try { xml = new window2.DOMParser().parseFromString(data, "text/xml"); } catch (e) { } parserErrorElem = xml && xml.getElementsByTagName("parsererror")[0]; if (!xml || parserErrorElem) { jQuery.error("Invalid XML: " + (parserErrorElem ? jQuery.map(parserErrorElem.childNodes, function(el) { return el.textContent; }).join("\n") : data)); } return xml; }; var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, stopPropagationCallback = function(e) { e.stopPropagation(); }; jQuery.extend(jQuery.event, { trigger: function(event, data, elem, onlyHandlers) { var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, eventPath = [elem || document2], type = hasOwn.call(event, "type") ? event.type : event, namespaces = hasOwn.call(event, "namespace") ? event.namespace.split(".") : []; cur = lastElement = tmp = elem = elem || document2; if (elem.nodeType === 3 || elem.nodeType === 8) { return; } if (rfocusMorph.test(type + jQuery.event.triggered)) { return; } if (type.indexOf(".") > -1) { namespaces = type.split("."); type = namespaces.shift(); namespaces.sort(); } ontype = type.indexOf(":") < 0 && "on" + type; event = event[jQuery.expando] ? event : new jQuery.Event(type, typeof event === "object" && event); event.isTrigger = onlyHandlers ? 2 : 3; event.namespace = namespaces.join("."); event.rnamespace = event.namespace ? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null; event.result = void 0; if (!event.target) { event.target = elem; } data = data == null ? [event] : jQuery.makeArray(data, [event]); special = jQuery.event.special[type] || {}; if (!onlyHandlers && special.trigger && special.trigger.apply(elem, data) === false) { return; } if (!onlyHandlers && !special.noBubble && !isWindow2(elem)) { bubbleType = special.delegateType || type; if (!rfocusMorph.test(bubbleType + type)) { cur = cur.parentNode; } for (; cur; cur = cur.parentNode) { eventPath.push(cur); tmp = cur; } if (tmp === (elem.ownerDocument || document2)) { eventPath.push(tmp.defaultView || tmp.parentWindow || window2); } } i = 0; while ((cur = eventPath[i++]) && !event.isPropagationStopped()) { lastElement = cur; event.type = i > 1 ? bubbleType : special.bindType || type; handle = (dataPriv.get(cur, "events") || /* @__PURE__ */ Object.create(null))[event.type] && dataPriv.get(cur, "handle"); if (handle) { handle.apply(cur, data); } handle = ontype && cur[ontype]; if (handle && handle.apply && acceptData(cur)) { event.result = handle.apply(cur, data); if (event.result === false) { event.preventDefault(); } } } event.type = type; if (!onlyHandlers && !event.isDefaultPrevented()) { if ((!special._default || special._default.apply(eventPath.pop(), data) === false) && acceptData(elem)) { if (ontype && isFunction(elem[type]) && !isWindow2(elem)) { tmp = elem[ontype]; if (tmp) { elem[ontype] = null; } jQuery.event.triggered = type; if (event.isPropagationStopped()) { lastElement.addEventListener(type, stopPropagationCallback); } elem[type](); if (event.isPropagationStopped()) { lastElement.removeEventListener(type, stopPropagationCallback); } jQuery.event.triggered = void 0; if (tmp) { elem[ontype] = tmp; } } } } return event.result; }, // Piggyback on a donor event to simulate a different one // Used only for `focus(in | out)` events simulate: function(type, elem, event) { var e = jQuery.extend( new jQuery.Event(), event, { type, isSimulated: true } ); jQuery.event.trigger(e, null, elem); } }); jQuery.fn.extend({ trigger: function(type, data) { return this.each(function() { jQuery.event.trigger(type, data, this); }); }, triggerHandler: function(type, data) { var elem = this[0]; if (elem) { return jQuery.event.trigger(type, data, elem, true); } } }); var rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i; function buildParams(prefix2, obj, traditional, add2) { var name; if (Array.isArray(obj)) { jQuery.each(obj, function(i, v) { if (traditional || rbracket.test(prefix2)) { add2(prefix2, v); } else { buildParams( prefix2 + "[" + (typeof v === "object" && v != null ? i : "") + "]", v, traditional, add2 ); } }); } else if (!traditional && toType(obj) === "object") { for (name in obj) { buildParams(prefix2 + "[" + name + "]", obj[name], traditional, add2); } } else { add2(prefix2, obj); } } jQuery.param = function(a, traditional) { var prefix2, s2 = [], add2 = function(key2, valueOrFunction) { var value = isFunction(valueOrFunction) ? valueOrFunction() : valueOrFunction; s2[s2.length] = encodeURIComponent(key2) + "=" + encodeURIComponent(value == null ? "" : value); }; if (a == null) { return ""; } if (Array.isArray(a) || a.jquery && !jQuery.isPlainObject(a)) { jQuery.each(a, function() { add2(this.name, this.value); }); } else { for (prefix2 in a) { buildParams(prefix2, a[prefix2], traditional, add2); } } return s2.join("&"); }; jQuery.fn.extend({ serialize: function() { return jQuery.param(this.serializeArray()); }, serializeArray: function() { return this.map(function() { var elements = jQuery.prop(this, "elements"); return elements ? jQuery.makeArray(elements) : this; }).filter(function() { var type = this.type; return this.name && !jQuery(this).is(":disabled") && rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type) && (this.checked || !rcheckableType.test(type)); }).map(function(_i, elem) { var val = jQuery(this).val(); if (val == null) { return null; } if (Array.isArray(val)) { return jQuery.map(val, function(val2) { return { name: elem.name, value: val2.replace(rCRLF, "\r\n") }; }); } return { name: elem.name, value: val.replace(rCRLF, "\r\n") }; }).get(); } }); var r20 = /%20/g, rhash = /#.*$/, rantiCache = /([?&])_=[^&]*/, rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, prefilters = {}, transports = {}, allTypes = "*/".concat("*"), originAnchor = document2.createElement("a"); originAnchor.href = location.href; function addToPrefiltersOrTransports(structure) { return function(dataTypeExpression, func) { if (typeof dataTypeExpression !== "string") { func = dataTypeExpression; dataTypeExpression = "*"; } var dataType, i = 0, dataTypes = dataTypeExpression.toLowerCase().match(rnothtmlwhite) || []; if (isFunction(func)) { while (dataType = dataTypes[i++]) { if (dataType[0] === "+") { dataType = dataType.slice(1) || "*"; (structure[dataType] = structure[dataType] || []).unshift(func); } else { (structure[dataType] = structure[dataType] || []).push(func); } } } }; } function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR) { var inspected = {}, seekingTransport = structure === transports; function inspect(dataType) { var selected; inspected[dataType] = true; jQuery.each(structure[dataType] || [], function(_18, prefilterOrFactory) { var dataTypeOrTransport = prefilterOrFactory(options, originalOptions, jqXHR); if (typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[dataTypeOrTransport]) { options.dataTypes.unshift(dataTypeOrTransport); inspect(dataTypeOrTransport); return false; } else if (seekingTransport) { return !(selected = dataTypeOrTransport); } }); return selected; } return inspect(options.dataTypes[0]) || !inspected["*"] && inspect("*"); } function ajaxExtend(target, src) { var key2, deep, flatOptions = jQuery.ajaxSettings.flatOptions || {}; for (key2 in src) { if (src[key2] !== void 0) { (flatOptions[key2] ? target : deep || (deep = {}))[key2] = src[key2]; } } if (deep) { jQuery.extend(true, target, deep); } return target; } function ajaxHandleResponses(s2, jqXHR, responses) { var ct, type, finalDataType, firstDataType, contents = s2.contents, dataTypes = s2.dataTypes; while (dataTypes[0] === "*") { dataTypes.shift(); if (ct === void 0) { ct = s2.mimeType || jqXHR.getResponseHeader("Content-Type"); } } if (ct) { for (type in contents) { if (contents[type] && contents[type].test(ct)) { dataTypes.unshift(type); break; } } } if (dataTypes[0] in responses) { finalDataType = dataTypes[0]; } else { for (type in responses) { if (!dataTypes[0] || s2.converters[type + " " + dataTypes[0]]) { finalDataType = type; break; } if (!firstDataType) { firstDataType = type; } } finalDataType = finalDataType || firstDataType; } if (finalDataType) { if (finalDataType !== dataTypes[0]) { dataTypes.unshift(finalDataType); } return responses[finalDataType]; } } function ajaxConvert(s2, response, jqXHR, isSuccess) { var conv2, current2, conv, tmp, prev, converters = {}, dataTypes = s2.dataTypes.slice(); if (dataTypes[1]) { for (conv in s2.converters) { converters[conv.toLowerCase()] = s2.converters[conv]; } } current2 = dataTypes.shift(); while (current2) { if (s2.responseFields[current2]) { jqXHR[s2.responseFields[current2]] = response; } if (!prev && isSuccess && s2.dataFilter) { response = s2.dataFilter(response, s2.dataType); } prev = current2; current2 = dataTypes.shift(); if (current2) { if (current2 === "*") { current2 = prev; } else if (prev !== "*" && prev !== current2) { conv = converters[prev + " " + current2] || converters["* " + current2]; if (!conv) { for (conv2 in converters) { tmp = conv2.split(" "); if (tmp[1] === current2) { conv = converters[prev + " " + tmp[0]] || converters["* " + tmp[0]]; if (conv) { if (conv === true) { conv = converters[conv2]; } else if (converters[conv2] !== true) { current2 = tmp[0]; dataTypes.unshift(tmp[1]); } break; } } } } if (conv !== true) { if (conv && s2.throws) { response = conv(response); } else { try { response = conv(response); } catch (e) { return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current2 }; } } } } } } return { state: "success", data: response }; } jQuery.extend({ // Counter for holding the number of active queries active: 0, // Last-Modified header cache for next request lastModified: {}, etag: {}, ajaxSettings: { url: location.href, type: "GET", isLocal: rlocalProtocol.test(location.protocol), global: true, processData: true, async: true, contentType: "application/x-www-form-urlencoded; charset=UTF-8", /* timeout: 0, data: null, dataType: null, username: null, password: null, cache: null, throws: false, traditional: false, headers: {}, */ accepts: { "*": allTypes, text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript" }, contents: { xml: /\bxml\b/, html: /\bhtml/, json: /\bjson\b/ }, responseFields: { xml: "responseXML", text: "responseText", json: "responseJSON" }, // Data converters // Keys separate source (or catchall "*") and destination types with a single space converters: { // Convert anything to text "* text": String, // Text to html (true = no transformation) "text html": true, // Evaluate text as a json expression "text json": JSON.parse, // Parse text as xml "text xml": jQuery.parseXML }, // For options that shouldn't be deep extended: // you can add your own custom options here if // and when you create one that shouldn't be // deep extended (see ajaxExtend) flatOptions: { url: true, context: true } }, // Creates a full fledged settings object into target // with both ajaxSettings and settings fields. // If target is omitted, writes into ajaxSettings. ajaxSetup: function(target, settings) { return settings ? ( // Building a settings object ajaxExtend(ajaxExtend(target, jQuery.ajaxSettings), settings) ) : ( // Extending ajaxSettings ajaxExtend(jQuery.ajaxSettings, target) ); }, ajaxPrefilter: addToPrefiltersOrTransports(prefilters), ajaxTransport: addToPrefiltersOrTransports(transports), // Main method ajax: function(url, options) { if (typeof url === "object") { options = url; url = void 0; } options = options || {}; var transport, cacheURL, responseHeadersString, responseHeaders, timeoutTimer, urlAnchor, completed3, fireGlobals, i, uncached, s2 = jQuery.ajaxSetup({}, options), callbackContext = s2.context || s2, globalEventContext = s2.context && (callbackContext.nodeType || callbackContext.jquery) ? jQuery(callbackContext) : jQuery.event, deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks("once memory"), statusCode = s2.statusCode || {}, requestHeaders = {}, requestHeadersNames = {}, strAbort = "canceled", jqXHR = { readyState: 0, // Builds headers hashtable if needed getResponseHeader: function(key2) { var match2; if (completed3) { if (!responseHeaders) { responseHeaders = {}; while (match2 = rheaders.exec(responseHeadersString)) { responseHeaders[match2[1].toLowerCase() + " "] = (responseHeaders[match2[1].toLowerCase() + " "] || []).concat(match2[2]); } } match2 = responseHeaders[key2.toLowerCase() + " "]; } return match2 == null ? null : match2.join(", "); }, // Raw string getAllResponseHeaders: function() { return completed3 ? responseHeadersString : null; }, // Caches the header setRequestHeader: function(name, value) { if (completed3 == null) { name = requestHeadersNames[name.toLowerCase()] = requestHeadersNames[name.toLowerCase()] || name; requestHeaders[name] = value; } return this; }, // Overrides response content-type header overrideMimeType: function(type) { if (completed3 == null) { s2.mimeType = type; } return this; }, // Status-dependent callbacks statusCode: function(map) { var code; if (map) { if (completed3) { jqXHR.always(map[jqXHR.status]); } else { for (code in map) { statusCode[code] = [statusCode[code], map[code]]; } } } return this; }, // Cancel the request abort: function(statusText) { var finalText = statusText || strAbort; if (transport) { transport.abort(finalText); } done(0, finalText); return this; } }; deferred.promise(jqXHR); s2.url = ((url || s2.url || location.href) + "").replace(rprotocol, location.protocol + "//"); s2.type = options.method || options.type || s2.method || s2.type; s2.dataTypes = (s2.dataType || "*").toLowerCase().match(rnothtmlwhite) || [""]; if (s2.crossDomain == null) { urlAnchor = document2.createElement("a"); try { urlAnchor.href = s2.url; urlAnchor.href = urlAnchor.href; s2.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== urlAnchor.protocol + "//" + urlAnchor.host; } catch (e) { s2.crossDomain = true; } } if (s2.data && s2.processData && typeof s2.data !== "string") { s2.data = jQuery.param(s2.data, s2.traditional); } inspectPrefiltersOrTransports(prefilters, s2, options, jqXHR); if (completed3) { return jqXHR; } fireGlobals = jQuery.event && s2.global; if (fireGlobals && jQuery.active++ === 0) { jQuery.event.trigger("ajaxStart"); } s2.type = s2.type.toUpperCase(); s2.hasContent = !rnoContent.test(s2.type); cacheURL = s2.url.replace(rhash, ""); if (!s2.hasContent) { uncached = s2.url.slice(cacheURL.length); if (s2.data && (s2.processData || typeof s2.data === "string")) { cacheURL += (rquery.test(cacheURL) ? "&" : "?") + s2.data; delete s2.data; } if (s2.cache === false) { cacheURL = cacheURL.replace(rantiCache, "$1"); uncached = (rquery.test(cacheURL) ? "&" : "?") + "_=" + nonce.guid++ + uncached; } s2.url = cacheURL + uncached; } else if (s2.data && s2.processData && (s2.contentType || "").indexOf("application/x-www-form-urlencoded") === 0) { s2.data = s2.data.replace(r20, "+"); } if (s2.ifModified) { if (jQuery.lastModified[cacheURL]) { jqXHR.setRequestHeader("If-Modified-Since", jQuery.lastModified[cacheURL]); } if (jQuery.etag[cacheURL]) { jqXHR.setRequestHeader("If-None-Match", jQuery.etag[cacheURL]); } } if (s2.data && s2.hasContent && s2.contentType !== false || options.contentType) { jqXHR.setRequestHeader("Content-Type", s2.contentType); } jqXHR.setRequestHeader( "Accept", s2.dataTypes[0] && s2.accepts[s2.dataTypes[0]] ? s2.accepts[s2.dataTypes[0]] + (s2.dataTypes[0] !== "*" ? ", " + allTypes + "; q=0.01" : "") : s2.accepts["*"] ); for (i in s2.headers) { jqXHR.setRequestHeader(i, s2.headers[i]); } if (s2.beforeSend && (s2.beforeSend.call(callbackContext, jqXHR, s2) === false || completed3)) { return jqXHR.abort(); } strAbort = "abort"; completeDeferred.add(s2.complete); jqXHR.done(s2.success); jqXHR.fail(s2.error); transport = inspectPrefiltersOrTransports(transports, s2, options, jqXHR); if (!transport) { done(-1, "No Transport"); } else { jqXHR.readyState = 1; if (fireGlobals) { globalEventContext.trigger("ajaxSend", [jqXHR, s2]); } if (completed3) { return jqXHR; } if (s2.async && s2.timeout > 0) { timeoutTimer = window2.setTimeout(function() { jqXHR.abort("timeout"); }, s2.timeout); } try { completed3 = false; transport.send(requestHeaders, done); } catch (e) { if (completed3) { throw e; } done(-1, e); } } function done(status, nativeStatusText, responses, headers) { var isSuccess, success, error, response, modified, statusText = nativeStatusText; if (completed3) { return; } completed3 = true; if (timeoutTimer) { window2.clearTimeout(timeoutTimer); } transport = void 0; responseHeadersString = headers || ""; jqXHR.readyState = status > 0 ? 4 : 0; isSuccess = status >= 200 && status < 300 || status === 304; if (responses) { response = ajaxHandleResponses(s2, jqXHR, responses); } if (!isSuccess && jQuery.inArray("script", s2.dataTypes) > -1 && jQuery.inArray("json", s2.dataTypes) < 0) { s2.converters["text script"] = function() { }; } response = ajaxConvert(s2, response, jqXHR, isSuccess); if (isSuccess) { if (s2.ifModified) { modified = jqXHR.getResponseHeader("Last-Modified"); if (modified) { jQuery.lastModified[cacheURL] = modified; } modified = jqXHR.getResponseHeader("etag"); if (modified) { jQuery.etag[cacheURL] = modified; } } if (status === 204 || s2.type === "HEAD") { statusText = "nocontent"; } else if (status === 304) { statusText = "notmodified"; } else { statusText = response.state; success = response.data; error = response.error; isSuccess = !error; } } else { error = statusText; if (status || !statusText) { statusText = "error"; if (status < 0) { status = 0; } } } jqXHR.status = status; jqXHR.statusText = (nativeStatusText || statusText) + ""; if (isSuccess) { deferred.resolveWith(callbackContext, [success, statusText, jqXHR]); } else { deferred.rejectWith(callbackContext, [jqXHR, statusText, error]); } jqXHR.statusCode(statusCode); statusCode = void 0; if (fireGlobals) { globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", [jqXHR, s2, isSuccess ? success : error] ); } completeDeferred.fireWith(callbackContext, [jqXHR, statusText]); if (fireGlobals) { globalEventContext.trigger("ajaxComplete", [jqXHR, s2]); if (!--jQuery.active) { jQuery.event.trigger("ajaxStop"); } } } return jqXHR; }, getJSON: function(url, data, callback) { return jQuery.get(url, data, callback, "json"); }, getScript: function(url, callback) { return jQuery.get(url, void 0, callback, "script"); } }); jQuery.each(["get", "post"], function(_i, method) { jQuery[method] = function(url, data, callback, type) { if (isFunction(data)) { type = type || callback; callback = data; data = void 0; } return jQuery.ajax(jQuery.extend({ url, type: method, dataType: type, data, success: callback }, jQuery.isPlainObject(url) && url)); }; }); jQuery.ajaxPrefilter(function(s2) { var i; for (i in s2.headers) { if (i.toLowerCase() === "content-type") { s2.contentType = s2.headers[i] || ""; } } }); jQuery._evalUrl = function(url, options, doc) { return jQuery.ajax({ url, // Make this explicit, since user can override this through ajaxSetup (trac-11264) type: "GET", dataType: "script", cache: true, async: false, global: false, // Only evaluate the response if it is successful (gh-4126) // dataFilter is not invoked for failure responses, so using it instead // of the default converter is kludgy but it works. converters: { "text script": function() { } }, dataFilter: function(response) { jQuery.globalEval(response, options, doc); } }); }; jQuery.fn.extend({ wrapAll: function(html) { var wrap; if (this[0]) { if (isFunction(html)) { html = html.call(this[0]); } wrap = jQuery(html, this[0].ownerDocument).eq(0).clone(true); if (this[0].parentNode) { wrap.insertBefore(this[0]); } wrap.map(function() { var elem = this; while (elem.firstElementChild) { elem = elem.firstElementChild; } return elem; }).append(this); } return this; }, wrapInner: function(html) { if (isFunction(html)) { return this.each(function(i) { jQuery(this).wrapInner(html.call(this, i)); }); } return this.each(function() { var self2 = jQuery(this), contents = self2.contents(); if (contents.length) { contents.wrapAll(html); } else { self2.append(html); } }); }, wrap: function(html) { var htmlIsFunction = isFunction(html); return this.each(function(i) { jQuery(this).wrapAll(htmlIsFunction ? html.call(this, i) : html); }); }, unwrap: function(selector) { this.parent(selector).not("body").each(function() { jQuery(this).replaceWith(this.childNodes); }); return this; } }); jQuery.expr.pseudos.hidden = function(elem) { return !jQuery.expr.pseudos.visible(elem); }; jQuery.expr.pseudos.visible = function(elem) { return !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length); }; jQuery.ajaxSettings.xhr = function() { try { return new window2.XMLHttpRequest(); } catch (e) { } }; var xhrSuccessStatus = { // File protocol always yields status code 0, assume 200 0: 200, // Support: IE <=9 only // trac-1450: sometimes IE returns 1223 when it should be 204 1223: 204 }, xhrSupported = jQuery.ajaxSettings.xhr(); support.cors = !!xhrSupported && "withCredentials" in xhrSupported; support.ajax = xhrSupported = !!xhrSupported; jQuery.ajaxTransport(function(options) { var callback, errorCallback; if (support.cors || xhrSupported && !options.crossDomain) { return { send: function(headers, complete) { var i, xhr = options.xhr(); xhr.open( options.type, options.url, options.async, options.username, options.password ); if (options.xhrFields) { for (i in options.xhrFields) { xhr[i] = options.xhrFields[i]; } } if (options.mimeType && xhr.overrideMimeType) { xhr.overrideMimeType(options.mimeType); } if (!options.crossDomain && !headers["X-Requested-With"]) { headers["X-Requested-With"] = "XMLHttpRequest"; } for (i in headers) { xhr.setRequestHeader(i, headers[i]); } callback = function(type) { return function() { if (callback) { callback = errorCallback = xhr.onload = xhr.onerror = xhr.onabort = xhr.ontimeout = xhr.onreadystatechange = null; if (type === "abort") { xhr.abort(); } else if (type === "error") { if (typeof xhr.status !== "number") { complete(0, "error"); } else { complete( // File: protocol always yields status 0; see trac-8605, trac-14207 xhr.status, xhr.statusText ); } } else { complete( xhrSuccessStatus[xhr.status] || xhr.status, xhr.statusText, // Support: IE <=9 only // IE9 has no XHR2 but throws on binary (trac-11426) // For XHR2 non-text, let the caller handle it (gh-2498) (xhr.responseType || "text") !== "text" || typeof xhr.responseText !== "string" ? { binary: xhr.response } : { text: xhr.responseText }, xhr.getAllResponseHeaders() ); } } }; }; xhr.onload = callback(); errorCallback = xhr.onerror = xhr.ontimeout = callback("error"); if (xhr.onabort !== void 0) { xhr.onabort = errorCallback; } else { xhr.onreadystatechange = function() { if (xhr.readyState === 4) { window2.setTimeout(function() { if (callback) { errorCallback(); } }); } }; } callback = callback("abort"); try { xhr.send(options.hasContent && options.data || null); } catch (e) { if (callback) { throw e; } } }, abort: function() { if (callback) { callback(); } } }; } }); jQuery.ajaxPrefilter(function(s2) { if (s2.crossDomain) { s2.contents.script = false; } }); jQuery.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /\b(?:java|ecma)script\b/ }, converters: { "text script": function(text) { jQuery.globalEval(text); return text; } } }); jQuery.ajaxPrefilter("script", function(s2) { if (s2.cache === void 0) { s2.cache = false; } if (s2.crossDomain) { s2.type = "GET"; } }); jQuery.ajaxTransport("script", function(s2) { if (s2.crossDomain || s2.scriptAttrs) { var script, callback; return { send: function(_18, complete) { script = jQuery("