@syncfusion/ej2-calendars 25.2.7 → 26.1.35-750253
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +3 -2
- package/dist/ej2-calendars.min.js +2 -2
- package/dist/ej2-calendars.umd.min.js +2 -2
- package/dist/ej2-calendars.umd.min.js.map +1 -1
- package/dist/es6/ej2-calendars.es2015.js +136 -200
- package/dist/es6/ej2-calendars.es2015.js.map +1 -1
- package/dist/es6/ej2-calendars.es5.js +131 -196
- package/dist/es6/ej2-calendars.es5.js.map +1 -1
- package/dist/global/ej2-calendars.min.js +2 -2
- package/dist/global/ej2-calendars.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +11 -11
- package/src/calendar/calendar.d.ts +1 -2
- package/src/calendar/calendar.js +21 -26
- package/src/calendar/islamic.js +8 -7
- package/src/datepicker/datepicker.d.ts +0 -1
- package/src/datepicker/datepicker.js +15 -16
- package/src/daterangepicker/daterangepicker.d.ts +0 -1
- package/src/daterangepicker/daterangepicker.js +25 -26
- package/src/datetimepicker/datetimepicker.js +17 -11
- package/src/maskbase/interface.js +0 -1
- package/src/maskbase/masked-date-time.js +3 -5
- package/src/timepicker/timepicker.d.ts +0 -1
- package/src/timepicker/timepicker.js +7 -11
- package/styles/bootstrap-dark.css +143 -91
- package/styles/bootstrap-dark.scss +20 -5
- package/styles/bootstrap.css +143 -93
- package/styles/bootstrap.scss +20 -5
- package/styles/bootstrap4.css +143 -93
- package/styles/bootstrap4.scss +20 -5
- package/styles/bootstrap5-dark.css +143 -94
- package/styles/bootstrap5-dark.scss +20 -5
- package/styles/bootstrap5.css +143 -94
- package/styles/bootstrap5.scss +20 -5
- package/styles/calendar/_bds-definition.scss +4 -3
- package/styles/calendar/_bootstrap5.3-definition.scss +256 -0
- package/styles/calendar/_fluent2-definition.scss +290 -0
- package/styles/calendar/_layout.scss +34 -14
- package/styles/calendar/_material3-definition.scss +0 -9
- package/styles/calendar/_theme.scss +104 -45
- package/styles/calendar/bootstrap-dark.css +48 -24
- package/styles/calendar/bootstrap.css +48 -24
- package/styles/calendar/bootstrap4.css +48 -24
- package/styles/calendar/bootstrap5-dark.css +48 -24
- package/styles/calendar/bootstrap5.css +48 -24
- package/styles/calendar/fabric-dark.css +51 -25
- package/styles/calendar/fabric.css +51 -25
- package/styles/calendar/fluent-dark.css +67 -33
- package/styles/calendar/fluent.css +67 -33
- package/styles/calendar/fluent2.css +2022 -0
- package/styles/calendar/fluent2.scss +5 -0
- package/styles/calendar/highcontrast-light.css +49 -24
- package/styles/calendar/highcontrast.css +51 -25
- package/styles/calendar/icons/_bootstrap5.3.scss +13 -0
- package/styles/calendar/icons/_fluent2.scss +13 -0
- package/styles/calendar/material-dark.css +51 -25
- package/styles/calendar/material.css +51 -25
- package/styles/calendar/material3-dark.css +52 -23
- package/styles/calendar/material3.css +52 -23
- package/styles/calendar/tailwind-dark.css +49 -25
- package/styles/calendar/tailwind.css +49 -25
- package/styles/datepicker/_bootstrap5.3-definition.scss +107 -0
- package/styles/datepicker/_fluent2-definition.scss +118 -0
- package/styles/datepicker/_layout.scss +20 -11
- package/styles/datepicker/_material3-definition.scss +0 -19
- package/styles/datepicker/bootstrap-dark.css +16 -18
- package/styles/datepicker/bootstrap.css +16 -18
- package/styles/datepicker/bootstrap4.css +16 -18
- package/styles/datepicker/bootstrap5-dark.css +18 -19
- package/styles/datepicker/bootstrap5.css +18 -19
- package/styles/datepicker/fabric-dark.css +16 -18
- package/styles/datepicker/fabric.css +16 -18
- package/styles/datepicker/fluent-dark.css +18 -19
- package/styles/datepicker/fluent.css +18 -19
- package/styles/datepicker/fluent2.css +1680 -0
- package/styles/datepicker/fluent2.scss +7 -0
- package/styles/datepicker/highcontrast-light.css +16 -18
- package/styles/datepicker/highcontrast.css +16 -18
- package/styles/datepicker/icons/_bootstrap5.3.scss +76 -0
- package/styles/datepicker/icons/_fluent2.scss +83 -0
- package/styles/datepicker/material-dark.css +27 -20
- package/styles/datepicker/material.css +41 -22
- package/styles/datepicker/material3-dark.css +46 -24
- package/styles/datepicker/material3.css +46 -24
- package/styles/datepicker/tailwind-dark.css +18 -19
- package/styles/datepicker/tailwind.css +18 -19
- package/styles/daterangepicker/_bds-definition.scss +2 -2
- package/styles/daterangepicker/_bootstrap5.3-definition.scss +296 -0
- package/styles/daterangepicker/_fluent2-definition.scss +309 -0
- package/styles/daterangepicker/_layout.scss +14 -22
- package/styles/daterangepicker/_material3-definition.scss +0 -20
- package/styles/daterangepicker/_theme.scss +16 -8
- package/styles/daterangepicker/bootstrap-dark.css +54 -33
- package/styles/daterangepicker/bootstrap.css +54 -33
- package/styles/daterangepicker/bootstrap4.css +54 -33
- package/styles/daterangepicker/bootstrap5-dark.css +56 -34
- package/styles/daterangepicker/bootstrap5.css +56 -34
- package/styles/daterangepicker/fabric-dark.css +54 -33
- package/styles/daterangepicker/fabric.css +54 -33
- package/styles/daterangepicker/fluent-dark.css +66 -39
- package/styles/daterangepicker/fluent.css +66 -39
- package/styles/daterangepicker/fluent2.css +2465 -0
- package/styles/daterangepicker/fluent2.scss +7 -0
- package/styles/daterangepicker/highcontrast-light.css +54 -33
- package/styles/daterangepicker/highcontrast.css +54 -33
- package/styles/daterangepicker/icons/_bootstrap5.3.scss +92 -0
- package/styles/daterangepicker/icons/_fluent2.scss +132 -0
- package/styles/daterangepicker/material-dark.css +63 -34
- package/styles/daterangepicker/material.css +77 -36
- package/styles/daterangepicker/material3-dark.css +88 -38
- package/styles/daterangepicker/material3.css +88 -38
- package/styles/daterangepicker/tailwind-dark.css +58 -35
- package/styles/daterangepicker/tailwind.css +58 -35
- package/styles/datetimepicker/_bootstrap5.3-definition.scss +65 -0
- package/styles/datetimepicker/_fluent2-definition.scss +65 -0
- package/styles/datetimepicker/_layout.scss +0 -3
- package/styles/datetimepicker/_material3-definition.scss +0 -10
- package/styles/datetimepicker/_theme.scss +2 -2
- package/styles/datetimepicker/bootstrap-dark.css +7 -3
- package/styles/datetimepicker/bootstrap.css +7 -3
- package/styles/datetimepicker/bootstrap4.css +7 -3
- package/styles/datetimepicker/bootstrap5-dark.css +7 -3
- package/styles/datetimepicker/bootstrap5.css +7 -3
- package/styles/datetimepicker/fabric-dark.css +7 -3
- package/styles/datetimepicker/fabric.css +7 -3
- package/styles/datetimepicker/fluent-dark.css +7 -3
- package/styles/datetimepicker/fluent.css +7 -3
- package/styles/datetimepicker/fluent2.css +1408 -0
- package/styles/datetimepicker/fluent2.scss +8 -0
- package/styles/datetimepicker/highcontrast-light.css +7 -3
- package/styles/datetimepicker/highcontrast.css +7 -3
- package/styles/datetimepicker/icons/_bootstrap5.3.scss +11 -0
- package/styles/datetimepicker/icons/_fluent2.scss +11 -0
- package/styles/datetimepicker/material-dark.css +16 -4
- package/styles/datetimepicker/material.css +30 -6
- package/styles/datetimepicker/material3-dark.css +33 -7
- package/styles/datetimepicker/material3.css +33 -7
- package/styles/datetimepicker/tailwind-dark.css +7 -3
- package/styles/datetimepicker/tailwind.css +7 -3
- package/styles/fabric-dark.css +146 -92
- package/styles/fabric-dark.scss +20 -5
- package/styles/fabric.css +146 -94
- package/styles/fabric.scss +20 -5
- package/styles/fluent-dark.css +172 -108
- package/styles/fluent-dark.scss +20 -5
- package/styles/fluent.css +172 -108
- package/styles/fluent.scss +20 -5
- package/styles/fluent2.css +4429 -0
- package/styles/fluent2.scss +20 -0
- package/styles/highcontrast-light.css +144 -91
- package/styles/highcontrast-light.scss +20 -5
- package/styles/highcontrast.css +146 -94
- package/styles/highcontrast.scss +20 -5
- package/styles/material-dark.css +157 -112
- package/styles/material-dark.scss +20 -5
- package/styles/material.css +171 -140
- package/styles/material.scss +20 -5
- package/styles/material3-dark.css +189 -139
- package/styles/material3-dark.scss +20 -5
- package/styles/material3.css +189 -139
- package/styles/material3.scss +20 -5
- package/styles/tailwind-dark.css +146 -96
- package/styles/tailwind-dark.scss +20 -5
- package/styles/tailwind.css +146 -96
- package/styles/tailwind.scss +20 -5
- package/styles/timepicker/_bootstrap5.3-definition.scss +85 -0
- package/styles/timepicker/_fluent2-definition.scss +84 -0
- package/styles/timepicker/_layout.scss +2 -16
- package/styles/timepicker/_material3-definition.scss +0 -16
- package/styles/timepicker/_theme.scss +1 -4
- package/styles/timepicker/bootstrap-dark.css +18 -10
- package/styles/timepicker/bootstrap.css +18 -10
- package/styles/timepicker/bootstrap4.css +18 -10
- package/styles/timepicker/bootstrap5-dark.css +18 -10
- package/styles/timepicker/bootstrap5.css +18 -10
- package/styles/timepicker/fabric-dark.css +18 -10
- package/styles/timepicker/fabric.css +18 -10
- package/styles/timepicker/fluent-dark.css +18 -10
- package/styles/timepicker/fluent.css +18 -10
- package/styles/timepicker/fluent2.css +1531 -0
- package/styles/timepicker/fluent2.scss +6 -0
- package/styles/timepicker/highcontrast-light.css +18 -10
- package/styles/timepicker/highcontrast.css +18 -10
- package/styles/timepicker/icons/_bootstrap5.3.scss +24 -0
- package/styles/timepicker/icons/_fluent2.scss +24 -0
- package/styles/timepicker/material-dark.css +27 -11
- package/styles/timepicker/material.css +41 -13
- package/styles/timepicker/material3-dark.css +45 -14
- package/styles/timepicker/material3.css +45 -14
- package/styles/timepicker/tailwind-dark.css +18 -10
- package/styles/timepicker/tailwind.css +18 -10
- package/CHANGELOG.md +0 -1232
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: ej2-calendars.min.js
|
|
3
|
-
* version :
|
|
3
|
+
* version : 26.1.35
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
7
|
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
8
|
* applicable laws.
|
|
9
9
|
*/
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("SyncfusionBase"),require("SyncfusionInputs"),require("SyncfusionPopups"),require("SyncfusionLists"),require("SyncfusionButtons")):"function"==typeof define&&define.amd?define(["SyncfusionBase","SyncfusionInputs","SyncfusionPopups","SyncfusionLists","SyncfusionButtons"],t):"object"==typeof exports?exports.SyncfusionCalendars=t(require("SyncfusionBase"),require("SyncfusionInputs"),require("SyncfusionPopups"),require("SyncfusionLists"),require("SyncfusionButtons")):e.SyncfusionCalendars=t(e.SyncfusionBase,e.SyncfusionInputs,e.SyncfusionPopups,e.SyncfusionLists,e.SyncfusionButtons)}(this,function(e,t,i,s,a){return function(e){function t(s){if(i[s])return i[s].exports;var a=i[s]={i:s,l:!1,exports:{}};return e[s].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var i={};return t.m=e,t.c=i,t.i=function(e){return e},t.d=function(e,i,s){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:s})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=16)}([function(t,i){t.exports=e},function(e,i){e.exports=t},function(e,t){e.exports=i},function(e,t,i){"use strict";i.d(t,"b",function(){return m}),i.d(t,"a",function(){return f});var s=i(0),a=(i.n(s),this&&this.__extends||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])})(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)}}()),n=this&&this.__decorate||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},r="e-other-month",l="e-calendar",o="e-calendar-content-table",h="e-disabled",u="e-overlay",d="e-selected",p="e-focused-date",c="e-focused-cell",m=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.isAngular=!1,s.previousDates=!1,s}return a(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(1944,2,18)),+this.max==+new Date(2099,11,31)&&(this.max=new Date(2069,10,16))),this.globalize=new s.Internationalization(this.locale),(i.i(s.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(l),this.enableRtl&&this.element.classList.add("e-rtl"),s.Browser.isDevice&&this.element.classList.add("e-device"),i.i(s.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(l),this.enableRtl&&this.calendarElement.classList.add("e-rtl"),s.Browser.isDevice&&this.calendarElement.classList.add("e-device"),i.i(s.attributes)(this.calendarElement,{"data-role":"calendar"})),!i.i(s.isNullOrUndefined)(i.i(s.closest)(this.element,"fieldset"))&&i.i(s.closest)(this.element,"fieldset").disabled&&(this.enabled=!1),this.createHeader(),this.createContent(),this.wireEvents()},t.prototype.rangeValidation=function(e,t){i.i(s.isNullOrUndefined)(e)&&this.setProperties({min:new Date(1900,0,1)},!0),i.i(s.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)),!i.i(s.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,a,n){if(n&&!i.i(s.isNullOrUndefined)(t)&&!i.i(s.isNullOrUndefined)(a)&&!i.i(s.isNullOrUndefined)(e)){var r=parseInt(t.style.zIndex,10)?parseInt(t.style.zIndex,10):1e3;a.style.zIndex=(r-1).toString(),e.style.zIndex=r.toString()}},t.prototype.minMaxUpdate=function(e){+this.min<=+this.max?i.i(s.removeClass)([this.element],u):(this.setProperties({min:this.min},!0),i.i(s.addClass)([this.element],u)),this.min=i.i(s.isNullOrUndefined)(this.min)||!+this.min?this.min=new Date(1900,0,1):this.min,this.max=i.i(s.isNullOrUndefined)(this.max)||!+this.max?this.max=new Date(2099,11,31):this.max,+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={"aria-disabled":"false","aria-label":"previous month"},t={"aria-disabled":"false","aria-label":"next month"},a={"aria-atomic":"true","aria-live":"assertive","aria-label":"title"},n={tabindex:"0"};this.headerElement=this.createElement("div",{className:"e-header"});var r=this.createElement("div",{className:"e-icon-container"});this.previousIcon=this.createElement("button",{className:"e-prev",attrs:{type:"button"}}),i.i(s.rippleEffect)(this.previousIcon,{duration:400,selector:".e-prev",isCenterRipple:!0}),i.i(s.attributes)(this.previousIcon,e),i.i(s.attributes)(this.previousIcon,n),this.nextIcon=this.createElement("button",{className:"e-next",attrs:{type:"button"}}),i.i(s.rippleEffect)(this.nextIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),"daterangepicker"===this.getModuleName()&&(i.i(s.attributes)(this.previousIcon,{tabIndex:"-1"}),i.i(s.attributes)(this.nextIcon,{tabIndex:"-1"})),i.i(s.attributes)(this.nextIcon,t),i.i(s.attributes)(this.nextIcon,n),this.headerTitleElement=this.createElement("div",{className:"e-day e-title"}),i.i(s.attributes)(this.headerTitleElement,a),i.i(s.attributes)(this.headerTitleElement,n),this.headerElement.appendChild(this.headerTitleElement),this.previousIcon.appendChild(this.createElement("span",{className:"e-date-icon-prev e-icons"})),this.nextIcon.appendChild(this.createElement("span",{className:"e-date-icon-next e-icons"})),r.appendChild(this.previousIcon),r.appendChild(this.nextIcon),this.headerElement.appendChild(r),"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:o,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()&&(s.EventHandler.add(this.table,"focus",this.addContentFocus,this),s.EventHandler.add(this.table,"blur",this.removeContentFocus,this))},t.prototype.addContentFocus=function(e){var t=this.tableBodyElement.querySelector("tr td.e-focused-date"),a=this.tableBodyElement.querySelector("tr td.e-selected");i.i(s.isNullOrUndefined)(a)?i.i(s.isNullOrUndefined)(t)||t.classList.add(c):a.classList.add(c)},t.prototype.removeContentFocus=function(e){var t=i.i(s.isNullOrUndefined)(this.tableBodyElement)?null:this.tableBodyElement.querySelector("tr td.e-focused-date"),a=i.i(s.isNullOrUndefined)(this.tableBodyElement)?null:this.tableBodyElement.querySelector("tr td.e-selected");i.i(s.isNullOrUndefined)(a)?i.i(s.isNullOrUndefined)(t)||t.classList.remove(c):a.classList.remove(c)},t.prototype.getCultureValues=function(){var e,t=[],a="days.stand-alone."+this.dayHeaderFormat.toLowerCase();if(e="en"===this.locale||"en-US"===this.locale?i.i(s.getValue)(a,i.i(s.getDefaultDateObject)()):this.getCultureObjects(s.cldrData,""+this.locale),!i.i(s.isNullOrUndefined)(e))for(var n=0,r=Object.keys(e);n<r.length;n++){var l=r[n];t.push(i.i(s.getValue)(l,e))}return t},t.prototype.toCapitalize=function(e){return!i.i(s.isNullOrUndefined)(e)&&e.length?e[0].toUpperCase()+e.slice(1):e},t.prototype.createContentHeader=function(){"calendar"===this.getModuleName()?i.i(s.isNullOrUndefined)(this.element.querySelectorAll(".e-content .e-week-header")[0])||i.i(s.detach)(this.element.querySelectorAll(".e-content .e-week-header")[0]):i.i(s.isNullOrUndefined)(this.calendarElement.querySelectorAll(".e-content .e-week-header")[0])||i.i(s.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()?i.i(s.addClass)([this.element],"e-week-number"):i.i(s.addClass)([this.calendarElement],"e-week-number"));var t=this.getCultureValues().length>0&&this.getCultureValues()?this.shiftArray(this.getCultureValues().length>0&&this.getCultureValues(),this.firstDayOfWeek):null;if(!i.i(s.isNullOrUndefined)(t))for(var a=0;a<=6;a++)e+='<th class="">'+this.toCapitalize(t[a])+"</th>";e="<tr>"+e+"</tr>",this.tableHeadElement.innerHTML=e,this.table.appendChild(this.tableHeadElement)},t.prototype.createContentBody=function(){switch("calendar"===this.getModuleName()?i.i(s.isNullOrUndefined)(this.element.querySelectorAll(".e-content tbody")[0])||i.i(s.detach)(this.element.querySelectorAll(".e-content tbody")[0]):i.i(s.isNullOrUndefined)(this.calendarElement.querySelectorAll(".e-content tbody")[0])||i.i(s.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),a={today:"Today"};this.globalize=new s.Internationalization(this.locale),this.l10=new s.L10n(this.getModuleName(),a,this.locale),this.todayElement=this.createElement("button",{attrs:{role:"button"}}),i.i(s.rippleEffect)(this.todayElement),this.updateFooter(),i.i(s.addClass)([this.todayElement],["e-btn","e-today","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||i.i(s.addClass)([this.todayElement],h),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(h)||s.EventHandler.add(this.todayElement,"click",this.todayButtonClick,this)}},t.prototype.wireEvents=function(e,t,a,n){s.EventHandler.add(this.headerTitleElement,"click",this.navigateTitle,this),this.defaultKeyConfigs=i.i(s.extend)(this.defaultKeyConfigs,this.keyConfigs),"calendar"===this.getModuleName()?this.keyboardModule=new s.KeyboardEvents(this.element,{eventName:"keydown",keyAction:this.keyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs}):this.keyboardModule=new s.KeyboardEvents(this.calendarElement,{eventName:"keydown",keyAction:this.keyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})},t.prototype.dateWireEvents=function(e,t,a,n){this.defaultKeyConfigs=this.getDefaultKeyConfig(),this.defaultKeyConfigs=i.i(s.extend)(this.defaultKeyConfigs,a),this.serverModuleName=n},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&&i.i(s.detach)(this.calendarElement),this.tableBodyElement&&i.i(s.detach)(this.tableBodyElement),this.table&&i.i(s.detach)(this.table),this.tableHeadElement&&i.i(s.detach)(this.tableHeadElement),this.nextIcon&&i.i(s.detach)(this.nextIcon),this.previousIcon&&i.i(s.detach)(this.previousIcon),this.footer&&i.i(s.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,a){if(null!==this.calendarElement||"escape"!==e.action){var n,r=this.tableBodyElement.querySelector("tr td.e-focused-date");n=a?i.i(s.isNullOrUndefined)(r)||+t!==parseInt(r.getAttribute("id").split("_")[0],10)?this.tableBodyElement.querySelector("tr td.e-selected"):r:this.tableBodyElement.querySelector("tr td.e-selected");var l=this.getViewNumber(this.currentView()),u=this.getViewNumber(this.depth),d=l===u&&this.getViewNumber(this.start)>=u;switch(this.effect="",e.action){case"moveLeft":"daterangepicker"!=this.getModuleName()&&!i.i(s.isNullOrUndefined)(e.target)&&e.target.classList.length>0&&e.target.classList.contains(o)&&(this.keyboardNavigate(-1,l,e,this.max,this.min),e.preventDefault());break;case"moveRight":"daterangepicker"!=this.getModuleName()&&!i.i(s.isNullOrUndefined)(e.target)&&e.target.classList.length>0&&e.target.classList.contains(o)&&(this.keyboardNavigate(1,l,e,this.max,this.min),e.preventDefault());break;case"moveUp":"daterangepicker"!=this.getModuleName()&&!i.i(s.isNullOrUndefined)(e.target)&&e.target.classList.length>0&&e.target.classList.contains(o)&&(0===l?this.keyboardNavigate(-7,l,e,this.max,this.min):this.keyboardNavigate(-4,l,e,this.max,this.min),e.preventDefault());break;case"moveDown":"daterangepicker"!=this.getModuleName()&&!i.i(s.isNullOrUndefined)(e.target)&&e.target.classList.length>0&&e.target.classList.contains(o)&&(0===l?this.keyboardNavigate(7,l,e,this.max,this.min):this.keyboardNavigate(4,l,e,this.max,this.min),e.preventDefault());break;case"select":if(e.target===this.headerTitleElement)this.navigateTitle(e);else if(e.target===this.previousIcon)this.navigatePrevious(e);else if(e.target===this.nextIcon)this.navigateNext(e);else if(e.target===this.todayElement)this.todayButtonClick(e,t),"datepicker"!==this.getModuleName()&&"datetimepicker"!==this.getModuleName()||this.element.focus();else{var p=i.i(s.isNullOrUndefined)(r)?n:r;if(!i.i(s.isNullOrUndefined)(p)&&!p.classList.contains(h)){if(d){var c=new Date(parseInt(""+p.id,0));this.selectDate(e,c,p)}else this.contentClick(null,--l,p,t);"datepicker"!==this.getModuleName()&&"datetimepicker"!==this.getModuleName()||this.element.focus()}}break;case"controlUp":this.title(),e.preventDefault();break;case"controlDown":(i.i(s.isNullOrUndefined)(r)||d)&&(i.i(s.isNullOrUndefined)(n)||d)||this.contentClick(null,--l,r||n,t),e.preventDefault();break;case"home":this.currentDate=this.firstDay(this.currentDate),i.i(s.detach)(this.tableBodyElement),0===l?this.renderMonths(e):1===l?this.renderYears(e):this.renderDecades(e),e.preventDefault();break;case"end":this.currentDate=this.lastDay(this.currentDate,l),i.i(s.detach)(this.tableBodyElement),0===l?this.renderMonths(e):1===l?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.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,a,n,r){var l=new Date(this.checkValue(this.currentDate));switch(t){case 2:this.addYears(this.currentDate,e),this.isMonthYearRange(this.currentDate)?(i.i(s.detach)(this.tableBodyElement),this.renderDecades(a)):this.currentDate=l;break;case 1:this.addMonths(this.currentDate,e),this.calendarMode,this.isMonthYearRange(this.currentDate)?(i.i(s.detach)(this.tableBodyElement),this.renderYears(a)):this.currentDate=l;break;case 0:this.addDay(this.currentDate,e,a,n,r),this.isMinMaxRange(this.currentDate)?(i.i(s.detach)(this.tableBodyElement),this.renderMonths(a)):this.currentDate=l}},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,i){var s,a=this.weekNumber?8:7;s="Gregorian"===this.calendarMode?this.renderDays(this.currentDate,t,null,null,i,e):this.islamicModule.islamicRenderDays(this.currentDate,t),this.createContentHeader(),"Gregorian"===this.calendarMode?this.renderTemplate(s,a,"e-month",e,t):this.islamicModule.islamicRenderTemplate(s,a,"e-month",e,t)},t.prototype.renderDays=function(e,t,a,n,l,o){var p,c=[],m=l?new Date(+e):this.getDate(new Date,this.timezone),f=new Date(this.checkValue(e)),v=f.getMonth();this.titleUpdate(e,"days");var y=f;for(f=new Date(y.getFullYear(),y.getMonth(),0,y.getHours(),y.getMinutes(),y.getSeconds(),y.getMilliseconds());f.getDay()!==this.firstDayOfWeek;)this.setStartDate(f,-864e5);for(var g=0;g<42;++g){var b=this.createElement("td",{className:"e-cell"}),D=this.createElement("span");if(g%7==0&&this.weekNumber){var E="FirstDay"===this.weekRule?6:"FirstFourDayWeek"===this.weekRule?3:0,C=new Date(f.getFullYear(),f.getMonth(),f.getDate()+E);D.textContent=""+this.getWeek(C),b.appendChild(D),i.i(s.addClass)([b],"e-week-number"),c.push(b)}p=new Date(+f),f=this.minMaxDate(f);var k={type:"dateTime",skeleton:"full"},w=this.globalize.parseDate(this.globalize.formatDate(f,k),k),M=this.dayCell(f),V=this.globalize.formatDate(f,{type:"date",skeleton:"full"}),N=this.createElement("span");N.textContent=this.globalize.formatDate(f,{format:"d",type:"date",skeleton:"yMd"});var O=this.min>f||this.max<f;O?(i.i(s.addClass)([M],h),i.i(s.addClass)([M],u)):N.setAttribute("title",""+V),v!==f.getMonth()&&(i.i(s.addClass)([M],r),N.setAttribute("aria-disabled","true")),0!==f.getDay()&&6!==f.getDay()||i.i(s.addClass)([M],"e-weekend"),M.appendChild(N),this.renderDayCellArgs={date:f,isDisabled:!1,element:M,isOutOfRange:O};var I=this.renderDayCellArgs;if(this.renderDayCellEvent(I),I.isDisabled){var T=new Date(this.checkValue(t)),x=new Date(this.checkValue(I.date));if(a){if(!i.i(s.isNullOrUndefined)(n)&&n.length>0)for(var S=0;S<n.length;S++){var P=+new Date(this.globalize.formatDate(I.date,{type:"date",skeleton:"yMd"})),A=+new Date(this.globalize.formatDate(n[S],{type:"date",skeleton:"yMd"}));P===A&&(n.splice(S,1),S=-1)}}else T&&+T==+x&&this.setProperties({value:null},!0)}this.renderDayCellArgs.isDisabled&&!M.classList.contains(d)&&(i.i(s.addClass)([M],h),i.i(s.addClass)([M],u),N.setAttribute("aria-disabled","true"),+this.renderDayCellArgs.date==+this.todayDate&&(this.todayDisabled=!0));var U=M.classList.contains(r),H=M.classList.contains(h);H||s.EventHandler.add(M,"click",this.clickHandler,this);var W=void 0;if(i.i(s.isNullOrUndefined)(o)||"click"!==o.type||(W=o.currentTarget),!a||i.i(s.isNullOrUndefined)(n)||H)!H&&this.getDateVal(f,t)&&i.i(s.addClass)([M],d);else{for(var L=0;L<n.length;L++){var F="Gregorian"===this.calendarMode?"gregorian":"islamic",B={format:null,type:"date",skeleton:"short",calendar:F},P=this.globalize.formatDate(f,B),A=this.globalize.formatDate(n[L],B);if((P===A&&this.getDateVal(f,n[L])||this.getDateVal(f,t))&&i.i(s.addClass)([M],d),!i.i(s.isNullOrUndefined)(W)&&W.innerText===M.innerText&&this.previousDates&&M.classList.contains(d)&&W.classList.contains(d)){i.i(s.removeClass)([M],d),this.previousDates=!1;for(var j=this.copyValues(n),R=0;R<j.length;R++){var Y="Gregorian"===this.calendarMode?"gregorian":"islamic",z={format:null,type:"date",skeleton:"short",calendar:Y};if(this.globalize.formatDate(w,z)===this.globalize.formatDate(j[R],z)){var S=j.indexOf(j[R]);j.splice(S,1),n.splice(S,1)}}this.setProperties({values:j},!0)}else this.updateFocus(U,H,f,M,e)}n.length<=0&&this.updateFocus(U,H,f,M,e)}this.updateFocus(U,H,f,M,e),i.i(s.isNullOrUndefined)(w)||w.getFullYear()!==m.getFullYear()||w.getMonth()!==m.getMonth()||w.getDate()!==m.getDate()||i.i(s.addClass)([M],"e-today"),c.push(this.renderDayCellArgs.element),f=new Date(+p),this.addDay(f,1,null,this.max,this.min)}return c},t.prototype.updateFocus=function(e,t,a,n,r){r.getDate()!==a.getDate()||e||t?(r>=this.max&&parseInt(n.id,0)===+this.max&&!e&&!t&&i.i(s.addClass)([n],p),r<=this.min&&parseInt(n.id,0)===+this.min&&!e&&!t&&i.i(s.addClass)([n],p)):i.i(s.addClass)([n],p)},t.prototype.renderYears=function(e,t){this.removeTableHeadElement();var a=[],n=i.i(s.isNullOrUndefined)(t),r=new Date(this.checkValue(this.currentDate)),l=r.getMonth(),o=r.getFullYear(),u=r,c=u.getFullYear(),m=new Date(this.checkValue(this.min)).getFullYear(),f=new Date(this.checkValue(this.min)).getMonth(),v=new Date(this.checkValue(this.max)).getFullYear(),y=new Date(this.checkValue(this.max)).getMonth();u.setMonth(0),this.titleUpdate(this.currentDate,"months"),u.setDate(1);for(var g=0;g<12;++g){var b=this.dayCell(u),D=this.createElement("span"),E=t&&t.getMonth()===u.getMonth(),C=t&&t.getFullYear()===o&&E,k=this.globalize.formatDate(u,{type:"date",format:"MMM y"});D.textContent=this.toCapitalize(this.globalize.formatDate(u,{format:null,type:"dateTime",skeleton:"MMM"})),this.min&&(c<m||g<f&&c===m)||this.max&&(c>v||g>y&&c>=v)?i.i(s.addClass)([b],h):!n&&C?i.i(s.addClass)([b],d):u.getMonth()===l&&this.currentDate.getMonth()===l&&i.i(s.addClass)([b],p),u.setDate(1),u.setMonth(u.getMonth()+1),b.classList.contains(h)||(s.EventHandler.add(b,"click",this.clickHandler,this),D.setAttribute("title",""+k)),b.appendChild(D),a.push(b)}this.renderTemplate(a,4,"e-year",e,t)},t.prototype.renderDecades=function(e,t){this.removeTableHeadElement();var a=[],n=new Date(this.checkValue(this.currentDate));n.setMonth(0),n.setDate(1);var r=n.getFullYear(),l=new Date(n.setFullYear(r-r%10)),o=new Date(n.setFullYear(r-r%10+9)),u=l.getFullYear(),c=o.getFullYear(),m=this.globalize.formatDate(l,{format:null,type:"dateTime",skeleton:"y"}),f=this.globalize.formatDate(o,{format:null,type:"dateTime",skeleton:"y"});this.headerTitleElement.textContent=m+" - "+f;for(var v=new Date(r-r%10-1,0,1),y=v.getFullYear(),g=0;g<12;++g){var b=y+g;n.setFullYear(b);var D=this.dayCell(n),E=this.createElement("span");E.textContent=this.globalize.formatDate(n,{format:null,type:"dateTime",skeleton:"y"}),b<u||b>c?(i.i(s.addClass)([D],"e-other-year"),E.setAttribute("aria-disabled","true"),i.i(s.isNullOrUndefined)(t)||n.getFullYear()!==t.getFullYear()||i.i(s.addClass)([D],d),(b<new Date(this.checkValue(this.min)).getFullYear()||b>new Date(this.checkValue(this.max)).getFullYear())&&i.i(s.addClass)([D],h)):b<new Date(this.checkValue(this.min)).getFullYear()||b>new Date(this.checkValue(this.max)).getFullYear()?i.i(s.addClass)([D],h):i.i(s.isNullOrUndefined)(t)||n.getFullYear()!==t.getFullYear()?n.getFullYear()!==this.currentDate.getFullYear()||D.classList.contains(h)||i.i(s.addClass)([D],p):i.i(s.addClass)([D],d),D.classList.contains(h)||(s.EventHandler.add(D,"click",this.clickHandler,this),E.setAttribute("title",""+E.textContent)),D.appendChild(E),a.push(D)}this.renderTemplate(a,4,"e-decade",e,t)},t.prototype.dayCell=function(e){var t,a="Gregorian"===this.calendarMode?"gregorian":"islamic",n={skeleton:"full",type:"dateTime",calendar:a},r=this.globalize.parseDate(this.globalize.formatDate(e,n),n);i.i(s.isNullOrUndefined)(r)||(t=r.valueOf());var l={className:"e-cell",attrs:{id:""+i.i(s.getUniqueID)(""+t),"aria-selected":"false"}};return this.createElement("td",l)},t.prototype.firstDay=function(e){var t="Decade"!==this.currentView()?this.tableBodyElement.querySelectorAll("td:not(."+r):this.tableBodyElement.querySelectorAll("td:not(.e-other-year");if(t.length)for(var i=0;i<t.length;i++)if(!t[i].classList.contains(h)){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!i.i(s.isNullOrUndefined)(e)&&e instanceof Date&&!isNaN(+e)?e:null},t.prototype.findLastDay=function(e){var t="Decade"===this.currentView()?this.tableBodyElement.querySelectorAll("td:not(.e-other-year"):this.tableBodyElement.querySelectorAll("td:not(."+r);if(t.length)for(var i=t.length-1;i>=0;i--)if(!t[i].classList.contains(h)){e=new Date(parseInt(t[i].id,0));break}return e},t.prototype.removeTableHeadElement=function(){"calendar"===this.getModuleName()?i.i(s.isNullOrUndefined)(this.element.querySelectorAll(".e-content table thead")[0])||i.i(s.detach)(this.tableHeadElement):i.i(s.isNullOrUndefined)(this.calendarElement.querySelectorAll(".e-content table thead")[0])||i.i(s.detach)(this.tableHeadElement)},t.prototype.renderTemplate=function(e,t,a,n,l){var o,h=this.getViewNumber(this.currentView());this.tableBodyElement=this.createElement("tbody"),this.table.appendChild(this.tableBodyElement),i.i(s.removeClass)([this.contentElement,this.headerElement],["e-month","e-decade","e-year"]),i.i(s.addClass)([this.contentElement,this.headerElement],[a]);for(var u=t,d=0,p=0;p<e.length/t;++p){for(o=this.createElement("tr"),d=0+d;d<u;d++)e[d].classList.contains("e-week-number")||i.i(s.isNullOrUndefined)(e[d].children[0])||(i.i(s.addClass)([e[d].children[0]],["e-day"]),i.i(s.rippleEffect)(e[d].children[0],{duration:600,isCenterRipple:!0})),o.appendChild(e[d]),this.weekNumber&&7===d&&e[7].classList.contains(r)&&i.i(s.addClass)([o],"e-month-hide"),!this.weekNumber&&6===d&&e[6].classList.contains(r)&&i.i(s.addClass)([o],"e-month-hide"),this.weekNumber?41===d&&e[41].classList.contains(r)&&i.i(s.addClass)([o],"e-month-hide"):35===d&&e[35].classList.contains(r)&&i.i(s.addClass)([o],"e-month-hide");u+=t,d+=0,this.tableBodyElement.appendChild(o)}this.table.querySelector("tbody").className=this.effect,"Gregorian"===this.calendarMode?this.iconHandler():this.islamicModule.islamicIconHandler(),(h!==this.getViewNumber(this.currentView())||0===h&&h!==this.getViewNumber(this.currentView()))&&this.navigateHandler(n),this.setAriaActiveDescendant()},t.prototype.clickHandler=function(e,t){this.clickEventEmitter(e);var i=e.currentTarget,s=this.getViewNumber(this.currentView());i.classList.contains(r)?this.contentClick(e,0,null,t):s===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth)?this.contentClick(e,1,null,t):2===s?this.contentClick(e,1,null,t):i.classList.contains(r)||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,a,n){var r=this.getViewNumber(this.currentView()),l=this.getIdValue(e,a);switch(t){case 0:r===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth)?(i.i(s.detach)(this.tableBodyElement),this.currentDate=l,this.effect="e-zoomin",this.renderMonths(e)):("Gregorian"===this.calendarMode?(this.currentDate.setMonth(l.getMonth()),l.getMonth()>0&&this.currentDate.getMonth()!==l.getMonth()&&this.currentDate.setDate(0),this.currentDate.setFullYear(l.getFullYear())):this.currentDate=l,this.effect="e-zoomin",i.i(s.detach)(this.tableBodyElement),this.renderMonths(e));break;case 1:if(r===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth))this.selectDate(e,l,null);else{if("Gregorian"===this.calendarMode)this.currentDate.setFullYear(l.getFullYear());else{this.islamicPreviousHeader=this.headerElement.textContent;var o=this.islamicModule.getIslamicDate(l);this.currentDate=this.islamicModule.toGregorian(o.year,o.month,1)}this.effect="e-zoomin",i.i(s.detach)(this.tableBodyElement),this.renderYears(e)}}},t.prototype.switchView=function(e,t,a,n){switch(e){case 0:i.i(s.detach)(this.tableBodyElement),this.renderMonths(t,null,n);break;case 1:i.i(s.detach)(this.tableBodyElement),this.renderYears(t);break;case 2:i.i(s.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(){var e=["value"];return this.addOnPersist(e)},t.prototype.onPropertyChanged=function(e,t,a,n){this.effect="";for(var r=0,l=Object.keys(e);r<l.length;r++){var o=l[r];switch(o){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.createContentHeader():this.calendarElement&&this.createContentHeader(),this.adjustLongHeaderSize();break;case"min":case"max":this.rangeValidation(this.min,this.max),"min"===o?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&&i.i(s.detach)(this.tableBodyElement),this.minMaxUpdate(),a&&this.validateValues(a,n),"datepicker"!==this.getModuleName()?this.createContentBody():this.calendarElement&&this.createContentBody(),(this.todayDate<this.min||this.max<this.todayDate)&&this.footer&&this.todayElement?(i.i(s.detach)(this.todayElement),i.i(s.detach)(this.footer),this.todayElement=this.footer=null,this.createContentFooter()):this.footer&&this.todayElement&&this.todayElement.classList.contains("e-disabled")&&(i.i(s.removeClass)([this.todayElement],h),i.i(s.detach)(this.todayElement),i.i(s.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.createContentHeader(),this.createContentBody()):this.calendarElement&&(this.createContentHeader(),this.createContentBody());break;case"locale":if(this.globalize=new s.Internationalization(this.locale),"datepicker"!==this.getModuleName()?(this.createContentHeader(),this.createContentBody()):this.calendarElement&&(this.createContentHeader(),this.createContentBody()),"calendar"===this.getModuleName()){var u={today:"Today"};this.l10=new s.L10n(this.getModuleName(),u,this.locale)}this.l10.setLocale(this.locale),this.showTodayButton&&this.updateFooter();break;case"showTodayButton":e.showTodayButton?this.createContentFooter():i.i(s.isNullOrUndefined)(this.todayElement)||i.i(s.isNullOrUndefined)(this.footer)||(i.i(s.detach)(this.todayElement),i.i(s.detach)(this.footer),this.todayElement=this.footer=void 0),this.setProperties({showTodayButton:e.showTodayButton},!0)}}},t.prototype.validateValues=function(e,t){if(e&&!i.i(s.isNullOrUndefined)(t)&&t.length>0){for(var a=this.copyValues(t),n=0;n<a.length;n++){var r=a[n],l="Gregorian"===this.calendarMode?"gregorian":"islamic",o=void 0;o="Gregorian"===this.calendarMode?this.globalize.formatDate(r,{type:"date",skeleton:"yMd"}):this.globalize.formatDate(r,{type:"dateTime",skeleton:"full",calendar:"islamic"});var h={type:"date",skeleton:"yMd",calendar:l},u=this.globalize.formatDate(this.min,h),d=u,p={type:"date",skeleton:"yMd",calendar:l},c=this.globalize.formatDate(this.max,p),m=c;(+new Date(o)<+new Date(d)||+new Date(o)>+new Date(m))&&(a.splice(n,1),n=-1)}this.setProperties({values:a},!0)}},t.prototype.setValueUpdate=function(){i.i(s.isNullOrUndefined)(this.tableBodyElement)||(i.i(s.detach)(this.tableBodyElement),this.setProperties({start:this.currentView()},!0),this.createContentBody())},t.prototype.copyValues=function(e){var t=[];if(!i.i(s.isNullOrUndefined)(e)&&e.length>0)for(var a=0;a<e.length;a++)t.push(new Date(+e[a]));return t},t.prototype.titleUpdate=function(e,t){var i,a,n=new s.Internationalization(this.locale),r="Gregorian"===this.calendarMode?"gregorian":"islamic";switch("Gregorian"===this.calendarMode?(i=n.formatDate(e,{type:"dateTime",skeleton:"yMMMM",calendar:r}),a=n.formatDate(e,{format:null,type:"dateTime",skeleton:"y",calendar:r})):(i=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(i);break;case"months":this.headerTitleElement.textContent=a}},t.prototype.setActiveDescendant=function(){var e,t,a=this.tableBodyElement.querySelector("tr td.e-focused-date"),n=this.tableBodyElement.querySelector("tr td.e-selected"),r="Gregorian"===this.calendarMode?"gregorian":"islamic",l=this.currentView();return t="Month"===l?this.globalize.formatDate(this.currentDate,{type:"date",skeleton:"full",calendar:r}):"Year"===l?"islamic"!==r?this.globalize.formatDate(this.currentDate,{type:"date",skeleton:"yMMMM",calendar:r}):this.globalize.formatDate(this.currentDate,{type:"date",skeleton:"GyMMM",calendar:r}):this.globalize.formatDate(this.currentDate,{format:null,type:"date",skeleton:"y",calendar:r}),(n||a)&&(i.i(s.isNullOrUndefined)(n)||n.setAttribute("aria-selected","true"),(a||n).setAttribute("aria-label",t),e=(a||n).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?i.i(s.removeClass)([this.element],[l]):this.calendarElement&&this.element&&i.i(s.removeClass)([this.element],[l]),"calendar"===this.getModuleName()&&this.element&&(i.i(s.isNullOrUndefined)(this.headerTitleElement)||s.EventHandler.remove(this.headerTitleElement,"click",this.navigateTitle),this.todayElement&&s.EventHandler.remove(this.todayElement,"click",this.todayButtonClick),this.previousIconHandler(!0),this.nextIconHandler(!0),this.keyboardModule.destroy(),this.element.removeAttribute("data-role"),i.i(s.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="e-zoomin",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),"calendar"===this.getModuleName()&&this.table.focus()},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){!s.Browser.isDevice&&e.preventDefault(),"Gregorian"===this.calendarMode?this.previous():this.islamicModule.islamicPrevious(),this.triggerNavigate(e),"calendar"===this.getModuleName()&&this.table.focus()},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){!s.Browser.isDevice&&e.preventDefault(),"Gregorian"===this.calendarMode?this.next():this.islamicModule.islamicNext(),this.triggerNavigate(e),"calendar"===this.getModuleName()&&this.table.focus()},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!i.i(s.isNullOrUndefined)(this.contentElement)&&this.contentElement.classList.contains("e-year")?"Year":!i.i(s.isNullOrUndefined)(this.contentElement)&&this.contentElement.classList.contains("e-decade")?"Decade":"Month"},t.prototype.getDateVal=function(e,t){return!i.i(s.isNullOrUndefined)(t)&&e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()},t.prototype.getCultureObjects=function(e,t){var a=".dates.calendars.gregorian.days.format."+this.dayHeaderFormat.toLowerCase(),n=".dates.calendars.islamic.days.format."+this.dayHeaderFormat.toLowerCase();return"Gregorian"===this.calendarMode?i.i(s.getValue)("main."+this.locale+a,e):i.i(s.getValue)("main."+this.locale+n,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+864e5)/864e5/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="Gregorian"===this.calendarMode?"gregorian":"islamic",a={type:"dateTime",skeleton:"full",calendar:s},n=this.globalize.formatDate(new Date(parseInt(""+i.getAttribute("id"),0)),a),r=this.globalize.parseDate(n,a),l=r.valueOf()-r.valueOf()%1e3;return new Date(l)},t.prototype.adjustLongHeaderSize=function(){i.i(s.removeClass)([this.element],"e-calendar-day-header-lg"),"Wide"===this.dayHeaderFormat&&i.i(s.addClass)(["calendar"===this.getModuleName()?this.element:this.calendarElement],"e-calendar-day-header-lg")},t.prototype.selectDate=function(e,t,a,n,r){var o=a||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(n&&!this.checkPresentDate(t,r)){var h=this.copyValues(r);!i.i(s.isNullOrUndefined)(r)&&h.length>0?(h.push(new Date(this.checkValue(t))),this.setProperties({values:h},!0),this.setProperties({value:r[r.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 u=i.i(s.closest)(o,"."+l);if(i.i(s.isNullOrUndefined)(u)&&(u=this.tableBodyElement),n||i.i(s.isNullOrUndefined)(u.querySelector("."+d))||i.i(s.removeClass)([u.querySelector("."+d)],d),n||i.i(s.isNullOrUndefined)(u.querySelector("."+p))||i.i(s.removeClass)([u.querySelector("."+p)],p),n||i.i(s.isNullOrUndefined)(u.querySelector("."+c))||i.i(s.removeClass)([u.querySelector("."+c)],c),n){for(var h=this.copyValues(r),m=Array.prototype.slice.call(this.tableBodyElement.querySelectorAll("td")),f=0;f<m.length;f++){var v=u.querySelectorAll("td."+p)[0],y=u.querySelectorAll("td."+d)[0];m[f]===v&&i.i(s.removeClass)([m[f]],p),m[f]!==y||this.checkPresentDate(new Date(parseInt(y.getAttribute("id").split("_")[0],10)),r)||i.i(s.removeClass)([m[f]],d)}if(o.classList.contains(d)){i.i(s.removeClass)([o],d);for(var g=0;g<h.length;g++){var b="Gregorian"===this.calendarMode?"gregorian":"islamic",D={format:null,type:"date",skeleton:"short",calendar:b};if(this.globalize.formatDate(t,D)===this.globalize.formatDate(h[g],D)){var f=h.indexOf(h[g]);h.splice(f,1),i.i(s.addClass)([o],p)}}this.setProperties({values:h},!0)}else i.i(s.addClass)([o],d)}else i.i(s.addClass)([o],d);this.isDateSelected=!0},t.prototype.checkPresentDate=function(e,t){var a=!1;if(!i.i(s.isNullOrUndefined)(t))for(var n=0;n<t.length;n++){var r="Gregorian"===this.calendarMode?"gregorian":"islamic",l=this.globalize.formatDate(e,{format:null,type:"date",skeleton:"short",calendar:r}),o=this.globalize.formatDate(t[n],{format:null,type:"date",skeleton:"short",calendar:r});l===o&&(a=!0)}return a},t.prototype.setAriaActiveDescendant=function(){i.i(s.attributes)(this.table,{"aria-activedescendant":""+this.setActiveDescendant()})},t.prototype.previousIconHandler=function(e){e?i.i(s.isNullOrUndefined)(this.previousIcon)||(s.EventHandler.remove(this.previousIcon,"click",this.navigatePreviousHandler),i.i(s.addClass)([this.previousIcon],""+h),i.i(s.addClass)([this.previousIcon],""+u),this.previousIcon.setAttribute("aria-disabled","true")):(s.EventHandler.add(this.previousIcon,"click",this.navigatePreviousHandler),i.i(s.removeClass)([this.previousIcon],""+h),i.i(s.removeClass)([this.previousIcon],""+u),this.previousIcon.setAttribute("aria-disabled","false"))},t.prototype.renderDayCellEvent=function(e){i.i(s.extend)(this.renderDayCellArgs,{name:"renderDayCell"}),this.trigger("renderDayCell",e)},t.prototype.navigatedEvent=function(e){i.i(s.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?i.i(s.isNullOrUndefined)(this.previousIcon)||(s.EventHandler.remove(this.nextIcon,"click",this.navigateNextHandler),i.i(s.addClass)([this.nextIcon],h),i.i(s.addClass)([this.nextIcon],u),this.nextIcon.setAttribute("aria-disabled","true")):(s.EventHandler.add(this.nextIcon,"click",this.navigateNextHandler),i.i(s.removeClass)([this.nextIcon],h),i.i(s.removeClass)([this.nextIcon],u),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&&(n-=n%i,s=n-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(1944,1,18)).month&&t.year>=this.islamicModule.getIslamicDate(new Date(1944,1,18)).year&&t.month<=this.islamicModule.getIslamicDate(new Date(2069,1,16)).month&&t.year<=this.islamicModule.getIslamicDate(new Date(2069,1,16)).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,a,n,r){var l=t,o=new Date(+e);if(!i.i(s.isNullOrUndefined)(this.tableBodyElement)&&!i.i(s.isNullOrUndefined)(a)){for(;this.findNextTD(new Date(+e),l,n,r);)l+=t;var h=new Date(o.setDate(o.getDate()+l));l=+h>+n||+h<+r?l===t?t-t:t:l}e.setDate(e.getDate()+l)},t.prototype.findNextTD=function(e,t,a,n){var r=new Date(e.setDate(e.getDate()+t)),l=[],o=!1;if((!i.i(s.isNullOrUndefined)(r)&&r.getMonth())===(!i.i(s.isNullOrUndefined)(this.currentDate)&&this.currentDate.getMonth())){var u=void 0;u="Gregorian"===this.calendarMode?this.renderDays(r):this.islamicModule.islamicRenderDays(this.currentDate,r),l=u.filter(function(e){return e.classList.contains(h)})}else l=this.tableBodyElement.querySelectorAll("td."+h);if(+r<=+a&&+r>=+n&&l.length)for(var d=0;d<l.length&&!(o=+r==+new Date(parseInt(l[d].id,0)));d++);return o},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},n([i.i(s.Property)(new Date(1900,0,1))],t.prototype,"min",void 0),n([i.i(s.Property)(!0)],t.prototype,"enabled",void 0),n([i.i(s.Property)(null)],t.prototype,"cssClass",void 0),n([i.i(s.Property)(new Date(2099,11,31))],t.prototype,"max",void 0),n([i.i(s.Property)(null)],t.prototype,"firstDayOfWeek",void 0),n([i.i(s.Property)("Gregorian")],t.prototype,"calendarMode",void 0),n([i.i(s.Property)("Month")],t.prototype,"start",void 0),n([i.i(s.Property)("Month")],t.prototype,"depth",void 0),n([i.i(s.Property)(!1)],t.prototype,"weekNumber",void 0),n([i.i(s.Property)("FirstDay")],t.prototype,"weekRule",void 0),n([i.i(s.Property)(!0)],t.prototype,"showTodayButton",void 0),n([i.i(s.Property)("Short")],t.prototype,"dayHeaderFormat",void 0),n([i.i(s.Property)(!1)],t.prototype,"enablePersistence",void 0),n([i.i(s.Property)(null)],t.prototype,"keyConfigs",void 0),n([i.i(s.Property)(null)],t.prototype,"serverTimezoneOffset",void 0),n([i.i(s.Event)()],t.prototype,"created",void 0),n([i.i(s.Event)()],t.prototype,"destroyed",void 0),n([i.i(s.Event)()],t.prototype,"navigated",void 0),n([i.i(s.Event)()],t.prototype,"renderDayCell",void 0),t=n([s.NotifyPropertyChanges],t)}(s.Component),f=function(e){function t(t,i){return e.call(this,t,i)||this}return a(t,e),t.prototype.render=function(){if("Islamic"===this.calendarMode&&void 0===this.islamicModule&&i.i(s.throwError)("Requires the injectable Islamic modules to render Calendar in Islamic mode"),this.isMultiSelection&&"object"==typeof this.values&&!i.i(s.isNullOrUndefined)(this.values)&&this.values.length>0){for(var t=[],a=[],n=0;n<this.values.length;n++)-1===t.indexOf(+this.values[n])&&(t.push(+this.values[n]),a.push(this.values[n]));this.setProperties({values:a},!0);for(var r=0;r<this.values.length;r++)if(!this.checkDateValue(this.values[r]))if("string"==typeof this.values[r]&&this.checkDateValue(new Date(this.checkValue(this.values[r])))){var l=new Date(this.checkValue(this.values[r]));this.values.splice(r,1),this.values.splice(r,0,l)}else this.values.splice(r,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 o=i.i(s.closest)(this.element,"form");o&&s.EventHandler.add(o,"reset",this.formResetHandler.bind(this)),this.setTimeZone(this.serverTimezoneOffset)}this.renderComplete()},t.prototype.setEnable=function(e){e?i.i(s.removeClass)([this.element],h):i.i(s.addClass)([this.element],h)},t.prototype.setClass=function(e,t){i.i(s.isNullOrUndefined)(t)||(t=t.replace(/\s+/g," ").trim()),i.i(s.isNullOrUndefined)(e)||(e=e.replace(/\s+/g," ").trim()),i.i(s.isNullOrUndefined)(t)||""===t||i.i(s.removeClass)([this.element],t.split(" ")),i.i(s.isNullOrUndefined)(e)||i.i(s.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(!i.i(s.isNullOrUndefined)(this.serverTimezoneOffset)&&this.value){var t=e,a=(new Date).getTimezoneOffset()/60,n=t+a;n=this.isDayLightSaving()?n--:n,this.value=new Date(this.value.getTime()+60*n*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),!i.i(s.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()&&(!i.i(s.isNullOrUndefined)(this.value)&&this.value<=this.min&&this.min<=this.max?(this.setProperties({value:this.min},!0),this.changedArgs={value:this.value}):!i.i(s.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()||i.i(s.isNullOrUndefined)(this.value)?e.prototype.minMaxUpdate.call(this,this.value):!i.i(s.isNullOrUndefined)(this.value)&&this.value<this.min&&this.min<=this.max?e.prototype.minMaxUpdate.call(this,this.min):!i.i(s.isNullOrUndefined)(this.value)&&this.value>this.max&&this.min<=this.max&&e.prototype.minMaxUpdate.call(this,this.max)},t.prototype.generateTodayVal=function(t){var a=new Date;return i.i(s.isNullOrUndefined)(this.timezone)||(a=e.prototype.getDate.call(this,a,this.timezone)),t&&i.i(s.isNullOrUndefined)(this.timezone)?(a.setHours(t.getHours()),a.setMinutes(t.getMinutes()),a.setSeconds(t.getSeconds()),a.setMilliseconds(t.getMilliseconds())):a=new Date(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0,0),a},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(r)?this.changeHandler(a):this.changeHandler()},t.prototype.clickHandler=function(t){var a=t.currentTarget;if(this.isPopupClicked=!0,a.classList.contains(r))if(this.isMultiSelection){var n=this.copyValues(this.values);-1===n.toString().indexOf(this.getIdValue(t,null).toString())?(n.push(this.getIdValue(t,null)),this.setProperties({values:n},!0),this.setProperties({value:this.values[this.values.length-1]},!0)):this.previousDates=!0}else this.setProperties({value:this.getIdValue(t,null)},!0);var l=this.currentView();e.prototype.clickHandler.call(this,t,this.value),this.isMultiSelection&&this.currentDate!==this.value&&!i.i(s.isNullOrUndefined)(this.tableBodyElement.querySelectorAll("."+p)[0])&&"Year"===l&&this.tableBodyElement.querySelectorAll("."+p)[0].classList.remove(p)},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);var t=["value","values"];return this.addOnPersist(t)},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=i.i(s.closest)(this.element,"form");t&&s.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 a=this.copyValues(this.values);if("object"==typeof t&&t.length>0)for(var n=t,r=0;r<n.length;r++)this.checkDateValue(n[r])&&!e.prototype.checkPresentDate.call(this,n[r],a)&&(!i.i(s.isNullOrUndefined)(a)&&a.length>0?a.push(n[r]):a=[new Date(+n[r])]);else this.checkDateValue(t)&&!e.prototype.checkPresentDate.call(this,t,a)&&(!i.i(s.isNullOrUndefined)(a)&&a.length>0?a.push(t):a=[new Date(+t)]);this.setProperties({values:a},!0),this.isMultiSelection&&this.setProperties({value:this.values[this.values.length-1]},!0),this.validateValues(this.isMultiSelection,a),this.update(),this.changedArgs={value:this.value,values:this.values},this.changeHandler()}},t.prototype.removeDate=function(e){if("string"!=typeof e&&"number"!=typeof e&&!i.i(s.isNullOrUndefined)(this.values)&&this.values.length>0){var t=this.copyValues(this.values);if("object"==typeof e&&e.length>0)for(var a=e,n=0;n<a.length;n++)for(var r=0;r<t.length;r++)+t[r]==+a[n]&&t.splice(r,1);else for(var r=0;r<t.length;r++)+t[r]==+e&&t.splice(r,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,a,n){e.prototype.selectDate.call(this,t,a,n,this.isMultiSelection,this.values),this.isMultiSelection&&!i.i(s.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){!i.i(s.isNullOrUndefined)(this.todayButtonEvent)&&this.isTodayClicked&&(e=this.todayButtonEvent,this.isTodayClicked=!1),this.changedArgs.event=e||null,this.changedArgs.isInteracted=!i.i(s.isNullOrUndefined)(e),i.i(s.isNullOrUndefined)(this.value)||this.setProperties({value:this.value},!0),this.isMultiSelection||+this.value===Number.NaN||(i.i(s.isNullOrUndefined)(this.value)||i.i(s.isNullOrUndefined)(this.previousDate))&&(null!==this.previousDate||isNaN(+this.value))?i.i(s.isNullOrUndefined)(this.values)||this.previousValues===this.values.length||(this.changeEvent(e),this.previousValues=this.values.length):this.changeEvent(e)},n([i.i(s.Property)(null)],t.prototype,"value",void 0),n([i.i(s.Property)(null)],t.prototype,"values",void 0),n([i.i(s.Property)(!1)],t.prototype,"isMultiSelection",void 0),n([i.i(s.Event)()],t.prototype,"change",void 0),t=n([s.NotifyPropertyChanges],t)}(m)},function(e,t,i){"use strict";i.d(t,"a",function(){return d});var s=i(0),a=(i.n(s),i(2)),n=(i.n(a),i(1)),r=(i.n(n),i(3)),l=this&&this.__extends||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])})(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)}}(),o=this&&this.__decorate||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},h="e-datepicker",u=["title","class","style"],d=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.isAngular=!1,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 l(t,e),t.prototype.render=function(){this.initialize(),this.bindEvents(),"Never"!==this.floatLabelType&&n.Input.calculateWidth(this.inputElement,this.inputWrapper.container),i.i(s.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(s.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"),!i.i(s.isNullOrUndefined)(i.i(s.closest)(this.element,"fieldset"))&&i.i(s.closest)(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete(),this.setTimeZone(this.serverTimezoneOffset)},t.prototype.setTimeZone=function(e){if(!i.i(s.isNullOrUndefined)(this.serverTimezoneOffset)&&this.value){var t=(new Date).getTimezoneOffset()/60,a=e,n=a+t;n=this.isDayLightSaving()?n--:n,this.value=new Date(this.value.getTime()+60*n*60*1e3),this.updateInput()}},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"):i.i(s.attributes)(this.inputElement,{readonly:""}),this.updateIconState()},t.prototype.updateIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&i.i(s.removeClass)([this.inputWrapper.container],["e-non-edit"]):""===this.inputElement.value?i.i(s.removeClass)([this.inputWrapper.container],["e-non-edit"]):i.i(s.addClass)([this.inputWrapper.container],["e-non-edit"])},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=i.i(s.isNullOrUndefined)(this.value)?null:new Date(+this.value),this.inputElement.setAttribute("value",this.inputElement.value),this.inputValueCopy=this.value},t.prototype.createInput=function(){var e={"aria-atomic":"true","aria-expanded":"false",role:"combobox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-invalid":"false","aria-label":this.getModuleName()};if("datepicker"===this.getModuleName()){var t={placeholder:this.placeholder};this.globalize=new s.Internationalization(this.locale),this.l10n=new s.L10n("datepicker",t,this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0)}this.fullScreenMode&&s.Browser.isDevice&&(this.cssClass+=" e-popup-expand");var a=this.cssClass;i.i(s.isNullOrUndefined)(this.cssClass)||""===this.cssClass||(a=this.cssClass.replace(/\s+/g," ").trim());var r=!this.enableMask;this.inputWrapper=n.Input.createInput({element:this.inputElement,floatLabelType:this.floatLabelType,bindClearAction:r,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:a,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),i.i(s.attributes)(this.inputElement,e),this.enabled?(this.inputElement.setAttribute("aria-disabled","false"),this.inputElement.setAttribute("tabindex",this.tabIndex)):(this.inputElement.setAttribute("aria-disabled","true"),this.inputElement.tabIndex=-1),n.Input.addAttributes({"aria-label":"select",role:"button"},this.inputWrapper.buttons[0]),i.i(s.addClass)([this.inputWrapper.container],"e-date-wrapper")},t.prototype.updateInput=function(t,a){void 0===t&&(t=!1),void 0===a&&(a=!1);var n;if(this.value&&!this.isCalendar()&&this.disabledDates(t,a),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)),!i.i(s.isNullOrUndefined)(this.value)){var r=this.value,l=void 0,o=i.i(s.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString;if("datetimepicker"===this.getModuleName()?l="Gregorian"===this.calendarMode?this.globalize.formatDate(this.value,{format:o,type:"dateTime",skeleton:"yMd"}):this.globalize.formatDate(this.value,{format:o,type:"dateTime",skeleton:"yMd",calendar:"islamic"}):(n="Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"},l=this.globalize.formatDate(this.value,n)),+r<=+this.max&&+r>=+this.min)this.updateInputValue(l);else{var h=+r>=+this.max||!+this.value||!+this.value||+r<=+this.min;!this.strictMode&&h&&this.updateInputValue(l)}}i.i(s.isNullOrUndefined)(this.value)&&this.strictMode&&(this.enableMask?(this.updateInputValue(this.maskedDateValue),this.notify("createMask",{module:"MaskedDateTime"})):this.updateInputValue("")),!this.strictMode&&i.i(s.isNullOrUndefined)(this.value)&&this.invalidValueString&&this.updateInputValue(this.invalidValueString),this.changedArgs={value:this.value},this.errorClass(),this.updateIconState()},t.prototype.minMaxUpdates=function(){!i.i(s.isNullOrUndefined)(this.value)&&this.value<this.min&&this.min<=this.max&&this.strictMode?(this.setProperties({value:this.min},!0),this.changedArgs={value:this.value}):!i.i(s.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,a=null,n=null;if("datetimepicker"===this.getModuleName()){var r=new s.Internationalization(this.locale);"Gregorian"===this.calendarMode?(a={format:this.dateTimeFormat,type:"dateTime",skeleton:"yMd"},n={format:r.getDatePattern({skeleton:"yMd"}),type:"dateTime"}):(a={format:this.dateTimeFormat,type:"dateTime",skeleton:"yMd",calendar:"islamic"},n={format:r.getDatePattern({skeleton:"yMd"}),type:"dateTime",calendar:"islamic"})}else a="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(e,a)),i.i(s.isNullOrUndefined)(t)&&"datetimepicker"===this.getModuleName()&&(t=this.checkDateValue(this.globalize.parseDate(e,n))),t},t.prototype.checkInvalidValue=function(e){if(!(e instanceof Date||i.i(s.isNullOrUndefined)(e))){var t=null,a=e;"number"==typeof e&&(a=e.toString());if("datetimepicker"===this.getModuleName()){var n=new s.Internationalization(this.locale);"Gregorian"===this.calendarMode?({format:this.dateTimeFormat,type:"dateTime",skeleton:"yMd"},{format:n.getDatePattern({skeleton:"yMd"}),type:"dateTime"}):({format:this.dateTimeFormat,type:"dateTime",skeleton:"yMd",calendar:"islamic"},{format:n.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 r=!1;if("string"!=typeof a)a=null,r=!0;else if("string"==typeof a&&(a=a.trim()),!(t=this.checkStringValue(a))){var l=null,o=null;l=/^\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)?)?/,o=/^\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)?)?/,!l.test(a)&&!o.test(a)||/^[a-zA-Z0-9- ]*$/.test(a)||isNaN(+new Date(this.checkValue(a)))?r=!0:t=new Date(a)}r?(this.strictMode||(this.invalidValueString=a),this.setProperties({value:null},!0)):this.setProperties({value:t},!0)}},t.prototype.bindInputEvent=function(){i.i(s.isNullOrUndefined)(this.formatString)&&!this.enableMask||(this.enableMask||-1===this.formatString.indexOf("y")?s.EventHandler.add(this.inputElement,"input",this.inputHandler,this):s.EventHandler.remove(this.inputElement,"input",this.inputHandler))},t.prototype.bindEvents=function(){s.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.dateIconHandler,this),s.EventHandler.add(this.inputElement,"mouseup",this.mouseUpHandler,this),s.EventHandler.add(this.inputElement,"focus",this.inputFocusHandler,this),s.EventHandler.add(this.inputElement,"blur",this.inputBlurHandler,this),s.EventHandler.add(this.inputElement,"keyup",this.keyupHandler,this),this.enableMask&&s.EventHandler.add(this.inputElement,"keydown",this.keydownHandler,this),this.bindInputEvent(),s.EventHandler.add(this.inputElement,"change",this.inputChangeHandler,this),this.showClearButton&&this.inputWrapper.clearButton&&s.EventHandler.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this),this.formElement&&s.EventHandler.add(this.formElement,"reset",this.resetFormHandler,this),this.defaultKeyConfigs=i.i(s.extend)(this.defaultKeyConfigs,this.keyConfigs),this.keyboardModules=new s.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"Delete":!this.enableMask||this.popupObj||this.readonly||("Delete"!==e.code&&e.preventDefault(),this.notify("keyDownHandler",{module:"MaskedDateTime",e:e}))}},t.prototype.unBindEvents=function(){i.i(s.isNullOrUndefined)(this.inputWrapper)||s.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.dateIconHandler),s.EventHandler.remove(this.inputElement,"mouseup",this.mouseUpHandler),s.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),s.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),s.EventHandler.remove(this.inputElement,"change",this.inputChangeHandler),s.EventHandler.remove(this.inputElement,"keyup",this.keyupHandler),this.enableMask&&s.EventHandler.remove(this.inputElement,"keydown",this.keydownHandler),this.showClearButton&&this.inputWrapper.clearButton&&s.EventHandler.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler),this.formElement&&s.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=i.i(s.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&&s.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("");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"}),i.i(s.closest)(this.element,"form")){var a=this.element,n=document.createEvent("KeyboardEvent");n.initEvent("keyup",!1,!0),a.dispatchEvent(n)}},t.prototype.preventEventBubbling=function(e){e.preventDefault(),this.interopAdaptor.invokeMethodAsync("OnDateIconClick")},t.prototype.updateInputValue=function(e){n.Input.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton)},t.prototype.dateIconHandler=function(e){this.enabled&&(this.isIconClicked=!0,s.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(),i.i(s.addClass)([this.inputWrapper.container],["e-input-focus"]),i.i(s.addClass)(this.inputWrapper.buttons,"e-active"))),this.isIconClicked=!1)},t.prototype.updateHtmlAttributeToWrapper=function(){if(!i.i(s.isNullOrUndefined)(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var a=t[e];if(!i.i(s.isNullOrUndefined)(this.htmlAttributes[""+a])&&u.indexOf(a)>-1)if("class"===a){var n=this.htmlAttributes[""+a].replace(/\s+/g," ").trim();""!==n&&i.i(s.addClass)([this.inputWrapper.container],n.split(" "))}else if("style"===a){var r=this.inputWrapper.container.getAttribute(a);i.i(s.isNullOrUndefined)(r)?r=this.htmlAttributes[""+a]:";"===r.charAt(r.length-1)?r+=this.htmlAttributes[""+a]:r=r+";"+this.htmlAttributes[""+a],this.inputWrapper.container.setAttribute(a,r)}else this.inputWrapper.container.setAttribute(a,this.htmlAttributes[""+a])}},t.prototype.updateHtmlAttributeToElement=function(){if(!i.i(s.isNullOrUndefined)(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var a=t[e];u.indexOf(a)<0&&this.inputElement.setAttribute(a,this.htmlAttributes[""+a])}},t.prototype.updateCssClass=function(e,t){i.i(s.isNullOrUndefined)(t)||(t=t.replace(/\s+/g," ").trim()),i.i(s.isNullOrUndefined)(e)||(e=e.replace(/\s+/g," ").trim()),n.Input.setCssClass(e,[this.inputWrapper.container],t),this.popupWrapper&&n.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.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));var e={model:this};this.isDateIconClicked=!1,this.trigger("focus",e),this.updateIconState(),this.openOnFocus&&!this.isIconClicked&&this.show()}},t.prototype.inputHandler=function(){this.isPopupClicked=!1,this.enableMask&&this.notify("inputHandler",{module:"MaskedDateTime"})},t.prototype.inputBlurHandler=function(e){if(this.enabled){if(this.strictModeUpdate(),""===this.inputElement.value&&i.i(s.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=i.i(s.extend)(this.defaultKeyConfigs,this.keyConfigs),this.calendarKeyboardModules=new s.KeyboardEvents(this.calendarElement.children[1].firstElementChild,{eventName:"keydown",keyAction:this.calendarKeyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})),this.isPopupClicked=!1}},t.prototype.documentHandler=function(t){i.i(s.isNullOrUndefined)(this.popupObj)||i.i(s.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 a=t.target;i.i(s.closest)(a,".e-datepicker.e-popup-wrapper")||i.i(s.isNullOrUndefined)(this.inputWrapper)||i.i(s.closest)(a,".e-input-group")===this.inputWrapper.container||a.classList.contains("e-day")||a.classList.contains("e-dlg-overlay")?i.i(s.closest)(a,".e-datepicker.e-popup-wrapper")&&(a.classList.contains("e-day")&&!i.i(s.isNullOrUndefined)(t.target.parentElement)&&t.target.parentElement.classList.contains("e-selected")&&i.i(s.closest)(a,".e-content")&&i.i(s.closest)(a,".e-content").classList.contains("e-"+this.depth.toLowerCase())?this.hide(t):i.i(s.closest)(a,".e-footer-container")&&a.classList.contains("e-today")&&a.classList.contains("e-btn")&&+new Date(+this.value)==+e.prototype.generateTodayVal.call(this,this.value)&&this.hide(t)):(this.hide(t),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":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 i=this.inputElement.selectionStart,s=this.inputElement.selectionEnd;if(this.enableMask&&!this.popupObj&&!this.readonly){var a=this.inputElement.value.length;(0===i&&s===a||s!==a&&"tab"===e.action||0!==i&&"shiftTab"===e.action)&&e.preventDefault(),this.notify("keyDownHandler",{module:"MaskedDateTime",e:e}),i=this.inputElement.selectionStart,s=this.inputElement.selectionEnd}this.strictModeUpdate(),this.updateInput(),this.popupUpdate(),this.changeTrigger(e),this.errorClass(),this.enableMask&&(this.inputElement.selectionStart=i,this.inputElement.selectionEnd=s),"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=!i.i(s.isNullOrUndefined)(this.value)&&new Date(+this.value)||null,this.isCalendar()&&(e.prototype.keyActionHandle.call(this,t),this.isCalendar()&&i.i(s.attributes)(this.inputElement,{"aria-activedescendant":""+this.setActiveDescendant()}))},t.prototype.popupUpdate=function(){if((i.i(s.isNullOrUndefined)(this.value)&&!i.i(s.isNullOrUndefined)(this.previousDate)||"datetimepicker"!==this.getModuleName()&&+this.value!=+this.previousDate||"datetimepicker"===this.getModuleName()&&+this.value!=+this.previousDateTime)&&(this.popupObj&&this.popupObj.element.querySelectorAll(".e-selected").length>0&&i.i(s.removeClass)(this.popupObj.element.querySelectorAll(".e-selected"),["e-selected"]),!i.i(s.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(){var e,t,a=/^y/,n=/[^a-zA-Z]/;if("datetimepicker"===this.getModuleName()?e=i.i(s.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString:a.test(this.formatString)&&!n.test(this.formatString)||(e=i.i(s.isNullOrUndefined)(this.formatString)?this.formatString:this.formatString.replace("dd","d")),i.i(s.isNullOrUndefined)(e))e=this.formatString;else{e.split("M").length-1<3&&(e=e.replace("MM","M"))}var r;"datetimepicker"===this.getModuleName()?r="Gregorian"===this.calendarMode?{format:i.i(s.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:i.i(s.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"}:(t="Gregorian"===this.calendarMode?{format:e,type:"dateTime",skeleton:"yMd"}:{format:e,type:"dateTime",skeleton:"yMd",calendar:"islamic"},r=t);var l;if("string"==typeof this.inputElement.value&&(this.inputElement.value=this.inputElement.value.trim()),"datetimepicker"===this.getModuleName())if(this.checkDateValue(this.globalize.parseDate(this.inputElement.value,r))){var o=this.inputElement.value.replace(/(am|pm|Am|aM|pM|Pm)/g,function(e){return e.toLocaleUpperCase()});l=this.globalize.parseDate(o,r)}else t="Gregorian"===this.calendarMode?{format:e,type:"dateTime",skeleton:"yMd"}:{format:e,type:"dateTime",skeleton:"yMd",calendar:"islamic"},l=this.globalize.parseDate(this.inputElement.value,t);else l=this.globalize.parseDate(this.inputElement.value,r),l=!i.i(s.isNullOrUndefined)(l)&&isNaN(+l)?null:l,!i.i(s.isNullOrUndefined)(this.formatString)&&""!==this.inputElement.value&&this.strictMode&&(this.isPopupClicked||!this.isPopupClicked&&this.inputElement.value===this.previousElementValue)&&-1===this.formatString.indexOf("y")&&l.setFullYear(this.value.getFullYear());"datepicker"===this.getModuleName()&&this.value&&!isNaN(+this.value)&&l&&l.setHours(this.value.getHours(),this.value.getMinutes(),this.value.getSeconds(),this.value.getMilliseconds()),this.strictMode&&l?(this.updateInputValue(this.globalize.formatDate(l,r)),this.inputElement.value!==this.previousElementValue&&this.setProperties({value:l},!0)):this.strictMode||this.inputElement.value!==this.previousElementValue&&this.setProperties({value:l},!0),this.strictMode&&!l&&this.inputElement.value===(this.enableMask?this.maskedDateValue:"")&&this.setProperties({value:null},!0),isNaN(+this.value)&&this.setProperties({value:null},!0),i.i(s.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:h+" e-popup-wrapper",id:this.inputElement.id+"_options"}),this.popupWrapper.setAttribute("aria-label",this.element.id),this.popupWrapper.setAttribute("role","dialog"),i.i(s.isNullOrUndefined)(this.cssClass)||(this.popupWrapper.className+=" "+this.cssClass),s.Browser.isDevice&&(this.modelHeader(),this.modal=this.createElement("div"),this.modal.className=h+" e-date-modal",document.body.className+=" e-date-overflow",this.modal.style.display="block",document.body.appendChild(this.modal)),this.calendarElement.querySelector("table tbody").className="",this.popupObj=new a.Popup(this.popupWrapper,{content:this.calendarElement,relateTo:s.Browser.isDevice?document.body:this.inputWrapper.container,position:s.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:s.Browser.isDevice?{X:"fit",Y:"fit"}:this.enableRtl?{X:"fit",Y:"flip"}:{X:"flip",Y:"flip"},open:function(){s.Browser.isDevice&&e.fullScreenMode&&(e.iconRight=parseInt(window.getComputedStyle(e.calendarElement.querySelector(".e-header.e-month .e-prev")).marginRight,10)>16,e.touchModule=new s.Touch(e.calendarElement.querySelector(".e-content.e-month"),{swipe:e.CalendarSwipeHandler.bind(e)}),s.EventHandler.add(e.calendarElement.querySelector(".e-content.e-month"),"touchstart",e.TouchStartHandler,e)),"datetimepicker"!==e.getModuleName()&&document.activeElement!==e.inputElement&&(e.defaultKeyConfigs=i.i(s.extend)(e.defaultKeyConfigs,e.keyConfigs),e.calendarElement.children[1].firstElementChild.focus(),e.calendarKeyboardModules=new s.KeyboardEvents(e.calendarElement.children[1].firstElementChild,{eventName:"keydown",keyAction:e.calendarKeyActionHandle.bind(e),keyConfigs:e.defaultKeyConfigs}),e.calendarKeyboardModules=new s.KeyboardEvents(e.inputWrapper.container.children[e.index],{eventName:"keydown",keyAction:e.calendarKeyActionHandle.bind(e),keyConfigs:e.defaultKeyConfigs}))},close:function(){e.isDateIconClicked&&e.inputWrapper.container.children[e.index].focus(),e.value&&e.disabledDates(),e.popupObj&&e.popupObj.destroy(),e.resetCalendar(),i.i(s.detach)(e.popupWrapper),e.popupObj=e.popupWrapper=null,e.preventArgs=null,e.calendarKeyboardModules=null,e.setAriaAttributes()},targetExitViewport:function(){s.Browser.isDevice||e.hide()}}),this.popupObj.element.className+=" "+this.cssClass,this.setAriaAttributes()},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"}),i=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"},i.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"});s.EventHandler.add(l,"mousedown touchstart",this.modelCloseHandler,this);var o=this.calendarElement.querySelector("button.e-today");a.classList.add("e-day-wrapper"),o.classList.add("e-outline"),t.appendChild(l),t.appendChild(o)}this.fullScreenMode||t.appendChild(i),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=!i.i(s.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(){this.trigger("navigated",this.navigatedArgs)},t.prototype.keyupHandler=function(e){this.isKeyAction=this.inputElement.value!==this.previousElementValue},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.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,a,n;a="datetimepicker"===this.getModuleName()&&i.i(s.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString,this.value&&("datetimepicker"===this.getModuleName()?(n="Gregorian"===this.calendarMode?{format:a,type:"dateTime",skeleton:"yMd"}:{format:a,type:"dateTime",skeleton:"yMd",calendar:"islamic"},t=this.globalize.formatDate(this.changedArgs.value,n)):(n="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,n)),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"})),i.i(s.isNullOrUndefined)(t)||(this.updateInputValue(t),this.enableMask&&this.notify("setMaskSelection",{module:"MaskedDateTime"}))},t.prototype.isCalendar=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains("e-popup-wrapper"))},t.prototype.setWidth=function(e){this.inputWrapper.container.style.width="number"==typeof e?i.i(s.formatUnit)(this.width):"string"==typeof e?e.match(/px|%|em/)?this.width:i.i(s.formatUnit)(this.width):"100%"},t.prototype.show=function(t,a){var n=this;if(!(this.enabled&&this.readonly||!this.enabled||this.popupObj)){var r=!0,l=void 0;i.i(s.isNullOrUndefined)(this.value)||+this.value>=+new Date(this.checkValue(this.min))&&+this.value<=+new Date(this.checkValue(this.max))?l=this.value||null:(l=new Date(this.checkValue(this.value)),this.setProperties({value:null},!0)),this.isCalendar()||(e.prototype.render.call(this),this.setProperties({value:l||null},!0),this.previousDate=l,this.createCalendar()),s.Browser.isDevice&&(this.mobilePopupWrapper=this.createElement("div",{className:"e-datepick-mob-popup-wrap"}),document.body.appendChild(this.mobilePopupWrapper)),this.preventArgs={preventDefault:function(){r=!1},popup:this.popupObj,event:a||null,cancel:!1,appendTo:s.Browser.isDevice?this.mobilePopupWrapper:document.body};var o=this.preventArgs;if(this.trigger("open",o,function(t){if(n.preventArgs=t,r&&!n.preventArgs.cancel){i.i(s.addClass)(n.inputWrapper.buttons,"e-active"),n.preventArgs.appendTo.appendChild(n.popupWrapper),n.popupObj.refreshPosition(n.inputElement);var a={name:"FadeIn",duration:s.Browser.isDevice?0:300};1e3===n.zIndex?n.popupObj.show(new s.Animation(a),n.element):n.popupObj.show(new s.Animation(a),null),e.prototype.setOverlayIndex.call(n,n.mobilePopupWrapper,n.popupObj.element,n.modal,s.Browser.isDevice),n.setAriaAttributes()}else n.popupObj.destroy(),n.popupWrapper=n.popupObj=null;i.i(s.isNullOrUndefined)(n.inputElement)||""!==n.inputElement.value||!i.i(s.isNullOrUndefined)(n.tableBodyElement)&&n.tableBodyElement.querySelectorAll("td.e-selected").length>0&&(i.i(s.addClass)([n.tableBodyElement.querySelector("td.e-selected")],"e-focused-date"),i.i(s.removeClass)(n.tableBodyElement.querySelectorAll("td.e-selected"),"e-selected")),s.EventHandler.add(document,"mousedown touchstart",n.documentHandler,n)}),s.Browser.isDevice){var h=this.createElement("div",{className:"e-dlg-overlay"});h.style.zIndex=(this.zIndex-1).toString(),this.mobilePopupWrapper.appendChild(h)}}},t.prototype.hide=function(e){var t=this;if(i.i(s.isNullOrUndefined)(this.popupWrapper))s.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit();else{var a=!0;this.preventArgs={preventDefault:function(){a=!1},popup:this.popupObj,event:e||null,cancel:!1},i.i(s.removeClass)(this.inputWrapper.buttons,"e-active"),i.i(s.removeClass)([document.body],"e-date-overflow");var n=this.preventArgs;this.isCalendar()?this.trigger("close",n,function(e){t.closeEventCallback(a,e)}):this.closeEventCallback(a,n)}},t.prototype.closeEventCallback=function(e,t){this.preventArgs=t,this.isCalendar()&&e&&!this.preventArgs.cancel&&(this.popupObj.hide(),this.isAltKeyPressed=!1,this.keyboardModule.destroy(),i.i(s.removeClass)(this.inputWrapper.buttons,"e-active")),this.setAriaAttributes(),s.Browser.isDevice&&this.modal&&(this.modal.style.display="none",this.modal.outerHTML="",this.modal=null),s.Browser.isDevice&&(i.i(s.isNullOrUndefined)(this.mobilePopupWrapper)||!e||!i.i(s.isNullOrUndefined)(this.preventArgs)&&this.preventArgs.cancel||(this.mobilePopupWrapper.remove(),this.mobilePopupWrapper=null)),s.EventHandler.remove(document,"mousedown touchstart",this.documentHandler),s.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit()},t.prototype.focusIn=function(e){document.activeElement!==this.inputElement&&this.enabled&&(this.inputElement.focus(),i.i(s.addClass)([this.inputWrapper.container],["e-input-focus"]))},t.prototype.focusOut=function(){document.activeElement===this.inputElement&&(i.i(s.removeClass)([this.inputWrapper.container],["e-input-focus"]),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),n.Input.destroy({element:this.inputElement,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),i.i(s.isNullOrUndefined)(this.keyboardModules)||this.keyboardModules.destroy(),this.popupObj&&this.popupObj.element.classList.contains("e-popup")&&e.prototype.destroy.call(this);var t={"aria-atomic":"true","aria-disabled":"true","aria-expanded":"false",role:"combobox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-label":this.getModuleName()};this.inputElement&&(n.Input.removeAttributes(t,this.inputElement),i.i(s.isNullOrUndefined)(this.inputElementCopy.getAttribute("tabindex"))?this.inputElement.removeAttribute("tabindex"):this.inputElement.setAttribute("tabindex",this.tabIndex),s.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),s.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),this.ensureInputAttribute()),this.isCalendar()&&(this.popupWrapper&&i.i(s.detach)(this.popupWrapper),this.popupObj=this.popupWrapper=null,this.keyboardModule.destroy()),null===this.ngTag&&(this.inputElement&&(i.i(s.isNullOrUndefined)(this.inputWrapper)||this.inputWrapper.container.insertAdjacentElement("afterend",this.inputElement),i.i(s.removeClass)([this.inputElement],["e-input"])),i.i(s.removeClass)([this.element],[h]),i.i(s.isNullOrUndefined)(this.inputWrapper)||i.i(s.detach)(this.inputWrapper.container)),this.formElement&&s.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(var t=0;t<e.length;t++)i.i(s.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),i.i(s.removeClass)([this.inputElementCopy],[h,"e-control","e-lib"]),this.inputElement=this.element,this.formElement=i.i(s.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=i.i(s.getUniqueID)("ej2-datetimepicker"),null!==this.ngTag&&i.i(s.attributes)(this.inputElement,{id:this.element.id+"_input"})):(this.element.id=i.i(s.getUniqueID)("ej2-datepicker"),null!==this.ngTag&&i.i(s.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.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 a=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id");t.setAttribute("name",a),e.removeAttribute("name");for(var n=["required","aria-required","form"],r=0;r<n.length;r++)if(!i.i(s.isNullOrUndefined)(e.getAttribute(n[r]))){var l=e.getAttribute(n[r]);t.setAttribute(n[r],l),e.removeAttribute(n[r])}},t.prototype.checkFormat=function(){var e=new s.Internationalization(this.locale);if(this.format)if("string"==typeof this.format)this.formatString=this.format;else if(""===this.format.skeleton||i.i(s.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.checkHtmlAttributes=function(e){this.globalize=new s.Internationalization(this.locale),this.checkFormat(),this.checkView();var t,a=e?i.i(s.isNullOrUndefined)(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["value","min","max","disabled","readonly","style","name","placeholder","type"];t="datetimepicker"===this.getModuleName()?"Gregorian"===this.calendarMode?{format:i.i(s.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:i.i(s.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 n=0,r=a;n<r.length;n++){var l=r[n];if(!i.i(s.isNullOrUndefined)(this.inputElement.getAttribute(l)))switch(l){case"disabled":if(i.i(s.isNullOrUndefined)(this.datepickerOptions)||void 0===this.datepickerOptions.enabled||e){var o="disabled"!==this.inputElement.getAttribute(l)&&""!==this.inputElement.getAttribute(l)&&"true"!==this.inputElement.getAttribute(l);this.setProperties({enabled:o},!e)}break;case"readonly":if(i.i(s.isNullOrUndefined)(this.datepickerOptions)||void 0===this.datepickerOptions.readonly||e){var h="readonly"===this.inputElement.getAttribute(l)||""===this.inputElement.getAttribute(l)||"true"===this.inputElement.getAttribute(l);this.setProperties({readonly:h},!e)}break;case"placeholder":(i.i(s.isNullOrUndefined)(this.datepickerOptions)||void 0===this.datepickerOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(l)},!e);break;case"style":this.inputElement.setAttribute("style",""+this.inputElement.getAttribute(l));break;case"name":this.inputElement.setAttribute("name",""+this.inputElement.getAttribute(l));break;case"value":if(i.i(s.isNullOrUndefined)(this.datepickerOptions)||void 0===this.datepickerOptions.value||e){var u=this.inputElement.getAttribute(l);this.setProperties(i.i(s.setValue)(l,this.globalize.parseDate(u,t),{}),!e)}break;case"min":if(+this.min==+new Date(1900,0,1)||e){var d=this.inputElement.getAttribute(l);this.setProperties(i.i(s.setValue)(l,this.globalize.parseDate(d),{}),!e)}break;case"max":if(+this.max==+new Date(2099,11,31)||e){var p=this.inputElement.getAttribute(l);this.setProperties(i.i(s.setValue)(l,this.globalize.parseDate(p),{}),!e)}break;case"type":"text"!==this.inputElement.getAttribute(l)&&this.inputElement.setAttribute("type","text")}}},t.prototype.getModuleName=function(){return"datepicker"},t.prototype.disabledDates=function(t,a){void 0===t&&(t=!1),void 0===a&&(a=!1);var n,r,l=this.checkDateValue(this.value)?new Date(+this.value):new Date(this.checkValue(this.value)),o=this.previousDate;this.minMaxUpdates(),(!t||t&&!i.i(s.isNullOrUndefined)(this.renderDayCell))&&e.prototype.render.call(this),this.previousDate=o;var h=l&&+l,u='*[id^="/id"]'.replace("/id",""+h);this.strictMode||("string"==typeof this.value||"object"==typeof this.value&&+this.value!=+l)&&this.setProperties({value:l},!0),i.i(s.isNullOrUndefined)(this.calendarElement)||i.i(s.isNullOrUndefined)(this.calendarElement.querySelectorAll(u)[0])||this.calendarElement.querySelectorAll(u)[0].classList.contains("e-disabled")&&(this.strictMode||(this.currentDate=new Date((new Date).setHours(0,0,0,0))));var d;"datetimepicker"===this.getModuleName()?(r="Gregorian"===this.calendarMode?this.globalize.formatDate(l,{format:i.i(s.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd"}):this.globalize.formatDate(l,{format:i.i(s.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"}),d=r):(n="Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"},d=this.globalize.formatDate(l,n)),this.popupObj||(this.updateInputValue(d),this.enableMask&&(this.updateInputValue(this.maskedDateValue),this.notify("createMask",{module:"MaskedDateTime",isBlur:a})))},t.prototype.setAriaAttributes=function(){this.isCalendar()?(n.Input.addAttributes({"aria-expanded":"true"},this.inputElement),i.i(s.attributes)(this.inputElement,{"aria-owns":this.inputElement.id+"_options"}),i.i(s.attributes)(this.inputElement,{"aria-controls":this.inputElement.id}),this.value&&i.i(s.attributes)(this.inputElement,{"aria-activedescendant":""+this.setActiveDescendant()})):(n.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");!(i.i(s.isNullOrUndefined)(this.value)||i.i(s.isNullOrUndefined)(this.min)||i.i(s.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&&i.i(s.isNullOrUndefined)(this.value)||t?(i.i(s.addClass)([this.inputWrapper.container],"e-error"),i.i(s.attributes)(this.inputElement,{"aria-invalid":"true"})):i.i(s.isNullOrUndefined)(this.inputWrapper)||(i.i(s.removeClass)([this.inputWrapper.container],"e-error"),i.i(s.attributes)(this.inputElement,{"aria-invalid":"false"}))},t.prototype.onPropertyChanged=function(t,a){for(var r=0,l=Object.keys(t);r<l.length;r++){switch(l[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,i.i(s.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"allowEdit":this.setAllowEdit();break;case"placeholder":n.Input.setPlaceholder(this.placeholder,this.inputElement);break;case"readonly":n.Input.setReadonly(this.readonly,this.inputElement);break;case"enabled":n.Input.setEnabled(this.enabled,this.inputElement),this.setAriaDisabled();break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.checkHtmlAttributes(!0);break;case"locale":this.globalize=new s.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.datepickerOptions&&null==this.datepickerOptions.placeholder&&(this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),n.Input.setPlaceholder(this.placeholder,this.inputElement)),this.updateInput(),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"});break;case"enableRtl":n.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]);break;case"start":case"depth":this.checkView(),this.calendarElement&&e.prototype.onPropertyChanged.call(this,t,a);break;case"zIndex":this.setProperties({zIndex:t.zIndex},!0);break;case"cssClass":this.updateCssClass(t.cssClass,a.cssClass);break;case"showClearButton":n.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),n.Input.calculateWidth(this.inputElement,this.inputWrapper.container),i.i(s.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(s.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,n.Input.removeFloating(this.inputWrapper),n.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder),i.i(s.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(s.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;default:this.calendarElement&&this.isCalendar()&&e.prototype.onPropertyChanged.call(this,t,a)}this.isDynamicValueChanged||this.hide(null),this.isDynamicValueChanged=!1}},o([i.i(s.Property)(null)],t.prototype,"width",void 0),o([i.i(s.Property)(null)],t.prototype,"value",void 0),o([i.i(s.Property)(null)],t.prototype,"cssClass",void 0),o([i.i(s.Property)(!1)],t.prototype,"strictMode",void 0),o([i.i(s.Property)(null)],t.prototype,"format",void 0),o([i.i(s.Property)(!0)],t.prototype,"enabled",void 0),o([i.i(s.Property)(!1)],t.prototype,"fullScreenMode",void 0),o([i.i(s.Property)({})],t.prototype,"htmlAttributes",void 0),o([i.i(s.Property)(null)],t.prototype,"values",void 0),o([i.i(s.Property)(!1)],t.prototype,"isMultiSelection",void 0),o([i.i(s.Property)(!0)],t.prototype,"showClearButton",void 0),o([i.i(s.Property)(!0)],t.prototype,"allowEdit",void 0),o([i.i(s.Property)(null)],t.prototype,"keyConfigs",void 0),o([i.i(s.Property)(!1)],t.prototype,"enablePersistence",void 0),o([i.i(s.Property)(1e3)],t.prototype,"zIndex",void 0),o([i.i(s.Property)(!1)],t.prototype,"readonly",void 0),o([i.i(s.Property)(null)],t.prototype,"placeholder",void 0),o([i.i(s.Property)("Never")],t.prototype,"floatLabelType",void 0),o([i.i(s.Property)(null)],t.prototype,"serverTimezoneOffset",void 0),o([i.i(s.Property)(!1)],t.prototype,"openOnFocus",void 0),o([i.i(s.Property)(!1)],t.prototype,"enableMask",void 0),o([i.i(s.Property)({day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"})],t.prototype,"maskPlaceholder",void 0),o([i.i(s.Event)()],t.prototype,"open",void 0),o([i.i(s.Event)()],t.prototype,"cleared",void 0),o([i.i(s.Event)()],t.prototype,"close",void 0),o([i.i(s.Event)()],t.prototype,"blur",void 0),o([i.i(s.Event)()],t.prototype,"focus",void 0),o([i.i(s.Event)()],t.prototype,"created",void 0),o([i.i(s.Event)()],t.prototype,"destroyed",void 0),t=o([s.NotifyPropertyChanges],t)}(r.a)},function(e,t,i){"use strict";i.d(t,"a",function(){return s}),i.d(t,"b",function(){return g}),i.d(t,"c",function(){return b});var s,a=i(0),n=(i.n(a),i(2)),r=(i.n(n),i(1)),l=(i.n(r),i(6)),o=(i.n(l),this&&this.__extends||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])})(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)}}()),h=this&&this.__decorate||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},u=(new Date).getDate(),d=(new Date).getMonth(),p=(new Date).getFullYear(),c="e-timepicker",m="e-disabled",f="e-input-focus",v="e-list-item",y=["title","class","style"];!function(e){function t(e,t,i,s,a,n){this.calendarMode;var r,o=6e4*n,h=[],u=[];r=+t.setMilliseconds(0);for(var d=+i.setMilliseconds(0);d>=r;)u.push(r),h.push(s.formatDate(new Date(r),{format:a,type:"time"})),r+=o;return{collection:u,list:l.ListBase.createList(e,h,null,!0)}}e.createListItems=t}(s||(s={}));var g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),h([i.i(a.Property)("day")],t.prototype,"day",void 0),h([i.i(a.Property)("month")],t.prototype,"month",void 0),h([i.i(a.Property)("year")],t.prototype,"year",void 0),h([i.i(a.Property)("day of the week")],t.prototype,"dayOfTheWeek",void 0),h([i.i(a.Property)("hour")],t.prototype,"hour",void 0),h([i.i(a.Property)("minute")],t.prototype,"minute",void 0),h([i.i(a.Property)("second")],t.prototype,"second",void 0),t}(a.ChildProperty),b=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.isAngular=!1,s.preventChange=!1,s.maskedDateValue="",s.moduleName=s.getModuleName(),s.timeOptions=t,s}return o(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),i.i(a.removeClass)([this.cloneElement],[c,"e-control","e-lib"]),this.inputElement=this.element,this.angularTag=null,this.formElement=i.i(a.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.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex"),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),i.i(a.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(a.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"),!i.i(a.isNullOrUndefined)(i.i(a.closest)(this.element,"fieldset"))&&i.i(a.closest)(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete()},t.prototype.setTimeZone=function(){if(!i.i(a.isNullOrUndefined)(this.serverTimezoneOffset)&&this.value){var e=(new Date).getTimezoneOffset()/60,t=this.serverTimezoneOffset,s=t+e;s=this.isDayLightSaving()?s--:s,this.value=new Date(this.value.getTime()+60*s*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"):i.i(a.attributes)(this.inputElement,{readonly:""}),this.clearIconState()},t.prototype.clearIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&i.i(a.removeClass)([this.inputWrapper.container],["e-non-edit"]):""===this.inputElement.value?i.i(a.removeClass)([this.inputWrapper.container],["e-non-edit"]):i.i(a.addClass)([this.inputWrapper.container],["e-non-edit"])},t.prototype.validateDisable=function(){this.setMinMax(this.initMin,this.initMax),i.i(a.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 n=["required","aria-required","form"],r=0;r<n.length;r++)if(!i.i(a.isNullOrUndefined)(e.getAttribute(n[r]))){var l=e.getAttribute(n[r]);t.setAttribute(n[r],l),e.removeAttribute(n[r])}},t.prototype.initialize=function(){this.globalize=new a.Internationalization(this.locale),this.defaultCulture=new a.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 a.L10n("timepicker",e,this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),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,i.i(a.isNullOrUndefined)(this.element.getAttribute("id"))?(this.element.id=i.i(a.getUniqueID)("ej2_timepicker"),null!==this.angularTag&&i.i(a.attributes)(this.inputElement,{id:this.element.id+"_input"})):null!==this.angularTag&&(this.inputElement.id=this.element.getAttribute("id")+"_input"),i.i(a.isNullOrUndefined)(this.inputElement.getAttribute("name"))&&i.i(a.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(i.i(a.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!i.i(a.isNullOrUndefined)(e)&&e instanceof Date&&!isNaN(+e)?e:null},t.prototype.createInputElement=function(){this.fullScreenMode&&a.Browser.isDevice&&(this.cssClass+=" e-popup-expand");var e=this.cssClass,t=!this.enableMask;i.i(a.isNullOrUndefined)(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),this.inputWrapper=r.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),i.i(a.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)||r.Input.addAttributes({style:this.inputStyle},this.inputElement),i.i(a.addClass)([this.inputWrapper.container],"e-time-wrapper")},t.prototype.getCldrDateTimeFormat=function(){var e=new a.Internationalization(this.locale),t=e.getDatePattern({skeleton:"yMd"});return this.isNullOrEmpty(this.formatString)?t+" "+this.cldrFormat("time"):this.formatString},t.prototype.checkInvalidValue=function(e){var t=!1;if("object"!=typeof e&&!i.i(a.isNullOrUndefined)(e)){var s=e;"string"==typeof s&&(s=s.trim());var n=null,r=null;if("number"==typeof e?s=e.toString():"string"==typeof e&&(/^[a-zA-Z0-9- ]*$/.test(e)||(n=this.setCurrentDate(this.getDateObject(e)),i.i(a.isNullOrUndefined)(n)&&(n=this.checkDateValue(this.globalize.parseDate(s,{format:this.getCldrDateTimeFormat(),type:"datetime"})),i.i(a.isNullOrUndefined)(n)&&(n=this.checkDateValue(this.globalize.parseDate(s,{format:this.formatString,type:"dateTime",skeleton:"yMd"})))))),r=this.globalize.parseDate(s,{format:this.getCldrDateTimeFormat(),type:"datetime"}),n=!i.i(a.isNullOrUndefined)(r)&&r instanceof Date&&!isNaN(+r)?r:null,i.i(a.isNullOrUndefined)(n)&&s.replace(/\s/g,"").length){var l=null,o=null;l=/^\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)?)?/,o=/^\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)?)?/,!l.test(s)&&!o.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.cldrFormat=function(e){return"en"===this.locale||"en-US"===this.locale?i.i(a.getValue)("timeFormats.short",i.i(a.getDefaultDateObject)()):this.getCultureTimeObject(a.cldrData,""+this.locale)},t.prototype.destroy=function(){this.hide(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),this.unBindEvents();var t={"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&&(r.Input.removeAttributes(t,this.inputElement),null===this.angularTag&&this.inputWrapper.container.parentElement.appendChild(this.inputElement),i.i(a.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"),i.i(a.isNullOrUndefined)(this.cloneElement.getAttribute("disabled"))&&r.Input.setEnabled(!0,this.inputElement,this.floatLabelType)),this.inputWrapper.container&&i.i(a.detach)(this.inputWrapper.container),this.inputWrapper=this.popupWrapper=this.cloneElement=void 0,this.liCollections=this.timeCollections=this.disableItemCollection=[],i.i(a.isNullOrUndefined)(this.rippleFn)||this.rippleFn(),r.Input.destroy({element:this.inputElement,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),e.prototype.destroy.call(this),this.formElement&&a.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(var t=0;t<e.length;t++)i.i(a.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:c+" e-popup",attrs:{id:this.element.id+"_popup",style:"visibility:hidden"}}),this.popupWrapper.setAttribute("aria-label",this.element.id),this.popupWrapper.setAttribute("role","dialog"),i.i(a.isNullOrUndefined)(this.cssClass)||(this.popupWrapper.className+=" "+this.cssClass),!i.i(a.isNullOrUndefined)(this.step)&&this.step>0&&(this.generateList(),i.i(a.append)([this.listWrapper],this.popupWrapper)),this.addSelection(),this.renderPopup(),i.i(a.detach)(this.popupWrapper)},t.prototype.getPopupHeight=function(){var e=parseInt("240px",10),t=this.popupWrapper.getBoundingClientRect().height;return t>e?e:t},t.prototype.generateList=function(){this.createListItems(),this.wireListEvents();var e={duration:300,selector:"."+v};this.rippleFn=i.i(a.rippleEffect)(this.listWrapper,e),this.liCollections=this.listWrapper.querySelectorAll("."+v)},t.prototype.renderPopup=function(){var e=this;if(this.containerStyle=this.inputWrapper.container.getBoundingClientRect(),this.popupObj=new n.Popup(this.popupWrapper,{width:this.setPopupWidth(this.width),zIndex:this.zIndex,targetType:"relative",position:a.Browser.isDevice?{X:"center",Y:"center"}:{X:"left",Y:"bottom"},collision:a.Browser.isDevice?{X:"fit",Y:"fit"}:{X:"flip",Y:"flip"},enableRtl:this.enableRtl,relateTo:a.Browser.isDevice?document.body:this.inputWrapper.container,offsetY:4,open:function(){e.popupWrapper.style.visibility="visible",i.i(a.addClass)([e.inputWrapper.buttons[0]],"e-active")},close:function(){i.i(a.removeClass)([e.inputWrapper.buttons[0]],"e-active"),e.unWireListEvents(),e.inputElement.removeAttribute("aria-activedescendant"),i.i(a.remove)(e.popupObj.element),e.popupObj.destroy(),e.popupWrapper.innerHTML="",e.listWrapper=e.popupWrapper=e.listTag=void 0},targetExitViewport:function(){a.Browser.isDevice||e.hide()}}),a.Browser.isDevice||(this.popupObj.collision={X:"none",Y:"flip"}),a.Browser.isDevice&&this.fullScreenMode?(this.popupObj.element.style.maxHeight="100%",this.popupObj.element.style.width="100%"):this.popupObj.element.style.maxHeight="240px",a.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 r=this.createElement("span",{className:"e-popup-close"});a.EventHandler.add(r,"mousedown touchstart",this.timePopupCloseHandler,this),t.appendChild(r),t.appendChild(s),this.popupWrapper.insertBefore(t,this.popupWrapper.firstElementChild)}},t.prototype.timePopupCloseHandler=function(e){this.hide()},t.prototype.getFormattedValue=function(e){return i.i(a.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():u,a=i?this.initValue.getMonth():d,n=i?this.initValue.getFullYear():p;return new Date(n,a,s,t.getHours(),t.getMinutes(),t.getSeconds())}}return null},t.prototype.updateHtmlAttributeToWrapper=function(){if(!i.i(a.isNullOrUndefined)(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var s=t[e];if(y.indexOf(s)>-1)if("class"===s){var n=this.htmlAttributes[""+s].replace(/\s+/g," ").trim();""!==n&&i.i(a.addClass)([this.inputWrapper.container],n.split(" "))}else if("style"===s){var r=this.inputWrapper.container.getAttribute(s);r=i.i(a.isNullOrUndefined)(r)?this.htmlAttributes[""+s]:r+this.htmlAttributes[""+s],this.inputWrapper.container.setAttribute(s,r)}else this.inputWrapper.container.setAttribute(s,this.htmlAttributes[""+s])}},t.prototype.updateHtmlAttributeToElement=function(){if(!i.i(a.isNullOrUndefined)(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var s=t[e];y.indexOf(s)<0&&this.inputElement.setAttribute(s,this.htmlAttributes[""+s])}},t.prototype.updateCssClass=function(e,t){i.i(a.isNullOrUndefined)(t)||(t=t.replace(/\s+/g," ").trim()),i.i(a.isNullOrUndefined)(e)||(e=e.replace(/\s+/g," ").trim()),r.Input.setCssClass(e,[this.inputWrapper.container],t),this.popupWrapper&&r.Input.setCssClass(e,[this.popupWrapper],t)},t.prototype.removeErrorClass=function(){i.i(a.removeClass)([this.inputWrapper.container],"e-error"),i.i(a.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():(i.i(a.addClass)([this.inputWrapper.container],"e-error"),i.i(a.attributes)(this.inputElement,{"aria-invalid":"true"}))},t.prototype.validateInterval=function(){!i.i(a.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){i.i(a.addClass)(e,m)},t.prototype.enableElement=function(e){i.i(a.removeClass)(e,m)},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=i.i(a.getValue)("dayPeriods.format.wide",i.i(a.getDefaultDateObject)());else{e=i.i(a.getValue)("main."+this.locale+".dates.calendars.gregorian.dayPeriods.format.abbreviated",a.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 i.i(a.isNullOrUndefined)(this.popupWrapper)?null:this.popupWrapper.querySelectorAll(".e-active")},t.prototype.isNullOrEmpty=function(e){return!!(i.i(a.isNullOrUndefined)(e)||"string"==typeof e&&""===e.trim())},t.prototype.setWidth=function(e){return e="number"==typeof e?i.i(a.formatUnit)(e):"string"==typeof e?e.match(/px|%|em/)?e:i.i(a.formatUnit)(e):"100%"},t.prototype.setPopupWidth=function(e){if(e=this.setWidth(e),e.indexOf("%")>-1){e=(this.containerStyle.width*parseFloat(e)/100).toString()+"px"}return e},t.prototype.setScrollPosition=function(){var e=this.selectedElement;i.i(a.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(i.i(a.isNullOrUndefined)(this.popupWrapper))this.popupWrapper.scrollTop=0;else{var t=this.popupWrapper.querySelectorAll("."+v);if(t.length){var s=this.timeCollections[0],n=this.getDateObject(this.checkDateValue(this.scrollTo)).getTime();e=t[Math.round((n-s)/(6e4*this.step))]}}i.i(a.isNullOrUndefined)(e)?this.popupWrapper.scrollTop=0:this.findScrollTop(e)},t.prototype.getText=function(){return i.i(a.isNullOrUndefined)(this.checkDateValue(this.value))?"":this.getValue(this.value)},t.prototype.getValue=function(e){return i.i(a.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?i.i(a.getValue)("dateFormats.short",i.i(a.getDefaultDateObject)()):this.getCultureDateObject(a.cldrData,""+this.locale)},t.prototype.cldrTimeFormat=function(){return this.isNullOrEmpty(this.formatString)?"en"===this.locale||"en-US"===this.locale?i.i(a.getValue)("timeFormats.short",i.i(a.getDefaultDateObject)()):this.getCultureTimeObject(a.cldrData,""+this.locale):this.formatString},t.prototype.dateToNumeric=function(){return"en"===this.locale||"en-US"===this.locale?i.i(a.getValue)("timeFormats.medium",i.i(a.getDefaultDateObject)()):i.i(a.getValue)("main."+this.locale+".dates.calendars.gregorian.timeFormats.medium",a.cldrData)},t.prototype.getExactDateTime=function(e){return i.i(a.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 i.i(a.isNullOrUndefined)(e)?null:e!==this.getText()?this.getDateObject(e):this.getDateObject(this.value)},t.prototype.updatePlaceHolder=function(){r.Input.setPlaceholder(this.l10n.getConstant("placeholder"),this.inputElement)},t.prototype.updateInputValue=function(e){r.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&&(a.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),a.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"});a.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){a=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: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:e}));break;default:this.isNavigate=!1}},t.prototype.onMouseClick=function(e){var t=e.target,s=this.selectedElement=i.i(a.closest)(t,"."+v);this.setSelection(s,e),s&&s.classList.contains(v)&&this.hide()},t.prototype.closePopup=function(e,t){var s=this;if(this.isPopupOpen()&&this.popupWrapper){var n={popup:this.popupObj,event:t||null,cancel:!1,name:"open"};i.i(a.removeClass)([document.body],"e-time-overflow"),this.trigger("close",n,function(t){if(!t.cancel){var n={name:"FadeOut",duration:50,delay:e||0};s.popupObj.hide(new a.Animation(n)),i.i(a.removeClass)([s.inputWrapper.container],["e-icon-anim"]),i.i(a.attributes)(s.inputElement,{"aria-expanded":"false"}),s.inputElement.removeAttribute("aria-owns"),s.inputElement.removeAttribute("aria-controls"),s.inputElement.removeAttribute("aria-activedescendant"),a.EventHandler.remove(document,"mousedown touchstart",s.documentClickHandler)}a.Browser.isDevice&&s.modal&&(s.modal.style.display="none",s.modal.outerHTML="",s.modal=null),a.Browser.isDevice&&(i.i(a.isNullOrUndefined)(s.mobileTimePopupWrap)||(s.mobileTimePopupWrap.remove(),s.mobileTimePopupWrap=null)),a.Browser.isDevice&&s.allowEdit&&!s.readonly&&s.inputElement.removeAttribute("readonly")})}else a.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){var s=this.getDateObject(new Date(this.timeCollections[this.activeIndex]));+this.prevDate!=+s&&this.valueProcess(e,s)}else(this.prevValue!==this.inputElement.value||i.i(a.isNullOrUndefined)(this.checkDateValue(this.value)))&&this.valueProcess(e,this.compareFormatChange(this.inputElement.value));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=i.i(a.closest)(e.target,"."+v);this.setHover(t,"e-hover")},t.prototype.setHover=function(e,t){this.enabled&&this.isValidLI(e)&&!e.classList.contains(t)&&(this.removeHover(t),i.i(a.addClass)([e],t),"e-navigation"===t&&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]),i.i(a.addClass)([this.selectedElement],"e-active"),this.selectedElement.setAttribute("aria-selected","true"),this.checkValueChange(t,!0))},t.prototype.onMouseLeave=function(){this.removeHover("e-hover")},t.prototype.scrollHandler=function(){"timepicker"===this.getModuleName()&&a.Browser.isDevice||this.hide()},t.prototype.setMinMax=function(e,t){i.i(a.isNullOrUndefined)(this.checkDateValue(e))&&(this.initMin=this.getDateObject("12:00:00 AM")),i.i(a.isNullOrUndefined)(this.checkDateValue(t))&&(this.initMax=this.getDateObject("11:59:59 PM"))},t.prototype.validateMinMax=function(e,t,s){var n=e instanceof Date?e:this.getDateObject(e);return i.i(a.isNullOrUndefined)(this.checkDateValue(n))?+this.createDateObj(this.getFormattedValue(this.initMin))>+this.createDateObj(this.getFormattedValue(this.initMax))&&this.disableTimeIcon():e=this.strictOperation(this.initMin,this.initMax,e,n),this.strictMode&&(e=this.valueIsDisable(e)?e:null),this.checkErrorState(e),e},t.prototype.valueIsDisable=function(e){if(this.disableItemCollection.length>0){if(this.disableItemCollection.length===this.timeCollections.length)return!1;for(var t=e instanceof Date?this.objToString(e):e,i=0;i<this.disableItemCollection.length;i++)if(t===this.disableItemCollection[i])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)),n=this.setCurrentDate(this.getDateObject(this.initMin));if(i.i(a.isNullOrUndefined)(this.checkDateValue(t))){if(+s<+n||""!==this.inputElement.value)return!1}else if(+t>+s||+t<+n)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(){a.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.popupHandler,this),a.EventHandler.add(this.inputElement,"blur",this.inputBlurHandler,this),a.EventHandler.add(this.inputElement,"focus",this.inputFocusHandler,this),a.EventHandler.add(this.inputElement,"change",this.inputChangeHandler,this),a.EventHandler.add(this.inputElement,"input",this.inputEventHandler,this),this.enableMask&&a.EventHandler.add(this.inputElement,"keydown",this.keydownHandler,this),this.showClearButton&&this.inputWrapper.clearButton&&a.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.clearHandler,this),this.formElement&&a.EventHandler.add(this.formElement,"reset",this.formResetHandler,this),a.Browser.isDevice||(this.keyConfigure=i.i(a.extend)(this.keyConfigure,this.keyConfigs),this.inputEvent=new a.KeyboardEvents(this.inputWrapper.container,{keyAction:this.inputHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}),this.showClearButton&&this.inputElement&&a.EventHandler.add(this.inputElement,"mousedown",this.mouseDownHandler,this))},t.prototype.keydownHandler=function(e){switch(e.code){case"Delete":!this.enableMask||this.popupObj||this.readonly||this.notify("keyDownHandler",{module:"MaskedDateTime",e:e})}},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&&a.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown touchstart",this.popupHandler),a.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),a.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),a.EventHandler.remove(this.inputElement,"change",this.inputChangeHandler),a.EventHandler.remove(this.inputElement,"input",this.inputEventHandler),this.inputEvent&&this.inputEvent.destroy(),a.EventHandler.remove(this.inputElement,"mousedown touchstart",this.mouseDownHandler),!this.showClearButton||i.i(a.isNullOrUndefined)(this.inputWrapper)||i.i(a.isNullOrUndefined)(this.inputWrapper.clearButton)||a.EventHandler.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.clearHandler),this.formElement&&a.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},t.prototype.bindClearEvent=function(){this.showClearButton&&this.inputWrapper.clearButton&&a.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(),i.i(a.isNullOrUndefined)(this.value)?(this.resetState(),this.raiseClearedEvent(e)):this.clear(e),this.popupWrapper&&(this.popupWrapper.scrollTop=0),this.enableMask&&this.notify("clearHandler",{module:"MaskedDateTime"}),i.i(a.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=e?i.i(a.isNullOrUndefined)(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["step","disabled","readonly","style","name","value","min","max","placeholder"],n=0,r=s;n<r.length;n++){var l=r[n];if(!i.i(a.isNullOrUndefined)(this.inputElement.getAttribute(l)))switch(l){case"disabled":if(i.i(a.isNullOrUndefined)(this.timeOptions)||void 0===this.timeOptions.enabled||e){var o="disabled"!==this.inputElement.getAttribute(l)&&""!==this.inputElement.getAttribute(l)&&"true"!==this.inputElement.getAttribute(l);this.setProperties({enabled:o},!e)}break;case"style":this.inputStyle=this.inputElement.getAttribute(l);break;case"readonly":if(i.i(a.isNullOrUndefined)(this.timeOptions)||void 0===this.timeOptions.readonly||e){var h="readonly"===this.inputElement.getAttribute(l)||""===this.inputElement.getAttribute(l)||"true"===this.inputElement.getAttribute(l);this.setProperties({readonly:h},!e)}break;case"name":this.inputElement.setAttribute("name",this.inputElement.getAttribute(l));break;case"step":this.step=parseInt(this.inputElement.getAttribute(l),10);break;case"placeholder":(i.i(a.isNullOrUndefined)(this.timeOptions)||void 0===this.timeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(l)},!e);break;case"min":(i.i(a.isNullOrUndefined)(this.timeOptions)||void 0===this.timeOptions.min||e)&&(t=new Date(this.inputElement.getAttribute(l)),i.i(a.isNullOrUndefined)(this.checkDateValue(t))||this.setProperties({min:t},!e));break;case"max":(i.i(a.isNullOrUndefined)(this.timeOptions)||void 0===this.timeOptions.max||e)&&(t=new Date(this.inputElement.getAttribute(l)),i.i(a.isNullOrUndefined)(this.checkDateValue(t))||this.setProperties({max:t},!e));break;case"value":(i.i(a.isNullOrUndefined)(this.timeOptions)||void 0===this.timeOptions.value||e)&&(t=new Date(this.inputElement.getAttribute(l)),i.i(a.isNullOrUndefined)(this.checkDateValue(t))||(this.initValue=t,this.updateInput(!1,this.initValue),this.setProperties({value:t},!e)))}}},t.prototype.setCurrentDate=function(e){return i.i(a.isNullOrUndefined)(this.checkDateValue(e))?null:new Date(p,d,u,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 n=null===s&&e.trim().length>0?this.previousState(this.prevDate):this.inputElement.value;this.updateInputValue(n),this.enableMask&&(n||this.updateInputValue(this.maskedDateValue),i.i(a.isNullOrUndefined)(s)&&e!==this.maskedDateValue&&this.createMask(),i.i(a.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(),r.Input.setValue("",this.inputElement,this.floatLabelType,!1),this.valueWithMinutes=this.activeIndex=null,this.strictMode||this.checkErrorState(null)},t.prototype.objToString=function(e){return i.i(a.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,n=this.validateMinMax(t,this.min,this.max),r=this.getDateObject(n);if(this.getFormattedValue(r)!==this.getFormattedValue(this.value)?(this.valueWithMinutes=i.i(a.isNullOrUndefined)(r)?null:r,s=this.objToString(this.valueWithMinutes)):(this.strictMode&&(e=r),this.valueWithMinutes=this.checkDateValue(e),s=this.objToString(this.valueWithMinutes)),!this.strictMode&&i.i(a.isNullOrUndefined)(s)){var l=n.trim().length>0?n:"";this.updateInputValue(l),this.enableMask&&(l||this.updateInputValue(this.maskedDateValue))}else this.updateInputValue(s),this.enableMask&&(""===s&&this.updateInputValue(this.maskedDateValue),i.i(a.isNullOrUndefined)(s)&&t!==this.maskedDateValue&&this.createMask(),i.i(a.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=i.i(a.isNullOrUndefined)(this.valueWithMinutes)?this.createDateObj(t):this.getDateObject(this.valueWithMinutes),n=null,r=this.liCollections.length,l=this.timeCollections;if(i.i(a.isNullOrUndefined)(this.checkDateValue(s))&&i.i(a.isNullOrUndefined)(this.activeIndex))this.selectNextItem(e);else{if("home"===e.action){var o=this.validLiElement(0);n=+this.createDateObj(new Date(this.timeCollections[o])),this.activeIndex=o}else if("end"===e.action){var o=this.validLiElement(l.length-1,!0);n=+this.createDateObj(new Date(this.timeCollections[o])),this.activeIndex=o}else if("down"===e.action)for(var h=0;h<r;h++){if(+s<this.timeCollections[h]){var o=this.validLiElement(h);n=+this.createDateObj(new Date(this.timeCollections[o])),this.activeIndex=o;break}if(h===r-1){var o=this.validLiElement(0);n=+this.createDateObj(new Date(this.timeCollections[o])),this.activeIndex=o;break}}else for(var h=r-1;h>=0;h--){if(+s>this.timeCollections[h]){var o=this.validLiElement(h,!0);n=+this.createDateObj(new Date(this.timeCollections[o])),this.activeIndex=o;break}if(0===h){var o=this.validLiElement(r-1);n=+this.createDateObj(new Date(this.timeCollections[o])),this.activeIndex=o;break}}this.selectedElement=this.liCollections[this.activeIndex],this.elementValue(i.i(a.isNullOrUndefined)(n)?null:new Date(n))}},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){i.i(a.isNullOrUndefined)(this.checkDateValue(e))||this.checkValue(e)},t.prototype.validLiElement=function(e,t){var s=null,n=i.i(a.isNullOrUndefined)(this.popupWrapper)?this.liCollections:this.popupWrapper.querySelectorAll("."+v),r=!0;if(n.length)if(t)for(var l=e;l>=0;l--){if(!n[l].classList.contains(m)){s=l;break}0===l&&r&&(e=l=n.length,r=!1)}else for(var l=e;l<=n.length-1;l++){if(!n[l].classList.contains(m)){s=l;break}l===n.length-1&&r&&(e=l=-1,r=!1)}return s},t.prototype.keyHandler=function(e){if(!(i.i(a.isNullOrUndefined)(this.step)||this.step<=0||!i.i(a.isNullOrUndefined)(this.inputWrapper)&&this.inputWrapper.buttons[0].classList.contains(m))){var t=this.timeCollections.length;if(i.i(a.isNullOrUndefined)(this.getActiveElement())||0===this.getActiveElement().length)if(this.liCollections.length>0)if(i.i(a.isNullOrUndefined)(this.value)&&i.i(a.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 n=void 0;if(e.keyCode>=37&&e.keyCode<=40){var 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),n=i.i(a.isNullOrUndefined)(this.timeCollections[s])?this.timeCollections[0]:this.timeCollections[s]}else if("home"===e.action){var s=this.validLiElement(0);this.activeIndex=s,n=this.timeCollections[s]}else if("end"===e.action){var s=this.validLiElement(t-1,!0);this.activeIndex=s,n=this.timeCollections[s]}this.selectedElement=this.liCollections[this.activeIndex],this.elementValue(new Date(n))}this.isNavigate=!0,this.setHover(this.selectedElement,"e-navigation"),this.setActiveDescendant(),this.enableMask&&this.selectInputText(),!this.isPopupOpen()||null===this.selectedElement||e&&"click"===e.type||this.setScrollPosition()}},t.prototype.getCultureTimeObject=function(e,t){return i.i(a.getValue)("main."+t+".dates.calendars.gregorian.timeFormats.short",e)},t.prototype.getCultureDateObject=function(e,t){return i.i(a.getValue)("main."+t+".dates.calendars.gregorian.dateFormats.short",e)},t.prototype.wireListEvents=function(){a.EventHandler.add(this.listWrapper,"click",this.onMouseClick,this),a.Browser.isDevice||(a.EventHandler.add(this.listWrapper,"mouseover",this.onMouseOver,this),a.EventHandler.add(this.listWrapper,"mouseout",this.onMouseLeave,this))},t.prototype.unWireListEvents=function(){this.listWrapper&&(a.EventHandler.remove(this.listWrapper,"click",this.onMouseClick),a.Browser.isDevice||(a.EventHandler.remove(this.listWrapper,"mouseover",this.onMouseOver),a.EventHandler.remove(this.listWrapper,"mouseout",this.onMouseLeave)))},t.prototype.valueProcess=function(e,t){var s=i.i(a.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:!i.i(a.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&&i.i(a.isNullOrUndefined)(this.value)&&this.invalidValueString&&(this.checkErrorState(this.invalidValueString),this.updateInputValue(this.invalidValueString)),this.clearIconState()},t.prototype.setActiveDescendant=function(){!i.i(a.isNullOrUndefined)(this.selectedElement)&&this.value?i.i(a.attributes)(this.inputElement,{"aria-activedescendant":this.selectedElement.getAttribute("id")}):this.inputElement.removeAttribute("aria-activedescendant")},t.prototype.removeSelection=function(){if(this.removeHover("e-hover"),!i.i(a.isNullOrUndefined)(this.popupWrapper)){var e=this.popupWrapper.querySelectorAll(".e-active");e.length&&(i.i(a.removeClass)(e,"e-active"),e[0].removeAttribute("aria-selected"))}},t.prototype.removeHover=function(e){var t=this.getHoverItem(e);t&&t.length&&(i.i(a.removeClass)(t,e),"e-navigation"===e&&t[0].removeAttribute("aria-selected"))},t.prototype.getHoverItem=function(e){var t;return i.i(a.isNullOrUndefined)(this.popupWrapper)||(t=this.popupWrapper.querySelectorAll("."+e)),t},t.prototype.setActiveClass=function(){if(!i.i(a.isNullOrUndefined)(this.popupWrapper)){var e=this.popupWrapper.querySelectorAll("."+v);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(),i.i(a.isNullOrUndefined)(this.selectedElement)||(i.i(a.addClass)([this.selectedElement],"e-active"),this.selectedElement.setAttribute("aria-selected","true"))},t.prototype.isValidLI=function(e){return e&&e.classList.contains(v)&&!e.classList.contains(m)},t.prototype.createDateObj=function(e){var t=this.globalize.formatDate(new Date,{format:null,skeleton:"short",type:"date"}),s=null;return"string"==typeof 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)),i.i(a.isNullOrUndefined)(s)&&(s=this.timeParse(t,e))):s=this.timeParse(t,e):e instanceof Date&&(s=e),s},t.prototype.timeParse=function(e,t){var s;return s=this.globalize.parseDate(e+" "+t,{format:this.cldrDateFormat()+" "+this.cldrTimeFormat(),type:"datetime"}),s=i.i(a.isNullOrUndefined)(s)?this.globalize.parseDate(e+" "+t,{format:this.cldrDateFormat()+" "+this.dateToNumeric(),type:"datetime"}):s,s=i.i(a.isNullOrUndefined)(s)?s:new Date(s.setMilliseconds(0))},t.prototype.createListItems=function(){var e=this;this.listWrapper=this.createElement("div",{className:"e-content",attrs:{tabindex:"-1"}});var t,s=6e4*this.step,n=[];this.timeCollections=[],this.disableItemCollection=[],t=+this.getDateObject(this.initMin).setMilliseconds(0);for(var r=+this.getDateObject(this.initMax).setMilliseconds(0);r>=t;)this.timeCollections.push(t),n.push(this.globalize.formatDate(new Date(t),{format:this.cldrTimeFormat(),type:"time"})),t+=s;var o={itemCreated:function(t){var i={element:t.item,text:t.text,value:e.getDateObject(t.text),isDisabled:!1};e.trigger("itemRender",i,function(t){t.isDisabled&&t.element.classList.add(m),t.element.classList.contains(m)&&e.disableItemCollection.push(t.element.getAttribute("data-value"))})}};this.listTag=l.ListBase.createList(this.createElement,n,o,!0),i.i(a.attributes)(this.listTag,{role:"listbox","aria-hidden":"false",id:this.element.id+"_options",tabindex:"0"}),i.i(a.append)([this.listTag],this.listWrapper)},t.prototype.documentClickHandler=function(e){var t=e.target;i.i(a.isNullOrUndefined)(this.popupObj)||i.i(a.isNullOrUndefined)(this.inputWrapper)||!(this.inputWrapper.container.contains(t)&&"mousedown"!==e.type||this.popupObj.element&&this.popupObj.element.contains(t))||"touchstart"===e.type||e.preventDefault(),i.i(a.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.classList.contains("e-dlg-overlay")?t!==this.inputElement&&(a.Browser.isDevice||(this.isPreventBlur=(a.Browser.isIE||"edge"===a.Browser.info.name)&&document.activeElement===this.inputElement&&t===this.popupWrapper)):this.isPopupOpen()&&(this.hide(),this.focusOut())},t.prototype.setEnableRtl=function(){r.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]),this.popupObj&&(this.popupObj.enableRtl=this.enableRtl,this.popupObj.dataBind())},t.prototype.setEnable=function(){r.Input.setEnabled(this.enabled,this.inputElement,this.floatLabelType),this.enabled?(i.i(a.removeClass)([this.inputWrapper.container],m),i.i(a.attributes)(this.inputElement,{"aria-disabled":"false"}),this.inputElement.setAttribute("tabindex",this.tabIndex)):(this.hide(),i.i(a.addClass)([this.inputWrapper.container],m),i.i(a.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.enabled){if(this.isPreventBlur&&this.isPopupOpen())return void this.inputElement.focus();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("")),i.i(a.removeClass)([this.inputWrapper.container],[f]),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(),i.i(a.removeClass)([this.inputWrapper.container],[f]);var e={model:this};this.trigger("blur",e)}},t.prototype.isPopupOpen=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains(""+c))},t.prototype.inputFocusHandler=function(){if(this.enabled){var e={model:this};this.readonly||a.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.trigger("focus",e),this.clearIconState(),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(),a.Browser.isDevice&&this.listWrapper&&(this.modal=this.createElement("div"),this.modal.className=c+" e-time-modal",document.body.className+=" e-time-overflow",document.body.appendChild(this.modal)),a.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:a.Browser.isDevice?this.mobileTimePopupWrap:document.body};var s=this.openPopupEventArgs;if(this.trigger("open",s,function(e){if(t.openPopupEventArgs=e,t.openPopupEventArgs.cancel||t.inputWrapper.buttons[0].classList.contains(m))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(),a.Browser.isDevice||t.inputElement.focus();var s={name:"FadeIn",duration:50};t.popupObj.refreshPosition(t.anchor),1e3===t.zIndex?t.popupObj.show(new a.Animation(s),t.element):t.popupObj.show(new a.Animation(s),null),t.setActiveDescendant(),i.i(a.attributes)(t.inputElement,{"aria-expanded":"true"}),i.i(a.attributes)(t.inputElement,{"aria-owns":t.inputElement.id+"_options"}),i.i(a.attributes)(t.inputElement,{"aria-controls":t.inputElement.id}),i.i(a.addClass)([t.inputWrapper.container],f),a.EventHandler.add(document,"mousedown touchstart",t.documentClickHandler,t),t.setOverlayIndex(t.mobileTimePopupWrap,t.popupObj.element,t.modal,a.Browser.isDevice)}}),a.Browser.isDevice){var n=this.createElement("div",{className:"e-dlg-overlay"});n.style.zIndex=(this.zIndex-1).toString(),this.mobileTimePopupWrap.appendChild(n)}}},t.prototype.setOverlayIndex=function(e,t,s,n){if(n&&!i.i(a.isNullOrUndefined)(t)&&!i.i(a.isNullOrUndefined)(s)&&!i.i(a.isNullOrUndefined)(e)){var r=parseInt(t.style.zIndex,10)?parseInt(t.style.zIndex,10):1e3;s.style.zIndex=(r-1).toString(),e.style.zIndex=r.toString()}},t.prototype.formatValues=function(e){var t;return"number"==typeof e?t=i.i(a.formatUnit)(e):"string"==typeof e&&(t=e.match(/px|%|em/)?e:isNaN(parseInt(e,10))?e:i.i(a.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)),a.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(){var e=["value"];return this.addOnPersist(e)},t.prototype.getModuleName=function(){return"timepicker"},t.prototype.onPropertyChanged=function(e,t){for(var s=0,n=Object.keys(e);s<n.length;s++){var l=n[s];switch(l){case"placeholder":r.Input.setPlaceholder(e.placeholder,this.inputElement);break;case"readonly":r.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,l);break;case"showClearButton":r.Input.setClearButton(this.showClearButton,this.inputElement,this.inputWrapper),this.bindClearEvent();break;case"locale":this.setProperties({locale:e.locale},!0),this.globalize=new a.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":i.i(a.setStyleAttribute)(this.inputWrapper.container,{width:this.setWidth(e.width)}),this.containerStyle=this.inputWrapper.container.getBoundingClientRect(),r.Input.calculateWidth(this.inputElement,this.inputWrapper.container),i.i(a.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(a.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&&i.i(a.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,r.Input.removeFloating(this.inputWrapper),r.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder),i.i(a.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(a.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},h([i.i(a.Property)(null)],t.prototype,"width",void 0),h([i.i(a.Property)(null)],t.prototype,"cssClass",void 0),h([i.i(a.Property)(!1)],t.prototype,"strictMode",void 0),h([i.i(a.Property)(null)],t.prototype,"keyConfigs",void 0),h([i.i(a.Property)(null)],t.prototype,"format",void 0),h([i.i(a.Property)(!0)],t.prototype,"enabled",void 0),h([i.i(a.Property)(!1)],t.prototype,"fullScreenMode",void 0),h([i.i(a.Property)(!1)],t.prototype,"readonly",void 0),h([i.i(a.Property)({})],t.prototype,"htmlAttributes",void 0),h([i.i(a.Property)("Never")],t.prototype,"floatLabelType",void 0),h([i.i(a.Property)(null)],t.prototype,"placeholder",void 0),h([i.i(a.Property)(1e3)],t.prototype,"zIndex",void 0),h([i.i(a.Property)(!1)],t.prototype,"enablePersistence",void 0),h([i.i(a.Property)(!0)],t.prototype,"showClearButton",void 0),h([i.i(a.Property)(30)],t.prototype,"step",void 0),h([i.i(a.Property)(null)],t.prototype,"scrollTo",void 0),h([i.i(a.Property)(null)],t.prototype,"value",void 0),h([i.i(a.Property)(null)],t.prototype,"min",void 0),h([i.i(a.Property)(null)],t.prototype,"max",void 0),h([i.i(a.Property)(!0)],t.prototype,"allowEdit",void 0),h([i.i(a.Property)(!1)],t.prototype,"openOnFocus",void 0),h([i.i(a.Property)(!1)],t.prototype,"enableMask",void 0),h([i.i(a.Property)({day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"})],t.prototype,"maskPlaceholder",void 0),h([i.i(a.Property)(null)],t.prototype,"serverTimezoneOffset",void 0),h([i.i(a.Event)()],t.prototype,"change",void 0),h([i.i(a.Event)()],t.prototype,"created",void 0),h([i.i(a.Event)()],t.prototype,"destroyed",void 0),h([i.i(a.Event)()],t.prototype,"open",void 0),h([i.i(a.Event)()],t.prototype,"itemRender",void 0),h([i.i(a.Event)()],t.prototype,"close",void 0),h([i.i(a.Event)()],t.prototype,"cleared",void 0),h([i.i(a.Event)()],t.prototype,"blur",void 0),h([i.i(a.Event)()],t.prototype,"focus",void 0),t=h([a.NotifyPropertyChanges],t)}(a.Component)},function(e,t){e.exports=s},function(e,t,i){"use strict";var s=i(3);i.d(t,"a",function(){return s.b}),i.d(t,"b",function(){return s.a});var a=i(13);i.d(t,"c",function(){return a.a})},function(e,t,i){"use strict";var s=i(4);i.d(t,"a",function(){return s.a})},function(e,t,i){"use strict";var s=i(14);i.d(t,"a",function(){return s.a}),i.d(t,"b",function(){return s.b})},function(e,t,i){"use strict";var s=i(15);i.d(t,"a",function(){return s.a})},function(e,t,i){"use strict";var s=i(17);i.d(t,"a",function(){return s.a})},function(e,t,i){"use strict";var s=i(5);i.d(t,"a",function(){return s.a}),i.d(t,"b",function(){return s.b}),i.d(t,"c",function(){return s.c})},function(e,t,i){"use strict";i.d(t,"a",function(){return r});var s=i(0),a=(i.n(s),"e-other-month"),n="e-disabled",r=function(){function e(e){this.calendarInstance=e}return e.prototype.getModuleName=function(){return"islamic"},e.prototype.islamicTitleUpdate=function(e,t){var i=new s.Internationalization(this.calendarInstance.locale);switch(t){case"days":this.calendarInstance.headerTitleElement.textContent=i.formatDate(e,{type:"dateTime",format:"MMMMyyyy",calendar:"islamic"});break;case"months":this.calendarInstance.headerTitleElement.textContent=i.formatDate(e,{type:"dateTime",format:"yyyy",calendar:"islamic"})}},e.prototype.islamicRenderDays=function(e,t,r,l){var o,h=[],u=new Date(this.islamicInValue(e));this.islamicTitleUpdate(e,"days");var d=this.getIslamicDate(u),p=this.toGregorian(d.year,d.month,1),c=d.month;for(u=p;u.getDay()!==this.calendarInstance.firstDayOfWeek;)this.calendarInstance.setStartDate(u,-864e5);for(var m=0;m<42;++m){var f=this.calendarInstance.createElement("td",{className:"e-cell"}),v=this.calendarInstance.createElement("span");m%7==0&&this.calendarInstance.weekNumber&&(v.textContent=""+this.calendarInstance.getWeek(u),f.appendChild(v),i.i(s.addClass)([f],"e-week-number"),h.push(f)),o=new Date(+u),u=this.calendarInstance.minMaxDate(u);var y={type:"dateTime",skeleton:"full",calendar:"islamic"},g=this.calendarInstance.globalize.parseDate(this.calendarInstance.globalize.formatDate(u,y),y),b=this.islamicDayCell(u),D=this.calendarInstance.globalize.formatDate(u,{type:"date",skeleton:"full",calendar:"islamic"}),E=this.calendarInstance.createElement("span");E.textContent=this.calendarInstance.globalize.formatDate(u,{type:"date",skeleton:"d",calendar:"islamic"});var C=this.calendarInstance.min>u||this.calendarInstance.max<u;C?(i.i(s.addClass)([b],n),i.i(s.addClass)([b],"e-overlay")):E.setAttribute("title",""+D);c!==this.getIslamicDate(u).month&&i.i(s.addClass)([b],a),0!==u.getDay()&&6!==u.getDay()||i.i(s.addClass)([b],"e-weekend"),b.appendChild(E),this.calendarInstance.renderDayCellArgs={date:u,isDisabled:!1,element:b,isOutOfRange:C};var k=this.calendarInstance.renderDayCellArgs;if(this.calendarInstance.renderDayCellEvent(k),k.isDisabled)if(this.calendarInstance.isMultiSelection){if(!i.i(s.isNullOrUndefined)(this.calendarInstance.values)&&this.calendarInstance.values.length>0)for(var w=0;w<l.length;w++){var M=+new Date(this.calendarInstance.globalize.formatDate(k.date,{type:"date",skeleton:"yMd",calendar:"islamic"})),V=+new Date(this.calendarInstance.globalize.formatDate(this.calendarInstance.values[w],{type:"date",skeleton:"yMd",calendar:"islamic"}));M===V&&(this.calendarInstance.values.splice(w,1),w=-1)}}else t&&+t==+k.date&&this.calendarInstance.setProperties({value:null},!0);this.calendarInstance.renderDayCellArgs.isDisabled&&!b.classList.contains("e-selected")&&(i.i(s.addClass)([b],n),i.i(s.addClass)([b],"e-overlay"),+this.calendarInstance.renderDayCellArgs.date==+this.calendarInstance.todayDate&&(this.calendarInstance.todayDisabled=!0));var N=b.classList.contains(a),O=b.classList.contains(n);if(O||s.EventHandler.add(b,"click",this.calendarInstance.clickHandler,this.calendarInstance),!this.calendarInstance.isMultiSelection||i.i(s.isNullOrUndefined)(this.calendarInstance.values)||N||O)N||O||!this.calendarInstance.getDateVal(u,t)?this.calendarInstance.updateFocus(N,O,u,b,e):i.i(s.addClass)([b],"e-selected");else{for(var I=0;I<this.calendarInstance.values.length;I++){var M=this.calendarInstance.globalize.formatDate(u,{type:"date",skeleton:"short",calendar:"islamic"}),V=this.calendarInstance.globalize.formatDate(this.calendarInstance.values[I],{type:"date",skeleton:"short",calendar:"islamic"});M===V&&this.calendarInstance.getDateVal(u,this.calendarInstance.values[I])?i.i(s.addClass)([b],"e-selected"):this.calendarInstance.updateFocus(N,O,u,b,e)}this.calendarInstance.values.length<=0&&this.calendarInstance.updateFocus(N,O,u,b,e)}g.getDate()===(new Date).getDate()&&g.getMonth()===(new Date).getMonth()&&g.getFullYear()===(new Date).getFullYear()&&i.i(s.addClass)([b],"e-today"),u=new Date(+o),h.push(this.calendarInstance.renderDayCellArgs.element),this.calendarInstance.addDay(u,1,null,this.calendarInstance.max,this.calendarInstance.min)}return h},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,i=this.islamicCompareMonth(e,this.calendarInstance.max)>-1;this.calendarInstance.previousIconHandler(t),this.calendarInstance.nextIconHandler(i);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=s.HijriParser.toGregorian(1361,1,1),l=this.hijriCompareDecade(e,this.calendarInstance.min)<1,o=this.hijriCompareDecade(e,this.calendarInstance.max)>-1;l=s.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 a=[],r=i.i(s.isNullOrUndefined)(t),l=new Date(this.islamicInValue(this.calendarInstance.currentDate)),o=l,h=this.getIslamicDate(o);o=s.HijriParser.toGregorian(h.year,1,1);var u=h.month,d=h.year,p=h.year,c=this.getIslamicDate(this.calendarInstance.min).year,m=this.getIslamicDate(this.calendarInstance.min).month,f=this.getIslamicDate(this.calendarInstance.max).year,v=this.getIslamicDate(this.calendarInstance.max).month;this.islamicTitleUpdate(this.calendarInstance.currentDate,"months");for(var y=1;y<=12;++y){var g=this.getIslamicDate(o);o=s.HijriParser.toGregorian(g.year,y,1);var b=this.islamicDayCell(o),D=this.calendarInstance.createElement("span"),E=t&&this.getIslamicDate(t).month===this.getIslamicDate(o).month,C=t&&this.getIslamicDate(t).year===d&&E;D.textContent=this.calendarInstance.globalize.formatDate(o,{type:"dateTime",format:"MMM",calendar:"islamic"}),this.calendarInstance.min&&(p<c||y<m&&p===c)||this.calendarInstance.max&&(p>f||y>v&&p>=f)?i.i(s.addClass)([b],n):!r&&C?i.i(s.addClass)([b],"e-selected"):this.getIslamicDate(o).month===u&&this.getIslamicDate(this.calendarInstance.currentDate).month===u&&i.i(s.addClass)([b],"e-focused-date"),b.classList.contains(n)||s.EventHandler.add(b,"click",this.calendarInstance.clickHandler,this.calendarInstance),b.appendChild(D),a.push(b)}this.islamicRenderTemplate(a,4,"e-year",e,t)},e.prototype.islamicRenderDecade=function(e,t){this.calendarInstance.removeTableHeadElement();var r=[],l=new Date(this.islamicInValue(this.calendarInstance.currentDate)),o=this.getIslamicDate(l);l=s.HijriParser.toGregorian(o.year,1,1);var h=l.getFullYear(),u=new Date(this.islamicInValue(h-h%10)),d=new Date(this.islamicInValue(h-h%10+9)),p=u.getFullYear(),c=d.getFullYear(),m=this.calendarInstance.globalize.formatDate(u,{type:"dateTime",format:"y",calendar:"islamic"}),f=this.calendarInstance.globalize.formatDate(d,{type:"dateTime",format:"y",calendar:"islamic"});"ar"===this.calendarInstance.locale&&(m=Number(m.replace(/[٠١٢٣٤٥٦٧٨٩]/g,function(e){return String.fromCharCode(e.charCodeAt(0)-1632+48)})),f=Number(f.replace(/[٠١٢٣٤٥٦٧٨٩]/g,function(e){return String.fromCharCode(e.charCodeAt(0)-1632+48)})));var v=this.calendarInstance.headerElement.textContent.split("-");if((!i.i(s.isNullOrUndefined)(e)&&v[0]!==m&&"home"===e.action||!i.i(s.isNullOrUndefined)(e)&&"keydown"===e.type&&"end"===e.action)&&(m=this.calendarInstance.headerElement.textContent.split("-")[0].trim(),f=this.calendarInstance.headerElement.textContent.split("-")[1].trim()),this.calendarInstance.islamicPreviousHeader&&(m=this.calendarInstance.islamicPreviousHeader.split("-")[0].trim(),f=this.calendarInstance.islamicPreviousHeader.split("-")[1].trim(),this.calendarInstance.islamicPreviousHeader=null),this.calendarInstance.previousIconClicked){for(var y=0;y<=v.length;y++)(f=f-v[y]==2||v[y]-f==2?(parseInt(f,10)+1).toString():f-v[y]==3||v[y]-f==3?(parseInt(f,10)+2).toString():f-v[y]==4||v[y]-f==4?(parseInt(f,10)+3).toString():f-v[y]==5||v[y]-f==5?(parseInt(f,10)+4).toString():f)-v[y]!=0&&v[y]-f!=0||(f=(parseInt(f,10)-1).toString());f-v[y]!=8&&v[y]-f!=8||(f=(parseInt(f,10)-9).toString(),m=(parseInt(f,10)-9).toString()),f-v[y]!=7&&v[y]-f!=7||(f=(parseInt(f,10)-8).toString(),m=(parseInt(f,10)-9).toString()),m=f-m==10?(parseInt(m,10)+1).toString():f-m==11?(parseInt(m,10)+2).toString():f-m==12?(parseInt(m,10)+3).toString():m,f-m==8&&(m=(parseInt(m,10)-1).toString())}if(this.calendarInstance.nextIconClicked){for(var g=0;g<=v.length;g++)m-v[g]!=0&&v[g]-m!=0||(m=(parseInt(m,10)+1).toString()),m-v[g]==2&&m>v[g].trim()&&(m=(parseInt(m,10)-1).toString()),v[g]-m==1&&m<v[g].trim()&&(m=(parseInt(m,10)+2).toString());m-this.calendarInstance.headerTitleElement.textContent.split("-")[1].trim()>1&&(m=(parseInt(this.calendarInstance.headerTitleElement.textContent.split("-")[1].trim(),10)+1).toString(),f=(parseInt(m,10)+9).toString()),f=f-m==10?(parseInt(f,10)-1).toString():f,f=f-m==7?(parseInt(f,10)+2).toString():f-m==8?(parseInt(f,10)+1).toString():f}if("ar"===this.calendarInstance.locale){var b=this.calendarInstance.globalize.formatDate(u,{type:"dateTime",format:"y",calendar:"islamic"}),D=this.calendarInstance.globalize.formatDate(d,{type:"dateTime",format:"y",calendar:"islamic"});this.calendarInstance.headerTitleElement.textContent=b+" - "+D}else this.calendarInstance.headerTitleElement.textContent=m+" - "+f;this.calendarInstance.nextIconClicked=this.calendarInstance.previousIconClicked=!1;var E=(parseInt(m,10)-2).toString();p=Math.round(.97*parseInt(m,10)+622),c=Math.round(.97*parseInt(f,10)+622);for(var C=Math.round(.97*parseInt(E,10)+622),k=1;k<=12;++k){var w=C+k;l.setFullYear(w),l.setDate(1),l.setMonth(0),this.getIslamicDate(l).year-o.year>1&&(l.setMonth(1),k-=1,l.setFullYear(l.getFullYear()-1)),o=this.getIslamicDate(l);if(l=s.HijriParser.toGregorian(o.year,1,1),o.year===parseInt(m,10)-1||o.year>=m&&o.year<=c||o.year===parseInt(f,10)+1){var M=this.islamicDayCell(l);i.i(s.attributes)(M,{role:"gridcell"});var V=this.calendarInstance.createElement("span");V.textContent=this.calendarInstance.globalize.formatDate(l,{type:"dateTime",format:"y",calendar:"islamic"}),o.year===parseInt(m,10)-1||w<p||w>c&&o.year!==parseInt(f,10)?i.i(s.addClass)([M],a):w<new Date(this.islamicInValue(this.calendarInstance.min)).getFullYear()||w>new Date(this.islamicInValue(this.calendarInstance.max)).getFullYear()?i.i(s.addClass)([M],n):i.i(s.isNullOrUndefined)(t)||this.getIslamicDate(l).year!==this.getIslamicDate(t).year?l.getFullYear()!==this.calendarInstance.currentDate.getFullYear()||M.classList.contains(n)||i.i(s.addClass)([M],"e-focused-date"):i.i(s.addClass)([M],"e-selected"),M.classList.contains(n)||s.EventHandler.add(M,"click",this.calendarInstance.clickHandler,this.calendarInstance),M.appendChild(V),(!i.i(s.isNullOrUndefined)(e)&&"home"===e.action&&o.year.toString()===m||!i.i(s.isNullOrUndefined)(e)&&"end"===e.action&&o.year.toString()===f)&&i.i(s.addClass)([M],"e-focused-date"),r.push(M)}}this.islamicRenderTemplate(r,4,"e-decade",e,t)},e.prototype.islamicDayCell=function(e){var t={skeleton:"full",type:"dateTime",calendar:"islamic"},a=this.calendarInstance.globalize.formatDate(e,t),n=this.calendarInstance.globalize.parseDate(a,t),r=n.valueOf(),l={className:"e-cell",attrs:{id:""+i.i(s.getUniqueID)(""+r),"aria-selected":"false",role:"gridcell"}};return this.calendarInstance.createElement("td",l)},e.prototype.islamicRenderTemplate=function(e,t,n,r,l){var o,h=this.calendarInstance.getViewNumber(this.calendarInstance.currentView());this.calendarInstance.tableBodyElement=this.calendarInstance.createElement("tbody"),this.calendarInstance.table.appendChild(this.calendarInstance.tableBodyElement),i.i(s.removeClass)([this.calendarInstance.contentElement,this.calendarInstance.headerElement],["e-month","e-decade","e-year"]),i.i(s.addClass)([this.calendarInstance.contentElement,this.calendarInstance.headerElement],[n]);for(var u=t,d=0,p=0;p<Math.round(e.length/t);++p){for(o=this.calendarInstance.createElement("tr",{attrs:{role:"row"}}),d=0+d;d<u;d++)e[d].classList.contains("e-week-number")||i.i(s.isNullOrUndefined)(e[d].children[0])||(i.i(s.addClass)([e[d].children[0]],["e-day"]),i.i(s.rippleEffect)(e[d].children[0],{duration:600,isCenterRipple:!0})),o.appendChild(e[d]),this.calendarInstance.weekNumber&&7===d&&e[7].classList.contains(a)&&i.i(s.addClass)([o],"e-month-hide"),!this.calendarInstance.weekNumber&&6===d&&e[6].classList.contains(a)&&i.i(s.addClass)([o],"e-month-hide"),this.calendarInstance.weekNumber?41===d&&e[41].classList.contains(a)&&i.i(s.addClass)([o],"e-month-hide"):35===d&&e[35].classList.contains(a)&&i.i(s.addClass)([o],"e-month-hide");u+=t,d+=0,this.calendarInstance.tableBodyElement.appendChild(o)}this.calendarInstance.table.querySelector("tbody").className=this.calendarInstance.effect,this.islamicIconHandler(),(h!==this.calendarInstance.getViewNumber(this.calendarInstance.currentView())||0===h&&h!==this.calendarInstance.getViewNumber(this.calendarInstance.currentView()))&&this.calendarInstance.navigateHandler(r),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),l=r.year;return s=l,a=0,i&&(l-=l%i,s=l-l%i+i-1),n.year>s?a=1:"Decade"===this.calendarInstance.currentView()&&n.year<l&&!(e.getFullYear()>=2060&&e.getFullYear()<=2069)?a=-1:n.year<l&&"Year"===this.calendarInstance.currentView()&&(a=-1),a},e.prototype.getIslamicDate=function(e){return s.HijriParser.getHijriDate(e)},e.prototype.toGregorian=function(e,t,i){return s.HijriParser.toGregorian(e,t,i)},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}()},function(e,t,i){"use strict";i.d(t,"a",function(){return A}),i.d(t,"b",function(){return U});var s=i(0),a=(i.n(s),i(3)),n=i(2),r=(i.n(n),i(18)),l=(i.n(r),i(1)),o=(i.n(l),i(6)),h=(i.n(o),this&&this.__extends||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])})(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)}}()),u=this&&this.__decorate||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},d="e-left-calendar",p="e-right-calendar",c="e-daterangepicker",m="e-active",f="e-start-date",v="e-end-date",y="e-input-focus",g="e-range-hover",b="e-other-month",D="e-disabled",E="e-selected",C="e-calendar",k="e-header",w="e-title",M="e-focused-date",V="e-content",N="e-day-span",O="e-date-disabled",I="e-icon-disabled",T="e-overlay",x="e-list-item",S="e-hover",P=["title","class","style"],A=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return h(t,e),u([i.i(s.Property)()],t.prototype,"label",void 0),u([i.i(s.Property)()],t.prototype,"start",void 0),u([i.i(s.Property)()],t.prototype,"end",void 0),t}(s.ChildProperty),U=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.isAngular=!1,s.preventChange=!1,s.dateRangeOptions=t,s}return h(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&&l.Input.calculateWidth(this.inputElement,this.inputWrapper.container),i.i(s.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(s.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"),!i.i(s.isNullOrUndefined)(i.i(s.closest)(this.element,"fieldset"))&&i.i(s.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=!!s.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),i.i(s.removeClass)([this.cloneElement],[c,"e-control","e-lib"]),this.updateHtmlAttributeToElement(),this.element.getAttribute("id")?null!==this.angularTag&&(this.inputElement.id=this.element.getAttribute("id")+"_input"):(this.element.id=i.i(s.getUniqueID)("ej2-datetimepicker"),null!==this.angularTag&&i.i(s.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.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=i.i(s.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())):i.i(s.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 s.Internationalization(this.locale),this.checkFormat(),this.checkView(),(i.i(s.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||i.i(s.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.initialize=function(){null!==this.angularTag&&this.validationAttribute(this.element,this.inputElement),this.checkHtmlAttributes(!1),i.i(s.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 s.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"):i.i(s.attributes)(this.inputElement,{readonly:""}),this.updateClearIconState()},t.prototype.updateClearIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&i.i(s.removeClass)([this.inputWrapper.container],["e-non-edit"]):""===this.inputElement.value?i.i(s.removeClass)([this.inputWrapper.container],["e-non-edit"]):i.i(s.addClass)([this.inputWrapper.container],["e-non-edit"])},t.prototype.validationAttribute=function(e,t){var a=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id");t.setAttribute("name",a),e.removeAttribute("name");for(var n=["required","aria-required","form"],r=0;r<n.length;r++)if(!i.i(s.isNullOrUndefined)(e.getAttribute(n[r]))){var l=e.getAttribute(n[r]);t.setAttribute(n[r],l),e.removeAttribute(n[r])}},t.prototype.updateHtmlAttributeToWrapper=function(){if(!i.i(s.isNullOrUndefined)(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var a=t[e];if(P.indexOf(a)>-1)if("class"===a){var n=this.htmlAttributes[""+a].replace(/\s+/g," ").trim();""!==n&&i.i(s.addClass)([this.inputWrapper.container],n.split(" "))}else if("style"===a){var r=this.inputWrapper.container.getAttribute(a);r=i.i(s.isNullOrUndefined)(r)?this.htmlAttributes[""+a]:r+this.htmlAttributes[""+a],this.inputWrapper.container.setAttribute(a,r)}else this.inputWrapper.container.setAttribute(a,this.htmlAttributes[""+a])}},t.prototype.updateHtmlAttributeToElement=function(){if(!i.i(s.isNullOrUndefined)(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var a=t[e];P.indexOf(a)<0&&this.inputElement.setAttribute(a,this.htmlAttributes[""+a])}},t.prototype.updateCssClass=function(e,t){i.i(s.isNullOrUndefined)(t)||(t=t.replace(/\s+/g," ").trim()),i.i(s.isNullOrUndefined)(e)||(e=e.replace(/\s+/g," ").trim()),l.Input.setCssClass(e,[this.inputWrapper.container],t),this.popupWrapper&&l.Input.setCssClass(e,[this.popupWrapper],t)},t.prototype.processPresets=function(){this.presetsItem=[];var e=0;if(!i.i(s.isUndefined)(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)){for(var t=0,a=this.presets;t<a.length;t++){var n=a[t],r=n.label.replace(/\s+/g,"")+"_"+ ++e;"string"==typeof n.end?this.presetsItem.push({id:r,text:n.label,end:new Date(this.checkValue(n.end)),start:new Date(this.checkValue(n.start))}):this.presetsItem.push({id:r,text:n.label,start:n.start,end:n.end})}var l=i.i(s.isNullOrUndefined)(this.startValue)?null:new Date(+this.startValue),o=i.i(s.isNullOrUndefined)(this.endValue)?null:new Date(+this.endValue);this.presetsItem.push({id:"custom_range",text:this.l10n.getConstant("customRange"),start:l,end:o}),i.i(s.isNullOrUndefined)(this.startValue)||i.i(s.isNullOrUndefined)(this.endValue)||(this.isCustomRange=!0,this.activeIndex=this.presetsItem.length-1)}},t.prototype.bindEvents=function(){s.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler,this),s.EventHandler.add(this.inputElement,"focus",this.inputFocusHandler,this),s.EventHandler.add(this.inputElement,"blur",this.inputBlurHandler,this),s.EventHandler.add(this.inputElement,"change",this.inputChangeHandler,this),this.showClearButton&&this.inputWrapper.clearButton&&s.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this),this.isMobile||(this.keyInputConfigs=i.i(s.extend)(this.keyInputConfigs,this.keyConfigs),this.inputKeyboardModule=new s.KeyboardEvents(this.inputElement,{eventName:"keydown",keyAction:this.inputHandler.bind(this),keyConfigs:this.keyInputConfigs})),this.formElement&&s.EventHandler.add(this.formElement,"reset",this.formResetHandler,this),this.enabled?this.inputElement.setAttribute("tabindex",this.tabIndex):this.inputElement.tabIndex=-1},t.prototype.unBindEvents=function(){s.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler),s.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),s.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),s.EventHandler.remove(this.inputElement,"change",this.inputChangeHandler),this.showClearButton&&this.inputWrapper.clearButton&&s.EventHandler.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler),this.isMobile||i.i(s.isNullOrUndefined)(this.inputKeyboardModule)||this.inputKeyboardModule.destroy(),this.formElement&&s.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.startDate,e)),"string"==typeof this.endDate&&(this.endDate=this.globalize.parseDate(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&&s.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),i.i(s.closest)(this.element,"form")){var a=this.firstHiddenChild,n=document.createEvent("KeyboardEvent");n.initEvent("keyup",!1,!0),a.dispatchEvent(n)}}},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");i.i(s.isNullOrUndefined)(this.startCopy)?(this.setProperties({value:null,startDate:null,endDate:null},!0),this.startValue=this.endValue=null):(i.i(s.isNullOrUndefined)(this.value)||i.i(s.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&&(l.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),l.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),i.i(s.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||i.i(s.isNullOrUndefined)(this.leftCalendar)||(this.isRangeIconClicked=!1,this.calendarFocus(),this.isRangeIconClicked=!0),i.i(s.addClass)([this.inputWrapper.container],[y])))},t.prototype.checkHtmlAttributes=function(e){this.globalize=new s.Internationalization(this.locale);for(var t=e?i.i(s.isNullOrUndefined)(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["startDate","endDate","minDays","maxDays","min","max","disabled","readonly","style","name","placeholder","type","value"],a={format:this.formatString,type:"date",skeleton:"yMd"},n=0,r=t;n<r.length;n++){var l=r[n];if(!i.i(s.isNullOrUndefined)(this.inputElement.getAttribute(l)))switch(l){case"disabled":if(i.i(s.isNullOrUndefined)(this.dateRangeOptions)||void 0===this.dateRangeOptions.enabled||e){var o="disabled"===this.inputElement.getAttribute(l)||""===this.inputElement.getAttribute(l)||"true"===this.inputElement.getAttribute(l);this.setProperties({enabled:!o},!e)}break;case"readonly":if(i.i(s.isNullOrUndefined)(this.dateRangeOptions)||void 0===this.dateRangeOptions.readonly||e){var h="readonly"===this.inputElement.getAttribute(l)||"true"===this.inputElement.getAttribute(l)||""===this.inputElement.getAttribute(l);this.setProperties({readonly:h},!e)}break;case"placeholder":(i.i(s.isNullOrUndefined)(this.dateRangeOptions)||void 0===this.dateRangeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(l)},!e);break;case"value":if(i.i(s.isNullOrUndefined)(this.dateRangeOptions)||void 0===this.dateRangeOptions.value||e){var u=this.inputElement.getAttribute(l);this.setProperties(i.i(s.setValue)(l,u,{}),!e)}break;case"style":this.inputElement.setAttribute("style",""+this.inputElement.getAttribute(l));break;case"min":if(i.i(s.isNullOrUndefined)(this.min)||+this.min==+new Date(1900,0,1)||e){var d=this.globalize.parseDate(this.inputElement.getAttribute(l),a);this.setProperties(i.i(s.setValue)(l,d,{}),!e)}break;case"name":this.inputElement.setAttribute("name",""+this.inputElement.getAttribute(l));break;case"max":if(i.i(s.isNullOrUndefined)(this.max)||+this.max==+new Date(2099,11,31)||e){var d=this.globalize.parseDate(this.inputElement.getAttribute(l),a);this.setProperties(i.i(s.setValue)(l,d,{}),!e)}break;case"startDate":if(i.i(s.isNullOrUndefined)(this.startDate)){var d=this.globalize.parseDate(this.inputElement.getAttribute(l),a);this.startValue=d,this.setValue()}break;case"endDate":if(i.i(s.isNullOrUndefined)(this.endDate)){var d=this.globalize.parseDate(this.inputElement.getAttribute(l),a);this.endValue=d,this.setValue()}break;case"minDays":i.i(s.isNullOrUndefined)(this.minDays)&&this.setProperties(i.i(s.setValue)(l,parseInt(this.inputElement.getAttribute(l),10),{}),!0);break;case"maxDays":i.i(s.isNullOrUndefined)(this.maxDays)&&this.setProperties(i.i(s.setValue)(l,parseInt(this.inputElement.getAttribute(l),10),{}),!0);break;case"type":"text"!==this.inputElement.getAttribute(l)&&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(var e=0;e<=this.presetsItem.length-2;e++){var t=this.presetsItem[e].start,a=this.presetsItem[e].end;this.startValue&&this.endValue&&t.getDate()==this.startValue.getDate()&&t.getMonth()==this.startValue.getMonth()&&t.getFullYear()==this.startValue.getFullYear()&&a.getDate()==this.endValue.getDate()&&a.getMonth()==this.endValue.getMonth()&&a.getFullYear()==this.endValue.getFullYear()&&(this.activeIndex=e,this.isCustomRange=!1)}this.popupWrapper=i.i(s.createElement)("div",{id:this.element.id+"_popup",className:c+" e-popup"}),this.popupWrapper.setAttribute("aria-label",this.element.id),this.popupWrapper.setAttribute("role","dialog"),this.adjustLongHeaderWidth();var n=!this.isCustomRange||this.isMobile;!i.i(s.isUndefined)(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)&&n?(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]),i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.isNullOrUndefined)(this.startValue)||i.i(s.isNullOrUndefined)(this.renderDayCellArgs)||!this.renderDayCellArgs.isDisabled||this.disabledDateRender(),this.updateHeader()},t.prototype.clearCalendarEvents=function(){this.leftCalPrevIcon&&this.leftCalNextIcon&&this.rightCalPrevIcon&&this.rightCalNextIcon&&(s.EventHandler.clearEvents(this.leftCalPrevIcon),s.EventHandler.clearEvents(this.leftCalNextIcon),s.EventHandler.clearEvents(this.rightCalPrevIcon),s.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(D)&&s.EventHandler.add(this.leftCalPrevIcon,"mousedown",this.navPrevFunction),this.leftCalNextIcon&&!this.leftCalNextIcon.classList.contains(D)&&s.EventHandler.add(this.leftCalNextIcon,"mousedown",this.navNextFunction),this.rightCalPrevIcon&&!this.rightCalPrevIcon.classList.contains(D)&&s.EventHandler.add(this.rightCalPrevIcon,"mousedown",this.navPrevFunction),this.rightCalNextIcon&&!this.rightCalNextIcon.classList.contains(D)&&s.EventHandler.add(this.rightCalNextIcon,"mousedown",this.navNextFunction)},t.prototype.bindCalendarEvents=function(){this.isMobile?(this.deviceCalendarEvent(),s.EventHandler.add(this.startButton.element,"click",this.deviceHeaderClick,this),s.EventHandler.add(this.endButton.element,"click",this.deviceHeaderClick,this)):(this.updateNavIcons(),this.calendarIconEvent(),this.calendarIconRipple(),this.headerTitleElement=this.popupObj.element.querySelector(".e-right-calendar .e-header ."+w),this.headerTitleElement=this.popupObj.element.querySelector(".e-left-calendar .e-header ."+w),this.defaultKeyConfigs=i.i(s.extend)(this.defaultKeyConfigs,this.keyConfigs),this.leftKeyboardModule=new s.KeyboardEvents(this.leftCalendar,{eventName:"keydown",keyAction:this.keyInputHandler.bind(this),keyConfigs:this.defaultKeyConfigs}),this.rightKeyboardModule=new s.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(){i.i(s.rippleEffect)(this.leftCalPrevIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),i.i(s.rippleEffect)(this.leftCalNextIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),i.i(s.rippleEffect)(this.rightCalPrevIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),i.i(s.rippleEffect)(this.rightCalNextIcon,{selector:".e-next",duration:400,isCenterRipple:!0})},t.prototype.deviceCalendarEvent=function(){s.EventHandler.clearEvents(this.nextIcon),s.EventHandler.clearEvents(this.previousIcon),i.i(s.rippleEffect)(this.nextIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),i.i(s.rippleEffect)(this.previousIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),this.nextIcon&&!this.nextIcon.classList.contains(D)&&s.EventHandler.add(this.nextIcon,"mousedown",this.deviceNavNextFunction),this.previousIcon&&!this.previousIcon.classList.contains(D)&&s.EventHandler.add(this.previousIcon,"mousedown",this.deviceNavPrevFunction)},t.prototype.deviceNavNext=function(e){var t=i.i(s.closest)(e.target,"."+C);this.updateDeviceCalendar(t),this.navigateNext(e),this.deviceNavigation()},t.prototype.deviceNavPrevious=function(e){var t=i.i(s.closest)(e.target,"."+C);this.updateDeviceCalendar(t),this.navigatePrevious(e),this.deviceNavigation()},t.prototype.updateDeviceCalendar=function(e){e&&(this.previousIcon=e.querySelector(".e-prev"),this.nextIcon=e.querySelector(".e-next"),this.calendarElement=e,this.deviceCalendar=e,this.contentElement=e.querySelector("."+V),this.tableBodyElement=i.i(s.select)(".e-content tbody",e),this.table=e.querySelector("."+V).getElementsByTagName("table")[0],this.headerTitleElement=e.querySelector(".e-header ."+w),this.headerElement=e.querySelector("."+k))},t.prototype.deviceHeaderClick=function(e){if(e.currentTarget.classList.contains("e-start-btn")&&!i.i(s.isNullOrUndefined)(this.startValue)){this.endButton.element.classList.remove(m),this.startButton.element.classList.add(m);var t=this.popupObj.element.querySelector("."+C);this.updateDeviceCalendar(t),i.i(s.isNullOrUndefined)(this.calendarElement.querySelector(".e-start-date:not(.e-other-month)"))&&(this.currentDate=new Date(+this.startValue),i.i(s.remove)(this.tableBodyElement),this.createContentBody(),this.deviceNavigation()),this.removeClassDisabled()}else if(!i.i(s.isNullOrUndefined)(this.startValue)&&!i.i(s.isNullOrUndefined)(this.endValue)){this.startButton.element.classList.remove(m),this.endButton.element.classList.add(m);var t=this.popupObj.element.querySelector("."+C);this.updateDeviceCalendar(t),i.i(s.isNullOrUndefined)(this.calendarElement.querySelector(".e-end-date:not(.e-other-month)"))&&(this.currentDate=new Date(+this.endValue),i.i(s.remove)(this.tableBodyElement),this.createContentBody(),this.deviceNavigation()),this.updateMinMaxDays(this.popupObj.element.querySelector("."+C)),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.openOnFocus&&!this.preventFocus?(this.preventFocus=!0,this.show()):this.preventFocus=!0}},t.prototype.inputBlurHandler=function(e){if(this.enabled){if(!this.preventBlur){var t=this.inputElement.value;if(i.i(s.isNullOrUndefined)(this.presetsItem)||this.presetsItem.length>0&&this.previousEleValue!==this.inputElement.value&&(this.activeIndex=this.presetsItem.length-1,this.isCustomRange=!0),!i.i(s.isNullOrUndefined)(t)&&""!==t.trim()){var a=t.split(" "+this.separator+" ");if(a.length>1){this.invalidValueString=null;var n={format:this.formatString,type:"date",skeleton:"yMd"},r=this.globalize.parseDate(a[0],n),o=this.globalize.parseDate(a[1],n),h=this.getStartEndDate(r,!1,a,n),u=this.getStartEndDate(o,!0,a,n);if(!(i.i(s.isNullOrUndefined)(h)||isNaN(+h)||i.i(s.isNullOrUndefined)(u)||isNaN(+u))){var d=this.startValue;this.startValue=h;var p=this.endValue;if(this.endValue=u,this.setValue(),this.refreshControl(),t!==this.previousEleValue&&this.changeTrigger(e),!this.preventBlur&&document.activeElement!==this.inputElement){this.preventFocus=!1;var c={model:this};this.trigger("blur",c)}return this.updateHiddenInput(),void(this.isMobile&&this.isPopupOpen()&&(this.startValue=d,this.endValue=p))}this.strictMode||(this.startValue=null,this.endValue=null,this.setValue())}else this.strictMode||(this.startValue=null,this.endValue=null,this.setValue())}if(this.strictMode?(i.i(s.isNullOrUndefined)(t)||""!==t.trim()||(this.startValue=null,this.endValue=null),l.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.updateInput()):(i.i(s.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;var c={model:this};this.trigger("blur",c)}}this.updateHiddenInput()}},t.prototype.getStartEndDate=function(e,t,i,s){return"Month"===this.depth?this.globalize.parseDate(i[t?1:0].trim(),s):"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.clearRange=function(){this.previousStartValue=this.previousEndValue=null,this.currentDate=null},t.prototype.errorClass=function(){var e=this.inputElement.value.trim();(i.i(s.isNullOrUndefined)(this.endValue)&&i.i(s.isNullOrUndefined)(this.startValue)&&""!==e||!i.i(s.isNullOrUndefined)(this.startValue)&&+this.startValue<+this.min||!i.i(s.isNullOrUndefined)(this.startValue)&&!i.i(s.isNullOrUndefined)(this.endValue)&&+this.startValue>+this.endValue||!i.i(s.isNullOrUndefined)(this.endValue)&&+this.endValue>+this.max||this.startValue&&this.isDateDisabled(this.startValue)||this.endValue&&this.isDateDisabled(this.endValue))&&""!==e?(i.i(s.addClass)([this.inputWrapper.container],"e-error"),i.i(s.attributes)(this.inputElement,{"aria-invalid":"true"})):this.inputWrapper&&(i.i(s.removeClass)([this.inputWrapper.container],"e-error"),i.i(s.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,a,n,r){var l,o,h=this.getViewNumber(this.currentView()),u=this.min;switch(o=i.i(s.isNullOrUndefined)(this.maxDays)||!this.isMaxDaysClicked||i.i(s.isNullOrUndefined)(this.startValue)?this.max:new Date(new Date(+this.startValue).setDate(this.startValue.getDate()+(this.maxDays-1))),e.action){case"moveRight":l=new Date(+this.currentDate),this.addDay(l,1,e,o,u),t&&+l==+n&&(r=this.keyCalendarUpdate(!1,r)),this.keyboardNavigate(1,h,e,o,u),this.keyNavigation(r,e);break;case"moveLeft":l=new Date(+this.currentDate),this.addDay(l,-1,e,o,u),t||+l==+a&&(r=this.keyCalendarUpdate(!0,r)),this.keyboardNavigate(-1,h,e,o,u),this.keyNavigation(r,e);break;case"moveUp":0===h?(l=new Date(+this.currentDate),this.addDay(l,-7,e,o,u),+l<=+a&&!t&&(r=this.keyCalendarUpdate(!0,r)),this.keyboardNavigate(-7,h,e,o,u)):this.keyboardNavigate(-4,h,e,this.max,this.min),this.keyNavigation(r,e);break;case"moveDown":0===h?(l=new Date(+this.currentDate),this.addDay(l,7,e,o,u),t&&+l>=+n&&(r=this.keyCalendarUpdate(!1,r)),this.keyboardNavigate(7,h,e,o,u)):this.keyboardNavigate(4,h,e,this.max,this.min),this.keyNavigation(r,e);break;case"home":this.currentDate=this.firstDay(this.currentDate),i.i(s.remove)(this.tableBodyElement),0===h?this.renderMonths(e):1===h?this.renderYears(e):this.renderDecades(e),this.keyNavigation(r,e);break;case"end":this.currentDate=this.lastDay(this.currentDate,h),i.i(s.remove)(this.tableBodyElement),0===h?this.renderMonths(e):1===h?this.renderYears(e):this.renderDecades(e),this.keyNavigation(r,e);break;case"tab":this.tabKeyValidation(r,d)&&(r=this.keyCalendarUpdate(!1,r,!1),this.currentDate=this.firstCellToFocus(this.rightCalendar),h=this.getViewNumber(this.currentView()),this.keyboardNavigate(0,h,e,o,u),this.keyNavigation(r,e));break;case"shiftTab":this.tabKeyValidation(r,p)&&(r=this.keyCalendarUpdate(!0,r,!1),this.currentDate=this.firstCellToFocus(this.leftCalendar),this.keyboardNavigate(0,h,e,o,u),this.keyNavigation(r,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,a){var n,r=this.getViewNumber(this.currentView()),l=new Date(this.rightCalCurrentDate.getFullYear(),this.rightCalCurrentDate.getMonth(),1),o=new Date(this.leftCalCurrentDate.getFullYear(),this.leftCalCurrentDate.getMonth()+1,0),h=i.i(s.closest)(t.target,"."+p);h=i.i(s.isNullOrUndefined)(h)?this.leftCalendar:h;var u=h.classList.contains(d);this.updateCalendarElement(h);var c=this.tableBodyElement.querySelector("tr td.e-selected"),m=h.querySelector("tr td."+M),g=h.querySelector("tr td."+f),b=h.querySelector("tr td."+v),E=this.getViewNumber(this.depth),C=r===E&&this.getViewNumber(this.start)>=E,k=i.i(s.closest)(t.target,"."+d),w=i.i(s.closest)(t.target,"."+p),V=i.i(s.closest)(t.target,".e-presets");switch(i.i(s.isNullOrUndefined)(m)?i.i(s.isNullOrUndefined)(b)||this.dateDisabled?i.i(s.isNullOrUndefined)(g)||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(),i.i(s.addClass)([this.inputWrapper.container],[y]));break;case"select":if(C){var N=i.i(s.isNullOrUndefined)(m)?g:m;i.i(s.isNullOrUndefined)(N)||N.classList.contains(D)||this.selectRange(null,N)}else(i.i(s.isNullOrUndefined)(c)||C)&&i.i(s.isNullOrUndefined)(m)||(i.i(s.isNullOrUndefined)(this.value)||(a=this.calendarElement.classList.contains(d)?this.startDate:this.endDate),this.controlDown=t,this.contentClick(null,--r,m||c,a));t.preventDefault();break;case"controlHome":var O=new Date(this.currentDate.getFullYear(),0,1);!u&&+O<+o&&(h=this.keyCalendarUpdate(!0,h)),e.prototype.navigateTo.call(this,"Month",new Date(this.currentDate.getFullYear(),0,1)),this.keyNavigation(h,t);break;case"altRightArrow":i.i(s.isNullOrUndefined)(k)?i.i(s.isNullOrUndefined)(w)?i.i(s.isNullOrUndefined)(V)||this.cancelButton.element.focus():i.i(s.isNullOrUndefined)(this.presetElement)?this.cancelButton.element.focus():(this.presetElement.focus(),this.removeFocusedDate()):this.rightCalendar.children[1].firstElementChild.focus(),t.preventDefault();break;case"altLeftArrow":i.i(s.isNullOrUndefined)(k)?i.i(s.isNullOrUndefined)(w)||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(d),this.calendarNavigation(t,this.calendarElement),t.preventDefault();break;case"controlDown":i.i(s.isNullOrUndefined)(c)&&i.i(s.isNullOrUndefined)(m)||C||(i.i(s.isNullOrUndefined)(this.value)||(a=this.calendarElement.classList.contains(d)?this.startDate:this.endDate),this.controlDown=t,this.contentClick(null,--r,c||m,a)),t.preventDefault();break;case"controlEnd":var O=new Date(this.currentDate.getFullYear(),11,31);u&&+O>+l&&(h=this.keyCalendarUpdate(!1,h)),e.prototype.navigateTo.call(this,"Month",new Date(this.currentDate.getFullYear(),11,31)),this.keyNavigation(h,t);break;case"pageUp":n=new Date(+this.currentDate),this.addMonths(n,-1),!u&&+n<=+o&&(h=this.keyCalendarUpdate(!0,h)),this.addMonths(this.currentDate,-1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(h,t);break;case"pageDown":n=new Date(+this.currentDate),this.addMonths(n,1),u&&+n>=+l&&(h=this.keyCalendarUpdate(!1,h)),this.addMonths(this.currentDate,1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(h,t);break;case"shiftPageUp":n=new Date(+this.currentDate),this.addYears(n,-1),!u&&+n<=+o&&(h=this.keyCalendarUpdate(!0,h)),this.addYears(this.currentDate,-1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(h,t);break;case"shiftPageDown":n=new Date(+this.currentDate),this.addYears(n,1),u&&+n>=+l&&(h=this.keyCalendarUpdate(!1,h)),this.addYears(this.currentDate,1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(h,t);break;case"shiftTab":i.i(s.isNullOrUndefined)(this.presetElement)||(this.presetElement.setAttribute("tabindex","0"),this.presetElement.focus(),this.removeFocusedDate()),u&&t.preventDefault(),this.tabKeyValidation(h,p)&&(this.currentDate=new Date(+this.leftCalCurrentDate),this.navInCalendar(t,u,o,l,h));break;case"spacebar":this.applyButton&&!this.applyButton.disabled&&this.applyFunction(t);break;case"tab":this.tabKeyValidation(h,d)&&(this.currentDate=new Date(+this.rightCalCurrentDate),this.navInCalendar(t,u,o,l,h));break;default:this.navInCalendar(t,u,o,l,h),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(d)?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||i.i(s.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){var t;t=e?e.querySelectorAll(".e-calendar td"):this.popupObj.element.querySelectorAll(".e-calendar td");for(var i=0,a=t;i<a.length;i++){var n=a[i];s.EventHandler.clearEvents(n);n.classList.contains(D)||n.classList.contains(O)||n.classList.contains("e-week-number")||(this.isMobile||s.EventHandler.add(n,"mouseover",this.hoverSelection,this),s.EventHandler.add(n,"mousedown",this.selectRange,this))}},t.prototype.removeFocusedDate=function(){for(var e=!i.i(s.isNullOrUndefined)(this.startValue)||!i.i(s.isNullOrUndefined)(this.endValue),t=this.popupObj.element.querySelectorAll(".e-calendar ."+M),a=0,n=t;a<n.length;a++){var r=n[a],l=new Date,o=this.getIdValue(null,r);("Month"===this.depth&&"Month"===this.currentView()&&(!r.classList.contains("e-today")||r.classList.contains("e-today")&&e)||"Year"===this.depth&&"Year"===this.currentView()&&(!this.isSameMonth(l,o)&&!this.isSameYear(l,o)||e)||"Decade"===this.depth&&"Decade"===this.currentView()&&(!this.isSameYear(l,o)||e))&&(r.classList.remove(M),r.classList.contains(f)||r.classList.contains(v)||r.removeAttribute("aria-label"))}},t.prototype.hoverSelection=function(e,t){var a=t||e.currentTarget,n=this.getIdValue(null,a);if(!i.i(s.isNullOrUndefined)(this.startValue)&&+this.startValue>=+this.min&&+this.startValue<=+this.max&&(!this.isDateDisabled(this.endValue)&&!this.isDateDisabled(this.startValue)&&i.i(s.isNullOrUndefined)(this.endValue)&&i.i(s.isNullOrUndefined)(this.startValue)||!i.i(s.isNullOrUndefined)(this.startValue)&&i.i(s.isNullOrUndefined)(this.endValue)))for(var r=this.popupObj.element.querySelectorAll(".e-calendar td"),l=0,o=r;l<o.length;l++){var h=o[l],u=!h.classList.contains(D)||h.classList.contains(O);if(!h.classList.contains("e-week-number")&&u){var d=this.getIdValue(null,h),p=new Date(+this.startValue),c=new Date(+d);c.setHours(0,0,0,0)>=p.setHours(0,0,0,0)&&+d<=+n?i.i(s.addClass)([h],g):i.i(s.removeClass)([h],[g])}}},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(!i.i(s.isNullOrUndefined)(this.startValue))for(var t=0,a=e;t<a.length;t++)for(var n=a[t],r=n.querySelectorAll(".e-calendar td"),l=0,o=r;l<o.length;l++){var h=o[l];if(!h.classList.contains("e-week-number")&&!h.classList.contains(D)){var u=this.getIdValue(null,h),d=this.getIdValue(null,h);if(i.i(s.isNullOrUndefined)(this.endValue)?i.i(s.removeClass)([h],[g]):this.currentView()===this.depth&&+d.setHours(0,0,0,0)>=+new Date(+this.startValue).setHours(0,0,0,0)&&+d.setHours(0,0,0,0)<=+new Date(+this.endValue).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)&&i.i(s.addClass)([h],g),h.classList.contains(E)&&h.classList.contains(v)&&+d!=+this.endValue&&(i.i(s.removeClass)([h],[E]),i.i(s.removeClass)([h],[v])),h.classList.contains(g)&&+d>+this.endValue&&i.i(s.removeClass)([h],[g]),!h.classList.contains(b)){var p=new Date(+this.startValue),c=new Date(+u);this.currentView()===this.depth&&+c.setHours(0,0,0,0)==+p.setHours(0,0,0,0)&&+c.setHours(0,0,0,0)>=+p.setHours(0,0,0,0)&&+this.startValue>=+this.min&&!this.inputWrapper.container.classList.contains("e-error")&&!this.isDateDisabled(this.startValue)&&!this.isDateDisabled(this.endValue)&&(i.i(s.addClass)([h],[f,E]),this.addSelectedAttributes(h,this.startValue,!0));var m=new Date(+this.endValue);"Year"===this.currentView()?c=new Date(c.getFullYear(),c.getMonth()+1,0):"Decade"===this.currentView()&&(c=new Date(c.getFullYear(),11,31)),this.currentView()===this.depth&&!i.i(s.isNullOrUndefined)(this.endValue)&&+c.setHours(0,0,0,0)==+m.setHours(0,0,0,0)&&+c.setHours(0,0,0,0)<=+m.setHours(0,0,0,0)&&+this.startValue>=+this.min&&!this.inputWrapper.container.classList.contains("e-error")&&!this.isDateDisabled(this.startValue)&&!this.isDateDisabled(this.endValue)&&(i.i(s.addClass)([h],[v,E]),this.addSelectedAttributes(h,this.startValue,!1)),+u!=+this.startValue||i.i(s.isNullOrUndefined)(this.endValue)||+u!=+this.endValue||this.addSelectedAttributes(h,this.endValue,!1,!0)}}}},t.prototype.checkMinMaxDays=function(){(!i.i(s.isNullOrUndefined)(this.minDays)&&this.minDays>0||!i.i(s.isNullOrUndefined)(this.maxDays)&&this.maxDays>0)&&(this.isMobile?this.updateMinMaxDays(this.popupObj.element.querySelector("."+C)):(this.updateMinMaxDays(this.popupObj.element.querySelector("."+d)),this.updateMinMaxDays(this.popupObj.element.querySelector("."+p))))},t.prototype.rangeArgs=function(e){var t,a,n=i.i(s.isNullOrUndefined)(this.startValue)?null:this.globalize.formatDate(this.startValue,{format:this.formatString,type:"date",skeleton:"yMd"}),r=i.i(s.isNullOrUndefined)(this.endValue)?null:this.globalize.formatDate(this.endValue,{format:this.formatString,type:"date",skeleton:"yMd"});return i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.isNullOrUndefined)(this.startValue)?(t="",a=0):(t=n+" "+this.separator+" "+r,a=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:a,event:e||null,element:this.element,isInteracted:!i.i(s.isNullOrUndefined)(e),text:t}},t.prototype.otherMonthSelect=function(e,t,a){var n=+this.getIdValue(null,e),r='*[id^="/id"]:not(.e-other-month)'.replace("/id",""+n),l=this.popupObj&&this.popupObj.element.querySelector(r);i.i(s.isNullOrUndefined)(l)||(t?(i.i(s.addClass)([l],[f,E]),this.addSelectedAttributes(l,this.startValue,!0)):(i.i(s.addClass)([l],[v,E]),this.addSelectedAttributes(l,this.endValue,!0)),a&&this.addSelectedAttributes(e,this.endValue,!1,!0))},t.prototype.selectRange=function(e,t){var a,n;e&&e.preventDefault();var r=i.i(s.isNullOrUndefined)(e)?this.getIdValue(null,t):this.getIdValue(e,null),l=r.getFullYear(),o=r.getMonth(),h=new Date(l,o,1),u=new Date(l,o+1,0),c=new Date(l,0,1),y=new Date(l,11,31);i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.isNullOrUndefined)(this.startValue)?this.isMobile&&this.startButton.element.classList.contains(m)&&this.removeSelection():(!this.isMobile||this.isMobile&&!this.endButton.element.classList.contains(m))&&this.removeSelection();var D=t||e.currentTarget;if(i.i(s.isNullOrUndefined)(this.startValue))i.i(s.isNullOrUndefined)(this.previousStartValue)||(r.setHours(this.previousStartValue.getHours()),r.setMinutes(this.previousStartValue.getMinutes()),r.setSeconds(this.previousStartValue.getSeconds())),this.startValue="Month"===this.depth?new Date(this.checkValue(r)):"Year"===this.depth?h:c,this.endValue=null,this.setValue(),i.i(s.addClass)([D],f),this.addSelectedAttributes(D,this.startValue,!0),D.classList.contains(b)&&this.otherMonthSelect(D,!0),this.checkMinMaxDays(),this.applyButton.disabled=!0,this.applyButton.element.disabled=!0,this.isMobile&&(this.endButton.element.classList.add(m),this.startButton.element.classList.remove(m),this.endButton.element.removeAttribute("disabled"),this.selectableDates()),this.trigger("select",this.rangeArgs(e));else if(+r==+this.startValue||+r>+this.startValue){if(+r==+this.startValue&&!i.i(s.isNullOrUndefined)(this.minDays)&&this.minDays>1)return;this.endValue=null,this.setValue(),(this.isMobile||t)&&this.hoverSelection(e,t),i.i(s.isNullOrUndefined)(this.previousEndValue)||(r.setHours(this.previousEndValue.getHours()),r.setMinutes(this.previousEndValue.getMinutes()),r.setSeconds(this.previousEndValue.getSeconds())),this.endValue="Month"===this.depth?new Date(this.checkValue(r)):"Year"===this.depth?u:y,this.setValue();var C=this.popupObj.element.querySelectorAll("."+v);if(this.isMobile){this.startButton.element.classList.remove(m),this.endButton.element.classList.add(m);for(var k=0,w=C;k<w.length;k++){var M=w[k];M.removeAttribute("aria-label"),M.classList.contains(f)?(this.addSelectedAttributes(M,this.startValue,!0),i.i(s.removeClass)([M],[v])):(M.setAttribute("aria-selected","false"),i.i(s.removeClass)([M],[v,E]))}}i.i(s.addClass)([D],v),+this.endValue==+this.startValue?this.addSelectedAttributes(D,this.endValue,!1,!0):this.addSelectedAttributes(D,this.endValue,!1),D.classList.contains(b)&&(+this.endValue==+this.startValue?this.otherMonthSelect(D,!1,!0):this.otherMonthSelect(D,!1)),C=this.popupObj.element.querySelectorAll("."+v);for(var V=0,N=C;V<N.length;V++){var O=N[V];O.classList.contains(f)&&i.i(s.removeClass)([O],[g])}this.applyButton.disabled=!1,this.applyButton.element.disabled=!1,this.isMobile||this.removeClassDisabled(),!i.i(s.isNullOrUndefined)(this.renderDayCellArgs)&&this.renderDayCellArgs.isDisabled&&this.disabledDateRender(),this.trigger("select",this.rangeArgs(e))}else+r<+this.startValue&&(this.removeClassDisabled(),this.startValue="Month"===this.depth?new Date(this.checkValue(r)):"Year"===this.depth?h:c,this.setValue(),this.removeSelectedAttributes(),i.i(s.removeClass)(this.popupObj.element.querySelectorAll("."+f),[f,E]),i.i(s.addClass)([D],f),this.addSelectedAttributes(D,this.startValue,!0),D.classList.contains(b)&&this.otherMonthSelect(D,!0),this.checkMinMaxDays());e&&(a=i.i(s.closest)(e.target,"."+d)),i.i(s.isNullOrUndefined)(a)?(e&&(n=e&&i.i(s.closest)(e.target,"."+p)),i.i(s.isNullOrUndefined)(n)||this.rightCalendar.children[1].firstElementChild.focus()):this.leftCalendar.children[1].firstElementChild.focus(),i.i(s.addClass)([D],E),this.calendarIconEvent(),this.updateHeader(),this.removeFocusedDate()},t.prototype.selectableDates=function(){if(!i.i(s.isNullOrUndefined)(this.startValue)){var e=this.calendarElement.querySelectorAll(".e-calendar td"),t=!1;if(this.currentView()===this.depth){for(var a=0,n=e;a<n.length;a++){var r=n[a];if(!r.classList.contains(f)&&!r.classList.contains("e-week-number")&&!r.classList.contains(D)){if(+this.getIdValue(null,r)<+this.startValue){i.i(s.addClass)([r],[O,D,T]),s.EventHandler.clearEvents(r);continue}break}if(r.classList.contains(f)&&!r.classList.contains(b)){t=!0;break}}t&&(this.previousIcon.classList.contains(D)||i.i(s.addClass)([this.previousIcon],[I,D,T]))}else{for(var l=0,o=e;l<o.length;l++){var r=o[l],h=this.startValue.getMonth(),u=this.startValue.getFullYear(),d=this.getIdValue(null,r);if(this.startButton.element.classList.contains(m)||!("Year"===this.currentView()&&d.getMonth()<h&&d.getFullYear()<=u||"Decade"===this.currentView()&&d.getMonth()<=h&&d.getFullYear()<u))break;i.i(s.addClass)([r],[D])}e[0].classList.contains(D)?this.previousIconHandler(!0):e[e.length-1].classList.contains(D)&&this.nextIconHandler(!0)}}},t.prototype.updateMinMaxDays=function(e){if(!i.i(s.isNullOrUndefined)(this.startValue)&&i.i(s.isNullOrUndefined)(this.endValue)||this.isMobile&&this.endButton.element.classList.contains(m)){if(!i.i(s.isNullOrUndefined)(this.minDays)&&this.minDays>0||!i.i(s.isNullOrUndefined)(this.maxDays)&&this.maxDays>0){var t=this.removeTimeValueFromDate(this.startValue),a=new Date(new Date(+t).setDate(t.getDate()+(this.minDays-1))),n=new Date(new Date(+t).setDate(t.getDate()+(this.maxDays-1)));a=!i.i(s.isNullOrUndefined)(this.minDays)&&this.minDays>0?a:null,n=!i.i(s.isNullOrUndefined)(this.maxDays)&&this.maxDays>0?n:null,"Year"===this.currentView()?(a=i.i(s.isNullOrUndefined)(a)?null:new Date(a.getFullYear(),a.getMonth(),0),n=i.i(s.isNullOrUndefined)(n)?null:new Date(n.getFullYear(),n.getMonth(),1)):"Decade"===this.currentView()&&(a=i.i(s.isNullOrUndefined)(a)?null:new Date(a.getFullYear()-1,11,1),n=i.i(s.isNullOrUndefined)(n)?null:new Date(n.getFullYear(),0,1));for(var r=e.querySelectorAll(".e-calendar td"),l=void 0,o=0,h=r;o<h.length;o++){var u=h[o];if(!u.classList.contains(f)&&!u.classList.contains("e-week-number")){var c=this.getIdValue(null,u);if(c=this.removeTimeValueFromDate(c),!i.i(s.isNullOrUndefined)(a)&&+c==+a&&u.classList.contains(D)&&a.setDate(a.getDate()+1),!u.classList.contains(D)){if(+c<=+t)continue;!i.i(s.isNullOrUndefined)(a)&&+c<+a&&(i.i(s.addClass)([u],[O,D,T]),s.EventHandler.clearEvents(u)),!i.i(s.isNullOrUndefined)(n)&&+c>+n&&(i.i(s.addClass)([u],[O,D,T]),this.isMaxDaysClicked=!0,s.EventHandler.clearEvents(u),i.i(s.isNullOrUndefined)(l)&&!u.classList.contains(b)&&(l=u))}}}if(!i.i(s.isNullOrUndefined)(l))if(this.isMobile)this.nextIcon.classList.contains(D)||i.i(s.addClass)([this.nextIcon],[I,D,T]);else{var v=i.i(s.closest)(l,"."+p);v=i.i(s.isNullOrUndefined)(v)?this.leftCalendar:v;var y=v.classList.contains(d);y?(this.rightCalNextIcon.classList.contains(D)||i.i(s.addClass)([this.rightCalNextIcon],[I,D,T]),this.leftCalNextIcon.classList.contains(D)||i.i(s.addClass)([this.leftCalNextIcon],[I,D,T]),this.rightCalPrevIcon.classList.contains(D)||i.i(s.addClass)([this.rightCalPrevIcon],[I,D,T])):this.rightCalNextIcon.classList.contains(D)||i.i(s.addClass)([this.rightCalNextIcon],[I,D,T])}}}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=this.popupObj.element.querySelectorAll(".e-calendar td."+O),t=0,a=e;t<a.length;t++){var n=a[t];n.classList.contains(O)&&(i.i(s.removeClass)([n],[O,D,T]),s.EventHandler.add(n,"click",this.selectRange,this),this.isMobile||s.EventHandler.add(n,"mouseover",this.hoverSelection,this))}this.isMobile?(this.nextIcon.classList.contains(I)&&i.i(s.removeClass)([this.nextIcon],[I,D,T]),this.previousIcon.classList.contains(I)&&i.i(s.removeClass)([this.previousIcon],[I,D,T])):(this.rightCalNextIcon.classList.contains(I)&&i.i(s.removeClass)([this.rightCalNextIcon],[I,D,T]),this.rightCalPrevIcon.classList.contains(I)&&i.i(s.removeClass)([this.rightCalPrevIcon],[I,D,T]),this.leftCalNextIcon.classList.contains(I)&&i.i(s.removeClass)([this.leftCalNextIcon],[I,D,T]))},t.prototype.updateHeader=function(){var e={type:"date",skeleton:"yMMMd"};if(i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.isNullOrUndefined)(this.startValue))this.popupObj.element.querySelector("."+N).textContent=this.l10n.getConstant("selectedDays");else{var t=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1;i.i(s.isNullOrUndefined)(this.disabledDayCnt)||(t-=this.disabledDayCnt,this.disabledDayCnt=null),this.popupObj.element.querySelector("."+N).textContent=t.toString()+" "+this.l10n.getConstant("days")}this.isMobile?(i.i(s.isNullOrUndefined)(this.startValue)?this.startButton.element.textContent=this.l10n.getConstant("startLabel"):this.startButton.element.textContent=this.globalize.formatDate(this.startValue,e),i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.isNullOrUndefined)(this.startValue)?this.endButton.element.textContent=this.l10n.getConstant("endLabel"):this.endButton.element.textContent=this.globalize.formatDate(this.endValue,e)):(i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.isNullOrUndefined)(this.startValue)?this.popupObj.element.querySelector(".e-end-label").textContent=this.l10n.getConstant("endLabel"):this.popupObj.element.querySelector(".e-end-label").textContent=this.globalize.formatDate(this.endValue,e),i.i(s.isNullOrUndefined)(this.startValue)?this.popupObj.element.querySelector(".e-start-label").textContent=this.l10n.getConstant("startLabel"):this.popupObj.element.querySelector(".e-start-label").textContent=this.globalize.formatDate(this.startValue,e)),(this.isDateDisabled(this.startValue)||this.isDateDisabled(this.endValue)||!i.i(s.isNullOrUndefined)(this.startValue)&&+this.startValue<+this.min||!i.i(s.isNullOrUndefined)(this.endValue)&&+this.endValue>+this.max||!i.i(s.isNullOrUndefined)(this.startValue)&&!i.i(s.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("."+N).textContent=this.l10n.getConstant("selectedDays")):(this.popupObj.element.querySelector("."+N).textContent=this.l10n.getConstant("selectedDays"),this.popupObj.element.querySelector(".e-start-label").textContent=this.l10n.getConstant("startLabel"),this.popupObj.element.querySelector(".e-end-label").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("."+E).length>0&&i.i(s.removeClass)(this.popupObj.element.querySelectorAll("."+E),[f,v,E]),this.popupObj.element.querySelectorAll("."+M).length>0&&i.i(s.removeClass)(this.popupObj.element.querySelectorAll("."+M),M),this.popupObj.element.querySelectorAll("."+g).length>0&&i.i(s.removeClass)(this.popupObj.element.querySelectorAll("."+g),[g]))},t.prototype.addSelectedAttributes=function(e,t,a,n){if(e){var r=this.globalize.formatDate(t,{type:"date",skeleton:"full"});!i.i(s.isNullOrUndefined)(n)&&n?e.setAttribute("aria-label","The current start and end date is "+r):e.setAttribute("aria-label","The current "+(a?"start":"end")+" date is "+r),e.setAttribute("aria-selected","true")}},t.prototype.removeSelectedAttributes=function(){if(this.popupObj){for(var e=this.popupObj.element.querySelectorAll("."+f),t=0,i=e;t<i.length;t++){var s=i[t];s.setAttribute("aria-selected","false"),s.removeAttribute("aria-label")}for(var a=this.popupObj.element.querySelectorAll("."+v),n=0,r=a;n<r.length;n++){var s=r[n];s.setAttribute("aria-selected","false"),s.removeAttribute("aria-label")}}},t.prototype.updateCalendarElement=function(e){e.classList.contains(d)?(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("."+V),this.tableBodyElement=i.i(s.select)(".e-content tbody",e),this.table=e.querySelector("."+V).getElementsByTagName("table")[0],this.headerTitleElement=e.querySelector(".e-header ."+w),this.headerElement=e.querySelector("."+k)},t.prototype.navPrevMonth=function(e){e.preventDefault();var t=i.i(s.closest)(e.target,"."+d);t=i.i(s.isNullOrUndefined)(t)?i.i(s.closest)(e.target,"."+p):t,this.updateCalendarElement(t),this.navigatePrevious(e),!i.i(s.isNullOrUndefined)(this.startValue)&&i.i(s.isNullOrUndefined)(this.endValue)&&this.updateMinMaxDays(t),this.updateControl(t)},t.prototype.deviceNavigation=function(e){this.deviceCalendarEvent(),this.updateRange([this.popupObj.element.querySelector("."+C)]),this.endButton.element.classList.contains(m)&&this.updateMinMaxDays(this.popupObj.element.querySelector("."+C)),this.endButton.element.classList.contains(m)&&this.selectableDates(),this.currentView()===this.depth&&this.bindCalendarCellEvents(),this.removeFocusedDate()},t.prototype.updateControl=function(e,t){void 0===t&&(t=null),e.classList.contains(p)?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=i.i(s.closest)(e.target,"."+d);t=i.i(s.isNullOrUndefined)(t)?i.i(s.closest)(e.target,"."+p):t,this.updateCalendarElement(t),this.navigateNext(e),!i.i(s.isNullOrUndefined)(this.startValue)&&i.i(s.isNullOrUndefined)(this.endValue)&&this.updateMinMaxDays(t),this.updateControl(t)},t.prototype.isPopupOpen=function(){return!(i.i(s.isNullOrUndefined)(this.popupObj)||!this.popupObj.element.classList.contains("e-popup"))},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"}),a=this.createElement("button",{className:"e-start-btn"});this.startButton=new r.Button({content:this.l10n.getConstant("startLabel")},a),this.endButton=new r.Button({content:this.l10n.getConstant("endLabel")},t),e.appendChild(a),e.appendChild(t)}else{var n=this.createElement("a",{className:"e-start-label"}),l=this.createElement("a",{className:"e-end-label"}),o=this.createElement("span",{className:"e-change-icon e-icons"});i.i(s.attributes)(n,{"aria-atomic":"true","aria-live":"assertive","aria-label":"Start Date",role:"button"}),i.i(s.attributes)(l,{"aria-atomic":"true","aria-live":"assertive","aria-label":"End Date",role:"button"}),e.appendChild(n),e.appendChild(o),e.appendChild(l),n.textContent=this.l10n.getConstant("startLabel"),l.textContent=this.l10n.getConstant("endLabel")}return e},t.prototype.disableInput=function(){this.strictMode?i.i(s.isNullOrUndefined)(this.previousStartValue)||i.i(s.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),l.Input.setEnabled(this.enabled,this.inputElement),this.bindEvents()},t.prototype.validateMinMax=function(){if(this.min=i.i(s.isNullOrUndefined)(this.min)||!+this.min?this.min=new Date(1900,0,1):this.min,this.max=i.i(s.isNullOrUndefined)(this.max)||!+this.max?this.max=new Date(2099,11,31):this.max,!(this.min<=this.max))return void this.disableInput();i.i(s.isNullOrUndefined)(this.minDays)||i.i(s.isNullOrUndefined)(this.maxDays)||this.maxDays>0&&this.minDays>0&&this.minDays>this.maxDays&&(this.maxDays=null),!i.i(s.isNullOrUndefined)(this.minDays)&&this.minDays<0&&(this.minDays=null),!i.i(s.isNullOrUndefined)(this.maxDays)&&this.maxDays<0&&(this.maxDays=null)},t.prototype.validateRangeStrict=function(){i.i(s.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)),i.i(s.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(!i.i(s.isNullOrUndefined)(this.startValue)&&!i.i(s.isNullOrUndefined)(this.endValue)){var e=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1;if(!i.i(s.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();i.i(s.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(C),this.enableRtl&&this.calendarElement.classList.add("e-rtl"),i.i(s.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(i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.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),!i.i(s.isNullOrUndefined)(this.startValue)&&+this.startValue<+this.min||!i.i(s.isNullOrUndefined)(this.endValue)&&+this.endValue>+this.max||!i.i(s.isNullOrUndefined)(this.startValue)&&!i.i(s.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(i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.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;return void this.currentDate.setFullYear(e)}this.currentDate=new Date(+this.endValue),(!i.i(s.isNullOrUndefined)(this.endValue)&&+this.endValue>+this.max||!i.i(s.isNullOrUndefined)(this.startValue)&&!i.i(s.isNullOrUndefined)(this.endValue)&&+this.startValue>+this.endValue||!i.i(s.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(i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.isNullOrUndefined)(this.startValue)||this.isSameDecade(this.endValue,this.currentDate)||this.isDateDisabled(this.endValue)||this.isDateDisabled(this.startValue)){var e=this.currentDate.getFullYear()+10;return void this.currentDate.setFullYear(e)}this.currentDate=new Date(+this.endValue),(!i.i(s.isNullOrUndefined)(this.startValue)&&!i.i(s.isNullOrUndefined)(this.endValue)&&+this.startValue>+this.endValue||!i.i(s.isNullOrUndefined)(this.endValue)&&+this.endValue>+this.max||!i.i(s.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(){i.i(s.isNullOrUndefined)(this.startValue)?(this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.startMonthCurrentDate()):!i.i(s.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)),(!i.i(s.isNullOrUndefined)(this.endValue)&&+this.endValue>+this.max||!i.i(s.isNullOrUndefined)(this.startValue)&&+this.startValue<+this.min||!i.i(s.isNullOrUndefined)(this.startValue)&&!i.i(s.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){i.i(s.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 a=this.calendarElement.querySelector(".e-calendar .e-prev"),n=this.calendarElement.querySelector(".e-calendar .e-next");i.i(s.remove)(this.calendarElement.querySelector(".e-calendar .e-icon-container")),this.calendarElement.querySelector(".e-calendar ."+k).appendChild(n),this.calendarElement.querySelector(".e-calendar ."+k).appendChild(a),i.i(s.prepend)([a],this.calendarElement.querySelector(".e-calendar ."+k)),this.deviceCalendar=this.calendarElement,t.appendChild(this.calendarElement),this.headerTitleElement=this.calendarElement.querySelector(".e-calendar .e-header ."+w)}else{this.selectStartMonth(),this.renderCalendar(),this.leftCalCurrentDate=new Date(+this.currentDate),this.calendarElement.classList.add(d),this.leftCalPrevIcon=this.calendarElement.querySelector(".e-left-calendar .e-prev"),this.leftCalNextIcon=this.calendarElement.querySelector(".e-left-calendar .e-next"),this.leftTitle=this.calendarElement.querySelector(".e-left-calendar ."+w),i.i(s.remove)(this.calendarElement.querySelector(".e-left-calendar .e-icon-container")),this.calendarElement.querySelector(".e-left-calendar ."+k).appendChild(this.leftCalNextIcon),this.calendarElement.querySelector(".e-left-calendar ."+k).appendChild(this.leftCalPrevIcon),i.i(s.prepend)([this.leftCalPrevIcon],this.calendarElement.querySelector(".e-left-calendar ."+k)),this.leftCalendar=this.calendarElement;var r=this.createElement("div",{className:"e-left-container"}),l=this.createElement("div",{className:"e-right-container"});r.appendChild(this.leftCalendar),t.appendChild(r),this.isMobile||s.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),i.i(s.addClass)([this.calendarElement],p),this.rightCalendar=this.calendarElement,i.i(s.removeClass)([this.leftCalendar&&this.leftCalendar.querySelector(".e-content tbody")],"e-zoomin"),i.i(s.removeClass)([this.rightCalendar&&this.rightCalendar.querySelector(".e-content tbody")],"e-zoomin"),this.rightCalPrevIcon=this.calendarElement.querySelector(".e-right-calendar .e-prev"),this.rightCalNextIcon=this.calendarElement.querySelector(".e-right-calendar .e-next"),this.rightTitle=this.calendarElement.querySelector(".e-right-calendar ."+w),i.i(s.remove)(this.calendarElement.querySelector(".e-right-calendar .e-icon-container")),this.calendarElement.querySelector("table").setAttribute("tabindex","0"),this.calendarElement.querySelector(".e-right-calendar ."+k).appendChild(this.rightCalNextIcon),this.calendarElement.querySelector(".e-right-calendar ."+k).appendChild(this.rightCalPrevIcon),i.i(s.prepend)([this.rightCalPrevIcon],this.calendarElement.querySelector(".e-right-calendar ."+k)),l.appendChild(this.rightCalendar),t.appendChild(l),this.isMobile||s.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||(i.i(s.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),!i.i(s.isNullOrUndefined)(this.popupObj)){var a=this.getCalendarView(this.currentView());if(this.isMobile)a===this.depth?(this.bindCalendarCellEvents(),this.deviceNavigation(),this.removeFocusedDate(),this.checkMinMaxDays()):this.selectableDates();else if(this.isMobile||a!==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"))&&i.i(s.isNullOrUndefined)(this.controlDown))(t&&!t.currentTarget.children[0].classList.contains("e-icons")||!i.i(s.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&&i.i(s.isNullOrUndefined)(this.endValue)?"Month"===a&&this.startValue.getMonth()<this.rightCalCurrentDate.getMonth()&&this.startValue.getFullYear()<=this.rightCalCurrentDate.getFullYear()?e.prototype.navigateTo.call(this,a,new Date(+this.startValue)):"Year"===a&&this.startValue.getFullYear()<this.rightCalCurrentDate.getFullYear()?e.prototype.navigateTo.call(this,a,new Date(+this.startValue)):e.prototype.navigateTo.call(this,a,this.leftCalCurrentDate):e.prototype.navigateTo.call(this,a,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,a,this.rightCalCurrentDate);var n=this.rightCalCurrentDate?this.rightCalCurrentDate:this.currentDate;this.updateControl(this.rightCalendar,n),this.updateNavIcons(),this.calendarIconEvent(),this.calendarIconRipple(),this.controlDown=null}this.checkMinMaxDays()}}},t.prototype.createControl=function(){var e=this.createElement("div",{className:"e-date-range-container"}),t=this.createElement("div",{className:"e-range-header"});if(this.isMobile&&this.fullScreenMode){var a=this.createElement("div",{className:"e-model-header-wrapper"}),n=this.createElement("span",{className:"e-popup-close"});s.EventHandler.add(n,"mousedown touchstart",this.modelRangeCloseHandler,this);var l=this.createElement("span",{className:"e-apply"});s.EventHandler.add(l,"mousedown touchstart",this.applyFunction,this),a.appendChild(n),a.appendChild(l),t.appendChild(a)}var o=this.createRangeHeader();t.appendChild(o);var h=this.createElement("div",{className:N});i.i(s.attributes)(h,{"aria-label":"Selected Days"}),h.textContent=this.l10n.getConstant("selectedDays"),t.appendChild(h);var u=this.createElement("div",{className:"e-separator"}),d=this.createCalendar();e.appendChild(t),e.appendChild(u),e.appendChild(d);var p=this.createElement("div",{className:"e-footer"}),c=this.createElement("button",{className:"e-cancel e-flat e-css"}),m=this.createElement("button");i.i(s.addClass)([m],["e-apply","e-flat","e-primary","e-css"]),p.appendChild(m),p.appendChild(c);var f=!i.i(s.isNullOrUndefined)(this.startValue)&&!i.i(s.isNullOrUndefined)(this.endValue);if(this.cancelButton=new r.Button({content:this.l10n.getConstant("cancelText")},c),this.applyButton=new r.Button({content:this.l10n.getConstant("applyText"),disabled:!f},m),s.EventHandler.add(m,"click",this.applyFunction,this),s.EventHandler.add(c,"click",this.cancelFunction,this),this.popupWrapper.appendChild(e),!this.isMobile&&!i.i(s.isUndefined)(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)){this.createPresets(),this.listRippleEffect(),i.i(s.addClass)([e],"e-range-border"),i.i(s.addClass)([this.popupWrapper],"e-preset-wrapper");this.popupWrapper.querySelector(".e-presets").style.height=this.popupWrapper.querySelector(".e-date-range-container").getBoundingClientRect().height+"px"}this.popupWrapper.appendChild(p),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(),i.i(s.addClass)([this.inputWrapper.container],[y])),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(){i.i(s.isNullOrUndefined)(this.startValue)&&i.i(s.isNullOrUndefined)(this.endValue)?(this.endButton.element.setAttribute("disabled",""),this.startButton.element.classList.add(m)):i.i(s.isNullOrUndefined)(this.startValue)||this.startButton.element.classList.add(m)},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(),i.i(s.addClass)([this.inputWrapper.container],[y])),"touchstart"!==e.type&&this.closeEventArgs&&!this.closeEventArgs.cancel&&e.preventDefault(),i.i(s.isNullOrUndefined)(this.startValue)||i.i(s.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()||l.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),i.i(s.closest)(e.target,".e-input-group")||t||this.focusOut(),this.isMobile||(this.isKeyPopup=!1,this.isRangeIconClicked&&(this.inputWrapper.container.children[1].focus(),this.keyInputConfigs=i.i(s.extend)(this.keyInputConfigs,this.keyConfigs),this.popupKeyboardModule=new s.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 a=t||e.target,n=i.i(s.closest)(a,"."+x),r=n&&n.classList.contains(m);n&&n.classList.contains(x)&&this.setListSelection(n,e),this.preventFocus=!0,this.inputElement.focus(),this.isMobile||(this.preventFocus=!0,n&&n.classList.contains(x)&&"custom_range"===n.getAttribute("id")?this.leftCalendar.children[1].firstElementChild.focus():r||"keydown"!==e.type||this.inputElement.focus())}},t.prototype.onMouseOver=function(e){var t=i.i(s.closest)(e.target,"."+x);t&&t.classList.contains(x)&&!t.classList.contains(S)&&i.i(s.addClass)([t],S)},t.prototype.onMouseLeave=function(e){var t=i.i(s.closest)(e.target,"."+S);i.i(s.isNullOrUndefined)(t)||i.i(s.removeClass)([t],S)},t.prototype.setListSelection=function(e,t){if(e&&(!e.classList.contains(m)||this.isMobile&&e.classList.contains(m))){if(this.isMobile&&e.classList.contains(m)){this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(e);if("custom_range"===this.presetsItem[this.activeIndex].id)return void this.renderCustomPopup();return}this.removeListSelection(),this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(e),i.i(s.addClass)([e],m),e.setAttribute("aria-selected","true");var a=this.presetsItem[this.activeIndex];"custom_range"===a.id?this.renderCustomPopup():this.applyPresetRange(a,t)}},t.prototype.removeListSelection=function(){var e=this.presetElement.querySelector("."+m);i.i(s.isNullOrUndefined)(e)||(i.i(s.removeClass)([e],m),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(){this.isCustomWindow=!0,this.popupObj.hide(),this.popupWrapper=this.createElement("div",{id:this.element.id+"_popup",className:c+" e-popup"}),this.renderControl(),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 a=t[e];i.i(s.rippleEffect)(a)}},t.prototype.createPresets=function(){if(!i.i(s.isUndefined)(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)){this.presetElement=this.createElement("div",{className:"e-presets",attrs:{tabindex:"0"}});var e=o.ListBase.createList(this.createElement,this.presetsItem,null,!0);i.i(s.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(i.i(s.isNullOrUndefined)(t)||(t.textContent=""!==this.l10n.getConstant("customRange")?this.l10n.getConstant("customRange"):"Custom Range"),this.liCollections=this.presetElement.querySelectorAll("."+x),this.wireListEvents(),this.isMobile)if(this.fullScreenMode){var a=i.i(s.createElement)("div",{className:"e-range-mob-popup-wrap"}),n=this.createElement("div",{className:"e-model-header"}),r=this.createElement("span",{className:"e-model-title"});r.textContent="Select Preset";var l=this.createElement("span",{className:"e-popup-close"});s.EventHandler.add(l,"mousedown touchstart",this.modelRangeCloseHandler,this);var h=this.presetElement;n.appendChild(l),n.appendChild(r),a.appendChild(n),a.appendChild(h),this.popupWrapper.insertBefore(a,this.popupWrapper.firstElementChild),this.presetElement.style.width="100%"}else this.presetElement.style.width=this.inputWrapper.container.getBoundingClientRect().width+"px";!i.i(s.isNullOrUndefined)(this.activeIndex)&&this.activeIndex>-1&&i.i(s.addClass)([this.liCollections[this.activeIndex]],m)}},t.prototype.wireListEvents=function(){s.EventHandler.add(this.presetElement,"click",this.onMouseClick,this),this.isMobile||(s.EventHandler.add(this.presetElement,"mouseover",this.onMouseOver,this),s.EventHandler.add(this.presetElement,"mouseout",this.onMouseLeave,this))},t.prototype.unWireListEvents=function(){i.i(s.isNullOrUndefined)(this.presetElement)||(s.EventHandler.remove(this.presetElement,"click touchstart",this.onMouseClick),this.isMobile||(s.EventHandler.remove(this.presetElement,"mouseover",this.onMouseOver),s.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;i.i(s.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 n.Popup(this.popupWrapper,{relateTo:this.isMobile&&this.isCustomWindow?document.body:i.i(s.isNullOrUndefined)(this.targetElement)?this.inputWrapper.container:this.targetElement,position:this.isMobile?i.i(s.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?i.i(s.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 s.Touch(e.calendarElement.querySelector(".e-content.e-month"),{swipe:e.dateRangeSwipeHandler.bind(e)}),s.EventHandler.add(e.calendarElement.querySelector(".e-content.e-month"),"touchstart",e.touchStartRangeHandler,e))),i.i(s.attributes)(e.inputElement,{"aria-expanded":"true","aria-owns":e.element.id,"aria-controls":e.inputElement.id}),e.value?i.i(s.attributes)(e.inputElement,{"aria-activedescendant":e.inputElement.id}):e.inputElement.removeAttribute("aria-activedescendant"),i.i(s.addClass)([e.inputWrapper.buttons[0]],m),e.isMobile||(e.cancelButton&&(e.btnKeyboardModule=new s.KeyboardEvents(e.cancelButton.element,{eventName:"keydown",keyAction:e.popupKeyActionHandle.bind(e),keyConfigs:{tab:"tab",altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}}),e.btnKeyboardModule=new s.KeyboardEvents(e.applyButton.element,{eventName:"keydown",keyAction:e.popupKeyActionHandle.bind(e),keyConfigs:{altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}})),i.i(s.isNullOrUndefined)(e.leftCalendar)||e.isRangeIconClicked||e.calendarFocus(),i.i(s.isNullOrUndefined)(e.presetElement)||(e.keyInputConfigs=i.i(s.extend)(e.keyInputConfigs,e.keyConfigs),e.presetKeyboardModule=new s.KeyboardEvents(e.presetElement,{eventName:"keydown",keyAction:e.presetKeyActionHandler.bind(e),keyConfigs:e.keyInputConfigs}),e.presetKeyboardModule=new s.KeyboardEvents(e.presetElement,{eventName:"keydown",keyAction:e.popupKeyActionHandle.bind(e),keyConfigs:{altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}}),i.i(s.isNullOrUndefined)(e.leftCalendar)?(e.preventBlur=!0,e.presetElement.focus()):e.presetElement.setAttribute("tabindex","-1")),e.popupKeyBoardHandler()),e.isMobile&&!s.Browser.isDevice&&s.EventHandler.add(document,"keydown",e.popupCloseHandler,e)},close:function(){i.i(s.attributes)(e.inputElement,{"aria-expanded":"false"}),e.inputElement.removeAttribute("aria-owns"),e.inputElement.removeAttribute("aria-controls"),e.inputElement.removeAttribute("aria-activedescendant"),i.i(s.removeClass)([e.inputWrapper.buttons[0]],m),e.isRangeIconClicked&&e.inputWrapper.container.children[1].focus(),i.i(s.isUndefined)(e.presets[0].start&&e.presets[0].end&&e.presets[0].label)||e.unWireListEvents(),i.i(s.isNullOrUndefined)(e.popupObj)||(i.i(s.isNullOrUndefined)(e.popupObj.element.parentElement)||i.i(s.detach)(e.popupObj.element),e.popupObj.destroy(),e.popupObj=null),e.isMobile&&!s.Browser.isDevice&&s.EventHandler.remove(document,"keydown",e.popupCloseHandler)},targetExitViewport:function(){var t=e.popupObj&&e.popupObj.element;!s.Browser.isDevice&&t&&t.getBoundingClientRect().height<window.innerHeight&&e.hide()}}),this.isMobile&&(this.popupObj.element.classList.add("e-device"),this.isMobile||this.popupObj.element.classList.add("e-bigger")),this.isMobile&&this.isCustomWindow&&(i.i(s.addClass)([this.modal],["e-device",c,"e-range-modal"]),document.body.className+=" e-range-overflow",this.modal.style.display="block"),s.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){switch(e.keyCode){case 27:this.hide(e)}},t.prototype.calendarFocus=function(){var e=this.popupObj&&this.popupObj.element.querySelector("."+f);if(e){var t=i.i(s.closest)(e,"."+p);t=i.i(s.isNullOrUndefined)(t)?this.leftCalendar:t,this.isRangeIconClicked?this.inputWrapper.container.focus():(this.preventBlur=!0,t.children[1].firstElementChild.focus()),i.i(s.addClass)([e],M)}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(".e-presets"),t=this.popupObj&&this.popupObj.element.querySelector(".e-date-range-container");i.i(s.isNullOrUndefined)(e)||i.i(s.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(),a=this.getActiveLI();if(!i.i(s.isNullOrUndefined)(this.leftCalendar)&&!i.i(s.isNullOrUndefined)(a)&&(i.i(s.isNullOrUndefined)(t)||!i.i(s.isNullOrUndefined)(a)&&a===t)){this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(a);if("custom_range"===this.presetsItem[this.activeIndex].id)return this.calendarFocus(),a.classList.remove(S),void e.preventDefault()}i.i(s.isNullOrUndefined)(t)&&i.i(s.isNullOrUndefined)(a)||this.onMouseClick(e,t||a),e.preventDefault();break;case"tab":if(this.leftCalendar){var n=this.getHoverLI();i.i(s.isNullOrUndefined)(n)||n.classList.remove(S)}else this.hide(e),e.preventDefault()}},t.prototype.listMoveDown=function(e){var t=this.getHoverLI(),a=this.getActiveLI();if(i.i(s.isNullOrUndefined)(t))if(i.i(s.isNullOrUndefined)(a))i.i(s.addClass)([this.liCollections[0]],S);else{var n=a.nextElementSibling;!i.i(s.isNullOrUndefined)(n)&&n.classList.contains(x)&&i.i(s.addClass)([n],S)}else{var n=t.nextElementSibling;!i.i(s.isNullOrUndefined)(n)&&n.classList.contains(x)&&(i.i(s.removeClass)([t],S),i.i(s.addClass)([n],S))}},t.prototype.listMoveUp=function(e){var t=this.getHoverLI(),a=this.getActiveLI();if(i.i(s.isNullOrUndefined)(t)){if(!i.i(s.isNullOrUndefined)(a)){var n=a.previousElementSibling;!i.i(s.isNullOrUndefined)(n)&&n.classList.contains(x)&&i.i(s.addClass)([n],S)}}else{var n=t.previousElementSibling;!i.i(s.isNullOrUndefined)(n)&&n.classList.contains(x)&&(i.i(s.removeClass)([t],S),i.i(s.addClass)([n],S))}},t.prototype.getHoverLI=function(){return this.presetElement.querySelector("."+S)},t.prototype.getActiveLI=function(){return this.presetElement.querySelector("."+m)},t.prototype.popupKeyBoardHandler=function(){this.popupKeyboardModule=new s.KeyboardEvents(this.popupWrapper,{eventName:"keydown",keyAction:this.popupKeyActionHandle.bind(this),keyConfigs:{escape:"escape"}}),this.keyInputConfigs=i.i(s.extend)(this.keyInputConfigs,this.keyConfigs),this.popupKeyboardModule=new s.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("."+S),a=this.presetElement.querySelector("."+m),n=i.i(s.isNullOrUndefined)(t)?a:t;if(!i.i(s.isNullOrUndefined)(n)){var r=n.nextElementSibling,l=r?r.offsetTop:n.offsetTop,o=n.getBoundingClientRect().height;l+n.offsetTop>e?this.presetElement.scrollTop=r?l-(e/2+o/2):l:this.presetElement.scrollTop=0}},t.prototype.popupKeyActionHandle=function(e){var t=i.i(s.closest)(e.target,".e-presets");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":i.i(s.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":i.i(s.isNullOrUndefined)(t)?document.activeElement===this.applyButton.element&&!0!==this.applyButton.element.disabled?this.cancelButton.element.focus():i.i(s.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(!i.i(s.isNullOrUndefined)(this.popupObj)){var t=e.target;this.inputWrapper.container.contains(t)&&(i.i(s.isNullOrUndefined)(this.popupObj)||i.i(s.closest)(t,'[id="'+this.popupWrapper.id+'"]')||"mousedown"===e.type)||"touchstart"!==e.type&&("mousedown"===e.type||this.closeEventArgs&&!this.closeEventArgs.cancel)&&e.preventDefault(),!i.i(s.isNullOrUndefined)(this.targetElement)&&(i.i(s.isNullOrUndefined)(this.targetElement)||t===this.targetElement)||i.i(s.closest)(t,'[id="'+this.popupWrapper.id+'"]')||i.i(s.closest)(t,".e-input-group")===this.inputWrapper.container||i.i(s.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;i.i(s.isNullOrUndefined)(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),this.inputWrapper=l.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),i.i(s.attributes)(this.inputElement,{tabindex:"0","aria-expanded":"false",role:"combobox",autocomplete:"off","aria-disabled":this.enabled?"false":"true",autocorrect:"off",autocapitalize:"off",spellcheck:"false"}),l.Input.addAttributes({"aria-label":"select",role:"button"},this.inputWrapper.buttons[0]),this.setEleWidth(this.width),i.i(s.addClass)([this.inputWrapper.container],"e-date-range-wrapper"),i.i(s.isNullOrUndefined)(this.inputElement.getAttribute("name"))&&i.i(s.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?i.i(s.formatUnit)(this.width):"100%"},t.prototype.adjustLongHeaderWidth=function(){"Wide"===this.dayHeaderFormat&&i.i(s.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(),i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.isNullOrUndefined)(this.startValue)||e||i.i(s.isNullOrUndefined)(this.renderDayCellArgs)||!this.renderDayCellArgs.isDisabled||this.disabledDateRender(),this.errorClass(),this.previousStartValue=i.i(s.isNullOrUndefined)(this.startValue)||isNaN(+this.startValue)?null:new Date(+this.startValue),this.previousEndValue=i.i(s.isNullOrUndefined)(this.endValue)||isNaN(+this.endValue)?null:new Date(+this.endValue)},t.prototype.updateInput=function(){if(!i.i(s.isNullOrUndefined)(this.endValue)&&!i.i(s.isNullOrUndefined)(this.startValue)){var e={format:this.formatString,type:"date",skeleton:"yMd"},t=this.globalize.formatDate(this.startValue,e),a=this.globalize.formatDate(this.endValue,e);l.Input.setValue(t+" "+this.separator+" "+a,this.inputElement,this.floatLabelType,this.showClearButton),this.previousStartValue=new Date(+this.startValue),this.previousEndValue=new Date(+this.endValue)}!this.strictMode&&i.i(s.isNullOrUndefined)(this.value)&&this.invalidValueString&&l.Input.setValue(this.invalidValueString,this.inputElement,this.floatLabelType,this.showClearButton)},t.prototype.checkInvalidRange=function(e){if(!i.i(s.isNullOrUndefined)(e)){var t=!1,a=void 0,n=void 0,r=null,l=null,o=null,h=!1,u=!1,d=!1;if("string"==typeof e){var p=e.split(" "+this.separator+" ");2===p.length?(r=p[0],l=p[1]):(t=!0,o=e)}else e.length>0?(a=e[0],n=e[1]):(a=e.start,n=e.end),a instanceof Date||"object"==typeof a?a instanceof Date?h=!0:i.i(s.isNullOrUndefined)(a)||(d=!0):r=this.getstringvalue(a),n instanceof Date||"object"==typeof n?n instanceof Date?u=!0:i.i(s.isNullOrUndefined)(n)||(d=!0):l=this.getstringvalue(n);(i.i(s.isNullOrUndefined)(r)&&!h&&!i.i(s.isNullOrUndefined)(l)||!i.i(s.isNullOrUndefined)(r)&&!u&&i.i(s.isNullOrUndefined)(l))&&(t=!0),d&&(r=l=o=null,t=!0),r&&(t=t||this.checkInvalidValue(r)),l&&(t=t||this.checkInvalidValue(l)),t&&(h&&!d&&(r=a.toLocaleDateString()),u&&!d&&(l=n.toLocaleDateString()),i.i(s.isNullOrUndefined)(r)||i.i(s.isNullOrUndefined)(l)?i.i(s.isNullOrUndefined)(r)?i.i(s.isNullOrUndefined)(l)||(o=l):o=r:o=r+" "+this.separator+" "+l,this.invalidValueString=o,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 i.i(s.isNullOrUndefined)(e)||"number"!=typeof e?i.i(s.isNullOrUndefined)(e)||"string"!=typeof e||(t=""+e):t=e.toString(),t},t.prototype.checkInvalidValue=function(e){var t=e,i=!1,a=null;if(a={format:this.formatString,type:"date",skeleton:"yMd"},"string"!=typeof t)i=!0;else{var n=new s.Internationalization(this.locale);if(!this.checkDateValue(n.parseDate(t,a))){var r=null,l=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)?)?/,l=/^\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)?)?/,(!r.test(t)&&!l.test(t)||/^[a-zA-Z0-9- ]*$/.test(t)||isNaN(+new Date(this.checkValue(t))))&&(i=!0)}}return i},t.prototype.isDateDisabled=function(e){if(i.i(s.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 a=this.virtualRenderCellArgs;return this.virtualRenderCellEvent(a),!!a.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){i.i(s.extend)(this.virtualRenderCellArgs,{name:"renderDayCell"}),this.trigger("renderDayCell",e)},t.prototype.disabledDates=function(){var e=!1,t=!1;return i.i(s.isNullOrUndefined)(this.endValue)||i.i(s.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&&(i.i(s.addClass)([this.inputWrapper.container],[y]),this.inputElement.focus())},t.prototype.focusOut=function(){var e=this.preventBlur;document.activeElement===this.inputElement&&(i.i(s.removeClass)([this.inputWrapper.container],[y]),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&&(i.i(s.removeClass)([this.inputElement],[c]),s.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),l.Input.removeAttributes(t,this.inputElement),i.i(s.isNullOrUndefined)(this.cloneElement.getAttribute("tabindex"))?this.inputElement.removeAttribute("tabindex"):this.inputElement.setAttribute("tabindex",this.tabIndex),this.ensureInputAttribute(),this.inputElement.classList.remove("e-input"),i.i(s.isNullOrUndefined)(this.inputWrapper)||(s.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler),null===this.angularTag&&this.inputWrapper.container.parentElement.appendChild(this.inputElement),i.i(s.detach)(this.inputWrapper.container))),i.i(s.isNullOrUndefined)(this.inputKeyboardModule)||this.isMobile||this.inputKeyboardModule.destroy(),this.popupObj&&(this.isMobile||this.clearCalendarEvents()),l.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&&s.EventHandler.remove(this.formElement,"reset",this.formResetHandler),i.i(s.isNullOrUndefined)(this.firstHiddenChild)||i.i(s.isNullOrUndefined)(this.secondHiddenChild)||(i.i(s.detach)(this.firstHiddenChild),i.i(s.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(var t=0;t<e.length;t++)i.i(s.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.getPersistData=function(){var e=["startDate","endDate","value"];return this.addOnPersist(e)},t.prototype.getSelectedRange=function(){var e;return i.i(s.isNullOrUndefined)(this.startValue)||i.i(s.isNullOrUndefined)(this.endValue)?e=0:(e=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1,!i.i(s.isNullOrUndefined)(this.renderDayCellArgs)&&this.renderDayCellArgs.isDisabled&&this.disabledDateRender(),i.i(s.isNullOrUndefined)(this.disabledDayCnt)||(e-=this.disabledDayCnt,this.disabledDayCnt=null)),{startDate:this.startValue,endDate:this.endValue,daySpan:e}},t.prototype.show=function(t,a){var n=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||s.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:a||null,appendTo:this.isMobile||s.Browser.isDevice?this.mobileRangePopupWrap:document.body};var r=this.openEventArgs;if(this.trigger("open",r,function(r){if(n.openEventArgs=r,!n.openEventArgs.cancel){n.openEventArgs.appendTo.appendChild(n.popupWrapper),n.showPopup(t,a);var l=!n.isCustomRange||n.isMobile&&n.isCustomRange;!i.i(s.isUndefined)(n.presets[0].start&&n.presets[0].end&&n.presets[0].label)&&l&&n.setScrollPosition(),n.checkMinMaxDays(),n.isMobile&&!i.i(s.isNullOrUndefined)(n.startDate)&&i.i(s.isNullOrUndefined)(n.endDate)&&(n.endButton.element.classList.add(m),n.startButton.element.classList.remove(m),n.endButton.element.removeAttribute("disabled"),n.selectableDates()),e.prototype.setOverlayIndex.call(n,n.mobileRangePopupWrap,n.popupObj.element,n.modal,n.isMobile||s.Browser.isDevice)}}),s.Browser.isDevice){var l=this.createElement("div",{className:"e-dlg-overlay"});l.style.zIndex=(this.zIndex-1).toString(),this.mobileRangePopupWrap.appendChild(l)}}},t.prototype.hide=function(e){var t=this;if(this.popupObj){if(i.i(s.isNullOrUndefined)(this.previousEndValue)&&i.i(s.isNullOrUndefined)(this.previousStartValue)?this.clearRange():(i.i(s.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))),i.i(s.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 a=this.closeEventArgs;this.trigger("close",a,function(e){t.closeEventArgs=e,t.closeEventArgs.cancel?i.i(s.removeClass)([t.inputWrapper.buttons[0]],m):(t.isMobile&&(i.i(s.isNullOrUndefined)(t.startButton)||i.i(s.isNullOrUndefined)(t.endButton)||(s.EventHandler.remove(t.startButton.element,"click touchstart",t.deviceHeaderClick),s.EventHandler.remove(t.endButton.element,"click touchstart",t.deviceHeaderClick))),t.popupObj&&(t.popupObj.hide(),t.preventBlur&&(t.inputElement.focus(),i.i(s.addClass)([t.inputWrapper.container],[y]))),t.isMobile||(i.i(s.isNullOrUndefined)(t.leftKeyboardModule)||i.i(s.isNullOrUndefined)(t.rightKeyboardModule)||(t.leftKeyboardModule.destroy(),t.rightKeyboardModule.destroy()),i.i(s.isNullOrUndefined)(t.presetElement)||t.presetKeyboardModule.destroy(),i.i(s.isNullOrUndefined)(t.cancelButton)||t.btnKeyboardModule.destroy()),t.targetElement=null,i.i(s.removeClass)([document.body],"e-range-overflow"),s.EventHandler.remove(document,"mousedown touchstart",t.documentHandler),t.isMobile&&t.modal&&(t.modal.style.display="none",t.modal.outerHTML="",t.modal=null),(t.isMobile||s.Browser.isDevice)&&(i.i(s.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 s.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.dateRangeOptions&&null==this.dateRangeOptions.placeholder&&(this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),l.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(){l.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.refreshChange()},t.prototype.enableInput=function(){+this.min<=+this.max&&(this.setProperties({enabled:!0},!0),l.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?this.setProperties({value:{start:null,end:null}},!0):t.value&&!t.value.start&&this.setProperties({value:{start:null,end:null}},!0),this.updateValue(),this.setDate()},t.prototype.createHiddenInput=function(){i.i(s.isNullOrUndefined)(this.firstHiddenChild)&&i.i(s.isNullOrUndefined)(this.secondHiddenChild)&&(this.firstHiddenChild=this.createElement("input"),this.secondHiddenChild=this.createElement("input")),i.i(s.isNullOrUndefined)(this.inputElement.getAttribute("name"))||(this.inputElement.setAttribute("data-name",this.inputElement.getAttribute("name")),this.inputElement.removeAttribute("name")),i.i(s.attributes)(this.firstHiddenChild,{type:"text",name:this.inputElement.getAttribute("data-name"),class:"e-daterange-hidden"}),i.i(s.attributes)(this.secondHiddenChild,{type:"text",name:this.inputElement.getAttribute("data-name"),class:"e-daterange-hidden"});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&&i.i(s.isNullOrUndefined)(this.startValue)&&i.i(s.isNullOrUndefined)(this.endValue)?this.removeSelection():this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar]),this.updateHeader())},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 a={format:this.formatString,type:"date",skeleton:"yMd"},n=0,r=Object.keys(e);n<r.length;n++){var o=r[n];switch(["maxDays","minDays","value"].indexOf(o)<0&&this.hide(null),o){case"width":this.setEleWidth(this.width),l.Input.calculateWidth(this.inputElement,this.inputWrapper.container),i.i(s.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(s.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":l.Input.setPlaceholder(e.placeholder,this.inputElement),this.setProperties({placeholder:e.placeholder},!0);break;case"readonly":l.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),l.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),l.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"locale":this.globalize=new s.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.dateRangeOptions&&null==this.dateRangeOptions.placeholder&&(this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),l.Input.setPlaceholder(this.placeholder,this.inputElement)),this.setLocale();break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.setDataAttribute(!0),this.checkHtmlAttributes(!0);break;case"showClearButton":l.Input.setClearButton(this.showClearButton,this.inputElement,this.inputWrapper),this.bindClearEvent();break;case"startDate":"string"==typeof e.startDate&&(e.startDate=this.globalize.parseDate(e.startDate,a)),+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(e.endDate,a)),+this.initEndDate!=+e.endDate&&(this.endValue=this.getStartEndValue(e.endDate,!0),this.setDate(),this.setValue());break;case"value":if(this.invalidValueString=null,this.checkInvalidRange(e.value),"string"==typeof e.value)if(this.invalidValueString)this.clearModelvalue(e,t);else{var h=e.value.split(" "+this.separator+" ");this.value=[new Date(h[0]),new Date(h[1])],this.updateValue(),this.setDate()}else!i.i(s.isNullOrUndefined)(e.value)&&e.value.length>0||!i.i(s.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?this.modelValue=e.value:e.value.start&&(this.modelValue=e.value),this.updateValue(),this.setDate())):(i.i(s.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(i.i(s.isNullOrUndefined)(this.startValue)&&i.i(s.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":this.setProperties({minDays:e.minDays},!0),this.refreshChange(),this.setMinMaxDays();break;case"maxDays":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,l.Input.removeFloating(this.inputWrapper),l.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder),i.i(s.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(s.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()}}},u([i.i(s.Property)(null)],t.prototype,"value",void 0),u([i.i(s.Property)(!1)],t.prototype,"enablePersistence",void 0),u([i.i(s.Property)(new Date(1900,0,1))],t.prototype,"min",void 0),u([i.i(s.Property)(new Date(2099,11,31))],t.prototype,"max",void 0),u([i.i(s.Property)(null)],t.prototype,"locale",void 0),u([i.i(s.Property)(null)],t.prototype,"firstDayOfWeek",void 0),u([i.i(s.Property)(!1)],t.prototype,"weekNumber",void 0),u([i.i(s.Property)("Gregorian")],t.prototype,"calendarMode",void 0),u([i.i(s.Property)(!1)],t.prototype,"openOnFocus",void 0),u([i.i(s.Property)(!1)],t.prototype,"fullScreenMode",void 0),u([i.i(s.Event)()],t.prototype,"created",void 0),u([i.i(s.Event)()],t.prototype,"destroyed",void 0),u([i.i(s.Event)()],t.prototype,"change",void 0),u([i.i(s.Event)()],t.prototype,"cleared",void 0),u([i.i(s.Event)()],t.prototype,"navigated",void 0),u([i.i(s.Event)()],t.prototype,"renderDayCell",void 0),u([i.i(s.Property)(null)],t.prototype,"startDate",void 0),u([i.i(s.Property)(null)],t.prototype,"endDate",void 0),u([i.i(s.Collection)([{}],A)],t.prototype,"presets",void 0),u([i.i(s.Property)("")],t.prototype,"width",void 0),u([i.i(s.Property)(1e3)],t.prototype,"zIndex",void 0),u([i.i(s.Property)(!0)],t.prototype,"showClearButton",void 0),u([i.i(s.Property)(!0)],t.prototype,"showTodayButton",void 0),u([i.i(s.Property)("Month")],t.prototype,"start",void 0),u([i.i(s.Property)("Month")],t.prototype,"depth",void 0),u([i.i(s.Property)("")],t.prototype,"cssClass",void 0),u([i.i(s.Property)("-")],t.prototype,"separator",void 0),u([i.i(s.Property)(null)],t.prototype,"minDays",void 0),u([i.i(s.Property)(null)],t.prototype,"maxDays",void 0),u([i.i(s.Property)(!1)],t.prototype,"strictMode",void 0),u([i.i(s.Property)(null)],t.prototype,"keyConfigs",void 0),u([i.i(s.Property)(null)],t.prototype,"format",void 0),u([i.i(s.Property)(!0)],t.prototype,"enabled",void 0),u([i.i(s.Property)(!1)],t.prototype,"readonly",void 0),u([i.i(s.Property)(!0)],t.prototype,"allowEdit",void 0),u([i.i(s.Property)("Never")],t.prototype,"floatLabelType",void 0),u([i.i(s.Property)(null)],t.prototype,"placeholder",void 0),u([i.i(s.Property)({})],t.prototype,"htmlAttributes",void 0),u([i.i(s.Event)()],t.prototype,"open",void 0),u([i.i(s.Event)()],t.prototype,"close",void 0),u([i.i(s.Event)()],t.prototype,"select",void 0),u([i.i(s.Event)()],t.prototype,"focus",void 0),u([i.i(s.Event)()],t.prototype,"blur",void 0),t=u([s.NotifyPropertyChanges],t)}(a.b)},function(e,t,i){"use strict";i.d(t,"a",function(){return D});var s=i(0),a=(i.n(s),i(2)),n=(i.n(a),i(1)),r=(i.n(n),i(4)),l=i(5),o=this&&this.__extends||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])})(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)}}(),h=this&&this.__decorate||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},u=(new Date).getDate(),d=(new Date).getMonth(),p=(new Date).getFullYear(),c=(new Date).getHours(),m=(new Date).getMinutes(),f=(new Date).getSeconds(),v=(new Date).getMilliseconds(),y="e-datetimepicker",g="e-active",b="e-list-item",D=function(e){function t(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 o(t,e),t.prototype.focusHandler=function(){this.enabled&&i.i(s.addClass)([this.inputWrapper.container],"e-input-focus")},t.prototype.focusIn=function(){e.prototype.focusIn.call(this)},t.prototype.focusOut=function(){document.activeElement===this.inputElement&&(this.inputElement.blur(),i.i(s.removeClass)([this.inputWrapper.container],["e-input-focus"]))},t.prototype.blurHandler=function(e){if(this.enabled){if(this.isTimePopupOpen()&&this.isPreventBlur)return void this.inputElement.focus();i.i(s.removeClass)([this.inputWrapper.container],"e-input-focus");var t={model:this};this.isTimePopupOpen()&&this.hide(e),this.trigger("blur",t)}},t.prototype.destroy=function(){this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),this.popupObject&&this.popupObject.element.classList.contains("e-popup")&&(this.popupObject.destroy(),i.i(s.detach)(this.dateTimeWrapper),this.dateTimeWrapper=void 0,this.liCollections=this.timeCollections=[],i.i(s.isNullOrUndefined)(this.rippleFn)||this.rippleFn());var t={"aria-live":"assertive","aria-atomic":"true","aria-invalid":"false",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-expanded":"false",role:"combobox",autocomplete:"off"};this.inputElement&&n.Input.removeAttributes(t,this.inputElement),this.isCalendar()&&(this.popupWrapper&&i.i(s.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,n.Input.destroy({element:this.inputElement,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),e.prototype.destroy.call(this)},t.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))),!i.i(s.isNullOrUndefined)(i.i(s.closest)(this.element,"fieldset"))&&i.i(s.closest)(this.element,"fieldset").disabled&&(this.enabled=!1),e.prototype.updateHtmlAttributeToElement.call(this),this.checkAttributes(!1);var t={placeholder:this.placeholder};this.l10n=new s.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||n.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&&n.Input.calculateWidth(this.inputElement,this.inputWrapper.container),i.i(s.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(s.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()},t.prototype.setValue=function(t){if(void 0===t&&(t=!1),this.initValue=this.validateMinMaxRange(this.value),!this.strictMode&&this.isDateObject(this.initValue)){var a=this.validateMinMaxRange(this.initValue);n.Input.setValue(this.getFormattedValue(a),this.inputElement,this.floatLabelType,this.showClearButton),this.setProperties({value:a},!0)}else i.i(s.isNullOrUndefined)(this.value)&&(this.initValue=null,this.setProperties({value:null},!0));this.valueWithMinutes=this.value,e.prototype.updateInput.call(this,t)},t.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},t.prototype.checkValidState=function(e){this.isValidState=!0,this.strictMode||(+e>+this.max||+e<+this.min)&&(this.isValidState=!1),this.checkErrorState()},t.prototype.checkErrorState=function(){this.isValidState?i.i(s.removeClass)([this.inputWrapper.container],"e-error"):i.i(s.addClass)([this.inputWrapper.container],"e-error"),i.i(s.attributes)(this.inputElement,{"aria-invalid":this.isValidState?"false":"true"})},t.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},t.prototype.disablePopupButton=function(e){e?(i.i(s.addClass)([this.inputWrapper.buttons[0],this.timeIcon],"e-disabled"),this.hide()):i.i(s.removeClass)([this.inputWrapper.buttons[0],this.timeIcon],"e-disabled")},t.prototype.getFormattedValue=function(e){var t;return i.i(s.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))},t.prototype.isDateObject=function(e){return!i.i(s.isNullOrUndefined)(e)&&!isNaN(+e)},t.prototype.createInputElement=function(){i.i(s.removeClass)([this.inputElement],"e-datepicker"),i.i(s.removeClass)([this.inputWrapper.container],"e-date-wrapper"),i.i(s.addClass)([this.inputWrapper.container],"e-datetime-wrapper"),i.i(s.addClass)([this.inputElement],y),this.renderTimeIcon()},t.prototype.renderTimeIcon=function(){this.timeIcon=n.Input.appendSpan("e-input-group-icon e-time-icon e-icons",this.inputWrapper.container)},t.prototype.bindInputEvents=function(){s.EventHandler.add(this.timeIcon,"mousedown",this.timeHandler,this),s.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.dateHandler,this),s.EventHandler.add(this.inputElement,"blur",this.blurHandler,this),s.EventHandler.add(this.inputElement,"focus",this.focusHandler,this),this.defaultKeyConfigs=i.i(s.extend)(this.defaultKeyConfigs,this.keyConfigs),this.keyboardHandler=new s.KeyboardEvents(this.inputElement,{eventName:"keydown",keyAction:this.inputKeyAction.bind(this),keyConfigs:this.defaultKeyConfigs})},t.prototype.unBindInputEvents=function(){s.EventHandler.remove(this.timeIcon,"mousedown touchstart",this.timeHandler),s.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown touchstart",this.dateHandler),this.inputElement&&(s.EventHandler.remove(this.inputElement,"blur",this.blurHandler),s.EventHandler.remove(this.inputElement,"focus",this.focusHandler)),this.keyboardHandler&&this.keyboardHandler.destroy()},t.prototype.cldrTimeFormat=function(){return this.isNullOrEmpty(this.timeFormat)?"en"===this.locale||"en-US"===this.locale?i.i(s.getValue)("timeFormats.short",i.i(s.getDefaultDateObject)()):this.getCultureTimeObject(s.cldrData,""+this.locale):this.timeFormat},t.prototype.cldrDateTimeFormat=function(){var e=new s.Internationalization(this.locale),t=e.getDatePattern({skeleton:"yMd"});return this.isNullOrEmpty(this.formatString)?t+" "+this.getCldrFormat("time"):this.formatString},t.prototype.getCldrFormat=function(e){return"en"===this.locale||"en-US"===this.locale?i.i(s.getValue)("timeFormats.short",i.i(s.getDefaultDateObject)()):this.getCultureTimeObject(s.cldrData,""+this.locale)},t.prototype.isNullOrEmpty=function(e){return!!(i.i(s.isNullOrUndefined)(e)||"string"==typeof e&&""===e.trim())},t.prototype.getCultureTimeObject=function(e,t){return"Gregorian"===this.calendarMode?i.i(s.getValue)("main."+this.locale+".dates.calendars.gregorian.timeFormats.short",e):i.i(s.getValue)("main."+this.locale+".dates.calendars.islamic.timeFormats.short",e)},t.prototype.timeHandler=function(t){this.enabled&&(this.isIconClicked=!0,s.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),i.i(s.addClass)([this.inputWrapper.container],["e-input-focus"]))),this.isIconClicked=!1)},t.prototype.dateHandler=function(e){this.enabled&&(e.currentTarget===this.inputWrapper.buttons[0]&&e.preventDefault(),this.enabled&&!this.readonly&&(this.isTimePopupOpen()&&this.closePopup(e),i.i(s.isNullOrUndefined)(this.popupWrapper)||this.popupCreation("date",e)))},t.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)))},t.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)},t.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.inputElement.value,{format:this.dateFormatString,type:"datetime"})):e=this.globalize.parseDate(this.inputElement.value,{format:this.cldrDateTimeFormat(),type:"datetime",calendar:"islamic"});var t=i.i(s.isNullOrUndefined)(this.value)?""!==this.inputElement.value?e:new Date:this.value;this.valueWithMinutes=t,this.listWrapper=i.i(s.createElement)("div",{className:"e-content",attrs:{tabindex:"0"}});var a=this.startTime(t),n=this.endTime(t),r=l.a.createListItems(this.createElement,a,n,this.globalize,this.cldrTimeFormat(),this.step);this.timeCollections=r.collection,this.listTag=r.list,i.i(s.attributes)(this.listTag,{role:"listbox","aria-hidden":"false",id:this.element.id+"_options"}),i.i(s.append)([r.list],this.listWrapper),this.wireTimeListEvents();var o={duration:300,selector:"."+b};this.rippleFn=i.i(s.rippleEffect)(this.listWrapper,o),this.liCollections=this.listWrapper.querySelectorAll("."+b)},t.prototype.popupCreation=function(e,t){if(s.Browser.isDevice&&this.element.setAttribute("readonly","readonly"),"date"===e)!this.readonly&&this.popupWrapper&&(i.i(s.addClass)([this.popupWrapper],"e-datetimepopup-wrapper"),i.i(s.attributes)(this.popupWrapper,{id:this.element.id+"_options"}));else if(!this.readonly&&(this.dateTimeWrapper=i.i(s.createElement)("div",{className:y+" e-popup",attrs:{id:this.element.id+"_timepopup",style:"visibility:hidden ; display:block"}}),i.i(s.isNullOrUndefined)(this.cssClass)||(this.dateTimeWrapper.className+=" "+this.cssClass),!i.i(s.isNullOrUndefined)(this.step)&&this.step>0&&(this.listCreation(),i.i(s.append)([this.listWrapper],this.dateTimeWrapper)),document.body.appendChild(this.dateTimeWrapper),this.addTimeSelection(),this.renderPopup(),this.setTimeScrollPosition(),this.openPopup(t),(!s.Browser.isDevice||s.Browser.isDevice&&!this.fullScreenMode)&&this.popupObject.refreshPosition(this.inputElement),s.Browser.isDevice&&this.fullScreenMode&&(this.dateTimeWrapper.style.left="0px"),s.Browser.isDevice)){var a=this.createElement("div",{className:"e-dlg-overlay"});a.style.zIndex=(this.zIndex-1).toString(),this.timeModal.appendChild(a)}},t.prototype.openPopup=function(e){var t=this;this.preventArgs={cancel:!1,popup:this.popupObject,event:e||null};var a=this.preventArgs;this.trigger("open",a,function(e){if(t.preventArgs=e,!t.preventArgs.cancel&&!t.readonly){var a={name:"FadeIn",duration:100};1e3===t.zIndex?t.popupObject.show(new s.Animation(a),t.element):t.popupObject.show(new s.Animation(a),null),i.i(s.addClass)([t.inputWrapper.container],["e-icon-anim"]),i.i(s.attributes)(t.inputElement,{"aria-expanded":"true"}),i.i(s.attributes)(t.inputElement,{"aria-owns":t.inputElement.id+"_options"}),i.i(s.attributes)(t.inputElement,{"aria-controls":t.inputElement.id}),s.EventHandler.add(document,"mousedown touchstart",t.documentClickHandler,t)}})},t.prototype.documentClickHandler=function(e){var t=e.target;!i.i(s.isNullOrUndefined)(this.popupObject)&&(this.inputWrapper.container.contains(t)&&"mousedown"!==e.type||this.popupObject.element&&this.popupObject.element.contains(t))&&"touchstart"!==e.type&&e.preventDefault(),i.i(s.closest)(t,'[id="'+(this.popupObject&&this.popupObject.element.id+'"]'))||t===this.inputElement||t===this.timeIcon||i.i(s.isNullOrUndefined)(this.inputWrapper)||t===this.inputWrapper.container||t.classList.contains("e-dlg-overlay")?t!==this.inputElement&&(s.Browser.isDevice||(this.isPreventBlur=document.activeElement===this.inputElement&&(s.Browser.isIE||"edge"===s.Browser.info.name)&&t===this.popupObject.element)):this.isTimePopupOpen()&&(this.hide(e),this.focusOut())},t.prototype.isTimePopupOpen=function(){return!(!this.dateTimeWrapper||!this.dateTimeWrapper.classList.contains(""+y))},t.prototype.isDatePopupOpen=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains("e-datetimepopup-wrapper"))},t.prototype.renderPopup=function(){var e=this;this.containerStyle=this.inputWrapper.container.getBoundingClientRect(),s.Browser.isDevice&&(this.timeModal=i.i(s.createElement)("div"),this.timeModal.className=y+" e-time-modal",document.body.className+=" e-time-overflow",this.timeModal.style.display="block",document.body.appendChild(this.timeModal));if(this.popupObject=new a.Popup(this.dateTimeWrapper,{width:this.setPopupWidth(),zIndex:this.zIndex,targetType:"container",collision:s.Browser.isDevice?{X:"fit",Y:"fit"}:{X:"flip",Y:"flip"},relateTo:s.Browser.isDevice?document.body:this.inputWrapper.container,position:s.Browser.isDevice?{X:"center",Y:"center"}:{X:"left",Y:"bottom"},enableRtl:this.enableRtl,offsetY:4,open:function(){e.dateTimeWrapper.style.visibility="visible",i.i(s.addClass)([e.timeIcon],g),s.Browser.isDevice||(e.timekeyConfigure=i.i(s.extend)(e.timekeyConfigure,e.keyConfigs),e.inputEvent=new s.KeyboardEvents(e.inputWrapper.container,{keyAction:e.timeKeyActionHandle.bind(e),keyConfigs:e.timekeyConfigure,eventName:"keydown"}))},close:function(){i.i(s.removeClass)([e.timeIcon],g),e.unWireTimeListEvents(),e.inputElement.removeAttribute("aria-activedescendant"),i.i(s.remove)(e.popupObject.element),e.popupObject.destroy(),e.dateTimeWrapper.innerHTML="",e.listWrapper=e.dateTimeWrapper=void 0,e.inputEvent&&e.inputEvent.destroy()},targetExitViewport:function(){s.Browser.isDevice||e.hide()}}),s.Browser.isDevice&&this.fullScreenMode?(this.popupObject.element.style.display="flex",this.popupObject.element.style.maxHeight="100%",this.popupObject.element.style.width="100%"):this.popupObject.element.style.maxHeight="250px",s.Browser.isDevice&&this.fullScreenMode){var t=i.i(s.createElement)("div",{className:"e-datetime-mob-popup-wrap"}),n=this.createElement("div",{className:"e-model-header"}),r=this.createElement("span",{className:"e-model-title"});r.textContent="Select time";var l=this.createElement("span",{className:"e-popup-close"});s.EventHandler.add(l,"mousedown touchstart",this.dateTimeCloseHandler,this);var o=this.dateTimeWrapper.querySelector(".e-content");n.appendChild(l),n.appendChild(r),t.appendChild(n),t.appendChild(o),this.dateTimeWrapper.insertBefore(t,this.dateTimeWrapper.firstElementChild)}},t.prototype.dateTimeCloseHandler=function(e){this.hide()},t.prototype.setDimension=function(e){return e="number"==typeof e?i.i(s.formatUnit)(e):"string"==typeof e?e:"100%"},t.prototype.setPopupWidth=function(){var e=this.setDimension(this.width);if(e.indexOf("%")>-1){e=(this.containerStyle.width*parseFloat(e)/100).toString()+"px"}return e},t.prototype.wireTimeListEvents=function(){s.EventHandler.add(this.listWrapper,"click",this.onMouseClick,this),s.Browser.isDevice||(s.EventHandler.add(this.listWrapper,"mouseover",this.onMouseOver,this),s.EventHandler.add(this.listWrapper,"mouseout",this.onMouseLeave,this))},t.prototype.unWireTimeListEvents=function(){this.listWrapper&&(s.EventHandler.remove(this.listWrapper,"click",this.onMouseClick),s.EventHandler.remove(document,"mousedown touchstart",this.documentClickHandler),s.Browser.isDevice||(s.EventHandler.add(this.listWrapper,"mouseover",this.onMouseOver,this),s.EventHandler.add(this.listWrapper,"mouseout",this.onMouseLeave,this)))},t.prototype.onMouseOver=function(e){var t=i.i(s.closest)(e.target,"."+b);this.setTimeHover(t,"e-hover")},t.prototype.onMouseLeave=function(){this.removeTimeHover("e-hover")},t.prototype.setTimeHover=function(e,t){this.enabled&&this.isValidLI(e)&&!e.classList.contains(t)&&(this.removeTimeHover(t),i.i(s.addClass)([e],t))},t.prototype.getPopupHeight=function(){var e=parseInt("250px",10),t=this.dateTimeWrapper.getBoundingClientRect().height;return s.Browser.isDevice&&this.fullScreenMode?t:t>e?e:t},t.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))},t.prototype.updateValue=function(e){this.setInputValue("time"),+this.previousDateTime!=+this.value&&(this.changedArgs={value:this.value,event:e||null,isInteracted:!i.i(s.isNullOrUndefined)(e),element:this.element},this.addTimeSelection(),this.trigger("change",this.changedArgs),this.previousDateTime=this.previousDate=this.value)},t.prototype.setTimeScrollPosition=function(){var e=this.selectedElement;i.i(s.isNullOrUndefined)(e)?this.dateTimeWrapper&&this.checkDateValue(this.scrollTo)&&this.setScrollTo():this.findScrollTop(e)},t.prototype.findScrollTop=function(e){var t=this.getPopupHeight(),i=e.nextElementSibling,a=i?i.offsetTop:e.offsetTop,n=e.getBoundingClientRect().height;if(a+e.offsetTop>t)if(s.Browser.isDevice&&this.fullScreenMode){var r=this.dateTimeWrapper.querySelector(".e-content");r.scrollTop=i?a-(t/2+n/2):a}else this.dateTimeWrapper.scrollTop=i?a-(t/2+n/2):a;else this.dateTimeWrapper.scrollTop=0},t.prototype.setScrollTo=function(){var e,t=this.dateTimeWrapper.querySelectorAll("."+b);if(t.length>=0){this.scrollInvoked=!0;var a=this.timeCollections[0],n=this.getDateObject(this.checkDateValue(this.scrollTo)).getTime();e=t[Math.round((n-a)/(6e4*this.step))]}else this.dateTimeWrapper.scrollTop=0;i.i(s.isNullOrUndefined)(e)?this.dateTimeWrapper.scrollTop=0:this.findScrollTop(e)},t.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]));n.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()},t.prototype.getFullDateTime=function(){var e=null;return e=this.isDateObject(this.valueWithMinutes)?this.combineDateTime(this.valueWithMinutes):this.previousDate,this.validateMinMaxRange(e)},t.prototype.createMask=function(){this.notify("createMask",{module:"MaskedDateTime"})},t.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},t.prototype.onMouseClick=function(e){var t=e.target,a=this.selectedElement=i.i(s.closest)(t,"."+b);a&&a.classList.contains(b)&&(this.timeValue=a.getAttribute("data-value"),this.hide(e)),this.setSelection(a,e)},t.prototype.setSelection=function(e,t){if(this.isValidLI(e)&&!e.classList.contains(g)){this.selectedElement=e;var a=Array.prototype.slice.call(this.liCollections).indexOf(e);this.activeIndex=a,this.valueWithMinutes=new Date(this.timeCollections[this.activeIndex]),i.i(s.addClass)([this.selectedElement],g),this.selectedElement.setAttribute("aria-selected","true"),this.updateValue(t)}},t.prototype.setTimeActiveClass=function(){var e=i.i(s.isNullOrUndefined)(this.dateTimeWrapper)?this.listWrapper:this.dateTimeWrapper;if(!i.i(s.isNullOrUndefined)(e)){var t=e.querySelectorAll("."+b);if(t.length)for(var a=0;a<t.length;a++)if(this.timeCollections[a]===+this.valueWithMinutes){t[a].setAttribute("aria-selected","true"),this.selectedElement=t[a],this.activeIndex=a,this.setTimeActiveDescendant();break}}},t.prototype.setTimeActiveDescendant=function(){!i.i(s.isNullOrUndefined)(this.selectedElement)&&this.value?i.i(s.attributes)(this.inputElement,{"aria-activedescendant":this.selectedElement.getAttribute("id")}):this.inputElement.removeAttribute("aria-activedescendant")},t.prototype.addTimeSelection=function(){this.selectedElement=null,this.removeTimeSelection(),this.setTimeActiveClass(),i.i(s.isNullOrUndefined)(this.selectedElement)||(i.i(s.addClass)([this.selectedElement],g),this.selectedElement.setAttribute("aria-selected","true"))},t.prototype.removeTimeSelection=function(){if(this.removeTimeHover("e-hover"),!i.i(s.isNullOrUndefined)(this.dateTimeWrapper)){var e=this.dateTimeWrapper.querySelectorAll("."+g);e.length&&(i.i(s.removeClass)(e,g),e[0].removeAttribute("aria-selected"))}},t.prototype.removeTimeHover=function(e){var t=this.getTimeHoverItem(e);t&&t.length&&i.i(s.removeClass)(t,e)},t.prototype.getTimeHoverItem=function(e){var t,a=i.i(s.isNullOrUndefined)(this.dateTimeWrapper)?this.listWrapper:this.dateTimeWrapper;return i.i(s.isNullOrUndefined)(a)||(t=a.querySelectorAll("."+e)),t},t.prototype.isValidLI=function(e){return e&&e.classList.contains(b)&&!e.classList.contains("e-disabled")},t.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)},t.prototype.startTime=function(e){var t,i,s=this.min,a=null===e?new Date:e;return+a.getDate()==+s.getDate()&&+a.getMonth()==+s.getMonth()&&+a.getFullYear()==+s.getFullYear()||+new Date(a.getFullYear(),a.getMonth(),a.getDate())<=+new Date(s.getFullYear(),s.getMonth(),s.getDate())?(i=!1,t=this.min):+a<+this.max&&+a>+this.min?(i=!0,t=a):+a>=+this.max&&(i=!0,t=this.max),this.calculateStartEnd(t,i,"starttime")},t.prototype.TimePopupFormat=function(){function e(e){switch(e){case"d":case"dd":case"ddd":case"dddd":case"M":case"MM":case"MMM":case"MMMM":case"y":case"yy":case"yyy":case"yyyy":""==t?t+=e:t=t+"/"+e,i+=1}return i>2&&(s.dateFormatString=t),t}var t="",i=0,s=this;return e},t.prototype.endTime=function(e){var t,i,s=this.max,a=null===e?new Date:e;return+a.getDate()==+s.getDate()&&+a.getMonth()==+s.getMonth()&&+a.getFullYear()==+s.getFullYear()||+new Date(a.getUTCFullYear(),a.getMonth(),a.getDate())>=+new Date(s.getFullYear(),s.getMonth(),s.getDate())?(i=!1,t=this.max):+a<+this.max&&+a>+this.min?(i=!0,t=a):+a<=+this.min&&(i=!0,t=this.min),this.calculateStartEnd(t,i,"endtime")},t.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 a=this.preventArgs;i.i(s.isNullOrUndefined)(this.popupObj)?this.trigger("close",a,function(i){t.dateTimeCloseEventCallback(e,i)}):this.dateTimeCloseEventCallback(e,a)}else s.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit()},t.prototype.dateTimeCloseEventCallback=function(t,a){this.preventArgs=a,this.preventArgs.cancel||(this.isDatePopupOpen()?e.prototype.hide.call(this,t):this.isTimePopupOpen()&&(this.closePopup(t),i.i(s.removeClass)([document.body],"e-time-overflow"),s.Browser.isDevice&&this.timeModal&&(this.timeModal.style.display="none",this.timeModal.outerHTML="",this.timeModal=null),this.setTimeActiveDescendant())),s.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit()},t.prototype.closePopup=function(e){if(this.isTimePopupOpen()&&this.popupObject){var t={name:"FadeOut",duration:100,delay:0};this.popupObject.hide(new s.Animation(t)),this.inputWrapper.container.classList.remove("e-icon-anim"),i.i(s.attributes)(this.inputElement,{"aria-expanded":"false"}),this.inputElement.removeAttribute("aria-owns"),this.inputElement.removeAttribute("aria-controls"),s.EventHandler.remove(document,"mousedown touchstart",this.documentClickHandler)}},t.prototype.preRender=function(){this.checkFormat(),this.dateTimeFormat=this.cldrDateTimeFormat(),e.prototype.preRender.call(this),i.i(s.removeClass)([this.inputElementCopy],[y])},t.prototype.getProperty=function(e,t){"min"===t?this.setProperties({min:this.validateValue(e.min)},!0):this.setProperties({max:this.validateValue(e.max)},!0)},t.prototype.checkAttributes=function(e){for(var t,a=e?i.i(s.isNullOrUndefined)(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["style","name","step","disabled","readonly","value","min","max","placeholder","type"],n=0,r=a;n<r.length;n++){var l=r[n];if(!i.i(s.isNullOrUndefined)(this.inputElement.getAttribute(l)))switch(l){case"name":this.inputElement.setAttribute("name",this.inputElement.getAttribute(l));break;case"step":this.step=parseInt(this.inputElement.getAttribute(l),10);break;case"readonly":if(i.i(s.isNullOrUndefined)(this.dateTimeOptions)||void 0===this.dateTimeOptions.readonly||e){var o="disabled"===this.inputElement.getAttribute(l)||""===this.inputElement.getAttribute(l)||"true"===this.inputElement.getAttribute(l);this.setProperties({readonly:o},!e)}break;case"placeholder":(i.i(s.isNullOrUndefined)(this.dateTimeOptions)||void 0===this.dateTimeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(l)},!e);break;case"min":(i.i(s.isNullOrUndefined)(this.dateTimeOptions)||void 0===this.dateTimeOptions.min||e)&&(t=new Date(this.inputElement.getAttribute(l)),this.isNullOrEmpty(t)||isNaN(+t)||this.setProperties({min:t},!e));break;case"disabled":if(i.i(s.isNullOrUndefined)(this.dateTimeOptions)||void 0===this.dateTimeOptions.enabled||e){var h="disabled"!==this.inputElement.getAttribute(l)&&"true"!==this.inputElement.getAttribute(l)&&""!==this.inputElement.getAttribute(l);this.setProperties({enabled:h},!e)}break;case"value":(i.i(s.isNullOrUndefined)(this.dateTimeOptions)||void 0===this.dateTimeOptions.value||e)&&(t=new Date(this.inputElement.getAttribute(l)),this.isNullOrEmpty(t)||isNaN(+t)||this.setProperties({value:t},!e));break;case"max":(i.i(s.isNullOrUndefined)(this.dateTimeOptions)||void 0===this.dateTimeOptions.max||e)&&(t=new Date(this.inputElement.getAttribute(l)),this.isNullOrEmpty(t)||isNaN(+t)||this.setProperties({max:t},!e))}}},t.prototype.requiredModules=function(){var e=[];return"Islamic"===this.calendarMode&&e.push({args:[this],member:"islamic",name:"Islamic"}),this.enableMask&&e.push(this.maskedDateModule()),e},t.prototype.maskedDateModule=function(){return{args:[this],member:"MaskedDateTime"}},t.prototype.getTimeActiveElement=function(){return i.i(s.isNullOrUndefined)(this.dateTimeWrapper)?null:this.dateTimeWrapper.querySelectorAll("."+g)},t.prototype.createDateObj=function(e){return e instanceof Date?e:null},t.prototype.getDateObject=function(e){if(!this.isNullOrEmpty(e)){var t=this.createDateObj(e),a=this.valueWithMinutes,n=!i.i(s.isNullOrUndefined)(a);if(this.checkDateValue(t)){var r=n?a.getDate():u,l=n?a.getMonth():d,o=n?a.getFullYear():p,h=n?a.getHours():c,y=n?a.getMinutes():m,g=n?a.getSeconds():f,b=n?a.getMilliseconds():v;return this.scrollInvoked?(this.scrollInvoked=!1,new Date(o,l,r,t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())):new Date(o,l,r,h,y,g,b)}}return null},t.prototype.findNextTimeElement=function(e){var t=this.inputElement.value,a=i.i(s.isNullOrUndefined)(this.valueWithMinutes)?this.createDateObj(t):this.getDateObject(this.valueWithMinutes),n=null,r=this.liCollections.length;if(!i.i(s.isNullOrUndefined)(this.activeIndex)||!i.i(s.isNullOrUndefined)(this.checkDateValue(a))){if("home"===e.action)n=+this.createDateObj(new Date(this.timeCollections[0])),this.activeIndex=0;else if("end"===e.action)n=+this.createDateObj(new Date(this.timeCollections[this.timeCollections.length-1])),this.activeIndex=this.timeCollections.length-1;else if("down"===e.action){for(var l=0;l<r;l++)if(+a<this.timeCollections[l]){n=+this.createDateObj(new Date(this.timeCollections[l])),this.activeIndex=l;break}}else for(var l=r-1;l>=0;l--)if(+a>this.timeCollections[l]){n=+this.createDateObj(new Date(this.timeCollections[l])),this.activeIndex=l;break}this.selectedElement=this.liCollections[this.activeIndex],this.timeElementValue(i.i(s.isNullOrUndefined)(n)?null:new Date(n))}},t.prototype.setTimeValue=function(e,t){var a,r,l=this.validateMinMaxRange(t),o=this.createDateObj(l);return this.getFormattedValue(o)!==(i.i(s.isNullOrUndefined)(this.value)?null:this.getFormattedValue(this.value))?(this.valueWithMinutes=i.i(s.isNullOrUndefined)(o)?null:o,r=new Date(+this.valueWithMinutes)):(this.strictMode&&(e=o),this.valueWithMinutes=this.checkDateValue(e),r=new Date(+this.valueWithMinutes)),a="Gregorian"===this.calendarMode?this.globalize.formatDate(r,{format:i.i(s.isNullOrUndefined)(this.formatString)?this.cldrDateTimeFormat():this.formatString,type:"dateTime",skeleton:"yMd"}):this.globalize.formatDate(r,{format:i.i(s.isNullOrUndefined)(this.formatString)?this.cldrDateTimeFormat():this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"}),!this.strictMode&&i.i(s.isNullOrUndefined)(r),n.Input.setValue(a,this.inputElement,this.floatLabelType,this.showClearButton),r},t.prototype.timeElementValue=function(e){if(!i.i(s.isNullOrUndefined)(this.checkDateValue(e))&&!this.isNullOrEmpty(e)){var t=e instanceof Date?e:this.getDateObject(e);return this.setTimeValue(t,e)}return null},t.prototype.timeKeyHandler=function(e){if(!(i.i(s.isNullOrUndefined)(this.step)||this.step<=0)){var t=this.timeCollections.length;if(i.i(s.isNullOrUndefined)(this.getTimeActiveElement())||0===this.getTimeActiveElement().length)this.liCollections.length>0&&(i.i(s.isNullOrUndefined)(this.value)&&i.i(s.isNullOrUndefined)(this.activeIndex)?(this.activeIndex=0,this.selectedElement=this.liCollections[0],this.timeElementValue(new Date(this.timeCollections[0]))):this.findNextTimeElement(e));else{var a=void 0;if(e.keyCode>=37&&e.keyCode<=40){var n=40===e.keyCode||39===e.keyCode?++this.activeIndex:--this.activeIndex;this.activeIndex=n=this.activeIndex===t?0:this.activeIndex,this.activeIndex=n=this.activeIndex<0?t-1:this.activeIndex,a=i.i(s.isNullOrUndefined)(this.timeCollections[n])?this.timeCollections[0]:this.timeCollections[n]}else"home"===e.action?(this.activeIndex=0,a=this.timeCollections[0]):"end"===e.action&&(this.activeIndex=t-1,a=this.timeCollections[t-1]);this.selectedElement=this.liCollections[this.activeIndex],this.timeElementValue(new Date(a))}this.isNavigate=!0,this.setTimeHover(this.selectedElement,"e-navigation"),this.setTimeActiveDescendant(),!this.isTimePopupOpen()||null===this.selectedElement||e&&"click"===e.type||this.setTimeScrollPosition()}},t.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),i.i(s.addClass)([this.inputWrapper.container],"e-input-focus"),this.isNavigate=!1,e.stopPropagation();break;case"escape":this.hide(e);break;default:this.isNavigate=!1}},t.prototype.inputKeyAction=function(e){switch(e.action){case"altDownArrow":this.strictModeUpdate(),this.updateInput(),this.toggle(e)}},t.prototype.onPropertyChanged=function(t,a){for(var r=0,l=Object.keys(t);r<l.length;r++){var o=l[r];switch(o){case"value":this.isDynamicValueChanged=!0,this.invalidValueString=null,this.checkInvalidValue(t.value),t.value=this.value,t.value=this.validateValue(t.value),this.enableMask?n.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton):n.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,o),this.updateInput();break;case"enableRtl":n.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]);break;case"cssClass":i.i(s.isNullOrUndefined)(a.cssClass)||(a.cssClass=a.cssClass.replace(/\s+/g," ").trim()),i.i(s.isNullOrUndefined)(t.cssClass)||(t.cssClass=t.cssClass.replace(/\s+/g," ").trim()),n.Input.setCssClass(t.cssClass,[this.inputWrapper.container],a.cssClass),this.dateTimeWrapper&&n.Input.setCssClass(t.cssClass,[this.dateTimeWrapper],a.cssClass);break;case"locale":this.globalize=new s.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.dateTimeOptions&&null==this.dateTimeOptions.placeholder&&(this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),n.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||n.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton));break;case"placeholder":n.Input.setPlaceholder(t.placeholder,this.inputElement);break;case"enabled":n.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),n.Input.calculateWidth(this.inputElement,this.inputWrapper.container),i.i(s.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(s.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":n.Input.setReadonly(this.readonly,this.inputElement);break;case"floatLabelType":this.floatLabelType=t.floatLabelType,n.Input.removeFloating(this.inputWrapper),n.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder),i.i(s.isNullOrUndefined)(this.inputWrapper.buttons[0])||i.i(s.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"}),n.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton)):this.inputElement.value===this.maskedDateValue&&(this.maskedDateValue="",n.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton));break;default:e.prototype.onPropertyChanged.call(this,t,a)}this.isDynamicValueChanged||this.hide(null),this.isDynamicValueChanged=!1}},t.prototype.getModuleName=function(){return"datetimepicker"},t.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=i.i(s.isNullOrUndefined)(this.inputValueCopy)?"":this.getFormattedValue(this.inputValueCopy)},h([i.i(s.Property)(null)],t.prototype,"timeFormat",void 0),h([i.i(s.Property)(30)],t.prototype,"step",void 0),h([i.i(s.Property)(null)],t.prototype,"scrollTo",void 0),h([i.i(s.Property)(1e3)],t.prototype,"zIndex",void 0),h([i.i(s.Property)(null)],t.prototype,"value",void 0),h([i.i(s.Property)(null)],t.prototype,"keyConfigs",void 0),h([i.i(s.Property)({})],t.prototype,"htmlAttributes",void 0),h([i.i(s.Property)(!1)],t.prototype,"enablePersistence",void 0),h([i.i(s.Property)(!0)],t.prototype,"allowEdit",void 0),h([i.i(s.Property)(!1)],t.prototype,"isMultiSelection",void 0),h([i.i(s.Property)(null)],t.prototype,"values",void 0),h([i.i(s.Property)(!0)],t.prototype,"showClearButton",void 0),h([i.i(s.Property)(null)],t.prototype,"placeholder",void 0),h([i.i(s.Property)(!1)],t.prototype,"strictMode",void 0),h([i.i(s.Property)(!1)],t.prototype,"fullScreenMode",void 0),h([i.i(s.Property)(null)],t.prototype,"serverTimezoneOffset",void 0),h([i.i(s.Property)(new Date(1900,0,1))],t.prototype,"min",void 0),h([i.i(s.Property)(new Date(2099,11,31))],t.prototype,"max",void 0),h([i.i(s.Property)(null)],t.prototype,"firstDayOfWeek",void 0),h([i.i(s.Property)("Gregorian")],t.prototype,"calendarMode",void 0),h([i.i(s.Property)("Month")],t.prototype,"start",void 0),h([i.i(s.Property)("Month")],t.prototype,"depth",void 0),h([i.i(s.Property)(!1)],t.prototype,"weekNumber",void 0),h([i.i(s.Property)(!0)],t.prototype,"showTodayButton",void 0),h([i.i(s.Property)("Short")],t.prototype,"dayHeaderFormat",void 0),h([i.i(s.Property)(!1)],t.prototype,"openOnFocus",void 0),h([i.i(s.Property)(!1)],t.prototype,"enableMask",void 0),h([i.i(s.Property)({day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"})],t.prototype,"maskPlaceholder",void 0),h([i.i(s.Event)()],t.prototype,"open",void 0),h([i.i(s.Event)()],t.prototype,"close",void 0),h([i.i(s.Event)()],t.prototype,"cleared",void 0),h([i.i(s.Event)()],t.prototype,"blur",void 0),h([i.i(s.Event)()],t.prototype,"focus",void 0),h([i.i(s.Event)()],t.prototype,"created",void 0),h([i.i(s.Event)()],t.prototype,"destroyed",void 0),t=h([s.NotifyPropertyChanges],t)}(r.a)},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=i(7);i.d(t,"CalendarBase",function(){return s.a}),i.d(t,"Calendar",function(){return s.b}),i.d(t,"Islamic",function(){return s.c});var a=i(8);i.d(t,"DatePicker",function(){return a.a});var n=i(9);i.d(t,"Presets",function(){return n.a}),i.d(t,"DateRangePicker",function(){return n.b});var r=i(12);i.d(t,"TimePickerBase",function(){return r.a}),i.d(t,"TimeMaskPlaceholder",function(){return r.b}),i.d(t,"TimePicker",function(){return r.c});var l=i(10);i.d(t,"DateTimePicker",function(){return l.a});var o=i(11);i.d(t,"MaskedDateTime",function(){return o.a})},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var s=i(0),a=(i.n(s),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|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))},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))},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 s.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(this.dayTypeCount=this.monthTypeCount=this.hourTypeCount=this.minuteTypeCount=this.secondTypeCount=0,"Delete"===e.e.key)return void(this.isDeleteKey=!0);if(!(e.e.altKey||e.e.ctrlKey||"ArrowLeft"!==e.e.key&&"ArrowRight"!==e.e.key&&"shiftTab"!==e.e.key&&"Tab"!==e.e.key&&"shiftTab"!==e.e.action&&"End"!==e.e.key&&"Home"!==e.e.key)){var t=this.parent.inputElement.selectionStart,i=this.parent.inputElement.selectionEnd,s=this.parent.inputElement.value.length;if(0===t&&i===s&&("Tab"===e.e.key||"shiftTab"===e.e.action)){var a="shiftTab"===e.e.action?i:0;this.parent.inputElement.selectionStart=this.parent.inputElement.selectionEnd=a}if("End"===e.e.key||"Home"===e.e.key){var n="End"===e.e.key?s:0;this.parent.inputElement.selectionStart=this.parent.inputElement.selectionEnd=n}this.navigateSelection("ArrowLeft"===e.e.key||"shiftTab"===e.e.action||"End"===e.e.key)}if(!(e.e.altKey||e.e.ctrlKey||"ArrowUp"!==e.e.key&&"ArrowDown"!==e.e.key)){var t=this.parent.inputElement.selectionStart,r="";-1!==this.validCharacters.indexOf(this.hiddenMask[t])&&(r=this.hiddenMask[t]),this.dateAlteration("ArrowDown"===e.e.key);var l=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=l,this.parent.inputElement.value=l;for(var o=0;o<this.hiddenMask.length;o++)if(r===this.hiddenMask[o]){t=o;break}this.parent.inputElement.selectionStart=t,this.validCharacterCheck()}},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(var 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,this.dayTypeCount=this.dayTypeCount+1}else this.isDayPart=!1,this.dayTypeCount=this.isDateZero?this.dayTypeCount+1:this.dayTypeCount;break;case"M":var o=void 0;if(o=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(o)){var h=this.getCulturedValue("months[stand-alone].wide"),u=Object.keys(h);for(this.monthCharacter+=s[e-1].toLowerCase();this.monthCharacter.length>0;){for(var r=1,d=0,p=u;d<p.length;d++){p[d];if(0===h[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(;o>12;)o=parseInt(o.toString().slice(1),10);if(o>=1){if(a.setMonth(o-1),o>=10||1==o?this.isLeadingZero&&1==o?(this.isNavigate=1===o.toString().length,this.isLeadingZero=!1):this.isNavigate=2===o.toString().length:this.isNavigate=1===o.toString().length,a.getMonth()!==o-1&&(a.setDate(1),a.setMonth(o-1)),this.isDayPart){var c=new Date(this.previousDate.getFullYear(),this.previousDate.getMonth()+1,0).getDate(),m=new Date(a.getFullYear(),a.getMonth()+1,0).getDate();this.previousDate.getDate()===c&&m<=c&&a.setDate(m)}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,this.monthTypeCount=this.isMonthZero?this.monthTypeCount+1:this.monthTypeCount}break;case"y":var f=(this.isYearPart&&a.getFullYear().toString().length<4&&!this.isShortYear?10*a.getFullYear():0)+parseInt(s[e-1],10),v=(this.dateformat.match(/y/g)||[]).length;if(v=2!==v?4:v,this.isShortYear=!1,this.isYearZero="0"===s[e-1],isNaN(f))return;for(;f>9999;)f=parseInt(f.toString().slice(1),10);f<1?this.isYearPart=!1:(a.setFullYear(f),f.toString().length===v&&(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=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(var 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=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(var 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=this.minuteTypeCount+1;break;case"s":var g=(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(g))return;for(var r=0;g>59;r++)g=parseInt(g.toString().slice(1),10);a.setSeconds(g),this.isNavigate=2===g.toString().length,this.isSecondsPart=!0,this.secondTypeCount=this.secondTypeCount+1;break;case"a":this.periodCharacter+=s[e-1].toLowerCase();for(var b=this.getCulturedValue("dayPeriods.format.wide"),D=Object.keys(b),r=0;this.periodCharacter.length>0;r++)(0===b[D[0]].toLowerCase().indexOf(this.periodCharacter)&&a.getHours()>=12||0===b[D[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(){function e(e){var i,s,a,n=t.getCulturedValue("days[stand-alone].abbreviated"),r=Object.keys(n),l=t.getCulturedValue("days[stand-alone].wide"),o=Object.keys(l),h=t.getCulturedValue("days[stand-alone].narrow"),u=Object.keys(h),d=t.getCulturedValue("months[stand-alone].abbreviated"),p=t.getCulturedValue("months[stand-alone].wide"),c=t.getCulturedValue("dayPeriods.format.wide");Object.keys(c);switch(e){case"ddd":case"dddd":case"d":i=t.isDayPart?t.maskDateValue.getDate().toString():t.defaultConstant.day.toString(),i=t.zeroCheck(t.isDateZero,t.isDayPart,i),2===t.dayTypeCount&&(t.isNavigate=!0,t.dayTypeCount=0);break;case"dd":i=t.isDayPart?t.roundOff(t.maskDateValue.getDate(),2):t.defaultConstant.day.toString(),i=t.zeroCheck(t.isDateZero,t.isDayPart,i),2===t.dayTypeCount&&(t.isNavigate=!0,t.dayTypeCount=0);break;case"E":case"EE":case"EEE":i=t.isDayPart&&t.isMonthPart&&t.isYearPart?n[r[t.maskDateValue.getDay()]].toString():t.defaultConstant.dayOfTheWeek.toString();break;case"EEEE":i=t.isDayPart&&t.isMonthPart&&t.isYearPart?l[o[t.maskDateValue.getDay()]].toString():t.defaultConstant.dayOfTheWeek.toString();break;case"EEEEE":i=t.isDayPart&&t.isMonthPart&&t.isYearPart?h[u[t.maskDateValue.getDay()]].toString():t.defaultConstant.dayOfTheWeek.toString();break;case"M":i=t.isMonthPart?(t.maskDateValue.getMonth()+1).toString():t.defaultConstant.month.toString(),i=t.zeroCheck(t.isMonthZero,t.isMonthPart,i),2===t.monthTypeCount&&(t.isNavigate=!0,t.monthTypeCount=0);break;case"MM":i=t.isMonthPart?t.roundOff(t.maskDateValue.getMonth()+1,2):t.defaultConstant.month.toString(),i=t.zeroCheck(t.isMonthZero,t.isMonthPart,i),2===t.monthTypeCount&&(t.isNavigate=!0,t.monthTypeCount=0);break;case"MMM":i=t.isMonthPart?d[t.maskDateValue.getMonth()+1]:t.defaultConstant.month.toString();break;case"MMMM":i=t.isMonthPart?p[t.maskDateValue.getMonth()+1]:t.defaultConstant.month.toString();break;case"yy":i=t.isYearPart?t.roundOff(t.maskDateValue.getFullYear()%100,2):t.defaultConstant.year.toString(),i=t.zeroCheck(t.isYearZero,t.isYearPart,i);break;case"y":case"yyy":case"yyyy":i=t.isYearPart?t.roundOff(t.maskDateValue.getFullYear(),4):t.defaultConstant.year.toString(),i=t.zeroCheck(t.isYearZero,t.isYearPart,i);break;case"h":i=t.isHourPart?(t.maskDateValue.getHours()%12||12).toString():t.defaultConstant.hour.toString(),2===t.hourTypeCount&&(t.isNavigate=!0,t.hourTypeCount=0);break;case"hh":i=t.isHourPart?t.roundOff(t.maskDateValue.getHours()%12||12,2):t.defaultConstant.hour.toString(),2===t.hourTypeCount&&(t.isNavigate=!0,t.hourTypeCount=0);break;case"H":i=t.isHourPart?t.maskDateValue.getHours().toString():t.defaultConstant.hour.toString(),2===t.hourTypeCount&&(t.isNavigate=!0,t.hourTypeCount=0);break;case"HH":i=t.isHourPart?t.roundOff(t.maskDateValue.getHours(),2):t.defaultConstant.hour.toString(),2===t.hourTypeCount&&(t.isNavigate=!0,t.hourTypeCount=0);break;case"m":i=t.isMinutePart?t.maskDateValue.getMinutes().toString():t.defaultConstant.minute.toString(),2===t.minuteTypeCount&&(t.isNavigate=!0,t.minuteTypeCount=0);break;case"mm":i=t.isMinutePart?t.roundOff(t.maskDateValue.getMinutes(),2):t.defaultConstant.minute.toString(),2===t.minuteTypeCount&&(t.isNavigate=!0,t.minuteTypeCount=0);break;case"s":i=t.isSecondsPart?t.maskDateValue.getSeconds().toString():t.defaultConstant.second.toString(),2===t.secondTypeCount&&(t.isNavigate=!0,t.secondTypeCount=0);break;case"ss":i=t.isSecondsPart?t.roundOff(t.maskDateValue.getSeconds(),2):t.defaultConstant.second.toString(),2===t.secondTypeCount&&(t.isNavigate=!0,t.secondTypeCount=0);break;case"f":i=Math.floor(t.maskDateValue.getMilliseconds()/100).toString();break;case"ff":s=t.maskDateValue.getMilliseconds(),t.maskDateValue.getMilliseconds()>99&&(s=Math.floor(t.maskDateValue.getMilliseconds()/10)),i=t.roundOff(s,2);break;case"fff":i=t.roundOff(t.maskDateValue.getMilliseconds(),3);break;case"a":case"aa":i=t.maskDateValue.getHours()<12?c.am:c.pm;break;case"z":case"zz":case"zzz":case"zzzz":a={format:e,type:"dateTime",skeleton:"yMd",calendar:t.parent.calendarMode},i=t.parent.globalize.formatDate(t.maskDateValue,a)}if(i=void 0!==i?i:e.slice(1,e.length-1),t.isHiddenMask){for(var m="",f=0;f<i.length;f++)m+=e[0];return m}return i}var t=this;return e},e.prototype.maskInputHandler=function(){var e=this.parent.inputElement.selectionStart,t="";-1!==this.validCharacters.indexOf(this.hiddenMask[e])&&(t=this.hiddenMask[e]),this.differenceCheck();var i=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=i,this.parent.inputElement.value=i,this.parent.inputElement.value=i;for(var s=0;s<this.hiddenMask.length;s++)if(t===this.hiddenMask[s]){e=s;break}if(this.parent.inputElement.selectionStart=e,this.validCharacterCheck(),(this.isNavigate||this.isDeletion)&&!this.isDeleteKey){var a=!this.isNavigate;this.isNavigate=this.isDeletion=!1,this.navigateSelection(a)}this.isDeleteKey&&(this.isDeletion=!1),this.isDeleteKey=!1},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?i.i(s.getValue)(e,i.i(s.getDefaultDateObject)()):i.i(s.getValue)("main."+t+".dates.calendars.gregorian."+e,s.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()},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)},e.prototype.destroy=function(){this.removeEventListener()},e}())},function(e,t){e.exports=a}])});
|
|
10
|
+
!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:()=>x,CalendarBase:()=>T,DatePicker:()=>ee,DateRangePicker:()=>Ge,DateTimePicker:()=>Ut,Islamic:()=>B,MaskedDateTime:()=>jt,Presets:()=>_e,TimeMaskPlaceholder:()=>pt,TimePicker:()=>ct,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-calendar-content-table",c="e-year",m="e-month",f="e-decade",v="e-icons",y="e-disabled",g="e-overlay",b="e-week-number",D="e-selected",E="e-focused-date",C="e-focused-cell",k="e-month-hide",M="e-today",w="e-day",V="e-cell",N="e-zoomin",O="e-calendar-day-header-lg",I=864e5,T=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(1944,2,18)),+this.max==+new Date(2099,11,31)&&(this.max=new Date(2069,10,16))),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<=+this.max?(0,i.removeClass)([this.element],g):(this.setProperties({min:this.min},!0),(0,i.addClass)([this.element],g)),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&&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:w+" e-title"}),(0,i.attributes)(this.headerTitleElement,{"aria-atomic":"true","aria-live":"assertive","aria-label":"title"}),(0,i.attributes)(this.headerTitleElement,e),this.headerElement.appendChild(this.headerTitleElement),this.previousIcon.appendChild(this.createElement("span",{className:"e-date-icon-prev "+v})),this.nextIcon.appendChild(this.createElement("span",{className:"e-date-icon-next "+v})),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:p,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(C):s.classList.add(C)},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(C):s.classList.remove(C)},t.prototype.getCultureValues=function(){var e,t=[],s="days.stand-alone."+this.dayHeaderFormat.toLowerCase();if(e="en"===this.locale||"en-US"===this.locale?(0,i.getValue)(s,(0,i.getDefaultDateObject)()):this.getCultureObjects(i.cldrData,""+this.locale),!(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],""+b):(0,i.addClass)([this.calendarElement],""+b));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",M,"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],y),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(y)||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)&&e.target.classList.length>0&&e.target.classList.contains(p)&&(this.keyboardNavigate(-1,r,e,this.max,this.min),e.preventDefault());break;case"moveRight":"daterangepicker"!==this.getModuleName()&&!(0,i.isNullOrUndefined)(e.target)&&e.target.classList.length>0&&e.target.classList.contains(p)&&(this.keyboardNavigate(1,r,e,this.max,this.min),e.preventDefault());break;case"moveUp":"daterangepicker"!==this.getModuleName()&&!(0,i.isNullOrUndefined)(e.target)&&e.target.classList.length>0&&e.target.classList.contains(p)&&(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)&&e.target.classList.length>0&&e.target.classList.contains(p)&&(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(y))if(e.target!==this.nextIcon||e.target.className.includes(y))if(e.target!==this.todayElement||e.target.className.includes(y)){var h=(0,i.isNullOrUndefined)(n)?a:n;if(!(0,i.isNullOrUndefined)(h)&&!h.classList.contains(y))if(o){var u=new Date(parseInt(""+h.id,0));this.selectDate(e,u,h),"datepicker"!==this.getModuleName()&&"datetimepicker"!==this.getModuleName()||this.element.focus()}else e.target.className.includes(y)||this.contentClick(null,--r,h,t)}else this.todayButtonClick(e,t),"datepicker"!==this.getModuleName()&&"datetimepicker"!==this.getModuleName()||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.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,i){var s,a=this.weekNumber?8:7;s="Gregorian"===this.calendarMode?this.renderDays(this.currentDate,t,null,null,i,e):this.islamicModule.islamicRenderDays(this.currentDate,t),this.createContentHeader(),"Gregorian"===this.calendarMode?this.renderTemplate(s,a,m,e,t):this.islamicModule.islamicRenderTemplate(s,a,m,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:V}),v=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);v.textContent=""+this.getWeek(C),f.appendChild(v),(0,i.addClass)([f],""+b),h.push(f)}o=new Date(+d),d=this.minMaxDate(d);var k={type:"dateTime",skeleton:"full"},w=this.globalize.parseDate(this.globalize.formatDate(d,k),k),N=this.dayCell(d),O=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)([N],y),(0,i.addClass)([N],g)):I.setAttribute("title",""+O),p!==d.getMonth()&&((0,i.addClass)([N],n),I.setAttribute("aria-disabled","true")),0!==d.getDay()&&6!==d.getDay()||(0,i.addClass)([N],"e-weekend"),N.appendChild(I),this.renderDayCellArgs={date:d,isDisabled:!1,element:N,isOutOfRange:T};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&&!N.classList.contains(D)&&((0,i.addClass)([N],y),(0,i.addClass)([N],g),I.setAttribute("aria-disabled","true"),+this.renderDayCellArgs.date==+this.todayDate&&(this.todayDisabled=!0));var U=N.classList.contains(n),H=N.classList.contains(y);H||i.EventHandler.add(N,"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)([N],D);else{for(var L=0;L<a.length;L++){var F={format:null,type:"date",skeleton:"short",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"};if((this.globalize.formatDate(d,F)===this.globalize.formatDate(a[L],F)&&this.getDateVal(d,a[L])||this.getDateVal(d,t))&&(0,i.addClass)([N],D),!(0,i.isNullOrUndefined)(W)&&W.innerText===N.innerText&&this.previousDates&&N.classList.contains(D)&&W.classList.contains(D)){(0,i.removeClass)([N],D),this.previousDates=!1;for(var B=this.copyValues(a),j=0;j<B.length;j++){var R={format:null,type:"date",skeleton:"short",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"};if(this.globalize.formatDate(w,R)===this.globalize.formatDate(B[j],R)){A=B.indexOf(B[j]);B.splice(A,1),a.splice(A,1)}}this.setProperties({values:B},!0)}else this.updateFocus(U,H,d,N,e)}a.length<=0&&this.updateFocus(U,H,d,N,e)}this.updateFocus(U,H,d,N,e),(0,i.isNullOrUndefined)(w)||w.getFullYear()!==u.getFullYear()||w.getMonth()!==u.getMonth()||w.getDate()!==u.getDate()||(0,i.addClass)([N],M),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],E),n<=this.min&&parseInt(a.id,0)===+this.min&&!e&&!t&&(0,i.addClass)([a],E)):(0,i.addClass)([a],E)},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(),p=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 v=this.dayCell(o),g=this.createElement("span"),b=t&&t.getMonth()===o.getMonth(),C=t&&t.getFullYear()===l&&b,k=this.globalize.formatDate(o,{type:"date",format:"MMM y"});g.textContent=this.toCapitalize(this.globalize.formatDate(o,{format:null,type:"dateTime",skeleton:"MMM"})),this.min&&(h<u||f<d&&h===u)||this.max&&(h>p||f>m&&h>=p)?(0,i.addClass)([v],y):!a&&C?(0,i.addClass)([v],D):o.getMonth()===r&&this.currentDate.getMonth()===r&&(0,i.addClass)([v],E),o.setDate(1),o.setMonth(o.getMonth()+1),v.classList.contains(y)||(i.EventHandler.add(v,"click",this.clickHandler,this),g.setAttribute("title",""+k)),v.appendChild(g),s.push(v)}this.renderTemplate(s,4,c,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 v=this.dayCell(a),g=this.createElement("span");g.textContent=this.globalize.formatDate(a,{format:null,type:"dateTime",skeleton:"y"}),f<h||f>u?((0,i.addClass)([v],r),g.setAttribute("aria-disabled","true"),(0,i.isNullOrUndefined)(t)||a.getFullYear()!==t.getFullYear()||(0,i.addClass)([v],D),(f<new Date(this.checkValue(this.min)).getFullYear()||f>new Date(this.checkValue(this.max)).getFullYear())&&(0,i.addClass)([v],y)):f<new Date(this.checkValue(this.min)).getFullYear()||f>new Date(this.checkValue(this.max)).getFullYear()?(0,i.addClass)([v],y):(0,i.isNullOrUndefined)(t)||a.getFullYear()!==t.getFullYear()?a.getFullYear()!==this.currentDate.getFullYear()||v.classList.contains(y)||(0,i.addClass)([v],E):(0,i.addClass)([v],D),v.classList.contains(y)||(i.EventHandler.add(v,"click",this.clickHandler,this),g.setAttribute("title",""+g.textContent)),v.appendChild(g),s.push(v)}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:V,attrs:{id:""+(0,i.getUniqueID)(""+t),"aria-selected":"false"}};return this.createElement("td",n)},t.prototype.firstDay=function(e){var t="Decade"!==this.currentView()?this.tableBodyElement.querySelectorAll("td:not(."+n):this.tableBodyElement.querySelectorAll("td:not(."+r);if(t.length)for(var i=0;i<t.length;i++)if(!t[i].classList.contains(y)){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);if(t.length)for(var i=t.length-1;i>=0;i--)if(!t[i].classList.contains(y)){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],[m,f,c]),(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]],[w]),(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],k),!this.weekNumber&&6===u&&e[6].classList.contains(n)&&(0,i.addClass)([l],k),this.weekNumber?41===u&&e[41].classList.contains(n)&&(0,i.addClass)([l],k):35===u&&e[35].classList.contains(n)&&(0,i.addClass)([l],k);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=N,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=N,(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=N,(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],y),(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;l="Gregorian"===this.calendarMode?this.globalize.formatDate(n,{type:"date",skeleton:"yMd"}):this.globalize.formatDate(n,{type:"dateTime",skeleton:"full",calendar:"islamic"});var o={type:"date",skeleton:"yMd",calendar:r},h=this.globalize.formatDate(this.min,o),u={type:"date",skeleton:"yMd",calendar:r},d=this.globalize.formatDate(this.max,u);(+new Date(l)<+new Date(h)||+new Date(l)>+new Date(d))&&(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=N,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(c)?"Year":!(0,i.isNullOrUndefined)(this.contentElement)&&this.contentElement.classList.contains(f)?"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=".dates.calendars.gregorian.days.format."+this.dayHeaderFormat.toLowerCase(),a=".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+I)/I/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("."+D))||(0,i.removeClass)([o.querySelector("."+D)],D),a||(0,i.isNullOrUndefined)(o.querySelector("."+E))||(0,i.removeClass)([o.querySelector("."+E)],E),a||(0,i.isNullOrUndefined)(o.querySelector("."+C))||(0,i.removeClass)([o.querySelector("."+C)],C),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."+E)[0],c=o.querySelectorAll("td."+D)[0];u[d]===p&&(0,i.removeClass)([u[d]],E),u[d]!==c||this.checkPresentDate(new Date(parseInt(c.getAttribute("id").split("_")[0],10)),n)||(0,i.removeClass)([u[d]],D)}if(r.classList.contains(D)){(0,i.removeClass)([r],D);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],E)}}this.setProperties({values:l},!0)}else(0,i.addClass)([r],D)}else(0,i.addClass)([r],D);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],""+y),(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],""+y),(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],y),(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],y),(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(1944,1,18)).month&&t.year>=this.islamicModule.getIslamicDate(new Date(1944,1,18)).year&&t.month<=this.islamicModule.getIslamicDate(new Date(2069,1,16)).month&&t.year<=this.islamicModule.getIslamicDate(new Date(2069,1,16)).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(y)}))}else r=this.tableBodyElement.querySelectorAll("td."+y);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),x=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],y):(0,i.addClass)([this.element],y)},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("."+E)[0])&&"Year"===r&&this.tableBodyElement.querySelectorAll("."+E)[0].classList.remove(E)},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)}(T),S="e-other-month",P="e-year",A="e-disabled",U="e-overlay",H="e-selected",W="e-focused-date",L="e-month-hide",F="e-cell",B=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),y=this.calendarInstance.globalize.formatDate(l,{type:"date",skeleton:"full",calendar:"islamic"}),g=this.calendarInstance.createElement("span");g.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],A),(0,i.addClass)([v],U)):g.setAttribute("title",""+y),u!==this.getIslamicDate(l).month&&(0,i.addClass)([v],S),0!==l.getDay()&&6!==l.getDay()||(0,i.addClass)([v],"e-weekend"),v.appendChild(g),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(H)&&((0,i.addClass)([v],A),(0,i.addClass)([v],U),+this.calendarInstance.renderDayCellArgs.date==+this.calendarInstance.todayDate&&(this.calendarInstance.todayDisabled=!0));var C=v.classList.contains(S),k=v.classList.contains(A);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],H);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],H):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),y=this.calendarInstance.createElement("span"),g=t&&this.getIslamicDate(t).month===this.getIslamicDate(n).month,b=t&&this.getIslamicDate(t).year===o&&g;y.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],A):!a&&b?(0,i.addClass)([v],H):this.getIslamicDate(n).month===l&&this.getIslamicDate(this.calendarInstance.currentDate).month===l&&(0,i.addClass)([v],W),v.classList.contains(A)||i.EventHandler.add(v,"click",this.calendarInstance.clickHandler,this.calendarInstance),v.appendChild(y),s.push(v)}this.islamicRenderTemplate(s,4,P,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"});"ar"===this.calendarInstance.locale&&(d=Number(d.replace(/[٠١٢٣٤٥٦٧٨٩]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)-1632+48)}))),p=Number(p.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 y=(parseInt(d,10)-2).toString();h=Math.round(.97*parseInt(d,10)+622),u=Math.round(.97*parseInt(p,10)+622);for(var g=Math.round(.97*parseInt(y,10)+622),b=1;b<=12;++b){var D=g+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],S):D<new Date(this.islamicInValue(this.calendarInstance.min)).getFullYear()||D>new Date(this.islamicInValue(this.calendarInstance.max)).getFullYear()?(0,i.addClass)([E],A):(0,i.isNullOrUndefined)(t)||this.getIslamicDate(a).year!==this.getIslamicDate(t).year?a.getFullYear()!==this.calendarInstance.currentDate.getFullYear()||E.classList.contains(A)||(0,i.addClass)([E],W):(0,i.addClass)([E],H),E.classList.contains(A)||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],W),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",P]),(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(S)&&(0,i.addClass)([r],L),!this.calendarInstance.weekNumber&&6===h&&e[6].classList.contains(S)&&(0,i.addClass)([r],L),this.calendarInstance.weekNumber?41===h&&e[41].classList.contains(S)&&(0,i.addClass)([r],L):35===h&&e[35].classList.contains(S)&&(0,i.addClass)([r],L);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()>=2060&&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}(),j=l(197),R=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)}}(),z=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},q="e-datepicker",K="e-popup-wrapper",_="e-input-focus",G="e-error",Z="e-active",X="e-date-overflow",J="e-selected",$="e-non-edit",Q=["title","class","style"],ee=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&&R.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(),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()}},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],[$]):""===this.inputElement.value?(0,i.removeClass)([this.inputWrapper.container],[$]):(0,i.addClass)([this.inputWrapper.container],[$])},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(){var e={"aria-atomic":"true","aria-expanded":"false",role:"combobox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-invalid":"false","aria-label":this.getModuleName()};if("datepicker"===this.getModuleName()){var t={placeholder:this.placeholder};this.globalize=new i.Internationalization(this.locale),this.l10n=new i.L10n("datepicker",t,this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0)}this.fullScreenMode&&i.Browser.isDevice&&(this.cssClass+=" e-popup-expand");var s=this.cssClass;(0,i.isNullOrUndefined)(this.cssClass)||""===this.cssClass||(s=this.cssClass.replace(/\s+/g," ").trim());var a=!this.enableMask;this.inputWrapper=R.Input.createInput({element:this.inputElement,floatLabelType:this.floatLabelType,bindClearAction:a,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:s,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,e),this.enabled?(this.inputElement.setAttribute("aria-disabled","false"),this.inputElement.setAttribute("tabindex",this.tabIndex)):(this.inputElement.setAttribute("aria-disabled","true"),this.inputElement.tabIndex=-1),R.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(e,s)),(0,i.isNullOrUndefined)(t)&&"datetimepicker"===this.getModuleName()&&(t=this.checkDateValue(this.globalize.parseDate(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"Delete":!this.enableMask||this.popupObj||this.readonly||("Delete"!==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("");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){R.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],[_]),(0,i.addClass)(this.inputWrapper.buttons,Z))),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])&&Q.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];Q.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()),R.Input.setCssClass(e,[this.inputWrapper.container],t),this.popupWrapper&&R.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.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));var e={model:this};this.isDateIconClicked=!1,this.trigger("focus",e),this.updateIconState(),this.openOnFocus&&!this.isIconClicked&&this.show()}},t.prototype.inputHandler=function(){this.isPopupClicked=!1,this.enableMask&&this.notify("inputHandler",{module:"MaskedDateTime"})},t.prototype.inputBlurHandler=function(e){if(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")||s.classList.contains("e-dlg-overlay")?(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),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":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 i=this.inputElement.selectionStart,s=this.inputElement.selectionEnd;if(this.enableMask&&!this.popupObj&&!this.readonly){var a=this.inputElement.value.length;(0===i&&s===a||s!==a&&"tab"===e.action||0!==i&&"shiftTab"===e.action)&&e.preventDefault(),this.notify("keyDownHandler",{module:"MaskedDateTime",e}),i=this.inputElement.selectionStart,s=this.inputElement.selectionEnd}this.strictModeUpdate(),this.updateInput(),this.popupUpdate(),this.changeTrigger(e),this.errorClass(),this.enableMask&&(this.inputElement.selectionStart=i,this.inputElement.selectionEnd=s),"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("."+J).length>0&&(0,i.removeClass)(this.popupObj.element.querySelectorAll("."+J),[J]),!(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(){var e,t,s,a;("datetimepicker"===this.getModuleName()?e=(0,i.isNullOrUndefined)(this.formatString)?this.dateTimeFormat:this.formatString:/^y/.test(this.formatString)&&!/[^a-zA-Z]/.test(this.formatString)||(e=(0,i.isNullOrUndefined)(this.formatString)?this.formatString:this.formatString.replace("dd","d")),(0,i.isNullOrUndefined)(e))?e=this.formatString:e.split("M").length-1<3&&(e=e.replace("MM","M"));if(s="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"}:t="Gregorian"===this.calendarMode?{format:e,type:"dateTime",skeleton:"yMd"}:{format:e,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.inputElement.value,s))){var n=this.inputElement.value.replace(/(am|pm|Am|aM|pM|Pm)/g,(function(e){return e.toLocaleUpperCase()}));a=this.globalize.parseDate(n,s)}else t="Gregorian"===this.calendarMode?{format:e,type:"dateTime",skeleton:"yMd"}:{format:e,type:"dateTime",skeleton:"yMd",calendar:"islamic"},a=this.globalize.parseDate(this.inputElement.value,t);else a=this.globalize.parseDate(this.inputElement.value,s),a=!(0,i.isNullOrUndefined)(a)&&isNaN(+a)?null:a,!(0,i.isNullOrUndefined)(this.formatString)&&""!==this.inputElement.value&&this.strictMode&&(this.isPopupClicked||!this.isPopupClicked&&this.inputElement.value===this.previousElementValue)&&-1===this.formatString.indexOf("y")&&a.setFullYear(this.value.getFullYear());"datepicker"===this.getModuleName()&&this.value&&!isNaN(+this.value)&&a&&a.setHours(this.value.getHours(),this.value.getMinutes(),this.value.getSeconds(),this.value.getMilliseconds()),this.strictMode&&a?(this.updateInputValue(this.globalize.formatDate(a,s)),this.inputElement.value!==this.previousElementValue&&this.setProperties({value:a},!0)):this.strictMode||this.inputElement.value!==this.previousElementValue&&this.setProperties({value:a},!0),this.strictMode&&!a&&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:q+" "+K,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=q+" e-date-modal",document.body.className+=" "+X,this.modal.style.display="block",document.body.appendChild(this.modal)),this.calendarElement.querySelector("table tbody").className="",this.popupObj=new j.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}))},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.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.calendarElement.querySelector("button.e-today");a.classList.add("e-day-wrapper"),o.classList.add("e-outline"),t.appendChild(l),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(){this.trigger("navigated",this.navigatedArgs)},t.prototype.keyupHandler=function(e){this.isKeyAction=this.inputElement.value!==this.previousElementValue},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.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(""+K))},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%"},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;if(this.trigger("open",l,(function(t){if(a.preventArgs=t,n&&!a.preventArgs.cancel){(0,i.addClass)(a.inputWrapper.buttons,Z),a.preventArgs.appendTo.appendChild(a.popupWrapper),a.popupObj.refreshPosition(a.inputElement);var s={name:"FadeIn",duration:i.Browser.isDevice?0:300};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()}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"),J)),i.EventHandler.add(document,"mousedown touchstart",a.documentHandler,a)})),i.Browser.isDevice){var o=this.createElement("div",{className:"e-dlg-overlay"});o.style.zIndex=(this.zIndex-1).toString(),this.mobilePopupWrapper.appendChild(o)}}},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,Z),(0,i.removeClass)([document.body],X);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){this.preventArgs=t,this.isCalendar()&&e&&!this.preventArgs.cancel&&(this.popupObj.hide(),this.isAltKeyPressed=!1,this.keyboardModule.destroy(),(0,i.removeClass)(this.inputWrapper.buttons,Z)),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"),this.setAllowEdit()},t.prototype.focusIn=function(e){document.activeElement!==this.inputElement&&this.enabled&&(this.inputElement.focus(),(0,i.addClass)([this.inputWrapper.container],[_]))},t.prototype.focusOut=function(){document.activeElement===this.inputElement&&((0,i.removeClass)([this.inputWrapper.container],[_]),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),R.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);var t={"aria-atomic":"true","aria-disabled":"true","aria-expanded":"false",role:"combobox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-label":this.getModuleName()};this.inputElement&&(R.Input.removeAttributes(t,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],[q]),(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],[q,"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.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.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(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(u),{}),!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(d),{}),!e)}break;case"type":"text"!==this.inputElement.getAttribute(r)&&this.inputElement.setAttribute("type","text")}}},t.prototype.getModuleName=function(){return"datepicker"},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()?(R.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()})):(R.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?((0,i.addClass)([this.inputWrapper.container],G),(0,i.attributes)(this.inputElement,{"aria-invalid":"true"})):(0,i.isNullOrUndefined)(this.inputWrapper)||((0,i.removeClass)([this.inputWrapper.container],G),(0,i.attributes)(this.inputElement,{"aria-invalid":"false"}))},t.prototype.onPropertyChanged=function(t,s){for(var a=0,n=Object.keys(t);a<n.length;a++){switch(n[a]){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"allowEdit":this.setAllowEdit();break;case"placeholder":R.Input.setPlaceholder(this.placeholder,this.inputElement);break;case"readonly":R.Input.setReadonly(this.readonly,this.inputElement);break;case"enabled":R.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),R.Input.setPlaceholder(this.placeholder,this.inputElement)),this.updateInput(),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"});break;case"enableRtl":R.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":R.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),R.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,R.Input.removeFloating(this.inputWrapper),R.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;default:this.calendarElement&&this.isCalendar()&&e.prototype.onPropertyChanged.call(this,t,s)}this.isDynamicValueChanged||this.hide(null),this.isDynamicValueChanged=!1}},z([(0,i.Property)(null)],t.prototype,"width",void 0),z([(0,i.Property)(null)],t.prototype,"value",void 0),z([(0,i.Property)(null)],t.prototype,"cssClass",void 0),z([(0,i.Property)(!1)],t.prototype,"strictMode",void 0),z([(0,i.Property)(null)],t.prototype,"format",void 0),z([(0,i.Property)(!0)],t.prototype,"enabled",void 0),z([(0,i.Property)(!1)],t.prototype,"fullScreenMode",void 0),z([(0,i.Property)({})],t.prototype,"htmlAttributes",void 0),z([(0,i.Property)(null)],t.prototype,"values",void 0),z([(0,i.Property)(!1)],t.prototype,"isMultiSelection",void 0),z([(0,i.Property)(!0)],t.prototype,"showClearButton",void 0),z([(0,i.Property)(!0)],t.prototype,"allowEdit",void 0),z([(0,i.Property)(null)],t.prototype,"keyConfigs",void 0),z([(0,i.Property)(!1)],t.prototype,"enablePersistence",void 0),z([(0,i.Property)(1e3)],t.prototype,"zIndex",void 0),z([(0,i.Property)(!1)],t.prototype,"readonly",void 0),z([(0,i.Property)(null)],t.prototype,"placeholder",void 0),z([(0,i.Property)("Never")],t.prototype,"floatLabelType",void 0),z([(0,i.Property)(null)],t.prototype,"serverTimezoneOffset",void 0),z([(0,i.Property)(!1)],t.prototype,"openOnFocus",void 0),z([(0,i.Property)(!1)],t.prototype,"enableMask",void 0),z([(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),z([(0,i.Event)()],t.prototype,"open",void 0),z([(0,i.Event)()],t.prototype,"cleared",void 0),z([(0,i.Event)()],t.prototype,"close",void 0),z([(0,i.Event)()],t.prototype,"blur",void 0),z([(0,i.Event)()],t.prototype,"focus",void 0),z([(0,i.Event)()],t.prototype,"created",void 0),z([(0,i.Event)()],t.prototype,"destroyed",void 0),t=z([i.NotifyPropertyChanges],t)}(x),te=l(741),ie=l(90),se=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)}}(),ae=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},ne="e-input-group",re="e-popup",le="e-left-calendar",oe="e-right-calendar",he="e-daterangepicker",ue="e-error",de="e-active",pe="e-start-date",ce="e-end-date",me="e-start-btn",fe="e-input-focus",ve="e-range-hover",ye="e-other-month",ge="e-start-label",be="e-end-label",De="e-disabled",Ee="e-selected",Ce="e-calendar",ke="e-next",Me="e-prev",we="e-header",Ve="e-title",Ne="e-icon-container",Oe="e-date-range-container",Ie="e-presets",Te="e-today",xe="e-focused-date",Se="e-content",Pe="e-day-span",Ae="e-week-number",Ue="e-date-disabled",He="e-icon-disabled",We="e-device",Le="e-overlay",Fe="e-list-item",Be="e-hover",je="e-range-overflow",Re="e-flat",Ye="e-css",ze="e-non-edit",qe="e-daterange-hidden",Ke=["title","class","style"],_e=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return se(t,e),ae([(0,i.Property)()],t.prototype,"label",void 0),ae([(0,i.Property)()],t.prototype,"start",void 0),ae([(0,i.Property)()],t.prototype,"end",void 0),t}(i.ChildProperty),Ge=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 se(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&&R.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],[he,"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.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.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],[ze]):""===this.inputElement.value?(0,i.removeClass)([this.inputWrapper.container],[ze]):(0,i.addClass)([this.inputWrapper.container],[ze])},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(Ke.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];Ke.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()),R.Input.setCssClass(e,[this.inputWrapper.container],t),this.popupWrapper&&R.Input.setCssClass(e,[this.popupWrapper],t)},t.prototype.processPresets=function(){this.presetsItem=[];var e=0;if(!(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.startDate,e)),"string"==typeof this.endDate&&(this.endDate=this.globalize.parseDate(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&&(R.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),R.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],[fe])))},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.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.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.inputElement.getAttribute(r),s);this.startValue=u,this.setValue()}break;case"endDate":if((0,i.isNullOrUndefined)(this.endDate)){u=this.globalize.parseDate(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:he+" "+re}),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(De)&&i.EventHandler.add(this.leftCalPrevIcon,"mousedown",this.navPrevFunction),this.leftCalNextIcon&&!this.leftCalNextIcon.classList.contains(De)&&i.EventHandler.add(this.leftCalNextIcon,"mousedown",this.navNextFunction),this.rightCalPrevIcon&&!this.rightCalPrevIcon.classList.contains(De)&&i.EventHandler.add(this.rightCalPrevIcon,"mousedown",this.navPrevFunction),this.rightCalNextIcon&&!this.rightCalNextIcon.classList.contains(De)&&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("."+oe+" ."+we+" ."+Ve),this.headerTitleElement=this.popupObj.element.querySelector("."+le+" ."+we+" ."+Ve),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(De)&&i.EventHandler.add(this.nextIcon,"mousedown",this.deviceNavNextFunction),this.previousIcon&&!this.previousIcon.classList.contains(De)&&i.EventHandler.add(this.previousIcon,"mousedown",this.deviceNavPrevFunction)},t.prototype.deviceNavNext=function(e){var t=(0,i.closest)(e.target,"."+Ce);this.updateDeviceCalendar(t),this.navigateNext(e),this.deviceNavigation()},t.prototype.deviceNavPrevious=function(e){var t=(0,i.closest)(e.target,"."+Ce);this.updateDeviceCalendar(t),this.navigatePrevious(e),this.deviceNavigation()},t.prototype.updateDeviceCalendar=function(e){e&&(this.previousIcon=e.querySelector("."+Me),this.nextIcon=e.querySelector("."+ke),this.calendarElement=e,this.deviceCalendar=e,this.contentElement=e.querySelector("."+Se),this.tableBodyElement=(0,i.select)("."+Se+" tbody",e),this.table=e.querySelector("."+Se).getElementsByTagName("table")[0],this.headerTitleElement=e.querySelector("."+we+" ."+Ve),this.headerElement=e.querySelector("."+we))},t.prototype.deviceHeaderClick=function(e){if(e.currentTarget.classList.contains(me)&&!(0,i.isNullOrUndefined)(this.startValue)){this.endButton.element.classList.remove(de),this.startButton.element.classList.add(de);var t=this.popupObj.element.querySelector("."+Ce);this.updateDeviceCalendar(t),(0,i.isNullOrUndefined)(this.calendarElement.querySelector("."+pe+":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(de),this.endButton.element.classList.add(de);t=this.popupObj.element.querySelector("."+Ce);this.updateDeviceCalendar(t),(0,i.isNullOrUndefined)(this.calendarElement.querySelector("."+ce+":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("."+Ce)),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.openOnFocus&&!this.preventFocus?(this.preventFocus=!0,this.show()):this.preventFocus=!0}},t.prototype.inputBlurHandler=function(e){if(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(s[0],a),r=this.globalize.parseDate(s[1],a),l=this.getStartEndDate(n,!1,s,a),o=this.getStartEndDate(r,!0,s,a);if(!((0,i.isNullOrUndefined)(l)||isNaN(+l)||(0,i.isNullOrUndefined)(o)||isNaN(+o))){var h=this.startValue;this.startValue=l;var u=this.endValue;if(this.endValue=o,this.setValue(),this.refreshControl(),t!==this.previousEleValue&&this.changeTrigger(e),!this.preventBlur&&document.activeElement!==this.inputElement){this.preventFocus=!1;var d={model:this};this.trigger("blur",d)}return this.updateHiddenInput(),void(this.isMobile&&this.isPopupOpen()&&(this.startValue=h,this.endValue=u))}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),R.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;d={model:this};this.trigger("blur",d)}}this.updateHiddenInput()}},t.prototype.getStartEndDate=function(e,t,i,s){return"Month"===this.depth?this.globalize.parseDate(i[t?1:0].trim(),s):"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.clearRange=function(){this.previousStartValue=this.previousEndValue=null,this.currentDate=null},t.prototype.errorClass=function(){var e=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],ue),(0,i.attributes)(this.inputElement,{"aria-invalid":"true"})):this.inputWrapper&&((0,i.removeClass)([this.inputWrapper.container],ue),(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,le)&&(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,oe)&&(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,"."+oe),h=(o=(0,i.isNullOrUndefined)(o)?this.leftCalendar:o).classList.contains(le);this.updateCalendarElement(o);var u=this.tableBodyElement.querySelector("tr td.e-selected"),d=o.querySelector("tr td."+xe),p=o.querySelector("tr td."+pe),c=o.querySelector("tr td."+ce),m=this.getViewNumber(this.depth),f=n===m&&this.getViewNumber(this.start)>=m,v=(0,i.closest)(t.target,"."+le),y=(0,i.closest)(t.target,"."+oe),g=(0,i.closest)(t.target,"."+Ie);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],[fe]));break;case"select":if(f){var b=(0,i.isNullOrUndefined)(d)?p:d;(0,i.isNullOrUndefined)(b)||b.classList.contains(De)||this.selectRange(null,b)}else((0,i.isNullOrUndefined)(u)||f)&&(0,i.isNullOrUndefined)(d)||((0,i.isNullOrUndefined)(this.value)||(s=this.calendarElement.classList.contains(le)?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)(y)?(0,i.isNullOrUndefined)(g)||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)(y)||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(le),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(le)?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,oe)&&(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,le)&&(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(le)?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("."+Ce+" td"):this.popupObj.element.querySelectorAll("."+Ce+" td");t<s.length;t++){var a=s[t];i.EventHandler.clearEvents(a),a.classList.contains(De)||a.classList.contains(Ue)||a.classList.contains(Ae)||(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("."+Ce+" ."+xe);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(Te)||a.classList.contains(Te)&&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(xe),a.classList.contains(pe)||a.classList.contains(ce)||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("."+Ce+" td");n<r.length;n++){var l=r[n],o=!l.classList.contains(De)||l.classList.contains(Ue);if(!l.classList.contains(Ae)&&o){var h=this.getIdValue(null,l),u=new Date(+this.startValue);new Date(+h).setHours(0,0,0,0)>=u.setHours(0,0,0,0)&&+h<=+a?(0,i.addClass)([l],ve):(0,i.removeClass)([l],[ve])}}},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("."+Ce+" td");a<n.length;a++){var r=n[a];if(!r.classList.contains(Ae)&&!r.classList.contains(De)){var l=this.getIdValue(null,r),o=this.getIdValue(null,r);if((0,i.isNullOrUndefined)(this.endValue)?(0,i.removeClass)([r],[ve]):this.currentView()===this.depth&&+o.setHours(0,0,0,0)>=+new Date(+this.startValue).setHours(0,0,0,0)&&+o.setHours(0,0,0,0)<=+new Date(+this.endValue).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],ve),r.classList.contains(Ee)&&r.classList.contains(ce)&&+o!=+this.endValue&&((0,i.removeClass)([r],[Ee]),(0,i.removeClass)([r],[ce])),r.classList.contains(ve)&&+o>+this.endValue&&(0,i.removeClass)([r],[ve]),!r.classList.contains(ye)){var h=new Date(+this.startValue),u=new Date(+l);this.currentView()===this.depth&&+u.setHours(0,0,0,0)==+h.setHours(0,0,0,0)&&+u.setHours(0,0,0,0)>=+h.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,Ee]),this.addSelectedAttributes(r,this.startValue,!0));var d=new Date(+this.endValue);"Year"===this.currentView()?u=new Date(u.getFullYear(),u.getMonth()+1,0):"Decade"===this.currentView()&&(u=new Date(u.getFullYear(),11,31)),this.currentView()===this.depth&&!(0,i.isNullOrUndefined)(this.endValue)&&+u.setHours(0,0,0,0)==+d.setHours(0,0,0,0)&&+u.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],[ce,Ee]),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("."+Ce)):(this.updateMinMaxDays(this.popupObj.element.querySelector("."+le)),this.updateMinMaxDays(this.popupObj.element.querySelector("."+oe))))},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],[pe,Ee]),this.addSelectedAttributes(r,this.startValue,!0)):((0,i.addClass)([r],[ce,Ee]),this.addSelectedAttributes(r,this.endValue,!0)),s&&this.addSelectedAttributes(e,this.endValue,!1,!0))},t.prototype.selectRange=function(e,t){var s,a;e&&e.preventDefault();var n=(0,i.isNullOrUndefined)(e)?this.getIdValue(null,t):this.getIdValue(e,null),r=n.getFullYear(),l=n.getMonth(),o=new Date(r,l,1),h=new Date(r,l+1,0),u=new Date(r,0,1),d=new Date(r,11,31);(0,i.isNullOrUndefined)(this.endValue)||(0,i.isNullOrUndefined)(this.startValue)?this.isMobile&&this.startButton.element.classList.contains(de)&&this.removeSelection():(!this.isMobile||this.isMobile&&!this.endButton.element.classList.contains(de))&&this.removeSelection();var p=t||e.currentTarget;if((0,i.isNullOrUndefined)(this.startValue))(0,i.isNullOrUndefined)(this.previousStartValue)||(n.setHours(this.previousStartValue.getHours()),n.setMinutes(this.previousStartValue.getMinutes()),n.setSeconds(this.previousStartValue.getSeconds())),this.startValue="Month"===this.depth?new Date(this.checkValue(n)):"Year"===this.depth?o:u,this.endValue=null,this.setValue(),(0,i.addClass)([p],pe),this.addSelectedAttributes(p,this.startValue,!0),p.classList.contains(ye)&&this.otherMonthSelect(p,!0),this.checkMinMaxDays(),this.applyButton.disabled=!0,this.applyButton.element.disabled=!0,this.isMobile&&(this.endButton.element.classList.add(de),this.startButton.element.classList.remove(de),this.endButton.element.removeAttribute("disabled"),this.selectableDates()),this.trigger("select",this.rangeArgs(e));else if(+n==+this.startValue||+n>+this.startValue){if(+n==+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)||(n.setHours(this.previousEndValue.getHours()),n.setMinutes(this.previousEndValue.getMinutes()),n.setSeconds(this.previousEndValue.getSeconds())),this.endValue="Month"===this.depth?new Date(this.checkValue(n)):"Year"===this.depth?h:d,this.setValue();var c=this.popupObj.element.querySelectorAll("."+ce);if(this.isMobile){this.startButton.element.classList.remove(de),this.endButton.element.classList.add(de);for(var m=0,f=c;m<f.length;m++){var v=f[m];v.removeAttribute("aria-label"),v.classList.contains(pe)?(this.addSelectedAttributes(v,this.startValue,!0),(0,i.removeClass)([v],[ce])):(v.setAttribute("aria-selected","false"),(0,i.removeClass)([v],[ce,Ee]))}}(0,i.addClass)([p],ce),+this.endValue==+this.startValue?this.addSelectedAttributes(p,this.endValue,!1,!0):this.addSelectedAttributes(p,this.endValue,!1),p.classList.contains(ye)&&(+this.endValue==+this.startValue?this.otherMonthSelect(p,!1,!0):this.otherMonthSelect(p,!1));for(var y=0,g=c=this.popupObj.element.querySelectorAll("."+ce);y<g.length;y++){var b=g[y];b.classList.contains(pe)&&(0,i.removeClass)([b],[ve])}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+n<+this.startValue&&(this.removeClassDisabled(),this.startValue="Month"===this.depth?new Date(this.checkValue(n)):"Year"===this.depth?o:u,this.setValue(),this.removeSelectedAttributes(),(0,i.removeClass)(this.popupObj.element.querySelectorAll("."+pe),[pe,Ee]),(0,i.addClass)([p],pe),this.addSelectedAttributes(p,this.startValue,!0),p.classList.contains(ye)&&this.otherMonthSelect(p,!0),this.checkMinMaxDays());e&&(s=(0,i.closest)(e.target,"."+le)),(0,i.isNullOrUndefined)(s)?(e&&(a=e&&(0,i.closest)(e.target,"."+oe)),(0,i.isNullOrUndefined)(a)||this.rightCalendar.children[1].firstElementChild.focus()):this.leftCalendar.children[1].firstElementChild.focus(),(0,i.addClass)([p],Ee),this.calendarIconEvent(),this.updateHeader(),this.removeFocusedDate()},t.prototype.selectableDates=function(){if(!(0,i.isNullOrUndefined)(this.startValue)){var e=this.calendarElement.querySelectorAll("."+Ce+" td"),t=!1;if(this.currentView()===this.depth){for(var s=0,a=e;s<a.length;s++){if(!(l=a[s]).classList.contains(pe)&&!l.classList.contains(Ae)&&!l.classList.contains(De)){if(+this.getIdValue(null,l)<+this.startValue){(0,i.addClass)([l],[Ue,De,Le]),i.EventHandler.clearEvents(l);continue}break}if(l.classList.contains(pe)&&!l.classList.contains(ye)){t=!0;break}}t&&(this.previousIcon.classList.contains(De)||(0,i.addClass)([this.previousIcon],[He,De,Le]))}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(de)||!("Year"===this.currentView()&&u.getMonth()<o&&u.getFullYear()<=h||"Decade"===this.currentView()&&u.getMonth()<=o&&u.getFullYear()<h))break;(0,i.addClass)([l],[De])}e[0].classList.contains(De)?this.previousIconHandler(!0):e[e.length-1].classList.contains(De)&&this.nextIconHandler(!0)}}},t.prototype.updateMinMaxDays=function(e){if(!(0,i.isNullOrUndefined)(this.startValue)&&(0,i.isNullOrUndefined)(this.endValue)||this.isMobile&&this.endButton.element.classList.contains(de)){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("."+Ce+" td");r<l.length;r++){var o=l[r];if(!o.classList.contains(pe)&&!o.classList.contains(Ae)){var h=this.getIdValue(null,o);if(h=this.removeTimeValueFromDate(h),!(0,i.isNullOrUndefined)(s)&&+h==+s&&o.classList.contains(De)&&s.setDate(s.getDate()+1),!o.classList.contains(De)){if(+h<=+t)continue;!(0,i.isNullOrUndefined)(s)&&+h<+s&&((0,i.addClass)([o],[Ue,De,Le]),i.EventHandler.clearEvents(o)),!(0,i.isNullOrUndefined)(a)&&+h>+a&&((0,i.addClass)([o],[Ue,De,Le]),this.isMaxDaysClicked=!0,i.EventHandler.clearEvents(o),(0,i.isNullOrUndefined)(n)&&!o.classList.contains(ye)&&(n=o))}}}if(!(0,i.isNullOrUndefined)(n))if(this.isMobile)this.nextIcon.classList.contains(De)||(0,i.addClass)([this.nextIcon],[He,De,Le]);else{var u=(0,i.closest)(n,"."+oe);(u=(0,i.isNullOrUndefined)(u)?this.leftCalendar:u).classList.contains(le)?(this.rightCalNextIcon.classList.contains(De)||(0,i.addClass)([this.rightCalNextIcon],[He,De,Le]),this.leftCalNextIcon.classList.contains(De)||(0,i.addClass)([this.leftCalNextIcon],[He,De,Le]),this.rightCalPrevIcon.classList.contains(De)||(0,i.addClass)([this.rightCalPrevIcon],[He,De,Le])):this.rightCalNextIcon.classList.contains(De)||(0,i.addClass)([this.rightCalNextIcon],[He,De,Le])}}}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("."+Ce+" td."+Ue);e<t.length;e++){var s=t[e];s.classList.contains(Ue)&&((0,i.removeClass)([s],[Ue,De,Le]),i.EventHandler.add(s,"click",this.selectRange,this),this.isMobile||i.EventHandler.add(s,"mouseover",this.hoverSelection,this))}this.isMobile?(this.nextIcon.classList.contains(He)&&(0,i.removeClass)([this.nextIcon],[He,De,Le]),this.previousIcon.classList.contains(He)&&(0,i.removeClass)([this.previousIcon],[He,De,Le])):(this.rightCalNextIcon.classList.contains(He)&&(0,i.removeClass)([this.rightCalNextIcon],[He,De,Le]),this.rightCalPrevIcon.classList.contains(He)&&(0,i.removeClass)([this.rightCalPrevIcon],[He,De,Le]),this.leftCalNextIcon.classList.contains(He)&&(0,i.removeClass)([this.leftCalNextIcon],[He,De,Le]))},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("."+Pe).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("."+Pe).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("."+be).textContent=this.l10n.getConstant("endLabel"):this.popupObj.element.querySelector("."+be).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("."+Pe).textContent=this.l10n.getConstant("selectedDays")):(this.popupObj.element.querySelector("."+Pe).textContent=this.l10n.getConstant("selectedDays"),this.popupObj.element.querySelector("."+ge).textContent=this.l10n.getConstant("startLabel"),this.popupObj.element.querySelector("."+be).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("."+Ee).length>0&&(0,i.removeClass)(this.popupObj.element.querySelectorAll("."+Ee),[pe,ce,Ee]),this.popupObj.element.querySelectorAll("."+xe).length>0&&(0,i.removeClass)(this.popupObj.element.querySelectorAll("."+xe),xe),this.popupObj.element.querySelectorAll("."+ve).length>0&&(0,i.removeClass)(this.popupObj.element.querySelectorAll("."+ve),[ve]))},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("."+pe);e<t.length;e++){(a=t[e]).setAttribute("aria-selected","false"),a.removeAttribute("aria-label")}for(var i=0,s=this.popupObj.element.querySelectorAll("."+ce);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(le)?(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("."+Se),this.tableBodyElement=(0,i.select)("."+Se+" tbody",e),this.table=e.querySelector("."+Se).getElementsByTagName("table")[0],this.headerTitleElement=e.querySelector("."+we+" ."+Ve),this.headerElement=e.querySelector("."+we)},t.prototype.navPrevMonth=function(e){e.preventDefault();var t=(0,i.closest)(e.target,"."+le);t=(0,i.isNullOrUndefined)(t)?(0,i.closest)(e.target,"."+oe):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("."+Ce)]),this.endButton.element.classList.contains(de)&&this.updateMinMaxDays(this.popupObj.element.querySelector("."+Ce)),this.endButton.element.classList.contains(de)&&this.selectableDates(),this.currentView()===this.depth&&this.bindCalendarCellEvents(),this.removeFocusedDate()},t.prototype.updateControl=function(e,t){void 0===t&&(t=null),e.classList.contains(oe)?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,"."+le);t=(0,i.isNullOrUndefined)(t)?(0,i.closest)(e.target,"."+oe):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(re))},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:me});this.startButton=new te.Button({content:this.l10n.getConstant("startLabel")},s),this.endButton=new te.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:be}),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),R.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(Ce),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("."+Ce+" ."+Me),a=this.calendarElement.querySelector("."+Ce+" ."+ke);(0,i.remove)(this.calendarElement.querySelector("."+Ce+" ."+Ne)),this.calendarElement.querySelector("."+Ce+" ."+we).appendChild(a),this.calendarElement.querySelector("."+Ce+" ."+we).appendChild(s),(0,i.prepend)([s],this.calendarElement.querySelector("."+Ce+" ."+we)),this.deviceCalendar=this.calendarElement,t.appendChild(this.calendarElement),this.headerTitleElement=this.calendarElement.querySelector("."+Ce+" ."+we+" ."+Ve)}else{this.selectStartMonth(),this.renderCalendar(),this.leftCalCurrentDate=new Date(+this.currentDate),this.calendarElement.classList.add(le),this.leftCalPrevIcon=this.calendarElement.querySelector("."+le+" ."+Me),this.leftCalNextIcon=this.calendarElement.querySelector("."+le+" ."+ke),this.leftTitle=this.calendarElement.querySelector("."+le+" ."+Ve),(0,i.remove)(this.calendarElement.querySelector("."+le+" ."+Ne)),this.calendarElement.querySelector("."+le+" ."+we).appendChild(this.leftCalNextIcon),this.calendarElement.querySelector("."+le+" ."+we).appendChild(this.leftCalPrevIcon),(0,i.prepend)([this.leftCalPrevIcon],this.calendarElement.querySelector("."+le+" ."+we)),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],oe),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("."+oe+" ."+Me),this.rightCalNextIcon=this.calendarElement.querySelector("."+oe+" ."+ke),this.rightTitle=this.calendarElement.querySelector("."+oe+" ."+Ve),(0,i.remove)(this.calendarElement.querySelector("."+oe+" ."+Ne)),this.calendarElement.querySelector("table").setAttribute("tabindex","0"),this.calendarElement.querySelector("."+oe+" ."+we).appendChild(this.rightCalNextIcon),this.calendarElement.querySelector("."+oe+" ."+we).appendChild(this.rightCalPrevIcon),(0,i.prepend)([this.rightCalPrevIcon],this.calendarElement.querySelector("."+oe+" ."+we)),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:Pe});(0,i.attributes)(l,{"aria-label":"Selected Days"}),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 "+Re+" "+Ye}),p=this.createElement("button");(0,i.addClass)([p],["e-apply",Re,"e-primary",Ye]),u.appendChild(p),u.appendChild(d);var c=!(0,i.isNullOrUndefined)(this.startValue)&&!(0,i.isNullOrUndefined)(this.endValue);(this.cancelButton=new te.Button({content:this.l10n.getConstant("cancelText")},d),this.applyButton=new te.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("."+Ie).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],[fe])),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(de)):(0,i.isNullOrUndefined)(this.startValue)||this.startButton.element.classList.add(de)},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],[fe])),"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()||R.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,"."+ne)||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(de);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(Be)&&(0,i.addClass)([t],Be)},t.prototype.onMouseLeave=function(e){var t=(0,i.closest)(e.target,"."+Be);(0,i.isNullOrUndefined)(t)||(0,i.removeClass)([t],Be)},t.prototype.setListSelection=function(e,t){if(e&&(!e.classList.contains(de)||this.isMobile&&e.classList.contains(de))){if(this.isMobile&&e.classList.contains(de))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],de),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("."+de);(0,i.isNullOrUndefined)(e)||((0,i.removeClass)([e],de),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(){this.isCustomWindow=!0,this.popupObj.hide(),this.popupWrapper=this.createElement("div",{id:this.element.id+"_popup",className:he+" "+re}),this.renderControl(),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:Ie,attrs:{tabindex:"0"}});var e=ie.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]],de)}},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 j.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]],de),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]],de),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(),(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(We),this.isMobile||this.popupObj.element.classList.add("e-bigger")),this.isMobile&&this.isCustomWindow&&((0,i.addClass)([this.modal],[We,he,"e-range-modal"]),document.body.className+=" "+je,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("."+pe);if(e){var t=(0,i.closest)(e,"."+oe);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],xe)}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("."+Ie),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(Be),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(Be)}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]],Be);else{a=s.nextElementSibling;!(0,i.isNullOrUndefined)(a)&&a.classList.contains(Fe)&&(0,i.addClass)([a],Be)}else{var a=t.nextElementSibling;!(0,i.isNullOrUndefined)(a)&&a.classList.contains(Fe)&&((0,i.removeClass)([t],Be),(0,i.addClass)([a],Be))}},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],Be)}}else{var a=t.previousElementSibling;!(0,i.isNullOrUndefined)(a)&&a.classList.contains(Fe)&&((0,i.removeClass)([t],Be),(0,i.addClass)([a],Be))}},t.prototype.getHoverLI=function(){return this.presetElement.querySelector("."+Be)},t.prototype.getActiveLI=function(){return this.presetElement.querySelector("."+de)},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("."+Be),s=this.presetElement.querySelector("."+de),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,"."+Ie);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,"."+ne)===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=R.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",autocorrect:"off",autocapitalize:"off",spellcheck:"false"}),R.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%"},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);R.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&&R.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],[fe]),this.inputElement.focus())},t.prototype.focusOut=function(){var e=this.preventBlur;document.activeElement===this.inputElement&&((0,i.removeClass)([this.inputWrapper.container],[fe]),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],[he]),i.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),R.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()),R.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.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;if(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;!(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(de),a.startButton.element.classList.remove(de),a.endButton.element.removeAttribute("disabled"),a.selectableDates()),e.prototype.setOverlayIndex.call(a,a.mobileRangePopupWrap,a.popupObj.element,a.modal,a.isMobile||i.Browser.isDevice)}})),i.Browser.isDevice){var r=this.createElement("div",{className:"e-dlg-overlay"});r.style.zIndex=(this.zIndex-1).toString(),this.mobileRangePopupWrap.appendChild(r)}}},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]],de):(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],[fe]))),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],je),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),R.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(){R.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.refreshChange()},t.prototype.enableInput=function(){+this.min<=+this.max&&(this.setProperties({enabled:!0},!0),R.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:qe}),(0,i.attributes)(this.secondHiddenChild,{type:"text",name:this.inputElement.getAttribute("data-name"),class:qe});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.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=0,n=Object.keys(e);a<n.length;a++){var r=n[a];switch(["maxDays","minDays","value"].indexOf(r)<0&&this.hide(null),r){case"width":this.setEleWidth(this.width),R.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":R.Input.setPlaceholder(e.placeholder,this.inputElement),this.setProperties({placeholder:e.placeholder},!0);break;case"readonly":R.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),R.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),R.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"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),R.Input.setPlaceholder(this.placeholder,this.inputElement)),this.setLocale();break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.setDataAttribute(!0),this.checkHtmlAttributes(!0);break;case"showClearButton":R.Input.setClearButton(this.showClearButton,this.inputElement,this.inputWrapper),this.bindClearEvent();break;case"startDate":"string"==typeof e.startDate&&(e.startDate=this.globalize.parseDate(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(e.endDate,s)),+this.initEndDate!=+e.endDate&&(this.endValue=this.getStartEndValue(e.endDate,!0),this.setDate(),this.setValue());break;case"value":if(this.invalidValueString=null,this.checkInvalidRange(e.value),"string"==typeof e.value)if(this.invalidValueString)this.clearModelvalue(e,t);else{var l=e.value.split(" "+this.separator+" ");this.value=[new Date(l[0]),new Date(l[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":this.setProperties({minDays:e.minDays},!0),this.refreshChange(),this.setMinMaxDays();break;case"maxDays":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,R.Input.removeFloating(this.inputWrapper),R.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()}}},ae([(0,i.Property)(null)],t.prototype,"value",void 0),ae([(0,i.Property)(!1)],t.prototype,"enablePersistence",void 0),ae([(0,i.Property)(new Date(1900,0,1))],t.prototype,"min",void 0),ae([(0,i.Property)(new Date(2099,11,31))],t.prototype,"max",void 0),ae([(0,i.Property)(null)],t.prototype,"locale",void 0),ae([(0,i.Property)(null)],t.prototype,"firstDayOfWeek",void 0),ae([(0,i.Property)(!1)],t.prototype,"weekNumber",void 0),ae([(0,i.Property)("Gregorian")],t.prototype,"calendarMode",void 0),ae([(0,i.Property)(!1)],t.prototype,"openOnFocus",void 0),ae([(0,i.Property)(!1)],t.prototype,"fullScreenMode",void 0),ae([(0,i.Event)()],t.prototype,"created",void 0),ae([(0,i.Event)()],t.prototype,"destroyed",void 0),ae([(0,i.Event)()],t.prototype,"change",void 0),ae([(0,i.Event)()],t.prototype,"cleared",void 0),ae([(0,i.Event)()],t.prototype,"navigated",void 0),ae([(0,i.Event)()],t.prototype,"renderDayCell",void 0),ae([(0,i.Property)(null)],t.prototype,"startDate",void 0),ae([(0,i.Property)(null)],t.prototype,"endDate",void 0),ae([(0,i.Collection)([{}],_e)],t.prototype,"presets",void 0),ae([(0,i.Property)("")],t.prototype,"width",void 0),ae([(0,i.Property)(1e3)],t.prototype,"zIndex",void 0),ae([(0,i.Property)(!0)],t.prototype,"showClearButton",void 0),ae([(0,i.Property)(!0)],t.prototype,"showTodayButton",void 0),ae([(0,i.Property)("Month")],t.prototype,"start",void 0),ae([(0,i.Property)("Month")],t.prototype,"depth",void 0),ae([(0,i.Property)("")],t.prototype,"cssClass",void 0),ae([(0,i.Property)("-")],t.prototype,"separator",void 0),ae([(0,i.Property)(null)],t.prototype,"minDays",void 0),ae([(0,i.Property)(null)],t.prototype,"maxDays",void 0),ae([(0,i.Property)(!1)],t.prototype,"strictMode",void 0),ae([(0,i.Property)(null)],t.prototype,"keyConfigs",void 0),ae([(0,i.Property)(null)],t.prototype,"format",void 0),ae([(0,i.Property)(!0)],t.prototype,"enabled",void 0),ae([(0,i.Property)(!1)],t.prototype,"readonly",void 0),ae([(0,i.Property)(!0)],t.prototype,"allowEdit",void 0),ae([(0,i.Property)("Never")],t.prototype,"floatLabelType",void 0),ae([(0,i.Property)(null)],t.prototype,"placeholder",void 0),ae([(0,i.Property)({})],t.prototype,"htmlAttributes",void 0),ae([(0,i.Event)()],t.prototype,"open",void 0),ae([(0,i.Event)()],t.prototype,"close",void 0),ae([(0,i.Event)()],t.prototype,"select",void 0),ae([(0,i.Event)()],t.prototype,"focus",void 0),ae([(0,i.Event)()],t.prototype,"blur",void 0),t=ae([i.NotifyPropertyChanges],t)}(T),Ze=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)}}(),Xe=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},Je="e-error",$e="240px",Qe=(new Date).getDate(),et=(new Date).getMonth(),tt=(new Date).getFullYear(),it="e-timepicker",st="e-active",at="e-hover",nt="e-navigation",rt="e-disabled",lt="e-input-focus",ot="e-list-item",ht="e-time-overflow",ut="e-non-edit",dt=["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:ie.ListBase.createList(e,o,null,!0)}}}(t||(t={}));var pt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ze(t,e),Xe([(0,i.Property)("day")],t.prototype,"day",void 0),Xe([(0,i.Property)("month")],t.prototype,"month",void 0),Xe([(0,i.Property)("year")],t.prototype,"year",void 0),Xe([(0,i.Property)("day of the week")],t.prototype,"dayOfTheWeek",void 0),Xe([(0,i.Property)("hour")],t.prototype,"hour",void 0),Xe([(0,i.Property)("minute")],t.prototype,"minute",void 0),Xe([(0,i.Property)("second")],t.prototype,"second",void 0),t}(i.ChildProperty),ct=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 Ze(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],[it,"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.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex"),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],[ut]):""===this.inputElement.value?(0,i.removeClass)([this.inputWrapper.container],[ut]):(0,i.addClass)([this.inputWrapper.container],[ut])},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),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=R.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),(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)||R.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(s,{format:this.getCldrDateTimeFormat(),type:"datetime"})),(0,i.isNullOrUndefined)(n)&&(n=this.checkDateValue(this.globalize.parseDate(s,{format:this.formatString,type:"dateTime",skeleton:"yMd"})))))),a=this.globalize.parseDate(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.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&&(R.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"))&&R.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(),R.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:it+" e-popup",attrs:{id:this.element.id+"_popup",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($e,10),t=this.popupWrapper.getBoundingClientRect().height;return t>e?e:t},t.prototype.generateList=function(){this.createListItems(),this.wireListEvents();var e={duration:300,selector:"."+ot};this.rippleFn=(0,i.rippleEffect)(this.listWrapper,e),this.liCollections=this.listWrapper.querySelectorAll("."+ot)},t.prototype.renderPopup=function(){var e=this;if(this.containerStyle=this.inputWrapper.container.getBoundingClientRect(),this.popupObj=new j.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]],st)},close:function(){(0,i.removeClass)([e.inputWrapper.buttons[0]],st),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=$e,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():Qe,a=i?this.initValue.getMonth():et,n=i?this.initValue.getFullYear():tt;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(dt.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];dt.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()),R.Input.setCssClass(e,[this.inputWrapper.container],t),this.popupWrapper&&R.Input.setCssClass(e,[this.popupWrapper],t)},t.prototype.removeErrorClass=function(){(0,i.removeClass)([this.inputWrapper.container],Je),(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],Je),(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,rt)},t.prototype.enableElement=function(e){(0,i.removeClass)(e,rt)},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("."+st)},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("."+ot);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(){R.Input.setPlaceholder(this.l10n.getConstant("placeholder"),this.inputElement)},t.prototype.updateInputValue=function(e){R.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,"."+ot);this.setSelection(s,e),s&&s.classList.contains(ot)&&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],ht),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){var s=this.getDateObject(new Date(this.timeCollections[this.activeIndex]));+this.prevDate!=+s&&this.valueProcess(e,s)}else(this.prevValue!==this.inputElement.value||(0,i.isNullOrUndefined)(this.checkDateValue(this.value)))&&this.valueProcess(e,this.compareFormatChange(this.inputElement.value));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,"."+ot);this.setHover(t,at)},t.prototype.setHover=function(e,t){this.enabled&&this.isValidLI(e)&&!e.classList.contains(t)&&(this.removeHover(t),(0,i.addClass)([e],t),t===nt&&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],st),this.selectedElement.setAttribute("aria-selected","true"),this.checkValueChange(t,!0))},t.prototype.onMouseLeave=function(){this.removeHover(at)},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(this.disableItemCollection.length>0){if(this.disableItemCollection.length===this.timeCollections.length)return!1;for(var t=e instanceof Date?this.objToString(e):e,i=0;i<this.disableItemCollection.length;i++)if(t===this.disableItemCollection[i])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),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.showClearButton&&this.inputElement&&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.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.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(tt,et,Qe,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(),R.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("."+ot),n=!0;if(a.length)if(t)for(var r=e;r>=0;r--){if(!a[r].classList.contains(rt)){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(rt)){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(rt))){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,nt),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(at),!(0,i.isNullOrUndefined)(this.popupWrapper)){var e=this.popupWrapper.querySelectorAll("."+st);e.length&&((0,i.removeClass)(e,st),e[0].removeAttribute("aria-selected"))}},t.prototype.removeHover=function(e){var t=this.getHoverItem(e);t&&t.length&&((0,i.removeClass)(t,e),e===nt&&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("."+ot);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],st),this.selectedElement.setAttribute("aria-selected","true"))},t.prototype.isValidLI=function(e){return e&&e.classList.contains(ot)&&!e.classList.contains(rt)},t.prototype.createDateObj=function(e){var t=this.globalize.formatDate(new Date,{format:null,skeleton:"short",type:"date"}),s=null;return"string"==typeof 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):e instanceof Date&&(s=e),s},t.prototype.timeParse=function(e,t){var s;return s=this.globalize.parseDate(e+" "+t,{format:this.cldrDateFormat()+" "+this.cldrTimeFormat(),type:"datetime"}),s=(0,i.isNullOrUndefined)(s)?this.globalize.parseDate(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(rt),e.element.classList.contains(rt)&&t.disableItemCollection.push(e.element.getAttribute("data-value"))}))}};this.listTag=ie.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.classList.contains("e-dlg-overlay")?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(),this.focusOut())},t.prototype.setEnableRtl=function(){R.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]),this.popupObj&&(this.popupObj.enableRtl=this.enableRtl,this.popupObj.dataBind())},t.prototype.setEnable=function(){R.Input.setEnabled(this.enabled,this.inputElement,this.floatLabelType),this.enabled?((0,i.removeClass)([this.inputWrapper.container],rt),(0,i.attributes)(this.inputElement,{"aria-disabled":"false"}),this.inputElement.setAttribute("tabindex",this.tabIndex)):(this.hide(),(0,i.addClass)([this.inputWrapper.container],rt),(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.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],[lt]),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],[lt]);var e={model:this};this.trigger("blur",e)}},t.prototype.isPopupOpen=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains(""+it))},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.trigger("focus",e),this.clearIconState(),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=it+" e-time-modal",document.body.className+=" "+ht,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;if(this.trigger("open",s,(function(e){if(t.openPopupEventArgs=e,t.openPopupEventArgs.cancel||t.inputWrapper.buttons[0].classList.contains(rt))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};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],lt),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=this.createElement("div",{className:"e-dlg-overlay"});a.style.zIndex=(this.zIndex-1).toString(),this.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.onPropertyChanged=function(e,t){for(var s=0,a=Object.keys(e);s<a.length;s++){var n=a[s];switch(n){case"placeholder":R.Input.setPlaceholder(e.placeholder,this.inputElement);break;case"readonly":R.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":R.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(),R.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,R.Input.removeFloating(this.inputWrapper),R.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},Xe([(0,i.Property)(null)],t.prototype,"width",void 0),Xe([(0,i.Property)(null)],t.prototype,"cssClass",void 0),Xe([(0,i.Property)(!1)],t.prototype,"strictMode",void 0),Xe([(0,i.Property)(null)],t.prototype,"keyConfigs",void 0),Xe([(0,i.Property)(null)],t.prototype,"format",void 0),Xe([(0,i.Property)(!0)],t.prototype,"enabled",void 0),Xe([(0,i.Property)(!1)],t.prototype,"fullScreenMode",void 0),Xe([(0,i.Property)(!1)],t.prototype,"readonly",void 0),Xe([(0,i.Property)({})],t.prototype,"htmlAttributes",void 0),Xe([(0,i.Property)("Never")],t.prototype,"floatLabelType",void 0),Xe([(0,i.Property)(null)],t.prototype,"placeholder",void 0),Xe([(0,i.Property)(1e3)],t.prototype,"zIndex",void 0),Xe([(0,i.Property)(!1)],t.prototype,"enablePersistence",void 0),Xe([(0,i.Property)(!0)],t.prototype,"showClearButton",void 0),Xe([(0,i.Property)(30)],t.prototype,"step",void 0),Xe([(0,i.Property)(null)],t.prototype,"scrollTo",void 0),Xe([(0,i.Property)(null)],t.prototype,"value",void 0),Xe([(0,i.Property)(null)],t.prototype,"min",void 0),Xe([(0,i.Property)(null)],t.prototype,"max",void 0),Xe([(0,i.Property)(!0)],t.prototype,"allowEdit",void 0),Xe([(0,i.Property)(!1)],t.prototype,"openOnFocus",void 0),Xe([(0,i.Property)(!1)],t.prototype,"enableMask",void 0),Xe([(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),Xe([(0,i.Property)(null)],t.prototype,"serverTimezoneOffset",void 0),Xe([(0,i.Event)()],t.prototype,"change",void 0),Xe([(0,i.Event)()],t.prototype,"created",void 0),Xe([(0,i.Event)()],t.prototype,"destroyed",void 0),Xe([(0,i.Event)()],t.prototype,"open",void 0),Xe([(0,i.Event)()],t.prototype,"itemRender",void 0),Xe([(0,i.Event)()],t.prototype,"close",void 0),Xe([(0,i.Event)()],t.prototype,"cleared",void 0),Xe([(0,i.Event)()],t.prototype,"blur",void 0),Xe([(0,i.Event)()],t.prototype,"focus",void 0),t=Xe([i.NotifyPropertyChanges],t)}(i.Component),mt=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)}}(),ft=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},vt=(new Date).getDate(),yt=(new Date).getMonth(),gt=(new Date).getFullYear(),bt=(new Date).getHours(),Dt=(new Date).getMinutes(),Et=(new Date).getSeconds(),Ct=(new Date).getMilliseconds(),kt="e-datetimepicker",Mt="e-datetimepopup-wrapper",wt="e-popup",Vt="e-input-focus",Nt="250px",Ot="e-icon-anim",It="e-disabled",Tt="e-error",xt="e-active",St="e-hover",Pt="e-list-item",At="e-time-overflow",Ut=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 mt(s,e),s.prototype.focusHandler=function(){this.enabled&&(0,i.addClass)([this.inputWrapper.container],Vt)},s.prototype.focusIn=function(){e.prototype.focusIn.call(this)},s.prototype.focusOut=function(){document.activeElement===this.inputElement&&(this.inputElement.blur(),(0,i.removeClass)([this.inputWrapper.container],[Vt]))},s.prototype.blurHandler=function(e){if(this.enabled)if(this.isTimePopupOpen()&&this.isPreventBlur)this.inputElement.focus();else{(0,i.removeClass)([this.inputWrapper.container],Vt);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(wt)&&(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&&R.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,R.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))),!(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||R.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&&R.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);R.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.isValidState=!1),this.checkErrorState()},s.prototype.checkErrorState=function(){this.isValidState?(0,i.removeClass)([this.inputWrapper.container],Tt):(0,i.addClass)([this.inputWrapper.container],Tt),(0,i.attributes)(this.inputElement,{"aria-invalid":this.isValidState?"false":"true"})},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],It),this.hide()):(0,i.removeClass)([this.inputWrapper.buttons[0],this.timeIcon],It)},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],kt),this.renderTimeIcon()},s.prototype.renderTimeIcon=function(){this.timeIcon=R.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],[Vt]))),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.inputElement.value,{format:this.dateFormatString,type:"datetime"})):e=this.globalize.parseDate(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:"."+Pt};this.rippleFn=(0,i.rippleEffect)(this.listWrapper,l),this.liCollections=this.listWrapper.querySelectorAll("."+Pt)},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],Mt),(0,i.attributes)(this.popupWrapper,{id:this.element.id+"_options"}));else if(!this.readonly&&(this.dateTimeWrapper=(0,i.createElement)("div",{className:kt+" "+wt,attrs:{id:this.element.id+"_timepopup",style:"visibility:hidden ; display:block"}}),(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.fullScreenMode&&(this.dateTimeWrapper.style.left="0px"),i.Browser.isDevice)){var s=this.createElement("div",{className:"e-dlg-overlay"});s.style.zIndex=(this.zIndex-1).toString(),this.timeModal.appendChild(s)}},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.classList.contains("e-dlg-overlay")?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),this.focusOut())},s.prototype.isTimePopupOpen=function(){return!(!this.dateTimeWrapper||!this.dateTimeWrapper.classList.contains(""+kt))},s.prototype.isDatePopupOpen=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains(""+Mt))},s.prototype.renderPopup=function(){var e=this;this.containerStyle=this.inputWrapper.container.getBoundingClientRect(),i.Browser.isDevice&&(this.timeModal=(0,i.createElement)("div"),this.timeModal.className=kt+" e-time-modal",document.body.className+=" "+At,this.timeModal.style.display="block",document.body.appendChild(this.timeModal));if(this.popupObject=new j.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],xt),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],xt),e.unWireTimeListEvents(),e.inputElement.removeAttribute("aria-activedescendant"),(0,i.remove)(e.popupObject.element),e.popupObject.destroy(),e.dateTimeWrapper.innerHTML="",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.display="flex",this.popupObject.element.style.maxHeight="100%",this.popupObject.element.style.width="100%"):this.popupObject.element.style.maxHeight=Nt,i.Browser.isDevice&&this.fullScreenMode){var t=(0,i.createElement)("div",{className:"e-datetime-mob-popup-wrap"}),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);var r=this.dateTimeWrapper.querySelector(".e-content");s.appendChild(n),s.appendChild(a),t.appendChild(s),t.appendChild(r),this.dateTimeWrapper.insertBefore(t,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,"."+Pt);this.setTimeHover(t,St)},s.prototype.onMouseLeave=function(){this.removeTimeHover(St)},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(Nt,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("."+Pt);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]));R.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,"."+Pt);s&&s.classList.contains(Pt)&&(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(xt)){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],xt),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("."+Pt);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],xt),this.selectedElement.setAttribute("aria-selected","true"))},s.prototype.removeTimeSelection=function(){if(this.removeTimeHover(St),!(0,i.isNullOrUndefined)(this.dateTimeWrapper)){var e=this.dateTimeWrapper.querySelectorAll("."+xt);e.length&&((0,i.removeClass)(e,xt),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(Pt)&&!e.classList.contains(It)},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=this.min,a=null===e?new Date:e;return+a.getDate()==+s.getDate()&&+a.getMonth()==+s.getMonth()&&+a.getFullYear()==+s.getFullYear()||+new Date(a.getFullYear(),a.getMonth(),a.getDate())<=+new Date(s.getFullYear(),s.getMonth(),s.getDate())?(i=!1,t=this.min):+a<+this.max&&+a>+this.min?(i=!0,t=a):+a>=+this.max&&(i=!0,t=this.max),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=this.max,a=null===e?new Date:e;return+a.getDate()==+s.getDate()&&+a.getMonth()==+s.getMonth()&&+a.getFullYear()==+s.getFullYear()||+new Date(a.getUTCFullYear(),a.getMonth(),a.getDate())>=+new Date(s.getFullYear(),s.getMonth(),s.getDate())?(i=!1,t=this.max):+a<+this.max&&+a>+this.min?(i=!0,t=a):+a<=+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],At),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],[kt])},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("."+xt)},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():vt,r=a?s.getMonth():yt,l=a?s.getFullYear():gt,o=a?s.getHours():bt,h=a?s.getMinutes():Dt,u=a?s.getSeconds():Et,d=a?s.getMilliseconds():Ct;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),R.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],Vt),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(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?R.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton):R.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":R.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()),R.Input.setCssClass(t.cssClass,[this.inputWrapper.container],s.cssClass),this.dateTimeWrapper&&R.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),R.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||R.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton));break;case"placeholder":R.Input.setPlaceholder(t.placeholder,this.inputElement);break;case"enabled":R.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),R.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":R.Input.setReadonly(this.readonly,this.inputElement);break;case"floatLabelType":this.floatLabelType=t.floatLabelType,R.Input.removeFloating(this.inputWrapper),R.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"}),R.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton)):this.inputElement.value===this.maskedDateValue&&(this.maskedDateValue="",R.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.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)},ft([(0,i.Property)(null)],s.prototype,"timeFormat",void 0),ft([(0,i.Property)(30)],s.prototype,"step",void 0),ft([(0,i.Property)(null)],s.prototype,"scrollTo",void 0),ft([(0,i.Property)(1e3)],s.prototype,"zIndex",void 0),ft([(0,i.Property)(null)],s.prototype,"value",void 0),ft([(0,i.Property)(null)],s.prototype,"keyConfigs",void 0),ft([(0,i.Property)({})],s.prototype,"htmlAttributes",void 0),ft([(0,i.Property)(!1)],s.prototype,"enablePersistence",void 0),ft([(0,i.Property)(!0)],s.prototype,"allowEdit",void 0),ft([(0,i.Property)(!1)],s.prototype,"isMultiSelection",void 0),ft([(0,i.Property)(null)],s.prototype,"values",void 0),ft([(0,i.Property)(!0)],s.prototype,"showClearButton",void 0),ft([(0,i.Property)(null)],s.prototype,"placeholder",void 0),ft([(0,i.Property)(!1)],s.prototype,"strictMode",void 0),ft([(0,i.Property)(!1)],s.prototype,"fullScreenMode",void 0),ft([(0,i.Property)(null)],s.prototype,"serverTimezoneOffset",void 0),ft([(0,i.Property)(new Date(1900,0,1))],s.prototype,"min",void 0),ft([(0,i.Property)(new Date(2099,11,31))],s.prototype,"max",void 0),ft([(0,i.Property)(null)],s.prototype,"firstDayOfWeek",void 0),ft([(0,i.Property)("Gregorian")],s.prototype,"calendarMode",void 0),ft([(0,i.Property)("Month")],s.prototype,"start",void 0),ft([(0,i.Property)("Month")],s.prototype,"depth",void 0),ft([(0,i.Property)(!1)],s.prototype,"weekNumber",void 0),ft([(0,i.Property)(!0)],s.prototype,"showTodayButton",void 0),ft([(0,i.Property)("Short")],s.prototype,"dayHeaderFormat",void 0),ft([(0,i.Property)(!1)],s.prototype,"openOnFocus",void 0),ft([(0,i.Property)(!1)],s.prototype,"enableMask",void 0),ft([(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),ft([(0,i.Event)()],s.prototype,"open",void 0),ft([(0,i.Event)()],s.prototype,"close",void 0),ft([(0,i.Event)()],s.prototype,"cleared",void 0),ft([(0,i.Event)()],s.prototype,"blur",void 0),ft([(0,i.Event)()],s.prototype,"focus",void 0),ft([(0,i.Event)()],s.prototype,"created",void 0),ft([(0,i.Event)()],s.prototype,"destroyed",void 0),s=ft([i.NotifyPropertyChanges],s)}(ee),Ht="ArrowLeft",Wt="ArrowDown",Lt="shiftTab",Ft="End",Bt="Home",jt=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|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))},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))},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(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!==Ht&&"ArrowRight"!==e.e.key&&e.e.key!==Lt&&"Tab"!==e.e.key&&e.e.action!==Lt&&e.e.key!==Ft&&e.e.key!==Bt)){var t=this.parent.inputElement.selectionStart,i=this.parent.inputElement.selectionEnd,s=this.parent.inputElement.value.length;if(0===t&&i===s&&("Tab"===e.e.key||e.e.action===Lt)){var a=e.e.action===Lt?i:0;this.parent.inputElement.selectionStart=this.parent.inputElement.selectionEnd=a}if(e.e.key===Ft||e.e.key===Bt){var n=e.e.key===Ft?s:0;this.parent.inputElement.selectionStart=this.parent.inputElement.selectionEnd=n}this.navigateSelection(e.e.key===Ht||e.e.action===Lt||e.e.key===Ft)}if(!(e.e.altKey||e.e.ctrlKey||"ArrowUp"!==e.e.key&&e.e.key!==Wt)){t=this.parent.inputElement.selectionStart;var r="";-1!==this.validCharacters.indexOf(this.hiddenMask[t])&&(r=this.hiddenMask[t]),this.dateAlteration(e.e.key===Wt);var l=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=l,this.parent.inputElement.value=l;for(var o=0;o<this.hiddenMask.length;o++)if(r===this.hiddenMask[o]){t=o;break}this.parent.inputElement.selectionStart=t,this.validCharacterCheck()}}else this.isDeleteKey=!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,this.dayTypeCount=this.dayTypeCount+1}else this.isDayPart=!1,this.dayTypeCount=this.isDateZero?this.dayTypeCount+1:this.dayTypeCount;break;case"M":var o=void 0;if(o=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(o)){var h=this.getCulturedValue("months[stand-alone].wide"),u=Object.keys(h);for(this.monthCharacter+=s[e-1].toLowerCase();this.monthCharacter.length>0;){r=1;for(var d=0,p=u;d<p.length;d++){p[d];if(0===h[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(;o>12;)o=parseInt(o.toString().slice(1),10);if(o>=1){if(a.setMonth(o-1),o>=10||1===o?this.isLeadingZero&&1===o?(this.isNavigate=1===o.toString().length,this.isLeadingZero=!1):this.isNavigate=2===o.toString().length:this.isNavigate=1===o.toString().length,a.getMonth()!==o-1&&(a.setDate(1),a.setMonth(o-1)),this.isDayPart){var c=new Date(this.previousDate.getFullYear(),this.previousDate.getMonth()+1,0).getDate(),m=new Date(a.getFullYear(),a.getMonth()+1,0).getDate();this.previousDate.getDate()===c&&m<=c&&a.setDate(m)}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,this.monthTypeCount=this.isMonthZero?this.monthTypeCount+1:this.monthTypeCount}break;case"y":var f=(this.isYearPart&&a.getFullYear().toString().length<4&&!this.isShortYear?10*a.getFullYear():0)+parseInt(s[e-1],10),v=(this.dateformat.match(/y/g)||[]).length;if(v=2!==v?4:v,this.isShortYear=!1,this.isYearZero="0"===s[e-1],isNaN(f))return;for(;f>9999;)f=parseInt(f.toString().slice(1),10);f<1?this.isYearPart=!1:(a.setFullYear(f),f.toString().length===v&&(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=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=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=this.minuteTypeCount+1;break;case"s":var g=(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(g))return;for(r=0;g>59;r++)g=parseInt(g.toString().slice(1),10);a.setSeconds(g),this.isNavigate=2===g.toString().length,this.isSecondsPart=!0,this.secondTypeCount=this.secondTypeCount+1;break;case"a":this.periodCharacter+=s[e-1].toLowerCase();var b=this.getCulturedValue("dayPeriods.format.wide"),D=Object.keys(b);for(r=0;this.periodCharacter.length>0;r++)(0===b[D[0]].toLowerCase().indexOf(this.periodCharacter)&&a.getHours()>=12||0===b[D[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":i=e.isDayPart&&e.isMonthPart&&e.isYearPart?n[r[e.maskDateValue.getDay()]].toString():e.defaultConstant.dayOfTheWeek.toString();break;case"EEEE":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.maskInputHandler=function(){var e=this.parent.inputElement.selectionStart,t="";-1!==this.validCharacters.indexOf(this.hiddenMask[e])&&(t=this.hiddenMask[e]),this.differenceCheck();var i=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=i,this.parent.inputElement.value=i,this.parent.inputElement.value=i;for(var s=0;s<this.hiddenMask.length;s++)if(t===this.hiddenMask[s]){e=s;break}if(this.parent.inputElement.selectionStart=e,this.validCharacterCheck(),(this.isNavigate||this.isDeletion)&&!this.isDeleteKey){var a=!this.isNavigate;this.isNavigate=this.isDeletion=!1,this.navigateSelection(a)}this.isDeleteKey&&(this.isDeletion=!1),this.isDeleteKey=!1},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()},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)},e.prototype.destroy=function(){this.removeEventListener()},e}()})(),o})()));
|