UNPKG

@syncfusion/ej2-calendars

Version:

A complete package of date or time components with built-in features such as date formatting, inline editing, multiple (range) selection, range restriction, month and year selection, strict mode, and globalization.

10 lines 394 kB
/*!
*  filename: ej2-calendars.min.js
*  version : 32.1.22
*  Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
*  Use of this code is subject to the terms of our license.
*  A copy of the current license can be obtained at any time by e-mailing
*  licensing@syncfusion.com. Any infringement will be prosecuted under
*  applicable laws. 
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("SyncfusionBase"),require("SyncfusionPopups"),require("SyncfusionInputs"),require("SyncfusionButtons"),require("SyncfusionLists")):"function"==typeof define&&define.amd?define(["SyncfusionBase","SyncfusionPopups","SyncfusionInputs","SyncfusionButtons","SyncfusionLists"],t):"object"==typeof exports?exports.SyncfusionCalendars=t(require("SyncfusionBase"),require("SyncfusionPopups"),require("SyncfusionInputs"),require("SyncfusionButtons"),require("SyncfusionLists")):e.SyncfusionCalendars=t(e.SyncfusionBase,e.SyncfusionPopups,e.SyncfusionInputs,e.SyncfusionButtons,e.SyncfusionLists)}(self,(e,t,i,s,a)=>(()=>{"use strict";var n={766:t=>{t.exports=e},741:e=>{e.exports=s},323:e=>{e.exports=i},90:e=>{e.exports=a},197:e=>{e.exports=t}},r={};function l(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={exports:{}};return n[e](i,i.exports,l),i.exports}l.d=(e,t)=>{for(var i in t)l.o(t,i)&&!l.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{l.r(o),l.d(o,{Calendar:()=>T,CalendarBase:()=>I,DatePicker:()=>Q,DateRangePicker:()=>_e,DateTimePicker:()=>At,Islamic:()=>L,MaskedDateTime:()=>Bt,Presets:()=>Ke,TimeMaskPlaceholder:()=>dt,TimePicker:()=>pt,TimePickerBase:()=>t});var e,t,i=l(766),s=(e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)},function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}),a=function(e,t,i,s){var a,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(r=(n<3?a(r):n>3?a(t,i,r):a(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},n="e-other-month",r="e-other-year",h="e-calendar",u="e-device",d="e-rtl",p="e-year",c="e-month",m="e-decade",f="e-icons",v="e-disabled",g="e-overlay",y="e-week-number",b="e-selected",D="e-focused-date",E="e-focused-cell",C="e-month-hide",k="e-today",M="e-day",w="e-cell",V="e-zoomin",O="e-calendar-day-header-lg",N=864e5,I=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.effect="",s.isPopupClicked=!1,s.isDateSelected=!0,s.isTodayClicked=!1,s.preventChange=!1,s.previousDates=!1,s}return s(t,e),t.prototype.render=function(){this.rangeValidation(this.min,this.max),this.calendarEleCopy=this.element.cloneNode(!0),"Islamic"===this.calendarMode&&(+this.min.setSeconds(0)===+new Date(1900,0,1,0,0,0)&&(this.min=new Date(1941,12,18)),+this.max===+new Date(2099,11,31)&&(this.max=new Date(2068,2,4))),this.globalize=new i.Internationalization(this.locale),((0,i.isNullOrUndefined)(this.firstDayOfWeek)||this.firstDayOfWeek>6||this.firstDayOfWeek<0)&&this.setProperties({firstDayOfWeek:this.globalize.getFirstDayOfWeek()},!0),this.todayDisabled=!1,this.todayDate=new Date((new Date).setHours(0,0,0,0)),"calendar"===this.getModuleName()?(this.element.classList.add(h),this.enableRtl&&this.element.classList.add(d),i.Browser.isDevice&&this.element.classList.add(u),(0,i.attributes)(this.element,{"data-role":"calendar"}),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.setAttribute("tabindex",this.tabIndex)):(this.calendarElement=this.createElement("div"),this.calendarElement.classList.add(h),this.enableRtl&&this.calendarElement.classList.add(d),i.Browser.isDevice&&this.calendarElement.classList.add(u),(0,i.attributes)(this.calendarElement,{"data-role":"calendar"})),!(0,i.isNullOrUndefined)((0,i.closest)(this.element,"fieldset"))&&(0,i.closest)(this.element,"fieldset").disabled&&(this.enabled=!1),this.createHeader(),this.createContent(),this.wireEvents()},t.prototype.rangeValidation=function(e,t){(0,i.isNullOrUndefined)(e)&&this.setProperties({min:new Date(1900,0,1)},!0),(0,i.isNullOrUndefined)(t)&&this.setProperties({max:new Date(2099,11,31)},!0)},t.prototype.getDefaultKeyConfig=function(){return this.defaultKeyConfigs={controlUp:"ctrl+38",controlDown:"ctrl+40",moveDown:"downarrow",moveUp:"uparrow",moveLeft:"leftarrow",moveRight:"rightarrow",select:"enter",home:"home",end:"end",pageUp:"pageup",pageDown:"pagedown",shiftPageUp:"shift+pageup",shiftPageDown:"shift+pagedown",controlHome:"ctrl+home",controlEnd:"ctrl+end",altUpArrow:"alt+uparrow",spacebar:"space",altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"},this.defaultKeyConfigs},t.prototype.validateDate=function(e){this.setProperties({min:this.checkDateValue(new Date(this.checkValue(this.min)))},!0),this.setProperties({max:this.checkDateValue(new Date(this.checkValue(this.max)))},!0),this.currentDate=this.currentDate?this.currentDate:new Date((new Date).setHours(0,0,0,0)),!(0,i.isNullOrUndefined)(e)&&this.min<=this.max&&e>=this.min&&e<=this.max&&(this.currentDate=new Date(this.checkValue(e)))},t.prototype.setOverlayIndex=function(e,t,s,a){if(a&&!(0,i.isNullOrUndefined)(t)&&!(0,i.isNullOrUndefined)(s)&&!(0,i.isNullOrUndefined)(e)){var n=parseInt(t.style.zIndex,10)?parseInt(t.style.zIndex,10):1e3;s.style.zIndex=(n-1).toString(),e.style.zIndex=n.toString()}},t.prototype.minMaxUpdate=function(e){this.min=(0,i.isNullOrUndefined)(this.min)||!+this.min?this.min=new Date(1900,0,1):this.min,this.max=(0,i.isNullOrUndefined)(this.max)||!+this.max?this.max=new Date(2099,11,31):this.max,+this.min<=+this.max?(0,i.removeClass)([this.element],g):(this.setProperties({min:this.min},!0),(0,i.addClass)([this.element],g)),+this.min<=+this.max&&e&&+e<=+this.max&&+e>=+this.min?this.currentDate=new Date(this.checkValue(e)):+this.min<=+this.max&&!e&&+this.currentDate>+this.max?this.currentDate=new Date(this.checkValue(this.max)):+this.currentDate<+this.min&&(this.currentDate=new Date(this.checkValue(this.min)))},t.prototype.createHeader=function(){var e={tabindex:"0"};this.headerElement=this.createElement("div",{className:"e-header"});var t=this.createElement("div",{className:"e-icon-container"});this.previousIcon=this.createElement("button",{className:"e-prev",attrs:{type:"button"}}),(0,i.rippleEffect)(this.previousIcon,{duration:400,selector:".e-prev",isCenterRipple:!0}),(0,i.attributes)(this.previousIcon,{"aria-disabled":"false","aria-label":"previous month"}),(0,i.attributes)(this.previousIcon,e),this.nextIcon=this.createElement("button",{className:"e-next",attrs:{type:"button"}}),(0,i.rippleEffect)(this.nextIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),"daterangepicker"===this.getModuleName()&&((0,i.attributes)(this.previousIcon,{tabIndex:"-1"}),(0,i.attributes)(this.nextIcon,{tabIndex:"-1"})),(0,i.attributes)(this.nextIcon,{"aria-disabled":"false","aria-label":"next month"}),(0,i.attributes)(this.nextIcon,e),this.headerTitleElement=this.createElement("div",{className:M+" e-title"}),(0,i.attributes)(this.headerTitleElement,{"aria-atomic":"true","aria-live":"assertive"}),(0,i.attributes)(this.headerTitleElement,e),this.headerElement.appendChild(this.headerTitleElement),this.previousIcon.appendChild(this.createElement("span",{className:"e-date-icon-prev "+f})),this.nextIcon.appendChild(this.createElement("span",{className:"e-date-icon-next  "+f})),t.appendChild(this.previousIcon),t.appendChild(this.nextIcon),this.headerElement.appendChild(t),"calendar"===this.getModuleName()?this.element.appendChild(this.headerElement):this.calendarElement.appendChild(this.headerElement),this.adjustLongHeaderSize()},t.prototype.createContent=function(){this.contentElement=this.createElement("div",{className:"e-content"}),this.table=this.createElement("table",{attrs:{class:"e-calendar-content-table",tabIndex:"0",role:"grid","aria-activedescendant":"","aria-labelledby":this.element.id}}),"calendar"===this.getModuleName()?this.element.appendChild(this.contentElement):this.calendarElement.appendChild(this.contentElement),this.contentElement.appendChild(this.table),this.createContentHeader(),this.createContentBody(),this.showTodayButton&&this.createContentFooter(),"daterangepicker"!==this.getModuleName()&&(i.EventHandler.add(this.table,"focus",this.addContentFocus,this),i.EventHandler.add(this.table,"blur",this.removeContentFocus,this))},t.prototype.addContentFocus=function(e){var t=this.tableBodyElement.querySelector("tr td.e-focused-date"),s=this.tableBodyElement.querySelector("tr td.e-selected");(0,i.isNullOrUndefined)(s)?(0,i.isNullOrUndefined)(t)||t.classList.add(E):s.classList.add(E)},t.prototype.removeContentFocus=function(e){var t=(0,i.isNullOrUndefined)(this.tableBodyElement)?null:this.tableBodyElement.querySelector("tr td.e-focused-date"),s=(0,i.isNullOrUndefined)(this.tableBodyElement)?null:this.tableBodyElement.querySelector("tr td.e-selected");(0,i.isNullOrUndefined)(s)?(0,i.isNullOrUndefined)(t)||t.classList.remove(E):s.classList.remove(E)},t.prototype.getCultureValues=function(){var e,t=[],s=(0,i.isNullOrUndefined)(this.dayHeaderFormat)?null:"days.stand-alone."+this.dayHeaderFormat.toLowerCase();if(e="en"!==this.locale&&"en-US"!==this.locale||(0,i.isNullOrUndefined)(s)?this.getCultureObjects(i.cldrData,""+this.locale):(0,i.getValue)(s,(0,i.getDefaultDateObject)()),!(0,i.isNullOrUndefined)(e))for(var a=0,n=Object.keys(e);a<n.length;a++){var r=n[a];t.push((0,i.getValue)(r,e))}return t},t.prototype.toCapitalize=function(e){return!(0,i.isNullOrUndefined)(e)&&e.length?e[0].toUpperCase()+e.slice(1):e},t.prototype.createContentHeader=function(){"calendar"===this.getModuleName()?(0,i.isNullOrUndefined)(this.element.querySelectorAll(".e-content .e-week-header")[0])||(0,i.detach)(this.element.querySelectorAll(".e-content .e-week-header")[0]):(0,i.isNullOrUndefined)(this.calendarElement.querySelectorAll(".e-content .e-week-header")[0])||(0,i.detach)(this.calendarElement.querySelectorAll(".e-content .e-week-header")[0]);var e="";(this.firstDayOfWeek>6||this.firstDayOfWeek<0)&&this.setProperties({firstDayOfWeek:0},!0),this.tableHeadElement=this.createElement("thead",{className:"e-week-header"}),this.weekNumber&&(e+='<th class="e-week-number" aria-hidden="true"></th>',"calendar"===this.getModuleName()?(0,i.addClass)([this.element],""+y):(0,i.addClass)([this.calendarElement],""+y));var t=this.getCultureValues().length>0&&this.getCultureValues()?this.shiftArray(this.getCultureValues().length>0&&this.getCultureValues(),this.firstDayOfWeek):null;if(!(0,i.isNullOrUndefined)(t))for(var s=0;s<=6;s++)e+='<th  class="">'+this.toCapitalize(t[s])+"</th>";e="<tr>"+e+"</tr>",this.tableHeadElement.innerHTML=e,this.table.appendChild(this.tableHeadElement)},t.prototype.createContentBody=function(){switch("calendar"===this.getModuleName()?(0,i.isNullOrUndefined)(this.element.querySelectorAll(".e-content tbody")[0])||(0,i.detach)(this.element.querySelectorAll(".e-content tbody")[0]):(0,i.isNullOrUndefined)(this.calendarElement.querySelectorAll(".e-content tbody")[0])||(0,i.detach)(this.calendarElement.querySelectorAll(".e-content tbody")[0]),this.start){case"Year":this.renderYears();break;case"Decade":this.renderDecades();break;default:this.renderMonths()}},t.prototype.updateFooter=function(){this.todayElement.textContent=this.l10.getConstant("today"),this.todayElement.setAttribute("aria-label",this.l10.getConstant("today")),this.todayElement.setAttribute("tabindex","0")},t.prototype.createContentFooter=function(){if(this.showTodayButton){var e=new Date(+this.min),t=new Date(+this.max);this.globalize=new i.Internationalization(this.locale),this.l10=new i.L10n(this.getModuleName(),{today:"Today"},this.locale),this.todayElement=this.createElement("button",{attrs:{role:"button"}}),(0,i.rippleEffect)(this.todayElement),this.updateFooter(),(0,i.addClass)([this.todayElement],["e-btn",k,"e-flat","e-primary","e-css"]),+new Date(e.setHours(0,0,0,0))<=+this.todayDate&&+this.todayDate<=+new Date(t.setHours(0,0,0,0))&&!this.todayDisabled||(0,i.addClass)([this.todayElement],v),this.footer=this.createElement("div",{className:"e-footer-container"}),this.footer.appendChild(this.todayElement),"calendar"===this.getModuleName()&&this.element.appendChild(this.footer),"datepicker"===this.getModuleName()&&this.calendarElement.appendChild(this.footer),"datetimepicker"===this.getModuleName()&&this.calendarElement.appendChild(this.footer),this.todayElement.classList.contains(v)||i.EventHandler.add(this.todayElement,"click",this.todayButtonClick,this)}},t.prototype.wireEvents=function(e,t,s,a){i.EventHandler.add(this.headerTitleElement,"click",this.navigateTitle,this),this.defaultKeyConfigs=(0,i.extend)(this.defaultKeyConfigs,this.keyConfigs),"calendar"===this.getModuleName()?this.keyboardModule=new i.KeyboardEvents(this.element,{eventName:"keydown",keyAction:this.keyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs}):this.keyboardModule=new i.KeyboardEvents(this.calendarElement,{eventName:"keydown",keyAction:this.keyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})},t.prototype.dateWireEvents=function(e,t,s,a){this.defaultKeyConfigs=this.getDefaultKeyConfig(),this.defaultKeyConfigs=(0,i.extend)(this.defaultKeyConfigs,s),this.serverModuleName=a},t.prototype.todayButtonClick=function(e,t,i){this.showTodayButton&&(this.currentView()===this.depth?this.effect="":this.effect="e-zoomin",this.getViewNumber(this.start)>=this.getViewNumber(this.depth)?this.navigateTo(this.depth,new Date(this.checkValue(t)),i):this.navigateTo("Month",new Date(this.checkValue(t)),i))},t.prototype.resetCalendar=function(){this.calendarElement&&(0,i.detach)(this.calendarElement),this.tableBodyElement&&(0,i.detach)(this.tableBodyElement),this.table&&(0,i.detach)(this.table),this.tableHeadElement&&(0,i.detach)(this.tableHeadElement),this.nextIcon&&(0,i.detach)(this.nextIcon),this.previousIcon&&(0,i.detach)(this.previousIcon),this.footer&&(0,i.detach)(this.footer),this.todayElement=null,this.renderDayCellArgs=null,this.calendarElement=this.tableBodyElement=this.footer=this.tableHeadElement=this.nextIcon=this.previousIcon=this.table=null},t.prototype.keyActionHandle=function(e,t,s){if(null!==this.calendarElement||"escape"!==e.action){var a,n=this.tableBodyElement.querySelector("tr td.e-focused-date");a=s?(0,i.isNullOrUndefined)(n)||+t!==parseInt(n.getAttribute("id").split("_")[0],10)?this.tableBodyElement.querySelector("tr td.e-selected"):n:this.tableBodyElement.querySelector("tr td.e-selected");var r=this.getViewNumber(this.currentView()),l=this.getViewNumber(this.depth),o=r===l&&this.getViewNumber(this.start)>=l;switch(this.effect="",e.action){case"moveLeft":"daterangepicker"===this.getModuleName()||(0,i.isNullOrUndefined)(e.target)||(this.keyboardNavigate(-1,r,e,this.max,this.min),e.preventDefault());break;case"moveRight":"daterangepicker"===this.getModuleName()||(0,i.isNullOrUndefined)(e.target)||(this.keyboardNavigate(1,r,e,this.max,this.min),e.preventDefault());break;case"moveUp":"daterangepicker"===this.getModuleName()||(0,i.isNullOrUndefined)(e.target)||(0===r?this.keyboardNavigate(-7,r,e,this.max,this.min):this.keyboardNavigate(-4,r,e,this.max,this.min),e.preventDefault());break;case"moveDown":"daterangepicker"===this.getModuleName()||(0,i.isNullOrUndefined)(e.target)||(0===r?this.keyboardNavigate(7,r,e,this.max,this.min):this.keyboardNavigate(4,r,e,this.max,this.min),e.preventDefault());break;case"select":if(e.target===this.headerTitleElement)this.navigateTitle(e);else if(e.target!==this.previousIcon||e.target.className.includes(v))if(e.target!==this.nextIcon||e.target.className.includes(v))if(e.target!==this.todayElement||e.target.className.includes(v)){var h=(0,i.isNullOrUndefined)(n)?a:n;if(!(0,i.isNullOrUndefined)(h)&&!h.classList.contains(v))if(o){var u=new Date(parseInt(""+h.id,0));this.selectDate(e,u,h),"datepicker"!==this.getModuleName()&&"datetimepicker"!==this.getModuleName()||(this.isAngular?this.inputElement.focus():this.element.focus())}else e.target.className.includes(v)||this.contentClick(null,--r,h,t)}else this.todayButtonClick(e,t),"datepicker"!==this.getModuleName()&&"datetimepicker"!==this.getModuleName()||(this.isAngular?this.inputElement.focus():this.element.focus());else this.navigateNext(e);else this.navigatePrevious(e);break;case"controlUp":this.title(),e.preventDefault();break;case"controlDown":((0,i.isNullOrUndefined)(n)||o)&&((0,i.isNullOrUndefined)(a)||o)||this.contentClick(null,--r,n||a,t),e.preventDefault();break;case"home":this.currentDate=this.firstDay(this.currentDate),(0,i.detach)(this.tableBodyElement),0===r?this.renderMonths(e):1===r?this.renderYears(e):this.renderDecades(e),e.preventDefault();break;case"end":this.currentDate=this.lastDay(this.currentDate,r),(0,i.detach)(this.tableBodyElement),0===r?this.renderMonths(e):1===r?this.renderYears(e):this.renderDecades(e),e.preventDefault();break;case"pageUp":this.addMonths(this.currentDate,-1),this.navigateTo("Month",this.currentDate),e.preventDefault();break;case"pageDown":this.addMonths(this.currentDate,1),this.navigateTo("Month",this.currentDate),e.preventDefault();break;case"shiftPageUp":this.addYears(this.currentDate,-1),this.navigateTo("Month",this.currentDate),e.preventDefault();break;case"shiftPageDown":this.addYears(this.currentDate,1),this.navigateTo("Month",this.currentDate),e.preventDefault();break;case"controlHome":this.navigateTo("Month",new Date(this.currentDate.getFullYear(),0,1)),e.preventDefault();break;case"controlEnd":this.navigateTo("Month",new Date(this.currentDate.getFullYear(),11,31)),e.preventDefault();break;case"tab":"datepicker"!==this.getModuleName()&&"datetimepicker"!==this.getModuleName()||e.target!==this.todayElement||(e.preventDefault(),this.isAngular?this.inputElement.focus():this.element.focus(),this.hide());break;case"shiftTab":"datepicker"!==this.getModuleName()&&"datetimepicker"!==this.getModuleName()||e.target!==this.headerTitleElement||(e.preventDefault(),this.isAngular?this.inputElement.focus():this.element.focus(),this.hide());break;case"escape":"datepicker"!==this.getModuleName()&&"datetimepicker"!==this.getModuleName()||e.target!==this.headerTitleElement&&e.target!==this.previousIcon&&e.target!==this.nextIcon&&e.target!==this.todayElement||this.hide()}}},t.prototype.keyboardNavigate=function(e,t,s,a,n){var r=new Date(this.checkValue(this.currentDate));switch(t){case 2:this.addYears(this.currentDate,e),this.isMonthYearRange(this.currentDate)?((0,i.detach)(this.tableBodyElement),this.renderDecades(s)):this.currentDate=r;break;case 1:this.addMonths(this.currentDate,e),this.calendarMode,this.isMonthYearRange(this.currentDate)?((0,i.detach)(this.tableBodyElement),this.renderYears(s)):this.currentDate=r;break;case 0:this.addDay(this.currentDate,e,s,a,n),this.isMinMaxRange(this.currentDate)?((0,i.detach)(this.tableBodyElement),this.renderMonths(s)):this.currentDate=r}},t.prototype.preRender=function(e){var t=this;this.navigatePreviousHandler=this.navigatePrevious.bind(this),this.navigateNextHandler=this.navigateNext.bind(this),this.defaultKeyConfigs=this.getDefaultKeyConfig(),this.navigateHandler=function(e){t.triggerNavigate(e)}},t.prototype.minMaxDate=function(e){var t=new Date(new Date(+e).setHours(0,0,0,0)),i=new Date(new Date(+this.min).setHours(0,0,0,0)),s=new Date(new Date(+this.max).setHours(0,0,0,0));return+t!==+i&&+t!==+s||(+e<+this.min&&(e=new Date(+this.min)),+e>+this.max&&(e=new Date(+this.max))),e},t.prototype.renderMonths=function(e,t,s){var a,n=this.weekNumber?8:7;a="Gregorian"===this.calendarMode?this.renderDays(this.currentDate,t,null,null,s,e):(0,i.isNullOrUndefined)(this.islamicModule)?null:this.islamicModule.islamicRenderDays(this.currentDate,t),this.createContentHeader(),"Gregorian"===this.calendarMode?this.renderTemplate(a,n,c,e,t):(0,i.isNullOrUndefined)(this.islamicModule)||this.islamicModule.islamicRenderTemplate(a,n,c,e,t)},t.prototype.renderDays=function(e,t,s,a,r,l){var o,h=[],u=r?new Date(+e):this.getDate(new Date,this.timezone),d=new Date(this.checkValue(e)),p=d.getMonth();this.titleUpdate(e,"days");var c=d;for(d=new Date(c.getFullYear(),c.getMonth(),0,c.getHours(),c.getMinutes(),c.getSeconds(),c.getMilliseconds());d.getDay()!==this.firstDayOfWeek;)this.setStartDate(d,-864e5);for(var m=0;m<42;++m){var f=this.createElement("td",{className:w}),D=this.createElement("span");if(m%7==0&&this.weekNumber){var E="FirstDay"===this.weekRule?6:"FirstFourDayWeek"===this.weekRule?3:0,C=new Date(d.getFullYear(),d.getMonth(),d.getDate()+E);D.textContent=""+this.getWeek(C),f.appendChild(D),(0,i.addClass)([f],""+y),h.push(f)}o=new Date(+d),d=this.minMaxDate(d);var M={type:"dateTime",skeleton:"full"},V=this.globalize.parseDate(this.globalize.formatDate(d,M),M),O=this.dayCell(d),N=this.globalize.formatDate(d,{type:"date",skeleton:"full"}),I=this.createElement("span");I.textContent=this.globalize.formatDate(d,{format:"d",type:"date",skeleton:"yMd"});var T=this.min>d||this.max<d;T?((0,i.addClass)([O],v),(0,i.addClass)([O],g)):I.setAttribute("title",""+N),p!==d.getMonth()&&((0,i.addClass)([O],n),I.setAttribute("aria-disabled","true")),0!==d.getDay()&&6!==d.getDay()||(0,i.addClass)([O],"e-weekend"),O.appendChild(I),this.renderDayCellArgs={date:d,isDisabled:!1,element:O,isOutOfRange:T,currentView:this.currentView()};var x=this.renderDayCellArgs;if(this.renderDayCellEvent(x),x.isDisabled){var S=new Date(this.checkValue(t)),P=new Date(this.checkValue(x.date));if(s){if(!(0,i.isNullOrUndefined)(a)&&a.length>0)for(var A=0;A<a.length;A++){+new Date(this.globalize.formatDate(x.date,{type:"date",skeleton:"yMd"}))===+new Date(this.globalize.formatDate(a[A],{type:"date",skeleton:"yMd"}))&&(a.splice(A,1),A=-1)}}else S&&+S===+P&&this.setProperties({value:null},!0)}this.renderDayCellArgs.isDisabled&&!O.classList.contains(b)&&((0,i.addClass)([O],v),(0,i.addClass)([O],g),I.setAttribute("aria-disabled","true"),+this.renderDayCellArgs.date===+this.todayDate&&(this.todayDisabled=!0));var U=O.classList.contains(n),H=O.classList.contains(v);H||i.EventHandler.add(O,"click",this.clickHandler,this);var W=void 0;if((0,i.isNullOrUndefined)(l)||"click"!==l.type||(W=l.currentTarget),!s||(0,i.isNullOrUndefined)(a)||H)!H&&this.getDateVal(d,t)&&(0,i.addClass)([O],b);else{for(var F=0;F<a.length;F++){var L={format:null,type:"date",skeleton:"short",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"};if((this.globalize.formatDate(d,L)===this.globalize.formatDate(a[F],L)&&this.getDateVal(d,a[F])||this.getDateVal(d,t))&&(0,i.addClass)([O],b),!(0,i.isNullOrUndefined)(W)&&W.innerText===O.innerText&&this.previousDates&&O.classList.contains(b)&&W.classList.contains(b)){(0,i.removeClass)([O],b),this.previousDates=!1;for(var B=this.copyValues(a),j=0;j<B.length;j++){var Y={format:null,type:"date",skeleton:"short",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"};if(this.globalize.formatDate(V,Y)===this.globalize.formatDate(B[j],Y)){A=B.indexOf(B[j]);B.splice(A,1),a.splice(A,1)}}this.setProperties({values:B},!0)}else this.updateFocus(U,H,d,O,e)}a.length<=0&&this.updateFocus(U,H,d,O,e)}this.updateFocus(U,H,d,O,e),(0,i.isNullOrUndefined)(V)||V.getFullYear()!==u.getFullYear()||V.getMonth()!==u.getMonth()||V.getDate()!==u.getDate()||(0,i.addClass)([O],k),h.push(this.renderDayCellArgs.element),d=new Date(+o),this.addDay(d,1,null,this.max,this.min)}return h},t.prototype.updateFocus=function(e,t,s,a,n){n.getDate()!==s.getDate()||e||t?(n>=this.max&&parseInt(a.id,0)===+this.max&&!e&&!t&&(0,i.addClass)([a],D),n<=this.min&&parseInt(a.id,0)===+this.min&&!e&&!t&&(0,i.addClass)([a],D)):(0,i.addClass)([a],D)},t.prototype.renderYears=function(e,t){this.removeTableHeadElement();var s=[],a=(0,i.isNullOrUndefined)(t),n=new Date(this.checkValue(this.currentDate)),r=n.getMonth(),l=n.getFullYear(),o=n,h=o.getFullYear(),u=new Date(this.checkValue(this.min)).getFullYear(),d=new Date(this.checkValue(this.min)).getMonth(),c=new Date(this.checkValue(this.max)).getFullYear(),m=new Date(this.checkValue(this.max)).getMonth();o.setMonth(0),this.titleUpdate(this.currentDate,"months"),o.setDate(1);for(var f=0;f<12;++f){var g=this.dayCell(o),y=this.createElement("span"),E=t&&t.getMonth()===o.getMonth(),C=t&&t.getFullYear()===l&&E,k=this.globalize.formatDate(o,{type:"date",format:"MMM y"});y.textContent=this.toCapitalize(this.globalize.formatDate(o,{format:null,type:"dateTime",skeleton:"MMM"})),this.min&&(h<u||f<d&&h===u)||this.max&&(h>c||f>m&&h>=c)?(0,i.addClass)([g],v):!a&&C?(0,i.addClass)([g],b):o.getMonth()===r&&this.currentDate.getMonth()===r&&(0,i.addClass)([g],D),o.setDate(1),o.setMonth(o.getMonth()+1),g.classList.contains(v)||(i.EventHandler.add(g,"click",this.clickHandler,this),y.setAttribute("title",""+k)),g.appendChild(y),s.push(g)}this.renderTemplate(s,4,p,e,t)},t.prototype.renderDecades=function(e,t){this.removeTableHeadElement();var s=[],a=new Date(this.checkValue(this.currentDate));a.setMonth(0),a.setDate(1);var n=a.getFullYear(),l=new Date(a.setFullYear(n-n%10)),o=new Date(a.setFullYear(n-n%10+9)),h=l.getFullYear(),u=o.getFullYear(),d=this.globalize.formatDate(l,{format:null,type:"dateTime",skeleton:"y"}),p=this.globalize.formatDate(o,{format:null,type:"dateTime",skeleton:"y"});this.headerTitleElement.textContent=d+" - "+p;for(var c=new Date(n-n%10-1,0,1).getFullYear(),m=0;m<12;++m){var f=c+m;a.setFullYear(f);var g=this.dayCell(a),y=this.createElement("span");y.textContent=this.globalize.formatDate(a,{format:null,type:"dateTime",skeleton:"y"}),f<h||f>u?((0,i.addClass)([g],r),y.setAttribute("aria-disabled","true"),(0,i.isNullOrUndefined)(t)||a.getFullYear()!==t.getFullYear()||(0,i.addClass)([g],b),(f<new Date(this.checkValue(this.min)).getFullYear()||f>new Date(this.checkValue(this.max)).getFullYear())&&(0,i.addClass)([g],v)):f<new Date(this.checkValue(this.min)).getFullYear()||f>new Date(this.checkValue(this.max)).getFullYear()?(0,i.addClass)([g],v):(0,i.isNullOrUndefined)(t)||a.getFullYear()!==t.getFullYear()?a.getFullYear()!==this.currentDate.getFullYear()||g.classList.contains(v)||(0,i.addClass)([g],D):(0,i.addClass)([g],b),g.classList.contains(v)||(i.EventHandler.add(g,"click",this.clickHandler,this),y.setAttribute("title",""+y.textContent)),g.appendChild(y),s.push(g)}this.renderTemplate(s,4,"e-decade",e,t)},t.prototype.dayCell=function(e){var t,s={skeleton:"full",type:"dateTime",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"},a=this.globalize.parseDate(this.globalize.formatDate(e,s),s);(0,i.isNullOrUndefined)(a)||(t=a.valueOf());var n={className:w,attrs:{id:""+(0,i.getUniqueID)(""+t)}};return this.createElement("td",n)},t.prototype.firstDay=function(e){var t="Decade"!==this.currentView()?this.tableBodyElement.querySelectorAll("td:not(."+n+"):not(."+y+")"):this.tableBodyElement.querySelectorAll("td:not(."+r);if(t.length)for(var i=0;i<t.length;i++)if(!t[i].classList.contains(v)){e=new Date(parseInt(t[i].id,0));break}return e},t.prototype.lastDay=function(e,t){var i=new Date(e.getFullYear(),e.getMonth()+1,0);if(2!==t){var s=Math.abs(i.getTimezoneOffset()-this.firstDay(e).getTimezoneOffset());return s&&i.setHours(this.firstDay(e).getHours()+s/60),this.findLastDay(i)}return this.findLastDay(this.firstDay(i))},t.prototype.checkDateValue=function(e){return!(0,i.isNullOrUndefined)(e)&&e instanceof Date&&!isNaN(+e)?e:null},t.prototype.findLastDay=function(e){var t="Decade"===this.currentView()?this.tableBodyElement.querySelectorAll("td:not(."+r):this.tableBodyElement.querySelectorAll("td:not(."+n+"):not(."+y+")");if(t.length)for(var i=t.length-1;i>=0;i--)if(!t[i].classList.contains(v)){e=new Date(parseInt(t[i].id,0));break}return e},t.prototype.removeTableHeadElement=function(){"calendar"===this.getModuleName()?(0,i.isNullOrUndefined)(this.element.querySelectorAll(".e-content table thead")[0])||(0,i.detach)(this.tableHeadElement):(0,i.isNullOrUndefined)(this.calendarElement.querySelectorAll(".e-content table thead")[0])||(0,i.detach)(this.tableHeadElement)},t.prototype.renderTemplate=function(e,t,s,a,r){var l,o=this.getViewNumber(this.currentView());this.tableBodyElement=this.createElement("tbody"),this.table.appendChild(this.tableBodyElement),(0,i.removeClass)([this.contentElement,this.headerElement],[c,m,p]),(0,i.addClass)([this.contentElement,this.headerElement],[s]);for(var h=t,u=0,d=0;d<e.length/t;++d){for(l=this.createElement("tr"),u=0+u;u<h;u++)e[u].classList.contains("e-week-number")||(0,i.isNullOrUndefined)(e[u].children[0])||((0,i.addClass)([e[u].children[0]],[M]),(0,i.rippleEffect)(e[u].children[0],{duration:600,isCenterRipple:!0})),l.appendChild(e[u]),this.weekNumber&&7===u&&e[7].classList.contains(n)&&(0,i.addClass)([l],C),!this.weekNumber&&6===u&&e[6].classList.contains(n)&&(0,i.addClass)([l],C),this.weekNumber?41===u&&e[41].classList.contains(n)&&(0,i.addClass)([l],C):35===u&&e[35].classList.contains(n)&&(0,i.addClass)([l],C);h+=t,u+=0,this.tableBodyElement.appendChild(l)}this.table.querySelector("tbody").className=this.effect,"Gregorian"===this.calendarMode?this.iconHandler():this.islamicModule.islamicIconHandler(),(o!==this.getViewNumber(this.currentView())||0===o&&o!==this.getViewNumber(this.currentView()))&&this.navigateHandler(a),this.setAriaActiveDescendant()},t.prototype.clickHandler=function(e,t){this.clickEventEmitter(e);var i=e.currentTarget,s=this.getViewNumber(this.currentView());i.classList.contains(n)?this.contentClick(e,0,null,t):s===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth)||2===s?this.contentClick(e,1,null,t):i.classList.contains(n)||0!==s?this.contentClick(e,0,i,t):this.selectDate(e,this.getIdValue(e,null),null),"calendar"===this.getModuleName()&&this.table.focus()},t.prototype.clickEventEmitter=function(e){e.preventDefault()},t.prototype.contentClick=function(e,t,s,a){var n=this.getViewNumber(this.currentView()),r=this.getIdValue(e,s);switch(t){case 0:n===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth)?((0,i.detach)(this.tableBodyElement),this.currentDate=r,this.effect=V,this.renderMonths(e)):("Gregorian"===this.calendarMode?(this.currentDate.setMonth(r.getMonth()),r.getMonth()>0&&this.currentDate.getMonth()!==r.getMonth()&&this.currentDate.setDate(0),this.currentDate.setFullYear(r.getFullYear())):this.currentDate=r,this.effect=V,(0,i.detach)(this.tableBodyElement),this.renderMonths(e));break;case 1:if(n===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth))this.selectDate(e,r,null);else{if("Gregorian"===this.calendarMode)this.currentDate.setFullYear(r.getFullYear());else{this.islamicPreviousHeader=this.headerElement.textContent;var l=this.islamicModule.getIslamicDate(r);this.currentDate=this.islamicModule.toGregorian(l.year,l.month,1)}this.effect=V,(0,i.detach)(this.tableBodyElement),this.renderYears(e)}}},t.prototype.switchView=function(e,t,s,a){switch(e){case 0:(0,i.detach)(this.tableBodyElement),this.renderMonths(t,null,a);break;case 1:(0,i.detach)(this.tableBodyElement),this.renderYears(t);break;case 2:(0,i.detach)(this.tableBodyElement),this.renderDecades(t)}},t.prototype.getModuleName=function(){return"calendar"},t.prototype.requiredModules=function(){var e=[];return"Islamic"===this.calendarMode&&e.push({args:[this],member:"islamic",name:"Islamic"}),e},t.prototype.getPersistData=function(){return this.addOnPersist(["value"])},t.prototype.onPropertyChanged=function(e,t,s,a){this.effect="";for(var n=0,r=Object.keys(e);n<r.length;n++){var l=r[n];switch(l){case"enableRtl":e.enableRtl?"calendar"===this.getModuleName()?this.element.classList.add("e-rtl"):this.calendarElement.classList.add("e-rtl"):"calendar"===this.getModuleName()?this.element.classList.remove("e-rtl"):this.calendarElement.classList.remove("e-rtl");break;case"dayHeaderFormat":this.getCultureValues(),("datepicker"!==this.getModuleName()||this.calendarElement)&&this.createContentHeader(),this.adjustLongHeaderSize();break;case"min":case"max":this.rangeValidation(this.min,this.max),"min"===l?this.setProperties({min:this.checkDateValue(new Date(this.checkValue(e.min)))},!0):this.setProperties({max:this.checkDateValue(new Date(this.checkValue(e.max)))},!0),this.setProperties({start:this.currentView()},!0),this.tableBodyElement&&(0,i.detach)(this.tableBodyElement),this.minMaxUpdate(),s&&this.validateValues(s,a),("datepicker"!==this.getModuleName()||this.calendarElement)&&this.createContentBody(),(this.todayDate<this.min||this.max<this.todayDate)&&this.footer&&this.todayElement?((0,i.detach)(this.todayElement),(0,i.detach)(this.footer),this.todayElement=this.footer=null,this.createContentFooter()):this.footer&&this.todayElement&&this.todayElement.classList.contains("e-disabled")&&((0,i.removeClass)([this.todayElement],v),(0,i.detach)(this.todayElement),(0,i.detach)(this.footer),this.todayElement=this.footer=null,this.createContentFooter());break;case"start":case"depth":case"weekNumber":case"firstDayOfWeek":case"weekRule":this.checkView(),("datepicker"!==this.getModuleName()||this.calendarElement)&&(this.createContentHeader(),this.createContentBody());break;case"locale":if(this.globalize=new i.Internationalization(this.locale),("datepicker"!==this.getModuleName()||this.calendarElement)&&(this.createContentHeader(),this.createContentBody()),"calendar"===this.getModuleName()){this.l10=new i.L10n(this.getModuleName(),{today:"Today"},this.locale)}this.l10.setLocale(this.locale),this.showTodayButton&&this.updateFooter();break;case"showTodayButton":e.showTodayButton?this.createContentFooter():(0,i.isNullOrUndefined)(this.todayElement)||(0,i.isNullOrUndefined)(this.footer)||((0,i.detach)(this.todayElement),(0,i.detach)(this.footer),this.todayElement=this.footer=void 0),this.setProperties({showTodayButton:e.showTodayButton},!0)}}},t.prototype.validateValues=function(e,t){if(e&&!(0,i.isNullOrUndefined)(t)&&t.length>0){for(var s=this.copyValues(t),a=0;a<s.length;a++){var n=s[a],r="Gregorian"===this.calendarMode?"gregorian":"islamic",l=void 0,o=void 0,h=void 0;"Gregorian"===this.calendarMode?(l={type:"date",skeleton:"yMd"},o=this.globalize.formatDate(n,l),h=this.globalize.parseDate(o,l)):(l={type:"date",skeleton:"yMd",calendar:"islamic"},o=this.globalize.formatDate(n,l),h=this.globalize.parseDate(o,l));var u={type:"date",skeleton:"yMd",calendar:r},d=this.globalize.formatDate(this.min,u),p={type:"date",skeleton:"yMd",calendar:r},c=this.globalize.formatDate(this.max,p),m=this.globalize.parseDate(d,u),f=this.globalize.parseDate(c,p);(+h<+m||+h>+f)&&(s.splice(a,1),a=-1)}this.setProperties({values:s},!0)}},t.prototype.setValueUpdate=function(){(0,i.isNullOrUndefined)(this.tableBodyElement)||((0,i.detach)(this.tableBodyElement),this.setProperties({start:this.currentView()},!0),this.createContentBody())},t.prototype.copyValues=function(e){var t=[];if(!(0,i.isNullOrUndefined)(e)&&e.length>0)for(var s=0;s<e.length;s++)t.push(new Date(+e[s]));return t},t.prototype.titleUpdate=function(e,t){var s,a,n=new i.Internationalization(this.locale),r="Gregorian"===this.calendarMode?"gregorian":"islamic";switch("Gregorian"===this.calendarMode?(s=n.formatDate(e,{type:"dateTime",skeleton:"yMMMM",calendar:r}),a=n.formatDate(e,{format:null,type:"dateTime",skeleton:"y",calendar:r})):(s=n.formatDate(e,{type:"dateTime",format:"MMMM y",calendar:r}),a=n.formatDate(e,{type:"dateTime",format:"y",calendar:r})),t){case"days":this.headerTitleElement.textContent=this.toCapitalize(s);break;case"months":this.headerTitleElement.textContent=a}},t.prototype.setActiveDescendant=function(){var e,t,s=this.tableBodyElement.querySelector("tr td.e-focused-date"),a=this.tableBodyElement.querySelector("tr td.e-selected"),n="Gregorian"===this.calendarMode?"gregorian":"islamic",r=this.currentView();return t="Month"===r?this.globalize.formatDate(this.currentDate,{type:"date",skeleton:"full",calendar:n}):"Year"===r?"islamic"!==n?this.globalize.formatDate(this.currentDate,{type:"date",skeleton:"yMMMM",calendar:n}):this.globalize.formatDate(this.currentDate,{type:"date",skeleton:"GyMMM",calendar:n}):this.globalize.formatDate(this.currentDate,{format:null,type:"date",skeleton:"y",calendar:n}),(a||s)&&((0,i.isNullOrUndefined)(a)||a.setAttribute("aria-selected","true"),(s||a).setAttribute("aria-label",t),e=(s||a).getAttribute("id")),e},t.prototype.iconHandler=function(){switch(new Date(this.checkValue(this.currentDate)).setDate(1),this.currentView()){case"Month":this.previousIconHandler(this.compareMonth(new Date(this.checkValue(this.currentDate)),this.min)<1),this.nextIconHandler(this.compareMonth(new Date(this.checkValue(this.currentDate)),this.max)>-1);break;case"Year":this.previousIconHandler(this.compareYear(new Date(this.checkValue(this.currentDate)),this.min)<1),this.nextIconHandler(this.compareYear(new Date(this.checkValue(this.currentDate)),this.max)>-1);break;case"Decade":this.previousIconHandler(this.compareDecade(new Date(this.checkValue(this.currentDate)),this.min)<1),this.nextIconHandler(this.compareDecade(new Date(this.checkValue(this.currentDate)),this.max)>-1)}},t.prototype.destroy=function(){("calendar"===this.getModuleName()&&this.element||this.calendarElement&&this.element)&&(0,i.removeClass)([this.element],[h]),"calendar"===this.getModuleName()&&this.element&&((0,i.isNullOrUndefined)(this.headerTitleElement)||i.EventHandler.remove(this.headerTitleElement,"click",this.navigateTitle),this.todayElement&&i.EventHandler.remove(this.todayElement,"click",this.todayButtonClick),this.previousIconHandler(!0),this.nextIconHandler(!0),this.keyboardModule.destroy(),this.element.removeAttribute("data-role"),(0,i.isNullOrUndefined)(this.calendarEleCopy.getAttribute("tabindex"))?this.element.removeAttribute("tabindex"):this.element.setAttribute("tabindex",this.tabIndex)),this.element&&(this.element.innerHTML=""),this.todayElement=null,this.tableBodyElement=null,this.todayButtonEvent=null,this.renderDayCellArgs=null,this.headerElement=null,this.nextIcon=null,this.table=null,this.tableHeadElement=null,this.previousIcon=null,this.headerTitleElement=null,this.footer=null,this.contentElement=null,e.prototype.destroy.call(this)},t.prototype.title=function(e){var t=this.getViewNumber(this.currentView());this.effect=V,this.switchView(++t,e)},t.prototype.getViewNumber=function(e){return"Month"===e?0:"Year"===e?1:2},t.prototype.navigateTitle=function(e){e.preventDefault(),this.title(e)},t.prototype.previous=function(){this.effect="";var e=this.getViewNumber(this.currentView());switch(this.currentView()){case"Month":this.addMonths(this.currentDate,-1),this.switchView(e);break;case"Year":this.addYears(this.currentDate,-1),this.switchView(e);break;case"Decade":this.addYears(this.currentDate,-10),this.switchView(e)}},t.prototype.navigatePrevious=function(e){!i.Browser.isDevice&&e.preventDefault(),"Gregorian"===this.calendarMode?this.previous():this.islamicModule.islamicPrevious(),this.triggerNavigate(e)},t.prototype.next=function(){this.effect="";var e=this.getViewNumber(this.currentView());switch(this.currentView()){case"Month":this.addMonths(this.currentDate,1),this.switchView(e);break;case"Year":this.addYears(this.currentDate,1),this.switchView(e);break;case"Decade":this.addYears(this.currentDate,10),this.switchView(e)}},t.prototype.navigateNext=function(e){!i.Browser.isDevice&&e.preventDefault(),"Gregorian"===this.calendarMode?this.next():this.islamicModule.islamicNext(),this.triggerNavigate(e)},t.prototype.navigateTo=function(e,t,i){+t>=+this.min&&+t<=+this.max&&(this.currentDate=t),+t<=+this.min&&(this.currentDate=new Date(this.checkValue(this.min))),+t>=+this.max&&(this.currentDate=new Date(this.checkValue(this.max))),this.getViewNumber(this.depth)>=this.getViewNumber(e)&&(this.getViewNumber(this.depth)<=this.getViewNumber(this.start)||this.getViewNumber(this.depth)===this.getViewNumber(e))&&(e=this.depth),this.switchView(this.getViewNumber(e),null,null,i)},t.prototype.currentView=function(){return!(0,i.isNullOrUndefined)(this.contentElement)&&this.contentElement.classList.contains(p)?"Year":!(0,i.isNullOrUndefined)(this.contentElement)&&this.contentElement.classList.contains(m)?"Decade":"Month"},t.prototype.getDateVal=function(e,t){return!(0,i.isNullOrUndefined)(t)&&e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()},t.prototype.getCultureObjects=function(e,t){var s=(0,i.isNullOrUndefined)(this.dayHeaderFormat)?null:".dates.calendars.gregorian.days.format."+this.dayHeaderFormat.toLowerCase(),a=(0,i.isNullOrUndefined)(this.dayHeaderFormat)?null:".dates.calendars.islamic.days.format."+this.dayHeaderFormat.toLowerCase();return"Gregorian"===this.calendarMode?(0,i.getValue)("main."+this.locale+s,e):(0,i.getValue)("main."+this.locale+a,e)},t.prototype.getWeek=function(e){var t=new Date(this.checkValue(e)).valueOf(),i=new Date(e.getFullYear(),0,1).valueOf();return Math.ceil((t-i+N)/N/7)},t.prototype.setStartDate=function(e,t){var i=e.getTimezoneOffset(),s=new Date(e.getTime()+t),a=s.getTimezoneOffset()-i;e.setTime(s.getTime()+6e4*a)},t.prototype.addMonths=function(e,t){if("Gregorian"===this.calendarMode){var i=e.getDate();e.setDate(1),e.setMonth(e.getMonth()+t),e.setDate(Math.min(i,this.getMaxDays(e)))}else{var s=this.islamicModule.getIslamicDate(e);this.currentDate=this.islamicModule.toGregorian(s.year,s.month+t,1)}},t.prototype.addYears=function(e,t){if("Gregorian"===this.calendarMode){var i=e.getDate();e.setDate(1),e.setFullYear(e.getFullYear()+t),e.setDate(Math.min(i,this.getMaxDays(e)))}else{var s=this.islamicModule.getIslamicDate(e);this.currentDate=this.islamicModule.toGregorian(s.year+t,s.month,1)}},t.prototype.getIdValue=function(e,t){var i;i=e?e.currentTarget:t;var s={type:"dateTime",skeleton:"full",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"},a=this.globalize.formatDate(new Date(parseInt(""+i.getAttribute("id"),0)),s),n=this.globalize.parseDate(a,s),r=n.valueOf()-n.valueOf()%1e3;return new Date(r)},t.prototype.adjustLongHeaderSize=function(){(0,i.removeClass)([this.element],O),"Wide"===this.dayHeaderFormat&&(0,i.addClass)(["calendar"===this.getModuleName()?this.element:this.calendarElement],O)},t.prototype.selectDate=function(e,t,s,a,n){var r=s||e.currentTarget;if(this.isDateSelected=!1,"Decade"===this.currentView())this.setDateDecade(this.currentDate,t.getFullYear());else if("Year"===this.currentView())this.setDateYear(this.currentDate,t);else{if(a&&!this.checkPresentDate(t,n)){var l=this.copyValues(n);!(0,i.isNullOrUndefined)(n)&&l.length>0?(l.push(new Date(this.checkValue(t))),this.setProperties({values:l},!0),this.setProperties({value:n[n.length-1]},!0)):this.setProperties({values:[new Date(this.checkValue(t))]},!0)}else this.setProperties({value:new Date(this.checkValue(t))},!0);this.currentDate=new Date(this.checkValue(t))}var o=(0,i.closest)(r,"."+h);if((0,i.isNullOrUndefined)(o)&&(o=this.tableBodyElement),a||(0,i.isNullOrUndefined)(o.querySelector("."+b))||(0,i.removeClass)([o.querySelector("."+b)],b),a||(0,i.isNullOrUndefined)(o.querySelector("."+D))||(0,i.removeClass)([o.querySelector("."+D)],D),a||(0,i.isNullOrUndefined)(o.querySelector("."+E))||(0,i.removeClass)([o.querySelector("."+E)],E),a){l=this.copyValues(n);for(var u=Array.prototype.slice.call(this.tableBodyElement.querySelectorAll("td")),d=0;d<u.length;d++){var p=o.querySelectorAll("td."+D)[0],c=o.querySelectorAll("td."+b)[0];u[d]===p&&(0,i.removeClass)([u[d]],D),u[d]!==c||this.checkPresentDate(new Date(parseInt(c.getAttribute("id").split("_")[0],10)),n)||(0,i.removeClass)([u[d]],b)}if(r.classList.contains(b)){(0,i.removeClass)([r],b);for(var m=0;m<l.length;m++){var f={format:null,type:"date",skeleton:"short",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"};if(this.globalize.formatDate(t,f)===this.globalize.formatDate(l[m],f)){d=l.indexOf(l[m]);l.splice(d,1),(0,i.addClass)([r],D)}}this.setProperties({values:l},!0)}else(0,i.addClass)([r],b)}else(0,i.addClass)([r],b);this.isDateSelected=!0},t.prototype.checkPresentDate=function(e,t){var s=!1;if(!(0,i.isNullOrUndefined)(t))for(var a=0;a<t.length;a++){var n="Gregorian"===this.calendarMode?"gregorian":"islamic";this.globalize.formatDate(e,{format:null,type:"date",skeleton:"short",calendar:n})===this.globalize.formatDate(t[a],{format:null,type:"date",skeleton:"short",calendar:n})&&(s=!0)}return s},t.prototype.setAriaActiveDescendant=function(){(0,i.attributes)(this.table,{"aria-activedescendant":""+this.setActiveDescendant()})},t.prototype.previousIconHandler=function(e){e?(0,i.isNullOrUndefined)(this.previousIcon)||(i.EventHandler.remove(this.previousIcon,"click",this.navigatePreviousHandler),(0,i.addClass)([this.previousIcon],""+v),(0,i.addClass)([this.previousIcon],""+g),this.previousIcon.setAttribute("aria-disabled","true")):(i.EventHandler.add(this.previousIcon,"click",this.navigatePreviousHandler),(0,i.removeClass)([this.previousIcon],""+v),(0,i.removeClass)([this.previousIcon],""+g),this.previousIcon.setAttribute("aria-disabled","false"))},t.prototype.renderDayCellEvent=function(e){(0,i.extend)(this.renderDayCellArgs,{name:"renderDayCell"}),this.trigger("renderDayCell",e)},t.prototype.navigatedEvent=function(e){(0,i.extend)(this.navigatedArgs,{name:"navigated",event:e}),this.trigger("navigated",this.navigatedArgs)},t.prototype.triggerNavigate=function(e){this.navigatedArgs={view:this.currentView(),date:this.currentDate},this.navigatedEvent(e)},t.prototype.nextIconHandler=function(e){e?(0,i.isNullOrUndefined)(this.previousIcon)||(i.EventHandler.remove(this.nextIcon,"click",this.navigateNextHandler),(0,i.addClass)([this.nextIcon],v),(0,i.addClass)([this.nextIcon],g),this.nextIcon.setAttribute("aria-disabled","true")):(i.EventHandler.add(this.nextIcon,"click",this.navigateNextHandler),(0,i.removeClass)([this.nextIcon],v),(0,i.removeClass)([this.nextIcon],g),this.nextIcon.setAttribute("aria-disabled","false"))},t.prototype.compare=function(e,t,i){var s,a,n=t.getFullYear();return s=n,a=0,i&&(s=(n-=n%i)-n%i+i-1),e.getFullYear()>s?a=1:e.getFullYear()<n&&(a=-1),a},t.prototype.isMinMaxRange=function(e){return+e>=+this.min&&+e<=+this.max},t.prototype.isMonthYearRange=function(e){if("Gregorian"===this.calendarMode)return e.getMonth()>=this.min.getMonth()&&e.getFullYear()>=this.min.getFullYear()&&e.getMonth()<=this.max.getMonth()&&e.getFullYear()<=this.max.getFullYear();var t=this.islamicModule.getIslamicDate(e);return t.month>=this.islamicModule.getIslamicDate(new Date(1941,12,18)).month&&t.year>=this.islamicModule.getIslamicDate(new Date(1941,12,18)).year&&t.month<=this.islamicModule.getIslamicDate(new Date(2068,2,4)).month&&t.year<=this.islamicModule.getIslamicDate(new Date(2068,2,4)).year},t.prototype.compareYear=function(e,t){return this.compare(e,t,0)},t.prototype.compareDecade=function(e,t){return this.compare(e,t,10)},t.prototype.shiftArray=function(e,t){return e.slice(t).concat(e.slice(0,t))},t.prototype.addDay=function(e,t,s,a,n){var r=t,l=new Date(+e);if(!(0,i.isNullOrUndefined)(this.tableBodyElement)&&!(0,i.isNullOrUndefined)(s)){for(;this.findNextTD(new Date(+e),r,a,n);)r+=t;var o=new Date(l.setDate(l.getDate()+r));r=+o>+a||+o<+n?r===t?t-t:t:r}e.setDate(e.getDate()+r)},t.prototype.findNextTD=function(e,t,s,a){var n=new Date(e.setDate(e.getDate()+t)),r=[],l=!1;if((!(0,i.isNullOrUndefined)(n)&&n.getMonth())===(!(0,i.isNullOrUndefined)(this.currentDate)&&this.currentDate.getMonth())){r=("Gregorian"===this.calendarMode?this.renderDays(n):this.islamicModule.islamicRenderDays(this.currentDate,n)).filter(function(e){return e.classList.contains(v)})}else r=this.tableBodyElement.querySelectorAll("td."+v);if(+n<=+s&&+n>=+a&&r.length)for(var o=0;o<r.length&&!(l=+n===+new Date(parseInt(r[o].id,0)));o++);return l},t.prototype.getMaxDays=function(e){var t,i=new Date(this.checkValue(e));t=28;for(var s=i.getMonth();i.getMonth()===s;)++t,i.setDate(t);return t-1},t.prototype.setDateDecade=function(e,t){e.setFullYear(t),this.setProperties({value:new Date(this.checkValue(e))},!0)},t.prototype.setDateYear=function(e,t){e.setFullYear(t.getFullYear(),t.getMonth(),e.getDate()),t.getMonth()!==e.getMonth()&&(e.setDate(0),this.currentDate=new Date(this.checkValue(t))),this.setProperties({value:new Date(this.checkValue(e))},!0)},t.prototype.compareMonth=function(e,t){return e.getFullYear()>t.getFullYear()?1:e.getFullYear()<t.getFullYear()?-1:e.getMonth()===t.getMonth()?0:e.getMonth()>t.getMonth()?1:-1},t.prototype.checkValue=function(e){return e instanceof Date?e.toUTCString():""+e},t.prototype.checkView=function(){"Decade"!==this.start&&"Year"!==this.start&&this.setProperties({start:"Month"},!0),"Decade"!==this.depth&&"Year"!==this.depth&&this.setProperties({depth:"Month"},!0),this.getViewNumber(this.depth)>this.getViewNumber(this.start)&&this.setProperties({depth:"Month"},!0)},t.prototype.getDate=function(e,t){return t&&(e=new Date(e.toLocaleString("en-US",{timeZone:t}))),e},a([(0,i.Property)(new Date(1900,0,1))],t.prototype,"min",void 0),a([(0,i.Property)(!0)],t.prototype,"enabled",void 0),a([(0,i.Property)(null)],t.prototype,"cssClass",void 0),a([(0,i.Property)(new Date(2099,11,31))],t.prototype,"max",void 0),a([(0,i.Property)(null)],t.prototype,"firstDayOfWeek",void 0),a([(0,i.Property)("Gregorian")],t.prototype,"calendarMode",void 0),a([(0,i.Property)("Month")],t.prototype,"start",void 0),a([(0,i.Property)("Month")],t.prototype,"depth",void 0),a([(0,i.Property)(!1)],t.prototype,"weekNumber",void 0),a([(0,i.Property)("FirstDay")],t.prototype,"weekRule",void 0),a([(0,i.Property)(!0)],t.prototype,"showTodayButton",void 0),a([(0,i.Property)("Short")],t.prototype,"dayHeaderFormat",void 0),a([(0,i.Property)(!1)],t.prototype,"enablePersistence",void 0),a([(0,i.Property)(null)],t.prototype,"keyConfigs",void 0),a([(0,i.Property)(null)],t.prototype,"serverTimezoneOffset",void 0),a([(0,i.Event)()],t.prototype,"created",void 0),a([(0,i.Event)()],t.prototype,"destroyed",void 0),a([(0,i.Event)()],t.prototype,"navigated",void 0),a([(0,i.Event)()],t.prototype,"renderDayCell",void 0),t=a([i.NotifyPropertyChanges],t)}(i.Component),T=function(e){function t(t,i){return e.call(this,t,i)||this}return s(t,e),t.prototype.render=function(){if("Islamic"===this.calendarMode&&void 0===this.islamicModule&&(0,i.throwError)("Requires the injectable Islamic modules to render Calendar in Islamic mode"),this.isMultiSelection&&"object"==typeof this.values&&!(0,i.isNullOrUndefined)(this.values)&&this.values.length>0){for(var t=[],s=[],a=0;a<this.values.length;a++)-1===t.indexOf(+this.values[a])&&(t.push(+this.values[a]),s.push(this.values[a]));this.setProperties({values:s},!0);for(var n=0;n<this.values.length;n++)if(!this.checkDateValue(this.values[n]))if("string"==typeof this.values[n]&&this.checkDateValue(new Date(this.checkValue(this.values[n])))){var r=new Date(this.checkValue(this.values[n]));this.values.splice(n,1),this.values.splice(n,0,r)}else this.values.splice(n,1);this.setProperties({value:this.values[this.values.length-1]},!0),this.previousValues=this.values.length}if(this.validateDate(),this.minMaxUpdate(),"calendar"===this.getModuleName()&&(this.setEnable(this.enabled),this.setClass(this.cssClass)),e.prototype.render.call(this),"calendar"===this.getModuleName()){var l=(0,i.closest)(this.element,"form");l&&i.EventHandler.add(l,"reset",this.formResetHandler.bind(this)),this.setTimeZone(this.serverTimezoneOffset)}this.renderComplete()},t.prototype.setEnable=function(e){e?(0,i.removeClass)([this.element],v):(0,i.addClass)([this.element],v)},t.prototype.setClass=function(e,t){(0,i.isNullOrUndefined)(t)||(t=t.replace(/\s+/g," ").trim()),(0,i.isNullOrUndefined)(e)||(e=e.replace(/\s+/g," ").trim()),(0,i.isNullOrUndefined)(t)||""===t||(0,i.removeClass)([this.element],t.split(" ")),(0,i.isNullOrUndefined)(e)||(0,i.addClass)([this.element],e.split(" "))},t.prototype.isDayLightSaving=function(){var e=new Date(this.value.getFullYear(),6,1).getTimezoneOffset(),t=new Date(this.value.getFullYear(),0,1).getTimezoneOffset();return this.value.getTimezoneOffset()<Math.max(t,e)},t.prototype.setTimeZone=function(e){if(!(0,i.isNullOrUndefined)(this.serverTimezoneOffset)&&this.value){var t=e+(new Date).getTimezoneOffset()/60;t=this.isDayLightSaving()?t--:t,this.value=new Date(this.value.getTime()+60*t*60*1e3)}},t.prototype.formResetHandler=function(){this.setProperties({value:null},!0)},t.prototype.validateDate=function(){"string"==typeof this.value&&this.setProperties({value:this.checkDateValue(new Date(this.checkValue(this.value)))},!0),e.prototype.validateDate.call(this,this.value),!(0,i.isNullOrUndefined)(this.value)&&this.min<=this.max&&this.value>=this.min&&this.value<=this.max&&(this.currentDate=new Date(this.checkValue(this.value))),isNaN(+this.value)&&this.setProperties({value:null},!0)},t.prototype.minMaxUpdate=function(){"calendar"===this.getModuleName()&&(!(0,i.isNullOrUndefined)(this.value)&&this.value<=this.min&&this.min<=this.max?(this.setProperties({value:this.min},!0),this.changedArgs={value:this.value}):!(0,i.isNullOrUndefined)(this.value)&&this.value>=this.max&&this.min<=this.max&&(this.setProperties({value:this.max},!0),this.changedArgs={value:this.value})),"calendar"===this.getModuleName()||(0,i.isNullOrUndefined)(this.value)?e.prototype.minMaxUpdate.call(this,this.value):!(0,i.isNullOrUndefined)(this.value)&&this.value<this.min&&this.min<=this.max?e.prototype.minMaxUpdate.call(this,this.min):!(0,i.isNullOrUndefined)(this.value)&&this.value>this.max&&this.min<=this.max&&e.prototype.minMaxUpdate.call(this,this.max)},t.prototype.generateTodayVal=function(t){var s=new Date;return(0,i.isNullOrUndefined)(this.timezone)||(s=e.prototype.getDate.call(this,s,this.timezone)),t&&(0,i.isNullOrUndefined)(this.timezone)?(s.setHours(t.getHours()),s.setMinutes(t.getMinutes()),s.setSeconds(t.getSeconds()),s.setMilliseconds(t.getMilliseconds())):s=new Date(s.getFullYear(),s.getMonth(),s.getDate(),0,0,0,0),s},t.prototype.todayButtonClick=function(t){if(this.showTodayButton){var i=this.generateTodayVal(this.value);if(this.setProperties({value:i},!0),this.isTodayClicked=!0,this.todayButtonEvent=t,this.isMultiSelection){var s=this.copyValues(this.values);e.prototype.checkPresentDate.call(this,i,this.values)||(s.push(i),this.setProperties({values:s}))}e.prototype.todayButtonClick.call(this,t,new Date(+this.value))}},t.prototype.keyActionHandle=function(t){e.prototype.keyActionHandle.call(this,t,this.value,this.isMultiSelection)},t.prototype.preRender=function(){var t=this;this.changeHandler=function(e){t.triggerChange(e)},this.checkView(),e.prototype.preRender.call(this,this.value)},t.prototype.createContent=function(){this.previousDate=this.value,this.previousDateTime=this.value,e.prototype.createContent.call(this)},t.prototype.minMaxDate=function(t){return e.prototype.minMaxDate.call(this,t)},t.prototype.renderMonths=function(t,i,s){e.prototype.renderMonths.call(this,t,this.value,s)},t.prototype.renderDays=function(t,i,s,a,n,r){var l=e.prototype.renderDays.call(this,t,this.value,this.isMultiSelection,this.values,n,r);return this.isMultiSelection&&e.prototype.validateValues.call(this,this.isMultiSelection,this.values),l},t.prototype.renderYears=function(t){"Gregorian"===this.calendarMode?e.prototype.renderYears.call(this,t,this.value):this.islamicModule.islamicRenderYears(t,this.value)},t.prototype.renderDecades=function(t){"Gregorian"===this.calendarMode?e.prototype.renderDecades.call(this,t,this.value):this.islamicModule.islamicRenderDecade(t,this.value)},t.prototype.renderTemplate=function(t,i,s,a){"Gregorian"===this.calendarMode?e.prototype.renderTemplate.call(this,t,i,s,a,this.value):this.islamicModule.islamicRenderTemplate(t,i,s,a,this.value),this.changedArgs={value:this.value,values:this.values},a&&"click"===a.type&&a.currentTarget.classList.contains(n)?this.changeHandler(a):this.changeHandler()},t.prototype.clickHandler=function(t){var s=t.currentTarget;if(this.isPopupClicked=!0,s.classList.contains(n))if(this.isMultiSelection){var a=this.copyValues(this.values);-1===a.toString().indexOf(this.getIdValue(t,null).toString())?(a.push(this.getIdValue(t,null)),this.setProperties({values:a},!0),this.setProperties({value:this.values[this.values.length-1]},!0)):this.previousDates=!0}else this.setProperties({value:this.getIdValue(t,null)},!0);var r=this.currentView();e.prototype.clickHandler.call(this,t,this.value),this.isMultiSelection&&this.currentDate!==this.value&&!(0,i.isNullOrUndefined)(this.tableBodyElement.querySelectorAll("."+D)[0])&&"Year"===r&&this.tableBodyElement.querySelectorAll("."+D)[0].classList.remove(D)},t.prototype.switchView=function(t,i,s,a){e.prototype.switchView.call(this,t,i,this.isMultiSelection,a)},t.prototype.getModuleName=function(){return e.prototype.getModuleName.call(this),"calendar"},t.prototype.getPersistData=function(){e.prototype.getPersistData.call(this);return this.addOnPersist(["value","values"])},t.prototype.onPropertyChanged=function(t,i){this.effect="",this.rangeValidation(this.min,this.max);for(var s=0,a=Object.keys(t);s<a.length;s++){switch(a[s]){case"value":this.isDateSelected&&("string"==typeof t.value?this.setProperties({value:new Date(this.checkValue(t.value))},!0):t.value=new Date(this.checkValue(t.value)),isNaN(+this.value)&&this.setProperties({value:i.value},!0),this.update());break;case"values":if(this.isDateSelected){if("string"==typeof t.values||"number"==typeof t.values)this.setProperties({values:null},!0);else{for(var n=this.copyValues(this.values),r=0;r<n.length;r++){var l=n[r];this.checkDateValue(l)&&!e.prototype.checkPresentDate.call(this,l,n)&&n.push(l)}this.setProperties({values:n},!0),this.values.length>0&&this.setProperties({value:t.values[t.values.length-1]},!0)}this.validateValues(this.isMultiSelection,this.values),this.update()}break;case"isMultiSelection":this.isDateSelected&&(this.setProperties({isMultiSelection:t.isMultiSelection},!0),this.update());break;case"enabled":this.setEnable(this.enabled);break;case"cssClass":"calendar"===this.getModuleName()&&this.setClass(t.cssClass,i.cssClass);break;default:e.prototype.onPropertyChanged.call(this,t,i,this.isMultiSelection,this.values)}}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange},t.prototype.destroy=function(){if(e.prototype.destroy.call(this),"calendar"===this.getModuleName()){this.changedArgs=null;var t=(0,i.closest)(this.element,"form");t&&i.EventHandler.remove(t,"reset",this.formResetHandler.bind(this))}},t.prototype.navigateTo=function(t,i,s){this.minMaxUpdate(),e.prototype.navigateTo.call(this,t,i,s)},t.prototype.currentView=function(){return e.prototype.currentView.call(this)},t.prototype.addDate=function(t){if("string"!=typeof t&&"number"!=typeof t){var s=this.copyValues(this.values);if("object"==typeof t&&t.length>0)for(var a=t,n=0;n<a.length;n++)this.checkDateValue(a[n])&&!e.prototype.checkPresentDate.call(this,a[n],s)&&(!(0,i.isNullOrUndefined)(s)&&s.length>0?s.push(a[n]):s=[new Date(+a[n])]);else this.checkDateValue(t)&&!e.prototype.checkPresentDate.call(this,t,s)&&(!(0,i.isNullOrUndefined)(s)&&s.length>0?s.push(t):s=[new Date(+t)]);this.setProperties({values:s},!0),this.isMultiSelection&&this.setProperties({value:this.values[this.values.length-1]},!0),this.validateValues(this.isMultiSelection,s),this.update(),this.changedArgs={value:this.value,values:this.values},this.changeHandler()}},t.prototype.removeDate=function(e){if("string"!=typeof e&&"number"!=typeof e&&!(0,i.isNullOrUndefined)(this.values)&&this.values.length>0){var t=this.copyValues(this.values);if("object"==typeof e&&e.length>0)for(var s=e,a=0;a<s.length;a++)for(var n=0;n<t.length;n++)+t[n]===+s[a]&&t.splice(n,1);else for(n=0;n<t.length;n++)+t[n]===+e&&t.splice(n,1);this.setProperties({values:t},!1),this.update(),this.isMultiSelection&&this.setProperties({value:this.values[this.values.length-1]},!0),this.changedArgs={value:this.value,values:this.values},this.changeHandler()}},t.prototype.setTodayDate=function(t){var i=new Date(+t);this.setProperties({value:i},!0),e.prototype.todayButtonClick.call(this,null,i,!0)},t.prototype.update=function(){this.validateDate(),this.minMaxUpdate(),e.prototype.setValueUpdate.call(this)},t.prototype.selectDate=function(t,s,a){e.prototype.selectDate.call(this,t,s,a,this.isMultiSelection,this.values),this.isMultiSelection&&!(0,i.isNullOrUndefined)(this.values)&&this.values.length>0&&this.setProperties({value:this.values[this.values.length-1]},!0),this.changedArgs={value:this.value,values:this.values},this.changeHandler(t)},t.prototype.changeEvent=function(e){((this.value&&this.value.valueOf())!==(this.previousDate&&+this.previousDate.valueOf())||this.isMultiSelection)&&(this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",this.changedArgs),this.previousDate=new Date(+this.value))},t.prototype.triggerChange=function(e){!(0,i.isNullOrUndefined)(this.todayButtonEvent)&&this.isTodayClicked&&(e=this.todayButtonEvent,this.isTodayClicked=!1),this.changedArgs.event=e||null,this.changedArgs.isInteracted=!(0,i.isNullOrUndefined)(e),(0,i.isNullOrUndefined)(this.value)||this.setProperties({value:this.value},!0),this.isMultiSelection||+this.value===Number.NaN||((0,i.isNullOrUndefined)(this.value)||(0,i.isNullOrUndefined)(this.previousDate))&&(null!==this.previousDate||isNaN(+this.value))?(0,i.isNullOrUndefined)(this.values)||this.previousValues===this.values.length||(this.changeEvent(e),this.previousValues=this.values.length):this.changeEvent(e)},a([(0,i.Property)(null)],t.prototype,"value",void 0),a([(0,i.Property)(null)],t.prototype,"values",void 0),a([(0,i.Property)(!1)],t.prototype,"isMultiSelection",void 0),a([(0,i.Event)()],t.prototype,"change",void 0),t=a([i.NotifyPropertyChanges],t)}(I),x="e-other-month",S="e-year",P="e-disabled",A="e-overlay",U="e-selected",H="e-focused-date",W="e-month-hide",F="e-cell",L=function(){function e(e){this.calendarInstance=e}return e.prototype.getModuleName=function(){return"islamic"},e.prototype.islamicTitleUpdate=function(e,t){var s=new i.Internationalization(this.calendarInstance.locale);switch(t){case"days":this.calendarInstance.headerTitleElement.textContent=s.formatDate(e,{type:"dateTime",format:"MMMMyyyy",calendar:"islamic"});break;case"months":this.calendarInstance.headerTitleElement.textContent=s.formatDate(e,{type:"dateTime",format:"yyyy",calendar:"islamic"})}},e.prototype.islamicRenderDays=function(e,t,s,a){var n,r=[],l=new Date(this.islamicInValue(e));this.islamicTitleUpdate(e,"days");var o=this.getIslamicDate(l),h=this.toGregorian(o.year,o.month,1),u=o.month;for(l=h;l.getDay()!==this.calendarInstance.firstDayOfWeek;)this.calendarInstance.setStartDate(l,-864e5);for(var d=0;d<42;++d){var p=this.calendarInstance.createElement("td",{className:F}),c=this.calendarInstance.createElement("span");d%7==0&&this.calendarInstance.weekNumber&&(c.textContent=""+this.calendarInstance.getWeek(l),p.appendChild(c),(0,i.addClass)([p],"e-week-number"),r.push(p)),n=new Date(+l),l=this.calendarInstance.minMaxDate(l);var m={type:"dateTime",skeleton:"full",calendar:"islamic"},f=this.calendarInstance.globalize.parseDate(this.calendarInstance.globalize.formatDate(l,m),m),v=this.islamicDayCell(l),g=this.calendarInstance.globalize.formatDate(l,{type:"date",skeleton:"full",calendar:"islamic"}),y=this.calendarInstance.createElement("span");y.textContent=this.calendarInstance.globalize.formatDate(l,{type:"date",skeleton:"d",calendar:"islamic"});var b=this.calendarInstance.min>l||this.calendarInstance.max<l;b?((0,i.addClass)([v],P),(0,i.addClass)([v],A)):y.setAttribute("title",""+g),u!==this.getIslamicDate(l).month&&(0,i.addClass)([v],x),0!==l.getDay()&&6!==l.getDay()||(0,i.addClass)([v],"e-weekend"),v.appendChild(y),this.calendarInstance.renderDayCellArgs={date:l,isDisabled:!1,element:v,isOutOfRange:b};var D=this.calendarInstance.renderDayCellArgs;if(this.calendarInstance.renderDayCellEvent(D),D.isDisabled)if(this.calendarInstance.isMultiSelection){if(!(0,i.isNullOrUndefined)(this.calendarInstance.values)&&this.calendarInstance.values.length>0)for(var E=0;E<a.length;E++){+new Date(this.calendarInstance.globalize.formatDate(D.date,{type:"date",skeleton:"yMd",calendar:"islamic"}))===+new Date(this.calendarInstance.globalize.formatDate(this.calendarInstance.values[E],{type:"date",skeleton:"yMd",calendar:"islamic"}))&&(this.calendarInstance.values.splice(E,1),E=-1)}}else t&&+t===+D.date&&this.calendarInstance.setProperties({value:null},!0);this.calendarInstance.renderDayCellArgs.isDisabled&&!v.classList.contains(U)&&((0,i.addClass)([v],P),(0,i.addClass)([v],A),+this.calendarInstance.renderDayCellArgs.date===+this.calendarInstance.todayDate&&(this.calendarInstance.todayDisabled=!0));var C=v.classList.contains(x),k=v.classList.contains(P);if(k||i.EventHandler.add(v,"click",this.calendarInstance.clickHandler,this.calendarInstance),!this.calendarInstance.isMultiSelection||(0,i.isNullOrUndefined)(this.calendarInstance.values)||C||k)C||k||!this.calendarInstance.getDateVal(l,t)?this.calendarInstance.updateFocus(C,k,l,v,e):(0,i.addClass)([v],U);else{for(var M=0;M<this.calendarInstance.values.length;M++){this.calendarInstance.globalize.formatDate(l,{type:"date",skeleton:"short",calendar:"islamic"})===this.calendarInstance.globalize.formatDate(this.calendarInstance.values[M],{type:"date",skeleton:"short",calendar:"islamic"})&&this.calendarInstance.getDateVal(l,this.calendarInstance.values[M])?(0,i.addClass)([v],U):this.calendarInstance.updateFocus(C,k,l,v,e)}this.calendarInstance.values.length<=0&&this.calendarInstance.updateFocus(C,k,l,v,e)}f.getDate()===(new Date).getDate()&&f.getMonth()===(new Date).getMonth()&&f.getFullYear()===(new Date).getFullYear()&&(0,i.addClass)([v],"e-today"),l=new Date(+n),r.push(this.calendarInstance.renderDayCellArgs.element),this.calendarInstance.addDay(l,1,null,this.calendarInstance.max,this.calendarInstance.min)}return r},e.prototype.islamicIconHandler=function(){new Date(this.islamicInValue(this.calendarInstance.currentDate)).setDate(1);var e=new Date(this.islamicInValue(this.calendarInstance.currentDate));switch(this.calendarInstance.currentView()){case"Month":var t=this.islamicCompareMonth(e,this.calendarInstance.min)<1,s=this.islamicCompareMonth(e,this.calendarInstance.max)>-1;this.calendarInstance.previousIconHandler(t),this.calendarInstance.nextIconHandler(s);break;case"Year":var a=this.hijriCompareYear(e,this.calendarInstance.min)<1,n=this.hijriCompareYear(e,this.calendarInstance.max)>-1;this.calendarInstance.previousIconHandler(a),this.calendarInstance.nextIconHandler(n);break;case"Decade":var r=i.HijriParser.toGregorian(1361,1,1),l=this.hijriCompareDecade(e,this.calendarInstance.min)<1,o=this.hijriCompareDecade(e,this.calendarInstance.max)>-1;l=i.HijriParser.toGregorian(this.calendarInstance.headerTitleElement.textContent.split("-")[0].trim(),1,1).getFullYear()===r.getFullYear()||l,this.calendarInstance.previousIconHandler(l),this.calendarInstance.nextIconHandler(o)}},e.prototype.islamicNext=function(){this.calendarInstance.effect="";var e=this.calendarInstance.getViewNumber(this.calendarInstance.currentView()),t=this.getIslamicDate(this.calendarInstance.currentDate);switch(this.calendarInstance.currentView()){case"Year":this.calendarInstance.currentDate=this.toGregorian(t.year+1,t.month,1),this.calendarInstance.switchView(e);break;case"Month":this.calendarInstance.currentDate=this.toGregorian(t.year,t.month+1,1),this.calendarInstance.switchView(e);break;case"Decade":this.calendarInstance.nextIconClicked=!0,t.year-this.calendarInstance.headerElement.textContent.split("-")[0].trim()===1&&(t.year=t.year-this.calendarInstance.headerElement.textContent.split("-")[0].trim()===1?t.year+1:t.year),this.calendarInstance.currentDate=this.toGregorian(t.year+10,t.month,1),this.calendarInstance.switchView(e)}},e.prototype.islamicPrevious=function(){var e=this.calendarInstance.getViewNumber(this.calendarInstance.currentView());this.calendarInstance.effect="";var t=this.getIslamicDate(this.calendarInstance.currentDate);switch(this.calendarInstance.currentView()){case"Month":this.calendarInstance.currentDate=this.toGregorian(t.year,t.month-1,1),this.calendarInstance.switchView(e);break;case"Year":this.calendarInstance.currentDate=this.toGregorian(t.year-1,t.month,1),this.calendarInstance.switchView(e);break;case"Decade":this.calendarInstance.previousIconClicked=!0,this.calendarInstance.currentDate=this.toGregorian(t.year-10,t.month-1,1),this.calendarInstance.switchView(e)}},e.prototype.islamicRenderYears=function(e,t){this.calendarInstance.removeTableHeadElement();var s=[],a=(0,i.isNullOrUndefined)(t),n=new Date(this.islamicInValue(this.calendarInstance.currentDate)),r=this.getIslamicDate(n);n=i.HijriParser.toGregorian(r.year,1,1);var l=r.month,o=r.year,h=r.year,u=this.getIslamicDate(this.calendarInstance.min).year,d=this.getIslamicDate(this.calendarInstance.min).month,p=this.getIslamicDate(this.calendarInstance.max).year,c=this.getIslamicDate(this.calendarInstance.max).month;this.islamicTitleUpdate(this.calendarInstance.currentDate,"months");for(var m=1;m<=12;++m){var f=this.getIslamicDate(n);n=i.HijriParser.toGregorian(f.year,m,1);var v=this.islamicDayCell(n),g=this.calendarInstance.createElement("span"),y=t&&this.getIslamicDate(t).month===this.getIslamicDate(n).month,b=t&&this.getIslamicDate(t).year===o&&y;g.textContent=this.calendarInstance.globalize.formatDate(n,{type:"dateTime",format:"MMM",calendar:"islamic"}),this.calendarInstance.min&&(h<u||m<d&&h===u)||this.calendarInstance.max&&(h>p||m>c&&h>=p)?(0,i.addClass)([v],P):!a&&b?(0,i.addClass)([v],U):this.getIslamicDate(n).month===l&&this.getIslamicDate(this.calendarInstance.currentDate).month===l&&(0,i.addClass)([v],H),v.classList.contains(P)||i.EventHandler.add(v,"click",this.calendarInstance.clickHandler,this.calendarInstance),v.appendChild(g),s.push(v)}this.islamicRenderTemplate(s,4,S,e,t)},e.prototype.islamicRenderDecade=function(e,t){this.calendarInstance.removeTableHeadElement();var s=[],a=new Date(this.islamicInValue(this.calendarInstance.currentDate)),n=this.getIslamicDate(a),r=(a=i.HijriParser.toGregorian(n.year,1,1)).getFullYear(),l=new Date(this.islamicInValue(r-r%10)),o=new Date(this.islamicInValue(r-r%10+9)),h=l.getFullYear(),u=o.getFullYear(),d=this.calendarInstance.globalize.formatDate(l,{type:"dateTime",format:"y",calendar:"islamic"}),p=this.calendarInstance.globalize.formatDate(o,{type:"dateTime",format:"y",calendar:"islamic"});n.year%10==1?(d=n.year,p=n.year+9):n.year%10>1?p=(d=n.year-(n.year%10-1))+9:n.year%10==0&&(d=n.year-9,p=n.year),"ar"===this.calendarInstance.locale&&(d=Number(d.toString().replace(/[٠١٢٣٤٥٦٧٨٩]/g,function(e){return String.fromCharCode(e.charCodeAt(0)-1632+48)})),p=Number(p.toString().replace(/[٠١٢٣٤٥٦٧٨٩]/g,function(e){return String.fromCharCode(e.charCodeAt(0)-1632+48)})));var c=this.calendarInstance.headerElement.textContent.split("-");if((!(0,i.isNullOrUndefined)(e)&&c[0]!==d&&"home"===e.action||!(0,i.isNullOrUndefined)(e)&&"keydown"===e.type&&"end"===e.action)&&(d=this.calendarInstance.headerElement.textContent.split("-")[0].trim(),p=this.calendarInstance.headerElement.textContent.split("-")[1].trim()),this.calendarInstance.islamicPreviousHeader&&(d=this.calendarInstance.islamicPreviousHeader.split("-")[0].trim(),p=this.calendarInstance.islamicPreviousHeader.split("-")[1].trim(),this.calendarInstance.islamicPreviousHeader=null),this.calendarInstance.previousIconClicked){var m=0;for(m=0;m<=c.length;m++)(p=p-c[m]===2||c[m]-p===2?(parseInt(p,10)+1).toString():p-c[m]===3||c[m]-p===3?(parseInt(p,10)+2).toString():p-c[m]===4||c[m]-p===4?(parseInt(p,10)+3).toString():p-c[m]===5||c[m]-p===5?(parseInt(p,10)+4).toString():p)-c[m]!==0&&c[m]-p!==0||(p=(parseInt(p,10)-1).toString());p-c[m]!==8&&c[m]-p!==8||(p=(parseInt(p,10)-9).toString(),d=(parseInt(p,10)-9).toString()),p-c[m]!==7&&c[m]-p!==7||(p=(parseInt(p,10)-8).toString(),d=(parseInt(p,10)-9).toString()),p-(d=p-d===10?(parseInt(d,10)+1).toString():p-d===11?(parseInt(d,10)+2).toString():p-d===12?(parseInt(d,10)+3).toString():d)===8&&(d=(parseInt(d,10)-1).toString())}if(this.calendarInstance.nextIconClicked){for(m=0;m<=c.length;m++)d-c[m]!==0&&c[m]-d!==0||(d=(parseInt(d,10)+1).toString()),d-c[m]===2&&d>c[m].trim()&&(d=(parseInt(d,10)-1).toString()),c[m]-d===1&&d<c[m].trim()&&(d=(parseInt(d,10)+2).toString());d-this.calendarInstance.headerTitleElement.textContent.split("-")[1].trim()>1&&(d=(parseInt(this.calendarInstance.headerTitleElement.textContent.split("-")[1].trim(),10)+1).toString(),p=(parseInt(d,10)+9).toString()),p=(p=p-d===10?(parseInt(p,10)-1).toString():p)-d===7?(parseInt(p,10)+2).toString():p-d===8?(parseInt(p,10)+1).toString():p}if("ar"===this.calendarInstance.locale){var f=this.calendarInstance.globalize.formatDate(l,{type:"dateTime",format:"y",calendar:"islamic"}),v=this.calendarInstance.globalize.formatDate(o,{type:"dateTime",format:"y",calendar:"islamic"});this.calendarInstance.headerTitleElement.textContent=f+" - "+v}else this.calendarInstance.headerTitleElement.textContent=d+" - "+p;this.calendarInstance.nextIconClicked=this.calendarInstance.previousIconClicked=!1;var g=(parseInt(d,10)-2).toString();h=Math.round(.97*parseInt(d,10)+622),u=Math.round(.97*parseInt(p,10)+622);for(var y=Math.round(.97*parseInt(g,10)+622),b=1;b<=12;++b){var D=y+b;if(a.setFullYear(D),a.setDate(1),a.setMonth(0),this.getIslamicDate(a).year-n.year>1&&(a.setMonth(1),b-=1,a.setFullYear(a.getFullYear()-1)),n=this.getIslamicDate(a),a=i.HijriParser.toGregorian(n.year,1,1),n.year===parseInt(d,10)-1||n.year>=d&&n.year<=u||n.year===parseInt(p,10)+1){var E=this.islamicDayCell(a);(0,i.attributes)(E,{role:"gridcell"});var C=this.calendarInstance.createElement("span");C.textContent=this.calendarInstance.globalize.formatDate(a,{type:"dateTime",format:"y",calendar:"islamic"}),n.year===parseInt(d,10)-1||D<h||D>u&&n.year!==parseInt(p,10)?((0,i.addClass)([E],x),(D<=new Date(this.islamicInValue(this.calendarInstance.min)).getFullYear()||D>=new Date(this.islamicInValue(this.calendarInstance.max)).getFullYear())&&(0,i.addClass)([E],P)):D<new Date(this.islamicInValue(this.calendarInstance.min)).getFullYear()||D>new Date(this.islamicInValue(this.calendarInstance.max)).getFullYear()?(0,i.addClass)([E],P):(0,i.isNullOrUndefined)(t)||this.getIslamicDate(a).year!==this.getIslamicDate(t).year?this.getIslamicDate(a).year!==this.getIslamicDate(this.calendarInstance.currentDate).year||E.classList.contains(P)||(0,i.addClass)([E],H):(0,i.addClass)([E],U),E.classList.contains(P)||i.EventHandler.add(E,"click",this.calendarInstance.clickHandler,this.calendarInstance),E.appendChild(C),(!(0,i.isNullOrUndefined)(e)&&"home"===e.action&&n.year.toString()===d||!(0,i.isNullOrUndefined)(e)&&"end"===e.action&&n.year.toString()===p)&&(0,i.addClass)([E],H),s.push(E)}}this.islamicRenderTemplate(s,4,"e-decade",e,t)},e.prototype.islamicDayCell=function(e){var t={skeleton:"full",type:"dateTime",calendar:"islamic"},s=this.calendarInstance.globalize.formatDate(e,t),a=this.calendarInstance.globalize.parseDate(s,t).valueOf(),n={className:F,attrs:{id:""+(0,i.getUniqueID)(""+a),"aria-selected":"false",role:"gridcell"}};return this.calendarInstance.createElement("td",n)},e.prototype.islamicRenderTemplate=function(e,t,s,a,n){var r,l=this.calendarInstance.getViewNumber(this.calendarInstance.currentView());this.calendarInstance.tableBodyElement=this.calendarInstance.createElement("tbody"),this.calendarInstance.table.appendChild(this.calendarInstance.tableBodyElement),(0,i.removeClass)([this.calendarInstance.contentElement,this.calendarInstance.headerElement],["e-month","e-decade",S]),(0,i.addClass)([this.calendarInstance.contentElement,this.calendarInstance.headerElement],[s]);for(var o=t,h=0,u=0;u<Math.round(e.length/t);++u){for(r=this.calendarInstance.createElement("tr",{attrs:{role:"row"}}),h=0+h;h<o;h++)e[h].classList.contains("e-week-number")||(0,i.isNullOrUndefined)(e[h].children[0])||((0,i.addClass)([e[h].children[0]],["e-day"]),(0,i.rippleEffect)(e[h].children[0],{duration:600,isCenterRipple:!0})),r.appendChild(e[h]),this.calendarInstance.weekNumber&&7===h&&e[7].classList.contains(x)&&(0,i.addClass)([r],W),!this.calendarInstance.weekNumber&&6===h&&e[6].classList.contains(x)&&(0,i.addClass)([r],W),this.calendarInstance.weekNumber?41===h&&e[41].classList.contains(x)&&(0,i.addClass)([r],W):35===h&&e[35].classList.contains(x)&&(0,i.addClass)([r],W);o+=t,h+=0,this.calendarInstance.tableBodyElement.appendChild(r)}this.calendarInstance.table.querySelector("tbody").className=this.calendarInstance.effect,this.islamicIconHandler(),(l!==this.calendarInstance.getViewNumber(this.calendarInstance.currentView())||0===l&&l!==this.calendarInstance.getViewNumber(this.calendarInstance.currentView()))&&this.calendarInstance.navigateHandler(a),this.calendarInstance.setAriaActiveDescendant(),this.calendarInstance.changedArgs={value:this.calendarInstance.value,values:this.calendarInstance.values},this.calendarInstance.changeHandler()},e.prototype.islamicCompareMonth=function(e,t){var i=this.getIslamicDate(e),s=this.getIslamicDate(t);return i.year>s.year?1:i.year<s.year?-1:i.month===s.month?0:i.month>s.month?1:-1},e.prototype.islamicCompare=function(e,t,i){var s,a,n=this.getIslamicDate(e),r=this.getIslamicDate(t).year;return s=r,a=0,i&&(s=(r-=r%i)-r%i+i-1),n.year>s?a=1:("Decade"===this.calendarInstance.currentView()&&n.year<r&&!(e.getFullYear()>=2058&&e.getFullYear()<=2069)||n.year<r&&"Year"===this.calendarInstance.currentView())&&(a=-1),a},e.prototype.getIslamicDate=function(e){return i.HijriParser.getHijriDate(e)},e.prototype.toGregorian=function(e,t,s){return i.HijriParser.toGregorian(e,t,s)},e.prototype.hijriCompareYear=function(e,t){return this.islamicCompare(e,t,0)},e.prototype.hijriCompareDecade=function(e,t){return this.islamicCompare(e,t,10)},e.prototype.destroy=function(){this.calendarInstance=null},e.prototype.islamicInValue=function(e){return e instanceof Date?e.toUTCString():""+e},e}(),B=l(197),j=l(323),Y=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),R=function(e,t,i,s){var a,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(r=(n<3?a(r):n>3?a(t,i,r):a(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},z="e-datepicker",q="e-popup-wrapper",K="e-input-focus",_="e-error",G="e-active",Z="e-date-overflow",X="e-selected",J="e-non-edit",$=["title","class","style"],Q=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.isDateIconClicked=!1,s.isAltKeyPressed=!1,s.isInteracted=!0,s.invalidValueString=null,s.checkPreviousValue=null,s.maskedDateValue="",s.preventChange=!1,s.isIconClicked=!1,s.isDynamicValueChanged=!1,s.moduleName=s.getModuleName(),s.isFocused=!1,s.isBlur=!1,s.isKeyAction=!1,s.datepickerOptions=t,s}return Y(t,e),t.prototype.render=function(){this.initialize(),this.bindEvents(),"Never"!==this.floatLabelType&&j.Input.calculateWidth(this.inputElement,this.inputWrapper.container),(0,i.isNullOrUndefined)(this.inputWrapper.buttons[0])||(0,i.isNullOrUndefined)(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon"),!(0,i.isNullOrUndefined)((0,i.closest)(this.element,"fieldset"))&&(0,i.closest)(this.element,"fieldset").disabled&&(this.enabled=!1),this.initTimeZone=(new Date).getTimezoneOffset(),this.renderComplete(),this.setTimeZone(this.serverTimezoneOffset)},t.prototype.setTimeZone=function(e){if(!(0,i.isNullOrUndefined)(this.serverTimezoneOffset)&&this.value){var t=e+(new Date).getTimezoneOffset()/60;t=this.isDayLightSaving()?t--:t,this.value=new Date(this.value.getTime()+60*t*60*1e3),this.updateInput(),this.changeTrigger(null)}},t.prototype.isDayLightSaving=function(){var e=new Date(this.value.getFullYear(),0,1).getTimezoneOffset(),t=new Date(this.value.getFullYear(),6,1).getTimezoneOffset();return this.value.getTimezoneOffset()<Math.max(e,t)},t.prototype.setAllowEdit=function(){this.allowEdit?this.readonly||this.inputElement.removeAttribute("readonly"):(0,i.attributes)(this.inputElement,{readonly:""}),this.updateIconState()},t.prototype.updateIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&(0,i.removeClass)([this.inputWrapper.container],[J]):""===this.inputElement.value?(0,i.removeClass)([this.inputWrapper.container],[J]):(0,i.addClass)([this.inputWrapper.container],[J])},t.prototype.initialize=function(){this.checkInvalidValue(this.value),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"}),this.createInput(),this.updateHtmlAttributeToWrapper(),this.setAllowEdit(),!this.enableMask||this.value||!this.maskedDateValue||"Always"!==this.floatLabelType&&this.floatLabelType&&this.placeholder?this.enableMask||this.updateInput(!0):(this.updateInput(!0),this.updateInputValue(this.maskedDateValue)),this.previousElementValue=this.inputElement.value,this.previousDate=(0,i.isNullOrUndefined)(this.value)?null:new Date(+this.value),this.inputElement.setAttribute("value",this.inputElement.value),this.inputValueCopy=this.value},t.prototype.createInput=function(){if("datepicker"===this.getModuleName()){var e={placeholder:this.placeholder};this.globalize=new i.Internationalization(this.locale),this.l10n=new i.L10n("datepicker",e,this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0)}this.fullScreenMode&&i.Browser.isDevice&&(this.cssClass+=" e-popup-expand");var t=this.cssClass;(0,i.isNullOrUndefined)(this.cssClass)||""===this.cssClass||(t=this.cssClass.replace(/\s+/g," ").trim());var s=!this.enableMask;this.inputWrapper=j.Input.createInput({element:this.inputElement,floatLabelType:this.floatLabelType,bindClearAction:s,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:t,enabled:this.enabled,enableRtl:this.enableRtl,showClearButton:this.showClearButton},buttons:["e-input-group-icon e-date-icon e-icons"]},this.createElement),this.setWidth(this.width),""!==this.inputElement.name?this.inputElement.setAttribute("name",""+this.inputElement.getAttribute("name")):this.inputElement.setAttribute("name",""+this.element.id),(0,i.attributes)(this.inputElement,{"aria-atomic":"true","aria-expanded":"false",role:"combobox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-invalid":"false"}),this.inputElement.hasAttribute("aria-label")||this.inputElement.setAttribute("aria-label",this.getModuleName()),this.enabled?(this.inputElement.setAttribute("aria-disabled","false"),this.inputElement.setAttribute("tabindex",this.tabIndex)):(this.inputElement.setAttribute("aria-disabled","true"),this.inputElement.tabIndex=-1),j.Input.addAttributes({"aria-label":"select",role:"button"},this.inputWrapper.buttons[0]),(0,i.addClass)([this.inputWrapper.container],"e-date-wrapper")},t.prototype.updateInput=function(t,s){var a;if(void 0===t&&(t=!1),void 0===s&&(s=!1),this.value&&!this.isCalendar()&&this.disabledDates(t,s),isNaN(+new Date(this.checkValue(this.value)))&&this.setProperties({value:null},!0),this.strictMode&&(e.prototype.validateDate.call(this),this.minMaxUpdates(),e.prototype.minMaxUpdate.call(this)),!(0,i.isNullOrUndefined)(this.value)){var n=this.value,r=void 0,l=(0,i.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString;if("datetimepicker"===this.getModuleName()?r="Gregorian"===this.calendarMode?this.globalize.formatDate(this.value,{format:l,type:"dateTime",skeleton:"yMd"}):this.globalize.formatDate(this.value,{format:l,type:"dateTime",skeleton:"yMd",calendar:"islamic"}):(a="Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"},r=this.globalize.formatDate(this.value,a)),+n<=+this.max&&+n>=+this.min)this.updateInputValue(r);else{var o=+n>=+this.max||!+this.value||!+this.value||+n<=+this.min;!this.strictMode&&o&&this.updateInputValue(r)}}(0,i.isNullOrUndefined)(this.value)&&this.strictMode&&(this.enableMask?(this.updateInputValue(this.maskedDateValue),this.notify("createMask",{module:"MaskedDateTime"})):this.updateInputValue("")),!this.strictMode&&(0,i.isNullOrUndefined)(this.value)&&this.invalidValueString&&this.updateInputValue(this.invalidValueString),this.changedArgs={value:this.value},this.errorClass(),this.updateIconState()},t.prototype.minMaxUpdates=function(){!(0,i.isNullOrUndefined)(this.value)&&this.value<this.min&&this.min<=this.max&&this.strictMode?(this.setProperties({value:this.min},!0),this.changedArgs={value:this.value}):!(0,i.isNullOrUndefined)(this.value)&&this.value>this.max&&this.min<=this.max&&this.strictMode&&(this.setProperties({value:this.max},!0),this.changedArgs={value:this.value})},t.prototype.checkStringValue=function(e){var t=null,s=null,a=null;if("datetimepicker"===this.getModuleName()){var n=new i.Internationalization(this.locale);"Gregorian"===this.calendarMode?(s={format:this.dateTimeFormat,type:"dateTime",skeleton:"yMd"},a={format:n.getDatePattern({skeleton:"yMd"}),type:"dateTime"}):(s={format:this.dateTimeFormat,type:"dateTime",skeleton:"yMd",calendar:"islamic"},a={format:n.getDatePattern({skeleton:"yMd"}),type:"dateTime",calendar:"islamic"})}else s="Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"};return t=this.checkDateValue(this.globalize.parseDate(this.getAmPmValue(e),s)),(0,i.isNullOrUndefined)(t)&&"datetimepicker"===this.getModuleName()&&(t=this.checkDateValue(this.globalize.parseDate(this.getAmPmValue(e),a))),t},t.prototype.checkInvalidValue=function(e){if(!(e instanceof Date||(0,i.isNullOrUndefined)(e))){var t=null,s=e;"number"==typeof e&&(s=e.toString());if("datetimepicker"===this.getModuleName()){var a=new i.Internationalization(this.locale);"Gregorian"===this.calendarMode?({format:this.dateTimeFormat,type:"dateTime",skeleton:"yMd"},{format:a.getDatePattern({skeleton:"yMd"}),type:"dateTime"}):({format:this.dateTimeFormat,type:"dateTime",skeleton:"yMd",calendar:"islamic"},{format:a.getDatePattern({skeleton:"yMd"}),type:"dateTime",calendar:"islamic"})}else"Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"};var n=!1;if("string"!=typeof s)s=null,n=!0;else if("string"==typeof s&&(s=s.trim()),!(t=this.checkStringValue(s))){var r=null;r=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,!/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/.test(s)&&!r.test(s)||/^[a-zA-Z0-9- ]*$/.test(s)||isNaN(+new Date(this.checkValue(s)))?n=!0:t=new Date(s)}n?(this.strictMode||(this.invalidValueString=s),this.setProperties({value:null},!0)):this.setProperties({value:t},!0)}},t.prototype.bindInputEvent=function(){(0,i.isNullOrUndefined)(this.formatString)&&!this.enableMask||(this.enableMask||-1===this.formatString.indexOf("y")?i.EventHandler.add(this.inputElement,"input",this.inputHandler,this):i.EventHandler.remove(this.inputElement,"input",this.inputHandler))},t.prototype.bindEvents=function(){i.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.dateIconHandler,this),i.EventHandler.add(this.inputElement,"mouseup",this.mouseUpHandler,this),i.EventHandler.add(this.inputElement,"focus",this.inputFocusHandler,this),i.EventHandler.add(this.inputElement,"blur",this.inputBlurHandler,this),i.EventHandler.add(this.inputElement,"keyup",this.keyupHandler,this),this.enableMask&&i.EventHandler.add(this.inputElement,"keydown",this.keydownHandler,this),this.bindInputEvent(),i.EventHandler.add(this.inputElement,"change",this.inputChangeHandler,this),this.showClearButton&&this.inputWrapper.clearButton&&i.EventHandler.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this),this.formElement&&i.EventHandler.add(this.formElement,"reset",this.resetFormHandler,this),this.defaultKeyConfigs=(0,i.extend)(this.defaultKeyConfigs,this.keyConfigs),this.keyboardModules=new i.KeyboardEvents(this.inputElement,{eventName:"keydown",keyAction:this.inputKeyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})},t.prototype.keydownHandler=function(e){switch(e.code){case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"ArrowDown":case"Home":case"End":case"Backspace":case"Delete":!this.enableMask||this.popupObj||this.readonly||("Delete"!==e.code&&"Backspace"!==e.code&&e.preventDefault(),this.notify("keyDownHandler",{module:"MaskedDateTime",e}))}},t.prototype.unBindEvents=function(){(0,i.isNullOrUndefined)(this.inputWrapper)||i.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.dateIconHandler),i.EventHandler.remove(this.inputElement,"mouseup",this.mouseUpHandler),i.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),i.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),i.EventHandler.remove(this.inputElement,"change",this.inputChangeHandler),i.EventHandler.remove(this.inputElement,"keyup",this.keyupHandler),this.enableMask&&i.EventHandler.remove(this.inputElement,"keydown",this.keydownHandler),this.showClearButton&&this.inputWrapper.clearButton&&i.EventHandler.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler),this.formElement&&i.EventHandler.remove(this.formElement,"reset",this.resetFormHandler)},t.prototype.resetFormHandler=function(){if(this.enabled&&!this.inputElement.disabled){var e=this.inputElement.getAttribute("value");"EJS-DATEPICKER"!==this.element.tagName&&"EJS-DATETIMEPICKER"!==this.element.tagName||(e="",this.inputValueCopy=null,this.inputElement.setAttribute("value","")),this.setProperties({value:this.inputValueCopy},!0),this.restoreValue(),this.inputElement&&(this.updateInputValue(e),this.errorClass())}},t.prototype.restoreValue=function(){this.currentDate=this.value?this.value:new Date,this.previousDate=this.value,this.previousElementValue=(0,i.isNullOrUndefined)(this.inputValueCopy)?"":this.globalize.formatDate(this.inputValueCopy,{format:this.formatString,type:"dateTime",skeleton:"yMd"})},t.prototype.inputChangeHandler=function(e){this.enabled&&e.stopPropagation()},t.prototype.bindClearEvent=function(){this.showClearButton&&this.inputWrapper.clearButton&&i.EventHandler.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this)},t.prototype.resetHandler=function(e){this.enabled&&(e.preventDefault(),this.clear(e))},t.prototype.mouseUpHandler=function(e){this.enableMask&&(e.preventDefault(),this.notify("setMaskSelection",{module:"MaskedDateTime"}))},t.prototype.clear=function(e){this.setProperties({value:null},!0),this.enableMask||this.updateInputValue(""),(0,i.isNullOrUndefined)(this.value)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0)));var t={event:e};if(this.trigger("cleared",t),this.invalidValueString="",this.updateInput(),this.popupUpdate(),this.changeEvent(e),this.enableMask&&this.notify("clearHandler",{module:"MaskedDateTime"}),(0,i.closest)(this.element,"form")){var s=this.element,a=document.createEvent("KeyboardEvent");a.initEvent("keyup",!1,!0),s.dispatchEvent(a)}},t.prototype.preventEventBubbling=function(e){e.preventDefault(),this.interopAdaptor.invokeMethodAsync("OnDateIconClick")},t.prototype.updateInputValue=function(e){j.Input.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton)},t.prototype.dateIconHandler=function(e){this.enabled&&(this.isIconClicked=!0,i.Browser.isDevice&&(this.inputElement.setAttribute("readonly",""),this.inputElement.blur()),e.preventDefault(),this.readonly||(this.isCalendar()?this.hide(e):(this.isDateIconClicked=!0,this.show(null,e),"datetimepicker"===this.getModuleName()&&this.inputElement.focus(),this.inputElement.focus(),(0,i.addClass)([this.inputWrapper.container],[K]),(0,i.addClass)(this.inputWrapper.buttons,G))),this.isIconClicked=!1)},t.prototype.updateHtmlAttributeToWrapper=function(){if(!(0,i.isNullOrUndefined)(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var s=t[e];if(!(0,i.isNullOrUndefined)(this.htmlAttributes[""+s])&&$.indexOf(s)>-1)if("class"===s){var a=this.htmlAttributes[""+s].replace(/\s+/g," ").trim();""!==a&&(0,i.addClass)([this.inputWrapper.container],a.split(" "))}else if("style"===s){var n=this.inputWrapper.container.getAttribute(s);(0,i.isNullOrUndefined)(n)?n=this.htmlAttributes[""+s]:";"===n.charAt(n.length-1)?n+=this.htmlAttributes[""+s]:n=n+";"+this.htmlAttributes[""+s],this.inputWrapper.container.setAttribute(s,n)}else this.inputWrapper.container.setAttribute(s,this.htmlAttributes[""+s])}},t.prototype.updateHtmlAttributeToElement=function(){if(!(0,i.isNullOrUndefined)(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var s=t[e];$.indexOf(s)<0&&this.inputElement.setAttribute(s,this.htmlAttributes[""+s])}},t.prototype.updateCssClass=function(e,t){(0,i.isNullOrUndefined)(t)||(t=t.replace(/\s+/g," ").trim()),(0,i.isNullOrUndefined)(e)||(e=e.replace(/\s+/g," ").trim()),j.Input.setCssClass(e,[this.inputWrapper.container],t),this.popupWrapper&&j.Input.setCssClass(e,[this.popupWrapper],t)},t.prototype.calendarKeyActionHandle=function(e){switch(e.action){case"escape":this.isCalendar()?this.hide(e):this.inputWrapper.container.children[this.index].blur();break;case"enter":this.isCalendar()?+this.value===+this.currentDate||this.isCalendar()||this.inputWrapper.container.children[this.index].focus():this.show(null,e),"datetimepicker"===this.getModuleName()&&this.inputElement.focus()}},t.prototype.inputFocusHandler=function(){if(this.isFocused=!0,this.enabled){this.initTimeZone!==(new Date).getTimezoneOffset()&&this.strictModeUpdate(!0),this.enableMask&&!this.inputElement.value&&this.placeholder&&(!this.maskedDateValue||this.value||"Auto"!==this.floatLabelType&&"Never"!==this.floatLabelType&&!this.placeholder||(this.updateInputValue(this.maskedDateValue),this.inputElement.selectionStart=0,this.inputElement.selectionEnd=this.inputElement.value.length)),this.enableMask&&this.showClearButton&&this.inputElement&&this.inputElement.value===this.maskedDateValue&&this.inputWrapper&&this.inputWrapper.clearButton&&!this.inputWrapper.clearButton.classList.contains("e-clear-icon-hide")&&this.inputWrapper.clearButton.classList.add("e-clear-icon-hide");var e={model:this};this.isDateIconClicked=!1,this.trigger("focus",e),this.updateIconState(),this.clearFloatLabelOverflowWidth(),this.openOnFocus&&!this.isIconClicked&&this.show()}},t.prototype.inputHandler=function(e){this.isPopupClicked=!1,this.enableMask&&((0,i.isNullOrUndefined)(e)||(0,i.isNullOrUndefined)(e.inputType)||"insertFromPaste"!==e.inputType?this.notify("inputHandler",{module:"MaskedDateTime"}):this.notify("maskPasteInputHandler",{module:"MaskedDateTime"}))},t.prototype.inputBlurHandler=function(e){if(this.updateFloatLabelOverflowWidth(),this.enabled){if(this.strictModeUpdate(),""===this.inputElement.value&&(0,i.isNullOrUndefined)(this.value)&&(this.invalidValueString=null,this.updateInputValue("")),this.isBlur=!0,this.updateInput(!1,!0),this.isBlur=!1,this.popupUpdate(),this.changeTrigger(e),this.enableMask&&this.maskedDateValue&&this.placeholder&&"Always"!==this.floatLabelType&&(this.inputElement.value!==this.maskedDateValue||this.value||"Auto"!==this.floatLabelType&&"Never"!==this.floatLabelType&&!this.placeholder||this.updateInputValue("")),this.errorClass(),this.isCalendar()&&document.activeElement===this.inputElement&&this.hide(e),"datepicker"===this.getModuleName()){var t={model:this};this.trigger("blur",t)}this.isCalendar()&&(this.defaultKeyConfigs=(0,i.extend)(this.defaultKeyConfigs,this.keyConfigs),this.calendarKeyboardModules=new i.KeyboardEvents(this.calendarElement.children[1].firstElementChild,{eventName:"keydown",keyAction:this.calendarKeyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})),this.isPopupClicked=!1}},t.prototype.documentHandler=function(t){(0,i.isNullOrUndefined)(this.popupObj)||(0,i.isNullOrUndefined)(this.inputWrapper)||!(this.inputWrapper.container.contains(t.target)&&"mousedown"!==t.type||this.popupObj.element&&this.popupObj.element.contains(t.target))||"touchstart"===t.type||t.preventDefault();var s=t.target;(0,i.closest)(s,".e-datepicker.e-popup-wrapper")||(0,i.isNullOrUndefined)(this.inputWrapper)||(0,i.closest)(s,".e-input-group")===this.inputWrapper.container||s.classList.contains("e-day")?(0,i.closest)(s,".e-datepicker.e-popup-wrapper")&&(s.classList.contains("e-day")&&!(0,i.isNullOrUndefined)(t.target.parentElement)&&t.target.parentElement.classList.contains("e-selected")&&(0,i.closest)(s,".e-content")&&(0,i.closest)(s,".e-content").classList.contains("e-"+this.depth.toLowerCase())||(0,i.closest)(s,".e-footer-container")&&s.classList.contains("e-today")&&s.classList.contains("e-btn")&&+new Date(+this.value)===+e.prototype.generateTodayVal.call(this,this.value))&&this.hide(t):(this.hide(t),s.classList.contains("e-dlg-overlay")?t.preventDefault():this.focusOut())},t.prototype.inputKeyActionHandle=function(e){var t=this.currentView();switch(e.action){case"altUpArrow":this.isAltKeyPressed=!1,this.hide(e),this.inputElement.focus();break;case"altDownArrow":this.isAltKeyPressed=!0,this.strictModeUpdate(),this.updateInput(),this.changeTrigger(e),"datepicker"===this.getModuleName()&&this.show(null,e);break;case"escape":this.hide(e);break;case"enter":var i=this.inputElement.value===this.previousElementValue,s=this.value instanceof Date&&this.previousDate instanceof Date?this.value.getTime()===this.previousDate.getTime():this.value===this.previousDate;i&&s||(this.strictModeUpdate(),this.updateInput(),this.popupUpdate(),this.changeTrigger(e),this.errorClass()),this.isCalendar()||document.activeElement!==this.inputElement||this.hide(e),this.isCalendar()&&(e.preventDefault(),e.stopPropagation());break;case"tab":case"shiftTab":var a=this.inputElement.selectionStart,n=this.inputElement.selectionEnd;if(this.enableMask&&!this.popupObj&&!this.readonly){var r=this.inputElement.value.length;(0===a&&n===r||n!==r&&"tab"===e.action||0!==a&&"shiftTab"===e.action)&&e.preventDefault(),this.notify("keyDownHandler",{module:"MaskedDateTime",e}),a=this.inputElement.selectionStart,n=this.inputElement.selectionEnd}this.strictModeUpdate(),this.updateInput(),this.popupUpdate(),this.changeTrigger(e),this.errorClass(),this.enableMask&&(this.inputElement.selectionStart=a,this.inputElement.selectionEnd=n),"tab"===e.action&&e.target===this.inputElement&&this.isCalendar()&&document.activeElement===this.inputElement&&(e.preventDefault(),this.headerTitleElement.focus()),"shiftTab"===e.action&&e.target===this.inputElement&&this.isCalendar()&&document.activeElement===this.inputElement&&this.hide(e);break;default:this.defaultAction(e),"select"===e.action&&t===this.depth&&this.hide(e)}},t.prototype.defaultAction=function(t){this.previousDate=!(0,i.isNullOrUndefined)(this.value)&&new Date(+this.value)||null,this.isCalendar()&&(e.prototype.keyActionHandle.call(this,t),this.isCalendar()&&(0,i.attributes)(this.inputElement,{"aria-activedescendant":""+this.setActiveDescendant()}))},t.prototype.popupUpdate=function(){if(((0,i.isNullOrUndefined)(this.value)&&!(0,i.isNullOrUndefined)(this.previousDate)||"datetimepicker"!==this.getModuleName()&&+this.value!==+this.previousDate||"datetimepicker"===this.getModuleName()&&+this.value!==+this.previousDateTime)&&(this.popupObj&&this.popupObj.element.querySelectorAll("."+X).length>0&&(0,i.removeClass)(this.popupObj.element.querySelectorAll("."+X),[X]),!(0,i.isNullOrUndefined)(this.value)&&+this.value>=+this.min&&+this.value<=+this.max)){var t=new Date(this.checkValue(this.value));e.prototype.navigateTo.call(this,"Month",t)}},t.prototype.strictModeUpdate=function(e){var t,s,a,n;("datetimepicker"===this.getModuleName()?t=(0,i.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString:/^y/.test(this.formatString)&&!/[^a-zA-Z]/.test(this.formatString)||(t=(0,i.isNullOrUndefined)(this.formatString)?this.formatString:this.formatString.replace("dd","d")),(0,i.isNullOrUndefined)(t))?t=this.formatString:t.split("M").length-1<3&&(t=t.replace("MM","M"));if(a="datetimepicker"===this.getModuleName()?"Gregorian"===this.calendarMode?{format:(0,i.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:(0,i.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"}:s="Gregorian"===this.calendarMode?{format:t,type:"dateTime",skeleton:"yMd"}:{format:t,type:"dateTime",skeleton:"yMd",calendar:"islamic"},"string"==typeof this.inputElement.value&&(this.inputElement.value=this.inputElement.value.trim()),"datetimepicker"===this.getModuleName()){if(this.checkDateValue(this.globalize.parseDate(this.getAmPmValue(this.inputElement.value),a))?n=this.globalize.parseDate(this.getAmPmValue(this.inputElement.value),a):(s="Gregorian"===this.calendarMode?{format:t,type:"dateTime",skeleton:"yMd"}:{format:t,type:"dateTime",skeleton:"yMd",calendar:"islamic"},n=this.globalize.parseDate(this.getAmPmValue(this.inputElement.value),s)),((0,i.isNullOrUndefined)(n)||"object"==typeof n&&isNaN(n.getTime()))&&!(0,i.isNullOrUndefined)(this.inputFormatsString))for(var r=0,l=this.inputFormatsString;r<l.length;r++){var o=l[r],h=void 0;if(h="Gregorian"===this.calendarMode?{format:o,type:"dateTime",skeleton:"yMd"}:{format:o,type:"dateTime",skeleton:"yMd",calendar:"islamic"},n=this.globalize.parseDate(this.getAmPmValue(this.inputElement.value),h),!(0,i.isNullOrUndefined)(n)&&n instanceof Date&&!isNaN(n.getTime()))break}}else{if(n=this.globalize.parseDate(this.getAmPmValue(this.inputElement.value),a),((0,i.isNullOrUndefined)(n)||"object"==typeof n&&isNaN(n.getTime()))&&!(0,i.isNullOrUndefined)(this.inputFormatsString))for(var u=0,d=this.inputFormatsString;u<d.length;u++){var p=d[u];h=void 0;if(h="Gregorian"===this.calendarMode?{format:p,type:"dateTime",skeleton:"yMd"}:{format:p,type:"dateTime",skeleton:"yMd",calendar:"islamic"},n=this.globalize.parseDate(this.getAmPmValue(this.inputElement.value),h),!(0,i.isNullOrUndefined)(n)&&n instanceof Date&&!isNaN(n.getTime()))break}n=!(0,i.isNullOrUndefined)(n)&&isNaN(+n)?null:n,!(0,i.isNullOrUndefined)(this.formatString)&&""!==this.inputElement.value&&this.strictMode&&(this.isPopupClicked||!this.isPopupClicked&&this.inputElement.value===this.previousElementValue)&&-1===this.formatString.indexOf("y")&&n.setFullYear(this.value.getFullYear())}"datepicker"===this.getModuleName()&&this.value&&!isNaN(+this.value)&&n&&!e&&n.setHours(this.value.getHours(),this.value.getMinutes(),this.value.getSeconds(),this.value.getMilliseconds()),this.strictMode&&n?(this.updateInputValue(this.globalize.formatDate(n,a)),(this.inputElement.value!==this.previousElementValue||e)&&this.setProperties({value:n},!0)):this.strictMode||(this.inputElement.value!==this.previousElementValue||e)&&this.setProperties({value:n},!0),this.strictMode&&!n&&this.inputElement.value===(this.enableMask?this.maskedDateValue:"")&&this.setProperties({value:null},!0),isNaN(+this.value)&&this.setProperties({value:null},!0),(0,i.isNullOrUndefined)(this.value)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0)))},t.prototype.createCalendar=function(){var e=this;this.popupWrapper=this.createElement("div",{className:z+" "+q,id:this.inputElement.id+"_options"}),this.popupWrapper.setAttribute("aria-label",this.element.id),this.popupWrapper.setAttribute("role","dialog"),(0,i.isNullOrUndefined)(this.cssClass)||(this.popupWrapper.className+=" "+this.cssClass),i.Browser.isDevice&&(this.modelHeader(),this.modal=this.createElement("div"),this.modal.className=z+" e-date-modal",document.body.className+=" "+Z,this.modal.style.display="block",document.body.appendChild(this.modal)),this.calendarElement.querySelector("table tbody").className="",this.popupObj=new B.Popup(this.popupWrapper,{content:this.calendarElement,relateTo:i.Browser.isDevice?document.body:this.inputWrapper.container,position:i.Browser.isDevice?{X:"center",Y:"center"}:this.enableRtl?{X:"right",Y:"bottom"}:{X:"left",Y:"bottom"},offsetY:4,targetType:"container",enableRtl:this.enableRtl,zIndex:this.zIndex,collision:i.Browser.isDevice?{X:"fit",Y:"fit"}:this.enableRtl?{X:"fit",Y:"flip"}:{X:"flip",Y:"flip"},open:function(){i.Browser.isDevice&&e.fullScreenMode&&(e.iconRight=parseInt(window.getComputedStyle(e.calendarElement.querySelector(".e-header.e-month .e-prev")).marginRight,10)>16,e.touchModule=new i.Touch(e.calendarElement.querySelector(".e-content.e-month"),{swipe:e.CalendarSwipeHandler.bind(e)}),i.EventHandler.add(e.calendarElement.querySelector(".e-content.e-month"),"touchstart",e.TouchStartHandler,e)),"datetimepicker"!==e.getModuleName()&&document.activeElement!==e.inputElement&&(e.defaultKeyConfigs=(0,i.extend)(e.defaultKeyConfigs,e.keyConfigs),e.calendarElement.children[1].firstElementChild.focus(),e.calendarKeyboardModules=new i.KeyboardEvents(e.calendarElement.children[1].firstElementChild,{eventName:"keydown",keyAction:e.calendarKeyActionHandle.bind(e),keyConfigs:e.defaultKeyConfigs}),e.calendarKeyboardModules=new i.KeyboardEvents(e.inputWrapper.container.children[e.index],{eventName:"keydown",keyAction:e.calendarKeyActionHandle.bind(e),keyConfigs:e.defaultKeyConfigs})),i.Browser.isDevice&&e.allowEdit&&!e.readonly&&i.Browser.isIos&&e.inputElement.blur()},close:function(){e.isDateIconClicked&&e.inputWrapper.container.children[e.index].focus(),e.value&&e.disabledDates(),e.popupObj&&e.popupObj.destroy(),e.resetCalendar(),(0,i.detach)(e.popupWrapper),e.popupObj=e.popupWrapper=null,e.preventArgs=null,e.calendarKeyboardModules=null,e.setAriaAttributes()},targetExitViewport:function(){i.Browser.isDevice||e.hide()}}),this.popupObj.element.className+=" "+this.cssClass,this.setAriaAttributes()},t.prototype.getAmPmValue=function(e){try{return"string"==typeof e&&""!==e.trim()?e.replace(/(am|pm|Am|aM|pM|Pm)/g,function(e){return e.toLocaleUpperCase()}):""}catch(e){return console.error("Error occurred while processing date:",e),""}},t.prototype.CalendarSwipeHandler=function(e){var t=0;if(this.iconRight)switch(e.swipeDirection){case"Left":t=1;break;case"Right":t=-1}else switch(e.swipeDirection){case"Up":t=1;break;case"Down":t=-1}this.touchStart&&(1===t?this.navigateNext(e):-1===t&&this.navigatePrevious(e),this.touchStart=!1)},t.prototype.TouchStartHandler=function(e){this.touchStart=!0},t.prototype.setAriaDisabled=function(){this.enabled?(this.inputElement.setAttribute("aria-disabled","false"),this.inputElement.setAttribute("tabindex",this.tabIndex)):(this.inputElement.setAttribute("aria-disabled","true"),this.inputElement.tabIndex=-1)},t.prototype.modelHeader=function(){var e,t=this.createElement("div",{className:"e-model-header"}),s=this.createElement("h1",{className:"e-model-year"}),a=this.createElement("div"),n=this.createElement("span",{className:"e-model-day"}),r=this.createElement("span",{className:"e-model-month"});if(e="Gregorian"===this.calendarMode?{format:"y",skeleton:"dateTime"}:{format:"y",skeleton:"dateTime",calendar:"islamic"},s.textContent=""+this.globalize.formatDate(this.value||new Date,e),e="Gregorian"===this.calendarMode?{format:"E",skeleton:"dateTime"}:{format:"E",skeleton:"dateTime",calendar:"islamic"},n.textContent=this.globalize.formatDate(this.value||new Date,e)+", ",e="Gregorian"===this.calendarMode?{format:"MMM d",skeleton:"dateTime"}:{format:"MMM d",skeleton:"dateTime",calendar:"islamic"},r.textContent=""+this.globalize.formatDate(this.value||new Date,e),this.fullScreenMode){var l=this.createElement("span",{className:"e-popup-close"});i.EventHandler.add(l,"mousedown touchstart",this.modelCloseHandler,this);var o=this.showTodayButton?this.calendarElement.querySelector("button.e-today"):null;a.classList.add("e-day-wrapper"),t.appendChild(l),o&&(o.classList.add("e-outline"),t.appendChild(o))}this.fullScreenMode||t.appendChild(s),a.appendChild(n),a.appendChild(r),t.appendChild(a),this.calendarElement.insertBefore(t,this.calendarElement.firstElementChild)},t.prototype.modelCloseHandler=function(e){this.hide()},t.prototype.changeTrigger=function(e){this.inputElement.value!==this.previousElementValue&&(this.previousDate&&this.previousDate.valueOf())!==(this.value&&this.value.valueOf())&&(this.isDynamicValueChanged&&this.isCalendar()&&this.popupUpdate(),this.changedArgs.value=this.value,this.changedArgs.event=e||null,this.changedArgs.element=this.element,this.changedArgs.isInteracted=!(0,i.isNullOrUndefined)(e),this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",this.changedArgs),this.previousElementValue=this.inputElement.value,this.previousDate=isNaN(+new Date(this.checkValue(this.value)))?null:new Date(this.checkValue(this.value)),this.isInteracted=!0),this.isKeyAction=!1},t.prototype.navigatedEvent=function(e){(0,i.extend)(this.navigatedArgs,{name:"navigated",event:e}),this.trigger("navigated",this.navigatedArgs)},t.prototype.keyupHandler=function(e){this.isKeyAction=this.inputElement.value!==this.previousElementValue,this.enableMask&&this.showClearButton&&this.inputElement&&this.inputElement.value===this.maskedDateValue&&this.inputWrapper&&this.inputWrapper.clearButton&&!this.inputWrapper.clearButton.classList.contains("e-clear-icon-hide")&&this.inputWrapper.clearButton.classList.add("e-clear-icon-hide")},t.prototype.changeEvent=function(e){this.isIconClicked||this.isBlur||this.isKeyAction||this.selectCalendar(e),(this.previousDate&&this.previousDate.valueOf())!==(this.value&&this.value.valueOf())?(this.changedArgs.event=e||null,this.changedArgs.element=this.element,this.changedArgs.isInteracted=this.isInteracted,this.isDynamicValueChanged||(this.isAngular&&(this.previousDate=this.value&&new Date(+this.value)),this.trigger("change",this.changedArgs)),this.previousDate=this.value&&new Date(+this.value),this.isDynamicValueChanged||this.hide(e),this.previousElementValue=this.inputElement.value,this.errorClass()):e&&this.hide(e),this.isKeyAction=!1},t.prototype.requiredModules=function(){var e=[];return"Islamic"===this.calendarMode&&e.push({args:[this],member:"islamic",name:"Islamic"}),this.enableMask&&e.push({args:[this],member:"MaskedDateTime"}),e},t.prototype.selectCalendar=function(e){var t,s,a;s="datetimepicker"===this.getModuleName()&&(0,i.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString,this.value&&("datetimepicker"===this.getModuleName()?(a="Gregorian"===this.calendarMode?{format:s,type:"dateTime",skeleton:"yMd"}:{format:s,type:"dateTime",skeleton:"yMd",calendar:"islamic"},t=this.globalize.formatDate(this.changedArgs.value,a)):(a="Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"},t=this.globalize.formatDate(this.changedArgs.value,a)),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"})),(0,i.isNullOrUndefined)(t)||(this.updateInputValue(t),this.enableMask&&this.notify("setMaskSelection",{module:"MaskedDateTime"}))},t.prototype.isCalendar=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains(""+q))},t.prototype.setWidth=function(e){this.inputWrapper.container.style.width="number"==typeof e?(0,i.formatUnit)(this.width):"string"==typeof e?e.match(/px|%|em/)?this.width:(0,i.formatUnit)(this.width):"100%",this.updateFloatLabelOverflowWidth()},t.prototype.show=function(t,s){var a=this;if(!(this.enabled&&this.readonly||!this.enabled||this.popupObj)){var n=!0,r=void 0;(0,i.isNullOrUndefined)(this.value)||+this.value>=+new Date(this.checkValue(this.min))&&+this.value<=+new Date(this.checkValue(this.max))?r=this.value||null:(r=new Date(this.checkValue(this.value)),this.setProperties({value:null},!0)),this.isCalendar()||(e.prototype.render.call(this),this.setProperties({value:r||null},!0),this.previousDate=r,this.createCalendar()),i.Browser.isDevice&&(this.mobilePopupWrapper=this.createElement("div",{className:"e-datepick-mob-popup-wrap"}),document.body.appendChild(this.mobilePopupWrapper)),this.preventArgs={preventDefault:function(){n=!1},popup:this.popupObj,event:s||null,cancel:!1,appendTo:i.Browser.isDevice?this.mobilePopupWrapper:document.body};var l=this.preventArgs;this.trigger("open",l,function(t){if(a.preventArgs=t,n&&!a.preventArgs.cancel){(0,i.addClass)(a.inputWrapper.buttons,G),a.preventArgs.appendTo.appendChild(a.popupWrapper),a.popupObj.refreshPosition(a.inputElement);var s={name:"FadeIn",duration:i.Browser.isDevice?0:300};if(1e3===a.zIndex?a.popupObj.show(new i.Animation(s),a.element):a.popupObj.show(new i.Animation(s),null),e.prototype.setOverlayIndex.call(a,a.mobilePopupWrapper,a.popupObj.element,a.modal,i.Browser.isDevice),a.setAriaAttributes(),i.Browser.isDevice){var r=a.createElement("div",{className:"e-dlg-overlay"});r.style.zIndex=(a.zIndex-1).toString(),a.mobilePopupWrapper.appendChild(r)}}else a.popupObj.destroy(),a.popupWrapper=a.popupObj=null;(0,i.isNullOrUndefined)(a.inputElement)||""!==a.inputElement.value||!(0,i.isNullOrUndefined)(a.tableBodyElement)&&a.tableBodyElement.querySelectorAll("td.e-selected").length>0&&((0,i.addClass)([a.tableBodyElement.querySelector("td.e-selected")],"e-focused-date"),(0,i.removeClass)(a.tableBodyElement.querySelectorAll("td.e-selected"),X)),i.EventHandler.add(document,"mousedown touchstart",a.documentHandler,a)})}},t.prototype.hide=function(e){var t=this;if((0,i.isNullOrUndefined)(this.popupWrapper))i.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit();else{var s=!0;this.preventArgs={preventDefault:function(){s=!1},popup:this.popupObj,event:e||null,cancel:!1},(0,i.removeClass)(this.inputWrapper.buttons,G),(0,i.removeClass)([document.body],Z);var a=this.preventArgs;this.isCalendar()?this.trigger("close",a,function(e){t.closeEventCallback(s,e)}):this.closeEventCallback(s,a)}},t.prototype.closeEventCallback=function(e,t){var s=this;this.preventArgs=t,this.isCalendar()&&e&&!this.preventArgs.cancel&&(this.popupObj.hide(),this.isAltKeyPressed=!1,this.keyboardModule.destroy(),(0,i.removeClass)(this.inputWrapper.buttons,G)),this.setAriaAttributes(),i.Browser.isDevice&&this.modal&&(this.modal.style.display="none",this.modal.outerHTML="",this.modal=null),i.Browser.isDevice&&((0,i.isNullOrUndefined)(this.mobilePopupWrapper)||!e||!(0,i.isNullOrUndefined)(this.preventArgs)&&this.preventArgs.cancel||(this.mobilePopupWrapper.remove(),this.mobilePopupWrapper=null)),i.EventHandler.remove(document,"mousedown touchstart",this.documentHandler),i.Browser.isDevice&&this.allowEdit&&!this.readonly&&(this.inputElement.removeAttribute("readonly"),i.Browser.isIos&&setTimeout(function(){s.inputElement.focus()},1)),this.setAllowEdit()},t.prototype.focusIn=function(e){document.activeElement!==this.inputElement&&this.enabled&&(this.inputElement.focus(),(0,i.addClass)([this.inputWrapper.container],[K]))},t.prototype.focusOut=function(){document.activeElement===this.inputElement&&((0,i.removeClass)([this.inputWrapper.container],[K]),this.inputElement.blur())},t.prototype.currentView=function(){var t;return this.calendarElement&&(t=e.prototype.currentView.call(this)),t},t.prototype.navigateTo=function(t,i){this.calendarElement&&e.prototype.navigateTo.call(this,t,i)},t.prototype.destroy=function(){this.unBindEvents(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),e.prototype.destroy.call(this),j.Input.destroy({element:this.inputElement,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),(0,i.isNullOrUndefined)(this.keyboardModules)||this.keyboardModules.destroy(),this.popupObj&&this.popupObj.element.classList.contains("e-popup")&&e.prototype.destroy.call(this);this.inputElement.hasAttribute("aria-label")&&this.inputElement.removeAttribute("aria-label"),this.inputElement&&(j.Input.removeAttributes({"aria-atomic":"true","aria-disabled":"true","aria-expanded":"false",role:"combobox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false"},this.inputElement),(0,i.isNullOrUndefined)(this.inputElementCopy.getAttribute("tabindex"))?this.inputElement.removeAttribute("tabindex"):this.inputElement.setAttribute("tabindex",this.tabIndex),i.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),i.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),this.ensureInputAttribute()),this.isCalendar()&&(this.popupWrapper&&(0,i.detach)(this.popupWrapper),this.popupObj=this.popupWrapper=null,this.keyboardModule.destroy()),null===this.ngTag&&(this.inputElement&&((0,i.isNullOrUndefined)(this.inputWrapper)||this.inputWrapper.container.insertAdjacentElement("afterend",this.inputElement),(0,i.removeClass)([this.inputElement],["e-input"])),(0,i.removeClass)([this.element],[z]),(0,i.isNullOrUndefined)(this.inputWrapper)||(0,i.detach)(this.inputWrapper.container)),this.formElement&&i.EventHandler.remove(this.formElement,"reset",this.resetFormHandler),this.inputWrapper=null,this.keyboardModules=null},t.prototype.ensureInputAttribute=function(){for(var e=[],t=0;t<this.inputElement.attributes.length;t++)e[t]=this.inputElement.attributes[t].name;for(t=0;t<e.length;t++)(0,i.isNullOrUndefined)(this.inputElementCopy.getAttribute(e[t]))?("value"===e[t].toLowerCase()&&(this.inputElement.value=""),this.inputElement.removeAttribute(e[t])):("value"===e[t].toLowerCase()&&(this.inputElement.value=this.inputElementCopy.getAttribute(e[t])),this.inputElement.setAttribute(e[t],this.inputElementCopy.getAttribute(e[t])))},t.prototype.preRender=function(){this.inputElementCopy=this.element.cloneNode(!0),(0,i.removeClass)([this.inputElementCopy],[z,"e-control","e-lib"]),this.inputElement=this.element,this.formElement=(0,i.closest)(this.inputElement,"form"),this.index=this.showClearButton?2:1,this.ngTag=null,"EJS-DATEPICKER"!==this.element.tagName&&"EJS-DATETIMEPICKER"!==this.element.tagName||(this.ngTag=this.element.tagName,this.inputElement=this.createElement("input"),this.element.appendChild(this.inputElement)),this.element.getAttribute("id")?null!==this.ngTag&&(this.inputElement.id=this.element.getAttribute("id")+"_input"):"datetimepicker"===this.getModuleName()?(this.element.id=(0,i.getUniqueID)("ej2-datetimepicker"),null!==this.ngTag&&(0,i.attributes)(this.inputElement,{id:this.element.id+"_input"})):(this.element.id=(0,i.getUniqueID)("ej2-datepicker"),null!==this.ngTag&&(0,i.attributes)(this.inputElement,{id:this.element.id+"_input"})),null!==this.ngTag&&this.validationAttribute(this.element,this.inputElement),this.updateHtmlAttributeToElement(),this.defaultKeyConfigs=this.getDefaultKeyConfig(),this.checkHtmlAttributes(!1),this.inputFormats&&this.checkInputFormats(),null!==this.ngTag?(this.tabIndex=this.inputElement.hasAttribute("tabindex")?this.inputElement.getAttribute("tabindex"):"0",this.inputElement.removeAttribute("tabindex")):(this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex")),e.prototype.preRender.call(this)},t.prototype.getDefaultKeyConfig=function(){return this.defaultKeyConfigs={altUpArrow:"alt+uparrow",altDownArrow:"alt+downarrow",escape:"escape",enter:"enter",controlUp:"ctrl+38",controlDown:"ctrl+40",moveDown:"downarrow",moveUp:"uparrow",moveLeft:"leftarrow",moveRight:"rightarrow",select:"enter",home:"home",end:"end",pageUp:"pageup",pageDown:"pagedown",shiftPageUp:"shift+pageup",shiftPageDown:"shift+pagedown",controlHome:"ctrl+home",controlEnd:"ctrl+end",shiftTab:"shift+tab",tab:"tab"},this.defaultKeyConfigs},t.prototype.validationAttribute=function(e,t){var s=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id");t.setAttribute("name",s),e.removeAttribute("name");for(var a=["required","aria-required","form"],n=0;n<a.length;n++)if(!(0,i.isNullOrUndefined)(e.getAttribute(a[n]))){var r=e.getAttribute(a[n]);t.setAttribute(a[n],r),e.removeAttribute(a[n])}},t.prototype.checkFormat=function(){var e=new i.Internationalization(this.locale);if(this.format)if("string"==typeof this.format)this.formatString=this.format;else if(""===this.format.skeleton||(0,i.isNullOrUndefined)(this.format.skeleton))"datetimepicker"===this.getModuleName()?this.formatString=this.dateTimeFormat:this.formatString=null;else{var t=this.format.skeleton;"datetimepicker"===this.getModuleName()?this.formatString=e.getDatePattern({skeleton:t,type:"dateTime"}):this.formatString=e.getDatePattern({skeleton:t,type:"date"})}else this.formatString=null},t.prototype.checkInputFormats=function(){var e=new i.Internationalization(this.locale);if(this.inputFormatsString=[],this.inputFormats){for(var t=0,s=this.inputFormats;t<s.length;t++){var a=s[t],n="";if("string"==typeof a)n=a;else if(""!==a.skeleton&&!(0,i.isNullOrUndefined)(a.skeleton)){var r=a.skeleton;n="datetimepicker"===this.getModuleName()?e.getDatePattern({skeleton:r,type:"dateTime"}):e.getDatePattern({skeleton:r,type:"date"})}n&&this.inputFormatsString.push(n)}0===this.inputFormatsString.length&&(this.inputFormatsString=null)}else this.inputFormatsString=null},t.prototype.checkHtmlAttributes=function(e){this.globalize=new i.Internationalization(this.locale),this.checkFormat(),this.checkView();var t,s=e?(0,i.isNullOrUndefined)(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["value","min","max","disabled","readonly","style","name","placeholder","type"];t="datetimepicker"===this.getModuleName()?"Gregorian"===this.calendarMode?{format:(0,i.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:(0,i.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"}:"Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"};for(var a=0,n=s;a<n.length;a++){var r=n[a];if(!(0,i.isNullOrUndefined)(this.inputElement.getAttribute(r)))switch(r){case"disabled":if((0,i.isNullOrUndefined)(this.datepickerOptions)||void 0===this.datepickerOptions.enabled||e){var l="disabled"!==this.inputElement.getAttribute(r)&&""!==this.inputElement.getAttribute(r)&&"true"!==this.inputElement.getAttribute(r);this.setProperties({enabled:l},!e)}break;case"readonly":if((0,i.isNullOrUndefined)(this.datepickerOptions)||void 0===this.datepickerOptions.readonly||e){var o="readonly"===this.inputElement.getAttribute(r)||""===this.inputElement.getAttribute(r)||"true"===this.inputElement.getAttribute(r);this.setProperties({readonly:o},!e)}break;case"placeholder":((0,i.isNullOrUndefined)(this.datepickerOptions)||void 0===this.datepickerOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(r)},!e);break;case"style":this.inputElement.setAttribute("style",""+this.inputElement.getAttribute(r));break;case"name":this.inputElement.setAttribute("name",""+this.inputElement.getAttribute(r));break;case"value":if((0,i.isNullOrUndefined)(this.datepickerOptions)||void 0===this.datepickerOptions.value||e){var h=this.inputElement.getAttribute(r);this.setProperties((0,i.setValue)(r,this.globalize.parseDate(this.getAmPmValue(h),t),{}),!e)}break;case"min":if(+this.min===+new Date(1900,0,1)||e){var u=this.inputElement.getAttribute(r);this.setProperties((0,i.setValue)(r,this.globalize.parseDate(this.getAmPmValue(u),t),{}),!e)}break;case"max":if(+this.max===+new Date(2099,11,31)||e){var d=this.inputElement.getAttribute(r);this.setProperties((0,i.setValue)(r,this.globalize.parseDate(this.getAmPmValue(d),t),{}),!e)}break;case"type":"text"!==this.inputElement.getAttribute(r)&&this.inputElement.setAttribute("type","text")}}},t.prototype.getModuleName=function(){return"datepicker"},t.prototype.updateFloatLabelOverflowWidth=function(){for(var e=this.inputWrapper.container,t=e.querySelector(".e-float-text.e-label-bottom"),i=0,s=e.querySelectorAll(".e-input-group-icon, .e-clear-icon"),a=0;a<s.length;a++)i+=s[a].offsetWidth;if(t){var n=this.element.parentElement.offsetWidth-i;!n||this.cssClass&&-1!==this.cssClass.split(" ").indexOf("e-outline")||(t.style.width=n+"px")}},t.prototype.clearFloatLabelOverflowWidth=function(){var e=this.inputWrapper.container.querySelector(".e-float-text.e-label-top");e&&e.removeAttribute("style")},t.prototype.disabledDates=function(t,s){var a;void 0===t&&(t=!1),void 0===s&&(s=!1);var n=this.checkDateValue(this.value)?new Date(+this.value):new Date(this.checkValue(this.value)),r=this.previousDate;this.minMaxUpdates(),(!t||t&&!(0,i.isNullOrUndefined)(this.renderDayCell))&&e.prototype.render.call(this),this.previousDate=r;var l,o='*[id^="/id"]'.replace("/id",""+(n&&+n));this.strictMode||("string"==typeof this.value||"object"==typeof this.value&&+this.value!==+n)&&this.setProperties({value:n},!0),(0,i.isNullOrUndefined)(this.calendarElement)||(0,i.isNullOrUndefined)(this.calendarElement.querySelectorAll(o)[0])||this.calendarElement.querySelectorAll(o)[0].classList.contains("e-disabled")&&(this.strictMode||(this.currentDate=new Date((new Date).setHours(0,0,0,0)))),"datetimepicker"===this.getModuleName()?l="Gregorian"===this.calendarMode?this.globalize.formatDate(n,{format:(0,i.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd"}):this.globalize.formatDate(n,{format:(0,i.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"}):(a="Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"},l=this.globalize.formatDate(n,a)),this.popupObj||(this.updateInputValue(l),this.enableMask&&(this.updateInputValue(this.maskedDateValue),this.notify("createMask",{module:"MaskedDateTime",isBlur:s})))},t.prototype.setAriaAttributes=function(){this.isCalendar()?(j.Input.addAttributes({"aria-expanded":"true"},this.inputElement),(0,i.attributes)(this.inputElement,{"aria-owns":this.inputElement.id+"_options"}),(0,i.attributes)(this.inputElement,{"aria-controls":this.inputElement.id}),this.value&&(0,i.attributes)(this.inputElement,{"aria-activedescendant":""+this.setActiveDescendant()})):(j.Input.addAttributes({"aria-expanded":"false"},this.inputElement),this.inputElement.removeAttribute("aria-owns"),this.inputElement.removeAttribute("aria-controls"),this.inputElement.removeAttribute("aria-activedescendant"))},t.prototype.errorClass=function(){var e='*[id^="/id"]'.replace("/id",""+ +this.value),t=this.calendarElement&&this.calendarElement.querySelectorAll(e)[0]&&this.calendarElement.querySelectorAll(e)[0].classList.contains("e-disabled");!((0,i.isNullOrUndefined)(this.value)||(0,i.isNullOrUndefined)(this.min)||(0,i.isNullOrUndefined)(this.max)||new Date(this.value).setMilliseconds(0)>=new Date(this.min).setMilliseconds(0)&&new Date(this.value).setMilliseconds(0)<=new Date(this.max).setMilliseconds(0))||!this.strictMode&&""!==this.inputElement.value&&this.inputElement.value!==this.maskedDateValue&&(0,i.isNullOrUndefined)(this.value)||t||!this.isValidTime(this.value)?((0,i.addClass)([this.inputWrapper.container],_),(0,i.attributes)(this.inputElement,{"aria-invalid":"true"})):(0,i.isNullOrUndefined)(this.inputWrapper)||((0,i.removeClass)([this.inputWrapper.container],_),(0,i.attributes)(this.inputElement,{"aria-invalid":"false"}))},t.prototype.isValidTime=function(e){return!0},t.prototype.onPropertyChanged=function(t,s){for(var a=0,n=Object.keys(t);a<n.length;a++){var r=n[a];switch(["blur","change","cleared","close","created","destroyed","focus","navigated","open","renderDayCell"].indexOf(r)>0&&this.isReact&&(this.isDynamicValueChanged=!0),r){case"value":this.isDynamicValueChanged=!0,this.isInteracted=!1,this.invalidValueString=null,this.checkInvalidValue(t.value),t.value=this.value,this.previousElementValue=this.inputElement.value,(0,i.isNullOrUndefined)(this.value)&&(this.enableMask?this.updateInputValue(this.maskedDateValue):this.updateInputValue(""),this.currentDate=new Date((new Date).setHours(0,0,0,0))),this.updateInput(!0),+this.previousDate!==+this.value&&this.changeTrigger(null),this.isInteracted=!0,this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange,this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"});break;case"format":this.checkFormat(),this.bindInputEvent(),this.updateInput(),this.enableMask&&(this.notify("createMask",{module:"MaskedDateTime"}),this.value||this.updateInputValue(this.maskedDateValue));break;case"inputFormats":this.checkInputFormats();break;case"allowEdit":this.setAllowEdit();break;case"placeholder":j.Input.setPlaceholder(this.placeholder,this.inputElement);break;case"readonly":j.Input.setReadonly(this.readonly,this.inputElement);break;case"enabled":j.Input.setEnabled(this.enabled,this.inputElement),this.setAriaDisabled();break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.checkHtmlAttributes(!0);break;case"locale":this.globalize=new i.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.datepickerOptions&&null==this.datepickerOptions.placeholder&&(this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),j.Input.setPlaceholder(this.placeholder,this.inputElement)),this.updateInput(),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"});break;case"enableRtl":j.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]);break;case"start":case"depth":this.checkView(),this.calendarElement&&e.prototype.onPropertyChanged.call(this,t,s);break;case"zIndex":this.setProperties({zIndex:t.zIndex},!0);break;case"cssClass":this.updateCssClass(t.cssClass,s.cssClass);break;case"showClearButton":j.Input.setClearButton(this.showClearButton,this.inputElement,this.inputWrapper),this.bindClearEvent(),this.index=this.showClearButton?2:1;break;case"strictMode":this.invalidValueString=null,this.updateInput();break;case"width":this.setWidth(t.width),j.Input.calculateWidth(this.inputElement,this.inputWrapper.container),(0,i.isNullOrUndefined)(this.inputWrapper.buttons[0])||(0,i.isNullOrUndefined)(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon");break;case"floatLabelType":this.floatLabelType=t.floatLabelType,j.Input.removeFloating(this.inputWrapper),j.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder),(0,i.isNullOrUndefined)(this.inputWrapper.buttons[0])||(0,i.isNullOrUndefined)(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon");break;case"enableMask":this.enableMask?(this.notify("createMask",{module:"MaskedDateTime"}),this.updateInputValue(this.maskedDateValue),this.bindInputEvent()):this.inputElement.value===this.maskedDateValue&&this.updateInputValue("");break;case"min":case"max":"min"===r&&(0,i.isNullOrUndefined)(this.min)&&(this.min=new Date(1900,0,1)),"max"===r&&(0,i.isNullOrUndefined)(this.max)&&(this.max=new Date(2099,11,31)),this.errorClass();break;default:this.calendarElement&&this.isCalendar()&&e.prototype.onPropertyChanged.call(this,t,s)}this.isDynamicValueChanged||this.hide(null),this.isDynamicValueChanged=!1}},t.prototype.addDate=function(e){},R([(0,i.Property)(null)],t.prototype,"width",void 0),R([(0,i.Property)(null)],t.prototype,"value",void 0),R([(0,i.Property)(null)],t.prototype,"cssClass",void 0),R([(0,i.Property)(!1)],t.prototype,"strictMode",void 0),R([(0,i.Property)(null)],t.prototype,"format",void 0),R([(0,i.Property)(null)],t.prototype,"inputFormats",void 0),R([(0,i.Property)(!0)],t.prototype,"enabled",void 0),R([(0,i.Property)(!1)],t.prototype,"fullScreenMode",void 0),R([(0,i.Property)({})],t.prototype,"htmlAttributes",void 0),R([(0,i.Property)(null)],t.prototype,"values",void 0),R([(0,i.Property)(!1)],t.prototype,"isMultiSelection",void 0),R([(0,i.Property)(!0)],t.prototype,"showClearButton",void 0),R([(0,i.Property)(!0)],t.prototype,"allowEdit",void 0),R([(0,i.Property)(null)],t.prototype,"keyConfigs",void 0),R([(0,i.Property)(!1)],t.prototype,"enablePersistence",void 0),R([(0,i.Property)(1e3)],t.prototype,"zIndex",void 0),R([(0,i.Property)(!1)],t.prototype,"readonly",void 0),R([(0,i.Property)(null)],t.prototype,"placeholder",void 0),R([(0,i.Property)("Never")],t.prototype,"floatLabelType",void 0),R([(0,i.Property)(null)],t.prototype,"serverTimezoneOffset",void 0),R([(0,i.Property)(!1)],t.prototype,"openOnFocus",void 0),R([(0,i.Property)(!1)],t.prototype,"enableMask",void 0),R([(0,i.Property)({day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"})],t.prototype,"maskPlaceholder",void 0),R([(0,i.Event)()],t.prototype,"open",void 0),R([(0,i.Event)()],t.prototype,"cleared",void 0),R([(0,i.Event)()],t.prototype,"close",void 0),R([(0,i.Event)()],t.prototype,"blur",void 0),R([(0,i.Event)()],t.prototype,"focus",void 0),R([(0,i.Event)()],t.prototype,"created",void 0),R([(0,i.Event)()],t.prototype,"destroyed",void 0),t=R([i.NotifyPropertyChanges],t)}(T),ee=l(741),te=l(90),ie=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),se=function(e,t,i,s){var a,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(r=(n<3?a(r):n>3?a(t,i,r):a(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},ae="e-input-group",ne="e-popup",re="e-left-calendar",le="e-right-calendar",oe="e-daterangepicker",he="e-error",ue="e-active",de="e-start-date",pe="e-end-date",ce="e-start-btn",me="e-input-focus",fe="e-range-hover",ve="e-other-month",ge="e-start-label",ye="e-end-label",be="e-disabled",De="e-selected",Ee="e-calendar",Ce="e-next",ke="e-prev",Me="e-header",we="e-title",Ve="e-icon-container",Oe="e-date-range-container",Ne="e-presets",Ie="e-today",Te="e-focused-date",xe="e-content",Se="e-day-span",Pe="e-week-number",Ae="e-date-disabled",Ue="e-icon-disabled",He="e-device",We="e-overlay",Fe="e-list-item",Le="e-hover",Be="e-range-overflow",je="e-flat",Ye="e-css",Re="e-non-edit",ze="e-daterange-hidden",qe=["title","class","style"],Ke=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ie(t,e),se([(0,i.Property)()],t.prototype,"label",void 0),se([(0,i.Property)()],t.prototype,"start",void 0),se([(0,i.Property)()],t.prototype,"end",void 0),t}(i.ChildProperty),_e=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.isCustomRange=!1,s.isCustomWindow=!1,s.presetsItem=[],s.liCollections=[],s.previousEleValue="",s.isKeyPopup=!1,s.dateDisabled=!1,s.isRangeIconClicked=!1,s.isMaxDaysClicked=!1,s.disabledDays=[],s.preventBlur=!1,s.preventFocus=!1,s.invalidValueString=null,s.preventChange=!1,s.dateRangeOptions=t,s}return ie(t,e),t.prototype.render=function(){this.initialize(),this.setProperties({startDate:this.startValue},!0),this.setProperties({endDate:this.endValue},!0),this.setModelValue(),this.setDataAttribute(!1),this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false"),"Never"!==this.floatLabelType&&j.Input.calculateWidth(this.inputElement,this.inputWrapper.container),(0,i.isNullOrUndefined)(this.inputWrapper.buttons[0])||(0,i.isNullOrUndefined)(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon"),!(0,i.isNullOrUndefined)((0,i.closest)(this.element,"fieldset"))&&(0,i.closest)(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete()},t.prototype.preRender=function(){if(this.keyInputConfigs={altDownArrow:"alt+downarrow",escape:"escape",enter:"enter",tab:"tab",altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow",moveUp:"uparrow",moveDown:"downarrow",spacebar:"space"},this.defaultConstant={placeholder:this.placeholder,startLabel:"Start Date",endLabel:"End Date",customRange:"Custom Range",applyText:"Apply",cancelText:"Cancel",selectedDays:"Selected Days",days:"days"},this.isMobile=!!i.Browser.isDevice||window.matchMedia("(max-width:550px)").matches,this.inputElement=this.element,this.angularTag=null,"EJS-DATERANGEPICKER"===this.element.tagName&&(this.angularTag=this.element.tagName,this.inputElement=this.createElement("input"),this.element.appendChild(this.inputElement)),this.cloneElement=this.element.cloneNode(!0),(0,i.removeClass)([this.cloneElement],[oe,"e-control","e-lib"]),this.updateHtmlAttributeToElement(),this.element.getAttribute("id")?null!==this.angularTag&&(this.inputElement.id=this.element.getAttribute("id")+"_input"):(this.element.id=(0,i.getUniqueID)("ej2-datetimepicker"),null!==this.angularTag&&(0,i.attributes)(this.inputElement,{id:this.element.id+"_input"})),this.checkInvalidRange(this.value),!this.invalidValueString&&"string"==typeof this.value){var t=this.value.split(" "+this.separator+" ");this.value=[new Date(t[0]),new Date(t[1])]}this.initProperty(),this.inputFormats&&this.checkInputFormats(),null!==this.angularTag?(this.tabIndex=this.inputElement.hasAttribute("tabindex")?this.inputElement.getAttribute("tabindex"):"0",this.inputElement.removeAttribute("tabindex")):(this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex")),e.prototype.preRender.call(this),this.navNextFunction=this.navNextMonth.bind(this),this.navPrevFunction=this.navPrevMonth.bind(this),this.deviceNavNextFunction=this.deviceNavNext.bind(this),this.deviceNavPrevFunction=this.deviceNavPrevious.bind(this),this.initStartDate=this.checkDateValue(this.startValue),this.initEndDate=this.checkDateValue(this.endValue),this.formElement=(0,i.closest)(this.element,"form")},t.prototype.updateValue=function(){this.value&&this.value.length>0?(this.value[0]instanceof Date&&!isNaN(+this.value[0])?(this.setProperties({startDate:this.value[0]},!0),this.startValue=this.value[0]):"string"==typeof this.value[0]?0===+this.value[0]||isNaN(+new Date(this.checkValue(this.value[0])))?(this.startValue=null,this.setValue()):(this.setProperties({startDate:new Date(this.checkValue(this.value[0]))},!0),this.startValue=new Date(this.checkValue(this.value[0]))):(this.startValue=null,this.setValue()),this.value[1]instanceof Date&&!isNaN(+this.value[1])?(this.setProperties({endDate:this.value[1]},!0),this.endValue=this.value[1]):"string"==typeof this.value[1]?0===+this.value[0]||isNaN(+new Date(this.checkValue(this.value[0])))?(this.setProperties({endDate:null},!0),this.endValue=null,this.setValue()):(this.setProperties({endDate:new Date(this.checkValue(this.value[1]))},!0),this.endValue=new Date(this.checkValue(this.value[1])),this.setValue()):(this.setProperties({endDate:null},!0),this.endValue=null,this.setValue())):this.value&&this.value.start?(this.value.start instanceof Date&&!isNaN(+this.value.start)?(this.setProperties({startDate:this.value.start},!0),this.startValue=this.value.start):"string"==typeof this.value.start?(this.setProperties({startDate:new Date(this.checkValue(this.value.start))},!0),this.startValue=new Date(this.checkValue(this.value.start))):(this.startValue=null,this.setValue()),this.value.end instanceof Date&&!isNaN(+this.value.end)?(this.setProperties({endDate:this.value.end},!0),this.endValue=this.value.end):"string"==typeof this.value.end?(this.setProperties({endDate:new Date(this.checkValue(this.value.end))},!0),this.endValue=new Date(this.checkValue(this.value.end)),this.setValue()):(this.setProperties({endDate:null},!0),this.endValue=null,this.setValue())):(0,i.isNullOrUndefined)(this.value)&&(this.endValue=this.checkDateValue(new Date(this.checkValue(this.endDate))),this.startValue=this.checkDateValue(new Date(this.checkValue(this.startDate))),this.setValue())},t.prototype.initProperty=function(){this.globalize=new i.Internationalization(this.locale),this.checkFormat(),this.checkView(),((0,i.isNullOrUndefined)(this.firstDayOfWeek)||this.firstDayOfWeek>6||this.firstDayOfWeek<0)&&this.setProperties({firstDayOfWeek:this.globalize.getFirstDayOfWeek()},!0),this.updateValue()},t.prototype.checkFormat=function(){if(this.format)if("string"==typeof this.format)this.formatString=this.format;else if(""===this.format.skeleton||(0,i.isNullOrUndefined)(this.format.skeleton))this.formatString=null;else{var e=this.format.skeleton;this.formatString=this.globalize.getDatePattern({skeleton:e,type:"date"})}else this.formatString=null},t.prototype.checkInputFormats=function(){if(this.inputFormatsString=[],this.inputFormats){for(var e=0,t=this.inputFormats;e<t.length;e++){var s=t[e],a="";if("string"==typeof s)a=s;else if(""!==s.skeleton&&!(0,i.isNullOrUndefined)(s.skeleton)){var n=s.skeleton;a=this.globalize.getDatePattern({skeleton:n,type:"date"})}a&&this.inputFormatsString.push(a)}0===this.inputFormatsString.length&&(this.inputFormatsString=null)}else this.inputFormatsString=null},t.prototype.initialize=function(){null!==this.angularTag&&this.validationAttribute(this.element,this.inputElement),this.checkHtmlAttributes(!1),(0,i.merge)(this.defaultKeyConfigs,{shiftTab:"shift+tab",tab:"tab"});var e=this.checkDateValue(new Date(this.checkValue(this.startValue)));this.setProperties({startDate:e},!0),this.setProperties({endValue:this.checkDateValue(new Date(this.checkValue(this.endValue)))},!0),this.setValue(),this.setProperties({min:this.checkDateValue(new Date(this.checkValue(this.min)))},!0),this.setProperties({max:this.checkDateValue(new Date(this.checkValue(this.max)))},!0),this.l10n=new i.L10n("daterangepicker",this.defaultConstant,this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.processPresets(),this.createInput(),this.updateHtmlAttributeToWrapper(),this.setRangeAllowEdit(),this.bindEvents()},t.prototype.setDataAttribute=function(e){var t={};if(e)t=this.htmlAttributes;else for(var i=0;i<this.element.attributes.length;i++)t[this.element.attributes[i].name]=this.element.getAttribute(this.element.attributes[i].name);for(var s=0,a=Object.keys(t);s<a.length;s++){var n=a[s];0===n.indexOf("data")&&(this.firstHiddenChild.setAttribute(n,t[""+n]),this.secondHiddenChild.setAttribute(n,t[""+n]))}},t.prototype.setRangeAllowEdit=function(){this.allowEdit?this.readonly||this.inputElement.removeAttribute("readonly"):(0,i.attributes)(this.inputElement,{readonly:""}),this.updateClearIconState()},t.prototype.updateClearIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&(0,i.removeClass)([this.inputWrapper.container],[Re]):""===this.inputElement.value?(0,i.removeClass)([this.inputWrapper.container],[Re]):(0,i.addClass)([this.inputWrapper.container],[Re])},t.prototype.validationAttribute=function(e,t){var s=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id");t.setAttribute("name",s),e.removeAttribute("name");for(var a=["required","aria-required","form"],n=0;n<a.length;n++)if(!(0,i.isNullOrUndefined)(e.getAttribute(a[n]))){var r=e.getAttribute(a[n]);t.setAttribute(a[n],r),e.removeAttribute(a[n])}},t.prototype.updateHtmlAttributeToWrapper=function(){if(!(0,i.isNullOrUndefined)(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var s=t[e];if(qe.indexOf(s)>-1)if("class"===s){var a=this.htmlAttributes[""+s].replace(/\s+/g," ").trim();""!==a&&(0,i.addClass)([this.inputWrapper.container],a.split(" "))}else if("style"===s){var n=this.inputWrapper.container.getAttribute(s);n=(0,i.isNullOrUndefined)(n)?this.htmlAttributes[""+s]:n+this.htmlAttributes[""+s],this.inputWrapper.container.setAttribute(s,n)}else this.inputWrapper.container.setAttribute(s,this.htmlAttributes[""+s])}},t.prototype.updateHtmlAttributeToElement=function(){if(!(0,i.isNullOrUndefined)(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var s=t[e];qe.indexOf(s)<0&&this.inputElement.setAttribute(s,this.htmlAttributes[""+s])}},t.prototype.updateCssClass=function(e,t){(0,i.isNullOrUndefined)(t)||(t=t.replace(/\s+/g," ").trim()),(0,i.isNullOrUndefined)(e)||(e=e.replace(/\s+/g," ").trim()),j.Input.setCssClass(e,[this.inputWrapper.container],t),this.popupWrapper&&j.Input.setCssClass(e,[this.popupWrapper],t)},t.prototype.processPresets=function(){this.presetsItem=[];var e=0;if(!(0,i.isNullOrUndefined)(this.presets[0])&&!(0,i.isUndefined)(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)){for(var t=0,s=this.presets;t<s.length;t++){var a=s[t],n=a.label.replace(/\s+/g,"")+"_"+ ++e;"string"==typeof a.end?this.presetsItem.push({id:n,text:a.label,end:new Date(this.checkValue(a.end)),start:new Date(this.checkValue(a.start))}):this.presetsItem.push({id:n,text:a.label,start:a.start,end:a.end})}var r=(0,i.isNullOrUndefined)(this.startValue)?null:new Date(+this.startValue),l=(0,i.isNullOrUndefined)(this.endValue)?null:new Date(+this.endValue);this.presetsItem.push({id:"custom_range",text:this.l10n.getConstant("customRange"),start:r,end:l}),(0,i.isNullOrUndefined)(this.startValue)||(0,i.isNullOrUndefined)(this.endValue)||(this.isCustomRange=!0,this.activeIndex=this.presetsItem.length-1)}},t.prototype.bindEvents=function(){i.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler,this),i.EventHandler.add(this.inputElement,"focus",this.inputFocusHandler,this),i.EventHandler.add(this.inputElement,"blur",this.inputBlurHandler,this),i.EventHandler.add(this.inputElement,"change",this.inputChangeHandler,this),this.showClearButton&&this.inputWrapper.clearButton&&i.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this),this.isMobile||(this.keyInputConfigs=(0,i.extend)(this.keyInputConfigs,this.keyConfigs),this.inputKeyboardModule=new i.KeyboardEvents(this.inputElement,{eventName:"keydown",keyAction:this.inputHandler.bind(this),keyConfigs:this.keyInputConfigs})),this.formElement&&i.EventHandler.add(this.formElement,"reset",this.formResetHandler,this),this.enabled?this.inputElement.setAttribute("tabindex",this.tabIndex):this.inputElement.tabIndex=-1},t.prototype.unBindEvents=function(){i.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler),i.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),i.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),i.EventHandler.remove(this.inputElement,"change",this.inputChangeHandler),this.showClearButton&&this.inputWrapper.clearButton&&i.EventHandler.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler),this.isMobile||(0,i.isNullOrUndefined)(this.inputKeyboardModule)||this.inputKeyboardModule.destroy(),this.formElement&&i.EventHandler.remove(this.formElement,"reset",this.formResetHandler),this.inputElement.tabIndex=-1},t.prototype.updateHiddenInput=function(){if(this.firstHiddenChild&&this.secondHiddenChild){var e={format:this.formatString,type:"datetime",skeleton:"yMd"};"string"==typeof this.startDate&&(this.startDate=this.globalize.parseDate(this.getAmPmValue(this.startDate),e)),"string"==typeof this.endDate&&(this.endDate=this.globalize.parseDate(this.getAmPmValue(this.endDate),e)),this.firstHiddenChild.value=this.startDate&&this.globalize.formatDate(this.startDate,e)||this.inputElement.value,this.secondHiddenChild.value=this.endDate&&this.globalize.formatDate(this.endDate,e)||this.inputElement.value,this.dispatchEvent(this.firstHiddenChild,"focusout"),this.dispatchEvent(this.firstHiddenChild,"change")}},t.prototype.inputChangeHandler=function(e){this.enabled&&(e.stopPropagation(),this.updateHiddenInput())},t.prototype.bindClearEvent=function(){this.showClearButton&&this.inputWrapper.clearButton&&i.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this)},t.prototype.resetHandler=function(e){if(this.enabled){this.valueType=this.value,e.preventDefault(),this.clear();var t={event:e};if(this.setProperties({endDate:this.checkDateValue(this.endValue)},!0),this.setProperties({startDate:this.checkDateValue(this.startValue)},!0),this.trigger("cleared",t),this.changeTrigger(e),this.clearRange(),this.hide(e),(0,i.closest)(this.element,"form")){var s=this.firstHiddenChild,a=document.createEvent("KeyboardEvent");a.initEvent("keyup",!1,!0),s.dispatchEvent(a)}}},t.prototype.restoreValue=function(){this.previousEleValue=this.inputElement.value,this.previousStartValue=this.startValue,this.previousEndValue=this.endValue,this.valueType=null,this.initStartDate=this.checkDateValue(this.startValue),this.initEndDate=this.checkDateValue(this.endValue),this.setValue(),this.setModelValue()},t.prototype.formResetHandler=function(e){if(this.enabled&&this.formElement&&e.target===this.formElement&&!this.inputElement.disabled){var t=this.inputElement.getAttribute("value");(0,i.isNullOrUndefined)(this.startCopy)?(this.setProperties({value:null,startDate:null,endDate:null},!0),this.startValue=this.endValue=null):((0,i.isNullOrUndefined)(this.value)||(0,i.isNullOrUndefined)(this.value.start)?(this.setProperties({value:[this.startCopy,this.endCopy]},!0),this.startValue=this.value[0],this.endValue=this.value[1]):(this.setProperties({value:{start:this.startCopy,end:this.endCopy}},!0),this.startValue=this.value.start,this.endValue=this.value.end),this.setProperties({startDate:this.startValue,endDate:this.endValue},!0)),"EJS-DATERANGEPICKER"===this.element.tagName&&(this.setProperties({value:null,startDate:null,endDate:null},!0),t="",this.startValue=this.endValue=null,this.inputElement.setAttribute("value","")),this.restoreValue(),this.inputElement&&(j.Input.setValue(t,this.inputElement,this.floatLabelType,this.showClearButton),this.errorClass())}},t.prototype.clear=function(){null!==this.startValue&&(this.startValue=null),null!==this.endValue&&(this.endValue=null),this.value&&this.value.start&&this.setProperties({value:{start:null,end:null}},!0),null!==this.value&&this.value.length>0&&this.setProperties({value:null},!0),j.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),(0,i.isNullOrUndefined)(this.applyButton)||(this.applyButton.disabled=this.applyButton.element.disabled=!0),this.removeSelection()},t.prototype.rangeIconHandler=function(e){this.enabled&&(this.isMobile&&this.inputElement.setAttribute("readonly",""),e.preventDefault(),this.targetElement=null,this.isPopupOpen()&&document.body.contains(this.popupObj.element)?this.applyFunction(e):(this.isRangeIconClicked=!0,this.inputWrapper.container.children[0].focus(),this.show(null,e),this.isMobile||(0,i.isNullOrUndefined)(this.leftCalendar)||(this.isRangeIconClicked=!1,this.calendarFocus(),this.isRangeIconClicked=!0),(0,i.addClass)([this.inputWrapper.container],[me])))},t.prototype.checkHtmlAttributes=function(e){this.globalize=new i.Internationalization(this.locale);for(var t=e?(0,i.isNullOrUndefined)(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["startDate","endDate","minDays","maxDays","min","max","disabled","readonly","style","name","placeholder","type","value"],s={format:this.formatString,type:"date",skeleton:"yMd"},a=0,n=t;a<n.length;a++){var r=n[a];if(!(0,i.isNullOrUndefined)(this.inputElement.getAttribute(r)))switch(r){case"disabled":if((0,i.isNullOrUndefined)(this.dateRangeOptions)||void 0===this.dateRangeOptions.enabled||e){var l="disabled"===this.inputElement.getAttribute(r)||""===this.inputElement.getAttribute(r)||"true"===this.inputElement.getAttribute(r);this.setProperties({enabled:!l},!e)}break;case"readonly":if((0,i.isNullOrUndefined)(this.dateRangeOptions)||void 0===this.dateRangeOptions.readonly||e){var o="readonly"===this.inputElement.getAttribute(r)||"true"===this.inputElement.getAttribute(r)||""===this.inputElement.getAttribute(r);this.setProperties({readonly:o},!e)}break;case"placeholder":((0,i.isNullOrUndefined)(this.dateRangeOptions)||void 0===this.dateRangeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(r)},!e);break;case"value":if((0,i.isNullOrUndefined)(this.dateRangeOptions)||void 0===this.dateRangeOptions.value||e){var h=this.inputElement.getAttribute(r);this.setProperties((0,i.setValue)(r,h,{}),!e)}break;case"style":this.inputElement.setAttribute("style",""+this.inputElement.getAttribute(r));break;case"min":if((0,i.isNullOrUndefined)(this.min)||+this.min===+new Date(1900,0,1)||e){var u=this.globalize.parseDate(this.getAmPmValue(this.inputElement.getAttribute(r)),s);this.setProperties((0,i.setValue)(r,u,{}),!e)}break;case"name":this.inputElement.setAttribute("name",""+this.inputElement.getAttribute(r));break;case"max":if((0,i.isNullOrUndefined)(this.max)||+this.max===+new Date(2099,11,31)||e){u=this.globalize.parseDate(this.getAmPmValue(this.inputElement.getAttribute(r)),s);this.setProperties((0,i.setValue)(r,u,{}),!e)}break;case"startDate":if((0,i.isNullOrUndefined)(this.startDate)){u=this.globalize.parseDate(this.getAmPmValue(this.inputElement.getAttribute(r)),s);this.startValue=u,this.setValue()}break;case"endDate":if((0,i.isNullOrUndefined)(this.endDate)){u=this.globalize.parseDate(this.getAmPmValue(this.inputElement.getAttribute(r)),s);this.endValue=u,this.setValue()}break;case"minDays":(0,i.isNullOrUndefined)(this.minDays)&&this.setProperties((0,i.setValue)(r,parseInt(this.inputElement.getAttribute(r),10),{}),!0);break;case"maxDays":(0,i.isNullOrUndefined)(this.maxDays)&&this.setProperties((0,i.setValue)(r,parseInt(this.inputElement.getAttribute(r),10),{}),!0);break;case"type":"text"!==this.inputElement.getAttribute(r)&&this.inputElement.setAttribute("type","text")}}},t.prototype.createPopup=function(){for(var e=0;e<this.presetsItem.length;e++)e!==this.presetsItem.length-1&&"custom_range"===this.presetsItem[e].id&&this.presetsItem.splice(e,1);this.activeIndex=this.presetsItem.length-1,this.isCustomRange=!0;for(e=0;e<=this.presetsItem.length-2;e++){var t=this.presetsItem[e].start,s=this.presetsItem[e].end;this.startValue&&this.endValue&&t.getDate()===this.startValue.getDate()&&t.getMonth()===this.startValue.getMonth()&&t.getFullYear()===this.startValue.getFullYear()&&s.getDate()===this.endValue.getDate()&&s.getMonth()===this.endValue.getMonth()&&s.getFullYear()===this.endValue.getFullYear()&&(this.activeIndex=e,this.isCustomRange=!1)}this.popupWrapper=(0,i.createElement)("div",{id:this.element.id+"_popup",className:oe+" "+ne}),this.popupWrapper.setAttribute("aria-label",this.element.id),this.popupWrapper.setAttribute("role","dialog"),this.adjustLongHeaderWidth();var a=!this.isCustomRange||this.isMobile;!(0,i.isUndefined)(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)&&a?(this.isCustomWindow=!1,this.createPresets(),this.listRippleEffect(),this.renderPopup()):(this.isCustomWindow=!0,this.renderControl())},t.prototype.renderControl=function(){this.createControl(),this.bindCalendarEvents(),this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar]),(0,i.isNullOrUndefined)(this.endValue)||(0,i.isNullOrUndefined)(this.startValue)||(0,i.isNullOrUndefined)(this.renderDayCellArgs)||!this.renderDayCellArgs.isDisabled||this.disabledDateRender(),this.updateHeader()},t.prototype.clearCalendarEvents=function(){this.leftCalPrevIcon&&this.leftCalNextIcon&&this.rightCalPrevIcon&&this.rightCalNextIcon&&(i.EventHandler.clearEvents(this.leftCalPrevIcon),i.EventHandler.clearEvents(this.leftCalNextIcon),i.EventHandler.clearEvents(this.rightCalPrevIcon),i.EventHandler.clearEvents(this.rightCalNextIcon))},t.prototype.updateNavIcons=function(){e.prototype.iconHandler.call(this)},t.prototype.calendarIconEvent=function(){this.clearCalendarEvents(),this.leftCalPrevIcon&&!this.leftCalPrevIcon.classList.contains(be)&&i.EventHandler.add(this.leftCalPrevIcon,"mousedown",this.navPrevFunction),this.leftCalNextIcon&&!this.leftCalNextIcon.classList.contains(be)&&i.EventHandler.add(this.leftCalNextIcon,"mousedown",this.navNextFunction),this.rightCalPrevIcon&&!this.rightCalPrevIcon.classList.contains(be)&&i.EventHandler.add(this.rightCalPrevIcon,"mousedown",this.navPrevFunction),this.rightCalNextIcon&&!this.rightCalNextIcon.classList.contains(be)&&i.EventHandler.add(this.rightCalNextIcon,"mousedown",this.navNextFunction)},t.prototype.bindCalendarEvents=function(){this.isMobile?(this.deviceCalendarEvent(),i.EventHandler.add(this.startButton.element,"click",this.deviceHeaderClick,this),i.EventHandler.add(this.endButton.element,"click",this.deviceHeaderClick,this)):(this.updateNavIcons(),this.calendarIconEvent(),this.calendarIconRipple(),this.headerTitleElement=this.popupObj.element.querySelector("."+le+" ."+Me+" ."+we),this.headerTitleElement=this.popupObj.element.querySelector("."+re+" ."+Me+" ."+we),this.defaultKeyConfigs=(0,i.extend)(this.defaultKeyConfigs,this.keyConfigs),this.leftKeyboardModule=new i.KeyboardEvents(this.leftCalendar,{eventName:"keydown",keyAction:this.keyInputHandler.bind(this),keyConfigs:this.defaultKeyConfigs}),this.rightKeyboardModule=new i.KeyboardEvents(this.rightCalendar,{eventName:"keydown",keyAction:this.keyInputHandler.bind(this),keyConfigs:this.defaultKeyConfigs})),this.start===this.depth&&this.bindCalendarCellEvents(),this.removeFocusedDate()},t.prototype.calendarIconRipple=function(){(0,i.rippleEffect)(this.leftCalPrevIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),(0,i.rippleEffect)(this.leftCalNextIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),(0,i.rippleEffect)(this.rightCalPrevIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),(0,i.rippleEffect)(this.rightCalNextIcon,{selector:".e-next",duration:400,isCenterRipple:!0})},t.prototype.deviceCalendarEvent=function(){i.EventHandler.clearEvents(this.nextIcon),i.EventHandler.clearEvents(this.previousIcon),(0,i.rippleEffect)(this.nextIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),(0,i.rippleEffect)(this.previousIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),this.nextIcon&&!this.nextIcon.classList.contains(be)&&i.EventHandler.add(this.nextIcon,"mousedown",this.deviceNavNextFunction),this.previousIcon&&!this.previousIcon.classList.contains(be)&&i.EventHandler.add(this.previousIcon,"mousedown",this.deviceNavPrevFunction)},t.prototype.deviceNavNext=function(e){var t=(0,i.closest)(e.target,"."+Ee);this.updateDeviceCalendar(t),this.navigateNext(e),this.deviceNavigation()},t.prototype.deviceNavPrevious=function(e){var t=(0,i.closest)(e.target,"."+Ee);this.updateDeviceCalendar(t),this.navigatePrevious(e),this.deviceNavigation()},t.prototype.updateDeviceCalendar=function(e){e&&(this.previousIcon=e.querySelector("."+ke),this.nextIcon=e.querySelector("."+Ce),this.calendarElement=e,this.deviceCalendar=e,this.contentElement=e.querySelector("."+xe),this.tableBodyElement=(0,i.select)("."+xe+" tbody",e),this.table=e.querySelector("."+xe).getElementsByTagName("table")[0],this.headerTitleElement=e.querySelector("."+Me+" ."+we),this.headerElement=e.querySelector("."+Me))},t.prototype.deviceHeaderClick=function(e){if(e.currentTarget.classList.contains(ce)&&!(0,i.isNullOrUndefined)(this.startValue)){this.endButton.element.classList.remove(ue),this.startButton.element.classList.add(ue);var t=this.popupObj.element.querySelector("."+Ee);this.updateDeviceCalendar(t),(0,i.isNullOrUndefined)(this.calendarElement.querySelector("."+de+":not(.e-other-month)"))&&(this.currentDate=new Date(+this.startValue),(0,i.remove)(this.tableBodyElement),this.createContentBody(),this.deviceNavigation()),this.removeClassDisabled()}else if(!(0,i.isNullOrUndefined)(this.startValue)&&!(0,i.isNullOrUndefined)(this.endValue)){this.startButton.element.classList.remove(ue),this.endButton.element.classList.add(ue);t=this.popupObj.element.querySelector("."+Ee);this.updateDeviceCalendar(t),(0,i.isNullOrUndefined)(this.calendarElement.querySelector("."+pe+":not(.e-other-month)"))&&(this.currentDate=new Date(+this.endValue),(0,i.remove)(this.tableBodyElement),this.createContentBody(),this.deviceNavigation()),this.updateMinMaxDays(this.popupObj.element.querySelector("."+Ee)),this.selectableDates()}},t.prototype.inputFocusHandler=function(){if(this.enabled){this.preventBlur=!1;var e={model:this};this.preventFocus||this.trigger("focus",e),this.updateClearIconState(),this.clearFloatLabelOverflowWidth(),this.openOnFocus&&!this.preventFocus?(this.preventFocus=!0,this.show()):this.preventFocus=!0}},t.prototype.inputBlurHandler=function(e){if(this.updateFloatLabelOverflowWidth(),this.enabled){if(!this.preventBlur){var t=this.inputElement.value;if((0,i.isNullOrUndefined)(this.presetsItem)||this.presetsItem.length>0&&this.previousEleValue!==this.inputElement.value&&(this.activeIndex=this.presetsItem.length-1,this.isCustomRange=!0),!(0,i.isNullOrUndefined)(t)&&""!==t.trim()){var s=t.split(" "+this.separator+" ");if(s.length>1){this.invalidValueString=null;var a={format:this.formatString,type:"date",skeleton:"yMd"},n=this.globalize.parseDate(this.getAmPmValue(s[0]).trim(),a),r=this.globalize.parseDate(this.getAmPmValue(s[1]).trim(),a);if("Decade"!==this.start&&"Year"===this.start&&"Month"!==this.depth&&(this.inputElement.defaultValue!==t&&(r=this.getStartEndDate(r,!0)),r>=this.max&&(r=this.max)),((0,i.isNullOrUndefined)(n)||"object"==typeof n&&isNaN(n.getTime())||(0,i.isNullOrUndefined)(r)||"object"==typeof r&&isNaN(r.getTime()))&&!(0,i.isNullOrUndefined)(this.inputFormatsString))for(var l=0,o=this.inputFormatsString;l<o.length;l++){var h={format:o[l],type:"date",skeleton:"yMd"};if(((0,i.isNullOrUndefined)(n)||"object"==typeof n&&isNaN(n.getTime()))&&(n=this.globalize.parseDate(this.getAmPmValue(s[0]).trim(),h)),((0,i.isNullOrUndefined)(r)||"object"==typeof r&&isNaN(r.getTime()))&&(r=this.globalize.parseDate(this.getAmPmValue(s[1]).trim(),h)),!(0,i.isNullOrUndefined)(n)&&n instanceof Date&&!isNaN(n.getTime())&&!(0,i.isNullOrUndefined)(r)&&r instanceof Date&&!isNaN(r.getTime()))break}if(!((0,i.isNullOrUndefined)(n)||isNaN(+n)||(0,i.isNullOrUndefined)(r)||isNaN(+r))){var u=this.startValue;this.startValue=n;var d=this.endValue;if(this.endValue=r,this.setValue(),this.refreshControl(),t!==this.previousEleValue&&this.changeTrigger(e),!this.preventBlur&&document.activeElement!==this.inputElement){this.preventFocus=!1;var p={model:this};this.trigger("blur",p)}return this.updateHiddenInput(),void(this.isMobile&&this.isPopupOpen()&&(this.startValue=u,this.endValue=d))}this.strictMode||(this.startValue=null,this.endValue=null,this.setValue())}else this.strictMode||(this.startValue=null,this.endValue=null,this.setValue())}if(this.strictMode?((0,i.isNullOrUndefined)(t)||""!==t.trim()||(this.startValue=null,this.endValue=null),j.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.updateInput()):((0,i.isNullOrUndefined)(this.popupObj)&&(this.currentDate=null),this.previousStartValue=this.previousEndValue=null,this.startValue=null,this.endValue=null,this.setValue()),this.errorClass(),this.changeTrigger(e),!this.preventBlur&&document.activeElement!==this.inputElement){this.preventFocus=!1;p={model:this};this.trigger("blur",p)}}this.updateHiddenInput()}},t.prototype.getStartEndDate=function(e,t){return"Year"===this.currentView()&&!(0,i.isNullOrUndefined)(e)||"Year"===this.depth?new Date(e.getFullYear(),e.getMonth()+(t?1:0),t?0:1):"Decade"!==this.currentView()||(0,i.isNullOrUndefined)(e)?null:new Date(e.getFullYear(),t?11:0,t?31:1)},t.prototype.clearRange=function(){this.previousStartValue=this.previousEndValue=null,this.currentDate=null},t.prototype.errorClass=function(){var e=(0,i.isNullOrUndefined)(this.inputElement.value)?null:this.inputElement.value.trim();((0,i.isNullOrUndefined)(this.endValue)&&(0,i.isNullOrUndefined)(this.startValue)&&""!==e||!(0,i.isNullOrUndefined)(this.startValue)&&+this.startValue<+this.min||!(0,i.isNullOrUndefined)(this.startValue)&&!(0,i.isNullOrUndefined)(this.endValue)&&+this.startValue>+this.endValue||!(0,i.isNullOrUndefined)(this.endValue)&&+this.endValue>+this.max||this.startValue&&this.isDateDisabled(this.startValue)||this.endValue&&this.isDateDisabled(this.endValue))&&""!==e?((0,i.addClass)([this.inputWrapper.container],he),(0,i.attributes)(this.inputElement,{"aria-invalid":"true"})):this.inputWrapper&&((0,i.removeClass)([this.inputWrapper.container],he),(0,i.attributes)(this.inputElement,{"aria-invalid":"false"}))},t.prototype.keyCalendarUpdate=function(e,t,i){return void 0===i&&(i=!0),i&&this.removeFocusedDate(),e?(this.leftCalCurrentDate=new Date(+this.currentDate),t=this.leftCalendar):(this.rightCalCurrentDate=new Date(+this.currentDate),t=this.rightCalendar),this.updateCalendarElement(t),this.table.focus(),t},t.prototype.navInCalendar=function(e,t,s,a,n){var r,l,o=this.getViewNumber(this.currentView()),h=this.min;switch(l=(0,i.isNullOrUndefined)(this.maxDays)||!this.isMaxDaysClicked||(0,i.isNullOrUndefined)(this.startValue)?this.max:new Date(new Date(+this.startValue).setDate(this.startValue.getDate()+(this.maxDays-1))),e.action){case"moveRight":r=new Date(+this.currentDate),this.addDay(r,1,e,l,h),t&&+r===+a&&(n=this.keyCalendarUpdate(!1,n)),this.keyboardNavigate(1,o,e,l,h),this.keyNavigation(n,e);break;case"moveLeft":r=new Date(+this.currentDate),this.addDay(r,-1,e,l,h),t||+r===+s&&(n=this.keyCalendarUpdate(!0,n)),this.keyboardNavigate(-1,o,e,l,h),this.keyNavigation(n,e);break;case"moveUp":0===o?(r=new Date(+this.currentDate),this.addDay(r,-7,e,l,h),+r<=+s&&!t&&(n=this.keyCalendarUpdate(!0,n)),this.keyboardNavigate(-7,o,e,l,h)):this.keyboardNavigate(-4,o,e,this.max,this.min),this.keyNavigation(n,e);break;case"moveDown":0===o?(r=new Date(+this.currentDate),this.addDay(r,7,e,l,h),t&&+r>=+a&&(n=this.keyCalendarUpdate(!1,n)),this.keyboardNavigate(7,o,e,l,h)):this.keyboardNavigate(4,o,e,this.max,this.min),this.keyNavigation(n,e);break;case"home":this.currentDate=this.firstDay(this.currentDate),(0,i.remove)(this.tableBodyElement),0===o?this.renderMonths(e):1===o?this.renderYears(e):this.renderDecades(e),this.keyNavigation(n,e);break;case"end":this.currentDate=this.lastDay(this.currentDate,o),(0,i.remove)(this.tableBodyElement),0===o?this.renderMonths(e):1===o?this.renderYears(e):this.renderDecades(e),this.keyNavigation(n,e);break;case"tab":this.tabKeyValidation(n,re)&&(n=this.keyCalendarUpdate(!1,n,!1),this.currentDate=this.firstCellToFocus(this.rightCalendar),o=this.getViewNumber(this.currentView()),this.keyboardNavigate(0,o,e,l,h),this.keyNavigation(n,e));break;case"shiftTab":this.tabKeyValidation(n,le)&&(n=this.keyCalendarUpdate(!0,n,!1),this.currentDate=this.firstCellToFocus(this.leftCalendar),this.keyboardNavigate(0,o,e,l,h),this.keyNavigation(n,e))}},t.prototype.firstCellToFocus=function(e){var t=2===this.getViewNumber(this.currentView())?e.children[1].firstElementChild.querySelector("td.e-cell:not(.e-week-number):not(.e-disabled):not(.e-other-year)"):e.children[1].firstElementChild.querySelector("td.e-cell:not(.e-week-number):not(.e-disabled):not(.e-other-month)"),i=t&&t.id?t.id.split("_")[0]:null,s=new Date(this.currentDate.getFullYear(),this.currentDate.getMonth(),1);return i?new Date(+i):s},t.prototype.keyInputHandler=function(t,s){var a,n=this.getViewNumber(this.currentView()),r=new Date(this.rightCalCurrentDate.getFullYear(),this.rightCalCurrentDate.getMonth(),1),l=new Date(this.leftCalCurrentDate.getFullYear(),this.leftCalCurrentDate.getMonth()+1,0),o=(0,i.closest)(t.target,"."+le),h=(o=(0,i.isNullOrUndefined)(o)?this.leftCalendar:o).classList.contains(re);this.updateCalendarElement(o);var u=this.tableBodyElement.querySelector("tr td.e-selected"),d=o.querySelector("tr td."+Te),p=o.querySelector("tr td."+de),c=o.querySelector("tr td."+pe),m=this.getViewNumber(this.depth),f=n===m&&this.getViewNumber(this.start)>=m,v=(0,i.closest)(t.target,"."+re),g=(0,i.closest)(t.target,"."+le),y=(0,i.closest)(t.target,"."+Ne);switch((0,i.isNullOrUndefined)(d)?(0,i.isNullOrUndefined)(c)||this.dateDisabled?(0,i.isNullOrUndefined)(p)||this.dateDisabled?this.dateDisabled||this.currentDate.setDate(1):this.currentDate=new Date(+this.startValue):this.currentDate=new Date(+this.endValue):this.currentDate=this.currentDate,this.effect="",t.action){case"altUpArrow":this.isPopupOpen()&&(this.hide(t),this.preventFocus=!0,this.inputElement.focus(),(0,i.addClass)([this.inputWrapper.container],[me]));break;case"select":if(f){var b=(0,i.isNullOrUndefined)(d)?p:d;(0,i.isNullOrUndefined)(b)||b.classList.contains(be)||this.selectRange(null,b)}else((0,i.isNullOrUndefined)(u)||f)&&(0,i.isNullOrUndefined)(d)||((0,i.isNullOrUndefined)(this.value)||(s=this.calendarElement.classList.contains(re)?this.startDate:this.endDate),this.controlDown=t,this.contentClick(null,--n,d||u,s));t.preventDefault();break;case"controlHome":var D=new Date(this.currentDate.getFullYear(),0,1);!h&&+D<+l&&(o=this.keyCalendarUpdate(!0,o)),e.prototype.navigateTo.call(this,"Month",new Date(this.currentDate.getFullYear(),0,1)),this.keyNavigation(o,t);break;case"altRightArrow":(0,i.isNullOrUndefined)(v)?(0,i.isNullOrUndefined)(g)?(0,i.isNullOrUndefined)(y)||this.cancelButton.element.focus():(0,i.isNullOrUndefined)(this.presetElement)?this.cancelButton.element.focus():(this.presetElement.focus(),this.removeFocusedDate()):this.rightCalendar.children[1].firstElementChild.focus(),t.preventDefault();break;case"altLeftArrow":(0,i.isNullOrUndefined)(v)?(0,i.isNullOrUndefined)(g)||this.leftCalendar.children[1].firstElementChild.focus():!0!==this.applyButton.element.disabled?this.applyButton.element.focus():this.cancelButton.element.focus(),t.preventDefault();break;case"controlUp":this.calendarElement.classList.contains(re),this.calendarNavigation(t,this.calendarElement),t.preventDefault();break;case"controlDown":(0,i.isNullOrUndefined)(u)&&(0,i.isNullOrUndefined)(d)||f||((0,i.isNullOrUndefined)(this.value)||(s=this.calendarElement.classList.contains(re)?this.startDate:this.endDate),this.controlDown=t,this.contentClick(null,--n,u||d,s)),t.preventDefault();break;case"controlEnd":D=new Date(this.currentDate.getFullYear(),11,31);h&&+D>+r&&(o=this.keyCalendarUpdate(!1,o)),e.prototype.navigateTo.call(this,"Month",new Date(this.currentDate.getFullYear(),11,31)),this.keyNavigation(o,t);break;case"pageUp":a=new Date(+this.currentDate),this.addMonths(a,-1),!h&&+a<=+l&&(o=this.keyCalendarUpdate(!0,o)),this.addMonths(this.currentDate,-1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(o,t);break;case"pageDown":a=new Date(+this.currentDate),this.addMonths(a,1),h&&+a>=+r&&(o=this.keyCalendarUpdate(!1,o)),this.addMonths(this.currentDate,1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(o,t);break;case"shiftPageUp":a=new Date(+this.currentDate),this.addYears(a,-1),!h&&+a<=+l&&(o=this.keyCalendarUpdate(!0,o)),this.addYears(this.currentDate,-1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(o,t);break;case"shiftPageDown":a=new Date(+this.currentDate),this.addYears(a,1),h&&+a>=+r&&(o=this.keyCalendarUpdate(!1,o)),this.addYears(this.currentDate,1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(o,t);break;case"shiftTab":(0,i.isNullOrUndefined)(this.presetElement)||(this.presetElement.setAttribute("tabindex","0"),this.presetElement.focus(),this.removeFocusedDate()),h&&t.preventDefault(),this.tabKeyValidation(o,le)&&(this.currentDate=new Date(+this.leftCalCurrentDate),this.navInCalendar(t,h,l,r,o));break;case"spacebar":this.applyButton&&!this.applyButton.disabled&&this.applyFunction(t);break;case"tab":this.tabKeyValidation(o,re)&&(this.currentDate=new Date(+this.rightCalCurrentDate),this.navInCalendar(t,h,l,r,o));break;default:this.navInCalendar(t,h,l,r,o),this.checkMinMaxDays()}this.presetHeight()},t.prototype.tabKeyValidation=function(e,t){var i=e.classList.contains(t),s=this.rightCalendar.querySelector(".e-header"),a=this.leftCalendar.querySelector(".e-header"),n=!!s&&s.classList.contains("e-month"),r=!!a&&a.classList.contains("e-month"),l=!!s&&s.classList.contains("e-year"),o=!!a&&a.classList.contains("e-year"),h=!!s&&s.classList.contains("e-decade"),u=!!a&&a.classList.contains("e-decade");return i&&(r||o||u)&&(n||l||h)&&!this.isMobile},t.prototype.keyNavigation=function(e,t){this.bindCalendarCellEvents(e),e.classList.contains(re)?this.leftCalCurrentDate=new Date(+this.currentDate):this.rightCalCurrentDate=new Date(+this.currentDate),this.updateNavIcons(),this.calendarIconEvent(),this.updateRange([e]),this.dateDisabled=this.isDateDisabled(this.currentDate),t.preventDefault()},t.prototype.inputHandler=function(e){switch(e.action){case"altDownArrow":this.isPopupOpen()||(""===this.inputElement.value&&(this.clear(),this.changeTrigger(e),this.clearRange()),this.show(null,e),this.isRangeIconClicked=!1,this.isMobile||(0,i.isNullOrUndefined)(this.leftCalendar)||this.calendarFocus(),this.isKeyPopup=!0);break;case"escape":this.isPopupOpen()&&this.hide(e);break;case"enter":document.activeElement===this.inputElement&&(this.inputBlurHandler(e),this.hide(e));break;case"tab":document.activeElement===this.inputElement&&this.isPopupOpen()&&(this.hide(e),e.preventDefault())}},t.prototype.bindCalendarCellEvents=function(e){for(var t=0,s=e?e.querySelectorAll("."+Ee+" td"):this.popupObj.element.querySelectorAll("."+Ee+" td");t<s.length;t++){var a=s[t];i.EventHandler.clearEvents(a),a.classList.contains(be)||a.classList.contains(Ae)||a.classList.contains(Pe)||(this.isMobile||i.EventHandler.add(a,"mouseover",this.hoverSelection,this),i.EventHandler.add(a,"mousedown",this.selectRange,this))}},t.prototype.removeFocusedDate=function(){for(var e=!(0,i.isNullOrUndefined)(this.startValue)||!(0,i.isNullOrUndefined)(this.endValue),t=0,s=this.popupObj.element.querySelectorAll("."+Ee+" ."+Te);t<s.length;t++){var a=s[t],n=new Date,r=this.getIdValue(null,a);("Month"===this.depth&&"Month"===this.currentView()&&(!a.classList.contains(Ie)||a.classList.contains(Ie)&&e)||"Year"===this.depth&&"Year"===this.currentView()&&(!this.isSameMonth(n,r)&&!this.isSameYear(n,r)||e)||"Decade"===this.depth&&"Decade"===this.currentView()&&(!this.isSameYear(n,r)||e))&&(a.classList.remove(Te),a.classList.contains(de)||a.classList.contains(pe)||a.removeAttribute("aria-label"))}},t.prototype.hoverSelection=function(e,t){var s=t||e.currentTarget,a=this.getIdValue(null,s);if(!(0,i.isNullOrUndefined)(this.startValue)&&+this.startValue>=+this.min&&+this.startValue<=+this.max&&(!this.isDateDisabled(this.endValue)&&!this.isDateDisabled(this.startValue)&&(0,i.isNullOrUndefined)(this.endValue)&&(0,i.isNullOrUndefined)(this.startValue)||!(0,i.isNullOrUndefined)(this.startValue)&&(0,i.isNullOrUndefined)(this.endValue)))for(var n=0,r=this.popupObj.element.querySelectorAll("."+Ee+" td");n<r.length;n++){var l=r[n],o=!l.classList.contains(be)||l.classList.contains(Ae);if(!l.classList.contains(Pe)&&o){var h=this.getIdValue(null,l),u="Month"===this.currentView()?new Date(+this.startValue):this.getStartEndDate(new Date(+this.startValue),!1);new Date(+h).setHours(0,0,0,0)>=u.setHours(0,0,0,0)&&+h<=+a?(0,i.addClass)([l],fe):(0,i.removeClass)([l],[fe])}}},t.prototype.isSameStartEnd=function(e,t){var i=!1;return"Month"===this.depth?e.setHours(0,0,0,0)===t.setHours(0,0,0,0)&&(i=!0):"Year"===this.depth?e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&(i=!0):"Decade"===this.depth&&e.getFullYear()===t.getFullYear()&&(i=!0),i},t.prototype.updateRange=function(e){if(!(0,i.isNullOrUndefined)(this.startValue))for(var t=0,s=e;t<s.length;t++)for(var a=0,n=s[t].querySelectorAll("."+Ee+" td");a<n.length;a++){var r=n[a];if(!r.classList.contains(Pe)&&!r.classList.contains(be)){var l=this.getIdValue(null,r),o=this.getIdValue(null,r);if((0,i.isNullOrUndefined)(this.endValue))(0,i.removeClass)([r],[fe]);else{var h="Month"===this.currentView()?new Date(+this.startValue):this.getStartEndDate(new Date(+this.startValue),!1),u="Month"===this.currentView()?new Date(+this.endValue):this.getStartEndDate(new Date(+this.endValue),!0);this.currentView()===this.depth&&+o.setHours(0,0,0,0)>=+h.setHours(0,0,0,0)&&+o.setHours(0,0,0,0)<=+u.setHours(0,0,0,0)&&!this.isSameStartEnd(new Date(+this.startValue),new Date(+this.endValue))&&+new Date(+this.startValue).setHours(0,0,0,0)>=+this.min&&+new Date(+this.endValue).setHours(0,0,0,0)<=+this.max&&!this.isDateDisabled(this.startValue)&&!this.isDateDisabled(this.endValue)&&(0,i.addClass)([r],fe)}if(r.classList.contains(De)&&r.classList.contains(pe)&&+o!==+this.endValue&&((0,i.removeClass)([r],[De]),(0,i.removeClass)([r],[pe])),r.classList.contains(fe)&&+o>+this.endValue&&(0,i.removeClass)([r],[fe]),!r.classList.contains(ve)){var d="Month"===this.currentView()?new Date(+this.startValue):this.getStartEndDate(new Date(+this.startValue),!1),p=new Date(+l);this.currentView()===this.depth&&+p.setHours(0,0,0,0)===+d.setHours(0,0,0,0)&&+p.setHours(0,0,0,0)>=+d.setHours(0,0,0,0)&&+this.startValue>=+this.min&&!this.inputWrapper.container.classList.contains("e-error")&&!this.isDateDisabled(this.startValue)&&!this.isDateDisabled(this.endValue)&&((0,i.addClass)([r],[de,De]),this.addSelectedAttributes(r,this.startValue,!0));var c="Month"===this.currentView()?new Date(+this.endValue):this.getStartEndDate(new Date(+this.endValue),!0);"Year"===this.currentView()?p=new Date(p.getFullYear(),p.getMonth()+1,0):"Decade"===this.currentView()&&(p=new Date(p.getFullYear(),11,31)),this.currentView()===this.depth&&!(0,i.isNullOrUndefined)(this.endValue)&&+p.setHours(0,0,0,0)===+c.setHours(0,0,0,0)&&+p.setHours(0,0,0,0)<=+c.setHours(0,0,0,0)&&+this.startValue>=+this.min&&!this.inputWrapper.container.classList.contains("e-error")&&!this.isDateDisabled(this.startValue)&&!this.isDateDisabled(this.endValue)&&((0,i.addClass)([r],[pe,De]),this.addSelectedAttributes(r,this.startValue,!1)),+l!==+this.startValue||(0,i.isNullOrUndefined)(this.endValue)||+l!==+this.endValue||this.addSelectedAttributes(r,this.endValue,!1,!0)}}}},t.prototype.checkMinMaxDays=function(){(!(0,i.isNullOrUndefined)(this.minDays)&&this.minDays>0||!(0,i.isNullOrUndefined)(this.maxDays)&&this.maxDays>0)&&(this.isMobile?this.updateMinMaxDays(this.popupObj.element.querySelector("."+Ee)):(this.updateMinMaxDays(this.popupObj.element.querySelector("."+re)),this.updateMinMaxDays(this.popupObj.element.querySelector("."+le))))},t.prototype.rangeArgs=function(e){var t,s,a=(0,i.isNullOrUndefined)(this.startValue)?null:this.globalize.formatDate(this.startValue,{format:this.formatString,type:"date",skeleton:"yMd"}),n=(0,i.isNullOrUndefined)(this.endValue)?null:this.globalize.formatDate(this.endValue,{format:this.formatString,type:"date",skeleton:"yMd"});return(0,i.isNullOrUndefined)(this.endValue)||(0,i.isNullOrUndefined)(this.startValue)?(t="",s=0):(t=a+" "+this.separator+" "+n,s=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1),{value:this.value,startDate:this.startValue,endDate:this.endValue,daySpan:s,event:e||null,element:this.element,isInteracted:!(0,i.isNullOrUndefined)(e),text:t}},t.prototype.otherMonthSelect=function(e,t,s){var a=+this.getIdValue(null,e),n='*[id^="/id"]:not(.e-other-month)'.replace("/id",""+a),r=this.popupObj&&this.popupObj.element.querySelector(n);(0,i.isNullOrUndefined)(r)||(t?((0,i.addClass)([r],[de,De]),this.addSelectedAttributes(r,this.startValue,!0)):((0,i.addClass)([r],[pe,De]),this.addSelectedAttributes(r,this.endValue,!0)),s&&this.addSelectedAttributes(e,this.endValue,!1,!0))},t.prototype.selectRange=function(e,t){var s,a,n,r,l;e&&e.preventDefault();var o=this.inputElement.value;if(!(0,i.isNullOrUndefined)(o)&&""!==o.trim()){var h=o.split(" "+this.separator+" ");if(h.length>1&&("Year"===this.currentView()&&"Year"===this.depth||"Decade"===this.currentView()&&"Decade"===this.depth)){var u={format:this.formatString,type:"date",skeleton:"yMd"};r=this.globalize.parseDate(this.getAmPmValue(h[0]).trim(),u),l=this.globalize.parseDate(this.getAmPmValue(h[1]).trim(),u),n=!0}}var d=(0,i.isNullOrUndefined)(e)?this.getIdValue(null,t):this.getIdValue(e,null);(0,i.isNullOrUndefined)(this.startValue)||("Year"===this.currentView()&&"Year"===this.depth?d=new Date(d.getFullYear(),d.getMonth(),this.startValue.getDate()):"Decade"===this.currentView()&&"Decade"===this.depth&&(d=new Date(d.getFullYear(),this.startValue.getMonth(),this.startValue.getDate())));var p=d.getFullYear(),c=d.getMonth(),m=n&&"Year"!==this.start?new Date(p,c,r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds()):new Date(p,c,1),f=n&&"Year"!==this.start?new Date(p,c,l.getDate(),l.getHours(),l.getMinutes(),l.getSeconds()):new Date(p,c+1,0),v=n&&"Year"!==this.start?new Date(p,r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds()):new Date(p,0,1),g=n&&"Year"!==this.start?new Date(p,l.getMonth(),l.getDate(),l.getHours(),l.getMinutes(),l.getSeconds()):new Date(p,11,31);(0,i.isNullOrUndefined)(this.endValue)||(0,i.isNullOrUndefined)(this.startValue)?this.isMobile&&this.startButton.element.classList.contains(ue)&&this.removeSelection():(!this.isMobile||this.isMobile&&!this.endButton.element.classList.contains(ue))&&this.removeSelection();var y=t||e.currentTarget;if((0,i.isNullOrUndefined)(this.startValue))(0,i.isNullOrUndefined)(this.previousStartValue)||(d.setHours(this.previousStartValue.getHours()),d.setMinutes(this.previousStartValue.getMinutes()),d.setSeconds(this.previousStartValue.getSeconds())),this.startValue="Month"===this.depth?new Date(this.checkValue(d)):"Year"===this.depth?m:v,this.endValue=null,this.setValue(),(0,i.addClass)([y],de),this.addSelectedAttributes(y,this.startValue,!0),y.classList.contains(ve)&&this.otherMonthSelect(y,!0),this.checkMinMaxDays(),this.applyButton.disabled=!0,this.applyButton.element.disabled=!0,this.isMobile&&(this.endButton.element.classList.add(ue),this.startButton.element.classList.remove(ue),this.endButton.element.removeAttribute("disabled"),this.selectableDates()),this.trigger("select",this.rangeArgs(e));else if(+d===+this.startValue||+d>+this.startValue){if(+d===+this.startValue&&!(0,i.isNullOrUndefined)(this.minDays)&&this.minDays>1)return;this.endValue=null,this.setValue(),(this.isMobile||t)&&this.hoverSelection(e,t),(0,i.isNullOrUndefined)(this.previousEndValue)||(d.setHours(this.previousEndValue.getHours()),d.setMinutes(this.previousEndValue.getMinutes()),d.setSeconds(this.previousEndValue.getSeconds())),this.endValue="Month"===this.depth?new Date(this.checkValue(d)):"Year"===this.depth?f:g,this.setValue();var b=this.popupObj.element.querySelectorAll("."+pe);if(this.isMobile){this.startButton.element.classList.remove(ue),this.endButton.element.classList.add(ue);for(var D=0,E=b;D<E.length;D++){var C=E[D];C.removeAttribute("aria-label"),C.classList.contains(de)?(this.addSelectedAttributes(C,this.startValue,!0),(0,i.removeClass)([C],[pe])):(C.setAttribute("aria-selected","false"),(0,i.removeClass)([C],[pe,De]))}}(0,i.addClass)([y],pe),+this.endValue===+this.startValue?this.addSelectedAttributes(y,this.endValue,!1,!0):this.addSelectedAttributes(y,this.endValue,!1),y.classList.contains(ve)&&(+this.endValue===+this.startValue?this.otherMonthSelect(y,!1,!0):this.otherMonthSelect(y,!1));for(var k=0,M=b=this.popupObj.element.querySelectorAll("."+pe);k<M.length;k++){var w=M[k];w.classList.contains(de)&&(0,i.removeClass)([w],[fe])}this.applyButton.disabled=!1,this.applyButton.element.disabled=!1,this.isMobile||this.removeClassDisabled(),!(0,i.isNullOrUndefined)(this.renderDayCellArgs)&&this.renderDayCellArgs.isDisabled&&this.disabledDateRender(),this.trigger("select",this.rangeArgs(e))}else+d<+this.startValue&&(this.removeClassDisabled(),this.startValue="Month"===this.depth?new Date(this.checkValue(d)):"Year"===this.depth?m:v,this.setValue(),this.removeSelectedAttributes(),(0,i.removeClass)(this.popupObj.element.querySelectorAll("."+de),[de,De]),(0,i.addClass)([y],de),this.addSelectedAttributes(y,this.startValue,!0),y.classList.contains(ve)&&this.otherMonthSelect(y,!0),this.checkMinMaxDays());var V=this.min.getTime()!==new Date(1900,0,1).getTime(),O=this.max.getTime()!==new Date(2099,11,31).getTime();if("Year"===this.currentView()&&"Year"===this.depth){var N=new Date(this.min.getFullYear(),this.min.getMonth(),1);!(0,i.isNullOrUndefined)(this.startValue)&&V&&+this.startValue<=+N&&(this.startValue=this.min);var I=new Date(this.max.getFullYear(),this.max.getMonth()+1,0);!(0,i.isNullOrUndefined)(this.endValue)&&O&&+this.endValue>=+I&&(this.endValue=this.max)}else"Decade"===this.currentView()&&"Decade"===this.depth&&(!(0,i.isNullOrUndefined)(this.startValue)&&V&&this.startValue.getFullYear()<=this.min.getFullYear()?this.startValue=this.min:V&&this.startValue.getFullYear()>this.min.getFullYear()&&(this.startValue=new Date(this.startValue.getFullYear(),0,1)),!(0,i.isNullOrUndefined)(this.endValue)&&O&&this.endValue.getFullYear()>=this.max.getFullYear()&&(this.endValue=this.max));e&&(s=(0,i.closest)(e.target,"."+re)),(0,i.isNullOrUndefined)(s)?(e&&(a=e&&(0,i.closest)(e.target,"."+le)),(0,i.isNullOrUndefined)(a)||this.rightCalendar.children[1].firstElementChild.focus()):this.leftCalendar.children[1].firstElementChild.focus(),(0,i.addClass)([y],De),this.calendarIconEvent(),this.updateHeader(),this.removeFocusedDate()},t.prototype.selectableDates=function(){if(!(0,i.isNullOrUndefined)(this.startValue)){var e=this.calendarElement.querySelectorAll("."+Ee+" td"),t=!1;if(this.currentView()===this.depth){for(var s=0,a=e;s<a.length;s++){if(!(l=a[s]).classList.contains(de)&&!l.classList.contains(Pe)&&!l.classList.contains(be)){if(+this.getIdValue(null,l)<+this.startValue){(0,i.addClass)([l],[Ae,be,We]),i.EventHandler.clearEvents(l);continue}break}if(l.classList.contains(de)&&!l.classList.contains(ve)){t=!0;break}}t&&(this.previousIcon.classList.contains(be)||(0,i.addClass)([this.previousIcon],[Ue,be,We]))}else{for(var n=0,r=e;n<r.length;n++){var l=r[n],o=this.startValue.getMonth(),h=this.startValue.getFullYear(),u=this.getIdValue(null,l);if(this.startButton.element.classList.contains(ue)||!("Year"===this.currentView()&&u.getMonth()<o&&u.getFullYear()<=h||"Decade"===this.currentView()&&u.getMonth()<=o&&u.getFullYear()<h))break;(0,i.addClass)([l],[be])}e[0].classList.contains(be)?this.previousIconHandler(!0):e[e.length-1].classList.contains(be)&&this.nextIconHandler(!0)}}},t.prototype.updateMinMaxDays=function(e){if(!(0,i.isNullOrUndefined)(this.startValue)&&(0,i.isNullOrUndefined)(this.endValue)||this.isMobile&&this.endButton&&this.endButton.element.classList.contains(ue)){if(!(0,i.isNullOrUndefined)(this.minDays)&&this.minDays>0||!(0,i.isNullOrUndefined)(this.maxDays)&&this.maxDays>0){var t=this.removeTimeValueFromDate(this.startValue),s=new Date(new Date(+t).setDate(t.getDate()+(this.minDays-1))),a=new Date(new Date(+t).setDate(t.getDate()+(this.maxDays-1)));s=!(0,i.isNullOrUndefined)(this.minDays)&&this.minDays>0?s:null,a=!(0,i.isNullOrUndefined)(this.maxDays)&&this.maxDays>0?a:null,"Year"===this.currentView()?(s=(0,i.isNullOrUndefined)(s)?null:new Date(s.getFullYear(),s.getMonth(),0),a=(0,i.isNullOrUndefined)(a)?null:new Date(a.getFullYear(),a.getMonth(),1)):"Decade"===this.currentView()&&(s=(0,i.isNullOrUndefined)(s)?null:new Date(s.getFullYear()-1,11,1),a=(0,i.isNullOrUndefined)(a)?null:new Date(a.getFullYear(),0,1));for(var n=void 0,r=0,l=e.querySelectorAll("."+Ee+" td");r<l.length;r++){var o=l[r];if(!o.classList.contains(de)&&!o.classList.contains(Pe)){var h=this.getIdValue(null,o);if(h=this.removeTimeValueFromDate(h),!(0,i.isNullOrUndefined)(s)&&+h===+s&&o.classList.contains(be)&&s.setDate(s.getDate()+1),!o.classList.contains(be)){if(+h<=+t)continue;!(0,i.isNullOrUndefined)(s)&&+h<+s&&((0,i.addClass)([o],[Ae,be,We]),i.EventHandler.clearEvents(o)),!(0,i.isNullOrUndefined)(a)&&+h>+a&&((0,i.addClass)([o],[Ae,be,We]),this.isMaxDaysClicked=!0,i.EventHandler.clearEvents(o),(0,i.isNullOrUndefined)(n)&&!o.classList.contains(ve)&&(n=o))}}}if(!(0,i.isNullOrUndefined)(n))if(this.isMobile)this.nextIcon.classList.contains(be)||(0,i.addClass)([this.nextIcon],[Ue,be,We]);else{var u=(0,i.closest)(n,"."+le);(u=(0,i.isNullOrUndefined)(u)?this.leftCalendar:u).classList.contains(re)?(this.rightCalNextIcon.classList.contains(be)||(0,i.addClass)([this.rightCalNextIcon],[Ue,be,We]),this.leftCalNextIcon.classList.contains(be)||(0,i.addClass)([this.leftCalNextIcon],[Ue,be,We]),this.rightCalPrevIcon.classList.contains(be)||(0,i.addClass)([this.rightCalPrevIcon],[Ue,be,We])):this.rightCalNextIcon.classList.contains(be)||(0,i.addClass)([this.rightCalNextIcon],[Ue,be,We])}}}else this.isMaxDaysClicked=!1},t.prototype.removeTimeValueFromDate=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())},t.prototype.removeClassDisabled=function(){for(var e=0,t=this.popupObj.element.querySelectorAll("."+Ee+" td."+Ae);e<t.length;e++){var s=t[e];s.classList.contains(Ae)&&((0,i.removeClass)([s],[Ae,be,We]),i.EventHandler.add(s,"click",this.selectRange,this),this.isMobile||i.EventHandler.add(s,"mouseover",this.hoverSelection,this))}this.isMobile?(this.nextIcon.classList.contains(Ue)&&(0,i.removeClass)([this.nextIcon],[Ue,be,We]),this.previousIcon.classList.contains(Ue)&&(0,i.removeClass)([this.previousIcon],[Ue,be,We])):(this.rightCalNextIcon.classList.contains(Ue)&&(0,i.removeClass)([this.rightCalNextIcon],[Ue,be,We]),this.rightCalPrevIcon.classList.contains(Ue)&&(0,i.removeClass)([this.rightCalPrevIcon],[Ue,be,We]),this.leftCalNextIcon.classList.contains(Ue)&&(0,i.removeClass)([this.leftCalNextIcon],[Ue,be,We]))},t.prototype.updateHeader=function(){var e={type:"date",skeleton:"yMMMd"};if((0,i.isNullOrUndefined)(this.endValue)||(0,i.isNullOrUndefined)(this.startValue))this.popupObj.element.querySelector("."+Se).textContent=this.l10n.getConstant("selectedDays");else{var t=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1;(0,i.isNullOrUndefined)(this.disabledDayCnt)||(t-=this.disabledDayCnt,this.disabledDayCnt=null),this.popupObj.element.querySelector("."+Se).textContent=t.toString()+" "+this.l10n.getConstant("days")}this.isMobile?((0,i.isNullOrUndefined)(this.startValue)?this.startButton.element.textContent=this.l10n.getConstant("startLabel"):this.startButton.element.textContent=this.globalize.formatDate(this.startValue,e),(0,i.isNullOrUndefined)(this.endValue)||(0,i.isNullOrUndefined)(this.startValue)?this.endButton.element.textContent=this.l10n.getConstant("endLabel"):this.endButton.element.textContent=this.globalize.formatDate(this.endValue,e)):((0,i.isNullOrUndefined)(this.endValue)||(0,i.isNullOrUndefined)(this.startValue)?this.popupObj.element.querySelector("."+ye).textContent=this.l10n.getConstant("endLabel"):this.popupObj.element.querySelector("."+ye).textContent=this.globalize.formatDate(this.endValue,e),(0,i.isNullOrUndefined)(this.startValue)?this.popupObj.element.querySelector("."+ge).textContent=this.l10n.getConstant("startLabel"):this.popupObj.element.querySelector("."+ge).textContent=this.globalize.formatDate(this.startValue,e)),(this.isDateDisabled(this.startValue)||this.isDateDisabled(this.endValue)||!(0,i.isNullOrUndefined)(this.startValue)&&+this.startValue<+this.min||!(0,i.isNullOrUndefined)(this.endValue)&&+this.endValue>+this.max||!(0,i.isNullOrUndefined)(this.startValue)&&!(0,i.isNullOrUndefined)(this.endValue)&&+this.startValue>+this.endValue)&&(this.isMobile?(this.startButton.element.textContent=this.l10n.getConstant("startLabel"),this.endButton.element.textContent=this.l10n.getConstant("endLabel"),this.popupObj.element.querySelector("."+Se).textContent=this.l10n.getConstant("selectedDays")):(this.popupObj.element.querySelector("."+Se).textContent=this.l10n.getConstant("selectedDays"),this.popupObj.element.querySelector("."+ge).textContent=this.l10n.getConstant("startLabel"),this.popupObj.element.querySelector("."+ye).textContent=this.l10n.getConstant("endLabel"))),this.popupObj.element.querySelector("#custom_range")&&(this.popupObj.element.querySelector("#custom_range").textContent=""!==this.l10n.getConstant("customRange")?this.l10n.getConstant("customRange"):"Custom Range")},t.prototype.removeSelection=function(){this.startValue=null,this.endValue=null,this.setValue(),this.removeSelectedAttributes(),this.popupObj&&(this.popupObj.element.querySelectorAll("."+De).length>0&&(0,i.removeClass)(this.popupObj.element.querySelectorAll("."+De),[de,pe,De]),this.popupObj.element.querySelectorAll("."+Te).length>0&&(0,i.removeClass)(this.popupObj.element.querySelectorAll("."+Te),Te),this.popupObj.element.querySelectorAll("."+fe).length>0&&(0,i.removeClass)(this.popupObj.element.querySelectorAll("."+fe),[fe]))},t.prototype.addSelectedAttributes=function(e,t,s,a){if(e){var n=this.globalize.formatDate(t,{type:"date",skeleton:"full"});!(0,i.isNullOrUndefined)(a)&&a?e.setAttribute("aria-label","The current start and end date is "+n):e.setAttribute("aria-label","The current "+(s?"start":"end")+" date is "+n),e.setAttribute("aria-selected","true")}},t.prototype.removeSelectedAttributes=function(){if(this.popupObj){for(var e=0,t=this.popupObj.element.querySelectorAll("."+de);e<t.length;e++){(a=t[e]).setAttribute("aria-selected","false"),a.removeAttribute("aria-label")}for(var i=0,s=this.popupObj.element.querySelectorAll("."+pe);i<s.length;i++){var a;(a=s[i]).setAttribute("aria-selected","false"),a.removeAttribute("aria-label")}}},t.prototype.updateCalendarElement=function(e){e.classList.contains(re)?(this.calendarElement=this.leftCalendar,this.currentDate=this.leftCalCurrentDate,this.previousIcon=this.leftCalPrevIcon,this.nextIcon=this.leftCalNextIcon):(this.calendarElement=this.rightCalendar,this.currentDate=this.rightCalCurrentDate,this.previousIcon=this.rightCalPrevIcon,this.nextIcon=this.rightCalNextIcon),this.contentElement=e.querySelector("."+xe),this.tableBodyElement=(0,i.select)("."+xe+" tbody",e),this.table=e.querySelector("."+xe).getElementsByTagName("table")[0],this.headerTitleElement=e.querySelector("."+Me+" ."+we),this.headerElement=e.querySelector("."+Me)},t.prototype.navPrevMonth=function(e){e.preventDefault();var t=(0,i.closest)(e.target,"."+re);t=(0,i.isNullOrUndefined)(t)?(0,i.closest)(e.target,"."+le):t,this.updateCalendarElement(t),this.navigatePrevious(e),!(0,i.isNullOrUndefined)(this.startValue)&&(0,i.isNullOrUndefined)(this.endValue)&&this.updateMinMaxDays(t),this.updateControl(t)},t.prototype.deviceNavigation=function(e){this.deviceCalendarEvent(),this.updateRange([this.popupObj.element.querySelector("."+Ee)]),this.endButton.element.classList.contains(ue)&&this.updateMinMaxDays(this.popupObj.element.querySelector("."+Ee)),this.endButton.element.classList.contains(ue)&&this.selectableDates(),this.currentView()===this.depth&&this.bindCalendarCellEvents(),this.removeFocusedDate()},t.prototype.updateControl=function(e,t){void 0===t&&(t=null),e.classList.contains(le)?this.rightCalCurrentDate=new Date(+(t||this.currentDate)):this.leftCalCurrentDate=new Date(+this.currentDate),this.calendarIconEvent(),("Month"===this.depth&&this.leftCalendar.querySelector(".e-content").classList.contains("e-month")&&this.rightCalendar.querySelector(".e-content").classList.contains("e-month")||"Year"===this.depth&&this.leftCalendar.querySelector(".e-content").classList.contains("e-year")&&this.rightCalendar.querySelector(".e-content").classList.contains("e-year")||"Decade"===this.depth&&this.leftCalendar.querySelector(".e-content").classList.contains("e-decade")&&this.rightCalendar.querySelector(".e-content").classList.contains("e-decade")||this.isMobile)&&this.bindCalendarCellEvents(),this.removeFocusedDate(),this.updateRange([e])},t.prototype.navNextMonth=function(e){e.preventDefault();var t=(0,i.closest)(e.target,"."+re);t=(0,i.isNullOrUndefined)(t)?(0,i.closest)(e.target,"."+le):t,this.updateCalendarElement(t),this.navigateNext(e),!(0,i.isNullOrUndefined)(this.startValue)&&(0,i.isNullOrUndefined)(this.endValue)&&this.updateMinMaxDays(t),this.updateControl(t)},t.prototype.isPopupOpen=function(){return!((0,i.isNullOrUndefined)(this.popupObj)||!this.popupObj.element.classList.contains(ne))},t.prototype.createRangeHeader=function(){var e=this.createElement("div",{className:"e-start-end"});if(this.isMobile){var t=this.createElement("button",{className:"e-end-btn"}),s=this.createElement("button",{className:ce});this.startButton=new ee.Button({content:this.l10n.getConstant("startLabel")},s),this.endButton=new ee.Button({content:this.l10n.getConstant("endLabel")},t),e.appendChild(s),e.appendChild(t)}else{var a=this.createElement("a",{className:ge}),n=this.createElement("a",{className:ye}),r=this.createElement("span",{className:"e-change-icon e-icons"});(0,i.attributes)(a,{"aria-atomic":"true","aria-live":"assertive","aria-label":"Start Date",role:"button"}),(0,i.attributes)(n,{"aria-atomic":"true","aria-live":"assertive","aria-label":"End Date",role:"button"}),e.appendChild(a),e.appendChild(r),e.appendChild(n),a.textContent=this.l10n.getConstant("startLabel"),n.textContent=this.l10n.getConstant("endLabel")}return e},t.prototype.disableInput=function(){this.strictMode?(0,i.isNullOrUndefined)(this.previousStartValue)||(0,i.isNullOrUndefined)(this.previousEndValue)||(this.startValue=this.previousStartValue,this.endValue=this.previousEndValue,this.setValue(),this.updateInput()):(this.updateInput(),this.clearRange(),this.setProperties({startDate:null},!0),this.setProperties({endDate:null},!0),this.startValue=null,this.endValue=null,this.setValue(),this.errorClass()),this.setProperties({enabled:!1},!0),j.Input.setEnabled(this.enabled,this.inputElement),this.bindEvents()},t.prototype.validateMinMax=function(){this.min=(0,i.isNullOrUndefined)(this.min)||!+this.min?this.min=new Date(1900,0,1):this.min,this.max=(0,i.isNullOrUndefined)(this.max)||!+this.max?this.max=new Date(2099,11,31):this.max,this.min<=this.max?((0,i.isNullOrUndefined)(this.minDays)||(0,i.isNullOrUndefined)(this.maxDays)||this.maxDays>0&&this.minDays>0&&this.minDays>this.maxDays&&(this.maxDays=null),!(0,i.isNullOrUndefined)(this.minDays)&&this.minDays<0&&(this.minDays=null),!(0,i.isNullOrUndefined)(this.maxDays)&&this.maxDays<0&&(this.maxDays=null)):this.disableInput()},t.prototype.validateRangeStrict=function(){(0,i.isNullOrUndefined)(this.startValue)||(+this.startValue<=+this.min?(this.startValue=this.min,this.setValue()):+this.startValue>=+this.min&&+this.startValue>=+this.max&&(this.startValue=this.max)),(0,i.isNullOrUndefined)(this.endValue)||(+this.endValue>+this.max?(this.endValue=this.max,this.setValue()):+this.endValue<+this.min&&(this.endValue=this.min,this.setValue())),this.validateMinMaxDays()},t.prototype.validateRange=function(){this.validateMinMaxDays()},t.prototype.validateMinMaxDays=function(){if(!(0,i.isNullOrUndefined)(this.startValue)&&!(0,i.isNullOrUndefined)(this.endValue)){var e=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1;if(!(0,i.isNullOrUndefined)(this.minDays)&&this.minDays>0&&!(e>=this.minDays))if(this.strictMode){var t=new Date(+this.startValue);t.setDate(t.getDate()+(this.minDays-1)),+t>+this.max?(this.endValue=this.max,this.setValue()):(this.endValue=t,this.setValue())}else this.startValue=null,this.endValue=null,this.setValue();(0,i.isNullOrUndefined)(this.maxDays)||!(this.maxDays>0)||e<=this.maxDays||(this.strictMode?(this.endValue=new Date(+this.startValue),this.endValue.setDate(this.endValue.getDate()+(this.maxDays-1)),this.setValue()):(this.startValue=null,this.endValue=null,this.setValue()))}},t.prototype.renderCalendar=function(){this.calendarElement=this.createElement("div"),this.calendarElement.classList.add(Ee),this.enableRtl&&this.calendarElement.classList.add("e-rtl"),(0,i.attributes)(this.calendarElement,{"data-role":"calendar"}),e.prototype.createHeader.call(this),e.prototype.createContent.call(this)},t.prototype.isSameMonth=function(e,t){return e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()},t.prototype.isSameYear=function(e,t){return e.getFullYear()===t.getFullYear()},t.prototype.isSameDecade=function(e,t){var i=e.getFullYear(),s=t.getFullYear();return i-i%10==s-s%10},t.prototype.startMonthCurrentDate=function(){this.isSameMonth(this.min,this.max)||+this.currentDate>+this.max||this.isSameMonth(this.currentDate,this.max)?(this.currentDate=new Date(+this.max),this.currentDate.setDate(1),this.currentDate.setMonth(this.currentDate.getMonth()-1)):this.currentDate<this.min&&(this.currentDate=new Date(this.checkValue(this.min)))},t.prototype.selectNextMonth=function(){if((0,i.isNullOrUndefined)(this.endValue)||(0,i.isNullOrUndefined)(this.startValue)||this.isSameMonth(this.endValue,this.currentDate)||this.isDateDisabled(this.endValue)||this.isDateDisabled(this.startValue))return this.currentDate.setDate(1),void this.currentDate.setMonth(this.currentDate.getMonth()+1);if(this.currentDate=new Date(+this.endValue),!(0,i.isNullOrUndefined)(this.startValue)&&+this.startValue<+this.min||!(0,i.isNullOrUndefined)(this.endValue)&&+this.endValue>+this.max||!(0,i.isNullOrUndefined)(this.startValue)&&!(0,i.isNullOrUndefined)(this.endValue)&&+this.startValue>+this.endValue){this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.currentDate.setDate(1);var e=this.currentDate.getMonth()+1;this.currentDate.setMonth(e)}},t.prototype.selectNextYear=function(){if((0,i.isNullOrUndefined)(this.endValue)||(0,i.isNullOrUndefined)(this.startValue)||this.isSameYear(this.endValue,this.currentDate)||this.isDateDisabled(this.endValue)||this.isDateDisabled(this.startValue)){this.currentDate.setMonth(0);var e=this.currentDate.getFullYear()+1;this.currentDate.setFullYear(e)}else this.currentDate=new Date(+this.endValue),(!(0,i.isNullOrUndefined)(this.endValue)&&+this.endValue>+this.max||!(0,i.isNullOrUndefined)(this.startValue)&&!(0,i.isNullOrUndefined)(this.endValue)&&+this.startValue>+this.endValue||!(0,i.isNullOrUndefined)(this.startValue)&&+this.startValue<+this.min)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.currentDate.setMonth(0),this.currentDate.setFullYear(this.currentDate.getFullYear()+1))},t.prototype.selectNextDecade=function(){if((0,i.isNullOrUndefined)(this.endValue)||(0,i.isNullOrUndefined)(this.startValue)||this.isSameDecade(this.endValue,this.currentDate)||this.isDateDisabled(this.endValue)||this.isDateDisabled(this.startValue)){var e=this.currentDate.getFullYear()+10;this.currentDate.setFullYear(e)}else this.currentDate=new Date(+this.endValue),(!(0,i.isNullOrUndefined)(this.startValue)&&!(0,i.isNullOrUndefined)(this.endValue)&&+this.startValue>+this.endValue||!(0,i.isNullOrUndefined)(this.endValue)&&+this.endValue>+this.max||!(0,i.isNullOrUndefined)(this.startValue)&&+this.startValue<+this.min)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.currentDate.setFullYear(this.currentDate.getFullYear()+10))},t.prototype.selectStartMonth=function(){(0,i.isNullOrUndefined)(this.startValue)?(this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.startMonthCurrentDate()):!(0,i.isNullOrUndefined)(this.max)&&this.isSameMonth(this.startValue,this.max)?(this.currentDate=new Date(+this.max),this.currentDate.setDate(1),this.currentDate.setMonth(this.currentDate.getMonth()-1)):this.startValue>=this.min&&this.startValue<=this.max&&!this.isDateDisabled(this.startValue)?this.currentDate=new Date(+this.startValue):this.currentDate=new Date((new Date).setHours(0,0,0,0)),(!(0,i.isNullOrUndefined)(this.endValue)&&+this.endValue>+this.max||!(0,i.isNullOrUndefined)(this.startValue)&&+this.startValue<+this.min||!(0,i.isNullOrUndefined)(this.startValue)&&!(0,i.isNullOrUndefined)(this.endValue)&&+this.startValue>+this.endValue)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0))),this.startMonthCurrentDate()},t.prototype.createCalendar=function(){var t=this.createElement("div",{className:"e-calendar-container"});if(this.isMobile){(0,i.isNullOrUndefined)(this.startValue)||(this.currentDate=new Date(+this.startValue)),e.prototype.validateDate.call(this),e.prototype.minMaxUpdate.call(this),e.prototype.render.call(this);var s=this.calendarElement.querySelector("."+Ee+" ."+ke),a=this.calendarElement.querySelector("."+Ee+" ."+Ce);(0,i.remove)(this.calendarElement.querySelector("."+Ee+" ."+Ve)),this.calendarElement.querySelector("."+Ee+" ."+Me).appendChild(a),this.calendarElement.querySelector("."+Ee+" ."+Me).appendChild(s),(0,i.prepend)([s],this.calendarElement.querySelector("."+Ee+" ."+Me)),this.deviceCalendar=this.calendarElement,t.appendChild(this.calendarElement),this.headerTitleElement=this.calendarElement.querySelector("."+Ee+" ."+Me+" ."+we)}else{this.selectStartMonth(),this.renderCalendar(),this.leftCalCurrentDate=new Date(+this.currentDate),this.calendarElement.classList.add(re),this.leftCalPrevIcon=this.calendarElement.querySelector("."+re+" ."+ke),this.leftCalNextIcon=this.calendarElement.querySelector("."+re+" ."+Ce),this.leftTitle=this.calendarElement.querySelector("."+re+" ."+we),(0,i.remove)(this.calendarElement.querySelector("."+re+" ."+Ve)),this.calendarElement.querySelector("."+re+" ."+Me).appendChild(this.leftCalNextIcon),this.calendarElement.querySelector("."+re+" ."+Me).appendChild(this.leftCalPrevIcon),(0,i.prepend)([this.leftCalPrevIcon],this.calendarElement.querySelector("."+re+" ."+Me)),this.leftCalendar=this.calendarElement;var n=this.createElement("div",{className:"e-left-container"}),r=this.createElement("div",{className:"e-right-container"});n.appendChild(this.leftCalendar),t.appendChild(n),this.isMobile||i.EventHandler.add(this.leftTitle,"click",this.leftNavTitle,this),"Month"===this.start&&this.selectNextMonth(),"Year"===this.start&&this.selectNextYear(),"Decade"===this.start&&this.selectNextDecade(),this.renderCalendar(),this.rightCalCurrentDate=new Date(+this.currentDate),(0,i.addClass)([this.calendarElement],le),this.rightCalendar=this.calendarElement,(0,i.removeClass)([this.leftCalendar&&this.leftCalendar.querySelector(".e-content tbody")],"e-zoomin"),(0,i.removeClass)([this.rightCalendar&&this.rightCalendar.querySelector(".e-content tbody")],"e-zoomin"),this.rightCalPrevIcon=this.calendarElement.querySelector("."+le+" ."+ke),this.rightCalNextIcon=this.calendarElement.querySelector("."+le+" ."+Ce),this.rightTitle=this.calendarElement.querySelector("."+le+" ."+we),(0,i.remove)(this.calendarElement.querySelector("."+le+" ."+Ve)),this.calendarElement.querySelector("table").setAttribute("tabindex","0"),this.calendarElement.querySelector("."+le+" ."+Me).appendChild(this.rightCalNextIcon),this.calendarElement.querySelector("."+le+" ."+Me).appendChild(this.rightCalPrevIcon),(0,i.prepend)([this.rightCalPrevIcon],this.calendarElement.querySelector("."+le+" ."+Me)),r.appendChild(this.rightCalendar),t.appendChild(r),this.isMobile||i.EventHandler.add(this.rightTitle,"click",this.rightNavTitle,this)}return t},t.prototype.leftNavTitle=function(e){this.isPopupOpen()&&(this.calendarElement=this.leftCalendar,this.calendarNavigation(e,this.calendarElement))},t.prototype.calendarNavigation=function(t,i){this.table=i.querySelector("table"),this.headerTitleElement=i.querySelector(".e-title"),this.tableBodyElement=i.querySelector("tbody"),this.tableHeadElement=i.querySelector("thead"),this.contentElement=i.querySelector(".e-content"),this.updateCalendarElement(i),e.prototype.navigateTitle.call(this,t),this.updateNavIcons()},t.prototype.rightNavTitle=function(e){this.isPopupOpen()&&(this.calendarElement=this.rightCalendar,this.calendarNavigation(e,this.calendarElement))},t.prototype.clickEventEmitter=function(e){this.isMobile||((0,i.closest)(e.target,".e-calendar.e-left-calendar")?(this.calendarElement=this.leftCalendar,this.updateCalendarElement(this.leftCalendar)):(this.calendarElement=this.rightCalendar,this.updateCalendarElement(this.rightCalendar)))},t.prototype.currentView=function(){return e.prototype.currentView.call(this)},t.prototype.getCalendarView=function(e){return"Year"===e?"Year":"Decade"===e?"Decade":"Month"},t.prototype.navigatedEvent=function(t){if(this.trigger("navigated",this.navigatedArgs),!(0,i.isNullOrUndefined)(this.popupObj)){var s=this.getCalendarView(this.currentView());if(this.isMobile)s===this.depth?(this.bindCalendarCellEvents(),this.deviceNavigation(),this.removeFocusedDate(),this.checkMinMaxDays()):this.selectableDates();else if(this.isMobile||s!==this.depth)this.updateNavIcons(),this.calendarIconEvent();else{if((this.calendarElement.classList.contains("e-left-calendar")?this.leftCalendar:this.rightCalendar)!==this.leftCalendar||(!t||t.currentTarget.children[0].classList.contains("e-icons"))&&(0,i.isNullOrUndefined)(this.controlDown))(t&&!t.currentTarget.children[0].classList.contains("e-icons")||!(0,i.isNullOrUndefined)(this.controlDown))&&(this.rightCalCurrentDate=new Date(+this.currentDate),this.effect="",this.currentDate=this.rightCalCurrentDate,this.updateCalendarElement(this.rightCalendar),this.updateControl(this.rightCalendar),this.updateCalendarElement(this.leftCalendar),this.startValue&&(0,i.isNullOrUndefined)(this.endValue)&&("Month"===s&&this.startValue.getMonth()<this.rightCalCurrentDate.getMonth()&&this.startValue.getFullYear()<=this.rightCalCurrentDate.getFullYear()||"Year"===s&&this.startValue.getFullYear()<this.rightCalCurrentDate.getFullYear())?e.prototype.navigateTo.call(this,s,new Date(+this.startValue)):e.prototype.navigateTo.call(this,s,this.leftCalCurrentDate),this.updateControl(this.leftCalendar),this.updateNavIcons(),this.calendarIconEvent(),this.calendarIconRipple(),this.controlDown=null);else{this.leftCalCurrentDate=new Date(+this.currentDate),this.effect="",this.currentDate=this.leftCalCurrentDate,this.updateCalendarElement(this.leftCalendar),this.updateControl(this.leftCalendar),this.updateCalendarElement(this.rightCalendar),e.prototype.navigateTo.call(this,s,this.rightCalCurrentDate);var a=this.rightCalCurrentDate?this.rightCalCurrentDate:this.currentDate;this.updateControl(this.rightCalendar,a),this.updateNavIcons(),this.calendarIconEvent(),this.calendarIconRipple(),this.controlDown=null}this.checkMinMaxDays()}}},t.prototype.createControl=function(){var e=this.createElement("div",{className:Oe}),t=this.createElement("div",{className:"e-range-header"});if(this.isMobile&&this.fullScreenMode){var s=this.createElement("div",{className:"e-model-header-wrapper"}),a=this.createElement("span",{className:"e-popup-close"});i.EventHandler.add(a,"mousedown touchstart",this.modelRangeCloseHandler,this);var n=this.createElement("span",{className:"e-apply"});i.EventHandler.add(n,"mousedown touchstart",this.applyFunction,this),s.appendChild(a),s.appendChild(n),t.appendChild(s)}var r=this.createRangeHeader();t.appendChild(r);var l=this.createElement("div",{className:Se});l.textContent=this.l10n.getConstant("selectedDays"),t.appendChild(l);var o=this.createElement("div",{className:"e-separator"}),h=this.createCalendar();e.appendChild(t),e.appendChild(o),e.appendChild(h);var u=this.createElement("div",{className:"e-footer"}),d=this.createElement("button",{className:"e-cancel "+je+" "+Ye}),p=this.createElement("button");(0,i.addClass)([p],["e-apply",je,"e-primary",Ye]),u.appendChild(p),u.appendChild(d);var c=!(0,i.isNullOrUndefined)(this.startValue)&&!(0,i.isNullOrUndefined)(this.endValue);(this.cancelButton=new ee.Button({content:this.l10n.getConstant("cancelText")},d),this.applyButton=new ee.Button({content:this.l10n.getConstant("applyText"),disabled:!c},p),i.EventHandler.add(p,"click",this.applyFunction,this),i.EventHandler.add(d,"click",this.cancelFunction,this),this.popupWrapper.appendChild(e),this.isMobile)||((0,i.isUndefined)(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)||(this.createPresets(),this.listRippleEffect(),(0,i.addClass)([e],"e-range-border"),(0,i.addClass)([this.popupWrapper],"e-preset-wrapper"),this.popupWrapper.querySelector("."+Ne).style.height=this.popupWrapper.querySelector("."+Oe).getBoundingClientRect().height+"px"));this.popupWrapper.appendChild(u),this.isMobile&&this.deviceHeaderUpdate(),this.renderPopup()},t.prototype.modelRangeCloseHandler=function(e){this.hide()},t.prototype.cancelFunction=function(e){document.activeElement!==this.inputElement&&(this.preventFocus=!0,this.inputElement.focus(),(0,i.addClass)([this.inputWrapper.container],[me])),e.preventDefault(),this.isKeyPopup&&(this.inputElement.focus(),this.isKeyPopup=!1),this.startValue=null,this.endValue=null,this.removeSelection(),this.hide(e)},t.prototype.deviceHeaderUpdate=function(){(0,i.isNullOrUndefined)(this.startValue)&&(0,i.isNullOrUndefined)(this.endValue)?(this.endButton.element.setAttribute("disabled",""),this.startButton.element.classList.add(ue)):(0,i.isNullOrUndefined)(this.startValue)||this.startButton.element.classList.add(ue)},t.prototype.applyFunction=function(e){var t=!1;"touchstart"!==e.type&&e.preventDefault(),this.closeEventArgs&&this.closeEventArgs.cancel&&(this.startValue=this.popupWrapper.querySelector(".e-start-date")&&this.getIdValue(null,this.popupWrapper.querySelector(".e-start-date")),this.endValue=this.popupWrapper.querySelector(".e-end-date")&&this.getIdValue(null,this.popupWrapper.querySelector(".e-end-date")),this.setValue()),document.activeElement!==this.inputElement&&(this.preventFocus=!0,this.inputElement.focus(),(0,i.addClass)([this.inputWrapper.container],[me])),"touchstart"!==e.type&&this.closeEventArgs&&!this.closeEventArgs.cancel&&e.preventDefault(),(0,i.isNullOrUndefined)(this.startValue)||(0,i.isNullOrUndefined)(this.endValue)?this.hide(e||null):(this.previousStartValue&&this.previousEndValue&&this.startValue.getDate()===this.previousStartValue.getDate()&&this.startValue.getMonth()===this.previousStartValue.getMonth()&&this.startValue.getFullYear()===this.previousStartValue.getFullYear()&&this.endValue.getDate()===this.previousEndValue.getDate()&&this.endValue.getMonth()===this.previousEndValue.getMonth()&&this.endValue.getFullYear()===this.previousEndValue.getFullYear()||j.Input.setValue(this.rangeArgs(e).text,this.inputElement,this.floatLabelType,this.showClearButton),this.previousStartValue=new Date(+this.startValue),this.previousEndValue=new Date(+this.endValue),this.previousEleValue=this.inputElement.value,+this.initStartDate===+this.startValue&&+this.initEndDate===+this.endValue||(t=!0),this.changeTrigger(e),this.hide(e||null),this.errorClass(),t=!0),(0,i.closest)(e.target,"."+ae)||t||this.focusOut(),this.isMobile||(this.isKeyPopup=!1,this.isRangeIconClicked&&(this.inputWrapper.container.children[1].focus(),this.keyInputConfigs=(0,i.extend)(this.keyInputConfigs,this.keyConfigs),this.popupKeyboardModule=new i.KeyboardEvents(this.inputWrapper.container.children[1],{eventName:"keydown",keyConfigs:this.keyInputConfigs,keyAction:this.popupKeyActionHandle.bind(this)})))},t.prototype.onMouseClick=function(e,t){if("touchstart"!==e.type){var s=t||e.target,a=(0,i.closest)(s,"."+Fe),n=a&&a.classList.contains(ue);a&&a.classList.contains(Fe)&&this.setListSelection(a,e),this.preventFocus=!0,this.inputElement.focus(),this.isMobile||(this.preventFocus=!0,a&&a.classList.contains(Fe)&&"custom_range"===a.getAttribute("id")?this.leftCalendar.children[1].firstElementChild.focus():n||"keydown"!==e.type||this.inputElement.focus())}},t.prototype.onMouseOver=function(e){var t=(0,i.closest)(e.target,"."+Fe);t&&t.classList.contains(Fe)&&!t.classList.contains(Le)&&(0,i.addClass)([t],Le)},t.prototype.onMouseLeave=function(e){var t=(0,i.closest)(e.target,"."+Le);(0,i.isNullOrUndefined)(t)||(0,i.removeClass)([t],Le)},t.prototype.setListSelection=function(e,t){if(e&&(!e.classList.contains(ue)||this.isMobile&&e.classList.contains(ue))){if(this.isMobile&&e.classList.contains(ue))return this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(e),"custom_range"===this.presetsItem[this.activeIndex].id?void this.renderCustomPopup():void 0;this.removeListSelection(),this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(e),(0,i.addClass)([e],ue),e.setAttribute("aria-selected","true");var s=this.presetsItem[this.activeIndex];"custom_range"===s.id?this.renderCustomPopup():this.applyPresetRange(s,t)}},t.prototype.removeListSelection=function(){var e=this.presetElement.querySelector("."+ue);(0,i.isNullOrUndefined)(e)||((0,i.removeClass)([e],ue),e.removeAttribute("aria-selected"))},t.prototype.setValue=function(){this.modelValue=[this.startValue,this.endValue]},t.prototype.applyPresetRange=function(e,t){this.hide(null),this.presetsItem[this.presetsItem.length-1].start=null,this.presetsItem[this.presetsItem.length-1].end=null,this.startValue=e.start,this.endValue=e.end,this.setValue(),this.refreshControl(),this.trigger("select",this.rangeArgs(t)),this.changeTrigger(t),this.previousEleValue=this.inputElement.value,this.isCustomRange=!1,this.leftCalendar=this.rightCalendar=null,this.isKeyPopup&&(this.isRangeIconClicked=!1,this.inputElement.focus())},t.prototype.showPopup=function(e,t){this.presetHeight(),1e3===this.zIndex?this.popupObj.show(null,this.element):this.popupObj.show(null,null),this.isMobile&&this.popupObj.refreshPosition()},t.prototype.renderCustomPopup=function(){var e=this;this.isCustomWindow=!0,this.popupObj.hide(),this.popupWrapper=this.createElement("div",{id:this.element.id+"_popup",className:oe+" "+ne}),this.renderControl(),this.openEventArgs={popup:this.popupObj||null,cancel:!1,date:this.inputElement.value,model:this,event:event||null,appendTo:this.isMobile||i.Browser.isDevice?this.mobileRangePopupWrap:document.body};var t=this.openEventArgs;this.trigger("open",t,function(t){e.openEventArgs=t,e.openEventArgs.cancel}),this.openEventArgs.appendTo.appendChild(this.popupWrapper),this.showPopup(),this.isCustomRange=!0,this.isMobile||this.calendarFocus()},t.prototype.listRippleEffect=function(){for(var e=0,t=this.liCollections;e<t.length;e++){var s=t[e];(0,i.rippleEffect)(s)}},t.prototype.createPresets=function(){if(!(0,i.isUndefined)(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)){this.presetElement=this.createElement("div",{className:Ne,attrs:{tabindex:"0"}});var e=te.ListBase.createList(this.createElement,this.presetsItem,null,!0);(0,i.attributes)(e,{role:"listbox","aria-hidden":"false",id:this.element.id+"_options",tabindex:"0","aria-label":"daterangepicker-preset"}),this.presetElement.appendChild(e),this.popupWrapper.appendChild(this.presetElement);var t=this.presetElement.querySelector("#custom_range");if((0,i.isNullOrUndefined)(t)||(t.textContent=""!==this.l10n.getConstant("customRange")?this.l10n.getConstant("customRange"):"Custom Range"),this.liCollections=this.presetElement.querySelectorAll("."+Fe),this.wireListEvents(),this.isMobile)if(this.fullScreenMode){var s=(0,i.createElement)("div",{className:"e-range-mob-popup-wrap"}),a=this.createElement("div",{className:"e-model-header"}),n=this.createElement("span",{className:"e-model-title"});n.textContent="Select Preset";var r=this.createElement("span",{className:"e-popup-close"});i.EventHandler.add(r,"mousedown touchstart",this.modelRangeCloseHandler,this);var l=this.presetElement;a.appendChild(r),a.appendChild(n),s.appendChild(a),s.appendChild(l),this.popupWrapper.insertBefore(s,this.popupWrapper.firstElementChild),this.presetElement.style.width="100%"}else this.presetElement.style.width=this.inputWrapper.container.getBoundingClientRect().width+"px";!(0,i.isNullOrUndefined)(this.activeIndex)&&this.activeIndex>-1&&(0,i.addClass)([this.liCollections[this.activeIndex]],ue)}},t.prototype.wireListEvents=function(){i.EventHandler.add(this.presetElement,"click",this.onMouseClick,this),this.isMobile||(i.EventHandler.add(this.presetElement,"mouseover",this.onMouseOver,this),i.EventHandler.add(this.presetElement,"mouseout",this.onMouseLeave,this))},t.prototype.unWireListEvents=function(){(0,i.isNullOrUndefined)(this.presetElement)||(i.EventHandler.remove(this.presetElement,"click touchstart",this.onMouseClick),this.isMobile||(i.EventHandler.remove(this.presetElement,"mouseover",this.onMouseOver),i.EventHandler.remove(this.presetElement,"mouseout",this.onMouseLeave)))},t.prototype.renderPopup=function(){var e=this;this.popupWrapper.classList.add("e-control");var t=this.popupWrapper.getBoundingClientRect().width;(0,i.isNullOrUndefined)(this.cssClass)||""===this.cssClass.trim()||(this.popupWrapper.className+=" "+this.cssClass),this.isMobile&&this.isCustomWindow&&(this.modal=this.createElement("div"),document.body.appendChild(this.modal)),this.popupObj=new B.Popup(this.popupWrapper,{relateTo:this.isMobile&&this.isCustomWindow?document.body:(0,i.isNullOrUndefined)(this.targetElement)?this.inputWrapper.container:this.targetElement,position:this.isMobile?(0,i.isUndefined)(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)||this.isCustomWindow?{X:"center",Y:"center"}:{X:"left",Y:"bottom"}:this.enableRtl?{X:"left",Y:"bottom"}:{X:"right",Y:"bottom"},offsetX:this.isMobile||this.enableRtl?0:-t,offsetY:4,collision:this.isMobile?(0,i.isUndefined)(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)||this.isCustomWindow?{X:"fit",Y:"fit"}:{X:"fit"}:{X:"fit",Y:"flip"},targetType:this.isMobile&&this.isCustomWindow?"container":"relative",enableRtl:this.enableRtl,zIndex:this.zIndex,open:function(){e.isMobile&&e.fullScreenMode&&(e.iconRangeRight=e.calendarElement&&window.getComputedStyle(e.calendarElement.querySelector(".e-header.e-month .e-prev")).cssFloat,e.iconRangeRight&&(e.touchRangeModule=new i.Touch(e.calendarElement.querySelector(".e-content.e-month"),{swipe:e.dateRangeSwipeHandler.bind(e)}),i.EventHandler.add(e.calendarElement.querySelector(".e-content.e-month"),"touchstart",e.touchStartRangeHandler,e))),(0,i.attributes)(e.inputElement,{"aria-expanded":"true","aria-owns":e.element.id,"aria-controls":e.inputElement.id}),e.value?(0,i.attributes)(e.inputElement,{"aria-activedescendant":e.inputElement.id}):e.inputElement.removeAttribute("aria-activedescendant"),(0,i.addClass)([e.inputWrapper.buttons[0]],ue),e.isMobile||(e.cancelButton&&(e.btnKeyboardModule=new i.KeyboardEvents(e.cancelButton.element,{eventName:"keydown",keyAction:e.popupKeyActionHandle.bind(e),keyConfigs:{tab:"tab",altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}}),e.btnKeyboardModule=new i.KeyboardEvents(e.applyButton.element,{eventName:"keydown",keyAction:e.popupKeyActionHandle.bind(e),keyConfigs:{altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}})),(0,i.isNullOrUndefined)(e.leftCalendar)||e.isRangeIconClicked||e.calendarFocus(),(0,i.isNullOrUndefined)(e.presetElement)||(e.keyInputConfigs=(0,i.extend)(e.keyInputConfigs,e.keyConfigs),e.presetKeyboardModule=new i.KeyboardEvents(e.presetElement,{eventName:"keydown",keyAction:e.presetKeyActionHandler.bind(e),keyConfigs:e.keyInputConfigs}),e.presetKeyboardModule=new i.KeyboardEvents(e.presetElement,{eventName:"keydown",keyAction:e.popupKeyActionHandle.bind(e),keyConfigs:{altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}}),(0,i.isNullOrUndefined)(e.leftCalendar)?(e.preventBlur=!0,e.presetElement.focus()):e.presetElement.setAttribute("tabindex","-1")),e.popupKeyBoardHandler()),e.isMobile&&!i.Browser.isDevice&&i.EventHandler.add(document,"keydown",e.popupCloseHandler,e)},close:function(){(0,i.attributes)(e.inputElement,{"aria-expanded":"false"}),e.inputElement.removeAttribute("aria-owns"),e.inputElement.removeAttribute("aria-controls"),e.inputElement.removeAttribute("aria-activedescendant"),(0,i.removeClass)([e.inputWrapper.buttons[0]],ue),e.isRangeIconClicked&&e.inputWrapper.container.children[1].focus(),(0,i.isUndefined)(e.presets[0].start&&e.presets[0].end&&e.presets[0].label)||e.unWireListEvents(),e.applyButton&&e.applyButton.destroy(),e.cancelButton&&e.cancelButton.destroy(),e.isMobile&&e.endButton&&e.endButton.destroy(),e.isMobile&&e.startButton&&e.startButton.destroy(),(0,i.isNullOrUndefined)(e.popupObj)||((0,i.isNullOrUndefined)(e.popupObj.element.parentElement)||(0,i.detach)(e.popupObj.element),e.popupObj.destroy(),e.popupObj=null),e.isMobile&&!i.Browser.isDevice&&i.EventHandler.remove(document,"keydown",e.popupCloseHandler)},targetExitViewport:function(){var t=e.popupObj&&e.popupObj.element;!i.Browser.isDevice&&t&&t.getBoundingClientRect().height<window.innerHeight&&e.hide()}}),this.isMobile&&this.popupObj.element.classList.add(He),this.isMobile&&this.isCustomWindow&&((0,i.addClass)([this.modal],[He,oe,"e-range-modal"]),document.body.className+=" "+Be,this.modal.style.display="block"),i.EventHandler.add(document,"mousedown touchstart",this.documentHandler,this)},t.prototype.dateRangeSwipeHandler=function(e){var t=0;if("left"===this.iconRangeRight)switch(e.swipeDirection){case"Left":t=1;break;case"Right":t=-1}else switch(e.swipeDirection){case"Up":t=1;break;case"Down":t=-1}this.touchRangeStart&&(1===t?this.navigateNext(e):-1===t&&this.navigatePrevious(e),this.touchRangeStart=!1)},t.prototype.touchStartRangeHandler=function(e){this.touchRangeStart=!0},t.prototype.popupCloseHandler=function(e){if(27===e.keyCode)this.hide(e)},t.prototype.calendarFocus=function(){var e=this.popupObj&&this.popupObj.element.querySelector("."+de);if(e){var t=(0,i.closest)(e,"."+le);t=(0,i.isNullOrUndefined)(t)?this.leftCalendar:t,this.isRangeIconClicked?this.inputWrapper.container.focus():(this.preventBlur=!0,t.children[1].firstElementChild.focus()),(0,i.addClass)([e],Te)}else this.isRangeIconClicked?this.inputWrapper.container.focus():(this.preventBlur=!0,this.leftCalendar.children[1].firstElementChild.focus())},t.prototype.presetHeight=function(){var e=this.popupObj&&this.popupObj.element.querySelector("."+Ne),t=this.popupObj&&this.popupObj.element.querySelector("."+Oe);(0,i.isNullOrUndefined)(e)||(0,i.isNullOrUndefined)(t)||(e.style.height=t.getBoundingClientRect().height+"px")},t.prototype.presetKeyActionHandler=function(e){switch(e.action){case"moveDown":this.listMoveDown(e),this.setScrollPosition(),e.preventDefault();break;case"moveUp":this.listMoveUp(e),this.setScrollPosition(),e.preventDefault();break;case"enter":var t=this.getHoverLI(),s=this.getActiveLI();if(!(0,i.isNullOrUndefined)(this.leftCalendar)&&!(0,i.isNullOrUndefined)(s))if((0,i.isNullOrUndefined)(t)||!(0,i.isNullOrUndefined)(s)&&s===t)if(this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(s),"custom_range"===this.presetsItem[this.activeIndex].id)return this.calendarFocus(),s.classList.remove(Le),void e.preventDefault();(0,i.isNullOrUndefined)(t)&&(0,i.isNullOrUndefined)(s)||this.onMouseClick(e,t||s),e.preventDefault();break;case"tab":if(this.leftCalendar){var a=this.getHoverLI();(0,i.isNullOrUndefined)(a)||a.classList.remove(Le)}else this.hide(e),e.preventDefault()}},t.prototype.listMoveDown=function(e){var t=this.getHoverLI(),s=this.getActiveLI();if((0,i.isNullOrUndefined)(t))if((0,i.isNullOrUndefined)(s))(0,i.addClass)([this.liCollections[0]],Le);else{a=s.nextElementSibling;!(0,i.isNullOrUndefined)(a)&&a.classList.contains(Fe)&&(0,i.addClass)([a],Le)}else{var a=t.nextElementSibling;!(0,i.isNullOrUndefined)(a)&&a.classList.contains(Fe)&&((0,i.removeClass)([t],Le),(0,i.addClass)([a],Le))}},t.prototype.listMoveUp=function(e){var t=this.getHoverLI(),s=this.getActiveLI();if((0,i.isNullOrUndefined)(t)){if(!(0,i.isNullOrUndefined)(s)){a=s.previousElementSibling;!(0,i.isNullOrUndefined)(a)&&a.classList.contains(Fe)&&(0,i.addClass)([a],Le)}}else{var a=t.previousElementSibling;!(0,i.isNullOrUndefined)(a)&&a.classList.contains(Fe)&&((0,i.removeClass)([t],Le),(0,i.addClass)([a],Le))}},t.prototype.getHoverLI=function(){return this.presetElement.querySelector("."+Le)},t.prototype.getActiveLI=function(){return this.presetElement.querySelector("."+ue)},t.prototype.popupKeyBoardHandler=function(){this.popupKeyboardModule=new i.KeyboardEvents(this.popupWrapper,{eventName:"keydown",keyAction:this.popupKeyActionHandle.bind(this),keyConfigs:{escape:"escape"}}),this.keyInputConfigs=(0,i.extend)(this.keyInputConfigs,this.keyConfigs),this.popupKeyboardModule=new i.KeyboardEvents(this.inputWrapper.container.children[1],{eventName:"keydown",keyAction:this.popupKeyActionHandle.bind(this),keyConfigs:this.keyInputConfigs})},t.prototype.setScrollPosition=function(){var e=this.presetElement.getBoundingClientRect().height,t=this.presetElement.querySelector("."+Le),s=this.presetElement.querySelector("."+ue),a=(0,i.isNullOrUndefined)(t)?s:t;if(!(0,i.isNullOrUndefined)(a)){var n=a.nextElementSibling,r=n?n.offsetTop:a.offsetTop,l=a.getBoundingClientRect().height;r+a.offsetTop>e?this.presetElement.scrollTop=n?r-(e/2+l/2):r:this.presetElement.scrollTop=0}},t.prototype.popupKeyActionHandle=function(e){var t=(0,i.closest)(e.target,"."+Ne);switch(e.action){case"escape":this.isPopupOpen()?(this.isKeyPopup&&(this.inputElement.focus(),this.isKeyPopup=!1),this.hide(e)):this.inputWrapper.container.children[1].blur();break;case"enter":this.isPopupOpen()?this.inputWrapper.container.children[1].focus():this.show(null,e);break;case"tab":this.hide(e);break;case"altRightArrow":(0,i.isNullOrUndefined)(t)?document.activeElement===this.cancelButton.element&&!0!==this.applyButton.element.disabled?this.applyButton.element.focus():this.leftCalendar.children[1].firstElementChild.focus():this.cancelButton.element.focus(),e.preventDefault();break;case"altLeftArrow":(0,i.isNullOrUndefined)(t)?document.activeElement===this.applyButton.element&&!0!==this.applyButton.element.disabled?this.cancelButton.element.focus():(0,i.isNullOrUndefined)(this.presetElement)||document.activeElement!==this.cancelButton.element?this.rightCalendar.children[1].firstElementChild.focus():this.presetElement.focus():this.rightCalendar.children[1].firstElementChild.focus(),e.preventDefault()}},t.prototype.documentHandler=function(e){if(!(0,i.isNullOrUndefined)(this.popupObj)){var t=e.target;this.inputWrapper.container.contains(t)&&((0,i.isNullOrUndefined)(this.popupObj)||(0,i.closest)(t,'[id="'+this.popupWrapper.id+'"]')||"mousedown"===e.type)||"touchstart"!==e.type&&("mousedown"===e.type||this.closeEventArgs&&!this.closeEventArgs.cancel)&&e.preventDefault(),!(0,i.isNullOrUndefined)(this.targetElement)&&((0,i.isNullOrUndefined)(this.targetElement)||t===this.targetElement)||(0,i.closest)(t,'[id="'+this.popupWrapper.id+'"]')||(0,i.closest)(t,"."+ae)===this.inputWrapper.container||(0,i.closest)(t,".e-daterangepicker.e-popup")&&!t.classList.contains("e-day")||t.classList.contains("e-dlg-overlay")||(this.preventBlur=!1,this.isPopupOpen()&&document.body.contains(this.popupObj.element)&&(this.applyFunction(e),this.isMobile||(this.isRangeIconClicked=!1)))}},t.prototype.createInput=function(){this.fullScreenMode&&this.isMobile&&(this.cssClass+=" e-popup-expand");var e=this.cssClass;(0,i.isNullOrUndefined)(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),this.inputWrapper=j.Input.createInput({floatLabelType:this.floatLabelType,element:this.inputElement,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:e,enabled:this.enabled,enableRtl:this.enableRtl,showClearButton:this.showClearButton},buttons:["e-input-group-icon e-range-icon e-icons"]},this.createElement),(0,i.attributes)(this.inputElement,{tabindex:"0","aria-expanded":"false",role:"combobox",autocomplete:"off","aria-disabled":this.enabled?"false":"true",autocapitalize:"off",spellcheck:"false"}),i.Browser.isIos&&(0,i.attributes)(this.inputElement,{autocorrect:"off"}),j.Input.addAttributes({"aria-label":"select",role:"button"},this.inputWrapper.buttons[0]),this.setEleWidth(this.width),(0,i.addClass)([this.inputWrapper.container],"e-date-range-wrapper"),(0,i.isNullOrUndefined)(this.inputElement.getAttribute("name"))&&(0,i.attributes)(this.inputElement,{name:this.element.id}),"hidden"===this.inputElement.type&&(this.inputWrapper.container.style.display="none"),this.refreshControl(),this.previousEleValue=this.inputElement.value,this.inputElement.setAttribute("value",this.inputElement.value),this.startCopy=this.startDate,this.endCopy=this.endDate},t.prototype.setEleWidth=function(e){this.inputWrapper.container.style.width="string"==typeof e?this.width:"number"==typeof e?(0,i.formatUnit)(this.width):"100%",this.updateFloatLabelOverflowWidth()},t.prototype.adjustLongHeaderWidth=function(){"Wide"===this.dayHeaderFormat&&(0,i.addClass)([this.popupWrapper],"e-daterange-day-header-lg")},t.prototype.refreshControl=function(){this.validateMinMax(),this.strictMode&&this.validateRangeStrict();var e=this.disabledDates();this.strictMode&&e&&(this.startValue=this.previousStartValue,this.setProperties({startDate:this.startValue},!0),this.endValue=this.previousEndValue,this.setProperties({endDate:this.endValue},!0),this.setValue()),this.updateInput(),this.strictMode||this.validateRange(),!this.strictMode&&e&&this.clearRange(),(0,i.isNullOrUndefined)(this.endValue)||(0,i.isNullOrUndefined)(this.startValue)||e||(0,i.isNullOrUndefined)(this.renderDayCellArgs)||!this.renderDayCellArgs.isDisabled||this.disabledDateRender(),this.errorClass(),this.previousStartValue=(0,i.isNullOrUndefined)(this.startValue)||isNaN(+this.startValue)?null:new Date(+this.startValue),this.previousEndValue=(0,i.isNullOrUndefined)(this.endValue)||isNaN(+this.endValue)?null:new Date(+this.endValue)},t.prototype.updateInput=function(){if(!(0,i.isNullOrUndefined)(this.endValue)&&!(0,i.isNullOrUndefined)(this.startValue)){var e={format:this.formatString,type:"date",skeleton:"yMd"},t=this.globalize.formatDate(this.startValue,e),s=this.globalize.formatDate(this.endValue,e);j.Input.setValue(t+" "+this.separator+" "+s,this.inputElement,this.floatLabelType,this.showClearButton),this.previousStartValue=new Date(+this.startValue),this.previousEndValue=new Date(+this.endValue)}!this.strictMode&&(0,i.isNullOrUndefined)(this.value)&&this.invalidValueString&&j.Input.setValue(this.invalidValueString,this.inputElement,this.floatLabelType,this.showClearButton)},t.prototype.checkInvalidRange=function(e){if(!(0,i.isNullOrUndefined)(e)){var t=!1,s=void 0,a=void 0,n=null,r=null,l=null,o=!1,h=!1,u=!1;if("string"==typeof e){var d=e.split(" "+this.separator+" ");2===d.length?(n=d[0],r=d[1]):(t=!0,l=e)}else e.length>0?(s=e[0],a=e[1]):(s=e.start,a=e.end),s instanceof Date||"object"==typeof s?s instanceof Date?o=!0:(0,i.isNullOrUndefined)(s)||(u=!0):n=this.getstringvalue(s),a instanceof Date||"object"==typeof a?a instanceof Date?h=!0:(0,i.isNullOrUndefined)(a)||(u=!0):r=this.getstringvalue(a);((0,i.isNullOrUndefined)(n)&&!o&&!(0,i.isNullOrUndefined)(r)||!(0,i.isNullOrUndefined)(n)&&!h&&(0,i.isNullOrUndefined)(r))&&(t=!0),u&&(n=r=l=null,t=!0),n&&(t=t||this.checkInvalidValue(n)),r&&(t=t||this.checkInvalidValue(r)),t&&(o&&!u&&(n=s.toLocaleDateString()),h&&!u&&(r=a.toLocaleDateString()),(0,i.isNullOrUndefined)(n)||(0,i.isNullOrUndefined)(r)?(0,i.isNullOrUndefined)(n)?(0,i.isNullOrUndefined)(r)||(l=r):l=n:l=n+" "+this.separator+" "+r,this.invalidValueString=l,this.setProperties({value:null},!0),this.setProperties({startValue:null},!0),this.setProperties({endValue:null},!0),this.startDate=null,this.endDate=null)}},t.prototype.getstringvalue=function(e){var t=null;return(0,i.isNullOrUndefined)(e)||"number"!=typeof e?(0,i.isNullOrUndefined)(e)||"string"!=typeof e||(t=""+e):t=e.toString(),t},t.prototype.checkInvalidValue=function(e){var t,s=e,a=!1;if(t={format:this.formatString,type:"date",skeleton:"yMd"},"string"!=typeof s)a=!0;else{var n=new i.Internationalization(this.locale);if(!this.checkDateValue(n.parseDate(s,t))){var r=null;r=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,(!/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/.test(s)&&!r.test(s)||/^[a-zA-Z0-9- ]*$/.test(s)||isNaN(+new Date(this.checkValue(s))))&&(a=!0)}}return a},t.prototype.isDateDisabled=function(e){if((0,i.isNullOrUndefined)(e))return!1;var t=new Date(+e);if(+t<+this.min||+t>+this.max)return!0;this.virtualRenderCellArgs={date:t,isDisabled:!1};var s=this.virtualRenderCellArgs;return this.virtualRenderCellEvent(s),!!s.isDisabled},t.prototype.disabledDateRender=function(){this.disabledDays=[],this.disabledDayCnt=null;for(var e=new Date(+this.startValue),t=0;+e<=+this.endValue&&+this.endValue<=+this.max;){this.virtualRenderCellArgs={date:e,isDisabled:!1};var i=this.virtualRenderCellArgs;this.virtualRenderCellEvent(i),i.isDisabled&&(this.disabledDays.push(new Date(+i.date)),+e>+this.startValue&&+e<+this.endValue&&t++),this.addDay(e,1,null,this.max,this.min)}this.disabledDayCnt=t},t.prototype.virtualRenderCellEvent=function(e){(0,i.extend)(this.virtualRenderCellArgs,{name:"renderDayCell"}),this.trigger("renderDayCell",e)},t.prototype.disabledDates=function(){var e=!1,t=!1;return(0,i.isNullOrUndefined)(this.endValue)||(0,i.isNullOrUndefined)(this.startValue)||(e=this.isDateDisabled(this.startValue),t=this.isDateDisabled(this.endValue),this.isPopupOpen()||(this.currentDate=null),this.setValue()),e||t},t.prototype.setModelValue=function(){this.value||null!==this.startDate||null!==this.endDate?null===this.value||null===this.value.start?null===this.value?this.setProperties({value:[this.startDate,this.endDate]},!0):null===this.value.start&&this.setProperties({value:{start:this.startDate,end:this.endDate}},!0):this.value&&this.value.length>0||this.valueType&&this.valueType.length>0?(+this.startDate===+this.value[0]&&+this.endDate===+this.value[1]||this.setProperties({value:[this.startDate,this.endDate]},!0),this.value&&null==this.value[0]&&null==this.value[1]&&this.setProperties({value:null},!0)):this.value&&this.value.start&&this.setProperties({value:{start:this.startDate,end:this.endDate}},!0):this.setProperties({value:null},!0),this.createHiddenInput()},t.prototype.dispatchEvent=function(e,t){var i=document.createEvent("HTMLEvents");i.initEvent(t,!1,!0),e.dispatchEvent(i),this.firstHiddenChild.dispatchEvent(i)},t.prototype.changeTrigger=function(e){+this.initStartDate===+this.startValue&&+this.initEndDate===+this.endValue||(this.setProperties({endDate:this.checkDateValue(this.endValue)},!0),this.setProperties({startDate:this.checkDateValue(this.startValue)},!0),this.setModelValue(),this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",this.rangeArgs(e))),this.previousEleValue=this.inputElement.value,this.initStartDate=this.checkDateValue(this.startValue),this.initEndDate=this.checkDateValue(this.endValue)},t.prototype.navigateTo=function(t,i){if(this.isPopupOpen()){if("month"===t.toLowerCase())t="Month";else if("year"===t.toLowerCase())t="Year";else{if("decade"!==t.toLowerCase())return;t="Decade"}this.getViewNumber(t)<this.getViewNumber(this.depth)&&(t=this.depth),this.isMobile?e.prototype.navigateTo.call(this,t,i):(i<this.min?i=new Date(+this.min):i>=this.max&&(i=new Date(+this.max)),"Month"===t&&this.isSameMonth(i,this.max)?i=new Date(this.max.getFullYear(),this.max.getMonth()-1,this.min.getDate()):"Year"===t&&this.isSameYear(i,this.max)?i=new Date(this.max.getFullYear()-1,this.max.getMonth(),this.max.getDate()):"Decade"===t&&this.isSameDecade(i,this.max)&&(i=new Date(this.max.getFullYear()-10,this.max.getMonth(),this.max.getDate())),this.leftCalCurrentDate=i,this.navigate(this.leftCalendar,this.leftCalCurrentDate,t),i="Month"===t?new Date(this.currentDate.setMonth(this.currentDate.getMonth()+1)):"Year"===t?new Date(this.currentDate.setFullYear(this.currentDate.getFullYear()+1)):new Date(this.currentDate.setFullYear(this.currentDate.getFullYear()+10)),this.rightCalCurrentDate=i,this.navigate(this.rightCalendar,this.rightCalCurrentDate,t),this.leftKeyboardModule=this.rightKeyboardModule=null,this.updateNavIcons()),this.currentView()===this.depth&&this.bindCalendarCellEvents(),this.removeFocusedDate(),this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar])}},t.prototype.navigate=function(t,i,s){this.calendarElement=t,this.table=t.querySelector("table"),this.tableBodyElement=t.querySelector("tbody"),this.headerTitleElement=t.querySelector(".e-title"),this.tableHeadElement=t.querySelector("thead"),this.contentElement=t.querySelector(".e-content"),this.previousIcon=t.querySelector(".e-prev"),this.nextIcon=t.querySelector(".e-next"),this.effect="e-zoomin",e.prototype.navigateTo.call(this,s,i)},t.prototype.focusIn=function(){document.activeElement!==this.inputElement&&this.enabled&&((0,i.addClass)([this.inputWrapper.container],[me]),this.inputElement.focus())},t.prototype.focusOut=function(){var e=this.preventBlur;document.activeElement===this.inputElement&&((0,i.removeClass)([this.inputWrapper.container],[me]),this.preventBlur=!1,this.inputElement.blur(),this.preventBlur=e)},t.prototype.destroy=function(){this.unBindEvents(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),this.hide(null);var t={tabindex:"0","aria-expanded":"false",role:"combobox",autocomplete:"off","aria-disabled":this.enabled?"false":"true",autocorrect:"off",autocapitalize:"off","aria-invalid":"false",spellcheck:"false"};this.inputElement&&((0,i.removeClass)([this.inputElement],[oe]),i.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),j.Input.removeAttributes(t,this.inputElement),(0,i.isNullOrUndefined)(this.cloneElement.getAttribute("tabindex"))?this.inputElement.removeAttribute("tabindex"):this.inputElement.setAttribute("tabindex",this.tabIndex),this.ensureInputAttribute(),this.inputElement.classList.remove("e-input"),(0,i.isNullOrUndefined)(this.inputWrapper)||(i.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler),null===this.angularTag&&this.inputWrapper.container.parentElement.appendChild(this.inputElement),(0,i.detach)(this.inputWrapper.container))),(0,i.isNullOrUndefined)(this.inputKeyboardModule)||this.isMobile||this.inputKeyboardModule.destroy(),this.popupObj&&(this.isMobile||this.clearCalendarEvents()),j.Input.destroy({element:this.inputElement,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),e.prototype.destroy.call(this),this.inputWrapper=this.popupWrapper=this.popupObj=this.cloneElement=this.presetElement=null,this.formElement&&i.EventHandler.remove(this.formElement,"reset",this.formResetHandler),(0,i.isNullOrUndefined)(this.firstHiddenChild)||(0,i.isNullOrUndefined)(this.secondHiddenChild)||((0,i.detach)(this.firstHiddenChild),(0,i.detach)(this.secondHiddenChild),this.firstHiddenChild=this.secondHiddenChild=null,this.inputElement.setAttribute("name",this.element.getAttribute("data-name")),this.inputElement.removeAttribute("data-name")),this.closeEventArgs=null,this.leftCalendar=null,this.rightTitle=null,this.leftTitle=null,this.openEventArgs=null,this.leftCalNextIcon=null,this.rightCalendar=null,this.closeEventArgs=null,this.rightCalPrevIcon=null,this.leftCalPrevIcon=null,this.popupKeyboardModule=null,this.cancelButton=null,this.applyButton=null,this.calendarElement=null,this.leftKeyboardModule=null,this.rightCalNextIcon=null,this.leftCalNextIcon=null,this.btnKeyboardModule=null,this.rightKeyboardModule=null,this.leftKeyboardModule=null,this.presetKeyboardModule=null,this.liCollections=null,this.popupObj=null,this.popupWrapper=null},t.prototype.ensureInputAttribute=function(){for(var e=[],t=0;t<this.inputElement.attributes.length;t++)e[t]=this.inputElement.attributes[t].name;for(t=0;t<e.length;t++)(0,i.isNullOrUndefined)(this.cloneElement.getAttribute(e[t]))?("value"===e[t].toLowerCase()&&(this.inputElement.value=""),this.inputElement.removeAttribute(e[t])):("value"===e[t].toLowerCase()&&(this.inputElement.value=this.cloneElement.getAttribute(e[t])),this.inputElement.setAttribute(e[t],this.cloneElement.getAttribute(e[t])))},t.prototype.getModuleName=function(){return"daterangepicker"},t.prototype.updateFloatLabelOverflowWidth=function(){for(var e=this.inputWrapper.container,t=e.querySelector(".e-float-text.e-label-bottom"),i=0,s=e.querySelectorAll(".e-input-group-icon, .e-clear-icon"),a=0;a<s.length;a++)i+=s[a].offsetWidth;if(t){var n=this.element.parentElement.offsetWidth-i;!n||this.cssClass&&-1!==this.cssClass.split(" ").indexOf("e-outline")||(t.style.width=n+"px")}},t.prototype.clearFloatLabelOverflowWidth=function(){var e=this.inputWrapper.container.querySelector(".e-float-text.e-label-top");e&&e.removeAttribute("style")},t.prototype.getPersistData=function(){return this.addOnPersist(["startDate","endDate","value"])},t.prototype.getSelectedRange=function(){var e;return(0,i.isNullOrUndefined)(this.startValue)||(0,i.isNullOrUndefined)(this.endValue)?e=0:(e=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1,!(0,i.isNullOrUndefined)(this.renderDayCellArgs)&&this.renderDayCellArgs.isDisabled&&this.disabledDateRender(),(0,i.isNullOrUndefined)(this.disabledDayCnt)||(e-=this.disabledDayCnt,this.disabledDayCnt=null)),{startDate:this.startValue,endDate:this.endValue,daySpan:e}},t.prototype.show=function(t,s){var a=this;if(this.isMobile&&this.popupObj&&this.popupObj.refreshPosition(),!(this.enabled&&this.readonly||!this.enabled||this.popupObj||this.isPopupOpen())){t&&(this.targetElement=t),this.createPopup(),(this.isMobile||i.Browser.isDevice)&&(this.mobileRangePopupWrap=this.createElement("div",{className:"e-daterangepick-mob-popup-wrap"}),document.body.appendChild(this.mobileRangePopupWrap)),this.openEventArgs={popup:this.popupObj||null,cancel:!1,date:this.inputElement.value,model:this,event:s||null,appendTo:this.isMobile||i.Browser.isDevice?this.mobileRangePopupWrap:document.body};var n=this.openEventArgs;this.trigger("open",n,function(n){if(a.openEventArgs=n,!a.openEventArgs.cancel){a.openEventArgs.appendTo.appendChild(a.popupWrapper),a.showPopup(t,s);var r=!a.isCustomRange||a.isMobile&&a.isCustomRange;if(!(0,i.isUndefined)(a.presets[0].start&&a.presets[0].end&&a.presets[0].label)&&r&&a.setScrollPosition(),a.checkMinMaxDays(),a.isMobile&&!(0,i.isNullOrUndefined)(a.startDate)&&(0,i.isNullOrUndefined)(a.endDate)&&(a.endButton.element.classList.add(ue),a.startButton.element.classList.remove(ue),a.endButton.element.removeAttribute("disabled"),a.selectableDates()),e.prototype.setOverlayIndex.call(a,a.mobileRangePopupWrap,a.popupObj.element,a.modal,a.isMobile||i.Browser.isDevice),!(0,i.isNullOrUndefined)(a.mobileRangePopupWrap)&&!(0,i.isNullOrUndefined)(a.popupObj)&&!(0,i.isNullOrUndefined)(a.popupObj.element)&&(0,i.isNullOrUndefined)(a.modal)&&!(0,i.isUndefined)(a.presets[0].start&&a.presets[0].end&&a.presets[0].label)&&r&&(a.isMobile||i.Browser.isDevice)&&!a.isCustomWindow){var l=parseInt(a.popupObj.element.style.zIndex,10)?parseInt(a.popupObj.element.style.zIndex,10):1e3;a.mobileRangePopupWrap.style.zIndex=l.toString()}if(i.Browser.isDevice){var o=a.createElement("div",{className:"e-dlg-overlay"});o.style.zIndex=(a.zIndex-1).toString(),a.mobileRangePopupWrap.appendChild(o)}}})}},t.prototype.hide=function(e){var t=this;if(this.popupObj){if((0,i.isNullOrUndefined)(this.previousEndValue)&&(0,i.isNullOrUndefined)(this.previousStartValue)?this.clearRange():((0,i.isNullOrUndefined)(this.previousStartValue)?(this.startValue=null,this.setValue()):(this.startValue=new Date(this.checkValue(this.previousStartValue)),this.setValue(),this.currentDate=new Date(this.checkValue(this.startValue))),(0,i.isNullOrUndefined)(this.previousEndValue)?(this.endValue=null,this.setValue()):(this.endValue=new Date(this.checkValue(this.previousEndValue)),this.setValue())),this.isPopupOpen()){this.closeEventArgs={cancel:!1,popup:this.popupObj,date:this.inputElement.value,model:this,event:e||null};var s=this.closeEventArgs;this.trigger("close",s,function(e){t.closeEventArgs=e,t.closeEventArgs.cancel?(0,i.removeClass)([t.inputWrapper.buttons[0]],ue):(t.isMobile&&((0,i.isNullOrUndefined)(t.startButton)||(0,i.isNullOrUndefined)(t.endButton)||(i.EventHandler.remove(t.startButton.element,"click touchstart",t.deviceHeaderClick),i.EventHandler.remove(t.endButton.element,"click touchstart",t.deviceHeaderClick))),t.popupObj&&(t.popupObj.hide(),t.preventBlur&&(t.inputElement.focus(),(0,i.addClass)([t.inputWrapper.container],[me]))),t.isMobile||((0,i.isNullOrUndefined)(t.leftKeyboardModule)||(0,i.isNullOrUndefined)(t.rightKeyboardModule)||(t.leftKeyboardModule.destroy(),t.rightKeyboardModule.destroy()),(0,i.isNullOrUndefined)(t.presetElement)||t.presetKeyboardModule.destroy(),(0,i.isNullOrUndefined)(t.cancelButton)||t.btnKeyboardModule.destroy()),t.targetElement=null,(0,i.removeClass)([document.body],Be),i.EventHandler.remove(document,"mousedown touchstart",t.documentHandler),t.isMobile&&t.modal&&(t.modal.style.display="none",t.modal.outerHTML="",t.modal=null),(t.isMobile||i.Browser.isDevice)&&((0,i.isNullOrUndefined)(t.mobileRangePopupWrap)||(t.mobileRangePopupWrap.remove(),t.mobileRangePopupWrap=null)),t.isKeyPopup=t.dateDisabled=!1),t.updateClearIconState(),t.updateHiddenInput(),t.isMobile&&t.allowEdit&&!t.readonly&&t.inputElement.removeAttribute("readonly")})}}else this.updateClearIconState(),this.updateHiddenInput(),this.isMobile&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly")},t.prototype.setLocale=function(){this.globalize=new i.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.dateRangeOptions&&null==this.dateRangeOptions.placeholder&&(this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),j.Input.setPlaceholder(this.placeholder,this.inputElement)),this.updateInput(),this.updateHiddenInput(),this.changeTrigger()},t.prototype.refreshChange=function(){this.checkView(),this.refreshControl(),this.changeTrigger()},t.prototype.setDate=function(){j.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.refreshChange()},t.prototype.enableInput=function(){+this.min<=+this.max&&(this.setProperties({enabled:!0},!0),j.Input.setEnabled(this.enabled,this.inputElement),this.element.hasAttribute("disabled")&&this.bindEvents())},t.prototype.clearModelvalue=function(e,t){this.setProperties({startDate:null},!0),this.setProperties({endDate:null},!0),t.value&&t.value.length>0?this.setProperties({value:null},!0):(t.value&&t.value.start||t.value&&!t.value.start)&&this.setProperties({value:{start:null,end:null}},!0),this.updateValue(),this.setDate()},t.prototype.createHiddenInput=function(){(0,i.isNullOrUndefined)(this.firstHiddenChild)&&(0,i.isNullOrUndefined)(this.secondHiddenChild)&&(this.firstHiddenChild=this.createElement("input"),this.secondHiddenChild=this.createElement("input")),(0,i.isNullOrUndefined)(this.inputElement.getAttribute("name"))||(this.inputElement.setAttribute("data-name",this.inputElement.getAttribute("name")),this.inputElement.removeAttribute("name")),(0,i.attributes)(this.firstHiddenChild,{type:"text",name:this.inputElement.getAttribute("data-name"),class:ze}),(0,i.attributes)(this.secondHiddenChild,{type:"text",name:this.inputElement.getAttribute("data-name"),class:ze});var e={format:this.formatString,type:"datetime",skeleton:"yMd"};this.firstHiddenChild.value=this.startDate&&this.globalize.formatDate(this.startDate,e),this.secondHiddenChild.value=this.endDate&&this.globalize.formatDate(this.endDate,e),this.inputElement.parentElement.appendChild(this.firstHiddenChild),this.inputElement.parentElement.appendChild(this.secondHiddenChild)},t.prototype.setMinMaxDays=function(){this.isPopupOpen()&&(this.removeClassDisabled(),this.checkMinMaxDays(),this.isMobile&&this.selectableDates(),!this.strictMode&&(0,i.isNullOrUndefined)(this.startValue)&&(0,i.isNullOrUndefined)(this.endValue)?this.removeSelection():this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar]),this.updateHeader())},t.prototype.getAmPmValue=function(e){try{return"string"==typeof e&&""!==e.trim()?e.replace(/(am|pm|Am|aM|pM|Pm)/g,function(e){return e.toLocaleUpperCase()}):""}catch(e){return console.error("Error occurred while processing date:",e),""}},t.prototype.getStartEndValue=function(e,t){return"Month"===this.depth?this.checkDateValue(new Date(this.checkValue(e))):"Year"===this.depth?new Date(e.getFullYear(),e.getMonth()+(t?1:0),t?0:1):new Date(e.getFullYear(),t?11:0,t?31:1)},t.prototype.onPropertyChanged=function(e,t){for(var s={format:this.formatString,type:"date",skeleton:"yMd"},a=!1,n=0,r=Object.keys(e);n<r.length;n++){var l=r[n];switch(["blur","change","cleared","close","created","destroyed","focus","navigated","open","renderDayCell","select"].indexOf(l)>0&&this.isReact&&(a=!0),l){case"width":this.setEleWidth(this.width),j.Input.calculateWidth(this.inputElement,this.inputWrapper.container),(0,i.isNullOrUndefined)(this.inputWrapper.buttons[0])||(0,i.isNullOrUndefined)(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon");break;case"separator":this.previousEleValue=this.inputElement.value,this.setProperties({separator:e.separator},!0),this.updateInput(),this.changeTrigger();break;case"placeholder":j.Input.setPlaceholder(e.placeholder,this.inputElement),this.setProperties({placeholder:e.placeholder},!0);break;case"readonly":j.Input.setReadonly(this.readonly,this.inputElement),this.setRangeAllowEdit();break;case"cssClass":this.updateCssClass(e.cssClass,t.cssClass);break;case"enabled":this.setProperties({enabled:e.enabled},!0),j.Input.setEnabled(this.enabled,this.inputElement),this.enabled?this.inputElement.setAttribute("tabindex",this.tabIndex):this.inputElement.tabIndex=-1;break;case"allowEdit":this.setRangeAllowEdit();break;case"enableRtl":this.setProperties({enableRtl:e.enableRtl},!0),j.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]);break;case"zIndex":this.setProperties({zIndex:e.zIndex},!0);break;case"format":this.setProperties({format:e.format},!0),this.checkFormat(),this.updateInput(),this.changeTrigger();break;case"inputFormats":this.checkInputFormats();break;case"locale":this.globalize=new i.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.dateRangeOptions&&null==this.dateRangeOptions.placeholder&&(this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),j.Input.setPlaceholder(this.placeholder,this.inputElement)),this.setLocale();break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.setDataAttribute(!0),this.checkHtmlAttributes(!0);break;case"showClearButton":j.Input.setClearButton(this.showClearButton,this.inputElement,this.inputWrapper),this.bindClearEvent();break;case"startDate":"string"==typeof e.startDate&&(e.startDate=this.globalize.parseDate(this.getAmPmValue(e.startDate),s)),+this.initStartDate!==+e.startDate&&(this.startValue=this.getStartEndValue(e.startDate,!1),this.setDate(),this.setValue());break;case"endDate":"string"==typeof e.endDate&&(e.endDate=this.globalize.parseDate(this.getAmPmValue(e.endDate),s)),+this.initEndDate!==+e.endDate&&(this.endValue=this.getStartEndValue(e.endDate,!0),this.setDate(),this.setValue());break;case"value":if(a=!0,this.invalidValueString=null,this.checkInvalidRange(e.value),"string"==typeof e.value)if(this.invalidValueString)this.clearModelvalue(e,t);else{var o=e.value.split(" "+this.separator+" ");this.value=[new Date(o[0]),new Date(o[1])],this.updateValue(),this.setDate()}else!(0,i.isNullOrUndefined)(e.value)&&e.value.length>0||!(0,i.isNullOrUndefined)(e.value)&&e.value.start?(this.valueType=e.value,null===e.value[0]||null===e.value.start?1===e.value.length||e.value.start?this.clearModelvalue(e,t):null!==e.value[1]&&null!==e.value.start||this.clearModelvalue(e,t):+this.initStartDate===+e.value[0]&&+this.initEndDate===+e.value[1]&&+this.initStartDate===+(e.value.start||+this.initEndDate!==+e.value.start)||((1===e.value.length||e.value.start)&&(this.modelValue=e.value),this.updateValue(),this.setDate())):((0,i.isNullOrUndefined)(this.value)||null==e.value.start)&&(this.valueType=e.value,this.startValue=null,this.endValue=null,this.clearModelvalue(e,t));if(this.isPopupOpen()){if((0,i.isNullOrUndefined)(this.startValue)&&(0,i.isNullOrUndefined)(this.endValue))return this.removeSelection(),void(this.isMobile&&this.deviceHeaderUpdate());this.isMobile?(this.navigate(this.deviceCalendar,this.startValue,this.currentView()),this.deviceHeaderUpdate()):(this.navigate(this.leftCalendar,this.startValue,this.currentView()),this.updateControl(this.leftCalendar),this.navigate(this.rightCalendar,this.endValue,this.currentView()),this.updateControl(this.rightCalendar)),this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar]),this.updateHeader(),this.applyButton.disabled=this.applyButton.element.disabled=!1}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange;break;case"minDays":a=!0,this.setProperties({minDays:e.minDays},!0),this.refreshChange(),this.setMinMaxDays();break;case"maxDays":a=!0,this.setProperties({maxDays:e.maxDays},!0),this.refreshChange(),this.setMinMaxDays();break;case"min":this.setProperties({min:this.checkDateValue(new Date(this.checkValue(e.min)))},!0),this.previousEleValue=this.inputElement.value,this.enableInput(),this.refreshChange();break;case"max":this.setProperties({max:this.checkDateValue(new Date(this.checkValue(e.max)))},!0),this.enableInput(),this.refreshChange();break;case"strictMode":this.invalidValueString=null,this.setProperties({strictMode:e.strictMode},!0),this.refreshChange();break;case"presets":this.setProperties({presets:e.presets},!0),this.processPresets();break;case"floatLabelType":this.floatLabelType=e.floatLabelType,j.Input.removeFloating(this.inputWrapper),j.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder),(0,i.isNullOrUndefined)(this.inputWrapper.buttons[0])||(0,i.isNullOrUndefined)(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon");break;case"start":this.setProperties({start:e.start},!0),this.refreshChange();break;case"depth":this.setProperties({depth:e.depth},!0),this.refreshChange()}a||this.hide(null)}},se([(0,i.Property)(null)],t.prototype,"value",void 0),se([(0,i.Property)(!1)],t.prototype,"enablePersistence",void 0),se([(0,i.Property)(new Date(1900,0,1))],t.prototype,"min",void 0),se([(0,i.Property)(new Date(2099,11,31))],t.prototype,"max",void 0),se([(0,i.Property)(null)],t.prototype,"locale",void 0),se([(0,i.Property)(null)],t.prototype,"firstDayOfWeek",void 0),se([(0,i.Property)(!1)],t.prototype,"weekNumber",void 0),se([(0,i.Property)("Gregorian")],t.prototype,"calendarMode",void 0),se([(0,i.Property)(!1)],t.prototype,"openOnFocus",void 0),se([(0,i.Property)(!1)],t.prototype,"fullScreenMode",void 0),se([(0,i.Event)()],t.prototype,"created",void 0),se([(0,i.Event)()],t.prototype,"destroyed",void 0),se([(0,i.Event)()],t.prototype,"change",void 0),se([(0,i.Event)()],t.prototype,"cleared",void 0),se([(0,i.Event)()],t.prototype,"navigated",void 0),se([(0,i.Event)()],t.prototype,"renderDayCell",void 0),se([(0,i.Property)(null)],t.prototype,"startDate",void 0),se([(0,i.Property)(null)],t.prototype,"endDate",void 0),se([(0,i.Collection)([{}],Ke)],t.prototype,"presets",void 0),se([(0,i.Property)("")],t.prototype,"width",void 0),se([(0,i.Property)(1e3)],t.prototype,"zIndex",void 0),se([(0,i.Property)(!0)],t.prototype,"showClearButton",void 0),se([(0,i.Property)(!0)],t.prototype,"showTodayButton",void 0),se([(0,i.Property)("Month")],t.prototype,"start",void 0),se([(0,i.Property)("Month")],t.prototype,"depth",void 0),se([(0,i.Property)("")],t.prototype,"cssClass",void 0),se([(0,i.Property)("-")],t.prototype,"separator",void 0),se([(0,i.Property)(null)],t.prototype,"minDays",void 0),se([(0,i.Property)(null)],t.prototype,"maxDays",void 0),se([(0,i.Property)(!1)],t.prototype,"strictMode",void 0),se([(0,i.Property)(null)],t.prototype,"keyConfigs",void 0),se([(0,i.Property)(null)],t.prototype,"format",void 0),se([(0,i.Property)(null)],t.prototype,"inputFormats",void 0),se([(0,i.Property)(!0)],t.prototype,"enabled",void 0),se([(0,i.Property)(!1)],t.prototype,"readonly",void 0),se([(0,i.Property)(!0)],t.prototype,"allowEdit",void 0),se([(0,i.Property)("Never")],t.prototype,"floatLabelType",void 0),se([(0,i.Property)(null)],t.prototype,"placeholder",void 0),se([(0,i.Property)({})],t.prototype,"htmlAttributes",void 0),se([(0,i.Event)()],t.prototype,"open",void 0),se([(0,i.Event)()],t.prototype,"close",void 0),se([(0,i.Event)()],t.prototype,"select",void 0),se([(0,i.Event)()],t.prototype,"focus",void 0),se([(0,i.Event)()],t.prototype,"blur",void 0),t=se([i.NotifyPropertyChanges],t)}(I),Ge=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Ze=function(e,t,i,s){var a,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(r=(n<3?a(r):n>3?a(t,i,r):a(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},Xe="e-error",Je="240px",$e=(new Date).getDate(),Qe=(new Date).getMonth(),et=(new Date).getFullYear(),tt="e-timepicker",it="e-active",st="e-hover",at="e-navigation",nt="e-disabled",rt="e-input-focus",lt="e-list-item",ot="e-time-overflow",ht="e-non-edit",ut=["title","class","style"];!function(e){e.createListItems=function(e,t,i,s,a,n){var r;this.calendarMode;var l=6e4*n,o=[],h=[];r=+t.setMilliseconds(0);for(var u=+i.setMilliseconds(0);u>=r;)h.push(r),o.push(s.formatDate(new Date(r),{format:a,type:"time"})),r+=l;return{collection:h,list:te.ListBase.createList(e,o,null,!0)}}}(t||(t={}));var dt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ge(t,e),Ze([(0,i.Property)("day")],t.prototype,"day",void 0),Ze([(0,i.Property)("month")],t.prototype,"month",void 0),Ze([(0,i.Property)("year")],t.prototype,"year",void 0),Ze([(0,i.Property)("day of the week")],t.prototype,"dayOfTheWeek",void 0),Ze([(0,i.Property)("hour")],t.prototype,"hour",void 0),Ze([(0,i.Property)("minute")],t.prototype,"minute",void 0),Ze([(0,i.Property)("second")],t.prototype,"second",void 0),t}(i.ChildProperty),pt=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.liCollections=[],s.timeCollections=[],s.disableItemCollection=[],s.invalidValueString=null,s.preventChange=!1,s.maskedDateValue="",s.moduleName=s.getModuleName(),s.timeOptions=t,s}return Ge(t,e),t.prototype.preRender=function(){this.keyConfigure={enter:"enter",escape:"escape",end:"end",tab:"tab",home:"home",down:"downarrow",up:"uparrow",left:"leftarrow",right:"rightarrow",open:"alt+downarrow",close:"alt+uparrow"},this.cloneElement=this.element.cloneNode(!0),(0,i.removeClass)([this.cloneElement],[tt,"e-control","e-lib"]),this.inputElement=this.element,this.angularTag=null,this.formElement=(0,i.closest)(this.element,"form"),"EJS-TIMEPICKER"===this.element.tagName&&(this.angularTag=this.element.tagName,this.inputElement=this.createElement("input"),this.element.appendChild(this.inputElement)),this.openPopupEventArgs={appendTo:document.body}},t.prototype.render=function(){this.initialize(),this.createInputElement(),this.updateHtmlAttributeToWrapper(),this.setTimeAllowEdit(),this.setEnable(),this.validateInterval(),this.bindEvents(),this.validateDisable(),this.setTimeZone(),this.setValue(this.getFormattedValue(this.value)),!this.enableMask||this.value||!this.maskedDateValue||"Always"!==this.floatLabelType&&this.floatLabelType&&this.placeholder||(this.updateInputValue(this.maskedDateValue),this.checkErrorState(this.maskedDateValue)),this.anchor=this.inputElement,this.inputElement.setAttribute("value",this.inputElement.value),this.inputEleValue=this.getDateObject(this.inputElement.value),(0,i.isNullOrUndefined)(this.inputWrapper.buttons[0])||(0,i.isNullOrUndefined)(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon"),!(0,i.isNullOrUndefined)((0,i.closest)(this.element,"fieldset"))&&(0,i.closest)(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete()},t.prototype.setTimeZone=function(){if(!(0,i.isNullOrUndefined)(this.serverTimezoneOffset)&&this.value){var e=(new Date).getTimezoneOffset()/60,t=this.serverTimezoneOffset+e;t=this.isDayLightSaving()?t--:t,this.value=new Date(this.value.getTime()+60*t*60*1e3)}},t.prototype.isDayLightSaving=function(){var e=new Date(this.value.getFullYear(),0,1).getTimezoneOffset(),t=new Date(this.value.getFullYear(),6,1).getTimezoneOffset();return this.value.getTimezoneOffset()<Math.max(e,t)},t.prototype.setTimeAllowEdit=function(){this.allowEdit?this.readonly||this.inputElement.removeAttribute("readonly"):(0,i.attributes)(this.inputElement,{readonly:""}),this.clearIconState()},t.prototype.clearIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&(0,i.removeClass)([this.inputWrapper.container],[ht]):""===this.inputElement.value?(0,i.removeClass)([this.inputWrapper.container],[ht]):(0,i.addClass)([this.inputWrapper.container],[ht])},t.prototype.validateDisable=function(){this.setMinMax(this.initMin,this.initMax),(0,i.isNullOrUndefined)(this.value)||(this.popupCreation(),this.popupObj.destroy(),this.popupWrapper=this.popupObj=null),isNaN(+this.value)||null===this.value||this.valueIsDisable(this.value)||(this.strictMode&&this.resetState(),this.initValue=null,this.initMax=this.getDateObject(this.initMax),this.initMin=this.getDateObject(this.initMin),this.timeCollections=this.liCollections=[],this.setMinMax(this.initMin,this.initMax))},t.prototype.validationAttribute=function(e,t){var s=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id");t.setAttribute("name",s),e.removeAttribute("name");for(var a=["required","aria-required","form"],n=0;n<a.length;n++)if(!(0,i.isNullOrUndefined)(e.getAttribute(a[n]))){var r=e.getAttribute(a[n]);t.setAttribute(a[n],r),e.removeAttribute(a[n])}},t.prototype.initialize=function(){this.globalize=new i.Internationalization(this.locale),this.defaultCulture=new i.Internationalization("en"),this.checkTimeFormat(),this.checkInvalidValue(this.value),this.setProperties({value:this.checkDateValue(new Date(this.checkInValue(this.value)))},!0),this.setProperties({min:this.checkDateValue(new Date(this.checkInValue(this.min)))},!0),this.setProperties({max:this.checkDateValue(new Date(this.checkInValue(this.max)))},!0),this.setProperties({scrollTo:this.checkDateValue(new Date(this.checkInValue(this.scrollTo)))},!0),null!==this.angularTag&&this.validationAttribute(this.element,this.inputElement),this.updateHtmlAttributeToElement(),this.checkAttributes(!1);var e={placeholder:this.placeholder};this.l10n=new i.L10n("timepicker",e,this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),null!==this.angularTag?(this.tabIndex=this.inputElement.hasAttribute("tabindex")?this.inputElement.getAttribute("tabindex"):"0",this.inputElement.removeAttribute("tabindex")):(this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex")),this.initValue=this.checkDateValue(this.value),this.initMin=this.checkDateValue(this.min),this.initMax=this.checkDateValue(this.max),this.isNavigate=this.isPreventBlur=this.isTextSelected=!1,this.activeIndex=this.valueWithMinutes=this.prevDate=null,(0,i.isNullOrUndefined)(this.element.getAttribute("id"))?(this.element.id=(0,i.getUniqueID)("ej2_timepicker"),null!==this.angularTag&&(0,i.attributes)(this.inputElement,{id:this.element.id+"_input"})):null!==this.angularTag&&(this.inputElement.id=this.element.getAttribute("id")+"_input"),(0,i.isNullOrUndefined)(this.inputElement.getAttribute("name"))&&(0,i.attributes)(this.inputElement,{name:this.element.id}),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"})},t.prototype.checkTimeFormat=function(){if(this.format)if("string"==typeof this.format)this.formatString=this.format;else if((0,i.isNullOrUndefined)(this.format.skeleton)||""===this.format.skeleton)this.formatString=this.globalize.getDatePattern({type:"time",skeleton:"short"});else{var e=this.format.skeleton;this.formatString=this.globalize.getDatePattern({type:"time",skeleton:e})}else this.formatString=null},t.prototype.checkDateValue=function(e){return!(0,i.isNullOrUndefined)(e)&&e instanceof Date&&!isNaN(+e)?e:null},t.prototype.createInputElement=function(){this.fullScreenMode&&i.Browser.isDevice&&(this.cssClass+=" e-popup-expand");var e=this.cssClass,t=!this.enableMask;(0,i.isNullOrUndefined)(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),this.inputWrapper=j.Input.createInput({element:this.inputElement,bindClearAction:t,floatLabelType:this.floatLabelType,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:e,enabled:this.enabled,enableRtl:this.enableRtl,showClearButton:this.showClearButton},buttons:[" e-input-group-icon e-time-icon e-icons"]},this.createElement),this.inputWrapper.container.style.width=this.setWidth(this.width),this.updateFloatLabelOverflowWidth(),(0,i.attributes)(this.inputElement,{"aria-autocomplete":"list",tabindex:"0","aria-expanded":"false",role:"combobox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-disabled":"false","aria-invalid":"false"}),this.isNullOrEmpty(this.inputStyle)||j.Input.addAttributes({style:this.inputStyle},this.inputElement),(0,i.addClass)([this.inputWrapper.container],"e-time-wrapper")},t.prototype.getCldrDateTimeFormat=function(){var e=new i.Internationalization(this.locale).getDatePattern({skeleton:"yMd"});return this.isNullOrEmpty(this.formatString)?e+" "+this.cldrFormat("time"):this.formatString},t.prototype.checkInvalidValue=function(e){var t=!1;if("object"!=typeof e&&!(0,i.isNullOrUndefined)(e)){var s=e;"string"==typeof s&&(s=s.trim());var a,n=null;if("number"==typeof e?s=e.toString():"string"==typeof e&&(/^[a-zA-Z0-9- ]*$/.test(e)||(n=this.setCurrentDate(this.getDateObject(e)),(0,i.isNullOrUndefined)(n)&&(n=this.checkDateValue(this.globalize.parseDate(this.getAmPmValue(s),{format:this.getCldrDateTimeFormat(),type:"datetime"})),(0,i.isNullOrUndefined)(n)&&(n=this.checkDateValue(this.globalize.parseDate(this.getAmPmValue(s),{format:this.formatString,type:"dateTime",skeleton:"yMd"})))))),a=this.globalize.parseDate(this.getAmPmValue(s),{format:this.getCldrDateTimeFormat(),type:"datetime"}),n=!(0,i.isNullOrUndefined)(a)&&a instanceof Date&&!isNaN(+a)?a:null,(0,i.isNullOrUndefined)(n)&&s.replace(/\s/g,"").length){var r=null;r=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,!/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/.test(s)&&!r.test(s)||/^[a-zA-Z0-9- ]*$/.test(e)||isNaN(+new Date(""+s))?t=!0:n=new Date(""+s)}t?(this.strictMode||(this.invalidValueString=s),this.setProperties({value:null},!0),this.initValue=null):(this.setProperties({value:n},!0),this.initValue=this.value)}},t.prototype.requiredModules=function(){var e=[];return this.enableMask&&e.push({args:[this],member:"MaskedDateTime"}),e},t.prototype.getAmPmValue=function(e){try{return"string"==typeof e&&""!==e.trim()?e.replace(/(am|pm|Am|aM|pM|Pm)/g,function(e){return e.toLocaleUpperCase()}):""}catch(e){return console.error("Error occurred while processing date:",e),""}},t.prototype.cldrFormat=function(e){return"en"===this.locale||"en-US"===this.locale?(0,i.getValue)("timeFormats.short",(0,i.getDefaultDateObject)()):this.getCultureTimeObject(i.cldrData,""+this.locale)},t.prototype.destroy=function(){this.hide(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),this.unBindEvents();this.inputElement&&(j.Input.removeAttributes({"aria-autocomplete":"list",tabindex:"0","aria-expanded":"false",role:"combobox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-disabled":"true","aria-invalid":"false"},this.inputElement),null===this.angularTag&&this.inputWrapper.container.parentElement.appendChild(this.inputElement),(0,i.isNullOrUndefined)(this.cloneElement.getAttribute("tabindex"))?this.inputElement.removeAttribute("tabindex"):this.inputElement.setAttribute("tabindex",this.tabIndex),this.ensureInputAttribute(),this.enableElement([this.inputElement]),this.inputElement.classList.remove("e-input"),(0,i.isNullOrUndefined)(this.cloneElement.getAttribute("disabled"))&&j.Input.setEnabled(!0,this.inputElement,this.floatLabelType)),this.inputWrapper.container&&(0,i.detach)(this.inputWrapper.container),this.inputWrapper=this.popupWrapper=this.cloneElement=void 0,this.liCollections=this.timeCollections=this.disableItemCollection=[],(0,i.isNullOrUndefined)(this.rippleFn)||this.rippleFn(),j.Input.destroy({element:this.inputElement,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),e.prototype.destroy.call(this),this.formElement&&i.EventHandler.remove(this.formElement,"reset",this.formResetHandler),this.rippleFn=null,this.openPopupEventArgs=null,this.selectedElement=null,this.listTag=null,this.liCollections=null},t.prototype.ensureInputAttribute=function(){for(var e=[],t=0;t<this.inputElement.attributes.length;t++)e[t]=this.inputElement.attributes[t].name;for(t=0;t<e.length;t++)(0,i.isNullOrUndefined)(this.cloneElement.getAttribute(e[t]))?(this.inputElement.removeAttribute(e[t]),"value"===e[t].toLowerCase()&&(this.inputElement.value="")):(this.inputElement.setAttribute(e[t],this.cloneElement.getAttribute(e[t])),"value"===e[t].toLowerCase()&&(this.inputElement.value=this.cloneElement.getAttribute(e[t])))},t.prototype.popupCreation=function(){this.popupWrapper=this.createElement("div",{className:tt+" e-popup",attrs:{id:this.element.id+"_popup"}}),this.popupWrapper.style.visibility="hidden",this.popupWrapper.setAttribute("aria-label",this.element.id),this.popupWrapper.setAttribute("role","dialog"),(0,i.isNullOrUndefined)(this.cssClass)||(this.popupWrapper.className+=" "+this.cssClass),!(0,i.isNullOrUndefined)(this.step)&&this.step>0&&(this.generateList(),(0,i.append)([this.listWrapper],this.popupWrapper)),this.addSelection(),this.renderPopup(),(0,i.detach)(this.popupWrapper)},t.prototype.getPopupHeight=function(){var e=parseInt(Je,10),t=this.popupWrapper.getBoundingClientRect().height;return t>e?e:t},t.prototype.generateList=function(){this.createListItems(),this.wireListEvents();var e={duration:300,selector:"."+lt};this.rippleFn=(0,i.rippleEffect)(this.listWrapper,e),this.liCollections=this.listWrapper.querySelectorAll("."+lt)},t.prototype.renderPopup=function(){var e=this;if(this.containerStyle=this.inputWrapper.container.getBoundingClientRect(),this.popupObj=new B.Popup(this.popupWrapper,{width:this.setPopupWidth(this.width),zIndex:this.zIndex,targetType:"relative",position:i.Browser.isDevice?{X:"center",Y:"center"}:{X:"left",Y:"bottom"},collision:i.Browser.isDevice?{X:"fit",Y:"fit"}:{X:"flip",Y:"flip"},enableRtl:this.enableRtl,relateTo:i.Browser.isDevice?document.body:this.inputWrapper.container,offsetY:4,open:function(){e.popupWrapper.style.visibility="visible",(0,i.addClass)([e.inputWrapper.buttons[0]],it)},close:function(){(0,i.removeClass)([e.inputWrapper.buttons[0]],it),e.unWireListEvents(),e.inputElement.removeAttribute("aria-activedescendant"),(0,i.remove)(e.popupObj.element),e.popupObj.destroy(),e.popupWrapper.innerHTML="",e.listWrapper=e.popupWrapper=e.listTag=void 0},targetExitViewport:function(){i.Browser.isDevice||e.hide()}}),i.Browser.isDevice||(this.popupObj.collision={X:"none",Y:"flip"}),i.Browser.isDevice&&this.fullScreenMode?(this.popupObj.element.style.maxHeight="100%",this.popupObj.element.style.width="100%"):this.popupObj.element.style.maxHeight=Je,i.Browser.isDevice&&this.fullScreenMode){var t=this.createElement("div",{className:"e-model-header"}),s=this.createElement("span",{className:"e-model-title"});s.textContent="Select time";var a=this.createElement("span",{className:"e-popup-close"});i.EventHandler.add(a,"mousedown touchstart",this.timePopupCloseHandler,this),t.appendChild(a),t.appendChild(s),this.popupWrapper.insertBefore(t,this.popupWrapper.firstElementChild)}},t.prototype.timePopupCloseHandler=function(e){this.hide()},t.prototype.getFormattedValue=function(e){return(0,i.isNullOrUndefined)(this.checkDateValue(e))?null:this.globalize.formatDate(e,{skeleton:"medium",type:"time"})},t.prototype.getDateObject=function(e){if(!this.isNullOrEmpty(e)){var t=this.createDateObj(e),i=!this.isNullOrEmpty(this.initValue);if(this.checkDateValue(t)){var s=i?this.initValue.getDate():$e,a=i?this.initValue.getMonth():Qe,n=i?this.initValue.getFullYear():et;return new Date(n,a,s,t.getHours(),t.getMinutes(),t.getSeconds())}}return null},t.prototype.updateHtmlAttributeToWrapper=function(){if(!(0,i.isNullOrUndefined)(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var s=t[e];if(ut.indexOf(s)>-1)if("class"===s){var a=this.htmlAttributes[""+s].replace(/\s+/g," ").trim();""!==a&&(0,i.addClass)([this.inputWrapper.container],a.split(" "))}else if("style"===s){var n=this.inputWrapper.container.getAttribute(s);n=(0,i.isNullOrUndefined)(n)?this.htmlAttributes[""+s]:n+this.htmlAttributes[""+s],this.inputWrapper.container.setAttribute(s,n)}else this.inputWrapper.container.setAttribute(s,this.htmlAttributes[""+s])}},t.prototype.updateHtmlAttributeToElement=function(){if(!(0,i.isNullOrUndefined)(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var s=t[e];ut.indexOf(s)<0&&this.inputElement.setAttribute(s,this.htmlAttributes[""+s])}},t.prototype.updateCssClass=function(e,t){(0,i.isNullOrUndefined)(t)||(t=t.replace(/\s+/g," ").trim()),(0,i.isNullOrUndefined)(e)||(e=e.replace(/\s+/g," ").trim()),j.Input.setCssClass(e,[this.inputWrapper.container],t),this.popupWrapper&&j.Input.setCssClass(e,[this.popupWrapper],t)},t.prototype.removeErrorClass=function(){(0,i.removeClass)([this.inputWrapper.container],Xe),(0,i.attributes)(this.inputElement,{"aria-invalid":"false"})},t.prototype.checkErrorState=function(e){var t=this.getDateObject(e);this.validateState(t)&&!this.invalidValueString||this.enableMask&&this.inputElement.value===this.maskedDateValue?this.removeErrorClass():((0,i.addClass)([this.inputWrapper.container],Xe),(0,i.attributes)(this.inputElement,{"aria-invalid":"true"}))},t.prototype.validateInterval=function(){!(0,i.isNullOrUndefined)(this.step)&&this.step>0?this.enableElement([this.inputWrapper.buttons[0]]):this.disableTimeIcon()},t.prototype.disableTimeIcon=function(){this.disableElement([this.inputWrapper.buttons[0]]),this.hide()},t.prototype.disableElement=function(e){(0,i.addClass)(e,nt)},t.prototype.enableElement=function(e){(0,i.removeClass)(e,nt)},t.prototype.selectInputText=function(){this.inputElement.setSelectionRange(0,this.inputElement.value.length)},t.prototype.setCursorToEnd=function(){this.inputElement.setSelectionRange(this.inputElement.value.length,this.inputElement.value.length)},t.prototype.getMeridianText=function(){var e;if("en"===this.locale||"en-US"===this.locale)e=(0,i.getValue)("dayPeriods.format.wide",(0,i.getDefaultDateObject)());else{e=(0,i.getValue)("main."+this.locale+".dates.calendars.gregorian.dayPeriods.format.abbreviated",i.cldrData)}return e},t.prototype.getCursorSelection=function(){var e=this.inputElement,t=0,i=0;return isNaN(e.selectionStart)||(t=e.selectionStart,i=e.selectionEnd),{start:Math.abs(t),end:Math.abs(i)}},t.prototype.getActiveElement=function(){return(0,i.isNullOrUndefined)(this.popupWrapper)?null:this.popupWrapper.querySelectorAll("."+it)},t.prototype.isNullOrEmpty=function(e){return!!((0,i.isNullOrUndefined)(e)||"string"==typeof e&&""===e.trim())},t.prototype.setWidth=function(e){return e="number"==typeof e?(0,i.formatUnit)(e):"string"==typeof e?e.match(/px|%|em/)?e:(0,i.formatUnit)(e):"100%"},t.prototype.setPopupWidth=function(e){(e=this.setWidth(e)).indexOf("%")>-1&&(e=(this.containerStyle.width*parseFloat(e)/100).toString()+"px");return e},t.prototype.setScrollPosition=function(){var e=this.selectedElement;(0,i.isNullOrUndefined)(e)?this.popupWrapper&&this.checkDateValue(this.scrollTo)&&this.setScrollTo():this.findScrollTop(e)},t.prototype.findScrollTop=function(e){var t=this.getPopupHeight(),i=e.nextElementSibling,s=i?i.offsetTop:e.offsetTop,a=e.getBoundingClientRect().height;s+e.offsetTop>t?this.popupWrapper.scrollTop=i?s-(t/2+a/2):s:this.popupWrapper.scrollTop=0},t.prototype.setScrollTo=function(){var e;if((0,i.isNullOrUndefined)(this.popupWrapper))this.popupWrapper.scrollTop=0;else{var t=this.popupWrapper.querySelectorAll("."+lt);if(t.length){var s=this.timeCollections[0],a=this.getDateObject(this.checkDateValue(this.scrollTo)).getTime();e=t[Math.round((a-s)/(6e4*this.step))]}}(0,i.isNullOrUndefined)(e)?this.popupWrapper.scrollTop=0:this.findScrollTop(e)},t.prototype.getText=function(){return(0,i.isNullOrUndefined)(this.checkDateValue(this.value))?"":this.getValue(this.value)},t.prototype.getValue=function(e){return(0,i.isNullOrUndefined)(this.checkDateValue(e))?null:this.globalize.formatDate(e,{format:this.cldrTimeFormat(),type:"time"})},t.prototype.cldrDateFormat=function(){return"en"===this.locale||"en-US"===this.locale?(0,i.getValue)("dateFormats.short",(0,i.getDefaultDateObject)()):this.getCultureDateObject(i.cldrData,""+this.locale)},t.prototype.cldrTimeFormat=function(){return this.isNullOrEmpty(this.formatString)?"en"===this.locale||"en-US"===this.locale?(0,i.getValue)("timeFormats.short",(0,i.getDefaultDateObject)()):this.getCultureTimeObject(i.cldrData,""+this.locale):this.formatString},t.prototype.dateToNumeric=function(){return"en"===this.locale||"en-US"===this.locale?(0,i.getValue)("timeFormats.medium",(0,i.getDefaultDateObject)()):(0,i.getValue)("main."+this.locale+".dates.calendars.gregorian.timeFormats.medium",i.cldrData)},t.prototype.getExactDateTime=function(e){return(0,i.isNullOrUndefined)(this.checkDateValue(e))?null:this.globalize.formatDate(e,{format:this.dateToNumeric(),type:"time"})},t.prototype.setValue=function(e){var t=this.checkValue(e);this.strictMode||this.validateState(t)?this.isNullOrEmpty(t)?(this.initValue=null,this.validateMinMax(this.value,this.min,this.max)):this.initValue=this.compareFormatChange(t):(null===this.checkDateValue(this.valueWithMinutes)&&(this.initValue=this.valueWithMinutes=null),this.validateMinMax(this.value,this.min,this.max)),this.updateInput(!0,this.initValue)},t.prototype.compareFormatChange=function(e){return(0,i.isNullOrUndefined)(e)?null:e!==this.getText()?this.getDateObject(e):this.getDateObject(this.value)},t.prototype.updatePlaceHolder=function(){j.Input.setPlaceholder(this.l10n.getConstant("placeholder"),this.inputElement)},t.prototype.updateInputValue=function(e){j.Input.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton)},t.prototype.preventEventBubbling=function(e){e.preventDefault(),this.interopAdaptor.invokeMethodAsync("OnTimeIconClick")},t.prototype.popupHandler=function(e){this.enabled&&(i.Browser.isDevice&&this.inputElement.setAttribute("readonly",""),e.preventDefault(),this.isPopupOpen()?this.closePopup(0,e):(this.inputElement.focus(),this.show(e)))},t.prototype.mouseDownHandler=function(){this.enabled&&(this.readonly||(this.inputElement.setSelectionRange(0,0),i.EventHandler.add(this.inputElement,"mouseup",this.mouseUpHandler,this)))},t.prototype.mouseUpHandler=function(e){if(!this.readonly){if(e.preventDefault(),this.enableMask)return e.preventDefault(),void this.notify("setMaskSelection",{module:"MaskedDateTime"});i.EventHandler.remove(this.inputElement,"mouseup",this.mouseUpHandler);var t=this.getCursorSelection();0===t.start&&t.end===this.inputElement.value.length||(this.inputElement.value.length>0&&(this.cursorDetails=this.focusSelection()),this.inputElement.setSelectionRange(this.cursorDetails.start,this.cursorDetails.end))}},t.prototype.focusSelection=function(){var e=new RegExp("^[a-zA-Z0-9]+$"),t=this.inputElement.value.split("");t.push(" ");var i=this.getCursorSelection(),s=0,a=0,n=!1;if(this.isTextSelected)s=i.start,a=i.end,this.isTextSelected=!1;else for(var r=0;r<t.length;r++)if(e.test(t[r])||(a=r,n=!0),n){if(i.start>=s&&i.end<=a){this.isTextSelected=!0;break}s=r+1,n=!1}return{start:s,end:a}},t.prototype.inputHandler=function(e){if(!this.readonly&&this.enabled)switch("right"!==e.action&&"left"!==e.action&&"tab"!==e.action&&("home"!==e.action&&"end"!==e.action&&"up"!==e.action&&"down"!==e.action||this.isPopupOpen()||this.enableMask)&&e.preventDefault(),e.action){case"home":case"end":case"up":case"down":this.isPopupOpen()||(this.popupCreation(),this.popupObj.destroy(),this.popupObj=this.popupWrapper=null),!this.enableMask||this.readonly||this.isPopupOpen()||(e.preventDefault(),this.notify("keyDownHandler",{module:"MaskedDateTime",e})),this.isPopupOpen()&&this.keyHandler(e);break;case"enter":this.isNavigate?(this.selectedElement=this.liCollections[this.activeIndex],this.valueWithMinutes=new Date(this.timeCollections[this.activeIndex]),this.updateValue(this.valueWithMinutes,e)):this.updateValue(this.inputElement.value,e),this.hide(),this.isNavigate=!1,this.isPopupOpen()&&e.stopPropagation();break;case"open":this.show(e);break;case"escape":this.updateInputValue(this.objToString(this.value)),this.enableMask&&(this.value||this.updateInputValue(this.maskedDateValue),this.createMask()),this.previousState(this.value),this.hide();break;case"close":this.hide();break;case"right":case"left":case"tab":case"shiftTab":this.isPopupOpen()||!this.enableMask||this.readonly||((0===this.inputElement.selectionStart&&this.inputElement.selectionEnd===this.inputElement.value.length||this.inputElement.selectionEnd!==this.inputElement.value.length&&"tab"===e.action||0!==this.inputElement.selectionStart&&"shiftTab"===e.action||"left"===e.action||"right"===e.action)&&e.preventDefault(),this.notify("keyDownHandler",{module:"MaskedDateTime",e}));break;default:this.isNavigate=!1}},t.prototype.onMouseClick=function(e){var t=e.target,s=this.selectedElement=(0,i.closest)(t,"."+lt);this.setSelection(s,e),s&&s.classList.contains(lt)&&this.hide()},t.prototype.closePopup=function(e,t){var s=this;if(this.isPopupOpen()&&this.popupWrapper){var a={popup:this.popupObj,event:t||null,cancel:!1,name:"open"};(0,i.removeClass)([document.body],ot),this.trigger("close",a,function(t){if(!t.cancel){var a={name:"FadeOut",duration:50,delay:e||0};s.popupObj.hide(new i.Animation(a)),(0,i.removeClass)([s.inputWrapper.container],["e-icon-anim"]),(0,i.attributes)(s.inputElement,{"aria-expanded":"false"}),s.inputElement.removeAttribute("aria-owns"),s.inputElement.removeAttribute("aria-controls"),s.inputElement.removeAttribute("aria-activedescendant"),i.EventHandler.remove(document,"mousedown touchstart",s.documentClickHandler)}i.Browser.isDevice&&s.modal&&(s.modal.style.display="none",s.modal.outerHTML="",s.modal=null),i.Browser.isDevice&&((0,i.isNullOrUndefined)(s.mobileTimePopupWrap)||(s.mobileTimePopupWrap.remove(),s.mobileTimePopupWrap=null)),i.Browser.isDevice&&s.allowEdit&&!s.readonly&&s.inputElement.removeAttribute("readonly")})}else i.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly")},t.prototype.disposeServerPopup=function(){this.popupWrapper&&(this.popupWrapper.style.visibility="hidden",this.popupWrapper.style.top="-9999px",this.popupWrapper.style.left="-9999px",this.popupWrapper.style.width="0px",this.popupWrapper.style.height="0px")},t.prototype.checkValueChange=function(e,t){if(this.strictMode||this.validateState(this.valueWithMinutes))if(t){s=this.getDateObject(new Date(this.timeCollections[this.activeIndex]));+this.prevDate!==+s&&this.valueProcess(e,s)}else{var s=this.compareFormatChange(this.inputElement.value);(+this.prevDate!==+s||(0,i.isNullOrUndefined)(this.checkDateValue(this.value)))&&this.valueProcess(e,s)}else null===this.checkDateValue(this.valueWithMinutes)&&(this.initValue=this.valueWithMinutes=null),this.setProperties({value:this.compareFormatChange(this.inputElement.value)},!0),this.initValue=this.valueWithMinutes=this.compareFormatChange(this.inputElement.value),this.prevValue=this.inputElement.value,+this.prevDate!==+this.value&&this.changeEvent(e)},t.prototype.onMouseOver=function(e){var t=(0,i.closest)(e.target,"."+lt);this.setHover(t,st)},t.prototype.setHover=function(e,t){this.enabled&&this.isValidLI(e)&&!e.classList.contains(t)&&(this.removeHover(t),(0,i.addClass)([e],t),t===at&&e.setAttribute("aria-selected","true"))},t.prototype.setSelection=function(e,t){this.isValidLI(e)&&(this.checkValue(e.getAttribute("data-value")),this.enableMask&&this.createMask(),this.selectedElement=e,this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(e),this.valueWithMinutes=new Date(this.timeCollections[this.activeIndex]),(0,i.addClass)([this.selectedElement],it),this.selectedElement.setAttribute("aria-selected","true"),this.checkValueChange(t,!0))},t.prototype.onMouseLeave=function(){this.removeHover(st)},t.prototype.scrollHandler=function(){"timepicker"===this.getModuleName()&&i.Browser.isDevice||this.hide()},t.prototype.setMinMax=function(e,t){(0,i.isNullOrUndefined)(this.checkDateValue(e))&&(this.initMin=this.getDateObject("12:00:00 AM")),(0,i.isNullOrUndefined)(this.checkDateValue(t))&&(this.initMax=this.getDateObject("11:59:59 PM"))},t.prototype.validateMinMax=function(e,t,s){var a=e instanceof Date?e:this.getDateObject(e);return(0,i.isNullOrUndefined)(this.checkDateValue(a))?+this.createDateObj(this.getFormattedValue(this.initMin))>+this.createDateObj(this.getFormattedValue(this.initMax))&&this.disableTimeIcon():e=this.strictOperation(this.initMin,this.initMax,e,a),this.strictMode&&(e=this.valueIsDisable(e)?e:null),this.checkErrorState(e),e},t.prototype.valueIsDisable=function(e){if(!(0,i.isNullOrUndefined)(this.disableItemCollection)&&this.disableItemCollection.length>0){if(this.disableItemCollection.length===this.timeCollections.length)return!1;for(var t=e instanceof Date?this.objToString(e):e,s=0;s<this.disableItemCollection.length;s++)if(t===this.disableItemCollection[s])return!1}return!0},t.prototype.validateState=function(e){if(!this.strictMode){if(!this.valueIsDisable(e))return!1;var t=this.setCurrentDate(this.getDateObject(e)),s=this.setCurrentDate(this.getDateObject(this.initMax)),a=this.setCurrentDate(this.getDateObject(this.initMin));if((0,i.isNullOrUndefined)(this.checkDateValue(t))){if(+s<+a||""!==this.inputElement.value)return!1}else if(+t>+s||+t<+a)return!1}return!0},t.prototype.strictOperation=function(e,t,i,s){var a=this.createDateObj(this.getFormattedValue(t)),n=this.createDateObj(this.getFormattedValue(e)),r=this.createDateObj(this.getFormattedValue(s));if(this.strictMode){if(+n>+a)return this.disableTimeIcon(),this.initValue=this.getDateObject(a),this.updateInputValue(this.getValue(this.initValue)),this.enableMask&&this.createMask(),this.inputElement.value;if(+n>=+r)return this.getDateObject(n);if(+r>=+a||+n===+a)return this.getDateObject(a)}else if(+n>+a&&(this.disableTimeIcon(),!isNaN(+this.createDateObj(i))))return i;return i},t.prototype.bindEvents=function(){i.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.popupHandler,this),i.EventHandler.add(this.inputElement,"blur",this.inputBlurHandler,this),i.EventHandler.add(this.inputElement,"focus",this.inputFocusHandler,this),i.EventHandler.add(this.inputElement,"change",this.inputChangeHandler,this),i.EventHandler.add(this.inputElement,"input",this.inputEventHandler,this),this.enableMask&&(i.EventHandler.add(this.inputElement,"keydown",this.keydownHandler,this),i.EventHandler.add(this.inputElement,"keyup",this.keyupHandler,this)),this.showClearButton&&this.inputWrapper.clearButton&&i.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.clearHandler,this),this.formElement&&i.EventHandler.add(this.formElement,"reset",this.formResetHandler,this),i.Browser.isDevice||(this.keyConfigure=(0,i.extend)(this.keyConfigure,this.keyConfigs),this.inputEvent=new i.KeyboardEvents(this.inputWrapper.container,{keyAction:this.inputHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}),this.inputElement&&(this.showClearButton||this.enableMask)&&i.EventHandler.add(this.inputElement,"mousedown",this.mouseDownHandler,this))},t.prototype.keydownHandler=function(e){if("Delete"===e.code)!this.enableMask||this.popupObj||this.readonly||this.notify("keyDownHandler",{module:"MaskedDateTime",e})},t.prototype.keyupHandler=function(e){("Backspace"===e.code||"Delete"===e.code)&&this.enableMask&&this.showClearButton&&this.inputElement&&this.inputElement.value===this.maskedDateValue&&this.inputWrapper&&this.inputWrapper.clearButton&&!this.inputWrapper.clearButton.classList.contains("e-clear-icon-hide")&&this.inputWrapper.clearButton.classList.add("e-clear-icon-hide")},t.prototype.formResetHandler=function(){if(this.enabled&&!this.inputElement.disabled){var e=this.inputElement.getAttribute("value"),t=this.checkDateValue(this.inputEleValue);"EJS-TIMEPICKER"===this.element.tagName&&(t=null,e="",this.inputElement.setAttribute("value","")),this.setProperties({value:t},!0),this.prevDate=this.value,this.valueWithMinutes=this.value,this.initValue=this.value,this.inputElement&&(this.updateInputValue(e),this.enableMask&&(e||this.updateInputValue(this.maskedDateValue),this.createMask()),this.checkErrorState(e),this.prevValue=this.inputElement.value)}},t.prototype.inputChangeHandler=function(e){this.enabled&&e.stopPropagation()},t.prototype.inputEventHandler=function(){this.enableMask&&this.notify("inputHandler",{module:"MaskedDateTime"})},t.prototype.unBindEvents=function(){this.inputWrapper&&i.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown touchstart",this.popupHandler),i.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),i.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),i.EventHandler.remove(this.inputElement,"change",this.inputChangeHandler),i.EventHandler.remove(this.inputElement,"input",this.inputEventHandler),this.enableMask&&i.EventHandler.remove(this.inputElement,"keyup",this.keyupHandler),this.inputEvent&&this.inputEvent.destroy(),i.EventHandler.remove(this.inputElement,"mousedown touchstart",this.mouseDownHandler),!this.showClearButton||(0,i.isNullOrUndefined)(this.inputWrapper)||(0,i.isNullOrUndefined)(this.inputWrapper.clearButton)||i.EventHandler.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.clearHandler),this.formElement&&i.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},t.prototype.bindClearEvent=function(){this.showClearButton&&this.inputWrapper.clearButton&&i.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.clearHandler,this)},t.prototype.raiseClearedEvent=function(e){var t={event:e};this.trigger("cleared",t)},t.prototype.clearHandler=function(e){if(this.enabled&&(e.preventDefault(),(0,i.isNullOrUndefined)(this.value)?(this.resetState(),this.raiseClearedEvent(e)):this.clear(e),this.popupWrapper&&(this.popupWrapper.scrollTop=0),this.enableMask&&this.notify("clearHandler",{module:"MaskedDateTime"}),(0,i.closest)(this.element,"form"))){var t=this.element,s=document.createEvent("KeyboardEvent");s.initEvent("keyup",!1,!0),t.dispatchEvent(s)}},t.prototype.clear=function(e){this.setProperties({value:null},!0),this.initValue=null,this.resetState(),this.raiseClearedEvent(e),this.changeEvent(e)},t.prototype.setZIndex=function(){this.popupObj&&(this.popupObj.zIndex=this.zIndex,this.popupObj.dataBind())},t.prototype.checkAttributes=function(e){for(var t,s=0,a=e?(0,i.isNullOrUndefined)(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["step","disabled","readonly","style","name","value","min","max","placeholder"];s<a.length;s++){var n=a[s];if(!(0,i.isNullOrUndefined)(this.inputElement.getAttribute(n)))switch(n){case"disabled":if((0,i.isNullOrUndefined)(this.timeOptions)||void 0===this.timeOptions.enabled||e){var r="disabled"!==this.inputElement.getAttribute(n)&&""!==this.inputElement.getAttribute(n)&&"true"!==this.inputElement.getAttribute(n);this.setProperties({enabled:r},!e)}break;case"style":this.inputStyle=this.inputElement.getAttribute(n);break;case"readonly":if((0,i.isNullOrUndefined)(this.timeOptions)||void 0===this.timeOptions.readonly||e){var l="readonly"===this.inputElement.getAttribute(n)||""===this.inputElement.getAttribute(n)||"true"===this.inputElement.getAttribute(n);this.setProperties({readonly:l},!e)}break;case"name":this.inputElement.setAttribute("name",this.inputElement.getAttribute(n));break;case"step":this.step=parseInt(this.inputElement.getAttribute(n),10);break;case"placeholder":((0,i.isNullOrUndefined)(this.timeOptions)||void 0===this.timeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(n)},!e);break;case"min":((0,i.isNullOrUndefined)(this.timeOptions)||void 0===this.timeOptions.min||e)&&(t=new Date(this.inputElement.getAttribute(n)),(0,i.isNullOrUndefined)(this.checkDateValue(t))||this.setProperties({min:t},!e));break;case"max":((0,i.isNullOrUndefined)(this.timeOptions)||void 0===this.timeOptions.max||e)&&(t=new Date(this.inputElement.getAttribute(n)),(0,i.isNullOrUndefined)(this.checkDateValue(t))||this.setProperties({max:t},!e));break;case"value":((0,i.isNullOrUndefined)(this.timeOptions)||void 0===this.timeOptions.value||e)&&(t=new Date(this.inputElement.getAttribute(n)),(0,i.isNullOrUndefined)(this.checkDateValue(t))||(this.initValue=t,this.updateInput(!1,this.initValue),this.setProperties({value:t},!e)))}}},t.prototype.setCurrentDate=function(e){return(0,i.isNullOrUndefined)(this.checkDateValue(e))?null:new Date(et,Qe,$e,e.getHours(),e.getMinutes(),e.getSeconds())},t.prototype.getTextFormat=function(){var e=0;if("a"===this.cldrTimeFormat().split(" ")[0]||0===this.cldrTimeFormat().indexOf("a"))e=1;else if(this.cldrTimeFormat().indexOf("a")<0)for(var t=this.cldrTimeFormat().split(" "),i=0;i<t.length;i++)if(t[i].toLowerCase().indexOf("h")>=0){e=i;break}return e},t.prototype.updateValue=function(e,t){var s;if(this.isNullOrEmpty(e))this.resetState();else if(s=this.checkValue(e),this.strictMode){var a=null===s&&e.trim().length>0?this.previousState(this.prevDate):this.inputElement.value;this.updateInputValue(a),this.enableMask&&(a||this.updateInputValue(this.maskedDateValue),(0,i.isNullOrUndefined)(s)&&e!==this.maskedDateValue&&this.createMask(),(0,i.isNullOrUndefined)(s)&&e===this.maskedDateValue&&this.updateInputValue(this.maskedDateValue))}this.checkValueChange(t,"string"!=typeof e)},t.prototype.previousState=function(e){for(var t=this.getDateObject(e),i=0;i<this.timeCollections.length;i++)if(+t===this.timeCollections[i]){this.activeIndex=i,this.selectedElement=this.liCollections[i],this.valueWithMinutes=new Date(this.timeCollections[i]);break}return this.getValue(e)},t.prototype.resetState=function(){this.removeSelection(),j.Input.setValue("",this.inputElement,this.floatLabelType,!1),this.valueWithMinutes=this.activeIndex=null,this.strictMode||this.checkErrorState(null)},t.prototype.objToString=function(e){return(0,i.isNullOrUndefined)(this.checkDateValue(e))?null:this.globalize.formatDate(e,{format:this.cldrTimeFormat(),type:"time"})},t.prototype.checkValue=function(e){if(!this.isNullOrEmpty(e)){var t=e instanceof Date?e:this.getDateObject(e);return this.validateValue(t,e)}return this.resetState(),this.valueWithMinutes=null},t.prototype.validateValue=function(e,t){var s,a=this.validateMinMax(t,this.min,this.max),n=this.getDateObject(a);if(this.getFormattedValue(n)!==this.getFormattedValue(this.value)?(this.valueWithMinutes=(0,i.isNullOrUndefined)(n)?null:n,s=this.objToString(this.valueWithMinutes)):(this.strictMode&&(e=n),this.valueWithMinutes=this.checkDateValue(e),s=this.objToString(this.valueWithMinutes)),!this.strictMode&&(0,i.isNullOrUndefined)(s)){var r=a.trim().length>0?a:"";this.updateInputValue(r),this.enableMask&&(r||this.updateInputValue(this.maskedDateValue))}else this.updateInputValue(s),this.enableMask&&(""===s&&this.updateInputValue(this.maskedDateValue),(0,i.isNullOrUndefined)(s)&&t!==this.maskedDateValue&&this.createMask(),(0,i.isNullOrUndefined)(s)&&t===this.maskedDateValue&&this.updateInputValue(this.maskedDateValue));return s},t.prototype.createMask=function(){this.notify("createMask",{module:"MaskedDateTime"})},t.prototype.findNextElement=function(e){var t=this.inputElement.value,s=(0,i.isNullOrUndefined)(this.valueWithMinutes)?this.createDateObj(t):this.getDateObject(this.valueWithMinutes),a=null,n=this.liCollections.length,r=this.timeCollections;if((0,i.isNullOrUndefined)(this.checkDateValue(s))&&(0,i.isNullOrUndefined)(this.activeIndex))this.selectNextItem(e);else{if("home"===e.action){var l=this.validLiElement(0);a=+this.createDateObj(new Date(this.timeCollections[l])),this.activeIndex=l}else if("end"===e.action){l=this.validLiElement(r.length-1,!0);a=+this.createDateObj(new Date(this.timeCollections[l])),this.activeIndex=l}else if("down"===e.action)for(var o=0;o<n;o++){if(+s<this.timeCollections[o]){l=this.validLiElement(o);a=+this.createDateObj(new Date(this.timeCollections[l])),this.activeIndex=l;break}if(o===n-1){l=this.validLiElement(0);a=+this.createDateObj(new Date(this.timeCollections[l])),this.activeIndex=l;break}}else for(o=n-1;o>=0;o--){if(+s>this.timeCollections[o]){l=this.validLiElement(o,!0);a=+this.createDateObj(new Date(this.timeCollections[l])),this.activeIndex=l;break}if(0===o){l=this.validLiElement(n-1);a=+this.createDateObj(new Date(this.timeCollections[l])),this.activeIndex=l;break}}this.selectedElement=this.liCollections[this.activeIndex],this.elementValue((0,i.isNullOrUndefined)(a)?null:new Date(a))}},t.prototype.selectNextItem=function(e){var t=this.validLiElement(0,"down"!==e.action);this.activeIndex=t,this.selectedElement=this.liCollections[t],this.elementValue(new Date(this.timeCollections[t]))},t.prototype.elementValue=function(e){(0,i.isNullOrUndefined)(this.checkDateValue(e))||this.checkValue(e)},t.prototype.validLiElement=function(e,t){var s=null,a=(0,i.isNullOrUndefined)(this.popupWrapper)?this.liCollections:this.popupWrapper.querySelectorAll("."+lt),n=!0;if(a.length)if(t)for(var r=e;r>=0;r--){if(!a[r].classList.contains(nt)){s=r;break}0===r&&n&&(e=r=a.length,n=!1)}else for(r=e;r<=a.length-1;r++){if(!a[r].classList.contains(nt)){s=r;break}r===a.length-1&&n&&(e=r=-1,n=!1)}return s},t.prototype.keyHandler=function(e){if(!((0,i.isNullOrUndefined)(this.step)||this.step<=0||!(0,i.isNullOrUndefined)(this.inputWrapper)&&this.inputWrapper.buttons[0].classList.contains(nt))){var t=this.timeCollections.length;if((0,i.isNullOrUndefined)(this.getActiveElement())||0===this.getActiveElement().length)if(this.liCollections.length>0)if((0,i.isNullOrUndefined)(this.value)&&(0,i.isNullOrUndefined)(this.activeIndex)){var s=this.validLiElement(0,"down"!==e.action);this.activeIndex=s,this.selectedElement=this.liCollections[s],this.elementValue(new Date(this.timeCollections[s]))}else this.findNextElement(e);else this.findNextElement(e);else{var a=void 0;if(e.keyCode>=37&&e.keyCode<=40){s=40===e.keyCode||39===e.keyCode?++this.activeIndex:--this.activeIndex;this.activeIndex=s=this.activeIndex===t?0:this.activeIndex,this.activeIndex=s=this.activeIndex<0?t-1:this.activeIndex,this.activeIndex=s=this.validLiElement(this.activeIndex,40!==e.keyCode&&39!==e.keyCode),a=(0,i.isNullOrUndefined)(this.timeCollections[s])?this.timeCollections[0]:this.timeCollections[s]}else if("home"===e.action){s=this.validLiElement(0);this.activeIndex=s,a=this.timeCollections[s]}else if("end"===e.action){s=this.validLiElement(t-1,!0);this.activeIndex=s,a=this.timeCollections[s]}this.selectedElement=this.liCollections[this.activeIndex],this.elementValue(new Date(a))}this.isNavigate=!0,this.setHover(this.selectedElement,at),this.setActiveDescendant(),this.enableMask&&this.selectInputText(),!this.isPopupOpen()||null===this.selectedElement||e&&"click"===e.type||this.setScrollPosition()}},t.prototype.getCultureTimeObject=function(e,t){return(0,i.getValue)("main."+t+".dates.calendars.gregorian.timeFormats.short",e)},t.prototype.getCultureDateObject=function(e,t){return(0,i.getValue)("main."+t+".dates.calendars.gregorian.dateFormats.short",e)},t.prototype.wireListEvents=function(){i.EventHandler.add(this.listWrapper,"click",this.onMouseClick,this),i.Browser.isDevice||(i.EventHandler.add(this.listWrapper,"mouseover",this.onMouseOver,this),i.EventHandler.add(this.listWrapper,"mouseout",this.onMouseLeave,this))},t.prototype.unWireListEvents=function(){this.listWrapper&&(i.EventHandler.remove(this.listWrapper,"click",this.onMouseClick),i.Browser.isDevice||(i.EventHandler.remove(this.listWrapper,"mouseover",this.onMouseOver),i.EventHandler.remove(this.listWrapper,"mouseout",this.onMouseLeave)))},t.prototype.valueProcess=function(e,t){var s=(0,i.isNullOrUndefined)(this.checkDateValue(t))?null:t;+this.prevDate!==+s&&(this.initValue=s,this.changeEvent(e))},t.prototype.changeEvent=function(e){this.addSelection(),this.updateInput(!0,this.initValue);var t={event:e||null,value:this.value,text:this.inputElement.value,isInteracted:!(0,i.isNullOrUndefined)(e),element:this.element};t.value=this.valueWithMinutes||this.getDateObject(this.inputElement.value),this.prevDate=this.valueWithMinutes||this.getDateObject(this.inputElement.value),this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",t),this.invalidValueString=null,this.checkErrorState(this.value)},t.prototype.updateInput=function(e,t){e&&(this.prevValue=this.getValue(this.prevDate)),this.prevDate=this.valueWithMinutes=t,"number"==typeof t&&(this.value&&+new Date(+this.value).setMilliseconds(0))===+t||(this.setProperties({value:t},!0),this.enableMask&&this.value&&this.createMask()),!this.strictMode&&(0,i.isNullOrUndefined)(this.value)&&this.invalidValueString&&(this.checkErrorState(this.invalidValueString),this.updateInputValue(this.invalidValueString)),this.clearIconState()},t.prototype.setActiveDescendant=function(){!(0,i.isNullOrUndefined)(this.selectedElement)&&this.value?(0,i.attributes)(this.inputElement,{"aria-activedescendant":this.selectedElement.getAttribute("id")}):this.inputElement.removeAttribute("aria-activedescendant")},t.prototype.removeSelection=function(){if(this.removeHover(st),!(0,i.isNullOrUndefined)(this.popupWrapper)){var e=this.popupWrapper.querySelectorAll("."+it);e.length&&((0,i.removeClass)(e,it),e[0].removeAttribute("aria-selected"))}},t.prototype.removeHover=function(e){var t=this.getHoverItem(e);t&&t.length&&((0,i.removeClass)(t,e),e===at&&t[0].removeAttribute("aria-selected"))},t.prototype.getHoverItem=function(e){var t;return(0,i.isNullOrUndefined)(this.popupWrapper)||(t=this.popupWrapper.querySelectorAll("."+e)),t},t.prototype.setActiveClass=function(){if(!(0,i.isNullOrUndefined)(this.popupWrapper)){var e=this.popupWrapper.querySelectorAll("."+lt);if(e.length)for(var t=0;t<e.length;t++)if(this.timeCollections[t]===+this.getDateObject(this.valueWithMinutes)){e[t].setAttribute("aria-selected","true"),this.selectedElement=e[t],this.activeIndex=t;break}}},t.prototype.addSelection=function(){this.selectedElement=null,this.removeSelection(),this.setActiveClass(),(0,i.isNullOrUndefined)(this.selectedElement)||((0,i.addClass)([this.selectedElement],it),this.selectedElement.setAttribute("aria-selected","true"))},t.prototype.isValidLI=function(e){return e&&e.classList.contains(lt)&&!e.classList.contains(nt)},t.prototype.createDateObj=function(e){var t=this.globalize.formatDate(new Date,{format:null,skeleton:"short",type:"date"}),s=null;return"string"!=typeof e||this.enableMask&&this.maskedDateValue&&this.inputElement.value===this.maskedDateValue&&!this.value?e instanceof Date&&(s=e):e.toUpperCase().indexOf("AM")>-1||e.toUpperCase().indexOf("PM")>-1?(t=this.defaultCulture.formatDate(new Date,{format:null,skeleton:"short",type:"date"}),s=isNaN(+new Date(t+" "+e))?null:new Date(new Date(t+" "+e).setMilliseconds(0)),(0,i.isNullOrUndefined)(s)&&(s=this.timeParse(t,e))):s=this.timeParse(t,e),s},t.prototype.timeParse=function(e,t){var s;return s=this.globalize.parseDate(this.getAmPmValue(e+" "+t),{format:this.cldrDateFormat()+" "+this.cldrTimeFormat(),type:"datetime"}),s=(0,i.isNullOrUndefined)(s)?this.globalize.parseDate(this.getAmPmValue(e+" "+t),{format:this.cldrDateFormat()+" "+this.dateToNumeric(),type:"datetime"}):s,s=(0,i.isNullOrUndefined)(s)?s:new Date(s.setMilliseconds(0))},t.prototype.createListItems=function(){var e,t=this;this.listWrapper=this.createElement("div",{className:"e-content",attrs:{tabindex:"-1"}});var s=6e4*this.step,a=[];this.timeCollections=[],this.disableItemCollection=[],e=+this.getDateObject(this.initMin).setMilliseconds(0);for(var n=+this.getDateObject(this.initMax).setMilliseconds(0);n>=e;)this.timeCollections.push(e),a.push(this.globalize.formatDate(new Date(e),{format:this.cldrTimeFormat(),type:"time"})),e+=s;var r={itemCreated:function(e){var i={element:e.item,text:e.text,value:t.getDateObject(e.text),isDisabled:!1};t.trigger("itemRender",i,function(e){e.isDisabled&&e.element.classList.add(nt),e.element.classList.contains(nt)&&t.disableItemCollection.push(e.element.getAttribute("data-value"))})}};this.listTag=te.ListBase.createList(this.createElement,a,r,!0),(0,i.attributes)(this.listTag,{role:"listbox","aria-hidden":"false",id:this.element.id+"_options",tabindex:"0"}),(0,i.append)([this.listTag],this.listWrapper)},t.prototype.documentClickHandler=function(e){var t=e.target;(0,i.isNullOrUndefined)(this.popupObj)||(0,i.isNullOrUndefined)(this.inputWrapper)||!(this.inputWrapper.container.contains(t)&&"mousedown"!==e.type||this.popupObj.element&&this.popupObj.element.contains(t))||"touchstart"===e.type||e.preventDefault(),(0,i.closest)(t,'[id="'+this.popupObj.element.id+'"]')||t===this.inputElement||t===(this.inputWrapper&&this.inputWrapper.buttons[0])||t===(this.inputWrapper&&this.inputWrapper.clearButton)||t===(this.inputWrapper&&this.inputWrapper.container)?t!==this.inputElement&&(i.Browser.isDevice||(this.isPreventBlur=(i.Browser.isIE||"edge"===i.Browser.info.name)&&document.activeElement===this.inputElement&&t===this.popupWrapper)):this.isPopupOpen()&&(this.hide(),t.classList.contains("e-dlg-overlay")?e.preventDefault():this.focusOut())},t.prototype.setEnableRtl=function(){j.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]),this.popupObj&&(this.popupObj.enableRtl=this.enableRtl,this.popupObj.dataBind())},t.prototype.setEnable=function(){j.Input.setEnabled(this.enabled,this.inputElement,this.floatLabelType),this.enabled?((0,i.removeClass)([this.inputWrapper.container],nt),(0,i.attributes)(this.inputElement,{"aria-disabled":"false"}),this.inputElement.setAttribute("tabindex",this.tabIndex)):(this.hide(),(0,i.addClass)([this.inputWrapper.container],nt),(0,i.attributes)(this.inputElement,{"aria-disabled":"true"}),this.inputElement.tabIndex=-1)},t.prototype.getProperty=function(e,t){"min"===t?(this.initMin=this.checkDateValue(new Date(this.checkInValue(e.min))),this.setProperties({min:this.initMin},!0)):(this.initMax=this.checkDateValue(new Date(this.checkInValue(e.max))),this.setProperties({max:this.initMax},!0)),""===this.inputElement.value?this.validateMinMax(this.value,this.min,this.max):this.checkValue(this.inputElement.value),this.checkValueChange(null,!1)},t.prototype.inputBlurHandler=function(e){if(this.updateFloatLabelOverflowWidth(),this.enabled)if(this.isPreventBlur&&this.isPopupOpen())this.inputElement.focus();else{this.closePopup(0,e),this.enableMask&&this.maskedDateValue&&this.placeholder&&"Always"!==this.floatLabelType&&(this.inputElement.value!==this.maskedDateValue||this.value||"Auto"!==this.floatLabelType&&"Never"!==this.floatLabelType&&!this.placeholder||this.updateInputValue("")),(0,i.removeClass)([this.inputWrapper.container],[rt]),this.getText()!==this.inputElement.value?this.updateValue(this.inputElement.value,e):0===this.inputElement.value.trim().length&&this.resetState(),this.cursorDetails=null,this.isNavigate=!1,""===this.inputElement.value&&(this.invalidValueString=null);var t={model:this};this.trigger("blur",t)}},t.prototype.focusOut=function(){if(document.activeElement===this.inputElement){this.inputElement.blur(),(0,i.removeClass)([this.inputWrapper.container],[rt]);var e={model:this};this.trigger("blur",e)}},t.prototype.isPopupOpen=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains(""+tt))},t.prototype.inputFocusHandler=function(){if(this.enabled){var e={model:this};this.readonly||i.Browser.isDevice||this.enableMask||this.selectInputText(),this.enableMask&&!this.inputElement.value&&this.placeholder&&(!this.maskedDateValue||this.value||"Auto"!==this.floatLabelType&&"Never"!==this.floatLabelType&&!this.placeholder||(this.updateInputValue(this.maskedDateValue),this.inputElement.selectionStart=0,this.inputElement.selectionEnd=this.inputElement.value.length)),this.enableMask&&this.showClearButton&&this.inputElement&&this.inputElement.value===this.maskedDateValue&&this.inputWrapper&&this.inputWrapper.clearButton&&!this.inputWrapper.clearButton.classList.contains("e-clear-icon-hide")&&this.inputWrapper.clearButton.classList.add("e-clear-icon-hide"),this.trigger("focus",e),this.clearIconState(),this.clearFloatLabelOverflowWidth(),this.openOnFocus&&this.show()}},t.prototype.focusIn=function(){document.activeElement!==this.inputElement&&this.enabled&&this.inputElement.focus()},t.prototype.hide=function(){this.closePopup(100,null),this.clearIconState()},t.prototype.show=function(e){var t=this;if(!(this.enabled&&this.readonly||!this.enabled||this.popupWrapper)){this.popupCreation(),i.Browser.isDevice&&this.listWrapper&&(this.modal=this.createElement("div"),this.modal.className=tt+" e-time-modal",document.body.className+=" "+ot,document.body.appendChild(this.modal)),i.Browser.isDevice&&(this.mobileTimePopupWrap=this.createElement("div",{className:"e-timepicker-mob-popup-wrap"}),document.body.appendChild(this.mobileTimePopupWrap)),this.openPopupEventArgs={popup:this.popupObj||null,cancel:!1,event:e||null,name:"open",appendTo:i.Browser.isDevice?this.mobileTimePopupWrap:document.body};var s=this.openPopupEventArgs;this.trigger("open",s,function(e){if(t.openPopupEventArgs=e,t.openPopupEventArgs.cancel||t.inputWrapper.buttons[0].classList.contains(nt))t.popupObj.destroy(),t.popupWrapper=t.listTag=void 0,t.liCollections=t.timeCollections=t.disableItemCollection=[],t.popupObj=null;else{t.openPopupEventArgs.appendTo.appendChild(t.popupWrapper),t.popupAlignment(t.openPopupEventArgs),t.setScrollPosition(),i.Browser.isDevice||t.inputElement.focus();var s={name:"FadeIn",duration:50};if(t.popupObj.refreshPosition(t.anchor),1e3===t.zIndex?t.popupObj.show(new i.Animation(s),t.element):t.popupObj.show(new i.Animation(s),null),t.setActiveDescendant(),(0,i.attributes)(t.inputElement,{"aria-expanded":"true"}),(0,i.attributes)(t.inputElement,{"aria-owns":t.inputElement.id+"_options"}),(0,i.attributes)(t.inputElement,{"aria-controls":t.inputElement.id}),(0,i.addClass)([t.inputWrapper.container],rt),i.EventHandler.add(document,"mousedown touchstart",t.documentClickHandler,t),t.setOverlayIndex(t.mobileTimePopupWrap,t.popupObj.element,t.modal,i.Browser.isDevice),i.Browser.isDevice){var a=t.createElement("div",{className:"e-dlg-overlay"});a.style.zIndex=(t.zIndex-1).toString(),t.mobileTimePopupWrap.appendChild(a)}}})}},t.prototype.setOverlayIndex=function(e,t,s,a){if(a&&!(0,i.isNullOrUndefined)(t)&&!(0,i.isNullOrUndefined)(s)&&!(0,i.isNullOrUndefined)(e)){var n=parseInt(t.style.zIndex,10)?parseInt(t.style.zIndex,10):1e3;s.style.zIndex=(n-1).toString(),e.style.zIndex=n.toString()}},t.prototype.formatValues=function(e){var t;return"number"==typeof e?t=(0,i.formatUnit)(e):"string"==typeof e&&(t=e.match(/px|%|em/)||isNaN(parseInt(e,10))?e:(0,i.formatUnit)(e)),t},t.prototype.popupAlignment=function(e){if(e.popup.position.X=this.formatValues(e.popup.position.X),e.popup.position.Y=this.formatValues(e.popup.position.Y),isNaN(parseFloat(e.popup.position.X))&&isNaN(parseFloat(e.popup.position.Y))||(this.popupObj.relateTo=this.anchor=document.body,this.popupObj.targetType="container"),isNaN(parseFloat(e.popup.position.X))||(this.popupObj.offsetX=parseFloat(e.popup.position.X)),isNaN(parseFloat(e.popup.position.Y))||(this.popupObj.offsetY=parseFloat(e.popup.position.Y)),i.Browser.isDevice)"center"===e.popup.position.X&&"center"===e.popup.position.Y&&(this.popupObj.relateTo=this.anchor=document.body,this.popupObj.offsetY=0,this.popupObj.targetType="container",this.popupObj.collision={X:"fit",Y:"fit"});else{switch(e.popup.position.X){case"left":break;case"right":e.popup.offsetX=this.containerStyle.width;break;case"center":e.popup.offsetX=-this.containerStyle.width/2}switch(e.popup.position.Y){case"top":case"bottom":break;case"center":e.popup.offsetY=-this.containerStyle.height/2}"center"===e.popup.position.X&&"center"===e.popup.position.Y&&(this.popupObj.relateTo=this.inputWrapper.container,this.anchor=this.inputElement,this.popupObj.targetType="relative")}},t.prototype.getPersistData=function(){return this.addOnPersist(["value"])},t.prototype.getModuleName=function(){return"timepicker"},t.prototype.updateFloatLabelOverflowWidth=function(){for(var e=this.inputWrapper.container,t=e.querySelector(".e-float-text.e-label-bottom"),i=0,s=e.querySelectorAll(".e-input-group-icon, .e-clear-icon"),a=0;a<s.length;a++)i+=s[a].offsetWidth;if(t){var n=this.element.parentElement.offsetWidth-i;!n||this.cssClass&&-1!==this.cssClass.split(" ").indexOf("e-outline")||(t.style.width=n+"px")}},t.prototype.clearFloatLabelOverflowWidth=function(){var e=this.inputWrapper.container.querySelector(".e-float-text.e-label-top");e&&e.removeAttribute("style")},t.prototype.onPropertyChanged=function(e,t){for(var s=0,a=Object.keys(e);s<a.length;s++){var n=a[s];switch(n){case"placeholder":j.Input.setPlaceholder(e.placeholder,this.inputElement);break;case"readonly":j.Input.setReadonly(this.readonly,this.inputElement,this.floatLabelType),this.readonly&&this.hide(),this.setTimeAllowEdit();break;case"enabled":this.setProperties({enabled:e.enabled},!0),this.setEnable();break;case"allowEdit":this.setTimeAllowEdit();break;case"enableRtl":this.setProperties({enableRtl:e.enableRtl},!0),this.setEnableRtl();break;case"cssClass":this.updateCssClass(e.cssClass,t.cssClass);break;case"zIndex":this.setProperties({zIndex:e.zIndex},!0),this.setZIndex();break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.checkAttributes(!0);break;case"min":case"max":this.getProperty(e,n);break;case"showClearButton":j.Input.setClearButton(this.showClearButton,this.inputElement,this.inputWrapper),this.bindClearEvent();break;case"locale":this.setProperties({locale:e.locale},!0),this.globalize=new i.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.timeOptions&&null==this.timeOptions.placeholder&&this.updatePlaceHolder(),this.setValue(this.value),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"});break;case"width":(0,i.setStyleAttribute)(this.inputWrapper.container,{width:this.setWidth(e.width)}),this.containerStyle=this.inputWrapper.container.getBoundingClientRect(),j.Input.calculateWidth(this.inputElement,this.inputWrapper.container),(0,i.isNullOrUndefined)(this.inputWrapper.buttons[0])||(0,i.isNullOrUndefined)(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon");break;case"format":this.setProperties({format:e.format},!0),this.checkTimeFormat(),this.setValue(this.value),this.enableMask&&(this.createMask(),this.value||this.updateInputValue(this.maskedDateValue));break;case"value":this.invalidValueString=null,this.checkInvalidValue(e.value),e.value=this.value,this.invalidValueString?(this.updateInputValue(this.invalidValueString),this.checkErrorState(this.invalidValueString)):("string"==typeof e.value?(this.setProperties({value:this.checkDateValue(new Date(e.value))},!0),e.value=this.value):(e.value&&+new Date(+e.value).setMilliseconds(0))!==+this.value&&(e.value=this.checkDateValue(new Date(""+e.value))),this.initValue=e.value,e.value=this.compareFormatChange(this.checkValue(e.value))),this.enableMask&&(0,i.isNullOrUndefined)(e.value)&&(this.updateInputValue(this.maskedDateValue),this.checkErrorState(this.maskedDateValue)),this.checkValueChange(null,!1),this.isPopupOpen()&&this.setScrollPosition(),this.isAngular&&this.preventChange&&(this.preventChange=!1),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"});break;case"floatLabelType":this.floatLabelType=e.floatLabelType,j.Input.removeFloating(this.inputWrapper),j.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder),(0,i.isNullOrUndefined)(this.inputWrapper.buttons[0])||(0,i.isNullOrUndefined)(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon");break;case"strictMode":this.invalidValueString=null,e.strictMode&&this.checkErrorState(null),this.setProperties({strictMode:e.strictMode},!0),this.checkValue(this.inputElement.value),this.checkValueChange(null,!1);break;case"scrollTo":this.checkDateValue(new Date(this.checkInValue(e.scrollTo)))?(this.popupWrapper&&this.setScrollTo(),this.setProperties({scrollTo:this.checkDateValue(new Date(this.checkInValue(e.scrollTo)))},!0)):this.setProperties({scrollTo:null},!0);break;case"enableMask":this.enableMask?(this.notify("createMask",{module:"MaskedDateTime"}),this.updateInputValue(this.maskedDateValue)):this.inputElement.value===this.maskedDateValue&&this.updateInputValue("")}}},t.prototype.checkInValue=function(e){return e instanceof Date?e.toUTCString():""+e},Ze([(0,i.Property)(null)],t.prototype,"width",void 0),Ze([(0,i.Property)(null)],t.prototype,"cssClass",void 0),Ze([(0,i.Property)(!1)],t.prototype,"strictMode",void 0),Ze([(0,i.Property)(null)],t.prototype,"keyConfigs",void 0),Ze([(0,i.Property)(null)],t.prototype,"format",void 0),Ze([(0,i.Property)(!0)],t.prototype,"enabled",void 0),Ze([(0,i.Property)(!1)],t.prototype,"fullScreenMode",void 0),Ze([(0,i.Property)(!1)],t.prototype,"readonly",void 0),Ze([(0,i.Property)({})],t.prototype,"htmlAttributes",void 0),Ze([(0,i.Property)("Never")],t.prototype,"floatLabelType",void 0),Ze([(0,i.Property)(null)],t.prototype,"placeholder",void 0),Ze([(0,i.Property)(1e3)],t.prototype,"zIndex",void 0),Ze([(0,i.Property)(!1)],t.prototype,"enablePersistence",void 0),Ze([(0,i.Property)(!0)],t.prototype,"showClearButton",void 0),Ze([(0,i.Property)(30)],t.prototype,"step",void 0),Ze([(0,i.Property)(null)],t.prototype,"scrollTo",void 0),Ze([(0,i.Property)(null)],t.prototype,"value",void 0),Ze([(0,i.Property)(null)],t.prototype,"min",void 0),Ze([(0,i.Property)(null)],t.prototype,"max",void 0),Ze([(0,i.Property)(!0)],t.prototype,"allowEdit",void 0),Ze([(0,i.Property)(!1)],t.prototype,"openOnFocus",void 0),Ze([(0,i.Property)(!1)],t.prototype,"enableMask",void 0),Ze([(0,i.Property)({day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"})],t.prototype,"maskPlaceholder",void 0),Ze([(0,i.Property)(null)],t.prototype,"serverTimezoneOffset",void 0),Ze([(0,i.Event)()],t.prototype,"change",void 0),Ze([(0,i.Event)()],t.prototype,"created",void 0),Ze([(0,i.Event)()],t.prototype,"destroyed",void 0),Ze([(0,i.Event)()],t.prototype,"open",void 0),Ze([(0,i.Event)()],t.prototype,"itemRender",void 0),Ze([(0,i.Event)()],t.prototype,"close",void 0),Ze([(0,i.Event)()],t.prototype,"cleared",void 0),Ze([(0,i.Event)()],t.prototype,"blur",void 0),Ze([(0,i.Event)()],t.prototype,"focus",void 0),t=Ze([i.NotifyPropertyChanges],t)}(i.Component),ct=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),mt=function(e,t,i,s){var a,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(r=(n<3?a(r):n>3?a(t,i,r):a(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},ft=(new Date).getDate(),vt=(new Date).getMonth(),gt=(new Date).getFullYear(),yt=(new Date).getHours(),bt=(new Date).getMinutes(),Dt=(new Date).getSeconds(),Et=(new Date).getMilliseconds(),Ct="e-datetimepicker",kt="e-datetimepopup-wrapper",Mt="e-popup",wt="e-input-focus",Vt="250px",Ot="e-icon-anim",Nt="e-disabled",It="e-error",Tt="e-active",xt="e-hover",St="e-list-item",Pt="e-time-overflow",At=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.valueWithMinutes=null,s.scrollInvoked=!1,s.moduleName=s.getModuleName(),s.formatRegex=/dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yyy|yy|y|'[^']*'|'[^']*'/g,s.dateFormatString="",s.dateTimeOptions=t,s}return ct(s,e),s.prototype.focusHandler=function(){this.clearLabelOverflowWidth(),this.enabled&&(0,i.addClass)([this.inputWrapper.container],wt)},s.prototype.focusIn=function(){e.prototype.focusIn.call(this)},s.prototype.focusOut=function(){document.activeElement===this.inputElement&&(this.inputElement.blur(),this.inputWrapper&&(0,i.removeClass)([this.inputWrapper.container],[wt]))},s.prototype.blurHandler=function(e){if(this.updateLabelOverflowWidth(),this.enabled)if(this.isTimePopupOpen()&&this.isPreventBlur)this.inputElement.focus();else{(0,i.removeClass)([this.inputWrapper.container],wt);var t={model:this};this.isTimePopupOpen()&&this.hide(e),this.trigger("blur",t)}},s.prototype.destroy=function(){this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),this.popupObject&&this.popupObject.element.classList.contains(Mt)&&(this.popupObject.destroy(),(0,i.detach)(this.dateTimeWrapper),this.dateTimeWrapper=void 0,this.liCollections=this.timeCollections=[],(0,i.isNullOrUndefined)(this.rippleFn)||this.rippleFn());this.inputElement&&j.Input.removeAttributes({"aria-live":"assertive","aria-atomic":"true","aria-invalid":"false",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-expanded":"false",role:"combobox",autocomplete:"off"},this.inputElement),this.isCalendar()&&(this.popupWrapper&&(0,i.detach)(this.popupWrapper),this.popupObject=this.popupWrapper=null,this.keyboardHandler.destroy()),this.unBindInputEvents(),this.liCollections=null,this.rippleFn=null,this.selectedElement=null,this.listTag=null,this.timeIcon=null,this.popupObject=null,this.preventArgs=null,this.keyboardModule=null,j.Input.destroy({element:this.inputElement,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),e.prototype.destroy.call(this)},s.prototype.render=function(){this.timekeyConfigure={enter:"enter",escape:"escape",end:"end",tab:"tab",home:"home",down:"downarrow",up:"uparrow",left:"leftarrow",right:"rightarrow",open:"alt+downarrow",close:"alt+uparrow"},this.valueWithMinutes=null,this.previousDateTime=null,this.isPreventBlur=!1,this.cloneElement=this.element.cloneNode(!0),this.dateTimeFormat=this.cldrDateTimeFormat(),this.initValue=this.value,"string"==typeof this.min&&(this.min=this.checkDateValue(new Date(this.min))),"string"==typeof this.max&&(this.max=this.checkDateValue(new Date(this.max))),"string"==typeof this.minTime&&(this.minTime=this.checkDateValue(new Date(this.minTime))),"string"==typeof this.maxTime&&(this.maxTime=this.checkDateValue(new Date(this.maxTime))),!(0,i.isNullOrUndefined)((0,i.closest)(this.element,"fieldset"))&&(0,i.closest)(this.element,"fieldset").disabled&&(this.enabled=!1),e.prototype.updateHtmlAttributeToElement.call(this),this.checkAttributes(!1);var t={placeholder:this.placeholder};this.l10n=new i.L10n("datetimepicker",t,this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),e.prototype.render.call(this),this.createInputElement(),e.prototype.updateHtmlAttributeToWrapper.call(this),this.bindInputEvents(),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"}),this.setValue(!0),!this.enableMask||this.value||!this.maskedDateValue||"Always"!==this.floatLabelType&&this.floatLabelType&&this.placeholder||j.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton),this.setProperties({scrollTo:this.checkDateValue(new Date(this.checkValue(this.scrollTo)))},!0),this.previousDateTime=this.value&&new Date(+this.value),"EJS-DATETIMEPICKER"===this.element.tagName&&(this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex"),this.enabled||(this.inputElement.tabIndex=-1)),"Never"!==this.floatLabelType&&j.Input.calculateWidth(this.inputElement,this.inputWrapper.container),(0,i.isNullOrUndefined)(this.inputWrapper.buttons[0])||(0,i.isNullOrUndefined)(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-date-time-icon"),this.renderComplete()},s.prototype.setValue=function(t){if(void 0===t&&(t=!1),this.initValue=this.validateMinMaxRange(this.value),!this.strictMode&&this.isDateObject(this.initValue)){var s=this.validateMinMaxRange(this.initValue);j.Input.setValue(this.getFormattedValue(s),this.inputElement,this.floatLabelType,this.showClearButton),this.setProperties({value:s},!0)}else(0,i.isNullOrUndefined)(this.value)&&(this.initValue=null,this.setProperties({value:null},!0));this.valueWithMinutes=this.value,e.prototype.updateInput.call(this,t)},s.prototype.validateMinMaxRange=function(e){var t=e;return this.isDateObject(e)?t=this.validateValue(e):+this.min>+this.max&&this.disablePopupButton(!0),this.checkValidState(t),t},s.prototype.checkValidState=function(e){this.isValidState=!0,this.strictMode||(+e>+this.max||+e<+this.min||!this.isValidTime(e))&&(this.isValidState=!1),this.checkErrorState()},s.prototype.checkErrorState=function(){this.isValidState?(0,i.removeClass)([this.inputWrapper.container],It):(0,i.addClass)([this.inputWrapper.container],It),(0,i.attributes)(this.inputElement,{"aria-invalid":this.isValidState?"false":"true"})},s.prototype.isValidTime=function(e){if(null!=e&&(this.minTime||this.maxTime)){var t=void 0,i=void 0,s=void 0,a=void 0,n=36e5*e.getHours()+6e4*e.getMinutes()+1e3*e.getSeconds()+e.getMilliseconds();if(this.minTime&&(t=36e5*this.minTime.getHours()+6e4*this.minTime.getMinutes()+1e3*this.minTime.getSeconds()+this.minTime.getMilliseconds()),this.maxTime&&(i=36e5*this.maxTime.getHours()+6e4*this.maxTime.getMinutes()+1e3*this.maxTime.getSeconds()+this.maxTime.getMilliseconds()),this.min&&+e.getDate()===+this.min.getDate()&&+e.getMonth()===+this.min.getMonth()&&+e.getFullYear()===+this.min.getFullYear()&&(t=t<(a=36e5*this.min.getHours()+6e4*this.min.getMinutes()+1e3*this.min.getSeconds()+this.min.getMilliseconds())?a:t),this.max&&+e.getDate()===+this.max.getDate()&&+e.getMonth()===+this.max.getMonth()&&+this.max.getFullYear()==+this.max.getFullYear()&&(i=i>(s=36e5*this.max.getHours()+6e4*this.max.getMinutes()+1e3*this.max.getSeconds()+this.max.getMilliseconds())?s:i),this.strictMode){var r=void 0;return t&&n<t?(r=new Date(e.getFullYear(),e.getMonth(),e.getDate(),this.minTime.getHours(),this.minTime.getMinutes(),this.minTime.getSeconds(),this.minTime.getMilliseconds()),this.setProperties({value:r},!0),this.changedArgs={value:this.value}):i&&n>i&&(r=new Date(e.getFullYear(),e.getMonth(),e.getDate(),this.maxTime.getHours(),this.maxTime.getMinutes(),this.maxTime.getSeconds(),this.maxTime.getMilliseconds()),this.setProperties({value:r},!0),this.changedArgs={value:this.value}),!0}return!(t&&n<t||i&&n>i)}return!0},s.prototype.validateValue=function(e){var t=e;return this.strictMode?+this.min>+this.max?(this.disablePopupButton(!0),t=this.max):+e<+this.min?t=this.min:+e>+this.max&&(t=this.max):+this.min>+this.max&&(this.disablePopupButton(!0),t=e),t},s.prototype.disablePopupButton=function(e){e?((0,i.addClass)([this.inputWrapper.buttons[0],this.timeIcon],Nt),this.hide()):(0,i.removeClass)([this.inputWrapper.buttons[0],this.timeIcon],Nt)},s.prototype.getFormattedValue=function(e){var t;return(0,i.isNullOrUndefined)(e)?null:(t="Gregorian"===this.calendarMode?{format:this.cldrDateTimeFormat(),type:"dateTime",skeleton:"yMd"}:{format:this.cldrDateTimeFormat(),type:"dateTime",skeleton:"yMd",calendar:"islamic"},this.globalize.formatDate(e,t))},s.prototype.isDateObject=function(e){return!(0,i.isNullOrUndefined)(e)&&!isNaN(+e)},s.prototype.createInputElement=function(){(0,i.removeClass)([this.inputElement],"e-datepicker"),(0,i.removeClass)([this.inputWrapper.container],"e-date-wrapper"),(0,i.addClass)([this.inputWrapper.container],"e-datetime-wrapper"),(0,i.addClass)([this.inputElement],Ct),this.renderTimeIcon(),this.updateLabelOverflowWidth()},s.prototype.renderTimeIcon=function(){this.timeIcon=j.Input.appendSpan("e-input-group-icon e-time-icon e-icons",this.inputWrapper.container)},s.prototype.bindInputEvents=function(){i.EventHandler.add(this.timeIcon,"mousedown",this.timeHandler,this),i.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.dateHandler,this),i.EventHandler.add(this.inputElement,"blur",this.blurHandler,this),i.EventHandler.add(this.inputElement,"focus",this.focusHandler,this),this.defaultKeyConfigs=(0,i.extend)(this.defaultKeyConfigs,this.keyConfigs),this.keyboardHandler=new i.KeyboardEvents(this.inputElement,{eventName:"keydown",keyAction:this.inputKeyAction.bind(this),keyConfigs:this.defaultKeyConfigs})},s.prototype.unBindInputEvents=function(){i.EventHandler.remove(this.timeIcon,"mousedown touchstart",this.timeHandler),i.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown touchstart",this.dateHandler),this.inputElement&&(i.EventHandler.remove(this.inputElement,"blur",this.blurHandler),i.EventHandler.remove(this.inputElement,"focus",this.focusHandler)),this.keyboardHandler&&this.keyboardHandler.destroy()},s.prototype.cldrTimeFormat=function(){return this.isNullOrEmpty(this.timeFormat)?"en"===this.locale||"en-US"===this.locale?(0,i.getValue)("timeFormats.short",(0,i.getDefaultDateObject)()):this.getCultureTimeObject(i.cldrData,""+this.locale):this.timeFormat},s.prototype.cldrDateTimeFormat=function(){var e=new i.Internationalization(this.locale).getDatePattern({skeleton:"yMd"});return this.isNullOrEmpty(this.formatString)?e+" "+this.getCldrFormat("time"):this.formatString},s.prototype.getCldrFormat=function(e){return"en"===this.locale||"en-US"===this.locale?(0,i.getValue)("timeFormats.short",(0,i.getDefaultDateObject)()):this.getCultureTimeObject(i.cldrData,""+this.locale)},s.prototype.isNullOrEmpty=function(e){return!!((0,i.isNullOrUndefined)(e)||"string"==typeof e&&""===e.trim())},s.prototype.getCultureTimeObject=function(e,t){return"Gregorian"===this.calendarMode?(0,i.getValue)("main."+this.locale+".dates.calendars.gregorian.timeFormats.short",e):(0,i.getValue)("main."+this.locale+".dates.calendars.islamic.timeFormats.short",e)},s.prototype.timeHandler=function(t){this.enabled&&(this.isIconClicked=!0,i.Browser.isDevice&&this.inputElement.setAttribute("readonly",""),t.currentTarget===this.timeIcon&&t.preventDefault(),this.enabled&&!this.readonly&&(this.isDatePopupOpen()&&e.prototype.hide.call(this,t),this.isTimePopupOpen()?this.closePopup(t):(this.inputElement.focus(),this.popupCreation("time",t),(0,i.addClass)([this.inputWrapper.container],[wt]))),this.isIconClicked=!1)},s.prototype.dateHandler=function(e){this.enabled&&(e.currentTarget===this.inputWrapper.buttons[0]&&e.preventDefault(),this.enabled&&!this.readonly&&(this.isTimePopupOpen()&&this.closePopup(e),(0,i.isNullOrUndefined)(this.popupWrapper)||this.popupCreation("date",e)))},s.prototype.show=function(t,i){this.enabled&&this.readonly||!this.enabled||("time"!==t||this.dateTimeWrapper?this.popupObj||(this.isTimePopupOpen()&&this.hide(i),e.prototype.show.call(this),this.popupCreation("date",i)):(this.isDatePopupOpen()&&this.hide(i),this.popupCreation("time",i)))},s.prototype.toggle=function(t){this.isDatePopupOpen()?(e.prototype.hide.call(this,t),this.show("time",null)):this.isTimePopupOpen()?(this.hide(t),e.prototype.show.call(this,null,t),this.popupCreation("date",null)):this.show(null,t)},s.prototype.listCreation=function(){var e;"Gregorian"===this.calendarMode?(this.cldrDateTimeFormat().replace(this.formatRegex,this.TimePopupFormat()),""===this.dateFormatString&&(this.dateFormatString=this.cldrDateTimeFormat()),e=this.globalize.parseDate(this.getAmPmValue(this.inputElement.value),{format:this.dateFormatString,type:"datetime"})):e=this.globalize.parseDate(this.getAmPmValue(this.inputElement.value),{format:this.cldrDateTimeFormat(),type:"datetime",calendar:"islamic"});var s=(0,i.isNullOrUndefined)(this.value)?""!==this.inputElement.value?e:new Date:this.value;this.valueWithMinutes=s,this.listWrapper=(0,i.createElement)("div",{className:"e-content",attrs:{tabindex:"0"}});var a=this.startTime(s),n=this.endTime(s),r=t.createListItems(this.createElement,a,n,this.globalize,this.cldrTimeFormat(),this.step);this.timeCollections=r.collection,this.listTag=r.list,(0,i.attributes)(this.listTag,{role:"listbox","aria-hidden":"false",id:this.element.id+"_options"}),(0,i.append)([r.list],this.listWrapper),this.wireTimeListEvents();var l={duration:300,selector:"."+St};this.rippleFn=(0,i.rippleEffect)(this.listWrapper,l),this.liCollections=this.listWrapper.querySelectorAll("."+St)},s.prototype.popupCreation=function(e,t){if(i.Browser.isDevice&&this.element.setAttribute("readonly","readonly"),"date"===e)!this.readonly&&this.popupWrapper&&((0,i.addClass)([this.popupWrapper],kt),(0,i.attributes)(this.popupWrapper,{id:this.element.id+"_options"}));else if(!this.readonly){var s=(0,i.createElement)("div",{className:Ct+" "+Mt,attrs:{id:this.element.id+"_timepopup"}});s.style.cssText="visibility: hidden; display: block;",this.dateTimeWrapper=s,(0,i.isNullOrUndefined)(this.cssClass)||(this.dateTimeWrapper.className+=" "+this.cssClass),!(0,i.isNullOrUndefined)(this.step)&&this.step>0&&(this.listCreation(),(0,i.append)([this.listWrapper],this.dateTimeWrapper)),document.body.appendChild(this.dateTimeWrapper),this.addTimeSelection(),this.renderPopup(),this.setTimeScrollPosition(),this.openPopup(t),(!i.Browser.isDevice||i.Browser.isDevice&&!this.fullScreenMode)&&this.popupObject.refreshPosition(this.inputElement),i.Browser.isDevice&&(this.modelWrapper.style.zIndex=(this.popupObject.zIndex-1).toString(),this.fullScreenMode&&(this.dateTimeWrapper.style.left="0px"))}},s.prototype.openPopup=function(e){var t=this;this.preventArgs={cancel:!1,popup:this.popupObject,event:e||null};var s=this.preventArgs;this.trigger("open",s,function(e){if(t.preventArgs=e,!t.preventArgs.cancel&&!t.readonly){var s={name:"FadeIn",duration:100};1e3===t.zIndex?t.popupObject.show(new i.Animation(s),t.element):t.popupObject.show(new i.Animation(s),null),(0,i.addClass)([t.inputWrapper.container],[Ot]),(0,i.attributes)(t.inputElement,{"aria-expanded":"true"}),(0,i.attributes)(t.inputElement,{"aria-owns":t.inputElement.id+"_options"}),(0,i.attributes)(t.inputElement,{"aria-controls":t.inputElement.id}),i.EventHandler.add(document,"mousedown touchstart",t.documentClickHandler,t)}})},s.prototype.documentClickHandler=function(e){var t=e.target;!(0,i.isNullOrUndefined)(this.popupObject)&&(this.inputWrapper.container.contains(t)&&"mousedown"!==e.type||this.popupObject.element&&this.popupObject.element.contains(t))&&"touchstart"!==e.type&&e.preventDefault(),(0,i.closest)(t,'[id="'+(this.popupObject&&this.popupObject.element.id+'"]'))||t===this.inputElement||t===this.timeIcon||(0,i.isNullOrUndefined)(this.inputWrapper)||t===this.inputWrapper.container?t!==this.inputElement&&(i.Browser.isDevice||(this.isPreventBlur=document.activeElement===this.inputElement&&(i.Browser.isIE||"edge"===i.Browser.info.name)&&t===this.popupObject.element)):this.isTimePopupOpen()&&(this.hide(e),t.classList.contains("e-dlg-overlay")?e.preventDefault():this.focusOut())},s.prototype.isTimePopupOpen=function(){return!(!this.dateTimeWrapper||!this.dateTimeWrapper.classList.contains(""+Ct))},s.prototype.isDatePopupOpen=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains(""+kt))},s.prototype.renderPopup=function(){var e=this;if(this.containerStyle=this.inputWrapper.container.getBoundingClientRect(),i.Browser.isDevice&&(this.timeModal=(0,i.createElement)("div"),this.timeModal.className=Ct+" e-time-modal",document.body.className+=" "+Pt,this.timeModal.style.display="block",document.body.appendChild(this.timeModal)),i.Browser.isDevice){this.modelWrapper=(0,i.createElement)("div",{className:"e-datetime-mob-popup-wrap"}),this.modelWrapper.appendChild(this.dateTimeWrapper);var t=(0,i.createElement)("div",{className:"e-dlg-overlay"});t.style.zIndex=(this.zIndex-1).toString(),this.modelWrapper.appendChild(t),document.body.appendChild(this.modelWrapper)}if(this.popupObject=new B.Popup(this.dateTimeWrapper,{width:this.setPopupWidth(),zIndex:this.zIndex,targetType:"container",collision:i.Browser.isDevice?{X:"fit",Y:"fit"}:{X:"flip",Y:"flip"},relateTo:i.Browser.isDevice?document.body:this.inputWrapper.container,position:i.Browser.isDevice?{X:"center",Y:"center"}:{X:"left",Y:"bottom"},enableRtl:this.enableRtl,offsetY:4,open:function(){e.dateTimeWrapper.style.visibility="visible",(0,i.addClass)([e.timeIcon],Tt),i.Browser.isDevice||(e.timekeyConfigure=(0,i.extend)(e.timekeyConfigure,e.keyConfigs),e.inputEvent=new i.KeyboardEvents(e.inputWrapper.container,{keyAction:e.timeKeyActionHandle.bind(e),keyConfigs:e.timekeyConfigure,eventName:"keydown"}))},close:function(){(0,i.removeClass)([e.timeIcon],Tt),e.unWireTimeListEvents(),e.inputElement.removeAttribute("aria-activedescendant"),(0,i.remove)(e.popupObject.element),e.popupObject.destroy(),e.dateTimeWrapper.innerHTML="",e.modelWrapper&&(0,i.remove)(e.modelWrapper),e.listWrapper=e.dateTimeWrapper=void 0,e.inputEvent&&e.inputEvent.destroy()},targetExitViewport:function(){i.Browser.isDevice||e.hide()}}),i.Browser.isDevice&&this.fullScreenMode?(this.popupObject.element.style.maxHeight="100%",this.popupObject.element.style.width="100%"):this.popupObject.element.style.maxHeight=Vt,i.Browser.isDevice&&this.fullScreenMode){var s=this.createElement("div",{className:"e-model-header"}),a=this.createElement("span",{className:"e-model-title"});a.textContent="Select time";var n=this.createElement("span",{className:"e-popup-close"});i.EventHandler.add(n,"mousedown touchstart",this.dateTimeCloseHandler,this),s.appendChild(n),s.appendChild(a),this.dateTimeWrapper.insertBefore(s,this.dateTimeWrapper.firstElementChild)}},s.prototype.dateTimeCloseHandler=function(e){this.hide()},s.prototype.setDimension=function(e){return"number"==typeof e?e=(0,i.formatUnit)(e):"string"==typeof e||(e="100%"),e},s.prototype.setPopupWidth=function(){var e=this.setDimension(this.width);e.indexOf("%")>-1&&(e=(this.containerStyle.width*parseFloat(e)/100).toString()+"px");return e},s.prototype.wireTimeListEvents=function(){i.EventHandler.add(this.listWrapper,"click",this.onMouseClick,this),i.Browser.isDevice||(i.EventHandler.add(this.listWrapper,"mouseover",this.onMouseOver,this),i.EventHandler.add(this.listWrapper,"mouseout",this.onMouseLeave,this))},s.prototype.unWireTimeListEvents=function(){this.listWrapper&&(i.EventHandler.remove(this.listWrapper,"click",this.onMouseClick),i.EventHandler.remove(document,"mousedown touchstart",this.documentClickHandler),i.Browser.isDevice||(i.EventHandler.add(this.listWrapper,"mouseover",this.onMouseOver,this),i.EventHandler.add(this.listWrapper,"mouseout",this.onMouseLeave,this)))},s.prototype.onMouseOver=function(e){var t=(0,i.closest)(e.target,"."+St);this.setTimeHover(t,xt)},s.prototype.onMouseLeave=function(){this.removeTimeHover(xt)},s.prototype.setTimeHover=function(e,t){this.enabled&&this.isValidLI(e)&&!e.classList.contains(t)&&(this.removeTimeHover(t),(0,i.addClass)([e],t))},s.prototype.getPopupHeight=function(){var e=parseInt(Vt,10),t=this.dateTimeWrapper.getBoundingClientRect().height;return i.Browser.isDevice&&this.fullScreenMode?t:t>e?e:t},s.prototype.changeEvent=function(t){e.prototype.changeEvent.call(this,t),(this.value&&this.value.valueOf())!==(this.previousDateTime&&+this.previousDateTime.valueOf())&&(this.valueWithMinutes=this.value,this.setInputValue("date"),this.previousDateTime=this.value&&new Date(+this.value))},s.prototype.updateValue=function(e){this.setInputValue("time"),+this.previousDateTime!==+this.value&&(this.changedArgs={value:this.value,event:e||null,isInteracted:!(0,i.isNullOrUndefined)(e),element:this.element},this.addTimeSelection(),this.trigger("change",this.changedArgs),this.previousDateTime=this.previousDate=this.value)},s.prototype.setTimeScrollPosition=function(){var e=this.selectedElement;(0,i.isNullOrUndefined)(e)?this.dateTimeWrapper&&this.checkDateValue(this.scrollTo)&&this.setScrollTo():this.findScrollTop(e)},s.prototype.findScrollTop=function(e){var t=this.getPopupHeight(),s=e.nextElementSibling,a=s?s.offsetTop:e.offsetTop,n=e.getBoundingClientRect().height;a+e.offsetTop>t?i.Browser.isDevice&&this.fullScreenMode?this.dateTimeWrapper.querySelector(".e-content").scrollTop=s?a-(t/2+n/2):a:this.dateTimeWrapper.scrollTop=s?a-(t/2+n/2):a:this.dateTimeWrapper.scrollTop=0},s.prototype.setScrollTo=function(){var e,t=this.dateTimeWrapper.querySelectorAll("."+St);if(t.length>=0){this.scrollInvoked=!0;var s=this.timeCollections[0],a=this.getDateObject(this.checkDateValue(this.scrollTo)).getTime();e=t[Math.round((a-s)/(6e4*this.step))]}else this.dateTimeWrapper.scrollTop=0;(0,i.isNullOrUndefined)(e)?this.dateTimeWrapper.scrollTop=0:this.findScrollTop(e)},s.prototype.setInputValue=function(e){if("date"===e)this.inputElement.value=this.previousElementValue=this.getFormattedValue(this.getFullDateTime()),this.setProperties({value:this.getFullDateTime()},!0);else{var t=this.getFormattedValue(new Date(this.timeCollections[this.activeIndex]));j.Input.setValue(t,this.inputElement,this.floatLabelType,this.showClearButton),this.previousElementValue=this.inputElement.value,this.setProperties({value:new Date(this.timeCollections[this.activeIndex])},!0),this.enableMask&&this.createMask()}this.updateIconState()},s.prototype.getFullDateTime=function(){var e=null;return e=this.isDateObject(this.valueWithMinutes)?this.combineDateTime(this.valueWithMinutes):this.previousDate,this.validateMinMaxRange(e)},s.prototype.createMask=function(){this.notify("createMask",{module:"MaskedDateTime"})},s.prototype.combineDateTime=function(e){if(this.isDateObject(e)){var t=this.previousDate.getDate(),i=this.previousDate.getMonth(),s=this.previousDate.getFullYear(),a=e.getHours(),n=e.getMinutes(),r=e.getSeconds();return new Date(s,i,t,a,n,r)}return this.previousDate},s.prototype.onMouseClick=function(e){var t=e.target,s=this.selectedElement=(0,i.closest)(t,"."+St);s&&s.classList.contains(St)&&(this.timeValue=s.getAttribute("data-value"),this.hide(e)),this.setSelection(s,e)},s.prototype.setSelection=function(e,t){if(this.isValidLI(e)&&!e.classList.contains(Tt)){this.selectedElement=e;var s=Array.prototype.slice.call(this.liCollections).indexOf(e);this.activeIndex=s,this.valueWithMinutes=new Date(this.timeCollections[this.activeIndex]),(0,i.addClass)([this.selectedElement],Tt),this.selectedElement.setAttribute("aria-selected","true"),this.updateValue(t)}},s.prototype.setTimeActiveClass=function(){var e=(0,i.isNullOrUndefined)(this.dateTimeWrapper)?this.listWrapper:this.dateTimeWrapper;if(!(0,i.isNullOrUndefined)(e)){var t=e.querySelectorAll("."+St);if(t.length)for(var s=0;s<t.length;s++)if(this.timeCollections[s]===+this.valueWithMinutes){t[s].setAttribute("aria-selected","true"),this.selectedElement=t[s],this.activeIndex=s,this.setTimeActiveDescendant();break}}},s.prototype.setTimeActiveDescendant=function(){!(0,i.isNullOrUndefined)(this.selectedElement)&&this.value?(0,i.attributes)(this.inputElement,{"aria-activedescendant":this.selectedElement.getAttribute("id")}):this.inputElement.removeAttribute("aria-activedescendant")},s.prototype.addTimeSelection=function(){this.selectedElement=null,this.removeTimeSelection(),this.setTimeActiveClass(),(0,i.isNullOrUndefined)(this.selectedElement)||((0,i.addClass)([this.selectedElement],Tt),this.selectedElement.setAttribute("aria-selected","true"))},s.prototype.removeTimeSelection=function(){if(this.removeTimeHover(xt),!(0,i.isNullOrUndefined)(this.dateTimeWrapper)){var e=this.dateTimeWrapper.querySelectorAll("."+Tt);e.length&&((0,i.removeClass)(e,Tt),e[0].removeAttribute("aria-selected"))}},s.prototype.removeTimeHover=function(e){var t=this.getTimeHoverItem(e);t&&t.length&&(0,i.removeClass)(t,e)},s.prototype.getTimeHoverItem=function(e){var t,s=(0,i.isNullOrUndefined)(this.dateTimeWrapper)?this.listWrapper:this.dateTimeWrapper;return(0,i.isNullOrUndefined)(s)||(t=s.querySelectorAll("."+e)),t},s.prototype.isValidLI=function(e){return e&&e.classList.contains(St)&&!e.classList.contains(Nt)},s.prototype.calculateStartEnd=function(e,t,i){var s=e.getDate(),a=e.getMonth(),n=e.getFullYear(),r=e.getHours(),l=e.getMinutes(),o=e.getSeconds(),h=e.getMilliseconds();return t?"starttime"===i?new Date(n,a,s,0,0,0):new Date(n,a,s,23,59,59):new Date(n,a,s,r,l,o,h)},s.prototype.startTime=function(e){var t,i,s,a=this.min,n=this.max,r=null===e?new Date:e,l=!1;return this.minTime?(s=new Date(r.getFullYear(),r.getMonth(),r.getDate(),this.minTime.getHours(),this.minTime.getMinutes(),this.minTime.getSeconds(),this.minTime.getMilliseconds()),l=!0):s=r,+s.getDate()===+a.getDate()&&+s.getMonth()===+a.getMonth()&&+s.getFullYear()===+a.getFullYear()||+new Date(s.getFullYear(),s.getMonth(),s.getDate())<=+new Date(a.getFullYear(),a.getMonth(),a.getDate())?(i=!1,t=a,l&&+new Date(s.getFullYear(),s.getMonth(),s.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds())>=+new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds())&&t.setHours(s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds())):+s<+n&&+s>+a?(i=!l,t=s):+s>=+n&&(i=!0,t=n),this.calculateStartEnd(t,i,"starttime")},s.prototype.TimePopupFormat=function(){var e="",t=0,i=this;return function(s){switch(s){case"d":case"dd":case"ddd":case"dddd":case"M":case"MM":case"MMM":case"MMMM":case"y":case"yy":case"yyy":case"yyyy":""===e?e+=s:e=e+"/"+s,t+=1}return t>2&&(i.dateFormatString=e),e}},s.prototype.endTime=function(e){var t,i,s,a=this.max,n=null===e?new Date:e,r=!1;return this.maxTime?(s=new Date(n.getFullYear(),n.getMonth(),n.getDate(),this.maxTime.getHours(),this.maxTime.getMinutes(),this.maxTime.getSeconds(),this.maxTime.getMilliseconds()),r=!0):s=n,+s.getDate()===+a.getDate()&&+s.getMonth()===+a.getMonth()&&+s.getFullYear()===+a.getFullYear()||+new Date(s.getUTCFullYear(),s.getMonth(),s.getDate())>=+new Date(a.getFullYear(),a.getMonth(),a.getDate())?(i=!1,t=this.max,r&&+new Date(s.getUTCFullYear(),s.getMonth(),s.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds())<=+new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds())&&t.setHours(s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds())):+s<+this.max&&+s>+this.min?(i=!r,t=s):+s<=+this.min&&(i=!0,t=this.min),this.calculateStartEnd(t,i,"endtime")},s.prototype.hide=function(e){var t=this;if(this.popupObj||this.dateTimeWrapper){this.preventArgs={cancel:!1,popup:this.popupObj||this.popupObject,event:e||null};var s=this.preventArgs;(0,i.isNullOrUndefined)(this.popupObj)?this.trigger("close",s,function(i){t.dateTimeCloseEventCallback(e,i)}):this.dateTimeCloseEventCallback(e,s)}else i.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit()},s.prototype.dateTimeCloseEventCallback=function(t,s){this.preventArgs=s,this.preventArgs.cancel||(this.isDatePopupOpen()?e.prototype.hide.call(this,t):this.isTimePopupOpen()&&(this.closePopup(t),(0,i.removeClass)([document.body],Pt),i.Browser.isDevice&&this.timeModal&&(this.timeModal.style.display="none",this.timeModal.outerHTML="",this.timeModal=null),this.setTimeActiveDescendant())),i.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit()},s.prototype.closePopup=function(e){if(this.isTimePopupOpen()&&this.popupObject){var t={name:"FadeOut",duration:100,delay:0};this.popupObject.hide(new i.Animation(t)),this.inputWrapper.container.classList.remove(Ot),(0,i.attributes)(this.inputElement,{"aria-expanded":"false"}),this.inputElement.removeAttribute("aria-owns"),this.inputElement.removeAttribute("aria-controls"),i.EventHandler.remove(document,"mousedown touchstart",this.documentClickHandler)}},s.prototype.preRender=function(){this.checkFormat(),this.dateTimeFormat=this.cldrDateTimeFormat(),e.prototype.preRender.call(this),(0,i.removeClass)([this.inputElementCopy],[Ct])},s.prototype.getProperty=function(e,t){"min"===t?this.setProperties({min:this.validateValue(e.min)},!0):this.setProperties({max:this.validateValue(e.max)},!0)},s.prototype.checkAttributes=function(e){for(var t,s=0,a=e?(0,i.isNullOrUndefined)(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["style","name","step","disabled","readonly","value","min","max","placeholder","type"];s<a.length;s++){var n=a[s];if(!(0,i.isNullOrUndefined)(this.inputElement.getAttribute(n)))switch(n){case"name":this.inputElement.setAttribute("name",this.inputElement.getAttribute(n));break;case"step":this.step=parseInt(this.inputElement.getAttribute(n),10);break;case"readonly":if((0,i.isNullOrUndefined)(this.dateTimeOptions)||void 0===this.dateTimeOptions.readonly||e){var r="disabled"===this.inputElement.getAttribute(n)||""===this.inputElement.getAttribute(n)||"true"===this.inputElement.getAttribute(n);this.setProperties({readonly:r},!e)}break;case"placeholder":((0,i.isNullOrUndefined)(this.dateTimeOptions)||void 0===this.dateTimeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(n)},!e);break;case"min":((0,i.isNullOrUndefined)(this.dateTimeOptions)||void 0===this.dateTimeOptions.min||e)&&(t=new Date(this.inputElement.getAttribute(n)),this.isNullOrEmpty(t)||isNaN(+t)||this.setProperties({min:t},!e));break;case"disabled":if((0,i.isNullOrUndefined)(this.dateTimeOptions)||void 0===this.dateTimeOptions.enabled||e){var l="disabled"!==this.inputElement.getAttribute(n)&&"true"!==this.inputElement.getAttribute(n)&&""!==this.inputElement.getAttribute(n);this.setProperties({enabled:l},!e)}break;case"value":((0,i.isNullOrUndefined)(this.dateTimeOptions)||void 0===this.dateTimeOptions.value||e)&&(t=new Date(this.inputElement.getAttribute(n)),this.isNullOrEmpty(t)||isNaN(+t)||this.setProperties({value:t},!e));break;case"max":((0,i.isNullOrUndefined)(this.dateTimeOptions)||void 0===this.dateTimeOptions.max||e)&&(t=new Date(this.inputElement.getAttribute(n)),this.isNullOrEmpty(t)||isNaN(+t)||this.setProperties({max:t},!e))}}},s.prototype.requiredModules=function(){var e=[];return"Islamic"===this.calendarMode&&e.push({args:[this],member:"islamic",name:"Islamic"}),this.enableMask&&e.push(this.maskedDateModule()),e},s.prototype.maskedDateModule=function(){return{args:[this],member:"MaskedDateTime"}},s.prototype.getTimeActiveElement=function(){return(0,i.isNullOrUndefined)(this.dateTimeWrapper)?null:this.dateTimeWrapper.querySelectorAll("."+Tt)},s.prototype.createDateObj=function(e){return e instanceof Date?e:null},s.prototype.getDateObject=function(e){if(!this.isNullOrEmpty(e)){var t=this.createDateObj(e),s=this.valueWithMinutes,a=!(0,i.isNullOrUndefined)(s);if(this.checkDateValue(t)){var n=a?s.getDate():ft,r=a?s.getMonth():vt,l=a?s.getFullYear():gt,o=a?s.getHours():yt,h=a?s.getMinutes():bt,u=a?s.getSeconds():Dt,d=a?s.getMilliseconds():Et;return this.scrollInvoked?(this.scrollInvoked=!1,new Date(l,r,n,t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())):new Date(l,r,n,o,h,u,d)}}return null},s.prototype.findNextTimeElement=function(e){var t=this.inputElement.value,s=(0,i.isNullOrUndefined)(this.valueWithMinutes)?this.createDateObj(t):this.getDateObject(this.valueWithMinutes),a=null,n=this.liCollections.length;if(!(0,i.isNullOrUndefined)(this.activeIndex)||!(0,i.isNullOrUndefined)(this.checkDateValue(s))){if("home"===e.action)a=+this.createDateObj(new Date(this.timeCollections[0])),this.activeIndex=0;else if("end"===e.action)a=+this.createDateObj(new Date(this.timeCollections[this.timeCollections.length-1])),this.activeIndex=this.timeCollections.length-1;else if("down"===e.action){for(var r=0;r<n;r++)if(+s<this.timeCollections[r]){a=+this.createDateObj(new Date(this.timeCollections[r])),this.activeIndex=r;break}}else for(r=n-1;r>=0;r--)if(+s>this.timeCollections[r]){a=+this.createDateObj(new Date(this.timeCollections[r])),this.activeIndex=r;break}this.selectedElement=this.liCollections[this.activeIndex],this.timeElementValue((0,i.isNullOrUndefined)(a)?null:new Date(a))}},s.prototype.setTimeValue=function(e,t){var s,a,n=this.validateMinMaxRange(t),r=this.createDateObj(n);return this.getFormattedValue(r)!==((0,i.isNullOrUndefined)(this.value)?null:this.getFormattedValue(this.value))?(this.valueWithMinutes=(0,i.isNullOrUndefined)(r)?null:r,a=new Date(+this.valueWithMinutes)):(this.strictMode&&(e=r),this.valueWithMinutes=this.checkDateValue(e),a=new Date(+this.valueWithMinutes)),s="Gregorian"===this.calendarMode?this.globalize.formatDate(a,{format:(0,i.isNullOrUndefined)(this.formatString)?this.cldrDateTimeFormat():this.formatString,type:"dateTime",skeleton:"yMd"}):this.globalize.formatDate(a,{format:(0,i.isNullOrUndefined)(this.formatString)?this.cldrDateTimeFormat():this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"}),!this.strictMode&&(0,i.isNullOrUndefined)(a),j.Input.setValue(s,this.inputElement,this.floatLabelType,this.showClearButton),a},s.prototype.timeElementValue=function(e){if(!(0,i.isNullOrUndefined)(this.checkDateValue(e))&&!this.isNullOrEmpty(e)){var t=e instanceof Date?e:this.getDateObject(e);return this.setTimeValue(t,e)}return null},s.prototype.timeKeyHandler=function(e){if(!((0,i.isNullOrUndefined)(this.step)||this.step<=0)){var t=this.timeCollections.length;if((0,i.isNullOrUndefined)(this.getTimeActiveElement())||0===this.getTimeActiveElement().length)this.liCollections.length>0&&((0,i.isNullOrUndefined)(this.value)&&(0,i.isNullOrUndefined)(this.activeIndex)?(this.activeIndex=0,this.selectedElement=this.liCollections[0],this.timeElementValue(new Date(this.timeCollections[0]))):this.findNextTimeElement(e));else{var s=void 0;if(e.keyCode>=37&&e.keyCode<=40){var a=40===e.keyCode||39===e.keyCode?++this.activeIndex:--this.activeIndex;this.activeIndex=this.activeIndex===t?0:this.activeIndex,this.activeIndex=a=this.activeIndex<0?t-1:this.activeIndex,s=(0,i.isNullOrUndefined)(this.timeCollections[a])?this.timeCollections[0]:this.timeCollections[a]}else"home"===e.action?(this.activeIndex=0,s=this.timeCollections[0]):"end"===e.action&&(this.activeIndex=t-1,s=this.timeCollections[t-1]);this.selectedElement=this.liCollections[this.activeIndex],this.timeElementValue(new Date(s))}this.isNavigate=!0,this.setTimeHover(this.selectedElement,"e-navigation"),this.setTimeActiveDescendant(),!this.isTimePopupOpen()||null===this.selectedElement||e&&"click"===e.type||this.setTimeScrollPosition()}},s.prototype.timeKeyActionHandle=function(e){if(this.enabled)switch("right"!==e.action&&"left"!==e.action&&"tab"!==e.action&&e.preventDefault(),e.action){case"up":case"down":case"home":case"end":this.timeKeyHandler(e);break;case"enter":this.isNavigate?(this.selectedElement=this.liCollections[this.activeIndex],this.valueWithMinutes=new Date(this.timeCollections[this.activeIndex]),this.setInputValue("time"),+this.previousDateTime!==+this.value&&(this.changedArgs.value=this.value,this.addTimeSelection(),this.previousDateTime=this.value)):this.updateValue(e),this.hide(e),(0,i.addClass)([this.inputWrapper.container],wt),this.isNavigate=!1,e.stopPropagation();break;case"escape":this.hide(e);break;default:this.isNavigate=!1}},s.prototype.inputKeyAction=function(e){if("altDownArrow"===e.action)this.strictModeUpdate(),this.updateInput(),this.toggle(e)},s.prototype.onPropertyChanged=function(t,s){for(var a=0,n=Object.keys(t);a<n.length;a++){var r=n[a];switch(["blur","change","cleared","close","created","destroyed","focus","navigated","open","renderDayCell"].indexOf(r)>0&&this.isReact&&(this.isDynamicValueChanged=!0),r){case"value":this.isDynamicValueChanged=!0,this.invalidValueString=null,this.checkInvalidValue(t.value),t.value=this.value,t.value=this.validateValue(t.value),this.enableMask?j.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton):j.Input.setValue(this.getFormattedValue(t.value),this.inputElement,this.floatLabelType,this.showClearButton),this.valueWithMinutes=t.value,this.setProperties({value:t.value},!0),this.popupObj&&this.popupUpdate(),this.previousDateTime=new Date(this.inputElement.value),this.updateInput(),this.changeTrigger(null),this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange,this.enableMask&&this.value&&this.notify("createMask",{module:"MaskedDateTime"});break;case"min":case"max":this.getProperty(t,r),this.updateInput();break;case"enableRtl":j.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]);break;case"cssClass":(0,i.isNullOrUndefined)(s.cssClass)||(s.cssClass=s.cssClass.replace(/\s+/g," ").trim()),(0,i.isNullOrUndefined)(t.cssClass)||(t.cssClass=t.cssClass.replace(/\s+/g," ").trim()),j.Input.setCssClass(t.cssClass,[this.inputWrapper.container],s.cssClass),this.dateTimeWrapper&&j.Input.setCssClass(t.cssClass,[this.dateTimeWrapper],s.cssClass);break;case"locale":this.globalize=new i.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.dateTimeOptions&&null==this.dateTimeOptions.placeholder&&(this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),j.Input.setPlaceholder(this.l10n.getConstant("placeholder"),this.inputElement)),this.dateTimeFormat=this.cldrDateTimeFormat(),e.prototype.updateInput.call(this);break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.checkAttributes(!0);break;case"format":this.setProperties({format:t.format},!0),this.checkFormat(),this.dateTimeFormat=this.formatString,this.setValue(),this.enableMask&&(this.notify("createMask",{module:"MaskedDateTime"}),this.value||j.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton));break;case"placeholder":j.Input.setPlaceholder(t.placeholder,this.inputElement);break;case"enabled":j.Input.setEnabled(this.enabled,this.inputElement),this.enabled?this.inputElement.setAttribute("tabindex",this.tabIndex):this.inputElement.tabIndex=-1;break;case"strictMode":this.invalidValueString=null,this.updateInput();break;case"width":this.setWidth(t.width),j.Input.calculateWidth(this.inputElement,this.inputWrapper.container),(0,i.isNullOrUndefined)(this.inputWrapper.buttons[0])||(0,i.isNullOrUndefined)(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-date-time-icon");break;case"readonly":j.Input.setReadonly(this.readonly,this.inputElement);break;case"floatLabelType":this.floatLabelType=t.floatLabelType,j.Input.removeFloating(this.inputWrapper),j.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder),(0,i.isNullOrUndefined)(this.inputWrapper.buttons[0])||(0,i.isNullOrUndefined)(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-date-time-icon");break;case"scrollTo":this.checkDateValue(new Date(this.checkValue(t.scrollTo)))?(this.dateTimeWrapper&&this.setScrollTo(),this.setProperties({scrollTo:this.checkDateValue(new Date(this.checkValue(t.scrollTo)))},!0)):this.setProperties({scrollTo:null},!0);break;case"enableMask":this.enableMask?(this.notify("createMask",{module:"MaskedDateTime"}),j.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton)):this.inputElement.value===this.maskedDateValue&&(this.maskedDateValue="",j.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton));break;default:e.prototype.onPropertyChanged.call(this,t,s)}this.isDynamicValueChanged||this.hide(null),this.isDynamicValueChanged=!1}},s.prototype.updateLabelOverflowWidth=function(){for(var e=this.inputWrapper.container,t=e.querySelector(".e-float-text.e-label-bottom"),i=0,s=e.querySelectorAll(".e-input-group-icon, .e-clear-icon"),a=0;a<s.length;a++)i+=s[a].offsetWidth;if(t){var n=this.element.parentElement.offsetWidth-i;!n||this.cssClass&&-1!==this.cssClass.split(" ").indexOf("e-outline")||(t.style.width=n+"px")}},s.prototype.clearLabelOverflowWidth=function(){var e=this.inputWrapper.container.querySelector(".e-float-text.e-label-top");e&&e.removeAttribute("style")},s.prototype.getModuleName=function(){return"datetimepicker"},s.prototype.restoreValue=function(){this.previousDateTime=this.previousDate,this.currentDate=this.value?this.value:new Date,this.valueWithMinutes=this.value,this.previousDate=this.value,this.previousElementValue=this.previousElementValue=(0,i.isNullOrUndefined)(this.inputValueCopy)?"":this.getFormattedValue(this.inputValueCopy)},mt([(0,i.Property)(null)],s.prototype,"timeFormat",void 0),mt([(0,i.Property)(30)],s.prototype,"step",void 0),mt([(0,i.Property)(null)],s.prototype,"scrollTo",void 0),mt([(0,i.Property)(1e3)],s.prototype,"zIndex",void 0),mt([(0,i.Property)(null)],s.prototype,"value",void 0),mt([(0,i.Property)(null)],s.prototype,"keyConfigs",void 0),mt([(0,i.Property)({})],s.prototype,"htmlAttributes",void 0),mt([(0,i.Property)(!1)],s.prototype,"enablePersistence",void 0),mt([(0,i.Property)(!0)],s.prototype,"allowEdit",void 0),mt([(0,i.Property)(!1)],s.prototype,"isMultiSelection",void 0),mt([(0,i.Property)(null)],s.prototype,"values",void 0),mt([(0,i.Property)(!0)],s.prototype,"showClearButton",void 0),mt([(0,i.Property)(null)],s.prototype,"placeholder",void 0),mt([(0,i.Property)(!1)],s.prototype,"strictMode",void 0),mt([(0,i.Property)(!1)],s.prototype,"fullScreenMode",void 0),mt([(0,i.Property)(null)],s.prototype,"serverTimezoneOffset",void 0),mt([(0,i.Property)(new Date(1900,0,1))],s.prototype,"min",void 0),mt([(0,i.Property)(new Date(2099,11,31))],s.prototype,"max",void 0),mt([(0,i.Property)(null)],s.prototype,"minTime",void 0),mt([(0,i.Property)(null)],s.prototype,"maxTime",void 0),mt([(0,i.Property)(null)],s.prototype,"firstDayOfWeek",void 0),mt([(0,i.Property)("Gregorian")],s.prototype,"calendarMode",void 0),mt([(0,i.Property)("Month")],s.prototype,"start",void 0),mt([(0,i.Property)("Month")],s.prototype,"depth",void 0),mt([(0,i.Property)(!1)],s.prototype,"weekNumber",void 0),mt([(0,i.Property)(!0)],s.prototype,"showTodayButton",void 0),mt([(0,i.Property)("Short")],s.prototype,"dayHeaderFormat",void 0),mt([(0,i.Property)(!1)],s.prototype,"openOnFocus",void 0),mt([(0,i.Property)(!1)],s.prototype,"enableMask",void 0),mt([(0,i.Property)({day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"})],s.prototype,"maskPlaceholder",void 0),mt([(0,i.Event)()],s.prototype,"open",void 0),mt([(0,i.Event)()],s.prototype,"close",void 0),mt([(0,i.Event)()],s.prototype,"cleared",void 0),mt([(0,i.Event)()],s.prototype,"blur",void 0),mt([(0,i.Event)()],s.prototype,"focus",void 0),mt([(0,i.Event)()],s.prototype,"created",void 0),mt([(0,i.Event)()],s.prototype,"destroyed",void 0),s=mt([i.NotifyPropertyChanges],s)}(Q),Ut="ArrowLeft",Ht="ArrowDown",Wt="shiftTab",Ft="End",Lt="Home",Bt=function(){function e(e){this.mask="",this.defaultConstant={day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"},this.hiddenMask="",this.validCharacters="dMyhmHfasz",this.isDayPart=!1,this.isMonthPart=!1,this.isYearPart=!1,this.isHourPart=!1,this.isMinutePart=!1,this.isSecondsPart=!1,this.isMilliSecondsPart=!1,this.monthCharacter="",this.periodCharacter="",this.isHiddenMask=!1,this.isComplete=!1,this.isNavigate=!1,this.navigated=!1,this.isBlur=!1,this.formatRegex=/EEEEE|EEEE|EEE|EE|E|cccc|ccc|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yyy|yy|y|HH|H|hh|h|mm|m|fff|ff|f|aa|a|ss|s|zzzz|zzz|zz|z|'[^']*'|'[^']*'/g,this.isDeletion=!1,this.isShortYear=!1,this.isDeleteKey=!1,this.isDateZero=!1,this.isMonthZero=!1,this.isYearZero=!1,this.isLeadingZero=!1,this.dayTypeCount=0,this.monthTypeCount=0,this.hourTypeCount=0,this.minuteTypeCount=0,this.secondTypeCount=0,this.parent=e,this.dateformat=this.getCulturedFormat(),this.maskDateValue=null!=this.parent.value?new Date(+this.parent.value):new Date,this.maskDateValue.setMonth(0),this.maskDateValue.setHours(0),this.maskDateValue.setMinutes(0),this.maskDateValue.setSeconds(0),this.previousDate=new Date(this.maskDateValue.getFullYear(),this.maskDateValue.getMonth(),this.maskDateValue.getDate(),this.maskDateValue.getHours(),this.maskDateValue.getMinutes(),this.maskDateValue.getSeconds()),this.removeEventListener(),this.addEventListener()}return e.prototype.getModuleName=function(){return"MaskedDateTime"},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("createMask",this.createMask,this),this.parent.on("setMaskSelection",this.validCharacterCheck,this),this.parent.on("inputHandler",this.maskInputHandler,this),this.parent.on("keyDownHandler",this.maskKeydownHandler,this),this.parent.on("clearHandler",this.clearHandler,this),this.parent.on("maskPasteInputHandler",this.maskPasteInputHandler,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("createMask",this.createMask),this.parent.off("setMaskSelection",this.validCharacterCheck),this.parent.off("inputHandler",this.maskInputHandler),this.parent.off("keyDownHandler",this.maskKeydownHandler),this.parent.off("clearHandler",this.clearHandler),this.parent.off("maskPasteInputHandler",this.maskPasteInputHandler))},e.prototype.createMask=function(e){this.isDayPart=this.isMonthPart=this.isYearPart=this.isHourPart=this.isMinutePart=this.isSecondsPart=!1,this.dateformat=this.getCulturedFormat(),this.parent.maskPlaceholder.day&&(this.defaultConstant.day=this.parent.maskPlaceholder.day),this.parent.maskPlaceholder.month&&(this.defaultConstant.month=this.parent.maskPlaceholder.month),this.parent.maskPlaceholder.year&&(this.defaultConstant.year=this.parent.maskPlaceholder.year),this.parent.maskPlaceholder.hour&&(this.defaultConstant.hour=this.parent.maskPlaceholder.hour),this.parent.maskPlaceholder.minute&&(this.defaultConstant.minute=this.parent.maskPlaceholder.minute),this.parent.maskPlaceholder.second&&(this.defaultConstant.second=this.parent.maskPlaceholder.second),this.parent.maskPlaceholder.dayOfTheWeek&&(this.defaultConstant.dayOfTheWeek=this.parent.maskPlaceholder.dayOfTheWeek.toString()),this.getCUltureMaskFormat();var t=this.dateformat.replace(this.formatRegex,this.formatCheck());this.isHiddenMask=!0,this.hiddenMask=this.dateformat.replace(this.formatRegex,this.formatCheck()),this.isHiddenMask=!1,this.previousHiddenMask=this.hiddenMask,this.mask=this.previousValue=t,this.parent.maskedDateValue=this.mask,this.parent.value&&(this.navigated=!0,this.isBlur=e.isBlur,this.setDynamicValue())},e.prototype.getCUltureMaskFormat=function(){this.l10n=new i.L10n(this.parent.moduleName,this.defaultConstant,this.parent.locale),this.objectString=Object.keys(this.defaultConstant);for(var e=0;e<this.objectString.length;e++)this.defaultConstant[this.objectString[e].toString()]=this.l10n.getConstant(this.objectString[e].toString())},e.prototype.validCharacterCheck=function(){var e=this.parent.inputElement.selectionStart;"timepicker"!==this.parent.moduleName&&e===this.hiddenMask.length&&this.mask===this.parent.inputElement.value&&(e=0);for(var t=e,i=e-1;t<this.hiddenMask.length||i>=0;t++,i--){if(t<this.hiddenMask.length&&-1!==this.validCharacters.indexOf(this.hiddenMask[t]))return void this.setSelection(this.hiddenMask[t]);if(i>=0&&-1!==this.validCharacters.indexOf(this.hiddenMask[i]))return void this.setSelection(this.hiddenMask[i])}},e.prototype.setDynamicValue=function(){this.maskDateValue=new Date(+this.parent.value),this.isDayPart=this.isMonthPart=this.isYearPart=this.isHourPart=this.isMinutePart=this.isSecondsPart=!0,this.updateValue(),this.isBlur||this.validCharacterCheck()},e.prototype.setSelection=function(e){for(var t=-1,i=0,s=0;s<this.hiddenMask.length;s++)this.hiddenMask[s]===e&&(i=s+1,-1===t&&(t=s));t<0&&(t=0),this.parent.inputElement.setSelectionRange(t,i)},e.prototype.maskKeydownHandler=function(e){if("Backspace"!==e.e.key)if(this.dayTypeCount=this.monthTypeCount=this.hourTypeCount=this.minuteTypeCount=this.secondTypeCount=0,"Delete"!==e.e.key){if(!(e.e.altKey||e.e.ctrlKey||e.e.key!==Ut&&"ArrowRight"!==e.e.key&&e.e.key!==Wt&&"Tab"!==e.e.key&&e.e.action!==Wt&&e.e.key!==Ft&&e.e.key!==Lt)){l=this.parent.inputElement.selectionStart;var t=this.parent.inputElement.selectionEnd,i=this.parent.inputElement.value.length;if(0===l&&t===i&&("Tab"===e.e.key||e.e.action===Wt)){var s=e.e.action===Wt?t:0;this.parent.inputElement.selectionStart=this.parent.inputElement.selectionEnd=s}if(e.e.key===Ft||e.e.key===Lt){var a=e.e.key===Ft?i:0;this.parent.inputElement.selectionStart=this.parent.inputElement.selectionEnd=a}this.navigateSelection(e.e.key===Ut||e.e.action===Wt||e.e.key===Ft)}if(!(e.e.altKey||e.e.ctrlKey||"ArrowUp"!==e.e.key&&e.e.key!==Ht)){l=this.parent.inputElement.selectionStart,o="";-1!==this.validCharacters.indexOf(this.hiddenMask[l])&&(o=this.hiddenMask[l]),this.dateAlteration(e.e.key===Ht);var n=this.dateformat.replace(this.formatRegex,this.formatCheck());this.isHiddenMask=!0,this.hiddenMask=this.dateformat.replace(this.formatRegex,this.formatCheck()),this.isHiddenMask=!1,this.previousHiddenMask=this.hiddenMask,this.previousValue=n,this.parent.inputElement.value=n;for(var r=0;r<this.hiddenMask.length;r++)if(o===this.hiddenMask[r]){l=r;break}this.parent.inputElement.selectionStart=l,this.validCharacterCheck()}}else this.isDeleteKey=!0;else{var l=this.parent.inputElement.selectionStart,o="";switch(-1!==this.validCharacters.indexOf(this.hiddenMask[l])&&(o=this.hiddenMask[l]),o){case"d":this.dayTypeCount=Math.max(this.dayTypeCount-1,0);break;case"M":this.monthTypeCount=Math.max(this.monthTypeCount-1,0);break;case"H":case"h":this.hourTypeCount=Math.max(this.hourTypeCount-1,0);break;case"m":this.minuteTypeCount=Math.max(this.minuteTypeCount-1,0);break;case"s":this.secondTypeCount=Math.max(this.secondTypeCount-1,0)}}},e.prototype.isPersist=function(){return this.parent.isFocused||this.navigated},e.prototype.differenceCheck=function(){var e=this.parent.inputElement.selectionStart,t=this.parent.inputElement.value,i=this.previousValue.substring(0,e+this.previousValue.length-t.length),s=t.substring(0,e),a=new Date(+this.maskDateValue),n=new Date(a.getFullYear(),a.getMonth()+1,0).getDate();if(0===i.indexOf(s)&&(0===s.length||this.previousHiddenMask[s.length-1]!==this.previousHiddenMask[s.length])){for(var r=s.length;r<i.length;r++)""!==this.previousHiddenMask[r]&&this.validCharacters.indexOf(this.previousHiddenMask[r])>=0&&(this.isDeletion=this.handleDeletion(this.previousHiddenMask[r],!1));if(this.isDeletion)return}switch(this.previousHiddenMask[e-1]){case"d":var l=(this.isDayPart&&a.getDate().toString().length<2&&!this.isPersist()?10*a.getDate():0)+parseInt(s[e-1],10);if(this.isDateZero="0"===s[e-1],this.parent.isFocused=!this.parent.isFocused&&this.parent.isFocused,this.navigated=!this.navigated&&this.navigated,isNaN(l))return;for(r=0;l>n;r++)l=parseInt(l.toString().slice(1),10);if(l>=1){if(a.setDate(l),this.isNavigate=2===l.toString().length,this.previousDate=new Date(a.getFullYear(),a.getMonth(),a.getDate()),a.getMonth()!==this.maskDateValue.getMonth())return;this.isDayPart=!0;var o=new Date(a.getFullYear(),a.getMonth()+1,0).getDate();this.dayTypeCount+=0===this.dayTypeCount&&parseInt(l+"0",10)>o?2:1}else this.isDayPart=!1,1===this.dayTypeCount&&this.isDateZero||(this.dayTypeCount+=this.isDateZero?1:0);break;case"M":var h=void 0;if(h=a.getMonth().toString().length<2&&!this.isPersist()?(this.isMonthPart?10*(a.getMonth()+1):0)+parseInt(s[e-1],10):parseInt(s[e-1],10),this.parent.isFocused=!this.parent.isFocused&&this.parent.isFocused,this.navigated=!this.navigated&&this.navigated,this.isMonthZero="0"===s[e-1],isNaN(h)){var u=this.getCulturedValue("months[stand-alone].wide"),d=Object.keys(u);for(this.monthCharacter+=s[e-1].toLowerCase();this.monthCharacter.length>0;){r=1;for(var p=0,c=d;p<c.length;p++){c[p];if(0===u[r].toLowerCase().indexOf(this.monthCharacter))return a.setMonth(r-1),this.isMonthPart=!0,void(this.maskDateValue=a);r++}this.monthCharacter=this.monthCharacter.substring(1,this.monthCharacter.length)}}else{for(;h>12;)h=parseInt(h.toString().slice(1),10);if(h>=1){if(a.setMonth(h-1),h>=10||1===h?this.isLeadingZero&&1===h?(this.isNavigate=1===h.toString().length,this.isLeadingZero=!1):this.isNavigate=2===h.toString().length:this.isNavigate=1===h.toString().length,a.getMonth()!==h-1&&(a.setDate(1),a.setMonth(h-1)),this.isDayPart){var m=new Date(this.previousDate.getFullYear(),this.previousDate.getMonth()+1,0).getDate(),f=new Date(a.getFullYear(),a.getMonth()+1,0).getDate();this.previousDate.getDate()===m&&f<=m&&a.setDate(f)}this.previousDate=new Date(a.getFullYear(),a.getMonth(),a.getDate()),this.isMonthPart=!0,this.monthTypeCount=this.monthTypeCount+1,this.isLeadingZero=!1}else a.setMonth(0),this.isLeadingZero=!0,this.isMonthPart=!1,1===this.monthTypeCount&&this.isMonthZero||(this.monthTypeCount+=this.isMonthZero?1:0)}break;case"y":var v=(this.isYearPart&&a.getFullYear().toString().length<4&&!this.isShortYear?10*a.getFullYear():0)+parseInt(s[e-1],10),g=(this.dateformat.match(/y/g)||[]).length;if(g=2!==g?4:g,this.isShortYear=!1,this.isYearZero="0"===s[e-1],isNaN(v))return;for(;v>9999;)v=parseInt(v.toString().slice(1),10);v<1?this.isYearPart=!1:(a.setFullYear(v),v.toString().length===g&&(this.isNavigate=!0),this.previousDate=new Date(a.getFullYear(),a.getMonth(),a.getDate()),this.isYearPart=!0);break;case"h":if(this.hour=(this.isHourPart&&(a.getHours()%12||12).toString().length<2&&!this.isPersist()?10*(a.getHours()%12||12):0)+parseInt(s[e-1],10),this.parent.isFocused=!this.parent.isFocused&&this.parent.isFocused,this.navigated=!this.navigated&&this.navigated,isNaN(this.hour))return;for(;this.hour>12;)this.hour=parseInt(this.hour.toString().slice(1),10);a.setHours(12*Math.floor(a.getHours()/12)+this.hour%12),this.isNavigate=2===this.hour.toString().length,this.isHourPart=!0,this.hourTypeCount=0===this.hourTypeCount&&this.hour&&parseInt(this.hour+"0",10)>12?2:this.hourTypeCount+1;break;case"H":if(this.hour=(this.isHourPart&&a.getHours().toString().length<2&&!this.isPersist()?10*a.getHours():0)+parseInt(s[e-1],10),this.parent.isFocused=!this.parent.isFocused&&this.parent.isFocused,this.navigated=!this.navigated&&this.navigated,isNaN(this.hour))return;for(r=0;this.hour>23;r++)this.hour=parseInt(this.hour.toString().slice(1),10);a.setHours(this.hour),this.isNavigate=2===this.hour.toString().length,this.isHourPart=!0,this.hourTypeCount=0===this.hourTypeCount&&this.hour&&parseInt(this.hour+"0",10)>23?2:this.hourTypeCount+1;break;case"m":var y=(this.isMinutePart&&a.getMinutes().toString().length<2&&!this.isPersist()?10*a.getMinutes():0)+parseInt(s[e-1],10);if(this.parent.isFocused=!this.parent.isFocused&&this.parent.isFocused,this.navigated=!this.navigated&&this.navigated,isNaN(y))return;for(r=0;y>59;r++)y=parseInt(y.toString().slice(1),10);a.setMinutes(y),this.isNavigate=2===y.toString().length,this.isMinutePart=!0,this.minuteTypeCount=0===this.minuteTypeCount&&parseInt(y+"0",10)>59?2:this.minuteTypeCount+1;break;case"s":var b=(this.isSecondsPart&&a.getSeconds().toString().length<2&&!this.isPersist()?10*a.getSeconds():0)+parseInt(s[e-1],10);if(this.parent.isFocused=!this.parent.isFocused&&this.parent.isFocused,this.navigated=!this.navigated&&this.navigated,isNaN(b))return;for(r=0;b>59;r++)b=parseInt(b.toString().slice(1),10);a.setSeconds(b),this.isNavigate=2===b.toString().length,this.isSecondsPart=!0,this.secondTypeCount=0===this.secondTypeCount&&parseInt(b+"0",10)>59?2:this.secondTypeCount+1;break;case"a":this.periodCharacter+=s[e-1].toLowerCase();var D=this.getCulturedValue("dayPeriods.format.wide"),E=Object.keys(D);for(r=0;this.periodCharacter.length>0;r++)(0===D[E[0]].toLowerCase().indexOf(this.periodCharacter)&&a.getHours()>=12||0===D[E[1]].toLowerCase().indexOf(this.periodCharacter)&&a.getHours()<12)&&(a.setHours((a.getHours()+12)%24),this.maskDateValue=a),this.periodCharacter=this.periodCharacter.substring(1,this.periodCharacter.length)}this.maskDateValue=a},e.prototype.formatCheck=function(){var e=this;return function(t){var i,s,a,n=e.getCulturedValue("days[stand-alone].abbreviated"),r=Object.keys(n),l=e.getCulturedValue("days[stand-alone].wide"),o=Object.keys(l),h=e.getCulturedValue("days[stand-alone].narrow"),u=Object.keys(h),d=e.getCulturedValue("months[stand-alone].abbreviated"),p=e.getCulturedValue("months[stand-alone].wide"),c=e.getCulturedValue("dayPeriods.format.wide");switch(Object.keys(c),t){case"ddd":case"dddd":case"d":i=e.isDayPart?e.maskDateValue.getDate().toString():e.defaultConstant.day.toString(),i=e.zeroCheck(e.isDateZero,e.isDayPart,i),2===e.dayTypeCount&&(e.isNavigate=!0,e.dayTypeCount=0);break;case"dd":i=e.isDayPart?e.roundOff(e.maskDateValue.getDate(),2):e.defaultConstant.day.toString(),i=e.zeroCheck(e.isDateZero,e.isDayPart,i),2===e.dayTypeCount&&(e.isNavigate=!0,e.dayTypeCount=0);break;case"E":case"EE":case"EEE":case"ccc":i=e.isDayPart&&e.isMonthPart&&e.isYearPart?n[r[e.maskDateValue.getDay()]].toString():e.defaultConstant.dayOfTheWeek.toString();break;case"EEEE":case"cccc":i=e.isDayPart&&e.isMonthPart&&e.isYearPart?l[o[e.maskDateValue.getDay()]].toString():e.defaultConstant.dayOfTheWeek.toString();break;case"EEEEE":i=e.isDayPart&&e.isMonthPart&&e.isYearPart?h[u[e.maskDateValue.getDay()]].toString():e.defaultConstant.dayOfTheWeek.toString();break;case"M":i=e.isMonthPart?(e.maskDateValue.getMonth()+1).toString():e.defaultConstant.month.toString(),i=e.zeroCheck(e.isMonthZero,e.isMonthPart,i),2===e.monthTypeCount&&(e.isNavigate=!0,e.monthTypeCount=0);break;case"MM":i=e.isMonthPart?e.roundOff(e.maskDateValue.getMonth()+1,2):e.defaultConstant.month.toString(),i=e.zeroCheck(e.isMonthZero,e.isMonthPart,i),2===e.monthTypeCount&&(e.isNavigate=!0,e.monthTypeCount=0);break;case"MMM":i=e.isMonthPart?d[e.maskDateValue.getMonth()+1]:e.defaultConstant.month.toString();break;case"MMMM":i=e.isMonthPart?p[e.maskDateValue.getMonth()+1]:e.defaultConstant.month.toString();break;case"yy":i=e.isYearPart?e.roundOff(e.maskDateValue.getFullYear()%100,2):e.defaultConstant.year.toString(),i=e.zeroCheck(e.isYearZero,e.isYearPart,i);break;case"y":case"yyy":case"yyyy":i=e.isYearPart?e.roundOff(e.maskDateValue.getFullYear(),4):e.defaultConstant.year.toString(),i=e.zeroCheck(e.isYearZero,e.isYearPart,i);break;case"h":i=e.isHourPart?(e.maskDateValue.getHours()%12||12).toString():e.defaultConstant.hour.toString(),2===e.hourTypeCount&&(e.isNavigate=!0,e.hourTypeCount=0);break;case"hh":i=e.isHourPart?e.roundOff(e.maskDateValue.getHours()%12||12,2):e.defaultConstant.hour.toString(),2===e.hourTypeCount&&(e.isNavigate=!0,e.hourTypeCount=0);break;case"H":i=e.isHourPart?e.maskDateValue.getHours().toString():e.defaultConstant.hour.toString(),2===e.hourTypeCount&&(e.isNavigate=!0,e.hourTypeCount=0);break;case"HH":i=e.isHourPart?e.roundOff(e.maskDateValue.getHours(),2):e.defaultConstant.hour.toString(),2===e.hourTypeCount&&(e.isNavigate=!0,e.hourTypeCount=0);break;case"m":i=e.isMinutePart?e.maskDateValue.getMinutes().toString():e.defaultConstant.minute.toString(),2===e.minuteTypeCount&&(e.isNavigate=!0,e.minuteTypeCount=0);break;case"mm":i=e.isMinutePart?e.roundOff(e.maskDateValue.getMinutes(),2):e.defaultConstant.minute.toString(),2===e.minuteTypeCount&&(e.isNavigate=!0,e.minuteTypeCount=0);break;case"s":i=e.isSecondsPart?e.maskDateValue.getSeconds().toString():e.defaultConstant.second.toString(),2===e.secondTypeCount&&(e.isNavigate=!0,e.secondTypeCount=0);break;case"ss":i=e.isSecondsPart?e.roundOff(e.maskDateValue.getSeconds(),2):e.defaultConstant.second.toString(),2===e.secondTypeCount&&(e.isNavigate=!0,e.secondTypeCount=0);break;case"f":i=Math.floor(e.maskDateValue.getMilliseconds()/100).toString();break;case"ff":s=e.maskDateValue.getMilliseconds(),e.maskDateValue.getMilliseconds()>99&&(s=Math.floor(e.maskDateValue.getMilliseconds()/10)),i=e.roundOff(s,2);break;case"fff":i=e.roundOff(e.maskDateValue.getMilliseconds(),3);break;case"a":case"aa":i=e.maskDateValue.getHours()<12?c.am:c.pm;break;case"z":case"zz":case"zzz":case"zzzz":a={format:t,type:"dateTime",skeleton:"yMd",calendar:e.parent.calendarMode},i=e.parent.globalize.formatDate(e.maskDateValue,a)}if(i=void 0!==i?i:t.slice(1,t.length-1),e.isHiddenMask){for(var m="",f=0;f<i.length;f++)m+=t[0];return m}return i}},e.prototype.isValidDate=function(e){var t=new Date(e);return!isNaN(t.getTime())},e.prototype.maskPasteInputHandler=function(){if(this.isValidDate(this.parent.inputElement.value))return this.maskDateValue=new Date(this.parent.inputElement.value),this.isDayPart=this.isMonthPart=this.isYearPart=this.isHourPart=this.isMinutePart=this.isSecondsPart=!0,this.updateValue(),void(this.isBlur||this.validCharacterCheck());this.maskInputHandler()},e.prototype.maskInputHandler=function(){var e=this.parent.inputElement.selectionStart;i.Browser.isDevice&&(i.Browser.isIos||i.Browser.isIos7)&&(e=this.normalizeTokenIndex(e));var t="";-1!==this.validCharacters.indexOf(this.hiddenMask[e])&&(t=this.hiddenMask[e]),this.differenceCheck();var s=this.dateformat.replace(this.formatRegex,this.formatCheck());this.isHiddenMask=!0,this.hiddenMask=this.dateformat.replace(this.formatRegex,this.formatCheck()),this.isDateZero=this.isMonthZero=this.isYearZero=!1,this.isHiddenMask=!1,this.previousHiddenMask=this.hiddenMask,this.previousValue=s,this.parent.inputElement.value=s;for(var a=0;a<this.hiddenMask.length;a++)if(t===this.hiddenMask[a]){e=a;break}var n=null,r=0;if(i.Browser.isDevice&&(i.Browser.isIos||i.Browser.isIos7)){var l=this.findScrollableParent(this.parent.inputElement);l?(n=l,r=l.scrollTop):(n=window,r=window.pageYOffset||document.documentElement.scrollTop||0)}if(this.parent.inputElement.selectionStart=e,this.validCharacterCheck(),(this.isNavigate||this.isDeletion)&&!this.isDeleteKey){var o=!this.isNavigate;this.isNavigate=this.isDeletion=!1,this.navigateSelection(o),i.Browser.isDevice&&(i.Browser.isIos||i.Browser.isIos7)&&setTimeout(function(){n?n.scrollTop=r:window.scrollTo(0,r)},0)}this.isDeleteKey&&(this.isDeletion=!1),this.isDeleteKey=!1},e.prototype.findScrollableParent=function(e){for(;e;){if(this.isScrollable(e))return e;e=e.parentElement}return null},e.prototype.isScrollable=function(e){var t=window.getComputedStyle(e).overflowY;return e.scrollHeight>e.clientHeight&&("auto"===t||"scroll"===t)},e.prototype.navigateSelection=function(e){var t=this.parent.inputElement.selectionStart,i=this.parent.inputElement.selectionEnd,s=e?t-1:i;for(this.navigated=!0;s<this.hiddenMask.length&&s>=0;){if(this.validCharacters.indexOf(this.hiddenMask[s])>=0){this.setSelection(this.hiddenMask[s]);break}s+=e?-1:1}},e.prototype.roundOff=function(e,t){for(var i=e.toString(),s=t-i.length,a="",n=0;n<s;n++)a+="0";return a+i},e.prototype.zeroCheck=function(e,t,i){var s=i;return e&&!t&&(s="0"),s},e.prototype.handleDeletion=function(e,t){switch(e){case"d":this.isDayPart=t;break;case"M":this.isMonthPart=t,t||(this.maskDateValue.setMonth(0),this.monthCharacter="");break;case"y":this.isYearPart=t;break;case"H":case"h":this.isHourPart=t,t||(this.periodCharacter="");break;case"m":this.isMinutePart=t;break;case"s":this.isSecondsPart=t;break;default:return!1}return!0},e.prototype.dateAlteration=function(e){var t=this.parent.inputElement.selectionStart,i="";if(-1!==this.validCharacters.indexOf(this.hiddenMask[t])){i=this.hiddenMask[t];var s=new Date(this.maskDateValue.getFullYear(),this.maskDateValue.getMonth(),this.maskDateValue.getDate(),this.maskDateValue.getHours(),this.maskDateValue.getMinutes(),this.maskDateValue.getSeconds());this.previousDate=new Date(this.maskDateValue.getFullYear(),this.maskDateValue.getMonth(),this.maskDateValue.getDate(),this.maskDateValue.getHours(),this.maskDateValue.getMinutes(),this.maskDateValue.getSeconds());var a=e?-1:1;switch(i){case"d":s.setDate(s.getDate()+a);break;case"M":var n=s.getMonth()+a;if(s.setDate(1),s.setMonth(n),this.isDayPart){var r=new Date(this.previousDate.getFullYear(),this.previousDate.getMonth()+1,0).getDate(),l=new Date(s.getFullYear(),s.getMonth()+1,0).getDate();this.previousDate.getDate()===r&&l<=r?s.setDate(l):s.setDate(this.previousDate.getDate())}else s.setDate(this.previousDate.getDate());this.previousDate=new Date(s.getFullYear(),s.getMonth(),s.getDate());break;case"y":s.setFullYear(s.getFullYear()+a);break;case"H":case"h":s.setHours(s.getHours()+a);break;case"m":s.setMinutes(s.getMinutes()+a);break;case"s":s.setSeconds(s.getSeconds()+a);break;case"a":s.setHours((s.getHours()+12)%24)}this.maskDateValue=s.getFullYear()>0?s:this.maskDateValue,-1!==this.validCharacters.indexOf(this.hiddenMask[t])&&this.handleDeletion(this.hiddenMask[t],!0)}},e.prototype.getCulturedValue=function(e){var t=this.parent.locale;return"en"===t||"en-US"===t?(0,i.getValue)(e,(0,i.getDefaultDateObject)()):(0,i.getValue)("main."+t+".dates.calendars.gregorian."+e,i.cldrData)},e.prototype.getCulturedFormat=function(){var e=this.getCulturedValue("dateTimeFormats[availableFormats].yMd").toString();return"datepicker"===this.parent.moduleName&&(e=this.getCulturedValue("dateTimeFormats[availableFormats].yMd").toString(),this.parent.format&&this.parent.formatString&&(e=this.parent.formatString)),"datetimepicker"===this.parent.moduleName&&(e=this.getCulturedValue("dateTimeFormats[availableFormats].yMd").toString(),this.parent.dateTimeFormat&&(e=this.parent.dateTimeFormat)),"timepicker"===this.parent.moduleName&&(e=this.parent.cldrTimeFormat()),e},e.prototype.clearHandler=function(){this.isDayPart=this.isMonthPart=this.isYearPart=this.isHourPart=this.isMinutePart=this.isSecondsPart=!1,this.updateValue(),this.parent.inputElement&&this.parent.inputElement.value===this.parent.maskedDateValue&&this.parent.inputWrapper&&this.parent.inputWrapper.clearButton&&!this.parent.inputWrapper.clearButton.classList.contains("e-clear-icon-hide")&&this.parent.inputWrapper.clearButton.classList.add("e-clear-icon-hide")},e.prototype.updateValue=function(){this.monthCharacter=this.periodCharacter="";var e=this.dateformat.replace(this.formatRegex,this.formatCheck());this.isHiddenMask=!0,this.hiddenMask=this.dateformat.replace(this.formatRegex,this.formatCheck()),this.isHiddenMask=!1,this.previousHiddenMask=this.hiddenMask,this.previousValue=e,this.parent.updateInputValue(e),!this.parent.strictMode||0===this.dayTypeCount&&0===this.monthTypeCount||(this.isLeadingZero=!1),this.dayTypeCount=0,this.monthTypeCount=0},e.prototype.isMaskToken=function(e){return e>=0&&e<this.hiddenMask.length&&-1!==this.validCharacters.indexOf(this.hiddenMask[e])},e.prototype.normalizeTokenIndex=function(e,t){if(void 0===t&&(t=!1),this.isMaskToken(e))return e;var i=e-1,s=e+1;if(t){if(this.isMaskToken(i))return i;if(this.isMaskToken(s))return s}else{if(this.isMaskToken(s))return s;if(this.isMaskToken(i))return i}return e},e.prototype.destroy=function(){this.removeEventListener()},e}()})(),o})());