@syncfusion/ej2-calendars 25.2.4 → 25.2.7-30676
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/CHANGELOG.md +1220 -1212
- package/README.md +178 -178
- package/dist/ej2-calendars.umd.min.js +1 -10
- package/dist/ej2-calendars.umd.min.js.map +1 -1
- package/dist/es6/ej2-calendars.es2015.js +37 -34
- package/dist/es6/ej2-calendars.es2015.js.map +1 -1
- package/dist/es6/ej2-calendars.es5.js +112 -109
- package/dist/es6/ej2-calendars.es5.js.map +1 -1
- package/helpers/e2e/calendarHelper.js +13 -13
- package/helpers/e2e/datepickerHelper.js +13 -13
- package/helpers/e2e/daterangepickerHelper.js +13 -13
- package/helpers/e2e/datetimepickerHelper.js +13 -13
- package/helpers/e2e/index.js +3 -3
- package/helpers/e2e/timepickerHelper.js +13 -13
- package/license +10 -10
- package/package.json +85 -85
- package/src/calendar/calendar-model.d.ts +277 -277
- package/src/calendar/calendar.d.ts +20 -20
- package/src/calendar/calendar.js +25 -25
- package/src/common/maskplaceholder-model.d.ts +36 -36
- package/src/common/maskplaceholder.js +19 -19
- package/src/datepicker/datepicker-model.d.ts +289 -289
- package/src/datepicker/datepicker.d.ts +10 -10
- package/src/datepicker/datepicker.js +23 -23
- package/src/daterangepicker/daterangepicker-model.d.ts +427 -427
- package/src/daterangepicker/daterangepicker.d.ts +2 -2
- package/src/daterangepicker/daterangepicker.js +24 -21
- package/src/datetimepicker/datetimepicker-model.d.ts +453 -453
- package/src/datetimepicker/datetimepicker.d.ts +1 -1
- package/src/datetimepicker/datetimepicker.js +20 -20
- package/src/timepicker/timepicker-model.d.ts +350 -350
- package/src/timepicker/timepicker.d.ts +5 -5
- package/src/timepicker/timepicker.js +23 -23
- package/styles/bootstrap-dark.css +190 -984
- package/styles/bootstrap-dark.scss +20 -5
- package/styles/bootstrap.css +190 -985
- package/styles/bootstrap.scss +20 -5
- package/styles/bootstrap4.css +190 -992
- package/styles/bootstrap4.scss +20 -5
- package/styles/bootstrap5-dark.css +191 -1014
- package/styles/bootstrap5-dark.scss +20 -5
- package/styles/bootstrap5.css +191 -1014
- package/styles/bootstrap5.scss +20 -5
- package/styles/calendar/_all.scss +2 -2
- package/styles/calendar/_bds-definition.scss +273 -272
- package/styles/calendar/_bigger.scss +1142 -0
- package/styles/calendar/_bootstrap-dark-definition.scss +238 -238
- package/styles/calendar/_bootstrap-definition.scss +238 -238
- package/styles/calendar/_bootstrap4-definition.scss +238 -238
- package/styles/calendar/_bootstrap5-definition.scss +258 -258
- package/styles/calendar/_bootstrap5.3-definition.scss +260 -0
- package/styles/calendar/_fabric-dark-definition.scss +202 -202
- package/styles/calendar/_fabric-definition.scss +200 -200
- package/styles/calendar/_fluent-definition.scss +264 -262
- package/styles/calendar/_fluent2-definition.scss +294 -0
- package/styles/calendar/_fusionnew-definition.scss +260 -260
- package/styles/calendar/_highcontrast-definition.scss +199 -199
- package/styles/calendar/_highcontrast-light-definition.scss +202 -202
- package/styles/calendar/_layout.scss +565 -789
- package/styles/calendar/_material-dark-definition.scss +204 -204
- package/styles/calendar/_material-definition.scss +199 -199
- package/styles/calendar/_material3-definition.scss +196 -205
- package/styles/calendar/_tailwind-definition.scss +271 -271
- package/styles/calendar/_tailwind4-definition.scss +260 -0
- package/styles/calendar/_theme.scss +643 -555
- package/styles/calendar/bootstrap-dark.css +97 -375
- package/styles/calendar/bootstrap.css +97 -375
- package/styles/calendar/bootstrap4.css +97 -375
- package/styles/calendar/bootstrap5-dark.css +98 -396
- package/styles/calendar/bootstrap5.css +98 -396
- package/styles/calendar/fabric-dark.css +98 -377
- package/styles/calendar/fabric.css +99 -379
- package/styles/calendar/fluent-dark.css +116 -424
- package/styles/calendar/fluent.css +116 -424
- package/styles/calendar/fluent2.css +1747 -0
- package/styles/calendar/fluent2.scss +5 -0
- package/styles/calendar/highcontrast-light.css +97 -375
- package/styles/calendar/highcontrast.css +99 -379
- package/styles/calendar/icons/_bds.scss +13 -13
- package/styles/calendar/icons/_bootstrap-dark.scss +13 -13
- package/styles/calendar/icons/_bootstrap.scss +13 -13
- package/styles/calendar/icons/_bootstrap4.scss +13 -13
- package/styles/calendar/icons/_bootstrap5.3.scss +13 -0
- package/styles/calendar/icons/_bootstrap5.scss +13 -13
- package/styles/calendar/icons/_fabric-dark.scss +13 -13
- package/styles/calendar/icons/_fabric.scss +13 -13
- package/styles/calendar/icons/_fluent.scss +13 -13
- package/styles/calendar/icons/_fluent2.scss +13 -0
- package/styles/calendar/icons/_fusionnew.scss +13 -13
- package/styles/calendar/icons/_highcontrast-light.scss +13 -13
- package/styles/calendar/icons/_highcontrast.scss +13 -13
- package/styles/calendar/icons/_material-dark.scss +13 -13
- package/styles/calendar/icons/_material.scss +13 -13
- package/styles/calendar/icons/_material3.scss +13 -13
- package/styles/calendar/icons/_tailwind.scss +13 -13
- package/styles/calendar/icons/_tailwind4.scss +13 -0
- package/styles/calendar/material-dark.css +99 -379
- package/styles/calendar/material.css +99 -379
- package/styles/calendar/material3-dark.css +100 -380
- package/styles/calendar/material3-dark.scss +1 -1
- package/styles/calendar/material3.css +100 -380
- package/styles/calendar/material3.scss +1 -1
- package/styles/calendar/tailwind-dark.css +100 -428
- package/styles/calendar/tailwind.css +100 -428
- package/styles/datepicker/_all.scss +2 -2
- package/styles/datepicker/_bds-definition.scss +105 -105
- package/styles/datepicker/_bigger.scss +82 -0
- package/styles/datepicker/_bootstrap-dark-definition.scss +97 -97
- package/styles/datepicker/_bootstrap-definition.scss +96 -96
- package/styles/datepicker/_bootstrap4-definition.scss +101 -101
- package/styles/datepicker/_bootstrap5-definition.scss +107 -107
- package/styles/datepicker/_bootstrap5.3-definition.scss +108 -0
- package/styles/datepicker/_fabric-dark-definition.scss +98 -98
- package/styles/datepicker/_fabric-definition.scss +95 -95
- package/styles/datepicker/_fluent-definition.scss +107 -107
- package/styles/datepicker/_fluent2-definition.scss +118 -0
- package/styles/datepicker/_fusionnew-definition.scss +107 -107
- package/styles/datepicker/_highcontrast-definition.scss +96 -96
- package/styles/datepicker/_highcontrast-light-definition.scss +99 -99
- package/styles/datepicker/_layout.scss +459 -433
- package/styles/datepicker/_material-dark-definition.scss +103 -103
- package/styles/datepicker/_material-definition.scss +100 -100
- package/styles/datepicker/_material3-definition.scss +97 -116
- package/styles/datepicker/_tailwind-definition.scss +105 -105
- package/styles/datepicker/_tailwind4-definition.scss +108 -0
- package/styles/datepicker/_theme.scss +48 -53
- package/styles/datepicker/bootstrap-dark.css +2 -43
- package/styles/datepicker/bootstrap.css +2 -43
- package/styles/datepicker/bootstrap4.css +2 -45
- package/styles/datepicker/bootstrap5-dark.css +2 -45
- package/styles/datepicker/bootstrap5.css +2 -45
- package/styles/datepicker/fabric-dark.css +2 -43
- package/styles/datepicker/fabric.css +2 -43
- package/styles/datepicker/fluent-dark.css +2 -45
- package/styles/datepicker/fluent.css +2 -45
- package/styles/datepicker/fluent2.css +1617 -0
- package/styles/datepicker/fluent2.scss +7 -0
- package/styles/datepicker/highcontrast-light.css +2 -43
- package/styles/datepicker/highcontrast.css +2 -43
- package/styles/datepicker/icons/_bds.scss +52 -76
- package/styles/datepicker/icons/_bootstrap-dark.scss +49 -73
- package/styles/datepicker/icons/_bootstrap.scss +50 -72
- package/styles/datepicker/icons/_bootstrap4.scss +52 -76
- package/styles/datepicker/icons/_bootstrap5.3.scss +52 -0
- package/styles/datepicker/icons/_bootstrap5.scss +52 -76
- package/styles/datepicker/icons/_fabric-dark.scss +43 -65
- package/styles/datepicker/icons/_fabric.scss +43 -65
- package/styles/datepicker/icons/_fluent.scss +52 -76
- package/styles/datepicker/icons/_fluent2.scss +52 -0
- package/styles/datepicker/icons/_fusionnew.scss +52 -76
- package/styles/datepicker/icons/_highcontrast-light.scss +50 -72
- package/styles/datepicker/icons/_highcontrast.scss +50 -72
- package/styles/datepicker/icons/_material-dark.scss +59 -99
- package/styles/datepicker/icons/_material.scss +59 -99
- package/styles/datepicker/icons/_material3.scss +50 -79
- package/styles/datepicker/icons/_tailwind.scss +52 -76
- package/styles/datepicker/icons/_tailwind4.scss +52 -0
- package/styles/datepicker/material-dark.css +2 -60
- package/styles/datepicker/material.css +2 -60
- package/styles/datepicker/material3-dark.css +4 -52
- package/styles/datepicker/material3-dark.scss +1 -1
- package/styles/datepicker/material3.css +4 -52
- package/styles/datepicker/material3.scss +1 -1
- package/styles/datepicker/tailwind-dark.css +2 -50
- package/styles/datepicker/tailwind.css +2 -50
- package/styles/daterangepicker/_all.scss +2 -2
- package/styles/daterangepicker/_bds-definition.scss +294 -294
- package/styles/daterangepicker/_bigger.scss +971 -0
- package/styles/daterangepicker/_bootstrap-dark-definition.scss +258 -258
- package/styles/daterangepicker/_bootstrap-definition.scss +258 -258
- package/styles/daterangepicker/_bootstrap4-definition.scss +268 -268
- package/styles/daterangepicker/_bootstrap5-definition.scss +296 -296
- package/styles/daterangepicker/_bootstrap5.3-definition.scss +298 -0
- package/styles/daterangepicker/_fabric-dark-definition.scss +261 -261
- package/styles/daterangepicker/_fabric-definition.scss +258 -258
- package/styles/daterangepicker/_fluent-definition.scss +313 -322
- package/styles/daterangepicker/_fluent2-definition.scss +305 -0
- package/styles/daterangepicker/_fusionnew-definition.scss +295 -295
- package/styles/daterangepicker/_highcontrast-definition.scss +258 -258
- package/styles/daterangepicker/_highcontrast-light-definition.scss +261 -261
- package/styles/daterangepicker/_layout.scss +790 -1030
- package/styles/daterangepicker/_material-dark-definition.scss +266 -266
- package/styles/daterangepicker/_material-definition.scss +266 -266
- package/styles/daterangepicker/_material3-definition.scss +262 -282
- package/styles/daterangepicker/_tailwind-definition.scss +287 -287
- package/styles/daterangepicker/_tailwind4-definition.scss +298 -0
- package/styles/daterangepicker/_theme.scss +415 -455
- package/styles/daterangepicker/bootstrap-dark.css +67 -479
- package/styles/daterangepicker/bootstrap.css +67 -478
- package/styles/daterangepicker/bootstrap4.css +67 -483
- package/styles/daterangepicker/bootstrap5-dark.css +67 -483
- package/styles/daterangepicker/bootstrap5.css +67 -483
- package/styles/daterangepicker/fabric-dark.css +67 -473
- package/styles/daterangepicker/fabric.css +67 -473
- package/styles/daterangepicker/fluent-dark.css +66 -502
- package/styles/daterangepicker/fluent.css +66 -502
- package/styles/daterangepicker/fluent2.css +1998 -0
- package/styles/daterangepicker/fluent2.scss +7 -0
- package/styles/daterangepicker/highcontrast-light.css +67 -473
- package/styles/daterangepicker/highcontrast.css +67 -473
- package/styles/daterangepicker/icons/_bds.scss +74 -92
- package/styles/daterangepicker/icons/_bootstrap-dark.scss +61 -85
- package/styles/daterangepicker/icons/_bootstrap.scss +69 -85
- package/styles/daterangepicker/icons/_bootstrap4.scss +75 -94
- package/styles/daterangepicker/icons/_bootstrap5.3.scss +74 -0
- package/styles/daterangepicker/icons/_bootstrap5.scss +74 -92
- package/styles/daterangepicker/icons/_fabric-dark.scss +69 -85
- package/styles/daterangepicker/icons/_fabric.scss +69 -85
- package/styles/daterangepicker/icons/_fluent.scss +74 -92
- package/styles/daterangepicker/icons/_fluent2.scss +91 -0
- package/styles/daterangepicker/icons/_fusionnew.scss +74 -92
- package/styles/daterangepicker/icons/_highcontrast-light.scss +69 -85
- package/styles/daterangepicker/icons/_highcontrast.scss +69 -85
- package/styles/daterangepicker/icons/_material-dark.scss +85 -119
- package/styles/daterangepicker/icons/_material.scss +85 -119
- package/styles/daterangepicker/icons/_material3.scss +90 -129
- package/styles/daterangepicker/icons/_tailwind.scss +74 -92
- package/styles/daterangepicker/icons/_tailwind4.scss +74 -0
- package/styles/daterangepicker/material-dark.css +67 -490
- package/styles/daterangepicker/material.css +67 -495
- package/styles/daterangepicker/material3-dark.css +70 -504
- package/styles/daterangepicker/material3-dark.scss +1 -1
- package/styles/daterangepicker/material3.css +70 -504
- package/styles/daterangepicker/material3.scss +1 -1
- package/styles/daterangepicker/tailwind-dark.css +66 -478
- package/styles/daterangepicker/tailwind.css +66 -478
- package/styles/datetimepicker/_all.scss +2 -2
- package/styles/datetimepicker/_bds-definition.scss +65 -65
- package/styles/datetimepicker/_bigger.scss +105 -0
- package/styles/datetimepicker/_bootstrap-dark-definition.scss +60 -60
- package/styles/datetimepicker/_bootstrap-definition.scss +59 -59
- package/styles/datetimepicker/_bootstrap4-definition.scss +65 -65
- package/styles/datetimepicker/_bootstrap5-definition.scss +65 -65
- package/styles/datetimepicker/_bootstrap5.3-definition.scss +65 -0
- package/styles/datetimepicker/_fabric-dark-definition.scss +60 -60
- package/styles/datetimepicker/_fabric-definition.scss +57 -57
- package/styles/datetimepicker/_fluent-definition.scss +65 -65
- package/styles/datetimepicker/_fluent2-definition.scss +65 -0
- package/styles/datetimepicker/_fusionnew-definition.scss +65 -65
- package/styles/datetimepicker/_highcontrast-definition.scss +57 -57
- package/styles/datetimepicker/_highcontrast-light-definition.scss +60 -60
- package/styles/datetimepicker/_layout.scss +179 -238
- package/styles/datetimepicker/_material-dark-definition.scss +64 -64
- package/styles/datetimepicker/_material-definition.scss +62 -62
- package/styles/datetimepicker/_material3-definition.scss +61 -71
- package/styles/datetimepicker/_tailwind-definition.scss +65 -65
- package/styles/datetimepicker/_tailwind4-definition.scss +65 -0
- package/styles/datetimepicker/_theme.scss +70 -70
- package/styles/datetimepicker/bootstrap-dark.css +23 -42
- package/styles/datetimepicker/bootstrap.css +23 -42
- package/styles/datetimepicker/bootstrap4.css +23 -42
- package/styles/datetimepicker/bootstrap5-dark.css +23 -42
- package/styles/datetimepicker/bootstrap5.css +23 -42
- package/styles/datetimepicker/fabric-dark.css +23 -42
- package/styles/datetimepicker/fabric.css +23 -42
- package/styles/datetimepicker/fluent-dark.css +23 -42
- package/styles/datetimepicker/fluent.css +23 -42
- package/styles/datetimepicker/fluent2.css +1373 -0
- package/styles/datetimepicker/fluent2.scss +8 -0
- package/styles/datetimepicker/highcontrast-light.css +23 -42
- package/styles/datetimepicker/highcontrast.css +23 -42
- package/styles/datetimepicker/icons/_bds.scss +11 -11
- package/styles/datetimepicker/icons/_bootstrap-dark.scss +11 -11
- package/styles/datetimepicker/icons/_bootstrap.scss +11 -11
- package/styles/datetimepicker/icons/_bootstrap4.scss +11 -11
- package/styles/datetimepicker/icons/_bootstrap5.3.scss +11 -0
- package/styles/datetimepicker/icons/_bootstrap5.scss +11 -11
- package/styles/datetimepicker/icons/_fabric-dark.scss +11 -11
- package/styles/datetimepicker/icons/_fabric.scss +11 -11
- package/styles/datetimepicker/icons/_fluent.scss +11 -11
- package/styles/datetimepicker/icons/_fluent2.scss +11 -0
- package/styles/datetimepicker/icons/_fusionnew.scss +11 -11
- package/styles/datetimepicker/icons/_highcontrast-light.scss +11 -11
- package/styles/datetimepicker/icons/_highcontrast.scss +11 -11
- package/styles/datetimepicker/icons/_material-dark.scss +31 -53
- package/styles/datetimepicker/icons/_material.scss +40 -62
- package/styles/datetimepicker/icons/_material3.scss +11 -11
- package/styles/datetimepicker/icons/_tailwind.scss +11 -11
- package/styles/datetimepicker/icons/_tailwind4.scss +11 -0
- package/styles/datetimepicker/material-dark.css +23 -66
- package/styles/datetimepicker/material.css +23 -66
- package/styles/datetimepicker/material3-dark.css +24 -54
- package/styles/datetimepicker/material3-dark.scss +1 -1
- package/styles/datetimepicker/material3.css +24 -54
- package/styles/datetimepicker/material3.scss +1 -1
- package/styles/datetimepicker/tailwind-dark.css +23 -42
- package/styles/datetimepicker/tailwind.css +23 -42
- package/styles/fabric-dark.css +191 -980
- package/styles/fabric-dark.scss +20 -5
- package/styles/fabric.css +192 -984
- package/styles/fabric.scss +20 -5
- package/styles/fluent-dark.css +208 -1061
- package/styles/fluent-dark.scss +20 -5
- package/styles/fluent.css +208 -1061
- package/styles/fluent.scss +20 -5
- package/styles/fluent2.css +3549 -0
- package/styles/fluent2.scss +20 -0
- package/styles/highcontrast-light.css +190 -978
- package/styles/highcontrast-light.scss +20 -5
- package/styles/highcontrast.css +192 -984
- package/styles/highcontrast.scss +20 -5
- package/styles/material-dark.css +192 -1075
- package/styles/material-dark.scss +20 -5
- package/styles/material.css +192 -1106
- package/styles/material.scss +20 -5
- package/styles/material3-dark.css +194 -1083
- package/styles/material3-dark.scss +20 -5
- package/styles/material3.css +194 -1083
- package/styles/material3.scss +20 -5
- package/styles/tailwind-dark.css +192 -1046
- package/styles/tailwind-dark.scss +20 -5
- package/styles/tailwind.css +192 -1046
- package/styles/tailwind.scss +20 -5
- package/styles/timepicker/_all.scss +2 -2
- package/styles/timepicker/_bds-definition.scss +84 -84
- package/styles/timepicker/_bigger.scss +92 -0
- package/styles/timepicker/_bootstrap-dark-definition.scss +80 -80
- package/styles/timepicker/_bootstrap-definition.scss +77 -77
- package/styles/timepicker/_bootstrap4-definition.scss +85 -85
- package/styles/timepicker/_bootstrap5-definition.scss +86 -86
- package/styles/timepicker/_bootstrap5.3-definition.scss +85 -0
- package/styles/timepicker/_fabric-dark-definition.scss +80 -80
- package/styles/timepicker/_fabric-definition.scss +77 -77
- package/styles/timepicker/_fluent-definition.scss +86 -86
- package/styles/timepicker/_fluent2-definition.scss +84 -0
- package/styles/timepicker/_fusionnew-definition.scss +86 -86
- package/styles/timepicker/_highcontrast-definition.scss +77 -77
- package/styles/timepicker/_highcontrast-light-definition.scss +80 -80
- package/styles/timepicker/_layout.scss +227 -303
- package/styles/timepicker/_material-dark-definition.scss +84 -84
- package/styles/timepicker/_material-definition.scss +81 -81
- package/styles/timepicker/_material3-definition.scss +83 -99
- package/styles/timepicker/_tailwind-definition.scss +84 -84
- package/styles/timepicker/_tailwind4-definition.scss +86 -0
- package/styles/timepicker/_theme.scss +109 -114
- package/styles/timepicker/bootstrap-dark.css +1 -42
- package/styles/timepicker/bootstrap.css +1 -42
- package/styles/timepicker/bootstrap4.css +1 -42
- package/styles/timepicker/bootstrap5-dark.css +1 -42
- package/styles/timepicker/bootstrap5.css +1 -42
- package/styles/timepicker/fabric-dark.css +1 -42
- package/styles/timepicker/fabric.css +1 -42
- package/styles/timepicker/fluent-dark.css +1 -42
- package/styles/timepicker/fluent.css +1 -42
- package/styles/timepicker/fluent2.css +1470 -0
- package/styles/timepicker/fluent2.scss +6 -0
- package/styles/timepicker/highcontrast-light.css +1 -42
- package/styles/timepicker/highcontrast.css +1 -42
- package/styles/timepicker/icons/_bds.scss +24 -24
- package/styles/timepicker/icons/_bootstrap-dark.scss +23 -23
- package/styles/timepicker/icons/_bootstrap.scss +24 -24
- package/styles/timepicker/icons/_bootstrap4.scss +24 -24
- package/styles/timepicker/icons/_bootstrap5.3.scss +24 -0
- package/styles/timepicker/icons/_bootstrap5.scss +24 -24
- package/styles/timepicker/icons/_fabric-dark.scss +24 -24
- package/styles/timepicker/icons/_fabric.scss +24 -24
- package/styles/timepicker/icons/_fluent.scss +24 -24
- package/styles/timepicker/icons/_fluent2.scss +24 -0
- package/styles/timepicker/icons/_fusionnew.scss +24 -24
- package/styles/timepicker/icons/_highcontrast-light.scss +24 -24
- package/styles/timepicker/icons/_highcontrast.scss +24 -24
- package/styles/timepicker/icons/_material-dark.scss +37 -52
- package/styles/timepicker/icons/_material.scss +39 -54
- package/styles/timepicker/icons/_material3.scss +24 -24
- package/styles/timepicker/icons/_tailwind.scss +24 -24
- package/styles/timepicker/icons/_tailwind4.scss +24 -0
- package/styles/timepicker/material-dark.css +1 -59
- package/styles/timepicker/material.css +1 -59
- package/styles/timepicker/material3-dark.css +2 -51
- package/styles/timepicker/material3-dark.scss +1 -1
- package/styles/timepicker/material3.css +2 -51
- package/styles/timepicker/material3.scss +1 -1
- package/styles/timepicker/tailwind-dark.css +1 -42
- package/styles/timepicker/tailwind.css +1 -42
- package/.eslintrc.json +0 -260
- package/dist/ej2-calendars.min.js +0 -10
- package/dist/global/ej2-calendars.min.js +0 -11
- package/dist/global/ej2-calendars.min.js.map +0 -1
- package/dist/global/index.d.ts +0 -14
- package/tslint.json +0 -111
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* filename: ej2-calendars.umd.min.js
|
|
3
|
-
* version : 25.2.4
|
|
4
|
-
* Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
|
|
5
|
-
* Use of this code is subject to the terms of our license.
|
|
6
|
-
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
|
-
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
|
-
* applicable laws.
|
|
9
|
-
*/
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-lists")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-popups","@syncfusion/ej2-inputs","@syncfusion/ej2-buttons","@syncfusion/ej2-lists"],t):t(e.ej={},e.ej2Base,e.ej2Popups,e.ej2Inputs,e.ej2Buttons,e.ej2Lists)}(this,function(e,t,i,s,a,n){"use strict";var r=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)}}(),l=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},o="e-other-month",h="e-other-year",u="e-calendar",d="e-calendar-content-table",p="e-year",c="e-month",m="e-disabled",f="e-overlay",v="e-week-number",y="e-selected",g="e-focused-date",b="e-focused-cell",D="e-month-hide",E="e-zoomin",C="e-calendar-day-header-lg",k=function(e){function i(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 r(i,e),i.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 t.Internationalization(this.locale),(t.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(u),this.enableRtl&&this.element.classList.add("e-rtl"),t.Browser.isDevice&&this.element.classList.add("e-device"),t.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(u),this.enableRtl&&this.calendarElement.classList.add("e-rtl"),t.Browser.isDevice&&this.calendarElement.classList.add("e-device"),t.attributes(this.calendarElement,{"data-role":"calendar"})),!t.isNullOrUndefined(t.closest(this.element,"fieldset"))&&t.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.createHeader(),this.createContent(),this.wireEvents()},i.prototype.rangeValidation=function(e,i){t.isNullOrUndefined(e)&&this.setProperties({min:new Date(1900,0,1)},!0),t.isNullOrUndefined(i)&&this.setProperties({max:new Date(2099,11,31)},!0)},i.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},i.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)),!t.isNullOrUndefined(e)&&this.min<=this.max&&e>=this.min&&e<=this.max&&(this.currentDate=new Date(this.checkValue(e)))},i.prototype.setOverlayIndex=function(e,i,s,a){if(a&&!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(s)&&!t.isNullOrUndefined(e)){var n=parseInt(i.style.zIndex,10)?parseInt(i.style.zIndex,10):1e3;s.style.zIndex=(n-1).toString(),e.style.zIndex=n.toString()}},i.prototype.minMaxUpdate=function(e){+this.min<=+this.max?t.removeClass([this.element],f):(this.setProperties({min:this.min},!0),t.addClass([this.element],f)),this.min=t.isNullOrUndefined(this.min)||!+this.min?this.min=new Date(1900,0,1):this.min,this.max=t.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)))},i.prototype.createHeader=function(){var e={tabindex:"0"};this.headerElement=this.createElement("div",{className:"e-header"});var i=this.createElement("div",{className:"e-icon-container"});this.previousIcon=this.createElement("button",{className:"e-prev",attrs:{type:"button"}}),t.rippleEffect(this.previousIcon,{duration:400,selector:".e-prev",isCenterRipple:!0}),t.attributes(this.previousIcon,{"aria-disabled":"false","aria-label":"previous month"}),t.attributes(this.previousIcon,e),this.nextIcon=this.createElement("button",{className:"e-next",attrs:{type:"button"}}),t.rippleEffect(this.nextIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),"daterangepicker"===this.getModuleName()&&(t.attributes(this.previousIcon,{tabIndex:"-1"}),t.attributes(this.nextIcon,{tabIndex:"-1"})),t.attributes(this.nextIcon,{"aria-disabled":"false","aria-label":"next month"}),t.attributes(this.nextIcon,e),this.headerTitleElement=this.createElement("div",{className:"e-day e-title"}),t.attributes(this.headerTitleElement,{"aria-atomic":"true","aria-live":"assertive","aria-label":"title"}),t.attributes(this.headerTitleElement,e),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"})),i.appendChild(this.previousIcon),i.appendChild(this.nextIcon),this.headerElement.appendChild(i),"calendar"===this.getModuleName()?this.element.appendChild(this.headerElement):this.calendarElement.appendChild(this.headerElement),this.adjustLongHeaderSize()},i.prototype.createContent=function(){this.contentElement=this.createElement("div",{className:"e-content"}),this.table=this.createElement("table",{attrs:{class:d,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()&&(t.EventHandler.add(this.table,"focus",this.addContentFocus,this),t.EventHandler.add(this.table,"blur",this.removeContentFocus,this))},i.prototype.addContentFocus=function(e){var i=this.tableBodyElement.querySelector("tr td.e-focused-date"),s=this.tableBodyElement.querySelector("tr td.e-selected");t.isNullOrUndefined(s)?t.isNullOrUndefined(i)||i.classList.add(b):s.classList.add(b)},i.prototype.removeContentFocus=function(e){var i=t.isNullOrUndefined(this.tableBodyElement)?null:this.tableBodyElement.querySelector("tr td.e-focused-date"),s=t.isNullOrUndefined(this.tableBodyElement)?null:this.tableBodyElement.querySelector("tr td.e-selected");t.isNullOrUndefined(s)?t.isNullOrUndefined(i)||i.classList.remove(b):s.classList.remove(b)},i.prototype.getCultureValues=function(){var e,i=[],s="days.stand-alone."+this.dayHeaderFormat.toLowerCase();if(e="en"===this.locale||"en-US"===this.locale?t.getValue(s,t.getDefaultDateObject()):this.getCultureObjects(t.cldrData,""+this.locale),!t.isNullOrUndefined(e))for(var a=0,n=Object.keys(e);a<n.length;a++){var r=n[a];i.push(t.getValue(r,e))}return i},i.prototype.toCapitalize=function(e){return!t.isNullOrUndefined(e)&&e.length?e[0].toUpperCase()+e.slice(1):e},i.prototype.createContentHeader=function(){"calendar"===this.getModuleName()?t.isNullOrUndefined(this.element.querySelectorAll(".e-content .e-week-header")[0])||t.detach(this.element.querySelectorAll(".e-content .e-week-header")[0]):t.isNullOrUndefined(this.calendarElement.querySelectorAll(".e-content .e-week-header")[0])||t.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()?t.addClass([this.element],""+v):t.addClass([this.calendarElement],""+v));var i=this.getCultureValues().length>0&&this.getCultureValues()?this.shiftArray(this.getCultureValues().length>0&&this.getCultureValues(),this.firstDayOfWeek):null;if(!t.isNullOrUndefined(i))for(var s=0;s<=6;s++)e+='<th class="">'+this.toCapitalize(i[s])+"</th>";e="<tr>"+e+"</tr>",this.tableHeadElement.innerHTML=e,this.table.appendChild(this.tableHeadElement)},i.prototype.createContentBody=function(){switch("calendar"===this.getModuleName()?t.isNullOrUndefined(this.element.querySelectorAll(".e-content tbody")[0])||t.detach(this.element.querySelectorAll(".e-content tbody")[0]):t.isNullOrUndefined(this.calendarElement.querySelectorAll(".e-content tbody")[0])||t.detach(this.calendarElement.querySelectorAll(".e-content tbody")[0]),this.start){case"Year":this.renderYears();break;case"Decade":this.renderDecades();break;default:this.renderMonths()}},i.prototype.updateFooter=function(){this.todayElement.textContent=this.l10.getConstant("today"),this.todayElement.setAttribute("aria-label",this.l10.getConstant("today")),this.todayElement.setAttribute("tabindex","0")},i.prototype.createContentFooter=function(){if(this.showTodayButton){var e=new Date(+this.min),i=new Date(+this.max);this.globalize=new t.Internationalization(this.locale),this.l10=new t.L10n(this.getModuleName(),{today:"Today"},this.locale),this.todayElement=this.createElement("button",{attrs:{role:"button"}}),t.rippleEffect(this.todayElement),this.updateFooter(),t.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(i.setHours(0,0,0,0))&&!this.todayDisabled||t.addClass([this.todayElement],m),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(m)||t.EventHandler.add(this.todayElement,"click",this.todayButtonClick,this)}},i.prototype.wireEvents=function(e,i,s,a){t.EventHandler.add(this.headerTitleElement,"click",this.navigateTitle,this),this.defaultKeyConfigs=t.extend(this.defaultKeyConfigs,this.keyConfigs),"calendar"===this.getModuleName()?this.keyboardModule=new t.KeyboardEvents(this.element,{eventName:"keydown",keyAction:this.keyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs}):this.keyboardModule=new t.KeyboardEvents(this.calendarElement,{eventName:"keydown",keyAction:this.keyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})},i.prototype.dateWireEvents=function(e,i,s,a){this.defaultKeyConfigs=this.getDefaultKeyConfig(),this.defaultKeyConfigs=t.extend(this.defaultKeyConfigs,s),this.serverModuleName=a},i.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))},i.prototype.resetCalendar=function(){this.calendarElement&&t.detach(this.calendarElement),this.tableBodyElement&&t.detach(this.tableBodyElement),this.table&&t.detach(this.table),this.tableHeadElement&&t.detach(this.tableHeadElement),this.nextIcon&&t.detach(this.nextIcon),this.previousIcon&&t.detach(this.previousIcon),this.footer&&t.detach(this.footer),this.todayElement=null,this.renderDayCellArgs=null,this.calendarElement=this.tableBodyElement=this.footer=this.tableHeadElement=this.nextIcon=this.previousIcon=this.table=null},i.prototype.keyActionHandle=function(e,i,s){var a,n=this.tableBodyElement.querySelector("tr td.e-focused-date");a=s?t.isNullOrUndefined(n)||+i!==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()&&!t.isNullOrUndefined(e.target)&&e.target.classList.length>0&&e.target.classList.contains(d)&&(this.keyboardNavigate(-1,r,e,this.max,this.min),e.preventDefault());break;case"moveRight":"daterangepicker"!=this.getModuleName()&&!t.isNullOrUndefined(e.target)&&e.target.classList.length>0&&e.target.classList.contains(d)&&(this.keyboardNavigate(1,r,e,this.max,this.min),e.preventDefault());break;case"moveUp":"daterangepicker"!=this.getModuleName()&&!t.isNullOrUndefined(e.target)&&e.target.classList.length>0&&e.target.classList.contains(d)&&(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()&&!t.isNullOrUndefined(e.target)&&e.target.classList.length>0&&e.target.classList.contains(d)&&(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)this.navigatePrevious(e);else if(e.target===this.nextIcon)this.navigateNext(e);else if(e.target===this.todayElement)this.todayButtonClick(e,i),"datepicker"!==this.getModuleName()&&"datetimepicker"!==this.getModuleName()||this.element.focus();else{var h=t.isNullOrUndefined(n)?a:n;if(!t.isNullOrUndefined(h)&&!h.classList.contains(m)){if(o){var u=new Date(parseInt(""+h.id,0));this.selectDate(e,u,h)}else this.contentClick(null,--r,h,i);"datepicker"!==this.getModuleName()&&"datetimepicker"!==this.getModuleName()||this.element.focus()}}break;case"controlUp":this.title(),e.preventDefault();break;case"controlDown":(t.isNullOrUndefined(n)||o)&&(t.isNullOrUndefined(a)||o)||this.contentClick(null,--r,n||a,i),e.preventDefault();break;case"home":this.currentDate=this.firstDay(this.currentDate),t.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),t.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.element.focus(),this.hide());break;case"shiftTab":"datepicker"!==this.getModuleName()&&"datetimepicker"!==this.getModuleName()||e.target!==this.headerTitleElement||(e.preventDefault(),this.element.focus(),this.hide())}},i.prototype.keyboardNavigate=function(e,i,s,a,n){var r=new Date(this.checkValue(this.currentDate));switch(i){case 2:this.addYears(this.currentDate,e),this.isMonthYearRange(this.currentDate)?(t.detach(this.tableBodyElement),this.renderDecades(s)):this.currentDate=r;break;case 1:this.addMonths(this.currentDate,e),this.calendarMode,this.isMonthYearRange(this.currentDate)?(t.detach(this.tableBodyElement),this.renderYears(s)):this.currentDate=r;break;case 0:this.addDay(this.currentDate,e,s,a,n),this.isMinMaxRange(this.currentDate)?(t.detach(this.tableBodyElement),this.renderMonths(s)):this.currentDate=r}},i.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)}},i.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},i.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,c,e,t):this.islamicModule.islamicRenderTemplate(s,a,c,e,t)},i.prototype.renderDays=function(e,i,s,a,n,r){var l,h=[],u=n?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 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(d.getFullYear(),d.getMonth(),d.getDate()+E);D.textContent=""+this.getWeek(C),b.appendChild(D),t.addClass([b],""+v),h.push(b)}l=new Date(+d),d=this.minMaxDate(d);var k={type:"dateTime",skeleton:"full"},M=this.globalize.parseDate(this.globalize.formatDate(d,k),k),w=this.dayCell(d),V=this.globalize.formatDate(d,{type:"date",skeleton:"full"}),N=this.createElement("span");N.textContent=this.globalize.formatDate(d,{format:"d",type:"date",skeleton:"yMd"});var O=this.min>d||this.max<d;O?(t.addClass([w],m),t.addClass([w],f)):N.setAttribute("title",""+V),p!==d.getMonth()&&(t.addClass([w],o),N.setAttribute("aria-disabled","true")),0!==d.getDay()&&6!==d.getDay()||t.addClass([w],"e-weekend"),w.appendChild(N),this.renderDayCellArgs={date:d,isDisabled:!1,element:w,isOutOfRange:O};var I=this.renderDayCellArgs;if(this.renderDayCellEvent(I),I.isDisabled){var T=new Date(this.checkValue(i)),x=new Date(this.checkValue(I.date));if(s){if(!t.isNullOrUndefined(a)&&a.length>0)for(var S=0;S<a.length;S++){+new Date(this.globalize.formatDate(I.date,{type:"date",skeleton:"yMd"}))===+new Date(this.globalize.formatDate(a[S],{type:"date",skeleton:"yMd"}))&&(a.splice(S,1),S=-1)}}else T&&+T==+x&&this.setProperties({value:null},!0)}this.renderDayCellArgs.isDisabled&&!w.classList.contains(y)&&(t.addClass([w],m),t.addClass([w],f),N.setAttribute("aria-disabled","true"),+this.renderDayCellArgs.date==+this.todayDate&&(this.todayDisabled=!0));var P=w.classList.contains(o),A=w.classList.contains(m);A||t.EventHandler.add(w,"click",this.clickHandler,this);var U=void 0;if(t.isNullOrUndefined(r)||"click"!==r.type||(U=r.currentTarget),!s||t.isNullOrUndefined(a)||A)!A&&this.getDateVal(d,i)&&t.addClass([w],y);else{for(var H=0;H<a.length;H++){var W={format:null,type:"date",skeleton:"short",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"};if((this.globalize.formatDate(d,W)===this.globalize.formatDate(a[H],W)&&this.getDateVal(d,a[H])||this.getDateVal(d,i))&&t.addClass([w],y),!t.isNullOrUndefined(U)&&U.innerText===w.innerText&&this.previousDates&&w.classList.contains(y)&&U.classList.contains(y)){t.removeClass([w],y),this.previousDates=!1;for(var L=this.copyValues(a),F=0;F<L.length;F++){var B={format:null,type:"date",skeleton:"short",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"};if(this.globalize.formatDate(M,B)===this.globalize.formatDate(L[F],B)){S=L.indexOf(L[F]);L.splice(S,1),a.splice(S,1)}}this.setProperties({values:L},!0)}else this.updateFocus(P,A,d,w,e)}a.length<=0&&this.updateFocus(P,A,d,w,e)}this.updateFocus(P,A,d,w,e),t.isNullOrUndefined(M)||M.getFullYear()!==u.getFullYear()||M.getMonth()!==u.getMonth()||M.getDate()!==u.getDate()||t.addClass([w],"e-today"),h.push(this.renderDayCellArgs.element),d=new Date(+l),this.addDay(d,1,null,this.max,this.min)}return h},i.prototype.updateFocus=function(e,i,s,a,n){n.getDate()!==s.getDate()||e||i?(n>=this.max&&parseInt(a.id,0)===+this.max&&!e&&!i&&t.addClass([a],g),n<=this.min&&parseInt(a.id,0)===+this.min&&!e&&!i&&t.addClass([a],g)):t.addClass([a],g)},i.prototype.renderYears=function(e,i){this.removeTableHeadElement();var s=[],a=t.isNullOrUndefined(i),n=new Date(this.checkValue(this.currentDate)),r=n.getMonth(),l=n.getFullYear(),o=n,h=o.getFullYear(),u=new Date(this.checkValue(this.min)).getFullYear(),d=new Date(this.checkValue(this.min)).getMonth(),c=new Date(this.checkValue(this.max)).getFullYear(),f=new Date(this.checkValue(this.max)).getMonth();o.setMonth(0),this.titleUpdate(this.currentDate,"months"),o.setDate(1);for(var v=0;v<12;++v){var b=this.dayCell(o),D=this.createElement("span"),E=i&&i.getMonth()===o.getMonth(),C=i&&i.getFullYear()===l&&E,k=this.globalize.formatDate(o,{type:"date",format:"MMM y"});D.textContent=this.toCapitalize(this.globalize.formatDate(o,{format:null,type:"dateTime",skeleton:"MMM"})),this.min&&(h<u||v<d&&h===u)||this.max&&(h>c||v>f&&h>=c)?t.addClass([b],m):!a&&C?t.addClass([b],y):o.getMonth()===r&&this.currentDate.getMonth()===r&&t.addClass([b],g),o.setDate(1),o.setMonth(o.getMonth()+1),b.classList.contains(m)||(t.EventHandler.add(b,"click",this.clickHandler,this),D.setAttribute("title",""+k)),b.appendChild(D),s.push(b)}this.renderTemplate(s,4,p,e,i)},i.prototype.renderDecades=function(e,i){this.removeTableHeadElement();var s=[],a=new Date(this.checkValue(this.currentDate));a.setMonth(0),a.setDate(1);var n=a.getFullYear(),r=new Date(a.setFullYear(n-n%10)),l=new Date(a.setFullYear(n-n%10+9)),o=r.getFullYear(),u=l.getFullYear(),d=this.globalize.formatDate(r,{format:null,type:"dateTime",skeleton:"y"}),p=this.globalize.formatDate(l,{format:null,type:"dateTime",skeleton:"y"});this.headerTitleElement.textContent=d+" - "+p;for(var c=new Date(n-n%10-1,0,1).getFullYear(),f=0;f<12;++f){var v=c+f;a.setFullYear(v);var b=this.dayCell(a),D=this.createElement("span");D.textContent=this.globalize.formatDate(a,{format:null,type:"dateTime",skeleton:"y"}),v<o||v>u?(t.addClass([b],h),D.setAttribute("aria-disabled","true"),t.isNullOrUndefined(i)||a.getFullYear()!==i.getFullYear()||t.addClass([b],y),(v<new Date(this.checkValue(this.min)).getFullYear()||v>new Date(this.checkValue(this.max)).getFullYear())&&t.addClass([b],m)):v<new Date(this.checkValue(this.min)).getFullYear()||v>new Date(this.checkValue(this.max)).getFullYear()?t.addClass([b],m):t.isNullOrUndefined(i)||a.getFullYear()!==i.getFullYear()?a.getFullYear()!==this.currentDate.getFullYear()||b.classList.contains(m)||t.addClass([b],g):t.addClass([b],y),b.classList.contains(m)||(t.EventHandler.add(b,"click",this.clickHandler,this),D.setAttribute("title",""+D.textContent)),b.appendChild(D),s.push(b)}this.renderTemplate(s,4,"e-decade",e,i)},i.prototype.dayCell=function(e){var i,s={skeleton:"full",type:"dateTime",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"},a=this.globalize.parseDate(this.globalize.formatDate(e,s),s);t.isNullOrUndefined(a)||(i=a.valueOf());var n={className:"e-cell",attrs:{id:""+t.getUniqueID(""+i),"aria-selected":"false"}};return this.createElement("td",n)},i.prototype.firstDay=function(e){var t="Decade"!==this.currentView()?this.tableBodyElement.querySelectorAll("td:not(."+o):this.tableBodyElement.querySelectorAll("td:not(."+h);if(t.length)for(var i=0;i<t.length;i++)if(!t[i].classList.contains(m)){e=new Date(parseInt(t[i].id,0));break}return e},i.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))},i.prototype.checkDateValue=function(e){return!t.isNullOrUndefined(e)&&e instanceof Date&&!isNaN(+e)?e:null},i.prototype.findLastDay=function(e){var t="Decade"===this.currentView()?this.tableBodyElement.querySelectorAll("td:not(."+h):this.tableBodyElement.querySelectorAll("td:not(."+o);if(t.length)for(var i=t.length-1;i>=0;i--)if(!t[i].classList.contains(m)){e=new Date(parseInt(t[i].id,0));break}return e},i.prototype.removeTableHeadElement=function(){"calendar"===this.getModuleName()?t.isNullOrUndefined(this.element.querySelectorAll(".e-content table thead")[0])||t.detach(this.tableHeadElement):t.isNullOrUndefined(this.calendarElement.querySelectorAll(".e-content table thead")[0])||t.detach(this.tableHeadElement)},i.prototype.renderTemplate=function(e,i,s,a,n){var r,l=this.getViewNumber(this.currentView());this.tableBodyElement=this.createElement("tbody"),this.table.appendChild(this.tableBodyElement),t.removeClass([this.contentElement,this.headerElement],[c,"e-decade",p]),t.addClass([this.contentElement,this.headerElement],[s]);for(var h=i,u=0,d=0;d<e.length/i;++d){for(r=this.createElement("tr"),u=0+u;u<h;u++)e[u].classList.contains("e-week-number")||t.isNullOrUndefined(e[u].children[0])||(t.addClass([e[u].children[0]],["e-day"]),t.rippleEffect(e[u].children[0],{duration:600,isCenterRipple:!0})),r.appendChild(e[u]),this.weekNumber&&7===u&&e[7].classList.contains(o)&&t.addClass([r],D),!this.weekNumber&&6===u&&e[6].classList.contains(o)&&t.addClass([r],D),this.weekNumber?41===u&&e[41].classList.contains(o)&&t.addClass([r],D):35===u&&e[35].classList.contains(o)&&t.addClass([r],D);h+=i,u+=0,this.tableBodyElement.appendChild(r)}this.table.querySelector("tbody").className=this.effect,"Gregorian"===this.calendarMode?this.iconHandler():this.islamicModule.islamicIconHandler(),(l!==this.getViewNumber(this.currentView())||0===l&&l!==this.getViewNumber(this.currentView()))&&this.navigateHandler(a),this.setAriaActiveDescendant()},i.prototype.clickHandler=function(e,t){this.clickEventEmitter(e);var i=e.currentTarget,s=this.getViewNumber(this.currentView());i.classList.contains(o)?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(o)||0!==s?this.contentClick(e,0,i,t):this.selectDate(e,this.getIdValue(e,null),null),"calendar"===this.getModuleName()&&this.table.focus()},i.prototype.clickEventEmitter=function(e){e.preventDefault()},i.prototype.contentClick=function(e,i,s,a){var n=this.getViewNumber(this.currentView()),r=this.getIdValue(e,s);switch(i){case 0:n===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth)?(t.detach(this.tableBodyElement),this.currentDate=r,this.effect=E,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=E,t.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=E,t.detach(this.tableBodyElement),this.renderYears(e)}}},i.prototype.switchView=function(e,i,s,a){switch(e){case 0:t.detach(this.tableBodyElement),this.renderMonths(i,null,a);break;case 1:t.detach(this.tableBodyElement),this.renderYears(i);break;case 2:t.detach(this.tableBodyElement),this.renderDecades(i)}},i.prototype.getModuleName=function(){return"calendar"},i.prototype.requiredModules=function(){var e=[];return"Islamic"===this.calendarMode&&e.push({args:[this],member:"islamic",name:"Islamic"}),e},i.prototype.getPersistData=function(){return this.addOnPersist(["value"])},i.prototype.onPropertyChanged=function(e,i,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.createContentHeader():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&&t.detach(this.tableBodyElement),this.minMaxUpdate(),s&&this.validateValues(s,a),"datepicker"!==this.getModuleName()?this.createContentBody():this.calendarElement&&this.createContentBody(),(this.todayDate<this.min||this.max<this.todayDate)&&this.footer&&this.todayElement?(t.detach(this.todayElement),t.detach(this.footer),this.todayElement=this.footer=null,this.createContentFooter()):this.footer&&this.todayElement&&this.todayElement.classList.contains("e-disabled")&&(t.removeClass([this.todayElement],m),t.detach(this.todayElement),t.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 t.Internationalization(this.locale),"datepicker"!==this.getModuleName()?(this.createContentHeader(),this.createContentBody()):this.calendarElement&&(this.createContentHeader(),this.createContentBody()),"calendar"===this.getModuleName()){this.l10=new t.L10n(this.getModuleName(),{today:"Today"},this.locale)}this.l10.setLocale(this.locale),this.showTodayButton&&this.updateFooter();break;case"showTodayButton":e.showTodayButton?this.createContentFooter():t.isNullOrUndefined(this.todayElement)||t.isNullOrUndefined(this.footer)||(t.detach(this.todayElement),t.detach(this.footer),this.todayElement=this.footer=void 0),this.setProperties({showTodayButton:e.showTodayButton},!0)}}},i.prototype.validateValues=function(e,i){if(e&&!t.isNullOrUndefined(i)&&i.length>0){for(var s=this.copyValues(i),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)}},i.prototype.setValueUpdate=function(){t.isNullOrUndefined(this.tableBodyElement)||(t.detach(this.tableBodyElement),this.setProperties({start:this.currentView()},!0),this.createContentBody())},i.prototype.copyValues=function(e){var i=[];if(!t.isNullOrUndefined(e)&&e.length>0)for(var s=0;s<e.length;s++)i.push(new Date(+e[s]));return i},i.prototype.titleUpdate=function(e,i){var s,a,n=new t.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})),i){case"days":this.headerTitleElement.textContent=this.toCapitalize(s);break;case"months":this.headerTitleElement.textContent=a}},i.prototype.setActiveDescendant=function(){var e,i,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 i="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)&&(t.isNullOrUndefined(a)||a.setAttribute("aria-selected","true"),(s||a).setAttribute("aria-label",i),e=(s||a).getAttribute("id")),e},i.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)}},i.prototype.destroy=function(){"calendar"===this.getModuleName()&&this.element?t.removeClass([this.element],[u]):this.calendarElement&&this.element&&t.removeClass([this.element],[u]),"calendar"===this.getModuleName()&&this.element&&(t.isNullOrUndefined(this.headerTitleElement)||t.EventHandler.remove(this.headerTitleElement,"click",this.navigateTitle),this.todayElement&&t.EventHandler.remove(this.todayElement,"click",this.todayButtonClick),this.previousIconHandler(!0),this.nextIconHandler(!0),this.keyboardModule.destroy(),this.element.removeAttribute("data-role"),t.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)},i.prototype.title=function(e){var t=this.getViewNumber(this.currentView());this.effect=E,this.switchView(++t,e)},i.prototype.getViewNumber=function(e){return"Month"===e?0:"Year"===e?1:2},i.prototype.navigateTitle=function(e){e.preventDefault(),this.title(e),"calendar"===this.getModuleName()&&this.table.focus()},i.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)}},i.prototype.navigatePrevious=function(e){!t.Browser.isDevice&&e.preventDefault(),"Gregorian"===this.calendarMode?this.previous():this.islamicModule.islamicPrevious(),this.triggerNavigate(e),"calendar"===this.getModuleName()&&this.table.focus()},i.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)}},i.prototype.navigateNext=function(e){!t.Browser.isDevice&&e.preventDefault(),"Gregorian"===this.calendarMode?this.next():this.islamicModule.islamicNext(),this.triggerNavigate(e),"calendar"===this.getModuleName()&&this.table.focus()},i.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)},i.prototype.currentView=function(){return!t.isNullOrUndefined(this.contentElement)&&this.contentElement.classList.contains(p)?"Year":!t.isNullOrUndefined(this.contentElement)&&this.contentElement.classList.contains("e-decade")?"Decade":"Month"},i.prototype.getDateVal=function(e,i){return!t.isNullOrUndefined(i)&&e.getDate()===i.getDate()&&e.getMonth()===i.getMonth()&&e.getFullYear()===i.getFullYear()},i.prototype.getCultureObjects=function(e,i){var s=".dates.calendars.gregorian.days.format."+this.dayHeaderFormat.toLowerCase(),a=".dates.calendars.islamic.days.format."+this.dayHeaderFormat.toLowerCase();return"Gregorian"===this.calendarMode?t.getValue("main."+this.locale+s,e):t.getValue("main."+this.locale+a,e)},i.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)},i.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)},i.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)}},i.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)}},i.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)},i.prototype.adjustLongHeaderSize=function(){t.removeClass([this.element],C),"Wide"===this.dayHeaderFormat&&t.addClass(["calendar"===this.getModuleName()?this.element:this.calendarElement],C)},i.prototype.selectDate=function(e,i,s,a,n){var r=s||e.currentTarget;if(this.isDateSelected=!1,"Decade"===this.currentView())this.setDateDecade(this.currentDate,i.getFullYear());else if("Year"===this.currentView())this.setDateYear(this.currentDate,i);else{if(a&&!this.checkPresentDate(i,n)){var l=this.copyValues(n);!t.isNullOrUndefined(n)&&l.length>0?(l.push(new Date(this.checkValue(i))),this.setProperties({values:l},!0),this.setProperties({value:n[n.length-1]},!0)):this.setProperties({values:[new Date(this.checkValue(i))]},!0)}else this.setProperties({value:new Date(this.checkValue(i))},!0);this.currentDate=new Date(this.checkValue(i))}var o=t.closest(r,"."+u);if(t.isNullOrUndefined(o)&&(o=this.tableBodyElement),a||t.isNullOrUndefined(o.querySelector("."+y))||t.removeClass([o.querySelector("."+y)],y),a||t.isNullOrUndefined(o.querySelector("."+g))||t.removeClass([o.querySelector("."+g)],g),a||t.isNullOrUndefined(o.querySelector("."+b))||t.removeClass([o.querySelector("."+b)],b),a){l=this.copyValues(n);for(var h=Array.prototype.slice.call(this.tableBodyElement.querySelectorAll("td")),d=0;d<h.length;d++){var p=o.querySelectorAll("td."+g)[0],c=o.querySelectorAll("td."+y)[0];h[d]===p&&t.removeClass([h[d]],g),h[d]!==c||this.checkPresentDate(new Date(parseInt(c.getAttribute("id").split("_")[0],10)),n)||t.removeClass([h[d]],y)}if(r.classList.contains(y)){t.removeClass([r],y);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(i,f)===this.globalize.formatDate(l[m],f)){d=l.indexOf(l[m]);l.splice(d,1),t.addClass([r],g)}}this.setProperties({values:l},!0)}else t.addClass([r],y)}else t.addClass([r],y);this.isDateSelected=!0},i.prototype.checkPresentDate=function(e,i){var s=!1;if(!t.isNullOrUndefined(i))for(var a=0;a<i.length;a++){var n="Gregorian"===this.calendarMode?"gregorian":"islamic";this.globalize.formatDate(e,{format:null,type:"date",skeleton:"short",calendar:n})===this.globalize.formatDate(i[a],{format:null,type:"date",skeleton:"short",calendar:n})&&(s=!0)}return s},i.prototype.setAriaActiveDescendant=function(){t.attributes(this.table,{"aria-activedescendant":""+this.setActiveDescendant()})},i.prototype.previousIconHandler=function(e){e?t.isNullOrUndefined(this.previousIcon)||(t.EventHandler.remove(this.previousIcon,"click",this.navigatePreviousHandler),t.addClass([this.previousIcon],""+m),t.addClass([this.previousIcon],""+f),this.previousIcon.setAttribute("aria-disabled","true")):(t.EventHandler.add(this.previousIcon,"click",this.navigatePreviousHandler),t.removeClass([this.previousIcon],""+m),t.removeClass([this.previousIcon],""+f),this.previousIcon.setAttribute("aria-disabled","false"))},i.prototype.renderDayCellEvent=function(e){t.extend(this.renderDayCellArgs,{name:"renderDayCell"}),this.trigger("renderDayCell",e)},i.prototype.navigatedEvent=function(e){t.extend(this.navigatedArgs,{name:"navigated",event:e}),this.trigger("navigated",this.navigatedArgs)},i.prototype.triggerNavigate=function(e){this.navigatedArgs={view:this.currentView(),date:this.currentDate},this.navigatedEvent(e)},i.prototype.nextIconHandler=function(e){e?t.isNullOrUndefined(this.previousIcon)||(t.EventHandler.remove(this.nextIcon,"click",this.navigateNextHandler),t.addClass([this.nextIcon],m),t.addClass([this.nextIcon],f),this.nextIcon.setAttribute("aria-disabled","true")):(t.EventHandler.add(this.nextIcon,"click",this.navigateNextHandler),t.removeClass([this.nextIcon],m),t.removeClass([this.nextIcon],f),this.nextIcon.setAttribute("aria-disabled","false"))},i.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},i.prototype.isMinMaxRange=function(e){return+e>=+this.min&&+e<=+this.max},i.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},i.prototype.compareYear=function(e,t){return this.compare(e,t,0)},i.prototype.compareDecade=function(e,t){return this.compare(e,t,10)},i.prototype.shiftArray=function(e,t){return e.slice(t).concat(e.slice(0,t))},i.prototype.addDay=function(e,i,s,a,n){var r=i,l=new Date(+e);if(!t.isNullOrUndefined(this.tableBodyElement)&&!t.isNullOrUndefined(s)){for(;this.findNextTD(new Date(+e),r,a,n);)r+=i;var o=new Date(l.setDate(l.getDate()+r));r=+o>+a||+o<+n?r===i?i-i:i:r}e.setDate(e.getDate()+r)},i.prototype.findNextTD=function(e,i,s,a){var n=new Date(e.setDate(e.getDate()+i)),r=[],l=!1;if((!t.isNullOrUndefined(n)&&n.getMonth())===(!t.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(m)})}else r=this.tableBodyElement.querySelectorAll("td."+m);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},i.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},i.prototype.setDateDecade=function(e,t){e.setFullYear(t),this.setProperties({value:new Date(this.checkValue(e))},!0)},i.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)},i.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},i.prototype.checkValue=function(e){return e instanceof Date?e.toUTCString():""+e},i.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)},i.prototype.getDate=function(e,t){return t&&(e=new Date(e.toLocaleString("en-US",{timeZone:t}))),e},l([t.Property(new Date(1900,0,1))],i.prototype,"min",void 0),l([t.Property(!0)],i.prototype,"enabled",void 0),l([t.Property(null)],i.prototype,"cssClass",void 0),l([t.Property(new Date(2099,11,31))],i.prototype,"max",void 0),l([t.Property(null)],i.prototype,"firstDayOfWeek",void 0),l([t.Property("Gregorian")],i.prototype,"calendarMode",void 0),l([t.Property("Month")],i.prototype,"start",void 0),l([t.Property("Month")],i.prototype,"depth",void 0),l([t.Property(!1)],i.prototype,"weekNumber",void 0),l([t.Property("FirstDay")],i.prototype,"weekRule",void 0),l([t.Property(!0)],i.prototype,"showTodayButton",void 0),l([t.Property("Short")],i.prototype,"dayHeaderFormat",void 0),l([t.Property(!1)],i.prototype,"enablePersistence",void 0),l([t.Property(null)],i.prototype,"keyConfigs",void 0),l([t.Property(null)],i.prototype,"serverTimezoneOffset",void 0),l([t.Event()],i.prototype,"created",void 0),l([t.Event()],i.prototype,"destroyed",void 0),l([t.Event()],i.prototype,"navigated",void 0),l([t.Event()],i.prototype,"renderDayCell",void 0),i=l([t.NotifyPropertyChanges],i)}(t.Component),M=function(e){function i(t,i){return e.call(this,t,i)||this}return r(i,e),i.prototype.render=function(){if("Islamic"===this.calendarMode&&void 0===this.islamicModule&&t.throwError("Requires the injectable Islamic modules to render Calendar in Islamic mode"),this.isMultiSelection&&"object"==typeof this.values&&!t.isNullOrUndefined(this.values)&&this.values.length>0){for(var i=[],s=[],a=0;a<this.values.length;a++)-1===i.indexOf(+this.values[a])&&(i.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=t.closest(this.element,"form");l&&t.EventHandler.add(l,"reset",this.formResetHandler.bind(this)),this.setTimeZone(this.serverTimezoneOffset)}this.renderComplete()},i.prototype.setEnable=function(e){e?t.removeClass([this.element],m):t.addClass([this.element],m)},i.prototype.setClass=function(e,i){t.isNullOrUndefined(i)||(i=i.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e)||(e=e.replace(/\s+/g," ").trim()),t.isNullOrUndefined(i)||""===i||t.removeClass([this.element],i.split(" ")),t.isNullOrUndefined(e)||t.addClass([this.element],e.split(" "))},i.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)},i.prototype.setTimeZone=function(e){if(!t.isNullOrUndefined(this.serverTimezoneOffset)&&this.value){var i=e+(new Date).getTimezoneOffset()/60;i=this.isDayLightSaving()?i--:i,this.value=new Date(this.value.getTime()+60*i*60*1e3)}},i.prototype.formResetHandler=function(){this.setProperties({value:null},!0)},i.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),!t.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)},i.prototype.minMaxUpdate=function(){"calendar"===this.getModuleName()&&(!t.isNullOrUndefined(this.value)&&this.value<=this.min&&this.min<=this.max?(this.setProperties({value:this.min},!0),this.changedArgs={value:this.value}):!t.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()||t.isNullOrUndefined(this.value)?e.prototype.minMaxUpdate.call(this,this.value):!t.isNullOrUndefined(this.value)&&this.value<this.min&&this.min<=this.max?e.prototype.minMaxUpdate.call(this,this.min):!t.isNullOrUndefined(this.value)&&this.value>this.max&&this.min<=this.max&&e.prototype.minMaxUpdate.call(this,this.max)},i.prototype.generateTodayVal=function(i){var s=new Date;return t.isNullOrUndefined(this.timezone)||(s=e.prototype.getDate.call(this,s,this.timezone)),i&&t.isNullOrUndefined(this.timezone)?(s.setHours(i.getHours()),s.setMinutes(i.getMinutes()),s.setSeconds(i.getSeconds()),s.setMilliseconds(i.getMilliseconds())):s=new Date(s.getFullYear(),s.getMonth(),s.getDate(),0,0,0,0),s},i.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))}},i.prototype.keyActionHandle=function(t){e.prototype.keyActionHandle.call(this,t,this.value,this.isMultiSelection)},i.prototype.preRender=function(){var t=this;this.changeHandler=function(e){t.triggerChange(e)},this.checkView(),e.prototype.preRender.call(this,this.value)},i.prototype.createContent=function(){this.previousDate=this.value,this.previousDateTime=this.value,e.prototype.createContent.call(this)},i.prototype.minMaxDate=function(t){return e.prototype.minMaxDate.call(this,t)},i.prototype.renderMonths=function(t,i,s){e.prototype.renderMonths.call(this,t,this.value,s)},i.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},i.prototype.renderYears=function(t){"Gregorian"===this.calendarMode?e.prototype.renderYears.call(this,t,this.value):this.islamicModule.islamicRenderYears(t,this.value)},i.prototype.renderDecades=function(t){"Gregorian"===this.calendarMode?e.prototype.renderDecades.call(this,t,this.value):this.islamicModule.islamicRenderDecade(t,this.value)},i.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(o)?this.changeHandler(a):this.changeHandler()},i.prototype.clickHandler=function(i){var s=i.currentTarget;if(this.isPopupClicked=!0,s.classList.contains(o))if(this.isMultiSelection){var a=this.copyValues(this.values);-1===a.toString().indexOf(this.getIdValue(i,null).toString())?(a.push(this.getIdValue(i,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(i,null)},!0);var n=this.currentView();e.prototype.clickHandler.call(this,i,this.value),this.isMultiSelection&&this.currentDate!==this.value&&!t.isNullOrUndefined(this.tableBodyElement.querySelectorAll("."+g)[0])&&"Year"===n&&this.tableBodyElement.querySelectorAll("."+g)[0].classList.remove(g)},i.prototype.switchView=function(t,i,s,a){e.prototype.switchView.call(this,t,i,this.isMultiSelection,a)},i.prototype.getModuleName=function(){return e.prototype.getModuleName.call(this),"calendar"},i.prototype.getPersistData=function(){e.prototype.getPersistData.call(this);return this.addOnPersist(["value","values"])},i.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},i.prototype.destroy=function(){if(e.prototype.destroy.call(this),"calendar"===this.getModuleName()){this.changedArgs=null;var i=t.closest(this.element,"form");i&&t.EventHandler.remove(i,"reset",this.formResetHandler.bind(this))}},i.prototype.navigateTo=function(t,i,s){this.minMaxUpdate(),e.prototype.navigateTo.call(this,t,i,s)},i.prototype.currentView=function(){return e.prototype.currentView.call(this)},i.prototype.addDate=function(i){if("string"!=typeof i&&"number"!=typeof i){var s=this.copyValues(this.values);if("object"==typeof i&&i.length>0)for(var a=i,n=0;n<a.length;n++)this.checkDateValue(a[n])&&!e.prototype.checkPresentDate.call(this,a[n],s)&&(!t.isNullOrUndefined(s)&&s.length>0?s.push(a[n]):s=[new Date(+a[n])]);else this.checkDateValue(i)&&!e.prototype.checkPresentDate.call(this,i,s)&&(!t.isNullOrUndefined(s)&&s.length>0?s.push(i):s=[new Date(+i)]);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()}},i.prototype.removeDate=function(e){if("string"!=typeof e&&"number"!=typeof e&&!t.isNullOrUndefined(this.values)&&this.values.length>0){var i=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<i.length;n++)+i[n]==+s[a]&&i.splice(n,1);else for(n=0;n<i.length;n++)+i[n]==+e&&i.splice(n,1);this.setProperties({values:i},!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()}},i.prototype.setTodayDate=function(t){var i=new Date(+t);this.setProperties({value:i},!0),e.prototype.todayButtonClick.call(this,null,i,!0)},i.prototype.update=function(){this.validateDate(),this.minMaxUpdate(),e.prototype.setValueUpdate.call(this)},i.prototype.selectDate=function(i,s,a){e.prototype.selectDate.call(this,i,s,a,this.isMultiSelection,this.values),this.isMultiSelection&&!t.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(i)},i.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))},i.prototype.triggerChange=function(e){!t.isNullOrUndefined(this.todayButtonEvent)&&this.isTodayClicked&&(e=this.todayButtonEvent,this.isTodayClicked=!1),this.changedArgs.event=e||null,this.changedArgs.isInteracted=!t.isNullOrUndefined(e),t.isNullOrUndefined(this.value)||this.setProperties({value:this.value},!0),this.isMultiSelection||+this.value===Number.NaN||(t.isNullOrUndefined(this.value)||t.isNullOrUndefined(this.previousDate))&&(null!==this.previousDate||isNaN(+this.value))?t.isNullOrUndefined(this.values)||this.previousValues===this.values.length||(this.changeEvent(e),this.previousValues=this.values.length):this.changeEvent(e)},l([t.Property(null)],i.prototype,"value",void 0),l([t.Property(null)],i.prototype,"values",void 0),l([t.Property(!1)],i.prototype,"isMultiSelection",void 0),l([t.Event()],i.prototype,"change",void 0),i=l([t.NotifyPropertyChanges],i)}(k),w="e-other-month",V="e-disabled",N="e-selected",O="e-focused-date",I="e-month-hide",T=function(){function e(e){this.calendarInstance=e}return e.prototype.getModuleName=function(){return"islamic"},e.prototype.islamicTitleUpdate=function(e,i){var s=new t.Internationalization(this.calendarInstance.locale);switch(i){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,i,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:"e-cell"}),c=this.calendarInstance.createElement("span");d%7==0&&this.calendarInstance.weekNumber&&(c.textContent=""+this.calendarInstance.getWeek(l),p.appendChild(c),t.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?(t.addClass([v],V),t.addClass([v],"e-overlay")):g.setAttribute("title",""+y);u!==this.getIslamicDate(l).month&&t.addClass([v],w),0!==l.getDay()&&6!==l.getDay()||t.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(!t.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 i&&+i==+D.date&&this.calendarInstance.setProperties({value:null},!0);this.calendarInstance.renderDayCellArgs.isDisabled&&!v.classList.contains(N)&&(t.addClass([v],V),t.addClass([v],"e-overlay"),+this.calendarInstance.renderDayCellArgs.date==+this.calendarInstance.todayDate&&(this.calendarInstance.todayDisabled=!0));var C=v.classList.contains(w),k=v.classList.contains(V);if(k||t.EventHandler.add(v,"click",this.calendarInstance.clickHandler,this.calendarInstance),!this.calendarInstance.isMultiSelection||t.isNullOrUndefined(this.calendarInstance.values)||C||k)C||k||!this.calendarInstance.getDateVal(l,i)?this.calendarInstance.updateFocus(C,k,l,v,e):t.addClass([v],N);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])?t.addClass([v],N):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()&&t.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 i=this.islamicCompareMonth(e,this.calendarInstance.min)<1,s=this.islamicCompareMonth(e,this.calendarInstance.max)>-1;this.calendarInstance.previousIconHandler(i),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=t.HijriParser.toGregorian(1361,1,1),l=this.hijriCompareDecade(e,this.calendarInstance.min)<1,o=this.hijriCompareDecade(e,this.calendarInstance.max)>-1;l=t.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,i){this.calendarInstance.removeTableHeadElement();var s=[],a=t.isNullOrUndefined(i),n=new Date(this.islamicInValue(this.calendarInstance.currentDate)),r=this.getIslamicDate(n);n=t.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=t.HijriParser.toGregorian(f.year,m,1);var v=this.islamicDayCell(n),y=this.calendarInstance.createElement("span"),g=i&&this.getIslamicDate(i).month===this.getIslamicDate(n).month,b=i&&this.getIslamicDate(i).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)?t.addClass([v],V):!a&&b?t.addClass([v],N):this.getIslamicDate(n).month===l&&this.getIslamicDate(this.calendarInstance.currentDate).month===l&&t.addClass([v],O),v.classList.contains(V)||t.EventHandler.add(v,"click",this.calendarInstance.clickHandler,this.calendarInstance),v.appendChild(y),s.push(v)}this.islamicRenderTemplate(s,4,"e-year",e,i)},e.prototype.islamicRenderDecade=function(e,i){this.calendarInstance.removeTableHeadElement();var s=[],a=new Date(this.islamicInValue(this.calendarInstance.currentDate)),n=this.getIslamicDate(a),r=(a=t.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((!t.isNullOrUndefined(e)&&c[0]!==d&&"home"===e.action||!t.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){for(var 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(var f=0;f<=c.length;f++)d-c[f]!=0&&c[f]-d!=0||(d=(parseInt(d,10)+1).toString()),d-c[f]==2&&d>c[f].trim()&&(d=(parseInt(d,10)-1).toString()),c[f]-d==1&&d<c[f].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 v=this.calendarInstance.globalize.formatDate(l,{type:"dateTime",format:"y",calendar:"islamic"}),y=this.calendarInstance.globalize.formatDate(o,{type:"dateTime",format:"y",calendar:"islamic"});this.calendarInstance.headerTitleElement.textContent=v+" - "+y}else this.calendarInstance.headerTitleElement.textContent=d+" - "+p;this.calendarInstance.nextIconClicked=this.calendarInstance.previousIconClicked=!1;var g=(parseInt(d,10)-2).toString();h=Math.round(.97*parseInt(d,10)+622),u=Math.round(.97*parseInt(p,10)+622);for(var b=Math.round(.97*parseInt(g,10)+622),D=1;D<=12;++D){var E=b+D;a.setFullYear(E),a.setDate(1),a.setMonth(0),this.getIslamicDate(a).year-n.year>1&&(a.setMonth(1),D-=1,a.setFullYear(a.getFullYear()-1)),n=this.getIslamicDate(a);if(a=t.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 C=this.islamicDayCell(a);t.attributes(C,{role:"gridcell"});var k=this.calendarInstance.createElement("span");k.textContent=this.calendarInstance.globalize.formatDate(a,{type:"dateTime",format:"y",calendar:"islamic"}),n.year===parseInt(d,10)-1||E<h||E>u&&n.year!==parseInt(p,10)?t.addClass([C],w):E<new Date(this.islamicInValue(this.calendarInstance.min)).getFullYear()||E>new Date(this.islamicInValue(this.calendarInstance.max)).getFullYear()?t.addClass([C],V):t.isNullOrUndefined(i)||this.getIslamicDate(a).year!==this.getIslamicDate(i).year?a.getFullYear()!==this.calendarInstance.currentDate.getFullYear()||C.classList.contains(V)||t.addClass([C],O):t.addClass([C],N),C.classList.contains(V)||t.EventHandler.add(C,"click",this.calendarInstance.clickHandler,this.calendarInstance),C.appendChild(k),(!t.isNullOrUndefined(e)&&"home"===e.action&&n.year.toString()===d||!t.isNullOrUndefined(e)&&"end"===e.action&&n.year.toString()===p)&&t.addClass([C],O),s.push(C)}}this.islamicRenderTemplate(s,4,"e-decade",e,i)},e.prototype.islamicDayCell=function(e){var i={skeleton:"full",type:"dateTime",calendar:"islamic"},s=this.calendarInstance.globalize.formatDate(e,i),a=this.calendarInstance.globalize.parseDate(s,i).valueOf(),n={className:"e-cell",attrs:{id:""+t.getUniqueID(""+a),"aria-selected":"false",role:"gridcell"}};return this.calendarInstance.createElement("td",n)},e.prototype.islamicRenderTemplate=function(e,i,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),t.removeClass([this.calendarInstance.contentElement,this.calendarInstance.headerElement],["e-month","e-decade","e-year"]),t.addClass([this.calendarInstance.contentElement,this.calendarInstance.headerElement],[s]);for(var o=i,h=0,u=0;u<Math.round(e.length/i);++u){for(r=this.calendarInstance.createElement("tr",{attrs:{role:"row"}}),h=0+h;h<o;h++)e[h].classList.contains("e-week-number")||t.isNullOrUndefined(e[h].children[0])||(t.addClass([e[h].children[0]],["e-day"]),t.rippleEffect(e[h].children[0],{duration:600,isCenterRipple:!0})),r.appendChild(e[h]),this.calendarInstance.weekNumber&&7===h&&e[7].classList.contains(w)&&t.addClass([r],I),!this.calendarInstance.weekNumber&&6===h&&e[6].classList.contains(w)&&t.addClass([r],I),this.calendarInstance.weekNumber?41===h&&e[41].classList.contains(w)&&t.addClass([r],I):35===h&&e[35].classList.contains(w)&&t.addClass([r],I);o+=i,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)?a=-1:n.year<r&&"Year"===this.calendarInstance.currentView()&&(a=-1),a},e.prototype.getIslamicDate=function(e){return t.HijriParser.getHijriDate(e)},e.prototype.toGregorian=function(e,i,s){return t.HijriParser.toGregorian(e,i,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}(),x=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)}}(),S=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},P="e-datepicker",A="e-popup-wrapper",U="e-input-focus",H="e-active",W="e-date-overflow",L="e-selected",F="e-non-edit",B=["title","class","style"],j=function(e){function a(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 x(a,e),a.prototype.render=function(){this.initialize(),this.bindEvents(),"Never"!==this.floatLabelType&&s.Input.calculateWidth(this.inputElement,this.inputWrapper.container),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.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"),!t.isNullOrUndefined(t.closest(this.element,"fieldset"))&&t.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete(),this.setTimeZone(this.serverTimezoneOffset)},a.prototype.setTimeZone=function(e){if(!t.isNullOrUndefined(this.serverTimezoneOffset)&&this.value){var i=e+(new Date).getTimezoneOffset()/60;i=this.isDayLightSaving()?i--:i,this.value=new Date(this.value.getTime()+60*i*60*1e3),this.updateInput()}},a.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)},a.prototype.setAllowEdit=function(){this.allowEdit?this.readonly||this.inputElement.removeAttribute("readonly"):t.attributes(this.inputElement,{readonly:""}),this.updateIconState()},a.prototype.updateIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&t.removeClass([this.inputWrapper.container],[F]):""===this.inputElement.value?t.removeClass([this.inputWrapper.container],[F]):t.addClass([this.inputWrapper.container],[F])},a.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=t.isNullOrUndefined(this.value)?null:new Date(+this.value),this.inputElement.setAttribute("value",this.inputElement.value),this.inputValueCopy=this.value},a.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 i={placeholder:this.placeholder};this.globalize=new t.Internationalization(this.locale),this.l10n=new t.L10n("datepicker",i,this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0)}this.fullScreenMode&&t.Browser.isDevice&&(this.cssClass+=" e-popup-expand");var a=this.cssClass;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(a=this.cssClass.replace(/\s+/g," ").trim());var n=!this.enableMask;this.inputWrapper=s.Input.createInput({element:this.inputElement,floatLabelType:this.floatLabelType,bindClearAction:n,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),t.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),s.Input.addAttributes({"aria-label":"select",role:"button"},this.inputWrapper.buttons[0]),t.addClass([this.inputWrapper.container],"e-date-wrapper")},a.prototype.updateInput=function(i,s){void 0===i&&(i=!1),void 0===s&&(s=!1);var a;if(this.value&&!this.isCalendar()&&this.disabledDates(i,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)),!t.isNullOrUndefined(this.value)){var n=this.value,r=void 0,l=t.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)}}t.isNullOrUndefined(this.value)&&this.strictMode&&(this.enableMask?(this.updateInputValue(this.maskedDateValue),this.notify("createMask",{module:"MaskedDateTime"})):this.updateInputValue("")),!this.strictMode&&t.isNullOrUndefined(this.value)&&this.invalidValueString&&this.updateInputValue(this.invalidValueString),this.changedArgs={value:this.value},this.errorClass(),this.updateIconState()},a.prototype.minMaxUpdates=function(){!t.isNullOrUndefined(this.value)&&this.value<this.min&&this.min<=this.max&&this.strictMode?(this.setProperties({value:this.min},!0),this.changedArgs={value:this.value}):!t.isNullOrUndefined(this.value)&&this.value>this.max&&this.min<=this.max&&this.strictMode&&(this.setProperties({value:this.max},!0),this.changedArgs={value:this.value})},a.prototype.checkStringValue=function(e){var i=null,s=null,a=null;if("datetimepicker"===this.getModuleName()){var n=new t.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 i=this.checkDateValue(this.globalize.parseDate(e,s)),t.isNullOrUndefined(i)&&"datetimepicker"===this.getModuleName()&&(i=this.checkDateValue(this.globalize.parseDate(e,a))),i},a.prototype.checkInvalidValue=function(e){if(!(e instanceof Date||t.isNullOrUndefined(e))){var i=null,s=e;"number"==typeof e&&(s=e.toString());if("datetimepicker"===this.getModuleName()){var a=new t.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()),!(i=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:i=new Date(s)}n?(this.strictMode||(this.invalidValueString=s),this.setProperties({value:null},!0)):this.setProperties({value:i},!0)}},a.prototype.bindInputEvent=function(){t.isNullOrUndefined(this.formatString)&&!this.enableMask||(this.enableMask||-1===this.formatString.indexOf("y")?t.EventHandler.add(this.inputElement,"input",this.inputHandler,this):t.EventHandler.remove(this.inputElement,"input",this.inputHandler))},a.prototype.bindEvents=function(){t.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.dateIconHandler,this),t.EventHandler.add(this.inputElement,"mouseup",this.mouseUpHandler,this),t.EventHandler.add(this.inputElement,"focus",this.inputFocusHandler,this),t.EventHandler.add(this.inputElement,"blur",this.inputBlurHandler,this),t.EventHandler.add(this.inputElement,"keyup",this.keyupHandler,this),this.enableMask&&t.EventHandler.add(this.inputElement,"keydown",this.keydownHandler,this),this.bindInputEvent(),t.EventHandler.add(this.inputElement,"change",this.inputChangeHandler,this),this.showClearButton&&this.inputWrapper.clearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.resetFormHandler,this),this.defaultKeyConfigs=t.extend(this.defaultKeyConfigs,this.keyConfigs),this.keyboardModules=new t.KeyboardEvents(this.inputElement,{eventName:"keydown",keyAction:this.inputKeyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})},a.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}))}},a.prototype.unBindEvents=function(){t.isNullOrUndefined(this.inputWrapper)||t.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.dateIconHandler),t.EventHandler.remove(this.inputElement,"mouseup",this.mouseUpHandler),t.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),t.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),t.EventHandler.remove(this.inputElement,"change",this.inputChangeHandler),t.EventHandler.remove(this.inputElement,"keyup",this.keyupHandler),this.enableMask&&t.EventHandler.remove(this.inputElement,"keydown",this.keydownHandler),this.showClearButton&&this.inputWrapper.clearButton&&t.EventHandler.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.resetFormHandler)},a.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())}},a.prototype.restoreValue=function(){this.currentDate=this.value?this.value:new Date,this.previousDate=this.value,this.previousElementValue=t.isNullOrUndefined(this.inputValueCopy)?"":this.globalize.formatDate(this.inputValueCopy,{format:this.formatString,type:"dateTime",skeleton:"yMd"})},a.prototype.inputChangeHandler=function(e){this.enabled&&e.stopPropagation()},a.prototype.bindClearEvent=function(){this.showClearButton&&this.inputWrapper.clearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this)},a.prototype.resetHandler=function(e){this.enabled&&(e.preventDefault(),this.clear(e))},a.prototype.mouseUpHandler=function(e){this.enableMask&&(e.preventDefault(),this.notify("setMaskSelection",{module:"MaskedDateTime"}))},a.prototype.clear=function(e){this.setProperties({value:null},!0),this.enableMask||this.updateInputValue("");var i={event:e};if(this.trigger("cleared",i),this.invalidValueString="",this.updateInput(),this.popupUpdate(),this.changeEvent(e),this.enableMask&&this.notify("clearHandler",{module:"MaskedDateTime"}),t.closest(this.element,"form")){var s=this.element,a=document.createEvent("KeyboardEvent");a.initEvent("keyup",!1,!0),s.dispatchEvent(a)}},a.prototype.preventEventBubbling=function(e){e.preventDefault(),this.interopAdaptor.invokeMethodAsync("OnDateIconClick")},a.prototype.updateInputValue=function(e){s.Input.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton)},a.prototype.dateIconHandler=function(e){this.enabled&&(this.isIconClicked=!0,t.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(),t.addClass([this.inputWrapper.container],[U]),t.addClass(this.inputWrapper.buttons,H))),this.isIconClicked=!1)},a.prototype.updateHtmlAttributeToWrapper=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if(!t.isNullOrUndefined(this.htmlAttributes[""+s])&&B.indexOf(s)>-1)if("class"===s){var a=this.htmlAttributes[""+s].replace(/\s+/g," ").trim();""!==a&&t.addClass([this.inputWrapper.container],a.split(" "))}else if("style"===s){var n=this.inputWrapper.container.getAttribute(s);t.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])}},a.prototype.updateHtmlAttributeToElement=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];B.indexOf(s)<0&&this.inputElement.setAttribute(s,this.htmlAttributes[""+s])}},a.prototype.updateCssClass=function(e,i){t.isNullOrUndefined(i)||(i=i.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e)||(e=e.replace(/\s+/g," ").trim()),s.Input.setCssClass(e,[this.inputWrapper.container],i),this.popupWrapper&&s.Input.setCssClass(e,[this.popupWrapper],i)},a.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()}},a.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()}},a.prototype.inputHandler=function(){this.isPopupClicked=!1,this.enableMask&&this.notify("inputHandler",{module:"MaskedDateTime"})},a.prototype.inputBlurHandler=function(e){if(this.enabled){if(this.strictModeUpdate(),""===this.inputElement.value&&t.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 i={model:this};this.trigger("blur",i)}this.isCalendar()&&(this.defaultKeyConfigs=t.extend(this.defaultKeyConfigs,this.keyConfigs),this.calendarKeyboardModules=new t.KeyboardEvents(this.calendarElement.children[1].firstElementChild,{eventName:"keydown",keyAction:this.calendarKeyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})),this.isPopupClicked=!1}},a.prototype.documentHandler=function(i){t.isNullOrUndefined(this.popupObj)||t.isNullOrUndefined(this.inputWrapper)||!(this.inputWrapper.container.contains(i.target)&&"mousedown"!==i.type||this.popupObj.element&&this.popupObj.element.contains(i.target))||"touchstart"===i.type||i.preventDefault();var s=i.target;t.closest(s,".e-datepicker.e-popup-wrapper")||t.isNullOrUndefined(this.inputWrapper)||t.closest(s,".e-input-group")===this.inputWrapper.container||s.classList.contains("e-day")||s.classList.contains("e-dlg-overlay")?t.closest(s,".e-datepicker.e-popup-wrapper")&&(s.classList.contains("e-day")&&!t.isNullOrUndefined(i.target.parentElement)&&i.target.parentElement.classList.contains("e-selected")&&t.closest(s,".e-content")&&t.closest(s,".e-content").classList.contains("e-"+this.depth.toLowerCase())?this.hide(i):t.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(i)):(this.hide(i),this.focusOut())},a.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)}},a.prototype.defaultAction=function(i){this.previousDate=!t.isNullOrUndefined(this.value)&&new Date(+this.value)||null,this.isCalendar()&&(e.prototype.keyActionHandle.call(this,i),this.isCalendar()&&t.attributes(this.inputElement,{"aria-activedescendant":""+this.setActiveDescendant()}))},a.prototype.popupUpdate=function(){if((t.isNullOrUndefined(this.value)&&!t.isNullOrUndefined(this.previousDate)||"datetimepicker"!==this.getModuleName()&&+this.value!=+this.previousDate||"datetimepicker"===this.getModuleName()&&+this.value!=+this.previousDateTime)&&(this.popupObj&&this.popupObj.element.querySelectorAll("."+L).length>0&&t.removeClass(this.popupObj.element.querySelectorAll("."+L),[L]),!t.isNullOrUndefined(this.value)&&+this.value>=+this.min&&+this.value<=+this.max)){var i=new Date(this.checkValue(this.value));e.prototype.navigateTo.call(this,"Month",i)}},a.prototype.strictModeUpdate=function(){var e,i;if("datetimepicker"===this.getModuleName()?e=t.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString:/^y/.test(this.formatString)&&!/[^a-zA-Z]/.test(this.formatString)||(e=t.isNullOrUndefined(this.formatString)?this.formatString:this.formatString.replace("dd","d")),t.isNullOrUndefined(e))e=this.formatString;else{e.split("M").length-1<3&&(e=e.replace("MM","M"))}var s;s="datetimepicker"===this.getModuleName()?"Gregorian"===this.calendarMode?{format:t.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:t.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"}:i="Gregorian"===this.calendarMode?{format:e,type:"dateTime",skeleton:"yMd"}:{format:e,type:"dateTime",skeleton:"yMd",calendar:"islamic"};var a;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,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 i="Gregorian"===this.calendarMode?{format:e,type:"dateTime",skeleton:"yMd"}:{format:e,type:"dateTime",skeleton:"yMd",calendar:"islamic"},a=this.globalize.parseDate(this.inputElement.value,i);else a=this.globalize.parseDate(this.inputElement.value,s),a=!t.isNullOrUndefined(a)&&isNaN(+a)?null:a,!t.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),t.isNullOrUndefined(this.value)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0)))},a.prototype.createCalendar=function(){var e=this;this.popupWrapper=this.createElement("div",{className:P+" "+A,id:this.inputElement.id+"_options"}),this.popupWrapper.setAttribute("aria-label",this.element.id),this.popupWrapper.setAttribute("role","dialog"),t.isNullOrUndefined(this.cssClass)||(this.popupWrapper.className+=" "+this.cssClass),t.Browser.isDevice&&(this.modelHeader(),this.modal=this.createElement("div"),this.modal.className=P+" e-date-modal",document.body.className+=" "+W,this.modal.style.display="block",document.body.appendChild(this.modal)),this.calendarElement.querySelector("table tbody").className="",this.popupObj=new i.Popup(this.popupWrapper,{content:this.calendarElement,relateTo:t.Browser.isDevice?document.body:this.inputWrapper.container,position:t.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:t.Browser.isDevice?{X:"fit",Y:"fit"}:this.enableRtl?{X:"fit",Y:"flip"}:{X:"flip",Y:"flip"},open:function(){t.Browser.isDevice&&e.fullScreenMode&&(e.iconRight=parseInt(window.getComputedStyle(e.calendarElement.querySelector(".e-header.e-month .e-prev")).marginRight,10)>16,e.touchModule=new t.Touch(e.calendarElement.querySelector(".e-content.e-month"),{swipe:e.CalendarSwipeHandler.bind(e)}),t.EventHandler.add(e.calendarElement.querySelector(".e-content.e-month"),"touchstart",e.TouchStartHandler,e)),"datetimepicker"!==e.getModuleName()&&document.activeElement!==e.inputElement&&(e.defaultKeyConfigs=t.extend(e.defaultKeyConfigs,e.keyConfigs),e.calendarElement.children[1].firstElementChild.focus(),e.calendarKeyboardModules=new t.KeyboardEvents(e.calendarElement.children[1].firstElementChild,{eventName:"keydown",keyAction:e.calendarKeyActionHandle.bind(e),keyConfigs:e.defaultKeyConfigs}),e.calendarKeyboardModules=new t.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(),t.detach(e.popupWrapper),e.popupObj=e.popupWrapper=null,e.preventArgs=null,e.calendarKeyboardModules=null,e.setAriaAttributes()},targetExitViewport:function(){t.Browser.isDevice||e.hide()}}),this.popupObj.element.className+=" "+this.cssClass,this.setAriaAttributes()},a.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)},a.prototype.TouchStartHandler=function(e){this.touchStart=!0},a.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)},a.prototype.modelHeader=function(){var e,i=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"});t.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"),i.appendChild(l),i.appendChild(o)}this.fullScreenMode||i.appendChild(s),a.appendChild(n),a.appendChild(r),i.appendChild(a),this.calendarElement.insertBefore(i,this.calendarElement.firstElementChild)},a.prototype.modelCloseHandler=function(e){this.hide()},a.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=!t.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},a.prototype.navigatedEvent=function(){this.trigger("navigated",this.navigatedArgs)},a.prototype.keyupHandler=function(e){this.isKeyAction=this.inputElement.value!==this.previousElementValue},a.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},a.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},a.prototype.selectCalendar=function(e){var i,s,a;s="datetimepicker"===this.getModuleName()&&t.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"},i=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"},i=this.globalize.formatDate(this.changedArgs.value,a)),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"})),t.isNullOrUndefined(i)||(this.updateInputValue(i),this.enableMask&&this.notify("setMaskSelection",{module:"MaskedDateTime"}))},a.prototype.isCalendar=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains(""+A))},a.prototype.setWidth=function(e){this.inputWrapper.container.style.width="number"==typeof e?t.formatUnit(this.width):"string"==typeof e?e.match(/px|%|em/)?this.width:t.formatUnit(this.width):"100%"},a.prototype.show=function(i,s){var a=this;if(!(this.enabled&&this.readonly||!this.enabled||this.popupObj)){var n=!0,r=void 0;t.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()),t.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:t.Browser.isDevice?this.mobilePopupWrapper:document.body};var l=this.preventArgs;if(this.trigger("open",l,function(i){if(a.preventArgs=i,n&&!a.preventArgs.cancel){t.addClass(a.inputWrapper.buttons,H),a.preventArgs.appendTo.appendChild(a.popupWrapper),a.popupObj.refreshPosition(a.inputElement);var s={name:"FadeIn",duration:t.Browser.isDevice?0:300};1e3===a.zIndex?a.popupObj.show(new t.Animation(s),a.element):a.popupObj.show(new t.Animation(s),null),e.prototype.setOverlayIndex.call(a,a.mobilePopupWrapper,a.popupObj.element,a.modal,t.Browser.isDevice),a.setAriaAttributes()}else a.popupObj.destroy(),a.popupWrapper=a.popupObj=null;t.isNullOrUndefined(a.inputElement)||""!==a.inputElement.value||!t.isNullOrUndefined(a.tableBodyElement)&&a.tableBodyElement.querySelectorAll("td.e-selected").length>0&&(t.addClass([a.tableBodyElement.querySelector("td.e-selected")],"e-focused-date"),t.removeClass(a.tableBodyElement.querySelectorAll("td.e-selected"),L)),t.EventHandler.add(document,"mousedown touchstart",a.documentHandler,a)}),t.Browser.isDevice){var o=this.createElement("div",{className:"e-dlg-overlay"});o.style.zIndex=(this.zIndex-1).toString(),this.mobilePopupWrapper.appendChild(o)}}},a.prototype.hide=function(e){var i=this;if(t.isNullOrUndefined(this.popupWrapper))t.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},t.removeClass(this.inputWrapper.buttons,H),t.removeClass([document.body],W);var a=this.preventArgs;this.isCalendar()?this.trigger("close",a,function(e){i.closeEventCallback(s,e)}):this.closeEventCallback(s,a)}},a.prototype.closeEventCallback=function(e,i){this.preventArgs=i,this.isCalendar()&&e&&!this.preventArgs.cancel&&(this.popupObj.hide(),this.isAltKeyPressed=!1,this.keyboardModule.destroy(),t.removeClass(this.inputWrapper.buttons,H)),this.setAriaAttributes(),t.Browser.isDevice&&this.modal&&(this.modal.style.display="none",this.modal.outerHTML="",this.modal=null),t.Browser.isDevice&&(t.isNullOrUndefined(this.mobilePopupWrapper)||!e||!t.isNullOrUndefined(this.preventArgs)&&this.preventArgs.cancel||(this.mobilePopupWrapper.remove(),this.mobilePopupWrapper=null)),t.EventHandler.remove(document,"mousedown touchstart",this.documentHandler),t.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit()},a.prototype.focusIn=function(e){document.activeElement!==this.inputElement&&this.enabled&&(this.inputElement.focus(),t.addClass([this.inputWrapper.container],[U]))},a.prototype.focusOut=function(){document.activeElement===this.inputElement&&(t.removeClass([this.inputWrapper.container],[U]),this.inputElement.blur())},a.prototype.currentView=function(){var t;return this.calendarElement&&(t=e.prototype.currentView.call(this)),t},a.prototype.navigateTo=function(t,i){this.calendarElement&&e.prototype.navigateTo.call(this,t,i)},a.prototype.destroy=function(){this.unBindEvents(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),e.prototype.destroy.call(this),s.Input.destroy({element:this.inputElement,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),t.isNullOrUndefined(this.keyboardModules)||this.keyboardModules.destroy(),this.popupObj&&this.popupObj.element.classList.contains("e-popup")&&e.prototype.destroy.call(this);var i={"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&&(s.Input.removeAttributes(i,this.inputElement),t.isNullOrUndefined(this.inputElementCopy.getAttribute("tabindex"))?this.inputElement.removeAttribute("tabindex"):this.inputElement.setAttribute("tabindex",this.tabIndex),t.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),t.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),this.ensureInputAttribute()),this.isCalendar()&&(this.popupWrapper&&t.detach(this.popupWrapper),this.popupObj=this.popupWrapper=null,this.keyboardModule.destroy()),null===this.ngTag&&(this.inputElement&&(t.isNullOrUndefined(this.inputWrapper)||this.inputWrapper.container.insertAdjacentElement("afterend",this.inputElement),t.removeClass([this.inputElement],["e-input"])),t.removeClass([this.element],[P]),t.isNullOrUndefined(this.inputWrapper)||t.detach(this.inputWrapper.container)),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.resetFormHandler),this.inputWrapper=null,this.keyboardModules=null},a.prototype.ensureInputAttribute=function(){for(var e=[],i=0;i<this.inputElement.attributes.length;i++)e[i]=this.inputElement.attributes[i].name;for(i=0;i<e.length;i++)t.isNullOrUndefined(this.inputElementCopy.getAttribute(e[i]))?("value"===e[i].toLowerCase()&&(this.inputElement.value=""),this.inputElement.removeAttribute(e[i])):("value"===e[i].toLowerCase()&&(this.inputElement.value=this.inputElementCopy.getAttribute(e[i])),this.inputElement.setAttribute(e[i],this.inputElementCopy.getAttribute(e[i])))},a.prototype.preRender=function(){this.inputElementCopy=this.element.cloneNode(!0),t.removeClass([this.inputElementCopy],[P,"e-control","e-lib"]),this.inputElement=this.element,this.formElement=t.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=t.getUniqueID("ej2-datetimepicker"),null!==this.ngTag&&t.attributes(this.inputElement,{id:this.element.id+"_input"})):(this.element.id=t.getUniqueID("ej2-datepicker"),null!==this.ngTag&&t.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)},a.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},a.prototype.validationAttribute=function(e,i){var s=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id");i.setAttribute("name",s),e.removeAttribute("name");for(var a=["required","aria-required","form"],n=0;n<a.length;n++)if(!t.isNullOrUndefined(e.getAttribute(a[n]))){var r=e.getAttribute(a[n]);i.setAttribute(a[n],r),e.removeAttribute(a[n])}},a.prototype.checkFormat=function(){var e=new t.Internationalization(this.locale);if(this.format)if("string"==typeof this.format)this.formatString=this.format;else if(""===this.format.skeleton||t.isNullOrUndefined(this.format.skeleton))"datetimepicker"===this.getModuleName()?this.formatString=this.dateTimeFormat:this.formatString=null;else{var i=this.format.skeleton;"datetimepicker"===this.getModuleName()?this.formatString=e.getDatePattern({skeleton:i,type:"dateTime"}):this.formatString=e.getDatePattern({skeleton:i,type:"date"})}else this.formatString=null},a.prototype.checkHtmlAttributes=function(e){this.globalize=new t.Internationalization(this.locale),this.checkFormat(),this.checkView();var i,s=e?t.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["value","min","max","disabled","readonly","style","name","placeholder","type"];i="datetimepicker"===this.getModuleName()?"Gregorian"===this.calendarMode?{format:t.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:t.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(!t.isNullOrUndefined(this.inputElement.getAttribute(r)))switch(r){case"disabled":if(t.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(t.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":(t.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(t.isNullOrUndefined(this.datepickerOptions)||void 0===this.datepickerOptions.value||e){var h=this.inputElement.getAttribute(r);this.setProperties(t.setValue(r,this.globalize.parseDate(h,i),{}),!e)}break;case"min":if(+this.min==+new Date(1900,0,1)||e){var u=this.inputElement.getAttribute(r);this.setProperties(t.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(t.setValue(r,this.globalize.parseDate(d),{}),!e)}break;case"type":"text"!==this.inputElement.getAttribute(r)&&this.inputElement.setAttribute("type","text")}}},a.prototype.getModuleName=function(){return"datepicker"},a.prototype.disabledDates=function(i,s){void 0===i&&(i=!1),void 0===s&&(s=!1);var a,n=this.checkDateValue(this.value)?new Date(+this.value):new Date(this.checkValue(this.value)),r=this.previousDate;this.minMaxUpdates(),(!i||i&&!t.isNullOrUndefined(this.renderDayCell))&&e.prototype.render.call(this),this.previousDate=r;var l='*[id^="/id"]'.replace("/id",""+(n&&+n));this.strictMode||("string"==typeof this.value||"object"==typeof this.value&&+this.value!=+n)&&this.setProperties({value:n},!0),t.isNullOrUndefined(this.calendarElement)||t.isNullOrUndefined(this.calendarElement.querySelectorAll(l)[0])||this.calendarElement.querySelectorAll(l)[0].classList.contains("e-disabled")&&(this.strictMode||(this.currentDate=new Date((new Date).setHours(0,0,0,0))));var o;"datetimepicker"===this.getModuleName()?o="Gregorian"===this.calendarMode?this.globalize.formatDate(n,{format:t.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd"}):this.globalize.formatDate(n,{format:t.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"},o=this.globalize.formatDate(n,a)),this.popupObj||(this.updateInputValue(o),this.enableMask&&(this.updateInputValue(this.maskedDateValue),this.notify("createMask",{module:"MaskedDateTime",isBlur:s})))},a.prototype.setAriaAttributes=function(){this.isCalendar()?(s.Input.addAttributes({"aria-expanded":"true"},this.inputElement),t.attributes(this.inputElement,{"aria-owns":this.inputElement.id+"_options"}),t.attributes(this.inputElement,{"aria-controls":this.inputElement.id}),this.value&&t.attributes(this.inputElement,{"aria-activedescendant":""+this.setActiveDescendant()})):(s.Input.addAttributes({"aria-expanded":"false"},this.inputElement),this.inputElement.removeAttribute("aria-owns"),this.inputElement.removeAttribute("aria-controls"),this.inputElement.removeAttribute("aria-activedescendant"))},a.prototype.errorClass=function(){var e='*[id^="/id"]'.replace("/id",""+ +this.value),i=this.calendarElement&&this.calendarElement.querySelectorAll(e)[0]&&this.calendarElement.querySelectorAll(e)[0].classList.contains("e-disabled");!(t.isNullOrUndefined(this.value)||t.isNullOrUndefined(this.min)||t.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&&t.isNullOrUndefined(this.value)||i?(t.addClass([this.inputWrapper.container],"e-error"),t.attributes(this.inputElement,{"aria-invalid":"true"})):t.isNullOrUndefined(this.inputWrapper)||(t.removeClass([this.inputWrapper.container],"e-error"),t.attributes(this.inputElement,{"aria-invalid":"false"}))},a.prototype.onPropertyChanged=function(i,a){for(var n=0,r=Object.keys(i);n<r.length;n++){switch(r[n]){case"value":this.isDynamicValueChanged=!0,this.isInteracted=!1,this.invalidValueString=null,this.checkInvalidValue(i.value),i.value=this.value,this.previousElementValue=this.inputElement.value,t.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":s.Input.setPlaceholder(this.placeholder,this.inputElement);break;case"readonly":s.Input.setReadonly(this.readonly,this.inputElement);break;case"enabled":s.Input.setEnabled(this.enabled,this.inputElement),this.setAriaDisabled();break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.checkHtmlAttributes(!0);break;case"locale":this.globalize=new t.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.datepickerOptions&&null==this.datepickerOptions.placeholder&&(this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),s.Input.setPlaceholder(this.placeholder,this.inputElement)),this.updateInput(),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"});break;case"enableRtl":s.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]);break;case"start":case"depth":this.checkView(),this.calendarElement&&e.prototype.onPropertyChanged.call(this,i,a);break;case"zIndex":this.setProperties({zIndex:i.zIndex},!0);break;case"cssClass":this.updateCssClass(i.cssClass,a.cssClass);break;case"showClearButton":s.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(i.width),s.Input.calculateWidth(this.inputElement,this.inputWrapper.container),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.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=i.floatLabelType,s.Input.removeFloating(this.inputWrapper),s.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.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,i,a)}this.isDynamicValueChanged||this.hide(null),this.isDynamicValueChanged=!1}},S([t.Property(null)],a.prototype,"width",void 0),S([t.Property(null)],a.prototype,"value",void 0),S([t.Property(null)],a.prototype,"cssClass",void 0),S([t.Property(!1)],a.prototype,"strictMode",void 0),S([t.Property(null)],a.prototype,"format",void 0),S([t.Property(!0)],a.prototype,"enabled",void 0),S([t.Property(!1)],a.prototype,"fullScreenMode",void 0),S([t.Property({})],a.prototype,"htmlAttributes",void 0),S([t.Property(null)],a.prototype,"values",void 0),S([t.Property(!1)],a.prototype,"isMultiSelection",void 0),S([t.Property(!0)],a.prototype,"showClearButton",void 0),S([t.Property(!0)],a.prototype,"allowEdit",void 0),S([t.Property(null)],a.prototype,"keyConfigs",void 0),S([t.Property(!1)],a.prototype,"enablePersistence",void 0),S([t.Property(1e3)],a.prototype,"zIndex",void 0),S([t.Property(!1)],a.prototype,"readonly",void 0),S([t.Property(null)],a.prototype,"placeholder",void 0),S([t.Property("Never")],a.prototype,"floatLabelType",void 0),S([t.Property(null)],a.prototype,"serverTimezoneOffset",void 0),S([t.Property(!1)],a.prototype,"openOnFocus",void 0),S([t.Property(!1)],a.prototype,"enableMask",void 0),S([t.Property({day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"})],a.prototype,"maskPlaceholder",void 0),S([t.Event()],a.prototype,"open",void 0),S([t.Event()],a.prototype,"cleared",void 0),S([t.Event()],a.prototype,"close",void 0),S([t.Event()],a.prototype,"blur",void 0),S([t.Event()],a.prototype,"focus",void 0),S([t.Event()],a.prototype,"created",void 0),S([t.Event()],a.prototype,"destroyed",void 0),a=S([t.NotifyPropertyChanges],a)}(M),R=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)}}(),Y=function(e,t,i,s){var a,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(r=(n<3?a(r):n>3?a(t,i,r):a(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},z="e-left-calendar",q="e-right-calendar",K="e-daterangepicker",_="e-active",G="e-start-date",Z="e-end-date",X="e-input-focus",J="e-range-hover",$="e-other-month",Q="e-start-label",ee="e-end-label",te="e-disabled",ie="e-selected",se="e-calendar",ae="e-header",ne="e-title",re="e-icon-container",le="e-date-range-container",oe="e-presets",he="e-focused-date",ue="e-content",de="e-day-span",pe="e-week-number",ce="e-date-disabled",me="e-icon-disabled",fe="e-overlay",ve="e-list-item",ye="e-hover",ge="e-range-overflow",be="e-non-edit",De="e-daterange-hidden",Ee=["title","class","style"],Ce=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return R(i,e),Y([t.Property()],i.prototype,"label",void 0),Y([t.Property()],i.prototype,"start",void 0),Y([t.Property()],i.prototype,"end",void 0),i}(t.ChildProperty),ke=function(e){function r(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 R(r,e),r.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&&s.Input.calculateWidth(this.inputElement,this.inputWrapper.container),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.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"),!t.isNullOrUndefined(t.closest(this.element,"fieldset"))&&t.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete()},r.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=!!t.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),t.removeClass([this.cloneElement],[K,"e-control","e-lib"]),this.updateHtmlAttributeToElement(),this.element.getAttribute("id")?null!==this.angularTag&&(this.inputElement.id=this.element.getAttribute("id")+"_input"):(this.element.id=t.getUniqueID("ej2-datetimepicker"),null!==this.angularTag&&t.attributes(this.inputElement,{id:this.element.id+"_input"})),this.checkInvalidRange(this.value),!this.invalidValueString&&"string"==typeof this.value){var i=this.value.split(" "+this.separator+" ");this.value=[new Date(i[0]),new Date(i[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=t.closest(this.element,"form")},r.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())):t.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())},r.prototype.initProperty=function(){this.globalize=new t.Internationalization(this.locale),this.checkFormat(),this.checkView(),(t.isNullOrUndefined(this.firstDayOfWeek)||this.firstDayOfWeek>6||this.firstDayOfWeek<0)&&this.setProperties({firstDayOfWeek:this.globalize.getFirstDayOfWeek()},!0),this.updateValue()},r.prototype.checkFormat=function(){if(this.format)if("string"==typeof this.format)this.formatString=this.format;else if(""===this.format.skeleton||t.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},r.prototype.initialize=function(){null!==this.angularTag&&this.validationAttribute(this.element,this.inputElement),this.checkHtmlAttributes(!1),t.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 t.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()},r.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]))}},r.prototype.setRangeAllowEdit=function(){this.allowEdit?this.readonly||this.inputElement.removeAttribute("readonly"):t.attributes(this.inputElement,{readonly:""}),this.updateClearIconState()},r.prototype.updateClearIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&t.removeClass([this.inputWrapper.container],[be]):""===this.inputElement.value?t.removeClass([this.inputWrapper.container],[be]):t.addClass([this.inputWrapper.container],[be])},r.prototype.validationAttribute=function(e,i){var s=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id");i.setAttribute("name",s),e.removeAttribute("name");for(var a=["required","aria-required","form"],n=0;n<a.length;n++)if(!t.isNullOrUndefined(e.getAttribute(a[n]))){var r=e.getAttribute(a[n]);i.setAttribute(a[n],r),e.removeAttribute(a[n])}},r.prototype.updateHtmlAttributeToWrapper=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if(Ee.indexOf(s)>-1)if("class"===s){var a=this.htmlAttributes[""+s].replace(/\s+/g," ").trim();""!==a&&t.addClass([this.inputWrapper.container],a.split(" "))}else if("style"===s){var n=this.inputWrapper.container.getAttribute(s);n=t.isNullOrUndefined(n)?this.htmlAttributes[""+s]:n+this.htmlAttributes[""+s],this.inputWrapper.container.setAttribute(s,n)}else this.inputWrapper.container.setAttribute(s,this.htmlAttributes[""+s])}},r.prototype.updateHtmlAttributeToElement=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];Ee.indexOf(s)<0&&this.inputElement.setAttribute(s,this.htmlAttributes[""+s])}},r.prototype.updateCssClass=function(e,i){t.isNullOrUndefined(i)||(i=i.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e)||(e=e.replace(/\s+/g," ").trim()),s.Input.setCssClass(e,[this.inputWrapper.container],i),this.popupWrapper&&s.Input.setCssClass(e,[this.popupWrapper],i)},r.prototype.processPresets=function(){this.presetsItem=[];var e=0;if(!t.isUndefined(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)){for(var i=0,s=this.presets;i<s.length;i++){var a=s[i],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=t.isNullOrUndefined(this.startValue)?null:new Date(+this.startValue),l=t.isNullOrUndefined(this.endValue)?null:new Date(+this.endValue);this.presetsItem.push({id:"custom_range",text:this.l10n.getConstant("customRange"),start:r,end:l}),t.isNullOrUndefined(this.startValue)||t.isNullOrUndefined(this.endValue)||(this.isCustomRange=!0,this.activeIndex=this.presetsItem.length-1)}},r.prototype.bindEvents=function(){t.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler,this),t.EventHandler.add(this.inputElement,"focus",this.inputFocusHandler,this),t.EventHandler.add(this.inputElement,"blur",this.inputBlurHandler,this),t.EventHandler.add(this.inputElement,"change",this.inputChangeHandler,this),this.showClearButton&&this.inputWrapper.clearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this),this.isMobile||(this.keyInputConfigs=t.extend(this.keyInputConfigs,this.keyConfigs),this.inputKeyboardModule=new t.KeyboardEvents(this.inputElement,{eventName:"keydown",keyAction:this.inputHandler.bind(this),keyConfigs:this.keyInputConfigs})),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this),this.enabled?this.inputElement.setAttribute("tabindex",this.tabIndex):this.inputElement.tabIndex=-1},r.prototype.unBindEvents=function(){t.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler),t.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),t.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),t.EventHandler.remove(this.inputElement,"change",this.inputChangeHandler),this.showClearButton&&this.inputWrapper.clearButton&&t.EventHandler.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler),this.isMobile||t.isNullOrUndefined(this.inputKeyboardModule)||this.inputKeyboardModule.destroy(),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler),this.inputElement.tabIndex=-1},r.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")}},r.prototype.inputChangeHandler=function(e){this.enabled&&(e.stopPropagation(),this.updateHiddenInput())},r.prototype.bindClearEvent=function(){this.showClearButton&&this.inputWrapper.clearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this)},r.prototype.resetHandler=function(e){if(this.enabled){this.valueType=this.value,e.preventDefault(),this.clear();var i={event:e};if(this.setProperties({endDate:this.checkDateValue(this.endValue)},!0),this.setProperties({startDate:this.checkDateValue(this.startValue)},!0),this.trigger("cleared",i),this.changeTrigger(e),this.clearRange(),this.hide(e),t.closest(this.element,"form")){var s=this.firstHiddenChild,a=document.createEvent("KeyboardEvent");a.initEvent("keyup",!1,!0),s.dispatchEvent(a)}}},r.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()},r.prototype.formResetHandler=function(e){if(this.enabled&&this.formElement&&e.target===this.formElement&&!this.inputElement.disabled){var i=this.inputElement.getAttribute("value");t.isNullOrUndefined(this.startCopy)?(this.setProperties({value:null,startDate:null,endDate:null},!0),this.startValue=this.endValue=null):(t.isNullOrUndefined(this.value)||t.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),i="",this.startValue=this.endValue=null,this.inputElement.setAttribute("value","")),this.restoreValue(),this.inputElement&&(s.Input.setValue(i,this.inputElement,this.floatLabelType,this.showClearButton),this.errorClass())}},r.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),s.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),t.isNullOrUndefined(this.applyButton)||(this.applyButton.disabled=this.applyButton.element.disabled=!0),this.removeSelection()},r.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||t.isNullOrUndefined(this.leftCalendar)||(this.isRangeIconClicked=!1,this.calendarFocus(),this.isRangeIconClicked=!0),t.addClass([this.inputWrapper.container],[X])))},r.prototype.checkHtmlAttributes=function(e){this.globalize=new t.Internationalization(this.locale);for(var i=e?t.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=i;a<n.length;a++){var r=n[a];if(!t.isNullOrUndefined(this.inputElement.getAttribute(r)))switch(r){case"disabled":if(t.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(t.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":(t.isNullOrUndefined(this.dateRangeOptions)||void 0===this.dateRangeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(r)},!e);break;case"value":if(t.isNullOrUndefined(this.dateRangeOptions)||void 0===this.dateRangeOptions.value||e){var h=this.inputElement.getAttribute(r);this.setProperties(t.setValue(r,h,{}),!e)}break;case"style":this.inputElement.setAttribute("style",""+this.inputElement.getAttribute(r));break;case"min":if(t.isNullOrUndefined(this.min)||+this.min==+new Date(1900,0,1)||e){var u=this.globalize.parseDate(this.inputElement.getAttribute(r),s);this.setProperties(t.setValue(r,u,{}),!e)}break;case"name":this.inputElement.setAttribute("name",""+this.inputElement.getAttribute(r));break;case"max":if(t.isNullOrUndefined(this.max)||+this.max==+new Date(2099,11,31)||e){u=this.globalize.parseDate(this.inputElement.getAttribute(r),s);this.setProperties(t.setValue(r,u,{}),!e)}break;case"startDate":if(t.isNullOrUndefined(this.startDate)){u=this.globalize.parseDate(this.inputElement.getAttribute(r),s);this.startValue=u,this.setValue()}break;case"endDate":if(t.isNullOrUndefined(this.endDate)){u=this.globalize.parseDate(this.inputElement.getAttribute(r),s);this.endValue=u,this.setValue()}break;case"minDays":t.isNullOrUndefined(this.minDays)&&this.setProperties(t.setValue(r,parseInt(this.inputElement.getAttribute(r),10),{}),!0);break;case"maxDays":t.isNullOrUndefined(this.maxDays)&&this.setProperties(t.setValue(r,parseInt(this.inputElement.getAttribute(r),10),{}),!0);break;case"type":"text"!==this.inputElement.getAttribute(r)&&this.inputElement.setAttribute("type","text")}}},r.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 i=this.presetsItem[e].start,s=this.presetsItem[e].end;this.startValue&&this.endValue&&i.getDate()==this.startValue.getDate()&&i.getMonth()==this.startValue.getMonth()&&i.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=t.createElement("div",{id:this.element.id+"_popup",className:K+" e-popup"}),this.popupWrapper.setAttribute("aria-label",this.element.id),this.popupWrapper.setAttribute("role","dialog"),this.adjustLongHeaderWidth();var a=!this.isCustomRange||this.isMobile;!t.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())},r.prototype.renderControl=function(){this.createControl(),this.bindCalendarEvents(),this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar]),t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)||t.isNullOrUndefined(this.renderDayCellArgs)||!this.renderDayCellArgs.isDisabled||this.disabledDateRender(),this.updateHeader()},r.prototype.clearCalendarEvents=function(){this.leftCalPrevIcon&&this.leftCalNextIcon&&this.rightCalPrevIcon&&this.rightCalNextIcon&&(t.EventHandler.clearEvents(this.leftCalPrevIcon),t.EventHandler.clearEvents(this.leftCalNextIcon),t.EventHandler.clearEvents(this.rightCalPrevIcon),t.EventHandler.clearEvents(this.rightCalNextIcon))},r.prototype.updateNavIcons=function(){e.prototype.iconHandler.call(this)},r.prototype.calendarIconEvent=function(){this.clearCalendarEvents(),this.leftCalPrevIcon&&!this.leftCalPrevIcon.classList.contains(te)&&t.EventHandler.add(this.leftCalPrevIcon,"mousedown",this.navPrevFunction),this.leftCalNextIcon&&!this.leftCalNextIcon.classList.contains(te)&&t.EventHandler.add(this.leftCalNextIcon,"mousedown",this.navNextFunction),this.rightCalPrevIcon&&!this.rightCalPrevIcon.classList.contains(te)&&t.EventHandler.add(this.rightCalPrevIcon,"mousedown",this.navPrevFunction),this.rightCalNextIcon&&!this.rightCalNextIcon.classList.contains(te)&&t.EventHandler.add(this.rightCalNextIcon,"mousedown",this.navNextFunction)},r.prototype.bindCalendarEvents=function(){this.isMobile?(this.deviceCalendarEvent(),t.EventHandler.add(this.startButton.element,"click",this.deviceHeaderClick,this),t.EventHandler.add(this.endButton.element,"click",this.deviceHeaderClick,this)):(this.updateNavIcons(),this.calendarIconEvent(),this.calendarIconRipple(),this.headerTitleElement=this.popupObj.element.querySelector("."+q+" ."+ae+" ."+ne),this.headerTitleElement=this.popupObj.element.querySelector("."+z+" ."+ae+" ."+ne),this.defaultKeyConfigs=t.extend(this.defaultKeyConfigs,this.keyConfigs),this.leftKeyboardModule=new t.KeyboardEvents(this.leftCalendar,{eventName:"keydown",keyAction:this.keyInputHandler.bind(this),keyConfigs:this.defaultKeyConfigs}),this.rightKeyboardModule=new t.KeyboardEvents(this.rightCalendar,{eventName:"keydown",keyAction:this.keyInputHandler.bind(this),keyConfigs:this.defaultKeyConfigs})),this.start===this.depth&&this.bindCalendarCellEvents(),this.removeFocusedDate()},r.prototype.calendarIconRipple=function(){t.rippleEffect(this.leftCalPrevIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),t.rippleEffect(this.leftCalNextIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),t.rippleEffect(this.rightCalPrevIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),t.rippleEffect(this.rightCalNextIcon,{selector:".e-next",duration:400,isCenterRipple:!0})},r.prototype.deviceCalendarEvent=function(){t.EventHandler.clearEvents(this.nextIcon),t.EventHandler.clearEvents(this.previousIcon),t.rippleEffect(this.nextIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),t.rippleEffect(this.previousIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),this.nextIcon&&!this.nextIcon.classList.contains(te)&&t.EventHandler.add(this.nextIcon,"mousedown",this.deviceNavNextFunction),this.previousIcon&&!this.previousIcon.classList.contains(te)&&t.EventHandler.add(this.previousIcon,"mousedown",this.deviceNavPrevFunction)},r.prototype.deviceNavNext=function(e){var i=t.closest(e.target,"."+se);this.updateDeviceCalendar(i),this.navigateNext(e),this.deviceNavigation()},r.prototype.deviceNavPrevious=function(e){var i=t.closest(e.target,"."+se);this.updateDeviceCalendar(i),this.navigatePrevious(e),this.deviceNavigation()},r.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("."+ue),this.tableBodyElement=t.select(".e-content tbody",e),this.table=e.querySelector("."+ue).getElementsByTagName("table")[0],this.headerTitleElement=e.querySelector(".e-header ."+ne),this.headerElement=e.querySelector("."+ae))},r.prototype.deviceHeaderClick=function(e){if(e.currentTarget.classList.contains("e-start-btn")&&!t.isNullOrUndefined(this.startValue)){this.endButton.element.classList.remove(_),this.startButton.element.classList.add(_);var i=this.popupObj.element.querySelector("."+se);this.updateDeviceCalendar(i),t.isNullOrUndefined(this.calendarElement.querySelector("."+G+":not(.e-other-month)"))&&(this.currentDate=new Date(+this.startValue),t.remove(this.tableBodyElement),this.createContentBody(),this.deviceNavigation()),this.removeClassDisabled()}else if(!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue)){this.startButton.element.classList.remove(_),this.endButton.element.classList.add(_);i=this.popupObj.element.querySelector("."+se);this.updateDeviceCalendar(i),t.isNullOrUndefined(this.calendarElement.querySelector("."+Z+":not(.e-other-month)"))&&(this.currentDate=new Date(+this.endValue),t.remove(this.tableBodyElement),this.createContentBody(),this.deviceNavigation()),this.updateMinMaxDays(this.popupObj.element.querySelector("."+se)),this.selectableDates()}},r.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}},r.prototype.inputBlurHandler=function(e){if(this.enabled){if(!this.preventBlur){var i=this.inputElement.value;if(t.isNullOrUndefined(this.presetsItem)||this.presetsItem.length>0&&this.previousEleValue!==this.inputElement.value&&(this.activeIndex=this.presetsItem.length-1,this.isCustomRange=!0),!t.isNullOrUndefined(i)&&""!==i.trim()){var a=i.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),l=this.globalize.parseDate(a[1],n),o=this.getStartEndDate(r,!1,a,n),h=this.getStartEndDate(l,!0,a,n);if(!(t.isNullOrUndefined(o)||isNaN(+o)||t.isNullOrUndefined(h)||isNaN(+h))){var u=this.startValue;this.startValue=o;var d=this.endValue;if(this.endValue=h,this.setValue(),this.refreshControl(),i!==this.previousEleValue&&this.changeTrigger(e),!this.preventBlur&&document.activeElement!==this.inputElement){this.preventFocus=!1;var p={model:this};this.trigger("blur",p)}return this.updateHiddenInput(),void(this.isMobile&&this.isPopupOpen()&&(this.startValue=u,this.endValue=d))}this.strictMode||(this.startValue=null,this.endValue=null,this.setValue())}else this.strictMode||(this.startValue=null,this.endValue=null,this.setValue())}if(this.strictMode?(t.isNullOrUndefined(i)||""!==i.trim()||(this.startValue=null,this.endValue=null),s.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.updateInput()):(t.isNullOrUndefined(this.popupObj)&&(this.currentDate=null),this.previousStartValue=this.previousEndValue=null,this.startValue=null,this.endValue=null,this.setValue()),this.errorClass(),this.changeTrigger(e),!this.preventBlur&&document.activeElement!==this.inputElement){this.preventFocus=!1;p={model:this};this.trigger("blur",p)}}this.updateHiddenInput()}},r.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)},r.prototype.clearRange=function(){this.previousStartValue=this.previousEndValue=null,this.currentDate=null},r.prototype.errorClass=function(){var e=this.inputElement.value.trim();(t.isNullOrUndefined(this.endValue)&&t.isNullOrUndefined(this.startValue)&&""!==e||!t.isNullOrUndefined(this.startValue)&&+this.startValue<+this.min||!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue)&&+this.startValue>+this.endValue||!t.isNullOrUndefined(this.endValue)&&+this.endValue>+this.max||this.startValue&&this.isDateDisabled(this.startValue)||this.endValue&&this.isDateDisabled(this.endValue))&&""!==e?(t.addClass([this.inputWrapper.container],"e-error"),t.attributes(this.inputElement,{"aria-invalid":"true"})):this.inputWrapper&&(t.removeClass([this.inputWrapper.container],"e-error"),t.attributes(this.inputElement,{"aria-invalid":"false"}))},r.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},r.prototype.navInCalendar=function(e,i,s,a,n){var r,l,o=this.getViewNumber(this.currentView()),h=this.min;switch(l=t.isNullOrUndefined(this.maxDays)||!this.isMaxDaysClicked||t.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),i&&+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),i||+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&&!i&&(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),i&&+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),t.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),t.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,z)&&(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,q)&&(n=this.keyCalendarUpdate(!0,n,!1),this.currentDate=this.firstCellToFocus(this.leftCalendar),this.keyboardNavigate(0,o,e,l,h),this.keyNavigation(n,e))}},r.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},r.prototype.keyInputHandler=function(i,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=t.closest(i.target,"."+q),h=(o=t.isNullOrUndefined(o)?this.leftCalendar:o).classList.contains(z);this.updateCalendarElement(o);var u=this.tableBodyElement.querySelector("tr td.e-selected"),d=o.querySelector("tr td."+he),p=o.querySelector("tr td."+G),c=o.querySelector("tr td."+Z),m=this.getViewNumber(this.depth),f=n===m&&this.getViewNumber(this.start)>=m,v=t.closest(i.target,"."+z),y=t.closest(i.target,"."+q),g=t.closest(i.target,"."+oe);switch(t.isNullOrUndefined(d)?t.isNullOrUndefined(c)||this.dateDisabled?t.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="",i.action){case"altUpArrow":this.isPopupOpen()&&(this.hide(i),this.preventFocus=!0,this.inputElement.focus(),t.addClass([this.inputWrapper.container],[X]));break;case"select":if(f){var b=t.isNullOrUndefined(d)?p:d;t.isNullOrUndefined(b)||b.classList.contains(te)||this.selectRange(null,b)}else(t.isNullOrUndefined(u)||f)&&t.isNullOrUndefined(d)||(t.isNullOrUndefined(this.value)||(s=this.calendarElement.classList.contains(z)?this.startDate:this.endDate),this.controlDown=i,this.contentClick(null,--n,d||u,s));i.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,i);break;case"altRightArrow":t.isNullOrUndefined(v)?t.isNullOrUndefined(y)?t.isNullOrUndefined(g)||this.cancelButton.element.focus():t.isNullOrUndefined(this.presetElement)?this.cancelButton.element.focus():(this.presetElement.focus(),this.removeFocusedDate()):this.rightCalendar.children[1].firstElementChild.focus(),i.preventDefault();break;case"altLeftArrow":t.isNullOrUndefined(v)?t.isNullOrUndefined(y)||this.leftCalendar.children[1].firstElementChild.focus():!0!==this.applyButton.element.disabled?this.applyButton.element.focus():this.cancelButton.element.focus(),i.preventDefault();break;case"controlUp":this.calendarElement.classList.contains(z),this.calendarNavigation(i,this.calendarElement),i.preventDefault();break;case"controlDown":t.isNullOrUndefined(u)&&t.isNullOrUndefined(d)||f||(t.isNullOrUndefined(this.value)||(s=this.calendarElement.classList.contains(z)?this.startDate:this.endDate),this.controlDown=i,this.contentClick(null,--n,u||d,s)),i.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,i);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,i);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,i);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,i);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,i);break;case"shiftTab":t.isNullOrUndefined(this.presetElement)||(this.presetElement.setAttribute("tabindex","0"),this.presetElement.focus(),this.removeFocusedDate()),h&&i.preventDefault(),this.tabKeyValidation(o,q)&&(this.currentDate=new Date(+this.leftCalCurrentDate),this.navInCalendar(i,h,l,r,o));break;case"spacebar":this.applyButton&&!this.applyButton.disabled&&this.applyFunction(i);break;case"tab":this.tabKeyValidation(o,z)&&(this.currentDate=new Date(+this.rightCalCurrentDate),this.navInCalendar(i,h,l,r,o));break;default:this.navInCalendar(i,h,l,r,o),this.checkMinMaxDays()}this.presetHeight()},r.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},r.prototype.keyNavigation=function(e,t){this.bindCalendarCellEvents(e),e.classList.contains(z)?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()},r.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||t.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())}},r.prototype.bindCalendarCellEvents=function(e){for(var i=0,s=e?e.querySelectorAll("."+se+" td"):this.popupObj.element.querySelectorAll("."+se+" td");i<s.length;i++){var a=s[i];t.EventHandler.clearEvents(a);a.classList.contains(te)||a.classList.contains(ce)||a.classList.contains(pe)||(this.isMobile||t.EventHandler.add(a,"mouseover",this.hoverSelection,this),t.EventHandler.add(a,"mousedown",this.selectRange,this))}},r.prototype.removeFocusedDate=function(){for(var e=!t.isNullOrUndefined(this.startValue)||!t.isNullOrUndefined(this.endValue),i=0,s=this.popupObj.element.querySelectorAll("."+se+" ."+he);i<s.length;i++){var a=s[i],n=new Date,r=this.getIdValue(null,a);("Month"===this.depth&&"Month"===this.currentView()&&(!a.classList.contains("e-today")||a.classList.contains("e-today")&&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(he),a.classList.contains(G)||a.classList.contains(Z)||a.removeAttribute("aria-label"))}},r.prototype.hoverSelection=function(e,i){var s=i||e.currentTarget,a=this.getIdValue(null,s);if(!t.isNullOrUndefined(this.startValue)&&+this.startValue>=+this.min&&+this.startValue<=+this.max&&(!this.isDateDisabled(this.endValue)&&!this.isDateDisabled(this.startValue)&&t.isNullOrUndefined(this.endValue)&&t.isNullOrUndefined(this.startValue)||!t.isNullOrUndefined(this.startValue)&&t.isNullOrUndefined(this.endValue)))for(var n=0,r=this.popupObj.element.querySelectorAll("."+se+" td");n<r.length;n++){var l=r[n],o=!l.classList.contains(te)||l.classList.contains(ce);if(!l.classList.contains(pe)&&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?t.addClass([l],J):t.removeClass([l],[J])}}},r.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},r.prototype.updateRange=function(e){if(!t.isNullOrUndefined(this.startValue))for(var i=0,s=e;i<s.length;i++)for(var a=0,n=s[i].querySelectorAll("."+se+" td");a<n.length;a++){var r=n[a];if(!r.classList.contains(pe)&&!r.classList.contains(te)){var l=this.getIdValue(null,r),o=this.getIdValue(null,r);if(t.isNullOrUndefined(this.endValue)?t.removeClass([r],[J]):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)&&t.addClass([r],J),r.classList.contains(ie)&&r.classList.contains(Z)&&+o!=+this.endValue&&(t.removeClass([r],[ie]),t.removeClass([r],[Z])),r.classList.contains(J)&&+o>+this.endValue&&t.removeClass([r],[J]),!r.classList.contains($)){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)&&(t.addClass([r],[G,ie]),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&&!t.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)&&(t.addClass([r],[Z,ie]),this.addSelectedAttributes(r,this.startValue,!1)),+l!=+this.startValue||t.isNullOrUndefined(this.endValue)||+l!=+this.endValue||this.addSelectedAttributes(r,this.endValue,!1,!0)}}}},r.prototype.checkMinMaxDays=function(){(!t.isNullOrUndefined(this.minDays)&&this.minDays>0||!t.isNullOrUndefined(this.maxDays)&&this.maxDays>0)&&(this.isMobile?this.updateMinMaxDays(this.popupObj.element.querySelector("."+se)):(this.updateMinMaxDays(this.popupObj.element.querySelector("."+z)),this.updateMinMaxDays(this.popupObj.element.querySelector("."+q))))},r.prototype.rangeArgs=function(e){var i,s,a=t.isNullOrUndefined(this.startValue)?null:this.globalize.formatDate(this.startValue,{format:this.formatString,type:"date",skeleton:"yMd"}),n=t.isNullOrUndefined(this.endValue)?null:this.globalize.formatDate(this.endValue,{format:this.formatString,type:"date",skeleton:"yMd"});t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)?(i="",s=0):(i=a+" "+this.separator+" "+n,s=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1);return{value:this.value,startDate:this.startValue,endDate:this.endValue,daySpan:s,event:e||null,element:this.element,isInteracted:!t.isNullOrUndefined(e),text:i}},r.prototype.otherMonthSelect=function(e,i,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);t.isNullOrUndefined(r)||(i?(t.addClass([r],[G,ie]),this.addSelectedAttributes(r,this.startValue,!0)):(t.addClass([r],[Z,ie]),this.addSelectedAttributes(r,this.endValue,!0)),s&&this.addSelectedAttributes(e,this.endValue,!1,!0))},r.prototype.selectRange=function(e,i){var s,a;e&&e.preventDefault();var n=t.isNullOrUndefined(e)?this.getIdValue(null,i):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);t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)?this.isMobile&&this.startButton.element.classList.contains(_)&&this.removeSelection():(!this.isMobile||this.isMobile&&!this.endButton.element.classList.contains(_))&&this.removeSelection();var p=i||e.currentTarget;if(t.isNullOrUndefined(this.startValue))t.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(),t.addClass([p],G),this.addSelectedAttributes(p,this.startValue,!0),p.classList.contains($)&&this.otherMonthSelect(p,!0),this.checkMinMaxDays(),this.applyButton.disabled=!0,this.applyButton.element.disabled=!0,this.isMobile&&(this.endButton.element.classList.add(_),this.startButton.element.classList.remove(_),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&&!t.isNullOrUndefined(this.minDays)&&this.minDays>1)return;this.endValue=null,this.setValue(),(this.isMobile||i)&&this.hoverSelection(e,i),t.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("."+Z);if(this.isMobile){this.startButton.element.classList.remove(_),this.endButton.element.classList.add(_);for(var m=0,f=c;m<f.length;m++){var v=f[m];v.removeAttribute("aria-label"),v.classList.contains(G)?(this.addSelectedAttributes(v,this.startValue,!0),t.removeClass([v],[Z])):(v.setAttribute("aria-selected","false"),t.removeClass([v],[Z,ie]))}}t.addClass([p],Z),+this.endValue==+this.startValue?this.addSelectedAttributes(p,this.endValue,!1,!0):this.addSelectedAttributes(p,this.endValue,!1),p.classList.contains($)&&(+this.endValue==+this.startValue?this.otherMonthSelect(p,!1,!0):this.otherMonthSelect(p,!1));for(var y=0,g=c=this.popupObj.element.querySelectorAll("."+Z);y<g.length;y++){var b=g[y];b.classList.contains(G)&&t.removeClass([b],[J])}this.applyButton.disabled=!1,this.applyButton.element.disabled=!1,this.isMobile||this.removeClassDisabled(),!t.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(),t.removeClass(this.popupObj.element.querySelectorAll("."+G),[G,ie]),t.addClass([p],G),this.addSelectedAttributes(p,this.startValue,!0),p.classList.contains($)&&this.otherMonthSelect(p,!0),this.checkMinMaxDays());e&&(s=t.closest(e.target,"."+z)),t.isNullOrUndefined(s)?(e&&(a=e&&t.closest(e.target,"."+q)),t.isNullOrUndefined(a)||this.rightCalendar.children[1].firstElementChild.focus()):this.leftCalendar.children[1].firstElementChild.focus(),t.addClass([p],ie),this.calendarIconEvent(),this.updateHeader(),this.removeFocusedDate()},r.prototype.selectableDates=function(){if(!t.isNullOrUndefined(this.startValue)){var e=this.calendarElement.querySelectorAll("."+se+" td"),i=!1;if(this.currentView()===this.depth){for(var s=0,a=e;s<a.length;s++){if(!(l=a[s]).classList.contains(G)&&!l.classList.contains(pe)&&!l.classList.contains(te)){if(+this.getIdValue(null,l)<+this.startValue){t.addClass([l],[ce,te,fe]),t.EventHandler.clearEvents(l);continue}break}if(l.classList.contains(G)&&!l.classList.contains($)){i=!0;break}}i&&(this.previousIcon.classList.contains(te)||t.addClass([this.previousIcon],[me,te,fe]))}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(_)||!("Year"===this.currentView()&&u.getMonth()<o&&u.getFullYear()<=h||"Decade"===this.currentView()&&u.getMonth()<=o&&u.getFullYear()<h))break;t.addClass([l],[te])}e[0].classList.contains(te)?this.previousIconHandler(!0):e[e.length-1].classList.contains(te)&&this.nextIconHandler(!0)}}},r.prototype.updateMinMaxDays=function(e){if(!t.isNullOrUndefined(this.startValue)&&t.isNullOrUndefined(this.endValue)||this.isMobile&&this.endButton.element.classList.contains(_)){if(!t.isNullOrUndefined(this.minDays)&&this.minDays>0||!t.isNullOrUndefined(this.maxDays)&&this.maxDays>0){var i=this.removeTimeValueFromDate(this.startValue),s=new Date(new Date(+i).setDate(i.getDate()+(this.minDays-1))),a=new Date(new Date(+i).setDate(i.getDate()+(this.maxDays-1)));s=!t.isNullOrUndefined(this.minDays)&&this.minDays>0?s:null,a=!t.isNullOrUndefined(this.maxDays)&&this.maxDays>0?a:null,"Year"===this.currentView()?(s=t.isNullOrUndefined(s)?null:new Date(s.getFullYear(),s.getMonth(),0),a=t.isNullOrUndefined(a)?null:new Date(a.getFullYear(),a.getMonth(),1)):"Decade"===this.currentView()&&(s=t.isNullOrUndefined(s)?null:new Date(s.getFullYear()-1,11,1),a=t.isNullOrUndefined(a)?null:new Date(a.getFullYear(),0,1));for(var n=void 0,r=0,l=e.querySelectorAll("."+se+" td");r<l.length;r++){var o=l[r];if(!o.classList.contains(G)&&!o.classList.contains(pe)){var h=this.getIdValue(null,o);if(h=this.removeTimeValueFromDate(h),!t.isNullOrUndefined(s)&&+h==+s&&o.classList.contains(te)&&s.setDate(s.getDate()+1),!o.classList.contains(te)){if(+h<=+i)continue;!t.isNullOrUndefined(s)&&+h<+s&&(t.addClass([o],[ce,te,fe]),t.EventHandler.clearEvents(o)),!t.isNullOrUndefined(a)&&+h>+a&&(t.addClass([o],[ce,te,fe]),this.isMaxDaysClicked=!0,t.EventHandler.clearEvents(o),t.isNullOrUndefined(n)&&!o.classList.contains($)&&(n=o))}}}if(!t.isNullOrUndefined(n))if(this.isMobile)this.nextIcon.classList.contains(te)||t.addClass([this.nextIcon],[me,te,fe]);else{var u=t.closest(n,"."+q);(u=t.isNullOrUndefined(u)?this.leftCalendar:u).classList.contains(z)?(this.rightCalNextIcon.classList.contains(te)||t.addClass([this.rightCalNextIcon],[me,te,fe]),this.leftCalNextIcon.classList.contains(te)||t.addClass([this.leftCalNextIcon],[me,te,fe]),this.rightCalPrevIcon.classList.contains(te)||t.addClass([this.rightCalPrevIcon],[me,te,fe])):this.rightCalNextIcon.classList.contains(te)||t.addClass([this.rightCalNextIcon],[me,te,fe])}}}else this.isMaxDaysClicked=!1},r.prototype.removeTimeValueFromDate=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())},r.prototype.removeClassDisabled=function(){for(var e=0,i=this.popupObj.element.querySelectorAll("."+se+" td."+ce);e<i.length;e++){var s=i[e];s.classList.contains(ce)&&(t.removeClass([s],[ce,te,fe]),t.EventHandler.add(s,"click",this.selectRange,this),this.isMobile||t.EventHandler.add(s,"mouseover",this.hoverSelection,this))}this.isMobile?(this.nextIcon.classList.contains(me)&&t.removeClass([this.nextIcon],[me,te,fe]),this.previousIcon.classList.contains(me)&&t.removeClass([this.previousIcon],[me,te,fe])):(this.rightCalNextIcon.classList.contains(me)&&t.removeClass([this.rightCalNextIcon],[me,te,fe]),this.rightCalPrevIcon.classList.contains(me)&&t.removeClass([this.rightCalPrevIcon],[me,te,fe]),this.leftCalNextIcon.classList.contains(me)&&t.removeClass([this.leftCalNextIcon],[me,te,fe]))},r.prototype.updateHeader=function(){var e={type:"date",skeleton:"yMMMd"};if(t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue))this.popupObj.element.querySelector("."+de).textContent=this.l10n.getConstant("selectedDays");else{var i=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1;t.isNullOrUndefined(this.disabledDayCnt)||(i-=this.disabledDayCnt,this.disabledDayCnt=null),this.popupObj.element.querySelector("."+de).textContent=i.toString()+" "+this.l10n.getConstant("days")}this.isMobile?(t.isNullOrUndefined(this.startValue)?this.startButton.element.textContent=this.l10n.getConstant("startLabel"):this.startButton.element.textContent=this.globalize.formatDate(this.startValue,e),t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)?this.endButton.element.textContent=this.l10n.getConstant("endLabel"):this.endButton.element.textContent=this.globalize.formatDate(this.endValue,e)):(t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)?this.popupObj.element.querySelector("."+ee).textContent=this.l10n.getConstant("endLabel"):this.popupObj.element.querySelector("."+ee).textContent=this.globalize.formatDate(this.endValue,e),t.isNullOrUndefined(this.startValue)?this.popupObj.element.querySelector("."+Q).textContent=this.l10n.getConstant("startLabel"):this.popupObj.element.querySelector("."+Q).textContent=this.globalize.formatDate(this.startValue,e)),(this.isDateDisabled(this.startValue)||this.isDateDisabled(this.endValue)||!t.isNullOrUndefined(this.startValue)&&+this.startValue<+this.min||!t.isNullOrUndefined(this.endValue)&&+this.endValue>+this.max||!t.isNullOrUndefined(this.startValue)&&!t.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("."+de).textContent=this.l10n.getConstant("selectedDays")):(this.popupObj.element.querySelector("."+de).textContent=this.l10n.getConstant("selectedDays"),this.popupObj.element.querySelector("."+Q).textContent=this.l10n.getConstant("startLabel"),this.popupObj.element.querySelector("."+ee).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")},r.prototype.removeSelection=function(){this.startValue=null,this.endValue=null,this.setValue(),this.removeSelectedAttributes(),this.popupObj&&(this.popupObj.element.querySelectorAll("."+ie).length>0&&t.removeClass(this.popupObj.element.querySelectorAll("."+ie),[G,Z,ie]),this.popupObj.element.querySelectorAll("."+he).length>0&&t.removeClass(this.popupObj.element.querySelectorAll("."+he),he),this.popupObj.element.querySelectorAll("."+J).length>0&&t.removeClass(this.popupObj.element.querySelectorAll("."+J),[J]))},r.prototype.addSelectedAttributes=function(e,i,s,a){if(e){var n=this.globalize.formatDate(i,{type:"date",skeleton:"full"});!t.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")}},r.prototype.removeSelectedAttributes=function(){if(this.popupObj){for(var e=0,t=this.popupObj.element.querySelectorAll("."+G);e<t.length;e++){(a=t[e]).setAttribute("aria-selected","false"),a.removeAttribute("aria-label")}for(var i=0,s=this.popupObj.element.querySelectorAll("."+Z);i<s.length;i++){var a;(a=s[i]).setAttribute("aria-selected","false"),a.removeAttribute("aria-label")}}},r.prototype.updateCalendarElement=function(e){e.classList.contains(z)?(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("."+ue),this.tableBodyElement=t.select(".e-content tbody",e),this.table=e.querySelector("."+ue).getElementsByTagName("table")[0],this.headerTitleElement=e.querySelector(".e-header ."+ne),this.headerElement=e.querySelector("."+ae)},r.prototype.navPrevMonth=function(e){e.preventDefault();var i=t.closest(e.target,"."+z);i=t.isNullOrUndefined(i)?t.closest(e.target,"."+q):i,this.updateCalendarElement(i),this.navigatePrevious(e),!t.isNullOrUndefined(this.startValue)&&t.isNullOrUndefined(this.endValue)&&this.updateMinMaxDays(i),this.updateControl(i)},r.prototype.deviceNavigation=function(e){this.deviceCalendarEvent(),this.updateRange([this.popupObj.element.querySelector("."+se)]),this.endButton.element.classList.contains(_)&&this.updateMinMaxDays(this.popupObj.element.querySelector("."+se)),this.endButton.element.classList.contains(_)&&this.selectableDates(),this.currentView()===this.depth&&this.bindCalendarCellEvents(),this.removeFocusedDate()},r.prototype.updateControl=function(e,t){void 0===t&&(t=null),e.classList.contains(q)?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])},r.prototype.navNextMonth=function(e){e.preventDefault();var i=t.closest(e.target,"."+z);i=t.isNullOrUndefined(i)?t.closest(e.target,"."+q):i,this.updateCalendarElement(i),this.navigateNext(e),!t.isNullOrUndefined(this.startValue)&&t.isNullOrUndefined(this.endValue)&&this.updateMinMaxDays(i),this.updateControl(i)},r.prototype.isPopupOpen=function(){return!(t.isNullOrUndefined(this.popupObj)||!this.popupObj.element.classList.contains("e-popup"))},r.prototype.createRangeHeader=function(){var e=this.createElement("div",{className:"e-start-end"});if(this.isMobile){var i=this.createElement("button",{className:"e-end-btn"}),s=this.createElement("button",{className:"e-start-btn"});this.startButton=new a.Button({content:this.l10n.getConstant("startLabel")},s),this.endButton=new a.Button({content:this.l10n.getConstant("endLabel")},i),e.appendChild(s),e.appendChild(i)}else{var n=this.createElement("a",{className:Q}),r=this.createElement("a",{className:ee}),l=this.createElement("span",{className:"e-change-icon e-icons"});t.attributes(n,{"aria-atomic":"true","aria-live":"assertive","aria-label":"Start Date",role:"button"}),t.attributes(r,{"aria-atomic":"true","aria-live":"assertive","aria-label":"End Date",role:"button"}),e.appendChild(n),e.appendChild(l),e.appendChild(r),n.textContent=this.l10n.getConstant("startLabel"),r.textContent=this.l10n.getConstant("endLabel")}return e},r.prototype.disableInput=function(){this.strictMode?t.isNullOrUndefined(this.previousStartValue)||t.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),s.Input.setEnabled(this.enabled,this.inputElement),this.bindEvents()},r.prototype.validateMinMax=function(){this.min=t.isNullOrUndefined(this.min)||!+this.min?this.min=new Date(1900,0,1):this.min,this.max=t.isNullOrUndefined(this.max)||!+this.max?this.max=new Date(2099,11,31):this.max,this.min<=this.max?(t.isNullOrUndefined(this.minDays)||t.isNullOrUndefined(this.maxDays)||this.maxDays>0&&this.minDays>0&&this.minDays>this.maxDays&&(this.maxDays=null),!t.isNullOrUndefined(this.minDays)&&this.minDays<0&&(this.minDays=null),!t.isNullOrUndefined(this.maxDays)&&this.maxDays<0&&(this.maxDays=null)):this.disableInput()},r.prototype.validateRangeStrict=function(){t.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)),t.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()},r.prototype.validateRange=function(){this.validateMinMaxDays()},r.prototype.validateMinMaxDays=function(){if(!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue)){var e=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1;if(!t.isNullOrUndefined(this.minDays)&&this.minDays>0&&!(e>=this.minDays))if(this.strictMode){var i=new Date(+this.startValue);i.setDate(i.getDate()+(this.minDays-1)),+i>+this.max?(this.endValue=this.max,this.setValue()):(this.endValue=i,this.setValue())}else this.startValue=null,this.endValue=null,this.setValue();t.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()))}},r.prototype.renderCalendar=function(){this.calendarElement=this.createElement("div"),this.calendarElement.classList.add(se),this.enableRtl&&this.calendarElement.classList.add("e-rtl"),t.attributes(this.calendarElement,{"data-role":"calendar"}),e.prototype.createHeader.call(this),e.prototype.createContent.call(this)},r.prototype.isSameMonth=function(e,t){return e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()},r.prototype.isSameYear=function(e,t){return e.getFullYear()===t.getFullYear()},r.prototype.isSameDecade=function(e,t){var i=e.getFullYear(),s=t.getFullYear();return i-i%10==s-s%10},r.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)))},r.prototype.selectNextMonth=function(){if(t.isNullOrUndefined(this.endValue)||t.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),!t.isNullOrUndefined(this.startValue)&&+this.startValue<+this.min||!t.isNullOrUndefined(this.endValue)&&+this.endValue>+this.max||!t.isNullOrUndefined(this.startValue)&&!t.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)}},r.prototype.selectNextYear=function(){if(t.isNullOrUndefined(this.endValue)||t.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),(!t.isNullOrUndefined(this.endValue)&&+this.endValue>+this.max||!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue)&&+this.startValue>+this.endValue||!t.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))},r.prototype.selectNextDecade=function(){if(t.isNullOrUndefined(this.endValue)||t.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),(!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue)&&+this.startValue>+this.endValue||!t.isNullOrUndefined(this.endValue)&&+this.endValue>+this.max||!t.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))},r.prototype.selectStartMonth=function(){t.isNullOrUndefined(this.startValue)?(this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.startMonthCurrentDate()):!t.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)),(!t.isNullOrUndefined(this.endValue)&&+this.endValue>+this.max||!t.isNullOrUndefined(this.startValue)&&+this.startValue<+this.min||!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue)&&+this.startValue>+this.endValue)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0))),this.startMonthCurrentDate()},r.prototype.createCalendar=function(){var i=this.createElement("div",{className:"e-calendar-container"});if(this.isMobile){t.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("."+se+" .e-prev"),a=this.calendarElement.querySelector("."+se+" .e-next");t.remove(this.calendarElement.querySelector("."+se+" ."+re)),this.calendarElement.querySelector("."+se+" ."+ae).appendChild(a),this.calendarElement.querySelector("."+se+" ."+ae).appendChild(s),t.prepend([s],this.calendarElement.querySelector("."+se+" ."+ae)),this.deviceCalendar=this.calendarElement,i.appendChild(this.calendarElement),this.headerTitleElement=this.calendarElement.querySelector(".e-calendar .e-header ."+ne)}else{this.selectStartMonth(),this.renderCalendar(),this.leftCalCurrentDate=new Date(+this.currentDate),this.calendarElement.classList.add(z),this.leftCalPrevIcon=this.calendarElement.querySelector("."+z+" .e-prev"),this.leftCalNextIcon=this.calendarElement.querySelector("."+z+" .e-next"),this.leftTitle=this.calendarElement.querySelector("."+z+" ."+ne),t.remove(this.calendarElement.querySelector("."+z+" ."+re)),this.calendarElement.querySelector("."+z+" ."+ae).appendChild(this.leftCalNextIcon),this.calendarElement.querySelector("."+z+" ."+ae).appendChild(this.leftCalPrevIcon),t.prepend([this.leftCalPrevIcon],this.calendarElement.querySelector("."+z+" ."+ae)),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),i.appendChild(n),this.isMobile||t.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),t.addClass([this.calendarElement],q),this.rightCalendar=this.calendarElement,t.removeClass([this.leftCalendar&&this.leftCalendar.querySelector(".e-content tbody")],"e-zoomin"),t.removeClass([this.rightCalendar&&this.rightCalendar.querySelector(".e-content tbody")],"e-zoomin"),this.rightCalPrevIcon=this.calendarElement.querySelector("."+q+" .e-prev"),this.rightCalNextIcon=this.calendarElement.querySelector("."+q+" .e-next"),this.rightTitle=this.calendarElement.querySelector("."+q+" ."+ne),t.remove(this.calendarElement.querySelector("."+q+" ."+re)),this.calendarElement.querySelector("table").setAttribute("tabindex","0"),this.calendarElement.querySelector("."+q+" ."+ae).appendChild(this.rightCalNextIcon),this.calendarElement.querySelector("."+q+" ."+ae).appendChild(this.rightCalPrevIcon),t.prepend([this.rightCalPrevIcon],this.calendarElement.querySelector("."+q+" ."+ae)),r.appendChild(this.rightCalendar),i.appendChild(r),this.isMobile||t.EventHandler.add(this.rightTitle,"click",this.rightNavTitle,this)}return i},r.prototype.leftNavTitle=function(e){this.isPopupOpen()&&(this.calendarElement=this.leftCalendar,this.calendarNavigation(e,this.calendarElement))},r.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()},r.prototype.rightNavTitle=function(e){this.isPopupOpen()&&(this.calendarElement=this.rightCalendar,this.calendarNavigation(e,this.calendarElement))},r.prototype.clickEventEmitter=function(e){this.isMobile||(t.closest(e.target,".e-calendar.e-left-calendar")?(this.calendarElement=this.leftCalendar,this.updateCalendarElement(this.leftCalendar)):(this.calendarElement=this.rightCalendar,this.updateCalendarElement(this.rightCalendar)))},r.prototype.currentView=function(){return e.prototype.currentView.call(this)},r.prototype.getCalendarView=function(e){return"Year"===e?"Year":"Decade"===e?"Decade":"Month"},r.prototype.navigatedEvent=function(i){if(this.trigger("navigated",this.navigatedArgs),!t.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||(!i||i.currentTarget.children[0].classList.contains("e-icons"))&&t.isNullOrUndefined(this.controlDown))(i&&!i.currentTarget.children[0].classList.contains("e-icons")||!t.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&&t.isNullOrUndefined(this.endValue)?"Month"===s&&this.startValue.getMonth()<this.rightCalCurrentDate.getMonth()&&this.startValue.getFullYear()<=this.rightCalCurrentDate.getFullYear()?e.prototype.navigateTo.call(this,s,new Date(+this.startValue)):"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):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()}}},r.prototype.createControl=function(){var e=this.createElement("div",{className:le}),i=this.createElement("div",{className:"e-range-header"});if(this.isMobile&&this.fullScreenMode){var s=this.createElement("div",{className:"e-model-header-wrapper"}),n=this.createElement("span",{className:"e-popup-close"});t.EventHandler.add(n,"mousedown touchstart",this.modelRangeCloseHandler,this);var r=this.createElement("span",{className:"e-apply"});t.EventHandler.add(r,"mousedown touchstart",this.applyFunction,this),s.appendChild(n),s.appendChild(r),i.appendChild(s)}var l=this.createRangeHeader();i.appendChild(l);var o=this.createElement("div",{className:de});t.attributes(o,{"aria-label":"Selected Days"}),o.textContent=this.l10n.getConstant("selectedDays"),i.appendChild(o);var h=this.createElement("div",{className:"e-separator"}),u=this.createCalendar();e.appendChild(i),e.appendChild(h),e.appendChild(u);var d=this.createElement("div",{className:"e-footer"}),p=this.createElement("button",{className:"e-cancel e-flat e-css"}),c=this.createElement("button");t.addClass([c],["e-apply","e-flat","e-primary","e-css"]),d.appendChild(c),d.appendChild(p);var m=!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue);if(this.cancelButton=new a.Button({content:this.l10n.getConstant("cancelText")},p),this.applyButton=new a.Button({content:this.l10n.getConstant("applyText"),disabled:!m},c),t.EventHandler.add(c,"click",this.applyFunction,this),t.EventHandler.add(p,"click",this.cancelFunction,this),this.popupWrapper.appendChild(e),!this.isMobile&&!t.isUndefined(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)){this.createPresets(),this.listRippleEffect(),t.addClass([e],"e-range-border"),t.addClass([this.popupWrapper],"e-preset-wrapper");this.popupWrapper.querySelector("."+oe).style.height=this.popupWrapper.querySelector("."+le).getBoundingClientRect().height+"px"}this.popupWrapper.appendChild(d),this.isMobile&&this.deviceHeaderUpdate(),this.renderPopup()},r.prototype.modelRangeCloseHandler=function(e){this.hide()},r.prototype.cancelFunction=function(e){document.activeElement!==this.inputElement&&(this.preventFocus=!0,this.inputElement.focus(),t.addClass([this.inputWrapper.container],[X])),e.preventDefault(),this.isKeyPopup&&(this.inputElement.focus(),this.isKeyPopup=!1),this.startValue=null,this.endValue=null,this.removeSelection(),this.hide(e)},r.prototype.deviceHeaderUpdate=function(){t.isNullOrUndefined(this.startValue)&&t.isNullOrUndefined(this.endValue)?(this.endButton.element.setAttribute("disabled",""),this.startButton.element.classList.add(_)):t.isNullOrUndefined(this.startValue)||this.startButton.element.classList.add(_)},r.prototype.applyFunction=function(e){var i=!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(),t.addClass([this.inputWrapper.container],[X])),"touchstart"!==e.type&&this.closeEventArgs&&!this.closeEventArgs.cancel&&e.preventDefault(),t.isNullOrUndefined(this.startValue)||t.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()||s.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||(i=!0),this.changeTrigger(e),this.hide(e||null),this.errorClass(),i=!0),t.closest(e.target,".e-input-group")||i||this.focusOut(),this.isMobile||(this.isKeyPopup=!1,this.isRangeIconClicked&&(this.inputWrapper.container.children[1].focus(),this.keyInputConfigs=t.extend(this.keyInputConfigs,this.keyConfigs),this.popupKeyboardModule=new t.KeyboardEvents(this.inputWrapper.container.children[1],{eventName:"keydown",keyConfigs:this.keyInputConfigs,keyAction:this.popupKeyActionHandle.bind(this)})))},r.prototype.onMouseClick=function(e,i){if("touchstart"!==e.type){var s=i||e.target,a=t.closest(s,"."+ve),n=a&&a.classList.contains(_);a&&a.classList.contains(ve)&&this.setListSelection(a,e),this.preventFocus=!0,this.inputElement.focus(),this.isMobile||(this.preventFocus=!0,a&&a.classList.contains(ve)&&"custom_range"===a.getAttribute("id")?this.leftCalendar.children[1].firstElementChild.focus():n||"keydown"!==e.type||this.inputElement.focus())}},r.prototype.onMouseOver=function(e){var i=t.closest(e.target,"."+ve);i&&i.classList.contains(ve)&&!i.classList.contains(ye)&&t.addClass([i],ye)},r.prototype.onMouseLeave=function(e){var i=t.closest(e.target,"."+ye);t.isNullOrUndefined(i)||t.removeClass([i],ye)},r.prototype.setListSelection=function(e,i){if(e&&(!e.classList.contains(_)||this.isMobile&&e.classList.contains(_))){if(this.isMobile&&e.classList.contains(_)){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),t.addClass([e],_),e.setAttribute("aria-selected","true");var s=this.presetsItem[this.activeIndex];"custom_range"===s.id?this.renderCustomPopup():this.applyPresetRange(s,i)}},r.prototype.removeListSelection=function(){var e=this.presetElement.querySelector("."+_);t.isNullOrUndefined(e)||(t.removeClass([e],_),e.removeAttribute("aria-selected"))},r.prototype.setValue=function(){this.modelValue=[this.startValue,this.endValue]},r.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())},r.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()},r.prototype.renderCustomPopup=function(){this.isCustomWindow=!0,this.popupObj.hide(),this.popupWrapper=this.createElement("div",{id:this.element.id+"_popup",className:K+" e-popup"}),this.renderControl(),this.openEventArgs.appendTo.appendChild(this.popupWrapper),this.showPopup(),this.isCustomRange=!0,this.isMobile||this.calendarFocus()},r.prototype.listRippleEffect=function(){for(var e=0,i=this.liCollections;e<i.length;e++){var s=i[e];t.rippleEffect(s)}},r.prototype.createPresets=function(){if(!t.isUndefined(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)){this.presetElement=this.createElement("div",{className:oe,attrs:{tabindex:"0"}});var e=n.ListBase.createList(this.createElement,this.presetsItem,null,!0);t.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 i=this.presetElement.querySelector("#custom_range");if(t.isNullOrUndefined(i)||(i.textContent=""!==this.l10n.getConstant("customRange")?this.l10n.getConstant("customRange"):"Custom Range"),this.liCollections=this.presetElement.querySelectorAll("."+ve),this.wireListEvents(),this.isMobile)if(this.fullScreenMode){var s=t.createElement("div",{className:"e-range-mob-popup-wrap"}),a=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"});t.EventHandler.add(l,"mousedown touchstart",this.modelRangeCloseHandler,this);var o=this.presetElement;a.appendChild(l),a.appendChild(r),s.appendChild(a),s.appendChild(o),this.popupWrapper.insertBefore(s,this.popupWrapper.firstElementChild),this.presetElement.style.width="100%"}else this.presetElement.style.width=this.inputWrapper.container.getBoundingClientRect().width+"px";!t.isNullOrUndefined(this.activeIndex)&&this.activeIndex>-1&&t.addClass([this.liCollections[this.activeIndex]],_)}},r.prototype.wireListEvents=function(){t.EventHandler.add(this.presetElement,"click",this.onMouseClick,this),this.isMobile||(t.EventHandler.add(this.presetElement,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.presetElement,"mouseout",this.onMouseLeave,this))},r.prototype.unWireListEvents=function(){t.isNullOrUndefined(this.presetElement)||(t.EventHandler.remove(this.presetElement,"click touchstart",this.onMouseClick),this.isMobile||(t.EventHandler.remove(this.presetElement,"mouseover",this.onMouseOver),t.EventHandler.remove(this.presetElement,"mouseout",this.onMouseLeave)))},r.prototype.renderPopup=function(){var e=this;this.popupWrapper.classList.add("e-control");var s=this.popupWrapper.getBoundingClientRect().width;t.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 i.Popup(this.popupWrapper,{relateTo:this.isMobile&&this.isCustomWindow?document.body:t.isNullOrUndefined(this.targetElement)?this.inputWrapper.container:this.targetElement,position:this.isMobile?t.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:-s,offsetY:4,collision:this.isMobile?t.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 t.Touch(e.calendarElement.querySelector(".e-content.e-month"),{swipe:e.dateRangeSwipeHandler.bind(e)}),t.EventHandler.add(e.calendarElement.querySelector(".e-content.e-month"),"touchstart",e.touchStartRangeHandler,e))),t.attributes(e.inputElement,{"aria-expanded":"true","aria-owns":e.element.id,"aria-controls":e.inputElement.id}),e.value?t.attributes(e.inputElement,{"aria-activedescendant":e.inputElement.id}):e.inputElement.removeAttribute("aria-activedescendant"),t.addClass([e.inputWrapper.buttons[0]],_),e.isMobile||(e.cancelButton&&(e.btnKeyboardModule=new t.KeyboardEvents(e.cancelButton.element,{eventName:"keydown",keyAction:e.popupKeyActionHandle.bind(e),keyConfigs:{tab:"tab",altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}}),e.btnKeyboardModule=new t.KeyboardEvents(e.applyButton.element,{eventName:"keydown",keyAction:e.popupKeyActionHandle.bind(e),keyConfigs:{altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}})),t.isNullOrUndefined(e.leftCalendar)||e.isRangeIconClicked||e.calendarFocus(),t.isNullOrUndefined(e.presetElement)||(e.keyInputConfigs=t.extend(e.keyInputConfigs,e.keyConfigs),e.presetKeyboardModule=new t.KeyboardEvents(e.presetElement,{eventName:"keydown",keyAction:e.presetKeyActionHandler.bind(e),keyConfigs:e.keyInputConfigs}),e.presetKeyboardModule=new t.KeyboardEvents(e.presetElement,{eventName:"keydown",keyAction:e.popupKeyActionHandle.bind(e),keyConfigs:{altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}}),t.isNullOrUndefined(e.leftCalendar)?(e.preventBlur=!0,e.presetElement.focus()):e.presetElement.setAttribute("tabindex","-1")),e.popupKeyBoardHandler()),e.isMobile&&!t.Browser.isDevice&&t.EventHandler.add(document,"keydown",e.popupCloseHandler,e)},close:function(){t.attributes(e.inputElement,{"aria-expanded":"false"}),e.inputElement.removeAttribute("aria-owns"),e.inputElement.removeAttribute("aria-controls"),e.inputElement.removeAttribute("aria-activedescendant"),t.removeClass([e.inputWrapper.buttons[0]],_),e.isRangeIconClicked&&e.inputWrapper.container.children[1].focus(),t.isUndefined(e.presets[0].start&&e.presets[0].end&&e.presets[0].label)||e.unWireListEvents(),t.isNullOrUndefined(e.popupObj)||(t.isNullOrUndefined(e.popupObj.element.parentElement)||t.detach(e.popupObj.element),e.popupObj.destroy(),e.popupObj=null),e.isMobile&&!t.Browser.isDevice&&t.EventHandler.remove(document,"keydown",e.popupCloseHandler)},targetExitViewport:function(){var i=e.popupObj&&e.popupObj.element;!t.Browser.isDevice&&i&&i.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&&(t.addClass([this.modal],["e-device",K,"e-range-modal"]),document.body.className+=" "+ge,this.modal.style.display="block"),t.EventHandler.add(document,"mousedown touchstart",this.documentHandler,this)},r.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)},r.prototype.touchStartRangeHandler=function(e){this.touchRangeStart=!0},r.prototype.popupCloseHandler=function(e){switch(e.keyCode){case 27:this.hide(e)}},r.prototype.calendarFocus=function(){var e=this.popupObj&&this.popupObj.element.querySelector("."+G);if(e){var i=t.closest(e,"."+q);i=t.isNullOrUndefined(i)?this.leftCalendar:i,this.isRangeIconClicked?this.inputWrapper.container.focus():(this.preventBlur=!0,i.children[1].firstElementChild.focus()),t.addClass([e],he)}else this.isRangeIconClicked?this.inputWrapper.container.focus():(this.preventBlur=!0,this.leftCalendar.children[1].firstElementChild.focus())},r.prototype.presetHeight=function(){var e=this.popupObj&&this.popupObj.element.querySelector("."+oe),i=this.popupObj&&this.popupObj.element.querySelector("."+le);t.isNullOrUndefined(e)||t.isNullOrUndefined(i)||(e.style.height=i.getBoundingClientRect().height+"px")},r.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 i=this.getHoverLI(),s=this.getActiveLI();if(!t.isNullOrUndefined(this.leftCalendar)&&!t.isNullOrUndefined(s)&&(t.isNullOrUndefined(i)||!t.isNullOrUndefined(s)&&s===i)){this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(s);if("custom_range"===this.presetsItem[this.activeIndex].id)return this.calendarFocus(),s.classList.remove(ye),void e.preventDefault()}t.isNullOrUndefined(i)&&t.isNullOrUndefined(s)||this.onMouseClick(e,i||s),e.preventDefault();break;case"tab":if(this.leftCalendar){var a=this.getHoverLI();t.isNullOrUndefined(a)||a.classList.remove(ye)}else this.hide(e),e.preventDefault()}},r.prototype.listMoveDown=function(e){var i=this.getHoverLI(),s=this.getActiveLI();if(t.isNullOrUndefined(i))if(t.isNullOrUndefined(s))t.addClass([this.liCollections[0]],ye);else{a=s.nextElementSibling;!t.isNullOrUndefined(a)&&a.classList.contains(ve)&&t.addClass([a],ye)}else{var a=i.nextElementSibling;!t.isNullOrUndefined(a)&&a.classList.contains(ve)&&(t.removeClass([i],ye),t.addClass([a],ye))}},r.prototype.listMoveUp=function(e){var i=this.getHoverLI(),s=this.getActiveLI();if(t.isNullOrUndefined(i)){if(!t.isNullOrUndefined(s)){a=s.previousElementSibling;!t.isNullOrUndefined(a)&&a.classList.contains(ve)&&t.addClass([a],ye)}}else{var a=i.previousElementSibling;!t.isNullOrUndefined(a)&&a.classList.contains(ve)&&(t.removeClass([i],ye),t.addClass([a],ye))}},r.prototype.getHoverLI=function(){return this.presetElement.querySelector("."+ye)},r.prototype.getActiveLI=function(){return this.presetElement.querySelector("."+_)},r.prototype.popupKeyBoardHandler=function(){this.popupKeyboardModule=new t.KeyboardEvents(this.popupWrapper,{eventName:"keydown",keyAction:this.popupKeyActionHandle.bind(this),keyConfigs:{escape:"escape"}}),this.keyInputConfigs=t.extend(this.keyInputConfigs,this.keyConfigs),this.popupKeyboardModule=new t.KeyboardEvents(this.inputWrapper.container.children[1],{eventName:"keydown",keyAction:this.popupKeyActionHandle.bind(this),keyConfigs:this.keyInputConfigs})},r.prototype.setScrollPosition=function(){var e=this.presetElement.getBoundingClientRect().height,i=this.presetElement.querySelector("."+ye),s=this.presetElement.querySelector("."+_),a=t.isNullOrUndefined(i)?s:i;if(!t.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}},r.prototype.popupKeyActionHandle=function(e){var i=t.closest(e.target,"."+oe);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":t.isNullOrUndefined(i)?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":t.isNullOrUndefined(i)?document.activeElement===this.applyButton.element&&!0!==this.applyButton.element.disabled?this.cancelButton.element.focus():t.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()}},r.prototype.documentHandler=function(e){if(!t.isNullOrUndefined(this.popupObj)){var i=e.target;this.inputWrapper.container.contains(i)&&(t.isNullOrUndefined(this.popupObj)||t.closest(i,'[id="'+this.popupWrapper.id+'"]')||"mousedown"===e.type)||"touchstart"!==e.type&&("mousedown"===e.type||this.closeEventArgs&&!this.closeEventArgs.cancel)&&e.preventDefault(),!t.isNullOrUndefined(this.targetElement)&&(t.isNullOrUndefined(this.targetElement)||i===this.targetElement)||t.closest(i,'[id="'+this.popupWrapper.id+'"]')||t.closest(i,".e-input-group")===this.inputWrapper.container||t.closest(i,".e-daterangepicker.e-popup")&&!i.classList.contains("e-day")||i.classList.contains("e-dlg-overlay")||(this.preventBlur=!1,this.isPopupOpen()&&document.body.contains(this.popupObj.element)&&(this.applyFunction(e),this.isMobile||(this.isRangeIconClicked=!1)))}},r.prototype.createInput=function(){this.fullScreenMode&&this.isMobile&&(this.cssClass+=" e-popup-expand");var e=this.cssClass;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),this.inputWrapper=s.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),t.attributes(this.inputElement,{tabindex:"0","aria-expanded":"false",role:"combobox",autocomplete:"off","aria-disabled":this.enabled?"false":"true",autocorrect:"off",autocapitalize:"off",spellcheck:"false"}),s.Input.addAttributes({"aria-label":"select",role:"button"},this.inputWrapper.buttons[0]),this.setEleWidth(this.width),t.addClass([this.inputWrapper.container],"e-date-range-wrapper"),t.isNullOrUndefined(this.inputElement.getAttribute("name"))&&t.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},r.prototype.setEleWidth=function(e){this.inputWrapper.container.style.width="string"==typeof e?this.width:"number"==typeof e?t.formatUnit(this.width):"100%"},r.prototype.adjustLongHeaderWidth=function(){"Wide"===this.dayHeaderFormat&&t.addClass([this.popupWrapper],"e-daterange-day-header-lg")},r.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(),t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)||e||t.isNullOrUndefined(this.renderDayCellArgs)||!this.renderDayCellArgs.isDisabled||this.disabledDateRender(),this.errorClass(),this.previousStartValue=t.isNullOrUndefined(this.startValue)||isNaN(+this.startValue)?null:new Date(+this.startValue),this.previousEndValue=t.isNullOrUndefined(this.endValue)||isNaN(+this.endValue)?null:new Date(+this.endValue)},r.prototype.updateInput=function(){if(!t.isNullOrUndefined(this.endValue)&&!t.isNullOrUndefined(this.startValue)){var e={format:this.formatString,type:"date",skeleton:"yMd"},i=this.globalize.formatDate(this.startValue,e),a=this.globalize.formatDate(this.endValue,e);s.Input.setValue(i+" "+this.separator+" "+a,this.inputElement,this.floatLabelType,this.showClearButton),this.previousStartValue=new Date(+this.startValue),this.previousEndValue=new Date(+this.endValue)}!this.strictMode&&t.isNullOrUndefined(this.value)&&this.invalidValueString&&s.Input.setValue(this.invalidValueString,this.inputElement,this.floatLabelType,this.showClearButton)},r.prototype.checkInvalidRange=function(e){if(!t.isNullOrUndefined(e)){var i=!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]):(i=!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:t.isNullOrUndefined(s)||(u=!0):n=this.getstringvalue(s),a instanceof Date||"object"==typeof a?a instanceof Date?h=!0:t.isNullOrUndefined(a)||(u=!0):r=this.getstringvalue(a);(t.isNullOrUndefined(n)&&!o&&!t.isNullOrUndefined(r)||!t.isNullOrUndefined(n)&&!h&&t.isNullOrUndefined(r))&&(i=!0),u&&(n=r=l=null,i=!0),n&&(i=i||this.checkInvalidValue(n)),r&&(i=i||this.checkInvalidValue(r)),i&&(o&&!u&&(n=s.toLocaleDateString()),h&&!u&&(r=a.toLocaleDateString()),t.isNullOrUndefined(n)||t.isNullOrUndefined(r)?t.isNullOrUndefined(n)?t.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)}},r.prototype.getstringvalue=function(e){var i=null;return t.isNullOrUndefined(e)||"number"!=typeof e?t.isNullOrUndefined(e)||"string"!=typeof e||(i=""+e):i=e.toString(),i},r.prototype.checkInvalidValue=function(e){var i=e,s=!1,a=null;if(a={format:this.formatString,type:"date",skeleton:"yMd"},"string"!=typeof i)s=!0;else{var n=new t.Internationalization(this.locale);if(!this.checkDateValue(n.parseDate(i,a))){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(i)&&!r.test(i)||/^[a-zA-Z0-9- ]*$/.test(i)||isNaN(+new Date(this.checkValue(i))))&&(s=!0)}}return s},r.prototype.isDateDisabled=function(e){if(t.isNullOrUndefined(e))return!1;var i=new Date(+e);if(+i<+this.min||+i>+this.max)return!0;this.virtualRenderCellArgs={date:i,isDisabled:!1};var s=this.virtualRenderCellArgs;return this.virtualRenderCellEvent(s),!!s.isDisabled},r.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},r.prototype.virtualRenderCellEvent=function(e){t.extend(this.virtualRenderCellArgs,{name:"renderDayCell"}),this.trigger("renderDayCell",e)},r.prototype.disabledDates=function(){var e=!1,i=!1;return t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)||(e=this.isDateDisabled(this.startValue),i=this.isDateDisabled(this.endValue),this.isPopupOpen()||(this.currentDate=null),this.setValue()),e||i},r.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()},r.prototype.dispatchEvent=function(e,t){var i=document.createEvent("HTMLEvents");i.initEvent(t,!1,!0),e.dispatchEvent(i),this.firstHiddenChild.dispatchEvent(i)},r.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)},r.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])}},r.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)},r.prototype.focusIn=function(){document.activeElement!==this.inputElement&&this.enabled&&(t.addClass([this.inputWrapper.container],[X]),this.inputElement.focus())},r.prototype.focusOut=function(){var e=this.preventBlur;document.activeElement===this.inputElement&&(t.removeClass([this.inputWrapper.container],[X]),this.preventBlur=!1,this.inputElement.blur(),this.preventBlur=e)},r.prototype.destroy=function(){this.unBindEvents(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),this.hide(null);var i={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&&(t.removeClass([this.inputElement],[K]),t.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),s.Input.removeAttributes(i,this.inputElement),t.isNullOrUndefined(this.cloneElement.getAttribute("tabindex"))?this.inputElement.removeAttribute("tabindex"):this.inputElement.setAttribute("tabindex",this.tabIndex),this.ensureInputAttribute(),this.inputElement.classList.remove("e-input"),t.isNullOrUndefined(this.inputWrapper)||(t.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler),null===this.angularTag&&this.inputWrapper.container.parentElement.appendChild(this.inputElement),t.detach(this.inputWrapper.container))),t.isNullOrUndefined(this.inputKeyboardModule)||this.isMobile||this.inputKeyboardModule.destroy(),this.popupObj&&(this.isMobile||this.clearCalendarEvents()),s.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&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler),t.isNullOrUndefined(this.firstHiddenChild)||t.isNullOrUndefined(this.secondHiddenChild)||(t.detach(this.firstHiddenChild),t.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},r.prototype.ensureInputAttribute=function(){for(var e=[],i=0;i<this.inputElement.attributes.length;i++)e[i]=this.inputElement.attributes[i].name;for(i=0;i<e.length;i++)t.isNullOrUndefined(this.cloneElement.getAttribute(e[i]))?("value"===e[i].toLowerCase()&&(this.inputElement.value=""),this.inputElement.removeAttribute(e[i])):("value"===e[i].toLowerCase()&&(this.inputElement.value=this.cloneElement.getAttribute(e[i])),this.inputElement.setAttribute(e[i],this.cloneElement.getAttribute(e[i])))},r.prototype.getModuleName=function(){return"daterangepicker"},r.prototype.getPersistData=function(){return this.addOnPersist(["startDate","endDate","value"])},r.prototype.getSelectedRange=function(){var e;return t.isNullOrUndefined(this.startValue)||t.isNullOrUndefined(this.endValue)?e=0:(e=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1,!t.isNullOrUndefined(this.renderDayCellArgs)&&this.renderDayCellArgs.isDisabled&&this.disabledDateRender(),t.isNullOrUndefined(this.disabledDayCnt)||(e-=this.disabledDayCnt,this.disabledDayCnt=null)),{startDate:this.startValue,endDate:this.endValue,daySpan:e}},r.prototype.show=function(i,s){var a=this;if(this.isMobile&&this.popupObj&&this.popupObj.refreshPosition(),!(this.enabled&&this.readonly||!this.enabled||this.popupObj||this.isPopupOpen())){i&&(this.targetElement=i),this.createPopup(),(this.isMobile||t.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||t.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(i,s);var r=!a.isCustomRange||a.isMobile&&a.isCustomRange;!t.isUndefined(a.presets[0].start&&a.presets[0].end&&a.presets[0].label)&&r&&a.setScrollPosition(),a.checkMinMaxDays(),a.isMobile&&!t.isNullOrUndefined(a.startDate)&&t.isNullOrUndefined(a.endDate)&&(a.endButton.element.classList.add(_),a.startButton.element.classList.remove(_),a.endButton.element.removeAttribute("disabled"),a.selectableDates()),e.prototype.setOverlayIndex.call(a,a.mobileRangePopupWrap,a.popupObj.element,a.modal,a.isMobile||t.Browser.isDevice)}}),t.Browser.isDevice){var r=this.createElement("div",{className:"e-dlg-overlay"});r.style.zIndex=(this.zIndex-1).toString(),this.mobileRangePopupWrap.appendChild(r)}}},r.prototype.hide=function(e){var i=this;if(this.popupObj){if(t.isNullOrUndefined(this.previousEndValue)&&t.isNullOrUndefined(this.previousStartValue)?this.clearRange():(t.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))),t.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){i.closeEventArgs=e,i.closeEventArgs.cancel?t.removeClass([i.inputWrapper.buttons[0]],_):(i.isMobile&&(t.isNullOrUndefined(i.startButton)||t.isNullOrUndefined(i.endButton)||(t.EventHandler.remove(i.startButton.element,"click touchstart",i.deviceHeaderClick),t.EventHandler.remove(i.endButton.element,"click touchstart",i.deviceHeaderClick))),i.popupObj&&(i.popupObj.hide(),i.preventBlur&&(i.inputElement.focus(),t.addClass([i.inputWrapper.container],[X]))),i.isMobile||(t.isNullOrUndefined(i.leftKeyboardModule)||t.isNullOrUndefined(i.rightKeyboardModule)||(i.leftKeyboardModule.destroy(),i.rightKeyboardModule.destroy()),t.isNullOrUndefined(i.presetElement)||i.presetKeyboardModule.destroy(),t.isNullOrUndefined(i.cancelButton)||i.btnKeyboardModule.destroy()),i.targetElement=null,t.removeClass([document.body],ge),t.EventHandler.remove(document,"mousedown touchstart",i.documentHandler),i.isMobile&&i.modal&&(i.modal.style.display="none",i.modal.outerHTML="",i.modal=null),(i.isMobile||t.Browser.isDevice)&&(t.isNullOrUndefined(i.mobileRangePopupWrap)||(i.mobileRangePopupWrap.remove(),i.mobileRangePopupWrap=null)),i.isKeyPopup=i.dateDisabled=!1),i.updateClearIconState(),i.updateHiddenInput(),i.isMobile&&i.allowEdit&&!i.readonly&&i.inputElement.removeAttribute("readonly")})}}else this.updateClearIconState(),this.updateHiddenInput(),this.isMobile&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly")},r.prototype.setLocale=function(){this.globalize=new t.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.dateRangeOptions&&null==this.dateRangeOptions.placeholder&&(this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),s.Input.setPlaceholder(this.placeholder,this.inputElement)),this.updateInput(),this.updateHiddenInput(),this.changeTrigger()},r.prototype.refreshChange=function(){this.checkView(),this.refreshControl(),this.changeTrigger()},r.prototype.setDate=function(){s.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.refreshChange()},r.prototype.enableInput=function(){+this.min<=+this.max&&(this.setProperties({enabled:!0},!0),s.Input.setEnabled(this.enabled,this.inputElement),this.element.hasAttribute("disabled")&&this.bindEvents())},r.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()},r.prototype.createHiddenInput=function(){t.isNullOrUndefined(this.firstHiddenChild)&&t.isNullOrUndefined(this.secondHiddenChild)&&(this.firstHiddenChild=this.createElement("input"),this.secondHiddenChild=this.createElement("input")),t.isNullOrUndefined(this.inputElement.getAttribute("name"))||(this.inputElement.setAttribute("data-name",this.inputElement.getAttribute("name")),this.inputElement.removeAttribute("name")),t.attributes(this.firstHiddenChild,{type:"text",name:this.inputElement.getAttribute("data-name"),class:De}),t.attributes(this.secondHiddenChild,{type:"text",name:this.inputElement.getAttribute("data-name"),class:De});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)},r.prototype.setMinMaxDays=function(){this.isPopupOpen()&&(this.removeClassDisabled(),this.checkMinMaxDays(),this.isMobile&&this.selectableDates(),!this.strictMode&&t.isNullOrUndefined(this.startValue)&&t.isNullOrUndefined(this.endValue)?this.removeSelection():this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar]),this.updateHeader())},r.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)},r.prototype.onPropertyChanged=function(e,i){for(var a={format:this.formatString,type:"date",skeleton:"yMd"},n=0,r=Object.keys(e);n<r.length;n++){var l=r[n];switch(["maxDays","minDays","value"].indexOf(l)<0&&this.hide(null),l){case"width":this.setEleWidth(this.width),s.Input.calculateWidth(this.inputElement,this.inputWrapper.container),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.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":s.Input.setPlaceholder(e.placeholder,this.inputElement),this.setProperties({placeholder:e.placeholder},!0);break;case"readonly":s.Input.setReadonly(this.readonly,this.inputElement),this.setRangeAllowEdit();break;case"cssClass":this.updateCssClass(e.cssClass,i.cssClass);break;case"enabled":this.setProperties({enabled:e.enabled},!0),s.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),s.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 t.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.dateRangeOptions&&null==this.dateRangeOptions.placeholder&&(this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),s.Input.setPlaceholder(this.placeholder,this.inputElement)),this.setLocale();break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.setDataAttribute(!0),this.checkHtmlAttributes(!0);break;case"showClearButton":s.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,i);else{var o=e.value.split(" "+this.separator+" ");this.value=[new Date(o[0]),new Date(o[1])],this.updateValue(),this.setDate()}else!t.isNullOrUndefined(e.value)&&e.value.length>0||!t.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,i):null!==e.value[1]&&null!==e.value.start||this.clearModelvalue(e,i):+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())):(t.isNullOrUndefined(this.value)||null==e.value.start)&&(this.valueType=e.value,this.startValue=null,this.endValue=null,this.clearModelvalue(e,i));if(this.isPopupOpen()){if(t.isNullOrUndefined(this.startValue)&&t.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,s.Input.removeFloating(this.inputWrapper),s.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.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()}}},Y([t.Property(null)],r.prototype,"value",void 0),Y([t.Property(!1)],r.prototype,"enablePersistence",void 0),Y([t.Property(new Date(1900,0,1))],r.prototype,"min",void 0),Y([t.Property(new Date(2099,11,31))],r.prototype,"max",void 0),Y([t.Property(null)],r.prototype,"locale",void 0),Y([t.Property(null)],r.prototype,"firstDayOfWeek",void 0),Y([t.Property(!1)],r.prototype,"weekNumber",void 0),Y([t.Property("Gregorian")],r.prototype,"calendarMode",void 0),Y([t.Property(!1)],r.prototype,"openOnFocus",void 0),Y([t.Property(!1)],r.prototype,"fullScreenMode",void 0),Y([t.Event()],r.prototype,"created",void 0),Y([t.Event()],r.prototype,"destroyed",void 0),Y([t.Event()],r.prototype,"change",void 0),Y([t.Event()],r.prototype,"cleared",void 0),Y([t.Event()],r.prototype,"navigated",void 0),Y([t.Event()],r.prototype,"renderDayCell",void 0),Y([t.Property(null)],r.prototype,"startDate",void 0),Y([t.Property(null)],r.prototype,"endDate",void 0),Y([t.Collection([{}],Ce)],r.prototype,"presets",void 0),Y([t.Property("")],r.prototype,"width",void 0),Y([t.Property(1e3)],r.prototype,"zIndex",void 0),Y([t.Property(!0)],r.prototype,"showClearButton",void 0),Y([t.Property(!0)],r.prototype,"showTodayButton",void 0),Y([t.Property("Month")],r.prototype,"start",void 0),Y([t.Property("Month")],r.prototype,"depth",void 0),Y([t.Property("")],r.prototype,"cssClass",void 0),Y([t.Property("-")],r.prototype,"separator",void 0),Y([t.Property(null)],r.prototype,"minDays",void 0),Y([t.Property(null)],r.prototype,"maxDays",void 0),Y([t.Property(!1)],r.prototype,"strictMode",void 0),Y([t.Property(null)],r.prototype,"keyConfigs",void 0),Y([t.Property(null)],r.prototype,"format",void 0),Y([t.Property(!0)],r.prototype,"enabled",void 0),Y([t.Property(!1)],r.prototype,"readonly",void 0),Y([t.Property(!0)],r.prototype,"allowEdit",void 0),Y([t.Property("Never")],r.prototype,"floatLabelType",void 0),Y([t.Property(null)],r.prototype,"placeholder",void 0),Y([t.Property({})],r.prototype,"htmlAttributes",void 0),Y([t.Event()],r.prototype,"open",void 0),Y([t.Event()],r.prototype,"close",void 0),Y([t.Event()],r.prototype,"select",void 0),Y([t.Event()],r.prototype,"focus",void 0),Y([t.Event()],r.prototype,"blur",void 0),r=Y([t.NotifyPropertyChanges],r)}(k),Me=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)}}(),we=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},Ve=(new Date).getDate(),Ne=(new Date).getMonth(),Oe=(new Date).getFullYear(),Ie="e-timepicker",Te="e-active",xe="e-navigation",Se="e-disabled",Pe="e-input-focus",Ae="e-list-item",Ue="e-non-edit",He=["title","class","style"];!function(t){(e.TimePickerBase||(e.TimePickerBase={})).createListItems=function(e,t,i,s,a,r){this.calendarMode;var l,o=6e4*r,h=[],u=[];l=+t.setMilliseconds(0);for(var d=+i.setMilliseconds(0);d>=l;)u.push(l),h.push(s.formatDate(new Date(l),{format:a,type:"time"})),l+=o;return{collection:u,list:n.ListBase.createList(e,h,null,!0)}}}();var We=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Me(i,e),we([t.Property("day")],i.prototype,"day",void 0),we([t.Property("month")],i.prototype,"month",void 0),we([t.Property("year")],i.prototype,"year",void 0),we([t.Property("day of the week")],i.prototype,"dayOfTheWeek",void 0),we([t.Property("hour")],i.prototype,"hour",void 0),we([t.Property("minute")],i.prototype,"minute",void 0),we([t.Property("second")],i.prototype,"second",void 0),i}(t.ChildProperty),Le=function(e){function a(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 Me(a,e),a.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),t.removeClass([this.cloneElement],[Ie,"e-control","e-lib"]),this.inputElement=this.element,this.angularTag=null,this.formElement=t.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}},a.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),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.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"),!t.isNullOrUndefined(t.closest(this.element,"fieldset"))&&t.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete()},a.prototype.setTimeZone=function(){if(!t.isNullOrUndefined(this.serverTimezoneOffset)&&this.value){var e=(new Date).getTimezoneOffset()/60,i=this.serverTimezoneOffset+e;i=this.isDayLightSaving()?i--:i,this.value=new Date(this.value.getTime()+60*i*60*1e3)}},a.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)},a.prototype.setTimeAllowEdit=function(){this.allowEdit?this.readonly||this.inputElement.removeAttribute("readonly"):t.attributes(this.inputElement,{readonly:""}),this.clearIconState()},a.prototype.clearIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&t.removeClass([this.inputWrapper.container],[Ue]):""===this.inputElement.value?t.removeClass([this.inputWrapper.container],[Ue]):t.addClass([this.inputWrapper.container],[Ue])},a.prototype.validateDisable=function(){this.setMinMax(this.initMin,this.initMax),t.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))},a.prototype.validationAttribute=function(e,i){var s=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id");i.setAttribute("name",s),e.removeAttribute("name");for(var a=["required","aria-required","form"],n=0;n<a.length;n++)if(!t.isNullOrUndefined(e.getAttribute(a[n]))){var r=e.getAttribute(a[n]);i.setAttribute(a[n],r),e.removeAttribute(a[n])}},a.prototype.initialize=function(){this.globalize=new t.Internationalization(this.locale),this.defaultCulture=new t.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 t.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,t.isNullOrUndefined(this.element.getAttribute("id"))?(this.element.id=t.getUniqueID("ej2_timepicker"),null!==this.angularTag&&t.attributes(this.inputElement,{id:this.element.id+"_input"})):null!==this.angularTag&&(this.inputElement.id=this.element.getAttribute("id")+"_input"),t.isNullOrUndefined(this.inputElement.getAttribute("name"))&&t.attributes(this.inputElement,{name:this.element.id}),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"})},a.prototype.checkTimeFormat=function(){if(this.format)if("string"==typeof this.format)this.formatString=this.format;else if(t.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},a.prototype.checkDateValue=function(e){return!t.isNullOrUndefined(e)&&e instanceof Date&&!isNaN(+e)?e:null},a.prototype.createInputElement=function(){this.fullScreenMode&&t.Browser.isDevice&&(this.cssClass+=" e-popup-expand");var e=this.cssClass,i=!this.enableMask;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),this.inputWrapper=s.Input.createInput({element:this.inputElement,bindClearAction:i,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),t.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)||s.Input.addAttributes({style:this.inputStyle},this.inputElement),t.addClass([this.inputWrapper.container],"e-time-wrapper")},a.prototype.getCldrDateTimeFormat=function(){var e=new t.Internationalization(this.locale).getDatePattern({skeleton:"yMd"});return this.isNullOrEmpty(this.formatString)?e+" "+this.cldrFormat("time"):this.formatString},a.prototype.checkInvalidValue=function(e){var i=!1;if("object"!=typeof e&&!t.isNullOrUndefined(e)){var s=e;"string"==typeof s&&(s=s.trim());var a=null,n=null;if("number"==typeof e?s=e.toString():"string"==typeof e&&(/^[a-zA-Z0-9- ]*$/.test(e)||(a=this.setCurrentDate(this.getDateObject(e)),t.isNullOrUndefined(a)&&(a=this.checkDateValue(this.globalize.parseDate(s,{format:this.getCldrDateTimeFormat(),type:"datetime"})),t.isNullOrUndefined(a)&&(a=this.checkDateValue(this.globalize.parseDate(s,{format:this.formatString,type:"dateTime",skeleton:"yMd"})))))),n=this.globalize.parseDate(s,{format:this.getCldrDateTimeFormat(),type:"datetime"}),a=!t.isNullOrUndefined(n)&&n instanceof Date&&!isNaN(+n)?n:null,t.isNullOrUndefined(a)&&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))?i=!0:a=new Date(""+s)}i?(this.strictMode||(this.invalidValueString=s),this.setProperties({value:null},!0),this.initValue=null):(this.setProperties({value:a},!0),this.initValue=this.value)}},a.prototype.requiredModules=function(){var e=[];return this.enableMask&&e.push({args:[this],member:"MaskedDateTime"}),e},a.prototype.cldrFormat=function(e){return"en"===this.locale||"en-US"===this.locale?t.getValue("timeFormats.short",t.getDefaultDateObject()):this.getCultureTimeObject(t.cldrData,""+this.locale)},a.prototype.destroy=function(){this.hide(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),this.unBindEvents();this.inputElement&&(s.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),t.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"),t.isNullOrUndefined(this.cloneElement.getAttribute("disabled"))&&s.Input.setEnabled(!0,this.inputElement,this.floatLabelType)),this.inputWrapper.container&&t.detach(this.inputWrapper.container),this.inputWrapper=this.popupWrapper=this.cloneElement=void 0,this.liCollections=this.timeCollections=this.disableItemCollection=[],t.isNullOrUndefined(this.rippleFn)||this.rippleFn(),s.Input.destroy({element:this.inputElement,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),e.prototype.destroy.call(this),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler),this.rippleFn=null,this.openPopupEventArgs=null,this.selectedElement=null,this.listTag=null,this.liCollections=null},a.prototype.ensureInputAttribute=function(){for(var e=[],i=0;i<this.inputElement.attributes.length;i++)e[i]=this.inputElement.attributes[i].name;for(i=0;i<e.length;i++)t.isNullOrUndefined(this.cloneElement.getAttribute(e[i]))?(this.inputElement.removeAttribute(e[i]),"value"===e[i].toLowerCase()&&(this.inputElement.value="")):(this.inputElement.setAttribute(e[i],this.cloneElement.getAttribute(e[i])),"value"===e[i].toLowerCase()&&(this.inputElement.value=this.cloneElement.getAttribute(e[i])))},a.prototype.popupCreation=function(){this.popupWrapper=this.createElement("div",{className:Ie+" e-popup",attrs:{id:this.element.id+"_popup",style:"visibility:hidden"}}),this.popupWrapper.setAttribute("aria-label",this.element.id),this.popupWrapper.setAttribute("role","dialog"),t.isNullOrUndefined(this.cssClass)||(this.popupWrapper.className+=" "+this.cssClass),!t.isNullOrUndefined(this.step)&&this.step>0&&(this.generateList(),t.append([this.listWrapper],this.popupWrapper)),this.addSelection(),this.renderPopup(),t.detach(this.popupWrapper)},a.prototype.getPopupHeight=function(){var e=parseInt("240px",10),t=this.popupWrapper.getBoundingClientRect().height;return t>e?e:t},a.prototype.generateList=function(){this.createListItems(),this.wireListEvents();var e={duration:300,selector:"."+Ae};this.rippleFn=t.rippleEffect(this.listWrapper,e),this.liCollections=this.listWrapper.querySelectorAll("."+Ae)},a.prototype.renderPopup=function(){var e=this;if(this.containerStyle=this.inputWrapper.container.getBoundingClientRect(),this.popupObj=new i.Popup(this.popupWrapper,{width:this.setPopupWidth(this.width),zIndex:this.zIndex,targetType:"relative",position:t.Browser.isDevice?{X:"center",Y:"center"}:{X:"left",Y:"bottom"},collision:t.Browser.isDevice?{X:"fit",Y:"fit"}:{X:"flip",Y:"flip"},enableRtl:this.enableRtl,relateTo:t.Browser.isDevice?document.body:this.inputWrapper.container,offsetY:4,open:function(){e.popupWrapper.style.visibility="visible",t.addClass([e.inputWrapper.buttons[0]],Te)},close:function(){t.removeClass([e.inputWrapper.buttons[0]],Te),e.unWireListEvents(),e.inputElement.removeAttribute("aria-activedescendant"),t.remove(e.popupObj.element),e.popupObj.destroy(),e.popupWrapper.innerHTML="",e.listWrapper=e.popupWrapper=e.listTag=void 0},targetExitViewport:function(){t.Browser.isDevice||e.hide()}}),t.Browser.isDevice||(this.popupObj.collision={X:"none",Y:"flip"}),t.Browser.isDevice&&this.fullScreenMode?(this.popupObj.element.style.maxHeight="100%",this.popupObj.element.style.width="100%"):this.popupObj.element.style.maxHeight="240px",t.Browser.isDevice&&this.fullScreenMode){var s=this.createElement("div",{className:"e-model-header"}),a=this.createElement("span",{className:"e-model-title"});a.textContent="Select time";var n=this.createElement("span",{className:"e-popup-close"});t.EventHandler.add(n,"mousedown touchstart",this.timePopupCloseHandler,this),s.appendChild(n),s.appendChild(a),this.popupWrapper.insertBefore(s,this.popupWrapper.firstElementChild)}},a.prototype.timePopupCloseHandler=function(e){this.hide()},a.prototype.getFormattedValue=function(e){return t.isNullOrUndefined(this.checkDateValue(e))?null:this.globalize.formatDate(e,{skeleton:"medium",type:"time"})},a.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():Ve,a=i?this.initValue.getMonth():Ne,n=i?this.initValue.getFullYear():Oe;return new Date(n,a,s,t.getHours(),t.getMinutes(),t.getSeconds())}}return null},a.prototype.updateHtmlAttributeToWrapper=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if(He.indexOf(s)>-1)if("class"===s){var a=this.htmlAttributes[""+s].replace(/\s+/g," ").trim();""!==a&&t.addClass([this.inputWrapper.container],a.split(" "))}else if("style"===s){var n=this.inputWrapper.container.getAttribute(s);n=t.isNullOrUndefined(n)?this.htmlAttributes[""+s]:n+this.htmlAttributes[""+s],this.inputWrapper.container.setAttribute(s,n)}else this.inputWrapper.container.setAttribute(s,this.htmlAttributes[""+s])}},a.prototype.updateHtmlAttributeToElement=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];He.indexOf(s)<0&&this.inputElement.setAttribute(s,this.htmlAttributes[""+s])}},a.prototype.updateCssClass=function(e,i){t.isNullOrUndefined(i)||(i=i.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e)||(e=e.replace(/\s+/g," ").trim()),s.Input.setCssClass(e,[this.inputWrapper.container],i),this.popupWrapper&&s.Input.setCssClass(e,[this.popupWrapper],i)},a.prototype.removeErrorClass=function(){t.removeClass([this.inputWrapper.container],"e-error"),t.attributes(this.inputElement,{"aria-invalid":"false"})},a.prototype.checkErrorState=function(e){var i=this.getDateObject(e);this.validateState(i)&&!this.invalidValueString||this.enableMask&&this.inputElement.value===this.maskedDateValue?this.removeErrorClass():(t.addClass([this.inputWrapper.container],"e-error"),t.attributes(this.inputElement,{"aria-invalid":"true"}))},a.prototype.validateInterval=function(){!t.isNullOrUndefined(this.step)&&this.step>0?this.enableElement([this.inputWrapper.buttons[0]]):this.disableTimeIcon()},a.prototype.disableTimeIcon=function(){this.disableElement([this.inputWrapper.buttons[0]]),this.hide()},a.prototype.disableElement=function(e){t.addClass(e,Se)},a.prototype.enableElement=function(e){t.removeClass(e,Se)},a.prototype.selectInputText=function(){this.inputElement.setSelectionRange(0,this.inputElement.value.length)},a.prototype.setCursorToEnd=function(){this.inputElement.setSelectionRange(this.inputElement.value.length,this.inputElement.value.length)},a.prototype.getMeridianText=function(){var e;if("en"===this.locale||"en-US"===this.locale)e=t.getValue("dayPeriods.format.wide",t.getDefaultDateObject());else{e=t.getValue("main."+this.locale+".dates.calendars.gregorian.dayPeriods.format.abbreviated",t.cldrData)}return e},a.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)}},a.prototype.getActiveElement=function(){return t.isNullOrUndefined(this.popupWrapper)?null:this.popupWrapper.querySelectorAll("."+Te)},a.prototype.isNullOrEmpty=function(e){return!!(t.isNullOrUndefined(e)||"string"==typeof e&&""===e.trim())},a.prototype.setWidth=function(e){return e="number"==typeof e?t.formatUnit(e):"string"==typeof e?e.match(/px|%|em/)?e:t.formatUnit(e):"100%"},a.prototype.setPopupWidth=function(e){if((e=this.setWidth(e)).indexOf("%")>-1){e=(this.containerStyle.width*parseFloat(e)/100).toString()+"px"}return e},a.prototype.setScrollPosition=function(){var e=this.selectedElement;t.isNullOrUndefined(e)?this.popupWrapper&&this.checkDateValue(this.scrollTo)&&this.setScrollTo():this.findScrollTop(e)},a.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},a.prototype.setScrollTo=function(){var e;if(t.isNullOrUndefined(this.popupWrapper))this.popupWrapper.scrollTop=0;else{var i=this.popupWrapper.querySelectorAll("."+Ae);if(i.length){var s=this.timeCollections[0],a=this.getDateObject(this.checkDateValue(this.scrollTo)).getTime();e=i[Math.round((a-s)/(6e4*this.step))]}}t.isNullOrUndefined(e)?this.popupWrapper.scrollTop=0:this.findScrollTop(e)},a.prototype.getText=function(){return t.isNullOrUndefined(this.checkDateValue(this.value))?"":this.getValue(this.value)},a.prototype.getValue=function(e){return t.isNullOrUndefined(this.checkDateValue(e))?null:this.globalize.formatDate(e,{format:this.cldrTimeFormat(),type:"time"})},a.prototype.cldrDateFormat=function(){return"en"===this.locale||"en-US"===this.locale?t.getValue("dateFormats.short",t.getDefaultDateObject()):this.getCultureDateObject(t.cldrData,""+this.locale)},a.prototype.cldrTimeFormat=function(){return this.isNullOrEmpty(this.formatString)?"en"===this.locale||"en-US"===this.locale?t.getValue("timeFormats.short",t.getDefaultDateObject()):this.getCultureTimeObject(t.cldrData,""+this.locale):this.formatString},a.prototype.dateToNumeric=function(){return"en"===this.locale||"en-US"===this.locale?t.getValue("timeFormats.medium",t.getDefaultDateObject()):t.getValue("main."+this.locale+".dates.calendars.gregorian.timeFormats.medium",t.cldrData)},a.prototype.getExactDateTime=function(e){return t.isNullOrUndefined(this.checkDateValue(e))?null:this.globalize.formatDate(e,{format:this.dateToNumeric(),type:"time"})},a.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)},a.prototype.compareFormatChange=function(e){return t.isNullOrUndefined(e)?null:e!==this.getText()?this.getDateObject(e):this.getDateObject(this.value)},a.prototype.updatePlaceHolder=function(){s.Input.setPlaceholder(this.l10n.getConstant("placeholder"),this.inputElement)},a.prototype.updateInputValue=function(e){s.Input.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton)},a.prototype.preventEventBubbling=function(e){e.preventDefault(),this.interopAdaptor.invokeMethodAsync("OnTimeIconClick")},a.prototype.popupHandler=function(e){this.enabled&&(t.Browser.isDevice&&this.inputElement.setAttribute("readonly",""),e.preventDefault(),this.isPopupOpen()?this.closePopup(0,e):(this.inputElement.focus(),this.show(e)))},a.prototype.mouseDownHandler=function(){this.enabled&&(this.readonly||(this.inputElement.setSelectionRange(0,0),t.EventHandler.add(this.inputElement,"mouseup",this.mouseUpHandler,this)))},a.prototype.mouseUpHandler=function(e){if(!this.readonly){if(e.preventDefault(),this.enableMask)return e.preventDefault(),void this.notify("setMaskSelection",{module:"MaskedDateTime"});t.EventHandler.remove(this.inputElement,"mouseup",this.mouseUpHandler);var i=this.getCursorSelection();0===i.start&&i.end===this.inputElement.value.length||(this.inputElement.value.length>0&&(this.cursorDetails=this.focusSelection()),this.inputElement.setSelectionRange(this.cursorDetails.start,this.cursorDetails.end))}},a.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}},a.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}},a.prototype.onMouseClick=function(e){var i=e.target,s=this.selectedElement=t.closest(i,"."+Ae);this.setSelection(s,e),s&&s.classList.contains(Ae)&&this.hide()},a.prototype.closePopup=function(e,i){var s=this;if(this.isPopupOpen()&&this.popupWrapper){var a={popup:this.popupObj,event:i||null,cancel:!1,name:"open"};t.removeClass([document.body],"e-time-overflow"),this.trigger("close",a,function(i){if(!i.cancel){var a={name:"FadeOut",duration:50,delay:e||0};s.popupObj.hide(new t.Animation(a)),t.removeClass([s.inputWrapper.container],["e-icon-anim"]),t.attributes(s.inputElement,{"aria-expanded":"false"}),s.inputElement.removeAttribute("aria-owns"),s.inputElement.removeAttribute("aria-controls"),s.inputElement.removeAttribute("aria-activedescendant"),t.EventHandler.remove(document,"mousedown touchstart",s.documentClickHandler)}t.Browser.isDevice&&s.modal&&(s.modal.style.display="none",s.modal.outerHTML="",s.modal=null),t.Browser.isDevice&&(t.isNullOrUndefined(s.mobileTimePopupWrap)||(s.mobileTimePopupWrap.remove(),s.mobileTimePopupWrap=null)),t.Browser.isDevice&&s.allowEdit&&!s.readonly&&s.inputElement.removeAttribute("readonly")})}else t.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly")},a.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")},a.prototype.checkValueChange=function(e,i){if(this.strictMode||this.validateState(this.valueWithMinutes))if(i){var s=this.getDateObject(new Date(this.timeCollections[this.activeIndex]));+this.prevDate!=+s&&this.valueProcess(e,s)}else(this.prevValue!==this.inputElement.value||t.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)},a.prototype.onMouseOver=function(e){var i=t.closest(e.target,"."+Ae);this.setHover(i,"e-hover")},a.prototype.setHover=function(e,i){this.enabled&&this.isValidLI(e)&&!e.classList.contains(i)&&(this.removeHover(i),t.addClass([e],i),i===xe&&e.setAttribute("aria-selected","true"))},a.prototype.setSelection=function(e,i){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]),t.addClass([this.selectedElement],Te),this.selectedElement.setAttribute("aria-selected","true"),this.checkValueChange(i,!0))},a.prototype.onMouseLeave=function(){this.removeHover("e-hover")},a.prototype.scrollHandler=function(){"timepicker"===this.getModuleName()&&t.Browser.isDevice||this.hide()},a.prototype.setMinMax=function(e,i){t.isNullOrUndefined(this.checkDateValue(e))&&(this.initMin=this.getDateObject("12:00:00 AM")),t.isNullOrUndefined(this.checkDateValue(i))&&(this.initMax=this.getDateObject("11:59:59 PM"))},a.prototype.validateMinMax=function(e,i,s){var a=e instanceof Date?e:this.getDateObject(e);return t.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},a.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},a.prototype.validateState=function(e){if(!this.strictMode){if(!this.valueIsDisable(e))return!1;var i=this.setCurrentDate(this.getDateObject(e)),s=this.setCurrentDate(this.getDateObject(this.initMax)),a=this.setCurrentDate(this.getDateObject(this.initMin));if(t.isNullOrUndefined(this.checkDateValue(i))){if(+s<+a||""!==this.inputElement.value)return!1}else if(+i>+s||+i<+a)return!1}return!0},a.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},a.prototype.bindEvents=function(){t.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.popupHandler,this),t.EventHandler.add(this.inputElement,"blur",this.inputBlurHandler,this),t.EventHandler.add(this.inputElement,"focus",this.inputFocusHandler,this),t.EventHandler.add(this.inputElement,"change",this.inputChangeHandler,this),t.EventHandler.add(this.inputElement,"input",this.inputEventHandler,this),this.enableMask&&t.EventHandler.add(this.inputElement,"keydown",this.keydownHandler,this),this.showClearButton&&this.inputWrapper.clearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.clearHandler,this),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this),t.Browser.isDevice||(this.keyConfigure=t.extend(this.keyConfigure,this.keyConfigs),this.inputEvent=new t.KeyboardEvents(this.inputWrapper.container,{keyAction:this.inputHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}),this.showClearButton&&this.inputElement&&t.EventHandler.add(this.inputElement,"mousedown",this.mouseDownHandler,this))},a.prototype.keydownHandler=function(e){switch(e.code){case"Delete":!this.enableMask||this.popupObj||this.readonly||this.notify("keyDownHandler",{module:"MaskedDateTime",e:e})}},a.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)}},a.prototype.inputChangeHandler=function(e){this.enabled&&e.stopPropagation()},a.prototype.inputEventHandler=function(){this.enableMask&&this.notify("inputHandler",{module:"MaskedDateTime"})},a.prototype.unBindEvents=function(){this.inputWrapper&&t.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown touchstart",this.popupHandler),t.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),t.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),t.EventHandler.remove(this.inputElement,"change",this.inputChangeHandler),t.EventHandler.remove(this.inputElement,"input",this.inputEventHandler),this.inputEvent&&this.inputEvent.destroy(),t.EventHandler.remove(this.inputElement,"mousedown touchstart",this.mouseDownHandler),!this.showClearButton||t.isNullOrUndefined(this.inputWrapper)||t.isNullOrUndefined(this.inputWrapper.clearButton)||t.EventHandler.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.clearHandler),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},a.prototype.bindClearEvent=function(){this.showClearButton&&this.inputWrapper.clearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.clearHandler,this)},a.prototype.raiseClearedEvent=function(e){var t={event:e};this.trigger("cleared",t)},a.prototype.clearHandler=function(e){if(this.enabled&&(e.preventDefault(),t.isNullOrUndefined(this.value)?(this.resetState(),this.raiseClearedEvent(e)):this.clear(e),this.popupWrapper&&(this.popupWrapper.scrollTop=0),this.enableMask&&this.notify("clearHandler",{module:"MaskedDateTime"}),t.closest(this.element,"form"))){var i=this.element,s=document.createEvent("KeyboardEvent");s.initEvent("keyup",!1,!0),i.dispatchEvent(s)}},a.prototype.clear=function(e){this.setProperties({value:null},!0),this.initValue=null,this.resetState(),this.raiseClearedEvent(e),this.changeEvent(e)},a.prototype.setZIndex=function(){this.popupObj&&(this.popupObj.zIndex=this.zIndex,this.popupObj.dataBind())},a.prototype.checkAttributes=function(e){for(var i,s=0,a=e?t.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(!t.isNullOrUndefined(this.inputElement.getAttribute(n)))switch(n){case"disabled":if(t.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(t.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":(t.isNullOrUndefined(this.timeOptions)||void 0===this.timeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(n)},!e);break;case"min":(t.isNullOrUndefined(this.timeOptions)||void 0===this.timeOptions.min||e)&&(i=new Date(this.inputElement.getAttribute(n)),t.isNullOrUndefined(this.checkDateValue(i))||this.setProperties({min:i},!e));break;case"max":(t.isNullOrUndefined(this.timeOptions)||void 0===this.timeOptions.max||e)&&(i=new Date(this.inputElement.getAttribute(n)),t.isNullOrUndefined(this.checkDateValue(i))||this.setProperties({max:i},!e));break;case"value":(t.isNullOrUndefined(this.timeOptions)||void 0===this.timeOptions.value||e)&&(i=new Date(this.inputElement.getAttribute(n)),t.isNullOrUndefined(this.checkDateValue(i))||(this.initValue=i,this.updateInput(!1,this.initValue),this.setProperties({value:i},!e)))}}},a.prototype.setCurrentDate=function(e){return t.isNullOrUndefined(this.checkDateValue(e))?null:new Date(Oe,Ne,Ve,e.getHours(),e.getMinutes(),e.getSeconds())},a.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},a.prototype.updateValue=function(e,i){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),t.isNullOrUndefined(s)&&e!==this.maskedDateValue&&this.createMask(),t.isNullOrUndefined(s)&&e===this.maskedDateValue&&this.updateInputValue(this.maskedDateValue))}this.checkValueChange(i,"string"!=typeof e)},a.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.prevValue},a.prototype.resetState=function(){this.removeSelection(),s.Input.setValue("",this.inputElement,this.floatLabelType,!1),this.valueWithMinutes=this.activeIndex=null,this.strictMode||this.checkErrorState(null)},a.prototype.objToString=function(e){return t.isNullOrUndefined(this.checkDateValue(e))?null:this.globalize.formatDate(e,{format:this.cldrTimeFormat(),type:"time"})},a.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},a.prototype.validateValue=function(e,i){var s,a=this.validateMinMax(i,this.min,this.max),n=this.getDateObject(a);if(this.getFormattedValue(n)!==this.getFormattedValue(this.value)?(this.valueWithMinutes=t.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&&t.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),t.isNullOrUndefined(s)&&i!==this.maskedDateValue&&this.createMask(),t.isNullOrUndefined(s)&&i===this.maskedDateValue&&this.updateInputValue(this.maskedDateValue));return s},a.prototype.createMask=function(){this.notify("createMask",{module:"MaskedDateTime"})},a.prototype.findNextElement=function(e){var i=this.inputElement.value,s=t.isNullOrUndefined(this.valueWithMinutes)?this.createDateObj(i):this.getDateObject(this.valueWithMinutes),a=null,n=this.liCollections.length,r=this.timeCollections;if(t.isNullOrUndefined(this.checkDateValue(s))&&t.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(t.isNullOrUndefined(a)?null:new Date(a))}},a.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]))},a.prototype.elementValue=function(e){t.isNullOrUndefined(this.checkDateValue(e))||this.checkValue(e)},a.prototype.validLiElement=function(e,i){var s=null,a=t.isNullOrUndefined(this.popupWrapper)?this.liCollections:this.popupWrapper.querySelectorAll("."+Ae),n=!0;if(a.length)if(i)for(var r=e;r>=0;r--){if(!a[r].classList.contains(Se)){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(Se)){s=r;break}r===a.length-1&&n&&(e=r=-1,n=!1)}return s},a.prototype.keyHandler=function(e){if(!(t.isNullOrUndefined(this.step)||this.step<=0||!t.isNullOrUndefined(this.inputWrapper)&&this.inputWrapper.buttons[0].classList.contains(Se))){var i=this.timeCollections.length;if(t.isNullOrUndefined(this.getActiveElement())||0===this.getActiveElement().length)if(this.liCollections.length>0)if(t.isNullOrUndefined(this.value)&&t.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===i?0:this.activeIndex,this.activeIndex=s=this.activeIndex<0?i-1:this.activeIndex,this.activeIndex=s=this.validLiElement(this.activeIndex,40!==e.keyCode&&39!==e.keyCode),a=t.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(i-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,xe),this.setActiveDescendant(),this.enableMask&&this.selectInputText(),!this.isPopupOpen()||null===this.selectedElement||e&&"click"===e.type||this.setScrollPosition()}},a.prototype.getCultureTimeObject=function(e,i){return t.getValue("main."+i+".dates.calendars.gregorian.timeFormats.short",e)},a.prototype.getCultureDateObject=function(e,i){return t.getValue("main."+i+".dates.calendars.gregorian.dateFormats.short",e)},a.prototype.wireListEvents=function(){t.EventHandler.add(this.listWrapper,"click",this.onMouseClick,this),t.Browser.isDevice||(t.EventHandler.add(this.listWrapper,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.listWrapper,"mouseout",this.onMouseLeave,this))},a.prototype.unWireListEvents=function(){this.listWrapper&&(t.EventHandler.remove(this.listWrapper,"click",this.onMouseClick),t.Browser.isDevice||(t.EventHandler.remove(this.listWrapper,"mouseover",this.onMouseOver),t.EventHandler.remove(this.listWrapper,"mouseout",this.onMouseLeave)))},a.prototype.valueProcess=function(e,i){var s=t.isNullOrUndefined(this.checkDateValue(i))?null:i;+this.prevDate!=+s&&(this.initValue=s,this.changeEvent(e))},a.prototype.changeEvent=function(e){this.addSelection(),this.updateInput(!0,this.initValue);var i={event:e||null,value:this.value,text:this.inputElement.value,isInteracted:!t.isNullOrUndefined(e),element:this.element};i.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",i),this.invalidValueString=null,this.checkErrorState(this.value)},a.prototype.updateInput=function(e,i){e&&(this.prevValue=this.getValue(i)),this.prevDate=this.valueWithMinutes=i,"number"==typeof i&&(this.value&&+new Date(+this.value).setMilliseconds(0))===+i||(this.setProperties({value:i},!0),this.enableMask&&this.value&&this.createMask()),!this.strictMode&&t.isNullOrUndefined(this.value)&&this.invalidValueString&&(this.checkErrorState(this.invalidValueString),this.updateInputValue(this.invalidValueString)),this.clearIconState()},a.prototype.setActiveDescendant=function(){!t.isNullOrUndefined(this.selectedElement)&&this.value?t.attributes(this.inputElement,{"aria-activedescendant":this.selectedElement.getAttribute("id")}):this.inputElement.removeAttribute("aria-activedescendant")},a.prototype.removeSelection=function(){if(this.removeHover("e-hover"),!t.isNullOrUndefined(this.popupWrapper)){var e=this.popupWrapper.querySelectorAll("."+Te);e.length&&(t.removeClass(e,Te),e[0].removeAttribute("aria-selected"))}},a.prototype.removeHover=function(e){var i=this.getHoverItem(e);i&&i.length&&(t.removeClass(i,e),e===xe&&i[0].removeAttribute("aria-selected"))},a.prototype.getHoverItem=function(e){var i;return t.isNullOrUndefined(this.popupWrapper)||(i=this.popupWrapper.querySelectorAll("."+e)),i},a.prototype.setActiveClass=function(){if(!t.isNullOrUndefined(this.popupWrapper)){var e=this.popupWrapper.querySelectorAll("."+Ae);if(e.length)for(var i=0;i<e.length;i++)if(this.timeCollections[i]===+this.getDateObject(this.valueWithMinutes)){e[i].setAttribute("aria-selected","true"),this.selectedElement=e[i],this.activeIndex=i;break}}},a.prototype.addSelection=function(){this.selectedElement=null,this.removeSelection(),this.setActiveClass(),t.isNullOrUndefined(this.selectedElement)||(t.addClass([this.selectedElement],Te),this.selectedElement.setAttribute("aria-selected","true"))},a.prototype.isValidLI=function(e){return e&&e.classList.contains(Ae)&&!e.classList.contains(Se)},a.prototype.createDateObj=function(e){var i=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?(i=this.defaultCulture.formatDate(new Date,{format:null,skeleton:"short",type:"date"}),s=isNaN(+new Date(i+" "+e))?null:new Date(new Date(i+" "+e).setMilliseconds(0)),t.isNullOrUndefined(s)&&(s=this.timeParse(i,e))):s=this.timeParse(i,e):e instanceof Date&&(s=e),s},a.prototype.timeParse=function(e,i){var s;return s=this.globalize.parseDate(e+" "+i,{format:this.cldrDateFormat()+" "+this.cldrTimeFormat(),type:"datetime"}),s=t.isNullOrUndefined(s)?this.globalize.parseDate(e+" "+i,{format:this.cldrDateFormat()+" "+this.dateToNumeric(),type:"datetime"}):s,s=t.isNullOrUndefined(s)?s:new Date(s.setMilliseconds(0))},a.prototype.createListItems=function(){var e=this;this.listWrapper=this.createElement("div",{className:"e-content",attrs:{tabindex:"-1"}});var i,s=6e4*this.step,a=[];this.timeCollections=[],this.disableItemCollection=[],i=+this.getDateObject(this.initMin).setMilliseconds(0);for(var r=+this.getDateObject(this.initMax).setMilliseconds(0);r>=i;)this.timeCollections.push(i),a.push(this.globalize.formatDate(new Date(i),{format:this.cldrTimeFormat(),type:"time"})),i+=s;var l={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(Se),t.element.classList.contains(Se)&&e.disableItemCollection.push(t.element.getAttribute("data-value"))})}};this.listTag=n.ListBase.createList(this.createElement,a,l,!0),t.attributes(this.listTag,{role:"listbox","aria-hidden":"false",id:this.element.id+"_options",tabindex:"0"}),t.append([this.listTag],this.listWrapper)},a.prototype.documentClickHandler=function(e){var i=e.target;t.isNullOrUndefined(this.popupObj)||t.isNullOrUndefined(this.inputWrapper)||!(this.inputWrapper.container.contains(i)&&"mousedown"!==e.type||this.popupObj.element&&this.popupObj.element.contains(i))||"touchstart"===e.type||e.preventDefault(),t.closest(i,'[id="'+this.popupObj.element.id+'"]')||i===this.inputElement||i===(this.inputWrapper&&this.inputWrapper.buttons[0])||i===(this.inputWrapper&&this.inputWrapper.clearButton)||i===(this.inputWrapper&&this.inputWrapper.container)||i.classList.contains("e-dlg-overlay")?i!==this.inputElement&&(t.Browser.isDevice||(this.isPreventBlur=(t.Browser.isIE||"edge"===t.Browser.info.name)&&document.activeElement===this.inputElement&&i===this.popupWrapper)):this.isPopupOpen()&&(this.hide(),this.focusOut())},a.prototype.setEnableRtl=function(){s.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]),this.popupObj&&(this.popupObj.enableRtl=this.enableRtl,this.popupObj.dataBind())},a.prototype.setEnable=function(){s.Input.setEnabled(this.enabled,this.inputElement,this.floatLabelType),this.enabled?(t.removeClass([this.inputWrapper.container],Se),t.attributes(this.inputElement,{"aria-disabled":"false"}),this.inputElement.setAttribute("tabindex",this.tabIndex)):(this.hide(),t.addClass([this.inputWrapper.container],Se),t.attributes(this.inputElement,{"aria-disabled":"true"}),this.inputElement.tabIndex=-1)},a.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)},a.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("")),t.removeClass([this.inputWrapper.container],[Pe]),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 i={model:this};this.trigger("blur",i)}},a.prototype.focusOut=function(){if(document.activeElement===this.inputElement){this.inputElement.blur(),t.removeClass([this.inputWrapper.container],[Pe]);var e={model:this};this.trigger("blur",e)}},a.prototype.isPopupOpen=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains(""+Ie))},a.prototype.inputFocusHandler=function(){if(this.enabled){var e={model:this};this.readonly||t.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()}},a.prototype.focusIn=function(){document.activeElement!==this.inputElement&&this.enabled&&this.inputElement.focus()},a.prototype.hide=function(){this.closePopup(100,null),this.clearIconState()},a.prototype.show=function(e){var i=this;if(!(this.enabled&&this.readonly||!this.enabled||this.popupWrapper)){this.popupCreation(),t.Browser.isDevice&&this.listWrapper&&(this.modal=this.createElement("div"),this.modal.className=Ie+" e-time-modal",document.body.className+=" e-time-overflow",document.body.appendChild(this.modal)),t.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:t.Browser.isDevice?this.mobileTimePopupWrap:document.body};var s=this.openPopupEventArgs;if(this.trigger("open",s,function(e){if(i.openPopupEventArgs=e,i.openPopupEventArgs.cancel||i.inputWrapper.buttons[0].classList.contains(Se))i.popupObj.destroy(),i.popupWrapper=i.listTag=void 0,i.liCollections=i.timeCollections=i.disableItemCollection=[],i.popupObj=null;else{i.openPopupEventArgs.appendTo.appendChild(i.popupWrapper),i.popupAlignment(i.openPopupEventArgs),i.setScrollPosition(),t.Browser.isDevice||i.inputElement.focus();var s={name:"FadeIn",duration:50};i.popupObj.refreshPosition(i.anchor),1e3===i.zIndex?i.popupObj.show(new t.Animation(s),i.element):i.popupObj.show(new t.Animation(s),null),i.setActiveDescendant(),t.attributes(i.inputElement,{"aria-expanded":"true"}),t.attributes(i.inputElement,{"aria-owns":i.inputElement.id+"_options"}),t.attributes(i.inputElement,{"aria-controls":i.inputElement.id}),t.addClass([i.inputWrapper.container],Pe),t.EventHandler.add(document,"mousedown touchstart",i.documentClickHandler,i),i.setOverlayIndex(i.mobileTimePopupWrap,i.popupObj.element,i.modal,t.Browser.isDevice)}}),t.Browser.isDevice){var a=this.createElement("div",{className:"e-dlg-overlay"});a.style.zIndex=(this.zIndex-1).toString(),this.mobileTimePopupWrap.appendChild(a)}}},a.prototype.setOverlayIndex=function(e,i,s,a){if(a&&!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(s)&&!t.isNullOrUndefined(e)){var n=parseInt(i.style.zIndex,10)?parseInt(i.style.zIndex,10):1e3;s.style.zIndex=(n-1).toString(),e.style.zIndex=n.toString()}},a.prototype.formatValues=function(e){var i;return"number"==typeof e?i=t.formatUnit(e):"string"==typeof e&&(i=e.match(/px|%|em/)?e:isNaN(parseInt(e,10))?e:t.formatUnit(e)),i},a.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)),t.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")}},a.prototype.getPersistData=function(){return this.addOnPersist(["value"])},a.prototype.getModuleName=function(){return"timepicker"},a.prototype.onPropertyChanged=function(e,i){for(var a=0,n=Object.keys(e);a<n.length;a++){var r=n[a];switch(r){case"placeholder":s.Input.setPlaceholder(e.placeholder,this.inputElement);break;case"readonly":s.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,i.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,r);break;case"showClearButton":s.Input.setClearButton(this.showClearButton,this.inputElement,this.inputWrapper),this.bindClearEvent();break;case"locale":this.setProperties({locale:e.locale},!0),this.globalize=new t.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":t.setStyleAttribute(this.inputWrapper.container,{width:this.setWidth(e.width)}),this.containerStyle=this.inputWrapper.container.getBoundingClientRect(),s.Input.calculateWidth(this.inputElement,this.inputWrapper.container),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.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&&t.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,s.Input.removeFloating(this.inputWrapper),s.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.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("")}}},a.prototype.checkInValue=function(e){return e instanceof Date?e.toUTCString():""+e},we([t.Property(null)],a.prototype,"width",void 0),we([t.Property(null)],a.prototype,"cssClass",void 0),we([t.Property(!1)],a.prototype,"strictMode",void 0),we([t.Property(null)],a.prototype,"keyConfigs",void 0),we([t.Property(null)],a.prototype,"format",void 0),we([t.Property(!0)],a.prototype,"enabled",void 0),we([t.Property(!1)],a.prototype,"fullScreenMode",void 0),we([t.Property(!1)],a.prototype,"readonly",void 0),we([t.Property({})],a.prototype,"htmlAttributes",void 0),we([t.Property("Never")],a.prototype,"floatLabelType",void 0),we([t.Property(null)],a.prototype,"placeholder",void 0),we([t.Property(1e3)],a.prototype,"zIndex",void 0),we([t.Property(!1)],a.prototype,"enablePersistence",void 0),we([t.Property(!0)],a.prototype,"showClearButton",void 0),we([t.Property(30)],a.prototype,"step",void 0),we([t.Property(null)],a.prototype,"scrollTo",void 0),we([t.Property(null)],a.prototype,"value",void 0),we([t.Property(null)],a.prototype,"min",void 0),we([t.Property(null)],a.prototype,"max",void 0),we([t.Property(!0)],a.prototype,"allowEdit",void 0),we([t.Property(!1)],a.prototype,"openOnFocus",void 0),we([t.Property(!1)],a.prototype,"enableMask",void 0),we([t.Property({day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"})],a.prototype,"maskPlaceholder",void 0),we([t.Property(null)],a.prototype,"serverTimezoneOffset",void 0),we([t.Event()],a.prototype,"change",void 0),we([t.Event()],a.prototype,"created",void 0),we([t.Event()],a.prototype,"destroyed",void 0),we([t.Event()],a.prototype,"open",void 0),we([t.Event()],a.prototype,"itemRender",void 0),we([t.Event()],a.prototype,"close",void 0),we([t.Event()],a.prototype,"cleared",void 0),we([t.Event()],a.prototype,"blur",void 0),we([t.Event()],a.prototype,"focus",void 0),a=we([t.NotifyPropertyChanges],a)}(t.Component),Fe=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)}}(),Be=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=(new Date).getDate(),Re=(new Date).getMonth(),Ye=(new Date).getFullYear(),ze=(new Date).getHours(),qe=(new Date).getMinutes(),Ke=(new Date).getSeconds(),_e=(new Date).getMilliseconds(),Ge="e-datetimepicker",Ze="e-datetimepopup-wrapper",Xe="e-input-focus",Je="e-disabled",$e="e-active",Qe="e-list-item",et=function(a){function n(e,t){var i=a.call(this,e,t)||this;return i.valueWithMinutes=null,i.scrollInvoked=!1,i.moduleName=i.getModuleName(),i.formatRegex=/dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yyy|yy|y|'[^']*'|'[^']*'/g,i.dateFormatString="",i.dateTimeOptions=e,i}return Fe(n,a),n.prototype.focusHandler=function(){this.enabled&&t.addClass([this.inputWrapper.container],Xe)},n.prototype.focusIn=function(){a.prototype.focusIn.call(this)},n.prototype.focusOut=function(){document.activeElement===this.inputElement&&(this.inputElement.blur(),t.removeClass([this.inputWrapper.container],[Xe]))},n.prototype.blurHandler=function(e){if(this.enabled)if(this.isTimePopupOpen()&&this.isPreventBlur)this.inputElement.focus();else{t.removeClass([this.inputWrapper.container],Xe);var i={model:this};this.isTimePopupOpen()&&this.hide(e),this.trigger("blur",i)}},n.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(),t.detach(this.dateTimeWrapper),this.dateTimeWrapper=void 0,this.liCollections=this.timeCollections=[],t.isNullOrUndefined(this.rippleFn)||this.rippleFn());this.inputElement&&s.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&&t.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,s.Input.destroy({element:this.inputElement,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),a.prototype.destroy.call(this)},n.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))),!t.isNullOrUndefined(t.closest(this.element,"fieldset"))&&t.closest(this.element,"fieldset").disabled&&(this.enabled=!1),a.prototype.updateHtmlAttributeToElement.call(this),this.checkAttributes(!1);var e={placeholder:this.placeholder};this.l10n=new t.L10n("datetimepicker",e,this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),a.prototype.render.call(this),this.createInputElement(),a.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||s.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&&s.Input.calculateWidth(this.inputElement,this.inputWrapper.container),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.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()},n.prototype.setValue=function(e){if(void 0===e&&(e=!1),this.initValue=this.validateMinMaxRange(this.value),!this.strictMode&&this.isDateObject(this.initValue)){var i=this.validateMinMaxRange(this.initValue);s.Input.setValue(this.getFormattedValue(i),this.inputElement,this.floatLabelType,this.showClearButton),this.setProperties({value:i},!0)}else t.isNullOrUndefined(this.value)&&(this.initValue=null,this.setProperties({value:null},!0));this.valueWithMinutes=this.value,a.prototype.updateInput.call(this,e)},n.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},n.prototype.checkValidState=function(e){this.isValidState=!0,this.strictMode||(+e>+this.max||+e<+this.min)&&(this.isValidState=!1),this.checkErrorState()},n.prototype.checkErrorState=function(){this.isValidState?t.removeClass([this.inputWrapper.container],"e-error"):t.addClass([this.inputWrapper.container],"e-error"),t.attributes(this.inputElement,{"aria-invalid":this.isValidState?"false":"true"})},n.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},n.prototype.disablePopupButton=function(e){e?(t.addClass([this.inputWrapper.buttons[0],this.timeIcon],Je),this.hide()):t.removeClass([this.inputWrapper.buttons[0],this.timeIcon],Je)},n.prototype.getFormattedValue=function(e){var i;return t.isNullOrUndefined(e)?null:(i="Gregorian"===this.calendarMode?{format:this.cldrDateTimeFormat(),type:"dateTime",skeleton:"yMd"}:{format:this.cldrDateTimeFormat(),type:"dateTime",skeleton:"yMd",calendar:"islamic"},this.globalize.formatDate(e,i))},n.prototype.isDateObject=function(e){return!t.isNullOrUndefined(e)&&!isNaN(+e)},n.prototype.createInputElement=function(){t.removeClass([this.inputElement],"e-datepicker"),t.removeClass([this.inputWrapper.container],"e-date-wrapper"),t.addClass([this.inputWrapper.container],"e-datetime-wrapper"),t.addClass([this.inputElement],Ge),this.renderTimeIcon()},n.prototype.renderTimeIcon=function(){this.timeIcon=s.Input.appendSpan("e-input-group-icon e-time-icon e-icons",this.inputWrapper.container)},n.prototype.bindInputEvents=function(){t.EventHandler.add(this.timeIcon,"mousedown",this.timeHandler,this),t.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.dateHandler,this),t.EventHandler.add(this.inputElement,"blur",this.blurHandler,this),t.EventHandler.add(this.inputElement,"focus",this.focusHandler,this),this.defaultKeyConfigs=t.extend(this.defaultKeyConfigs,this.keyConfigs),this.keyboardHandler=new t.KeyboardEvents(this.inputElement,{eventName:"keydown",keyAction:this.inputKeyAction.bind(this),keyConfigs:this.defaultKeyConfigs})},n.prototype.unBindInputEvents=function(){t.EventHandler.remove(this.timeIcon,"mousedown touchstart",this.timeHandler),t.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown touchstart",this.dateHandler),this.inputElement&&(t.EventHandler.remove(this.inputElement,"blur",this.blurHandler),t.EventHandler.remove(this.inputElement,"focus",this.focusHandler)),this.keyboardHandler&&this.keyboardHandler.destroy()},n.prototype.cldrTimeFormat=function(){return this.isNullOrEmpty(this.timeFormat)?"en"===this.locale||"en-US"===this.locale?t.getValue("timeFormats.short",t.getDefaultDateObject()):this.getCultureTimeObject(t.cldrData,""+this.locale):this.timeFormat},n.prototype.cldrDateTimeFormat=function(){var e=new t.Internationalization(this.locale).getDatePattern({skeleton:"yMd"});return this.isNullOrEmpty(this.formatString)?e+" "+this.getCldrFormat("time"):this.formatString},n.prototype.getCldrFormat=function(e){return"en"===this.locale||"en-US"===this.locale?t.getValue("timeFormats.short",t.getDefaultDateObject()):this.getCultureTimeObject(t.cldrData,""+this.locale)},n.prototype.isNullOrEmpty=function(e){return!!(t.isNullOrUndefined(e)||"string"==typeof e&&""===e.trim())},n.prototype.getCultureTimeObject=function(e,i){return"Gregorian"===this.calendarMode?t.getValue("main."+this.locale+".dates.calendars.gregorian.timeFormats.short",e):t.getValue("main."+this.locale+".dates.calendars.islamic.timeFormats.short",e)},n.prototype.timeHandler=function(e){this.enabled&&(this.isIconClicked=!0,t.Browser.isDevice&&this.inputElement.setAttribute("readonly",""),e.currentTarget===this.timeIcon&&e.preventDefault(),this.enabled&&!this.readonly&&(this.isDatePopupOpen()&&a.prototype.hide.call(this,e),this.isTimePopupOpen()?this.closePopup(e):(this.inputElement.focus(),this.popupCreation("time",e),t.addClass([this.inputWrapper.container],[Xe]))),this.isIconClicked=!1)},n.prototype.dateHandler=function(e){this.enabled&&(e.currentTarget===this.inputWrapper.buttons[0]&&e.preventDefault(),this.enabled&&!this.readonly&&(this.isTimePopupOpen()&&this.closePopup(e),t.isNullOrUndefined(this.popupWrapper)||this.popupCreation("date",e)))},n.prototype.show=function(e,t){this.enabled&&this.readonly||!this.enabled||("time"!==e||this.dateTimeWrapper?this.popupObj||(this.isTimePopupOpen()&&this.hide(t),a.prototype.show.call(this),this.popupCreation("date",t)):(this.isDatePopupOpen()&&this.hide(t),this.popupCreation("time",t)))},n.prototype.toggle=function(e){this.isDatePopupOpen()?(a.prototype.hide.call(this,e),this.show("time",null)):this.isTimePopupOpen()?(this.hide(e),a.prototype.show.call(this,null,e),this.popupCreation("date",null)):this.show(null,e)},n.prototype.listCreation=function(){var i;"Gregorian"===this.calendarMode?(this.cldrDateTimeFormat().replace(this.formatRegex,this.TimePopupFormat()),""===this.dateFormatString&&(this.dateFormatString=this.cldrDateTimeFormat()),i=this.globalize.parseDate(this.inputElement.value,{format:this.dateFormatString,type:"datetime"})):i=this.globalize.parseDate(this.inputElement.value,{format:this.cldrDateTimeFormat(),type:"datetime",calendar:"islamic"});var s=t.isNullOrUndefined(this.value)?""!==this.inputElement.value?i:new Date:this.value;this.valueWithMinutes=s,this.listWrapper=t.createElement("div",{className:"e-content",attrs:{tabindex:"0"}});var a=this.startTime(s),n=this.endTime(s),r=e.TimePickerBase.createListItems(this.createElement,a,n,this.globalize,this.cldrTimeFormat(),this.step);this.timeCollections=r.collection,this.listTag=r.list,t.attributes(this.listTag,{role:"listbox","aria-hidden":"false",id:this.element.id+"_options"}),t.append([r.list],this.listWrapper),this.wireTimeListEvents();var l={duration:300,selector:"."+Qe};this.rippleFn=t.rippleEffect(this.listWrapper,l),this.liCollections=this.listWrapper.querySelectorAll("."+Qe)},n.prototype.popupCreation=function(e,i){if(t.Browser.isDevice&&this.element.setAttribute("readonly","readonly"),"date"===e)!this.readonly&&this.popupWrapper&&(t.addClass([this.popupWrapper],Ze),t.attributes(this.popupWrapper,{id:this.element.id+"_options"}));else if(!this.readonly&&(this.dateTimeWrapper=t.createElement("div",{className:Ge+" e-popup",attrs:{id:this.element.id+"_timepopup",style:"visibility:hidden ; display:block"}}),t.isNullOrUndefined(this.cssClass)||(this.dateTimeWrapper.className+=" "+this.cssClass),!t.isNullOrUndefined(this.step)&&this.step>0&&(this.listCreation(),t.append([this.listWrapper],this.dateTimeWrapper)),document.body.appendChild(this.dateTimeWrapper),this.addTimeSelection(),this.renderPopup(),this.setTimeScrollPosition(),this.openPopup(i),(!t.Browser.isDevice||t.Browser.isDevice&&!this.fullScreenMode)&&this.popupObject.refreshPosition(this.inputElement),t.Browser.isDevice&&this.fullScreenMode&&(this.dateTimeWrapper.style.left="0px"),t.Browser.isDevice)){var s=this.createElement("div",{className:"e-dlg-overlay"});s.style.zIndex=(this.zIndex-1).toString(),this.timeModal.appendChild(s)}},n.prototype.openPopup=function(e){var i=this;this.preventArgs={cancel:!1,popup:this.popupObject,event:e||null};var s=this.preventArgs;this.trigger("open",s,function(e){if(i.preventArgs=e,!i.preventArgs.cancel&&!i.readonly){var s={name:"FadeIn",duration:100};1e3===i.zIndex?i.popupObject.show(new t.Animation(s),i.element):i.popupObject.show(new t.Animation(s),null),t.addClass([i.inputWrapper.container],["e-icon-anim"]),t.attributes(i.inputElement,{"aria-expanded":"true"}),t.attributes(i.inputElement,{"aria-owns":i.inputElement.id+"_options"}),t.attributes(i.inputElement,{"aria-controls":i.inputElement.id}),t.EventHandler.add(document,"mousedown touchstart",i.documentClickHandler,i)}})},n.prototype.documentClickHandler=function(e){var i=e.target;!t.isNullOrUndefined(this.popupObject)&&(this.inputWrapper.container.contains(i)&&"mousedown"!==e.type||this.popupObject.element&&this.popupObject.element.contains(i))&&"touchstart"!==e.type&&e.preventDefault(),t.closest(i,'[id="'+(this.popupObject&&this.popupObject.element.id+'"]'))||i===this.inputElement||i===this.timeIcon||t.isNullOrUndefined(this.inputWrapper)||i===this.inputWrapper.container||i.classList.contains("e-dlg-overlay")?i!==this.inputElement&&(t.Browser.isDevice||(this.isPreventBlur=document.activeElement===this.inputElement&&(t.Browser.isIE||"edge"===t.Browser.info.name)&&i===this.popupObject.element)):this.isTimePopupOpen()&&(this.hide(e),this.focusOut())},n.prototype.isTimePopupOpen=function(){return!(!this.dateTimeWrapper||!this.dateTimeWrapper.classList.contains(""+Ge))},n.prototype.isDatePopupOpen=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains(""+Ze))},n.prototype.renderPopup=function(){var e=this;this.containerStyle=this.inputWrapper.container.getBoundingClientRect(),t.Browser.isDevice&&(this.timeModal=t.createElement("div"),this.timeModal.className=Ge+" e-time-modal",document.body.className+=" e-time-overflow",this.timeModal.style.display="block",document.body.appendChild(this.timeModal));if(this.popupObject=new i.Popup(this.dateTimeWrapper,{width:this.setPopupWidth(),zIndex:this.zIndex,targetType:"container",collision:t.Browser.isDevice?{X:"fit",Y:"fit"}:{X:"flip",Y:"flip"},relateTo:t.Browser.isDevice?document.body:this.inputWrapper.container,position:t.Browser.isDevice?{X:"center",Y:"center"}:{X:"left",Y:"bottom"},enableRtl:this.enableRtl,offsetY:4,open:function(){e.dateTimeWrapper.style.visibility="visible",t.addClass([e.timeIcon],$e),t.Browser.isDevice||(e.timekeyConfigure=t.extend(e.timekeyConfigure,e.keyConfigs),e.inputEvent=new t.KeyboardEvents(e.inputWrapper.container,{keyAction:e.timeKeyActionHandle.bind(e),keyConfigs:e.timekeyConfigure,eventName:"keydown"}))},close:function(){t.removeClass([e.timeIcon],$e),e.unWireTimeListEvents(),e.inputElement.removeAttribute("aria-activedescendant"),t.remove(e.popupObject.element),e.popupObject.destroy(),e.dateTimeWrapper.innerHTML="",e.listWrapper=e.dateTimeWrapper=void 0,e.inputEvent&&e.inputEvent.destroy()},targetExitViewport:function(){t.Browser.isDevice||e.hide()}}),t.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",t.Browser.isDevice&&this.fullScreenMode){var s=t.createElement("div",{className:"e-datetime-mob-popup-wrap"}),a=this.createElement("div",{className:"e-model-header"}),n=this.createElement("span",{className:"e-model-title"});n.textContent="Select time";var r=this.createElement("span",{className:"e-popup-close"});t.EventHandler.add(r,"mousedown touchstart",this.dateTimeCloseHandler,this);var l=this.dateTimeWrapper.querySelector(".e-content");a.appendChild(r),a.appendChild(n),s.appendChild(a),s.appendChild(l),this.dateTimeWrapper.insertBefore(s,this.dateTimeWrapper.firstElementChild)}},n.prototype.dateTimeCloseHandler=function(e){this.hide()},n.prototype.setDimension=function(e){return e="number"==typeof e?t.formatUnit(e):"string"==typeof e?e:"100%"},n.prototype.setPopupWidth=function(){var e=this.setDimension(this.width);if(e.indexOf("%")>-1){e=(this.containerStyle.width*parseFloat(e)/100).toString()+"px"}return e},n.prototype.wireTimeListEvents=function(){t.EventHandler.add(this.listWrapper,"click",this.onMouseClick,this),t.Browser.isDevice||(t.EventHandler.add(this.listWrapper,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.listWrapper,"mouseout",this.onMouseLeave,this))},n.prototype.unWireTimeListEvents=function(){this.listWrapper&&(t.EventHandler.remove(this.listWrapper,"click",this.onMouseClick),t.EventHandler.remove(document,"mousedown touchstart",this.documentClickHandler),t.Browser.isDevice||(t.EventHandler.add(this.listWrapper,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.listWrapper,"mouseout",this.onMouseLeave,this)))},n.prototype.onMouseOver=function(e){var i=t.closest(e.target,"."+Qe);this.setTimeHover(i,"e-hover")},n.prototype.onMouseLeave=function(){this.removeTimeHover("e-hover")},n.prototype.setTimeHover=function(e,i){this.enabled&&this.isValidLI(e)&&!e.classList.contains(i)&&(this.removeTimeHover(i),t.addClass([e],i))},n.prototype.getPopupHeight=function(){var e=parseInt("250px",10),i=this.dateTimeWrapper.getBoundingClientRect().height;return t.Browser.isDevice&&this.fullScreenMode?i:i>e?e:i},n.prototype.changeEvent=function(e){a.prototype.changeEvent.call(this,e),(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))},n.prototype.updateValue=function(e){this.setInputValue("time"),+this.previousDateTime!=+this.value&&(this.changedArgs={value:this.value,event:e||null,isInteracted:!t.isNullOrUndefined(e),element:this.element},this.addTimeSelection(),this.trigger("change",this.changedArgs),this.previousDateTime=this.previousDate=this.value)},n.prototype.setTimeScrollPosition=function(){var e=this.selectedElement;t.isNullOrUndefined(e)?this.dateTimeWrapper&&this.checkDateValue(this.scrollTo)&&this.setScrollTo():this.findScrollTop(e)},n.prototype.findScrollTop=function(e){var i=this.getPopupHeight(),s=e.nextElementSibling,a=s?s.offsetTop:e.offsetTop,n=e.getBoundingClientRect().height;if(a+e.offsetTop>i)if(t.Browser.isDevice&&this.fullScreenMode){this.dateTimeWrapper.querySelector(".e-content").scrollTop=s?a-(i/2+n/2):a}else this.dateTimeWrapper.scrollTop=s?a-(i/2+n/2):a;else this.dateTimeWrapper.scrollTop=0},n.prototype.setScrollTo=function(){var e,i=this.dateTimeWrapper.querySelectorAll("."+Qe);if(i.length>=0){this.scrollInvoked=!0;var s=this.timeCollections[0],a=this.getDateObject(this.checkDateValue(this.scrollTo)).getTime();e=i[Math.round((a-s)/(6e4*this.step))]}else this.dateTimeWrapper.scrollTop=0;t.isNullOrUndefined(e)?this.dateTimeWrapper.scrollTop=0:this.findScrollTop(e)},n.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]));s.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()},n.prototype.getFullDateTime=function(){var e=null;return e=this.isDateObject(this.valueWithMinutes)?this.combineDateTime(this.valueWithMinutes):this.previousDate,this.validateMinMaxRange(e)},n.prototype.createMask=function(){this.notify("createMask",{module:"MaskedDateTime"})},n.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},n.prototype.onMouseClick=function(e){var i=e.target,s=this.selectedElement=t.closest(i,"."+Qe);s&&s.classList.contains(Qe)&&(this.timeValue=s.getAttribute("data-value"),this.hide(e)),this.setSelection(s,e)},n.prototype.setSelection=function(e,i){if(this.isValidLI(e)&&!e.classList.contains($e)){this.selectedElement=e;var s=Array.prototype.slice.call(this.liCollections).indexOf(e);this.activeIndex=s,this.valueWithMinutes=new Date(this.timeCollections[this.activeIndex]),t.addClass([this.selectedElement],$e),this.selectedElement.setAttribute("aria-selected","true"),this.updateValue(i)}},n.prototype.setTimeActiveClass=function(){var e=t.isNullOrUndefined(this.dateTimeWrapper)?this.listWrapper:this.dateTimeWrapper;if(!t.isNullOrUndefined(e)){var i=e.querySelectorAll("."+Qe);if(i.length)for(var s=0;s<i.length;s++)if(this.timeCollections[s]===+this.valueWithMinutes){i[s].setAttribute("aria-selected","true"),this.selectedElement=i[s],this.activeIndex=s,this.setTimeActiveDescendant();break}}},n.prototype.setTimeActiveDescendant=function(){!t.isNullOrUndefined(this.selectedElement)&&this.value?t.attributes(this.inputElement,{"aria-activedescendant":this.selectedElement.getAttribute("id")}):this.inputElement.removeAttribute("aria-activedescendant")},n.prototype.addTimeSelection=function(){this.selectedElement=null,this.removeTimeSelection(),this.setTimeActiveClass(),t.isNullOrUndefined(this.selectedElement)||(t.addClass([this.selectedElement],$e),this.selectedElement.setAttribute("aria-selected","true"))},n.prototype.removeTimeSelection=function(){if(this.removeTimeHover("e-hover"),!t.isNullOrUndefined(this.dateTimeWrapper)){var e=this.dateTimeWrapper.querySelectorAll("."+$e);e.length&&(t.removeClass(e,$e),e[0].removeAttribute("aria-selected"))}},n.prototype.removeTimeHover=function(e){var i=this.getTimeHoverItem(e);i&&i.length&&t.removeClass(i,e)},n.prototype.getTimeHoverItem=function(e){var i,s=t.isNullOrUndefined(this.dateTimeWrapper)?this.listWrapper:this.dateTimeWrapper;return t.isNullOrUndefined(s)||(i=s.querySelectorAll("."+e)),i},n.prototype.isValidLI=function(e){return e&&e.classList.contains(Qe)&&!e.classList.contains(Je)},n.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)},n.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")},n.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}},n.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")},n.prototype.hide=function(e){var i=this;if(this.popupObj||this.dateTimeWrapper){this.preventArgs={cancel:!1,popup:this.popupObj||this.popupObject,event:e||null};var s=this.preventArgs;t.isNullOrUndefined(this.popupObj)?this.trigger("close",s,function(t){i.dateTimeCloseEventCallback(e,t)}):this.dateTimeCloseEventCallback(e,s)}else t.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit()},n.prototype.dateTimeCloseEventCallback=function(e,i){this.preventArgs=i,this.preventArgs.cancel||(this.isDatePopupOpen()?a.prototype.hide.call(this,e):this.isTimePopupOpen()&&(this.closePopup(e),t.removeClass([document.body],"e-time-overflow"),t.Browser.isDevice&&this.timeModal&&(this.timeModal.style.display="none",this.timeModal.outerHTML="",this.timeModal=null),this.setTimeActiveDescendant())),t.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit()},n.prototype.closePopup=function(e){if(this.isTimePopupOpen()&&this.popupObject){var i={name:"FadeOut",duration:100,delay:0};this.popupObject.hide(new t.Animation(i)),this.inputWrapper.container.classList.remove("e-icon-anim"),t.attributes(this.inputElement,{"aria-expanded":"false"}),this.inputElement.removeAttribute("aria-owns"),this.inputElement.removeAttribute("aria-controls"),t.EventHandler.remove(document,"mousedown touchstart",this.documentClickHandler)}},n.prototype.preRender=function(){this.checkFormat(),this.dateTimeFormat=this.cldrDateTimeFormat(),a.prototype.preRender.call(this),t.removeClass([this.inputElementCopy],[Ge])},n.prototype.getProperty=function(e,t){"min"===t?this.setProperties({min:this.validateValue(e.min)},!0):this.setProperties({max:this.validateValue(e.max)},!0)},n.prototype.checkAttributes=function(e){for(var i,s=0,a=e?t.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(!t.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(t.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":(t.isNullOrUndefined(this.dateTimeOptions)||void 0===this.dateTimeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(n)},!e);break;case"min":(t.isNullOrUndefined(this.dateTimeOptions)||void 0===this.dateTimeOptions.min||e)&&(i=new Date(this.inputElement.getAttribute(n)),this.isNullOrEmpty(i)||isNaN(+i)||this.setProperties({min:i},!e));break;case"disabled":if(t.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":(t.isNullOrUndefined(this.dateTimeOptions)||void 0===this.dateTimeOptions.value||e)&&(i=new Date(this.inputElement.getAttribute(n)),this.isNullOrEmpty(i)||isNaN(+i)||this.setProperties({value:i},!e));break;case"max":(t.isNullOrUndefined(this.dateTimeOptions)||void 0===this.dateTimeOptions.max||e)&&(i=new Date(this.inputElement.getAttribute(n)),this.isNullOrEmpty(i)||isNaN(+i)||this.setProperties({max:i},!e))}}},n.prototype.requiredModules=function(){var e=[];return"Islamic"===this.calendarMode&&e.push({args:[this],member:"islamic",name:"Islamic"}),this.enableMask&&e.push(this.maskedDateModule()),e},n.prototype.maskedDateModule=function(){return{args:[this],member:"MaskedDateTime"}},n.prototype.getTimeActiveElement=function(){return t.isNullOrUndefined(this.dateTimeWrapper)?null:this.dateTimeWrapper.querySelectorAll("."+$e)},n.prototype.createDateObj=function(e){return e instanceof Date?e:null},n.prototype.getDateObject=function(e){if(!this.isNullOrEmpty(e)){var i=this.createDateObj(e),s=this.valueWithMinutes,a=!t.isNullOrUndefined(s);if(this.checkDateValue(i)){var n=a?s.getDate():je,r=a?s.getMonth():Re,l=a?s.getFullYear():Ye,o=a?s.getHours():ze,h=a?s.getMinutes():qe,u=a?s.getSeconds():Ke,d=a?s.getMilliseconds():_e;return this.scrollInvoked?(this.scrollInvoked=!1,new Date(l,r,n,i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds())):new Date(l,r,n,o,h,u,d)}}return null},n.prototype.findNextTimeElement=function(e){var i=this.inputElement.value,s=t.isNullOrUndefined(this.valueWithMinutes)?this.createDateObj(i):this.getDateObject(this.valueWithMinutes),a=null,n=this.liCollections.length;if(!t.isNullOrUndefined(this.activeIndex)||!t.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(t.isNullOrUndefined(a)?null:new Date(a))}},n.prototype.setTimeValue=function(e,i){var a,n,r=this.validateMinMaxRange(i),l=this.createDateObj(r);return this.getFormattedValue(l)!==(t.isNullOrUndefined(this.value)?null:this.getFormattedValue(this.value))?(this.valueWithMinutes=t.isNullOrUndefined(l)?null:l,n=new Date(+this.valueWithMinutes)):(this.strictMode&&(e=l),this.valueWithMinutes=this.checkDateValue(e),n=new Date(+this.valueWithMinutes)),a="Gregorian"===this.calendarMode?this.globalize.formatDate(n,{format:t.isNullOrUndefined(this.formatString)?this.cldrDateTimeFormat():this.formatString,type:"dateTime",skeleton:"yMd"}):this.globalize.formatDate(n,{format:t.isNullOrUndefined(this.formatString)?this.cldrDateTimeFormat():this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"}),!this.strictMode&&t.isNullOrUndefined(n),s.Input.setValue(a,this.inputElement,this.floatLabelType,this.showClearButton),n},n.prototype.timeElementValue=function(e){if(!t.isNullOrUndefined(this.checkDateValue(e))&&!this.isNullOrEmpty(e)){var i=e instanceof Date?e:this.getDateObject(e);return this.setTimeValue(i,e)}return null},n.prototype.timeKeyHandler=function(e){if(!(t.isNullOrUndefined(this.step)||this.step<=0)){var i=this.timeCollections.length;if(t.isNullOrUndefined(this.getTimeActiveElement())||0===this.getTimeActiveElement().length)this.liCollections.length>0&&(t.isNullOrUndefined(this.value)&&t.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=a=this.activeIndex===i?0:this.activeIndex,this.activeIndex=a=this.activeIndex<0?i-1:this.activeIndex,s=t.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=i-1,s=this.timeCollections[i-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()}},n.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),t.addClass([this.inputWrapper.container],Xe),this.isNavigate=!1,e.stopPropagation();break;case"escape":this.hide(e);break;default:this.isNavigate=!1}},n.prototype.inputKeyAction=function(e){switch(e.action){case"altDownArrow":this.strictModeUpdate(),this.updateInput(),this.toggle(e)}},n.prototype.onPropertyChanged=function(e,i){for(var n=0,r=Object.keys(e);n<r.length;n++){var l=r[n];switch(l){case"value":this.isDynamicValueChanged=!0,this.invalidValueString=null,this.checkInvalidValue(e.value),e.value=this.value,e.value=this.validateValue(e.value),this.enableMask?s.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton):s.Input.setValue(this.getFormattedValue(e.value),this.inputElement,this.floatLabelType,this.showClearButton),this.valueWithMinutes=e.value,this.setProperties({value:e.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(e,l),this.updateInput();break;case"enableRtl":s.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]);break;case"cssClass":t.isNullOrUndefined(i.cssClass)||(i.cssClass=i.cssClass.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e.cssClass)||(e.cssClass=e.cssClass.replace(/\s+/g," ").trim()),s.Input.setCssClass(e.cssClass,[this.inputWrapper.container],i.cssClass),this.dateTimeWrapper&&s.Input.setCssClass(e.cssClass,[this.dateTimeWrapper],i.cssClass);break;case"locale":this.globalize=new t.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.dateTimeOptions&&null==this.dateTimeOptions.placeholder&&(this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),s.Input.setPlaceholder(this.l10n.getConstant("placeholder"),this.inputElement)),this.dateTimeFormat=this.cldrDateTimeFormat(),a.prototype.updateInput.call(this);break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.checkAttributes(!0);break;case"format":this.setProperties({format:e.format},!0),this.checkFormat(),this.dateTimeFormat=this.formatString,this.setValue(),this.enableMask&&(this.notify("createMask",{module:"MaskedDateTime"}),this.value||s.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton));break;case"placeholder":s.Input.setPlaceholder(e.placeholder,this.inputElement);break;case"enabled":s.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(e.width),s.Input.calculateWidth(this.inputElement,this.inputWrapper.container),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.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":s.Input.setReadonly(this.readonly,this.inputElement);break;case"floatLabelType":this.floatLabelType=e.floatLabelType,s.Input.removeFloating(this.inputWrapper),s.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.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(e.scrollTo)))?(this.dateTimeWrapper&&this.setScrollTo(),this.setProperties({scrollTo:this.checkDateValue(new Date(this.checkValue(e.scrollTo)))},!0)):this.setProperties({scrollTo:null},!0);break;case"enableMask":this.enableMask?(this.notify("createMask",{module:"MaskedDateTime"}),s.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton)):this.inputElement.value===this.maskedDateValue&&(this.maskedDateValue="",s.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton));break;default:a.prototype.onPropertyChanged.call(this,e,i)}this.isDynamicValueChanged||this.hide(null),this.isDynamicValueChanged=!1}},n.prototype.getModuleName=function(){return"datetimepicker"},n.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=t.isNullOrUndefined(this.inputValueCopy)?"":this.getFormattedValue(this.inputValueCopy)},Be([t.Property(null)],n.prototype,"timeFormat",void 0),Be([t.Property(30)],n.prototype,"step",void 0),Be([t.Property(null)],n.prototype,"scrollTo",void 0),Be([t.Property(1e3)],n.prototype,"zIndex",void 0),Be([t.Property(null)],n.prototype,"value",void 0),Be([t.Property(null)],n.prototype,"keyConfigs",void 0),Be([t.Property({})],n.prototype,"htmlAttributes",void 0),Be([t.Property(!1)],n.prototype,"enablePersistence",void 0),Be([t.Property(!0)],n.prototype,"allowEdit",void 0),Be([t.Property(!1)],n.prototype,"isMultiSelection",void 0),Be([t.Property(null)],n.prototype,"values",void 0),Be([t.Property(!0)],n.prototype,"showClearButton",void 0),Be([t.Property(null)],n.prototype,"placeholder",void 0),Be([t.Property(!1)],n.prototype,"strictMode",void 0),Be([t.Property(!1)],n.prototype,"fullScreenMode",void 0),Be([t.Property(null)],n.prototype,"serverTimezoneOffset",void 0),Be([t.Property(new Date(1900,0,1))],n.prototype,"min",void 0),Be([t.Property(new Date(2099,11,31))],n.prototype,"max",void 0),Be([t.Property(null)],n.prototype,"firstDayOfWeek",void 0),Be([t.Property("Gregorian")],n.prototype,"calendarMode",void 0),Be([t.Property("Month")],n.prototype,"start",void 0),Be([t.Property("Month")],n.prototype,"depth",void 0),Be([t.Property(!1)],n.prototype,"weekNumber",void 0),Be([t.Property(!0)],n.prototype,"showTodayButton",void 0),Be([t.Property("Short")],n.prototype,"dayHeaderFormat",void 0),Be([t.Property(!1)],n.prototype,"openOnFocus",void 0),Be([t.Property(!1)],n.prototype,"enableMask",void 0),Be([t.Property({day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"})],n.prototype,"maskPlaceholder",void 0),Be([t.Event()],n.prototype,"open",void 0),Be([t.Event()],n.prototype,"close",void 0),Be([t.Event()],n.prototype,"cleared",void 0),Be([t.Event()],n.prototype,"blur",void 0),Be([t.Event()],n.prototype,"focus",void 0),Be([t.Event()],n.prototype,"created",void 0),Be([t.Event()],n.prototype,"destroyed",void 0),n=Be([t.NotifyPropertyChanges],n)}(j),tt="shiftTab",it=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 t.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||"ArrowLeft"!==e.e.key&&"ArrowRight"!==e.e.key&&e.e.key!==tt&&"Tab"!==e.e.key&&e.e.action!==tt&&"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||e.e.action===tt)){var a=e.e.action===tt?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||e.e.action===tt||"End"===e.e.key)}if(!(e.e.altKey||e.e.ctrlKey||"ArrowUp"!==e.e.key&&"ArrowDown"!==e.e.key)){t=this.parent.inputElement.selectionStart;var 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()}}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(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 i=this.parent.locale;return"en"===i||"en-US"===i?t.getValue(e,t.getDefaultDateObject()):t.getValue("main."+i+".dates.calendars.gregorian."+e,t.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}();e.CalendarBase=k,e.Calendar=M,e.Islamic=T,e.DatePicker=j,e.Presets=Ce,e.DateRangePicker=ke,e.TimeMaskPlaceholder=We,e.TimePicker=Le,e.DateTimePicker=et,e.MaskedDateTime=it,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-lists")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-popups","@syncfusion/ej2-inputs","@syncfusion/ej2-buttons","@syncfusion/ej2-lists"],t):t(e.ej={},e.ej2Base,e.ej2Popups,e.ej2Inputs,e.ej2Buttons,e.ej2Lists)}(this,function(e,t,i,s,a,n){"use strict";var r=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)}}(),l=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},o="e-other-month",h="e-other-year",u="e-calendar",d="e-calendar-content-table",p="e-year",c="e-month",m="e-disabled",f="e-overlay",v="e-week-number",y="e-selected",g="e-focused-date",b="e-focused-cell",D="e-month-hide",E="e-zoomin",C="e-calendar-day-header-lg",k=function(e){function i(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 r(i,e),i.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 t.Internationalization(this.locale),(t.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(u),this.enableRtl&&this.element.classList.add("e-rtl"),t.Browser.isDevice&&this.element.classList.add("e-device"),t.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(u),this.enableRtl&&this.calendarElement.classList.add("e-rtl"),t.Browser.isDevice&&this.calendarElement.classList.add("e-device"),t.attributes(this.calendarElement,{"data-role":"calendar"})),!t.isNullOrUndefined(t.closest(this.element,"fieldset"))&&t.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.createHeader(),this.createContent(),this.wireEvents()},i.prototype.rangeValidation=function(e,i){t.isNullOrUndefined(e)&&this.setProperties({min:new Date(1900,0,1)},!0),t.isNullOrUndefined(i)&&this.setProperties({max:new Date(2099,11,31)},!0)},i.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},i.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)),!t.isNullOrUndefined(e)&&this.min<=this.max&&e>=this.min&&e<=this.max&&(this.currentDate=new Date(this.checkValue(e)))},i.prototype.setOverlayIndex=function(e,i,s,a){if(a&&!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(s)&&!t.isNullOrUndefined(e)){var n=parseInt(i.style.zIndex,10)?parseInt(i.style.zIndex,10):1e3;s.style.zIndex=(n-1).toString(),e.style.zIndex=n.toString()}},i.prototype.minMaxUpdate=function(e){+this.min<=+this.max?t.removeClass([this.element],f):(this.setProperties({min:this.min},!0),t.addClass([this.element],f)),this.min=t.isNullOrUndefined(this.min)||!+this.min?this.min=new Date(1900,0,1):this.min,this.max=t.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)))},i.prototype.createHeader=function(){var e={tabindex:"0"};this.headerElement=this.createElement("div",{className:"e-header"});var i=this.createElement("div",{className:"e-icon-container"});this.previousIcon=this.createElement("button",{className:"e-prev",attrs:{type:"button"}}),t.rippleEffect(this.previousIcon,{duration:400,selector:".e-prev",isCenterRipple:!0}),t.attributes(this.previousIcon,{"aria-disabled":"false","aria-label":"previous month"}),t.attributes(this.previousIcon,e),this.nextIcon=this.createElement("button",{className:"e-next",attrs:{type:"button"}}),t.rippleEffect(this.nextIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),"daterangepicker"===this.getModuleName()&&(t.attributes(this.previousIcon,{tabIndex:"-1"}),t.attributes(this.nextIcon,{tabIndex:"-1"})),t.attributes(this.nextIcon,{"aria-disabled":"false","aria-label":"next month"}),t.attributes(this.nextIcon,e),this.headerTitleElement=this.createElement("div",{className:"e-day e-title"}),t.attributes(this.headerTitleElement,{"aria-atomic":"true","aria-live":"assertive","aria-label":"title"}),t.attributes(this.headerTitleElement,e),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"})),i.appendChild(this.previousIcon),i.appendChild(this.nextIcon),this.headerElement.appendChild(i),"calendar"===this.getModuleName()?this.element.appendChild(this.headerElement):this.calendarElement.appendChild(this.headerElement),this.adjustLongHeaderSize()},i.prototype.createContent=function(){this.contentElement=this.createElement("div",{className:"e-content"}),this.table=this.createElement("table",{attrs:{class:d,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()&&(t.EventHandler.add(this.table,"focus",this.addContentFocus,this),t.EventHandler.add(this.table,"blur",this.removeContentFocus,this))},i.prototype.addContentFocus=function(e){var i=this.tableBodyElement.querySelector("tr td.e-focused-date"),s=this.tableBodyElement.querySelector("tr td.e-selected");t.isNullOrUndefined(s)?t.isNullOrUndefined(i)||i.classList.add(b):s.classList.add(b)},i.prototype.removeContentFocus=function(e){var i=t.isNullOrUndefined(this.tableBodyElement)?null:this.tableBodyElement.querySelector("tr td.e-focused-date"),s=t.isNullOrUndefined(this.tableBodyElement)?null:this.tableBodyElement.querySelector("tr td.e-selected");t.isNullOrUndefined(s)?t.isNullOrUndefined(i)||i.classList.remove(b):s.classList.remove(b)},i.prototype.getCultureValues=function(){var e,i=[],s="days.stand-alone."+this.dayHeaderFormat.toLowerCase();if(e="en"===this.locale||"en-US"===this.locale?t.getValue(s,t.getDefaultDateObject()):this.getCultureObjects(t.cldrData,""+this.locale),!t.isNullOrUndefined(e))for(var a=0,n=Object.keys(e);a<n.length;a++){var r=n[a];i.push(t.getValue(r,e))}return i},i.prototype.toCapitalize=function(e){return!t.isNullOrUndefined(e)&&e.length?e[0].toUpperCase()+e.slice(1):e},i.prototype.createContentHeader=function(){"calendar"===this.getModuleName()?t.isNullOrUndefined(this.element.querySelectorAll(".e-content .e-week-header")[0])||t.detach(this.element.querySelectorAll(".e-content .e-week-header")[0]):t.isNullOrUndefined(this.calendarElement.querySelectorAll(".e-content .e-week-header")[0])||t.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()?t.addClass([this.element],""+v):t.addClass([this.calendarElement],""+v));var i=this.getCultureValues().length>0&&this.getCultureValues()?this.shiftArray(this.getCultureValues().length>0&&this.getCultureValues(),this.firstDayOfWeek):null;if(!t.isNullOrUndefined(i))for(var s=0;s<=6;s++)e+='<th class="">'+this.toCapitalize(i[s])+"</th>";e="<tr>"+e+"</tr>",this.tableHeadElement.innerHTML=e,this.table.appendChild(this.tableHeadElement)},i.prototype.createContentBody=function(){switch("calendar"===this.getModuleName()?t.isNullOrUndefined(this.element.querySelectorAll(".e-content tbody")[0])||t.detach(this.element.querySelectorAll(".e-content tbody")[0]):t.isNullOrUndefined(this.calendarElement.querySelectorAll(".e-content tbody")[0])||t.detach(this.calendarElement.querySelectorAll(".e-content tbody")[0]),this.start){case"Year":this.renderYears();break;case"Decade":this.renderDecades();break;default:this.renderMonths()}},i.prototype.updateFooter=function(){this.todayElement.textContent=this.l10.getConstant("today"),this.todayElement.setAttribute("aria-label",this.l10.getConstant("today")),this.todayElement.setAttribute("tabindex","0")},i.prototype.createContentFooter=function(){if(this.showTodayButton){var e=new Date(+this.min),i=new Date(+this.max);this.globalize=new t.Internationalization(this.locale),this.l10=new t.L10n(this.getModuleName(),{today:"Today"},this.locale),this.todayElement=this.createElement("button",{attrs:{role:"button"}}),t.rippleEffect(this.todayElement),this.updateFooter(),t.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(i.setHours(0,0,0,0))&&!this.todayDisabled||t.addClass([this.todayElement],m),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(m)||t.EventHandler.add(this.todayElement,"click",this.todayButtonClick,this)}},i.prototype.wireEvents=function(e,i,s,a){t.EventHandler.add(this.headerTitleElement,"click",this.navigateTitle,this),this.defaultKeyConfigs=t.extend(this.defaultKeyConfigs,this.keyConfigs),"calendar"===this.getModuleName()?this.keyboardModule=new t.KeyboardEvents(this.element,{eventName:"keydown",keyAction:this.keyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs}):this.keyboardModule=new t.KeyboardEvents(this.calendarElement,{eventName:"keydown",keyAction:this.keyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})},i.prototype.dateWireEvents=function(e,i,s,a){this.defaultKeyConfigs=this.getDefaultKeyConfig(),this.defaultKeyConfigs=t.extend(this.defaultKeyConfigs,s),this.serverModuleName=a},i.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))},i.prototype.resetCalendar=function(){this.calendarElement&&t.detach(this.calendarElement),this.tableBodyElement&&t.detach(this.tableBodyElement),this.table&&t.detach(this.table),this.tableHeadElement&&t.detach(this.tableHeadElement),this.nextIcon&&t.detach(this.nextIcon),this.previousIcon&&t.detach(this.previousIcon),this.footer&&t.detach(this.footer),this.todayElement=null,this.renderDayCellArgs=null,this.calendarElement=this.tableBodyElement=this.footer=this.tableHeadElement=this.nextIcon=this.previousIcon=this.table=null},i.prototype.keyActionHandle=function(e,i,s){var a,n=this.tableBodyElement.querySelector("tr td.e-focused-date");a=s?t.isNullOrUndefined(n)||+i!==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()&&!t.isNullOrUndefined(e.target)&&e.target.classList.length>0&&e.target.classList.contains(d)&&(this.keyboardNavigate(-1,r,e,this.max,this.min),e.preventDefault());break;case"moveRight":"daterangepicker"!=this.getModuleName()&&!t.isNullOrUndefined(e.target)&&e.target.classList.length>0&&e.target.classList.contains(d)&&(this.keyboardNavigate(1,r,e,this.max,this.min),e.preventDefault());break;case"moveUp":"daterangepicker"!=this.getModuleName()&&!t.isNullOrUndefined(e.target)&&e.target.classList.length>0&&e.target.classList.contains(d)&&(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()&&!t.isNullOrUndefined(e.target)&&e.target.classList.length>0&&e.target.classList.contains(d)&&(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)this.navigatePrevious(e);else if(e.target===this.nextIcon)this.navigateNext(e);else if(e.target===this.todayElement)this.todayButtonClick(e,i),"datepicker"!==this.getModuleName()&&"datetimepicker"!==this.getModuleName()||this.element.focus();else{var h=t.isNullOrUndefined(n)?a:n;if(!t.isNullOrUndefined(h)&&!h.classList.contains(m)){if(o){var u=new Date(parseInt(""+h.id,0));this.selectDate(e,u,h)}else this.contentClick(null,--r,h,i);"datepicker"!==this.getModuleName()&&"datetimepicker"!==this.getModuleName()||this.element.focus()}}break;case"controlUp":this.title(),e.preventDefault();break;case"controlDown":(t.isNullOrUndefined(n)||o)&&(t.isNullOrUndefined(a)||o)||this.contentClick(null,--r,n||a,i),e.preventDefault();break;case"home":this.currentDate=this.firstDay(this.currentDate),t.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),t.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.element.focus(),this.hide());break;case"shiftTab":"datepicker"!==this.getModuleName()&&"datetimepicker"!==this.getModuleName()||e.target!==this.headerTitleElement||(e.preventDefault(),this.element.focus(),this.hide())}},i.prototype.keyboardNavigate=function(e,i,s,a,n){var r=new Date(this.checkValue(this.currentDate));switch(i){case 2:this.addYears(this.currentDate,e),this.isMonthYearRange(this.currentDate)?(t.detach(this.tableBodyElement),this.renderDecades(s)):this.currentDate=r;break;case 1:this.addMonths(this.currentDate,e),this.calendarMode,this.isMonthYearRange(this.currentDate)?(t.detach(this.tableBodyElement),this.renderYears(s)):this.currentDate=r;break;case 0:this.addDay(this.currentDate,e,s,a,n),this.isMinMaxRange(this.currentDate)?(t.detach(this.tableBodyElement),this.renderMonths(s)):this.currentDate=r}},i.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)}},i.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},i.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,c,e,t):this.islamicModule.islamicRenderTemplate(s,a,c,e,t)},i.prototype.renderDays=function(e,i,s,a,n,r){var l,h=[],u=n?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 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(d.getFullYear(),d.getMonth(),d.getDate()+E);D.textContent=""+this.getWeek(C),b.appendChild(D),t.addClass([b],""+v),h.push(b)}l=new Date(+d),d=this.minMaxDate(d);var k={type:"dateTime",skeleton:"full"},M=this.globalize.parseDate(this.globalize.formatDate(d,k),k),w=this.dayCell(d),V=this.globalize.formatDate(d,{type:"date",skeleton:"full"}),N=this.createElement("span");N.textContent=this.globalize.formatDate(d,{format:"d",type:"date",skeleton:"yMd"});var O=this.min>d||this.max<d;O?(t.addClass([w],m),t.addClass([w],f)):N.setAttribute("title",""+V),p!==d.getMonth()&&(t.addClass([w],o),N.setAttribute("aria-disabled","true")),0!==d.getDay()&&6!==d.getDay()||t.addClass([w],"e-weekend"),w.appendChild(N),this.renderDayCellArgs={date:d,isDisabled:!1,element:w,isOutOfRange:O};var I=this.renderDayCellArgs;if(this.renderDayCellEvent(I),I.isDisabled){var T=new Date(this.checkValue(i)),x=new Date(this.checkValue(I.date));if(s){if(!t.isNullOrUndefined(a)&&a.length>0)for(var S=0;S<a.length;S++){+new Date(this.globalize.formatDate(I.date,{type:"date",skeleton:"yMd"}))===+new Date(this.globalize.formatDate(a[S],{type:"date",skeleton:"yMd"}))&&(a.splice(S,1),S=-1)}}else T&&+T==+x&&this.setProperties({value:null},!0)}this.renderDayCellArgs.isDisabled&&!w.classList.contains(y)&&(t.addClass([w],m),t.addClass([w],f),N.setAttribute("aria-disabled","true"),+this.renderDayCellArgs.date==+this.todayDate&&(this.todayDisabled=!0));var P=w.classList.contains(o),A=w.classList.contains(m);A||t.EventHandler.add(w,"click",this.clickHandler,this);var U=void 0;if(t.isNullOrUndefined(r)||"click"!==r.type||(U=r.currentTarget),!s||t.isNullOrUndefined(a)||A)!A&&this.getDateVal(d,i)&&t.addClass([w],y);else{for(var H=0;H<a.length;H++){var W={format:null,type:"date",skeleton:"short",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"};if((this.globalize.formatDate(d,W)===this.globalize.formatDate(a[H],W)&&this.getDateVal(d,a[H])||this.getDateVal(d,i))&&t.addClass([w],y),!t.isNullOrUndefined(U)&&U.innerText===w.innerText&&this.previousDates&&w.classList.contains(y)&&U.classList.contains(y)){t.removeClass([w],y),this.previousDates=!1;for(var L=this.copyValues(a),F=0;F<L.length;F++){var B={format:null,type:"date",skeleton:"short",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"};if(this.globalize.formatDate(M,B)===this.globalize.formatDate(L[F],B)){S=L.indexOf(L[F]);L.splice(S,1),a.splice(S,1)}}this.setProperties({values:L},!0)}else this.updateFocus(P,A,d,w,e)}a.length<=0&&this.updateFocus(P,A,d,w,e)}this.updateFocus(P,A,d,w,e),t.isNullOrUndefined(M)||M.getFullYear()!==u.getFullYear()||M.getMonth()!==u.getMonth()||M.getDate()!==u.getDate()||t.addClass([w],"e-today"),h.push(this.renderDayCellArgs.element),d=new Date(+l),this.addDay(d,1,null,this.max,this.min)}return h},i.prototype.updateFocus=function(e,i,s,a,n){n.getDate()!==s.getDate()||e||i?(n>=this.max&&parseInt(a.id,0)===+this.max&&!e&&!i&&t.addClass([a],g),n<=this.min&&parseInt(a.id,0)===+this.min&&!e&&!i&&t.addClass([a],g)):t.addClass([a],g)},i.prototype.renderYears=function(e,i){this.removeTableHeadElement();var s=[],a=t.isNullOrUndefined(i),n=new Date(this.checkValue(this.currentDate)),r=n.getMonth(),l=n.getFullYear(),o=n,h=o.getFullYear(),u=new Date(this.checkValue(this.min)).getFullYear(),d=new Date(this.checkValue(this.min)).getMonth(),c=new Date(this.checkValue(this.max)).getFullYear(),f=new Date(this.checkValue(this.max)).getMonth();o.setMonth(0),this.titleUpdate(this.currentDate,"months"),o.setDate(1);for(var v=0;v<12;++v){var b=this.dayCell(o),D=this.createElement("span"),E=i&&i.getMonth()===o.getMonth(),C=i&&i.getFullYear()===l&&E,k=this.globalize.formatDate(o,{type:"date",format:"MMM y"});D.textContent=this.toCapitalize(this.globalize.formatDate(o,{format:null,type:"dateTime",skeleton:"MMM"})),this.min&&(h<u||v<d&&h===u)||this.max&&(h>c||v>f&&h>=c)?t.addClass([b],m):!a&&C?t.addClass([b],y):o.getMonth()===r&&this.currentDate.getMonth()===r&&t.addClass([b],g),o.setDate(1),o.setMonth(o.getMonth()+1),b.classList.contains(m)||(t.EventHandler.add(b,"click",this.clickHandler,this),D.setAttribute("title",""+k)),b.appendChild(D),s.push(b)}this.renderTemplate(s,4,p,e,i)},i.prototype.renderDecades=function(e,i){this.removeTableHeadElement();var s=[],a=new Date(this.checkValue(this.currentDate));a.setMonth(0),a.setDate(1);var n=a.getFullYear(),r=new Date(a.setFullYear(n-n%10)),l=new Date(a.setFullYear(n-n%10+9)),o=r.getFullYear(),u=l.getFullYear(),d=this.globalize.formatDate(r,{format:null,type:"dateTime",skeleton:"y"}),p=this.globalize.formatDate(l,{format:null,type:"dateTime",skeleton:"y"});this.headerTitleElement.textContent=d+" - "+p;for(var c=new Date(n-n%10-1,0,1).getFullYear(),f=0;f<12;++f){var v=c+f;a.setFullYear(v);var b=this.dayCell(a),D=this.createElement("span");D.textContent=this.globalize.formatDate(a,{format:null,type:"dateTime",skeleton:"y"}),v<o||v>u?(t.addClass([b],h),D.setAttribute("aria-disabled","true"),t.isNullOrUndefined(i)||a.getFullYear()!==i.getFullYear()||t.addClass([b],y),(v<new Date(this.checkValue(this.min)).getFullYear()||v>new Date(this.checkValue(this.max)).getFullYear())&&t.addClass([b],m)):v<new Date(this.checkValue(this.min)).getFullYear()||v>new Date(this.checkValue(this.max)).getFullYear()?t.addClass([b],m):t.isNullOrUndefined(i)||a.getFullYear()!==i.getFullYear()?a.getFullYear()!==this.currentDate.getFullYear()||b.classList.contains(m)||t.addClass([b],g):t.addClass([b],y),b.classList.contains(m)||(t.EventHandler.add(b,"click",this.clickHandler,this),D.setAttribute("title",""+D.textContent)),b.appendChild(D),s.push(b)}this.renderTemplate(s,4,"e-decade",e,i)},i.prototype.dayCell=function(e){var i,s={skeleton:"full",type:"dateTime",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"},a=this.globalize.parseDate(this.globalize.formatDate(e,s),s);t.isNullOrUndefined(a)||(i=a.valueOf());var n={className:"e-cell",attrs:{id:""+t.getUniqueID(""+i),"aria-selected":"false"}};return this.createElement("td",n)},i.prototype.firstDay=function(e){var t="Decade"!==this.currentView()?this.tableBodyElement.querySelectorAll("td:not(."+o):this.tableBodyElement.querySelectorAll("td:not(."+h);if(t.length)for(var i=0;i<t.length;i++)if(!t[i].classList.contains(m)){e=new Date(parseInt(t[i].id,0));break}return e},i.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))},i.prototype.checkDateValue=function(e){return!t.isNullOrUndefined(e)&&e instanceof Date&&!isNaN(+e)?e:null},i.prototype.findLastDay=function(e){var t="Decade"===this.currentView()?this.tableBodyElement.querySelectorAll("td:not(."+h):this.tableBodyElement.querySelectorAll("td:not(."+o);if(t.length)for(var i=t.length-1;i>=0;i--)if(!t[i].classList.contains(m)){e=new Date(parseInt(t[i].id,0));break}return e},i.prototype.removeTableHeadElement=function(){"calendar"===this.getModuleName()?t.isNullOrUndefined(this.element.querySelectorAll(".e-content table thead")[0])||t.detach(this.tableHeadElement):t.isNullOrUndefined(this.calendarElement.querySelectorAll(".e-content table thead")[0])||t.detach(this.tableHeadElement)},i.prototype.renderTemplate=function(e,i,s,a,n){var r,l=this.getViewNumber(this.currentView());this.tableBodyElement=this.createElement("tbody"),this.table.appendChild(this.tableBodyElement),t.removeClass([this.contentElement,this.headerElement],[c,"e-decade",p]),t.addClass([this.contentElement,this.headerElement],[s]);for(var h=i,u=0,d=0;d<e.length/i;++d){for(r=this.createElement("tr"),u=0+u;u<h;u++)e[u].classList.contains("e-week-number")||t.isNullOrUndefined(e[u].children[0])||(t.addClass([e[u].children[0]],["e-day"]),t.rippleEffect(e[u].children[0],{duration:600,isCenterRipple:!0})),r.appendChild(e[u]),this.weekNumber&&7===u&&e[7].classList.contains(o)&&t.addClass([r],D),!this.weekNumber&&6===u&&e[6].classList.contains(o)&&t.addClass([r],D),this.weekNumber?41===u&&e[41].classList.contains(o)&&t.addClass([r],D):35===u&&e[35].classList.contains(o)&&t.addClass([r],D);h+=i,u+=0,this.tableBodyElement.appendChild(r)}this.table.querySelector("tbody").className=this.effect,"Gregorian"===this.calendarMode?this.iconHandler():this.islamicModule.islamicIconHandler(),(l!==this.getViewNumber(this.currentView())||0===l&&l!==this.getViewNumber(this.currentView()))&&this.navigateHandler(a),this.setAriaActiveDescendant()},i.prototype.clickHandler=function(e,t){this.clickEventEmitter(e);var i=e.currentTarget,s=this.getViewNumber(this.currentView());i.classList.contains(o)?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(o)||0!==s?this.contentClick(e,0,i,t):this.selectDate(e,this.getIdValue(e,null),null),"calendar"===this.getModuleName()&&this.table.focus()},i.prototype.clickEventEmitter=function(e){e.preventDefault()},i.prototype.contentClick=function(e,i,s,a){var n=this.getViewNumber(this.currentView()),r=this.getIdValue(e,s);switch(i){case 0:n===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth)?(t.detach(this.tableBodyElement),this.currentDate=r,this.effect=E,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=E,t.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=E,t.detach(this.tableBodyElement),this.renderYears(e)}}},i.prototype.switchView=function(e,i,s,a){switch(e){case 0:t.detach(this.tableBodyElement),this.renderMonths(i,null,a);break;case 1:t.detach(this.tableBodyElement),this.renderYears(i);break;case 2:t.detach(this.tableBodyElement),this.renderDecades(i)}},i.prototype.getModuleName=function(){return"calendar"},i.prototype.requiredModules=function(){var e=[];return"Islamic"===this.calendarMode&&e.push({args:[this],member:"islamic",name:"Islamic"}),e},i.prototype.getPersistData=function(){return this.addOnPersist(["value"])},i.prototype.onPropertyChanged=function(e,i,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.createContentHeader():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&&t.detach(this.tableBodyElement),this.minMaxUpdate(),s&&this.validateValues(s,a),"datepicker"!==this.getModuleName()?this.createContentBody():this.calendarElement&&this.createContentBody(),(this.todayDate<this.min||this.max<this.todayDate)&&this.footer&&this.todayElement?(t.detach(this.todayElement),t.detach(this.footer),this.todayElement=this.footer=null,this.createContentFooter()):this.footer&&this.todayElement&&this.todayElement.classList.contains("e-disabled")&&(t.removeClass([this.todayElement],m),t.detach(this.todayElement),t.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 t.Internationalization(this.locale),"datepicker"!==this.getModuleName()?(this.createContentHeader(),this.createContentBody()):this.calendarElement&&(this.createContentHeader(),this.createContentBody()),"calendar"===this.getModuleName()){this.l10=new t.L10n(this.getModuleName(),{today:"Today"},this.locale)}this.l10.setLocale(this.locale),this.showTodayButton&&this.updateFooter();break;case"showTodayButton":e.showTodayButton?this.createContentFooter():t.isNullOrUndefined(this.todayElement)||t.isNullOrUndefined(this.footer)||(t.detach(this.todayElement),t.detach(this.footer),this.todayElement=this.footer=void 0),this.setProperties({showTodayButton:e.showTodayButton},!0)}}},i.prototype.validateValues=function(e,i){if(e&&!t.isNullOrUndefined(i)&&i.length>0){for(var s=this.copyValues(i),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)}},i.prototype.setValueUpdate=function(){t.isNullOrUndefined(this.tableBodyElement)||(t.detach(this.tableBodyElement),this.setProperties({start:this.currentView()},!0),this.createContentBody())},i.prototype.copyValues=function(e){var i=[];if(!t.isNullOrUndefined(e)&&e.length>0)for(var s=0;s<e.length;s++)i.push(new Date(+e[s]));return i},i.prototype.titleUpdate=function(e,i){var s,a,n=new t.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})),i){case"days":this.headerTitleElement.textContent=this.toCapitalize(s);break;case"months":this.headerTitleElement.textContent=a}},i.prototype.setActiveDescendant=function(){var e,i,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 i="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)&&(t.isNullOrUndefined(a)||a.setAttribute("aria-selected","true"),(s||a).setAttribute("aria-label",i),e=(s||a).getAttribute("id")),e},i.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)}},i.prototype.destroy=function(){"calendar"===this.getModuleName()&&this.element?t.removeClass([this.element],[u]):this.calendarElement&&this.element&&t.removeClass([this.element],[u]),"calendar"===this.getModuleName()&&this.element&&(t.isNullOrUndefined(this.headerTitleElement)||t.EventHandler.remove(this.headerTitleElement,"click",this.navigateTitle),this.todayElement&&t.EventHandler.remove(this.todayElement,"click",this.todayButtonClick),this.previousIconHandler(!0),this.nextIconHandler(!0),this.keyboardModule.destroy(),this.element.removeAttribute("data-role"),t.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)},i.prototype.title=function(e){var t=this.getViewNumber(this.currentView());this.effect=E,this.switchView(++t,e)},i.prototype.getViewNumber=function(e){return"Month"===e?0:"Year"===e?1:2},i.prototype.navigateTitle=function(e){e.preventDefault(),this.title(e),"calendar"===this.getModuleName()&&this.table.focus()},i.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)}},i.prototype.navigatePrevious=function(e){!t.Browser.isDevice&&e.preventDefault(),"Gregorian"===this.calendarMode?this.previous():this.islamicModule.islamicPrevious(),this.triggerNavigate(e),"calendar"===this.getModuleName()&&this.table.focus()},i.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)}},i.prototype.navigateNext=function(e){!t.Browser.isDevice&&e.preventDefault(),"Gregorian"===this.calendarMode?this.next():this.islamicModule.islamicNext(),this.triggerNavigate(e),"calendar"===this.getModuleName()&&this.table.focus()},i.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)},i.prototype.currentView=function(){return!t.isNullOrUndefined(this.contentElement)&&this.contentElement.classList.contains(p)?"Year":!t.isNullOrUndefined(this.contentElement)&&this.contentElement.classList.contains("e-decade")?"Decade":"Month"},i.prototype.getDateVal=function(e,i){return!t.isNullOrUndefined(i)&&e.getDate()===i.getDate()&&e.getMonth()===i.getMonth()&&e.getFullYear()===i.getFullYear()},i.prototype.getCultureObjects=function(e,i){var s=".dates.calendars.gregorian.days.format."+this.dayHeaderFormat.toLowerCase(),a=".dates.calendars.islamic.days.format."+this.dayHeaderFormat.toLowerCase();return"Gregorian"===this.calendarMode?t.getValue("main."+this.locale+s,e):t.getValue("main."+this.locale+a,e)},i.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)},i.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)},i.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)}},i.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)}},i.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)},i.prototype.adjustLongHeaderSize=function(){t.removeClass([this.element],C),"Wide"===this.dayHeaderFormat&&t.addClass(["calendar"===this.getModuleName()?this.element:this.calendarElement],C)},i.prototype.selectDate=function(e,i,s,a,n){var r=s||e.currentTarget;if(this.isDateSelected=!1,"Decade"===this.currentView())this.setDateDecade(this.currentDate,i.getFullYear());else if("Year"===this.currentView())this.setDateYear(this.currentDate,i);else{if(a&&!this.checkPresentDate(i,n)){var l=this.copyValues(n);!t.isNullOrUndefined(n)&&l.length>0?(l.push(new Date(this.checkValue(i))),this.setProperties({values:l},!0),this.setProperties({value:n[n.length-1]},!0)):this.setProperties({values:[new Date(this.checkValue(i))]},!0)}else this.setProperties({value:new Date(this.checkValue(i))},!0);this.currentDate=new Date(this.checkValue(i))}var o=t.closest(r,"."+u);if(t.isNullOrUndefined(o)&&(o=this.tableBodyElement),a||t.isNullOrUndefined(o.querySelector("."+y))||t.removeClass([o.querySelector("."+y)],y),a||t.isNullOrUndefined(o.querySelector("."+g))||t.removeClass([o.querySelector("."+g)],g),a||t.isNullOrUndefined(o.querySelector("."+b))||t.removeClass([o.querySelector("."+b)],b),a){l=this.copyValues(n);for(var h=Array.prototype.slice.call(this.tableBodyElement.querySelectorAll("td")),d=0;d<h.length;d++){var p=o.querySelectorAll("td."+g)[0],c=o.querySelectorAll("td."+y)[0];h[d]===p&&t.removeClass([h[d]],g),h[d]!==c||this.checkPresentDate(new Date(parseInt(c.getAttribute("id").split("_")[0],10)),n)||t.removeClass([h[d]],y)}if(r.classList.contains(y)){t.removeClass([r],y);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(i,f)===this.globalize.formatDate(l[m],f)){d=l.indexOf(l[m]);l.splice(d,1),t.addClass([r],g)}}this.setProperties({values:l},!0)}else t.addClass([r],y)}else t.addClass([r],y);this.isDateSelected=!0},i.prototype.checkPresentDate=function(e,i){var s=!1;if(!t.isNullOrUndefined(i))for(var a=0;a<i.length;a++){var n="Gregorian"===this.calendarMode?"gregorian":"islamic";this.globalize.formatDate(e,{format:null,type:"date",skeleton:"short",calendar:n})===this.globalize.formatDate(i[a],{format:null,type:"date",skeleton:"short",calendar:n})&&(s=!0)}return s},i.prototype.setAriaActiveDescendant=function(){t.attributes(this.table,{"aria-activedescendant":""+this.setActiveDescendant()})},i.prototype.previousIconHandler=function(e){e?t.isNullOrUndefined(this.previousIcon)||(t.EventHandler.remove(this.previousIcon,"click",this.navigatePreviousHandler),t.addClass([this.previousIcon],""+m),t.addClass([this.previousIcon],""+f),this.previousIcon.setAttribute("aria-disabled","true")):(t.EventHandler.add(this.previousIcon,"click",this.navigatePreviousHandler),t.removeClass([this.previousIcon],""+m),t.removeClass([this.previousIcon],""+f),this.previousIcon.setAttribute("aria-disabled","false"))},i.prototype.renderDayCellEvent=function(e){t.extend(this.renderDayCellArgs,{name:"renderDayCell"}),this.trigger("renderDayCell",e)},i.prototype.navigatedEvent=function(e){t.extend(this.navigatedArgs,{name:"navigated",event:e}),this.trigger("navigated",this.navigatedArgs)},i.prototype.triggerNavigate=function(e){this.navigatedArgs={view:this.currentView(),date:this.currentDate},this.navigatedEvent(e)},i.prototype.nextIconHandler=function(e){e?t.isNullOrUndefined(this.previousIcon)||(t.EventHandler.remove(this.nextIcon,"click",this.navigateNextHandler),t.addClass([this.nextIcon],m),t.addClass([this.nextIcon],f),this.nextIcon.setAttribute("aria-disabled","true")):(t.EventHandler.add(this.nextIcon,"click",this.navigateNextHandler),t.removeClass([this.nextIcon],m),t.removeClass([this.nextIcon],f),this.nextIcon.setAttribute("aria-disabled","false"))},i.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},i.prototype.isMinMaxRange=function(e){return+e>=+this.min&&+e<=+this.max},i.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},i.prototype.compareYear=function(e,t){return this.compare(e,t,0)},i.prototype.compareDecade=function(e,t){return this.compare(e,t,10)},i.prototype.shiftArray=function(e,t){return e.slice(t).concat(e.slice(0,t))},i.prototype.addDay=function(e,i,s,a,n){var r=i,l=new Date(+e);if(!t.isNullOrUndefined(this.tableBodyElement)&&!t.isNullOrUndefined(s)){for(;this.findNextTD(new Date(+e),r,a,n);)r+=i;var o=new Date(l.setDate(l.getDate()+r));r=+o>+a||+o<+n?r===i?i-i:i:r}e.setDate(e.getDate()+r)},i.prototype.findNextTD=function(e,i,s,a){var n=new Date(e.setDate(e.getDate()+i)),r=[],l=!1;if((!t.isNullOrUndefined(n)&&n.getMonth())===(!t.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(m)})}else r=this.tableBodyElement.querySelectorAll("td."+m);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},i.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},i.prototype.setDateDecade=function(e,t){e.setFullYear(t),this.setProperties({value:new Date(this.checkValue(e))},!0)},i.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)},i.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},i.prototype.checkValue=function(e){return e instanceof Date?e.toUTCString():""+e},i.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)},i.prototype.getDate=function(e,t){return t&&(e=new Date(e.toLocaleString("en-US",{timeZone:t}))),e},l([t.Property(new Date(1900,0,1))],i.prototype,"min",void 0),l([t.Property(!0)],i.prototype,"enabled",void 0),l([t.Property(null)],i.prototype,"cssClass",void 0),l([t.Property(new Date(2099,11,31))],i.prototype,"max",void 0),l([t.Property(null)],i.prototype,"firstDayOfWeek",void 0),l([t.Property("Gregorian")],i.prototype,"calendarMode",void 0),l([t.Property("Month")],i.prototype,"start",void 0),l([t.Property("Month")],i.prototype,"depth",void 0),l([t.Property(!1)],i.prototype,"weekNumber",void 0),l([t.Property("FirstDay")],i.prototype,"weekRule",void 0),l([t.Property(!0)],i.prototype,"showTodayButton",void 0),l([t.Property("Short")],i.prototype,"dayHeaderFormat",void 0),l([t.Property(!1)],i.prototype,"enablePersistence",void 0),l([t.Property(null)],i.prototype,"keyConfigs",void 0),l([t.Property(null)],i.prototype,"serverTimezoneOffset",void 0),l([t.Event()],i.prototype,"created",void 0),l([t.Event()],i.prototype,"destroyed",void 0),l([t.Event()],i.prototype,"navigated",void 0),l([t.Event()],i.prototype,"renderDayCell",void 0),i=l([t.NotifyPropertyChanges],i)}(t.Component),M=function(e){function i(t,i){return e.call(this,t,i)||this}return r(i,e),i.prototype.render=function(){if("Islamic"===this.calendarMode&&void 0===this.islamicModule&&t.throwError("Requires the injectable Islamic modules to render Calendar in Islamic mode"),this.isMultiSelection&&"object"==typeof this.values&&!t.isNullOrUndefined(this.values)&&this.values.length>0){for(var i=[],s=[],a=0;a<this.values.length;a++)-1===i.indexOf(+this.values[a])&&(i.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=t.closest(this.element,"form");l&&t.EventHandler.add(l,"reset",this.formResetHandler.bind(this)),this.setTimeZone(this.serverTimezoneOffset)}this.renderComplete()},i.prototype.setEnable=function(e){e?t.removeClass([this.element],m):t.addClass([this.element],m)},i.prototype.setClass=function(e,i){t.isNullOrUndefined(i)||(i=i.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e)||(e=e.replace(/\s+/g," ").trim()),t.isNullOrUndefined(i)||""===i||t.removeClass([this.element],i.split(" ")),t.isNullOrUndefined(e)||t.addClass([this.element],e.split(" "))},i.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)},i.prototype.setTimeZone=function(e){if(!t.isNullOrUndefined(this.serverTimezoneOffset)&&this.value){var i=e+(new Date).getTimezoneOffset()/60;i=this.isDayLightSaving()?i--:i,this.value=new Date(this.value.getTime()+60*i*60*1e3)}},i.prototype.formResetHandler=function(){this.setProperties({value:null},!0)},i.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),!t.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)},i.prototype.minMaxUpdate=function(){"calendar"===this.getModuleName()&&(!t.isNullOrUndefined(this.value)&&this.value<=this.min&&this.min<=this.max?(this.setProperties({value:this.min},!0),this.changedArgs={value:this.value}):!t.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()||t.isNullOrUndefined(this.value)?e.prototype.minMaxUpdate.call(this,this.value):!t.isNullOrUndefined(this.value)&&this.value<this.min&&this.min<=this.max?e.prototype.minMaxUpdate.call(this,this.min):!t.isNullOrUndefined(this.value)&&this.value>this.max&&this.min<=this.max&&e.prototype.minMaxUpdate.call(this,this.max)},i.prototype.generateTodayVal=function(i){var s=new Date;return t.isNullOrUndefined(this.timezone)||(s=e.prototype.getDate.call(this,s,this.timezone)),i&&t.isNullOrUndefined(this.timezone)?(s.setHours(i.getHours()),s.setMinutes(i.getMinutes()),s.setSeconds(i.getSeconds()),s.setMilliseconds(i.getMilliseconds())):s=new Date(s.getFullYear(),s.getMonth(),s.getDate(),0,0,0,0),s},i.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))}},i.prototype.keyActionHandle=function(t){e.prototype.keyActionHandle.call(this,t,this.value,this.isMultiSelection)},i.prototype.preRender=function(){var t=this;this.changeHandler=function(e){t.triggerChange(e)},this.checkView(),e.prototype.preRender.call(this,this.value)},i.prototype.createContent=function(){this.previousDate=this.value,this.previousDateTime=this.value,e.prototype.createContent.call(this)},i.prototype.minMaxDate=function(t){return e.prototype.minMaxDate.call(this,t)},i.prototype.renderMonths=function(t,i,s){e.prototype.renderMonths.call(this,t,this.value,s)},i.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},i.prototype.renderYears=function(t){"Gregorian"===this.calendarMode?e.prototype.renderYears.call(this,t,this.value):this.islamicModule.islamicRenderYears(t,this.value)},i.prototype.renderDecades=function(t){"Gregorian"===this.calendarMode?e.prototype.renderDecades.call(this,t,this.value):this.islamicModule.islamicRenderDecade(t,this.value)},i.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(o)?this.changeHandler(a):this.changeHandler()},i.prototype.clickHandler=function(i){var s=i.currentTarget;if(this.isPopupClicked=!0,s.classList.contains(o))if(this.isMultiSelection){var a=this.copyValues(this.values);-1===a.toString().indexOf(this.getIdValue(i,null).toString())?(a.push(this.getIdValue(i,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(i,null)},!0);var n=this.currentView();e.prototype.clickHandler.call(this,i,this.value),this.isMultiSelection&&this.currentDate!==this.value&&!t.isNullOrUndefined(this.tableBodyElement.querySelectorAll("."+g)[0])&&"Year"===n&&this.tableBodyElement.querySelectorAll("."+g)[0].classList.remove(g)},i.prototype.switchView=function(t,i,s,a){e.prototype.switchView.call(this,t,i,this.isMultiSelection,a)},i.prototype.getModuleName=function(){return e.prototype.getModuleName.call(this),"calendar"},i.prototype.getPersistData=function(){e.prototype.getPersistData.call(this);return this.addOnPersist(["value","values"])},i.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},i.prototype.destroy=function(){if(e.prototype.destroy.call(this),"calendar"===this.getModuleName()){this.changedArgs=null;var i=t.closest(this.element,"form");i&&t.EventHandler.remove(i,"reset",this.formResetHandler.bind(this))}},i.prototype.navigateTo=function(t,i,s){this.minMaxUpdate(),e.prototype.navigateTo.call(this,t,i,s)},i.prototype.currentView=function(){return e.prototype.currentView.call(this)},i.prototype.addDate=function(i){if("string"!=typeof i&&"number"!=typeof i){var s=this.copyValues(this.values);if("object"==typeof i&&i.length>0)for(var a=i,n=0;n<a.length;n++)this.checkDateValue(a[n])&&!e.prototype.checkPresentDate.call(this,a[n],s)&&(!t.isNullOrUndefined(s)&&s.length>0?s.push(a[n]):s=[new Date(+a[n])]);else this.checkDateValue(i)&&!e.prototype.checkPresentDate.call(this,i,s)&&(!t.isNullOrUndefined(s)&&s.length>0?s.push(i):s=[new Date(+i)]);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()}},i.prototype.removeDate=function(e){if("string"!=typeof e&&"number"!=typeof e&&!t.isNullOrUndefined(this.values)&&this.values.length>0){var i=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<i.length;n++)+i[n]==+s[a]&&i.splice(n,1);else for(n=0;n<i.length;n++)+i[n]==+e&&i.splice(n,1);this.setProperties({values:i},!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()}},i.prototype.setTodayDate=function(t){var i=new Date(+t);this.setProperties({value:i},!0),e.prototype.todayButtonClick.call(this,null,i,!0)},i.prototype.update=function(){this.validateDate(),this.minMaxUpdate(),e.prototype.setValueUpdate.call(this)},i.prototype.selectDate=function(i,s,a){e.prototype.selectDate.call(this,i,s,a,this.isMultiSelection,this.values),this.isMultiSelection&&!t.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(i)},i.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))},i.prototype.triggerChange=function(e){!t.isNullOrUndefined(this.todayButtonEvent)&&this.isTodayClicked&&(e=this.todayButtonEvent,this.isTodayClicked=!1),this.changedArgs.event=e||null,this.changedArgs.isInteracted=!t.isNullOrUndefined(e),t.isNullOrUndefined(this.value)||this.setProperties({value:this.value},!0),this.isMultiSelection||+this.value===Number.NaN||(t.isNullOrUndefined(this.value)||t.isNullOrUndefined(this.previousDate))&&(null!==this.previousDate||isNaN(+this.value))?t.isNullOrUndefined(this.values)||this.previousValues===this.values.length||(this.changeEvent(e),this.previousValues=this.values.length):this.changeEvent(e)},l([t.Property(null)],i.prototype,"value",void 0),l([t.Property(null)],i.prototype,"values",void 0),l([t.Property(!1)],i.prototype,"isMultiSelection",void 0),l([t.Event()],i.prototype,"change",void 0),i=l([t.NotifyPropertyChanges],i)}(k),w="e-other-month",V="e-disabled",N="e-selected",O="e-focused-date",I="e-month-hide",T=function(){function e(e){this.calendarInstance=e}return e.prototype.getModuleName=function(){return"islamic"},e.prototype.islamicTitleUpdate=function(e,i){var s=new t.Internationalization(this.calendarInstance.locale);switch(i){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,i,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:"e-cell"}),c=this.calendarInstance.createElement("span");d%7==0&&this.calendarInstance.weekNumber&&(c.textContent=""+this.calendarInstance.getWeek(l),p.appendChild(c),t.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?(t.addClass([v],V),t.addClass([v],"e-overlay")):g.setAttribute("title",""+y);u!==this.getIslamicDate(l).month&&t.addClass([v],w),0!==l.getDay()&&6!==l.getDay()||t.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(!t.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 i&&+i==+D.date&&this.calendarInstance.setProperties({value:null},!0);this.calendarInstance.renderDayCellArgs.isDisabled&&!v.classList.contains(N)&&(t.addClass([v],V),t.addClass([v],"e-overlay"),+this.calendarInstance.renderDayCellArgs.date==+this.calendarInstance.todayDate&&(this.calendarInstance.todayDisabled=!0));var C=v.classList.contains(w),k=v.classList.contains(V);if(k||t.EventHandler.add(v,"click",this.calendarInstance.clickHandler,this.calendarInstance),!this.calendarInstance.isMultiSelection||t.isNullOrUndefined(this.calendarInstance.values)||C||k)C||k||!this.calendarInstance.getDateVal(l,i)?this.calendarInstance.updateFocus(C,k,l,v,e):t.addClass([v],N);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])?t.addClass([v],N):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()&&t.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 i=this.islamicCompareMonth(e,this.calendarInstance.min)<1,s=this.islamicCompareMonth(e,this.calendarInstance.max)>-1;this.calendarInstance.previousIconHandler(i),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=t.HijriParser.toGregorian(1361,1,1),l=this.hijriCompareDecade(e,this.calendarInstance.min)<1,o=this.hijriCompareDecade(e,this.calendarInstance.max)>-1;l=t.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,i){this.calendarInstance.removeTableHeadElement();var s=[],a=t.isNullOrUndefined(i),n=new Date(this.islamicInValue(this.calendarInstance.currentDate)),r=this.getIslamicDate(n);n=t.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=t.HijriParser.toGregorian(f.year,m,1);var v=this.islamicDayCell(n),y=this.calendarInstance.createElement("span"),g=i&&this.getIslamicDate(i).month===this.getIslamicDate(n).month,b=i&&this.getIslamicDate(i).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)?t.addClass([v],V):!a&&b?t.addClass([v],N):this.getIslamicDate(n).month===l&&this.getIslamicDate(this.calendarInstance.currentDate).month===l&&t.addClass([v],O),v.classList.contains(V)||t.EventHandler.add(v,"click",this.calendarInstance.clickHandler,this.calendarInstance),v.appendChild(y),s.push(v)}this.islamicRenderTemplate(s,4,"e-year",e,i)},e.prototype.islamicRenderDecade=function(e,i){this.calendarInstance.removeTableHeadElement();var s=[],a=new Date(this.islamicInValue(this.calendarInstance.currentDate)),n=this.getIslamicDate(a),r=(a=t.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((!t.isNullOrUndefined(e)&&c[0]!==d&&"home"===e.action||!t.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){for(var 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(var f=0;f<=c.length;f++)d-c[f]!=0&&c[f]-d!=0||(d=(parseInt(d,10)+1).toString()),d-c[f]==2&&d>c[f].trim()&&(d=(parseInt(d,10)-1).toString()),c[f]-d==1&&d<c[f].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 v=this.calendarInstance.globalize.formatDate(l,{type:"dateTime",format:"y",calendar:"islamic"}),y=this.calendarInstance.globalize.formatDate(o,{type:"dateTime",format:"y",calendar:"islamic"});this.calendarInstance.headerTitleElement.textContent=v+" - "+y}else this.calendarInstance.headerTitleElement.textContent=d+" - "+p;this.calendarInstance.nextIconClicked=this.calendarInstance.previousIconClicked=!1;var g=(parseInt(d,10)-2).toString();h=Math.round(.97*parseInt(d,10)+622),u=Math.round(.97*parseInt(p,10)+622);for(var b=Math.round(.97*parseInt(g,10)+622),D=1;D<=12;++D){var E=b+D;a.setFullYear(E),a.setDate(1),a.setMonth(0),this.getIslamicDate(a).year-n.year>1&&(a.setMonth(1),D-=1,a.setFullYear(a.getFullYear()-1)),n=this.getIslamicDate(a);if(a=t.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 C=this.islamicDayCell(a);t.attributes(C,{role:"gridcell"});var k=this.calendarInstance.createElement("span");k.textContent=this.calendarInstance.globalize.formatDate(a,{type:"dateTime",format:"y",calendar:"islamic"}),n.year===parseInt(d,10)-1||E<h||E>u&&n.year!==parseInt(p,10)?t.addClass([C],w):E<new Date(this.islamicInValue(this.calendarInstance.min)).getFullYear()||E>new Date(this.islamicInValue(this.calendarInstance.max)).getFullYear()?t.addClass([C],V):t.isNullOrUndefined(i)||this.getIslamicDate(a).year!==this.getIslamicDate(i).year?a.getFullYear()!==this.calendarInstance.currentDate.getFullYear()||C.classList.contains(V)||t.addClass([C],O):t.addClass([C],N),C.classList.contains(V)||t.EventHandler.add(C,"click",this.calendarInstance.clickHandler,this.calendarInstance),C.appendChild(k),(!t.isNullOrUndefined(e)&&"home"===e.action&&n.year.toString()===d||!t.isNullOrUndefined(e)&&"end"===e.action&&n.year.toString()===p)&&t.addClass([C],O),s.push(C)}}this.islamicRenderTemplate(s,4,"e-decade",e,i)},e.prototype.islamicDayCell=function(e){var i={skeleton:"full",type:"dateTime",calendar:"islamic"},s=this.calendarInstance.globalize.formatDate(e,i),a=this.calendarInstance.globalize.parseDate(s,i).valueOf(),n={className:"e-cell",attrs:{id:""+t.getUniqueID(""+a),"aria-selected":"false",role:"gridcell"}};return this.calendarInstance.createElement("td",n)},e.prototype.islamicRenderTemplate=function(e,i,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),t.removeClass([this.calendarInstance.contentElement,this.calendarInstance.headerElement],["e-month","e-decade","e-year"]),t.addClass([this.calendarInstance.contentElement,this.calendarInstance.headerElement],[s]);for(var o=i,h=0,u=0;u<Math.round(e.length/i);++u){for(r=this.calendarInstance.createElement("tr",{attrs:{role:"row"}}),h=0+h;h<o;h++)e[h].classList.contains("e-week-number")||t.isNullOrUndefined(e[h].children[0])||(t.addClass([e[h].children[0]],["e-day"]),t.rippleEffect(e[h].children[0],{duration:600,isCenterRipple:!0})),r.appendChild(e[h]),this.calendarInstance.weekNumber&&7===h&&e[7].classList.contains(w)&&t.addClass([r],I),!this.calendarInstance.weekNumber&&6===h&&e[6].classList.contains(w)&&t.addClass([r],I),this.calendarInstance.weekNumber?41===h&&e[41].classList.contains(w)&&t.addClass([r],I):35===h&&e[35].classList.contains(w)&&t.addClass([r],I);o+=i,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)?a=-1:n.year<r&&"Year"===this.calendarInstance.currentView()&&(a=-1),a},e.prototype.getIslamicDate=function(e){return t.HijriParser.getHijriDate(e)},e.prototype.toGregorian=function(e,i,s){return t.HijriParser.toGregorian(e,i,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}(),x=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)}}(),S=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},P="e-datepicker",A="e-popup-wrapper",U="e-input-focus",H="e-active",W="e-date-overflow",L="e-selected",F="e-non-edit",B=["title","class","style"],j=function(e){function a(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 x(a,e),a.prototype.render=function(){this.initialize(),this.bindEvents(),"Never"!==this.floatLabelType&&s.Input.calculateWidth(this.inputElement,this.inputWrapper.container),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.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"),!t.isNullOrUndefined(t.closest(this.element,"fieldset"))&&t.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete(),this.setTimeZone(this.serverTimezoneOffset)},a.prototype.setTimeZone=function(e){if(!t.isNullOrUndefined(this.serverTimezoneOffset)&&this.value){var i=e+(new Date).getTimezoneOffset()/60;i=this.isDayLightSaving()?i--:i,this.value=new Date(this.value.getTime()+60*i*60*1e3),this.updateInput()}},a.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)},a.prototype.setAllowEdit=function(){this.allowEdit?this.readonly||this.inputElement.removeAttribute("readonly"):t.attributes(this.inputElement,{readonly:""}),this.updateIconState()},a.prototype.updateIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&t.removeClass([this.inputWrapper.container],[F]):""===this.inputElement.value?t.removeClass([this.inputWrapper.container],[F]):t.addClass([this.inputWrapper.container],[F])},a.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=t.isNullOrUndefined(this.value)?null:new Date(+this.value),this.inputElement.setAttribute("value",this.inputElement.value),this.inputValueCopy=this.value},a.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 i={placeholder:this.placeholder};this.globalize=new t.Internationalization(this.locale),this.l10n=new t.L10n("datepicker",i,this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0)}this.fullScreenMode&&t.Browser.isDevice&&(this.cssClass+=" e-popup-expand");var a=this.cssClass;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(a=this.cssClass.replace(/\s+/g," ").trim());var n=!this.enableMask;this.inputWrapper=s.Input.createInput({element:this.inputElement,floatLabelType:this.floatLabelType,bindClearAction:n,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),t.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),s.Input.addAttributes({"aria-label":"select",role:"button"},this.inputWrapper.buttons[0]),t.addClass([this.inputWrapper.container],"e-date-wrapper")},a.prototype.updateInput=function(i,s){void 0===i&&(i=!1),void 0===s&&(s=!1);var a;if(this.value&&!this.isCalendar()&&this.disabledDates(i,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)),!t.isNullOrUndefined(this.value)){var n=this.value,r=void 0,l=t.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)}}t.isNullOrUndefined(this.value)&&this.strictMode&&(this.enableMask?(this.updateInputValue(this.maskedDateValue),this.notify("createMask",{module:"MaskedDateTime"})):this.updateInputValue("")),!this.strictMode&&t.isNullOrUndefined(this.value)&&this.invalidValueString&&this.updateInputValue(this.invalidValueString),this.changedArgs={value:this.value},this.errorClass(),this.updateIconState()},a.prototype.minMaxUpdates=function(){!t.isNullOrUndefined(this.value)&&this.value<this.min&&this.min<=this.max&&this.strictMode?(this.setProperties({value:this.min},!0),this.changedArgs={value:this.value}):!t.isNullOrUndefined(this.value)&&this.value>this.max&&this.min<=this.max&&this.strictMode&&(this.setProperties({value:this.max},!0),this.changedArgs={value:this.value})},a.prototype.checkStringValue=function(e){var i=null,s=null,a=null;if("datetimepicker"===this.getModuleName()){var n=new t.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 i=this.checkDateValue(this.globalize.parseDate(e,s)),t.isNullOrUndefined(i)&&"datetimepicker"===this.getModuleName()&&(i=this.checkDateValue(this.globalize.parseDate(e,a))),i},a.prototype.checkInvalidValue=function(e){if(!(e instanceof Date||t.isNullOrUndefined(e))){var i=null,s=e;"number"==typeof e&&(s=e.toString());if("datetimepicker"===this.getModuleName()){var a=new t.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()),!(i=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:i=new Date(s)}n?(this.strictMode||(this.invalidValueString=s),this.setProperties({value:null},!0)):this.setProperties({value:i},!0)}},a.prototype.bindInputEvent=function(){t.isNullOrUndefined(this.formatString)&&!this.enableMask||(this.enableMask||-1===this.formatString.indexOf("y")?t.EventHandler.add(this.inputElement,"input",this.inputHandler,this):t.EventHandler.remove(this.inputElement,"input",this.inputHandler))},a.prototype.bindEvents=function(){t.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.dateIconHandler,this),t.EventHandler.add(this.inputElement,"mouseup",this.mouseUpHandler,this),t.EventHandler.add(this.inputElement,"focus",this.inputFocusHandler,this),t.EventHandler.add(this.inputElement,"blur",this.inputBlurHandler,this),t.EventHandler.add(this.inputElement,"keyup",this.keyupHandler,this),this.enableMask&&t.EventHandler.add(this.inputElement,"keydown",this.keydownHandler,this),this.bindInputEvent(),t.EventHandler.add(this.inputElement,"change",this.inputChangeHandler,this),this.showClearButton&&this.inputWrapper.clearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.resetFormHandler,this),this.defaultKeyConfigs=t.extend(this.defaultKeyConfigs,this.keyConfigs),this.keyboardModules=new t.KeyboardEvents(this.inputElement,{eventName:"keydown",keyAction:this.inputKeyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})},a.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}))}},a.prototype.unBindEvents=function(){t.isNullOrUndefined(this.inputWrapper)||t.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.dateIconHandler),t.EventHandler.remove(this.inputElement,"mouseup",this.mouseUpHandler),t.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),t.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),t.EventHandler.remove(this.inputElement,"change",this.inputChangeHandler),t.EventHandler.remove(this.inputElement,"keyup",this.keyupHandler),this.enableMask&&t.EventHandler.remove(this.inputElement,"keydown",this.keydownHandler),this.showClearButton&&this.inputWrapper.clearButton&&t.EventHandler.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.resetFormHandler)},a.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())}},a.prototype.restoreValue=function(){this.currentDate=this.value?this.value:new Date,this.previousDate=this.value,this.previousElementValue=t.isNullOrUndefined(this.inputValueCopy)?"":this.globalize.formatDate(this.inputValueCopy,{format:this.formatString,type:"dateTime",skeleton:"yMd"})},a.prototype.inputChangeHandler=function(e){this.enabled&&e.stopPropagation()},a.prototype.bindClearEvent=function(){this.showClearButton&&this.inputWrapper.clearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this)},a.prototype.resetHandler=function(e){this.enabled&&(e.preventDefault(),this.clear(e))},a.prototype.mouseUpHandler=function(e){this.enableMask&&(e.preventDefault(),this.notify("setMaskSelection",{module:"MaskedDateTime"}))},a.prototype.clear=function(e){this.setProperties({value:null},!0),this.enableMask||this.updateInputValue("");var i={event:e};if(this.trigger("cleared",i),this.invalidValueString="",this.updateInput(),this.popupUpdate(),this.changeEvent(e),this.enableMask&&this.notify("clearHandler",{module:"MaskedDateTime"}),t.closest(this.element,"form")){var s=this.element,a=document.createEvent("KeyboardEvent");a.initEvent("keyup",!1,!0),s.dispatchEvent(a)}},a.prototype.preventEventBubbling=function(e){e.preventDefault(),this.interopAdaptor.invokeMethodAsync("OnDateIconClick")},a.prototype.updateInputValue=function(e){s.Input.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton)},a.prototype.dateIconHandler=function(e){this.enabled&&(this.isIconClicked=!0,t.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(),t.addClass([this.inputWrapper.container],[U]),t.addClass(this.inputWrapper.buttons,H))),this.isIconClicked=!1)},a.prototype.updateHtmlAttributeToWrapper=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if(!t.isNullOrUndefined(this.htmlAttributes[""+s])&&B.indexOf(s)>-1)if("class"===s){var a=this.htmlAttributes[""+s].replace(/\s+/g," ").trim();""!==a&&t.addClass([this.inputWrapper.container],a.split(" "))}else if("style"===s){var n=this.inputWrapper.container.getAttribute(s);t.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])}},a.prototype.updateHtmlAttributeToElement=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];B.indexOf(s)<0&&this.inputElement.setAttribute(s,this.htmlAttributes[""+s])}},a.prototype.updateCssClass=function(e,i){t.isNullOrUndefined(i)||(i=i.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e)||(e=e.replace(/\s+/g," ").trim()),s.Input.setCssClass(e,[this.inputWrapper.container],i),this.popupWrapper&&s.Input.setCssClass(e,[this.popupWrapper],i)},a.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()}},a.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()}},a.prototype.inputHandler=function(){this.isPopupClicked=!1,this.enableMask&&this.notify("inputHandler",{module:"MaskedDateTime"})},a.prototype.inputBlurHandler=function(e){if(this.enabled){if(this.strictModeUpdate(),""===this.inputElement.value&&t.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 i={model:this};this.trigger("blur",i)}this.isCalendar()&&(this.defaultKeyConfigs=t.extend(this.defaultKeyConfigs,this.keyConfigs),this.calendarKeyboardModules=new t.KeyboardEvents(this.calendarElement.children[1].firstElementChild,{eventName:"keydown",keyAction:this.calendarKeyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})),this.isPopupClicked=!1}},a.prototype.documentHandler=function(i){t.isNullOrUndefined(this.popupObj)||t.isNullOrUndefined(this.inputWrapper)||!(this.inputWrapper.container.contains(i.target)&&"mousedown"!==i.type||this.popupObj.element&&this.popupObj.element.contains(i.target))||"touchstart"===i.type||i.preventDefault();var s=i.target;t.closest(s,".e-datepicker.e-popup-wrapper")||t.isNullOrUndefined(this.inputWrapper)||t.closest(s,".e-input-group")===this.inputWrapper.container||s.classList.contains("e-day")||s.classList.contains("e-dlg-overlay")?t.closest(s,".e-datepicker.e-popup-wrapper")&&(s.classList.contains("e-day")&&!t.isNullOrUndefined(i.target.parentElement)&&i.target.parentElement.classList.contains("e-selected")&&t.closest(s,".e-content")&&t.closest(s,".e-content").classList.contains("e-"+this.depth.toLowerCase())?this.hide(i):t.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(i)):(this.hide(i),this.focusOut())},a.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)}},a.prototype.defaultAction=function(i){this.previousDate=!t.isNullOrUndefined(this.value)&&new Date(+this.value)||null,this.isCalendar()&&(e.prototype.keyActionHandle.call(this,i),this.isCalendar()&&t.attributes(this.inputElement,{"aria-activedescendant":""+this.setActiveDescendant()}))},a.prototype.popupUpdate=function(){if((t.isNullOrUndefined(this.value)&&!t.isNullOrUndefined(this.previousDate)||"datetimepicker"!==this.getModuleName()&&+this.value!=+this.previousDate||"datetimepicker"===this.getModuleName()&&+this.value!=+this.previousDateTime)&&(this.popupObj&&this.popupObj.element.querySelectorAll("."+L).length>0&&t.removeClass(this.popupObj.element.querySelectorAll("."+L),[L]),!t.isNullOrUndefined(this.value)&&+this.value>=+this.min&&+this.value<=+this.max)){var i=new Date(this.checkValue(this.value));e.prototype.navigateTo.call(this,"Month",i)}},a.prototype.strictModeUpdate=function(){var e,i;if("datetimepicker"===this.getModuleName()?e=t.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString:/^y/.test(this.formatString)&&!/[^a-zA-Z]/.test(this.formatString)||(e=t.isNullOrUndefined(this.formatString)?this.formatString:this.formatString.replace("dd","d")),t.isNullOrUndefined(e))e=this.formatString;else{e.split("M").length-1<3&&(e=e.replace("MM","M"))}var s;s="datetimepicker"===this.getModuleName()?"Gregorian"===this.calendarMode?{format:t.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:t.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"}:i="Gregorian"===this.calendarMode?{format:e,type:"dateTime",skeleton:"yMd"}:{format:e,type:"dateTime",skeleton:"yMd",calendar:"islamic"};var a;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,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 i="Gregorian"===this.calendarMode?{format:e,type:"dateTime",skeleton:"yMd"}:{format:e,type:"dateTime",skeleton:"yMd",calendar:"islamic"},a=this.globalize.parseDate(this.inputElement.value,i);else a=this.globalize.parseDate(this.inputElement.value,s),a=!t.isNullOrUndefined(a)&&isNaN(+a)?null:a,!t.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),t.isNullOrUndefined(this.value)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0)))},a.prototype.createCalendar=function(){var e=this;this.popupWrapper=this.createElement("div",{className:P+" "+A,id:this.inputElement.id+"_options"}),this.popupWrapper.setAttribute("aria-label",this.element.id),this.popupWrapper.setAttribute("role","dialog"),t.isNullOrUndefined(this.cssClass)||(this.popupWrapper.className+=" "+this.cssClass),t.Browser.isDevice&&(this.modelHeader(),this.modal=this.createElement("div"),this.modal.className=P+" e-date-modal",document.body.className+=" "+W,this.modal.style.display="block",document.body.appendChild(this.modal)),this.calendarElement.querySelector("table tbody").className="",this.popupObj=new i.Popup(this.popupWrapper,{content:this.calendarElement,relateTo:t.Browser.isDevice?document.body:this.inputWrapper.container,position:t.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:t.Browser.isDevice?{X:"fit",Y:"fit"}:this.enableRtl?{X:"fit",Y:"flip"}:{X:"flip",Y:"flip"},open:function(){t.Browser.isDevice&&e.fullScreenMode&&(e.iconRight=parseInt(window.getComputedStyle(e.calendarElement.querySelector(".e-header.e-month .e-prev")).marginRight,10)>16,e.touchModule=new t.Touch(e.calendarElement.querySelector(".e-content.e-month"),{swipe:e.CalendarSwipeHandler.bind(e)}),t.EventHandler.add(e.calendarElement.querySelector(".e-content.e-month"),"touchstart",e.TouchStartHandler,e)),"datetimepicker"!==e.getModuleName()&&document.activeElement!==e.inputElement&&(e.defaultKeyConfigs=t.extend(e.defaultKeyConfigs,e.keyConfigs),e.calendarElement.children[1].firstElementChild.focus(),e.calendarKeyboardModules=new t.KeyboardEvents(e.calendarElement.children[1].firstElementChild,{eventName:"keydown",keyAction:e.calendarKeyActionHandle.bind(e),keyConfigs:e.defaultKeyConfigs}),e.calendarKeyboardModules=new t.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(),t.detach(e.popupWrapper),e.popupObj=e.popupWrapper=null,e.preventArgs=null,e.calendarKeyboardModules=null,e.setAriaAttributes()},targetExitViewport:function(){t.Browser.isDevice||e.hide()}}),this.popupObj.element.className+=" "+this.cssClass,this.setAriaAttributes()},a.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)},a.prototype.TouchStartHandler=function(e){this.touchStart=!0},a.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)},a.prototype.modelHeader=function(){var e,i=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"});t.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"),i.appendChild(l),i.appendChild(o)}this.fullScreenMode||i.appendChild(s),a.appendChild(n),a.appendChild(r),i.appendChild(a),this.calendarElement.insertBefore(i,this.calendarElement.firstElementChild)},a.prototype.modelCloseHandler=function(e){this.hide()},a.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=!t.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},a.prototype.navigatedEvent=function(){this.trigger("navigated",this.navigatedArgs)},a.prototype.keyupHandler=function(e){this.isKeyAction=this.inputElement.value!==this.previousElementValue},a.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},a.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},a.prototype.selectCalendar=function(e){var i,s,a;s="datetimepicker"===this.getModuleName()&&t.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"},i=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"},i=this.globalize.formatDate(this.changedArgs.value,a)),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"})),t.isNullOrUndefined(i)||(this.updateInputValue(i),this.enableMask&&this.notify("setMaskSelection",{module:"MaskedDateTime"}))},a.prototype.isCalendar=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains(""+A))},a.prototype.setWidth=function(e){this.inputWrapper.container.style.width="number"==typeof e?t.formatUnit(this.width):"string"==typeof e?e.match(/px|%|em/)?this.width:t.formatUnit(this.width):"100%"},a.prototype.show=function(i,s){var a=this;if(!(this.enabled&&this.readonly||!this.enabled||this.popupObj)){var n=!0,r=void 0;t.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()),t.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:t.Browser.isDevice?this.mobilePopupWrapper:document.body};var l=this.preventArgs;if(this.trigger("open",l,function(i){if(a.preventArgs=i,n&&!a.preventArgs.cancel){t.addClass(a.inputWrapper.buttons,H),a.preventArgs.appendTo.appendChild(a.popupWrapper),a.popupObj.refreshPosition(a.inputElement);var s={name:"FadeIn",duration:t.Browser.isDevice?0:300};1e3===a.zIndex?a.popupObj.show(new t.Animation(s),a.element):a.popupObj.show(new t.Animation(s),null),e.prototype.setOverlayIndex.call(a,a.mobilePopupWrapper,a.popupObj.element,a.modal,t.Browser.isDevice),a.setAriaAttributes()}else a.popupObj.destroy(),a.popupWrapper=a.popupObj=null;t.isNullOrUndefined(a.inputElement)||""!==a.inputElement.value||!t.isNullOrUndefined(a.tableBodyElement)&&a.tableBodyElement.querySelectorAll("td.e-selected").length>0&&(t.addClass([a.tableBodyElement.querySelector("td.e-selected")],"e-focused-date"),t.removeClass(a.tableBodyElement.querySelectorAll("td.e-selected"),L)),t.EventHandler.add(document,"mousedown touchstart",a.documentHandler,a)}),t.Browser.isDevice){var o=this.createElement("div",{className:"e-dlg-overlay"});o.style.zIndex=(this.zIndex-1).toString(),this.mobilePopupWrapper.appendChild(o)}}},a.prototype.hide=function(e){var i=this;if(t.isNullOrUndefined(this.popupWrapper))t.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},t.removeClass(this.inputWrapper.buttons,H),t.removeClass([document.body],W);var a=this.preventArgs;this.isCalendar()?this.trigger("close",a,function(e){i.closeEventCallback(s,e)}):this.closeEventCallback(s,a)}},a.prototype.closeEventCallback=function(e,i){this.preventArgs=i,this.isCalendar()&&e&&!this.preventArgs.cancel&&(this.popupObj.hide(),this.isAltKeyPressed=!1,this.keyboardModule.destroy(),t.removeClass(this.inputWrapper.buttons,H)),this.setAriaAttributes(),t.Browser.isDevice&&this.modal&&(this.modal.style.display="none",this.modal.outerHTML="",this.modal=null),t.Browser.isDevice&&(t.isNullOrUndefined(this.mobilePopupWrapper)||!e||!t.isNullOrUndefined(this.preventArgs)&&this.preventArgs.cancel||(this.mobilePopupWrapper.remove(),this.mobilePopupWrapper=null)),t.EventHandler.remove(document,"mousedown touchstart",this.documentHandler),t.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit()},a.prototype.focusIn=function(e){document.activeElement!==this.inputElement&&this.enabled&&(this.inputElement.focus(),t.addClass([this.inputWrapper.container],[U]))},a.prototype.focusOut=function(){document.activeElement===this.inputElement&&(t.removeClass([this.inputWrapper.container],[U]),this.inputElement.blur())},a.prototype.currentView=function(){var t;return this.calendarElement&&(t=e.prototype.currentView.call(this)),t},a.prototype.navigateTo=function(t,i){this.calendarElement&&e.prototype.navigateTo.call(this,t,i)},a.prototype.destroy=function(){this.unBindEvents(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),e.prototype.destroy.call(this),s.Input.destroy({element:this.inputElement,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),t.isNullOrUndefined(this.keyboardModules)||this.keyboardModules.destroy(),this.popupObj&&this.popupObj.element.classList.contains("e-popup")&&e.prototype.destroy.call(this);var i={"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&&(s.Input.removeAttributes(i,this.inputElement),t.isNullOrUndefined(this.inputElementCopy.getAttribute("tabindex"))?this.inputElement.removeAttribute("tabindex"):this.inputElement.setAttribute("tabindex",this.tabIndex),t.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),t.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),this.ensureInputAttribute()),this.isCalendar()&&(this.popupWrapper&&t.detach(this.popupWrapper),this.popupObj=this.popupWrapper=null,this.keyboardModule.destroy()),null===this.ngTag&&(this.inputElement&&(t.isNullOrUndefined(this.inputWrapper)||this.inputWrapper.container.insertAdjacentElement("afterend",this.inputElement),t.removeClass([this.inputElement],["e-input"])),t.removeClass([this.element],[P]),t.isNullOrUndefined(this.inputWrapper)||t.detach(this.inputWrapper.container)),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.resetFormHandler),this.inputWrapper=null,this.keyboardModules=null},a.prototype.ensureInputAttribute=function(){for(var e=[],i=0;i<this.inputElement.attributes.length;i++)e[i]=this.inputElement.attributes[i].name;for(i=0;i<e.length;i++)t.isNullOrUndefined(this.inputElementCopy.getAttribute(e[i]))?("value"===e[i].toLowerCase()&&(this.inputElement.value=""),this.inputElement.removeAttribute(e[i])):("value"===e[i].toLowerCase()&&(this.inputElement.value=this.inputElementCopy.getAttribute(e[i])),this.inputElement.setAttribute(e[i],this.inputElementCopy.getAttribute(e[i])))},a.prototype.preRender=function(){this.inputElementCopy=this.element.cloneNode(!0),t.removeClass([this.inputElementCopy],[P,"e-control","e-lib"]),this.inputElement=this.element,this.formElement=t.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=t.getUniqueID("ej2-datetimepicker"),null!==this.ngTag&&t.attributes(this.inputElement,{id:this.element.id+"_input"})):(this.element.id=t.getUniqueID("ej2-datepicker"),null!==this.ngTag&&t.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)},a.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},a.prototype.validationAttribute=function(e,i){var s=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id");i.setAttribute("name",s),e.removeAttribute("name");for(var a=["required","aria-required","form"],n=0;n<a.length;n++)if(!t.isNullOrUndefined(e.getAttribute(a[n]))){var r=e.getAttribute(a[n]);i.setAttribute(a[n],r),e.removeAttribute(a[n])}},a.prototype.checkFormat=function(){var e=new t.Internationalization(this.locale);if(this.format)if("string"==typeof this.format)this.formatString=this.format;else if(""===this.format.skeleton||t.isNullOrUndefined(this.format.skeleton))"datetimepicker"===this.getModuleName()?this.formatString=this.dateTimeFormat:this.formatString=null;else{var i=this.format.skeleton;"datetimepicker"===this.getModuleName()?this.formatString=e.getDatePattern({skeleton:i,type:"dateTime"}):this.formatString=e.getDatePattern({skeleton:i,type:"date"})}else this.formatString=null},a.prototype.checkHtmlAttributes=function(e){this.globalize=new t.Internationalization(this.locale),this.checkFormat(),this.checkView();var i,s=e?t.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["value","min","max","disabled","readonly","style","name","placeholder","type"];i="datetimepicker"===this.getModuleName()?"Gregorian"===this.calendarMode?{format:t.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:t.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(!t.isNullOrUndefined(this.inputElement.getAttribute(r)))switch(r){case"disabled":if(t.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(t.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":(t.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(t.isNullOrUndefined(this.datepickerOptions)||void 0===this.datepickerOptions.value||e){var h=this.inputElement.getAttribute(r);this.setProperties(t.setValue(r,this.globalize.parseDate(h,i),{}),!e)}break;case"min":if(+this.min==+new Date(1900,0,1)||e){var u=this.inputElement.getAttribute(r);this.setProperties(t.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(t.setValue(r,this.globalize.parseDate(d),{}),!e)}break;case"type":"text"!==this.inputElement.getAttribute(r)&&this.inputElement.setAttribute("type","text")}}},a.prototype.getModuleName=function(){return"datepicker"},a.prototype.disabledDates=function(i,s){void 0===i&&(i=!1),void 0===s&&(s=!1);var a,n=this.checkDateValue(this.value)?new Date(+this.value):new Date(this.checkValue(this.value)),r=this.previousDate;this.minMaxUpdates(),(!i||i&&!t.isNullOrUndefined(this.renderDayCell))&&e.prototype.render.call(this),this.previousDate=r;var l='*[id^="/id"]'.replace("/id",""+(n&&+n));this.strictMode||("string"==typeof this.value||"object"==typeof this.value&&+this.value!=+n)&&this.setProperties({value:n},!0),t.isNullOrUndefined(this.calendarElement)||t.isNullOrUndefined(this.calendarElement.querySelectorAll(l)[0])||this.calendarElement.querySelectorAll(l)[0].classList.contains("e-disabled")&&(this.strictMode||(this.currentDate=new Date((new Date).setHours(0,0,0,0))));var o;"datetimepicker"===this.getModuleName()?o="Gregorian"===this.calendarMode?this.globalize.formatDate(n,{format:t.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd"}):this.globalize.formatDate(n,{format:t.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"},o=this.globalize.formatDate(n,a)),this.popupObj||(this.updateInputValue(o),this.enableMask&&(this.updateInputValue(this.maskedDateValue),this.notify("createMask",{module:"MaskedDateTime",isBlur:s})))},a.prototype.setAriaAttributes=function(){this.isCalendar()?(s.Input.addAttributes({"aria-expanded":"true"},this.inputElement),t.attributes(this.inputElement,{"aria-owns":this.inputElement.id+"_options"}),t.attributes(this.inputElement,{"aria-controls":this.inputElement.id}),this.value&&t.attributes(this.inputElement,{"aria-activedescendant":""+this.setActiveDescendant()})):(s.Input.addAttributes({"aria-expanded":"false"},this.inputElement),this.inputElement.removeAttribute("aria-owns"),this.inputElement.removeAttribute("aria-controls"),this.inputElement.removeAttribute("aria-activedescendant"))},a.prototype.errorClass=function(){var e='*[id^="/id"]'.replace("/id",""+ +this.value),i=this.calendarElement&&this.calendarElement.querySelectorAll(e)[0]&&this.calendarElement.querySelectorAll(e)[0].classList.contains("e-disabled");!(t.isNullOrUndefined(this.value)||t.isNullOrUndefined(this.min)||t.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&&t.isNullOrUndefined(this.value)||i?(t.addClass([this.inputWrapper.container],"e-error"),t.attributes(this.inputElement,{"aria-invalid":"true"})):t.isNullOrUndefined(this.inputWrapper)||(t.removeClass([this.inputWrapper.container],"e-error"),t.attributes(this.inputElement,{"aria-invalid":"false"}))},a.prototype.onPropertyChanged=function(i,a){for(var n=0,r=Object.keys(i);n<r.length;n++){switch(r[n]){case"value":this.isDynamicValueChanged=!0,this.isInteracted=!1,this.invalidValueString=null,this.checkInvalidValue(i.value),i.value=this.value,this.previousElementValue=this.inputElement.value,t.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":s.Input.setPlaceholder(this.placeholder,this.inputElement);break;case"readonly":s.Input.setReadonly(this.readonly,this.inputElement);break;case"enabled":s.Input.setEnabled(this.enabled,this.inputElement),this.setAriaDisabled();break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.checkHtmlAttributes(!0);break;case"locale":this.globalize=new t.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.datepickerOptions&&null==this.datepickerOptions.placeholder&&(this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),s.Input.setPlaceholder(this.placeholder,this.inputElement)),this.updateInput(),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"});break;case"enableRtl":s.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]);break;case"start":case"depth":this.checkView(),this.calendarElement&&e.prototype.onPropertyChanged.call(this,i,a);break;case"zIndex":this.setProperties({zIndex:i.zIndex},!0);break;case"cssClass":this.updateCssClass(i.cssClass,a.cssClass);break;case"showClearButton":s.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(i.width),s.Input.calculateWidth(this.inputElement,this.inputWrapper.container),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.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=i.floatLabelType,s.Input.removeFloating(this.inputWrapper),s.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.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,i,a)}this.isDynamicValueChanged||this.hide(null),this.isDynamicValueChanged=!1}},S([t.Property(null)],a.prototype,"width",void 0),S([t.Property(null)],a.prototype,"value",void 0),S([t.Property(null)],a.prototype,"cssClass",void 0),S([t.Property(!1)],a.prototype,"strictMode",void 0),S([t.Property(null)],a.prototype,"format",void 0),S([t.Property(!0)],a.prototype,"enabled",void 0),S([t.Property(!1)],a.prototype,"fullScreenMode",void 0),S([t.Property({})],a.prototype,"htmlAttributes",void 0),S([t.Property(null)],a.prototype,"values",void 0),S([t.Property(!1)],a.prototype,"isMultiSelection",void 0),S([t.Property(!0)],a.prototype,"showClearButton",void 0),S([t.Property(!0)],a.prototype,"allowEdit",void 0),S([t.Property(null)],a.prototype,"keyConfigs",void 0),S([t.Property(!1)],a.prototype,"enablePersistence",void 0),S([t.Property(1e3)],a.prototype,"zIndex",void 0),S([t.Property(!1)],a.prototype,"readonly",void 0),S([t.Property(null)],a.prototype,"placeholder",void 0),S([t.Property("Never")],a.prototype,"floatLabelType",void 0),S([t.Property(null)],a.prototype,"serverTimezoneOffset",void 0),S([t.Property(!1)],a.prototype,"openOnFocus",void 0),S([t.Property(!1)],a.prototype,"enableMask",void 0),S([t.Property({day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"})],a.prototype,"maskPlaceholder",void 0),S([t.Event()],a.prototype,"open",void 0),S([t.Event()],a.prototype,"cleared",void 0),S([t.Event()],a.prototype,"close",void 0),S([t.Event()],a.prototype,"blur",void 0),S([t.Event()],a.prototype,"focus",void 0),S([t.Event()],a.prototype,"created",void 0),S([t.Event()],a.prototype,"destroyed",void 0),a=S([t.NotifyPropertyChanges],a)}(M),R=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)}}(),Y=function(e,t,i,s){var a,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(r=(n<3?a(r):n>3?a(t,i,r):a(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},z="e-left-calendar",q="e-right-calendar",K="e-daterangepicker",_="e-active",G="e-start-date",Z="e-end-date",X="e-input-focus",J="e-range-hover",$="e-other-month",Q="e-start-label",ee="e-end-label",te="e-disabled",ie="e-selected",se="e-calendar",ae="e-header",ne="e-title",re="e-icon-container",le="e-date-range-container",oe="e-presets",he="e-focused-date",ue="e-content",de="e-day-span",pe="e-week-number",ce="e-date-disabled",me="e-icon-disabled",fe="e-overlay",ve="e-list-item",ye="e-hover",ge="e-range-overflow",be="e-non-edit",De="e-daterange-hidden",Ee=["title","class","style"],Ce=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return R(i,e),Y([t.Property()],i.prototype,"label",void 0),Y([t.Property()],i.prototype,"start",void 0),Y([t.Property()],i.prototype,"end",void 0),i}(t.ChildProperty),ke=function(e){function r(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 R(r,e),r.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&&s.Input.calculateWidth(this.inputElement,this.inputWrapper.container),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.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"),!t.isNullOrUndefined(t.closest(this.element,"fieldset"))&&t.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete()},r.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=!!t.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),t.removeClass([this.cloneElement],[K,"e-control","e-lib"]),this.updateHtmlAttributeToElement(),this.element.getAttribute("id")?null!==this.angularTag&&(this.inputElement.id=this.element.getAttribute("id")+"_input"):(this.element.id=t.getUniqueID("ej2-datetimepicker"),null!==this.angularTag&&t.attributes(this.inputElement,{id:this.element.id+"_input"})),this.checkInvalidRange(this.value),!this.invalidValueString&&"string"==typeof this.value){var i=this.value.split(" "+this.separator+" ");this.value=[new Date(i[0]),new Date(i[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=t.closest(this.element,"form")},r.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())):t.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())},r.prototype.initProperty=function(){this.globalize=new t.Internationalization(this.locale),this.checkFormat(),this.checkView(),(t.isNullOrUndefined(this.firstDayOfWeek)||this.firstDayOfWeek>6||this.firstDayOfWeek<0)&&this.setProperties({firstDayOfWeek:this.globalize.getFirstDayOfWeek()},!0),this.updateValue()},r.prototype.checkFormat=function(){if(this.format)if("string"==typeof this.format)this.formatString=this.format;else if(""===this.format.skeleton||t.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},r.prototype.initialize=function(){null!==this.angularTag&&this.validationAttribute(this.element,this.inputElement),this.checkHtmlAttributes(!1),t.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 t.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()},r.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]))}},r.prototype.setRangeAllowEdit=function(){this.allowEdit?this.readonly||this.inputElement.removeAttribute("readonly"):t.attributes(this.inputElement,{readonly:""}),this.updateClearIconState()},r.prototype.updateClearIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&t.removeClass([this.inputWrapper.container],[be]):""===this.inputElement.value?t.removeClass([this.inputWrapper.container],[be]):t.addClass([this.inputWrapper.container],[be])},r.prototype.validationAttribute=function(e,i){var s=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id");i.setAttribute("name",s),e.removeAttribute("name");for(var a=["required","aria-required","form"],n=0;n<a.length;n++)if(!t.isNullOrUndefined(e.getAttribute(a[n]))){var r=e.getAttribute(a[n]);i.setAttribute(a[n],r),e.removeAttribute(a[n])}},r.prototype.updateHtmlAttributeToWrapper=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if(Ee.indexOf(s)>-1)if("class"===s){var a=this.htmlAttributes[""+s].replace(/\s+/g," ").trim();""!==a&&t.addClass([this.inputWrapper.container],a.split(" "))}else if("style"===s){var n=this.inputWrapper.container.getAttribute(s);n=t.isNullOrUndefined(n)?this.htmlAttributes[""+s]:n+this.htmlAttributes[""+s],this.inputWrapper.container.setAttribute(s,n)}else this.inputWrapper.container.setAttribute(s,this.htmlAttributes[""+s])}},r.prototype.updateHtmlAttributeToElement=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];Ee.indexOf(s)<0&&this.inputElement.setAttribute(s,this.htmlAttributes[""+s])}},r.prototype.updateCssClass=function(e,i){t.isNullOrUndefined(i)||(i=i.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e)||(e=e.replace(/\s+/g," ").trim()),s.Input.setCssClass(e,[this.inputWrapper.container],i),this.popupWrapper&&s.Input.setCssClass(e,[this.popupWrapper],i)},r.prototype.processPresets=function(){this.presetsItem=[];var e=0;if(!t.isUndefined(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)){for(var i=0,s=this.presets;i<s.length;i++){var a=s[i],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=t.isNullOrUndefined(this.startValue)?null:new Date(+this.startValue),l=t.isNullOrUndefined(this.endValue)?null:new Date(+this.endValue);this.presetsItem.push({id:"custom_range",text:this.l10n.getConstant("customRange"),start:r,end:l}),t.isNullOrUndefined(this.startValue)||t.isNullOrUndefined(this.endValue)||(this.isCustomRange=!0,this.activeIndex=this.presetsItem.length-1)}},r.prototype.bindEvents=function(){t.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler,this),t.EventHandler.add(this.inputElement,"focus",this.inputFocusHandler,this),t.EventHandler.add(this.inputElement,"blur",this.inputBlurHandler,this),t.EventHandler.add(this.inputElement,"change",this.inputChangeHandler,this),this.showClearButton&&this.inputWrapper.clearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this),this.isMobile||(this.keyInputConfigs=t.extend(this.keyInputConfigs,this.keyConfigs),this.inputKeyboardModule=new t.KeyboardEvents(this.inputElement,{eventName:"keydown",keyAction:this.inputHandler.bind(this),keyConfigs:this.keyInputConfigs})),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this),this.enabled?this.inputElement.setAttribute("tabindex",this.tabIndex):this.inputElement.tabIndex=-1},r.prototype.unBindEvents=function(){t.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler),t.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),t.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),t.EventHandler.remove(this.inputElement,"change",this.inputChangeHandler),this.showClearButton&&this.inputWrapper.clearButton&&t.EventHandler.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler),this.isMobile||t.isNullOrUndefined(this.inputKeyboardModule)||this.inputKeyboardModule.destroy(),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler),this.inputElement.tabIndex=-1},r.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")}},r.prototype.inputChangeHandler=function(e){this.enabled&&(e.stopPropagation(),this.updateHiddenInput())},r.prototype.bindClearEvent=function(){this.showClearButton&&this.inputWrapper.clearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this)},r.prototype.resetHandler=function(e){if(this.enabled){this.valueType=this.value,e.preventDefault(),this.clear();var i={event:e};if(this.setProperties({endDate:this.checkDateValue(this.endValue)},!0),this.setProperties({startDate:this.checkDateValue(this.startValue)},!0),this.trigger("cleared",i),this.changeTrigger(e),this.clearRange(),this.hide(e),t.closest(this.element,"form")){var s=this.firstHiddenChild,a=document.createEvent("KeyboardEvent");a.initEvent("keyup",!1,!0),s.dispatchEvent(a)}}},r.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()},r.prototype.formResetHandler=function(e){if(this.enabled&&this.formElement&&e.target===this.formElement&&!this.inputElement.disabled){var i=this.inputElement.getAttribute("value");t.isNullOrUndefined(this.startCopy)?(this.setProperties({value:null,startDate:null,endDate:null},!0),this.startValue=this.endValue=null):(t.isNullOrUndefined(this.value)||t.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),i="",this.startValue=this.endValue=null,this.inputElement.setAttribute("value","")),this.restoreValue(),this.inputElement&&(s.Input.setValue(i,this.inputElement,this.floatLabelType,this.showClearButton),this.errorClass())}},r.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),s.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),t.isNullOrUndefined(this.applyButton)||(this.applyButton.disabled=this.applyButton.element.disabled=!0),this.removeSelection()},r.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||t.isNullOrUndefined(this.leftCalendar)||(this.isRangeIconClicked=!1,this.calendarFocus(),this.isRangeIconClicked=!0),t.addClass([this.inputWrapper.container],[X])))},r.prototype.checkHtmlAttributes=function(e){this.globalize=new t.Internationalization(this.locale);for(var i=e?t.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=i;a<n.length;a++){var r=n[a];if(!t.isNullOrUndefined(this.inputElement.getAttribute(r)))switch(r){case"disabled":if(t.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(t.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":(t.isNullOrUndefined(this.dateRangeOptions)||void 0===this.dateRangeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(r)},!e);break;case"value":if(t.isNullOrUndefined(this.dateRangeOptions)||void 0===this.dateRangeOptions.value||e){var h=this.inputElement.getAttribute(r);this.setProperties(t.setValue(r,h,{}),!e)}break;case"style":this.inputElement.setAttribute("style",""+this.inputElement.getAttribute(r));break;case"min":if(t.isNullOrUndefined(this.min)||+this.min==+new Date(1900,0,1)||e){var u=this.globalize.parseDate(this.inputElement.getAttribute(r),s);this.setProperties(t.setValue(r,u,{}),!e)}break;case"name":this.inputElement.setAttribute("name",""+this.inputElement.getAttribute(r));break;case"max":if(t.isNullOrUndefined(this.max)||+this.max==+new Date(2099,11,31)||e){u=this.globalize.parseDate(this.inputElement.getAttribute(r),s);this.setProperties(t.setValue(r,u,{}),!e)}break;case"startDate":if(t.isNullOrUndefined(this.startDate)){u=this.globalize.parseDate(this.inputElement.getAttribute(r),s);this.startValue=u,this.setValue()}break;case"endDate":if(t.isNullOrUndefined(this.endDate)){u=this.globalize.parseDate(this.inputElement.getAttribute(r),s);this.endValue=u,this.setValue()}break;case"minDays":t.isNullOrUndefined(this.minDays)&&this.setProperties(t.setValue(r,parseInt(this.inputElement.getAttribute(r),10),{}),!0);break;case"maxDays":t.isNullOrUndefined(this.maxDays)&&this.setProperties(t.setValue(r,parseInt(this.inputElement.getAttribute(r),10),{}),!0);break;case"type":"text"!==this.inputElement.getAttribute(r)&&this.inputElement.setAttribute("type","text")}}},r.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 i=this.presetsItem[e].start,s=this.presetsItem[e].end;this.startValue&&this.endValue&&i.getDate()==this.startValue.getDate()&&i.getMonth()==this.startValue.getMonth()&&i.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=t.createElement("div",{id:this.element.id+"_popup",className:K+" e-popup"}),this.popupWrapper.setAttribute("aria-label",this.element.id),this.popupWrapper.setAttribute("role","dialog"),this.adjustLongHeaderWidth();var a=!this.isCustomRange||this.isMobile;!t.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())},r.prototype.renderControl=function(){this.createControl(),this.bindCalendarEvents(),this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar]),t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)||t.isNullOrUndefined(this.renderDayCellArgs)||!this.renderDayCellArgs.isDisabled||this.disabledDateRender(),this.updateHeader()},r.prototype.clearCalendarEvents=function(){this.leftCalPrevIcon&&this.leftCalNextIcon&&this.rightCalPrevIcon&&this.rightCalNextIcon&&(t.EventHandler.clearEvents(this.leftCalPrevIcon),t.EventHandler.clearEvents(this.leftCalNextIcon),t.EventHandler.clearEvents(this.rightCalPrevIcon),t.EventHandler.clearEvents(this.rightCalNextIcon))},r.prototype.updateNavIcons=function(){e.prototype.iconHandler.call(this)},r.prototype.calendarIconEvent=function(){this.clearCalendarEvents(),this.leftCalPrevIcon&&!this.leftCalPrevIcon.classList.contains(te)&&t.EventHandler.add(this.leftCalPrevIcon,"mousedown",this.navPrevFunction),this.leftCalNextIcon&&!this.leftCalNextIcon.classList.contains(te)&&t.EventHandler.add(this.leftCalNextIcon,"mousedown",this.navNextFunction),this.rightCalPrevIcon&&!this.rightCalPrevIcon.classList.contains(te)&&t.EventHandler.add(this.rightCalPrevIcon,"mousedown",this.navPrevFunction),this.rightCalNextIcon&&!this.rightCalNextIcon.classList.contains(te)&&t.EventHandler.add(this.rightCalNextIcon,"mousedown",this.navNextFunction)},r.prototype.bindCalendarEvents=function(){this.isMobile?(this.deviceCalendarEvent(),t.EventHandler.add(this.startButton.element,"click",this.deviceHeaderClick,this),t.EventHandler.add(this.endButton.element,"click",this.deviceHeaderClick,this)):(this.updateNavIcons(),this.calendarIconEvent(),this.calendarIconRipple(),this.headerTitleElement=this.popupObj.element.querySelector("."+q+" ."+ae+" ."+ne),this.headerTitleElement=this.popupObj.element.querySelector("."+z+" ."+ae+" ."+ne),this.defaultKeyConfigs=t.extend(this.defaultKeyConfigs,this.keyConfigs),this.leftKeyboardModule=new t.KeyboardEvents(this.leftCalendar,{eventName:"keydown",keyAction:this.keyInputHandler.bind(this),keyConfigs:this.defaultKeyConfigs}),this.rightKeyboardModule=new t.KeyboardEvents(this.rightCalendar,{eventName:"keydown",keyAction:this.keyInputHandler.bind(this),keyConfigs:this.defaultKeyConfigs})),this.start===this.depth&&this.bindCalendarCellEvents(),this.removeFocusedDate()},r.prototype.calendarIconRipple=function(){t.rippleEffect(this.leftCalPrevIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),t.rippleEffect(this.leftCalNextIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),t.rippleEffect(this.rightCalPrevIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),t.rippleEffect(this.rightCalNextIcon,{selector:".e-next",duration:400,isCenterRipple:!0})},r.prototype.deviceCalendarEvent=function(){t.EventHandler.clearEvents(this.nextIcon),t.EventHandler.clearEvents(this.previousIcon),t.rippleEffect(this.nextIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),t.rippleEffect(this.previousIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),this.nextIcon&&!this.nextIcon.classList.contains(te)&&t.EventHandler.add(this.nextIcon,"mousedown",this.deviceNavNextFunction),this.previousIcon&&!this.previousIcon.classList.contains(te)&&t.EventHandler.add(this.previousIcon,"mousedown",this.deviceNavPrevFunction)},r.prototype.deviceNavNext=function(e){var i=t.closest(e.target,"."+se);this.updateDeviceCalendar(i),this.navigateNext(e),this.deviceNavigation()},r.prototype.deviceNavPrevious=function(e){var i=t.closest(e.target,"."+se);this.updateDeviceCalendar(i),this.navigatePrevious(e),this.deviceNavigation()},r.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("."+ue),this.tableBodyElement=t.select(".e-content tbody",e),this.table=e.querySelector("."+ue).getElementsByTagName("table")[0],this.headerTitleElement=e.querySelector(".e-header ."+ne),this.headerElement=e.querySelector("."+ae))},r.prototype.deviceHeaderClick=function(e){if(e.currentTarget.classList.contains("e-start-btn")&&!t.isNullOrUndefined(this.startValue)){this.endButton.element.classList.remove(_),this.startButton.element.classList.add(_);var i=this.popupObj.element.querySelector("."+se);this.updateDeviceCalendar(i),t.isNullOrUndefined(this.calendarElement.querySelector("."+G+":not(.e-other-month)"))&&(this.currentDate=new Date(+this.startValue),t.remove(this.tableBodyElement),this.createContentBody(),this.deviceNavigation()),this.removeClassDisabled()}else if(!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue)){this.startButton.element.classList.remove(_),this.endButton.element.classList.add(_);i=this.popupObj.element.querySelector("."+se);this.updateDeviceCalendar(i),t.isNullOrUndefined(this.calendarElement.querySelector("."+Z+":not(.e-other-month)"))&&(this.currentDate=new Date(+this.endValue),t.remove(this.tableBodyElement),this.createContentBody(),this.deviceNavigation()),this.updateMinMaxDays(this.popupObj.element.querySelector("."+se)),this.selectableDates()}},r.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}},r.prototype.inputBlurHandler=function(e){if(this.enabled){if(!this.preventBlur){var i=this.inputElement.value;if(t.isNullOrUndefined(this.presetsItem)||this.presetsItem.length>0&&this.previousEleValue!==this.inputElement.value&&(this.activeIndex=this.presetsItem.length-1,this.isCustomRange=!0),!t.isNullOrUndefined(i)&&""!==i.trim()){var a=i.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),l=this.globalize.parseDate(a[1],n),o=this.getStartEndDate(r,!1,a,n),h=this.getStartEndDate(l,!0,a,n);if(!(t.isNullOrUndefined(o)||isNaN(+o)||t.isNullOrUndefined(h)||isNaN(+h))){var u=this.startValue;this.startValue=o;var d=this.endValue;if(this.endValue=h,this.setValue(),this.refreshControl(),i!==this.previousEleValue&&this.changeTrigger(e),!this.preventBlur&&document.activeElement!==this.inputElement){this.preventFocus=!1;var p={model:this};this.trigger("blur",p)}return this.updateHiddenInput(),void(this.isMobile&&this.isPopupOpen()&&(this.startValue=u,this.endValue=d))}this.strictMode||(this.startValue=null,this.endValue=null,this.setValue())}else this.strictMode||(this.startValue=null,this.endValue=null,this.setValue())}if(this.strictMode?(t.isNullOrUndefined(i)||""!==i.trim()||(this.startValue=null,this.endValue=null),s.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.updateInput()):(t.isNullOrUndefined(this.popupObj)&&(this.currentDate=null),this.previousStartValue=this.previousEndValue=null,this.startValue=null,this.endValue=null,this.setValue()),this.errorClass(),this.changeTrigger(e),!this.preventBlur&&document.activeElement!==this.inputElement){this.preventFocus=!1;p={model:this};this.trigger("blur",p)}}this.updateHiddenInput()}},r.prototype.getStartEndDate=function(e,i,s,a){return"Month"===this.depth?this.globalize.parseDate(s[i?1:0].trim(),a):"Year"!==this.depth||t.isNullOrUndefined(e)?t.isNullOrUndefined(e)?null:new Date(e.getFullYear(),i?11:0,i?31:1):new Date(e.getFullYear(),e.getMonth()+(i?1:0),i?0:1)},r.prototype.clearRange=function(){this.previousStartValue=this.previousEndValue=null,this.currentDate=null},r.prototype.errorClass=function(){var e=this.inputElement.value.trim();(t.isNullOrUndefined(this.endValue)&&t.isNullOrUndefined(this.startValue)&&""!==e||!t.isNullOrUndefined(this.startValue)&&+this.startValue<+this.min||!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue)&&+this.startValue>+this.endValue||!t.isNullOrUndefined(this.endValue)&&+this.endValue>+this.max||this.startValue&&this.isDateDisabled(this.startValue)||this.endValue&&this.isDateDisabled(this.endValue))&&""!==e?(t.addClass([this.inputWrapper.container],"e-error"),t.attributes(this.inputElement,{"aria-invalid":"true"})):this.inputWrapper&&(t.removeClass([this.inputWrapper.container],"e-error"),t.attributes(this.inputElement,{"aria-invalid":"false"}))},r.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},r.prototype.navInCalendar=function(e,i,s,a,n){var r,l,o=this.getViewNumber(this.currentView()),h=this.min;switch(l=t.isNullOrUndefined(this.maxDays)||!this.isMaxDaysClicked||t.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),i&&+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),i||+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&&!i&&(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),i&&+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),t.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),t.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,z)&&(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,q)&&(n=this.keyCalendarUpdate(!0,n,!1),this.currentDate=this.firstCellToFocus(this.leftCalendar),this.keyboardNavigate(0,o,e,l,h),this.keyNavigation(n,e))}},r.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},r.prototype.keyInputHandler=function(i,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=t.closest(i.target,"."+q),h=(o=t.isNullOrUndefined(o)?this.leftCalendar:o).classList.contains(z);this.updateCalendarElement(o);var u=this.tableBodyElement.querySelector("tr td.e-selected"),d=o.querySelector("tr td."+he),p=o.querySelector("tr td."+G),c=o.querySelector("tr td."+Z),m=this.getViewNumber(this.depth),f=n===m&&this.getViewNumber(this.start)>=m,v=t.closest(i.target,"."+z),y=t.closest(i.target,"."+q),g=t.closest(i.target,"."+oe);switch(t.isNullOrUndefined(d)?t.isNullOrUndefined(c)||this.dateDisabled?t.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="",i.action){case"altUpArrow":this.isPopupOpen()&&(this.hide(i),this.preventFocus=!0,this.inputElement.focus(),t.addClass([this.inputWrapper.container],[X]));break;case"select":if(f){var b=t.isNullOrUndefined(d)?p:d;t.isNullOrUndefined(b)||b.classList.contains(te)||this.selectRange(null,b)}else(t.isNullOrUndefined(u)||f)&&t.isNullOrUndefined(d)||(t.isNullOrUndefined(this.value)||(s=this.calendarElement.classList.contains(z)?this.startDate:this.endDate),this.controlDown=i,this.contentClick(null,--n,d||u,s));i.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,i);break;case"altRightArrow":t.isNullOrUndefined(v)?t.isNullOrUndefined(y)?t.isNullOrUndefined(g)||this.cancelButton.element.focus():t.isNullOrUndefined(this.presetElement)?this.cancelButton.element.focus():(this.presetElement.focus(),this.removeFocusedDate()):this.rightCalendar.children[1].firstElementChild.focus(),i.preventDefault();break;case"altLeftArrow":t.isNullOrUndefined(v)?t.isNullOrUndefined(y)||this.leftCalendar.children[1].firstElementChild.focus():!0!==this.applyButton.element.disabled?this.applyButton.element.focus():this.cancelButton.element.focus(),i.preventDefault();break;case"controlUp":this.calendarElement.classList.contains(z),this.calendarNavigation(i,this.calendarElement),i.preventDefault();break;case"controlDown":t.isNullOrUndefined(u)&&t.isNullOrUndefined(d)||f||(t.isNullOrUndefined(this.value)||(s=this.calendarElement.classList.contains(z)?this.startDate:this.endDate),this.controlDown=i,this.contentClick(null,--n,u||d,s)),i.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,i);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,i);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,i);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,i);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,i);break;case"shiftTab":t.isNullOrUndefined(this.presetElement)||(this.presetElement.setAttribute("tabindex","0"),this.presetElement.focus(),this.removeFocusedDate()),h&&i.preventDefault(),this.tabKeyValidation(o,q)&&(this.currentDate=new Date(+this.leftCalCurrentDate),this.navInCalendar(i,h,l,r,o));break;case"spacebar":this.applyButton&&!this.applyButton.disabled&&this.applyFunction(i);break;case"tab":this.tabKeyValidation(o,z)&&(this.currentDate=new Date(+this.rightCalCurrentDate),this.navInCalendar(i,h,l,r,o));break;default:this.navInCalendar(i,h,l,r,o),this.checkMinMaxDays()}this.presetHeight()},r.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},r.prototype.keyNavigation=function(e,t){this.bindCalendarCellEvents(e),e.classList.contains(z)?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()},r.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||t.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())}},r.prototype.bindCalendarCellEvents=function(e){for(var i=0,s=e?e.querySelectorAll("."+se+" td"):this.popupObj.element.querySelectorAll("."+se+" td");i<s.length;i++){var a=s[i];t.EventHandler.clearEvents(a);a.classList.contains(te)||a.classList.contains(ce)||a.classList.contains(pe)||(this.isMobile||t.EventHandler.add(a,"mouseover",this.hoverSelection,this),t.EventHandler.add(a,"mousedown",this.selectRange,this))}},r.prototype.removeFocusedDate=function(){for(var e=!t.isNullOrUndefined(this.startValue)||!t.isNullOrUndefined(this.endValue),i=0,s=this.popupObj.element.querySelectorAll("."+se+" ."+he);i<s.length;i++){var a=s[i],n=new Date,r=this.getIdValue(null,a);("Month"===this.depth&&"Month"===this.currentView()&&(!a.classList.contains("e-today")||a.classList.contains("e-today")&&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(he),a.classList.contains(G)||a.classList.contains(Z)||a.removeAttribute("aria-label"))}},r.prototype.hoverSelection=function(e,i){var s=i||e.currentTarget,a=this.getIdValue(null,s);if(!t.isNullOrUndefined(this.startValue)&&+this.startValue>=+this.min&&+this.startValue<=+this.max&&(!this.isDateDisabled(this.endValue)&&!this.isDateDisabled(this.startValue)&&t.isNullOrUndefined(this.endValue)&&t.isNullOrUndefined(this.startValue)||!t.isNullOrUndefined(this.startValue)&&t.isNullOrUndefined(this.endValue)))for(var n=0,r=this.popupObj.element.querySelectorAll("."+se+" td");n<r.length;n++){var l=r[n],o=!l.classList.contains(te)||l.classList.contains(ce);if(!l.classList.contains(pe)&&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?t.addClass([l],J):t.removeClass([l],[J])}}},r.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},r.prototype.updateRange=function(e){if(!t.isNullOrUndefined(this.startValue))for(var i=0,s=e;i<s.length;i++)for(var a=0,n=s[i].querySelectorAll("."+se+" td");a<n.length;a++){var r=n[a];if(!r.classList.contains(pe)&&!r.classList.contains(te)){var l=this.getIdValue(null,r),o=this.getIdValue(null,r);if(t.isNullOrUndefined(this.endValue)?t.removeClass([r],[J]):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)&&t.addClass([r],J),r.classList.contains(ie)&&r.classList.contains(Z)&&+o!=+this.endValue&&(t.removeClass([r],[ie]),t.removeClass([r],[Z])),r.classList.contains(J)&&+o>+this.endValue&&t.removeClass([r],[J]),!r.classList.contains($)){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)&&(t.addClass([r],[G,ie]),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&&!t.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)&&(t.addClass([r],[Z,ie]),this.addSelectedAttributes(r,this.startValue,!1)),+l!=+this.startValue||t.isNullOrUndefined(this.endValue)||+l!=+this.endValue||this.addSelectedAttributes(r,this.endValue,!1,!0)}}}},r.prototype.checkMinMaxDays=function(){(!t.isNullOrUndefined(this.minDays)&&this.minDays>0||!t.isNullOrUndefined(this.maxDays)&&this.maxDays>0)&&(this.isMobile?this.updateMinMaxDays(this.popupObj.element.querySelector("."+se)):(this.updateMinMaxDays(this.popupObj.element.querySelector("."+z)),this.updateMinMaxDays(this.popupObj.element.querySelector("."+q))))},r.prototype.rangeArgs=function(e){var i,s,a=t.isNullOrUndefined(this.startValue)?null:this.globalize.formatDate(this.startValue,{format:this.formatString,type:"date",skeleton:"yMd"}),n=t.isNullOrUndefined(this.endValue)?null:this.globalize.formatDate(this.endValue,{format:this.formatString,type:"date",skeleton:"yMd"});t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)?(i="",s=0):(i=a+" "+this.separator+" "+n,s=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1);return{value:this.value,startDate:this.startValue,endDate:this.endValue,daySpan:s,event:e||null,element:this.element,isInteracted:!t.isNullOrUndefined(e),text:i}},r.prototype.otherMonthSelect=function(e,i,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);t.isNullOrUndefined(r)||(i?(t.addClass([r],[G,ie]),this.addSelectedAttributes(r,this.startValue,!0)):(t.addClass([r],[Z,ie]),this.addSelectedAttributes(r,this.endValue,!0)),s&&this.addSelectedAttributes(e,this.endValue,!1,!0))},r.prototype.selectRange=function(e,i){var s,a;e&&e.preventDefault();var n=t.isNullOrUndefined(e)?this.getIdValue(null,i):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);t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)?this.isMobile&&this.startButton.element.classList.contains(_)&&this.removeSelection():(!this.isMobile||this.isMobile&&!this.endButton.element.classList.contains(_))&&this.removeSelection();var p=i||e.currentTarget;if(t.isNullOrUndefined(this.startValue))t.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(),t.addClass([p],G),this.addSelectedAttributes(p,this.startValue,!0),p.classList.contains($)&&this.otherMonthSelect(p,!0),this.checkMinMaxDays(),this.applyButton.disabled=!0,this.applyButton.element.disabled=!0,this.isMobile&&(this.endButton.element.classList.add(_),this.startButton.element.classList.remove(_),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&&!t.isNullOrUndefined(this.minDays)&&this.minDays>1)return;this.endValue=null,this.setValue(),(this.isMobile||i)&&this.hoverSelection(e,i),t.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("."+Z);if(this.isMobile){this.startButton.element.classList.remove(_),this.endButton.element.classList.add(_);for(var m=0,f=c;m<f.length;m++){var v=f[m];v.removeAttribute("aria-label"),v.classList.contains(G)?(this.addSelectedAttributes(v,this.startValue,!0),t.removeClass([v],[Z])):(v.setAttribute("aria-selected","false"),t.removeClass([v],[Z,ie]))}}t.addClass([p],Z),+this.endValue==+this.startValue?this.addSelectedAttributes(p,this.endValue,!1,!0):this.addSelectedAttributes(p,this.endValue,!1),p.classList.contains($)&&(+this.endValue==+this.startValue?this.otherMonthSelect(p,!1,!0):this.otherMonthSelect(p,!1));for(var y=0,g=c=this.popupObj.element.querySelectorAll("."+Z);y<g.length;y++){var b=g[y];b.classList.contains(G)&&t.removeClass([b],[J])}this.applyButton.disabled=!1,this.applyButton.element.disabled=!1,this.isMobile||this.removeClassDisabled(),!t.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(),t.removeClass(this.popupObj.element.querySelectorAll("."+G),[G,ie]),t.addClass([p],G),this.addSelectedAttributes(p,this.startValue,!0),p.classList.contains($)&&this.otherMonthSelect(p,!0),this.checkMinMaxDays());e&&(s=t.closest(e.target,"."+z)),t.isNullOrUndefined(s)?(e&&(a=e&&t.closest(e.target,"."+q)),t.isNullOrUndefined(a)||this.rightCalendar.children[1].firstElementChild.focus()):this.leftCalendar.children[1].firstElementChild.focus(),t.addClass([p],ie),this.calendarIconEvent(),this.updateHeader(),this.removeFocusedDate()},r.prototype.selectableDates=function(){if(!t.isNullOrUndefined(this.startValue)){var e=this.calendarElement.querySelectorAll("."+se+" td"),i=!1;if(this.currentView()===this.depth){for(var s=0,a=e;s<a.length;s++){if(!(l=a[s]).classList.contains(G)&&!l.classList.contains(pe)&&!l.classList.contains(te)){if(+this.getIdValue(null,l)<+this.startValue){t.addClass([l],[ce,te,fe]),t.EventHandler.clearEvents(l);continue}break}if(l.classList.contains(G)&&!l.classList.contains($)){i=!0;break}}i&&(this.previousIcon.classList.contains(te)||t.addClass([this.previousIcon],[me,te,fe]))}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(_)||!("Year"===this.currentView()&&u.getMonth()<o&&u.getFullYear()<=h||"Decade"===this.currentView()&&u.getMonth()<=o&&u.getFullYear()<h))break;t.addClass([l],[te])}e[0].classList.contains(te)?this.previousIconHandler(!0):e[e.length-1].classList.contains(te)&&this.nextIconHandler(!0)}}},r.prototype.updateMinMaxDays=function(e){if(!t.isNullOrUndefined(this.startValue)&&t.isNullOrUndefined(this.endValue)||this.isMobile&&this.endButton.element.classList.contains(_)){if(!t.isNullOrUndefined(this.minDays)&&this.minDays>0||!t.isNullOrUndefined(this.maxDays)&&this.maxDays>0){var i=this.removeTimeValueFromDate(this.startValue),s=new Date(new Date(+i).setDate(i.getDate()+(this.minDays-1))),a=new Date(new Date(+i).setDate(i.getDate()+(this.maxDays-1)));s=!t.isNullOrUndefined(this.minDays)&&this.minDays>0?s:null,a=!t.isNullOrUndefined(this.maxDays)&&this.maxDays>0?a:null,"Year"===this.currentView()?(s=t.isNullOrUndefined(s)?null:new Date(s.getFullYear(),s.getMonth(),0),a=t.isNullOrUndefined(a)?null:new Date(a.getFullYear(),a.getMonth(),1)):"Decade"===this.currentView()&&(s=t.isNullOrUndefined(s)?null:new Date(s.getFullYear()-1,11,1),a=t.isNullOrUndefined(a)?null:new Date(a.getFullYear(),0,1));for(var n=void 0,r=0,l=e.querySelectorAll("."+se+" td");r<l.length;r++){var o=l[r];if(!o.classList.contains(G)&&!o.classList.contains(pe)){var h=this.getIdValue(null,o);if(h=this.removeTimeValueFromDate(h),!t.isNullOrUndefined(s)&&+h==+s&&o.classList.contains(te)&&s.setDate(s.getDate()+1),!o.classList.contains(te)){if(+h<=+i)continue;!t.isNullOrUndefined(s)&&+h<+s&&(t.addClass([o],[ce,te,fe]),t.EventHandler.clearEvents(o)),!t.isNullOrUndefined(a)&&+h>+a&&(t.addClass([o],[ce,te,fe]),this.isMaxDaysClicked=!0,t.EventHandler.clearEvents(o),t.isNullOrUndefined(n)&&!o.classList.contains($)&&(n=o))}}}if(!t.isNullOrUndefined(n))if(this.isMobile)this.nextIcon.classList.contains(te)||t.addClass([this.nextIcon],[me,te,fe]);else{var u=t.closest(n,"."+q);(u=t.isNullOrUndefined(u)?this.leftCalendar:u).classList.contains(z)?(this.rightCalNextIcon.classList.contains(te)||t.addClass([this.rightCalNextIcon],[me,te,fe]),this.leftCalNextIcon.classList.contains(te)||t.addClass([this.leftCalNextIcon],[me,te,fe]),this.rightCalPrevIcon.classList.contains(te)||t.addClass([this.rightCalPrevIcon],[me,te,fe])):this.rightCalNextIcon.classList.contains(te)||t.addClass([this.rightCalNextIcon],[me,te,fe])}}}else this.isMaxDaysClicked=!1},r.prototype.removeTimeValueFromDate=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())},r.prototype.removeClassDisabled=function(){for(var e=0,i=this.popupObj.element.querySelectorAll("."+se+" td."+ce);e<i.length;e++){var s=i[e];s.classList.contains(ce)&&(t.removeClass([s],[ce,te,fe]),t.EventHandler.add(s,"click",this.selectRange,this),this.isMobile||t.EventHandler.add(s,"mouseover",this.hoverSelection,this))}this.isMobile?(this.nextIcon.classList.contains(me)&&t.removeClass([this.nextIcon],[me,te,fe]),this.previousIcon.classList.contains(me)&&t.removeClass([this.previousIcon],[me,te,fe])):(this.rightCalNextIcon.classList.contains(me)&&t.removeClass([this.rightCalNextIcon],[me,te,fe]),this.rightCalPrevIcon.classList.contains(me)&&t.removeClass([this.rightCalPrevIcon],[me,te,fe]),this.leftCalNextIcon.classList.contains(me)&&t.removeClass([this.leftCalNextIcon],[me,te,fe]))},r.prototype.updateHeader=function(){var e={type:"date",skeleton:"yMMMd"};if(t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue))this.popupObj.element.querySelector("."+de).textContent=this.l10n.getConstant("selectedDays");else{var i=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1;t.isNullOrUndefined(this.disabledDayCnt)||(i-=this.disabledDayCnt,this.disabledDayCnt=null),this.popupObj.element.querySelector("."+de).textContent=i.toString()+" "+this.l10n.getConstant("days")}this.isMobile?(t.isNullOrUndefined(this.startValue)?this.startButton.element.textContent=this.l10n.getConstant("startLabel"):this.startButton.element.textContent=this.globalize.formatDate(this.startValue,e),t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)?this.endButton.element.textContent=this.l10n.getConstant("endLabel"):this.endButton.element.textContent=this.globalize.formatDate(this.endValue,e)):(t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)?this.popupObj.element.querySelector("."+ee).textContent=this.l10n.getConstant("endLabel"):this.popupObj.element.querySelector("."+ee).textContent=this.globalize.formatDate(this.endValue,e),t.isNullOrUndefined(this.startValue)?this.popupObj.element.querySelector("."+Q).textContent=this.l10n.getConstant("startLabel"):this.popupObj.element.querySelector("."+Q).textContent=this.globalize.formatDate(this.startValue,e)),(this.isDateDisabled(this.startValue)||this.isDateDisabled(this.endValue)||!t.isNullOrUndefined(this.startValue)&&+this.startValue<+this.min||!t.isNullOrUndefined(this.endValue)&&+this.endValue>+this.max||!t.isNullOrUndefined(this.startValue)&&!t.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("."+de).textContent=this.l10n.getConstant("selectedDays")):(this.popupObj.element.querySelector("."+de).textContent=this.l10n.getConstant("selectedDays"),this.popupObj.element.querySelector("."+Q).textContent=this.l10n.getConstant("startLabel"),this.popupObj.element.querySelector("."+ee).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")},r.prototype.removeSelection=function(){this.startValue=null,this.endValue=null,this.setValue(),this.removeSelectedAttributes(),this.popupObj&&(this.popupObj.element.querySelectorAll("."+ie).length>0&&t.removeClass(this.popupObj.element.querySelectorAll("."+ie),[G,Z,ie]),this.popupObj.element.querySelectorAll("."+he).length>0&&t.removeClass(this.popupObj.element.querySelectorAll("."+he),he),this.popupObj.element.querySelectorAll("."+J).length>0&&t.removeClass(this.popupObj.element.querySelectorAll("."+J),[J]))},r.prototype.addSelectedAttributes=function(e,i,s,a){if(e){var n=this.globalize.formatDate(i,{type:"date",skeleton:"full"});!t.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")}},r.prototype.removeSelectedAttributes=function(){if(this.popupObj){for(var e=0,t=this.popupObj.element.querySelectorAll("."+G);e<t.length;e++){(a=t[e]).setAttribute("aria-selected","false"),a.removeAttribute("aria-label")}for(var i=0,s=this.popupObj.element.querySelectorAll("."+Z);i<s.length;i++){var a;(a=s[i]).setAttribute("aria-selected","false"),a.removeAttribute("aria-label")}}},r.prototype.updateCalendarElement=function(e){e.classList.contains(z)?(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("."+ue),this.tableBodyElement=t.select(".e-content tbody",e),this.table=e.querySelector("."+ue).getElementsByTagName("table")[0],this.headerTitleElement=e.querySelector(".e-header ."+ne),this.headerElement=e.querySelector("."+ae)},r.prototype.navPrevMonth=function(e){e.preventDefault();var i=t.closest(e.target,"."+z);i=t.isNullOrUndefined(i)?t.closest(e.target,"."+q):i,this.updateCalendarElement(i),this.navigatePrevious(e),!t.isNullOrUndefined(this.startValue)&&t.isNullOrUndefined(this.endValue)&&this.updateMinMaxDays(i),this.updateControl(i)},r.prototype.deviceNavigation=function(e){this.deviceCalendarEvent(),this.updateRange([this.popupObj.element.querySelector("."+se)]),this.endButton.element.classList.contains(_)&&this.updateMinMaxDays(this.popupObj.element.querySelector("."+se)),this.endButton.element.classList.contains(_)&&this.selectableDates(),this.currentView()===this.depth&&this.bindCalendarCellEvents(),this.removeFocusedDate()},r.prototype.updateControl=function(e,t){void 0===t&&(t=null),e.classList.contains(q)?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])},r.prototype.navNextMonth=function(e){e.preventDefault();var i=t.closest(e.target,"."+z);i=t.isNullOrUndefined(i)?t.closest(e.target,"."+q):i,this.updateCalendarElement(i),this.navigateNext(e),!t.isNullOrUndefined(this.startValue)&&t.isNullOrUndefined(this.endValue)&&this.updateMinMaxDays(i),this.updateControl(i)},r.prototype.isPopupOpen=function(){return!(t.isNullOrUndefined(this.popupObj)||!this.popupObj.element.classList.contains("e-popup"))},r.prototype.createRangeHeader=function(){var e=this.createElement("div",{className:"e-start-end"});if(this.isMobile){var i=this.createElement("button",{className:"e-end-btn"}),s=this.createElement("button",{className:"e-start-btn"});this.startButton=new a.Button({content:this.l10n.getConstant("startLabel")},s),this.endButton=new a.Button({content:this.l10n.getConstant("endLabel")},i),e.appendChild(s),e.appendChild(i)}else{var n=this.createElement("a",{className:Q}),r=this.createElement("a",{className:ee}),l=this.createElement("span",{className:"e-change-icon e-icons"});t.attributes(n,{"aria-atomic":"true","aria-live":"assertive","aria-label":"Start Date",role:"button"}),t.attributes(r,{"aria-atomic":"true","aria-live":"assertive","aria-label":"End Date",role:"button"}),e.appendChild(n),e.appendChild(l),e.appendChild(r),n.textContent=this.l10n.getConstant("startLabel"),r.textContent=this.l10n.getConstant("endLabel")}return e},r.prototype.disableInput=function(){this.strictMode?t.isNullOrUndefined(this.previousStartValue)||t.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),s.Input.setEnabled(this.enabled,this.inputElement),this.bindEvents()},r.prototype.validateMinMax=function(){this.min=t.isNullOrUndefined(this.min)||!+this.min?this.min=new Date(1900,0,1):this.min,this.max=t.isNullOrUndefined(this.max)||!+this.max?this.max=new Date(2099,11,31):this.max,this.min<=this.max?(t.isNullOrUndefined(this.minDays)||t.isNullOrUndefined(this.maxDays)||this.maxDays>0&&this.minDays>0&&this.minDays>this.maxDays&&(this.maxDays=null),!t.isNullOrUndefined(this.minDays)&&this.minDays<0&&(this.minDays=null),!t.isNullOrUndefined(this.maxDays)&&this.maxDays<0&&(this.maxDays=null)):this.disableInput()},r.prototype.validateRangeStrict=function(){t.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)),t.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()},r.prototype.validateRange=function(){this.validateMinMaxDays()},r.prototype.validateMinMaxDays=function(){if(!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue)){var e=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1;if(!t.isNullOrUndefined(this.minDays)&&this.minDays>0&&!(e>=this.minDays))if(this.strictMode){var i=new Date(+this.startValue);i.setDate(i.getDate()+(this.minDays-1)),+i>+this.max?(this.endValue=this.max,this.setValue()):(this.endValue=i,this.setValue())}else this.startValue=null,this.endValue=null,this.setValue();t.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()))}},r.prototype.renderCalendar=function(){this.calendarElement=this.createElement("div"),this.calendarElement.classList.add(se),this.enableRtl&&this.calendarElement.classList.add("e-rtl"),t.attributes(this.calendarElement,{"data-role":"calendar"}),e.prototype.createHeader.call(this),e.prototype.createContent.call(this)},r.prototype.isSameMonth=function(e,t){return e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()},r.prototype.isSameYear=function(e,t){return e.getFullYear()===t.getFullYear()},r.prototype.isSameDecade=function(e,t){var i=e.getFullYear(),s=t.getFullYear();return i-i%10==s-s%10},r.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)))},r.prototype.selectNextMonth=function(){if(t.isNullOrUndefined(this.endValue)||t.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),!t.isNullOrUndefined(this.startValue)&&+this.startValue<+this.min||!t.isNullOrUndefined(this.endValue)&&+this.endValue>+this.max||!t.isNullOrUndefined(this.startValue)&&!t.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)}},r.prototype.selectNextYear=function(){if(t.isNullOrUndefined(this.endValue)||t.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),(!t.isNullOrUndefined(this.endValue)&&+this.endValue>+this.max||!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue)&&+this.startValue>+this.endValue||!t.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))},r.prototype.selectNextDecade=function(){if(t.isNullOrUndefined(this.endValue)||t.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),(!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue)&&+this.startValue>+this.endValue||!t.isNullOrUndefined(this.endValue)&&+this.endValue>+this.max||!t.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))},r.prototype.selectStartMonth=function(){t.isNullOrUndefined(this.startValue)?(this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.startMonthCurrentDate()):!t.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)),(!t.isNullOrUndefined(this.endValue)&&+this.endValue>+this.max||!t.isNullOrUndefined(this.startValue)&&+this.startValue<+this.min||!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue)&&+this.startValue>+this.endValue)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0))),this.startMonthCurrentDate()},r.prototype.createCalendar=function(){var i=this.createElement("div",{className:"e-calendar-container"});if(this.isMobile){t.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("."+se+" .e-prev"),a=this.calendarElement.querySelector("."+se+" .e-next");t.remove(this.calendarElement.querySelector("."+se+" ."+re)),this.calendarElement.querySelector("."+se+" ."+ae).appendChild(a),this.calendarElement.querySelector("."+se+" ."+ae).appendChild(s),t.prepend([s],this.calendarElement.querySelector("."+se+" ."+ae)),this.deviceCalendar=this.calendarElement,i.appendChild(this.calendarElement),this.headerTitleElement=this.calendarElement.querySelector(".e-calendar .e-header ."+ne)}else{this.selectStartMonth(),this.renderCalendar(),this.leftCalCurrentDate=new Date(+this.currentDate),this.calendarElement.classList.add(z),this.leftCalPrevIcon=this.calendarElement.querySelector("."+z+" .e-prev"),this.leftCalNextIcon=this.calendarElement.querySelector("."+z+" .e-next"),this.leftTitle=this.calendarElement.querySelector("."+z+" ."+ne),t.remove(this.calendarElement.querySelector("."+z+" ."+re)),this.calendarElement.querySelector("."+z+" ."+ae).appendChild(this.leftCalNextIcon),this.calendarElement.querySelector("."+z+" ."+ae).appendChild(this.leftCalPrevIcon),t.prepend([this.leftCalPrevIcon],this.calendarElement.querySelector("."+z+" ."+ae)),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),i.appendChild(n),this.isMobile||t.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),t.addClass([this.calendarElement],q),this.rightCalendar=this.calendarElement,t.removeClass([this.leftCalendar&&this.leftCalendar.querySelector(".e-content tbody")],"e-zoomin"),t.removeClass([this.rightCalendar&&this.rightCalendar.querySelector(".e-content tbody")],"e-zoomin"),this.rightCalPrevIcon=this.calendarElement.querySelector("."+q+" .e-prev"),this.rightCalNextIcon=this.calendarElement.querySelector("."+q+" .e-next"),this.rightTitle=this.calendarElement.querySelector("."+q+" ."+ne),t.remove(this.calendarElement.querySelector("."+q+" ."+re)),this.calendarElement.querySelector("table").setAttribute("tabindex","0"),this.calendarElement.querySelector("."+q+" ."+ae).appendChild(this.rightCalNextIcon),this.calendarElement.querySelector("."+q+" ."+ae).appendChild(this.rightCalPrevIcon),t.prepend([this.rightCalPrevIcon],this.calendarElement.querySelector("."+q+" ."+ae)),r.appendChild(this.rightCalendar),i.appendChild(r),this.isMobile||t.EventHandler.add(this.rightTitle,"click",this.rightNavTitle,this)}return i},r.prototype.leftNavTitle=function(e){this.isPopupOpen()&&(this.calendarElement=this.leftCalendar,this.calendarNavigation(e,this.calendarElement))},r.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()},r.prototype.rightNavTitle=function(e){this.isPopupOpen()&&(this.calendarElement=this.rightCalendar,this.calendarNavigation(e,this.calendarElement))},r.prototype.clickEventEmitter=function(e){this.isMobile||(t.closest(e.target,".e-calendar.e-left-calendar")?(this.calendarElement=this.leftCalendar,this.updateCalendarElement(this.leftCalendar)):(this.calendarElement=this.rightCalendar,this.updateCalendarElement(this.rightCalendar)))},r.prototype.currentView=function(){return e.prototype.currentView.call(this)},r.prototype.getCalendarView=function(e){return"Year"===e?"Year":"Decade"===e?"Decade":"Month"},r.prototype.navigatedEvent=function(i){if(this.trigger("navigated",this.navigatedArgs),!t.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||(!i||i.currentTarget.children[0].classList.contains("e-icons"))&&t.isNullOrUndefined(this.controlDown))(i&&!i.currentTarget.children[0].classList.contains("e-icons")||!t.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&&t.isNullOrUndefined(this.endValue)?"Month"===s&&this.startValue.getMonth()<this.rightCalCurrentDate.getMonth()&&this.startValue.getFullYear()<=this.rightCalCurrentDate.getFullYear()?e.prototype.navigateTo.call(this,s,new Date(+this.startValue)):"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):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()}}},r.prototype.createControl=function(){var e=this.createElement("div",{className:le}),i=this.createElement("div",{className:"e-range-header"});if(this.isMobile&&this.fullScreenMode){var s=this.createElement("div",{className:"e-model-header-wrapper"}),n=this.createElement("span",{className:"e-popup-close"});t.EventHandler.add(n,"mousedown touchstart",this.modelRangeCloseHandler,this);var r=this.createElement("span",{className:"e-apply"});t.EventHandler.add(r,"mousedown touchstart",this.applyFunction,this),s.appendChild(n),s.appendChild(r),i.appendChild(s)}var l=this.createRangeHeader();i.appendChild(l);var o=this.createElement("div",{className:de});t.attributes(o,{"aria-label":"Selected Days"}),o.textContent=this.l10n.getConstant("selectedDays"),i.appendChild(o);var h=this.createElement("div",{className:"e-separator"}),u=this.createCalendar();e.appendChild(i),e.appendChild(h),e.appendChild(u);var d=this.createElement("div",{className:"e-footer"}),p=this.createElement("button",{className:"e-cancel e-flat e-css"}),c=this.createElement("button");t.addClass([c],["e-apply","e-flat","e-primary","e-css"]),d.appendChild(c),d.appendChild(p);var m=!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue);if(this.cancelButton=new a.Button({content:this.l10n.getConstant("cancelText")},p),this.applyButton=new a.Button({content:this.l10n.getConstant("applyText"),disabled:!m},c),t.EventHandler.add(c,"click",this.applyFunction,this),t.EventHandler.add(p,"click",this.cancelFunction,this),this.popupWrapper.appendChild(e),!this.isMobile&&!t.isUndefined(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)){this.createPresets(),this.listRippleEffect(),t.addClass([e],"e-range-border"),t.addClass([this.popupWrapper],"e-preset-wrapper");this.popupWrapper.querySelector("."+oe).style.height=this.popupWrapper.querySelector("."+le).getBoundingClientRect().height+"px"}this.popupWrapper.appendChild(d),this.isMobile&&this.deviceHeaderUpdate(),this.renderPopup()},r.prototype.modelRangeCloseHandler=function(e){this.hide()},r.prototype.cancelFunction=function(e){document.activeElement!==this.inputElement&&(this.preventFocus=!0,this.inputElement.focus(),t.addClass([this.inputWrapper.container],[X])),e.preventDefault(),this.isKeyPopup&&(this.inputElement.focus(),this.isKeyPopup=!1),this.startValue=null,this.endValue=null,this.removeSelection(),this.hide(e)},r.prototype.deviceHeaderUpdate=function(){t.isNullOrUndefined(this.startValue)&&t.isNullOrUndefined(this.endValue)?(this.endButton.element.setAttribute("disabled",""),this.startButton.element.classList.add(_)):t.isNullOrUndefined(this.startValue)||this.startButton.element.classList.add(_)},r.prototype.applyFunction=function(e){var i=!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(),t.addClass([this.inputWrapper.container],[X])),"touchstart"!==e.type&&this.closeEventArgs&&!this.closeEventArgs.cancel&&e.preventDefault(),t.isNullOrUndefined(this.startValue)||t.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()||s.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||(i=!0),this.changeTrigger(e),this.hide(e||null),this.errorClass(),i=!0),t.closest(e.target,".e-input-group")||i||this.focusOut(),this.isMobile||(this.isKeyPopup=!1,this.isRangeIconClicked&&(this.inputWrapper.container.children[1].focus(),this.keyInputConfigs=t.extend(this.keyInputConfigs,this.keyConfigs),this.popupKeyboardModule=new t.KeyboardEvents(this.inputWrapper.container.children[1],{eventName:"keydown",keyConfigs:this.keyInputConfigs,keyAction:this.popupKeyActionHandle.bind(this)})))},r.prototype.onMouseClick=function(e,i){if("touchstart"!==e.type){var s=i||e.target,a=t.closest(s,"."+ve),n=a&&a.classList.contains(_);a&&a.classList.contains(ve)&&this.setListSelection(a,e),this.preventFocus=!0,this.inputElement.focus(),this.isMobile||(this.preventFocus=!0,a&&a.classList.contains(ve)&&"custom_range"===a.getAttribute("id")?this.leftCalendar.children[1].firstElementChild.focus():n||"keydown"!==e.type||this.inputElement.focus())}},r.prototype.onMouseOver=function(e){var i=t.closest(e.target,"."+ve);i&&i.classList.contains(ve)&&!i.classList.contains(ye)&&t.addClass([i],ye)},r.prototype.onMouseLeave=function(e){var i=t.closest(e.target,"."+ye);t.isNullOrUndefined(i)||t.removeClass([i],ye)},r.prototype.setListSelection=function(e,i){if(e&&(!e.classList.contains(_)||this.isMobile&&e.classList.contains(_))){if(this.isMobile&&e.classList.contains(_)){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),t.addClass([e],_),e.setAttribute("aria-selected","true");var s=this.presetsItem[this.activeIndex];"custom_range"===s.id?this.renderCustomPopup():this.applyPresetRange(s,i)}},r.prototype.removeListSelection=function(){var e=this.presetElement.querySelector("."+_);t.isNullOrUndefined(e)||(t.removeClass([e],_),e.removeAttribute("aria-selected"))},r.prototype.setValue=function(){this.modelValue=[this.startValue,this.endValue]},r.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())},r.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()},r.prototype.renderCustomPopup=function(){this.isCustomWindow=!0,this.popupObj.hide(),this.popupWrapper=this.createElement("div",{id:this.element.id+"_popup",className:K+" e-popup"}),this.renderControl(),this.openEventArgs.appendTo.appendChild(this.popupWrapper),this.showPopup(),this.isCustomRange=!0,this.isMobile||this.calendarFocus()},r.prototype.listRippleEffect=function(){for(var e=0,i=this.liCollections;e<i.length;e++){var s=i[e];t.rippleEffect(s)}},r.prototype.createPresets=function(){if(!t.isUndefined(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)){this.presetElement=this.createElement("div",{className:oe,attrs:{tabindex:"0"}});var e=n.ListBase.createList(this.createElement,this.presetsItem,null,!0);t.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 i=this.presetElement.querySelector("#custom_range");if(t.isNullOrUndefined(i)||(i.textContent=""!==this.l10n.getConstant("customRange")?this.l10n.getConstant("customRange"):"Custom Range"),this.liCollections=this.presetElement.querySelectorAll("."+ve),this.wireListEvents(),this.isMobile)if(this.fullScreenMode){var s=t.createElement("div",{className:"e-range-mob-popup-wrap"}),a=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"});t.EventHandler.add(l,"mousedown touchstart",this.modelRangeCloseHandler,this);var o=this.presetElement;a.appendChild(l),a.appendChild(r),s.appendChild(a),s.appendChild(o),this.popupWrapper.insertBefore(s,this.popupWrapper.firstElementChild),this.presetElement.style.width="100%"}else this.presetElement.style.width=this.inputWrapper.container.getBoundingClientRect().width+"px";!t.isNullOrUndefined(this.activeIndex)&&this.activeIndex>-1&&t.addClass([this.liCollections[this.activeIndex]],_)}},r.prototype.wireListEvents=function(){t.EventHandler.add(this.presetElement,"click",this.onMouseClick,this),this.isMobile||(t.EventHandler.add(this.presetElement,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.presetElement,"mouseout",this.onMouseLeave,this))},r.prototype.unWireListEvents=function(){t.isNullOrUndefined(this.presetElement)||(t.EventHandler.remove(this.presetElement,"click touchstart",this.onMouseClick),this.isMobile||(t.EventHandler.remove(this.presetElement,"mouseover",this.onMouseOver),t.EventHandler.remove(this.presetElement,"mouseout",this.onMouseLeave)))},r.prototype.renderPopup=function(){var e=this;this.popupWrapper.classList.add("e-control");var s=this.popupWrapper.getBoundingClientRect().width;t.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 i.Popup(this.popupWrapper,{relateTo:this.isMobile&&this.isCustomWindow?document.body:t.isNullOrUndefined(this.targetElement)?this.inputWrapper.container:this.targetElement,position:this.isMobile?t.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:-s,offsetY:4,collision:this.isMobile?t.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 t.Touch(e.calendarElement.querySelector(".e-content.e-month"),{swipe:e.dateRangeSwipeHandler.bind(e)}),t.EventHandler.add(e.calendarElement.querySelector(".e-content.e-month"),"touchstart",e.touchStartRangeHandler,e))),t.attributes(e.inputElement,{"aria-expanded":"true","aria-owns":e.element.id,"aria-controls":e.inputElement.id}),e.value?t.attributes(e.inputElement,{"aria-activedescendant":e.inputElement.id}):e.inputElement.removeAttribute("aria-activedescendant"),t.addClass([e.inputWrapper.buttons[0]],_),e.isMobile||(e.cancelButton&&(e.btnKeyboardModule=new t.KeyboardEvents(e.cancelButton.element,{eventName:"keydown",keyAction:e.popupKeyActionHandle.bind(e),keyConfigs:{tab:"tab",altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}}),e.btnKeyboardModule=new t.KeyboardEvents(e.applyButton.element,{eventName:"keydown",keyAction:e.popupKeyActionHandle.bind(e),keyConfigs:{altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}})),t.isNullOrUndefined(e.leftCalendar)||e.isRangeIconClicked||e.calendarFocus(),t.isNullOrUndefined(e.presetElement)||(e.keyInputConfigs=t.extend(e.keyInputConfigs,e.keyConfigs),e.presetKeyboardModule=new t.KeyboardEvents(e.presetElement,{eventName:"keydown",keyAction:e.presetKeyActionHandler.bind(e),keyConfigs:e.keyInputConfigs}),e.presetKeyboardModule=new t.KeyboardEvents(e.presetElement,{eventName:"keydown",keyAction:e.popupKeyActionHandle.bind(e),keyConfigs:{altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}}),t.isNullOrUndefined(e.leftCalendar)?(e.preventBlur=!0,e.presetElement.focus()):e.presetElement.setAttribute("tabindex","-1")),e.popupKeyBoardHandler()),e.isMobile&&!t.Browser.isDevice&&t.EventHandler.add(document,"keydown",e.popupCloseHandler,e)},close:function(){t.attributes(e.inputElement,{"aria-expanded":"false"}),e.inputElement.removeAttribute("aria-owns"),e.inputElement.removeAttribute("aria-controls"),e.inputElement.removeAttribute("aria-activedescendant"),t.removeClass([e.inputWrapper.buttons[0]],_),e.isRangeIconClicked&&e.inputWrapper.container.children[1].focus(),t.isUndefined(e.presets[0].start&&e.presets[0].end&&e.presets[0].label)||e.unWireListEvents(),t.isNullOrUndefined(e.popupObj)||(t.isNullOrUndefined(e.popupObj.element.parentElement)||t.detach(e.popupObj.element),e.popupObj.destroy(),e.popupObj=null),e.isMobile&&!t.Browser.isDevice&&t.EventHandler.remove(document,"keydown",e.popupCloseHandler)},targetExitViewport:function(){var i=e.popupObj&&e.popupObj.element;!t.Browser.isDevice&&i&&i.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&&(t.addClass([this.modal],["e-device",K,"e-range-modal"]),document.body.className+=" "+ge,this.modal.style.display="block"),t.EventHandler.add(document,"mousedown touchstart",this.documentHandler,this)},r.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)},r.prototype.touchStartRangeHandler=function(e){this.touchRangeStart=!0},r.prototype.popupCloseHandler=function(e){switch(e.keyCode){case 27:this.hide(e)}},r.prototype.calendarFocus=function(){var e=this.popupObj&&this.popupObj.element.querySelector("."+G);if(e){var i=t.closest(e,"."+q);i=t.isNullOrUndefined(i)?this.leftCalendar:i,this.isRangeIconClicked?this.inputWrapper.container.focus():(this.preventBlur=!0,i.children[1].firstElementChild.focus()),t.addClass([e],he)}else this.isRangeIconClicked?this.inputWrapper.container.focus():(this.preventBlur=!0,this.leftCalendar.children[1].firstElementChild.focus())},r.prototype.presetHeight=function(){var e=this.popupObj&&this.popupObj.element.querySelector("."+oe),i=this.popupObj&&this.popupObj.element.querySelector("."+le);t.isNullOrUndefined(e)||t.isNullOrUndefined(i)||(e.style.height=i.getBoundingClientRect().height+"px")},r.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 i=this.getHoverLI(),s=this.getActiveLI();if(!t.isNullOrUndefined(this.leftCalendar)&&!t.isNullOrUndefined(s)&&(t.isNullOrUndefined(i)||!t.isNullOrUndefined(s)&&s===i)){this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(s);if("custom_range"===this.presetsItem[this.activeIndex].id)return this.calendarFocus(),s.classList.remove(ye),void e.preventDefault()}t.isNullOrUndefined(i)&&t.isNullOrUndefined(s)||this.onMouseClick(e,i||s),e.preventDefault();break;case"tab":if(this.leftCalendar){var a=this.getHoverLI();t.isNullOrUndefined(a)||a.classList.remove(ye)}else this.hide(e),e.preventDefault()}},r.prototype.listMoveDown=function(e){var i=this.getHoverLI(),s=this.getActiveLI();if(t.isNullOrUndefined(i))if(t.isNullOrUndefined(s))t.addClass([this.liCollections[0]],ye);else{a=s.nextElementSibling;!t.isNullOrUndefined(a)&&a.classList.contains(ve)&&t.addClass([a],ye)}else{var a=i.nextElementSibling;!t.isNullOrUndefined(a)&&a.classList.contains(ve)&&(t.removeClass([i],ye),t.addClass([a],ye))}},r.prototype.listMoveUp=function(e){var i=this.getHoverLI(),s=this.getActiveLI();if(t.isNullOrUndefined(i)){if(!t.isNullOrUndefined(s)){a=s.previousElementSibling;!t.isNullOrUndefined(a)&&a.classList.contains(ve)&&t.addClass([a],ye)}}else{var a=i.previousElementSibling;!t.isNullOrUndefined(a)&&a.classList.contains(ve)&&(t.removeClass([i],ye),t.addClass([a],ye))}},r.prototype.getHoverLI=function(){return this.presetElement.querySelector("."+ye)},r.prototype.getActiveLI=function(){return this.presetElement.querySelector("."+_)},r.prototype.popupKeyBoardHandler=function(){this.popupKeyboardModule=new t.KeyboardEvents(this.popupWrapper,{eventName:"keydown",keyAction:this.popupKeyActionHandle.bind(this),keyConfigs:{escape:"escape"}}),this.keyInputConfigs=t.extend(this.keyInputConfigs,this.keyConfigs),this.popupKeyboardModule=new t.KeyboardEvents(this.inputWrapper.container.children[1],{eventName:"keydown",keyAction:this.popupKeyActionHandle.bind(this),keyConfigs:this.keyInputConfigs})},r.prototype.setScrollPosition=function(){var e=this.presetElement.getBoundingClientRect().height,i=this.presetElement.querySelector("."+ye),s=this.presetElement.querySelector("."+_),a=t.isNullOrUndefined(i)?s:i;if(!t.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}},r.prototype.popupKeyActionHandle=function(e){var i=t.closest(e.target,"."+oe);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":t.isNullOrUndefined(i)?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":t.isNullOrUndefined(i)?document.activeElement===this.applyButton.element&&!0!==this.applyButton.element.disabled?this.cancelButton.element.focus():t.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()}},r.prototype.documentHandler=function(e){if(!t.isNullOrUndefined(this.popupObj)){var i=e.target;this.inputWrapper.container.contains(i)&&(t.isNullOrUndefined(this.popupObj)||t.closest(i,'[id="'+this.popupWrapper.id+'"]')||"mousedown"===e.type)||"touchstart"!==e.type&&("mousedown"===e.type||this.closeEventArgs&&!this.closeEventArgs.cancel)&&e.preventDefault(),!t.isNullOrUndefined(this.targetElement)&&(t.isNullOrUndefined(this.targetElement)||i===this.targetElement)||t.closest(i,'[id="'+this.popupWrapper.id+'"]')||t.closest(i,".e-input-group")===this.inputWrapper.container||t.closest(i,".e-daterangepicker.e-popup")&&!i.classList.contains("e-day")||i.classList.contains("e-dlg-overlay")||(this.preventBlur=!1,this.isPopupOpen()&&document.body.contains(this.popupObj.element)&&(this.applyFunction(e),this.isMobile||(this.isRangeIconClicked=!1)))}},r.prototype.createInput=function(){this.fullScreenMode&&this.isMobile&&(this.cssClass+=" e-popup-expand");var e=this.cssClass;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),this.inputWrapper=s.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),t.attributes(this.inputElement,{tabindex:"0","aria-expanded":"false",role:"combobox",autocomplete:"off","aria-disabled":this.enabled?"false":"true",autocorrect:"off",autocapitalize:"off",spellcheck:"false"}),s.Input.addAttributes({"aria-label":"select",role:"button"},this.inputWrapper.buttons[0]),this.setEleWidth(this.width),t.addClass([this.inputWrapper.container],"e-date-range-wrapper"),t.isNullOrUndefined(this.inputElement.getAttribute("name"))&&t.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},r.prototype.setEleWidth=function(e){this.inputWrapper.container.style.width="string"==typeof e?this.width:"number"==typeof e?t.formatUnit(this.width):"100%"},r.prototype.adjustLongHeaderWidth=function(){"Wide"===this.dayHeaderFormat&&t.addClass([this.popupWrapper],"e-daterange-day-header-lg")},r.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(),t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)||e||t.isNullOrUndefined(this.renderDayCellArgs)||!this.renderDayCellArgs.isDisabled||this.disabledDateRender(),this.errorClass(),this.previousStartValue=t.isNullOrUndefined(this.startValue)||isNaN(+this.startValue)?null:new Date(+this.startValue),this.previousEndValue=t.isNullOrUndefined(this.endValue)||isNaN(+this.endValue)?null:new Date(+this.endValue)},r.prototype.updateInput=function(){if(!t.isNullOrUndefined(this.endValue)&&!t.isNullOrUndefined(this.startValue)){var e={format:this.formatString,type:"date",skeleton:"yMd"},i=this.globalize.formatDate(this.startValue,e),a=this.globalize.formatDate(this.endValue,e);s.Input.setValue(i+" "+this.separator+" "+a,this.inputElement,this.floatLabelType,this.showClearButton),this.previousStartValue=new Date(+this.startValue),this.previousEndValue=new Date(+this.endValue)}!this.strictMode&&t.isNullOrUndefined(this.value)&&this.invalidValueString&&s.Input.setValue(this.invalidValueString,this.inputElement,this.floatLabelType,this.showClearButton)},r.prototype.checkInvalidRange=function(e){if(!t.isNullOrUndefined(e)){var i=!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]):(i=!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:t.isNullOrUndefined(s)||(u=!0):n=this.getstringvalue(s),a instanceof Date||"object"==typeof a?a instanceof Date?h=!0:t.isNullOrUndefined(a)||(u=!0):r=this.getstringvalue(a);(t.isNullOrUndefined(n)&&!o&&!t.isNullOrUndefined(r)||!t.isNullOrUndefined(n)&&!h&&t.isNullOrUndefined(r))&&(i=!0),u&&(n=r=l=null,i=!0),n&&(i=i||this.checkInvalidValue(n)),r&&(i=i||this.checkInvalidValue(r)),i&&(o&&!u&&(n=s.toLocaleDateString()),h&&!u&&(r=a.toLocaleDateString()),t.isNullOrUndefined(n)||t.isNullOrUndefined(r)?t.isNullOrUndefined(n)?t.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)}},r.prototype.getstringvalue=function(e){var i=null;return t.isNullOrUndefined(e)||"number"!=typeof e?t.isNullOrUndefined(e)||"string"!=typeof e||(i=""+e):i=e.toString(),i},r.prototype.checkInvalidValue=function(e){var i=e,s=!1,a=null;if(a={format:this.formatString,type:"date",skeleton:"yMd"},"string"!=typeof i)s=!0;else{var n=new t.Internationalization(this.locale);if(!this.checkDateValue(n.parseDate(i,a))){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(i)&&!r.test(i)||/^[a-zA-Z0-9- ]*$/.test(i)||isNaN(+new Date(this.checkValue(i))))&&(s=!0)}}return s},r.prototype.isDateDisabled=function(e){if(t.isNullOrUndefined(e))return!1;var i=new Date(+e);if(+i<+this.min||+i>+this.max)return!0;this.virtualRenderCellArgs={date:i,isDisabled:!1};var s=this.virtualRenderCellArgs;return this.virtualRenderCellEvent(s),!!s.isDisabled},r.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},r.prototype.virtualRenderCellEvent=function(e){t.extend(this.virtualRenderCellArgs,{name:"renderDayCell"}),this.trigger("renderDayCell",e)},r.prototype.disabledDates=function(){var e=!1,i=!1;return t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)||(e=this.isDateDisabled(this.startValue),i=this.isDateDisabled(this.endValue),this.isPopupOpen()||(this.currentDate=null),this.setValue()),e||i},r.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()},r.prototype.dispatchEvent=function(e,t){var i=document.createEvent("HTMLEvents");i.initEvent(t,!1,!0),e.dispatchEvent(i),this.firstHiddenChild.dispatchEvent(i)},r.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)},r.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])}},r.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)},r.prototype.focusIn=function(){document.activeElement!==this.inputElement&&this.enabled&&(t.addClass([this.inputWrapper.container],[X]),this.inputElement.focus())},r.prototype.focusOut=function(){var e=this.preventBlur;document.activeElement===this.inputElement&&(t.removeClass([this.inputWrapper.container],[X]),this.preventBlur=!1,this.inputElement.blur(),this.preventBlur=e)},r.prototype.destroy=function(){this.unBindEvents(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),this.hide(null);var i={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&&(t.removeClass([this.inputElement],[K]),t.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),s.Input.removeAttributes(i,this.inputElement),t.isNullOrUndefined(this.cloneElement.getAttribute("tabindex"))?this.inputElement.removeAttribute("tabindex"):this.inputElement.setAttribute("tabindex",this.tabIndex),this.ensureInputAttribute(),this.inputElement.classList.remove("e-input"),t.isNullOrUndefined(this.inputWrapper)||(t.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler),null===this.angularTag&&this.inputWrapper.container.parentElement.appendChild(this.inputElement),t.detach(this.inputWrapper.container))),t.isNullOrUndefined(this.inputKeyboardModule)||this.isMobile||this.inputKeyboardModule.destroy(),this.popupObj&&(this.isMobile||this.clearCalendarEvents()),s.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&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler),t.isNullOrUndefined(this.firstHiddenChild)||t.isNullOrUndefined(this.secondHiddenChild)||(t.detach(this.firstHiddenChild),t.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},r.prototype.ensureInputAttribute=function(){for(var e=[],i=0;i<this.inputElement.attributes.length;i++)e[i]=this.inputElement.attributes[i].name;for(i=0;i<e.length;i++)t.isNullOrUndefined(this.cloneElement.getAttribute(e[i]))?("value"===e[i].toLowerCase()&&(this.inputElement.value=""),this.inputElement.removeAttribute(e[i])):("value"===e[i].toLowerCase()&&(this.inputElement.value=this.cloneElement.getAttribute(e[i])),this.inputElement.setAttribute(e[i],this.cloneElement.getAttribute(e[i])))},r.prototype.getModuleName=function(){return"daterangepicker"},r.prototype.getPersistData=function(){return this.addOnPersist(["startDate","endDate","value"])},r.prototype.getSelectedRange=function(){var e;return t.isNullOrUndefined(this.startValue)||t.isNullOrUndefined(this.endValue)?e=0:(e=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1,!t.isNullOrUndefined(this.renderDayCellArgs)&&this.renderDayCellArgs.isDisabled&&this.disabledDateRender(),t.isNullOrUndefined(this.disabledDayCnt)||(e-=this.disabledDayCnt,this.disabledDayCnt=null)),{startDate:this.startValue,endDate:this.endValue,daySpan:e}},r.prototype.show=function(i,s){var a=this;if(this.isMobile&&this.popupObj&&this.popupObj.refreshPosition(),!(this.enabled&&this.readonly||!this.enabled||this.popupObj||this.isPopupOpen())){i&&(this.targetElement=i),this.createPopup(),(this.isMobile||t.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||t.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(i,s);var r=!a.isCustomRange||a.isMobile&&a.isCustomRange;!t.isUndefined(a.presets[0].start&&a.presets[0].end&&a.presets[0].label)&&r&&a.setScrollPosition(),a.checkMinMaxDays(),a.isMobile&&!t.isNullOrUndefined(a.startDate)&&t.isNullOrUndefined(a.endDate)&&(a.endButton.element.classList.add(_),a.startButton.element.classList.remove(_),a.endButton.element.removeAttribute("disabled"),a.selectableDates()),e.prototype.setOverlayIndex.call(a,a.mobileRangePopupWrap,a.popupObj.element,a.modal,a.isMobile||t.Browser.isDevice)}}),t.Browser.isDevice){var r=this.createElement("div",{className:"e-dlg-overlay"});r.style.zIndex=(this.zIndex-1).toString(),this.mobileRangePopupWrap.appendChild(r)}}},r.prototype.hide=function(e){var i=this;if(this.popupObj){if(t.isNullOrUndefined(this.previousEndValue)&&t.isNullOrUndefined(this.previousStartValue)?this.clearRange():(t.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))),t.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){i.closeEventArgs=e,i.closeEventArgs.cancel?t.removeClass([i.inputWrapper.buttons[0]],_):(i.isMobile&&(t.isNullOrUndefined(i.startButton)||t.isNullOrUndefined(i.endButton)||(t.EventHandler.remove(i.startButton.element,"click touchstart",i.deviceHeaderClick),t.EventHandler.remove(i.endButton.element,"click touchstart",i.deviceHeaderClick))),i.popupObj&&(i.popupObj.hide(),i.preventBlur&&(i.inputElement.focus(),t.addClass([i.inputWrapper.container],[X]))),i.isMobile||(t.isNullOrUndefined(i.leftKeyboardModule)||t.isNullOrUndefined(i.rightKeyboardModule)||(i.leftKeyboardModule.destroy(),i.rightKeyboardModule.destroy()),t.isNullOrUndefined(i.presetElement)||i.presetKeyboardModule.destroy(),t.isNullOrUndefined(i.cancelButton)||i.btnKeyboardModule.destroy()),i.targetElement=null,t.removeClass([document.body],ge),t.EventHandler.remove(document,"mousedown touchstart",i.documentHandler),i.isMobile&&i.modal&&(i.modal.style.display="none",i.modal.outerHTML="",i.modal=null),(i.isMobile||t.Browser.isDevice)&&(t.isNullOrUndefined(i.mobileRangePopupWrap)||(i.mobileRangePopupWrap.remove(),i.mobileRangePopupWrap=null)),i.isKeyPopup=i.dateDisabled=!1),i.updateClearIconState(),i.updateHiddenInput(),i.isMobile&&i.allowEdit&&!i.readonly&&i.inputElement.removeAttribute("readonly")})}}else this.updateClearIconState(),this.updateHiddenInput(),this.isMobile&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly")},r.prototype.setLocale=function(){this.globalize=new t.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.dateRangeOptions&&null==this.dateRangeOptions.placeholder&&(this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),s.Input.setPlaceholder(this.placeholder,this.inputElement)),this.updateInput(),this.updateHiddenInput(),this.changeTrigger()},r.prototype.refreshChange=function(){this.checkView(),this.refreshControl(),this.changeTrigger()},r.prototype.setDate=function(){s.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.refreshChange()},r.prototype.enableInput=function(){+this.min<=+this.max&&(this.setProperties({enabled:!0},!0),s.Input.setEnabled(this.enabled,this.inputElement),this.element.hasAttribute("disabled")&&this.bindEvents())},r.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()},r.prototype.createHiddenInput=function(){t.isNullOrUndefined(this.firstHiddenChild)&&t.isNullOrUndefined(this.secondHiddenChild)&&(this.firstHiddenChild=this.createElement("input"),this.secondHiddenChild=this.createElement("input")),t.isNullOrUndefined(this.inputElement.getAttribute("name"))||(this.inputElement.setAttribute("data-name",this.inputElement.getAttribute("name")),this.inputElement.removeAttribute("name")),t.attributes(this.firstHiddenChild,{type:"text",name:this.inputElement.getAttribute("data-name"),class:De}),t.attributes(this.secondHiddenChild,{type:"text",name:this.inputElement.getAttribute("data-name"),class:De});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)},r.prototype.setMinMaxDays=function(){this.isPopupOpen()&&(this.removeClassDisabled(),this.checkMinMaxDays(),this.isMobile&&this.selectableDates(),!this.strictMode&&t.isNullOrUndefined(this.startValue)&&t.isNullOrUndefined(this.endValue)?this.removeSelection():this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar]),this.updateHeader())},r.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)},r.prototype.onPropertyChanged=function(e,i){for(var a={format:this.formatString,type:"date",skeleton:"yMd"},n=0,r=Object.keys(e);n<r.length;n++){var l=r[n];switch(["maxDays","minDays","value"].indexOf(l)<0&&this.hide(null),l){case"width":this.setEleWidth(this.width),s.Input.calculateWidth(this.inputElement,this.inputWrapper.container),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.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":s.Input.setPlaceholder(e.placeholder,this.inputElement),this.setProperties({placeholder:e.placeholder},!0);break;case"readonly":s.Input.setReadonly(this.readonly,this.inputElement),this.setRangeAllowEdit();break;case"cssClass":this.updateCssClass(e.cssClass,i.cssClass);break;case"enabled":this.setProperties({enabled:e.enabled},!0),s.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),s.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 t.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.dateRangeOptions&&null==this.dateRangeOptions.placeholder&&(this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),s.Input.setPlaceholder(this.placeholder,this.inputElement)),this.setLocale();break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.setDataAttribute(!0),this.checkHtmlAttributes(!0);break;case"showClearButton":s.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,i);else{var o=e.value.split(" "+this.separator+" ");this.value=[new Date(o[0]),new Date(o[1])],this.updateValue(),this.setDate()}else!t.isNullOrUndefined(e.value)&&e.value.length>0||!t.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,i):null!==e.value[1]&&null!==e.value.start||this.clearModelvalue(e,i):+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())):(t.isNullOrUndefined(this.value)||null==e.value.start)&&(this.valueType=e.value,this.startValue=null,this.endValue=null,this.clearModelvalue(e,i));if(this.isPopupOpen()){if(t.isNullOrUndefined(this.startValue)&&t.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,s.Input.removeFloating(this.inputWrapper),s.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.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()}}},Y([t.Property(null)],r.prototype,"value",void 0),Y([t.Property(!1)],r.prototype,"enablePersistence",void 0),Y([t.Property(new Date(1900,0,1))],r.prototype,"min",void 0),Y([t.Property(new Date(2099,11,31))],r.prototype,"max",void 0),Y([t.Property(null)],r.prototype,"locale",void 0),Y([t.Property(null)],r.prototype,"firstDayOfWeek",void 0),Y([t.Property(!1)],r.prototype,"weekNumber",void 0),Y([t.Property("Gregorian")],r.prototype,"calendarMode",void 0),Y([t.Property(!1)],r.prototype,"openOnFocus",void 0),Y([t.Property(!1)],r.prototype,"fullScreenMode",void 0),Y([t.Event()],r.prototype,"created",void 0),Y([t.Event()],r.prototype,"destroyed",void 0),Y([t.Event()],r.prototype,"change",void 0),Y([t.Event()],r.prototype,"cleared",void 0),Y([t.Event()],r.prototype,"navigated",void 0),Y([t.Event()],r.prototype,"renderDayCell",void 0),Y([t.Property(null)],r.prototype,"startDate",void 0),Y([t.Property(null)],r.prototype,"endDate",void 0),Y([t.Collection([{}],Ce)],r.prototype,"presets",void 0),Y([t.Property("")],r.prototype,"width",void 0),Y([t.Property(1e3)],r.prototype,"zIndex",void 0),Y([t.Property(!0)],r.prototype,"showClearButton",void 0),Y([t.Property(!0)],r.prototype,"showTodayButton",void 0),Y([t.Property("Month")],r.prototype,"start",void 0),Y([t.Property("Month")],r.prototype,"depth",void 0),Y([t.Property("")],r.prototype,"cssClass",void 0),Y([t.Property("-")],r.prototype,"separator",void 0),Y([t.Property(null)],r.prototype,"minDays",void 0),Y([t.Property(null)],r.prototype,"maxDays",void 0),Y([t.Property(!1)],r.prototype,"strictMode",void 0),Y([t.Property(null)],r.prototype,"keyConfigs",void 0),Y([t.Property(null)],r.prototype,"format",void 0),Y([t.Property(!0)],r.prototype,"enabled",void 0),Y([t.Property(!1)],r.prototype,"readonly",void 0),Y([t.Property(!0)],r.prototype,"allowEdit",void 0),Y([t.Property("Never")],r.prototype,"floatLabelType",void 0),Y([t.Property(null)],r.prototype,"placeholder",void 0),Y([t.Property({})],r.prototype,"htmlAttributes",void 0),Y([t.Event()],r.prototype,"open",void 0),Y([t.Event()],r.prototype,"close",void 0),Y([t.Event()],r.prototype,"select",void 0),Y([t.Event()],r.prototype,"focus",void 0),Y([t.Event()],r.prototype,"blur",void 0),r=Y([t.NotifyPropertyChanges],r)}(k),Me=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)}}(),we=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},Ve=(new Date).getDate(),Ne=(new Date).getMonth(),Oe=(new Date).getFullYear(),Ie="e-timepicker",Te="e-active",xe="e-navigation",Se="e-disabled",Pe="e-input-focus",Ae="e-list-item",Ue="e-non-edit",He=["title","class","style"];!function(t){(e.TimePickerBase||(e.TimePickerBase={})).createListItems=function(e,t,i,s,a,r){this.calendarMode;var l,o=6e4*r,h=[],u=[];l=+t.setMilliseconds(0);for(var d=+i.setMilliseconds(0);d>=l;)u.push(l),h.push(s.formatDate(new Date(l),{format:a,type:"time"})),l+=o;return{collection:u,list:n.ListBase.createList(e,h,null,!0)}}}();var We=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Me(i,e),we([t.Property("day")],i.prototype,"day",void 0),we([t.Property("month")],i.prototype,"month",void 0),we([t.Property("year")],i.prototype,"year",void 0),we([t.Property("day of the week")],i.prototype,"dayOfTheWeek",void 0),we([t.Property("hour")],i.prototype,"hour",void 0),we([t.Property("minute")],i.prototype,"minute",void 0),we([t.Property("second")],i.prototype,"second",void 0),i}(t.ChildProperty),Le=function(e){function a(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 Me(a,e),a.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),t.removeClass([this.cloneElement],[Ie,"e-control","e-lib"]),this.inputElement=this.element,this.angularTag=null,this.formElement=t.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}},a.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),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.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"),!t.isNullOrUndefined(t.closest(this.element,"fieldset"))&&t.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete()},a.prototype.setTimeZone=function(){if(!t.isNullOrUndefined(this.serverTimezoneOffset)&&this.value){var e=(new Date).getTimezoneOffset()/60,i=this.serverTimezoneOffset+e;i=this.isDayLightSaving()?i--:i,this.value=new Date(this.value.getTime()+60*i*60*1e3)}},a.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)},a.prototype.setTimeAllowEdit=function(){this.allowEdit?this.readonly||this.inputElement.removeAttribute("readonly"):t.attributes(this.inputElement,{readonly:""}),this.clearIconState()},a.prototype.clearIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&t.removeClass([this.inputWrapper.container],[Ue]):""===this.inputElement.value?t.removeClass([this.inputWrapper.container],[Ue]):t.addClass([this.inputWrapper.container],[Ue])},a.prototype.validateDisable=function(){this.setMinMax(this.initMin,this.initMax),t.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))},a.prototype.validationAttribute=function(e,i){var s=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id");i.setAttribute("name",s),e.removeAttribute("name");for(var a=["required","aria-required","form"],n=0;n<a.length;n++)if(!t.isNullOrUndefined(e.getAttribute(a[n]))){var r=e.getAttribute(a[n]);i.setAttribute(a[n],r),e.removeAttribute(a[n])}},a.prototype.initialize=function(){this.globalize=new t.Internationalization(this.locale),this.defaultCulture=new t.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 t.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,t.isNullOrUndefined(this.element.getAttribute("id"))?(this.element.id=t.getUniqueID("ej2_timepicker"),null!==this.angularTag&&t.attributes(this.inputElement,{id:this.element.id+"_input"})):null!==this.angularTag&&(this.inputElement.id=this.element.getAttribute("id")+"_input"),t.isNullOrUndefined(this.inputElement.getAttribute("name"))&&t.attributes(this.inputElement,{name:this.element.id}),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"})},a.prototype.checkTimeFormat=function(){if(this.format)if("string"==typeof this.format)this.formatString=this.format;else if(t.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},a.prototype.checkDateValue=function(e){return!t.isNullOrUndefined(e)&&e instanceof Date&&!isNaN(+e)?e:null},a.prototype.createInputElement=function(){this.fullScreenMode&&t.Browser.isDevice&&(this.cssClass+=" e-popup-expand");var e=this.cssClass,i=!this.enableMask;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),this.inputWrapper=s.Input.createInput({element:this.inputElement,bindClearAction:i,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),t.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)||s.Input.addAttributes({style:this.inputStyle},this.inputElement),t.addClass([this.inputWrapper.container],"e-time-wrapper")},a.prototype.getCldrDateTimeFormat=function(){var e=new t.Internationalization(this.locale).getDatePattern({skeleton:"yMd"});return this.isNullOrEmpty(this.formatString)?e+" "+this.cldrFormat("time"):this.formatString},a.prototype.checkInvalidValue=function(e){var i=!1;if("object"!=typeof e&&!t.isNullOrUndefined(e)){var s=e;"string"==typeof s&&(s=s.trim());var a=null,n=null;if("number"==typeof e?s=e.toString():"string"==typeof e&&(/^[a-zA-Z0-9- ]*$/.test(e)||(a=this.setCurrentDate(this.getDateObject(e)),t.isNullOrUndefined(a)&&(a=this.checkDateValue(this.globalize.parseDate(s,{format:this.getCldrDateTimeFormat(),type:"datetime"})),t.isNullOrUndefined(a)&&(a=this.checkDateValue(this.globalize.parseDate(s,{format:this.formatString,type:"dateTime",skeleton:"yMd"})))))),n=this.globalize.parseDate(s,{format:this.getCldrDateTimeFormat(),type:"datetime"}),a=!t.isNullOrUndefined(n)&&n instanceof Date&&!isNaN(+n)?n:null,t.isNullOrUndefined(a)&&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))?i=!0:a=new Date(""+s)}i?(this.strictMode||(this.invalidValueString=s),this.setProperties({value:null},!0),this.initValue=null):(this.setProperties({value:a},!0),this.initValue=this.value)}},a.prototype.requiredModules=function(){var e=[];return this.enableMask&&e.push({args:[this],member:"MaskedDateTime"}),e},a.prototype.cldrFormat=function(e){return"en"===this.locale||"en-US"===this.locale?t.getValue("timeFormats.short",t.getDefaultDateObject()):this.getCultureTimeObject(t.cldrData,""+this.locale)},a.prototype.destroy=function(){this.hide(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),this.unBindEvents();this.inputElement&&(s.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),t.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"),t.isNullOrUndefined(this.cloneElement.getAttribute("disabled"))&&s.Input.setEnabled(!0,this.inputElement,this.floatLabelType)),this.inputWrapper.container&&t.detach(this.inputWrapper.container),this.inputWrapper=this.popupWrapper=this.cloneElement=void 0,this.liCollections=this.timeCollections=this.disableItemCollection=[],t.isNullOrUndefined(this.rippleFn)||this.rippleFn(),s.Input.destroy({element:this.inputElement,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),e.prototype.destroy.call(this),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler),this.rippleFn=null,this.openPopupEventArgs=null,this.selectedElement=null,this.listTag=null,this.liCollections=null},a.prototype.ensureInputAttribute=function(){for(var e=[],i=0;i<this.inputElement.attributes.length;i++)e[i]=this.inputElement.attributes[i].name;for(i=0;i<e.length;i++)t.isNullOrUndefined(this.cloneElement.getAttribute(e[i]))?(this.inputElement.removeAttribute(e[i]),"value"===e[i].toLowerCase()&&(this.inputElement.value="")):(this.inputElement.setAttribute(e[i],this.cloneElement.getAttribute(e[i])),"value"===e[i].toLowerCase()&&(this.inputElement.value=this.cloneElement.getAttribute(e[i])))},a.prototype.popupCreation=function(){this.popupWrapper=this.createElement("div",{className:Ie+" e-popup",attrs:{id:this.element.id+"_popup",style:"visibility:hidden"}}),this.popupWrapper.setAttribute("aria-label",this.element.id),this.popupWrapper.setAttribute("role","dialog"),t.isNullOrUndefined(this.cssClass)||(this.popupWrapper.className+=" "+this.cssClass),!t.isNullOrUndefined(this.step)&&this.step>0&&(this.generateList(),t.append([this.listWrapper],this.popupWrapper)),this.addSelection(),this.renderPopup(),t.detach(this.popupWrapper)},a.prototype.getPopupHeight=function(){var e=parseInt("240px",10),t=this.popupWrapper.getBoundingClientRect().height;return t>e?e:t},a.prototype.generateList=function(){this.createListItems(),this.wireListEvents();var e={duration:300,selector:"."+Ae};this.rippleFn=t.rippleEffect(this.listWrapper,e),this.liCollections=this.listWrapper.querySelectorAll("."+Ae)},a.prototype.renderPopup=function(){var e=this;if(this.containerStyle=this.inputWrapper.container.getBoundingClientRect(),this.popupObj=new i.Popup(this.popupWrapper,{width:this.setPopupWidth(this.width),zIndex:this.zIndex,targetType:"relative",position:t.Browser.isDevice?{X:"center",Y:"center"}:{X:"left",Y:"bottom"},collision:t.Browser.isDevice?{X:"fit",Y:"fit"}:{X:"flip",Y:"flip"},enableRtl:this.enableRtl,relateTo:t.Browser.isDevice?document.body:this.inputWrapper.container,offsetY:4,open:function(){e.popupWrapper.style.visibility="visible",t.addClass([e.inputWrapper.buttons[0]],Te)},close:function(){t.removeClass([e.inputWrapper.buttons[0]],Te),e.unWireListEvents(),e.inputElement.removeAttribute("aria-activedescendant"),t.remove(e.popupObj.element),e.popupObj.destroy(),e.popupWrapper.innerHTML="",e.listWrapper=e.popupWrapper=e.listTag=void 0},targetExitViewport:function(){t.Browser.isDevice||e.hide()}}),t.Browser.isDevice||(this.popupObj.collision={X:"none",Y:"flip"}),t.Browser.isDevice&&this.fullScreenMode?(this.popupObj.element.style.maxHeight="100%",this.popupObj.element.style.width="100%"):this.popupObj.element.style.maxHeight="240px",t.Browser.isDevice&&this.fullScreenMode){var s=this.createElement("div",{className:"e-model-header"}),a=this.createElement("span",{className:"e-model-title"});a.textContent="Select time";var n=this.createElement("span",{className:"e-popup-close"});t.EventHandler.add(n,"mousedown touchstart",this.timePopupCloseHandler,this),s.appendChild(n),s.appendChild(a),this.popupWrapper.insertBefore(s,this.popupWrapper.firstElementChild)}},a.prototype.timePopupCloseHandler=function(e){this.hide()},a.prototype.getFormattedValue=function(e){return t.isNullOrUndefined(this.checkDateValue(e))?null:this.globalize.formatDate(e,{skeleton:"medium",type:"time"})},a.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():Ve,a=i?this.initValue.getMonth():Ne,n=i?this.initValue.getFullYear():Oe;return new Date(n,a,s,t.getHours(),t.getMinutes(),t.getSeconds())}}return null},a.prototype.updateHtmlAttributeToWrapper=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if(He.indexOf(s)>-1)if("class"===s){var a=this.htmlAttributes[""+s].replace(/\s+/g," ").trim();""!==a&&t.addClass([this.inputWrapper.container],a.split(" "))}else if("style"===s){var n=this.inputWrapper.container.getAttribute(s);n=t.isNullOrUndefined(n)?this.htmlAttributes[""+s]:n+this.htmlAttributes[""+s],this.inputWrapper.container.setAttribute(s,n)}else this.inputWrapper.container.setAttribute(s,this.htmlAttributes[""+s])}},a.prototype.updateHtmlAttributeToElement=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];He.indexOf(s)<0&&this.inputElement.setAttribute(s,this.htmlAttributes[""+s])}},a.prototype.updateCssClass=function(e,i){t.isNullOrUndefined(i)||(i=i.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e)||(e=e.replace(/\s+/g," ").trim()),s.Input.setCssClass(e,[this.inputWrapper.container],i),this.popupWrapper&&s.Input.setCssClass(e,[this.popupWrapper],i)},a.prototype.removeErrorClass=function(){t.removeClass([this.inputWrapper.container],"e-error"),t.attributes(this.inputElement,{"aria-invalid":"false"})},a.prototype.checkErrorState=function(e){var i=this.getDateObject(e);this.validateState(i)&&!this.invalidValueString||this.enableMask&&this.inputElement.value===this.maskedDateValue?this.removeErrorClass():(t.addClass([this.inputWrapper.container],"e-error"),t.attributes(this.inputElement,{"aria-invalid":"true"}))},a.prototype.validateInterval=function(){!t.isNullOrUndefined(this.step)&&this.step>0?this.enableElement([this.inputWrapper.buttons[0]]):this.disableTimeIcon()},a.prototype.disableTimeIcon=function(){this.disableElement([this.inputWrapper.buttons[0]]),this.hide()},a.prototype.disableElement=function(e){t.addClass(e,Se)},a.prototype.enableElement=function(e){t.removeClass(e,Se)},a.prototype.selectInputText=function(){this.inputElement.setSelectionRange(0,this.inputElement.value.length)},a.prototype.setCursorToEnd=function(){this.inputElement.setSelectionRange(this.inputElement.value.length,this.inputElement.value.length)},a.prototype.getMeridianText=function(){var e;if("en"===this.locale||"en-US"===this.locale)e=t.getValue("dayPeriods.format.wide",t.getDefaultDateObject());else{e=t.getValue("main."+this.locale+".dates.calendars.gregorian.dayPeriods.format.abbreviated",t.cldrData)}return e},a.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)}},a.prototype.getActiveElement=function(){return t.isNullOrUndefined(this.popupWrapper)?null:this.popupWrapper.querySelectorAll("."+Te)},a.prototype.isNullOrEmpty=function(e){return!!(t.isNullOrUndefined(e)||"string"==typeof e&&""===e.trim())},a.prototype.setWidth=function(e){return e="number"==typeof e?t.formatUnit(e):"string"==typeof e?e.match(/px|%|em/)?e:t.formatUnit(e):"100%"},a.prototype.setPopupWidth=function(e){if((e=this.setWidth(e)).indexOf("%")>-1){e=(this.containerStyle.width*parseFloat(e)/100).toString()+"px"}return e},a.prototype.setScrollPosition=function(){var e=this.selectedElement;t.isNullOrUndefined(e)?this.popupWrapper&&this.checkDateValue(this.scrollTo)&&this.setScrollTo():this.findScrollTop(e)},a.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},a.prototype.setScrollTo=function(){var e;if(t.isNullOrUndefined(this.popupWrapper))this.popupWrapper.scrollTop=0;else{var i=this.popupWrapper.querySelectorAll("."+Ae);if(i.length){var s=this.timeCollections[0],a=this.getDateObject(this.checkDateValue(this.scrollTo)).getTime();e=i[Math.round((a-s)/(6e4*this.step))]}}t.isNullOrUndefined(e)?this.popupWrapper.scrollTop=0:this.findScrollTop(e)},a.prototype.getText=function(){return t.isNullOrUndefined(this.checkDateValue(this.value))?"":this.getValue(this.value)},a.prototype.getValue=function(e){return t.isNullOrUndefined(this.checkDateValue(e))?null:this.globalize.formatDate(e,{format:this.cldrTimeFormat(),type:"time"})},a.prototype.cldrDateFormat=function(){return"en"===this.locale||"en-US"===this.locale?t.getValue("dateFormats.short",t.getDefaultDateObject()):this.getCultureDateObject(t.cldrData,""+this.locale)},a.prototype.cldrTimeFormat=function(){return this.isNullOrEmpty(this.formatString)?"en"===this.locale||"en-US"===this.locale?t.getValue("timeFormats.short",t.getDefaultDateObject()):this.getCultureTimeObject(t.cldrData,""+this.locale):this.formatString},a.prototype.dateToNumeric=function(){return"en"===this.locale||"en-US"===this.locale?t.getValue("timeFormats.medium",t.getDefaultDateObject()):t.getValue("main."+this.locale+".dates.calendars.gregorian.timeFormats.medium",t.cldrData)},a.prototype.getExactDateTime=function(e){return t.isNullOrUndefined(this.checkDateValue(e))?null:this.globalize.formatDate(e,{format:this.dateToNumeric(),type:"time"})},a.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)},a.prototype.compareFormatChange=function(e){return t.isNullOrUndefined(e)?null:e!==this.getText()?this.getDateObject(e):this.getDateObject(this.value)},a.prototype.updatePlaceHolder=function(){s.Input.setPlaceholder(this.l10n.getConstant("placeholder"),this.inputElement)},a.prototype.updateInputValue=function(e){s.Input.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton)},a.prototype.preventEventBubbling=function(e){e.preventDefault(),this.interopAdaptor.invokeMethodAsync("OnTimeIconClick")},a.prototype.popupHandler=function(e){this.enabled&&(t.Browser.isDevice&&this.inputElement.setAttribute("readonly",""),e.preventDefault(),this.isPopupOpen()?this.closePopup(0,e):(this.inputElement.focus(),this.show(e)))},a.prototype.mouseDownHandler=function(){this.enabled&&(this.readonly||(this.inputElement.setSelectionRange(0,0),t.EventHandler.add(this.inputElement,"mouseup",this.mouseUpHandler,this)))},a.prototype.mouseUpHandler=function(e){if(!this.readonly){if(e.preventDefault(),this.enableMask)return e.preventDefault(),void this.notify("setMaskSelection",{module:"MaskedDateTime"});t.EventHandler.remove(this.inputElement,"mouseup",this.mouseUpHandler);var i=this.getCursorSelection();0===i.start&&i.end===this.inputElement.value.length||(this.inputElement.value.length>0&&(this.cursorDetails=this.focusSelection()),this.inputElement.setSelectionRange(this.cursorDetails.start,this.cursorDetails.end))}},a.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}},a.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}},a.prototype.onMouseClick=function(e){var i=e.target,s=this.selectedElement=t.closest(i,"."+Ae);this.setSelection(s,e),s&&s.classList.contains(Ae)&&this.hide()},a.prototype.closePopup=function(e,i){var s=this;if(this.isPopupOpen()&&this.popupWrapper){var a={popup:this.popupObj,event:i||null,cancel:!1,name:"open"};t.removeClass([document.body],"e-time-overflow"),this.trigger("close",a,function(i){if(!i.cancel){var a={name:"FadeOut",duration:50,delay:e||0};s.popupObj.hide(new t.Animation(a)),t.removeClass([s.inputWrapper.container],["e-icon-anim"]),t.attributes(s.inputElement,{"aria-expanded":"false"}),s.inputElement.removeAttribute("aria-owns"),s.inputElement.removeAttribute("aria-controls"),s.inputElement.removeAttribute("aria-activedescendant"),t.EventHandler.remove(document,"mousedown touchstart",s.documentClickHandler)}t.Browser.isDevice&&s.modal&&(s.modal.style.display="none",s.modal.outerHTML="",s.modal=null),t.Browser.isDevice&&(t.isNullOrUndefined(s.mobileTimePopupWrap)||(s.mobileTimePopupWrap.remove(),s.mobileTimePopupWrap=null)),t.Browser.isDevice&&s.allowEdit&&!s.readonly&&s.inputElement.removeAttribute("readonly")})}else t.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly")},a.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")},a.prototype.checkValueChange=function(e,i){if(this.strictMode||this.validateState(this.valueWithMinutes))if(i){var s=this.getDateObject(new Date(this.timeCollections[this.activeIndex]));+this.prevDate!=+s&&this.valueProcess(e,s)}else(this.prevValue!==this.inputElement.value||t.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)},a.prototype.onMouseOver=function(e){var i=t.closest(e.target,"."+Ae);this.setHover(i,"e-hover")},a.prototype.setHover=function(e,i){this.enabled&&this.isValidLI(e)&&!e.classList.contains(i)&&(this.removeHover(i),t.addClass([e],i),i===xe&&e.setAttribute("aria-selected","true"))},a.prototype.setSelection=function(e,i){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]),t.addClass([this.selectedElement],Te),this.selectedElement.setAttribute("aria-selected","true"),this.checkValueChange(i,!0))},a.prototype.onMouseLeave=function(){this.removeHover("e-hover")},a.prototype.scrollHandler=function(){"timepicker"===this.getModuleName()&&t.Browser.isDevice||this.hide()},a.prototype.setMinMax=function(e,i){t.isNullOrUndefined(this.checkDateValue(e))&&(this.initMin=this.getDateObject("12:00:00 AM")),t.isNullOrUndefined(this.checkDateValue(i))&&(this.initMax=this.getDateObject("11:59:59 PM"))},a.prototype.validateMinMax=function(e,i,s){var a=e instanceof Date?e:this.getDateObject(e);return t.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},a.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},a.prototype.validateState=function(e){if(!this.strictMode){if(!this.valueIsDisable(e))return!1;var i=this.setCurrentDate(this.getDateObject(e)),s=this.setCurrentDate(this.getDateObject(this.initMax)),a=this.setCurrentDate(this.getDateObject(this.initMin));if(t.isNullOrUndefined(this.checkDateValue(i))){if(+s<+a||""!==this.inputElement.value)return!1}else if(+i>+s||+i<+a)return!1}return!0},a.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},a.prototype.bindEvents=function(){t.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.popupHandler,this),t.EventHandler.add(this.inputElement,"blur",this.inputBlurHandler,this),t.EventHandler.add(this.inputElement,"focus",this.inputFocusHandler,this),t.EventHandler.add(this.inputElement,"change",this.inputChangeHandler,this),t.EventHandler.add(this.inputElement,"input",this.inputEventHandler,this),this.enableMask&&t.EventHandler.add(this.inputElement,"keydown",this.keydownHandler,this),this.showClearButton&&this.inputWrapper.clearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.clearHandler,this),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this),t.Browser.isDevice||(this.keyConfigure=t.extend(this.keyConfigure,this.keyConfigs),this.inputEvent=new t.KeyboardEvents(this.inputWrapper.container,{keyAction:this.inputHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}),this.showClearButton&&this.inputElement&&t.EventHandler.add(this.inputElement,"mousedown",this.mouseDownHandler,this))},a.prototype.keydownHandler=function(e){switch(e.code){case"Delete":!this.enableMask||this.popupObj||this.readonly||this.notify("keyDownHandler",{module:"MaskedDateTime",e:e})}},a.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)}},a.prototype.inputChangeHandler=function(e){this.enabled&&e.stopPropagation()},a.prototype.inputEventHandler=function(){this.enableMask&&this.notify("inputHandler",{module:"MaskedDateTime"})},a.prototype.unBindEvents=function(){this.inputWrapper&&t.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown touchstart",this.popupHandler),t.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),t.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),t.EventHandler.remove(this.inputElement,"change",this.inputChangeHandler),t.EventHandler.remove(this.inputElement,"input",this.inputEventHandler),this.inputEvent&&this.inputEvent.destroy(),t.EventHandler.remove(this.inputElement,"mousedown touchstart",this.mouseDownHandler),!this.showClearButton||t.isNullOrUndefined(this.inputWrapper)||t.isNullOrUndefined(this.inputWrapper.clearButton)||t.EventHandler.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.clearHandler),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},a.prototype.bindClearEvent=function(){this.showClearButton&&this.inputWrapper.clearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.clearHandler,this)},a.prototype.raiseClearedEvent=function(e){var t={event:e};this.trigger("cleared",t)},a.prototype.clearHandler=function(e){if(this.enabled&&(e.preventDefault(),t.isNullOrUndefined(this.value)?(this.resetState(),this.raiseClearedEvent(e)):this.clear(e),this.popupWrapper&&(this.popupWrapper.scrollTop=0),this.enableMask&&this.notify("clearHandler",{module:"MaskedDateTime"}),t.closest(this.element,"form"))){var i=this.element,s=document.createEvent("KeyboardEvent");s.initEvent("keyup",!1,!0),i.dispatchEvent(s)}},a.prototype.clear=function(e){this.setProperties({value:null},!0),this.initValue=null,this.resetState(),this.raiseClearedEvent(e),this.changeEvent(e)},a.prototype.setZIndex=function(){this.popupObj&&(this.popupObj.zIndex=this.zIndex,this.popupObj.dataBind())},a.prototype.checkAttributes=function(e){for(var i,s=0,a=e?t.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(!t.isNullOrUndefined(this.inputElement.getAttribute(n)))switch(n){case"disabled":if(t.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(t.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":(t.isNullOrUndefined(this.timeOptions)||void 0===this.timeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(n)},!e);break;case"min":(t.isNullOrUndefined(this.timeOptions)||void 0===this.timeOptions.min||e)&&(i=new Date(this.inputElement.getAttribute(n)),t.isNullOrUndefined(this.checkDateValue(i))||this.setProperties({min:i},!e));break;case"max":(t.isNullOrUndefined(this.timeOptions)||void 0===this.timeOptions.max||e)&&(i=new Date(this.inputElement.getAttribute(n)),t.isNullOrUndefined(this.checkDateValue(i))||this.setProperties({max:i},!e));break;case"value":(t.isNullOrUndefined(this.timeOptions)||void 0===this.timeOptions.value||e)&&(i=new Date(this.inputElement.getAttribute(n)),t.isNullOrUndefined(this.checkDateValue(i))||(this.initValue=i,this.updateInput(!1,this.initValue),this.setProperties({value:i},!e)))}}},a.prototype.setCurrentDate=function(e){return t.isNullOrUndefined(this.checkDateValue(e))?null:new Date(Oe,Ne,Ve,e.getHours(),e.getMinutes(),e.getSeconds())},a.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},a.prototype.updateValue=function(e,i){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),t.isNullOrUndefined(s)&&e!==this.maskedDateValue&&this.createMask(),t.isNullOrUndefined(s)&&e===this.maskedDateValue&&this.updateInputValue(this.maskedDateValue))}this.checkValueChange(i,"string"!=typeof e)},a.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)},a.prototype.resetState=function(){this.removeSelection(),s.Input.setValue("",this.inputElement,this.floatLabelType,!1),this.valueWithMinutes=this.activeIndex=null,this.strictMode||this.checkErrorState(null)},a.prototype.objToString=function(e){return t.isNullOrUndefined(this.checkDateValue(e))?null:this.globalize.formatDate(e,{format:this.cldrTimeFormat(),type:"time"})},a.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},a.prototype.validateValue=function(e,i){var s,a=this.validateMinMax(i,this.min,this.max),n=this.getDateObject(a);if(this.getFormattedValue(n)!==this.getFormattedValue(this.value)?(this.valueWithMinutes=t.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&&t.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),t.isNullOrUndefined(s)&&i!==this.maskedDateValue&&this.createMask(),t.isNullOrUndefined(s)&&i===this.maskedDateValue&&this.updateInputValue(this.maskedDateValue));return s},a.prototype.createMask=function(){this.notify("createMask",{module:"MaskedDateTime"})},a.prototype.findNextElement=function(e){var i=this.inputElement.value,s=t.isNullOrUndefined(this.valueWithMinutes)?this.createDateObj(i):this.getDateObject(this.valueWithMinutes),a=null,n=this.liCollections.length,r=this.timeCollections;if(t.isNullOrUndefined(this.checkDateValue(s))&&t.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(t.isNullOrUndefined(a)?null:new Date(a))}},a.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]))},a.prototype.elementValue=function(e){t.isNullOrUndefined(this.checkDateValue(e))||this.checkValue(e)},a.prototype.validLiElement=function(e,i){var s=null,a=t.isNullOrUndefined(this.popupWrapper)?this.liCollections:this.popupWrapper.querySelectorAll("."+Ae),n=!0;if(a.length)if(i)for(var r=e;r>=0;r--){if(!a[r].classList.contains(Se)){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(Se)){s=r;break}r===a.length-1&&n&&(e=r=-1,n=!1)}return s},a.prototype.keyHandler=function(e){if(!(t.isNullOrUndefined(this.step)||this.step<=0||!t.isNullOrUndefined(this.inputWrapper)&&this.inputWrapper.buttons[0].classList.contains(Se))){var i=this.timeCollections.length;if(t.isNullOrUndefined(this.getActiveElement())||0===this.getActiveElement().length)if(this.liCollections.length>0)if(t.isNullOrUndefined(this.value)&&t.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===i?0:this.activeIndex,this.activeIndex=s=this.activeIndex<0?i-1:this.activeIndex,this.activeIndex=s=this.validLiElement(this.activeIndex,40!==e.keyCode&&39!==e.keyCode),a=t.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(i-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,xe),this.setActiveDescendant(),this.enableMask&&this.selectInputText(),!this.isPopupOpen()||null===this.selectedElement||e&&"click"===e.type||this.setScrollPosition()}},a.prototype.getCultureTimeObject=function(e,i){return t.getValue("main."+i+".dates.calendars.gregorian.timeFormats.short",e)},a.prototype.getCultureDateObject=function(e,i){return t.getValue("main."+i+".dates.calendars.gregorian.dateFormats.short",e)},a.prototype.wireListEvents=function(){t.EventHandler.add(this.listWrapper,"click",this.onMouseClick,this),t.Browser.isDevice||(t.EventHandler.add(this.listWrapper,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.listWrapper,"mouseout",this.onMouseLeave,this))},a.prototype.unWireListEvents=function(){this.listWrapper&&(t.EventHandler.remove(this.listWrapper,"click",this.onMouseClick),t.Browser.isDevice||(t.EventHandler.remove(this.listWrapper,"mouseover",this.onMouseOver),t.EventHandler.remove(this.listWrapper,"mouseout",this.onMouseLeave)))},a.prototype.valueProcess=function(e,i){var s=t.isNullOrUndefined(this.checkDateValue(i))?null:i;+this.prevDate!=+s&&(this.initValue=s,this.changeEvent(e))},a.prototype.changeEvent=function(e){this.addSelection(),this.updateInput(!0,this.initValue);var i={event:e||null,value:this.value,text:this.inputElement.value,isInteracted:!t.isNullOrUndefined(e),element:this.element};i.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",i),this.invalidValueString=null,this.checkErrorState(this.value)},a.prototype.updateInput=function(e,i){e&&(this.prevValue=this.getValue(this.prevDate)),this.prevDate=this.valueWithMinutes=i,"number"==typeof i&&(this.value&&+new Date(+this.value).setMilliseconds(0))===+i||(this.setProperties({value:i},!0),this.enableMask&&this.value&&this.createMask()),!this.strictMode&&t.isNullOrUndefined(this.value)&&this.invalidValueString&&(this.checkErrorState(this.invalidValueString),this.updateInputValue(this.invalidValueString)),this.clearIconState()},a.prototype.setActiveDescendant=function(){!t.isNullOrUndefined(this.selectedElement)&&this.value?t.attributes(this.inputElement,{"aria-activedescendant":this.selectedElement.getAttribute("id")}):this.inputElement.removeAttribute("aria-activedescendant")},a.prototype.removeSelection=function(){if(this.removeHover("e-hover"),!t.isNullOrUndefined(this.popupWrapper)){var e=this.popupWrapper.querySelectorAll("."+Te);e.length&&(t.removeClass(e,Te),e[0].removeAttribute("aria-selected"))}},a.prototype.removeHover=function(e){var i=this.getHoverItem(e);i&&i.length&&(t.removeClass(i,e),e===xe&&i[0].removeAttribute("aria-selected"))},a.prototype.getHoverItem=function(e){var i;return t.isNullOrUndefined(this.popupWrapper)||(i=this.popupWrapper.querySelectorAll("."+e)),i},a.prototype.setActiveClass=function(){if(!t.isNullOrUndefined(this.popupWrapper)){var e=this.popupWrapper.querySelectorAll("."+Ae);if(e.length)for(var i=0;i<e.length;i++)if(this.timeCollections[i]===+this.getDateObject(this.valueWithMinutes)){e[i].setAttribute("aria-selected","true"),this.selectedElement=e[i],this.activeIndex=i;break}}},a.prototype.addSelection=function(){this.selectedElement=null,this.removeSelection(),this.setActiveClass(),t.isNullOrUndefined(this.selectedElement)||(t.addClass([this.selectedElement],Te),this.selectedElement.setAttribute("aria-selected","true"))},a.prototype.isValidLI=function(e){return e&&e.classList.contains(Ae)&&!e.classList.contains(Se)},a.prototype.createDateObj=function(e){var i=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?(i=this.defaultCulture.formatDate(new Date,{format:null,skeleton:"short",type:"date"}),s=isNaN(+new Date(i+" "+e))?null:new Date(new Date(i+" "+e).setMilliseconds(0)),t.isNullOrUndefined(s)&&(s=this.timeParse(i,e))):s=this.timeParse(i,e):e instanceof Date&&(s=e),s},a.prototype.timeParse=function(e,i){var s;return s=this.globalize.parseDate(e+" "+i,{format:this.cldrDateFormat()+" "+this.cldrTimeFormat(),type:"datetime"}),s=t.isNullOrUndefined(s)?this.globalize.parseDate(e+" "+i,{format:this.cldrDateFormat()+" "+this.dateToNumeric(),type:"datetime"}):s,s=t.isNullOrUndefined(s)?s:new Date(s.setMilliseconds(0))},a.prototype.createListItems=function(){var e=this;this.listWrapper=this.createElement("div",{className:"e-content",attrs:{tabindex:"-1"}});var i,s=6e4*this.step,a=[];this.timeCollections=[],this.disableItemCollection=[],i=+this.getDateObject(this.initMin).setMilliseconds(0);for(var r=+this.getDateObject(this.initMax).setMilliseconds(0);r>=i;)this.timeCollections.push(i),a.push(this.globalize.formatDate(new Date(i),{format:this.cldrTimeFormat(),type:"time"})),i+=s;var l={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(Se),t.element.classList.contains(Se)&&e.disableItemCollection.push(t.element.getAttribute("data-value"))})}};this.listTag=n.ListBase.createList(this.createElement,a,l,!0),t.attributes(this.listTag,{role:"listbox","aria-hidden":"false",id:this.element.id+"_options",tabindex:"0"}),t.append([this.listTag],this.listWrapper)},a.prototype.documentClickHandler=function(e){var i=e.target;t.isNullOrUndefined(this.popupObj)||t.isNullOrUndefined(this.inputWrapper)||!(this.inputWrapper.container.contains(i)&&"mousedown"!==e.type||this.popupObj.element&&this.popupObj.element.contains(i))||"touchstart"===e.type||e.preventDefault(),t.closest(i,'[id="'+this.popupObj.element.id+'"]')||i===this.inputElement||i===(this.inputWrapper&&this.inputWrapper.buttons[0])||i===(this.inputWrapper&&this.inputWrapper.clearButton)||i===(this.inputWrapper&&this.inputWrapper.container)||i.classList.contains("e-dlg-overlay")?i!==this.inputElement&&(t.Browser.isDevice||(this.isPreventBlur=(t.Browser.isIE||"edge"===t.Browser.info.name)&&document.activeElement===this.inputElement&&i===this.popupWrapper)):this.isPopupOpen()&&(this.hide(),this.focusOut())},a.prototype.setEnableRtl=function(){s.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]),this.popupObj&&(this.popupObj.enableRtl=this.enableRtl,this.popupObj.dataBind())},a.prototype.setEnable=function(){s.Input.setEnabled(this.enabled,this.inputElement,this.floatLabelType),this.enabled?(t.removeClass([this.inputWrapper.container],Se),t.attributes(this.inputElement,{"aria-disabled":"false"}),this.inputElement.setAttribute("tabindex",this.tabIndex)):(this.hide(),t.addClass([this.inputWrapper.container],Se),t.attributes(this.inputElement,{"aria-disabled":"true"}),this.inputElement.tabIndex=-1)},a.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)},a.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("")),t.removeClass([this.inputWrapper.container],[Pe]),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 i={model:this};this.trigger("blur",i)}},a.prototype.focusOut=function(){if(document.activeElement===this.inputElement){this.inputElement.blur(),t.removeClass([this.inputWrapper.container],[Pe]);var e={model:this};this.trigger("blur",e)}},a.prototype.isPopupOpen=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains(""+Ie))},a.prototype.inputFocusHandler=function(){if(this.enabled){var e={model:this};this.readonly||t.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()}},a.prototype.focusIn=function(){document.activeElement!==this.inputElement&&this.enabled&&this.inputElement.focus()},a.prototype.hide=function(){this.closePopup(100,null),this.clearIconState()},a.prototype.show=function(e){var i=this;if(!(this.enabled&&this.readonly||!this.enabled||this.popupWrapper)){this.popupCreation(),t.Browser.isDevice&&this.listWrapper&&(this.modal=this.createElement("div"),this.modal.className=Ie+" e-time-modal",document.body.className+=" e-time-overflow",document.body.appendChild(this.modal)),t.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:t.Browser.isDevice?this.mobileTimePopupWrap:document.body};var s=this.openPopupEventArgs;if(this.trigger("open",s,function(e){if(i.openPopupEventArgs=e,i.openPopupEventArgs.cancel||i.inputWrapper.buttons[0].classList.contains(Se))i.popupObj.destroy(),i.popupWrapper=i.listTag=void 0,i.liCollections=i.timeCollections=i.disableItemCollection=[],i.popupObj=null;else{i.openPopupEventArgs.appendTo.appendChild(i.popupWrapper),i.popupAlignment(i.openPopupEventArgs),i.setScrollPosition(),t.Browser.isDevice||i.inputElement.focus();var s={name:"FadeIn",duration:50};i.popupObj.refreshPosition(i.anchor),1e3===i.zIndex?i.popupObj.show(new t.Animation(s),i.element):i.popupObj.show(new t.Animation(s),null),i.setActiveDescendant(),t.attributes(i.inputElement,{"aria-expanded":"true"}),t.attributes(i.inputElement,{"aria-owns":i.inputElement.id+"_options"}),t.attributes(i.inputElement,{"aria-controls":i.inputElement.id}),t.addClass([i.inputWrapper.container],Pe),t.EventHandler.add(document,"mousedown touchstart",i.documentClickHandler,i),i.setOverlayIndex(i.mobileTimePopupWrap,i.popupObj.element,i.modal,t.Browser.isDevice)}}),t.Browser.isDevice){var a=this.createElement("div",{className:"e-dlg-overlay"});a.style.zIndex=(this.zIndex-1).toString(),this.mobileTimePopupWrap.appendChild(a)}}},a.prototype.setOverlayIndex=function(e,i,s,a){if(a&&!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(s)&&!t.isNullOrUndefined(e)){var n=parseInt(i.style.zIndex,10)?parseInt(i.style.zIndex,10):1e3;s.style.zIndex=(n-1).toString(),e.style.zIndex=n.toString()}},a.prototype.formatValues=function(e){var i;return"number"==typeof e?i=t.formatUnit(e):"string"==typeof e&&(i=e.match(/px|%|em/)?e:isNaN(parseInt(e,10))?e:t.formatUnit(e)),i},a.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)),t.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")}},a.prototype.getPersistData=function(){return this.addOnPersist(["value"])},a.prototype.getModuleName=function(){return"timepicker"},a.prototype.onPropertyChanged=function(e,i){for(var a=0,n=Object.keys(e);a<n.length;a++){var r=n[a];switch(r){case"placeholder":s.Input.setPlaceholder(e.placeholder,this.inputElement);break;case"readonly":s.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,i.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,r);break;case"showClearButton":s.Input.setClearButton(this.showClearButton,this.inputElement,this.inputWrapper),this.bindClearEvent();break;case"locale":this.setProperties({locale:e.locale},!0),this.globalize=new t.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":t.setStyleAttribute(this.inputWrapper.container,{width:this.setWidth(e.width)}),this.containerStyle=this.inputWrapper.container.getBoundingClientRect(),s.Input.calculateWidth(this.inputElement,this.inputWrapper.container),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.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&&t.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,s.Input.removeFloating(this.inputWrapper),s.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.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("")}}},a.prototype.checkInValue=function(e){return e instanceof Date?e.toUTCString():""+e},we([t.Property(null)],a.prototype,"width",void 0),we([t.Property(null)],a.prototype,"cssClass",void 0),we([t.Property(!1)],a.prototype,"strictMode",void 0),we([t.Property(null)],a.prototype,"keyConfigs",void 0),we([t.Property(null)],a.prototype,"format",void 0),we([t.Property(!0)],a.prototype,"enabled",void 0),we([t.Property(!1)],a.prototype,"fullScreenMode",void 0),we([t.Property(!1)],a.prototype,"readonly",void 0),we([t.Property({})],a.prototype,"htmlAttributes",void 0),we([t.Property("Never")],a.prototype,"floatLabelType",void 0),we([t.Property(null)],a.prototype,"placeholder",void 0),we([t.Property(1e3)],a.prototype,"zIndex",void 0),we([t.Property(!1)],a.prototype,"enablePersistence",void 0),we([t.Property(!0)],a.prototype,"showClearButton",void 0),we([t.Property(30)],a.prototype,"step",void 0),we([t.Property(null)],a.prototype,"scrollTo",void 0),we([t.Property(null)],a.prototype,"value",void 0),we([t.Property(null)],a.prototype,"min",void 0),we([t.Property(null)],a.prototype,"max",void 0),we([t.Property(!0)],a.prototype,"allowEdit",void 0),we([t.Property(!1)],a.prototype,"openOnFocus",void 0),we([t.Property(!1)],a.prototype,"enableMask",void 0),we([t.Property({day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"})],a.prototype,"maskPlaceholder",void 0),we([t.Property(null)],a.prototype,"serverTimezoneOffset",void 0),we([t.Event()],a.prototype,"change",void 0),we([t.Event()],a.prototype,"created",void 0),we([t.Event()],a.prototype,"destroyed",void 0),we([t.Event()],a.prototype,"open",void 0),we([t.Event()],a.prototype,"itemRender",void 0),we([t.Event()],a.prototype,"close",void 0),we([t.Event()],a.prototype,"cleared",void 0),we([t.Event()],a.prototype,"blur",void 0),we([t.Event()],a.prototype,"focus",void 0),a=we([t.NotifyPropertyChanges],a)}(t.Component),Fe=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)}}(),Be=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=(new Date).getDate(),Re=(new Date).getMonth(),Ye=(new Date).getFullYear(),ze=(new Date).getHours(),qe=(new Date).getMinutes(),Ke=(new Date).getSeconds(),_e=(new Date).getMilliseconds(),Ge="e-datetimepicker",Ze="e-datetimepopup-wrapper",Xe="e-input-focus",Je="e-disabled",$e="e-active",Qe="e-list-item",et=function(a){function n(e,t){var i=a.call(this,e,t)||this;return i.valueWithMinutes=null,i.scrollInvoked=!1,i.moduleName=i.getModuleName(),i.formatRegex=/dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yyy|yy|y|'[^']*'|'[^']*'/g,i.dateFormatString="",i.dateTimeOptions=e,i}return Fe(n,a),n.prototype.focusHandler=function(){this.enabled&&t.addClass([this.inputWrapper.container],Xe)},n.prototype.focusIn=function(){a.prototype.focusIn.call(this)},n.prototype.focusOut=function(){document.activeElement===this.inputElement&&(this.inputElement.blur(),t.removeClass([this.inputWrapper.container],[Xe]))},n.prototype.blurHandler=function(e){if(this.enabled)if(this.isTimePopupOpen()&&this.isPreventBlur)this.inputElement.focus();else{t.removeClass([this.inputWrapper.container],Xe);var i={model:this};this.isTimePopupOpen()&&this.hide(e),this.trigger("blur",i)}},n.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(),t.detach(this.dateTimeWrapper),this.dateTimeWrapper=void 0,this.liCollections=this.timeCollections=[],t.isNullOrUndefined(this.rippleFn)||this.rippleFn());this.inputElement&&s.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&&t.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,s.Input.destroy({element:this.inputElement,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),a.prototype.destroy.call(this)},n.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))),!t.isNullOrUndefined(t.closest(this.element,"fieldset"))&&t.closest(this.element,"fieldset").disabled&&(this.enabled=!1),a.prototype.updateHtmlAttributeToElement.call(this),this.checkAttributes(!1);var e={placeholder:this.placeholder};this.l10n=new t.L10n("datetimepicker",e,this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),a.prototype.render.call(this),this.createInputElement(),a.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||s.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&&s.Input.calculateWidth(this.inputElement,this.inputWrapper.container),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.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()},n.prototype.setValue=function(e){if(void 0===e&&(e=!1),this.initValue=this.validateMinMaxRange(this.value),!this.strictMode&&this.isDateObject(this.initValue)){var i=this.validateMinMaxRange(this.initValue);s.Input.setValue(this.getFormattedValue(i),this.inputElement,this.floatLabelType,this.showClearButton),this.setProperties({value:i},!0)}else t.isNullOrUndefined(this.value)&&(this.initValue=null,this.setProperties({value:null},!0));this.valueWithMinutes=this.value,a.prototype.updateInput.call(this,e)},n.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},n.prototype.checkValidState=function(e){this.isValidState=!0,this.strictMode||(+e>+this.max||+e<+this.min)&&(this.isValidState=!1),this.checkErrorState()},n.prototype.checkErrorState=function(){this.isValidState?t.removeClass([this.inputWrapper.container],"e-error"):t.addClass([this.inputWrapper.container],"e-error"),t.attributes(this.inputElement,{"aria-invalid":this.isValidState?"false":"true"})},n.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},n.prototype.disablePopupButton=function(e){e?(t.addClass([this.inputWrapper.buttons[0],this.timeIcon],Je),this.hide()):t.removeClass([this.inputWrapper.buttons[0],this.timeIcon],Je)},n.prototype.getFormattedValue=function(e){var i;return t.isNullOrUndefined(e)?null:(i="Gregorian"===this.calendarMode?{format:this.cldrDateTimeFormat(),type:"dateTime",skeleton:"yMd"}:{format:this.cldrDateTimeFormat(),type:"dateTime",skeleton:"yMd",calendar:"islamic"},this.globalize.formatDate(e,i))},n.prototype.isDateObject=function(e){return!t.isNullOrUndefined(e)&&!isNaN(+e)},n.prototype.createInputElement=function(){t.removeClass([this.inputElement],"e-datepicker"),t.removeClass([this.inputWrapper.container],"e-date-wrapper"),t.addClass([this.inputWrapper.container],"e-datetime-wrapper"),t.addClass([this.inputElement],Ge),this.renderTimeIcon()},n.prototype.renderTimeIcon=function(){this.timeIcon=s.Input.appendSpan("e-input-group-icon e-time-icon e-icons",this.inputWrapper.container)},n.prototype.bindInputEvents=function(){t.EventHandler.add(this.timeIcon,"mousedown",this.timeHandler,this),t.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.dateHandler,this),t.EventHandler.add(this.inputElement,"blur",this.blurHandler,this),t.EventHandler.add(this.inputElement,"focus",this.focusHandler,this),this.defaultKeyConfigs=t.extend(this.defaultKeyConfigs,this.keyConfigs),this.keyboardHandler=new t.KeyboardEvents(this.inputElement,{eventName:"keydown",keyAction:this.inputKeyAction.bind(this),keyConfigs:this.defaultKeyConfigs})},n.prototype.unBindInputEvents=function(){t.EventHandler.remove(this.timeIcon,"mousedown touchstart",this.timeHandler),t.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown touchstart",this.dateHandler),this.inputElement&&(t.EventHandler.remove(this.inputElement,"blur",this.blurHandler),t.EventHandler.remove(this.inputElement,"focus",this.focusHandler)),this.keyboardHandler&&this.keyboardHandler.destroy()},n.prototype.cldrTimeFormat=function(){return this.isNullOrEmpty(this.timeFormat)?"en"===this.locale||"en-US"===this.locale?t.getValue("timeFormats.short",t.getDefaultDateObject()):this.getCultureTimeObject(t.cldrData,""+this.locale):this.timeFormat},n.prototype.cldrDateTimeFormat=function(){var e=new t.Internationalization(this.locale).getDatePattern({skeleton:"yMd"});return this.isNullOrEmpty(this.formatString)?e+" "+this.getCldrFormat("time"):this.formatString},n.prototype.getCldrFormat=function(e){return"en"===this.locale||"en-US"===this.locale?t.getValue("timeFormats.short",t.getDefaultDateObject()):this.getCultureTimeObject(t.cldrData,""+this.locale)},n.prototype.isNullOrEmpty=function(e){return!!(t.isNullOrUndefined(e)||"string"==typeof e&&""===e.trim())},n.prototype.getCultureTimeObject=function(e,i){return"Gregorian"===this.calendarMode?t.getValue("main."+this.locale+".dates.calendars.gregorian.timeFormats.short",e):t.getValue("main."+this.locale+".dates.calendars.islamic.timeFormats.short",e)},n.prototype.timeHandler=function(e){this.enabled&&(this.isIconClicked=!0,t.Browser.isDevice&&this.inputElement.setAttribute("readonly",""),e.currentTarget===this.timeIcon&&e.preventDefault(),this.enabled&&!this.readonly&&(this.isDatePopupOpen()&&a.prototype.hide.call(this,e),this.isTimePopupOpen()?this.closePopup(e):(this.inputElement.focus(),this.popupCreation("time",e),t.addClass([this.inputWrapper.container],[Xe]))),this.isIconClicked=!1)},n.prototype.dateHandler=function(e){this.enabled&&(e.currentTarget===this.inputWrapper.buttons[0]&&e.preventDefault(),this.enabled&&!this.readonly&&(this.isTimePopupOpen()&&this.closePopup(e),t.isNullOrUndefined(this.popupWrapper)||this.popupCreation("date",e)))},n.prototype.show=function(e,t){this.enabled&&this.readonly||!this.enabled||("time"!==e||this.dateTimeWrapper?this.popupObj||(this.isTimePopupOpen()&&this.hide(t),a.prototype.show.call(this),this.popupCreation("date",t)):(this.isDatePopupOpen()&&this.hide(t),this.popupCreation("time",t)))},n.prototype.toggle=function(e){this.isDatePopupOpen()?(a.prototype.hide.call(this,e),this.show("time",null)):this.isTimePopupOpen()?(this.hide(e),a.prototype.show.call(this,null,e),this.popupCreation("date",null)):this.show(null,e)},n.prototype.listCreation=function(){var i;"Gregorian"===this.calendarMode?(this.cldrDateTimeFormat().replace(this.formatRegex,this.TimePopupFormat()),""===this.dateFormatString&&(this.dateFormatString=this.cldrDateTimeFormat()),i=this.globalize.parseDate(this.inputElement.value,{format:this.dateFormatString,type:"datetime"})):i=this.globalize.parseDate(this.inputElement.value,{format:this.cldrDateTimeFormat(),type:"datetime",calendar:"islamic"});var s=t.isNullOrUndefined(this.value)?""!==this.inputElement.value?i:new Date:this.value;this.valueWithMinutes=s,this.listWrapper=t.createElement("div",{className:"e-content",attrs:{tabindex:"0"}});var a=this.startTime(s),n=this.endTime(s),r=e.TimePickerBase.createListItems(this.createElement,a,n,this.globalize,this.cldrTimeFormat(),this.step);this.timeCollections=r.collection,this.listTag=r.list,t.attributes(this.listTag,{role:"listbox","aria-hidden":"false",id:this.element.id+"_options"}),t.append([r.list],this.listWrapper),this.wireTimeListEvents();var l={duration:300,selector:"."+Qe};this.rippleFn=t.rippleEffect(this.listWrapper,l),this.liCollections=this.listWrapper.querySelectorAll("."+Qe)},n.prototype.popupCreation=function(e,i){if(t.Browser.isDevice&&this.element.setAttribute("readonly","readonly"),"date"===e)!this.readonly&&this.popupWrapper&&(t.addClass([this.popupWrapper],Ze),t.attributes(this.popupWrapper,{id:this.element.id+"_options"}));else if(!this.readonly&&(this.dateTimeWrapper=t.createElement("div",{className:Ge+" e-popup",attrs:{id:this.element.id+"_timepopup",style:"visibility:hidden ; display:block"}}),t.isNullOrUndefined(this.cssClass)||(this.dateTimeWrapper.className+=" "+this.cssClass),!t.isNullOrUndefined(this.step)&&this.step>0&&(this.listCreation(),t.append([this.listWrapper],this.dateTimeWrapper)),document.body.appendChild(this.dateTimeWrapper),this.addTimeSelection(),this.renderPopup(),this.setTimeScrollPosition(),this.openPopup(i),(!t.Browser.isDevice||t.Browser.isDevice&&!this.fullScreenMode)&&this.popupObject.refreshPosition(this.inputElement),t.Browser.isDevice&&this.fullScreenMode&&(this.dateTimeWrapper.style.left="0px"),t.Browser.isDevice)){var s=this.createElement("div",{className:"e-dlg-overlay"});s.style.zIndex=(this.zIndex-1).toString(),this.timeModal.appendChild(s)}},n.prototype.openPopup=function(e){var i=this;this.preventArgs={cancel:!1,popup:this.popupObject,event:e||null};var s=this.preventArgs;this.trigger("open",s,function(e){if(i.preventArgs=e,!i.preventArgs.cancel&&!i.readonly){var s={name:"FadeIn",duration:100};1e3===i.zIndex?i.popupObject.show(new t.Animation(s),i.element):i.popupObject.show(new t.Animation(s),null),t.addClass([i.inputWrapper.container],["e-icon-anim"]),t.attributes(i.inputElement,{"aria-expanded":"true"}),t.attributes(i.inputElement,{"aria-owns":i.inputElement.id+"_options"}),t.attributes(i.inputElement,{"aria-controls":i.inputElement.id}),t.EventHandler.add(document,"mousedown touchstart",i.documentClickHandler,i)}})},n.prototype.documentClickHandler=function(e){var i=e.target;!t.isNullOrUndefined(this.popupObject)&&(this.inputWrapper.container.contains(i)&&"mousedown"!==e.type||this.popupObject.element&&this.popupObject.element.contains(i))&&"touchstart"!==e.type&&e.preventDefault(),t.closest(i,'[id="'+(this.popupObject&&this.popupObject.element.id+'"]'))||i===this.inputElement||i===this.timeIcon||t.isNullOrUndefined(this.inputWrapper)||i===this.inputWrapper.container||i.classList.contains("e-dlg-overlay")?i!==this.inputElement&&(t.Browser.isDevice||(this.isPreventBlur=document.activeElement===this.inputElement&&(t.Browser.isIE||"edge"===t.Browser.info.name)&&i===this.popupObject.element)):this.isTimePopupOpen()&&(this.hide(e),this.focusOut())},n.prototype.isTimePopupOpen=function(){return!(!this.dateTimeWrapper||!this.dateTimeWrapper.classList.contains(""+Ge))},n.prototype.isDatePopupOpen=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains(""+Ze))},n.prototype.renderPopup=function(){var e=this;this.containerStyle=this.inputWrapper.container.getBoundingClientRect(),t.Browser.isDevice&&(this.timeModal=t.createElement("div"),this.timeModal.className=Ge+" e-time-modal",document.body.className+=" e-time-overflow",this.timeModal.style.display="block",document.body.appendChild(this.timeModal));if(this.popupObject=new i.Popup(this.dateTimeWrapper,{width:this.setPopupWidth(),zIndex:this.zIndex,targetType:"container",collision:t.Browser.isDevice?{X:"fit",Y:"fit"}:{X:"flip",Y:"flip"},relateTo:t.Browser.isDevice?document.body:this.inputWrapper.container,position:t.Browser.isDevice?{X:"center",Y:"center"}:{X:"left",Y:"bottom"},enableRtl:this.enableRtl,offsetY:4,open:function(){e.dateTimeWrapper.style.visibility="visible",t.addClass([e.timeIcon],$e),t.Browser.isDevice||(e.timekeyConfigure=t.extend(e.timekeyConfigure,e.keyConfigs),e.inputEvent=new t.KeyboardEvents(e.inputWrapper.container,{keyAction:e.timeKeyActionHandle.bind(e),keyConfigs:e.timekeyConfigure,eventName:"keydown"}))},close:function(){t.removeClass([e.timeIcon],$e),e.unWireTimeListEvents(),e.inputElement.removeAttribute("aria-activedescendant"),t.remove(e.popupObject.element),e.popupObject.destroy(),e.dateTimeWrapper.innerHTML="",e.listWrapper=e.dateTimeWrapper=void 0,e.inputEvent&&e.inputEvent.destroy()},targetExitViewport:function(){t.Browser.isDevice||e.hide()}}),t.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",t.Browser.isDevice&&this.fullScreenMode){var s=t.createElement("div",{className:"e-datetime-mob-popup-wrap"}),a=this.createElement("div",{className:"e-model-header"}),n=this.createElement("span",{className:"e-model-title"});n.textContent="Select time";var r=this.createElement("span",{className:"e-popup-close"});t.EventHandler.add(r,"mousedown touchstart",this.dateTimeCloseHandler,this);var l=this.dateTimeWrapper.querySelector(".e-content");a.appendChild(r),a.appendChild(n),s.appendChild(a),s.appendChild(l),this.dateTimeWrapper.insertBefore(s,this.dateTimeWrapper.firstElementChild)}},n.prototype.dateTimeCloseHandler=function(e){this.hide()},n.prototype.setDimension=function(e){return e="number"==typeof e?t.formatUnit(e):"string"==typeof e?e:"100%"},n.prototype.setPopupWidth=function(){var e=this.setDimension(this.width);if(e.indexOf("%")>-1){e=(this.containerStyle.width*parseFloat(e)/100).toString()+"px"}return e},n.prototype.wireTimeListEvents=function(){t.EventHandler.add(this.listWrapper,"click",this.onMouseClick,this),t.Browser.isDevice||(t.EventHandler.add(this.listWrapper,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.listWrapper,"mouseout",this.onMouseLeave,this))},n.prototype.unWireTimeListEvents=function(){this.listWrapper&&(t.EventHandler.remove(this.listWrapper,"click",this.onMouseClick),t.EventHandler.remove(document,"mousedown touchstart",this.documentClickHandler),t.Browser.isDevice||(t.EventHandler.add(this.listWrapper,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.listWrapper,"mouseout",this.onMouseLeave,this)))},n.prototype.onMouseOver=function(e){var i=t.closest(e.target,"."+Qe);this.setTimeHover(i,"e-hover")},n.prototype.onMouseLeave=function(){this.removeTimeHover("e-hover")},n.prototype.setTimeHover=function(e,i){this.enabled&&this.isValidLI(e)&&!e.classList.contains(i)&&(this.removeTimeHover(i),t.addClass([e],i))},n.prototype.getPopupHeight=function(){var e=parseInt("250px",10),i=this.dateTimeWrapper.getBoundingClientRect().height;return t.Browser.isDevice&&this.fullScreenMode?i:i>e?e:i},n.prototype.changeEvent=function(e){a.prototype.changeEvent.call(this,e),(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))},n.prototype.updateValue=function(e){this.setInputValue("time"),+this.previousDateTime!=+this.value&&(this.changedArgs={value:this.value,event:e||null,isInteracted:!t.isNullOrUndefined(e),element:this.element},this.addTimeSelection(),this.trigger("change",this.changedArgs),this.previousDateTime=this.previousDate=this.value)},n.prototype.setTimeScrollPosition=function(){var e=this.selectedElement;t.isNullOrUndefined(e)?this.dateTimeWrapper&&this.checkDateValue(this.scrollTo)&&this.setScrollTo():this.findScrollTop(e)},n.prototype.findScrollTop=function(e){var i=this.getPopupHeight(),s=e.nextElementSibling,a=s?s.offsetTop:e.offsetTop,n=e.getBoundingClientRect().height;if(a+e.offsetTop>i)if(t.Browser.isDevice&&this.fullScreenMode){this.dateTimeWrapper.querySelector(".e-content").scrollTop=s?a-(i/2+n/2):a}else this.dateTimeWrapper.scrollTop=s?a-(i/2+n/2):a;else this.dateTimeWrapper.scrollTop=0},n.prototype.setScrollTo=function(){var e,i=this.dateTimeWrapper.querySelectorAll("."+Qe);if(i.length>=0){this.scrollInvoked=!0;var s=this.timeCollections[0],a=this.getDateObject(this.checkDateValue(this.scrollTo)).getTime();e=i[Math.round((a-s)/(6e4*this.step))]}else this.dateTimeWrapper.scrollTop=0;t.isNullOrUndefined(e)?this.dateTimeWrapper.scrollTop=0:this.findScrollTop(e)},n.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]));s.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()},n.prototype.getFullDateTime=function(){var e=null;return e=this.isDateObject(this.valueWithMinutes)?this.combineDateTime(this.valueWithMinutes):this.previousDate,this.validateMinMaxRange(e)},n.prototype.createMask=function(){this.notify("createMask",{module:"MaskedDateTime"})},n.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},n.prototype.onMouseClick=function(e){var i=e.target,s=this.selectedElement=t.closest(i,"."+Qe);s&&s.classList.contains(Qe)&&(this.timeValue=s.getAttribute("data-value"),this.hide(e)),this.setSelection(s,e)},n.prototype.setSelection=function(e,i){if(this.isValidLI(e)&&!e.classList.contains($e)){this.selectedElement=e;var s=Array.prototype.slice.call(this.liCollections).indexOf(e);this.activeIndex=s,this.valueWithMinutes=new Date(this.timeCollections[this.activeIndex]),t.addClass([this.selectedElement],$e),this.selectedElement.setAttribute("aria-selected","true"),this.updateValue(i)}},n.prototype.setTimeActiveClass=function(){var e=t.isNullOrUndefined(this.dateTimeWrapper)?this.listWrapper:this.dateTimeWrapper;if(!t.isNullOrUndefined(e)){var i=e.querySelectorAll("."+Qe);if(i.length)for(var s=0;s<i.length;s++)if(this.timeCollections[s]===+this.valueWithMinutes){i[s].setAttribute("aria-selected","true"),this.selectedElement=i[s],this.activeIndex=s,this.setTimeActiveDescendant();break}}},n.prototype.setTimeActiveDescendant=function(){!t.isNullOrUndefined(this.selectedElement)&&this.value?t.attributes(this.inputElement,{"aria-activedescendant":this.selectedElement.getAttribute("id")}):this.inputElement.removeAttribute("aria-activedescendant")},n.prototype.addTimeSelection=function(){this.selectedElement=null,this.removeTimeSelection(),this.setTimeActiveClass(),t.isNullOrUndefined(this.selectedElement)||(t.addClass([this.selectedElement],$e),this.selectedElement.setAttribute("aria-selected","true"))},n.prototype.removeTimeSelection=function(){if(this.removeTimeHover("e-hover"),!t.isNullOrUndefined(this.dateTimeWrapper)){var e=this.dateTimeWrapper.querySelectorAll("."+$e);e.length&&(t.removeClass(e,$e),e[0].removeAttribute("aria-selected"))}},n.prototype.removeTimeHover=function(e){var i=this.getTimeHoverItem(e);i&&i.length&&t.removeClass(i,e)},n.prototype.getTimeHoverItem=function(e){var i,s=t.isNullOrUndefined(this.dateTimeWrapper)?this.listWrapper:this.dateTimeWrapper;return t.isNullOrUndefined(s)||(i=s.querySelectorAll("."+e)),i},n.prototype.isValidLI=function(e){return e&&e.classList.contains(Qe)&&!e.classList.contains(Je)},n.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)},n.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")},n.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}},n.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")},n.prototype.hide=function(e){var i=this;if(this.popupObj||this.dateTimeWrapper){this.preventArgs={cancel:!1,popup:this.popupObj||this.popupObject,event:e||null};var s=this.preventArgs;t.isNullOrUndefined(this.popupObj)?this.trigger("close",s,function(t){i.dateTimeCloseEventCallback(e,t)}):this.dateTimeCloseEventCallback(e,s)}else t.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit()},n.prototype.dateTimeCloseEventCallback=function(e,i){this.preventArgs=i,this.preventArgs.cancel||(this.isDatePopupOpen()?a.prototype.hide.call(this,e):this.isTimePopupOpen()&&(this.closePopup(e),t.removeClass([document.body],"e-time-overflow"),t.Browser.isDevice&&this.timeModal&&(this.timeModal.style.display="none",this.timeModal.outerHTML="",this.timeModal=null),this.setTimeActiveDescendant())),t.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit()},n.prototype.closePopup=function(e){if(this.isTimePopupOpen()&&this.popupObject){var i={name:"FadeOut",duration:100,delay:0};this.popupObject.hide(new t.Animation(i)),this.inputWrapper.container.classList.remove("e-icon-anim"),t.attributes(this.inputElement,{"aria-expanded":"false"}),this.inputElement.removeAttribute("aria-owns"),this.inputElement.removeAttribute("aria-controls"),t.EventHandler.remove(document,"mousedown touchstart",this.documentClickHandler)}},n.prototype.preRender=function(){this.checkFormat(),this.dateTimeFormat=this.cldrDateTimeFormat(),a.prototype.preRender.call(this),t.removeClass([this.inputElementCopy],[Ge])},n.prototype.getProperty=function(e,t){"min"===t?this.setProperties({min:this.validateValue(e.min)},!0):this.setProperties({max:this.validateValue(e.max)},!0)},n.prototype.checkAttributes=function(e){for(var i,s=0,a=e?t.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(!t.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(t.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":(t.isNullOrUndefined(this.dateTimeOptions)||void 0===this.dateTimeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(n)},!e);break;case"min":(t.isNullOrUndefined(this.dateTimeOptions)||void 0===this.dateTimeOptions.min||e)&&(i=new Date(this.inputElement.getAttribute(n)),this.isNullOrEmpty(i)||isNaN(+i)||this.setProperties({min:i},!e));break;case"disabled":if(t.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":(t.isNullOrUndefined(this.dateTimeOptions)||void 0===this.dateTimeOptions.value||e)&&(i=new Date(this.inputElement.getAttribute(n)),this.isNullOrEmpty(i)||isNaN(+i)||this.setProperties({value:i},!e));break;case"max":(t.isNullOrUndefined(this.dateTimeOptions)||void 0===this.dateTimeOptions.max||e)&&(i=new Date(this.inputElement.getAttribute(n)),this.isNullOrEmpty(i)||isNaN(+i)||this.setProperties({max:i},!e))}}},n.prototype.requiredModules=function(){var e=[];return"Islamic"===this.calendarMode&&e.push({args:[this],member:"islamic",name:"Islamic"}),this.enableMask&&e.push(this.maskedDateModule()),e},n.prototype.maskedDateModule=function(){return{args:[this],member:"MaskedDateTime"}},n.prototype.getTimeActiveElement=function(){return t.isNullOrUndefined(this.dateTimeWrapper)?null:this.dateTimeWrapper.querySelectorAll("."+$e)},n.prototype.createDateObj=function(e){return e instanceof Date?e:null},n.prototype.getDateObject=function(e){if(!this.isNullOrEmpty(e)){var i=this.createDateObj(e),s=this.valueWithMinutes,a=!t.isNullOrUndefined(s);if(this.checkDateValue(i)){var n=a?s.getDate():je,r=a?s.getMonth():Re,l=a?s.getFullYear():Ye,o=a?s.getHours():ze,h=a?s.getMinutes():qe,u=a?s.getSeconds():Ke,d=a?s.getMilliseconds():_e;return this.scrollInvoked?(this.scrollInvoked=!1,new Date(l,r,n,i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds())):new Date(l,r,n,o,h,u,d)}}return null},n.prototype.findNextTimeElement=function(e){var i=this.inputElement.value,s=t.isNullOrUndefined(this.valueWithMinutes)?this.createDateObj(i):this.getDateObject(this.valueWithMinutes),a=null,n=this.liCollections.length;if(!t.isNullOrUndefined(this.activeIndex)||!t.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(t.isNullOrUndefined(a)?null:new Date(a))}},n.prototype.setTimeValue=function(e,i){var a,n,r=this.validateMinMaxRange(i),l=this.createDateObj(r);return this.getFormattedValue(l)!==(t.isNullOrUndefined(this.value)?null:this.getFormattedValue(this.value))?(this.valueWithMinutes=t.isNullOrUndefined(l)?null:l,n=new Date(+this.valueWithMinutes)):(this.strictMode&&(e=l),this.valueWithMinutes=this.checkDateValue(e),n=new Date(+this.valueWithMinutes)),a="Gregorian"===this.calendarMode?this.globalize.formatDate(n,{format:t.isNullOrUndefined(this.formatString)?this.cldrDateTimeFormat():this.formatString,type:"dateTime",skeleton:"yMd"}):this.globalize.formatDate(n,{format:t.isNullOrUndefined(this.formatString)?this.cldrDateTimeFormat():this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"}),!this.strictMode&&t.isNullOrUndefined(n),s.Input.setValue(a,this.inputElement,this.floatLabelType,this.showClearButton),n},n.prototype.timeElementValue=function(e){if(!t.isNullOrUndefined(this.checkDateValue(e))&&!this.isNullOrEmpty(e)){var i=e instanceof Date?e:this.getDateObject(e);return this.setTimeValue(i,e)}return null},n.prototype.timeKeyHandler=function(e){if(!(t.isNullOrUndefined(this.step)||this.step<=0)){var i=this.timeCollections.length;if(t.isNullOrUndefined(this.getTimeActiveElement())||0===this.getTimeActiveElement().length)this.liCollections.length>0&&(t.isNullOrUndefined(this.value)&&t.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=a=this.activeIndex===i?0:this.activeIndex,this.activeIndex=a=this.activeIndex<0?i-1:this.activeIndex,s=t.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=i-1,s=this.timeCollections[i-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()}},n.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),t.addClass([this.inputWrapper.container],Xe),this.isNavigate=!1,e.stopPropagation();break;case"escape":this.hide(e);break;default:this.isNavigate=!1}},n.prototype.inputKeyAction=function(e){switch(e.action){case"altDownArrow":this.strictModeUpdate(),this.updateInput(),this.toggle(e)}},n.prototype.onPropertyChanged=function(e,i){for(var n=0,r=Object.keys(e);n<r.length;n++){var l=r[n];switch(l){case"value":this.isDynamicValueChanged=!0,this.invalidValueString=null,this.checkInvalidValue(e.value),e.value=this.value,e.value=this.validateValue(e.value),this.enableMask?s.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton):s.Input.setValue(this.getFormattedValue(e.value),this.inputElement,this.floatLabelType,this.showClearButton),this.valueWithMinutes=e.value,this.setProperties({value:e.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(e,l),this.updateInput();break;case"enableRtl":s.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]);break;case"cssClass":t.isNullOrUndefined(i.cssClass)||(i.cssClass=i.cssClass.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e.cssClass)||(e.cssClass=e.cssClass.replace(/\s+/g," ").trim()),s.Input.setCssClass(e.cssClass,[this.inputWrapper.container],i.cssClass),this.dateTimeWrapper&&s.Input.setCssClass(e.cssClass,[this.dateTimeWrapper],i.cssClass);break;case"locale":this.globalize=new t.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.dateTimeOptions&&null==this.dateTimeOptions.placeholder&&(this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),s.Input.setPlaceholder(this.l10n.getConstant("placeholder"),this.inputElement)),this.dateTimeFormat=this.cldrDateTimeFormat(),a.prototype.updateInput.call(this);break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.checkAttributes(!0);break;case"format":this.setProperties({format:e.format},!0),this.checkFormat(),this.dateTimeFormat=this.formatString,this.setValue(),this.enableMask&&(this.notify("createMask",{module:"MaskedDateTime"}),this.value||s.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton));break;case"placeholder":s.Input.setPlaceholder(e.placeholder,this.inputElement);break;case"enabled":s.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(e.width),s.Input.calculateWidth(this.inputElement,this.inputWrapper.container),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.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":s.Input.setReadonly(this.readonly,this.inputElement);break;case"floatLabelType":this.floatLabelType=e.floatLabelType,s.Input.removeFloating(this.inputWrapper),s.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.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(e.scrollTo)))?(this.dateTimeWrapper&&this.setScrollTo(),this.setProperties({scrollTo:this.checkDateValue(new Date(this.checkValue(e.scrollTo)))},!0)):this.setProperties({scrollTo:null},!0);break;case"enableMask":this.enableMask?(this.notify("createMask",{module:"MaskedDateTime"}),s.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton)):this.inputElement.value===this.maskedDateValue&&(this.maskedDateValue="",s.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton));break;default:a.prototype.onPropertyChanged.call(this,e,i)}this.isDynamicValueChanged||this.hide(null),this.isDynamicValueChanged=!1}},n.prototype.getModuleName=function(){return"datetimepicker"},n.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=t.isNullOrUndefined(this.inputValueCopy)?"":this.getFormattedValue(this.inputValueCopy)},Be([t.Property(null)],n.prototype,"timeFormat",void 0),Be([t.Property(30)],n.prototype,"step",void 0),Be([t.Property(null)],n.prototype,"scrollTo",void 0),Be([t.Property(1e3)],n.prototype,"zIndex",void 0),Be([t.Property(null)],n.prototype,"value",void 0),Be([t.Property(null)],n.prototype,"keyConfigs",void 0),Be([t.Property({})],n.prototype,"htmlAttributes",void 0),Be([t.Property(!1)],n.prototype,"enablePersistence",void 0),Be([t.Property(!0)],n.prototype,"allowEdit",void 0),Be([t.Property(!1)],n.prototype,"isMultiSelection",void 0),Be([t.Property(null)],n.prototype,"values",void 0),Be([t.Property(!0)],n.prototype,"showClearButton",void 0),Be([t.Property(null)],n.prototype,"placeholder",void 0),Be([t.Property(!1)],n.prototype,"strictMode",void 0),Be([t.Property(!1)],n.prototype,"fullScreenMode",void 0),Be([t.Property(null)],n.prototype,"serverTimezoneOffset",void 0),Be([t.Property(new Date(1900,0,1))],n.prototype,"min",void 0),Be([t.Property(new Date(2099,11,31))],n.prototype,"max",void 0),Be([t.Property(null)],n.prototype,"firstDayOfWeek",void 0),Be([t.Property("Gregorian")],n.prototype,"calendarMode",void 0),Be([t.Property("Month")],n.prototype,"start",void 0),Be([t.Property("Month")],n.prototype,"depth",void 0),Be([t.Property(!1)],n.prototype,"weekNumber",void 0),Be([t.Property(!0)],n.prototype,"showTodayButton",void 0),Be([t.Property("Short")],n.prototype,"dayHeaderFormat",void 0),Be([t.Property(!1)],n.prototype,"openOnFocus",void 0),Be([t.Property(!1)],n.prototype,"enableMask",void 0),Be([t.Property({day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"})],n.prototype,"maskPlaceholder",void 0),Be([t.Event()],n.prototype,"open",void 0),Be([t.Event()],n.prototype,"close",void 0),Be([t.Event()],n.prototype,"cleared",void 0),Be([t.Event()],n.prototype,"blur",void 0),Be([t.Event()],n.prototype,"focus",void 0),Be([t.Event()],n.prototype,"created",void 0),Be([t.Event()],n.prototype,"destroyed",void 0),n=Be([t.NotifyPropertyChanges],n)}(j),tt="shiftTab",it=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 t.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||"ArrowLeft"!==e.e.key&&"ArrowRight"!==e.e.key&&e.e.key!==tt&&"Tab"!==e.e.key&&e.e.action!==tt&&"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||e.e.action===tt)){var a=e.e.action===tt?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||e.e.action===tt||"End"===e.e.key)}if(!(e.e.altKey||e.e.ctrlKey||"ArrowUp"!==e.e.key&&"ArrowDown"!==e.e.key)){t=this.parent.inputElement.selectionStart;var 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()}}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(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 i=this.parent.locale;return"en"===i||"en-US"===i?t.getValue(e,t.getDefaultDateObject()):t.getValue("main."+i+".dates.calendars.gregorian."+e,t.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}();e.CalendarBase=k,e.Calendar=M,e.Islamic=T,e.DatePicker=j,e.Presets=Ce,e.DateRangePicker=ke,e.TimeMaskPlaceholder=We,e.TimePicker=Le,e.DateTimePicker=et,e.MaskedDateTime=it,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
11
2
|
//# sourceMappingURL=ej2-calendars.umd.min.js.map
|