{"version":3,"names":["tempusDominus","$","luxon","_interopDefaultLegacy","e","default","_interopNamespace","__esModule","n","Object","create","keys","forEach","k","d","getOwnPropertyDescriptor","defineProperty","get","enumerable","$__default","luxon__namespace","TdError","Error","NAME","Namespace","dataKey","events","Events","constructor","this","key","change","update","error","show","hide","blur","focus","keyup","keydown","css","Css","widget","calendarHeader","switch","toolbar","noHighlight","sideBySide","previous","next","disabled","old","new","active","dateContainer","decadesContainer","decade","yearsContainer","year","monthsContainer","month","daysContainer","day","calendarWeeks","dayOfTheWeek","today","weekend","rangeIn","rangeStart","rangeEnd","timeContainer","separator","clockContainer","hourContainer","minuteContainer","secondContainer","hour","minute","second","toggleMeridiem","collapsing","collapse","inline","lightTheme","darkTheme","isDarkPreferredQuery","errorMessages","ErrorMessages","base","failedToSetInvalidDate","failedToParseInput","unexpectedOption","optionName","code","unexpectedOptions","join","unexpectedOptionValue","badValue","validOptions","typeMismatch","badType","expectedType","numbersOutOfRange","lower","upper","failedToParseDate","date","soft","console","warn","mustProvideElement","subscribeMismatch","conflictingConfiguration","message","customDateFormatError","dateString","deprecatedWarning","remediation","throwError","Unit","DefaultFormatLocalization$1","dateFormats","LTS","LT","L","LL","LLL","LLLL","format","locale","hourCycle","undefined","ordinal","s","v","twoDigitTemplate","getFormatByUnit","unit","dateStyle","guessHourCycle","template","numberingSystem","dt","DateTime","setLocalization","hours","start","parts","end","Date","super","arguments","localization","nonLeapLadder","leapLadder","dateTimeRegex","formattingTokens","match2","match3","match4","match1to2","matchSigned","matchOffset","matchWord","zoneExpressions","obj","input","offset","offsetFromString","expressions","t","pattern","parser","afternoon","meridiemMatch","T","fff","milliseconds","addInput","ss","m","mm","H","h","HH","hh","dd","Do","match","i","replace","M","MM","MMM","months","getAllMonths","matchIndex","map","_","slice","indexOf","MMMM","y","yy","parseTwoDigitYear","yyyy","setLocale","value","static","formatLocalization","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","getMilliseconds","clone","minutes","seconds","JSON","stringify","name","startOf","startOfTheWeek","setMilliseconds","setSeconds","setMinutes","setHours","weekDay","goBack","manipulate","setDate","setMonth","endOf","endOfWeek","isBefore","compare","isValid","valueOf","isAfter","isSame","convert","isBetween","left","right","inclusivity","leftInclusivity","rightInclusivity","isLeftInRange","isRightInRange","timeStyle","Intl","DateTimeFormat","formatToParts","filter","x","type","secondsFormatted","minutesFormatted","getHoursFormatted","meridiem","hour12","find","p","dateFormatted","getDay","targetMonth","endOfMonth","monthFormatted","setFullYear","week","computeOrdinal","weekday","getUTCDay","weekNumber","Math","floor","weeksInWeekYear","p1","last","p2","dateToDataValue","toString","padStart","isLeapYear","applyFormat","Array","replaceTokens","formatStr","formats","a","b","B","toUpperCase","first","third","zoneInformation","style","timeZoneName","negative","includes","substring","property","getLocaleAfternoon","toLowerCase","correctHours","time","makeParser","matchArray","length","expressionArray","token","expression","part","exec","call","zone","UTC","formatString","formatter","HHCycle","startsWith","hhCycle","matches","ddd","dddd","$1","ServiceLocator","cache","Map","locate","identifier","service","set","serviceLocator","CalendarModes","className","step","OptionsStore","_currentCalendarViewMode","_viewDate","minimumCalendarViewMode","currentView","currentCalendarViewMode","viewDate","options","refreshCurrentView","isTwelveHour","Validation","optionsStore","targetDate","granularity","_enabledDisabledDatesIsValid","restrictions","daysOfWeekDisabled","_minMaxIsValid","_enabledDisabledHoursIsValid","disabledTimeIntervals","internal","from","to","disabledDates","_isInDisabledDates","enabledDates","_isInEnabledDates","testDate","minDate","maxDate","disabledHours","_isInDisabledHours","enabledHours","_isInEnabledHours","formattedDate","dateRangeIsValid","dates","index","target","dateRange","EventEmitter","subscribers","subscribe","callback","push","unsubscribe","bind","splice","emit","destroy","EventEmitters","triggerEvent","viewUpdate","updateDisplay","action","updateViewDate","defaultEnLocalization","clear","close","dayViewHeaderFormat","decrementHour","decrementMinute","decrementSecond","incrementHour","incrementMinute","incrementSecond","maxWeekdayLength","nextCentury","nextDecade","nextMonth","nextYear","pickHour","pickMinute","pickSecond","previousCentury","previousDecade","previousMonth","previousYear","selectDate","selectDecade","selectMonth","selectTime","selectYear","toggleAriaLabel","DefaultOptions","allowInputToggle","container","debug","defaultDate","display","icons","up","down","viewMode","toolbarPlacement","keepOpen","buttons","components","calendar","decades","clock","useTwentyfourHour","theme","placement","keyboardNavigation","keepInvalid","meta","multipleDates","multipleDatesSeparator","promptTimeOnDateChange","promptTimeOnDateChangeTransitionDelay","stepping","useCurrent","DefaultEnLocalization","tryConvertToDateTime","dateTime","fromString","convertToDateTime","converted","typeCheckDateArray","providedType","isArray","typeCheckNumberArray","some","mandatoryDate","optionalDate","mandatory","args","numbersInRange","validHourRange","validDateArray","validKeyOption","keyOptions","path","optionProcessors","freeze","valueObject","vk","subOptionName","HTMLElement","Element","appendChild","defaultType","defaultProcessor","processKey","OptionConverter","o","inputElement","deepCopy","paths","charAt","split","reduce","isValue","provided","copyTo","defaultOptions","objectPath","unsupportedOptions","flattenedOptions","getFlattenDefaultOptions","errors","didYouMean","defaultOptionValue","lastIndexOf","ignoreProperties","spread","providedOptions","mergeTo","newConfig","element","eData","parse","dataset","tdTargetInput","tdTargetToggle","dataOptions","objectToNormalized","object","lowered","normalizeObject","optionsLower","keyOption","_mergeOptions","optionSubgroup","internalObject","_flattenDefaults","deepKeys","pre","entries","flatMap","config","Dates","_dates","validation","_eventEmitters","picked","lastPicked","lastPickedIndex","formatInput","parseInput","dateConversion","reason","setFromInput","setValue","add","isPicked","innerDateFormatted","pickedIndex","unset","oldDate","isClear","factor","startYear","updateInput","newValue","noIndex","_setValueNull","round","onUpdate","ActionTypes","ActionTypes$1","DateDisplay","getPicker","document","createElement","classList","role","append","_daysOfTheWeek","div","rangeHoverEvent","rangeHoverOutEvent","handleMouseEvents","tabIndex","setAttribute","selectDay","matchMedia","addEventListener","_update","paint","getElementsByClassName","_updateCalendarView","innerDate","_handleCalendarWeeks","querySelectorAll","classes","_handleDateRange","remove","innerText","ariaLabel","currentTarget","contains","allDays","attributeValue","getAttribute","dayIndex","findIndex","rangeStartFormatted","rangeStartIndex","rangeStartElement","lambda","switcher","parentElement","getElementsByTagName","row","htmlDivElement","MonthDisplay","containerClone","YearDisplay","_startYear","_endYear","DecadeDisplay","getStartEndYear","_startDecade","_endDecade","isPreviousEnabled","pickedYears","textContent","startDecadeYear","endDecadeYear","TimeDisplay","_gridColumns","iconTag","_grid","timesDiv","querySelector","incrementHours","decrementHours","incrementMinutes","decrementMinutes","incrementSeconds","decrementSeconds","toggle","meridiemDate","gridTemplateAreas","top","middle","bottom","upIcon","downIcon","separatorColon","cloneNode","innerHTML","getSeparator","colon","divElement","showHours","showMinutes","showSeconds","button","trim","HourDisplay","selectHour","MinuteDisplay","selectMinute","secondDisplay","selectSecond","Collapse","height","setTimeout","showImmediately","getTransitionDurationFromElement","scrollHeight","getBoundingClientRect","offsetHeight","hideImmediately","transitionDuration","transitionDelay","window","getComputedStyle","floatTransitionDuration","Number","parseFloat","floatTransitionDelay","Display","_isVisible","_keyboardEventBound","_keyboardEvent","_documentClickEvent","composedPath","_actionsClickEvent","dateDisplay","monthDisplay","yearDisplay","decadeDisplay","timeDisplay","hourDisplay","minuteDisplay","_widget","result","isVisible","_hasTime","_updateCalendarHeader","_hasDate","_unit","_date","_classes","_element","_showSetDefaultIfNeeded","_buildWidget","_updateTheme","_showSetupViewMode","body","createPopup","modifiers","enabled","documentElement","dir","then","_handleFocus","showClock","updatePopup","onlyClock","_showMode","tries","direction","async","createPopperFunction","Popper","createPopper","import","_popperInstance","max","min","datePickerMode","picker","findViewDateElement","_getThemeClass","removeEventListener","currentTheme","isDarkMode","showing","_dispose","parentNode","removeChild","dateView","getHeadTemplate","timeView","_iconTag","getToolbarElements","_hasDateAndTime","_buildWidgetSideBySide","setupComponentView","hasFirst","hasSecond","shouldShow","arrow","title","icon","togglePicker","changeCalendarView","iconClass","svg","createElementNS","_rebuild","wasVisible","event","_handleKeyDownDate","_handleKeyDownClock","selector","dataValue","flag","activeElement","verticalChange","horizontalChange","click","stopPropagation","preventDefault","_handleTab","shiftKey","newViewDate","divWithValue","visibleElement","subView","cells","currentIndex","targetIndex","addCalendarHeaderTargets","calendarHeaderItems","tabTargets","toolbarItems","_handleFocusClock","children","Actions","do","handleNextPrevious","handleSelectCalendarMode","handleSelectDay","hideOrClock","manipulateAndSet","handleToggle","handleShowClockContainers","handleDateRange","handleMultiDate","htmlElement","classToUse","newDate","outerHTML","visible","other","getTime","TempusDominus","_subscribers","_isDisabled","_inputChangeEvent","internallyTriggered","detail","setViewDate","valueSplit","_toggleClickEvent","nodeName","_openClickEvent","actions","_initializeOptions","_initializeInput","_initializeToggle","_triggerEvent","_viewUpdate","updateOptions","reset","disable","enable","removeAttribute","eventTypes","callbacks","callBackArray","returnArray","eventType","_unsubscribe","dispose","_handleToggleKeydown","language","asked","loadedLocales","isChangeEvent","_handleAfterChangeEvent","dispatchEvent","CustomEvent","label","jQuery","trigger","_publish","eventName","includeDataset","_dataToOptions","_validateConflicts","tagName","query","clearTimeout","_currentPromptTimeTimeout","loadLocale","l","extend","plugin","option","installed","tempusDominus$1","version","__proto__","tdClasses","tdFactory","prototype","opts","parsedDate","fromFormat","toJSDate","outputCalendar","fromJSDate","toFormat","jQueryInterface","argument","jQueryHandleThis","each","me","data","isDateUpdateThroughDateOptionFromClientCode","ret","JQUERY_NO_CONFLICT","fn","Constructor","noConflict"],"sources":["./dist/js/tempus-dominus.js"],"sourcesContent":["/*!\n * Tempus Dominus v6.10.0 (https://getdatepicker.com/)\n * Copyright 2013-2025 Jonathan Peterson\n * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE)\n */\nvar tempusDominus = (function ($, luxon) {\n 'use strict';\n\n function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\n function _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () { return e[k]; }\n });\n }\n });\n }\n n[\"default\"] = e;\n return n;\n }\n\n var $__default = /*#__PURE__*/_interopDefaultLegacy($);\n var luxon__namespace = /*#__PURE__*/_interopNamespace(luxon);\n\n class TdError extends Error {\r\n }\r\n class ErrorMessages {\r\n constructor() {\r\n this.base = 'TD:';\r\n //#endregion\r\n //#region used with notify.error\r\n /**\r\n * Used with an Error Event type if the user selects a date that\r\n * fails restriction validation.\r\n */\r\n this.failedToSetInvalidDate = 'Failed to set invalid date';\r\n /**\r\n * Used with an Error Event type when a user changes the value of the\r\n * input field directly, and does not provide a valid date.\r\n */\r\n this.failedToParseInput = 'Failed parse input field';\r\n //#endregion\r\n }\r\n //#region out to console\r\n /**\r\n * Throws an error indicating that a key in the options object is invalid.\r\n * @param optionName\r\n */\r\n unexpectedOption(optionName) {\r\n const error = new TdError(`${this.base} Unexpected option: ${optionName} does not match a known option.`);\r\n error.code = 1;\r\n throw error;\r\n }\r\n /**\r\n * Throws an error indicating that one more keys in the options object is invalid.\r\n * @param optionName\r\n */\r\n unexpectedOptions(optionName) {\r\n const error = new TdError(`${this.base}: ${optionName.join(', ')}`);\r\n error.code = 1;\r\n throw error;\r\n }\r\n /**\r\n * Throws an error when an option is provide an unsupported value.\r\n * For example a value of 'cheese' for toolbarPlacement which only supports\r\n * 'top', 'bottom', 'default'.\r\n * @param optionName\r\n * @param badValue\r\n * @param validOptions\r\n */\r\n unexpectedOptionValue(optionName, badValue, validOptions) {\r\n const error = new TdError(`${this.base} Unexpected option value: ${optionName} does not accept a value of \"${badValue}\". Valid values are: ${validOptions.join(', ')}`);\r\n error.code = 2;\r\n throw error;\r\n }\r\n /**\r\n * Throws an error when an option value is the wrong type.\r\n * For example a string value was provided to multipleDates which only\r\n * supports true or false.\r\n * @param optionName\r\n * @param badType\r\n * @param expectedType\r\n */\r\n typeMismatch(optionName, badType, expectedType) {\r\n const error = new TdError(`${this.base} Mismatch types: ${optionName} has a type of ${badType} instead of the required ${expectedType}`);\r\n error.code = 3;\r\n throw error;\r\n }\r\n /**\r\n * Throws an error when an option value is outside of the expected range.\r\n * For example restrictions.daysOfWeekDisabled excepts a value between 0 and 6.\r\n * @param optionName\r\n * @param lower\r\n * @param upper\r\n */\r\n numbersOutOfRange(optionName, lower, upper) {\r\n const error = new TdError(`${this.base} ${optionName} expected an array of number between ${lower} and ${upper}.`);\r\n error.code = 4;\r\n throw error;\r\n }\r\n /**\r\n * Throws an error when a value for a date options couldn't be parsed. Either\r\n * the option was an invalid string or an invalid Date object.\r\n * @param optionName\r\n * @param date\r\n * @param soft If true, logs a warning instead of an error.\r\n */\r\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n failedToParseDate(optionName, date, soft = false) {\r\n const error = new TdError(`${this.base} Could not correctly parse \"${date}\" to a date for ${optionName}.`);\r\n error.code = 5;\r\n if (!soft)\r\n throw error;\r\n console.warn(error);\r\n }\r\n /**\r\n * Throws when an element to attach to was not provided in the constructor.\r\n */\r\n mustProvideElement() {\r\n const error = new TdError(`${this.base} No element was provided.`);\r\n error.code = 6;\r\n throw error;\r\n }\r\n /**\r\n * Throws if providing an array for the events to subscribe method doesn't have\r\n * the same number of callbacks. E.g., subscribe([1,2], [1])\r\n */\r\n subscribeMismatch() {\r\n const error = new TdError(`${this.base} The subscribed events does not match the number of callbacks`);\r\n error.code = 7;\r\n throw error;\r\n }\r\n /**\r\n * Throws if the configuration has conflicting rules e.g. minDate is after maxDate\r\n */\r\n conflictingConfiguration(message) {\r\n const error = new TdError(`${this.base} A configuration value conflicts with another rule. ${message}`);\r\n error.code = 8;\r\n throw error;\r\n }\r\n /**\r\n * customDateFormat errors\r\n */\r\n customDateFormatError(message) {\r\n const error = new TdError(`${this.base} Custom Date Format: ${message}`);\r\n error.code = 9;\r\n throw error;\r\n }\r\n /**\r\n * Logs a warning if a date option value is provided as a string, instead of\r\n * a date/datetime object.\r\n */\r\n dateString() {\r\n console.warn(`${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`);\r\n }\r\n deprecatedWarning(message, remediation) {\r\n console.warn(`${this.base} Warning ${message} is deprecated and will be removed in a future version. ${remediation}`);\r\n }\r\n throwError(message) {\r\n const error = new TdError(`${this.base} ${message}`);\r\n error.code = 9;\r\n throw error;\r\n }\r\n }\n\n // this is not the way I want this to stay but nested classes seemed to blown up once its compiled.\r\n const NAME = 'tempus-dominus', dataKey = 'td';\r\n /**\r\n * Events\r\n */\r\n class Events {\r\n constructor() {\r\n this.key = `.${dataKey}`;\r\n /**\r\n * Change event. Fired when the user selects a date.\r\n * See also EventTypes.ChangeEvent\r\n */\r\n this.change = `change${this.key}`;\r\n /**\r\n * Emit when the view changes for example from month view to the year view.\r\n * See also EventTypes.ViewUpdateEvent\r\n */\r\n this.update = `update${this.key}`;\r\n /**\r\n * Emits when a selected date or value from the input field fails to meet the provided validation rules.\r\n * See also EventTypes.FailEvent\r\n */\r\n this.error = `error${this.key}`;\r\n /**\r\n * Show event\r\n * @event Events#show\r\n */\r\n this.show = `show${this.key}`;\r\n /**\r\n * Hide event\r\n * @event Events#hide\r\n */\r\n this.hide = `hide${this.key}`;\r\n // blur and focus are used in the jQuery provider but are otherwise unused.\r\n // keyup/down will be used later for keybinding options\r\n this.blur = `blur${this.key}`;\r\n this.focus = `focus${this.key}`;\r\n this.keyup = `keyup${this.key}`;\r\n this.keydown = `keydown${this.key}`;\r\n }\r\n }\r\n class Css {\r\n constructor() {\r\n /**\r\n * The outer element for the widget.\r\n */\r\n this.widget = `${NAME}-widget`;\r\n /**\r\n * Hold the previous, next and switcher divs\r\n */\r\n this.calendarHeader = 'calendar-header';\r\n /**\r\n * The element for the action to change the calendar view. E.g. month -> year.\r\n */\r\n this.switch = 'picker-switch';\r\n /**\r\n * The elements for all the toolbar options\r\n */\r\n this.toolbar = 'toolbar';\r\n /**\r\n * Disables the hover and rounding affect.\r\n */\r\n this.noHighlight = 'no-highlight';\r\n /**\r\n * Applied to the widget element when the side by side option is in use.\r\n */\r\n this.sideBySide = 'timepicker-sbs';\r\n /**\r\n * The element for the action to change the calendar view, e.g. August -> July\r\n */\r\n this.previous = 'previous';\r\n /**\r\n * The element for the action to change the calendar view, e.g. August -> September\r\n */\r\n this.next = 'next';\r\n /**\r\n * Applied to any action that would violate any restriction options. ALso applied\r\n * to an input field if the disabled function is called.\r\n */\r\n this.disabled = 'disabled';\r\n /**\r\n * Applied to any date that is less than requested view,\r\n * e.g. the last day of the previous month.\r\n */\r\n this.old = 'old';\r\n /**\r\n * Applied to any date that is greater than of requested view,\r\n * e.g. the last day of the previous month.\r\n */\r\n this.new = 'new';\r\n /**\r\n * Applied to any date that is currently selected.\r\n */\r\n this.active = 'active';\r\n //#region date element\r\n /**\r\n * The outer element for the calendar view.\r\n */\r\n this.dateContainer = 'date-container';\r\n /**\r\n * The outer element for the decades view.\r\n */\r\n this.decadesContainer = `${this.dateContainer}-decades`;\r\n /**\r\n * Applied to elements within the decade container, e.g. 2020, 2030\r\n */\r\n this.decade = 'decade';\r\n /**\r\n * The outer element for the years view.\r\n */\r\n this.yearsContainer = `${this.dateContainer}-years`;\r\n /**\r\n * Applied to elements within the years container, e.g. 2021, 2021\r\n */\r\n this.year = 'year';\r\n /**\r\n * The outer element for the month view.\r\n */\r\n this.monthsContainer = `${this.dateContainer}-months`;\r\n /**\r\n * Applied to elements within the month container, e.g. January, February\r\n */\r\n this.month = 'month';\r\n /**\r\n * The outer element for the calendar view.\r\n */\r\n this.daysContainer = `${this.dateContainer}-days`;\r\n /**\r\n * Applied to elements within the day container, e.g. 1, 2..31\r\n */\r\n this.day = 'day';\r\n /**\r\n * If display.calendarWeeks is enabled, a column displaying the week of year\r\n * is shown. This class is applied to each cell in that column.\r\n */\r\n this.calendarWeeks = 'cw';\r\n /**\r\n * Applied to the first row of the calendar view, e.g. Sunday, Monday\r\n */\r\n this.dayOfTheWeek = 'dow';\r\n /**\r\n * Applied to the current date on the calendar view.\r\n */\r\n this.today = 'today';\r\n /**\r\n * Applied to the locale's weekend dates on the calendar view, e.g. Sunday, Saturday\r\n */\r\n this.weekend = 'weekend';\r\n this.rangeIn = 'range-in';\r\n this.rangeStart = 'range-start';\r\n this.rangeEnd = 'range-end';\r\n //#endregion\r\n //#region time element\r\n /**\r\n * The outer element for all time related elements.\r\n */\r\n this.timeContainer = 'time-container';\r\n /**\r\n * Applied the separator columns between time elements, e.g. hour *:* minute *:* second\r\n */\r\n this.separator = 'separator';\r\n /**\r\n * The outer element for the clock view.\r\n */\r\n this.clockContainer = `${this.timeContainer}-clock`;\r\n /**\r\n * The outer element for the hours selection view.\r\n */\r\n this.hourContainer = `${this.timeContainer}-hour`;\r\n /**\r\n * The outer element for the minutes selection view.\r\n */\r\n this.minuteContainer = `${this.timeContainer}-minute`;\r\n /**\r\n * The outer element for the seconds selection view.\r\n */\r\n this.secondContainer = `${this.timeContainer}-second`;\r\n /**\r\n * Applied to each element in the hours selection view.\r\n */\r\n this.hour = 'hour';\r\n /**\r\n * Applied to each element in the minutes selection view.\r\n */\r\n this.minute = 'minute';\r\n /**\r\n * Applied to each element in the seconds selection view.\r\n */\r\n this.second = 'second';\r\n /**\r\n * Applied AM/PM toggle button.\r\n */\r\n this.toggleMeridiem = 'toggleMeridiem';\r\n //#endregion\r\n //#region collapse\r\n /**\r\n * Applied the element of the current view mode, e.g. calendar or clock.\r\n */\r\n this.show = 'show';\r\n /**\r\n * Applied to the currently showing view mode during a transition\r\n * between calendar and clock views\r\n */\r\n this.collapsing = 'td-collapsing';\r\n /**\r\n * Applied to the currently hidden view mode.\r\n */\r\n this.collapse = 'td-collapse';\r\n //#endregion\r\n /**\r\n * Applied to the widget when the option display.inline is enabled.\r\n */\r\n this.inline = 'inline';\r\n /**\r\n * Applied to the widget when the option display.theme is light.\r\n */\r\n this.lightTheme = 'light';\r\n /**\r\n * Applied to the widget when the option display.theme is dark.\r\n */\r\n this.darkTheme = 'dark';\r\n /**\r\n * Used for detecting if the system color preference is dark mode\r\n */\r\n this.isDarkPreferredQuery = '(prefers-color-scheme: dark)';\r\n }\r\n }\r\n class Namespace {\r\n }\r\n Namespace.NAME = NAME;\r\n // noinspection JSUnusedGlobalSymbols\r\n Namespace.dataKey = dataKey;\r\n Namespace.events = new Events();\r\n Namespace.css = new Css();\r\n Namespace.errorMessages = new ErrorMessages();\n\n const DefaultFormatLocalization = {\r\n dateFormats: {\r\n LTS: 'h:mm:ss T',\r\n LT: 'h:mm T',\r\n L: 'MM/dd/yyyy',\r\n LL: 'MMMM d, yyyy',\r\n LLL: 'MMMM d, yyyy h:mm T',\r\n LLLL: 'dddd, MMMM d, yyyy h:mm T',\r\n },\r\n format: 'L LT',\r\n locale: 'default',\r\n hourCycle: undefined,\r\n ordinal: (n) => {\r\n const s = ['th', 'st', 'nd', 'rd'];\r\n const v = n % 100;\r\n return `[${n}${s[(v - 20) % 10] || s[v] || s[0]}]`;\r\n },\r\n };\r\n var DefaultFormatLocalization$1 = { ...DefaultFormatLocalization };\n\n var Unit;\r\n (function (Unit) {\r\n Unit[\"seconds\"] = \"seconds\";\r\n Unit[\"minutes\"] = \"minutes\";\r\n Unit[\"hours\"] = \"hours\";\r\n Unit[\"date\"] = \"date\";\r\n Unit[\"month\"] = \"month\";\r\n Unit[\"year\"] = \"year\";\r\n })(Unit || (Unit = {}));\r\n const twoDigitTemplate = {\r\n month: '2-digit',\r\n day: '2-digit',\r\n year: 'numeric',\r\n hour: '2-digit',\r\n minute: '2-digit',\r\n second: '2-digit',\r\n };\r\n /**\r\n * Returns an Intl format object based on the provided object\r\n * @param unit\r\n */\r\n const getFormatByUnit = (unit) => {\r\n switch (unit) {\r\n case 'date':\r\n return { dateStyle: 'short' };\r\n case 'month':\r\n return {\r\n month: 'numeric',\r\n year: 'numeric',\r\n };\r\n case 'year':\r\n return { year: 'numeric' };\r\n }\r\n };\r\n /**\r\n * Attempts to guess the hour cycle of the given local\r\n * @param locale\r\n */\r\n const guessHourCycle = (locale) => {\r\n if (!locale)\r\n return 'h12';\r\n // noinspection SpellCheckingInspection\r\n const template = {\r\n hour: '2-digit',\r\n minute: '2-digit',\r\n numberingSystem: 'latn',\r\n };\r\n const dt = new DateTime().setLocalization({ locale });\r\n dt.hours = 0;\r\n const start = dt.parts(undefined, template).hour;\r\n //midnight is 12 so en-US style 12 AM\r\n if (start === '12')\r\n return 'h12';\r\n //midnight is 24 is from 00-24\r\n if (start === '24')\r\n return 'h24';\r\n dt.hours = 23;\r\n const end = dt.parts(undefined, template).hour;\r\n //if midnight is 00 and hour 23 is 11 then\r\n if (start === '00' && end === '11')\r\n return 'h11';\r\n if (start === '00' && end === '23')\r\n return 'h23';\r\n console.warn(`couldn't determine hour cycle for ${locale}. start: ${start}. end: ${end}`);\r\n return undefined;\r\n };\r\n /**\r\n * For the most part this object behaves exactly the same way\r\n * as the native Date object with a little extra spice.\r\n */\r\n class DateTime extends Date {\r\n constructor() {\r\n super(...arguments);\r\n this.localization = DefaultFormatLocalization$1;\r\n this.nonLeapLadder = [\r\n 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334,\r\n ];\r\n this.leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\r\n //#region CDF stuff\r\n this.dateTimeRegex = \r\n //is regex cannot be simplified beyond what it already is\r\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\r\n this.formattingTokens = /(\\[[^[\\]]*])|([-_:/.,()\\s]+)|(T|t|yyyy|yy?|MM?M?M?|Do|dd?d?d?|hh?|HH?|mm?|ss?)/g; //NOSONAR is regex cannot be simplified beyond what it already is\r\n this.match2 = /\\d\\d/; // 00 - 99\r\n this.match3 = /\\d{3}/; // 000 - 999\r\n this.match4 = /\\d{4}/; // 0000 - 9999\r\n this.match1to2 = /\\d\\d?/; // 0 - 99\r\n this.matchSigned = /[+-]?\\d+/; // -inf - inf\r\n this.matchOffset = /[+-]\\d\\d:?(\\d\\d)?|Z/; // +00:00 -00:00 +0000 or -0000 +00 or Z\r\n this.matchWord = /[^\\d_:/,\\-()\\s]+/; // Word\r\n this.zoneExpressions = [\r\n this.matchOffset,\r\n (obj, input) => {\r\n obj.offset = this.offsetFromString(input);\r\n },\r\n ];\r\n this.expressions = {\r\n t: {\r\n pattern: undefined,\r\n parser: (obj, input) => {\r\n obj.afternoon = this.meridiemMatch(input);\r\n },\r\n },\r\n T: {\r\n pattern: undefined,\r\n parser: (obj, input) => {\r\n obj.afternoon = this.meridiemMatch(input);\r\n },\r\n },\r\n fff: {\r\n pattern: this.match3,\r\n parser: (obj, input) => {\r\n obj.milliseconds = +input;\r\n },\r\n },\r\n s: {\r\n pattern: this.match1to2,\r\n parser: this.addInput('seconds'),\r\n },\r\n ss: {\r\n pattern: this.match1to2,\r\n parser: this.addInput('seconds'),\r\n },\r\n m: {\r\n pattern: this.match1to2,\r\n parser: this.addInput('minutes'),\r\n },\r\n mm: {\r\n pattern: this.match1to2,\r\n parser: this.addInput('minutes'),\r\n },\r\n H: {\r\n pattern: this.match1to2,\r\n parser: this.addInput('hours'),\r\n },\r\n h: {\r\n pattern: this.match1to2,\r\n parser: this.addInput('hours'),\r\n },\r\n HH: {\r\n pattern: this.match1to2,\r\n parser: this.addInput('hours'),\r\n },\r\n hh: {\r\n pattern: this.match1to2,\r\n parser: this.addInput('hours'),\r\n },\r\n d: {\r\n pattern: this.match1to2,\r\n parser: this.addInput('day'),\r\n },\r\n dd: {\r\n pattern: this.match2,\r\n parser: this.addInput('day'),\r\n },\r\n Do: {\r\n pattern: this.matchWord,\r\n parser: (obj, input) => {\r\n obj.day = +(input.match(/\\d+/)[0] || 1);\r\n if (!this.localization.ordinal)\r\n return;\r\n for (let i = 1; i <= 31; i += 1) {\r\n if (this.localization.ordinal(i).replace(/[[\\]]/g, '') === input) {\r\n obj.day = i;\r\n }\r\n }\r\n },\r\n },\r\n M: {\r\n pattern: this.match1to2,\r\n parser: this.addInput('month'),\r\n },\r\n MM: {\r\n pattern: this.match2,\r\n parser: this.addInput('month'),\r\n },\r\n MMM: {\r\n pattern: this.matchWord,\r\n parser: (obj, input) => {\r\n const months = this.getAllMonths();\r\n const monthsShort = this.getAllMonths('short');\r\n const matchIndex = (monthsShort || months.map((_) => _.slice(0, 3))).indexOf(input) + 1;\r\n if (matchIndex < 1) {\r\n throw new Error();\r\n }\r\n obj.month = matchIndex % 12 || matchIndex;\r\n },\r\n },\r\n MMMM: {\r\n pattern: this.matchWord,\r\n parser: (obj, input) => {\r\n const months = this.getAllMonths();\r\n const matchIndex = months.indexOf(input) + 1;\r\n if (matchIndex < 1) {\r\n throw new Error();\r\n }\r\n obj.month = matchIndex % 12 || matchIndex;\r\n },\r\n },\r\n y: {\r\n pattern: this.matchSigned,\r\n parser: this.addInput('year'),\r\n },\r\n yy: {\r\n pattern: this.match2,\r\n parser: (obj, input) => {\r\n obj.year = this.parseTwoDigitYear(+input);\r\n },\r\n },\r\n yyyy: {\r\n pattern: this.match4,\r\n parser: this.addInput('year'),\r\n },\r\n // z: this.zoneExpressions,\r\n // zz: this.zoneExpressions,\r\n // zzz: this.zoneExpressions\r\n };\r\n //#endregion CDF stuff\r\n }\r\n /**\r\n * Chainable way to set the {@link locale}\r\n * @param value\r\n * @deprecated use setLocalization with a FormatLocalization object instead\r\n */\r\n setLocale(value) {\r\n if (!this.localization) {\r\n this.localization = DefaultFormatLocalization$1;\r\n this.localization.locale = value;\r\n }\r\n return this;\r\n }\r\n /**\r\n * Chainable way to set the {@link localization}\r\n * @param value\r\n */\r\n setLocalization(value) {\r\n this.localization = value;\r\n return this;\r\n }\r\n /**\r\n * Converts a plain JS date object to a DateTime object.\r\n * Doing this allows access to format, etc.\r\n * @param date\r\n * @param locale this parameter is deprecated. Use formatLocalization instead.\r\n * @param formatLocalization\r\n */\r\n static convert(date, locale = 'default', formatLocalization = undefined) {\r\n if (!date)\r\n throw new Error(`A date is required`);\r\n if (!formatLocalization) {\r\n formatLocalization = DefaultFormatLocalization$1;\r\n formatLocalization.locale = locale;\r\n }\r\n return new DateTime(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()).setLocalization(formatLocalization);\r\n }\r\n /**\r\n * Native date manipulations are not pure functions. This function creates a duplicate of the DateTime object.\r\n */\r\n get clone() {\r\n return new DateTime(this.year, this.month, this.date, this.hours, this.minutes, this.seconds, this.getMilliseconds()).setLocalization(this.localization);\r\n }\r\n static isValid(d) {\r\n if (d === undefined || JSON.stringify(d) === 'null')\r\n return false;\r\n if (d.constructor.name === DateTime.name)\r\n return true;\r\n return false;\r\n }\r\n /**\r\n * Sets the current date to the start of the {@link unit} provided\r\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')\r\n * would return April 1, 2021, 12:00:00.000 AM (midnight)\r\n * @param unit\r\n * @param startOfTheWeek Allows for the changing the start of the week.\r\n */\r\n startOf(unit, startOfTheWeek = 0) {\r\n if (this[unit] === undefined)\r\n throw new Error(`Unit '${unit}' is not valid`);\r\n switch (unit) {\r\n case 'seconds':\r\n this.setMilliseconds(0);\r\n break;\r\n case 'minutes':\r\n this.setSeconds(0, 0);\r\n break;\r\n case 'hours':\r\n this.setMinutes(0, 0, 0);\r\n break;\r\n case 'date':\r\n this.setHours(0, 0, 0, 0);\r\n break;\r\n case 'weekDay': {\r\n this.startOf(Unit.date);\r\n if (this.weekDay === startOfTheWeek)\r\n break;\r\n const goBack = (this.weekDay - startOfTheWeek + 7) % 7;\r\n this.manipulate(goBack * -1, Unit.date);\r\n break;\r\n }\r\n case 'month':\r\n this.startOf(Unit.date);\r\n this.setDate(1);\r\n break;\r\n case 'year':\r\n this.startOf(Unit.date);\r\n this.setMonth(0, 1);\r\n break;\r\n }\r\n return this;\r\n }\r\n /**\r\n * Sets the current date to the end of the {@link unit} provided\r\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')\r\n * would return April 30, 2021, 11:59:59.999 PM\r\n * @param unit\r\n * @param startOfTheWeek\r\n */\r\n endOf(unit, startOfTheWeek = 0) {\r\n if (this[unit] === undefined)\r\n throw new Error(`Unit '${unit}' is not valid`);\r\n switch (unit) {\r\n case 'seconds':\r\n this.setMilliseconds(999);\r\n break;\r\n case 'minutes':\r\n this.setSeconds(59, 999);\r\n break;\r\n case 'hours':\r\n this.setMinutes(59, 59, 999);\r\n break;\r\n case 'date':\r\n this.setHours(23, 59, 59, 999);\r\n break;\r\n case 'weekDay': {\r\n this.endOf(Unit.date);\r\n const endOfWeek = 6 + startOfTheWeek;\r\n if (this.weekDay === endOfWeek)\r\n break;\r\n this.manipulate(endOfWeek - this.weekDay, Unit.date);\r\n break;\r\n }\r\n case 'month':\r\n this.endOf(Unit.date);\r\n this.manipulate(1, Unit.month);\r\n this.setDate(0);\r\n break;\r\n case 'year':\r\n this.endOf(Unit.date);\r\n this.setMonth(11, 31);\r\n break;\r\n }\r\n return this;\r\n }\r\n /**\r\n * Change a {@link unit} value. Value can be positive or negative\r\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')\r\n * would return May 30, 2021, 11:45:32.984 AM\r\n * @param value A positive or negative number\r\n * @param unit\r\n */\r\n manipulate(value, unit) {\r\n if (this[unit] === undefined)\r\n throw new Error(`Unit '${unit}' is not valid`);\r\n this[unit] += value;\r\n return this;\r\n }\r\n /**\r\n * Return true if {@link compare} is before this date\r\n * @param compare The Date/DateTime to compare\r\n * @param unit If provided, uses {@link startOf} for\r\n * comparison.\r\n */\r\n isBefore(compare, unit) {\r\n // If the comparisons is undefined, return false\r\n if (!DateTime.isValid(compare))\r\n return false;\r\n if (!unit)\r\n return this.valueOf() < compare.valueOf();\r\n if (this[unit] === undefined)\r\n throw new Error(`Unit '${unit}' is not valid`);\r\n return (this.clone.startOf(unit).valueOf() < compare.clone.startOf(unit).valueOf());\r\n }\r\n /**\r\n * Return true if {@link compare} is after this date\r\n * @param compare The Date/DateTime to compare\r\n * @param unit If provided, uses {@link startOf} for\r\n * comparison.\r\n */\r\n isAfter(compare, unit) {\r\n // If the comparisons is undefined, return false\r\n if (!DateTime.isValid(compare))\r\n return false;\r\n if (!unit)\r\n return this.valueOf() > compare.valueOf();\r\n if (this[unit] === undefined)\r\n throw new Error(`Unit '${unit}' is not valid`);\r\n return (this.clone.startOf(unit).valueOf() > compare.clone.startOf(unit).valueOf());\r\n }\r\n /**\r\n * Return true if {@link compare} is same this date\r\n * @param compare The Date/DateTime to compare\r\n * @param unit If provided, uses {@link startOf} for\r\n * comparison.\r\n */\r\n isSame(compare, unit) {\r\n // If the comparisons is undefined, return false\r\n if (!DateTime.isValid(compare))\r\n return false;\r\n if (!unit)\r\n return this.valueOf() === compare.valueOf();\r\n if (this[unit] === undefined)\r\n throw new Error(`Unit '${unit}' is not valid`);\r\n compare = DateTime.convert(compare);\r\n return (this.clone.startOf(unit).valueOf() === compare.startOf(unit).valueOf());\r\n }\r\n /**\r\n * Check if this is between two other DateTimes, optionally looking at unit scale. The match is exclusive.\r\n * @param left\r\n * @param right\r\n * @param unit.\r\n * @param inclusivity. A [ indicates inclusion of a value. A ( indicates exclusion.\r\n * If the inclusivity parameter is used, both indicators must be passed.\r\n */\r\n isBetween(left, right, unit, inclusivity = '()') {\r\n // If one of the comparisons is undefined, return false\r\n if (!DateTime.isValid(left) || !DateTime.isValid(right))\r\n return false;\r\n // If a unit is provided and is not a valid property of the DateTime object, throw an error\r\n if (unit && this[unit] === undefined) {\r\n throw new Error(`Unit '${unit}' is not valid`);\r\n }\r\n const leftInclusivity = inclusivity[0] === '(';\r\n const rightInclusivity = inclusivity[1] === ')';\r\n const isLeftInRange = leftInclusivity\r\n ? this.isAfter(left, unit)\r\n : !this.isBefore(left, unit);\r\n const isRightInRange = rightInclusivity\r\n ? this.isBefore(right, unit)\r\n : !this.isAfter(right, unit);\r\n return isLeftInRange && isRightInRange;\r\n }\r\n /**\r\n * Returns flattened object of the date. Does not include literals\r\n * @param locale\r\n * @param template\r\n */\r\n parts(locale = this.localization.locale, template = { dateStyle: 'full', timeStyle: 'long' }) {\r\n const parts = {};\r\n new Intl.DateTimeFormat(locale, template)\r\n .formatToParts(this)\r\n .filter((x) => x.type !== 'literal')\r\n .forEach((x) => (parts[x.type] = x.value));\r\n return parts;\r\n }\r\n /**\r\n * Shortcut to Date.getSeconds()\r\n */\r\n get seconds() {\r\n return this.getSeconds();\r\n }\r\n /**\r\n * Shortcut to Date.setSeconds()\r\n */\r\n set seconds(value) {\r\n this.setSeconds(value);\r\n }\r\n /**\r\n * Returns two digit hours\r\n */\r\n get secondsFormatted() {\r\n return this.parts(undefined, twoDigitTemplate).second;\r\n }\r\n /**\r\n * Shortcut to Date.getMinutes()\r\n */\r\n get minutes() {\r\n return this.getMinutes();\r\n }\r\n /**\r\n * Shortcut to Date.setMinutes()\r\n */\r\n set minutes(value) {\r\n this.setMinutes(value);\r\n }\r\n /**\r\n * Returns two digit minutes\r\n */\r\n get minutesFormatted() {\r\n return this.parts(undefined, twoDigitTemplate).minute;\r\n }\r\n /**\r\n * Shortcut to Date.getHours()\r\n */\r\n get hours() {\r\n return this.getHours();\r\n }\r\n /**\r\n * Shortcut to Date.setHours()\r\n */\r\n set hours(value) {\r\n this.setHours(value);\r\n }\r\n /**\r\n * Returns two digit hour, e.g. 01...10\r\n * @param hourCycle Providing an hour cycle will change 00 to 24 depending on the given value.\r\n */\r\n getHoursFormatted(hourCycle = 'h12') {\r\n return this.parts(undefined, { ...twoDigitTemplate, hourCycle: hourCycle })\r\n .hour;\r\n }\r\n /**\r\n * Get the meridiem of the date. E.g. AM or PM.\r\n * If the {@link locale} provides a \"dayPeriod\" then this will be returned,\r\n * otherwise it will return AM or PM.\r\n * @param locale\r\n */\r\n meridiem(locale = this.localization.locale) {\r\n return new Intl.DateTimeFormat(locale, {\r\n hour: 'numeric',\r\n hour12: true,\r\n })\r\n .formatToParts(this)\r\n .find((p) => p.type === 'dayPeriod')?.value;\r\n }\r\n /**\r\n * Shortcut to Date.getDate()\r\n */\r\n get date() {\r\n return this.getDate();\r\n }\r\n /**\r\n * Shortcut to Date.setDate()\r\n */\r\n set date(value) {\r\n this.setDate(value);\r\n }\r\n /**\r\n * Return two digit date\r\n */\r\n get dateFormatted() {\r\n return this.parts(undefined, twoDigitTemplate).day;\r\n }\r\n /**\r\n * Shortcut to Date.getDay()\r\n */\r\n get weekDay() {\r\n return this.getDay();\r\n }\r\n /**\r\n * Shortcut to Date.getMonth()\r\n */\r\n get month() {\r\n return this.getMonth();\r\n }\r\n /**\r\n * Shortcut to Date.setMonth()\r\n */\r\n set month(value) {\r\n const targetMonth = new Date(this.year, value + 1);\r\n targetMonth.setDate(0);\r\n const endOfMonth = targetMonth.getDate();\r\n if (this.date > endOfMonth) {\r\n this.date = endOfMonth;\r\n }\r\n this.setMonth(value);\r\n }\r\n /**\r\n * Return two digit, human expected month. E.g. January = 1, December = 12\r\n */\r\n get monthFormatted() {\r\n return this.parts(undefined, twoDigitTemplate).month;\r\n }\r\n /**\r\n * Shortcut to Date.getFullYear()\r\n */\r\n get year() {\r\n return this.getFullYear();\r\n }\r\n /**\r\n * Shortcut to Date.setFullYear()\r\n */\r\n set year(value) {\r\n this.setFullYear(value);\r\n }\r\n // borrowed a bunch of stuff from Luxon\r\n /**\r\n * Gets the week of the year\r\n */\r\n get week() {\r\n const ordinal = this.computeOrdinal(), weekday = this.getUTCDay();\r\n let weekNumber = Math.floor((ordinal - weekday + 10) / 7);\r\n if (weekNumber < 1) {\r\n weekNumber = this.weeksInWeekYear();\r\n }\r\n else if (weekNumber > this.weeksInWeekYear()) {\r\n weekNumber = 1;\r\n }\r\n return weekNumber;\r\n }\r\n /**\r\n * Returns the number of weeks in the year\r\n */\r\n weeksInWeekYear() {\r\n const p1 = (this.year +\r\n Math.floor(this.year / 4) -\r\n Math.floor(this.year / 100) +\r\n Math.floor(this.year / 400)) %\r\n 7, last = this.year - 1, p2 = (last +\r\n Math.floor(last / 4) -\r\n Math.floor(last / 100) +\r\n Math.floor(last / 400)) %\r\n 7;\r\n return p1 === 4 || p2 === 3 ? 53 : 52;\r\n }\r\n dateToDataValue() {\r\n if (!DateTime.isValid(this))\r\n return '';\r\n return `${this.year}-${this.month.toString().padStart(2, '0')}-${this.date\r\n .toString()\r\n .padStart(2, '0')}`;\r\n }\r\n /**\r\n * Returns true or false depending on if the year is a leap year or not.\r\n */\r\n get isLeapYear() {\r\n return (this.year % 4 === 0 && (this.year % 100 !== 0 || this.year % 400 === 0));\r\n }\r\n computeOrdinal() {\r\n return (this.date +\r\n (this.isLeapYear ? this.leapLadder : this.nonLeapLadder)[this.month]);\r\n }\r\n /**\r\n * Returns a list of month values based on the current locale\r\n */\r\n getAllMonths(format = 'long') {\r\n const applyFormat = new Intl.DateTimeFormat(this.localization.locale, {\r\n month: format,\r\n }).format;\r\n return [...Array(12).keys()].map((m) => applyFormat(new Date(2021, m)));\r\n }\r\n /**\r\n * Replaces an expanded token set (e.g. LT/LTS)\r\n */\r\n replaceTokens(formatStr, formats) {\r\n /***\r\n * _ => match\r\n * a => first capture group. Anything between [ and ]\r\n * b => second capture group\r\n */\r\n return formatStr.replace(/(\\[[^[\\]]*])|(LTS?|l{1,4}|L{1,4})/g, (_, a, b) => {\r\n const B = b && b.toUpperCase();\r\n return a || formats[B] || DefaultFormatLocalization$1.dateFormats[B];\r\n });\r\n }\r\n parseTwoDigitYear(input) {\r\n return input + (input > 68 ? 1900 : 2000);\r\n }\r\n offsetFromString(input) {\r\n if (!input)\r\n return 0;\r\n if (input === 'Z')\r\n return 0;\r\n const [first, second, third] = input.match(/([+-]|\\d\\d)/g);\r\n const minutes = +second * 60 + (+third || 0);\r\n const signed = first === '+' ? -minutes : minutes;\r\n return minutes === 0 ? 0 : signed; // eslint-disable-line no-nested-ternary\r\n }\r\n /**\r\n * z = -4, zz = -04, zzz = -0400\r\n * @param date\r\n * @param style\r\n * @private\r\n */\r\n zoneInformation(date, style) {\r\n let name = date\r\n .parts(this.localization.locale, { timeZoneName: 'longOffset' })\r\n .timeZoneName.replace('GMT', '')\r\n .replace(':', '');\r\n const negative = name.includes('-');\r\n name = name.replace('-', '');\r\n if (style === 'z')\r\n name = name.substring(1, 2);\r\n else if (style === 'zz')\r\n name = name.substring(0, 2);\r\n return `${negative ? '-' : ''}${name}`;\r\n }\r\n addInput(property) {\r\n return (obj, input) => {\r\n obj[property] = +input;\r\n };\r\n }\r\n getLocaleAfternoon() {\r\n return new Intl.DateTimeFormat(this.localization.locale, {\r\n hour: 'numeric',\r\n hour12: true,\r\n })\r\n .formatToParts(new Date(2022, 3, 4, 13))\r\n .find((p) => p.type === 'dayPeriod')\r\n ?.value?.replace(/\\s+/g, ' ');\r\n }\r\n meridiemMatch(input) {\r\n return input.toLowerCase() === this.getLocaleAfternoon().toLowerCase();\r\n }\r\n correctHours(time) {\r\n const { afternoon } = time;\r\n if (afternoon !== undefined) {\r\n const { hours } = time;\r\n if (afternoon) {\r\n if (hours < 12) {\r\n time.hours += 12;\r\n }\r\n }\r\n else if (hours === 12) {\r\n time.hours = 0;\r\n }\r\n delete time.afternoon;\r\n }\r\n }\r\n makeParser(format) {\r\n format = this.replaceTokens(format, this.localization.dateFormats);\r\n const matchArray = format.match(this.formattingTokens);\r\n const { length } = matchArray;\r\n const expressionArray = [];\r\n for (let i = 0; i < length; i += 1) {\r\n const token = matchArray[i];\r\n const expression = this.expressions[token];\r\n if (expression?.parser) {\r\n expressionArray[i] = expression;\r\n }\r\n else {\r\n expressionArray[i] = token.replace(/^\\[[^[\\]]*]$/g, '');\r\n }\r\n }\r\n return (input) => {\r\n const time = {\r\n hours: 0,\r\n minutes: 0,\r\n seconds: 0,\r\n milliseconds: 0,\r\n };\r\n for (let i = 0, start = 0; i < length; i += 1) {\r\n const token = expressionArray[i];\r\n if (typeof token === 'string') {\r\n start += token.length;\r\n }\r\n else {\r\n const part = input.slice(start);\r\n let value = part;\r\n if (token.pattern) {\r\n const match = token.pattern.exec(part);\r\n value = match[0];\r\n }\r\n token.parser.call(this, time, value);\r\n input = input.replace(value, '');\r\n }\r\n }\r\n this.correctHours(time);\r\n return time;\r\n };\r\n }\r\n /**\r\n * Attempts to create a DateTime from a string.\r\n * @param input date as string\r\n * @param localization provides the date template the string is in via the format property\r\n */\r\n //eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static fromString(input, localization) {\r\n if (!localization?.format) {\r\n Namespace.errorMessages.customDateFormatError('No format was provided');\r\n }\r\n try {\r\n const dt = new DateTime();\r\n dt.setLocalization(localization);\r\n if (['x', 'X'].indexOf(localization.format) > -1)\r\n return new DateTime((localization.format === 'X' ? 1000 : 1) * +input);\r\n input = input.replace(/\\s+/g, ' ');\r\n const parser = dt.makeParser(localization.format);\r\n const { year, month, day, hours, minutes, seconds, milliseconds, zone } = parser(input);\r\n const d = day || (!year && !month ? dt.getDate() : 1);\r\n const y = year || dt.getFullYear();\r\n let M = 0;\r\n if (!(year && !month)) {\r\n M = month > 0 ? month - 1 : dt.getMonth();\r\n }\r\n if (zone) {\r\n return new DateTime(Date.UTC(y, M, d, hours, minutes, seconds, milliseconds + zone.offset * 60 * 1000));\r\n }\r\n return new DateTime(y, M, d, hours, minutes, seconds, milliseconds);\r\n }\r\n catch (e) {\r\n Namespace.errorMessages.customDateFormatError(`Unable to parse provided input: ${input}, format: ${localization.format}`);\r\n }\r\n }\r\n /**\r\n * Returns a string format.\r\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat\r\n * for valid templates and locale objects\r\n * @param template An optional object. If provided, method will use Intl., otherwise the localizations format properties\r\n * @param locale Can be a string or an array of strings. Uses browser defaults otherwise.\r\n */\r\n format(template, locale = this.localization.locale) {\r\n if (template && typeof template === 'object')\r\n return new Intl.DateTimeFormat(locale, template).format(this);\r\n const formatString = this.replaceTokens(\r\n //try template first\r\n template ||\r\n //otherwise try localization format\r\n this.localization.format ||\r\n //otherwise try date + time\r\n `${DefaultFormatLocalization$1.dateFormats.L}, ${DefaultFormatLocalization$1.dateFormats.LT}`, this.localization.dateFormats);\r\n const formatter = (template) => new Intl.DateTimeFormat(this.localization.locale, template).format(this);\r\n if (!this.localization.hourCycle)\r\n this.localization.hourCycle = guessHourCycle(this.localization.locale);\r\n //if the format asks for a twenty-four-hour string but the hour cycle is not, then make a base guess\r\n const HHCycle = this.localization.hourCycle.startsWith('h1')\r\n ? 'h24'\r\n : this.localization.hourCycle;\r\n const hhCycle = this.localization.hourCycle.startsWith('h2')\r\n ? 'h12'\r\n : this.localization.hourCycle;\r\n const matches = {\r\n y: this.year,\r\n yy: formatter({ year: '2-digit' }),\r\n yyyy: this.year,\r\n M: formatter({ month: 'numeric' }),\r\n MM: this.monthFormatted,\r\n MMM: this.getAllMonths('short')[this.getMonth()],\r\n MMMM: this.getAllMonths()[this.getMonth()],\r\n d: this.date,\r\n dd: this.dateFormatted,\r\n ddd: formatter({ weekday: 'short' }),\r\n dddd: formatter({ weekday: 'long' }),\r\n H: this.getHours(),\r\n HH: this.getHoursFormatted(HHCycle),\r\n h: this.hours > 12 ? this.hours - 12 : this.hours,\r\n hh: this.getHoursFormatted(hhCycle),\r\n t: this.meridiem(),\r\n T: this.meridiem().toUpperCase(),\r\n m: this.minutes,\r\n mm: this.minutesFormatted,\r\n s: this.seconds,\r\n ss: this.secondsFormatted,\r\n fff: this.getMilliseconds(),\r\n // z: this.zoneInformation(dateTime, 'z'), //-4\r\n // zz: this.zoneInformation(dateTime, 'zz'), //-04\r\n // zzz: this.zoneInformation(dateTime, 'zzz') //-0400\r\n };\r\n return formatString\r\n .replace(this.dateTimeRegex, (match, $1) => {\r\n return $1 || matches[match];\r\n })\r\n .replace(/\\[/g, '')\r\n .replace(/]/g, '');\r\n }\r\n }\n\n class ServiceLocator {\r\n constructor() {\r\n this.cache = new Map();\r\n }\r\n locate(identifier) {\r\n const service = this.cache.get(identifier);\r\n if (service)\r\n return service;\r\n const value = new identifier();\r\n this.cache.set(identifier, value);\r\n return value;\r\n }\r\n }\r\n const setupServiceLocator = () => {\r\n serviceLocator = new ServiceLocator();\r\n };\r\n let serviceLocator;\n\n const CalendarModes = [\r\n {\r\n name: 'calendar',\r\n className: Namespace.css.daysContainer,\r\n unit: Unit.month,\r\n step: 1,\r\n },\r\n {\r\n name: 'months',\r\n className: Namespace.css.monthsContainer,\r\n unit: Unit.year,\r\n step: 1,\r\n },\r\n {\r\n name: 'years',\r\n className: Namespace.css.yearsContainer,\r\n unit: Unit.year,\r\n step: 10,\r\n },\r\n {\r\n name: 'decades',\r\n className: Namespace.css.decadesContainer,\r\n unit: Unit.year,\r\n step: 100,\r\n },\r\n ];\n\n class OptionsStore {\r\n constructor() {\r\n this._currentCalendarViewMode = 0;\r\n this._viewDate = new DateTime();\r\n this.minimumCalendarViewMode = 0;\r\n this.currentView = 'calendar';\r\n }\r\n get currentCalendarViewMode() {\r\n return this._currentCalendarViewMode;\r\n }\r\n set currentCalendarViewMode(value) {\r\n this._currentCalendarViewMode = value;\r\n this.currentView = CalendarModes[value].name;\r\n }\r\n get viewDate() {\r\n return this._viewDate;\r\n }\r\n set viewDate(v) {\r\n this._viewDate = v;\r\n if (this.options)\r\n this.options.viewDate = v;\r\n }\r\n /**\r\n * When switching back to the calendar from the clock,\r\n * this sets currentView to the correct calendar view.\r\n */\r\n refreshCurrentView() {\r\n this.currentView = CalendarModes[this.currentCalendarViewMode].name;\r\n }\r\n get isTwelveHour() {\r\n return ['h12', 'h11'].includes(this.options.localization.hourCycle);\r\n }\r\n }\n\n /**\r\n * Main class for date validation rules based on the options provided.\r\n */\r\n class Validation {\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n }\r\n /**\r\n * Checks to see if the target date is valid based on the rules provided in the options.\r\n * Granularity can be provided to check portions of the date instead of the whole.\r\n * @param targetDate\r\n * @param granularity\r\n */\r\n isValid(targetDate, granularity) {\r\n if (!this._enabledDisabledDatesIsValid(granularity, targetDate))\r\n return false;\r\n if (granularity !== Unit.month &&\r\n granularity !== Unit.year &&\r\n this.optionsStore.options.restrictions.daysOfWeekDisabled?.length > 0 &&\r\n this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(targetDate.weekDay) !== -1)\r\n return false;\r\n if (!this._minMaxIsValid(granularity, targetDate))\r\n return false;\r\n if (granularity === Unit.hours ||\r\n granularity === Unit.minutes ||\r\n granularity === Unit.seconds) {\r\n if (!this._enabledDisabledHoursIsValid(targetDate))\r\n return false;\r\n if (this.optionsStore.options.restrictions.disabledTimeIntervals?.filter((internal) => targetDate.isBetween(internal.from, internal.to)).length !== 0)\r\n return false;\r\n }\r\n return true;\r\n }\r\n _enabledDisabledDatesIsValid(granularity, targetDate) {\r\n if (granularity !== Unit.date)\r\n return true;\r\n if (this.optionsStore.options.restrictions.disabledDates.length > 0 &&\r\n this._isInDisabledDates(targetDate)) {\r\n return false;\r\n }\r\n // noinspection RedundantIfStatementJS\r\n if (this.optionsStore.options.restrictions.enabledDates.length > 0 &&\r\n !this._isInEnabledDates(targetDate)) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n /**\r\n * Checks to see if the disabledDates option is in use and returns true (meaning invalid)\r\n * if the `testDate` is with in the array. Granularity is by date.\r\n * @param testDate\r\n * @private\r\n */\r\n _isInDisabledDates(testDate) {\r\n if (!this.optionsStore.options.restrictions.disabledDates ||\r\n this.optionsStore.options.restrictions.disabledDates.length === 0)\r\n return false;\r\n return !!this.optionsStore.options.restrictions.disabledDates.find((x) => x.isSame(testDate, Unit.date));\r\n }\r\n /**\r\n * Checks to see if the enabledDates option is in use and returns true (meaning valid)\r\n * if the `testDate` is with in the array. Granularity is by date.\r\n * @param testDate\r\n * @private\r\n */\r\n _isInEnabledDates(testDate) {\r\n if (!this.optionsStore.options.restrictions.enabledDates ||\r\n this.optionsStore.options.restrictions.enabledDates.length === 0)\r\n return true;\r\n return !!this.optionsStore.options.restrictions.enabledDates.find((x) => x.isSame(testDate, Unit.date));\r\n }\r\n _minMaxIsValid(granularity, targetDate) {\r\n if (this.optionsStore.options.restrictions.minDate &&\r\n targetDate.isBefore(this.optionsStore.options.restrictions.minDate, granularity)) {\r\n return false;\r\n }\r\n // noinspection RedundantIfStatementJS\r\n if (this.optionsStore.options.restrictions.maxDate &&\r\n targetDate.isAfter(this.optionsStore.options.restrictions.maxDate, granularity)) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n _enabledDisabledHoursIsValid(targetDate) {\r\n if (this.optionsStore.options.restrictions.disabledHours.length > 0 &&\r\n this._isInDisabledHours(targetDate)) {\r\n return false;\r\n }\r\n // noinspection RedundantIfStatementJS\r\n if (this.optionsStore.options.restrictions.enabledHours.length > 0 &&\r\n !this._isInEnabledHours(targetDate)) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n /**\r\n * Checks to see if the disabledHours option is in use and returns true (meaning invalid)\r\n * if the `testDate` is with in the array. Granularity is by hours.\r\n * @param testDate\r\n * @private\r\n */\r\n _isInDisabledHours(testDate) {\r\n if (!this.optionsStore.options.restrictions.disabledHours ||\r\n this.optionsStore.options.restrictions.disabledHours.length === 0)\r\n return false;\r\n const formattedDate = testDate.hours;\r\n return this.optionsStore.options.restrictions.disabledHours.includes(formattedDate);\r\n }\r\n /**\r\n * Checks to see if the enabledHours option is in use and returns true (meaning valid)\r\n * if the `testDate` is with in the array. Granularity is by hours.\r\n * @param testDate\r\n * @private\r\n */\r\n _isInEnabledHours(testDate) {\r\n if (!this.optionsStore.options.restrictions.enabledHours ||\r\n this.optionsStore.options.restrictions.enabledHours.length === 0)\r\n return true;\r\n const formattedDate = testDate.hours;\r\n return this.optionsStore.options.restrictions.enabledHours.includes(formattedDate);\r\n }\r\n dateRangeIsValid(dates, index, target) {\r\n // if we're not using the option, then return valid\r\n if (!this.optionsStore.options.dateRange)\r\n return true;\r\n // if we've only selected 0..1 dates, and we're not setting the end date\r\n // then return valid. We only want to validate the range if both are selected,\r\n // because the other validation on the target has already occurred.\r\n if (dates.length !== 2 && index !== 1)\r\n return true;\r\n // initialize start date\r\n const start = dates[0].clone;\r\n // check if start date is not the same as target date\r\n if (start.isSame(target, Unit.date))\r\n return true;\r\n // add one day to start; start has already been validated\r\n start.manipulate(1, Unit.date);\r\n // check each date in the range to make sure it's valid\r\n while (!start.isSame(target, Unit.date)) {\r\n const valid = this.isValid(start, Unit.date);\r\n if (!valid)\r\n return false;\r\n start.manipulate(1, Unit.date);\r\n }\r\n return true;\r\n }\r\n }\n\n class EventEmitter {\r\n constructor() {\r\n this.subscribers = [];\r\n }\r\n subscribe(callback) {\r\n this.subscribers.push(callback);\r\n return this.unsubscribe.bind(this, this.subscribers.length - 1);\r\n }\r\n unsubscribe(index) {\r\n this.subscribers.splice(index, 1);\r\n }\r\n emit(value) {\r\n this.subscribers.forEach((callback) => {\r\n callback(value);\r\n });\r\n }\r\n destroy() {\r\n this.subscribers = null;\r\n this.subscribers = [];\r\n }\r\n }\r\n class EventEmitters {\r\n constructor() {\r\n this.triggerEvent = new EventEmitter();\r\n this.viewUpdate = new EventEmitter();\r\n this.updateDisplay = new EventEmitter();\r\n this.action = new EventEmitter(); //eslint-disable-line @typescript-eslint/no-explicit-any\r\n this.updateViewDate = new EventEmitter();\r\n }\r\n destroy() {\r\n this.triggerEvent.destroy();\r\n this.viewUpdate.destroy();\r\n this.updateDisplay.destroy();\r\n this.action.destroy();\r\n this.updateViewDate.destroy();\r\n }\r\n }\n\n const defaultEnLocalization = {\r\n clear: 'Clear selection',\r\n close: 'Close the picker',\r\n dateFormats: DefaultFormatLocalization$1.dateFormats,\r\n dayViewHeaderFormat: { month: 'long', year: '2-digit' },\r\n decrementHour: 'Decrement Hour',\r\n decrementMinute: 'Decrement Minute',\r\n decrementSecond: 'Decrement Second',\r\n format: DefaultFormatLocalization$1.format,\r\n hourCycle: DefaultFormatLocalization$1.hourCycle,\r\n incrementHour: 'Increment Hour',\r\n incrementMinute: 'Increment Minute',\r\n incrementSecond: 'Increment Second',\r\n locale: DefaultFormatLocalization$1.locale,\r\n maxWeekdayLength: 0,\r\n nextCentury: 'Next Century',\r\n nextDecade: 'Next Decade',\r\n nextMonth: 'Next Month',\r\n nextYear: 'Next Year',\r\n ordinal: DefaultFormatLocalization$1.ordinal,\r\n pickHour: 'Pick Hour',\r\n pickMinute: 'Pick Minute',\r\n pickSecond: 'Pick Second',\r\n previousCentury: 'Previous Century',\r\n previousDecade: 'Previous Decade',\r\n previousMonth: 'Previous Month',\r\n previousYear: 'Previous Year',\r\n selectDate: 'Select Date',\r\n selectDecade: 'Select Decade',\r\n selectMonth: 'Select Month',\r\n selectTime: 'Select Time',\r\n selectYear: 'Select Year',\r\n startOfTheWeek: 0,\r\n today: 'Go to today',\r\n toggleMeridiem: 'Toggle Meridiem',\r\n toggleAriaLabel: 'Change date',\r\n };\r\n const DefaultOptions = {\r\n allowInputToggle: false,\r\n container: undefined,\r\n dateRange: false,\r\n debug: false,\r\n defaultDate: undefined,\r\n display: {\r\n icons: {\r\n type: 'icons',\r\n time: 'fa-solid fa-clock',\r\n date: 'fa-solid fa-calendar',\r\n up: 'fa-solid fa-arrow-up',\r\n down: 'fa-solid fa-arrow-down',\r\n previous: 'fa-solid fa-chevron-left',\r\n next: 'fa-solid fa-chevron-right',\r\n today: 'fa-solid fa-calendar-check',\r\n clear: 'fa-solid fa-trash',\r\n close: 'fa-solid fa-xmark',\r\n },\r\n sideBySide: false,\r\n calendarWeeks: false,\r\n viewMode: 'calendar',\r\n toolbarPlacement: 'bottom',\r\n keepOpen: false,\r\n buttons: {\r\n today: false,\r\n clear: false,\r\n close: false,\r\n },\r\n components: {\r\n calendar: true,\r\n date: true,\r\n month: true,\r\n year: true,\r\n decades: true,\r\n clock: true,\r\n hours: true,\r\n minutes: true,\r\n seconds: false,\r\n useTwentyfourHour: undefined,\r\n },\r\n inline: false,\r\n theme: 'auto',\r\n placement: 'bottom',\r\n keyboardNavigation: true,\r\n },\r\n keepInvalid: false,\r\n localization: defaultEnLocalization,\r\n meta: {},\r\n multipleDates: false,\r\n multipleDatesSeparator: '; ',\r\n promptTimeOnDateChange: false,\r\n promptTimeOnDateChangeTransitionDelay: 200,\r\n restrictions: {\r\n minDate: undefined,\r\n maxDate: undefined,\r\n disabledDates: [],\r\n enabledDates: [],\r\n daysOfWeekDisabled: [],\r\n disabledTimeIntervals: [],\r\n disabledHours: [],\r\n enabledHours: [],\r\n },\r\n stepping: 1,\r\n useCurrent: true,\r\n viewDate: new DateTime(),\r\n };\r\n const DefaultEnLocalization = { ...defaultEnLocalization };\n\n /**\r\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\r\n * @param d If a string will attempt creating a date from it.\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n * @private\r\n */\r\n function tryConvertToDateTime(d, localization) {\r\n if (!d)\r\n return null;\r\n if (d.constructor.name === DateTime.name)\r\n return d;\r\n if (d.constructor.name === Date.name) {\r\n return DateTime.convert(d);\r\n }\r\n if (typeof d === typeof '') {\r\n const dateTime = DateTime.fromString(d, localization);\r\n if (JSON.stringify(dateTime) === 'null') {\r\n return null;\r\n }\r\n return dateTime;\r\n }\r\n return null;\r\n }\r\n /**\r\n * Attempts to convert `d` to a DateTime object\r\n * @param d value to convert\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n */\r\n function convertToDateTime(d, optionName, localization) {\r\n if (typeof d === typeof '' && optionName !== 'input') {\r\n Namespace.errorMessages.dateString();\r\n }\r\n const converted = tryConvertToDateTime(d, localization);\r\n if (!converted) {\r\n Namespace.errorMessages.failedToParseDate(optionName, d, optionName === 'input');\r\n }\r\n return converted;\r\n }\r\n /**\r\n * Type checks that `value` is an array of Date or DateTime\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n * @param localization\r\n */\r\n function typeCheckDateArray(optionName, value, //eslint-disable-line @typescript-eslint/no-explicit-any\r\n providedType, localization = DefaultFormatLocalization$1) {\r\n if (!Array.isArray(value)) {\r\n Namespace.errorMessages.typeMismatch(optionName, providedType, 'array of DateTime or Date');\r\n }\r\n for (let i = 0; i < value.length; i++) {\r\n const d = value[i];\r\n const dateTime = convertToDateTime(d, optionName, localization);\r\n dateTime.setLocalization(localization);\r\n value[i] = dateTime;\r\n }\r\n }\r\n /**\r\n * Type checks that `value` is an array of numbers\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n */\r\n function typeCheckNumberArray(optionName, value, //eslint-disable-line @typescript-eslint/no-explicit-any\r\n providedType) {\r\n if (!Array.isArray(value) || value.some((x) => typeof x !== typeof 0)) {\r\n Namespace.errorMessages.typeMismatch(optionName, providedType, 'array of numbers');\r\n }\r\n }\n\n function mandatoryDate(key) {\r\n return ({ value, localization }) => {\r\n const dateTime = convertToDateTime(value, key, localization);\r\n if (dateTime !== undefined) {\r\n dateTime.setLocalization(localization);\r\n return dateTime;\r\n }\r\n };\r\n }\r\n function optionalDate(key) {\r\n const mandatory = mandatoryDate(key);\r\n return (args) => {\r\n if (args.value === undefined) {\r\n return args.value;\r\n }\r\n return mandatory(args);\r\n };\r\n }\r\n function numbersInRange(key, lower, upper) {\r\n return ({ value, providedType }) => {\r\n if (value === undefined) {\r\n return [];\r\n }\r\n typeCheckNumberArray(key, value, providedType);\r\n if (value.some((x) => x < lower || x > upper))\r\n Namespace.errorMessages.numbersOutOfRange(key, lower, upper);\r\n return value;\r\n };\r\n }\r\n function validHourRange(key) {\r\n return numbersInRange(key, 0, 23);\r\n }\r\n function validDateArray(key) {\r\n return ({ value, providedType, localization }) => {\r\n if (value === undefined) {\r\n return [];\r\n }\r\n typeCheckDateArray(key, value, providedType, localization);\r\n return value;\r\n };\r\n }\r\n function validKeyOption(keyOptions) {\r\n return ({ value, path }) => {\r\n if (!keyOptions.includes(value))\r\n Namespace.errorMessages.unexpectedOptionValue(path.substring(1), value, keyOptions);\r\n return value;\r\n };\r\n }\r\n const optionProcessors = Object.freeze({\r\n defaultDate: mandatoryDate('defaultDate'),\r\n viewDate: mandatoryDate('viewDate'),\r\n minDate: optionalDate('restrictions.minDate'),\r\n maxDate: optionalDate('restrictions.maxDate'),\r\n disabledHours: validHourRange('restrictions.disabledHours'),\r\n enabledHours: validHourRange('restrictions.enabledHours'),\r\n disabledDates: validDateArray('restrictions.disabledDates'),\r\n enabledDates: validDateArray('restrictions.enabledDates'),\r\n daysOfWeekDisabled: numbersInRange('restrictions.daysOfWeekDisabled', 0, 6),\r\n disabledTimeIntervals: ({ key, value, providedType, localization }) => {\r\n if (value === undefined) {\r\n return [];\r\n }\r\n if (!Array.isArray(value)) {\r\n Namespace.errorMessages.typeMismatch(key, providedType, 'array of { from: DateTime|Date, to: DateTime|Date }');\r\n }\r\n const valueObject = value; //eslint-disable-line @typescript-eslint/no-explicit-any\r\n for (let i = 0; i < valueObject.length; i++) {\r\n Object.keys(valueObject[i]).forEach((vk) => {\r\n const subOptionName = `${key}[${i}].${vk}`;\r\n const d = valueObject[i][vk];\r\n const dateTime = convertToDateTime(d, subOptionName, localization);\r\n dateTime.setLocalization(localization);\r\n valueObject[i][vk] = dateTime;\r\n });\r\n }\r\n return valueObject;\r\n },\r\n toolbarPlacement: validKeyOption(['top', 'bottom', 'default']),\r\n type: validKeyOption(['icons', 'sprites']),\r\n viewMode: validKeyOption([\r\n 'clock',\r\n 'calendar',\r\n 'months',\r\n 'years',\r\n 'decades',\r\n ]),\r\n theme: validKeyOption(['light', 'dark', 'auto']),\r\n placement: validKeyOption(['top', 'bottom']),\r\n meta: ({ value }) => value,\r\n dayViewHeaderFormat: ({ value }) => value,\r\n container: ({ value, path }) => {\r\n if (value &&\r\n !(value instanceof HTMLElement ||\r\n value instanceof Element ||\r\n value?.appendChild)) {\r\n Namespace.errorMessages.typeMismatch(path.substring(1), typeof value, 'HTMLElement');\r\n }\r\n return value;\r\n },\r\n useTwentyfourHour: ({ value, path, providedType, defaultType }) => {\r\n Namespace.errorMessages.deprecatedWarning('useTwentyfourHour', 'Please use \"options.localization.hourCycle\" instead');\r\n if (value === undefined || providedType === 'boolean')\r\n return value;\r\n Namespace.errorMessages.typeMismatch(path, providedType, defaultType);\r\n },\r\n hourCycle: validKeyOption(['h11', 'h12', 'h23', 'h24']),\r\n });\r\n const defaultProcessor = ({ value, defaultType, providedType, path, }) => {\r\n switch (defaultType) {\r\n case 'boolean':\r\n return value === 'true' || value === true;\r\n case 'number':\r\n return +value;\r\n case 'string':\r\n return value.toString();\r\n case 'object':\r\n return {};\r\n case 'function':\r\n return value;\r\n default:\r\n Namespace.errorMessages.typeMismatch(path, providedType, defaultType);\r\n }\r\n };\r\n function processKey(args) {\r\n return (optionProcessors[args.key] || defaultProcessor)(args);\r\n }\n\n class OptionConverter {\r\n static deepCopy(input) {\r\n const o = {};\r\n Object.keys(input).forEach((key) => {\r\n const inputElement = input[key];\r\n if (inputElement instanceof DateTime) {\r\n o[key] = inputElement.clone;\r\n return;\r\n }\r\n else if (inputElement instanceof Date) {\r\n o[key] = new Date(inputElement.valueOf());\r\n return;\r\n }\r\n o[key] = inputElement;\r\n if (typeof inputElement !== 'object' ||\r\n inputElement instanceof HTMLElement ||\r\n inputElement instanceof Element)\r\n return;\r\n if (!Array.isArray(inputElement)) {\r\n o[key] = OptionConverter.deepCopy(inputElement);\r\n }\r\n });\r\n return o;\r\n }\r\n /**\r\n * Finds value out of an object based on a string, period delimited, path\r\n * @param paths\r\n * @param obj\r\n */\r\n static objectPath(paths, obj) {\r\n if (paths.charAt(0) === '.')\r\n paths = paths.slice(1);\r\n if (!paths)\r\n return obj;\r\n return paths\r\n .split('.')\r\n .reduce((value, key) => OptionConverter.isValue(value) || OptionConverter.isValue(value[key])\r\n ? value[key]\r\n : undefined, obj);\r\n }\r\n /**\r\n * The spread operator caused sub keys to be missing after merging.\r\n * This is to fix that issue by using spread on the child objects first.\r\n * Also handles complex options like disabledDates\r\n * @param provided An option from new providedOptions\r\n * @param copyTo Destination object. This was added to prevent reference copies\r\n * @param localization\r\n * @param path\r\n */\r\n static spread(provided, copyTo, localization, path = '') {\r\n const defaultOptions = OptionConverter.objectPath(path, DefaultOptions);\r\n const unsupportedOptions = Object.keys(provided).filter((x) => !Object.keys(defaultOptions).includes(x));\r\n if (unsupportedOptions.length > 0) {\r\n const flattenedOptions = OptionConverter.getFlattenDefaultOptions();\r\n const errors = unsupportedOptions.map((x) => {\r\n let error = `\"${path}.${x}\" in not a known option.`;\r\n const didYouMean = flattenedOptions.find((y) => y.includes(x));\r\n if (didYouMean)\r\n error += ` Did you mean \"${didYouMean}\"?`;\r\n return error;\r\n });\r\n Namespace.errorMessages.unexpectedOptions(errors);\r\n }\r\n Object.keys(provided)\r\n .filter((key) => key !== '__proto__' && key !== 'constructor')\r\n .forEach((key) => {\r\n path += `.${key}`;\r\n if (path.charAt(0) === '.')\r\n path = path.slice(1);\r\n const defaultOptionValue = defaultOptions[key];\r\n const providedType = typeof provided[key];\r\n const defaultType = typeof defaultOptionValue;\r\n const value = provided[key];\r\n if (value === undefined || value === null) {\r\n copyTo[key] = value;\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n return;\r\n }\r\n if (typeof defaultOptionValue === 'object' &&\r\n !Array.isArray(provided[key]) &&\r\n !(defaultOptionValue instanceof Date ||\r\n OptionConverter.ignoreProperties.includes(key))) {\r\n OptionConverter.spread(provided[key], copyTo[key], localization, path);\r\n }\r\n else {\r\n copyTo[key] = OptionConverter.processKey(key, value, providedType, defaultType, path, localization);\r\n }\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n });\r\n }\r\n static processKey(key, value, //eslint-disable-line @typescript-eslint/no-explicit-any\r\n providedType, defaultType, path, localization) {\r\n return processKey({\r\n key,\r\n value,\r\n providedType,\r\n defaultType,\r\n path,\r\n localization,\r\n });\r\n }\r\n static _mergeOptions(providedOptions, mergeTo) {\r\n const newConfig = OptionConverter.deepCopy(mergeTo);\r\n //see if the options specify a locale\r\n const localization = mergeTo.localization?.locale !== 'default'\r\n ? mergeTo.localization\r\n : providedOptions?.localization || DefaultOptions.localization;\r\n OptionConverter.spread(providedOptions, newConfig, localization, '');\r\n return newConfig;\r\n }\r\n static _dataToOptions(element, options) {\r\n const eData = JSON.parse(JSON.stringify(element.dataset));\r\n if (eData?.tdTargetInput)\r\n delete eData.tdTargetInput;\r\n if (eData?.tdTargetToggle)\r\n delete eData.tdTargetToggle;\r\n if (!eData || Object.keys(eData).length === 0)\r\n return options;\r\n const dataOptions = {};\r\n // because dataset returns camelCase including the 'td' key the option\r\n // key won't align\r\n const objectToNormalized = (object) => {\r\n const lowered = {};\r\n Object.keys(object).forEach((x) => {\r\n lowered[x.toLowerCase()] = x;\r\n });\r\n return lowered;\r\n };\r\n const normalizeObject = this.normalizeObject(objectToNormalized);\r\n const optionsLower = objectToNormalized(options);\r\n Object.keys(eData)\r\n .filter((x) => x.startsWith(Namespace.dataKey))\r\n .map((x) => x.substring(2))\r\n .forEach((key) => {\r\n let keyOption = optionsLower[key.toLowerCase()];\r\n // dataset merges dashes to camelCase... yay\r\n // i.e. key = display_components_seconds\r\n if (key.includes('_')) {\r\n // [display, components, seconds]\r\n const split = key.split('_');\r\n // display\r\n keyOption = optionsLower[split[0].toLowerCase()];\r\n if (keyOption !== undefined &&\r\n options[keyOption].constructor === Object) {\r\n dataOptions[keyOption] = normalizeObject(split, 1, options[keyOption], eData[`td${key}`]);\r\n }\r\n }\r\n // or key = multipleDate\r\n else if (keyOption !== undefined) {\r\n dataOptions[keyOption] = eData[`td${key}`];\r\n }\r\n });\r\n return this._mergeOptions(dataOptions, options);\r\n }\r\n //todo clean this up\r\n static normalizeObject(objectToNormalized) {\r\n const normalizeObject = (split, index, optionSubgroup, value) => {\r\n // first round = display { ... }\r\n const normalizedOptions = objectToNormalized(optionSubgroup);\r\n const keyOption = normalizedOptions[split[index].toLowerCase()];\r\n const internalObject = {};\r\n if (keyOption === undefined)\r\n return internalObject;\r\n // if this is another object, continue down the rabbit hole\r\n if (optionSubgroup[keyOption]?.constructor === Object) {\r\n index++;\r\n internalObject[keyOption] = normalizeObject(split, index, optionSubgroup[keyOption], value);\r\n }\r\n else {\r\n internalObject[keyOption] = value;\r\n }\r\n return internalObject;\r\n };\r\n return normalizeObject;\r\n }\r\n /**\r\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\r\n * @param d If a string will attempt creating a date from it.\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n * @private\r\n */\r\n static _dateTypeCheck(d, //eslint-disable-line @typescript-eslint/no-explicit-any\r\n localization) {\r\n return tryConvertToDateTime(d, localization);\r\n }\r\n /**\r\n * Type checks that `value` is an array of Date or DateTime\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n * @param localization\r\n */\r\n static _typeCheckDateArray(optionName, value, providedType, localization) {\r\n return typeCheckDateArray(optionName, value, providedType, localization);\r\n }\r\n /**\r\n * Type checks that `value` is an array of numbers\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n */\r\n static _typeCheckNumberArray(optionName, value, providedType) {\r\n return typeCheckNumberArray(optionName, value, providedType);\r\n }\r\n /**\r\n * Attempts to convert `d` to a DateTime object\r\n * @param d value to convert\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n */\r\n static dateConversion(d, //eslint-disable-line @typescript-eslint/no-explicit-any\r\n optionName, localization) {\r\n return convertToDateTime(d, optionName, localization);\r\n }\r\n static getFlattenDefaultOptions() {\r\n if (this._flattenDefaults)\r\n return this._flattenDefaults;\r\n const deepKeys = (t, pre = []) => {\r\n if (Array.isArray(t))\r\n return [];\r\n if (Object(t) === t) {\r\n return Object.entries(t).flatMap(([k, v]) => deepKeys(v, [...pre, k]));\r\n }\r\n else {\r\n return pre.join('.');\r\n }\r\n };\r\n this._flattenDefaults = deepKeys(DefaultOptions);\r\n return this._flattenDefaults;\r\n }\r\n /**\r\n * Some options conflict like min/max date. Verify that these kinds of options\r\n * are set correctly.\r\n * @param config\r\n */\r\n static _validateConflicts(config) {\r\n if (config.display.sideBySide &&\r\n (!config.display.components.clock ||\r\n !(config.display.components.hours ||\r\n config.display.components.minutes ||\r\n config.display.components.seconds))) {\r\n Namespace.errorMessages.conflictingConfiguration('Cannot use side by side mode without the clock components');\r\n }\r\n if (config.restrictions.minDate && config.restrictions.maxDate) {\r\n if (config.restrictions.minDate.isAfter(config.restrictions.maxDate)) {\r\n Namespace.errorMessages.conflictingConfiguration('minDate is after maxDate');\r\n }\r\n if (config.restrictions.maxDate.isBefore(config.restrictions.minDate)) {\r\n Namespace.errorMessages.conflictingConfiguration('maxDate is before minDate');\r\n }\r\n }\r\n if (config.multipleDates && config.dateRange) {\r\n Namespace.errorMessages.conflictingConfiguration('Cannot uss option \"multipleDates\" with \"dateRange\"');\r\n }\r\n }\r\n }\r\n OptionConverter.ignoreProperties = [\r\n 'meta',\r\n 'dayViewHeaderFormat',\r\n 'container',\r\n 'dateForms',\r\n 'ordinal',\r\n ];\r\n OptionConverter.isValue = (a) => a != null; // everything except undefined + null\n\n class Dates {\r\n constructor() {\r\n this._dates = [];\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n }\r\n /**\r\n * Returns the array of selected dates\r\n */\r\n get picked() {\r\n return [...this._dates];\r\n }\r\n /**\r\n * Returns the last picked value.\r\n */\r\n get lastPicked() {\r\n return this._dates[this.lastPickedIndex]?.clone;\r\n }\r\n /**\r\n * Returns the length of picked dates -1 or 0 if none are selected.\r\n */\r\n get lastPickedIndex() {\r\n if (this._dates.length === 0)\r\n return 0;\r\n return this._dates.length - 1;\r\n }\r\n /**\r\n * Formats a DateTime object to a string. Used when setting the input value.\r\n * @param date\r\n */\r\n formatInput(date) {\r\n if (!date)\r\n return '';\r\n date.localization = this.optionsStore.options.localization;\r\n return date.format();\r\n }\r\n /**\r\n * parse the value into a DateTime object.\r\n * this can be overwritten to supply your own parsing.\r\n */\r\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n parseInput(value) {\r\n try {\r\n return OptionConverter.dateConversion(value, 'input', this.optionsStore.options.localization);\r\n }\r\n catch (e) {\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.error,\r\n reason: Namespace.errorMessages.failedToParseInput,\r\n format: this.optionsStore.options.localization.format,\r\n value: value,\r\n });\r\n return undefined;\r\n }\r\n }\r\n /**\r\n * Tries to convert the provided value to a DateTime object.\r\n * If value is null|undefined then clear the value of the provided index (or 0).\r\n * @param value Value to convert or null|undefined\r\n * @param index When using multidates this is the index in the array\r\n */\r\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n setFromInput(value, index) {\r\n if (!value) {\r\n this.setValue(undefined, index);\r\n return;\r\n }\r\n const converted = this.parseInput(value);\r\n if (converted) {\r\n converted.setLocalization(this.optionsStore.options.localization);\r\n this.setValue(converted, index);\r\n }\r\n }\r\n /**\r\n * Adds a new DateTime to selected dates array\r\n * @param date\r\n */\r\n add(date) {\r\n this._dates.push(date);\r\n }\r\n /**\r\n * Returns true if the `targetDate` is part of the selected dates array.\r\n * If `unit` is provided then a granularity to that unit will be used.\r\n * @param targetDate\r\n * @param unit\r\n */\r\n isPicked(targetDate, unit) {\r\n if (!DateTime.isValid(targetDate))\r\n return false;\r\n if (!unit)\r\n return this._dates.find((x) => x.isSame(targetDate)) !== undefined;\r\n const format = getFormatByUnit(unit);\r\n const innerDateFormatted = targetDate.format(format);\r\n return (this._dates\r\n .map((x) => x.format(format))\r\n .find((x) => x === innerDateFormatted) !== undefined);\r\n }\r\n /**\r\n * Returns the index at which `targetDate` is in the array.\r\n * This is used for updating or removing a date when multi-date is used\r\n * If `unit` is provided then a granularity to that unit will be used.\r\n * @param targetDate\r\n * @param unit\r\n */\r\n pickedIndex(targetDate, unit) {\r\n if (!DateTime.isValid(targetDate))\r\n return -1;\r\n if (!unit)\r\n return this._dates.map((x) => x.valueOf()).indexOf(targetDate.valueOf());\r\n const format = getFormatByUnit(unit);\r\n const innerDateFormatted = targetDate.format(format);\r\n return this._dates.map((x) => x.format(format)).indexOf(innerDateFormatted);\r\n }\r\n /**\r\n * Clears all selected dates.\r\n */\r\n clear() {\r\n this.optionsStore.unset = true;\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: undefined,\r\n oldDate: this.lastPicked,\r\n isClear: true,\r\n isValid: true,\r\n });\r\n this._dates = [];\r\n if (this.optionsStore.input)\r\n this.optionsStore.input.value = '';\r\n this._eventEmitters.updateDisplay.emit('all');\r\n }\r\n /**\r\n * Find the \"book end\" years given a `year` and a `factor`\r\n * @param factor e.g. 100 for decades\r\n * @param year e.g. 2021\r\n */\r\n static getStartEndYear(factor, year) {\r\n const step = factor / 10, startYear = Math.floor(year / factor) * factor, endYear = startYear + step * 9, focusValue = Math.floor(year / step) * step;\r\n return [startYear, endYear, focusValue];\r\n }\r\n updateInput(target) {\r\n if (!this.optionsStore.input)\r\n return;\r\n let newValue = this.formatInput(target);\r\n if (this.optionsStore.options.multipleDates ||\r\n this.optionsStore.options.dateRange) {\r\n newValue = this._dates\r\n .map((d) => this.formatInput(d))\r\n .join(this.optionsStore.options.multipleDatesSeparator);\r\n }\r\n if (this.optionsStore.input.value != newValue)\r\n this.optionsStore.input.value = newValue;\r\n }\r\n /**\r\n * Attempts to either clear or set the `target` date at `index`.\r\n * If the `target` is null then the date will be cleared.\r\n * If multi-date is being used then it will be removed from the array.\r\n * If `target` is valid and multi-date is used then if `index` is\r\n * provided the date at that index will be replaced, otherwise it is appended.\r\n * @param target\r\n * @param index\r\n */\r\n setValue(target, index) {\r\n const noIndex = typeof index === 'undefined', isClear = !target && noIndex;\r\n let oldDate = this.optionsStore.unset ? null : this._dates[index]?.clone;\r\n if (!oldDate && !this.optionsStore.unset && noIndex && isClear) {\r\n oldDate = this.lastPicked;\r\n }\r\n if (target && oldDate?.isSame(target)) {\r\n this.updateInput(target);\r\n return;\r\n }\r\n // case of calling setValue(null)\r\n if (!target) {\r\n this._setValueNull(isClear, index, oldDate);\r\n return;\r\n }\r\n index = index || 0;\r\n target = target.clone;\r\n // minute stepping is being used, force the minute to the closest value\r\n if (this.optionsStore.options.stepping !== 1) {\r\n target.minutes =\r\n Math.round(target.minutes / this.optionsStore.options.stepping) *\r\n this.optionsStore.options.stepping;\r\n target.startOf(Unit.minutes);\r\n }\r\n const onUpdate = (isValid) => {\r\n this._dates[index] = target;\r\n this._eventEmitters.updateViewDate.emit(target.clone);\r\n this.updateInput(target);\r\n this.optionsStore.unset = false;\r\n this._eventEmitters.updateDisplay.emit('all');\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: target,\r\n oldDate,\r\n isClear,\r\n isValid: isValid,\r\n });\r\n };\r\n if (this.validation.isValid(target) &&\r\n this.validation.dateRangeIsValid(this.picked, index, target)) {\r\n onUpdate(true);\r\n return;\r\n }\r\n if (this.optionsStore.options.keepInvalid) {\r\n onUpdate(false);\r\n }\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.error,\r\n reason: Namespace.errorMessages.failedToSetInvalidDate,\r\n date: target,\r\n oldDate,\r\n });\r\n }\r\n _setValueNull(isClear, index, oldDate) {\r\n if (!this.optionsStore.options.multipleDates ||\r\n this._dates.length === 1 ||\r\n isClear) {\r\n this.optionsStore.unset = true;\r\n this._dates = [];\r\n }\r\n else {\r\n this._dates.splice(index, 1);\r\n }\r\n this.updateInput();\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: undefined,\r\n oldDate,\r\n isClear,\r\n isValid: true,\r\n });\r\n this._eventEmitters.updateDisplay.emit('all');\r\n }\r\n }\n\n var ActionTypes;\r\n (function (ActionTypes) {\r\n ActionTypes[\"next\"] = \"next\";\r\n ActionTypes[\"previous\"] = \"previous\";\r\n ActionTypes[\"changeCalendarView\"] = \"changeCalendarView\";\r\n ActionTypes[\"selectMonth\"] = \"selectMonth\";\r\n ActionTypes[\"selectYear\"] = \"selectYear\";\r\n ActionTypes[\"selectDecade\"] = \"selectDecade\";\r\n ActionTypes[\"selectDay\"] = \"selectDay\";\r\n ActionTypes[\"selectHour\"] = \"selectHour\";\r\n ActionTypes[\"selectMinute\"] = \"selectMinute\";\r\n ActionTypes[\"selectSecond\"] = \"selectSecond\";\r\n ActionTypes[\"incrementHours\"] = \"incrementHours\";\r\n ActionTypes[\"incrementMinutes\"] = \"incrementMinutes\";\r\n ActionTypes[\"incrementSeconds\"] = \"incrementSeconds\";\r\n ActionTypes[\"decrementHours\"] = \"decrementHours\";\r\n ActionTypes[\"decrementMinutes\"] = \"decrementMinutes\";\r\n ActionTypes[\"decrementSeconds\"] = \"decrementSeconds\";\r\n ActionTypes[\"toggleMeridiem\"] = \"toggleMeridiem\";\r\n ActionTypes[\"togglePicker\"] = \"togglePicker\";\r\n ActionTypes[\"showClock\"] = \"showClock\";\r\n ActionTypes[\"showHours\"] = \"showHours\";\r\n ActionTypes[\"showMinutes\"] = \"showMinutes\";\r\n ActionTypes[\"showSeconds\"] = \"showSeconds\";\r\n ActionTypes[\"clear\"] = \"clear\";\r\n ActionTypes[\"close\"] = \"close\";\r\n ActionTypes[\"today\"] = \"today\";\r\n })(ActionTypes || (ActionTypes = {}));\r\n var ActionTypes$1 = ActionTypes;\n\n /**\r\n * Creates and updates the grid for `date`\r\n */\r\n class DateDisplay {\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker() {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.daysContainer);\r\n container.role = 'grid';\r\n container.append(...this._daysOfTheWeek());\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const div = document.createElement('div');\r\n div.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight);\r\n container.appendChild(div);\r\n }\r\n const { rangeHoverEvent, rangeHoverOutEvent } = this.handleMouseEvents(container);\r\n for (let i = 0; i < 42; i++) {\r\n if (i !== 0 && i % 7 === 0) {\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const div = document.createElement('div');\r\n div.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight);\r\n div.tabIndex = -1;\r\n container.appendChild(div);\r\n }\r\n }\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes$1.selectDay);\r\n div.role = 'gridcell';\r\n div.tabIndex = -1;\r\n container.appendChild(div);\r\n // if hover is supported then add the events\r\n if (matchMedia('(hover: hover)').matches &&\r\n this.optionsStore.options.dateRange) {\r\n div.addEventListener('mouseover', rangeHoverEvent);\r\n div.addEventListener('mouseout', rangeHoverOutEvent);\r\n }\r\n }\r\n return container;\r\n }\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget, paint) {\r\n const container = widget.getElementsByClassName(Namespace.css.daysContainer)[0];\r\n this._updateCalendarView(container);\r\n const innerDate = this.optionsStore.viewDate.clone\r\n .startOf(Unit.month)\r\n .startOf('weekDay', this.optionsStore.options.localization.startOfTheWeek)\r\n .manipulate(12, Unit.hours);\r\n this._handleCalendarWeeks(container, innerDate.clone);\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes$1.selectDay}\"]`)\r\n .forEach((element) => {\r\n const classes = [];\r\n classes.push(Namespace.css.day);\r\n if (innerDate.isBefore(this.optionsStore.viewDate, Unit.month)) {\r\n classes.push(Namespace.css.old);\r\n }\r\n if (innerDate.isAfter(this.optionsStore.viewDate, Unit.month)) {\r\n classes.push(Namespace.css.new);\r\n }\r\n if (!this.optionsStore.unset &&\r\n !this.optionsStore.options.dateRange &&\r\n this.dates.isPicked(innerDate, Unit.date)) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.date)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n if (innerDate.isSame(new DateTime(), Unit.date)) {\r\n classes.push(Namespace.css.today);\r\n }\r\n if (innerDate.weekDay === 0 || innerDate.weekDay === 6) {\r\n classes.push(Namespace.css.weekend);\r\n }\r\n this._handleDateRange(innerDate, classes);\r\n paint(Unit.date, innerDate, classes, element);\r\n element.classList.remove(...element.classList);\r\n element.classList.add(...classes);\r\n element.setAttribute('data-value', innerDate.dateToDataValue());\r\n element.setAttribute('data-day', `${innerDate.date}`);\r\n element.innerText = innerDate.parts(undefined, {\r\n day: 'numeric',\r\n }).day;\r\n element.ariaLabel = innerDate.format('MMMM dd, yyyy');\r\n innerDate.manipulate(1, Unit.date);\r\n });\r\n }\r\n _handleDateRange(innerDate, classes) {\r\n const rangeStart = this.dates.picked[0];\r\n const rangeEnd = this.dates.picked[1];\r\n if (this.optionsStore.options.dateRange) {\r\n if (innerDate.isBetween(rangeStart, rangeEnd, Unit.date)) {\r\n classes.push(Namespace.css.rangeIn);\r\n }\r\n if (innerDate.isSame(rangeStart, Unit.date)) {\r\n classes.push(Namespace.css.rangeStart);\r\n }\r\n if (innerDate.isSame(rangeEnd, Unit.date)) {\r\n classes.push(Namespace.css.rangeEnd);\r\n }\r\n }\r\n }\r\n handleMouseEvents(container) {\r\n const rangeHoverEvent = (e) => {\r\n const currentTarget = e?.currentTarget;\r\n // if we have 0 or 2 selected or if the target is disabled then ignore\r\n if (this.dates.picked.length !== 1 ||\r\n currentTarget.classList.contains(Namespace.css.disabled))\r\n return;\r\n // select all the date divs\r\n const allDays = [...container.querySelectorAll('.day')];\r\n // get the date value from the element being hovered over\r\n const attributeValue = currentTarget.getAttribute('data-value');\r\n // format the string to a date\r\n const innerDate = DateTime.fromString(attributeValue, {\r\n format: 'yyyy-MM-dd',\r\n });\r\n // find the position of the target in the date container\r\n const dayIndex = allDays.findIndex((e) => e.getAttribute('data-value') === attributeValue);\r\n // find the first and second selected dates\r\n const rangeStart = this.dates.picked[0];\r\n const rangeEnd = this.dates.picked[1];\r\n //format the start date so that it can be found by the attribute\r\n const rangeStartFormatted = rangeStart.dateToDataValue();\r\n const rangeStartIndex = allDays.findIndex((e) => e.getAttribute('data-value') === rangeStartFormatted);\r\n const rangeStartElement = allDays[rangeStartIndex];\r\n //make sure we don't leave start/end classes if we don't need them\r\n if (!innerDate.isSame(rangeStart, Unit.date)) {\r\n currentTarget.classList.remove(Namespace.css.rangeStart);\r\n }\r\n if (!innerDate.isSame(rangeEnd, Unit.date)) {\r\n currentTarget.classList.remove(Namespace.css.rangeEnd);\r\n }\r\n // the following figures out which direct from start date is selected\r\n // the selection \"cap\" classes are applied if needed\r\n // otherwise all the dates between will get the `rangeIn` class.\r\n // We make this selection based on the element's index and the rangeStart index\r\n let lambda;\r\n if (innerDate.isBefore(rangeStart)) {\r\n currentTarget.classList.add(Namespace.css.rangeStart);\r\n rangeStartElement?.classList.remove(Namespace.css.rangeStart);\r\n rangeStartElement?.classList.add(Namespace.css.rangeEnd);\r\n lambda = (_, index) => index > dayIndex && index < rangeStartIndex;\r\n }\r\n else {\r\n currentTarget.classList.add(Namespace.css.rangeEnd);\r\n rangeStartElement?.classList.remove(Namespace.css.rangeEnd);\r\n rangeStartElement?.classList.add(Namespace.css.rangeStart);\r\n lambda = (_, index) => index < dayIndex && index > rangeStartIndex;\r\n }\r\n allDays.filter(lambda).forEach((e) => {\r\n e.classList.add(Namespace.css.rangeIn);\r\n });\r\n };\r\n const rangeHoverOutEvent = (e) => {\r\n // find all the dates in the container\r\n const allDays = [...container.querySelectorAll('.day')];\r\n // if only the start is selected, remove all the rangeIn classes\r\n // we do this because once the user hovers over a new date the range will be recalculated.\r\n if (this.dates.picked.length === 1)\r\n allDays.forEach((e) => e.classList.remove(Namespace.css.rangeIn));\r\n // if we have 0 or 2 dates selected then ignore\r\n if (this.dates.picked.length !== 1)\r\n return;\r\n const currentTarget = e?.currentTarget;\r\n // get the elements date from the attribute value\r\n const innerDate = new DateTime(currentTarget.getAttribute('data-value'));\r\n // verify selections and remove invalid classes\r\n if (!innerDate.isSame(this.dates.picked[0], Unit.date)) {\r\n currentTarget.classList.remove(Namespace.css.rangeStart);\r\n }\r\n if (!innerDate.isSame(this.dates.picked[1], Unit.date)) {\r\n currentTarget.classList.remove(Namespace.css.rangeEnd);\r\n }\r\n };\r\n return { rangeHoverEvent, rangeHoverOutEvent };\r\n }\r\n _updateCalendarView(container) {\r\n if (this.optionsStore.currentView !== 'calendar')\r\n return;\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName('div');\r\n switcher.setAttribute(Namespace.css.daysContainer, this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat));\r\n this.optionsStore.options.display.components.month\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1, Unit.month), Unit.month)\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1, Unit.month), Unit.month)\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n /***\r\n * Generates a html row that contains the days of the week.\r\n * @private\r\n */\r\n _daysOfTheWeek() {\r\n const innerDate = this.optionsStore.viewDate.clone\r\n .startOf('weekDay', this.optionsStore.options.localization.startOfTheWeek)\r\n .startOf(Unit.date);\r\n const row = [];\r\n document.createElement('div');\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const htmlDivElement = document.createElement('div');\r\n htmlDivElement.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight);\r\n htmlDivElement.innerText = '#';\r\n row.push(htmlDivElement);\r\n }\r\n for (let i = 0; i < 7; i++) {\r\n const htmlDivElement = document.createElement('div');\r\n htmlDivElement.classList.add(Namespace.css.dayOfTheWeek, Namespace.css.noHighlight);\r\n let weekDay = innerDate.format({ weekday: 'short' });\r\n if (this.optionsStore.options.localization.maxWeekdayLength > 0)\r\n weekDay = weekDay.substring(0, this.optionsStore.options.localization.maxWeekdayLength);\r\n htmlDivElement.innerText = weekDay;\r\n htmlDivElement.ariaLabel = innerDate.format({ weekday: 'long' });\r\n innerDate.manipulate(1, Unit.date);\r\n row.push(htmlDivElement);\r\n }\r\n return row;\r\n }\r\n _handleCalendarWeeks(container, innerDate) {\r\n [...container.querySelectorAll(`.${Namespace.css.calendarWeeks}`)]\r\n .filter((e) => e.innerText !== '#')\r\n .forEach((element) => {\r\n element.innerText = `${innerDate.week}`;\r\n innerDate.manipulate(7, Unit.date);\r\n });\r\n }\r\n }\n\n /**\r\n * Creates and updates the grid for `month`\r\n */\r\n class MonthDisplay {\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker() {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.monthsContainer);\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement('div');\r\n div.tabIndex = -1;\r\n div.setAttribute('data-action', ActionTypes$1.selectMonth);\r\n container.appendChild(div);\r\n }\r\n return container;\r\n }\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget, paint) {\r\n const container = widget.getElementsByClassName(Namespace.css.monthsContainer)[0];\r\n if (this.optionsStore.currentView === 'months') {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName('div');\r\n switcher.setAttribute(Namespace.css.monthsContainer, this.optionsStore.viewDate.format({ year: 'numeric' }));\r\n this.optionsStore.options.display.components.year\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1, Unit.year), Unit.year)\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1, Unit.year), Unit.year)\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes$1.selectMonth}\"]`)\r\n .forEach((containerClone, index) => {\r\n const classes = [];\r\n classes.push(Namespace.css.month);\r\n if (!this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.month)) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.month)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n paint(Unit.month, innerDate, classes, containerClone);\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${index}`);\r\n containerClone.innerText = `${innerDate.format({ month: 'short' })}`;\r\n innerDate.manipulate(1, Unit.month);\r\n });\r\n }\r\n }\n\n /**\r\n * Creates and updates the grid for `year`\r\n */\r\n class YearDisplay {\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker() {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.yearsContainer);\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement('div');\r\n div.tabIndex = -1;\r\n div.setAttribute('data-action', ActionTypes$1.selectYear);\r\n container.appendChild(div);\r\n }\r\n return container;\r\n }\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget, paint) {\r\n this._startYear = this.optionsStore.viewDate.clone.manipulate(-1, Unit.year);\r\n this._endYear = this.optionsStore.viewDate.clone.manipulate(10, Unit.year);\r\n const container = widget.getElementsByClassName(Namespace.css.yearsContainer)[0];\r\n if (this.optionsStore.currentView === 'years') {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName('div');\r\n switcher.setAttribute(Namespace.css.yearsContainer, `${this._startYear.format({ year: 'numeric' })}-${this._endYear.format({\r\n year: 'numeric',\r\n })}`);\r\n this.optionsStore.options.display.components.decades\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this._startYear, Unit.year)\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this._endYear, Unit.year)\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n const innerDate = this.optionsStore.viewDate.clone\r\n .startOf(Unit.year)\r\n .manipulate(-1, Unit.year);\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes$1.selectYear}\"]`)\r\n .forEach((containerClone) => {\r\n const classes = [];\r\n classes.push(Namespace.css.year);\r\n if (!this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.year)) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.year)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n paint(Unit.year, innerDate, classes, containerClone);\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${innerDate.year}`);\r\n containerClone.innerText = innerDate.format({ year: 'numeric' });\r\n innerDate.manipulate(1, Unit.year);\r\n });\r\n }\r\n }\n\n /**\r\n * Creates and updates the grid for `seconds`\r\n */\r\n class DecadeDisplay {\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker() {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.decadesContainer);\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement('div');\r\n div.tabIndex = -1;\r\n div.setAttribute('data-action', ActionTypes$1.selectDecade);\r\n container.appendChild(div);\r\n }\r\n return container;\r\n }\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget, paint) {\r\n const [start, end] = Dates.getStartEndYear(100, this.optionsStore.viewDate.year);\r\n this._startDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n this._startDecade.year = start;\r\n this._endDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n this._endDecade.year = end;\r\n const container = widget.getElementsByClassName(Namespace.css.decadesContainer)[0];\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName('div');\r\n const isPreviousEnabled = this.validation.isValid(this._startDecade, Unit.year);\r\n if (this.optionsStore.currentView === 'decades') {\r\n switcher.setAttribute(Namespace.css.decadesContainer, `${this._startDecade.format({\r\n year: 'numeric',\r\n })}-${this._endDecade.format({ year: 'numeric' })}`);\r\n isPreviousEnabled\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this._endDecade, Unit.year)\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n const pickedYears = this.dates.picked.map((x) => x.year);\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes$1.selectDecade}\"]`)\r\n .forEach((containerClone, index) => {\r\n if (index === 0) {\r\n containerClone.classList.add(Namespace.css.old);\r\n if (this._startDecade.year - 10 < 0) {\r\n containerClone.textContent = ' ';\r\n previous.classList.add(Namespace.css.disabled);\r\n containerClone.classList.add(Namespace.css.disabled);\r\n containerClone.setAttribute('data-value', '');\r\n }\r\n return;\r\n }\r\n const classes = [];\r\n classes.push(Namespace.css.decade);\r\n const startDecadeYear = this._startDecade.year;\r\n const endDecadeYear = this._startDecade.year + 9;\r\n if (!this.optionsStore.unset &&\r\n pickedYears.filter((x) => x >= startDecadeYear && x <= endDecadeYear)\r\n .length > 0) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!isPreviousEnabled &&\r\n !this.validation.isValid(this._startDecade.clone.manipulate(10, Unit.year), Unit.year)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n paint('decade', this._startDecade, classes, containerClone);\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${this._startDecade.year}`);\r\n containerClone.innerText = `${this._startDecade.format({\r\n year: 'numeric',\r\n })}`;\r\n this._startDecade.manipulate(10, Unit.year);\r\n });\r\n }\r\n }\n\n /**\r\n * Creates the clock display\r\n */\r\n class TimeDisplay {\r\n constructor() {\r\n this._gridColumns = '';\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the clock display\r\n * @private\r\n */\r\n getPicker(iconTag) {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.clockContainer);\r\n container.append(...this._grid(iconTag));\r\n return container;\r\n }\r\n /**\r\n * Populates the various elements with in the clock display\r\n * like the current hour and if the manipulation icons are enabled.\r\n * @private\r\n */\r\n _update(widget) {\r\n const timesDiv = (widget.getElementsByClassName(Namespace.css.clockContainer)[0]);\r\n let lastPicked = this.dates.lastPicked?.clone;\r\n if (!lastPicked && this.optionsStore.options.useCurrent)\r\n lastPicked = this.optionsStore.viewDate.clone;\r\n timesDiv\r\n .querySelectorAll('.disabled')\r\n .forEach((element) => element.classList.remove(Namespace.css.disabled));\r\n if (this.optionsStore.options.display.components.hours) {\r\n if (!this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1, Unit.hours), Unit.hours)) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes$1.incrementHours}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n if (!this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1, Unit.hours), Unit.hours)) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes$1.decrementHours}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(`[data-time-component=${Unit.hours}]`).innerText = lastPicked\r\n ? lastPicked.getHoursFormatted(this.optionsStore.options.localization.hourCycle)\r\n : '--';\r\n }\r\n if (this.optionsStore.options.display.components.minutes) {\r\n if (!this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1, Unit.minutes), Unit.minutes)) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes$1.incrementMinutes}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n if (!this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1, Unit.minutes), Unit.minutes)) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes$1.decrementMinutes}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(`[data-time-component=${Unit.minutes}]`).innerText = lastPicked ? lastPicked.minutesFormatted : '--';\r\n }\r\n if (this.optionsStore.options.display.components.seconds) {\r\n if (!this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1, Unit.seconds), Unit.seconds)) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes$1.incrementSeconds}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n if (!this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1, Unit.seconds), Unit.seconds)) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes$1.decrementSeconds}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(`[data-time-component=${Unit.seconds}]`).innerText = lastPicked ? lastPicked.secondsFormatted : '--';\r\n }\r\n if (this.optionsStore.isTwelveHour) {\r\n const toggle = timesDiv.querySelector(`[data-action=${ActionTypes$1.toggleMeridiem}]`);\r\n const meridiemDate = (lastPicked || this.optionsStore.viewDate).clone;\r\n toggle.innerText = meridiemDate.meridiem();\r\n if (!this.validation.isValid(meridiemDate.manipulate(meridiemDate.hours >= 12 ? -12 : 12, Unit.hours))) {\r\n toggle.classList.add(Namespace.css.disabled);\r\n }\r\n else {\r\n toggle.classList.remove(Namespace.css.disabled);\r\n }\r\n }\r\n timesDiv.style.gridTemplateAreas = `\"${this._gridColumns}\"`;\r\n }\r\n /**\r\n * Creates the table for the clock display depending on what options are selected.\r\n * @private\r\n */\r\n _grid(iconTag) {\r\n this._gridColumns = '';\r\n const top = [], middle = [], bottom = [], separator = document.createElement('div'), upIcon = iconTag(this.optionsStore.options.display.icons.up), downIcon = iconTag(this.optionsStore.options.display.icons.down);\r\n separator.classList.add(Namespace.css.separator, Namespace.css.noHighlight);\r\n const separatorColon = separator.cloneNode(true);\r\n separatorColon.innerHTML = ':';\r\n const getSeparator = (colon = false) => {\r\n return colon\r\n ? separatorColon.cloneNode(true)\r\n : separator.cloneNode(true);\r\n };\r\n if (this.optionsStore.options.display.components.hours) {\r\n let divElement = document.createElement('div');\r\n divElement.tabIndex = -1;\r\n divElement.setAttribute('title', this.optionsStore.options.localization.incrementHour);\r\n divElement.setAttribute('data-action', ActionTypes$1.incrementHours);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n divElement = document.createElement('div');\r\n divElement.tabIndex = -1;\r\n divElement.setAttribute('title', this.optionsStore.options.localization.pickHour);\r\n divElement.setAttribute('data-action', ActionTypes$1.showHours);\r\n divElement.setAttribute('data-time-component', Unit.hours);\r\n middle.push(divElement);\r\n divElement = document.createElement('div');\r\n divElement.tabIndex = -1;\r\n divElement.setAttribute('title', this.optionsStore.options.localization.decrementHour);\r\n divElement.setAttribute('data-action', ActionTypes$1.decrementHours);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n this._gridColumns += 'a';\r\n }\r\n if (this.optionsStore.options.display.components.minutes) {\r\n this._gridColumns += ' a';\r\n if (this.optionsStore.options.display.components.hours) {\r\n top.push(getSeparator());\r\n middle.push(getSeparator(true));\r\n bottom.push(getSeparator());\r\n this._gridColumns += ' a';\r\n }\r\n let divElement = document.createElement('div');\r\n divElement.tabIndex = -1;\r\n divElement.setAttribute('title', this.optionsStore.options.localization.incrementMinute);\r\n divElement.setAttribute('data-action', ActionTypes$1.incrementMinutes);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n divElement = document.createElement('div');\r\n divElement.tabIndex = -1;\r\n divElement.setAttribute('title', this.optionsStore.options.localization.pickMinute);\r\n divElement.setAttribute('data-action', ActionTypes$1.showMinutes);\r\n divElement.setAttribute('data-time-component', Unit.minutes);\r\n middle.push(divElement);\r\n divElement = document.createElement('div');\r\n divElement.tabIndex = -1;\r\n divElement.setAttribute('title', this.optionsStore.options.localization.decrementMinute);\r\n divElement.setAttribute('data-action', ActionTypes$1.decrementMinutes);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n }\r\n if (this.optionsStore.options.display.components.seconds) {\r\n this._gridColumns += ' a';\r\n if (this.optionsStore.options.display.components.minutes) {\r\n top.push(getSeparator());\r\n middle.push(getSeparator(true));\r\n bottom.push(getSeparator());\r\n this._gridColumns += ' a';\r\n }\r\n let divElement = document.createElement('div');\r\n divElement.tabIndex = -1;\r\n divElement.setAttribute('title', this.optionsStore.options.localization.incrementSecond);\r\n divElement.setAttribute('data-action', ActionTypes$1.incrementSeconds);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n divElement = document.createElement('div');\r\n divElement.tabIndex = -1;\r\n divElement.setAttribute('title', this.optionsStore.options.localization.pickSecond);\r\n divElement.setAttribute('data-action', ActionTypes$1.showSeconds);\r\n divElement.setAttribute('data-time-component', Unit.seconds);\r\n middle.push(divElement);\r\n divElement = document.createElement('div');\r\n divElement.tabIndex = -1;\r\n divElement.setAttribute('title', this.optionsStore.options.localization.decrementSecond);\r\n divElement.setAttribute('data-action', ActionTypes$1.decrementSeconds);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n }\r\n if (this.optionsStore.isTwelveHour) {\r\n this._gridColumns += ' a';\r\n let divElement = getSeparator();\r\n top.push(divElement);\r\n const button = document.createElement('button');\r\n button.tabIndex = -1;\r\n button.setAttribute('type', 'button');\r\n button.setAttribute('title', this.optionsStore.options.localization.toggleMeridiem);\r\n button.setAttribute('data-action', ActionTypes$1.toggleMeridiem);\r\n button.setAttribute('tabindex', '-1');\r\n if (Namespace.css.toggleMeridiem.includes(',')) {\r\n //todo move this to paint function?\r\n button.classList.add(...Namespace.css.toggleMeridiem.split(','));\r\n }\r\n else\r\n button.classList.add(Namespace.css.toggleMeridiem);\r\n divElement = document.createElement('div');\r\n divElement.classList.add(Namespace.css.noHighlight);\r\n divElement.appendChild(button);\r\n middle.push(divElement);\r\n divElement = getSeparator();\r\n bottom.push(divElement);\r\n }\r\n this._gridColumns = this._gridColumns.trim();\r\n return [...top, ...middle, ...bottom];\r\n }\r\n }\n\n /**\r\n * Creates and updates the grid for `hours`\r\n */\r\n class HourDisplay {\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n this.dates = serviceLocator.locate(Dates);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker() {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.hourContainer);\r\n for (let i = 0; i < (this.optionsStore.isTwelveHour ? 12 : 24); i++) {\r\n const div = document.createElement('div');\r\n div.tabIndex = -1;\r\n div.setAttribute('data-action', ActionTypes$1.selectHour);\r\n container.appendChild(div);\r\n }\r\n return container;\r\n }\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget, paint) {\r\n const container = widget.getElementsByClassName(Namespace.css.hourContainer)[0];\r\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.date);\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes$1.selectHour}\"]`)\r\n .forEach((containerClone) => {\r\n const classes = [];\r\n classes.push(Namespace.css.hour);\r\n if (!this.validation.isValid(innerDate, Unit.hours)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n paint(Unit.hours, innerDate, classes, containerClone);\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${innerDate.hours}`);\r\n containerClone.innerText = innerDate.getHoursFormatted(this.optionsStore.options.localization.hourCycle);\r\n innerDate.manipulate(1, Unit.hours);\r\n });\r\n }\r\n }\n\n /**\r\n * Creates and updates the grid for `minutes`\r\n */\r\n class MinuteDisplay {\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker() {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.minuteContainer);\r\n const step = this.optionsStore.options.stepping === 1\r\n ? 5\r\n : this.optionsStore.options.stepping;\r\n for (let i = 0; i < 60 / step; i++) {\r\n const div = document.createElement('div');\r\n div.tabIndex = -1;\r\n div.setAttribute('data-action', ActionTypes$1.selectMinute);\r\n container.appendChild(div);\r\n }\r\n return container;\r\n }\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget, paint) {\r\n const container = widget.getElementsByClassName(Namespace.css.minuteContainer)[0];\r\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.hours);\r\n const step = this.optionsStore.options.stepping === 1\r\n ? 5\r\n : this.optionsStore.options.stepping;\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes$1.selectMinute}\"]`)\r\n .forEach((containerClone) => {\r\n const classes = [];\r\n classes.push(Namespace.css.minute);\r\n if (!this.validation.isValid(innerDate, Unit.minutes)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n paint(Unit.minutes, innerDate, classes, containerClone);\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${innerDate.minutes}`);\r\n containerClone.innerText = innerDate.minutesFormatted;\r\n innerDate.manipulate(step, Unit.minutes);\r\n });\r\n }\r\n }\n\n /**\r\n * Creates and updates the grid for `seconds`\r\n */\r\n class secondDisplay {\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker() {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.secondContainer);\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes$1.selectSecond);\r\n div.tabIndex = -1;\r\n container.appendChild(div);\r\n }\r\n return container;\r\n }\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget, paint) {\r\n const container = widget.getElementsByClassName(Namespace.css.secondContainer)[0];\r\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.minutes);\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes$1.selectSecond}\"]`)\r\n .forEach((containerClone) => {\r\n const classes = [];\r\n classes.push(Namespace.css.second);\r\n if (!this.validation.isValid(innerDate, Unit.seconds)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n paint(Unit.seconds, innerDate, classes, containerClone);\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${innerDate.seconds}`);\r\n containerClone.innerText = innerDate.secondsFormatted;\r\n innerDate.manipulate(5, Unit.seconds);\r\n });\r\n }\r\n }\n\n /**\r\n * Provides a collapse functionality to the view changes\r\n */\r\n class Collapse {\r\n /**\r\n * Flips the show/hide state of `target`\r\n * @param target html element to affect.\r\n */\r\n static toggle(target) {\r\n if (target.classList.contains(Namespace.css.show)) {\r\n this.hide(target);\r\n }\r\n else {\r\n this.show(target);\r\n }\r\n }\r\n /**\r\n * Skips any animation or timeouts and immediately set the element to show.\r\n * @param target\r\n */\r\n static showImmediately(target) {\r\n target.classList.remove(Namespace.css.collapsing);\r\n target.classList.add(Namespace.css.collapse, Namespace.css.show);\r\n target.style.height = '';\r\n }\r\n /**\r\n * If `target` is not already showing, then show after the animation.\r\n * @param target\r\n */\r\n static show(target) {\r\n if (target.classList.contains(Namespace.css.collapsing) ||\r\n target.classList.contains(Namespace.css.show))\r\n return;\r\n const complete = () => {\r\n Collapse.showImmediately(target);\r\n };\r\n target.style.height = '0';\r\n target.classList.remove(Namespace.css.collapse);\r\n target.classList.add(Namespace.css.collapsing);\r\n //eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n setTimeout(complete, this.getTransitionDurationFromElement(target));\r\n target.style.height = `${target.scrollHeight}px`;\r\n }\r\n /**\r\n * Skips any animation or timeouts and immediately set the element to hide.\r\n * @param target\r\n */\r\n static hideImmediately(target) {\r\n if (!target)\r\n return;\r\n target.classList.remove(Namespace.css.collapsing, Namespace.css.show);\r\n target.classList.add(Namespace.css.collapse);\r\n }\r\n /**\r\n * If `target` is not already hidden, then hide after the animation.\r\n * @param target HTML Element\r\n */\r\n static hide(target) {\r\n if (target.classList.contains(Namespace.css.collapsing) ||\r\n !target.classList.contains(Namespace.css.show))\r\n return;\r\n const complete = () => {\r\n Collapse.hideImmediately(target);\r\n };\r\n target.style.height = `${target.getBoundingClientRect()['height']}px`;\r\n const reflow = (element) => element.offsetHeight;\r\n reflow(target);\r\n target.classList.remove(Namespace.css.collapse, Namespace.css.show);\r\n target.classList.add(Namespace.css.collapsing);\r\n target.style.height = '';\r\n //eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n setTimeout(complete, this.getTransitionDurationFromElement(target));\r\n }\r\n }\r\n /**\r\n * Gets the transition duration from the `element` by getting css properties\r\n * `transition-duration` and `transition-delay`\r\n * @param element HTML Element\r\n */\r\n Collapse.getTransitionDurationFromElement = (element) => {\r\n if (!element) {\r\n return 0;\r\n }\r\n // Get transition-duration of the element\r\n let { transitionDuration, transitionDelay } = window.getComputedStyle(element);\r\n const floatTransitionDuration = Number.parseFloat(transitionDuration);\r\n const floatTransitionDelay = Number.parseFloat(transitionDelay);\r\n // Return 0 if element or transition duration is not found\r\n if (!floatTransitionDuration && !floatTransitionDelay) {\r\n return 0;\r\n }\r\n // If multiple durations are defined, take the first\r\n transitionDuration = transitionDuration.split(',')[0];\r\n transitionDelay = transitionDelay.split(',')[0];\r\n return ((Number.parseFloat(transitionDuration) +\r\n Number.parseFloat(transitionDelay)) *\r\n 1000);\r\n };\n\n /**\r\n * Main class for all things display related.\r\n */\r\n class Display {\r\n constructor() {\r\n this._isVisible = false;\r\n this._keyboardEventBound = this._keyboardEvent.bind(this);\r\n /**\r\n * A document click event to hide the widget if click is outside\r\n * @private\r\n * @param e MouseEvent\r\n */\r\n this._documentClickEvent = (e) => {\r\n if (this.optionsStore.options.debug || window.debug)\r\n return; //eslint-disable-line @typescript-eslint/no-explicit-any\r\n if (this._isVisible &&\r\n !e.composedPath().includes(this.widget) && // click inside the widget\r\n !e.composedPath()?.includes(this.optionsStore.element) // click on the element\r\n ) {\r\n this.hide();\r\n }\r\n };\r\n /**\r\n * Click event for any action like selecting a date\r\n * @param e MouseEvent\r\n * @private\r\n */\r\n this._actionsClickEvent = (e) => {\r\n this._eventEmitters.action.emit({ e: e });\r\n };\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.dateDisplay = serviceLocator.locate(DateDisplay);\r\n this.monthDisplay = serviceLocator.locate(MonthDisplay);\r\n this.yearDisplay = serviceLocator.locate(YearDisplay);\r\n this.decadeDisplay = serviceLocator.locate(DecadeDisplay);\r\n this.timeDisplay = serviceLocator.locate(TimeDisplay);\r\n this.hourDisplay = serviceLocator.locate(HourDisplay);\r\n this.minuteDisplay = serviceLocator.locate(MinuteDisplay);\r\n this.secondDisplay = serviceLocator.locate(secondDisplay);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n this._widget = undefined;\r\n this._eventEmitters.updateDisplay.subscribe((result) => {\r\n this._update(result);\r\n });\r\n }\r\n /**\r\n * Returns the widget body or undefined\r\n * @private\r\n */\r\n get widget() {\r\n return this._widget;\r\n }\r\n get dateContainer() {\r\n return this.widget?.querySelector(`div.${Namespace.css.dateContainer}`);\r\n }\r\n get timeContainer() {\r\n return this.widget?.querySelector(`div.${Namespace.css.timeContainer}`);\r\n }\r\n /**\r\n * Returns this visible state of the picker (shown)\r\n */\r\n get isVisible() {\r\n return this._isVisible;\r\n }\r\n /**\r\n * Updates the table for a particular unit. Used when an option as changed or\r\n * whenever the class list might need to be refreshed.\r\n * @param unit\r\n * @private\r\n */\r\n _update(unit) {\r\n if (!this.widget)\r\n return;\r\n switch (unit) {\r\n case Unit.seconds:\r\n this.secondDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.minutes:\r\n this.minuteDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.hours:\r\n this.hourDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.date:\r\n this.dateDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.month:\r\n this.monthDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.year:\r\n this.yearDisplay._update(this.widget, this.paint);\r\n break;\r\n case 'decade':\r\n this.decadeDisplay._update(this.widget, this.paint);\r\n break;\r\n case 'clock':\r\n if (!this._hasTime)\r\n break;\r\n this.timeDisplay._update(this.widget);\r\n this._update(Unit.hours);\r\n this._update(Unit.minutes);\r\n this._update(Unit.seconds);\r\n break;\r\n case 'calendar':\r\n this._update(Unit.date);\r\n this._update(Unit.year);\r\n this._update(Unit.month);\r\n this.decadeDisplay._update(this.widget, this.paint);\r\n this._updateCalendarHeader();\r\n break;\r\n case 'all':\r\n if (this._hasTime) {\r\n this._update('clock');\r\n }\r\n if (this._hasDate) {\r\n this._update('calendar');\r\n }\r\n }\r\n }\r\n // noinspection JSUnusedLocalSymbols\r\n /**\r\n * Allows developers to add/remove classes from an element.\r\n * @param _unit\r\n * @param _date\r\n * @param _classes\r\n * @param _element\r\n */\r\n /* eslint-disable @typescript-eslint/no-unused-vars */\r\n paint(_unit, _date, _classes, _element) {\r\n // implemented in plugin\r\n }\r\n /**\r\n * Shows the picker and creates a Popper instance if needed.\r\n * Add document click event to hide when clicking outside the picker.\r\n * fires Events#show\r\n */\r\n show() {\r\n if (this.widget == undefined) {\r\n this._showSetDefaultIfNeeded();\r\n this._buildWidget();\r\n this._updateTheme();\r\n this._showSetupViewMode();\r\n if (!this.optionsStore.options.display.inline) {\r\n // If needed to change the parent container\r\n const container = this.optionsStore.options?.container || document.body;\r\n const placement = this.optionsStore.options?.display?.placement || 'bottom';\r\n container.appendChild(this.widget);\r\n this.createPopup(this.optionsStore.element, this.widget, {\r\n modifiers: [{ name: 'eventListeners', enabled: true }],\r\n //#2400\r\n placement: document.documentElement.dir === 'rtl'\r\n ? `${placement}-end`\r\n : `${placement}-start`,\r\n }).then(() => {\r\n this._handleFocus();\r\n });\r\n }\r\n else {\r\n this.optionsStore.element.appendChild(this.widget);\r\n }\r\n if (this.optionsStore.options.display.viewMode == 'clock') {\r\n this._eventEmitters.action.emit({\r\n e: null,\r\n action: ActionTypes$1.showClock,\r\n });\r\n }\r\n this.widget\r\n .querySelectorAll('[data-action]')\r\n .forEach((element) => element.addEventListener('click', this._actionsClickEvent));\r\n // show the clock when using sideBySide\r\n if (this._hasTime && this.optionsStore.options.display.sideBySide) {\r\n this.timeDisplay._update(this.widget);\r\n this.widget.getElementsByClassName(Namespace.css.clockContainer)[0].style.display = 'grid';\r\n }\r\n }\r\n this.widget.classList.add(Namespace.css.show);\r\n if (!this.optionsStore.options.display.inline) {\r\n this.updatePopup();\r\n document.addEventListener('click', this._documentClickEvent);\r\n }\r\n this._eventEmitters.triggerEvent.emit({ type: Namespace.events.show });\r\n this._isVisible = true;\r\n if (this.optionsStore.options.display.keyboardNavigation) {\r\n this.widget.addEventListener('keydown', this._keyboardEventBound);\r\n }\r\n }\r\n _showSetupViewMode() {\r\n // If modeView is only clock\r\n const onlyClock = this._hasTime && !this._hasDate;\r\n // reset the view to the clock if there's no date components\r\n if (onlyClock) {\r\n this.optionsStore.currentView = 'clock';\r\n this._eventEmitters.action.emit({\r\n e: null,\r\n action: ActionTypes$1.showClock,\r\n });\r\n }\r\n // otherwise return to the calendar view\r\n else if (!this.optionsStore.currentCalendarViewMode) {\r\n this.optionsStore.currentCalendarViewMode =\r\n this.optionsStore.minimumCalendarViewMode;\r\n }\r\n if (!onlyClock && this.optionsStore.options.display.viewMode !== 'clock') {\r\n if (this._hasTime) {\r\n if (!this.optionsStore.options.display.sideBySide) {\r\n Collapse.hideImmediately(this.timeContainer);\r\n }\r\n else {\r\n Collapse.show(this.timeContainer);\r\n }\r\n }\r\n Collapse.show(this.dateContainer);\r\n }\r\n if (this._hasDate) {\r\n this._showMode();\r\n }\r\n }\r\n _showSetDefaultIfNeeded() {\r\n if (this.dates.picked.length != 0)\r\n return;\r\n if (this.optionsStore.options.useCurrent &&\r\n !this.optionsStore.options.defaultDate) {\r\n const date = new DateTime().setLocalization(this.optionsStore.options.localization);\r\n if (!this.optionsStore.options.keepInvalid) {\r\n let tries = 0;\r\n let direction = 1;\r\n if (this.optionsStore.options.restrictions.maxDate?.isBefore(date)) {\r\n direction = -1;\r\n }\r\n while (!this.validation.isValid(date) && tries > 31) {\r\n date.manipulate(direction, Unit.date);\r\n tries++;\r\n }\r\n }\r\n this.dates.setValue(date);\r\n }\r\n if (this.optionsStore.options.defaultDate) {\r\n this.dates.setValue(this.optionsStore.options.defaultDate);\r\n }\r\n }\r\n async createPopup(element, widget, \r\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n options) {\r\n let createPopperFunction;\r\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n if (window?.Popper) {\r\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n createPopperFunction = window?.Popper?.createPopper;\r\n }\r\n else {\r\n const { createPopper } = await import('@popperjs/core');\r\n createPopperFunction = createPopper;\r\n }\r\n if (createPopperFunction) {\r\n this._popperInstance = createPopperFunction(element, widget, options);\r\n }\r\n }\r\n updatePopup() {\r\n if (!this._popperInstance)\r\n return;\r\n this._popperInstance.update();\r\n this._handleFocus();\r\n }\r\n /**\r\n * Changes the calendar view mode. E.g. month <-> year\r\n * @param direction -/+ number to move currentViewMode\r\n * @private\r\n */\r\n _showMode(direction) {\r\n if (!this.widget) {\r\n return;\r\n }\r\n if (direction) {\r\n const max = Math.max(this.optionsStore.minimumCalendarViewMode, Math.min(3, this.optionsStore.currentCalendarViewMode + direction));\r\n if (this.optionsStore.currentCalendarViewMode == max)\r\n return;\r\n this.optionsStore.currentCalendarViewMode = max;\r\n }\r\n this.widget\r\n .querySelectorAll(`.${Namespace.css.dateContainer} > div:not(.${Namespace.css.calendarHeader}), .${Namespace.css.timeContainer} > div:not(.${Namespace.css.clockContainer})`)\r\n .forEach((e) => (e.style.display = 'none'));\r\n const datePickerMode = CalendarModes[this.optionsStore.currentCalendarViewMode];\r\n const picker = this.widget.querySelector(`.${datePickerMode.className}`);\r\n switch (datePickerMode.className) {\r\n case Namespace.css.decadesContainer:\r\n this.decadeDisplay._update(this.widget, this.paint);\r\n break;\r\n case Namespace.css.yearsContainer:\r\n this.yearDisplay._update(this.widget, this.paint);\r\n break;\r\n case Namespace.css.monthsContainer:\r\n this.monthDisplay._update(this.widget, this.paint);\r\n break;\r\n case Namespace.css.daysContainer:\r\n this.dateDisplay._update(this.widget, this.paint);\r\n break;\r\n }\r\n picker.style.display = 'grid';\r\n if (this.optionsStore.options.display.sideBySide)\r\n (this.widget.querySelectorAll(`.${Namespace.css.clockContainer}`)[0]).style.display = 'grid';\r\n this._updateCalendarHeader();\r\n this._eventEmitters.viewUpdate.emit();\r\n this.findViewDateElement()?.focus();\r\n }\r\n /**\r\n * Changes the theme. E.g. light, dark or auto\r\n * @param theme the theme name\r\n * @private\r\n */\r\n _updateTheme(theme) {\r\n if (!this.widget) {\r\n return;\r\n }\r\n if (theme) {\r\n if (this.optionsStore.options.display.theme === theme)\r\n return;\r\n this.optionsStore.options.display.theme = theme;\r\n }\r\n this.widget.classList.remove('light', 'dark');\r\n this.widget.classList.add(this._getThemeClass());\r\n if (this.optionsStore.options.display.theme === 'auto') {\r\n window\r\n .matchMedia(Namespace.css.isDarkPreferredQuery)\r\n .addEventListener('change', () => this._updateTheme());\r\n }\r\n else {\r\n window\r\n .matchMedia(Namespace.css.isDarkPreferredQuery)\r\n .removeEventListener('change', () => this._updateTheme());\r\n }\r\n }\r\n _getThemeClass() {\r\n const currentTheme = this.optionsStore.options.display.theme || 'auto';\r\n const isDarkMode = window.matchMedia &&\r\n window.matchMedia(Namespace.css.isDarkPreferredQuery).matches;\r\n switch (currentTheme) {\r\n case 'light':\r\n return Namespace.css.lightTheme;\r\n case 'dark':\r\n return Namespace.css.darkTheme;\r\n case 'auto':\r\n return isDarkMode ? Namespace.css.darkTheme : Namespace.css.lightTheme;\r\n }\r\n }\r\n _updateCalendarHeader() {\r\n if (!this._hasDate)\r\n return;\r\n const showing = [\r\n ...this.widget.querySelector(`.${Namespace.css.dateContainer} div[style*=\"display: grid\"]`).classList,\r\n ].find((x) => x.startsWith(Namespace.css.dateContainer));\r\n const [previous, switcher, next] = this.widget\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName('div');\r\n switch (showing) {\r\n case Namespace.css.decadesContainer:\r\n previous.setAttribute('title', this.optionsStore.options.localization.previousCentury);\r\n switcher.setAttribute('title', '');\r\n next.setAttribute('title', this.optionsStore.options.localization.nextCentury);\r\n break;\r\n case Namespace.css.yearsContainer:\r\n previous.setAttribute('title', this.optionsStore.options.localization.previousDecade);\r\n switcher.setAttribute('title', this.optionsStore.options.localization.selectDecade);\r\n next.setAttribute('title', this.optionsStore.options.localization.nextDecade);\r\n break;\r\n case Namespace.css.monthsContainer:\r\n previous.setAttribute('title', this.optionsStore.options.localization.previousYear);\r\n switcher.setAttribute('title', this.optionsStore.options.localization.selectYear);\r\n next.setAttribute('title', this.optionsStore.options.localization.nextYear);\r\n break;\r\n case Namespace.css.daysContainer:\r\n previous.setAttribute('title', this.optionsStore.options.localization.previousMonth);\r\n switcher.setAttribute('title', this.optionsStore.options.localization.selectMonth);\r\n next.setAttribute('title', this.optionsStore.options.localization.nextMonth);\r\n switcher.setAttribute(showing, this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat));\r\n break;\r\n }\r\n switcher.innerText = switcher.getAttribute(showing);\r\n }\r\n /**\r\n * Hides the picker if needed.\r\n * Remove document click event to hide when clicking outside the picker.\r\n * fires Events#hide\r\n */\r\n hide() {\r\n if (!this.widget || !this._isVisible)\r\n return;\r\n this.widget.classList.remove(Namespace.css.show);\r\n if (this._isVisible) {\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.hide,\r\n date: this.optionsStore.unset ? null : this.dates.lastPicked?.clone,\r\n });\r\n this._isVisible = false;\r\n }\r\n document.removeEventListener('click', this._documentClickEvent);\r\n if (this.optionsStore.options.display.keyboardNavigation) {\r\n this.widget.removeEventListener('keydown', this._keyboardEventBound);\r\n }\r\n this.optionsStore.toggle.focus();\r\n }\r\n /**\r\n * Toggles the picker's open state. Fires a show/hide event depending.\r\n */\r\n toggle() {\r\n return this._isVisible ? this.hide() : this.show();\r\n }\r\n /**\r\n * Removes document and data-action click listener and reset the widget\r\n * @private\r\n */\r\n _dispose() {\r\n document.removeEventListener('click', this._documentClickEvent);\r\n if (!this.widget)\r\n return;\r\n this.widget\r\n .querySelectorAll('[data-action]')\r\n .forEach((element) => element.removeEventListener('click', this._actionsClickEvent));\r\n this.widget.parentNode.removeChild(this.widget);\r\n this._widget = undefined;\r\n }\r\n /**\r\n * Builds the widgets html template.\r\n * @private\r\n */\r\n _buildWidget() {\r\n const template = document.createElement('div');\r\n template.tabIndex = -1;\r\n template.classList.add(Namespace.css.widget);\r\n template.setAttribute('role', 'widget');\r\n const dateView = document.createElement('div');\r\n dateView.tabIndex = -1;\r\n dateView.classList.add(Namespace.css.dateContainer);\r\n dateView.append(this.getHeadTemplate(), this.decadeDisplay.getPicker(), this.yearDisplay.getPicker(), this.monthDisplay.getPicker(), this.dateDisplay.getPicker());\r\n const timeView = document.createElement('div');\r\n timeView.tabIndex = -1;\r\n timeView.classList.add(Namespace.css.timeContainer);\r\n timeView.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this)));\r\n timeView.appendChild(this.hourDisplay.getPicker());\r\n timeView.appendChild(this.minuteDisplay.getPicker());\r\n timeView.appendChild(this.secondDisplay.getPicker());\r\n const toolbar = document.createElement('div');\r\n toolbar.tabIndex = -1;\r\n toolbar.classList.add(Namespace.css.toolbar);\r\n toolbar.append(...this.getToolbarElements());\r\n if (this.optionsStore.options.display.inline) {\r\n template.classList.add(Namespace.css.inline);\r\n }\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n template.classList.add('calendarWeeks');\r\n }\r\n if (this.optionsStore.options.display.sideBySide && this._hasDateAndTime) {\r\n this._buildWidgetSideBySide(template, dateView, timeView, toolbar);\r\n return;\r\n }\r\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\r\n template.appendChild(toolbar);\r\n }\r\n const setupComponentView = (hasFirst, hasSecond, element, shouldShow) => {\r\n if (!hasFirst)\r\n return;\r\n if (hasSecond) {\r\n element.classList.add(Namespace.css.collapse);\r\n if (shouldShow)\r\n element.classList.add(Namespace.css.show);\r\n }\r\n template.appendChild(element);\r\n };\r\n setupComponentView(this._hasDate, this._hasTime, dateView, this.optionsStore.options.display.viewMode !== 'clock');\r\n setupComponentView(this._hasTime, this._hasDate, timeView, this.optionsStore.options.display.viewMode === 'clock');\r\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\r\n template.appendChild(toolbar);\r\n }\r\n const arrow = document.createElement('div');\r\n arrow.classList.add('arrow');\r\n arrow.setAttribute('data-popper-arrow', '');\r\n template.appendChild(arrow);\r\n this._widget = template;\r\n }\r\n _buildWidgetSideBySide(template, dateView, timeView, toolbar) {\r\n template.classList.add(Namespace.css.sideBySide);\r\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\r\n template.appendChild(toolbar);\r\n }\r\n const row = document.createElement('div');\r\n row.classList.add('td-row');\r\n dateView.classList.add('td-half');\r\n timeView.classList.add('td-half');\r\n row.appendChild(dateView);\r\n row.appendChild(timeView);\r\n template.appendChild(row);\r\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\r\n template.appendChild(toolbar);\r\n }\r\n this._widget = template;\r\n }\r\n /**\r\n * Returns true if the hours, minutes, or seconds component is turned on\r\n */\r\n get _hasTime() {\r\n return (this.optionsStore.options.display.components.clock &&\r\n (this.optionsStore.options.display.components.hours ||\r\n this.optionsStore.options.display.components.minutes ||\r\n this.optionsStore.options.display.components.seconds));\r\n }\r\n /**\r\n * Returns true if the year, month, or date component is turned on\r\n */\r\n get _hasDate() {\r\n return (this.optionsStore.options.display.components.calendar &&\r\n (this.optionsStore.options.display.components.year ||\r\n this.optionsStore.options.display.components.month ||\r\n this.optionsStore.options.display.components.date));\r\n }\r\n get _hasDateAndTime() {\r\n return this._hasDate && this._hasTime;\r\n }\r\n /**\r\n * Get the toolbar html based on options like buttons => today\r\n * @private\r\n */\r\n getToolbarElements() {\r\n const toolbar = [];\r\n if (this.optionsStore.options.display.buttons.today) {\r\n const div = document.createElement('div');\r\n div.tabIndex = -1;\r\n div.setAttribute('data-action', ActionTypes$1.today);\r\n div.setAttribute('title', this.optionsStore.options.localization.today);\r\n div.appendChild(this._iconTag(this.optionsStore.options.display.icons.today));\r\n toolbar.push(div);\r\n }\r\n if (!this.optionsStore.options.display.sideBySide &&\r\n this._hasDate &&\r\n this._hasTime) {\r\n let title, icon;\r\n if (this.optionsStore.options.display.viewMode === 'clock') {\r\n title = this.optionsStore.options.localization.selectDate;\r\n icon = this.optionsStore.options.display.icons.date;\r\n }\r\n else {\r\n title = this.optionsStore.options.localization.selectTime;\r\n icon = this.optionsStore.options.display.icons.time;\r\n }\r\n const div = document.createElement('div');\r\n div.tabIndex = -1;\r\n div.setAttribute('data-action', ActionTypes$1.togglePicker);\r\n div.setAttribute('title', title);\r\n div.appendChild(this._iconTag(icon));\r\n toolbar.push(div);\r\n }\r\n if (this.optionsStore.options.display.buttons.clear) {\r\n const div = document.createElement('div');\r\n div.tabIndex = -1;\r\n div.setAttribute('data-action', ActionTypes$1.clear);\r\n div.setAttribute('title', this.optionsStore.options.localization.clear);\r\n div.appendChild(this._iconTag(this.optionsStore.options.display.icons.clear));\r\n toolbar.push(div);\r\n }\r\n if (this.optionsStore.options.display.buttons.close) {\r\n const div = document.createElement('div');\r\n div.tabIndex = -1;\r\n div.setAttribute('data-action', ActionTypes$1.close);\r\n div.setAttribute('title', this.optionsStore.options.localization.close);\r\n div.appendChild(this._iconTag(this.optionsStore.options.display.icons.close));\r\n toolbar.push(div);\r\n }\r\n return toolbar;\r\n }\r\n /***\r\n * Builds the base header template with next and previous icons\r\n * @private\r\n */\r\n getHeadTemplate() {\r\n const calendarHeader = document.createElement('div');\r\n calendarHeader.classList.add(Namespace.css.calendarHeader);\r\n const previous = document.createElement('div');\r\n previous.classList.add(Namespace.css.previous);\r\n previous.setAttribute('data-action', ActionTypes$1.previous);\r\n previous.appendChild(this._iconTag(this.optionsStore.options.display.icons[document.documentElement.dir === 'rtl' ? 'next' : 'previous']) //***\r\n );\r\n previous.tabIndex = -1;\r\n const switcher = document.createElement('div');\r\n switcher.classList.add(Namespace.css.switch);\r\n switcher.setAttribute('data-action', ActionTypes$1.changeCalendarView);\r\n switcher.tabIndex = -1;\r\n const next = document.createElement('div');\r\n next.classList.add(Namespace.css.next);\r\n next.setAttribute('data-action', ActionTypes$1.next);\r\n next.appendChild(this._iconTag(this.optionsStore.options.display.icons[document.documentElement.dir === 'rtl' ? 'previous' : 'next']) //***\r\n );\r\n next.tabIndex = -1;\r\n calendarHeader.append(previous, switcher, next);\r\n return calendarHeader;\r\n }\r\n /**\r\n * Builds an icon tag as either an ``\r\n * or with icons => type is `sprites` then a svg tag instead\r\n * @param iconClass\r\n * @private\r\n */\r\n _iconTag(iconClass) {\r\n if (this.optionsStore.options.display.icons.type === 'sprites') {\r\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\r\n const icon = document.createElementNS('http://www.w3.org/2000/svg', 'use');\r\n icon.setAttribute('xlink:href', iconClass); // Deprecated. Included for backward compatibility\r\n icon.setAttribute('href', iconClass);\r\n svg.appendChild(icon);\r\n return svg;\r\n }\r\n const icon = document.createElement('i');\r\n icon.classList.add(...iconClass.split(' '));\r\n return icon;\r\n }\r\n /**\r\n * Causes the widget to get rebuilt on next show. If the picker is already open\r\n * then hide and reshow it.\r\n * @private\r\n */\r\n _rebuild() {\r\n const wasVisible = this._isVisible;\r\n this._dispose();\r\n if (wasVisible)\r\n this.show();\r\n }\r\n refreshCurrentView() {\r\n //if the widget is not showing, just destroy it\r\n if (!this._isVisible)\r\n this._dispose();\r\n switch (this.optionsStore.currentView) {\r\n case 'clock':\r\n this._update('clock');\r\n break;\r\n case 'calendar':\r\n this._update(Unit.date);\r\n break;\r\n case 'months':\r\n this._update(Unit.month);\r\n break;\r\n case 'years':\r\n this._update(Unit.year);\r\n break;\r\n case 'decades':\r\n this._update('decade');\r\n break;\r\n }\r\n }\r\n _keyboardEvent(event) {\r\n if (this.optionsStore.currentView === 'clock') {\r\n this._handleKeyDownClock(event);\r\n return;\r\n }\r\n this._handleKeyDownDate(event);\r\n return false;\r\n }\r\n findViewDateElement() {\r\n let selector = '';\r\n let dataValue = '';\r\n switch (this.optionsStore.currentView) {\r\n case 'clock':\r\n break;\r\n case 'calendar':\r\n selector = Namespace.css.daysContainer;\r\n dataValue = this.optionsStore.viewDate.dateToDataValue();\r\n break;\r\n case 'months':\r\n selector = Namespace.css.monthsContainer;\r\n dataValue = this.optionsStore.viewDate.month.toString();\r\n break;\r\n case 'years':\r\n selector = Namespace.css.yearsContainer;\r\n dataValue = this.optionsStore.viewDate.year.toString();\r\n break;\r\n case 'decades':\r\n selector = Namespace.css.decadesContainer;\r\n dataValue = (Math.floor(this.optionsStore.viewDate.year / 10) * 10).toString();\r\n break;\r\n }\r\n return this.widget.querySelector(`.${selector} > div[data-value=\"${dataValue}\"]`);\r\n }\r\n _handleKeyDownDate(event) {\r\n let flag = false;\r\n const activeElement = document.activeElement;\r\n let unit = null;\r\n let verticalChange = 7;\r\n let horizontalChange = 1;\r\n let change = 1;\r\n const currentView = this.optionsStore.currentView;\r\n switch (currentView) {\r\n case 'calendar':\r\n unit = Unit.date;\r\n break;\r\n case 'months':\r\n unit = Unit.month;\r\n verticalChange = 3;\r\n horizontalChange = 1;\r\n break;\r\n case 'years':\r\n unit = Unit.year;\r\n verticalChange = 3;\r\n horizontalChange = 1;\r\n break;\r\n case 'decades':\r\n unit = Unit.year;\r\n verticalChange = 30;\r\n horizontalChange = 10;\r\n break;\r\n }\r\n switch (event.key) {\r\n case 'Esc':\r\n case 'Escape':\r\n this._eventEmitters.action.emit({ e: null, action: ActionTypes$1.close });\r\n break;\r\n case ' ':\r\n case 'Enter':\r\n activeElement.click();\r\n event.stopPropagation();\r\n event.preventDefault();\r\n return;\r\n case 'Tab':\r\n this._handleTab(activeElement, event);\r\n return;\r\n case 'Right':\r\n case 'ArrowRight':\r\n change = horizontalChange;\r\n flag = true;\r\n break;\r\n case 'Left':\r\n case 'ArrowLeft':\r\n flag = true;\r\n change = -horizontalChange;\r\n break;\r\n case 'Down':\r\n case 'ArrowDown':\r\n flag = true;\r\n change = verticalChange;\r\n break;\r\n case 'Up':\r\n case 'ArrowUp':\r\n flag = true;\r\n change = -verticalChange;\r\n break;\r\n case 'PageDown':\r\n switch (currentView) {\r\n case 'calendar':\r\n unit = event.shiftKey ? Unit.year : Unit.month;\r\n change = 1;\r\n break;\r\n case 'months':\r\n unit = Unit.year;\r\n change = event.shiftKey ? 10 : 1;\r\n break;\r\n case 'years':\r\n case 'decades':\r\n unit = Unit.year;\r\n change = event.shiftKey ? 100 : 10;\r\n break;\r\n }\r\n flag = true;\r\n break;\r\n case 'PageUp':\r\n switch (currentView) {\r\n case 'calendar':\r\n unit = event.shiftKey ? Unit.year : Unit.month;\r\n change = -1;\r\n break;\r\n case 'months':\r\n unit = Unit.year;\r\n change = -(event.shiftKey ? 10 : 1);\r\n break;\r\n case 'years':\r\n case 'decades':\r\n unit = Unit.year;\r\n change = -(event.shiftKey ? 100 : 10);\r\n break;\r\n }\r\n flag = true;\r\n break;\r\n case 'Home':\r\n this.optionsStore.viewDate = this.optionsStore.viewDate.clone.startOf('weekDay', this.optionsStore.options.localization.startOfTheWeek);\r\n flag = true;\r\n unit = null;\r\n break;\r\n case 'End':\r\n this.optionsStore.viewDate = this.optionsStore.viewDate.clone.endOf('weekDay', this.optionsStore.options.localization.startOfTheWeek);\r\n flag = true;\r\n unit = null;\r\n break;\r\n }\r\n if (!flag)\r\n return;\r\n let newViewDate = this.optionsStore.viewDate;\r\n if (unit) {\r\n newViewDate = newViewDate.clone.manipulate(change, unit);\r\n }\r\n this._eventEmitters.updateViewDate.emit(newViewDate);\r\n const divWithValue = this.findViewDateElement();\r\n if (divWithValue) {\r\n divWithValue.focus();\r\n }\r\n event.stopPropagation();\r\n event.preventDefault();\r\n }\r\n _handleKeyDownClock(event) {\r\n let flag = false;\r\n const activeElement = document.activeElement;\r\n // Should find which of hour, minute, or seconds sub-windows is open\r\n const visibleElement = this.widget.querySelector(`.${Namespace.css.timeContainer} > div[style*=\"display: grid\"]`);\r\n let subView = Namespace.css.clockContainer;\r\n if (visibleElement.classList.contains(Namespace.css.hourContainer)) {\r\n subView = Namespace.css.hourContainer;\r\n }\r\n if (visibleElement.classList.contains(Namespace.css.minuteContainer)) {\r\n subView = Namespace.css.minuteContainer;\r\n }\r\n if (visibleElement.classList.contains(Namespace.css.secondContainer)) {\r\n subView = Namespace.css.secondContainer;\r\n }\r\n switch (event.key) {\r\n case 'Esc':\r\n case 'Escape':\r\n this._eventEmitters.action.emit({ e: null, action: ActionTypes$1.close });\r\n break;\r\n case ' ':\r\n case 'Enter':\r\n activeElement.click();\r\n event.stopPropagation();\r\n event.preventDefault();\r\n return;\r\n case 'Tab':\r\n this._handleTab(activeElement, event);\r\n return;\r\n }\r\n if (subView === Namespace.css.clockContainer)\r\n return;\r\n const cells = [...visibleElement.querySelectorAll('div')];\r\n const currentIndex = cells.indexOf(document.activeElement);\r\n const columnCount = 4;\r\n let targetIndex;\r\n switch (event.key) {\r\n case 'Right':\r\n case 'ArrowRight':\r\n targetIndex = currentIndex < cells.length - 1 ? currentIndex + 1 : null;\r\n flag = true;\r\n break;\r\n case 'Left':\r\n case 'ArrowLeft':\r\n flag = true;\r\n targetIndex = currentIndex > 0 ? currentIndex - 1 : null;\r\n break;\r\n case 'Down':\r\n case 'ArrowDown':\r\n targetIndex =\r\n currentIndex + columnCount < cells.length\r\n ? currentIndex + columnCount\r\n : null;\r\n flag = true;\r\n break;\r\n case 'Up':\r\n case 'ArrowUp':\r\n targetIndex =\r\n currentIndex - columnCount >= 0 ? currentIndex - columnCount : null;\r\n flag = true;\r\n break;\r\n }\r\n if (!flag)\r\n return;\r\n if (targetIndex !== undefined && targetIndex !== null) {\r\n cells[targetIndex].focus();\r\n }\r\n event.stopPropagation();\r\n event.preventDefault();\r\n }\r\n _handleTab(activeElement, event) {\r\n const shiftKey = event.shiftKey;\r\n // gather tab targets\r\n const addCalendarHeaderTargets = () => {\r\n const calendarHeaderItems = this.widget.querySelectorAll(`.${Namespace.css.calendarHeader} > div`);\r\n tabTargets.push(...calendarHeaderItems);\r\n };\r\n const tabTargets = [];\r\n switch (this.optionsStore.currentView) {\r\n case 'clock':\r\n {\r\n tabTargets.push(...this.widget.querySelectorAll(`.${Namespace.css.timeContainer} > div[style*=\"display: grid\"] > div[data-action]`));\r\n const clock = this.widget.querySelectorAll(`.${Namespace.css.clockContainer}`)[0];\r\n // add meridiem if it's in view\r\n if (clock?.style.display === 'grid') {\r\n tabTargets.push(...this.widget.querySelectorAll(`.${Namespace.css.toggleMeridiem}`));\r\n }\r\n }\r\n break;\r\n case 'calendar':\r\n case 'months':\r\n case 'years':\r\n case 'decades':\r\n addCalendarHeaderTargets();\r\n tabTargets.push(this.findViewDateElement());\r\n break;\r\n }\r\n const toolbarItems = this.widget.querySelectorAll(`.${Namespace.css.toolbar} > div`);\r\n tabTargets.push(...toolbarItems);\r\n const index = tabTargets.indexOf(activeElement);\r\n if (index === -1)\r\n return;\r\n if (shiftKey) {\r\n if (index === 0) {\r\n tabTargets[tabTargets.length - 1].focus();\r\n }\r\n else {\r\n tabTargets[index - 1].focus();\r\n }\r\n }\r\n else {\r\n if (index === tabTargets.length - 1) {\r\n tabTargets[0].focus();\r\n }\r\n else {\r\n tabTargets[index + 1].focus();\r\n }\r\n }\r\n event.stopPropagation();\r\n event.preventDefault();\r\n }\r\n _handleFocus() {\r\n if (this.optionsStore.currentView === 'clock')\r\n this._handleFocusClock();\r\n else\r\n this.findViewDateElement().focus();\r\n }\r\n _handleFocusClock() {\r\n this.widget.querySelector(`.${Namespace.css.timeContainer} > div[style*=\"display: grid\"]`).children[0].focus();\r\n }\r\n }\n\n /**\r\n * Logic for various click actions\r\n */\r\n class Actions {\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n this.display = serviceLocator.locate(Display);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n this._eventEmitters.action.subscribe((result) => {\r\n this.do(result.e, result.action);\r\n });\r\n }\r\n /**\r\n * Performs the selected `action`. See ActionTypes\r\n * @param e This is normally a click event\r\n * @param action If not provided, then look for a [data-action]\r\n */\r\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n do(e, action) {\r\n const currentTarget = e?.currentTarget;\r\n if (currentTarget?.classList?.contains(Namespace.css.disabled))\r\n return;\r\n action = action || currentTarget?.dataset?.action;\r\n const lastPicked = (this.dates.lastPicked || this.optionsStore.viewDate)\r\n .clone;\r\n switch (action) {\r\n case ActionTypes$1.next:\r\n case ActionTypes$1.previous:\r\n this.handleNextPrevious(action);\r\n break;\r\n case ActionTypes$1.changeCalendarView:\r\n this.display._showMode(1);\r\n this.display._updateCalendarHeader();\r\n break;\r\n case ActionTypes$1.selectMonth:\r\n case ActionTypes$1.selectYear:\r\n case ActionTypes$1.selectDecade:\r\n this.handleSelectCalendarMode(action, currentTarget);\r\n break;\r\n case ActionTypes$1.selectDay:\r\n this.handleSelectDay(currentTarget);\r\n break;\r\n case ActionTypes$1.selectHour: {\r\n let hour = +currentTarget.dataset.value;\r\n if (lastPicked.hours >= 12 && this.optionsStore.isTwelveHour)\r\n hour += 12;\r\n lastPicked.hours = hour;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n }\r\n case ActionTypes$1.selectMinute: {\r\n lastPicked.minutes = +currentTarget.dataset.value;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n }\r\n case ActionTypes$1.selectSecond: {\r\n lastPicked.seconds = +currentTarget.dataset.value;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n }\r\n case ActionTypes$1.incrementHours:\r\n this.manipulateAndSet(lastPicked, Unit.hours);\r\n break;\r\n case ActionTypes$1.incrementMinutes:\r\n this.manipulateAndSet(lastPicked, Unit.minutes, this.optionsStore.options.stepping);\r\n break;\r\n case ActionTypes$1.incrementSeconds:\r\n this.manipulateAndSet(lastPicked, Unit.seconds);\r\n break;\r\n case ActionTypes$1.decrementHours:\r\n this.manipulateAndSet(lastPicked, Unit.hours, -1);\r\n break;\r\n case ActionTypes$1.decrementMinutes:\r\n this.manipulateAndSet(lastPicked, Unit.minutes, this.optionsStore.options.stepping * -1);\r\n break;\r\n case ActionTypes$1.decrementSeconds:\r\n this.manipulateAndSet(lastPicked, Unit.seconds, -1);\r\n break;\r\n case ActionTypes$1.toggleMeridiem:\r\n this.manipulateAndSet(lastPicked, Unit.hours, this.dates.lastPicked.hours >= 12 ? -12 : 12);\r\n break;\r\n case ActionTypes$1.togglePicker:\r\n this.handleToggle(currentTarget);\r\n break;\r\n case ActionTypes$1.showClock:\r\n case ActionTypes$1.showHours:\r\n case ActionTypes$1.showMinutes:\r\n case ActionTypes$1.showSeconds:\r\n //make sure the clock is actually displaying\r\n if (!this.optionsStore.options.display.sideBySide &&\r\n this.optionsStore.currentView !== 'clock') {\r\n //hide calendar\r\n Collapse.hideImmediately(this.display.dateContainer);\r\n //show clock\r\n Collapse.showImmediately(this.display.timeContainer);\r\n }\r\n this.handleShowClockContainers(action);\r\n break;\r\n case ActionTypes$1.clear:\r\n this.dates.setValue(null);\r\n this.display._updateCalendarHeader();\r\n break;\r\n case ActionTypes$1.close:\r\n this.display.hide();\r\n break;\r\n case ActionTypes$1.today: {\r\n const day = new DateTime().setLocalization(this.optionsStore.options.localization);\r\n this._eventEmitters.updateViewDate.emit(day);\r\n if (!this.validation.isValid(day, Unit.date))\r\n break;\r\n if (this.optionsStore.options.dateRange)\r\n this.handleDateRange(day);\r\n else if (this.optionsStore.options.multipleDates) {\r\n this.handleMultiDate(day);\r\n }\r\n else {\r\n this.dates.setValue(day, this.dates.lastPickedIndex);\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n handleShowClockContainers(action) {\r\n if (!this.display._hasTime) {\r\n Namespace.errorMessages.throwError('Cannot show clock containers when time is disabled.');\r\n /* ignore coverage: should never happen */\r\n return;\r\n }\r\n this.optionsStore.currentView = 'clock';\r\n this.display.widget\r\n .querySelectorAll(`.${Namespace.css.timeContainer} > div`)\r\n .forEach((htmlElement) => (htmlElement.style.display = 'none'));\r\n let classToUse = '';\r\n switch (action) {\r\n case ActionTypes$1.showClock:\r\n classToUse = Namespace.css.clockContainer;\r\n this.display._update('clock');\r\n break;\r\n case ActionTypes$1.showHours:\r\n classToUse = Namespace.css.hourContainer;\r\n this.display._update(Unit.hours);\r\n break;\r\n case ActionTypes$1.showMinutes:\r\n classToUse = Namespace.css.minuteContainer;\r\n this.display._update(Unit.minutes);\r\n break;\r\n case ActionTypes$1.showSeconds:\r\n classToUse = Namespace.css.secondContainer;\r\n this.display._update(Unit.seconds);\r\n break;\r\n }\r\n const element = this.display.widget.getElementsByClassName(classToUse)[0];\r\n element.style.display = 'grid';\r\n element.children[0]?.focus();\r\n }\r\n handleNextPrevious(action) {\r\n const { unit, step } = CalendarModes[this.optionsStore.currentCalendarViewMode];\r\n if (action === ActionTypes$1.next)\r\n this.optionsStore.viewDate.manipulate(step, unit);\r\n else\r\n this.optionsStore.viewDate.manipulate(step * -1, unit);\r\n this._eventEmitters.viewUpdate.emit();\r\n this.display._showMode();\r\n }\r\n /**\r\n * After setting the value it will either show the clock or hide the widget.\r\n * @param e\r\n */\r\n hideOrClock(e) {\r\n if (!this.optionsStore.isTwelveHour &&\r\n !this.optionsStore.options.display.components.minutes &&\r\n !this.optionsStore.options.display.keepOpen &&\r\n !this.optionsStore.options.display.inline) {\r\n this.display.hide();\r\n }\r\n else {\r\n this.do(e, ActionTypes$1.showClock);\r\n }\r\n }\r\n /**\r\n * Common function to manipulate {@link lastPicked} by `unit`.\r\n * @param lastPicked\r\n * @param unit\r\n * @param value Value to change by\r\n */\r\n manipulateAndSet(lastPicked, unit, value = 1) {\r\n const newDate = lastPicked.manipulate(value, unit);\r\n if (this.validation.isValid(newDate, unit)) {\r\n this.dates.setValue(newDate, this.dates.lastPickedIndex);\r\n }\r\n }\r\n handleSelectCalendarMode(action, currentTarget) {\r\n const value = +currentTarget.dataset.value;\r\n switch (action) {\r\n case ActionTypes$1.selectMonth:\r\n this.optionsStore.viewDate.month = value;\r\n break;\r\n case ActionTypes$1.selectYear:\r\n case ActionTypes$1.selectDecade:\r\n this.optionsStore.viewDate.year = value;\r\n break;\r\n }\r\n if (this.optionsStore.currentCalendarViewMode ===\r\n this.optionsStore.minimumCalendarViewMode) {\r\n this.dates.setValue(this.optionsStore.viewDate, this.dates.lastPickedIndex);\r\n if (!this.optionsStore.options.display.inline) {\r\n this.display.hide();\r\n }\r\n }\r\n else {\r\n this.display._showMode(-1);\r\n }\r\n }\r\n handleToggle(currentTarget) {\r\n if (currentTarget.getAttribute('title') ===\r\n this.optionsStore.options.localization.selectDate) {\r\n currentTarget.setAttribute('title', this.optionsStore.options.localization.selectTime);\r\n currentTarget.innerHTML = this.display._iconTag(this.optionsStore.options.display.icons.time).outerHTML;\r\n this.display._updateCalendarHeader();\r\n this.optionsStore.refreshCurrentView();\r\n }\r\n else {\r\n currentTarget.setAttribute('title', this.optionsStore.options.localization.selectDate);\r\n currentTarget.innerHTML = this.display._iconTag(this.optionsStore.options.display.icons.date).outerHTML;\r\n if (this.display._hasTime) {\r\n this.handleShowClockContainers(ActionTypes$1.showClock);\r\n this.display._update('clock');\r\n }\r\n }\r\n this.display.widget\r\n .querySelectorAll(`.${Namespace.css.dateContainer}, .${Namespace.css.timeContainer}`)\r\n .forEach((htmlElement) => Collapse.toggle(htmlElement));\r\n this._eventEmitters.viewUpdate.emit();\r\n const visible = this.display.widget.querySelector(`.${Namespace.css.collapsing} > div[style*=\"display: grid\"]`);\r\n visible?.focus();\r\n }\r\n handleSelectDay(currentTarget) {\r\n const day = this.optionsStore.viewDate.clone;\r\n if (currentTarget.classList.contains(Namespace.css.old)) {\r\n day.manipulate(-1, Unit.month);\r\n }\r\n if (currentTarget.classList.contains(Namespace.css.new)) {\r\n day.manipulate(1, Unit.month);\r\n }\r\n day.date = +currentTarget.dataset.day;\r\n if (this.optionsStore.options.dateRange)\r\n this.handleDateRange(day);\r\n else if (this.optionsStore.options.multipleDates) {\r\n this.handleMultiDate(day);\r\n }\r\n else {\r\n this.dates.setValue(day, this.dates.lastPickedIndex);\r\n }\r\n if (!this.display._hasTime &&\r\n !this.optionsStore.options.display.keepOpen &&\r\n !this.optionsStore.options.display.inline &&\r\n !this.optionsStore.options.multipleDates &&\r\n !this.optionsStore.options.dateRange) {\r\n this.display.hide();\r\n }\r\n }\r\n handleMultiDate(day) {\r\n let index = this.dates.pickedIndex(day, Unit.date);\r\n if (index !== -1) {\r\n this.dates.setValue(null, index); //deselect multi-date\r\n }\r\n else {\r\n index = this.dates.lastPickedIndex + 1;\r\n if (this.dates.picked.length === 0)\r\n index = 0;\r\n this.dates.setValue(day, index);\r\n }\r\n }\r\n handleDateRange(day) {\r\n switch (this.dates.picked.length) {\r\n case 2: {\r\n this.dates.clear();\r\n break;\r\n }\r\n case 1: {\r\n const other = this.dates.picked[0];\r\n if (day.getTime() === other.getTime()) {\r\n this.dates.clear();\r\n break;\r\n }\r\n if (day.isBefore(other)) {\r\n this.dates.setValue(day, 0);\r\n this.dates.setValue(other, 1);\r\n return;\r\n }\r\n else {\r\n this.dates.setValue(day, 1);\r\n return;\r\n }\r\n }\r\n }\r\n this.dates.setValue(day, 0);\r\n }\r\n }\n\n /**\r\n * A robust and powerful date/time picker component.\r\n */\r\n class TempusDominus {\r\n constructor(element, options = {}) {\r\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n this._subscribers = {};\r\n this._isDisabled = false;\r\n /**\r\n * Event for when the input field changes. This is a class level method so there's\r\n * something for the remove listener function.\r\n * @private\r\n */\r\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n this._inputChangeEvent = (event) => {\r\n const internallyTriggered = event?.detail;\r\n if (internallyTriggered)\r\n return;\r\n const setViewDate = () => {\r\n if (this.dates.lastPicked)\r\n this.optionsStore.viewDate = this.dates.lastPicked.clone;\r\n };\r\n const value = this.optionsStore.input.value;\r\n if (this.optionsStore.options.multipleDates ||\r\n this.optionsStore.options.dateRange) {\r\n try {\r\n const valueSplit = value.split(this.optionsStore.options.multipleDatesSeparator);\r\n for (let i = 0; i < valueSplit.length; i++) {\r\n this.dates.setFromInput(valueSplit[i], i);\r\n }\r\n setViewDate();\r\n }\r\n catch {\r\n console.warn('TD: Something went wrong trying to set the multipleDates values from the input field.');\r\n }\r\n }\r\n else {\r\n this.dates.setFromInput(value, 0);\r\n setViewDate();\r\n }\r\n };\r\n /**\r\n * Event for when the toggle is clicked. This is a class level method so there's\r\n * something for the remove listener function.\r\n * @private\r\n */\r\n this._toggleClickEvent = () => {\r\n if (this.optionsStore.element?.disabled ||\r\n this.optionsStore.input?.disabled ||\r\n //if we just have the input and allow input toggle is enabled, then don't cause a toggle\r\n (this.optionsStore.toggle.nodeName === 'INPUT' &&\r\n this.optionsStore.toggle?.type === 'text' &&\r\n this.optionsStore.options.allowInputToggle))\r\n return;\r\n this.toggle();\r\n };\r\n /**\r\n * Event for when the toggle is clicked. This is a class level method so there's\r\n * something for the remove listener function.\r\n * @private\r\n */\r\n this._openClickEvent = () => {\r\n if (this.optionsStore.element?.disabled ||\r\n this.optionsStore.input?.disabled)\r\n return;\r\n if (!this.display.isVisible)\r\n this.show();\r\n };\r\n setupServiceLocator();\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.display = serviceLocator.locate(Display);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.actions = serviceLocator.locate(Actions);\r\n if (!element) {\r\n Namespace.errorMessages.mustProvideElement();\r\n }\r\n this.optionsStore.element = element;\r\n this._initializeOptions(options, DefaultOptions, true);\r\n this.optionsStore.viewDate.setLocalization(this.optionsStore.options.localization);\r\n this.optionsStore.unset = true;\r\n this._initializeInput();\r\n this._initializeToggle();\r\n if (this.optionsStore.options.display.inline)\r\n this.display.show();\r\n this._eventEmitters.triggerEvent.subscribe((e) => {\r\n this._triggerEvent(e);\r\n });\r\n this._eventEmitters.viewUpdate.subscribe(() => {\r\n this._viewUpdate();\r\n });\r\n this._eventEmitters.updateViewDate.subscribe((dateTime) => {\r\n this.viewDate = dateTime;\r\n });\r\n }\r\n get viewDate() {\r\n return this.optionsStore.viewDate;\r\n }\r\n set viewDate(value) {\r\n this.optionsStore.viewDate = value;\r\n this.optionsStore.viewDate.setLocalization(this.optionsStore.options.localization);\r\n this.display._update(this.optionsStore.currentView === 'clock' ? 'clock' : 'calendar');\r\n }\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Update the picker options. If `reset` is provide `options` will be merged with DefaultOptions instead.\r\n * @param options\r\n * @param reset\r\n * @public\r\n */\r\n updateOptions(options, reset = false) {\r\n if (reset)\r\n this._initializeOptions(options, DefaultOptions);\r\n else\r\n this._initializeOptions(options, this.optionsStore.options);\r\n this.optionsStore.viewDate.setLocalization(this.optionsStore.options.localization);\r\n this.display.refreshCurrentView();\r\n }\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Toggles the picker open or closed. If the picker is disabled, nothing will happen.\r\n * @public\r\n */\r\n toggle() {\r\n if (this._isDisabled)\r\n return;\r\n this.display.toggle();\r\n }\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Shows the picker unless the picker is disabled.\r\n * @public\r\n */\r\n show() {\r\n if (this._isDisabled)\r\n return;\r\n this.display.show();\r\n }\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Hides the picker unless the picker is disabled.\r\n * @public\r\n */\r\n hide() {\r\n this.display.hide();\r\n }\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Disables the picker and the target input field.\r\n * @public\r\n */\r\n disable() {\r\n this._isDisabled = true;\r\n // todo this might be undesired. If a dev disables the input field to\r\n // only allow using the picker, this will break that.\r\n this.optionsStore.input?.setAttribute('disabled', 'disabled');\r\n this.display.hide();\r\n }\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Enables the picker and the target input field.\r\n * @public\r\n */\r\n enable() {\r\n this._isDisabled = false;\r\n this.optionsStore.input?.removeAttribute('disabled');\r\n }\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Clears all the selected dates\r\n * @public\r\n */\r\n clear() {\r\n this.optionsStore.input.value = '';\r\n this.dates.clear();\r\n }\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Allows for a direct subscription to picker events, without having to use addEventListener on the element.\r\n * @param eventTypes See Namespace.Events\r\n * @param callbacks Function to call when event is triggered\r\n * @public\r\n */\r\n subscribe(eventTypes, callbacks //eslint-disable-line @typescript-eslint/no-explicit-any\r\n ) {\r\n if (typeof eventTypes === 'string') {\r\n eventTypes = [eventTypes];\r\n }\r\n let callBackArray; //eslint-disable-line @typescript-eslint/no-explicit-any\r\n if (!Array.isArray(callbacks)) {\r\n callBackArray = [callbacks];\r\n }\r\n else {\r\n callBackArray = callbacks;\r\n }\r\n if (eventTypes.length !== callBackArray.length) {\r\n Namespace.errorMessages.subscribeMismatch();\r\n }\r\n const returnArray = [];\r\n for (let i = 0; i < eventTypes.length; i++) {\r\n const eventType = eventTypes[i];\r\n if (!Array.isArray(this._subscribers[eventType])) {\r\n this._subscribers[eventType] = [];\r\n }\r\n this._subscribers[eventType].push(callBackArray[i]);\r\n returnArray.push({\r\n unsubscribe: this._unsubscribe.bind(this, eventType, this._subscribers[eventType].length - 1),\r\n });\r\n if (eventTypes.length === 1) {\r\n return returnArray[0];\r\n }\r\n }\r\n return returnArray;\r\n }\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Hides the picker and removes event listeners\r\n */\r\n dispose() {\r\n this.display.hide();\r\n // this will clear the document click event listener\r\n this.display._dispose();\r\n this._eventEmitters.destroy();\r\n this.optionsStore.input?.removeEventListener('change', this._inputChangeEvent);\r\n if (this.optionsStore.options.allowInputToggle) {\r\n this.optionsStore.input?.removeEventListener('click', this._openClickEvent);\r\n this.optionsStore.input?.removeEventListener('focus', this._openClickEvent);\r\n }\r\n this.optionsStore.toggle?.removeEventListener('click', this._toggleClickEvent);\r\n this.optionsStore.toggle?.removeEventListener('keydown', this._handleToggleKeydown);\r\n this._subscribers = {};\r\n }\r\n /**\r\n * Updates the options to use the provided language.\r\n * THe language file must be loaded first.\r\n * @param language\r\n */\r\n locale(language) {\r\n const asked = loadedLocales[language];\r\n if (!asked)\r\n return;\r\n this.updateOptions({\r\n localization: asked,\r\n });\r\n }\r\n /**\r\n * Triggers an event like ChangeEvent when the picker has updated the value\r\n * of a selected date.\r\n * @param event Accepts a BaseEvent object.\r\n * @private\r\n */\r\n _triggerEvent(event) {\r\n event.viewMode = this.optionsStore.currentView;\r\n const isChangeEvent = event.type === Namespace.events.change;\r\n if (isChangeEvent) {\r\n const { date, oldDate, isClear } = event;\r\n if ((date && oldDate && date.isSame(oldDate)) ||\r\n (!isClear && !date && !oldDate)) {\r\n return;\r\n }\r\n this._handleAfterChangeEvent(event);\r\n this.optionsStore.input?.dispatchEvent(\r\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n new CustomEvent('change', { detail: event }));\r\n if (this.optionsStore.toggle) {\r\n let label = this.optionsStore.options.localization.toggleAriaLabel;\r\n if (this.dates.picked.length > 0) {\r\n const picked = this.dates.picked.map((x) => x.format()).join(', ');\r\n label = `${label}, ${picked}`;\r\n }\r\n this.optionsStore.toggle.ariaLabel = label;\r\n }\r\n }\r\n this.optionsStore.element.dispatchEvent(\r\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n new CustomEvent(event.type, { detail: event }));\r\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n if (window.jQuery) {\r\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const $ = window.jQuery;\r\n if (isChangeEvent && this.optionsStore.input) {\r\n $(this.optionsStore.input).trigger(event);\r\n }\r\n else {\r\n $(this.optionsStore.element).trigger(event);\r\n }\r\n }\r\n this._publish(event);\r\n }\r\n _publish(event) {\r\n // return if event is not subscribed\r\n if (!Array.isArray(this._subscribers[event.type])) {\r\n return;\r\n }\r\n // Trigger callback for each subscriber\r\n this._subscribers[event.type].forEach((callback) => {\r\n callback(event);\r\n });\r\n }\r\n /**\r\n * Fires a ViewUpdate event when, for example, the month view is changed.\r\n * @private\r\n */\r\n _viewUpdate() {\r\n this._triggerEvent({\r\n type: Namespace.events.update,\r\n viewDate: this.optionsStore.viewDate.clone,\r\n });\r\n }\r\n _unsubscribe(eventName, index) {\r\n this._subscribers[eventName].splice(index, 1);\r\n }\r\n /**\r\n * Merges two Option objects together and validates options type\r\n * @param config new Options\r\n * @param mergeTo Options to merge into\r\n * @param includeDataset When true, the elements data-td attributes will be included in the\r\n * @private\r\n */\r\n _initializeOptions(config, mergeTo, includeDataset = false) {\r\n let newConfig = OptionConverter.deepCopy(config);\r\n newConfig = OptionConverter._mergeOptions(newConfig, mergeTo);\r\n if (includeDataset)\r\n newConfig = OptionConverter._dataToOptions(this.optionsStore.element, newConfig);\r\n OptionConverter._validateConflicts(newConfig);\r\n newConfig.viewDate = newConfig.viewDate.setLocalization(newConfig.localization);\r\n if (!this.optionsStore.viewDate.isSame(newConfig.viewDate)) {\r\n this.optionsStore.viewDate = newConfig.viewDate;\r\n }\r\n /**\r\n * Sets the minimum view allowed by the picker. For example the case of only\r\n * allowing year and month to be selected but not date.\r\n */\r\n if (newConfig.display.components.year) {\r\n this.optionsStore.minimumCalendarViewMode = 2;\r\n }\r\n if (newConfig.display.components.month) {\r\n this.optionsStore.minimumCalendarViewMode = 1;\r\n }\r\n if (newConfig.display.components.date) {\r\n this.optionsStore.minimumCalendarViewMode = 0;\r\n }\r\n this.optionsStore.currentCalendarViewMode = Math.max(this.optionsStore.minimumCalendarViewMode, this.optionsStore.currentCalendarViewMode);\r\n // Update view mode if needed\r\n if (CalendarModes[this.optionsStore.currentCalendarViewMode].name !==\r\n newConfig.display.viewMode) {\r\n this.optionsStore.currentCalendarViewMode = Math.max(CalendarModes.findIndex((x) => x.name === newConfig.display.viewMode), this.optionsStore.minimumCalendarViewMode);\r\n }\r\n if (this.display?.isVisible) {\r\n this.display._update('all');\r\n }\r\n if (newConfig.display.components.useTwentyfourHour &&\r\n newConfig.localization.hourCycle === undefined)\r\n newConfig.localization.hourCycle = 'h24';\r\n else if (newConfig.localization.hourCycle === undefined) {\r\n newConfig.localization.hourCycle = guessHourCycle(newConfig.localization.locale);\r\n }\r\n this.optionsStore.options = newConfig;\r\n if (newConfig.restrictions.maxDate &&\r\n this.viewDate.isAfter(newConfig.restrictions.maxDate))\r\n this.viewDate = newConfig.restrictions.maxDate.clone;\r\n if (newConfig.restrictions.minDate &&\r\n this.viewDate.isBefore(newConfig.restrictions.minDate))\r\n this.viewDate = newConfig.restrictions.minDate.clone;\r\n }\r\n /**\r\n * Checks if an input field is being used, attempts to locate one and sets an\r\n * event listener if found.\r\n * @private\r\n */\r\n _initializeInput() {\r\n if (this.optionsStore.element.tagName == 'INPUT') {\r\n this.optionsStore.input = this.optionsStore.element;\r\n }\r\n else {\r\n const query = this.optionsStore.element.dataset.tdTargetInput;\r\n if (query == undefined || query == 'nearest') {\r\n this.optionsStore.input =\r\n this.optionsStore.element.querySelector('input');\r\n }\r\n else {\r\n this.optionsStore.input =\r\n this.optionsStore.element.querySelector(query);\r\n }\r\n }\r\n if (!this.optionsStore.input)\r\n return;\r\n if (!this.optionsStore.input.value && this.optionsStore.options.defaultDate)\r\n this.optionsStore.input.value = this.dates.formatInput(this.optionsStore.options.defaultDate);\r\n this.optionsStore.input.addEventListener('change', this._inputChangeEvent);\r\n if (this.optionsStore.options.allowInputToggle) {\r\n this.optionsStore.input.addEventListener('click', this._openClickEvent);\r\n this.optionsStore.input.addEventListener('focus', this._openClickEvent);\r\n }\r\n if (this.optionsStore.input.value) {\r\n this._inputChangeEvent();\r\n }\r\n }\r\n /**\r\n * Attempts to locate a toggle for the picker and sets an event listener\r\n * @private\r\n */\r\n _initializeToggle() {\r\n if (this.optionsStore.options.display.inline)\r\n return;\r\n let query = this.optionsStore.element.dataset.tdTargetToggle;\r\n if (query == 'nearest') {\r\n query = '[data-td-toggle=\"datetimepicker\"]';\r\n }\r\n this.optionsStore.toggle =\r\n query == undefined\r\n ? this.optionsStore.element\r\n : this.optionsStore.element.querySelector(query);\r\n if (this.optionsStore.toggle == undefined)\r\n return;\r\n this.optionsStore.toggle.addEventListener('click', this._toggleClickEvent);\r\n if (this.optionsStore.toggle !== this.optionsStore.element) {\r\n this.optionsStore.toggle.addEventListener('keydown', this._handleToggleKeydown.bind(this));\r\n }\r\n }\r\n /**\r\n * If the option is enabled this will render the clock view after a date pick.\r\n * @param e change event\r\n * @private\r\n */\r\n _handleAfterChangeEvent(e) {\r\n if (\r\n // options is disabled\r\n !this.optionsStore.options.promptTimeOnDateChange ||\r\n this.optionsStore.options.multipleDates ||\r\n this.optionsStore.options.display.inline ||\r\n this.optionsStore.options.display.sideBySide ||\r\n // time is disabled\r\n !this.display._hasTime ||\r\n // clock component is already showing\r\n this.display.widget\r\n ?.getElementsByClassName(Namespace.css.show)[0]\r\n .classList.contains(Namespace.css.timeContainer))\r\n return;\r\n // First time ever. If useCurrent option is set to true (default), do nothing\r\n // because the first date is selected automatically.\r\n // or date didn't change (time did) or date changed because time did.\r\n if ((!e.oldDate && this.optionsStore.options.useCurrent) ||\r\n (e.oldDate && e.date?.isSame(e.oldDate))) {\r\n return;\r\n }\r\n clearTimeout(this._currentPromptTimeTimeout);\r\n this._currentPromptTimeTimeout = setTimeout(() => {\r\n if (this.display.widget) {\r\n this._eventEmitters.action.emit({\r\n e: {\r\n currentTarget: this.display.widget.querySelector('[data-action=\"togglePicker\"]'),\r\n },\r\n action: ActionTypes$1.togglePicker,\r\n });\r\n }\r\n }, this.optionsStore.options.promptTimeOnDateChangeTransitionDelay);\r\n }\r\n _handleToggleKeydown(event) {\r\n if (event.key !== ' ' && event.key !== 'Enter')\r\n return;\r\n this.optionsStore.toggle.click();\r\n event.stopPropagation();\r\n event.preventDefault();\r\n }\r\n }\r\n /**\r\n * Whenever a locale is loaded via a plugin then store it here based on the\r\n * locale name. E.g. loadedLocales['ru']\r\n */\r\n const loadedLocales = {};\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Called from a locale plugin.\r\n * @param l locale object for localization options\r\n */\r\n const loadLocale = (l) => {\r\n if (loadedLocales[l.name])\r\n return;\r\n loadedLocales[l.name] = l.localization;\r\n };\r\n /**\r\n * A sets the global localization options to the provided locale name.\r\n * `loadLocale` MUST be called first.\r\n * @param l\r\n */\r\n const locale = (l) => {\r\n const asked = loadedLocales[l];\r\n if (!asked)\r\n return;\r\n DefaultOptions.localization = asked;\r\n };\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Called from a plugin to extend or override picker defaults.\r\n * @param plugin\r\n * @param option\r\n */\r\n const extend = function (plugin, option = undefined) {\r\n if (!plugin)\r\n return tempusDominus$1;\r\n if (!plugin.installed) {\r\n // install plugin only once\r\n plugin(option, { TempusDominus, Dates, Display, DateTime, Namespace }, tempusDominus$1);\r\n plugin.installed = true;\r\n }\r\n return tempusDominus$1;\r\n };\r\n const version = '6.9.4';\r\n const tempusDominus$1 = {\r\n TempusDominus,\r\n extend,\r\n loadLocale,\r\n locale,\r\n Namespace,\r\n DefaultOptions,\r\n DateTime,\r\n Unit,\r\n version,\r\n DefaultEnLocalization,\r\n };\n\n var _tempusDominus = {\n __proto__: null,\n TempusDominus: TempusDominus,\n extend: extend,\n loadLocale: loadLocale,\n locale: locale,\n Namespace: Namespace,\n DefaultOptions: DefaultOptions,\n DateTime: DateTime,\n get Unit () { return Unit; },\n version: version,\n DefaultEnLocalization: DefaultEnLocalization\n };\n\n var luxon_parse = (_, tdClasses, tdFactory) => {\r\n tdClasses.Dates.prototype.setFromInput = function (value, index) {\r\n let locale = this.optionsStore.options.localization.locale, format = this.optionsStore.options.localization.format;\r\n if (format) {\r\n let opts = {\r\n locale\r\n };\r\n let parsedDate = new tdFactory.DateTime(luxon__namespace.DateTime.fromFormat(value, format, opts).toJSDate());\r\n // Check if the date is valid (An invalid date object returns NaN for getTime() and NaN is the only object not strictly equal to itself.)\r\n if (parsedDate && parsedDate.getTime() === parsedDate.getTime()) {\r\n let date = tdFactory.DateTime.convert(parsedDate, '', this.optionsStore.options.localization);\r\n this.setValue(date, index);\r\n }\r\n else {\r\n console.error('Luxon failed to parse the input date.');\r\n }\r\n }\r\n else {\r\n console.error('Missing format.');\r\n }\r\n };\r\n tdClasses.Dates.prototype.formatInput = function (date) {\r\n let locale = this.optionsStore.options.localization.locale, format = this.optionsStore.options.localization.format;\r\n if (format) {\r\n let opts = {\r\n locale,\r\n outputCalendar: \"gregory\" // Make sure the date is converted back to \"gregory\" format\r\n };\r\n return date ? luxon__namespace.DateTime.fromJSDate(date, opts).toFormat(format) : \"\";\r\n }\r\n else {\r\n console.error('Missing format.');\r\n }\r\n };\r\n };\n\n ///\n\n const tempusDominus = _tempusDominus;\n\n tempusDominus.extend(luxon_parse); //***\n // tempusDominus.extend(fa_five); //*** for v2022 only\n\n /*!\n * Tempus Dominus v6.9.4 (https://getdatepicker.com/)\n * Copyright 2013-2021 Jonathan Peterson\n * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE)\n */\n tempusDominus.jQueryInterface = function (option, argument) {\n if (this.length === 1) {\n return tempusDominus.jQueryHandleThis(this, option, argument);\n }\n // \"this\" is jquery here\n return this.each(function () {\n tempusDominus.jQueryHandleThis(this, option, argument);\n });\n };\n\n tempusDominus.jQueryHandleThis = function (me, option, argument) {\n let data = $__default[\"default\"](me).data(tempusDominus.Namespace.dataKey);\n if (typeof option === 'object') {\n option = $__default[\"default\"].extend({}, tempusDominus.DefaultOptions, option);\n }\n\n if (!data) {\n data = new tempusDominus.TempusDominus($__default[\"default\"](me)[0], option);\n $__default[\"default\"](me).data(tempusDominus.Namespace.dataKey, data);\n }\n\n if (typeof option === 'string') {\n if (data[option] === undefined) {\n throw new Error(`No method named \"${option}\"`);\n }\n if (argument === undefined) {\n return data[option]();\n } else {\n if (option === 'date') {\n data.isDateUpdateThroughDateOptionFromClientCode = true;\n }\n const ret = data[option](argument);\n data.isDateUpdateThroughDateOptionFromClientCode = false;\n return ret;\n }\n }\n };\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n //*** $(document)\n // .on(\n // `click${tempusDominus.Namespace.events.key}.data-api`,\n // `[data-toggle=\"${tempusDominus.Namespace.dataKey}\"]`,\n // function () {\n // const $originalTarget = $(this),\n // $target = tempusDominus.getSelectorFromElement($originalTarget),\n // config = $target.data(tempusDominus.Namespace.dataKey);\n // if ($target.length === 0) {\n // return;\n // }\n // if (\n // config._options.allowInputToggle &&\n // $originalTarget.is('input[data-toggle=\"datetimepicker\"]')\n // ) {\n // return;\n // }\n // tempusDominus.jQueryInterface.call($target, 'toggle');\n // }\n // )\n // .on(\n // tempusDominus.Namespace.events.change,\n // `.${tempusDominus.Namespace.NAME}-input`,\n // function (event) {\n // const $target = tempusDominus.getSelectorFromElement($(this));\n // if ($target.length === 0 || event.isInit) {\n // return;\n // }\n // tempusDominus.jQueryInterface.call($target, '_change', event);\n // }\n // )\n // .on(\n // tempusDominus.Namespace.events.blur,\n // `.${tempusDominus.Namespace.NAME}-input`,\n // function (event) {\n // const $target = tempusDominus.getSelectorFromElement($(this)),\n // config = $target.data(tempusDominus.Namespace.dataKey);\n // if ($target.length === 0) {\n // return;\n // }\n // if (config._options.debug || window.debug) {\n // return;\n // }\n // tempusDominus.jQueryInterface.call($target, 'hide', event);\n // }\n // )\n // /*.on(tempusDominus.Namespace.Events.keydown, `.${tempusDominus.Namespace.NAME}-input`, function (event) {\n // const $target = tempusDominus.getSelectorFromElement($(this));\n // if ($target.length === 0) {\n // return;\n // }\n // tempusDominus.jQueryInterface.call($target, '_keydown', event);\n // })\n // .on(tempusDominus.Namespace.Events.keyup, `.${tempusDominus.Namespace.NAME}-input`, function (event) {\n // const $target = tempusDominus.getSelectorFromElement($(this));\n // if ($target.length === 0) {\n // return;\n // }\n // tempusDominus.jQueryInterface.call($target, '_keyup', event);\n // })*/\n // .on(\n // tempusDominus.Namespace.events.focus,\n // `.${tempusDominus.Namespace.NAME}-input`,\n // function (event) {\n // const $target = tempusDominus.getSelectorFromElement($(this)),\n // config = $target.data(tempusDominus.Namespace.dataKey);\n // if ($target.length === 0) {\n // return;\n // }\n // if (!config._options.allowInputToggle) {\n // return;\n // }\n // tempusDominus.jQueryInterface.call($target, 'show', event);\n // }\n // );\n const name = 'tempusDominus';\n const JQUERY_NO_CONFLICT = $__default[\"default\"].fn[name];\n $__default[\"default\"].fn[name] = tempusDominus.jQueryInterface;\n $__default[\"default\"].fn[name].Constructor = tempusDominus.TempusDominus;\n $__default[\"default\"].fn[name].noConflict = function () {\n $__default[\"default\"].fn[name] = JQUERY_NO_CONFLICT;\n return tempusDominus.jQueryInterface;\n };\n\n return tempusDominus;\n\n})(jQuery, luxon);\n"],"mappings":";;;;;AAKA,IAAIA,cAAgB,SAAWC,EAAGC,GAChC,aAEA,SAASC,EAAuBC,GAAK,OAAOA,GAAkB,iBAANA,GAAkB,YAAaA,EAAIA,EAAI,CAAEC,QAAWD,EAAK,CAEjH,SAASE,EAAkBF,GACzB,GAAIA,GAAKA,EAAEG,WAAY,OAAOH,EAC9B,IAAII,EAAIC,OAAOC,OAAO,MAatB,OAZIN,GACFK,OAAOE,KAAKP,GAAGQ,SAAQ,SAAUC,GAC/B,GAAU,YAANA,EAAiB,CACnB,IAAIC,EAAIL,OAAOM,yBAAyBX,EAAGS,GAC3CJ,OAAOO,eAAeR,EAAGK,EAAGC,EAAEG,IAAMH,EAAI,CACtCI,YAAY,EACZD,IAAK,WAAc,OAAOb,EAAES,EAAI,GAEpC,CACF,IAEFL,EAAW,QAAIJ,EACRI,CACT,CAEA,IAAIW,EAA0BhB,EAAsBF,GAChDmB,EAAgCd,EAAkBJ,GAEtD,MAAMmB,gBAAgBC,OA8ItB,MAAMC,EAAO,iBAkOb,MAAMC,WAENA,UAAUD,KAAOA,EAEjBC,UAAUC,QAtO+B,KAuOzCD,UAAUE,OAAS,IAnOnB,MAAMC,OACFC,cACIC,KAAKC,IAAM,MAKXD,KAAKE,OAAS,SAASF,KAAKC,MAK5BD,KAAKG,OAAS,SAASH,KAAKC,MAK5BD,KAAKI,MAAQ,Q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