diff --git a/README.md b/README.md index 8c0ef6e2f..e4e55b66c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/R6R53OEFF) -# Tempus Dominus Date/Time Picker v6.4.4 +# Tempus Dominus Date/Time Picker v6.7.7 Tempus Dominus is a powerful and robust date time picker for javascript. Version 6 is another major rewrite over the previous version. V6 is written with modern browsers in mind and is written in typescript. Bootstrap, momentjs and jQuery are no longer required dependencies. Popper2 is all that is required for the picker to position correctly. If you still require jQuery (seriously, you should move off that asap) there's a jQuery provider that wraps the native js functions. diff --git a/dist/js/tempus-dominus.esm.js b/dist/js/tempus-dominus.esm.js index 6181fa0f8..98be0f6a2 100644 --- a/dist/js/tempus-dominus.esm.js +++ b/dist/js/tempus-dominus.esm.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.4.4 (https://getdatepicker.com/) + * Tempus Dominus v6.7.7 (https://getdatepicker.com/) * Copyright 2013-2023 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ @@ -1414,12 +1414,12 @@ class Validation { if (dates.length !== 2 && index !== 1) return true; // initialize start date - const start = dates[0]; + const start = dates[0].clone; // check if start date is not the same as target date if (start.isSame(target, Unit.date)) return true; // add one day to start; start has already been validated - start.clone.manipulate(1, Unit.date); + start.manipulate(1, Unit.date); // check each date in the range to make sure it's valid while (!start.isSame(target, Unit.date)) { const valid = this.isValid(start, Unit.date); @@ -2055,13 +2055,13 @@ class Dates { * Returns the array of selected dates */ get picked() { - return this._dates; + return [...this._dates]; } /** * Returns the last picked value. */ get lastPicked() { - return this._dates[this.lastPickedIndex]; + return this._dates[this.lastPickedIndex]?.clone; } /** * Returns the length of picked dates -1 or 0 if none are selected. @@ -2197,7 +2197,7 @@ class Dates { */ setValue(target, index) { const noIndex = typeof index === 'undefined', isClear = !target && noIndex; - let oldDate = this.optionsStore.unset ? null : this._dates[index]; + let oldDate = this.optionsStore.unset ? null : this._dates[index]?.clone; if (!oldDate && !this.optionsStore.unset && noIndex && isClear) { oldDate = this.lastPicked; } @@ -2234,7 +2234,7 @@ class Dates { }); }; if (this.validation.isValid(target) && - this.validation.dateRangeIsValid(this._dates, index, target)) { + this.validation.dateRangeIsValid(this.picked, index, target)) { onUpdate(true); return; } @@ -2367,7 +2367,7 @@ class DateDisplay { classes.push(Namespace.css.new); } if (!this.optionsStore.unset && - !this.optionsStore.options.multipleDates && + !this.optionsStore.options.dateRange && this.dates.isPicked(innerDate, Unit.date)) { classes.push(Namespace.css.active); } @@ -4091,9 +4091,10 @@ class Actions { this.dates.setValue(other, 1); return; } - else + else { this.dates.setValue(day, 1); - return; + return; + } } } this.dates.setValue(day, 0); @@ -4562,7 +4563,7 @@ const extend = function (plugin, option = undefined) { } return tempusDominus; }; -const version = '6.4.4'; +const version = '6.7.7'; const tempusDominus = { TempusDominus, extend, diff --git a/dist/js/tempus-dominus.esm.js.map b/dist/js/tempus-dominus.esm.js.map index 79bdb78b8..3ca86797c 100644 --- a/dist/js/tempus-dominus.esm.js.map +++ b/dist/js/tempus-dominus.esm.js.map @@ -1 +1 @@ -{"version":3,"file":"tempus-dominus.esm.js","sources":["../../src/js/utilities/errors.ts","../../src/js/utilities/namespace.ts","../../src/js/utilities/default-format-localization.ts","../../src/js/datetime.ts","../../src/js/utilities/service-locator.ts","../../src/js/utilities/calendar-modes.ts","../../src/js/utilities/optionsStore.ts","../../src/js/validation.ts","../../src/js/utilities/event-emitter.ts","../../src/js/utilities/default-options.ts","../../src/js/utilities/typeChecker.ts","../../src/js/utilities/optionProcessor.ts","../../src/js/utilities/optionConverter.ts","../../src/js/dates.ts","../../src/js/utilities/action-types.ts","../../src/js/display/calendar/date-display.ts","../../src/js/display/calendar/month-display.ts","../../src/js/display/calendar/year-display.ts","../../src/js/display/calendar/decade-display.ts","../../src/js/display/time/time-display.ts","../../src/js/display/time/hour-display.ts","../../src/js/display/time/minute-display.ts","../../src/js/display/time/second-display.ts","../../src/js/display/collapse.ts","../../src/js/display/index.ts","../../src/js/actions.ts","../../src/js/tempus-dominus.ts"],"sourcesContent":["export class TdError extends Error {\n code: number;\n}\n\nexport class ErrorMessages {\n private base = 'TD:';\n\n //#region out to console\n\n /**\n * Throws an error indicating that a key in the options object is invalid.\n * @param optionName\n */\n unexpectedOption(optionName: string) {\n const error = new TdError(\n `${this.base} Unexpected option: ${optionName} does not match a known option.`\n );\n error.code = 1;\n throw error;\n }\n\n /**\n * Throws an error indicating that one more keys in the options object is invalid.\n * @param optionName\n */\n unexpectedOptions(optionName: string[]) {\n const error = new TdError(`${this.base}: ${optionName.join(', ')}`);\n error.code = 1;\n throw error;\n }\n\n /**\n * Throws an error when an option is provide an unsupported value.\n * For example a value of 'cheese' for toolbarPlacement which only supports\n * 'top', 'bottom', 'default'.\n * @param optionName\n * @param badValue\n * @param validOptions\n */\n unexpectedOptionValue(\n optionName: string,\n badValue: string,\n validOptions: string[]\n ) {\n const error = new TdError(\n `${\n this.base\n } Unexpected option value: ${optionName} does not accept a value of \"${badValue}\". Valid values are: ${validOptions.join(\n ', '\n )}`\n );\n error.code = 2;\n throw error;\n }\n\n /**\n * Throws an error when an option value is the wrong type.\n * For example a string value was provided to multipleDates which only\n * supports true or false.\n * @param optionName\n * @param badType\n * @param expectedType\n */\n typeMismatch(optionName: string, badType: string, expectedType: string) {\n const error = new TdError(\n `${this.base} Mismatch types: ${optionName} has a type of ${badType} instead of the required ${expectedType}`\n );\n error.code = 3;\n throw error;\n }\n\n /**\n * Throws an error when an option value is outside of the expected range.\n * For example restrictions.daysOfWeekDisabled excepts a value between 0 and 6.\n * @param optionName\n * @param lower\n * @param upper\n */\n numbersOutOfRange(optionName: string, lower: number, upper: number) {\n const error = new TdError(\n `${this.base} ${optionName} expected an array of number between ${lower} and ${upper}.`\n );\n error.code = 4;\n throw error;\n }\n\n /**\n * Throws an error when a value for a date options couldn't be parsed. Either\n * the option was an invalid string or an invalid Date object.\n * @param optionName\n * @param date\n * @param soft If true, logs a warning instead of an error.\n */\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n failedToParseDate(optionName: string, date: any, soft = false) {\n const error = new TdError(\n `${this.base} Could not correctly parse \"${date}\" to a date for ${optionName}.`\n );\n error.code = 5;\n if (!soft) throw error;\n console.warn(error);\n }\n\n /**\n * Throws when an element to attach to was not provided in the constructor.\n */\n mustProvideElement() {\n const error = new TdError(`${this.base} No element was provided.`);\n error.code = 6;\n throw error;\n }\n\n /**\n * Throws if providing an array for the events to subscribe method doesn't have\n * the same number of callbacks. E.g., subscribe([1,2], [1])\n */\n subscribeMismatch() {\n const error = new TdError(\n `${this.base} The subscribed events does not match the number of callbacks`\n );\n error.code = 7;\n throw error;\n }\n\n /**\n * Throws if the configuration has conflicting rules e.g. minDate is after maxDate\n */\n conflictingConfiguration(message?: string) {\n const error = new TdError(\n `${this.base} A configuration value conflicts with another rule. ${message}`\n );\n error.code = 8;\n throw error;\n }\n\n /**\n * customDateFormat errors\n */\n customDateFormatError(message?: string) {\n const error = new TdError(`${this.base} Custom Date Format: ${message}`);\n error.code = 9;\n throw error;\n }\n\n /**\n * Logs a warning if a date option value is provided as a string, instead of\n * a date/datetime object.\n */\n dateString() {\n console.warn(\n `${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`\n );\n }\n\n deprecatedWarning(message: string, remediation?: string) {\n console.warn(\n `${this.base} Warning ${message} is deprecated and will be removed in a future version. ${remediation}`\n );\n }\n\n throwError(message) {\n const error = new TdError(`${this.base} ${message}`);\n error.code = 9;\n throw error;\n }\n\n //#endregion\n\n //#region used with notify.error\n\n /**\n * Used with an Error Event type if the user selects a date that\n * fails restriction validation.\n */\n failedToSetInvalidDate = 'Failed to set invalid date';\n\n /**\n * Used with an Error Event type when a user changes the value of the\n * input field directly, and does not provide a valid date.\n */\n failedToParseInput = 'Failed parse input field';\n\n //#endregion\n}\n","import { ErrorMessages } from './errors';\n// this is not the way I want this to stay but nested classes seemed to blown up once its compiled.\nconst NAME = 'tempus-dominus',\n dataKey = 'td';\n\n/**\n * Events\n */\nclass Events {\n key = `.${dataKey}`;\n\n /**\n * Change event. Fired when the user selects a date.\n * See also EventTypes.ChangeEvent\n */\n change = `change${this.key}`;\n\n /**\n * Emit when the view changes for example from month view to the year view.\n * See also EventTypes.ViewUpdateEvent\n */\n update = `update${this.key}`;\n\n /**\n * Emits when a selected date or value from the input field fails to meet the provided validation rules.\n * See also EventTypes.FailEvent\n */\n error = `error${this.key}`;\n\n /**\n * Show event\n * @event Events#show\n */\n show = `show${this.key}`;\n\n /**\n * Hide event\n * @event Events#hide\n */\n hide = `hide${this.key}`;\n\n // blur and focus are used in the jQuery provider but are otherwise unused.\n // keyup/down will be used later for keybinding options\n\n blur = `blur${this.key}`;\n focus = `focus${this.key}`;\n keyup = `keyup${this.key}`;\n keydown = `keydown${this.key}`;\n}\n\nclass Css {\n /**\n * The outer element for the widget.\n */\n widget = `${NAME}-widget`;\n\n /**\n * Hold the previous, next and switcher divs\n */\n calendarHeader = 'calendar-header';\n\n /**\n * The element for the action to change the calendar view. E.g. month -> year.\n */\n switch = 'picker-switch';\n\n /**\n * The elements for all the toolbar options\n */\n toolbar = 'toolbar';\n\n /**\n * Disables the hover and rounding affect.\n */\n noHighlight = 'no-highlight';\n\n /**\n * Applied to the widget element when the side by side option is in use.\n */\n sideBySide = 'timepicker-sbs';\n\n /**\n * The element for the action to change the calendar view, e.g. August -> July\n */\n previous = 'previous';\n\n /**\n * The element for the action to change the calendar view, e.g. August -> September\n */\n next = 'next';\n\n /**\n * Applied to any action that would violate any restriction options. ALso applied\n * to an input field if the disabled function is called.\n */\n disabled = 'disabled';\n\n /**\n * Applied to any date that is less than requested view,\n * e.g. the last day of the previous month.\n */\n old = 'old';\n\n /**\n * Applied to any date that is greater than of requested view,\n * e.g. the last day of the previous month.\n */\n new = 'new';\n\n /**\n * Applied to any date that is currently selected.\n */\n active = 'active';\n\n //#region date element\n\n /**\n * The outer element for the calendar view.\n */\n dateContainer = 'date-container';\n\n /**\n * The outer element for the decades view.\n */\n decadesContainer = `${this.dateContainer}-decades`;\n\n /**\n * Applied to elements within the decade container, e.g. 2020, 2030\n */\n decade = 'decade';\n\n /**\n * The outer element for the years view.\n */\n yearsContainer = `${this.dateContainer}-years`;\n\n /**\n * Applied to elements within the years container, e.g. 2021, 2021\n */\n year = 'year';\n\n /**\n * The outer element for the month view.\n */\n monthsContainer = `${this.dateContainer}-months`;\n\n /**\n * Applied to elements within the month container, e.g. January, February\n */\n month = 'month';\n\n /**\n * The outer element for the calendar view.\n */\n daysContainer = `${this.dateContainer}-days`;\n\n /**\n * Applied to elements within the day container, e.g. 1, 2..31\n */\n day = 'day';\n\n /**\n * If display.calendarWeeks is enabled, a column displaying the week of year\n * is shown. This class is applied to each cell in that column.\n */\n calendarWeeks = 'cw';\n\n /**\n * Applied to the first row of the calendar view, e.g. Sunday, Monday\n */\n dayOfTheWeek = 'dow';\n\n /**\n * Applied to the current date on the calendar view.\n */\n today = 'today';\n\n /**\n * Applied to the locale's weekend dates on the calendar view, e.g. Sunday, Saturday\n */\n weekend = 'weekend';\n\n rangeIn = 'range-in';\n rangeStart = 'range-start';\n rangeEnd = 'range-end';\n\n //#endregion\n\n //#region time element\n\n /**\n * The outer element for all time related elements.\n */\n timeContainer = 'time-container';\n\n /**\n * Applied the separator columns between time elements, e.g. hour *:* minute *:* second\n */\n separator = 'separator';\n\n /**\n * The outer element for the clock view.\n */\n clockContainer = `${this.timeContainer}-clock`;\n\n /**\n * The outer element for the hours selection view.\n */\n hourContainer = `${this.timeContainer}-hour`;\n\n /**\n * The outer element for the minutes selection view.\n */\n minuteContainer = `${this.timeContainer}-minute`;\n\n /**\n * The outer element for the seconds selection view.\n */\n secondContainer = `${this.timeContainer}-second`;\n\n /**\n * Applied to each element in the hours selection view.\n */\n hour = 'hour';\n\n /**\n * Applied to each element in the minutes selection view.\n */\n minute = 'minute';\n\n /**\n * Applied to each element in the seconds selection view.\n */\n second = 'second';\n\n /**\n * Applied AM/PM toggle button.\n */\n toggleMeridiem = 'toggleMeridiem';\n\n //#endregion\n\n //#region collapse\n\n /**\n * Applied the element of the current view mode, e.g. calendar or clock.\n */\n show = 'show';\n\n /**\n * Applied to the currently showing view mode during a transition\n * between calendar and clock views\n */\n collapsing = 'td-collapsing';\n\n /**\n * Applied to the currently hidden view mode.\n */\n collapse = 'td-collapse';\n\n //#endregion\n\n /**\n * Applied to the widget when the option display.inline is enabled.\n */\n inline = 'inline';\n\n /**\n * Applied to the widget when the option display.theme is light.\n */\n lightTheme = 'light';\n\n /**\n * Applied to the widget when the option display.theme is dark.\n */\n darkTheme = 'dark';\n\n /**\n * Used for detecting if the system color preference is dark mode\n */\n isDarkPreferredQuery = '(prefers-color-scheme: dark)';\n}\n\nexport default class Namespace {\n static NAME = NAME;\n // noinspection JSUnusedGlobalSymbols\n static dataKey = dataKey;\n\n static events = new Events();\n\n static css = new Css();\n\n static errorMessages = new ErrorMessages();\n}\n","import { FormatLocalization } from './options';\n\nconst DefaultFormatLocalization: FormatLocalization = {\n locale: 'default',\n hourCycle: undefined,\n dateFormats: {\n LTS: 'h:mm:ss T',\n LT: 'h:mm T',\n L: 'MM/dd/yyyy',\n LL: 'MMMM d, yyyy',\n LLL: 'MMMM d, yyyy h:mm T',\n LLLL: 'dddd, MMMM d, yyyy h:mm T',\n },\n ordinal: (n) => {\n const s = ['th', 'st', 'nd', 'rd'];\n const v = n % 100;\n return `[${n}${s[(v - 20) % 10] || s[v] || s[0]}]`;\n },\n format: 'L LT',\n};\n\nexport default { ...DefaultFormatLocalization };\n","import { FormatLocalization } from './utilities/options';\nimport Namespace from './utilities/namespace';\nimport DefaultFormatLocalization from './utilities/default-format-localization';\n\ntype parsedTime = {\n year?: number;\n month?: number;\n day?: number;\n hours?: number;\n minutes?: number;\n seconds?: number;\n milliseconds?: number;\n zone?: {\n offset: number;\n };\n};\n\nexport enum Unit {\n seconds = 'seconds',\n minutes = 'minutes',\n hours = 'hours',\n date = 'date',\n month = 'month',\n year = 'year',\n}\n\nconst twoDigitTemplate = {\n month: '2-digit',\n day: '2-digit',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n};\n\nexport interface DateTimeFormatOptions extends Intl.DateTimeFormatOptions {\n timeStyle?: 'short' | 'medium' | 'long';\n dateStyle?: 'short' | 'medium' | 'long' | 'full';\n numberingSystem?: string;\n}\n\n/**\n * Returns an Intl format object based on the provided object\n * @param unit\n */\nexport const getFormatByUnit = (unit: Unit): object => {\n switch (unit) {\n case 'date':\n return { dateStyle: 'short' };\n case 'month':\n return {\n month: 'numeric',\n year: 'numeric',\n };\n case 'year':\n return { year: 'numeric' };\n }\n};\n\n/**\n * Attempts to guess the hour cycle of the given local\n * @param locale\n */\nexport const guessHourCycle = (locale: string): Intl.LocaleHourCycleKey => {\n if (!locale) return 'h12';\n\n // noinspection SpellCheckingInspection\n const template = {\n hour: '2-digit',\n minute: '2-digit',\n numberingSystem: 'latn',\n };\n\n const dt = new DateTime().setLocalization({ locale });\n dt.hours = 0;\n\n const start = dt.parts(undefined, template).hour;\n\n //midnight is 12 so en-US style 12 AM\n if (start === '12') return 'h12';\n //midnight is 24 is from 00-24\n if (start === '24') return 'h24';\n\n dt.hours = 23;\n const end = dt.parts(undefined, template).hour;\n\n //if midnight is 00 and hour 23 is 11 then\n if (start === '00' && end === '11') return 'h11';\n\n if (start === '00' && end === '23') return 'h23';\n\n console.warn(\n `couldn't determine hour cycle for ${locale}. start: ${start}. end: ${end}`\n );\n\n return undefined;\n};\n\n/**\n * For the most part this object behaves exactly the same way\n * as the native Date object with a little extra spice.\n */\nexport class DateTime extends Date {\n localization: FormatLocalization = DefaultFormatLocalization;\n\n /**\n * Chainable way to set the {@link locale}\n * @param value\n * @deprecated use setLocalization with a FormatLocalization object instead\n */\n setLocale(value: string): this {\n if (!this.localization) {\n this.localization = DefaultFormatLocalization;\n this.localization.locale = value;\n }\n return this;\n }\n\n /**\n * Chainable way to set the {@link localization}\n * @param value\n */\n setLocalization(value: FormatLocalization): this {\n this.localization = value;\n return this;\n }\n\n /**\n * Converts a plain JS date object to a DateTime object.\n * Doing this allows access to format, etc.\n * @param date\n * @param locale this parameter is deprecated. Use formatLocalization instead.\n * @param formatLocalization\n */\n static convert(\n date: Date,\n locale = 'default',\n formatLocalization: FormatLocalization = undefined\n ): DateTime {\n if (!date) throw new Error(`A date is required`);\n\n if (!formatLocalization) {\n formatLocalization = DefaultFormatLocalization;\n formatLocalization.locale = locale;\n }\n\n return new DateTime(\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n date.getMilliseconds()\n ).setLocalization(formatLocalization);\n }\n\n /**\n * Native date manipulations are not pure functions. This function creates a duplicate of the DateTime object.\n */\n get clone() {\n return new DateTime(\n this.year,\n this.month,\n this.date,\n this.hours,\n this.minutes,\n this.seconds,\n this.getMilliseconds()\n ).setLocalization(this.localization);\n }\n\n static isValid(d): boolean {\n if (d === undefined || JSON.stringify(d) === 'null') return false;\n if (d.constructor.name === DateTime.name) return true;\n return false;\n }\n\n /**\n * Sets the current date to the start of the {@link unit} provided\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).startOf('month')\n * would return April 1, 2021, 12:00:00.000 AM (midnight)\n * @param unit\n * @param startOfTheWeek Allows for the changing the start of the week.\n */\n startOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n switch (unit) {\n case 'seconds':\n this.setMilliseconds(0);\n break;\n case 'minutes':\n this.setSeconds(0, 0);\n break;\n case 'hours':\n this.setMinutes(0, 0, 0);\n break;\n case 'date':\n this.setHours(0, 0, 0, 0);\n break;\n case 'weekDay': {\n this.startOf(Unit.date);\n if (this.weekDay === startOfTheWeek) break;\n let goBack = this.weekDay;\n if (startOfTheWeek !== 0 && this.weekDay === 0)\n goBack = 8 - startOfTheWeek;\n this.manipulate(startOfTheWeek - goBack, Unit.date);\n break;\n }\n case 'month':\n this.startOf(Unit.date);\n this.setDate(1);\n break;\n case 'year':\n this.startOf(Unit.date);\n this.setMonth(0, 1);\n break;\n }\n return this;\n }\n\n /**\n * Sets the current date to the end of the {@link unit} provided\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).endOf('month')\n * would return April 30, 2021, 11:59:59.999 PM\n * @param unit\n * @param startOfTheWeek\n */\n endOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n switch (unit) {\n case 'seconds':\n this.setMilliseconds(999);\n break;\n case 'minutes':\n this.setSeconds(59, 999);\n break;\n case 'hours':\n this.setMinutes(59, 59, 999);\n break;\n case 'date':\n this.setHours(23, 59, 59, 999);\n break;\n case 'weekDay': {\n this.endOf(Unit.date);\n const endOfWeek = 6 + startOfTheWeek;\n if (this.weekDay === endOfWeek) break;\n this.manipulate(endOfWeek - this.weekDay, Unit.date);\n break;\n }\n case 'month':\n this.endOf(Unit.date);\n this.manipulate(1, Unit.month);\n this.setDate(0);\n break;\n case 'year':\n this.endOf(Unit.date);\n this.setMonth(11, 31);\n break;\n }\n return this;\n }\n\n /**\n * Change a {@link unit} value. Value can be positive or negative\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).manipulate(1, 'month')\n * would return May 30, 2021, 11:45:32.984 AM\n * @param value A positive or negative number\n * @param unit\n */\n manipulate(value: number, unit: Unit): this {\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n this[unit] += value;\n return this;\n }\n\n /**\n * Return true if {@link compare} is before this date\n * @param compare The Date/DateTime to compare\n * @param unit If provided, uses {@link startOf} for\n * comparison.\n */\n isBefore(compare: DateTime, unit?: Unit): boolean {\n // If the comparisons is undefined, return false\n if (!DateTime.isValid(compare)) return false;\n\n if (!unit) return this.valueOf() < compare.valueOf();\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n return (\n this.clone.startOf(unit).valueOf() < compare.clone.startOf(unit).valueOf()\n );\n }\n\n /**\n * Return true if {@link compare} is after this date\n * @param compare The Date/DateTime to compare\n * @param unit If provided, uses {@link startOf} for\n * comparison.\n */\n isAfter(compare: DateTime, unit?: Unit): boolean {\n // If the comparisons is undefined, return false\n if (!DateTime.isValid(compare)) return false;\n\n if (!unit) return this.valueOf() > compare.valueOf();\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n return (\n this.clone.startOf(unit).valueOf() > compare.clone.startOf(unit).valueOf()\n );\n }\n\n /**\n * Return true if {@link compare} is same this date\n * @param compare The Date/DateTime to compare\n * @param unit If provided, uses {@link startOf} for\n * comparison.\n */\n isSame(compare: DateTime, unit?: Unit): boolean {\n // If the comparisons is undefined, return false\n if (!DateTime.isValid(compare)) return false;\n\n if (!unit) return this.valueOf() === compare.valueOf();\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n compare = DateTime.convert(compare);\n return (\n this.clone.startOf(unit).valueOf() === compare.startOf(unit).valueOf()\n );\n }\n\n /**\n * Check if this is between two other DateTimes, optionally looking at unit scale. The match is exclusive.\n * @param left\n * @param right\n * @param unit.\n * @param inclusivity. A [ indicates inclusion of a value. A ( indicates exclusion.\n * If the inclusivity parameter is used, both indicators must be passed.\n */\n isBetween(\n left: DateTime,\n right: DateTime,\n unit?: Unit,\n inclusivity: '()' | '[]' | '(]' | '[)' = '()'\n ): boolean {\n // If one of the comparisons is undefined, return false\n if (!DateTime.isValid(left) || !DateTime.isValid(right)) return false;\n // If a unit is provided and is not a valid property of the DateTime object, throw an error\n if (unit && this[unit] === undefined) {\n throw new Error(`Unit '${unit}' is not valid`);\n }\n\n const leftInclusivity = inclusivity[0] === '(';\n const rightInclusivity = inclusivity[1] === ')';\n\n const isLeftInRange = leftInclusivity\n ? this.isAfter(left, unit)\n : !this.isBefore(left, unit);\n const isRightInRange = rightInclusivity\n ? this.isBefore(right, unit)\n : !this.isAfter(right, unit);\n\n return isLeftInRange && isRightInRange;\n }\n\n /**\n * Returns flattened object of the date. Does not include literals\n * @param locale\n * @param template\n */\n parts(\n locale = this.localization.locale,\n template: Record = { dateStyle: 'full', timeStyle: 'long' }\n ): Record {\n const parts = {};\n new Intl.DateTimeFormat(locale, template)\n .formatToParts(this)\n .filter((x) => x.type !== 'literal')\n .forEach((x) => (parts[x.type] = x.value));\n return parts;\n }\n\n /**\n * Shortcut to Date.getSeconds()\n */\n get seconds(): number {\n return this.getSeconds();\n }\n\n /**\n * Shortcut to Date.setSeconds()\n */\n set seconds(value: number) {\n this.setSeconds(value);\n }\n\n /**\n * Returns two digit hours\n */\n get secondsFormatted(): string {\n return this.parts(undefined, twoDigitTemplate).second;\n }\n\n /**\n * Shortcut to Date.getMinutes()\n */\n get minutes(): number {\n return this.getMinutes();\n }\n\n /**\n * Shortcut to Date.setMinutes()\n */\n set minutes(value: number) {\n this.setMinutes(value);\n }\n\n /**\n * Returns two digit minutes\n */\n get minutesFormatted(): string {\n return this.parts(undefined, twoDigitTemplate).minute;\n }\n\n /**\n * Shortcut to Date.getHours()\n */\n get hours(): number {\n return this.getHours();\n }\n\n /**\n * Shortcut to Date.setHours()\n */\n set hours(value: number) {\n this.setHours(value);\n }\n\n /**\n * Returns two digit hour, e.g. 01...10\n * @param hourCycle Providing an hour cycle will change 00 to 24 depending on the given value.\n */\n getHoursFormatted(hourCycle: Intl.LocaleHourCycleKey = 'h12') {\n return this.parts(undefined, { ...twoDigitTemplate, hourCycle: hourCycle })\n .hour;\n }\n\n /**\n * Get the meridiem of the date. E.g. AM or PM.\n * If the {@link locale} provides a \"dayPeriod\" then this will be returned,\n * otherwise it will return AM or PM.\n * @param locale\n */\n meridiem(locale: string = this.localization.locale): string {\n return new Intl.DateTimeFormat(locale, {\n hour: 'numeric',\n hour12: true,\n })\n .formatToParts(this)\n .find((p) => p.type === 'dayPeriod')?.value;\n }\n\n /**\n * Shortcut to Date.getDate()\n */\n get date(): number {\n return this.getDate();\n }\n\n /**\n * Shortcut to Date.setDate()\n */\n set date(value: number) {\n this.setDate(value);\n }\n\n /**\n * Return two digit date\n */\n get dateFormatted(): string {\n return this.parts(undefined, twoDigitTemplate).day;\n }\n\n /**\n * Shortcut to Date.getDay()\n */\n get weekDay(): number {\n return this.getDay();\n }\n\n /**\n * Shortcut to Date.getMonth()\n */\n get month(): number {\n return this.getMonth();\n }\n\n /**\n * Shortcut to Date.setMonth()\n */\n set month(value: number) {\n const targetMonth = new Date(this.year, value + 1);\n targetMonth.setDate(0);\n const endOfMonth = targetMonth.getDate();\n if (this.date > endOfMonth) {\n this.date = endOfMonth;\n }\n this.setMonth(value);\n }\n\n /**\n * Return two digit, human expected month. E.g. January = 1, December = 12\n */\n get monthFormatted(): string {\n return this.parts(undefined, twoDigitTemplate).month;\n }\n\n /**\n * Shortcut to Date.getFullYear()\n */\n get year(): number {\n return this.getFullYear();\n }\n\n /**\n * Shortcut to Date.setFullYear()\n */\n set year(value: number) {\n this.setFullYear(value);\n }\n\n // borrowed a bunch of stuff from Luxon\n /**\n * Gets the week of the year\n */\n get week(): number {\n const ordinal = this.computeOrdinal(),\n weekday = this.getUTCDay();\n\n let weekNumber = Math.floor((ordinal - weekday + 10) / 7);\n\n if (weekNumber < 1) {\n weekNumber = this.weeksInWeekYear();\n } else if (weekNumber > this.weeksInWeekYear()) {\n weekNumber = 1;\n }\n\n return weekNumber;\n }\n\n /**\n * Returns the number of weeks in the year\n */\n weeksInWeekYear() {\n const p1 =\n (this.year +\n Math.floor(this.year / 4) -\n Math.floor(this.year / 100) +\n Math.floor(this.year / 400)) %\n 7,\n last = this.year - 1,\n p2 =\n (last +\n Math.floor(last / 4) -\n Math.floor(last / 100) +\n Math.floor(last / 400)) %\n 7;\n return p1 === 4 || p2 === 3 ? 53 : 52;\n }\n\n /**\n * Returns true or false depending on if the year is a leap year or not.\n */\n get isLeapYear() {\n return (\n this.year % 4 === 0 && (this.year % 100 !== 0 || this.year % 400 === 0)\n );\n }\n\n private computeOrdinal() {\n return (\n this.date +\n (this.isLeapYear ? this.leapLadder : this.nonLeapLadder)[this.month]\n );\n }\n\n private nonLeapLadder = [\n 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334,\n ];\n private leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\n //#region CDF stuff\n\n private dateTimeRegex =\n //is regex cannot be simplified beyond what it already is\n /(\\[[^[\\]]*])|y{1,4}|M{1,4}|d{1,4}|H{1,2}|h{1,2}|t|T|m{1,2}|s{1,2}|f{3}/g; //NOSONAR\n\n private formattingTokens =\n /(\\[[^[\\]]*])|([-_:/.,()\\s]+)|(T|t|yyyy|yy?|MM?M?M?|Do|dd?|hh?|HH?|mm?|ss?)/g; //NOSONAR is regex cannot be simplified beyond what it already is\n\n /**\n * Returns a list of month values based on the current locale\n */\n private getAllMonths(\n format: '2-digit' | 'numeric' | 'long' | 'short' | 'narrow' = 'long'\n ) {\n const applyFormat = new Intl.DateTimeFormat(this.localization.locale, {\n month: format,\n }).format;\n return [...Array(12).keys()].map((m) => applyFormat(new Date(2021, m)));\n }\n\n /**\n * Replaces an expanded token set (e.g. LT/LTS)\n */\n private replaceTokens(formatStr, formats) {\n /***\n * _ => match\n * a => first capture group. Anything between [ and ]\n * b => second capture group\n */\n return formatStr.replace(\n /(\\[[^[\\]]*])|(LTS?|l{1,4}|L{1,4})/g,\n (_, a, b) => {\n const B = b && b.toUpperCase();\n return a || formats[B] || DefaultFormatLocalization.dateFormats[B];\n }\n );\n }\n\n private match2 = /\\d\\d/; // 00 - 99\n private match3 = /\\d{3}/; // 000 - 999\n private match4 = /\\d{4}/; // 0000 - 9999\n private match1to2 = /\\d\\d?/; // 0 - 99\n private matchSigned = /[+-]?\\d+/; // -inf - inf\n private matchOffset = /[+-]\\d\\d:?(\\d\\d)?|Z/; // +00:00 -00:00 +0000 or -0000 +00 or Z\n private matchWord = /[^\\d_:/,\\-()\\s]+/; // Word\n\n private parseTwoDigitYear(input) {\n input = +input;\n return input + (input > 68 ? 1900 : 2000);\n }\n\n private offsetFromString(string) {\n if (!string) return 0;\n if (string === 'Z') return 0;\n const [first, second, third] = string.match(/([+-]|\\d\\d)/g);\n const minutes = +(second * 60) + (+third || 0);\n const signed = first === '+' ? -minutes : minutes;\n return minutes === 0 ? 0 : signed; // eslint-disable-line no-nested-ternary\n }\n\n /**\n * z = -4, zz = -04, zzz = -0400\n * @param date\n * @param style\n * @private\n */\n private zoneInformation(date: DateTime, style: 'z' | 'zz' | 'zzz') {\n let name = date\n .parts(this.localization.locale, { timeZoneName: 'longOffset' })\n .timeZoneName.replace('GMT', '')\n .replace(':', '');\n\n const negative = name.includes('-');\n\n name = name.replace('-', '');\n\n if (style === 'z') name = name.substring(1, 2);\n else if (style === 'zz') name = name.substring(0, 2);\n\n return `${negative ? '-' : ''}${name}`;\n }\n\n private zoneExpressions = [\n this.matchOffset,\n (obj, input) => {\n obj.offset = this.offsetFromString(input);\n },\n ];\n\n private addInput(property) {\n return (time, input) => {\n time[property] = +input;\n };\n }\n\n private meridiemMatch(input) {\n const meridiem = new Intl.DateTimeFormat(this.localization.locale, {\n hour: 'numeric',\n hour12: true,\n })\n .formatToParts(new Date(2022, 3, 4, 13))\n .find((p) => p.type === 'dayPeriod')?.value;\n\n return input.toLowerCase() === meridiem.toLowerCase();\n }\n\n private expressions = {\n t: [\n this.matchWord,\n (ojb, input) => {\n ojb.afternoon = this.meridiemMatch(input);\n },\n ],\n T: [\n this.matchWord,\n (ojb, input) => {\n ojb.afternoon = this.meridiemMatch(input);\n },\n ],\n fff: [\n this.match3,\n (ojb, input) => {\n ojb.milliseconds = +input;\n },\n ],\n s: [this.match1to2, this.addInput('seconds')],\n ss: [this.match1to2, this.addInput('seconds')],\n m: [this.match1to2, this.addInput('minutes')],\n mm: [this.match1to2, this.addInput('minutes')],\n H: [this.match1to2, this.addInput('hours')],\n h: [this.match1to2, this.addInput('hours')],\n HH: [this.match1to2, this.addInput('hours')],\n hh: [this.match1to2, this.addInput('hours')],\n d: [this.match1to2, this.addInput('day')],\n dd: [this.match2, this.addInput('day')],\n Do: [\n this.matchWord,\n (ojb, input) => {\n [ojb.day] = input.match(/\\d+/);\n if (!this.localization.ordinal) return;\n for (let i = 1; i <= 31; i += 1) {\n if (this.localization.ordinal(i).replace(/[[\\]]/g, '') === input) {\n ojb.day = i;\n }\n }\n },\n ],\n M: [this.match1to2, this.addInput('month')],\n MM: [this.match2, this.addInput('month')],\n MMM: [\n this.matchWord,\n (obj, input) => {\n const months = this.getAllMonths();\n const monthsShort = this.getAllMonths('short');\n const matchIndex =\n (monthsShort || months.map((_) => _.slice(0, 3))).indexOf(input) + 1;\n if (matchIndex < 1) {\n throw new Error();\n }\n obj.month = matchIndex % 12 || matchIndex;\n },\n ],\n MMMM: [\n this.matchWord,\n (obj, input) => {\n const months = this.getAllMonths();\n const matchIndex = months.indexOf(input) + 1;\n if (matchIndex < 1) {\n throw new Error();\n }\n obj.month = matchIndex % 12 || matchIndex;\n },\n ],\n y: [this.matchSigned, this.addInput('year')],\n yy: [\n this.match2,\n (obj, input) => {\n obj.year = this.parseTwoDigitYear(input);\n },\n ],\n yyyy: [this.match4, this.addInput('year')],\n // z: this.zoneExpressions,\n // zz: this.zoneExpressions,\n // zzz: this.zoneExpressions\n };\n\n private correctHours(time) {\n const { afternoon } = time;\n if (afternoon !== undefined) {\n const { hours } = time;\n if (afternoon) {\n if (hours < 12) {\n time.hours += 12;\n }\n } else if (hours === 12) {\n time.hours = 0;\n }\n delete time.afternoon;\n }\n }\n\n private makeParser(format) {\n format = this.replaceTokens(format, this.localization.dateFormats);\n const array = format.match(this.formattingTokens);\n const { length } = array;\n for (let i = 0; i < length; i += 1) {\n const token = array[i];\n const parseTo = this.expressions[token];\n const regex = parseTo && parseTo[0];\n const parser = parseTo && parseTo[1];\n if (parser) {\n array[i] = { regex, parser };\n } else {\n array[i] = token.replace(/^\\[[^[\\]]*]$/g, '');\n }\n }\n\n return (input): parsedTime => {\n const time = {\n hours: 0,\n minutes: 0,\n seconds: 0,\n milliseconds: 0,\n };\n for (let i = 0, start = 0; i < length; i += 1) {\n const token = array[i];\n if (typeof token === 'string') {\n start += token.length;\n } else {\n const { regex, parser } = token;\n const part = input.slice(start);\n const match = regex.exec(part);\n const value = match[0];\n parser.call(this, time, value);\n input = input.replace(value, '');\n }\n }\n this.correctHours(time);\n return time;\n };\n }\n\n /**\n * Attempts to create a DateTime from a string.\n * @param input date as string\n * @param localization provides the date template the string is in via the format property\n */\n //eslint-disable-next-line @typescript-eslint/no-unused-vars\n static fromString(input: string, localization: FormatLocalization): DateTime {\n if (!localization?.format) {\n Namespace.errorMessages.customDateFormatError('No format was provided');\n }\n try {\n const dt = new DateTime();\n dt.setLocalization(localization);\n if (['x', 'X'].indexOf(localization.format) > -1)\n return new DateTime((localization.format === 'X' ? 1000 : 1) * +input);\n\n const parser = dt.makeParser(localization.format);\n const { year, month, day, hours, minutes, seconds, milliseconds, zone } =\n parser(input);\n const d = day || (!year && !month ? dt.getDate() : 1);\n const y = year || dt.getFullYear();\n let M = 0;\n if (!(year && !month)) {\n M = month > 0 ? month - 1 : dt.getMonth();\n }\n if (zone) {\n return new DateTime(\n Date.UTC(\n y,\n M,\n d,\n hours,\n minutes,\n seconds,\n milliseconds + zone.offset * 60 * 1000\n )\n );\n }\n return new DateTime(y, M, d, hours, minutes, seconds, milliseconds);\n } catch (e) {\n Namespace.errorMessages.customDateFormatError(\n `Unable to parse provided input: ${input}, format: ${localization.format}`\n );\n }\n }\n\n /**\n * Returns a string format.\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat\n * for valid templates and locale objects\n * @param template An optional object. If provided, method will use Intl., otherwise the localizations format properties\n * @param locale Can be a string or an array of strings. Uses browser defaults otherwise.\n */\n format(\n template?: DateTimeFormatOptions | string,\n locale = this.localization.locale\n ): string {\n if (template && typeof template === 'object')\n return new Intl.DateTimeFormat(locale, template).format(this);\n\n const formatString = this.replaceTokens(\n //try template first\n template ||\n //otherwise try localization format\n this.localization.format ||\n //otherwise try date + time\n `${DefaultFormatLocalization.dateFormats.L}, ${DefaultFormatLocalization.dateFormats.LT}`,\n this.localization.dateFormats\n );\n\n const formatter = (template) =>\n new Intl.DateTimeFormat(this.localization.locale, template).format(this);\n\n if (!this.localization.hourCycle)\n this.localization.hourCycle = guessHourCycle(this.localization.locale);\n\n //if the format asks for a twenty-four-hour string but the hour cycle is not, then make a base guess\n const HHCycle = this.localization.hourCycle.startsWith('h1')\n ? 'h24'\n : this.localization.hourCycle;\n const hhCycle = this.localization.hourCycle.startsWith('h2')\n ? 'h12'\n : this.localization.hourCycle;\n\n const matches = {\n yy: formatter({ year: '2-digit' }),\n yyyy: this.year,\n M: formatter({ month: 'numeric' }),\n MM: this.monthFormatted,\n MMM: this.getAllMonths('short')[this.getMonth()],\n MMMM: this.getAllMonths()[this.getMonth()],\n d: this.date,\n dd: this.dateFormatted,\n ddd: formatter({ weekday: 'short' }),\n dddd: formatter({ weekday: 'long' }),\n H: this.getHours(),\n HH: this.getHoursFormatted(HHCycle),\n h: this.hours > 12 ? this.hours - 12 : this.hours,\n hh: this.getHoursFormatted(hhCycle),\n t: this.meridiem(),\n T: this.meridiem().toUpperCase(),\n m: this.minutes,\n mm: this.minutesFormatted,\n s: this.seconds,\n ss: this.secondsFormatted,\n fff: this.getMilliseconds(),\n // z: this.zoneInformation(dateTime, 'z'), //-4\n // zz: this.zoneInformation(dateTime, 'zz'), //-04\n // zzz: this.zoneInformation(dateTime, 'zzz') //-0400\n };\n\n return formatString\n .replace(this.dateTimeRegex, (match, $1) => {\n return $1 || matches[match];\n })\n .replace(/\\[/g, '')\n .replace(/]/g, '');\n }\n\n //#endregion CDF stuff\n}\n","//eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport declare type Constructable = new (...args: any[]) => T;\n\nclass ServiceLocator {\n private cache: Map, unknown | symbol> = new Map();\n\n locate(identifier: Constructable): T {\n const service = this.cache.get(identifier);\n if (service) return service as T;\n const value = new identifier();\n this.cache.set(identifier, value);\n return value;\n }\n}\nexport const setupServiceLocator = () => {\n serviceLocator = new ServiceLocator();\n};\n\nexport let serviceLocator: ServiceLocator;\n","import { Unit } from '../datetime';\nimport Namespace from './namespace';\nimport ViewMode from './view-mode';\n\nconst CalendarModes: {\n name: keyof ViewMode;\n className: string;\n unit: Unit;\n step: number;\n}[] = [\n {\n name: 'calendar',\n className: Namespace.css.daysContainer,\n unit: Unit.month,\n step: 1,\n },\n {\n name: 'months',\n className: Namespace.css.monthsContainer,\n unit: Unit.year,\n step: 1,\n },\n {\n name: 'years',\n className: Namespace.css.yearsContainer,\n unit: Unit.year,\n step: 10,\n },\n {\n name: 'decades',\n className: Namespace.css.decadesContainer,\n unit: Unit.year,\n step: 100,\n },\n];\n\nexport default CalendarModes;\n","import { DateTime } from '../datetime';\nimport CalendarModes from './calendar-modes';\nimport ViewMode from './view-mode';\nimport Options from './options';\n\nexport class OptionsStore {\n options: Options;\n element: HTMLElement;\n input: HTMLInputElement;\n unset: boolean;\n private _currentCalendarViewMode = 0;\n\n get currentCalendarViewMode() {\n return this._currentCalendarViewMode;\n }\n\n set currentCalendarViewMode(value) {\n this._currentCalendarViewMode = value;\n this.currentView = CalendarModes[value].name;\n }\n\n _viewDate = new DateTime();\n\n get viewDate() {\n return this._viewDate;\n }\n\n set viewDate(v) {\n this._viewDate = v;\n if (this.options) this.options.viewDate = v;\n }\n\n /**\n * When switching back to the calendar from the clock,\n * this sets currentView to the correct calendar view.\n */\n refreshCurrentView() {\n this.currentView = CalendarModes[this.currentCalendarViewMode].name;\n }\n\n minimumCalendarViewMode = 0;\n currentView: keyof ViewMode = 'calendar';\n\n get isTwelveHour() {\n return ['h12', 'h11'].includes(this.options.localization.hourCycle);\n }\n}\n","import { DateTime, Unit } from './datetime';\nimport { serviceLocator } from './utilities/service-locator';\nimport { OptionsStore } from './utilities/optionsStore';\n\n/**\n * Main class for date validation rules based on the options provided.\n */\nexport default class Validation {\n private optionsStore: OptionsStore;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n }\n\n /**\n * Checks to see if the target date is valid based on the rules provided in the options.\n * Granularity can be provided to check portions of the date instead of the whole.\n * @param targetDate\n * @param granularity\n */\n isValid(targetDate: DateTime, granularity?: Unit): boolean {\n if (!this._enabledDisabledDatesIsValid(granularity, targetDate))\n return false;\n\n if (\n granularity !== Unit.month &&\n granularity !== Unit.year &&\n this.optionsStore.options.restrictions.daysOfWeekDisabled?.length > 0 &&\n this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(\n targetDate.weekDay\n ) !== -1\n )\n return false;\n\n if (!this._minMaxIsValid(granularity, targetDate)) return false;\n\n if (\n granularity === Unit.hours ||\n granularity === Unit.minutes ||\n granularity === Unit.seconds\n ) {\n if (!this._enabledDisabledHoursIsValid(targetDate)) return false;\n\n if (\n this.optionsStore.options.restrictions.disabledTimeIntervals?.filter(\n (internal) => targetDate.isBetween(internal.from, internal.to)\n ).length !== 0\n )\n return false;\n }\n\n return true;\n }\n\n private _enabledDisabledDatesIsValid(\n granularity: Unit,\n targetDate: DateTime\n ): boolean {\n if (granularity !== Unit.date) return true;\n\n if (\n this.optionsStore.options.restrictions.disabledDates.length > 0 &&\n this._isInDisabledDates(targetDate)\n ) {\n return false;\n }\n\n // noinspection RedundantIfStatementJS\n if (\n this.optionsStore.options.restrictions.enabledDates.length > 0 &&\n !this._isInEnabledDates(targetDate)\n ) {\n return false;\n }\n\n return true;\n }\n\n /**\n * Checks to see if the disabledDates option is in use and returns true (meaning invalid)\n * if the `testDate` is with in the array. Granularity is by date.\n * @param testDate\n * @private\n */\n private _isInDisabledDates(testDate: DateTime) {\n if (\n !this.optionsStore.options.restrictions.disabledDates ||\n this.optionsStore.options.restrictions.disabledDates.length === 0\n )\n return false;\n\n return !!this.optionsStore.options.restrictions.disabledDates.find((x) =>\n x.isSame(testDate, Unit.date)\n );\n }\n\n /**\n * Checks to see if the enabledDates option is in use and returns true (meaning valid)\n * if the `testDate` is with in the array. Granularity is by date.\n * @param testDate\n * @private\n */\n private _isInEnabledDates(testDate: DateTime) {\n if (\n !this.optionsStore.options.restrictions.enabledDates ||\n this.optionsStore.options.restrictions.enabledDates.length === 0\n )\n return true;\n\n return !!this.optionsStore.options.restrictions.enabledDates.find((x) =>\n x.isSame(testDate, Unit.date)\n );\n }\n\n private _minMaxIsValid(granularity: Unit, targetDate: DateTime) {\n if (\n this.optionsStore.options.restrictions.minDate &&\n targetDate.isBefore(\n this.optionsStore.options.restrictions.minDate,\n granularity\n )\n ) {\n return false;\n }\n\n // noinspection RedundantIfStatementJS\n if (\n this.optionsStore.options.restrictions.maxDate &&\n targetDate.isAfter(\n this.optionsStore.options.restrictions.maxDate,\n granularity\n )\n ) {\n return false;\n }\n\n return true;\n }\n\n private _enabledDisabledHoursIsValid(targetDate) {\n if (\n this.optionsStore.options.restrictions.disabledHours.length > 0 &&\n this._isInDisabledHours(targetDate)\n ) {\n return false;\n }\n\n // noinspection RedundantIfStatementJS\n if (\n this.optionsStore.options.restrictions.enabledHours.length > 0 &&\n !this._isInEnabledHours(targetDate)\n ) {\n return false;\n }\n\n return true;\n }\n\n /**\n * Checks to see if the disabledHours option is in use and returns true (meaning invalid)\n * if the `testDate` is with in the array. Granularity is by hours.\n * @param testDate\n * @private\n */\n private _isInDisabledHours(testDate: DateTime) {\n if (\n !this.optionsStore.options.restrictions.disabledHours ||\n this.optionsStore.options.restrictions.disabledHours.length === 0\n )\n return false;\n\n const formattedDate = testDate.hours;\n return this.optionsStore.options.restrictions.disabledHours.includes(\n formattedDate\n );\n }\n\n /**\n * Checks to see if the enabledHours option is in use and returns true (meaning valid)\n * if the `testDate` is with in the array. Granularity is by hours.\n * @param testDate\n * @private\n */\n private _isInEnabledHours(testDate: DateTime) {\n if (\n !this.optionsStore.options.restrictions.enabledHours ||\n this.optionsStore.options.restrictions.enabledHours.length === 0\n )\n return true;\n\n const formattedDate = testDate.hours;\n return this.optionsStore.options.restrictions.enabledHours.includes(\n formattedDate\n );\n }\n\n dateRangeIsValid(dates: DateTime[], index: number, target: DateTime) {\n // if we're not using the option, then return valid\n if (!this.optionsStore.options.dateRange) return true;\n\n // if we've only selected 0..1 dates, and we're not setting the end date\n // then return valid. We only want to validate the range if both are selected,\n // because the other validation on the target has already occurred.\n if (dates.length !== 2 && index !== 1) return true;\n\n // initialize start date\n const start = dates[0];\n\n // check if start date is not the same as target date\n if (start.isSame(target, Unit.date)) return true;\n\n // add one day to start; start has already been validated\n start.clone.manipulate(1, Unit.date);\n\n // check each date in the range to make sure it's valid\n while (!start.isSame(target, Unit.date)) {\n const valid = this.isValid(start, Unit.date);\n if (!valid) return false;\n start.manipulate(1, Unit.date);\n }\n\n return true;\n }\n}\n","import { DateTime, Unit } from '../datetime';\nimport ActionTypes from './action-types';\nimport { BaseEvent } from './event-types';\n\nexport type ViewUpdateValues = Unit | 'clock' | 'calendar' | 'all';\n\nclass EventEmitter {\n private subscribers: ((value?: T) => void)[] = [];\n\n subscribe(callback: (value: T) => void) {\n this.subscribers.push(callback);\n return this.unsubscribe.bind(this, this.subscribers.length - 1);\n }\n\n unsubscribe(index: number) {\n this.subscribers.splice(index, 1);\n }\n\n emit(value?: T) {\n this.subscribers.forEach((callback) => {\n callback(value);\n });\n }\n\n destroy() {\n this.subscribers = null;\n this.subscribers = [];\n }\n}\n\nexport class EventEmitters {\n triggerEvent = new EventEmitter();\n viewUpdate = new EventEmitter();\n updateDisplay = new EventEmitter();\n action = new EventEmitter<{ e: any; action?: ActionTypes }>(); //eslint-disable-line @typescript-eslint/no-explicit-any\n updateViewDate = new EventEmitter();\n\n destroy() {\n this.triggerEvent.destroy();\n this.viewUpdate.destroy();\n this.updateDisplay.destroy();\n this.action.destroy();\n this.updateViewDate.destroy();\n }\n}\n","import Options, { Localization } from './options';\nimport { DateTime } from '../datetime';\nimport DefaultFormatLocalization from './default-format-localization';\n\nconst defaultEnLocalization: Localization = {\n clear: 'Clear selection',\n close: 'Close the picker',\n dateFormats: DefaultFormatLocalization.dateFormats,\n dayViewHeaderFormat: { month: 'long', year: '2-digit' },\n decrementHour: 'Decrement Hour',\n decrementMinute: 'Decrement Minute',\n decrementSecond: 'Decrement Second',\n format: DefaultFormatLocalization.format,\n hourCycle: DefaultFormatLocalization.hourCycle,\n incrementHour: 'Increment Hour',\n incrementMinute: 'Increment Minute',\n incrementSecond: 'Increment Second',\n locale: DefaultFormatLocalization.locale,\n nextCentury: 'Next Century',\n nextDecade: 'Next Decade',\n nextMonth: 'Next Month',\n nextYear: 'Next Year',\n ordinal: DefaultFormatLocalization.ordinal,\n pickHour: 'Pick Hour',\n pickMinute: 'Pick Minute',\n pickSecond: 'Pick Second',\n previousCentury: 'Previous Century',\n previousDecade: 'Previous Decade',\n previousMonth: 'Previous Month',\n previousYear: 'Previous Year',\n selectDate: 'Select Date',\n selectDecade: 'Select Decade',\n selectMonth: 'Select Month',\n selectTime: 'Select Time',\n selectYear: 'Select Year',\n startOfTheWeek: 0,\n today: 'Go to today',\n toggleMeridiem: 'Toggle Meridiem',\n};\n\nconst DefaultOptions: Options = {\n allowInputToggle: false,\n container: undefined,\n dateRange: false,\n debug: false,\n defaultDate: undefined,\n display: {\n icons: {\n type: 'icons',\n time: 'fa-solid fa-clock',\n date: 'fa-solid fa-calendar',\n up: 'fa-solid fa-arrow-up',\n down: 'fa-solid fa-arrow-down',\n previous: 'fa-solid fa-chevron-left',\n next: 'fa-solid fa-chevron-right',\n today: 'fa-solid fa-calendar-check',\n clear: 'fa-solid fa-trash',\n close: 'fa-solid fa-xmark',\n },\n sideBySide: false,\n calendarWeeks: false,\n viewMode: 'calendar',\n toolbarPlacement: 'bottom',\n keepOpen: false,\n buttons: {\n today: false,\n clear: false,\n close: false,\n },\n components: {\n calendar: true,\n date: true,\n month: true,\n year: true,\n decades: true,\n clock: true,\n hours: true,\n minutes: true,\n seconds: false,\n useTwentyfourHour: undefined,\n },\n inline: false,\n theme: 'auto',\n placement: 'bottom',\n },\n keepInvalid: false,\n localization: defaultEnLocalization,\n meta: {},\n multipleDates: false,\n multipleDatesSeparator: '; ',\n promptTimeOnDateChange: false,\n promptTimeOnDateChangeTransitionDelay: 200,\n restrictions: {\n minDate: undefined,\n maxDate: undefined,\n disabledDates: [],\n enabledDates: [],\n daysOfWeekDisabled: [],\n disabledTimeIntervals: [],\n disabledHours: [],\n enabledHours: [],\n },\n stepping: 1,\n useCurrent: true,\n viewDate: new DateTime(),\n};\n\nexport default DefaultOptions;\nexport const DefaultEnLocalization = { ...defaultEnLocalization };\n","import Namespace from './namespace';\nimport { DateTime } from '../datetime';\nimport { FormatLocalization } from './options';\nimport DefaultFormatLocalization from './default-format-localization';\n\n/**\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\n * @param d If a string will attempt creating a date from it.\n * @param localization object containing locale and format settings. Only used with the custom formats\n * @private\n */\nexport function tryConvertToDateTime(\n this: void,\n d: DateTime | Date | '',\n localization: FormatLocalization\n): DateTime | null {\n if (!d) return null;\n if (d.constructor.name === DateTime.name) return d as DateTime;\n if (d.constructor.name === Date.name) {\n return DateTime.convert(d as Date);\n }\n if (typeof d === typeof '') {\n const dateTime = DateTime.fromString(d as unknown as string, localization);\n if (JSON.stringify(dateTime) === 'null') {\n return null;\n }\n return dateTime;\n }\n return null;\n}\n\n/**\n * Attempts to convert `d` to a DateTime object\n * @param d value to convert\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param localization object containing locale and format settings. Only used with the custom formats\n */\nexport function convertToDateTime(\n this: void,\n d: DateTime | Date | '',\n optionName: string,\n localization: FormatLocalization\n): DateTime {\n if (typeof d === typeof '' && optionName !== 'input') {\n Namespace.errorMessages.dateString();\n }\n\n const converted = tryConvertToDateTime(d, localization);\n\n if (!converted) {\n Namespace.errorMessages.failedToParseDate(\n optionName,\n d,\n optionName === 'input'\n );\n }\n return converted;\n}\n\n/**\n * Type checks that `value` is an array of Date or DateTime\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param value Option value\n * @param providedType Used to provide text to error messages\n * @param localization\n */\nexport function typeCheckDateArray(\n this: void,\n optionName: string,\n value: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n providedType: string,\n localization: FormatLocalization\n) {\n if (!Array.isArray(value)) {\n Namespace.errorMessages.typeMismatch(\n optionName,\n providedType,\n 'array of DateTime or Date'\n );\n }\n for (let i = 0; i < value.length; i++) {\n const d = value[i];\n const dateTime = convertToDateTime(d, optionName, localization);\n if (!dateTime) {\n Namespace.errorMessages.typeMismatch(\n optionName,\n typeof d,\n 'DateTime or Date'\n );\n }\n dateTime.setLocalization(localization ?? DefaultFormatLocalization);\n value[i] = dateTime;\n }\n}\n\n/**\n * Type checks that `value` is an array of numbers\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param value Option value\n * @param providedType Used to provide text to error messages\n */\nexport function typeCheckNumberArray(\n this: void,\n optionName: string,\n value: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n providedType: string\n) {\n if (!Array.isArray(value) || value.some((x) => typeof x !== typeof 0)) {\n Namespace.errorMessages.typeMismatch(\n optionName,\n providedType,\n 'array of numbers'\n );\n }\n}\n","import Namespace from './namespace';\nimport type { FormatLocalization } from './options';\nimport {\n convertToDateTime,\n typeCheckNumberArray,\n typeCheckDateArray,\n} from './typeChecker';\n\ninterface OptionProcessorFunctionArguments {\n key: string;\n value: any; //eslint-disable-line @typescript-eslint/no-explicit-any\n providedType: string;\n defaultType: string;\n path: string;\n localization: FormatLocalization;\n}\n\ntype OptionProcessorFunction = (\n this: void,\n args: OptionProcessorFunctionArguments\n) => any; //eslint-disable-line @typescript-eslint/no-explicit-any\n\nfunction mandatoryDate(key: string): OptionProcessorFunction {\n return ({ value, providedType, localization }) => {\n const dateTime = convertToDateTime(value, key, localization);\n if (dateTime !== undefined) {\n dateTime.setLocalization(localization);\n return dateTime;\n }\n Namespace.errorMessages.typeMismatch(key, providedType, 'DateTime or Date');\n };\n}\n\nfunction optionalDate(key: string): OptionProcessorFunction {\n const mandatory = mandatoryDate(key);\n return (args) => {\n if (args.value === undefined) {\n return args.value;\n }\n return mandatory(args);\n };\n}\n\nfunction numbersInRange(\n key: string,\n lower: number,\n upper: number\n): OptionProcessorFunction {\n return ({ value, providedType }) => {\n if (value === undefined) {\n return [];\n }\n typeCheckNumberArray(key, value, providedType);\n if ((value as number[]).some((x) => x < lower || x > upper))\n Namespace.errorMessages.numbersOutOfRange(key, lower, upper);\n return value;\n };\n}\n\nfunction validHourRange(key: string): OptionProcessorFunction {\n return numbersInRange(key, 0, 23);\n}\n\nfunction validDateArray(key: string): OptionProcessorFunction {\n return ({ value, providedType, localization }) => {\n if (value === undefined) {\n return [];\n }\n typeCheckDateArray(key, value, providedType, localization);\n return value;\n };\n}\n\nfunction validKeyOption(keyOptions: string[]): OptionProcessorFunction {\n return ({ value, path }) => {\n if (!keyOptions.includes(value))\n Namespace.errorMessages.unexpectedOptionValue(\n path.substring(1),\n value,\n keyOptions\n );\n return value;\n };\n}\n\nconst optionProcessors: { [key: string]: OptionProcessorFunction } =\n Object.freeze({\n defaultDate: mandatoryDate('defaultDate'),\n viewDate: mandatoryDate('viewDate'),\n minDate: optionalDate('restrictions.minDate'),\n maxDate: optionalDate('restrictions.maxDate'),\n disabledHours: validHourRange('restrictions.disabledHours'),\n enabledHours: validHourRange('restrictions.enabledHours'),\n disabledDates: validDateArray('restrictions.disabledDates'),\n enabledDates: validDateArray('restrictions.enabledDates'),\n daysOfWeekDisabled: numbersInRange('restrictions.daysOfWeekDisabled', 0, 6),\n disabledTimeIntervals: ({ key, value, providedType, localization }) => {\n if (value === undefined) {\n return [];\n }\n if (!Array.isArray(value)) {\n Namespace.errorMessages.typeMismatch(\n key,\n providedType,\n 'array of { from: DateTime|Date, to: DateTime|Date }'\n );\n }\n const valueObject = value as { from: any; to: any }[]; //eslint-disable-line @typescript-eslint/no-explicit-any\n for (let i = 0; i < valueObject.length; i++) {\n Object.keys(valueObject[i]).forEach((vk) => {\n const subOptionName = `${key}[${i}].${vk}`;\n const d = valueObject[i][vk];\n const dateTime = convertToDateTime(d, subOptionName, localization);\n if (!dateTime) {\n Namespace.errorMessages.typeMismatch(\n subOptionName,\n typeof d,\n 'DateTime or Date'\n );\n }\n dateTime.setLocalization(localization);\n valueObject[i][vk] = dateTime;\n });\n }\n return valueObject;\n },\n toolbarPlacement: validKeyOption(['top', 'bottom', 'default']),\n type: validKeyOption(['icons', 'sprites']),\n viewMode: validKeyOption([\n 'clock',\n 'calendar',\n 'months',\n 'years',\n 'decades',\n ]),\n theme: validKeyOption(['light', 'dark', 'auto']),\n placement: validKeyOption(['top', 'bottom']),\n meta: ({ value }) => value,\n dayViewHeaderFormat: ({ value }) => value,\n container: ({ value, path }) => {\n if (\n value &&\n !(\n value instanceof HTMLElement ||\n value instanceof Element ||\n value?.appendChild\n )\n ) {\n Namespace.errorMessages.typeMismatch(\n path.substring(1),\n typeof value,\n 'HTMLElement'\n );\n }\n return value;\n },\n useTwentyfourHour: ({ value, path, providedType, defaultType }) => {\n Namespace.errorMessages.deprecatedWarning(\n 'useTwentyfourHour',\n 'Please use \"options.localization.hourCycle\" instead'\n );\n if (value === undefined || providedType === 'boolean') return value;\n Namespace.errorMessages.typeMismatch(path, providedType, defaultType);\n },\n hourCycle: validKeyOption(['h11', 'h12', 'h23', 'h24']),\n });\n\nconst defaultProcessor: OptionProcessorFunction = ({\n value,\n defaultType,\n providedType,\n path,\n}) => {\n switch (defaultType) {\n case 'boolean':\n return value === 'true' || value === true;\n case 'number':\n return +value;\n case 'string':\n return value.toString();\n case 'object':\n return {};\n case 'function':\n return value;\n default:\n Namespace.errorMessages.typeMismatch(path, providedType, defaultType);\n }\n};\n\nexport function processKey(this: void, args: OptionProcessorFunctionArguments) {\n return (optionProcessors[args.key] || defaultProcessor)(args);\n}\n","import Namespace from './namespace';\nimport { DateTime } from '../datetime';\nimport DefaultOptions from './default-options';\nimport Options, { FormatLocalization } from './options';\nimport { processKey } from './optionProcessor';\nimport {\n convertToDateTime,\n tryConvertToDateTime,\n typeCheckDateArray,\n typeCheckNumberArray,\n} from './typeChecker';\n\nexport class OptionConverter {\n private static ignoreProperties = [\n 'meta',\n 'dayViewHeaderFormat',\n 'container',\n 'dateForms',\n 'ordinal',\n ];\n\n static deepCopy(input): Options {\n const o = {};\n\n Object.keys(input).forEach((key) => {\n const inputElement = input[key];\n\n if (inputElement instanceof DateTime) {\n o[key] = inputElement.clone;\n return;\n } else if (inputElement instanceof Date) {\n o[key] = new Date(inputElement.valueOf());\n return;\n }\n\n o[key] = inputElement;\n if (\n typeof inputElement !== 'object' ||\n inputElement instanceof HTMLElement ||\n inputElement instanceof Element\n )\n return;\n if (!Array.isArray(inputElement)) {\n o[key] = OptionConverter.deepCopy(inputElement);\n }\n });\n\n return o;\n }\n\n private static isValue = (a) => a != null; // everything except undefined + null\n\n /**\n * Finds value out of an object based on a string, period delimited, path\n * @param paths\n * @param obj\n */\n static objectPath(paths: string, obj) {\n if (paths.charAt(0) === '.') paths = paths.slice(1);\n if (!paths) return obj;\n return paths\n .split('.')\n .reduce(\n (value, key) =>\n OptionConverter.isValue(value) || OptionConverter.isValue(value[key])\n ? value[key]\n : undefined,\n obj\n );\n }\n\n /**\n * The spread operator caused sub keys to be missing after merging.\n * This is to fix that issue by using spread on the child objects first.\n * Also handles complex options like disabledDates\n * @param provided An option from new providedOptions\n * @param copyTo Destination object. This was added to prevent reference copies\n * @param localization\n * @param path\n */\n static spread(provided, copyTo, localization: FormatLocalization, path = '') {\n const defaultOptions = OptionConverter.objectPath(path, DefaultOptions);\n\n const unsupportedOptions = Object.keys(provided).filter(\n (x) => !Object.keys(defaultOptions).includes(x)\n );\n\n if (unsupportedOptions.length > 0) {\n const flattenedOptions = OptionConverter.getFlattenDefaultOptions();\n\n const errors = unsupportedOptions.map((x) => {\n let error = `\"${path}.${x}\" in not a known option.`;\n const didYouMean = flattenedOptions.find((y) => y.includes(x));\n if (didYouMean) error += ` Did you mean \"${didYouMean}\"?`;\n return error;\n });\n Namespace.errorMessages.unexpectedOptions(errors);\n }\n\n Object.keys(provided)\n .filter((key) => key !== '__proto__' && key !== 'constructor')\n .forEach((key) => {\n path += `.${key}`;\n if (path.charAt(0) === '.') path = path.slice(1);\n\n const defaultOptionValue = defaultOptions[key];\n const providedType = typeof provided[key];\n const defaultType = typeof defaultOptionValue;\n const value = provided[key];\n\n if (value === undefined || value === null) {\n copyTo[key] = value;\n path = path.substring(0, path.lastIndexOf(`.${key}`));\n return;\n }\n\n if (\n typeof defaultOptionValue === 'object' &&\n !Array.isArray(provided[key]) &&\n !(\n defaultOptionValue instanceof Date ||\n OptionConverter.ignoreProperties.includes(key)\n )\n ) {\n OptionConverter.spread(\n provided[key],\n copyTo[key],\n localization,\n path\n );\n } else {\n copyTo[key] = OptionConverter.processKey(\n key,\n value,\n providedType,\n defaultType,\n path,\n localization\n );\n }\n\n path = path.substring(0, path.lastIndexOf(`.${key}`));\n });\n }\n\n static processKey(\n key: string,\n value: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n providedType: string,\n defaultType: string,\n path: string,\n localization: FormatLocalization\n ) {\n return processKey({\n key,\n value,\n providedType,\n defaultType,\n path,\n localization,\n });\n }\n\n static _mergeOptions(providedOptions: Options, mergeTo: Options): Options {\n const newConfig = OptionConverter.deepCopy(mergeTo);\n //see if the options specify a locale\n const localization =\n mergeTo.localization?.locale !== 'default'\n ? mergeTo.localization\n : providedOptions?.localization || DefaultOptions.localization;\n\n OptionConverter.spread(providedOptions, newConfig, localization, '');\n\n return newConfig;\n }\n\n static _dataToOptions(element, options: Options): Options {\n const eData = JSON.parse(JSON.stringify(element.dataset));\n\n if (eData?.tdTargetInput) delete eData.tdTargetInput;\n if (eData?.tdTargetToggle) delete eData.tdTargetToggle;\n\n if (\n !eData ||\n Object.keys(eData).length === 0 ||\n eData.constructor !== DOMStringMap\n )\n return options;\n const dataOptions = {} as Options;\n\n // because dataset returns camelCase including the 'td' key the option\n // key won't align\n const objectToNormalized = (object) => {\n const lowered = {};\n Object.keys(object).forEach((x) => {\n lowered[x.toLowerCase()] = x;\n });\n\n return lowered;\n };\n\n const normalizeObject = this.normalizeObject(objectToNormalized);\n const optionsLower = objectToNormalized(options);\n\n Object.keys(eData)\n .filter((x) => x.startsWith(Namespace.dataKey))\n .map((x) => x.substring(2))\n .forEach((key) => {\n let keyOption = optionsLower[key.toLowerCase()];\n\n // dataset merges dashes to camelCase... yay\n // i.e. key = display_components_seconds\n if (key.includes('_')) {\n // [display, components, seconds]\n const split = key.split('_');\n // display\n keyOption = optionsLower[split[0].toLowerCase()];\n if (\n keyOption !== undefined &&\n options[keyOption].constructor === Object\n ) {\n dataOptions[keyOption] = normalizeObject(\n split,\n 1,\n options[keyOption],\n eData[`td${key}`]\n );\n }\n }\n // or key = multipleDate\n else if (keyOption !== undefined) {\n dataOptions[keyOption] = eData[`td${key}`];\n }\n });\n\n return this._mergeOptions(dataOptions, options);\n }\n\n //todo clean this up\n private static normalizeObject(objectToNormalized: (object) => object) {\n const normalizeObject = (\n split: string[],\n index: number,\n optionSubgroup: unknown,\n value: unknown\n ) => {\n // first round = display { ... }\n const normalizedOptions = objectToNormalized(optionSubgroup);\n\n const keyOption = normalizedOptions[split[index].toLowerCase()];\n const internalObject = {};\n\n if (keyOption === undefined) return internalObject;\n\n // if this is another object, continue down the rabbit hole\n if (optionSubgroup[keyOption].constructor === Object) {\n index++;\n internalObject[keyOption] = normalizeObject(\n split,\n index,\n optionSubgroup[keyOption],\n value\n );\n } else {\n internalObject[keyOption] = value;\n }\n return internalObject;\n };\n return normalizeObject;\n }\n\n /**\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\n * @param d If a string will attempt creating a date from it.\n * @param localization object containing locale and format settings. Only used with the custom formats\n * @private\n */\n static _dateTypeCheck(\n d: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n localization: FormatLocalization\n ): DateTime | null {\n return tryConvertToDateTime(d, localization);\n }\n\n /**\n * Type checks that `value` is an array of Date or DateTime\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param value Option value\n * @param providedType Used to provide text to error messages\n * @param localization\n */\n static _typeCheckDateArray(\n optionName: string,\n value,\n providedType: string,\n localization: FormatLocalization\n ) {\n return typeCheckDateArray(optionName, value, providedType, localization);\n }\n\n /**\n * Type checks that `value` is an array of numbers\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param value Option value\n * @param providedType Used to provide text to error messages\n */\n static _typeCheckNumberArray(\n optionName: string,\n value,\n providedType: string\n ) {\n return typeCheckNumberArray(optionName, value, providedType);\n }\n\n /**\n * Attempts to convert `d` to a DateTime object\n * @param d value to convert\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param localization object containing locale and format settings. Only used with the custom formats\n */\n static dateConversion(\n d: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n optionName: string,\n localization: FormatLocalization\n ): DateTime {\n return convertToDateTime(d, optionName, localization);\n }\n\n private static _flattenDefaults: string[];\n\n private static getFlattenDefaultOptions(): string[] {\n if (this._flattenDefaults) return this._flattenDefaults;\n const deepKeys = (t, pre = []) => {\n if (Array.isArray(t)) return [];\n if (Object(t) === t) {\n return Object.entries(t).flatMap(([k, v]) => deepKeys(v, [...pre, k]));\n } else {\n return pre.join('.');\n }\n };\n\n this._flattenDefaults = deepKeys(DefaultOptions);\n\n return this._flattenDefaults;\n }\n\n /**\n * Some options conflict like min/max date. Verify that these kinds of options\n * are set correctly.\n * @param config\n */\n static _validateConflicts(config: Options) {\n if (\n config.display.sideBySide &&\n (!config.display.components.clock ||\n !(\n config.display.components.hours ||\n config.display.components.minutes ||\n config.display.components.seconds\n ))\n ) {\n Namespace.errorMessages.conflictingConfiguration(\n 'Cannot use side by side mode without the clock components'\n );\n }\n\n if (config.restrictions.minDate && config.restrictions.maxDate) {\n if (config.restrictions.minDate.isAfter(config.restrictions.maxDate)) {\n Namespace.errorMessages.conflictingConfiguration(\n 'minDate is after maxDate'\n );\n }\n\n if (config.restrictions.maxDate.isBefore(config.restrictions.minDate)) {\n Namespace.errorMessages.conflictingConfiguration(\n 'maxDate is before minDate'\n );\n }\n }\n\n if (config.multipleDates && config.dateRange) {\n Namespace.errorMessages.conflictingConfiguration(\n 'Cannot uss option \"multipleDates\" with \"dateRange\"'\n );\n }\n }\n}\n","import { DateTime, getFormatByUnit, Unit } from './datetime';\nimport Namespace from './utilities/namespace';\nimport { ChangeEvent, FailEvent } from './utilities/event-types';\nimport Validation from './validation';\nimport { serviceLocator } from './utilities/service-locator';\nimport { EventEmitters } from './utilities/event-emitter';\nimport { OptionsStore } from './utilities/optionsStore';\nimport { OptionConverter } from './utilities/optionConverter';\n\nexport default class Dates {\n private _dates: DateTime[] = [];\n private optionsStore: OptionsStore;\n private validation: Validation;\n private _eventEmitters: EventEmitters;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.validation = serviceLocator.locate(Validation);\n this._eventEmitters = serviceLocator.locate(EventEmitters);\n }\n\n /**\n * Returns the array of selected dates\n */\n get picked(): DateTime[] {\n return this._dates;\n }\n\n /**\n * Returns the last picked value.\n */\n get lastPicked(): DateTime {\n return this._dates[this.lastPickedIndex];\n }\n\n /**\n * Returns the length of picked dates -1 or 0 if none are selected.\n */\n get lastPickedIndex(): number {\n if (this._dates.length === 0) return 0;\n return this._dates.length - 1;\n }\n\n /**\n * Formats a DateTime object to a string. Used when setting the input value.\n * @param date\n */\n formatInput(date: DateTime): string {\n if (!date) return '';\n date.localization = this.optionsStore.options.localization;\n return date.format();\n }\n\n /**\n * parse the value into a DateTime object.\n * this can be overwritten to supply your own parsing.\n */\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n parseInput(value: any): DateTime {\n return OptionConverter.dateConversion(\n value,\n 'input',\n this.optionsStore.options.localization\n );\n }\n\n /**\n * Tries to convert the provided value to a DateTime object.\n * If value is null|undefined then clear the value of the provided index (or 0).\n * @param value Value to convert or null|undefined\n * @param index When using multidates this is the index in the array\n */\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n setFromInput(value: any, index?: number) {\n if (!value) {\n this.setValue(undefined, index);\n return;\n }\n const converted = this.parseInput(value);\n if (converted) {\n converted.setLocalization(this.optionsStore.options.localization);\n this.setValue(converted, index);\n }\n }\n\n /**\n * Adds a new DateTime to selected dates array\n * @param date\n */\n add(date: DateTime): void {\n this._dates.push(date);\n }\n\n /**\n * Returns true if the `targetDate` is part of the selected dates array.\n * If `unit` is provided then a granularity to that unit will be used.\n * @param targetDate\n * @param unit\n */\n isPicked(targetDate: DateTime, unit?: Unit): boolean {\n if (!DateTime.isValid(targetDate)) return false;\n if (!unit)\n return this._dates.find((x) => x.isSame(targetDate)) !== undefined;\n\n const format = getFormatByUnit(unit);\n\n const innerDateFormatted = targetDate.format(format);\n\n return (\n this._dates\n .map((x) => x.format(format))\n .find((x) => x === innerDateFormatted) !== undefined\n );\n }\n\n /**\n * Returns the index at which `targetDate` is in the array.\n * This is used for updating or removing a date when multi-date is used\n * If `unit` is provided then a granularity to that unit will be used.\n * @param targetDate\n * @param unit\n */\n pickedIndex(targetDate: DateTime, unit?: Unit): number {\n if (!DateTime.isValid(targetDate)) return -1;\n if (!unit)\n return this._dates.map((x) => x.valueOf()).indexOf(targetDate.valueOf());\n\n const format = getFormatByUnit(unit);\n\n const innerDateFormatted = targetDate.format(format);\n\n return this._dates.map((x) => x.format(format)).indexOf(innerDateFormatted);\n }\n\n /**\n * Clears all selected dates.\n */\n clear() {\n this.optionsStore.unset = true;\n this._eventEmitters.triggerEvent.emit({\n type: Namespace.events.change,\n date: undefined,\n oldDate: this.lastPicked,\n isClear: true,\n isValid: true,\n } as ChangeEvent);\n this._dates = [];\n if (this.optionsStore.input) this.optionsStore.input.value = '';\n this._eventEmitters.updateDisplay.emit('all');\n }\n\n /**\n * Find the \"book end\" years given a `year` and a `factor`\n * @param factor e.g. 100 for decades\n * @param year e.g. 2021\n */\n static getStartEndYear(\n factor: number,\n year: number\n ): [number, number, number] {\n const step = factor / 10,\n startYear = Math.floor(year / factor) * factor,\n endYear = startYear + step * 9,\n focusValue = Math.floor(year / step) * step;\n return [startYear, endYear, focusValue];\n }\n\n updateInput(target?: DateTime) {\n if (!this.optionsStore.input) return;\n\n let newValue = this.formatInput(target);\n if (\n this.optionsStore.options.multipleDates ||\n this.optionsStore.options.dateRange\n ) {\n newValue = this._dates\n .map((d) => this.formatInput(d))\n .join(this.optionsStore.options.multipleDatesSeparator);\n }\n if (this.optionsStore.input.value != newValue)\n this.optionsStore.input.value = newValue;\n }\n\n /**\n * Attempts to either clear or set the `target` date at `index`.\n * If the `target` is null then the date will be cleared.\n * If multi-date is being used then it will be removed from the array.\n * If `target` is valid and multi-date is used then if `index` is\n * provided the date at that index will be replaced, otherwise it is appended.\n * @param target\n * @param index\n */\n setValue(target?: DateTime, index?: number): void {\n const noIndex = typeof index === 'undefined',\n isClear = !target && noIndex;\n let oldDate = this.optionsStore.unset ? null : this._dates[index];\n if (!oldDate && !this.optionsStore.unset && noIndex && isClear) {\n oldDate = this.lastPicked;\n }\n\n if (target && oldDate?.isSame(target)) {\n this.updateInput(target);\n return;\n }\n\n // case of calling setValue(null)\n if (!target) {\n this._setValueNull(isClear, index, oldDate);\n return;\n }\n\n index = index || 0;\n target = target.clone;\n\n // minute stepping is being used, force the minute to the closest value\n if (this.optionsStore.options.stepping !== 1) {\n target.minutes =\n Math.round(target.minutes / this.optionsStore.options.stepping) *\n this.optionsStore.options.stepping;\n target.startOf(Unit.minutes);\n }\n\n const onUpdate = (isValid: boolean) => {\n this._dates[index] = target;\n this._eventEmitters.updateViewDate.emit(target.clone);\n\n this.updateInput(target);\n\n this.optionsStore.unset = false;\n this._eventEmitters.updateDisplay.emit('all');\n this._eventEmitters.triggerEvent.emit({\n type: Namespace.events.change,\n date: target,\n oldDate,\n isClear,\n isValid: isValid,\n } as ChangeEvent);\n };\n\n if (\n this.validation.isValid(target) &&\n this.validation.dateRangeIsValid(this._dates, index, target)\n ) {\n onUpdate(true);\n return;\n }\n\n if (this.optionsStore.options.keepInvalid) {\n onUpdate(false);\n }\n\n this._eventEmitters.triggerEvent.emit({\n type: Namespace.events.error,\n reason: Namespace.errorMessages.failedToSetInvalidDate,\n date: target,\n oldDate,\n } as FailEvent);\n }\n\n private _setValueNull(isClear: boolean, index: number, oldDate: DateTime) {\n if (\n !this.optionsStore.options.multipleDates ||\n this._dates.length === 1 ||\n isClear\n ) {\n this.optionsStore.unset = true;\n this._dates = [];\n } else {\n this._dates.splice(index, 1);\n }\n\n this.updateInput();\n\n this._eventEmitters.triggerEvent.emit({\n type: Namespace.events.change,\n date: undefined,\n oldDate,\n isClear,\n isValid: true,\n } as ChangeEvent);\n\n this._eventEmitters.updateDisplay.emit('all');\n }\n}\n","enum ActionTypes {\n next = 'next',\n previous = 'previous',\n changeCalendarView = 'changeCalendarView',\n selectMonth = 'selectMonth',\n selectYear = 'selectYear',\n selectDecade = 'selectDecade',\n selectDay = 'selectDay',\n selectHour = 'selectHour',\n selectMinute = 'selectMinute',\n selectSecond = 'selectSecond',\n incrementHours = 'incrementHours',\n incrementMinutes = 'incrementMinutes',\n incrementSeconds = 'incrementSeconds',\n decrementHours = 'decrementHours',\n decrementMinutes = 'decrementMinutes',\n decrementSeconds = 'decrementSeconds',\n toggleMeridiem = 'toggleMeridiem',\n togglePicker = 'togglePicker',\n showClock = 'showClock',\n showHours = 'showHours',\n showMinutes = 'showMinutes',\n showSeconds = 'showSeconds',\n clear = 'clear',\n close = 'close',\n today = 'today',\n}\n\nexport default ActionTypes;\n","import { DateTime, Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport Dates from '../../dates';\nimport { Paint } from '../index';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `date`\n */\nexport default class DateDisplay {\n private optionsStore: OptionsStore;\n private dates: Dates;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n }\n\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.daysContainer);\n\n container.append(...this._daysOfTheWeek());\n\n if (this.optionsStore.options.display.calendarWeeks) {\n const div = document.createElement('div');\n div.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight);\n container.appendChild(div);\n }\n\n const { rangeHoverEvent, rangeHoverOutEvent } =\n this.handleMouseEvents(container);\n\n for (let i = 0; i < 42; i++) {\n if (i !== 0 && i % 7 === 0) {\n if (this.optionsStore.options.display.calendarWeeks) {\n const div = document.createElement('div');\n div.classList.add(\n Namespace.css.calendarWeeks,\n Namespace.css.noHighlight\n );\n container.appendChild(div);\n }\n }\n\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectDay);\n container.appendChild(div);\n\n // if hover is supported then add the events\n if (\n matchMedia('(hover: hover)').matches &&\n this.optionsStore.options.dateRange\n ) {\n div.addEventListener('mouseover', rangeHoverEvent);\n div.addEventListener('mouseout', rangeHoverOutEvent);\n }\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint): void {\n const container = widget.getElementsByClassName(\n Namespace.css.daysContainer\n )[0] as HTMLElement;\n\n this._updateCalendarView(container);\n\n const innerDate = this.optionsStore.viewDate.clone\n .startOf(Unit.month)\n .startOf('weekDay', this.optionsStore.options.localization.startOfTheWeek)\n .manipulate(12, Unit.hours);\n\n this._handleCalendarWeeks(container, innerDate.clone);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectDay}\"]`)\n .forEach((element: HTMLElement) => {\n const classes: string[] = [];\n classes.push(Namespace.css.day);\n\n if (innerDate.isBefore(this.optionsStore.viewDate, Unit.month)) {\n classes.push(Namespace.css.old);\n }\n if (innerDate.isAfter(this.optionsStore.viewDate, Unit.month)) {\n classes.push(Namespace.css.new);\n }\n\n if (\n !this.optionsStore.unset &&\n !this.optionsStore.options.multipleDates &&\n this.dates.isPicked(innerDate, Unit.date)\n ) {\n classes.push(Namespace.css.active);\n }\n if (!this.validation.isValid(innerDate, Unit.date)) {\n classes.push(Namespace.css.disabled);\n }\n if (innerDate.isSame(new DateTime(), Unit.date)) {\n classes.push(Namespace.css.today);\n }\n if (innerDate.weekDay === 0 || innerDate.weekDay === 6) {\n classes.push(Namespace.css.weekend);\n }\n\n this._handleDateRange(innerDate, classes);\n\n paint(Unit.date, innerDate, classes, element);\n\n element.classList.remove(...element.classList);\n element.classList.add(...classes);\n element.setAttribute('data-value', this._dateToDataValue(innerDate));\n element.setAttribute('data-day', `${innerDate.date}`);\n element.innerText = innerDate.parts(undefined, {\n day: 'numeric',\n }).day;\n innerDate.manipulate(1, Unit.date);\n });\n }\n\n private _dateToDataValue(date: DateTime): string {\n if (!DateTime.isValid(date)) return '';\n\n return `${date.year}-${date.monthFormatted}-${date.dateFormatted}`;\n }\n\n private _handleDateRange(innerDate: DateTime, classes: string[]) {\n const rangeStart = this.dates.picked[0];\n const rangeEnd = this.dates.picked[1];\n\n if (this.optionsStore.options.dateRange) {\n if (innerDate.isBetween(rangeStart, rangeEnd, Unit.date)) {\n classes.push(Namespace.css.rangeIn);\n }\n\n if (innerDate.isSame(rangeStart, Unit.date)) {\n classes.push(Namespace.css.rangeStart);\n }\n\n if (innerDate.isSame(rangeEnd, Unit.date)) {\n classes.push(Namespace.css.rangeEnd);\n }\n }\n }\n\n private handleMouseEvents(container: HTMLElement) {\n const rangeHoverEvent = (e: MouseEvent) => {\n const currentTarget = e?.currentTarget as HTMLElement;\n\n // if we have 0 or 2 selected or if the target is disabled then ignore\n if (\n this.dates.picked.length !== 1 ||\n currentTarget.classList.contains(Namespace.css.disabled)\n )\n return;\n\n // select all the date divs\n const allDays = [...container.querySelectorAll('.day')] as HTMLElement[];\n\n // get the date value from the element being hovered over\n const attributeValue = currentTarget.getAttribute('data-value');\n\n // format the string to a date\n const innerDate = DateTime.fromString(attributeValue, {\n format: 'yyyy-MM-dd',\n });\n\n // find the position of the target in the date container\n const dayIndex = allDays.findIndex(\n (e) => e.getAttribute('data-value') === attributeValue\n );\n\n // find the first and second selected dates\n const rangeStart = this.dates.picked[0];\n const rangeEnd = this.dates.picked[1];\n\n //format the start date so that it can be found by the attribute\n const rangeStartFormatted = this._dateToDataValue(rangeStart);\n const rangeStartIndex = allDays.findIndex(\n (e) => e.getAttribute('data-value') === rangeStartFormatted\n );\n const rangeStartElement = allDays[rangeStartIndex];\n\n //make sure we don't leave start/end classes if we don't need them\n if (!innerDate.isSame(rangeStart, Unit.date)) {\n currentTarget.classList.remove(Namespace.css.rangeStart);\n }\n\n if (!innerDate.isSame(rangeEnd, Unit.date)) {\n currentTarget.classList.remove(Namespace.css.rangeEnd);\n }\n\n // the following figures out which direct from start date is selected\n // the selection \"cap\" classes are applied if needed\n // otherwise all the dates between will get the `rangeIn` class.\n // We make this selection based on the element's index and the rangeStart index\n\n let lambda: (_, index) => boolean;\n\n if (innerDate.isBefore(rangeStart)) {\n currentTarget.classList.add(Namespace.css.rangeStart);\n rangeStartElement?.classList.remove(Namespace.css.rangeStart);\n rangeStartElement?.classList.add(Namespace.css.rangeEnd);\n lambda = (_, index) => index > dayIndex && index < rangeStartIndex;\n } else {\n currentTarget.classList.add(Namespace.css.rangeEnd);\n rangeStartElement?.classList.remove(Namespace.css.rangeEnd);\n rangeStartElement?.classList.add(Namespace.css.rangeStart);\n lambda = (_, index) => index < dayIndex && index > rangeStartIndex;\n }\n\n allDays.filter(lambda).forEach((e) => {\n e.classList.add(Namespace.css.rangeIn);\n });\n };\n\n const rangeHoverOutEvent = (e: MouseEvent) => {\n // find all the dates in the container\n const allDays = [...container.querySelectorAll('.day')] as HTMLElement[];\n\n // if only the start is selected, remove all the rangeIn classes\n // we do this because once the user hovers over a new date the range will be recalculated.\n if (this.dates.picked.length === 1)\n allDays.forEach((e) => e.classList.remove(Namespace.css.rangeIn));\n\n // if we have 0 or 2 dates selected then ignore\n if (this.dates.picked.length !== 1) return;\n\n const currentTarget = e?.currentTarget as HTMLElement;\n\n // get the elements date from the attribute value\n const innerDate = new DateTime(currentTarget.getAttribute('data-value'));\n\n // verify selections and remove invalid classes\n if (!innerDate.isSame(this.dates.picked[0], Unit.date)) {\n currentTarget.classList.remove(Namespace.css.rangeStart);\n }\n\n if (!innerDate.isSame(this.dates.picked[1], Unit.date)) {\n currentTarget.classList.remove(Namespace.css.rangeEnd);\n }\n };\n\n return { rangeHoverEvent, rangeHoverOutEvent };\n }\n\n private _updateCalendarView(container: Element) {\n if (this.optionsStore.currentView !== 'calendar') return;\n const [previous, switcher, next] = container.parentElement\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\n .getElementsByTagName('div');\n switcher.setAttribute(\n Namespace.css.daysContainer,\n this.optionsStore.viewDate.format(\n this.optionsStore.options.localization.dayViewHeaderFormat\n )\n );\n this.optionsStore.options.display.components.month\n ? switcher.classList.remove(Namespace.css.disabled)\n : switcher.classList.add(Namespace.css.disabled);\n this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.month),\n Unit.month\n )\n ? previous.classList.remove(Namespace.css.disabled)\n : previous.classList.add(Namespace.css.disabled);\n this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(1, Unit.month),\n Unit.month\n )\n ? next.classList.remove(Namespace.css.disabled)\n : next.classList.add(Namespace.css.disabled);\n }\n\n /***\n * Generates a html row that contains the days of the week.\n * @private\n */\n private _daysOfTheWeek(): HTMLElement[] {\n const innerDate = this.optionsStore.viewDate.clone\n .startOf('weekDay', this.optionsStore.options.localization.startOfTheWeek)\n .startOf(Unit.date);\n const row = [];\n document.createElement('div');\n\n if (this.optionsStore.options.display.calendarWeeks) {\n const htmlDivElement = document.createElement('div');\n htmlDivElement.classList.add(\n Namespace.css.calendarWeeks,\n Namespace.css.noHighlight\n );\n htmlDivElement.innerText = '#';\n row.push(htmlDivElement);\n }\n\n for (let i = 0; i < 7; i++) {\n const htmlDivElement = document.createElement('div');\n htmlDivElement.classList.add(\n Namespace.css.dayOfTheWeek,\n Namespace.css.noHighlight\n );\n htmlDivElement.innerText = innerDate.format({ weekday: 'short' });\n innerDate.manipulate(1, Unit.date);\n row.push(htmlDivElement);\n }\n\n return row;\n }\n\n private _handleCalendarWeeks(container: HTMLElement, innerDate: DateTime) {\n [...container.querySelectorAll(`.${Namespace.css.calendarWeeks}`)]\n .filter((e: HTMLElement) => e.innerText !== '#')\n .forEach((element: HTMLElement) => {\n element.innerText = `${innerDate.week}`;\n innerDate.manipulate(7, Unit.date);\n });\n }\n}\n","import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport Dates from '../../dates';\nimport { Paint } from '../index';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `month`\n */\nexport default class MonthDisplay {\n private optionsStore: OptionsStore;\n private dates: Dates;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n }\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.monthsContainer);\n\n for (let i = 0; i < 12; i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectMonth);\n container.appendChild(div);\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint): void {\n const container = widget.getElementsByClassName(\n Namespace.css.monthsContainer\n )[0];\n\n if (this.optionsStore.currentView === 'months') {\n const [previous, switcher, next] = container.parentElement\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\n .getElementsByTagName('div');\n\n switcher.setAttribute(\n Namespace.css.monthsContainer,\n this.optionsStore.viewDate.format({ year: 'numeric' })\n );\n\n this.optionsStore.options.display.components.year\n ? switcher.classList.remove(Namespace.css.disabled)\n : switcher.classList.add(Namespace.css.disabled);\n\n this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.year),\n Unit.year\n )\n ? previous.classList.remove(Namespace.css.disabled)\n : previous.classList.add(Namespace.css.disabled);\n\n this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(1, Unit.year),\n Unit.year\n )\n ? next.classList.remove(Namespace.css.disabled)\n : next.classList.add(Namespace.css.disabled);\n }\n\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.year);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMonth}\"]`)\n .forEach((containerClone: HTMLElement, index) => {\n const classes = [];\n classes.push(Namespace.css.month);\n\n if (\n !this.optionsStore.unset &&\n this.dates.isPicked(innerDate, Unit.month)\n ) {\n classes.push(Namespace.css.active);\n }\n if (!this.validation.isValid(innerDate, Unit.month)) {\n classes.push(Namespace.css.disabled);\n }\n\n paint(Unit.month, innerDate, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${index}`);\n containerClone.innerText = `${innerDate.format({ month: 'short' })}`;\n innerDate.manipulate(1, Unit.month);\n });\n }\n}\n","import { DateTime, Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Dates from '../../dates';\nimport Validation from '../../validation';\nimport { Paint } from '../index';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `year`\n */\nexport default class YearDisplay {\n private _startYear: DateTime;\n private _endYear: DateTime;\n private optionsStore: OptionsStore;\n private dates: Dates;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n }\n\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.yearsContainer);\n\n for (let i = 0; i < 12; i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectYear);\n container.appendChild(div);\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint) {\n this._startYear = this.optionsStore.viewDate.clone.manipulate(\n -1,\n Unit.year\n );\n this._endYear = this.optionsStore.viewDate.clone.manipulate(10, Unit.year);\n\n const container = widget.getElementsByClassName(\n Namespace.css.yearsContainer\n )[0];\n\n if (this.optionsStore.currentView === 'years') {\n const [previous, switcher, next] = container.parentElement\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\n .getElementsByTagName('div');\n\n switcher.setAttribute(\n Namespace.css.yearsContainer,\n `${this._startYear.format({ year: 'numeric' })}-${this._endYear.format({\n year: 'numeric',\n })}`\n );\n\n this.optionsStore.options.display.components.decades\n ? switcher.classList.remove(Namespace.css.disabled)\n : switcher.classList.add(Namespace.css.disabled);\n\n this.validation.isValid(this._startYear, Unit.year)\n ? previous.classList.remove(Namespace.css.disabled)\n : previous.classList.add(Namespace.css.disabled);\n this.validation.isValid(this._endYear, Unit.year)\n ? next.classList.remove(Namespace.css.disabled)\n : next.classList.add(Namespace.css.disabled);\n }\n\n const innerDate = this.optionsStore.viewDate.clone\n .startOf(Unit.year)\n .manipulate(-1, Unit.year);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectYear}\"]`)\n .forEach((containerClone: HTMLElement) => {\n const classes = [];\n classes.push(Namespace.css.year);\n\n if (\n !this.optionsStore.unset &&\n this.dates.isPicked(innerDate, Unit.year)\n ) {\n classes.push(Namespace.css.active);\n }\n if (!this.validation.isValid(innerDate, Unit.year)) {\n classes.push(Namespace.css.disabled);\n }\n\n paint(Unit.year, innerDate, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${innerDate.year}`);\n containerClone.innerText = innerDate.format({ year: 'numeric' });\n\n innerDate.manipulate(1, Unit.year);\n });\n }\n}\n","import Dates from '../../dates';\nimport { DateTime, Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport { Paint } from '../index';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `seconds`\n */\nexport default class DecadeDisplay {\n private _startDecade: DateTime;\n private _endDecade: DateTime;\n private optionsStore: OptionsStore;\n private dates: Dates;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n }\n\n /**\n * Build the container html for the display\n * @private\n */\n getPicker() {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.decadesContainer);\n\n for (let i = 0; i < 12; i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectDecade);\n container.appendChild(div);\n }\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint) {\n const [start, end] = Dates.getStartEndYear(\n 100,\n this.optionsStore.viewDate.year\n );\n this._startDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\n this._startDecade.year = start;\n this._endDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\n this._endDecade.year = end;\n\n const container = widget.getElementsByClassName(\n Namespace.css.decadesContainer\n )[0];\n\n const [previous, switcher, next] = container.parentElement\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\n .getElementsByTagName('div');\n\n if (this.optionsStore.currentView === 'decades') {\n switcher.setAttribute(\n Namespace.css.decadesContainer,\n `${this._startDecade.format({\n year: 'numeric',\n })}-${this._endDecade.format({ year: 'numeric' })}`\n );\n\n this.validation.isValid(this._startDecade, Unit.year)\n ? previous.classList.remove(Namespace.css.disabled)\n : previous.classList.add(Namespace.css.disabled);\n this.validation.isValid(this._endDecade, Unit.year)\n ? next.classList.remove(Namespace.css.disabled)\n : next.classList.add(Namespace.css.disabled);\n }\n\n const pickedYears = this.dates.picked.map((x) => x.year);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectDecade}\"]`)\n .forEach((containerClone: HTMLElement, index) => {\n if (index === 0) {\n containerClone.classList.add(Namespace.css.old);\n if (this._startDecade.year - 10 < 0) {\n containerClone.textContent = ' ';\n previous.classList.add(Namespace.css.disabled);\n containerClone.classList.add(Namespace.css.disabled);\n containerClone.setAttribute('data-value', '');\n return;\n } else {\n containerClone.innerText = this._startDecade.clone\n .manipulate(-10, Unit.year)\n .format({ year: 'numeric' });\n containerClone.setAttribute(\n 'data-value',\n `${this._startDecade.year}`\n );\n return;\n }\n }\n\n const classes = [];\n classes.push(Namespace.css.decade);\n const startDecadeYear = this._startDecade.year;\n const endDecadeYear = this._startDecade.year + 9;\n\n if (\n !this.optionsStore.unset &&\n pickedYears.filter((x) => x >= startDecadeYear && x <= endDecadeYear)\n .length > 0\n ) {\n classes.push(Namespace.css.active);\n }\n\n paint('decade', this._startDecade, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${this._startDecade.year}`);\n containerClone.innerText = `${this._startDecade.format({\n year: 'numeric',\n })}`;\n\n this._startDecade.manipulate(10, Unit.year);\n });\n }\n}\n","import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport Dates from '../../dates';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates the clock display\n */\nexport default class TimeDisplay {\n private _gridColumns = '';\n private optionsStore: OptionsStore;\n private validation: Validation;\n private dates: Dates;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n }\n\n /**\n * Build the container html for the clock display\n * @private\n */\n getPicker(iconTag: (iconClass: string) => HTMLElement): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.clockContainer);\n\n container.append(...this._grid(iconTag));\n\n return container;\n }\n\n /**\n * Populates the various elements with in the clock display\n * like the current hour and if the manipulation icons are enabled.\n * @private\n */\n _update(widget: HTMLElement): void {\n const timesDiv = (\n widget.getElementsByClassName(Namespace.css.clockContainer)[0]\n );\n let lastPicked = this.dates.lastPicked?.clone;\n if (!lastPicked && this.optionsStore.options.useCurrent)\n lastPicked = this.optionsStore.viewDate.clone;\n\n timesDiv\n .querySelectorAll('.disabled')\n .forEach((element) => element.classList.remove(Namespace.css.disabled));\n\n if (this.optionsStore.options.display.components.hours) {\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(1, Unit.hours),\n Unit.hours\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.incrementHours}]`)\n .classList.add(Namespace.css.disabled);\n }\n\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.hours),\n Unit.hours\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.decrementHours}]`)\n .classList.add(Namespace.css.disabled);\n }\n\n timesDiv.querySelector(\n `[data-time-component=${Unit.hours}]`\n ).innerText = lastPicked\n ? lastPicked.getHoursFormatted(\n this.optionsStore.options.localization.hourCycle\n )\n : '--';\n }\n\n if (this.optionsStore.options.display.components.minutes) {\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(1, Unit.minutes),\n Unit.minutes\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.incrementMinutes}]`)\n .classList.add(Namespace.css.disabled);\n }\n\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.minutes),\n Unit.minutes\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.decrementMinutes}]`)\n .classList.add(Namespace.css.disabled);\n }\n timesDiv.querySelector(\n `[data-time-component=${Unit.minutes}]`\n ).innerText = lastPicked ? lastPicked.minutesFormatted : '--';\n }\n\n if (this.optionsStore.options.display.components.seconds) {\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(1, Unit.seconds),\n Unit.seconds\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.incrementSeconds}]`)\n .classList.add(Namespace.css.disabled);\n }\n\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.seconds),\n Unit.seconds\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.decrementSeconds}]`)\n .classList.add(Namespace.css.disabled);\n }\n timesDiv.querySelector(\n `[data-time-component=${Unit.seconds}]`\n ).innerText = lastPicked ? lastPicked.secondsFormatted : '--';\n }\n\n if (this.optionsStore.isTwelveHour) {\n const toggle = timesDiv.querySelector(\n `[data-action=${ActionTypes.toggleMeridiem}]`\n );\n\n const meridiemDate = (lastPicked || this.optionsStore.viewDate).clone;\n\n toggle.innerText = meridiemDate.meridiem();\n\n if (\n !this.validation.isValid(\n meridiemDate.manipulate(\n meridiemDate.hours >= 12 ? -12 : 12,\n Unit.hours\n )\n )\n ) {\n toggle.classList.add(Namespace.css.disabled);\n } else {\n toggle.classList.remove(Namespace.css.disabled);\n }\n }\n\n timesDiv.style.gridTemplateAreas = `\"${this._gridColumns}\"`;\n }\n\n /**\n * Creates the table for the clock display depending on what options are selected.\n * @private\n */\n private _grid(iconTag: (iconClass: string) => HTMLElement): HTMLElement[] {\n this._gridColumns = '';\n const top = [],\n middle = [],\n bottom = [],\n separator = document.createElement('div'),\n upIcon = iconTag(this.optionsStore.options.display.icons.up),\n downIcon = iconTag(this.optionsStore.options.display.icons.down);\n\n separator.classList.add(Namespace.css.separator, Namespace.css.noHighlight);\n const separatorColon = separator.cloneNode(true);\n separatorColon.innerHTML = ':';\n\n const getSeparator = (colon = false): HTMLElement => {\n return colon\n ? separatorColon.cloneNode(true)\n : separator.cloneNode(true);\n };\n\n if (this.optionsStore.options.display.components.hours) {\n let divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.incrementHour\n );\n divElement.setAttribute('data-action', ActionTypes.incrementHours);\n divElement.appendChild(upIcon.cloneNode(true));\n top.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.pickHour\n );\n divElement.setAttribute('data-action', ActionTypes.showHours);\n divElement.setAttribute('data-time-component', Unit.hours);\n middle.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.decrementHour\n );\n divElement.setAttribute('data-action', ActionTypes.decrementHours);\n divElement.appendChild(downIcon.cloneNode(true));\n bottom.push(divElement);\n this._gridColumns += 'a';\n }\n\n if (this.optionsStore.options.display.components.minutes) {\n this._gridColumns += ' a';\n if (this.optionsStore.options.display.components.hours) {\n top.push(getSeparator());\n middle.push(getSeparator(true));\n bottom.push(getSeparator());\n this._gridColumns += ' a';\n }\n let divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.incrementMinute\n );\n divElement.setAttribute('data-action', ActionTypes.incrementMinutes);\n divElement.appendChild(upIcon.cloneNode(true));\n top.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.pickMinute\n );\n divElement.setAttribute('data-action', ActionTypes.showMinutes);\n divElement.setAttribute('data-time-component', Unit.minutes);\n middle.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.decrementMinute\n );\n divElement.setAttribute('data-action', ActionTypes.decrementMinutes);\n divElement.appendChild(downIcon.cloneNode(true));\n bottom.push(divElement);\n }\n\n if (this.optionsStore.options.display.components.seconds) {\n this._gridColumns += ' a';\n if (this.optionsStore.options.display.components.minutes) {\n top.push(getSeparator());\n middle.push(getSeparator(true));\n bottom.push(getSeparator());\n this._gridColumns += ' a';\n }\n let divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.incrementSecond\n );\n divElement.setAttribute('data-action', ActionTypes.incrementSeconds);\n divElement.appendChild(upIcon.cloneNode(true));\n top.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.pickSecond\n );\n divElement.setAttribute('data-action', ActionTypes.showSeconds);\n divElement.setAttribute('data-time-component', Unit.seconds);\n middle.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.decrementSecond\n );\n divElement.setAttribute('data-action', ActionTypes.decrementSeconds);\n divElement.appendChild(downIcon.cloneNode(true));\n bottom.push(divElement);\n }\n\n if (this.optionsStore.isTwelveHour) {\n this._gridColumns += ' a';\n let divElement = getSeparator();\n top.push(divElement);\n\n const button = document.createElement('button');\n button.setAttribute(\n 'title',\n this.optionsStore.options.localization.toggleMeridiem\n );\n button.setAttribute('data-action', ActionTypes.toggleMeridiem);\n button.setAttribute('tabindex', '-1');\n if (Namespace.css.toggleMeridiem.includes(',')) {\n //todo move this to paint function?\n button.classList.add(...Namespace.css.toggleMeridiem.split(','));\n } else button.classList.add(Namespace.css.toggleMeridiem);\n\n divElement = document.createElement('div');\n divElement.classList.add(Namespace.css.noHighlight);\n divElement.appendChild(button);\n middle.push(divElement);\n\n divElement = getSeparator();\n bottom.push(divElement);\n }\n\n this._gridColumns = this._gridColumns.trim();\n\n return [...top, ...middle, ...bottom];\n }\n}\n","import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport { Paint } from '../index';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `hours`\n */\nexport default class HourDisplay {\n private optionsStore: OptionsStore;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.validation = serviceLocator.locate(Validation);\n }\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.hourContainer);\n\n for (let i = 0; i < (this.optionsStore.isTwelveHour ? 12 : 24); i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectHour);\n container.appendChild(div);\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint): void {\n const container = widget.getElementsByClassName(\n Namespace.css.hourContainer\n )[0];\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.date);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectHour}\"]`)\n .forEach((containerClone: HTMLElement) => {\n const classes = [];\n classes.push(Namespace.css.hour);\n\n if (!this.validation.isValid(innerDate, Unit.hours)) {\n classes.push(Namespace.css.disabled);\n }\n\n paint(Unit.hours, innerDate, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${innerDate.hours}`);\n containerClone.innerText = innerDate.getHoursFormatted(\n this.optionsStore.options.localization.hourCycle\n );\n innerDate.manipulate(1, Unit.hours);\n });\n }\n}\n","import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport { Paint } from '../index';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `minutes`\n */\nexport default class MinuteDisplay {\n private optionsStore: OptionsStore;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.validation = serviceLocator.locate(Validation);\n }\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.minuteContainer);\n\n const step =\n this.optionsStore.options.stepping === 1\n ? 5\n : this.optionsStore.options.stepping;\n for (let i = 0; i < 60 / step; i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectMinute);\n container.appendChild(div);\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint): void {\n const container = widget.getElementsByClassName(\n Namespace.css.minuteContainer\n )[0];\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.hours);\n const step =\n this.optionsStore.options.stepping === 1\n ? 5\n : this.optionsStore.options.stepping;\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMinute}\"]`)\n .forEach((containerClone: HTMLElement) => {\n const classes = [];\n classes.push(Namespace.css.minute);\n\n if (!this.validation.isValid(innerDate, Unit.minutes)) {\n classes.push(Namespace.css.disabled);\n }\n\n paint(Unit.minutes, innerDate, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${innerDate.minutes}`);\n containerClone.innerText = innerDate.minutesFormatted;\n innerDate.manipulate(step, Unit.minutes);\n });\n }\n}\n","import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport { Paint } from '../index';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `seconds`\n */\nexport default class secondDisplay {\n private optionsStore: OptionsStore;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.validation = serviceLocator.locate(Validation);\n }\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.secondContainer);\n\n for (let i = 0; i < 12; i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectSecond);\n container.appendChild(div);\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint): void {\n const container = widget.getElementsByClassName(\n Namespace.css.secondContainer\n )[0];\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.minutes);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectSecond}\"]`)\n .forEach((containerClone: HTMLElement) => {\n const classes = [];\n classes.push(Namespace.css.second);\n\n if (!this.validation.isValid(innerDate, Unit.seconds)) {\n classes.push(Namespace.css.disabled);\n }\n\n paint(Unit.seconds, innerDate, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${innerDate.seconds}`);\n containerClone.innerText = innerDate.secondsFormatted;\n innerDate.manipulate(5, Unit.seconds);\n });\n }\n}\n","import Namespace from '../utilities/namespace';\n\n/**\n * Provides a collapse functionality to the view changes\n */\nexport default class Collapse {\n /**\n * Flips the show/hide state of `target`\n * @param target html element to affect.\n */\n static toggle(target: HTMLElement) {\n if (target.classList.contains(Namespace.css.show)) {\n this.hide(target);\n } else {\n this.show(target);\n }\n }\n\n /**\n * Skips any animation or timeouts and immediately set the element to show.\n * @param target\n */\n static showImmediately(target: HTMLElement) {\n target.classList.remove(Namespace.css.collapsing);\n target.classList.add(Namespace.css.collapse, Namespace.css.show);\n target.style.height = '';\n }\n\n /**\n * If `target` is not already showing, then show after the animation.\n * @param target\n */\n static show(target: HTMLElement) {\n if (\n target.classList.contains(Namespace.css.collapsing) ||\n target.classList.contains(Namespace.css.show)\n )\n return;\n\n let timeOut = null;\n const complete = () => {\n Collapse.showImmediately(target);\n timeOut = null;\n };\n\n target.style.height = '0';\n target.classList.remove(Namespace.css.collapse);\n target.classList.add(Namespace.css.collapsing);\n\n //eslint-disable-next-line @typescript-eslint/no-unused-vars\n timeOut = setTimeout(\n complete,\n this.getTransitionDurationFromElement(target)\n );\n target.style.height = `${target.scrollHeight}px`;\n }\n\n /**\n * Skips any animation or timeouts and immediately set the element to hide.\n * @param target\n */\n static hideImmediately(target: HTMLElement) {\n if (!target) return;\n target.classList.remove(Namespace.css.collapsing, Namespace.css.show);\n target.classList.add(Namespace.css.collapse);\n }\n\n /**\n * If `target` is not already hidden, then hide after the animation.\n * @param target HTML Element\n */\n static hide(target: HTMLElement) {\n if (\n target.classList.contains(Namespace.css.collapsing) ||\n !target.classList.contains(Namespace.css.show)\n )\n return;\n\n let timeOut = null;\n const complete = () => {\n Collapse.hideImmediately(target);\n timeOut = null;\n };\n\n target.style.height = `${target.getBoundingClientRect()['height']}px`;\n\n const reflow = (element) => element.offsetHeight;\n\n reflow(target);\n\n target.classList.remove(Namespace.css.collapse, Namespace.css.show);\n target.classList.add(Namespace.css.collapsing);\n target.style.height = '';\n\n //eslint-disable-next-line @typescript-eslint/no-unused-vars\n timeOut = setTimeout(\n complete,\n this.getTransitionDurationFromElement(target)\n );\n }\n\n /**\n * Gets the transition duration from the `element` by getting css properties\n * `transition-duration` and `transition-delay`\n * @param element HTML Element\n */\n private static getTransitionDurationFromElement = (element: HTMLElement) => {\n if (!element) {\n return 0;\n }\n\n // Get transition-duration of the element\n let { transitionDuration, transitionDelay } =\n window.getComputedStyle(element);\n\n const floatTransitionDuration = Number.parseFloat(transitionDuration);\n const floatTransitionDelay = Number.parseFloat(transitionDelay);\n\n // Return 0 if element or transition duration is not found\n if (!floatTransitionDuration && !floatTransitionDelay) {\n return 0;\n }\n\n // If multiple durations are defined, take the first\n transitionDuration = transitionDuration.split(',')[0];\n transitionDelay = transitionDelay.split(',')[0];\n\n return (\n (Number.parseFloat(transitionDuration) +\n Number.parseFloat(transitionDelay)) *\n 1000\n );\n };\n}\n","import DateDisplay from './calendar/date-display';\nimport MonthDisplay from './calendar/month-display';\nimport YearDisplay from './calendar/year-display';\nimport DecadeDisplay from './calendar/decade-display';\nimport TimeDisplay from './time/time-display';\nimport HourDisplay from './time/hour-display';\nimport MinuteDisplay from './time/minute-display';\nimport SecondDisplay from './time/second-display';\nimport { DateTime, Unit } from '../datetime';\nimport Namespace from '../utilities/namespace';\nimport { HideEvent } from '../utilities/event-types';\nimport Collapse from './collapse';\nimport Validation from '../validation';\nimport Dates from '../dates';\nimport { EventEmitters, ViewUpdateValues } from '../utilities/event-emitter';\nimport { serviceLocator } from '../utilities/service-locator';\nimport ActionTypes from '../utilities/action-types';\nimport CalendarModes from '../utilities/calendar-modes';\nimport { OptionsStore } from '../utilities/optionsStore';\n\n/**\n * Main class for all things display related.\n */\nexport default class Display {\n private _widget: HTMLElement;\n private _popperInstance: any; // eslint-disable-line @typescript-eslint/no-explicit-any\n private _isVisible = false;\n private optionsStore: OptionsStore;\n private validation: Validation;\n private dates: Dates;\n\n dateDisplay: DateDisplay;\n monthDisplay: MonthDisplay;\n yearDisplay: YearDisplay;\n decadeDisplay: DecadeDisplay;\n timeDisplay: TimeDisplay;\n hourDisplay: HourDisplay;\n minuteDisplay: MinuteDisplay;\n secondDisplay: SecondDisplay;\n private _eventEmitters: EventEmitters;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.validation = serviceLocator.locate(Validation);\n this.dates = serviceLocator.locate(Dates);\n\n this.dateDisplay = serviceLocator.locate(DateDisplay);\n this.monthDisplay = serviceLocator.locate(MonthDisplay);\n this.yearDisplay = serviceLocator.locate(YearDisplay);\n this.decadeDisplay = serviceLocator.locate(DecadeDisplay);\n this.timeDisplay = serviceLocator.locate(TimeDisplay);\n this.hourDisplay = serviceLocator.locate(HourDisplay);\n this.minuteDisplay = serviceLocator.locate(MinuteDisplay);\n this.secondDisplay = serviceLocator.locate(SecondDisplay);\n this._eventEmitters = serviceLocator.locate(EventEmitters);\n this._widget = undefined;\n\n this._eventEmitters.updateDisplay.subscribe((result: ViewUpdateValues) => {\n this._update(result);\n });\n }\n\n /**\n * Returns the widget body or undefined\n * @private\n */\n get widget(): HTMLElement | undefined {\n return this._widget;\n }\n\n get dateContainer(): HTMLElement | undefined {\n return this.widget?.querySelector(`div.${Namespace.css.dateContainer}`);\n }\n\n get timeContainer(): HTMLElement | undefined {\n return this.widget?.querySelector(`div.${Namespace.css.timeContainer}`);\n }\n\n /**\n * Returns this visible state of the picker (shown)\n */\n get isVisible() {\n return this._isVisible;\n }\n\n /**\n * Updates the table for a particular unit. Used when an option as changed or\n * whenever the class list might need to be refreshed.\n * @param unit\n * @private\n */\n _update(unit: ViewUpdateValues): void {\n if (!this.widget) return;\n //todo do I want some kind of error catching or other guards here?\n switch (unit) {\n case Unit.seconds:\n this.secondDisplay._update(this.widget, this.paint);\n break;\n case Unit.minutes:\n this.minuteDisplay._update(this.widget, this.paint);\n break;\n case Unit.hours:\n this.hourDisplay._update(this.widget, this.paint);\n break;\n case Unit.date:\n this.dateDisplay._update(this.widget, this.paint);\n break;\n case Unit.month:\n this.monthDisplay._update(this.widget, this.paint);\n break;\n case Unit.year:\n this.yearDisplay._update(this.widget, this.paint);\n break;\n case 'clock':\n if (!this._hasTime) break;\n this.timeDisplay._update(this.widget);\n this._update(Unit.hours);\n this._update(Unit.minutes);\n this._update(Unit.seconds);\n break;\n case 'calendar':\n this._update(Unit.date);\n this._update(Unit.year);\n this._update(Unit.month);\n this.decadeDisplay._update(this.widget, this.paint);\n this._updateCalendarHeader();\n break;\n case 'all':\n if (this._hasTime) {\n this._update('clock');\n }\n if (this._hasDate) {\n this._update('calendar');\n }\n }\n }\n\n // noinspection JSUnusedLocalSymbols\n /**\n * Allows developers to add/remove classes from an element.\n * @param _unit\n * @param _date\n * @param _classes\n * @param _element\n */\n\n /* eslint-disable @typescript-eslint/no-unused-vars */\n paint(\n _unit: Unit | 'decade',\n _date: DateTime,\n _classes: string[],\n _element: HTMLElement\n ) {\n // implemented in plugin\n }\n\n /**\n * Shows the picker and creates a Popper instance if needed.\n * Add document click event to hide when clicking outside the picker.\n * fires Events#show\n */\n show(): void {\n if (this.widget == undefined) {\n this._showSetDefaultIfNeeded();\n\n this._buildWidget();\n this._updateTheme();\n\n this._showSetupViewMode();\n\n if (!this.optionsStore.options.display.inline) {\n // If needed to change the parent container\n const container = this.optionsStore.options?.container || document.body;\n const placement =\n this.optionsStore.options?.display?.placement || 'bottom';\n\n container.appendChild(this.widget);\n this.createPopup(this.optionsStore.element, this.widget, {\n modifiers: [{ name: 'eventListeners', enabled: true }],\n //#2400\n placement:\n document.documentElement.dir === 'rtl'\n ? `${placement}-end`\n : `${placement}-start`,\n }).then();\n } else {\n this.optionsStore.element.appendChild(this.widget);\n }\n\n if (this.optionsStore.options.display.viewMode == 'clock') {\n this._eventEmitters.action.emit({\n e: null,\n action: ActionTypes.showClock,\n });\n }\n\n this.widget\n .querySelectorAll('[data-action]')\n .forEach((element) =>\n element.addEventListener('click', this._actionsClickEvent)\n );\n\n // show the clock when using sideBySide\n if (this._hasTime && this.optionsStore.options.display.sideBySide) {\n this.timeDisplay._update(this.widget);\n (\n this.widget.getElementsByClassName(\n Namespace.css.clockContainer\n )[0] as HTMLElement\n ).style.display = 'grid';\n }\n }\n\n this.widget.classList.add(Namespace.css.show);\n if (!this.optionsStore.options.display.inline) {\n this.updatePopup();\n document.addEventListener('click', this._documentClickEvent);\n }\n this._eventEmitters.triggerEvent.emit({ type: Namespace.events.show });\n this._isVisible = true;\n }\n\n private _showSetupViewMode() {\n // If modeView is only clock\n const onlyClock = this._hasTime && !this._hasDate;\n\n // reset the view to the clock if there's no date components\n if (onlyClock) {\n this.optionsStore.currentView = 'clock';\n this._eventEmitters.action.emit({\n e: null,\n action: ActionTypes.showClock,\n });\n }\n // otherwise return to the calendar view\n else if (!this.optionsStore.currentCalendarViewMode) {\n this.optionsStore.currentCalendarViewMode =\n this.optionsStore.minimumCalendarViewMode;\n }\n\n if (!onlyClock && this.optionsStore.options.display.viewMode !== 'clock') {\n if (this._hasTime) {\n if (!this.optionsStore.options.display.sideBySide) {\n Collapse.hideImmediately(this.timeContainer);\n } else {\n Collapse.show(this.timeContainer);\n }\n }\n Collapse.show(this.dateContainer);\n }\n\n if (this._hasDate) {\n this._showMode();\n }\n }\n\n private _showSetDefaultIfNeeded() {\n if (this.dates.picked.length != 0) return;\n\n if (\n this.optionsStore.options.useCurrent &&\n !this.optionsStore.options.defaultDate\n ) {\n const date = new DateTime().setLocalization(\n this.optionsStore.options.localization\n );\n if (!this.optionsStore.options.keepInvalid) {\n let tries = 0;\n let direction = 1;\n if (this.optionsStore.options.restrictions.maxDate?.isBefore(date)) {\n direction = -1;\n }\n while (!this.validation.isValid(date) && tries > 31) {\n date.manipulate(direction, Unit.date);\n tries++;\n }\n }\n this.dates.setValue(date);\n }\n\n if (this.optionsStore.options.defaultDate) {\n this.dates.setValue(this.optionsStore.options.defaultDate);\n }\n }\n\n async createPopup(\n element: HTMLElement,\n widget: HTMLElement,\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n options: any\n ): Promise {\n let createPopperFunction;\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((window as any)?.Popper) {\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n createPopperFunction = (window as any)?.Popper?.createPopper;\n } else {\n const { createPopper } = await import('@popperjs/core');\n createPopperFunction = createPopper;\n }\n if (createPopperFunction) {\n this._popperInstance = createPopperFunction(element, widget, options);\n }\n }\n\n updatePopup(): void {\n this._popperInstance?.update();\n }\n\n /**\n * Changes the calendar view mode. E.g. month <-> year\n * @param direction -/+ number to move currentViewMode\n * @private\n */\n _showMode(direction?: number): void {\n if (!this.widget) {\n return;\n }\n if (direction) {\n const max = Math.max(\n this.optionsStore.minimumCalendarViewMode,\n Math.min(3, this.optionsStore.currentCalendarViewMode + direction)\n );\n if (this.optionsStore.currentCalendarViewMode == max) return;\n this.optionsStore.currentCalendarViewMode = max;\n }\n\n this.widget\n .querySelectorAll(\n `.${Namespace.css.dateContainer} > div:not(.${Namespace.css.calendarHeader}), .${Namespace.css.timeContainer} > div:not(.${Namespace.css.clockContainer})`\n )\n .forEach((e: HTMLElement) => (e.style.display = 'none'));\n\n const datePickerMode =\n CalendarModes[this.optionsStore.currentCalendarViewMode];\n const picker: HTMLElement = this.widget.querySelector(\n `.${datePickerMode.className}`\n );\n\n switch (datePickerMode.className) {\n case Namespace.css.decadesContainer:\n this.decadeDisplay._update(this.widget, this.paint);\n break;\n case Namespace.css.yearsContainer:\n this.yearDisplay._update(this.widget, this.paint);\n break;\n case Namespace.css.monthsContainer:\n this.monthDisplay._update(this.widget, this.paint);\n break;\n case Namespace.css.daysContainer:\n this.dateDisplay._update(this.widget, this.paint);\n break;\n }\n\n picker.style.display = 'grid';\n\n if (this.optionsStore.options.display.sideBySide)\n ((\n this.widget.querySelectorAll(`.${Namespace.css.clockContainer}`)[0]\n )).style.display = 'grid';\n\n this._updateCalendarHeader();\n this._eventEmitters.viewUpdate.emit();\n }\n\n /**\n * Changes the theme. E.g. light, dark or auto\n * @param theme the theme name\n * @private\n */\n _updateTheme(theme?: 'light' | 'dark' | 'auto'): void {\n if (!this.widget) {\n return;\n }\n if (theme) {\n if (this.optionsStore.options.display.theme === theme) return;\n this.optionsStore.options.display.theme = theme;\n }\n\n this.widget.classList.remove('light', 'dark');\n this.widget.classList.add(this._getThemeClass());\n\n if (this.optionsStore.options.display.theme === 'auto') {\n window\n .matchMedia(Namespace.css.isDarkPreferredQuery)\n .addEventListener('change', () => this._updateTheme());\n } else {\n window\n .matchMedia(Namespace.css.isDarkPreferredQuery)\n .removeEventListener('change', () => this._updateTheme());\n }\n }\n\n _getThemeClass(): string {\n const currentTheme = this.optionsStore.options.display.theme || 'auto';\n\n const isDarkMode =\n window.matchMedia &&\n window.matchMedia(Namespace.css.isDarkPreferredQuery).matches;\n\n switch (currentTheme) {\n case 'light':\n return Namespace.css.lightTheme;\n case 'dark':\n return Namespace.css.darkTheme;\n case 'auto':\n return isDarkMode ? Namespace.css.darkTheme : Namespace.css.lightTheme;\n }\n }\n\n _updateCalendarHeader() {\n if (!this._hasDate) return;\n const showing = [\n ...this.widget.querySelector(\n `.${Namespace.css.dateContainer} div[style*=\"display: grid\"]`\n ).classList,\n ].find((x) => x.startsWith(Namespace.css.dateContainer));\n\n const [previous, switcher, next] = this.widget\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\n .getElementsByTagName('div');\n\n switch (showing) {\n case Namespace.css.decadesContainer:\n previous.setAttribute(\n 'title',\n this.optionsStore.options.localization.previousCentury\n );\n switcher.setAttribute('title', '');\n next.setAttribute(\n 'title',\n this.optionsStore.options.localization.nextCentury\n );\n break;\n case Namespace.css.yearsContainer:\n previous.setAttribute(\n 'title',\n this.optionsStore.options.localization.previousDecade\n );\n switcher.setAttribute(\n 'title',\n this.optionsStore.options.localization.selectDecade\n );\n next.setAttribute(\n 'title',\n this.optionsStore.options.localization.nextDecade\n );\n break;\n case Namespace.css.monthsContainer:\n previous.setAttribute(\n 'title',\n this.optionsStore.options.localization.previousYear\n );\n switcher.setAttribute(\n 'title',\n this.optionsStore.options.localization.selectYear\n );\n next.setAttribute(\n 'title',\n this.optionsStore.options.localization.nextYear\n );\n break;\n case Namespace.css.daysContainer:\n previous.setAttribute(\n 'title',\n this.optionsStore.options.localization.previousMonth\n );\n switcher.setAttribute(\n 'title',\n this.optionsStore.options.localization.selectMonth\n );\n next.setAttribute(\n 'title',\n this.optionsStore.options.localization.nextMonth\n );\n switcher.setAttribute(\n showing,\n this.optionsStore.viewDate.format(\n this.optionsStore.options.localization.dayViewHeaderFormat\n )\n );\n break;\n }\n switcher.innerText = switcher.getAttribute(showing);\n }\n\n /**\n * Hides the picker if needed.\n * Remove document click event to hide when clicking outside the picker.\n * fires Events#hide\n */\n hide(): void {\n if (!this.widget || !this._isVisible) return;\n\n this.widget.classList.remove(Namespace.css.show);\n\n if (this._isVisible) {\n this._eventEmitters.triggerEvent.emit({\n type: Namespace.events.hide,\n date: this.optionsStore.unset ? null : this.dates.lastPicked?.clone,\n } as HideEvent);\n this._isVisible = false;\n }\n\n document.removeEventListener('click', this._documentClickEvent);\n }\n\n /**\n * Toggles the picker's open state. Fires a show/hide event depending.\n */\n toggle() {\n return this._isVisible ? this.hide() : this.show();\n }\n\n /**\n * Removes document and data-action click listener and reset the widget\n * @private\n */\n _dispose() {\n document.removeEventListener('click', this._documentClickEvent);\n if (!this.widget) return;\n this.widget\n .querySelectorAll('[data-action]')\n .forEach((element) =>\n element.removeEventListener('click', this._actionsClickEvent)\n );\n this.widget.parentNode.removeChild(this.widget);\n this._widget = undefined;\n }\n\n /**\n * Builds the widgets html template.\n * @private\n */\n private _buildWidget(): HTMLElement {\n const template = document.createElement('div');\n template.classList.add(Namespace.css.widget);\n\n const dateView = document.createElement('div');\n dateView.classList.add(Namespace.css.dateContainer);\n dateView.append(\n this.getHeadTemplate(),\n this.decadeDisplay.getPicker(),\n this.yearDisplay.getPicker(),\n this.monthDisplay.getPicker(),\n this.dateDisplay.getPicker()\n );\n\n const timeView = document.createElement('div');\n timeView.classList.add(Namespace.css.timeContainer);\n timeView.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this)));\n timeView.appendChild(this.hourDisplay.getPicker());\n timeView.appendChild(this.minuteDisplay.getPicker());\n timeView.appendChild(this.secondDisplay.getPicker());\n\n const toolbar = document.createElement('div');\n toolbar.classList.add(Namespace.css.toolbar);\n toolbar.append(...this.getToolbarElements());\n\n if (this.optionsStore.options.display.inline) {\n template.classList.add(Namespace.css.inline);\n }\n\n if (this.optionsStore.options.display.calendarWeeks) {\n template.classList.add('calendarWeeks');\n }\n\n if (this.optionsStore.options.display.sideBySide && this._hasDateAndTime) {\n this._buildWidgetSideBySide(template, dateView, timeView, toolbar);\n return;\n }\n\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\n template.appendChild(toolbar);\n }\n\n const setupComponentView = (hasFirst, hasSecond, element, shouldShow) => {\n if (!hasFirst) return;\n if (hasSecond) {\n element.classList.add(Namespace.css.collapse);\n if (shouldShow) element.classList.add(Namespace.css.show);\n }\n template.appendChild(element);\n };\n\n setupComponentView(\n this._hasDate,\n this._hasTime,\n dateView,\n this.optionsStore.options.display.viewMode !== 'clock'\n );\n\n setupComponentView(\n this._hasTime,\n this._hasDate,\n timeView,\n this.optionsStore.options.display.viewMode === 'clock'\n );\n\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\n template.appendChild(toolbar);\n }\n\n const arrow = document.createElement('div');\n arrow.classList.add('arrow');\n arrow.setAttribute('data-popper-arrow', '');\n template.appendChild(arrow);\n\n this._widget = template;\n }\n\n private _buildWidgetSideBySide(\n template: HTMLDivElement,\n dateView: HTMLDivElement,\n timeView: HTMLDivElement,\n toolbar: HTMLDivElement\n ) {\n template.classList.add(Namespace.css.sideBySide);\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\n template.appendChild(toolbar);\n }\n const row = document.createElement('div');\n row.classList.add('td-row');\n dateView.classList.add('td-half');\n timeView.classList.add('td-half');\n\n row.appendChild(dateView);\n row.appendChild(timeView);\n template.appendChild(row);\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\n template.appendChild(toolbar);\n }\n this._widget = template;\n }\n\n /**\n * Returns true if the hours, minutes, or seconds component is turned on\n */\n get _hasTime(): boolean {\n return (\n this.optionsStore.options.display.components.clock &&\n (this.optionsStore.options.display.components.hours ||\n this.optionsStore.options.display.components.minutes ||\n this.optionsStore.options.display.components.seconds)\n );\n }\n\n /**\n * Returns true if the year, month, or date component is turned on\n */\n get _hasDate(): boolean {\n return (\n this.optionsStore.options.display.components.calendar &&\n (this.optionsStore.options.display.components.year ||\n this.optionsStore.options.display.components.month ||\n this.optionsStore.options.display.components.date)\n );\n }\n\n get _hasDateAndTime(): boolean {\n return this._hasDate && this._hasTime;\n }\n\n /**\n * Get the toolbar html based on options like buttons => today\n * @private\n */\n getToolbarElements(): HTMLElement[] {\n const toolbar = [];\n\n if (this.optionsStore.options.display.buttons.today) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.today);\n div.setAttribute('title', this.optionsStore.options.localization.today);\n\n div.appendChild(\n this._iconTag(this.optionsStore.options.display.icons.today)\n );\n toolbar.push(div);\n }\n if (\n !this.optionsStore.options.display.sideBySide &&\n this._hasDate &&\n this._hasTime\n ) {\n let title, icon;\n if (this.optionsStore.options.display.viewMode === 'clock') {\n title = this.optionsStore.options.localization.selectDate;\n icon = this.optionsStore.options.display.icons.date;\n } else {\n title = this.optionsStore.options.localization.selectTime;\n icon = this.optionsStore.options.display.icons.time;\n }\n\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.togglePicker);\n div.setAttribute('title', title);\n\n div.appendChild(this._iconTag(icon));\n toolbar.push(div);\n }\n if (this.optionsStore.options.display.buttons.clear) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.clear);\n div.setAttribute('title', this.optionsStore.options.localization.clear);\n\n div.appendChild(\n this._iconTag(this.optionsStore.options.display.icons.clear)\n );\n toolbar.push(div);\n }\n if (this.optionsStore.options.display.buttons.close) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.close);\n div.setAttribute('title', this.optionsStore.options.localization.close);\n\n div.appendChild(\n this._iconTag(this.optionsStore.options.display.icons.close)\n );\n toolbar.push(div);\n }\n\n return toolbar;\n }\n\n /***\n * Builds the base header template with next and previous icons\n * @private\n */\n getHeadTemplate(): HTMLElement {\n const calendarHeader = document.createElement('div');\n calendarHeader.classList.add(Namespace.css.calendarHeader);\n\n const previous = document.createElement('div');\n previous.classList.add(Namespace.css.previous);\n previous.setAttribute('data-action', ActionTypes.previous);\n previous.appendChild(\n this._iconTag(this.optionsStore.options.display.icons.previous)\n );\n\n const switcher = document.createElement('div');\n switcher.classList.add(Namespace.css.switch);\n switcher.setAttribute('data-action', ActionTypes.changeCalendarView);\n\n const next = document.createElement('div');\n next.classList.add(Namespace.css.next);\n next.setAttribute('data-action', ActionTypes.next);\n next.appendChild(\n this._iconTag(this.optionsStore.options.display.icons.next)\n );\n\n calendarHeader.append(previous, switcher, next);\n return calendarHeader;\n }\n\n /**\n * Builds an icon tag as either an ``\n * or with icons => type is `sprites` then a svg tag instead\n * @param iconClass\n * @private\n */\n _iconTag(iconClass: string): HTMLElement | SVGElement {\n if (this.optionsStore.options.display.icons.type === 'sprites') {\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n\n const icon = document.createElementNS(\n 'http://www.w3.org/2000/svg',\n 'use'\n );\n icon.setAttribute('xlink:href', iconClass); // Deprecated. Included for backward compatibility\n icon.setAttribute('href', iconClass);\n svg.appendChild(icon);\n\n return svg;\n }\n const icon = document.createElement('i');\n icon.classList.add(...iconClass.split(' '));\n return icon;\n }\n\n /**\n * A document click event to hide the widget if click is outside\n * @private\n * @param e MouseEvent\n */\n private _documentClickEvent = (e: MouseEvent) => {\n if (this.optionsStore.options.debug || (window as any).debug) return; //eslint-disable-line @typescript-eslint/no-explicit-any\n\n if (\n this._isVisible &&\n !e.composedPath().includes(this.widget) && // click inside the widget\n !e.composedPath()?.includes(this.optionsStore.element) // click on the element\n ) {\n this.hide();\n }\n };\n\n /**\n * Click event for any action like selecting a date\n * @param e MouseEvent\n * @private\n */\n private _actionsClickEvent = (e: MouseEvent) => {\n this._eventEmitters.action.emit({ e: e });\n };\n\n /**\n * Causes the widget to get rebuilt on next show. If the picker is already open\n * then hide and reshow it.\n * @private\n */\n _rebuild() {\n const wasVisible = this._isVisible;\n this._dispose();\n if (wasVisible) this.show();\n }\n}\n\nexport type Paint = (\n unit: Unit | 'decade',\n innerDate: DateTime,\n classes: string[],\n element: HTMLElement\n) => void;\n","import { DateTime, Unit } from './datetime';\nimport Collapse from './display/collapse';\nimport Namespace from './utilities/namespace';\nimport Dates from './dates';\nimport Validation from './validation';\nimport Display from './display';\nimport { EventEmitters } from './utilities/event-emitter';\nimport { serviceLocator } from './utilities/service-locator.js';\nimport ActionTypes from './utilities/action-types';\nimport CalendarModes from './utilities/calendar-modes';\nimport { OptionsStore } from './utilities/optionsStore';\n\n/**\n * Logic for various click actions\n */\nexport default class Actions {\n private optionsStore: OptionsStore;\n private validation: Validation;\n private dates: Dates;\n private display: Display;\n private _eventEmitters: EventEmitters;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n this.display = serviceLocator.locate(Display);\n this._eventEmitters = serviceLocator.locate(EventEmitters);\n\n this._eventEmitters.action.subscribe((result) => {\n this.do(result.e, result.action);\n });\n }\n\n /**\n * Performs the selected `action`. See ActionTypes\n * @param e This is normally a click event\n * @param action If not provided, then look for a [data-action]\n */\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n do(e: any, action?: ActionTypes) {\n const currentTarget = e?.currentTarget as HTMLElement;\n if (currentTarget?.classList?.contains(Namespace.css.disabled)) return;\n action = action || (currentTarget?.dataset?.action as ActionTypes);\n const lastPicked = (this.dates.lastPicked || this.optionsStore.viewDate)\n .clone;\n\n switch (action) {\n case ActionTypes.next:\n case ActionTypes.previous:\n this.handleNextPrevious(action);\n break;\n case ActionTypes.changeCalendarView:\n this.display._showMode(1);\n this.display._updateCalendarHeader();\n break;\n case ActionTypes.selectMonth:\n case ActionTypes.selectYear:\n case ActionTypes.selectDecade:\n this.handleSelectCalendarMode(action, currentTarget);\n break;\n case ActionTypes.selectDay:\n this.handleSelectDay(currentTarget);\n break;\n case ActionTypes.selectHour: {\n let hour = +currentTarget.dataset.value;\n if (lastPicked.hours >= 12 && this.optionsStore.isTwelveHour)\n hour += 12;\n lastPicked.hours = hour;\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\n this.hideOrClock(e);\n break;\n }\n case ActionTypes.selectMinute: {\n lastPicked.minutes = +currentTarget.dataset.value;\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\n this.hideOrClock(e);\n break;\n }\n case ActionTypes.selectSecond: {\n lastPicked.seconds = +currentTarget.dataset.value;\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\n this.hideOrClock(e);\n break;\n }\n case ActionTypes.incrementHours:\n this.manipulateAndSet(lastPicked, Unit.hours);\n break;\n case ActionTypes.incrementMinutes:\n this.manipulateAndSet(\n lastPicked,\n Unit.minutes,\n this.optionsStore.options.stepping\n );\n break;\n case ActionTypes.incrementSeconds:\n this.manipulateAndSet(lastPicked, Unit.seconds);\n break;\n case ActionTypes.decrementHours:\n this.manipulateAndSet(lastPicked, Unit.hours, -1);\n break;\n case ActionTypes.decrementMinutes:\n this.manipulateAndSet(\n lastPicked,\n Unit.minutes,\n this.optionsStore.options.stepping * -1\n );\n break;\n case ActionTypes.decrementSeconds:\n this.manipulateAndSet(lastPicked, Unit.seconds, -1);\n break;\n case ActionTypes.toggleMeridiem:\n this.manipulateAndSet(\n lastPicked,\n Unit.hours,\n this.dates.lastPicked.hours >= 12 ? -12 : 12\n );\n break;\n case ActionTypes.togglePicker:\n this.handleToggle(currentTarget);\n break;\n case ActionTypes.showClock:\n case ActionTypes.showHours:\n case ActionTypes.showMinutes:\n case ActionTypes.showSeconds:\n //make sure the clock is actually displaying\n if (\n !this.optionsStore.options.display.sideBySide &&\n this.optionsStore.currentView !== 'clock'\n ) {\n //hide calendar\n Collapse.hideImmediately(this.display.dateContainer);\n //show clock\n Collapse.showImmediately(this.display.timeContainer);\n }\n this.handleShowClockContainers(action);\n break;\n case ActionTypes.clear:\n this.dates.setValue(null);\n this.display._updateCalendarHeader();\n break;\n case ActionTypes.close:\n this.display.hide();\n break;\n case ActionTypes.today: {\n const today = new DateTime().setLocalization(\n this.optionsStore.options.localization\n );\n this._eventEmitters.updateViewDate.emit(today);\n\n //todo this this really a good idea?\n if (this.validation.isValid(today, Unit.date))\n this.dates.setValue(today, this.dates.lastPickedIndex);\n break;\n }\n }\n }\n\n private handleShowClockContainers(action: ActionTypes) {\n if (!this.display._hasTime) {\n Namespace.errorMessages.throwError(\n 'Cannot show clock containers when time is disabled.'\n );\n /* ignore coverage: should never happen */\n return;\n }\n\n this.optionsStore.currentView = 'clock';\n this.display.widget\n .querySelectorAll(`.${Namespace.css.timeContainer} > div`)\n .forEach(\n (htmlElement: HTMLElement) => (htmlElement.style.display = 'none')\n );\n\n let classToUse = '';\n switch (action) {\n case ActionTypes.showClock:\n classToUse = Namespace.css.clockContainer;\n this.display._update('clock');\n break;\n case ActionTypes.showHours:\n classToUse = Namespace.css.hourContainer;\n this.display._update(Unit.hours);\n break;\n case ActionTypes.showMinutes:\n classToUse = Namespace.css.minuteContainer;\n this.display._update(Unit.minutes);\n break;\n case ActionTypes.showSeconds:\n classToUse = Namespace.css.secondContainer;\n this.display._update(Unit.seconds);\n break;\n }\n\n ((\n this.display.widget.getElementsByClassName(classToUse)[0]\n )).style.display = 'grid';\n }\n\n private handleNextPrevious(action: ActionTypes) {\n const { unit, step } =\n CalendarModes[this.optionsStore.currentCalendarViewMode];\n if (action === ActionTypes.next)\n this.optionsStore.viewDate.manipulate(step, unit);\n else this.optionsStore.viewDate.manipulate(step * -1, unit);\n this._eventEmitters.viewUpdate.emit();\n\n this.display._showMode();\n }\n\n /**\n * After setting the value it will either show the clock or hide the widget.\n * @param e\n */\n private hideOrClock(e) {\n if (\n !this.optionsStore.isTwelveHour &&\n !this.optionsStore.options.display.components.minutes &&\n !this.optionsStore.options.display.keepOpen &&\n !this.optionsStore.options.display.inline\n ) {\n this.display.hide();\n } else {\n this.do(e, ActionTypes.showClock);\n }\n }\n\n /**\n * Common function to manipulate {@link lastPicked} by `unit`.\n * @param lastPicked\n * @param unit\n * @param value Value to change by\n */\n private manipulateAndSet(lastPicked: DateTime, unit: Unit, value = 1) {\n const newDate = lastPicked.manipulate(value, unit);\n if (this.validation.isValid(newDate, unit)) {\n this.dates.setValue(newDate, this.dates.lastPickedIndex);\n }\n }\n\n private handleSelectCalendarMode(\n action:\n | ActionTypes.selectMonth\n | ActionTypes.selectYear\n | ActionTypes.selectDecade,\n currentTarget: HTMLElement\n ) {\n const value = +currentTarget.dataset.value;\n switch (action) {\n case ActionTypes.selectMonth:\n this.optionsStore.viewDate.month = value;\n break;\n case ActionTypes.selectYear:\n case ActionTypes.selectDecade:\n this.optionsStore.viewDate.year = value;\n break;\n }\n\n if (\n this.optionsStore.currentCalendarViewMode ===\n this.optionsStore.minimumCalendarViewMode\n ) {\n this.dates.setValue(\n this.optionsStore.viewDate,\n this.dates.lastPickedIndex\n );\n if (!this.optionsStore.options.display.inline) {\n this.display.hide();\n }\n } else {\n this.display._showMode(-1);\n }\n }\n\n private handleToggle(currentTarget: HTMLElement) {\n if (\n currentTarget.getAttribute('title') ===\n this.optionsStore.options.localization.selectDate\n ) {\n currentTarget.setAttribute(\n 'title',\n this.optionsStore.options.localization.selectTime\n );\n currentTarget.innerHTML = this.display._iconTag(\n this.optionsStore.options.display.icons.time\n ).outerHTML;\n\n this.display._updateCalendarHeader();\n this.optionsStore.refreshCurrentView();\n } else {\n currentTarget.setAttribute(\n 'title',\n this.optionsStore.options.localization.selectDate\n );\n currentTarget.innerHTML = this.display._iconTag(\n this.optionsStore.options.display.icons.date\n ).outerHTML;\n if (this.display._hasTime) {\n this.handleShowClockContainers(ActionTypes.showClock);\n this.display._update('clock');\n }\n }\n\n this.display.widget\n .querySelectorAll(\n `.${Namespace.css.dateContainer}, .${Namespace.css.timeContainer}`\n )\n .forEach((htmlElement: HTMLElement) => Collapse.toggle(htmlElement));\n this._eventEmitters.viewUpdate.emit();\n }\n\n private handleSelectDay(currentTarget: HTMLElement) {\n const day = this.optionsStore.viewDate.clone;\n if (currentTarget.classList.contains(Namespace.css.old)) {\n day.manipulate(-1, Unit.month);\n }\n if (currentTarget.classList.contains(Namespace.css.new)) {\n day.manipulate(1, Unit.month);\n }\n\n day.date = +currentTarget.dataset.day;\n if (this.optionsStore.options.dateRange) this.handleDateRange(day);\n else if (this.optionsStore.options.multipleDates) {\n this.handleMultiDate(day);\n } else {\n this.dates.setValue(day, this.dates.lastPickedIndex);\n }\n\n if (\n !this.display._hasTime &&\n !this.optionsStore.options.display.keepOpen &&\n !this.optionsStore.options.display.inline &&\n !this.optionsStore.options.multipleDates &&\n !this.optionsStore.options.dateRange\n ) {\n this.display.hide();\n }\n }\n\n private handleMultiDate(day: DateTime) {\n let index = this.dates.pickedIndex(day, Unit.date);\n console.log(index);\n if (index !== -1) {\n this.dates.setValue(null, index); //deselect multi-date\n } else {\n index = this.dates.lastPickedIndex + 1;\n if (this.dates.picked.length === 0) index = 0;\n\n this.dates.setValue(day, index);\n }\n }\n\n private handleDateRange(day: DateTime) {\n switch (this.dates.picked.length) {\n case 2: {\n this.dates.clear();\n break;\n }\n case 1: {\n const other = this.dates.picked[0];\n if (day.getTime() === other.getTime()) {\n this.dates.clear();\n break;\n }\n if (day.isBefore(other)) {\n this.dates.setValue(day, 0);\n this.dates.setValue(other, 1);\n return;\n } else this.dates.setValue(day, 1);\n return;\n }\n }\n\n this.dates.setValue(day, 0);\n }\n}\n","import Display from './display/index';\nimport Dates from './dates';\nimport Actions from './actions';\nimport {\n DateTime,\n DateTimeFormatOptions,\n guessHourCycle,\n Unit,\n} from './datetime';\nimport Namespace from './utilities/namespace';\nimport Options from './utilities/options';\nimport {\n BaseEvent,\n ChangeEvent,\n ViewUpdateEvent,\n} from './utilities/event-types';\nimport { EventEmitters } from './utilities/event-emitter';\nimport {\n serviceLocator,\n setupServiceLocator,\n} from './utilities/service-locator';\nimport CalendarModes from './utilities/calendar-modes';\nimport DefaultOptions, {\n DefaultEnLocalization,\n} from './utilities/default-options';\nimport ActionTypes from './utilities/action-types';\nimport { OptionsStore } from './utilities/optionsStore';\nimport { OptionConverter } from './utilities/optionConverter';\n\n/**\n * A robust and powerful date/time picker component.\n */\nclass TempusDominus {\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n _subscribers: { [key: string]: ((event: any) => Record)[] } =\n {};\n private _isDisabled = false;\n private _toggle: HTMLElement;\n private _currentPromptTimeTimeout: NodeJS.Timeout;\n private actions: Actions;\n private optionsStore: OptionsStore;\n private _eventEmitters: EventEmitters;\n display: Display;\n dates: Dates;\n\n constructor(element: HTMLElement, options: Options = {} as Options) {\n setupServiceLocator();\n this._eventEmitters = serviceLocator.locate(EventEmitters);\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.display = serviceLocator.locate(Display);\n this.dates = serviceLocator.locate(Dates);\n this.actions = serviceLocator.locate(Actions);\n\n if (!element) {\n Namespace.errorMessages.mustProvideElement();\n }\n\n this.optionsStore.element = element;\n this._initializeOptions(options, DefaultOptions, true);\n this.optionsStore.viewDate.setLocalization(\n this.optionsStore.options.localization\n );\n this.optionsStore.unset = true;\n\n this._initializeInput();\n this._initializeToggle();\n\n if (this.optionsStore.options.display.inline) this.display.show();\n\n this._eventEmitters.triggerEvent.subscribe((e) => {\n this._triggerEvent(e);\n });\n\n this._eventEmitters.viewUpdate.subscribe(() => {\n this._viewUpdate();\n });\n\n this._eventEmitters.updateViewDate.subscribe((dateTime) => {\n this.viewDate = dateTime;\n });\n }\n\n get viewDate() {\n return this.optionsStore.viewDate;\n }\n\n set viewDate(value) {\n this.optionsStore.viewDate = value;\n this.optionsStore.viewDate.setLocalization(\n this.optionsStore.options.localization\n );\n this.display._update(\n this.optionsStore.currentView === 'clock' ? 'clock' : 'calendar'\n );\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Update the picker options. If `reset` is provide `options` will be merged with DefaultOptions instead.\n * @param options\n * @param reset\n * @public\n */\n updateOptions(options, reset = false): void {\n if (reset) this._initializeOptions(options, DefaultOptions);\n else this._initializeOptions(options, this.optionsStore.options);\n\n this.optionsStore.viewDate.setLocalization(\n this.optionsStore.options.localization\n );\n this.display._rebuild();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Toggles the picker open or closed. If the picker is disabled, nothing will happen.\n * @public\n */\n toggle(): void {\n if (this._isDisabled) return;\n this.display.toggle();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Shows the picker unless the picker is disabled.\n * @public\n */\n show(): void {\n if (this._isDisabled) return;\n this.display.show();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Hides the picker unless the picker is disabled.\n * @public\n */\n hide(): void {\n this.display.hide();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Disables the picker and the target input field.\n * @public\n */\n disable(): void {\n this._isDisabled = true;\n // todo this might be undesired. If a dev disables the input field to\n // only allow using the picker, this will break that.\n this.optionsStore.input?.setAttribute('disabled', 'disabled');\n this.display.hide();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Enables the picker and the target input field.\n * @public\n */\n enable(): void {\n this._isDisabled = false;\n this.optionsStore.input?.removeAttribute('disabled');\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Clears all the selected dates\n * @public\n */\n clear(): void {\n this.optionsStore.input.value = '';\n this.dates.clear();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Allows for a direct subscription to picker events, without having to use addEventListener on the element.\n * @param eventTypes See Namespace.Events\n * @param callbacks Function to call when event is triggered\n * @public\n */\n subscribe(\n eventTypes: string | string[],\n callbacks: (event: any) => void | ((event: any) => void)[] //eslint-disable-line @typescript-eslint/no-explicit-any\n ): { unsubscribe: () => void } | { unsubscribe: () => void }[] {\n if (typeof eventTypes === 'string') {\n eventTypes = [eventTypes];\n }\n let callBackArray: any[]; //eslint-disable-line @typescript-eslint/no-explicit-any\n if (!Array.isArray(callbacks)) {\n callBackArray = [callbacks];\n } else {\n callBackArray = callbacks;\n }\n\n if (eventTypes.length !== callBackArray.length) {\n Namespace.errorMessages.subscribeMismatch();\n }\n\n const returnArray = [];\n\n for (let i = 0; i < eventTypes.length; i++) {\n const eventType = eventTypes[i];\n if (!Array.isArray(this._subscribers[eventType])) {\n this._subscribers[eventType] = [];\n }\n\n this._subscribers[eventType].push(callBackArray[i]);\n\n returnArray.push({\n unsubscribe: this._unsubscribe.bind(\n this,\n eventType,\n this._subscribers[eventType].length - 1\n ),\n });\n\n if (eventTypes.length === 1) {\n return returnArray[0];\n }\n }\n\n return returnArray;\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Hides the picker and removes event listeners\n */\n dispose() {\n this.display.hide();\n // this will clear the document click event listener\n this.display._dispose();\n this._eventEmitters.destroy();\n this.optionsStore.input?.removeEventListener(\n 'change',\n this._inputChangeEvent\n );\n if (this.optionsStore.options.allowInputToggle) {\n this.optionsStore.input?.removeEventListener(\n 'click',\n this._toggleClickEvent\n );\n }\n this._toggle?.removeEventListener('click', this._toggleClickEvent);\n this._subscribers = {};\n }\n\n /**\n * Updates the options to use the provided language.\n * THe language file must be loaded first.\n * @param language\n */\n locale(language: string) {\n const asked = loadedLocales[language];\n if (!asked) return;\n this.updateOptions({\n localization: asked,\n });\n }\n\n /**\n * Triggers an event like ChangeEvent when the picker has updated the value\n * of a selected date.\n * @param event Accepts a BaseEvent object.\n * @private\n */\n private _triggerEvent(event: BaseEvent) {\n event.viewMode = this.optionsStore.currentView;\n\n const isChangeEvent = event.type === Namespace.events.change;\n if (isChangeEvent) {\n const { date, oldDate, isClear } = event as ChangeEvent;\n if (\n (date && oldDate && date.isSame(oldDate)) ||\n (!isClear && !date && !oldDate)\n ) {\n return;\n }\n this._handleAfterChangeEvent(event as ChangeEvent);\n\n this.optionsStore.input?.dispatchEvent(\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n new CustomEvent('change', { detail: event as any })\n );\n }\n\n this.optionsStore.element.dispatchEvent(\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n new CustomEvent(event.type, { detail: event as any })\n );\n\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((window as any).jQuery) {\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n const $ = (window as any).jQuery;\n\n if (isChangeEvent && this.optionsStore.input) {\n $(this.optionsStore.input).trigger(event);\n } else {\n $(this.optionsStore.element).trigger(event);\n }\n }\n\n this._publish(event);\n }\n\n private _publish(event: BaseEvent) {\n // return if event is not subscribed\n if (!Array.isArray(this._subscribers[event.type])) {\n return;\n }\n\n // Trigger callback for each subscriber\n this._subscribers[event.type].forEach((callback) => {\n callback(event);\n });\n }\n\n /**\n * Fires a ViewUpdate event when, for example, the month view is changed.\n * @private\n */\n private _viewUpdate() {\n this._triggerEvent({\n type: Namespace.events.update,\n viewDate: this.optionsStore.viewDate.clone,\n } as ViewUpdateEvent);\n }\n\n private _unsubscribe(eventName, index) {\n this._subscribers[eventName].splice(index, 1);\n }\n\n /**\n * Merges two Option objects together and validates options type\n * @param config new Options\n * @param mergeTo Options to merge into\n * @param includeDataset When true, the elements data-td attributes will be included in the\n * @private\n */\n private _initializeOptions(\n config: Options,\n mergeTo: Options,\n includeDataset = false\n ): void {\n let newConfig = OptionConverter.deepCopy(config);\n newConfig = OptionConverter._mergeOptions(newConfig, mergeTo);\n if (includeDataset)\n newConfig = OptionConverter._dataToOptions(\n this.optionsStore.element,\n newConfig\n );\n\n OptionConverter._validateConflicts(newConfig);\n\n newConfig.viewDate = newConfig.viewDate.setLocalization(\n newConfig.localization\n );\n\n if (!this.optionsStore.viewDate.isSame(newConfig.viewDate)) {\n this.optionsStore.viewDate = newConfig.viewDate;\n }\n\n /**\n * Sets the minimum view allowed by the picker. For example the case of only\n * allowing year and month to be selected but not date.\n */\n if (newConfig.display.components.year) {\n this.optionsStore.minimumCalendarViewMode = 2;\n }\n if (newConfig.display.components.month) {\n this.optionsStore.minimumCalendarViewMode = 1;\n }\n if (newConfig.display.components.date) {\n this.optionsStore.minimumCalendarViewMode = 0;\n }\n\n this.optionsStore.currentCalendarViewMode = Math.max(\n this.optionsStore.minimumCalendarViewMode,\n this.optionsStore.currentCalendarViewMode\n );\n\n // Update view mode if needed\n if (\n CalendarModes[this.optionsStore.currentCalendarViewMode].name !==\n newConfig.display.viewMode\n ) {\n this.optionsStore.currentCalendarViewMode = Math.max(\n CalendarModes.findIndex((x) => x.name === newConfig.display.viewMode),\n this.optionsStore.minimumCalendarViewMode\n );\n }\n\n if (this.display?.isVisible) {\n this.display._update('all');\n }\n\n if (\n newConfig.display.components.useTwentyfourHour &&\n newConfig.localization.hourCycle === undefined\n )\n newConfig.localization.hourCycle = 'h24';\n else if (newConfig.localization.hourCycle === undefined) {\n newConfig.localization.hourCycle = guessHourCycle(\n newConfig.localization.locale\n );\n }\n\n this.optionsStore.options = newConfig;\n }\n\n /**\n * Checks if an input field is being used, attempts to locate one and sets an\n * event listener if found.\n * @private\n */\n private _initializeInput() {\n if (this.optionsStore.element.tagName == 'INPUT') {\n this.optionsStore.input = this.optionsStore.element as HTMLInputElement;\n } else {\n const query = this.optionsStore.element.dataset.tdTargetInput;\n if (query == undefined || query == 'nearest') {\n this.optionsStore.input =\n this.optionsStore.element.querySelector('input');\n } else {\n this.optionsStore.input =\n this.optionsStore.element.querySelector(query);\n }\n }\n\n if (!this.optionsStore.input) return;\n\n if (!this.optionsStore.input.value && this.optionsStore.options.defaultDate)\n this.optionsStore.input.value = this.dates.formatInput(\n this.optionsStore.options.defaultDate\n );\n\n this.optionsStore.input.addEventListener('change', this._inputChangeEvent);\n if (this.optionsStore.options.allowInputToggle) {\n this.optionsStore.input.addEventListener('click', this._toggleClickEvent);\n }\n\n if (this.optionsStore.input.value) {\n this._inputChangeEvent();\n }\n }\n\n /**\n * Attempts to locate a toggle for the picker and sets an event listener\n * @private\n */\n private _initializeToggle() {\n if (this.optionsStore.options.display.inline) return;\n let query = this.optionsStore.element.dataset.tdTargetToggle;\n if (query == 'nearest') {\n query = '[data-td-toggle=\"datetimepicker\"]';\n }\n this._toggle =\n query == undefined\n ? this.optionsStore.element\n : this.optionsStore.element.querySelector(query);\n this._toggle.addEventListener('click', this._toggleClickEvent);\n }\n\n /**\n * If the option is enabled this will render the clock view after a date pick.\n * @param e change event\n * @private\n */\n private _handleAfterChangeEvent(e: ChangeEvent) {\n if (\n // options is disabled\n !this.optionsStore.options.promptTimeOnDateChange ||\n this.optionsStore.options.multipleDates ||\n this.optionsStore.options.display.inline ||\n this.optionsStore.options.display.sideBySide ||\n // time is disabled\n !this.display._hasTime ||\n // clock component is already showing\n this.display.widget\n ?.getElementsByClassName(Namespace.css.show)[0]\n .classList.contains(Namespace.css.timeContainer)\n )\n return;\n\n // First time ever. If useCurrent option is set to true (default), do nothing\n // because the first date is selected automatically.\n // or date didn't change (time did) or date changed because time did.\n if (\n (!e.oldDate && this.optionsStore.options.useCurrent) ||\n (e.oldDate && e.date?.isSame(e.oldDate))\n ) {\n return;\n }\n\n clearTimeout(this._currentPromptTimeTimeout);\n this._currentPromptTimeTimeout = setTimeout(() => {\n if (this.display.widget) {\n this._eventEmitters.action.emit({\n e: {\n currentTarget: this.display.widget.querySelector(\n `.${Namespace.css.switch}`\n ),\n },\n action: ActionTypes.togglePicker,\n });\n }\n }, this.optionsStore.options.promptTimeOnDateChangeTransitionDelay);\n }\n\n /**\n * Event for when the input field changes. This is a class level method so there's\n * something for the remove listener function.\n * @private\n */\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _inputChangeEvent = (event?: any) => {\n const internallyTriggered = event?.detail;\n if (internallyTriggered) return;\n\n const setViewDate = () => {\n if (this.dates.lastPicked)\n this.optionsStore.viewDate = this.dates.lastPicked.clone;\n };\n\n const value = this.optionsStore.input.value;\n if (this.optionsStore.options.multipleDates) {\n try {\n const valueSplit = value.split(\n this.optionsStore.options.multipleDatesSeparator\n );\n for (let i = 0; i < valueSplit.length; i++) {\n this.dates.setFromInput(valueSplit[i], i);\n }\n setViewDate();\n } catch {\n console.warn(\n 'TD: Something went wrong trying to set the multipleDates values from the input field.'\n );\n }\n } else {\n this.dates.setFromInput(value, 0);\n setViewDate();\n }\n };\n\n /**\n * Event for when the toggle is clicked. This is a class level method so there's\n * something for the remove listener function.\n * @private\n */\n private _toggleClickEvent = () => {\n if (\n (this.optionsStore.element as HTMLInputElement)?.disabled ||\n this.optionsStore.input?.disabled\n )\n return;\n this.toggle();\n };\n}\n\n/**\n * Whenever a locale is loaded via a plugin then store it here based on the\n * locale name. E.g. loadedLocales['ru']\n */\nconst loadedLocales = {};\n\n// noinspection JSUnusedGlobalSymbols\n/**\n * Called from a locale plugin.\n * @param l locale object for localization options\n */\nconst loadLocale = (l) => {\n if (loadedLocales[l.name]) return;\n loadedLocales[l.name] = l.localization;\n};\n\n/**\n * A sets the global localization options to the provided locale name.\n * `loadLocale` MUST be called first.\n * @param l\n */\nconst locale = (l: string) => {\n const asked = loadedLocales[l];\n if (!asked) return;\n DefaultOptions.localization = asked;\n};\n\n// noinspection JSUnusedGlobalSymbols\n/**\n * Called from a plugin to extend or override picker defaults.\n * @param plugin\n * @param option\n */\nconst extend = function (plugin, option = undefined) {\n if (!plugin) return tempusDominus;\n if (!plugin.installed) {\n // install plugin only once\n plugin(\n option,\n { TempusDominus, Dates, Display, DateTime, Namespace },\n tempusDominus\n );\n plugin.installed = true;\n }\n return tempusDominus;\n};\n\nconst version = '6.4.4';\n\nconst tempusDominus = {\n TempusDominus,\n extend,\n loadLocale,\n locale,\n Namespace,\n DefaultOptions,\n DateTime,\n Unit,\n version,\n DefaultEnLocalization,\n};\n\nexport {\n TempusDominus,\n extend,\n loadLocale,\n locale,\n Namespace,\n DefaultOptions,\n DateTime,\n Unit,\n version,\n DateTimeFormatOptions,\n Options,\n DefaultEnLocalization,\n};\n"],"names":["DefaultFormatLocalization","ActionTypes","SecondDisplay"],"mappings":";;;;;AAAM,MAAO,OAAQ,SAAQ,KAAK,CAAA;AAEjC,CAAA;MAEY,aAAa,CAAA;AAA1B,IAAA,WAAA,GAAA;QACU,IAAI,CAAA,IAAA,GAAG,KAAK,CAAC;;;AAqKrB;;;AAGG;QACH,IAAsB,CAAA,sBAAA,GAAG,4BAA4B,CAAC;AAEtD;;;AAGG;QACH,IAAkB,CAAA,kBAAA,GAAG,0BAA0B,CAAC;;KAGjD;;AA9KC;;;AAGG;AACH,IAAA,gBAAgB,CAAC,UAAkB,EAAA;AACjC,QAAA,MAAM,KAAK,GAAG,IAAI,OAAO,CACvB,CAAA,EAAG,IAAI,CAAC,IAAI,CAAA,oBAAA,EAAuB,UAAU,CAAA,+BAAA,CAAiC,CAC/E,CAAC;AACF,QAAA,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC;AACf,QAAA,MAAM,KAAK,CAAC;KACb;AAED;;;AAGG;AACH,I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;AAC/B,IAAA,IAAI,CAAC,KAAK;QAAE,OAAO;AACnB,IAAA,cAAc,CAAC,YAAY,GAAG,KAAK,CAAC;AACtC,EAAE;AAEF;AACA;;;;AAIG;AACH,MAAM,MAAM,GAAG,UAAU,MAAM,EAAE,MAAM,GAAG,SAAS,EAAA;AACjD,IAAA,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,aAAa,CAAC;AAClC,IAAA,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;;AAErB,QAAA,MAAM,CACJ,MAAM,EACN,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,EACtD,aAAa,CACd,CAAC;AACF,QAAA,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;AACzB,KAAA;AACD,IAAA,OAAO,aAAa,CAAC;AACvB,EAAE;AAEI,MAAA,OAAO,GAAG,QAAQ;AAExB,MAAM,aAAa,GAAG;IACpB,aAAa;IACb,MAAM;IACN,UAAU;IACV,MAAM;IACN,SAAS;IACT,cAAc;IACd,QAAQ;IACR,IAAI;IACJ,OAAO;IACP,qBAAqB;CACtB;;;;"} \ No newline at end of file +{"version":3,"file":"tempus-dominus.esm.js","sources":["../../src/js/utilities/errors.ts","../../src/js/utilities/namespace.ts","../../src/js/utilities/default-format-localization.ts","../../src/js/datetime.ts","../../src/js/utilities/service-locator.ts","../../src/js/utilities/calendar-modes.ts","../../src/js/utilities/optionsStore.ts","../../src/js/validation.ts","../../src/js/utilities/event-emitter.ts","../../src/js/utilities/default-options.ts","../../src/js/utilities/typeChecker.ts","../../src/js/utilities/optionProcessor.ts","../../src/js/utilities/optionConverter.ts","../../src/js/dates.ts","../../src/js/utilities/action-types.ts","../../src/js/display/calendar/date-display.ts","../../src/js/display/calendar/month-display.ts","../../src/js/display/calendar/year-display.ts","../../src/js/display/calendar/decade-display.ts","../../src/js/display/time/time-display.ts","../../src/js/display/time/hour-display.ts","../../src/js/display/time/minute-display.ts","../../src/js/display/time/second-display.ts","../../src/js/display/collapse.ts","../../src/js/display/index.ts","../../src/js/actions.ts","../../src/js/tempus-dominus.ts"],"sourcesContent":["export class TdError extends Error {\n code: number;\n}\n\nexport class ErrorMessages {\n private base = 'TD:';\n\n //#region out to console\n\n /**\n * Throws an error indicating that a key in the options object is invalid.\n * @param optionName\n */\n unexpectedOption(optionName: string) {\n const error = new TdError(\n `${this.base} Unexpected option: ${optionName} does not match a known option.`\n );\n error.code = 1;\n throw error;\n }\n\n /**\n * Throws an error indicating that one more keys in the options object is invalid.\n * @param optionName\n */\n unexpectedOptions(optionName: string[]) {\n const error = new TdError(`${this.base}: ${optionName.join(', ')}`);\n error.code = 1;\n throw error;\n }\n\n /**\n * Throws an error when an option is provide an unsupported value.\n * For example a value of 'cheese' for toolbarPlacement which only supports\n * 'top', 'bottom', 'default'.\n * @param optionName\n * @param badValue\n * @param validOptions\n */\n unexpectedOptionValue(\n optionName: string,\n badValue: string,\n validOptions: string[]\n ) {\n const error = new TdError(\n `${\n this.base\n } Unexpected option value: ${optionName} does not accept a value of \"${badValue}\". Valid values are: ${validOptions.join(\n ', '\n )}`\n );\n error.code = 2;\n throw error;\n }\n\n /**\n * Throws an error when an option value is the wrong type.\n * For example a string value was provided to multipleDates which only\n * supports true or false.\n * @param optionName\n * @param badType\n * @param expectedType\n */\n typeMismatch(optionName: string, badType: string, expectedType: string) {\n const error = new TdError(\n `${this.base} Mismatch types: ${optionName} has a type of ${badType} instead of the required ${expectedType}`\n );\n error.code = 3;\n throw error;\n }\n\n /**\n * Throws an error when an option value is outside of the expected range.\n * For example restrictions.daysOfWeekDisabled excepts a value between 0 and 6.\n * @param optionName\n * @param lower\n * @param upper\n */\n numbersOutOfRange(optionName: string, lower: number, upper: number) {\n const error = new TdError(\n `${this.base} ${optionName} expected an array of number between ${lower} and ${upper}.`\n );\n error.code = 4;\n throw error;\n }\n\n /**\n * Throws an error when a value for a date options couldn't be parsed. Either\n * the option was an invalid string or an invalid Date object.\n * @param optionName\n * @param date\n * @param soft If true, logs a warning instead of an error.\n */\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n failedToParseDate(optionName: string, date: any, soft = false) {\n const error = new TdError(\n `${this.base} Could not correctly parse \"${date}\" to a date for ${optionName}.`\n );\n error.code = 5;\n if (!soft) throw error;\n console.warn(error);\n }\n\n /**\n * Throws when an element to attach to was not provided in the constructor.\n */\n mustProvideElement() {\n const error = new TdError(`${this.base} No element was provided.`);\n error.code = 6;\n throw error;\n }\n\n /**\n * Throws if providing an array for the events to subscribe method doesn't have\n * the same number of callbacks. E.g., subscribe([1,2], [1])\n */\n subscribeMismatch() {\n const error = new TdError(\n `${this.base} The subscribed events does not match the number of callbacks`\n );\n error.code = 7;\n throw error;\n }\n\n /**\n * Throws if the configuration has conflicting rules e.g. minDate is after maxDate\n */\n conflictingConfiguration(message?: string) {\n const error = new TdError(\n `${this.base} A configuration value conflicts with another rule. ${message}`\n );\n error.code = 8;\n throw error;\n }\n\n /**\n * customDateFormat errors\n */\n customDateFormatError(message?: string) {\n const error = new TdError(`${this.base} Custom Date Format: ${message}`);\n error.code = 9;\n throw error;\n }\n\n /**\n * Logs a warning if a date option value is provided as a string, instead of\n * a date/datetime object.\n */\n dateString() {\n console.warn(\n `${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`\n );\n }\n\n deprecatedWarning(message: string, remediation?: string) {\n console.warn(\n `${this.base} Warning ${message} is deprecated and will be removed in a future version. ${remediation}`\n );\n }\n\n throwError(message) {\n const error = new TdError(`${this.base} ${message}`);\n error.code = 9;\n throw error;\n }\n\n //#endregion\n\n //#region used with notify.error\n\n /**\n * Used with an Error Event type if the user selects a date that\n * fails restriction validation.\n */\n failedToSetInvalidDate = 'Failed to set invalid date';\n\n /**\n * Used with an Error Event type when a user changes the value of the\n * input field directly, and does not provide a valid date.\n */\n failedToParseInput = 'Failed parse input field';\n\n //#endregion\n}\n","import { ErrorMessages } from './errors';\n// this is not the way I want this to stay but nested classes seemed to blown up once its compiled.\nconst NAME = 'tempus-dominus',\n dataKey = 'td';\n\n/**\n * Events\n */\nclass Events {\n key = `.${dataKey}`;\n\n /**\n * Change event. Fired when the user selects a date.\n * See also EventTypes.ChangeEvent\n */\n change = `change${this.key}`;\n\n /**\n * Emit when the view changes for example from month view to the year view.\n * See also EventTypes.ViewUpdateEvent\n */\n update = `update${this.key}`;\n\n /**\n * Emits when a selected date or value from the input field fails to meet the provided validation rules.\n * See also EventTypes.FailEvent\n */\n error = `error${this.key}`;\n\n /**\n * Show event\n * @event Events#show\n */\n show = `show${this.key}`;\n\n /**\n * Hide event\n * @event Events#hide\n */\n hide = `hide${this.key}`;\n\n // blur and focus are used in the jQuery provider but are otherwise unused.\n // keyup/down will be used later for keybinding options\n\n blur = `blur${this.key}`;\n focus = `focus${this.key}`;\n keyup = `keyup${this.key}`;\n keydown = `keydown${this.key}`;\n}\n\nclass Css {\n /**\n * The outer element for the widget.\n */\n widget = `${NAME}-widget`;\n\n /**\n * Hold the previous, next and switcher divs\n */\n calendarHeader = 'calendar-header';\n\n /**\n * The element for the action to change the calendar view. E.g. month -> year.\n */\n switch = 'picker-switch';\n\n /**\n * The elements for all the toolbar options\n */\n toolbar = 'toolbar';\n\n /**\n * Disables the hover and rounding affect.\n */\n noHighlight = 'no-highlight';\n\n /**\n * Applied to the widget element when the side by side option is in use.\n */\n sideBySide = 'timepicker-sbs';\n\n /**\n * The element for the action to change the calendar view, e.g. August -> July\n */\n previous = 'previous';\n\n /**\n * The element for the action to change the calendar view, e.g. August -> September\n */\n next = 'next';\n\n /**\n * Applied to any action that would violate any restriction options. ALso applied\n * to an input field if the disabled function is called.\n */\n disabled = 'disabled';\n\n /**\n * Applied to any date that is less than requested view,\n * e.g. the last day of the previous month.\n */\n old = 'old';\n\n /**\n * Applied to any date that is greater than of requested view,\n * e.g. the last day of the previous month.\n */\n new = 'new';\n\n /**\n * Applied to any date that is currently selected.\n */\n active = 'active';\n\n //#region date element\n\n /**\n * The outer element for the calendar view.\n */\n dateContainer = 'date-container';\n\n /**\n * The outer element for the decades view.\n */\n decadesContainer = `${this.dateContainer}-decades`;\n\n /**\n * Applied to elements within the decade container, e.g. 2020, 2030\n */\n decade = 'decade';\n\n /**\n * The outer element for the years view.\n */\n yearsContainer = `${this.dateContainer}-years`;\n\n /**\n * Applied to elements within the years container, e.g. 2021, 2021\n */\n year = 'year';\n\n /**\n * The outer element for the month view.\n */\n monthsContainer = `${this.dateContainer}-months`;\n\n /**\n * Applied to elements within the month container, e.g. January, February\n */\n month = 'month';\n\n /**\n * The outer element for the calendar view.\n */\n daysContainer = `${this.dateContainer}-days`;\n\n /**\n * Applied to elements within the day container, e.g. 1, 2..31\n */\n day = 'day';\n\n /**\n * If display.calendarWeeks is enabled, a column displaying the week of year\n * is shown. This class is applied to each cell in that column.\n */\n calendarWeeks = 'cw';\n\n /**\n * Applied to the first row of the calendar view, e.g. Sunday, Monday\n */\n dayOfTheWeek = 'dow';\n\n /**\n * Applied to the current date on the calendar view.\n */\n today = 'today';\n\n /**\n * Applied to the locale's weekend dates on the calendar view, e.g. Sunday, Saturday\n */\n weekend = 'weekend';\n\n rangeIn = 'range-in';\n rangeStart = 'range-start';\n rangeEnd = 'range-end';\n\n //#endregion\n\n //#region time element\n\n /**\n * The outer element for all time related elements.\n */\n timeContainer = 'time-container';\n\n /**\n * Applied the separator columns between time elements, e.g. hour *:* minute *:* second\n */\n separator = 'separator';\n\n /**\n * The outer element for the clock view.\n */\n clockContainer = `${this.timeContainer}-clock`;\n\n /**\n * The outer element for the hours selection view.\n */\n hourContainer = `${this.timeContainer}-hour`;\n\n /**\n * The outer element for the minutes selection view.\n */\n minuteContainer = `${this.timeContainer}-minute`;\n\n /**\n * The outer element for the seconds selection view.\n */\n secondContainer = `${this.timeContainer}-second`;\n\n /**\n * Applied to each element in the hours selection view.\n */\n hour = 'hour';\n\n /**\n * Applied to each element in the minutes selection view.\n */\n minute = 'minute';\n\n /**\n * Applied to each element in the seconds selection view.\n */\n second = 'second';\n\n /**\n * Applied AM/PM toggle button.\n */\n toggleMeridiem = 'toggleMeridiem';\n\n //#endregion\n\n //#region collapse\n\n /**\n * Applied the element of the current view mode, e.g. calendar or clock.\n */\n show = 'show';\n\n /**\n * Applied to the currently showing view mode during a transition\n * between calendar and clock views\n */\n collapsing = 'td-collapsing';\n\n /**\n * Applied to the currently hidden view mode.\n */\n collapse = 'td-collapse';\n\n //#endregion\n\n /**\n * Applied to the widget when the option display.inline is enabled.\n */\n inline = 'inline';\n\n /**\n * Applied to the widget when the option display.theme is light.\n */\n lightTheme = 'light';\n\n /**\n * Applied to the widget when the option display.theme is dark.\n */\n darkTheme = 'dark';\n\n /**\n * Used for detecting if the system color preference is dark mode\n */\n isDarkPreferredQuery = '(prefers-color-scheme: dark)';\n}\n\nexport default class Namespace {\n static NAME = NAME;\n // noinspection JSUnusedGlobalSymbols\n static dataKey = dataKey;\n\n static events = new Events();\n\n static css = new Css();\n\n static errorMessages = new ErrorMessages();\n}\n","import { FormatLocalization } from './options';\n\nconst DefaultFormatLocalization: FormatLocalization = {\n locale: 'default',\n hourCycle: undefined,\n dateFormats: {\n LTS: 'h:mm:ss T',\n LT: 'h:mm T',\n L: 'MM/dd/yyyy',\n LL: 'MMMM d, yyyy',\n LLL: 'MMMM d, yyyy h:mm T',\n LLLL: 'dddd, MMMM d, yyyy h:mm T',\n },\n ordinal: (n) => {\n const s = ['th', 'st', 'nd', 'rd'];\n const v = n % 100;\n return `[${n}${s[(v - 20) % 10] || s[v] || s[0]}]`;\n },\n format: 'L LT',\n};\n\nexport default { ...DefaultFormatLocalization };\n","import { FormatLocalization } from './utilities/options';\nimport Namespace from './utilities/namespace';\nimport DefaultFormatLocalization from './utilities/default-format-localization';\n\ntype parsedTime = {\n year?: number;\n month?: number;\n day?: number;\n hours?: number;\n minutes?: number;\n seconds?: number;\n milliseconds?: number;\n zone?: {\n offset: number;\n };\n};\n\nexport enum Unit {\n seconds = 'seconds',\n minutes = 'minutes',\n hours = 'hours',\n date = 'date',\n month = 'month',\n year = 'year',\n}\n\nconst twoDigitTemplate = {\n month: '2-digit',\n day: '2-digit',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n};\n\nexport interface DateTimeFormatOptions extends Intl.DateTimeFormatOptions {\n timeStyle?: 'short' | 'medium' | 'long';\n dateStyle?: 'short' | 'medium' | 'long' | 'full';\n numberingSystem?: string;\n}\n\n/**\n * Returns an Intl format object based on the provided object\n * @param unit\n */\nexport const getFormatByUnit = (unit: Unit): object => {\n switch (unit) {\n case 'date':\n return { dateStyle: 'short' };\n case 'month':\n return {\n month: 'numeric',\n year: 'numeric',\n };\n case 'year':\n return { year: 'numeric' };\n }\n};\n\n/**\n * Attempts to guess the hour cycle of the given local\n * @param locale\n */\nexport const guessHourCycle = (locale: string): Intl.LocaleHourCycleKey => {\n if (!locale) return 'h12';\n\n // noinspection SpellCheckingInspection\n const template = {\n hour: '2-digit',\n minute: '2-digit',\n numberingSystem: 'latn',\n };\n\n const dt = new DateTime().setLocalization({ locale });\n dt.hours = 0;\n\n const start = dt.parts(undefined, template).hour;\n\n //midnight is 12 so en-US style 12 AM\n if (start === '12') return 'h12';\n //midnight is 24 is from 00-24\n if (start === '24') return 'h24';\n\n dt.hours = 23;\n const end = dt.parts(undefined, template).hour;\n\n //if midnight is 00 and hour 23 is 11 then\n if (start === '00' && end === '11') return 'h11';\n\n if (start === '00' && end === '23') return 'h23';\n\n console.warn(\n `couldn't determine hour cycle for ${locale}. start: ${start}. end: ${end}`\n );\n\n return undefined;\n};\n\n/**\n * For the most part this object behaves exactly the same way\n * as the native Date object with a little extra spice.\n */\nexport class DateTime extends Date {\n localization: FormatLocalization = DefaultFormatLocalization;\n\n /**\n * Chainable way to set the {@link locale}\n * @param value\n * @deprecated use setLocalization with a FormatLocalization object instead\n */\n setLocale(value: string): this {\n if (!this.localization) {\n this.localization = DefaultFormatLocalization;\n this.localization.locale = value;\n }\n return this;\n }\n\n /**\n * Chainable way to set the {@link localization}\n * @param value\n */\n setLocalization(value: FormatLocalization): this {\n this.localization = value;\n return this;\n }\n\n /**\n * Converts a plain JS date object to a DateTime object.\n * Doing this allows access to format, etc.\n * @param date\n * @param locale this parameter is deprecated. Use formatLocalization instead.\n * @param formatLocalization\n */\n static convert(\n date: Date,\n locale = 'default',\n formatLocalization: FormatLocalization = undefined\n ): DateTime {\n if (!date) throw new Error(`A date is required`);\n\n if (!formatLocalization) {\n formatLocalization = DefaultFormatLocalization;\n formatLocalization.locale = locale;\n }\n\n return new DateTime(\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n date.getMilliseconds()\n ).setLocalization(formatLocalization);\n }\n\n /**\n * Native date manipulations are not pure functions. This function creates a duplicate of the DateTime object.\n */\n get clone() {\n return new DateTime(\n this.year,\n this.month,\n this.date,\n this.hours,\n this.minutes,\n this.seconds,\n this.getMilliseconds()\n ).setLocalization(this.localization);\n }\n\n static isValid(d): boolean {\n if (d === undefined || JSON.stringify(d) === 'null') return false;\n if (d.constructor.name === DateTime.name) return true;\n return false;\n }\n\n /**\n * Sets the current date to the start of the {@link unit} provided\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).startOf('month')\n * would return April 1, 2021, 12:00:00.000 AM (midnight)\n * @param unit\n * @param startOfTheWeek Allows for the changing the start of the week.\n */\n startOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n switch (unit) {\n case 'seconds':\n this.setMilliseconds(0);\n break;\n case 'minutes':\n this.setSeconds(0, 0);\n break;\n case 'hours':\n this.setMinutes(0, 0, 0);\n break;\n case 'date':\n this.setHours(0, 0, 0, 0);\n break;\n case 'weekDay': {\n this.startOf(Unit.date);\n if (this.weekDay === startOfTheWeek) break;\n let goBack = this.weekDay;\n if (startOfTheWeek !== 0 && this.weekDay === 0)\n goBack = 8 - startOfTheWeek;\n this.manipulate(startOfTheWeek - goBack, Unit.date);\n break;\n }\n case 'month':\n this.startOf(Unit.date);\n this.setDate(1);\n break;\n case 'year':\n this.startOf(Unit.date);\n this.setMonth(0, 1);\n break;\n }\n return this;\n }\n\n /**\n * Sets the current date to the end of the {@link unit} provided\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).endOf('month')\n * would return April 30, 2021, 11:59:59.999 PM\n * @param unit\n * @param startOfTheWeek\n */\n endOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n switch (unit) {\n case 'seconds':\n this.setMilliseconds(999);\n break;\n case 'minutes':\n this.setSeconds(59, 999);\n break;\n case 'hours':\n this.setMinutes(59, 59, 999);\n break;\n case 'date':\n this.setHours(23, 59, 59, 999);\n break;\n case 'weekDay': {\n this.endOf(Unit.date);\n const endOfWeek = 6 + startOfTheWeek;\n if (this.weekDay === endOfWeek) break;\n this.manipulate(endOfWeek - this.weekDay, Unit.date);\n break;\n }\n case 'month':\n this.endOf(Unit.date);\n this.manipulate(1, Unit.month);\n this.setDate(0);\n break;\n case 'year':\n this.endOf(Unit.date);\n this.setMonth(11, 31);\n break;\n }\n return this;\n }\n\n /**\n * Change a {@link unit} value. Value can be positive or negative\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).manipulate(1, 'month')\n * would return May 30, 2021, 11:45:32.984 AM\n * @param value A positive or negative number\n * @param unit\n */\n manipulate(value: number, unit: Unit): this {\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n this[unit] += value;\n return this;\n }\n\n /**\n * Return true if {@link compare} is before this date\n * @param compare The Date/DateTime to compare\n * @param unit If provided, uses {@link startOf} for\n * comparison.\n */\n isBefore(compare: DateTime, unit?: Unit): boolean {\n // If the comparisons is undefined, return false\n if (!DateTime.isValid(compare)) return false;\n\n if (!unit) return this.valueOf() < compare.valueOf();\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n return (\n this.clone.startOf(unit).valueOf() < compare.clone.startOf(unit).valueOf()\n );\n }\n\n /**\n * Return true if {@link compare} is after this date\n * @param compare The Date/DateTime to compare\n * @param unit If provided, uses {@link startOf} for\n * comparison.\n */\n isAfter(compare: DateTime, unit?: Unit): boolean {\n // If the comparisons is undefined, return false\n if (!DateTime.isValid(compare)) return false;\n\n if (!unit) return this.valueOf() > compare.valueOf();\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n return (\n this.clone.startOf(unit).valueOf() > compare.clone.startOf(unit).valueOf()\n );\n }\n\n /**\n * Return true if {@link compare} is same this date\n * @param compare The Date/DateTime to compare\n * @param unit If provided, uses {@link startOf} for\n * comparison.\n */\n isSame(compare: DateTime, unit?: Unit): boolean {\n // If the comparisons is undefined, return false\n if (!DateTime.isValid(compare)) return false;\n\n if (!unit) return this.valueOf() === compare.valueOf();\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n compare = DateTime.convert(compare);\n return (\n this.clone.startOf(unit).valueOf() === compare.startOf(unit).valueOf()\n );\n }\n\n /**\n * Check if this is between two other DateTimes, optionally looking at unit scale. The match is exclusive.\n * @param left\n * @param right\n * @param unit.\n * @param inclusivity. A [ indicates inclusion of a value. A ( indicates exclusion.\n * If the inclusivity parameter is used, both indicators must be passed.\n */\n isBetween(\n left: DateTime,\n right: DateTime,\n unit?: Unit,\n inclusivity: '()' | '[]' | '(]' | '[)' = '()'\n ): boolean {\n // If one of the comparisons is undefined, return false\n if (!DateTime.isValid(left) || !DateTime.isValid(right)) return false;\n // If a unit is provided and is not a valid property of the DateTime object, throw an error\n if (unit && this[unit] === undefined) {\n throw new Error(`Unit '${unit}' is not valid`);\n }\n\n const leftInclusivity = inclusivity[0] === '(';\n const rightInclusivity = inclusivity[1] === ')';\n\n const isLeftInRange = leftInclusivity\n ? this.isAfter(left, unit)\n : !this.isBefore(left, unit);\n const isRightInRange = rightInclusivity\n ? this.isBefore(right, unit)\n : !this.isAfter(right, unit);\n\n return isLeftInRange && isRightInRange;\n }\n\n /**\n * Returns flattened object of the date. Does not include literals\n * @param locale\n * @param template\n */\n parts(\n locale = this.localization.locale,\n template: Record = { dateStyle: 'full', timeStyle: 'long' }\n ): Record {\n const parts = {};\n new Intl.DateTimeFormat(locale, template)\n .formatToParts(this)\n .filter((x) => x.type !== 'literal')\n .forEach((x) => (parts[x.type] = x.value));\n return parts;\n }\n\n /**\n * Shortcut to Date.getSeconds()\n */\n get seconds(): number {\n return this.getSeconds();\n }\n\n /**\n * Shortcut to Date.setSeconds()\n */\n set seconds(value: number) {\n this.setSeconds(value);\n }\n\n /**\n * Returns two digit hours\n */\n get secondsFormatted(): string {\n return this.parts(undefined, twoDigitTemplate).second;\n }\n\n /**\n * Shortcut to Date.getMinutes()\n */\n get minutes(): number {\n return this.getMinutes();\n }\n\n /**\n * Shortcut to Date.setMinutes()\n */\n set minutes(value: number) {\n this.setMinutes(value);\n }\n\n /**\n * Returns two digit minutes\n */\n get minutesFormatted(): string {\n return this.parts(undefined, twoDigitTemplate).minute;\n }\n\n /**\n * Shortcut to Date.getHours()\n */\n get hours(): number {\n return this.getHours();\n }\n\n /**\n * Shortcut to Date.setHours()\n */\n set hours(value: number) {\n this.setHours(value);\n }\n\n /**\n * Returns two digit hour, e.g. 01...10\n * @param hourCycle Providing an hour cycle will change 00 to 24 depending on the given value.\n */\n getHoursFormatted(hourCycle: Intl.LocaleHourCycleKey = 'h12') {\n return this.parts(undefined, { ...twoDigitTemplate, hourCycle: hourCycle })\n .hour;\n }\n\n /**\n * Get the meridiem of the date. E.g. AM or PM.\n * If the {@link locale} provides a \"dayPeriod\" then this will be returned,\n * otherwise it will return AM or PM.\n * @param locale\n */\n meridiem(locale: string = this.localization.locale): string {\n return new Intl.DateTimeFormat(locale, {\n hour: 'numeric',\n hour12: true,\n })\n .formatToParts(this)\n .find((p) => p.type === 'dayPeriod')?.value;\n }\n\n /**\n * Shortcut to Date.getDate()\n */\n get date(): number {\n return this.getDate();\n }\n\n /**\n * Shortcut to Date.setDate()\n */\n set date(value: number) {\n this.setDate(value);\n }\n\n /**\n * Return two digit date\n */\n get dateFormatted(): string {\n return this.parts(undefined, twoDigitTemplate).day;\n }\n\n /**\n * Shortcut to Date.getDay()\n */\n get weekDay(): number {\n return this.getDay();\n }\n\n /**\n * Shortcut to Date.getMonth()\n */\n get month(): number {\n return this.getMonth();\n }\n\n /**\n * Shortcut to Date.setMonth()\n */\n set month(value: number) {\n const targetMonth = new Date(this.year, value + 1);\n targetMonth.setDate(0);\n const endOfMonth = targetMonth.getDate();\n if (this.date > endOfMonth) {\n this.date = endOfMonth;\n }\n this.setMonth(value);\n }\n\n /**\n * Return two digit, human expected month. E.g. January = 1, December = 12\n */\n get monthFormatted(): string {\n return this.parts(undefined, twoDigitTemplate).month;\n }\n\n /**\n * Shortcut to Date.getFullYear()\n */\n get year(): number {\n return this.getFullYear();\n }\n\n /**\n * Shortcut to Date.setFullYear()\n */\n set year(value: number) {\n this.setFullYear(value);\n }\n\n // borrowed a bunch of stuff from Luxon\n /**\n * Gets the week of the year\n */\n get week(): number {\n const ordinal = this.computeOrdinal(),\n weekday = this.getUTCDay();\n\n let weekNumber = Math.floor((ordinal - weekday + 10) / 7);\n\n if (weekNumber < 1) {\n weekNumber = this.weeksInWeekYear();\n } else if (weekNumber > this.weeksInWeekYear()) {\n weekNumber = 1;\n }\n\n return weekNumber;\n }\n\n /**\n * Returns the number of weeks in the year\n */\n weeksInWeekYear() {\n const p1 =\n (this.year +\n Math.floor(this.year / 4) -\n Math.floor(this.year / 100) +\n Math.floor(this.year / 400)) %\n 7,\n last = this.year - 1,\n p2 =\n (last +\n Math.floor(last / 4) -\n Math.floor(last / 100) +\n Math.floor(last / 400)) %\n 7;\n return p1 === 4 || p2 === 3 ? 53 : 52;\n }\n\n /**\n * Returns true or false depending on if the year is a leap year or not.\n */\n get isLeapYear() {\n return (\n this.year % 4 === 0 && (this.year % 100 !== 0 || this.year % 400 === 0)\n );\n }\n\n private computeOrdinal() {\n return (\n this.date +\n (this.isLeapYear ? this.leapLadder : this.nonLeapLadder)[this.month]\n );\n }\n\n private nonLeapLadder = [\n 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334,\n ];\n private leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\n //#region CDF stuff\n\n private dateTimeRegex =\n //is regex cannot be simplified beyond what it already is\n /(\\[[^[\\]]*])|y{1,4}|M{1,4}|d{1,4}|H{1,2}|h{1,2}|t|T|m{1,2}|s{1,2}|f{3}/g; //NOSONAR\n\n private formattingTokens =\n /(\\[[^[\\]]*])|([-_:/.,()\\s]+)|(T|t|yyyy|yy?|MM?M?M?|Do|dd?|hh?|HH?|mm?|ss?)/g; //NOSONAR is regex cannot be simplified beyond what it already is\n\n /**\n * Returns a list of month values based on the current locale\n */\n private getAllMonths(\n format: '2-digit' | 'numeric' | 'long' | 'short' | 'narrow' = 'long'\n ) {\n const applyFormat = new Intl.DateTimeFormat(this.localization.locale, {\n month: format,\n }).format;\n return [...Array(12).keys()].map((m) => applyFormat(new Date(2021, m)));\n }\n\n /**\n * Replaces an expanded token set (e.g. LT/LTS)\n */\n private replaceTokens(formatStr, formats) {\n /***\n * _ => match\n * a => first capture group. Anything between [ and ]\n * b => second capture group\n */\n return formatStr.replace(\n /(\\[[^[\\]]*])|(LTS?|l{1,4}|L{1,4})/g,\n (_, a, b) => {\n const B = b && b.toUpperCase();\n return a || formats[B] || DefaultFormatLocalization.dateFormats[B];\n }\n );\n }\n\n private match2 = /\\d\\d/; // 00 - 99\n private match3 = /\\d{3}/; // 000 - 999\n private match4 = /\\d{4}/; // 0000 - 9999\n private match1to2 = /\\d\\d?/; // 0 - 99\n private matchSigned = /[+-]?\\d+/; // -inf - inf\n private matchOffset = /[+-]\\d\\d:?(\\d\\d)?|Z/; // +00:00 -00:00 +0000 or -0000 +00 or Z\n private matchWord = /[^\\d_:/,\\-()\\s]+/; // Word\n\n private parseTwoDigitYear(input) {\n input = +input;\n return input + (input > 68 ? 1900 : 2000);\n }\n\n private offsetFromString(string) {\n if (!string) return 0;\n if (string === 'Z') return 0;\n const [first, second, third] = string.match(/([+-]|\\d\\d)/g);\n const minutes = +(second * 60) + (+third || 0);\n const signed = first === '+' ? -minutes : minutes;\n return minutes === 0 ? 0 : signed; // eslint-disable-line no-nested-ternary\n }\n\n /**\n * z = -4, zz = -04, zzz = -0400\n * @param date\n * @param style\n * @private\n */\n private zoneInformation(date: DateTime, style: 'z' | 'zz' | 'zzz') {\n let name = date\n .parts(this.localization.locale, { timeZoneName: 'longOffset' })\n .timeZoneName.replace('GMT', '')\n .replace(':', '');\n\n const negative = name.includes('-');\n\n name = name.replace('-', '');\n\n if (style === 'z') name = name.substring(1, 2);\n else if (style === 'zz') name = name.substring(0, 2);\n\n return `${negative ? '-' : ''}${name}`;\n }\n\n private zoneExpressions = [\n this.matchOffset,\n (obj, input) => {\n obj.offset = this.offsetFromString(input);\n },\n ];\n\n private addInput(property) {\n return (time, input) => {\n time[property] = +input;\n };\n }\n\n private meridiemMatch(input) {\n const meridiem = new Intl.DateTimeFormat(this.localization.locale, {\n hour: 'numeric',\n hour12: true,\n })\n .formatToParts(new Date(2022, 3, 4, 13))\n .find((p) => p.type === 'dayPeriod')?.value;\n\n return input.toLowerCase() === meridiem.toLowerCase();\n }\n\n private expressions = {\n t: [\n this.matchWord,\n (ojb, input) => {\n ojb.afternoon = this.meridiemMatch(input);\n },\n ],\n T: [\n this.matchWord,\n (ojb, input) => {\n ojb.afternoon = this.meridiemMatch(input);\n },\n ],\n fff: [\n this.match3,\n (ojb, input) => {\n ojb.milliseconds = +input;\n },\n ],\n s: [this.match1to2, this.addInput('seconds')],\n ss: [this.match1to2, this.addInput('seconds')],\n m: [this.match1to2, this.addInput('minutes')],\n mm: [this.match1to2, this.addInput('minutes')],\n H: [this.match1to2, this.addInput('hours')],\n h: [this.match1to2, this.addInput('hours')],\n HH: [this.match1to2, this.addInput('hours')],\n hh: [this.match1to2, this.addInput('hours')],\n d: [this.match1to2, this.addInput('day')],\n dd: [this.match2, this.addInput('day')],\n Do: [\n this.matchWord,\n (ojb, input) => {\n [ojb.day] = input.match(/\\d+/);\n if (!this.localization.ordinal) return;\n for (let i = 1; i <= 31; i += 1) {\n if (this.localization.ordinal(i).replace(/[[\\]]/g, '') === input) {\n ojb.day = i;\n }\n }\n },\n ],\n M: [this.match1to2, this.addInput('month')],\n MM: [this.match2, this.addInput('month')],\n MMM: [\n this.matchWord,\n (obj, input) => {\n const months = this.getAllMonths();\n const monthsShort = this.getAllMonths('short');\n const matchIndex =\n (monthsShort || months.map((_) => _.slice(0, 3))).indexOf(input) + 1;\n if (matchIndex < 1) {\n throw new Error();\n }\n obj.month = matchIndex % 12 || matchIndex;\n },\n ],\n MMMM: [\n this.matchWord,\n (obj, input) => {\n const months = this.getAllMonths();\n const matchIndex = months.indexOf(input) + 1;\n if (matchIndex < 1) {\n throw new Error();\n }\n obj.month = matchIndex % 12 || matchIndex;\n },\n ],\n y: [this.matchSigned, this.addInput('year')],\n yy: [\n this.match2,\n (obj, input) => {\n obj.year = this.parseTwoDigitYear(input);\n },\n ],\n yyyy: [this.match4, this.addInput('year')],\n // z: this.zoneExpressions,\n // zz: this.zoneExpressions,\n // zzz: this.zoneExpressions\n };\n\n private correctHours(time) {\n const { afternoon } = time;\n if (afternoon !== undefined) {\n const { hours } = time;\n if (afternoon) {\n if (hours < 12) {\n time.hours += 12;\n }\n } else if (hours === 12) {\n time.hours = 0;\n }\n delete time.afternoon;\n }\n }\n\n private makeParser(format) {\n format = this.replaceTokens(format, this.localization.dateFormats);\n const array = format.match(this.formattingTokens);\n const { length } = array;\n for (let i = 0; i < length; i += 1) {\n const token = array[i];\n const parseTo = this.expressions[token];\n const regex = parseTo && parseTo[0];\n const parser = parseTo && parseTo[1];\n if (parser) {\n array[i] = { regex, parser };\n } else {\n array[i] = token.replace(/^\\[[^[\\]]*]$/g, '');\n }\n }\n\n return (input): parsedTime => {\n const time = {\n hours: 0,\n minutes: 0,\n seconds: 0,\n milliseconds: 0,\n };\n for (let i = 0, start = 0; i < length; i += 1) {\n const token = array[i];\n if (typeof token === 'string') {\n start += token.length;\n } else {\n const { regex, parser } = token;\n const part = input.slice(start);\n const match = regex.exec(part);\n const value = match[0];\n parser.call(this, time, value);\n input = input.replace(value, '');\n }\n }\n this.correctHours(time);\n return time;\n };\n }\n\n /**\n * Attempts to create a DateTime from a string.\n * @param input date as string\n * @param localization provides the date template the string is in via the format property\n */\n //eslint-disable-next-line @typescript-eslint/no-unused-vars\n static fromString(input: string, localization: FormatLocalization): DateTime {\n if (!localization?.format) {\n Namespace.errorMessages.customDateFormatError('No format was provided');\n }\n try {\n const dt = new DateTime();\n dt.setLocalization(localization);\n if (['x', 'X'].indexOf(localization.format) > -1)\n return new DateTime((localization.format === 'X' ? 1000 : 1) * +input);\n\n const parser = dt.makeParser(localization.format);\n const { year, month, day, hours, minutes, seconds, milliseconds, zone } =\n parser(input);\n const d = day || (!year && !month ? dt.getDate() : 1);\n const y = year || dt.getFullYear();\n let M = 0;\n if (!(year && !month)) {\n M = month > 0 ? month - 1 : dt.getMonth();\n }\n if (zone) {\n return new DateTime(\n Date.UTC(\n y,\n M,\n d,\n hours,\n minutes,\n seconds,\n milliseconds + zone.offset * 60 * 1000\n )\n );\n }\n return new DateTime(y, M, d, hours, minutes, seconds, milliseconds);\n } catch (e) {\n Namespace.errorMessages.customDateFormatError(\n `Unable to parse provided input: ${input}, format: ${localization.format}`\n );\n }\n }\n\n /**\n * Returns a string format.\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat\n * for valid templates and locale objects\n * @param template An optional object. If provided, method will use Intl., otherwise the localizations format properties\n * @param locale Can be a string or an array of strings. Uses browser defaults otherwise.\n */\n format(\n template?: DateTimeFormatOptions | string,\n locale = this.localization.locale\n ): string {\n if (template && typeof template === 'object')\n return new Intl.DateTimeFormat(locale, template).format(this);\n\n const formatString = this.replaceTokens(\n //try template first\n template ||\n //otherwise try localization format\n this.localization.format ||\n //otherwise try date + time\n `${DefaultFormatLocalization.dateFormats.L}, ${DefaultFormatLocalization.dateFormats.LT}`,\n this.localization.dateFormats\n );\n\n const formatter = (template) =>\n new Intl.DateTimeFormat(this.localization.locale, template).format(this);\n\n if (!this.localization.hourCycle)\n this.localization.hourCycle = guessHourCycle(this.localization.locale);\n\n //if the format asks for a twenty-four-hour string but the hour cycle is not, then make a base guess\n const HHCycle = this.localization.hourCycle.startsWith('h1')\n ? 'h24'\n : this.localization.hourCycle;\n const hhCycle = this.localization.hourCycle.startsWith('h2')\n ? 'h12'\n : this.localization.hourCycle;\n\n const matches = {\n yy: formatter({ year: '2-digit' }),\n yyyy: this.year,\n M: formatter({ month: 'numeric' }),\n MM: this.monthFormatted,\n MMM: this.getAllMonths('short')[this.getMonth()],\n MMMM: this.getAllMonths()[this.getMonth()],\n d: this.date,\n dd: this.dateFormatted,\n ddd: formatter({ weekday: 'short' }),\n dddd: formatter({ weekday: 'long' }),\n H: this.getHours(),\n HH: this.getHoursFormatted(HHCycle),\n h: this.hours > 12 ? this.hours - 12 : this.hours,\n hh: this.getHoursFormatted(hhCycle),\n t: this.meridiem(),\n T: this.meridiem().toUpperCase(),\n m: this.minutes,\n mm: this.minutesFormatted,\n s: this.seconds,\n ss: this.secondsFormatted,\n fff: this.getMilliseconds(),\n // z: this.zoneInformation(dateTime, 'z'), //-4\n // zz: this.zoneInformation(dateTime, 'zz'), //-04\n // zzz: this.zoneInformation(dateTime, 'zzz') //-0400\n };\n\n return formatString\n .replace(this.dateTimeRegex, (match, $1) => {\n return $1 || matches[match];\n })\n .replace(/\\[/g, '')\n .replace(/]/g, '');\n }\n\n //#endregion CDF stuff\n}\n","//eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport declare type Constructable = new (...args: any[]) => T;\n\nclass ServiceLocator {\n private cache: Map, unknown | symbol> = new Map();\n\n locate(identifier: Constructable): T {\n const service = this.cache.get(identifier);\n if (service) return service as T;\n const value = new identifier();\n this.cache.set(identifier, value);\n return value;\n }\n}\nexport const setupServiceLocator = () => {\n serviceLocator = new ServiceLocator();\n};\n\nexport let serviceLocator: ServiceLocator;\n","import { Unit } from '../datetime';\nimport Namespace from './namespace';\nimport ViewMode from './view-mode';\n\nconst CalendarModes: {\n name: keyof ViewMode;\n className: string;\n unit: Unit;\n step: number;\n}[] = [\n {\n name: 'calendar',\n className: Namespace.css.daysContainer,\n unit: Unit.month,\n step: 1,\n },\n {\n name: 'months',\n className: Namespace.css.monthsContainer,\n unit: Unit.year,\n step: 1,\n },\n {\n name: 'years',\n className: Namespace.css.yearsContainer,\n unit: Unit.year,\n step: 10,\n },\n {\n name: 'decades',\n className: Namespace.css.decadesContainer,\n unit: Unit.year,\n step: 100,\n },\n];\n\nexport default CalendarModes;\n","import { DateTime } from '../datetime';\nimport CalendarModes from './calendar-modes';\nimport ViewMode from './view-mode';\nimport Options from './options';\n\nexport class OptionsStore {\n options: Options;\n element: HTMLElement;\n input: HTMLInputElement;\n unset: boolean;\n private _currentCalendarViewMode = 0;\n\n get currentCalendarViewMode() {\n return this._currentCalendarViewMode;\n }\n\n set currentCalendarViewMode(value) {\n this._currentCalendarViewMode = value;\n this.currentView = CalendarModes[value].name;\n }\n\n _viewDate = new DateTime();\n\n get viewDate() {\n return this._viewDate;\n }\n\n set viewDate(v) {\n this._viewDate = v;\n if (this.options) this.options.viewDate = v;\n }\n\n /**\n * When switching back to the calendar from the clock,\n * this sets currentView to the correct calendar view.\n */\n refreshCurrentView() {\n this.currentView = CalendarModes[this.currentCalendarViewMode].name;\n }\n\n minimumCalendarViewMode = 0;\n currentView: keyof ViewMode = 'calendar';\n\n get isTwelveHour() {\n return ['h12', 'h11'].includes(this.options.localization.hourCycle);\n }\n}\n","import { DateTime, Unit } from './datetime';\nimport { serviceLocator } from './utilities/service-locator';\nimport { OptionsStore } from './utilities/optionsStore';\n\n/**\n * Main class for date validation rules based on the options provided.\n */\nexport default class Validation {\n private optionsStore: OptionsStore;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n }\n\n /**\n * Checks to see if the target date is valid based on the rules provided in the options.\n * Granularity can be provided to check portions of the date instead of the whole.\n * @param targetDate\n * @param granularity\n */\n isValid(targetDate: DateTime, granularity?: Unit): boolean {\n if (!this._enabledDisabledDatesIsValid(granularity, targetDate))\n return false;\n\n if (\n granularity !== Unit.month &&\n granularity !== Unit.year &&\n this.optionsStore.options.restrictions.daysOfWeekDisabled?.length > 0 &&\n this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(\n targetDate.weekDay\n ) !== -1\n )\n return false;\n\n if (!this._minMaxIsValid(granularity, targetDate)) return false;\n\n if (\n granularity === Unit.hours ||\n granularity === Unit.minutes ||\n granularity === Unit.seconds\n ) {\n if (!this._enabledDisabledHoursIsValid(targetDate)) return false;\n\n if (\n this.optionsStore.options.restrictions.disabledTimeIntervals?.filter(\n (internal) => targetDate.isBetween(internal.from, internal.to)\n ).length !== 0\n )\n return false;\n }\n\n return true;\n }\n\n private _enabledDisabledDatesIsValid(\n granularity: Unit,\n targetDate: DateTime\n ): boolean {\n if (granularity !== Unit.date) return true;\n\n if (\n this.optionsStore.options.restrictions.disabledDates.length > 0 &&\n this._isInDisabledDates(targetDate)\n ) {\n return false;\n }\n\n // noinspection RedundantIfStatementJS\n if (\n this.optionsStore.options.restrictions.enabledDates.length > 0 &&\n !this._isInEnabledDates(targetDate)\n ) {\n return false;\n }\n\n return true;\n }\n\n /**\n * Checks to see if the disabledDates option is in use and returns true (meaning invalid)\n * if the `testDate` is with in the array. Granularity is by date.\n * @param testDate\n * @private\n */\n private _isInDisabledDates(testDate: DateTime) {\n if (\n !this.optionsStore.options.restrictions.disabledDates ||\n this.optionsStore.options.restrictions.disabledDates.length === 0\n )\n return false;\n\n return !!this.optionsStore.options.restrictions.disabledDates.find((x) =>\n x.isSame(testDate, Unit.date)\n );\n }\n\n /**\n * Checks to see if the enabledDates option is in use and returns true (meaning valid)\n * if the `testDate` is with in the array. Granularity is by date.\n * @param testDate\n * @private\n */\n private _isInEnabledDates(testDate: DateTime) {\n if (\n !this.optionsStore.options.restrictions.enabledDates ||\n this.optionsStore.options.restrictions.enabledDates.length === 0\n )\n return true;\n\n return !!this.optionsStore.options.restrictions.enabledDates.find((x) =>\n x.isSame(testDate, Unit.date)\n );\n }\n\n private _minMaxIsValid(granularity: Unit, targetDate: DateTime) {\n if (\n this.optionsStore.options.restrictions.minDate &&\n targetDate.isBefore(\n this.optionsStore.options.restrictions.minDate,\n granularity\n )\n ) {\n return false;\n }\n\n // noinspection RedundantIfStatementJS\n if (\n this.optionsStore.options.restrictions.maxDate &&\n targetDate.isAfter(\n this.optionsStore.options.restrictions.maxDate,\n granularity\n )\n ) {\n return false;\n }\n\n return true;\n }\n\n private _enabledDisabledHoursIsValid(targetDate) {\n if (\n this.optionsStore.options.restrictions.disabledHours.length > 0 &&\n this._isInDisabledHours(targetDate)\n ) {\n return false;\n }\n\n // noinspection RedundantIfStatementJS\n if (\n this.optionsStore.options.restrictions.enabledHours.length > 0 &&\n !this._isInEnabledHours(targetDate)\n ) {\n return false;\n }\n\n return true;\n }\n\n /**\n * Checks to see if the disabledHours option is in use and returns true (meaning invalid)\n * if the `testDate` is with in the array. Granularity is by hours.\n * @param testDate\n * @private\n */\n private _isInDisabledHours(testDate: DateTime) {\n if (\n !this.optionsStore.options.restrictions.disabledHours ||\n this.optionsStore.options.restrictions.disabledHours.length === 0\n )\n return false;\n\n const formattedDate = testDate.hours;\n return this.optionsStore.options.restrictions.disabledHours.includes(\n formattedDate\n );\n }\n\n /**\n * Checks to see if the enabledHours option is in use and returns true (meaning valid)\n * if the `testDate` is with in the array. Granularity is by hours.\n * @param testDate\n * @private\n */\n private _isInEnabledHours(testDate: DateTime) {\n if (\n !this.optionsStore.options.restrictions.enabledHours ||\n this.optionsStore.options.restrictions.enabledHours.length === 0\n )\n return true;\n\n const formattedDate = testDate.hours;\n return this.optionsStore.options.restrictions.enabledHours.includes(\n formattedDate\n );\n }\n\n dateRangeIsValid(dates: DateTime[], index: number, target: DateTime) {\n // if we're not using the option, then return valid\n if (!this.optionsStore.options.dateRange) return true;\n\n // if we've only selected 0..1 dates, and we're not setting the end date\n // then return valid. We only want to validate the range if both are selected,\n // because the other validation on the target has already occurred.\n if (dates.length !== 2 && index !== 1) return true;\n\n // initialize start date\n const start = dates[0].clone;\n // check if start date is not the same as target date\n if (start.isSame(target, Unit.date)) return true;\n\n // add one day to start; start has already been validated\n start.manipulate(1, Unit.date);\n\n // check each date in the range to make sure it's valid\n while (!start.isSame(target, Unit.date)) {\n const valid = this.isValid(start, Unit.date);\n if (!valid) return false;\n start.manipulate(1, Unit.date);\n }\n\n return true;\n }\n}\n","import { DateTime, Unit } from '../datetime';\nimport ActionTypes from './action-types';\nimport { BaseEvent } from './event-types';\n\nexport type ViewUpdateValues = Unit | 'clock' | 'calendar' | 'all';\n\nclass EventEmitter {\n private subscribers: ((value?: T) => void)[] = [];\n\n subscribe(callback: (value: T) => void) {\n this.subscribers.push(callback);\n return this.unsubscribe.bind(this, this.subscribers.length - 1);\n }\n\n unsubscribe(index: number) {\n this.subscribers.splice(index, 1);\n }\n\n emit(value?: T) {\n this.subscribers.forEach((callback) => {\n callback(value);\n });\n }\n\n destroy() {\n this.subscribers = null;\n this.subscribers = [];\n }\n}\n\nexport class EventEmitters {\n triggerEvent = new EventEmitter();\n viewUpdate = new EventEmitter();\n updateDisplay = new EventEmitter();\n action = new EventEmitter<{ e: any; action?: ActionTypes }>(); //eslint-disable-line @typescript-eslint/no-explicit-any\n updateViewDate = new EventEmitter();\n\n destroy() {\n this.triggerEvent.destroy();\n this.viewUpdate.destroy();\n this.updateDisplay.destroy();\n this.action.destroy();\n this.updateViewDate.destroy();\n }\n}\n","import Options, { Localization } from './options';\nimport { DateTime } from '../datetime';\nimport DefaultFormatLocalization from './default-format-localization';\n\nconst defaultEnLocalization: Localization = {\n clear: 'Clear selection',\n close: 'Close the picker',\n dateFormats: DefaultFormatLocalization.dateFormats,\n dayViewHeaderFormat: { month: 'long', year: '2-digit' },\n decrementHour: 'Decrement Hour',\n decrementMinute: 'Decrement Minute',\n decrementSecond: 'Decrement Second',\n format: DefaultFormatLocalization.format,\n hourCycle: DefaultFormatLocalization.hourCycle,\n incrementHour: 'Increment Hour',\n incrementMinute: 'Increment Minute',\n incrementSecond: 'Increment Second',\n locale: DefaultFormatLocalization.locale,\n nextCentury: 'Next Century',\n nextDecade: 'Next Decade',\n nextMonth: 'Next Month',\n nextYear: 'Next Year',\n ordinal: DefaultFormatLocalization.ordinal,\n pickHour: 'Pick Hour',\n pickMinute: 'Pick Minute',\n pickSecond: 'Pick Second',\n previousCentury: 'Previous Century',\n previousDecade: 'Previous Decade',\n previousMonth: 'Previous Month',\n previousYear: 'Previous Year',\n selectDate: 'Select Date',\n selectDecade: 'Select Decade',\n selectMonth: 'Select Month',\n selectTime: 'Select Time',\n selectYear: 'Select Year',\n startOfTheWeek: 0,\n today: 'Go to today',\n toggleMeridiem: 'Toggle Meridiem',\n};\n\nconst DefaultOptions: Options = {\n allowInputToggle: false,\n container: undefined,\n dateRange: false,\n debug: false,\n defaultDate: undefined,\n display: {\n icons: {\n type: 'icons',\n time: 'fa-solid fa-clock',\n date: 'fa-solid fa-calendar',\n up: 'fa-solid fa-arrow-up',\n down: 'fa-solid fa-arrow-down',\n previous: 'fa-solid fa-chevron-left',\n next: 'fa-solid fa-chevron-right',\n today: 'fa-solid fa-calendar-check',\n clear: 'fa-solid fa-trash',\n close: 'fa-solid fa-xmark',\n },\n sideBySide: false,\n calendarWeeks: false,\n viewMode: 'calendar',\n toolbarPlacement: 'bottom',\n keepOpen: false,\n buttons: {\n today: false,\n clear: false,\n close: false,\n },\n components: {\n calendar: true,\n date: true,\n month: true,\n year: true,\n decades: true,\n clock: true,\n hours: true,\n minutes: true,\n seconds: false,\n useTwentyfourHour: undefined,\n },\n inline: false,\n theme: 'auto',\n placement: 'bottom',\n },\n keepInvalid: false,\n localization: defaultEnLocalization,\n meta: {},\n multipleDates: false,\n multipleDatesSeparator: '; ',\n promptTimeOnDateChange: false,\n promptTimeOnDateChangeTransitionDelay: 200,\n restrictions: {\n minDate: undefined,\n maxDate: undefined,\n disabledDates: [],\n enabledDates: [],\n daysOfWeekDisabled: [],\n disabledTimeIntervals: [],\n disabledHours: [],\n enabledHours: [],\n },\n stepping: 1,\n useCurrent: true,\n viewDate: new DateTime(),\n};\n\nexport default DefaultOptions;\nexport const DefaultEnLocalization = { ...defaultEnLocalization };\n","import Namespace from './namespace';\nimport { DateTime } from '../datetime';\nimport { FormatLocalization } from './options';\nimport DefaultFormatLocalization from './default-format-localization';\n\n/**\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\n * @param d If a string will attempt creating a date from it.\n * @param localization object containing locale and format settings. Only used with the custom formats\n * @private\n */\nexport function tryConvertToDateTime(\n this: void,\n d: DateTime | Date | '',\n localization: FormatLocalization\n): DateTime | null {\n if (!d) return null;\n if (d.constructor.name === DateTime.name) return d as DateTime;\n if (d.constructor.name === Date.name) {\n return DateTime.convert(d as Date);\n }\n if (typeof d === typeof '') {\n const dateTime = DateTime.fromString(d as unknown as string, localization);\n if (JSON.stringify(dateTime) === 'null') {\n return null;\n }\n return dateTime;\n }\n return null;\n}\n\n/**\n * Attempts to convert `d` to a DateTime object\n * @param d value to convert\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param localization object containing locale and format settings. Only used with the custom formats\n */\nexport function convertToDateTime(\n this: void,\n d: DateTime | Date | '',\n optionName: string,\n localization: FormatLocalization\n): DateTime {\n if (typeof d === typeof '' && optionName !== 'input') {\n Namespace.errorMessages.dateString();\n }\n\n const converted = tryConvertToDateTime(d, localization);\n\n if (!converted) {\n Namespace.errorMessages.failedToParseDate(\n optionName,\n d,\n optionName === 'input'\n );\n }\n return converted;\n}\n\n/**\n * Type checks that `value` is an array of Date or DateTime\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param value Option value\n * @param providedType Used to provide text to error messages\n * @param localization\n */\nexport function typeCheckDateArray(\n this: void,\n optionName: string,\n value: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n providedType: string,\n localization: FormatLocalization\n) {\n if (!Array.isArray(value)) {\n Namespace.errorMessages.typeMismatch(\n optionName,\n providedType,\n 'array of DateTime or Date'\n );\n }\n for (let i = 0; i < value.length; i++) {\n const d = value[i];\n const dateTime = convertToDateTime(d, optionName, localization);\n if (!dateTime) {\n Namespace.errorMessages.typeMismatch(\n optionName,\n typeof d,\n 'DateTime or Date'\n );\n }\n dateTime.setLocalization(localization ?? DefaultFormatLocalization);\n value[i] = dateTime;\n }\n}\n\n/**\n * Type checks that `value` is an array of numbers\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param value Option value\n * @param providedType Used to provide text to error messages\n */\nexport function typeCheckNumberArray(\n this: void,\n optionName: string,\n value: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n providedType: string\n) {\n if (!Array.isArray(value) || value.some((x) => typeof x !== typeof 0)) {\n Namespace.errorMessages.typeMismatch(\n optionName,\n providedType,\n 'array of numbers'\n );\n }\n}\n","import Namespace from './namespace';\nimport type { FormatLocalization } from './options';\nimport {\n convertToDateTime,\n typeCheckNumberArray,\n typeCheckDateArray,\n} from './typeChecker';\n\ninterface OptionProcessorFunctionArguments {\n key: string;\n value: any; //eslint-disable-line @typescript-eslint/no-explicit-any\n providedType: string;\n defaultType: string;\n path: string;\n localization: FormatLocalization;\n}\n\ntype OptionProcessorFunction = (\n this: void,\n args: OptionProcessorFunctionArguments\n) => any; //eslint-disable-line @typescript-eslint/no-explicit-any\n\nfunction mandatoryDate(key: string): OptionProcessorFunction {\n return ({ value, providedType, localization }) => {\n const dateTime = convertToDateTime(value, key, localization);\n if (dateTime !== undefined) {\n dateTime.setLocalization(localization);\n return dateTime;\n }\n Namespace.errorMessages.typeMismatch(key, providedType, 'DateTime or Date');\n };\n}\n\nfunction optionalDate(key: string): OptionProcessorFunction {\n const mandatory = mandatoryDate(key);\n return (args) => {\n if (args.value === undefined) {\n return args.value;\n }\n return mandatory(args);\n };\n}\n\nfunction numbersInRange(\n key: string,\n lower: number,\n upper: number\n): OptionProcessorFunction {\n return ({ value, providedType }) => {\n if (value === undefined) {\n return [];\n }\n typeCheckNumberArray(key, value, providedType);\n if ((value as number[]).some((x) => x < lower || x > upper))\n Namespace.errorMessages.numbersOutOfRange(key, lower, upper);\n return value;\n };\n}\n\nfunction validHourRange(key: string): OptionProcessorFunction {\n return numbersInRange(key, 0, 23);\n}\n\nfunction validDateArray(key: string): OptionProcessorFunction {\n return ({ value, providedType, localization }) => {\n if (value === undefined) {\n return [];\n }\n typeCheckDateArray(key, value, providedType, localization);\n return value;\n };\n}\n\nfunction validKeyOption(keyOptions: string[]): OptionProcessorFunction {\n return ({ value, path }) => {\n if (!keyOptions.includes(value))\n Namespace.errorMessages.unexpectedOptionValue(\n path.substring(1),\n value,\n keyOptions\n );\n return value;\n };\n}\n\nconst optionProcessors: { [key: string]: OptionProcessorFunction } =\n Object.freeze({\n defaultDate: mandatoryDate('defaultDate'),\n viewDate: mandatoryDate('viewDate'),\n minDate: optionalDate('restrictions.minDate'),\n maxDate: optionalDate('restrictions.maxDate'),\n disabledHours: validHourRange('restrictions.disabledHours'),\n enabledHours: validHourRange('restrictions.enabledHours'),\n disabledDates: validDateArray('restrictions.disabledDates'),\n enabledDates: validDateArray('restrictions.enabledDates'),\n daysOfWeekDisabled: numbersInRange('restrictions.daysOfWeekDisabled', 0, 6),\n disabledTimeIntervals: ({ key, value, providedType, localization }) => {\n if (value === undefined) {\n return [];\n }\n if (!Array.isArray(value)) {\n Namespace.errorMessages.typeMismatch(\n key,\n providedType,\n 'array of { from: DateTime|Date, to: DateTime|Date }'\n );\n }\n const valueObject = value as { from: any; to: any }[]; //eslint-disable-line @typescript-eslint/no-explicit-any\n for (let i = 0; i < valueObject.length; i++) {\n Object.keys(valueObject[i]).forEach((vk) => {\n const subOptionName = `${key}[${i}].${vk}`;\n const d = valueObject[i][vk];\n const dateTime = convertToDateTime(d, subOptionName, localization);\n if (!dateTime) {\n Namespace.errorMessages.typeMismatch(\n subOptionName,\n typeof d,\n 'DateTime or Date'\n );\n }\n dateTime.setLocalization(localization);\n valueObject[i][vk] = dateTime;\n });\n }\n return valueObject;\n },\n toolbarPlacement: validKeyOption(['top', 'bottom', 'default']),\n type: validKeyOption(['icons', 'sprites']),\n viewMode: validKeyOption([\n 'clock',\n 'calendar',\n 'months',\n 'years',\n 'decades',\n ]),\n theme: validKeyOption(['light', 'dark', 'auto']),\n placement: validKeyOption(['top', 'bottom']),\n meta: ({ value }) => value,\n dayViewHeaderFormat: ({ value }) => value,\n container: ({ value, path }) => {\n if (\n value &&\n !(\n value instanceof HTMLElement ||\n value instanceof Element ||\n value?.appendChild\n )\n ) {\n Namespace.errorMessages.typeMismatch(\n path.substring(1),\n typeof value,\n 'HTMLElement'\n );\n }\n return value;\n },\n useTwentyfourHour: ({ value, path, providedType, defaultType }) => {\n Namespace.errorMessages.deprecatedWarning(\n 'useTwentyfourHour',\n 'Please use \"options.localization.hourCycle\" instead'\n );\n if (value === undefined || providedType === 'boolean') return value;\n Namespace.errorMessages.typeMismatch(path, providedType, defaultType);\n },\n hourCycle: validKeyOption(['h11', 'h12', 'h23', 'h24']),\n });\n\nconst defaultProcessor: OptionProcessorFunction = ({\n value,\n defaultType,\n providedType,\n path,\n}) => {\n switch (defaultType) {\n case 'boolean':\n return value === 'true' || value === true;\n case 'number':\n return +value;\n case 'string':\n return value.toString();\n case 'object':\n return {};\n case 'function':\n return value;\n default:\n Namespace.errorMessages.typeMismatch(path, providedType, defaultType);\n }\n};\n\nexport function processKey(this: void, args: OptionProcessorFunctionArguments) {\n return (optionProcessors[args.key] || defaultProcessor)(args);\n}\n","import Namespace from './namespace';\nimport { DateTime } from '../datetime';\nimport DefaultOptions from './default-options';\nimport Options, { FormatLocalization } from './options';\nimport { processKey } from './optionProcessor';\nimport {\n convertToDateTime,\n tryConvertToDateTime,\n typeCheckDateArray,\n typeCheckNumberArray,\n} from './typeChecker';\n\nexport class OptionConverter {\n private static ignoreProperties = [\n 'meta',\n 'dayViewHeaderFormat',\n 'container',\n 'dateForms',\n 'ordinal',\n ];\n\n static deepCopy(input): Options {\n const o = {};\n\n Object.keys(input).forEach((key) => {\n const inputElement = input[key];\n\n if (inputElement instanceof DateTime) {\n o[key] = inputElement.clone;\n return;\n } else if (inputElement instanceof Date) {\n o[key] = new Date(inputElement.valueOf());\n return;\n }\n\n o[key] = inputElement;\n if (\n typeof inputElement !== 'object' ||\n inputElement instanceof HTMLElement ||\n inputElement instanceof Element\n )\n return;\n if (!Array.isArray(inputElement)) {\n o[key] = OptionConverter.deepCopy(inputElement);\n }\n });\n\n return o;\n }\n\n private static isValue = (a) => a != null; // everything except undefined + null\n\n /**\n * Finds value out of an object based on a string, period delimited, path\n * @param paths\n * @param obj\n */\n static objectPath(paths: string, obj) {\n if (paths.charAt(0) === '.') paths = paths.slice(1);\n if (!paths) return obj;\n return paths\n .split('.')\n .reduce(\n (value, key) =>\n OptionConverter.isValue(value) || OptionConverter.isValue(value[key])\n ? value[key]\n : undefined,\n obj\n );\n }\n\n /**\n * The spread operator caused sub keys to be missing after merging.\n * This is to fix that issue by using spread on the child objects first.\n * Also handles complex options like disabledDates\n * @param provided An option from new providedOptions\n * @param copyTo Destination object. This was added to prevent reference copies\n * @param localization\n * @param path\n */\n static spread(provided, copyTo, localization: FormatLocalization, path = '') {\n const defaultOptions = OptionConverter.objectPath(path, DefaultOptions);\n\n const unsupportedOptions = Object.keys(provided).filter(\n (x) => !Object.keys(defaultOptions).includes(x)\n );\n\n if (unsupportedOptions.length > 0) {\n const flattenedOptions = OptionConverter.getFlattenDefaultOptions();\n\n const errors = unsupportedOptions.map((x) => {\n let error = `\"${path}.${x}\" in not a known option.`;\n const didYouMean = flattenedOptions.find((y) => y.includes(x));\n if (didYouMean) error += ` Did you mean \"${didYouMean}\"?`;\n return error;\n });\n Namespace.errorMessages.unexpectedOptions(errors);\n }\n\n Object.keys(provided)\n .filter((key) => key !== '__proto__' && key !== 'constructor')\n .forEach((key) => {\n path += `.${key}`;\n if (path.charAt(0) === '.') path = path.slice(1);\n\n const defaultOptionValue = defaultOptions[key];\n const providedType = typeof provided[key];\n const defaultType = typeof defaultOptionValue;\n const value = provided[key];\n\n if (value === undefined || value === null) {\n copyTo[key] = value;\n path = path.substring(0, path.lastIndexOf(`.${key}`));\n return;\n }\n\n if (\n typeof defaultOptionValue === 'object' &&\n !Array.isArray(provided[key]) &&\n !(\n defaultOptionValue instanceof Date ||\n OptionConverter.ignoreProperties.includes(key)\n )\n ) {\n OptionConverter.spread(\n provided[key],\n copyTo[key],\n localization,\n path\n );\n } else {\n copyTo[key] = OptionConverter.processKey(\n key,\n value,\n providedType,\n defaultType,\n path,\n localization\n );\n }\n\n path = path.substring(0, path.lastIndexOf(`.${key}`));\n });\n }\n\n static processKey(\n key: string,\n value: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n providedType: string,\n defaultType: string,\n path: string,\n localization: FormatLocalization\n ) {\n return processKey({\n key,\n value,\n providedType,\n defaultType,\n path,\n localization,\n });\n }\n\n static _mergeOptions(providedOptions: Options, mergeTo: Options): Options {\n const newConfig = OptionConverter.deepCopy(mergeTo);\n //see if the options specify a locale\n const localization =\n mergeTo.localization?.locale !== 'default'\n ? mergeTo.localization\n : providedOptions?.localization || DefaultOptions.localization;\n\n OptionConverter.spread(providedOptions, newConfig, localization, '');\n\n return newConfig;\n }\n\n static _dataToOptions(element, options: Options): Options {\n const eData = JSON.parse(JSON.stringify(element.dataset));\n\n if (eData?.tdTargetInput) delete eData.tdTargetInput;\n if (eData?.tdTargetToggle) delete eData.tdTargetToggle;\n\n if (\n !eData ||\n Object.keys(eData).length === 0 ||\n eData.constructor !== DOMStringMap\n )\n return options;\n const dataOptions = {} as Options;\n\n // because dataset returns camelCase including the 'td' key the option\n // key won't align\n const objectToNormalized = (object) => {\n const lowered = {};\n Object.keys(object).forEach((x) => {\n lowered[x.toLowerCase()] = x;\n });\n\n return lowered;\n };\n\n const normalizeObject = this.normalizeObject(objectToNormalized);\n const optionsLower = objectToNormalized(options);\n\n Object.keys(eData)\n .filter((x) => x.startsWith(Namespace.dataKey))\n .map((x) => x.substring(2))\n .forEach((key) => {\n let keyOption = optionsLower[key.toLowerCase()];\n\n // dataset merges dashes to camelCase... yay\n // i.e. key = display_components_seconds\n if (key.includes('_')) {\n // [display, components, seconds]\n const split = key.split('_');\n // display\n keyOption = optionsLower[split[0].toLowerCase()];\n if (\n keyOption !== undefined &&\n options[keyOption].constructor === Object\n ) {\n dataOptions[keyOption] = normalizeObject(\n split,\n 1,\n options[keyOption],\n eData[`td${key}`]\n );\n }\n }\n // or key = multipleDate\n else if (keyOption !== undefined) {\n dataOptions[keyOption] = eData[`td${key}`];\n }\n });\n\n return this._mergeOptions(dataOptions, options);\n }\n\n //todo clean this up\n private static normalizeObject(objectToNormalized: (object) => object) {\n const normalizeObject = (\n split: string[],\n index: number,\n optionSubgroup: unknown,\n value: unknown\n ) => {\n // first round = display { ... }\n const normalizedOptions = objectToNormalized(optionSubgroup);\n\n const keyOption = normalizedOptions[split[index].toLowerCase()];\n const internalObject = {};\n\n if (keyOption === undefined) return internalObject;\n\n // if this is another object, continue down the rabbit hole\n if (optionSubgroup[keyOption].constructor === Object) {\n index++;\n internalObject[keyOption] = normalizeObject(\n split,\n index,\n optionSubgroup[keyOption],\n value\n );\n } else {\n internalObject[keyOption] = value;\n }\n return internalObject;\n };\n return normalizeObject;\n }\n\n /**\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\n * @param d If a string will attempt creating a date from it.\n * @param localization object containing locale and format settings. Only used with the custom formats\n * @private\n */\n static _dateTypeCheck(\n d: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n localization: FormatLocalization\n ): DateTime | null {\n return tryConvertToDateTime(d, localization);\n }\n\n /**\n * Type checks that `value` is an array of Date or DateTime\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param value Option value\n * @param providedType Used to provide text to error messages\n * @param localization\n */\n static _typeCheckDateArray(\n optionName: string,\n value,\n providedType: string,\n localization: FormatLocalization\n ) {\n return typeCheckDateArray(optionName, value, providedType, localization);\n }\n\n /**\n * Type checks that `value` is an array of numbers\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param value Option value\n * @param providedType Used to provide text to error messages\n */\n static _typeCheckNumberArray(\n optionName: string,\n value,\n providedType: string\n ) {\n return typeCheckNumberArray(optionName, value, providedType);\n }\n\n /**\n * Attempts to convert `d` to a DateTime object\n * @param d value to convert\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param localization object containing locale and format settings. Only used with the custom formats\n */\n static dateConversion(\n d: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n optionName: string,\n localization: FormatLocalization\n ): DateTime {\n return convertToDateTime(d, optionName, localization);\n }\n\n private static _flattenDefaults: string[];\n\n private static getFlattenDefaultOptions(): string[] {\n if (this._flattenDefaults) return this._flattenDefaults;\n const deepKeys = (t, pre = []) => {\n if (Array.isArray(t)) return [];\n if (Object(t) === t) {\n return Object.entries(t).flatMap(([k, v]) => deepKeys(v, [...pre, k]));\n } else {\n return pre.join('.');\n }\n };\n\n this._flattenDefaults = deepKeys(DefaultOptions);\n\n return this._flattenDefaults;\n }\n\n /**\n * Some options conflict like min/max date. Verify that these kinds of options\n * are set correctly.\n * @param config\n */\n static _validateConflicts(config: Options) {\n if (\n config.display.sideBySide &&\n (!config.display.components.clock ||\n !(\n config.display.components.hours ||\n config.display.components.minutes ||\n config.display.components.seconds\n ))\n ) {\n Namespace.errorMessages.conflictingConfiguration(\n 'Cannot use side by side mode without the clock components'\n );\n }\n\n if (config.restrictions.minDate && config.restrictions.maxDate) {\n if (config.restrictions.minDate.isAfter(config.restrictions.maxDate)) {\n Namespace.errorMessages.conflictingConfiguration(\n 'minDate is after maxDate'\n );\n }\n\n if (config.restrictions.maxDate.isBefore(config.restrictions.minDate)) {\n Namespace.errorMessages.conflictingConfiguration(\n 'maxDate is before minDate'\n );\n }\n }\n\n if (config.multipleDates && config.dateRange) {\n Namespace.errorMessages.conflictingConfiguration(\n 'Cannot uss option \"multipleDates\" with \"dateRange\"'\n );\n }\n }\n}\n","import { DateTime, getFormatByUnit, Unit } from './datetime';\nimport Namespace from './utilities/namespace';\nimport { ChangeEvent, FailEvent } from './utilities/event-types';\nimport Validation from './validation';\nimport { serviceLocator } from './utilities/service-locator';\nimport { EventEmitters } from './utilities/event-emitter';\nimport { OptionsStore } from './utilities/optionsStore';\nimport { OptionConverter } from './utilities/optionConverter';\n\nexport default class Dates {\n private _dates: DateTime[] = [];\n private optionsStore: OptionsStore;\n private validation: Validation;\n private _eventEmitters: EventEmitters;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.validation = serviceLocator.locate(Validation);\n this._eventEmitters = serviceLocator.locate(EventEmitters);\n }\n\n /**\n * Returns the array of selected dates\n */\n get picked(): DateTime[] {\n return [...this._dates];\n }\n\n /**\n * Returns the last picked value.\n */\n get lastPicked(): DateTime {\n return this._dates[this.lastPickedIndex]?.clone;\n }\n\n /**\n * Returns the length of picked dates -1 or 0 if none are selected.\n */\n get lastPickedIndex(): number {\n if (this._dates.length === 0) return 0;\n return this._dates.length - 1;\n }\n\n /**\n * Formats a DateTime object to a string. Used when setting the input value.\n * @param date\n */\n formatInput(date: DateTime): string {\n if (!date) return '';\n date.localization = this.optionsStore.options.localization;\n return date.format();\n }\n\n /**\n * parse the value into a DateTime object.\n * this can be overwritten to supply your own parsing.\n */\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n parseInput(value: any): DateTime {\n return OptionConverter.dateConversion(\n value,\n 'input',\n this.optionsStore.options.localization\n );\n }\n\n /**\n * Tries to convert the provided value to a DateTime object.\n * If value is null|undefined then clear the value of the provided index (or 0).\n * @param value Value to convert or null|undefined\n * @param index When using multidates this is the index in the array\n */\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n setFromInput(value: any, index?: number) {\n if (!value) {\n this.setValue(undefined, index);\n return;\n }\n const converted = this.parseInput(value);\n if (converted) {\n converted.setLocalization(this.optionsStore.options.localization);\n this.setValue(converted, index);\n }\n }\n\n /**\n * Adds a new DateTime to selected dates array\n * @param date\n */\n add(date: DateTime): void {\n this._dates.push(date);\n }\n\n /**\n * Returns true if the `targetDate` is part of the selected dates array.\n * If `unit` is provided then a granularity to that unit will be used.\n * @param targetDate\n * @param unit\n */\n isPicked(targetDate: DateTime, unit?: Unit): boolean {\n if (!DateTime.isValid(targetDate)) return false;\n if (!unit)\n return this._dates.find((x) => x.isSame(targetDate)) !== undefined;\n\n const format = getFormatByUnit(unit);\n\n const innerDateFormatted = targetDate.format(format);\n\n return (\n this._dates\n .map((x) => x.format(format))\n .find((x) => x === innerDateFormatted) !== undefined\n );\n }\n\n /**\n * Returns the index at which `targetDate` is in the array.\n * This is used for updating or removing a date when multi-date is used\n * If `unit` is provided then a granularity to that unit will be used.\n * @param targetDate\n * @param unit\n */\n pickedIndex(targetDate: DateTime, unit?: Unit): number {\n if (!DateTime.isValid(targetDate)) return -1;\n if (!unit)\n return this._dates.map((x) => x.valueOf()).indexOf(targetDate.valueOf());\n\n const format = getFormatByUnit(unit);\n\n const innerDateFormatted = targetDate.format(format);\n\n return this._dates.map((x) => x.format(format)).indexOf(innerDateFormatted);\n }\n\n /**\n * Clears all selected dates.\n */\n clear() {\n this.optionsStore.unset = true;\n this._eventEmitters.triggerEvent.emit({\n type: Namespace.events.change,\n date: undefined,\n oldDate: this.lastPicked,\n isClear: true,\n isValid: true,\n } as ChangeEvent);\n this._dates = [];\n if (this.optionsStore.input) this.optionsStore.input.value = '';\n this._eventEmitters.updateDisplay.emit('all');\n }\n\n /**\n * Find the \"book end\" years given a `year` and a `factor`\n * @param factor e.g. 100 for decades\n * @param year e.g. 2021\n */\n static getStartEndYear(\n factor: number,\n year: number\n ): [number, number, number] {\n const step = factor / 10,\n startYear = Math.floor(year / factor) * factor,\n endYear = startYear + step * 9,\n focusValue = Math.floor(year / step) * step;\n return [startYear, endYear, focusValue];\n }\n\n updateInput(target?: DateTime) {\n if (!this.optionsStore.input) return;\n\n let newValue = this.formatInput(target);\n if (\n this.optionsStore.options.multipleDates ||\n this.optionsStore.options.dateRange\n ) {\n newValue = this._dates\n .map((d) => this.formatInput(d))\n .join(this.optionsStore.options.multipleDatesSeparator);\n }\n if (this.optionsStore.input.value != newValue)\n this.optionsStore.input.value = newValue;\n }\n\n /**\n * Attempts to either clear or set the `target` date at `index`.\n * If the `target` is null then the date will be cleared.\n * If multi-date is being used then it will be removed from the array.\n * If `target` is valid and multi-date is used then if `index` is\n * provided the date at that index will be replaced, otherwise it is appended.\n * @param target\n * @param index\n */\n setValue(target?: DateTime, index?: number): void {\n const noIndex = typeof index === 'undefined',\n isClear = !target && noIndex;\n let oldDate = this.optionsStore.unset ? null : this._dates[index]?.clone;\n if (!oldDate && !this.optionsStore.unset && noIndex && isClear) {\n oldDate = this.lastPicked;\n }\n\n if (target && oldDate?.isSame(target)) {\n this.updateInput(target);\n return;\n }\n\n // case of calling setValue(null)\n if (!target) {\n this._setValueNull(isClear, index, oldDate);\n return;\n }\n\n index = index || 0;\n target = target.clone;\n\n // minute stepping is being used, force the minute to the closest value\n if (this.optionsStore.options.stepping !== 1) {\n target.minutes =\n Math.round(target.minutes / this.optionsStore.options.stepping) *\n this.optionsStore.options.stepping;\n target.startOf(Unit.minutes);\n }\n\n const onUpdate = (isValid: boolean) => {\n this._dates[index] = target;\n this._eventEmitters.updateViewDate.emit(target.clone);\n\n this.updateInput(target);\n\n this.optionsStore.unset = false;\n this._eventEmitters.updateDisplay.emit('all');\n this._eventEmitters.triggerEvent.emit({\n type: Namespace.events.change,\n date: target,\n oldDate,\n isClear,\n isValid: isValid,\n } as ChangeEvent);\n };\n\n if (\n this.validation.isValid(target) &&\n this.validation.dateRangeIsValid(this.picked, index, target)\n ) {\n onUpdate(true);\n return;\n }\n\n if (this.optionsStore.options.keepInvalid) {\n onUpdate(false);\n }\n\n this._eventEmitters.triggerEvent.emit({\n type: Namespace.events.error,\n reason: Namespace.errorMessages.failedToSetInvalidDate,\n date: target,\n oldDate,\n } as FailEvent);\n }\n\n private _setValueNull(isClear: boolean, index: number, oldDate: DateTime) {\n if (\n !this.optionsStore.options.multipleDates ||\n this._dates.length === 1 ||\n isClear\n ) {\n this.optionsStore.unset = true;\n this._dates = [];\n } else {\n this._dates.splice(index, 1);\n }\n\n this.updateInput();\n\n this._eventEmitters.triggerEvent.emit({\n type: Namespace.events.change,\n date: undefined,\n oldDate,\n isClear,\n isValid: true,\n } as ChangeEvent);\n\n this._eventEmitters.updateDisplay.emit('all');\n }\n}\n","enum ActionTypes {\n next = 'next',\n previous = 'previous',\n changeCalendarView = 'changeCalendarView',\n selectMonth = 'selectMonth',\n selectYear = 'selectYear',\n selectDecade = 'selectDecade',\n selectDay = 'selectDay',\n selectHour = 'selectHour',\n selectMinute = 'selectMinute',\n selectSecond = 'selectSecond',\n incrementHours = 'incrementHours',\n incrementMinutes = 'incrementMinutes',\n incrementSeconds = 'incrementSeconds',\n decrementHours = 'decrementHours',\n decrementMinutes = 'decrementMinutes',\n decrementSeconds = 'decrementSeconds',\n toggleMeridiem = 'toggleMeridiem',\n togglePicker = 'togglePicker',\n showClock = 'showClock',\n showHours = 'showHours',\n showMinutes = 'showMinutes',\n showSeconds = 'showSeconds',\n clear = 'clear',\n close = 'close',\n today = 'today',\n}\n\nexport default ActionTypes;\n","import { DateTime, Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport Dates from '../../dates';\nimport { Paint } from '../index';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `date`\n */\nexport default class DateDisplay {\n private optionsStore: OptionsStore;\n private dates: Dates;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n }\n\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.daysContainer);\n\n container.append(...this._daysOfTheWeek());\n\n if (this.optionsStore.options.display.calendarWeeks) {\n const div = document.createElement('div');\n div.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight);\n container.appendChild(div);\n }\n\n const { rangeHoverEvent, rangeHoverOutEvent } =\n this.handleMouseEvents(container);\n\n for (let i = 0; i < 42; i++) {\n if (i !== 0 && i % 7 === 0) {\n if (this.optionsStore.options.display.calendarWeeks) {\n const div = document.createElement('div');\n div.classList.add(\n Namespace.css.calendarWeeks,\n Namespace.css.noHighlight\n );\n container.appendChild(div);\n }\n }\n\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectDay);\n container.appendChild(div);\n\n // if hover is supported then add the events\n if (\n matchMedia('(hover: hover)').matches &&\n this.optionsStore.options.dateRange\n ) {\n div.addEventListener('mouseover', rangeHoverEvent);\n div.addEventListener('mouseout', rangeHoverOutEvent);\n }\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint): void {\n const container = widget.getElementsByClassName(\n Namespace.css.daysContainer\n )[0] as HTMLElement;\n\n this._updateCalendarView(container);\n\n const innerDate = this.optionsStore.viewDate.clone\n .startOf(Unit.month)\n .startOf('weekDay', this.optionsStore.options.localization.startOfTheWeek)\n .manipulate(12, Unit.hours);\n\n this._handleCalendarWeeks(container, innerDate.clone);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectDay}\"]`)\n .forEach((element: HTMLElement) => {\n const classes: string[] = [];\n classes.push(Namespace.css.day);\n\n if (innerDate.isBefore(this.optionsStore.viewDate, Unit.month)) {\n classes.push(Namespace.css.old);\n }\n if (innerDate.isAfter(this.optionsStore.viewDate, Unit.month)) {\n classes.push(Namespace.css.new);\n }\n\n if (\n !this.optionsStore.unset &&\n !this.optionsStore.options.dateRange &&\n this.dates.isPicked(innerDate, Unit.date)\n ) {\n classes.push(Namespace.css.active);\n }\n if (!this.validation.isValid(innerDate, Unit.date)) {\n classes.push(Namespace.css.disabled);\n }\n if (innerDate.isSame(new DateTime(), Unit.date)) {\n classes.push(Namespace.css.today);\n }\n if (innerDate.weekDay === 0 || innerDate.weekDay === 6) {\n classes.push(Namespace.css.weekend);\n }\n\n this._handleDateRange(innerDate, classes);\n\n paint(Unit.date, innerDate, classes, element);\n\n element.classList.remove(...element.classList);\n element.classList.add(...classes);\n element.setAttribute('data-value', this._dateToDataValue(innerDate));\n element.setAttribute('data-day', `${innerDate.date}`);\n element.innerText = innerDate.parts(undefined, {\n day: 'numeric',\n }).day;\n innerDate.manipulate(1, Unit.date);\n });\n }\n\n private _dateToDataValue(date: DateTime): string {\n if (!DateTime.isValid(date)) return '';\n\n return `${date.year}-${date.monthFormatted}-${date.dateFormatted}`;\n }\n\n private _handleDateRange(innerDate: DateTime, classes: string[]) {\n const rangeStart = this.dates.picked[0];\n const rangeEnd = this.dates.picked[1];\n\n if (this.optionsStore.options.dateRange) {\n if (innerDate.isBetween(rangeStart, rangeEnd, Unit.date)) {\n classes.push(Namespace.css.rangeIn);\n }\n\n if (innerDate.isSame(rangeStart, Unit.date)) {\n classes.push(Namespace.css.rangeStart);\n }\n\n if (innerDate.isSame(rangeEnd, Unit.date)) {\n classes.push(Namespace.css.rangeEnd);\n }\n }\n }\n\n private handleMouseEvents(container: HTMLElement) {\n const rangeHoverEvent = (e: MouseEvent) => {\n const currentTarget = e?.currentTarget as HTMLElement;\n\n // if we have 0 or 2 selected or if the target is disabled then ignore\n if (\n this.dates.picked.length !== 1 ||\n currentTarget.classList.contains(Namespace.css.disabled)\n )\n return;\n\n // select all the date divs\n const allDays = [...container.querySelectorAll('.day')] as HTMLElement[];\n\n // get the date value from the element being hovered over\n const attributeValue = currentTarget.getAttribute('data-value');\n\n // format the string to a date\n const innerDate = DateTime.fromString(attributeValue, {\n format: 'yyyy-MM-dd',\n });\n\n // find the position of the target in the date container\n const dayIndex = allDays.findIndex(\n (e) => e.getAttribute('data-value') === attributeValue\n );\n\n // find the first and second selected dates\n const rangeStart = this.dates.picked[0];\n const rangeEnd = this.dates.picked[1];\n\n //format the start date so that it can be found by the attribute\n const rangeStartFormatted = this._dateToDataValue(rangeStart);\n const rangeStartIndex = allDays.findIndex(\n (e) => e.getAttribute('data-value') === rangeStartFormatted\n );\n const rangeStartElement = allDays[rangeStartIndex];\n\n //make sure we don't leave start/end classes if we don't need them\n if (!innerDate.isSame(rangeStart, Unit.date)) {\n currentTarget.classList.remove(Namespace.css.rangeStart);\n }\n\n if (!innerDate.isSame(rangeEnd, Unit.date)) {\n currentTarget.classList.remove(Namespace.css.rangeEnd);\n }\n\n // the following figures out which direct from start date is selected\n // the selection \"cap\" classes are applied if needed\n // otherwise all the dates between will get the `rangeIn` class.\n // We make this selection based on the element's index and the rangeStart index\n\n let lambda: (_, index) => boolean;\n\n if (innerDate.isBefore(rangeStart)) {\n currentTarget.classList.add(Namespace.css.rangeStart);\n rangeStartElement?.classList.remove(Namespace.css.rangeStart);\n rangeStartElement?.classList.add(Namespace.css.rangeEnd);\n lambda = (_, index) => index > dayIndex && index < rangeStartIndex;\n } else {\n currentTarget.classList.add(Namespace.css.rangeEnd);\n rangeStartElement?.classList.remove(Namespace.css.rangeEnd);\n rangeStartElement?.classList.add(Namespace.css.rangeStart);\n lambda = (_, index) => index < dayIndex && index > rangeStartIndex;\n }\n\n allDays.filter(lambda).forEach((e) => {\n e.classList.add(Namespace.css.rangeIn);\n });\n };\n\n const rangeHoverOutEvent = (e: MouseEvent) => {\n // find all the dates in the container\n const allDays = [...container.querySelectorAll('.day')] as HTMLElement[];\n\n // if only the start is selected, remove all the rangeIn classes\n // we do this because once the user hovers over a new date the range will be recalculated.\n if (this.dates.picked.length === 1)\n allDays.forEach((e) => e.classList.remove(Namespace.css.rangeIn));\n\n // if we have 0 or 2 dates selected then ignore\n if (this.dates.picked.length !== 1) return;\n\n const currentTarget = e?.currentTarget as HTMLElement;\n\n // get the elements date from the attribute value\n const innerDate = new DateTime(currentTarget.getAttribute('data-value'));\n\n // verify selections and remove invalid classes\n if (!innerDate.isSame(this.dates.picked[0], Unit.date)) {\n currentTarget.classList.remove(Namespace.css.rangeStart);\n }\n\n if (!innerDate.isSame(this.dates.picked[1], Unit.date)) {\n currentTarget.classList.remove(Namespace.css.rangeEnd);\n }\n };\n\n return { rangeHoverEvent, rangeHoverOutEvent };\n }\n\n private _updateCalendarView(container: Element) {\n if (this.optionsStore.currentView !== 'calendar') return;\n const [previous, switcher, next] = container.parentElement\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\n .getElementsByTagName('div');\n switcher.setAttribute(\n Namespace.css.daysContainer,\n this.optionsStore.viewDate.format(\n this.optionsStore.options.localization.dayViewHeaderFormat\n )\n );\n this.optionsStore.options.display.components.month\n ? switcher.classList.remove(Namespace.css.disabled)\n : switcher.classList.add(Namespace.css.disabled);\n this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.month),\n Unit.month\n )\n ? previous.classList.remove(Namespace.css.disabled)\n : previous.classList.add(Namespace.css.disabled);\n this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(1, Unit.month),\n Unit.month\n )\n ? next.classList.remove(Namespace.css.disabled)\n : next.classList.add(Namespace.css.disabled);\n }\n\n /***\n * Generates a html row that contains the days of the week.\n * @private\n */\n private _daysOfTheWeek(): HTMLElement[] {\n const innerDate = this.optionsStore.viewDate.clone\n .startOf('weekDay', this.optionsStore.options.localization.startOfTheWeek)\n .startOf(Unit.date);\n const row = [];\n document.createElement('div');\n\n if (this.optionsStore.options.display.calendarWeeks) {\n const htmlDivElement = document.createElement('div');\n htmlDivElement.classList.add(\n Namespace.css.calendarWeeks,\n Namespace.css.noHighlight\n );\n htmlDivElement.innerText = '#';\n row.push(htmlDivElement);\n }\n\n for (let i = 0; i < 7; i++) {\n const htmlDivElement = document.createElement('div');\n htmlDivElement.classList.add(\n Namespace.css.dayOfTheWeek,\n Namespace.css.noHighlight\n );\n htmlDivElement.innerText = innerDate.format({ weekday: 'short' });\n innerDate.manipulate(1, Unit.date);\n row.push(htmlDivElement);\n }\n\n return row;\n }\n\n private _handleCalendarWeeks(container: HTMLElement, innerDate: DateTime) {\n [...container.querySelectorAll(`.${Namespace.css.calendarWeeks}`)]\n .filter((e: HTMLElement) => e.innerText !== '#')\n .forEach((element: HTMLElement) => {\n element.innerText = `${innerDate.week}`;\n innerDate.manipulate(7, Unit.date);\n });\n }\n}\n","import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport Dates from '../../dates';\nimport { Paint } from '../index';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `month`\n */\nexport default class MonthDisplay {\n private optionsStore: OptionsStore;\n private dates: Dates;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n }\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.monthsContainer);\n\n for (let i = 0; i < 12; i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectMonth);\n container.appendChild(div);\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint): void {\n const container = widget.getElementsByClassName(\n Namespace.css.monthsContainer\n )[0];\n\n if (this.optionsStore.currentView === 'months') {\n const [previous, switcher, next] = container.parentElement\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\n .getElementsByTagName('div');\n\n switcher.setAttribute(\n Namespace.css.monthsContainer,\n this.optionsStore.viewDate.format({ year: 'numeric' })\n );\n\n this.optionsStore.options.display.components.year\n ? switcher.classList.remove(Namespace.css.disabled)\n : switcher.classList.add(Namespace.css.disabled);\n\n this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.year),\n Unit.year\n )\n ? previous.classList.remove(Namespace.css.disabled)\n : previous.classList.add(Namespace.css.disabled);\n\n this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(1, Unit.year),\n Unit.year\n )\n ? next.classList.remove(Namespace.css.disabled)\n : next.classList.add(Namespace.css.disabled);\n }\n\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.year);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMonth}\"]`)\n .forEach((containerClone: HTMLElement, index) => {\n const classes = [];\n classes.push(Namespace.css.month);\n\n if (\n !this.optionsStore.unset &&\n this.dates.isPicked(innerDate, Unit.month)\n ) {\n classes.push(Namespace.css.active);\n }\n if (!this.validation.isValid(innerDate, Unit.month)) {\n classes.push(Namespace.css.disabled);\n }\n\n paint(Unit.month, innerDate, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${index}`);\n containerClone.innerText = `${innerDate.format({ month: 'short' })}`;\n innerDate.manipulate(1, Unit.month);\n });\n }\n}\n","import { DateTime, Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Dates from '../../dates';\nimport Validation from '../../validation';\nimport { Paint } from '../index';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `year`\n */\nexport default class YearDisplay {\n private _startYear: DateTime;\n private _endYear: DateTime;\n private optionsStore: OptionsStore;\n private dates: Dates;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n }\n\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.yearsContainer);\n\n for (let i = 0; i < 12; i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectYear);\n container.appendChild(div);\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint) {\n this._startYear = this.optionsStore.viewDate.clone.manipulate(\n -1,\n Unit.year\n );\n this._endYear = this.optionsStore.viewDate.clone.manipulate(10, Unit.year);\n\n const container = widget.getElementsByClassName(\n Namespace.css.yearsContainer\n )[0];\n\n if (this.optionsStore.currentView === 'years') {\n const [previous, switcher, next] = container.parentElement\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\n .getElementsByTagName('div');\n\n switcher.setAttribute(\n Namespace.css.yearsContainer,\n `${this._startYear.format({ year: 'numeric' })}-${this._endYear.format({\n year: 'numeric',\n })}`\n );\n\n this.optionsStore.options.display.components.decades\n ? switcher.classList.remove(Namespace.css.disabled)\n : switcher.classList.add(Namespace.css.disabled);\n\n this.validation.isValid(this._startYear, Unit.year)\n ? previous.classList.remove(Namespace.css.disabled)\n : previous.classList.add(Namespace.css.disabled);\n this.validation.isValid(this._endYear, Unit.year)\n ? next.classList.remove(Namespace.css.disabled)\n : next.classList.add(Namespace.css.disabled);\n }\n\n const innerDate = this.optionsStore.viewDate.clone\n .startOf(Unit.year)\n .manipulate(-1, Unit.year);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectYear}\"]`)\n .forEach((containerClone: HTMLElement) => {\n const classes = [];\n classes.push(Namespace.css.year);\n\n if (\n !this.optionsStore.unset &&\n this.dates.isPicked(innerDate, Unit.year)\n ) {\n classes.push(Namespace.css.active);\n }\n if (!this.validation.isValid(innerDate, Unit.year)) {\n classes.push(Namespace.css.disabled);\n }\n\n paint(Unit.year, innerDate, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${innerDate.year}`);\n containerClone.innerText = innerDate.format({ year: 'numeric' });\n\n innerDate.manipulate(1, Unit.year);\n });\n }\n}\n","import Dates from '../../dates';\nimport { DateTime, Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport { Paint } from '../index';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `seconds`\n */\nexport default class DecadeDisplay {\n private _startDecade: DateTime;\n private _endDecade: DateTime;\n private optionsStore: OptionsStore;\n private dates: Dates;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n }\n\n /**\n * Build the container html for the display\n * @private\n */\n getPicker() {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.decadesContainer);\n\n for (let i = 0; i < 12; i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectDecade);\n container.appendChild(div);\n }\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint) {\n const [start, end] = Dates.getStartEndYear(\n 100,\n this.optionsStore.viewDate.year\n );\n this._startDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\n this._startDecade.year = start;\n this._endDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\n this._endDecade.year = end;\n\n const container = widget.getElementsByClassName(\n Namespace.css.decadesContainer\n )[0];\n\n const [previous, switcher, next] = container.parentElement\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\n .getElementsByTagName('div');\n\n if (this.optionsStore.currentView === 'decades') {\n switcher.setAttribute(\n Namespace.css.decadesContainer,\n `${this._startDecade.format({\n year: 'numeric',\n })}-${this._endDecade.format({ year: 'numeric' })}`\n );\n\n this.validation.isValid(this._startDecade, Unit.year)\n ? previous.classList.remove(Namespace.css.disabled)\n : previous.classList.add(Namespace.css.disabled);\n this.validation.isValid(this._endDecade, Unit.year)\n ? next.classList.remove(Namespace.css.disabled)\n : next.classList.add(Namespace.css.disabled);\n }\n\n const pickedYears = this.dates.picked.map((x) => x.year);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectDecade}\"]`)\n .forEach((containerClone: HTMLElement, index) => {\n if (index === 0) {\n containerClone.classList.add(Namespace.css.old);\n if (this._startDecade.year - 10 < 0) {\n containerClone.textContent = ' ';\n previous.classList.add(Namespace.css.disabled);\n containerClone.classList.add(Namespace.css.disabled);\n containerClone.setAttribute('data-value', '');\n return;\n } else {\n containerClone.innerText = this._startDecade.clone\n .manipulate(-10, Unit.year)\n .format({ year: 'numeric' });\n containerClone.setAttribute(\n 'data-value',\n `${this._startDecade.year}`\n );\n return;\n }\n }\n\n const classes = [];\n classes.push(Namespace.css.decade);\n const startDecadeYear = this._startDecade.year;\n const endDecadeYear = this._startDecade.year + 9;\n\n if (\n !this.optionsStore.unset &&\n pickedYears.filter((x) => x >= startDecadeYear && x <= endDecadeYear)\n .length > 0\n ) {\n classes.push(Namespace.css.active);\n }\n\n paint('decade', this._startDecade, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${this._startDecade.year}`);\n containerClone.innerText = `${this._startDecade.format({\n year: 'numeric',\n })}`;\n\n this._startDecade.manipulate(10, Unit.year);\n });\n }\n}\n","import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport Dates from '../../dates';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates the clock display\n */\nexport default class TimeDisplay {\n private _gridColumns = '';\n private optionsStore: OptionsStore;\n private validation: Validation;\n private dates: Dates;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n }\n\n /**\n * Build the container html for the clock display\n * @private\n */\n getPicker(iconTag: (iconClass: string) => HTMLElement): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.clockContainer);\n\n container.append(...this._grid(iconTag));\n\n return container;\n }\n\n /**\n * Populates the various elements with in the clock display\n * like the current hour and if the manipulation icons are enabled.\n * @private\n */\n _update(widget: HTMLElement): void {\n const timesDiv = (\n widget.getElementsByClassName(Namespace.css.clockContainer)[0]\n );\n let lastPicked = this.dates.lastPicked?.clone;\n if (!lastPicked && this.optionsStore.options.useCurrent)\n lastPicked = this.optionsStore.viewDate.clone;\n\n timesDiv\n .querySelectorAll('.disabled')\n .forEach((element) => element.classList.remove(Namespace.css.disabled));\n\n if (this.optionsStore.options.display.components.hours) {\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(1, Unit.hours),\n Unit.hours\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.incrementHours}]`)\n .classList.add(Namespace.css.disabled);\n }\n\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.hours),\n Unit.hours\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.decrementHours}]`)\n .classList.add(Namespace.css.disabled);\n }\n\n timesDiv.querySelector(\n `[data-time-component=${Unit.hours}]`\n ).innerText = lastPicked\n ? lastPicked.getHoursFormatted(\n this.optionsStore.options.localization.hourCycle\n )\n : '--';\n }\n\n if (this.optionsStore.options.display.components.minutes) {\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(1, Unit.minutes),\n Unit.minutes\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.incrementMinutes}]`)\n .classList.add(Namespace.css.disabled);\n }\n\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.minutes),\n Unit.minutes\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.decrementMinutes}]`)\n .classList.add(Namespace.css.disabled);\n }\n timesDiv.querySelector(\n `[data-time-component=${Unit.minutes}]`\n ).innerText = lastPicked ? lastPicked.minutesFormatted : '--';\n }\n\n if (this.optionsStore.options.display.components.seconds) {\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(1, Unit.seconds),\n Unit.seconds\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.incrementSeconds}]`)\n .classList.add(Namespace.css.disabled);\n }\n\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.seconds),\n Unit.seconds\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.decrementSeconds}]`)\n .classList.add(Namespace.css.disabled);\n }\n timesDiv.querySelector(\n `[data-time-component=${Unit.seconds}]`\n ).innerText = lastPicked ? lastPicked.secondsFormatted : '--';\n }\n\n if (this.optionsStore.isTwelveHour) {\n const toggle = timesDiv.querySelector(\n `[data-action=${ActionTypes.toggleMeridiem}]`\n );\n\n const meridiemDate = (lastPicked || this.optionsStore.viewDate).clone;\n\n toggle.innerText = meridiemDate.meridiem();\n\n if (\n !this.validation.isValid(\n meridiemDate.manipulate(\n meridiemDate.hours >= 12 ? -12 : 12,\n Unit.hours\n )\n )\n ) {\n toggle.classList.add(Namespace.css.disabled);\n } else {\n toggle.classList.remove(Namespace.css.disabled);\n }\n }\n\n timesDiv.style.gridTemplateAreas = `\"${this._gridColumns}\"`;\n }\n\n /**\n * Creates the table for the clock display depending on what options are selected.\n * @private\n */\n private _grid(iconTag: (iconClass: string) => HTMLElement): HTMLElement[] {\n this._gridColumns = '';\n const top = [],\n middle = [],\n bottom = [],\n separator = document.createElement('div'),\n upIcon = iconTag(this.optionsStore.options.display.icons.up),\n downIcon = iconTag(this.optionsStore.options.display.icons.down);\n\n separator.classList.add(Namespace.css.separator, Namespace.css.noHighlight);\n const separatorColon = separator.cloneNode(true);\n separatorColon.innerHTML = ':';\n\n const getSeparator = (colon = false): HTMLElement => {\n return colon\n ? separatorColon.cloneNode(true)\n : separator.cloneNode(true);\n };\n\n if (this.optionsStore.options.display.components.hours) {\n let divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.incrementHour\n );\n divElement.setAttribute('data-action', ActionTypes.incrementHours);\n divElement.appendChild(upIcon.cloneNode(true));\n top.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.pickHour\n );\n divElement.setAttribute('data-action', ActionTypes.showHours);\n divElement.setAttribute('data-time-component', Unit.hours);\n middle.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.decrementHour\n );\n divElement.setAttribute('data-action', ActionTypes.decrementHours);\n divElement.appendChild(downIcon.cloneNode(true));\n bottom.push(divElement);\n this._gridColumns += 'a';\n }\n\n if (this.optionsStore.options.display.components.minutes) {\n this._gridColumns += ' a';\n if (this.optionsStore.options.display.components.hours) {\n top.push(getSeparator());\n middle.push(getSeparator(true));\n bottom.push(getSeparator());\n this._gridColumns += ' a';\n }\n let divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.incrementMinute\n );\n divElement.setAttribute('data-action', ActionTypes.incrementMinutes);\n divElement.appendChild(upIcon.cloneNode(true));\n top.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.pickMinute\n );\n divElement.setAttribute('data-action', ActionTypes.showMinutes);\n divElement.setAttribute('data-time-component', Unit.minutes);\n middle.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.decrementMinute\n );\n divElement.setAttribute('data-action', ActionTypes.decrementMinutes);\n divElement.appendChild(downIcon.cloneNode(true));\n bottom.push(divElement);\n }\n\n if (this.optionsStore.options.display.components.seconds) {\n this._gridColumns += ' a';\n if (this.optionsStore.options.display.components.minutes) {\n top.push(getSeparator());\n middle.push(getSeparator(true));\n bottom.push(getSeparator());\n this._gridColumns += ' a';\n }\n let divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.incrementSecond\n );\n divElement.setAttribute('data-action', ActionTypes.incrementSeconds);\n divElement.appendChild(upIcon.cloneNode(true));\n top.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.pickSecond\n );\n divElement.setAttribute('data-action', ActionTypes.showSeconds);\n divElement.setAttribute('data-time-component', Unit.seconds);\n middle.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.decrementSecond\n );\n divElement.setAttribute('data-action', ActionTypes.decrementSeconds);\n divElement.appendChild(downIcon.cloneNode(true));\n bottom.push(divElement);\n }\n\n if (this.optionsStore.isTwelveHour) {\n this._gridColumns += ' a';\n let divElement = getSeparator();\n top.push(divElement);\n\n const button = document.createElement('button');\n button.setAttribute(\n 'title',\n this.optionsStore.options.localization.toggleMeridiem\n );\n button.setAttribute('data-action', ActionTypes.toggleMeridiem);\n button.setAttribute('tabindex', '-1');\n if (Namespace.css.toggleMeridiem.includes(',')) {\n //todo move this to paint function?\n button.classList.add(...Namespace.css.toggleMeridiem.split(','));\n } else button.classList.add(Namespace.css.toggleMeridiem);\n\n divElement = document.createElement('div');\n divElement.classList.add(Namespace.css.noHighlight);\n divElement.appendChild(button);\n middle.push(divElement);\n\n divElement = getSeparator();\n bottom.push(divElement);\n }\n\n this._gridColumns = this._gridColumns.trim();\n\n return [...top, ...middle, ...bottom];\n }\n}\n","import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport { Paint } from '../index';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `hours`\n */\nexport default class HourDisplay {\n private optionsStore: OptionsStore;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.validation = serviceLocator.locate(Validation);\n }\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.hourContainer);\n\n for (let i = 0; i < (this.optionsStore.isTwelveHour ? 12 : 24); i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectHour);\n container.appendChild(div);\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint): void {\n const container = widget.getElementsByClassName(\n Namespace.css.hourContainer\n )[0];\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.date);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectHour}\"]`)\n .forEach((containerClone: HTMLElement) => {\n const classes = [];\n classes.push(Namespace.css.hour);\n\n if (!this.validation.isValid(innerDate, Unit.hours)) {\n classes.push(Namespace.css.disabled);\n }\n\n paint(Unit.hours, innerDate, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${innerDate.hours}`);\n containerClone.innerText = innerDate.getHoursFormatted(\n this.optionsStore.options.localization.hourCycle\n );\n innerDate.manipulate(1, Unit.hours);\n });\n }\n}\n","import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport { Paint } from '../index';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `minutes`\n */\nexport default class MinuteDisplay {\n private optionsStore: OptionsStore;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.validation = serviceLocator.locate(Validation);\n }\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.minuteContainer);\n\n const step =\n this.optionsStore.options.stepping === 1\n ? 5\n : this.optionsStore.options.stepping;\n for (let i = 0; i < 60 / step; i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectMinute);\n container.appendChild(div);\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint): void {\n const container = widget.getElementsByClassName(\n Namespace.css.minuteContainer\n )[0];\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.hours);\n const step =\n this.optionsStore.options.stepping === 1\n ? 5\n : this.optionsStore.options.stepping;\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMinute}\"]`)\n .forEach((containerClone: HTMLElement) => {\n const classes = [];\n classes.push(Namespace.css.minute);\n\n if (!this.validation.isValid(innerDate, Unit.minutes)) {\n classes.push(Namespace.css.disabled);\n }\n\n paint(Unit.minutes, innerDate, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${innerDate.minutes}`);\n containerClone.innerText = innerDate.minutesFormatted;\n innerDate.manipulate(step, Unit.minutes);\n });\n }\n}\n","import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport { Paint } from '../index';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `seconds`\n */\nexport default class secondDisplay {\n private optionsStore: OptionsStore;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.validation = serviceLocator.locate(Validation);\n }\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.secondContainer);\n\n for (let i = 0; i < 12; i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectSecond);\n container.appendChild(div);\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint): void {\n const container = widget.getElementsByClassName(\n Namespace.css.secondContainer\n )[0];\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.minutes);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectSecond}\"]`)\n .forEach((containerClone: HTMLElement) => {\n const classes = [];\n classes.push(Namespace.css.second);\n\n if (!this.validation.isValid(innerDate, Unit.seconds)) {\n classes.push(Namespace.css.disabled);\n }\n\n paint(Unit.seconds, innerDate, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${innerDate.seconds}`);\n containerClone.innerText = innerDate.secondsFormatted;\n innerDate.manipulate(5, Unit.seconds);\n });\n }\n}\n","import Namespace from '../utilities/namespace';\n\n/**\n * Provides a collapse functionality to the view changes\n */\nexport default class Collapse {\n /**\n * Flips the show/hide state of `target`\n * @param target html element to affect.\n */\n static toggle(target: HTMLElement) {\n if (target.classList.contains(Namespace.css.show)) {\n this.hide(target);\n } else {\n this.show(target);\n }\n }\n\n /**\n * Skips any animation or timeouts and immediately set the element to show.\n * @param target\n */\n static showImmediately(target: HTMLElement) {\n target.classList.remove(Namespace.css.collapsing);\n target.classList.add(Namespace.css.collapse, Namespace.css.show);\n target.style.height = '';\n }\n\n /**\n * If `target` is not already showing, then show after the animation.\n * @param target\n */\n static show(target: HTMLElement) {\n if (\n target.classList.contains(Namespace.css.collapsing) ||\n target.classList.contains(Namespace.css.show)\n )\n return;\n\n let timeOut = null;\n const complete = () => {\n Collapse.showImmediately(target);\n timeOut = null;\n };\n\n target.style.height = '0';\n target.classList.remove(Namespace.css.collapse);\n target.classList.add(Namespace.css.collapsing);\n\n //eslint-disable-next-line @typescript-eslint/no-unused-vars\n timeOut = setTimeout(\n complete,\n this.getTransitionDurationFromElement(target)\n );\n target.style.height = `${target.scrollHeight}px`;\n }\n\n /**\n * Skips any animation or timeouts and immediately set the element to hide.\n * @param target\n */\n static hideImmediately(target: HTMLElement) {\n if (!target) return;\n target.classList.remove(Namespace.css.collapsing, Namespace.css.show);\n target.classList.add(Namespace.css.collapse);\n }\n\n /**\n * If `target` is not already hidden, then hide after the animation.\n * @param target HTML Element\n */\n static hide(target: HTMLElement) {\n if (\n target.classList.contains(Namespace.css.collapsing) ||\n !target.classList.contains(Namespace.css.show)\n )\n return;\n\n let timeOut = null;\n const complete = () => {\n Collapse.hideImmediately(target);\n timeOut = null;\n };\n\n target.style.height = `${target.getBoundingClientRect()['height']}px`;\n\n const reflow = (element) => element.offsetHeight;\n\n reflow(target);\n\n target.classList.remove(Namespace.css.collapse, Namespace.css.show);\n target.classList.add(Namespace.css.collapsing);\n target.style.height = '';\n\n //eslint-disable-next-line @typescript-eslint/no-unused-vars\n timeOut = setTimeout(\n complete,\n this.getTransitionDurationFromElement(target)\n );\n }\n\n /**\n * Gets the transition duration from the `element` by getting css properties\n * `transition-duration` and `transition-delay`\n * @param element HTML Element\n */\n private static getTransitionDurationFromElement = (element: HTMLElement) => {\n if (!element) {\n return 0;\n }\n\n // Get transition-duration of the element\n let { transitionDuration, transitionDelay } =\n window.getComputedStyle(element);\n\n const floatTransitionDuration = Number.parseFloat(transitionDuration);\n const floatTransitionDelay = Number.parseFloat(transitionDelay);\n\n // Return 0 if element or transition duration is not found\n if (!floatTransitionDuration && !floatTransitionDelay) {\n return 0;\n }\n\n // If multiple durations are defined, take the first\n transitionDuration = transitionDuration.split(',')[0];\n transitionDelay = transitionDelay.split(',')[0];\n\n return (\n (Number.parseFloat(transitionDuration) +\n Number.parseFloat(transitionDelay)) *\n 1000\n );\n };\n}\n","import DateDisplay from './calendar/date-display';\nimport MonthDisplay from './calendar/month-display';\nimport YearDisplay from './calendar/year-display';\nimport DecadeDisplay from './calendar/decade-display';\nimport TimeDisplay from './time/time-display';\nimport HourDisplay from './time/hour-display';\nimport MinuteDisplay from './time/minute-display';\nimport SecondDisplay from './time/second-display';\nimport { DateTime, Unit } from '../datetime';\nimport Namespace from '../utilities/namespace';\nimport { HideEvent } from '../utilities/event-types';\nimport Collapse from './collapse';\nimport Validation from '../validation';\nimport Dates from '../dates';\nimport { EventEmitters, ViewUpdateValues } from '../utilities/event-emitter';\nimport { serviceLocator } from '../utilities/service-locator';\nimport ActionTypes from '../utilities/action-types';\nimport CalendarModes from '../utilities/calendar-modes';\nimport { OptionsStore } from '../utilities/optionsStore';\n\n/**\n * Main class for all things display related.\n */\nexport default class Display {\n private _widget: HTMLElement;\n private _popperInstance: any; // eslint-disable-line @typescript-eslint/no-explicit-any\n private _isVisible = false;\n private optionsStore: OptionsStore;\n private validation: Validation;\n private dates: Dates;\n\n dateDisplay: DateDisplay;\n monthDisplay: MonthDisplay;\n yearDisplay: YearDisplay;\n decadeDisplay: DecadeDisplay;\n timeDisplay: TimeDisplay;\n hourDisplay: HourDisplay;\n minuteDisplay: MinuteDisplay;\n secondDisplay: SecondDisplay;\n private _eventEmitters: EventEmitters;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.validation = serviceLocator.locate(Validation);\n this.dates = serviceLocator.locate(Dates);\n\n this.dateDisplay = serviceLocator.locate(DateDisplay);\n this.monthDisplay = serviceLocator.locate(MonthDisplay);\n this.yearDisplay = serviceLocator.locate(YearDisplay);\n this.decadeDisplay = serviceLocator.locate(DecadeDisplay);\n this.timeDisplay = serviceLocator.locate(TimeDisplay);\n this.hourDisplay = serviceLocator.locate(HourDisplay);\n this.minuteDisplay = serviceLocator.locate(MinuteDisplay);\n this.secondDisplay = serviceLocator.locate(SecondDisplay);\n this._eventEmitters = serviceLocator.locate(EventEmitters);\n this._widget = undefined;\n\n this._eventEmitters.updateDisplay.subscribe((result: ViewUpdateValues) => {\n this._update(result);\n });\n }\n\n /**\n * Returns the widget body or undefined\n * @private\n */\n get widget(): HTMLElement | undefined {\n return this._widget;\n }\n\n get dateContainer(): HTMLElement | undefined {\n return this.widget?.querySelector(`div.${Namespace.css.dateContainer}`);\n }\n\n get timeContainer(): HTMLElement | undefined {\n return this.widget?.querySelector(`div.${Namespace.css.timeContainer}`);\n }\n\n /**\n * Returns this visible state of the picker (shown)\n */\n get isVisible() {\n return this._isVisible;\n }\n\n /**\n * Updates the table for a particular unit. Used when an option as changed or\n * whenever the class list might need to be refreshed.\n * @param unit\n * @private\n */\n _update(unit: ViewUpdateValues): void {\n if (!this.widget) return;\n //todo do I want some kind of error catching or other guards here?\n switch (unit) {\n case Unit.seconds:\n this.secondDisplay._update(this.widget, this.paint);\n break;\n case Unit.minutes:\n this.minuteDisplay._update(this.widget, this.paint);\n break;\n case Unit.hours:\n this.hourDisplay._update(this.widget, this.paint);\n break;\n case Unit.date:\n this.dateDisplay._update(this.widget, this.paint);\n break;\n case Unit.month:\n this.monthDisplay._update(this.widget, this.paint);\n break;\n case Unit.year:\n this.yearDisplay._update(this.widget, this.paint);\n break;\n case 'clock':\n if (!this._hasTime) break;\n this.timeDisplay._update(this.widget);\n this._update(Unit.hours);\n this._update(Unit.minutes);\n this._update(Unit.seconds);\n break;\n case 'calendar':\n this._update(Unit.date);\n this._update(Unit.year);\n this._update(Unit.month);\n this.decadeDisplay._update(this.widget, this.paint);\n this._updateCalendarHeader();\n break;\n case 'all':\n if (this._hasTime) {\n this._update('clock');\n }\n if (this._hasDate) {\n this._update('calendar');\n }\n }\n }\n\n // noinspection JSUnusedLocalSymbols\n /**\n * Allows developers to add/remove classes from an element.\n * @param _unit\n * @param _date\n * @param _classes\n * @param _element\n */\n\n /* eslint-disable @typescript-eslint/no-unused-vars */\n paint(\n _unit: Unit | 'decade',\n _date: DateTime,\n _classes: string[],\n _element: HTMLElement\n ) {\n // implemented in plugin\n }\n\n /**\n * Shows the picker and creates a Popper instance if needed.\n * Add document click event to hide when clicking outside the picker.\n * fires Events#show\n */\n show(): void {\n if (this.widget == undefined) {\n this._showSetDefaultIfNeeded();\n\n this._buildWidget();\n this._updateTheme();\n\n this._showSetupViewMode();\n\n if (!this.optionsStore.options.display.inline) {\n // If needed to change the parent container\n const container = this.optionsStore.options?.container || document.body;\n const placement =\n this.optionsStore.options?.display?.placement || 'bottom';\n\n container.appendChild(this.widget);\n this.createPopup(this.optionsStore.element, this.widget, {\n modifiers: [{ name: 'eventListeners', enabled: true }],\n //#2400\n placement:\n document.documentElement.dir === 'rtl'\n ? `${placement}-end`\n : `${placement}-start`,\n }).then();\n } else {\n this.optionsStore.element.appendChild(this.widget);\n }\n\n if (this.optionsStore.options.display.viewMode == 'clock') {\n this._eventEmitters.action.emit({\n e: null,\n action: ActionTypes.showClock,\n });\n }\n\n this.widget\n .querySelectorAll('[data-action]')\n .forEach((element) =>\n element.addEventListener('click', this._actionsClickEvent)\n );\n\n // show the clock when using sideBySide\n if (this._hasTime && this.optionsStore.options.display.sideBySide) {\n this.timeDisplay._update(this.widget);\n (\n this.widget.getElementsByClassName(\n Namespace.css.clockContainer\n )[0] as HTMLElement\n ).style.display = 'grid';\n }\n }\n\n this.widget.classList.add(Namespace.css.show);\n if (!this.optionsStore.options.display.inline) {\n this.updatePopup();\n document.addEventListener('click', this._documentClickEvent);\n }\n this._eventEmitters.triggerEvent.emit({ type: Namespace.events.show });\n this._isVisible = true;\n }\n\n private _showSetupViewMode() {\n // If modeView is only clock\n const onlyClock = this._hasTime && !this._hasDate;\n\n // reset the view to the clock if there's no date components\n if (onlyClock) {\n this.optionsStore.currentView = 'clock';\n this._eventEmitters.action.emit({\n e: null,\n action: ActionTypes.showClock,\n });\n }\n // otherwise return to the calendar view\n else if (!this.optionsStore.currentCalendarViewMode) {\n this.optionsStore.currentCalendarViewMode =\n this.optionsStore.minimumCalendarViewMode;\n }\n\n if (!onlyClock && this.optionsStore.options.display.viewMode !== 'clock') {\n if (this._hasTime) {\n if (!this.optionsStore.options.display.sideBySide) {\n Collapse.hideImmediately(this.timeContainer);\n } else {\n Collapse.show(this.timeContainer);\n }\n }\n Collapse.show(this.dateContainer);\n }\n\n if (this._hasDate) {\n this._showMode();\n }\n }\n\n private _showSetDefaultIfNeeded() {\n if (this.dates.picked.length != 0) return;\n\n if (\n this.optionsStore.options.useCurrent &&\n !this.optionsStore.options.defaultDate\n ) {\n const date = new DateTime().setLocalization(\n this.optionsStore.options.localization\n );\n if (!this.optionsStore.options.keepInvalid) {\n let tries = 0;\n let direction = 1;\n if (this.optionsStore.options.restrictions.maxDate?.isBefore(date)) {\n direction = -1;\n }\n while (!this.validation.isValid(date) && tries > 31) {\n date.manipulate(direction, Unit.date);\n tries++;\n }\n }\n this.dates.setValue(date);\n }\n\n if (this.optionsStore.options.defaultDate) {\n this.dates.setValue(this.optionsStore.options.defaultDate);\n }\n }\n\n async createPopup(\n element: HTMLElement,\n widget: HTMLElement,\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n options: any\n ): Promise {\n let createPopperFunction;\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((window as any)?.Popper) {\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n createPopperFunction = (window as any)?.Popper?.createPopper;\n } else {\n const { createPopper } = await import('@popperjs/core');\n createPopperFunction = createPopper;\n }\n if (createPopperFunction) {\n this._popperInstance = createPopperFunction(element, widget, options);\n }\n }\n\n updatePopup(): void {\n this._popperInstance?.update();\n }\n\n /**\n * Changes the calendar view mode. E.g. month <-> year\n * @param direction -/+ number to move currentViewMode\n * @private\n */\n _showMode(direction?: number): void {\n if (!this.widget) {\n return;\n }\n if (direction) {\n const max = Math.max(\n this.optionsStore.minimumCalendarViewMode,\n Math.min(3, this.optionsStore.currentCalendarViewMode + direction)\n );\n if (this.optionsStore.currentCalendarViewMode == max) return;\n this.optionsStore.currentCalendarViewMode = max;\n }\n\n this.widget\n .querySelectorAll(\n `.${Namespace.css.dateContainer} > div:not(.${Namespace.css.calendarHeader}), .${Namespace.css.timeContainer} > div:not(.${Namespace.css.clockContainer})`\n )\n .forEach((e: HTMLElement) => (e.style.display = 'none'));\n\n const datePickerMode =\n CalendarModes[this.optionsStore.currentCalendarViewMode];\n const picker: HTMLElement = this.widget.querySelector(\n `.${datePickerMode.className}`\n );\n\n switch (datePickerMode.className) {\n case Namespace.css.decadesContainer:\n this.decadeDisplay._update(this.widget, this.paint);\n break;\n case Namespace.css.yearsContainer:\n this.yearDisplay._update(this.widget, this.paint);\n break;\n case Namespace.css.monthsContainer:\n this.monthDisplay._update(this.widget, this.paint);\n break;\n case Namespace.css.daysContainer:\n this.dateDisplay._update(this.widget, this.paint);\n break;\n }\n\n picker.style.display = 'grid';\n\n if (this.optionsStore.options.display.sideBySide)\n ((\n this.widget.querySelectorAll(`.${Namespace.css.clockContainer}`)[0]\n )).style.display = 'grid';\n\n this._updateCalendarHeader();\n this._eventEmitters.viewUpdate.emit();\n }\n\n /**\n * Changes the theme. E.g. light, dark or auto\n * @param theme the theme name\n * @private\n */\n _updateTheme(theme?: 'light' | 'dark' | 'auto'): void {\n if (!this.widget) {\n return;\n }\n if (theme) {\n if (this.optionsStore.options.display.theme === theme) return;\n this.optionsStore.options.display.theme = theme;\n }\n\n this.widget.classList.remove('light', 'dark');\n this.widget.classList.add(this._getThemeClass());\n\n if (this.optionsStore.options.display.theme === 'auto') {\n window\n .matchMedia(Namespace.css.isDarkPreferredQuery)\n .addEventListener('change', () => this._updateTheme());\n } else {\n window\n .matchMedia(Namespace.css.isDarkPreferredQuery)\n .removeEventListener('change', () => this._updateTheme());\n }\n }\n\n _getThemeClass(): string {\n const currentTheme = this.optionsStore.options.display.theme || 'auto';\n\n const isDarkMode =\n window.matchMedia &&\n window.matchMedia(Namespace.css.isDarkPreferredQuery).matches;\n\n switch (currentTheme) {\n case 'light':\n return Namespace.css.lightTheme;\n case 'dark':\n return Namespace.css.darkTheme;\n case 'auto':\n return isDarkMode ? Namespace.css.darkTheme : Namespace.css.lightTheme;\n }\n }\n\n _updateCalendarHeader() {\n if (!this._hasDate) return;\n const showing = [\n ...this.widget.querySelector(\n `.${Namespace.css.dateContainer} div[style*=\"display: grid\"]`\n ).classList,\n ].find((x) => x.startsWith(Namespace.css.dateContainer));\n\n const [previous, switcher, next] = this.widget\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\n .getElementsByTagName('div');\n\n switch (showing) {\n case Namespace.css.decadesContainer:\n previous.setAttribute(\n 'title',\n this.optionsStore.options.localization.previousCentury\n );\n switcher.setAttribute('title', '');\n next.setAttribute(\n 'title',\n this.optionsStore.options.localization.nextCentury\n );\n break;\n case Namespace.css.yearsContainer:\n previous.setAttribute(\n 'title',\n this.optionsStore.options.localization.previousDecade\n );\n switcher.setAttribute(\n 'title',\n this.optionsStore.options.localization.selectDecade\n );\n next.setAttribute(\n 'title',\n this.optionsStore.options.localization.nextDecade\n );\n break;\n case Namespace.css.monthsContainer:\n previous.setAttribute(\n 'title',\n this.optionsStore.options.localization.previousYear\n );\n switcher.setAttribute(\n 'title',\n this.optionsStore.options.localization.selectYear\n );\n next.setAttribute(\n 'title',\n this.optionsStore.options.localization.nextYear\n );\n break;\n case Namespace.css.daysContainer:\n previous.setAttribute(\n 'title',\n this.optionsStore.options.localization.previousMonth\n );\n switcher.setAttribute(\n 'title',\n this.optionsStore.options.localization.selectMonth\n );\n next.setAttribute(\n 'title',\n this.optionsStore.options.localization.nextMonth\n );\n switcher.setAttribute(\n showing,\n this.optionsStore.viewDate.format(\n this.optionsStore.options.localization.dayViewHeaderFormat\n )\n );\n break;\n }\n switcher.innerText = switcher.getAttribute(showing);\n }\n\n /**\n * Hides the picker if needed.\n * Remove document click event to hide when clicking outside the picker.\n * fires Events#hide\n */\n hide(): void {\n if (!this.widget || !this._isVisible) return;\n\n this.widget.classList.remove(Namespace.css.show);\n\n if (this._isVisible) {\n this._eventEmitters.triggerEvent.emit({\n type: Namespace.events.hide,\n date: this.optionsStore.unset ? null : this.dates.lastPicked?.clone,\n } as HideEvent);\n this._isVisible = false;\n }\n\n document.removeEventListener('click', this._documentClickEvent);\n }\n\n /**\n * Toggles the picker's open state. Fires a show/hide event depending.\n */\n toggle() {\n return this._isVisible ? this.hide() : this.show();\n }\n\n /**\n * Removes document and data-action click listener and reset the widget\n * @private\n */\n _dispose() {\n document.removeEventListener('click', this._documentClickEvent);\n if (!this.widget) return;\n this.widget\n .querySelectorAll('[data-action]')\n .forEach((element) =>\n element.removeEventListener('click', this._actionsClickEvent)\n );\n this.widget.parentNode.removeChild(this.widget);\n this._widget = undefined;\n }\n\n /**\n * Builds the widgets html template.\n * @private\n */\n private _buildWidget(): HTMLElement {\n const template = document.createElement('div');\n template.classList.add(Namespace.css.widget);\n\n const dateView = document.createElement('div');\n dateView.classList.add(Namespace.css.dateContainer);\n dateView.append(\n this.getHeadTemplate(),\n this.decadeDisplay.getPicker(),\n this.yearDisplay.getPicker(),\n this.monthDisplay.getPicker(),\n this.dateDisplay.getPicker()\n );\n\n const timeView = document.createElement('div');\n timeView.classList.add(Namespace.css.timeContainer);\n timeView.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this)));\n timeView.appendChild(this.hourDisplay.getPicker());\n timeView.appendChild(this.minuteDisplay.getPicker());\n timeView.appendChild(this.secondDisplay.getPicker());\n\n const toolbar = document.createElement('div');\n toolbar.classList.add(Namespace.css.toolbar);\n toolbar.append(...this.getToolbarElements());\n\n if (this.optionsStore.options.display.inline) {\n template.classList.add(Namespace.css.inline);\n }\n\n if (this.optionsStore.options.display.calendarWeeks) {\n template.classList.add('calendarWeeks');\n }\n\n if (this.optionsStore.options.display.sideBySide && this._hasDateAndTime) {\n this._buildWidgetSideBySide(template, dateView, timeView, toolbar);\n return;\n }\n\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\n template.appendChild(toolbar);\n }\n\n const setupComponentView = (hasFirst, hasSecond, element, shouldShow) => {\n if (!hasFirst) return;\n if (hasSecond) {\n element.classList.add(Namespace.css.collapse);\n if (shouldShow) element.classList.add(Namespace.css.show);\n }\n template.appendChild(element);\n };\n\n setupComponentView(\n this._hasDate,\n this._hasTime,\n dateView,\n this.optionsStore.options.display.viewMode !== 'clock'\n );\n\n setupComponentView(\n this._hasTime,\n this._hasDate,\n timeView,\n this.optionsStore.options.display.viewMode === 'clock'\n );\n\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\n template.appendChild(toolbar);\n }\n\n const arrow = document.createElement('div');\n arrow.classList.add('arrow');\n arrow.setAttribute('data-popper-arrow', '');\n template.appendChild(arrow);\n\n this._widget = template;\n }\n\n private _buildWidgetSideBySide(\n template: HTMLDivElement,\n dateView: HTMLDivElement,\n timeView: HTMLDivElement,\n toolbar: HTMLDivElement\n ) {\n template.classList.add(Namespace.css.sideBySide);\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\n template.appendChild(toolbar);\n }\n const row = document.createElement('div');\n row.classList.add('td-row');\n dateView.classList.add('td-half');\n timeView.classList.add('td-half');\n\n row.appendChild(dateView);\n row.appendChild(timeView);\n template.appendChild(row);\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\n template.appendChild(toolbar);\n }\n this._widget = template;\n }\n\n /**\n * Returns true if the hours, minutes, or seconds component is turned on\n */\n get _hasTime(): boolean {\n return (\n this.optionsStore.options.display.components.clock &&\n (this.optionsStore.options.display.components.hours ||\n this.optionsStore.options.display.components.minutes ||\n this.optionsStore.options.display.components.seconds)\n );\n }\n\n /**\n * Returns true if the year, month, or date component is turned on\n */\n get _hasDate(): boolean {\n return (\n this.optionsStore.options.display.components.calendar &&\n (this.optionsStore.options.display.components.year ||\n this.optionsStore.options.display.components.month ||\n this.optionsStore.options.display.components.date)\n );\n }\n\n get _hasDateAndTime(): boolean {\n return this._hasDate && this._hasTime;\n }\n\n /**\n * Get the toolbar html based on options like buttons => today\n * @private\n */\n getToolbarElements(): HTMLElement[] {\n const toolbar = [];\n\n if (this.optionsStore.options.display.buttons.today) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.today);\n div.setAttribute('title', this.optionsStore.options.localization.today);\n\n div.appendChild(\n this._iconTag(this.optionsStore.options.display.icons.today)\n );\n toolbar.push(div);\n }\n if (\n !this.optionsStore.options.display.sideBySide &&\n this._hasDate &&\n this._hasTime\n ) {\n let title, icon;\n if (this.optionsStore.options.display.viewMode === 'clock') {\n title = this.optionsStore.options.localization.selectDate;\n icon = this.optionsStore.options.display.icons.date;\n } else {\n title = this.optionsStore.options.localization.selectTime;\n icon = this.optionsStore.options.display.icons.time;\n }\n\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.togglePicker);\n div.setAttribute('title', title);\n\n div.appendChild(this._iconTag(icon));\n toolbar.push(div);\n }\n if (this.optionsStore.options.display.buttons.clear) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.clear);\n div.setAttribute('title', this.optionsStore.options.localization.clear);\n\n div.appendChild(\n this._iconTag(this.optionsStore.options.display.icons.clear)\n );\n toolbar.push(div);\n }\n if (this.optionsStore.options.display.buttons.close) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.close);\n div.setAttribute('title', this.optionsStore.options.localization.close);\n\n div.appendChild(\n this._iconTag(this.optionsStore.options.display.icons.close)\n );\n toolbar.push(div);\n }\n\n return toolbar;\n }\n\n /***\n * Builds the base header template with next and previous icons\n * @private\n */\n getHeadTemplate(): HTMLElement {\n const calendarHeader = document.createElement('div');\n calendarHeader.classList.add(Namespace.css.calendarHeader);\n\n const previous = document.createElement('div');\n previous.classList.add(Namespace.css.previous);\n previous.setAttribute('data-action', ActionTypes.previous);\n previous.appendChild(\n this._iconTag(this.optionsStore.options.display.icons.previous)\n );\n\n const switcher = document.createElement('div');\n switcher.classList.add(Namespace.css.switch);\n switcher.setAttribute('data-action', ActionTypes.changeCalendarView);\n\n const next = document.createElement('div');\n next.classList.add(Namespace.css.next);\n next.setAttribute('data-action', ActionTypes.next);\n next.appendChild(\n this._iconTag(this.optionsStore.options.display.icons.next)\n );\n\n calendarHeader.append(previous, switcher, next);\n return calendarHeader;\n }\n\n /**\n * Builds an icon tag as either an ``\n * or with icons => type is `sprites` then a svg tag instead\n * @param iconClass\n * @private\n */\n _iconTag(iconClass: string): HTMLElement | SVGElement {\n if (this.optionsStore.options.display.icons.type === 'sprites') {\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n\n const icon = document.createElementNS(\n 'http://www.w3.org/2000/svg',\n 'use'\n );\n icon.setAttribute('xlink:href', iconClass); // Deprecated. Included for backward compatibility\n icon.setAttribute('href', iconClass);\n svg.appendChild(icon);\n\n return svg;\n }\n const icon = document.createElement('i');\n icon.classList.add(...iconClass.split(' '));\n return icon;\n }\n\n /**\n * A document click event to hide the widget if click is outside\n * @private\n * @param e MouseEvent\n */\n private _documentClickEvent = (e: MouseEvent) => {\n if (this.optionsStore.options.debug || (window as any).debug) return; //eslint-disable-line @typescript-eslint/no-explicit-any\n\n if (\n this._isVisible &&\n !e.composedPath().includes(this.widget) && // click inside the widget\n !e.composedPath()?.includes(this.optionsStore.element) // click on the element\n ) {\n this.hide();\n }\n };\n\n /**\n * Click event for any action like selecting a date\n * @param e MouseEvent\n * @private\n */\n private _actionsClickEvent = (e: MouseEvent) => {\n this._eventEmitters.action.emit({ e: e });\n };\n\n /**\n * Causes the widget to get rebuilt on next show. If the picker is already open\n * then hide and reshow it.\n * @private\n */\n _rebuild() {\n const wasVisible = this._isVisible;\n this._dispose();\n if (wasVisible) this.show();\n }\n}\n\nexport type Paint = (\n unit: Unit | 'decade',\n innerDate: DateTime,\n classes: string[],\n element: HTMLElement\n) => void;\n","import { DateTime, Unit } from './datetime';\nimport Collapse from './display/collapse';\nimport Namespace from './utilities/namespace';\nimport Dates from './dates';\nimport Validation from './validation';\nimport Display from './display';\nimport { EventEmitters } from './utilities/event-emitter';\nimport { serviceLocator } from './utilities/service-locator.js';\nimport ActionTypes from './utilities/action-types';\nimport CalendarModes from './utilities/calendar-modes';\nimport { OptionsStore } from './utilities/optionsStore';\n\n/**\n * Logic for various click actions\n */\nexport default class Actions {\n private optionsStore: OptionsStore;\n private validation: Validation;\n private dates: Dates;\n private display: Display;\n private _eventEmitters: EventEmitters;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n this.display = serviceLocator.locate(Display);\n this._eventEmitters = serviceLocator.locate(EventEmitters);\n\n this._eventEmitters.action.subscribe((result) => {\n this.do(result.e, result.action);\n });\n }\n\n /**\n * Performs the selected `action`. See ActionTypes\n * @param e This is normally a click event\n * @param action If not provided, then look for a [data-action]\n */\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n do(e: any, action?: ActionTypes) {\n const currentTarget = e?.currentTarget as HTMLElement;\n if (currentTarget?.classList?.contains(Namespace.css.disabled)) return;\n action = action || (currentTarget?.dataset?.action as ActionTypes);\n const lastPicked = (this.dates.lastPicked || this.optionsStore.viewDate)\n .clone;\n\n switch (action) {\n case ActionTypes.next:\n case ActionTypes.previous:\n this.handleNextPrevious(action);\n break;\n case ActionTypes.changeCalendarView:\n this.display._showMode(1);\n this.display._updateCalendarHeader();\n break;\n case ActionTypes.selectMonth:\n case ActionTypes.selectYear:\n case ActionTypes.selectDecade:\n this.handleSelectCalendarMode(action, currentTarget);\n break;\n case ActionTypes.selectDay:\n this.handleSelectDay(currentTarget);\n break;\n case ActionTypes.selectHour: {\n let hour = +currentTarget.dataset.value;\n if (lastPicked.hours >= 12 && this.optionsStore.isTwelveHour)\n hour += 12;\n lastPicked.hours = hour;\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\n this.hideOrClock(e);\n break;\n }\n case ActionTypes.selectMinute: {\n lastPicked.minutes = +currentTarget.dataset.value;\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\n this.hideOrClock(e);\n break;\n }\n case ActionTypes.selectSecond: {\n lastPicked.seconds = +currentTarget.dataset.value;\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\n this.hideOrClock(e);\n break;\n }\n case ActionTypes.incrementHours:\n this.manipulateAndSet(lastPicked, Unit.hours);\n break;\n case ActionTypes.incrementMinutes:\n this.manipulateAndSet(\n lastPicked,\n Unit.minutes,\n this.optionsStore.options.stepping\n );\n break;\n case ActionTypes.incrementSeconds:\n this.manipulateAndSet(lastPicked, Unit.seconds);\n break;\n case ActionTypes.decrementHours:\n this.manipulateAndSet(lastPicked, Unit.hours, -1);\n break;\n case ActionTypes.decrementMinutes:\n this.manipulateAndSet(\n lastPicked,\n Unit.minutes,\n this.optionsStore.options.stepping * -1\n );\n break;\n case ActionTypes.decrementSeconds:\n this.manipulateAndSet(lastPicked, Unit.seconds, -1);\n break;\n case ActionTypes.toggleMeridiem:\n this.manipulateAndSet(\n lastPicked,\n Unit.hours,\n this.dates.lastPicked.hours >= 12 ? -12 : 12\n );\n break;\n case ActionTypes.togglePicker:\n this.handleToggle(currentTarget);\n break;\n case ActionTypes.showClock:\n case ActionTypes.showHours:\n case ActionTypes.showMinutes:\n case ActionTypes.showSeconds:\n //make sure the clock is actually displaying\n if (\n !this.optionsStore.options.display.sideBySide &&\n this.optionsStore.currentView !== 'clock'\n ) {\n //hide calendar\n Collapse.hideImmediately(this.display.dateContainer);\n //show clock\n Collapse.showImmediately(this.display.timeContainer);\n }\n this.handleShowClockContainers(action);\n break;\n case ActionTypes.clear:\n this.dates.setValue(null);\n this.display._updateCalendarHeader();\n break;\n case ActionTypes.close:\n this.display.hide();\n break;\n case ActionTypes.today: {\n const today = new DateTime().setLocalization(\n this.optionsStore.options.localization\n );\n this._eventEmitters.updateViewDate.emit(today);\n\n //todo this this really a good idea?\n if (this.validation.isValid(today, Unit.date))\n this.dates.setValue(today, this.dates.lastPickedIndex);\n break;\n }\n }\n }\n\n private handleShowClockContainers(action: ActionTypes) {\n if (!this.display._hasTime) {\n Namespace.errorMessages.throwError(\n 'Cannot show clock containers when time is disabled.'\n );\n /* ignore coverage: should never happen */\n return;\n }\n\n this.optionsStore.currentView = 'clock';\n this.display.widget\n .querySelectorAll(`.${Namespace.css.timeContainer} > div`)\n .forEach(\n (htmlElement: HTMLElement) => (htmlElement.style.display = 'none')\n );\n\n let classToUse = '';\n switch (action) {\n case ActionTypes.showClock:\n classToUse = Namespace.css.clockContainer;\n this.display._update('clock');\n break;\n case ActionTypes.showHours:\n classToUse = Namespace.css.hourContainer;\n this.display._update(Unit.hours);\n break;\n case ActionTypes.showMinutes:\n classToUse = Namespace.css.minuteContainer;\n this.display._update(Unit.minutes);\n break;\n case ActionTypes.showSeconds:\n classToUse = Namespace.css.secondContainer;\n this.display._update(Unit.seconds);\n break;\n }\n\n ((\n this.display.widget.getElementsByClassName(classToUse)[0]\n )).style.display = 'grid';\n }\n\n private handleNextPrevious(action: ActionTypes) {\n const { unit, step } =\n CalendarModes[this.optionsStore.currentCalendarViewMode];\n if (action === ActionTypes.next)\n this.optionsStore.viewDate.manipulate(step, unit);\n else this.optionsStore.viewDate.manipulate(step * -1, unit);\n this._eventEmitters.viewUpdate.emit();\n\n this.display._showMode();\n }\n\n /**\n * After setting the value it will either show the clock or hide the widget.\n * @param e\n */\n private hideOrClock(e) {\n if (\n !this.optionsStore.isTwelveHour &&\n !this.optionsStore.options.display.components.minutes &&\n !this.optionsStore.options.display.keepOpen &&\n !this.optionsStore.options.display.inline\n ) {\n this.display.hide();\n } else {\n this.do(e, ActionTypes.showClock);\n }\n }\n\n /**\n * Common function to manipulate {@link lastPicked} by `unit`.\n * @param lastPicked\n * @param unit\n * @param value Value to change by\n */\n private manipulateAndSet(lastPicked: DateTime, unit: Unit, value = 1) {\n const newDate = lastPicked.manipulate(value, unit);\n if (this.validation.isValid(newDate, unit)) {\n this.dates.setValue(newDate, this.dates.lastPickedIndex);\n }\n }\n\n private handleSelectCalendarMode(\n action:\n | ActionTypes.selectMonth\n | ActionTypes.selectYear\n | ActionTypes.selectDecade,\n currentTarget: HTMLElement\n ) {\n const value = +currentTarget.dataset.value;\n switch (action) {\n case ActionTypes.selectMonth:\n this.optionsStore.viewDate.month = value;\n break;\n case ActionTypes.selectYear:\n case ActionTypes.selectDecade:\n this.optionsStore.viewDate.year = value;\n break;\n }\n\n if (\n this.optionsStore.currentCalendarViewMode ===\n this.optionsStore.minimumCalendarViewMode\n ) {\n this.dates.setValue(\n this.optionsStore.viewDate,\n this.dates.lastPickedIndex\n );\n if (!this.optionsStore.options.display.inline) {\n this.display.hide();\n }\n } else {\n this.display._showMode(-1);\n }\n }\n\n private handleToggle(currentTarget: HTMLElement) {\n if (\n currentTarget.getAttribute('title') ===\n this.optionsStore.options.localization.selectDate\n ) {\n currentTarget.setAttribute(\n 'title',\n this.optionsStore.options.localization.selectTime\n );\n currentTarget.innerHTML = this.display._iconTag(\n this.optionsStore.options.display.icons.time\n ).outerHTML;\n\n this.display._updateCalendarHeader();\n this.optionsStore.refreshCurrentView();\n } else {\n currentTarget.setAttribute(\n 'title',\n this.optionsStore.options.localization.selectDate\n );\n currentTarget.innerHTML = this.display._iconTag(\n this.optionsStore.options.display.icons.date\n ).outerHTML;\n if (this.display._hasTime) {\n this.handleShowClockContainers(ActionTypes.showClock);\n this.display._update('clock');\n }\n }\n\n this.display.widget\n .querySelectorAll(\n `.${Namespace.css.dateContainer}, .${Namespace.css.timeContainer}`\n )\n .forEach((htmlElement: HTMLElement) => Collapse.toggle(htmlElement));\n this._eventEmitters.viewUpdate.emit();\n }\n\n private handleSelectDay(currentTarget: HTMLElement) {\n const day = this.optionsStore.viewDate.clone;\n if (currentTarget.classList.contains(Namespace.css.old)) {\n day.manipulate(-1, Unit.month);\n }\n if (currentTarget.classList.contains(Namespace.css.new)) {\n day.manipulate(1, Unit.month);\n }\n\n day.date = +currentTarget.dataset.day;\n if (this.optionsStore.options.dateRange) this.handleDateRange(day);\n else if (this.optionsStore.options.multipleDates) {\n this.handleMultiDate(day);\n } else {\n this.dates.setValue(day, this.dates.lastPickedIndex);\n }\n\n if (\n !this.display._hasTime &&\n !this.optionsStore.options.display.keepOpen &&\n !this.optionsStore.options.display.inline &&\n !this.optionsStore.options.multipleDates &&\n !this.optionsStore.options.dateRange\n ) {\n this.display.hide();\n }\n }\n\n private handleMultiDate(day: DateTime) {\n let index = this.dates.pickedIndex(day, Unit.date);\n console.log(index);\n if (index !== -1) {\n this.dates.setValue(null, index); //deselect multi-date\n } else {\n index = this.dates.lastPickedIndex + 1;\n if (this.dates.picked.length === 0) index = 0;\n\n this.dates.setValue(day, index);\n }\n }\n\n private handleDateRange(day: DateTime) {\n switch (this.dates.picked.length) {\n case 2: {\n this.dates.clear();\n break;\n }\n case 1: {\n const other = this.dates.picked[0];\n if (day.getTime() === other.getTime()) {\n this.dates.clear();\n break;\n }\n if (day.isBefore(other)) {\n this.dates.setValue(day, 0);\n this.dates.setValue(other, 1);\n return;\n } else {\n this.dates.setValue(day, 1);\n return;\n }\n }\n }\n\n this.dates.setValue(day, 0);\n }\n}\n","import Display from './display/index';\nimport Dates from './dates';\nimport Actions from './actions';\nimport {\n DateTime,\n DateTimeFormatOptions,\n guessHourCycle,\n Unit,\n} from './datetime';\nimport Namespace from './utilities/namespace';\nimport Options from './utilities/options';\nimport {\n BaseEvent,\n ChangeEvent,\n ViewUpdateEvent,\n} from './utilities/event-types';\nimport { EventEmitters } from './utilities/event-emitter';\nimport {\n serviceLocator,\n setupServiceLocator,\n} from './utilities/service-locator';\nimport CalendarModes from './utilities/calendar-modes';\nimport DefaultOptions, {\n DefaultEnLocalization,\n} from './utilities/default-options';\nimport ActionTypes from './utilities/action-types';\nimport { OptionsStore } from './utilities/optionsStore';\nimport { OptionConverter } from './utilities/optionConverter';\n\n/**\n * A robust and powerful date/time picker component.\n */\nclass TempusDominus {\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n _subscribers: { [key: string]: ((event: any) => Record)[] } =\n {};\n private _isDisabled = false;\n private _toggle: HTMLElement;\n private _currentPromptTimeTimeout: NodeJS.Timeout;\n private actions: Actions;\n private optionsStore: OptionsStore;\n private _eventEmitters: EventEmitters;\n display: Display;\n dates: Dates;\n\n constructor(element: HTMLElement, options: Options = {} as Options) {\n setupServiceLocator();\n this._eventEmitters = serviceLocator.locate(EventEmitters);\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.display = serviceLocator.locate(Display);\n this.dates = serviceLocator.locate(Dates);\n this.actions = serviceLocator.locate(Actions);\n\n if (!element) {\n Namespace.errorMessages.mustProvideElement();\n }\n\n this.optionsStore.element = element;\n this._initializeOptions(options, DefaultOptions, true);\n this.optionsStore.viewDate.setLocalization(\n this.optionsStore.options.localization\n );\n this.optionsStore.unset = true;\n\n this._initializeInput();\n this._initializeToggle();\n\n if (this.optionsStore.options.display.inline) this.display.show();\n\n this._eventEmitters.triggerEvent.subscribe((e) => {\n this._triggerEvent(e);\n });\n\n this._eventEmitters.viewUpdate.subscribe(() => {\n this._viewUpdate();\n });\n\n this._eventEmitters.updateViewDate.subscribe((dateTime) => {\n this.viewDate = dateTime;\n });\n }\n\n get viewDate() {\n return this.optionsStore.viewDate;\n }\n\n set viewDate(value) {\n this.optionsStore.viewDate = value;\n this.optionsStore.viewDate.setLocalization(\n this.optionsStore.options.localization\n );\n this.display._update(\n this.optionsStore.currentView === 'clock' ? 'clock' : 'calendar'\n );\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Update the picker options. If `reset` is provide `options` will be merged with DefaultOptions instead.\n * @param options\n * @param reset\n * @public\n */\n updateOptions(options, reset = false): void {\n if (reset) this._initializeOptions(options, DefaultOptions);\n else this._initializeOptions(options, this.optionsStore.options);\n\n this.optionsStore.viewDate.setLocalization(\n this.optionsStore.options.localization\n );\n this.display._rebuild();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Toggles the picker open or closed. If the picker is disabled, nothing will happen.\n * @public\n */\n toggle(): void {\n if (this._isDisabled) return;\n this.display.toggle();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Shows the picker unless the picker is disabled.\n * @public\n */\n show(): void {\n if (this._isDisabled) return;\n this.display.show();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Hides the picker unless the picker is disabled.\n * @public\n */\n hide(): void {\n this.display.hide();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Disables the picker and the target input field.\n * @public\n */\n disable(): void {\n this._isDisabled = true;\n // todo this might be undesired. If a dev disables the input field to\n // only allow using the picker, this will break that.\n this.optionsStore.input?.setAttribute('disabled', 'disabled');\n this.display.hide();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Enables the picker and the target input field.\n * @public\n */\n enable(): void {\n this._isDisabled = false;\n this.optionsStore.input?.removeAttribute('disabled');\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Clears all the selected dates\n * @public\n */\n clear(): void {\n this.optionsStore.input.value = '';\n this.dates.clear();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Allows for a direct subscription to picker events, without having to use addEventListener on the element.\n * @param eventTypes See Namespace.Events\n * @param callbacks Function to call when event is triggered\n * @public\n */\n subscribe(\n eventTypes: string | string[],\n callbacks: (event: any) => void | ((event: any) => void)[] //eslint-disable-line @typescript-eslint/no-explicit-any\n ): { unsubscribe: () => void } | { unsubscribe: () => void }[] {\n if (typeof eventTypes === 'string') {\n eventTypes = [eventTypes];\n }\n let callBackArray: any[]; //eslint-disable-line @typescript-eslint/no-explicit-any\n if (!Array.isArray(callbacks)) {\n callBackArray = [callbacks];\n } else {\n callBackArray = callbacks;\n }\n\n if (eventTypes.length !== callBackArray.length) {\n Namespace.errorMessages.subscribeMismatch();\n }\n\n const returnArray = [];\n\n for (let i = 0; i < eventTypes.length; i++) {\n const eventType = eventTypes[i];\n if (!Array.isArray(this._subscribers[eventType])) {\n this._subscribers[eventType] = [];\n }\n\n this._subscribers[eventType].push(callBackArray[i]);\n\n returnArray.push({\n unsubscribe: this._unsubscribe.bind(\n this,\n eventType,\n this._subscribers[eventType].length - 1\n ),\n });\n\n if (eventTypes.length === 1) {\n return returnArray[0];\n }\n }\n\n return returnArray;\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Hides the picker and removes event listeners\n */\n dispose() {\n this.display.hide();\n // this will clear the document click event listener\n this.display._dispose();\n this._eventEmitters.destroy();\n this.optionsStore.input?.removeEventListener(\n 'change',\n this._inputChangeEvent\n );\n if (this.optionsStore.options.allowInputToggle) {\n this.optionsStore.input?.removeEventListener(\n 'click',\n this._toggleClickEvent\n );\n }\n this._toggle?.removeEventListener('click', this._toggleClickEvent);\n this._subscribers = {};\n }\n\n /**\n * Updates the options to use the provided language.\n * THe language file must be loaded first.\n * @param language\n */\n locale(language: string) {\n const asked = loadedLocales[language];\n if (!asked) return;\n this.updateOptions({\n localization: asked,\n });\n }\n\n /**\n * Triggers an event like ChangeEvent when the picker has updated the value\n * of a selected date.\n * @param event Accepts a BaseEvent object.\n * @private\n */\n private _triggerEvent(event: BaseEvent) {\n event.viewMode = this.optionsStore.currentView;\n\n const isChangeEvent = event.type === Namespace.events.change;\n if (isChangeEvent) {\n const { date, oldDate, isClear } = event as ChangeEvent;\n if (\n (date && oldDate && date.isSame(oldDate)) ||\n (!isClear && !date && !oldDate)\n ) {\n return;\n }\n this._handleAfterChangeEvent(event as ChangeEvent);\n\n this.optionsStore.input?.dispatchEvent(\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n new CustomEvent('change', { detail: event as any })\n );\n }\n\n this.optionsStore.element.dispatchEvent(\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n new CustomEvent(event.type, { detail: event as any })\n );\n\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((window as any).jQuery) {\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n const $ = (window as any).jQuery;\n\n if (isChangeEvent && this.optionsStore.input) {\n $(this.optionsStore.input).trigger(event);\n } else {\n $(this.optionsStore.element).trigger(event);\n }\n }\n\n this._publish(event);\n }\n\n private _publish(event: BaseEvent) {\n // return if event is not subscribed\n if (!Array.isArray(this._subscribers[event.type])) {\n return;\n }\n\n // Trigger callback for each subscriber\n this._subscribers[event.type].forEach((callback) => {\n callback(event);\n });\n }\n\n /**\n * Fires a ViewUpdate event when, for example, the month view is changed.\n * @private\n */\n private _viewUpdate() {\n this._triggerEvent({\n type: Namespace.events.update,\n viewDate: this.optionsStore.viewDate.clone,\n } as ViewUpdateEvent);\n }\n\n private _unsubscribe(eventName, index) {\n this._subscribers[eventName].splice(index, 1);\n }\n\n /**\n * Merges two Option objects together and validates options type\n * @param config new Options\n * @param mergeTo Options to merge into\n * @param includeDataset When true, the elements data-td attributes will be included in the\n * @private\n */\n private _initializeOptions(\n config: Options,\n mergeTo: Options,\n includeDataset = false\n ): void {\n let newConfig = OptionConverter.deepCopy(config);\n newConfig = OptionConverter._mergeOptions(newConfig, mergeTo);\n if (includeDataset)\n newConfig = OptionConverter._dataToOptions(\n this.optionsStore.element,\n newConfig\n );\n\n OptionConverter._validateConflicts(newConfig);\n\n newConfig.viewDate = newConfig.viewDate.setLocalization(\n newConfig.localization\n );\n\n if (!this.optionsStore.viewDate.isSame(newConfig.viewDate)) {\n this.optionsStore.viewDate = newConfig.viewDate;\n }\n\n /**\n * Sets the minimum view allowed by the picker. For example the case of only\n * allowing year and month to be selected but not date.\n */\n if (newConfig.display.components.year) {\n this.optionsStore.minimumCalendarViewMode = 2;\n }\n if (newConfig.display.components.month) {\n this.optionsStore.minimumCalendarViewMode = 1;\n }\n if (newConfig.display.components.date) {\n this.optionsStore.minimumCalendarViewMode = 0;\n }\n\n this.optionsStore.currentCalendarViewMode = Math.max(\n this.optionsStore.minimumCalendarViewMode,\n this.optionsStore.currentCalendarViewMode\n );\n\n // Update view mode if needed\n if (\n CalendarModes[this.optionsStore.currentCalendarViewMode].name !==\n newConfig.display.viewMode\n ) {\n this.optionsStore.currentCalendarViewMode = Math.max(\n CalendarModes.findIndex((x) => x.name === newConfig.display.viewMode),\n this.optionsStore.minimumCalendarViewMode\n );\n }\n\n if (this.display?.isVisible) {\n this.display._update('all');\n }\n\n if (\n newConfig.display.components.useTwentyfourHour &&\n newConfig.localization.hourCycle === undefined\n )\n newConfig.localization.hourCycle = 'h24';\n else if (newConfig.localization.hourCycle === undefined) {\n newConfig.localization.hourCycle = guessHourCycle(\n newConfig.localization.locale\n );\n }\n\n this.optionsStore.options = newConfig;\n }\n\n /**\n * Checks if an input field is being used, attempts to locate one and sets an\n * event listener if found.\n * @private\n */\n private _initializeInput() {\n if (this.optionsStore.element.tagName == 'INPUT') {\n this.optionsStore.input = this.optionsStore.element as HTMLInputElement;\n } else {\n const query = this.optionsStore.element.dataset.tdTargetInput;\n if (query == undefined || query == 'nearest') {\n this.optionsStore.input =\n this.optionsStore.element.querySelector('input');\n } else {\n this.optionsStore.input =\n this.optionsStore.element.querySelector(query);\n }\n }\n\n if (!this.optionsStore.input) return;\n\n if (!this.optionsStore.input.value && this.optionsStore.options.defaultDate)\n this.optionsStore.input.value = this.dates.formatInput(\n this.optionsStore.options.defaultDate\n );\n\n this.optionsStore.input.addEventListener('change', this._inputChangeEvent);\n if (this.optionsStore.options.allowInputToggle) {\n this.optionsStore.input.addEventListener('click', this._toggleClickEvent);\n }\n\n if (this.optionsStore.input.value) {\n this._inputChangeEvent();\n }\n }\n\n /**\n * Attempts to locate a toggle for the picker and sets an event listener\n * @private\n */\n private _initializeToggle() {\n if (this.optionsStore.options.display.inline) return;\n let query = this.optionsStore.element.dataset.tdTargetToggle;\n if (query == 'nearest') {\n query = '[data-td-toggle=\"datetimepicker\"]';\n }\n this._toggle =\n query == undefined\n ? this.optionsStore.element\n : this.optionsStore.element.querySelector(query);\n this._toggle.addEventListener('click', this._toggleClickEvent);\n }\n\n /**\n * If the option is enabled this will render the clock view after a date pick.\n * @param e change event\n * @private\n */\n private _handleAfterChangeEvent(e: ChangeEvent) {\n if (\n // options is disabled\n !this.optionsStore.options.promptTimeOnDateChange ||\n this.optionsStore.options.multipleDates ||\n this.optionsStore.options.display.inline ||\n this.optionsStore.options.display.sideBySide ||\n // time is disabled\n !this.display._hasTime ||\n // clock component is already showing\n this.display.widget\n ?.getElementsByClassName(Namespace.css.show)[0]\n .classList.contains(Namespace.css.timeContainer)\n )\n return;\n\n // First time ever. If useCurrent option is set to true (default), do nothing\n // because the first date is selected automatically.\n // or date didn't change (time did) or date changed because time did.\n if (\n (!e.oldDate && this.optionsStore.options.useCurrent) ||\n (e.oldDate && e.date?.isSame(e.oldDate))\n ) {\n return;\n }\n\n clearTimeout(this._currentPromptTimeTimeout);\n this._currentPromptTimeTimeout = setTimeout(() => {\n if (this.display.widget) {\n this._eventEmitters.action.emit({\n e: {\n currentTarget: this.display.widget.querySelector(\n `.${Namespace.css.switch}`\n ),\n },\n action: ActionTypes.togglePicker,\n });\n }\n }, this.optionsStore.options.promptTimeOnDateChangeTransitionDelay);\n }\n\n /**\n * Event for when the input field changes. This is a class level method so there's\n * something for the remove listener function.\n * @private\n */\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _inputChangeEvent = (event?: any) => {\n const internallyTriggered = event?.detail;\n if (internallyTriggered) return;\n\n const setViewDate = () => {\n if (this.dates.lastPicked)\n this.optionsStore.viewDate = this.dates.lastPicked.clone;\n };\n\n const value = this.optionsStore.input.value;\n if (this.optionsStore.options.multipleDates) {\n try {\n const valueSplit = value.split(\n this.optionsStore.options.multipleDatesSeparator\n );\n for (let i = 0; i < valueSplit.length; i++) {\n this.dates.setFromInput(valueSplit[i], i);\n }\n setViewDate();\n } catch {\n console.warn(\n 'TD: Something went wrong trying to set the multipleDates values from the input field.'\n );\n }\n } else {\n this.dates.setFromInput(value, 0);\n setViewDate();\n }\n };\n\n /**\n * Event for when the toggle is clicked. This is a class level method so there's\n * something for the remove listener function.\n * @private\n */\n private _toggleClickEvent = () => {\n if (\n (this.optionsStore.element as HTMLInputElement)?.disabled ||\n this.optionsStore.input?.disabled\n )\n return;\n this.toggle();\n };\n}\n\n/**\n * Whenever a locale is loaded via a plugin then store it here based on the\n * locale name. E.g. loadedLocales['ru']\n */\nconst loadedLocales = {};\n\n// noinspection JSUnusedGlobalSymbols\n/**\n * Called from a locale plugin.\n * @param l locale object for localization options\n */\nconst loadLocale = (l) => {\n if (loadedLocales[l.name]) return;\n loadedLocales[l.name] = l.localization;\n};\n\n/**\n * A sets the global localization options to the provided locale name.\n * `loadLocale` MUST be called first.\n * @param l\n */\nconst locale = (l: string) => {\n const asked = loadedLocales[l];\n if (!asked) return;\n DefaultOptions.localization = asked;\n};\n\n// noinspection JSUnusedGlobalSymbols\n/**\n * Called from a plugin to extend or override picker defaults.\n * @param plugin\n * @param option\n */\nconst extend = function (plugin, option = undefined) {\n if (!plugin) return tempusDominus;\n if (!plugin.installed) {\n // install plugin only once\n plugin(\n option,\n { TempusDominus, Dates, Display, DateTime, Namespace },\n tempusDominus\n );\n plugin.installed = true;\n }\n return tempusDominus;\n};\n\nconst version = '6.4.4';\n\nconst tempusDominus = {\n TempusDominus,\n extend,\n loadLocale,\n locale,\n Namespace,\n DefaultOptions,\n DateTime,\n Unit,\n version,\n DefaultEnLocalization,\n};\n\nexport {\n TempusDominus,\n extend,\n loadLocale,\n locale,\n Namespace,\n DefaultOptions,\n DateTime,\n Unit,\n version,\n DateTimeFormatOptions,\n Options,\n DefaultEnLocalization,\n};\n"],"names":["DefaultFormatLocalization","ActionTypes","SecondDisplay"],"mappings":";;;;;AAAM,MAAO,OAAQ,SAAQ,KAAK,CAAA;AAEjC,CAAA;MAEY,aAAa,CAAA;AAA1B,IAAA,WAAA,GAAA;QACU,IAAI,CAAA,IAAA,GAAG,KAAK,CAAC;;;AAqKrB;;;AAGG;QACH,IAAsB,CAAA,sBAAA,GAAG,4BAA4B,CAAC;AAEtD;;;AAGG;QACH,IAAkB,CAAA,kBAAA,GAAG,0BAA0B,CAAC;;KAGjD;;AA9KC;;;AAGG;AACH,IAAA,gBAAgB,CAAC,UAAkB,EAAA;AACjC,QAAA,MAAM,KAAK,GAAG,IAAI,OAAO,CACvB,CAAA,EAAG,IAAI,CAAC,IAAI,CAAA,oBAAA,EAAuB,UAAU,CAAA,+BAAA,CAAiC,CAC/E,CAAC;AACF,QAAA,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC;AACf,QAAA,MAAM,KAAK,CAAC;KACb;AAED;;;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AAC,CAAS,KAAI;AAC3B,IAAA,MAAM,KAAK,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;AAC/B,IAAA,IAAI,CAAC,KAAK;QAAE,OAAO;AACnB,IAAA,cAAc,CAAC,YAAY,GAAG,KAAK,CAAC;AACtC,EAAE;AAEF;AACA;;;;AAIG;AACH,MAAM,MAAM,GAAG,UAAU,MAAM,EAAE,MAAM,GAAG,SAAS,EAAA;AACjD,IAAA,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,aAAa,CAAC;AAClC,IAAA,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;;AAErB,QAAA,MAAM,CACJ,MAAM,EACN,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,EACtD,aAAa,CACd,CAAC;AACF,QAAA,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;AACzB,KAAA;AACD,IAAA,OAAO,aAAa,CAAC;AACvB,EAAE;AAEI,MAAA,OAAO,GAAG,QAAQ;AAExB,MAAM,aAAa,GAAG;IACpB,aAAa;IACb,MAAM;IACN,UAAU;IACV,MAAM;IACN,SAAS;IACT,cAAc;IACd,QAAQ;IACR,IAAI;IACJ,OAAO;IACP,qBAAqB;CACtB;;;;"} \ No newline at end of file diff --git a/dist/js/tempus-dominus.esm.min.js b/dist/js/tempus-dominus.esm.min.js index 5a1a40b93..184b09f8e 100644 --- a/dist/js/tempus-dominus.esm.min.js +++ b/dist/js/tempus-dominus.esm.min.js @@ -1,6 +1,6 @@ /*! - * Tempus Dominus v6.4.4 (https://getdatepicker.com/) + * Tempus Dominus v6.7.7 (https://getdatepicker.com/) * Copyright 2013-2023 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ -class t extends Error{}const e="tempus-dominus";class s{}s.NAME=e,s.dataKey="td",s.events=new class{constructor(){this.key=".td",this.change=`change${this.key}`,this.update=`update${this.key}`,this.error=`error${this.key}`,this.show=`show${this.key}`,this.hide=`hide${this.key}`,this.blur=`blur${this.key}`,this.focus=`focus${this.key}`,this.keyup=`keyup${this.key}`,this.keydown=`keydown${this.key}`}},s.css=new class{constructor(){this.widget=`${e}-widget`,this.calendarHeader="calendar-header",this.switch="picker-switch",this.toolbar="toolbar",this.noHighlight="no-highlight",this.sideBySide="timepicker-sbs",this.previous="previous",this.next="next",this.disabled="disabled",this.old="old",this.new="new",this.active="active",this.dateContainer="date-container",this.decadesContainer=`${this.dateContainer}-decades`,this.decade="decade",this.yearsContainer=`${this.dateContainer}-years`,this.year="year",this.monthsContainer=`${this.dateContainer}-months`,this.month="month",this.daysContainer=`${this.dateContainer}-days`,this.day="day",this.calendarWeeks="cw",this.dayOfTheWeek="dow",this.today="today",this.weekend="weekend",this.rangeIn="range-in",this.rangeStart="range-start",this.rangeEnd="range-end",this.timeContainer="time-container",this.separator="separator",this.clockContainer=`${this.timeContainer}-clock`,this.hourContainer=`${this.timeContainer}-hour`,this.minuteContainer=`${this.timeContainer}-minute`,this.secondContainer=`${this.timeContainer}-second`,this.hour="hour",this.minute="minute",this.second="second",this.toggleMeridiem="toggleMeridiem",this.show="show",this.collapsing="td-collapsing",this.collapse="td-collapse",this.inline="inline",this.lightTheme="light",this.darkTheme="dark",this.isDarkPreferredQuery="(prefers-color-scheme: dark)"}},s.errorMessages=new class{constructor(){this.base="TD:",this.failedToSetInvalidDate="Failed to set invalid date",this.failedToParseInput="Failed parse input field"}unexpectedOption(e){const s=new t(`${this.base} Unexpected option: ${e} does not match a known option.`);throw s.code=1,s}unexpectedOptions(e){const s=new t(`${this.base}: ${e.join(", ")}`);throw s.code=1,s}unexpectedOptionValue(e,s,i){const o=new t(`${this.base} Unexpected option value: ${e} does not accept a value of "${s}". Valid values are: ${i.join(", ")}`);throw o.code=2,o}typeMismatch(e,s,i){const o=new t(`${this.base} Mismatch types: ${e} has a type of ${s} instead of the required ${i}`);throw o.code=3,o}numbersOutOfRange(e,s,i){const o=new t(`${this.base} ${e} expected an array of number between ${s} and ${i}.`);throw o.code=4,o}failedToParseDate(e,s,i=!1){const o=new t(`${this.base} Could not correctly parse "${s}" to a date for ${e}.`);if(o.code=5,!i)throw o;console.warn(o)}mustProvideElement(){const e=new t(`${this.base} No element was provided.`);throw e.code=6,e}subscribeMismatch(){const e=new t(`${this.base} The subscribed events does not match the number of callbacks`);throw e.code=7,e}conflictingConfiguration(e){const s=new t(`${this.base} A configuration value conflicts with another rule. ${e}`);throw s.code=8,s}customDateFormatError(e){const s=new t(`${this.base} Custom Date Format: ${e}`);throw s.code=9,s}dateString(){console.warn(`${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`)}deprecatedWarning(t,e){console.warn(`${this.base} Warning ${t} is deprecated and will be removed in a future version. ${e}`)}throwError(e){const s=new t(`${this.base} ${e}`);throw s.code=9,s}};var i,o={...{locale:"default",hourCycle:void 0,dateFormats:{LTS:"h:mm:ss T",LT:"h:mm T",L:"MM/dd/yyyy",LL:"MMMM d, yyyy",LLL:"MMMM d, yyyy h:mm T",LLLL:"dddd, MMMM d, yyyy h:mm T"},ordinal:t=>{const e=["th","st","nd","rd"],s=t%100;return`[${t}${e[(s-20)%10]||e[s]||e[0]}]`},format:"L LT"}};!function(t){t.seconds="seconds",t.minutes="minutes",t.hours="hours",t.date="date",t.month="month",t.year="year"}(i||(i={}));const a={month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"},n=t=>{switch(t){case"date":return{dateStyle:"short"};case"month":return{month:"numeric",year:"numeric"};case"year":return{year:"numeric"}}},r=t=>{if(!t)return"h12";const e={hour:"2-digit",minute:"2-digit",numberingSystem:"latn"},s=(new d).setLocalization({locale:t});s.hours=0;const i=s.parts(void 0,e).hour;if("12"===i)return"h12";if("24"===i)return"h24";s.hours=23;const o=s.parts(void 0,e).hour;return"00"===i&&"11"===o?"h11":"00"===i&&"23"===o?"h23":void console.warn(`couldn't determine hour cycle for ${t}. start: ${i}. end: ${o}`)};class d extends Date{constructor(){super(...arguments),this.localization=o,this.nonLeapLadder=[0,31,59,90,120,151,181,212,243,273,304,334],this.leapLadder=[0,31,60,91,121,152,182,213,244,274,305,335],this.dateTimeRegex=/(\[[^[\]]*])|y{1,4}|M{1,4}|d{1,4}|H{1,2}|h{1,2}|t|T|m{1,2}|s{1,2}|f{3}/g,this.formattingTokens=/(\[[^[\]]*])|([-_:/.,()\s]+)|(T|t|yyyy|yy?|MM?M?M?|Do|dd?|hh?|HH?|mm?|ss?)/g,this.match2=/\d\d/,this.match3=/\d{3}/,this.match4=/\d{4}/,this.match1to2=/\d\d?/,this.matchSigned=/[+-]?\d+/,this.matchOffset=/[+-]\d\d:?(\d\d)?|Z/,this.matchWord=/[^\d_:/,\-()\s]+/,this.zoneExpressions=[this.matchOffset,(t,e)=>{t.offset=this.offsetFromString(e)}],this.expressions={t:[this.matchWord,(t,e)=>{t.afternoon=this.meridiemMatch(e)}],T:[this.matchWord,(t,e)=>{t.afternoon=this.meridiemMatch(e)}],fff:[this.match3,(t,e)=>{t.milliseconds=+e}],s:[this.match1to2,this.addInput("seconds")],ss:[this.match1to2,this.addInput("seconds")],m:[this.match1to2,this.addInput("minutes")],mm:[this.match1to2,this.addInput("minutes")],H:[this.match1to2,this.addInput("hours")],h:[this.match1to2,this.addInput("hours")],HH:[this.match1to2,this.addInput("hours")],hh:[this.match1to2,this.addInput("hours")],d:[this.match1to2,this.addInput("day")],dd:[this.match2,this.addInput("day")],Do:[this.matchWord,(t,e)=>{if([t.day]=e.match(/\d+/),this.localization.ordinal)for(let s=1;s<=31;s+=1)this.localization.ordinal(s).replace(/[[\]]/g,"")===e&&(t.day=s)}],M:[this.match1to2,this.addInput("month")],MM:[this.match2,this.addInput("month")],MMM:[this.matchWord,(t,e)=>{const s=this.getAllMonths(),i=(this.getAllMonths("short")||s.map((t=>t.slice(0,3)))).indexOf(e)+1;if(i<1)throw new Error;t.month=i%12||i}],MMMM:[this.matchWord,(t,e)=>{const s=this.getAllMonths().indexOf(e)+1;if(s<1)throw new Error;t.month=s%12||s}],y:[this.matchSigned,this.addInput("year")],yy:[this.match2,(t,e)=>{t.year=this.parseTwoDigitYear(e)}],yyyy:[this.match4,this.addInput("year")]}}setLocale(t){return this.localization||(this.localization=o,this.localization.locale=t),this}setLocalization(t){return this.localization=t,this}static convert(t,e="default",s=undefined){if(!t)throw new Error("A date is required");return s||((s=o).locale=e),new d(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()).setLocalization(s)}get clone(){return new d(this.year,this.month,this.date,this.hours,this.minutes,this.seconds,this.getMilliseconds()).setLocalization(this.localization)}static isValid(t){return void 0!==t&&"null"!==JSON.stringify(t)&&t.constructor.name===d.name}startOf(t,e=0){if(void 0===this[t])throw new Error(`Unit '${t}' is not valid`);switch(t){case"seconds":this.setMilliseconds(0);break;case"minutes":this.setSeconds(0,0);break;case"hours":this.setMinutes(0,0,0);break;case"date":this.setHours(0,0,0,0);break;case"weekDay":{if(this.startOf(i.date),this.weekDay===e)break;let t=this.weekDay;0!==e&&0===this.weekDay&&(t=8-e),this.manipulate(e-t,i.date);break}case"month":this.startOf(i.date),this.setDate(1);break;case"year":this.startOf(i.date),this.setMonth(0,1)}return this}endOf(t,e=0){if(void 0===this[t])throw new Error(`Unit '${t}' is not valid`);switch(t){case"seconds":this.setMilliseconds(999);break;case"minutes":this.setSeconds(59,999);break;case"hours":this.setMinutes(59,59,999);break;case"date":this.setHours(23,59,59,999);break;case"weekDay":{this.endOf(i.date);const t=6+e;if(this.weekDay===t)break;this.manipulate(t-this.weekDay,i.date);break}case"month":this.endOf(i.date),this.manipulate(1,i.month),this.setDate(0);break;case"year":this.endOf(i.date),this.setMonth(11,31)}return this}manipulate(t,e){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return this[e]+=t,this}isBefore(t,e){if(!d.isValid(t))return!1;if(!e)return this.valueOf()t.valueOf();if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return this.clone.startOf(e).valueOf()>t.clone.startOf(e).valueOf()}isSame(t,e){if(!d.isValid(t))return!1;if(!e)return this.valueOf()===t.valueOf();if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return t=d.convert(t),this.clone.startOf(e).valueOf()===t.startOf(e).valueOf()}isBetween(t,e,s,i="()"){if(!d.isValid(t)||!d.isValid(e))return!1;if(s&&void 0===this[s])throw new Error(`Unit '${s}' is not valid`);const o="("===i[0],a=")"===i[1],n=o?this.isAfter(t,s):!this.isBefore(t,s),r=a?this.isBefore(e,s):!this.isAfter(e,s);return n&&r}parts(t=this.localization.locale,e={dateStyle:"full",timeStyle:"long"}){const s={};return new Intl.DateTimeFormat(t,e).formatToParts(this).filter((t=>"literal"!==t.type)).forEach((t=>s[t.type]=t.value)),s}get seconds(){return this.getSeconds()}set seconds(t){this.setSeconds(t)}get secondsFormatted(){return this.parts(void 0,a).second}get minutes(){return this.getMinutes()}set minutes(t){this.setMinutes(t)}get minutesFormatted(){return this.parts(void 0,a).minute}get hours(){return this.getHours()}set hours(t){this.setHours(t)}getHoursFormatted(t="h12"){return this.parts(void 0,{...a,hourCycle:t}).hour}meridiem(t=this.localization.locale){return new Intl.DateTimeFormat(t,{hour:"numeric",hour12:!0}).formatToParts(this).find((t=>"dayPeriod"===t.type))?.value}get date(){return this.getDate()}set date(t){this.setDate(t)}get dateFormatted(){return this.parts(void 0,a).day}get weekDay(){return this.getDay()}get month(){return this.getMonth()}set month(t){const e=new Date(this.year,t+1);e.setDate(0);const s=e.getDate();this.date>s&&(this.date=s),this.setMonth(t)}get monthFormatted(){return this.parts(void 0,a).month}get year(){return this.getFullYear()}set year(t){this.setFullYear(t)}get week(){const t=this.computeOrdinal(),e=this.getUTCDay();let s=Math.floor((t-e+10)/7);return s<1?s=this.weeksInWeekYear():s>this.weeksInWeekYear()&&(s=1),s}weeksInWeekYear(){const t=(this.year+Math.floor(this.year/4)-Math.floor(this.year/100)+Math.floor(this.year/400))%7,e=this.year-1,s=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7;return 4===t||3===s?53:52}get isLeapYear(){return this.year%4==0&&(this.year%100!=0||this.year%400==0)}computeOrdinal(){return this.date+(this.isLeapYear?this.leapLadder:this.nonLeapLadder)[this.month]}getAllMonths(t="long"){const e=new Intl.DateTimeFormat(this.localization.locale,{month:t}).format;return[...Array(12).keys()].map((t=>e(new Date(2021,t))))}replaceTokens(t,e){return t.replace(/(\[[^[\]]*])|(LTS?|l{1,4}|L{1,4})/g,((t,s,i)=>{const a=i&&i.toUpperCase();return s||e[a]||o.dateFormats[a]}))}parseTwoDigitYear(t){return(t=+t)+(t>68?1900:2e3)}offsetFromString(t){if(!t)return 0;if("Z"===t)return 0;const[e,s,i]=t.match(/([+-]|\d\d)/g),o=60*s+(+i||0);return 0===o?0:"+"===e?-o:o}zoneInformation(t,e){let s=t.parts(this.localization.locale,{timeZoneName:"longOffset"}).timeZoneName.replace("GMT","").replace(":","");const i=s.includes("-");return s=s.replace("-",""),"z"===e?s=s.substring(1,2):"zz"===e&&(s=s.substring(0,2)),`${i?"-":""}${s}`}addInput(t){return(e,s)=>{e[t]=+s}}meridiemMatch(t){const e=new Intl.DateTimeFormat(this.localization.locale,{hour:"numeric",hour12:!0}).formatToParts(new Date(2022,3,4,13)).find((t=>"dayPeriod"===t.type))?.value;return t.toLowerCase()===e.toLowerCase()}correctHours(t){const{afternoon:e}=t;if(void 0!==e){const{hours:s}=t;e?s<12&&(t.hours+=12):12===s&&(t.hours=0),delete t.afternoon}}makeParser(t){const e=(t=this.replaceTokens(t,this.localization.dateFormats)).match(this.formattingTokens),{length:s}=e;for(let t=0;t{const i={hours:0,minutes:0,seconds:0,milliseconds:0};for(let o=0,a=0;o-1)return new d(("X"===e.format?1e3:1)*+t);const i=s.makeParser(e.format),{year:o,month:a,day:n,hours:r,minutes:l,seconds:c,milliseconds:h,zone:p}=i(t),u=n||(o||a?1:s.getDate()),m=o||s.getFullYear();let y=0;return o&&!a||(y=a>0?a-1:s.getMonth()),p?new d(Date.UTC(m,y,u,r,l,c,h+60*p.offset*1e3)):new d(m,y,u,r,l,c,h)}catch(i){s.errorMessages.customDateFormatError(`Unable to parse provided input: ${t}, format: ${e.format}`)}}format(t,e=this.localization.locale){if(t&&"object"==typeof t)return new Intl.DateTimeFormat(e,t).format(this);const s=this.replaceTokens(t||this.localization.format||`${o.dateFormats.L}, ${o.dateFormats.LT}`,this.localization.dateFormats),i=t=>new Intl.DateTimeFormat(this.localization.locale,t).format(this);this.localization.hourCycle||(this.localization.hourCycle=r(this.localization.locale));const a=this.localization.hourCycle.startsWith("h1")?"h24":this.localization.hourCycle,n=this.localization.hourCycle.startsWith("h2")?"h12":this.localization.hourCycle,d={yy:i({year:"2-digit"}),yyyy:this.year,M:i({month:"numeric"}),MM:this.monthFormatted,MMM:this.getAllMonths("short")[this.getMonth()],MMMM:this.getAllMonths()[this.getMonth()],d:this.date,dd:this.dateFormatted,ddd:i({weekday:"short"}),dddd:i({weekday:"long"}),H:this.getHours(),HH:this.getHoursFormatted(a),h:this.hours>12?this.hours-12:this.hours,hh:this.getHoursFormatted(n),t:this.meridiem(),T:this.meridiem().toUpperCase(),m:this.minutes,mm:this.minutesFormatted,s:this.seconds,ss:this.secondsFormatted,fff:this.getMilliseconds()};return s.replace(this.dateTimeRegex,((t,e)=>e||d[t])).replace(/\[/g,"").replace(/]/g,"")}}class l{constructor(){this.cache=new Map}locate(t){const e=this.cache.get(t);if(e)return e;const s=new t;return this.cache.set(t,s),s}}let c;const h=[{name:"calendar",className:s.css.daysContainer,unit:i.month,step:1},{name:"months",className:s.css.monthsContainer,unit:i.year,step:1},{name:"years",className:s.css.yearsContainer,unit:i.year,step:10},{name:"decades",className:s.css.decadesContainer,unit:i.year,step:100}];class p{constructor(){this._currentCalendarViewMode=0,this._viewDate=new d,this.minimumCalendarViewMode=0,this.currentView="calendar"}get currentCalendarViewMode(){return this._currentCalendarViewMode}set currentCalendarViewMode(t){this._currentCalendarViewMode=t,this.currentView=h[t].name}get viewDate(){return this._viewDate}set viewDate(t){this._viewDate=t,this.options&&(this.options.viewDate=t)}refreshCurrentView(){this.currentView=h[this.currentCalendarViewMode].name}get isTwelveHour(){return["h12","h11"].includes(this.options.localization.hourCycle)}}class u{constructor(){this.optionsStore=c.locate(p)}isValid(t,e){if(!this._enabledDisabledDatesIsValid(e,t))return!1;if(e!==i.month&&e!==i.year&&this.optionsStore.options.restrictions.daysOfWeekDisabled?.length>0&&-1!==this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(t.weekDay))return!1;if(!this._minMaxIsValid(e,t))return!1;if(e===i.hours||e===i.minutes||e===i.seconds){if(!this._enabledDisabledHoursIsValid(t))return!1;if(0!==this.optionsStore.options.restrictions.disabledTimeIntervals?.filter((e=>t.isBetween(e.from,e.to))).length)return!1}return!0}_enabledDisabledDatesIsValid(t,e){return t!==i.date||!(this.optionsStore.options.restrictions.disabledDates.length>0&&this._isInDisabledDates(e))&&!(this.optionsStore.options.restrictions.enabledDates.length>0&&!this._isInEnabledDates(e))}_isInDisabledDates(t){return!(!this.optionsStore.options.restrictions.disabledDates||0===this.optionsStore.options.restrictions.disabledDates.length)&&!!this.optionsStore.options.restrictions.disabledDates.find((e=>e.isSame(t,i.date)))}_isInEnabledDates(t){return!this.optionsStore.options.restrictions.enabledDates||0===this.optionsStore.options.restrictions.enabledDates.length||!!this.optionsStore.options.restrictions.enabledDates.find((e=>e.isSame(t,i.date)))}_minMaxIsValid(t,e){return(!this.optionsStore.options.restrictions.minDate||!e.isBefore(this.optionsStore.options.restrictions.minDate,t))&&(!this.optionsStore.options.restrictions.maxDate||!e.isAfter(this.optionsStore.options.restrictions.maxDate,t))}_enabledDisabledHoursIsValid(t){return!(this.optionsStore.options.restrictions.disabledHours.length>0&&this._isInDisabledHours(t))&&!(this.optionsStore.options.restrictions.enabledHours.length>0&&!this._isInEnabledHours(t))}_isInDisabledHours(t){if(!this.optionsStore.options.restrictions.disabledHours||0===this.optionsStore.options.restrictions.disabledHours.length)return!1;const e=t.hours;return this.optionsStore.options.restrictions.disabledHours.includes(e)}_isInEnabledHours(t){if(!this.optionsStore.options.restrictions.enabledHours||0===this.optionsStore.options.restrictions.enabledHours.length)return!0;const e=t.hours;return this.optionsStore.options.restrictions.enabledHours.includes(e)}dateRangeIsValid(t,e,s){if(!this.optionsStore.options.dateRange)return!0;if(2!==t.length&&1!==e)return!0;const o=t[0];if(o.isSame(s,i.date))return!0;for(o.clone.manipulate(1,i.date);!o.isSame(s,i.date);){if(!this.isValid(o,i.date))return!1;o.manipulate(1,i.date)}return!0}}class m{constructor(){this.subscribers=[]}subscribe(t){return this.subscribers.push(t),this.unsubscribe.bind(this,this.subscribers.length-1)}unsubscribe(t){this.subscribers.splice(t,1)}emit(t){this.subscribers.forEach((e=>{e(t)}))}destroy(){this.subscribers=null,this.subscribers=[]}}class y{constructor(){this.triggerEvent=new m,this.viewUpdate=new m,this.updateDisplay=new m,this.action=new m,this.updateViewDate=new m}destroy(){this.triggerEvent.destroy(),this.viewUpdate.destroy(),this.updateDisplay.destroy(),this.action.destroy(),this.updateViewDate.destroy()}}const g={clear:"Clear selection",close:"Close the picker",dateFormats:o.dateFormats,dayViewHeaderFormat:{month:"long",year:"2-digit"},decrementHour:"Decrement Hour",decrementMinute:"Decrement Minute",decrementSecond:"Decrement Second",format:o.format,hourCycle:o.hourCycle,incrementHour:"Increment Hour",incrementMinute:"Increment Minute",incrementSecond:"Increment Second",locale:o.locale,nextCentury:"Next Century",nextDecade:"Next Decade",nextMonth:"Next Month",nextYear:"Next Year",ordinal:o.ordinal,pickHour:"Pick Hour",pickMinute:"Pick Minute",pickSecond:"Pick Second",previousCentury:"Previous Century",previousDecade:"Previous Decade",previousMonth:"Previous Month",previousYear:"Previous Year",selectDate:"Select Date",selectDecade:"Select Decade",selectMonth:"Select Month",selectTime:"Select Time",selectYear:"Select Year",startOfTheWeek:0,today:"Go to today",toggleMeridiem:"Toggle Meridiem"},v={allowInputToggle:!1,container:void 0,dateRange:!1,debug:!1,defaultDate:void 0,display:{icons:{type:"icons",time:"fa-solid fa-clock",date:"fa-solid fa-calendar",up:"fa-solid fa-arrow-up",down:"fa-solid fa-arrow-down",previous:"fa-solid fa-chevron-left",next:"fa-solid fa-chevron-right",today:"fa-solid fa-calendar-check",clear:"fa-solid fa-trash",close:"fa-solid fa-xmark"},sideBySide:!1,calendarWeeks:!1,viewMode:"calendar",toolbarPlacement:"bottom",keepOpen:!1,buttons:{today:!1,clear:!1,close:!1},components:{calendar:!0,date:!0,month:!0,year:!0,decades:!0,clock:!0,hours:!0,minutes:!0,seconds:!1,useTwentyfourHour:void 0},inline:!1,theme:"auto",placement:"bottom"},keepInvalid:!1,localization:g,meta:{},multipleDates:!1,multipleDatesSeparator:"; ",promptTimeOnDateChange:!1,promptTimeOnDateChangeTransitionDelay:200,restrictions:{minDate:void 0,maxDate:void 0,disabledDates:[],enabledDates:[],daysOfWeekDisabled:[],disabledTimeIntervals:[],disabledHours:[],enabledHours:[]},stepping:1,useCurrent:!0,viewDate:new d},S={...g};function f(t,e){if(!t)return null;if(t.constructor.name===d.name)return t;if(t.constructor.name===Date.name)return d.convert(t);if("string"==typeof t){const s=d.fromString(t,e);return"null"===JSON.stringify(s)?null:s}return null}function w(t,e,i){"string"==typeof t&&"input"!==e&&s.errorMessages.dateString();const o=f(t,i);return o||s.errorMessages.failedToParseDate(e,t,"input"===e),o}function b(t,e,i,a){Array.isArray(e)||s.errorMessages.typeMismatch(t,i,"array of DateTime or Date");for(let i=0;i"number"!=typeof t))||s.errorMessages.typeMismatch(t,i,"array of numbers")}function _(t){return({value:e,providedType:i,localization:o})=>{const a=w(e,t,o);if(void 0!==a)return a.setLocalization(o),a;s.errorMessages.typeMismatch(t,i,"DateTime or Date")}}function k(t){const e=_(t);return t=>void 0===t.value?t.value:e(t)}function C(t,e,i){return({value:o,providedType:a})=>void 0===o?[]:(D(t,o,a),o.some((t=>ti))&&s.errorMessages.numbersOutOfRange(t,e,i),o)}function M(t){return C(t,0,23)}function E(t){return({value:e,providedType:s,localization:i})=>void 0===e?[]:(b(t,e,s,i),e)}function T(t){return({value:e,path:i})=>(t.includes(e)||s.errorMessages.unexpectedOptionValue(i.substring(1),e,t),e)}const L=Object.freeze({defaultDate:_("defaultDate"),viewDate:_("viewDate"),minDate:k("restrictions.minDate"),maxDate:k("restrictions.maxDate"),disabledHours:M("restrictions.disabledHours"),enabledHours:M("restrictions.enabledHours"),disabledDates:E("restrictions.disabledDates"),enabledDates:E("restrictions.enabledDates"),daysOfWeekDisabled:C("restrictions.daysOfWeekDisabled",0,6),disabledTimeIntervals:({key:t,value:e,providedType:i,localization:o})=>{if(void 0===e)return[];Array.isArray(e)||s.errorMessages.typeMismatch(t,i,"array of { from: DateTime|Date, to: DateTime|Date }");const a=e;for(let e=0;e{const n=`${t}[${e}].${i}`,r=a[e][i],d=w(r,n,o);d||s.errorMessages.typeMismatch(n,typeof r,"DateTime or Date"),d.setLocalization(o),a[e][i]=d}));return a},toolbarPlacement:T(["top","bottom","default"]),type:T(["icons","sprites"]),viewMode:T(["clock","calendar","months","years","decades"]),theme:T(["light","dark","auto"]),placement:T(["top","bottom"]),meta:({value:t})=>t,dayViewHeaderFormat:({value:t})=>t,container:({value:t,path:e})=>(t&&!(t instanceof HTMLElement||t instanceof Element||t?.appendChild)&&s.errorMessages.typeMismatch(e.substring(1),typeof t,"HTMLElement"),t),useTwentyfourHour:({value:t,path:e,providedType:i,defaultType:o})=>{if(s.errorMessages.deprecatedWarning("useTwentyfourHour",'Please use "options.localization.hourCycle" instead'),void 0===t||"boolean"===i)return t;s.errorMessages.typeMismatch(e,i,o)},hourCycle:T(["h11","h12","h23","h24"])}),A=({value:t,defaultType:e,providedType:i,path:o})=>{switch(e){case"boolean":return"true"===t||!0===t;case"number":return+t;case"string":return t.toString();case"object":return{};case"function":return t;default:s.errorMessages.typeMismatch(o,i,e)}};class V{static deepCopy(t){const e={};return Object.keys(t).forEach((s=>{const i=t[s];i instanceof d?e[s]=i.clone:i instanceof Date?e[s]=new Date(i.valueOf()):(e[s]=i,"object"!=typeof i||i instanceof HTMLElement||i instanceof Element||Array.isArray(i)||(e[s]=V.deepCopy(i)))})),e}static objectPath(t,e){return"."===t.charAt(0)&&(t=t.slice(1)),t?t.split(".").reduce(((t,e)=>V.isValue(t)||V.isValue(t[e])?t[e]:void 0),e):e}static spread(t,e,i,o=""){const a=V.objectPath(o,v),n=Object.keys(t).filter((t=>!Object.keys(a).includes(t)));if(n.length>0){const t=V.getFlattenDefaultOptions(),e=n.map((e=>{let s=`"${o}.${e}" in not a known option.`;const i=t.find((t=>t.includes(e)));return i&&(s+=` Did you mean "${i}"?`),s}));s.errorMessages.unexpectedOptions(e)}Object.keys(t).filter((t=>"__proto__"!==t&&"constructor"!==t)).forEach((s=>{"."===(o+=`.${s}`).charAt(0)&&(o=o.slice(1));const n=a[s],r=typeof t[s],d=typeof n,l=t[s];if(null==l)return e[s]=l,void(o=o.substring(0,o.lastIndexOf(`.${s}`)));"object"!=typeof n||Array.isArray(t[s])||n instanceof Date||V.ignoreProperties.includes(s)?e[s]=V.processKey(s,l,r,d,o,i):V.spread(t[s],e[s],i,o),o=o.substring(0,o.lastIndexOf(`.${s}`))}))}static processKey(t,e,s,i,o,a){return(L[(n={key:t,value:e,providedType:s,defaultType:i,path:o,localization:a}).key]||A)(n);var n}static _mergeOptions(t,e){const s=V.deepCopy(e),i="default"!==e.localization?.locale?e.localization:t?.localization||v.localization;return V.spread(t,s,i,""),s}static _dataToOptions(t,e){const i=JSON.parse(JSON.stringify(t.dataset));if(i?.tdTargetInput&&delete i.tdTargetInput,i?.tdTargetToggle&&delete i.tdTargetToggle,!i||0===Object.keys(i).length||i.constructor!==DOMStringMap)return e;const o={},a=t=>{const e={};return Object.keys(t).forEach((t=>{e[t.toLowerCase()]=t})),e},n=this.normalizeObject(a),r=a(e);return Object.keys(i).filter((t=>t.startsWith(s.dataKey))).map((t=>t.substring(2))).forEach((t=>{let s=r[t.toLowerCase()];if(t.includes("_")){const a=t.split("_");s=r[a[0].toLowerCase()],void 0!==s&&e[s].constructor===Object&&(o[s]=n(a,1,e[s],i[`td${t}`]))}else void 0!==s&&(o[s]=i[`td${t}`])})),this._mergeOptions(o,e)}static normalizeObject(t){const e=(s,i,o,a)=>{const n=t(o)[s[i].toLowerCase()],r={};return void 0===n||(o[n].constructor===Object?(i++,r[n]=e(s,i,o[n],a)):r[n]=a),r};return e}static _dateTypeCheck(t,e){return f(t,e)}static _typeCheckDateArray(t,e,s,i){return b(t,e,s,i)}static _typeCheckNumberArray(t,e,s){return D(t,e,s)}static dateConversion(t,e,s){return w(t,e,s)}static getFlattenDefaultOptions(){if(this._flattenDefaults)return this._flattenDefaults;const t=(e,s=[])=>Array.isArray(e)?[]:Object(e)===e?Object.entries(e).flatMap((([e,i])=>t(i,[...s,e]))):s.join(".");return this._flattenDefaults=t(v),this._flattenDefaults}static _validateConflicts(t){!t.display.sideBySide||t.display.components.clock&&(t.display.components.hours||t.display.components.minutes||t.display.components.seconds)||s.errorMessages.conflictingConfiguration("Cannot use side by side mode without the clock components"),t.restrictions.minDate&&t.restrictions.maxDate&&(t.restrictions.minDate.isAfter(t.restrictions.maxDate)&&s.errorMessages.conflictingConfiguration("minDate is after maxDate"),t.restrictions.maxDate.isBefore(t.restrictions.minDate)&&s.errorMessages.conflictingConfiguration("maxDate is before minDate")),t.multipleDates&&t.dateRange&&s.errorMessages.conflictingConfiguration('Cannot uss option "multipleDates" with "dateRange"')}}V.ignoreProperties=["meta","dayViewHeaderFormat","container","dateForms","ordinal"],V.isValue=t=>null!=t;class ${constructor(){this._dates=[],this.optionsStore=c.locate(p),this.validation=c.locate(u),this._eventEmitters=c.locate(y)}get picked(){return this._dates}get lastPicked(){return this._dates[this.lastPickedIndex]}get lastPickedIndex(){return 0===this._dates.length?0:this._dates.length-1}formatInput(t){return t?(t.localization=this.optionsStore.options.localization,t.format()):""}parseInput(t){return V.dateConversion(t,"input",this.optionsStore.options.localization)}setFromInput(t,e){if(!t)return void this.setValue(void 0,e);const s=this.parseInput(t);s&&(s.setLocalization(this.optionsStore.options.localization),this.setValue(s,e))}add(t){this._dates.push(t)}isPicked(t,e){if(!d.isValid(t))return!1;if(!e)return void 0!==this._dates.find((e=>e.isSame(t)));const s=n(e),i=t.format(s);return void 0!==this._dates.map((t=>t.format(s))).find((t=>t===i))}pickedIndex(t,e){if(!d.isValid(t))return-1;if(!e)return this._dates.map((t=>t.valueOf())).indexOf(t.valueOf());const s=n(e),i=t.format(s);return this._dates.map((t=>t.format(s))).indexOf(i)}clear(){this.optionsStore.unset=!0,this._eventEmitters.triggerEvent.emit({type:s.events.change,date:void 0,oldDate:this.lastPicked,isClear:!0,isValid:!0}),this._dates=[],this.optionsStore.input&&(this.optionsStore.input.value=""),this._eventEmitters.updateDisplay.emit("all")}static getStartEndYear(t,e){const s=t/10,i=Math.floor(e/t)*t;return[i,i+9*s,Math.floor(e/s)*s]}updateInput(t){if(!this.optionsStore.input)return;let e=this.formatInput(t);(this.optionsStore.options.multipleDates||this.optionsStore.options.dateRange)&&(e=this._dates.map((t=>this.formatInput(t))).join(this.optionsStore.options.multipleDatesSeparator)),this.optionsStore.input.value!=e&&(this.optionsStore.input.value=e)}setValue(t,e){const o=void 0===e,a=!t&&o;let n=this.optionsStore.unset?null:this._dates[e];if(!n&&!this.optionsStore.unset&&o&&a&&(n=this.lastPicked),t&&n?.isSame(t))return void this.updateInput(t);if(!t)return void this._setValueNull(a,e,n);e=e||0,t=t.clone,1!==this.optionsStore.options.stepping&&(t.minutes=Math.round(t.minutes/this.optionsStore.options.stepping)*this.optionsStore.options.stepping,t.startOf(i.minutes));const r=i=>{this._dates[e]=t,this._eventEmitters.updateViewDate.emit(t.clone),this.updateInput(t),this.optionsStore.unset=!1,this._eventEmitters.updateDisplay.emit("all"),this._eventEmitters.triggerEvent.emit({type:s.events.change,date:t,oldDate:n,isClear:a,isValid:i})};this.validation.isValid(t)&&this.validation.dateRangeIsValid(this._dates,e,t)?r(!0):(this.optionsStore.options.keepInvalid&&r(!1),this._eventEmitters.triggerEvent.emit({type:s.events.error,reason:s.errorMessages.failedToSetInvalidDate,date:t,oldDate:n}))}_setValueNull(t,e,i){!this.optionsStore.options.multipleDates||1===this._dates.length||t?(this.optionsStore.unset=!0,this._dates=[]):this._dates.splice(e,1),this.updateInput(),this._eventEmitters.triggerEvent.emit({type:s.events.change,date:void 0,oldDate:i,isClear:t,isValid:!0}),this._eventEmitters.updateDisplay.emit("all")}}var H;!function(t){t.next="next",t.previous="previous",t.changeCalendarView="changeCalendarView",t.selectMonth="selectMonth",t.selectYear="selectYear",t.selectDecade="selectDecade",t.selectDay="selectDay",t.selectHour="selectHour",t.selectMinute="selectMinute",t.selectSecond="selectSecond",t.incrementHours="incrementHours",t.incrementMinutes="incrementMinutes",t.incrementSeconds="incrementSeconds",t.decrementHours="decrementHours",t.decrementMinutes="decrementMinutes",t.decrementSeconds="decrementSeconds",t.toggleMeridiem="toggleMeridiem",t.togglePicker="togglePicker",t.showClock="showClock",t.showHours="showHours",t.showMinutes="showMinutes",t.showSeconds="showSeconds",t.clear="clear",t.close="close",t.today="today"}(H||(H={}));var O=H;class z{constructor(){this.optionsStore=c.locate(p),this.dates=c.locate($),this.validation=c.locate(u)}getPicker(){const t=document.createElement("div");if(t.classList.add(s.css.daysContainer),t.append(...this._daysOfTheWeek()),this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(s.css.calendarWeeks,s.css.noHighlight),t.appendChild(e)}const{rangeHoverEvent:e,rangeHoverOutEvent:i}=this.handleMouseEvents(t);for(let o=0;o<42;o++){if(0!==o&&o%7==0&&this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(s.css.calendarWeeks,s.css.noHighlight),t.appendChild(e)}const a=document.createElement("div");a.setAttribute("data-action",O.selectDay),t.appendChild(a),matchMedia("(hover: hover)").matches&&this.optionsStore.options.dateRange&&(a.addEventListener("mouseover",e),a.addEventListener("mouseout",i))}return t}_update(t,e){const o=t.getElementsByClassName(s.css.daysContainer)[0];this._updateCalendarView(o);const a=this.optionsStore.viewDate.clone.startOf(i.month).startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).manipulate(12,i.hours);this._handleCalendarWeeks(o,a.clone),o.querySelectorAll(`[data-action="${O.selectDay}"]`).forEach((t=>{const o=[];o.push(s.css.day),a.isBefore(this.optionsStore.viewDate,i.month)&&o.push(s.css.old),a.isAfter(this.optionsStore.viewDate,i.month)&&o.push(s.css.new),this.optionsStore.unset||this.optionsStore.options.multipleDates||!this.dates.isPicked(a,i.date)||o.push(s.css.active),this.validation.isValid(a,i.date)||o.push(s.css.disabled),a.isSame(new d,i.date)&&o.push(s.css.today),0!==a.weekDay&&6!==a.weekDay||o.push(s.css.weekend),this._handleDateRange(a,o),e(i.date,a,o,t),t.classList.remove(...t.classList),t.classList.add(...o),t.setAttribute("data-value",this._dateToDataValue(a)),t.setAttribute("data-day",`${a.date}`),t.innerText=a.parts(void 0,{day:"numeric"}).day,a.manipulate(1,i.date)}))}_dateToDataValue(t){return d.isValid(t)?`${t.year}-${t.monthFormatted}-${t.dateFormatted}`:""}_handleDateRange(t,e){const o=this.dates.picked[0],a=this.dates.picked[1];this.optionsStore.options.dateRange&&(t.isBetween(o,a,i.date)&&e.push(s.css.rangeIn),t.isSame(o,i.date)&&e.push(s.css.rangeStart),t.isSame(a,i.date)&&e.push(s.css.rangeEnd))}handleMouseEvents(t){return{rangeHoverEvent:e=>{const o=e?.currentTarget;if(1!==this.dates.picked.length||o.classList.contains(s.css.disabled))return;const a=[...t.querySelectorAll(".day")],n=o.getAttribute("data-value"),r=d.fromString(n,{format:"yyyy-MM-dd"}),l=a.findIndex((t=>t.getAttribute("data-value")===n)),c=this.dates.picked[0],h=this.dates.picked[1],p=this._dateToDataValue(c),u=a.findIndex((t=>t.getAttribute("data-value")===p)),m=a[u];let y;r.isSame(c,i.date)||o.classList.remove(s.css.rangeStart),r.isSame(h,i.date)||o.classList.remove(s.css.rangeEnd),r.isBefore(c)?(o.classList.add(s.css.rangeStart),m?.classList.remove(s.css.rangeStart),m?.classList.add(s.css.rangeEnd),y=(t,e)=>e>l&&eeu),a.filter(y).forEach((t=>{t.classList.add(s.css.rangeIn)}))},rangeHoverOutEvent:e=>{const o=[...t.querySelectorAll(".day")];if(1===this.dates.picked.length&&o.forEach((t=>t.classList.remove(s.css.rangeIn))),1!==this.dates.picked.length)return;const a=e?.currentTarget,n=new d(a.getAttribute("data-value"));n.isSame(this.dates.picked[0],i.date)||a.classList.remove(s.css.rangeStart),n.isSame(this.dates.picked[1],i.date)||a.classList.remove(s.css.rangeEnd)}}}_updateCalendarView(t){if("calendar"!==this.optionsStore.currentView)return;const[e,o,a]=t.parentElement.getElementsByClassName(s.css.calendarHeader)[0].getElementsByTagName("div");o.setAttribute(s.css.daysContainer,this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)),this.optionsStore.options.display.components.month?o.classList.remove(s.css.disabled):o.classList.add(s.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,i.month),i.month)?e.classList.remove(s.css.disabled):e.classList.add(s.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,i.month),i.month)?a.classList.remove(s.css.disabled):a.classList.add(s.css.disabled)}_daysOfTheWeek(){const t=this.optionsStore.viewDate.clone.startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).startOf(i.date),e=[];if(document.createElement("div"),this.optionsStore.options.display.calendarWeeks){const t=document.createElement("div");t.classList.add(s.css.calendarWeeks,s.css.noHighlight),t.innerText="#",e.push(t)}for(let o=0;o<7;o++){const o=document.createElement("div");o.classList.add(s.css.dayOfTheWeek,s.css.noHighlight),o.innerText=t.format({weekday:"short"}),t.manipulate(1,i.date),e.push(o)}return e}_handleCalendarWeeks(t,e){[...t.querySelectorAll(`.${s.css.calendarWeeks}`)].filter((t=>"#"!==t.innerText)).forEach((t=>{t.innerText=`${e.week}`,e.manipulate(7,i.date)}))}}class I{constructor(){this.optionsStore=c.locate(p),this.dates=c.locate($),this.validation=c.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(s.css.monthsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",O.selectMonth),t.appendChild(e)}return t}_update(t,e){const o=t.getElementsByClassName(s.css.monthsContainer)[0];if("months"===this.optionsStore.currentView){const[t,e,a]=o.parentElement.getElementsByClassName(s.css.calendarHeader)[0].getElementsByTagName("div");e.setAttribute(s.css.monthsContainer,this.optionsStore.viewDate.format({year:"numeric"})),this.optionsStore.options.display.components.year?e.classList.remove(s.css.disabled):e.classList.add(s.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,i.year),i.year)?t.classList.remove(s.css.disabled):t.classList.add(s.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,i.year),i.year)?a.classList.remove(s.css.disabled):a.classList.add(s.css.disabled)}const a=this.optionsStore.viewDate.clone.startOf(i.year);o.querySelectorAll(`[data-action="${O.selectMonth}"]`).forEach(((t,o)=>{const n=[];n.push(s.css.month),!this.optionsStore.unset&&this.dates.isPicked(a,i.month)&&n.push(s.css.active),this.validation.isValid(a,i.month)||n.push(s.css.disabled),e(i.month,a,n,t),t.classList.remove(...t.classList),t.classList.add(...n),t.setAttribute("data-value",`${o}`),t.innerText=`${a.format({month:"short"})}`,a.manipulate(1,i.month)}))}}class x{constructor(){this.optionsStore=c.locate(p),this.dates=c.locate($),this.validation=c.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(s.css.yearsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",O.selectYear),t.appendChild(e)}return t}_update(t,e){this._startYear=this.optionsStore.viewDate.clone.manipulate(-1,i.year),this._endYear=this.optionsStore.viewDate.clone.manipulate(10,i.year);const o=t.getElementsByClassName(s.css.yearsContainer)[0];if("years"===this.optionsStore.currentView){const[t,e,a]=o.parentElement.getElementsByClassName(s.css.calendarHeader)[0].getElementsByTagName("div");e.setAttribute(s.css.yearsContainer,`${this._startYear.format({year:"numeric"})}-${this._endYear.format({year:"numeric"})}`),this.optionsStore.options.display.components.decades?e.classList.remove(s.css.disabled):e.classList.add(s.css.disabled),this.validation.isValid(this._startYear,i.year)?t.classList.remove(s.css.disabled):t.classList.add(s.css.disabled),this.validation.isValid(this._endYear,i.year)?a.classList.remove(s.css.disabled):a.classList.add(s.css.disabled)}const a=this.optionsStore.viewDate.clone.startOf(i.year).manipulate(-1,i.year);o.querySelectorAll(`[data-action="${O.selectYear}"]`).forEach((t=>{const o=[];o.push(s.css.year),!this.optionsStore.unset&&this.dates.isPicked(a,i.year)&&o.push(s.css.active),this.validation.isValid(a,i.year)||o.push(s.css.disabled),e(i.year,a,o,t),t.classList.remove(...t.classList),t.classList.add(...o),t.setAttribute("data-value",`${a.year}`),t.innerText=a.format({year:"numeric"}),a.manipulate(1,i.year)}))}}class P{constructor(){this.optionsStore=c.locate(p),this.dates=c.locate($),this.validation=c.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(s.css.decadesContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",O.selectDecade),t.appendChild(e)}return t}_update(t,e){const[o,a]=$.getStartEndYear(100,this.optionsStore.viewDate.year);this._startDecade=this.optionsStore.viewDate.clone.startOf(i.year),this._startDecade.year=o,this._endDecade=this.optionsStore.viewDate.clone.startOf(i.year),this._endDecade.year=a;const n=t.getElementsByClassName(s.css.decadesContainer)[0],[r,d,l]=n.parentElement.getElementsByClassName(s.css.calendarHeader)[0].getElementsByTagName("div");"decades"===this.optionsStore.currentView&&(d.setAttribute(s.css.decadesContainer,`${this._startDecade.format({year:"numeric"})}-${this._endDecade.format({year:"numeric"})}`),this.validation.isValid(this._startDecade,i.year)?r.classList.remove(s.css.disabled):r.classList.add(s.css.disabled),this.validation.isValid(this._endDecade,i.year)?l.classList.remove(s.css.disabled):l.classList.add(s.css.disabled));const c=this.dates.picked.map((t=>t.year));n.querySelectorAll(`[data-action="${O.selectDecade}"]`).forEach(((t,o)=>{if(0===o)return t.classList.add(s.css.old),this._startDecade.year-10<0?(t.textContent=" ",r.classList.add(s.css.disabled),t.classList.add(s.css.disabled),void t.setAttribute("data-value","")):(t.innerText=this._startDecade.clone.manipulate(-10,i.year).format({year:"numeric"}),void t.setAttribute("data-value",`${this._startDecade.year}`));const a=[];a.push(s.css.decade);const n=this._startDecade.year,d=this._startDecade.year+9;!this.optionsStore.unset&&c.filter((t=>t>=n&&t<=d)).length>0&&a.push(s.css.active),e("decade",this._startDecade,a,t),t.classList.remove(...t.classList),t.classList.add(...a),t.setAttribute("data-value",`${this._startDecade.year}`),t.innerText=`${this._startDecade.format({year:"numeric"})}`,this._startDecade.manipulate(10,i.year)}))}}class N{constructor(){this._gridColumns="",this.optionsStore=c.locate(p),this.dates=c.locate($),this.validation=c.locate(u)}getPicker(t){const e=document.createElement("div");return e.classList.add(s.css.clockContainer),e.append(...this._grid(t)),e}_update(t){const e=t.getElementsByClassName(s.css.clockContainer)[0];let o=this.dates.lastPicked?.clone;if(!o&&this.optionsStore.options.useCurrent&&(o=this.optionsStore.viewDate.clone),e.querySelectorAll(".disabled").forEach((t=>t.classList.remove(s.css.disabled))),this.optionsStore.options.display.components.hours&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,i.hours),i.hours)||e.querySelector(`[data-action=${O.incrementHours}]`).classList.add(s.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,i.hours),i.hours)||e.querySelector(`[data-action=${O.decrementHours}]`).classList.add(s.css.disabled),e.querySelector(`[data-time-component=${i.hours}]`).innerText=o?o.getHoursFormatted(this.optionsStore.options.localization.hourCycle):"--"),this.optionsStore.options.display.components.minutes&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,i.minutes),i.minutes)||e.querySelector(`[data-action=${O.incrementMinutes}]`).classList.add(s.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,i.minutes),i.minutes)||e.querySelector(`[data-action=${O.decrementMinutes}]`).classList.add(s.css.disabled),e.querySelector(`[data-time-component=${i.minutes}]`).innerText=o?o.minutesFormatted:"--"),this.optionsStore.options.display.components.seconds&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,i.seconds),i.seconds)||e.querySelector(`[data-action=${O.incrementSeconds}]`).classList.add(s.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,i.seconds),i.seconds)||e.querySelector(`[data-action=${O.decrementSeconds}]`).classList.add(s.css.disabled),e.querySelector(`[data-time-component=${i.seconds}]`).innerText=o?o.secondsFormatted:"--"),this.optionsStore.isTwelveHour){const t=e.querySelector(`[data-action=${O.toggleMeridiem}]`),a=(o||this.optionsStore.viewDate).clone;t.innerText=a.meridiem(),this.validation.isValid(a.manipulate(a.hours>=12?-12:12,i.hours))?t.classList.remove(s.css.disabled):t.classList.add(s.css.disabled)}e.style.gridTemplateAreas=`"${this._gridColumns}"`}_grid(t){this._gridColumns="";const e=[],o=[],a=[],n=document.createElement("div"),r=t(this.optionsStore.options.display.icons.up),d=t(this.optionsStore.options.display.icons.down);n.classList.add(s.css.separator,s.css.noHighlight);const l=n.cloneNode(!0);l.innerHTML=":";const c=(t=!1)=>t?l.cloneNode(!0):n.cloneNode(!0);if(this.optionsStore.options.display.components.hours){let t=document.createElement("div");t.setAttribute("title",this.optionsStore.options.localization.incrementHour),t.setAttribute("data-action",O.incrementHours),t.appendChild(r.cloneNode(!0)),e.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.pickHour),t.setAttribute("data-action",O.showHours),t.setAttribute("data-time-component",i.hours),o.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.decrementHour),t.setAttribute("data-action",O.decrementHours),t.appendChild(d.cloneNode(!0)),a.push(t),this._gridColumns+="a"}if(this.optionsStore.options.display.components.minutes){this._gridColumns+=" a",this.optionsStore.options.display.components.hours&&(e.push(c()),o.push(c(!0)),a.push(c()),this._gridColumns+=" a");let t=document.createElement("div");t.setAttribute("title",this.optionsStore.options.localization.incrementMinute),t.setAttribute("data-action",O.incrementMinutes),t.appendChild(r.cloneNode(!0)),e.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.pickMinute),t.setAttribute("data-action",O.showMinutes),t.setAttribute("data-time-component",i.minutes),o.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.decrementMinute),t.setAttribute("data-action",O.decrementMinutes),t.appendChild(d.cloneNode(!0)),a.push(t)}if(this.optionsStore.options.display.components.seconds){this._gridColumns+=" a",this.optionsStore.options.display.components.minutes&&(e.push(c()),o.push(c(!0)),a.push(c()),this._gridColumns+=" a");let t=document.createElement("div");t.setAttribute("title",this.optionsStore.options.localization.incrementSecond),t.setAttribute("data-action",O.incrementSeconds),t.appendChild(r.cloneNode(!0)),e.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.pickSecond),t.setAttribute("data-action",O.showSeconds),t.setAttribute("data-time-component",i.seconds),o.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.decrementSecond),t.setAttribute("data-action",O.decrementSeconds),t.appendChild(d.cloneNode(!0)),a.push(t)}if(this.optionsStore.isTwelveHour){this._gridColumns+=" a";let t=c();e.push(t);const i=document.createElement("button");i.setAttribute("title",this.optionsStore.options.localization.toggleMeridiem),i.setAttribute("data-action",O.toggleMeridiem),i.setAttribute("tabindex","-1"),s.css.toggleMeridiem.includes(",")?i.classList.add(...s.css.toggleMeridiem.split(",")):i.classList.add(s.css.toggleMeridiem),t=document.createElement("div"),t.classList.add(s.css.noHighlight),t.appendChild(i),o.push(t),t=c(),a.push(t)}return this._gridColumns=this._gridColumns.trim(),[...e,...o,...a]}}class F{constructor(){this.optionsStore=c.locate(p),this.validation=c.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(s.css.hourContainer);for(let e=0;e<(this.optionsStore.isTwelveHour?12:24);e++){const e=document.createElement("div");e.setAttribute("data-action",O.selectHour),t.appendChild(e)}return t}_update(t,e){const o=t.getElementsByClassName(s.css.hourContainer)[0],a=this.optionsStore.viewDate.clone.startOf(i.date);o.querySelectorAll(`[data-action="${O.selectHour}"]`).forEach((t=>{const o=[];o.push(s.css.hour),this.validation.isValid(a,i.hours)||o.push(s.css.disabled),e(i.hours,a,o,t),t.classList.remove(...t.classList),t.classList.add(...o),t.setAttribute("data-value",`${a.hours}`),t.innerText=a.getHoursFormatted(this.optionsStore.options.localization.hourCycle),a.manipulate(1,i.hours)}))}}class B{constructor(){this.optionsStore=c.locate(p),this.validation=c.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(s.css.minuteContainer);const e=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;for(let s=0;s<60/e;s++){const e=document.createElement("div");e.setAttribute("data-action",O.selectMinute),t.appendChild(e)}return t}_update(t,e){const o=t.getElementsByClassName(s.css.minuteContainer)[0],a=this.optionsStore.viewDate.clone.startOf(i.hours),n=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;o.querySelectorAll(`[data-action="${O.selectMinute}"]`).forEach((t=>{const o=[];o.push(s.css.minute),this.validation.isValid(a,i.minutes)||o.push(s.css.disabled),e(i.minutes,a,o,t),t.classList.remove(...t.classList),t.classList.add(...o),t.setAttribute("data-value",`${a.minutes}`),t.innerText=a.minutesFormatted,a.manipulate(n,i.minutes)}))}}class W{constructor(){this.optionsStore=c.locate(p),this.validation=c.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(s.css.secondContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",O.selectSecond),t.appendChild(e)}return t}_update(t,e){const o=t.getElementsByClassName(s.css.secondContainer)[0],a=this.optionsStore.viewDate.clone.startOf(i.minutes);o.querySelectorAll(`[data-action="${O.selectSecond}"]`).forEach((t=>{const o=[];o.push(s.css.second),this.validation.isValid(a,i.seconds)||o.push(s.css.disabled),e(i.seconds,a,o,t),t.classList.remove(...t.classList),t.classList.add(...o),t.setAttribute("data-value",`${a.seconds}`),t.innerText=a.secondsFormatted,a.manipulate(5,i.seconds)}))}}class q{static toggle(t){t.classList.contains(s.css.show)?this.hide(t):this.show(t)}static showImmediately(t){t.classList.remove(s.css.collapsing),t.classList.add(s.css.collapse,s.css.show),t.style.height=""}static show(t){if(t.classList.contains(s.css.collapsing)||t.classList.contains(s.css.show))return;t.style.height="0",t.classList.remove(s.css.collapse),t.classList.add(s.css.collapsing),setTimeout((()=>{q.showImmediately(t)}),this.getTransitionDurationFromElement(t)),t.style.height=`${t.scrollHeight}px`}static hideImmediately(t){t&&(t.classList.remove(s.css.collapsing,s.css.show),t.classList.add(s.css.collapse))}static hide(t){if(t.classList.contains(s.css.collapsing)||!t.classList.contains(s.css.show))return;t.style.height=`${t.getBoundingClientRect().height}px`;t.offsetHeight,t.classList.remove(s.css.collapse,s.css.show),t.classList.add(s.css.collapsing),t.style.height="",setTimeout((()=>{q.hideImmediately(t)}),this.getTransitionDurationFromElement(t))}}q.getTransitionDurationFromElement=t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:s}=window.getComputedStyle(t);const i=Number.parseFloat(e),o=Number.parseFloat(s);return i||o?(e=e.split(",")[0],s=s.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(s))):0};class Y{constructor(){this._isVisible=!1,this._documentClickEvent=t=>{this.optionsStore.options.debug||window.debug||!this._isVisible||t.composedPath().includes(this.widget)||t.composedPath()?.includes(this.optionsStore.element)||this.hide()},this._actionsClickEvent=t=>{this._eventEmitters.action.emit({e:t})},this.optionsStore=c.locate(p),this.validation=c.locate(u),this.dates=c.locate($),this.dateDisplay=c.locate(z),this.monthDisplay=c.locate(I),this.yearDisplay=c.locate(x),this.decadeDisplay=c.locate(P),this.timeDisplay=c.locate(N),this.hourDisplay=c.locate(F),this.minuteDisplay=c.locate(B),this.secondDisplay=c.locate(W),this._eventEmitters=c.locate(y),this._widget=void 0,this._eventEmitters.updateDisplay.subscribe((t=>{this._update(t)}))}get widget(){return this._widget}get dateContainer(){return this.widget?.querySelector(`div.${s.css.dateContainer}`)}get timeContainer(){return this.widget?.querySelector(`div.${s.css.timeContainer}`)}get isVisible(){return this._isVisible}_update(t){if(this.widget)switch(t){case i.seconds:this.secondDisplay._update(this.widget,this.paint);break;case i.minutes:this.minuteDisplay._update(this.widget,this.paint);break;case i.hours:this.hourDisplay._update(this.widget,this.paint);break;case i.date:this.dateDisplay._update(this.widget,this.paint);break;case i.month:this.monthDisplay._update(this.widget,this.paint);break;case i.year:this.yearDisplay._update(this.widget,this.paint);break;case"clock":if(!this._hasTime)break;this.timeDisplay._update(this.widget),this._update(i.hours),this._update(i.minutes),this._update(i.seconds);break;case"calendar":this._update(i.date),this._update(i.year),this._update(i.month),this.decadeDisplay._update(this.widget,this.paint),this._updateCalendarHeader();break;case"all":this._hasTime&&this._update("clock"),this._hasDate&&this._update("calendar")}}paint(t,e,s,i){}show(){if(null==this.widget){if(this._showSetDefaultIfNeeded(),this._buildWidget(),this._updateTheme(),this._showSetupViewMode(),this.optionsStore.options.display.inline)this.optionsStore.element.appendChild(this.widget);else{const t=this.optionsStore.options?.container||document.body,e=this.optionsStore.options?.display?.placement||"bottom";t.appendChild(this.widget),this.createPopup(this.optionsStore.element,this.widget,{modifiers:[{name:"eventListeners",enabled:!0}],placement:"rtl"===document.documentElement.dir?`${e}-end`:`${e}-start`}).then()}"clock"==this.optionsStore.options.display.viewMode&&this._eventEmitters.action.emit({e:null,action:O.showClock}),this.widget.querySelectorAll("[data-action]").forEach((t=>t.addEventListener("click",this._actionsClickEvent))),this._hasTime&&this.optionsStore.options.display.sideBySide&&(this.timeDisplay._update(this.widget),this.widget.getElementsByClassName(s.css.clockContainer)[0].style.display="grid")}this.widget.classList.add(s.css.show),this.optionsStore.options.display.inline||(this.updatePopup(),document.addEventListener("click",this._documentClickEvent)),this._eventEmitters.triggerEvent.emit({type:s.events.show}),this._isVisible=!0}_showSetupViewMode(){const t=this._hasTime&&!this._hasDate;t?(this.optionsStore.currentView="clock",this._eventEmitters.action.emit({e:null,action:O.showClock})):this.optionsStore.currentCalendarViewMode||(this.optionsStore.currentCalendarViewMode=this.optionsStore.minimumCalendarViewMode),t||"clock"===this.optionsStore.options.display.viewMode||(this._hasTime&&(this.optionsStore.options.display.sideBySide?q.show(this.timeContainer):q.hideImmediately(this.timeContainer)),q.show(this.dateContainer)),this._hasDate&&this._showMode()}_showSetDefaultIfNeeded(){if(0==this.dates.picked.length){if(this.optionsStore.options.useCurrent&&!this.optionsStore.options.defaultDate){const t=(new d).setLocalization(this.optionsStore.options.localization);if(!this.optionsStore.options.keepInvalid){let e=0,s=1;for(this.optionsStore.options.restrictions.maxDate?.isBefore(t)&&(s=-1);!this.validation.isValid(t)&&e>31;)t.manipulate(s,i.date),e++}this.dates.setValue(t)}this.optionsStore.options.defaultDate&&this.dates.setValue(this.optionsStore.options.defaultDate)}}async createPopup(t,e,s){let i;if(window?.Popper)i=window?.Popper?.createPopper;else{const{createPopper:t}=await import("@popperjs/core");i=t}i&&(this._popperInstance=i(t,e,s))}updatePopup(){this._popperInstance?.update()}_showMode(t){if(!this.widget)return;if(t){const e=Math.max(this.optionsStore.minimumCalendarViewMode,Math.min(3,this.optionsStore.currentCalendarViewMode+t));if(this.optionsStore.currentCalendarViewMode==e)return;this.optionsStore.currentCalendarViewMode=e}this.widget.querySelectorAll(`.${s.css.dateContainer} > div:not(.${s.css.calendarHeader}), .${s.css.timeContainer} > div:not(.${s.css.clockContainer})`).forEach((t=>t.style.display="none"));const e=h[this.optionsStore.currentCalendarViewMode],i=this.widget.querySelector(`.${e.className}`);switch(e.className){case s.css.decadesContainer:this.decadeDisplay._update(this.widget,this.paint);break;case s.css.yearsContainer:this.yearDisplay._update(this.widget,this.paint);break;case s.css.monthsContainer:this.monthDisplay._update(this.widget,this.paint);break;case s.css.daysContainer:this.dateDisplay._update(this.widget,this.paint)}i.style.display="grid",this.optionsStore.options.display.sideBySide&&(this.widget.querySelectorAll(`.${s.css.clockContainer}`)[0].style.display="grid"),this._updateCalendarHeader(),this._eventEmitters.viewUpdate.emit()}_updateTheme(t){if(this.widget){if(t){if(this.optionsStore.options.display.theme===t)return;this.optionsStore.options.display.theme=t}this.widget.classList.remove("light","dark"),this.widget.classList.add(this._getThemeClass()),"auto"===this.optionsStore.options.display.theme?window.matchMedia(s.css.isDarkPreferredQuery).addEventListener("change",(()=>this._updateTheme())):window.matchMedia(s.css.isDarkPreferredQuery).removeEventListener("change",(()=>this._updateTheme()))}}_getThemeClass(){const t=this.optionsStore.options.display.theme||"auto",e=window.matchMedia&&window.matchMedia(s.css.isDarkPreferredQuery).matches;switch(t){case"light":return s.css.lightTheme;case"dark":return s.css.darkTheme;case"auto":return e?s.css.darkTheme:s.css.lightTheme}}_updateCalendarHeader(){if(!this._hasDate)return;const t=[...this.widget.querySelector(`.${s.css.dateContainer} div[style*="display: grid"]`).classList].find((t=>t.startsWith(s.css.dateContainer))),[e,i,o]=this.widget.getElementsByClassName(s.css.calendarHeader)[0].getElementsByTagName("div");switch(t){case s.css.decadesContainer:e.setAttribute("title",this.optionsStore.options.localization.previousCentury),i.setAttribute("title",""),o.setAttribute("title",this.optionsStore.options.localization.nextCentury);break;case s.css.yearsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousDecade),i.setAttribute("title",this.optionsStore.options.localization.selectDecade),o.setAttribute("title",this.optionsStore.options.localization.nextDecade);break;case s.css.monthsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousYear),i.setAttribute("title",this.optionsStore.options.localization.selectYear),o.setAttribute("title",this.optionsStore.options.localization.nextYear);break;case s.css.daysContainer:e.setAttribute("title",this.optionsStore.options.localization.previousMonth),i.setAttribute("title",this.optionsStore.options.localization.selectMonth),o.setAttribute("title",this.optionsStore.options.localization.nextMonth),i.setAttribute(t,this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat))}i.innerText=i.getAttribute(t)}hide(){this.widget&&this._isVisible&&(this.widget.classList.remove(s.css.show),this._isVisible&&(this._eventEmitters.triggerEvent.emit({type:s.events.hide,date:this.optionsStore.unset?null:this.dates.lastPicked?.clone}),this._isVisible=!1),document.removeEventListener("click",this._documentClickEvent))}toggle(){return this._isVisible?this.hide():this.show()}_dispose(){document.removeEventListener("click",this._documentClickEvent),this.widget&&(this.widget.querySelectorAll("[data-action]").forEach((t=>t.removeEventListener("click",this._actionsClickEvent))),this.widget.parentNode.removeChild(this.widget),this._widget=void 0)}_buildWidget(){const t=document.createElement("div");t.classList.add(s.css.widget);const e=document.createElement("div");e.classList.add(s.css.dateContainer),e.append(this.getHeadTemplate(),this.decadeDisplay.getPicker(),this.yearDisplay.getPicker(),this.monthDisplay.getPicker(),this.dateDisplay.getPicker());const i=document.createElement("div");i.classList.add(s.css.timeContainer),i.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this))),i.appendChild(this.hourDisplay.getPicker()),i.appendChild(this.minuteDisplay.getPicker()),i.appendChild(this.secondDisplay.getPicker());const o=document.createElement("div");if(o.classList.add(s.css.toolbar),o.append(...this.getToolbarElements()),this.optionsStore.options.display.inline&&t.classList.add(s.css.inline),this.optionsStore.options.display.calendarWeeks&&t.classList.add("calendarWeeks"),this.optionsStore.options.display.sideBySide&&this._hasDateAndTime)return void this._buildWidgetSideBySide(t,e,i,o);"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(o);const a=(e,i,o,a)=>{e&&(i&&(o.classList.add(s.css.collapse),a&&o.classList.add(s.css.show)),t.appendChild(o))};a(this._hasDate,this._hasTime,e,"clock"!==this.optionsStore.options.display.viewMode),a(this._hasTime,this._hasDate,i,"clock"===this.optionsStore.options.display.viewMode),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(o);const n=document.createElement("div");n.classList.add("arrow"),n.setAttribute("data-popper-arrow",""),t.appendChild(n),this._widget=t}_buildWidgetSideBySide(t,e,i,o){t.classList.add(s.css.sideBySide),"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(o);const a=document.createElement("div");a.classList.add("td-row"),e.classList.add("td-half"),i.classList.add("td-half"),a.appendChild(e),a.appendChild(i),t.appendChild(a),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(o),this._widget=t}get _hasTime(){return this.optionsStore.options.display.components.clock&&(this.optionsStore.options.display.components.hours||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.components.seconds)}get _hasDate(){return this.optionsStore.options.display.components.calendar&&(this.optionsStore.options.display.components.year||this.optionsStore.options.display.components.month||this.optionsStore.options.display.components.date)}get _hasDateAndTime(){return this._hasDate&&this._hasTime}getToolbarElements(){const t=[];if(this.optionsStore.options.display.buttons.today){const e=document.createElement("div");e.setAttribute("data-action",O.today),e.setAttribute("title",this.optionsStore.options.localization.today),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.today)),t.push(e)}if(!this.optionsStore.options.display.sideBySide&&this._hasDate&&this._hasTime){let e,s;"clock"===this.optionsStore.options.display.viewMode?(e=this.optionsStore.options.localization.selectDate,s=this.optionsStore.options.display.icons.date):(e=this.optionsStore.options.localization.selectTime,s=this.optionsStore.options.display.icons.time);const i=document.createElement("div");i.setAttribute("data-action",O.togglePicker),i.setAttribute("title",e),i.appendChild(this._iconTag(s)),t.push(i)}if(this.optionsStore.options.display.buttons.clear){const e=document.createElement("div");e.setAttribute("data-action",O.clear),e.setAttribute("title",this.optionsStore.options.localization.clear),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.clear)),t.push(e)}if(this.optionsStore.options.display.buttons.close){const e=document.createElement("div");e.setAttribute("data-action",O.close),e.setAttribute("title",this.optionsStore.options.localization.close),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.close)),t.push(e)}return t}getHeadTemplate(){const t=document.createElement("div");t.classList.add(s.css.calendarHeader);const e=document.createElement("div");e.classList.add(s.css.previous),e.setAttribute("data-action",O.previous),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.previous));const i=document.createElement("div");i.classList.add(s.css.switch),i.setAttribute("data-action",O.changeCalendarView);const o=document.createElement("div");return o.classList.add(s.css.next),o.setAttribute("data-action",O.next),o.appendChild(this._iconTag(this.optionsStore.options.display.icons.next)),t.append(e,i,o),t}_iconTag(t){if("sprites"===this.optionsStore.options.display.icons.type){const e=document.createElementNS("http://www.w3.org/2000/svg","svg"),s=document.createElementNS("http://www.w3.org/2000/svg","use");return s.setAttribute("xlink:href",t),s.setAttribute("href",t),e.appendChild(s),e}const e=document.createElement("i");return e.classList.add(...t.split(" ")),e}_rebuild(){const t=this._isVisible;this._dispose(),t&&this.show()}}class j{constructor(){this.optionsStore=c.locate(p),this.dates=c.locate($),this.validation=c.locate(u),this.display=c.locate(Y),this._eventEmitters=c.locate(y),this._eventEmitters.action.subscribe((t=>{this.do(t.e,t.action)}))}do(t,e){const o=t?.currentTarget;if(o?.classList?.contains(s.css.disabled))return;e=e||o?.dataset?.action;const a=(this.dates.lastPicked||this.optionsStore.viewDate).clone;switch(e){case O.next:case O.previous:this.handleNextPrevious(e);break;case O.changeCalendarView:this.display._showMode(1),this.display._updateCalendarHeader();break;case O.selectMonth:case O.selectYear:case O.selectDecade:this.handleSelectCalendarMode(e,o);break;case O.selectDay:this.handleSelectDay(o);break;case O.selectHour:{let e=+o.dataset.value;a.hours>=12&&this.optionsStore.isTwelveHour&&(e+=12),a.hours=e,this.dates.setValue(a,this.dates.lastPickedIndex),this.hideOrClock(t);break}case O.selectMinute:a.minutes=+o.dataset.value,this.dates.setValue(a,this.dates.lastPickedIndex),this.hideOrClock(t);break;case O.selectSecond:a.seconds=+o.dataset.value,this.dates.setValue(a,this.dates.lastPickedIndex),this.hideOrClock(t);break;case O.incrementHours:this.manipulateAndSet(a,i.hours);break;case O.incrementMinutes:this.manipulateAndSet(a,i.minutes,this.optionsStore.options.stepping);break;case O.incrementSeconds:this.manipulateAndSet(a,i.seconds);break;case O.decrementHours:this.manipulateAndSet(a,i.hours,-1);break;case O.decrementMinutes:this.manipulateAndSet(a,i.minutes,-1*this.optionsStore.options.stepping);break;case O.decrementSeconds:this.manipulateAndSet(a,i.seconds,-1);break;case O.toggleMeridiem:this.manipulateAndSet(a,i.hours,this.dates.lastPicked.hours>=12?-12:12);break;case O.togglePicker:this.handleToggle(o);break;case O.showClock:case O.showHours:case O.showMinutes:case O.showSeconds:this.optionsStore.options.display.sideBySide||"clock"===this.optionsStore.currentView||(q.hideImmediately(this.display.dateContainer),q.showImmediately(this.display.timeContainer)),this.handleShowClockContainers(e);break;case O.clear:this.dates.setValue(null),this.display._updateCalendarHeader();break;case O.close:this.display.hide();break;case O.today:{const t=(new d).setLocalization(this.optionsStore.options.localization);this._eventEmitters.updateViewDate.emit(t),this.validation.isValid(t,i.date)&&this.dates.setValue(t,this.dates.lastPickedIndex);break}}}handleShowClockContainers(t){if(!this.display._hasTime)return void s.errorMessages.throwError("Cannot show clock containers when time is disabled.");this.optionsStore.currentView="clock",this.display.widget.querySelectorAll(`.${s.css.timeContainer} > div`).forEach((t=>t.style.display="none"));let e="";switch(t){case O.showClock:e=s.css.clockContainer,this.display._update("clock");break;case O.showHours:e=s.css.hourContainer,this.display._update(i.hours);break;case O.showMinutes:e=s.css.minuteContainer,this.display._update(i.minutes);break;case O.showSeconds:e=s.css.secondContainer,this.display._update(i.seconds)}this.display.widget.getElementsByClassName(e)[0].style.display="grid"}handleNextPrevious(t){const{unit:e,step:s}=h[this.optionsStore.currentCalendarViewMode];t===O.next?this.optionsStore.viewDate.manipulate(s,e):this.optionsStore.viewDate.manipulate(-1*s,e),this._eventEmitters.viewUpdate.emit(),this.display._showMode()}hideOrClock(t){this.optionsStore.isTwelveHour||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline?this.do(t,O.showClock):this.display.hide()}manipulateAndSet(t,e,s=1){const i=t.manipulate(s,e);this.validation.isValid(i,e)&&this.dates.setValue(i,this.dates.lastPickedIndex)}handleSelectCalendarMode(t,e){const s=+e.dataset.value;switch(t){case O.selectMonth:this.optionsStore.viewDate.month=s;break;case O.selectYear:case O.selectDecade:this.optionsStore.viewDate.year=s}this.optionsStore.currentCalendarViewMode===this.optionsStore.minimumCalendarViewMode?(this.dates.setValue(this.optionsStore.viewDate,this.dates.lastPickedIndex),this.optionsStore.options.display.inline||this.display.hide()):this.display._showMode(-1)}handleToggle(t){t.getAttribute("title")===this.optionsStore.options.localization.selectDate?(t.setAttribute("title",this.optionsStore.options.localization.selectTime),t.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.time).outerHTML,this.display._updateCalendarHeader(),this.optionsStore.refreshCurrentView()):(t.setAttribute("title",this.optionsStore.options.localization.selectDate),t.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.date).outerHTML,this.display._hasTime&&(this.handleShowClockContainers(O.showClock),this.display._update("clock"))),this.display.widget.querySelectorAll(`.${s.css.dateContainer}, .${s.css.timeContainer}`).forEach((t=>q.toggle(t))),this._eventEmitters.viewUpdate.emit()}handleSelectDay(t){const e=this.optionsStore.viewDate.clone;t.classList.contains(s.css.old)&&e.manipulate(-1,i.month),t.classList.contains(s.css.new)&&e.manipulate(1,i.month),e.date=+t.dataset.day,this.optionsStore.options.dateRange?this.handleDateRange(e):this.optionsStore.options.multipleDates?this.handleMultiDate(e):this.dates.setValue(e,this.dates.lastPickedIndex),this.display._hasTime||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline||this.optionsStore.options.multipleDates||this.optionsStore.options.dateRange||this.display.hide()}handleMultiDate(t){let e=this.dates.pickedIndex(t,i.date);console.log(e),-1!==e?this.dates.setValue(null,e):(e=this.dates.lastPickedIndex+1,0===this.dates.picked.length&&(e=0),this.dates.setValue(t,e))}handleDateRange(t){switch(this.dates.picked.length){case 2:this.dates.clear();break;case 1:{const e=this.dates.picked[0];if(t.getTime()===e.getTime()){this.dates.clear();break}return t.isBefore(e)?(this.dates.setValue(t,0),void this.dates.setValue(e,1)):void this.dates.setValue(t,1)}}this.dates.setValue(t,0)}}class U{constructor(t,e={}){this._subscribers={},this._isDisabled=!1,this._inputChangeEvent=t=>{const e=t?.detail;if(e)return;const s=()=>{this.dates.lastPicked&&(this.optionsStore.viewDate=this.dates.lastPicked.clone)},i=this.optionsStore.input.value;if(this.optionsStore.options.multipleDates)try{const t=i.split(this.optionsStore.options.multipleDatesSeparator);for(let e=0;e{this.optionsStore.element?.disabled||this.optionsStore.input?.disabled||this.toggle()},c=new l,this._eventEmitters=c.locate(y),this.optionsStore=c.locate(p),this.display=c.locate(Y),this.dates=c.locate($),this.actions=c.locate(j),t||s.errorMessages.mustProvideElement(),this.optionsStore.element=t,this._initializeOptions(e,v,!0),this.optionsStore.viewDate.setLocalization(this.optionsStore.options.localization),this.optionsStore.unset=!0,this._initializeInput(),this._initializeToggle(),this.optionsStore.options.display.inline&&this.display.show(),this._eventEmitters.triggerEvent.subscribe((t=>{this._triggerEvent(t)})),this._eventEmitters.viewUpdate.subscribe((()=>{this._viewUpdate()})),this._eventEmitters.updateViewDate.subscribe((t=>{this.viewDate=t}))}get viewDate(){return this.optionsStore.viewDate}set viewDate(t){this.optionsStore.viewDate=t,this.optionsStore.viewDate.setLocalization(this.optionsStore.options.localization),this.display._update("clock"===this.optionsStore.currentView?"clock":"calendar")}updateOptions(t,e=!1){e?this._initializeOptions(t,v):this._initializeOptions(t,this.optionsStore.options),this.optionsStore.viewDate.setLocalization(this.optionsStore.options.localization),this.display._rebuild()}toggle(){this._isDisabled||this.display.toggle()}show(){this._isDisabled||this.display.show()}hide(){this.display.hide()}disable(){this._isDisabled=!0,this.optionsStore.input?.setAttribute("disabled","disabled"),this.display.hide()}enable(){this._isDisabled=!1,this.optionsStore.input?.removeAttribute("disabled")}clear(){this.optionsStore.input.value="",this.dates.clear()}subscribe(t,e){let i;"string"==typeof t&&(t=[t]),i=Array.isArray(e)?e:[e],t.length!==i.length&&s.errorMessages.subscribeMismatch();const o=[];for(let e=0;e{e(t)}))}_viewUpdate(){this._triggerEvent({type:s.events.update,viewDate:this.optionsStore.viewDate.clone})}_unsubscribe(t,e){this._subscribers[t].splice(e,1)}_initializeOptions(t,e,s=!1){let i=V.deepCopy(t);i=V._mergeOptions(i,e),s&&(i=V._dataToOptions(this.optionsStore.element,i)),V._validateConflicts(i),i.viewDate=i.viewDate.setLocalization(i.localization),this.optionsStore.viewDate.isSame(i.viewDate)||(this.optionsStore.viewDate=i.viewDate),i.display.components.year&&(this.optionsStore.minimumCalendarViewMode=2),i.display.components.month&&(this.optionsStore.minimumCalendarViewMode=1),i.display.components.date&&(this.optionsStore.minimumCalendarViewMode=0),this.optionsStore.currentCalendarViewMode=Math.max(this.optionsStore.minimumCalendarViewMode,this.optionsStore.currentCalendarViewMode),h[this.optionsStore.currentCalendarViewMode].name!==i.display.viewMode&&(this.optionsStore.currentCalendarViewMode=Math.max(h.findIndex((t=>t.name===i.display.viewMode)),this.optionsStore.minimumCalendarViewMode)),this.display?.isVisible&&this.display._update("all"),i.display.components.useTwentyfourHour&&void 0===i.localization.hourCycle?i.localization.hourCycle="h24":void 0===i.localization.hourCycle&&(i.localization.hourCycle=r(i.localization.locale)),this.optionsStore.options=i}_initializeInput(){if("INPUT"==this.optionsStore.element.tagName)this.optionsStore.input=this.optionsStore.element;else{const t=this.optionsStore.element.dataset.tdTargetInput;this.optionsStore.input=null==t||"nearest"==t?this.optionsStore.element.querySelector("input"):this.optionsStore.element.querySelector(t)}this.optionsStore.input&&(!this.optionsStore.input.value&&this.optionsStore.options.defaultDate&&(this.optionsStore.input.value=this.dates.formatInput(this.optionsStore.options.defaultDate)),this.optionsStore.input.addEventListener("change",this._inputChangeEvent),this.optionsStore.options.allowInputToggle&&this.optionsStore.input.addEventListener("click",this._toggleClickEvent),this.optionsStore.input.value&&this._inputChangeEvent())}_initializeToggle(){if(this.optionsStore.options.display.inline)return;let t=this.optionsStore.element.dataset.tdTargetToggle;"nearest"==t&&(t='[data-td-toggle="datetimepicker"]'),this._toggle=null==t?this.optionsStore.element:this.optionsStore.element.querySelector(t),this._toggle.addEventListener("click",this._toggleClickEvent)}_handleAfterChangeEvent(t){!this.optionsStore.options.promptTimeOnDateChange||this.optionsStore.options.multipleDates||this.optionsStore.options.display.inline||this.optionsStore.options.display.sideBySide||!this.display._hasTime||this.display.widget?.getElementsByClassName(s.css.show)[0].classList.contains(s.css.timeContainer)||!t.oldDate&&this.optionsStore.options.useCurrent||t.oldDate&&t.date?.isSame(t.oldDate)||(clearTimeout(this._currentPromptTimeTimeout),this._currentPromptTimeTimeout=setTimeout((()=>{this.display.widget&&this._eventEmitters.action.emit({e:{currentTarget:this.display.widget.querySelector(`.${s.css.switch}`)},action:O.togglePicker})}),this.optionsStore.options.promptTimeOnDateChangeTransitionDelay))}}const R={},Q=t=>{R[t.name]||(R[t.name]=t.localization)},J=t=>{const e=R[t];e&&(v.localization=e)},K=function(t,e=undefined){return t?(t.installed||(t(e,{TempusDominus:U,Dates:$,Display:Y,DateTime:d,Namespace:s},G),t.installed=!0),G):G},Z="6.4.4",G={TempusDominus:U,extend:K,loadLocale:Q,locale:J,Namespace:s,DefaultOptions:v,DateTime:d,Unit:i,version:Z,DefaultEnLocalization:S};export{d as DateTime,S as DefaultEnLocalization,v as DefaultOptions,s as Namespace,U as TempusDominus,i as Unit,K as extend,Q as loadLocale,J as locale,Z as version}; +class t extends Error{}const e="tempus-dominus";class s{}s.NAME=e,s.dataKey="td",s.events=new class{constructor(){this.key=".td",this.change=`change${this.key}`,this.update=`update${this.key}`,this.error=`error${this.key}`,this.show=`show${this.key}`,this.hide=`hide${this.key}`,this.blur=`blur${this.key}`,this.focus=`focus${this.key}`,this.keyup=`keyup${this.key}`,this.keydown=`keydown${this.key}`}},s.css=new class{constructor(){this.widget=`${e}-widget`,this.calendarHeader="calendar-header",this.switch="picker-switch",this.toolbar="toolbar",this.noHighlight="no-highlight",this.sideBySide="timepicker-sbs",this.previous="previous",this.next="next",this.disabled="disabled",this.old="old",this.new="new",this.active="active",this.dateContainer="date-container",this.decadesContainer=`${this.dateContainer}-decades`,this.decade="decade",this.yearsContainer=`${this.dateContainer}-years`,this.year="year",this.monthsContainer=`${this.dateContainer}-months`,this.month="month",this.daysContainer=`${this.dateContainer}-days`,this.day="day",this.calendarWeeks="cw",this.dayOfTheWeek="dow",this.today="today",this.weekend="weekend",this.rangeIn="range-in",this.rangeStart="range-start",this.rangeEnd="range-end",this.timeContainer="time-container",this.separator="separator",this.clockContainer=`${this.timeContainer}-clock`,this.hourContainer=`${this.timeContainer}-hour`,this.minuteContainer=`${this.timeContainer}-minute`,this.secondContainer=`${this.timeContainer}-second`,this.hour="hour",this.minute="minute",this.second="second",this.toggleMeridiem="toggleMeridiem",this.show="show",this.collapsing="td-collapsing",this.collapse="td-collapse",this.inline="inline",this.lightTheme="light",this.darkTheme="dark",this.isDarkPreferredQuery="(prefers-color-scheme: dark)"}},s.errorMessages=new class{constructor(){this.base="TD:",this.failedToSetInvalidDate="Failed to set invalid date",this.failedToParseInput="Failed parse input field"}unexpectedOption(e){const s=new t(`${this.base} Unexpected option: ${e} does not match a known option.`);throw s.code=1,s}unexpectedOptions(e){const s=new t(`${this.base}: ${e.join(", ")}`);throw s.code=1,s}unexpectedOptionValue(e,s,i){const o=new t(`${this.base} Unexpected option value: ${e} does not accept a value of "${s}". Valid values are: ${i.join(", ")}`);throw o.code=2,o}typeMismatch(e,s,i){const o=new t(`${this.base} Mismatch types: ${e} has a type of ${s} instead of the required ${i}`);throw o.code=3,o}numbersOutOfRange(e,s,i){const o=new t(`${this.base} ${e} expected an array of number between ${s} and ${i}.`);throw o.code=4,o}failedToParseDate(e,s,i=!1){const o=new t(`${this.base} Could not correctly parse "${s}" to a date for ${e}.`);if(o.code=5,!i)throw o;console.warn(o)}mustProvideElement(){const e=new t(`${this.base} No element was provided.`);throw e.code=6,e}subscribeMismatch(){const e=new t(`${this.base} The subscribed events does not match the number of callbacks`);throw e.code=7,e}conflictingConfiguration(e){const s=new t(`${this.base} A configuration value conflicts with another rule. ${e}`);throw s.code=8,s}customDateFormatError(e){const s=new t(`${this.base} Custom Date Format: ${e}`);throw s.code=9,s}dateString(){console.warn(`${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`)}deprecatedWarning(t,e){console.warn(`${this.base} Warning ${t} is deprecated and will be removed in a future version. ${e}`)}throwError(e){const s=new t(`${this.base} ${e}`);throw s.code=9,s}};var i,o={...{locale:"default",hourCycle:void 0,dateFormats:{LTS:"h:mm:ss T",LT:"h:mm T",L:"MM/dd/yyyy",LL:"MMMM d, yyyy",LLL:"MMMM d, yyyy h:mm T",LLLL:"dddd, MMMM d, yyyy h:mm T"},ordinal:t=>{const e=["th","st","nd","rd"],s=t%100;return`[${t}${e[(s-20)%10]||e[s]||e[0]}]`},format:"L LT"}};!function(t){t.seconds="seconds",t.minutes="minutes",t.hours="hours",t.date="date",t.month="month",t.year="year"}(i||(i={}));const a={month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"},n=t=>{switch(t){case"date":return{dateStyle:"short"};case"month":return{month:"numeric",year:"numeric"};case"year":return{year:"numeric"}}},r=t=>{if(!t)return"h12";const e={hour:"2-digit",minute:"2-digit",numberingSystem:"latn"},s=(new d).setLocalization({locale:t});s.hours=0;const i=s.parts(void 0,e).hour;if("12"===i)return"h12";if("24"===i)return"h24";s.hours=23;const o=s.parts(void 0,e).hour;return"00"===i&&"11"===o?"h11":"00"===i&&"23"===o?"h23":void console.warn(`couldn't determine hour cycle for ${t}. start: ${i}. end: ${o}`)};class d extends Date{constructor(){super(...arguments),this.localization=o,this.nonLeapLadder=[0,31,59,90,120,151,181,212,243,273,304,334],this.leapLadder=[0,31,60,91,121,152,182,213,244,274,305,335],this.dateTimeRegex=/(\[[^[\]]*])|y{1,4}|M{1,4}|d{1,4}|H{1,2}|h{1,2}|t|T|m{1,2}|s{1,2}|f{3}/g,this.formattingTokens=/(\[[^[\]]*])|([-_:/.,()\s]+)|(T|t|yyyy|yy?|MM?M?M?|Do|dd?|hh?|HH?|mm?|ss?)/g,this.match2=/\d\d/,this.match3=/\d{3}/,this.match4=/\d{4}/,this.match1to2=/\d\d?/,this.matchSigned=/[+-]?\d+/,this.matchOffset=/[+-]\d\d:?(\d\d)?|Z/,this.matchWord=/[^\d_:/,\-()\s]+/,this.zoneExpressions=[this.matchOffset,(t,e)=>{t.offset=this.offsetFromString(e)}],this.expressions={t:[this.matchWord,(t,e)=>{t.afternoon=this.meridiemMatch(e)}],T:[this.matchWord,(t,e)=>{t.afternoon=this.meridiemMatch(e)}],fff:[this.match3,(t,e)=>{t.milliseconds=+e}],s:[this.match1to2,this.addInput("seconds")],ss:[this.match1to2,this.addInput("seconds")],m:[this.match1to2,this.addInput("minutes")],mm:[this.match1to2,this.addInput("minutes")],H:[this.match1to2,this.addInput("hours")],h:[this.match1to2,this.addInput("hours")],HH:[this.match1to2,this.addInput("hours")],hh:[this.match1to2,this.addInput("hours")],d:[this.match1to2,this.addInput("day")],dd:[this.match2,this.addInput("day")],Do:[this.matchWord,(t,e)=>{if([t.day]=e.match(/\d+/),this.localization.ordinal)for(let s=1;s<=31;s+=1)this.localization.ordinal(s).replace(/[[\]]/g,"")===e&&(t.day=s)}],M:[this.match1to2,this.addInput("month")],MM:[this.match2,this.addInput("month")],MMM:[this.matchWord,(t,e)=>{const s=this.getAllMonths(),i=(this.getAllMonths("short")||s.map((t=>t.slice(0,3)))).indexOf(e)+1;if(i<1)throw new Error;t.month=i%12||i}],MMMM:[this.matchWord,(t,e)=>{const s=this.getAllMonths().indexOf(e)+1;if(s<1)throw new Error;t.month=s%12||s}],y:[this.matchSigned,this.addInput("year")],yy:[this.match2,(t,e)=>{t.year=this.parseTwoDigitYear(e)}],yyyy:[this.match4,this.addInput("year")]}}setLocale(t){return this.localization||(this.localization=o,this.localization.locale=t),this}setLocalization(t){return this.localization=t,this}static convert(t,e="default",s=undefined){if(!t)throw new Error("A date is required");return s||((s=o).locale=e),new d(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()).setLocalization(s)}get clone(){return new d(this.year,this.month,this.date,this.hours,this.minutes,this.seconds,this.getMilliseconds()).setLocalization(this.localization)}static isValid(t){return void 0!==t&&"null"!==JSON.stringify(t)&&t.constructor.name===d.name}startOf(t,e=0){if(void 0===this[t])throw new Error(`Unit '${t}' is not valid`);switch(t){case"seconds":this.setMilliseconds(0);break;case"minutes":this.setSeconds(0,0);break;case"hours":this.setMinutes(0,0,0);break;case"date":this.setHours(0,0,0,0);break;case"weekDay":{if(this.startOf(i.date),this.weekDay===e)break;let t=this.weekDay;0!==e&&0===this.weekDay&&(t=8-e),this.manipulate(e-t,i.date);break}case"month":this.startOf(i.date),this.setDate(1);break;case"year":this.startOf(i.date),this.setMonth(0,1)}return this}endOf(t,e=0){if(void 0===this[t])throw new Error(`Unit '${t}' is not valid`);switch(t){case"seconds":this.setMilliseconds(999);break;case"minutes":this.setSeconds(59,999);break;case"hours":this.setMinutes(59,59,999);break;case"date":this.setHours(23,59,59,999);break;case"weekDay":{this.endOf(i.date);const t=6+e;if(this.weekDay===t)break;this.manipulate(t-this.weekDay,i.date);break}case"month":this.endOf(i.date),this.manipulate(1,i.month),this.setDate(0);break;case"year":this.endOf(i.date),this.setMonth(11,31)}return this}manipulate(t,e){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return this[e]+=t,this}isBefore(t,e){if(!d.isValid(t))return!1;if(!e)return this.valueOf()t.valueOf();if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return this.clone.startOf(e).valueOf()>t.clone.startOf(e).valueOf()}isSame(t,e){if(!d.isValid(t))return!1;if(!e)return this.valueOf()===t.valueOf();if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return t=d.convert(t),this.clone.startOf(e).valueOf()===t.startOf(e).valueOf()}isBetween(t,e,s,i="()"){if(!d.isValid(t)||!d.isValid(e))return!1;if(s&&void 0===this[s])throw new Error(`Unit '${s}' is not valid`);const o="("===i[0],a=")"===i[1],n=o?this.isAfter(t,s):!this.isBefore(t,s),r=a?this.isBefore(e,s):!this.isAfter(e,s);return n&&r}parts(t=this.localization.locale,e={dateStyle:"full",timeStyle:"long"}){const s={};return new Intl.DateTimeFormat(t,e).formatToParts(this).filter((t=>"literal"!==t.type)).forEach((t=>s[t.type]=t.value)),s}get seconds(){return this.getSeconds()}set seconds(t){this.setSeconds(t)}get secondsFormatted(){return this.parts(void 0,a).second}get minutes(){return this.getMinutes()}set minutes(t){this.setMinutes(t)}get minutesFormatted(){return this.parts(void 0,a).minute}get hours(){return this.getHours()}set hours(t){this.setHours(t)}getHoursFormatted(t="h12"){return this.parts(void 0,{...a,hourCycle:t}).hour}meridiem(t=this.localization.locale){return new Intl.DateTimeFormat(t,{hour:"numeric",hour12:!0}).formatToParts(this).find((t=>"dayPeriod"===t.type))?.value}get date(){return this.getDate()}set date(t){this.setDate(t)}get dateFormatted(){return this.parts(void 0,a).day}get weekDay(){return this.getDay()}get month(){return this.getMonth()}set month(t){const e=new Date(this.year,t+1);e.setDate(0);const s=e.getDate();this.date>s&&(this.date=s),this.setMonth(t)}get monthFormatted(){return this.parts(void 0,a).month}get year(){return this.getFullYear()}set year(t){this.setFullYear(t)}get week(){const t=this.computeOrdinal(),e=this.getUTCDay();let s=Math.floor((t-e+10)/7);return s<1?s=this.weeksInWeekYear():s>this.weeksInWeekYear()&&(s=1),s}weeksInWeekYear(){const t=(this.year+Math.floor(this.year/4)-Math.floor(this.year/100)+Math.floor(this.year/400))%7,e=this.year-1,s=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7;return 4===t||3===s?53:52}get isLeapYear(){return this.year%4==0&&(this.year%100!=0||this.year%400==0)}computeOrdinal(){return this.date+(this.isLeapYear?this.leapLadder:this.nonLeapLadder)[this.month]}getAllMonths(t="long"){const e=new Intl.DateTimeFormat(this.localization.locale,{month:t}).format;return[...Array(12).keys()].map((t=>e(new Date(2021,t))))}replaceTokens(t,e){return t.replace(/(\[[^[\]]*])|(LTS?|l{1,4}|L{1,4})/g,((t,s,i)=>{const a=i&&i.toUpperCase();return s||e[a]||o.dateFormats[a]}))}parseTwoDigitYear(t){return(t=+t)+(t>68?1900:2e3)}offsetFromString(t){if(!t)return 0;if("Z"===t)return 0;const[e,s,i]=t.match(/([+-]|\d\d)/g),o=60*s+(+i||0);return 0===o?0:"+"===e?-o:o}zoneInformation(t,e){let s=t.parts(this.localization.locale,{timeZoneName:"longOffset"}).timeZoneName.replace("GMT","").replace(":","");const i=s.includes("-");return s=s.replace("-",""),"z"===e?s=s.substring(1,2):"zz"===e&&(s=s.substring(0,2)),`${i?"-":""}${s}`}addInput(t){return(e,s)=>{e[t]=+s}}meridiemMatch(t){const e=new Intl.DateTimeFormat(this.localization.locale,{hour:"numeric",hour12:!0}).formatToParts(new Date(2022,3,4,13)).find((t=>"dayPeriod"===t.type))?.value;return t.toLowerCase()===e.toLowerCase()}correctHours(t){const{afternoon:e}=t;if(void 0!==e){const{hours:s}=t;e?s<12&&(t.hours+=12):12===s&&(t.hours=0),delete t.afternoon}}makeParser(t){const e=(t=this.replaceTokens(t,this.localization.dateFormats)).match(this.formattingTokens),{length:s}=e;for(let t=0;t{const i={hours:0,minutes:0,seconds:0,milliseconds:0};for(let o=0,a=0;o-1)return new d(("X"===e.format?1e3:1)*+t);const i=s.makeParser(e.format),{year:o,month:a,day:n,hours:r,minutes:l,seconds:c,milliseconds:h,zone:p}=i(t),u=n||(o||a?1:s.getDate()),m=o||s.getFullYear();let y=0;return o&&!a||(y=a>0?a-1:s.getMonth()),p?new d(Date.UTC(m,y,u,r,l,c,h+60*p.offset*1e3)):new d(m,y,u,r,l,c,h)}catch(i){s.errorMessages.customDateFormatError(`Unable to parse provided input: ${t}, format: ${e.format}`)}}format(t,e=this.localization.locale){if(t&&"object"==typeof t)return new Intl.DateTimeFormat(e,t).format(this);const s=this.replaceTokens(t||this.localization.format||`${o.dateFormats.L}, ${o.dateFormats.LT}`,this.localization.dateFormats),i=t=>new Intl.DateTimeFormat(this.localization.locale,t).format(this);this.localization.hourCycle||(this.localization.hourCycle=r(this.localization.locale));const a=this.localization.hourCycle.startsWith("h1")?"h24":this.localization.hourCycle,n=this.localization.hourCycle.startsWith("h2")?"h12":this.localization.hourCycle,d={yy:i({year:"2-digit"}),yyyy:this.year,M:i({month:"numeric"}),MM:this.monthFormatted,MMM:this.getAllMonths("short")[this.getMonth()],MMMM:this.getAllMonths()[this.getMonth()],d:this.date,dd:this.dateFormatted,ddd:i({weekday:"short"}),dddd:i({weekday:"long"}),H:this.getHours(),HH:this.getHoursFormatted(a),h:this.hours>12?this.hours-12:this.hours,hh:this.getHoursFormatted(n),t:this.meridiem(),T:this.meridiem().toUpperCase(),m:this.minutes,mm:this.minutesFormatted,s:this.seconds,ss:this.secondsFormatted,fff:this.getMilliseconds()};return s.replace(this.dateTimeRegex,((t,e)=>e||d[t])).replace(/\[/g,"").replace(/]/g,"")}}class l{constructor(){this.cache=new Map}locate(t){const e=this.cache.get(t);if(e)return e;const s=new t;return this.cache.set(t,s),s}}let c;const h=[{name:"calendar",className:s.css.daysContainer,unit:i.month,step:1},{name:"months",className:s.css.monthsContainer,unit:i.year,step:1},{name:"years",className:s.css.yearsContainer,unit:i.year,step:10},{name:"decades",className:s.css.decadesContainer,unit:i.year,step:100}];class p{constructor(){this._currentCalendarViewMode=0,this._viewDate=new d,this.minimumCalendarViewMode=0,this.currentView="calendar"}get currentCalendarViewMode(){return this._currentCalendarViewMode}set currentCalendarViewMode(t){this._currentCalendarViewMode=t,this.currentView=h[t].name}get viewDate(){return this._viewDate}set viewDate(t){this._viewDate=t,this.options&&(this.options.viewDate=t)}refreshCurrentView(){this.currentView=h[this.currentCalendarViewMode].name}get isTwelveHour(){return["h12","h11"].includes(this.options.localization.hourCycle)}}class u{constructor(){this.optionsStore=c.locate(p)}isValid(t,e){if(!this._enabledDisabledDatesIsValid(e,t))return!1;if(e!==i.month&&e!==i.year&&this.optionsStore.options.restrictions.daysOfWeekDisabled?.length>0&&-1!==this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(t.weekDay))return!1;if(!this._minMaxIsValid(e,t))return!1;if(e===i.hours||e===i.minutes||e===i.seconds){if(!this._enabledDisabledHoursIsValid(t))return!1;if(0!==this.optionsStore.options.restrictions.disabledTimeIntervals?.filter((e=>t.isBetween(e.from,e.to))).length)return!1}return!0}_enabledDisabledDatesIsValid(t,e){return t!==i.date||!(this.optionsStore.options.restrictions.disabledDates.length>0&&this._isInDisabledDates(e))&&!(this.optionsStore.options.restrictions.enabledDates.length>0&&!this._isInEnabledDates(e))}_isInDisabledDates(t){return!(!this.optionsStore.options.restrictions.disabledDates||0===this.optionsStore.options.restrictions.disabledDates.length)&&!!this.optionsStore.options.restrictions.disabledDates.find((e=>e.isSame(t,i.date)))}_isInEnabledDates(t){return!this.optionsStore.options.restrictions.enabledDates||0===this.optionsStore.options.restrictions.enabledDates.length||!!this.optionsStore.options.restrictions.enabledDates.find((e=>e.isSame(t,i.date)))}_minMaxIsValid(t,e){return(!this.optionsStore.options.restrictions.minDate||!e.isBefore(this.optionsStore.options.restrictions.minDate,t))&&(!this.optionsStore.options.restrictions.maxDate||!e.isAfter(this.optionsStore.options.restrictions.maxDate,t))}_enabledDisabledHoursIsValid(t){return!(this.optionsStore.options.restrictions.disabledHours.length>0&&this._isInDisabledHours(t))&&!(this.optionsStore.options.restrictions.enabledHours.length>0&&!this._isInEnabledHours(t))}_isInDisabledHours(t){if(!this.optionsStore.options.restrictions.disabledHours||0===this.optionsStore.options.restrictions.disabledHours.length)return!1;const e=t.hours;return this.optionsStore.options.restrictions.disabledHours.includes(e)}_isInEnabledHours(t){if(!this.optionsStore.options.restrictions.enabledHours||0===this.optionsStore.options.restrictions.enabledHours.length)return!0;const e=t.hours;return this.optionsStore.options.restrictions.enabledHours.includes(e)}dateRangeIsValid(t,e,s){if(!this.optionsStore.options.dateRange)return!0;if(2!==t.length&&1!==e)return!0;const o=t[0].clone;if(o.isSame(s,i.date))return!0;for(o.manipulate(1,i.date);!o.isSame(s,i.date);){if(!this.isValid(o,i.date))return!1;o.manipulate(1,i.date)}return!0}}class m{constructor(){this.subscribers=[]}subscribe(t){return this.subscribers.push(t),this.unsubscribe.bind(this,this.subscribers.length-1)}unsubscribe(t){this.subscribers.splice(t,1)}emit(t){this.subscribers.forEach((e=>{e(t)}))}destroy(){this.subscribers=null,this.subscribers=[]}}class y{constructor(){this.triggerEvent=new m,this.viewUpdate=new m,this.updateDisplay=new m,this.action=new m,this.updateViewDate=new m}destroy(){this.triggerEvent.destroy(),this.viewUpdate.destroy(),this.updateDisplay.destroy(),this.action.destroy(),this.updateViewDate.destroy()}}const g={clear:"Clear selection",close:"Close the picker",dateFormats:o.dateFormats,dayViewHeaderFormat:{month:"long",year:"2-digit"},decrementHour:"Decrement Hour",decrementMinute:"Decrement Minute",decrementSecond:"Decrement Second",format:o.format,hourCycle:o.hourCycle,incrementHour:"Increment Hour",incrementMinute:"Increment Minute",incrementSecond:"Increment Second",locale:o.locale,nextCentury:"Next Century",nextDecade:"Next Decade",nextMonth:"Next Month",nextYear:"Next Year",ordinal:o.ordinal,pickHour:"Pick Hour",pickMinute:"Pick Minute",pickSecond:"Pick Second",previousCentury:"Previous Century",previousDecade:"Previous Decade",previousMonth:"Previous Month",previousYear:"Previous Year",selectDate:"Select Date",selectDecade:"Select Decade",selectMonth:"Select Month",selectTime:"Select Time",selectYear:"Select Year",startOfTheWeek:0,today:"Go to today",toggleMeridiem:"Toggle Meridiem"},v={allowInputToggle:!1,container:void 0,dateRange:!1,debug:!1,defaultDate:void 0,display:{icons:{type:"icons",time:"fa-solid fa-clock",date:"fa-solid fa-calendar",up:"fa-solid fa-arrow-up",down:"fa-solid fa-arrow-down",previous:"fa-solid fa-chevron-left",next:"fa-solid fa-chevron-right",today:"fa-solid fa-calendar-check",clear:"fa-solid fa-trash",close:"fa-solid fa-xmark"},sideBySide:!1,calendarWeeks:!1,viewMode:"calendar",toolbarPlacement:"bottom",keepOpen:!1,buttons:{today:!1,clear:!1,close:!1},components:{calendar:!0,date:!0,month:!0,year:!0,decades:!0,clock:!0,hours:!0,minutes:!0,seconds:!1,useTwentyfourHour:void 0},inline:!1,theme:"auto",placement:"bottom"},keepInvalid:!1,localization:g,meta:{},multipleDates:!1,multipleDatesSeparator:"; ",promptTimeOnDateChange:!1,promptTimeOnDateChangeTransitionDelay:200,restrictions:{minDate:void 0,maxDate:void 0,disabledDates:[],enabledDates:[],daysOfWeekDisabled:[],disabledTimeIntervals:[],disabledHours:[],enabledHours:[]},stepping:1,useCurrent:!0,viewDate:new d},S={...g};function f(t,e){if(!t)return null;if(t.constructor.name===d.name)return t;if(t.constructor.name===Date.name)return d.convert(t);if("string"==typeof t){const s=d.fromString(t,e);return"null"===JSON.stringify(s)?null:s}return null}function w(t,e,i){"string"==typeof t&&"input"!==e&&s.errorMessages.dateString();const o=f(t,i);return o||s.errorMessages.failedToParseDate(e,t,"input"===e),o}function b(t,e,i,a){Array.isArray(e)||s.errorMessages.typeMismatch(t,i,"array of DateTime or Date");for(let i=0;i"number"!=typeof t))||s.errorMessages.typeMismatch(t,i,"array of numbers")}function _(t){return({value:e,providedType:i,localization:o})=>{const a=w(e,t,o);if(void 0!==a)return a.setLocalization(o),a;s.errorMessages.typeMismatch(t,i,"DateTime or Date")}}function k(t){const e=_(t);return t=>void 0===t.value?t.value:e(t)}function C(t,e,i){return({value:o,providedType:a})=>void 0===o?[]:(D(t,o,a),o.some((t=>ti))&&s.errorMessages.numbersOutOfRange(t,e,i),o)}function M(t){return C(t,0,23)}function E(t){return({value:e,providedType:s,localization:i})=>void 0===e?[]:(b(t,e,s,i),e)}function T(t){return({value:e,path:i})=>(t.includes(e)||s.errorMessages.unexpectedOptionValue(i.substring(1),e,t),e)}const L=Object.freeze({defaultDate:_("defaultDate"),viewDate:_("viewDate"),minDate:k("restrictions.minDate"),maxDate:k("restrictions.maxDate"),disabledHours:M("restrictions.disabledHours"),enabledHours:M("restrictions.enabledHours"),disabledDates:E("restrictions.disabledDates"),enabledDates:E("restrictions.enabledDates"),daysOfWeekDisabled:C("restrictions.daysOfWeekDisabled",0,6),disabledTimeIntervals:({key:t,value:e,providedType:i,localization:o})=>{if(void 0===e)return[];Array.isArray(e)||s.errorMessages.typeMismatch(t,i,"array of { from: DateTime|Date, to: DateTime|Date }");const a=e;for(let e=0;e{const n=`${t}[${e}].${i}`,r=a[e][i],d=w(r,n,o);d||s.errorMessages.typeMismatch(n,typeof r,"DateTime or Date"),d.setLocalization(o),a[e][i]=d}));return a},toolbarPlacement:T(["top","bottom","default"]),type:T(["icons","sprites"]),viewMode:T(["clock","calendar","months","years","decades"]),theme:T(["light","dark","auto"]),placement:T(["top","bottom"]),meta:({value:t})=>t,dayViewHeaderFormat:({value:t})=>t,container:({value:t,path:e})=>(t&&!(t instanceof HTMLElement||t instanceof Element||t?.appendChild)&&s.errorMessages.typeMismatch(e.substring(1),typeof t,"HTMLElement"),t),useTwentyfourHour:({value:t,path:e,providedType:i,defaultType:o})=>{if(s.errorMessages.deprecatedWarning("useTwentyfourHour",'Please use "options.localization.hourCycle" instead'),void 0===t||"boolean"===i)return t;s.errorMessages.typeMismatch(e,i,o)},hourCycle:T(["h11","h12","h23","h24"])}),A=({value:t,defaultType:e,providedType:i,path:o})=>{switch(e){case"boolean":return"true"===t||!0===t;case"number":return+t;case"string":return t.toString();case"object":return{};case"function":return t;default:s.errorMessages.typeMismatch(o,i,e)}};class V{static deepCopy(t){const e={};return Object.keys(t).forEach((s=>{const i=t[s];i instanceof d?e[s]=i.clone:i instanceof Date?e[s]=new Date(i.valueOf()):(e[s]=i,"object"!=typeof i||i instanceof HTMLElement||i instanceof Element||Array.isArray(i)||(e[s]=V.deepCopy(i)))})),e}static objectPath(t,e){return"."===t.charAt(0)&&(t=t.slice(1)),t?t.split(".").reduce(((t,e)=>V.isValue(t)||V.isValue(t[e])?t[e]:void 0),e):e}static spread(t,e,i,o=""){const a=V.objectPath(o,v),n=Object.keys(t).filter((t=>!Object.keys(a).includes(t)));if(n.length>0){const t=V.getFlattenDefaultOptions(),e=n.map((e=>{let s=`"${o}.${e}" in not a known option.`;const i=t.find((t=>t.includes(e)));return i&&(s+=` Did you mean "${i}"?`),s}));s.errorMessages.unexpectedOptions(e)}Object.keys(t).filter((t=>"__proto__"!==t&&"constructor"!==t)).forEach((s=>{"."===(o+=`.${s}`).charAt(0)&&(o=o.slice(1));const n=a[s],r=typeof t[s],d=typeof n,l=t[s];if(null==l)return e[s]=l,void(o=o.substring(0,o.lastIndexOf(`.${s}`)));"object"!=typeof n||Array.isArray(t[s])||n instanceof Date||V.ignoreProperties.includes(s)?e[s]=V.processKey(s,l,r,d,o,i):V.spread(t[s],e[s],i,o),o=o.substring(0,o.lastIndexOf(`.${s}`))}))}static processKey(t,e,s,i,o,a){return(L[(n={key:t,value:e,providedType:s,defaultType:i,path:o,localization:a}).key]||A)(n);var n}static _mergeOptions(t,e){const s=V.deepCopy(e),i="default"!==e.localization?.locale?e.localization:t?.localization||v.localization;return V.spread(t,s,i,""),s}static _dataToOptions(t,e){const i=JSON.parse(JSON.stringify(t.dataset));if(i?.tdTargetInput&&delete i.tdTargetInput,i?.tdTargetToggle&&delete i.tdTargetToggle,!i||0===Object.keys(i).length||i.constructor!==DOMStringMap)return e;const o={},a=t=>{const e={};return Object.keys(t).forEach((t=>{e[t.toLowerCase()]=t})),e},n=this.normalizeObject(a),r=a(e);return Object.keys(i).filter((t=>t.startsWith(s.dataKey))).map((t=>t.substring(2))).forEach((t=>{let s=r[t.toLowerCase()];if(t.includes("_")){const a=t.split("_");s=r[a[0].toLowerCase()],void 0!==s&&e[s].constructor===Object&&(o[s]=n(a,1,e[s],i[`td${t}`]))}else void 0!==s&&(o[s]=i[`td${t}`])})),this._mergeOptions(o,e)}static normalizeObject(t){const e=(s,i,o,a)=>{const n=t(o)[s[i].toLowerCase()],r={};return void 0===n||(o[n].constructor===Object?(i++,r[n]=e(s,i,o[n],a)):r[n]=a),r};return e}static _dateTypeCheck(t,e){return f(t,e)}static _typeCheckDateArray(t,e,s,i){return b(t,e,s,i)}static _typeCheckNumberArray(t,e,s){return D(t,e,s)}static dateConversion(t,e,s){return w(t,e,s)}static getFlattenDefaultOptions(){if(this._flattenDefaults)return this._flattenDefaults;const t=(e,s=[])=>Array.isArray(e)?[]:Object(e)===e?Object.entries(e).flatMap((([e,i])=>t(i,[...s,e]))):s.join(".");return this._flattenDefaults=t(v),this._flattenDefaults}static _validateConflicts(t){!t.display.sideBySide||t.display.components.clock&&(t.display.components.hours||t.display.components.minutes||t.display.components.seconds)||s.errorMessages.conflictingConfiguration("Cannot use side by side mode without the clock components"),t.restrictions.minDate&&t.restrictions.maxDate&&(t.restrictions.minDate.isAfter(t.restrictions.maxDate)&&s.errorMessages.conflictingConfiguration("minDate is after maxDate"),t.restrictions.maxDate.isBefore(t.restrictions.minDate)&&s.errorMessages.conflictingConfiguration("maxDate is before minDate")),t.multipleDates&&t.dateRange&&s.errorMessages.conflictingConfiguration('Cannot uss option "multipleDates" with "dateRange"')}}V.ignoreProperties=["meta","dayViewHeaderFormat","container","dateForms","ordinal"],V.isValue=t=>null!=t;class ${constructor(){this._dates=[],this.optionsStore=c.locate(p),this.validation=c.locate(u),this._eventEmitters=c.locate(y)}get picked(){return[...this._dates]}get lastPicked(){return this._dates[this.lastPickedIndex]?.clone}get lastPickedIndex(){return 0===this._dates.length?0:this._dates.length-1}formatInput(t){return t?(t.localization=this.optionsStore.options.localization,t.format()):""}parseInput(t){return V.dateConversion(t,"input",this.optionsStore.options.localization)}setFromInput(t,e){if(!t)return void this.setValue(void 0,e);const s=this.parseInput(t);s&&(s.setLocalization(this.optionsStore.options.localization),this.setValue(s,e))}add(t){this._dates.push(t)}isPicked(t,e){if(!d.isValid(t))return!1;if(!e)return void 0!==this._dates.find((e=>e.isSame(t)));const s=n(e),i=t.format(s);return void 0!==this._dates.map((t=>t.format(s))).find((t=>t===i))}pickedIndex(t,e){if(!d.isValid(t))return-1;if(!e)return this._dates.map((t=>t.valueOf())).indexOf(t.valueOf());const s=n(e),i=t.format(s);return this._dates.map((t=>t.format(s))).indexOf(i)}clear(){this.optionsStore.unset=!0,this._eventEmitters.triggerEvent.emit({type:s.events.change,date:void 0,oldDate:this.lastPicked,isClear:!0,isValid:!0}),this._dates=[],this.optionsStore.input&&(this.optionsStore.input.value=""),this._eventEmitters.updateDisplay.emit("all")}static getStartEndYear(t,e){const s=t/10,i=Math.floor(e/t)*t;return[i,i+9*s,Math.floor(e/s)*s]}updateInput(t){if(!this.optionsStore.input)return;let e=this.formatInput(t);(this.optionsStore.options.multipleDates||this.optionsStore.options.dateRange)&&(e=this._dates.map((t=>this.formatInput(t))).join(this.optionsStore.options.multipleDatesSeparator)),this.optionsStore.input.value!=e&&(this.optionsStore.input.value=e)}setValue(t,e){const o=void 0===e,a=!t&&o;let n=this.optionsStore.unset?null:this._dates[e]?.clone;if(!n&&!this.optionsStore.unset&&o&&a&&(n=this.lastPicked),t&&n?.isSame(t))return void this.updateInput(t);if(!t)return void this._setValueNull(a,e,n);e=e||0,t=t.clone,1!==this.optionsStore.options.stepping&&(t.minutes=Math.round(t.minutes/this.optionsStore.options.stepping)*this.optionsStore.options.stepping,t.startOf(i.minutes));const r=i=>{this._dates[e]=t,this._eventEmitters.updateViewDate.emit(t.clone),this.updateInput(t),this.optionsStore.unset=!1,this._eventEmitters.updateDisplay.emit("all"),this._eventEmitters.triggerEvent.emit({type:s.events.change,date:t,oldDate:n,isClear:a,isValid:i})};this.validation.isValid(t)&&this.validation.dateRangeIsValid(this.picked,e,t)?r(!0):(this.optionsStore.options.keepInvalid&&r(!1),this._eventEmitters.triggerEvent.emit({type:s.events.error,reason:s.errorMessages.failedToSetInvalidDate,date:t,oldDate:n}))}_setValueNull(t,e,i){!this.optionsStore.options.multipleDates||1===this._dates.length||t?(this.optionsStore.unset=!0,this._dates=[]):this._dates.splice(e,1),this.updateInput(),this._eventEmitters.triggerEvent.emit({type:s.events.change,date:void 0,oldDate:i,isClear:t,isValid:!0}),this._eventEmitters.updateDisplay.emit("all")}}var H;!function(t){t.next="next",t.previous="previous",t.changeCalendarView="changeCalendarView",t.selectMonth="selectMonth",t.selectYear="selectYear",t.selectDecade="selectDecade",t.selectDay="selectDay",t.selectHour="selectHour",t.selectMinute="selectMinute",t.selectSecond="selectSecond",t.incrementHours="incrementHours",t.incrementMinutes="incrementMinutes",t.incrementSeconds="incrementSeconds",t.decrementHours="decrementHours",t.decrementMinutes="decrementMinutes",t.decrementSeconds="decrementSeconds",t.toggleMeridiem="toggleMeridiem",t.togglePicker="togglePicker",t.showClock="showClock",t.showHours="showHours",t.showMinutes="showMinutes",t.showSeconds="showSeconds",t.clear="clear",t.close="close",t.today="today"}(H||(H={}));var O=H;class z{constructor(){this.optionsStore=c.locate(p),this.dates=c.locate($),this.validation=c.locate(u)}getPicker(){const t=document.createElement("div");if(t.classList.add(s.css.daysContainer),t.append(...this._daysOfTheWeek()),this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(s.css.calendarWeeks,s.css.noHighlight),t.appendChild(e)}const{rangeHoverEvent:e,rangeHoverOutEvent:i}=this.handleMouseEvents(t);for(let o=0;o<42;o++){if(0!==o&&o%7==0&&this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(s.css.calendarWeeks,s.css.noHighlight),t.appendChild(e)}const a=document.createElement("div");a.setAttribute("data-action",O.selectDay),t.appendChild(a),matchMedia("(hover: hover)").matches&&this.optionsStore.options.dateRange&&(a.addEventListener("mouseover",e),a.addEventListener("mouseout",i))}return t}_update(t,e){const o=t.getElementsByClassName(s.css.daysContainer)[0];this._updateCalendarView(o);const a=this.optionsStore.viewDate.clone.startOf(i.month).startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).manipulate(12,i.hours);this._handleCalendarWeeks(o,a.clone),o.querySelectorAll(`[data-action="${O.selectDay}"]`).forEach((t=>{const o=[];o.push(s.css.day),a.isBefore(this.optionsStore.viewDate,i.month)&&o.push(s.css.old),a.isAfter(this.optionsStore.viewDate,i.month)&&o.push(s.css.new),this.optionsStore.unset||this.optionsStore.options.dateRange||!this.dates.isPicked(a,i.date)||o.push(s.css.active),this.validation.isValid(a,i.date)||o.push(s.css.disabled),a.isSame(new d,i.date)&&o.push(s.css.today),0!==a.weekDay&&6!==a.weekDay||o.push(s.css.weekend),this._handleDateRange(a,o),e(i.date,a,o,t),t.classList.remove(...t.classList),t.classList.add(...o),t.setAttribute("data-value",this._dateToDataValue(a)),t.setAttribute("data-day",`${a.date}`),t.innerText=a.parts(void 0,{day:"numeric"}).day,a.manipulate(1,i.date)}))}_dateToDataValue(t){return d.isValid(t)?`${t.year}-${t.monthFormatted}-${t.dateFormatted}`:""}_handleDateRange(t,e){const o=this.dates.picked[0],a=this.dates.picked[1];this.optionsStore.options.dateRange&&(t.isBetween(o,a,i.date)&&e.push(s.css.rangeIn),t.isSame(o,i.date)&&e.push(s.css.rangeStart),t.isSame(a,i.date)&&e.push(s.css.rangeEnd))}handleMouseEvents(t){return{rangeHoverEvent:e=>{const o=e?.currentTarget;if(1!==this.dates.picked.length||o.classList.contains(s.css.disabled))return;const a=[...t.querySelectorAll(".day")],n=o.getAttribute("data-value"),r=d.fromString(n,{format:"yyyy-MM-dd"}),l=a.findIndex((t=>t.getAttribute("data-value")===n)),c=this.dates.picked[0],h=this.dates.picked[1],p=this._dateToDataValue(c),u=a.findIndex((t=>t.getAttribute("data-value")===p)),m=a[u];let y;r.isSame(c,i.date)||o.classList.remove(s.css.rangeStart),r.isSame(h,i.date)||o.classList.remove(s.css.rangeEnd),r.isBefore(c)?(o.classList.add(s.css.rangeStart),m?.classList.remove(s.css.rangeStart),m?.classList.add(s.css.rangeEnd),y=(t,e)=>e>l&&eeu),a.filter(y).forEach((t=>{t.classList.add(s.css.rangeIn)}))},rangeHoverOutEvent:e=>{const o=[...t.querySelectorAll(".day")];if(1===this.dates.picked.length&&o.forEach((t=>t.classList.remove(s.css.rangeIn))),1!==this.dates.picked.length)return;const a=e?.currentTarget,n=new d(a.getAttribute("data-value"));n.isSame(this.dates.picked[0],i.date)||a.classList.remove(s.css.rangeStart),n.isSame(this.dates.picked[1],i.date)||a.classList.remove(s.css.rangeEnd)}}}_updateCalendarView(t){if("calendar"!==this.optionsStore.currentView)return;const[e,o,a]=t.parentElement.getElementsByClassName(s.css.calendarHeader)[0].getElementsByTagName("div");o.setAttribute(s.css.daysContainer,this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)),this.optionsStore.options.display.components.month?o.classList.remove(s.css.disabled):o.classList.add(s.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,i.month),i.month)?e.classList.remove(s.css.disabled):e.classList.add(s.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,i.month),i.month)?a.classList.remove(s.css.disabled):a.classList.add(s.css.disabled)}_daysOfTheWeek(){const t=this.optionsStore.viewDate.clone.startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).startOf(i.date),e=[];if(document.createElement("div"),this.optionsStore.options.display.calendarWeeks){const t=document.createElement("div");t.classList.add(s.css.calendarWeeks,s.css.noHighlight),t.innerText="#",e.push(t)}for(let o=0;o<7;o++){const o=document.createElement("div");o.classList.add(s.css.dayOfTheWeek,s.css.noHighlight),o.innerText=t.format({weekday:"short"}),t.manipulate(1,i.date),e.push(o)}return e}_handleCalendarWeeks(t,e){[...t.querySelectorAll(`.${s.css.calendarWeeks}`)].filter((t=>"#"!==t.innerText)).forEach((t=>{t.innerText=`${e.week}`,e.manipulate(7,i.date)}))}}class I{constructor(){this.optionsStore=c.locate(p),this.dates=c.locate($),this.validation=c.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(s.css.monthsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",O.selectMonth),t.appendChild(e)}return t}_update(t,e){const o=t.getElementsByClassName(s.css.monthsContainer)[0];if("months"===this.optionsStore.currentView){const[t,e,a]=o.parentElement.getElementsByClassName(s.css.calendarHeader)[0].getElementsByTagName("div");e.setAttribute(s.css.monthsContainer,this.optionsStore.viewDate.format({year:"numeric"})),this.optionsStore.options.display.components.year?e.classList.remove(s.css.disabled):e.classList.add(s.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,i.year),i.year)?t.classList.remove(s.css.disabled):t.classList.add(s.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,i.year),i.year)?a.classList.remove(s.css.disabled):a.classList.add(s.css.disabled)}const a=this.optionsStore.viewDate.clone.startOf(i.year);o.querySelectorAll(`[data-action="${O.selectMonth}"]`).forEach(((t,o)=>{const n=[];n.push(s.css.month),!this.optionsStore.unset&&this.dates.isPicked(a,i.month)&&n.push(s.css.active),this.validation.isValid(a,i.month)||n.push(s.css.disabled),e(i.month,a,n,t),t.classList.remove(...t.classList),t.classList.add(...n),t.setAttribute("data-value",`${o}`),t.innerText=`${a.format({month:"short"})}`,a.manipulate(1,i.month)}))}}class x{constructor(){this.optionsStore=c.locate(p),this.dates=c.locate($),this.validation=c.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(s.css.yearsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",O.selectYear),t.appendChild(e)}return t}_update(t,e){this._startYear=this.optionsStore.viewDate.clone.manipulate(-1,i.year),this._endYear=this.optionsStore.viewDate.clone.manipulate(10,i.year);const o=t.getElementsByClassName(s.css.yearsContainer)[0];if("years"===this.optionsStore.currentView){const[t,e,a]=o.parentElement.getElementsByClassName(s.css.calendarHeader)[0].getElementsByTagName("div");e.setAttribute(s.css.yearsContainer,`${this._startYear.format({year:"numeric"})}-${this._endYear.format({year:"numeric"})}`),this.optionsStore.options.display.components.decades?e.classList.remove(s.css.disabled):e.classList.add(s.css.disabled),this.validation.isValid(this._startYear,i.year)?t.classList.remove(s.css.disabled):t.classList.add(s.css.disabled),this.validation.isValid(this._endYear,i.year)?a.classList.remove(s.css.disabled):a.classList.add(s.css.disabled)}const a=this.optionsStore.viewDate.clone.startOf(i.year).manipulate(-1,i.year);o.querySelectorAll(`[data-action="${O.selectYear}"]`).forEach((t=>{const o=[];o.push(s.css.year),!this.optionsStore.unset&&this.dates.isPicked(a,i.year)&&o.push(s.css.active),this.validation.isValid(a,i.year)||o.push(s.css.disabled),e(i.year,a,o,t),t.classList.remove(...t.classList),t.classList.add(...o),t.setAttribute("data-value",`${a.year}`),t.innerText=a.format({year:"numeric"}),a.manipulate(1,i.year)}))}}class P{constructor(){this.optionsStore=c.locate(p),this.dates=c.locate($),this.validation=c.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(s.css.decadesContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",O.selectDecade),t.appendChild(e)}return t}_update(t,e){const[o,a]=$.getStartEndYear(100,this.optionsStore.viewDate.year);this._startDecade=this.optionsStore.viewDate.clone.startOf(i.year),this._startDecade.year=o,this._endDecade=this.optionsStore.viewDate.clone.startOf(i.year),this._endDecade.year=a;const n=t.getElementsByClassName(s.css.decadesContainer)[0],[r,d,l]=n.parentElement.getElementsByClassName(s.css.calendarHeader)[0].getElementsByTagName("div");"decades"===this.optionsStore.currentView&&(d.setAttribute(s.css.decadesContainer,`${this._startDecade.format({year:"numeric"})}-${this._endDecade.format({year:"numeric"})}`),this.validation.isValid(this._startDecade,i.year)?r.classList.remove(s.css.disabled):r.classList.add(s.css.disabled),this.validation.isValid(this._endDecade,i.year)?l.classList.remove(s.css.disabled):l.classList.add(s.css.disabled));const c=this.dates.picked.map((t=>t.year));n.querySelectorAll(`[data-action="${O.selectDecade}"]`).forEach(((t,o)=>{if(0===o)return t.classList.add(s.css.old),this._startDecade.year-10<0?(t.textContent=" ",r.classList.add(s.css.disabled),t.classList.add(s.css.disabled),void t.setAttribute("data-value","")):(t.innerText=this._startDecade.clone.manipulate(-10,i.year).format({year:"numeric"}),void t.setAttribute("data-value",`${this._startDecade.year}`));const a=[];a.push(s.css.decade);const n=this._startDecade.year,d=this._startDecade.year+9;!this.optionsStore.unset&&c.filter((t=>t>=n&&t<=d)).length>0&&a.push(s.css.active),e("decade",this._startDecade,a,t),t.classList.remove(...t.classList),t.classList.add(...a),t.setAttribute("data-value",`${this._startDecade.year}`),t.innerText=`${this._startDecade.format({year:"numeric"})}`,this._startDecade.manipulate(10,i.year)}))}}class N{constructor(){this._gridColumns="",this.optionsStore=c.locate(p),this.dates=c.locate($),this.validation=c.locate(u)}getPicker(t){const e=document.createElement("div");return e.classList.add(s.css.clockContainer),e.append(...this._grid(t)),e}_update(t){const e=t.getElementsByClassName(s.css.clockContainer)[0];let o=this.dates.lastPicked?.clone;if(!o&&this.optionsStore.options.useCurrent&&(o=this.optionsStore.viewDate.clone),e.querySelectorAll(".disabled").forEach((t=>t.classList.remove(s.css.disabled))),this.optionsStore.options.display.components.hours&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,i.hours),i.hours)||e.querySelector(`[data-action=${O.incrementHours}]`).classList.add(s.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,i.hours),i.hours)||e.querySelector(`[data-action=${O.decrementHours}]`).classList.add(s.css.disabled),e.querySelector(`[data-time-component=${i.hours}]`).innerText=o?o.getHoursFormatted(this.optionsStore.options.localization.hourCycle):"--"),this.optionsStore.options.display.components.minutes&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,i.minutes),i.minutes)||e.querySelector(`[data-action=${O.incrementMinutes}]`).classList.add(s.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,i.minutes),i.minutes)||e.querySelector(`[data-action=${O.decrementMinutes}]`).classList.add(s.css.disabled),e.querySelector(`[data-time-component=${i.minutes}]`).innerText=o?o.minutesFormatted:"--"),this.optionsStore.options.display.components.seconds&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,i.seconds),i.seconds)||e.querySelector(`[data-action=${O.incrementSeconds}]`).classList.add(s.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,i.seconds),i.seconds)||e.querySelector(`[data-action=${O.decrementSeconds}]`).classList.add(s.css.disabled),e.querySelector(`[data-time-component=${i.seconds}]`).innerText=o?o.secondsFormatted:"--"),this.optionsStore.isTwelveHour){const t=e.querySelector(`[data-action=${O.toggleMeridiem}]`),a=(o||this.optionsStore.viewDate).clone;t.innerText=a.meridiem(),this.validation.isValid(a.manipulate(a.hours>=12?-12:12,i.hours))?t.classList.remove(s.css.disabled):t.classList.add(s.css.disabled)}e.style.gridTemplateAreas=`"${this._gridColumns}"`}_grid(t){this._gridColumns="";const e=[],o=[],a=[],n=document.createElement("div"),r=t(this.optionsStore.options.display.icons.up),d=t(this.optionsStore.options.display.icons.down);n.classList.add(s.css.separator,s.css.noHighlight);const l=n.cloneNode(!0);l.innerHTML=":";const c=(t=!1)=>t?l.cloneNode(!0):n.cloneNode(!0);if(this.optionsStore.options.display.components.hours){let t=document.createElement("div");t.setAttribute("title",this.optionsStore.options.localization.incrementHour),t.setAttribute("data-action",O.incrementHours),t.appendChild(r.cloneNode(!0)),e.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.pickHour),t.setAttribute("data-action",O.showHours),t.setAttribute("data-time-component",i.hours),o.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.decrementHour),t.setAttribute("data-action",O.decrementHours),t.appendChild(d.cloneNode(!0)),a.push(t),this._gridColumns+="a"}if(this.optionsStore.options.display.components.minutes){this._gridColumns+=" a",this.optionsStore.options.display.components.hours&&(e.push(c()),o.push(c(!0)),a.push(c()),this._gridColumns+=" a");let t=document.createElement("div");t.setAttribute("title",this.optionsStore.options.localization.incrementMinute),t.setAttribute("data-action",O.incrementMinutes),t.appendChild(r.cloneNode(!0)),e.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.pickMinute),t.setAttribute("data-action",O.showMinutes),t.setAttribute("data-time-component",i.minutes),o.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.decrementMinute),t.setAttribute("data-action",O.decrementMinutes),t.appendChild(d.cloneNode(!0)),a.push(t)}if(this.optionsStore.options.display.components.seconds){this._gridColumns+=" a",this.optionsStore.options.display.components.minutes&&(e.push(c()),o.push(c(!0)),a.push(c()),this._gridColumns+=" a");let t=document.createElement("div");t.setAttribute("title",this.optionsStore.options.localization.incrementSecond),t.setAttribute("data-action",O.incrementSeconds),t.appendChild(r.cloneNode(!0)),e.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.pickSecond),t.setAttribute("data-action",O.showSeconds),t.setAttribute("data-time-component",i.seconds),o.push(t),t=document.createElement("div"),t.setAttribute("title",this.optionsStore.options.localization.decrementSecond),t.setAttribute("data-action",O.decrementSeconds),t.appendChild(d.cloneNode(!0)),a.push(t)}if(this.optionsStore.isTwelveHour){this._gridColumns+=" a";let t=c();e.push(t);const i=document.createElement("button");i.setAttribute("title",this.optionsStore.options.localization.toggleMeridiem),i.setAttribute("data-action",O.toggleMeridiem),i.setAttribute("tabindex","-1"),s.css.toggleMeridiem.includes(",")?i.classList.add(...s.css.toggleMeridiem.split(",")):i.classList.add(s.css.toggleMeridiem),t=document.createElement("div"),t.classList.add(s.css.noHighlight),t.appendChild(i),o.push(t),t=c(),a.push(t)}return this._gridColumns=this._gridColumns.trim(),[...e,...o,...a]}}class F{constructor(){this.optionsStore=c.locate(p),this.validation=c.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(s.css.hourContainer);for(let e=0;e<(this.optionsStore.isTwelveHour?12:24);e++){const e=document.createElement("div");e.setAttribute("data-action",O.selectHour),t.appendChild(e)}return t}_update(t,e){const o=t.getElementsByClassName(s.css.hourContainer)[0],a=this.optionsStore.viewDate.clone.startOf(i.date);o.querySelectorAll(`[data-action="${O.selectHour}"]`).forEach((t=>{const o=[];o.push(s.css.hour),this.validation.isValid(a,i.hours)||o.push(s.css.disabled),e(i.hours,a,o,t),t.classList.remove(...t.classList),t.classList.add(...o),t.setAttribute("data-value",`${a.hours}`),t.innerText=a.getHoursFormatted(this.optionsStore.options.localization.hourCycle),a.manipulate(1,i.hours)}))}}class B{constructor(){this.optionsStore=c.locate(p),this.validation=c.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(s.css.minuteContainer);const e=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;for(let s=0;s<60/e;s++){const e=document.createElement("div");e.setAttribute("data-action",O.selectMinute),t.appendChild(e)}return t}_update(t,e){const o=t.getElementsByClassName(s.css.minuteContainer)[0],a=this.optionsStore.viewDate.clone.startOf(i.hours),n=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;o.querySelectorAll(`[data-action="${O.selectMinute}"]`).forEach((t=>{const o=[];o.push(s.css.minute),this.validation.isValid(a,i.minutes)||o.push(s.css.disabled),e(i.minutes,a,o,t),t.classList.remove(...t.classList),t.classList.add(...o),t.setAttribute("data-value",`${a.minutes}`),t.innerText=a.minutesFormatted,a.manipulate(n,i.minutes)}))}}class W{constructor(){this.optionsStore=c.locate(p),this.validation=c.locate(u)}getPicker(){const t=document.createElement("div");t.classList.add(s.css.secondContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",O.selectSecond),t.appendChild(e)}return t}_update(t,e){const o=t.getElementsByClassName(s.css.secondContainer)[0],a=this.optionsStore.viewDate.clone.startOf(i.minutes);o.querySelectorAll(`[data-action="${O.selectSecond}"]`).forEach((t=>{const o=[];o.push(s.css.second),this.validation.isValid(a,i.seconds)||o.push(s.css.disabled),e(i.seconds,a,o,t),t.classList.remove(...t.classList),t.classList.add(...o),t.setAttribute("data-value",`${a.seconds}`),t.innerText=a.secondsFormatted,a.manipulate(5,i.seconds)}))}}class q{static toggle(t){t.classList.contains(s.css.show)?this.hide(t):this.show(t)}static showImmediately(t){t.classList.remove(s.css.collapsing),t.classList.add(s.css.collapse,s.css.show),t.style.height=""}static show(t){if(t.classList.contains(s.css.collapsing)||t.classList.contains(s.css.show))return;t.style.height="0",t.classList.remove(s.css.collapse),t.classList.add(s.css.collapsing),setTimeout((()=>{q.showImmediately(t)}),this.getTransitionDurationFromElement(t)),t.style.height=`${t.scrollHeight}px`}static hideImmediately(t){t&&(t.classList.remove(s.css.collapsing,s.css.show),t.classList.add(s.css.collapse))}static hide(t){if(t.classList.contains(s.css.collapsing)||!t.classList.contains(s.css.show))return;t.style.height=`${t.getBoundingClientRect().height}px`;t.offsetHeight,t.classList.remove(s.css.collapse,s.css.show),t.classList.add(s.css.collapsing),t.style.height="",setTimeout((()=>{q.hideImmediately(t)}),this.getTransitionDurationFromElement(t))}}q.getTransitionDurationFromElement=t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:s}=window.getComputedStyle(t);const i=Number.parseFloat(e),o=Number.parseFloat(s);return i||o?(e=e.split(",")[0],s=s.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(s))):0};class Y{constructor(){this._isVisible=!1,this._documentClickEvent=t=>{this.optionsStore.options.debug||window.debug||!this._isVisible||t.composedPath().includes(this.widget)||t.composedPath()?.includes(this.optionsStore.element)||this.hide()},this._actionsClickEvent=t=>{this._eventEmitters.action.emit({e:t})},this.optionsStore=c.locate(p),this.validation=c.locate(u),this.dates=c.locate($),this.dateDisplay=c.locate(z),this.monthDisplay=c.locate(I),this.yearDisplay=c.locate(x),this.decadeDisplay=c.locate(P),this.timeDisplay=c.locate(N),this.hourDisplay=c.locate(F),this.minuteDisplay=c.locate(B),this.secondDisplay=c.locate(W),this._eventEmitters=c.locate(y),this._widget=void 0,this._eventEmitters.updateDisplay.subscribe((t=>{this._update(t)}))}get widget(){return this._widget}get dateContainer(){return this.widget?.querySelector(`div.${s.css.dateContainer}`)}get timeContainer(){return this.widget?.querySelector(`div.${s.css.timeContainer}`)}get isVisible(){return this._isVisible}_update(t){if(this.widget)switch(t){case i.seconds:this.secondDisplay._update(this.widget,this.paint);break;case i.minutes:this.minuteDisplay._update(this.widget,this.paint);break;case i.hours:this.hourDisplay._update(this.widget,this.paint);break;case i.date:this.dateDisplay._update(this.widget,this.paint);break;case i.month:this.monthDisplay._update(this.widget,this.paint);break;case i.year:this.yearDisplay._update(this.widget,this.paint);break;case"clock":if(!this._hasTime)break;this.timeDisplay._update(this.widget),this._update(i.hours),this._update(i.minutes),this._update(i.seconds);break;case"calendar":this._update(i.date),this._update(i.year),this._update(i.month),this.decadeDisplay._update(this.widget,this.paint),this._updateCalendarHeader();break;case"all":this._hasTime&&this._update("clock"),this._hasDate&&this._update("calendar")}}paint(t,e,s,i){}show(){if(null==this.widget){if(this._showSetDefaultIfNeeded(),this._buildWidget(),this._updateTheme(),this._showSetupViewMode(),this.optionsStore.options.display.inline)this.optionsStore.element.appendChild(this.widget);else{const t=this.optionsStore.options?.container||document.body,e=this.optionsStore.options?.display?.placement||"bottom";t.appendChild(this.widget),this.createPopup(this.optionsStore.element,this.widget,{modifiers:[{name:"eventListeners",enabled:!0}],placement:"rtl"===document.documentElement.dir?`${e}-end`:`${e}-start`}).then()}"clock"==this.optionsStore.options.display.viewMode&&this._eventEmitters.action.emit({e:null,action:O.showClock}),this.widget.querySelectorAll("[data-action]").forEach((t=>t.addEventListener("click",this._actionsClickEvent))),this._hasTime&&this.optionsStore.options.display.sideBySide&&(this.timeDisplay._update(this.widget),this.widget.getElementsByClassName(s.css.clockContainer)[0].style.display="grid")}this.widget.classList.add(s.css.show),this.optionsStore.options.display.inline||(this.updatePopup(),document.addEventListener("click",this._documentClickEvent)),this._eventEmitters.triggerEvent.emit({type:s.events.show}),this._isVisible=!0}_showSetupViewMode(){const t=this._hasTime&&!this._hasDate;t?(this.optionsStore.currentView="clock",this._eventEmitters.action.emit({e:null,action:O.showClock})):this.optionsStore.currentCalendarViewMode||(this.optionsStore.currentCalendarViewMode=this.optionsStore.minimumCalendarViewMode),t||"clock"===this.optionsStore.options.display.viewMode||(this._hasTime&&(this.optionsStore.options.display.sideBySide?q.show(this.timeContainer):q.hideImmediately(this.timeContainer)),q.show(this.dateContainer)),this._hasDate&&this._showMode()}_showSetDefaultIfNeeded(){if(0==this.dates.picked.length){if(this.optionsStore.options.useCurrent&&!this.optionsStore.options.defaultDate){const t=(new d).setLocalization(this.optionsStore.options.localization);if(!this.optionsStore.options.keepInvalid){let e=0,s=1;for(this.optionsStore.options.restrictions.maxDate?.isBefore(t)&&(s=-1);!this.validation.isValid(t)&&e>31;)t.manipulate(s,i.date),e++}this.dates.setValue(t)}this.optionsStore.options.defaultDate&&this.dates.setValue(this.optionsStore.options.defaultDate)}}async createPopup(t,e,s){let i;if(window?.Popper)i=window?.Popper?.createPopper;else{const{createPopper:t}=await import("@popperjs/core");i=t}i&&(this._popperInstance=i(t,e,s))}updatePopup(){this._popperInstance?.update()}_showMode(t){if(!this.widget)return;if(t){const e=Math.max(this.optionsStore.minimumCalendarViewMode,Math.min(3,this.optionsStore.currentCalendarViewMode+t));if(this.optionsStore.currentCalendarViewMode==e)return;this.optionsStore.currentCalendarViewMode=e}this.widget.querySelectorAll(`.${s.css.dateContainer} > div:not(.${s.css.calendarHeader}), .${s.css.timeContainer} > div:not(.${s.css.clockContainer})`).forEach((t=>t.style.display="none"));const e=h[this.optionsStore.currentCalendarViewMode],i=this.widget.querySelector(`.${e.className}`);switch(e.className){case s.css.decadesContainer:this.decadeDisplay._update(this.widget,this.paint);break;case s.css.yearsContainer:this.yearDisplay._update(this.widget,this.paint);break;case s.css.monthsContainer:this.monthDisplay._update(this.widget,this.paint);break;case s.css.daysContainer:this.dateDisplay._update(this.widget,this.paint)}i.style.display="grid",this.optionsStore.options.display.sideBySide&&(this.widget.querySelectorAll(`.${s.css.clockContainer}`)[0].style.display="grid"),this._updateCalendarHeader(),this._eventEmitters.viewUpdate.emit()}_updateTheme(t){if(this.widget){if(t){if(this.optionsStore.options.display.theme===t)return;this.optionsStore.options.display.theme=t}this.widget.classList.remove("light","dark"),this.widget.classList.add(this._getThemeClass()),"auto"===this.optionsStore.options.display.theme?window.matchMedia(s.css.isDarkPreferredQuery).addEventListener("change",(()=>this._updateTheme())):window.matchMedia(s.css.isDarkPreferredQuery).removeEventListener("change",(()=>this._updateTheme()))}}_getThemeClass(){const t=this.optionsStore.options.display.theme||"auto",e=window.matchMedia&&window.matchMedia(s.css.isDarkPreferredQuery).matches;switch(t){case"light":return s.css.lightTheme;case"dark":return s.css.darkTheme;case"auto":return e?s.css.darkTheme:s.css.lightTheme}}_updateCalendarHeader(){if(!this._hasDate)return;const t=[...this.widget.querySelector(`.${s.css.dateContainer} div[style*="display: grid"]`).classList].find((t=>t.startsWith(s.css.dateContainer))),[e,i,o]=this.widget.getElementsByClassName(s.css.calendarHeader)[0].getElementsByTagName("div");switch(t){case s.css.decadesContainer:e.setAttribute("title",this.optionsStore.options.localization.previousCentury),i.setAttribute("title",""),o.setAttribute("title",this.optionsStore.options.localization.nextCentury);break;case s.css.yearsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousDecade),i.setAttribute("title",this.optionsStore.options.localization.selectDecade),o.setAttribute("title",this.optionsStore.options.localization.nextDecade);break;case s.css.monthsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousYear),i.setAttribute("title",this.optionsStore.options.localization.selectYear),o.setAttribute("title",this.optionsStore.options.localization.nextYear);break;case s.css.daysContainer:e.setAttribute("title",this.optionsStore.options.localization.previousMonth),i.setAttribute("title",this.optionsStore.options.localization.selectMonth),o.setAttribute("title",this.optionsStore.options.localization.nextMonth),i.setAttribute(t,this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat))}i.innerText=i.getAttribute(t)}hide(){this.widget&&this._isVisible&&(this.widget.classList.remove(s.css.show),this._isVisible&&(this._eventEmitters.triggerEvent.emit({type:s.events.hide,date:this.optionsStore.unset?null:this.dates.lastPicked?.clone}),this._isVisible=!1),document.removeEventListener("click",this._documentClickEvent))}toggle(){return this._isVisible?this.hide():this.show()}_dispose(){document.removeEventListener("click",this._documentClickEvent),this.widget&&(this.widget.querySelectorAll("[data-action]").forEach((t=>t.removeEventListener("click",this._actionsClickEvent))),this.widget.parentNode.removeChild(this.widget),this._widget=void 0)}_buildWidget(){const t=document.createElement("div");t.classList.add(s.css.widget);const e=document.createElement("div");e.classList.add(s.css.dateContainer),e.append(this.getHeadTemplate(),this.decadeDisplay.getPicker(),this.yearDisplay.getPicker(),this.monthDisplay.getPicker(),this.dateDisplay.getPicker());const i=document.createElement("div");i.classList.add(s.css.timeContainer),i.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this))),i.appendChild(this.hourDisplay.getPicker()),i.appendChild(this.minuteDisplay.getPicker()),i.appendChild(this.secondDisplay.getPicker());const o=document.createElement("div");if(o.classList.add(s.css.toolbar),o.append(...this.getToolbarElements()),this.optionsStore.options.display.inline&&t.classList.add(s.css.inline),this.optionsStore.options.display.calendarWeeks&&t.classList.add("calendarWeeks"),this.optionsStore.options.display.sideBySide&&this._hasDateAndTime)return void this._buildWidgetSideBySide(t,e,i,o);"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(o);const a=(e,i,o,a)=>{e&&(i&&(o.classList.add(s.css.collapse),a&&o.classList.add(s.css.show)),t.appendChild(o))};a(this._hasDate,this._hasTime,e,"clock"!==this.optionsStore.options.display.viewMode),a(this._hasTime,this._hasDate,i,"clock"===this.optionsStore.options.display.viewMode),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(o);const n=document.createElement("div");n.classList.add("arrow"),n.setAttribute("data-popper-arrow",""),t.appendChild(n),this._widget=t}_buildWidgetSideBySide(t,e,i,o){t.classList.add(s.css.sideBySide),"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(o);const a=document.createElement("div");a.classList.add("td-row"),e.classList.add("td-half"),i.classList.add("td-half"),a.appendChild(e),a.appendChild(i),t.appendChild(a),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(o),this._widget=t}get _hasTime(){return this.optionsStore.options.display.components.clock&&(this.optionsStore.options.display.components.hours||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.components.seconds)}get _hasDate(){return this.optionsStore.options.display.components.calendar&&(this.optionsStore.options.display.components.year||this.optionsStore.options.display.components.month||this.optionsStore.options.display.components.date)}get _hasDateAndTime(){return this._hasDate&&this._hasTime}getToolbarElements(){const t=[];if(this.optionsStore.options.display.buttons.today){const e=document.createElement("div");e.setAttribute("data-action",O.today),e.setAttribute("title",this.optionsStore.options.localization.today),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.today)),t.push(e)}if(!this.optionsStore.options.display.sideBySide&&this._hasDate&&this._hasTime){let e,s;"clock"===this.optionsStore.options.display.viewMode?(e=this.optionsStore.options.localization.selectDate,s=this.optionsStore.options.display.icons.date):(e=this.optionsStore.options.localization.selectTime,s=this.optionsStore.options.display.icons.time);const i=document.createElement("div");i.setAttribute("data-action",O.togglePicker),i.setAttribute("title",e),i.appendChild(this._iconTag(s)),t.push(i)}if(this.optionsStore.options.display.buttons.clear){const e=document.createElement("div");e.setAttribute("data-action",O.clear),e.setAttribute("title",this.optionsStore.options.localization.clear),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.clear)),t.push(e)}if(this.optionsStore.options.display.buttons.close){const e=document.createElement("div");e.setAttribute("data-action",O.close),e.setAttribute("title",this.optionsStore.options.localization.close),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.close)),t.push(e)}return t}getHeadTemplate(){const t=document.createElement("div");t.classList.add(s.css.calendarHeader);const e=document.createElement("div");e.classList.add(s.css.previous),e.setAttribute("data-action",O.previous),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.previous));const i=document.createElement("div");i.classList.add(s.css.switch),i.setAttribute("data-action",O.changeCalendarView);const o=document.createElement("div");return o.classList.add(s.css.next),o.setAttribute("data-action",O.next),o.appendChild(this._iconTag(this.optionsStore.options.display.icons.next)),t.append(e,i,o),t}_iconTag(t){if("sprites"===this.optionsStore.options.display.icons.type){const e=document.createElementNS("http://www.w3.org/2000/svg","svg"),s=document.createElementNS("http://www.w3.org/2000/svg","use");return s.setAttribute("xlink:href",t),s.setAttribute("href",t),e.appendChild(s),e}const e=document.createElement("i");return e.classList.add(...t.split(" ")),e}_rebuild(){const t=this._isVisible;this._dispose(),t&&this.show()}}class j{constructor(){this.optionsStore=c.locate(p),this.dates=c.locate($),this.validation=c.locate(u),this.display=c.locate(Y),this._eventEmitters=c.locate(y),this._eventEmitters.action.subscribe((t=>{this.do(t.e,t.action)}))}do(t,e){const o=t?.currentTarget;if(o?.classList?.contains(s.css.disabled))return;e=e||o?.dataset?.action;const a=(this.dates.lastPicked||this.optionsStore.viewDate).clone;switch(e){case O.next:case O.previous:this.handleNextPrevious(e);break;case O.changeCalendarView:this.display._showMode(1),this.display._updateCalendarHeader();break;case O.selectMonth:case O.selectYear:case O.selectDecade:this.handleSelectCalendarMode(e,o);break;case O.selectDay:this.handleSelectDay(o);break;case O.selectHour:{let e=+o.dataset.value;a.hours>=12&&this.optionsStore.isTwelveHour&&(e+=12),a.hours=e,this.dates.setValue(a,this.dates.lastPickedIndex),this.hideOrClock(t);break}case O.selectMinute:a.minutes=+o.dataset.value,this.dates.setValue(a,this.dates.lastPickedIndex),this.hideOrClock(t);break;case O.selectSecond:a.seconds=+o.dataset.value,this.dates.setValue(a,this.dates.lastPickedIndex),this.hideOrClock(t);break;case O.incrementHours:this.manipulateAndSet(a,i.hours);break;case O.incrementMinutes:this.manipulateAndSet(a,i.minutes,this.optionsStore.options.stepping);break;case O.incrementSeconds:this.manipulateAndSet(a,i.seconds);break;case O.decrementHours:this.manipulateAndSet(a,i.hours,-1);break;case O.decrementMinutes:this.manipulateAndSet(a,i.minutes,-1*this.optionsStore.options.stepping);break;case O.decrementSeconds:this.manipulateAndSet(a,i.seconds,-1);break;case O.toggleMeridiem:this.manipulateAndSet(a,i.hours,this.dates.lastPicked.hours>=12?-12:12);break;case O.togglePicker:this.handleToggle(o);break;case O.showClock:case O.showHours:case O.showMinutes:case O.showSeconds:this.optionsStore.options.display.sideBySide||"clock"===this.optionsStore.currentView||(q.hideImmediately(this.display.dateContainer),q.showImmediately(this.display.timeContainer)),this.handleShowClockContainers(e);break;case O.clear:this.dates.setValue(null),this.display._updateCalendarHeader();break;case O.close:this.display.hide();break;case O.today:{const t=(new d).setLocalization(this.optionsStore.options.localization);this._eventEmitters.updateViewDate.emit(t),this.validation.isValid(t,i.date)&&this.dates.setValue(t,this.dates.lastPickedIndex);break}}}handleShowClockContainers(t){if(!this.display._hasTime)return void s.errorMessages.throwError("Cannot show clock containers when time is disabled.");this.optionsStore.currentView="clock",this.display.widget.querySelectorAll(`.${s.css.timeContainer} > div`).forEach((t=>t.style.display="none"));let e="";switch(t){case O.showClock:e=s.css.clockContainer,this.display._update("clock");break;case O.showHours:e=s.css.hourContainer,this.display._update(i.hours);break;case O.showMinutes:e=s.css.minuteContainer,this.display._update(i.minutes);break;case O.showSeconds:e=s.css.secondContainer,this.display._update(i.seconds)}this.display.widget.getElementsByClassName(e)[0].style.display="grid"}handleNextPrevious(t){const{unit:e,step:s}=h[this.optionsStore.currentCalendarViewMode];t===O.next?this.optionsStore.viewDate.manipulate(s,e):this.optionsStore.viewDate.manipulate(-1*s,e),this._eventEmitters.viewUpdate.emit(),this.display._showMode()}hideOrClock(t){this.optionsStore.isTwelveHour||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline?this.do(t,O.showClock):this.display.hide()}manipulateAndSet(t,e,s=1){const i=t.manipulate(s,e);this.validation.isValid(i,e)&&this.dates.setValue(i,this.dates.lastPickedIndex)}handleSelectCalendarMode(t,e){const s=+e.dataset.value;switch(t){case O.selectMonth:this.optionsStore.viewDate.month=s;break;case O.selectYear:case O.selectDecade:this.optionsStore.viewDate.year=s}this.optionsStore.currentCalendarViewMode===this.optionsStore.minimumCalendarViewMode?(this.dates.setValue(this.optionsStore.viewDate,this.dates.lastPickedIndex),this.optionsStore.options.display.inline||this.display.hide()):this.display._showMode(-1)}handleToggle(t){t.getAttribute("title")===this.optionsStore.options.localization.selectDate?(t.setAttribute("title",this.optionsStore.options.localization.selectTime),t.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.time).outerHTML,this.display._updateCalendarHeader(),this.optionsStore.refreshCurrentView()):(t.setAttribute("title",this.optionsStore.options.localization.selectDate),t.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.date).outerHTML,this.display._hasTime&&(this.handleShowClockContainers(O.showClock),this.display._update("clock"))),this.display.widget.querySelectorAll(`.${s.css.dateContainer}, .${s.css.timeContainer}`).forEach((t=>q.toggle(t))),this._eventEmitters.viewUpdate.emit()}handleSelectDay(t){const e=this.optionsStore.viewDate.clone;t.classList.contains(s.css.old)&&e.manipulate(-1,i.month),t.classList.contains(s.css.new)&&e.manipulate(1,i.month),e.date=+t.dataset.day,this.optionsStore.options.dateRange?this.handleDateRange(e):this.optionsStore.options.multipleDates?this.handleMultiDate(e):this.dates.setValue(e,this.dates.lastPickedIndex),this.display._hasTime||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline||this.optionsStore.options.multipleDates||this.optionsStore.options.dateRange||this.display.hide()}handleMultiDate(t){let e=this.dates.pickedIndex(t,i.date);console.log(e),-1!==e?this.dates.setValue(null,e):(e=this.dates.lastPickedIndex+1,0===this.dates.picked.length&&(e=0),this.dates.setValue(t,e))}handleDateRange(t){switch(this.dates.picked.length){case 2:this.dates.clear();break;case 1:{const e=this.dates.picked[0];if(t.getTime()===e.getTime()){this.dates.clear();break}return t.isBefore(e)?(this.dates.setValue(t,0),void this.dates.setValue(e,1)):void this.dates.setValue(t,1)}}this.dates.setValue(t,0)}}class U{constructor(t,e={}){this._subscribers={},this._isDisabled=!1,this._inputChangeEvent=t=>{const e=t?.detail;if(e)return;const s=()=>{this.dates.lastPicked&&(this.optionsStore.viewDate=this.dates.lastPicked.clone)},i=this.optionsStore.input.value;if(this.optionsStore.options.multipleDates)try{const t=i.split(this.optionsStore.options.multipleDatesSeparator);for(let e=0;e{this.optionsStore.element?.disabled||this.optionsStore.input?.disabled||this.toggle()},c=new l,this._eventEmitters=c.locate(y),this.optionsStore=c.locate(p),this.display=c.locate(Y),this.dates=c.locate($),this.actions=c.locate(j),t||s.errorMessages.mustProvideElement(),this.optionsStore.element=t,this._initializeOptions(e,v,!0),this.optionsStore.viewDate.setLocalization(this.optionsStore.options.localization),this.optionsStore.unset=!0,this._initializeInput(),this._initializeToggle(),this.optionsStore.options.display.inline&&this.display.show(),this._eventEmitters.triggerEvent.subscribe((t=>{this._triggerEvent(t)})),this._eventEmitters.viewUpdate.subscribe((()=>{this._viewUpdate()})),this._eventEmitters.updateViewDate.subscribe((t=>{this.viewDate=t}))}get viewDate(){return this.optionsStore.viewDate}set viewDate(t){this.optionsStore.viewDate=t,this.optionsStore.viewDate.setLocalization(this.optionsStore.options.localization),this.display._update("clock"===this.optionsStore.currentView?"clock":"calendar")}updateOptions(t,e=!1){e?this._initializeOptions(t,v):this._initializeOptions(t,this.optionsStore.options),this.optionsStore.viewDate.setLocalization(this.optionsStore.options.localization),this.display._rebuild()}toggle(){this._isDisabled||this.display.toggle()}show(){this._isDisabled||this.display.show()}hide(){this.display.hide()}disable(){this._isDisabled=!0,this.optionsStore.input?.setAttribute("disabled","disabled"),this.display.hide()}enable(){this._isDisabled=!1,this.optionsStore.input?.removeAttribute("disabled")}clear(){this.optionsStore.input.value="",this.dates.clear()}subscribe(t,e){let i;"string"==typeof t&&(t=[t]),i=Array.isArray(e)?e:[e],t.length!==i.length&&s.errorMessages.subscribeMismatch();const o=[];for(let e=0;e{e(t)}))}_viewUpdate(){this._triggerEvent({type:s.events.update,viewDate:this.optionsStore.viewDate.clone})}_unsubscribe(t,e){this._subscribers[t].splice(e,1)}_initializeOptions(t,e,s=!1){let i=V.deepCopy(t);i=V._mergeOptions(i,e),s&&(i=V._dataToOptions(this.optionsStore.element,i)),V._validateConflicts(i),i.viewDate=i.viewDate.setLocalization(i.localization),this.optionsStore.viewDate.isSame(i.viewDate)||(this.optionsStore.viewDate=i.viewDate),i.display.components.year&&(this.optionsStore.minimumCalendarViewMode=2),i.display.components.month&&(this.optionsStore.minimumCalendarViewMode=1),i.display.components.date&&(this.optionsStore.minimumCalendarViewMode=0),this.optionsStore.currentCalendarViewMode=Math.max(this.optionsStore.minimumCalendarViewMode,this.optionsStore.currentCalendarViewMode),h[this.optionsStore.currentCalendarViewMode].name!==i.display.viewMode&&(this.optionsStore.currentCalendarViewMode=Math.max(h.findIndex((t=>t.name===i.display.viewMode)),this.optionsStore.minimumCalendarViewMode)),this.display?.isVisible&&this.display._update("all"),i.display.components.useTwentyfourHour&&void 0===i.localization.hourCycle?i.localization.hourCycle="h24":void 0===i.localization.hourCycle&&(i.localization.hourCycle=r(i.localization.locale)),this.optionsStore.options=i}_initializeInput(){if("INPUT"==this.optionsStore.element.tagName)this.optionsStore.input=this.optionsStore.element;else{const t=this.optionsStore.element.dataset.tdTargetInput;this.optionsStore.input=null==t||"nearest"==t?this.optionsStore.element.querySelector("input"):this.optionsStore.element.querySelector(t)}this.optionsStore.input&&(!this.optionsStore.input.value&&this.optionsStore.options.defaultDate&&(this.optionsStore.input.value=this.dates.formatInput(this.optionsStore.options.defaultDate)),this.optionsStore.input.addEventListener("change",this._inputChangeEvent),this.optionsStore.options.allowInputToggle&&this.optionsStore.input.addEventListener("click",this._toggleClickEvent),this.optionsStore.input.value&&this._inputChangeEvent())}_initializeToggle(){if(this.optionsStore.options.display.inline)return;let t=this.optionsStore.element.dataset.tdTargetToggle;"nearest"==t&&(t='[data-td-toggle="datetimepicker"]'),this._toggle=null==t?this.optionsStore.element:this.optionsStore.element.querySelector(t),this._toggle.addEventListener("click",this._toggleClickEvent)}_handleAfterChangeEvent(t){!this.optionsStore.options.promptTimeOnDateChange||this.optionsStore.options.multipleDates||this.optionsStore.options.display.inline||this.optionsStore.options.display.sideBySide||!this.display._hasTime||this.display.widget?.getElementsByClassName(s.css.show)[0].classList.contains(s.css.timeContainer)||!t.oldDate&&this.optionsStore.options.useCurrent||t.oldDate&&t.date?.isSame(t.oldDate)||(clearTimeout(this._currentPromptTimeTimeout),this._currentPromptTimeTimeout=setTimeout((()=>{this.display.widget&&this._eventEmitters.action.emit({e:{currentTarget:this.display.widget.querySelector(`.${s.css.switch}`)},action:O.togglePicker})}),this.optionsStore.options.promptTimeOnDateChangeTransitionDelay))}}const R={},Q=t=>{R[t.name]||(R[t.name]=t.localization)},J=t=>{const e=R[t];e&&(v.localization=e)},K=function(t,e=undefined){return t?(t.installed||(t(e,{TempusDominus:U,Dates:$,Display:Y,DateTime:d,Namespace:s},G),t.installed=!0),G):G},Z="6.7.7",G={TempusDominus:U,extend:K,loadLocale:Q,locale:J,Namespace:s,DefaultOptions:v,DateTime:d,Unit:i,version:Z,DefaultEnLocalization:S};export{d as DateTime,S as DefaultEnLocalization,v as DefaultOptions,s as Namespace,U as TempusDominus,i as Unit,K as extend,Q as loadLocale,J as locale,Z as version}; diff --git a/dist/js/tempus-dominus.js b/dist/js/tempus-dominus.js index 152452c75..9d4de3620 100644 --- a/dist/js/tempus-dominus.js +++ b/dist/js/tempus-dominus.js @@ -1,5 +1,5 @@ /*! - * Tempus Dominus v6.4.4 (https://getdatepicker.com/) + * Tempus Dominus v6.7.7 (https://getdatepicker.com/) * Copyright 2013-2023 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ @@ -1420,12 +1420,12 @@ if (dates.length !== 2 && index !== 1) return true; // initialize start date - const start = dates[0]; + const start = dates[0].clone; // check if start date is not the same as target date if (start.isSame(target, exports.Unit.date)) return true; // add one day to start; start has already been validated - start.clone.manipulate(1, exports.Unit.date); + start.manipulate(1, exports.Unit.date); // check each date in the range to make sure it's valid while (!start.isSame(target, exports.Unit.date)) { const valid = this.isValid(start, exports.Unit.date); @@ -2061,13 +2061,13 @@ * Returns the array of selected dates */ get picked() { - return this._dates; + return [...this._dates]; } /** * Returns the last picked value. */ get lastPicked() { - return this._dates[this.lastPickedIndex]; + return this._dates[this.lastPickedIndex]?.clone; } /** * Returns the length of picked dates -1 or 0 if none are selected. @@ -2203,7 +2203,7 @@ */ setValue(target, index) { const noIndex = typeof index === 'undefined', isClear = !target && noIndex; - let oldDate = this.optionsStore.unset ? null : this._dates[index]; + let oldDate = this.optionsStore.unset ? null : this._dates[index]?.clone; if (!oldDate && !this.optionsStore.unset && noIndex && isClear) { oldDate = this.lastPicked; } @@ -2240,7 +2240,7 @@ }); }; if (this.validation.isValid(target) && - this.validation.dateRangeIsValid(this._dates, index, target)) { + this.validation.dateRangeIsValid(this.picked, index, target)) { onUpdate(true); return; } @@ -2373,7 +2373,7 @@ classes.push(Namespace.css.new); } if (!this.optionsStore.unset && - !this.optionsStore.options.multipleDates && + !this.optionsStore.options.dateRange && this.dates.isPicked(innerDate, exports.Unit.date)) { classes.push(Namespace.css.active); } @@ -4097,9 +4097,10 @@ this.dates.setValue(other, 1); return; } - else + else { this.dates.setValue(day, 1); - return; + return; + } } } this.dates.setValue(day, 0); @@ -4568,7 +4569,7 @@ } return tempusDominus; }; - const version = '6.4.4'; + const version = '6.7.7'; const tempusDominus = { TempusDominus, extend, diff --git a/dist/js/tempus-dominus.js.map b/dist/js/tempus-dominus.js.map index e942d873f..b83c0d7b5 100644 --- a/dist/js/tempus-dominus.js.map +++ b/dist/js/tempus-dominus.js.map @@ -1 +1 @@ -{"version":3,"file":"tempus-dominus.js","sources":["../../src/js/utilities/errors.ts","../../src/js/utilities/namespace.ts","../../src/js/utilities/default-format-localization.ts","../../src/js/datetime.ts","../../src/js/utilities/service-locator.ts","../../src/js/utilities/calendar-modes.ts","../../src/js/utilities/optionsStore.ts","../../src/js/validation.ts","../../src/js/utilities/event-emitter.ts","../../src/js/utilities/default-options.ts","../../src/js/utilities/typeChecker.ts","../../src/js/utilities/optionProcessor.ts","../../src/js/utilities/optionConverter.ts","../../src/js/dates.ts","../../src/js/utilities/action-types.ts","../../src/js/display/calendar/date-display.ts","../../src/js/display/calendar/month-display.ts","../../src/js/display/calendar/year-display.ts","../../src/js/display/calendar/decade-display.ts","../../src/js/display/time/time-display.ts","../../src/js/display/time/hour-display.ts","../../src/js/display/time/minute-display.ts","../../src/js/display/time/second-display.ts","../../src/js/display/collapse.ts","../../src/js/display/index.ts","../../src/js/actions.ts","../../src/js/tempus-dominus.ts"],"sourcesContent":["export class TdError extends Error {\n code: number;\n}\n\nexport class ErrorMessages {\n private base = 'TD:';\n\n //#region out to console\n\n /**\n * Throws an error indicating that a key in the options object is invalid.\n * @param optionName\n */\n unexpectedOption(optionName: string) {\n const error = new TdError(\n `${this.base} Unexpected option: ${optionName} does not match a known option.`\n );\n error.code = 1;\n throw error;\n }\n\n /**\n * Throws an error indicating that one more keys in the options object is invalid.\n * @param optionName\n */\n unexpectedOptions(optionName: string[]) {\n const error = new TdError(`${this.base}: ${optionName.join(', ')}`);\n error.code = 1;\n throw error;\n }\n\n /**\n * Throws an error when an option is provide an unsupported value.\n * For example a value of 'cheese' for toolbarPlacement which only supports\n * 'top', 'bottom', 'default'.\n * @param optionName\n * @param badValue\n * @param validOptions\n */\n unexpectedOptionValue(\n optionName: string,\n badValue: string,\n validOptions: string[]\n ) {\n const error = new TdError(\n `${\n this.base\n } Unexpected option value: ${optionName} does not accept a value of \"${badValue}\". Valid values are: ${validOptions.join(\n ', '\n )}`\n );\n error.code = 2;\n throw error;\n }\n\n /**\n * Throws an error when an option value is the wrong type.\n * For example a string value was provided to multipleDates which only\n * supports true or false.\n * @param optionName\n * @param badType\n * @param expectedType\n */\n typeMismatch(optionName: string, badType: string, expectedType: string) {\n const error = new TdError(\n `${this.base} Mismatch types: ${optionName} has a type of ${badType} instead of the required ${expectedType}`\n );\n error.code = 3;\n throw error;\n }\n\n /**\n * Throws an error when an option value is outside of the expected range.\n * For example restrictions.daysOfWeekDisabled excepts a value between 0 and 6.\n * @param optionName\n * @param lower\n * @param upper\n */\n numbersOutOfRange(optionName: string, lower: number, upper: number) {\n const error = new TdError(\n `${this.base} ${optionName} expected an array of number between ${lower} and ${upper}.`\n );\n error.code = 4;\n throw error;\n }\n\n /**\n * Throws an error when a value for a date options couldn't be parsed. Either\n * the option was an invalid string or an invalid Date object.\n * @param optionName\n * @param date\n * @param soft If true, logs a warning instead of an error.\n */\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n failedToParseDate(optionName: string, date: any, soft = false) {\n const error = new TdError(\n `${this.base} Could not correctly parse \"${date}\" to a date for ${optionName}.`\n );\n error.code = 5;\n if (!soft) throw error;\n console.warn(error);\n }\n\n /**\n * Throws when an element to attach to was not provided in the constructor.\n */\n mustProvideElement() {\n const error = new TdError(`${this.base} No element was provided.`);\n error.code = 6;\n throw error;\n }\n\n /**\n * Throws if providing an array for the events to subscribe method doesn't have\n * the same number of callbacks. E.g., subscribe([1,2], [1])\n */\n subscribeMismatch() {\n const error = new TdError(\n `${this.base} The subscribed events does not match the number of callbacks`\n );\n error.code = 7;\n throw error;\n }\n\n /**\n * Throws if the configuration has conflicting rules e.g. minDate is after maxDate\n */\n conflictingConfiguration(message?: string) {\n const error = new TdError(\n `${this.base} A configuration value conflicts with another rule. ${message}`\n );\n error.code = 8;\n throw error;\n }\n\n /**\n * customDateFormat errors\n */\n customDateFormatError(message?: string) {\n const error = new TdError(`${this.base} Custom Date Format: ${message}`);\n error.code = 9;\n throw error;\n }\n\n /**\n * Logs a warning if a date option value is provided as a string, instead of\n * a date/datetime object.\n */\n dateString() {\n console.warn(\n `${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`\n );\n }\n\n deprecatedWarning(message: string, remediation?: string) {\n console.warn(\n `${this.base} Warning ${message} is deprecated and will be removed in a future version. ${remediation}`\n );\n }\n\n throwError(message) {\n const error = new TdError(`${this.base} ${message}`);\n error.code = 9;\n throw error;\n }\n\n //#endregion\n\n //#region used with notify.error\n\n /**\n * Used with an Error Event type if the user selects a date that\n * fails restriction validation.\n */\n failedToSetInvalidDate = 'Failed to set invalid date';\n\n /**\n * Used with an Error Event type when a user changes the value of the\n * input field directly, and does not provide a valid date.\n */\n failedToParseInput = 'Failed parse input field';\n\n //#endregion\n}\n","import { ErrorMessages } from './errors';\n// this is not the way I want this to stay but nested classes seemed to blown up once its compiled.\nconst NAME = 'tempus-dominus',\n dataKey = 'td';\n\n/**\n * Events\n */\nclass Events {\n key = `.${dataKey}`;\n\n /**\n * Change event. Fired when the user selects a date.\n * See also EventTypes.ChangeEvent\n */\n change = `change${this.key}`;\n\n /**\n * Emit when the view changes for example from month view to the year view.\n * See also EventTypes.ViewUpdateEvent\n */\n update = `update${this.key}`;\n\n /**\n * Emits when a selected date or value from the input field fails to meet the provided validation rules.\n * See also EventTypes.FailEvent\n */\n error = `error${this.key}`;\n\n /**\n * Show event\n * @event Events#show\n */\n show = `show${this.key}`;\n\n /**\n * Hide event\n * @event Events#hide\n */\n hide = `hide${this.key}`;\n\n // blur and focus are used in the jQuery provider but are otherwise unused.\n // keyup/down will be used later for keybinding options\n\n blur = `blur${this.key}`;\n focus = `focus${this.key}`;\n keyup = `keyup${this.key}`;\n keydown = `keydown${this.key}`;\n}\n\nclass Css {\n /**\n * The outer element for the widget.\n */\n widget = `${NAME}-widget`;\n\n /**\n * Hold the previous, next and switcher divs\n */\n calendarHeader = 'calendar-header';\n\n /**\n * The element for the action to change the calendar view. E.g. month -> year.\n */\n switch = 'picker-switch';\n\n /**\n * The elements for all the toolbar options\n */\n toolbar = 'toolbar';\n\n /**\n * Disables the hover and rounding affect.\n */\n noHighlight = 'no-highlight';\n\n /**\n * Applied to the widget element when the side by side option is in use.\n */\n sideBySide = 'timepicker-sbs';\n\n /**\n * The element for the action to change the calendar view, e.g. August -> July\n */\n previous = 'previous';\n\n /**\n * The element for the action to change the calendar view, e.g. August -> September\n */\n next = 'next';\n\n /**\n * Applied to any action that would violate any restriction options. ALso applied\n * to an input field if the disabled function is called.\n */\n disabled = 'disabled';\n\n /**\n * Applied to any date that is less than requested view,\n * e.g. the last day of the previous month.\n */\n old = 'old';\n\n /**\n * Applied to any date that is greater than of requested view,\n * e.g. the last day of the previous month.\n */\n new = 'new';\n\n /**\n * Applied to any date that is currently selected.\n */\n active = 'active';\n\n //#region date element\n\n /**\n * The outer element for the calendar view.\n */\n dateContainer = 'date-container';\n\n /**\n * The outer element for the decades view.\n */\n decadesContainer = `${this.dateContainer}-decades`;\n\n /**\n * Applied to elements within the decade container, e.g. 2020, 2030\n */\n decade = 'decade';\n\n /**\n * The outer element for the years view.\n */\n yearsContainer = `${this.dateContainer}-years`;\n\n /**\n * Applied to elements within the years container, e.g. 2021, 2021\n */\n year = 'year';\n\n /**\n * The outer element for the month view.\n */\n monthsContainer = `${this.dateContainer}-months`;\n\n /**\n * Applied to elements within the month container, e.g. January, February\n */\n month = 'month';\n\n /**\n * The outer element for the calendar view.\n */\n daysContainer = `${this.dateContainer}-days`;\n\n /**\n * Applied to elements within the day container, e.g. 1, 2..31\n */\n day = 'day';\n\n /**\n * If display.calendarWeeks is enabled, a column displaying the week of year\n * is shown. This class is applied to each cell in that column.\n */\n calendarWeeks = 'cw';\n\n /**\n * Applied to the first row of the calendar view, e.g. Sunday, Monday\n */\n dayOfTheWeek = 'dow';\n\n /**\n * Applied to the current date on the calendar view.\n */\n today = 'today';\n\n /**\n * Applied to the locale's weekend dates on the calendar view, e.g. Sunday, Saturday\n */\n weekend = 'weekend';\n\n rangeIn = 'range-in';\n rangeStart = 'range-start';\n rangeEnd = 'range-end';\n\n //#endregion\n\n //#region time element\n\n /**\n * The outer element for all time related elements.\n */\n timeContainer = 'time-container';\n\n /**\n * Applied the separator columns between time elements, e.g. hour *:* minute *:* second\n */\n separator = 'separator';\n\n /**\n * The outer element for the clock view.\n */\n clockContainer = `${this.timeContainer}-clock`;\n\n /**\n * The outer element for the hours selection view.\n */\n hourContainer = `${this.timeContainer}-hour`;\n\n /**\n * The outer element for the minutes selection view.\n */\n minuteContainer = `${this.timeContainer}-minute`;\n\n /**\n * The outer element for the seconds selection view.\n */\n secondContainer = `${this.timeContainer}-second`;\n\n /**\n * Applied to each element in the hours selection view.\n */\n hour = 'hour';\n\n /**\n * Applied to each element in the minutes selection view.\n */\n minute = 'minute';\n\n /**\n * Applied to each element in the seconds selection view.\n */\n second = 'second';\n\n /**\n * Applied AM/PM toggle button.\n */\n toggleMeridiem = 'toggleMeridiem';\n\n //#endregion\n\n //#region collapse\n\n /**\n * Applied the element of the current view mode, e.g. calendar or clock.\n */\n show = 'show';\n\n /**\n * Applied to the currently showing view mode during a transition\n * between calendar and clock views\n */\n collapsing = 'td-collapsing';\n\n /**\n * Applied to the currently hidden view mode.\n */\n collapse = 'td-collapse';\n\n //#endregion\n\n /**\n * Applied to the widget when the option display.inline is enabled.\n */\n inline = 'inline';\n\n /**\n * Applied to the widget when the option display.theme is light.\n */\n lightTheme = 'light';\n\n /**\n * Applied to the widget when the option display.theme is dark.\n */\n darkTheme = 'dark';\n\n /**\n * Used for detecting if the system color preference is dark mode\n */\n isDarkPreferredQuery = '(prefers-color-scheme: dark)';\n}\n\nexport default class Namespace {\n static NAME = NAME;\n // noinspection JSUnusedGlobalSymbols\n static dataKey = dataKey;\n\n static events = new Events();\n\n static css = new Css();\n\n static errorMessages = new ErrorMessages();\n}\n","import { FormatLocalization } from './options';\n\nconst DefaultFormatLocalization: FormatLocalization = {\n locale: 'default',\n hourCycle: undefined,\n dateFormats: {\n LTS: 'h:mm:ss T',\n LT: 'h:mm T',\n L: 'MM/dd/yyyy',\n LL: 'MMMM d, yyyy',\n LLL: 'MMMM d, yyyy h:mm T',\n LLLL: 'dddd, MMMM d, yyyy h:mm T',\n },\n ordinal: (n) => {\n const s = ['th', 'st', 'nd', 'rd'];\n const v = n % 100;\n return `[${n}${s[(v - 20) % 10] || s[v] || s[0]}]`;\n },\n format: 'L LT',\n};\n\nexport default { ...DefaultFormatLocalization };\n","import { FormatLocalization } from './utilities/options';\nimport Namespace from './utilities/namespace';\nimport DefaultFormatLocalization from './utilities/default-format-localization';\n\ntype parsedTime = {\n year?: number;\n month?: number;\n day?: number;\n hours?: number;\n minutes?: number;\n seconds?: number;\n milliseconds?: number;\n zone?: {\n offset: number;\n };\n};\n\nexport enum Unit {\n seconds = 'seconds',\n minutes = 'minutes',\n hours = 'hours',\n date = 'date',\n month = 'month',\n year = 'year',\n}\n\nconst twoDigitTemplate = {\n month: '2-digit',\n day: '2-digit',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n};\n\nexport interface DateTimeFormatOptions extends Intl.DateTimeFormatOptions {\n timeStyle?: 'short' | 'medium' | 'long';\n dateStyle?: 'short' | 'medium' | 'long' | 'full';\n numberingSystem?: string;\n}\n\n/**\n * Returns an Intl format object based on the provided object\n * @param unit\n */\nexport const getFormatByUnit = (unit: Unit): object => {\n switch (unit) {\n case 'date':\n return { dateStyle: 'short' };\n case 'month':\n return {\n month: 'numeric',\n year: 'numeric',\n };\n case 'year':\n return { year: 'numeric' };\n }\n};\n\n/**\n * Attempts to guess the hour cycle of the given local\n * @param locale\n */\nexport const guessHourCycle = (locale: string): Intl.LocaleHourCycleKey => {\n if (!locale) return 'h12';\n\n // noinspection SpellCheckingInspection\n const template = {\n hour: '2-digit',\n minute: '2-digit',\n numberingSystem: 'latn',\n };\n\n const dt = new DateTime().setLocalization({ locale });\n dt.hours = 0;\n\n const start = dt.parts(undefined, template).hour;\n\n //midnight is 12 so en-US style 12 AM\n if (start === '12') return 'h12';\n //midnight is 24 is from 00-24\n if (start === '24') return 'h24';\n\n dt.hours = 23;\n const end = dt.parts(undefined, template).hour;\n\n //if midnight is 00 and hour 23 is 11 then\n if (start === '00' && end === '11') return 'h11';\n\n if (start === '00' && end === '23') return 'h23';\n\n console.warn(\n `couldn't determine hour cycle for ${locale}. start: ${start}. end: ${end}`\n );\n\n return undefined;\n};\n\n/**\n * For the most part this object behaves exactly the same way\n * as the native Date object with a little extra spice.\n */\nexport class DateTime extends Date {\n localization: FormatLocalization = DefaultFormatLocalization;\n\n /**\n * Chainable way to set the {@link locale}\n * @param value\n * @deprecated use setLocalization with a FormatLocalization object instead\n */\n setLocale(value: string): this {\n if (!this.localization) {\n this.localization = DefaultFormatLocalization;\n this.localization.locale = value;\n }\n return this;\n }\n\n /**\n * Chainable way to set the {@link localization}\n * @param value\n */\n setLocalization(value: FormatLocalization): this {\n this.localization = value;\n return this;\n }\n\n /**\n * Converts a plain JS date object to a DateTime object.\n * Doing this allows access to format, etc.\n * @param date\n * @param locale this parameter is deprecated. Use formatLocalization instead.\n * @param formatLocalization\n */\n static convert(\n date: Date,\n locale = 'default',\n formatLocalization: FormatLocalization = undefined\n ): DateTime {\n if (!date) throw new Error(`A date is required`);\n\n if (!formatLocalization) {\n formatLocalization = DefaultFormatLocalization;\n formatLocalization.locale = locale;\n }\n\n return new DateTime(\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n date.getMilliseconds()\n ).setLocalization(formatLocalization);\n }\n\n /**\n * Native date manipulations are not pure functions. This function creates a duplicate of the DateTime object.\n */\n get clone() {\n return new DateTime(\n this.year,\n this.month,\n this.date,\n this.hours,\n this.minutes,\n this.seconds,\n this.getMilliseconds()\n ).setLocalization(this.localization);\n }\n\n static isValid(d): boolean {\n if (d === undefined || JSON.stringify(d) === 'null') return false;\n if (d.constructor.name === DateTime.name) return true;\n return false;\n }\n\n /**\n * Sets the current date to the start of the {@link unit} provided\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).startOf('month')\n * would return April 1, 2021, 12:00:00.000 AM (midnight)\n * @param unit\n * @param startOfTheWeek Allows for the changing the start of the week.\n */\n startOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n switch (unit) {\n case 'seconds':\n this.setMilliseconds(0);\n break;\n case 'minutes':\n this.setSeconds(0, 0);\n break;\n case 'hours':\n this.setMinutes(0, 0, 0);\n break;\n case 'date':\n this.setHours(0, 0, 0, 0);\n break;\n case 'weekDay': {\n this.startOf(Unit.date);\n if (this.weekDay === startOfTheWeek) break;\n let goBack = this.weekDay;\n if (startOfTheWeek !== 0 && this.weekDay === 0)\n goBack = 8 - startOfTheWeek;\n this.manipulate(startOfTheWeek - goBack, Unit.date);\n break;\n }\n case 'month':\n this.startOf(Unit.date);\n this.setDate(1);\n break;\n case 'year':\n this.startOf(Unit.date);\n this.setMonth(0, 1);\n break;\n }\n return this;\n }\n\n /**\n * Sets the current date to the end of the {@link unit} provided\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).endOf('month')\n * would return April 30, 2021, 11:59:59.999 PM\n * @param unit\n * @param startOfTheWeek\n */\n endOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n switch (unit) {\n case 'seconds':\n this.setMilliseconds(999);\n break;\n case 'minutes':\n this.setSeconds(59, 999);\n break;\n case 'hours':\n this.setMinutes(59, 59, 999);\n break;\n case 'date':\n this.setHours(23, 59, 59, 999);\n break;\n case 'weekDay': {\n this.endOf(Unit.date);\n const endOfWeek = 6 + startOfTheWeek;\n if (this.weekDay === endOfWeek) break;\n this.manipulate(endOfWeek - this.weekDay, Unit.date);\n break;\n }\n case 'month':\n this.endOf(Unit.date);\n this.manipulate(1, Unit.month);\n this.setDate(0);\n break;\n case 'year':\n this.endOf(Unit.date);\n this.setMonth(11, 31);\n break;\n }\n return this;\n }\n\n /**\n * Change a {@link unit} value. Value can be positive or negative\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).manipulate(1, 'month')\n * would return May 30, 2021, 11:45:32.984 AM\n * @param value A positive or negative number\n * @param unit\n */\n manipulate(value: number, unit: Unit): this {\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n this[unit] += value;\n return this;\n }\n\n /**\n * Return true if {@link compare} is before this date\n * @param compare The Date/DateTime to compare\n * @param unit If provided, uses {@link startOf} for\n * comparison.\n */\n isBefore(compare: DateTime, unit?: Unit): boolean {\n // If the comparisons is undefined, return false\n if (!DateTime.isValid(compare)) return false;\n\n if (!unit) return this.valueOf() < compare.valueOf();\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n return (\n this.clone.startOf(unit).valueOf() < compare.clone.startOf(unit).valueOf()\n );\n }\n\n /**\n * Return true if {@link compare} is after this date\n * @param compare The Date/DateTime to compare\n * @param unit If provided, uses {@link startOf} for\n * comparison.\n */\n isAfter(compare: DateTime, unit?: Unit): boolean {\n // If the comparisons is undefined, return false\n if (!DateTime.isValid(compare)) return false;\n\n if (!unit) return this.valueOf() > compare.valueOf();\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n return (\n this.clone.startOf(unit).valueOf() > compare.clone.startOf(unit).valueOf()\n );\n }\n\n /**\n * Return true if {@link compare} is same this date\n * @param compare The Date/DateTime to compare\n * @param unit If provided, uses {@link startOf} for\n * comparison.\n */\n isSame(compare: DateTime, unit?: Unit): boolean {\n // If the comparisons is undefined, return false\n if (!DateTime.isValid(compare)) return false;\n\n if (!unit) return this.valueOf() === compare.valueOf();\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n compare = DateTime.convert(compare);\n return (\n this.clone.startOf(unit).valueOf() === compare.startOf(unit).valueOf()\n );\n }\n\n /**\n * Check if this is between two other DateTimes, optionally looking at unit scale. The match is exclusive.\n * @param left\n * @param right\n * @param unit.\n * @param inclusivity. A [ indicates inclusion of a value. A ( indicates exclusion.\n * If the inclusivity parameter is used, both indicators must be passed.\n */\n isBetween(\n left: DateTime,\n right: DateTime,\n unit?: Unit,\n inclusivity: '()' | '[]' | '(]' | '[)' = '()'\n ): boolean {\n // If one of the comparisons is undefined, return false\n if (!DateTime.isValid(left) || !DateTime.isValid(right)) return false;\n // If a unit is provided and is not a valid property of the DateTime object, throw an error\n if (unit && this[unit] === undefined) {\n throw new Error(`Unit '${unit}' is not valid`);\n }\n\n const leftInclusivity = inclusivity[0] === '(';\n const rightInclusivity = inclusivity[1] === ')';\n\n const isLeftInRange = leftInclusivity\n ? this.isAfter(left, unit)\n : !this.isBefore(left, unit);\n const isRightInRange = rightInclusivity\n ? this.isBefore(right, unit)\n : !this.isAfter(right, unit);\n\n return isLeftInRange && isRightInRange;\n }\n\n /**\n * Returns flattened object of the date. Does not include literals\n * @param locale\n * @param template\n */\n parts(\n locale = this.localization.locale,\n template: Record = { dateStyle: 'full', timeStyle: 'long' }\n ): Record {\n const parts = {};\n new Intl.DateTimeFormat(locale, template)\n .formatToParts(this)\n .filter((x) => x.type !== 'literal')\n .forEach((x) => (parts[x.type] = x.value));\n return parts;\n }\n\n /**\n * Shortcut to Date.getSeconds()\n */\n get seconds(): number {\n return this.getSeconds();\n }\n\n /**\n * Shortcut to Date.setSeconds()\n */\n set seconds(value: number) {\n this.setSeconds(value);\n }\n\n /**\n * Returns two digit hours\n */\n get secondsFormatted(): string {\n return this.parts(undefined, twoDigitTemplate).second;\n }\n\n /**\n * Shortcut to Date.getMinutes()\n */\n get minutes(): number {\n return this.getMinutes();\n }\n\n /**\n * Shortcut to Date.setMinutes()\n */\n set minutes(value: number) {\n this.setMinutes(value);\n }\n\n /**\n * Returns two digit minutes\n */\n get minutesFormatted(): string {\n return this.parts(undefined, twoDigitTemplate).minute;\n }\n\n /**\n * Shortcut to Date.getHours()\n */\n get hours(): number {\n return this.getHours();\n }\n\n /**\n * Shortcut to Date.setHours()\n */\n set hours(value: number) {\n this.setHours(value);\n }\n\n /**\n * Returns two digit hour, e.g. 01...10\n * @param hourCycle Providing an hour cycle will change 00 to 24 depending on the given value.\n */\n getHoursFormatted(hourCycle: Intl.LocaleHourCycleKey = 'h12') {\n return this.parts(undefined, { ...twoDigitTemplate, hourCycle: hourCycle })\n .hour;\n }\n\n /**\n * Get the meridiem of the date. E.g. AM or PM.\n * If the {@link locale} provides a \"dayPeriod\" then this will be returned,\n * otherwise it will return AM or PM.\n * @param locale\n */\n meridiem(locale: string = this.localization.locale): string {\n return new Intl.DateTimeFormat(locale, {\n hour: 'numeric',\n hour12: true,\n })\n .formatToParts(this)\n .find((p) => p.type === 'dayPeriod')?.value;\n }\n\n /**\n * Shortcut to Date.getDate()\n */\n get date(): number {\n return this.getDate();\n }\n\n /**\n * Shortcut to Date.setDate()\n */\n set date(value: number) {\n this.setDate(value);\n }\n\n /**\n * Return two digit date\n */\n get dateFormatted(): string {\n return this.parts(undefined, twoDigitTemplate).day;\n }\n\n /**\n * Shortcut to Date.getDay()\n */\n get weekDay(): number {\n return this.getDay();\n }\n\n /**\n * Shortcut to Date.getMonth()\n */\n get month(): number {\n return this.getMonth();\n }\n\n /**\n * Shortcut to Date.setMonth()\n */\n set month(value: number) {\n const targetMonth = new Date(this.year, value + 1);\n targetMonth.setDate(0);\n const endOfMonth = targetMonth.getDate();\n if (this.date > endOfMonth) {\n this.date = endOfMonth;\n }\n this.setMonth(value);\n }\n\n /**\n * Return two digit, human expected month. E.g. January = 1, December = 12\n */\n get monthFormatted(): string {\n return this.parts(undefined, twoDigitTemplate).month;\n }\n\n /**\n * Shortcut to Date.getFullYear()\n */\n get year(): number {\n return this.getFullYear();\n }\n\n /**\n * Shortcut to Date.setFullYear()\n */\n set year(value: number) {\n this.setFullYear(value);\n }\n\n // borrowed a bunch of stuff from Luxon\n /**\n * Gets the week of the year\n */\n get week(): number {\n const ordinal = this.computeOrdinal(),\n weekday = this.getUTCDay();\n\n let weekNumber = Math.floor((ordinal - weekday + 10) / 7);\n\n if (weekNumber < 1) {\n weekNumber = this.weeksInWeekYear();\n } else if (weekNumber > this.weeksInWeekYear()) {\n weekNumber = 1;\n }\n\n return weekNumber;\n }\n\n /**\n * Returns the number of weeks in the year\n */\n weeksInWeekYear() {\n const p1 =\n (this.year +\n Math.floor(this.year / 4) -\n Math.floor(this.year / 100) +\n Math.floor(this.year / 400)) %\n 7,\n last = this.year - 1,\n p2 =\n (last +\n Math.floor(last / 4) -\n Math.floor(last / 100) +\n Math.floor(last / 400)) %\n 7;\n return p1 === 4 || p2 === 3 ? 53 : 52;\n }\n\n /**\n * Returns true or false depending on if the year is a leap year or not.\n */\n get isLeapYear() {\n return (\n this.year % 4 === 0 && (this.year % 100 !== 0 || this.year % 400 === 0)\n );\n }\n\n private computeOrdinal() {\n return (\n this.date +\n (this.isLeapYear ? this.leapLadder : this.nonLeapLadder)[this.month]\n );\n }\n\n private nonLeapLadder = [\n 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334,\n ];\n private leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\n //#region CDF stuff\n\n private dateTimeRegex =\n //is regex cannot be simplified beyond what it already is\n /(\\[[^[\\]]*])|y{1,4}|M{1,4}|d{1,4}|H{1,2}|h{1,2}|t|T|m{1,2}|s{1,2}|f{3}/g; //NOSONAR\n\n private formattingTokens =\n /(\\[[^[\\]]*])|([-_:/.,()\\s]+)|(T|t|yyyy|yy?|MM?M?M?|Do|dd?|hh?|HH?|mm?|ss?)/g; //NOSONAR is regex cannot be simplified beyond what it already is\n\n /**\n * Returns a list of month values based on the current locale\n */\n private getAllMonths(\n format: '2-digit' | 'numeric' | 'long' | 'short' | 'narrow' = 'long'\n ) {\n const applyFormat = new Intl.DateTimeFormat(this.localization.locale, {\n month: format,\n }).format;\n return [...Array(12).keys()].map((m) => applyFormat(new Date(2021, m)));\n }\n\n /**\n * Replaces an expanded token set (e.g. LT/LTS)\n */\n private replaceTokens(formatStr, formats) {\n /***\n * _ => match\n * a => first capture group. Anything between [ and ]\n * b => second capture group\n */\n return formatStr.replace(\n /(\\[[^[\\]]*])|(LTS?|l{1,4}|L{1,4})/g,\n (_, a, b) => {\n const B = b && b.toUpperCase();\n return a || formats[B] || DefaultFormatLocalization.dateFormats[B];\n }\n );\n }\n\n private match2 = /\\d\\d/; // 00 - 99\n private match3 = /\\d{3}/; // 000 - 999\n private match4 = /\\d{4}/; // 0000 - 9999\n private match1to2 = /\\d\\d?/; // 0 - 99\n private matchSigned = /[+-]?\\d+/; // -inf - inf\n private matchOffset = /[+-]\\d\\d:?(\\d\\d)?|Z/; // +00:00 -00:00 +0000 or -0000 +00 or Z\n private matchWord = /[^\\d_:/,\\-()\\s]+/; // Word\n\n private parseTwoDigitYear(input) {\n input = +input;\n return input + (input > 68 ? 1900 : 2000);\n }\n\n private offsetFromString(string) {\n if (!string) return 0;\n if (string === 'Z') return 0;\n const [first, second, third] = string.match(/([+-]|\\d\\d)/g);\n const minutes = +(second * 60) + (+third || 0);\n const signed = first === '+' ? -minutes : minutes;\n return minutes === 0 ? 0 : signed; // eslint-disable-line no-nested-ternary\n }\n\n /**\n * z = -4, zz = -04, zzz = -0400\n * @param date\n * @param style\n * @private\n */\n private zoneInformation(date: DateTime, style: 'z' | 'zz' | 'zzz') {\n let name = date\n .parts(this.localization.locale, { timeZoneName: 'longOffset' })\n .timeZoneName.replace('GMT', '')\n .replace(':', '');\n\n const negative = name.includes('-');\n\n name = name.replace('-', '');\n\n if (style === 'z') name = name.substring(1, 2);\n else if (style === 'zz') name = name.substring(0, 2);\n\n return `${negative ? '-' : ''}${name}`;\n }\n\n private zoneExpressions = [\n this.matchOffset,\n (obj, input) => {\n obj.offset = this.offsetFromString(input);\n },\n ];\n\n private addInput(property) {\n return (time, input) => {\n time[property] = +input;\n };\n }\n\n private meridiemMatch(input) {\n const meridiem = new Intl.DateTimeFormat(this.localization.locale, {\n hour: 'numeric',\n hour12: true,\n })\n .formatToParts(new Date(2022, 3, 4, 13))\n .find((p) => p.type === 'dayPeriod')?.value;\n\n return input.toLowerCase() === meridiem.toLowerCase();\n }\n\n private expressions = {\n t: [\n this.matchWord,\n (ojb, input) => {\n ojb.afternoon = this.meridiemMatch(input);\n },\n ],\n T: [\n this.matchWord,\n (ojb, input) => {\n ojb.afternoon = this.meridiemMatch(input);\n },\n ],\n fff: [\n this.match3,\n (ojb, input) => {\n ojb.milliseconds = +input;\n },\n ],\n s: [this.match1to2, this.addInput('seconds')],\n ss: [this.match1to2, this.addInput('seconds')],\n m: [this.match1to2, this.addInput('minutes')],\n mm: [this.match1to2, this.addInput('minutes')],\n H: [this.match1to2, this.addInput('hours')],\n h: [this.match1to2, this.addInput('hours')],\n HH: [this.match1to2, this.addInput('hours')],\n hh: [this.match1to2, this.addInput('hours')],\n d: [this.match1to2, this.addInput('day')],\n dd: [this.match2, this.addInput('day')],\n Do: [\n this.matchWord,\n (ojb, input) => {\n [ojb.day] = input.match(/\\d+/);\n if (!this.localization.ordinal) return;\n for (let i = 1; i <= 31; i += 1) {\n if (this.localization.ordinal(i).replace(/[[\\]]/g, '') === input) {\n ojb.day = i;\n }\n }\n },\n ],\n M: [this.match1to2, this.addInput('month')],\n MM: [this.match2, this.addInput('month')],\n MMM: [\n this.matchWord,\n (obj, input) => {\n const months = this.getAllMonths();\n const monthsShort = this.getAllMonths('short');\n const matchIndex =\n (monthsShort || months.map((_) => _.slice(0, 3))).indexOf(input) + 1;\n if (matchIndex < 1) {\n throw new Error();\n }\n obj.month = matchIndex % 12 || matchIndex;\n },\n ],\n MMMM: [\n this.matchWord,\n (obj, input) => {\n const months = this.getAllMonths();\n const matchIndex = months.indexOf(input) + 1;\n if (matchIndex < 1) {\n throw new Error();\n }\n obj.month = matchIndex % 12 || matchIndex;\n },\n ],\n y: [this.matchSigned, this.addInput('year')],\n yy: [\n this.match2,\n (obj, input) => {\n obj.year = this.parseTwoDigitYear(input);\n },\n ],\n yyyy: [this.match4, this.addInput('year')],\n // z: this.zoneExpressions,\n // zz: this.zoneExpressions,\n // zzz: this.zoneExpressions\n };\n\n private correctHours(time) {\n const { afternoon } = time;\n if (afternoon !== undefined) {\n const { hours } = time;\n if (afternoon) {\n if (hours < 12) {\n time.hours += 12;\n }\n } else if (hours === 12) {\n time.hours = 0;\n }\n delete time.afternoon;\n }\n }\n\n private makeParser(format) {\n format = this.replaceTokens(format, this.localization.dateFormats);\n const array = format.match(this.formattingTokens);\n const { length } = array;\n for (let i = 0; i < length; i += 1) {\n const token = array[i];\n const parseTo = this.expressions[token];\n const regex = parseTo && parseTo[0];\n const parser = parseTo && parseTo[1];\n if (parser) {\n array[i] = { regex, parser };\n } else {\n array[i] = token.replace(/^\\[[^[\\]]*]$/g, '');\n }\n }\n\n return (input): parsedTime => {\n const time = {\n hours: 0,\n minutes: 0,\n seconds: 0,\n milliseconds: 0,\n };\n for (let i = 0, start = 0; i < length; i += 1) {\n const token = array[i];\n if (typeof token === 'string') {\n start += token.length;\n } else {\n const { regex, parser } = token;\n const part = input.slice(start);\n const match = regex.exec(part);\n const value = match[0];\n parser.call(this, time, value);\n input = input.replace(value, '');\n }\n }\n this.correctHours(time);\n return time;\n };\n }\n\n /**\n * Attempts to create a DateTime from a string.\n * @param input date as string\n * @param localization provides the date template the string is in via the format property\n */\n //eslint-disable-next-line @typescript-eslint/no-unused-vars\n static fromString(input: string, localization: FormatLocalization): DateTime {\n if (!localization?.format) {\n Namespace.errorMessages.customDateFormatError('No format was provided');\n }\n try {\n const dt = new DateTime();\n dt.setLocalization(localization);\n if (['x', 'X'].indexOf(localization.format) > -1)\n return new DateTime((localization.format === 'X' ? 1000 : 1) * +input);\n\n const parser = dt.makeParser(localization.format);\n const { year, month, day, hours, minutes, seconds, milliseconds, zone } =\n parser(input);\n const d = day || (!year && !month ? dt.getDate() : 1);\n const y = year || dt.getFullYear();\n let M = 0;\n if (!(year && !month)) {\n M = month > 0 ? month - 1 : dt.getMonth();\n }\n if (zone) {\n return new DateTime(\n Date.UTC(\n y,\n M,\n d,\n hours,\n minutes,\n seconds,\n milliseconds + zone.offset * 60 * 1000\n )\n );\n }\n return new DateTime(y, M, d, hours, minutes, seconds, milliseconds);\n } catch (e) {\n Namespace.errorMessages.customDateFormatError(\n `Unable to parse provided input: ${input}, format: ${localization.format}`\n );\n }\n }\n\n /**\n * Returns a string format.\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat\n * for valid templates and locale objects\n * @param template An optional object. If provided, method will use Intl., otherwise the localizations format properties\n * @param locale Can be a string or an array of strings. Uses browser defaults otherwise.\n */\n format(\n template?: DateTimeFormatOptions | string,\n locale = this.localization.locale\n ): string {\n if (template && typeof template === 'object')\n return new Intl.DateTimeFormat(locale, template).format(this);\n\n const formatString = this.replaceTokens(\n //try template first\n template ||\n //otherwise try localization format\n this.localization.format ||\n //otherwise try date + time\n `${DefaultFormatLocalization.dateFormats.L}, ${DefaultFormatLocalization.dateFormats.LT}`,\n this.localization.dateFormats\n );\n\n const formatter = (template) =>\n new Intl.DateTimeFormat(this.localization.locale, template).format(this);\n\n if (!this.localization.hourCycle)\n this.localization.hourCycle = guessHourCycle(this.localization.locale);\n\n //if the format asks for a twenty-four-hour string but the hour cycle is not, then make a base guess\n const HHCycle = this.localization.hourCycle.startsWith('h1')\n ? 'h24'\n : this.localization.hourCycle;\n const hhCycle = this.localization.hourCycle.startsWith('h2')\n ? 'h12'\n : this.localization.hourCycle;\n\n const matches = {\n yy: formatter({ year: '2-digit' }),\n yyyy: this.year,\n M: formatter({ month: 'numeric' }),\n MM: this.monthFormatted,\n MMM: this.getAllMonths('short')[this.getMonth()],\n MMMM: this.getAllMonths()[this.getMonth()],\n d: this.date,\n dd: this.dateFormatted,\n ddd: formatter({ weekday: 'short' }),\n dddd: formatter({ weekday: 'long' }),\n H: this.getHours(),\n HH: this.getHoursFormatted(HHCycle),\n h: this.hours > 12 ? this.hours - 12 : this.hours,\n hh: this.getHoursFormatted(hhCycle),\n t: this.meridiem(),\n T: this.meridiem().toUpperCase(),\n m: this.minutes,\n mm: this.minutesFormatted,\n s: this.seconds,\n ss: this.secondsFormatted,\n fff: this.getMilliseconds(),\n // z: this.zoneInformation(dateTime, 'z'), //-4\n // zz: this.zoneInformation(dateTime, 'zz'), //-04\n // zzz: this.zoneInformation(dateTime, 'zzz') //-0400\n };\n\n return formatString\n .replace(this.dateTimeRegex, (match, $1) => {\n return $1 || matches[match];\n })\n .replace(/\\[/g, '')\n .replace(/]/g, '');\n }\n\n //#endregion CDF stuff\n}\n","//eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport declare type Constructable = new (...args: any[]) => T;\n\nclass ServiceLocator {\n private cache: Map, unknown | symbol> = new Map();\n\n locate(identifier: Constructable): T {\n const service = this.cache.get(identifier);\n if (service) return service as T;\n const value = new identifier();\n this.cache.set(identifier, value);\n return value;\n }\n}\nexport const setupServiceLocator = () => {\n serviceLocator = new ServiceLocator();\n};\n\nexport let serviceLocator: ServiceLocator;\n","import { Unit } from '../datetime';\nimport Namespace from './namespace';\nimport ViewMode from './view-mode';\n\nconst CalendarModes: {\n name: keyof ViewMode;\n className: string;\n unit: Unit;\n step: number;\n}[] = [\n {\n name: 'calendar',\n className: Namespace.css.daysContainer,\n unit: Unit.month,\n step: 1,\n },\n {\n name: 'months',\n className: Namespace.css.monthsContainer,\n unit: Unit.year,\n step: 1,\n },\n {\n name: 'years',\n className: Namespace.css.yearsContainer,\n unit: Unit.year,\n step: 10,\n },\n {\n name: 'decades',\n className: Namespace.css.decadesContainer,\n unit: Unit.year,\n step: 100,\n },\n];\n\nexport default CalendarModes;\n","import { DateTime } from '../datetime';\nimport CalendarModes from './calendar-modes';\nimport ViewMode from './view-mode';\nimport Options from './options';\n\nexport class OptionsStore {\n options: Options;\n element: HTMLElement;\n input: HTMLInputElement;\n unset: boolean;\n private _currentCalendarViewMode = 0;\n\n get currentCalendarViewMode() {\n return this._currentCalendarViewMode;\n }\n\n set currentCalendarViewMode(value) {\n this._currentCalendarViewMode = value;\n this.currentView = CalendarModes[value].name;\n }\n\n _viewDate = new DateTime();\n\n get viewDate() {\n return this._viewDate;\n }\n\n set viewDate(v) {\n this._viewDate = v;\n if (this.options) this.options.viewDate = v;\n }\n\n /**\n * When switching back to the calendar from the clock,\n * this sets currentView to the correct calendar view.\n */\n refreshCurrentView() {\n this.currentView = CalendarModes[this.currentCalendarViewMode].name;\n }\n\n minimumCalendarViewMode = 0;\n currentView: keyof ViewMode = 'calendar';\n\n get isTwelveHour() {\n return ['h12', 'h11'].includes(this.options.localization.hourCycle);\n }\n}\n","import { DateTime, Unit } from './datetime';\nimport { serviceLocator } from './utilities/service-locator';\nimport { OptionsStore } from './utilities/optionsStore';\n\n/**\n * Main class for date validation rules based on the options provided.\n */\nexport default class Validation {\n private optionsStore: OptionsStore;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n }\n\n /**\n * Checks to see if the target date is valid based on the rules provided in the options.\n * Granularity can be provided to check portions of the date instead of the whole.\n * @param targetDate\n * @param granularity\n */\n isValid(targetDate: DateTime, granularity?: Unit): boolean {\n if (!this._enabledDisabledDatesIsValid(granularity, targetDate))\n return false;\n\n if (\n granularity !== Unit.month &&\n granularity !== Unit.year &&\n this.optionsStore.options.restrictions.daysOfWeekDisabled?.length > 0 &&\n this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(\n targetDate.weekDay\n ) !== -1\n )\n return false;\n\n if (!this._minMaxIsValid(granularity, targetDate)) return false;\n\n if (\n granularity === Unit.hours ||\n granularity === Unit.minutes ||\n granularity === Unit.seconds\n ) {\n if (!this._enabledDisabledHoursIsValid(targetDate)) return false;\n\n if (\n this.optionsStore.options.restrictions.disabledTimeIntervals?.filter(\n (internal) => targetDate.isBetween(internal.from, internal.to)\n ).length !== 0\n )\n return false;\n }\n\n return true;\n }\n\n private _enabledDisabledDatesIsValid(\n granularity: Unit,\n targetDate: DateTime\n ): boolean {\n if (granularity !== Unit.date) return true;\n\n if (\n this.optionsStore.options.restrictions.disabledDates.length > 0 &&\n this._isInDisabledDates(targetDate)\n ) {\n return false;\n }\n\n // noinspection RedundantIfStatementJS\n if (\n this.optionsStore.options.restrictions.enabledDates.length > 0 &&\n !this._isInEnabledDates(targetDate)\n ) {\n return false;\n }\n\n return true;\n }\n\n /**\n * Checks to see if the disabledDates option is in use and returns true (meaning invalid)\n * if the `testDate` is with in the array. Granularity is by date.\n * @param testDate\n * @private\n */\n private _isInDisabledDates(testDate: DateTime) {\n if (\n !this.optionsStore.options.restrictions.disabledDates ||\n this.optionsStore.options.restrictions.disabledDates.length === 0\n )\n return false;\n\n return !!this.optionsStore.options.restrictions.disabledDates.find((x) =>\n x.isSame(testDate, Unit.date)\n );\n }\n\n /**\n * Checks to see if the enabledDates option is in use and returns true (meaning valid)\n * if the `testDate` is with in the array. Granularity is by date.\n * @param testDate\n * @private\n */\n private _isInEnabledDates(testDate: DateTime) {\n if (\n !this.optionsStore.options.restrictions.enabledDates ||\n this.optionsStore.options.restrictions.enabledDates.length === 0\n )\n return true;\n\n return !!this.optionsStore.options.restrictions.enabledDates.find((x) =>\n x.isSame(testDate, Unit.date)\n );\n }\n\n private _minMaxIsValid(granularity: Unit, targetDate: DateTime) {\n if (\n this.optionsStore.options.restrictions.minDate &&\n targetDate.isBefore(\n this.optionsStore.options.restrictions.minDate,\n granularity\n )\n ) {\n return false;\n }\n\n // noinspection RedundantIfStatementJS\n if (\n this.optionsStore.options.restrictions.maxDate &&\n targetDate.isAfter(\n this.optionsStore.options.restrictions.maxDate,\n granularity\n )\n ) {\n return false;\n }\n\n return true;\n }\n\n private _enabledDisabledHoursIsValid(targetDate) {\n if (\n this.optionsStore.options.restrictions.disabledHours.length > 0 &&\n this._isInDisabledHours(targetDate)\n ) {\n return false;\n }\n\n // noinspection RedundantIfStatementJS\n if (\n this.optionsStore.options.restrictions.enabledHours.length > 0 &&\n !this._isInEnabledHours(targetDate)\n ) {\n return false;\n }\n\n return true;\n }\n\n /**\n * Checks to see if the disabledHours option is in use and returns true (meaning invalid)\n * if the `testDate` is with in the array. Granularity is by hours.\n * @param testDate\n * @private\n */\n private _isInDisabledHours(testDate: DateTime) {\n if (\n !this.optionsStore.options.restrictions.disabledHours ||\n this.optionsStore.options.restrictions.disabledHours.length === 0\n )\n return false;\n\n const formattedDate = testDate.hours;\n return this.optionsStore.options.restrictions.disabledHours.includes(\n formattedDate\n );\n }\n\n /**\n * Checks to see if the enabledHours option is in use and returns true (meaning valid)\n * if the `testDate` is with in the array. Granularity is by hours.\n * @param testDate\n * @private\n */\n private _isInEnabledHours(testDate: DateTime) {\n if (\n !this.optionsStore.options.restrictions.enabledHours ||\n this.optionsStore.options.restrictions.enabledHours.length === 0\n )\n return true;\n\n const formattedDate = testDate.hours;\n return this.optionsStore.options.restrictions.enabledHours.includes(\n formattedDate\n );\n }\n\n dateRangeIsValid(dates: DateTime[], index: number, target: DateTime) {\n // if we're not using the option, then return valid\n if (!this.optionsStore.options.dateRange) return true;\n\n // if we've only selected 0..1 dates, and we're not setting the end date\n // then return valid. We only want to validate the range if both are selected,\n // because the other validation on the target has already occurred.\n if (dates.length !== 2 && index !== 1) return true;\n\n // initialize start date\n const start = dates[0];\n\n // check if start date is not the same as target date\n if (start.isSame(target, Unit.date)) return true;\n\n // add one day to start; start has already been validated\n start.clone.manipulate(1, Unit.date);\n\n // check each date in the range to make sure it's valid\n while (!start.isSame(target, Unit.date)) {\n const valid = this.isValid(start, Unit.date);\n if (!valid) return false;\n start.manipulate(1, Unit.date);\n }\n\n return true;\n }\n}\n","import { DateTime, Unit } from '../datetime';\nimport ActionTypes from './action-types';\nimport { BaseEvent } from './event-types';\n\nexport type ViewUpdateValues = Unit | 'clock' | 'calendar' | 'all';\n\nclass EventEmitter {\n private subscribers: ((value?: T) => void)[] = [];\n\n subscribe(callback: (value: T) => void) {\n this.subscribers.push(callback);\n return this.unsubscribe.bind(this, this.subscribers.length - 1);\n }\n\n unsubscribe(index: number) {\n this.subscribers.splice(index, 1);\n }\n\n emit(value?: T) {\n this.subscribers.forEach((callback) => {\n callback(value);\n });\n }\n\n destroy() {\n this.subscribers = null;\n this.subscribers = [];\n }\n}\n\nexport class EventEmitters {\n triggerEvent = new EventEmitter();\n viewUpdate = new EventEmitter();\n updateDisplay = new EventEmitter();\n action = new EventEmitter<{ e: any; action?: ActionTypes }>(); //eslint-disable-line @typescript-eslint/no-explicit-any\n updateViewDate = new EventEmitter();\n\n destroy() {\n this.triggerEvent.destroy();\n this.viewUpdate.destroy();\n this.updateDisplay.destroy();\n this.action.destroy();\n this.updateViewDate.destroy();\n }\n}\n","import Options, { Localization } from './options';\nimport { DateTime } from '../datetime';\nimport DefaultFormatLocalization from './default-format-localization';\n\nconst defaultEnLocalization: Localization = {\n clear: 'Clear selection',\n close: 'Close the picker',\n dateFormats: DefaultFormatLocalization.dateFormats,\n dayViewHeaderFormat: { month: 'long', year: '2-digit' },\n decrementHour: 'Decrement Hour',\n decrementMinute: 'Decrement Minute',\n decrementSecond: 'Decrement Second',\n format: DefaultFormatLocalization.format,\n hourCycle: DefaultFormatLocalization.hourCycle,\n incrementHour: 'Increment Hour',\n incrementMinute: 'Increment Minute',\n incrementSecond: 'Increment Second',\n locale: DefaultFormatLocalization.locale,\n nextCentury: 'Next Century',\n nextDecade: 'Next Decade',\n nextMonth: 'Next Month',\n nextYear: 'Next Year',\n ordinal: DefaultFormatLocalization.ordinal,\n pickHour: 'Pick Hour',\n pickMinute: 'Pick Minute',\n pickSecond: 'Pick Second',\n previousCentury: 'Previous Century',\n previousDecade: 'Previous Decade',\n previousMonth: 'Previous Month',\n previousYear: 'Previous Year',\n selectDate: 'Select Date',\n selectDecade: 'Select Decade',\n selectMonth: 'Select Month',\n selectTime: 'Select Time',\n selectYear: 'Select Year',\n startOfTheWeek: 0,\n today: 'Go to today',\n toggleMeridiem: 'Toggle Meridiem',\n};\n\nconst DefaultOptions: Options = {\n allowInputToggle: false,\n container: undefined,\n dateRange: false,\n debug: false,\n defaultDate: undefined,\n display: {\n icons: {\n type: 'icons',\n time: 'fa-solid fa-clock',\n date: 'fa-solid fa-calendar',\n up: 'fa-solid fa-arrow-up',\n down: 'fa-solid fa-arrow-down',\n previous: 'fa-solid fa-chevron-left',\n next: 'fa-solid fa-chevron-right',\n today: 'fa-solid fa-calendar-check',\n clear: 'fa-solid fa-trash',\n close: 'fa-solid fa-xmark',\n },\n sideBySide: false,\n calendarWeeks: false,\n viewMode: 'calendar',\n toolbarPlacement: 'bottom',\n keepOpen: false,\n buttons: {\n today: false,\n clear: false,\n close: false,\n },\n components: {\n calendar: true,\n date: true,\n month: true,\n year: true,\n decades: true,\n clock: true,\n hours: true,\n minutes: true,\n seconds: false,\n useTwentyfourHour: undefined,\n },\n inline: false,\n theme: 'auto',\n placement: 'bottom',\n },\n keepInvalid: false,\n localization: defaultEnLocalization,\n meta: {},\n multipleDates: false,\n multipleDatesSeparator: '; ',\n promptTimeOnDateChange: false,\n promptTimeOnDateChangeTransitionDelay: 200,\n restrictions: {\n minDate: undefined,\n maxDate: undefined,\n disabledDates: [],\n enabledDates: [],\n daysOfWeekDisabled: [],\n disabledTimeIntervals: [],\n disabledHours: [],\n enabledHours: [],\n },\n stepping: 1,\n useCurrent: true,\n viewDate: new DateTime(),\n};\n\nexport default DefaultOptions;\nexport const DefaultEnLocalization = { ...defaultEnLocalization };\n","import Namespace from './namespace';\nimport { DateTime } from '../datetime';\nimport { FormatLocalization } from './options';\nimport DefaultFormatLocalization from './default-format-localization';\n\n/**\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\n * @param d If a string will attempt creating a date from it.\n * @param localization object containing locale and format settings. Only used with the custom formats\n * @private\n */\nexport function tryConvertToDateTime(\n this: void,\n d: DateTime | Date | '',\n localization: FormatLocalization\n): DateTime | null {\n if (!d) return null;\n if (d.constructor.name === DateTime.name) return d as DateTime;\n if (d.constructor.name === Date.name) {\n return DateTime.convert(d as Date);\n }\n if (typeof d === typeof '') {\n const dateTime = DateTime.fromString(d as unknown as string, localization);\n if (JSON.stringify(dateTime) === 'null') {\n return null;\n }\n return dateTime;\n }\n return null;\n}\n\n/**\n * Attempts to convert `d` to a DateTime object\n * @param d value to convert\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param localization object containing locale and format settings. Only used with the custom formats\n */\nexport function convertToDateTime(\n this: void,\n d: DateTime | Date | '',\n optionName: string,\n localization: FormatLocalization\n): DateTime {\n if (typeof d === typeof '' && optionName !== 'input') {\n Namespace.errorMessages.dateString();\n }\n\n const converted = tryConvertToDateTime(d, localization);\n\n if (!converted) {\n Namespace.errorMessages.failedToParseDate(\n optionName,\n d,\n optionName === 'input'\n );\n }\n return converted;\n}\n\n/**\n * Type checks that `value` is an array of Date or DateTime\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param value Option value\n * @param providedType Used to provide text to error messages\n * @param localization\n */\nexport function typeCheckDateArray(\n this: void,\n optionName: string,\n value: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n providedType: string,\n localization: FormatLocalization\n) {\n if (!Array.isArray(value)) {\n Namespace.errorMessages.typeMismatch(\n optionName,\n providedType,\n 'array of DateTime or Date'\n );\n }\n for (let i = 0; i < value.length; i++) {\n const d = value[i];\n const dateTime = convertToDateTime(d, optionName, localization);\n if (!dateTime) {\n Namespace.errorMessages.typeMismatch(\n optionName,\n typeof d,\n 'DateTime or Date'\n );\n }\n dateTime.setLocalization(localization ?? DefaultFormatLocalization);\n value[i] = dateTime;\n }\n}\n\n/**\n * Type checks that `value` is an array of numbers\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param value Option value\n * @param providedType Used to provide text to error messages\n */\nexport function typeCheckNumberArray(\n this: void,\n optionName: string,\n value: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n providedType: string\n) {\n if (!Array.isArray(value) || value.some((x) => typeof x !== typeof 0)) {\n Namespace.errorMessages.typeMismatch(\n optionName,\n providedType,\n 'array of numbers'\n );\n }\n}\n","import Namespace from './namespace';\nimport type { FormatLocalization } from './options';\nimport {\n convertToDateTime,\n typeCheckNumberArray,\n typeCheckDateArray,\n} from './typeChecker';\n\ninterface OptionProcessorFunctionArguments {\n key: string;\n value: any; //eslint-disable-line @typescript-eslint/no-explicit-any\n providedType: string;\n defaultType: string;\n path: string;\n localization: FormatLocalization;\n}\n\ntype OptionProcessorFunction = (\n this: void,\n args: OptionProcessorFunctionArguments\n) => any; //eslint-disable-line @typescript-eslint/no-explicit-any\n\nfunction mandatoryDate(key: string): OptionProcessorFunction {\n return ({ value, providedType, localization }) => {\n const dateTime = convertToDateTime(value, key, localization);\n if (dateTime !== undefined) {\n dateTime.setLocalization(localization);\n return dateTime;\n }\n Namespace.errorMessages.typeMismatch(key, providedType, 'DateTime or Date');\n };\n}\n\nfunction optionalDate(key: string): OptionProcessorFunction {\n const mandatory = mandatoryDate(key);\n return (args) => {\n if (args.value === undefined) {\n return args.value;\n }\n return mandatory(args);\n };\n}\n\nfunction numbersInRange(\n key: string,\n lower: number,\n upper: number\n): OptionProcessorFunction {\n return ({ value, providedType }) => {\n if (value === undefined) {\n return [];\n }\n typeCheckNumberArray(key, value, providedType);\n if ((value as number[]).some((x) => x < lower || x > upper))\n Namespace.errorMessages.numbersOutOfRange(key, lower, upper);\n return value;\n };\n}\n\nfunction validHourRange(key: string): OptionProcessorFunction {\n return numbersInRange(key, 0, 23);\n}\n\nfunction validDateArray(key: string): OptionProcessorFunction {\n return ({ value, providedType, localization }) => {\n if (value === undefined) {\n return [];\n }\n typeCheckDateArray(key, value, providedType, localization);\n return value;\n };\n}\n\nfunction validKeyOption(keyOptions: string[]): OptionProcessorFunction {\n return ({ value, path }) => {\n if (!keyOptions.includes(value))\n Namespace.errorMessages.unexpectedOptionValue(\n path.substring(1),\n value,\n keyOptions\n );\n return value;\n };\n}\n\nconst optionProcessors: { [key: string]: OptionProcessorFunction } =\n Object.freeze({\n defaultDate: mandatoryDate('defaultDate'),\n viewDate: mandatoryDate('viewDate'),\n minDate: optionalDate('restrictions.minDate'),\n maxDate: optionalDate('restrictions.maxDate'),\n disabledHours: validHourRange('restrictions.disabledHours'),\n enabledHours: validHourRange('restrictions.enabledHours'),\n disabledDates: validDateArray('restrictions.disabledDates'),\n enabledDates: validDateArray('restrictions.enabledDates'),\n daysOfWeekDisabled: numbersInRange('restrictions.daysOfWeekDisabled', 0, 6),\n disabledTimeIntervals: ({ key, value, providedType, localization }) => {\n if (value === undefined) {\n return [];\n }\n if (!Array.isArray(value)) {\n Namespace.errorMessages.typeMismatch(\n key,\n providedType,\n 'array of { from: DateTime|Date, to: DateTime|Date }'\n );\n }\n const valueObject = value as { from: any; to: any }[]; //eslint-disable-line @typescript-eslint/no-explicit-any\n for (let i = 0; i < valueObject.length; i++) {\n Object.keys(valueObject[i]).forEach((vk) => {\n const subOptionName = `${key}[${i}].${vk}`;\n const d = valueObject[i][vk];\n const dateTime = convertToDateTime(d, subOptionName, localization);\n if (!dateTime) {\n Namespace.errorMessages.typeMismatch(\n subOptionName,\n typeof d,\n 'DateTime or Date'\n );\n }\n dateTime.setLocalization(localization);\n valueObject[i][vk] = dateTime;\n });\n }\n return valueObject;\n },\n toolbarPlacement: validKeyOption(['top', 'bottom', 'default']),\n type: validKeyOption(['icons', 'sprites']),\n viewMode: validKeyOption([\n 'clock',\n 'calendar',\n 'months',\n 'years',\n 'decades',\n ]),\n theme: validKeyOption(['light', 'dark', 'auto']),\n placement: validKeyOption(['top', 'bottom']),\n meta: ({ value }) => value,\n dayViewHeaderFormat: ({ value }) => value,\n container: ({ value, path }) => {\n if (\n value &&\n !(\n value instanceof HTMLElement ||\n value instanceof Element ||\n value?.appendChild\n )\n ) {\n Namespace.errorMessages.typeMismatch(\n path.substring(1),\n typeof value,\n 'HTMLElement'\n );\n }\n return value;\n },\n useTwentyfourHour: ({ value, path, providedType, defaultType }) => {\n Namespace.errorMessages.deprecatedWarning(\n 'useTwentyfourHour',\n 'Please use \"options.localization.hourCycle\" instead'\n );\n if (value === undefined || providedType === 'boolean') return value;\n Namespace.errorMessages.typeMismatch(path, providedType, defaultType);\n },\n hourCycle: validKeyOption(['h11', 'h12', 'h23', 'h24']),\n });\n\nconst defaultProcessor: OptionProcessorFunction = ({\n value,\n defaultType,\n providedType,\n path,\n}) => {\n switch (defaultType) {\n case 'boolean':\n return value === 'true' || value === true;\n case 'number':\n return +value;\n case 'string':\n return value.toString();\n case 'object':\n return {};\n case 'function':\n return value;\n default:\n Namespace.errorMessages.typeMismatch(path, providedType, defaultType);\n }\n};\n\nexport function processKey(this: void, args: OptionProcessorFunctionArguments) {\n return (optionProcessors[args.key] || defaultProcessor)(args);\n}\n","import Namespace from './namespace';\nimport { DateTime } from '../datetime';\nimport DefaultOptions from './default-options';\nimport Options, { FormatLocalization } from './options';\nimport { processKey } from './optionProcessor';\nimport {\n convertToDateTime,\n tryConvertToDateTime,\n typeCheckDateArray,\n typeCheckNumberArray,\n} from './typeChecker';\n\nexport class OptionConverter {\n private static ignoreProperties = [\n 'meta',\n 'dayViewHeaderFormat',\n 'container',\n 'dateForms',\n 'ordinal',\n ];\n\n static deepCopy(input): Options {\n const o = {};\n\n Object.keys(input).forEach((key) => {\n const inputElement = input[key];\n\n if (inputElement instanceof DateTime) {\n o[key] = inputElement.clone;\n return;\n } else if (inputElement instanceof Date) {\n o[key] = new Date(inputElement.valueOf());\n return;\n }\n\n o[key] = inputElement;\n if (\n typeof inputElement !== 'object' ||\n inputElement instanceof HTMLElement ||\n inputElement instanceof Element\n )\n return;\n if (!Array.isArray(inputElement)) {\n o[key] = OptionConverter.deepCopy(inputElement);\n }\n });\n\n return o;\n }\n\n private static isValue = (a) => a != null; // everything except undefined + null\n\n /**\n * Finds value out of an object based on a string, period delimited, path\n * @param paths\n * @param obj\n */\n static objectPath(paths: string, obj) {\n if (paths.charAt(0) === '.') paths = paths.slice(1);\n if (!paths) return obj;\n return paths\n .split('.')\n .reduce(\n (value, key) =>\n OptionConverter.isValue(value) || OptionConverter.isValue(value[key])\n ? value[key]\n : undefined,\n obj\n );\n }\n\n /**\n * The spread operator caused sub keys to be missing after merging.\n * This is to fix that issue by using spread on the child objects first.\n * Also handles complex options like disabledDates\n * @param provided An option from new providedOptions\n * @param copyTo Destination object. This was added to prevent reference copies\n * @param localization\n * @param path\n */\n static spread(provided, copyTo, localization: FormatLocalization, path = '') {\n const defaultOptions = OptionConverter.objectPath(path, DefaultOptions);\n\n const unsupportedOptions = Object.keys(provided).filter(\n (x) => !Object.keys(defaultOptions).includes(x)\n );\n\n if (unsupportedOptions.length > 0) {\n const flattenedOptions = OptionConverter.getFlattenDefaultOptions();\n\n const errors = unsupportedOptions.map((x) => {\n let error = `\"${path}.${x}\" in not a known option.`;\n const didYouMean = flattenedOptions.find((y) => y.includes(x));\n if (didYouMean) error += ` Did you mean \"${didYouMean}\"?`;\n return error;\n });\n Namespace.errorMessages.unexpectedOptions(errors);\n }\n\n Object.keys(provided)\n .filter((key) => key !== '__proto__' && key !== 'constructor')\n .forEach((key) => {\n path += `.${key}`;\n if (path.charAt(0) === '.') path = path.slice(1);\n\n const defaultOptionValue = defaultOptions[key];\n const providedType = typeof provided[key];\n const defaultType = typeof defaultOptionValue;\n const value = provided[key];\n\n if (value === undefined || value === null) {\n copyTo[key] = value;\n path = path.substring(0, path.lastIndexOf(`.${key}`));\n return;\n }\n\n if (\n typeof defaultOptionValue === 'object' &&\n !Array.isArray(provided[key]) &&\n !(\n defaultOptionValue instanceof Date ||\n OptionConverter.ignoreProperties.includes(key)\n )\n ) {\n OptionConverter.spread(\n provided[key],\n copyTo[key],\n localization,\n path\n );\n } else {\n copyTo[key] = OptionConverter.processKey(\n key,\n value,\n providedType,\n defaultType,\n path,\n localization\n );\n }\n\n path = path.substring(0, path.lastIndexOf(`.${key}`));\n });\n }\n\n static processKey(\n key: string,\n value: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n providedType: string,\n defaultType: string,\n path: string,\n localization: FormatLocalization\n ) {\n return processKey({\n key,\n value,\n providedType,\n defaultType,\n path,\n localization,\n });\n }\n\n static _mergeOptions(providedOptions: Options, mergeTo: Options): Options {\n const newConfig = OptionConverter.deepCopy(mergeTo);\n //see if the options specify a locale\n const localization =\n mergeTo.localization?.locale !== 'default'\n ? mergeTo.localization\n : providedOptions?.localization || DefaultOptions.localization;\n\n OptionConverter.spread(providedOptions, newConfig, localization, '');\n\n return newConfig;\n }\n\n static _dataToOptions(element, options: Options): Options {\n const eData = JSON.parse(JSON.stringify(element.dataset));\n\n if (eData?.tdTargetInput) delete eData.tdTargetInput;\n if (eData?.tdTargetToggle) delete eData.tdTargetToggle;\n\n if (\n !eData ||\n Object.keys(eData).length === 0 ||\n eData.constructor !== DOMStringMap\n )\n return options;\n const dataOptions = {} as Options;\n\n // because dataset returns camelCase including the 'td' key the option\n // key won't align\n const objectToNormalized = (object) => {\n const lowered = {};\n Object.keys(object).forEach((x) => {\n lowered[x.toLowerCase()] = x;\n });\n\n return lowered;\n };\n\n const normalizeObject = this.normalizeObject(objectToNormalized);\n const optionsLower = objectToNormalized(options);\n\n Object.keys(eData)\n .filter((x) => x.startsWith(Namespace.dataKey))\n .map((x) => x.substring(2))\n .forEach((key) => {\n let keyOption = optionsLower[key.toLowerCase()];\n\n // dataset merges dashes to camelCase... yay\n // i.e. key = display_components_seconds\n if (key.includes('_')) {\n // [display, components, seconds]\n const split = key.split('_');\n // display\n keyOption = optionsLower[split[0].toLowerCase()];\n if (\n keyOption !== undefined &&\n options[keyOption].constructor === Object\n ) {\n dataOptions[keyOption] = normalizeObject(\n split,\n 1,\n options[keyOption],\n eData[`td${key}`]\n );\n }\n }\n // or key = multipleDate\n else if (keyOption !== undefined) {\n dataOptions[keyOption] = eData[`td${key}`];\n }\n });\n\n return this._mergeOptions(dataOptions, options);\n }\n\n //todo clean this up\n private static normalizeObject(objectToNormalized: (object) => object) {\n const normalizeObject = (\n split: string[],\n index: number,\n optionSubgroup: unknown,\n value: unknown\n ) => {\n // first round = display { ... }\n const normalizedOptions = objectToNormalized(optionSubgroup);\n\n const keyOption = normalizedOptions[split[index].toLowerCase()];\n const internalObject = {};\n\n if (keyOption === undefined) return internalObject;\n\n // if this is another object, continue down the rabbit hole\n if (optionSubgroup[keyOption].constructor === Object) {\n index++;\n internalObject[keyOption] = normalizeObject(\n split,\n index,\n optionSubgroup[keyOption],\n value\n );\n } else {\n internalObject[keyOption] = value;\n }\n return internalObject;\n };\n return normalizeObject;\n }\n\n /**\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\n * @param d If a string will attempt creating a date from it.\n * @param localization object containing locale and format settings. Only used with the custom formats\n * @private\n */\n static _dateTypeCheck(\n d: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n localization: FormatLocalization\n ): DateTime | null {\n return tryConvertToDateTime(d, localization);\n }\n\n /**\n * Type checks that `value` is an array of Date or DateTime\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param value Option value\n * @param providedType Used to provide text to error messages\n * @param localization\n */\n static _typeCheckDateArray(\n optionName: string,\n value,\n providedType: string,\n localization: FormatLocalization\n ) {\n return typeCheckDateArray(optionName, value, providedType, localization);\n }\n\n /**\n * Type checks that `value` is an array of numbers\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param value Option value\n * @param providedType Used to provide text to error messages\n */\n static _typeCheckNumberArray(\n optionName: string,\n value,\n providedType: string\n ) {\n return typeCheckNumberArray(optionName, value, providedType);\n }\n\n /**\n * Attempts to convert `d` to a DateTime object\n * @param d value to convert\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param localization object containing locale and format settings. Only used with the custom formats\n */\n static dateConversion(\n d: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n optionName: string,\n localization: FormatLocalization\n ): DateTime {\n return convertToDateTime(d, optionName, localization);\n }\n\n private static _flattenDefaults: string[];\n\n private static getFlattenDefaultOptions(): string[] {\n if (this._flattenDefaults) return this._flattenDefaults;\n const deepKeys = (t, pre = []) => {\n if (Array.isArray(t)) return [];\n if (Object(t) === t) {\n return Object.entries(t).flatMap(([k, v]) => deepKeys(v, [...pre, k]));\n } else {\n return pre.join('.');\n }\n };\n\n this._flattenDefaults = deepKeys(DefaultOptions);\n\n return this._flattenDefaults;\n }\n\n /**\n * Some options conflict like min/max date. Verify that these kinds of options\n * are set correctly.\n * @param config\n */\n static _validateConflicts(config: Options) {\n if (\n config.display.sideBySide &&\n (!config.display.components.clock ||\n !(\n config.display.components.hours ||\n config.display.components.minutes ||\n config.display.components.seconds\n ))\n ) {\n Namespace.errorMessages.conflictingConfiguration(\n 'Cannot use side by side mode without the clock components'\n );\n }\n\n if (config.restrictions.minDate && config.restrictions.maxDate) {\n if (config.restrictions.minDate.isAfter(config.restrictions.maxDate)) {\n Namespace.errorMessages.conflictingConfiguration(\n 'minDate is after maxDate'\n );\n }\n\n if (config.restrictions.maxDate.isBefore(config.restrictions.minDate)) {\n Namespace.errorMessages.conflictingConfiguration(\n 'maxDate is before minDate'\n );\n }\n }\n\n if (config.multipleDates && config.dateRange) {\n Namespace.errorMessages.conflictingConfiguration(\n 'Cannot uss option \"multipleDates\" with \"dateRange\"'\n );\n }\n }\n}\n","import { DateTime, getFormatByUnit, Unit } from './datetime';\nimport Namespace from './utilities/namespace';\nimport { ChangeEvent, FailEvent } from './utilities/event-types';\nimport Validation from './validation';\nimport { serviceLocator } from './utilities/service-locator';\nimport { EventEmitters } from './utilities/event-emitter';\nimport { OptionsStore } from './utilities/optionsStore';\nimport { OptionConverter } from './utilities/optionConverter';\n\nexport default class Dates {\n private _dates: DateTime[] = [];\n private optionsStore: OptionsStore;\n private validation: Validation;\n private _eventEmitters: EventEmitters;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.validation = serviceLocator.locate(Validation);\n this._eventEmitters = serviceLocator.locate(EventEmitters);\n }\n\n /**\n * Returns the array of selected dates\n */\n get picked(): DateTime[] {\n return this._dates;\n }\n\n /**\n * Returns the last picked value.\n */\n get lastPicked(): DateTime {\n return this._dates[this.lastPickedIndex];\n }\n\n /**\n * Returns the length of picked dates -1 or 0 if none are selected.\n */\n get lastPickedIndex(): number {\n if (this._dates.length === 0) return 0;\n return this._dates.length - 1;\n }\n\n /**\n * Formats a DateTime object to a string. Used when setting the input value.\n * @param date\n */\n formatInput(date: DateTime): string {\n if (!date) return '';\n date.localization = this.optionsStore.options.localization;\n return date.format();\n }\n\n /**\n * parse the value into a DateTime object.\n * this can be overwritten to supply your own parsing.\n */\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n parseInput(value: any): DateTime {\n return OptionConverter.dateConversion(\n value,\n 'input',\n this.optionsStore.options.localization\n );\n }\n\n /**\n * Tries to convert the provided value to a DateTime object.\n * If value is null|undefined then clear the value of the provided index (or 0).\n * @param value Value to convert or null|undefined\n * @param index When using multidates this is the index in the array\n */\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n setFromInput(value: any, index?: number) {\n if (!value) {\n this.setValue(undefined, index);\n return;\n }\n const converted = this.parseInput(value);\n if (converted) {\n converted.setLocalization(this.optionsStore.options.localization);\n this.setValue(converted, index);\n }\n }\n\n /**\n * Adds a new DateTime to selected dates array\n * @param date\n */\n add(date: DateTime): void {\n this._dates.push(date);\n }\n\n /**\n * Returns true if the `targetDate` is part of the selected dates array.\n * If `unit` is provided then a granularity to that unit will be used.\n * @param targetDate\n * @param unit\n */\n isPicked(targetDate: DateTime, unit?: Unit): boolean {\n if (!DateTime.isValid(targetDate)) return false;\n if (!unit)\n return this._dates.find((x) => x.isSame(targetDate)) !== undefined;\n\n const format = getFormatByUnit(unit);\n\n const innerDateFormatted = targetDate.format(format);\n\n return (\n this._dates\n .map((x) => x.format(format))\n .find((x) => x === innerDateFormatted) !== undefined\n );\n }\n\n /**\n * Returns the index at which `targetDate` is in the array.\n * This is used for updating or removing a date when multi-date is used\n * If `unit` is provided then a granularity to that unit will be used.\n * @param targetDate\n * @param unit\n */\n pickedIndex(targetDate: DateTime, unit?: Unit): number {\n if (!DateTime.isValid(targetDate)) return -1;\n if (!unit)\n return this._dates.map((x) => x.valueOf()).indexOf(targetDate.valueOf());\n\n const format = getFormatByUnit(unit);\n\n const innerDateFormatted = targetDate.format(format);\n\n return this._dates.map((x) => x.format(format)).indexOf(innerDateFormatted);\n }\n\n /**\n * Clears all selected dates.\n */\n clear() {\n this.optionsStore.unset = true;\n this._eventEmitters.triggerEvent.emit({\n type: Namespace.events.change,\n date: undefined,\n oldDate: this.lastPicked,\n isClear: true,\n isValid: true,\n } as ChangeEvent);\n this._dates = [];\n if (this.optionsStore.input) this.optionsStore.input.value = '';\n this._eventEmitters.updateDisplay.emit('all');\n }\n\n /**\n * Find the \"book end\" years given a `year` and a `factor`\n * @param factor e.g. 100 for decades\n * @param year e.g. 2021\n */\n static getStartEndYear(\n factor: number,\n year: number\n ): [number, number, number] {\n const step = factor / 10,\n startYear = Math.floor(year / factor) * factor,\n endYear = startYear + step * 9,\n focusValue = Math.floor(year / step) * step;\n return [startYear, endYear, focusValue];\n }\n\n updateInput(target?: DateTime) {\n if (!this.optionsStore.input) return;\n\n let newValue = this.formatInput(target);\n if (\n this.optionsStore.options.multipleDates ||\n this.optionsStore.options.dateRange\n ) {\n newValue = this._dates\n .map((d) => this.formatInput(d))\n .join(this.optionsStore.options.multipleDatesSeparator);\n }\n if (this.optionsStore.input.value != newValue)\n this.optionsStore.input.value = newValue;\n }\n\n /**\n * Attempts to either clear or set the `target` date at `index`.\n * If the `target` is null then the date will be cleared.\n * If multi-date is being used then it will be removed from the array.\n * If `target` is valid and multi-date is used then if `index` is\n * provided the date at that index will be replaced, otherwise it is appended.\n * @param target\n * @param index\n */\n setValue(target?: DateTime, index?: number): void {\n const noIndex = typeof index === 'undefined',\n isClear = !target && noIndex;\n let oldDate = this.optionsStore.unset ? null : this._dates[index];\n if (!oldDate && !this.optionsStore.unset && noIndex && isClear) {\n oldDate = this.lastPicked;\n }\n\n if (target && oldDate?.isSame(target)) {\n this.updateInput(target);\n return;\n }\n\n // case of calling setValue(null)\n if (!target) {\n this._setValueNull(isClear, index, oldDate);\n return;\n }\n\n index = index || 0;\n target = target.clone;\n\n // minute stepping is being used, force the minute to the closest value\n if (this.optionsStore.options.stepping !== 1) {\n target.minutes =\n Math.round(target.minutes / this.optionsStore.options.stepping) *\n this.optionsStore.options.stepping;\n target.startOf(Unit.minutes);\n }\n\n const onUpdate = (isValid: boolean) => {\n this._dates[index] = target;\n this._eventEmitters.updateViewDate.emit(target.clone);\n\n this.updateInput(target);\n\n this.optionsStore.unset = false;\n this._eventEmitters.updateDisplay.emit('all');\n this._eventEmitters.triggerEvent.emit({\n type: Namespace.events.change,\n date: target,\n oldDate,\n isClear,\n isValid: isValid,\n } as ChangeEvent);\n };\n\n if (\n this.validation.isValid(target) &&\n this.validation.dateRangeIsValid(this._dates, index, target)\n ) {\n onUpdate(true);\n return;\n }\n\n if (this.optionsStore.options.keepInvalid) {\n onUpdate(false);\n }\n\n this._eventEmitters.triggerEvent.emit({\n type: Namespace.events.error,\n reason: Namespace.errorMessages.failedToSetInvalidDate,\n date: target,\n oldDate,\n } as FailEvent);\n }\n\n private _setValueNull(isClear: boolean, index: number, oldDate: DateTime) {\n if (\n !this.optionsStore.options.multipleDates ||\n this._dates.length === 1 ||\n isClear\n ) {\n this.optionsStore.unset = true;\n this._dates = [];\n } else {\n this._dates.splice(index, 1);\n }\n\n this.updateInput();\n\n this._eventEmitters.triggerEvent.emit({\n type: Namespace.events.change,\n date: undefined,\n oldDate,\n isClear,\n isValid: true,\n } as ChangeEvent);\n\n this._eventEmitters.updateDisplay.emit('all');\n }\n}\n","enum ActionTypes {\n next = 'next',\n previous = 'previous',\n changeCalendarView = 'changeCalendarView',\n selectMonth = 'selectMonth',\n selectYear = 'selectYear',\n selectDecade = 'selectDecade',\n selectDay = 'selectDay',\n selectHour = 'selectHour',\n selectMinute = 'selectMinute',\n selectSecond = 'selectSecond',\n incrementHours = 'incrementHours',\n incrementMinutes = 'incrementMinutes',\n incrementSeconds = 'incrementSeconds',\n decrementHours = 'decrementHours',\n decrementMinutes = 'decrementMinutes',\n decrementSeconds = 'decrementSeconds',\n toggleMeridiem = 'toggleMeridiem',\n togglePicker = 'togglePicker',\n showClock = 'showClock',\n showHours = 'showHours',\n showMinutes = 'showMinutes',\n showSeconds = 'showSeconds',\n clear = 'clear',\n close = 'close',\n today = 'today',\n}\n\nexport default ActionTypes;\n","import { DateTime, Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport Dates from '../../dates';\nimport { Paint } from '../index';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `date`\n */\nexport default class DateDisplay {\n private optionsStore: OptionsStore;\n private dates: Dates;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n }\n\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.daysContainer);\n\n container.append(...this._daysOfTheWeek());\n\n if (this.optionsStore.options.display.calendarWeeks) {\n const div = document.createElement('div');\n div.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight);\n container.appendChild(div);\n }\n\n const { rangeHoverEvent, rangeHoverOutEvent } =\n this.handleMouseEvents(container);\n\n for (let i = 0; i < 42; i++) {\n if (i !== 0 && i % 7 === 0) {\n if (this.optionsStore.options.display.calendarWeeks) {\n const div = document.createElement('div');\n div.classList.add(\n Namespace.css.calendarWeeks,\n Namespace.css.noHighlight\n );\n container.appendChild(div);\n }\n }\n\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectDay);\n container.appendChild(div);\n\n // if hover is supported then add the events\n if (\n matchMedia('(hover: hover)').matches &&\n this.optionsStore.options.dateRange\n ) {\n div.addEventListener('mouseover', rangeHoverEvent);\n div.addEventListener('mouseout', rangeHoverOutEvent);\n }\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint): void {\n const container = widget.getElementsByClassName(\n Namespace.css.daysContainer\n )[0] as HTMLElement;\n\n this._updateCalendarView(container);\n\n const innerDate = this.optionsStore.viewDate.clone\n .startOf(Unit.month)\n .startOf('weekDay', this.optionsStore.options.localization.startOfTheWeek)\n .manipulate(12, Unit.hours);\n\n this._handleCalendarWeeks(container, innerDate.clone);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectDay}\"]`)\n .forEach((element: HTMLElement) => {\n const classes: string[] = [];\n classes.push(Namespace.css.day);\n\n if (innerDate.isBefore(this.optionsStore.viewDate, Unit.month)) {\n classes.push(Namespace.css.old);\n }\n if (innerDate.isAfter(this.optionsStore.viewDate, Unit.month)) {\n classes.push(Namespace.css.new);\n }\n\n if (\n !this.optionsStore.unset &&\n !this.optionsStore.options.multipleDates &&\n this.dates.isPicked(innerDate, Unit.date)\n ) {\n classes.push(Namespace.css.active);\n }\n if (!this.validation.isValid(innerDate, Unit.date)) {\n classes.push(Namespace.css.disabled);\n }\n if (innerDate.isSame(new DateTime(), Unit.date)) {\n classes.push(Namespace.css.today);\n }\n if (innerDate.weekDay === 0 || innerDate.weekDay === 6) {\n classes.push(Namespace.css.weekend);\n }\n\n this._handleDateRange(innerDate, classes);\n\n paint(Unit.date, innerDate, classes, element);\n\n element.classList.remove(...element.classList);\n element.classList.add(...classes);\n element.setAttribute('data-value', this._dateToDataValue(innerDate));\n element.setAttribute('data-day', `${innerDate.date}`);\n element.innerText = innerDate.parts(undefined, {\n day: 'numeric',\n }).day;\n innerDate.manipulate(1, Unit.date);\n });\n }\n\n private _dateToDataValue(date: DateTime): string {\n if (!DateTime.isValid(date)) return '';\n\n return `${date.year}-${date.monthFormatted}-${date.dateFormatted}`;\n }\n\n private _handleDateRange(innerDate: DateTime, classes: string[]) {\n const rangeStart = this.dates.picked[0];\n const rangeEnd = this.dates.picked[1];\n\n if (this.optionsStore.options.dateRange) {\n if (innerDate.isBetween(rangeStart, rangeEnd, Unit.date)) {\n classes.push(Namespace.css.rangeIn);\n }\n\n if (innerDate.isSame(rangeStart, Unit.date)) {\n classes.push(Namespace.css.rangeStart);\n }\n\n if (innerDate.isSame(rangeEnd, Unit.date)) {\n classes.push(Namespace.css.rangeEnd);\n }\n }\n }\n\n private handleMouseEvents(container: HTMLElement) {\n const rangeHoverEvent = (e: MouseEvent) => {\n const currentTarget = e?.currentTarget as HTMLElement;\n\n // if we have 0 or 2 selected or if the target is disabled then ignore\n if (\n this.dates.picked.length !== 1 ||\n currentTarget.classList.contains(Namespace.css.disabled)\n )\n return;\n\n // select all the date divs\n const allDays = [...container.querySelectorAll('.day')] as HTMLElement[];\n\n // get the date value from the element being hovered over\n const attributeValue = currentTarget.getAttribute('data-value');\n\n // format the string to a date\n const innerDate = DateTime.fromString(attributeValue, {\n format: 'yyyy-MM-dd',\n });\n\n // find the position of the target in the date container\n const dayIndex = allDays.findIndex(\n (e) => e.getAttribute('data-value') === attributeValue\n );\n\n // find the first and second selected dates\n const rangeStart = this.dates.picked[0];\n const rangeEnd = this.dates.picked[1];\n\n //format the start date so that it can be found by the attribute\n const rangeStartFormatted = this._dateToDataValue(rangeStart);\n const rangeStartIndex = allDays.findIndex(\n (e) => e.getAttribute('data-value') === rangeStartFormatted\n );\n const rangeStartElement = allDays[rangeStartIndex];\n\n //make sure we don't leave start/end classes if we don't need them\n if (!innerDate.isSame(rangeStart, Unit.date)) {\n currentTarget.classList.remove(Namespace.css.rangeStart);\n }\n\n if (!innerDate.isSame(rangeEnd, Unit.date)) {\n currentTarget.classList.remove(Namespace.css.rangeEnd);\n }\n\n // the following figures out which direct from start date is selected\n // the selection \"cap\" classes are applied if needed\n // otherwise all the dates between will get the `rangeIn` class.\n // We make this selection based on the element's index and the rangeStart index\n\n let lambda: (_, index) => boolean;\n\n if (innerDate.isBefore(rangeStart)) {\n currentTarget.classList.add(Namespace.css.rangeStart);\n rangeStartElement?.classList.remove(Namespace.css.rangeStart);\n rangeStartElement?.classList.add(Namespace.css.rangeEnd);\n lambda = (_, index) => index > dayIndex && index < rangeStartIndex;\n } else {\n currentTarget.classList.add(Namespace.css.rangeEnd);\n rangeStartElement?.classList.remove(Namespace.css.rangeEnd);\n rangeStartElement?.classList.add(Namespace.css.rangeStart);\n lambda = (_, index) => index < dayIndex && index > rangeStartIndex;\n }\n\n allDays.filter(lambda).forEach((e) => {\n e.classList.add(Namespace.css.rangeIn);\n });\n };\n\n const rangeHoverOutEvent = (e: MouseEvent) => {\n // find all the dates in the container\n const allDays = [...container.querySelectorAll('.day')] as HTMLElement[];\n\n // if only the start is selected, remove all the rangeIn classes\n // we do this because once the user hovers over a new date the range will be recalculated.\n if (this.dates.picked.length === 1)\n allDays.forEach((e) => e.classList.remove(Namespace.css.rangeIn));\n\n // if we have 0 or 2 dates selected then ignore\n if (this.dates.picked.length !== 1) return;\n\n const currentTarget = e?.currentTarget as HTMLElement;\n\n // get the elements date from the attribute value\n const innerDate = new DateTime(currentTarget.getAttribute('data-value'));\n\n // verify selections and remove invalid classes\n if (!innerDate.isSame(this.dates.picked[0], Unit.date)) {\n currentTarget.classList.remove(Namespace.css.rangeStart);\n }\n\n if (!innerDate.isSame(this.dates.picked[1], Unit.date)) {\n currentTarget.classList.remove(Namespace.css.rangeEnd);\n }\n };\n\n return { rangeHoverEvent, rangeHoverOutEvent };\n }\n\n private _updateCalendarView(container: Element) {\n if (this.optionsStore.currentView !== 'calendar') return;\n const [previous, switcher, next] = container.parentElement\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\n .getElementsByTagName('div');\n switcher.setAttribute(\n Namespace.css.daysContainer,\n this.optionsStore.viewDate.format(\n this.optionsStore.options.localization.dayViewHeaderFormat\n )\n );\n this.optionsStore.options.display.components.month\n ? switcher.classList.remove(Namespace.css.disabled)\n : switcher.classList.add(Namespace.css.disabled);\n this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.month),\n Unit.month\n )\n ? previous.classList.remove(Namespace.css.disabled)\n : previous.classList.add(Namespace.css.disabled);\n this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(1, Unit.month),\n Unit.month\n )\n ? next.classList.remove(Namespace.css.disabled)\n : next.classList.add(Namespace.css.disabled);\n }\n\n /***\n * Generates a html row that contains the days of the week.\n * @private\n */\n private _daysOfTheWeek(): HTMLElement[] {\n const innerDate = this.optionsStore.viewDate.clone\n .startOf('weekDay', this.optionsStore.options.localization.startOfTheWeek)\n .startOf(Unit.date);\n const row = [];\n document.createElement('div');\n\n if (this.optionsStore.options.display.calendarWeeks) {\n const htmlDivElement = document.createElement('div');\n htmlDivElement.classList.add(\n Namespace.css.calendarWeeks,\n Namespace.css.noHighlight\n );\n htmlDivElement.innerText = '#';\n row.push(htmlDivElement);\n }\n\n for (let i = 0; i < 7; i++) {\n const htmlDivElement = document.createElement('div');\n htmlDivElement.classList.add(\n Namespace.css.dayOfTheWeek,\n Namespace.css.noHighlight\n );\n htmlDivElement.innerText = innerDate.format({ weekday: 'short' });\n innerDate.manipulate(1, Unit.date);\n row.push(htmlDivElement);\n }\n\n return row;\n }\n\n private _handleCalendarWeeks(container: HTMLElement, innerDate: DateTime) {\n [...container.querySelectorAll(`.${Namespace.css.calendarWeeks}`)]\n .filter((e: HTMLElement) => e.innerText !== '#')\n .forEach((element: HTMLElement) => {\n element.innerText = `${innerDate.week}`;\n innerDate.manipulate(7, Unit.date);\n });\n }\n}\n","import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport Dates from '../../dates';\nimport { Paint } from '../index';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `month`\n */\nexport default class MonthDisplay {\n private optionsStore: OptionsStore;\n private dates: Dates;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n }\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.monthsContainer);\n\n for (let i = 0; i < 12; i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectMonth);\n container.appendChild(div);\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint): void {\n const container = widget.getElementsByClassName(\n Namespace.css.monthsContainer\n )[0];\n\n if (this.optionsStore.currentView === 'months') {\n const [previous, switcher, next] = container.parentElement\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\n .getElementsByTagName('div');\n\n switcher.setAttribute(\n Namespace.css.monthsContainer,\n this.optionsStore.viewDate.format({ year: 'numeric' })\n );\n\n this.optionsStore.options.display.components.year\n ? switcher.classList.remove(Namespace.css.disabled)\n : switcher.classList.add(Namespace.css.disabled);\n\n this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.year),\n Unit.year\n )\n ? previous.classList.remove(Namespace.css.disabled)\n : previous.classList.add(Namespace.css.disabled);\n\n this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(1, Unit.year),\n Unit.year\n )\n ? next.classList.remove(Namespace.css.disabled)\n : next.classList.add(Namespace.css.disabled);\n }\n\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.year);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMonth}\"]`)\n .forEach((containerClone: HTMLElement, index) => {\n const classes = [];\n classes.push(Namespace.css.month);\n\n if (\n !this.optionsStore.unset &&\n this.dates.isPicked(innerDate, Unit.month)\n ) {\n classes.push(Namespace.css.active);\n }\n if (!this.validation.isValid(innerDate, Unit.month)) {\n classes.push(Namespace.css.disabled);\n }\n\n paint(Unit.month, innerDate, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${index}`);\n containerClone.innerText = `${innerDate.format({ month: 'short' })}`;\n innerDate.manipulate(1, Unit.month);\n });\n }\n}\n","import { DateTime, Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Dates from '../../dates';\nimport Validation from '../../validation';\nimport { Paint } from '../index';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `year`\n */\nexport default class YearDisplay {\n private _startYear: DateTime;\n private _endYear: DateTime;\n private optionsStore: OptionsStore;\n private dates: Dates;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n }\n\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.yearsContainer);\n\n for (let i = 0; i < 12; i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectYear);\n container.appendChild(div);\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint) {\n this._startYear = this.optionsStore.viewDate.clone.manipulate(\n -1,\n Unit.year\n );\n this._endYear = this.optionsStore.viewDate.clone.manipulate(10, Unit.year);\n\n const container = widget.getElementsByClassName(\n Namespace.css.yearsContainer\n )[0];\n\n if (this.optionsStore.currentView === 'years') {\n const [previous, switcher, next] = container.parentElement\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\n .getElementsByTagName('div');\n\n switcher.setAttribute(\n Namespace.css.yearsContainer,\n `${this._startYear.format({ year: 'numeric' })}-${this._endYear.format({\n year: 'numeric',\n })}`\n );\n\n this.optionsStore.options.display.components.decades\n ? switcher.classList.remove(Namespace.css.disabled)\n : switcher.classList.add(Namespace.css.disabled);\n\n this.validation.isValid(this._startYear, Unit.year)\n ? previous.classList.remove(Namespace.css.disabled)\n : previous.classList.add(Namespace.css.disabled);\n this.validation.isValid(this._endYear, Unit.year)\n ? next.classList.remove(Namespace.css.disabled)\n : next.classList.add(Namespace.css.disabled);\n }\n\n const innerDate = this.optionsStore.viewDate.clone\n .startOf(Unit.year)\n .manipulate(-1, Unit.year);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectYear}\"]`)\n .forEach((containerClone: HTMLElement) => {\n const classes = [];\n classes.push(Namespace.css.year);\n\n if (\n !this.optionsStore.unset &&\n this.dates.isPicked(innerDate, Unit.year)\n ) {\n classes.push(Namespace.css.active);\n }\n if (!this.validation.isValid(innerDate, Unit.year)) {\n classes.push(Namespace.css.disabled);\n }\n\n paint(Unit.year, innerDate, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${innerDate.year}`);\n containerClone.innerText = innerDate.format({ year: 'numeric' });\n\n innerDate.manipulate(1, Unit.year);\n });\n }\n}\n","import Dates from '../../dates';\nimport { DateTime, Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport { Paint } from '../index';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `seconds`\n */\nexport default class DecadeDisplay {\n private _startDecade: DateTime;\n private _endDecade: DateTime;\n private optionsStore: OptionsStore;\n private dates: Dates;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n }\n\n /**\n * Build the container html for the display\n * @private\n */\n getPicker() {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.decadesContainer);\n\n for (let i = 0; i < 12; i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectDecade);\n container.appendChild(div);\n }\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint) {\n const [start, end] = Dates.getStartEndYear(\n 100,\n this.optionsStore.viewDate.year\n );\n this._startDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\n this._startDecade.year = start;\n this._endDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\n this._endDecade.year = end;\n\n const container = widget.getElementsByClassName(\n Namespace.css.decadesContainer\n )[0];\n\n const [previous, switcher, next] = container.parentElement\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\n .getElementsByTagName('div');\n\n if (this.optionsStore.currentView === 'decades') {\n switcher.setAttribute(\n Namespace.css.decadesContainer,\n `${this._startDecade.format({\n year: 'numeric',\n })}-${this._endDecade.format({ year: 'numeric' })}`\n );\n\n this.validation.isValid(this._startDecade, Unit.year)\n ? previous.classList.remove(Namespace.css.disabled)\n : previous.classList.add(Namespace.css.disabled);\n this.validation.isValid(this._endDecade, Unit.year)\n ? next.classList.remove(Namespace.css.disabled)\n : next.classList.add(Namespace.css.disabled);\n }\n\n const pickedYears = this.dates.picked.map((x) => x.year);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectDecade}\"]`)\n .forEach((containerClone: HTMLElement, index) => {\n if (index === 0) {\n containerClone.classList.add(Namespace.css.old);\n if (this._startDecade.year - 10 < 0) {\n containerClone.textContent = ' ';\n previous.classList.add(Namespace.css.disabled);\n containerClone.classList.add(Namespace.css.disabled);\n containerClone.setAttribute('data-value', '');\n return;\n } else {\n containerClone.innerText = this._startDecade.clone\n .manipulate(-10, Unit.year)\n .format({ year: 'numeric' });\n containerClone.setAttribute(\n 'data-value',\n `${this._startDecade.year}`\n );\n return;\n }\n }\n\n const classes = [];\n classes.push(Namespace.css.decade);\n const startDecadeYear = this._startDecade.year;\n const endDecadeYear = this._startDecade.year + 9;\n\n if (\n !this.optionsStore.unset &&\n pickedYears.filter((x) => x >= startDecadeYear && x <= endDecadeYear)\n .length > 0\n ) {\n classes.push(Namespace.css.active);\n }\n\n paint('decade', this._startDecade, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${this._startDecade.year}`);\n containerClone.innerText = `${this._startDecade.format({\n year: 'numeric',\n })}`;\n\n this._startDecade.manipulate(10, Unit.year);\n });\n }\n}\n","import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport Dates from '../../dates';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates the clock display\n */\nexport default class TimeDisplay {\n private _gridColumns = '';\n private optionsStore: OptionsStore;\n private validation: Validation;\n private dates: Dates;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n }\n\n /**\n * Build the container html for the clock display\n * @private\n */\n getPicker(iconTag: (iconClass: string) => HTMLElement): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.clockContainer);\n\n container.append(...this._grid(iconTag));\n\n return container;\n }\n\n /**\n * Populates the various elements with in the clock display\n * like the current hour and if the manipulation icons are enabled.\n * @private\n */\n _update(widget: HTMLElement): void {\n const timesDiv = (\n widget.getElementsByClassName(Namespace.css.clockContainer)[0]\n );\n let lastPicked = this.dates.lastPicked?.clone;\n if (!lastPicked && this.optionsStore.options.useCurrent)\n lastPicked = this.optionsStore.viewDate.clone;\n\n timesDiv\n .querySelectorAll('.disabled')\n .forEach((element) => element.classList.remove(Namespace.css.disabled));\n\n if (this.optionsStore.options.display.components.hours) {\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(1, Unit.hours),\n Unit.hours\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.incrementHours}]`)\n .classList.add(Namespace.css.disabled);\n }\n\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.hours),\n Unit.hours\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.decrementHours}]`)\n .classList.add(Namespace.css.disabled);\n }\n\n timesDiv.querySelector(\n `[data-time-component=${Unit.hours}]`\n ).innerText = lastPicked\n ? lastPicked.getHoursFormatted(\n this.optionsStore.options.localization.hourCycle\n )\n : '--';\n }\n\n if (this.optionsStore.options.display.components.minutes) {\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(1, Unit.minutes),\n Unit.minutes\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.incrementMinutes}]`)\n .classList.add(Namespace.css.disabled);\n }\n\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.minutes),\n Unit.minutes\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.decrementMinutes}]`)\n .classList.add(Namespace.css.disabled);\n }\n timesDiv.querySelector(\n `[data-time-component=${Unit.minutes}]`\n ).innerText = lastPicked ? lastPicked.minutesFormatted : '--';\n }\n\n if (this.optionsStore.options.display.components.seconds) {\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(1, Unit.seconds),\n Unit.seconds\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.incrementSeconds}]`)\n .classList.add(Namespace.css.disabled);\n }\n\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.seconds),\n Unit.seconds\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.decrementSeconds}]`)\n .classList.add(Namespace.css.disabled);\n }\n timesDiv.querySelector(\n `[data-time-component=${Unit.seconds}]`\n ).innerText = lastPicked ? lastPicked.secondsFormatted : '--';\n }\n\n if (this.optionsStore.isTwelveHour) {\n const toggle = timesDiv.querySelector(\n `[data-action=${ActionTypes.toggleMeridiem}]`\n );\n\n const meridiemDate = (lastPicked || this.optionsStore.viewDate).clone;\n\n toggle.innerText = meridiemDate.meridiem();\n\n if (\n !this.validation.isValid(\n meridiemDate.manipulate(\n meridiemDate.hours >= 12 ? -12 : 12,\n Unit.hours\n )\n )\n ) {\n toggle.classList.add(Namespace.css.disabled);\n } else {\n toggle.classList.remove(Namespace.css.disabled);\n }\n }\n\n timesDiv.style.gridTemplateAreas = `\"${this._gridColumns}\"`;\n }\n\n /**\n * Creates the table for the clock display depending on what options are selected.\n * @private\n */\n private _grid(iconTag: (iconClass: string) => HTMLElement): HTMLElement[] {\n this._gridColumns = '';\n const top = [],\n middle = [],\n bottom = [],\n separator = document.createElement('div'),\n upIcon = iconTag(this.optionsStore.options.display.icons.up),\n downIcon = iconTag(this.optionsStore.options.display.icons.down);\n\n separator.classList.add(Namespace.css.separator, Namespace.css.noHighlight);\n const separatorColon = separator.cloneNode(true);\n separatorColon.innerHTML = ':';\n\n const getSeparator = (colon = false): HTMLElement => {\n return colon\n ? separatorColon.cloneNode(true)\n : separator.cloneNode(true);\n };\n\n if (this.optionsStore.options.display.components.hours) {\n let divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.incrementHour\n );\n divElement.setAttribute('data-action', ActionTypes.incrementHours);\n divElement.appendChild(upIcon.cloneNode(true));\n top.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.pickHour\n );\n divElement.setAttribute('data-action', ActionTypes.showHours);\n divElement.setAttribute('data-time-component', Unit.hours);\n middle.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.decrementHour\n );\n divElement.setAttribute('data-action', ActionTypes.decrementHours);\n divElement.appendChild(downIcon.cloneNode(true));\n bottom.push(divElement);\n this._gridColumns += 'a';\n }\n\n if (this.optionsStore.options.display.components.minutes) {\n this._gridColumns += ' a';\n if (this.optionsStore.options.display.components.hours) {\n top.push(getSeparator());\n middle.push(getSeparator(true));\n bottom.push(getSeparator());\n this._gridColumns += ' a';\n }\n let divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.incrementMinute\n );\n divElement.setAttribute('data-action', ActionTypes.incrementMinutes);\n divElement.appendChild(upIcon.cloneNode(true));\n top.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.pickMinute\n );\n divElement.setAttribute('data-action', ActionTypes.showMinutes);\n divElement.setAttribute('data-time-component', Unit.minutes);\n middle.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.decrementMinute\n );\n divElement.setAttribute('data-action', ActionTypes.decrementMinutes);\n divElement.appendChild(downIcon.cloneNode(true));\n bottom.push(divElement);\n }\n\n if (this.optionsStore.options.display.components.seconds) {\n this._gridColumns += ' a';\n if (this.optionsStore.options.display.components.minutes) {\n top.push(getSeparator());\n middle.push(getSeparator(true));\n bottom.push(getSeparator());\n this._gridColumns += ' a';\n }\n let divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.incrementSecond\n );\n divElement.setAttribute('data-action', ActionTypes.incrementSeconds);\n divElement.appendChild(upIcon.cloneNode(true));\n top.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.pickSecond\n );\n divElement.setAttribute('data-action', ActionTypes.showSeconds);\n divElement.setAttribute('data-time-component', Unit.seconds);\n middle.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.decrementSecond\n );\n divElement.setAttribute('data-action', ActionTypes.decrementSeconds);\n divElement.appendChild(downIcon.cloneNode(true));\n bottom.push(divElement);\n }\n\n if (this.optionsStore.isTwelveHour) {\n this._gridColumns += ' a';\n let divElement = getSeparator();\n top.push(divElement);\n\n const button = document.createElement('button');\n button.setAttribute(\n 'title',\n this.optionsStore.options.localization.toggleMeridiem\n );\n button.setAttribute('data-action', ActionTypes.toggleMeridiem);\n button.setAttribute('tabindex', '-1');\n if (Namespace.css.toggleMeridiem.includes(',')) {\n //todo move this to paint function?\n button.classList.add(...Namespace.css.toggleMeridiem.split(','));\n } else button.classList.add(Namespace.css.toggleMeridiem);\n\n divElement = document.createElement('div');\n divElement.classList.add(Namespace.css.noHighlight);\n divElement.appendChild(button);\n middle.push(divElement);\n\n divElement = getSeparator();\n bottom.push(divElement);\n }\n\n this._gridColumns = this._gridColumns.trim();\n\n return [...top, ...middle, ...bottom];\n }\n}\n","import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport { Paint } from '../index';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `hours`\n */\nexport default class HourDisplay {\n private optionsStore: OptionsStore;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.validation = serviceLocator.locate(Validation);\n }\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.hourContainer);\n\n for (let i = 0; i < (this.optionsStore.isTwelveHour ? 12 : 24); i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectHour);\n container.appendChild(div);\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint): void {\n const container = widget.getElementsByClassName(\n Namespace.css.hourContainer\n )[0];\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.date);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectHour}\"]`)\n .forEach((containerClone: HTMLElement) => {\n const classes = [];\n classes.push(Namespace.css.hour);\n\n if (!this.validation.isValid(innerDate, Unit.hours)) {\n classes.push(Namespace.css.disabled);\n }\n\n paint(Unit.hours, innerDate, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${innerDate.hours}`);\n containerClone.innerText = innerDate.getHoursFormatted(\n this.optionsStore.options.localization.hourCycle\n );\n innerDate.manipulate(1, Unit.hours);\n });\n }\n}\n","import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport { Paint } from '../index';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `minutes`\n */\nexport default class MinuteDisplay {\n private optionsStore: OptionsStore;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.validation = serviceLocator.locate(Validation);\n }\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.minuteContainer);\n\n const step =\n this.optionsStore.options.stepping === 1\n ? 5\n : this.optionsStore.options.stepping;\n for (let i = 0; i < 60 / step; i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectMinute);\n container.appendChild(div);\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint): void {\n const container = widget.getElementsByClassName(\n Namespace.css.minuteContainer\n )[0];\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.hours);\n const step =\n this.optionsStore.options.stepping === 1\n ? 5\n : this.optionsStore.options.stepping;\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMinute}\"]`)\n .forEach((containerClone: HTMLElement) => {\n const classes = [];\n classes.push(Namespace.css.minute);\n\n if (!this.validation.isValid(innerDate, Unit.minutes)) {\n classes.push(Namespace.css.disabled);\n }\n\n paint(Unit.minutes, innerDate, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${innerDate.minutes}`);\n containerClone.innerText = innerDate.minutesFormatted;\n innerDate.manipulate(step, Unit.minutes);\n });\n }\n}\n","import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport { Paint } from '../index';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `seconds`\n */\nexport default class secondDisplay {\n private optionsStore: OptionsStore;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.validation = serviceLocator.locate(Validation);\n }\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.secondContainer);\n\n for (let i = 0; i < 12; i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectSecond);\n container.appendChild(div);\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint): void {\n const container = widget.getElementsByClassName(\n Namespace.css.secondContainer\n )[0];\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.minutes);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectSecond}\"]`)\n .forEach((containerClone: HTMLElement) => {\n const classes = [];\n classes.push(Namespace.css.second);\n\n if (!this.validation.isValid(innerDate, Unit.seconds)) {\n classes.push(Namespace.css.disabled);\n }\n\n paint(Unit.seconds, innerDate, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${innerDate.seconds}`);\n containerClone.innerText = innerDate.secondsFormatted;\n innerDate.manipulate(5, Unit.seconds);\n });\n }\n}\n","import Namespace from '../utilities/namespace';\n\n/**\n * Provides a collapse functionality to the view changes\n */\nexport default class Collapse {\n /**\n * Flips the show/hide state of `target`\n * @param target html element to affect.\n */\n static toggle(target: HTMLElement) {\n if (target.classList.contains(Namespace.css.show)) {\n this.hide(target);\n } else {\n this.show(target);\n }\n }\n\n /**\n * Skips any animation or timeouts and immediately set the element to show.\n * @param target\n */\n static showImmediately(target: HTMLElement) {\n target.classList.remove(Namespace.css.collapsing);\n target.classList.add(Namespace.css.collapse, Namespace.css.show);\n target.style.height = '';\n }\n\n /**\n * If `target` is not already showing, then show after the animation.\n * @param target\n */\n static show(target: HTMLElement) {\n if (\n target.classList.contains(Namespace.css.collapsing) ||\n target.classList.contains(Namespace.css.show)\n )\n return;\n\n let timeOut = null;\n const complete = () => {\n Collapse.showImmediately(target);\n timeOut = null;\n };\n\n target.style.height = '0';\n target.classList.remove(Namespace.css.collapse);\n target.classList.add(Namespace.css.collapsing);\n\n //eslint-disable-next-line @typescript-eslint/no-unused-vars\n timeOut = setTimeout(\n complete,\n this.getTransitionDurationFromElement(target)\n );\n target.style.height = `${target.scrollHeight}px`;\n }\n\n /**\n * Skips any animation or timeouts and immediately set the element to hide.\n * @param target\n */\n static hideImmediately(target: HTMLElement) {\n if (!target) return;\n target.classList.remove(Namespace.css.collapsing, Namespace.css.show);\n target.classList.add(Namespace.css.collapse);\n }\n\n /**\n * If `target` is not already hidden, then hide after the animation.\n * @param target HTML Element\n */\n static hide(target: HTMLElement) {\n if (\n target.classList.contains(Namespace.css.collapsing) ||\n !target.classList.contains(Namespace.css.show)\n )\n return;\n\n let timeOut = null;\n const complete = () => {\n Collapse.hideImmediately(target);\n timeOut = null;\n };\n\n target.style.height = `${target.getBoundingClientRect()['height']}px`;\n\n const reflow = (element) => element.offsetHeight;\n\n reflow(target);\n\n target.classList.remove(Namespace.css.collapse, Namespace.css.show);\n target.classList.add(Namespace.css.collapsing);\n target.style.height = '';\n\n //eslint-disable-next-line @typescript-eslint/no-unused-vars\n timeOut = setTimeout(\n complete,\n this.getTransitionDurationFromElement(target)\n );\n }\n\n /**\n * Gets the transition duration from the `element` by getting css properties\n * `transition-duration` and `transition-delay`\n * @param element HTML Element\n */\n private static getTransitionDurationFromElement = (element: HTMLElement) => {\n if (!element) {\n return 0;\n }\n\n // Get transition-duration of the element\n let { transitionDuration, transitionDelay } =\n window.getComputedStyle(element);\n\n const floatTransitionDuration = Number.parseFloat(transitionDuration);\n const floatTransitionDelay = Number.parseFloat(transitionDelay);\n\n // Return 0 if element or transition duration is not found\n if (!floatTransitionDuration && !floatTransitionDelay) {\n return 0;\n }\n\n // If multiple durations are defined, take the first\n transitionDuration = transitionDuration.split(',')[0];\n transitionDelay = transitionDelay.split(',')[0];\n\n return (\n (Number.parseFloat(transitionDuration) +\n Number.parseFloat(transitionDelay)) *\n 1000\n );\n };\n}\n","import DateDisplay from './calendar/date-display';\nimport MonthDisplay from './calendar/month-display';\nimport YearDisplay from './calendar/year-display';\nimport DecadeDisplay from './calendar/decade-display';\nimport TimeDisplay from './time/time-display';\nimport HourDisplay from './time/hour-display';\nimport MinuteDisplay from './time/minute-display';\nimport SecondDisplay from './time/second-display';\nimport { DateTime, Unit } from '../datetime';\nimport Namespace from '../utilities/namespace';\nimport { HideEvent } from '../utilities/event-types';\nimport Collapse from './collapse';\nimport Validation from '../validation';\nimport Dates from '../dates';\nimport { EventEmitters, ViewUpdateValues } from '../utilities/event-emitter';\nimport { serviceLocator } from '../utilities/service-locator';\nimport ActionTypes from '../utilities/action-types';\nimport CalendarModes from '../utilities/calendar-modes';\nimport { OptionsStore } from '../utilities/optionsStore';\n\n/**\n * Main class for all things display related.\n */\nexport default class Display {\n private _widget: HTMLElement;\n private _popperInstance: any; // eslint-disable-line @typescript-eslint/no-explicit-any\n private _isVisible = false;\n private optionsStore: OptionsStore;\n private validation: Validation;\n private dates: Dates;\n\n dateDisplay: DateDisplay;\n monthDisplay: MonthDisplay;\n yearDisplay: YearDisplay;\n decadeDisplay: DecadeDisplay;\n timeDisplay: TimeDisplay;\n hourDisplay: HourDisplay;\n minuteDisplay: MinuteDisplay;\n secondDisplay: SecondDisplay;\n private _eventEmitters: EventEmitters;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.validation = serviceLocator.locate(Validation);\n this.dates = serviceLocator.locate(Dates);\n\n this.dateDisplay = serviceLocator.locate(DateDisplay);\n this.monthDisplay = serviceLocator.locate(MonthDisplay);\n this.yearDisplay = serviceLocator.locate(YearDisplay);\n this.decadeDisplay = serviceLocator.locate(DecadeDisplay);\n this.timeDisplay = serviceLocator.locate(TimeDisplay);\n this.hourDisplay = serviceLocator.locate(HourDisplay);\n this.minuteDisplay = serviceLocator.locate(MinuteDisplay);\n this.secondDisplay = serviceLocator.locate(SecondDisplay);\n this._eventEmitters = serviceLocator.locate(EventEmitters);\n this._widget = undefined;\n\n this._eventEmitters.updateDisplay.subscribe((result: ViewUpdateValues) => {\n this._update(result);\n });\n }\n\n /**\n * Returns the widget body or undefined\n * @private\n */\n get widget(): HTMLElement | undefined {\n return this._widget;\n }\n\n get dateContainer(): HTMLElement | undefined {\n return this.widget?.querySelector(`div.${Namespace.css.dateContainer}`);\n }\n\n get timeContainer(): HTMLElement | undefined {\n return this.widget?.querySelector(`div.${Namespace.css.timeContainer}`);\n }\n\n /**\n * Returns this visible state of the picker (shown)\n */\n get isVisible() {\n return this._isVisible;\n }\n\n /**\n * Updates the table for a particular unit. Used when an option as changed or\n * whenever the class list might need to be refreshed.\n * @param unit\n * @private\n */\n _update(unit: ViewUpdateValues): void {\n if (!this.widget) return;\n //todo do I want some kind of error catching or other guards here?\n switch (unit) {\n case Unit.seconds:\n this.secondDisplay._update(this.widget, this.paint);\n break;\n case Unit.minutes:\n this.minuteDisplay._update(this.widget, this.paint);\n break;\n case Unit.hours:\n this.hourDisplay._update(this.widget, this.paint);\n break;\n case Unit.date:\n this.dateDisplay._update(this.widget, this.paint);\n break;\n case Unit.month:\n this.monthDisplay._update(this.widget, this.paint);\n break;\n case Unit.year:\n this.yearDisplay._update(this.widget, this.paint);\n break;\n case 'clock':\n if (!this._hasTime) break;\n this.timeDisplay._update(this.widget);\n this._update(Unit.hours);\n this._update(Unit.minutes);\n this._update(Unit.seconds);\n break;\n case 'calendar':\n this._update(Unit.date);\n this._update(Unit.year);\n this._update(Unit.month);\n this.decadeDisplay._update(this.widget, this.paint);\n this._updateCalendarHeader();\n break;\n case 'all':\n if (this._hasTime) {\n this._update('clock');\n }\n if (this._hasDate) {\n this._update('calendar');\n }\n }\n }\n\n // noinspection JSUnusedLocalSymbols\n /**\n * Allows developers to add/remove classes from an element.\n * @param _unit\n * @param _date\n * @param _classes\n * @param _element\n */\n\n /* eslint-disable @typescript-eslint/no-unused-vars */\n paint(\n _unit: Unit | 'decade',\n _date: DateTime,\n _classes: string[],\n _element: HTMLElement\n ) {\n // implemented in plugin\n }\n\n /**\n * Shows the picker and creates a Popper instance if needed.\n * Add document click event to hide when clicking outside the picker.\n * fires Events#show\n */\n show(): void {\n if (this.widget == undefined) {\n this._showSetDefaultIfNeeded();\n\n this._buildWidget();\n this._updateTheme();\n\n this._showSetupViewMode();\n\n if (!this.optionsStore.options.display.inline) {\n // If needed to change the parent container\n const container = this.optionsStore.options?.container || document.body;\n const placement =\n this.optionsStore.options?.display?.placement || 'bottom';\n\n container.appendChild(this.widget);\n this.createPopup(this.optionsStore.element, this.widget, {\n modifiers: [{ name: 'eventListeners', enabled: true }],\n //#2400\n placement:\n document.documentElement.dir === 'rtl'\n ? `${placement}-end`\n : `${placement}-start`,\n }).then();\n } else {\n this.optionsStore.element.appendChild(this.widget);\n }\n\n if (this.optionsStore.options.display.viewMode == 'clock') {\n this._eventEmitters.action.emit({\n e: null,\n action: ActionTypes.showClock,\n });\n }\n\n this.widget\n .querySelectorAll('[data-action]')\n .forEach((element) =>\n element.addEventListener('click', this._actionsClickEvent)\n );\n\n // show the clock when using sideBySide\n if (this._hasTime && this.optionsStore.options.display.sideBySide) {\n this.timeDisplay._update(this.widget);\n (\n this.widget.getElementsByClassName(\n Namespace.css.clockContainer\n )[0] as HTMLElement\n ).style.display = 'grid';\n }\n }\n\n this.widget.classList.add(Namespace.css.show);\n if (!this.optionsStore.options.display.inline) {\n this.updatePopup();\n document.addEventListener('click', this._documentClickEvent);\n }\n this._eventEmitters.triggerEvent.emit({ type: Namespace.events.show });\n this._isVisible = true;\n }\n\n private _showSetupViewMode() {\n // If modeView is only clock\n const onlyClock = this._hasTime && !this._hasDate;\n\n // reset the view to the clock if there's no date components\n if (onlyClock) {\n this.optionsStore.currentView = 'clock';\n this._eventEmitters.action.emit({\n e: null,\n action: ActionTypes.showClock,\n });\n }\n // otherwise return to the calendar view\n else if (!this.optionsStore.currentCalendarViewMode) {\n this.optionsStore.currentCalendarViewMode =\n this.optionsStore.minimumCalendarViewMode;\n }\n\n if (!onlyClock && this.optionsStore.options.display.viewMode !== 'clock') {\n if (this._hasTime) {\n if (!this.optionsStore.options.display.sideBySide) {\n Collapse.hideImmediately(this.timeContainer);\n } else {\n Collapse.show(this.timeContainer);\n }\n }\n Collapse.show(this.dateContainer);\n }\n\n if (this._hasDate) {\n this._showMode();\n }\n }\n\n private _showSetDefaultIfNeeded() {\n if (this.dates.picked.length != 0) return;\n\n if (\n this.optionsStore.options.useCurrent &&\n !this.optionsStore.options.defaultDate\n ) {\n const date = new DateTime().setLocalization(\n this.optionsStore.options.localization\n );\n if (!this.optionsStore.options.keepInvalid) {\n let tries = 0;\n let direction = 1;\n if (this.optionsStore.options.restrictions.maxDate?.isBefore(date)) {\n direction = -1;\n }\n while (!this.validation.isValid(date) && tries > 31) {\n date.manipulate(direction, Unit.date);\n tries++;\n }\n }\n this.dates.setValue(date);\n }\n\n if (this.optionsStore.options.defaultDate) {\n this.dates.setValue(this.optionsStore.options.defaultDate);\n }\n }\n\n async createPopup(\n element: HTMLElement,\n widget: HTMLElement,\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n options: any\n ): Promise {\n let createPopperFunction;\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((window as any)?.Popper) {\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n createPopperFunction = (window as any)?.Popper?.createPopper;\n } else {\n const { createPopper } = await import('@popperjs/core');\n createPopperFunction = createPopper;\n }\n if (createPopperFunction) {\n this._popperInstance = createPopperFunction(element, widget, options);\n }\n }\n\n updatePopup(): void {\n this._popperInstance?.update();\n }\n\n /**\n * Changes the calendar view mode. E.g. month <-> year\n * @param direction -/+ number to move currentViewMode\n * @private\n */\n _showMode(direction?: number): void {\n if (!this.widget) {\n return;\n }\n if (direction) {\n const max = Math.max(\n this.optionsStore.minimumCalendarViewMode,\n Math.min(3, this.optionsStore.currentCalendarViewMode + direction)\n );\n if (this.optionsStore.currentCalendarViewMode == max) return;\n this.optionsStore.currentCalendarViewMode = max;\n }\n\n this.widget\n .querySelectorAll(\n `.${Namespace.css.dateContainer} > div:not(.${Namespace.css.calendarHeader}), .${Namespace.css.timeContainer} > div:not(.${Namespace.css.clockContainer})`\n )\n .forEach((e: HTMLElement) => (e.style.display = 'none'));\n\n const datePickerMode =\n CalendarModes[this.optionsStore.currentCalendarViewMode];\n const picker: HTMLElement = this.widget.querySelector(\n `.${datePickerMode.className}`\n );\n\n switch (datePickerMode.className) {\n case Namespace.css.decadesContainer:\n this.decadeDisplay._update(this.widget, this.paint);\n break;\n case Namespace.css.yearsContainer:\n this.yearDisplay._update(this.widget, this.paint);\n break;\n case Namespace.css.monthsContainer:\n this.monthDisplay._update(this.widget, this.paint);\n break;\n case Namespace.css.daysContainer:\n this.dateDisplay._update(this.widget, this.paint);\n break;\n }\n\n picker.style.display = 'grid';\n\n if (this.optionsStore.options.display.sideBySide)\n ((\n this.widget.querySelectorAll(`.${Namespace.css.clockContainer}`)[0]\n )).style.display = 'grid';\n\n this._updateCalendarHeader();\n this._eventEmitters.viewUpdate.emit();\n }\n\n /**\n * Changes the theme. E.g. light, dark or auto\n * @param theme the theme name\n * @private\n */\n _updateTheme(theme?: 'light' | 'dark' | 'auto'): void {\n if (!this.widget) {\n return;\n }\n if (theme) {\n if (this.optionsStore.options.display.theme === theme) return;\n this.optionsStore.options.display.theme = theme;\n }\n\n this.widget.classList.remove('light', 'dark');\n this.widget.classList.add(this._getThemeClass());\n\n if (this.optionsStore.options.display.theme === 'auto') {\n window\n .matchMedia(Namespace.css.isDarkPreferredQuery)\n .addEventListener('change', () => this._updateTheme());\n } else {\n window\n .matchMedia(Namespace.css.isDarkPreferredQuery)\n .removeEventListener('change', () => this._updateTheme());\n }\n }\n\n _getThemeClass(): string {\n const currentTheme = this.optionsStore.options.display.theme || 'auto';\n\n const isDarkMode =\n window.matchMedia &&\n window.matchMedia(Namespace.css.isDarkPreferredQuery).matches;\n\n switch (currentTheme) {\n case 'light':\n return Namespace.css.lightTheme;\n case 'dark':\n return Namespace.css.darkTheme;\n case 'auto':\n return isDarkMode ? Namespace.css.darkTheme : Namespace.css.lightTheme;\n }\n }\n\n _updateCalendarHeader() {\n if (!this._hasDate) return;\n const showing = [\n ...this.widget.querySelector(\n `.${Namespace.css.dateContainer} div[style*=\"display: grid\"]`\n ).classList,\n ].find((x) => x.startsWith(Namespace.css.dateContainer));\n\n const [previous, switcher, next] = this.widget\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\n .getElementsByTagName('div');\n\n switch (showing) {\n case Namespace.css.decadesContainer:\n previous.setAttribute(\n 'title',\n this.optionsStore.options.localization.previousCentury\n );\n switcher.setAttribute('title', '');\n next.setAttribute(\n 'title',\n this.optionsStore.options.localization.nextCentury\n );\n break;\n case Namespace.css.yearsContainer:\n previous.setAttribute(\n 'title',\n this.optionsStore.options.localization.previousDecade\n );\n switcher.setAttribute(\n 'title',\n this.optionsStore.options.localization.selectDecade\n );\n next.setAttribute(\n 'title',\n this.optionsStore.options.localization.nextDecade\n );\n break;\n case Namespace.css.monthsContainer:\n previous.setAttribute(\n 'title',\n this.optionsStore.options.localization.previousYear\n );\n switcher.setAttribute(\n 'title',\n this.optionsStore.options.localization.selectYear\n );\n next.setAttribute(\n 'title',\n this.optionsStore.options.localization.nextYear\n );\n break;\n case Namespace.css.daysContainer:\n previous.setAttribute(\n 'title',\n this.optionsStore.options.localization.previousMonth\n );\n switcher.setAttribute(\n 'title',\n this.optionsStore.options.localization.selectMonth\n );\n next.setAttribute(\n 'title',\n this.optionsStore.options.localization.nextMonth\n );\n switcher.setAttribute(\n showing,\n this.optionsStore.viewDate.format(\n this.optionsStore.options.localization.dayViewHeaderFormat\n )\n );\n break;\n }\n switcher.innerText = switcher.getAttribute(showing);\n }\n\n /**\n * Hides the picker if needed.\n * Remove document click event to hide when clicking outside the picker.\n * fires Events#hide\n */\n hide(): void {\n if (!this.widget || !this._isVisible) return;\n\n this.widget.classList.remove(Namespace.css.show);\n\n if (this._isVisible) {\n this._eventEmitters.triggerEvent.emit({\n type: Namespace.events.hide,\n date: this.optionsStore.unset ? null : this.dates.lastPicked?.clone,\n } as HideEvent);\n this._isVisible = false;\n }\n\n document.removeEventListener('click', this._documentClickEvent);\n }\n\n /**\n * Toggles the picker's open state. Fires a show/hide event depending.\n */\n toggle() {\n return this._isVisible ? this.hide() : this.show();\n }\n\n /**\n * Removes document and data-action click listener and reset the widget\n * @private\n */\n _dispose() {\n document.removeEventListener('click', this._documentClickEvent);\n if (!this.widget) return;\n this.widget\n .querySelectorAll('[data-action]')\n .forEach((element) =>\n element.removeEventListener('click', this._actionsClickEvent)\n );\n this.widget.parentNode.removeChild(this.widget);\n this._widget = undefined;\n }\n\n /**\n * Builds the widgets html template.\n * @private\n */\n private _buildWidget(): HTMLElement {\n const template = document.createElement('div');\n template.classList.add(Namespace.css.widget);\n\n const dateView = document.createElement('div');\n dateView.classList.add(Namespace.css.dateContainer);\n dateView.append(\n this.getHeadTemplate(),\n this.decadeDisplay.getPicker(),\n this.yearDisplay.getPicker(),\n this.monthDisplay.getPicker(),\n this.dateDisplay.getPicker()\n );\n\n const timeView = document.createElement('div');\n timeView.classList.add(Namespace.css.timeContainer);\n timeView.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this)));\n timeView.appendChild(this.hourDisplay.getPicker());\n timeView.appendChild(this.minuteDisplay.getPicker());\n timeView.appendChild(this.secondDisplay.getPicker());\n\n const toolbar = document.createElement('div');\n toolbar.classList.add(Namespace.css.toolbar);\n toolbar.append(...this.getToolbarElements());\n\n if (this.optionsStore.options.display.inline) {\n template.classList.add(Namespace.css.inline);\n }\n\n if (this.optionsStore.options.display.calendarWeeks) {\n template.classList.add('calendarWeeks');\n }\n\n if (this.optionsStore.options.display.sideBySide && this._hasDateAndTime) {\n this._buildWidgetSideBySide(template, dateView, timeView, toolbar);\n return;\n }\n\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\n template.appendChild(toolbar);\n }\n\n const setupComponentView = (hasFirst, hasSecond, element, shouldShow) => {\n if (!hasFirst) return;\n if (hasSecond) {\n element.classList.add(Namespace.css.collapse);\n if (shouldShow) element.classList.add(Namespace.css.show);\n }\n template.appendChild(element);\n };\n\n setupComponentView(\n this._hasDate,\n this._hasTime,\n dateView,\n this.optionsStore.options.display.viewMode !== 'clock'\n );\n\n setupComponentView(\n this._hasTime,\n this._hasDate,\n timeView,\n this.optionsStore.options.display.viewMode === 'clock'\n );\n\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\n template.appendChild(toolbar);\n }\n\n const arrow = document.createElement('div');\n arrow.classList.add('arrow');\n arrow.setAttribute('data-popper-arrow', '');\n template.appendChild(arrow);\n\n this._widget = template;\n }\n\n private _buildWidgetSideBySide(\n template: HTMLDivElement,\n dateView: HTMLDivElement,\n timeView: HTMLDivElement,\n toolbar: HTMLDivElement\n ) {\n template.classList.add(Namespace.css.sideBySide);\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\n template.appendChild(toolbar);\n }\n const row = document.createElement('div');\n row.classList.add('td-row');\n dateView.classList.add('td-half');\n timeView.classList.add('td-half');\n\n row.appendChild(dateView);\n row.appendChild(timeView);\n template.appendChild(row);\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\n template.appendChild(toolbar);\n }\n this._widget = template;\n }\n\n /**\n * Returns true if the hours, minutes, or seconds component is turned on\n */\n get _hasTime(): boolean {\n return (\n this.optionsStore.options.display.components.clock &&\n (this.optionsStore.options.display.components.hours ||\n this.optionsStore.options.display.components.minutes ||\n this.optionsStore.options.display.components.seconds)\n );\n }\n\n /**\n * Returns true if the year, month, or date component is turned on\n */\n get _hasDate(): boolean {\n return (\n this.optionsStore.options.display.components.calendar &&\n (this.optionsStore.options.display.components.year ||\n this.optionsStore.options.display.components.month ||\n this.optionsStore.options.display.components.date)\n );\n }\n\n get _hasDateAndTime(): boolean {\n return this._hasDate && this._hasTime;\n }\n\n /**\n * Get the toolbar html based on options like buttons => today\n * @private\n */\n getToolbarElements(): HTMLElement[] {\n const toolbar = [];\n\n if (this.optionsStore.options.display.buttons.today) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.today);\n div.setAttribute('title', this.optionsStore.options.localization.today);\n\n div.appendChild(\n this._iconTag(this.optionsStore.options.display.icons.today)\n );\n toolbar.push(div);\n }\n if (\n !this.optionsStore.options.display.sideBySide &&\n this._hasDate &&\n this._hasTime\n ) {\n let title, icon;\n if (this.optionsStore.options.display.viewMode === 'clock') {\n title = this.optionsStore.options.localization.selectDate;\n icon = this.optionsStore.options.display.icons.date;\n } else {\n title = this.optionsStore.options.localization.selectTime;\n icon = this.optionsStore.options.display.icons.time;\n }\n\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.togglePicker);\n div.setAttribute('title', title);\n\n div.appendChild(this._iconTag(icon));\n toolbar.push(div);\n }\n if (this.optionsStore.options.display.buttons.clear) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.clear);\n div.setAttribute('title', this.optionsStore.options.localization.clear);\n\n div.appendChild(\n this._iconTag(this.optionsStore.options.display.icons.clear)\n );\n toolbar.push(div);\n }\n if (this.optionsStore.options.display.buttons.close) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.close);\n div.setAttribute('title', this.optionsStore.options.localization.close);\n\n div.appendChild(\n this._iconTag(this.optionsStore.options.display.icons.close)\n );\n toolbar.push(div);\n }\n\n return toolbar;\n }\n\n /***\n * Builds the base header template with next and previous icons\n * @private\n */\n getHeadTemplate(): HTMLElement {\n const calendarHeader = document.createElement('div');\n calendarHeader.classList.add(Namespace.css.calendarHeader);\n\n const previous = document.createElement('div');\n previous.classList.add(Namespace.css.previous);\n previous.setAttribute('data-action', ActionTypes.previous);\n previous.appendChild(\n this._iconTag(this.optionsStore.options.display.icons.previous)\n );\n\n const switcher = document.createElement('div');\n switcher.classList.add(Namespace.css.switch);\n switcher.setAttribute('data-action', ActionTypes.changeCalendarView);\n\n const next = document.createElement('div');\n next.classList.add(Namespace.css.next);\n next.setAttribute('data-action', ActionTypes.next);\n next.appendChild(\n this._iconTag(this.optionsStore.options.display.icons.next)\n );\n\n calendarHeader.append(previous, switcher, next);\n return calendarHeader;\n }\n\n /**\n * Builds an icon tag as either an ``\n * or with icons => type is `sprites` then a svg tag instead\n * @param iconClass\n * @private\n */\n _iconTag(iconClass: string): HTMLElement | SVGElement {\n if (this.optionsStore.options.display.icons.type === 'sprites') {\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n\n const icon = document.createElementNS(\n 'http://www.w3.org/2000/svg',\n 'use'\n );\n icon.setAttribute('xlink:href', iconClass); // Deprecated. Included for backward compatibility\n icon.setAttribute('href', iconClass);\n svg.appendChild(icon);\n\n return svg;\n }\n const icon = document.createElement('i');\n icon.classList.add(...iconClass.split(' '));\n return icon;\n }\n\n /**\n * A document click event to hide the widget if click is outside\n * @private\n * @param e MouseEvent\n */\n private _documentClickEvent = (e: MouseEvent) => {\n if (this.optionsStore.options.debug || (window as any).debug) return; //eslint-disable-line @typescript-eslint/no-explicit-any\n\n if (\n this._isVisible &&\n !e.composedPath().includes(this.widget) && // click inside the widget\n !e.composedPath()?.includes(this.optionsStore.element) // click on the element\n ) {\n this.hide();\n }\n };\n\n /**\n * Click event for any action like selecting a date\n * @param e MouseEvent\n * @private\n */\n private _actionsClickEvent = (e: MouseEvent) => {\n this._eventEmitters.action.emit({ e: e });\n };\n\n /**\n * Causes the widget to get rebuilt on next show. If the picker is already open\n * then hide and reshow it.\n * @private\n */\n _rebuild() {\n const wasVisible = this._isVisible;\n this._dispose();\n if (wasVisible) this.show();\n }\n}\n\nexport type Paint = (\n unit: Unit | 'decade',\n innerDate: DateTime,\n classes: string[],\n element: HTMLElement\n) => void;\n","import { DateTime, Unit } from './datetime';\nimport Collapse from './display/collapse';\nimport Namespace from './utilities/namespace';\nimport Dates from './dates';\nimport Validation from './validation';\nimport Display from './display';\nimport { EventEmitters } from './utilities/event-emitter';\nimport { serviceLocator } from './utilities/service-locator.js';\nimport ActionTypes from './utilities/action-types';\nimport CalendarModes from './utilities/calendar-modes';\nimport { OptionsStore } from './utilities/optionsStore';\n\n/**\n * Logic for various click actions\n */\nexport default class Actions {\n private optionsStore: OptionsStore;\n private validation: Validation;\n private dates: Dates;\n private display: Display;\n private _eventEmitters: EventEmitters;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n this.display = serviceLocator.locate(Display);\n this._eventEmitters = serviceLocator.locate(EventEmitters);\n\n this._eventEmitters.action.subscribe((result) => {\n this.do(result.e, result.action);\n });\n }\n\n /**\n * Performs the selected `action`. See ActionTypes\n * @param e This is normally a click event\n * @param action If not provided, then look for a [data-action]\n */\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n do(e: any, action?: ActionTypes) {\n const currentTarget = e?.currentTarget as HTMLElement;\n if (currentTarget?.classList?.contains(Namespace.css.disabled)) return;\n action = action || (currentTarget?.dataset?.action as ActionTypes);\n const lastPicked = (this.dates.lastPicked || this.optionsStore.viewDate)\n .clone;\n\n switch (action) {\n case ActionTypes.next:\n case ActionTypes.previous:\n this.handleNextPrevious(action);\n break;\n case ActionTypes.changeCalendarView:\n this.display._showMode(1);\n this.display._updateCalendarHeader();\n break;\n case ActionTypes.selectMonth:\n case ActionTypes.selectYear:\n case ActionTypes.selectDecade:\n this.handleSelectCalendarMode(action, currentTarget);\n break;\n case ActionTypes.selectDay:\n this.handleSelectDay(currentTarget);\n break;\n case ActionTypes.selectHour: {\n let hour = +currentTarget.dataset.value;\n if (lastPicked.hours >= 12 && this.optionsStore.isTwelveHour)\n hour += 12;\n lastPicked.hours = hour;\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\n this.hideOrClock(e);\n break;\n }\n case ActionTypes.selectMinute: {\n lastPicked.minutes = +currentTarget.dataset.value;\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\n this.hideOrClock(e);\n break;\n }\n case ActionTypes.selectSecond: {\n lastPicked.seconds = +currentTarget.dataset.value;\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\n this.hideOrClock(e);\n break;\n }\n case ActionTypes.incrementHours:\n this.manipulateAndSet(lastPicked, Unit.hours);\n break;\n case ActionTypes.incrementMinutes:\n this.manipulateAndSet(\n lastPicked,\n Unit.minutes,\n this.optionsStore.options.stepping\n );\n break;\n case ActionTypes.incrementSeconds:\n this.manipulateAndSet(lastPicked, Unit.seconds);\n break;\n case ActionTypes.decrementHours:\n this.manipulateAndSet(lastPicked, Unit.hours, -1);\n break;\n case ActionTypes.decrementMinutes:\n this.manipulateAndSet(\n lastPicked,\n Unit.minutes,\n this.optionsStore.options.stepping * -1\n );\n break;\n case ActionTypes.decrementSeconds:\n this.manipulateAndSet(lastPicked, Unit.seconds, -1);\n break;\n case ActionTypes.toggleMeridiem:\n this.manipulateAndSet(\n lastPicked,\n Unit.hours,\n this.dates.lastPicked.hours >= 12 ? -12 : 12\n );\n break;\n case ActionTypes.togglePicker:\n this.handleToggle(currentTarget);\n break;\n case ActionTypes.showClock:\n case ActionTypes.showHours:\n case ActionTypes.showMinutes:\n case ActionTypes.showSeconds:\n //make sure the clock is actually displaying\n if (\n !this.optionsStore.options.display.sideBySide &&\n this.optionsStore.currentView !== 'clock'\n ) {\n //hide calendar\n Collapse.hideImmediately(this.display.dateContainer);\n //show clock\n Collapse.showImmediately(this.display.timeContainer);\n }\n this.handleShowClockContainers(action);\n break;\n case ActionTypes.clear:\n this.dates.setValue(null);\n this.display._updateCalendarHeader();\n break;\n case ActionTypes.close:\n this.display.hide();\n break;\n case ActionTypes.today: {\n const today = new DateTime().setLocalization(\n this.optionsStore.options.localization\n );\n this._eventEmitters.updateViewDate.emit(today);\n\n //todo this this really a good idea?\n if (this.validation.isValid(today, Unit.date))\n this.dates.setValue(today, this.dates.lastPickedIndex);\n break;\n }\n }\n }\n\n private handleShowClockContainers(action: ActionTypes) {\n if (!this.display._hasTime) {\n Namespace.errorMessages.throwError(\n 'Cannot show clock containers when time is disabled.'\n );\n /* ignore coverage: should never happen */\n return;\n }\n\n this.optionsStore.currentView = 'clock';\n this.display.widget\n .querySelectorAll(`.${Namespace.css.timeContainer} > div`)\n .forEach(\n (htmlElement: HTMLElement) => (htmlElement.style.display = 'none')\n );\n\n let classToUse = '';\n switch (action) {\n case ActionTypes.showClock:\n classToUse = Namespace.css.clockContainer;\n this.display._update('clock');\n break;\n case ActionTypes.showHours:\n classToUse = Namespace.css.hourContainer;\n this.display._update(Unit.hours);\n break;\n case ActionTypes.showMinutes:\n classToUse = Namespace.css.minuteContainer;\n this.display._update(Unit.minutes);\n break;\n case ActionTypes.showSeconds:\n classToUse = Namespace.css.secondContainer;\n this.display._update(Unit.seconds);\n break;\n }\n\n ((\n this.display.widget.getElementsByClassName(classToUse)[0]\n )).style.display = 'grid';\n }\n\n private handleNextPrevious(action: ActionTypes) {\n const { unit, step } =\n CalendarModes[this.optionsStore.currentCalendarViewMode];\n if (action === ActionTypes.next)\n this.optionsStore.viewDate.manipulate(step, unit);\n else this.optionsStore.viewDate.manipulate(step * -1, unit);\n this._eventEmitters.viewUpdate.emit();\n\n this.display._showMode();\n }\n\n /**\n * After setting the value it will either show the clock or hide the widget.\n * @param e\n */\n private hideOrClock(e) {\n if (\n !this.optionsStore.isTwelveHour &&\n !this.optionsStore.options.display.components.minutes &&\n !this.optionsStore.options.display.keepOpen &&\n !this.optionsStore.options.display.inline\n ) {\n this.display.hide();\n } else {\n this.do(e, ActionTypes.showClock);\n }\n }\n\n /**\n * Common function to manipulate {@link lastPicked} by `unit`.\n * @param lastPicked\n * @param unit\n * @param value Value to change by\n */\n private manipulateAndSet(lastPicked: DateTime, unit: Unit, value = 1) {\n const newDate = lastPicked.manipulate(value, unit);\n if (this.validation.isValid(newDate, unit)) {\n this.dates.setValue(newDate, this.dates.lastPickedIndex);\n }\n }\n\n private handleSelectCalendarMode(\n action:\n | ActionTypes.selectMonth\n | ActionTypes.selectYear\n | ActionTypes.selectDecade,\n currentTarget: HTMLElement\n ) {\n const value = +currentTarget.dataset.value;\n switch (action) {\n case ActionTypes.selectMonth:\n this.optionsStore.viewDate.month = value;\n break;\n case ActionTypes.selectYear:\n case ActionTypes.selectDecade:\n this.optionsStore.viewDate.year = value;\n break;\n }\n\n if (\n this.optionsStore.currentCalendarViewMode ===\n this.optionsStore.minimumCalendarViewMode\n ) {\n this.dates.setValue(\n this.optionsStore.viewDate,\n this.dates.lastPickedIndex\n );\n if (!this.optionsStore.options.display.inline) {\n this.display.hide();\n }\n } else {\n this.display._showMode(-1);\n }\n }\n\n private handleToggle(currentTarget: HTMLElement) {\n if (\n currentTarget.getAttribute('title') ===\n this.optionsStore.options.localization.selectDate\n ) {\n currentTarget.setAttribute(\n 'title',\n this.optionsStore.options.localization.selectTime\n );\n currentTarget.innerHTML = this.display._iconTag(\n this.optionsStore.options.display.icons.time\n ).outerHTML;\n\n this.display._updateCalendarHeader();\n this.optionsStore.refreshCurrentView();\n } else {\n currentTarget.setAttribute(\n 'title',\n this.optionsStore.options.localization.selectDate\n );\n currentTarget.innerHTML = this.display._iconTag(\n this.optionsStore.options.display.icons.date\n ).outerHTML;\n if (this.display._hasTime) {\n this.handleShowClockContainers(ActionTypes.showClock);\n this.display._update('clock');\n }\n }\n\n this.display.widget\n .querySelectorAll(\n `.${Namespace.css.dateContainer}, .${Namespace.css.timeContainer}`\n )\n .forEach((htmlElement: HTMLElement) => Collapse.toggle(htmlElement));\n this._eventEmitters.viewUpdate.emit();\n }\n\n private handleSelectDay(currentTarget: HTMLElement) {\n const day = this.optionsStore.viewDate.clone;\n if (currentTarget.classList.contains(Namespace.css.old)) {\n day.manipulate(-1, Unit.month);\n }\n if (currentTarget.classList.contains(Namespace.css.new)) {\n day.manipulate(1, Unit.month);\n }\n\n day.date = +currentTarget.dataset.day;\n if (this.optionsStore.options.dateRange) this.handleDateRange(day);\n else if (this.optionsStore.options.multipleDates) {\n this.handleMultiDate(day);\n } else {\n this.dates.setValue(day, this.dates.lastPickedIndex);\n }\n\n if (\n !this.display._hasTime &&\n !this.optionsStore.options.display.keepOpen &&\n !this.optionsStore.options.display.inline &&\n !this.optionsStore.options.multipleDates &&\n !this.optionsStore.options.dateRange\n ) {\n this.display.hide();\n }\n }\n\n private handleMultiDate(day: DateTime) {\n let index = this.dates.pickedIndex(day, Unit.date);\n console.log(index);\n if (index !== -1) {\n this.dates.setValue(null, index); //deselect multi-date\n } else {\n index = this.dates.lastPickedIndex + 1;\n if (this.dates.picked.length === 0) index = 0;\n\n this.dates.setValue(day, index);\n }\n }\n\n private handleDateRange(day: DateTime) {\n switch (this.dates.picked.length) {\n case 2: {\n this.dates.clear();\n break;\n }\n case 1: {\n const other = this.dates.picked[0];\n if (day.getTime() === other.getTime()) {\n this.dates.clear();\n break;\n }\n if (day.isBefore(other)) {\n this.dates.setValue(day, 0);\n this.dates.setValue(other, 1);\n return;\n } else this.dates.setValue(day, 1);\n return;\n }\n }\n\n this.dates.setValue(day, 0);\n }\n}\n","import Display from './display/index';\nimport Dates from './dates';\nimport Actions from './actions';\nimport {\n DateTime,\n DateTimeFormatOptions,\n guessHourCycle,\n Unit,\n} from './datetime';\nimport Namespace from './utilities/namespace';\nimport Options from './utilities/options';\nimport {\n BaseEvent,\n ChangeEvent,\n ViewUpdateEvent,\n} from './utilities/event-types';\nimport { EventEmitters } from './utilities/event-emitter';\nimport {\n serviceLocator,\n setupServiceLocator,\n} from './utilities/service-locator';\nimport CalendarModes from './utilities/calendar-modes';\nimport DefaultOptions, {\n DefaultEnLocalization,\n} from './utilities/default-options';\nimport ActionTypes from './utilities/action-types';\nimport { OptionsStore } from './utilities/optionsStore';\nimport { OptionConverter } from './utilities/optionConverter';\n\n/**\n * A robust and powerful date/time picker component.\n */\nclass TempusDominus {\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n _subscribers: { [key: string]: ((event: any) => Record)[] } =\n {};\n private _isDisabled = false;\n private _toggle: HTMLElement;\n private _currentPromptTimeTimeout: NodeJS.Timeout;\n private actions: Actions;\n private optionsStore: OptionsStore;\n private _eventEmitters: EventEmitters;\n display: Display;\n dates: Dates;\n\n constructor(element: HTMLElement, options: Options = {} as Options) {\n setupServiceLocator();\n this._eventEmitters = serviceLocator.locate(EventEmitters);\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.display = serviceLocator.locate(Display);\n this.dates = serviceLocator.locate(Dates);\n this.actions = serviceLocator.locate(Actions);\n\n if (!element) {\n Namespace.errorMessages.mustProvideElement();\n }\n\n this.optionsStore.element = element;\n this._initializeOptions(options, DefaultOptions, true);\n this.optionsStore.viewDate.setLocalization(\n this.optionsStore.options.localization\n );\n this.optionsStore.unset = true;\n\n this._initializeInput();\n this._initializeToggle();\n\n if (this.optionsStore.options.display.inline) this.display.show();\n\n this._eventEmitters.triggerEvent.subscribe((e) => {\n this._triggerEvent(e);\n });\n\n this._eventEmitters.viewUpdate.subscribe(() => {\n this._viewUpdate();\n });\n\n this._eventEmitters.updateViewDate.subscribe((dateTime) => {\n this.viewDate = dateTime;\n });\n }\n\n get viewDate() {\n return this.optionsStore.viewDate;\n }\n\n set viewDate(value) {\n this.optionsStore.viewDate = value;\n this.optionsStore.viewDate.setLocalization(\n this.optionsStore.options.localization\n );\n this.display._update(\n this.optionsStore.currentView === 'clock' ? 'clock' : 'calendar'\n );\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Update the picker options. If `reset` is provide `options` will be merged with DefaultOptions instead.\n * @param options\n * @param reset\n * @public\n */\n updateOptions(options, reset = false): void {\n if (reset) this._initializeOptions(options, DefaultOptions);\n else this._initializeOptions(options, this.optionsStore.options);\n\n this.optionsStore.viewDate.setLocalization(\n this.optionsStore.options.localization\n );\n this.display._rebuild();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Toggles the picker open or closed. If the picker is disabled, nothing will happen.\n * @public\n */\n toggle(): void {\n if (this._isDisabled) return;\n this.display.toggle();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Shows the picker unless the picker is disabled.\n * @public\n */\n show(): void {\n if (this._isDisabled) return;\n this.display.show();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Hides the picker unless the picker is disabled.\n * @public\n */\n hide(): void {\n this.display.hide();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Disables the picker and the target input field.\n * @public\n */\n disable(): void {\n this._isDisabled = true;\n // todo this might be undesired. If a dev disables the input field to\n // only allow using the picker, this will break that.\n this.optionsStore.input?.setAttribute('disabled', 'disabled');\n this.display.hide();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Enables the picker and the target input field.\n * @public\n */\n enable(): void {\n this._isDisabled = false;\n this.optionsStore.input?.removeAttribute('disabled');\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Clears all the selected dates\n * @public\n */\n clear(): void {\n this.optionsStore.input.value = '';\n this.dates.clear();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Allows for a direct subscription to picker events, without having to use addEventListener on the element.\n * @param eventTypes See Namespace.Events\n * @param callbacks Function to call when event is triggered\n * @public\n */\n subscribe(\n eventTypes: string | string[],\n callbacks: (event: any) => void | ((event: any) => void)[] //eslint-disable-line @typescript-eslint/no-explicit-any\n ): { unsubscribe: () => void } | { unsubscribe: () => void }[] {\n if (typeof eventTypes === 'string') {\n eventTypes = [eventTypes];\n }\n let callBackArray: any[]; //eslint-disable-line @typescript-eslint/no-explicit-any\n if (!Array.isArray(callbacks)) {\n callBackArray = [callbacks];\n } else {\n callBackArray = callbacks;\n }\n\n if (eventTypes.length !== callBackArray.length) {\n Namespace.errorMessages.subscribeMismatch();\n }\n\n const returnArray = [];\n\n for (let i = 0; i < eventTypes.length; i++) {\n const eventType = eventTypes[i];\n if (!Array.isArray(this._subscribers[eventType])) {\n this._subscribers[eventType] = [];\n }\n\n this._subscribers[eventType].push(callBackArray[i]);\n\n returnArray.push({\n unsubscribe: this._unsubscribe.bind(\n this,\n eventType,\n this._subscribers[eventType].length - 1\n ),\n });\n\n if (eventTypes.length === 1) {\n return returnArray[0];\n }\n }\n\n return returnArray;\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Hides the picker and removes event listeners\n */\n dispose() {\n this.display.hide();\n // this will clear the document click event listener\n this.display._dispose();\n this._eventEmitters.destroy();\n this.optionsStore.input?.removeEventListener(\n 'change',\n this._inputChangeEvent\n );\n if (this.optionsStore.options.allowInputToggle) {\n this.optionsStore.input?.removeEventListener(\n 'click',\n this._toggleClickEvent\n );\n }\n this._toggle?.removeEventListener('click', this._toggleClickEvent);\n this._subscribers = {};\n }\n\n /**\n * Updates the options to use the provided language.\n * THe language file must be loaded first.\n * @param language\n */\n locale(language: string) {\n const asked = loadedLocales[language];\n if (!asked) return;\n this.updateOptions({\n localization: asked,\n });\n }\n\n /**\n * Triggers an event like ChangeEvent when the picker has updated the value\n * of a selected date.\n * @param event Accepts a BaseEvent object.\n * @private\n */\n private _triggerEvent(event: BaseEvent) {\n event.viewMode = this.optionsStore.currentView;\n\n const isChangeEvent = event.type === Namespace.events.change;\n if (isChangeEvent) {\n const { date, oldDate, isClear } = event as ChangeEvent;\n if (\n (date && oldDate && date.isSame(oldDate)) ||\n (!isClear && !date && !oldDate)\n ) {\n return;\n }\n this._handleAfterChangeEvent(event as ChangeEvent);\n\n this.optionsStore.input?.dispatchEvent(\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n new CustomEvent('change', { detail: event as any })\n );\n }\n\n this.optionsStore.element.dispatchEvent(\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n new CustomEvent(event.type, { detail: event as any })\n );\n\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((window as any).jQuery) {\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n const $ = (window as any).jQuery;\n\n if (isChangeEvent && this.optionsStore.input) {\n $(this.optionsStore.input).trigger(event);\n } else {\n $(this.optionsStore.element).trigger(event);\n }\n }\n\n this._publish(event);\n }\n\n private _publish(event: BaseEvent) {\n // return if event is not subscribed\n if (!Array.isArray(this._subscribers[event.type])) {\n return;\n }\n\n // Trigger callback for each subscriber\n this._subscribers[event.type].forEach((callback) => {\n callback(event);\n });\n }\n\n /**\n * Fires a ViewUpdate event when, for example, the month view is changed.\n * @private\n */\n private _viewUpdate() {\n this._triggerEvent({\n type: Namespace.events.update,\n viewDate: this.optionsStore.viewDate.clone,\n } as ViewUpdateEvent);\n }\n\n private _unsubscribe(eventName, index) {\n this._subscribers[eventName].splice(index, 1);\n }\n\n /**\n * Merges two Option objects together and validates options type\n * @param config new Options\n * @param mergeTo Options to merge into\n * @param includeDataset When true, the elements data-td attributes will be included in the\n * @private\n */\n private _initializeOptions(\n config: Options,\n mergeTo: Options,\n includeDataset = false\n ): void {\n let newConfig = OptionConverter.deepCopy(config);\n newConfig = OptionConverter._mergeOptions(newConfig, mergeTo);\n if (includeDataset)\n newConfig = OptionConverter._dataToOptions(\n this.optionsStore.element,\n newConfig\n );\n\n OptionConverter._validateConflicts(newConfig);\n\n newConfig.viewDate = newConfig.viewDate.setLocalization(\n newConfig.localization\n );\n\n if (!this.optionsStore.viewDate.isSame(newConfig.viewDate)) {\n this.optionsStore.viewDate = newConfig.viewDate;\n }\n\n /**\n * Sets the minimum view allowed by the picker. For example the case of only\n * allowing year and month to be selected but not date.\n */\n if (newConfig.display.components.year) {\n this.optionsStore.minimumCalendarViewMode = 2;\n }\n if (newConfig.display.components.month) {\n this.optionsStore.minimumCalendarViewMode = 1;\n }\n if (newConfig.display.components.date) {\n this.optionsStore.minimumCalendarViewMode = 0;\n }\n\n this.optionsStore.currentCalendarViewMode = Math.max(\n this.optionsStore.minimumCalendarViewMode,\n this.optionsStore.currentCalendarViewMode\n );\n\n // Update view mode if needed\n if (\n CalendarModes[this.optionsStore.currentCalendarViewMode].name !==\n newConfig.display.viewMode\n ) {\n this.optionsStore.currentCalendarViewMode = Math.max(\n CalendarModes.findIndex((x) => x.name === newConfig.display.viewMode),\n this.optionsStore.minimumCalendarViewMode\n );\n }\n\n if (this.display?.isVisible) {\n this.display._update('all');\n }\n\n if (\n newConfig.display.components.useTwentyfourHour &&\n newConfig.localization.hourCycle === undefined\n )\n newConfig.localization.hourCycle = 'h24';\n else if (newConfig.localization.hourCycle === undefined) {\n newConfig.localization.hourCycle = guessHourCycle(\n newConfig.localization.locale\n );\n }\n\n this.optionsStore.options = newConfig;\n }\n\n /**\n * Checks if an input field is being used, attempts to locate one and sets an\n * event listener if found.\n * @private\n */\n private _initializeInput() {\n if (this.optionsStore.element.tagName == 'INPUT') {\n this.optionsStore.input = this.optionsStore.element as HTMLInputElement;\n } else {\n const query = this.optionsStore.element.dataset.tdTargetInput;\n if (query == undefined || query == 'nearest') {\n this.optionsStore.input =\n this.optionsStore.element.querySelector('input');\n } else {\n this.optionsStore.input =\n this.optionsStore.element.querySelector(query);\n }\n }\n\n if (!this.optionsStore.input) return;\n\n if (!this.optionsStore.input.value && this.optionsStore.options.defaultDate)\n this.optionsStore.input.value = this.dates.formatInput(\n this.optionsStore.options.defaultDate\n );\n\n this.optionsStore.input.addEventListener('change', this._inputChangeEvent);\n if (this.optionsStore.options.allowInputToggle) {\n this.optionsStore.input.addEventListener('click', this._toggleClickEvent);\n }\n\n if (this.optionsStore.input.value) {\n this._inputChangeEvent();\n }\n }\n\n /**\n * Attempts to locate a toggle for the picker and sets an event listener\n * @private\n */\n private _initializeToggle() {\n if (this.optionsStore.options.display.inline) return;\n let query = this.optionsStore.element.dataset.tdTargetToggle;\n if (query == 'nearest') {\n query = '[data-td-toggle=\"datetimepicker\"]';\n }\n this._toggle =\n query == undefined\n ? this.optionsStore.element\n : this.optionsStore.element.querySelector(query);\n this._toggle.addEventListener('click', this._toggleClickEvent);\n }\n\n /**\n * If the option is enabled this will render the clock view after a date pick.\n * @param e change event\n * @private\n */\n private _handleAfterChangeEvent(e: ChangeEvent) {\n if (\n // options is disabled\n !this.optionsStore.options.promptTimeOnDateChange ||\n this.optionsStore.options.multipleDates ||\n this.optionsStore.options.display.inline ||\n this.optionsStore.options.display.sideBySide ||\n // time is disabled\n !this.display._hasTime ||\n // clock component is already showing\n this.display.widget\n ?.getElementsByClassName(Namespace.css.show)[0]\n .classList.contains(Namespace.css.timeContainer)\n )\n return;\n\n // First time ever. If useCurrent option is set to true (default), do nothing\n // because the first date is selected automatically.\n // or date didn't change (time did) or date changed because time did.\n if (\n (!e.oldDate && this.optionsStore.options.useCurrent) ||\n (e.oldDate && e.date?.isSame(e.oldDate))\n ) {\n return;\n }\n\n clearTimeout(this._currentPromptTimeTimeout);\n this._currentPromptTimeTimeout = setTimeout(() => {\n if (this.display.widget) {\n this._eventEmitters.action.emit({\n e: {\n currentTarget: this.display.widget.querySelector(\n `.${Namespace.css.switch}`\n ),\n },\n action: ActionTypes.togglePicker,\n });\n }\n }, this.optionsStore.options.promptTimeOnDateChangeTransitionDelay);\n }\n\n /**\n * Event for when the input field changes. This is a class level method so there's\n * something for the remove listener function.\n * @private\n */\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _inputChangeEvent = (event?: any) => {\n const internallyTriggered = event?.detail;\n if (internallyTriggered) return;\n\n const setViewDate = () => {\n if (this.dates.lastPicked)\n this.optionsStore.viewDate = this.dates.lastPicked.clone;\n };\n\n const value = this.optionsStore.input.value;\n if (this.optionsStore.options.multipleDates) {\n try {\n const valueSplit = value.split(\n this.optionsStore.options.multipleDatesSeparator\n );\n for (let i = 0; i < valueSplit.length; i++) {\n this.dates.setFromInput(valueSplit[i], i);\n }\n setViewDate();\n } catch {\n console.warn(\n 'TD: Something went wrong trying to set the multipleDates values from the input field.'\n );\n }\n } else {\n this.dates.setFromInput(value, 0);\n setViewDate();\n }\n };\n\n /**\n * Event for when the toggle is clicked. This is a class level method so there's\n * something for the remove listener function.\n * @private\n */\n private _toggleClickEvent = () => {\n if (\n (this.optionsStore.element as HTMLInputElement)?.disabled ||\n this.optionsStore.input?.disabled\n )\n return;\n this.toggle();\n };\n}\n\n/**\n * Whenever a locale is loaded via a plugin then store it here based on the\n * locale name. E.g. loadedLocales['ru']\n */\nconst loadedLocales = {};\n\n// noinspection JSUnusedGlobalSymbols\n/**\n * Called from a locale plugin.\n * @param l locale object for localization options\n */\nconst loadLocale = (l) => {\n if (loadedLocales[l.name]) return;\n loadedLocales[l.name] = l.localization;\n};\n\n/**\n * A sets the global localization options to the provided locale name.\n * `loadLocale` MUST be called first.\n * @param l\n */\nconst locale = (l: string) => {\n const asked = loadedLocales[l];\n if (!asked) return;\n DefaultOptions.localization = asked;\n};\n\n// noinspection JSUnusedGlobalSymbols\n/**\n * Called from a plugin to extend or override picker defaults.\n * @param plugin\n * @param option\n */\nconst extend = function (plugin, option = undefined) {\n if (!plugin) return tempusDominus;\n if (!plugin.installed) {\n // install plugin only once\n plugin(\n option,\n { TempusDominus, Dates, Display, DateTime, Namespace },\n tempusDominus\n );\n plugin.installed = true;\n }\n return tempusDominus;\n};\n\nconst version = '6.4.4';\n\nconst tempusDominus = {\n TempusDominus,\n extend,\n loadLocale,\n locale,\n Namespace,\n DefaultOptions,\n DateTime,\n Unit,\n version,\n DefaultEnLocalization,\n};\n\nexport {\n TempusDominus,\n extend,\n loadLocale,\n locale,\n Namespace,\n DefaultOptions,\n DateTime,\n Unit,\n version,\n DateTimeFormatOptions,\n Options,\n DefaultEnLocalization,\n};\n"],"names":["Unit","DefaultFormatLocalization","ActionTypes","SecondDisplay"],"mappings":";;;;;;;;;;;EAAM,MAAO,OAAQ,SAAQ,KAAK,CAAA;EAEjC,CAAA;QAEY,aAAa,CAAA;EAA1B,IAAA,WAAA,GAAA;UACU,IAAI,CAAA,IAAA,GAAG,KAAK,CAAC;;;EAqKrB;;;EAGG;UACH,IAAsB,CAAA,sBAAA,GAAG,4BAA4B,CAAC;EAEtD;;;EAGG;UACH,IAAkB,CAAA,kBAAA,GAAG,0BAA0B,CAAC;;OAGjD;;EA9KC;;;EAGG;EACH,IAAA,gBAAgB,CAAC,UAAkB,EAAA;EACjC,QAAA,MAAM,KAAK,GAAG,IAAI,OAAO,CACvB,CAAA,EAAG,IAAI,CAAC,IAAI,CAAA,oBAAA,EAAuB,UAAU,CAAA,+BAAA,CAAiC,CAC/E,CAAC;EACF,QAAA,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC;EACf,QAAA,MAAM,KAAK,CAAC;OACb;EAED;;;EAGG;EACH,IAAA,iBAAiB,CAAC,UAAoB,EAAA;EACpC,QAAA,MAAM,KAAK,GAAG,I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CAAS,KAAI;EAC3B,IAAA,MAAM,KAAK,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;EAC/B,IAAA,IAAI,CAAC,KAAK;UAAE,OAAO;EACnB,IAAA,cAAc,CAAC,YAAY,GAAG,KAAK,CAAC;EACtC,EAAE;EAEF;EACA;;;;EAIG;AACH,QAAM,MAAM,GAAG,UAAU,MAAM,EAAE,MAAM,GAAG,SAAS,EAAA;EACjD,IAAA,IAAI,CAAC,MAAM;EAAE,QAAA,OAAO,aAAa,CAAC;EAClC,IAAA,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;;EAErB,QAAA,MAAM,CACJ,MAAM,EACN,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,EACtD,aAAa,CACd,CAAC;EACF,QAAA,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;EACzB,KAAA;EACD,IAAA,OAAO,aAAa,CAAC;EACvB,EAAE;AAEI,QAAA,OAAO,GAAG,QAAQ;EAExB,MAAM,aAAa,GAAG;MACpB,aAAa;MACb,MAAM;MACN,UAAU;MACV,MAAM;MACN,SAAS;MACT,cAAc;MACd,QAAQ;YACRF,YAAI;MACJ,OAAO;MACP,qBAAqB;GACtB;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"tempus-dominus.js","sources":["../../src/js/utilities/errors.ts","../../src/js/utilities/namespace.ts","../../src/js/utilities/default-format-localization.ts","../../src/js/datetime.ts","../../src/js/utilities/service-locator.ts","../../src/js/utilities/calendar-modes.ts","../../src/js/utilities/optionsStore.ts","../../src/js/validation.ts","../../src/js/utilities/event-emitter.ts","../../src/js/utilities/default-options.ts","../../src/js/utilities/typeChecker.ts","../../src/js/utilities/optionProcessor.ts","../../src/js/utilities/optionConverter.ts","../../src/js/dates.ts","../../src/js/utilities/action-types.ts","../../src/js/display/calendar/date-display.ts","../../src/js/display/calendar/month-display.ts","../../src/js/display/calendar/year-display.ts","../../src/js/display/calendar/decade-display.ts","../../src/js/display/time/time-display.ts","../../src/js/display/time/hour-display.ts","../../src/js/display/time/minute-display.ts","../../src/js/display/time/second-display.ts","../../src/js/display/collapse.ts","../../src/js/display/index.ts","../../src/js/actions.ts","../../src/js/tempus-dominus.ts"],"sourcesContent":["export class TdError extends Error {\n code: number;\n}\n\nexport class ErrorMessages {\n private base = 'TD:';\n\n //#region out to console\n\n /**\n * Throws an error indicating that a key in the options object is invalid.\n * @param optionName\n */\n unexpectedOption(optionName: string) {\n const error = new TdError(\n `${this.base} Unexpected option: ${optionName} does not match a known option.`\n );\n error.code = 1;\n throw error;\n }\n\n /**\n * Throws an error indicating that one more keys in the options object is invalid.\n * @param optionName\n */\n unexpectedOptions(optionName: string[]) {\n const error = new TdError(`${this.base}: ${optionName.join(', ')}`);\n error.code = 1;\n throw error;\n }\n\n /**\n * Throws an error when an option is provide an unsupported value.\n * For example a value of 'cheese' for toolbarPlacement which only supports\n * 'top', 'bottom', 'default'.\n * @param optionName\n * @param badValue\n * @param validOptions\n */\n unexpectedOptionValue(\n optionName: string,\n badValue: string,\n validOptions: string[]\n ) {\n const error = new TdError(\n `${\n this.base\n } Unexpected option value: ${optionName} does not accept a value of \"${badValue}\". Valid values are: ${validOptions.join(\n ', '\n )}`\n );\n error.code = 2;\n throw error;\n }\n\n /**\n * Throws an error when an option value is the wrong type.\n * For example a string value was provided to multipleDates which only\n * supports true or false.\n * @param optionName\n * @param badType\n * @param expectedType\n */\n typeMismatch(optionName: string, badType: string, expectedType: string) {\n const error = new TdError(\n `${this.base} Mismatch types: ${optionName} has a type of ${badType} instead of the required ${expectedType}`\n );\n error.code = 3;\n throw error;\n }\n\n /**\n * Throws an error when an option value is outside of the expected range.\n * For example restrictions.daysOfWeekDisabled excepts a value between 0 and 6.\n * @param optionName\n * @param lower\n * @param upper\n */\n numbersOutOfRange(optionName: string, lower: number, upper: number) {\n const error = new TdError(\n `${this.base} ${optionName} expected an array of number between ${lower} and ${upper}.`\n );\n error.code = 4;\n throw error;\n }\n\n /**\n * Throws an error when a value for a date options couldn't be parsed. Either\n * the option was an invalid string or an invalid Date object.\n * @param optionName\n * @param date\n * @param soft If true, logs a warning instead of an error.\n */\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n failedToParseDate(optionName: string, date: any, soft = false) {\n const error = new TdError(\n `${this.base} Could not correctly parse \"${date}\" to a date for ${optionName}.`\n );\n error.code = 5;\n if (!soft) throw error;\n console.warn(error);\n }\n\n /**\n * Throws when an element to attach to was not provided in the constructor.\n */\n mustProvideElement() {\n const error = new TdError(`${this.base} No element was provided.`);\n error.code = 6;\n throw error;\n }\n\n /**\n * Throws if providing an array for the events to subscribe method doesn't have\n * the same number of callbacks. E.g., subscribe([1,2], [1])\n */\n subscribeMismatch() {\n const error = new TdError(\n `${this.base} The subscribed events does not match the number of callbacks`\n );\n error.code = 7;\n throw error;\n }\n\n /**\n * Throws if the configuration has conflicting rules e.g. minDate is after maxDate\n */\n conflictingConfiguration(message?: string) {\n const error = new TdError(\n `${this.base} A configuration value conflicts with another rule. ${message}`\n );\n error.code = 8;\n throw error;\n }\n\n /**\n * customDateFormat errors\n */\n customDateFormatError(message?: string) {\n const error = new TdError(`${this.base} Custom Date Format: ${message}`);\n error.code = 9;\n throw error;\n }\n\n /**\n * Logs a warning if a date option value is provided as a string, instead of\n * a date/datetime object.\n */\n dateString() {\n console.warn(\n `${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`\n );\n }\n\n deprecatedWarning(message: string, remediation?: string) {\n console.warn(\n `${this.base} Warning ${message} is deprecated and will be removed in a future version. ${remediation}`\n );\n }\n\n throwError(message) {\n const error = new TdError(`${this.base} ${message}`);\n error.code = 9;\n throw error;\n }\n\n //#endregion\n\n //#region used with notify.error\n\n /**\n * Used with an Error Event type if the user selects a date that\n * fails restriction validation.\n */\n failedToSetInvalidDate = 'Failed to set invalid date';\n\n /**\n * Used with an Error Event type when a user changes the value of the\n * input field directly, and does not provide a valid date.\n */\n failedToParseInput = 'Failed parse input field';\n\n //#endregion\n}\n","import { ErrorMessages } from './errors';\n// this is not the way I want this to stay but nested classes seemed to blown up once its compiled.\nconst NAME = 'tempus-dominus',\n dataKey = 'td';\n\n/**\n * Events\n */\nclass Events {\n key = `.${dataKey}`;\n\n /**\n * Change event. Fired when the user selects a date.\n * See also EventTypes.ChangeEvent\n */\n change = `change${this.key}`;\n\n /**\n * Emit when the view changes for example from month view to the year view.\n * See also EventTypes.ViewUpdateEvent\n */\n update = `update${this.key}`;\n\n /**\n * Emits when a selected date or value from the input field fails to meet the provided validation rules.\n * See also EventTypes.FailEvent\n */\n error = `error${this.key}`;\n\n /**\n * Show event\n * @event Events#show\n */\n show = `show${this.key}`;\n\n /**\n * Hide event\n * @event Events#hide\n */\n hide = `hide${this.key}`;\n\n // blur and focus are used in the jQuery provider but are otherwise unused.\n // keyup/down will be used later for keybinding options\n\n blur = `blur${this.key}`;\n focus = `focus${this.key}`;\n keyup = `keyup${this.key}`;\n keydown = `keydown${this.key}`;\n}\n\nclass Css {\n /**\n * The outer element for the widget.\n */\n widget = `${NAME}-widget`;\n\n /**\n * Hold the previous, next and switcher divs\n */\n calendarHeader = 'calendar-header';\n\n /**\n * The element for the action to change the calendar view. E.g. month -> year.\n */\n switch = 'picker-switch';\n\n /**\n * The elements for all the toolbar options\n */\n toolbar = 'toolbar';\n\n /**\n * Disables the hover and rounding affect.\n */\n noHighlight = 'no-highlight';\n\n /**\n * Applied to the widget element when the side by side option is in use.\n */\n sideBySide = 'timepicker-sbs';\n\n /**\n * The element for the action to change the calendar view, e.g. August -> July\n */\n previous = 'previous';\n\n /**\n * The element for the action to change the calendar view, e.g. August -> September\n */\n next = 'next';\n\n /**\n * Applied to any action that would violate any restriction options. ALso applied\n * to an input field if the disabled function is called.\n */\n disabled = 'disabled';\n\n /**\n * Applied to any date that is less than requested view,\n * e.g. the last day of the previous month.\n */\n old = 'old';\n\n /**\n * Applied to any date that is greater than of requested view,\n * e.g. the last day of the previous month.\n */\n new = 'new';\n\n /**\n * Applied to any date that is currently selected.\n */\n active = 'active';\n\n //#region date element\n\n /**\n * The outer element for the calendar view.\n */\n dateContainer = 'date-container';\n\n /**\n * The outer element for the decades view.\n */\n decadesContainer = `${this.dateContainer}-decades`;\n\n /**\n * Applied to elements within the decade container, e.g. 2020, 2030\n */\n decade = 'decade';\n\n /**\n * The outer element for the years view.\n */\n yearsContainer = `${this.dateContainer}-years`;\n\n /**\n * Applied to elements within the years container, e.g. 2021, 2021\n */\n year = 'year';\n\n /**\n * The outer element for the month view.\n */\n monthsContainer = `${this.dateContainer}-months`;\n\n /**\n * Applied to elements within the month container, e.g. January, February\n */\n month = 'month';\n\n /**\n * The outer element for the calendar view.\n */\n daysContainer = `${this.dateContainer}-days`;\n\n /**\n * Applied to elements within the day container, e.g. 1, 2..31\n */\n day = 'day';\n\n /**\n * If display.calendarWeeks is enabled, a column displaying the week of year\n * is shown. This class is applied to each cell in that column.\n */\n calendarWeeks = 'cw';\n\n /**\n * Applied to the first row of the calendar view, e.g. Sunday, Monday\n */\n dayOfTheWeek = 'dow';\n\n /**\n * Applied to the current date on the calendar view.\n */\n today = 'today';\n\n /**\n * Applied to the locale's weekend dates on the calendar view, e.g. Sunday, Saturday\n */\n weekend = 'weekend';\n\n rangeIn = 'range-in';\n rangeStart = 'range-start';\n rangeEnd = 'range-end';\n\n //#endregion\n\n //#region time element\n\n /**\n * The outer element for all time related elements.\n */\n timeContainer = 'time-container';\n\n /**\n * Applied the separator columns between time elements, e.g. hour *:* minute *:* second\n */\n separator = 'separator';\n\n /**\n * The outer element for the clock view.\n */\n clockContainer = `${this.timeContainer}-clock`;\n\n /**\n * The outer element for the hours selection view.\n */\n hourContainer = `${this.timeContainer}-hour`;\n\n /**\n * The outer element for the minutes selection view.\n */\n minuteContainer = `${this.timeContainer}-minute`;\n\n /**\n * The outer element for the seconds selection view.\n */\n secondContainer = `${this.timeContainer}-second`;\n\n /**\n * Applied to each element in the hours selection view.\n */\n hour = 'hour';\n\n /**\n * Applied to each element in the minutes selection view.\n */\n minute = 'minute';\n\n /**\n * Applied to each element in the seconds selection view.\n */\n second = 'second';\n\n /**\n * Applied AM/PM toggle button.\n */\n toggleMeridiem = 'toggleMeridiem';\n\n //#endregion\n\n //#region collapse\n\n /**\n * Applied the element of the current view mode, e.g. calendar or clock.\n */\n show = 'show';\n\n /**\n * Applied to the currently showing view mode during a transition\n * between calendar and clock views\n */\n collapsing = 'td-collapsing';\n\n /**\n * Applied to the currently hidden view mode.\n */\n collapse = 'td-collapse';\n\n //#endregion\n\n /**\n * Applied to the widget when the option display.inline is enabled.\n */\n inline = 'inline';\n\n /**\n * Applied to the widget when the option display.theme is light.\n */\n lightTheme = 'light';\n\n /**\n * Applied to the widget when the option display.theme is dark.\n */\n darkTheme = 'dark';\n\n /**\n * Used for detecting if the system color preference is dark mode\n */\n isDarkPreferredQuery = '(prefers-color-scheme: dark)';\n}\n\nexport default class Namespace {\n static NAME = NAME;\n // noinspection JSUnusedGlobalSymbols\n static dataKey = dataKey;\n\n static events = new Events();\n\n static css = new Css();\n\n static errorMessages = new ErrorMessages();\n}\n","import { FormatLocalization } from './options';\n\nconst DefaultFormatLocalization: FormatLocalization = {\n locale: 'default',\n hourCycle: undefined,\n dateFormats: {\n LTS: 'h:mm:ss T',\n LT: 'h:mm T',\n L: 'MM/dd/yyyy',\n LL: 'MMMM d, yyyy',\n LLL: 'MMMM d, yyyy h:mm T',\n LLLL: 'dddd, MMMM d, yyyy h:mm T',\n },\n ordinal: (n) => {\n const s = ['th', 'st', 'nd', 'rd'];\n const v = n % 100;\n return `[${n}${s[(v - 20) % 10] || s[v] || s[0]}]`;\n },\n format: 'L LT',\n};\n\nexport default { ...DefaultFormatLocalization };\n","import { FormatLocalization } from './utilities/options';\nimport Namespace from './utilities/namespace';\nimport DefaultFormatLocalization from './utilities/default-format-localization';\n\ntype parsedTime = {\n year?: number;\n month?: number;\n day?: number;\n hours?: number;\n minutes?: number;\n seconds?: number;\n milliseconds?: number;\n zone?: {\n offset: number;\n };\n};\n\nexport enum Unit {\n seconds = 'seconds',\n minutes = 'minutes',\n hours = 'hours',\n date = 'date',\n month = 'month',\n year = 'year',\n}\n\nconst twoDigitTemplate = {\n month: '2-digit',\n day: '2-digit',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n};\n\nexport interface DateTimeFormatOptions extends Intl.DateTimeFormatOptions {\n timeStyle?: 'short' | 'medium' | 'long';\n dateStyle?: 'short' | 'medium' | 'long' | 'full';\n numberingSystem?: string;\n}\n\n/**\n * Returns an Intl format object based on the provided object\n * @param unit\n */\nexport const getFormatByUnit = (unit: Unit): object => {\n switch (unit) {\n case 'date':\n return { dateStyle: 'short' };\n case 'month':\n return {\n month: 'numeric',\n year: 'numeric',\n };\n case 'year':\n return { year: 'numeric' };\n }\n};\n\n/**\n * Attempts to guess the hour cycle of the given local\n * @param locale\n */\nexport const guessHourCycle = (locale: string): Intl.LocaleHourCycleKey => {\n if (!locale) return 'h12';\n\n // noinspection SpellCheckingInspection\n const template = {\n hour: '2-digit',\n minute: '2-digit',\n numberingSystem: 'latn',\n };\n\n const dt = new DateTime().setLocalization({ locale });\n dt.hours = 0;\n\n const start = dt.parts(undefined, template).hour;\n\n //midnight is 12 so en-US style 12 AM\n if (start === '12') return 'h12';\n //midnight is 24 is from 00-24\n if (start === '24') return 'h24';\n\n dt.hours = 23;\n const end = dt.parts(undefined, template).hour;\n\n //if midnight is 00 and hour 23 is 11 then\n if (start === '00' && end === '11') return 'h11';\n\n if (start === '00' && end === '23') return 'h23';\n\n console.warn(\n `couldn't determine hour cycle for ${locale}. start: ${start}. end: ${end}`\n );\n\n return undefined;\n};\n\n/**\n * For the most part this object behaves exactly the same way\n * as the native Date object with a little extra spice.\n */\nexport class DateTime extends Date {\n localization: FormatLocalization = DefaultFormatLocalization;\n\n /**\n * Chainable way to set the {@link locale}\n * @param value\n * @deprecated use setLocalization with a FormatLocalization object instead\n */\n setLocale(value: string): this {\n if (!this.localization) {\n this.localization = DefaultFormatLocalization;\n this.localization.locale = value;\n }\n return this;\n }\n\n /**\n * Chainable way to set the {@link localization}\n * @param value\n */\n setLocalization(value: FormatLocalization): this {\n this.localization = value;\n return this;\n }\n\n /**\n * Converts a plain JS date object to a DateTime object.\n * Doing this allows access to format, etc.\n * @param date\n * @param locale this parameter is deprecated. Use formatLocalization instead.\n * @param formatLocalization\n */\n static convert(\n date: Date,\n locale = 'default',\n formatLocalization: FormatLocalization = undefined\n ): DateTime {\n if (!date) throw new Error(`A date is required`);\n\n if (!formatLocalization) {\n formatLocalization = DefaultFormatLocalization;\n formatLocalization.locale = locale;\n }\n\n return new DateTime(\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n date.getMilliseconds()\n ).setLocalization(formatLocalization);\n }\n\n /**\n * Native date manipulations are not pure functions. This function creates a duplicate of the DateTime object.\n */\n get clone() {\n return new DateTime(\n this.year,\n this.month,\n this.date,\n this.hours,\n this.minutes,\n this.seconds,\n this.getMilliseconds()\n ).setLocalization(this.localization);\n }\n\n static isValid(d): boolean {\n if (d === undefined || JSON.stringify(d) === 'null') return false;\n if (d.constructor.name === DateTime.name) return true;\n return false;\n }\n\n /**\n * Sets the current date to the start of the {@link unit} provided\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).startOf('month')\n * would return April 1, 2021, 12:00:00.000 AM (midnight)\n * @param unit\n * @param startOfTheWeek Allows for the changing the start of the week.\n */\n startOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n switch (unit) {\n case 'seconds':\n this.setMilliseconds(0);\n break;\n case 'minutes':\n this.setSeconds(0, 0);\n break;\n case 'hours':\n this.setMinutes(0, 0, 0);\n break;\n case 'date':\n this.setHours(0, 0, 0, 0);\n break;\n case 'weekDay': {\n this.startOf(Unit.date);\n if (this.weekDay === startOfTheWeek) break;\n let goBack = this.weekDay;\n if (startOfTheWeek !== 0 && this.weekDay === 0)\n goBack = 8 - startOfTheWeek;\n this.manipulate(startOfTheWeek - goBack, Unit.date);\n break;\n }\n case 'month':\n this.startOf(Unit.date);\n this.setDate(1);\n break;\n case 'year':\n this.startOf(Unit.date);\n this.setMonth(0, 1);\n break;\n }\n return this;\n }\n\n /**\n * Sets the current date to the end of the {@link unit} provided\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).endOf('month')\n * would return April 30, 2021, 11:59:59.999 PM\n * @param unit\n * @param startOfTheWeek\n */\n endOf(unit: Unit | 'weekDay', startOfTheWeek = 0): this {\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n switch (unit) {\n case 'seconds':\n this.setMilliseconds(999);\n break;\n case 'minutes':\n this.setSeconds(59, 999);\n break;\n case 'hours':\n this.setMinutes(59, 59, 999);\n break;\n case 'date':\n this.setHours(23, 59, 59, 999);\n break;\n case 'weekDay': {\n this.endOf(Unit.date);\n const endOfWeek = 6 + startOfTheWeek;\n if (this.weekDay === endOfWeek) break;\n this.manipulate(endOfWeek - this.weekDay, Unit.date);\n break;\n }\n case 'month':\n this.endOf(Unit.date);\n this.manipulate(1, Unit.month);\n this.setDate(0);\n break;\n case 'year':\n this.endOf(Unit.date);\n this.setMonth(11, 31);\n break;\n }\n return this;\n }\n\n /**\n * Change a {@link unit} value. Value can be positive or negative\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).manipulate(1, 'month')\n * would return May 30, 2021, 11:45:32.984 AM\n * @param value A positive or negative number\n * @param unit\n */\n manipulate(value: number, unit: Unit): this {\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n this[unit] += value;\n return this;\n }\n\n /**\n * Return true if {@link compare} is before this date\n * @param compare The Date/DateTime to compare\n * @param unit If provided, uses {@link startOf} for\n * comparison.\n */\n isBefore(compare: DateTime, unit?: Unit): boolean {\n // If the comparisons is undefined, return false\n if (!DateTime.isValid(compare)) return false;\n\n if (!unit) return this.valueOf() < compare.valueOf();\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n return (\n this.clone.startOf(unit).valueOf() < compare.clone.startOf(unit).valueOf()\n );\n }\n\n /**\n * Return true if {@link compare} is after this date\n * @param compare The Date/DateTime to compare\n * @param unit If provided, uses {@link startOf} for\n * comparison.\n */\n isAfter(compare: DateTime, unit?: Unit): boolean {\n // If the comparisons is undefined, return false\n if (!DateTime.isValid(compare)) return false;\n\n if (!unit) return this.valueOf() > compare.valueOf();\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n return (\n this.clone.startOf(unit).valueOf() > compare.clone.startOf(unit).valueOf()\n );\n }\n\n /**\n * Return true if {@link compare} is same this date\n * @param compare The Date/DateTime to compare\n * @param unit If provided, uses {@link startOf} for\n * comparison.\n */\n isSame(compare: DateTime, unit?: Unit): boolean {\n // If the comparisons is undefined, return false\n if (!DateTime.isValid(compare)) return false;\n\n if (!unit) return this.valueOf() === compare.valueOf();\n if (this[unit] === undefined)\n throw new Error(`Unit '${unit}' is not valid`);\n compare = DateTime.convert(compare);\n return (\n this.clone.startOf(unit).valueOf() === compare.startOf(unit).valueOf()\n );\n }\n\n /**\n * Check if this is between two other DateTimes, optionally looking at unit scale. The match is exclusive.\n * @param left\n * @param right\n * @param unit.\n * @param inclusivity. A [ indicates inclusion of a value. A ( indicates exclusion.\n * If the inclusivity parameter is used, both indicators must be passed.\n */\n isBetween(\n left: DateTime,\n right: DateTime,\n unit?: Unit,\n inclusivity: '()' | '[]' | '(]' | '[)' = '()'\n ): boolean {\n // If one of the comparisons is undefined, return false\n if (!DateTime.isValid(left) || !DateTime.isValid(right)) return false;\n // If a unit is provided and is not a valid property of the DateTime object, throw an error\n if (unit && this[unit] === undefined) {\n throw new Error(`Unit '${unit}' is not valid`);\n }\n\n const leftInclusivity = inclusivity[0] === '(';\n const rightInclusivity = inclusivity[1] === ')';\n\n const isLeftInRange = leftInclusivity\n ? this.isAfter(left, unit)\n : !this.isBefore(left, unit);\n const isRightInRange = rightInclusivity\n ? this.isBefore(right, unit)\n : !this.isAfter(right, unit);\n\n return isLeftInRange && isRightInRange;\n }\n\n /**\n * Returns flattened object of the date. Does not include literals\n * @param locale\n * @param template\n */\n parts(\n locale = this.localization.locale,\n template: Record = { dateStyle: 'full', timeStyle: 'long' }\n ): Record {\n const parts = {};\n new Intl.DateTimeFormat(locale, template)\n .formatToParts(this)\n .filter((x) => x.type !== 'literal')\n .forEach((x) => (parts[x.type] = x.value));\n return parts;\n }\n\n /**\n * Shortcut to Date.getSeconds()\n */\n get seconds(): number {\n return this.getSeconds();\n }\n\n /**\n * Shortcut to Date.setSeconds()\n */\n set seconds(value: number) {\n this.setSeconds(value);\n }\n\n /**\n * Returns two digit hours\n */\n get secondsFormatted(): string {\n return this.parts(undefined, twoDigitTemplate).second;\n }\n\n /**\n * Shortcut to Date.getMinutes()\n */\n get minutes(): number {\n return this.getMinutes();\n }\n\n /**\n * Shortcut to Date.setMinutes()\n */\n set minutes(value: number) {\n this.setMinutes(value);\n }\n\n /**\n * Returns two digit minutes\n */\n get minutesFormatted(): string {\n return this.parts(undefined, twoDigitTemplate).minute;\n }\n\n /**\n * Shortcut to Date.getHours()\n */\n get hours(): number {\n return this.getHours();\n }\n\n /**\n * Shortcut to Date.setHours()\n */\n set hours(value: number) {\n this.setHours(value);\n }\n\n /**\n * Returns two digit hour, e.g. 01...10\n * @param hourCycle Providing an hour cycle will change 00 to 24 depending on the given value.\n */\n getHoursFormatted(hourCycle: Intl.LocaleHourCycleKey = 'h12') {\n return this.parts(undefined, { ...twoDigitTemplate, hourCycle: hourCycle })\n .hour;\n }\n\n /**\n * Get the meridiem of the date. E.g. AM or PM.\n * If the {@link locale} provides a \"dayPeriod\" then this will be returned,\n * otherwise it will return AM or PM.\n * @param locale\n */\n meridiem(locale: string = this.localization.locale): string {\n return new Intl.DateTimeFormat(locale, {\n hour: 'numeric',\n hour12: true,\n })\n .formatToParts(this)\n .find((p) => p.type === 'dayPeriod')?.value;\n }\n\n /**\n * Shortcut to Date.getDate()\n */\n get date(): number {\n return this.getDate();\n }\n\n /**\n * Shortcut to Date.setDate()\n */\n set date(value: number) {\n this.setDate(value);\n }\n\n /**\n * Return two digit date\n */\n get dateFormatted(): string {\n return this.parts(undefined, twoDigitTemplate).day;\n }\n\n /**\n * Shortcut to Date.getDay()\n */\n get weekDay(): number {\n return this.getDay();\n }\n\n /**\n * Shortcut to Date.getMonth()\n */\n get month(): number {\n return this.getMonth();\n }\n\n /**\n * Shortcut to Date.setMonth()\n */\n set month(value: number) {\n const targetMonth = new Date(this.year, value + 1);\n targetMonth.setDate(0);\n const endOfMonth = targetMonth.getDate();\n if (this.date > endOfMonth) {\n this.date = endOfMonth;\n }\n this.setMonth(value);\n }\n\n /**\n * Return two digit, human expected month. E.g. January = 1, December = 12\n */\n get monthFormatted(): string {\n return this.parts(undefined, twoDigitTemplate).month;\n }\n\n /**\n * Shortcut to Date.getFullYear()\n */\n get year(): number {\n return this.getFullYear();\n }\n\n /**\n * Shortcut to Date.setFullYear()\n */\n set year(value: number) {\n this.setFullYear(value);\n }\n\n // borrowed a bunch of stuff from Luxon\n /**\n * Gets the week of the year\n */\n get week(): number {\n const ordinal = this.computeOrdinal(),\n weekday = this.getUTCDay();\n\n let weekNumber = Math.floor((ordinal - weekday + 10) / 7);\n\n if (weekNumber < 1) {\n weekNumber = this.weeksInWeekYear();\n } else if (weekNumber > this.weeksInWeekYear()) {\n weekNumber = 1;\n }\n\n return weekNumber;\n }\n\n /**\n * Returns the number of weeks in the year\n */\n weeksInWeekYear() {\n const p1 =\n (this.year +\n Math.floor(this.year / 4) -\n Math.floor(this.year / 100) +\n Math.floor(this.year / 400)) %\n 7,\n last = this.year - 1,\n p2 =\n (last +\n Math.floor(last / 4) -\n Math.floor(last / 100) +\n Math.floor(last / 400)) %\n 7;\n return p1 === 4 || p2 === 3 ? 53 : 52;\n }\n\n /**\n * Returns true or false depending on if the year is a leap year or not.\n */\n get isLeapYear() {\n return (\n this.year % 4 === 0 && (this.year % 100 !== 0 || this.year % 400 === 0)\n );\n }\n\n private computeOrdinal() {\n return (\n this.date +\n (this.isLeapYear ? this.leapLadder : this.nonLeapLadder)[this.month]\n );\n }\n\n private nonLeapLadder = [\n 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334,\n ];\n private leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\n //#region CDF stuff\n\n private dateTimeRegex =\n //is regex cannot be simplified beyond what it already is\n /(\\[[^[\\]]*])|y{1,4}|M{1,4}|d{1,4}|H{1,2}|h{1,2}|t|T|m{1,2}|s{1,2}|f{3}/g; //NOSONAR\n\n private formattingTokens =\n /(\\[[^[\\]]*])|([-_:/.,()\\s]+)|(T|t|yyyy|yy?|MM?M?M?|Do|dd?|hh?|HH?|mm?|ss?)/g; //NOSONAR is regex cannot be simplified beyond what it already is\n\n /**\n * Returns a list of month values based on the current locale\n */\n private getAllMonths(\n format: '2-digit' | 'numeric' | 'long' | 'short' | 'narrow' = 'long'\n ) {\n const applyFormat = new Intl.DateTimeFormat(this.localization.locale, {\n month: format,\n }).format;\n return [...Array(12).keys()].map((m) => applyFormat(new Date(2021, m)));\n }\n\n /**\n * Replaces an expanded token set (e.g. LT/LTS)\n */\n private replaceTokens(formatStr, formats) {\n /***\n * _ => match\n * a => first capture group. Anything between [ and ]\n * b => second capture group\n */\n return formatStr.replace(\n /(\\[[^[\\]]*])|(LTS?|l{1,4}|L{1,4})/g,\n (_, a, b) => {\n const B = b && b.toUpperCase();\n return a || formats[B] || DefaultFormatLocalization.dateFormats[B];\n }\n );\n }\n\n private match2 = /\\d\\d/; // 00 - 99\n private match3 = /\\d{3}/; // 000 - 999\n private match4 = /\\d{4}/; // 0000 - 9999\n private match1to2 = /\\d\\d?/; // 0 - 99\n private matchSigned = /[+-]?\\d+/; // -inf - inf\n private matchOffset = /[+-]\\d\\d:?(\\d\\d)?|Z/; // +00:00 -00:00 +0000 or -0000 +00 or Z\n private matchWord = /[^\\d_:/,\\-()\\s]+/; // Word\n\n private parseTwoDigitYear(input) {\n input = +input;\n return input + (input > 68 ? 1900 : 2000);\n }\n\n private offsetFromString(string) {\n if (!string) return 0;\n if (string === 'Z') return 0;\n const [first, second, third] = string.match(/([+-]|\\d\\d)/g);\n const minutes = +(second * 60) + (+third || 0);\n const signed = first === '+' ? -minutes : minutes;\n return minutes === 0 ? 0 : signed; // eslint-disable-line no-nested-ternary\n }\n\n /**\n * z = -4, zz = -04, zzz = -0400\n * @param date\n * @param style\n * @private\n */\n private zoneInformation(date: DateTime, style: 'z' | 'zz' | 'zzz') {\n let name = date\n .parts(this.localization.locale, { timeZoneName: 'longOffset' })\n .timeZoneName.replace('GMT', '')\n .replace(':', '');\n\n const negative = name.includes('-');\n\n name = name.replace('-', '');\n\n if (style === 'z') name = name.substring(1, 2);\n else if (style === 'zz') name = name.substring(0, 2);\n\n return `${negative ? '-' : ''}${name}`;\n }\n\n private zoneExpressions = [\n this.matchOffset,\n (obj, input) => {\n obj.offset = this.offsetFromString(input);\n },\n ];\n\n private addInput(property) {\n return (time, input) => {\n time[property] = +input;\n };\n }\n\n private meridiemMatch(input) {\n const meridiem = new Intl.DateTimeFormat(this.localization.locale, {\n hour: 'numeric',\n hour12: true,\n })\n .formatToParts(new Date(2022, 3, 4, 13))\n .find((p) => p.type === 'dayPeriod')?.value;\n\n return input.toLowerCase() === meridiem.toLowerCase();\n }\n\n private expressions = {\n t: [\n this.matchWord,\n (ojb, input) => {\n ojb.afternoon = this.meridiemMatch(input);\n },\n ],\n T: [\n this.matchWord,\n (ojb, input) => {\n ojb.afternoon = this.meridiemMatch(input);\n },\n ],\n fff: [\n this.match3,\n (ojb, input) => {\n ojb.milliseconds = +input;\n },\n ],\n s: [this.match1to2, this.addInput('seconds')],\n ss: [this.match1to2, this.addInput('seconds')],\n m: [this.match1to2, this.addInput('minutes')],\n mm: [this.match1to2, this.addInput('minutes')],\n H: [this.match1to2, this.addInput('hours')],\n h: [this.match1to2, this.addInput('hours')],\n HH: [this.match1to2, this.addInput('hours')],\n hh: [this.match1to2, this.addInput('hours')],\n d: [this.match1to2, this.addInput('day')],\n dd: [this.match2, this.addInput('day')],\n Do: [\n this.matchWord,\n (ojb, input) => {\n [ojb.day] = input.match(/\\d+/);\n if (!this.localization.ordinal) return;\n for (let i = 1; i <= 31; i += 1) {\n if (this.localization.ordinal(i).replace(/[[\\]]/g, '') === input) {\n ojb.day = i;\n }\n }\n },\n ],\n M: [this.match1to2, this.addInput('month')],\n MM: [this.match2, this.addInput('month')],\n MMM: [\n this.matchWord,\n (obj, input) => {\n const months = this.getAllMonths();\n const monthsShort = this.getAllMonths('short');\n const matchIndex =\n (monthsShort || months.map((_) => _.slice(0, 3))).indexOf(input) + 1;\n if (matchIndex < 1) {\n throw new Error();\n }\n obj.month = matchIndex % 12 || matchIndex;\n },\n ],\n MMMM: [\n this.matchWord,\n (obj, input) => {\n const months = this.getAllMonths();\n const matchIndex = months.indexOf(input) + 1;\n if (matchIndex < 1) {\n throw new Error();\n }\n obj.month = matchIndex % 12 || matchIndex;\n },\n ],\n y: [this.matchSigned, this.addInput('year')],\n yy: [\n this.match2,\n (obj, input) => {\n obj.year = this.parseTwoDigitYear(input);\n },\n ],\n yyyy: [this.match4, this.addInput('year')],\n // z: this.zoneExpressions,\n // zz: this.zoneExpressions,\n // zzz: this.zoneExpressions\n };\n\n private correctHours(time) {\n const { afternoon } = time;\n if (afternoon !== undefined) {\n const { hours } = time;\n if (afternoon) {\n if (hours < 12) {\n time.hours += 12;\n }\n } else if (hours === 12) {\n time.hours = 0;\n }\n delete time.afternoon;\n }\n }\n\n private makeParser(format) {\n format = this.replaceTokens(format, this.localization.dateFormats);\n const array = format.match(this.formattingTokens);\n const { length } = array;\n for (let i = 0; i < length; i += 1) {\n const token = array[i];\n const parseTo = this.expressions[token];\n const regex = parseTo && parseTo[0];\n const parser = parseTo && parseTo[1];\n if (parser) {\n array[i] = { regex, parser };\n } else {\n array[i] = token.replace(/^\\[[^[\\]]*]$/g, '');\n }\n }\n\n return (input): parsedTime => {\n const time = {\n hours: 0,\n minutes: 0,\n seconds: 0,\n milliseconds: 0,\n };\n for (let i = 0, start = 0; i < length; i += 1) {\n const token = array[i];\n if (typeof token === 'string') {\n start += token.length;\n } else {\n const { regex, parser } = token;\n const part = input.slice(start);\n const match = regex.exec(part);\n const value = match[0];\n parser.call(this, time, value);\n input = input.replace(value, '');\n }\n }\n this.correctHours(time);\n return time;\n };\n }\n\n /**\n * Attempts to create a DateTime from a string.\n * @param input date as string\n * @param localization provides the date template the string is in via the format property\n */\n //eslint-disable-next-line @typescript-eslint/no-unused-vars\n static fromString(input: string, localization: FormatLocalization): DateTime {\n if (!localization?.format) {\n Namespace.errorMessages.customDateFormatError('No format was provided');\n }\n try {\n const dt = new DateTime();\n dt.setLocalization(localization);\n if (['x', 'X'].indexOf(localization.format) > -1)\n return new DateTime((localization.format === 'X' ? 1000 : 1) * +input);\n\n const parser = dt.makeParser(localization.format);\n const { year, month, day, hours, minutes, seconds, milliseconds, zone } =\n parser(input);\n const d = day || (!year && !month ? dt.getDate() : 1);\n const y = year || dt.getFullYear();\n let M = 0;\n if (!(year && !month)) {\n M = month > 0 ? month - 1 : dt.getMonth();\n }\n if (zone) {\n return new DateTime(\n Date.UTC(\n y,\n M,\n d,\n hours,\n minutes,\n seconds,\n milliseconds + zone.offset * 60 * 1000\n )\n );\n }\n return new DateTime(y, M, d, hours, minutes, seconds, milliseconds);\n } catch (e) {\n Namespace.errorMessages.customDateFormatError(\n `Unable to parse provided input: ${input}, format: ${localization.format}`\n );\n }\n }\n\n /**\n * Returns a string format.\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat\n * for valid templates and locale objects\n * @param template An optional object. If provided, method will use Intl., otherwise the localizations format properties\n * @param locale Can be a string or an array of strings. Uses browser defaults otherwise.\n */\n format(\n template?: DateTimeFormatOptions | string,\n locale = this.localization.locale\n ): string {\n if (template && typeof template === 'object')\n return new Intl.DateTimeFormat(locale, template).format(this);\n\n const formatString = this.replaceTokens(\n //try template first\n template ||\n //otherwise try localization format\n this.localization.format ||\n //otherwise try date + time\n `${DefaultFormatLocalization.dateFormats.L}, ${DefaultFormatLocalization.dateFormats.LT}`,\n this.localization.dateFormats\n );\n\n const formatter = (template) =>\n new Intl.DateTimeFormat(this.localization.locale, template).format(this);\n\n if (!this.localization.hourCycle)\n this.localization.hourCycle = guessHourCycle(this.localization.locale);\n\n //if the format asks for a twenty-four-hour string but the hour cycle is not, then make a base guess\n const HHCycle = this.localization.hourCycle.startsWith('h1')\n ? 'h24'\n : this.localization.hourCycle;\n const hhCycle = this.localization.hourCycle.startsWith('h2')\n ? 'h12'\n : this.localization.hourCycle;\n\n const matches = {\n yy: formatter({ year: '2-digit' }),\n yyyy: this.year,\n M: formatter({ month: 'numeric' }),\n MM: this.monthFormatted,\n MMM: this.getAllMonths('short')[this.getMonth()],\n MMMM: this.getAllMonths()[this.getMonth()],\n d: this.date,\n dd: this.dateFormatted,\n ddd: formatter({ weekday: 'short' }),\n dddd: formatter({ weekday: 'long' }),\n H: this.getHours(),\n HH: this.getHoursFormatted(HHCycle),\n h: this.hours > 12 ? this.hours - 12 : this.hours,\n hh: this.getHoursFormatted(hhCycle),\n t: this.meridiem(),\n T: this.meridiem().toUpperCase(),\n m: this.minutes,\n mm: this.minutesFormatted,\n s: this.seconds,\n ss: this.secondsFormatted,\n fff: this.getMilliseconds(),\n // z: this.zoneInformation(dateTime, 'z'), //-4\n // zz: this.zoneInformation(dateTime, 'zz'), //-04\n // zzz: this.zoneInformation(dateTime, 'zzz') //-0400\n };\n\n return formatString\n .replace(this.dateTimeRegex, (match, $1) => {\n return $1 || matches[match];\n })\n .replace(/\\[/g, '')\n .replace(/]/g, '');\n }\n\n //#endregion CDF stuff\n}\n","//eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport declare type Constructable = new (...args: any[]) => T;\n\nclass ServiceLocator {\n private cache: Map, unknown | symbol> = new Map();\n\n locate(identifier: Constructable): T {\n const service = this.cache.get(identifier);\n if (service) return service as T;\n const value = new identifier();\n this.cache.set(identifier, value);\n return value;\n }\n}\nexport const setupServiceLocator = () => {\n serviceLocator = new ServiceLocator();\n};\n\nexport let serviceLocator: ServiceLocator;\n","import { Unit } from '../datetime';\nimport Namespace from './namespace';\nimport ViewMode from './view-mode';\n\nconst CalendarModes: {\n name: keyof ViewMode;\n className: string;\n unit: Unit;\n step: number;\n}[] = [\n {\n name: 'calendar',\n className: Namespace.css.daysContainer,\n unit: Unit.month,\n step: 1,\n },\n {\n name: 'months',\n className: Namespace.css.monthsContainer,\n unit: Unit.year,\n step: 1,\n },\n {\n name: 'years',\n className: Namespace.css.yearsContainer,\n unit: Unit.year,\n step: 10,\n },\n {\n name: 'decades',\n className: Namespace.css.decadesContainer,\n unit: Unit.year,\n step: 100,\n },\n];\n\nexport default CalendarModes;\n","import { DateTime } from '../datetime';\nimport CalendarModes from './calendar-modes';\nimport ViewMode from './view-mode';\nimport Options from './options';\n\nexport class OptionsStore {\n options: Options;\n element: HTMLElement;\n input: HTMLInputElement;\n unset: boolean;\n private _currentCalendarViewMode = 0;\n\n get currentCalendarViewMode() {\n return this._currentCalendarViewMode;\n }\n\n set currentCalendarViewMode(value) {\n this._currentCalendarViewMode = value;\n this.currentView = CalendarModes[value].name;\n }\n\n _viewDate = new DateTime();\n\n get viewDate() {\n return this._viewDate;\n }\n\n set viewDate(v) {\n this._viewDate = v;\n if (this.options) this.options.viewDate = v;\n }\n\n /**\n * When switching back to the calendar from the clock,\n * this sets currentView to the correct calendar view.\n */\n refreshCurrentView() {\n this.currentView = CalendarModes[this.currentCalendarViewMode].name;\n }\n\n minimumCalendarViewMode = 0;\n currentView: keyof ViewMode = 'calendar';\n\n get isTwelveHour() {\n return ['h12', 'h11'].includes(this.options.localization.hourCycle);\n }\n}\n","import { DateTime, Unit } from './datetime';\nimport { serviceLocator } from './utilities/service-locator';\nimport { OptionsStore } from './utilities/optionsStore';\n\n/**\n * Main class for date validation rules based on the options provided.\n */\nexport default class Validation {\n private optionsStore: OptionsStore;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n }\n\n /**\n * Checks to see if the target date is valid based on the rules provided in the options.\n * Granularity can be provided to check portions of the date instead of the whole.\n * @param targetDate\n * @param granularity\n */\n isValid(targetDate: DateTime, granularity?: Unit): boolean {\n if (!this._enabledDisabledDatesIsValid(granularity, targetDate))\n return false;\n\n if (\n granularity !== Unit.month &&\n granularity !== Unit.year &&\n this.optionsStore.options.restrictions.daysOfWeekDisabled?.length > 0 &&\n this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(\n targetDate.weekDay\n ) !== -1\n )\n return false;\n\n if (!this._minMaxIsValid(granularity, targetDate)) return false;\n\n if (\n granularity === Unit.hours ||\n granularity === Unit.minutes ||\n granularity === Unit.seconds\n ) {\n if (!this._enabledDisabledHoursIsValid(targetDate)) return false;\n\n if (\n this.optionsStore.options.restrictions.disabledTimeIntervals?.filter(\n (internal) => targetDate.isBetween(internal.from, internal.to)\n ).length !== 0\n )\n return false;\n }\n\n return true;\n }\n\n private _enabledDisabledDatesIsValid(\n granularity: Unit,\n targetDate: DateTime\n ): boolean {\n if (granularity !== Unit.date) return true;\n\n if (\n this.optionsStore.options.restrictions.disabledDates.length > 0 &&\n this._isInDisabledDates(targetDate)\n ) {\n return false;\n }\n\n // noinspection RedundantIfStatementJS\n if (\n this.optionsStore.options.restrictions.enabledDates.length > 0 &&\n !this._isInEnabledDates(targetDate)\n ) {\n return false;\n }\n\n return true;\n }\n\n /**\n * Checks to see if the disabledDates option is in use and returns true (meaning invalid)\n * if the `testDate` is with in the array. Granularity is by date.\n * @param testDate\n * @private\n */\n private _isInDisabledDates(testDate: DateTime) {\n if (\n !this.optionsStore.options.restrictions.disabledDates ||\n this.optionsStore.options.restrictions.disabledDates.length === 0\n )\n return false;\n\n return !!this.optionsStore.options.restrictions.disabledDates.find((x) =>\n x.isSame(testDate, Unit.date)\n );\n }\n\n /**\n * Checks to see if the enabledDates option is in use and returns true (meaning valid)\n * if the `testDate` is with in the array. Granularity is by date.\n * @param testDate\n * @private\n */\n private _isInEnabledDates(testDate: DateTime) {\n if (\n !this.optionsStore.options.restrictions.enabledDates ||\n this.optionsStore.options.restrictions.enabledDates.length === 0\n )\n return true;\n\n return !!this.optionsStore.options.restrictions.enabledDates.find((x) =>\n x.isSame(testDate, Unit.date)\n );\n }\n\n private _minMaxIsValid(granularity: Unit, targetDate: DateTime) {\n if (\n this.optionsStore.options.restrictions.minDate &&\n targetDate.isBefore(\n this.optionsStore.options.restrictions.minDate,\n granularity\n )\n ) {\n return false;\n }\n\n // noinspection RedundantIfStatementJS\n if (\n this.optionsStore.options.restrictions.maxDate &&\n targetDate.isAfter(\n this.optionsStore.options.restrictions.maxDate,\n granularity\n )\n ) {\n return false;\n }\n\n return true;\n }\n\n private _enabledDisabledHoursIsValid(targetDate) {\n if (\n this.optionsStore.options.restrictions.disabledHours.length > 0 &&\n this._isInDisabledHours(targetDate)\n ) {\n return false;\n }\n\n // noinspection RedundantIfStatementJS\n if (\n this.optionsStore.options.restrictions.enabledHours.length > 0 &&\n !this._isInEnabledHours(targetDate)\n ) {\n return false;\n }\n\n return true;\n }\n\n /**\n * Checks to see if the disabledHours option is in use and returns true (meaning invalid)\n * if the `testDate` is with in the array. Granularity is by hours.\n * @param testDate\n * @private\n */\n private _isInDisabledHours(testDate: DateTime) {\n if (\n !this.optionsStore.options.restrictions.disabledHours ||\n this.optionsStore.options.restrictions.disabledHours.length === 0\n )\n return false;\n\n const formattedDate = testDate.hours;\n return this.optionsStore.options.restrictions.disabledHours.includes(\n formattedDate\n );\n }\n\n /**\n * Checks to see if the enabledHours option is in use and returns true (meaning valid)\n * if the `testDate` is with in the array. Granularity is by hours.\n * @param testDate\n * @private\n */\n private _isInEnabledHours(testDate: DateTime) {\n if (\n !this.optionsStore.options.restrictions.enabledHours ||\n this.optionsStore.options.restrictions.enabledHours.length === 0\n )\n return true;\n\n const formattedDate = testDate.hours;\n return this.optionsStore.options.restrictions.enabledHours.includes(\n formattedDate\n );\n }\n\n dateRangeIsValid(dates: DateTime[], index: number, target: DateTime) {\n // if we're not using the option, then return valid\n if (!this.optionsStore.options.dateRange) return true;\n\n // if we've only selected 0..1 dates, and we're not setting the end date\n // then return valid. We only want to validate the range if both are selected,\n // because the other validation on the target has already occurred.\n if (dates.length !== 2 && index !== 1) return true;\n\n // initialize start date\n const start = dates[0].clone;\n // check if start date is not the same as target date\n if (start.isSame(target, Unit.date)) return true;\n\n // add one day to start; start has already been validated\n start.manipulate(1, Unit.date);\n\n // check each date in the range to make sure it's valid\n while (!start.isSame(target, Unit.date)) {\n const valid = this.isValid(start, Unit.date);\n if (!valid) return false;\n start.manipulate(1, Unit.date);\n }\n\n return true;\n }\n}\n","import { DateTime, Unit } from '../datetime';\nimport ActionTypes from './action-types';\nimport { BaseEvent } from './event-types';\n\nexport type ViewUpdateValues = Unit | 'clock' | 'calendar' | 'all';\n\nclass EventEmitter {\n private subscribers: ((value?: T) => void)[] = [];\n\n subscribe(callback: (value: T) => void) {\n this.subscribers.push(callback);\n return this.unsubscribe.bind(this, this.subscribers.length - 1);\n }\n\n unsubscribe(index: number) {\n this.subscribers.splice(index, 1);\n }\n\n emit(value?: T) {\n this.subscribers.forEach((callback) => {\n callback(value);\n });\n }\n\n destroy() {\n this.subscribers = null;\n this.subscribers = [];\n }\n}\n\nexport class EventEmitters {\n triggerEvent = new EventEmitter();\n viewUpdate = new EventEmitter();\n updateDisplay = new EventEmitter();\n action = new EventEmitter<{ e: any; action?: ActionTypes }>(); //eslint-disable-line @typescript-eslint/no-explicit-any\n updateViewDate = new EventEmitter();\n\n destroy() {\n this.triggerEvent.destroy();\n this.viewUpdate.destroy();\n this.updateDisplay.destroy();\n this.action.destroy();\n this.updateViewDate.destroy();\n }\n}\n","import Options, { Localization } from './options';\nimport { DateTime } from '../datetime';\nimport DefaultFormatLocalization from './default-format-localization';\n\nconst defaultEnLocalization: Localization = {\n clear: 'Clear selection',\n close: 'Close the picker',\n dateFormats: DefaultFormatLocalization.dateFormats,\n dayViewHeaderFormat: { month: 'long', year: '2-digit' },\n decrementHour: 'Decrement Hour',\n decrementMinute: 'Decrement Minute',\n decrementSecond: 'Decrement Second',\n format: DefaultFormatLocalization.format,\n hourCycle: DefaultFormatLocalization.hourCycle,\n incrementHour: 'Increment Hour',\n incrementMinute: 'Increment Minute',\n incrementSecond: 'Increment Second',\n locale: DefaultFormatLocalization.locale,\n nextCentury: 'Next Century',\n nextDecade: 'Next Decade',\n nextMonth: 'Next Month',\n nextYear: 'Next Year',\n ordinal: DefaultFormatLocalization.ordinal,\n pickHour: 'Pick Hour',\n pickMinute: 'Pick Minute',\n pickSecond: 'Pick Second',\n previousCentury: 'Previous Century',\n previousDecade: 'Previous Decade',\n previousMonth: 'Previous Month',\n previousYear: 'Previous Year',\n selectDate: 'Select Date',\n selectDecade: 'Select Decade',\n selectMonth: 'Select Month',\n selectTime: 'Select Time',\n selectYear: 'Select Year',\n startOfTheWeek: 0,\n today: 'Go to today',\n toggleMeridiem: 'Toggle Meridiem',\n};\n\nconst DefaultOptions: Options = {\n allowInputToggle: false,\n container: undefined,\n dateRange: false,\n debug: false,\n defaultDate: undefined,\n display: {\n icons: {\n type: 'icons',\n time: 'fa-solid fa-clock',\n date: 'fa-solid fa-calendar',\n up: 'fa-solid fa-arrow-up',\n down: 'fa-solid fa-arrow-down',\n previous: 'fa-solid fa-chevron-left',\n next: 'fa-solid fa-chevron-right',\n today: 'fa-solid fa-calendar-check',\n clear: 'fa-solid fa-trash',\n close: 'fa-solid fa-xmark',\n },\n sideBySide: false,\n calendarWeeks: false,\n viewMode: 'calendar',\n toolbarPlacement: 'bottom',\n keepOpen: false,\n buttons: {\n today: false,\n clear: false,\n close: false,\n },\n components: {\n calendar: true,\n date: true,\n month: true,\n year: true,\n decades: true,\n clock: true,\n hours: true,\n minutes: true,\n seconds: false,\n useTwentyfourHour: undefined,\n },\n inline: false,\n theme: 'auto',\n placement: 'bottom',\n },\n keepInvalid: false,\n localization: defaultEnLocalization,\n meta: {},\n multipleDates: false,\n multipleDatesSeparator: '; ',\n promptTimeOnDateChange: false,\n promptTimeOnDateChangeTransitionDelay: 200,\n restrictions: {\n minDate: undefined,\n maxDate: undefined,\n disabledDates: [],\n enabledDates: [],\n daysOfWeekDisabled: [],\n disabledTimeIntervals: [],\n disabledHours: [],\n enabledHours: [],\n },\n stepping: 1,\n useCurrent: true,\n viewDate: new DateTime(),\n};\n\nexport default DefaultOptions;\nexport const DefaultEnLocalization = { ...defaultEnLocalization };\n","import Namespace from './namespace';\nimport { DateTime } from '../datetime';\nimport { FormatLocalization } from './options';\nimport DefaultFormatLocalization from './default-format-localization';\n\n/**\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\n * @param d If a string will attempt creating a date from it.\n * @param localization object containing locale and format settings. Only used with the custom formats\n * @private\n */\nexport function tryConvertToDateTime(\n this: void,\n d: DateTime | Date | '',\n localization: FormatLocalization\n): DateTime | null {\n if (!d) return null;\n if (d.constructor.name === DateTime.name) return d as DateTime;\n if (d.constructor.name === Date.name) {\n return DateTime.convert(d as Date);\n }\n if (typeof d === typeof '') {\n const dateTime = DateTime.fromString(d as unknown as string, localization);\n if (JSON.stringify(dateTime) === 'null') {\n return null;\n }\n return dateTime;\n }\n return null;\n}\n\n/**\n * Attempts to convert `d` to a DateTime object\n * @param d value to convert\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param localization object containing locale and format settings. Only used with the custom formats\n */\nexport function convertToDateTime(\n this: void,\n d: DateTime | Date | '',\n optionName: string,\n localization: FormatLocalization\n): DateTime {\n if (typeof d === typeof '' && optionName !== 'input') {\n Namespace.errorMessages.dateString();\n }\n\n const converted = tryConvertToDateTime(d, localization);\n\n if (!converted) {\n Namespace.errorMessages.failedToParseDate(\n optionName,\n d,\n optionName === 'input'\n );\n }\n return converted;\n}\n\n/**\n * Type checks that `value` is an array of Date or DateTime\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param value Option value\n * @param providedType Used to provide text to error messages\n * @param localization\n */\nexport function typeCheckDateArray(\n this: void,\n optionName: string,\n value: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n providedType: string,\n localization: FormatLocalization\n) {\n if (!Array.isArray(value)) {\n Namespace.errorMessages.typeMismatch(\n optionName,\n providedType,\n 'array of DateTime or Date'\n );\n }\n for (let i = 0; i < value.length; i++) {\n const d = value[i];\n const dateTime = convertToDateTime(d, optionName, localization);\n if (!dateTime) {\n Namespace.errorMessages.typeMismatch(\n optionName,\n typeof d,\n 'DateTime or Date'\n );\n }\n dateTime.setLocalization(localization ?? DefaultFormatLocalization);\n value[i] = dateTime;\n }\n}\n\n/**\n * Type checks that `value` is an array of numbers\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param value Option value\n * @param providedType Used to provide text to error messages\n */\nexport function typeCheckNumberArray(\n this: void,\n optionName: string,\n value: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n providedType: string\n) {\n if (!Array.isArray(value) || value.some((x) => typeof x !== typeof 0)) {\n Namespace.errorMessages.typeMismatch(\n optionName,\n providedType,\n 'array of numbers'\n );\n }\n}\n","import Namespace from './namespace';\nimport type { FormatLocalization } from './options';\nimport {\n convertToDateTime,\n typeCheckNumberArray,\n typeCheckDateArray,\n} from './typeChecker';\n\ninterface OptionProcessorFunctionArguments {\n key: string;\n value: any; //eslint-disable-line @typescript-eslint/no-explicit-any\n providedType: string;\n defaultType: string;\n path: string;\n localization: FormatLocalization;\n}\n\ntype OptionProcessorFunction = (\n this: void,\n args: OptionProcessorFunctionArguments\n) => any; //eslint-disable-line @typescript-eslint/no-explicit-any\n\nfunction mandatoryDate(key: string): OptionProcessorFunction {\n return ({ value, providedType, localization }) => {\n const dateTime = convertToDateTime(value, key, localization);\n if (dateTime !== undefined) {\n dateTime.setLocalization(localization);\n return dateTime;\n }\n Namespace.errorMessages.typeMismatch(key, providedType, 'DateTime or Date');\n };\n}\n\nfunction optionalDate(key: string): OptionProcessorFunction {\n const mandatory = mandatoryDate(key);\n return (args) => {\n if (args.value === undefined) {\n return args.value;\n }\n return mandatory(args);\n };\n}\n\nfunction numbersInRange(\n key: string,\n lower: number,\n upper: number\n): OptionProcessorFunction {\n return ({ value, providedType }) => {\n if (value === undefined) {\n return [];\n }\n typeCheckNumberArray(key, value, providedType);\n if ((value as number[]).some((x) => x < lower || x > upper))\n Namespace.errorMessages.numbersOutOfRange(key, lower, upper);\n return value;\n };\n}\n\nfunction validHourRange(key: string): OptionProcessorFunction {\n return numbersInRange(key, 0, 23);\n}\n\nfunction validDateArray(key: string): OptionProcessorFunction {\n return ({ value, providedType, localization }) => {\n if (value === undefined) {\n return [];\n }\n typeCheckDateArray(key, value, providedType, localization);\n return value;\n };\n}\n\nfunction validKeyOption(keyOptions: string[]): OptionProcessorFunction {\n return ({ value, path }) => {\n if (!keyOptions.includes(value))\n Namespace.errorMessages.unexpectedOptionValue(\n path.substring(1),\n value,\n keyOptions\n );\n return value;\n };\n}\n\nconst optionProcessors: { [key: string]: OptionProcessorFunction } =\n Object.freeze({\n defaultDate: mandatoryDate('defaultDate'),\n viewDate: mandatoryDate('viewDate'),\n minDate: optionalDate('restrictions.minDate'),\n maxDate: optionalDate('restrictions.maxDate'),\n disabledHours: validHourRange('restrictions.disabledHours'),\n enabledHours: validHourRange('restrictions.enabledHours'),\n disabledDates: validDateArray('restrictions.disabledDates'),\n enabledDates: validDateArray('restrictions.enabledDates'),\n daysOfWeekDisabled: numbersInRange('restrictions.daysOfWeekDisabled', 0, 6),\n disabledTimeIntervals: ({ key, value, providedType, localization }) => {\n if (value === undefined) {\n return [];\n }\n if (!Array.isArray(value)) {\n Namespace.errorMessages.typeMismatch(\n key,\n providedType,\n 'array of { from: DateTime|Date, to: DateTime|Date }'\n );\n }\n const valueObject = value as { from: any; to: any }[]; //eslint-disable-line @typescript-eslint/no-explicit-any\n for (let i = 0; i < valueObject.length; i++) {\n Object.keys(valueObject[i]).forEach((vk) => {\n const subOptionName = `${key}[${i}].${vk}`;\n const d = valueObject[i][vk];\n const dateTime = convertToDateTime(d, subOptionName, localization);\n if (!dateTime) {\n Namespace.errorMessages.typeMismatch(\n subOptionName,\n typeof d,\n 'DateTime or Date'\n );\n }\n dateTime.setLocalization(localization);\n valueObject[i][vk] = dateTime;\n });\n }\n return valueObject;\n },\n toolbarPlacement: validKeyOption(['top', 'bottom', 'default']),\n type: validKeyOption(['icons', 'sprites']),\n viewMode: validKeyOption([\n 'clock',\n 'calendar',\n 'months',\n 'years',\n 'decades',\n ]),\n theme: validKeyOption(['light', 'dark', 'auto']),\n placement: validKeyOption(['top', 'bottom']),\n meta: ({ value }) => value,\n dayViewHeaderFormat: ({ value }) => value,\n container: ({ value, path }) => {\n if (\n value &&\n !(\n value instanceof HTMLElement ||\n value instanceof Element ||\n value?.appendChild\n )\n ) {\n Namespace.errorMessages.typeMismatch(\n path.substring(1),\n typeof value,\n 'HTMLElement'\n );\n }\n return value;\n },\n useTwentyfourHour: ({ value, path, providedType, defaultType }) => {\n Namespace.errorMessages.deprecatedWarning(\n 'useTwentyfourHour',\n 'Please use \"options.localization.hourCycle\" instead'\n );\n if (value === undefined || providedType === 'boolean') return value;\n Namespace.errorMessages.typeMismatch(path, providedType, defaultType);\n },\n hourCycle: validKeyOption(['h11', 'h12', 'h23', 'h24']),\n });\n\nconst defaultProcessor: OptionProcessorFunction = ({\n value,\n defaultType,\n providedType,\n path,\n}) => {\n switch (defaultType) {\n case 'boolean':\n return value === 'true' || value === true;\n case 'number':\n return +value;\n case 'string':\n return value.toString();\n case 'object':\n return {};\n case 'function':\n return value;\n default:\n Namespace.errorMessages.typeMismatch(path, providedType, defaultType);\n }\n};\n\nexport function processKey(this: void, args: OptionProcessorFunctionArguments) {\n return (optionProcessors[args.key] || defaultProcessor)(args);\n}\n","import Namespace from './namespace';\nimport { DateTime } from '../datetime';\nimport DefaultOptions from './default-options';\nimport Options, { FormatLocalization } from './options';\nimport { processKey } from './optionProcessor';\nimport {\n convertToDateTime,\n tryConvertToDateTime,\n typeCheckDateArray,\n typeCheckNumberArray,\n} from './typeChecker';\n\nexport class OptionConverter {\n private static ignoreProperties = [\n 'meta',\n 'dayViewHeaderFormat',\n 'container',\n 'dateForms',\n 'ordinal',\n ];\n\n static deepCopy(input): Options {\n const o = {};\n\n Object.keys(input).forEach((key) => {\n const inputElement = input[key];\n\n if (inputElement instanceof DateTime) {\n o[key] = inputElement.clone;\n return;\n } else if (inputElement instanceof Date) {\n o[key] = new Date(inputElement.valueOf());\n return;\n }\n\n o[key] = inputElement;\n if (\n typeof inputElement !== 'object' ||\n inputElement instanceof HTMLElement ||\n inputElement instanceof Element\n )\n return;\n if (!Array.isArray(inputElement)) {\n o[key] = OptionConverter.deepCopy(inputElement);\n }\n });\n\n return o;\n }\n\n private static isValue = (a) => a != null; // everything except undefined + null\n\n /**\n * Finds value out of an object based on a string, period delimited, path\n * @param paths\n * @param obj\n */\n static objectPath(paths: string, obj) {\n if (paths.charAt(0) === '.') paths = paths.slice(1);\n if (!paths) return obj;\n return paths\n .split('.')\n .reduce(\n (value, key) =>\n OptionConverter.isValue(value) || OptionConverter.isValue(value[key])\n ? value[key]\n : undefined,\n obj\n );\n }\n\n /**\n * The spread operator caused sub keys to be missing after merging.\n * This is to fix that issue by using spread on the child objects first.\n * Also handles complex options like disabledDates\n * @param provided An option from new providedOptions\n * @param copyTo Destination object. This was added to prevent reference copies\n * @param localization\n * @param path\n */\n static spread(provided, copyTo, localization: FormatLocalization, path = '') {\n const defaultOptions = OptionConverter.objectPath(path, DefaultOptions);\n\n const unsupportedOptions = Object.keys(provided).filter(\n (x) => !Object.keys(defaultOptions).includes(x)\n );\n\n if (unsupportedOptions.length > 0) {\n const flattenedOptions = OptionConverter.getFlattenDefaultOptions();\n\n const errors = unsupportedOptions.map((x) => {\n let error = `\"${path}.${x}\" in not a known option.`;\n const didYouMean = flattenedOptions.find((y) => y.includes(x));\n if (didYouMean) error += ` Did you mean \"${didYouMean}\"?`;\n return error;\n });\n Namespace.errorMessages.unexpectedOptions(errors);\n }\n\n Object.keys(provided)\n .filter((key) => key !== '__proto__' && key !== 'constructor')\n .forEach((key) => {\n path += `.${key}`;\n if (path.charAt(0) === '.') path = path.slice(1);\n\n const defaultOptionValue = defaultOptions[key];\n const providedType = typeof provided[key];\n const defaultType = typeof defaultOptionValue;\n const value = provided[key];\n\n if (value === undefined || value === null) {\n copyTo[key] = value;\n path = path.substring(0, path.lastIndexOf(`.${key}`));\n return;\n }\n\n if (\n typeof defaultOptionValue === 'object' &&\n !Array.isArray(provided[key]) &&\n !(\n defaultOptionValue instanceof Date ||\n OptionConverter.ignoreProperties.includes(key)\n )\n ) {\n OptionConverter.spread(\n provided[key],\n copyTo[key],\n localization,\n path\n );\n } else {\n copyTo[key] = OptionConverter.processKey(\n key,\n value,\n providedType,\n defaultType,\n path,\n localization\n );\n }\n\n path = path.substring(0, path.lastIndexOf(`.${key}`));\n });\n }\n\n static processKey(\n key: string,\n value: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n providedType: string,\n defaultType: string,\n path: string,\n localization: FormatLocalization\n ) {\n return processKey({\n key,\n value,\n providedType,\n defaultType,\n path,\n localization,\n });\n }\n\n static _mergeOptions(providedOptions: Options, mergeTo: Options): Options {\n const newConfig = OptionConverter.deepCopy(mergeTo);\n //see if the options specify a locale\n const localization =\n mergeTo.localization?.locale !== 'default'\n ? mergeTo.localization\n : providedOptions?.localization || DefaultOptions.localization;\n\n OptionConverter.spread(providedOptions, newConfig, localization, '');\n\n return newConfig;\n }\n\n static _dataToOptions(element, options: Options): Options {\n const eData = JSON.parse(JSON.stringify(element.dataset));\n\n if (eData?.tdTargetInput) delete eData.tdTargetInput;\n if (eData?.tdTargetToggle) delete eData.tdTargetToggle;\n\n if (\n !eData ||\n Object.keys(eData).length === 0 ||\n eData.constructor !== DOMStringMap\n )\n return options;\n const dataOptions = {} as Options;\n\n // because dataset returns camelCase including the 'td' key the option\n // key won't align\n const objectToNormalized = (object) => {\n const lowered = {};\n Object.keys(object).forEach((x) => {\n lowered[x.toLowerCase()] = x;\n });\n\n return lowered;\n };\n\n const normalizeObject = this.normalizeObject(objectToNormalized);\n const optionsLower = objectToNormalized(options);\n\n Object.keys(eData)\n .filter((x) => x.startsWith(Namespace.dataKey))\n .map((x) => x.substring(2))\n .forEach((key) => {\n let keyOption = optionsLower[key.toLowerCase()];\n\n // dataset merges dashes to camelCase... yay\n // i.e. key = display_components_seconds\n if (key.includes('_')) {\n // [display, components, seconds]\n const split = key.split('_');\n // display\n keyOption = optionsLower[split[0].toLowerCase()];\n if (\n keyOption !== undefined &&\n options[keyOption].constructor === Object\n ) {\n dataOptions[keyOption] = normalizeObject(\n split,\n 1,\n options[keyOption],\n eData[`td${key}`]\n );\n }\n }\n // or key = multipleDate\n else if (keyOption !== undefined) {\n dataOptions[keyOption] = eData[`td${key}`];\n }\n });\n\n return this._mergeOptions(dataOptions, options);\n }\n\n //todo clean this up\n private static normalizeObject(objectToNormalized: (object) => object) {\n const normalizeObject = (\n split: string[],\n index: number,\n optionSubgroup: unknown,\n value: unknown\n ) => {\n // first round = display { ... }\n const normalizedOptions = objectToNormalized(optionSubgroup);\n\n const keyOption = normalizedOptions[split[index].toLowerCase()];\n const internalObject = {};\n\n if (keyOption === undefined) return internalObject;\n\n // if this is another object, continue down the rabbit hole\n if (optionSubgroup[keyOption].constructor === Object) {\n index++;\n internalObject[keyOption] = normalizeObject(\n split,\n index,\n optionSubgroup[keyOption],\n value\n );\n } else {\n internalObject[keyOption] = value;\n }\n return internalObject;\n };\n return normalizeObject;\n }\n\n /**\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\n * @param d If a string will attempt creating a date from it.\n * @param localization object containing locale and format settings. Only used with the custom formats\n * @private\n */\n static _dateTypeCheck(\n d: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n localization: FormatLocalization\n ): DateTime | null {\n return tryConvertToDateTime(d, localization);\n }\n\n /**\n * Type checks that `value` is an array of Date or DateTime\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param value Option value\n * @param providedType Used to provide text to error messages\n * @param localization\n */\n static _typeCheckDateArray(\n optionName: string,\n value,\n providedType: string,\n localization: FormatLocalization\n ) {\n return typeCheckDateArray(optionName, value, providedType, localization);\n }\n\n /**\n * Type checks that `value` is an array of numbers\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param value Option value\n * @param providedType Used to provide text to error messages\n */\n static _typeCheckNumberArray(\n optionName: string,\n value,\n providedType: string\n ) {\n return typeCheckNumberArray(optionName, value, providedType);\n }\n\n /**\n * Attempts to convert `d` to a DateTime object\n * @param d value to convert\n * @param optionName Provides text to error messages e.g. disabledDates\n * @param localization object containing locale and format settings. Only used with the custom formats\n */\n static dateConversion(\n d: any, //eslint-disable-line @typescript-eslint/no-explicit-any\n optionName: string,\n localization: FormatLocalization\n ): DateTime {\n return convertToDateTime(d, optionName, localization);\n }\n\n private static _flattenDefaults: string[];\n\n private static getFlattenDefaultOptions(): string[] {\n if (this._flattenDefaults) return this._flattenDefaults;\n const deepKeys = (t, pre = []) => {\n if (Array.isArray(t)) return [];\n if (Object(t) === t) {\n return Object.entries(t).flatMap(([k, v]) => deepKeys(v, [...pre, k]));\n } else {\n return pre.join('.');\n }\n };\n\n this._flattenDefaults = deepKeys(DefaultOptions);\n\n return this._flattenDefaults;\n }\n\n /**\n * Some options conflict like min/max date. Verify that these kinds of options\n * are set correctly.\n * @param config\n */\n static _validateConflicts(config: Options) {\n if (\n config.display.sideBySide &&\n (!config.display.components.clock ||\n !(\n config.display.components.hours ||\n config.display.components.minutes ||\n config.display.components.seconds\n ))\n ) {\n Namespace.errorMessages.conflictingConfiguration(\n 'Cannot use side by side mode without the clock components'\n );\n }\n\n if (config.restrictions.minDate && config.restrictions.maxDate) {\n if (config.restrictions.minDate.isAfter(config.restrictions.maxDate)) {\n Namespace.errorMessages.conflictingConfiguration(\n 'minDate is after maxDate'\n );\n }\n\n if (config.restrictions.maxDate.isBefore(config.restrictions.minDate)) {\n Namespace.errorMessages.conflictingConfiguration(\n 'maxDate is before minDate'\n );\n }\n }\n\n if (config.multipleDates && config.dateRange) {\n Namespace.errorMessages.conflictingConfiguration(\n 'Cannot uss option \"multipleDates\" with \"dateRange\"'\n );\n }\n }\n}\n","import { DateTime, getFormatByUnit, Unit } from './datetime';\nimport Namespace from './utilities/namespace';\nimport { ChangeEvent, FailEvent } from './utilities/event-types';\nimport Validation from './validation';\nimport { serviceLocator } from './utilities/service-locator';\nimport { EventEmitters } from './utilities/event-emitter';\nimport { OptionsStore } from './utilities/optionsStore';\nimport { OptionConverter } from './utilities/optionConverter';\n\nexport default class Dates {\n private _dates: DateTime[] = [];\n private optionsStore: OptionsStore;\n private validation: Validation;\n private _eventEmitters: EventEmitters;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.validation = serviceLocator.locate(Validation);\n this._eventEmitters = serviceLocator.locate(EventEmitters);\n }\n\n /**\n * Returns the array of selected dates\n */\n get picked(): DateTime[] {\n return [...this._dates];\n }\n\n /**\n * Returns the last picked value.\n */\n get lastPicked(): DateTime {\n return this._dates[this.lastPickedIndex]?.clone;\n }\n\n /**\n * Returns the length of picked dates -1 or 0 if none are selected.\n */\n get lastPickedIndex(): number {\n if (this._dates.length === 0) return 0;\n return this._dates.length - 1;\n }\n\n /**\n * Formats a DateTime object to a string. Used when setting the input value.\n * @param date\n */\n formatInput(date: DateTime): string {\n if (!date) return '';\n date.localization = this.optionsStore.options.localization;\n return date.format();\n }\n\n /**\n * parse the value into a DateTime object.\n * this can be overwritten to supply your own parsing.\n */\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n parseInput(value: any): DateTime {\n return OptionConverter.dateConversion(\n value,\n 'input',\n this.optionsStore.options.localization\n );\n }\n\n /**\n * Tries to convert the provided value to a DateTime object.\n * If value is null|undefined then clear the value of the provided index (or 0).\n * @param value Value to convert or null|undefined\n * @param index When using multidates this is the index in the array\n */\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n setFromInput(value: any, index?: number) {\n if (!value) {\n this.setValue(undefined, index);\n return;\n }\n const converted = this.parseInput(value);\n if (converted) {\n converted.setLocalization(this.optionsStore.options.localization);\n this.setValue(converted, index);\n }\n }\n\n /**\n * Adds a new DateTime to selected dates array\n * @param date\n */\n add(date: DateTime): void {\n this._dates.push(date);\n }\n\n /**\n * Returns true if the `targetDate` is part of the selected dates array.\n * If `unit` is provided then a granularity to that unit will be used.\n * @param targetDate\n * @param unit\n */\n isPicked(targetDate: DateTime, unit?: Unit): boolean {\n if (!DateTime.isValid(targetDate)) return false;\n if (!unit)\n return this._dates.find((x) => x.isSame(targetDate)) !== undefined;\n\n const format = getFormatByUnit(unit);\n\n const innerDateFormatted = targetDate.format(format);\n\n return (\n this._dates\n .map((x) => x.format(format))\n .find((x) => x === innerDateFormatted) !== undefined\n );\n }\n\n /**\n * Returns the index at which `targetDate` is in the array.\n * This is used for updating or removing a date when multi-date is used\n * If `unit` is provided then a granularity to that unit will be used.\n * @param targetDate\n * @param unit\n */\n pickedIndex(targetDate: DateTime, unit?: Unit): number {\n if (!DateTime.isValid(targetDate)) return -1;\n if (!unit)\n return this._dates.map((x) => x.valueOf()).indexOf(targetDate.valueOf());\n\n const format = getFormatByUnit(unit);\n\n const innerDateFormatted = targetDate.format(format);\n\n return this._dates.map((x) => x.format(format)).indexOf(innerDateFormatted);\n }\n\n /**\n * Clears all selected dates.\n */\n clear() {\n this.optionsStore.unset = true;\n this._eventEmitters.triggerEvent.emit({\n type: Namespace.events.change,\n date: undefined,\n oldDate: this.lastPicked,\n isClear: true,\n isValid: true,\n } as ChangeEvent);\n this._dates = [];\n if (this.optionsStore.input) this.optionsStore.input.value = '';\n this._eventEmitters.updateDisplay.emit('all');\n }\n\n /**\n * Find the \"book end\" years given a `year` and a `factor`\n * @param factor e.g. 100 for decades\n * @param year e.g. 2021\n */\n static getStartEndYear(\n factor: number,\n year: number\n ): [number, number, number] {\n const step = factor / 10,\n startYear = Math.floor(year / factor) * factor,\n endYear = startYear + step * 9,\n focusValue = Math.floor(year / step) * step;\n return [startYear, endYear, focusValue];\n }\n\n updateInput(target?: DateTime) {\n if (!this.optionsStore.input) return;\n\n let newValue = this.formatInput(target);\n if (\n this.optionsStore.options.multipleDates ||\n this.optionsStore.options.dateRange\n ) {\n newValue = this._dates\n .map((d) => this.formatInput(d))\n .join(this.optionsStore.options.multipleDatesSeparator);\n }\n if (this.optionsStore.input.value != newValue)\n this.optionsStore.input.value = newValue;\n }\n\n /**\n * Attempts to either clear or set the `target` date at `index`.\n * If the `target` is null then the date will be cleared.\n * If multi-date is being used then it will be removed from the array.\n * If `target` is valid and multi-date is used then if `index` is\n * provided the date at that index will be replaced, otherwise it is appended.\n * @param target\n * @param index\n */\n setValue(target?: DateTime, index?: number): void {\n const noIndex = typeof index === 'undefined',\n isClear = !target && noIndex;\n let oldDate = this.optionsStore.unset ? null : this._dates[index]?.clone;\n if (!oldDate && !this.optionsStore.unset && noIndex && isClear) {\n oldDate = this.lastPicked;\n }\n\n if (target && oldDate?.isSame(target)) {\n this.updateInput(target);\n return;\n }\n\n // case of calling setValue(null)\n if (!target) {\n this._setValueNull(isClear, index, oldDate);\n return;\n }\n\n index = index || 0;\n target = target.clone;\n\n // minute stepping is being used, force the minute to the closest value\n if (this.optionsStore.options.stepping !== 1) {\n target.minutes =\n Math.round(target.minutes / this.optionsStore.options.stepping) *\n this.optionsStore.options.stepping;\n target.startOf(Unit.minutes);\n }\n\n const onUpdate = (isValid: boolean) => {\n this._dates[index] = target;\n this._eventEmitters.updateViewDate.emit(target.clone);\n\n this.updateInput(target);\n\n this.optionsStore.unset = false;\n this._eventEmitters.updateDisplay.emit('all');\n this._eventEmitters.triggerEvent.emit({\n type: Namespace.events.change,\n date: target,\n oldDate,\n isClear,\n isValid: isValid,\n } as ChangeEvent);\n };\n\n if (\n this.validation.isValid(target) &&\n this.validation.dateRangeIsValid(this.picked, index, target)\n ) {\n onUpdate(true);\n return;\n }\n\n if (this.optionsStore.options.keepInvalid) {\n onUpdate(false);\n }\n\n this._eventEmitters.triggerEvent.emit({\n type: Namespace.events.error,\n reason: Namespace.errorMessages.failedToSetInvalidDate,\n date: target,\n oldDate,\n } as FailEvent);\n }\n\n private _setValueNull(isClear: boolean, index: number, oldDate: DateTime) {\n if (\n !this.optionsStore.options.multipleDates ||\n this._dates.length === 1 ||\n isClear\n ) {\n this.optionsStore.unset = true;\n this._dates = [];\n } else {\n this._dates.splice(index, 1);\n }\n\n this.updateInput();\n\n this._eventEmitters.triggerEvent.emit({\n type: Namespace.events.change,\n date: undefined,\n oldDate,\n isClear,\n isValid: true,\n } as ChangeEvent);\n\n this._eventEmitters.updateDisplay.emit('all');\n }\n}\n","enum ActionTypes {\n next = 'next',\n previous = 'previous',\n changeCalendarView = 'changeCalendarView',\n selectMonth = 'selectMonth',\n selectYear = 'selectYear',\n selectDecade = 'selectDecade',\n selectDay = 'selectDay',\n selectHour = 'selectHour',\n selectMinute = 'selectMinute',\n selectSecond = 'selectSecond',\n incrementHours = 'incrementHours',\n incrementMinutes = 'incrementMinutes',\n incrementSeconds = 'incrementSeconds',\n decrementHours = 'decrementHours',\n decrementMinutes = 'decrementMinutes',\n decrementSeconds = 'decrementSeconds',\n toggleMeridiem = 'toggleMeridiem',\n togglePicker = 'togglePicker',\n showClock = 'showClock',\n showHours = 'showHours',\n showMinutes = 'showMinutes',\n showSeconds = 'showSeconds',\n clear = 'clear',\n close = 'close',\n today = 'today',\n}\n\nexport default ActionTypes;\n","import { DateTime, Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport Dates from '../../dates';\nimport { Paint } from '../index';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `date`\n */\nexport default class DateDisplay {\n private optionsStore: OptionsStore;\n private dates: Dates;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n }\n\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.daysContainer);\n\n container.append(...this._daysOfTheWeek());\n\n if (this.optionsStore.options.display.calendarWeeks) {\n const div = document.createElement('div');\n div.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight);\n container.appendChild(div);\n }\n\n const { rangeHoverEvent, rangeHoverOutEvent } =\n this.handleMouseEvents(container);\n\n for (let i = 0; i < 42; i++) {\n if (i !== 0 && i % 7 === 0) {\n if (this.optionsStore.options.display.calendarWeeks) {\n const div = document.createElement('div');\n div.classList.add(\n Namespace.css.calendarWeeks,\n Namespace.css.noHighlight\n );\n container.appendChild(div);\n }\n }\n\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectDay);\n container.appendChild(div);\n\n // if hover is supported then add the events\n if (\n matchMedia('(hover: hover)').matches &&\n this.optionsStore.options.dateRange\n ) {\n div.addEventListener('mouseover', rangeHoverEvent);\n div.addEventListener('mouseout', rangeHoverOutEvent);\n }\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint): void {\n const container = widget.getElementsByClassName(\n Namespace.css.daysContainer\n )[0] as HTMLElement;\n\n this._updateCalendarView(container);\n\n const innerDate = this.optionsStore.viewDate.clone\n .startOf(Unit.month)\n .startOf('weekDay', this.optionsStore.options.localization.startOfTheWeek)\n .manipulate(12, Unit.hours);\n\n this._handleCalendarWeeks(container, innerDate.clone);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectDay}\"]`)\n .forEach((element: HTMLElement) => {\n const classes: string[] = [];\n classes.push(Namespace.css.day);\n\n if (innerDate.isBefore(this.optionsStore.viewDate, Unit.month)) {\n classes.push(Namespace.css.old);\n }\n if (innerDate.isAfter(this.optionsStore.viewDate, Unit.month)) {\n classes.push(Namespace.css.new);\n }\n\n if (\n !this.optionsStore.unset &&\n !this.optionsStore.options.dateRange &&\n this.dates.isPicked(innerDate, Unit.date)\n ) {\n classes.push(Namespace.css.active);\n }\n if (!this.validation.isValid(innerDate, Unit.date)) {\n classes.push(Namespace.css.disabled);\n }\n if (innerDate.isSame(new DateTime(), Unit.date)) {\n classes.push(Namespace.css.today);\n }\n if (innerDate.weekDay === 0 || innerDate.weekDay === 6) {\n classes.push(Namespace.css.weekend);\n }\n\n this._handleDateRange(innerDate, classes);\n\n paint(Unit.date, innerDate, classes, element);\n\n element.classList.remove(...element.classList);\n element.classList.add(...classes);\n element.setAttribute('data-value', this._dateToDataValue(innerDate));\n element.setAttribute('data-day', `${innerDate.date}`);\n element.innerText = innerDate.parts(undefined, {\n day: 'numeric',\n }).day;\n innerDate.manipulate(1, Unit.date);\n });\n }\n\n private _dateToDataValue(date: DateTime): string {\n if (!DateTime.isValid(date)) return '';\n\n return `${date.year}-${date.monthFormatted}-${date.dateFormatted}`;\n }\n\n private _handleDateRange(innerDate: DateTime, classes: string[]) {\n const rangeStart = this.dates.picked[0];\n const rangeEnd = this.dates.picked[1];\n\n if (this.optionsStore.options.dateRange) {\n if (innerDate.isBetween(rangeStart, rangeEnd, Unit.date)) {\n classes.push(Namespace.css.rangeIn);\n }\n\n if (innerDate.isSame(rangeStart, Unit.date)) {\n classes.push(Namespace.css.rangeStart);\n }\n\n if (innerDate.isSame(rangeEnd, Unit.date)) {\n classes.push(Namespace.css.rangeEnd);\n }\n }\n }\n\n private handleMouseEvents(container: HTMLElement) {\n const rangeHoverEvent = (e: MouseEvent) => {\n const currentTarget = e?.currentTarget as HTMLElement;\n\n // if we have 0 or 2 selected or if the target is disabled then ignore\n if (\n this.dates.picked.length !== 1 ||\n currentTarget.classList.contains(Namespace.css.disabled)\n )\n return;\n\n // select all the date divs\n const allDays = [...container.querySelectorAll('.day')] as HTMLElement[];\n\n // get the date value from the element being hovered over\n const attributeValue = currentTarget.getAttribute('data-value');\n\n // format the string to a date\n const innerDate = DateTime.fromString(attributeValue, {\n format: 'yyyy-MM-dd',\n });\n\n // find the position of the target in the date container\n const dayIndex = allDays.findIndex(\n (e) => e.getAttribute('data-value') === attributeValue\n );\n\n // find the first and second selected dates\n const rangeStart = this.dates.picked[0];\n const rangeEnd = this.dates.picked[1];\n\n //format the start date so that it can be found by the attribute\n const rangeStartFormatted = this._dateToDataValue(rangeStart);\n const rangeStartIndex = allDays.findIndex(\n (e) => e.getAttribute('data-value') === rangeStartFormatted\n );\n const rangeStartElement = allDays[rangeStartIndex];\n\n //make sure we don't leave start/end classes if we don't need them\n if (!innerDate.isSame(rangeStart, Unit.date)) {\n currentTarget.classList.remove(Namespace.css.rangeStart);\n }\n\n if (!innerDate.isSame(rangeEnd, Unit.date)) {\n currentTarget.classList.remove(Namespace.css.rangeEnd);\n }\n\n // the following figures out which direct from start date is selected\n // the selection \"cap\" classes are applied if needed\n // otherwise all the dates between will get the `rangeIn` class.\n // We make this selection based on the element's index and the rangeStart index\n\n let lambda: (_, index) => boolean;\n\n if (innerDate.isBefore(rangeStart)) {\n currentTarget.classList.add(Namespace.css.rangeStart);\n rangeStartElement?.classList.remove(Namespace.css.rangeStart);\n rangeStartElement?.classList.add(Namespace.css.rangeEnd);\n lambda = (_, index) => index > dayIndex && index < rangeStartIndex;\n } else {\n currentTarget.classList.add(Namespace.css.rangeEnd);\n rangeStartElement?.classList.remove(Namespace.css.rangeEnd);\n rangeStartElement?.classList.add(Namespace.css.rangeStart);\n lambda = (_, index) => index < dayIndex && index > rangeStartIndex;\n }\n\n allDays.filter(lambda).forEach((e) => {\n e.classList.add(Namespace.css.rangeIn);\n });\n };\n\n const rangeHoverOutEvent = (e: MouseEvent) => {\n // find all the dates in the container\n const allDays = [...container.querySelectorAll('.day')] as HTMLElement[];\n\n // if only the start is selected, remove all the rangeIn classes\n // we do this because once the user hovers over a new date the range will be recalculated.\n if (this.dates.picked.length === 1)\n allDays.forEach((e) => e.classList.remove(Namespace.css.rangeIn));\n\n // if we have 0 or 2 dates selected then ignore\n if (this.dates.picked.length !== 1) return;\n\n const currentTarget = e?.currentTarget as HTMLElement;\n\n // get the elements date from the attribute value\n const innerDate = new DateTime(currentTarget.getAttribute('data-value'));\n\n // verify selections and remove invalid classes\n if (!innerDate.isSame(this.dates.picked[0], Unit.date)) {\n currentTarget.classList.remove(Namespace.css.rangeStart);\n }\n\n if (!innerDate.isSame(this.dates.picked[1], Unit.date)) {\n currentTarget.classList.remove(Namespace.css.rangeEnd);\n }\n };\n\n return { rangeHoverEvent, rangeHoverOutEvent };\n }\n\n private _updateCalendarView(container: Element) {\n if (this.optionsStore.currentView !== 'calendar') return;\n const [previous, switcher, next] = container.parentElement\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\n .getElementsByTagName('div');\n switcher.setAttribute(\n Namespace.css.daysContainer,\n this.optionsStore.viewDate.format(\n this.optionsStore.options.localization.dayViewHeaderFormat\n )\n );\n this.optionsStore.options.display.components.month\n ? switcher.classList.remove(Namespace.css.disabled)\n : switcher.classList.add(Namespace.css.disabled);\n this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.month),\n Unit.month\n )\n ? previous.classList.remove(Namespace.css.disabled)\n : previous.classList.add(Namespace.css.disabled);\n this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(1, Unit.month),\n Unit.month\n )\n ? next.classList.remove(Namespace.css.disabled)\n : next.classList.add(Namespace.css.disabled);\n }\n\n /***\n * Generates a html row that contains the days of the week.\n * @private\n */\n private _daysOfTheWeek(): HTMLElement[] {\n const innerDate = this.optionsStore.viewDate.clone\n .startOf('weekDay', this.optionsStore.options.localization.startOfTheWeek)\n .startOf(Unit.date);\n const row = [];\n document.createElement('div');\n\n if (this.optionsStore.options.display.calendarWeeks) {\n const htmlDivElement = document.createElement('div');\n htmlDivElement.classList.add(\n Namespace.css.calendarWeeks,\n Namespace.css.noHighlight\n );\n htmlDivElement.innerText = '#';\n row.push(htmlDivElement);\n }\n\n for (let i = 0; i < 7; i++) {\n const htmlDivElement = document.createElement('div');\n htmlDivElement.classList.add(\n Namespace.css.dayOfTheWeek,\n Namespace.css.noHighlight\n );\n htmlDivElement.innerText = innerDate.format({ weekday: 'short' });\n innerDate.manipulate(1, Unit.date);\n row.push(htmlDivElement);\n }\n\n return row;\n }\n\n private _handleCalendarWeeks(container: HTMLElement, innerDate: DateTime) {\n [...container.querySelectorAll(`.${Namespace.css.calendarWeeks}`)]\n .filter((e: HTMLElement) => e.innerText !== '#')\n .forEach((element: HTMLElement) => {\n element.innerText = `${innerDate.week}`;\n innerDate.manipulate(7, Unit.date);\n });\n }\n}\n","import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport Dates from '../../dates';\nimport { Paint } from '../index';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `month`\n */\nexport default class MonthDisplay {\n private optionsStore: OptionsStore;\n private dates: Dates;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n }\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.monthsContainer);\n\n for (let i = 0; i < 12; i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectMonth);\n container.appendChild(div);\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint): void {\n const container = widget.getElementsByClassName(\n Namespace.css.monthsContainer\n )[0];\n\n if (this.optionsStore.currentView === 'months') {\n const [previous, switcher, next] = container.parentElement\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\n .getElementsByTagName('div');\n\n switcher.setAttribute(\n Namespace.css.monthsContainer,\n this.optionsStore.viewDate.format({ year: 'numeric' })\n );\n\n this.optionsStore.options.display.components.year\n ? switcher.classList.remove(Namespace.css.disabled)\n : switcher.classList.add(Namespace.css.disabled);\n\n this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.year),\n Unit.year\n )\n ? previous.classList.remove(Namespace.css.disabled)\n : previous.classList.add(Namespace.css.disabled);\n\n this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(1, Unit.year),\n Unit.year\n )\n ? next.classList.remove(Namespace.css.disabled)\n : next.classList.add(Namespace.css.disabled);\n }\n\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.year);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMonth}\"]`)\n .forEach((containerClone: HTMLElement, index) => {\n const classes = [];\n classes.push(Namespace.css.month);\n\n if (\n !this.optionsStore.unset &&\n this.dates.isPicked(innerDate, Unit.month)\n ) {\n classes.push(Namespace.css.active);\n }\n if (!this.validation.isValid(innerDate, Unit.month)) {\n classes.push(Namespace.css.disabled);\n }\n\n paint(Unit.month, innerDate, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${index}`);\n containerClone.innerText = `${innerDate.format({ month: 'short' })}`;\n innerDate.manipulate(1, Unit.month);\n });\n }\n}\n","import { DateTime, Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Dates from '../../dates';\nimport Validation from '../../validation';\nimport { Paint } from '../index';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `year`\n */\nexport default class YearDisplay {\n private _startYear: DateTime;\n private _endYear: DateTime;\n private optionsStore: OptionsStore;\n private dates: Dates;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n }\n\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.yearsContainer);\n\n for (let i = 0; i < 12; i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectYear);\n container.appendChild(div);\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint) {\n this._startYear = this.optionsStore.viewDate.clone.manipulate(\n -1,\n Unit.year\n );\n this._endYear = this.optionsStore.viewDate.clone.manipulate(10, Unit.year);\n\n const container = widget.getElementsByClassName(\n Namespace.css.yearsContainer\n )[0];\n\n if (this.optionsStore.currentView === 'years') {\n const [previous, switcher, next] = container.parentElement\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\n .getElementsByTagName('div');\n\n switcher.setAttribute(\n Namespace.css.yearsContainer,\n `${this._startYear.format({ year: 'numeric' })}-${this._endYear.format({\n year: 'numeric',\n })}`\n );\n\n this.optionsStore.options.display.components.decades\n ? switcher.classList.remove(Namespace.css.disabled)\n : switcher.classList.add(Namespace.css.disabled);\n\n this.validation.isValid(this._startYear, Unit.year)\n ? previous.classList.remove(Namespace.css.disabled)\n : previous.classList.add(Namespace.css.disabled);\n this.validation.isValid(this._endYear, Unit.year)\n ? next.classList.remove(Namespace.css.disabled)\n : next.classList.add(Namespace.css.disabled);\n }\n\n const innerDate = this.optionsStore.viewDate.clone\n .startOf(Unit.year)\n .manipulate(-1, Unit.year);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectYear}\"]`)\n .forEach((containerClone: HTMLElement) => {\n const classes = [];\n classes.push(Namespace.css.year);\n\n if (\n !this.optionsStore.unset &&\n this.dates.isPicked(innerDate, Unit.year)\n ) {\n classes.push(Namespace.css.active);\n }\n if (!this.validation.isValid(innerDate, Unit.year)) {\n classes.push(Namespace.css.disabled);\n }\n\n paint(Unit.year, innerDate, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${innerDate.year}`);\n containerClone.innerText = innerDate.format({ year: 'numeric' });\n\n innerDate.manipulate(1, Unit.year);\n });\n }\n}\n","import Dates from '../../dates';\nimport { DateTime, Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport { Paint } from '../index';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `seconds`\n */\nexport default class DecadeDisplay {\n private _startDecade: DateTime;\n private _endDecade: DateTime;\n private optionsStore: OptionsStore;\n private dates: Dates;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n }\n\n /**\n * Build the container html for the display\n * @private\n */\n getPicker() {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.decadesContainer);\n\n for (let i = 0; i < 12; i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectDecade);\n container.appendChild(div);\n }\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint) {\n const [start, end] = Dates.getStartEndYear(\n 100,\n this.optionsStore.viewDate.year\n );\n this._startDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\n this._startDecade.year = start;\n this._endDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\n this._endDecade.year = end;\n\n const container = widget.getElementsByClassName(\n Namespace.css.decadesContainer\n )[0];\n\n const [previous, switcher, next] = container.parentElement\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\n .getElementsByTagName('div');\n\n if (this.optionsStore.currentView === 'decades') {\n switcher.setAttribute(\n Namespace.css.decadesContainer,\n `${this._startDecade.format({\n year: 'numeric',\n })}-${this._endDecade.format({ year: 'numeric' })}`\n );\n\n this.validation.isValid(this._startDecade, Unit.year)\n ? previous.classList.remove(Namespace.css.disabled)\n : previous.classList.add(Namespace.css.disabled);\n this.validation.isValid(this._endDecade, Unit.year)\n ? next.classList.remove(Namespace.css.disabled)\n : next.classList.add(Namespace.css.disabled);\n }\n\n const pickedYears = this.dates.picked.map((x) => x.year);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectDecade}\"]`)\n .forEach((containerClone: HTMLElement, index) => {\n if (index === 0) {\n containerClone.classList.add(Namespace.css.old);\n if (this._startDecade.year - 10 < 0) {\n containerClone.textContent = ' ';\n previous.classList.add(Namespace.css.disabled);\n containerClone.classList.add(Namespace.css.disabled);\n containerClone.setAttribute('data-value', '');\n return;\n } else {\n containerClone.innerText = this._startDecade.clone\n .manipulate(-10, Unit.year)\n .format({ year: 'numeric' });\n containerClone.setAttribute(\n 'data-value',\n `${this._startDecade.year}`\n );\n return;\n }\n }\n\n const classes = [];\n classes.push(Namespace.css.decade);\n const startDecadeYear = this._startDecade.year;\n const endDecadeYear = this._startDecade.year + 9;\n\n if (\n !this.optionsStore.unset &&\n pickedYears.filter((x) => x >= startDecadeYear && x <= endDecadeYear)\n .length > 0\n ) {\n classes.push(Namespace.css.active);\n }\n\n paint('decade', this._startDecade, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${this._startDecade.year}`);\n containerClone.innerText = `${this._startDecade.format({\n year: 'numeric',\n })}`;\n\n this._startDecade.manipulate(10, Unit.year);\n });\n }\n}\n","import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport Dates from '../../dates';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates the clock display\n */\nexport default class TimeDisplay {\n private _gridColumns = '';\n private optionsStore: OptionsStore;\n private validation: Validation;\n private dates: Dates;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n }\n\n /**\n * Build the container html for the clock display\n * @private\n */\n getPicker(iconTag: (iconClass: string) => HTMLElement): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.clockContainer);\n\n container.append(...this._grid(iconTag));\n\n return container;\n }\n\n /**\n * Populates the various elements with in the clock display\n * like the current hour and if the manipulation icons are enabled.\n * @private\n */\n _update(widget: HTMLElement): void {\n const timesDiv = (\n widget.getElementsByClassName(Namespace.css.clockContainer)[0]\n );\n let lastPicked = this.dates.lastPicked?.clone;\n if (!lastPicked && this.optionsStore.options.useCurrent)\n lastPicked = this.optionsStore.viewDate.clone;\n\n timesDiv\n .querySelectorAll('.disabled')\n .forEach((element) => element.classList.remove(Namespace.css.disabled));\n\n if (this.optionsStore.options.display.components.hours) {\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(1, Unit.hours),\n Unit.hours\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.incrementHours}]`)\n .classList.add(Namespace.css.disabled);\n }\n\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.hours),\n Unit.hours\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.decrementHours}]`)\n .classList.add(Namespace.css.disabled);\n }\n\n timesDiv.querySelector(\n `[data-time-component=${Unit.hours}]`\n ).innerText = lastPicked\n ? lastPicked.getHoursFormatted(\n this.optionsStore.options.localization.hourCycle\n )\n : '--';\n }\n\n if (this.optionsStore.options.display.components.minutes) {\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(1, Unit.minutes),\n Unit.minutes\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.incrementMinutes}]`)\n .classList.add(Namespace.css.disabled);\n }\n\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.minutes),\n Unit.minutes\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.decrementMinutes}]`)\n .classList.add(Namespace.css.disabled);\n }\n timesDiv.querySelector(\n `[data-time-component=${Unit.minutes}]`\n ).innerText = lastPicked ? lastPicked.minutesFormatted : '--';\n }\n\n if (this.optionsStore.options.display.components.seconds) {\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(1, Unit.seconds),\n Unit.seconds\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.incrementSeconds}]`)\n .classList.add(Namespace.css.disabled);\n }\n\n if (\n !this.validation.isValid(\n this.optionsStore.viewDate.clone.manipulate(-1, Unit.seconds),\n Unit.seconds\n )\n ) {\n timesDiv\n .querySelector(`[data-action=${ActionTypes.decrementSeconds}]`)\n .classList.add(Namespace.css.disabled);\n }\n timesDiv.querySelector(\n `[data-time-component=${Unit.seconds}]`\n ).innerText = lastPicked ? lastPicked.secondsFormatted : '--';\n }\n\n if (this.optionsStore.isTwelveHour) {\n const toggle = timesDiv.querySelector(\n `[data-action=${ActionTypes.toggleMeridiem}]`\n );\n\n const meridiemDate = (lastPicked || this.optionsStore.viewDate).clone;\n\n toggle.innerText = meridiemDate.meridiem();\n\n if (\n !this.validation.isValid(\n meridiemDate.manipulate(\n meridiemDate.hours >= 12 ? -12 : 12,\n Unit.hours\n )\n )\n ) {\n toggle.classList.add(Namespace.css.disabled);\n } else {\n toggle.classList.remove(Namespace.css.disabled);\n }\n }\n\n timesDiv.style.gridTemplateAreas = `\"${this._gridColumns}\"`;\n }\n\n /**\n * Creates the table for the clock display depending on what options are selected.\n * @private\n */\n private _grid(iconTag: (iconClass: string) => HTMLElement): HTMLElement[] {\n this._gridColumns = '';\n const top = [],\n middle = [],\n bottom = [],\n separator = document.createElement('div'),\n upIcon = iconTag(this.optionsStore.options.display.icons.up),\n downIcon = iconTag(this.optionsStore.options.display.icons.down);\n\n separator.classList.add(Namespace.css.separator, Namespace.css.noHighlight);\n const separatorColon = separator.cloneNode(true);\n separatorColon.innerHTML = ':';\n\n const getSeparator = (colon = false): HTMLElement => {\n return colon\n ? separatorColon.cloneNode(true)\n : separator.cloneNode(true);\n };\n\n if (this.optionsStore.options.display.components.hours) {\n let divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.incrementHour\n );\n divElement.setAttribute('data-action', ActionTypes.incrementHours);\n divElement.appendChild(upIcon.cloneNode(true));\n top.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.pickHour\n );\n divElement.setAttribute('data-action', ActionTypes.showHours);\n divElement.setAttribute('data-time-component', Unit.hours);\n middle.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.decrementHour\n );\n divElement.setAttribute('data-action', ActionTypes.decrementHours);\n divElement.appendChild(downIcon.cloneNode(true));\n bottom.push(divElement);\n this._gridColumns += 'a';\n }\n\n if (this.optionsStore.options.display.components.minutes) {\n this._gridColumns += ' a';\n if (this.optionsStore.options.display.components.hours) {\n top.push(getSeparator());\n middle.push(getSeparator(true));\n bottom.push(getSeparator());\n this._gridColumns += ' a';\n }\n let divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.incrementMinute\n );\n divElement.setAttribute('data-action', ActionTypes.incrementMinutes);\n divElement.appendChild(upIcon.cloneNode(true));\n top.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.pickMinute\n );\n divElement.setAttribute('data-action', ActionTypes.showMinutes);\n divElement.setAttribute('data-time-component', Unit.minutes);\n middle.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.decrementMinute\n );\n divElement.setAttribute('data-action', ActionTypes.decrementMinutes);\n divElement.appendChild(downIcon.cloneNode(true));\n bottom.push(divElement);\n }\n\n if (this.optionsStore.options.display.components.seconds) {\n this._gridColumns += ' a';\n if (this.optionsStore.options.display.components.minutes) {\n top.push(getSeparator());\n middle.push(getSeparator(true));\n bottom.push(getSeparator());\n this._gridColumns += ' a';\n }\n let divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.incrementSecond\n );\n divElement.setAttribute('data-action', ActionTypes.incrementSeconds);\n divElement.appendChild(upIcon.cloneNode(true));\n top.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.pickSecond\n );\n divElement.setAttribute('data-action', ActionTypes.showSeconds);\n divElement.setAttribute('data-time-component', Unit.seconds);\n middle.push(divElement);\n\n divElement = document.createElement('div');\n divElement.setAttribute(\n 'title',\n this.optionsStore.options.localization.decrementSecond\n );\n divElement.setAttribute('data-action', ActionTypes.decrementSeconds);\n divElement.appendChild(downIcon.cloneNode(true));\n bottom.push(divElement);\n }\n\n if (this.optionsStore.isTwelveHour) {\n this._gridColumns += ' a';\n let divElement = getSeparator();\n top.push(divElement);\n\n const button = document.createElement('button');\n button.setAttribute(\n 'title',\n this.optionsStore.options.localization.toggleMeridiem\n );\n button.setAttribute('data-action', ActionTypes.toggleMeridiem);\n button.setAttribute('tabindex', '-1');\n if (Namespace.css.toggleMeridiem.includes(',')) {\n //todo move this to paint function?\n button.classList.add(...Namespace.css.toggleMeridiem.split(','));\n } else button.classList.add(Namespace.css.toggleMeridiem);\n\n divElement = document.createElement('div');\n divElement.classList.add(Namespace.css.noHighlight);\n divElement.appendChild(button);\n middle.push(divElement);\n\n divElement = getSeparator();\n bottom.push(divElement);\n }\n\n this._gridColumns = this._gridColumns.trim();\n\n return [...top, ...middle, ...bottom];\n }\n}\n","import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport { Paint } from '../index';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `hours`\n */\nexport default class HourDisplay {\n private optionsStore: OptionsStore;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.validation = serviceLocator.locate(Validation);\n }\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.hourContainer);\n\n for (let i = 0; i < (this.optionsStore.isTwelveHour ? 12 : 24); i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectHour);\n container.appendChild(div);\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint): void {\n const container = widget.getElementsByClassName(\n Namespace.css.hourContainer\n )[0];\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.date);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectHour}\"]`)\n .forEach((containerClone: HTMLElement) => {\n const classes = [];\n classes.push(Namespace.css.hour);\n\n if (!this.validation.isValid(innerDate, Unit.hours)) {\n classes.push(Namespace.css.disabled);\n }\n\n paint(Unit.hours, innerDate, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${innerDate.hours}`);\n containerClone.innerText = innerDate.getHoursFormatted(\n this.optionsStore.options.localization.hourCycle\n );\n innerDate.manipulate(1, Unit.hours);\n });\n }\n}\n","import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport { Paint } from '../index';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `minutes`\n */\nexport default class MinuteDisplay {\n private optionsStore: OptionsStore;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.validation = serviceLocator.locate(Validation);\n }\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.minuteContainer);\n\n const step =\n this.optionsStore.options.stepping === 1\n ? 5\n : this.optionsStore.options.stepping;\n for (let i = 0; i < 60 / step; i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectMinute);\n container.appendChild(div);\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint): void {\n const container = widget.getElementsByClassName(\n Namespace.css.minuteContainer\n )[0];\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.hours);\n const step =\n this.optionsStore.options.stepping === 1\n ? 5\n : this.optionsStore.options.stepping;\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectMinute}\"]`)\n .forEach((containerClone: HTMLElement) => {\n const classes = [];\n classes.push(Namespace.css.minute);\n\n if (!this.validation.isValid(innerDate, Unit.minutes)) {\n classes.push(Namespace.css.disabled);\n }\n\n paint(Unit.minutes, innerDate, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${innerDate.minutes}`);\n containerClone.innerText = innerDate.minutesFormatted;\n innerDate.manipulate(step, Unit.minutes);\n });\n }\n}\n","import { Unit } from '../../datetime';\nimport Namespace from '../../utilities/namespace';\nimport Validation from '../../validation';\nimport { serviceLocator } from '../../utilities/service-locator';\nimport { Paint } from '../index';\nimport ActionTypes from '../../utilities/action-types';\nimport { OptionsStore } from '../../utilities/optionsStore';\n\n/**\n * Creates and updates the grid for `seconds`\n */\nexport default class secondDisplay {\n private optionsStore: OptionsStore;\n private validation: Validation;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.validation = serviceLocator.locate(Validation);\n }\n /**\n * Build the container html for the display\n * @private\n */\n getPicker(): HTMLElement {\n const container = document.createElement('div');\n container.classList.add(Namespace.css.secondContainer);\n\n for (let i = 0; i < 12; i++) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.selectSecond);\n container.appendChild(div);\n }\n\n return container;\n }\n\n /**\n * Populates the grid and updates enabled states\n * @private\n */\n _update(widget: HTMLElement, paint: Paint): void {\n const container = widget.getElementsByClassName(\n Namespace.css.secondContainer\n )[0];\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.minutes);\n\n container\n .querySelectorAll(`[data-action=\"${ActionTypes.selectSecond}\"]`)\n .forEach((containerClone: HTMLElement) => {\n const classes = [];\n classes.push(Namespace.css.second);\n\n if (!this.validation.isValid(innerDate, Unit.seconds)) {\n classes.push(Namespace.css.disabled);\n }\n\n paint(Unit.seconds, innerDate, classes, containerClone);\n\n containerClone.classList.remove(...containerClone.classList);\n containerClone.classList.add(...classes);\n containerClone.setAttribute('data-value', `${innerDate.seconds}`);\n containerClone.innerText = innerDate.secondsFormatted;\n innerDate.manipulate(5, Unit.seconds);\n });\n }\n}\n","import Namespace from '../utilities/namespace';\n\n/**\n * Provides a collapse functionality to the view changes\n */\nexport default class Collapse {\n /**\n * Flips the show/hide state of `target`\n * @param target html element to affect.\n */\n static toggle(target: HTMLElement) {\n if (target.classList.contains(Namespace.css.show)) {\n this.hide(target);\n } else {\n this.show(target);\n }\n }\n\n /**\n * Skips any animation or timeouts and immediately set the element to show.\n * @param target\n */\n static showImmediately(target: HTMLElement) {\n target.classList.remove(Namespace.css.collapsing);\n target.classList.add(Namespace.css.collapse, Namespace.css.show);\n target.style.height = '';\n }\n\n /**\n * If `target` is not already showing, then show after the animation.\n * @param target\n */\n static show(target: HTMLElement) {\n if (\n target.classList.contains(Namespace.css.collapsing) ||\n target.classList.contains(Namespace.css.show)\n )\n return;\n\n let timeOut = null;\n const complete = () => {\n Collapse.showImmediately(target);\n timeOut = null;\n };\n\n target.style.height = '0';\n target.classList.remove(Namespace.css.collapse);\n target.classList.add(Namespace.css.collapsing);\n\n //eslint-disable-next-line @typescript-eslint/no-unused-vars\n timeOut = setTimeout(\n complete,\n this.getTransitionDurationFromElement(target)\n );\n target.style.height = `${target.scrollHeight}px`;\n }\n\n /**\n * Skips any animation or timeouts and immediately set the element to hide.\n * @param target\n */\n static hideImmediately(target: HTMLElement) {\n if (!target) return;\n target.classList.remove(Namespace.css.collapsing, Namespace.css.show);\n target.classList.add(Namespace.css.collapse);\n }\n\n /**\n * If `target` is not already hidden, then hide after the animation.\n * @param target HTML Element\n */\n static hide(target: HTMLElement) {\n if (\n target.classList.contains(Namespace.css.collapsing) ||\n !target.classList.contains(Namespace.css.show)\n )\n return;\n\n let timeOut = null;\n const complete = () => {\n Collapse.hideImmediately(target);\n timeOut = null;\n };\n\n target.style.height = `${target.getBoundingClientRect()['height']}px`;\n\n const reflow = (element) => element.offsetHeight;\n\n reflow(target);\n\n target.classList.remove(Namespace.css.collapse, Namespace.css.show);\n target.classList.add(Namespace.css.collapsing);\n target.style.height = '';\n\n //eslint-disable-next-line @typescript-eslint/no-unused-vars\n timeOut = setTimeout(\n complete,\n this.getTransitionDurationFromElement(target)\n );\n }\n\n /**\n * Gets the transition duration from the `element` by getting css properties\n * `transition-duration` and `transition-delay`\n * @param element HTML Element\n */\n private static getTransitionDurationFromElement = (element: HTMLElement) => {\n if (!element) {\n return 0;\n }\n\n // Get transition-duration of the element\n let { transitionDuration, transitionDelay } =\n window.getComputedStyle(element);\n\n const floatTransitionDuration = Number.parseFloat(transitionDuration);\n const floatTransitionDelay = Number.parseFloat(transitionDelay);\n\n // Return 0 if element or transition duration is not found\n if (!floatTransitionDuration && !floatTransitionDelay) {\n return 0;\n }\n\n // If multiple durations are defined, take the first\n transitionDuration = transitionDuration.split(',')[0];\n transitionDelay = transitionDelay.split(',')[0];\n\n return (\n (Number.parseFloat(transitionDuration) +\n Number.parseFloat(transitionDelay)) *\n 1000\n );\n };\n}\n","import DateDisplay from './calendar/date-display';\nimport MonthDisplay from './calendar/month-display';\nimport YearDisplay from './calendar/year-display';\nimport DecadeDisplay from './calendar/decade-display';\nimport TimeDisplay from './time/time-display';\nimport HourDisplay from './time/hour-display';\nimport MinuteDisplay from './time/minute-display';\nimport SecondDisplay from './time/second-display';\nimport { DateTime, Unit } from '../datetime';\nimport Namespace from '../utilities/namespace';\nimport { HideEvent } from '../utilities/event-types';\nimport Collapse from './collapse';\nimport Validation from '../validation';\nimport Dates from '../dates';\nimport { EventEmitters, ViewUpdateValues } from '../utilities/event-emitter';\nimport { serviceLocator } from '../utilities/service-locator';\nimport ActionTypes from '../utilities/action-types';\nimport CalendarModes from '../utilities/calendar-modes';\nimport { OptionsStore } from '../utilities/optionsStore';\n\n/**\n * Main class for all things display related.\n */\nexport default class Display {\n private _widget: HTMLElement;\n private _popperInstance: any; // eslint-disable-line @typescript-eslint/no-explicit-any\n private _isVisible = false;\n private optionsStore: OptionsStore;\n private validation: Validation;\n private dates: Dates;\n\n dateDisplay: DateDisplay;\n monthDisplay: MonthDisplay;\n yearDisplay: YearDisplay;\n decadeDisplay: DecadeDisplay;\n timeDisplay: TimeDisplay;\n hourDisplay: HourDisplay;\n minuteDisplay: MinuteDisplay;\n secondDisplay: SecondDisplay;\n private _eventEmitters: EventEmitters;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.validation = serviceLocator.locate(Validation);\n this.dates = serviceLocator.locate(Dates);\n\n this.dateDisplay = serviceLocator.locate(DateDisplay);\n this.monthDisplay = serviceLocator.locate(MonthDisplay);\n this.yearDisplay = serviceLocator.locate(YearDisplay);\n this.decadeDisplay = serviceLocator.locate(DecadeDisplay);\n this.timeDisplay = serviceLocator.locate(TimeDisplay);\n this.hourDisplay = serviceLocator.locate(HourDisplay);\n this.minuteDisplay = serviceLocator.locate(MinuteDisplay);\n this.secondDisplay = serviceLocator.locate(SecondDisplay);\n this._eventEmitters = serviceLocator.locate(EventEmitters);\n this._widget = undefined;\n\n this._eventEmitters.updateDisplay.subscribe((result: ViewUpdateValues) => {\n this._update(result);\n });\n }\n\n /**\n * Returns the widget body or undefined\n * @private\n */\n get widget(): HTMLElement | undefined {\n return this._widget;\n }\n\n get dateContainer(): HTMLElement | undefined {\n return this.widget?.querySelector(`div.${Namespace.css.dateContainer}`);\n }\n\n get timeContainer(): HTMLElement | undefined {\n return this.widget?.querySelector(`div.${Namespace.css.timeContainer}`);\n }\n\n /**\n * Returns this visible state of the picker (shown)\n */\n get isVisible() {\n return this._isVisible;\n }\n\n /**\n * Updates the table for a particular unit. Used when an option as changed or\n * whenever the class list might need to be refreshed.\n * @param unit\n * @private\n */\n _update(unit: ViewUpdateValues): void {\n if (!this.widget) return;\n //todo do I want some kind of error catching or other guards here?\n switch (unit) {\n case Unit.seconds:\n this.secondDisplay._update(this.widget, this.paint);\n break;\n case Unit.minutes:\n this.minuteDisplay._update(this.widget, this.paint);\n break;\n case Unit.hours:\n this.hourDisplay._update(this.widget, this.paint);\n break;\n case Unit.date:\n this.dateDisplay._update(this.widget, this.paint);\n break;\n case Unit.month:\n this.monthDisplay._update(this.widget, this.paint);\n break;\n case Unit.year:\n this.yearDisplay._update(this.widget, this.paint);\n break;\n case 'clock':\n if (!this._hasTime) break;\n this.timeDisplay._update(this.widget);\n this._update(Unit.hours);\n this._update(Unit.minutes);\n this._update(Unit.seconds);\n break;\n case 'calendar':\n this._update(Unit.date);\n this._update(Unit.year);\n this._update(Unit.month);\n this.decadeDisplay._update(this.widget, this.paint);\n this._updateCalendarHeader();\n break;\n case 'all':\n if (this._hasTime) {\n this._update('clock');\n }\n if (this._hasDate) {\n this._update('calendar');\n }\n }\n }\n\n // noinspection JSUnusedLocalSymbols\n /**\n * Allows developers to add/remove classes from an element.\n * @param _unit\n * @param _date\n * @param _classes\n * @param _element\n */\n\n /* eslint-disable @typescript-eslint/no-unused-vars */\n paint(\n _unit: Unit | 'decade',\n _date: DateTime,\n _classes: string[],\n _element: HTMLElement\n ) {\n // implemented in plugin\n }\n\n /**\n * Shows the picker and creates a Popper instance if needed.\n * Add document click event to hide when clicking outside the picker.\n * fires Events#show\n */\n show(): void {\n if (this.widget == undefined) {\n this._showSetDefaultIfNeeded();\n\n this._buildWidget();\n this._updateTheme();\n\n this._showSetupViewMode();\n\n if (!this.optionsStore.options.display.inline) {\n // If needed to change the parent container\n const container = this.optionsStore.options?.container || document.body;\n const placement =\n this.optionsStore.options?.display?.placement || 'bottom';\n\n container.appendChild(this.widget);\n this.createPopup(this.optionsStore.element, this.widget, {\n modifiers: [{ name: 'eventListeners', enabled: true }],\n //#2400\n placement:\n document.documentElement.dir === 'rtl'\n ? `${placement}-end`\n : `${placement}-start`,\n }).then();\n } else {\n this.optionsStore.element.appendChild(this.widget);\n }\n\n if (this.optionsStore.options.display.viewMode == 'clock') {\n this._eventEmitters.action.emit({\n e: null,\n action: ActionTypes.showClock,\n });\n }\n\n this.widget\n .querySelectorAll('[data-action]')\n .forEach((element) =>\n element.addEventListener('click', this._actionsClickEvent)\n );\n\n // show the clock when using sideBySide\n if (this._hasTime && this.optionsStore.options.display.sideBySide) {\n this.timeDisplay._update(this.widget);\n (\n this.widget.getElementsByClassName(\n Namespace.css.clockContainer\n )[0] as HTMLElement\n ).style.display = 'grid';\n }\n }\n\n this.widget.classList.add(Namespace.css.show);\n if (!this.optionsStore.options.display.inline) {\n this.updatePopup();\n document.addEventListener('click', this._documentClickEvent);\n }\n this._eventEmitters.triggerEvent.emit({ type: Namespace.events.show });\n this._isVisible = true;\n }\n\n private _showSetupViewMode() {\n // If modeView is only clock\n const onlyClock = this._hasTime && !this._hasDate;\n\n // reset the view to the clock if there's no date components\n if (onlyClock) {\n this.optionsStore.currentView = 'clock';\n this._eventEmitters.action.emit({\n e: null,\n action: ActionTypes.showClock,\n });\n }\n // otherwise return to the calendar view\n else if (!this.optionsStore.currentCalendarViewMode) {\n this.optionsStore.currentCalendarViewMode =\n this.optionsStore.minimumCalendarViewMode;\n }\n\n if (!onlyClock && this.optionsStore.options.display.viewMode !== 'clock') {\n if (this._hasTime) {\n if (!this.optionsStore.options.display.sideBySide) {\n Collapse.hideImmediately(this.timeContainer);\n } else {\n Collapse.show(this.timeContainer);\n }\n }\n Collapse.show(this.dateContainer);\n }\n\n if (this._hasDate) {\n this._showMode();\n }\n }\n\n private _showSetDefaultIfNeeded() {\n if (this.dates.picked.length != 0) return;\n\n if (\n this.optionsStore.options.useCurrent &&\n !this.optionsStore.options.defaultDate\n ) {\n const date = new DateTime().setLocalization(\n this.optionsStore.options.localization\n );\n if (!this.optionsStore.options.keepInvalid) {\n let tries = 0;\n let direction = 1;\n if (this.optionsStore.options.restrictions.maxDate?.isBefore(date)) {\n direction = -1;\n }\n while (!this.validation.isValid(date) && tries > 31) {\n date.manipulate(direction, Unit.date);\n tries++;\n }\n }\n this.dates.setValue(date);\n }\n\n if (this.optionsStore.options.defaultDate) {\n this.dates.setValue(this.optionsStore.options.defaultDate);\n }\n }\n\n async createPopup(\n element: HTMLElement,\n widget: HTMLElement,\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n options: any\n ): Promise {\n let createPopperFunction;\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((window as any)?.Popper) {\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n createPopperFunction = (window as any)?.Popper?.createPopper;\n } else {\n const { createPopper } = await import('@popperjs/core');\n createPopperFunction = createPopper;\n }\n if (createPopperFunction) {\n this._popperInstance = createPopperFunction(element, widget, options);\n }\n }\n\n updatePopup(): void {\n this._popperInstance?.update();\n }\n\n /**\n * Changes the calendar view mode. E.g. month <-> year\n * @param direction -/+ number to move currentViewMode\n * @private\n */\n _showMode(direction?: number): void {\n if (!this.widget) {\n return;\n }\n if (direction) {\n const max = Math.max(\n this.optionsStore.minimumCalendarViewMode,\n Math.min(3, this.optionsStore.currentCalendarViewMode + direction)\n );\n if (this.optionsStore.currentCalendarViewMode == max) return;\n this.optionsStore.currentCalendarViewMode = max;\n }\n\n this.widget\n .querySelectorAll(\n `.${Namespace.css.dateContainer} > div:not(.${Namespace.css.calendarHeader}), .${Namespace.css.timeContainer} > div:not(.${Namespace.css.clockContainer})`\n )\n .forEach((e: HTMLElement) => (e.style.display = 'none'));\n\n const datePickerMode =\n CalendarModes[this.optionsStore.currentCalendarViewMode];\n const picker: HTMLElement = this.widget.querySelector(\n `.${datePickerMode.className}`\n );\n\n switch (datePickerMode.className) {\n case Namespace.css.decadesContainer:\n this.decadeDisplay._update(this.widget, this.paint);\n break;\n case Namespace.css.yearsContainer:\n this.yearDisplay._update(this.widget, this.paint);\n break;\n case Namespace.css.monthsContainer:\n this.monthDisplay._update(this.widget, this.paint);\n break;\n case Namespace.css.daysContainer:\n this.dateDisplay._update(this.widget, this.paint);\n break;\n }\n\n picker.style.display = 'grid';\n\n if (this.optionsStore.options.display.sideBySide)\n ((\n this.widget.querySelectorAll(`.${Namespace.css.clockContainer}`)[0]\n )).style.display = 'grid';\n\n this._updateCalendarHeader();\n this._eventEmitters.viewUpdate.emit();\n }\n\n /**\n * Changes the theme. E.g. light, dark or auto\n * @param theme the theme name\n * @private\n */\n _updateTheme(theme?: 'light' | 'dark' | 'auto'): void {\n if (!this.widget) {\n return;\n }\n if (theme) {\n if (this.optionsStore.options.display.theme === theme) return;\n this.optionsStore.options.display.theme = theme;\n }\n\n this.widget.classList.remove('light', 'dark');\n this.widget.classList.add(this._getThemeClass());\n\n if (this.optionsStore.options.display.theme === 'auto') {\n window\n .matchMedia(Namespace.css.isDarkPreferredQuery)\n .addEventListener('change', () => this._updateTheme());\n } else {\n window\n .matchMedia(Namespace.css.isDarkPreferredQuery)\n .removeEventListener('change', () => this._updateTheme());\n }\n }\n\n _getThemeClass(): string {\n const currentTheme = this.optionsStore.options.display.theme || 'auto';\n\n const isDarkMode =\n window.matchMedia &&\n window.matchMedia(Namespace.css.isDarkPreferredQuery).matches;\n\n switch (currentTheme) {\n case 'light':\n return Namespace.css.lightTheme;\n case 'dark':\n return Namespace.css.darkTheme;\n case 'auto':\n return isDarkMode ? Namespace.css.darkTheme : Namespace.css.lightTheme;\n }\n }\n\n _updateCalendarHeader() {\n if (!this._hasDate) return;\n const showing = [\n ...this.widget.querySelector(\n `.${Namespace.css.dateContainer} div[style*=\"display: grid\"]`\n ).classList,\n ].find((x) => x.startsWith(Namespace.css.dateContainer));\n\n const [previous, switcher, next] = this.widget\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\n .getElementsByTagName('div');\n\n switch (showing) {\n case Namespace.css.decadesContainer:\n previous.setAttribute(\n 'title',\n this.optionsStore.options.localization.previousCentury\n );\n switcher.setAttribute('title', '');\n next.setAttribute(\n 'title',\n this.optionsStore.options.localization.nextCentury\n );\n break;\n case Namespace.css.yearsContainer:\n previous.setAttribute(\n 'title',\n this.optionsStore.options.localization.previousDecade\n );\n switcher.setAttribute(\n 'title',\n this.optionsStore.options.localization.selectDecade\n );\n next.setAttribute(\n 'title',\n this.optionsStore.options.localization.nextDecade\n );\n break;\n case Namespace.css.monthsContainer:\n previous.setAttribute(\n 'title',\n this.optionsStore.options.localization.previousYear\n );\n switcher.setAttribute(\n 'title',\n this.optionsStore.options.localization.selectYear\n );\n next.setAttribute(\n 'title',\n this.optionsStore.options.localization.nextYear\n );\n break;\n case Namespace.css.daysContainer:\n previous.setAttribute(\n 'title',\n this.optionsStore.options.localization.previousMonth\n );\n switcher.setAttribute(\n 'title',\n this.optionsStore.options.localization.selectMonth\n );\n next.setAttribute(\n 'title',\n this.optionsStore.options.localization.nextMonth\n );\n switcher.setAttribute(\n showing,\n this.optionsStore.viewDate.format(\n this.optionsStore.options.localization.dayViewHeaderFormat\n )\n );\n break;\n }\n switcher.innerText = switcher.getAttribute(showing);\n }\n\n /**\n * Hides the picker if needed.\n * Remove document click event to hide when clicking outside the picker.\n * fires Events#hide\n */\n hide(): void {\n if (!this.widget || !this._isVisible) return;\n\n this.widget.classList.remove(Namespace.css.show);\n\n if (this._isVisible) {\n this._eventEmitters.triggerEvent.emit({\n type: Namespace.events.hide,\n date: this.optionsStore.unset ? null : this.dates.lastPicked?.clone,\n } as HideEvent);\n this._isVisible = false;\n }\n\n document.removeEventListener('click', this._documentClickEvent);\n }\n\n /**\n * Toggles the picker's open state. Fires a show/hide event depending.\n */\n toggle() {\n return this._isVisible ? this.hide() : this.show();\n }\n\n /**\n * Removes document and data-action click listener and reset the widget\n * @private\n */\n _dispose() {\n document.removeEventListener('click', this._documentClickEvent);\n if (!this.widget) return;\n this.widget\n .querySelectorAll('[data-action]')\n .forEach((element) =>\n element.removeEventListener('click', this._actionsClickEvent)\n );\n this.widget.parentNode.removeChild(this.widget);\n this._widget = undefined;\n }\n\n /**\n * Builds the widgets html template.\n * @private\n */\n private _buildWidget(): HTMLElement {\n const template = document.createElement('div');\n template.classList.add(Namespace.css.widget);\n\n const dateView = document.createElement('div');\n dateView.classList.add(Namespace.css.dateContainer);\n dateView.append(\n this.getHeadTemplate(),\n this.decadeDisplay.getPicker(),\n this.yearDisplay.getPicker(),\n this.monthDisplay.getPicker(),\n this.dateDisplay.getPicker()\n );\n\n const timeView = document.createElement('div');\n timeView.classList.add(Namespace.css.timeContainer);\n timeView.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this)));\n timeView.appendChild(this.hourDisplay.getPicker());\n timeView.appendChild(this.minuteDisplay.getPicker());\n timeView.appendChild(this.secondDisplay.getPicker());\n\n const toolbar = document.createElement('div');\n toolbar.classList.add(Namespace.css.toolbar);\n toolbar.append(...this.getToolbarElements());\n\n if (this.optionsStore.options.display.inline) {\n template.classList.add(Namespace.css.inline);\n }\n\n if (this.optionsStore.options.display.calendarWeeks) {\n template.classList.add('calendarWeeks');\n }\n\n if (this.optionsStore.options.display.sideBySide && this._hasDateAndTime) {\n this._buildWidgetSideBySide(template, dateView, timeView, toolbar);\n return;\n }\n\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\n template.appendChild(toolbar);\n }\n\n const setupComponentView = (hasFirst, hasSecond, element, shouldShow) => {\n if (!hasFirst) return;\n if (hasSecond) {\n element.classList.add(Namespace.css.collapse);\n if (shouldShow) element.classList.add(Namespace.css.show);\n }\n template.appendChild(element);\n };\n\n setupComponentView(\n this._hasDate,\n this._hasTime,\n dateView,\n this.optionsStore.options.display.viewMode !== 'clock'\n );\n\n setupComponentView(\n this._hasTime,\n this._hasDate,\n timeView,\n this.optionsStore.options.display.viewMode === 'clock'\n );\n\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\n template.appendChild(toolbar);\n }\n\n const arrow = document.createElement('div');\n arrow.classList.add('arrow');\n arrow.setAttribute('data-popper-arrow', '');\n template.appendChild(arrow);\n\n this._widget = template;\n }\n\n private _buildWidgetSideBySide(\n template: HTMLDivElement,\n dateView: HTMLDivElement,\n timeView: HTMLDivElement,\n toolbar: HTMLDivElement\n ) {\n template.classList.add(Namespace.css.sideBySide);\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\n template.appendChild(toolbar);\n }\n const row = document.createElement('div');\n row.classList.add('td-row');\n dateView.classList.add('td-half');\n timeView.classList.add('td-half');\n\n row.appendChild(dateView);\n row.appendChild(timeView);\n template.appendChild(row);\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\n template.appendChild(toolbar);\n }\n this._widget = template;\n }\n\n /**\n * Returns true if the hours, minutes, or seconds component is turned on\n */\n get _hasTime(): boolean {\n return (\n this.optionsStore.options.display.components.clock &&\n (this.optionsStore.options.display.components.hours ||\n this.optionsStore.options.display.components.minutes ||\n this.optionsStore.options.display.components.seconds)\n );\n }\n\n /**\n * Returns true if the year, month, or date component is turned on\n */\n get _hasDate(): boolean {\n return (\n this.optionsStore.options.display.components.calendar &&\n (this.optionsStore.options.display.components.year ||\n this.optionsStore.options.display.components.month ||\n this.optionsStore.options.display.components.date)\n );\n }\n\n get _hasDateAndTime(): boolean {\n return this._hasDate && this._hasTime;\n }\n\n /**\n * Get the toolbar html based on options like buttons => today\n * @private\n */\n getToolbarElements(): HTMLElement[] {\n const toolbar = [];\n\n if (this.optionsStore.options.display.buttons.today) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.today);\n div.setAttribute('title', this.optionsStore.options.localization.today);\n\n div.appendChild(\n this._iconTag(this.optionsStore.options.display.icons.today)\n );\n toolbar.push(div);\n }\n if (\n !this.optionsStore.options.display.sideBySide &&\n this._hasDate &&\n this._hasTime\n ) {\n let title, icon;\n if (this.optionsStore.options.display.viewMode === 'clock') {\n title = this.optionsStore.options.localization.selectDate;\n icon = this.optionsStore.options.display.icons.date;\n } else {\n title = this.optionsStore.options.localization.selectTime;\n icon = this.optionsStore.options.display.icons.time;\n }\n\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.togglePicker);\n div.setAttribute('title', title);\n\n div.appendChild(this._iconTag(icon));\n toolbar.push(div);\n }\n if (this.optionsStore.options.display.buttons.clear) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.clear);\n div.setAttribute('title', this.optionsStore.options.localization.clear);\n\n div.appendChild(\n this._iconTag(this.optionsStore.options.display.icons.clear)\n );\n toolbar.push(div);\n }\n if (this.optionsStore.options.display.buttons.close) {\n const div = document.createElement('div');\n div.setAttribute('data-action', ActionTypes.close);\n div.setAttribute('title', this.optionsStore.options.localization.close);\n\n div.appendChild(\n this._iconTag(this.optionsStore.options.display.icons.close)\n );\n toolbar.push(div);\n }\n\n return toolbar;\n }\n\n /***\n * Builds the base header template with next and previous icons\n * @private\n */\n getHeadTemplate(): HTMLElement {\n const calendarHeader = document.createElement('div');\n calendarHeader.classList.add(Namespace.css.calendarHeader);\n\n const previous = document.createElement('div');\n previous.classList.add(Namespace.css.previous);\n previous.setAttribute('data-action', ActionTypes.previous);\n previous.appendChild(\n this._iconTag(this.optionsStore.options.display.icons.previous)\n );\n\n const switcher = document.createElement('div');\n switcher.classList.add(Namespace.css.switch);\n switcher.setAttribute('data-action', ActionTypes.changeCalendarView);\n\n const next = document.createElement('div');\n next.classList.add(Namespace.css.next);\n next.setAttribute('data-action', ActionTypes.next);\n next.appendChild(\n this._iconTag(this.optionsStore.options.display.icons.next)\n );\n\n calendarHeader.append(previous, switcher, next);\n return calendarHeader;\n }\n\n /**\n * Builds an icon tag as either an ``\n * or with icons => type is `sprites` then a svg tag instead\n * @param iconClass\n * @private\n */\n _iconTag(iconClass: string): HTMLElement | SVGElement {\n if (this.optionsStore.options.display.icons.type === 'sprites') {\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n\n const icon = document.createElementNS(\n 'http://www.w3.org/2000/svg',\n 'use'\n );\n icon.setAttribute('xlink:href', iconClass); // Deprecated. Included for backward compatibility\n icon.setAttribute('href', iconClass);\n svg.appendChild(icon);\n\n return svg;\n }\n const icon = document.createElement('i');\n icon.classList.add(...iconClass.split(' '));\n return icon;\n }\n\n /**\n * A document click event to hide the widget if click is outside\n * @private\n * @param e MouseEvent\n */\n private _documentClickEvent = (e: MouseEvent) => {\n if (this.optionsStore.options.debug || (window as any).debug) return; //eslint-disable-line @typescript-eslint/no-explicit-any\n\n if (\n this._isVisible &&\n !e.composedPath().includes(this.widget) && // click inside the widget\n !e.composedPath()?.includes(this.optionsStore.element) // click on the element\n ) {\n this.hide();\n }\n };\n\n /**\n * Click event for any action like selecting a date\n * @param e MouseEvent\n * @private\n */\n private _actionsClickEvent = (e: MouseEvent) => {\n this._eventEmitters.action.emit({ e: e });\n };\n\n /**\n * Causes the widget to get rebuilt on next show. If the picker is already open\n * then hide and reshow it.\n * @private\n */\n _rebuild() {\n const wasVisible = this._isVisible;\n this._dispose();\n if (wasVisible) this.show();\n }\n}\n\nexport type Paint = (\n unit: Unit | 'decade',\n innerDate: DateTime,\n classes: string[],\n element: HTMLElement\n) => void;\n","import { DateTime, Unit } from './datetime';\nimport Collapse from './display/collapse';\nimport Namespace from './utilities/namespace';\nimport Dates from './dates';\nimport Validation from './validation';\nimport Display from './display';\nimport { EventEmitters } from './utilities/event-emitter';\nimport { serviceLocator } from './utilities/service-locator.js';\nimport ActionTypes from './utilities/action-types';\nimport CalendarModes from './utilities/calendar-modes';\nimport { OptionsStore } from './utilities/optionsStore';\n\n/**\n * Logic for various click actions\n */\nexport default class Actions {\n private optionsStore: OptionsStore;\n private validation: Validation;\n private dates: Dates;\n private display: Display;\n private _eventEmitters: EventEmitters;\n\n constructor() {\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.dates = serviceLocator.locate(Dates);\n this.validation = serviceLocator.locate(Validation);\n this.display = serviceLocator.locate(Display);\n this._eventEmitters = serviceLocator.locate(EventEmitters);\n\n this._eventEmitters.action.subscribe((result) => {\n this.do(result.e, result.action);\n });\n }\n\n /**\n * Performs the selected `action`. See ActionTypes\n * @param e This is normally a click event\n * @param action If not provided, then look for a [data-action]\n */\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n do(e: any, action?: ActionTypes) {\n const currentTarget = e?.currentTarget as HTMLElement;\n if (currentTarget?.classList?.contains(Namespace.css.disabled)) return;\n action = action || (currentTarget?.dataset?.action as ActionTypes);\n const lastPicked = (this.dates.lastPicked || this.optionsStore.viewDate)\n .clone;\n\n switch (action) {\n case ActionTypes.next:\n case ActionTypes.previous:\n this.handleNextPrevious(action);\n break;\n case ActionTypes.changeCalendarView:\n this.display._showMode(1);\n this.display._updateCalendarHeader();\n break;\n case ActionTypes.selectMonth:\n case ActionTypes.selectYear:\n case ActionTypes.selectDecade:\n this.handleSelectCalendarMode(action, currentTarget);\n break;\n case ActionTypes.selectDay:\n this.handleSelectDay(currentTarget);\n break;\n case ActionTypes.selectHour: {\n let hour = +currentTarget.dataset.value;\n if (lastPicked.hours >= 12 && this.optionsStore.isTwelveHour)\n hour += 12;\n lastPicked.hours = hour;\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\n this.hideOrClock(e);\n break;\n }\n case ActionTypes.selectMinute: {\n lastPicked.minutes = +currentTarget.dataset.value;\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\n this.hideOrClock(e);\n break;\n }\n case ActionTypes.selectSecond: {\n lastPicked.seconds = +currentTarget.dataset.value;\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\n this.hideOrClock(e);\n break;\n }\n case ActionTypes.incrementHours:\n this.manipulateAndSet(lastPicked, Unit.hours);\n break;\n case ActionTypes.incrementMinutes:\n this.manipulateAndSet(\n lastPicked,\n Unit.minutes,\n this.optionsStore.options.stepping\n );\n break;\n case ActionTypes.incrementSeconds:\n this.manipulateAndSet(lastPicked, Unit.seconds);\n break;\n case ActionTypes.decrementHours:\n this.manipulateAndSet(lastPicked, Unit.hours, -1);\n break;\n case ActionTypes.decrementMinutes:\n this.manipulateAndSet(\n lastPicked,\n Unit.minutes,\n this.optionsStore.options.stepping * -1\n );\n break;\n case ActionTypes.decrementSeconds:\n this.manipulateAndSet(lastPicked, Unit.seconds, -1);\n break;\n case ActionTypes.toggleMeridiem:\n this.manipulateAndSet(\n lastPicked,\n Unit.hours,\n this.dates.lastPicked.hours >= 12 ? -12 : 12\n );\n break;\n case ActionTypes.togglePicker:\n this.handleToggle(currentTarget);\n break;\n case ActionTypes.showClock:\n case ActionTypes.showHours:\n case ActionTypes.showMinutes:\n case ActionTypes.showSeconds:\n //make sure the clock is actually displaying\n if (\n !this.optionsStore.options.display.sideBySide &&\n this.optionsStore.currentView !== 'clock'\n ) {\n //hide calendar\n Collapse.hideImmediately(this.display.dateContainer);\n //show clock\n Collapse.showImmediately(this.display.timeContainer);\n }\n this.handleShowClockContainers(action);\n break;\n case ActionTypes.clear:\n this.dates.setValue(null);\n this.display._updateCalendarHeader();\n break;\n case ActionTypes.close:\n this.display.hide();\n break;\n case ActionTypes.today: {\n const today = new DateTime().setLocalization(\n this.optionsStore.options.localization\n );\n this._eventEmitters.updateViewDate.emit(today);\n\n //todo this this really a good idea?\n if (this.validation.isValid(today, Unit.date))\n this.dates.setValue(today, this.dates.lastPickedIndex);\n break;\n }\n }\n }\n\n private handleShowClockContainers(action: ActionTypes) {\n if (!this.display._hasTime) {\n Namespace.errorMessages.throwError(\n 'Cannot show clock containers when time is disabled.'\n );\n /* ignore coverage: should never happen */\n return;\n }\n\n this.optionsStore.currentView = 'clock';\n this.display.widget\n .querySelectorAll(`.${Namespace.css.timeContainer} > div`)\n .forEach(\n (htmlElement: HTMLElement) => (htmlElement.style.display = 'none')\n );\n\n let classToUse = '';\n switch (action) {\n case ActionTypes.showClock:\n classToUse = Namespace.css.clockContainer;\n this.display._update('clock');\n break;\n case ActionTypes.showHours:\n classToUse = Namespace.css.hourContainer;\n this.display._update(Unit.hours);\n break;\n case ActionTypes.showMinutes:\n classToUse = Namespace.css.minuteContainer;\n this.display._update(Unit.minutes);\n break;\n case ActionTypes.showSeconds:\n classToUse = Namespace.css.secondContainer;\n this.display._update(Unit.seconds);\n break;\n }\n\n ((\n this.display.widget.getElementsByClassName(classToUse)[0]\n )).style.display = 'grid';\n }\n\n private handleNextPrevious(action: ActionTypes) {\n const { unit, step } =\n CalendarModes[this.optionsStore.currentCalendarViewMode];\n if (action === ActionTypes.next)\n this.optionsStore.viewDate.manipulate(step, unit);\n else this.optionsStore.viewDate.manipulate(step * -1, unit);\n this._eventEmitters.viewUpdate.emit();\n\n this.display._showMode();\n }\n\n /**\n * After setting the value it will either show the clock or hide the widget.\n * @param e\n */\n private hideOrClock(e) {\n if (\n !this.optionsStore.isTwelveHour &&\n !this.optionsStore.options.display.components.minutes &&\n !this.optionsStore.options.display.keepOpen &&\n !this.optionsStore.options.display.inline\n ) {\n this.display.hide();\n } else {\n this.do(e, ActionTypes.showClock);\n }\n }\n\n /**\n * Common function to manipulate {@link lastPicked} by `unit`.\n * @param lastPicked\n * @param unit\n * @param value Value to change by\n */\n private manipulateAndSet(lastPicked: DateTime, unit: Unit, value = 1) {\n const newDate = lastPicked.manipulate(value, unit);\n if (this.validation.isValid(newDate, unit)) {\n this.dates.setValue(newDate, this.dates.lastPickedIndex);\n }\n }\n\n private handleSelectCalendarMode(\n action:\n | ActionTypes.selectMonth\n | ActionTypes.selectYear\n | ActionTypes.selectDecade,\n currentTarget: HTMLElement\n ) {\n const value = +currentTarget.dataset.value;\n switch (action) {\n case ActionTypes.selectMonth:\n this.optionsStore.viewDate.month = value;\n break;\n case ActionTypes.selectYear:\n case ActionTypes.selectDecade:\n this.optionsStore.viewDate.year = value;\n break;\n }\n\n if (\n this.optionsStore.currentCalendarViewMode ===\n this.optionsStore.minimumCalendarViewMode\n ) {\n this.dates.setValue(\n this.optionsStore.viewDate,\n this.dates.lastPickedIndex\n );\n if (!this.optionsStore.options.display.inline) {\n this.display.hide();\n }\n } else {\n this.display._showMode(-1);\n }\n }\n\n private handleToggle(currentTarget: HTMLElement) {\n if (\n currentTarget.getAttribute('title') ===\n this.optionsStore.options.localization.selectDate\n ) {\n currentTarget.setAttribute(\n 'title',\n this.optionsStore.options.localization.selectTime\n );\n currentTarget.innerHTML = this.display._iconTag(\n this.optionsStore.options.display.icons.time\n ).outerHTML;\n\n this.display._updateCalendarHeader();\n this.optionsStore.refreshCurrentView();\n } else {\n currentTarget.setAttribute(\n 'title',\n this.optionsStore.options.localization.selectDate\n );\n currentTarget.innerHTML = this.display._iconTag(\n this.optionsStore.options.display.icons.date\n ).outerHTML;\n if (this.display._hasTime) {\n this.handleShowClockContainers(ActionTypes.showClock);\n this.display._update('clock');\n }\n }\n\n this.display.widget\n .querySelectorAll(\n `.${Namespace.css.dateContainer}, .${Namespace.css.timeContainer}`\n )\n .forEach((htmlElement: HTMLElement) => Collapse.toggle(htmlElement));\n this._eventEmitters.viewUpdate.emit();\n }\n\n private handleSelectDay(currentTarget: HTMLElement) {\n const day = this.optionsStore.viewDate.clone;\n if (currentTarget.classList.contains(Namespace.css.old)) {\n day.manipulate(-1, Unit.month);\n }\n if (currentTarget.classList.contains(Namespace.css.new)) {\n day.manipulate(1, Unit.month);\n }\n\n day.date = +currentTarget.dataset.day;\n if (this.optionsStore.options.dateRange) this.handleDateRange(day);\n else if (this.optionsStore.options.multipleDates) {\n this.handleMultiDate(day);\n } else {\n this.dates.setValue(day, this.dates.lastPickedIndex);\n }\n\n if (\n !this.display._hasTime &&\n !this.optionsStore.options.display.keepOpen &&\n !this.optionsStore.options.display.inline &&\n !this.optionsStore.options.multipleDates &&\n !this.optionsStore.options.dateRange\n ) {\n this.display.hide();\n }\n }\n\n private handleMultiDate(day: DateTime) {\n let index = this.dates.pickedIndex(day, Unit.date);\n console.log(index);\n if (index !== -1) {\n this.dates.setValue(null, index); //deselect multi-date\n } else {\n index = this.dates.lastPickedIndex + 1;\n if (this.dates.picked.length === 0) index = 0;\n\n this.dates.setValue(day, index);\n }\n }\n\n private handleDateRange(day: DateTime) {\n switch (this.dates.picked.length) {\n case 2: {\n this.dates.clear();\n break;\n }\n case 1: {\n const other = this.dates.picked[0];\n if (day.getTime() === other.getTime()) {\n this.dates.clear();\n break;\n }\n if (day.isBefore(other)) {\n this.dates.setValue(day, 0);\n this.dates.setValue(other, 1);\n return;\n } else {\n this.dates.setValue(day, 1);\n return;\n }\n }\n }\n\n this.dates.setValue(day, 0);\n }\n}\n","import Display from './display/index';\nimport Dates from './dates';\nimport Actions from './actions';\nimport {\n DateTime,\n DateTimeFormatOptions,\n guessHourCycle,\n Unit,\n} from './datetime';\nimport Namespace from './utilities/namespace';\nimport Options from './utilities/options';\nimport {\n BaseEvent,\n ChangeEvent,\n ViewUpdateEvent,\n} from './utilities/event-types';\nimport { EventEmitters } from './utilities/event-emitter';\nimport {\n serviceLocator,\n setupServiceLocator,\n} from './utilities/service-locator';\nimport CalendarModes from './utilities/calendar-modes';\nimport DefaultOptions, {\n DefaultEnLocalization,\n} from './utilities/default-options';\nimport ActionTypes from './utilities/action-types';\nimport { OptionsStore } from './utilities/optionsStore';\nimport { OptionConverter } from './utilities/optionConverter';\n\n/**\n * A robust and powerful date/time picker component.\n */\nclass TempusDominus {\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n _subscribers: { [key: string]: ((event: any) => Record)[] } =\n {};\n private _isDisabled = false;\n private _toggle: HTMLElement;\n private _currentPromptTimeTimeout: NodeJS.Timeout;\n private actions: Actions;\n private optionsStore: OptionsStore;\n private _eventEmitters: EventEmitters;\n display: Display;\n dates: Dates;\n\n constructor(element: HTMLElement, options: Options = {} as Options) {\n setupServiceLocator();\n this._eventEmitters = serviceLocator.locate(EventEmitters);\n this.optionsStore = serviceLocator.locate(OptionsStore);\n this.display = serviceLocator.locate(Display);\n this.dates = serviceLocator.locate(Dates);\n this.actions = serviceLocator.locate(Actions);\n\n if (!element) {\n Namespace.errorMessages.mustProvideElement();\n }\n\n this.optionsStore.element = element;\n this._initializeOptions(options, DefaultOptions, true);\n this.optionsStore.viewDate.setLocalization(\n this.optionsStore.options.localization\n );\n this.optionsStore.unset = true;\n\n this._initializeInput();\n this._initializeToggle();\n\n if (this.optionsStore.options.display.inline) this.display.show();\n\n this._eventEmitters.triggerEvent.subscribe((e) => {\n this._triggerEvent(e);\n });\n\n this._eventEmitters.viewUpdate.subscribe(() => {\n this._viewUpdate();\n });\n\n this._eventEmitters.updateViewDate.subscribe((dateTime) => {\n this.viewDate = dateTime;\n });\n }\n\n get viewDate() {\n return this.optionsStore.viewDate;\n }\n\n set viewDate(value) {\n this.optionsStore.viewDate = value;\n this.optionsStore.viewDate.setLocalization(\n this.optionsStore.options.localization\n );\n this.display._update(\n this.optionsStore.currentView === 'clock' ? 'clock' : 'calendar'\n );\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Update the picker options. If `reset` is provide `options` will be merged with DefaultOptions instead.\n * @param options\n * @param reset\n * @public\n */\n updateOptions(options, reset = false): void {\n if (reset) this._initializeOptions(options, DefaultOptions);\n else this._initializeOptions(options, this.optionsStore.options);\n\n this.optionsStore.viewDate.setLocalization(\n this.optionsStore.options.localization\n );\n this.display._rebuild();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Toggles the picker open or closed. If the picker is disabled, nothing will happen.\n * @public\n */\n toggle(): void {\n if (this._isDisabled) return;\n this.display.toggle();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Shows the picker unless the picker is disabled.\n * @public\n */\n show(): void {\n if (this._isDisabled) return;\n this.display.show();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Hides the picker unless the picker is disabled.\n * @public\n */\n hide(): void {\n this.display.hide();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Disables the picker and the target input field.\n * @public\n */\n disable(): void {\n this._isDisabled = true;\n // todo this might be undesired. If a dev disables the input field to\n // only allow using the picker, this will break that.\n this.optionsStore.input?.setAttribute('disabled', 'disabled');\n this.display.hide();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Enables the picker and the target input field.\n * @public\n */\n enable(): void {\n this._isDisabled = false;\n this.optionsStore.input?.removeAttribute('disabled');\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Clears all the selected dates\n * @public\n */\n clear(): void {\n this.optionsStore.input.value = '';\n this.dates.clear();\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Allows for a direct subscription to picker events, without having to use addEventListener on the element.\n * @param eventTypes See Namespace.Events\n * @param callbacks Function to call when event is triggered\n * @public\n */\n subscribe(\n eventTypes: string | string[],\n callbacks: (event: any) => void | ((event: any) => void)[] //eslint-disable-line @typescript-eslint/no-explicit-any\n ): { unsubscribe: () => void } | { unsubscribe: () => void }[] {\n if (typeof eventTypes === 'string') {\n eventTypes = [eventTypes];\n }\n let callBackArray: any[]; //eslint-disable-line @typescript-eslint/no-explicit-any\n if (!Array.isArray(callbacks)) {\n callBackArray = [callbacks];\n } else {\n callBackArray = callbacks;\n }\n\n if (eventTypes.length !== callBackArray.length) {\n Namespace.errorMessages.subscribeMismatch();\n }\n\n const returnArray = [];\n\n for (let i = 0; i < eventTypes.length; i++) {\n const eventType = eventTypes[i];\n if (!Array.isArray(this._subscribers[eventType])) {\n this._subscribers[eventType] = [];\n }\n\n this._subscribers[eventType].push(callBackArray[i]);\n\n returnArray.push({\n unsubscribe: this._unsubscribe.bind(\n this,\n eventType,\n this._subscribers[eventType].length - 1\n ),\n });\n\n if (eventTypes.length === 1) {\n return returnArray[0];\n }\n }\n\n return returnArray;\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Hides the picker and removes event listeners\n */\n dispose() {\n this.display.hide();\n // this will clear the document click event listener\n this.display._dispose();\n this._eventEmitters.destroy();\n this.optionsStore.input?.removeEventListener(\n 'change',\n this._inputChangeEvent\n );\n if (this.optionsStore.options.allowInputToggle) {\n this.optionsStore.input?.removeEventListener(\n 'click',\n this._toggleClickEvent\n );\n }\n this._toggle?.removeEventListener('click', this._toggleClickEvent);\n this._subscribers = {};\n }\n\n /**\n * Updates the options to use the provided language.\n * THe language file must be loaded first.\n * @param language\n */\n locale(language: string) {\n const asked = loadedLocales[language];\n if (!asked) return;\n this.updateOptions({\n localization: asked,\n });\n }\n\n /**\n * Triggers an event like ChangeEvent when the picker has updated the value\n * of a selected date.\n * @param event Accepts a BaseEvent object.\n * @private\n */\n private _triggerEvent(event: BaseEvent) {\n event.viewMode = this.optionsStore.currentView;\n\n const isChangeEvent = event.type === Namespace.events.change;\n if (isChangeEvent) {\n const { date, oldDate, isClear } = event as ChangeEvent;\n if (\n (date && oldDate && date.isSame(oldDate)) ||\n (!isClear && !date && !oldDate)\n ) {\n return;\n }\n this._handleAfterChangeEvent(event as ChangeEvent);\n\n this.optionsStore.input?.dispatchEvent(\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n new CustomEvent('change', { detail: event as any })\n );\n }\n\n this.optionsStore.element.dispatchEvent(\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n new CustomEvent(event.type, { detail: event as any })\n );\n\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((window as any).jQuery) {\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n const $ = (window as any).jQuery;\n\n if (isChangeEvent && this.optionsStore.input) {\n $(this.optionsStore.input).trigger(event);\n } else {\n $(this.optionsStore.element).trigger(event);\n }\n }\n\n this._publish(event);\n }\n\n private _publish(event: BaseEvent) {\n // return if event is not subscribed\n if (!Array.isArray(this._subscribers[event.type])) {\n return;\n }\n\n // Trigger callback for each subscriber\n this._subscribers[event.type].forEach((callback) => {\n callback(event);\n });\n }\n\n /**\n * Fires a ViewUpdate event when, for example, the month view is changed.\n * @private\n */\n private _viewUpdate() {\n this._triggerEvent({\n type: Namespace.events.update,\n viewDate: this.optionsStore.viewDate.clone,\n } as ViewUpdateEvent);\n }\n\n private _unsubscribe(eventName, index) {\n this._subscribers[eventName].splice(index, 1);\n }\n\n /**\n * Merges two Option objects together and validates options type\n * @param config new Options\n * @param mergeTo Options to merge into\n * @param includeDataset When true, the elements data-td attributes will be included in the\n * @private\n */\n private _initializeOptions(\n config: Options,\n mergeTo: Options,\n includeDataset = false\n ): void {\n let newConfig = OptionConverter.deepCopy(config);\n newConfig = OptionConverter._mergeOptions(newConfig, mergeTo);\n if (includeDataset)\n newConfig = OptionConverter._dataToOptions(\n this.optionsStore.element,\n newConfig\n );\n\n OptionConverter._validateConflicts(newConfig);\n\n newConfig.viewDate = newConfig.viewDate.setLocalization(\n newConfig.localization\n );\n\n if (!this.optionsStore.viewDate.isSame(newConfig.viewDate)) {\n this.optionsStore.viewDate = newConfig.viewDate;\n }\n\n /**\n * Sets the minimum view allowed by the picker. For example the case of only\n * allowing year and month to be selected but not date.\n */\n if (newConfig.display.components.year) {\n this.optionsStore.minimumCalendarViewMode = 2;\n }\n if (newConfig.display.components.month) {\n this.optionsStore.minimumCalendarViewMode = 1;\n }\n if (newConfig.display.components.date) {\n this.optionsStore.minimumCalendarViewMode = 0;\n }\n\n this.optionsStore.currentCalendarViewMode = Math.max(\n this.optionsStore.minimumCalendarViewMode,\n this.optionsStore.currentCalendarViewMode\n );\n\n // Update view mode if needed\n if (\n CalendarModes[this.optionsStore.currentCalendarViewMode].name !==\n newConfig.display.viewMode\n ) {\n this.optionsStore.currentCalendarViewMode = Math.max(\n CalendarModes.findIndex((x) => x.name === newConfig.display.viewMode),\n this.optionsStore.minimumCalendarViewMode\n );\n }\n\n if (this.display?.isVisible) {\n this.display._update('all');\n }\n\n if (\n newConfig.display.components.useTwentyfourHour &&\n newConfig.localization.hourCycle === undefined\n )\n newConfig.localization.hourCycle = 'h24';\n else if (newConfig.localization.hourCycle === undefined) {\n newConfig.localization.hourCycle = guessHourCycle(\n newConfig.localization.locale\n );\n }\n\n this.optionsStore.options = newConfig;\n }\n\n /**\n * Checks if an input field is being used, attempts to locate one and sets an\n * event listener if found.\n * @private\n */\n private _initializeInput() {\n if (this.optionsStore.element.tagName == 'INPUT') {\n this.optionsStore.input = this.optionsStore.element as HTMLInputElement;\n } else {\n const query = this.optionsStore.element.dataset.tdTargetInput;\n if (query == undefined || query == 'nearest') {\n this.optionsStore.input =\n this.optionsStore.element.querySelector('input');\n } else {\n this.optionsStore.input =\n this.optionsStore.element.querySelector(query);\n }\n }\n\n if (!this.optionsStore.input) return;\n\n if (!this.optionsStore.input.value && this.optionsStore.options.defaultDate)\n this.optionsStore.input.value = this.dates.formatInput(\n this.optionsStore.options.defaultDate\n );\n\n this.optionsStore.input.addEventListener('change', this._inputChangeEvent);\n if (this.optionsStore.options.allowInputToggle) {\n this.optionsStore.input.addEventListener('click', this._toggleClickEvent);\n }\n\n if (this.optionsStore.input.value) {\n this._inputChangeEvent();\n }\n }\n\n /**\n * Attempts to locate a toggle for the picker and sets an event listener\n * @private\n */\n private _initializeToggle() {\n if (this.optionsStore.options.display.inline) return;\n let query = this.optionsStore.element.dataset.tdTargetToggle;\n if (query == 'nearest') {\n query = '[data-td-toggle=\"datetimepicker\"]';\n }\n this._toggle =\n query == undefined\n ? this.optionsStore.element\n : this.optionsStore.element.querySelector(query);\n this._toggle.addEventListener('click', this._toggleClickEvent);\n }\n\n /**\n * If the option is enabled this will render the clock view after a date pick.\n * @param e change event\n * @private\n */\n private _handleAfterChangeEvent(e: ChangeEvent) {\n if (\n // options is disabled\n !this.optionsStore.options.promptTimeOnDateChange ||\n this.optionsStore.options.multipleDates ||\n this.optionsStore.options.display.inline ||\n this.optionsStore.options.display.sideBySide ||\n // time is disabled\n !this.display._hasTime ||\n // clock component is already showing\n this.display.widget\n ?.getElementsByClassName(Namespace.css.show)[0]\n .classList.contains(Namespace.css.timeContainer)\n )\n return;\n\n // First time ever. If useCurrent option is set to true (default), do nothing\n // because the first date is selected automatically.\n // or date didn't change (time did) or date changed because time did.\n if (\n (!e.oldDate && this.optionsStore.options.useCurrent) ||\n (e.oldDate && e.date?.isSame(e.oldDate))\n ) {\n return;\n }\n\n clearTimeout(this._currentPromptTimeTimeout);\n this._currentPromptTimeTimeout = setTimeout(() => {\n if (this.display.widget) {\n this._eventEmitters.action.emit({\n e: {\n currentTarget: this.display.widget.querySelector(\n `.${Namespace.css.switch}`\n ),\n },\n action: ActionTypes.togglePicker,\n });\n }\n }, this.optionsStore.options.promptTimeOnDateChangeTransitionDelay);\n }\n\n /**\n * Event for when the input field changes. This is a class level method so there's\n * something for the remove listener function.\n * @private\n */\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _inputChangeEvent = (event?: any) => {\n const internallyTriggered = event?.detail;\n if (internallyTriggered) return;\n\n const setViewDate = () => {\n if (this.dates.lastPicked)\n this.optionsStore.viewDate = this.dates.lastPicked.clone;\n };\n\n const value = this.optionsStore.input.value;\n if (this.optionsStore.options.multipleDates) {\n try {\n const valueSplit = value.split(\n this.optionsStore.options.multipleDatesSeparator\n );\n for (let i = 0; i < valueSplit.length; i++) {\n this.dates.setFromInput(valueSplit[i], i);\n }\n setViewDate();\n } catch {\n console.warn(\n 'TD: Something went wrong trying to set the multipleDates values from the input field.'\n );\n }\n } else {\n this.dates.setFromInput(value, 0);\n setViewDate();\n }\n };\n\n /**\n * Event for when the toggle is clicked. This is a class level method so there's\n * something for the remove listener function.\n * @private\n */\n private _toggleClickEvent = () => {\n if (\n (this.optionsStore.element as HTMLInputElement)?.disabled ||\n this.optionsStore.input?.disabled\n )\n return;\n this.toggle();\n };\n}\n\n/**\n * Whenever a locale is loaded via a plugin then store it here based on the\n * locale name. E.g. loadedLocales['ru']\n */\nconst loadedLocales = {};\n\n// noinspection JSUnusedGlobalSymbols\n/**\n * Called from a locale plugin.\n * @param l locale object for localization options\n */\nconst loadLocale = (l) => {\n if (loadedLocales[l.name]) return;\n loadedLocales[l.name] = l.localization;\n};\n\n/**\n * A sets the global localization options to the provided locale name.\n * `loadLocale` MUST be called first.\n * @param l\n */\nconst locale = (l: string) => {\n const asked = loadedLocales[l];\n if (!asked) return;\n DefaultOptions.localization = asked;\n};\n\n// noinspection JSUnusedGlobalSymbols\n/**\n * Called from a plugin to extend or override picker defaults.\n * @param plugin\n * @param option\n */\nconst extend = function (plugin, option = undefined) {\n if (!plugin) return tempusDominus;\n if (!plugin.installed) {\n // install plugin only once\n plugin(\n option,\n { TempusDominus, Dates, Display, DateTime, Namespace },\n tempusDominus\n );\n plugin.installed = true;\n }\n return tempusDominus;\n};\n\nconst version = '6.4.4';\n\nconst tempusDominus = {\n TempusDominus,\n extend,\n loadLocale,\n locale,\n Namespace,\n DefaultOptions,\n DateTime,\n Unit,\n version,\n DefaultEnLocalization,\n};\n\nexport {\n TempusDominus,\n extend,\n loadLocale,\n locale,\n Namespace,\n DefaultOptions,\n DateTime,\n Unit,\n version,\n DateTimeFormatOptions,\n Options,\n DefaultEnLocalization,\n};\n"],"names":["Unit","DefaultFormatLocalization","ActionTypes","SecondDisplay"],"mappings":";;;;;;;;;;;EAAM,MAAO,OAAQ,SAAQ,KAAK,CAAA;EAEjC,CAAA;QAEY,aAAa,CAAA;EAA1B,IAAA,WAAA,GAAA;UACU,IAAI,CAAA,IAAA,GAAG,KAAK,CAAC;;;EAqKrB;;;EAGG;UACH,IAAsB,CAAA,sBAAA,GAAG,4BAA4B,CAAC;EAEtD;;;EAGG;UACH,IAAkB,CAAA,kBAAA,GAAG,0BAA0B,CAAC;;OAGjD;;EA9KC;;;EAGG;EACH,IAAA,gBAAgB,CAAC,UAAkB,EAAA;EACjC,QAAA,MAAM,KAAK,GAAG,IAAI,OAAO,CACvB,CAAA,EAAG,IAAI,CAAC,IAAI,CAAA,oBAAA,EAAuB,UAAU,CAAA,+BAAA,CAAiC,CA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GG;AACH,QAAM,UAAU,GAAG,CAAC,CAAC,KAAI;EACvB,IAAA,IAAI,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC;UAAE,OAAO;MAClC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC;EACzC,EAAE;EAEF;;;;EAIG;AACH,QAAM,MAAM,GAAG,CAAC,CAAS,KAAI;EAC3B,IAAA,MAAM,KAAK,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;EAC/B,IAAA,IAAI,CAAC,KAAK;UAAE,OAAO;EACnB,IAAA,cAAc,CAAC,YAAY,GAAG,KAAK,CAAC;EACtC,EAAE;EAEF;EACA;;;;EAIG;AACH,QAAM,MAAM,GAAG,UAAU,MAAM,EAAE,MAAM,GAAG,SAAS,EAAA;EACjD,IAAA,IAAI,CAAC,MAAM;EAAE,QAAA,OAAO,aAAa,CAAC;EAClC,IAAA,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;;EAErB,QAAA,MAAM,CACJ,MAAM,EACN,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,EACtD,aAAa,CACd,CAAC;EACF,QAAA,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;EACzB,KAAA;EACD,IAAA,OAAO,aAAa,CAAC;EACvB,EAAE;AAEI,QAAA,OAAO,GAAG,QAAQ;EAExB,MAAM,aAAa,GAAG;MACpB,aAAa;MACb,MAAM;MACN,UAAU;MACV,MAAM;MACN,SAAS;MACT,cAAc;MACd,QAAQ;YACRF,YAAI;MACJ,OAAO;MACP,qBAAqB;GACtB;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/js/tempus-dominus.min.js b/dist/js/tempus-dominus.min.js index e46c02109..560a708b3 100644 --- a/dist/js/tempus-dominus.min.js +++ b/dist/js/tempus-dominus.min.js @@ -1,6 +1,6 @@ /*! - * Tempus Dominus v6.4.4 (https://getdatepicker.com/) + * Tempus Dominus v6.7.7 (https://getdatepicker.com/) * Copyright 2013-2023 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).tempusDominus={})}(this,(function(t){"use strict";class e extends Error{}const s="tempus-dominus";class i{}i.NAME=s,i.dataKey="td",i.events=new class{constructor(){this.key=".td",this.change=`change${this.key}`,this.update=`update${this.key}`,this.error=`error${this.key}`,this.show=`show${this.key}`,this.hide=`hide${this.key}`,this.blur=`blur${this.key}`,this.focus=`focus${this.key}`,this.keyup=`keyup${this.key}`,this.keydown=`keydown${this.key}`}},i.css=new class{constructor(){this.widget=`${s}-widget`,this.calendarHeader="calendar-header",this.switch="picker-switch",this.toolbar="toolbar",this.noHighlight="no-highlight",this.sideBySide="timepicker-sbs",this.previous="previous",this.next="next",this.disabled="disabled",this.old="old",this.new="new",this.active="active",this.dateContainer="date-container",this.decadesContainer=`${this.dateContainer}-decades`,this.decade="decade",this.yearsContainer=`${this.dateContainer}-years`,this.year="year",this.monthsContainer=`${this.dateContainer}-months`,this.month="month",this.daysContainer=`${this.dateContainer}-days`,this.day="day",this.calendarWeeks="cw",this.dayOfTheWeek="dow",this.today="today",this.weekend="weekend",this.rangeIn="range-in",this.rangeStart="range-start",this.rangeEnd="range-end",this.timeContainer="time-container",this.separator="separator",this.clockContainer=`${this.timeContainer}-clock`,this.hourContainer=`${this.timeContainer}-hour`,this.minuteContainer=`${this.timeContainer}-minute`,this.secondContainer=`${this.timeContainer}-second`,this.hour="hour",this.minute="minute",this.second="second",this.toggleMeridiem="toggleMeridiem",this.show="show",this.collapsing="td-collapsing",this.collapse="td-collapse",this.inline="inline",this.lightTheme="light",this.darkTheme="dark",this.isDarkPreferredQuery="(prefers-color-scheme: dark)"}},i.errorMessages=new class{constructor(){this.base="TD:",this.failedToSetInvalidDate="Failed to set invalid date",this.failedToParseInput="Failed parse input field"}unexpectedOption(t){const s=new e(`${this.base} Unexpected option: ${t} does not match a known option.`);throw s.code=1,s}unexpectedOptions(t){const s=new e(`${this.base}: ${t.join(", ")}`);throw s.code=1,s}unexpectedOptionValue(t,s,i){const o=new e(`${this.base} Unexpected option value: ${t} does not accept a value of "${s}". Valid values are: ${i.join(", ")}`);throw o.code=2,o}typeMismatch(t,s,i){const o=new e(`${this.base} Mismatch types: ${t} has a type of ${s} instead of the required ${i}`);throw o.code=3,o}numbersOutOfRange(t,s,i){const o=new e(`${this.base} ${t} expected an array of number between ${s} and ${i}.`);throw o.code=4,o}failedToParseDate(t,s,i=!1){const o=new e(`${this.base} Could not correctly parse "${s}" to a date for ${t}.`);if(o.code=5,!i)throw o;console.warn(o)}mustProvideElement(){const t=new e(`${this.base} No element was provided.`);throw t.code=6,t}subscribeMismatch(){const t=new e(`${this.base} The subscribed events does not match the number of callbacks`);throw t.code=7,t}conflictingConfiguration(t){const s=new e(`${this.base} A configuration value conflicts with another rule. ${t}`);throw s.code=8,s}customDateFormatError(t){const s=new e(`${this.base} Custom Date Format: ${t}`);throw s.code=9,s}dateString(){console.warn(`${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`)}deprecatedWarning(t,e){console.warn(`${this.base} Warning ${t} is deprecated and will be removed in a future version. ${e}`)}throwError(t){const s=new e(`${this.base} ${t}`);throw s.code=9,s}};var o,a={...{locale:"default",hourCycle:void 0,dateFormats:{LTS:"h:mm:ss T",LT:"h:mm T",L:"MM/dd/yyyy",LL:"MMMM d, yyyy",LLL:"MMMM d, yyyy h:mm T",LLLL:"dddd, MMMM d, yyyy h:mm T"},ordinal:t=>{const e=["th","st","nd","rd"],s=t%100;return`[${t}${e[(s-20)%10]||e[s]||e[0]}]`},format:"L LT"}};t.Unit=void 0,(o=t.Unit||(t.Unit={})).seconds="seconds",o.minutes="minutes",o.hours="hours",o.date="date",o.month="month",o.year="year";const n={month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"},r=t=>{switch(t){case"date":return{dateStyle:"short"};case"month":return{month:"numeric",year:"numeric"};case"year":return{year:"numeric"}}},d=t=>{if(!t)return"h12";const e={hour:"2-digit",minute:"2-digit",numberingSystem:"latn"},s=(new l).setLocalization({locale:t});s.hours=0;const i=s.parts(void 0,e).hour;if("12"===i)return"h12";if("24"===i)return"h24";s.hours=23;const o=s.parts(void 0,e).hour;return"00"===i&&"11"===o?"h11":"00"===i&&"23"===o?"h23":void console.warn(`couldn't determine hour cycle for ${t}. start: ${i}. end: ${o}`)};class l extends Date{constructor(){super(...arguments),this.localization=a,this.nonLeapLadder=[0,31,59,90,120,151,181,212,243,273,304,334],this.leapLadder=[0,31,60,91,121,152,182,213,244,274,305,335],this.dateTimeRegex=/(\[[^[\]]*])|y{1,4}|M{1,4}|d{1,4}|H{1,2}|h{1,2}|t|T|m{1,2}|s{1,2}|f{3}/g,this.formattingTokens=/(\[[^[\]]*])|([-_:/.,()\s]+)|(T|t|yyyy|yy?|MM?M?M?|Do|dd?|hh?|HH?|mm?|ss?)/g,this.match2=/\d\d/,this.match3=/\d{3}/,this.match4=/\d{4}/,this.match1to2=/\d\d?/,this.matchSigned=/[+-]?\d+/,this.matchOffset=/[+-]\d\d:?(\d\d)?|Z/,this.matchWord=/[^\d_:/,\-()\s]+/,this.zoneExpressions=[this.matchOffset,(t,e)=>{t.offset=this.offsetFromString(e)}],this.expressions={t:[this.matchWord,(t,e)=>{t.afternoon=this.meridiemMatch(e)}],T:[this.matchWord,(t,e)=>{t.afternoon=this.meridiemMatch(e)}],fff:[this.match3,(t,e)=>{t.milliseconds=+e}],s:[this.match1to2,this.addInput("seconds")],ss:[this.match1to2,this.addInput("seconds")],m:[this.match1to2,this.addInput("minutes")],mm:[this.match1to2,this.addInput("minutes")],H:[this.match1to2,this.addInput("hours")],h:[this.match1to2,this.addInput("hours")],HH:[this.match1to2,this.addInput("hours")],hh:[this.match1to2,this.addInput("hours")],d:[this.match1to2,this.addInput("day")],dd:[this.match2,this.addInput("day")],Do:[this.matchWord,(t,e)=>{if([t.day]=e.match(/\d+/),this.localization.ordinal)for(let s=1;s<=31;s+=1)this.localization.ordinal(s).replace(/[[\]]/g,"")===e&&(t.day=s)}],M:[this.match1to2,this.addInput("month")],MM:[this.match2,this.addInput("month")],MMM:[this.matchWord,(t,e)=>{const s=this.getAllMonths(),i=(this.getAllMonths("short")||s.map((t=>t.slice(0,3)))).indexOf(e)+1;if(i<1)throw new Error;t.month=i%12||i}],MMMM:[this.matchWord,(t,e)=>{const s=this.getAllMonths().indexOf(e)+1;if(s<1)throw new Error;t.month=s%12||s}],y:[this.matchSigned,this.addInput("year")],yy:[this.match2,(t,e)=>{t.year=this.parseTwoDigitYear(e)}],yyyy:[this.match4,this.addInput("year")]}}setLocale(t){return this.localization||(this.localization=a,this.localization.locale=t),this}setLocalization(t){return this.localization=t,this}static convert(t,e="default",s=undefined){if(!t)throw new Error("A date is required");return s||((s=a).locale=e),new l(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()).setLocalization(s)}get clone(){return new l(this.year,this.month,this.date,this.hours,this.minutes,this.seconds,this.getMilliseconds()).setLocalization(this.localization)}static isValid(t){return void 0!==t&&"null"!==JSON.stringify(t)&&t.constructor.name===l.name}startOf(e,s=0){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);switch(e){case"seconds":this.setMilliseconds(0);break;case"minutes":this.setSeconds(0,0);break;case"hours":this.setMinutes(0,0,0);break;case"date":this.setHours(0,0,0,0);break;case"weekDay":{if(this.startOf(t.Unit.date),this.weekDay===s)break;let e=this.weekDay;0!==s&&0===this.weekDay&&(e=8-s),this.manipulate(s-e,t.Unit.date);break}case"month":this.startOf(t.Unit.date),this.setDate(1);break;case"year":this.startOf(t.Unit.date),this.setMonth(0,1)}return this}endOf(e,s=0){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);switch(e){case"seconds":this.setMilliseconds(999);break;case"minutes":this.setSeconds(59,999);break;case"hours":this.setMinutes(59,59,999);break;case"date":this.setHours(23,59,59,999);break;case"weekDay":{this.endOf(t.Unit.date);const e=6+s;if(this.weekDay===e)break;this.manipulate(e-this.weekDay,t.Unit.date);break}case"month":this.endOf(t.Unit.date),this.manipulate(1,t.Unit.month),this.setDate(0);break;case"year":this.endOf(t.Unit.date),this.setMonth(11,31)}return this}manipulate(t,e){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return this[e]+=t,this}isBefore(t,e){if(!l.isValid(t))return!1;if(!e)return this.valueOf()t.valueOf();if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return this.clone.startOf(e).valueOf()>t.clone.startOf(e).valueOf()}isSame(t,e){if(!l.isValid(t))return!1;if(!e)return this.valueOf()===t.valueOf();if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return t=l.convert(t),this.clone.startOf(e).valueOf()===t.startOf(e).valueOf()}isBetween(t,e,s,i="()"){if(!l.isValid(t)||!l.isValid(e))return!1;if(s&&void 0===this[s])throw new Error(`Unit '${s}' is not valid`);const o="("===i[0],a=")"===i[1],n=o?this.isAfter(t,s):!this.isBefore(t,s),r=a?this.isBefore(e,s):!this.isAfter(e,s);return n&&r}parts(t=this.localization.locale,e={dateStyle:"full",timeStyle:"long"}){const s={};return new Intl.DateTimeFormat(t,e).formatToParts(this).filter((t=>"literal"!==t.type)).forEach((t=>s[t.type]=t.value)),s}get seconds(){return this.getSeconds()}set seconds(t){this.setSeconds(t)}get secondsFormatted(){return this.parts(void 0,n).second}get minutes(){return this.getMinutes()}set minutes(t){this.setMinutes(t)}get minutesFormatted(){return this.parts(void 0,n).minute}get hours(){return this.getHours()}set hours(t){this.setHours(t)}getHoursFormatted(t="h12"){return this.parts(void 0,{...n,hourCycle:t}).hour}meridiem(t=this.localization.locale){return new Intl.DateTimeFormat(t,{hour:"numeric",hour12:!0}).formatToParts(this).find((t=>"dayPeriod"===t.type))?.value}get date(){return this.getDate()}set date(t){this.setDate(t)}get dateFormatted(){return this.parts(void 0,n).day}get weekDay(){return this.getDay()}get month(){return this.getMonth()}set month(t){const e=new Date(this.year,t+1);e.setDate(0);const s=e.getDate();this.date>s&&(this.date=s),this.setMonth(t)}get monthFormatted(){return this.parts(void 0,n).month}get year(){return this.getFullYear()}set year(t){this.setFullYear(t)}get week(){const t=this.computeOrdinal(),e=this.getUTCDay();let s=Math.floor((t-e+10)/7);return s<1?s=this.weeksInWeekYear():s>this.weeksInWeekYear()&&(s=1),s}weeksInWeekYear(){const t=(this.year+Math.floor(this.year/4)-Math.floor(this.year/100)+Math.floor(this.year/400))%7,e=this.year-1,s=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7;return 4===t||3===s?53:52}get isLeapYear(){return this.year%4==0&&(this.year%100!=0||this.year%400==0)}computeOrdinal(){return this.date+(this.isLeapYear?this.leapLadder:this.nonLeapLadder)[this.month]}getAllMonths(t="long"){const e=new Intl.DateTimeFormat(this.localization.locale,{month:t}).format;return[...Array(12).keys()].map((t=>e(new Date(2021,t))))}replaceTokens(t,e){return t.replace(/(\[[^[\]]*])|(LTS?|l{1,4}|L{1,4})/g,((t,s,i)=>{const o=i&&i.toUpperCase();return s||e[o]||a.dateFormats[o]}))}parseTwoDigitYear(t){return(t=+t)+(t>68?1900:2e3)}offsetFromString(t){if(!t)return 0;if("Z"===t)return 0;const[e,s,i]=t.match(/([+-]|\d\d)/g),o=60*s+(+i||0);return 0===o?0:"+"===e?-o:o}zoneInformation(t,e){let s=t.parts(this.localization.locale,{timeZoneName:"longOffset"}).timeZoneName.replace("GMT","").replace(":","");const i=s.includes("-");return s=s.replace("-",""),"z"===e?s=s.substring(1,2):"zz"===e&&(s=s.substring(0,2)),`${i?"-":""}${s}`}addInput(t){return(e,s)=>{e[t]=+s}}meridiemMatch(t){const e=new Intl.DateTimeFormat(this.localization.locale,{hour:"numeric",hour12:!0}).formatToParts(new Date(2022,3,4,13)).find((t=>"dayPeriod"===t.type))?.value;return t.toLowerCase()===e.toLowerCase()}correctHours(t){const{afternoon:e}=t;if(void 0!==e){const{hours:s}=t;e?s<12&&(t.hours+=12):12===s&&(t.hours=0),delete t.afternoon}}makeParser(t){const e=(t=this.replaceTokens(t,this.localization.dateFormats)).match(this.formattingTokens),{length:s}=e;for(let t=0;t{const i={hours:0,minutes:0,seconds:0,milliseconds:0};for(let o=0,a=0;o-1)return new l(("X"===e.format?1e3:1)*+t);const i=s.makeParser(e.format),{year:o,month:a,day:n,hours:r,minutes:d,seconds:c,milliseconds:h,zone:p}=i(t),u=n||(o||a?1:s.getDate()),m=o||s.getFullYear();let y=0;return o&&!a||(y=a>0?a-1:s.getMonth()),p?new l(Date.UTC(m,y,u,r,d,c,h+60*p.offset*1e3)):new l(m,y,u,r,d,c,h)}catch(s){i.errorMessages.customDateFormatError(`Unable to parse provided input: ${t}, format: ${e.format}`)}}format(t,e=this.localization.locale){if(t&&"object"==typeof t)return new Intl.DateTimeFormat(e,t).format(this);const s=this.replaceTokens(t||this.localization.format||`${a.dateFormats.L}, ${a.dateFormats.LT}`,this.localization.dateFormats),i=t=>new Intl.DateTimeFormat(this.localization.locale,t).format(this);this.localization.hourCycle||(this.localization.hourCycle=d(this.localization.locale));const o=this.localization.hourCycle.startsWith("h1")?"h24":this.localization.hourCycle,n=this.localization.hourCycle.startsWith("h2")?"h12":this.localization.hourCycle,r={yy:i({year:"2-digit"}),yyyy:this.year,M:i({month:"numeric"}),MM:this.monthFormatted,MMM:this.getAllMonths("short")[this.getMonth()],MMMM:this.getAllMonths()[this.getMonth()],d:this.date,dd:this.dateFormatted,ddd:i({weekday:"short"}),dddd:i({weekday:"long"}),H:this.getHours(),HH:this.getHoursFormatted(o),h:this.hours>12?this.hours-12:this.hours,hh:this.getHoursFormatted(n),t:this.meridiem(),T:this.meridiem().toUpperCase(),m:this.minutes,mm:this.minutesFormatted,s:this.seconds,ss:this.secondsFormatted,fff:this.getMilliseconds()};return s.replace(this.dateTimeRegex,((t,e)=>e||r[t])).replace(/\[/g,"").replace(/]/g,"")}}class c{constructor(){this.cache=new Map}locate(t){const e=this.cache.get(t);if(e)return e;const s=new t;return this.cache.set(t,s),s}}let h;const p=[{name:"calendar",className:i.css.daysContainer,unit:t.Unit.month,step:1},{name:"months",className:i.css.monthsContainer,unit:t.Unit.year,step:1},{name:"years",className:i.css.yearsContainer,unit:t.Unit.year,step:10},{name:"decades",className:i.css.decadesContainer,unit:t.Unit.year,step:100}];class u{constructor(){this._currentCalendarViewMode=0,this._viewDate=new l,this.minimumCalendarViewMode=0,this.currentView="calendar"}get currentCalendarViewMode(){return this._currentCalendarViewMode}set currentCalendarViewMode(t){this._currentCalendarViewMode=t,this.currentView=p[t].name}get viewDate(){return this._viewDate}set viewDate(t){this._viewDate=t,this.options&&(this.options.viewDate=t)}refreshCurrentView(){this.currentView=p[this.currentCalendarViewMode].name}get isTwelveHour(){return["h12","h11"].includes(this.options.localization.hourCycle)}}class m{constructor(){this.optionsStore=h.locate(u)}isValid(e,s){if(!this._enabledDisabledDatesIsValid(s,e))return!1;if(s!==t.Unit.month&&s!==t.Unit.year&&this.optionsStore.options.restrictions.daysOfWeekDisabled?.length>0&&-1!==this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(e.weekDay))return!1;if(!this._minMaxIsValid(s,e))return!1;if(s===t.Unit.hours||s===t.Unit.minutes||s===t.Unit.seconds){if(!this._enabledDisabledHoursIsValid(e))return!1;if(0!==this.optionsStore.options.restrictions.disabledTimeIntervals?.filter((t=>e.isBetween(t.from,t.to))).length)return!1}return!0}_enabledDisabledDatesIsValid(e,s){return e!==t.Unit.date||!(this.optionsStore.options.restrictions.disabledDates.length>0&&this._isInDisabledDates(s))&&!(this.optionsStore.options.restrictions.enabledDates.length>0&&!this._isInEnabledDates(s))}_isInDisabledDates(e){return!(!this.optionsStore.options.restrictions.disabledDates||0===this.optionsStore.options.restrictions.disabledDates.length)&&!!this.optionsStore.options.restrictions.disabledDates.find((s=>s.isSame(e,t.Unit.date)))}_isInEnabledDates(e){return!this.optionsStore.options.restrictions.enabledDates||0===this.optionsStore.options.restrictions.enabledDates.length||!!this.optionsStore.options.restrictions.enabledDates.find((s=>s.isSame(e,t.Unit.date)))}_minMaxIsValid(t,e){return(!this.optionsStore.options.restrictions.minDate||!e.isBefore(this.optionsStore.options.restrictions.minDate,t))&&(!this.optionsStore.options.restrictions.maxDate||!e.isAfter(this.optionsStore.options.restrictions.maxDate,t))}_enabledDisabledHoursIsValid(t){return!(this.optionsStore.options.restrictions.disabledHours.length>0&&this._isInDisabledHours(t))&&!(this.optionsStore.options.restrictions.enabledHours.length>0&&!this._isInEnabledHours(t))}_isInDisabledHours(t){if(!this.optionsStore.options.restrictions.disabledHours||0===this.optionsStore.options.restrictions.disabledHours.length)return!1;const e=t.hours;return this.optionsStore.options.restrictions.disabledHours.includes(e)}_isInEnabledHours(t){if(!this.optionsStore.options.restrictions.enabledHours||0===this.optionsStore.options.restrictions.enabledHours.length)return!0;const e=t.hours;return this.optionsStore.options.restrictions.enabledHours.includes(e)}dateRangeIsValid(e,s,i){if(!this.optionsStore.options.dateRange)return!0;if(2!==e.length&&1!==s)return!0;const o=e[0];if(o.isSame(i,t.Unit.date))return!0;for(o.clone.manipulate(1,t.Unit.date);!o.isSame(i,t.Unit.date);){if(!this.isValid(o,t.Unit.date))return!1;o.manipulate(1,t.Unit.date)}return!0}}class y{constructor(){this.subscribers=[]}subscribe(t){return this.subscribers.push(t),this.unsubscribe.bind(this,this.subscribers.length-1)}unsubscribe(t){this.subscribers.splice(t,1)}emit(t){this.subscribers.forEach((e=>{e(t)}))}destroy(){this.subscribers=null,this.subscribers=[]}}class g{constructor(){this.triggerEvent=new y,this.viewUpdate=new y,this.updateDisplay=new y,this.action=new y,this.updateViewDate=new y}destroy(){this.triggerEvent.destroy(),this.viewUpdate.destroy(),this.updateDisplay.destroy(),this.action.destroy(),this.updateViewDate.destroy()}}const v={clear:"Clear selection",close:"Close the picker",dateFormats:a.dateFormats,dayViewHeaderFormat:{month:"long",year:"2-digit"},decrementHour:"Decrement Hour",decrementMinute:"Decrement Minute",decrementSecond:"Decrement Second",format:a.format,hourCycle:a.hourCycle,incrementHour:"Increment Hour",incrementMinute:"Increment Minute",incrementSecond:"Increment Second",locale:a.locale,nextCentury:"Next Century",nextDecade:"Next Decade",nextMonth:"Next Month",nextYear:"Next Year",ordinal:a.ordinal,pickHour:"Pick Hour",pickMinute:"Pick Minute",pickSecond:"Pick Second",previousCentury:"Previous Century",previousDecade:"Previous Decade",previousMonth:"Previous Month",previousYear:"Previous Year",selectDate:"Select Date",selectDecade:"Select Decade",selectMonth:"Select Month",selectTime:"Select Time",selectYear:"Select Year",startOfTheWeek:0,today:"Go to today",toggleMeridiem:"Toggle Meridiem"},f={allowInputToggle:!1,container:void 0,dateRange:!1,debug:!1,defaultDate:void 0,display:{icons:{type:"icons",time:"fa-solid fa-clock",date:"fa-solid fa-calendar",up:"fa-solid fa-arrow-up",down:"fa-solid fa-arrow-down",previous:"fa-solid fa-chevron-left",next:"fa-solid fa-chevron-right",today:"fa-solid fa-calendar-check",clear:"fa-solid fa-trash",close:"fa-solid fa-xmark"},sideBySide:!1,calendarWeeks:!1,viewMode:"calendar",toolbarPlacement:"bottom",keepOpen:!1,buttons:{today:!1,clear:!1,close:!1},components:{calendar:!0,date:!0,month:!0,year:!0,decades:!0,clock:!0,hours:!0,minutes:!0,seconds:!1,useTwentyfourHour:void 0},inline:!1,theme:"auto",placement:"bottom"},keepInvalid:!1,localization:v,meta:{},multipleDates:!1,multipleDatesSeparator:"; ",promptTimeOnDateChange:!1,promptTimeOnDateChangeTransitionDelay:200,restrictions:{minDate:void 0,maxDate:void 0,disabledDates:[],enabledDates:[],daysOfWeekDisabled:[],disabledTimeIntervals:[],disabledHours:[],enabledHours:[]},stepping:1,useCurrent:!0,viewDate:new l},S={...v};function w(t,e){if(!t)return null;if(t.constructor.name===l.name)return t;if(t.constructor.name===Date.name)return l.convert(t);if("string"==typeof t){const s=l.fromString(t,e);return"null"===JSON.stringify(s)?null:s}return null}function b(t,e,s){"string"==typeof t&&"input"!==e&&i.errorMessages.dateString();const o=w(t,s);return o||i.errorMessages.failedToParseDate(e,t,"input"===e),o}function D(t,e,s,o){Array.isArray(e)||i.errorMessages.typeMismatch(t,s,"array of DateTime or Date");for(let s=0;s"number"!=typeof t))||i.errorMessages.typeMismatch(t,s,"array of numbers")}function k(t){return({value:e,providedType:s,localization:o})=>{const a=b(e,t,o);if(void 0!==a)return a.setLocalization(o),a;i.errorMessages.typeMismatch(t,s,"DateTime or Date")}}function C(t){const e=k(t);return t=>void 0===t.value?t.value:e(t)}function M(t,e,s){return({value:o,providedType:a})=>void 0===o?[]:(_(t,o,a),o.some((t=>ts))&&i.errorMessages.numbersOutOfRange(t,e,s),o)}function E(t){return M(t,0,23)}function T(t){return({value:e,providedType:s,localization:i})=>void 0===e?[]:(D(t,e,s,i),e)}function L(t){return({value:e,path:s})=>(t.includes(e)||i.errorMessages.unexpectedOptionValue(s.substring(1),e,t),e)}const U=Object.freeze({defaultDate:k("defaultDate"),viewDate:k("viewDate"),minDate:C("restrictions.minDate"),maxDate:C("restrictions.maxDate"),disabledHours:E("restrictions.disabledHours"),enabledHours:E("restrictions.enabledHours"),disabledDates:T("restrictions.disabledDates"),enabledDates:T("restrictions.enabledDates"),daysOfWeekDisabled:M("restrictions.daysOfWeekDisabled",0,6),disabledTimeIntervals:({key:t,value:e,providedType:s,localization:o})=>{if(void 0===e)return[];Array.isArray(e)||i.errorMessages.typeMismatch(t,s,"array of { from: DateTime|Date, to: DateTime|Date }");const a=e;for(let e=0;e{const n=`${t}[${e}].${s}`,r=a[e][s],d=b(r,n,o);d||i.errorMessages.typeMismatch(n,typeof r,"DateTime or Date"),d.setLocalization(o),a[e][s]=d}));return a},toolbarPlacement:L(["top","bottom","default"]),type:L(["icons","sprites"]),viewMode:L(["clock","calendar","months","years","decades"]),theme:L(["light","dark","auto"]),placement:L(["top","bottom"]),meta:({value:t})=>t,dayViewHeaderFormat:({value:t})=>t,container:({value:t,path:e})=>(t&&!(t instanceof HTMLElement||t instanceof Element||t?.appendChild)&&i.errorMessages.typeMismatch(e.substring(1),typeof t,"HTMLElement"),t),useTwentyfourHour:({value:t,path:e,providedType:s,defaultType:o})=>{if(i.errorMessages.deprecatedWarning("useTwentyfourHour",'Please use "options.localization.hourCycle" instead'),void 0===t||"boolean"===s)return t;i.errorMessages.typeMismatch(e,s,o)},hourCycle:L(["h11","h12","h23","h24"])}),A=({value:t,defaultType:e,providedType:s,path:o})=>{switch(e){case"boolean":return"true"===t||!0===t;case"number":return+t;case"string":return t.toString();case"object":return{};case"function":return t;default:i.errorMessages.typeMismatch(o,s,e)}};class V{static deepCopy(t){const e={};return Object.keys(t).forEach((s=>{const i=t[s];i instanceof l?e[s]=i.clone:i instanceof Date?e[s]=new Date(i.valueOf()):(e[s]=i,"object"!=typeof i||i instanceof HTMLElement||i instanceof Element||Array.isArray(i)||(e[s]=V.deepCopy(i)))})),e}static objectPath(t,e){return"."===t.charAt(0)&&(t=t.slice(1)),t?t.split(".").reduce(((t,e)=>V.isValue(t)||V.isValue(t[e])?t[e]:void 0),e):e}static spread(t,e,s,o=""){const a=V.objectPath(o,f),n=Object.keys(t).filter((t=>!Object.keys(a).includes(t)));if(n.length>0){const t=V.getFlattenDefaultOptions(),e=n.map((e=>{let s=`"${o}.${e}" in not a known option.`;const i=t.find((t=>t.includes(e)));return i&&(s+=` Did you mean "${i}"?`),s}));i.errorMessages.unexpectedOptions(e)}Object.keys(t).filter((t=>"__proto__"!==t&&"constructor"!==t)).forEach((i=>{"."===(o+=`.${i}`).charAt(0)&&(o=o.slice(1));const n=a[i],r=typeof t[i],d=typeof n,l=t[i];if(null==l)return e[i]=l,void(o=o.substring(0,o.lastIndexOf(`.${i}`)));"object"!=typeof n||Array.isArray(t[i])||n instanceof Date||V.ignoreProperties.includes(i)?e[i]=V.processKey(i,l,r,d,o,s):V.spread(t[i],e[i],s,o),o=o.substring(0,o.lastIndexOf(`.${i}`))}))}static processKey(t,e,s,i,o,a){return(U[(n={key:t,value:e,providedType:s,defaultType:i,path:o,localization:a}).key]||A)(n);var n}static _mergeOptions(t,e){const s=V.deepCopy(e),i="default"!==e.localization?.locale?e.localization:t?.localization||f.localization;return V.spread(t,s,i,""),s}static _dataToOptions(t,e){const s=JSON.parse(JSON.stringify(t.dataset));if(s?.tdTargetInput&&delete s.tdTargetInput,s?.tdTargetToggle&&delete s.tdTargetToggle,!s||0===Object.keys(s).length||s.constructor!==DOMStringMap)return e;const o={},a=t=>{const e={};return Object.keys(t).forEach((t=>{e[t.toLowerCase()]=t})),e},n=this.normalizeObject(a),r=a(e);return Object.keys(s).filter((t=>t.startsWith(i.dataKey))).map((t=>t.substring(2))).forEach((t=>{let i=r[t.toLowerCase()];if(t.includes("_")){const a=t.split("_");i=r[a[0].toLowerCase()],void 0!==i&&e[i].constructor===Object&&(o[i]=n(a,1,e[i],s[`td${t}`]))}else void 0!==i&&(o[i]=s[`td${t}`])})),this._mergeOptions(o,e)}static normalizeObject(t){const e=(s,i,o,a)=>{const n=t(o)[s[i].toLowerCase()],r={};return void 0===n||(o[n].constructor===Object?(i++,r[n]=e(s,i,o[n],a)):r[n]=a),r};return e}static _dateTypeCheck(t,e){return w(t,e)}static _typeCheckDateArray(t,e,s,i){return D(t,e,s,i)}static _typeCheckNumberArray(t,e,s){return _(t,e,s)}static dateConversion(t,e,s){return b(t,e,s)}static getFlattenDefaultOptions(){if(this._flattenDefaults)return this._flattenDefaults;const t=(e,s=[])=>Array.isArray(e)?[]:Object(e)===e?Object.entries(e).flatMap((([e,i])=>t(i,[...s,e]))):s.join(".");return this._flattenDefaults=t(f),this._flattenDefaults}static _validateConflicts(t){!t.display.sideBySide||t.display.components.clock&&(t.display.components.hours||t.display.components.minutes||t.display.components.seconds)||i.errorMessages.conflictingConfiguration("Cannot use side by side mode without the clock components"),t.restrictions.minDate&&t.restrictions.maxDate&&(t.restrictions.minDate.isAfter(t.restrictions.maxDate)&&i.errorMessages.conflictingConfiguration("minDate is after maxDate"),t.restrictions.maxDate.isBefore(t.restrictions.minDate)&&i.errorMessages.conflictingConfiguration("maxDate is before minDate")),t.multipleDates&&t.dateRange&&i.errorMessages.conflictingConfiguration('Cannot uss option "multipleDates" with "dateRange"')}}V.ignoreProperties=["meta","dayViewHeaderFormat","container","dateForms","ordinal"],V.isValue=t=>null!=t;class ${constructor(){this._dates=[],this.optionsStore=h.locate(u),this.validation=h.locate(m),this._eventEmitters=h.locate(g)}get picked(){return this._dates}get lastPicked(){return this._dates[this.lastPickedIndex]}get lastPickedIndex(){return 0===this._dates.length?0:this._dates.length-1}formatInput(t){return t?(t.localization=this.optionsStore.options.localization,t.format()):""}parseInput(t){return V.dateConversion(t,"input",this.optionsStore.options.localization)}setFromInput(t,e){if(!t)return void this.setValue(void 0,e);const s=this.parseInput(t);s&&(s.setLocalization(this.optionsStore.options.localization),this.setValue(s,e))}add(t){this._dates.push(t)}isPicked(t,e){if(!l.isValid(t))return!1;if(!e)return void 0!==this._dates.find((e=>e.isSame(t)));const s=r(e),i=t.format(s);return void 0!==this._dates.map((t=>t.format(s))).find((t=>t===i))}pickedIndex(t,e){if(!l.isValid(t))return-1;if(!e)return this._dates.map((t=>t.valueOf())).indexOf(t.valueOf());const s=r(e),i=t.format(s);return this._dates.map((t=>t.format(s))).indexOf(i)}clear(){this.optionsStore.unset=!0,this._eventEmitters.triggerEvent.emit({type:i.events.change,date:void 0,oldDate:this.lastPicked,isClear:!0,isValid:!0}),this._dates=[],this.optionsStore.input&&(this.optionsStore.input.value=""),this._eventEmitters.updateDisplay.emit("all")}static getStartEndYear(t,e){const s=t/10,i=Math.floor(e/t)*t;return[i,i+9*s,Math.floor(e/s)*s]}updateInput(t){if(!this.optionsStore.input)return;let e=this.formatInput(t);(this.optionsStore.options.multipleDates||this.optionsStore.options.dateRange)&&(e=this._dates.map((t=>this.formatInput(t))).join(this.optionsStore.options.multipleDatesSeparator)),this.optionsStore.input.value!=e&&(this.optionsStore.input.value=e)}setValue(e,s){const o=void 0===s,a=!e&&o;let n=this.optionsStore.unset?null:this._dates[s];if(!n&&!this.optionsStore.unset&&o&&a&&(n=this.lastPicked),e&&n?.isSame(e))return void this.updateInput(e);if(!e)return void this._setValueNull(a,s,n);s=s||0,e=e.clone,1!==this.optionsStore.options.stepping&&(e.minutes=Math.round(e.minutes/this.optionsStore.options.stepping)*this.optionsStore.options.stepping,e.startOf(t.Unit.minutes));const r=t=>{this._dates[s]=e,this._eventEmitters.updateViewDate.emit(e.clone),this.updateInput(e),this.optionsStore.unset=!1,this._eventEmitters.updateDisplay.emit("all"),this._eventEmitters.triggerEvent.emit({type:i.events.change,date:e,oldDate:n,isClear:a,isValid:t})};this.validation.isValid(e)&&this.validation.dateRangeIsValid(this._dates,s,e)?r(!0):(this.optionsStore.options.keepInvalid&&r(!1),this._eventEmitters.triggerEvent.emit({type:i.events.error,reason:i.errorMessages.failedToSetInvalidDate,date:e,oldDate:n}))}_setValueNull(t,e,s){!this.optionsStore.options.multipleDates||1===this._dates.length||t?(this.optionsStore.unset=!0,this._dates=[]):this._dates.splice(e,1),this.updateInput(),this._eventEmitters.triggerEvent.emit({type:i.events.change,date:void 0,oldDate:s,isClear:t,isValid:!0}),this._eventEmitters.updateDisplay.emit("all")}}var O;!function(t){t.next="next",t.previous="previous",t.changeCalendarView="changeCalendarView",t.selectMonth="selectMonth",t.selectYear="selectYear",t.selectDecade="selectDecade",t.selectDay="selectDay",t.selectHour="selectHour",t.selectMinute="selectMinute",t.selectSecond="selectSecond",t.incrementHours="incrementHours",t.incrementMinutes="incrementMinutes",t.incrementSeconds="incrementSeconds",t.decrementHours="decrementHours",t.decrementMinutes="decrementMinutes",t.decrementSeconds="decrementSeconds",t.toggleMeridiem="toggleMeridiem",t.togglePicker="togglePicker",t.showClock="showClock",t.showHours="showHours",t.showMinutes="showMinutes",t.showSeconds="showSeconds",t.clear="clear",t.close="close",t.today="today"}(O||(O={}));var z=O;class H{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate($),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");if(t.classList.add(i.css.daysContainer),t.append(...this._daysOfTheWeek()),this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(i.css.calendarWeeks,i.css.noHighlight),t.appendChild(e)}const{rangeHoverEvent:e,rangeHoverOutEvent:s}=this.handleMouseEvents(t);for(let o=0;o<42;o++){if(0!==o&&o%7==0&&this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(i.css.calendarWeeks,i.css.noHighlight),t.appendChild(e)}const a=document.createElement("div");a.setAttribute("data-action",z.selectDay),t.appendChild(a),matchMedia("(hover: hover)").matches&&this.optionsStore.options.dateRange&&(a.addEventListener("mouseover",e),a.addEventListener("mouseout",s))}return t}_update(e,s){const o=e.getElementsByClassName(i.css.daysContainer)[0];this._updateCalendarView(o);const a=this.optionsStore.viewDate.clone.startOf(t.Unit.month).startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).manipulate(12,t.Unit.hours);this._handleCalendarWeeks(o,a.clone),o.querySelectorAll(`[data-action="${z.selectDay}"]`).forEach((e=>{const o=[];o.push(i.css.day),a.isBefore(this.optionsStore.viewDate,t.Unit.month)&&o.push(i.css.old),a.isAfter(this.optionsStore.viewDate,t.Unit.month)&&o.push(i.css.new),this.optionsStore.unset||this.optionsStore.options.multipleDates||!this.dates.isPicked(a,t.Unit.date)||o.push(i.css.active),this.validation.isValid(a,t.Unit.date)||o.push(i.css.disabled),a.isSame(new l,t.Unit.date)&&o.push(i.css.today),0!==a.weekDay&&6!==a.weekDay||o.push(i.css.weekend),this._handleDateRange(a,o),s(t.Unit.date,a,o,e),e.classList.remove(...e.classList),e.classList.add(...o),e.setAttribute("data-value",this._dateToDataValue(a)),e.setAttribute("data-day",`${a.date}`),e.innerText=a.parts(void 0,{day:"numeric"}).day,a.manipulate(1,t.Unit.date)}))}_dateToDataValue(t){return l.isValid(t)?`${t.year}-${t.monthFormatted}-${t.dateFormatted}`:""}_handleDateRange(e,s){const o=this.dates.picked[0],a=this.dates.picked[1];this.optionsStore.options.dateRange&&(e.isBetween(o,a,t.Unit.date)&&s.push(i.css.rangeIn),e.isSame(o,t.Unit.date)&&s.push(i.css.rangeStart),e.isSame(a,t.Unit.date)&&s.push(i.css.rangeEnd))}handleMouseEvents(e){return{rangeHoverEvent:s=>{const o=s?.currentTarget;if(1!==this.dates.picked.length||o.classList.contains(i.css.disabled))return;const a=[...e.querySelectorAll(".day")],n=o.getAttribute("data-value"),r=l.fromString(n,{format:"yyyy-MM-dd"}),d=a.findIndex((t=>t.getAttribute("data-value")===n)),c=this.dates.picked[0],h=this.dates.picked[1],p=this._dateToDataValue(c),u=a.findIndex((t=>t.getAttribute("data-value")===p)),m=a[u];let y;r.isSame(c,t.Unit.date)||o.classList.remove(i.css.rangeStart),r.isSame(h,t.Unit.date)||o.classList.remove(i.css.rangeEnd),r.isBefore(c)?(o.classList.add(i.css.rangeStart),m?.classList.remove(i.css.rangeStart),m?.classList.add(i.css.rangeEnd),y=(t,e)=>e>d&&eeu),a.filter(y).forEach((t=>{t.classList.add(i.css.rangeIn)}))},rangeHoverOutEvent:s=>{const o=[...e.querySelectorAll(".day")];if(1===this.dates.picked.length&&o.forEach((t=>t.classList.remove(i.css.rangeIn))),1!==this.dates.picked.length)return;const a=s?.currentTarget,n=new l(a.getAttribute("data-value"));n.isSame(this.dates.picked[0],t.Unit.date)||a.classList.remove(i.css.rangeStart),n.isSame(this.dates.picked[1],t.Unit.date)||a.classList.remove(i.css.rangeEnd)}}}_updateCalendarView(e){if("calendar"!==this.optionsStore.currentView)return;const[s,o,a]=e.parentElement.getElementsByClassName(i.css.calendarHeader)[0].getElementsByTagName("div");o.setAttribute(i.css.daysContainer,this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)),this.optionsStore.options.display.components.month?o.classList.remove(i.css.disabled):o.classList.add(i.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.month),t.Unit.month)?s.classList.remove(i.css.disabled):s.classList.add(i.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.month),t.Unit.month)?a.classList.remove(i.css.disabled):a.classList.add(i.css.disabled)}_daysOfTheWeek(){const e=this.optionsStore.viewDate.clone.startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).startOf(t.Unit.date),s=[];if(document.createElement("div"),this.optionsStore.options.display.calendarWeeks){const t=document.createElement("div");t.classList.add(i.css.calendarWeeks,i.css.noHighlight),t.innerText="#",s.push(t)}for(let o=0;o<7;o++){const o=document.createElement("div");o.classList.add(i.css.dayOfTheWeek,i.css.noHighlight),o.innerText=e.format({weekday:"short"}),e.manipulate(1,t.Unit.date),s.push(o)}return s}_handleCalendarWeeks(e,s){[...e.querySelectorAll(`.${i.css.calendarWeeks}`)].filter((t=>"#"!==t.innerText)).forEach((e=>{e.innerText=`${s.week}`,s.manipulate(7,t.Unit.date)}))}}class x{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate($),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(i.css.monthsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",z.selectMonth),t.appendChild(e)}return t}_update(e,s){const o=e.getElementsByClassName(i.css.monthsContainer)[0];if("months"===this.optionsStore.currentView){const[e,s,a]=o.parentElement.getElementsByClassName(i.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(i.css.monthsContainer,this.optionsStore.viewDate.format({year:"numeric"})),this.optionsStore.options.display.components.year?s.classList.remove(i.css.disabled):s.classList.add(i.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.year),t.Unit.year)?e.classList.remove(i.css.disabled):e.classList.add(i.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.year),t.Unit.year)?a.classList.remove(i.css.disabled):a.classList.add(i.css.disabled)}const a=this.optionsStore.viewDate.clone.startOf(t.Unit.year);o.querySelectorAll(`[data-action="${z.selectMonth}"]`).forEach(((e,o)=>{const n=[];n.push(i.css.month),!this.optionsStore.unset&&this.dates.isPicked(a,t.Unit.month)&&n.push(i.css.active),this.validation.isValid(a,t.Unit.month)||n.push(i.css.disabled),s(t.Unit.month,a,n,e),e.classList.remove(...e.classList),e.classList.add(...n),e.setAttribute("data-value",`${o}`),e.innerText=`${a.format({month:"short"})}`,a.manipulate(1,t.Unit.month)}))}}class I{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate($),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(i.css.yearsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",z.selectYear),t.appendChild(e)}return t}_update(e,s){this._startYear=this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.year),this._endYear=this.optionsStore.viewDate.clone.manipulate(10,t.Unit.year);const o=e.getElementsByClassName(i.css.yearsContainer)[0];if("years"===this.optionsStore.currentView){const[e,s,a]=o.parentElement.getElementsByClassName(i.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(i.css.yearsContainer,`${this._startYear.format({year:"numeric"})}-${this._endYear.format({year:"numeric"})}`),this.optionsStore.options.display.components.decades?s.classList.remove(i.css.disabled):s.classList.add(i.css.disabled),this.validation.isValid(this._startYear,t.Unit.year)?e.classList.remove(i.css.disabled):e.classList.add(i.css.disabled),this.validation.isValid(this._endYear,t.Unit.year)?a.classList.remove(i.css.disabled):a.classList.add(i.css.disabled)}const a=this.optionsStore.viewDate.clone.startOf(t.Unit.year).manipulate(-1,t.Unit.year);o.querySelectorAll(`[data-action="${z.selectYear}"]`).forEach((e=>{const o=[];o.push(i.css.year),!this.optionsStore.unset&&this.dates.isPicked(a,t.Unit.year)&&o.push(i.css.active),this.validation.isValid(a,t.Unit.year)||o.push(i.css.disabled),s(t.Unit.year,a,o,e),e.classList.remove(...e.classList),e.classList.add(...o),e.setAttribute("data-value",`${a.year}`),e.innerText=a.format({year:"numeric"}),a.manipulate(1,t.Unit.year)}))}}class P{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate($),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(i.css.decadesContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",z.selectDecade),t.appendChild(e)}return t}_update(e,s){const[o,a]=$.getStartEndYear(100,this.optionsStore.viewDate.year);this._startDecade=this.optionsStore.viewDate.clone.startOf(t.Unit.year),this._startDecade.year=o,this._endDecade=this.optionsStore.viewDate.clone.startOf(t.Unit.year),this._endDecade.year=a;const n=e.getElementsByClassName(i.css.decadesContainer)[0],[r,d,l]=n.parentElement.getElementsByClassName(i.css.calendarHeader)[0].getElementsByTagName("div");"decades"===this.optionsStore.currentView&&(d.setAttribute(i.css.decadesContainer,`${this._startDecade.format({year:"numeric"})}-${this._endDecade.format({year:"numeric"})}`),this.validation.isValid(this._startDecade,t.Unit.year)?r.classList.remove(i.css.disabled):r.classList.add(i.css.disabled),this.validation.isValid(this._endDecade,t.Unit.year)?l.classList.remove(i.css.disabled):l.classList.add(i.css.disabled));const c=this.dates.picked.map((t=>t.year));n.querySelectorAll(`[data-action="${z.selectDecade}"]`).forEach(((e,o)=>{if(0===o)return e.classList.add(i.css.old),this._startDecade.year-10<0?(e.textContent=" ",r.classList.add(i.css.disabled),e.classList.add(i.css.disabled),void e.setAttribute("data-value","")):(e.innerText=this._startDecade.clone.manipulate(-10,t.Unit.year).format({year:"numeric"}),void e.setAttribute("data-value",`${this._startDecade.year}`));const a=[];a.push(i.css.decade);const n=this._startDecade.year,d=this._startDecade.year+9;!this.optionsStore.unset&&c.filter((t=>t>=n&&t<=d)).length>0&&a.push(i.css.active),s("decade",this._startDecade,a,e),e.classList.remove(...e.classList),e.classList.add(...a),e.setAttribute("data-value",`${this._startDecade.year}`),e.innerText=`${this._startDecade.format({year:"numeric"})}`,this._startDecade.manipulate(10,t.Unit.year)}))}}class N{constructor(){this._gridColumns="",this.optionsStore=h.locate(u),this.dates=h.locate($),this.validation=h.locate(m)}getPicker(t){const e=document.createElement("div");return e.classList.add(i.css.clockContainer),e.append(...this._grid(t)),e}_update(e){const s=e.getElementsByClassName(i.css.clockContainer)[0];let o=this.dates.lastPicked?.clone;if(!o&&this.optionsStore.options.useCurrent&&(o=this.optionsStore.viewDate.clone),s.querySelectorAll(".disabled").forEach((t=>t.classList.remove(i.css.disabled))),this.optionsStore.options.display.components.hours&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.hours),t.Unit.hours)||s.querySelector(`[data-action=${z.incrementHours}]`).classList.add(i.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.hours),t.Unit.hours)||s.querySelector(`[data-action=${z.decrementHours}]`).classList.add(i.css.disabled),s.querySelector(`[data-time-component=${t.Unit.hours}]`).innerText=o?o.getHoursFormatted(this.optionsStore.options.localization.hourCycle):"--"),this.optionsStore.options.display.components.minutes&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.minutes),t.Unit.minutes)||s.querySelector(`[data-action=${z.incrementMinutes}]`).classList.add(i.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.minutes),t.Unit.minutes)||s.querySelector(`[data-action=${z.decrementMinutes}]`).classList.add(i.css.disabled),s.querySelector(`[data-time-component=${t.Unit.minutes}]`).innerText=o?o.minutesFormatted:"--"),this.optionsStore.options.display.components.seconds&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.seconds),t.Unit.seconds)||s.querySelector(`[data-action=${z.incrementSeconds}]`).classList.add(i.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.seconds),t.Unit.seconds)||s.querySelector(`[data-action=${z.decrementSeconds}]`).classList.add(i.css.disabled),s.querySelector(`[data-time-component=${t.Unit.seconds}]`).innerText=o?o.secondsFormatted:"--"),this.optionsStore.isTwelveHour){const e=s.querySelector(`[data-action=${z.toggleMeridiem}]`),a=(o||this.optionsStore.viewDate).clone;e.innerText=a.meridiem(),this.validation.isValid(a.manipulate(a.hours>=12?-12:12,t.Unit.hours))?e.classList.remove(i.css.disabled):e.classList.add(i.css.disabled)}s.style.gridTemplateAreas=`"${this._gridColumns}"`}_grid(e){this._gridColumns="";const s=[],o=[],a=[],n=document.createElement("div"),r=e(this.optionsStore.options.display.icons.up),d=e(this.optionsStore.options.display.icons.down);n.classList.add(i.css.separator,i.css.noHighlight);const l=n.cloneNode(!0);l.innerHTML=":";const c=(t=!1)=>t?l.cloneNode(!0):n.cloneNode(!0);if(this.optionsStore.options.display.components.hours){let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementHour),e.setAttribute("data-action",z.incrementHours),e.appendChild(r.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickHour),e.setAttribute("data-action",z.showHours),e.setAttribute("data-time-component",t.Unit.hours),o.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementHour),e.setAttribute("data-action",z.decrementHours),e.appendChild(d.cloneNode(!0)),a.push(e),this._gridColumns+="a"}if(this.optionsStore.options.display.components.minutes){this._gridColumns+=" a",this.optionsStore.options.display.components.hours&&(s.push(c()),o.push(c(!0)),a.push(c()),this._gridColumns+=" a");let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementMinute),e.setAttribute("data-action",z.incrementMinutes),e.appendChild(r.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickMinute),e.setAttribute("data-action",z.showMinutes),e.setAttribute("data-time-component",t.Unit.minutes),o.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementMinute),e.setAttribute("data-action",z.decrementMinutes),e.appendChild(d.cloneNode(!0)),a.push(e)}if(this.optionsStore.options.display.components.seconds){this._gridColumns+=" a",this.optionsStore.options.display.components.minutes&&(s.push(c()),o.push(c(!0)),a.push(c()),this._gridColumns+=" a");let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementSecond),e.setAttribute("data-action",z.incrementSeconds),e.appendChild(r.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickSecond),e.setAttribute("data-action",z.showSeconds),e.setAttribute("data-time-component",t.Unit.seconds),o.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementSecond),e.setAttribute("data-action",z.decrementSeconds),e.appendChild(d.cloneNode(!0)),a.push(e)}if(this.optionsStore.isTwelveHour){this._gridColumns+=" a";let t=c();s.push(t);const e=document.createElement("button");e.setAttribute("title",this.optionsStore.options.localization.toggleMeridiem),e.setAttribute("data-action",z.toggleMeridiem),e.setAttribute("tabindex","-1"),i.css.toggleMeridiem.includes(",")?e.classList.add(...i.css.toggleMeridiem.split(",")):e.classList.add(i.css.toggleMeridiem),t=document.createElement("div"),t.classList.add(i.css.noHighlight),t.appendChild(e),o.push(t),t=c(),a.push(t)}return this._gridColumns=this._gridColumns.trim(),[...s,...o,...a]}}class F{constructor(){this.optionsStore=h.locate(u),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(i.css.hourContainer);for(let e=0;e<(this.optionsStore.isTwelveHour?12:24);e++){const e=document.createElement("div");e.setAttribute("data-action",z.selectHour),t.appendChild(e)}return t}_update(e,s){const o=e.getElementsByClassName(i.css.hourContainer)[0],a=this.optionsStore.viewDate.clone.startOf(t.Unit.date);o.querySelectorAll(`[data-action="${z.selectHour}"]`).forEach((e=>{const o=[];o.push(i.css.hour),this.validation.isValid(a,t.Unit.hours)||o.push(i.css.disabled),s(t.Unit.hours,a,o,e),e.classList.remove(...e.classList),e.classList.add(...o),e.setAttribute("data-value",`${a.hours}`),e.innerText=a.getHoursFormatted(this.optionsStore.options.localization.hourCycle),a.manipulate(1,t.Unit.hours)}))}}class B{constructor(){this.optionsStore=h.locate(u),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(i.css.minuteContainer);const e=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;for(let s=0;s<60/e;s++){const e=document.createElement("div");e.setAttribute("data-action",z.selectMinute),t.appendChild(e)}return t}_update(e,s){const o=e.getElementsByClassName(i.css.minuteContainer)[0],a=this.optionsStore.viewDate.clone.startOf(t.Unit.hours),n=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;o.querySelectorAll(`[data-action="${z.selectMinute}"]`).forEach((e=>{const o=[];o.push(i.css.minute),this.validation.isValid(a,t.Unit.minutes)||o.push(i.css.disabled),s(t.Unit.minutes,a,o,e),e.classList.remove(...e.classList),e.classList.add(...o),e.setAttribute("data-value",`${a.minutes}`),e.innerText=a.minutesFormatted,a.manipulate(n,t.Unit.minutes)}))}}class W{constructor(){this.optionsStore=h.locate(u),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(i.css.secondContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",z.selectSecond),t.appendChild(e)}return t}_update(e,s){const o=e.getElementsByClassName(i.css.secondContainer)[0],a=this.optionsStore.viewDate.clone.startOf(t.Unit.minutes);o.querySelectorAll(`[data-action="${z.selectSecond}"]`).forEach((e=>{const o=[];o.push(i.css.second),this.validation.isValid(a,t.Unit.seconds)||o.push(i.css.disabled),s(t.Unit.seconds,a,o,e),e.classList.remove(...e.classList),e.classList.add(...o),e.setAttribute("data-value",`${a.seconds}`),e.innerText=a.secondsFormatted,a.manipulate(5,t.Unit.seconds)}))}}class q{static toggle(t){t.classList.contains(i.css.show)?this.hide(t):this.show(t)}static showImmediately(t){t.classList.remove(i.css.collapsing),t.classList.add(i.css.collapse,i.css.show),t.style.height=""}static show(t){if(t.classList.contains(i.css.collapsing)||t.classList.contains(i.css.show))return;t.style.height="0",t.classList.remove(i.css.collapse),t.classList.add(i.css.collapsing),setTimeout((()=>{q.showImmediately(t)}),this.getTransitionDurationFromElement(t)),t.style.height=`${t.scrollHeight}px`}static hideImmediately(t){t&&(t.classList.remove(i.css.collapsing,i.css.show),t.classList.add(i.css.collapse))}static hide(t){if(t.classList.contains(i.css.collapsing)||!t.classList.contains(i.css.show))return;t.style.height=`${t.getBoundingClientRect().height}px`;t.offsetHeight,t.classList.remove(i.css.collapse,i.css.show),t.classList.add(i.css.collapsing),t.style.height="",setTimeout((()=>{q.hideImmediately(t)}),this.getTransitionDurationFromElement(t))}}q.getTransitionDurationFromElement=t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:s}=window.getComputedStyle(t);const i=Number.parseFloat(e),o=Number.parseFloat(s);return i||o?(e=e.split(",")[0],s=s.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(s))):0};class Y{constructor(){this._isVisible=!1,this._documentClickEvent=t=>{this.optionsStore.options.debug||window.debug||!this._isVisible||t.composedPath().includes(this.widget)||t.composedPath()?.includes(this.optionsStore.element)||this.hide()},this._actionsClickEvent=t=>{this._eventEmitters.action.emit({e:t})},this.optionsStore=h.locate(u),this.validation=h.locate(m),this.dates=h.locate($),this.dateDisplay=h.locate(H),this.monthDisplay=h.locate(x),this.yearDisplay=h.locate(I),this.decadeDisplay=h.locate(P),this.timeDisplay=h.locate(N),this.hourDisplay=h.locate(F),this.minuteDisplay=h.locate(B),this.secondDisplay=h.locate(W),this._eventEmitters=h.locate(g),this._widget=void 0,this._eventEmitters.updateDisplay.subscribe((t=>{this._update(t)}))}get widget(){return this._widget}get dateContainer(){return this.widget?.querySelector(`div.${i.css.dateContainer}`)}get timeContainer(){return this.widget?.querySelector(`div.${i.css.timeContainer}`)}get isVisible(){return this._isVisible}_update(e){if(this.widget)switch(e){case t.Unit.seconds:this.secondDisplay._update(this.widget,this.paint);break;case t.Unit.minutes:this.minuteDisplay._update(this.widget,this.paint);break;case t.Unit.hours:this.hourDisplay._update(this.widget,this.paint);break;case t.Unit.date:this.dateDisplay._update(this.widget,this.paint);break;case t.Unit.month:this.monthDisplay._update(this.widget,this.paint);break;case t.Unit.year:this.yearDisplay._update(this.widget,this.paint);break;case"clock":if(!this._hasTime)break;this.timeDisplay._update(this.widget),this._update(t.Unit.hours),this._update(t.Unit.minutes),this._update(t.Unit.seconds);break;case"calendar":this._update(t.Unit.date),this._update(t.Unit.year),this._update(t.Unit.month),this.decadeDisplay._update(this.widget,this.paint),this._updateCalendarHeader();break;case"all":this._hasTime&&this._update("clock"),this._hasDate&&this._update("calendar")}}paint(t,e,s,i){}show(){if(null==this.widget){if(this._showSetDefaultIfNeeded(),this._buildWidget(),this._updateTheme(),this._showSetupViewMode(),this.optionsStore.options.display.inline)this.optionsStore.element.appendChild(this.widget);else{const t=this.optionsStore.options?.container||document.body,e=this.optionsStore.options?.display?.placement||"bottom";t.appendChild(this.widget),this.createPopup(this.optionsStore.element,this.widget,{modifiers:[{name:"eventListeners",enabled:!0}],placement:"rtl"===document.documentElement.dir?`${e}-end`:`${e}-start`}).then()}"clock"==this.optionsStore.options.display.viewMode&&this._eventEmitters.action.emit({e:null,action:z.showClock}),this.widget.querySelectorAll("[data-action]").forEach((t=>t.addEventListener("click",this._actionsClickEvent))),this._hasTime&&this.optionsStore.options.display.sideBySide&&(this.timeDisplay._update(this.widget),this.widget.getElementsByClassName(i.css.clockContainer)[0].style.display="grid")}this.widget.classList.add(i.css.show),this.optionsStore.options.display.inline||(this.updatePopup(),document.addEventListener("click",this._documentClickEvent)),this._eventEmitters.triggerEvent.emit({type:i.events.show}),this._isVisible=!0}_showSetupViewMode(){const t=this._hasTime&&!this._hasDate;t?(this.optionsStore.currentView="clock",this._eventEmitters.action.emit({e:null,action:z.showClock})):this.optionsStore.currentCalendarViewMode||(this.optionsStore.currentCalendarViewMode=this.optionsStore.minimumCalendarViewMode),t||"clock"===this.optionsStore.options.display.viewMode||(this._hasTime&&(this.optionsStore.options.display.sideBySide?q.show(this.timeContainer):q.hideImmediately(this.timeContainer)),q.show(this.dateContainer)),this._hasDate&&this._showMode()}_showSetDefaultIfNeeded(){if(0==this.dates.picked.length){if(this.optionsStore.options.useCurrent&&!this.optionsStore.options.defaultDate){const e=(new l).setLocalization(this.optionsStore.options.localization);if(!this.optionsStore.options.keepInvalid){let s=0,i=1;for(this.optionsStore.options.restrictions.maxDate?.isBefore(e)&&(i=-1);!this.validation.isValid(e)&&s>31;)e.manipulate(i,t.Unit.date),s++}this.dates.setValue(e)}this.optionsStore.options.defaultDate&&this.dates.setValue(this.optionsStore.options.defaultDate)}}async createPopup(t,e,s){let i;if(window?.Popper)i=window?.Popper?.createPopper;else{const{createPopper:t}=await import("@popperjs/core");i=t}i&&(this._popperInstance=i(t,e,s))}updatePopup(){this._popperInstance?.update()}_showMode(t){if(!this.widget)return;if(t){const e=Math.max(this.optionsStore.minimumCalendarViewMode,Math.min(3,this.optionsStore.currentCalendarViewMode+t));if(this.optionsStore.currentCalendarViewMode==e)return;this.optionsStore.currentCalendarViewMode=e}this.widget.querySelectorAll(`.${i.css.dateContainer} > div:not(.${i.css.calendarHeader}), .${i.css.timeContainer} > div:not(.${i.css.clockContainer})`).forEach((t=>t.style.display="none"));const e=p[this.optionsStore.currentCalendarViewMode],s=this.widget.querySelector(`.${e.className}`);switch(e.className){case i.css.decadesContainer:this.decadeDisplay._update(this.widget,this.paint);break;case i.css.yearsContainer:this.yearDisplay._update(this.widget,this.paint);break;case i.css.monthsContainer:this.monthDisplay._update(this.widget,this.paint);break;case i.css.daysContainer:this.dateDisplay._update(this.widget,this.paint)}s.style.display="grid",this.optionsStore.options.display.sideBySide&&(this.widget.querySelectorAll(`.${i.css.clockContainer}`)[0].style.display="grid"),this._updateCalendarHeader(),this._eventEmitters.viewUpdate.emit()}_updateTheme(t){if(this.widget){if(t){if(this.optionsStore.options.display.theme===t)return;this.optionsStore.options.display.theme=t}this.widget.classList.remove("light","dark"),this.widget.classList.add(this._getThemeClass()),"auto"===this.optionsStore.options.display.theme?window.matchMedia(i.css.isDarkPreferredQuery).addEventListener("change",(()=>this._updateTheme())):window.matchMedia(i.css.isDarkPreferredQuery).removeEventListener("change",(()=>this._updateTheme()))}}_getThemeClass(){const t=this.optionsStore.options.display.theme||"auto",e=window.matchMedia&&window.matchMedia(i.css.isDarkPreferredQuery).matches;switch(t){case"light":return i.css.lightTheme;case"dark":return i.css.darkTheme;case"auto":return e?i.css.darkTheme:i.css.lightTheme}}_updateCalendarHeader(){if(!this._hasDate)return;const t=[...this.widget.querySelector(`.${i.css.dateContainer} div[style*="display: grid"]`).classList].find((t=>t.startsWith(i.css.dateContainer))),[e,s,o]=this.widget.getElementsByClassName(i.css.calendarHeader)[0].getElementsByTagName("div");switch(t){case i.css.decadesContainer:e.setAttribute("title",this.optionsStore.options.localization.previousCentury),s.setAttribute("title",""),o.setAttribute("title",this.optionsStore.options.localization.nextCentury);break;case i.css.yearsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousDecade),s.setAttribute("title",this.optionsStore.options.localization.selectDecade),o.setAttribute("title",this.optionsStore.options.localization.nextDecade);break;case i.css.monthsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousYear),s.setAttribute("title",this.optionsStore.options.localization.selectYear),o.setAttribute("title",this.optionsStore.options.localization.nextYear);break;case i.css.daysContainer:e.setAttribute("title",this.optionsStore.options.localization.previousMonth),s.setAttribute("title",this.optionsStore.options.localization.selectMonth),o.setAttribute("title",this.optionsStore.options.localization.nextMonth),s.setAttribute(t,this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat))}s.innerText=s.getAttribute(t)}hide(){this.widget&&this._isVisible&&(this.widget.classList.remove(i.css.show),this._isVisible&&(this._eventEmitters.triggerEvent.emit({type:i.events.hide,date:this.optionsStore.unset?null:this.dates.lastPicked?.clone}),this._isVisible=!1),document.removeEventListener("click",this._documentClickEvent))}toggle(){return this._isVisible?this.hide():this.show()}_dispose(){document.removeEventListener("click",this._documentClickEvent),this.widget&&(this.widget.querySelectorAll("[data-action]").forEach((t=>t.removeEventListener("click",this._actionsClickEvent))),this.widget.parentNode.removeChild(this.widget),this._widget=void 0)}_buildWidget(){const t=document.createElement("div");t.classList.add(i.css.widget);const e=document.createElement("div");e.classList.add(i.css.dateContainer),e.append(this.getHeadTemplate(),this.decadeDisplay.getPicker(),this.yearDisplay.getPicker(),this.monthDisplay.getPicker(),this.dateDisplay.getPicker());const s=document.createElement("div");s.classList.add(i.css.timeContainer),s.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this))),s.appendChild(this.hourDisplay.getPicker()),s.appendChild(this.minuteDisplay.getPicker()),s.appendChild(this.secondDisplay.getPicker());const o=document.createElement("div");if(o.classList.add(i.css.toolbar),o.append(...this.getToolbarElements()),this.optionsStore.options.display.inline&&t.classList.add(i.css.inline),this.optionsStore.options.display.calendarWeeks&&t.classList.add("calendarWeeks"),this.optionsStore.options.display.sideBySide&&this._hasDateAndTime)return void this._buildWidgetSideBySide(t,e,s,o);"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(o);const a=(e,s,o,a)=>{e&&(s&&(o.classList.add(i.css.collapse),a&&o.classList.add(i.css.show)),t.appendChild(o))};a(this._hasDate,this._hasTime,e,"clock"!==this.optionsStore.options.display.viewMode),a(this._hasTime,this._hasDate,s,"clock"===this.optionsStore.options.display.viewMode),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(o);const n=document.createElement("div");n.classList.add("arrow"),n.setAttribute("data-popper-arrow",""),t.appendChild(n),this._widget=t}_buildWidgetSideBySide(t,e,s,o){t.classList.add(i.css.sideBySide),"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(o);const a=document.createElement("div");a.classList.add("td-row"),e.classList.add("td-half"),s.classList.add("td-half"),a.appendChild(e),a.appendChild(s),t.appendChild(a),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(o),this._widget=t}get _hasTime(){return this.optionsStore.options.display.components.clock&&(this.optionsStore.options.display.components.hours||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.components.seconds)}get _hasDate(){return this.optionsStore.options.display.components.calendar&&(this.optionsStore.options.display.components.year||this.optionsStore.options.display.components.month||this.optionsStore.options.display.components.date)}get _hasDateAndTime(){return this._hasDate&&this._hasTime}getToolbarElements(){const t=[];if(this.optionsStore.options.display.buttons.today){const e=document.createElement("div");e.setAttribute("data-action",z.today),e.setAttribute("title",this.optionsStore.options.localization.today),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.today)),t.push(e)}if(!this.optionsStore.options.display.sideBySide&&this._hasDate&&this._hasTime){let e,s;"clock"===this.optionsStore.options.display.viewMode?(e=this.optionsStore.options.localization.selectDate,s=this.optionsStore.options.display.icons.date):(e=this.optionsStore.options.localization.selectTime,s=this.optionsStore.options.display.icons.time);const i=document.createElement("div");i.setAttribute("data-action",z.togglePicker),i.setAttribute("title",e),i.appendChild(this._iconTag(s)),t.push(i)}if(this.optionsStore.options.display.buttons.clear){const e=document.createElement("div");e.setAttribute("data-action",z.clear),e.setAttribute("title",this.optionsStore.options.localization.clear),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.clear)),t.push(e)}if(this.optionsStore.options.display.buttons.close){const e=document.createElement("div");e.setAttribute("data-action",z.close),e.setAttribute("title",this.optionsStore.options.localization.close),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.close)),t.push(e)}return t}getHeadTemplate(){const t=document.createElement("div");t.classList.add(i.css.calendarHeader);const e=document.createElement("div");e.classList.add(i.css.previous),e.setAttribute("data-action",z.previous),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.previous));const s=document.createElement("div");s.classList.add(i.css.switch),s.setAttribute("data-action",z.changeCalendarView);const o=document.createElement("div");return o.classList.add(i.css.next),o.setAttribute("data-action",z.next),o.appendChild(this._iconTag(this.optionsStore.options.display.icons.next)),t.append(e,s,o),t}_iconTag(t){if("sprites"===this.optionsStore.options.display.icons.type){const e=document.createElementNS("http://www.w3.org/2000/svg","svg"),s=document.createElementNS("http://www.w3.org/2000/svg","use");return s.setAttribute("xlink:href",t),s.setAttribute("href",t),e.appendChild(s),e}const e=document.createElement("i");return e.classList.add(...t.split(" ")),e}_rebuild(){const t=this._isVisible;this._dispose(),t&&this.show()}}class j{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate($),this.validation=h.locate(m),this.display=h.locate(Y),this._eventEmitters=h.locate(g),this._eventEmitters.action.subscribe((t=>{this.do(t.e,t.action)}))}do(e,s){const o=e?.currentTarget;if(o?.classList?.contains(i.css.disabled))return;s=s||o?.dataset?.action;const a=(this.dates.lastPicked||this.optionsStore.viewDate).clone;switch(s){case z.next:case z.previous:this.handleNextPrevious(s);break;case z.changeCalendarView:this.display._showMode(1),this.display._updateCalendarHeader();break;case z.selectMonth:case z.selectYear:case z.selectDecade:this.handleSelectCalendarMode(s,o);break;case z.selectDay:this.handleSelectDay(o);break;case z.selectHour:{let t=+o.dataset.value;a.hours>=12&&this.optionsStore.isTwelveHour&&(t+=12),a.hours=t,this.dates.setValue(a,this.dates.lastPickedIndex),this.hideOrClock(e);break}case z.selectMinute:a.minutes=+o.dataset.value,this.dates.setValue(a,this.dates.lastPickedIndex),this.hideOrClock(e);break;case z.selectSecond:a.seconds=+o.dataset.value,this.dates.setValue(a,this.dates.lastPickedIndex),this.hideOrClock(e);break;case z.incrementHours:this.manipulateAndSet(a,t.Unit.hours);break;case z.incrementMinutes:this.manipulateAndSet(a,t.Unit.minutes,this.optionsStore.options.stepping);break;case z.incrementSeconds:this.manipulateAndSet(a,t.Unit.seconds);break;case z.decrementHours:this.manipulateAndSet(a,t.Unit.hours,-1);break;case z.decrementMinutes:this.manipulateAndSet(a,t.Unit.minutes,-1*this.optionsStore.options.stepping);break;case z.decrementSeconds:this.manipulateAndSet(a,t.Unit.seconds,-1);break;case z.toggleMeridiem:this.manipulateAndSet(a,t.Unit.hours,this.dates.lastPicked.hours>=12?-12:12);break;case z.togglePicker:this.handleToggle(o);break;case z.showClock:case z.showHours:case z.showMinutes:case z.showSeconds:this.optionsStore.options.display.sideBySide||"clock"===this.optionsStore.currentView||(q.hideImmediately(this.display.dateContainer),q.showImmediately(this.display.timeContainer)),this.handleShowClockContainers(s);break;case z.clear:this.dates.setValue(null),this.display._updateCalendarHeader();break;case z.close:this.display.hide();break;case z.today:{const e=(new l).setLocalization(this.optionsStore.options.localization);this._eventEmitters.updateViewDate.emit(e),this.validation.isValid(e,t.Unit.date)&&this.dates.setValue(e,this.dates.lastPickedIndex);break}}}handleShowClockContainers(e){if(!this.display._hasTime)return void i.errorMessages.throwError("Cannot show clock containers when time is disabled.");this.optionsStore.currentView="clock",this.display.widget.querySelectorAll(`.${i.css.timeContainer} > div`).forEach((t=>t.style.display="none"));let s="";switch(e){case z.showClock:s=i.css.clockContainer,this.display._update("clock");break;case z.showHours:s=i.css.hourContainer,this.display._update(t.Unit.hours);break;case z.showMinutes:s=i.css.minuteContainer,this.display._update(t.Unit.minutes);break;case z.showSeconds:s=i.css.secondContainer,this.display._update(t.Unit.seconds)}this.display.widget.getElementsByClassName(s)[0].style.display="grid"}handleNextPrevious(t){const{unit:e,step:s}=p[this.optionsStore.currentCalendarViewMode];t===z.next?this.optionsStore.viewDate.manipulate(s,e):this.optionsStore.viewDate.manipulate(-1*s,e),this._eventEmitters.viewUpdate.emit(),this.display._showMode()}hideOrClock(t){this.optionsStore.isTwelveHour||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline?this.do(t,z.showClock):this.display.hide()}manipulateAndSet(t,e,s=1){const i=t.manipulate(s,e);this.validation.isValid(i,e)&&this.dates.setValue(i,this.dates.lastPickedIndex)}handleSelectCalendarMode(t,e){const s=+e.dataset.value;switch(t){case z.selectMonth:this.optionsStore.viewDate.month=s;break;case z.selectYear:case z.selectDecade:this.optionsStore.viewDate.year=s}this.optionsStore.currentCalendarViewMode===this.optionsStore.minimumCalendarViewMode?(this.dates.setValue(this.optionsStore.viewDate,this.dates.lastPickedIndex),this.optionsStore.options.display.inline||this.display.hide()):this.display._showMode(-1)}handleToggle(t){t.getAttribute("title")===this.optionsStore.options.localization.selectDate?(t.setAttribute("title",this.optionsStore.options.localization.selectTime),t.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.time).outerHTML,this.display._updateCalendarHeader(),this.optionsStore.refreshCurrentView()):(t.setAttribute("title",this.optionsStore.options.localization.selectDate),t.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.date).outerHTML,this.display._hasTime&&(this.handleShowClockContainers(z.showClock),this.display._update("clock"))),this.display.widget.querySelectorAll(`.${i.css.dateContainer}, .${i.css.timeContainer}`).forEach((t=>q.toggle(t))),this._eventEmitters.viewUpdate.emit()}handleSelectDay(e){const s=this.optionsStore.viewDate.clone;e.classList.contains(i.css.old)&&s.manipulate(-1,t.Unit.month),e.classList.contains(i.css.new)&&s.manipulate(1,t.Unit.month),s.date=+e.dataset.day,this.optionsStore.options.dateRange?this.handleDateRange(s):this.optionsStore.options.multipleDates?this.handleMultiDate(s):this.dates.setValue(s,this.dates.lastPickedIndex),this.display._hasTime||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline||this.optionsStore.options.multipleDates||this.optionsStore.options.dateRange||this.display.hide()}handleMultiDate(e){let s=this.dates.pickedIndex(e,t.Unit.date);console.log(s),-1!==s?this.dates.setValue(null,s):(s=this.dates.lastPickedIndex+1,0===this.dates.picked.length&&(s=0),this.dates.setValue(e,s))}handleDateRange(t){switch(this.dates.picked.length){case 2:this.dates.clear();break;case 1:{const e=this.dates.picked[0];if(t.getTime()===e.getTime()){this.dates.clear();break}return t.isBefore(e)?(this.dates.setValue(t,0),void this.dates.setValue(e,1)):void this.dates.setValue(t,1)}}this.dates.setValue(t,0)}}class R{constructor(t,e={}){this._subscribers={},this._isDisabled=!1,this._inputChangeEvent=t=>{const e=t?.detail;if(e)return;const s=()=>{this.dates.lastPicked&&(this.optionsStore.viewDate=this.dates.lastPicked.clone)},i=this.optionsStore.input.value;if(this.optionsStore.options.multipleDates)try{const t=i.split(this.optionsStore.options.multipleDatesSeparator);for(let e=0;e{this.optionsStore.element?.disabled||this.optionsStore.input?.disabled||this.toggle()},h=new c,this._eventEmitters=h.locate(g),this.optionsStore=h.locate(u),this.display=h.locate(Y),this.dates=h.locate($),this.actions=h.locate(j),t||i.errorMessages.mustProvideElement(),this.optionsStore.element=t,this._initializeOptions(e,f,!0),this.optionsStore.viewDate.setLocalization(this.optionsStore.options.localization),this.optionsStore.unset=!0,this._initializeInput(),this._initializeToggle(),this.optionsStore.options.display.inline&&this.display.show(),this._eventEmitters.triggerEvent.subscribe((t=>{this._triggerEvent(t)})),this._eventEmitters.viewUpdate.subscribe((()=>{this._viewUpdate()})),this._eventEmitters.updateViewDate.subscribe((t=>{this.viewDate=t}))}get viewDate(){return this.optionsStore.viewDate}set viewDate(t){this.optionsStore.viewDate=t,this.optionsStore.viewDate.setLocalization(this.optionsStore.options.localization),this.display._update("clock"===this.optionsStore.currentView?"clock":"calendar")}updateOptions(t,e=!1){e?this._initializeOptions(t,f):this._initializeOptions(t,this.optionsStore.options),this.optionsStore.viewDate.setLocalization(this.optionsStore.options.localization),this.display._rebuild()}toggle(){this._isDisabled||this.display.toggle()}show(){this._isDisabled||this.display.show()}hide(){this.display.hide()}disable(){this._isDisabled=!0,this.optionsStore.input?.setAttribute("disabled","disabled"),this.display.hide()}enable(){this._isDisabled=!1,this.optionsStore.input?.removeAttribute("disabled")}clear(){this.optionsStore.input.value="",this.dates.clear()}subscribe(t,e){let s;"string"==typeof t&&(t=[t]),s=Array.isArray(e)?e:[e],t.length!==s.length&&i.errorMessages.subscribeMismatch();const o=[];for(let e=0;e{e(t)}))}_viewUpdate(){this._triggerEvent({type:i.events.update,viewDate:this.optionsStore.viewDate.clone})}_unsubscribe(t,e){this._subscribers[t].splice(e,1)}_initializeOptions(t,e,s=!1){let i=V.deepCopy(t);i=V._mergeOptions(i,e),s&&(i=V._dataToOptions(this.optionsStore.element,i)),V._validateConflicts(i),i.viewDate=i.viewDate.setLocalization(i.localization),this.optionsStore.viewDate.isSame(i.viewDate)||(this.optionsStore.viewDate=i.viewDate),i.display.components.year&&(this.optionsStore.minimumCalendarViewMode=2),i.display.components.month&&(this.optionsStore.minimumCalendarViewMode=1),i.display.components.date&&(this.optionsStore.minimumCalendarViewMode=0),this.optionsStore.currentCalendarViewMode=Math.max(this.optionsStore.minimumCalendarViewMode,this.optionsStore.currentCalendarViewMode),p[this.optionsStore.currentCalendarViewMode].name!==i.display.viewMode&&(this.optionsStore.currentCalendarViewMode=Math.max(p.findIndex((t=>t.name===i.display.viewMode)),this.optionsStore.minimumCalendarViewMode)),this.display?.isVisible&&this.display._update("all"),i.display.components.useTwentyfourHour&&void 0===i.localization.hourCycle?i.localization.hourCycle="h24":void 0===i.localization.hourCycle&&(i.localization.hourCycle=d(i.localization.locale)),this.optionsStore.options=i}_initializeInput(){if("INPUT"==this.optionsStore.element.tagName)this.optionsStore.input=this.optionsStore.element;else{const t=this.optionsStore.element.dataset.tdTargetInput;this.optionsStore.input=null==t||"nearest"==t?this.optionsStore.element.querySelector("input"):this.optionsStore.element.querySelector(t)}this.optionsStore.input&&(!this.optionsStore.input.value&&this.optionsStore.options.defaultDate&&(this.optionsStore.input.value=this.dates.formatInput(this.optionsStore.options.defaultDate)),this.optionsStore.input.addEventListener("change",this._inputChangeEvent),this.optionsStore.options.allowInputToggle&&this.optionsStore.input.addEventListener("click",this._toggleClickEvent),this.optionsStore.input.value&&this._inputChangeEvent())}_initializeToggle(){if(this.optionsStore.options.display.inline)return;let t=this.optionsStore.element.dataset.tdTargetToggle;"nearest"==t&&(t='[data-td-toggle="datetimepicker"]'),this._toggle=null==t?this.optionsStore.element:this.optionsStore.element.querySelector(t),this._toggle.addEventListener("click",this._toggleClickEvent)}_handleAfterChangeEvent(t){!this.optionsStore.options.promptTimeOnDateChange||this.optionsStore.options.multipleDates||this.optionsStore.options.display.inline||this.optionsStore.options.display.sideBySide||!this.display._hasTime||this.display.widget?.getElementsByClassName(i.css.show)[0].classList.contains(i.css.timeContainer)||!t.oldDate&&this.optionsStore.options.useCurrent||t.oldDate&&t.date?.isSame(t.oldDate)||(clearTimeout(this._currentPromptTimeTimeout),this._currentPromptTimeTimeout=setTimeout((()=>{this.display.widget&&this._eventEmitters.action.emit({e:{currentTarget:this.display.widget.querySelector(`.${i.css.switch}`)},action:z.togglePicker})}),this.optionsStore.options.promptTimeOnDateChangeTransitionDelay))}}const Q={},J=t=>{Q[t.name]||(Q[t.name]=t.localization)},K=t=>{const e=Q[t];e&&(f.localization=e)},Z=function(t,e=undefined){return t?(t.installed||(t(e,{TempusDominus:R,Dates:$,Display:Y,DateTime:l,Namespace:i},X),t.installed=!0),X):X},G="6.4.4",X={TempusDominus:R,extend:Z,loadLocale:J,locale:K,Namespace:i,DefaultOptions:f,DateTime:l,Unit:t.Unit,version:G,DefaultEnLocalization:S};t.DateTime=l,t.DefaultEnLocalization=S,t.DefaultOptions=f,t.Namespace=i,t.TempusDominus=R,t.extend=Z,t.loadLocale=J,t.locale=K,t.version=G,Object.defineProperty(t,"__esModule",{value:!0})})); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).tempusDominus={})}(this,(function(t){"use strict";class e extends Error{}const s="tempus-dominus";class i{}i.NAME=s,i.dataKey="td",i.events=new class{constructor(){this.key=".td",this.change=`change${this.key}`,this.update=`update${this.key}`,this.error=`error${this.key}`,this.show=`show${this.key}`,this.hide=`hide${this.key}`,this.blur=`blur${this.key}`,this.focus=`focus${this.key}`,this.keyup=`keyup${this.key}`,this.keydown=`keydown${this.key}`}},i.css=new class{constructor(){this.widget=`${s}-widget`,this.calendarHeader="calendar-header",this.switch="picker-switch",this.toolbar="toolbar",this.noHighlight="no-highlight",this.sideBySide="timepicker-sbs",this.previous="previous",this.next="next",this.disabled="disabled",this.old="old",this.new="new",this.active="active",this.dateContainer="date-container",this.decadesContainer=`${this.dateContainer}-decades`,this.decade="decade",this.yearsContainer=`${this.dateContainer}-years`,this.year="year",this.monthsContainer=`${this.dateContainer}-months`,this.month="month",this.daysContainer=`${this.dateContainer}-days`,this.day="day",this.calendarWeeks="cw",this.dayOfTheWeek="dow",this.today="today",this.weekend="weekend",this.rangeIn="range-in",this.rangeStart="range-start",this.rangeEnd="range-end",this.timeContainer="time-container",this.separator="separator",this.clockContainer=`${this.timeContainer}-clock`,this.hourContainer=`${this.timeContainer}-hour`,this.minuteContainer=`${this.timeContainer}-minute`,this.secondContainer=`${this.timeContainer}-second`,this.hour="hour",this.minute="minute",this.second="second",this.toggleMeridiem="toggleMeridiem",this.show="show",this.collapsing="td-collapsing",this.collapse="td-collapse",this.inline="inline",this.lightTheme="light",this.darkTheme="dark",this.isDarkPreferredQuery="(prefers-color-scheme: dark)"}},i.errorMessages=new class{constructor(){this.base="TD:",this.failedToSetInvalidDate="Failed to set invalid date",this.failedToParseInput="Failed parse input field"}unexpectedOption(t){const s=new e(`${this.base} Unexpected option: ${t} does not match a known option.`);throw s.code=1,s}unexpectedOptions(t){const s=new e(`${this.base}: ${t.join(", ")}`);throw s.code=1,s}unexpectedOptionValue(t,s,i){const o=new e(`${this.base} Unexpected option value: ${t} does not accept a value of "${s}". Valid values are: ${i.join(", ")}`);throw o.code=2,o}typeMismatch(t,s,i){const o=new e(`${this.base} Mismatch types: ${t} has a type of ${s} instead of the required ${i}`);throw o.code=3,o}numbersOutOfRange(t,s,i){const o=new e(`${this.base} ${t} expected an array of number between ${s} and ${i}.`);throw o.code=4,o}failedToParseDate(t,s,i=!1){const o=new e(`${this.base} Could not correctly parse "${s}" to a date for ${t}.`);if(o.code=5,!i)throw o;console.warn(o)}mustProvideElement(){const t=new e(`${this.base} No element was provided.`);throw t.code=6,t}subscribeMismatch(){const t=new e(`${this.base} The subscribed events does not match the number of callbacks`);throw t.code=7,t}conflictingConfiguration(t){const s=new e(`${this.base} A configuration value conflicts with another rule. ${t}`);throw s.code=8,s}customDateFormatError(t){const s=new e(`${this.base} Custom Date Format: ${t}`);throw s.code=9,s}dateString(){console.warn(`${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`)}deprecatedWarning(t,e){console.warn(`${this.base} Warning ${t} is deprecated and will be removed in a future version. ${e}`)}throwError(t){const s=new e(`${this.base} ${t}`);throw s.code=9,s}};var o,a={...{locale:"default",hourCycle:void 0,dateFormats:{LTS:"h:mm:ss T",LT:"h:mm T",L:"MM/dd/yyyy",LL:"MMMM d, yyyy",LLL:"MMMM d, yyyy h:mm T",LLLL:"dddd, MMMM d, yyyy h:mm T"},ordinal:t=>{const e=["th","st","nd","rd"],s=t%100;return`[${t}${e[(s-20)%10]||e[s]||e[0]}]`},format:"L LT"}};t.Unit=void 0,(o=t.Unit||(t.Unit={})).seconds="seconds",o.minutes="minutes",o.hours="hours",o.date="date",o.month="month",o.year="year";const n={month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"},r=t=>{switch(t){case"date":return{dateStyle:"short"};case"month":return{month:"numeric",year:"numeric"};case"year":return{year:"numeric"}}},d=t=>{if(!t)return"h12";const e={hour:"2-digit",minute:"2-digit",numberingSystem:"latn"},s=(new l).setLocalization({locale:t});s.hours=0;const i=s.parts(void 0,e).hour;if("12"===i)return"h12";if("24"===i)return"h24";s.hours=23;const o=s.parts(void 0,e).hour;return"00"===i&&"11"===o?"h11":"00"===i&&"23"===o?"h23":void console.warn(`couldn't determine hour cycle for ${t}. start: ${i}. end: ${o}`)};class l extends Date{constructor(){super(...arguments),this.localization=a,this.nonLeapLadder=[0,31,59,90,120,151,181,212,243,273,304,334],this.leapLadder=[0,31,60,91,121,152,182,213,244,274,305,335],this.dateTimeRegex=/(\[[^[\]]*])|y{1,4}|M{1,4}|d{1,4}|H{1,2}|h{1,2}|t|T|m{1,2}|s{1,2}|f{3}/g,this.formattingTokens=/(\[[^[\]]*])|([-_:/.,()\s]+)|(T|t|yyyy|yy?|MM?M?M?|Do|dd?|hh?|HH?|mm?|ss?)/g,this.match2=/\d\d/,this.match3=/\d{3}/,this.match4=/\d{4}/,this.match1to2=/\d\d?/,this.matchSigned=/[+-]?\d+/,this.matchOffset=/[+-]\d\d:?(\d\d)?|Z/,this.matchWord=/[^\d_:/,\-()\s]+/,this.zoneExpressions=[this.matchOffset,(t,e)=>{t.offset=this.offsetFromString(e)}],this.expressions={t:[this.matchWord,(t,e)=>{t.afternoon=this.meridiemMatch(e)}],T:[this.matchWord,(t,e)=>{t.afternoon=this.meridiemMatch(e)}],fff:[this.match3,(t,e)=>{t.milliseconds=+e}],s:[this.match1to2,this.addInput("seconds")],ss:[this.match1to2,this.addInput("seconds")],m:[this.match1to2,this.addInput("minutes")],mm:[this.match1to2,this.addInput("minutes")],H:[this.match1to2,this.addInput("hours")],h:[this.match1to2,this.addInput("hours")],HH:[this.match1to2,this.addInput("hours")],hh:[this.match1to2,this.addInput("hours")],d:[this.match1to2,this.addInput("day")],dd:[this.match2,this.addInput("day")],Do:[this.matchWord,(t,e)=>{if([t.day]=e.match(/\d+/),this.localization.ordinal)for(let s=1;s<=31;s+=1)this.localization.ordinal(s).replace(/[[\]]/g,"")===e&&(t.day=s)}],M:[this.match1to2,this.addInput("month")],MM:[this.match2,this.addInput("month")],MMM:[this.matchWord,(t,e)=>{const s=this.getAllMonths(),i=(this.getAllMonths("short")||s.map((t=>t.slice(0,3)))).indexOf(e)+1;if(i<1)throw new Error;t.month=i%12||i}],MMMM:[this.matchWord,(t,e)=>{const s=this.getAllMonths().indexOf(e)+1;if(s<1)throw new Error;t.month=s%12||s}],y:[this.matchSigned,this.addInput("year")],yy:[this.match2,(t,e)=>{t.year=this.parseTwoDigitYear(e)}],yyyy:[this.match4,this.addInput("year")]}}setLocale(t){return this.localization||(this.localization=a,this.localization.locale=t),this}setLocalization(t){return this.localization=t,this}static convert(t,e="default",s=undefined){if(!t)throw new Error("A date is required");return s||((s=a).locale=e),new l(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()).setLocalization(s)}get clone(){return new l(this.year,this.month,this.date,this.hours,this.minutes,this.seconds,this.getMilliseconds()).setLocalization(this.localization)}static isValid(t){return void 0!==t&&"null"!==JSON.stringify(t)&&t.constructor.name===l.name}startOf(e,s=0){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);switch(e){case"seconds":this.setMilliseconds(0);break;case"minutes":this.setSeconds(0,0);break;case"hours":this.setMinutes(0,0,0);break;case"date":this.setHours(0,0,0,0);break;case"weekDay":{if(this.startOf(t.Unit.date),this.weekDay===s)break;let e=this.weekDay;0!==s&&0===this.weekDay&&(e=8-s),this.manipulate(s-e,t.Unit.date);break}case"month":this.startOf(t.Unit.date),this.setDate(1);break;case"year":this.startOf(t.Unit.date),this.setMonth(0,1)}return this}endOf(e,s=0){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);switch(e){case"seconds":this.setMilliseconds(999);break;case"minutes":this.setSeconds(59,999);break;case"hours":this.setMinutes(59,59,999);break;case"date":this.setHours(23,59,59,999);break;case"weekDay":{this.endOf(t.Unit.date);const e=6+s;if(this.weekDay===e)break;this.manipulate(e-this.weekDay,t.Unit.date);break}case"month":this.endOf(t.Unit.date),this.manipulate(1,t.Unit.month),this.setDate(0);break;case"year":this.endOf(t.Unit.date),this.setMonth(11,31)}return this}manipulate(t,e){if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return this[e]+=t,this}isBefore(t,e){if(!l.isValid(t))return!1;if(!e)return this.valueOf()t.valueOf();if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return this.clone.startOf(e).valueOf()>t.clone.startOf(e).valueOf()}isSame(t,e){if(!l.isValid(t))return!1;if(!e)return this.valueOf()===t.valueOf();if(void 0===this[e])throw new Error(`Unit '${e}' is not valid`);return t=l.convert(t),this.clone.startOf(e).valueOf()===t.startOf(e).valueOf()}isBetween(t,e,s,i="()"){if(!l.isValid(t)||!l.isValid(e))return!1;if(s&&void 0===this[s])throw new Error(`Unit '${s}' is not valid`);const o="("===i[0],a=")"===i[1],n=o?this.isAfter(t,s):!this.isBefore(t,s),r=a?this.isBefore(e,s):!this.isAfter(e,s);return n&&r}parts(t=this.localization.locale,e={dateStyle:"full",timeStyle:"long"}){const s={};return new Intl.DateTimeFormat(t,e).formatToParts(this).filter((t=>"literal"!==t.type)).forEach((t=>s[t.type]=t.value)),s}get seconds(){return this.getSeconds()}set seconds(t){this.setSeconds(t)}get secondsFormatted(){return this.parts(void 0,n).second}get minutes(){return this.getMinutes()}set minutes(t){this.setMinutes(t)}get minutesFormatted(){return this.parts(void 0,n).minute}get hours(){return this.getHours()}set hours(t){this.setHours(t)}getHoursFormatted(t="h12"){return this.parts(void 0,{...n,hourCycle:t}).hour}meridiem(t=this.localization.locale){return new Intl.DateTimeFormat(t,{hour:"numeric",hour12:!0}).formatToParts(this).find((t=>"dayPeriod"===t.type))?.value}get date(){return this.getDate()}set date(t){this.setDate(t)}get dateFormatted(){return this.parts(void 0,n).day}get weekDay(){return this.getDay()}get month(){return this.getMonth()}set month(t){const e=new Date(this.year,t+1);e.setDate(0);const s=e.getDate();this.date>s&&(this.date=s),this.setMonth(t)}get monthFormatted(){return this.parts(void 0,n).month}get year(){return this.getFullYear()}set year(t){this.setFullYear(t)}get week(){const t=this.computeOrdinal(),e=this.getUTCDay();let s=Math.floor((t-e+10)/7);return s<1?s=this.weeksInWeekYear():s>this.weeksInWeekYear()&&(s=1),s}weeksInWeekYear(){const t=(this.year+Math.floor(this.year/4)-Math.floor(this.year/100)+Math.floor(this.year/400))%7,e=this.year-1,s=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7;return 4===t||3===s?53:52}get isLeapYear(){return this.year%4==0&&(this.year%100!=0||this.year%400==0)}computeOrdinal(){return this.date+(this.isLeapYear?this.leapLadder:this.nonLeapLadder)[this.month]}getAllMonths(t="long"){const e=new Intl.DateTimeFormat(this.localization.locale,{month:t}).format;return[...Array(12).keys()].map((t=>e(new Date(2021,t))))}replaceTokens(t,e){return t.replace(/(\[[^[\]]*])|(LTS?|l{1,4}|L{1,4})/g,((t,s,i)=>{const o=i&&i.toUpperCase();return s||e[o]||a.dateFormats[o]}))}parseTwoDigitYear(t){return(t=+t)+(t>68?1900:2e3)}offsetFromString(t){if(!t)return 0;if("Z"===t)return 0;const[e,s,i]=t.match(/([+-]|\d\d)/g),o=60*s+(+i||0);return 0===o?0:"+"===e?-o:o}zoneInformation(t,e){let s=t.parts(this.localization.locale,{timeZoneName:"longOffset"}).timeZoneName.replace("GMT","").replace(":","");const i=s.includes("-");return s=s.replace("-",""),"z"===e?s=s.substring(1,2):"zz"===e&&(s=s.substring(0,2)),`${i?"-":""}${s}`}addInput(t){return(e,s)=>{e[t]=+s}}meridiemMatch(t){const e=new Intl.DateTimeFormat(this.localization.locale,{hour:"numeric",hour12:!0}).formatToParts(new Date(2022,3,4,13)).find((t=>"dayPeriod"===t.type))?.value;return t.toLowerCase()===e.toLowerCase()}correctHours(t){const{afternoon:e}=t;if(void 0!==e){const{hours:s}=t;e?s<12&&(t.hours+=12):12===s&&(t.hours=0),delete t.afternoon}}makeParser(t){const e=(t=this.replaceTokens(t,this.localization.dateFormats)).match(this.formattingTokens),{length:s}=e;for(let t=0;t{const i={hours:0,minutes:0,seconds:0,milliseconds:0};for(let o=0,a=0;o-1)return new l(("X"===e.format?1e3:1)*+t);const i=s.makeParser(e.format),{year:o,month:a,day:n,hours:r,minutes:d,seconds:c,milliseconds:h,zone:p}=i(t),u=n||(o||a?1:s.getDate()),m=o||s.getFullYear();let y=0;return o&&!a||(y=a>0?a-1:s.getMonth()),p?new l(Date.UTC(m,y,u,r,d,c,h+60*p.offset*1e3)):new l(m,y,u,r,d,c,h)}catch(s){i.errorMessages.customDateFormatError(`Unable to parse provided input: ${t}, format: ${e.format}`)}}format(t,e=this.localization.locale){if(t&&"object"==typeof t)return new Intl.DateTimeFormat(e,t).format(this);const s=this.replaceTokens(t||this.localization.format||`${a.dateFormats.L}, ${a.dateFormats.LT}`,this.localization.dateFormats),i=t=>new Intl.DateTimeFormat(this.localization.locale,t).format(this);this.localization.hourCycle||(this.localization.hourCycle=d(this.localization.locale));const o=this.localization.hourCycle.startsWith("h1")?"h24":this.localization.hourCycle,n=this.localization.hourCycle.startsWith("h2")?"h12":this.localization.hourCycle,r={yy:i({year:"2-digit"}),yyyy:this.year,M:i({month:"numeric"}),MM:this.monthFormatted,MMM:this.getAllMonths("short")[this.getMonth()],MMMM:this.getAllMonths()[this.getMonth()],d:this.date,dd:this.dateFormatted,ddd:i({weekday:"short"}),dddd:i({weekday:"long"}),H:this.getHours(),HH:this.getHoursFormatted(o),h:this.hours>12?this.hours-12:this.hours,hh:this.getHoursFormatted(n),t:this.meridiem(),T:this.meridiem().toUpperCase(),m:this.minutes,mm:this.minutesFormatted,s:this.seconds,ss:this.secondsFormatted,fff:this.getMilliseconds()};return s.replace(this.dateTimeRegex,((t,e)=>e||r[t])).replace(/\[/g,"").replace(/]/g,"")}}class c{constructor(){this.cache=new Map}locate(t){const e=this.cache.get(t);if(e)return e;const s=new t;return this.cache.set(t,s),s}}let h;const p=[{name:"calendar",className:i.css.daysContainer,unit:t.Unit.month,step:1},{name:"months",className:i.css.monthsContainer,unit:t.Unit.year,step:1},{name:"years",className:i.css.yearsContainer,unit:t.Unit.year,step:10},{name:"decades",className:i.css.decadesContainer,unit:t.Unit.year,step:100}];class u{constructor(){this._currentCalendarViewMode=0,this._viewDate=new l,this.minimumCalendarViewMode=0,this.currentView="calendar"}get currentCalendarViewMode(){return this._currentCalendarViewMode}set currentCalendarViewMode(t){this._currentCalendarViewMode=t,this.currentView=p[t].name}get viewDate(){return this._viewDate}set viewDate(t){this._viewDate=t,this.options&&(this.options.viewDate=t)}refreshCurrentView(){this.currentView=p[this.currentCalendarViewMode].name}get isTwelveHour(){return["h12","h11"].includes(this.options.localization.hourCycle)}}class m{constructor(){this.optionsStore=h.locate(u)}isValid(e,s){if(!this._enabledDisabledDatesIsValid(s,e))return!1;if(s!==t.Unit.month&&s!==t.Unit.year&&this.optionsStore.options.restrictions.daysOfWeekDisabled?.length>0&&-1!==this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(e.weekDay))return!1;if(!this._minMaxIsValid(s,e))return!1;if(s===t.Unit.hours||s===t.Unit.minutes||s===t.Unit.seconds){if(!this._enabledDisabledHoursIsValid(e))return!1;if(0!==this.optionsStore.options.restrictions.disabledTimeIntervals?.filter((t=>e.isBetween(t.from,t.to))).length)return!1}return!0}_enabledDisabledDatesIsValid(e,s){return e!==t.Unit.date||!(this.optionsStore.options.restrictions.disabledDates.length>0&&this._isInDisabledDates(s))&&!(this.optionsStore.options.restrictions.enabledDates.length>0&&!this._isInEnabledDates(s))}_isInDisabledDates(e){return!(!this.optionsStore.options.restrictions.disabledDates||0===this.optionsStore.options.restrictions.disabledDates.length)&&!!this.optionsStore.options.restrictions.disabledDates.find((s=>s.isSame(e,t.Unit.date)))}_isInEnabledDates(e){return!this.optionsStore.options.restrictions.enabledDates||0===this.optionsStore.options.restrictions.enabledDates.length||!!this.optionsStore.options.restrictions.enabledDates.find((s=>s.isSame(e,t.Unit.date)))}_minMaxIsValid(t,e){return(!this.optionsStore.options.restrictions.minDate||!e.isBefore(this.optionsStore.options.restrictions.minDate,t))&&(!this.optionsStore.options.restrictions.maxDate||!e.isAfter(this.optionsStore.options.restrictions.maxDate,t))}_enabledDisabledHoursIsValid(t){return!(this.optionsStore.options.restrictions.disabledHours.length>0&&this._isInDisabledHours(t))&&!(this.optionsStore.options.restrictions.enabledHours.length>0&&!this._isInEnabledHours(t))}_isInDisabledHours(t){if(!this.optionsStore.options.restrictions.disabledHours||0===this.optionsStore.options.restrictions.disabledHours.length)return!1;const e=t.hours;return this.optionsStore.options.restrictions.disabledHours.includes(e)}_isInEnabledHours(t){if(!this.optionsStore.options.restrictions.enabledHours||0===this.optionsStore.options.restrictions.enabledHours.length)return!0;const e=t.hours;return this.optionsStore.options.restrictions.enabledHours.includes(e)}dateRangeIsValid(e,s,i){if(!this.optionsStore.options.dateRange)return!0;if(2!==e.length&&1!==s)return!0;const o=e[0].clone;if(o.isSame(i,t.Unit.date))return!0;for(o.manipulate(1,t.Unit.date);!o.isSame(i,t.Unit.date);){if(!this.isValid(o,t.Unit.date))return!1;o.manipulate(1,t.Unit.date)}return!0}}class y{constructor(){this.subscribers=[]}subscribe(t){return this.subscribers.push(t),this.unsubscribe.bind(this,this.subscribers.length-1)}unsubscribe(t){this.subscribers.splice(t,1)}emit(t){this.subscribers.forEach((e=>{e(t)}))}destroy(){this.subscribers=null,this.subscribers=[]}}class g{constructor(){this.triggerEvent=new y,this.viewUpdate=new y,this.updateDisplay=new y,this.action=new y,this.updateViewDate=new y}destroy(){this.triggerEvent.destroy(),this.viewUpdate.destroy(),this.updateDisplay.destroy(),this.action.destroy(),this.updateViewDate.destroy()}}const v={clear:"Clear selection",close:"Close the picker",dateFormats:a.dateFormats,dayViewHeaderFormat:{month:"long",year:"2-digit"},decrementHour:"Decrement Hour",decrementMinute:"Decrement Minute",decrementSecond:"Decrement Second",format:a.format,hourCycle:a.hourCycle,incrementHour:"Increment Hour",incrementMinute:"Increment Minute",incrementSecond:"Increment Second",locale:a.locale,nextCentury:"Next Century",nextDecade:"Next Decade",nextMonth:"Next Month",nextYear:"Next Year",ordinal:a.ordinal,pickHour:"Pick Hour",pickMinute:"Pick Minute",pickSecond:"Pick Second",previousCentury:"Previous Century",previousDecade:"Previous Decade",previousMonth:"Previous Month",previousYear:"Previous Year",selectDate:"Select Date",selectDecade:"Select Decade",selectMonth:"Select Month",selectTime:"Select Time",selectYear:"Select Year",startOfTheWeek:0,today:"Go to today",toggleMeridiem:"Toggle Meridiem"},f={allowInputToggle:!1,container:void 0,dateRange:!1,debug:!1,defaultDate:void 0,display:{icons:{type:"icons",time:"fa-solid fa-clock",date:"fa-solid fa-calendar",up:"fa-solid fa-arrow-up",down:"fa-solid fa-arrow-down",previous:"fa-solid fa-chevron-left",next:"fa-solid fa-chevron-right",today:"fa-solid fa-calendar-check",clear:"fa-solid fa-trash",close:"fa-solid fa-xmark"},sideBySide:!1,calendarWeeks:!1,viewMode:"calendar",toolbarPlacement:"bottom",keepOpen:!1,buttons:{today:!1,clear:!1,close:!1},components:{calendar:!0,date:!0,month:!0,year:!0,decades:!0,clock:!0,hours:!0,minutes:!0,seconds:!1,useTwentyfourHour:void 0},inline:!1,theme:"auto",placement:"bottom"},keepInvalid:!1,localization:v,meta:{},multipleDates:!1,multipleDatesSeparator:"; ",promptTimeOnDateChange:!1,promptTimeOnDateChangeTransitionDelay:200,restrictions:{minDate:void 0,maxDate:void 0,disabledDates:[],enabledDates:[],daysOfWeekDisabled:[],disabledTimeIntervals:[],disabledHours:[],enabledHours:[]},stepping:1,useCurrent:!0,viewDate:new l},S={...v};function w(t,e){if(!t)return null;if(t.constructor.name===l.name)return t;if(t.constructor.name===Date.name)return l.convert(t);if("string"==typeof t){const s=l.fromString(t,e);return"null"===JSON.stringify(s)?null:s}return null}function b(t,e,s){"string"==typeof t&&"input"!==e&&i.errorMessages.dateString();const o=w(t,s);return o||i.errorMessages.failedToParseDate(e,t,"input"===e),o}function D(t,e,s,o){Array.isArray(e)||i.errorMessages.typeMismatch(t,s,"array of DateTime or Date");for(let s=0;s"number"!=typeof t))||i.errorMessages.typeMismatch(t,s,"array of numbers")}function k(t){return({value:e,providedType:s,localization:o})=>{const a=b(e,t,o);if(void 0!==a)return a.setLocalization(o),a;i.errorMessages.typeMismatch(t,s,"DateTime or Date")}}function C(t){const e=k(t);return t=>void 0===t.value?t.value:e(t)}function M(t,e,s){return({value:o,providedType:a})=>void 0===o?[]:(_(t,o,a),o.some((t=>ts))&&i.errorMessages.numbersOutOfRange(t,e,s),o)}function E(t){return M(t,0,23)}function T(t){return({value:e,providedType:s,localization:i})=>void 0===e?[]:(D(t,e,s,i),e)}function L(t){return({value:e,path:s})=>(t.includes(e)||i.errorMessages.unexpectedOptionValue(s.substring(1),e,t),e)}const U=Object.freeze({defaultDate:k("defaultDate"),viewDate:k("viewDate"),minDate:C("restrictions.minDate"),maxDate:C("restrictions.maxDate"),disabledHours:E("restrictions.disabledHours"),enabledHours:E("restrictions.enabledHours"),disabledDates:T("restrictions.disabledDates"),enabledDates:T("restrictions.enabledDates"),daysOfWeekDisabled:M("restrictions.daysOfWeekDisabled",0,6),disabledTimeIntervals:({key:t,value:e,providedType:s,localization:o})=>{if(void 0===e)return[];Array.isArray(e)||i.errorMessages.typeMismatch(t,s,"array of { from: DateTime|Date, to: DateTime|Date }");const a=e;for(let e=0;e{const n=`${t}[${e}].${s}`,r=a[e][s],d=b(r,n,o);d||i.errorMessages.typeMismatch(n,typeof r,"DateTime or Date"),d.setLocalization(o),a[e][s]=d}));return a},toolbarPlacement:L(["top","bottom","default"]),type:L(["icons","sprites"]),viewMode:L(["clock","calendar","months","years","decades"]),theme:L(["light","dark","auto"]),placement:L(["top","bottom"]),meta:({value:t})=>t,dayViewHeaderFormat:({value:t})=>t,container:({value:t,path:e})=>(t&&!(t instanceof HTMLElement||t instanceof Element||t?.appendChild)&&i.errorMessages.typeMismatch(e.substring(1),typeof t,"HTMLElement"),t),useTwentyfourHour:({value:t,path:e,providedType:s,defaultType:o})=>{if(i.errorMessages.deprecatedWarning("useTwentyfourHour",'Please use "options.localization.hourCycle" instead'),void 0===t||"boolean"===s)return t;i.errorMessages.typeMismatch(e,s,o)},hourCycle:L(["h11","h12","h23","h24"])}),A=({value:t,defaultType:e,providedType:s,path:o})=>{switch(e){case"boolean":return"true"===t||!0===t;case"number":return+t;case"string":return t.toString();case"object":return{};case"function":return t;default:i.errorMessages.typeMismatch(o,s,e)}};class V{static deepCopy(t){const e={};return Object.keys(t).forEach((s=>{const i=t[s];i instanceof l?e[s]=i.clone:i instanceof Date?e[s]=new Date(i.valueOf()):(e[s]=i,"object"!=typeof i||i instanceof HTMLElement||i instanceof Element||Array.isArray(i)||(e[s]=V.deepCopy(i)))})),e}static objectPath(t,e){return"."===t.charAt(0)&&(t=t.slice(1)),t?t.split(".").reduce(((t,e)=>V.isValue(t)||V.isValue(t[e])?t[e]:void 0),e):e}static spread(t,e,s,o=""){const a=V.objectPath(o,f),n=Object.keys(t).filter((t=>!Object.keys(a).includes(t)));if(n.length>0){const t=V.getFlattenDefaultOptions(),e=n.map((e=>{let s=`"${o}.${e}" in not a known option.`;const i=t.find((t=>t.includes(e)));return i&&(s+=` Did you mean "${i}"?`),s}));i.errorMessages.unexpectedOptions(e)}Object.keys(t).filter((t=>"__proto__"!==t&&"constructor"!==t)).forEach((i=>{"."===(o+=`.${i}`).charAt(0)&&(o=o.slice(1));const n=a[i],r=typeof t[i],d=typeof n,l=t[i];if(null==l)return e[i]=l,void(o=o.substring(0,o.lastIndexOf(`.${i}`)));"object"!=typeof n||Array.isArray(t[i])||n instanceof Date||V.ignoreProperties.includes(i)?e[i]=V.processKey(i,l,r,d,o,s):V.spread(t[i],e[i],s,o),o=o.substring(0,o.lastIndexOf(`.${i}`))}))}static processKey(t,e,s,i,o,a){return(U[(n={key:t,value:e,providedType:s,defaultType:i,path:o,localization:a}).key]||A)(n);var n}static _mergeOptions(t,e){const s=V.deepCopy(e),i="default"!==e.localization?.locale?e.localization:t?.localization||f.localization;return V.spread(t,s,i,""),s}static _dataToOptions(t,e){const s=JSON.parse(JSON.stringify(t.dataset));if(s?.tdTargetInput&&delete s.tdTargetInput,s?.tdTargetToggle&&delete s.tdTargetToggle,!s||0===Object.keys(s).length||s.constructor!==DOMStringMap)return e;const o={},a=t=>{const e={};return Object.keys(t).forEach((t=>{e[t.toLowerCase()]=t})),e},n=this.normalizeObject(a),r=a(e);return Object.keys(s).filter((t=>t.startsWith(i.dataKey))).map((t=>t.substring(2))).forEach((t=>{let i=r[t.toLowerCase()];if(t.includes("_")){const a=t.split("_");i=r[a[0].toLowerCase()],void 0!==i&&e[i].constructor===Object&&(o[i]=n(a,1,e[i],s[`td${t}`]))}else void 0!==i&&(o[i]=s[`td${t}`])})),this._mergeOptions(o,e)}static normalizeObject(t){const e=(s,i,o,a)=>{const n=t(o)[s[i].toLowerCase()],r={};return void 0===n||(o[n].constructor===Object?(i++,r[n]=e(s,i,o[n],a)):r[n]=a),r};return e}static _dateTypeCheck(t,e){return w(t,e)}static _typeCheckDateArray(t,e,s,i){return D(t,e,s,i)}static _typeCheckNumberArray(t,e,s){return _(t,e,s)}static dateConversion(t,e,s){return b(t,e,s)}static getFlattenDefaultOptions(){if(this._flattenDefaults)return this._flattenDefaults;const t=(e,s=[])=>Array.isArray(e)?[]:Object(e)===e?Object.entries(e).flatMap((([e,i])=>t(i,[...s,e]))):s.join(".");return this._flattenDefaults=t(f),this._flattenDefaults}static _validateConflicts(t){!t.display.sideBySide||t.display.components.clock&&(t.display.components.hours||t.display.components.minutes||t.display.components.seconds)||i.errorMessages.conflictingConfiguration("Cannot use side by side mode without the clock components"),t.restrictions.minDate&&t.restrictions.maxDate&&(t.restrictions.minDate.isAfter(t.restrictions.maxDate)&&i.errorMessages.conflictingConfiguration("minDate is after maxDate"),t.restrictions.maxDate.isBefore(t.restrictions.minDate)&&i.errorMessages.conflictingConfiguration("maxDate is before minDate")),t.multipleDates&&t.dateRange&&i.errorMessages.conflictingConfiguration('Cannot uss option "multipleDates" with "dateRange"')}}V.ignoreProperties=["meta","dayViewHeaderFormat","container","dateForms","ordinal"],V.isValue=t=>null!=t;class ${constructor(){this._dates=[],this.optionsStore=h.locate(u),this.validation=h.locate(m),this._eventEmitters=h.locate(g)}get picked(){return[...this._dates]}get lastPicked(){return this._dates[this.lastPickedIndex]?.clone}get lastPickedIndex(){return 0===this._dates.length?0:this._dates.length-1}formatInput(t){return t?(t.localization=this.optionsStore.options.localization,t.format()):""}parseInput(t){return V.dateConversion(t,"input",this.optionsStore.options.localization)}setFromInput(t,e){if(!t)return void this.setValue(void 0,e);const s=this.parseInput(t);s&&(s.setLocalization(this.optionsStore.options.localization),this.setValue(s,e))}add(t){this._dates.push(t)}isPicked(t,e){if(!l.isValid(t))return!1;if(!e)return void 0!==this._dates.find((e=>e.isSame(t)));const s=r(e),i=t.format(s);return void 0!==this._dates.map((t=>t.format(s))).find((t=>t===i))}pickedIndex(t,e){if(!l.isValid(t))return-1;if(!e)return this._dates.map((t=>t.valueOf())).indexOf(t.valueOf());const s=r(e),i=t.format(s);return this._dates.map((t=>t.format(s))).indexOf(i)}clear(){this.optionsStore.unset=!0,this._eventEmitters.triggerEvent.emit({type:i.events.change,date:void 0,oldDate:this.lastPicked,isClear:!0,isValid:!0}),this._dates=[],this.optionsStore.input&&(this.optionsStore.input.value=""),this._eventEmitters.updateDisplay.emit("all")}static getStartEndYear(t,e){const s=t/10,i=Math.floor(e/t)*t;return[i,i+9*s,Math.floor(e/s)*s]}updateInput(t){if(!this.optionsStore.input)return;let e=this.formatInput(t);(this.optionsStore.options.multipleDates||this.optionsStore.options.dateRange)&&(e=this._dates.map((t=>this.formatInput(t))).join(this.optionsStore.options.multipleDatesSeparator)),this.optionsStore.input.value!=e&&(this.optionsStore.input.value=e)}setValue(e,s){const o=void 0===s,a=!e&&o;let n=this.optionsStore.unset?null:this._dates[s]?.clone;if(!n&&!this.optionsStore.unset&&o&&a&&(n=this.lastPicked),e&&n?.isSame(e))return void this.updateInput(e);if(!e)return void this._setValueNull(a,s,n);s=s||0,e=e.clone,1!==this.optionsStore.options.stepping&&(e.minutes=Math.round(e.minutes/this.optionsStore.options.stepping)*this.optionsStore.options.stepping,e.startOf(t.Unit.minutes));const r=t=>{this._dates[s]=e,this._eventEmitters.updateViewDate.emit(e.clone),this.updateInput(e),this.optionsStore.unset=!1,this._eventEmitters.updateDisplay.emit("all"),this._eventEmitters.triggerEvent.emit({type:i.events.change,date:e,oldDate:n,isClear:a,isValid:t})};this.validation.isValid(e)&&this.validation.dateRangeIsValid(this.picked,s,e)?r(!0):(this.optionsStore.options.keepInvalid&&r(!1),this._eventEmitters.triggerEvent.emit({type:i.events.error,reason:i.errorMessages.failedToSetInvalidDate,date:e,oldDate:n}))}_setValueNull(t,e,s){!this.optionsStore.options.multipleDates||1===this._dates.length||t?(this.optionsStore.unset=!0,this._dates=[]):this._dates.splice(e,1),this.updateInput(),this._eventEmitters.triggerEvent.emit({type:i.events.change,date:void 0,oldDate:s,isClear:t,isValid:!0}),this._eventEmitters.updateDisplay.emit("all")}}var O;!function(t){t.next="next",t.previous="previous",t.changeCalendarView="changeCalendarView",t.selectMonth="selectMonth",t.selectYear="selectYear",t.selectDecade="selectDecade",t.selectDay="selectDay",t.selectHour="selectHour",t.selectMinute="selectMinute",t.selectSecond="selectSecond",t.incrementHours="incrementHours",t.incrementMinutes="incrementMinutes",t.incrementSeconds="incrementSeconds",t.decrementHours="decrementHours",t.decrementMinutes="decrementMinutes",t.decrementSeconds="decrementSeconds",t.toggleMeridiem="toggleMeridiem",t.togglePicker="togglePicker",t.showClock="showClock",t.showHours="showHours",t.showMinutes="showMinutes",t.showSeconds="showSeconds",t.clear="clear",t.close="close",t.today="today"}(O||(O={}));var z=O;class H{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate($),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");if(t.classList.add(i.css.daysContainer),t.append(...this._daysOfTheWeek()),this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(i.css.calendarWeeks,i.css.noHighlight),t.appendChild(e)}const{rangeHoverEvent:e,rangeHoverOutEvent:s}=this.handleMouseEvents(t);for(let o=0;o<42;o++){if(0!==o&&o%7==0&&this.optionsStore.options.display.calendarWeeks){const e=document.createElement("div");e.classList.add(i.css.calendarWeeks,i.css.noHighlight),t.appendChild(e)}const a=document.createElement("div");a.setAttribute("data-action",z.selectDay),t.appendChild(a),matchMedia("(hover: hover)").matches&&this.optionsStore.options.dateRange&&(a.addEventListener("mouseover",e),a.addEventListener("mouseout",s))}return t}_update(e,s){const o=e.getElementsByClassName(i.css.daysContainer)[0];this._updateCalendarView(o);const a=this.optionsStore.viewDate.clone.startOf(t.Unit.month).startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).manipulate(12,t.Unit.hours);this._handleCalendarWeeks(o,a.clone),o.querySelectorAll(`[data-action="${z.selectDay}"]`).forEach((e=>{const o=[];o.push(i.css.day),a.isBefore(this.optionsStore.viewDate,t.Unit.month)&&o.push(i.css.old),a.isAfter(this.optionsStore.viewDate,t.Unit.month)&&o.push(i.css.new),this.optionsStore.unset||this.optionsStore.options.dateRange||!this.dates.isPicked(a,t.Unit.date)||o.push(i.css.active),this.validation.isValid(a,t.Unit.date)||o.push(i.css.disabled),a.isSame(new l,t.Unit.date)&&o.push(i.css.today),0!==a.weekDay&&6!==a.weekDay||o.push(i.css.weekend),this._handleDateRange(a,o),s(t.Unit.date,a,o,e),e.classList.remove(...e.classList),e.classList.add(...o),e.setAttribute("data-value",this._dateToDataValue(a)),e.setAttribute("data-day",`${a.date}`),e.innerText=a.parts(void 0,{day:"numeric"}).day,a.manipulate(1,t.Unit.date)}))}_dateToDataValue(t){return l.isValid(t)?`${t.year}-${t.monthFormatted}-${t.dateFormatted}`:""}_handleDateRange(e,s){const o=this.dates.picked[0],a=this.dates.picked[1];this.optionsStore.options.dateRange&&(e.isBetween(o,a,t.Unit.date)&&s.push(i.css.rangeIn),e.isSame(o,t.Unit.date)&&s.push(i.css.rangeStart),e.isSame(a,t.Unit.date)&&s.push(i.css.rangeEnd))}handleMouseEvents(e){return{rangeHoverEvent:s=>{const o=s?.currentTarget;if(1!==this.dates.picked.length||o.classList.contains(i.css.disabled))return;const a=[...e.querySelectorAll(".day")],n=o.getAttribute("data-value"),r=l.fromString(n,{format:"yyyy-MM-dd"}),d=a.findIndex((t=>t.getAttribute("data-value")===n)),c=this.dates.picked[0],h=this.dates.picked[1],p=this._dateToDataValue(c),u=a.findIndex((t=>t.getAttribute("data-value")===p)),m=a[u];let y;r.isSame(c,t.Unit.date)||o.classList.remove(i.css.rangeStart),r.isSame(h,t.Unit.date)||o.classList.remove(i.css.rangeEnd),r.isBefore(c)?(o.classList.add(i.css.rangeStart),m?.classList.remove(i.css.rangeStart),m?.classList.add(i.css.rangeEnd),y=(t,e)=>e>d&&eeu),a.filter(y).forEach((t=>{t.classList.add(i.css.rangeIn)}))},rangeHoverOutEvent:s=>{const o=[...e.querySelectorAll(".day")];if(1===this.dates.picked.length&&o.forEach((t=>t.classList.remove(i.css.rangeIn))),1!==this.dates.picked.length)return;const a=s?.currentTarget,n=new l(a.getAttribute("data-value"));n.isSame(this.dates.picked[0],t.Unit.date)||a.classList.remove(i.css.rangeStart),n.isSame(this.dates.picked[1],t.Unit.date)||a.classList.remove(i.css.rangeEnd)}}}_updateCalendarView(e){if("calendar"!==this.optionsStore.currentView)return;const[s,o,a]=e.parentElement.getElementsByClassName(i.css.calendarHeader)[0].getElementsByTagName("div");o.setAttribute(i.css.daysContainer,this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat)),this.optionsStore.options.display.components.month?o.classList.remove(i.css.disabled):o.classList.add(i.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.month),t.Unit.month)?s.classList.remove(i.css.disabled):s.classList.add(i.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.month),t.Unit.month)?a.classList.remove(i.css.disabled):a.classList.add(i.css.disabled)}_daysOfTheWeek(){const e=this.optionsStore.viewDate.clone.startOf("weekDay",this.optionsStore.options.localization.startOfTheWeek).startOf(t.Unit.date),s=[];if(document.createElement("div"),this.optionsStore.options.display.calendarWeeks){const t=document.createElement("div");t.classList.add(i.css.calendarWeeks,i.css.noHighlight),t.innerText="#",s.push(t)}for(let o=0;o<7;o++){const o=document.createElement("div");o.classList.add(i.css.dayOfTheWeek,i.css.noHighlight),o.innerText=e.format({weekday:"short"}),e.manipulate(1,t.Unit.date),s.push(o)}return s}_handleCalendarWeeks(e,s){[...e.querySelectorAll(`.${i.css.calendarWeeks}`)].filter((t=>"#"!==t.innerText)).forEach((e=>{e.innerText=`${s.week}`,s.manipulate(7,t.Unit.date)}))}}class x{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate($),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(i.css.monthsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",z.selectMonth),t.appendChild(e)}return t}_update(e,s){const o=e.getElementsByClassName(i.css.monthsContainer)[0];if("months"===this.optionsStore.currentView){const[e,s,a]=o.parentElement.getElementsByClassName(i.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(i.css.monthsContainer,this.optionsStore.viewDate.format({year:"numeric"})),this.optionsStore.options.display.components.year?s.classList.remove(i.css.disabled):s.classList.add(i.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.year),t.Unit.year)?e.classList.remove(i.css.disabled):e.classList.add(i.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.year),t.Unit.year)?a.classList.remove(i.css.disabled):a.classList.add(i.css.disabled)}const a=this.optionsStore.viewDate.clone.startOf(t.Unit.year);o.querySelectorAll(`[data-action="${z.selectMonth}"]`).forEach(((e,o)=>{const n=[];n.push(i.css.month),!this.optionsStore.unset&&this.dates.isPicked(a,t.Unit.month)&&n.push(i.css.active),this.validation.isValid(a,t.Unit.month)||n.push(i.css.disabled),s(t.Unit.month,a,n,e),e.classList.remove(...e.classList),e.classList.add(...n),e.setAttribute("data-value",`${o}`),e.innerText=`${a.format({month:"short"})}`,a.manipulate(1,t.Unit.month)}))}}class I{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate($),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(i.css.yearsContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",z.selectYear),t.appendChild(e)}return t}_update(e,s){this._startYear=this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.year),this._endYear=this.optionsStore.viewDate.clone.manipulate(10,t.Unit.year);const o=e.getElementsByClassName(i.css.yearsContainer)[0];if("years"===this.optionsStore.currentView){const[e,s,a]=o.parentElement.getElementsByClassName(i.css.calendarHeader)[0].getElementsByTagName("div");s.setAttribute(i.css.yearsContainer,`${this._startYear.format({year:"numeric"})}-${this._endYear.format({year:"numeric"})}`),this.optionsStore.options.display.components.decades?s.classList.remove(i.css.disabled):s.classList.add(i.css.disabled),this.validation.isValid(this._startYear,t.Unit.year)?e.classList.remove(i.css.disabled):e.classList.add(i.css.disabled),this.validation.isValid(this._endYear,t.Unit.year)?a.classList.remove(i.css.disabled):a.classList.add(i.css.disabled)}const a=this.optionsStore.viewDate.clone.startOf(t.Unit.year).manipulate(-1,t.Unit.year);o.querySelectorAll(`[data-action="${z.selectYear}"]`).forEach((e=>{const o=[];o.push(i.css.year),!this.optionsStore.unset&&this.dates.isPicked(a,t.Unit.year)&&o.push(i.css.active),this.validation.isValid(a,t.Unit.year)||o.push(i.css.disabled),s(t.Unit.year,a,o,e),e.classList.remove(...e.classList),e.classList.add(...o),e.setAttribute("data-value",`${a.year}`),e.innerText=a.format({year:"numeric"}),a.manipulate(1,t.Unit.year)}))}}class P{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate($),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(i.css.decadesContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",z.selectDecade),t.appendChild(e)}return t}_update(e,s){const[o,a]=$.getStartEndYear(100,this.optionsStore.viewDate.year);this._startDecade=this.optionsStore.viewDate.clone.startOf(t.Unit.year),this._startDecade.year=o,this._endDecade=this.optionsStore.viewDate.clone.startOf(t.Unit.year),this._endDecade.year=a;const n=e.getElementsByClassName(i.css.decadesContainer)[0],[r,d,l]=n.parentElement.getElementsByClassName(i.css.calendarHeader)[0].getElementsByTagName("div");"decades"===this.optionsStore.currentView&&(d.setAttribute(i.css.decadesContainer,`${this._startDecade.format({year:"numeric"})}-${this._endDecade.format({year:"numeric"})}`),this.validation.isValid(this._startDecade,t.Unit.year)?r.classList.remove(i.css.disabled):r.classList.add(i.css.disabled),this.validation.isValid(this._endDecade,t.Unit.year)?l.classList.remove(i.css.disabled):l.classList.add(i.css.disabled));const c=this.dates.picked.map((t=>t.year));n.querySelectorAll(`[data-action="${z.selectDecade}"]`).forEach(((e,o)=>{if(0===o)return e.classList.add(i.css.old),this._startDecade.year-10<0?(e.textContent=" ",r.classList.add(i.css.disabled),e.classList.add(i.css.disabled),void e.setAttribute("data-value","")):(e.innerText=this._startDecade.clone.manipulate(-10,t.Unit.year).format({year:"numeric"}),void e.setAttribute("data-value",`${this._startDecade.year}`));const a=[];a.push(i.css.decade);const n=this._startDecade.year,d=this._startDecade.year+9;!this.optionsStore.unset&&c.filter((t=>t>=n&&t<=d)).length>0&&a.push(i.css.active),s("decade",this._startDecade,a,e),e.classList.remove(...e.classList),e.classList.add(...a),e.setAttribute("data-value",`${this._startDecade.year}`),e.innerText=`${this._startDecade.format({year:"numeric"})}`,this._startDecade.manipulate(10,t.Unit.year)}))}}class N{constructor(){this._gridColumns="",this.optionsStore=h.locate(u),this.dates=h.locate($),this.validation=h.locate(m)}getPicker(t){const e=document.createElement("div");return e.classList.add(i.css.clockContainer),e.append(...this._grid(t)),e}_update(e){const s=e.getElementsByClassName(i.css.clockContainer)[0];let o=this.dates.lastPicked?.clone;if(!o&&this.optionsStore.options.useCurrent&&(o=this.optionsStore.viewDate.clone),s.querySelectorAll(".disabled").forEach((t=>t.classList.remove(i.css.disabled))),this.optionsStore.options.display.components.hours&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.hours),t.Unit.hours)||s.querySelector(`[data-action=${z.incrementHours}]`).classList.add(i.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.hours),t.Unit.hours)||s.querySelector(`[data-action=${z.decrementHours}]`).classList.add(i.css.disabled),s.querySelector(`[data-time-component=${t.Unit.hours}]`).innerText=o?o.getHoursFormatted(this.optionsStore.options.localization.hourCycle):"--"),this.optionsStore.options.display.components.minutes&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.minutes),t.Unit.minutes)||s.querySelector(`[data-action=${z.incrementMinutes}]`).classList.add(i.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.minutes),t.Unit.minutes)||s.querySelector(`[data-action=${z.decrementMinutes}]`).classList.add(i.css.disabled),s.querySelector(`[data-time-component=${t.Unit.minutes}]`).innerText=o?o.minutesFormatted:"--"),this.optionsStore.options.display.components.seconds&&(this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1,t.Unit.seconds),t.Unit.seconds)||s.querySelector(`[data-action=${z.incrementSeconds}]`).classList.add(i.css.disabled),this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1,t.Unit.seconds),t.Unit.seconds)||s.querySelector(`[data-action=${z.decrementSeconds}]`).classList.add(i.css.disabled),s.querySelector(`[data-time-component=${t.Unit.seconds}]`).innerText=o?o.secondsFormatted:"--"),this.optionsStore.isTwelveHour){const e=s.querySelector(`[data-action=${z.toggleMeridiem}]`),a=(o||this.optionsStore.viewDate).clone;e.innerText=a.meridiem(),this.validation.isValid(a.manipulate(a.hours>=12?-12:12,t.Unit.hours))?e.classList.remove(i.css.disabled):e.classList.add(i.css.disabled)}s.style.gridTemplateAreas=`"${this._gridColumns}"`}_grid(e){this._gridColumns="";const s=[],o=[],a=[],n=document.createElement("div"),r=e(this.optionsStore.options.display.icons.up),d=e(this.optionsStore.options.display.icons.down);n.classList.add(i.css.separator,i.css.noHighlight);const l=n.cloneNode(!0);l.innerHTML=":";const c=(t=!1)=>t?l.cloneNode(!0):n.cloneNode(!0);if(this.optionsStore.options.display.components.hours){let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementHour),e.setAttribute("data-action",z.incrementHours),e.appendChild(r.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickHour),e.setAttribute("data-action",z.showHours),e.setAttribute("data-time-component",t.Unit.hours),o.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementHour),e.setAttribute("data-action",z.decrementHours),e.appendChild(d.cloneNode(!0)),a.push(e),this._gridColumns+="a"}if(this.optionsStore.options.display.components.minutes){this._gridColumns+=" a",this.optionsStore.options.display.components.hours&&(s.push(c()),o.push(c(!0)),a.push(c()),this._gridColumns+=" a");let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementMinute),e.setAttribute("data-action",z.incrementMinutes),e.appendChild(r.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickMinute),e.setAttribute("data-action",z.showMinutes),e.setAttribute("data-time-component",t.Unit.minutes),o.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementMinute),e.setAttribute("data-action",z.decrementMinutes),e.appendChild(d.cloneNode(!0)),a.push(e)}if(this.optionsStore.options.display.components.seconds){this._gridColumns+=" a",this.optionsStore.options.display.components.minutes&&(s.push(c()),o.push(c(!0)),a.push(c()),this._gridColumns+=" a");let e=document.createElement("div");e.setAttribute("title",this.optionsStore.options.localization.incrementSecond),e.setAttribute("data-action",z.incrementSeconds),e.appendChild(r.cloneNode(!0)),s.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.pickSecond),e.setAttribute("data-action",z.showSeconds),e.setAttribute("data-time-component",t.Unit.seconds),o.push(e),e=document.createElement("div"),e.setAttribute("title",this.optionsStore.options.localization.decrementSecond),e.setAttribute("data-action",z.decrementSeconds),e.appendChild(d.cloneNode(!0)),a.push(e)}if(this.optionsStore.isTwelveHour){this._gridColumns+=" a";let t=c();s.push(t);const e=document.createElement("button");e.setAttribute("title",this.optionsStore.options.localization.toggleMeridiem),e.setAttribute("data-action",z.toggleMeridiem),e.setAttribute("tabindex","-1"),i.css.toggleMeridiem.includes(",")?e.classList.add(...i.css.toggleMeridiem.split(",")):e.classList.add(i.css.toggleMeridiem),t=document.createElement("div"),t.classList.add(i.css.noHighlight),t.appendChild(e),o.push(t),t=c(),a.push(t)}return this._gridColumns=this._gridColumns.trim(),[...s,...o,...a]}}class F{constructor(){this.optionsStore=h.locate(u),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(i.css.hourContainer);for(let e=0;e<(this.optionsStore.isTwelveHour?12:24);e++){const e=document.createElement("div");e.setAttribute("data-action",z.selectHour),t.appendChild(e)}return t}_update(e,s){const o=e.getElementsByClassName(i.css.hourContainer)[0],a=this.optionsStore.viewDate.clone.startOf(t.Unit.date);o.querySelectorAll(`[data-action="${z.selectHour}"]`).forEach((e=>{const o=[];o.push(i.css.hour),this.validation.isValid(a,t.Unit.hours)||o.push(i.css.disabled),s(t.Unit.hours,a,o,e),e.classList.remove(...e.classList),e.classList.add(...o),e.setAttribute("data-value",`${a.hours}`),e.innerText=a.getHoursFormatted(this.optionsStore.options.localization.hourCycle),a.manipulate(1,t.Unit.hours)}))}}class B{constructor(){this.optionsStore=h.locate(u),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(i.css.minuteContainer);const e=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;for(let s=0;s<60/e;s++){const e=document.createElement("div");e.setAttribute("data-action",z.selectMinute),t.appendChild(e)}return t}_update(e,s){const o=e.getElementsByClassName(i.css.minuteContainer)[0],a=this.optionsStore.viewDate.clone.startOf(t.Unit.hours),n=1===this.optionsStore.options.stepping?5:this.optionsStore.options.stepping;o.querySelectorAll(`[data-action="${z.selectMinute}"]`).forEach((e=>{const o=[];o.push(i.css.minute),this.validation.isValid(a,t.Unit.minutes)||o.push(i.css.disabled),s(t.Unit.minutes,a,o,e),e.classList.remove(...e.classList),e.classList.add(...o),e.setAttribute("data-value",`${a.minutes}`),e.innerText=a.minutesFormatted,a.manipulate(n,t.Unit.minutes)}))}}class W{constructor(){this.optionsStore=h.locate(u),this.validation=h.locate(m)}getPicker(){const t=document.createElement("div");t.classList.add(i.css.secondContainer);for(let e=0;e<12;e++){const e=document.createElement("div");e.setAttribute("data-action",z.selectSecond),t.appendChild(e)}return t}_update(e,s){const o=e.getElementsByClassName(i.css.secondContainer)[0],a=this.optionsStore.viewDate.clone.startOf(t.Unit.minutes);o.querySelectorAll(`[data-action="${z.selectSecond}"]`).forEach((e=>{const o=[];o.push(i.css.second),this.validation.isValid(a,t.Unit.seconds)||o.push(i.css.disabled),s(t.Unit.seconds,a,o,e),e.classList.remove(...e.classList),e.classList.add(...o),e.setAttribute("data-value",`${a.seconds}`),e.innerText=a.secondsFormatted,a.manipulate(5,t.Unit.seconds)}))}}class q{static toggle(t){t.classList.contains(i.css.show)?this.hide(t):this.show(t)}static showImmediately(t){t.classList.remove(i.css.collapsing),t.classList.add(i.css.collapse,i.css.show),t.style.height=""}static show(t){if(t.classList.contains(i.css.collapsing)||t.classList.contains(i.css.show))return;t.style.height="0",t.classList.remove(i.css.collapse),t.classList.add(i.css.collapsing),setTimeout((()=>{q.showImmediately(t)}),this.getTransitionDurationFromElement(t)),t.style.height=`${t.scrollHeight}px`}static hideImmediately(t){t&&(t.classList.remove(i.css.collapsing,i.css.show),t.classList.add(i.css.collapse))}static hide(t){if(t.classList.contains(i.css.collapsing)||!t.classList.contains(i.css.show))return;t.style.height=`${t.getBoundingClientRect().height}px`;t.offsetHeight,t.classList.remove(i.css.collapse,i.css.show),t.classList.add(i.css.collapsing),t.style.height="",setTimeout((()=>{q.hideImmediately(t)}),this.getTransitionDurationFromElement(t))}}q.getTransitionDurationFromElement=t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:s}=window.getComputedStyle(t);const i=Number.parseFloat(e),o=Number.parseFloat(s);return i||o?(e=e.split(",")[0],s=s.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(s))):0};class Y{constructor(){this._isVisible=!1,this._documentClickEvent=t=>{this.optionsStore.options.debug||window.debug||!this._isVisible||t.composedPath().includes(this.widget)||t.composedPath()?.includes(this.optionsStore.element)||this.hide()},this._actionsClickEvent=t=>{this._eventEmitters.action.emit({e:t})},this.optionsStore=h.locate(u),this.validation=h.locate(m),this.dates=h.locate($),this.dateDisplay=h.locate(H),this.monthDisplay=h.locate(x),this.yearDisplay=h.locate(I),this.decadeDisplay=h.locate(P),this.timeDisplay=h.locate(N),this.hourDisplay=h.locate(F),this.minuteDisplay=h.locate(B),this.secondDisplay=h.locate(W),this._eventEmitters=h.locate(g),this._widget=void 0,this._eventEmitters.updateDisplay.subscribe((t=>{this._update(t)}))}get widget(){return this._widget}get dateContainer(){return this.widget?.querySelector(`div.${i.css.dateContainer}`)}get timeContainer(){return this.widget?.querySelector(`div.${i.css.timeContainer}`)}get isVisible(){return this._isVisible}_update(e){if(this.widget)switch(e){case t.Unit.seconds:this.secondDisplay._update(this.widget,this.paint);break;case t.Unit.minutes:this.minuteDisplay._update(this.widget,this.paint);break;case t.Unit.hours:this.hourDisplay._update(this.widget,this.paint);break;case t.Unit.date:this.dateDisplay._update(this.widget,this.paint);break;case t.Unit.month:this.monthDisplay._update(this.widget,this.paint);break;case t.Unit.year:this.yearDisplay._update(this.widget,this.paint);break;case"clock":if(!this._hasTime)break;this.timeDisplay._update(this.widget),this._update(t.Unit.hours),this._update(t.Unit.minutes),this._update(t.Unit.seconds);break;case"calendar":this._update(t.Unit.date),this._update(t.Unit.year),this._update(t.Unit.month),this.decadeDisplay._update(this.widget,this.paint),this._updateCalendarHeader();break;case"all":this._hasTime&&this._update("clock"),this._hasDate&&this._update("calendar")}}paint(t,e,s,i){}show(){if(null==this.widget){if(this._showSetDefaultIfNeeded(),this._buildWidget(),this._updateTheme(),this._showSetupViewMode(),this.optionsStore.options.display.inline)this.optionsStore.element.appendChild(this.widget);else{const t=this.optionsStore.options?.container||document.body,e=this.optionsStore.options?.display?.placement||"bottom";t.appendChild(this.widget),this.createPopup(this.optionsStore.element,this.widget,{modifiers:[{name:"eventListeners",enabled:!0}],placement:"rtl"===document.documentElement.dir?`${e}-end`:`${e}-start`}).then()}"clock"==this.optionsStore.options.display.viewMode&&this._eventEmitters.action.emit({e:null,action:z.showClock}),this.widget.querySelectorAll("[data-action]").forEach((t=>t.addEventListener("click",this._actionsClickEvent))),this._hasTime&&this.optionsStore.options.display.sideBySide&&(this.timeDisplay._update(this.widget),this.widget.getElementsByClassName(i.css.clockContainer)[0].style.display="grid")}this.widget.classList.add(i.css.show),this.optionsStore.options.display.inline||(this.updatePopup(),document.addEventListener("click",this._documentClickEvent)),this._eventEmitters.triggerEvent.emit({type:i.events.show}),this._isVisible=!0}_showSetupViewMode(){const t=this._hasTime&&!this._hasDate;t?(this.optionsStore.currentView="clock",this._eventEmitters.action.emit({e:null,action:z.showClock})):this.optionsStore.currentCalendarViewMode||(this.optionsStore.currentCalendarViewMode=this.optionsStore.minimumCalendarViewMode),t||"clock"===this.optionsStore.options.display.viewMode||(this._hasTime&&(this.optionsStore.options.display.sideBySide?q.show(this.timeContainer):q.hideImmediately(this.timeContainer)),q.show(this.dateContainer)),this._hasDate&&this._showMode()}_showSetDefaultIfNeeded(){if(0==this.dates.picked.length){if(this.optionsStore.options.useCurrent&&!this.optionsStore.options.defaultDate){const e=(new l).setLocalization(this.optionsStore.options.localization);if(!this.optionsStore.options.keepInvalid){let s=0,i=1;for(this.optionsStore.options.restrictions.maxDate?.isBefore(e)&&(i=-1);!this.validation.isValid(e)&&s>31;)e.manipulate(i,t.Unit.date),s++}this.dates.setValue(e)}this.optionsStore.options.defaultDate&&this.dates.setValue(this.optionsStore.options.defaultDate)}}async createPopup(t,e,s){let i;if(window?.Popper)i=window?.Popper?.createPopper;else{const{createPopper:t}=await import("@popperjs/core");i=t}i&&(this._popperInstance=i(t,e,s))}updatePopup(){this._popperInstance?.update()}_showMode(t){if(!this.widget)return;if(t){const e=Math.max(this.optionsStore.minimumCalendarViewMode,Math.min(3,this.optionsStore.currentCalendarViewMode+t));if(this.optionsStore.currentCalendarViewMode==e)return;this.optionsStore.currentCalendarViewMode=e}this.widget.querySelectorAll(`.${i.css.dateContainer} > div:not(.${i.css.calendarHeader}), .${i.css.timeContainer} > div:not(.${i.css.clockContainer})`).forEach((t=>t.style.display="none"));const e=p[this.optionsStore.currentCalendarViewMode],s=this.widget.querySelector(`.${e.className}`);switch(e.className){case i.css.decadesContainer:this.decadeDisplay._update(this.widget,this.paint);break;case i.css.yearsContainer:this.yearDisplay._update(this.widget,this.paint);break;case i.css.monthsContainer:this.monthDisplay._update(this.widget,this.paint);break;case i.css.daysContainer:this.dateDisplay._update(this.widget,this.paint)}s.style.display="grid",this.optionsStore.options.display.sideBySide&&(this.widget.querySelectorAll(`.${i.css.clockContainer}`)[0].style.display="grid"),this._updateCalendarHeader(),this._eventEmitters.viewUpdate.emit()}_updateTheme(t){if(this.widget){if(t){if(this.optionsStore.options.display.theme===t)return;this.optionsStore.options.display.theme=t}this.widget.classList.remove("light","dark"),this.widget.classList.add(this._getThemeClass()),"auto"===this.optionsStore.options.display.theme?window.matchMedia(i.css.isDarkPreferredQuery).addEventListener("change",(()=>this._updateTheme())):window.matchMedia(i.css.isDarkPreferredQuery).removeEventListener("change",(()=>this._updateTheme()))}}_getThemeClass(){const t=this.optionsStore.options.display.theme||"auto",e=window.matchMedia&&window.matchMedia(i.css.isDarkPreferredQuery).matches;switch(t){case"light":return i.css.lightTheme;case"dark":return i.css.darkTheme;case"auto":return e?i.css.darkTheme:i.css.lightTheme}}_updateCalendarHeader(){if(!this._hasDate)return;const t=[...this.widget.querySelector(`.${i.css.dateContainer} div[style*="display: grid"]`).classList].find((t=>t.startsWith(i.css.dateContainer))),[e,s,o]=this.widget.getElementsByClassName(i.css.calendarHeader)[0].getElementsByTagName("div");switch(t){case i.css.decadesContainer:e.setAttribute("title",this.optionsStore.options.localization.previousCentury),s.setAttribute("title",""),o.setAttribute("title",this.optionsStore.options.localization.nextCentury);break;case i.css.yearsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousDecade),s.setAttribute("title",this.optionsStore.options.localization.selectDecade),o.setAttribute("title",this.optionsStore.options.localization.nextDecade);break;case i.css.monthsContainer:e.setAttribute("title",this.optionsStore.options.localization.previousYear),s.setAttribute("title",this.optionsStore.options.localization.selectYear),o.setAttribute("title",this.optionsStore.options.localization.nextYear);break;case i.css.daysContainer:e.setAttribute("title",this.optionsStore.options.localization.previousMonth),s.setAttribute("title",this.optionsStore.options.localization.selectMonth),o.setAttribute("title",this.optionsStore.options.localization.nextMonth),s.setAttribute(t,this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat))}s.innerText=s.getAttribute(t)}hide(){this.widget&&this._isVisible&&(this.widget.classList.remove(i.css.show),this._isVisible&&(this._eventEmitters.triggerEvent.emit({type:i.events.hide,date:this.optionsStore.unset?null:this.dates.lastPicked?.clone}),this._isVisible=!1),document.removeEventListener("click",this._documentClickEvent))}toggle(){return this._isVisible?this.hide():this.show()}_dispose(){document.removeEventListener("click",this._documentClickEvent),this.widget&&(this.widget.querySelectorAll("[data-action]").forEach((t=>t.removeEventListener("click",this._actionsClickEvent))),this.widget.parentNode.removeChild(this.widget),this._widget=void 0)}_buildWidget(){const t=document.createElement("div");t.classList.add(i.css.widget);const e=document.createElement("div");e.classList.add(i.css.dateContainer),e.append(this.getHeadTemplate(),this.decadeDisplay.getPicker(),this.yearDisplay.getPicker(),this.monthDisplay.getPicker(),this.dateDisplay.getPicker());const s=document.createElement("div");s.classList.add(i.css.timeContainer),s.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this))),s.appendChild(this.hourDisplay.getPicker()),s.appendChild(this.minuteDisplay.getPicker()),s.appendChild(this.secondDisplay.getPicker());const o=document.createElement("div");if(o.classList.add(i.css.toolbar),o.append(...this.getToolbarElements()),this.optionsStore.options.display.inline&&t.classList.add(i.css.inline),this.optionsStore.options.display.calendarWeeks&&t.classList.add("calendarWeeks"),this.optionsStore.options.display.sideBySide&&this._hasDateAndTime)return void this._buildWidgetSideBySide(t,e,s,o);"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(o);const a=(e,s,o,a)=>{e&&(s&&(o.classList.add(i.css.collapse),a&&o.classList.add(i.css.show)),t.appendChild(o))};a(this._hasDate,this._hasTime,e,"clock"!==this.optionsStore.options.display.viewMode),a(this._hasTime,this._hasDate,s,"clock"===this.optionsStore.options.display.viewMode),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(o);const n=document.createElement("div");n.classList.add("arrow"),n.setAttribute("data-popper-arrow",""),t.appendChild(n),this._widget=t}_buildWidgetSideBySide(t,e,s,o){t.classList.add(i.css.sideBySide),"top"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(o);const a=document.createElement("div");a.classList.add("td-row"),e.classList.add("td-half"),s.classList.add("td-half"),a.appendChild(e),a.appendChild(s),t.appendChild(a),"bottom"===this.optionsStore.options.display.toolbarPlacement&&t.appendChild(o),this._widget=t}get _hasTime(){return this.optionsStore.options.display.components.clock&&(this.optionsStore.options.display.components.hours||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.components.seconds)}get _hasDate(){return this.optionsStore.options.display.components.calendar&&(this.optionsStore.options.display.components.year||this.optionsStore.options.display.components.month||this.optionsStore.options.display.components.date)}get _hasDateAndTime(){return this._hasDate&&this._hasTime}getToolbarElements(){const t=[];if(this.optionsStore.options.display.buttons.today){const e=document.createElement("div");e.setAttribute("data-action",z.today),e.setAttribute("title",this.optionsStore.options.localization.today),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.today)),t.push(e)}if(!this.optionsStore.options.display.sideBySide&&this._hasDate&&this._hasTime){let e,s;"clock"===this.optionsStore.options.display.viewMode?(e=this.optionsStore.options.localization.selectDate,s=this.optionsStore.options.display.icons.date):(e=this.optionsStore.options.localization.selectTime,s=this.optionsStore.options.display.icons.time);const i=document.createElement("div");i.setAttribute("data-action",z.togglePicker),i.setAttribute("title",e),i.appendChild(this._iconTag(s)),t.push(i)}if(this.optionsStore.options.display.buttons.clear){const e=document.createElement("div");e.setAttribute("data-action",z.clear),e.setAttribute("title",this.optionsStore.options.localization.clear),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.clear)),t.push(e)}if(this.optionsStore.options.display.buttons.close){const e=document.createElement("div");e.setAttribute("data-action",z.close),e.setAttribute("title",this.optionsStore.options.localization.close),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.close)),t.push(e)}return t}getHeadTemplate(){const t=document.createElement("div");t.classList.add(i.css.calendarHeader);const e=document.createElement("div");e.classList.add(i.css.previous),e.setAttribute("data-action",z.previous),e.appendChild(this._iconTag(this.optionsStore.options.display.icons.previous));const s=document.createElement("div");s.classList.add(i.css.switch),s.setAttribute("data-action",z.changeCalendarView);const o=document.createElement("div");return o.classList.add(i.css.next),o.setAttribute("data-action",z.next),o.appendChild(this._iconTag(this.optionsStore.options.display.icons.next)),t.append(e,s,o),t}_iconTag(t){if("sprites"===this.optionsStore.options.display.icons.type){const e=document.createElementNS("http://www.w3.org/2000/svg","svg"),s=document.createElementNS("http://www.w3.org/2000/svg","use");return s.setAttribute("xlink:href",t),s.setAttribute("href",t),e.appendChild(s),e}const e=document.createElement("i");return e.classList.add(...t.split(" ")),e}_rebuild(){const t=this._isVisible;this._dispose(),t&&this.show()}}class j{constructor(){this.optionsStore=h.locate(u),this.dates=h.locate($),this.validation=h.locate(m),this.display=h.locate(Y),this._eventEmitters=h.locate(g),this._eventEmitters.action.subscribe((t=>{this.do(t.e,t.action)}))}do(e,s){const o=e?.currentTarget;if(o?.classList?.contains(i.css.disabled))return;s=s||o?.dataset?.action;const a=(this.dates.lastPicked||this.optionsStore.viewDate).clone;switch(s){case z.next:case z.previous:this.handleNextPrevious(s);break;case z.changeCalendarView:this.display._showMode(1),this.display._updateCalendarHeader();break;case z.selectMonth:case z.selectYear:case z.selectDecade:this.handleSelectCalendarMode(s,o);break;case z.selectDay:this.handleSelectDay(o);break;case z.selectHour:{let t=+o.dataset.value;a.hours>=12&&this.optionsStore.isTwelveHour&&(t+=12),a.hours=t,this.dates.setValue(a,this.dates.lastPickedIndex),this.hideOrClock(e);break}case z.selectMinute:a.minutes=+o.dataset.value,this.dates.setValue(a,this.dates.lastPickedIndex),this.hideOrClock(e);break;case z.selectSecond:a.seconds=+o.dataset.value,this.dates.setValue(a,this.dates.lastPickedIndex),this.hideOrClock(e);break;case z.incrementHours:this.manipulateAndSet(a,t.Unit.hours);break;case z.incrementMinutes:this.manipulateAndSet(a,t.Unit.minutes,this.optionsStore.options.stepping);break;case z.incrementSeconds:this.manipulateAndSet(a,t.Unit.seconds);break;case z.decrementHours:this.manipulateAndSet(a,t.Unit.hours,-1);break;case z.decrementMinutes:this.manipulateAndSet(a,t.Unit.minutes,-1*this.optionsStore.options.stepping);break;case z.decrementSeconds:this.manipulateAndSet(a,t.Unit.seconds,-1);break;case z.toggleMeridiem:this.manipulateAndSet(a,t.Unit.hours,this.dates.lastPicked.hours>=12?-12:12);break;case z.togglePicker:this.handleToggle(o);break;case z.showClock:case z.showHours:case z.showMinutes:case z.showSeconds:this.optionsStore.options.display.sideBySide||"clock"===this.optionsStore.currentView||(q.hideImmediately(this.display.dateContainer),q.showImmediately(this.display.timeContainer)),this.handleShowClockContainers(s);break;case z.clear:this.dates.setValue(null),this.display._updateCalendarHeader();break;case z.close:this.display.hide();break;case z.today:{const e=(new l).setLocalization(this.optionsStore.options.localization);this._eventEmitters.updateViewDate.emit(e),this.validation.isValid(e,t.Unit.date)&&this.dates.setValue(e,this.dates.lastPickedIndex);break}}}handleShowClockContainers(e){if(!this.display._hasTime)return void i.errorMessages.throwError("Cannot show clock containers when time is disabled.");this.optionsStore.currentView="clock",this.display.widget.querySelectorAll(`.${i.css.timeContainer} > div`).forEach((t=>t.style.display="none"));let s="";switch(e){case z.showClock:s=i.css.clockContainer,this.display._update("clock");break;case z.showHours:s=i.css.hourContainer,this.display._update(t.Unit.hours);break;case z.showMinutes:s=i.css.minuteContainer,this.display._update(t.Unit.minutes);break;case z.showSeconds:s=i.css.secondContainer,this.display._update(t.Unit.seconds)}this.display.widget.getElementsByClassName(s)[0].style.display="grid"}handleNextPrevious(t){const{unit:e,step:s}=p[this.optionsStore.currentCalendarViewMode];t===z.next?this.optionsStore.viewDate.manipulate(s,e):this.optionsStore.viewDate.manipulate(-1*s,e),this._eventEmitters.viewUpdate.emit(),this.display._showMode()}hideOrClock(t){this.optionsStore.isTwelveHour||this.optionsStore.options.display.components.minutes||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline?this.do(t,z.showClock):this.display.hide()}manipulateAndSet(t,e,s=1){const i=t.manipulate(s,e);this.validation.isValid(i,e)&&this.dates.setValue(i,this.dates.lastPickedIndex)}handleSelectCalendarMode(t,e){const s=+e.dataset.value;switch(t){case z.selectMonth:this.optionsStore.viewDate.month=s;break;case z.selectYear:case z.selectDecade:this.optionsStore.viewDate.year=s}this.optionsStore.currentCalendarViewMode===this.optionsStore.minimumCalendarViewMode?(this.dates.setValue(this.optionsStore.viewDate,this.dates.lastPickedIndex),this.optionsStore.options.display.inline||this.display.hide()):this.display._showMode(-1)}handleToggle(t){t.getAttribute("title")===this.optionsStore.options.localization.selectDate?(t.setAttribute("title",this.optionsStore.options.localization.selectTime),t.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.time).outerHTML,this.display._updateCalendarHeader(),this.optionsStore.refreshCurrentView()):(t.setAttribute("title",this.optionsStore.options.localization.selectDate),t.innerHTML=this.display._iconTag(this.optionsStore.options.display.icons.date).outerHTML,this.display._hasTime&&(this.handleShowClockContainers(z.showClock),this.display._update("clock"))),this.display.widget.querySelectorAll(`.${i.css.dateContainer}, .${i.css.timeContainer}`).forEach((t=>q.toggle(t))),this._eventEmitters.viewUpdate.emit()}handleSelectDay(e){const s=this.optionsStore.viewDate.clone;e.classList.contains(i.css.old)&&s.manipulate(-1,t.Unit.month),e.classList.contains(i.css.new)&&s.manipulate(1,t.Unit.month),s.date=+e.dataset.day,this.optionsStore.options.dateRange?this.handleDateRange(s):this.optionsStore.options.multipleDates?this.handleMultiDate(s):this.dates.setValue(s,this.dates.lastPickedIndex),this.display._hasTime||this.optionsStore.options.display.keepOpen||this.optionsStore.options.display.inline||this.optionsStore.options.multipleDates||this.optionsStore.options.dateRange||this.display.hide()}handleMultiDate(e){let s=this.dates.pickedIndex(e,t.Unit.date);console.log(s),-1!==s?this.dates.setValue(null,s):(s=this.dates.lastPickedIndex+1,0===this.dates.picked.length&&(s=0),this.dates.setValue(e,s))}handleDateRange(t){switch(this.dates.picked.length){case 2:this.dates.clear();break;case 1:{const e=this.dates.picked[0];if(t.getTime()===e.getTime()){this.dates.clear();break}return t.isBefore(e)?(this.dates.setValue(t,0),void this.dates.setValue(e,1)):void this.dates.setValue(t,1)}}this.dates.setValue(t,0)}}class R{constructor(t,e={}){this._subscribers={},this._isDisabled=!1,this._inputChangeEvent=t=>{const e=t?.detail;if(e)return;const s=()=>{this.dates.lastPicked&&(this.optionsStore.viewDate=this.dates.lastPicked.clone)},i=this.optionsStore.input.value;if(this.optionsStore.options.multipleDates)try{const t=i.split(this.optionsStore.options.multipleDatesSeparator);for(let e=0;e{this.optionsStore.element?.disabled||this.optionsStore.input?.disabled||this.toggle()},h=new c,this._eventEmitters=h.locate(g),this.optionsStore=h.locate(u),this.display=h.locate(Y),this.dates=h.locate($),this.actions=h.locate(j),t||i.errorMessages.mustProvideElement(),this.optionsStore.element=t,this._initializeOptions(e,f,!0),this.optionsStore.viewDate.setLocalization(this.optionsStore.options.localization),this.optionsStore.unset=!0,this._initializeInput(),this._initializeToggle(),this.optionsStore.options.display.inline&&this.display.show(),this._eventEmitters.triggerEvent.subscribe((t=>{this._triggerEvent(t)})),this._eventEmitters.viewUpdate.subscribe((()=>{this._viewUpdate()})),this._eventEmitters.updateViewDate.subscribe((t=>{this.viewDate=t}))}get viewDate(){return this.optionsStore.viewDate}set viewDate(t){this.optionsStore.viewDate=t,this.optionsStore.viewDate.setLocalization(this.optionsStore.options.localization),this.display._update("clock"===this.optionsStore.currentView?"clock":"calendar")}updateOptions(t,e=!1){e?this._initializeOptions(t,f):this._initializeOptions(t,this.optionsStore.options),this.optionsStore.viewDate.setLocalization(this.optionsStore.options.localization),this.display._rebuild()}toggle(){this._isDisabled||this.display.toggle()}show(){this._isDisabled||this.display.show()}hide(){this.display.hide()}disable(){this._isDisabled=!0,this.optionsStore.input?.setAttribute("disabled","disabled"),this.display.hide()}enable(){this._isDisabled=!1,this.optionsStore.input?.removeAttribute("disabled")}clear(){this.optionsStore.input.value="",this.dates.clear()}subscribe(t,e){let s;"string"==typeof t&&(t=[t]),s=Array.isArray(e)?e:[e],t.length!==s.length&&i.errorMessages.subscribeMismatch();const o=[];for(let e=0;e{e(t)}))}_viewUpdate(){this._triggerEvent({type:i.events.update,viewDate:this.optionsStore.viewDate.clone})}_unsubscribe(t,e){this._subscribers[t].splice(e,1)}_initializeOptions(t,e,s=!1){let i=V.deepCopy(t);i=V._mergeOptions(i,e),s&&(i=V._dataToOptions(this.optionsStore.element,i)),V._validateConflicts(i),i.viewDate=i.viewDate.setLocalization(i.localization),this.optionsStore.viewDate.isSame(i.viewDate)||(this.optionsStore.viewDate=i.viewDate),i.display.components.year&&(this.optionsStore.minimumCalendarViewMode=2),i.display.components.month&&(this.optionsStore.minimumCalendarViewMode=1),i.display.components.date&&(this.optionsStore.minimumCalendarViewMode=0),this.optionsStore.currentCalendarViewMode=Math.max(this.optionsStore.minimumCalendarViewMode,this.optionsStore.currentCalendarViewMode),p[this.optionsStore.currentCalendarViewMode].name!==i.display.viewMode&&(this.optionsStore.currentCalendarViewMode=Math.max(p.findIndex((t=>t.name===i.display.viewMode)),this.optionsStore.minimumCalendarViewMode)),this.display?.isVisible&&this.display._update("all"),i.display.components.useTwentyfourHour&&void 0===i.localization.hourCycle?i.localization.hourCycle="h24":void 0===i.localization.hourCycle&&(i.localization.hourCycle=d(i.localization.locale)),this.optionsStore.options=i}_initializeInput(){if("INPUT"==this.optionsStore.element.tagName)this.optionsStore.input=this.optionsStore.element;else{const t=this.optionsStore.element.dataset.tdTargetInput;this.optionsStore.input=null==t||"nearest"==t?this.optionsStore.element.querySelector("input"):this.optionsStore.element.querySelector(t)}this.optionsStore.input&&(!this.optionsStore.input.value&&this.optionsStore.options.defaultDate&&(this.optionsStore.input.value=this.dates.formatInput(this.optionsStore.options.defaultDate)),this.optionsStore.input.addEventListener("change",this._inputChangeEvent),this.optionsStore.options.allowInputToggle&&this.optionsStore.input.addEventListener("click",this._toggleClickEvent),this.optionsStore.input.value&&this._inputChangeEvent())}_initializeToggle(){if(this.optionsStore.options.display.inline)return;let t=this.optionsStore.element.dataset.tdTargetToggle;"nearest"==t&&(t='[data-td-toggle="datetimepicker"]'),this._toggle=null==t?this.optionsStore.element:this.optionsStore.element.querySelector(t),this._toggle.addEventListener("click",this._toggleClickEvent)}_handleAfterChangeEvent(t){!this.optionsStore.options.promptTimeOnDateChange||this.optionsStore.options.multipleDates||this.optionsStore.options.display.inline||this.optionsStore.options.display.sideBySide||!this.display._hasTime||this.display.widget?.getElementsByClassName(i.css.show)[0].classList.contains(i.css.timeContainer)||!t.oldDate&&this.optionsStore.options.useCurrent||t.oldDate&&t.date?.isSame(t.oldDate)||(clearTimeout(this._currentPromptTimeTimeout),this._currentPromptTimeTimeout=setTimeout((()=>{this.display.widget&&this._eventEmitters.action.emit({e:{currentTarget:this.display.widget.querySelector(`.${i.css.switch}`)},action:z.togglePicker})}),this.optionsStore.options.promptTimeOnDateChangeTransitionDelay))}}const Q={},J=t=>{Q[t.name]||(Q[t.name]=t.localization)},K=t=>{const e=Q[t];e&&(f.localization=e)},Z=function(t,e=undefined){return t?(t.installed||(t(e,{TempusDominus:R,Dates:$,Display:Y,DateTime:l,Namespace:i},X),t.installed=!0),X):X},G="6.7.7",X={TempusDominus:R,extend:Z,loadLocale:J,locale:K,Namespace:i,DefaultOptions:f,DateTime:l,Unit:t.Unit,version:G,DefaultEnLocalization:S};t.DateTime=l,t.DefaultEnLocalization=S,t.DefaultOptions=f,t.Namespace=i,t.TempusDominus=R,t.extend=Z,t.loadLocale=J,t.locale=K,t.version=G,Object.defineProperty(t,"__esModule",{value:!0})})); diff --git a/package-lock.json b/package-lock.json index 4d015cded..3375ad400 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@eonasdan/tempus-dominus", - "version": "6.4.4", + "version": "6.7.7", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@eonasdan/tempus-dominus", - "version": "6.4.4", + "version": "6.7.7", "license": "MIT", "devDependencies": { "@eonasdan/parvus-server": "^1.1.9", diff --git a/package.json b/package.json index 2f0e90f18..29fa98f46 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "name": "Jonathan Peterson" }, "name": "@eonasdan/tempus-dominus", - "version": "6.4.4", + "version": "6.7.7", "style": "dist/css/tempus-dominus.css", "sass": "scss/tempus-dominus.scss", "main": "dist/js/tempus-dominus.js", diff --git a/src/docs/partials/change-log.html b/src/docs/partials/change-log.html index a28f594ec..3e3e93695 100644 --- a/src/docs/partials/change-log.html +++ b/src/docs/partials/change-log.html @@ -2,6 +2,24 @@

Version 6

+
+

6.7.7

+

New

+
    +
  • Lots more test coverage #2791
  • +
  • Placement option #2789
  • +
  • Exported default en-US locale #2687
  • +
  • When userCurrent is false the clock will now display -- instead. #2764
  • +
+

Bug fixes

+
    +
  • Fixed some issues with the date range #2788, #2798
  • +
  • Fixed calendarWeeks bug #2786
  • +
  • Fixed REPL issues #2795 #2784
  • +
  • Fixed multiple dates option not showing "active" state #2796
  • +
+
+

6.4.4

Bug fixes

diff --git a/src/docs/partials/installing.html b/src/docs/partials/installing.html index 060c93457..3a3e55336 100644 --- a/src/docs/partials/installing.html +++ b/src/docs/partials/installing.html @@ -15,10 +15,10 @@

Via CDN

<!-- Popperjs --> <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js" crossorigin="anonymous"></script> <!-- Tempus Dominus JavaScript --> -<script src="https://cdn.jsdelivr.net/npm/@eonasdan/tempus-dominus@6.4.4/dist/js/tempus-dominus.min.js" crossorigin="anonymous"></script> +<script src="https://cdn.jsdelivr.net/npm/@eonasdan/tempus-dominus@6.7.7/dist/js/tempus-dominus.min.js" crossorigin="anonymous"></script> <!-- Tempus Dominus Styles --> -<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@eonasdan/tempus-dominus@6.4.4/dist/css/tempus-dominus.min.css" crossorigin="anonymous"> +<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@eonasdan/tempus-dominus@6.7.7/dist/css/tempus-dominus.min.css" crossorigin="anonymous">
diff --git a/src/docs/partials/options/index.html b/src/docs/partials/options/index.html index 5a472aa15..5b5becc9c 100644 --- a/src/docs/partials/options/index.html +++ b/src/docs/partials/options/index.html @@ -123,7 +123,7 @@
-

dateRange (as of 6.4.4) dateRange (as of 6.7.7)

diff --git a/src/docs/templates/index.html b/src/docs/templates/index.html index 83056c8ed..2976f8ebb 100644 --- a/src/docs/templates/index.html +++ b/src/docs/templates/index.html @@ -17,7 +17,7 @@

Powerful and robust date and time picker

- Currently v6.4.4 + Currently v6.7.7 · v5 docs

@@ -55,10 +55,10 @@

JsDelivr

<!-- Popperjs --> <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js" integrity="sha256-BRqBN7dYgABqtY9Hd4ynE+1slnEw+roEPFzQ7TRRfcg=" crossorigin="anonymous"></script> <!-- Tempus Dominus JavaScript --> -<script src="https://cdn.jsdelivr.net/npm/@eonasdan/tempus-dominus@6.4.4/dist/js/tempus-dominus.min.js" crossorigin="anonymous"></script> +<script src="https://cdn.jsdelivr.net/npm/@eonasdan/tempus-dominus@6.7.7/dist/js/tempus-dominus.min.js" crossorigin="anonymous"></script> <!-- Tempus Dominus Styles --> -<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@eonasdan/tempus-dominus@6.4.4/dist/css/tempus-dominus.min.css" crossorigin="anonymous"> +<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@eonasdan/tempus-dominus@6.7.7/dist/css/tempus-dominus.min.css" crossorigin="anonymous"> diff --git a/src/docs/templates/shell.html b/src/docs/templates/shell.html index 41b6ff8f1..bfcade63f 100644 --- a/src/docs/templates/shell.html +++ b/src/docs/templates/shell.html @@ -136,7 +136,7 @@ Tempus Dominus v6.0
diff --git a/src/js/jQuery-provider.js b/src/js/jQuery-provider.js index e3e99f5a8..5ab5081d0 100644 --- a/src/js/jQuery-provider.js +++ b/src/js/jQuery-provider.js @@ -2,7 +2,7 @@ /*global $, tempusDominus */ /*! - * Tempus Dominus v6.4.4 (https://getdatepicker.com/) + * Tempus Dominus v6.7.7 (https://getdatepicker.com/) * Copyright 2013-2021 Jonathan Peterson * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE) */ diff --git a/src/js/tempus-dominus.ts b/src/js/tempus-dominus.ts index add2eb214..0d585904d 100644 --- a/src/js/tempus-dominus.ts +++ b/src/js/tempus-dominus.ts @@ -608,7 +608,7 @@ const extend = function (plugin, option = undefined) { return tempusDominus; }; -const version = '6.4.4'; +const version = '6.7.7'; const tempusDominus = { TempusDominus, diff --git a/src/nuget/TempusDominus.nuspec b/src/nuget/TempusDominus.nuspec index 69b55176c..91fc86f16 100644 --- a/src/nuget/TempusDominus.nuspec +++ b/src/nuget/TempusDominus.nuspec @@ -2,7 +2,7 @@ TempusDominus - 6.4.4 + 6.7.7 Tempus Dominus Eonasdan Eonasdan diff --git a/src/nuget/TempusDominus.scss.nuspec b/src/nuget/TempusDominus.scss.nuspec index 57c0008ec..9ce94a247 100644 --- a/src/nuget/TempusDominus.scss.nuspec +++ b/src/nuget/TempusDominus.scss.nuspec @@ -2,7 +2,7 @@ TempusDominus.scss - 6.4.4 + 6.7.7 Tempus Dominus Eonasdan Eonasdan diff --git a/types/tempus-dominus.d.ts b/types/tempus-dominus.d.ts index 82a90ec52..61a907e80 100644 --- a/types/tempus-dominus.d.ts +++ b/types/tempus-dominus.d.ts @@ -217,7 +217,7 @@ declare const extend: ( ordinal?: (n: number) => any; }; }; -declare const version = '6.4.4'; +declare const version = '6.7.7'; export { TempusDominus, extend,