@syncfusion/ej2-inputs 19.2.59 → 19.3.47
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 +8 -0
- package/dist/ej2-inputs.umd.min.js +2 -2
- package/dist/ej2-inputs.umd.min.js.map +1 -1
- package/dist/es6/ej2-inputs.es2015.js +346 -606
- package/dist/es6/ej2-inputs.es2015.js.map +1 -1
- package/dist/es6/ej2-inputs.es5.js +358 -623
- package/dist/es6/ej2-inputs.es5.js.map +1 -1
- package/dist/global/ej2-inputs.min.js +2 -2
- package/dist/global/ej2-inputs.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/helpers/e2e/colorpickerHelper.d.ts +23 -0
- package/helpers/e2e/colorpickerHelper.js +53 -0
- package/package.json +9 -9
- package/src/maskedtextbox/maskedtextbox/maskedtextbox-model.d.ts +1 -4
- package/src/maskedtextbox/maskedtextbox/maskedtextbox.d.ts +0 -3
- package/src/maskedtextbox/maskedtextbox/maskedtextbox.js +2 -11
- package/src/numerictextbox/numerictextbox-model.d.ts +1 -10
- package/src/numerictextbox/numerictextbox.d.ts +0 -9
- package/src/numerictextbox/numerictextbox.js +51 -95
- package/src/slider/slider.d.ts +1 -0
- package/src/slider/slider.js +10 -1
- package/src/textbox/textbox-model.d.ts +1 -4
- package/src/textbox/textbox.d.ts +0 -3
- package/src/textbox/textbox.js +90 -112
- package/src/uploader/uploader-model.d.ts +1 -26
- package/src/uploader/uploader.d.ts +0 -40
- package/src/uploader/uploader.js +210 -407
- package/styles/bootstrap-dark.css +14 -6
- package/styles/bootstrap.css +14 -6
- package/styles/bootstrap4.css +22 -12
- package/styles/bootstrap5-dark.css +7548 -0
- package/styles/bootstrap5-dark.scss +7 -0
- package/styles/bootstrap5.css +7548 -0
- package/styles/bootstrap5.scss +7 -0
- package/styles/color-picker/_bootstrap5-dark-definition.scss +1 -0
- package/styles/color-picker/_bootstrap5-definition.scss +134 -0
- package/styles/color-picker/_layout.scss +26 -3
- package/styles/color-picker/_tailwind-dark-definition.scss +1 -132
- package/styles/color-picker/_tailwind-definition.scss +25 -24
- package/styles/color-picker/_theme.scss +33 -0
- package/styles/color-picker/bootstrap5-dark.css +964 -0
- package/styles/color-picker/bootstrap5-dark.scss +11 -0
- package/styles/color-picker/bootstrap5.css +964 -0
- package/styles/color-picker/bootstrap5.scss +11 -0
- package/styles/color-picker/icons/_bootstrap5-dark.scss +1 -0
- package/styles/color-picker/icons/_bootstrap5.scss +10 -0
- package/styles/fabric-dark.css +15 -7
- package/styles/fabric.css +15 -7
- package/styles/highcontrast-light.css +15 -7
- package/styles/highcontrast.css +16 -8
- package/styles/input/_bootstrap5-dark-definition.scss +1 -0
- package/styles/input/_bootstrap5-definition.scss +320 -0
- package/styles/input/_definition.scss +217 -0
- package/styles/input/_fabric-definition.scss +1 -1
- package/styles/input/_highcontrast-definition.scss +1 -1
- package/styles/input/_layout.scss +196 -157
- package/styles/input/_material-dark-definition.scss +133 -120
- package/styles/input/_material-definition.scss +1 -0
- package/styles/input/_tailwind-dark-definition.scss +1 -315
- package/styles/input/_tailwind-definition.scss +50 -47
- package/styles/input/_theme.scss +92 -59
- package/styles/input/bootstrap-dark.css +12 -3
- package/styles/input/bootstrap.css +12 -3
- package/styles/input/bootstrap4.css +15 -3
- package/styles/input/bootstrap5-dark.css +4670 -0
- package/styles/input/bootstrap5-dark.scss +4 -0
- package/styles/input/bootstrap5.css +4670 -0
- package/styles/input/bootstrap5.scss +4 -0
- package/styles/input/fabric-dark.css +12 -3
- package/styles/input/fabric.css +13 -4
- package/styles/input/highcontrast-light.css +12 -3
- package/styles/input/highcontrast.css +13 -4
- package/styles/input/icons/_bootstrap5-dark.scss +1 -0
- package/styles/input/icons/_bootstrap5.scss +17 -0
- package/styles/input/icons/_material-dark.scss +32 -0
- package/styles/input/icons/_tailwind-dark.scss +1 -17
- package/styles/input/material-dark.css +2320 -201
- package/styles/input/material.css +12 -3
- package/styles/input/tailwind-dark.css +14 -5
- package/styles/input/tailwind.css +14 -5
- package/styles/maskedtextbox/_bootstrap5-dark-definition.scss +1 -0
- package/styles/maskedtextbox/_bootstrap5-definition.scss +7 -0
- package/styles/maskedtextbox/_tailwind-dark-definition.scss +1 -6
- package/styles/maskedtextbox/_tailwind-definition.scss +4 -1
- package/styles/maskedtextbox/bootstrap5-dark.css +33 -0
- package/styles/maskedtextbox/bootstrap5-dark.scss +4 -0
- package/styles/maskedtextbox/bootstrap5.css +33 -0
- package/styles/maskedtextbox/bootstrap5.scss +4 -0
- package/styles/material-dark.css +2337 -218
- package/styles/material.css +14 -5
- package/styles/numerictextbox/_bootstrap5-dark-definition.scss +1 -0
- package/styles/numerictextbox/_bootstrap5-definition.scss +3 -0
- package/styles/numerictextbox/_tailwind-dark-definition.scss +1 -5
- package/styles/numerictextbox/_tailwind-definition.scss +1 -1
- package/styles/numerictextbox/bootstrap5-dark.css +48 -0
- package/styles/numerictextbox/bootstrap5-dark.scss +5 -0
- package/styles/numerictextbox/bootstrap5.css +48 -0
- package/styles/numerictextbox/bootstrap5.scss +5 -0
- package/styles/numerictextbox/icons/_bootstrap5-dark.scss +1 -0
- package/styles/numerictextbox/icons/_bootstrap5.scss +12 -0
- package/styles/numerictextbox/icons/_tailwind-dark.scss +1 -12
- package/styles/slider/_bootstrap5-dark-definition.scss +1 -0
- package/styles/slider/_bootstrap5-definition.scss +90 -0
- package/styles/slider/_fabric-dark-definition.scss +2 -2
- package/styles/slider/_layout.scss +294 -69
- package/styles/slider/_material-dark-definition.scss +1 -1
- package/styles/slider/_tailwind-dark-definition.scss +1 -80
- package/styles/slider/_tailwind-definition.scss +32 -27
- package/styles/slider/_theme.scss +14 -6
- package/styles/slider/bootstrap-dark.css +2 -3
- package/styles/slider/bootstrap.css +2 -3
- package/styles/slider/bootstrap4.css +7 -9
- package/styles/slider/bootstrap5-dark.css +749 -0
- package/styles/slider/bootstrap5-dark.scss +5 -0
- package/styles/slider/bootstrap5.css +749 -0
- package/styles/slider/bootstrap5.scss +5 -0
- package/styles/slider/fabric-dark.css +3 -4
- package/styles/slider/fabric.css +2 -3
- package/styles/slider/highcontrast-light.css +3 -4
- package/styles/slider/highcontrast.css +3 -4
- package/styles/slider/material-dark.css +16 -16
- package/styles/slider/material.css +2 -2
- package/styles/slider/tailwind-dark.css +9 -8
- package/styles/slider/tailwind.css +7 -3
- package/styles/tailwind-dark.css +23 -13
- package/styles/tailwind.css +21 -8
- package/styles/textbox/_bootstrap5-dark-definition.scss +1 -0
- package/styles/textbox/_bootstrap5-definition.scss +0 -0
- package/styles/textbox/_tailwind-dark-definition.scss +1 -0
- package/styles/textbox/bootstrap5-dark.css +0 -0
- package/styles/textbox/bootstrap5-dark.scss +4 -0
- package/styles/textbox/bootstrap5.css +0 -0
- package/styles/textbox/bootstrap5.scss +4 -0
- package/styles/uploader/_bootstrap5-dark-definition.scss +1 -0
- package/styles/uploader/_bootstrap5-definition.scss +216 -0
- package/styles/uploader/_definition.scss +142 -0
- package/styles/uploader/_tailwind-dark-definition.scss +1 -216
- package/styles/uploader/_tailwind-definition.scss +21 -21
- package/styles/uploader/_theme.scss +2 -2
- package/styles/uploader/bootstrap5-dark.css +1079 -0
- package/styles/uploader/bootstrap5-dark.scss +6 -0
- package/styles/uploader/bootstrap5.css +1079 -0
- package/styles/uploader/bootstrap5.scss +6 -0
- package/styles/uploader/icons/_bootstrap5-dark.scss +1 -0
- package/styles/uploader/icons/_bootstrap5.scss +34 -0
- package/styles/uploader/icons/_tailwind-dark.scss +1 -35
- package/styles/uploader/material-dark.css +1 -1
- package/.eslintrc.json +0 -244
- package/styles/color-picker/_icons.scss +0 -10
- package/tslint.json +0 -111
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: ej2-inputs.umd.min.js
|
|
3
|
-
* version : 19.
|
|
3
|
+
* version : 19.3.47
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
7
|
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
8
|
* applicable laws.
|
|
9
9
|
*/
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-splitbuttons")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-popups","@syncfusion/ej2-splitbuttons"],t):t(e.ej={},e.ej2Base,e.ej2Popups,e.ej2Splitbuttons)}(this,function(e,t,i,s){"use strict";function n(){if(t.attributes(this.element,{role:"textbox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-live":"assertive","aria-valuenow":""}),this.mask){for(var e=this.mask.split("]"),i=0;i<e.length;i++)if("\\"===e[i][e[i].length-1]){e[i]=e[i]+"]";for(var s=e[i].split("["),n=0;n<s.length;n++)"\\"===s[n][s[n].length-1]&&(s[n]=s[n]+"["),p.call(this,s[n])}else{if((s=e[i].split("[")).length>1){var a=!1;for(n=0;n<s.length;n++)"\\"===s[n]?(this.customRegExpCollec.push("["),this.hiddenMask+=s[n]+"["):""===s[n]?a=!0:""!==s[n]&&a||n===s.length-1?(this.customRegExpCollec.push("["+s[n]+"]"),this.hiddenMask+=this.promptChar,a=!1):p.call(this,s[n])}else p.call(this,s[0])}if(this.escapeMaskValue=this.hiddenMask,this.promptMask=this.hiddenMask.replace(/[09?LCAa#&]/g,this.promptChar),!t.isNullOrUndefined(this.customCharacters))for(i=0;i<this.promptMask.length;i++)t.isNullOrUndefined(this.customCharacters[this.promptMask[i]])||(this.promptMask=this.promptMask.replace(new RegExp(this.promptMask[i],"g"),this.promptChar));var l=0;if(this.hiddenMask.match(new RegExp(/\\/)))for(i=0;i<this.hiddenMask.length;i++){n=0;i>=1&&(n=i),n-=l=this.hiddenMask.length-this.promptMask.length,i>0&&"\\"!==this.hiddenMask[i-1]&&(">"===this.hiddenMask[i]||"<"===this.hiddenMask[i]||"|"===this.hiddenMask[i])&&(this.promptMask=this.promptMask.substring(0,n)+this.promptMask.substring(i+1-l,this.promptMask.length),this.escapeMaskValue=this.escapeMaskValue.substring(0,n)+this.escapeMaskValue.substring(i+1-l,this.escapeMaskValue.length)),"\\"===this.hiddenMask[i]&&(this.promptMask=this.promptMask.substring(0,n)+this.hiddenMask[i+1]+this.promptMask.substring(i+2-l,this.promptMask.length),this.escapeMaskValue=this.escapeMaskValue.substring(0,n)+this.escapeMaskValue[i+1]+this.escapeMaskValue.substring(i+2-l,this.escapeMaskValue.length))}else this.promptMask=this.promptMask.replace(/[>|<]/g,""),this.escapeMaskValue=this.hiddenMask.replace(/[>|<]/g,"");t.attributes(this.element,{"aria-invalid":"false"})}}function a(){R.call(this,this.promptMask),F.call(this,this.value)}function l(){t.EventHandler.add(this.element,"keydown",x,this),t.EventHandler.add(this.element,"keypress",P,this),t.EventHandler.add(this.element,"keyup",A,this),t.EventHandler.add(this.element,"input",S,this),t.EventHandler.add(this.element,"focus",v,this),t.EventHandler.add(this.element,"blur",y,this),t.EventHandler.add(this.element,"paste",b,this),t.EventHandler.add(this.element,"cut",E,this),t.EventHandler.add(this.element,"drop",C,this),t.EventHandler.add(this.element,"mousedown",m,this),t.EventHandler.add(this.element,"mouseup",f,this),this.enabled&&(o.call(this),this.formElement&&t.EventHandler.add(this.formElement,"reset",d,this))}function r(){t.EventHandler.remove(this.element,"keydown",x),t.EventHandler.remove(this.element,"keypress",P),t.EventHandler.remove(this.element,"keyup",A),t.EventHandler.remove(this.element,"input",S),t.EventHandler.remove(this.element,"focus",v),t.EventHandler.remove(this.element,"blur",y),t.EventHandler.remove(this.element,"paste",b),t.EventHandler.remove(this.element,"cut",E),t.EventHandler.remove(this.element,"mousedown",m),t.EventHandler.remove(this.element,"mouseup",f),this.formElement&&t.EventHandler.remove(this.formElement,"reset",d)}function o(){this.showClearButton&&t.EventHandler.add(this.inputObj.clearButton,"mousedown touchstart",h,this)}function h(e){e.preventDefault(),this.inputObj.clearButton.classList.contains("e-clear-icon-hide")||(function(e){var t=this.element.value;R.call(this,this.promptMask),this.redoCollec.unshift({value:this.promptMask,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),L.call(this,e,t),this.element.setSelectionRange(0,0)}.call(this,e),this.value="")}function d(){"EJS-MASKEDTEXTBOX"===this.element.tagName?R.call(this,this.promptMask):this.value=this.initInputValue}function u(e){return e.value}function c(e,i){var s="",n=0,a=!1,l=t.isNullOrUndefined(i)?t.isNullOrUndefined(e)||t.isNullOrUndefined(this)?i:e.value:i;if(l!==this.promptMask)for(var r=0;r<this.customRegExpCollec.length;r++)a&&(a=!1),">"!==this.customRegExpCollec[n]&&"<"!==this.customRegExpCollec[n]&&"|"!==this.customRegExpCollec[n]&&"\\"!==this.customRegExpCollec[n]||(--r,a=!0),a||l[r]!==this.promptChar&&!t.isNullOrUndefined(this.customRegExpCollec[n])&&(this._callPasteHandler||!t.isNullOrUndefined(this.regExpCollec[this.customRegExpCollec[n]])||this.customRegExpCollec[n].length>2&&"["===this.customRegExpCollec[n][0]&&"]"===this.customRegExpCollec[n][this.customRegExpCollec[n].length-1]||!t.isNullOrUndefined(this.customCharacters)&&!t.isNullOrUndefined(this.customCharacters[this.customRegExpCollec[n]]))&&""!==l&&(s+=l[r]),++n;return(null===this.mask||""===this.mask&&void 0!==this.value)&&(s=l),s}function p(e){for(var t=0;t<e.length;t++)this.hiddenMask+=e[t],"\\"!==e[t]&&this.customRegExpCollec.push(e[t])}function m(){this.isClicked=!0}function f(){this.isClicked=!1}function v(e){var i=this,s=this.element,n=0,a=c.call(this,s),l=!1,r=!1,o={selectionStart:s.selectionStart,event:e,value:this.value,maskedValue:s.value,container:this.inputObj.container,selectionEnd:s.selectionEnd};if(this.isClicked||g.call(this,o,s),this.mask&&(null!==a&&""!==a||"Always"===this.floatLabelType||null===this.placeholder||""===this.placeholder||(s.value=this.promptMask),setTimeout(function(){if(s.selectionStart===i.promptMask.length||s.value[s.selectionStart]===i.promptChar)l=!0;else for(var e=s.selectionStart;e<i.promptMask.length;e++){if(s.value[e]===i.promptChar){l=!0;break}if(s.value[e]!==i.promptMask[e]){l=!1;break}}}),setTimeout(function(){var e=s.selectionStart-1;if(e===i.promptMask.length-1||s.value[e]===i.promptChar)r=!0;else for(var t=e;t>=0;t--){if(s.value[t]===i.promptChar){r=!0;break}if(s.value[t]!==i.promptMask[t]){r=!1;break}}}),this.isClicked||"Always"!==this.floatLabelType&&(null===a||""===a)&&null!==this.placeholder&&""!==this.placeholder)){for(n=0;n<this.promptMask.length;n++)if(s.value[n]===this.promptChar){setTimeout(function(){(l||r)&&(s.selectionEnd=n,s.selectionStart=n),o={selectionStart:s.selectionStart,event:e,value:i.value,maskedValue:s.value,container:i.inputObj.container,selectionEnd:s.selectionEnd},g.call(i,o,s)});break}t.isNullOrUndefined(s.value.match(this.promptChar))&&(o={selectionStart:s.selectionStart,event:e,value:this.value,maskedValue:s.value,container:this.inputObj.container,selectionEnd:s.selectionEnd},g.call(this,o,s)),this.isClicked=!1}}function g(e,t){this.trigger("focus",e,function(e){t.selectionStart=e.selectionStart,t.selectionEnd=e.selectionEnd})}function y(e){if(this.blurEventArgs={event:e,value:this.value,maskedValue:this.element.value,container:this.inputObj.container},this.trigger("blur",this.blurEventArgs),this.mask&&(this.isFocus=!1,this.placeholder&&this.element.value===this.promptMask&&"Always"!==this.floatLabelType)){R.call(this,"");var i=this.element.parentNode.querySelector(".e-float-text");"Auto"===this.floatLabelType&&!t.isNullOrUndefined(i)&&i.classList.contains(te)&&t.removeClass([i],te)}}function b(e){var t=this;if(this.mask&&!this.readonly){var i=this.element.selectionStart,s=this.element.selectionEnd,n=this.element.value;R.call(this,""),this._callPasteHandler=!0,setTimeout(function(){var a=t.element.value.replace(/ /g,"");t.redoCollec.length>0&&t.redoCollec[0].value===t.element.value&&(a=c.call(t,t.element)),R.call(t,n),t.element.selectionStart=i,t.element.selectionEnd=s;var l=0;t.maskKeyPress=!0;do{H.call(t,a[l],!1,null),++l}while(l<a.length);if(t.maskKeyPress=!1,t._callPasteHandler=!1,t.element.value===n){var r=0;t.maskKeyPress=!0;do{H.call(t,a[r],!1,null),++r}while(r<a.length);t.maskKeyPress=!1}else L.call(t,e,n)},1)}}function E(e){var t=this;if(this.mask&&!this.readonly){var i=this.element.value,s=this.element.selectionStart,n=this.element.selectionEnd;this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd});var a=this.element.value.substring(0,s)+this.promptMask.substring(s,n)+this.element.value.substring(n);setTimeout(function(){R.call(t,a),t.element.selectionStart=t.element.selectionEnd=s,t.element.value!==i&&L.call(t,e,null)},0)}}function C(e){e.preventDefault()}function S(e){if(!0!==t.Browser.isIE||""!==this.element.value||"Never"!==this.floatLabelType){if(t.extend(e,{ctrlKey:!1,keyCode:229}),this.mask){if(""===this.element.value&&this.redoCollec.unshift({value:this.promptMask,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),1===this.element.value.length&&(this.element.value=this.element.value+this.promptMask,this.element.setSelectionRange(1,1)),this._callPasteHandler||O.call(this,e),this.element.value.length>this.promptMask.length){var i=this.element.selectionStart,s=this.element.value.length-this.promptMask.length,n=this.element.value.substring(i-s,i);this.maskKeyPress=!1;var a=0;do{H.call(this,n[a],e.ctrlKey,e),++a}while(a<n.length);this.element.value!==this.preEleVal&&L.call(this,e,null)}var l=c.call(this,this.element);this.prevValue=l,this.value=l,""===l&&(R.call(this,this.promptMask),this.element.setSelectionRange(0,0))}}}function x(e){if(this.mask&&!this.readonly){229!==e.keyCode&&(!e.ctrlKey||89!==e.keyCode&&90!==e.keyCode||e.preventDefault(),O.call(this,e));var t=this.element.value;if(e.ctrlKey&&(89===e.keyCode||90===e.keyCode)){var i=void 0;90===e.keyCode&&this.undoCollec.length>0&&t!==this.undoCollec[this.undoCollec.length-1].value?(i=this.undoCollec[this.undoCollec.length-1],this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),R.call(this,i.value),this.element.selectionStart=i.startIndex,this.element.selectionEnd=i.endIndex,this.undoCollec.splice(this.undoCollec.length-1,1)):89===e.keyCode&&this.redoCollec.length>0&&t!==this.redoCollec[0].value&&(i=this.redoCollec[0],this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),R.call(this,i.value),this.element.selectionStart=i.startIndex,this.element.selectionEnd=i.endIndex,this.redoCollec.splice(0,1))}}}function T(){var e,t=this.element.selectionStart,i=this.element.selectionEnd;this.redoCollec.length>0?(e=this.redoCollec[0],R.call(this,e.value),e.startIndex-t==1?(this.element.selectionStart=e.startIndex,this.element.selectionEnd=e.endIndex):(this.element.selectionStart=t+1,this.element.selectionEnd=i+1)):(R.call(this,this.promptMask),this.element.selectionStart=this.element.selectionEnd=t)}function k(e,t,i){return"input"===i.type&&(e=!1,t=this.element.value,R.call(this,this.promptMask),F.call(this,t)),e}function O(e){var i,s=!1,n=!1;this.element.value.length<this.promptMask.length&&(s=!0,i=this.element.value,s=k.call(this,s,i,e),T.call(this)),this.element.value.length>=this.promptMask.length&&"input"===e.type&&(s=k.call(this,s,i,e));var a=this.element.selectionStart,l=this.element.selectionEnd,r=this.element.selectionStart,o=this.element.selectionEnd,h=this.hiddenMask.replace(/[>|\\<]/g,""),d=h[r-1],u=this.element.selectionEnd;if(s||8===e.keyCode||46===e.keyCode){this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:o});var c=!1,p=this.element.value;if(r>0||(8===e.keyCode||46===e.keyCode)&&r<this.element.value.length&&this.element.selectionEnd-r!==this.element.value.length){var m=r;r!==o?(r=o,46===e.keyCode&&(c=!0)):46===e.keyCode?++m:--m;for(var f=r;8===e.keyCode||s||c?f>m:f<m;8===e.keyCode||s||c?f--:f++)for(var v=r;8===e.keyCode||s||c?v>0:v<this.element.value.length;8===e.keyCode||s||c?v--:v++){var g=void 0;(8===e.keyCode||c)&&(a!==l&&a!==r||a===l)||s?(d=h[v-1],g=r-1):(d=h[v],g=r,++r);var y=this.element.value[g];if(t.isNullOrUndefined(this.regExpCollec[d])&&!t.isNullOrUndefined(this.customCharacters)&&t.isNullOrUndefined(this.customCharacters[d])&&this.hiddenMask[g]!==this.promptChar&&"["!==this.customRegExpCollec[g][0]&&"]"!==this.customRegExpCollec[g][this.customRegExpCollec[g].length-1]||this.promptMask[g]!==this.promptChar&&t.isNullOrUndefined(this.customCharacters))this.element.selectionStart=this.element.selectionEnd=g,e.preventDefault(),46!==e.keyCode||c||++this.element.selectionStart;else{var b=this.element.value,E=this.promptChar,C=b.substring(0,g)+E+b.substring(r,b.length);R.call(this,C),e.preventDefault(),46!==e.keyCode||c||g++,this.element.selectionStart=this.element.selectionEnd=g,n=!0}if(r=this.element.selectionStart,!n&&8===e.keyCode||c||!n&&46!==e.keyCode?g=r-1:(g=r,n=!1),y=this.element.value[g],a!==l&&this.element.selectionStart===a||this.promptMask[g]===this.promptChar||y!==this.promptMask[g]&&this.promptMask[g]!==this.promptChar&&!t.isNullOrUndefined(this.customCharacters))break}}46===e.keyCode&&c&&n&&(this.element.selectionStart=this.element.selectionEnd=u),0===this.element.selectionStart&&this.element.selectionEnd===this.element.value.length&&(R.call(this,this.promptMask),e.preventDefault(),this.element.selectionStart=this.element.selectionEnd=r),this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),this.element.value!==p&&L.call(this,e,i)}}function P(e){if(this.mask&&!this.readonly){var t=this.element.value;if(!e.ctrlKey||e.ctrlKey&&"KeyA"!==e.code&&"KeyY"!==e.code&&"KeyZ"!==e.code&&"KeyX"!==e.code&&"KeyC"!==e.code&&"KeyV"!==e.code){this.maskKeyPress=!0;var i=e.key;"Spacebar"===i&&(i=String.fromCharCode(e.keyCode)),i?i&&1===i.length&&(H.call(this,i,e.ctrlKey,e),e.preventDefault()):(this.isIosInvalid=!0,H.call(this,String.fromCharCode(e.keyCode),e.ctrlKey,e),e.preventDefault(),this.isIosInvalid=!1),32===e.keyCode&&" "===i&&" "===this.promptChar&&(this.element.selectionStart=this.element.selectionEnd=this.element.selectionStart-i.length)}this.element.value!==t&&L.call(this,e,t)}}function L(e,i){var s=this.isProtectedOnChange;if(!t.isNullOrUndefined(this.changeEventArgs)&&!this.isInitial){var n={};this.changeEventArgs={value:this.element.value,maskedValue:this.element.value,isInteraction:!1,isInteracted:!1},this.mask&&(this.changeEventArgs.value=c.call(this,this.element)),t.isNullOrUndefined(e)||(this.changeEventArgs.isInteracted=!0,this.changeEventArgs.isInteraction=!0,this.changeEventArgs.event=e),this.isProtectedOnChange=!0,this.value=this.changeEventArgs.value,this.isProtectedOnChange=s,t.merge(n,this.changeEventArgs),this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",n)}this.preEleVal=this.element.value,this.prevValue=c.call(this,this.element),t.attributes(this.element,{"aria-valuenow":this.element.value})}function A(e){if(this.mask&&!this.readonly){var i=void 0;if(this.maskKeyPress||229!==e.keyCode)U.call(this);else{var s=void 0;if(1===this.element.value.length&&(this.element.value=this.element.value+this.promptMask,this.element.setSelectionRange(1,1)),this.element.value.length>this.promptMask.length){var n=this.element.selectionStart,a=this.element.value.length-this.promptMask.length,l=this.element.value.substring(n-a,n);if(this.undoCollec.length>0){i=this.undoCollec[this.undoCollec.length-1];var r=this.element.selectionStart;s=i.value;var o=i.value.substring(r-a,r);i=this.redoCollec[0],l=l.trim();var h=t.Browser.isAndroid&&""===l;h||o===l||i.value.substring(r-a,r)===l?h&&B.call(this,e,r-1,this.element.selectionEnd-1,l,e.ctrlKey,!1):H.call(this,l,e.ctrlKey,e)}else s=this.promptMask,H.call(this,l,e.ctrlKey,e);this.maskKeyPress=!1,L.call(this,e,s)}}var d=c.call(this,this.element);(0!==this.element.selectionStart||this.promptMask!==this.element.value||""!==d||""===d&&this.value!==d)&&(this.prevValue=d,this.value=d)}else L.call(this,e);if(0===this.element.selectionStart&&0===this.element.selectionEnd){var u=this.element;setTimeout(function(){u.setSelectionRange(0,0)},0)}}function N(e){this.maskKeyPress||function(e){if(e.length>1&&this.promptMask.length+e.length<this.element.value.length){var t=this.redoCollec[0].value.substring(0,this.redoCollec[0].startIndex)+e+this.redoCollec[0].value.substring(this.redoCollec[0].startIndex,this.redoCollec[0].value.length);R.call(this,t),this.element.selectionStart=this.element.selectionEnd=this.redoCollec[0].startIndex+e.length}this.element.selectionStart=this.element.selectionStart-e.length,this.element.selectionEnd=this.element.selectionEnd-e.length}.call(this,e)}function H(e,i,s){if(N.call(this,e),!t.isNullOrUndefined(this)&&!t.isNullOrUndefined(e))for(var n,a,l=this.element.selectionStart,r=l,o=!1,h=this.element.value,d=!1,u=!1,c=0;c<e.length;c++){var p=e[c];if(l=this.element.selectionStart,this.maskKeyPress||r!==l||(l+=c),!this.maskKeyPress||l<this.promptMask.length){for(var m=l;m<this.promptMask.length;m++){n=this.escapeMaskValue[l],"\\"===this.hiddenMask[l]&&this.hiddenMask[l+1]===e&&(u=!0),(t.isNullOrUndefined(this.regExpCollec[n])&&(t.isNullOrUndefined(this.customCharacters)||!t.isNullOrUndefined(this.customCharacters)&&t.isNullOrUndefined(this.customCharacters[n]))&&this.hiddenMask[l]!==this.promptChar&&"["!==this.customRegExpCollec[l][0]&&"]"!==this.customRegExpCollec[l][this.customRegExpCollec[l].length-1]||this.promptMask[l]!==this.promptChar&&t.isNullOrUndefined(this.customCharacters)||this.promptChar===n&&this.escapeMaskValue===this.mask)&&(this.element.selectionStart=this.element.selectionEnd=l+1,l=this.element.selectionStart,n=this.hiddenMask[l])}if(t.isNullOrUndefined(this.customCharacters)||t.isNullOrUndefined(this.customCharacters[n]))!t.isNullOrUndefined(this.regExpCollec[n])&&p.match(new RegExp(this.regExpCollec[n]))&&this.promptMask[l]===this.promptChar?o=!0:this.promptMask[l]===this.promptChar&&"["===this.customRegExpCollec[l][0]&&"]"===this.customRegExpCollec[l][this.customRegExpCollec[l].length-1]&&p.match(new RegExp(this.customRegExpCollec[l]))&&(o=!0);else{var f=this.customCharacters[n].split(",");for(m=0;m<f.length;m++)if(p.match(new RegExp("["+f[m]+"]"))){o=!0;break}}if((!this.maskKeyPress||l<this.hiddenMask.length)&&o){if(0===c)if(this.maskKeyPress)this.undoCollec.push({value:h,startIndex:l,endIndex:l});else{var v=this.element.selectionStart,g=this.element.selectionEnd;this.redoCollec.length>0?(a=this.redoCollec[0].value,R.call(this,a),this.undoCollec.push(this.redoCollec[0])):(this.undoCollec.push({value:this.promptMask,startIndex:l,endIndex:l}),a=this.promptMask,R.call(this,a)),this.element.selectionStart=v,this.element.selectionEnd=g}l=this.element.selectionStart,function(e,t,i,s,n){this.hiddenMask.length>this.promptMask.length&&(i=function(e,t){var i,s,n=t,a=0;for(s=0;s<this.hiddenMask.length;s++)if("\\"===this.hiddenMask[s]&&(i=n.substring(0,s)+"\\"+n.substring(s,n.length)),">"!==this.hiddenMask[s]&&"<"!==this.hiddenMask[s]&&"|"!==this.hiddenMask[s]||(this.hiddenMask[s]!==n[s]&&(i=n.substring(0,s)+this.hiddenMask[s]+n.substring(s,n.length)),++a),i){if(i[s]===this.promptChar&&s>this.element.selectionStart||this.element.value.indexOf(this.promptChar)<0&&this.element.selectionStart+a===s){a=0;break}n=i}for(;s>=0&&i;){if(0===s||"\\"!==i[s-1]){if(">"===i[s]){e=e.toUpperCase();break}if("<"===i[s]){e=e.toLowerCase();break}if("|"===i[s])break}--s}return e}.call(this,i,this.element.value));if(!n){var a=this.element.value,l=a.substring(0,t)+i+a.substring(t+1,a.length);R.call(this,l),this.element.selectionStart=this.element.selectionEnd=t+1}}.call(this,s,l,p,a,u),d=!0,c===e.length-1&&this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),o=!1}else l=this.element.selectionStart,B.call(this,s,l,r,e,i,d);c!==e.length-1||o||(!t.Browser.isAndroid||t.Browser.isAndroid&&l<this.promptMask.length)&&this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd})}else 1!==e.length||i||t.isNullOrUndefined(s)||w.call(this)}}function B(e,i,s,n,a,l){if(!this.maskKeyPress){var r=this.element.value;i>=this.promptMask.length?R.call(this,r.substring(0,i)):(s===i?R.call(this,r.substring(0,i)+r.substring(i+1,r.length)):this.promptMask.length===this.element.value.length?R.call(this,r.substring(0,i)+r.substring(i,r.length)):R.call(this,r.substring(0,s)+r.substring(s+1,r.length)),this.element.selectionStart=this.element.selectionEnd=l||this.element.value[s]!==this.promptChar?i:s),w.call(this)}1!==n.length||a||t.isNullOrUndefined(e)||w.call(this)}function w(){var e=this,i=this.element.parentNode,s=200;i.classList.contains(J)||i.classList.contains(Q)?t.addClass([i],$):t.addClass([this.element],$),!0===this.isIosInvalid&&(s=400),t.attributes(this.element,{"aria-invalid":"true"}),setTimeout(function(){e.maskKeyPress||U.call(e)},s)}function U(){var e=this.element.parentNode;t.isNullOrUndefined(e)||t.removeClass([e],$),t.removeClass([this.element],$),t.attributes(this.element,{"aria-invalid":"false"})}function F(e){if(this.mask&&void 0!==e&&(void 0===this.prevValue||this.prevValue!==e)){if(this.maskKeyPress=!0,R.call(this,this.promptMask),""===e||null===e&&"Never"===this.floatLabelType&&this.placeholder||(this.element.selectionStart=0,this.element.selectionEnd=0),null!==e)for(var i=0;i<e.length;i++)H.call(this,e[i],!1,null);var s=c.call(this,this.element);this.prevValue=s,this.value=s,L.call(this,null,null),this.maskKeyPress=!1;var n=this.element.parentNode.querySelector(".e-float-text");this.element.value===this.promptMask&&"Auto"===this.floatLabelType&&this.placeholder&&!t.isNullOrUndefined(n)&&n.classList.contains(te)&&!this.isFocus&&(t.removeClass([n],te),t.addClass([n],ie),R.call(this,""))}(null===this.mask||""===this.mask&&void 0!==this.value)&&R.call(this,this.value)}function R(i,s){!this.isFocus&&"Auto"===this.floatLabelType&&this.placeholder&&t.isNullOrUndefined(this.value)&&(i="");var n=c.call(this,s||this.element,i);null===n||""===n?(e.Input.setValue(i,s||this.element,this.floatLabelType,!1),this.showClearButton&&this.inputObj.clearButton.classList.add("e-clear-icon-hide")):e.Input.setValue(i,s||this.element,this.floatLabelType,this.showClearButton)}function V(e){t.addClass([e.element],ee);var i={element:e.element,mask:e.mask,promptMask:"",hiddenMask:"",escapeMaskValue:"",promptChar:e.promptChar?e.promptChar.length>1?e.promptChar=e.promptChar[0]:e.promptChar:"_",value:e.value?e.value:null,regExpCollec:se,customRegExpCollec:[],customCharacters:e.customCharacters,undoCollec:[],redoCollec:[],maskKeyPress:!1,prevValue:""};return n.call(i),i}function M(e){var i;return!t.isNullOrUndefined(e)&&e.element.classList.contains(ee)&&(i=V(e)),i}var I={RTL:"e-rtl",DISABLE:"e-disabled",INPUT:"e-input",TEXTAREA:"e-multi-line-input",INPUTGROUP:"e-input-group",FLOATINPUT:"e-float-input",FLOATLINE:"e-float-line",FLOATTEXT:"e-float-text",CLEARICON:"e-clear-icon",CLEARICONHIDE:"e-clear-icon-hide",LABELTOP:"e-label-top",LABELBOTTOM:"e-label-bottom",NOFLOATLABEL:"e-no-float-label",INPUTCUSTOMTAG:"e-input-custom-tag",FLOATCUSTOMTAG:"e-float-custom-tag"};!function(e){function i(e){s(e.floatLabelType,e.element),e.element.addEventListener("focus",function(){var e=u(this);(e.classList.contains("e-input-group")||e.classList.contains("e-outline")||e.classList.contains("e-filled"))&&e.classList.add("e-input-focus")}),e.element.addEventListener("blur",function(){var e=u(this);(e.classList.contains("e-input-group")||e.classList.contains("e-outline")||e.classList.contains("e-filled"))&&e.classList.remove("e-input-focus")}),e.element.addEventListener("input",function(){s(H,e.element)})}function s(e,i){var s=i.value;""!==s&&!t.isNullOrUndefined(s)&&i.parentElement?i.parentElement.classList.add("e-valid-input"):"Always"!==e&&i.parentElement&&i.parentElement.classList.remove("e-valid-input")}function n(){var e=u(this).getElementsByClassName("e-float-text")[0];t.isNullOrUndefined(e)||(t.addClass([e],I.LABELTOP),e.classList.contains(I.LABELBOTTOM)&&t.removeClass([e],I.LABELBOTTOM))}function a(){var e=u(this);if(e.getElementsByTagName("textarea")[0]?""===e.getElementsByTagName("textarea")[0].value:""===e.getElementsByTagName("input")[0].value){var i=e.getElementsByClassName("e-float-text")[0];t.isNullOrUndefined(i)||(i.classList.contains(I.LABELTOP)&&t.removeClass([i],I.LABELTOP),t.addClass([i],I.LABELBOTTOM))}}function l(e){e.addEventListener("focus",n),e.addEventListener("blur",a)}function r(e,i,s){var n=t.isNullOrUndefined(s)?t.createElement:s;"Auto"===e.floatLabelType&&l(e.element),t.isNullOrUndefined(i.container)?(i.container=m(e,I.FLOATINPUT,I.FLOATCUSTOMTAG,"div",n),e.element.parentNode&&e.element.parentNode.insertBefore(i.container,e.element)):(t.isNullOrUndefined(e.customTag)||i.container.classList.add(I.FLOATCUSTOMTAG),i.container.classList.add(I.FLOATINPUT));var a=n("span",{className:I.FLOATLINE}),r=n("label",{className:I.FLOATTEXT});if(t.isNullOrUndefined(e.element.id)||""===e.element.id||(r.id="label_"+e.element.id.replace(/ /g,"_"),t.attributes(e.element,{"aria-labelledby":r.id})),t.isNullOrUndefined(e.element.placeholder)||""===e.element.placeholder||(r.innerText=f(e.element.placeholder),e.element.removeAttribute("placeholder")),t.isNullOrUndefined(e.properties)||t.isNullOrUndefined(e.properties.placeholder)||""===e.properties.placeholder||(r.innerText=f(e.properties.placeholder)),r.innerText||i.container.classList.add(I.NOFLOATLABEL),i.container.classList.contains("e-float-icon-left")){var o=i.container.querySelector(".e-input-in-wrap");o.appendChild(e.element),o.appendChild(a),o.appendChild(r)}else i.container.appendChild(e.element),i.container.appendChild(a),i.container.appendChild(r);d(e.element.value,r),"Always"===e.floatLabelType&&(r.classList.contains(I.LABELBOTTOM)&&t.removeClass([r],I.LABELBOTTOM),t.addClass([r],I.LABELTOP)),"Auto"===e.floatLabelType&&(e.element.addEventListener("input",function(t){d(e.element.value,r)}),e.element.addEventListener("blur",function(t){d(e.element.value,r)})),t.isNullOrUndefined(e.element.getAttribute("id"))||r.setAttribute("for",e.element.getAttribute("id"))}function o(e,t){"Always"===e&&t.classList.contains("e-outline")&&t.classList.add("e-valid-input")}function h(e,i){e?t.removeClass([i],I.CLEARICONHIDE):t.addClass([i],I.CLEARICONHIDE)}function d(e,i){e?(t.addClass([i],I.LABELTOP),i.classList.contains(I.LABELBOTTOM)&&t.removeClass([i],I.LABELBOTTOM)):(i.classList.contains(I.LABELTOP)&&t.removeClass([i],I.LABELTOP),t.addClass([i],I.LABELBOTTOM))}function u(e){var i=t.isNullOrUndefined(e.parentNode)?e:e.parentNode;return i&&i.classList.contains("e-input-in-wrap")&&(i=i.parentNode),i}function c(e,i,s){(void 0==B||B)&&i.addEventListener("click",function(s){e.classList.contains(I.DISABLE)||e.readOnly||(s.preventDefault(),e!==document.activeElement&&e.focus(),e.value="",t.addClass([i],I.CLEARICONHIDE))}),e.addEventListener("input",function(t){h(e.value,i)}),e.addEventListener("focus",function(t){h(e.value,i)}),e.addEventListener("blur",function(e){setTimeout(function(){t.addClass([i],I.CLEARICONHIDE)},200)})}function p(e,t){if(u(e).classList.contains(I.FLOATINPUT)&&"Auto"===t){var i=u(e).getElementsByClassName("e-float-text")[0];d(e.value,i)}}function m(e,i,s,n,a){var l,r=t.isNullOrUndefined(a)?t.createElement:a;return t.isNullOrUndefined(e.customTag)?l=r(n,{className:i}):(l=r(e.customTag,{className:i})).classList.add(s),l.classList.add("e-control-wrapper"),l}function f(e){var i="";if(!t.isNullOrUndefined(e)&&""!==e){var s=document.createElement("span");s.innerHTML='<input placeholder="'+e+'"/>';i=s.children[0].placeholder}return i}function v(e,i,s){t.isNullOrUndefined(s)||""===s||t.removeClass(i,s.split(" ")),t.isNullOrUndefined(e)||""===e||t.addClass(i,e.split(" "))}function g(e,i){e=f(e);var s=u(i);s.classList.contains(I.FLOATINPUT)?t.isNullOrUndefined(e)||""===e?(s.classList.add(I.NOFLOATLABEL),s.getElementsByClassName(I.FLOATTEXT)[0].textContent=""):(s.getElementsByClassName(I.FLOATTEXT)[0].textContent=e,s.classList.remove(I.NOFLOATLABEL),i.removeAttribute("placeholder")):t.isNullOrUndefined(e)||""===e?(i.removeAttribute("placeholder"),i.removeAttribute("aria-placeholder")):t.attributes(i,{placeholder:e,"aria-placeholder":e})}function y(e,i,s){e?t.attributes(i,{readonly:""}):i.removeAttribute("readonly"),t.isNullOrUndefined(s)||p(i,s)}function b(e,i){e?t.addClass(i,I.RTL):t.removeClass(i,I.RTL)}function E(e,i,s,n){var a={disabled:"disabled","aria-disabled":"true"},l=!t.isNullOrUndefined(n);e?(i.classList.remove(I.DISABLE),S(a,i),l&&t.removeClass([n],I.DISABLE)):(i.classList.add(I.DISABLE),x(a,i),l&&t.addClass([n],I.DISABLE)),t.isNullOrUndefined(s)||p(i,s)}function C(e,i,s,n,a){var l=t.isNullOrUndefined(a)?t.createElement:a;e?s.clearButton=function(e,i,s,n){var a=(t.isNullOrUndefined(n)?t.createElement:n)("span",{className:I.CLEARICON}),l=i.container;t.isNullOrUndefined(s)?(i.container.classList.contains(I.FLOATINPUT)?i.container.querySelector("."+I.FLOATTEXT):e).insertAdjacentElement("afterend",a):l.appendChild(a);return!t.isNullOrUndefined(l)&&l.classList.contains(I.FLOATINPUT)&&t.addClass([l],I.INPUTGROUP),t.addClass([a],I.CLEARICONHIDE),c(e,a),a.setAttribute("aria-label","close"),a}(i,s,n,l):(t.remove(s.clearButton),s.clearButton=null)}function S(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){var n=s[i],a=u(t);"disabled"===n&&t.classList.remove(I.DISABLE),"disabled"===n&&a.classList.contains(I.INPUTGROUP)&&a.classList.remove(I.DISABLE),"placeholder"===n&&a.classList.contains(I.FLOATINPUT)?a.getElementsByClassName(I.FLOATTEXT)[0].textContent="":t.removeAttribute(n)}}function x(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){var n=s[i],a=u(t);"disabled"===n&&t.classList.add(I.DISABLE),"disabled"===n&&a.classList.contains(I.INPUTGROUP)&&a.classList.add(I.DISABLE),"placeholder"===n&&a.classList.contains(I.FLOATINPUT)?a.getElementsByClassName(I.FLOATTEXT)[0].textContent=e[n]:t.setAttribute(n,e[n])}}function T(e,i,s){var n=[];n.push(s);var a=t.isNullOrUndefined(s)?i.querySelectorAll(".e-input-group-icon"):n;if(e&&a.length>0)for(var l=0;l<a.length;l++)a[l].addEventListener("mousedown",k,!1),a[l].addEventListener("mouseup",O,!1);else if(a.length>0)for(l=0;l<a.length;l++)a[l].removeEventListener("mousedown",k,this),a[l].removeEventListener("mouseup",O,this)}function k(){for(var e=this.parentElement;!e.classList.contains("e-input-group");)e=e.parentElement;!function(e,t){e.classList.contains("e-disabled")||e.querySelector("input").readOnly||t.classList.add("e-input-btn-ripple")}(e,this)}function O(){var e=this;setTimeout(function(){e.classList.remove("e-input-btn-ripple")},500)}function P(e,t){var i=t("span",{className:e});return i.classList.add("e-input-group-icon"),i}function L(e,i,s,n){var a=t.isNullOrUndefined(n)?t.createElement:n,l=P(e,a);i.classList.add("e-float-icon-left");var r=i.querySelector(".e-input-in-wrap");if(t.isNullOrUndefined(r)){r=a("span",{className:"e-input-in-wrap"}),s.parentNode.insertBefore(r,s);var o=i.querySelectorAll(s.tagName+" ~ *");r.appendChild(s);for(var h=0;h<o.length;h++)r.appendChild(o[h])}return r.parentNode.insertBefore(l,r),i.classList.contains(I.INPUTGROUP)||i.classList.add(I.INPUTGROUP),T(!0,i,l),l}function A(e,i,s){var n=P(e,t.isNullOrUndefined(s)?t.createElement:s);i.classList.contains(I.INPUTGROUP)||i.classList.add(I.INPUTGROUP);return(i.classList.contains("e-float-icon-left")?i.querySelector(".e-input-in-wrap"):i).appendChild(n),T(!0,i,n),n}function N(e,t){"hidden"===t.type?e.classList.add("e-hidden"):e.classList.contains("e-hidden")&&e.classList.remove("e-hidden")}var H,B=!0;e.createInput=function(e,s){var n=t.isNullOrUndefined(s)?t.createElement:s,a={container:null,buttons:[],clearButton:null};if(H=e.floatLabelType,B=e.bindClearAction,t.isNullOrUndefined(e.floatLabelType)||"Never"===e.floatLabelType?(a.container=m(e,I.INPUTGROUP,I.INPUTCUSTOMTAG,"span",n),e.element.parentNode.insertBefore(a.container,e.element),t.addClass([e.element],I.INPUT),a.container.appendChild(e.element)):r(e,a,n),i(e),t.isNullOrUndefined(e.properties)||t.isNullOrUndefined(e.properties.showClearButton)||!e.properties.showClearButton||"TEXTAREA"===e.element.tagName||(C(e.properties.showClearButton,e.element,a,!0,n),a.clearButton.setAttribute("role","button"),a.container.classList.contains(I.FLOATINPUT)&&t.addClass([a.container],I.INPUTGROUP)),!t.isNullOrUndefined(e.buttons)&&"TEXTAREA"!==e.element.tagName)for(var l=0;l<e.buttons.length;l++)a.buttons.push(A(e.buttons[l],a.container,n));return t.isNullOrUndefined(e.element)||"TEXTAREA"!==e.element.tagName||t.addClass([a.container],I.TEXTAREA),N(a.container,e.element),a=function(e,i){if(!t.isNullOrUndefined(e.properties))for(var s=0,n=Object.keys(e.properties);s<n.length;s++){var a=n[s];switch(a){case"cssClass":v(e.properties.cssClass,[i.container]),o(e.floatLabelType,i.container);break;case"enabled":E(e.properties.enabled,e.element,e.floatLabelType,i.container);break;case"enableRtl":b(e.properties.enableRtl,[i.container]);break;case"placeholder":g(e.properties.placeholder,e.element);break;case"readonly":y(e.properties.readonly,e.element)}}return i}(e,a)},e.bindInitialEvent=i,e.wireFloatingEvents=l,e.wireClearBtnEvents=c,e.setValue=function(e,i,n,a){if(i.value=e,t.isNullOrUndefined(n)||"Auto"!==n||p(i,n),!t.isNullOrUndefined(a)&&a){var l=u(i);if(!t.isNullOrUndefined(l)){var r=l.getElementsByClassName(I.CLEARICON)[0];t.isNullOrUndefined(r)||(i.value&&l.classList.contains("e-input-focus")?t.removeClass([r],I.CLEARICONHIDE):t.addClass([r],I.CLEARICONHIDE))}}s(n,i)},e.setCssClass=v,e.setWidth=function(e,i){"number"==typeof e?i.style.width=t.formatUnit(e):"string"==typeof e&&(i.style.width=e.match(/px|%|em/)?e:t.formatUnit(e))},e.setPlaceholder=g,e.setReadonly=y,e.setEnableRtl=b,e.setEnabled=E,e.setClearButton=C,e.removeAttributes=S,e.addAttributes=x,e.removeFloating=function(e){var i=e.container;if(!t.isNullOrUndefined(i)&&i.classList.contains(I.FLOATINPUT)){var s=i.querySelector("textarea")?i.querySelector("textarea"):i.querySelector("input"),l=i.querySelector("."+I.FLOATTEXT).textContent,r=null!==i.querySelector(".e-clear-icon");t.detach(i.querySelector("."+I.FLOATLINE)),t.detach(i.querySelector("."+I.FLOATTEXT)),t.classList(i,[I.INPUTGROUP],[I.FLOATINPUT]),function(e){e.removeEventListener("focus",n),e.removeEventListener("blur",a)}(s),t.attributes(s,{placeholder:l}),s.classList.add(I.INPUT),r||"INPUT"!==s.tagName||s.removeAttribute("required")}},e.addFloating=function(e,i,s,n){var a=t.isNullOrUndefined(n)?t.createElement:n,l=t.closest(e,"."+I.INPUTGROUP);if(H=i,"Never"!==i){var h=l.tagName,d={element:e,floatLabelType:i,customTag:h="DIV"!==h&&"SPAN"!==h?h:null,properties:{placeholder:s}},u=l.querySelector(".e-clear-icon"),c={container:l};e.classList.remove(I.INPUT),r(d,c,a);var p=l.classList.contains("e-float-icon-left");if(t.isNullOrUndefined(u)&&(u=p?l.querySelector(".e-input-in-wrap").querySelector(".e-input-group-icon"):l.querySelector(".e-input-group-icon")),t.isNullOrUndefined(u))p&&(u=l.querySelector(".e-input-group-icon")),t.isNullOrUndefined(u)&&l.classList.remove(I.INPUTGROUP);else{var m=l.querySelector("."+I.FLOATLINE),f=l.querySelector("."+I.FLOATTEXT),v=p?l.querySelector(".e-input-in-wrap"):l;v.insertBefore(e,u),v.insertBefore(m,u),v.insertBefore(f,u)}}o(i,e.parentElement)},e.setRipple=function(e,t){for(var i=0;i<t.length;i++)T(e,t[i].container)},e.addIcon=function(e,t,i,s,n){var a="string"==typeof t?t.split(","):t;if("append"===e.toLowerCase())for(var l=0,r=a;l<r.length;l++)A(r[l],i,n);else for(var o=0,h=a;o<h.length;o++)L(h[o],i,s,n)},e.prependSpan=L,e.appendSpan=A,e.validateInputType=N}(e.Input||(e.Input={}));var D=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)}}(),z=function(e,t,i,s){var n,a=arguments.length,l=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(l=(a<3?n(l):a>3?n(t,i,l):n(t,i))||l);return a>3&&l&&Object.defineProperty(t,i,l),l},q="e-input-group-icon",W="e-spin-up",j="e-spin-down",_="increment",X="decrement",K=new RegExp("^(-)?(\\d*)$"),Z="e-input-focus",Y=["title","style","class"],G=function(i){function s(e,t){var s=i.call(this,e,t)||this;return s.isVue=!1,s.preventChange=!1,s.isAngular=!1,s.isDynamicChange=!1,s.numericOptions=e,s}return D(s,i),s.prototype.preRender=function(){this.isPrevFocused=!1,this.decimalSeparator=".",this.intRegExp=new RegExp("/^(-)?(d*)$/"),this.isCalled=!1;var e=t.getValue("ej2_instances",this.element);if(this.cloneElement=this.element.cloneNode(!0),t.removeClass([this.cloneElement],["e-control","e-numerictextbox","e-lib"]),this.angularTagName=null,this.formEle=t.closest(this.element,"form"),"EJS-NUMERICTEXTBOX"===this.element.tagName){this.angularTagName=this.element.tagName;for(var i=this.createElement("input"),s=0;s<this.element.attributes.length;s++){"id"!==this.element.attributes[s].nodeName&&(i.setAttribute(this.element.attributes[s].nodeName,this.element.attributes[s].nodeValue),i.innerHTML=this.element.innerHTML)}this.element.hasAttribute("name")&&this.element.removeAttribute("name"),this.element.classList.remove("e-control","e-numerictextbox"),this.element.appendChild(i),this.element=i,t.setValue("ej2_instances",e,this.element)}if(!t.isBlazor()||!this.isServerRendered){t.attributes(this.element,{role:"spinbutton",tabindex:"0",autocomplete:"off","aria-live":"assertive"});var n={incrementTitle:"Increment value",decrementTitle:"Decrement value",placeholder:this.placeholder};this.l10n=new t.L10n("numerictextbox",n,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0)}this.isValidState=!0,this.inputStyle=null,this.inputName=null,this.cultureInfo={},this.initCultureInfo(),this.initCultureFunc(),this.prevValue=this.value,t.isBlazor()&&this.isServerRendered||(this.updateHTMLAttrToElement(),this.checkAttributes(!1),this.formEle&&(this.inputEleValue=this.value)),this.validateMinMax(),this.validateStep(),null!==this.placeholder||t.isBlazor()&&this.isServerRendered||this.updatePlaceholder()},s.prototype.render=function(){"input"===this.element.tagName.toLowerCase()&&(t.isBlazor()&&this.isServerRendered?(this.container=this.element.parentElement,this.inputWrapper={container:this.container},this.hiddenInput=this.container.querySelector('input[type="hidden"]'),this.showClearButton&&(this.inputWrapper.clearButton=this.container.querySelector(".e-clear-icon"),e.Input.wireClearBtnEvents(this.element,this.inputWrapper.clearButton,this.inputWrapper.container)),this.showSpinButton&&(this.spinDown=this.container.querySelector("."+j),this.spinUp=this.container.querySelector("."+W),this.wireSpinBtnEvents()),e.Input.bindInitialEvent({element:this.element,buttons:null,customTag:null,floatLabelType:this.floatLabelType,properties:this.properties})):(this.createWrapper(),this.showSpinButton&&this.spinBtnCreation(),this.setElementWidth(this.width),this.container.classList.contains("e-input-group")||this.container.classList.add("e-input-group"),this.changeValue(null===this.value||isNaN(this.value)?null:this.strictMode?this.trimValue(this.value):this.value)),this.wireEvents(),t.isBlazor()&&this.isServerRendered||(null===this.value||isNaN(this.value)||this.decimals&&this.setProperties({value:this.roundNumber(this.value,this.decimals)},!0),(this.element.getAttribute("value")||this.value)&&(this.element.setAttribute("value",this.element.value),this.hiddenInput.setAttribute("value",this.hiddenInput.value))),this.elementPrevValue=this.element.value,this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false"),this.renderComplete())},s.prototype.checkAttributes=function(e){for(var i=0,s=e?t.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["value","min","max","step","disabled","readonly","style","name","placeholder"];i<s.length;i++){var n=s[i];if(!t.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"disabled":if(t.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.enabled||e){var a="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n);this.setProperties({enabled:a},!e)}break;case"readonly":if(t.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.readonly||e){var l="readonly"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n);this.setProperties({readonly:l},!e)}break;case"placeholder":(t.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.placeholder||e)&&this.setProperties({placeholder:this.element.placeholder},!e);break;case"value":if(t.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.value||e){var r=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));this.setProperties(t.setValue(n,r,{}),!e)}break;case"min":if(t.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.min||e){var o=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));null===o||isNaN(o)||this.setProperties(t.setValue(n,o,{}),!e)}break;case"max":if(t.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.max||e){var h=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));null===h||isNaN(h)||this.setProperties(t.setValue(n,h,{}),!e)}break;case"step":if(t.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.step||e){var d=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));null===d||isNaN(d)||this.setProperties(t.setValue(n,d,{}),!e)}break;case"style":this.inputStyle=this.element.getAttribute(n);break;case"name":this.inputName=this.element.getAttribute(n);break;default:var u=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));(null!==u&&!isNaN(u)||"value"===n)&&this.setProperties(t.setValue(n,u,{}),!0)}}},s.prototype.updatePlaceholder=function(){this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0)},s.prototype.initCultureFunc=function(){this.instance=new t.Internationalization(this.locale)},s.prototype.initCultureInfo=function(){this.cultureInfo.format=this.format,null!==t.getValue("currency",this)&&(t.setValue("currency",this.currency,this.cultureInfo),this.setProperties({currencyCode:this.currency},!0))},s.prototype.createWrapper=function(){var i=this.cssClass;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(i=this.getNumericValidClassList(this.cssClass));var s=e.Input.createInput({element:this.element,floatLabelType:this.floatLabelType,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:i,enableRtl:this.enableRtl,showClearButton:this.showClearButton,enabled:this.enabled}},this.createElement);this.inputWrapper=s,this.container=s.container,this.container.setAttribute("class","e-control-wrapper e-numeric "+this.container.getAttribute("class")),this.updateHTMLAttrToWrapper(),this.readonly&&t.attributes(this.element,{"aria-readonly":"true"}),this.hiddenInput=this.createElement("input",{attrs:{type:"text",validateHidden:"true",class:"e-numeric-hidden"}}),this.inputName=null!==this.inputName?this.inputName:this.element.id,this.element.removeAttribute("name"),t.attributes(this.hiddenInput,{name:this.inputName}),this.container.insertBefore(this.hiddenInput,this.container.childNodes[1]),this.updateDataAttribute(!1),null!==this.inputStyle&&t.attributes(this.container,{style:this.inputStyle})},s.prototype.updateDataAttribute=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,n=Object.keys(t);s<n.length;s++){var a=n[s];0===a.indexOf("data")&&this.hiddenInput.setAttribute(a,t[a])}},s.prototype.updateHTMLAttrToElement=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];Y.indexOf(s)<0&&this.element.setAttribute(s,this.htmlAttributes[s])}},s.prototype.updateCssClass=function(t,i){e.Input.setCssClass(this.getNumericValidClassList(t),[this.container],this.getNumericValidClassList(i))},s.prototype.getNumericValidClassList=function(e){var i=e;return t.isNullOrUndefined(e)||""===e||(i=e.replace(/\s+/g," ").trim()),i},s.prototype.updateHTMLAttrToWrapper=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if(Y.indexOf(s)>-1)if("class"===s){var n=this.getNumericValidClassList(this.htmlAttributes[s]);""!==n&&t.addClass([this.container],n.split(" "))}else if("style"===s){var a=this.container.getAttribute(s);a=t.isNullOrUndefined(a)?this.htmlAttributes[s]:a+this.htmlAttributes[s],this.container.setAttribute(s,a)}else this.container.setAttribute(s,this.htmlAttributes[s])}},s.prototype.setElementWidth=function(e){t.isNullOrUndefined(e)||("number"==typeof e?this.container.style.width=t.formatUnit(e):"string"==typeof e&&(this.container.style.width=e.match(/px|%|em/)?e:t.formatUnit(e)))},s.prototype.spinBtnCreation=function(){this.spinDown=e.Input.appendSpan(q+" "+j,this.container,this.createElement),t.attributes(this.spinDown,{title:this.l10n.getConstant("decrementTitle"),"aria-label":this.l10n.getConstant("decrementTitle")}),this.spinUp=e.Input.appendSpan(q+" "+W,this.container,this.createElement),t.attributes(this.spinUp,{title:this.l10n.getConstant("incrementTitle"),"aria-label":this.l10n.getConstant("incrementTitle")}),this.wireSpinBtnEvents()},s.prototype.validateMinMax=function(){("number"!=typeof this.min||isNaN(this.min))&&this.setProperties({min:-Number.MAX_VALUE},!0),("number"!=typeof this.max||isNaN(this.max))&&this.setProperties({max:Number.MAX_VALUE},!0),null!==this.decimals&&(this.min!==-Number.MAX_VALUE&&this.setProperties({min:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.min))},!0),this.max!==Number.MAX_VALUE&&this.setProperties({max:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.max))},!0)),this.setProperties({min:this.min>this.max?this.max:this.min},!0),t.attributes(this.element,{"aria-valuemin":this.min.toString(),"aria-valuemax":this.max.toString()})},s.prototype.formattedValue=function(e,t){return this.instance.getNumberFormat({maximumFractionDigits:e,minimumFractionDigits:e,useGrouping:!1})(t)},s.prototype.validateStep=function(){null!==this.decimals&&this.setProperties({step:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.step))},!0)},s.prototype.action=function(e,t){this.isInteract=!0;var i=this.isFocused?this.instance.getNumberParser({format:"n"})(this.element.value):this.value;this.changeValue(this.performAction(i,this.step,e)),this.raiseChangeEvent(t)},s.prototype.checkErrorClass=function(){this.isValidState?t.removeClass([this.container],"e-error"):t.addClass([this.container],"e-error"),t.attributes(this.element,{"aria-invalid":this.isValidState?"false":"true"})},s.prototype.bindClearEvent=function(){this.showClearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this)},s.prototype.resetHandler=function(e){e.preventDefault(),this.inputWrapper.clearButton.classList.contains("e-clear-icon-hide")||this.clear(e),this.isInteract=!0,this.raiseChangeEvent(e)},s.prototype.clear=function(e){this.setProperties({value:null},!0),this.setElementValue(""),this.hiddenInput.value="";if(t.closest(this.element,"form")){var i=this.element.nextElementSibling,s=document.createEvent("KeyboardEvent");s.initEvent("keyup",!1,!0),i.dispatchEvent(s)}},s.prototype.resetFormHandler=function(){"EJS-NUMERICTEXTBOX"===this.element.tagName?this.updateValue(null):this.updateValue(this.inputEleValue)},s.prototype.setSpinButton=function(){t.isNullOrUndefined(this.spinDown)||t.attributes(this.spinDown,{title:this.l10n.getConstant("decrementTitle"),"aria-label":this.l10n.getConstant("decrementTitle")}),t.isNullOrUndefined(this.spinUp)||t.attributes(this.spinUp,{title:this.l10n.getConstant("incrementTitle"),"aria-label":this.l10n.getConstant("incrementTitle")})},s.prototype.wireEvents=function(){t.EventHandler.add(this.element,"focus",this.focusHandler,this),t.EventHandler.add(this.element,"blur",this.focusOutHandler,this),t.EventHandler.add(this.element,"keydown",this.keyDownHandler,this),t.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),t.EventHandler.add(this.element,"input",this.inputHandler,this),t.EventHandler.add(this.element,"keypress",this.keyPressHandler,this),t.EventHandler.add(this.element,"change",this.changeHandler,this),t.EventHandler.add(this.element,"paste",this.pasteHandler,this),this.enabled&&(this.bindClearEvent(),this.formEle&&t.EventHandler.add(this.formEle,"reset",this.resetFormHandler,this))},s.prototype.wireSpinBtnEvents=function(){t.EventHandler.add(this.spinUp,t.Browser.touchStartEvent,this.mouseDownOnSpinner,this),t.EventHandler.add(this.spinDown,t.Browser.touchStartEvent,this.mouseDownOnSpinner,this),t.EventHandler.add(this.spinUp,t.Browser.touchEndEvent,this.mouseUpOnSpinner,this),t.EventHandler.add(this.spinDown,t.Browser.touchEndEvent,this.mouseUpOnSpinner,this),t.EventHandler.add(this.spinUp,t.Browser.touchMoveEvent,this.touchMoveOnSpinner,this),t.EventHandler.add(this.spinDown,t.Browser.touchMoveEvent,this.touchMoveOnSpinner,this)},s.prototype.unwireEvents=function(){t.EventHandler.remove(this.element,"focus",this.focusHandler),t.EventHandler.remove(this.element,"blur",this.focusOutHandler),t.EventHandler.remove(this.element,"keyup",this.keyUpHandler),t.EventHandler.remove(this.element,"input",this.inputHandler),t.EventHandler.remove(this.element,"keydown",this.keyDownHandler),t.EventHandler.remove(this.element,"keypress",this.keyPressHandler),t.EventHandler.remove(this.element,"change",this.changeHandler),t.EventHandler.remove(this.element,"paste",this.pasteHandler),this.formEle&&t.EventHandler.remove(this.formEle,"reset",this.resetFormHandler)},s.prototype.unwireSpinBtnEvents=function(){t.EventHandler.remove(this.spinUp,t.Browser.touchStartEvent,this.mouseDownOnSpinner),t.EventHandler.remove(this.spinDown,t.Browser.touchStartEvent,this.mouseDownOnSpinner),t.EventHandler.remove(this.spinUp,t.Browser.touchEndEvent,this.mouseUpOnSpinner),t.EventHandler.remove(this.spinDown,t.Browser.touchEndEvent,this.mouseUpOnSpinner),t.EventHandler.remove(this.spinUp,t.Browser.touchMoveEvent,this.touchMoveOnSpinner),t.EventHandler.remove(this.spinDown,t.Browser.touchMoveEvent,this.touchMoveOnSpinner)},s.prototype.changeHandler=function(e){e.stopPropagation(),this.element.value.length||this.setProperties({value:null},!0);var t=this.instance.getNumberParser({format:"n"})(this.element.value);this.updateValue(t,e)},s.prototype.raiseChangeEvent=function(e){if(this.prevValue!==this.value){var i={};this.changeEventArgs={value:this.value,previousValue:this.prevValue,isInteracted:this.isInteract,isInteraction:this.isInteract,event:e},e&&(this.changeEventArgs.event=e),void 0===this.changeEventArgs.event&&(this.changeEventArgs.isInteracted=!1,this.changeEventArgs.isInteraction=!1),t.merge(i,this.changeEventArgs),this.prevValue=this.value,this.isInteract=!1,this.elementPrevValue=this.element.value,this.preventChange=!1,this.trigger("change",i)}},s.prototype.pasteHandler=function(){var e=this;if(this.enabled&&!this.readonly){var t=this.element.value;setTimeout(function(){e.numericRegex().test(e.element.value)||e.setElementValue(t)})}},s.prototype.preventHandler=function(){var e=this,i=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform);setTimeout(function(){if(e.element.selectionStart>0){var s=e.element.selectionStart,n=e.element.selectionStart-1,a=e.element.value.split(""),l=t.getNumericObject(e.locale),r=t.getValue("decimal",l).charCodeAt(0);" "===e.element.value[n]&&e.element.selectionStart>0&&!i?(t.isNullOrUndefined(e.prevVal)?e.element.value=e.element.value.trim():0!==n?e.element.value=e.prevVal:0===n&&(e.element.value=e.element.value.trim()),e.element.setSelectionRange(n,n)):isNaN(parseFloat(e.element.value[e.element.selectionStart-1]))&&45!==e.element.value[e.element.selectionStart-1].charCodeAt(0)?(a.indexOf(e.element.value[e.element.selectionStart-1])!==a.lastIndexOf(e.element.value[e.element.selectionStart-1])&&e.element.value[e.element.selectionStart-1].charCodeAt(0)===r||e.element.value[e.element.selectionStart-1].charCodeAt(0)!==r)&&(e.element.value=e.element.value.substring(0,n)+e.element.value.substring(s,e.element.value.length),e.element.setSelectionRange(n,n),isNaN(parseFloat(e.element.value[e.element.selectionStart-1]))&&e.element.selectionStart>0&&e.element.value.length&&e.preventHandler()):isNaN(parseFloat(e.element.value[e.element.selectionStart-2]))&&e.element.selectionStart>1&&45!==e.element.value[e.element.selectionStart-2].charCodeAt(0)&&(a.indexOf(e.element.value[e.element.selectionStart-2])!==a.lastIndexOf(e.element.value[e.element.selectionStart-2])&&e.element.value[e.element.selectionStart-2].charCodeAt(0)===r||e.element.value[e.element.selectionStart-2].charCodeAt(0)!==r)&&(e.element.setSelectionRange(n,n),e.nextEle=e.element.value[e.element.selectionStart],e.cursorPosChanged=!0,e.preventHandler()),!0===e.cursorPosChanged&&e.element.value[e.element.selectionStart]===e.nextEle&&isNaN(parseFloat(e.element.value[e.element.selectionStart-1]))&&(e.element.setSelectionRange(e.element.selectionStart+1,e.element.selectionStart+1),e.cursorPosChanged=!1,e.nextEle=null),""===e.element.value.trim()&&e.element.setSelectionRange(0,0),e.element.selectionStart>0&&45===e.element.value[e.element.selectionStart-1].charCodeAt(0)&&e.element.selectionStart>1&&(t.isNullOrUndefined(e.prevVal)?e.element.value=e.element.value:e.element.value=e.prevVal,e.element.setSelectionRange(e.element.selectionStart,e.element.selectionStart)),e.prevVal=e.element.value}})},s.prototype.keyUpHandler=function(){if(this.enabled&&!this.readonly){!(!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform))&&t.Browser.isDevice&&this.preventHandler();var e=this.instance.getNumberParser({format:"n"})(this.element.value);e=null===e||isNaN(e)?null:e,this.hiddenInput.value=e||0===e?e.toString():null;if(t.closest(this.element,"form")){var i=this.element.nextElementSibling,s=document.createEvent("KeyboardEvent");s.initEvent("keyup",!1,!0),i.dispatchEvent(s)}}},s.prototype.inputHandler=function(e){if(this.enabled&&!this.readonly){var i=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform);if((navigator.userAgent.toLowerCase().indexOf("firefox")>-1||i)&&t.Browser.isDevice&&this.preventHandler(),this.isAngular&&this.element.value!==t.getValue("decimal",t.getNumericObject(this.locale))&&this.element.value!==t.getValue("minusSign",t.getNumericObject(this.locale))){var s=this.instance.getNumberParser({format:"n"})(this.element.value);s=isNaN(s)?null:s,this.localChange({value:s}),this.preventChange=!0}if(this.isVue){var n=this.instance.getNumberParser({format:"n"})(this.element.value),a=this.instance.getNumberParser({format:"n"})(this.elementPrevValue),l={event:e,value:null===n||isNaN(n)?null:n,previousValue:null===a||isNaN(a)?null:a};this.preventChange=!0,this.elementPrevValue=this.element.value,this.trigger("input",l)}}},s.prototype.keyDownHandler=function(e){if(!this.readonly)switch(e.keyCode){case 38:e.preventDefault(),this.action(_,e);break;case 40:e.preventDefault(),this.action(X,e)}},s.prototype.performAction=function(e,t,i){(null===e||isNaN(e))&&(e=0);var s=i===_?e+t:e-t;return s=this.correctRounding(e,t,s),this.strictMode?this.trimValue(s):s},s.prototype.correctRounding=function(e,t,i){var s=new RegExp("[,.](.*)"),n=s.test(e.toString()),a=s.test(t.toString());if(n||a){var l=n?s.exec(e.toString())[0].length:0,r=a?s.exec(t.toString())[0].length:0,o=Math.max(l,r);return e=this.roundValue(i,o)}return i},s.prototype.roundValue=function(e,t){t=t||0;var i=Math.pow(10,t);return e*=i,e=Math.round(e)/i},s.prototype.updateValue=function(e,t){t&&(this.isInteract=!0),null===e||isNaN(e)||this.decimals&&(e=this.roundNumber(e,this.decimals)),this.changeValue(null===e||isNaN(e)?null:this.strictMode?this.trimValue(e):e),this.isDynamicChange||this.raiseChangeEvent(t)},s.prototype.updateCurrency=function(e,i){t.setValue(e,i,this.cultureInfo),this.updateValue(this.value)},s.prototype.changeValue=function(e){if(e||0===e){var t=this.getNumberOfDecimals(e);this.setProperties({value:this.roundNumber(e,t)},!0)}else e=null,this.setProperties({value:e},!0);this.modifyText(),this.strictMode||this.validateState()},s.prototype.modifyText=function(){if(this.value||0===this.value){var e=this.formatNumber(),i=this.isFocused?e:this.instance.getNumberFormat(this.cultureInfo)(this.value);this.setElementValue(i),t.attributes(this.element,{"aria-valuenow":e}),this.hiddenInput.value=this.value.toString(),null!==this.value&&this.serverDecimalSeparator&&(this.hiddenInput.value=this.hiddenInput.value.replace(".",this.serverDecimalSeparator))}else this.setElementValue(""),this.element.removeAttribute("aria-valuenow"),this.hiddenInput.value=null},s.prototype.setElementValue=function(t,i){e.Input.setValue(t,i||this.element,this.floatLabelType,this.showClearButton)},s.prototype.validateState=function(){this.isValidState=!0,(this.value||0===this.value)&&(this.isValidState=!(this.value>this.max||this.value<this.min)),this.checkErrorClass()},s.prototype.getNumberOfDecimals=function(e){var i,s=new RegExp("[eE][-+]?([0-9]+)"),n=e.toString();if(s.test(n)){var a=s.exec(n);t.isNullOrUndefined(a)||(n=e.toFixed(Math.min(parseInt(a[1],10),20)))}var l=n.split(".")[1];return i=l&&l.length?l.length:0,null!==this.decimals&&(i=i<this.decimals?i:this.decimals),i},s.prototype.formatNumber=function(){var e=this.getNumberOfDecimals(this.value);return this.instance.getNumberFormat({maximumFractionDigits:e,minimumFractionDigits:e,useGrouping:!1})(this.value)},s.prototype.trimValue=function(e){return e>this.max?this.max:e<this.min?this.min:e},s.prototype.roundNumber=function(e,t){var i=e,s=t||0,n=i.toString().split("e"),a=(i=Math.round(Number(n[0]+"e"+(n[1]?Number(n[1])+s:s)))).toString().split("e");return i=Number(a[0]+"e"+(a[1]?Number(a[1])-s:-s)),Number(i.toFixed(s))},s.prototype.cancelEvent=function(e){return e.preventDefault(),!1},s.prototype.keyPressHandler=function(e){if(!this.enabled||this.readonly)return!0;if(!t.Browser.isDevice&&"11.0"===t.Browser.info.version&&13===e.keyCode){var i=this.instance.getNumberParser({format:"n"})(this.element.value);return this.updateValue(i,e),!0}if(0===e.which||e.metaKey||e.ctrlKey||8===e.keyCode||13===e.keyCode)return!0;var s=String.fromCharCode(e.which),n=this.element.value;return n=n.substring(0,this.element.selectionStart)+s+n.substring(this.element.selectionEnd),!!this.numericRegex().test(n)||(e.preventDefault(),e.stopPropagation(),!1)},s.prototype.numericRegex=function(){var e=t.getNumericObject(this.locale),i=t.getValue("decimal",e),s="*";return"."===i&&(i="\\"+i),0===this.decimals&&this.validateDecimalOnType?K:(this.decimals&&this.validateDecimalOnType&&(s="{0,"+this.decimals+"}"),new RegExp("^(-)?(((\\d+("+i+"\\d"+s+")?)|("+i+"\\d"+s+")))?$"))},s.prototype.mouseWheel=function(e){e.preventDefault();var t,i=e;i.wheelDelta?t=i.wheelDelta/120:i.detail&&(t=-i.detail/3),t>0?this.action(_,e):t<0&&this.action(X,e),this.cancelEvent(e)},s.prototype.focusHandler=function(e){var i=this;if(this.focusEventArgs={event:e,value:this.value,container:this.container},this.trigger("focus",this.focusEventArgs),this.enabled&&!this.readonly){if(this.isFocused=!0,t.removeClass([this.container],"e-error"),this.prevValue=this.value,this.value||0===this.value){var s=this.formatNumber();if(this.setElementValue(s),!this.isPrevFocused)if(t.Browser.isDevice||"11.0"!==t.Browser.info.version){var n=t.Browser.isDevice&&t.Browser.isIos?600:0;setTimeout(function(){i.element.setSelectionRange(0,s.length)},n)}else this.element.setSelectionRange(0,s.length)}t.Browser.isDevice||t.EventHandler.add(this.element,"mousewheel DOMMouseScroll",this.mouseWheel,this)}},s.prototype.focusOutHandler=function(e){var i=this;if(this.blurEventArgs={event:e,value:this.value,container:this.container},this.trigger("blur",this.blurEventArgs),this.enabled&&!this.readonly){if(this.isPrevFocused){if(e.preventDefault(),t.Browser.isDevice){var s=this.element.value;this.element.focus(),this.isPrevFocused=!1;var n=this.element;setTimeout(function(){i.setElementValue(s,n)},200)}}else{this.isFocused=!1,this.element.value.length||this.setProperties({value:null},!0);var a=this.instance.getNumberParser({format:"n"})(this.element.value);this.updateValue(a),t.Browser.isDevice||t.EventHandler.remove(this.element,"mousewheel DOMMouseScroll",this.mouseWheel)}if(t.closest(this.element,"form")){var l=this.element.nextElementSibling,r=document.createEvent("FocusEvent");r.initEvent("focusout",!1,!0),l.dispatchEvent(r)}}},s.prototype.mouseDownOnSpinner=function(e){var i=this;if(this.isFocused&&(this.isPrevFocused=!0,e.preventDefault()),this.getElementData(e)){this.getElementData(e);var s=e.currentTarget,n=s.classList.contains(W)?_:X;t.EventHandler.add(s,"mouseleave",this.mouseUpClick,this),this.timeOut=setInterval(function(){i.isCalled=!0,i.action(n,e)},150),t.EventHandler.add(document,"mouseup",this.mouseUpClick,this)}},s.prototype.touchMoveOnSpinner=function(e){var t;if("touchmove"===e.type){var i=e.touches;t=i.length&&document.elementFromPoint(i[0].pageX,i[0].pageY)}else t=document.elementFromPoint(e.clientX,e.clientY);t.classList.contains(q)||clearInterval(this.timeOut)},s.prototype.mouseUpOnSpinner=function(e){if(this.isPrevFocused&&(this.element.focus(),t.Browser.isDevice||(this.isPrevFocused=!1)),t.Browser.isDevice||e.preventDefault(),this.getElementData(e)){var i=e.currentTarget,s=i.classList.contains(W)?_:X;t.EventHandler.remove(i,"mouseleave",this.mouseUpClick),this.isCalled||this.action(s,e),this.isCalled=!1,t.EventHandler.remove(document,"mouseup",this.mouseUpClick);if(t.closest(this.element,"form")){var n=this.element.nextElementSibling,a=document.createEvent("KeyboardEvent");a.initEvent("keyup",!1,!0),n.dispatchEvent(a)}}},s.prototype.getElementData=function(e){return!(e.which&&3===e.which||e.button&&2===e.button||!this.enabled||this.readonly)&&(clearInterval(this.timeOut),!0)},s.prototype.floatLabelTypeUpdate=function(){e.Input.removeFloating(this.inputWrapper);var t=this.hiddenInput;this.hiddenInput.remove(),e.Input.addFloating(this.element,this.floatLabelType,this.placeholder,this.createElement),this.container.insertBefore(t,this.container.childNodes[1])},s.prototype.mouseUpClick=function(e){e.stopPropagation(),clearInterval(this.timeOut),this.isCalled=!1,t.EventHandler.remove(this.spinUp,"mouseleave",this.mouseUpClick),t.EventHandler.remove(this.spinDown,"mouseleave",this.mouseUpClick)},s.prototype.increment=function(e){void 0===e&&(e=this.step),this.isInteract=!1,this.changeValue(this.performAction(this.value,e,_)),this.raiseChangeEvent()},s.prototype.decrement=function(e){void 0===e&&(e=this.step),this.isInteract=!1,this.changeValue(this.performAction(this.value,e,X)),this.raiseChangeEvent()},s.prototype.destroy=function(){if(this.unwireEvents(),!t.isBlazor()||!this.isServerRendered){t.detach(this.hiddenInput),this.showSpinButton&&(this.unwireSpinBtnEvents(),t.detach(this.spinUp),t.detach(this.spinDown));for(var e=["aria-labelledby","role","autocomplete","aria-readonly","autocorrect","aria-disabled","aria-placeholder","autocapitalize","spellcheck","aria-autocomplete","tabindex","aria-valuemin","aria-valuemax","aria-live","aria-valuenow","aria-invalid"],s=0;s<e.length;s++)this.element.removeAttribute(e[s]);this.element.classList.remove("e-input"),this.container.insertAdjacentElement("afterend",this.element),t.detach(this.container),i.prototype.destroy.call(this)}},s.prototype.getText=function(){return this.element.value},s.prototype.focusIn=function(){document.activeElement!==this.element&&this.enabled&&(this.element.focus(),t.addClass([this.container],[Z]))},s.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.element.blur(),t.removeClass([this.container],[Z]))},s.prototype.getPersistData=function(){return this.addOnPersist(["value"])},s.prototype.onPropertyChanged=function(i,s){for(var n=0,a=Object.keys(i);n<a.length;n++){var l=a[n];switch(l){case"width":this.setElementWidth(i.width);break;case"cssClass":this.updateCssClass(i.cssClass,s.cssClass);break;case"enabled":e.Input.setEnabled(i.enabled,this.element);break;case"enableRtl":e.Input.setEnableRtl(i.enableRtl,[this.container]);break;case"readonly":e.Input.setReadonly(i.readonly,this.element),this.readonly?t.attributes(this.element,{"aria-readonly":"true"}):this.element.removeAttribute("aria-readonly");break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.updateDataAttribute(!0),this.checkAttributes(!0),e.Input.validateInputType(this.container,this.element);break;case"placeholder":e.Input.setPlaceholder(i.placeholder,this.element);break;case"step":this.step=i.step,this.validateStep();break;case"showSpinButton":this.updateSpinButton(i);break;case"showClearButton":this.updateClearButton(i);break;case"floatLabelType":this.floatLabelType=i.floatLabelType,this.floatLabelTypeUpdate();break;case"value":this.isDynamicChange=(this.isAngular||this.isVue)&&this.preventChange,this.updateValue(i.value),this.isDynamicChange&&(this.preventChange=!1,this.isDynamicChange=!1);break;case"min":case"max":t.setValue(l,t.getValue(l,i),this),this.validateMinMax(),this.updateValue(this.value);break;case"strictMode":this.strictMode=i.strictMode,this.updateValue(this.value),this.validateState();break;case"locale":this.initCultureFunc(),this.l10n.setLocale(this.locale),this.setSpinButton(),this.updatePlaceholder(),e.Input.setPlaceholder(this.placeholder,this.element),this.updateValue(this.value);break;case"currency":var r=t.getValue(l,i);this.setProperties({currencyCode:r},!0),this.updateCurrency(l,r);break;case"currencyCode":var o=t.getValue(l,i);this.setProperties({currency:o},!0),this.updateCurrency("currency",o);break;case"format":t.setValue(l,t.getValue(l,i),this),this.initCultureInfo(),this.updateValue(this.value);break;case"decimals":this.decimals=i.decimals,this.updateValue(this.value)}}},s.prototype.updateClearButton=function(i){t.isBlazor()?this.showClearButton&&(this.inputWrapper.clearButton=this.container.querySelector(".e-clear-icon"),e.Input.wireClearBtnEvents(this.element,this.inputWrapper.clearButton,this.inputWrapper.container)):(e.Input.setClearButton(i.showClearButton,this.element,this.inputWrapper,void 0,this.createElement),this.bindClearEvent())},s.prototype.updateSpinButton=function(e){t.isBlazor()?this.showSpinButton&&(this.spinDown=this.container.querySelector("."+j),this.spinUp=this.container.querySelector("."+W),this.wireSpinBtnEvents()):e.showSpinButton?this.spinBtnCreation():(t.detach(this.spinUp),t.detach(this.spinDown))},s.prototype.getModuleName=function(){return"numerictextbox"},z([t.Property("")],s.prototype,"cssClass",void 0),z([t.Property(null)],s.prototype,"value",void 0),z([t.Property(-Number.MAX_VALUE)],s.prototype,"min",void 0),z([t.Property(Number.MAX_VALUE)],s.prototype,"max",void 0),z([t.Property(1)],s.prototype,"step",void 0),z([t.Property(null)],s.prototype,"width",void 0),z([t.Property(null)],s.prototype,"placeholder",void 0),z([t.Property({})],s.prototype,"htmlAttributes",void 0),z([t.Property(!0)],s.prototype,"showSpinButton",void 0),z([t.Property(!1)],s.prototype,"readonly",void 0),z([t.Property(!0)],s.prototype,"enabled",void 0),z([t.Property(!1)],s.prototype,"showClearButton",void 0),z([t.Property(!1)],s.prototype,"enablePersistence",void 0),z([t.Property("n2")],s.prototype,"format",void 0),z([t.Property(null)],s.prototype,"decimals",void 0),z([t.Property(null)],s.prototype,"currency",void 0),z([t.Property(null)],s.prototype,"currencyCode",void 0),z([t.Property(!0)],s.prototype,"strictMode",void 0),z([t.Property(!1)],s.prototype,"validateDecimalOnType",void 0),z([t.Property("Never")],s.prototype,"floatLabelType",void 0),z([t.Event()],s.prototype,"created",void 0),z([t.Event()],s.prototype,"destroyed",void 0),z([t.Event()],s.prototype,"change",void 0),z([t.Event()],s.prototype,"focus",void 0),z([t.Event()],s.prototype,"blur",void 0),s=z([t.NotifyPropertyChanges],s)}(t.Component),$="e-error",J="e-input-group",Q="e-float-input",ee="e-utility-mask",te="e-label-top",ie="e-label-bottom",se={0:"[0-9]",9:"[0-9 ]","#":"[0-9 +-]",L:"[A-Za-z]","?":"[A-Za-z ]","&":"[^ ]+",C:"[^]+",A:"[A-Za-z0-9]",a:"[A-Za-z0-9 ]"},ne=function(){return function(){}}(),ae=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)}}(),le=function(e,t,i,s){var n,a=arguments.length,l=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(l=(a<3?n(l):a>3?n(t,i,l):n(t,i))||l);return a>3&&l&&Object.defineProperty(t,i,l),l},re="e-input-focus",oe=["title","style","class"],he=function(i){function s(e,t){var s=i.call(this,e,t)||this;return s.initInputValue="",s.isAngular=!1,s.preventChange=!1,s.isClicked=!1,s.maskOptions=e,s}return ae(s,i),s.prototype.getModuleName=function(){return"maskedtextbox"},s.prototype.preRender=function(){this.promptMask="",this.hiddenMask="",this.escapeMaskValue="",this.regExpCollec=se,this.customRegExpCollec=[],this.undoCollec=[],this.redoCollec=[],this.changeEventArgs={},this.focusEventArgs={},this.blurEventArgs={},this.maskKeyPress=!1,this.isFocus=!1,this.isInitial=!1,this.isIosInvalid=!1;var e=t.getValue("ej2_instances",this.element);if(this.cloneElement=this.element.cloneNode(!0),t.removeClass([this.cloneElement],["e-control","e-maskedtextbox","e-lib"]),this.angularTagName=null,this.formElement=t.closest(this.element,"form"),"EJS-MASKEDTEXTBOX"===this.element.tagName){this.angularTagName=this.element.tagName;for(var i=this.createElement("input"),s=0;s<this.element.attributes.length;s++)i.setAttribute(this.element.attributes[s].nodeName,this.element.attributes[s].nodeValue),i.innerHTML=this.element.innerHTML;this.element.hasAttribute("id")&&this.element.removeAttribute("id"),this.element.classList.remove("e-control","e-maskedtextbox"),this.element.classList.add("e-mask-container"),this.element.appendChild(i),this.element=i,t.setValue("ej2_instances",e,this.element)}this.updateHTMLAttrToElement(),this.checkHtmlAttributes(!1),this.formElement&&(this.initInputValue=this.value)},s.prototype.getPersistData=function(){return this.addOnPersist(["value"])},s.prototype.render=function(){var e=this;if("input"===this.element.tagName.toLowerCase()){var i=t.isBlazor()&&this.isServerRendered;"Never"===this.floatLabelType&&t.addClass([this.element],"e-input"),this.createWrapper(),this.updateHTMLAttrToWrapper(),""===this.element.name&&this.element.setAttribute("name",this.element.id),this.isInitial=!0,i&&!0===t.Browser.isIE?setTimeout(function(){e.resetMaskedTextBox()}):this.resetMaskedTextBox(),this.isInitial=!1,this.setMaskPlaceholder(!0,!1),this.setWidth(this.width),this.preEleVal=this.element.value,t.Browser.isDevice||"11.0"!==t.Browser.info.version&&"edge"!==t.Browser.info.name||this.element.blur(),t.Browser.isDevice&&t.Browser.isIos&&this.element.blur(),(this.element.getAttribute("value")||this.value)&&this.element.setAttribute("value",this.element.value),this.renderComplete()}},s.prototype.updateHTMLAttrToElement=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];oe.indexOf(s)<0&&this.element.setAttribute(s,this.htmlAttributes[s])}},s.prototype.updateCssClass=function(t,i){e.Input.setCssClass(this.getValidClassList(t),[this.inputObj.container],this.getValidClassList(i))},s.prototype.getValidClassList=function(e){var i=e;return t.isNullOrUndefined(e)||""===e||(i=e.replace(/\s+/g," ").trim()),i},s.prototype.updateHTMLAttrToWrapper=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if(oe.indexOf(s)>-1)if("class"===s){var n=this.htmlAttributes[s].replace(/\s+/g," ").trim();""!==n&&t.addClass([this.inputObj.container],n.split(" "))}else if("style"===s){var a=this.inputObj.container.getAttribute(s);a=t.isNullOrUndefined(a)?this.htmlAttributes[s]:a+this.htmlAttributes[s],this.inputObj.container.setAttribute(s,a)}else this.inputObj.container.setAttribute(s,this.htmlAttributes[s])}},s.prototype.resetMaskedTextBox=function(){this.promptMask="",this.hiddenMask="",this.escapeMaskValue="",this.customRegExpCollec=[],this.undoCollec=[],this.redoCollec=[],this.promptChar.length>1&&(this.promptChar=this.promptChar[0]),n.call(this),a.call(this),(null===this.mask||""===this.mask&&void 0!==this.value)&&R.call(this,this.value);var e=c.call(this,this.element);this.prevValue=e,this.value=e,this.isInitial||r.call(this),l.call(this)},s.prototype.setMaskPlaceholder=function(t,i){(i||this.placeholder)&&(e.Input.setPlaceholder(this.placeholder,this.element),(this.element.value===this.promptMask&&t&&"Always"!==this.floatLabelType||this.element.value===this.promptMask&&"Never"===this.floatLabelType)&&R.call(this,""))},s.prototype.setWidth=function(e){if(!t.isNullOrUndefined(e))if("number"==typeof e)this.inputObj.container.style.width=t.formatUnit(e),this.element.style.width=t.formatUnit(e);else if("string"==typeof e){var i=e.match(/px|%|em/)?e:t.formatUnit(e);this.inputObj.container.style.width=i,this.element.style.width=i}},s.prototype.checkHtmlAttributes=function(e){for(var i=0,s=e?t.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly"];i<s.length;i++){var n=s[i];if(!t.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"placeholder":(t.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.placeholder||e)&&this.setProperties({placeholder:this.element.placeholder},!e);break;case"disabled":if(t.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.enabled||e){var a="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n);this.setProperties({enabled:a},!e)}break;case"value":(t.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.value||e)&&this.setProperties({value:this.element.value},!e);break;case"readonly":if(t.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.readonly||e){var l="readonly"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n);this.setProperties({readonly:l},!e)}}}},s.prototype.createWrapper=function(){var i=this.cssClass;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(i=this.getValidClassList(this.cssClass)),this.inputObj=e.Input.createInput({element:this.element,floatLabelType:this.floatLabelType,properties:{enableRtl:this.enableRtl,cssClass:i,enabled:this.enabled,readonly:this.readonly,placeholder:this.placeholder,showClearButton:this.showClearButton}},this.createElement),this.inputObj.container.setAttribute("class","e-control-wrapper e-mask "+this.inputObj.container.getAttribute("class"))},s.prototype.onPropertyChanged=function(t,i){for(var s=0,n=Object.keys(t);s<n.length;s++){switch(n[s]){case"value":F.call(this,this.value),this.placeholder&&this.setMaskPlaceholder(!1,!1);break;case"placeholder":this.setMaskPlaceholder(!0,!0);break;case"width":this.setWidth(t.width);break;case"cssClass":this.updateCssClass(t.cssClass,i.cssClass);break;case"enabled":e.Input.setEnabled(t.enabled,this.element,this.floatLabelType,this.inputObj.container);break;case"readonly":e.Input.setReadonly(t.readonly,this.element);break;case"enableRtl":e.Input.setEnableRtl(t.enableRtl,[this.inputObj.container]);break;case"customCharacters":this.customCharacters=t.customCharacters,this.resetMaskedTextBox();break;case"showClearButton":e.Input.setClearButton(t.showClearButton,this.element,this.inputObj,void 0,this.createElement),o.call(this);break;case"floatLabelType":this.floatLabelType=t.floatLabelType,e.Input.removeFloating(this.inputObj),e.Input.addFloating(this.element,this.floatLabelType,this.placeholder,this.createElement);break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.checkHtmlAttributes(!0);break;case"mask":var a=this.value;this.mask=t.mask,this.updateValue(a);break;case"promptChar":t.promptChar.length>1&&(t.promptChar=t.promptChar[0]),t.promptChar?this.promptChar=t.promptChar:this.promptChar="_";var l=this.element.value.replace(new RegExp("["+i.promptChar+"]","g"),this.promptChar);this.promptMask===this.element.value&&(l=this.promptMask.replace(new RegExp("["+i.promptChar+"]","g"),this.promptChar)),this.promptMask=this.promptMask.replace(new RegExp("["+i.promptChar+"]","g"),this.promptChar),this.undoCollec=this.redoCollec=[],R.call(this,l)}}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange},s.prototype.updateValue=function(e){this.resetMaskedTextBox(),F.call(this,e)},s.prototype.getMaskedValue=function(){return u.call(this,this.element)},s.prototype.focusIn=function(){document.activeElement!==this.element&&this.enabled&&(this.element.focus(),t.addClass([this.inputObj.container],[re]))},s.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.element.blur(),t.removeClass([this.inputObj.container],[re]))},s.prototype.destroy=function(){r.call(this);for(var e=["aria-labelledby","role","autocomplete","aria-readonly","autocorrect","aria-disabled","aria-placeholder","autocapitalize","spellcheck","aria-autocomplete","aria-live","aria-valuenow","aria-invalid"],s=0;s<e.length;s++)this.element.removeAttribute(e[s]);this.element.classList.remove("e-input"),this.inputObj.container.insertAdjacentElement("afterend",this.element),t.detach(this.inputObj.container),i.prototype.destroy.call(this)},le([t.Property(null)],s.prototype,"cssClass",void 0),le([t.Property(null)],s.prototype,"width",void 0),le([t.Property(null)],s.prototype,"placeholder",void 0),le([t.Property("Never")],s.prototype,"floatLabelType",void 0),le([t.Property({})],s.prototype,"htmlAttributes",void 0),le([t.Property(!0)],s.prototype,"enabled",void 0),le([t.Property(!1)],s.prototype,"readonly",void 0),le([t.Property(!1)],s.prototype,"showClearButton",void 0),le([t.Property(!1)],s.prototype,"enablePersistence",void 0),le([t.Property(null)],s.prototype,"mask",void 0),le([t.Property("_")],s.prototype,"promptChar",void 0),le([t.Property(null)],s.prototype,"value",void 0),le([t.Property(null)],s.prototype,"customCharacters",void 0),le([t.Event()],s.prototype,"created",void 0),le([t.Event()],s.prototype,"destroyed",void 0),le([t.Event()],s.prototype,"change",void 0),le([t.Event()],s.prototype,"focus",void 0),le([t.Event()],s.prototype,"blur",void 0),s=le([t.NotifyPropertyChanges],s)}(t.Component),de=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)}}(),ue=function(e,t,i,s){var n,a=arguments.length,l=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(l=(a<3?n(l):a>3?n(t,i,l):n(t,i))||l);return a>3&&l&&Object.defineProperty(t,i,l),l},ce=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return de(i,e),ue([t.Property("None")],i.prototype,"placement",void 0),ue([t.Property(10)],i.prototype,"largeStep",void 0),ue([t.Property(1)],i.prototype,"smallStep",void 0),ue([t.Property(!1)],i.prototype,"showSmallTicks",void 0),ue([t.Property(null)],i.prototype,"format",void 0),i}(t.ChildProperty),pe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return de(i,e),ue([t.Property(null)],i.prototype,"color",void 0),ue([t.Property(null)],i.prototype,"start",void 0),ue([t.Property(null)],i.prototype,"end",void 0),i}(t.ChildProperty),me=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return de(i,e),ue([t.Property(!1)],i.prototype,"enabled",void 0),ue([t.Property(null)],i.prototype,"minStart",void 0),ue([t.Property(null)],i.prototype,"minEnd",void 0),ue([t.Property(null)],i.prototype,"maxStart",void 0),ue([t.Property(null)],i.prototype,"maxEnd",void 0),ue([t.Property(!1)],i.prototype,"startHandleFixed",void 0),ue([t.Property(!1)],i.prototype,"endHandleFixed",void 0),i}(t.ChildProperty),fe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return de(i,e),ue([t.Property("")],i.prototype,"cssClass",void 0),ue([t.Property("Before")],i.prototype,"placement",void 0),ue([t.Property("Focus")],i.prototype,"showOn",void 0),ue([t.Property(!1)],i.prototype,"isVisible",void 0),ue([t.Property(null)],i.prototype,"format",void 0),i}(t.ChildProperty),ve="e-slider",ge="e-rtl",ye="e-slider-input",be="e-control-wrapper",Ee="e-handle",Ce="e-range",Se="e-slider-button",xe="e-first-button",Te="e-second-button",ke="e-scale",Oe="e-tick",Pe="e-large",Le="e-tick-value",Ae="e-slider-tooltip",Ne="e-slider-hover",He="e-handle-first",Be="e-handle-second",we="e-disabled",Ue="e-slider-container",Fe="e-slider-horizontal-before",Re="e-slider-horizontal-after",Ve="e-slider-vertical-before",Me="e-slider-vertical-after",Ie="e-material-tooltip-open",De="e-tooltip-active",ze="e-material-slider",qe="e-slider-track",We="e-slider-horizantal-color",je="e-slider-vertical-color",_e="e-handle-focused",Xe="e-vertical",Ke="e-horizontal",Ze="e-handle-start",Ye="e-material-tooltip-start",Ge="e-tab-handle",$e="e-button-icon",Je="e-small-size",Qe="e-tick-pos",et="e-first-tick",tt="e-last-tick",it="e-slider-btn",st="e-tab-track",nt="e-tab-range",at="e-handle-active",lt="e-material-handle",rt="e-material-range",ot="e-material-default",ht="e-material-tooltip-show",dt="e-material-tooltip-hide",ut="e-read-only",ct="e-limits",pt="e-limit-bar",mt="e-limit-first",ft="e-limit-second",vt="e-drag-horizontal",gt="e-drag-vertical",yt=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.horDir="left",s.verDir="bottom",s.transition={handle:"left .4s cubic-bezier(.25, .8, .25, 1), right .4s cubic-bezier(.25, .8, .25, 1), top .4s cubic-bezier(.25, .8, .25, 1) , bottom .4s cubic-bezier(.25, .8, .25, 1)",rangeBar:"all .4s cubic-bezier(.25, .8, .25, 1)"},s.transitionOnMaterialTooltip={handle:"left 1ms ease-out, right 1ms ease-out, bottom 1ms ease-out, top 1ms ease-out",rangeBar:"left 1ms ease-out, right 1ms ease-out, bottom 1ms ease-out, width 1ms ease-out, height 1ms ease-out"},s.scaleTransform="transform .4s cubic-bezier(.25, .8, .25, 1)",s.customAriaText=null,s.drag=!0,s.isDragComplete=!1,s.initialTooltip=!0,s}return de(s,e),s.prototype.preRender=function(){this.l10n=new t.L10n("slider",{incrementTitle:"Increase",decrementTitle:"Decrease"},this.locale),this.isElementFocused=!1,this.tickElementCollection=[],this.tooltipFormatInfo={},this.ticksFormatInfo={},this.initCultureInfo(),this.initCultureFunc(),this.formChecker()},s.prototype.formChecker=function(){var e=t.closest(this.element,"form");e?(this.isForm=!0,t.isNullOrUndefined(this.formResetValue)||this.setProperties({value:this.formResetValue},!0),this.formResetValue=this.value,"Range"!==this.type||!t.isNullOrUndefined(this.formResetValue)&&"object"==typeof this.formResetValue?t.isNullOrUndefined(this.formResetValue)&&(this.formResetValue=parseFloat(t.formatUnit(this.min))):this.formResetValue=[parseFloat(t.formatUnit(this.min)),parseFloat(t.formatUnit(this.max))],this.formElement=e):this.isForm=!1},s.prototype.initCultureFunc=function(){this.internationalization=new t.Internationalization(this.locale)},s.prototype.initCultureInfo=function(){this.tooltipFormatInfo.format=t.isNullOrUndefined(this.tooltip.format)?null:this.tooltip.format,this.ticksFormatInfo.format=t.isNullOrUndefined(this.ticks.format)?null:this.ticks.format},s.prototype.formatString=function(e,t){var i=null,s=null;if(e||0===e){i=this.formatNumber(e);var n=this.numberOfDecimals(e);s=this.internationalization.getNumberFormat(t)(this.makeRoundNumber(e,n))}return{elementVal:i,formatString:s}},s.prototype.formatNumber=function(e){var t=this.numberOfDecimals(e);return this.internationalization.getNumberFormat({maximumFractionDigits:t,minimumFractionDigits:t,useGrouping:!1})(e)},s.prototype.numberOfDecimals=function(e){var t=e.toString().split(".")[1];return t&&t.length?t.length:0},s.prototype.makeRoundNumber=function(e,t){var i=t||0;return Number(e.toFixed(i))},s.prototype.fractionalToInteger=function(e){e=0===this.numberOfDecimals(e)?Number(e).toFixed(this.noOfDecimals):e;for(var t=1,i=0;i<this.noOfDecimals;i++)t*=10;return e=Number((e*t).toFixed(0))},s.prototype.render=function(){this.initialize(),this.initRender(),this.wireEvents(),this.setZindex(),this.renderComplete()},s.prototype.initialize=function(){t.addClass([this.element],ve),this.setCSSClass()},s.prototype.setElementWidth=function(e){t.isNullOrUndefined(e)||("number"==typeof e?this.sliderContainer.style.width=t.formatUnit(e):"string"==typeof e&&(this.sliderContainer.style.width=e.match(/px|%|em/)?e:t.formatUnit(e)))},s.prototype.setCSSClass=function(e){e&&t.removeClass([this.element],e.split(" ")),this.cssClass&&t.addClass([this.element],this.cssClass.split(" "))},s.prototype.setEnabled=function(){this.enabled?(t.removeClass([this.sliderContainer],[we]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.remove(we),this.wireEvents()):(t.addClass([this.sliderContainer],[we]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.add(we),this.unwireEvents())},s.prototype.getTheme=function(e){return window.getComputedStyle(e,":after").getPropertyValue("content").replace(/['"]+/g,"")},s.prototype.initRender=function(){this.sliderContainer=this.createElement("div",{className:Ue+" "+be}),this.element.parentNode.insertBefore(this.sliderContainer,this.element),this.sliderContainer.appendChild(this.element),this.sliderTrack=this.createElement("div",{className:qe}),this.element.appendChild(this.sliderTrack),this.setElementWidth(this.width),this.element.tabIndex=-1,this.getThemeInitialization(),this.setHandler(),this.createRangeBar(),this.limits.enabled&&this.createLimitBar(),this.setOrientClass(),this.hiddenInput=this.createElement("input",{attrs:{type:"hidden",value:t.isNullOrUndefined(this.value)?this.min.toString():this.value.toString(),name:this.element.getAttribute("name")||this.element.getAttribute("id")||"_"+(1e3*Math.random()).toFixed(0)+"slider",class:ye}}),this.hiddenInput.tabIndex=-1,this.sliderContainer.appendChild(this.hiddenInput),this.showButtons&&this.setButtons(),this.setEnableRTL(),"Range"===this.type?this.rangeValueUpdate():this.value=t.isNullOrUndefined(this.value)?parseFloat(t.formatUnit(this.min.toString())):this.value,this.previousVal="Range"!==this.type?this.checkHandleValue(parseFloat(t.formatUnit(this.value.toString()))):[this.checkHandleValue(parseFloat(t.formatUnit(this.value[0].toString()))),this.checkHandleValue(parseFloat(t.formatUnit(this.value[1].toString())))],this.previousChanged=this.previousVal,t.isNullOrUndefined(this.element.hasAttribute("name"))||this.element.removeAttribute("name"),this.setValue(),this.limits.enabled&&this.setLimitBar(),"None"!==this.ticks.placement&&this.renderScale(),this.tooltip.isVisible&&this.renderTooltip(),this.enabled?t.removeClass([this.sliderContainer],[we]):t.addClass([this.sliderContainer],[we]),this.readonly?t.addClass([this.sliderContainer],[ut]):t.removeClass([this.sliderContainer],[ut])},s.prototype.getThemeInitialization=function(){this.isMaterial="material"===this.getTheme(this.sliderContainer)||"material-dark"===this.getTheme(this.sliderContainer),this.isBootstrap="bootstrap"===this.getTheme(this.sliderContainer)||"bootstrap-dark"===this.getTheme(this.sliderContainer),this.isBootstrap4="bootstrap4"===this.getTheme(this.sliderContainer),this.isTailwind="tailwind"===this.getTheme(this.sliderContainer)||"tailwind-dark"===this.getTheme(this.sliderContainer),this.isMaterialTooltip=this.isMaterial&&"Range"!==this.type&&this.tooltip.isVisible},s.prototype.createRangeBar=function(){"Default"!==this.type&&(this.rangeBar=this.createElement("div",{attrs:{class:Ce}}),this.element.appendChild(this.rangeBar),this.drag&&"Range"===this.type&&("Horizontal"===this.orientation?this.rangeBar.classList.add(vt):this.rangeBar.classList.add(gt)))},s.prototype.createLimitBar=function(){var e="Range"!==this.type?pt:mt;e+=" "+ct,this.limitBarFirst=this.createElement("div",{attrs:{class:e}}),this.element.appendChild(this.limitBarFirst),"Range"===this.type&&(this.limitBarSecond=this.createElement("div",{attrs:{class:ft+" "+ct}}),this.element.appendChild(this.limitBarSecond))},s.prototype.setOrientClass=function(){"Vertical"!==this.orientation?(this.sliderContainer.classList.remove(Xe),this.sliderContainer.classList.add(Ke),this.firstHandle.setAttribute("aria-orientation","horizontal"),"Range"===this.type&&this.secondHandle.setAttribute("aria-orientation","horizontal")):(this.sliderContainer.classList.remove(Ke),this.sliderContainer.classList.add(Xe),this.firstHandle.setAttribute("aria-orientation","vertical"),"Range"===this.type&&this.secondHandle.setAttribute("aria-orientation","vertical"))},s.prototype.setAriaAttributes=function(e){var i=this,s=this.min,n=this.max;if(!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&(s=this.customValues[0],n=this.customValues[this.customValues.length-1]),"Range"!==this.type)t.attributes(e,{"aria-valuemin":s.toString(),"aria-valuemax":n.toString()});else{(!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0?[[s.toString(),this.customValues[this.value[1]].toString()],[this.customValues[this.value[0]].toString(),n.toString()]]:[[s.toString(),this.value[1].toString()],[this.value[0].toString(),n.toString()]]).forEach(function(e,s){var n=0===s?i.firstHandle:i.secondHandle;n&&t.attributes(n,{"aria-valuemin":e[0],"aria-valuemax":e[1]})})}},s.prototype.createSecondHandle=function(){this.secondHandle=this.createElement("div",{attrs:{class:Ee,role:"slider",tabIndex:"0"}}),this.secondHandle.classList.add(Be),this.element.appendChild(this.secondHandle)},s.prototype.createFirstHandle=function(){this.firstHandle=this.createElement("div",{attrs:{class:Ee,role:"slider",tabIndex:"0"}}),this.firstHandle.classList.add(He),this.element.appendChild(this.firstHandle),this.isMaterialTooltip&&(this.materialHandle=this.createElement("div",{attrs:{class:Ee+" "+lt}}),this.element.appendChild(this.materialHandle))},s.prototype.wireFirstHandleEvt=function(e){e?(t.EventHandler.remove(this.firstHandle,"mousedown touchstart",this.handleFocus),t.EventHandler.remove(this.firstHandle,"transitionend",this.transitionEnd),t.EventHandler.remove(this.firstHandle,"mouseenter touchenter",this.handleOver),t.EventHandler.remove(this.firstHandle,"mouseleave touchend",this.handleLeave)):(t.EventHandler.add(this.firstHandle,"mousedown touchstart",this.handleFocus,this),t.EventHandler.add(this.firstHandle,"transitionend",this.transitionEnd,this),t.EventHandler.add(this.firstHandle,"mouseenter touchenter",this.handleOver,this),t.EventHandler.add(this.firstHandle,"mouseleave touchend",this.handleLeave,this))},s.prototype.wireSecondHandleEvt=function(e){e?(t.EventHandler.remove(this.secondHandle,"mousedown touchstart",this.handleFocus),t.EventHandler.remove(this.secondHandle,"transitionend",this.transitionEnd),t.EventHandler.remove(this.secondHandle,"mouseenter touchenter",this.handleOver),t.EventHandler.remove(this.secondHandle,"mouseleave touchend",this.handleLeave)):(t.EventHandler.add(this.secondHandle,"mousedown touchstart",this.handleFocus,this),t.EventHandler.add(this.secondHandle,"transitionend",this.transitionEnd,this),t.EventHandler.add(this.secondHandle,"mouseenter touchenter",this.handleOver,this),t.EventHandler.add(this.secondHandle,"mouseleave touchend",this.handleLeave,this))},s.prototype.handleStart=function(){"Range"!==this.type&&(this.firstHandle.classList[0===this.handlePos1?"add":"remove"](Ze),this.isMaterialTooltip&&(this.materialHandle.classList[0===this.handlePos1?"add":"remove"](Ze),this.tooltipElement&&this.tooltipElement.classList[0===this.handlePos1?"add":"remove"](Ye)))},s.prototype.transitionEnd=function(e){"transform"!==e.propertyName&&(this.handleStart(),this.getHandle().style.transition="none","Default"!==this.type&&(this.rangeBar.style.transition="none"),this.isMaterial&&this.tooltip.isVisible&&"Default"===this.type&&(this.tooltipElement.style.transition=this.transition.handle),this.tooltipToggle(this.getHandle()),this.closeTooltip())},s.prototype.handleFocusOut=function(){this.firstHandle.classList.contains(_e)&&this.firstHandle.classList.remove(_e),"Range"===this.type&&this.secondHandle.classList.contains(_e)&&this.secondHandle.classList.remove(_e)},s.prototype.handleFocus=function(e){this.focusSliderElement(),this.sliderBarClick(e),e.currentTarget===this.firstHandle?this.firstHandle.classList.add(_e):this.secondHandle.classList.add(_e),t.EventHandler.add(document,"mousemove touchmove",this.sliderBarMove,this),t.EventHandler.add(document,"mouseup touchend",this.sliderBarUp,this)},s.prototype.handleOver=function(e){this.tooltip.isVisible&&"Hover"===this.tooltip.showOn&&this.tooltipToggle(e.currentTarget),"Default"===this.type&&this.tooltipToggle(this.getHandle())},s.prototype.handleLeave=function(e){!this.tooltip.isVisible||"Hover"!==this.tooltip.showOn||e.currentTarget.classList.contains(_e)||e.currentTarget.classList.contains(Ge)||this.closeTooltip()},s.prototype.setHandler=function(){this.min>this.max&&(this.min=this.max),this.createFirstHandle(),"Range"===this.type&&this.createSecondHandle()},s.prototype.setEnableRTL=function(){this.enableRtl&&"Vertical"!==this.orientation?t.addClass([this.sliderContainer],ge):t.removeClass([this.sliderContainer],ge);var e="Vertical"!==this.orientation?this.horDir:this.verDir;this.enableRtl?(this.horDir="right",this.verDir="bottom"):(this.horDir="left",this.verDir="bottom");e!==("Vertical"!==this.orientation?this.horDir:this.verDir)&&"Horizontal"===this.orientation&&(t.setStyleAttribute(this.firstHandle,{right:"",left:"auto"}),"Range"===this.type&&t.setStyleAttribute(this.secondHandle,{top:"",left:"auto"})),this.setBarColor()},s.prototype.tooltipValue=function(){var e,t=this,i={value:this.value,text:""};this.initialTooltip&&(this.initialTooltip=!1,this.setTooltipContent(),i.text=e=this.tooltipObj.content,this.trigger("tooltipChange",i,function(i){t.addTooltipClass(i.text),e!==i.text&&(t.customAriaText=i.text,t.tooltipObj.content=i.text,t.setAriaAttrValue(t.firstHandle),"Range"===t.type&&t.setAriaAttrValue(t.secondHandle))}),this.isMaterialTooltip&&this.setPreviousVal("change",this.value))},s.prototype.setTooltipContent=function(){var e;e=this.formatContent(this.tooltipFormatInfo,!1),this.tooltipObj.content=e},s.prototype.formatContent=function(e,i){var s="",n=this.handleVal1,a=this.handleVal2;return!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&(n=this.customValues[this.handleVal1],a=this.customValues[this.handleVal2]),i?("Range"===this.type?s=this.enableRtl&&"Vertical"!==this.orientation?t.isNullOrUndefined(this.tooltip)||t.isNullOrUndefined(this.tooltip.format)?a.toString()+" - "+n.toString():this.formatString(a,e).elementVal+" - "+this.formatString(n,e).elementVal:t.isNullOrUndefined(this.tooltip)||t.isNullOrUndefined(this.tooltip.format)?n.toString()+" - "+a.toString():this.formatString(n,e).elementVal+" - "+this.formatString(a,e).elementVal:t.isNullOrUndefined(n)||(s=t.isNullOrUndefined(this.tooltip)||t.isNullOrUndefined(this.tooltip.format)?n.toString():this.formatString(n,e).elementVal),s):("Range"===this.type?s=this.enableRtl&&"Vertical"!==this.orientation?t.isNullOrUndefined(e.format)?a.toString()+" - "+n.toString():this.formatString(a,e).formatString+" - "+this.formatString(n,e).formatString:t.isNullOrUndefined(e.format)?n.toString()+" - "+a.toString():this.formatString(n,e).formatString+" - "+this.formatString(a,e).formatString:t.isNullOrUndefined(n)||(s=t.isNullOrUndefined(e.format)?n.toString():this.formatString(n,e).formatString),s)},s.prototype.addTooltipClass=function(e){if(this.isMaterialTooltip){var t=e.toString().length;if(this.tooltipElement){i=t>4?{oldCss:ot,newCss:rt}:{oldCss:rt,newCss:ot};this.tooltipElement.classList.remove(i.oldCss),this.tooltipElement.classList.contains(i.newCss)||(this.tooltipElement.classList.add(i.newCss),this.tooltipElement.style.transform=t>4?"scale(1)":this.getTooltipTransformProperties(this.previousTooltipClass).rotate)}else{var i=t>4?rt:ot;this.tooltipObj.cssClass=Ae+" "+i}}},s.prototype.tooltipPlacement=function(){return"Horizontal"===this.orientation?"Before"===this.tooltip.placement?"TopCenter":"BottomCenter":"Before"===this.tooltip.placement?"LeftCenter":"RightCenter"},s.prototype.tooltipBeforeOpen=function(e){this.tooltipElement=e.element,this.tooltip.cssClass&&t.addClass([this.tooltipElement],this.tooltip.cssClass.split(" ").filter(function(e){return e})),e.target.removeAttribute("aria-describedby"),this.isMaterialTooltip&&(this.tooltipElement.firstElementChild.classList.add(dt),this.handleStart(),this.setTooltipTransform())},s.prototype.tooltipCollision=function(e){if(this.isBootstrap||this.isBootstrap4||this.isMaterial&&!this.isMaterialTooltip){var t=this.isBootstrap4?3:6;switch(e){case"TopCenter":this.tooltipObj.setProperties({offsetY:-t},!1);break;case"BottomCenter":this.tooltipObj.setProperties({offsetY:t},!1);break;case"LeftCenter":this.tooltipObj.setProperties({offsetX:-t},!1);break;case"RightCenter":this.tooltipObj.setProperties({offsetX:t},!1)}}},s.prototype.materialTooltipEventCallBack=function(e){this.sliderBarClick(e),t.EventHandler.add(document,"mousemove touchmove",this.sliderBarMove,this),t.EventHandler.add(document,"mouseup touchend",this.sliderBarUp,this)},s.prototype.wireMaterialTooltipEvent=function(e){this.isMaterialTooltip&&(e?t.EventHandler.remove(this.tooltipElement,"mousedown touchstart",this.materialTooltipEventCallBack):t.EventHandler.add(this.tooltipElement,"mousedown touchstart",this.materialTooltipEventCallBack,this))},s.prototype.tooltipPositionCalculation=function(e){var t;switch(e){case"TopCenter":t=Fe;break;case"BottomCenter":t=Re;break;case"LeftCenter":t=Ve;break;case"RightCenter":t=Me}return t},s.prototype.getTooltipTransformProperties=function(e){var t;if(this.tooltipElement){var i="Horizontal"===this.orientation?this.tooltipElement.clientHeight+14-this.tooltipElement.clientHeight/2:this.tooltipElement.clientWidth+14-this.tooltipElement.clientWidth/2;t="Horizontal"===this.orientation?e===Fe?{rotate:"rotate(45deg)",translate:"translateY("+i+"px)"}:{rotate:"rotate(225deg)",translate:"translateY("+-i+"px)"}:e===Ve?{rotate:"rotate(-45deg)",translate:"translateX("+i+"px)"}:{rotate:"rotate(-225deg)",translate:"translateX("+-i+"px)"}}return t},s.prototype.openMaterialTooltip=function(){var e=this;if(this.isMaterialTooltip){this.refreshTooltip(this.firstHandle);var t=this.tooltipElement.firstElementChild;t.classList.remove(dt),t.classList.add(ht),this.firstHandle.style.cursor="default",this.tooltipElement.style.transition=this.scaleTransform,this.tooltipElement.classList.add(Ie),this.materialHandle.style.transform="scale(0)",t.innerText.length>4?this.tooltipElement.style.transform="scale(1)":this.tooltipElement.style.transform=this.getTooltipTransformProperties(this.previousTooltipClass).rotate,"Default"===this.type?setTimeout(function(){e.tooltipElement.style.transition=e.transition.handle},2500):setTimeout(function(){e.tooltipElement.style.transition="none"},2500)}},s.prototype.closeMaterialTooltip=function(){var e=this;if(this.isMaterialTooltip){var t=this.tooltipElement.firstElementChild;this.tooltipElement.style.transition=this.scaleTransform,t.classList.remove(ht),t.classList.add(dt),this.firstHandle.style.cursor="-webkit-grab",this.firstHandle.style.cursor="grab",this.materialHandle&&(this.materialHandle.style.transform="scale(1)"),this.tooltipElement.classList.remove(Ie),this.setTooltipTransform(),this.tooltipTarget=void 0,setTimeout(function(){e.tooltipElement.style.transition="none"},2500)}},s.prototype.checkTooltipPosition=function(e){var t=this.tooltipPositionCalculation(e.collidedPosition);void 0!==this.tooltipCollidedPosition&&this.tooltipCollidedPosition===e.collidedPosition&&e.element.classList.contains(t)||(this.isMaterialTooltip&&(void 0!==t&&(e.element.classList.remove(this.previousTooltipClass),e.element.classList.add(t),this.previousTooltipClass=t),e.element.style.transform&&e.element.classList.contains(Ie)&&e.element.firstElementChild.innerText.length<=4&&(e.element.style.transform=this.getTooltipTransformProperties(this.previousTooltipClass).rotate)),this.tooltipCollidedPosition=e.collidedPosition),this.isMaterialTooltip&&this.tooltipElement&&-1!==this.tooltipElement.style.transform.indexOf("translate")&&this.setTooltipTransform()},s.prototype.setTooltipTransform=function(){var e=this.getTooltipTransformProperties(this.previousTooltipClass);this.tooltipElement.firstElementChild.innerText.length>4?this.tooltipElement.style.transform=e.translate+" scale(0.01)":this.tooltipElement.style.transform=e.translate+" "+e.rotate+" scale(0.01)"},s.prototype.renderTooltip=function(){this.tooltipObj=new i.Tooltip({showTipPointer:this.isBootstrap||this.isMaterial||this.isBootstrap4||this.isTailwind,cssClass:Ae,height:this.isMaterial?30:"auto",animation:{open:{effect:"None"},close:{effect:"FadeOut",duration:500}},opensOn:"Custom",beforeOpen:this.tooltipBeforeOpen.bind(this),beforeCollision:this.checkTooltipPosition.bind(this),beforeClose:this.tooltipBeforeClose.bind(this),enableHtmlSanitizer:this.enableHtmlSanitizer}),this.tooltipObj.appendTo(this.firstHandle),this.initializeTooltipProps()},s.prototype.initializeTooltipProps=function(){var e=this.isMaterialTooltip?"Always":"Auto"===this.tooltip.showOn?"Hover":this.tooltip.showOn;this.setProperties({tooltip:{showOn:e}},!0),this.tooltipObj.position=this.tooltipPlacement(),this.tooltipCollision(this.tooltipObj.position),[this.firstHandle,this.rangeBar,this.secondHandle].forEach(function(e){t.isNullOrUndefined(e)||(e.style.transition="none")}),this.isMaterialTooltip&&(this.sliderContainer.classList.add(ze),this.tooltipValue(),this.tooltipObj.animation.close.effect="None",this.tooltipObj.open(this.firstHandle))},s.prototype.tooltipBeforeClose=function(){this.tooltipElement=void 0,this.tooltipCollidedPosition=void 0},s.prototype.setButtons=function(){this.firstBtn=this.createElement("div",{className:Se+" "+xe}),this.firstBtn.appendChild(this.createElement("span",{className:$e})),this.isTailwind&&this.firstBtn.querySelector("span").classList.add("e-icons"),this.firstBtn.tabIndex=-1,this.secondBtn=this.createElement("div",{className:Se+" "+Te}),this.secondBtn.appendChild(this.createElement("span",{className:$e})),this.isTailwind&&this.secondBtn.querySelector("span").classList.add("e-icons"),this.secondBtn.tabIndex=-1,this.sliderContainer.classList.add(it),this.sliderContainer.appendChild(this.firstBtn),this.sliderContainer.appendChild(this.secondBtn),this.sliderContainer.appendChild(this.element),this.buttonTitle()},s.prototype.buttonTitle=function(){var e=this.enableRtl&&"Vertical"!==this.orientation;this.l10n.setLocale(this.locale);var i=this.l10n.getConstant("decrementTitle"),s=this.l10n.getConstant("incrementTitle");t.attributes(e?this.secondBtn:this.firstBtn,{"aria-label":i,title:i}),t.attributes(e?this.firstBtn:this.secondBtn,{"aria-label":s,title:s})},s.prototype.buttonFocusOut=function(){this.isMaterial&&this.getHandle().classList.remove("e-large-thumb-size")},s.prototype.repeatButton=function(e){var t,i=this.handleValueUpdate(),s=this.enableRtl&&"Vertical"!==this.orientation;e.target.parentElement.classList.contains(xe)||e.target.classList.contains(xe)?t=s?this.add(i,parseFloat(this.step.toString()),!0):this.add(i,parseFloat(this.step.toString()),!1):(e.target.parentElement.classList.contains(Te)||e.target.classList.contains(Te))&&(t=s?this.add(i,parseFloat(this.step.toString()),!1):this.add(i,parseFloat(this.step.toString()),!0)),this.limits.enabled&&(t=this.getLimitCorrectedValues(t)),t>=this.min&&t<=this.max&&(this.changeHandleValue(t),this.tooltipToggle(this.getHandle()))},s.prototype.repeatHandlerMouse=function(e){e.preventDefault(),"mousedown"!==e.type&&"touchstart"!==e.type||(this.buttonClick(e),this.repeatInterval=setInterval(this.repeatButton.bind(this),180,e))},s.prototype.materialChange=function(){this.getHandle().classList.contains("e-large-thumb-size")||this.getHandle().classList.add("e-large-thumb-size")},s.prototype.repeatHandlerUp=function(e){this.changeEvent("changed",e),this.closeTooltip(),clearInterval(this.repeatInterval),this.getHandle().focus()},s.prototype.customTickCounter=function(e){var i=4;return!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&(e>4&&(i=3),e>7&&(i=2),e>14&&(i=1),e>28&&(i=0)),i},s.prototype.renderScale=function(){var e="Vertical"===this.orientation?"v":"h";this.noOfDecimals=this.numberOfDecimals(this.step),this.ul=this.createElement("ul",{className:ke+" e-"+e+"-scale "+Oe+"-"+this.ticks.placement.toLowerCase(),attrs:{role:"presentation",tabIndex:"-1","aria-hidden":"true"}}),this.ul.style.zIndex="-1",t.Browser.isAndroid&&"h"===e&&this.ul.classList.add(Qe);var i=this.ticks.smallStep;this.ticks.showSmallTicks?i<=0&&(i=parseFloat(t.formatUnit(this.step))):i=this.ticks.largeStep>0?this.ticks.largeStep:parseFloat(t.formatUnit(this.max))-parseFloat(t.formatUnit(this.min));var s=this.fractionalToInteger(this.min),n=this.fractionalToInteger(this.max),a=this.fractionalToInteger(i),l=!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&this.customValues.length-1,r=this.customTickCounter(l),o=!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0?l*r+l:Math.abs((n-s)/a);this.element.appendChild(this.ul);var h,d=parseFloat(this.min.toString());"v"===e&&(d=parseFloat(this.max.toString()));var u,c=0,p=100/o;p===1/0&&(p=5);for(var m=0,f=!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0?this.customValues.length-1:0,v=0;m<=o;m++){if(h=this.createElement("li",{attrs:{class:Oe,role:"presentation",tabIndex:"-1","aria-hidden":"true"}}),!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0)(u=m%(r+1)==0)&&("h"===e?(d=this.customValues[v],v++):(d=this.customValues[f],f--),h.setAttribute("title",d.toString()));else if(h.setAttribute("title",d.toString()),0===this.numberOfDecimals(this.max)&&0===this.numberOfDecimals(this.min)&&0===this.numberOfDecimals(this.step))u="h"===e?(d-parseFloat(this.min.toString()))%this.ticks.largeStep==0:Math.abs(d-parseFloat(this.max.toString()))%this.ticks.largeStep==0;else{var g=this.fractionalToInteger(this.ticks.largeStep),y=this.fractionalToInteger(d);u="h"===e?(y-s)%g==0:Math.abs(y-parseFloat(n.toString()))%g==0}u&&h.classList.add(Pe),"h"===e?h.style.width=p+"%":h.style.height=p+"%";var b=u?"Both"===this.ticks.placement?2:1:0;if(u)for(var E=0;E<b;E++)this.createTick(h,d,p);else t.isNullOrUndefined(this.customValues)&&this.formatTicksValue(h,d);this.ul.appendChild(h),this.tickElementCollection.push(h);var C=void 0;t.isNullOrUndefined(this.customValues)&&(C=this.numberOfDecimals(i)>this.numberOfDecimals(d)?this.numberOfDecimals(i):this.numberOfDecimals(d),d="h"===e?this.makeRoundNumber(d+i,C):this.makeRoundNumber(d-i,C),c=this.makeRoundNumber(c+i,C))}this.ticksAlignment(e,p)},s.prototype.ticksAlignment=function(e,t,i){void 0===i&&(i=!0),this.firstChild=this.ul.firstElementChild,this.lastChild=this.ul.lastElementChild,this.firstChild.classList.add(et),this.lastChild.classList.add(tt),this.sliderContainer.classList.add(ke+"-"+this.ticks.placement.toLowerCase()),"h"===e?(this.firstChild.style.width=t/2+"%",this.lastChild.style.width=t/2+"%"):(this.firstChild.style.height=t/2+"%",this.lastChild.style.height=t/2+"%");var s={ticksWrapper:this.ul,tickElements:this.tickElementCollection};i&&this.trigger("renderedTicks",s),this.scaleAlignment()},s.prototype.createTick=function(e,i,s){var n=this.createElement("span",{className:Le+" "+Oe+"-"+this.ticks.placement.toLowerCase(),attrs:{role:"presentation",tabIndex:"-1","aria-hidden":"true"}});e.appendChild(n),t.isNullOrUndefined(this.customValues)?this.formatTicksValue(e,i,n,s):this.enableHtmlSanitizer?n.innerHTML=t.SanitizeHtmlHelper.sanitize(i.toString()):n.innerHTML=i.toString()},s.prototype.formatTicksValue=function(e,i,s,n){var a=this,l=this.formatNumber(i),r={value:i,text:t.isNullOrUndefined(this.ticks)||t.isNullOrUndefined(this.ticks.format)?l:this.formatString(i,this.ticksFormatInfo).formatString,tickElement:e};this.trigger("renderingTicks",r,function(i){e.setAttribute("title",i.text.toString()),s&&(a.enableHtmlSanitizer?s.innerHTML=t.SanitizeHtmlHelper.sanitize(i.text.toString()):s.innerHTML=i.text.toString())})},s.prototype.scaleAlignment=function(){this.tickValuePosition();this.orientation;"Vertical"===this.orientation?this.element.getBoundingClientRect().width<=15?this.sliderContainer.classList.add(Je):this.sliderContainer.classList.remove(Je):this.element.getBoundingClientRect().height<=15?this.sliderContainer.classList.add(Je):this.sliderContainer.classList.remove(Je)},s.prototype.tickValuePosition=function(){this.firstChild=this.element.querySelector("ul").children[0];var e,i,s=this.firstChild.getBoundingClientRect(),n=this.ticks.smallStep,a=Math.abs(parseFloat(t.formatUnit(this.max))-parseFloat(t.formatUnit(this.min)))/n;this.firstChild.children.length>0&&(e=this.firstChild.children[0].getBoundingClientRect());var l,r=[this.sliderContainer.querySelectorAll("."+Oe+"."+Pe+" ."+Le)];l="Both"===this.ticks.placement?[].slice.call(r[0],2):[].slice.call(r[0],1);for(var o="Vertical"===this.orientation?2*s.height:2*s.width,h=0;h<this.firstChild.children.length;h++)"Vertical"===this.orientation?this.firstChild.children[h].style.top=-e.height/2+"px":this.enableRtl?this.firstChild.children[h].style.left=(o-this.firstChild.children[h].getBoundingClientRect().width)/2+"px":this.firstChild.children[h].style.left=-e.width/2+"px";for(h=0;h<l.length;h++)i=l[h].getBoundingClientRect(),"Vertical"===this.orientation?t.setStyleAttribute(l[h],{top:(o-i.height)/2+"px"}):t.setStyleAttribute(l[h],{left:(o-i.width)/2+"px"});this.enableRtl&&this.lastChild.children.length&&0!==a&&(this.lastChild.children[0].style.left=-this.lastChild.getBoundingClientRect().width/2+"px","Both"===this.ticks.placement&&(this.lastChild.children[1].style.left=-this.lastChild.getBoundingClientRect().width/2+"px")),0===a&&("Horizontal"===this.orientation&&(this.enableRtl?(this.firstChild.classList.remove(tt),this.firstChild.style.right=this.firstHandle.style.right,this.firstChild.children[0].style.left=this.firstChild.getBoundingClientRect().width/2+2+"px","Both"===this.ticks.placement&&(this.firstChild.children[1].style.left=this.firstChild.getBoundingClientRect().width/2+2+"px")):(this.firstChild.classList.remove(tt),this.firstChild.style.left=this.firstHandle.style.left)),"Vertical"===this.orientation&&this.firstChild.classList.remove(tt))},s.prototype.setAriaAttrValue=function(e){var i,s=!t.isNullOrUndefined(this.ticks)&&!t.isNullOrUndefined(this.ticks.format),n=s?this.formatContent(this.tooltipFormatInfo,!1):this.formatContent(this.ticksFormatInfo,!1),a=s?this.formatContent(this.ticksFormatInfo,!0):this.formatContent(this.tooltipFormatInfo,!0);i=2===(n=this.customAriaText?this.customAriaText:n).split(" - ").length?n.split(" - "):[n,n],this.setAriaAttributes(e),"Range"!==this.type?t.attributes(e,{"aria-valuenow":a,"aria-valuetext":n}):this.enableRtl?e===this.firstHandle?t.attributes(e,{"aria-valuenow":a.split(" - ")[1],"aria-valuetext":i[1]}):t.attributes(e,{"aria-valuenow":a.split(" - ")[0],"aria-valuetext":i[0]}):e===this.firstHandle?t.attributes(e,{"aria-valuenow":a.split(" - ")[0],"aria-valuetext":i[0]}):t.attributes(e,{"aria-valuenow":a.split(" - ")[1],"aria-valuetext":i[1]})},s.prototype.handleValueUpdate=function(){return"Range"===this.type?1===this.activeHandle?this.handleVal1:this.handleVal2:this.handleVal1},s.prototype.getLimitCorrectedValues=function(e){return e="MinRange"===this.type||"Default"===this.type?this.getLimitValueAndPosition(e,this.limits.minStart,this.limits.minEnd)[0]:1===this.activeHandle?this.getLimitValueAndPosition(e,this.limits.minStart,this.limits.minEnd)[0]:this.getLimitValueAndPosition(e,this.limits.maxStart,this.limits.maxEnd)[0]},s.prototype.focusSliderElement=function(){this.isElementFocused||(this.element.focus(),this.isElementFocused=!0)},s.prototype.buttonClick=function(e){this.focusSliderElement();var i,s=this.enableRtl&&"Vertical"!==this.orientation,n=this.handleValueUpdate();40===e.keyCode||37===e.keyCode||e.currentTarget.classList.contains(xe)?i=s?this.add(n,parseFloat(this.step.toString()),!0):this.add(n,parseFloat(this.step.toString()),!1):38===e.keyCode||39===e.keyCode||e.currentTarget.classList.contains(Te)?i=s?this.add(n,parseFloat(this.step.toString()),!1):this.add(n,parseFloat(this.step.toString()),!0):33===e.keyCode||e.currentTarget.classList.contains(xe)?i=s?this.add(n,parseFloat(this.ticks.largeStep.toString()),!1):this.add(n,parseFloat(this.ticks.largeStep.toString()),!0):34===e.keyCode||e.currentTarget.classList.contains(Te)?i=s?this.add(n,parseFloat(this.ticks.largeStep.toString()),!0):this.add(n,parseFloat(this.ticks.largeStep.toString()),!1):36===e.keyCode?i=parseFloat(this.min.toString()):35===e.keyCode&&(i=parseFloat(this.max.toString())),this.limits.enabled&&(i=this.getLimitCorrectedValues(i)),this.changeHandleValue(i),!this.isMaterial||this.tooltip.isVisible||this.getHandle().classList.contains(Ge)||this.materialChange(),this.tooltipToggle(this.getHandle()),this.getHandle().focus(),e.currentTarget.classList.contains(xe)&&t.EventHandler.add(this.firstBtn,"mouseup touchend",this.buttonUp,this),e.currentTarget.classList.contains(Te)&&t.EventHandler.add(this.secondBtn,"mouseup touchend",this.buttonUp,this)},s.prototype.tooltipToggle=function(e){this.isMaterialTooltip?this.tooltipElement.classList.contains(Ie)?this.refreshTooltip(this.firstHandle):this.openMaterialTooltip():this.tooltipElement?this.refreshTooltip(e):this.openTooltip(e)},s.prototype.buttonUp=function(e){e.currentTarget.classList.contains(xe)&&t.EventHandler.remove(this.firstBtn,"mouseup touchend",this.buttonUp),e.currentTarget.classList.contains(Te)&&t.EventHandler.remove(this.secondBtn,"mouseup touchend",this.buttonUp)},s.prototype.setRangeBar=function(){"Horizontal"===this.orientation?"MinRange"===this.type?(this.enableRtl?this.rangeBar.style.right="0px":this.rangeBar.style.left="0px",t.setStyleAttribute(this.rangeBar,{width:t.isNullOrUndefined(this.handlePos1)?0:this.handlePos1+"px"})):(this.enableRtl?this.rangeBar.style.right=this.handlePos1+"px":this.rangeBar.style.left=this.handlePos1+"px",t.setStyleAttribute(this.rangeBar,{width:this.handlePos2-this.handlePos1+"px"})):"MinRange"===this.type?(this.rangeBar.style.bottom="0px",t.setStyleAttribute(this.rangeBar,{height:t.isNullOrUndefined(this.handlePos1)?0:this.handlePos1+"px"})):(this.rangeBar.style.bottom=this.handlePos1+"px",t.setStyleAttribute(this.rangeBar,{height:this.handlePos2-this.handlePos1+"px"}))},s.prototype.checkValidValueAndPos=function(e){return e=this.checkHandleValue(e),e=this.checkHandlePosition(e)},s.prototype.setLimitBarPositions=function(e,t,i,s){"Horizontal"===this.orientation?this.enableRtl?(this.limitBarFirst.style.right=e+"px",this.limitBarFirst.style.width=t-e+"px"):(this.limitBarFirst.style.left=e+"px",this.limitBarFirst.style.width=t-e+"px"):(this.limitBarFirst.style.bottom=e+"px",this.limitBarFirst.style.height=t-e+"px"),"Range"===this.type&&("Horizontal"===this.orientation?this.enableRtl?(this.limitBarSecond.style.right=i+"px",this.limitBarSecond.style.width=s-i+"px"):(this.limitBarSecond.style.left=i+"px",this.limitBarSecond.style.width=s-i+"px"):(this.limitBarSecond.style.bottom=i+"px",this.limitBarSecond.style.height=s-i+"px"))},s.prototype.setLimitBar=function(){if("Default"===this.type||"MinRange"===this.type){var e=this.getLimitValueAndPosition(this.limits.minStart,this.limits.minStart,this.limits.minEnd,!0)[0];e=this.checkValidValueAndPos(e);var t=this.getLimitValueAndPosition(this.limits.minEnd,this.limits.minStart,this.limits.minEnd,!0)[0];t=this.checkValidValueAndPos(t),this.setLimitBarPositions(e,t)}else if("Range"===this.type){var i=this.getLimitValueAndPosition(this.limits.minStart,this.limits.minStart,this.limits.minEnd,!0)[0];i=this.checkValidValueAndPos(i);var s=this.getLimitValueAndPosition(this.limits.minEnd,this.limits.minStart,this.limits.minEnd,!0)[0];s=this.checkValidValueAndPos(s);var n=this.getLimitValueAndPosition(this.limits.maxStart,this.limits.maxStart,this.limits.maxEnd,!0)[0];n=this.checkValidValueAndPos(n);var a=this.getLimitValueAndPosition(this.limits.maxEnd,this.limits.maxStart,this.limits.maxEnd,!0)[0];a=this.checkValidValueAndPos(a),this.setLimitBarPositions(i,s,n,a)}},s.prototype.getLimitValueAndPosition=function(e,i,s,n){return t.isNullOrUndefined(i)&&(i=this.min,t.isNullOrUndefined(e)&&n&&(e=i)),t.isNullOrUndefined(s)&&(s=this.max,t.isNullOrUndefined(e)&&n&&(e=s)),e<i&&(e=i),e>s&&(e=s),[e,this.checkHandlePosition(e)]},s.prototype.setValue=function(){if(!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&(this.min=0,this.max=this.customValues.length-1,this.setBarColor()),this.setAriaAttributes(this.firstHandle),this.handleVal1=t.isNullOrUndefined(this.value)?this.checkHandleValue(parseFloat(this.min.toString())):this.checkHandleValue(parseFloat(this.value.toString())),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.preHandlePos1=this.handlePos1,t.isNullOrUndefined(this.activeHandle)?"Range"===this.type?this.activeHandle=2:this.activeHandle=1:this.activeHandle=this.activeHandle,"Default"===this.type||"MinRange"===this.type){if(this.limits.enabled){var e=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd);this.handleVal1=e[0],this.handlePos1=e[1],this.preHandlePos1=this.handlePos1}this.setHandlePosition(null),this.handleStart(),this.value=this.handleVal1,this.setAriaAttrValue(this.firstHandle),this.changeEvent("changed",null)}else this.validateRangeValue();"Default"!==this.type&&this.setRangeBar(),this.limits.enabled&&this.setLimitBar()},s.prototype.rangeValueUpdate=function(){null!==this.value&&"object"==typeof this.value||(this.value=[parseFloat(t.formatUnit(this.min)),parseFloat(t.formatUnit(this.max))])},s.prototype.validateRangeValue=function(){this.rangeValueUpdate(),this.setRangeValue()},s.prototype.modifyZindex=function(){"Range"===this.type?1===this.activeHandle?(this.firstHandle.style.zIndex=this.zIndex+4+"",this.secondHandle.style.zIndex=this.zIndex+3+""):(this.firstHandle.style.zIndex=this.zIndex+3+"",this.secondHandle.style.zIndex=this.zIndex+4+""):this.isMaterialTooltip&&this.tooltipElement&&(this.tooltipElement.style.zIndex=i.getZindexPartial(this.element)+"")},s.prototype.setHandlePosition=function(e){var t,i=this,s=1===this.activeHandle?this.handlePos1:this.handlePos2;t=this.isMaterialTooltip?[this.firstHandle,this.materialHandle]:[this.getHandle()],this.handleStart(),t.forEach(function(e){"Horizontal"===i.orientation?i.enableRtl?e.style.right=s+"px":e.style.left=s+"px":e.style.bottom=s+"px"}),this.changeEvent("change",e)},s.prototype.getHandle=function(){return 1===this.activeHandle?this.firstHandle:this.secondHandle},s.prototype.setRangeValue=function(){this.updateRangeValue(),this.activeHandle=1,this.setHandlePosition(null),this.activeHandle=2,this.setHandlePosition(null),this.activeHandle=1},s.prototype.changeEvent=function(e,t){var i="change"===e?this.previousVal:this.previousChanged;if("Range"!==this.type)this.setProperties({value:this.handleVal1},!0),i===this.value||this.isMaterialTooltip&&this.initialTooltip||(this.trigger(e,this.changeEventArgs(e,t)),this.initialTooltip=!0,this.setPreviousVal(e,this.value)),this.setAriaAttrValue(this.firstHandle);else{var s=this.value=[this.handleVal1,this.handleVal2];this.setProperties({value:s},!0),(i.length===this.value.length&&this.value[0]!==i[0]||this.value[1]!==i[1])&&(this.initialTooltip=!1,this.trigger(e,this.changeEventArgs(e,t)),this.initialTooltip=!0,this.setPreviousVal(e,this.value)),this.setAriaAttrValue(this.getHandle())}this.hiddenInput.value=this.value.toString()},s.prototype.changeEventArgs=function(e,i){var s;return this.tooltip.isVisible&&this.tooltipObj&&this.initialTooltip?(this.tooltipValue(),s={value:this.value,previousValue:"change"===e?this.previousVal:this.previousChanged,action:e,text:this.tooltipObj.content,isInteracted:!t.isNullOrUndefined(i)}):s={value:this.value,previousValue:"change"===e?this.previousVal:this.previousChanged,action:e,text:t.isNullOrUndefined(this.ticksFormatInfo.format)?this.value.toString():"Range"!==this.type?this.formatString(this.value,this.ticksFormatInfo).formatString:this.formatString(this.value[0],this.ticksFormatInfo).formatString+" - "+this.formatString(this.value[1],this.ticksFormatInfo).formatString,isInteracted:!t.isNullOrUndefined(i)},s},s.prototype.setPreviousVal=function(e,t){"change"===e?this.previousVal=t:this.previousChanged=t},s.prototype.updateRangeValue=function(){var e=this.value.toString().split(",").map(Number);if(this.enableRtl&&"Vertical"!==this.orientation||this.rtl?this.value=[e[1],e[0]]:this.value=[e[0],e[1]],this.enableRtl&&"Vertical"!==this.orientation?(this.handleVal1=this.checkHandleValue(this.value[1]),this.handleVal2=this.checkHandleValue(this.value[0])):(this.handleVal1=this.checkHandleValue(this.value[0]),this.handleVal2=this.checkHandleValue(this.value[1])),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.handlePos2=this.checkHandlePosition(this.handleVal2),this.handlePos1>this.handlePos2&&(this.handlePos1=this.handlePos2,this.handleVal1=this.handleVal2),this.preHandlePos1=this.handlePos1,this.preHandlePos2=this.handlePos2,this.limits.enabled){this.activeHandle=1;var t=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd);this.handleVal1=t[0],this.handlePos1=t[1],this.preHandlePos1=this.handlePos1,this.activeHandle=2,t=this.getLimitValueAndPosition(this.handleVal2,this.limits.maxStart,this.limits.maxEnd),this.handleVal2=t[0],this.handlePos2=t[1],this.preHandlePos2=this.handlePos2}},s.prototype.checkHandlePosition=function(e){var i;return e=100*(e-parseFloat(t.formatUnit(this.min)))/(parseFloat(t.formatUnit(this.max))-parseFloat(t.formatUnit(this.min))),i="Horizontal"===this.orientation?this.element.getBoundingClientRect().width*(e/100):this.element.getBoundingClientRect().height*(e/100),parseFloat(t.formatUnit(this.max))===parseFloat(t.formatUnit(this.min))&&(i="Horizontal"===this.orientation?this.element.getBoundingClientRect().width:this.element.getBoundingClientRect().height),i},s.prototype.checkHandleValue=function(e){if(this.min>this.max&&(this.min=this.max),this.min===this.max)return parseFloat(t.formatUnit(this.max));var i=this.tempStartEnd();return e<i.start?e=i.start:e>i.end&&(e=i.end),e},s.prototype.reposition=function(){var e=this;this.firstHandle.style.transition="none","Default"!==this.type&&(this.rangeBar.style.transition="none"),"Range"===this.type&&(this.secondHandle.style.transition="none"),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.handleVal2&&(this.handlePos2=this.checkHandlePosition(this.handleVal2)),"Horizontal"===this.orientation?(this.enableRtl?this.firstHandle.style.right=this.handlePos1+"px":this.firstHandle.style.left=this.handlePos1+"px",this.isMaterialTooltip&&(this.enableRtl?this.materialHandle.style.right=this.handlePos1+"px":this.materialHandle.style.left=this.handlePos1+"px"),"MinRange"===this.type?(this.enableRtl?this.rangeBar.style.right="0px":this.rangeBar.style.left="0px",t.setStyleAttribute(this.rangeBar,{width:t.isNullOrUndefined(this.handlePos1)?0:this.handlePos1+"px"})):"Range"===this.type&&(this.enableRtl?this.secondHandle.style.right=this.handlePos2+"px":this.secondHandle.style.left=this.handlePos2+"px",this.enableRtl?this.rangeBar.style.right=this.handlePos1+"px":this.rangeBar.style.left=this.handlePos1+"px",t.setStyleAttribute(this.rangeBar,{width:this.handlePos2-this.handlePos1+"px"}))):(this.firstHandle.style.bottom=this.handlePos1+"px",this.isMaterialTooltip&&(this.materialHandle.style.bottom=this.handlePos1+"px"),"MinRange"===this.type?(this.rangeBar.style.bottom="0px",t.setStyleAttribute(this.rangeBar,{height:t.isNullOrUndefined(this.handlePos1)?0:this.handlePos1+"px"})):"Range"===this.type&&(this.secondHandle.style.bottom=this.handlePos2+"px",this.rangeBar.style.bottom=this.handlePos1+"px",t.setStyleAttribute(this.rangeBar,{height:this.handlePos2-this.handlePos1+"px"}))),this.limits.enabled&&this.setLimitBar(),"None"!==this.ticks.placement&&this.ul&&(this.removeElement(this.ul),this.ul=void 0,this.renderScale()),this.handleStart(),this.tooltip.isVisible||setTimeout(function(){e.firstHandle.style.transition=e.scaleTransform,"Range"===e.type&&(e.secondHandle.style.transition=e.scaleTransform)}),this.refreshTooltip(this.tooltipTarget),this.setBarColor()},s.prototype.changeHandleValue=function(e){var t=null;1===this.activeHandle?(this.limits.enabled&&this.limits.startHandleFixed||(this.handleVal1=this.checkHandleValue(e),this.handlePos1=this.checkHandlePosition(this.handleVal1),"Range"===this.type&&this.handlePos1>this.handlePos2&&(this.handlePos1=this.handlePos2,this.handleVal1=this.handleVal2),this.handlePos1!==this.preHandlePos1&&(t=this.preHandlePos1=this.handlePos1)),this.modifyZindex()):(this.limits.enabled&&this.limits.endHandleFixed||(this.handleVal2=this.checkHandleValue(e),this.handlePos2=this.checkHandlePosition(this.handleVal2),"Range"===this.type&&this.handlePos2<this.handlePos1&&(this.handlePos2=this.handlePos1,this.handleVal2=this.handleVal1),this.handlePos2!==this.preHandlePos2&&(t=this.preHandlePos2=this.handlePos2)),this.modifyZindex()),null!==t&&("Default"!==this.type&&this.setRangeBar(),this.setHandlePosition(null))},s.prototype.tempStartEnd=function(){return this.min>this.max?{start:this.max,end:this.min}:{start:this.min,end:this.max}},s.prototype.xyToPosition=function(e){if(this.min===this.max)return 100;if("Horizontal"===this.orientation){var t=e.x-this.element.getBoundingClientRect().left,i=this.element.offsetWidth/100;this.val=t/i}else{var s=e.y-this.element.getBoundingClientRect().top;i=this.element.offsetHeight/100;this.val=100-s/i}var n=this.stepValueCalculation(this.val);return n<0?n=0:n>100&&(n=100),this.enableRtl&&"Vertical"!==this.orientation&&(n=100-n),"Horizontal"===this.orientation?this.element.getBoundingClientRect().width*(n/100):this.element.getBoundingClientRect().height*(n/100)},s.prototype.stepValueCalculation=function(e){0===this.step&&(this.step=1);var i=parseFloat(t.formatUnit(this.step))/((parseFloat(t.formatUnit(this.max))-parseFloat(t.formatUnit(this.min)))/100),s=e%Math.abs(i);return 0!==s&&(i/2>s?e-=s:e+=Math.abs(i)-s),e},s.prototype.add=function(e,t,i){var s=Math.pow(10,3);return i?(Math.round(e*s)+Math.round(t*s))/s:(Math.round(e*s)-Math.round(t*s))/s},s.prototype.positionToValue=function(e){var i,s=parseFloat(t.formatUnit(this.max))-parseFloat(t.formatUnit(this.min));i="Horizontal"===this.orientation?e/this.element.getBoundingClientRect().width*s:e/this.element.getBoundingClientRect().height*s;return this.add(i,parseFloat(this.min.toString()),!0)},s.prototype.sliderBarClick=function(e){e.preventDefault();var t;"mousedown"===e.type||"mouseup"===e.type||"click"===e.type?t={x:e.clientX,y:e.clientY}:"touchend"!==e.type&&"touchstart"!==e.type||(t={x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY});var i=this.xyToPosition(t),s=this.positionToValue(i);if("Range"===this.type&&this.handlePos2-i<i-this.handlePos1){if(this.activeHandle=2,!this.limits.enabled||!this.limits.endHandleFixed){if(this.limits.enabled){s=(n=this.getLimitValueAndPosition(s,this.limits.maxStart,this.limits.maxEnd))[0],i=n[1]}this.secondHandle.classList.add(at),this.handlePos2=this.preHandlePos2=i,this.handleVal2=s}this.modifyZindex(),this.secondHandle.focus()}else{if(this.activeHandle=1,!this.limits.enabled||!this.limits.startHandleFixed){if(this.limits.enabled){var n;s=(n=this.getLimitValueAndPosition(s,this.limits.minStart,this.limits.minEnd))[0],i=n[1]}this.firstHandle.classList.add(at),this.handlePos1=this.preHandlePos1=i,this.handleVal1=s}this.modifyZindex(),this.firstHandle.focus()}this.isMaterialTooltip&&this.tooltipElement.classList.add(De);var a=this.element.querySelector("."+Ge);a&&this.getHandle()!==a&&a.classList.remove(Ge);var l=1===this.activeHandle?this.firstHandle:this.secondHandle;if(e.target===l)return!this.isMaterial||this.tooltip.isVisible||this.getHandle().classList.contains(Ge)||this.materialChange(),this.sliderBarUp(e),void this.tooltipToggle(this.getHandle());if(this.checkRepeatedValue(s)){var r=this.isMaterial&&this.tooltip.isVisible?this.transitionOnMaterialTooltip:this.transition;this.getHandle().style.transition=r.handle,"Default"!==this.type&&(this.rangeBar.style.transition=r.rangeBar),this.setHandlePosition(e),this.isMaterialTooltip&&(this.initialTooltip=!1),this.changeEvent("changed",e),"Default"!==this.type&&this.setRangeBar()}},s.prototype.handleValueAdjust=function(e,t,i){1===i?(this.handleVal1=t,this.handleVal2=this.handleVal1+this.minDiff):2===i&&(this.handleVal2=t,this.handleVal1=this.handleVal2-this.minDiff),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.handlePos2=this.checkHandlePosition(this.handleVal2)},s.prototype.dragRangeBarMove=function(e){var t,i;"touchmove"!==e.type&&e.preventDefault(),this.rangeBarDragged=!0;var s;this.rangeBar.style.transition="none",this.firstHandle.style.transition="none",this.secondHandle.style.transition="none";var n,a;if("mousemove"===e.type?(n=(t=[e.clientX,e.clientY])[0],a=t[1]):(n=(i=[e.changedTouches[0].clientX,e.changedTouches[0].clientY])[0],a=i[1]),!(this.limits.enabled&&this.limits.startHandleFixed||this.limits.enabled&&this.limits.endHandleFixed)){if(s=this.enableRtl?{x:n+this.secondPartRemain,y:a+this.secondPartRemain}:{x:n-this.firstPartRemain,y:a+this.secondPartRemain},this.handlePos1=this.xyToPosition(s),this.handleVal1=this.positionToValue(this.handlePos1),s=this.enableRtl?{x:n-this.firstPartRemain,y:a-this.firstPartRemain}:{x:n+this.secondPartRemain,y:a-this.firstPartRemain},this.handlePos2=this.xyToPosition(s),this.handleVal2=this.positionToValue(this.handlePos2),this.limits.enabled){var l=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd);this.handleVal1=l[0],this.handlePos1=l[1],this.handleVal1===this.limits.minEnd&&this.handleValueAdjust(this.handleVal1,this.limits.minEnd,1),this.handleVal1===this.limits.minStart&&this.handleValueAdjust(this.handleVal1,this.limits.minStart,1),l=this.getLimitValueAndPosition(this.handleVal2,this.limits.maxStart,this.limits.maxEnd),this.handleVal2=l[0],this.handlePos2=l[1],this.handleVal2===this.limits.maxStart&&this.handleValueAdjust(this.handleVal2,this.limits.maxStart,2),this.handleVal2===this.limits.maxEnd&&this.handleValueAdjust(this.handleVal2,this.limits.maxEnd,2)}this.handleVal2===this.max&&this.handleValueAdjust(this.handleVal2,this.max,2),this.handleVal1===this.min&&this.handleValueAdjust(this.handleVal1,this.min,1)}this.activeHandle=1,this.setHandlePosition(e),this.activeHandle=2,this.setHandlePosition(e),this.tooltipToggle(this.rangeBar),this.setRangeBar()},s.prototype.sliderBarUp=function(e){this.changeEvent("changed",e),this.handleFocusOut(),this.firstHandle.classList.remove(at),"Range"===this.type&&(this.initialTooltip=!1,this.secondHandle.classList.remove(at)),this.closeTooltip(),this.isMaterial&&(this.getHandle().classList.remove("e-large-thumb-size"),this.isMaterialTooltip&&this.tooltipElement.classList.remove(De)),t.EventHandler.remove(document,"mousemove touchmove",this.sliderBarMove),t.EventHandler.remove(document,"mouseup touchend",this.sliderBarUp)},s.prototype.sliderBarMove=function(e){"touchmove"!==e.type&&e.preventDefault();var t;t="mousemove"===e.type?{x:e.clientX,y:e.clientY}:{x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY};var i=this.xyToPosition(t),s=this.positionToValue(i);if(i=Math.round(i),"Range"!==this.type&&1===this.activeHandle){if(!this.limits.enabled||!this.limits.startHandleFixed){if(this.limits.enabled){var n=this.getLimitValueAndPosition(s,this.limits.minStart,this.limits.minEnd);i=n[1],s=n[0]}this.handlePos1=i,this.handleVal1=s}this.firstHandle.classList.add(at)}if("Range"===this.type)if(1===this.activeHandle){if(this.firstHandle.classList.add(at),!(this.limits.enabled&&this.limits.startHandleFixed||(i>this.handlePos2&&(i=this.handlePos2,s=this.handleVal2),i===this.preHandlePos1))){if(this.limits.enabled){s=(a=this.getLimitValueAndPosition(s,this.limits.minStart,this.limits.minEnd))[0],i=a[1]}this.handlePos1=this.preHandlePos1=i,this.handleVal1=s,this.activeHandle=1}}else if(2===this.activeHandle&&(this.secondHandle.classList.add(at),!(this.limits.enabled&&this.limits.endHandleFixed||(i<this.handlePos1&&(i=this.handlePos1,s=this.handleVal1),i===this.preHandlePos2)))){if(this.limits.enabled){var a;s=(a=this.getLimitValueAndPosition(s,this.limits.maxStart,this.limits.maxEnd))[0],i=a[1]}this.handlePos2=this.preHandlePos2=i,this.handleVal2=s,this.activeHandle=2}this.checkRepeatedValue(s)&&(this.getHandle().style.transition=this.scaleTransform,"Default"!==this.type&&(this.rangeBar.style.transition="none"),this.setHandlePosition(e),!this.isMaterial||this.tooltip.isVisible||this.getHandle().classList.contains(Ge)||this.materialChange(),this.tooltipToggle(this.getHandle()),"Default"!==this.type&&this.setRangeBar())},s.prototype.dragRangeBarUp=function(e){this.rangeBarDragged?this.isDragComplete=!0:(this.focusSliderElement(),this.sliderBarClick(e)),this.changeEvent("changed",e),this.closeTooltip(),t.EventHandler.remove(document,"mousemove touchmove",this.dragRangeBarMove),t.EventHandler.remove(document,"mouseup touchend",this.dragRangeBarUp),this.rangeBarDragged=!1},s.prototype.checkRepeatedValue=function(e){if("Range"===this.type){if(e===(this.enableRtl&&"Vertical"!==this.orientation?1===this.activeHandle?this.previousVal[1]:this.previousVal[0]:1===this.activeHandle?this.previousVal[0]:this.previousVal[1]))return 0}else if(e===this.previousVal)return 0;return 1},s.prototype.refreshTooltip=function(e){this.tooltip.isVisible&&this.tooltipObj&&(this.tooltipValue(),e&&(this.tooltipObj.refresh(e),this.tooltipTarget=e))},s.prototype.openTooltip=function(e){this.tooltip.isVisible&&this.tooltipObj&&!this.isMaterialTooltip&&(this.tooltipValue(),this.tooltipObj.open(e),this.tooltipTarget=e)},s.prototype.closeTooltip=function(){this.tooltip.isVisible&&this.tooltipObj&&"Always"!==this.tooltip.showOn&&!this.isMaterialTooltip&&(this.tooltipValue(),this.tooltipObj.close(),this.tooltipTarget=void 0)},s.prototype.keyDown=function(e){switch(e.keyCode){case 37:case 38:case 39:case 40:case 33:case 34:case 36:case 35:e.preventDefault(),this.buttonClick(e)}},s.prototype.wireButtonEvt=function(e){e?(t.EventHandler.remove(this.firstBtn,"mouseleave touchleave",this.buttonFocusOut),t.EventHandler.remove(this.secondBtn,"mouseleave touchleave",this.buttonFocusOut),t.EventHandler.remove(this.firstBtn,"mousedown touchstart",this.repeatHandlerMouse),t.EventHandler.remove(this.firstBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp),t.EventHandler.remove(this.secondBtn,"mousedown touchstart",this.repeatHandlerMouse),t.EventHandler.remove(this.secondBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp),t.EventHandler.remove(this.firstBtn,"focusout",this.sliderFocusOut),t.EventHandler.remove(this.secondBtn,"focusout",this.sliderFocusOut)):(t.EventHandler.add(this.firstBtn,"mouseleave touchleave",this.buttonFocusOut,this),t.EventHandler.add(this.secondBtn,"mouseleave touchleave",this.buttonFocusOut,this),t.EventHandler.add(this.firstBtn,"mousedown touchstart",this.repeatHandlerMouse,this),t.EventHandler.add(this.firstBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp,this),t.EventHandler.add(this.secondBtn,"mousedown touchstart",this.repeatHandlerMouse,this),t.EventHandler.add(this.secondBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp,this),t.EventHandler.add(this.firstBtn,"focusout",this.sliderFocusOut,this),t.EventHandler.add(this.secondBtn,"focusout",this.sliderFocusOut,this))},s.prototype.rangeBarMousedown=function(e){var i,s;if(e.preventDefault(),this.focusSliderElement(),"Range"===this.type&&this.drag&&e.target===this.rangeBar){var n=void 0,a=void 0;"mousedown"===e.type?(n=(i=[e.clientX,e.clientY])[0],a=i[1]):"touchstart"===e.type&&(n=(s=[e.changedTouches[0].clientX,e.changedTouches[0].clientY])[0],a=s[1]),"Horizontal"===this.orientation?(this.firstPartRemain=n-this.rangeBar.getBoundingClientRect().left,this.secondPartRemain=this.rangeBar.getBoundingClientRect().right-n):(this.firstPartRemain=a-this.rangeBar.getBoundingClientRect().top,this.secondPartRemain=this.rangeBar.getBoundingClientRect().bottom-a),this.minDiff=this.handleVal2-this.handleVal1,this.tooltipToggle(this.rangeBar);var l=this.element.querySelector("."+Ge);l&&l.classList.remove(Ge),t.EventHandler.add(document,"mousemove touchmove",this.dragRangeBarMove,this),t.EventHandler.add(document,"mouseup touchend",this.dragRangeBarUp,this)}},s.prototype.elementClick=function(e){this.isDragComplete?this.isDragComplete=!1:(e.preventDefault(),this.focusSliderElement(),this.sliderBarClick(e))},s.prototype.wireEvents=function(){this.onresize=this.reposition.bind(this),window.addEventListener("resize",this.onresize),this.enabled&&!this.readonly&&(t.EventHandler.add(this.element,"click",this.elementClick,this),"Range"===this.type&&this.drag&&t.EventHandler.add(this.rangeBar,"mousedown touchstart",this.rangeBarMousedown,this),t.EventHandler.add(this.sliderContainer,"keydown",this.keyDown,this),t.EventHandler.add(this.sliderContainer,"keyup",this.keyUp,this),t.EventHandler.add(this.element,"focusout",this.sliderFocusOut,this),t.EventHandler.add(this.sliderContainer,"mouseover mouseout touchstart touchend",this.hover,this),this.wireFirstHandleEvt(!1),"Range"===this.type&&this.wireSecondHandleEvt(!1),this.showButtons&&this.wireButtonEvt(!1),this.wireMaterialTooltipEvent(!1),this.isForm&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this))},s.prototype.unwireEvents=function(){t.EventHandler.remove(this.element,"click",this.elementClick),"Range"===this.type&&this.drag&&t.EventHandler.remove(this.rangeBar,"mousedown touchstart",this.rangeBarMousedown),t.EventHandler.remove(this.sliderContainer,"keydown",this.keyDown),t.EventHandler.remove(this.sliderContainer,"keyup",this.keyUp),t.EventHandler.remove(this.element,"focusout",this.sliderFocusOut),t.EventHandler.remove(this.sliderContainer,"mouseover mouseout touchstart touchend",this.hover),this.wireFirstHandleEvt(!0),"Range"===this.type&&this.wireSecondHandleEvt(!0),this.showButtons&&this.wireButtonEvt(!0),this.wireMaterialTooltipEvent(!0),t.EventHandler.remove(this.element,"reset",this.formResetHandler)},s.prototype.formResetHandler=function(){this.setProperties({value:this.formResetValue},!0),this.setValue()},s.prototype.keyUp=function(e){if(9===e.keyCode&&e.target.classList.contains(Ee)&&(this.focusSliderElement(),!e.target.classList.contains(Ge))){this.element.querySelector("."+Ge)&&this.element.querySelector("."+Ge).classList.remove(Ge),e.target.classList.add(Ge);var t=e.target.parentElement;t===this.element&&(t.querySelector("."+qe).classList.add(st),"Range"!==this.type&&"MinRange"!==this.type||t.querySelector("."+Ce).classList.add(nt)),"Range"===this.type&&(e.target.previousSibling.classList.contains(Ee)?this.activeHandle=2:this.activeHandle=1),this.getHandle().focus(),this.tooltipToggle(this.getHandle())}this.closeTooltip(),this.changeEvent("changed",e)},s.prototype.hover=function(e){t.isNullOrUndefined(e)||("mouseover"===e.type||"touchmove"===e.type||"mousemove"===e.type||"pointermove"===e.type||"touchstart"===e.type?this.sliderContainer.classList.add(Ne):this.sliderContainer.classList.remove(Ne))},s.prototype.sliderFocusOut=function(e){e.relatedTarget!==this.secondHandle&&e.relatedTarget!==this.firstHandle&&e.relatedTarget!==this.element&&e.relatedTarget!==this.firstBtn&&e.relatedTarget!==this.secondBtn&&(this.closeMaterialTooltip(),this.closeTooltip(),this.element.querySelector("."+Ge)&&this.element.querySelector("."+Ge).classList.remove(Ge),this.element.querySelector("."+st)&&(this.element.querySelector("."+st).classList.remove(st),"Range"!==this.type&&"MinRange"!==this.type||!this.element.querySelector("."+nt)||this.element.querySelector("."+nt).classList.remove(nt)),this.hiddenInput.focus(),this.hiddenInput.blur(),this.isElementFocused=!1)},s.prototype.removeElement=function(e){e.parentNode&&e.parentNode.removeChild(e)},s.prototype.changeSliderType=function(e,i){this.isMaterialTooltip&&this.materialHandle&&(this.sliderContainer.classList.remove(ze),this.removeElement(this.materialHandle),this.materialHandle=void 0),this.removeElement(this.firstHandle),this.firstHandle=void 0,"Default"!==e&&("Range"===e&&(this.removeElement(this.secondHandle),this.secondHandle=void 0),this.removeElement(this.rangeBar),this.rangeBar=void 0),this.tooltip.isVisible&&!t.isNullOrUndefined(this.tooltipObj)&&(this.tooltipObj.destroy(),this.tooltipElement=void 0,this.tooltipCollidedPosition=void 0),this.limits.enabled&&("MinRange"===e||"Default"===e?t.isNullOrUndefined(this.limitBarFirst)||(this.removeElement(this.limitBarFirst),this.limitBarFirst=void 0):t.isNullOrUndefined(this.limitBarSecond)||(this.removeElement(this.limitBarSecond),this.limitBarSecond=void 0)),this.activeHandle=1,this.getThemeInitialization(),"Range"===this.type&&this.rangeValueUpdate(),this.createRangeBar(),this.limits.enabled&&this.createLimitBar(),this.setHandler(),this.setOrientClass(),this.wireFirstHandleEvt(!1),"Range"===this.type&&this.wireSecondHandleEvt(!1),this.setValue(),this.tooltip.isVisible&&(this.renderTooltip(),this.wireMaterialTooltipEvent(!1)),this.setBarColor(),"tooltip"!==i&&this.updateConfig()},s.prototype.changeRtl=function(){if(this.enableRtl||"Range"!==this.type||(this.value=[this.handleVal2,this.handleVal1]),this.updateConfig(),this.tooltip.isVisible&&this.tooltipObj.refresh(this.firstHandle),this.showButtons){var e=this.enableRtl&&"Vertical"!==this.orientation;t.attributes(e?this.secondBtn:this.firstBtn,{"aria-label":"Decrease",title:"Decrease"}),t.attributes(e?this.firstBtn:this.secondBtn,{"aria-label":"Increase",title:"Increase"})}},s.prototype.changeOrientation=function(){this.changeSliderType(this.type,"null")},s.prototype.updateConfig=function(){this.setEnableRTL(),this.setValue(),this.tooltip.isVisible&&this.refreshTooltip(this.tooltipTarget),"None"!==this.ticks.placement&&this.ul&&(this.removeElement(this.ul),this.ul=void 0,this.renderScale()),this.limitsPropertyChange()},s.prototype.limitsPropertyChange=function(){this.limits.enabled?(t.isNullOrUndefined(this.limitBarFirst)&&"Range"!==this.type&&this.createLimitBar(),t.isNullOrUndefined(this.limitBarFirst)&&t.isNullOrUndefined(this.limitBarSecond)&&"Range"===this.type&&this.createLimitBar(),this.setLimitBar(),this.setValue()):(t.isNullOrUndefined(this.limitBarFirst)||t.detach(this.limitBarFirst),t.isNullOrUndefined(this.limitBarSecond)||t.detach(this.limitBarSecond))},s.prototype.getPersistData=function(){return this.addOnPersist(["value"])},s.prototype.destroy=function(){e.prototype.destroy.call(this),this.unwireEvents(),window.removeEventListener("resize",this.onresize),t.removeClass([this.sliderContainer],[we]),this.firstHandle.removeAttribute("aria-orientation"),"Range"===this.type&&this.secondHandle.removeAttribute("aria-orientation"),this.sliderContainer.parentNode.insertBefore(this.element,this.sliderContainer),t.detach(this.sliderContainer),this.tooltip.isVisible&&this.tooltipObj.destroy(),this.element.innerHTML=""},s.prototype.onPropertyChanged=function(e,i){for(var s=this,n=0,a=Object.keys(e);n<a.length;n++){var l=a[n];switch(l){case"cssClass":this.setCSSClass(i.cssClass);break;case"value":if(e&&i){var r=t.isNullOrUndefined(e.value)?"Range"===this.type?[this.min,this.max]:this.min:e.value;this.setProperties({value:r},!0),t.isNullOrUndefined(i.value)||i.value.toString()===r.toString()||(this.setValue(),this.refreshTooltip(this.tooltipTarget),"Range"===this.type&&(t.isNullOrUndefined(e.value)||i.value[1]===r[1]?this.activeHandle=1:this.activeHandle=2))}break;case"min":case"step":case"max":this.setMinMaxValue();break;case"tooltip":t.isNullOrUndefined(e.tooltip)||t.isNullOrUndefined(i.tooltip)||this.setTooltip(l);break;case"type":t.isNullOrUndefined(i)||!Object.keys(i).length||t.isNullOrUndefined(i.type)||(this.changeSliderType(i.type,l),this.setZindex());break;case"enableRtl":i.enableRtl!==e.enableRtl&&"Vertical"!==this.orientation&&(this.rtl=i.enableRtl,this.changeRtl());break;case"limits":this.limitsPropertyChange();break;case"orientation":this.changeOrientation();break;case"ticks":t.isNullOrUndefined(this.sliderContainer.querySelector("."+ke))||(t.detach(this.ul),Array.prototype.forEach.call(this.sliderContainer.classList,function(e){e.match(/e-scale-/)&&s.sliderContainer.classList.remove(e)})),"None"!==this.ticks.placement&&(this.renderScale(),this.setZindex());break;case"locale":this.showButtons&&this.buttonTitle();break;case"showButtons":e.showButtons?(this.setButtons(),this.reposition(),this.enabled&&!this.readonly&&this.wireButtonEvt(!1)):this.firstBtn&&this.secondBtn&&(this.sliderContainer.removeChild(this.firstBtn),this.sliderContainer.removeChild(this.secondBtn),this.sliderContainer.classList.remove(it),this.firstBtn=void 0,this.secondBtn=void 0,this.reposition());break;case"enabled":this.setEnabled();break;case"readonly":this.setReadOnly();break;case"customValues":this.setValue(),this.reposition();break;case"colorRange":this.reposition();break;case"width":this.setElementWidth(e.width),this.setMinMaxValue(),this.limits&&this.limitsPropertyChange()}}},s.prototype.setReadOnly=function(){this.readonly?(this.unwireEvents(),this.sliderContainer.classList.add(ut)):(this.wireEvents(),this.sliderContainer.classList.remove(ut))},s.prototype.setMinMaxValue=function(){var e=this;this.setValue(),this.refreshTooltip(this.tooltipTarget),t.isNullOrUndefined(this.sliderContainer.querySelector("."+ke))||this.ul&&(t.detach(this.ul),Array.prototype.forEach.call(this.sliderContainer.classList,function(t){t.match(/e-scale-/)&&e.sliderContainer.classList.remove(t)})),"None"!==this.ticks.placement&&(this.renderScale(),this.setZindex())},s.prototype.setZindex=function(){this.zIndex=6,t.isNullOrUndefined(this.ticks)||"None"===this.ticks.placement||(this.ul.style.zIndex=this.zIndex+-7+"",this.element.style.zIndex=this.zIndex+2+""),this.isMaterial||t.isNullOrUndefined(this.ticks)||"Both"!==this.ticks.placement||(this.element.style.zIndex=this.zIndex+2+""),this.firstHandle.style.zIndex=this.zIndex+3+"","Range"===this.type&&(this.secondHandle.style.zIndex=this.zIndex+4+"")},s.prototype.setTooltip=function(e){this.changeSliderType(this.type,e)},s.prototype.setBarColor=function(){for(var e,i,s=this.sliderTrack.lastElementChild;s;)this.sliderTrack.removeChild(s),s=this.sliderTrack.lastElementChild;for(var n=0;n<this.colorRange.length;n++)if(!t.isNullOrUndefined(this.colorRange[n].start)&&!t.isNullOrUndefined(this.colorRange[n].end)&&this.colorRange[n].end>this.colorRange[n].start){this.colorRange[n].start<this.min&&(this.colorRange[n].start=this.min),this.colorRange[n].end>this.max&&(this.colorRange[n].end=this.max);var a=this.checkHandlePosition(this.colorRange[n].start),l=this.checkHandlePosition(this.colorRange[n].end),r=this.createElement("div");r.style.backgroundColor=this.colorRange[n].color,r.style.border="1px solid "+this.colorRange[n].color,"Horizontal"===this.orientation?(i=We,e=this.enableRtl?t.isNullOrUndefined(this.customValues)?this.checkHandlePosition(this.max)-this.checkHandlePosition(this.colorRange[n].end):this.checkHandlePosition(this.customValues.length-this.colorRange[n].end-1):this.checkHandlePosition(this.colorRange[n].start),r.style.width=l-a+"px",r.style.left=e+"px"):(i=je,e=this.checkHandlePosition(this.colorRange[n].start),r.style.height=l-a+"px",r.style.bottom=e+"px"),r.classList.add(i),this.sliderTrack.appendChild(r)}},s.prototype.getModuleName=function(){return"slider"},ue([t.Property(null)],s.prototype,"value",void 0),ue([t.Property(null)],s.prototype,"customValues",void 0),ue([t.Property(1)],s.prototype,"step",void 0),ue([t.Property(null)],s.prototype,"width",void 0),ue([t.Property(0)],s.prototype,"min",void 0),ue([t.Property(100)],s.prototype,"max",void 0),ue([t.Property(!1)],s.prototype,"readonly",void 0),ue([t.Property("Default")],s.prototype,"type",void 0),ue([t.Collection([{}],pe)],s.prototype,"colorRange",void 0),ue([t.Complex({},ce)],s.prototype,"ticks",void 0),ue([t.Complex({},me)],s.prototype,"limits",void 0),ue([t.Property(!0)],s.prototype,"enabled",void 0),ue([t.Complex({},fe)],s.prototype,"tooltip",void 0),ue([t.Property(!1)],s.prototype,"showButtons",void 0),ue([t.Property(!0)],s.prototype,"enableAnimation",void 0),ue([t.Property("Horizontal")],s.prototype,"orientation",void 0),ue([t.Property("")],s.prototype,"cssClass",void 0),ue([t.Property(!1)],s.prototype,"enableHtmlSanitizer",void 0),ue([t.Event()],s.prototype,"created",void 0),ue([t.Event()],s.prototype,"change",void 0),ue([t.Event()],s.prototype,"changed",void 0),ue([t.Event()],s.prototype,"renderingTicks",void 0),ue([t.Event()],s.prototype,"renderedTicks",void 0),ue([t.Event()],s.prototype,"tooltipChange",void 0),s=ue([t.NotifyPropertyChanges],s)}(t.Component),bt=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)}}(),Et=function(e,t,i,s){var n,a=arguments.length,l=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(l=(a<3?n(l):a>3?n(t,i,l):n(t,i))||l);return a>3&&l&&Object.defineProperty(t,i,l),l},Ct={EMAIL:new RegExp("^[A-Za-z0-9._%+-]{1,}@[A-Za-z0-9._%+-]{1,}([.]{1}[a-zA-Z0-9]{2,}|[.]{1}[a-zA-Z0-9]{2,4}[.]{1}[a-zA-Z0-9]{2,4})$"),URL:/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/m,DATE_ISO:new RegExp("^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$"),DIGITS:new RegExp("^[0-9]*$"),PHONE:new RegExp("^[+]?[0-9]{9,13}$"),CREDITCARD:new RegExp("^\\d{13,16}$")};!function(e){e[e.Message=0]="Message",e[e.Label=1]="Label"}(e.ErrorOption||(e.ErrorOption={}));var St=function(i){function s(e,s){var n=i.call(this,s,e)||this;if(n.validated=[],n.errorRules=[],n.allowSubmit=!1,n.required="required",n.infoElement=null,n.inputElement=null,n.selectQuery="input:not([type=reset]):not([type=button]), select, textarea",n.localyMessage={},n.defaultMessages={required:"This field is required.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateIso:"Please enter a valid date ( ISO ).",creditcard:"Please enter valid card number",number:"Please enter a valid number.",digits:"Please enter only digits.",maxLength:"Please enter no more than {0} characters.",minLength:"Please enter at least {0} characters.",rangeLength:"Please enter a value between {0} and {1} characters long.",range:"Please enter a value between {0} and {1}.",max:"Please enter a value less than or equal to {0}.",min:"Please enter a value greater than or equal to {0}.",regex:"Please enter a correct value.",tel:"Please enter a valid phone number.",pattern:"Please enter a correct pattern value.",equalTo:"Please enter the valid match text"},void 0===n.rules&&(n.rules={}),n.l10n=new t.L10n("formValidator",n.defaultMessages,n.locale),n.locale&&n.localeFunc(),t.onIntlChange.on("notifyExternalChange",n.afterLocalization,n),e="string"==typeof e?t.select(e,document):e,null!=n.element)return n.element.setAttribute("novalidate",""),n.inputElements=t.selectAll(n.selectQuery,n.element),n.createHTML5Rules(),n.wireEvents(),n}bt(s,i),n=s,s.prototype.addRules=function(e,i){e&&(this.rules.hasOwnProperty(e)?t.extend(this.rules[e],i,{}):this.rules[e]=i)},s.prototype.removeRules=function(e,i){if(e||i)if(this.rules[e]&&!i)delete this.rules[e];else{if(t.isNullOrUndefined(this.rules[e]&&i))return;for(var s=0;s<i.length;s++)delete this.rules[e][i[s]]}else this.rules={}},s.prototype.validate=function(e){var t=Object.keys(this.rules);if(e&&t.length)return this.validateRules(e),-1!==t.indexOf(e)&&0===this.errorRules.filter(function(t){return t.name===e}).length;this.errorRules=[];for(var i=0,s=t;i<s.length;i++){var n=s[i];this.validateRules(n)}return 0===this.errorRules.length},s.prototype.reset=function(){this.element.reset(),this.clearForm()},s.prototype.getInputElement=function(e){return this.inputElement=t.select('[name="'+e+'"]',this.element),this.inputElement},s.prototype.destroy=function(){this.reset(),this.unwireEvents(),this.rules={};for(var e=0,s=t.selectAll("."+this.errorClass+", ."+this.validClass,this.element);e<s.length;e++){var n=s[e];t.detach(n)}i.prototype.destroy.call(this),t.onIntlChange.off("notifyExternalChange",this.afterLocalization)},s.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){switch(s[i]){case"locale":this.localeFunc()}}},s.prototype.localeFunc=function(){for(var e=0,t=Object.keys(this.defaultMessages);e<t.length;e++){var i=t[e];this.l10n.setLocale(this.locale);var s=this.l10n.getConstant(i);this.localyMessage[i]=s}},s.prototype.getModuleName=function(){return"formValidator"},s.prototype.afterLocalization=function(e){this.locale=e.locale,this.localeFunc()},s.prototype.refresh=function(){this.unwireEvents(),this.inputElements=t.selectAll(this.selectQuery,this.element),this.wireEvents()},s.prototype.clearForm=function(){this.errorRules=[],this.validated=[];for(var e=0,i=t.selectAll(this.selectQuery,this.element);e<i.length;e++){var s=i[e];s.removeAttribute("aria-invalid"),s.classList.remove(this.errorClass),s.name.length>0&&(this.getInputElement(s.name),this.getErrorElement(s.name),this.hideMessage(s.name)),s.classList.remove(this.validClass)}},s.prototype.createHTML5Rules=function(){for(var e=["required","validateHidden","regex","rangeLength","maxLength","minLength","dateIso","digits","pattern","data-val-required","type","data-validation","min","max","range","equalTo","data-val-minlength-min","data-val-equalto-other","data-val-maxlength-max","data-val-range-min","data-val-regex-pattern","data-val-length-max","data-val-creditcard","data-val-phone"],t=["hidden","email","url","date","number","tel"],i=0,s=this.inputElements;i<s.length;i++){for(var n=s[i],a={},l=0,r=e;l<r.length;l++){var o=r[l];if(null!==n.getAttribute(o))switch(o){case"required":this.defRule(n,a,o,n.required);break;case"data-validation":o=n.getAttribute(o),this.defRule(n,a,o,!0);break;case"type":-1!==t.indexOf(n.type)&&this.defRule(n,a,n.type,!0);break;case"rangeLength":case"range":this.defRule(n,a,o,JSON.parse(n.getAttribute(o)));break;case"equalTo":var h=n.getAttribute(o);this.defRule(n,a,o,h);break;default:"true"===n.getAttribute("data-val")?this.annotationRule(n,a,o,n.getAttribute(o)):this.defRule(n,a,o,n.getAttribute(o))}}0!==Object.keys(a).length&&this.addRules(n.name,a)}},s.prototype.annotationRule=function(e,t,i,s){var n=i.split("-"),a=["required","creditcard","phone","maxlength","minlength","range","regex","equalto"],l=n[n.length-1],r=n[n.length-2];if(-1!==a.indexOf(l))switch(l){case"required":this.defRule(e,t,"required",s);break;case"creditcard":this.defRule(e,t,"creditcard",s);break;case"phone":this.defRule(e,t,"tel",s)}else if(-1!==a.indexOf(r))switch(r){case"maxlength":this.defRule(e,t,"maxLength",s);break;case"minlength":this.defRule(e,t,"minLength",s);break;case"range":var o=e.getAttribute("data-val-range-min"),h=e.getAttribute("data-val-range-max");this.defRule(e,t,"range",[o,h]);break;case"equalto":var d=e.getAttribute(i).split(".");this.defRule(e,t,"equalTo",d[d.length-1]);break;case"regex":this.defRule(e,t,"regex",s)}},s.prototype.defRule=function(e,t,i,s){var n,a=e.getAttribute("data-"+i+"-message"),l=e.getAttribute("data-val-"+i);this.rules[e.name]&&"validateHidden"!==i&&"hidden"!==i&&(this.getInputElement(e.name),n=this.getErrorMessage(this.rules[e.name][i],i)),a?s=[s,a]:l?s=[s,l]:n&&(s=[s,n]),t[i]=s},s.prototype.wireEvents=function(){for(var e=0,i=this.inputElements;e<i.length;e++){var s=i[e];n.isCheckable(s)?t.EventHandler.add(s,"click",this.clickHandler,this):"SELECT"===s.tagName?t.EventHandler.add(s,"change",this.changeHandler,this):(t.EventHandler.add(s,"focusout",this.focusOutHandler,this),t.EventHandler.add(s,"keyup",this.keyUpHandler,this))}t.EventHandler.add(this.element,"submit",this.submitHandler,this),t.EventHandler.add(this.element,"reset",this.resetHandler,this)},s.prototype.unwireEvents=function(){for(var e=0,i=this.inputElements;e<i.length;e++){var s=i[e];t.EventHandler.clearEvents(s)}t.EventHandler.remove(this.element,"submit",this.submitHandler),t.EventHandler.remove(this.element,"reset",this.resetHandler)},s.prototype.focusOutHandler=function(e){this.trigger("focusout",e);var t=e.target;this.rules[t.name]&&(this.rules[t.name][this.required]||t.value.length>0?this.validate(t.name):-1===this.validated.indexOf(t.name)&&this.validated.push(t.name))},s.prototype.keyUpHandler=function(e){this.trigger("keyup",e);var t=e.target;(9!==e.which||this.rules[t.name]&&(!this.rules[t.name]||this.rules[t.name][this.required]))&&-1!==this.validated.indexOf(t.name)&&this.rules[t.name]&&-1===[16,17,18,20,35,36,37,38,39,40,45,144,225].indexOf(e.which)&&this.validate(t.name)},s.prototype.clickHandler=function(e){this.trigger("click",e);var t=e.target;"submit"!==t.type?this.validate(t.name):null!==t.getAttribute("formnovalidate")&&(this.allowSubmit=!0)},s.prototype.changeHandler=function(e){this.trigger("change",e);var t=e.target;this.validate(t.name)},s.prototype.submitHandler=function(e){this.trigger("submit",e),this.allowSubmit||this.validate()?this.allowSubmit=!1:e.preventDefault()},s.prototype.resetHandler=function(){this.clearForm()},s.prototype.validateRules=function(e){if(this.rules[e]){var t=Object.keys(this.rules[e]),i=!1,s=!1,n=t.indexOf("validateHidden"),a=t.indexOf("hidden");if(this.getInputElement(e),-1!==a&&(i=!0),-1!==n&&(s=!0),!i||i&&s){-1!==n&&t.splice(n,1),-1!==a&&t.splice(a-1,1),this.getErrorElement(e);for(var l=0,r=t;l<r.length;l++){var o=r[l],h=this.getErrorMessage(this.rules[e][o],o),d={name:e,message:h},u={inputName:e,element:this.inputElement,message:h};if(!this.isValid(e,o)&&!this.inputElement.classList.contains(this.ignore)){this.removeErrorRules(e),this.errorRules.push(d),this.inputElement.setAttribute("aria-invalid","true"),this.inputElement.setAttribute("aria-describedby",this.inputElement.id+"-info"),this.inputElement.classList.add(this.errorClass),this.inputElement.classList.remove(this.validClass),this.infoElement?this.showMessage(d):this.createErrorElement(e,d.message,this.inputElement),u.errorElement=this.infoElement,u.status="failure",this.inputElement.classList.add(this.errorClass),this.inputElement.classList.remove(this.validClass),this.optionalValidationStatus(e,u),this.trigger("validationComplete",u),"required"===o&&this.inputElement.setAttribute("aria-required","true");break}this.hideMessage(e),u.status="success",this.trigger("validationComplete",u)}}}},s.prototype.optionalValidationStatus=function(e,i){this.rules[e][this.required]||this.inputElement.value.length||t.isNullOrUndefined(this.infoElement)||(this.infoElement.innerHTML=this.inputElement.value,this.infoElement.setAttribute("aria-invalid","false"),i.status="",this.hideMessage(e))},s.prototype.isValid=function(e,i){var s=this.rules[e][i],a=s instanceof Array&&"string"==typeof s[1]?s[0]:s,l=this.rules[e][i],r={value:this.inputElement.value,param:a,element:this.inputElement,formElement:this.element};if(this.trigger("validationBegin",r),!r.param&&"required"===i)return!0;if(l&&"function"==typeof l[0]){return l[0].call(this,{element:this.inputElement,value:this.inputElement.value})}return n.isCheckable(this.inputElement)?"required"!==i||t.selectAll('input[name="'+e+'"]:checked',this.element).length>0:n.checkValidator[i](r)},s.prototype.getErrorMessage=function(e,i){var s=this.inputElement.getAttribute("data-"+i+"-message")?this.inputElement.getAttribute("data-"+i+"-message"):e instanceof Array&&"string"==typeof e[1]?e[1]:0!==Object.keys(this.localyMessage).length?this.localyMessage[i]:this.defaultMessages[i],n=s.match(/{(\d)}/g);if(!t.isNullOrUndefined(n))for(var a=0;a<n.length;a++){var l=e instanceof Array?e[a]:e;s=s.replace(n[a],l)}return s},s.prototype.createErrorElement=function(i,s,n){var a=t.createElement(this.errorElement,{className:this.errorClass,innerHTML:s,attrs:{for:i}});if(this.errorOption===e.ErrorOption.Message&&(a.classList.remove(this.errorClass),a.classList.add("e-message"),a=t.createElement(this.errorContainer,{className:this.errorClass,innerHTML:a.outerHTML})),a.id=this.inputElement.name+"-info",this.element.querySelector('[data-valmsg-for="'+n.id+'"]'))this.element.querySelector('[data-valmsg-for="'+n.id+'"]').appendChild(a);else if(!0===n.hasAttribute("data-msg-containerid")){var l=n.getAttribute("data-msg-containerid");t.select("#"+l,this.element).appendChild(a)}else null!=this.customPlacement?this.customPlacement.call(this,this.inputElement,a):this.inputElement.parentNode.insertBefore(a,this.inputElement.nextSibling);a.style.display="block",this.getErrorElement(i),this.validated.push(i),this.checkRequired(i)},s.prototype.getErrorElement=function(e){return this.infoElement=t.select(this.errorElement+"."+this.errorClass,this.inputElement.parentElement),this.infoElement||(this.infoElement=t.select(this.errorElement+"."+this.errorClass+'[for="'+e+'"]',this.element)),this.infoElement},s.prototype.removeErrorRules=function(e){for(var t=0;t<this.errorRules.length;t++){this.errorRules[t].name===e&&this.errorRules.splice(t,1)}},s.prototype.showMessage=function(e){this.infoElement.style.display="block",this.infoElement.innerHTML=e.message,this.checkRequired(e.name)},s.prototype.hideMessage=function(e){this.infoElement&&(this.infoElement.style.display="none",this.removeErrorRules(e),this.inputElement.classList.add(this.validClass),this.inputElement.classList.remove(this.errorClass),this.inputElement.setAttribute("aria-invalid","false"))},s.prototype.checkRequired=function(e){this.rules[e][this.required]||this.inputElement.value.length||t.isNullOrUndefined(this.infoElement)||(this.infoElement.innerHTML=this.inputElement.value,this.infoElement.setAttribute("aria-invalid","false"),this.hideMessage(e))},s.isCheckable=function(e){var t=e.getAttribute("type");return t&&("checkbox"===t||"radio"===t||"submit"===t)};var n;return s.checkValidator={required:function(e){return isNaN(Date.parse(e.value))?e.value.toString().length>0:!isNaN(new Date(e.value).getTime())},email:function(e){return Ct.EMAIL.test(e.value)},url:function(e){return Ct.URL.test(e.value)},dateIso:function(e){return Ct.DATE_ISO.test(e.value)},tel:function(e){return Ct.PHONE.test(e.value)},creditcard:function(e){return Ct.CREDITCARD.test(e.value)},number:function(e){return!isNaN(Number(e.value))&&-1===e.value.indexOf(" ")},digits:function(e){return Ct.DIGITS.test(e.value)},maxLength:function(e){return e.value.length<=e.param},minLength:function(e){return e.value.length>=e.param},rangeLength:function(e){var t=e.param;return e.value.length>=t[0]&&e.value.length<=t[1]},range:function(e){var t=e.param;return!isNaN(Number(e.value))&&Number(e.value)>=t[0]&&Number(e.value)<=t[1]},date:function(e){return!isNaN(new Date(e.value).getTime())},max:function(e){return isNaN(Number(e.value))?new Date(e.value).getTime()<=new Date(JSON.parse(JSON.stringify(e.param))).getTime():+e.value<=e.param},min:function(e){if(isNaN(Number(e.value))){if(-1!==e.value.indexOf(",")){var t=e.value.replace(/,/g,"");return parseFloat(t)>=e.param}return new Date(e.value).getTime()>=new Date(JSON.parse(JSON.stringify(e.param))).getTime()}return+e.value>=e.param},regex:function(e){return new RegExp(e.param).test(e.value)},equalTo:function(e){var t=e.formElement.querySelector("#"+e.param);return e.param=t.value,e.param===e.value}},Et([t.Property("")],s.prototype,"locale",void 0),Et([t.Property("e-hidden")],s.prototype,"ignore",void 0),Et([t.Property()],s.prototype,"rules",void 0),Et([t.Property("e-error")],s.prototype,"errorClass",void 0),Et([t.Property("e-valid")],s.prototype,"validClass",void 0),Et([t.Property("label")],s.prototype,"errorElement",void 0),Et([t.Property("div")],s.prototype,"errorContainer",void 0),Et([t.Property(e.ErrorOption.Label)],s.prototype,"errorOption",void 0),Et([t.Event()],s.prototype,"focusout",void 0),Et([t.Event()],s.prototype,"keyup",void 0),Et([t.Event()],s.prototype,"click",void 0),Et([t.Event()],s.prototype,"change",void 0),Et([t.Event()],s.prototype,"submit",void 0),Et([t.Event()],s.prototype,"validationBegin",void 0),Et([t.Event()],s.prototype,"validationComplete",void 0),Et([t.Event()],s.prototype,"customPlacement",void 0),s=n=Et([t.NotifyPropertyChanges],s)}(t.Base),xt=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)}}(),Tt=function(e,t,i,s){var n,a=arguments.length,l=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(l=(a<3?n(l):a>3?n(t,i,l):n(t,i))||l);return a>3&&l&&Object.defineProperty(t,i,l),l},kt="e-file-drop",Ot="e-file-select-wrap",Pt="e-upload-file-list",Lt="e-file-status",At="e-file-remove-btn",Nt="e-file-delete-btn",Ht="e-file-abort-btn",Bt="e-file-reload-btn",wt="e-upload-drag-hover",Ut="e-upload-progress-wrap",Ft="e-upload-progress-bar",Rt="e-progress-bar-text",Vt="e-upload-progress",Mt="e-upload-success",It="e-upload-fails",Dt="e-file-container",zt="e-validation-fails",qt="e-disabled",Wt="e-clear-icon-focus",jt="e-file-pause-btn",_t="e-file-play-btn",Xt="e-restrict-retry",Kt=["title","style","class"],Zt="e-file-invalid",Yt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return xt(i,e),Tt([t.Property("")],i.prototype,"name",void 0),Tt([t.Property(null)],i.prototype,"size",void 0),Tt([t.Property("")],i.prototype,"type",void 0),i}(t.ChildProperty),Gt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return xt(i,e),Tt([t.Property("Browse...")],i.prototype,"browse",void 0),Tt([t.Property("Upload")],i.prototype,"upload",void 0),Tt([t.Property("Clear")],i.prototype,"clear",void 0),i}(t.ChildProperty),$t=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return xt(i,e),Tt([t.Property("")],i.prototype,"saveUrl",void 0),Tt([t.Property("")],i.prototype,"removeUrl",void 0),Tt([t.Property(0)],i.prototype,"chunkSize",void 0),Tt([t.Property(3)],i.prototype,"retryCount",void 0),Tt([t.Property(500)],i.prototype,"retryAfterDelay",void 0),i}(t.ChildProperty),Jt=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.initialAttr={accept:null,multiple:!1,disabled:!1},s.uploadedFilesData=[],s.base64String=[],s.isForm=!1,s.allTypes=!1,s.pausedData=[],s.uploadMetaData=[],s.tabIndex="0",s.btnTabIndex="0",s.disableKeyboardNavigation=!1,s.count=-1,s.actionCompleteCount=0,s.flag=!0,s.selectedFiles=[],s.uploaderName="UploadFiles",s.fileStreams=[],s.newFileRef=0,s.isFirstFileOnSelection=!1,s.dragCounter=0,s.fileList=[],s.filesData=[],s.uploaderOptions=t,s}return xt(s,e),s.prototype.onPropertyChanged=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++){switch(n[s]){case"allowedExtensions":this.setExtensions(this.allowedExtensions),this.clearAll();break;case"enabled":this.setControlStatus();break;case"multiple":this.setMultipleSelection();break;case"enableRtl":this.setRTL(),this.reRenderFileList();break;case"buttons":this.buttons.browse=t.isNullOrUndefined(this.buttons.browse)?"":this.buttons.browse,this.buttons.clear=t.isNullOrUndefined(this.buttons.clear)?"":this.buttons.clear,this.buttons.upload=t.isNullOrUndefined(this.buttons.upload)?"":this.buttons.upload,this.renderButtonTemplates();break;case"dropArea":this.unBindDropEvents(),this.updateDropArea();break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.checkHTMLAttributes(!0);break;case"files":this.renderPreLoadFiles();break;case"directoryUpload":this.updateDirectoryAttributes();break;case"template":this.isServerBlazor||this.clearAll();break;case"minFileSize":case"maxFileSize":case"autoUpload":case"sequentialUpload":this.clearAll();break;case"locale":this.l10n.setLocale(this.locale),this.setLocalizedTexts(),this.preLocaleObj=t.getValue("currentLocale",this.l10n);break;case"cssClass":this.setCSSClass(i.cssClass)}}},s.prototype.setLocalizedTexts=function(){t.isNullOrUndefined(this.template)&&("string"==typeof this.buttons.browse&&(this.browseButton.innerText="Browse..."===this.buttons.browse?this.localizedTexts("Browse"):this.buttons.browse,this.browseButton.setAttribute("title",this.browseButton.innerText),this.uploadWrapper&&!t.isNullOrUndefined(this.uploadWrapper.querySelector("."+kt))&&(this.uploadWrapper.querySelector("."+kt).innerHTML=this.localizedTexts("dropFilesHint"))),this.updateFileList())},s.prototype.getKeyValue=function(e){for(var t,i=0,s=Object.keys(this.preLocaleObj);i<s.length;i++){var n=s[i];this.preLocaleObj[n]===e&&(t=n)}return t},s.prototype.updateFileList=function(){if(this.fileList.length>0&&!t.isNullOrUndefined(this.uploadWrapper.querySelector(".e-upload-files")))for(var e=0;e<this.fileList.length;e++)this.fileList[e].querySelector(".e-file-status").innerHTML=this.localizedTexts(this.getKeyValue(this.filesData[e].status)),this.filesData[e].status=this.localizedTexts(this.getKeyValue(this.filesData[e].status)),this.fileList[e].classList.contains(Mt)&&this.fileList[e].querySelector(".e-icons").setAttribute("title",this.localizedTexts("delete")),this.fileList[e].querySelector(".e-file-play-btn")&&this.fileList[e].querySelector(".e-icons").setAttribute("title",this.localizedTexts("resume")),this.fileList[e].querySelector(".e-file-remove-btn")&&this.fileList[e].querySelector(".e-icons").setAttribute("title",this.localizedTexts("remove")),this.fileList[e].querySelector(".e-file-reload-btn")&&this.fileList[e].querySelector(".e-icons").setAttribute("title",this.localizedTexts("retry")),this.autoUpload||(this.uploadButton.innerText="Upload"===this.buttons.upload?this.localizedTexts("Upload"):this.buttons.upload,this.uploadButton.setAttribute("title",this.localizedTexts("Upload")),this.clearButton.innerText="Clear"===this.buttons.clear?this.localizedTexts("Clear"):this.buttons.clear,this.clearButton.setAttribute("title",this.localizedTexts("Clear")))},s.prototype.reRenderFileList=function(){this.listParent&&(t.detach(this.listParent),this.listParent=null,this.fileList=[],this.createFileList(this.filesData),this.actionButtons&&(this.removeActionButtons(),this.renderActionButtons(),this.checkActionButtonStatus()))},s.prototype.preRender=function(){if(this.localeText={Browse:"Browse...",Clear:"Clear",Upload:"Upload",dropFilesHint:"Or drop files here",invalidMaxFileSize:"File size is too large",invalidMinFileSize:"File size is too small",invalidFileType:"File type is not allowed",uploadFailedMessage:"File failed to upload",uploadSuccessMessage:"File uploaded successfully",removedSuccessMessage:"File removed successfully",removedFailedMessage:"Unable to remove file",inProgress:"Uploading",readyToUploadMessage:"Ready to upload",abort:"Abort",remove:"Remove",cancel:"Cancel",delete:"Delete file",pauseUpload:"File upload paused",pause:"Pause",resume:"Resume",retry:"Retry",fileUploadCancel:"File upload canceled",invalidFileSelection:"Invalid files selected",totalFiles:"Total files",size:"Size"},this.l10n=new t.L10n("uploader",this.localeText,this.locale),this.preLocaleObj=t.getValue("currentLocale",this.l10n),this.isServerBlazor=!(!t.isBlazor()||!this.isServerRendered),this.isBlazorTemplate=!(!this.isServerBlazor||""===this.template||t.isNullOrUndefined(this.template)),this.isBlazorSaveUrl=!(!this.isServerRendered||""!==this.asyncSettings.saveUrl&&!t.isNullOrUndefined(this.asyncSettings.saveUrl)),this.isBlazorSaveUrl&&this.sequentialUpload&&(this.sequentialUpload=!1),this.isBlazorSaveUrl||this.formRendered(),!this.isServerBlazor){this.updateHTMLAttrToElement(),this.checkHTMLAttributes(!1);var e=t.getValue("ej2_instances",this.element);if("EJS-UPLOADER"===this.element.tagName){for(var i=this.createElement("input",{attrs:{type:"file"}}),s=0;s<this.element.attributes.length;s++)i.setAttribute(this.element.attributes[s].nodeName,this.element.attributes[s].nodeValue),i.innerHTML=this.element.innerHTML;i.hasAttribute("name")||i.setAttribute("name","UploadFiles"),this.element.appendChild(i),this.element=i,t.setValue("ej2_instances",e,this.element)}e[0].isPureReactComponent&&(t.isNullOrUndefined(e[0].props.name)?!t.isNullOrUndefined(e[0].props.id)&&t.isNullOrUndefined(e[0].props.name)?this.element.setAttribute("name",e[0].props.id):this.element.setAttribute("name","UploadFiles"):this.element.setAttribute("name",e[0].props.name)),t.isNullOrUndefined(this.element.getAttribute("name"))&&this.element.setAttribute("name",this.element.getAttribute("id")),this.element.hasAttribute("type")||this.element.setAttribute("type","file"),this.updateDirectoryAttributes()}this.keyConfigs={enter:"enter"},this.element.hasAttribute("tabindex")&&(this.tabIndex=this.element.getAttribute("tabindex")),this.browserName=t.Browser.info.name,this.uploaderName=this.element.getAttribute("name")},s.prototype.formRendered=function(){var e=t.closest(this.element,"form");if(!t.isNullOrUndefined(e))for(;e&&e!==document.documentElement;e=e.parentElement)"FORM"===e.tagName&&(this.isForm=!0,this.formElement=e,e.setAttribute("enctype","multipart/form-data"),e.setAttribute("encoding","multipart/form-data"))},s.prototype.getPersistData=function(){return this.addOnPersist(["filesData"])},s.prototype.getModuleName=function(){return"uploader"},s.prototype.updateDirectoryAttributes=function(){this.directoryUpload?(this.element.setAttribute("directory","true"),this.element.setAttribute("webkitdirectory","true")):(this.element.removeAttribute("directory"),this.element.removeAttribute("webkitdirectory"))},s.prototype.render=function(){this.isServerBlazor?(this.dropAreaWrapper=t.closest(this.element,"."+Ot),this.uploadWrapper=t.closest(this.element,".e-upload.e-control-wrapper"),this.browseButton=this.dropAreaWrapper.querySelector("button.e-upload-browse-btn"),this.setDropArea(),this.renderPreLoadFiles(),this.wireEvents()):(this.renderBrowseButton(),this.initializeUpload(),this.updateHTMLAttrToWrapper(),this.wireEvents(),this.setMultipleSelection(),this.setExtensions(this.allowedExtensions),this.setRTL(),this.renderPreLoadFiles(),this.setControlStatus(),this.setCSSClass()),this.isServerBlazor&&this.renderComplete()},s.prototype.renderBrowseButton=function(){this.browseButton=this.createElement("button",{className:"e-css e-btn",attrs:{type:"button"}}),this.browseButton.setAttribute("tabindex",this.tabIndex),"string"==typeof this.buttons.browse?(this.browseButton.textContent="Browse..."===this.buttons.browse?this.localizedTexts("Browse"):this.buttons.browse,this.browseButton.setAttribute("title",this.browseButton.innerText)):this.browseButton.appendChild(this.buttons.browse),this.element.setAttribute("aria-label","Uploader")},s.prototype.renderActionButtons=function(){this.element.setAttribute("tabindex","-1"),this.isBlazorSaveUrl||this.isBlazorTemplate||(this.actionButtons=this.createElement("div",{className:"e-upload-actions"}),this.uploadButton=this.createElement("button",{className:"e-file-upload-btn e-css e-btn e-flat e-primary",attrs:{type:"button",tabindex:this.btnTabIndex}}),this.clearButton=this.createElement("button",{className:"e-file-clear-btn e-css e-btn e-flat",attrs:{type:"button",tabindex:this.btnTabIndex}}),this.actionButtons.appendChild(this.clearButton),this.actionButtons.appendChild(this.uploadButton),this.renderButtonTemplates(),this.uploadWrapper.appendChild(this.actionButtons),this.browseButton.blur(),this.isPreloadFiles||this.uploadButton.focus(),this.wireActionButtonEvents())},s.prototype.serverActionButtonsEventBind=function(e){e&&!this.isForm&&(this.browseButton.blur(),this.actionButtons=e,this.uploadButton=this.actionButtons.querySelector(".e-file-upload-btn"),this.clearButton=this.actionButtons.querySelector(".e-file-clear-btn"),this.uploadButton.focus(),this.unwireActionButtonEvents(),this.wireActionButtonEvents(),this.checkActionButtonStatus())},s.prototype.serverUlElement=function(e){e&&(this.isBlazorSaveUrl||this.isBlazorTemplate)&&(this.listParent=e,this.fileList=[].slice.call(this.listParent.querySelectorAll("li")),this.serverRemoveIconBindEvent(),this.isForm||this.checkAutoUpload(this.filesData))},s.prototype.wireActionButtonEvents=function(){t.EventHandler.add(this.uploadButton,"click",this.uploadButtonClick,this),t.EventHandler.add(this.clearButton,"click",this.clearButtonClick,this)},s.prototype.unwireActionButtonEvents=function(){t.EventHandler.remove(this.uploadButton,"click",this.uploadButtonClick),t.EventHandler.remove(this.clearButton,"click",this.clearButtonClick)},s.prototype.removeActionButtons=function(){this.actionButtons&&(this.unwireActionButtonEvents(),this.isBlazorSaveUrl||this.isBlazorTemplate||t.detach(this.actionButtons),this.actionButtons=null)},s.prototype.renderButtonTemplates=function(){if("string"==typeof this.buttons.browse?(this.browseButton.textContent="Browse..."===this.buttons.browse?this.localizedTexts("Browse"):this.buttons.browse,this.browseButton.setAttribute("title",this.browseButton.textContent)):(this.browseButton.innerHTML="",this.browseButton.appendChild(this.buttons.browse)),this.uploadButton){var e=t.isNullOrUndefined(this.buttons.upload)?"Upload":this.buttons.upload;this.buttons.upload=e,"string"==typeof this.buttons.upload?(this.uploadButton.textContent="Upload"===this.buttons.upload?this.localizedTexts("Upload"):this.buttons.upload,this.uploadButton.setAttribute("title",this.uploadButton.textContent)):(this.uploadButton.innerHTML="",this.uploadButton.appendChild(this.buttons.upload))}if(this.clearButton){var i=t.isNullOrUndefined(this.buttons.clear)?"Clear":this.buttons.clear;this.buttons.clear=i,"string"==typeof this.buttons.clear?(this.clearButton.textContent="Clear"===this.buttons.clear?this.localizedTexts("Clear"):this.buttons.clear,this.clearButton.setAttribute("title",this.clearButton.textContent)):(this.clearButton.innerHTML="",this.clearButton.appendChild(this.buttons.clear))}},s.prototype.initializeUpload=function(){this.element.setAttribute("tabindex","-1");var e=this.createElement("span",{className:"e-file-select"});this.element.parentElement.insertBefore(e,this.element),this.dropAreaWrapper=this.createElement("div",{className:Ot}),this.element.parentElement.insertBefore(this.dropAreaWrapper,this.element),e.appendChild(this.element),this.dropAreaWrapper.appendChild(this.browseButton),this.dropAreaWrapper.appendChild(e),this.uploadWrapper=this.createElement("div",{className:"e-upload e-control-wrapper"}),this.dropAreaWrapper.parentElement.insertBefore(this.uploadWrapper,this.dropAreaWrapper),this.uploadWrapper.appendChild(this.dropAreaWrapper),this.setDropArea()},s.prototype.renderPreLoadFiles=function(){if(this.files.length){if(this.enablePersistence&&this.filesData.length)return void this.createFileList(this.filesData);if(t.isNullOrUndefined(this.files[0].size))return;this.isPreloadFiles=!0;var e=[].slice.call(this.files),i=[];this.multiple||(this.clearData(),e=[e[0]]);for(var s=0,n=e;s<n.length;s++){var a=n[s],l={name:a.name+"."+a.type.split(".")[a.type.split(".").length-1],rawFile:"",size:a.size,status:this.localizedTexts("uploadSuccessMessage"),type:a.type,validationMessages:{minSize:"",maxSize:""},statusCode:"2"};i.push(l),this.filesData.push(l)}this.createFileList(i),this.autoUpload||!this.listParent||this.actionButtons||this.isForm&&!this.allowUpload()||!this.showFileList||this.renderActionButtons(),this.checkActionButtonStatus(),this.sequentialUpload&&(this.count=this.filesData.length-1),this.isPreloadFiles=!1}},s.prototype.checkActionButtonStatus=function(){if(this.actionButtons){var e=this.uploadWrapper.querySelectorAll("."+zt).length+this.uploadWrapper.querySelectorAll(".e-upload-fails:not(.e-upload-progress)").length+this.uploadWrapper.querySelectorAll("span."+Mt).length+this.uploadWrapper.querySelectorAll("span."+Vt).length;e>0&&e===this.uploadWrapper.querySelectorAll("li").length?this.uploadButton.setAttribute("disabled","disabled"):this.uploadButton.removeAttribute("disabled")}},s.prototype.setDropArea=function(){var e=this.dropAreaWrapper.querySelector(".e-file-drop");if(this.dropArea){this.dropZoneElement="string"!=typeof this.dropArea?this.dropArea:t.select(this.dropArea,document);for(var i=this.element,s=!1;i.parentNode;)(i=i.parentNode)===this.dropZoneElement&&(s=!0,e?this.isServerBlazor||(e.innerHTML=this.localizedTexts("dropFilesHint")):this.createDropTextHint());!s&&e&&t.remove(e)}else t.isNullOrUndefined(this.uploaderOptions)||void 0!==this.uploaderOptions.dropArea||(this.createDropTextHint(),this.dropZoneElement=this.uploadWrapper,this.setProperties({dropArea:this.uploadWrapper},!0));this.bindDropEvents()},s.prototype.updateDropArea=function(){if(this.dropArea)this.setDropArea();else{this.dropZoneElement=null;var e=this.dropAreaWrapper.querySelector(".e-file-drop");e&&t.remove(e)}},s.prototype.createDropTextHint=function(){if(!this.isServerBlazor){var e=this.createElement("span",{className:kt});e.innerHTML=this.localizedTexts("dropFilesHint"),this.dropAreaWrapper.appendChild(e)}},s.prototype.updateHTMLAttrToElement=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];Kt.indexOf(s)<0&&this.element.setAttribute(s,this.htmlAttributes[s])}},s.prototype.updateHTMLAttrToWrapper=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if(Kt.indexOf(s)>-1)if("class"===s){var n=this.htmlAttributes[s].replace(/\s+/g," ").trim();""!==n&&t.addClass([this.uploadWrapper],n.split(" "))}else if("style"===s){var a=this.uploadWrapper.getAttribute(s);a=t.isNullOrUndefined(a)?this.htmlAttributes[s]:a+this.htmlAttributes[s],this.uploadWrapper.setAttribute(s,a)}else this.uploadWrapper.setAttribute(s,this.htmlAttributes[s])}},s.prototype.setMultipleSelection=function(){if(this.multiple&&!this.element.hasAttribute("multiple")){var e=document.createAttribute("multiple");e.value="multiple",this.element.setAttributeNode(e)}else this.multiple||this.element.removeAttribute("multiple")},s.prototype.checkAutoUpload=function(e){this.autoUpload?(this.sequentialUpload?this.sequenceUpload(e):this.upload(e),this.removeActionButtons()):this.actionButtons||this.renderActionButtons(),this.checkActionButtonStatus()},s.prototype.sequenceUpload=function(e){if(this.filesData.length-e.length==0||"1"!==this.filesData[this.filesData.length-e.length-1].statusCode){++this.count;var t=!this.showFileList;"object"==typeof this.filesData[this.count]?(this.isFirstFileOnSelection=!1,this.upload(this.filesData[this.count],t),"0"===this.filesData[this.count].statusCode&&this.sequenceUpload(e)):--this.count}},s.prototype.setCSSClass=function(e){var i=this.cssClass;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(i=this.cssClass.replace(/\s+/g," ").trim()),t.isNullOrUndefined(this.cssClass)||""===i||t.addClass([this.uploadWrapper],i.split(i.indexOf(",")>-1?",":" "));var s=e;t.isNullOrUndefined(e)||(s=e.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e)||""===s||t.removeClass([this.uploadWrapper],s.split(" "))},s.prototype.wireEvents=function(){t.EventHandler.add(this.browseButton,"click",this.browseButtonClick,this),t.EventHandler.add(this.element,"change",this.onSelectFiles,this),t.EventHandler.add(document,"click",this.removeFocus,this),this.keyboardModule=new t.KeyboardEvents(this.uploadWrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.isForm&&t.EventHandler.add(this.formElement,"reset",this.resetForm,this)},s.prototype.unWireEvents=function(){t.EventHandler.remove(this.browseButton,"click",this.browseButtonClick),t.EventHandler.remove(this.element,"change",this.onSelectFiles),t.EventHandler.remove(document,"click",this.removeFocus),this.isForm&&t.EventHandler.remove(this.formElement,"reset",this.resetForm),this.keyboardModule&&this.keyboardModule.destroy()},s.prototype.resetForm=function(){this.clearAll()},s.prototype.keyActionHandler=function(e){var i=e.target;switch(e.action){case"enter":if(e.target===this.clearButton)this.clearButtonClick();else if(e.target===this.uploadButton)this.uploadButtonClick();else if(e.target===this.browseButton)this.browseButtonClick();else if(i.classList.contains(jt)){(s=this.getCurrentMetaData(null,e)).file.statusCode="4",s.file.status=this.localizedTexts("pauseUpload"),this.abortUpload(s,!1)}else if(i.classList.contains(_t))this.resumeUpload(this.getCurrentMetaData(null,e),e);else if(i.classList.contains(Bt)){var s=this.getCurrentMetaData(null,e);if(t.isNullOrUndefined(s)){var n=e.target.parentElement,a=this.filesData[this.fileList.indexOf(n)];this.retry(a)}else s.file.statusCode="1",s.file.status=this.localizedTexts("readyToUploadMessage"),this.chunkUpload(s.file)}else this.removeFiles(e),i.classList.contains(Ht)||this.browseButton.focus();e.preventDefault(),e.stopPropagation()}},s.prototype.getCurrentMetaData=function(e,i){var s,n;if(t.isNullOrUndefined(e)){var a=i.target.parentElement;s=this.filesData[this.fileList.indexOf(a)]}else s=e;for(var l=0;l<this.uploadMetaData.length;l++)this.uploadMetaData[l].file.name===s.name&&(n=this.uploadMetaData[l]);return n},s.prototype.removeFocus=function(){this.uploadWrapper&&this.listParent&&this.listParent.querySelector("."+Wt)&&(document.activeElement.blur(),this.listParent.querySelector("."+Wt).classList.remove(Wt))},s.prototype.browseButtonClick=function(){this.element.click()},s.prototype.uploadButtonClick=function(){this.sequentialUpload?this.sequenceUpload(this.filesData):this.upload(this.filesData)},s.prototype.clearButtonClick=function(){this.clearAll(),this.sequentialUpload&&(this.count=-1),this.actionCompleteCount=0},s.prototype.bindDropEvents=function(){this.dropZoneElement&&(t.EventHandler.add(this.dropZoneElement,"drop",this.dropElement,this),t.EventHandler.add(this.dropZoneElement,"dragover",this.dragHover,this),t.EventHandler.add(this.dropZoneElement,"dragleave",this.onDragLeave,this),t.EventHandler.add(this.dropZoneElement,"paste",this.onPasteFile,this),t.EventHandler.add(this.dropZoneElement,"dragenter",this.onDragEnter,this))},s.prototype.unBindDropEvents=function(){this.dropZoneElement&&(t.EventHandler.remove(this.dropZoneElement,"drop",this.dropElement),t.EventHandler.remove(this.dropZoneElement,"dragover",this.dragHover),t.EventHandler.remove(this.dropZoneElement,"dragleave",this.onDragLeave),t.EventHandler.remove(this.dropZoneElement,"dragenter",this.onDragEnter))},s.prototype.onDragEnter=function(e){this.enabled&&(this.dropZoneElement.classList.add(wt),this.dragCounter=this.dragCounter+1,e.preventDefault(),e.stopPropagation())},s.prototype.onDragLeave=function(){this.enabled&&(this.dragCounter=this.dragCounter-1,this.dragCounter||this.dropZoneElement.classList.remove(wt))},s.prototype.dragHover=function(e){this.enabled&&("Default"!==this.dropEffect&&(e.dataTransfer.dropEffect=this.dropEffect.toLowerCase()),e.preventDefault(),e.stopPropagation())},s.prototype.dropElement=function(e){this.dragCounter=0,this.dropZoneElement.classList.remove(wt),this.onSelectFiles(e),e.preventDefault(),e.stopPropagation()},s.prototype.onPasteFile=function(e){var t=e.clipboardData.items;if(1===t.length){var i=[].slice.call(t)[0];"file"===i.kind&&i.type.match("^image/")&&this.renderSelectedFiles(e,[i.getAsFile()],!1,!0)}},s.prototype.getSelectedFiles=function(e){for(var t=[],i=this.fileList[e],s=this.getFilesData(),n=+i.getAttribute("data-files-count"),a=0,l=0;l<e;l++)a+=+this.fileList[l].getAttribute("data-files-count");for(var r=a;r<a+n;r++)t.push(s[r]);return t},s.prototype.removeFiles=function(e){if(this.enabled){var s=e.target.parentElement;this.isBlazorSaveUrl&&(this.fileList=[].slice.call(this.uploadWrapper.querySelectorAll("li")));var n=this.fileList.indexOf(s),a=this.fileList[n],l=this.isFormUpload(),r=l?this.getSelectedFiles(n):this.getFilesInArray(this.filesData[n]);if(!t.isNullOrUndefined(r)){if(e.target.classList.contains(Ht)&&!l){if(r[0].statusCode="5",!t.isNullOrUndefined(a)){var o=a.querySelector("."+Ht);i.createSpinner({target:o,width:"20px"}),i.showSpinner(o)}this.sequentialUpload&&this.uploadSequential(),a.classList.contains(Xt)||this.checkActionComplete(!0)}else t.closest(e.target,".e-spinner-pane")||this.remove(r,!1,!1,!0,e);this.element.value="",this.checkActionButtonStatus()}}},s.prototype.removeFilesData=function(e,i){var s;if(i)this.showFileList||(s=this.filesData.indexOf(e),this.filesData.splice(s,1));else{var n=this.getLiElement(e);t.isNullOrUndefined(n)||(this.isBlazorSaveUrl||t.detach(n),s=this.fileList.indexOf(n),this.fileList.splice(s,1),this.filesData.splice(s,1),this.isBlazorSaveUrl?this.interopAdaptor.invokeMethodAsync("removeFileData",s):(0!==this.fileList.length||t.isNullOrUndefined(this.listParent)||(t.detach(this.listParent),this.listParent=null,this.removeActionButtons()),this.sequentialUpload&&s<=this.count&&--this.count))}},s.prototype.removeUploadedFile=function(e,i,s,n){var a=this,l=e,r=new t.Ajax(this.asyncSettings.removeUrl,"POST",!0,null);r.emitError=!1;var o=new FormData;if(r.beforeSend=function(n){i.currentRequest=r.httpRequest,t.isBlazor()&&(a.currentRequestHeader&&a.updateCustomheader(r.httpRequest,a.currentRequestHeader),a.customFormDatas&&a.updateFormData(o,a.customFormDatas)),s?a.removingEventCallback(i,o,l,e):a.trigger("removing",i,function(t){t.cancel?n.cancel=!0:a.removingEventCallback(t,o,l,e)})},this.isServerBlazor){var h=this.element.getAttribute("name");t.isNullOrUndefined(l.rawFile)||""===l.rawFile?o.append(h,l.name):o.append(h,l.rawFile,l.name)}r.onLoad=function(e){return a.removeCompleted(e,l,n),{}},r.onError=function(e){return a.removeFailed(e,l,n),{}},r.send(o)},s.prototype.removingEventCallback=function(e,s,n,a){var l=this.element.getAttribute("name"),r=this.getLiElement(a);if(!(t.isNullOrUndefined(r)||t.isNullOrUndefined(r.querySelector("."+Nt))&&t.isNullOrUndefined(r.querySelector("."+At)))){var o=r.querySelector("."+Nt)?r.querySelector("."+Nt):r.querySelector("."+At);i.createSpinner({target:o,width:"20px"}),i.showSpinner(o)}this.isServerBlazor||(e.postRawFile&&!t.isNullOrUndefined(n.rawFile)&&""!==n.rawFile?s.append(l,n.rawFile,n.name):s.append(l,n.name),this.updateFormData(s,e.customFormData))},s.prototype.updateFormData=function(e,t){if(t.length>0&&t[0])for(var i=function(i){var s=t[i],n=Object.keys(s).map(function(e){return s[e]});e.append(Object.keys(s)[0],n)},s=0;s<t.length;s++)i(s)},s.prototype.updateCustomheader=function(e,t){if(t.length>0&&t[0])for(var i=function(i){var s=t[i],n=Object.keys(s).map(function(e){return s[e]});e.setRequestHeader(Object.keys(s)[0],n)},s=0;s<t.length;s++)i(s)},s.prototype.removeCompleted=function(e,t,i){var s=e&&e.currentTarget?this.getResponse(e):null,n=e.target;if(4===n.readyState&&n.status>=200&&n.status<=299){var a={e:e,response:s,operation:"remove",file:this.updateStatus(t,this.localizedTexts("removedSuccessMessage"),"2")};this.trigger("success",a),this.removeFilesData(t,i);var l=this.uploadedFilesData.indexOf(t);this.uploadedFilesData.splice(l,1),this.trigger("change",{files:this.uploadedFilesData})}else this.removeFailed(e,t,i)},s.prototype.removeFailed=function(e,s,n){var a={e:e,response:e&&e.currentTarget?this.getResponse(e):null,operation:"remove",file:this.updateStatus(s,this.localizedTexts("removedFailedMessage"),"0")};if(!n){var l=this.filesData.indexOf(s),r=this.fileList[l];if(r){r.classList.remove(Mt),r.classList.add(It);var o=r.querySelector("."+Lt);o&&(o.classList.remove(Mt),o.classList.add(It))}this.checkActionButtonStatus()}this.trigger("failure",a);var h=this.getLiElement(s);if(!t.isNullOrUndefined(h)&&!t.isNullOrUndefined(h.querySelector("."+Nt))){var d=h.querySelector("."+Nt);i.hideSpinner(d),t.detach(h.querySelector(".e-spinner-pane"))}},s.prototype.getFilesFromFolder=function(e){this.filesEntries=[];var t=this.multiple?e.dataTransfer.items:[e.dataTransfer.items[0]];if(this.checkDirectoryUpload(t))for(var i=function(i){var n=t[i].webkitGetAsEntry();if(n.isFile){var a=[];n.file(function(e){var t=n.fullPath;a.push({path:t,file:e})}),s.renderSelectedFiles(e,a,!0)}else n.isDirectory&&s.traverseFileTree(n,e)},s=this,n=0;n<t.length;n++)i(n)},s.prototype.checkDirectoryUpload=function(e){for(var t=0;e&&t<e.length;t++){if(e[t].webkitGetAsEntry().isDirectory)return!0}return!1},s.prototype.traverseFileTree=function(e,t){if(e.isFile)this.filesEntries.push(e);else if(e.isDirectory){var i=e.createReader();this.readFileFromDirectory(i,t)}},s.prototype.readFileFromDirectory=function(e,t){var i=this;e.readEntries(function(s){for(var n=0;n<s.length;n++)i.traverseFileTree(s[n],t);i.pushFilesEntries(t),s.length&&i.readFileFromDirectory(e)})},s.prototype.pushFilesEntries=function(e){for(var t=this,i=[],s=function(s){n.filesEntries[s].file(function(n){if(t.filesEntries.length){var a=t.filesEntries[s].fullPath;i.push({path:a,file:n}),s===t.filesEntries.length-1&&(t.filesEntries=[],t.renderSelectedFiles(e,i,!0))}})},n=this,a=0;a<this.filesEntries.length;a++)s(a)},s.prototype.onSelectFiles=function(e){if(this.enabled){var t;if("drop"===e.type)if(this.directoryUpload)this.getFilesFromFolder(e);else{var i=this.sortFilesList=e.dataTransfer.files;"msie"!==this.browserName&&"edge"!==this.browserName&&"safari"!==this.browserName&&(this.element.files=i),i.length>0&&(t=this.multiple?this.sortFileList(i):[i[0]],this.renderSelectedFiles(e,t))}else t=[].slice.call(e.target.files),this.renderSelectedFiles(e,t)}},s.prototype.getBase64=function(e){return new Promise(function(t,i){var s=new FileReader;s.readAsDataURL(e),s.onload=function(){return t(s.result)},s.onerror=function(e){return i(e)}})},s.prototype.renderSelectedFiles=function(e,t,i,s){var n=this;this.base64String=[];var a={event:e,cancel:!1,filesData:[],isModified:!1,modifiedFilesData:[],progressInterval:"",isCanceled:!1,currentRequest:null,customFormData:null};if(t.length<1)return a.isCanceled=!0,void this.trigger("selected",a);this.flag=!0;var l=[];this.multiple||(this.clearData(!0),t=[t[0]]);for(var r=0;r<t.length;r++){var o=i?t[r].file:t[r];this.updateInitialFileDetails(e,t,o,r,l,i,s)}a.filesData=l,this.allowedExtensions.indexOf("*")>-1&&(this.allTypes=!0),this.allTypes||(l=this.checkExtension(l)),this.trigger("selected",a,function(e){n._internalRenderSelect(e,l)})},s.prototype.updateInitialFileDetails=function(e,i,s,n,a,l,r){var o={name:l?i[n].path.substring(1,i[n].path.length):r?t.getUniqueID(s.name.substring(0,s.name.lastIndexOf(".")))+"."+this.getFileType(s.name):this.directoryUpload?i[n].webkitRelativePath:s.name,rawFile:s,size:s.size,status:this.localizedTexts("readyToUploadMessage"),type:this.getFileType(s.name),validationMessages:this.validatedFileSize(s.size),statusCode:"1",id:t.getUniqueID(s.name.substring(0,s.name.lastIndexOf(".")))+"."+this.getFileType(s.name)};r&&(o.fileSource="paste"),o.status=""!==o.validationMessages.minSize?this.localizedTexts("invalidMinFileSize"):""!==o.validationMessages.maxSize?this.localizedTexts("invalidMaxFileSize"):o.status,""===o.validationMessages.minSize&&""===o.validationMessages.maxSize||(o.statusCode="0"),a.push(o)},s.prototype._internalRenderSelect=function(e,i){if(!e.cancel){if(t.isBlazor()&&(this.currentRequestHeader=e.currentRequest,this.customFormDatas=e.customFormData),this.selectedFiles=this.selectedFiles.concat(i),this.btnTabIndex=this.disableKeyboardNavigation?"-1":"0",this.showFileList){if(e.isModified&&e.modifiedFilesData.length>0){for(var s=0;s<e.modifiedFilesData.length;s++)for(var n=0;n<i.length;n++)e.modifiedFilesData[s].id===i[n].id&&(e.modifiedFilesData[s].rawFile=i[n].rawFile);var a=this.allTypes?e.modifiedFilesData:this.checkExtension(e.modifiedFilesData);this.updateSortedFileList(a),this.filesData=a,this.isForm&&!this.allowUpload()||this.checkAutoUpload(a)}else this.createFileList(i,!0),this.isBlazorSaveUrl||this.isBlazorTemplate||(this.filesData=this.filesData.concat(i)),this.isForm&&!this.allowUpload()||this.isBlazorSaveUrl||this.isBlazorTemplate||this.checkAutoUpload(i);t.isNullOrUndefined(e.progressInterval)||""===e.progressInterval||(this.progressInterval=e.progressInterval)}else this.filesData=this.filesData.concat(i),this.isBlazorSaveUrl&&this.interopAdaptor.invokeMethodAsync("updateServerFileData",this.filesData,this.isForm),this.autoUpload&&this.upload(this.filesData,!0);this.raiseActionComplete(),this.isFirstFileOnSelection=!0}},s.prototype.allowUpload=function(){var e=!1;return this.isForm&&!t.isNullOrUndefined(this.asyncSettings.saveUrl)&&""!==this.asyncSettings.saveUrl&&(e=!0),e},s.prototype.isFormUpload=function(){var e=!1;return!this.isForm||!t.isNullOrUndefined(this.asyncSettings.saveUrl)&&""!==this.asyncSettings.saveUrl||!t.isNullOrUndefined(this.asyncSettings.removeUrl)&&""!==this.asyncSettings.removeUrl||(e=!0),e},s.prototype.clearData=function(e){t.isNullOrUndefined(this.listParent)||this.isBlazorSaveUrl||this.isBlazorTemplate||(t.detach(this.listParent),this.listParent=null),"msie"===this.browserName||e||(this.element.value=""),this.fileList=[],this.filesData=[],this.isBlazorSaveUrl||this.isBlazorTemplate?this.interopAdaptor.invokeMethodAsync("clearAll"):this.removeActionButtons()},s.prototype.updateSortedFileList=function(e){var i=this.createElement("div",{id:"clonewrapper"}),s=-1;if(this.listParent){for(var n=0;n<this.listParent.querySelectorAll("li").length;n++){var a=this.listParent.querySelectorAll("li")[n];i.appendChild(a.cloneNode(!0))}for(var l=0,r=this.listParent.querySelectorAll("li");l<r.length;l++){var o=r[l];t.detach(o)}this.removeActionButtons();var h=[].slice.call(i.childNodes);t.detach(this.listParent),this.listParent=null,this.fileList=[],this.createParentUL();for(var d=0;d<e.length;d++){for(var u=0;u<this.filesData.length;u++)this.filesData[u].name===e[d].name&&(this.listParent.appendChild(h[u]),t.EventHandler.add(h[u].querySelector(".e-icons"),"click",this.removeFiles,this),this.fileList.push(h[u]),s=d);s!==d&&this.createFileList([e[d]])}}else this.createFileList(e)},s.prototype.isBlank=function(e){return!e||/^\s*$/.test(e)},s.prototype.checkExtension=function(e){var t=e;if(!this.isBlank(this.allowedExtensions)){for(var i=[],s=0,n=this.allowedExtensions.split(",");s<n.length;s++){var a=n[s];i.push(a.trim().toLocaleLowerCase())}for(var l=0;l<e.length;l++)-1===i.indexOf(("."+e[l].type).toLocaleLowerCase())&&(e[l].status=this.localizedTexts("invalidFileType"),e[l].statusCode="0")}return t},s.prototype.validatedFileSize=function(e){var t="",i="";e<this.minFileSize?t=this.localizedTexts("invalidMinFileSize"):e>this.maxFileSize?i=this.localizedTexts("invalidMaxFileSize"):(t="",i="");return{minSize:t,maxSize:i}},s.prototype.isPreLoadFile=function(e){for(var t=!1,i=0;i<this.files.length;i++)this.files[i].name===e.name.slice(0,e.name.lastIndexOf("."))&&this.files[i].type===e.type&&(t=!0);return t},s.prototype.createCustomfileList=function(e){this.createParentUL(),t.resetBlazorTemplate(this.element.id+"Template","Template");for(var i=0,s=e;i<s.length;i++){var n=s[i],a=this.createElement("li",{className:Pt,attrs:{"data-file-name":n.name}});this.uploadTemplateFn=this.templateComplier(this.template);var l=this.uploadTemplateFn(n,this,"template",this.element.id+"Template",this.isStringTemplate,null,a);if(l){var r=[].slice.call(l);t.append(r,a)}var o=e.indexOf(n),h={element:a,fileInfo:n,index:o,isPreload:this.isPreLoadFile(n)},d={element:a,fileInfo:n,index:o,isPreload:this.isPreLoadFile(n)};this.trigger("rendering",h),this.trigger("fileListRendering",d),this.listParent.appendChild(a),this.fileList.push(a)}this.renderReactTemplates(),t.updateBlazorTemplate(this.element.id+"Template","Template",this,!1)},s.prototype.createParentUL=function(){t.isNullOrUndefined(this.listParent)&&(this.listParent=this.createElement("ul",{className:"e-upload-files"}),this.uploadWrapper.appendChild(this.listParent))},s.prototype.formFileList=function(e,i){var s=this.createElement("li",{className:Pt});s.setAttribute("data-files-count",e.length+"");for(var n,a=this.createElement("span",{className:Dt}),l=0,r=e;l<r.length;l++){var o=r[l],h=this.createElement("span",{className:"e-file-name"});h.innerHTML=this.getFileNameOnly(o.name);var d=this.createElement("span",{className:"e-file-type"}),u=this.getFileType(o.name);if(d.innerHTML="."+u,u||d.classList.add("e-hidden"),this.enableRtl){var c=this.createElement("span",{className:"e-rtl-container"});c.appendChild(d),c.appendChild(h),a.appendChild(c)}else a.appendChild(h),a.appendChild(d);this.truncateName(h),n=this.formValidateFileInfo(o,s)}s.appendChild(a),this.setListToFileInfo(e,s);var p=this.listParent.querySelectorAll("li").length,m=this.createElement("span");if(s.classList.contains(Zt)?(m.classList.add(Lt),m.classList.add(Zt),m.innerText=e.length>1?this.localizedTexts("invalidFileSelection"):n):(m.classList.add(e.length>1?"e-file-information":"e-file-size"),m.innerText=e.length>1?this.localizedTexts("totalFiles")+": "+e.length+" , "+this.localizedTexts("size")+": "+this.bytesToSize(this.getFileSize(e)):this.bytesToSize(e[0].size),this.createFormInput(e)),a.appendChild(m),t.isNullOrUndefined(s.querySelector(".e-icons"))){var f=this.createElement("span",{className:"e-icons",attrs:{tabindex:this.btnTabIndex}});"msie"===this.browserName&&f.classList.add("e-msie"),f.setAttribute("title",this.localizedTexts("remove")),s.appendChild(a),s.appendChild(f),t.EventHandler.add(f,"click",this.removeFiles,this),f.classList.add(At)}var v={element:s,fileInfo:this.mergeFileInfo(e,s),index:p,isPreload:this.isPreLoadFile(this.mergeFileInfo(e,s))},g={element:s,fileInfo:this.mergeFileInfo(e,s),index:p,isPreload:this.isPreLoadFile(this.mergeFileInfo(e,s))};this.trigger("rendering",v),this.trigger("fileListRendering",g),this.listParent.appendChild(s),this.fileList.push(s)},s.prototype.formValidateFileInfo=function(e,t){var i=e.status,s=this.validatedFileSize(e.size);""===s.minSize&&""===s.maxSize||(this.addInvalidClass(t),i=""!==s.minSize?this.localizedTexts("invalidMinFileSize"):""!==s.maxSize?this.localizedTexts("invalidMaxFileSize"):i);var n=this.checkExtension(this.getFilesInArray(e))[0].status;return n===this.localizedTexts("invalidFileType")&&(this.addInvalidClass(t),i=n),i},s.prototype.addInvalidClass=function(e){e.classList.add(Zt)},s.prototype.createFormInput=function(e){var t=this.element.cloneNode(!0);t.classList.add("e-hidden-file-input");for(var i=0,s=e;i<s.length;i++){s[i].input=t}t.setAttribute("name",this.uploaderName),this.uploadWrapper.querySelector(".e-file-select").appendChild(t),"msie"!==this.browserName&&"edge"!==this.browserName&&(this.element.value="")},s.prototype.getFileSize=function(e){for(var t=0,i=0,s=e;i<s.length;i++){t+=s[i].size}return t},s.prototype.mergeFileInfo=function(e,t){for(var i={name:"",rawFile:"",size:0,status:"",type:"",validationMessages:{minSize:"",maxSize:""},statusCode:"1",list:t},s=[],n="",a=0,l=e;a<l.length;a++){var r=l[a];s.push(r.name),n=r.type}return i.name=s.join(", "),i.size=this.getFileSize(e),i.type=n,i.status=this.statusForFormUpload(e,t),i},s.prototype.statusForFormUpload=function(e,t){for(var i,s=!0,n=0,a=e;n<a.length;n++){var l=a[n];i=l.status;var r=this.validatedFileSize(l.size);""===r.minSize&&""===r.maxSize||(s=!1,i=""!==r.minSize?this.localizedTexts("invalidMinFileSize"):""!==r.maxSize?this.localizedTexts("invalidMaxFileSize"):i);var o=this.checkExtension(this.getFilesInArray(l))[0].status;o===this.localizedTexts("invalidFileType")&&(s=!1,i=o)}return s?i=this.localizedTexts("totalFiles")+": "+e.length+" , "+this.localizedTexts("size")+": "+this.bytesToSize(this.getFileSize(e)):(t.classList.add(Zt),i=e.length>1?this.localizedTexts("invalidFileSelection"):i),i},s.prototype.formCustomFileList=function(e,i){this.createParentUL(),t.resetBlazorTemplate(this.element.id+"Template","Template");var s=this.createElement("li",{className:Pt});s.setAttribute("data-files-count",e.length+""),this.setListToFileInfo(e,s);var n=this.mergeFileInfo(e,s);s.setAttribute("data-file-name",n.name),this.uploadTemplateFn=this.templateComplier(this.template);var a=this.uploadTemplateFn(n,this,"template",this.element.id+"Template",this.isStringTemplate,null,s);if(a){var l=[].slice.call(a);t.append(l,s)}var r=this.listParent.querySelectorAll("li").length;s.classList.contains(Zt)||this.createFormInput(e);var o={element:s,fileInfo:n,index:r,isPreload:this.isPreLoadFile(n)},h={element:s,fileInfo:n,index:r,isPreload:this.isPreLoadFile(n)};this.trigger("rendering",o),this.trigger("fileListRendering",h),this.listParent.appendChild(s),this.fileList.push(s),this.renderReactTemplates(),t.updateBlazorTemplate(this.element.id+"Template","Template",this,!1)},s.prototype.createFileList=function(e,i){if(this.isBlazorSaveUrl||this.isBlazorTemplate){var s=i?this.filesData=this.filesData.concat(e):e;this.interopAdaptor.invokeMethodAsync("createFileList",s,this.isForm)}else if(this.createParentUL(),""===this.template||t.isNullOrUndefined(this.template))if(this.isFormUpload())this.uploadWrapper.classList.add("e-form-upload"),this.formFileList(e,this.element.files);else for(var n=0,a=e;n<a.length;n++){var l=a[n],r=this.createElement("li",{className:Pt,attrs:{"data-file-name":l.name,"data-files-count":"1"}}),o=this.createElement("span",{className:Dt}),h=this.createElement("span",{className:"e-file-name",attrs:{title:l.name}});h.innerHTML=this.getFileNameOnly(l.name);var d=this.createElement("span",{className:"e-file-type"}),u=this.getFileType(l.name);if(d.innerHTML="."+u,u||d.classList.add("e-hidden"),this.enableRtl){var c=this.createElement("span",{className:"e-rtl-container"});c.appendChild(d),c.appendChild(h),o.appendChild(c)}else o.appendChild(h),o.appendChild(d);var p=this.createElement("span",{className:"e-file-size"});p.innerHTML=this.bytesToSize(l.size),o.appendChild(p);var m=this.createElement("span",{className:Lt});o.appendChild(m),m.innerHTML=l.status,r.appendChild(o);var f=this.createElement("span",{className:" e-icons",attrs:{tabindex:this.btnTabIndex}});"msie"===this.browserName&&f.classList.add("e-msie"),f.setAttribute("title",this.localizedTexts("remove")),r.appendChild(f),t.EventHandler.add(f,"click",this.removeFiles,this),"2"===l.statusCode?(m.classList.add(Mt),f.classList.add(Nt),f.setAttribute("title",this.localizedTexts("delete"))):"1"!==l.statusCode&&(m.classList.remove(Mt),m.classList.add(zt)),this.autoUpload&&"1"===l.statusCode&&""!==this.asyncSettings.saveUrl&&(m.innerHTML=""),f.classList.contains(Nt)||f.classList.add(At);var v=e.indexOf(l),g={element:r,fileInfo:l,index:v,isPreload:this.isPreLoadFile(l)},y={element:r,fileInfo:l,index:v,isPreload:this.isPreLoadFile(l)};this.trigger("rendering",g),this.trigger("fileListRendering",y),this.listParent.appendChild(r),this.fileList.push(r),this.truncateName(h);var b=this.flag;this.isPreLoadFile(l)&&(this.flag=!1,this.checkActionComplete(!0),this.flag=b)}else this.isFormUpload()?(this.uploadWrapper.classList.add("e-form-upload"),this.formCustomFileList(e,this.element.files)):this.createCustomfileList(e)},s.prototype.getSlicedName=function(e){var t=e.textContent;e.dataset.tail=t.slice(t.length-10)},s.prototype.setListToFileInfo=function(e,t){for(var i=0,s=e;i<s.length;i++){s[i].list=t}},s.prototype.truncateName=function(e){var t=e;"edge"!==this.browserName&&t.offsetWidth<t.scrollWidth?this.getSlicedName(t):t.offsetWidth+1<t.scrollWidth&&this.getSlicedName(t)},s.prototype.getFileType=function(e){var t,i=e.lastIndexOf(".");return i>=0&&(t=e.substring(i+1)),t||""},s.prototype.getFileNameOnly=function(e){var t=this.getFileType(e);return t=e.split("."+t)[0]},s.prototype.setInitialAttributes=function(){if(this.initialAttr.accept&&this.element.setAttribute("accept",this.initialAttr.accept),this.initialAttr.disabled&&this.element.setAttribute("disabled","disabled"),this.initialAttr.multiple){var e=document.createAttribute("multiple");this.element.setAttributeNode(e)}},s.prototype.filterfileList=function(e){for(var t=[],i=0;i<e.length;i++)this.getLiElement(e[i]).classList.contains(Mt)||t.push(e[i]);return t},s.prototype.updateStatus=function(e,i,s,n){if(void 0===n&&(n=!0),""!==i&&!t.isNullOrUndefined(i)&&""!==s&&!t.isNullOrUndefined(s))if(this.isBlazorSaveUrl)for(var a=0;a<this.filesData.length;a++)this.filesData[a].name===e.name&&(this.filesData[a].status=i,this.filesData[a].statusCode=s);else e.status=i,e.statusCode=s;if(n){var l=this.getLiElement(e);t.isNullOrUndefined(l)||t.isNullOrUndefined(l.querySelector("."+Lt))||""===i||t.isNullOrUndefined(i)||(l.querySelector("."+Lt).textContent=i)}return e},s.prototype.getLiElement=function(e){for(var i,s=0;s<this.filesData.length;s++)(t.isNullOrUndefined(this.filesData[s].id)||t.isNullOrUndefined(e.id)?this.filesData[s].name===e.name:this.filesData[s].name===e.name&&this.filesData[s].id===e.id)&&(i=s);return this.fileList[i]},s.prototype.createProgressBar=function(e){var t=this.createElement("span",{className:Ut}),i=this.createElement("progressbar",{className:Ft,attrs:{value:"0",max:"100"}}),s=this.createElement("span",{className:"e-progress-inner-wrap"});i.setAttribute("style","width: 0%");var n=this.createElement("span",{className:Rt});n.textContent="0%",s.appendChild(i),t.appendChild(s),t.appendChild(n),e.querySelector("."+Dt).appendChild(t)},s.prototype.updateProgressbar=function(e,i){if(!isNaN(Math.round(e.loaded/e.total*100))&&!t.isNullOrUndefined(i.querySelector("."+Ft)))if(t.isNullOrUndefined(this.progressInterval)||""===this.progressInterval)this.changeProgressValue(i,Math.round(e.loaded/e.total*100).toString()+"%");else{var s=Math.round(e.loaded/e.total*100)%parseInt(this.progressInterval,10);0!==s&&100!==s||this.changeProgressValue(i,Math.round(e.loaded/e.total*100).toString()+"%")}},s.prototype.changeProgressValue=function(e,t){e.querySelector("."+Ft).setAttribute("style","width:"+t),e.querySelector("."+Rt).textContent=t},s.prototype.uploadInProgress=function(e,i,s,n){var a=this.getLiElement(i);if(!t.isNullOrUndefined(a)||s){if(t.isNullOrUndefined(a))this.cancelUploadingFile(i,e,n);else{"5"===i.statusCode&&this.cancelUploadingFile(i,e,n,a),a.querySelectorAll("."+Ut).length>0||!a.querySelector("."+Lt)||(a.querySelector("."+Lt).classList.add(Vt),this.createProgressBar(a),this.updateProgressBarClasses(a,Vt),a.querySelector("."+Lt).classList.remove(It)),this.updateProgressbar(e,a);var l=a.querySelector("."+At);t.isNullOrUndefined(l)||(l.classList.add(Ht,Vt),l.setAttribute("title",this.localizedTexts("abort")),l.classList.remove(At))}var r={e:e,operation:"upload",file:this.updateStatus(i,this.localizedTexts("inProgress"),"3")};this.trigger("progress",r)}},s.prototype.cancelUploadingFile=function(e,s,n,a){var l=this;if("5"===e.statusCode){var r={event:s,fileData:e,cancel:!1,customFormData:[]};this.trigger("canceling",r,function(s){if(s.cancel){if(e.statusCode="3",!t.isNullOrUndefined(a)){var r=a.querySelector("."+Ht);t.isNullOrUndefined(r)||(i.hideSpinner(r),t.detach(a.querySelector(".e-spinner-pane")))}}else{n.emitError=!1,n.httpRequest.abort();var o=new FormData;if("5"===e.statusCode){var h=l.element.getAttribute("name");o.append(h,e.name),o.append("cancel-uploading",e.name),l.updateFormData(o,s.customFormData);var d=new t.Ajax(l.asyncSettings.removeUrl,"POST",!0,null);d.emitError=!1,d.onLoad=function(t){return l.removecanceledFile(t,e),{}},d.send(o)}}})}},s.prototype.removecanceledFile=function(e,s){var n=this.getLiElement(s);if(!n.querySelector("."+Bt)&&!t.isNullOrUndefined(n.querySelector("."+Ht))){this.updateStatus(s,this.localizedTexts("fileUploadCancel"),"5"),this.renderFailureState(e,s,n);var a=n.querySelector("."+At);t.isNullOrUndefined(n)||(i.hideSpinner(a),t.isNullOrUndefined(n.querySelector(".e-spinner-pane"))||t.detach(n.querySelector(".e-spinner-pane")));var l={event:e,response:e&&e.currentTarget?this.getResponse(e):null,operation:"cancel",file:s};this.trigger("success",l)}},s.prototype.renderFailureState=function(e,i,s){var n=this;this.updateProgressBarClasses(s,It),this.removeProgressbar(s,"failure"),t.isNullOrUndefined(s.querySelector(".e-file-status"))||s.querySelector(".e-file-status").classList.add(It);var a=s.querySelector("."+Ht);if(!t.isNullOrUndefined(a)){a.classList.remove(Ht,Vt),a.classList.add(At),a.setAttribute("title",this.localizedTexts("remove")),this.pauseButton=this.createElement("span",{className:"e-icons e-file-reload-btn",attrs:{tabindex:this.btnTabIndex}}),a.parentElement.insertBefore(this.pauseButton,a),this.pauseButton.setAttribute("title",this.localizedTexts("retry"));s.querySelector("."+Bt).addEventListener("click",function(e){n.reloadcanceledFile(e,i,s,!1)},!1)}},s.prototype.reloadcanceledFile=function(e,i,s,n){i.statusCode="1",i.status=this.localizedTexts("readyToUploadMessage"),n||(t.isNullOrUndefined(s.querySelector("."+Lt))||s.querySelector("."+Lt).classList.remove(It),t.isNullOrUndefined(s.querySelector("."+Bt))||t.detach(s.querySelector("."+Bt)),this.pauseButton=null),s.classList.add(Xt),this.upload([i])},s.prototype.uploadComplete=function(e,i,s){var n=e.target;if(4===n.readyState&&n.status>=200&&n.status<=299){var a=this.getLiElement(i);if(t.isNullOrUndefined(a)&&(!s||t.isNullOrUndefined(s)))return;if(!t.isNullOrUndefined(a)){this.updateProgressBarClasses(a,Mt),this.removeProgressbar(a,"success");var l=a.querySelector("."+Ht);t.isNullOrUndefined(l)||(l.classList.add(Nt),l.setAttribute("title",this.localizedTexts("delete")),l.classList.remove(Ht),l.classList.remove(Vt))}this.raiseSuccessEvent(e,i)}else this.uploadFailed(e,i)},s.prototype.getResponse=function(e){var t=e.currentTarget;return{readyState:t.readyState,statusCode:t.status,statusText:t.statusText,headers:t.getAllResponseHeaders(),withCredentials:t.withCredentials}},s.prototype.serverRemoveIconBindEvent=function(){if(this.uploadWrapper&&this.isBlazorSaveUrl)for(var e=[].slice.call(this.uploadWrapper.querySelectorAll("ul li")),i=0;i<e.length;i++){var s=e[i]?e[i].querySelector(".e-icons"):null;s&&(t.EventHandler.remove(s,"click",this.removeFiles),t.EventHandler.add(s,"click",this.removeFiles,this))}},s.prototype.raiseSuccessEvent=function(e,s){var n=this,a=e&&e.currentTarget?this.getResponse(e):null,l=this.localizedTexts("uploadSuccessMessage"),r={e:e,response:a,operation:"upload",file:this.updateStatus(s,l,"2",!1),statusText:l};if(!this.isBlazorSaveUrl){var o=this.getLiElement(s);if(!t.isNullOrUndefined(o)){var h=o.querySelector(".e-spinner-pane");t.isNullOrUndefined(h)||(i.hideSpinner(o),t.detach(h))}}this.trigger("success",r,function(e){n.updateStatus(s,e.statusText,"2"),n.uploadedFilesData.push(s),n.isBlazorSaveUrl||n.trigger("change",{file:n.uploadedFilesData}),n.checkActionButtonStatus(),n.fileList.length>0&&(n.getLiElement(s).classList.contains(Xt)?n.getLiElement(s).classList.remove(Xt):(n.uploadSequential(),n.checkActionComplete(!0)))})},s.prototype.uploadFailed=function(e,i){var s=this,n=this.getLiElement(i),a=e&&e.currentTarget?this.getResponse(e):null,l=this.localizedTexts("uploadFailedMessage"),r={e:e,response:a,operation:"upload",file:this.updateStatus(i,l,"0",!1),statusText:l};t.isNullOrUndefined(n)||this.renderFailureState(e,i,n),this.trigger("failure",r,function(e){s.updateStatus(i,e.statusText,"0"),s.checkActionButtonStatus(),s.uploadSequential(),s.checkActionComplete(!0)})},s.prototype.uploadSequential=function(){this.sequentialUpload&&(this.autoUpload?this.checkAutoUpload(this.filesData):this.uploadButtonClick())},s.prototype.checkActionComplete=function(e){e?++this.actionCompleteCount:--this.actionCompleteCount,this.raiseActionComplete()},s.prototype.raiseActionComplete=function(){if(this.filesData.length===this.actionCompleteCount&&this.flag){this.flag=!1;var e={fileData:[]};e.fileData=this.getSelectedFileStatus(this.selectedFiles),this.trigger("actionComplete",e)}},s.prototype.getSelectedFileStatus=function(e){for(var t=[],i=0,s=0;s<e.length;s++)for(var n=e[s],a=0;a<this.filesData.length;a++)this.filesData[a].name===n.name&&(t[i]=this.filesData[a],++i);return t},s.prototype.updateProgressBarClasses=function(e,i){var s=e.querySelector("."+Ft);t.isNullOrUndefined(s)||s.classList.add(i)},s.prototype.removeProgressbar=function(e,i){var s=this;t.isNullOrUndefined(e.querySelector("."+Ut))||(this.progressAnimation=new t.Animation({duration:1250}),this.progressAnimation.animate(e.querySelector("."+Ut),{name:"FadeOut"}),this.progressAnimation.animate(e.querySelector("."+Rt),{name:"FadeOut"}),setTimeout(function(){s.animateProgressBar(e,i)},750))},s.prototype.animateProgressBar=function(e,i){"success"===i?(e.classList.add(Mt),t.isNullOrUndefined(e.querySelector("."+Lt))||(e.querySelector("."+Lt).classList.remove(Vt),this.progressAnimation.animate(e.querySelector("."+Lt),{name:"FadeIn"}),e.querySelector("."+Lt).classList.add(Mt))):t.isNullOrUndefined(e.querySelector("."+Lt))||(e.querySelector("."+Lt).classList.remove(Vt),this.progressAnimation.animate(e.querySelector("."+Lt),{name:"FadeIn"}),e.querySelector("."+Lt).classList.add(It)),e.querySelector("."+Ut)&&t.detach(e.querySelector("."+Ut))},s.prototype.setExtensions=function(e){""===e||t.isNullOrUndefined(e)?this.element.removeAttribute("accept"):this.element.setAttribute("accept",e)},s.prototype.templateComplier=function(e){if(e)try{if(t.selectAll(e,document).length)return t.compile(t.select(e,document).innerHTML.trim())}catch(i){return t.compile(e)}},s.prototype.setRTL=function(){this.enableRtl?t.addClass([this.uploadWrapper],"e-rtl"):t.removeClass([this.uploadWrapper],"e-rtl")},s.prototype.localizedTexts=function(e){return this.l10n.setLocale(this.locale),this.l10n.getConstant(e)},s.prototype.setControlStatus=function(){this.enabled?(this.uploadWrapper.classList.contains(qt)&&this.uploadWrapper.classList.remove(qt),!t.isNullOrUndefined(this.browseButton)&&this.element.hasAttribute("disabled")&&(this.element.removeAttribute("disabled"),this.browseButton.removeAttribute("disabled")),!t.isNullOrUndefined(this.clearButton)&&this.clearButton.hasAttribute("disabled")&&this.clearButton.removeAttribute("disabled"),!t.isNullOrUndefined(this.uploadButton)&&this.uploadButton.hasAttribute("disabled")&&this.uploadButton.hasAttribute("disabled")):(this.uploadWrapper.classList.add(qt),this.element.setAttribute("disabled","disabled"),this.browseButton.setAttribute("disabled","disabled"),t.isNullOrUndefined(this.clearButton)||this.clearButton.setAttribute("disabled","disabled"),t.isNullOrUndefined(this.uploadButton)||this.uploadButton.setAttribute("disabled","disabled"))},s.prototype.checkHTMLAttributes=function(e){for(var i=0,s=e?t.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["accept","multiple","disabled"];i<s.length;i++){var n=s[i];if(!t.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"accept":(t.isNullOrUndefined(this.uploaderOptions)||void 0===this.uploaderOptions.allowedExtensions||e)&&(this.setProperties({allowedExtensions:this.element.getAttribute("accept")},!e),this.initialAttr.accept=this.allowedExtensions);break;case"multiple":if(t.isNullOrUndefined(this.uploaderOptions)||void 0===this.uploaderOptions.multiple||e){var a="multiple"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n);this.setProperties({multiple:a},!e),this.initialAttr.multiple=!0}break;case"disabled":if(t.isNullOrUndefined(this.uploaderOptions)||void 0===this.uploaderOptions.enabled||e){var l="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n);this.setProperties({enabled:l},!e),this.initialAttr.disabled=!0}}}},s.prototype.chunkUpload=function(e,t,i){var s=Math.min(this.asyncSettings.chunkSize,e.size),n={chunkIndex:0,blob:e.rawFile.slice(0,s),file:e,start:0,end:s,retryCount:0,request:null};this.sendRequest(e,n,t,i)},s.prototype.sendRequest=function(e,i,s,n){var a=this,l=new FormData,r=e.rawFile.slice(i.start,i.end);l.append("chunkFile",r,e.name),l.append(this.uploaderName,r,e.name),l.append("chunk-index",i.chunkIndex.toString()),l.append("chunkIndex",i.chunkIndex.toString());var o=Math.max(Math.ceil(e.size/this.asyncSettings.chunkSize),1);l.append("total-chunk",o.toString()),l.append("totalChunk",o.toString());var h=new t.Ajax({url:this.asyncSettings.saveUrl,type:"POST",async:!0,contentType:null});h.emitError=!1,h.onLoad=function(e){return a.chunkUploadComplete(e,i,s),{}},h.onUploadProgress=function(e){return a.chunkUploadInProgress(e,i,s),{}};var d={fileData:e,customFormData:[],cancel:!1,chunkSize:0===this.asyncSettings.chunkSize?null:this.asyncSettings.chunkSize};h.beforeSend=function(s){d.currentRequest=h.httpRequest,d.currentChunkIndex=i.chunkIndex,t.isBlazor()&&(a.currentRequestHeader&&a.updateCustomheader(h.httpRequest,a.currentRequestHeader),a.customFormDatas&&a.updateFormData(l,a.customFormDatas)),0===d.currentChunkIndex?a.trigger("uploading",d,function(t){a.uploadingEventCallback(l,t,s,e)}):a.trigger("chunkUploading",d,function(t){a.uploadingEventCallback(l,t,s,e)})},h.onError=function(e){return a.chunkUploadFailed(e,i,s),{}},h.send(l),i.request=h},s.prototype.uploadingEventCallback=function(e,t,i,s){t.cancel?this.eventCancelByArgs(i,t,s):this.updateFormData(e,t.customFormData)},s.prototype.eventCancelByArgs=function(e,i,s){var n=this;if(e.cancel=!0,"5"!==i.fileData.statusCode){i.fileData.statusCode="5",i.fileData.status=this.localizedTexts("fileUploadCancel");var a=this.getLiElement(i.fileData);if(a){t.isNullOrUndefined(a.querySelector("."+Lt))||(a.querySelector("."+Lt).innerHTML=this.localizedTexts("fileUploadCancel"),a.querySelector("."+Lt).classList.add(It)),this.pauseButton=this.createElement("span",{className:"e-icons e-file-reload-btn",attrs:{tabindex:this.btnTabIndex}});var l=a.querySelector("."+At);l&&l.parentElement.insertBefore(this.pauseButton,l),this.pauseButton.setAttribute("title",this.localizedTexts("retry")),this.pauseButton.addEventListener("click",function(e){n.reloadcanceledFile(e,s,a)},!1),this.checkActionButtonStatus()}}},s.prototype.checkChunkUpload=function(){return!(this.asyncSettings.chunkSize<=0||t.isNullOrUndefined(this.asyncSettings.chunkSize))},s.prototype.chunkUploadComplete=function(e,s,n){var a,l=this,r=e.target;if(4===r.readyState&&r.status>=200&&r.status<300){var o=e&&e.currentTarget?this.getResponse(e):null,h=Math.max(Math.ceil(s.file.size/this.asyncSettings.chunkSize),1),d={event:e,file:s.file,chunkIndex:s.chunkIndex,totalChunk:h,chunkSize:this.asyncSettings.chunkSize,response:o};if(this.trigger("chunkSuccess",d),!t.isNullOrUndefined(n)&&n||(a=this.getLiElement(s.file)),this.updateMetaData(s),s.end===s.file.size&&(s.file.statusCode="3"),"5"===s.file.statusCode){var u={event:e,fileData:s.file,cancel:!1,customFormData:[]};this.trigger("canceling",u,function(e){if(e.cancel){s.file.statusCode="3";var o=a.querySelector("."+Ht);t.isNullOrUndefined(a)||t.isNullOrUndefined(o)||(i.hideSpinner(o),t.detach(a.querySelector(".e-spinner-pane"))),l.sendNextRequest(s)}else{s.request.emitError=!1,r.abort();var h=new FormData,d=l.element.getAttribute("name");h.append(d,s.file.name),h.append("cancel-uploading",s.file.name),h.append("cancelUploading",s.file.name),l.updateFormData(h,e.customFormData);var u=new t.Ajax(l.asyncSettings.removeUrl,"POST",!0,null);u.emitError=!1,u.onLoad=function(e){return l.removeChunkFile(e,s,n),{}},u.send(h)}})}else{if(h-1===s.chunkIndex&&h>s.chunkIndex){var c=this.pausedData.indexOf(s);return c>=0&&this.pausedData.splice(c,1),t.isNullOrUndefined(this.template)&&(t.isNullOrUndefined(n)||!n)&&a&&(a&&!t.isNullOrUndefined(a.querySelector("."+jt))&&t.detach(a.querySelector("."+jt)),this.removeChunkProgressBar(s)),void this.raiseSuccessEvent(e,s.file)}"4"!==s.file.statusCode&&this.sendNextRequest(s)}}else this.chunkUploadFailed(e,s)},s.prototype.sendNextRequest=function(e){e.start=e.end,e.end+=this.asyncSettings.chunkSize,e.end=Math.min(e.end,e.file.size),e.chunkIndex+=1,this.sendRequest(e.file,e)},s.prototype.removeChunkFile=function(e,s,n){if(t.isNullOrUndefined(this.template)&&t.isNullOrUndefined(n)&&!n){var a=this.getLiElement(s.file),l=a.querySelector("."+Ht),r=l;this.updateStatus(s.file,this.localizedTexts("fileUploadCancel"),"5"),this.updateProgressBarClasses(a,It),this.removeProgressbar(a,"failure"),l&&l.classList.remove(Ht),l&&l.classList.add(At),l&&l.setAttribute("title",this.localizedTexts("remove"));var o=a.querySelector("."+jt);o&&o.classList.add(Bt),o&&o.classList.remove(jt),o&&o.setAttribute("title",this.localizedTexts("retry")),t.isNullOrUndefined(a)||t.isNullOrUndefined(l)||t.isNullOrUndefined(a.querySelector(".e-spinner-pane"))||(i.hideSpinner(r),t.detach(a.querySelector(".e-spinner-pane")))}},s.prototype.pauseUpload=function(e,t,i){e.file.statusCode="4",e.file.status=this.localizedTexts("pause"),this.updateMetaData(e);var s={event:t||null,file:e.file,chunkIndex:e.chunkIndex,chunkCount:Math.round(e.file.size/this.asyncSettings.chunkSize),chunkSize:this.asyncSettings.chunkSize};this.abortUpload(e,i,s)},s.prototype.abortUpload=function(e,i,s){"4"!==e.file.statusCode&&(e.request.emitError=!1,e.request.httpRequest.abort());var n=this.getLiElement(e.file);if(t.isNullOrUndefined(this.template)&&(t.isNullOrUndefined(i)||!i)){var a=n.querySelector("."+jt);a.classList.remove(jt),a.classList.add(_t),a.setAttribute("title",this.localizedTexts("resume")),a.nextElementSibling.classList.add(At),a.nextElementSibling.classList.remove(Ht),a.nextElementSibling.setAttribute("title",this.localizedTexts("remove"))}for(var l=0;l<this.pausedData.length;l++)this.pausedData[l].file.name===e.file.name&&this.pausedData.splice(l,1);this.pausedData.push(e),this.trigger("pausing",s)},s.prototype.resumeUpload=function(e,i,s){var n,a=this.getLiElement(e.file);t.isNullOrUndefined(a)||(n=a.querySelector("."+_t)),t.isNullOrUndefined(n)||!t.isNullOrUndefined(s)&&s||(n.classList.remove(_t),n.classList.add(jt),n.setAttribute("title",this.localizedTexts("pause")),n.nextElementSibling.classList.remove(At),n.nextElementSibling.classList.add(Ht),n.nextElementSibling.setAttribute("title",this.localizedTexts("abort"))),e.file.status=this.localizedTexts("inProgress"),e.file.statusCode="3",this.updateMetaData(e);var l={event:i||null,file:e.file,chunkIndex:e.chunkIndex,chunkCount:Math.round(e.file.size/this.asyncSettings.chunkSize),chunkSize:this.asyncSettings.chunkSize};this.trigger("resuming",l);for(var r=0;r<this.pausedData.length;r++)this.pausedData[r].end===this.pausedData[r].file.size?this.chunkUploadComplete(i,e,s):this.pausedData[r].file.name===e.file.name&&(this.pausedData[r].start=this.pausedData[r].end,this.pausedData[r].end=this.pausedData[r].end+this.asyncSettings.chunkSize,this.pausedData[r].end=Math.min(this.pausedData[r].end,this.pausedData[r].file.size),this.pausedData[r].chunkIndex=this.pausedData[r].chunkIndex+1,this.sendRequest(this.pausedData[r].file,this.pausedData[r],s))},s.prototype.updateMetaData=function(e){-1===this.uploadMetaData.indexOf(e)?this.uploadMetaData.push(e):(this.uploadMetaData.splice(this.uploadMetaData.indexOf(e),1),this.uploadMetaData.push(e))},s.prototype.removeChunkProgressBar=function(e){var i=this.getLiElement(e.file);if(!t.isNullOrUndefined(i)){this.updateProgressBarClasses(i,Mt),this.removeProgressbar(i,"success");var s=i.querySelector("."+Ht);t.isNullOrUndefined(s)||(s.classList.add(Nt),s.setAttribute("title",this.localizedTexts("delete")),s.classList.remove(Ht,Vt))}},s.prototype.chunkUploadFailed=function(e,i,s){var n,a=this,l=Math.max(Math.ceil(i.file.size/this.asyncSettings.chunkSize),1);!t.isNullOrUndefined(this.template)||!t.isNullOrUndefined(s)&&s||(n=this.getLiElement(i.file));var r=e&&e.currentTarget?this.getResponse(e):null,o={event:e,file:i.file,chunkIndex:i.chunkIndex,totalChunk:l,chunkSize:this.asyncSettings.chunkSize,cancel:!1,response:r};this.trigger("chunkFailure",o,function(l){if(!l.cancel)if(i.retryCount<a.asyncSettings.retryCount)setTimeout(function(){a.retryRequest(n,i,s)},a.asyncSettings.retryAfterDelay);else{if(!t.isNullOrUndefined(n)){var o=n.querySelector("."+jt)?n.querySelector("."+jt):n.querySelector("."+_t);t.isNullOrUndefined(o)||(o.classList.add(Bt),o.classList.remove(jt,_t)),a.updateProgressBarClasses(n,It),a.removeProgressbar(n,"failure"),n.querySelector(".e-icons").classList.remove(Vt);var h=n.querySelector("."+Ht)?n.querySelector("."+Ht):n.querySelector("."+At);h.classList.remove(Ht),t.isNullOrUndefined(n.querySelector("."+jt))||t.detach(n.querySelector("."+jt)),i.start>0?(h.classList.add(Nt),h.setAttribute("title",a.localizedTexts("delete"))):(h.classList.add(At),h.setAttribute("title",a.localizedTexts("remove")))}i.retryCount=0;var d=i.file,u=a.localizedTexts("uploadFailedMessage"),c={e:e,response:r,operation:"upload",file:a.updateStatus(d,u,"0",!1),statusText:u};a.trigger("failure",c,function(e){a.updateStatus(d,e.statusText,"0"),a.uploadSequential(),a.checkActionComplete(!0)})}})},s.prototype.retryRequest=function(e,i,s){t.isNullOrUndefined(this.template)&&(t.isNullOrUndefined(s)||!s)&&e&&this.updateProgressBarClasses(e,It),i.retryCount+=1,this.sendRequest(i.file,i)},s.prototype.checkPausePlayAction=function(e){var t=e.target,i=e.target.parentElement,s=this.fileList.indexOf(i),n=this.filesData[s],a=this.getCurrentMetaData(n);t.classList.contains(jt)?this.pauseUpload(a,e):t.classList.contains(_t)?this.resumeUpload(a,e):t.classList.contains(Bt)&&(a.file.status===this.localizedTexts("fileUploadCancel")?this.retryUpload(a,!1):this.retryUpload(a,!0))},s.prototype.retryUpload=function(e,t){t?(e.end=e.end+this.asyncSettings.chunkSize,e.start=e.start+this.asyncSettings.chunkSize,this.sendRequest(e.file,e)):(e.file.statusCode="1",e.file.status=this.localizedTexts("readyToUploadMessage"),this.chunkUpload(e.file)),this.getLiElement(e.file).classList.add(Xt)},s.prototype.chunkUploadInProgress=function(e,i,s){var n=this;if("4"!==i.file.statusCode){"4"!==i.file.statusCode&&"5"!==i.file.statusCode&&(i.file.statusCode="3",i.file.status=this.localizedTexts("inProgress")),this.updateMetaData(i);var a=this.getLiElement(i.file);if(!t.isNullOrUndefined(a)){var l=a.querySelector("."+Bt);if(t.isNullOrUndefined(l)||(l.classList.add(jt),l.setAttribute("title",this.localizedTexts("pause")),l.classList.remove(Bt)),!t.isNullOrUndefined(a)){if(!(a.querySelectorAll("."+Ut).length>0)){var r=a.querySelector("."+Lt);t.isNullOrUndefined(this.template)&&(r.classList.add(Vt),r.classList.remove(It),this.createProgressBar(a),this.updateProgressBarClasses(a,Vt));var o=a.querySelector("."+At)?a.querySelector("."+At):a.querySelector("."+Nt);t.isNullOrUndefined(o)||(o.classList.add(Ht),o.setAttribute("title",this.localizedTexts("abort")),o.classList.remove(At))}if(!isNaN(Math.round(e.loaded/e.total*100))&&t.isNullOrUndefined(this.template)&&"4"!==i.file.statusCode){var h=void 0,d=Math.ceil(i.file.size/this.asyncSettings.chunkSize)-1;this.asyncSettings.chunkSize&&d&&(h=Math.round(i.chunkIndex/d*100),this.changeProgressValue(a,h.toString()+"%"))}0===i.chunkIndex&&this.checkActionButtonStatus()}if(t.isNullOrUndefined(a.querySelector("."+jt))&&t.isNullOrUndefined(this.template)&&t.isNullOrUndefined(a.querySelector("."+Nt))){this.pauseButton=this.createElement("span",{className:"e-icons e-file-pause-btn",attrs:{tabindex:this.btnTabIndex}}),"msie"===this.browserName&&this.pauseButton.classList.add("e-msie");var u=a.querySelector("."+Ht);u.parentElement.insertBefore(this.pauseButton,u),this.pauseButton.setAttribute("title",this.localizedTexts("pause")),this.pauseButton.addEventListener("click",function(e){n.checkPausePlayAction(e)},!1)}}}},s.prototype.bytesToSize=function(e){var t=-1;if(!e)return"0.0 KB";do{e/=1024,t++}while(e>99);return t>=2&&(e*=1024,t=1),Math.max(e,0).toFixed(1)+" "+["KB","MB"][t]},s.prototype.sortFileList=function(e){for(var t=e=e||this.sortFilesList,i=[],s=0;s<t.length;s++)i.push(t[s].name);for(var n=[],a=0,l=i.sort();a<l.length;a++){var r=l[a];for(s=0;s<t.length;s++)r===t[s].name&&n.push(t[s])}return n},s.prototype.destroy=function(){this.element.value=null,this.clearTemplate(),this.isBlazorSaveUrl||this.isBlazorTemplate||this.clearAll(),this.unWireEvents(),this.unBindDropEvents(),this.multiple&&this.element.removeAttribute("multiple"),this.enabled||this.element.removeAttribute("disabled"),this.element.removeAttribute("accept"),this.setInitialAttributes();for(var i=0,s=["aria-label","directory","webkitdirectory","tabindex"];i<s.length;i++){var n=s[i];this.element.removeAttribute(n)}this.isServerBlazor?this.uploadWrapper=null:(t.isNullOrUndefined(this.uploadWrapper)||(this.uploadWrapper.parentElement.appendChild(this.element),t.detach(this.uploadWrapper)),this.uploadWrapper=null,e.prototype.destroy.call(this))},s.prototype.upload=function(e,i){var s=this;if(e=e||this.filesData,this.sequentialUpload&&(this.isFirstFileOnSelection||i))this.sequenceUpload(e);else{var n=this.getFilesInArray(e);this.trigger("beforeUpload",{customFormData:[],currentRequest:null,cancel:!1},function(e){e.cancel||(t.isBlazor()&&(s.currentRequestHeader=e.currentRequest?e.currentRequest:s.currentRequestHeader,s.customFormDatas=e.customFormData&&e.customFormData.length>0?e.customFormData:s.customFormDatas),s.uploadFiles(n,i))})}},s.prototype.getFilesInArray=function(e){var t=[];return e instanceof Array?t=e:t.push(e),t},s.prototype.serverReadFileBase64=function(e,t,i){var s=this;return new Promise(function(n,a){var l=s.fileStreams[e].rawFile;try{var r=new FileReader;r.onload=function(e){return function(){try{var t=e.result,i=t?t.split(";base64,")[1]:null;n(i)}catch(e){a(e)}}}(r),r.readAsDataURL(l.slice(t,t+i))}catch(e){a(e)}})},s.prototype.uploadFileCount=function(e){var t=this.filesData;if(!t||0===t.length)return-1;return t.length},s.prototype.getFileRead=function(e,t){var i=this.filesData;if(!i||0===i.length)return-1;var s=i[e],n=this.newFileRef++;return this.fileStreams[n]=s,n},s.prototype.getFileInfo=function(e,t){var i=this.filesData;if(!i||0===i.length)return null;return i[e]?this.filesData[e]:null},s.prototype.uploadFiles=function(e,i){var s=this,n=[];if(""===this.asyncSettings.saveUrl||t.isNullOrUndefined(this.asyncSettings.saveUrl))this.isServerBlazor&&this.interopAdaptor.invokeMethodAsync("GetFileDetails",e);else{if(!i||t.isNullOrUndefined(i))if(this.multiple)n=this.filterfileList(e);else{var a=[];a.push(e[0]),n=this.filterfileList(a)}else n=e;for(var l=function(e){r.isServerBlazor&&!r.checkChunkUpload()?n[e]&&n[e].rawFile instanceof File&&r.getBase64(n[e].rawFile).then(function(t){s.base64String.push(t),s.uploadFilesRequest(n,e,i)}):r.uploadFilesRequest(n,e,i)},r=this,o=0;o<n.length;o++)l(o)}},s.prototype.uploadFilesRequest=function(e,i,s){var n=this,a=[],l=this.checkChunkUpload(),r=new t.Ajax(this.asyncSettings.saveUrl,"POST",!0,null);r.emitError=!1;var o;this.isServerBlazor&&(o=e.slice(0),a.push(o[i].rawFile));var h={fileData:this.isServerBlazor?o[i]:e[i],customFormData:[],cancel:!1},d=new FormData;if(r.beforeSend=function(s){h.currentRequest=r.httpRequest,t.isBlazor()&&(h.fileData.rawFile=l?h.fileData.rawFile:n.base64String[i],n.currentRequestHeader&&n.updateCustomheader(r.httpRequest,n.currentRequestHeader),n.customFormDatas&&n.updateFormData(d,n.customFormDatas)),n.trigger("uploading",h,function(t){n.isServerBlazor&&!l&&(e[i].rawFile=t.fileData.rawFile=a[i]),t.cancel&&n.eventCancelByArgs(s,t,e[i]),n.updateFormData(d,t.customFormData)})},"1"===e[i].statusCode){var u=this.element.getAttribute("name");d.append(u,e[i].rawFile,e[i].name),l&&e[i].size>this.asyncSettings.chunkSize?this.chunkUpload(e[i],s,i):(r.onLoad=function(t){return h.cancel&&n.isServerBlazor?{}:(n.uploadComplete(t,e[i],s),{})},r.onUploadProgress=function(t){return h.cancel&&n.isServerBlazor?{}:(n.uploadInProgress(t,e[i],s,r),{})},r.onError=function(t){return n.uploadFailed(t,e[i]),{}},r.send(d))}},s.prototype.spliceFiles=function(e){for(var t=this.fileList[e],i=this.getFilesData(),s=+t.getAttribute("data-files-count"),n=0,a=0;a<e;a++)n+=+this.fileList[a].getAttribute("data-files-count");for(var l=n+s-1;l>=n;l--)i.splice(l,1)},s.prototype.remove=function(e,i,s,n,a){var l=this;t.isNullOrUndefined(n)&&(n=!0);var r={event:a,cancel:!1,filesData:[],customFormData:[],postRawFile:n,currentRequest:null};this.trigger("beforeRemove",{cancel:!1,customFormData:[],currentRequest:null},function(n){if(!n.cancel)if(t.isBlazor()&&(l.currentRequestHeader=n.currentRequest,l.customFormDatas=n.customFormData),l.isFormUpload()&&!l.isBlazorSaveUrl)r.filesData=e,l.trigger("removing",r,function(i){if(!i.cancel)for(var s=!1,n=void 0,a=0,r=l.getFilesInArray(e);a<r.length;a++){var o=r[a];if(s||(n=l.fileList.indexOf(o.list)),n>-1){var h=t.isNullOrUndefined(o.input)?null:o.input;h&&t.detach(h),l.spliceFiles(n),t.detach(l.fileList[n]),l.fileList.splice(n,1),s=!0,n=-1}}});else if(!l.isForm||!t.isNullOrUndefined(l.asyncSettings.removeUrl)&&""!==l.asyncSettings.removeUrl||l.isBlazorSaveUrl){var o=[];(e=t.isNullOrUndefined(e)?l.filesData:e)instanceof Array?o=e:o.push(e),r.filesData=o;for(var h=l.asyncSettings.removeUrl,d=""!==h&&!t.isNullOrUndefined(h),u=function(e){var t=l.uploadedFilesData.indexOf(e);("2"===e.statusCode||"4"===e.statusCode||"0"===e.statusCode&&-1!==t)&&d?l.removeUploadedFile(e,r,s,i):s?l.removeFilesData(e,i):l.trigger("removing",r,function(t){t.cancel||l.removeFilesData(e,i)}),a&&!a.target.classList.contains(At)&&l.checkActionComplete(!1)},c=0,p=o;c<p.length;c++){u(p[c])}}else r.filesData=l.getFilesData(),l.trigger("removing",r,function(e){e.cancel||l.clearAll()})})},s.prototype.clearAll=function(){var e=this;if(t.isNullOrUndefined(this.listParent)&&!this.isBlazorSaveUrl&&!this.isBlazorTemplate)return"msie"!==this.browserName&&(this.element.value=""),void(this.filesData=[]);var i={cancel:!1,filesData:this.filesData};this.trigger("clearing",i,function(t){t.cancel||(e.clearData(),e.actionCompleteCount=0,e.count=-1)})},s.prototype.getFilesData=function(e){if(this.isServerBlazor){for(var i=0;i<this.filesData.length;i++)this.filesData[i].rawFile=this.base64String[i];return this.filesData}return t.isNullOrUndefined(e)?this.filesData:this.getSelectedFiles(e)},s.prototype.pause=function(e,t){e=e||this.filesData;var i=this.getFilesInArray(e);this.pauseUploading(i,t)},s.prototype.pauseUploading=function(e,t){for(var i=this.getFiles(e),s=0;s<i.length;s++)"3"===i[s].statusCode&&this.pauseUpload(this.getCurrentMetaData(i[s],null),null,t)},s.prototype.getFiles=function(e){var i=[];return t.isNullOrUndefined(e)||e instanceof Array?i=e:i.push(e),i},s.prototype.resume=function(e,t){e=e||this.filesData;var i=this.getFilesInArray(e);this.resumeFiles(i,t)},s.prototype.resumeFiles=function(e,t){for(var i=this.getFiles(e),s=0;s<i.length;s++)"4"===i[s].statusCode&&this.resumeUpload(this.getCurrentMetaData(i[s],null),null,t)},s.prototype.retry=function(e,t,i){e=e||this.filesData;var s=this.getFilesInArray(e);this.sequentialUpload&&this.isFirstFileOnSelection&&(this.isFirstFileOnSelection=!1),this.retryFailedFiles(s,t,i)},s.prototype.retryFailedFiles=function(e,t,i){for(var s=this.getFiles(e),n=0;n<s.length;n++)if("5"===s[n].statusCode||"0"===s[n].statusCode)if(this.asyncSettings.chunkSize>0)this.retryUpload(this.getCurrentMetaData(s[n],null),t);else{var a=void 0;i||(a=this.fileList[this.filesData.indexOf(s[n])]),this.reloadcanceledFile(null,s[n],a,i)}},s.prototype.cancel=function(e){e=e||this.filesData;var t=this.getFilesInArray(e);this.cancelUpload(t)},s.prototype.cancelUpload=function(e){var t=this.getFiles(e);if(this.asyncSettings.chunkSize>0){for(var i=0;i<t.length;i++)if("3"===t[i].statusCode){var s=this.getCurrentMetaData(t[i],null);s.file.statusCode="5",s.file.status=this.localizedTexts("fileUploadCancel"),this.updateMetaData(s),this.showHideUploadSpinner(t[i])}}else for(i=0;i<t.length;i++)"3"===t[i].statusCode&&(t[i].statusCode="5",t[i].status=this.localizedTexts("fileUploadCancel"),this.showHideUploadSpinner(t[i]))},s.prototype.showHideUploadSpinner=function(e){var s=this.getLiElement(e);if(!t.isNullOrUndefined(s)&&t.isNullOrUndefined(this.template)){var n=s.querySelector("."+Ht);i.createSpinner({target:n,width:"20px"}),i.showSpinner(n)}},Tt([t.Complex({saveUrl:"",removeUrl:""},$t)],s.prototype,"asyncSettings",void 0),Tt([t.Property(!1)],s.prototype,"sequentialUpload",void 0),Tt([t.Property({})],s.prototype,"htmlAttributes",void 0),Tt([t.Property("")],s.prototype,"cssClass",void 0),Tt([t.Property(!0)],s.prototype,"enabled",void 0),Tt([t.Property(null)],s.prototype,"template",void 0),Tt([t.Property(!0)],s.prototype,"multiple",void 0),Tt([t.Property(!0)],s.prototype,"autoUpload",void 0),Tt([t.Complex({},Gt)],s.prototype,"buttons",void 0),Tt([t.Property("")],s.prototype,"allowedExtensions",void 0),Tt([t.Property(0)],s.prototype,"minFileSize",void 0),Tt([t.Property(3e7)],s.prototype,"maxFileSize",void 0),Tt([t.Property(null)],s.prototype,"dropArea",void 0),Tt([t.Collection([{}],Yt)],s.prototype,"files",void 0),Tt([t.Property(!0)],s.prototype,"showFileList",void 0),Tt([t.Property(!1)],s.prototype,"directoryUpload",void 0),Tt([t.Property("Default")],s.prototype,"dropEffect",void 0),Tt([t.Event()],s.prototype,"created",void 0),Tt([t.Event()],s.prototype,"actionComplete",void 0),Tt([t.Event()],s.prototype,"rendering",void 0),Tt([t.Event()],s.prototype,"beforeUpload",void 0),Tt([t.Event()],s.prototype,"fileListRendering",void 0),Tt([t.Event()],s.prototype,"selected",void 0),Tt([t.Event()],s.prototype,"uploading",void 0),Tt([t.Event()],s.prototype,"success",void 0),Tt([t.Event()],s.prototype,"failure",void 0),Tt([t.Event()],s.prototype,"removing",void 0),Tt([t.Event()],s.prototype,"beforeRemove",void 0),Tt([t.Event()],s.prototype,"clearing",void 0),Tt([t.Event()],s.prototype,"progress",void 0),Tt([t.Event()],s.prototype,"change",void 0),Tt([t.Event()],s.prototype,"chunkSuccess",void 0),Tt([t.Event()],s.prototype,"chunkFailure",void 0),Tt([t.Event()],s.prototype,"chunkUploading",void 0),Tt([t.Event()],s.prototype,"canceling",void 0),Tt([t.Event()],s.prototype,"pausing",void 0),Tt([t.Event()],s.prototype,"resuming",void 0),s=Tt([t.NotifyPropertyChanges],s)}(t.Component),Qt=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)}}(),ei=function(e,t,i,s){var n,a=arguments.length,l=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(l=(a<3?n(l):a>3?n(t,i,l):n(t,i))||l);return a>3&&l&&Object.defineProperty(t,i,l),l},ti="e-ctrl-btn",ii="e-switch-ctrl-btn",si="e-value-switch-btn",ni="e-hide-hex-value",ai="e-hide-opacity",li="e-hide-switchable-value",ri="e-hide-value",oi="e-hide-valueswitcher",hi="e-hsv-color",di="e-selected-value",ui="e-mode-switch-btn",ci="e-nocolor-item",pi="e-opacity-value",mi="e-palette",fi="e-color-palette",vi="e-color-picker",gi="e-preview-container",yi="e-previous",bi="e-show-value",Ei="e-selected",Ci="e-split-preview",Si=["#000000","#f44336","#e91e63","#9c27b0","#673ab7","#2196f3","#03a9f4","#00bcd4","#009688","#ffeb3b","#ffffff","#ffebee","#fce4ec","#f3e5f5","#ede7f6","#e3f2fd","#e1f5fe","#e0f7fa","#e0f2f1","#fffde7","#f2f2f2","#ffcdd2","#f8bbd0","#e1bee7","#d1c4e9","#bbdefb","#b3e5fc","#b2ebf2","#b2dfdb","#fff9c4","#e6e6e6","#ef9a9a","#f48fb1","#ce93d8","#b39ddb","#90caf9","#81d4fa","#80deea","#80cbc4","#fff59d","#cccccc","#e57373","#f06292","#ba68c8","#9575cd","#64b5f6","#4fc3f7","#4dd0e1","#4db6ac","#fff176","#b3b3b3","#ef5350","#ec407a","#ab47bc","#7e57c2","#42a5f5","#29b6f6","#26c6da","#26a69a","#ffee58","#999999","#e53935","#d81b60","#8e24aa","#5e35b1","#1e88e5","#039be5","#00acc1","#00897b","#fdd835","#808080","#d32f2f","#c2185b","#7b1fa2","#512da8","#1976d2","#0288d1","#0097a7","#00796b","#fbc02d","#666666","#c62828","#ad1457","#6a1b9a","#4527a0","#1565c0","#0277bd","#00838f","#00695c","#f9a825","#4d4d4d","#b71c1c","#880e4f","#4a148c","#311b92","#0d47a1","#01579b","#006064","#004d40","#f57f17"],xi=function(n){function a(e,t){return n.call(this,e,t)||this}return Qt(a,n),a.prototype.preRender=function(){var e=this.element;this.formElement=t.closest(this.element,"form"),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this);this.l10n=new t.L10n("colorpicker",{Apply:"Apply",Cancel:"Cancel",ModeSwitcher:"Switch Mode"},this.locale),e.getAttribute("ejs-for")&&!e.getAttribute("name")&&e.setAttribute("name",e.id)},a.prototype.render=function(){this.initWrapper(),this.inline?this.createWidget():this.createSplitBtn(),this.enableOpacity||t.addClass([this.container.parentElement],ai),this.renderComplete()},a.prototype.initWrapper=function(){var e=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper"});this.element.parentNode.insertBefore(e,this.element),e.appendChild(this.element),t.attributes(this.element,{tabindex:"-1",spellcheck:"false"}),this.container=this.createElement("div",{className:"e-container"}),this.getWrapper().appendChild(this.container);var i=this.value?this.roundValue(this.value).toLowerCase():"#008000ff";this.noColor&&"Palette"===this.mode&&""===this.value&&(i="");var s=i.slice(0,7);t.isNullOrUndefined(this.initialInputValue)&&(this.initialInputValue=s),this.element.value=s,this.enableOpacity?this.setProperties({value:i},!0):this.setProperties({value:s},!0),this.enableRtl&&e.classList.add("e-rtl"),this.cssClass&&t.addClass([e],this.cssClass.split(" ")),this.tileRipple=t.rippleEffect(this.container,{selector:".e-tile"}),this.ctrlBtnRipple=t.rippleEffect(this.container,{selector:".e-btn"})},a.prototype.getWrapper=function(){return this.element.parentElement},a.prototype.createWidget=function(){"Palette"===this.mode?(this.createPalette(),this.inline||this.firstPaletteFocus()):(this.createPicker(),this.inline||this.getDragHandler().focus()),this.isRgb=!0,this.createInput(),this.createCtrlBtn(),this.disabled||this.wireEvents(),this.inline&&this.disabled&&this.toggleDisabled(!0),t.Browser.isDevice&&this.refreshPopupPos()},a.prototype.createSplitBtn=function(){var e=this,n=this.createElement("button",{className:"e-split-colorpicker"});this.getWrapper().appendChild(n),this.splitBtn=new s.SplitButton({iconCss:"e-selected-color",target:this.container,disabled:this.disabled,enableRtl:this.enableRtl,open:this.onOpen.bind(this),click:function(){e.trigger("change",{currentValue:{hex:e.value.slice(0,7),rgba:e.convertToRgbString(e.hexToRgb(e.value))},previousValue:{hex:null,rgba:null},value:e.value})}}),this.splitBtn.createElement=this.createElement,this.splitBtn.appendTo(n);var a=this.createElement("span",{className:Ci});t.select(".e-selected-color",n).appendChild(a),a.style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value));var l=this.getPopupEle();if(t.addClass([l],"e-colorpicker-popup"),this.cssClass&&t.addClass([l],this.cssClass.split(" ")),t.Browser.isDevice){var r=this.getPopupInst();r.relateTo=document.body,r.position={X:"center",Y:"center"},r.targetType="container",r.collision={X:"fit",Y:"fit"},r.offsetY=4,l.style.zIndex=i.getZindexPartial(this.splitBtn.element).toString()}this.bindCallBackEvent()},a.prototype.onOpen=function(){this.trigger("open",{element:this.container})},a.prototype.getPopupInst=function(){return t.getInstance(this.getPopupEle(),i.Popup)},a.prototype.bindCallBackEvent=function(){var e=this;this.splitBtn.beforeOpen=function(i){var n=new s.Deferred;return e.trigger("beforeOpen",i,function(s){if(!s.cancel){var a=e.getPopupEle();a.style.top=t.formatUnit(0+pageYOffset),a.style.left=t.formatUnit(0+pageXOffset),a.style.display="block",e.createWidget(),a.style.display="",t.Browser.isDevice&&(e.modal=e.createElement("div"),e.modal.className="e-"+e.getModuleName()+" e-modal",e.modal.style.display="none",document.body.insertBefore(e.modal,a),document.body.className+=" e-colorpicker-overflow",e.modal.style.display="block",e.modal.style.zIndex=(Number(a.style.zIndex)-1).toString())}i.cancel=s.cancel,n.resolve(s)}),n},this.splitBtn.beforeClose=function(i){var n=new s.Deferred;if(t.isNullOrUndefined(i.event))n.resolve(i);else{var a={element:e.container,event:i.event,cancel:!1};e.trigger("beforeClose",a,function(s){t.Browser.isDevice&&i.event.target===e.modal&&(s.cancel=!0),s.cancel||e.onPopupClose(),i.cancel=s.cancel,n.resolve(s)})}return n}},a.prototype.onPopupClose=function(){this.unWireEvents(),this.destroyOtherComp(),this.container.style.width="",t.select("."+Ci,this.splitBtn.element).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value)),this.container.innerHTML="",t.removeClass([this.container],[vi,fi]),t.Browser.isDevice&&this.modal&&(t.removeClass([document.body],"e-colorpicker-overflow"),this.modal.style.display="none",this.modal.outerHTML="",this.modal=null)},a.prototype.createPalette=function(){if(t.classList(this.container,[fi],[vi]),this.presetColors){var e=this.createElement("div",{className:"e-custom-palette"});this.appendElement(e);var i=Object.keys(this.presetColors);if(1===i.length)this.appendPalette(this.presetColors[i[0]],i[0],e);else for(var s=0,n=i.length;s<n;s++)this.appendPalette(this.presetColors[i[s]],i[s],e);t.selectAll(".e-row",e).length>10&&t.addClass([e],"e-palette-group")}else this.appendPalette(Si,"default");"Palette"===this.mode&&!this.modeSwitcher&&this.noColor&&this.setNoColor();var a=parseInt(getComputedStyle(this.container).borderBottomWidth,10);this.container.style.width=t.formatUnit(this.container.children[0].offsetWidth+a+a),this.rgb=this.hexToRgb(this.roundValue(this.value)),this.hsv=this.rgbToHsv.apply(this,this.rgb)},a.prototype.firstPaletteFocus=function(){t.select("."+Ei,this.container.children[0])||t.selectAll("."+mi,this.container)[0].focus()},a.prototype.appendPalette=function(e,t,i){var s=this.createElement("div",{className:mi,attrs:{tabindex:"0"}});i?i.appendChild(s):this.appendElement(s);for(var n,a,l,r=0,o=e.length;r<o;r++)0!==r&&r%this.columns!=0||(n=this.createElement("div",{className:"e-row",attrs:{role:"presentation"}}),s.appendChild(n)),l=this.roundValue(e[r]).toLowerCase(),a=this.createElement("span",{className:"e-tile",attrs:{role:"gridcell","aria-label":l,"aria-selected":"false"}}),this.trigger("beforeTileRender",{element:a,presetName:t,value:e[r]}),n.appendChild(a),this.value===l&&(this.addTileSelection(a),s.focus()),a.style.backgroundColor=this.convertToRgbString(this.hexToRgb(l))},a.prototype.setNoColor=function(){var e=this.container.querySelector(".e-row").children[0];e.classList.add(ci),this.value||(e.classList.add(Ei),t.closest(e,"."+mi).focus()),["aria-selected","aria-label"].forEach(function(t){e.removeAttribute(t)}),e.style.backgroundColor=""},a.prototype.appendElement=function(e,t){void 0===t&&(t=0);var i=this.container.children[t];i?this.container.insertBefore(e,i):this.container.appendChild(e)},a.prototype.addTileSelection=function(e){e.classList.add(Ei),e.setAttribute("aria-selected","true")},a.prototype.createPicker=function(){t.classList(this.container,[vi],[fi]);var e=this.createElement("div",{className:"e-hsv-container"});this.appendElement(e),e.appendChild(this.createElement("div",{className:hi}));var i=this.createElement("span",{className:"e-handler",attrs:{tabindex:"0"}});e.appendChild(i),this.rgb=this.hexToRgb(this.value),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.setHsvContainerBg(),this.setHandlerPosition(),this.createSlider(),this.createDragTooltip()},a.prototype.setHsvContainerBg=function(e){void 0===e&&(e=this.hsv[0]),this.getHsvContainer().style.backgroundColor=this.convertToRgbString(this.hsvToRgb(e,100,100,1))},a.prototype.getHsvContainer=function(){return t.select(".e-hsv-container",this.container)},a.prototype.setHandlerPosition=function(){var e=this.getDragHandler(),i=t.select("."+hi,this.container);this.enableRtl?e.style.left=t.formatUnit(i.offsetWidth*Math.abs(100-this.hsv[1])/100):e.style.left=t.formatUnit(i.offsetWidth*this.hsv[1]/100),e.style.top=t.formatUnit(i.offsetHeight*(100-this.hsv[2])/100)},a.prototype.createSlider=function(){var e=this.createElement("div",{className:"e-slider-preview"});this.appendElement(e,1),this.createPreview(e);var t=this.createElement("div",{className:"e-colorpicker-slider"});e.insertBefore(t,e.children[0]);var i=this.createElement("div",{className:"e-hue-slider"});t.appendChild(i),this.hueSlider=new yt({value:this.hsv[0],min:0,max:359,enableRtl:this.enableRtl,enabled:!this.disabled,change:this.hueChange.bind(this)}),this.hueSlider.createElement=this.createElement,this.hueSlider.appendTo(i),this.enableOpacity&&(i=this.createElement("div",{className:"e-opacity-slider"}),t.appendChild(i),this.createOpacitySlider(i))},a.prototype.createOpacitySlider=function(e){this.opacitySlider=new yt({value:100*this.rgb[3],min:0,max:100,enableRtl:this.enableRtl,enabled:!this.disabled,change:this.opacityChange.bind(this)}),this.opacitySlider.createElement=this.createElement,this.opacitySlider.appendTo(e);var t=this.createElement("div",{className:"e-opacity-empty-track"});e.appendChild(t),this.updateOpacitySliderBg()},a.prototype.updateOpacitySliderBg=function(){var e=this.enableRtl?"to left":"to right",i=t.select(".e-opacity-empty-track",this.opacitySlider.element);i&&(i.style.background="linear-gradient("+e+", rgba("+this.rgb.slice(0,3)+", 0) 0%, "+this.convertToRgbString(this.rgb.slice(0,3))+" 100%)")},a.prototype.hueChange=function(e){this.hsv[0]=e.value,this.setHsvContainerBg(),this.convertToOtherFormat()},a.prototype.opacityChange=function(e){var t=e.value,i=this.rgbToHex(this.rgb);this.hsv[3]=t/100,this.rgb[3]=t/100;var s=this.rgbToHex(this.rgb);this.updateOpacityInput(t);var n=this.convertToRgbString(this.rgb);this.updatePreview(n),this.triggerEvent(s,i,n)},a.prototype.updateOpacityInput=function(e){if(this.enableOpacity&&!this.getWrapper().classList.contains(ri)){var i=t.getInstance(t.select("."+pi,this.container),G);i.value=e,i.dataBind()}},a.prototype.createPreview=function(e){var t=this.createElement("div",{className:gi});e.appendChild(t);var i=this.createElement("span",{className:"e-preview e-current"});t.appendChild(i);var s=this.convertToRgbString(this.rgb);i.style.backgroundColor=s,i=this.createElement("span",{className:"e-preview "+yi}),t.appendChild(i),i.style.backgroundColor=s},a.prototype.isPicker=function(){return!this.container.classList.contains(fi)},a.prototype.getPopupEle=function(){return this.container.parentElement},a.prototype.createNumericInput=function(e,t,i,s){var n=this,a=new G({value:t,placeholder:i,min:0,max:s,format:"###.##",showSpinButton:!1,floatLabelType:"Always",enableRtl:this.enableRtl,enabled:!this.disabled,readonly:!this.isPicker(),change:function(e){e.event&&n.inputHandler(e.event)}});a.createElement=this.createElement,a.appendTo(e)},a.prototype.createInput=function(){var t=this.isPicker(),i=this.getWrapper();if(t&&!i.classList.contains(ri)||!t&&i.classList.contains(bi)){var s=this.createElement("div",{className:di});t?this.appendElement(s,2):this.appendElement(s,1);var n=this.createElement("div",{className:"e-input-container"});if(s.appendChild(n),i.classList.contains(oi)||this.appendValueSwitchBtn(s),!i.classList.contains(ni)){var a=this.createElement("input",{className:"e-hex",attrs:{maxlength:"7",spellcheck:"false"}});n.appendChild(a),e.Input.createInput({element:a,floatLabelType:"Always",properties:{placeholder:"HEX",enableRtl:this.enableRtl,enabled:!this.disabled,readonly:!this.isPicker()}},this.createElement),e.Input.setValue(this.value.slice(0,7),a),a.addEventListener("input",this.inputHandler.bind(this))}if(!i.classList.contains(li)){var l=void 0,r=void 0;this.isRgb?(l="RGB",r=this.rgb):(l="HSV",r=this.hsv);for(var o=["rh","gs","bv"],h=0;h<3;h++)this.createNumericInput(n.appendChild(this.createElement("input",{className:"e-"+o[h]+"-value"})),r[h],l[h],255);this.enableOpacity&&this.appendOpacityValue(n)}}},a.prototype.appendOpacityValue=function(e){this.createNumericInput(e.appendChild(this.createElement("input",{className:pi})),100*this.rgb[3],"A",100)},a.prototype.appendValueSwitchBtn=function(e){var t=this.createElement("button",{className:"e-icons e-css e-btn e-flat e-icon-btn "+si});e.appendChild(t),this.isPicker()&&!this.getWrapper().classList.contains(li)&&t.addEventListener("click",this.formatSwitchHandler.bind(this))},a.prototype.createCtrlBtn=function(){if(this.modeSwitcher||this.showButtons){this.l10n.setLocale(this.locale);var e=this.createElement("div",{className:ii});if(this.container.appendChild(e),this.showButtons){var t=this.createElement("div",{className:ti});e.appendChild(t);var i=this.l10n.getConstant("Apply");t.appendChild(this.createElement("button",{innerHTML:i,className:"e-btn e-css e-flat e-primary e-small e-apply",attrs:{title:i}}));var s=this.l10n.getConstant("Cancel");t.appendChild(this.createElement("button",{innerHTML:s,className:"e-btn e-css e-flat e-small e-cancel",attrs:{title:s}}))}this.modeSwitcher&&this.appendModeSwitchBtn()}},a.prototype.appendModeSwitchBtn=function(){var e=this.createElement("button",{className:"e-icons e-btn e-flat e-icon-btn "+ui,attrs:{title:this.l10n.getConstant("ModeSwitcher")}});t.select("."+ii,this.container).insertBefore(e,t.select("."+ti,this.container))},a.prototype.createDragTooltip=function(){var e=this,s=new i.Tooltip({opensOn:"Custom",showTipPointer:!1,cssClass:"e-color-picker-tooltip",beforeOpen:function(t){e.tooltipEle=t.element},animation:{open:{effect:"None"},close:{effect:"None"}}});s.createElement=this.createElement,s.appendTo(this.container),s.open(this.container),this.tooltipEle.style.zIndex=i.getZindexPartial(this.tooltipEle).toString(),t.select(".e-tip-content",this.tooltipEle).appendChild(this.createElement("div",{className:"e-tip-transparent"}))},a.prototype.getTooltipInst=function(){return t.getInstance(this.container,i.Tooltip)},a.prototype.setTooltipOffset=function(e){this.getTooltipInst().offsetY=e},a.prototype.toggleDisabled=function(e){e?this.getWrapper().classList.add("e-disabled"):this.getWrapper().classList.remove("e-disabled"),this.showButtons&&[].slice.call(t.selectAll(".e-btn",this.container)).forEach(function(i){e?t.attributes(i,{disabled:""}):i.removeAttribute("disabled")})},a.prototype.convertToRgbString=function(e){return e.length?4===e.length?"rgba("+e.join()+")":"rgb("+e.join()+")":""},a.prototype.convertToHsvString=function(e){return 4===e.length?"hsva("+e.join()+")":"hsv("+e.join()+")"},a.prototype.updateHsv=function(){this.hsv[1]=this.hsv[1]>100?100:this.hsv[1],this.hsv[2]=this.hsv[2]>100?100:this.hsv[2],this.setHandlerPosition()},a.prototype.convertToOtherFormat=function(e){void 0===e&&(e=!1);var t=this.rgbToHex(this.rgb);this.rgb=this.hsvToRgb.apply(this,this.hsv);var i=this.rgbToHex(this.rgb),s=this.convertToRgbString(this.rgb);this.updatePreview(s),this.updateInput(i),this.triggerEvent(i,t,s,e)},a.prototype.updateInput=function(i){var s=this.getWrapper();s.classList.contains(ri)||(s.classList.contains(ni)||e.Input.setValue(i.substr(0,7),t.select(".e-hex",this.container)),s.classList.contains(li)||(this.isRgb?this.updateValue(this.rgb,!1):this.updateValue(this.hsv,!1)))},a.prototype.updatePreview=function(e){this.enableOpacity&&this.updateOpacitySliderBg(),t.select(".e-tip-transparent",this.tooltipEle).style.backgroundColor=e,t.select("."+gi+" .e-current",this.container).style.backgroundColor=e,t.select("."+gi+" ."+yi,this.container).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value))},a.prototype.getDragHandler=function(){return t.select(".e-handler",this.container)},a.prototype.removeTileSelection=function(){[].slice.call(t.selectAll("."+Ei,this.container.children[0])).forEach(function(e){e.classList.remove(Ei),e.setAttribute("aria-selected","false")})},a.prototype.convertRgbToNumberArray=function(e){return e.slice(e.indexOf("(")+1,e.indexOf(")")).split(",").map(function(e,t){return 3!==t?parseInt(e,10):parseFloat(e)})},a.prototype.getValue=function(e,t){if(e||(e=this.value),t=t?t.toLowerCase():"hex","r"===e[0]){var i=this.convertRgbToNumberArray(e);if("hex"===t||"hexa"===t){var s=this.rgbToHex(i);return"hex"===t?s.slice(0,7):s}return"hsv"===t?this.convertToHsvString(this.rgbToHsv.apply(this,i.slice(0,3))):"hsva"===t?this.convertToHsvString(this.rgbToHsv.apply(this,i)):"null"}if("h"===e[0]){i=this.hsvToRgb.apply(this,this.convertRgbToNumberArray(e));if("rgba"===t)return this.convertToRgbString(i);if("hex"===t||"hexa"===t){s=this.rgbToHex(i);return"hex"===t?s.slice(0,7):s}return"rgb"===t?this.convertToRgbString(i.slice(0,3)):"null"}e=this.roundValue(e);var n=this.hexToRgb(e);return"rgb"!==t&&"hsv"!==t||(n=n.slice(0,3)),"rgba"===t||"rgb"===t?this.convertToRgbString(n):"hsva"===t||"hsv"===t?this.convertToHsvString(this.rgbToHsv.apply(this,n)):"hex"===t?e.slice(0,7):"a"===t?n[3].toString():"null"},a.prototype.toggle=function(){this.container.parentElement.classList.contains("e-popup-close")?this.splitBtn.toggle():this.closePopup(null)},a.prototype.getModuleName=function(){return"colorpicker"},a.prototype.getPersistData=function(){return this.addOnPersist(["value"])},a.prototype.wireEvents=function(){if(this.isPicker()){var e=this.getDragHandler();t.EventHandler.add(e,"keydown",this.pickerKeyDown,this),t.EventHandler.add(this.getHsvContainer(),"mousedown touchstart",this.handlerDown,this),(this.modeSwitcher||this.showButtons)&&this.addCtrlSwitchEvent(),t.EventHandler.add(t.select("."+yi,this.container),"click",this.previewHandler,this)}else t.EventHandler.add(this.container,"click",this.paletteClickHandler,this),t.EventHandler.add(this.container,"keydown",this.paletteKeyDown,this)},a.prototype.formResetHandler=function(){this.value=this.initialInputValue,t.attributes(this.element,{value:this.initialInputValue})},a.prototype.addCtrlSwitchEvent=function(){var e=t.select("."+ii,this.container);e&&t.EventHandler.add(e,"click",this.btnClickHandler,this)},a.prototype.pickerKeyDown=function(e){switch(e.keyCode){case 39:this.handlerDragPosition(1,this.enableRtl?-1:1,e);break;case 37:this.handlerDragPosition(1,this.enableRtl?1:-1,e);break;case 38:this.handlerDragPosition(2,1,e);break;case 40:this.handlerDragPosition(2,-1,e);break;case 13:e.preventDefault();var t=this.rgbToHex(this.rgb);this.enterKeyHandler(t,e)}},a.prototype.enterKeyHandler=function(e,t){this.triggerChangeEvent(e),this.inline||(this.closePopup(t),this.splitBtn.element.focus())},a.prototype.closePopup=function(e){var t=this,i={element:this.container,event:e,cancel:!1};this.trigger("beforeClose",i,function(e){e.cancel||(t.splitBtn.toggle(),t.onPopupClose())})},a.prototype.triggerChangeEvent=function(e){var t=e.slice(0,7);this.trigger("change",{currentValue:{hex:t,rgba:this.convertToRgbString(this.rgb)},previousValue:{hex:this.value.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(this.value))},value:this.enableOpacity?e:t}),this.enableOpacity?this.setProperties({value:e},!0):this.setProperties({value:t},!0),this.element.value=t||"#000000"},a.prototype.handlerDragPosition=function(e,t,i){i.preventDefault(),this.hsv[e]+=t*(i.ctrlKey?1:3),this.hsv[e]<0&&(this.hsv[e]=0),this.updateHsv(),this.convertToOtherFormat(!0)},a.prototype.handlerDown=function(e){e.preventDefault(),"mousedown"===e.type?(this.clientX=Math.abs(e.pageX-pageXOffset),this.clientY=Math.abs(e.pageY-pageYOffset),this.setTooltipOffset(8)):(this.clientX=Math.abs(e.changedTouches[0].pageX-pageXOffset),this.clientY=Math.abs(e.changedTouches[0].pageY-pageYOffset),this.setTooltipOffset(-8)),this.setHsv(this.clientX,this.clientY),this.getDragHandler().style.transition="left .4s cubic-bezier(.25, .8, .25, 1), top .4s cubic-bezier(.25, .8, .25, 1)",this.updateHsv(),this.convertToOtherFormat(),this.getDragHandler().focus(),t.EventHandler.add(document,"mousemove touchmove",this.handlerMove,this),t.EventHandler.add(document,"mouseup touchend",this.handlerEnd,this)},a.prototype.handlerMove=function(e){"touchmove"!==e.type&&e.preventDefault();var i,s;"mousemove"===e.type?(i=Math.abs(e.pageX-pageXOffset),s=Math.abs(e.pageY-pageYOffset)):(i=Math.abs(e.changedTouches[0].pageX-pageXOffset),s=Math.abs(e.changedTouches[0].pageY-pageYOffset)),this.setHsv(i,s);var n=this.getDragHandler();this.updateHsv(),this.convertToOtherFormat(),this.getTooltipInst().refresh(n),this.tooltipEle.style.transform||(Math.abs(this.clientX-i)>8||Math.abs(this.clientY-s)>8)&&(t.select("."+hi,this.container).style.cursor="pointer",n.style.transition="none",this.inline||(this.tooltipEle.style.zIndex=(parseInt(this.getPopupEle().style.zIndex,10)+1).toString()),this.tooltipEle.style.transform="rotate(45deg)",n.classList.add("e-hide-handler"))},a.prototype.setHsv=function(e,i){var s=t.select("."+hi,this.container),n=s.getBoundingClientRect();e=this.enableRtl?e>n.right?0:Math.abs(e-n.right):e>n.left?Math.abs(e-n.left):0,i=i>n.top?Math.abs(i-n.top):0,this.hsv[2]=Math.round(10*Number(100*(s.offsetHeight-Math.max(0,Math.min(s.offsetHeight,i-s.offsetTop)))/s.offsetHeight))/10,this.hsv[1]=Math.round(10*Number(100*Math.max(0,Math.min(s.offsetWidth,e-s.offsetLeft))/s.offsetWidth))/10},a.prototype.handlerEnd=function(e){"touchend"!==e.type&&e.preventDefault(),t.EventHandler.remove(document,"mousemove touchmove",this.handlerMove),t.EventHandler.remove(document,"mouseup touchend",this.handlerEnd);var i=this.getDragHandler();t.select("."+hi,this.container).style.cursor="",this.tooltipEle.style.transform&&(this.tooltipEle.style.transform="",i.classList.remove("e-hide-handler")),this.inline||this.showButtons||this.closePopup(e)},a.prototype.btnClickHandler=function(e){var i=e.target;t.closest(i,"."+ui)?(e.stopPropagation(),this.switchToPalette()):(i.classList.contains("e-apply")||i.classList.contains("e-cancel"))&&this.ctrlBtnClick(i,e)},a.prototype.switchToPalette=function(){this.trigger("beforeModeSwitch",{element:this.container,mode:"Palette"}),this.unWireEvents(),this.destroyOtherComp(),t.detach(t.select(".e-slider-preview",this.container)),this.getWrapper().classList.contains(ri)||t.remove(t.select("."+di,this.container)),t.detach(this.getHsvContainer()),this.createPalette(),this.firstPaletteFocus(),this.createInput(),this.refreshPopupPos(),this.wireEvents(),this.trigger("onModeSwitch",{element:this.container,mode:"Palette"})},a.prototype.refreshPopupPos=function(){if(!this.inline){var e=this.getPopupEle();e.style.left=t.formatUnit(0+pageXOffset),e.style.top=t.formatUnit(0+pageYOffset),this.getPopupInst().refreshPosition(this.splitBtn.element.parentElement)}},a.prototype.formatSwitchHandler=function(){this.isRgb?(this.updateValue(this.hsv,!0,3,[360,100,100]),this.isRgb=!1):(this.updateValue(this.rgb,!0,2),this.isRgb=!0)},a.prototype.updateValue=function(e,i,s,n){for(var a,l=["e-rh-value","e-gs-value","e-bv-value"],r=0,o=l.length;r<o;r++)(a=t.getInstance(t.select("."+l[r],this.container),G)).value=Math.round(e[r]),i&&(a.placeholder=l[r].substr(s,1).toUpperCase(),a.max=n?n[r]:255),a.dataBind()},a.prototype.previewHandler=function(e){var i=e.target,s=this.rgbToHex(this.rgb);this.rgb=this.convertRgbToNumberArray(i.style.backgroundColor),this.rgb[3]||(this.rgb[3]=1);var n=this.rgbToHex(this.rgb),a=this.rgbToHsv.apply(this,this.rgb);a[0]!==this.hsv[0]&&(this.hueSlider.setProperties({value:a[0]},!0),this.hueSlider.refresh()),this.setHsvContainerBg(a[0]),this.enableOpacity&&a[3]!==this.hsv[3]&&(this.opacitySlider.setProperties({value:100*a[3]},!0),this.opacitySlider.refresh(),this.updateOpacitySliderBg()),this.hsv=a,this.setHandlerPosition(),this.updateInput(n),t.select("."+gi+" .e-current",this.container).style.backgroundColor=this.convertToRgbString(this.rgb),this.triggerEvent(n,s,this.convertToRgbString(this.rgb))},a.prototype.paletteClickHandler=function(e){e.preventDefault();var i=e.target;if(i.classList.contains("e-tile")){if(this.removeTileSelection(),this.addTileSelection(i),i.classList.contains(ci))this.noColorTile();else{var s=i.getAttribute("aria-label"),n=this.rgbToHex(this.rgb);this.rgb=this.hexToRgb(this.roundValue(s)),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.getWrapper().classList.contains(bi)&&this.updateInput(s),this.triggerEvent(s,n,this.convertToRgbString(this.rgb))}this.inline||this.showButtons||this.closePopup(e)}else t.closest(i,"."+ui)?this.switchToPicker():i.classList.contains("e-apply")||i.classList.contains("e-cancel")?this.ctrlBtnClick(i,e):this.getWrapper().classList.contains(bi)&&t.closest(i,"."+si)&&this.formatSwitchHandler()},a.prototype.noColorTile=function(e){void 0===e&&(e=!1);var t=this.rgbToHex(this.rgb);this.rgb=[],this.hsv=[],this.triggerEvent("",t,"",e)},a.prototype.switchToPicker=function(){var e=this.getWrapper();this.trigger("beforeModeSwitch",{element:this.container,mode:"Picker"}),this.unWireEvents(),[].slice.call(t.selectAll("."+mi,this.container)).forEach(function(e){t.detach(e)}),e.classList.contains(bi)&&t.detach(t.select("."+di,this.container)),this.container.style.width="";var i=t.select(".e-custom-palette",this.container);this.presetColors&&t.remove(i),this.createPicker(),this.getDragHandler().focus(),this.createInput(),this.refreshPopupPos(),this.wireEvents(),this.trigger("onModeSwitch",{element:this.container,mode:"Picker"})},a.prototype.ctrlBtnClick=function(e,t){if(e.classList.contains("e-apply")){var i=this.rgbToHex(this.rgb);this.triggerChangeEvent(i)}this.inline||(this.closePopup(t),this.splitBtn.element.focus())},a.prototype.paletteKeyDown=function(e){var i=e.target;if(i.classList.contains(mi)){var s,n,a=[].slice.call(t.selectAll(".e-tile",i)),l=a.filter(function(e){return e.classList.contains("e-selected")}).pop();switch(!e.altKey&&e.keyCode){case 39:e.preventDefault(),s=l?a[this.tilePosition(a,l,this.enableRtl?-1:1)]:a[this.enableRtl?a.length-1:0],this.keySelectionChanges(s);break;case 37:e.preventDefault(),s=l?a[this.tilePosition(a,l,this.enableRtl?1:-1)]:a[this.enableRtl?0:a.length-1],this.keySelectionChanges(s);break;case 38:e.preventDefault(),s=a[n=l?this.tilePosition(a,l,-this.columns):0]?a[n]:a[n-this.columns],this.keySelectionChanges(s);break;case 40:e.preventDefault(),a[n=l?this.tilePosition(a,l,this.columns):a.length-1]?s=a[n]:(n%=a.length,s=a[n+=a[a.length-1].parentElement.childElementCount]),this.keySelectionChanges(s);break;case 13:if(e.preventDefault(),l){var r=l.getAttribute("aria-label");this.enterKeyHandler(r||"",e)}}}},a.prototype.keySelectionChanges=function(e){if(this.removeTileSelection(),this.addTileSelection(e),e.classList.contains(ci))this.noColorTile(!0);else{var t=e.getAttribute("aria-label"),i=this.rgbToHex(this.rgb);this.rgb=this.hexToRgb(t),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.getWrapper().classList.contains(bi)&&this.updateInput(t),this.triggerEvent(t,i,this.convertToRgbString(this.rgb),!0)}},a.prototype.tilePosition=function(e,t,i){var s=(e=Array.prototype.slice.call(e)).length,n=this.columns-e[s-1].parentElement.childElementCount,a=e.indexOf(t);return(a+=i)<0?a+=s+n:a%=s+n,a},a.prototype.inputHandler=function(e){var i=e.target;if(i.value.length){var s,n;switch(t.select(".e-float-text",i.parentElement).textContent){case"HEX":var a="";if(("#"===i.value[0]&&5!==i.value.length||"#"!==i.value[0]&&4!==i.value.length)&&(a=this.roundValue(i.value)),9!==a.length)return;n=this.rgbToHex(this.rgb),this.rgb=this.hexToRgb(a+a.substr(-2)),this.inputValueChange(this.rgbToHsv.apply(this,this.rgb),n,i.value);break;case"R":this.rgb[0]!==Number(i.value)&&(n=this.rgbToHex(this.rgb),this.rgb[0]=Number(i.value),s=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(s,n));break;case"G":this.rgb[1]!==Number(i.value)&&(n=this.rgbToHex(this.rgb),this.rgb[1]=Number(i.value),s=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(s,n));break;case"B":this.rgb[2]!==Number(i.value)&&(n=this.rgbToHex(this.rgb),this.rgb[2]=Number(i.value),s=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(s,n));break;case"H":this.hueSlider.value=Number(i.value);break;case"S":this.hsv[1]!==Number(i.value)&&(this.hsv[1]=Number(i.value),this.updateHsv(),this.convertToOtherFormat());break;case"V":this.hsv[2]!==Number(i.value)&&(this.hsv[2]=Number(i.value),this.updateHsv(),this.convertToOtherFormat());break;case"A":this.opacitySlider.value=Number(i.value)}}},a.prototype.inputValueChange=function(e,t,i){e[0]!==this.hsv[0]&&(this.hueSlider.setProperties({value:e[0]},!0),this.hueSlider.refresh(),this.setHsvContainerBg(e[0])),this.hsv=e;var s=this.rgbToHex(this.rgb);this.setHandlerPosition(),this.updateInput(i||s);var n=this.convertToRgbString(this.rgb);this.updatePreview(n),this.triggerEvent(s,t,n)},a.prototype.triggerEvent=function(e,t,i,s){void 0===s&&(s=!1);var n=e.slice(0,7);this.showButtons||s?this.trigger("select",{currentValue:{hex:n,rgba:i},previousValue:{hex:t.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(t))}}):(this.trigger("change",{currentValue:{hex:n,rgba:i},previousValue:{hex:this.value.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(this.value))},value:e}),this.setProperties({value:e},!0),this.element.value=n||"#000000")},a.prototype.destroy=function(){var e=this,i=this.getWrapper();n.prototype.destroy.call(this),["tabindex","spellcheck"].forEach(function(t){e.element.removeAttribute(t)}),this.inline?(this.unWireEvents(),this.destroyOtherComp()):(this.isPopupOpen()&&(this.unWireEvents(),this.destroyOtherComp()),this.splitBtn.destroy(),this.splitBtn=null),this.tileRipple(),this.tileRipple=null,this.ctrlBtnRipple(),this.ctrlBtnRipple=null,this.element.nextElementSibling&&t.detach(this.element.nextElementSibling),i&&(i.parentElement.insertBefore(this.element,i),t.detach(i)),this.container=null,this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},a.prototype.destroyOtherComp=function(){if(this.isPicker()){this.hueSlider.destroy(),this.enableOpacity&&(this.opacitySlider.destroy(),this.opacitySlider=null),this.hueSlider=null;var e=this.getTooltipInst();e.close(),e.destroy(),this.tooltipEle=null}},a.prototype.isPopupOpen=function(){return this.getPopupEle().classList.contains("e-popup-open")},a.prototype.unWireEvents=function(){if(this.isPicker()){var e=this.getDragHandler();t.EventHandler.remove(e,"keydown",this.pickerKeyDown),t.EventHandler.remove(this.getHsvContainer(),"mousedown touchstart",this.handlerDown),(this.modeSwitcher||this.showButtons)&&t.EventHandler.remove(t.select("."+ii,this.container),"click",this.btnClickHandler),t.EventHandler.remove(t.select("."+yi,this.container),"click",this.previewHandler)}else t.EventHandler.remove(this.container,"click",this.paletteClickHandler),t.EventHandler.remove(this.container,"keydown",this.paletteKeyDown)},a.prototype.roundValue=function(e){if(!e)return"";"#"!==e[0]&&(e="#"+e);var t=e.length;if(4===t&&(e+="f",t=5),5===t){for(var i="",s=1,n=e.length;s<n;s++)i+=e.charAt(s)+e.charAt(s);e="#"+i,t=9}return 7===t&&(e+="ff"),e},a.prototype.hexToRgb=function(e){if(!e)return[];9!==(e=e.trim()).length&&(e=this.roundValue(e));var t=Number((parseInt(e.slice(-2),16)/255).toFixed(2));e=e.slice(1,7);var i=parseInt(e,16),s=[];return s.push(i>>16&255),s.push(i>>8&255),s.push(255&i),s.push(t),s},a.prototype.rgbToHsv=function(e,i,s,n){if(this.rgb&&!this.rgb.length)return[];e/=255,i/=255,s/=255;var a,l=Math.max(e,i,s),r=Math.min(e,i,s),o=l,h=l-r,d=0===l?0:h/l;if(l===r)a=0;else{switch(l){case e:a=(i-s)/h+(i<s?6:0);break;case i:a=(s-e)/h+2;break;case s:a=(e-i)/h+4}a/=6}var u=[Math.round(360*a),Math.round(1e3*d)/10,Math.round(1e3*o)/10];return t.isNullOrUndefined(n)||u.push(n),u},a.prototype.hsvToRgb=function(e,i,s,n){var a,l,r;if(i/=100,s/=100,0===i)return a=l=r=s,[Math.round(255*a),Math.round(255*l),Math.round(255*r),n];e/=60;var o=Math.floor(e),h=e-o,d=s*(1-i),u=s*(1-i*h),c=s*(1-i*(1-h));switch(o){case 0:a=s,l=c,r=d;break;case 1:a=u,l=s,r=d;break;case 2:a=d,l=s,r=c;break;case 3:a=d,l=u,r=s;break;case 4:a=c,l=d,r=s;break;default:a=s,l=d,r=u}var p=[Math.round(255*a),Math.round(255*l),Math.round(255*r)];return t.isNullOrUndefined(n)||p.push(n),p},a.prototype.rgbToHex=function(e){return e.length?"#"+this.hex(e[0])+this.hex(e[1])+this.hex(e[2])+(t.isNullOrUndefined(e[3])?"":0!==e[3]?(Math.round(255*e[3])+65536).toString(16).substr(-2):"00"):""},a.prototype.hex=function(e){return("0"+e.toString(16)).slice(-2)},a.prototype.changeModeSwitcherProp=function(e){var i=t.select("."+ii,this.container);e?i?this.appendModeSwitchBtn():(this.createCtrlBtn(),this.isPicker()&&!this.disabled&&this.addCtrlSwitchEvent()):i&&(this.showButtons?t.detach(t.select("."+ui,i)):t.remove(i))},a.prototype.changeShowBtnProps=function(e){var i=t.select("."+ii,this.container);e?(i&&t.remove(i),this.createCtrlBtn(),this.isPicker()&&!this.disabled&&this.addCtrlSwitchEvent()):this.modeSwitcher?t.detach(t.select("."+ti,i)):t.remove(i)},a.prototype.changeValueProp=function(e){if(this.isPicker())this.rgb=this.hexToRgb(e),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.setHandlerPosition(),t.detach(t.closest(this.hueSlider.element,".e-slider-preview")),this.createSlider(),this.setHsvContainerBg(),this.updateInput(e),4===this.rgb.length&&this.updateOpacityInput(100*this.rgb[3]);else{this.removeTileSelection();var i=this.container.querySelector('span[aria-label="'+this.roundValue(e)+'"]');i&&this.addTileSelection(i)}},a.prototype.setInputEleProps=function(){t.remove(t.select("."+di,this.container)),this.createInput()},a.prototype.changeDisabledProp=function(e){this.isPicker()&&(this.hueSlider.enabled=!e,this.opacitySlider.enabled=!e,this.setInputEleProps()),e?(this.toggleDisabled(!0),this.unWireEvents()):(this.toggleDisabled(!1),this.wireEvents())},a.prototype.changeCssClassProps=function(e,i){var s=this.getWrapper(),n=this.getPopupEle();i&&t.removeClass([s,n],i.split(" ")),e&&t.addClass([s,n],e.split(" "))},a.prototype.changeRtlProps=function(e){e?t.addClass([this.getWrapper()],"e-rtl"):t.removeClass([this.getWrapper()],"e-rtl")},a.prototype.changePaletteProps=function(){t.detach(this.container.children[0]),this.container.style.width="",this.createPalette()},a.prototype.changeOpacityProps=function(e){var i=this.getWrapper();e?(t.removeClass([this.container.parentElement],ai),this.createOpacitySlider(t.select(".e-colorpicker-slider",this.container).appendChild(this.createElement("div",{className:"e-opacity-slider"}))),i.classList.contains(ri)||i.classList.contains(li)||this.appendOpacityValue(t.select(".e-input-container",this.container))):(t.addClass([this.container.parentElement],ai),this.opacitySlider.destroy(),t.remove(this.opacitySlider.element),this.opacitySlider=null,i.classList.contains(ri)||i.classList.contains(li)||t.remove(t.select("."+pi,this.container).parentElement))},a.prototype.onPropertyChanged=function(e,i){var n=this;if(!t.isNullOrUndefined(e.value)){var a=this.roundValue(e.value);if(9===a.length){this.element.value=this.roundValue(a).slice(0,7);var l=this.splitBtn&&t.select("."+Ci,this.splitBtn.element);l&&(l.style.backgroundColor=this.convertToRgbString(this.hexToRgb(e.value)))}else this.value=i.value}if(!this.inline&&t.isNullOrUndefined(e.inline)){if(this.splitBtn.setProperties(s.getModel(e,["disabled","enableRtl"])),!this.isPopupOpen())return this.changeCssClassProps(e.cssClass,i.cssClass),void this.changeRtlProps(e.enableRtl)}for(var r=function(s){switch(s){case"inline":e.inline?(o.getWrapper().appendChild(o.container),o.splitBtn.destroy(),t.detach(o.element.nextElementSibling),o.container.children.length||o.createWidget()):(o.destroyOtherComp(),o.unWireEvents(),o.container.innerHTML="",o.createSplitBtn());break;case"cssClass":o.changeCssClassProps(e.cssClass,i.cssClass);var a=e.cssClass.split(" ").concat(i.cssClass.split(" ")),l=0;(a=a.reduce(function(e,t){return e.indexOf(t)<0&&e.push(t),e},[])).forEach(function(e){if(0===l&&(e===ri||e===oi||e===bi||e===ni||e===li)){t.select("."+di,n.container)&&t.remove(t.select("."+di,n.container)),n.createInput(),l++}});break;case"enableRtl":o.isPicker()&&(o.hueSlider.enableRtl=e.enableRtl,o.enableOpacity&&(o.opacitySlider.enableRtl=e.enableRtl),o.setInputEleProps()),o.changeRtlProps(e.enableRtl);break;case"disabled":o.changeDisabledProp(e.disabled);break;case"value":o.value!==i.value&&o.changeValueProp(e.value);break;case"showButtons":o.changeShowBtnProps(e.showButtons);break;case"mode":"Picker"===e.mode?o.switchToPicker():o.switchToPalette();break;case"modeSwitcher":o.changeModeSwitcherProp(e.modeSwitcher);break;case"columns":case"presetColors":o.isPicker()||o.changePaletteProps();break;case"noColor":e.noColor?"Palette"!==o.mode||o.modeSwitcher||o.setNoColor():o.changePaletteProps();break;case"enableOpacity":o.changeOpacityProps(e.enableOpacity)}},o=this,h=0,d=Object.keys(e);h<d.length;h++){r(d[h])}},a.prototype.focusIn=function(){this.element.parentElement.focus()},ei([t.Property("#008000ff")],a.prototype,"value",void 0),ei([t.Property("")],a.prototype,"cssClass",void 0),ei([t.Property(!1)],a.prototype,"disabled",void 0),ei([t.Property("Picker")],a.prototype,"mode",void 0),ei([t.Property(!0)],a.prototype,"modeSwitcher",void 0),ei([t.Property(null)],a.prototype,"presetColors",void 0),ei([t.Property(!0)],a.prototype,"showButtons",void 0),ei([t.Property(10)],a.prototype,"columns",void 0),ei([t.Property(!1)],a.prototype,"inline",void 0),ei([t.Property(!1)],a.prototype,"noColor",void 0),ei([t.Property(!1)],a.prototype,"enablePersistence",void 0),ei([t.Property(!0)],a.prototype,"enableOpacity",void 0),ei([t.Event()],a.prototype,"select",void 0),ei([t.Event()],a.prototype,"change",void 0),ei([t.Event()],a.prototype,"beforeTileRender",void 0),ei([t.Event()],a.prototype,"beforeOpen",void 0),ei([t.Event()],a.prototype,"open",void 0),ei([t.Event()],a.prototype,"beforeClose",void 0),ei([t.Event()],a.prototype,"beforeModeSwitch",void 0),ei([t.Event()],a.prototype,"onModeSwitch",void 0),ei([t.Event()],a.prototype,"created",void 0),a=ei([t.NotifyPropertyChanges],a)}(t.Component),Ti=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)}}(),ki=function(e,t,i,s){var n,a=arguments.length,l=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(l=(a<3?n(l):a>3?n(t,i,l):n(t,i))||l);return a>3&&l&&Object.defineProperty(t,i,l),l},Oi=["title","style","class"],Pi=function(i){function s(e,t){var s=i.call(this,e,t)||this;return s.previousValue=null,s.isAngular=!1,s.isHiddenInput=!1,s.isForm=!1,s.inputPreviousValue=null,s.isVue=!1,s.textboxOptions=e,s}return Ti(s,i),s.prototype.onPropertyChanged=function(i,s){for(var n=0,a=Object.keys(i);n<a.length;n++){switch(a[n]){case"floatLabelType":e.Input.removeFloating(this.textboxWrapper),e.Input.addFloating(this.respectiveElement,this.floatLabelType,this.placeholder);break;case"enabled":e.Input.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container),this.bindClearEvent();break;case"width":e.Input.setWidth(i.width,this.textboxWrapper.container);break;case"value":var l=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.isBlank(this.value)||(this.value=this.value.toString()),this.isProtectedOnChange=l,e.Input.setValue(this.value,this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value),this.inputPreviousValue=this.respectiveElement.value,(this.isAngular||this.isVue)&&!0===this.preventChange?(this.previousValue=this.isAngular?this.value:this.previousValue,this.preventChange=!1):(t.isNullOrUndefined(this.isAngular)||!this.isAngular||this.isAngular&&!this.preventChange||this.isAngular&&t.isNullOrUndefined(this.preventChange))&&this.raiseChangeEvent();break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.checkAttributes(!0),e.Input.validateInputType(this.textboxWrapper.container,this.element);break;case"readonly":e.Input.setReadonly(this.readonly,this.respectiveElement);break;case"type":"TEXTAREA"!==this.respectiveElement.tagName&&(this.respectiveElement.setAttribute("type",this.type),e.Input.validateInputType(this.textboxWrapper.container,this.element),this.raiseChangeEvent());break;case"showClearButton":"TEXTAREA"!==this.respectiveElement.tagName&&(e.Input.setClearButton(this.showClearButton,this.respectiveElement,this.textboxWrapper),this.bindClearEvent());break;case"enableRtl":e.Input.setEnableRtl(this.enableRtl,[this.textboxWrapper.container]);break;case"placeholder":e.Input.setPlaceholder(this.placeholder,this.respectiveElement);break;case"autocomplete":"on"!==this.autocomplete&&""!==this.autocomplete?this.respectiveElement.autocomplete=this.autocomplete:this.removeAttributes(["autocomplete"]);break;case"cssClass":this.updateCssClass(i.cssClass,s.cssClass);break;case"locale":this.globalize=new t.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),e.Input.setPlaceholder(this.placeholder,this.respectiveElement)}}},s.prototype.getModuleName=function(){return"textbox"},s.prototype.isBlank=function(e){return!e||/^\s*$/.test(e)},s.prototype.preRender=function(){if(!t.isBlazor()||!this.isServerRendered){if(this.cloneElement=this.element.cloneNode(!0),this.formElement=t.closest(this.element,"form"),t.isNullOrUndefined(this.formElement)||(this.isForm=!0),"EJS-TEXTBOX"===this.element.tagName){for(var e=t.getValue("ej2_instances",this.element),i=this.multiline?this.createElement("textarea"):this.createElement("input"),s=0;s<this.element.attributes.length;s++){"id"!==(l=this.element.attributes[s].nodeName)&&(i.setAttribute(l,this.element.attributes[s].nodeValue),i.innerHTML=this.element.innerHTML,"name"===l&&this.element.removeAttribute("name"))}this.element.appendChild(i),this.element=i,t.setValue("ej2_instances",e,this.element)}this.updateHTMLAttrToElement(),this.checkAttributes(!1),"TEXTAREA"!==this.element.tagName&&this.element.setAttribute("type",this.type),this.element.setAttribute("role","textbox"),this.globalize=new t.Internationalization(this.locale);var n={placeholder:this.placeholder};if(this.l10n=new t.L10n("textbox",n,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.element.hasAttribute("id")||this.element.setAttribute("id",t.getUniqueID("textbox")),this.element.hasAttribute("name")||this.element.setAttribute("name",this.element.getAttribute("id")),"INPUT"===this.element.tagName&&this.multiline){this.isHiddenInput=!0,this.textarea=this.createElement("textarea"),this.element.parentNode.insertBefore(this.textarea,this.element),this.element.setAttribute("type","hidden"),this.textarea.setAttribute("name",this.element.getAttribute("name")),this.element.removeAttribute("name"),this.textarea.setAttribute("role",this.element.getAttribute("role")),this.element.removeAttribute("role"),this.textarea.setAttribute("id",t.getUniqueID("textarea"));var a=["placeholder","disabled","value","readonly","type","autocomplete"];for(s=0;s<this.element.attributes.length;s++){var l=this.element.attributes[s].nodeName;this.element.hasAttribute(l)&&Oi.indexOf(l)<0&&"id"!==l&&"type"!==l&&"e-mappinguid"!==l&&(this.textarea.setAttribute(l,this.element.attributes[s].nodeValue),a.indexOf(l)<0&&(this.element.removeAttribute(l),s--))}}}},s.prototype.checkAttributes=function(e){for(var i=0,s=e?t.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly","type","autocomplete"];i<s.length;i++){var n=s[i];if(!t.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"disabled":if(t.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.enabled||e){var a="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n);this.setProperties({enabled:a},!e)}break;case"readonly":if(t.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.readonly||e){var l="readonly"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n);this.setProperties({readonly:l},!e)}break;case"placeholder":(t.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.placeholder||e)&&this.setProperties({placeholder:this.element.placeholder},!e);break;case"autocomplete":if(t.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.autocomplete||e){var r="off"===this.element.autocomplete?"off":"on";this.setProperties({autocomplete:r},!e)}break;case"value":(t.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.value||e)&&this.setProperties({value:this.element.value},!e);break;case"type":(t.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.type||e)&&this.setProperties({type:this.element.type},!e)}}},s.prototype.render=function(){var i=this.cssClass;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(i=this.getInputValidClassList(this.cssClass)),t.isBlazor()&&this.isServerRendered?(this.respectiveElement=this.element,this.textboxWrapper={container:this.element.parentElement},this.showClearButton&&!this.multiline&&(this.textboxWrapper.clearButton=this.textboxWrapper.container.querySelector(".e-clear-icon"),e.Input.wireClearBtnEvents(this.respectiveElement,this.textboxWrapper.clearButton,this.textboxWrapper.container)),"Auto"===this.floatLabelType&&e.Input.wireFloatingEvents(this.respectiveElement),e.Input.bindInitialEvent({element:this.respectiveElement,buttons:null,customTag:null,floatLabelType:this.floatLabelType,properties:this.properties})):(this.respectiveElement=this.isHiddenInput?this.textarea:this.element,this.textboxWrapper=e.Input.createInput({element:this.respectiveElement,floatLabelType:this.floatLabelType,properties:{enabled:this.enabled,enableRtl:this.enableRtl,cssClass:i,readonly:this.readonly,placeholder:this.placeholder,showClearButton:this.showClearButton}}),this.updateHTMLAttrToWrapper(),this.isHiddenInput&&this.respectiveElement.parentNode.insertBefore(this.element,this.respectiveElement)),this.wireEvents(),t.isNullOrUndefined(this.value)||(e.Input.setValue(this.value,this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value)),t.isNullOrUndefined(this.value)||(this.initialValue=this.value,this.setInitialValue()),"on"!==this.autocomplete&&""!==this.autocomplete?this.respectiveElement.autocomplete=this.autocomplete:t.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.autocomplete||this.removeAttributes(["autocomplete"]),this.previousValue=this.value,this.inputPreviousValue=this.value,this.respectiveElement.defaultValue=this.respectiveElement.value,e.Input.setWidth(this.width,this.textboxWrapper.container),this.renderComplete()},s.prototype.updateHTMLAttrToWrapper=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if(Oi.indexOf(s)>-1)if("class"===s){var n=this.getInputValidClassList(this.htmlAttributes[s]);""!==n&&t.addClass([this.textboxWrapper.container],n.split(" "))}else if("style"===s){var a=this.textboxWrapper.container.getAttribute(s);a=t.isNullOrUndefined(a)?this.htmlAttributes[s]:a+this.htmlAttributes[s],this.textboxWrapper.container.setAttribute(s,a)}else this.textboxWrapper.container.setAttribute(s,this.htmlAttributes[s])}},s.prototype.updateHTMLAttrToElement=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];Oi.indexOf(s)<0&&this.element.setAttribute(s,this.htmlAttributes[s])}},s.prototype.updateCssClass=function(t,i){e.Input.setCssClass(this.getInputValidClassList(t),[this.textboxWrapper.container],this.getInputValidClassList(i))},s.prototype.getInputValidClassList=function(e){var i=e;return t.isNullOrUndefined(e)||""===e||(i=e.replace(/\s+/g," ").trim()),i},s.prototype.setInitialValue=function(){this.isAngular||this.respectiveElement.setAttribute("value",this.initialValue)},s.prototype.wireEvents=function(){t.EventHandler.add(this.respectiveElement,"focus",this.focusHandler,this),t.EventHandler.add(this.respectiveElement,"blur",this.focusOutHandler,this),t.EventHandler.add(this.respectiveElement,"input",this.inputHandler,this),t.EventHandler.add(this.respectiveElement,"change",this.changeHandler,this),this.isForm&&t.EventHandler.add(this.formElement,"reset",this.resetForm,this),this.bindClearEvent(),!t.isNullOrUndefined(this.textboxWrapper.container.querySelector(".e-float-text"))&&"Auto"===this.floatLabelType&&this.textboxWrapper.container.classList.contains("e-autofill")&&this.textboxWrapper.container.classList.contains("e-outline")&&t.EventHandler.add(this.textboxWrapper.container.querySelector(".e-float-text"),"animationstart",this.animationHandler,this)},s.prototype.animationHandler=function(){this.textboxWrapper.container.classList.add("e-valid-input");var e=this.textboxWrapper.container.querySelector(".e-float-text");t.isNullOrUndefined(e)||(e.classList.add("e-label-top"),e.classList.contains("e-label-bottom")&&e.classList.remove("e-label-bottom"))},s.prototype.resetValue=function(e){var t=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.value=e,this.isProtectedOnChange=t},s.prototype.resetForm=function(){if(this.isAngular?this.resetValue(""):this.resetValue(this.initialValue),!t.isNullOrUndefined(this.textboxWrapper)){var e=this.textboxWrapper.container.querySelector(".e-float-text");t.isNullOrUndefined(e)||(t.isNullOrUndefined(this.initialValue)||""===this.initialValue?(e.classList.add("e-label-bottom"),e.classList.remove("e-label-top")):""!==this.initialValue&&(e.classList.add("e-label-top"),e.classList.remove("e-label-bottom")))}},s.prototype.focusHandler=function(e){var t={container:this.textboxWrapper.container,event:e,value:this.value};this.trigger("focus",t)},s.prototype.focusOutHandler=function(e){null===this.previousValue&&null===this.value&&""===this.respectiveElement.value||this.previousValue===this.respectiveElement.value||this.raiseChangeEvent(e,!0);var t={container:this.textboxWrapper.container,event:e,value:this.value};this.trigger("blur",t)},s.prototype.inputHandler=function(e){var t={event:e,value:this.respectiveElement.value,previousValue:this.inputPreviousValue,container:this.textboxWrapper.container};this.inputPreviousValue=this.respectiveElement.value,this.isAngular&&(this.localChange({value:this.respectiveElement.value}),this.preventChange=!0),this.isVue&&(this.preventChange=!0),this.trigger("input",t),e.stopPropagation()},s.prototype.changeHandler=function(e){this.setProperties({value:this.respectiveElement.value},!0),this.raiseChangeEvent(e,!0),e.stopPropagation()},s.prototype.raiseChangeEvent=function(e,t){var i={event:e,value:this.value,previousValue:this.previousValue,container:this.textboxWrapper.container,isInteraction:t||!1,isInteracted:t||!1};this.preventChange=!1,this.trigger("change",i),this.previousValue=this.value},s.prototype.bindClearEvent=function(){this.showClearButton&&"TEXTAREA"!==this.respectiveElement.tagName&&(this.enabled?t.EventHandler.add(this.textboxWrapper.clearButton,"mousedown touchstart",this.resetInputHandler,this):t.EventHandler.remove(this.textboxWrapper.clearButton,"mousedown touchstart",this.resetInputHandler))},s.prototype.resetInputHandler=function(t){if(t.preventDefault(),!this.textboxWrapper.clearButton.classList.contains("e-clear-icon-hide")){e.Input.setValue("",this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value),this.setProperties({value:this.respectiveElement.value},!0);var i={event:t,value:this.respectiveElement.value,previousValue:this.inputPreviousValue,container:this.textboxWrapper.container};this.trigger("input",i),this.inputPreviousValue=this.respectiveElement.value,this.raiseChangeEvent(t,!0)}},s.prototype.unWireEvents=function(){t.EventHandler.remove(this.respectiveElement,"focus",this.focusHandler),t.EventHandler.remove(this.respectiveElement,"blur",this.focusOutHandler),t.EventHandler.remove(this.respectiveElement,"input",this.inputHandler),t.EventHandler.remove(this.respectiveElement,"change",this.changeHandler),this.isForm&&t.EventHandler.remove(this.formElement,"reset",this.resetForm),!t.isNullOrUndefined(this.textboxWrapper.container.querySelector(".e-float-text"))&&"Auto"===this.floatLabelType&&this.textboxWrapper.container.classList.contains("e-outline")&&this.textboxWrapper.container.classList.contains("e-autofill")&&t.EventHandler.remove(this.textboxWrapper.container.querySelector(".e-float-text"),"animationstart",this.animationHandler)},s.prototype.destroy=function(){this.unWireEvents(),t.isBlazor()&&this.isServerRendered?this.textboxWrapper=null:("INPUT"===this.element.tagName&&this.multiline&&(t.detach(this.textboxWrapper.container.getElementsByTagName("textarea")[0]),this.respectiveElement=this.element,this.element.removeAttribute("type")),this.respectiveElement.value=this.respectiveElement.defaultValue,this.respectiveElement.classList.remove("e-input"),this.removeAttributes(["aria-placeholder","aria-disabled","aria-readonly","aria-labelledby"]),t.isNullOrUndefined(this.textboxWrapper)||(this.textboxWrapper.container.insertAdjacentElement("afterend",this.respectiveElement),t.detach(this.textboxWrapper.container)),this.textboxWrapper=null,i.prototype.destroy.call(this))},s.prototype.addIcon=function(t,i){e.Input.addIcon(t,i,this.textboxWrapper.container,this.respectiveElement,this.createElement)},s.prototype.getPersistData=function(){return this.addOnPersist(["value"])},s.prototype.addAttributes=function(t){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i];"disabled"===n?(this.setProperties({enabled:!1},!0),e.Input.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container)):"readonly"===n?(this.setProperties({readonly:!0},!0),e.Input.setReadonly(this.readonly,this.respectiveElement)):"class"===n?this.respectiveElement.classList.add(t[n]):"placeholder"===n?(this.setProperties({placeholder:t[n]},!0),e.Input.setPlaceholder(this.placeholder,this.respectiveElement)):("rows"===n&&this.respectiveElement.tagName,this.respectiveElement.setAttribute(n,t[n]))}},s.prototype.removeAttributes=function(t){for(var i=0,s=t;i<s.length;i++){var n=s[i];"disabled"===n?(this.setProperties({enabled:!0},!0),e.Input.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container)):"readonly"===n?(this.setProperties({readonly:!1},!0),e.Input.setReadonly(this.readonly,this.respectiveElement)):"placeholder"===n?(this.setProperties({placeholder:null},!0),e.Input.setPlaceholder(this.placeholder,this.respectiveElement)):this.respectiveElement.removeAttribute(n)}},s.prototype.focusIn=function(){document.activeElement!==this.respectiveElement&&this.enabled&&(this.respectiveElement.focus(),(this.textboxWrapper.container.classList.contains("e-input-group")||this.textboxWrapper.container.classList.contains("e-outline")||this.textboxWrapper.container.classList.contains("e-filled"))&&t.addClass([this.textboxWrapper.container],["e-input-focus"]))},s.prototype.focusOut=function(){document.activeElement===this.respectiveElement&&this.enabled&&(this.respectiveElement.blur(),(this.textboxWrapper.container.classList.contains("e-input-group")||this.textboxWrapper.container.classList.contains("e-outline")||this.textboxWrapper.container.classList.contains("e-filled"))&&t.removeClass([this.textboxWrapper.container],["e-input-focus"]))},ki([t.Property("text")],s.prototype,"type",void 0),ki([t.Property(!1)],s.prototype,"readonly",void 0),ki([t.Property(null)],s.prototype,"value",void 0),ki([t.Property("Never")],s.prototype,"floatLabelType",void 0),ki([t.Property("")],s.prototype,"cssClass",void 0),ki([t.Property(null)],s.prototype,"placeholder",void 0),ki([t.Property("on")],s.prototype,"autocomplete",void 0),ki([t.Property({})],s.prototype,"htmlAttributes",void 0),ki([t.Property(!1)],s.prototype,"multiline",void 0),ki([t.Property(!0)],s.prototype,"enabled",void 0),ki([t.Property(!1)],s.prototype,"showClearButton",void 0),ki([t.Property(!1)],s.prototype,"enablePersistence",void 0),ki([t.Property(null)],s.prototype,"width",void 0),ki([t.Event()],s.prototype,"created",void 0),ki([t.Event()],s.prototype,"destroyed",void 0),ki([t.Event()],s.prototype,"change",void 0),ki([t.Event()],s.prototype,"blur",void 0),ki([t.Event()],s.prototype,"focus",void 0),ki([t.Event()],s.prototype,"input",void 0),s=ki([t.NotifyPropertyChanges],s)}(t.Component);e.NumericTextBox=G,e.regularExpressions=se,e.createMask=n,e.applyMask=a,e.wireEvents=l,e.unwireEvents=r,e.bindClearEvent=o,e.unstrippedValue=u,e.strippedValue=c,e.maskInputMouseDownHandler=m,e.maskInputMouseUpHandler=f,e.maskInputFocusHandler=v,e.triggerFocus=g,e.maskInputBlurHandler=y,e.maskInputDropHandler=C,e.mobileRemoveFunction=T,e.setMaskValue=F,e.setElementValue=R,e.maskInput=function(e){var t=V(e);a.call(t);var i=c.call(this,this.element);this.prevValue=i,this.value=i,e.mask&&(r.call(t),l.call(t))},e.getVal=function(e){return c.call(M(e),e.element)},e.getMaskedVal=function(e){return u.call(M(e),e.element)},e.MaskUndo=ne,e.MaskedTextBox=he,e.TicksData=ce,e.ColorRangeData=pe,e.LimitData=me,e.TooltipData=fe,e.Slider=yt,e.regex=Ct,e.FormValidator=St,e.FilesProp=Yt,e.ButtonsProps=Gt,e.AsyncSettings=$t,e.Uploader=Jt,e.ColorPicker=xi,e.TextBox=Pi,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-splitbuttons")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-popups","@syncfusion/ej2-splitbuttons"],t):t(e.ej={},e.ej2Base,e.ej2Popups,e.ej2Splitbuttons)}(this,function(e,t,i,s){"use strict";function n(){if(t.attributes(this.element,{role:"textbox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-live":"assertive","aria-valuenow":""}),this.mask){for(var e=this.mask.split("]"),i=0;i<e.length;i++)if("\\"===e[i][e[i].length-1]){e[i]=e[i]+"]";for(var s=e[i].split("["),n=0;n<s.length;n++)"\\"===s[n][s[n].length-1]&&(s[n]=s[n]+"["),p.call(this,s[n])}else{if((s=e[i].split("[")).length>1){var a=!1;for(n=0;n<s.length;n++)"\\"===s[n]?(this.customRegExpCollec.push("["),this.hiddenMask+=s[n]+"["):""===s[n]?a=!0:""!==s[n]&&a||n===s.length-1?(this.customRegExpCollec.push("["+s[n]+"]"),this.hiddenMask+=this.promptChar,a=!1):p.call(this,s[n])}else p.call(this,s[0])}if(this.escapeMaskValue=this.hiddenMask,this.promptMask=this.hiddenMask.replace(/[09?LCAa#&]/g,this.promptChar),!t.isNullOrUndefined(this.customCharacters))for(i=0;i<this.promptMask.length;i++)t.isNullOrUndefined(this.customCharacters[this.promptMask[i]])||(this.promptMask=this.promptMask.replace(new RegExp(this.promptMask[i],"g"),this.promptChar));var l=0;if(this.hiddenMask.match(new RegExp(/\\/)))for(i=0;i<this.hiddenMask.length;i++){n=0;i>=1&&(n=i),n-=l=this.hiddenMask.length-this.promptMask.length,i>0&&"\\"!==this.hiddenMask[i-1]&&(">"===this.hiddenMask[i]||"<"===this.hiddenMask[i]||"|"===this.hiddenMask[i])&&(this.promptMask=this.promptMask.substring(0,n)+this.promptMask.substring(i+1-l,this.promptMask.length),this.escapeMaskValue=this.escapeMaskValue.substring(0,n)+this.escapeMaskValue.substring(i+1-l,this.escapeMaskValue.length)),"\\"===this.hiddenMask[i]&&(this.promptMask=this.promptMask.substring(0,n)+this.hiddenMask[i+1]+this.promptMask.substring(i+2-l,this.promptMask.length),this.escapeMaskValue=this.escapeMaskValue.substring(0,n)+this.escapeMaskValue[i+1]+this.escapeMaskValue.substring(i+2-l,this.escapeMaskValue.length))}else this.promptMask=this.promptMask.replace(/[>|<]/g,""),this.escapeMaskValue=this.hiddenMask.replace(/[>|<]/g,"");t.attributes(this.element,{"aria-invalid":"false"})}}function a(){F.call(this,this.promptMask),R.call(this,this.value)}function l(){t.EventHandler.add(this.element,"keydown",x,this),t.EventHandler.add(this.element,"keypress",P,this),t.EventHandler.add(this.element,"keyup",A,this),t.EventHandler.add(this.element,"input",S,this),t.EventHandler.add(this.element,"focus",v,this),t.EventHandler.add(this.element,"blur",y,this),t.EventHandler.add(this.element,"paste",b,this),t.EventHandler.add(this.element,"cut",E,this),t.EventHandler.add(this.element,"drop",C,this),t.EventHandler.add(this.element,"mousedown",m,this),t.EventHandler.add(this.element,"mouseup",f,this),this.enabled&&(o.call(this),this.formElement&&t.EventHandler.add(this.formElement,"reset",d,this))}function r(){t.EventHandler.remove(this.element,"keydown",x),t.EventHandler.remove(this.element,"keypress",P),t.EventHandler.remove(this.element,"keyup",A),t.EventHandler.remove(this.element,"input",S),t.EventHandler.remove(this.element,"focus",v),t.EventHandler.remove(this.element,"blur",y),t.EventHandler.remove(this.element,"paste",b),t.EventHandler.remove(this.element,"cut",E),t.EventHandler.remove(this.element,"mousedown",m),t.EventHandler.remove(this.element,"mouseup",f),this.formElement&&t.EventHandler.remove(this.formElement,"reset",d)}function o(){this.showClearButton&&t.EventHandler.add(this.inputObj.clearButton,"mousedown touchstart",h,this)}function h(e){e.preventDefault(),this.inputObj.clearButton.classList.contains("e-clear-icon-hide")||(function(e){var t=this.element.value;F.call(this,this.promptMask),this.redoCollec.unshift({value:this.promptMask,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),L.call(this,e,t),this.element.setSelectionRange(0,0)}.call(this,e),this.value="")}function d(){"EJS-MASKEDTEXTBOX"===this.element.tagName?F.call(this,this.promptMask):this.value=this.initInputValue}function u(e){return e.value}function c(e,i){var s="",n=0,a=!1,l=t.isNullOrUndefined(i)?t.isNullOrUndefined(e)||t.isNullOrUndefined(this)?i:e.value:i;if(l!==this.promptMask)for(var r=0;r<this.customRegExpCollec.length;r++)a&&(a=!1),">"!==this.customRegExpCollec[n]&&"<"!==this.customRegExpCollec[n]&&"|"!==this.customRegExpCollec[n]&&"\\"!==this.customRegExpCollec[n]||(--r,a=!0),a||l[r]!==this.promptChar&&!t.isNullOrUndefined(this.customRegExpCollec[n])&&(this._callPasteHandler||!t.isNullOrUndefined(this.regExpCollec[this.customRegExpCollec[n]])||this.customRegExpCollec[n].length>2&&"["===this.customRegExpCollec[n][0]&&"]"===this.customRegExpCollec[n][this.customRegExpCollec[n].length-1]||!t.isNullOrUndefined(this.customCharacters)&&!t.isNullOrUndefined(this.customCharacters[this.customRegExpCollec[n]]))&&""!==l&&(s+=l[r]),++n;return(null===this.mask||""===this.mask&&void 0!==this.value)&&(s=l),s}function p(e){for(var t=0;t<e.length;t++)this.hiddenMask+=e[t],"\\"!==e[t]&&this.customRegExpCollec.push(e[t])}function m(){this.isClicked=!0}function f(){this.isClicked=!1}function v(e){var i=this,s=this.element,n=0,a=c.call(this,s),l=!1,r=!1,o={selectionStart:s.selectionStart,event:e,value:this.value,maskedValue:s.value,container:this.inputObj.container,selectionEnd:s.selectionEnd};if(this.isClicked||g.call(this,o,s),this.mask&&(null!==a&&""!==a||"Always"===this.floatLabelType||null===this.placeholder||""===this.placeholder||(s.value=this.promptMask),setTimeout(function(){if(s.selectionStart===i.promptMask.length||s.value[s.selectionStart]===i.promptChar)l=!0;else for(var e=s.selectionStart;e<i.promptMask.length;e++){if(s.value[e]===i.promptChar){l=!0;break}if(s.value[e]!==i.promptMask[e]){l=!1;break}}}),setTimeout(function(){var e=s.selectionStart-1;if(e===i.promptMask.length-1||s.value[e]===i.promptChar)r=!0;else for(var t=e;t>=0;t--){if(s.value[t]===i.promptChar){r=!0;break}if(s.value[t]!==i.promptMask[t]){r=!1;break}}}),this.isClicked||"Always"!==this.floatLabelType&&(null===a||""===a)&&null!==this.placeholder&&""!==this.placeholder)){for(n=0;n<this.promptMask.length;n++)if(s.value[n]===this.promptChar){setTimeout(function(){(l||r)&&(s.selectionEnd=n,s.selectionStart=n),o={selectionStart:s.selectionStart,event:e,value:i.value,maskedValue:s.value,container:i.inputObj.container,selectionEnd:s.selectionEnd},g.call(i,o,s)});break}t.isNullOrUndefined(s.value.match(this.promptChar))&&(o={selectionStart:s.selectionStart,event:e,value:this.value,maskedValue:s.value,container:this.inputObj.container,selectionEnd:s.selectionEnd},g.call(this,o,s)),this.isClicked=!1}}function g(e,t){this.trigger("focus",e,function(e){t.selectionStart=e.selectionStart,t.selectionEnd=e.selectionEnd})}function y(e){if(this.blurEventArgs={event:e,value:this.value,maskedValue:this.element.value,container:this.inputObj.container},this.trigger("blur",this.blurEventArgs),this.mask&&(this.isFocus=!1,this.placeholder&&this.element.value===this.promptMask&&"Always"!==this.floatLabelType)){F.call(this,"");var i=this.element.parentNode.querySelector(".e-float-text");"Auto"===this.floatLabelType&&!t.isNullOrUndefined(i)&&i.classList.contains(ee)&&t.removeClass([i],ee)}}function b(e){var t=this;if(this.mask&&!this.readonly){var i=this.element.selectionStart,s=this.element.selectionEnd,n=this.element.value;F.call(this,""),this._callPasteHandler=!0,setTimeout(function(){var a=t.element.value.replace(/ /g,"");t.redoCollec.length>0&&t.redoCollec[0].value===t.element.value&&(a=c.call(t,t.element)),F.call(t,n),t.element.selectionStart=i,t.element.selectionEnd=s;var l=0;t.maskKeyPress=!0;do{H.call(t,a[l],!1,null),++l}while(l<a.length);if(t.maskKeyPress=!1,t._callPasteHandler=!1,t.element.value===n){var r=0;t.maskKeyPress=!0;do{H.call(t,a[r],!1,null),++r}while(r<a.length);t.maskKeyPress=!1}else L.call(t,e,n)},1)}}function E(e){var t=this;if(this.mask&&!this.readonly){var i=this.element.value,s=this.element.selectionStart,n=this.element.selectionEnd;this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd});var a=this.element.value.substring(0,s)+this.promptMask.substring(s,n)+this.element.value.substring(n);setTimeout(function(){F.call(t,a),t.element.selectionStart=t.element.selectionEnd=s,t.element.value!==i&&L.call(t,e,null)},0)}}function C(e){e.preventDefault()}function S(e){if(!0!==t.Browser.isIE||""!==this.element.value||"Never"!==this.floatLabelType){if(t.extend(e,{ctrlKey:!1,keyCode:229}),this.mask){if(""===this.element.value&&this.redoCollec.unshift({value:this.promptMask,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),1===this.element.value.length&&(this.element.value=this.element.value+this.promptMask,this.element.setSelectionRange(1,1)),this._callPasteHandler||O.call(this,e),this.element.value.length>this.promptMask.length){var i=this.element.selectionStart,s=this.element.value.length-this.promptMask.length,n=this.element.value.substring(i-s,i);this.maskKeyPress=!1;var a=0;do{H.call(this,n[a],e.ctrlKey,e),++a}while(a<n.length);this.element.value!==this.preEleVal&&L.call(this,e,null)}var l=c.call(this,this.element);this.prevValue=l,this.value=l,""===l&&(F.call(this,this.promptMask),this.element.setSelectionRange(0,0))}}}function x(e){if(this.mask&&!this.readonly){229!==e.keyCode&&(!e.ctrlKey||89!==e.keyCode&&90!==e.keyCode||e.preventDefault(),O.call(this,e));var t=this.element.value;if(e.ctrlKey&&(89===e.keyCode||90===e.keyCode)){var i=void 0;90===e.keyCode&&this.undoCollec.length>0&&t!==this.undoCollec[this.undoCollec.length-1].value?(i=this.undoCollec[this.undoCollec.length-1],this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),F.call(this,i.value),this.element.selectionStart=i.startIndex,this.element.selectionEnd=i.endIndex,this.undoCollec.splice(this.undoCollec.length-1,1)):89===e.keyCode&&this.redoCollec.length>0&&t!==this.redoCollec[0].value&&(i=this.redoCollec[0],this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),F.call(this,i.value),this.element.selectionStart=i.startIndex,this.element.selectionEnd=i.endIndex,this.redoCollec.splice(0,1))}}}function k(){var e,t=this.element.selectionStart,i=this.element.selectionEnd;this.redoCollec.length>0?(e=this.redoCollec[0],F.call(this,e.value),e.startIndex-t==1?(this.element.selectionStart=e.startIndex,this.element.selectionEnd=e.endIndex):(this.element.selectionStart=t+1,this.element.selectionEnd=i+1)):(F.call(this,this.promptMask),this.element.selectionStart=this.element.selectionEnd=t)}function T(e,t,i){return"input"===i.type&&(e=!1,t=this.element.value,F.call(this,this.promptMask),R.call(this,t)),e}function O(e){var i,s=!1,n=!1;this.element.value.length<this.promptMask.length&&(s=!0,i=this.element.value,s=T.call(this,s,i,e),k.call(this)),this.element.value.length>=this.promptMask.length&&"input"===e.type&&(s=T.call(this,s,i,e));var a=this.element.selectionStart,l=this.element.selectionEnd,r=this.element.selectionStart,o=this.element.selectionEnd,h=this.hiddenMask.replace(/[>|\\<]/g,""),d=h[r-1],u=this.element.selectionEnd;if(s||8===e.keyCode||46===e.keyCode){this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:o});var c=!1,p=this.element.value;if(r>0||(8===e.keyCode||46===e.keyCode)&&r<this.element.value.length&&this.element.selectionEnd-r!==this.element.value.length){var m=r;r!==o?(r=o,46===e.keyCode&&(c=!0)):46===e.keyCode?++m:--m;for(var f=r;8===e.keyCode||s||c?f>m:f<m;8===e.keyCode||s||c?f--:f++)for(var v=r;8===e.keyCode||s||c?v>0:v<this.element.value.length;8===e.keyCode||s||c?v--:v++){var g=void 0;(8===e.keyCode||c)&&(a!==l&&a!==r||a===l)||s?(d=h[v-1],g=r-1):(d=h[v],g=r,++r);var y=this.element.value[g];if(t.isNullOrUndefined(this.regExpCollec[d])&&!t.isNullOrUndefined(this.customCharacters)&&t.isNullOrUndefined(this.customCharacters[d])&&this.hiddenMask[g]!==this.promptChar&&"["!==this.customRegExpCollec[g][0]&&"]"!==this.customRegExpCollec[g][this.customRegExpCollec[g].length-1]||this.promptMask[g]!==this.promptChar&&t.isNullOrUndefined(this.customCharacters))this.element.selectionStart=this.element.selectionEnd=g,e.preventDefault(),46!==e.keyCode||c||++this.element.selectionStart;else{var b=this.element.value,E=this.promptChar,C=b.substring(0,g)+E+b.substring(r,b.length);F.call(this,C),e.preventDefault(),46!==e.keyCode||c||g++,this.element.selectionStart=this.element.selectionEnd=g,n=!0}if(r=this.element.selectionStart,!n&&8===e.keyCode||c||!n&&46!==e.keyCode?g=r-1:(g=r,n=!1),y=this.element.value[g],a!==l&&this.element.selectionStart===a||this.promptMask[g]===this.promptChar||y!==this.promptMask[g]&&this.promptMask[g]!==this.promptChar&&!t.isNullOrUndefined(this.customCharacters))break}}46===e.keyCode&&c&&n&&(this.element.selectionStart=this.element.selectionEnd=u),0===this.element.selectionStart&&this.element.selectionEnd===this.element.value.length&&(F.call(this,this.promptMask),e.preventDefault(),this.element.selectionStart=this.element.selectionEnd=r),this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),this.element.value!==p&&L.call(this,e,i)}}function P(e){if(this.mask&&!this.readonly){var t=this.element.value;if(!e.ctrlKey||e.ctrlKey&&"KeyA"!==e.code&&"KeyY"!==e.code&&"KeyZ"!==e.code&&"KeyX"!==e.code&&"KeyC"!==e.code&&"KeyV"!==e.code){this.maskKeyPress=!0;var i=e.key;"Spacebar"===i&&(i=String.fromCharCode(e.keyCode)),i?i&&1===i.length&&(H.call(this,i,e.ctrlKey,e),e.preventDefault()):(this.isIosInvalid=!0,H.call(this,String.fromCharCode(e.keyCode),e.ctrlKey,e),e.preventDefault(),this.isIosInvalid=!1),32===e.keyCode&&" "===i&&" "===this.promptChar&&(this.element.selectionStart=this.element.selectionEnd=this.element.selectionStart-i.length)}this.element.value!==t&&L.call(this,e,t)}}function L(e,i){var s=this.isProtectedOnChange;if(!t.isNullOrUndefined(this.changeEventArgs)&&!this.isInitial){var n={};this.changeEventArgs={value:this.element.value,maskedValue:this.element.value,isInteraction:!1,isInteracted:!1},this.mask&&(this.changeEventArgs.value=c.call(this,this.element)),t.isNullOrUndefined(e)||(this.changeEventArgs.isInteracted=!0,this.changeEventArgs.isInteraction=!0,this.changeEventArgs.event=e),this.isProtectedOnChange=!0,this.value=this.changeEventArgs.value,this.isProtectedOnChange=s,t.merge(n,this.changeEventArgs),this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",n)}this.preEleVal=this.element.value,this.prevValue=c.call(this,this.element),t.attributes(this.element,{"aria-valuenow":this.element.value})}function A(e){if(this.mask&&!this.readonly){var i=void 0;if(this.maskKeyPress||229!==e.keyCode)U.call(this);else{var s=void 0;if(1===this.element.value.length&&(this.element.value=this.element.value+this.promptMask,this.element.setSelectionRange(1,1)),this.element.value.length>this.promptMask.length){var n=this.element.selectionStart,a=this.element.value.length-this.promptMask.length,l=this.element.value.substring(n-a,n);if(this.undoCollec.length>0){i=this.undoCollec[this.undoCollec.length-1];var r=this.element.selectionStart;s=i.value;var o=i.value.substring(r-a,r);i=this.redoCollec[0],l=l.trim();var h=t.Browser.isAndroid&&""===l;h||o===l||i.value.substring(r-a,r)===l?h&&B.call(this,e,r-1,this.element.selectionEnd-1,l,e.ctrlKey,!1):H.call(this,l,e.ctrlKey,e)}else s=this.promptMask,H.call(this,l,e.ctrlKey,e);this.maskKeyPress=!1,L.call(this,e,s)}}var d=c.call(this,this.element);(0!==this.element.selectionStart||this.promptMask!==this.element.value||""!==d||""===d&&this.value!==d)&&(this.prevValue=d,this.value=d)}else L.call(this,e);if(0===this.element.selectionStart&&0===this.element.selectionEnd){var u=this.element;setTimeout(function(){u.setSelectionRange(0,0)},0)}}function N(e){this.maskKeyPress||function(e){if(e.length>1&&this.promptMask.length+e.length<this.element.value.length){var t=this.redoCollec[0].value.substring(0,this.redoCollec[0].startIndex)+e+this.redoCollec[0].value.substring(this.redoCollec[0].startIndex,this.redoCollec[0].value.length);F.call(this,t),this.element.selectionStart=this.element.selectionEnd=this.redoCollec[0].startIndex+e.length}this.element.selectionStart=this.element.selectionStart-e.length,this.element.selectionEnd=this.element.selectionEnd-e.length}.call(this,e)}function H(e,i,s){if(N.call(this,e),!t.isNullOrUndefined(this)&&!t.isNullOrUndefined(e))for(var n,a,l=this.element.selectionStart,r=l,o=!1,h=this.element.value,d=!1,u=!1,c=0;c<e.length;c++){var p=e[c];if(l=this.element.selectionStart,this.maskKeyPress||r!==l||(l+=c),!this.maskKeyPress||l<this.promptMask.length){for(var m=l;m<this.promptMask.length;m++){n=this.escapeMaskValue[l],"\\"===this.hiddenMask[l]&&this.hiddenMask[l+1]===e&&(u=!0),(t.isNullOrUndefined(this.regExpCollec[n])&&(t.isNullOrUndefined(this.customCharacters)||!t.isNullOrUndefined(this.customCharacters)&&t.isNullOrUndefined(this.customCharacters[n]))&&this.hiddenMask[l]!==this.promptChar&&"["!==this.customRegExpCollec[l][0]&&"]"!==this.customRegExpCollec[l][this.customRegExpCollec[l].length-1]||this.promptMask[l]!==this.promptChar&&t.isNullOrUndefined(this.customCharacters)||this.promptChar===n&&this.escapeMaskValue===this.mask)&&(this.element.selectionStart=this.element.selectionEnd=l+1,l=this.element.selectionStart,n=this.hiddenMask[l])}if(t.isNullOrUndefined(this.customCharacters)||t.isNullOrUndefined(this.customCharacters[n]))!t.isNullOrUndefined(this.regExpCollec[n])&&p.match(new RegExp(this.regExpCollec[n]))&&this.promptMask[l]===this.promptChar?o=!0:this.promptMask[l]===this.promptChar&&"["===this.customRegExpCollec[l][0]&&"]"===this.customRegExpCollec[l][this.customRegExpCollec[l].length-1]&&p.match(new RegExp(this.customRegExpCollec[l]))&&(o=!0);else{var f=this.customCharacters[n].split(",");for(m=0;m<f.length;m++)if(p.match(new RegExp("["+f[m]+"]"))){o=!0;break}}if((!this.maskKeyPress||l<this.hiddenMask.length)&&o){if(0===c)if(this.maskKeyPress)this.undoCollec.push({value:h,startIndex:l,endIndex:l});else{var v=this.element.selectionStart,g=this.element.selectionEnd;this.redoCollec.length>0?(a=this.redoCollec[0].value,F.call(this,a),this.undoCollec.push(this.redoCollec[0])):(this.undoCollec.push({value:this.promptMask,startIndex:l,endIndex:l}),a=this.promptMask,F.call(this,a)),this.element.selectionStart=v,this.element.selectionEnd=g}l=this.element.selectionStart,function(e,t,i,s,n){this.hiddenMask.length>this.promptMask.length&&(i=function(e,t){var i,s,n=t,a=0;for(s=0;s<this.hiddenMask.length;s++)if("\\"===this.hiddenMask[s]&&(i=n.substring(0,s)+"\\"+n.substring(s,n.length)),">"!==this.hiddenMask[s]&&"<"!==this.hiddenMask[s]&&"|"!==this.hiddenMask[s]||(this.hiddenMask[s]!==n[s]&&(i=n.substring(0,s)+this.hiddenMask[s]+n.substring(s,n.length)),++a),i){if(i[s]===this.promptChar&&s>this.element.selectionStart||this.element.value.indexOf(this.promptChar)<0&&this.element.selectionStart+a===s){a=0;break}n=i}for(;s>=0&&i;){if(0===s||"\\"!==i[s-1]){if(">"===i[s]){e=e.toUpperCase();break}if("<"===i[s]){e=e.toLowerCase();break}if("|"===i[s])break}--s}return e}.call(this,i,this.element.value));if(!n){var a=this.element.value,l=a.substring(0,t)+i+a.substring(t+1,a.length);F.call(this,l),this.element.selectionStart=this.element.selectionEnd=t+1}}.call(this,s,l,p,a,u),d=!0,c===e.length-1&&this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),o=!1}else l=this.element.selectionStart,B.call(this,s,l,r,e,i,d);c!==e.length-1||o||(!t.Browser.isAndroid||t.Browser.isAndroid&&l<this.promptMask.length)&&this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd})}else 1!==e.length||i||t.isNullOrUndefined(s)||w.call(this)}}function B(e,i,s,n,a,l){if(!this.maskKeyPress){var r=this.element.value;i>=this.promptMask.length?F.call(this,r.substring(0,i)):(s===i?F.call(this,r.substring(0,i)+r.substring(i+1,r.length)):this.promptMask.length===this.element.value.length?F.call(this,r.substring(0,i)+r.substring(i,r.length)):F.call(this,r.substring(0,s)+r.substring(s+1,r.length)),this.element.selectionStart=this.element.selectionEnd=l||this.element.value[s]!==this.promptChar?i:s),w.call(this)}1!==n.length||a||t.isNullOrUndefined(e)||w.call(this)}function w(){var e=this,i=this.element.parentNode,s=200;i.classList.contains(J)||i.classList.contains($)?t.addClass([i],G):t.addClass([this.element],G),!0===this.isIosInvalid&&(s=400),t.attributes(this.element,{"aria-invalid":"true"}),setTimeout(function(){e.maskKeyPress||U.call(e)},s)}function U(){var e=this.element.parentNode;t.isNullOrUndefined(e)||t.removeClass([e],G),t.removeClass([this.element],G),t.attributes(this.element,{"aria-invalid":"false"})}function R(e){if(this.mask&&void 0!==e&&(void 0===this.prevValue||this.prevValue!==e)){if(this.maskKeyPress=!0,F.call(this,this.promptMask),""===e||null===e&&"Never"===this.floatLabelType&&this.placeholder||(this.element.selectionStart=0,this.element.selectionEnd=0),null!==e)for(var i=0;i<e.length;i++)H.call(this,e[i],!1,null);var s=c.call(this,this.element);this.prevValue=s,this.value=s,L.call(this,null,null),this.maskKeyPress=!1;var n=this.element.parentNode.querySelector(".e-float-text");this.element.value===this.promptMask&&"Auto"===this.floatLabelType&&this.placeholder&&!t.isNullOrUndefined(n)&&n.classList.contains(ee)&&!this.isFocus&&(t.removeClass([n],ee),t.addClass([n],te),F.call(this,""))}(null===this.mask||""===this.mask&&void 0!==this.value)&&F.call(this,this.value)}function F(i,s){!this.isFocus&&"Auto"===this.floatLabelType&&this.placeholder&&t.isNullOrUndefined(this.value)&&(i="");var n=c.call(this,s||this.element,i);null===n||""===n?(e.Input.setValue(i,s||this.element,this.floatLabelType,!1),this.showClearButton&&this.inputObj.clearButton.classList.add("e-clear-icon-hide")):e.Input.setValue(i,s||this.element,this.floatLabelType,this.showClearButton)}function V(e){t.addClass([e.element],Q);var i={element:e.element,mask:e.mask,promptMask:"",hiddenMask:"",escapeMaskValue:"",promptChar:e.promptChar?e.promptChar.length>1?e.promptChar=e.promptChar[0]:e.promptChar:"_",value:e.value?e.value:null,regExpCollec:ie,customRegExpCollec:[],customCharacters:e.customCharacters,undoCollec:[],redoCollec:[],maskKeyPress:!1,prevValue:""};return n.call(i),i}function M(e){var i;return!t.isNullOrUndefined(e)&&e.element.classList.contains(Q)&&(i=V(e)),i}var I={RTL:"e-rtl",DISABLE:"e-disabled",INPUT:"e-input",TEXTAREA:"e-multi-line-input",INPUTGROUP:"e-input-group",FLOATINPUT:"e-float-input",FLOATLINE:"e-float-line",FLOATTEXT:"e-float-text",CLEARICON:"e-clear-icon",CLEARICONHIDE:"e-clear-icon-hide",LABELTOP:"e-label-top",LABELBOTTOM:"e-label-bottom",NOFLOATLABEL:"e-no-float-label",INPUTCUSTOMTAG:"e-input-custom-tag",FLOATCUSTOMTAG:"e-float-custom-tag"};!function(e){function i(e){s(e.floatLabelType,e.element),e.element.addEventListener("focus",function(){var e=u(this);(e.classList.contains("e-input-group")||e.classList.contains("e-outline")||e.classList.contains("e-filled"))&&e.classList.add("e-input-focus")}),e.element.addEventListener("blur",function(){var e=u(this);(e.classList.contains("e-input-group")||e.classList.contains("e-outline")||e.classList.contains("e-filled"))&&e.classList.remove("e-input-focus")}),e.element.addEventListener("input",function(){s(H,e.element)})}function s(e,i){var s=i.value;""!==s&&!t.isNullOrUndefined(s)&&i.parentElement?i.parentElement.classList.add("e-valid-input"):"Always"!==e&&i.parentElement&&i.parentElement.classList.remove("e-valid-input")}function n(){var e=u(this).getElementsByClassName("e-float-text")[0];t.isNullOrUndefined(e)||(t.addClass([e],I.LABELTOP),e.classList.contains(I.LABELBOTTOM)&&t.removeClass([e],I.LABELBOTTOM))}function a(){var e=u(this);if(e.getElementsByTagName("textarea")[0]?""===e.getElementsByTagName("textarea")[0].value:""===e.getElementsByTagName("input")[0].value){var i=e.getElementsByClassName("e-float-text")[0];t.isNullOrUndefined(i)||(i.classList.contains(I.LABELTOP)&&t.removeClass([i],I.LABELTOP),t.addClass([i],I.LABELBOTTOM))}}function l(e){e.addEventListener("focus",n),e.addEventListener("blur",a)}function r(e,i,s){var n=t.isNullOrUndefined(s)?t.createElement:s;"Auto"===e.floatLabelType&&l(e.element),t.isNullOrUndefined(i.container)?(i.container=m(e,I.FLOATINPUT,I.FLOATCUSTOMTAG,"div",n),e.element.parentNode&&e.element.parentNode.insertBefore(i.container,e.element)):(t.isNullOrUndefined(e.customTag)||i.container.classList.add(I.FLOATCUSTOMTAG),i.container.classList.add(I.FLOATINPUT));var a=n("span",{className:I.FLOATLINE}),r=n("label",{className:I.FLOATTEXT});if(t.isNullOrUndefined(e.element.id)||""===e.element.id||(r.id="label_"+e.element.id.replace(/ /g,"_"),t.attributes(e.element,{"aria-labelledby":r.id})),t.isNullOrUndefined(e.element.placeholder)||""===e.element.placeholder||(r.innerText=f(e.element.placeholder),e.element.removeAttribute("placeholder")),t.isNullOrUndefined(e.properties)||t.isNullOrUndefined(e.properties.placeholder)||""===e.properties.placeholder||(r.innerText=f(e.properties.placeholder)),r.innerText||i.container.classList.add(I.NOFLOATLABEL),i.container.classList.contains("e-float-icon-left")){var o=i.container.querySelector(".e-input-in-wrap");o.appendChild(e.element),o.appendChild(a),o.appendChild(r)}else i.container.appendChild(e.element),i.container.appendChild(a),i.container.appendChild(r);d(e.element.value,r),"Always"===e.floatLabelType&&(r.classList.contains(I.LABELBOTTOM)&&t.removeClass([r],I.LABELBOTTOM),t.addClass([r],I.LABELTOP)),"Auto"===e.floatLabelType&&(e.element.addEventListener("input",function(t){d(e.element.value,r)}),e.element.addEventListener("blur",function(t){d(e.element.value,r)})),t.isNullOrUndefined(e.element.getAttribute("id"))||r.setAttribute("for",e.element.getAttribute("id"))}function o(e,t){"Always"===e&&t.classList.contains("e-outline")&&t.classList.add("e-valid-input")}function h(e,i){e?t.removeClass([i],I.CLEARICONHIDE):t.addClass([i],I.CLEARICONHIDE)}function d(e,i){e?(t.addClass([i],I.LABELTOP),i.classList.contains(I.LABELBOTTOM)&&t.removeClass([i],I.LABELBOTTOM)):(i.classList.contains(I.LABELTOP)&&t.removeClass([i],I.LABELTOP),t.addClass([i],I.LABELBOTTOM))}function u(e){var i=t.isNullOrUndefined(e.parentNode)?e:e.parentNode;return i&&i.classList.contains("e-input-in-wrap")&&(i=i.parentNode),i}function c(e,i,s){(void 0==B||B)&&i.addEventListener("click",function(s){e.classList.contains(I.DISABLE)||e.readOnly||(s.preventDefault(),e!==document.activeElement&&e.focus(),e.value="",t.addClass([i],I.CLEARICONHIDE))}),e.addEventListener("input",function(t){h(e.value,i)}),e.addEventListener("focus",function(t){h(e.value,i)}),e.addEventListener("blur",function(e){setTimeout(function(){t.addClass([i],I.CLEARICONHIDE)},200)})}function p(e,t){if(u(e).classList.contains(I.FLOATINPUT)&&"Auto"===t){var i=u(e).getElementsByClassName("e-float-text")[0];d(e.value,i)}}function m(e,i,s,n,a){var l,r=t.isNullOrUndefined(a)?t.createElement:a;return t.isNullOrUndefined(e.customTag)?l=r(n,{className:i}):(l=r(e.customTag,{className:i})).classList.add(s),l.classList.add("e-control-wrapper"),l}function f(e){var i="";if(!t.isNullOrUndefined(e)&&""!==e){var s=document.createElement("span");s.innerHTML='<input placeholder="'+e+'"/>';i=s.children[0].placeholder}return i}function v(e,i,s){t.isNullOrUndefined(s)||""===s||t.removeClass(i,s.split(" ")),t.isNullOrUndefined(e)||""===e||t.addClass(i,e.split(" "))}function g(e,i){e=f(e);var s=u(i);s.classList.contains(I.FLOATINPUT)?t.isNullOrUndefined(e)||""===e?(s.classList.add(I.NOFLOATLABEL),s.getElementsByClassName(I.FLOATTEXT)[0].textContent=""):(s.getElementsByClassName(I.FLOATTEXT)[0].textContent=e,s.classList.remove(I.NOFLOATLABEL),i.removeAttribute("placeholder")):t.isNullOrUndefined(e)||""===e?(i.removeAttribute("placeholder"),i.removeAttribute("aria-placeholder")):t.attributes(i,{placeholder:e,"aria-placeholder":e})}function y(e,i,s){e?t.attributes(i,{readonly:""}):i.removeAttribute("readonly"),t.isNullOrUndefined(s)||p(i,s)}function b(e,i){e?t.addClass(i,I.RTL):t.removeClass(i,I.RTL)}function E(e,i,s,n){var a={disabled:"disabled","aria-disabled":"true"},l=!t.isNullOrUndefined(n);e?(i.classList.remove(I.DISABLE),S(a,i),l&&t.removeClass([n],I.DISABLE)):(i.classList.add(I.DISABLE),x(a,i),l&&t.addClass([n],I.DISABLE)),t.isNullOrUndefined(s)||p(i,s)}function C(e,i,s,n,a){var l=t.isNullOrUndefined(a)?t.createElement:a;e?s.clearButton=function(e,i,s,n){var a=(t.isNullOrUndefined(n)?t.createElement:n)("span",{className:I.CLEARICON}),l=i.container;t.isNullOrUndefined(s)?(i.container.classList.contains(I.FLOATINPUT)?i.container.querySelector("."+I.FLOATTEXT):e).insertAdjacentElement("afterend",a):l.appendChild(a);return!t.isNullOrUndefined(l)&&l.classList.contains(I.FLOATINPUT)&&t.addClass([l],I.INPUTGROUP),t.addClass([a],I.CLEARICONHIDE),c(e,a),a.setAttribute("aria-label","close"),a}(i,s,n,l):(t.remove(s.clearButton),s.clearButton=null)}function S(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){var n=s[i],a=u(t);"disabled"===n&&t.classList.remove(I.DISABLE),"disabled"===n&&a.classList.contains(I.INPUTGROUP)&&a.classList.remove(I.DISABLE),"placeholder"===n&&a.classList.contains(I.FLOATINPUT)?a.getElementsByClassName(I.FLOATTEXT)[0].textContent="":t.removeAttribute(n)}}function x(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){var n=s[i],a=u(t);"disabled"===n&&t.classList.add(I.DISABLE),"disabled"===n&&a.classList.contains(I.INPUTGROUP)&&a.classList.add(I.DISABLE),"placeholder"===n&&a.classList.contains(I.FLOATINPUT)?a.getElementsByClassName(I.FLOATTEXT)[0].textContent=e[n]:t.setAttribute(n,e[n])}}function k(e,i,s){var n=[];n.push(s);var a=t.isNullOrUndefined(s)?i.querySelectorAll(".e-input-group-icon"):n;if(e&&a.length>0)for(var l=0;l<a.length;l++)a[l].addEventListener("mousedown",T,!1),a[l].addEventListener("mouseup",O,!1);else if(a.length>0)for(l=0;l<a.length;l++)a[l].removeEventListener("mousedown",T,this),a[l].removeEventListener("mouseup",O,this)}function T(){for(var e=this.parentElement;!e.classList.contains("e-input-group");)e=e.parentElement;!function(e,t){e.classList.contains("e-disabled")||e.querySelector("input").readOnly||t.classList.add("e-input-btn-ripple")}(e,this)}function O(){var e=this;setTimeout(function(){e.classList.remove("e-input-btn-ripple")},500)}function P(e,t){var i=t("span",{className:e});return i.classList.add("e-input-group-icon"),i}function L(e,i,s,n){var a=t.isNullOrUndefined(n)?t.createElement:n,l=P(e,a);i.classList.add("e-float-icon-left");var r=i.querySelector(".e-input-in-wrap");if(t.isNullOrUndefined(r)){r=a("span",{className:"e-input-in-wrap"}),s.parentNode.insertBefore(r,s);var o=i.querySelectorAll(s.tagName+" ~ *");r.appendChild(s);for(var h=0;h<o.length;h++)r.appendChild(o[h])}return r.parentNode.insertBefore(l,r),i.classList.contains(I.INPUTGROUP)||i.classList.add(I.INPUTGROUP),k(!0,i,l),l}function A(e,i,s){var n=P(e,t.isNullOrUndefined(s)?t.createElement:s);i.classList.contains(I.INPUTGROUP)||i.classList.add(I.INPUTGROUP);return(i.classList.contains("e-float-icon-left")?i.querySelector(".e-input-in-wrap"):i).appendChild(n),k(!0,i,n),n}function N(e,t){"hidden"===t.type?e.classList.add("e-hidden"):e.classList.contains("e-hidden")&&e.classList.remove("e-hidden")}var H,B=!0;e.createInput=function(e,s){var n=t.isNullOrUndefined(s)?t.createElement:s,a={container:null,buttons:[],clearButton:null};if(H=e.floatLabelType,B=e.bindClearAction,t.isNullOrUndefined(e.floatLabelType)||"Never"===e.floatLabelType?(a.container=m(e,I.INPUTGROUP,I.INPUTCUSTOMTAG,"span",n),e.element.parentNode.insertBefore(a.container,e.element),t.addClass([e.element],I.INPUT),a.container.appendChild(e.element)):r(e,a,n),i(e),t.isNullOrUndefined(e.properties)||t.isNullOrUndefined(e.properties.showClearButton)||!e.properties.showClearButton||"TEXTAREA"===e.element.tagName||(C(e.properties.showClearButton,e.element,a,!0,n),a.clearButton.setAttribute("role","button"),a.container.classList.contains(I.FLOATINPUT)&&t.addClass([a.container],I.INPUTGROUP)),!t.isNullOrUndefined(e.buttons)&&"TEXTAREA"!==e.element.tagName)for(var l=0;l<e.buttons.length;l++)a.buttons.push(A(e.buttons[l],a.container,n));return t.isNullOrUndefined(e.element)||"TEXTAREA"!==e.element.tagName||t.addClass([a.container],I.TEXTAREA),N(a.container,e.element),a=function(e,i){if(!t.isNullOrUndefined(e.properties))for(var s=0,n=Object.keys(e.properties);s<n.length;s++){var a=n[s];switch(a){case"cssClass":v(e.properties.cssClass,[i.container]),o(e.floatLabelType,i.container);break;case"enabled":E(e.properties.enabled,e.element,e.floatLabelType,i.container);break;case"enableRtl":b(e.properties.enableRtl,[i.container]);break;case"placeholder":g(e.properties.placeholder,e.element);break;case"readonly":y(e.properties.readonly,e.element)}}return i}(e,a)},e.bindInitialEvent=i,e.wireFloatingEvents=l,e.wireClearBtnEvents=c,e.setValue=function(e,i,n,a){if(i.value=e,t.isNullOrUndefined(n)||"Auto"!==n||p(i,n),!t.isNullOrUndefined(a)&&a){var l=u(i);if(!t.isNullOrUndefined(l)){var r=l.getElementsByClassName(I.CLEARICON)[0];t.isNullOrUndefined(r)||(i.value&&l.classList.contains("e-input-focus")?t.removeClass([r],I.CLEARICONHIDE):t.addClass([r],I.CLEARICONHIDE))}}s(n,i)},e.setCssClass=v,e.setWidth=function(e,i){"number"==typeof e?i.style.width=t.formatUnit(e):"string"==typeof e&&(i.style.width=e.match(/px|%|em/)?e:t.formatUnit(e))},e.setPlaceholder=g,e.setReadonly=y,e.setEnableRtl=b,e.setEnabled=E,e.setClearButton=C,e.removeAttributes=S,e.addAttributes=x,e.removeFloating=function(e){var i=e.container;if(!t.isNullOrUndefined(i)&&i.classList.contains(I.FLOATINPUT)){var s=i.querySelector("textarea")?i.querySelector("textarea"):i.querySelector("input"),l=i.querySelector("."+I.FLOATTEXT).textContent,r=null!==i.querySelector(".e-clear-icon");t.detach(i.querySelector("."+I.FLOATLINE)),t.detach(i.querySelector("."+I.FLOATTEXT)),t.classList(i,[I.INPUTGROUP],[I.FLOATINPUT]),function(e){e.removeEventListener("focus",n),e.removeEventListener("blur",a)}(s),t.attributes(s,{placeholder:l}),s.classList.add(I.INPUT),r||"INPUT"!==s.tagName||s.removeAttribute("required")}},e.addFloating=function(e,i,s,n){var a=t.isNullOrUndefined(n)?t.createElement:n,l=t.closest(e,"."+I.INPUTGROUP);if(H=i,"Never"!==i){var h=l.tagName,d={element:e,floatLabelType:i,customTag:h="DIV"!==h&&"SPAN"!==h?h:null,properties:{placeholder:s}},u=l.querySelector(".e-clear-icon"),c={container:l};e.classList.remove(I.INPUT),r(d,c,a);var p=l.classList.contains("e-float-icon-left");if(t.isNullOrUndefined(u)&&(u=p?l.querySelector(".e-input-in-wrap").querySelector(".e-input-group-icon"):l.querySelector(".e-input-group-icon")),t.isNullOrUndefined(u))p&&(u=l.querySelector(".e-input-group-icon")),t.isNullOrUndefined(u)&&l.classList.remove(I.INPUTGROUP);else{var m=l.querySelector("."+I.FLOATLINE),f=l.querySelector("."+I.FLOATTEXT),v=p?l.querySelector(".e-input-in-wrap"):l;v.insertBefore(e,u),v.insertBefore(m,u),v.insertBefore(f,u)}}o(i,e.parentElement)},e.setRipple=function(e,t){for(var i=0;i<t.length;i++)k(e,t[i].container)},e.addIcon=function(e,t,i,s,n){var a="string"==typeof t?t.split(","):t;if("append"===e.toLowerCase())for(var l=0,r=a;l<r.length;l++)A(r[l],i,n);else for(var o=0,h=a;o<h.length;o++)L(h[o],i,s,n)},e.prependSpan=L,e.appendSpan=A,e.validateInputType=N}(e.Input||(e.Input={}));var D=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)}}(),z=function(e,t,i,s){var n,a=arguments.length,l=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(l=(a<3?n(l):a>3?n(t,i,l):n(t,i))||l);return a>3&&l&&Object.defineProperty(t,i,l),l},q="e-input-group-icon",W="e-spin-up",j="increment",_="decrement",X=new RegExp("^(-)?(\\d*)$"),K="e-input-focus",Z=["title","style","class"],Y=function(i){function s(e,t){var s=i.call(this,e,t)||this;return s.isVue=!1,s.preventChange=!1,s.isAngular=!1,s.isDynamicChange=!1,s.numericOptions=e,s}return D(s,i),s.prototype.preRender=function(){this.isPrevFocused=!1,this.decimalSeparator=".",this.intRegExp=new RegExp("/^(-)?(d*)$/"),this.isCalled=!1;var e=t.getValue("ej2_instances",this.element);if(this.cloneElement=this.element.cloneNode(!0),t.removeClass([this.cloneElement],["e-control","e-numerictextbox","e-lib"]),this.angularTagName=null,this.formEle=t.closest(this.element,"form"),"EJS-NUMERICTEXTBOX"===this.element.tagName){this.angularTagName=this.element.tagName;for(var i=this.createElement("input"),s=0;s<this.element.attributes.length;s++){"id"!==this.element.attributes[s].nodeName&&(i.setAttribute(this.element.attributes[s].nodeName,this.element.attributes[s].nodeValue),i.innerHTML=this.element.innerHTML)}this.element.hasAttribute("name")&&this.element.removeAttribute("name"),this.element.classList.remove("e-control","e-numerictextbox"),this.element.appendChild(i),this.element=i,t.setValue("ej2_instances",e,this.element)}t.attributes(this.element,{role:"spinbutton",tabindex:"0",autocomplete:"off","aria-live":"assertive"});var n={incrementTitle:"Increment value",decrementTitle:"Decrement value",placeholder:this.placeholder};this.l10n=new t.L10n("numerictextbox",n,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.isValidState=!0,this.inputStyle=null,this.inputName=null,this.cultureInfo={},this.initCultureInfo(),this.initCultureFunc(),this.prevValue=this.value,this.updateHTMLAttrToElement(),this.checkAttributes(!1),this.formEle&&(this.inputEleValue=this.value),this.validateMinMax(),this.validateStep(),null===this.placeholder&&this.updatePlaceholder()},s.prototype.render=function(){"input"===this.element.tagName.toLowerCase()&&(this.createWrapper(),this.showSpinButton&&this.spinBtnCreation(),this.setElementWidth(this.width),this.container.classList.contains("e-input-group")||this.container.classList.add("e-input-group"),this.changeValue(null===this.value||isNaN(this.value)?null:this.strictMode?this.trimValue(this.value):this.value),this.wireEvents(),null===this.value||isNaN(this.value)||this.decimals&&this.setProperties({value:this.roundNumber(this.value,this.decimals)},!0),(this.element.getAttribute("value")||this.value)&&(this.element.setAttribute("value",this.element.value),this.hiddenInput.setAttribute("value",this.hiddenInput.value)),this.elementPrevValue=this.element.value,this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false"),this.renderComplete())},s.prototype.checkAttributes=function(e){for(var i=0,s=e?t.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["value","min","max","step","disabled","readonly","style","name","placeholder"];i<s.length;i++){var n=s[i];if(!t.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"disabled":if(t.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.enabled||e){var a="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n);this.setProperties({enabled:a},!e)}break;case"readonly":if(t.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.readonly||e){var l="readonly"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n);this.setProperties({readonly:l},!e)}break;case"placeholder":(t.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.placeholder||e)&&this.setProperties({placeholder:this.element.placeholder},!e);break;case"value":if(t.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.value||e){var r=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));this.setProperties(t.setValue(n,r,{}),!e)}break;case"min":if(t.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.min||e){var o=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));null===o||isNaN(o)||this.setProperties(t.setValue(n,o,{}),!e)}break;case"max":if(t.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.max||e){var h=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));null===h||isNaN(h)||this.setProperties(t.setValue(n,h,{}),!e)}break;case"step":if(t.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.step||e){var d=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));null===d||isNaN(d)||this.setProperties(t.setValue(n,d,{}),!e)}break;case"style":this.inputStyle=this.element.getAttribute(n);break;case"name":this.inputName=this.element.getAttribute(n);break;default:var u=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));(null!==u&&!isNaN(u)||"value"===n)&&this.setProperties(t.setValue(n,u,{}),!0)}}},s.prototype.updatePlaceholder=function(){this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0)},s.prototype.initCultureFunc=function(){this.instance=new t.Internationalization(this.locale)},s.prototype.initCultureInfo=function(){this.cultureInfo.format=this.format,null!==t.getValue("currency",this)&&(t.setValue("currency",this.currency,this.cultureInfo),this.setProperties({currencyCode:this.currency},!0))},s.prototype.createWrapper=function(){var i=this.cssClass;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(i=this.getNumericValidClassList(this.cssClass));var s=e.Input.createInput({element:this.element,floatLabelType:this.floatLabelType,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:i,enableRtl:this.enableRtl,showClearButton:this.showClearButton,enabled:this.enabled}},this.createElement);this.inputWrapper=s,this.container=s.container,this.container.setAttribute("class","e-control-wrapper e-numeric "+this.container.getAttribute("class")),this.updateHTMLAttrToWrapper(),this.readonly&&t.attributes(this.element,{"aria-readonly":"true"}),this.hiddenInput=this.createElement("input",{attrs:{type:"text",validateHidden:"true",class:"e-numeric-hidden"}}),this.inputName=null!==this.inputName?this.inputName:this.element.id,this.element.removeAttribute("name"),t.attributes(this.hiddenInput,{name:this.inputName}),this.container.insertBefore(this.hiddenInput,this.container.childNodes[1]),this.updateDataAttribute(!1),null!==this.inputStyle&&t.attributes(this.container,{style:this.inputStyle})},s.prototype.updateDataAttribute=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,n=Object.keys(t);s<n.length;s++){var a=n[s];0===a.indexOf("data")&&this.hiddenInput.setAttribute(a,t[a])}},s.prototype.updateHTMLAttrToElement=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];Z.indexOf(s)<0&&this.element.setAttribute(s,this.htmlAttributes[s])}},s.prototype.updateCssClass=function(t,i){e.Input.setCssClass(this.getNumericValidClassList(t),[this.container],this.getNumericValidClassList(i))},s.prototype.getNumericValidClassList=function(e){var i=e;return t.isNullOrUndefined(e)||""===e||(i=e.replace(/\s+/g," ").trim()),i},s.prototype.updateHTMLAttrToWrapper=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if(Z.indexOf(s)>-1)if("class"===s){var n=this.getNumericValidClassList(this.htmlAttributes[s]);""!==n&&t.addClass([this.container],n.split(" "))}else if("style"===s){var a=this.container.getAttribute(s);a=t.isNullOrUndefined(a)?this.htmlAttributes[s]:a+this.htmlAttributes[s],this.container.setAttribute(s,a)}else this.container.setAttribute(s,this.htmlAttributes[s])}},s.prototype.setElementWidth=function(e){t.isNullOrUndefined(e)||("number"==typeof e?this.container.style.width=t.formatUnit(e):"string"==typeof e&&(this.container.style.width=e.match(/px|%|em/)?e:t.formatUnit(e)))},s.prototype.spinBtnCreation=function(){this.spinDown=e.Input.appendSpan(q+" e-spin-down",this.container,this.createElement),t.attributes(this.spinDown,{title:this.l10n.getConstant("decrementTitle"),"aria-label":this.l10n.getConstant("decrementTitle")}),this.spinUp=e.Input.appendSpan(q+" "+W,this.container,this.createElement),t.attributes(this.spinUp,{title:this.l10n.getConstant("incrementTitle"),"aria-label":this.l10n.getConstant("incrementTitle")}),this.wireSpinBtnEvents()},s.prototype.validateMinMax=function(){("number"!=typeof this.min||isNaN(this.min))&&this.setProperties({min:-Number.MAX_VALUE},!0),("number"!=typeof this.max||isNaN(this.max))&&this.setProperties({max:Number.MAX_VALUE},!0),null!==this.decimals&&(this.min!==-Number.MAX_VALUE&&this.setProperties({min:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.min))},!0),this.max!==Number.MAX_VALUE&&this.setProperties({max:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.max))},!0)),this.setProperties({min:this.min>this.max?this.max:this.min},!0),t.attributes(this.element,{"aria-valuemin":this.min.toString(),"aria-valuemax":this.max.toString()})},s.prototype.formattedValue=function(e,t){return this.instance.getNumberFormat({maximumFractionDigits:e,minimumFractionDigits:e,useGrouping:!1})(t)},s.prototype.validateStep=function(){null!==this.decimals&&this.setProperties({step:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.step))},!0)},s.prototype.action=function(e,t){this.isInteract=!0;var i=this.isFocused?this.instance.getNumberParser({format:"n"})(this.element.value):this.value;this.changeValue(this.performAction(i,this.step,e)),this.raiseChangeEvent(t)},s.prototype.checkErrorClass=function(){this.isValidState?t.removeClass([this.container],"e-error"):t.addClass([this.container],"e-error"),t.attributes(this.element,{"aria-invalid":this.isValidState?"false":"true"})},s.prototype.bindClearEvent=function(){this.showClearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this)},s.prototype.resetHandler=function(e){e.preventDefault(),this.inputWrapper.clearButton.classList.contains("e-clear-icon-hide")||this.clear(e),this.isInteract=!0,this.raiseChangeEvent(e)},s.prototype.clear=function(e){this.setProperties({value:null},!0),this.setElementValue(""),this.hiddenInput.value="";if(t.closest(this.element,"form")){var i=this.element.nextElementSibling,s=document.createEvent("KeyboardEvent");s.initEvent("keyup",!1,!0),i.dispatchEvent(s)}},s.prototype.resetFormHandler=function(){"EJS-NUMERICTEXTBOX"===this.element.tagName?this.updateValue(null):this.updateValue(this.inputEleValue)},s.prototype.setSpinButton=function(){t.isNullOrUndefined(this.spinDown)||t.attributes(this.spinDown,{title:this.l10n.getConstant("decrementTitle"),"aria-label":this.l10n.getConstant("decrementTitle")}),t.isNullOrUndefined(this.spinUp)||t.attributes(this.spinUp,{title:this.l10n.getConstant("incrementTitle"),"aria-label":this.l10n.getConstant("incrementTitle")})},s.prototype.wireEvents=function(){t.EventHandler.add(this.element,"focus",this.focusHandler,this),t.EventHandler.add(this.element,"blur",this.focusOutHandler,this),t.EventHandler.add(this.element,"keydown",this.keyDownHandler,this),t.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),t.EventHandler.add(this.element,"input",this.inputHandler,this),t.EventHandler.add(this.element,"keypress",this.keyPressHandler,this),t.EventHandler.add(this.element,"change",this.changeHandler,this),t.EventHandler.add(this.element,"paste",this.pasteHandler,this),this.enabled&&(this.bindClearEvent(),this.formEle&&t.EventHandler.add(this.formEle,"reset",this.resetFormHandler,this))},s.prototype.wireSpinBtnEvents=function(){t.EventHandler.add(this.spinUp,t.Browser.touchStartEvent,this.mouseDownOnSpinner,this),t.EventHandler.add(this.spinDown,t.Browser.touchStartEvent,this.mouseDownOnSpinner,this),t.EventHandler.add(this.spinUp,t.Browser.touchEndEvent,this.mouseUpOnSpinner,this),t.EventHandler.add(this.spinDown,t.Browser.touchEndEvent,this.mouseUpOnSpinner,this),t.EventHandler.add(this.spinUp,t.Browser.touchMoveEvent,this.touchMoveOnSpinner,this),t.EventHandler.add(this.spinDown,t.Browser.touchMoveEvent,this.touchMoveOnSpinner,this)},s.prototype.unwireEvents=function(){t.EventHandler.remove(this.element,"focus",this.focusHandler),t.EventHandler.remove(this.element,"blur",this.focusOutHandler),t.EventHandler.remove(this.element,"keyup",this.keyUpHandler),t.EventHandler.remove(this.element,"input",this.inputHandler),t.EventHandler.remove(this.element,"keydown",this.keyDownHandler),t.EventHandler.remove(this.element,"keypress",this.keyPressHandler),t.EventHandler.remove(this.element,"change",this.changeHandler),t.EventHandler.remove(this.element,"paste",this.pasteHandler),this.formEle&&t.EventHandler.remove(this.formEle,"reset",this.resetFormHandler)},s.prototype.unwireSpinBtnEvents=function(){t.EventHandler.remove(this.spinUp,t.Browser.touchStartEvent,this.mouseDownOnSpinner),t.EventHandler.remove(this.spinDown,t.Browser.touchStartEvent,this.mouseDownOnSpinner),t.EventHandler.remove(this.spinUp,t.Browser.touchEndEvent,this.mouseUpOnSpinner),t.EventHandler.remove(this.spinDown,t.Browser.touchEndEvent,this.mouseUpOnSpinner),t.EventHandler.remove(this.spinUp,t.Browser.touchMoveEvent,this.touchMoveOnSpinner),t.EventHandler.remove(this.spinDown,t.Browser.touchMoveEvent,this.touchMoveOnSpinner)},s.prototype.changeHandler=function(e){e.stopPropagation(),this.element.value.length||this.setProperties({value:null},!0);var t=this.instance.getNumberParser({format:"n"})(this.element.value);this.updateValue(t,e)},s.prototype.raiseChangeEvent=function(e){if(this.prevValue!==this.value){var i={};this.changeEventArgs={value:this.value,previousValue:this.prevValue,isInteracted:this.isInteract,isInteraction:this.isInteract,event:e},e&&(this.changeEventArgs.event=e),void 0===this.changeEventArgs.event&&(this.changeEventArgs.isInteracted=!1,this.changeEventArgs.isInteraction=!1),t.merge(i,this.changeEventArgs),this.prevValue=this.value,this.isInteract=!1,this.elementPrevValue=this.element.value,this.preventChange=!1,this.trigger("change",i)}},s.prototype.pasteHandler=function(){var e=this;if(this.enabled&&!this.readonly){var t=this.element.value;setTimeout(function(){e.numericRegex().test(e.element.value)||e.setElementValue(t)})}},s.prototype.preventHandler=function(){var e=this,i=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform);setTimeout(function(){if(e.element.selectionStart>0){var s=e.element.selectionStart,n=e.element.selectionStart-1,a=e.element.value.split(""),l=t.getNumericObject(e.locale),r=t.getValue("decimal",l).charCodeAt(0);" "===e.element.value[n]&&e.element.selectionStart>0&&!i?(t.isNullOrUndefined(e.prevVal)?e.element.value=e.element.value.trim():0!==n?e.element.value=e.prevVal:0===n&&(e.element.value=e.element.value.trim()),e.element.setSelectionRange(n,n)):isNaN(parseFloat(e.element.value[e.element.selectionStart-1]))&&45!==e.element.value[e.element.selectionStart-1].charCodeAt(0)?(a.indexOf(e.element.value[e.element.selectionStart-1])!==a.lastIndexOf(e.element.value[e.element.selectionStart-1])&&e.element.value[e.element.selectionStart-1].charCodeAt(0)===r||e.element.value[e.element.selectionStart-1].charCodeAt(0)!==r)&&(e.element.value=e.element.value.substring(0,n)+e.element.value.substring(s,e.element.value.length),e.element.setSelectionRange(n,n),isNaN(parseFloat(e.element.value[e.element.selectionStart-1]))&&e.element.selectionStart>0&&e.element.value.length&&e.preventHandler()):isNaN(parseFloat(e.element.value[e.element.selectionStart-2]))&&e.element.selectionStart>1&&45!==e.element.value[e.element.selectionStart-2].charCodeAt(0)&&(a.indexOf(e.element.value[e.element.selectionStart-2])!==a.lastIndexOf(e.element.value[e.element.selectionStart-2])&&e.element.value[e.element.selectionStart-2].charCodeAt(0)===r||e.element.value[e.element.selectionStart-2].charCodeAt(0)!==r)&&(e.element.setSelectionRange(n,n),e.nextEle=e.element.value[e.element.selectionStart],e.cursorPosChanged=!0,e.preventHandler()),!0===e.cursorPosChanged&&e.element.value[e.element.selectionStart]===e.nextEle&&isNaN(parseFloat(e.element.value[e.element.selectionStart-1]))&&(e.element.setSelectionRange(e.element.selectionStart+1,e.element.selectionStart+1),e.cursorPosChanged=!1,e.nextEle=null),""===e.element.value.trim()&&e.element.setSelectionRange(0,0),e.element.selectionStart>0&&45===e.element.value[e.element.selectionStart-1].charCodeAt(0)&&e.element.selectionStart>1&&(t.isNullOrUndefined(e.prevVal)?e.element.value=e.element.value:e.element.value=e.prevVal,e.element.setSelectionRange(e.element.selectionStart,e.element.selectionStart)),e.prevVal=e.element.value}})},s.prototype.keyUpHandler=function(){if(this.enabled&&!this.readonly){!(!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform))&&t.Browser.isDevice&&this.preventHandler();var e=this.instance.getNumberParser({format:"n"})(this.element.value);e=null===e||isNaN(e)?null:e,this.hiddenInput.value=e||0===e?e.toString():null;if(t.closest(this.element,"form")){var i=this.element.nextElementSibling,s=document.createEvent("KeyboardEvent");s.initEvent("keyup",!1,!0),i.dispatchEvent(s)}}},s.prototype.inputHandler=function(e){if(this.enabled&&!this.readonly){var i=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform);if((navigator.userAgent.toLowerCase().indexOf("firefox")>-1||i)&&t.Browser.isDevice&&this.preventHandler(),this.isAngular&&this.element.value!==t.getValue("decimal",t.getNumericObject(this.locale))&&this.element.value!==t.getValue("minusSign",t.getNumericObject(this.locale))){var s=this.instance.getNumberParser({format:"n"})(this.element.value);s=isNaN(s)?null:s,this.localChange({value:s}),this.preventChange=!0}if(this.isVue){var n=this.instance.getNumberParser({format:"n"})(this.element.value),a=this.instance.getNumberParser({format:"n"})(this.elementPrevValue),l={event:e,value:null===n||isNaN(n)?null:n,previousValue:null===a||isNaN(a)?null:a};this.preventChange=!0,this.elementPrevValue=this.element.value,this.trigger("input",l)}}},s.prototype.keyDownHandler=function(e){if(!this.readonly)switch(e.keyCode){case 38:e.preventDefault(),this.action(j,e);break;case 40:e.preventDefault(),this.action(_,e)}},s.prototype.performAction=function(e,t,i){(null===e||isNaN(e))&&(e=0);var s=i===j?e+t:e-t;return s=this.correctRounding(e,t,s),this.strictMode?this.trimValue(s):s},s.prototype.correctRounding=function(e,t,i){var s=new RegExp("[,.](.*)"),n=s.test(e.toString()),a=s.test(t.toString());if(n||a){var l=n?s.exec(e.toString())[0].length:0,r=a?s.exec(t.toString())[0].length:0,o=Math.max(l,r);return e=this.roundValue(i,o)}return i},s.prototype.roundValue=function(e,t){t=t||0;var i=Math.pow(10,t);return e*=i,e=Math.round(e)/i},s.prototype.updateValue=function(e,t){t&&(this.isInteract=!0),null===e||isNaN(e)||this.decimals&&(e=this.roundNumber(e,this.decimals)),this.changeValue(null===e||isNaN(e)?null:this.strictMode?this.trimValue(e):e),this.isDynamicChange||this.raiseChangeEvent(t)},s.prototype.updateCurrency=function(e,i){t.setValue(e,i,this.cultureInfo),this.updateValue(this.value)},s.prototype.changeValue=function(e){if(e||0===e){var t=this.getNumberOfDecimals(e);this.setProperties({value:this.roundNumber(e,t)},!0)}else e=null,this.setProperties({value:e},!0);this.modifyText(),this.strictMode||this.validateState()},s.prototype.modifyText=function(){if(this.value||0===this.value){var e=this.formatNumber(),i=this.isFocused?e:this.instance.getNumberFormat(this.cultureInfo)(this.value);this.setElementValue(i),t.attributes(this.element,{"aria-valuenow":e}),this.hiddenInput.value=this.value.toString(),null!==this.value&&this.serverDecimalSeparator&&(this.hiddenInput.value=this.hiddenInput.value.replace(".",this.serverDecimalSeparator))}else this.setElementValue(""),this.element.removeAttribute("aria-valuenow"),this.hiddenInput.value=null},s.prototype.setElementValue=function(t,i){e.Input.setValue(t,i||this.element,this.floatLabelType,this.showClearButton)},s.prototype.validateState=function(){this.isValidState=!0,(this.value||0===this.value)&&(this.isValidState=!(this.value>this.max||this.value<this.min)),this.checkErrorClass()},s.prototype.getNumberOfDecimals=function(e){var i,s=new RegExp("[eE][-+]?([0-9]+)"),n=e.toString();if(s.test(n)){var a=s.exec(n);t.isNullOrUndefined(a)||(n=e.toFixed(Math.min(parseInt(a[1],10),20)))}var l=n.split(".")[1];return i=l&&l.length?l.length:0,null!==this.decimals&&(i=i<this.decimals?i:this.decimals),i},s.prototype.formatNumber=function(){var e=this.getNumberOfDecimals(this.value);return this.instance.getNumberFormat({maximumFractionDigits:e,minimumFractionDigits:e,useGrouping:!1})(this.value)},s.prototype.trimValue=function(e){return e>this.max?this.max:e<this.min?this.min:e},s.prototype.roundNumber=function(e,t){var i=e,s=t||0,n=i.toString().split("e"),a=(i=Math.round(Number(n[0]+"e"+(n[1]?Number(n[1])+s:s)))).toString().split("e");return i=Number(a[0]+"e"+(a[1]?Number(a[1])-s:-s)),Number(i.toFixed(s))},s.prototype.cancelEvent=function(e){return e.preventDefault(),!1},s.prototype.keyPressHandler=function(e){if(!this.enabled||this.readonly)return!0;if(!t.Browser.isDevice&&"11.0"===t.Browser.info.version&&13===e.keyCode){var i=this.instance.getNumberParser({format:"n"})(this.element.value);return this.updateValue(i,e),!0}if(0===e.which||e.metaKey||e.ctrlKey||8===e.keyCode||13===e.keyCode)return!0;var s=String.fromCharCode(e.which),n=this.element.value;return n=n.substring(0,this.element.selectionStart)+s+n.substring(this.element.selectionEnd),!!this.numericRegex().test(n)||(e.preventDefault(),e.stopPropagation(),!1)},s.prototype.numericRegex=function(){var e=t.getNumericObject(this.locale),i=t.getValue("decimal",e),s="*";return"."===i&&(i="\\"+i),0===this.decimals&&this.validateDecimalOnType?X:(this.decimals&&this.validateDecimalOnType&&(s="{0,"+this.decimals+"}"),new RegExp("^(-)?(((\\d+("+i+"\\d"+s+")?)|("+i+"\\d"+s+")))?$"))},s.prototype.mouseWheel=function(e){e.preventDefault();var t,i=e;i.wheelDelta?t=i.wheelDelta/120:i.detail&&(t=-i.detail/3),t>0?this.action(j,e):t<0&&this.action(_,e),this.cancelEvent(e)},s.prototype.focusHandler=function(e){var i=this;if(this.focusEventArgs={event:e,value:this.value,container:this.container},this.trigger("focus",this.focusEventArgs),this.enabled&&!this.readonly){if(this.isFocused=!0,t.removeClass([this.container],"e-error"),this.prevValue=this.value,this.value||0===this.value){var s=this.formatNumber();if(this.setElementValue(s),!this.isPrevFocused)if(t.Browser.isDevice||"11.0"!==t.Browser.info.version){var n=t.Browser.isDevice&&t.Browser.isIos?600:0;setTimeout(function(){i.element.setSelectionRange(0,s.length)},n)}else this.element.setSelectionRange(0,s.length)}t.Browser.isDevice||t.EventHandler.add(this.element,"mousewheel DOMMouseScroll",this.mouseWheel,this)}},s.prototype.focusOutHandler=function(e){var i=this;if(this.blurEventArgs={event:e,value:this.value,container:this.container},this.trigger("blur",this.blurEventArgs),this.enabled&&!this.readonly){if(this.isPrevFocused){if(e.preventDefault(),t.Browser.isDevice){var s=this.element.value;this.element.focus(),this.isPrevFocused=!1;var n=this.element;setTimeout(function(){i.setElementValue(s,n)},200)}}else{this.isFocused=!1,this.element.value.length||this.setProperties({value:null},!0);var a=this.instance.getNumberParser({format:"n"})(this.element.value);this.updateValue(a),t.Browser.isDevice||t.EventHandler.remove(this.element,"mousewheel DOMMouseScroll",this.mouseWheel)}if(t.closest(this.element,"form")){var l=this.element.nextElementSibling,r=document.createEvent("FocusEvent");r.initEvent("focusout",!1,!0),l.dispatchEvent(r)}}},s.prototype.mouseDownOnSpinner=function(e){var i=this;if(this.isFocused&&(this.isPrevFocused=!0,e.preventDefault()),this.getElementData(e)){this.getElementData(e);var s=e.currentTarget,n=s.classList.contains(W)?j:_;t.EventHandler.add(s,"mouseleave",this.mouseUpClick,this),this.timeOut=setInterval(function(){i.isCalled=!0,i.action(n,e)},150),t.EventHandler.add(document,"mouseup",this.mouseUpClick,this)}},s.prototype.touchMoveOnSpinner=function(e){var t;if("touchmove"===e.type){var i=e.touches;t=i.length&&document.elementFromPoint(i[0].pageX,i[0].pageY)}else t=document.elementFromPoint(e.clientX,e.clientY);t.classList.contains(q)||clearInterval(this.timeOut)},s.prototype.mouseUpOnSpinner=function(e){if(this.isPrevFocused&&(this.element.focus(),t.Browser.isDevice||(this.isPrevFocused=!1)),t.Browser.isDevice||e.preventDefault(),this.getElementData(e)){var i=e.currentTarget,s=i.classList.contains(W)?j:_;t.EventHandler.remove(i,"mouseleave",this.mouseUpClick),this.isCalled||this.action(s,e),this.isCalled=!1,t.EventHandler.remove(document,"mouseup",this.mouseUpClick);if(t.closest(this.element,"form")){var n=this.element.nextElementSibling,a=document.createEvent("KeyboardEvent");a.initEvent("keyup",!1,!0),n.dispatchEvent(a)}}},s.prototype.getElementData=function(e){return!(e.which&&3===e.which||e.button&&2===e.button||!this.enabled||this.readonly)&&(clearInterval(this.timeOut),!0)},s.prototype.floatLabelTypeUpdate=function(){e.Input.removeFloating(this.inputWrapper);var t=this.hiddenInput;this.hiddenInput.remove(),e.Input.addFloating(this.element,this.floatLabelType,this.placeholder,this.createElement),this.container.insertBefore(t,this.container.childNodes[1])},s.prototype.mouseUpClick=function(e){e.stopPropagation(),clearInterval(this.timeOut),this.isCalled=!1,t.EventHandler.remove(this.spinUp,"mouseleave",this.mouseUpClick),t.EventHandler.remove(this.spinDown,"mouseleave",this.mouseUpClick)},s.prototype.increment=function(e){void 0===e&&(e=this.step),this.isInteract=!1,this.changeValue(this.performAction(this.value,e,j)),this.raiseChangeEvent()},s.prototype.decrement=function(e){void 0===e&&(e=this.step),this.isInteract=!1,this.changeValue(this.performAction(this.value,e,_)),this.raiseChangeEvent()},s.prototype.destroy=function(){this.unwireEvents(),t.detach(this.hiddenInput),this.showSpinButton&&(this.unwireSpinBtnEvents(),t.detach(this.spinUp),t.detach(this.spinDown));for(var e=["aria-labelledby","role","autocomplete","aria-readonly","autocorrect","aria-disabled","aria-placeholder","autocapitalize","spellcheck","aria-autocomplete","tabindex","aria-valuemin","aria-valuemax","aria-live","aria-valuenow","aria-invalid"],s=0;s<e.length;s++)this.element.removeAttribute(e[s]);this.element.classList.remove("e-input"),this.container.insertAdjacentElement("afterend",this.element),t.detach(this.container),i.prototype.destroy.call(this)},s.prototype.getText=function(){return this.element.value},s.prototype.focusIn=function(){document.activeElement!==this.element&&this.enabled&&(this.element.focus(),t.addClass([this.container],[K]))},s.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.element.blur(),t.removeClass([this.container],[K]))},s.prototype.getPersistData=function(){return this.addOnPersist(["value"])},s.prototype.onPropertyChanged=function(i,s){for(var n=0,a=Object.keys(i);n<a.length;n++){var l=a[n];switch(l){case"width":this.setElementWidth(i.width);break;case"cssClass":this.updateCssClass(i.cssClass,s.cssClass);break;case"enabled":e.Input.setEnabled(i.enabled,this.element);break;case"enableRtl":e.Input.setEnableRtl(i.enableRtl,[this.container]);break;case"readonly":e.Input.setReadonly(i.readonly,this.element),this.readonly?t.attributes(this.element,{"aria-readonly":"true"}):this.element.removeAttribute("aria-readonly");break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.updateDataAttribute(!0),this.checkAttributes(!0),e.Input.validateInputType(this.container,this.element);break;case"placeholder":e.Input.setPlaceholder(i.placeholder,this.element);break;case"step":this.step=i.step,this.validateStep();break;case"showSpinButton":this.updateSpinButton(i);break;case"showClearButton":this.updateClearButton(i);break;case"floatLabelType":this.floatLabelType=i.floatLabelType,this.floatLabelTypeUpdate();break;case"value":this.isDynamicChange=(this.isAngular||this.isVue)&&this.preventChange,this.updateValue(i.value),this.isDynamicChange&&(this.preventChange=!1,this.isDynamicChange=!1);break;case"min":case"max":t.setValue(l,t.getValue(l,i),this),this.validateMinMax(),this.updateValue(this.value);break;case"strictMode":this.strictMode=i.strictMode,this.updateValue(this.value),this.validateState();break;case"locale":this.initCultureFunc(),this.l10n.setLocale(this.locale),this.setSpinButton(),this.updatePlaceholder(),e.Input.setPlaceholder(this.placeholder,this.element),this.updateValue(this.value);break;case"currency":var r=t.getValue(l,i);this.setProperties({currencyCode:r},!0),this.updateCurrency(l,r);break;case"currencyCode":var o=t.getValue(l,i);this.setProperties({currency:o},!0),this.updateCurrency("currency",o);break;case"format":t.setValue(l,t.getValue(l,i),this),this.initCultureInfo(),this.updateValue(this.value);break;case"decimals":this.decimals=i.decimals,this.updateValue(this.value)}}},s.prototype.updateClearButton=function(t){e.Input.setClearButton(t.showClearButton,this.element,this.inputWrapper,void 0,this.createElement),this.bindClearEvent()},s.prototype.updateSpinButton=function(e){e.showSpinButton?this.spinBtnCreation():(t.detach(this.spinUp),t.detach(this.spinDown))},s.prototype.getModuleName=function(){return"numerictextbox"},z([t.Property("")],s.prototype,"cssClass",void 0),z([t.Property(null)],s.prototype,"value",void 0),z([t.Property(-Number.MAX_VALUE)],s.prototype,"min",void 0),z([t.Property(Number.MAX_VALUE)],s.prototype,"max",void 0),z([t.Property(1)],s.prototype,"step",void 0),z([t.Property(null)],s.prototype,"width",void 0),z([t.Property(null)],s.prototype,"placeholder",void 0),z([t.Property({})],s.prototype,"htmlAttributes",void 0),z([t.Property(!0)],s.prototype,"showSpinButton",void 0),z([t.Property(!1)],s.prototype,"readonly",void 0),z([t.Property(!0)],s.prototype,"enabled",void 0),z([t.Property(!1)],s.prototype,"showClearButton",void 0),z([t.Property(!1)],s.prototype,"enablePersistence",void 0),z([t.Property("n2")],s.prototype,"format",void 0),z([t.Property(null)],s.prototype,"decimals",void 0),z([t.Property(null)],s.prototype,"currency",void 0),z([t.Property(null)],s.prototype,"currencyCode",void 0),z([t.Property(!0)],s.prototype,"strictMode",void 0),z([t.Property(!1)],s.prototype,"validateDecimalOnType",void 0),z([t.Property("Never")],s.prototype,"floatLabelType",void 0),z([t.Event()],s.prototype,"created",void 0),z([t.Event()],s.prototype,"destroyed",void 0),z([t.Event()],s.prototype,"change",void 0),z([t.Event()],s.prototype,"focus",void 0),z([t.Event()],s.prototype,"blur",void 0),s=z([t.NotifyPropertyChanges],s)}(t.Component),G="e-error",J="e-input-group",$="e-float-input",Q="e-utility-mask",ee="e-label-top",te="e-label-bottom",ie={0:"[0-9]",9:"[0-9 ]","#":"[0-9 +-]",L:"[A-Za-z]","?":"[A-Za-z ]","&":"[^ ]+",C:"[^]+",A:"[A-Za-z0-9]",a:"[A-Za-z0-9 ]"},se=function(){return function(){}}(),ne=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)}}(),ae=function(e,t,i,s){var n,a=arguments.length,l=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(l=(a<3?n(l):a>3?n(t,i,l):n(t,i))||l);return a>3&&l&&Object.defineProperty(t,i,l),l},le="e-input-focus",re=["title","style","class"],oe=function(i){function s(e,t){var s=i.call(this,e,t)||this;return s.initInputValue="",s.isAngular=!1,s.preventChange=!1,s.isClicked=!1,s.maskOptions=e,s}return ne(s,i),s.prototype.getModuleName=function(){return"maskedtextbox"},s.prototype.preRender=function(){this.promptMask="",this.hiddenMask="",this.escapeMaskValue="",this.regExpCollec=ie,this.customRegExpCollec=[],this.undoCollec=[],this.redoCollec=[],this.changeEventArgs={},this.focusEventArgs={},this.blurEventArgs={},this.maskKeyPress=!1,this.isFocus=!1,this.isInitial=!1,this.isIosInvalid=!1;var e=t.getValue("ej2_instances",this.element);if(this.cloneElement=this.element.cloneNode(!0),t.removeClass([this.cloneElement],["e-control","e-maskedtextbox","e-lib"]),this.angularTagName=null,this.formElement=t.closest(this.element,"form"),"EJS-MASKEDTEXTBOX"===this.element.tagName){this.angularTagName=this.element.tagName;for(var i=this.createElement("input"),s=0;s<this.element.attributes.length;s++)i.setAttribute(this.element.attributes[s].nodeName,this.element.attributes[s].nodeValue),i.innerHTML=this.element.innerHTML;this.element.hasAttribute("id")&&this.element.removeAttribute("id"),this.element.classList.remove("e-control","e-maskedtextbox"),this.element.classList.add("e-mask-container"),this.element.appendChild(i),this.element=i,t.setValue("ej2_instances",e,this.element)}this.updateHTMLAttrToElement(),this.checkHtmlAttributes(!1),this.formElement&&(this.initInputValue=this.value)},s.prototype.getPersistData=function(){return this.addOnPersist(["value"])},s.prototype.render=function(){"input"===this.element.tagName.toLowerCase()&&("Never"===this.floatLabelType&&t.addClass([this.element],"e-input"),this.createWrapper(),this.updateHTMLAttrToWrapper(),""===this.element.name&&this.element.setAttribute("name",this.element.id),this.isInitial=!0,this.resetMaskedTextBox(),this.isInitial=!1,this.setMaskPlaceholder(!0,!1),this.setWidth(this.width),this.preEleVal=this.element.value,t.Browser.isDevice||"11.0"!==t.Browser.info.version&&"edge"!==t.Browser.info.name||this.element.blur(),t.Browser.isDevice&&t.Browser.isIos&&this.element.blur(),(this.element.getAttribute("value")||this.value)&&this.element.setAttribute("value",this.element.value),this.renderComplete())},s.prototype.updateHTMLAttrToElement=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];re.indexOf(s)<0&&this.element.setAttribute(s,this.htmlAttributes[s])}},s.prototype.updateCssClass=function(t,i){e.Input.setCssClass(this.getValidClassList(t),[this.inputObj.container],this.getValidClassList(i))},s.prototype.getValidClassList=function(e){var i=e;return t.isNullOrUndefined(e)||""===e||(i=e.replace(/\s+/g," ").trim()),i},s.prototype.updateHTMLAttrToWrapper=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if(re.indexOf(s)>-1)if("class"===s){var n=this.htmlAttributes[s].replace(/\s+/g," ").trim();""!==n&&t.addClass([this.inputObj.container],n.split(" "))}else if("style"===s){var a=this.inputObj.container.getAttribute(s);a=t.isNullOrUndefined(a)?this.htmlAttributes[s]:a+this.htmlAttributes[s],this.inputObj.container.setAttribute(s,a)}else this.inputObj.container.setAttribute(s,this.htmlAttributes[s])}},s.prototype.resetMaskedTextBox=function(){this.promptMask="",this.hiddenMask="",this.escapeMaskValue="",this.customRegExpCollec=[],this.undoCollec=[],this.redoCollec=[],this.promptChar.length>1&&(this.promptChar=this.promptChar[0]),n.call(this),a.call(this),(null===this.mask||""===this.mask&&void 0!==this.value)&&F.call(this,this.value);var e=c.call(this,this.element);this.prevValue=e,this.value=e,this.isInitial||r.call(this),l.call(this)},s.prototype.setMaskPlaceholder=function(t,i){(i||this.placeholder)&&(e.Input.setPlaceholder(this.placeholder,this.element),(this.element.value===this.promptMask&&t&&"Always"!==this.floatLabelType||this.element.value===this.promptMask&&"Never"===this.floatLabelType)&&F.call(this,""))},s.prototype.setWidth=function(e){if(!t.isNullOrUndefined(e))if("number"==typeof e)this.inputObj.container.style.width=t.formatUnit(e),this.element.style.width=t.formatUnit(e);else if("string"==typeof e){var i=e.match(/px|%|em/)?e:t.formatUnit(e);this.inputObj.container.style.width=i,this.element.style.width=i}},s.prototype.checkHtmlAttributes=function(e){for(var i=0,s=e?t.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly"];i<s.length;i++){var n=s[i];if(!t.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"placeholder":(t.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.placeholder||e)&&this.setProperties({placeholder:this.element.placeholder},!e);break;case"disabled":if(t.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.enabled||e){var a="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n);this.setProperties({enabled:a},!e)}break;case"value":(t.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.value||e)&&this.setProperties({value:this.element.value},!e);break;case"readonly":if(t.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.readonly||e){var l="readonly"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n);this.setProperties({readonly:l},!e)}}}},s.prototype.createWrapper=function(){var i=this.cssClass;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(i=this.getValidClassList(this.cssClass)),this.inputObj=e.Input.createInput({element:this.element,floatLabelType:this.floatLabelType,properties:{enableRtl:this.enableRtl,cssClass:i,enabled:this.enabled,readonly:this.readonly,placeholder:this.placeholder,showClearButton:this.showClearButton}},this.createElement),this.inputObj.container.setAttribute("class","e-control-wrapper e-mask "+this.inputObj.container.getAttribute("class"))},s.prototype.onPropertyChanged=function(t,i){for(var s=0,n=Object.keys(t);s<n.length;s++){switch(n[s]){case"value":R.call(this,this.value),this.placeholder&&this.setMaskPlaceholder(!1,!1);break;case"placeholder":this.setMaskPlaceholder(!0,!0);break;case"width":this.setWidth(t.width);break;case"cssClass":this.updateCssClass(t.cssClass,i.cssClass);break;case"enabled":e.Input.setEnabled(t.enabled,this.element,this.floatLabelType,this.inputObj.container);break;case"readonly":e.Input.setReadonly(t.readonly,this.element);break;case"enableRtl":e.Input.setEnableRtl(t.enableRtl,[this.inputObj.container]);break;case"customCharacters":this.customCharacters=t.customCharacters,this.resetMaskedTextBox();break;case"showClearButton":e.Input.setClearButton(t.showClearButton,this.element,this.inputObj,void 0,this.createElement),o.call(this);break;case"floatLabelType":this.floatLabelType=t.floatLabelType,e.Input.removeFloating(this.inputObj),e.Input.addFloating(this.element,this.floatLabelType,this.placeholder,this.createElement);break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.checkHtmlAttributes(!0);break;case"mask":var a=this.value;this.mask=t.mask,this.updateValue(a);break;case"promptChar":t.promptChar.length>1&&(t.promptChar=t.promptChar[0]),t.promptChar?this.promptChar=t.promptChar:this.promptChar="_";var l=this.element.value.replace(new RegExp("["+i.promptChar+"]","g"),this.promptChar);this.promptMask===this.element.value&&(l=this.promptMask.replace(new RegExp("["+i.promptChar+"]","g"),this.promptChar)),this.promptMask=this.promptMask.replace(new RegExp("["+i.promptChar+"]","g"),this.promptChar),this.undoCollec=this.redoCollec=[],F.call(this,l)}}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange},s.prototype.updateValue=function(e){this.resetMaskedTextBox(),R.call(this,e)},s.prototype.getMaskedValue=function(){return u.call(this,this.element)},s.prototype.focusIn=function(){document.activeElement!==this.element&&this.enabled&&(this.element.focus(),t.addClass([this.inputObj.container],[le]))},s.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.element.blur(),t.removeClass([this.inputObj.container],[le]))},s.prototype.destroy=function(){r.call(this);for(var e=["aria-labelledby","role","autocomplete","aria-readonly","autocorrect","aria-disabled","aria-placeholder","autocapitalize","spellcheck","aria-autocomplete","aria-live","aria-valuenow","aria-invalid"],s=0;s<e.length;s++)this.element.removeAttribute(e[s]);this.element.classList.remove("e-input"),this.inputObj.container.insertAdjacentElement("afterend",this.element),t.detach(this.inputObj.container),i.prototype.destroy.call(this)},ae([t.Property(null)],s.prototype,"cssClass",void 0),ae([t.Property(null)],s.prototype,"width",void 0),ae([t.Property(null)],s.prototype,"placeholder",void 0),ae([t.Property("Never")],s.prototype,"floatLabelType",void 0),ae([t.Property({})],s.prototype,"htmlAttributes",void 0),ae([t.Property(!0)],s.prototype,"enabled",void 0),ae([t.Property(!1)],s.prototype,"readonly",void 0),ae([t.Property(!1)],s.prototype,"showClearButton",void 0),ae([t.Property(!1)],s.prototype,"enablePersistence",void 0),ae([t.Property(null)],s.prototype,"mask",void 0),ae([t.Property("_")],s.prototype,"promptChar",void 0),ae([t.Property(null)],s.prototype,"value",void 0),ae([t.Property(null)],s.prototype,"customCharacters",void 0),ae([t.Event()],s.prototype,"created",void 0),ae([t.Event()],s.prototype,"destroyed",void 0),ae([t.Event()],s.prototype,"change",void 0),ae([t.Event()],s.prototype,"focus",void 0),ae([t.Event()],s.prototype,"blur",void 0),s=ae([t.NotifyPropertyChanges],s)}(t.Component),he=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)}}(),de=function(e,t,i,s){var n,a=arguments.length,l=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(l=(a<3?n(l):a>3?n(t,i,l):n(t,i))||l);return a>3&&l&&Object.defineProperty(t,i,l),l},ue=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return he(i,e),de([t.Property("None")],i.prototype,"placement",void 0),de([t.Property(10)],i.prototype,"largeStep",void 0),de([t.Property(1)],i.prototype,"smallStep",void 0),de([t.Property(!1)],i.prototype,"showSmallTicks",void 0),de([t.Property(null)],i.prototype,"format",void 0),i}(t.ChildProperty),ce=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return he(i,e),de([t.Property(null)],i.prototype,"color",void 0),de([t.Property(null)],i.prototype,"start",void 0),de([t.Property(null)],i.prototype,"end",void 0),i}(t.ChildProperty),pe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return he(i,e),de([t.Property(!1)],i.prototype,"enabled",void 0),de([t.Property(null)],i.prototype,"minStart",void 0),de([t.Property(null)],i.prototype,"minEnd",void 0),de([t.Property(null)],i.prototype,"maxStart",void 0),de([t.Property(null)],i.prototype,"maxEnd",void 0),de([t.Property(!1)],i.prototype,"startHandleFixed",void 0),de([t.Property(!1)],i.prototype,"endHandleFixed",void 0),i}(t.ChildProperty),me=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return he(i,e),de([t.Property("")],i.prototype,"cssClass",void 0),de([t.Property("Before")],i.prototype,"placement",void 0),de([t.Property("Focus")],i.prototype,"showOn",void 0),de([t.Property(!1)],i.prototype,"isVisible",void 0),de([t.Property(null)],i.prototype,"format",void 0),i}(t.ChildProperty),fe="e-slider",ve="e-rtl",ge="e-slider-input",ye="e-control-wrapper",be="e-handle",Ee="e-range",Ce="e-slider-button",Se="e-first-button",xe="e-second-button",ke="e-scale",Te="e-tick",Oe="e-large",Pe="e-tick-value",Le="e-slider-tooltip",Ae="e-slider-hover",Ne="e-handle-first",He="e-handle-second",Be="e-disabled",we="e-slider-container",Ue="e-slider-horizontal-before",Re="e-slider-horizontal-after",Fe="e-slider-vertical-before",Ve="e-slider-vertical-after",Me="e-material-tooltip-open",Ie="e-tooltip-active",De="e-material-slider",ze="e-slider-track",qe="e-slider-horizantal-color",We="e-slider-vertical-color",je="e-handle-focused",_e="e-vertical",Xe="e-horizontal",Ke="e-handle-start",Ze="e-material-tooltip-start",Ye="e-tab-handle",Ge="e-button-icon",Je="e-small-size",$e="e-tick-pos",Qe="e-first-tick",et="e-last-tick",tt="e-slider-btn",it="e-tab-track",st="e-tab-range",nt="e-handle-active",at="e-material-handle",lt="e-material-range",rt="e-material-default",ot="e-material-tooltip-show",ht="e-material-tooltip-hide",dt="e-read-only",ut="e-limits",ct="e-limit-bar",pt="e-limit-first",mt="e-limit-second",ft="e-drag-horizontal",vt="e-drag-vertical",gt=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.horDir="left",s.verDir="bottom",s.transition={handle:"left .4s cubic-bezier(.25, .8, .25, 1), right .4s cubic-bezier(.25, .8, .25, 1), top .4s cubic-bezier(.25, .8, .25, 1) , bottom .4s cubic-bezier(.25, .8, .25, 1)",rangeBar:"all .4s cubic-bezier(.25, .8, .25, 1)"},s.transitionOnMaterialTooltip={handle:"left 1ms ease-out, right 1ms ease-out, bottom 1ms ease-out, top 1ms ease-out",rangeBar:"left 1ms ease-out, right 1ms ease-out, bottom 1ms ease-out, width 1ms ease-out, height 1ms ease-out"},s.scaleTransform="transform .4s cubic-bezier(.25, .8, .25, 1)",s.customAriaText=null,s.drag=!0,s.isDragComplete=!1,s.initialTooltip=!0,s}return he(s,e),s.prototype.preRender=function(){this.l10n=new t.L10n("slider",{incrementTitle:"Increase",decrementTitle:"Decrease"},this.locale),this.isElementFocused=!1,this.tickElementCollection=[],this.tooltipFormatInfo={},this.ticksFormatInfo={},this.initCultureInfo(),this.initCultureFunc(),this.formChecker()},s.prototype.formChecker=function(){var e=t.closest(this.element,"form");e?(this.isForm=!0,t.isNullOrUndefined(this.formResetValue)||this.setProperties({value:this.formResetValue},!0),this.formResetValue=this.value,"Range"!==this.type||!t.isNullOrUndefined(this.formResetValue)&&"object"==typeof this.formResetValue?t.isNullOrUndefined(this.formResetValue)&&(this.formResetValue=parseFloat(t.formatUnit(this.min))):this.formResetValue=[parseFloat(t.formatUnit(this.min)),parseFloat(t.formatUnit(this.max))],this.formElement=e):this.isForm=!1},s.prototype.initCultureFunc=function(){this.internationalization=new t.Internationalization(this.locale)},s.prototype.initCultureInfo=function(){this.tooltipFormatInfo.format=t.isNullOrUndefined(this.tooltip.format)?null:this.tooltip.format,this.ticksFormatInfo.format=t.isNullOrUndefined(this.ticks.format)?null:this.ticks.format},s.prototype.formatString=function(e,t){var i=null,s=null;if(e||0===e){i=this.formatNumber(e);var n=this.numberOfDecimals(e);s=this.internationalization.getNumberFormat(t)(this.makeRoundNumber(e,n))}return{elementVal:i,formatString:s}},s.prototype.formatNumber=function(e){var t=this.numberOfDecimals(e);return this.internationalization.getNumberFormat({maximumFractionDigits:t,minimumFractionDigits:t,useGrouping:!1})(e)},s.prototype.numberOfDecimals=function(e){var t=e.toString().split(".")[1];return t&&t.length?t.length:0},s.prototype.makeRoundNumber=function(e,t){var i=t||0;return Number(e.toFixed(i))},s.prototype.fractionalToInteger=function(e){e=0===this.numberOfDecimals(e)?Number(e).toFixed(this.noOfDecimals):e;for(var t=1,i=0;i<this.noOfDecimals;i++)t*=10;return e=Number((e*t).toFixed(0))},s.prototype.render=function(){var e=this;this.initialize(),this.initRender(),this.wireEvents(),this.setZindex(),this.renderComplete(),"EJS-SLIDER"===this.element.tagName&&"none"==this.getTheme(this.sliderContainer)&&setTimeout(function(){e.refresh()},0)},s.prototype.initialize=function(){t.addClass([this.element],fe),this.setCSSClass()},s.prototype.setElementWidth=function(e){t.isNullOrUndefined(e)||("number"==typeof e?this.sliderContainer.style.width=t.formatUnit(e):"string"==typeof e&&(this.sliderContainer.style.width=e.match(/px|%|em/)?e:t.formatUnit(e)))},s.prototype.setCSSClass=function(e){e&&t.removeClass([this.element],e.split(" ")),this.cssClass&&t.addClass([this.element],this.cssClass.split(" "))},s.prototype.setEnabled=function(){this.enabled?(t.removeClass([this.sliderContainer],[Be]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.remove(Be),this.wireEvents()):(t.addClass([this.sliderContainer],[Be]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.add(Be),this.unwireEvents())},s.prototype.getTheme=function(e){return window.getComputedStyle(e,":after").getPropertyValue("content").replace(/['"]+/g,"")},s.prototype.initRender=function(){this.sliderContainer=this.createElement("div",{className:we+" "+ye}),this.element.parentNode.insertBefore(this.sliderContainer,this.element),this.sliderContainer.appendChild(this.element),this.sliderTrack=this.createElement("div",{className:ze}),this.element.appendChild(this.sliderTrack),this.setElementWidth(this.width),this.element.tabIndex=-1,this.getThemeInitialization(),this.setHandler(),this.createRangeBar(),this.limits.enabled&&this.createLimitBar(),this.setOrientClass(),this.hiddenInput=this.createElement("input",{attrs:{type:"hidden",value:t.isNullOrUndefined(this.value)?this.min.toString():this.value.toString(),name:this.element.getAttribute("name")||this.element.getAttribute("id")||"_"+(1e3*Math.random()).toFixed(0)+"slider",class:ge}}),this.hiddenInput.tabIndex=-1,this.sliderContainer.appendChild(this.hiddenInput),this.showButtons&&this.setButtons(),this.setEnableRTL(),"Range"===this.type?this.rangeValueUpdate():this.value=t.isNullOrUndefined(this.value)?parseFloat(t.formatUnit(this.min.toString())):this.value,this.previousVal="Range"!==this.type?this.checkHandleValue(parseFloat(t.formatUnit(this.value.toString()))):[this.checkHandleValue(parseFloat(t.formatUnit(this.value[0].toString()))),this.checkHandleValue(parseFloat(t.formatUnit(this.value[1].toString())))],this.previousChanged=this.previousVal,t.isNullOrUndefined(this.element.hasAttribute("name"))||this.element.removeAttribute("name"),this.setValue(),this.limits.enabled&&this.setLimitBar(),"None"!==this.ticks.placement&&this.renderScale(),this.tooltip.isVisible&&this.renderTooltip(),this.enabled?t.removeClass([this.sliderContainer],[Be]):t.addClass([this.sliderContainer],[Be]),this.readonly?t.addClass([this.sliderContainer],[dt]):t.removeClass([this.sliderContainer],[dt])},s.prototype.getThemeInitialization=function(){this.isMaterial="material"===this.getTheme(this.sliderContainer)||"material-dark"===this.getTheme(this.sliderContainer),this.isBootstrap="bootstrap"===this.getTheme(this.sliderContainer)||"bootstrap-dark"===this.getTheme(this.sliderContainer),this.isBootstrap4="bootstrap4"===this.getTheme(this.sliderContainer),this.isTailwind="tailwind"===this.getTheme(this.sliderContainer)||"tailwind-dark"===this.getTheme(this.sliderContainer),this.isBootstrap5="bootstrap5"===this.getTheme(this.sliderContainer),this.isMaterialTooltip=this.isMaterial&&"Range"!==this.type&&this.tooltip.isVisible},s.prototype.createRangeBar=function(){"Default"!==this.type&&(this.rangeBar=this.createElement("div",{attrs:{class:Ee}}),this.element.appendChild(this.rangeBar),this.drag&&"Range"===this.type&&("Horizontal"===this.orientation?this.rangeBar.classList.add(ft):this.rangeBar.classList.add(vt)))},s.prototype.createLimitBar=function(){var e="Range"!==this.type?ct:pt;e+=" "+ut,this.limitBarFirst=this.createElement("div",{attrs:{class:e}}),this.element.appendChild(this.limitBarFirst),"Range"===this.type&&(this.limitBarSecond=this.createElement("div",{attrs:{class:mt+" "+ut}}),this.element.appendChild(this.limitBarSecond))},s.prototype.setOrientClass=function(){"Vertical"!==this.orientation?(this.sliderContainer.classList.remove(_e),this.sliderContainer.classList.add(Xe),this.firstHandle.setAttribute("aria-orientation","horizontal"),"Range"===this.type&&this.secondHandle.setAttribute("aria-orientation","horizontal")):(this.sliderContainer.classList.remove(Xe),this.sliderContainer.classList.add(_e),this.firstHandle.setAttribute("aria-orientation","vertical"),"Range"===this.type&&this.secondHandle.setAttribute("aria-orientation","vertical"))},s.prototype.setAriaAttributes=function(e){var i=this,s=this.min,n=this.max;if(!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&(s=this.customValues[0],n=this.customValues[this.customValues.length-1]),"Range"!==this.type)t.attributes(e,{"aria-valuemin":s.toString(),"aria-valuemax":n.toString()});else{(!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0?[[s.toString(),this.customValues[this.value[1]].toString()],[this.customValues[this.value[0]].toString(),n.toString()]]:[[s.toString(),this.value[1].toString()],[this.value[0].toString(),n.toString()]]).forEach(function(e,s){var n=0===s?i.firstHandle:i.secondHandle;n&&t.attributes(n,{"aria-valuemin":e[0],"aria-valuemax":e[1]})})}},s.prototype.createSecondHandle=function(){this.secondHandle=this.createElement("div",{attrs:{class:be,role:"slider",tabIndex:"0"}}),this.secondHandle.classList.add(He),this.element.appendChild(this.secondHandle)},s.prototype.createFirstHandle=function(){this.firstHandle=this.createElement("div",{attrs:{class:be,role:"slider",tabIndex:"0"}}),this.firstHandle.classList.add(Ne),this.element.appendChild(this.firstHandle),this.isMaterialTooltip&&(this.materialHandle=this.createElement("div",{attrs:{class:be+" "+at}}),this.element.appendChild(this.materialHandle))},s.prototype.wireFirstHandleEvt=function(e){e?(t.EventHandler.remove(this.firstHandle,"mousedown touchstart",this.handleFocus),t.EventHandler.remove(this.firstHandle,"transitionend",this.transitionEnd),t.EventHandler.remove(this.firstHandle,"mouseenter touchenter",this.handleOver),t.EventHandler.remove(this.firstHandle,"mouseleave touchend",this.handleLeave)):(t.EventHandler.add(this.firstHandle,"mousedown touchstart",this.handleFocus,this),t.EventHandler.add(this.firstHandle,"transitionend",this.transitionEnd,this),t.EventHandler.add(this.firstHandle,"mouseenter touchenter",this.handleOver,this),t.EventHandler.add(this.firstHandle,"mouseleave touchend",this.handleLeave,this))},s.prototype.wireSecondHandleEvt=function(e){e?(t.EventHandler.remove(this.secondHandle,"mousedown touchstart",this.handleFocus),t.EventHandler.remove(this.secondHandle,"transitionend",this.transitionEnd),t.EventHandler.remove(this.secondHandle,"mouseenter touchenter",this.handleOver),t.EventHandler.remove(this.secondHandle,"mouseleave touchend",this.handleLeave)):(t.EventHandler.add(this.secondHandle,"mousedown touchstart",this.handleFocus,this),t.EventHandler.add(this.secondHandle,"transitionend",this.transitionEnd,this),t.EventHandler.add(this.secondHandle,"mouseenter touchenter",this.handleOver,this),t.EventHandler.add(this.secondHandle,"mouseleave touchend",this.handleLeave,this))},s.prototype.handleStart=function(){"Range"!==this.type&&(this.firstHandle.classList[0===this.handlePos1?"add":"remove"](Ke),this.isMaterialTooltip&&(this.materialHandle.classList[0===this.handlePos1?"add":"remove"](Ke),this.tooltipElement&&this.tooltipElement.classList[0===this.handlePos1?"add":"remove"](Ze)))},s.prototype.transitionEnd=function(e){"transform"!==e.propertyName&&(this.handleStart(),this.getHandle().style.transition="none","Default"!==this.type&&(this.rangeBar.style.transition="none"),this.isMaterial&&this.tooltip.isVisible&&"Default"===this.type&&(this.tooltipElement.style.transition=this.transition.handle),this.tooltipToggle(this.getHandle()),this.closeTooltip())},s.prototype.handleFocusOut=function(){this.firstHandle.classList.contains(je)&&this.firstHandle.classList.remove(je),"Range"===this.type&&this.secondHandle.classList.contains(je)&&this.secondHandle.classList.remove(je)},s.prototype.handleFocus=function(e){this.focusSliderElement(),this.sliderBarClick(e),e.currentTarget===this.firstHandle?this.firstHandle.classList.add(je):this.secondHandle.classList.add(je),t.EventHandler.add(document,"mousemove touchmove",this.sliderBarMove,this),t.EventHandler.add(document,"mouseup touchend",this.sliderBarUp,this)},s.prototype.handleOver=function(e){this.tooltip.isVisible&&"Hover"===this.tooltip.showOn&&this.tooltipToggle(e.currentTarget),"Default"===this.type&&this.tooltipToggle(this.getHandle())},s.prototype.handleLeave=function(e){!this.tooltip.isVisible||"Hover"!==this.tooltip.showOn||e.currentTarget.classList.contains(je)||e.currentTarget.classList.contains(Ye)||this.closeTooltip()},s.prototype.setHandler=function(){this.min>this.max&&(this.min=this.max),this.createFirstHandle(),"Range"===this.type&&this.createSecondHandle()},s.prototype.setEnableRTL=function(){this.enableRtl&&"Vertical"!==this.orientation?t.addClass([this.sliderContainer],ve):t.removeClass([this.sliderContainer],ve);var e="Vertical"!==this.orientation?this.horDir:this.verDir;this.enableRtl?(this.horDir="right",this.verDir="bottom"):(this.horDir="left",this.verDir="bottom");e!==("Vertical"!==this.orientation?this.horDir:this.verDir)&&"Horizontal"===this.orientation&&(t.setStyleAttribute(this.firstHandle,{right:"",left:"auto"}),"Range"===this.type&&t.setStyleAttribute(this.secondHandle,{top:"",left:"auto"})),this.setBarColor()},s.prototype.tooltipValue=function(){var e,t=this,i={value:this.value,text:""};this.initialTooltip&&(this.initialTooltip=!1,this.setTooltipContent(),i.text=e=this.tooltipObj.content,this.trigger("tooltipChange",i,function(i){t.addTooltipClass(i.text),e!==i.text&&(t.customAriaText=i.text,t.tooltipObj.content=i.text,t.setAriaAttrValue(t.firstHandle),"Range"===t.type&&t.setAriaAttrValue(t.secondHandle))}),this.isMaterialTooltip&&this.setPreviousVal("change",this.value))},s.prototype.setTooltipContent=function(){var e;e=this.formatContent(this.tooltipFormatInfo,!1),this.tooltipObj.content=e},s.prototype.formatContent=function(e,i){var s="",n=this.handleVal1,a=this.handleVal2;return!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&(n=this.customValues[this.handleVal1],a=this.customValues[this.handleVal2]),i?("Range"===this.type?s=this.enableRtl&&"Vertical"!==this.orientation?t.isNullOrUndefined(this.tooltip)||t.isNullOrUndefined(this.tooltip.format)?a.toString()+" - "+n.toString():this.formatString(a,e).elementVal+" - "+this.formatString(n,e).elementVal:t.isNullOrUndefined(this.tooltip)||t.isNullOrUndefined(this.tooltip.format)?n.toString()+" - "+a.toString():this.formatString(n,e).elementVal+" - "+this.formatString(a,e).elementVal:t.isNullOrUndefined(n)||(s=t.isNullOrUndefined(this.tooltip)||t.isNullOrUndefined(this.tooltip.format)?n.toString():this.formatString(n,e).elementVal),s):("Range"===this.type?s=this.enableRtl&&"Vertical"!==this.orientation?t.isNullOrUndefined(e.format)?a.toString()+" - "+n.toString():this.formatString(a,e).formatString+" - "+this.formatString(n,e).formatString:t.isNullOrUndefined(e.format)?n.toString()+" - "+a.toString():this.formatString(n,e).formatString+" - "+this.formatString(a,e).formatString:t.isNullOrUndefined(n)||(s=t.isNullOrUndefined(e.format)?n.toString():this.formatString(n,e).formatString),s)},s.prototype.addTooltipClass=function(e){if(this.isMaterialTooltip){var t=e.toString().length;if(this.tooltipElement){i=t>4?{oldCss:rt,newCss:lt}:{oldCss:lt,newCss:rt};this.tooltipElement.classList.remove(i.oldCss),this.tooltipElement.classList.contains(i.newCss)||(this.tooltipElement.classList.add(i.newCss),this.tooltipElement.style.transform=t>4?"scale(1)":this.getTooltipTransformProperties(this.previousTooltipClass).rotate)}else{var i=t>4?lt:rt;this.tooltipObj.cssClass=Le+" "+i}}},s.prototype.tooltipPlacement=function(){return"Horizontal"===this.orientation?"Before"===this.tooltip.placement?"TopCenter":"BottomCenter":"Before"===this.tooltip.placement?"LeftCenter":"RightCenter"},s.prototype.tooltipBeforeOpen=function(e){this.tooltipElement=e.element,this.tooltip.cssClass&&t.addClass([this.tooltipElement],this.tooltip.cssClass.split(" ").filter(function(e){return e})),e.target.removeAttribute("aria-describedby"),this.isMaterialTooltip&&(this.tooltipElement.firstElementChild.classList.add(ht),this.handleStart(),this.setTooltipTransform())},s.prototype.tooltipCollision=function(e){if(this.isBootstrap||this.isBootstrap4||this.isMaterial&&!this.isMaterialTooltip){var t=this.isBootstrap4?3:6;switch(e){case"TopCenter":this.tooltipObj.setProperties({offsetY:-t},!1);break;case"BottomCenter":this.tooltipObj.setProperties({offsetY:t},!1);break;case"LeftCenter":this.tooltipObj.setProperties({offsetX:-t},!1);break;case"RightCenter":this.tooltipObj.setProperties({offsetX:t},!1)}}},s.prototype.materialTooltipEventCallBack=function(e){this.sliderBarClick(e),t.EventHandler.add(document,"mousemove touchmove",this.sliderBarMove,this),t.EventHandler.add(document,"mouseup touchend",this.sliderBarUp,this)},s.prototype.wireMaterialTooltipEvent=function(e){this.isMaterialTooltip&&(e?t.EventHandler.remove(this.tooltipElement,"mousedown touchstart",this.materialTooltipEventCallBack):t.EventHandler.add(this.tooltipElement,"mousedown touchstart",this.materialTooltipEventCallBack,this))},s.prototype.tooltipPositionCalculation=function(e){var t;switch(e){case"TopCenter":t=Ue;break;case"BottomCenter":t=Re;break;case"LeftCenter":t=Fe;break;case"RightCenter":t=Ve}return t},s.prototype.getTooltipTransformProperties=function(e){var t;if(this.tooltipElement){var i="Horizontal"===this.orientation?this.tooltipElement.clientHeight+14-this.tooltipElement.clientHeight/2:this.tooltipElement.clientWidth+14-this.tooltipElement.clientWidth/2;t="Horizontal"===this.orientation?e===Ue?{rotate:"rotate(45deg)",translate:"translateY("+i+"px)"}:{rotate:"rotate(225deg)",translate:"translateY("+-i+"px)"}:e===Fe?{rotate:"rotate(-45deg)",translate:"translateX("+i+"px)"}:{rotate:"rotate(-225deg)",translate:"translateX("+-i+"px)"}}return t},s.prototype.openMaterialTooltip=function(){var e=this;if(this.isMaterialTooltip){this.refreshTooltip(this.firstHandle);var t=this.tooltipElement.firstElementChild;t.classList.remove(ht),t.classList.add(ot),this.firstHandle.style.cursor="default",this.tooltipElement.style.transition=this.scaleTransform,this.tooltipElement.classList.add(Me),this.materialHandle.style.transform="scale(0)",t.innerText.length>4?this.tooltipElement.style.transform="scale(1)":this.tooltipElement.style.transform=this.getTooltipTransformProperties(this.previousTooltipClass).rotate,"Default"===this.type?setTimeout(function(){e.tooltipElement.style.transition=e.transition.handle},2500):setTimeout(function(){e.tooltipElement.style.transition="none"},2500)}},s.prototype.closeMaterialTooltip=function(){var e=this;if(this.isMaterialTooltip){var t=this.tooltipElement.firstElementChild;this.tooltipElement.style.transition=this.scaleTransform,t.classList.remove(ot),t.classList.add(ht),this.firstHandle.style.cursor="-webkit-grab",this.firstHandle.style.cursor="grab",this.materialHandle&&(this.materialHandle.style.transform="scale(1)"),this.tooltipElement.classList.remove(Me),this.setTooltipTransform(),this.tooltipTarget=void 0,setTimeout(function(){e.tooltipElement.style.transition="none"},2500)}},s.prototype.checkTooltipPosition=function(e){var t=this.tooltipPositionCalculation(e.collidedPosition);void 0!==this.tooltipCollidedPosition&&this.tooltipCollidedPosition===e.collidedPosition&&e.element.classList.contains(t)||(this.isMaterialTooltip&&(void 0!==t&&(e.element.classList.remove(this.previousTooltipClass),e.element.classList.add(t),this.previousTooltipClass=t),e.element.style.transform&&e.element.classList.contains(Me)&&e.element.firstElementChild.innerText.length<=4&&(e.element.style.transform=this.getTooltipTransformProperties(this.previousTooltipClass).rotate)),this.tooltipCollidedPosition=e.collidedPosition),this.isMaterialTooltip&&this.tooltipElement&&-1!==this.tooltipElement.style.transform.indexOf("translate")&&this.setTooltipTransform()},s.prototype.setTooltipTransform=function(){var e=this.getTooltipTransformProperties(this.previousTooltipClass);this.tooltipElement.firstElementChild.innerText.length>4?this.tooltipElement.style.transform=e.translate+" scale(0.01)":this.tooltipElement.style.transform=e.translate+" "+e.rotate+" scale(0.01)"},s.prototype.renderTooltip=function(){this.tooltipObj=new i.Tooltip({showTipPointer:this.isBootstrap||this.isMaterial||this.isBootstrap4||this.isTailwind||this.isBootstrap5,cssClass:Le,height:this.isMaterial?30:"auto",animation:{open:{effect:"None"},close:{effect:"FadeOut",duration:500}},opensOn:"Custom",beforeOpen:this.tooltipBeforeOpen.bind(this),beforeCollision:this.checkTooltipPosition.bind(this),beforeClose:this.tooltipBeforeClose.bind(this),enableHtmlSanitizer:this.enableHtmlSanitizer}),this.tooltipObj.appendTo(this.firstHandle),this.initializeTooltipProps()},s.prototype.initializeTooltipProps=function(){var e=this.isMaterialTooltip?"Always":"Auto"===this.tooltip.showOn?"Hover":this.tooltip.showOn;this.setProperties({tooltip:{showOn:e}},!0),this.tooltipObj.position=this.tooltipPlacement(),this.tooltipCollision(this.tooltipObj.position),[this.firstHandle,this.rangeBar,this.secondHandle].forEach(function(e){t.isNullOrUndefined(e)||(e.style.transition="none")}),this.isMaterialTooltip&&(this.sliderContainer.classList.add(De),this.tooltipValue(),this.tooltipObj.animation.close.effect="None",this.tooltipObj.open(this.firstHandle))},s.prototype.tooltipBeforeClose=function(){this.tooltipElement=void 0,this.tooltipCollidedPosition=void 0},s.prototype.setButtons=function(){this.firstBtn=this.createElement("div",{className:Ce+" "+Se}),this.firstBtn.appendChild(this.createElement("span",{className:Ge})),this.isTailwind&&this.firstBtn.querySelector("span").classList.add("e-icons"),this.firstBtn.tabIndex=-1,this.secondBtn=this.createElement("div",{className:Ce+" "+xe}),this.secondBtn.appendChild(this.createElement("span",{className:Ge})),this.isTailwind&&this.secondBtn.querySelector("span").classList.add("e-icons"),this.secondBtn.tabIndex=-1,this.sliderContainer.classList.add(tt),this.sliderContainer.appendChild(this.firstBtn),this.sliderContainer.appendChild(this.secondBtn),this.sliderContainer.appendChild(this.element),this.buttonTitle()},s.prototype.buttonTitle=function(){var e=this.enableRtl&&"Vertical"!==this.orientation;this.l10n.setLocale(this.locale);var i=this.l10n.getConstant("decrementTitle"),s=this.l10n.getConstant("incrementTitle");t.attributes(e?this.secondBtn:this.firstBtn,{"aria-label":i,title:i}),t.attributes(e?this.firstBtn:this.secondBtn,{"aria-label":s,title:s})},s.prototype.buttonFocusOut=function(){this.isMaterial&&this.getHandle().classList.remove("e-large-thumb-size")},s.prototype.repeatButton=function(e){var t,i=this.handleValueUpdate(),s=this.enableRtl&&"Vertical"!==this.orientation;e.target.parentElement.classList.contains(Se)||e.target.classList.contains(Se)?t=s?this.add(i,parseFloat(this.step.toString()),!0):this.add(i,parseFloat(this.step.toString()),!1):(e.target.parentElement.classList.contains(xe)||e.target.classList.contains(xe))&&(t=s?this.add(i,parseFloat(this.step.toString()),!1):this.add(i,parseFloat(this.step.toString()),!0)),this.limits.enabled&&(t=this.getLimitCorrectedValues(t)),t>=this.min&&t<=this.max&&(this.changeHandleValue(t),this.tooltipToggle(this.getHandle()))},s.prototype.repeatHandlerMouse=function(e){e.preventDefault(),"mousedown"!==e.type&&"touchstart"!==e.type||(this.buttonClick(e),this.repeatInterval=setInterval(this.repeatButton.bind(this),180,e))},s.prototype.materialChange=function(){this.getHandle().classList.contains("e-large-thumb-size")||this.getHandle().classList.add("e-large-thumb-size")},s.prototype.repeatHandlerUp=function(e){this.changeEvent("changed",e),this.closeTooltip(),clearInterval(this.repeatInterval),this.getHandle().focus()},s.prototype.customTickCounter=function(e){var i=4;return!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&(e>4&&(i=3),e>7&&(i=2),e>14&&(i=1),e>28&&(i=0)),i},s.prototype.renderScale=function(){var e="Vertical"===this.orientation?"v":"h";this.noOfDecimals=this.numberOfDecimals(this.step),this.ul=this.createElement("ul",{className:ke+" e-"+e+"-scale "+Te+"-"+this.ticks.placement.toLowerCase(),attrs:{role:"presentation",tabIndex:"-1","aria-hidden":"true"}}),this.ul.style.zIndex="-1",t.Browser.isAndroid&&"h"===e&&this.ul.classList.add($e);var i=this.ticks.smallStep;this.ticks.showSmallTicks?i<=0&&(i=parseFloat(t.formatUnit(this.step))):i=this.ticks.largeStep>0?this.ticks.largeStep:parseFloat(t.formatUnit(this.max))-parseFloat(t.formatUnit(this.min));var s=this.fractionalToInteger(this.min),n=this.fractionalToInteger(this.max),a=this.fractionalToInteger(i),l=!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&this.customValues.length-1,r=this.customTickCounter(l),o=!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0?l*r+l:Math.abs((n-s)/a);this.element.appendChild(this.ul);var h,d=parseFloat(this.min.toString());"v"===e&&(d=parseFloat(this.max.toString()));var u,c=0,p=100/o;p===1/0&&(p=5);for(var m=0,f=!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0?this.customValues.length-1:0,v=0;m<=o;m++){if(h=this.createElement("li",{attrs:{class:Te,role:"presentation",tabIndex:"-1","aria-hidden":"true"}}),!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0)(u=m%(r+1)==0)&&("h"===e?(d=this.customValues[v],v++):(d=this.customValues[f],f--),h.setAttribute("title",d.toString()));else if(h.setAttribute("title",d.toString()),0===this.numberOfDecimals(this.max)&&0===this.numberOfDecimals(this.min)&&0===this.numberOfDecimals(this.step))u="h"===e?(d-parseFloat(this.min.toString()))%this.ticks.largeStep==0:Math.abs(d-parseFloat(this.max.toString()))%this.ticks.largeStep==0;else{var g=this.fractionalToInteger(this.ticks.largeStep),y=this.fractionalToInteger(d);u="h"===e?(y-s)%g==0:Math.abs(y-parseFloat(n.toString()))%g==0}u&&h.classList.add(Oe),"h"===e?h.style.width=p+"%":h.style.height=p+"%";var b=u?"Both"===this.ticks.placement?2:1:0;if(u)for(var E=0;E<b;E++)this.createTick(h,d,p);else t.isNullOrUndefined(this.customValues)&&this.formatTicksValue(h,d);this.ul.appendChild(h),this.tickElementCollection.push(h);var C=void 0;t.isNullOrUndefined(this.customValues)&&(C=this.numberOfDecimals(i)>this.numberOfDecimals(d)?this.numberOfDecimals(i):this.numberOfDecimals(d),d="h"===e?this.makeRoundNumber(d+i,C):this.makeRoundNumber(d-i,C),c=this.makeRoundNumber(c+i,C))}this.ticksAlignment(e,p)},s.prototype.ticksAlignment=function(e,t,i){void 0===i&&(i=!0),this.firstChild=this.ul.firstElementChild,this.lastChild=this.ul.lastElementChild,this.firstChild.classList.add(Qe),this.lastChild.classList.add(et),this.sliderContainer.classList.add(ke+"-"+this.ticks.placement.toLowerCase()),"h"===e?(this.firstChild.style.width=t/2+"%",this.lastChild.style.width=t/2+"%"):(this.firstChild.style.height=t/2+"%",this.lastChild.style.height=t/2+"%");var s={ticksWrapper:this.ul,tickElements:this.tickElementCollection};i&&this.trigger("renderedTicks",s),this.scaleAlignment()},s.prototype.createTick=function(e,i,s){var n=this.createElement("span",{className:Pe+" "+Te+"-"+this.ticks.placement.toLowerCase(),attrs:{role:"presentation",tabIndex:"-1","aria-hidden":"true"}});e.appendChild(n),t.isNullOrUndefined(this.customValues)?this.formatTicksValue(e,i,n,s):this.enableHtmlSanitizer?n.innerHTML=t.SanitizeHtmlHelper.sanitize(i.toString()):n.innerHTML=i.toString()},s.prototype.formatTicksValue=function(e,i,s,n){var a=this,l=this.formatNumber(i),r={value:i,text:t.isNullOrUndefined(this.ticks)||t.isNullOrUndefined(this.ticks.format)?l:this.formatString(i,this.ticksFormatInfo).formatString,tickElement:e};this.trigger("renderingTicks",r,function(i){e.setAttribute("title",i.text.toString()),s&&(a.enableHtmlSanitizer?s.innerHTML=t.SanitizeHtmlHelper.sanitize(i.text.toString()):s.innerHTML=i.text.toString())})},s.prototype.scaleAlignment=function(){this.tickValuePosition();this.orientation;"Vertical"===this.orientation?this.element.getBoundingClientRect().width<=15?this.sliderContainer.classList.add(Je):this.sliderContainer.classList.remove(Je):this.element.getBoundingClientRect().height<=15?this.sliderContainer.classList.add(Je):this.sliderContainer.classList.remove(Je)},s.prototype.tickValuePosition=function(){this.firstChild=this.element.querySelector("ul").children[0];var e,i,s=this.firstChild.getBoundingClientRect(),n=this.ticks.smallStep,a=Math.abs(parseFloat(t.formatUnit(this.max))-parseFloat(t.formatUnit(this.min)))/n;this.firstChild.children.length>0&&(e=this.firstChild.children[0].getBoundingClientRect());var l,r=[this.sliderContainer.querySelectorAll("."+Te+"."+Oe+" ."+Pe)];l="Both"===this.ticks.placement?[].slice.call(r[0],2):[].slice.call(r[0],1);for(var o="Vertical"===this.orientation?2*s.height:2*s.width,h=0;h<this.firstChild.children.length;h++)"Vertical"===this.orientation?this.firstChild.children[h].style.top=-e.height/2+"px":this.enableRtl?this.firstChild.children[h].style.left=(o-this.firstChild.children[h].getBoundingClientRect().width)/2+"px":this.firstChild.children[h].style.left=-e.width/2+"px";for(h=0;h<l.length;h++)i=l[h].getBoundingClientRect(),"Vertical"===this.orientation?t.setStyleAttribute(l[h],{top:(o-i.height)/2+"px"}):t.setStyleAttribute(l[h],{left:(o-i.width)/2+"px"});this.enableRtl&&this.lastChild.children.length&&0!==a&&(this.lastChild.children[0].style.left=-this.lastChild.getBoundingClientRect().width/2+"px","Both"===this.ticks.placement&&(this.lastChild.children[1].style.left=-this.lastChild.getBoundingClientRect().width/2+"px")),0===a&&("Horizontal"===this.orientation&&(this.enableRtl?(this.firstChild.classList.remove(et),this.firstChild.style.right=this.firstHandle.style.right,this.firstChild.children[0].style.left=this.firstChild.getBoundingClientRect().width/2+2+"px","Both"===this.ticks.placement&&(this.firstChild.children[1].style.left=this.firstChild.getBoundingClientRect().width/2+2+"px")):(this.firstChild.classList.remove(et),this.firstChild.style.left=this.firstHandle.style.left)),"Vertical"===this.orientation&&this.firstChild.classList.remove(et))},s.prototype.setAriaAttrValue=function(e){var i,s=!t.isNullOrUndefined(this.ticks)&&!t.isNullOrUndefined(this.ticks.format),n=s?this.formatContent(this.tooltipFormatInfo,!1):this.formatContent(this.ticksFormatInfo,!1),a=s?this.formatContent(this.ticksFormatInfo,!0):this.formatContent(this.tooltipFormatInfo,!0);i=2===(n=this.customAriaText?this.customAriaText:n).split(" - ").length?n.split(" - "):[n,n],this.setAriaAttributes(e),"Range"!==this.type?t.attributes(e,{"aria-valuenow":a,"aria-valuetext":n}):this.enableRtl?e===this.firstHandle?t.attributes(e,{"aria-valuenow":a.split(" - ")[1],"aria-valuetext":i[1]}):t.attributes(e,{"aria-valuenow":a.split(" - ")[0],"aria-valuetext":i[0]}):e===this.firstHandle?t.attributes(e,{"aria-valuenow":a.split(" - ")[0],"aria-valuetext":i[0]}):t.attributes(e,{"aria-valuenow":a.split(" - ")[1],"aria-valuetext":i[1]})},s.prototype.handleValueUpdate=function(){return"Range"===this.type?1===this.activeHandle?this.handleVal1:this.handleVal2:this.handleVal1},s.prototype.getLimitCorrectedValues=function(e){return e="MinRange"===this.type||"Default"===this.type?this.getLimitValueAndPosition(e,this.limits.minStart,this.limits.minEnd)[0]:1===this.activeHandle?this.getLimitValueAndPosition(e,this.limits.minStart,this.limits.minEnd)[0]:this.getLimitValueAndPosition(e,this.limits.maxStart,this.limits.maxEnd)[0]},s.prototype.focusSliderElement=function(){this.isElementFocused||(this.element.focus(),this.isElementFocused=!0)},s.prototype.buttonClick=function(e){this.focusSliderElement();var i,s=this.enableRtl&&"Vertical"!==this.orientation,n=this.handleValueUpdate();40===e.keyCode||37===e.keyCode||e.currentTarget.classList.contains(Se)?i=s?this.add(n,parseFloat(this.step.toString()),!0):this.add(n,parseFloat(this.step.toString()),!1):38===e.keyCode||39===e.keyCode||e.currentTarget.classList.contains(xe)?i=s?this.add(n,parseFloat(this.step.toString()),!1):this.add(n,parseFloat(this.step.toString()),!0):33===e.keyCode||e.currentTarget.classList.contains(Se)?i=s?this.add(n,parseFloat(this.ticks.largeStep.toString()),!1):this.add(n,parseFloat(this.ticks.largeStep.toString()),!0):34===e.keyCode||e.currentTarget.classList.contains(xe)?i=s?this.add(n,parseFloat(this.ticks.largeStep.toString()),!0):this.add(n,parseFloat(this.ticks.largeStep.toString()),!1):36===e.keyCode?i=parseFloat(this.min.toString()):35===e.keyCode&&(i=parseFloat(this.max.toString())),this.limits.enabled&&(i=this.getLimitCorrectedValues(i)),this.changeHandleValue(i),!this.isMaterial||this.tooltip.isVisible||this.getHandle().classList.contains(Ye)||this.materialChange(),this.tooltipToggle(this.getHandle()),this.getHandle().focus(),e.currentTarget.classList.contains(Se)&&t.EventHandler.add(this.firstBtn,"mouseup touchend",this.buttonUp,this),e.currentTarget.classList.contains(xe)&&t.EventHandler.add(this.secondBtn,"mouseup touchend",this.buttonUp,this)},s.prototype.tooltipToggle=function(e){this.isMaterialTooltip?this.tooltipElement.classList.contains(Me)?this.refreshTooltip(this.firstHandle):this.openMaterialTooltip():this.tooltipElement?this.refreshTooltip(e):this.openTooltip(e)},s.prototype.buttonUp=function(e){e.currentTarget.classList.contains(Se)&&t.EventHandler.remove(this.firstBtn,"mouseup touchend",this.buttonUp),e.currentTarget.classList.contains(xe)&&t.EventHandler.remove(this.secondBtn,"mouseup touchend",this.buttonUp)},s.prototype.setRangeBar=function(){"Horizontal"===this.orientation?"MinRange"===this.type?(this.enableRtl?this.rangeBar.style.right="0px":this.rangeBar.style.left="0px",t.setStyleAttribute(this.rangeBar,{width:t.isNullOrUndefined(this.handlePos1)?0:this.handlePos1+"px"})):(this.enableRtl?this.rangeBar.style.right=this.handlePos1+"px":this.rangeBar.style.left=this.handlePos1+"px",t.setStyleAttribute(this.rangeBar,{width:this.handlePos2-this.handlePos1+"px"})):"MinRange"===this.type?(this.rangeBar.style.bottom="0px",t.setStyleAttribute(this.rangeBar,{height:t.isNullOrUndefined(this.handlePos1)?0:this.handlePos1+"px"})):(this.rangeBar.style.bottom=this.handlePos1+"px",t.setStyleAttribute(this.rangeBar,{height:this.handlePos2-this.handlePos1+"px"}))},s.prototype.checkValidValueAndPos=function(e){return e=this.checkHandleValue(e),e=this.checkHandlePosition(e)},s.prototype.setLimitBarPositions=function(e,t,i,s){"Horizontal"===this.orientation?this.enableRtl?(this.limitBarFirst.style.right=e+"px",this.limitBarFirst.style.width=t-e+"px"):(this.limitBarFirst.style.left=e+"px",this.limitBarFirst.style.width=t-e+"px"):(this.limitBarFirst.style.bottom=e+"px",this.limitBarFirst.style.height=t-e+"px"),"Range"===this.type&&("Horizontal"===this.orientation?this.enableRtl?(this.limitBarSecond.style.right=i+"px",this.limitBarSecond.style.width=s-i+"px"):(this.limitBarSecond.style.left=i+"px",this.limitBarSecond.style.width=s-i+"px"):(this.limitBarSecond.style.bottom=i+"px",this.limitBarSecond.style.height=s-i+"px"))},s.prototype.setLimitBar=function(){if("Default"===this.type||"MinRange"===this.type){var e=this.getLimitValueAndPosition(this.limits.minStart,this.limits.minStart,this.limits.minEnd,!0)[0];e=this.checkValidValueAndPos(e);var t=this.getLimitValueAndPosition(this.limits.minEnd,this.limits.minStart,this.limits.minEnd,!0)[0];t=this.checkValidValueAndPos(t),this.setLimitBarPositions(e,t)}else if("Range"===this.type){var i=this.getLimitValueAndPosition(this.limits.minStart,this.limits.minStart,this.limits.minEnd,!0)[0];i=this.checkValidValueAndPos(i);var s=this.getLimitValueAndPosition(this.limits.minEnd,this.limits.minStart,this.limits.minEnd,!0)[0];s=this.checkValidValueAndPos(s);var n=this.getLimitValueAndPosition(this.limits.maxStart,this.limits.maxStart,this.limits.maxEnd,!0)[0];n=this.checkValidValueAndPos(n);var a=this.getLimitValueAndPosition(this.limits.maxEnd,this.limits.maxStart,this.limits.maxEnd,!0)[0];a=this.checkValidValueAndPos(a),this.setLimitBarPositions(i,s,n,a)}},s.prototype.getLimitValueAndPosition=function(e,i,s,n){return t.isNullOrUndefined(i)&&(i=this.min,t.isNullOrUndefined(e)&&n&&(e=i)),t.isNullOrUndefined(s)&&(s=this.max,t.isNullOrUndefined(e)&&n&&(e=s)),e<i&&(e=i),e>s&&(e=s),[e,this.checkHandlePosition(e)]},s.prototype.setValue=function(){if(!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&(this.min=0,this.max=this.customValues.length-1,this.setBarColor()),this.setAriaAttributes(this.firstHandle),this.handleVal1=t.isNullOrUndefined(this.value)?this.checkHandleValue(parseFloat(this.min.toString())):this.checkHandleValue(parseFloat(this.value.toString())),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.preHandlePos1=this.handlePos1,t.isNullOrUndefined(this.activeHandle)?"Range"===this.type?this.activeHandle=2:this.activeHandle=1:this.activeHandle=this.activeHandle,"Default"===this.type||"MinRange"===this.type){if(this.limits.enabled){var e=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd);this.handleVal1=e[0],this.handlePos1=e[1],this.preHandlePos1=this.handlePos1}this.setHandlePosition(null),this.handleStart(),this.value=this.handleVal1,this.setAriaAttrValue(this.firstHandle),this.changeEvent("changed",null)}else this.validateRangeValue();"Default"!==this.type&&this.setRangeBar(),this.limits.enabled&&this.setLimitBar()},s.prototype.rangeValueUpdate=function(){null!==this.value&&"object"==typeof this.value||(this.value=[parseFloat(t.formatUnit(this.min)),parseFloat(t.formatUnit(this.max))])},s.prototype.validateRangeValue=function(){this.rangeValueUpdate(),this.setRangeValue()},s.prototype.modifyZindex=function(){"Range"===this.type?1===this.activeHandle?(this.firstHandle.style.zIndex=this.zIndex+4+"",this.secondHandle.style.zIndex=this.zIndex+3+""):(this.firstHandle.style.zIndex=this.zIndex+3+"",this.secondHandle.style.zIndex=this.zIndex+4+""):this.isMaterialTooltip&&this.tooltipElement&&(this.tooltipElement.style.zIndex=i.getZindexPartial(this.element)+"")},s.prototype.setHandlePosition=function(e){var t,i=this,s=1===this.activeHandle?this.handlePos1:this.handlePos2;t=this.isMaterialTooltip?[this.firstHandle,this.materialHandle]:[this.getHandle()],this.handleStart(),t.forEach(function(e){"Horizontal"===i.orientation?i.enableRtl?e.style.right=s+"px":e.style.left=s+"px":e.style.bottom=s+"px"}),this.changeEvent("change",e)},s.prototype.getHandle=function(){return 1===this.activeHandle?this.firstHandle:this.secondHandle},s.prototype.setRangeValue=function(){this.updateRangeValue(),this.activeHandle=1,this.setHandlePosition(null),this.activeHandle=2,this.setHandlePosition(null),this.activeHandle=1},s.prototype.changeEvent=function(e,t){var i="change"===e?this.previousVal:this.previousChanged;if("Range"!==this.type)this.setProperties({value:this.handleVal1},!0),i===this.value||this.isMaterialTooltip&&this.initialTooltip||(this.trigger(e,this.changeEventArgs(e,t)),this.initialTooltip=!0,this.setPreviousVal(e,this.value)),this.setAriaAttrValue(this.firstHandle);else{var s=this.value=[this.handleVal1,this.handleVal2];this.setProperties({value:s},!0),(i.length===this.value.length&&this.value[0]!==i[0]||this.value[1]!==i[1])&&(this.initialTooltip=!1,this.trigger(e,this.changeEventArgs(e,t)),this.initialTooltip=!0,this.setPreviousVal(e,this.value)),this.setAriaAttrValue(this.getHandle())}this.hiddenInput.value=this.value.toString()},s.prototype.changeEventArgs=function(e,i){var s;return this.tooltip.isVisible&&this.tooltipObj&&this.initialTooltip?(this.tooltipValue(),s={value:this.value,previousValue:"change"===e?this.previousVal:this.previousChanged,action:e,text:this.tooltipObj.content,isInteracted:!t.isNullOrUndefined(i)}):s={value:this.value,previousValue:"change"===e?this.previousVal:this.previousChanged,action:e,text:t.isNullOrUndefined(this.ticksFormatInfo.format)?this.value.toString():"Range"!==this.type?this.formatString(this.value,this.ticksFormatInfo).formatString:this.formatString(this.value[0],this.ticksFormatInfo).formatString+" - "+this.formatString(this.value[1],this.ticksFormatInfo).formatString,isInteracted:!t.isNullOrUndefined(i)},s},s.prototype.setPreviousVal=function(e,t){"change"===e?this.previousVal=t:this.previousChanged=t},s.prototype.updateRangeValue=function(){var e=this.value.toString().split(",").map(Number);if(this.enableRtl&&"Vertical"!==this.orientation||this.rtl?this.value=[e[1],e[0]]:this.value=[e[0],e[1]],this.enableRtl&&"Vertical"!==this.orientation?(this.handleVal1=this.checkHandleValue(this.value[1]),this.handleVal2=this.checkHandleValue(this.value[0])):(this.handleVal1=this.checkHandleValue(this.value[0]),this.handleVal2=this.checkHandleValue(this.value[1])),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.handlePos2=this.checkHandlePosition(this.handleVal2),this.handlePos1>this.handlePos2&&(this.handlePos1=this.handlePos2,this.handleVal1=this.handleVal2),this.preHandlePos1=this.handlePos1,this.preHandlePos2=this.handlePos2,this.limits.enabled){this.activeHandle=1;var t=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd);this.handleVal1=t[0],this.handlePos1=t[1],this.preHandlePos1=this.handlePos1,this.activeHandle=2,t=this.getLimitValueAndPosition(this.handleVal2,this.limits.maxStart,this.limits.maxEnd),this.handleVal2=t[0],this.handlePos2=t[1],this.preHandlePos2=this.handlePos2}},s.prototype.checkHandlePosition=function(e){var i;return e=100*(e-parseFloat(t.formatUnit(this.min)))/(parseFloat(t.formatUnit(this.max))-parseFloat(t.formatUnit(this.min))),i="Horizontal"===this.orientation?this.element.getBoundingClientRect().width*(e/100):this.element.getBoundingClientRect().height*(e/100),parseFloat(t.formatUnit(this.max))===parseFloat(t.formatUnit(this.min))&&(i="Horizontal"===this.orientation?this.element.getBoundingClientRect().width:this.element.getBoundingClientRect().height),i},s.prototype.checkHandleValue=function(e){if(this.min>this.max&&(this.min=this.max),this.min===this.max)return parseFloat(t.formatUnit(this.max));var i=this.tempStartEnd();return e<i.start?e=i.start:e>i.end&&(e=i.end),e},s.prototype.reposition=function(){var e=this;this.firstHandle.style.transition="none","Default"!==this.type&&(this.rangeBar.style.transition="none"),"Range"===this.type&&(this.secondHandle.style.transition="none"),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.handleVal2&&(this.handlePos2=this.checkHandlePosition(this.handleVal2)),"Horizontal"===this.orientation?(this.enableRtl?this.firstHandle.style.right=this.handlePos1+"px":this.firstHandle.style.left=this.handlePos1+"px",this.isMaterialTooltip&&(this.enableRtl?this.materialHandle.style.right=this.handlePos1+"px":this.materialHandle.style.left=this.handlePos1+"px"),"MinRange"===this.type?(this.enableRtl?this.rangeBar.style.right="0px":this.rangeBar.style.left="0px",t.setStyleAttribute(this.rangeBar,{width:t.isNullOrUndefined(this.handlePos1)?0:this.handlePos1+"px"})):"Range"===this.type&&(this.enableRtl?this.secondHandle.style.right=this.handlePos2+"px":this.secondHandle.style.left=this.handlePos2+"px",this.enableRtl?this.rangeBar.style.right=this.handlePos1+"px":this.rangeBar.style.left=this.handlePos1+"px",t.setStyleAttribute(this.rangeBar,{width:this.handlePos2-this.handlePos1+"px"}))):(this.firstHandle.style.bottom=this.handlePos1+"px",this.isMaterialTooltip&&(this.materialHandle.style.bottom=this.handlePos1+"px"),"MinRange"===this.type?(this.rangeBar.style.bottom="0px",t.setStyleAttribute(this.rangeBar,{height:t.isNullOrUndefined(this.handlePos1)?0:this.handlePos1+"px"})):"Range"===this.type&&(this.secondHandle.style.bottom=this.handlePos2+"px",this.rangeBar.style.bottom=this.handlePos1+"px",t.setStyleAttribute(this.rangeBar,{height:this.handlePos2-this.handlePos1+"px"}))),this.limits.enabled&&this.setLimitBar(),"None"!==this.ticks.placement&&this.ul&&(this.removeElement(this.ul),this.ul=void 0,this.renderScale()),this.handleStart(),this.tooltip.isVisible||setTimeout(function(){e.firstHandle.style.transition=e.scaleTransform,"Range"===e.type&&(e.secondHandle.style.transition=e.scaleTransform)}),this.refreshTooltip(this.tooltipTarget),this.setBarColor()},s.prototype.changeHandleValue=function(e){var t=null;1===this.activeHandle?(this.limits.enabled&&this.limits.startHandleFixed||(this.handleVal1=this.checkHandleValue(e),this.handlePos1=this.checkHandlePosition(this.handleVal1),"Range"===this.type&&this.handlePos1>this.handlePos2&&(this.handlePos1=this.handlePos2,this.handleVal1=this.handleVal2),this.handlePos1!==this.preHandlePos1&&(t=this.preHandlePos1=this.handlePos1)),this.modifyZindex()):(this.limits.enabled&&this.limits.endHandleFixed||(this.handleVal2=this.checkHandleValue(e),this.handlePos2=this.checkHandlePosition(this.handleVal2),"Range"===this.type&&this.handlePos2<this.handlePos1&&(this.handlePos2=this.handlePos1,this.handleVal2=this.handleVal1),this.handlePos2!==this.preHandlePos2&&(t=this.preHandlePos2=this.handlePos2)),this.modifyZindex()),null!==t&&("Default"!==this.type&&this.setRangeBar(),this.setHandlePosition(null))},s.prototype.tempStartEnd=function(){return this.min>this.max?{start:this.max,end:this.min}:{start:this.min,end:this.max}},s.prototype.xyToPosition=function(e){if(this.min===this.max)return 100;if("Horizontal"===this.orientation){var t=e.x-this.element.getBoundingClientRect().left,i=this.element.offsetWidth/100;this.val=t/i}else{var s=e.y-this.element.getBoundingClientRect().top;i=this.element.offsetHeight/100;this.val=100-s/i}var n=this.stepValueCalculation(this.val);return n<0?n=0:n>100&&(n=100),this.enableRtl&&"Vertical"!==this.orientation&&(n=100-n),"Horizontal"===this.orientation?this.element.getBoundingClientRect().width*(n/100):this.element.getBoundingClientRect().height*(n/100)},s.prototype.stepValueCalculation=function(e){0===this.step&&(this.step=1);var i=parseFloat(t.formatUnit(this.step))/((parseFloat(t.formatUnit(this.max))-parseFloat(t.formatUnit(this.min)))/100),s=e%Math.abs(i);return 0!==s&&(i/2>s?e-=s:e+=Math.abs(i)-s),e},s.prototype.add=function(e,t,i){var s=Math.pow(10,3);return i?(Math.round(e*s)+Math.round(t*s))/s:(Math.round(e*s)-Math.round(t*s))/s},s.prototype.positionToValue=function(e){var i,s=parseFloat(t.formatUnit(this.max))-parseFloat(t.formatUnit(this.min));i="Horizontal"===this.orientation?e/this.element.getBoundingClientRect().width*s:e/this.element.getBoundingClientRect().height*s;return this.add(i,parseFloat(this.min.toString()),!0)},s.prototype.sliderBarClick=function(e){e.preventDefault();var t;"mousedown"===e.type||"mouseup"===e.type||"click"===e.type?t={x:e.clientX,y:e.clientY}:"touchend"!==e.type&&"touchstart"!==e.type||(t={x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY});var i=this.xyToPosition(t),s=this.positionToValue(i);if("Range"===this.type&&this.handlePos2-i<i-this.handlePos1){if(this.activeHandle=2,!this.limits.enabled||!this.limits.endHandleFixed){if(this.limits.enabled){s=(n=this.getLimitValueAndPosition(s,this.limits.maxStart,this.limits.maxEnd))[0],i=n[1]}this.secondHandle.classList.add(nt),this.handlePos2=this.preHandlePos2=i,this.handleVal2=s}this.modifyZindex(),this.secondHandle.focus()}else{if(this.activeHandle=1,!this.limits.enabled||!this.limits.startHandleFixed){if(this.limits.enabled){var n;s=(n=this.getLimitValueAndPosition(s,this.limits.minStart,this.limits.minEnd))[0],i=n[1]}this.firstHandle.classList.add(nt),this.handlePos1=this.preHandlePos1=i,this.handleVal1=s}this.modifyZindex(),this.firstHandle.focus()}this.isMaterialTooltip&&this.tooltipElement.classList.add(Ie);var a=this.element.querySelector("."+Ye);a&&this.getHandle()!==a&&a.classList.remove(Ye);var l=1===this.activeHandle?this.firstHandle:this.secondHandle;if(e.target===l)return!this.isMaterial||this.tooltip.isVisible||this.getHandle().classList.contains(Ye)||this.materialChange(),this.sliderBarUp(e),void this.tooltipToggle(this.getHandle());if(this.checkRepeatedValue(s)){var r=this.isMaterial&&this.tooltip.isVisible?this.transitionOnMaterialTooltip:this.transition;this.getHandle().style.transition=r.handle,"Default"!==this.type&&(this.rangeBar.style.transition=r.rangeBar),this.setHandlePosition(e),this.isMaterialTooltip&&(this.initialTooltip=!1),this.changeEvent("changed",e),"Default"!==this.type&&this.setRangeBar()}},s.prototype.handleValueAdjust=function(e,t,i){1===i?(this.handleVal1=t,this.handleVal2=this.handleVal1+this.minDiff):2===i&&(this.handleVal2=t,this.handleVal1=this.handleVal2-this.minDiff),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.handlePos2=this.checkHandlePosition(this.handleVal2)},s.prototype.dragRangeBarMove=function(e){var t,i;"touchmove"!==e.type&&e.preventDefault(),this.rangeBarDragged=!0;var s;this.rangeBar.style.transition="none",this.firstHandle.style.transition="none",this.secondHandle.style.transition="none";var n,a;if("mousemove"===e.type?(n=(t=[e.clientX,e.clientY])[0],a=t[1]):(n=(i=[e.changedTouches[0].clientX,e.changedTouches[0].clientY])[0],a=i[1]),!(this.limits.enabled&&this.limits.startHandleFixed||this.limits.enabled&&this.limits.endHandleFixed)){if(s=this.enableRtl?{x:n+this.secondPartRemain,y:a+this.secondPartRemain}:{x:n-this.firstPartRemain,y:a+this.secondPartRemain},this.handlePos1=this.xyToPosition(s),this.handleVal1=this.positionToValue(this.handlePos1),s=this.enableRtl?{x:n-this.firstPartRemain,y:a-this.firstPartRemain}:{x:n+this.secondPartRemain,y:a-this.firstPartRemain},this.handlePos2=this.xyToPosition(s),this.handleVal2=this.positionToValue(this.handlePos2),this.limits.enabled){var l=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd);this.handleVal1=l[0],this.handlePos1=l[1],this.handleVal1===this.limits.minEnd&&this.handleValueAdjust(this.handleVal1,this.limits.minEnd,1),this.handleVal1===this.limits.minStart&&this.handleValueAdjust(this.handleVal1,this.limits.minStart,1),l=this.getLimitValueAndPosition(this.handleVal2,this.limits.maxStart,this.limits.maxEnd),this.handleVal2=l[0],this.handlePos2=l[1],this.handleVal2===this.limits.maxStart&&this.handleValueAdjust(this.handleVal2,this.limits.maxStart,2),this.handleVal2===this.limits.maxEnd&&this.handleValueAdjust(this.handleVal2,this.limits.maxEnd,2)}this.handleVal2===this.max&&this.handleValueAdjust(this.handleVal2,this.max,2),this.handleVal1===this.min&&this.handleValueAdjust(this.handleVal1,this.min,1)}this.activeHandle=1,this.setHandlePosition(e),this.activeHandle=2,this.setHandlePosition(e),this.tooltipToggle(this.rangeBar),this.setRangeBar()},s.prototype.sliderBarUp=function(e){this.changeEvent("changed",e),this.handleFocusOut(),this.firstHandle.classList.remove(nt),"Range"===this.type&&(this.initialTooltip=!1,this.secondHandle.classList.remove(nt)),this.closeTooltip(),this.isMaterial&&(this.getHandle().classList.remove("e-large-thumb-size"),this.isMaterialTooltip&&this.tooltipElement.classList.remove(Ie)),t.EventHandler.remove(document,"mousemove touchmove",this.sliderBarMove),t.EventHandler.remove(document,"mouseup touchend",this.sliderBarUp)},s.prototype.sliderBarMove=function(e){"touchmove"!==e.type&&e.preventDefault();var t;t="mousemove"===e.type?{x:e.clientX,y:e.clientY}:{x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY};var i=this.xyToPosition(t),s=this.positionToValue(i);if(i=Math.round(i),"Range"!==this.type&&1===this.activeHandle){if(!this.limits.enabled||!this.limits.startHandleFixed){if(this.limits.enabled){var n=this.getLimitValueAndPosition(s,this.limits.minStart,this.limits.minEnd);i=n[1],s=n[0]}this.handlePos1=i,this.handleVal1=s}this.firstHandle.classList.add(nt)}if("Range"===this.type)if(1===this.activeHandle){if(this.firstHandle.classList.add(nt),!(this.limits.enabled&&this.limits.startHandleFixed||(i>this.handlePos2&&(i=this.handlePos2,s=this.handleVal2),i===this.preHandlePos1))){if(this.limits.enabled){s=(a=this.getLimitValueAndPosition(s,this.limits.minStart,this.limits.minEnd))[0],i=a[1]}this.handlePos1=this.preHandlePos1=i,this.handleVal1=s,this.activeHandle=1}}else if(2===this.activeHandle&&(this.secondHandle.classList.add(nt),!(this.limits.enabled&&this.limits.endHandleFixed||(i<this.handlePos1&&(i=this.handlePos1,s=this.handleVal1),i===this.preHandlePos2)))){if(this.limits.enabled){var a;s=(a=this.getLimitValueAndPosition(s,this.limits.maxStart,this.limits.maxEnd))[0],i=a[1]}this.handlePos2=this.preHandlePos2=i,this.handleVal2=s,this.activeHandle=2}this.checkRepeatedValue(s)&&(this.getHandle().style.transition=this.scaleTransform,"Default"!==this.type&&(this.rangeBar.style.transition="none"),this.setHandlePosition(e),!this.isMaterial||this.tooltip.isVisible||this.getHandle().classList.contains(Ye)||this.materialChange(),this.tooltipToggle(this.getHandle()),"Default"!==this.type&&this.setRangeBar())},s.prototype.dragRangeBarUp=function(e){this.rangeBarDragged?this.isDragComplete=!0:(this.focusSliderElement(),this.sliderBarClick(e)),this.changeEvent("changed",e),this.closeTooltip(),t.EventHandler.remove(document,"mousemove touchmove",this.dragRangeBarMove),t.EventHandler.remove(document,"mouseup touchend",this.dragRangeBarUp),this.rangeBarDragged=!1},s.prototype.checkRepeatedValue=function(e){if("Range"===this.type){if(e===(this.enableRtl&&"Vertical"!==this.orientation?1===this.activeHandle?this.previousVal[1]:this.previousVal[0]:1===this.activeHandle?this.previousVal[0]:this.previousVal[1]))return 0}else if(e===this.previousVal)return 0;return 1},s.prototype.refreshTooltip=function(e){this.tooltip.isVisible&&this.tooltipObj&&(this.tooltipValue(),e&&(this.tooltipObj.refresh(e),this.tooltipTarget=e))},s.prototype.openTooltip=function(e){this.tooltip.isVisible&&this.tooltipObj&&!this.isMaterialTooltip&&(this.tooltipValue(),this.tooltipObj.open(e),this.tooltipTarget=e)},s.prototype.closeTooltip=function(){this.tooltip.isVisible&&this.tooltipObj&&"Always"!==this.tooltip.showOn&&!this.isMaterialTooltip&&(this.tooltipValue(),this.tooltipObj.close(),this.tooltipTarget=void 0)},s.prototype.keyDown=function(e){switch(e.keyCode){case 37:case 38:case 39:case 40:case 33:case 34:case 36:case 35:e.preventDefault(),this.buttonClick(e)}},s.prototype.wireButtonEvt=function(e){e?(t.EventHandler.remove(this.firstBtn,"mouseleave touchleave",this.buttonFocusOut),t.EventHandler.remove(this.secondBtn,"mouseleave touchleave",this.buttonFocusOut),t.EventHandler.remove(this.firstBtn,"mousedown touchstart",this.repeatHandlerMouse),t.EventHandler.remove(this.firstBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp),t.EventHandler.remove(this.secondBtn,"mousedown touchstart",this.repeatHandlerMouse),t.EventHandler.remove(this.secondBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp),t.EventHandler.remove(this.firstBtn,"focusout",this.sliderFocusOut),t.EventHandler.remove(this.secondBtn,"focusout",this.sliderFocusOut)):(t.EventHandler.add(this.firstBtn,"mouseleave touchleave",this.buttonFocusOut,this),t.EventHandler.add(this.secondBtn,"mouseleave touchleave",this.buttonFocusOut,this),t.EventHandler.add(this.firstBtn,"mousedown touchstart",this.repeatHandlerMouse,this),t.EventHandler.add(this.firstBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp,this),t.EventHandler.add(this.secondBtn,"mousedown touchstart",this.repeatHandlerMouse,this),t.EventHandler.add(this.secondBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp,this),t.EventHandler.add(this.firstBtn,"focusout",this.sliderFocusOut,this),t.EventHandler.add(this.secondBtn,"focusout",this.sliderFocusOut,this))},s.prototype.rangeBarMousedown=function(e){var i,s;if(e.preventDefault(),this.focusSliderElement(),"Range"===this.type&&this.drag&&e.target===this.rangeBar){var n=void 0,a=void 0;"mousedown"===e.type?(n=(i=[e.clientX,e.clientY])[0],a=i[1]):"touchstart"===e.type&&(n=(s=[e.changedTouches[0].clientX,e.changedTouches[0].clientY])[0],a=s[1]),"Horizontal"===this.orientation?(this.firstPartRemain=n-this.rangeBar.getBoundingClientRect().left,this.secondPartRemain=this.rangeBar.getBoundingClientRect().right-n):(this.firstPartRemain=a-this.rangeBar.getBoundingClientRect().top,this.secondPartRemain=this.rangeBar.getBoundingClientRect().bottom-a),this.minDiff=this.handleVal2-this.handleVal1,this.tooltipToggle(this.rangeBar);var l=this.element.querySelector("."+Ye);l&&l.classList.remove(Ye),t.EventHandler.add(document,"mousemove touchmove",this.dragRangeBarMove,this),t.EventHandler.add(document,"mouseup touchend",this.dragRangeBarUp,this)}},s.prototype.elementClick=function(e){this.isDragComplete?this.isDragComplete=!1:(e.preventDefault(),this.focusSliderElement(),this.sliderBarClick(e))},s.prototype.wireEvents=function(){this.onresize=this.reposition.bind(this),window.addEventListener("resize",this.onresize),this.enabled&&!this.readonly&&(t.EventHandler.add(this.element,"click",this.elementClick,this),"Range"===this.type&&this.drag&&t.EventHandler.add(this.rangeBar,"mousedown touchstart",this.rangeBarMousedown,this),t.EventHandler.add(this.sliderContainer,"keydown",this.keyDown,this),t.EventHandler.add(this.sliderContainer,"keyup",this.keyUp,this),t.EventHandler.add(this.element,"focusout",this.sliderFocusOut,this),t.EventHandler.add(this.sliderContainer,"mouseover mouseout touchstart touchend",this.hover,this),this.wireFirstHandleEvt(!1),"Range"===this.type&&this.wireSecondHandleEvt(!1),this.showButtons&&this.wireButtonEvt(!1),this.wireMaterialTooltipEvent(!1),this.isForm&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this))},s.prototype.unwireEvents=function(){t.EventHandler.remove(this.element,"click",this.elementClick),"Range"===this.type&&this.drag&&t.EventHandler.remove(this.rangeBar,"mousedown touchstart",this.rangeBarMousedown),t.EventHandler.remove(this.sliderContainer,"keydown",this.keyDown),t.EventHandler.remove(this.sliderContainer,"keyup",this.keyUp),t.EventHandler.remove(this.element,"focusout",this.sliderFocusOut),t.EventHandler.remove(this.sliderContainer,"mouseover mouseout touchstart touchend",this.hover),this.wireFirstHandleEvt(!0),"Range"===this.type&&this.wireSecondHandleEvt(!0),this.showButtons&&this.wireButtonEvt(!0),this.wireMaterialTooltipEvent(!0),t.EventHandler.remove(this.element,"reset",this.formResetHandler)},s.prototype.formResetHandler=function(){this.setProperties({value:this.formResetValue},!0),this.setValue()},s.prototype.keyUp=function(e){if(9===e.keyCode&&e.target.classList.contains(be)&&(this.focusSliderElement(),!e.target.classList.contains(Ye))){this.element.querySelector("."+Ye)&&this.element.querySelector("."+Ye).classList.remove(Ye),e.target.classList.add(Ye);var t=e.target.parentElement;t===this.element&&(t.querySelector("."+ze).classList.add(it),"Range"!==this.type&&"MinRange"!==this.type||t.querySelector("."+Ee).classList.add(st)),"Range"===this.type&&(e.target.previousSibling.classList.contains(be)?this.activeHandle=2:this.activeHandle=1),this.getHandle().focus(),this.tooltipToggle(this.getHandle())}this.closeTooltip(),this.changeEvent("changed",e)},s.prototype.hover=function(e){t.isNullOrUndefined(e)||("mouseover"===e.type||"touchmove"===e.type||"mousemove"===e.type||"pointermove"===e.type||"touchstart"===e.type?this.sliderContainer.classList.add(Ae):this.sliderContainer.classList.remove(Ae))},s.prototype.sliderFocusOut=function(e){e.relatedTarget!==this.secondHandle&&e.relatedTarget!==this.firstHandle&&e.relatedTarget!==this.element&&e.relatedTarget!==this.firstBtn&&e.relatedTarget!==this.secondBtn&&(this.closeMaterialTooltip(),this.closeTooltip(),this.element.querySelector("."+Ye)&&this.element.querySelector("."+Ye).classList.remove(Ye),this.element.querySelector("."+it)&&(this.element.querySelector("."+it).classList.remove(it),"Range"!==this.type&&"MinRange"!==this.type||!this.element.querySelector("."+st)||this.element.querySelector("."+st).classList.remove(st)),this.hiddenInput.focus(),this.hiddenInput.blur(),this.isElementFocused=!1)},s.prototype.removeElement=function(e){e.parentNode&&e.parentNode.removeChild(e)},s.prototype.changeSliderType=function(e,i){this.isMaterialTooltip&&this.materialHandle&&(this.sliderContainer.classList.remove(De),this.removeElement(this.materialHandle),this.materialHandle=void 0),this.removeElement(this.firstHandle),this.firstHandle=void 0,"Default"!==e&&("Range"===e&&(this.removeElement(this.secondHandle),this.secondHandle=void 0),this.removeElement(this.rangeBar),this.rangeBar=void 0),this.tooltip.isVisible&&!t.isNullOrUndefined(this.tooltipObj)&&(this.tooltipObj.destroy(),this.tooltipElement=void 0,this.tooltipCollidedPosition=void 0),this.limits.enabled&&("MinRange"===e||"Default"===e?t.isNullOrUndefined(this.limitBarFirst)||(this.removeElement(this.limitBarFirst),this.limitBarFirst=void 0):t.isNullOrUndefined(this.limitBarSecond)||(this.removeElement(this.limitBarSecond),this.limitBarSecond=void 0)),this.activeHandle=1,this.getThemeInitialization(),"Range"===this.type&&this.rangeValueUpdate(),this.createRangeBar(),this.limits.enabled&&this.createLimitBar(),this.setHandler(),this.setOrientClass(),this.wireFirstHandleEvt(!1),"Range"===this.type&&this.wireSecondHandleEvt(!1),this.setValue(),this.tooltip.isVisible&&(this.renderTooltip(),this.wireMaterialTooltipEvent(!1)),this.setBarColor(),"tooltip"!==i&&this.updateConfig()},s.prototype.changeRtl=function(){if(this.enableRtl||"Range"!==this.type||(this.value=[this.handleVal2,this.handleVal1]),this.updateConfig(),this.tooltip.isVisible&&this.tooltipObj.refresh(this.firstHandle),this.showButtons){var e=this.enableRtl&&"Vertical"!==this.orientation;t.attributes(e?this.secondBtn:this.firstBtn,{"aria-label":"Decrease",title:"Decrease"}),t.attributes(e?this.firstBtn:this.secondBtn,{"aria-label":"Increase",title:"Increase"})}},s.prototype.changeOrientation=function(){this.changeSliderType(this.type,"null")},s.prototype.updateConfig=function(){this.setEnableRTL(),this.setValue(),this.tooltip.isVisible&&this.refreshTooltip(this.tooltipTarget),"None"!==this.ticks.placement&&this.ul&&(this.removeElement(this.ul),this.ul=void 0,this.renderScale()),this.limitsPropertyChange()},s.prototype.limitsPropertyChange=function(){this.limits.enabled?(t.isNullOrUndefined(this.limitBarFirst)&&"Range"!==this.type&&this.createLimitBar(),t.isNullOrUndefined(this.limitBarFirst)&&t.isNullOrUndefined(this.limitBarSecond)&&"Range"===this.type&&this.createLimitBar(),this.setLimitBar(),this.setValue()):(t.isNullOrUndefined(this.limitBarFirst)||t.detach(this.limitBarFirst),t.isNullOrUndefined(this.limitBarSecond)||t.detach(this.limitBarSecond))},s.prototype.getPersistData=function(){return this.addOnPersist(["value"])},s.prototype.destroy=function(){e.prototype.destroy.call(this),this.unwireEvents(),window.removeEventListener("resize",this.onresize),t.removeClass([this.sliderContainer],[Be]),this.firstHandle.removeAttribute("aria-orientation"),"Range"===this.type&&this.secondHandle.removeAttribute("aria-orientation"),this.sliderContainer.parentNode.insertBefore(this.element,this.sliderContainer),t.detach(this.sliderContainer),this.tooltip.isVisible&&this.tooltipObj.destroy(),this.element.innerHTML=""},s.prototype.onPropertyChanged=function(e,i){for(var s=this,n=0,a=Object.keys(e);n<a.length;n++){var l=a[n];switch(l){case"cssClass":this.setCSSClass(i.cssClass);break;case"value":if(e&&i){var r=t.isNullOrUndefined(e.value)?"Range"===this.type?[this.min,this.max]:this.min:e.value;this.setProperties({value:r},!0),t.isNullOrUndefined(i.value)||i.value.toString()===r.toString()||(this.setValue(),this.refreshTooltip(this.tooltipTarget),"Range"===this.type&&(t.isNullOrUndefined(e.value)||i.value[1]===r[1]?this.activeHandle=1:this.activeHandle=2))}break;case"min":case"step":case"max":this.setMinMaxValue();break;case"tooltip":t.isNullOrUndefined(e.tooltip)||t.isNullOrUndefined(i.tooltip)||this.setTooltip(l);break;case"type":t.isNullOrUndefined(i)||!Object.keys(i).length||t.isNullOrUndefined(i.type)||(this.changeSliderType(i.type,l),this.setZindex());break;case"enableRtl":i.enableRtl!==e.enableRtl&&"Vertical"!==this.orientation&&(this.rtl=i.enableRtl,this.changeRtl());break;case"limits":this.limitsPropertyChange();break;case"orientation":this.changeOrientation();break;case"ticks":t.isNullOrUndefined(this.sliderContainer.querySelector("."+ke))||(t.detach(this.ul),Array.prototype.forEach.call(this.sliderContainer.classList,function(e){e.match(/e-scale-/)&&s.sliderContainer.classList.remove(e)})),"None"!==this.ticks.placement&&(this.renderScale(),this.setZindex());break;case"locale":this.showButtons&&this.buttonTitle();break;case"showButtons":e.showButtons?(this.setButtons(),this.reposition(),this.enabled&&!this.readonly&&this.wireButtonEvt(!1)):this.firstBtn&&this.secondBtn&&(this.sliderContainer.removeChild(this.firstBtn),this.sliderContainer.removeChild(this.secondBtn),this.sliderContainer.classList.remove(tt),this.firstBtn=void 0,this.secondBtn=void 0,this.reposition());break;case"enabled":this.setEnabled();break;case"readonly":this.setReadOnly();break;case"customValues":this.setValue(),this.reposition();break;case"colorRange":this.reposition();break;case"width":this.setElementWidth(e.width),this.setMinMaxValue(),this.limits&&this.limitsPropertyChange()}}},s.prototype.setReadOnly=function(){this.readonly?(this.unwireEvents(),this.sliderContainer.classList.add(dt)):(this.wireEvents(),this.sliderContainer.classList.remove(dt))},s.prototype.setMinMaxValue=function(){var e=this;this.setValue(),this.refreshTooltip(this.tooltipTarget),t.isNullOrUndefined(this.sliderContainer.querySelector("."+ke))||this.ul&&(t.detach(this.ul),Array.prototype.forEach.call(this.sliderContainer.classList,function(t){t.match(/e-scale-/)&&e.sliderContainer.classList.remove(t)})),"None"!==this.ticks.placement&&(this.renderScale(),this.setZindex())},s.prototype.setZindex=function(){this.zIndex=6,t.isNullOrUndefined(this.ticks)||"None"===this.ticks.placement||(this.ul.style.zIndex=this.zIndex+-7+"",this.element.style.zIndex=this.zIndex+2+""),this.isMaterial||t.isNullOrUndefined(this.ticks)||"Both"!==this.ticks.placement||(this.element.style.zIndex=this.zIndex+2+""),this.firstHandle.style.zIndex=this.zIndex+3+"","Range"===this.type&&(this.secondHandle.style.zIndex=this.zIndex+4+"")},s.prototype.setTooltip=function(e){this.changeSliderType(this.type,e)},s.prototype.setBarColor=function(){for(var e,i,s=this.sliderTrack.lastElementChild;s;)this.sliderTrack.removeChild(s),s=this.sliderTrack.lastElementChild;for(var n=0;n<this.colorRange.length;n++)if(!t.isNullOrUndefined(this.colorRange[n].start)&&!t.isNullOrUndefined(this.colorRange[n].end)&&this.colorRange[n].end>this.colorRange[n].start){this.colorRange[n].start<this.min&&(this.colorRange[n].start=this.min),this.colorRange[n].end>this.max&&(this.colorRange[n].end=this.max);var a=this.checkHandlePosition(this.colorRange[n].start),l=this.checkHandlePosition(this.colorRange[n].end),r=this.createElement("div");r.style.backgroundColor=this.colorRange[n].color,r.style.border="1px solid "+this.colorRange[n].color,"Horizontal"===this.orientation?(i=qe,e=this.enableRtl?t.isNullOrUndefined(this.customValues)?this.checkHandlePosition(this.max)-this.checkHandlePosition(this.colorRange[n].end):this.checkHandlePosition(this.customValues.length-this.colorRange[n].end-1):this.checkHandlePosition(this.colorRange[n].start),r.style.width=l-a+"px",r.style.left=e+"px"):(i=We,e=this.checkHandlePosition(this.colorRange[n].start),r.style.height=l-a+"px",r.style.bottom=e+"px"),r.classList.add(i),this.sliderTrack.appendChild(r)}},s.prototype.getModuleName=function(){return"slider"},de([t.Property(null)],s.prototype,"value",void 0),de([t.Property(null)],s.prototype,"customValues",void 0),de([t.Property(1)],s.prototype,"step",void 0),de([t.Property(null)],s.prototype,"width",void 0),de([t.Property(0)],s.prototype,"min",void 0),de([t.Property(100)],s.prototype,"max",void 0),de([t.Property(!1)],s.prototype,"readonly",void 0),de([t.Property("Default")],s.prototype,"type",void 0),de([t.Collection([{}],ce)],s.prototype,"colorRange",void 0),de([t.Complex({},ue)],s.prototype,"ticks",void 0),de([t.Complex({},pe)],s.prototype,"limits",void 0),de([t.Property(!0)],s.prototype,"enabled",void 0),de([t.Complex({},me)],s.prototype,"tooltip",void 0),de([t.Property(!1)],s.prototype,"showButtons",void 0),de([t.Property(!0)],s.prototype,"enableAnimation",void 0),de([t.Property("Horizontal")],s.prototype,"orientation",void 0),de([t.Property("")],s.prototype,"cssClass",void 0),de([t.Property(!1)],s.prototype,"enableHtmlSanitizer",void 0),de([t.Event()],s.prototype,"created",void 0),de([t.Event()],s.prototype,"change",void 0),de([t.Event()],s.prototype,"changed",void 0),de([t.Event()],s.prototype,"renderingTicks",void 0),de([t.Event()],s.prototype,"renderedTicks",void 0),de([t.Event()],s.prototype,"tooltipChange",void 0),s=de([t.NotifyPropertyChanges],s)}(t.Component),yt=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)}}(),bt=function(e,t,i,s){var n,a=arguments.length,l=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(l=(a<3?n(l):a>3?n(t,i,l):n(t,i))||l);return a>3&&l&&Object.defineProperty(t,i,l),l},Et={EMAIL:new RegExp("^[A-Za-z0-9._%+-]{1,}@[A-Za-z0-9._%+-]{1,}([.]{1}[a-zA-Z0-9]{2,}|[.]{1}[a-zA-Z0-9]{2,4}[.]{1}[a-zA-Z0-9]{2,4})$"),URL:/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/m,DATE_ISO:new RegExp("^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$"),DIGITS:new RegExp("^[0-9]*$"),PHONE:new RegExp("^[+]?[0-9]{9,13}$"),CREDITCARD:new RegExp("^\\d{13,16}$")};!function(e){e[e.Message=0]="Message",e[e.Label=1]="Label"}(e.ErrorOption||(e.ErrorOption={}));var Ct=function(i){function s(e,s){var n=i.call(this,s,e)||this;if(n.validated=[],n.errorRules=[],n.allowSubmit=!1,n.required="required",n.infoElement=null,n.inputElement=null,n.selectQuery="input:not([type=reset]):not([type=button]), select, textarea",n.localyMessage={},n.defaultMessages={required:"This field is required.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateIso:"Please enter a valid date ( ISO ).",creditcard:"Please enter valid card number",number:"Please enter a valid number.",digits:"Please enter only digits.",maxLength:"Please enter no more than {0} characters.",minLength:"Please enter at least {0} characters.",rangeLength:"Please enter a value between {0} and {1} characters long.",range:"Please enter a value between {0} and {1}.",max:"Please enter a value less than or equal to {0}.",min:"Please enter a value greater than or equal to {0}.",regex:"Please enter a correct value.",tel:"Please enter a valid phone number.",pattern:"Please enter a correct pattern value.",equalTo:"Please enter the valid match text"},void 0===n.rules&&(n.rules={}),n.l10n=new t.L10n("formValidator",n.defaultMessages,n.locale),n.locale&&n.localeFunc(),t.onIntlChange.on("notifyExternalChange",n.afterLocalization,n),e="string"==typeof e?t.select(e,document):e,null!=n.element)return n.element.setAttribute("novalidate",""),n.inputElements=t.selectAll(n.selectQuery,n.element),n.createHTML5Rules(),n.wireEvents(),n}yt(s,i),n=s,s.prototype.addRules=function(e,i){e&&(this.rules.hasOwnProperty(e)?t.extend(this.rules[e],i,{}):this.rules[e]=i)},s.prototype.removeRules=function(e,i){if(e||i)if(this.rules[e]&&!i)delete this.rules[e];else{if(t.isNullOrUndefined(this.rules[e]&&i))return;for(var s=0;s<i.length;s++)delete this.rules[e][i[s]]}else this.rules={}},s.prototype.validate=function(e){var t=Object.keys(this.rules);if(e&&t.length)return this.validateRules(e),-1!==t.indexOf(e)&&0===this.errorRules.filter(function(t){return t.name===e}).length;this.errorRules=[];for(var i=0,s=t;i<s.length;i++){var n=s[i];this.validateRules(n)}return 0===this.errorRules.length},s.prototype.reset=function(){this.element.reset(),this.clearForm()},s.prototype.getInputElement=function(e){return this.inputElement=t.select('[name="'+e+'"]',this.element),this.inputElement},s.prototype.destroy=function(){this.reset(),this.unwireEvents(),this.rules={};for(var e=0,s=t.selectAll("."+this.errorClass+", ."+this.validClass,this.element);e<s.length;e++){var n=s[e];t.detach(n)}i.prototype.destroy.call(this),t.onIntlChange.off("notifyExternalChange",this.afterLocalization)},s.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){switch(s[i]){case"locale":this.localeFunc()}}},s.prototype.localeFunc=function(){for(var e=0,t=Object.keys(this.defaultMessages);e<t.length;e++){var i=t[e];this.l10n.setLocale(this.locale);var s=this.l10n.getConstant(i);this.localyMessage[i]=s}},s.prototype.getModuleName=function(){return"formValidator"},s.prototype.afterLocalization=function(e){this.locale=e.locale,this.localeFunc()},s.prototype.refresh=function(){this.unwireEvents(),this.inputElements=t.selectAll(this.selectQuery,this.element),this.wireEvents()},s.prototype.clearForm=function(){this.errorRules=[],this.validated=[];for(var e=0,i=t.selectAll(this.selectQuery,this.element);e<i.length;e++){var s=i[e];s.removeAttribute("aria-invalid"),s.classList.remove(this.errorClass),s.name.length>0&&(this.getInputElement(s.name),this.getErrorElement(s.name),this.hideMessage(s.name)),s.classList.remove(this.validClass)}},s.prototype.createHTML5Rules=function(){for(var e=["required","validateHidden","regex","rangeLength","maxLength","minLength","dateIso","digits","pattern","data-val-required","type","data-validation","min","max","range","equalTo","data-val-minlength-min","data-val-equalto-other","data-val-maxlength-max","data-val-range-min","data-val-regex-pattern","data-val-length-max","data-val-creditcard","data-val-phone"],t=["hidden","email","url","date","number","tel"],i=0,s=this.inputElements;i<s.length;i++){for(var n=s[i],a={},l=0,r=e;l<r.length;l++){var o=r[l];if(null!==n.getAttribute(o))switch(o){case"required":this.defRule(n,a,o,n.required);break;case"data-validation":o=n.getAttribute(o),this.defRule(n,a,o,!0);break;case"type":-1!==t.indexOf(n.type)&&this.defRule(n,a,n.type,!0);break;case"rangeLength":case"range":this.defRule(n,a,o,JSON.parse(n.getAttribute(o)));break;case"equalTo":var h=n.getAttribute(o);this.defRule(n,a,o,h);break;default:"true"===n.getAttribute("data-val")?this.annotationRule(n,a,o,n.getAttribute(o)):this.defRule(n,a,o,n.getAttribute(o))}}0!==Object.keys(a).length&&this.addRules(n.name,a)}},s.prototype.annotationRule=function(e,t,i,s){var n=i.split("-"),a=["required","creditcard","phone","maxlength","minlength","range","regex","equalto"],l=n[n.length-1],r=n[n.length-2];if(-1!==a.indexOf(l))switch(l){case"required":this.defRule(e,t,"required",s);break;case"creditcard":this.defRule(e,t,"creditcard",s);break;case"phone":this.defRule(e,t,"tel",s)}else if(-1!==a.indexOf(r))switch(r){case"maxlength":this.defRule(e,t,"maxLength",s);break;case"minlength":this.defRule(e,t,"minLength",s);break;case"range":var o=e.getAttribute("data-val-range-min"),h=e.getAttribute("data-val-range-max");this.defRule(e,t,"range",[o,h]);break;case"equalto":var d=e.getAttribute(i).split(".");this.defRule(e,t,"equalTo",d[d.length-1]);break;case"regex":this.defRule(e,t,"regex",s)}},s.prototype.defRule=function(e,t,i,s){var n,a=e.getAttribute("data-"+i+"-message"),l=e.getAttribute("data-val-"+i);this.rules[e.name]&&"validateHidden"!==i&&"hidden"!==i&&(this.getInputElement(e.name),n=this.getErrorMessage(this.rules[e.name][i],i)),a?s=[s,a]:l?s=[s,l]:n&&(s=[s,n]),t[i]=s},s.prototype.wireEvents=function(){for(var e=0,i=this.inputElements;e<i.length;e++){var s=i[e];n.isCheckable(s)?t.EventHandler.add(s,"click",this.clickHandler,this):"SELECT"===s.tagName?t.EventHandler.add(s,"change",this.changeHandler,this):(t.EventHandler.add(s,"focusout",this.focusOutHandler,this),t.EventHandler.add(s,"keyup",this.keyUpHandler,this))}t.EventHandler.add(this.element,"submit",this.submitHandler,this),t.EventHandler.add(this.element,"reset",this.resetHandler,this)},s.prototype.unwireEvents=function(){for(var e=0,i=this.inputElements;e<i.length;e++){var s=i[e];t.EventHandler.clearEvents(s)}t.EventHandler.remove(this.element,"submit",this.submitHandler),t.EventHandler.remove(this.element,"reset",this.resetHandler)},s.prototype.focusOutHandler=function(e){this.trigger("focusout",e);var t=e.target;this.rules[t.name]&&(this.rules[t.name][this.required]||t.value.length>0?this.validate(t.name):-1===this.validated.indexOf(t.name)&&this.validated.push(t.name))},s.prototype.keyUpHandler=function(e){this.trigger("keyup",e);var t=e.target;(9!==e.which||this.rules[t.name]&&(!this.rules[t.name]||this.rules[t.name][this.required]))&&-1!==this.validated.indexOf(t.name)&&this.rules[t.name]&&-1===[16,17,18,20,35,36,37,38,39,40,45,144,225].indexOf(e.which)&&this.validate(t.name)},s.prototype.clickHandler=function(e){this.trigger("click",e);var t=e.target;"submit"!==t.type?this.validate(t.name):null!==t.getAttribute("formnovalidate")&&(this.allowSubmit=!0)},s.prototype.changeHandler=function(e){this.trigger("change",e);var t=e.target;this.validate(t.name)},s.prototype.submitHandler=function(e){this.trigger("submit",e),this.allowSubmit||this.validate()?this.allowSubmit=!1:e.preventDefault()},s.prototype.resetHandler=function(){this.clearForm()},s.prototype.validateRules=function(e){if(this.rules[e]){var t=Object.keys(this.rules[e]),i=!1,s=!1,n=t.indexOf("validateHidden"),a=t.indexOf("hidden");if(this.getInputElement(e),-1!==a&&(i=!0),-1!==n&&(s=!0),!i||i&&s){-1!==n&&t.splice(n,1),-1!==a&&t.splice(a-1,1),this.getErrorElement(e);for(var l=0,r=t;l<r.length;l++){var o=r[l],h=this.getErrorMessage(this.rules[e][o],o),d={name:e,message:h},u={inputName:e,element:this.inputElement,message:h};if(!this.isValid(e,o)&&!this.inputElement.classList.contains(this.ignore)){this.removeErrorRules(e),this.errorRules.push(d),this.inputElement.setAttribute("aria-invalid","true"),this.inputElement.setAttribute("aria-describedby",this.inputElement.id+"-info"),this.inputElement.classList.add(this.errorClass),this.inputElement.classList.remove(this.validClass),this.infoElement?this.showMessage(d):this.createErrorElement(e,d.message,this.inputElement),u.errorElement=this.infoElement,u.status="failure",this.inputElement.classList.add(this.errorClass),this.inputElement.classList.remove(this.validClass),this.optionalValidationStatus(e,u),this.trigger("validationComplete",u),"required"===o&&this.inputElement.setAttribute("aria-required","true");break}this.hideMessage(e),u.status="success",this.trigger("validationComplete",u)}}}},s.prototype.optionalValidationStatus=function(e,i){this.rules[e][this.required]||this.inputElement.value.length||t.isNullOrUndefined(this.infoElement)||(this.infoElement.innerHTML=this.inputElement.value,this.infoElement.setAttribute("aria-invalid","false"),i.status="",this.hideMessage(e))},s.prototype.isValid=function(e,i){var s=this.rules[e][i],a=s instanceof Array&&"string"==typeof s[1]?s[0]:s,l=this.rules[e][i],r={value:this.inputElement.value,param:a,element:this.inputElement,formElement:this.element};if(this.trigger("validationBegin",r),!r.param&&"required"===i)return!0;if(l&&"function"==typeof l[0]){return l[0].call(this,{element:this.inputElement,value:this.inputElement.value})}return n.isCheckable(this.inputElement)?"required"!==i||t.selectAll('input[name="'+e+'"]:checked',this.element).length>0:n.checkValidator[i](r)},s.prototype.getErrorMessage=function(e,i){var s=this.inputElement.getAttribute("data-"+i+"-message")?this.inputElement.getAttribute("data-"+i+"-message"):e instanceof Array&&"string"==typeof e[1]?e[1]:0!==Object.keys(this.localyMessage).length?this.localyMessage[i]:this.defaultMessages[i],n=s.match(/{(\d)}/g);if(!t.isNullOrUndefined(n))for(var a=0;a<n.length;a++){var l=e instanceof Array?e[a]:e;s=s.replace(n[a],l)}return s},s.prototype.createErrorElement=function(i,s,n){var a=t.createElement(this.errorElement,{className:this.errorClass,innerHTML:s,attrs:{for:i}});if(this.errorOption===e.ErrorOption.Message&&(a.classList.remove(this.errorClass),a.classList.add("e-message"),a=t.createElement(this.errorContainer,{className:this.errorClass,innerHTML:a.outerHTML})),a.id=this.inputElement.name+"-info",this.element.querySelector('[data-valmsg-for="'+n.id+'"]'))this.element.querySelector('[data-valmsg-for="'+n.id+'"]').appendChild(a);else if(!0===n.hasAttribute("data-msg-containerid")){var l=n.getAttribute("data-msg-containerid");t.select("#"+l,this.element).appendChild(a)}else null!=this.customPlacement?this.customPlacement.call(this,this.inputElement,a):this.inputElement.parentNode.insertBefore(a,this.inputElement.nextSibling);a.style.display="block",this.getErrorElement(i),this.validated.push(i),this.checkRequired(i)},s.prototype.getErrorElement=function(e){return this.infoElement=t.select(this.errorElement+"."+this.errorClass,this.inputElement.parentElement),this.infoElement||(this.infoElement=t.select(this.errorElement+"."+this.errorClass+'[for="'+e+'"]',this.element)),this.infoElement},s.prototype.removeErrorRules=function(e){for(var t=0;t<this.errorRules.length;t++){this.errorRules[t].name===e&&this.errorRules.splice(t,1)}},s.prototype.showMessage=function(e){this.infoElement.style.display="block",this.infoElement.innerHTML=e.message,this.checkRequired(e.name)},s.prototype.hideMessage=function(e){this.infoElement&&(this.infoElement.style.display="none",this.removeErrorRules(e),this.inputElement.classList.add(this.validClass),this.inputElement.classList.remove(this.errorClass),this.inputElement.setAttribute("aria-invalid","false"))},s.prototype.checkRequired=function(e){this.rules[e][this.required]||this.inputElement.value.length||t.isNullOrUndefined(this.infoElement)||(this.infoElement.innerHTML=this.inputElement.value,this.infoElement.setAttribute("aria-invalid","false"),this.hideMessage(e))},s.isCheckable=function(e){var t=e.getAttribute("type");return t&&("checkbox"===t||"radio"===t||"submit"===t)};var n;return s.checkValidator={required:function(e){return isNaN(Date.parse(e.value))?e.value.toString().length>0:!isNaN(new Date(e.value).getTime())},email:function(e){return Et.EMAIL.test(e.value)},url:function(e){return Et.URL.test(e.value)},dateIso:function(e){return Et.DATE_ISO.test(e.value)},tel:function(e){return Et.PHONE.test(e.value)},creditcard:function(e){return Et.CREDITCARD.test(e.value)},number:function(e){return!isNaN(Number(e.value))&&-1===e.value.indexOf(" ")},digits:function(e){return Et.DIGITS.test(e.value)},maxLength:function(e){return e.value.length<=e.param},minLength:function(e){return e.value.length>=e.param},rangeLength:function(e){var t=e.param;return e.value.length>=t[0]&&e.value.length<=t[1]},range:function(e){var t=e.param;return!isNaN(Number(e.value))&&Number(e.value)>=t[0]&&Number(e.value)<=t[1]},date:function(e){return!isNaN(new Date(e.value).getTime())},max:function(e){return isNaN(Number(e.value))?new Date(e.value).getTime()<=new Date(JSON.parse(JSON.stringify(e.param))).getTime():+e.value<=e.param},min:function(e){if(isNaN(Number(e.value))){if(-1!==e.value.indexOf(",")){var t=e.value.replace(/,/g,"");return parseFloat(t)>=e.param}return new Date(e.value).getTime()>=new Date(JSON.parse(JSON.stringify(e.param))).getTime()}return+e.value>=e.param},regex:function(e){return new RegExp(e.param).test(e.value)},equalTo:function(e){var t=e.formElement.querySelector("#"+e.param);return e.param=t.value,e.param===e.value}},bt([t.Property("")],s.prototype,"locale",void 0),bt([t.Property("e-hidden")],s.prototype,"ignore",void 0),bt([t.Property()],s.prototype,"rules",void 0),bt([t.Property("e-error")],s.prototype,"errorClass",void 0),bt([t.Property("e-valid")],s.prototype,"validClass",void 0),bt([t.Property("label")],s.prototype,"errorElement",void 0),bt([t.Property("div")],s.prototype,"errorContainer",void 0),bt([t.Property(e.ErrorOption.Label)],s.prototype,"errorOption",void 0),bt([t.Event()],s.prototype,"focusout",void 0),bt([t.Event()],s.prototype,"keyup",void 0),bt([t.Event()],s.prototype,"click",void 0),bt([t.Event()],s.prototype,"change",void 0),bt([t.Event()],s.prototype,"submit",void 0),bt([t.Event()],s.prototype,"validationBegin",void 0),bt([t.Event()],s.prototype,"validationComplete",void 0),bt([t.Event()],s.prototype,"customPlacement",void 0),s=n=bt([t.NotifyPropertyChanges],s)}(t.Base),St=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)}}(),xt=function(e,t,i,s){var n,a=arguments.length,l=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(l=(a<3?n(l):a>3?n(t,i,l):n(t,i))||l);return a>3&&l&&Object.defineProperty(t,i,l),l},kt="e-file-drop",Tt="e-upload-file-list",Ot="e-file-status",Pt="e-file-remove-btn",Lt="e-file-delete-btn",At="e-file-abort-btn",Nt="e-file-reload-btn",Ht="e-upload-drag-hover",Bt="e-upload-progress-wrap",wt="e-upload-progress-bar",Ut="e-progress-bar-text",Rt="e-upload-progress",Ft="e-upload-success",Vt="e-upload-fails",Mt="e-file-container",It="e-validation-fails",Dt="e-disabled",zt="e-clear-icon-focus",qt="e-file-pause-btn",Wt="e-file-play-btn",jt="e-restrict-retry",_t=["title","style","class"],Xt="e-file-invalid",Kt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return St(i,e),xt([t.Property("")],i.prototype,"name",void 0),xt([t.Property(null)],i.prototype,"size",void 0),xt([t.Property("")],i.prototype,"type",void 0),i}(t.ChildProperty),Zt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return St(i,e),xt([t.Property("Browse...")],i.prototype,"browse",void 0),xt([t.Property("Upload")],i.prototype,"upload",void 0),xt([t.Property("Clear")],i.prototype,"clear",void 0),i}(t.ChildProperty),Yt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return St(i,e),xt([t.Property("")],i.prototype,"saveUrl",void 0),xt([t.Property("")],i.prototype,"removeUrl",void 0),xt([t.Property(0)],i.prototype,"chunkSize",void 0),xt([t.Property(3)],i.prototype,"retryCount",void 0),xt([t.Property(500)],i.prototype,"retryAfterDelay",void 0),i}(t.ChildProperty),Gt=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.initialAttr={accept:null,multiple:!1,disabled:!1},s.uploadedFilesData=[],s.base64String=[],s.isForm=!1,s.allTypes=!1,s.pausedData=[],s.uploadMetaData=[],s.tabIndex="0",s.btnTabIndex="0",s.disableKeyboardNavigation=!1,s.count=-1,s.actionCompleteCount=0,s.flag=!0,s.selectedFiles=[],s.uploaderName="UploadFiles",s.fileStreams=[],s.newFileRef=0,s.isFirstFileOnSelection=!1,s.dragCounter=0,s.fileList=[],s.filesData=[],s.uploaderOptions=t,s}return St(s,e),s.prototype.onPropertyChanged=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++){switch(n[s]){case"allowedExtensions":this.setExtensions(this.allowedExtensions),this.clearAll();break;case"enabled":this.setControlStatus();break;case"multiple":this.setMultipleSelection();break;case"enableRtl":this.setRTL(),this.reRenderFileList();break;case"buttons":this.buttons.browse=t.isNullOrUndefined(this.buttons.browse)?"":this.buttons.browse,this.buttons.clear=t.isNullOrUndefined(this.buttons.clear)?"":this.buttons.clear,this.buttons.upload=t.isNullOrUndefined(this.buttons.upload)?"":this.buttons.upload,this.renderButtonTemplates();break;case"dropArea":this.unBindDropEvents(),this.updateDropArea();break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.checkHTMLAttributes(!0);break;case"files":this.renderPreLoadFiles();break;case"directoryUpload":this.updateDirectoryAttributes();break;case"template":this.clearAll();break;case"minFileSize":case"maxFileSize":case"autoUpload":case"sequentialUpload":this.clearAll();break;case"locale":this.l10n.setLocale(this.locale),this.setLocalizedTexts(),this.preLocaleObj=t.getValue("currentLocale",this.l10n);break;case"cssClass":this.setCSSClass(i.cssClass)}}},s.prototype.setLocalizedTexts=function(){t.isNullOrUndefined(this.template)&&("string"==typeof this.buttons.browse&&(this.browseButton.innerText="Browse..."===this.buttons.browse?this.localizedTexts("Browse"):this.buttons.browse,this.browseButton.setAttribute("title",this.browseButton.innerText),this.uploadWrapper&&!t.isNullOrUndefined(this.uploadWrapper.querySelector("."+kt))&&(this.uploadWrapper.querySelector("."+kt).innerHTML=this.localizedTexts("dropFilesHint"))),this.updateFileList())},s.prototype.getKeyValue=function(e){for(var t,i=0,s=Object.keys(this.preLocaleObj);i<s.length;i++){var n=s[i];this.preLocaleObj[n]===e&&(t=n)}return t},s.prototype.updateFileList=function(){if(this.fileList.length>0&&!t.isNullOrUndefined(this.uploadWrapper.querySelector(".e-upload-files")))for(var e=0;e<this.fileList.length;e++)this.fileList[e].querySelector(".e-file-status").innerHTML=this.localizedTexts(this.getKeyValue(this.filesData[e].status)),this.filesData[e].status=this.localizedTexts(this.getKeyValue(this.filesData[e].status)),this.fileList[e].classList.contains(Ft)&&this.fileList[e].querySelector(".e-icons").setAttribute("title",this.localizedTexts("delete")),this.fileList[e].querySelector(".e-file-play-btn")&&this.fileList[e].querySelector(".e-icons").setAttribute("title",this.localizedTexts("resume")),this.fileList[e].querySelector(".e-file-remove-btn")&&this.fileList[e].querySelector(".e-icons").setAttribute("title",this.localizedTexts("remove")),this.fileList[e].querySelector(".e-file-reload-btn")&&this.fileList[e].querySelector(".e-icons").setAttribute("title",this.localizedTexts("retry")),this.autoUpload||(this.uploadButton.innerText="Upload"===this.buttons.upload?this.localizedTexts("Upload"):this.buttons.upload,this.uploadButton.setAttribute("title",this.localizedTexts("Upload")),this.clearButton.innerText="Clear"===this.buttons.clear?this.localizedTexts("Clear"):this.buttons.clear,this.clearButton.setAttribute("title",this.localizedTexts("Clear")))},s.prototype.reRenderFileList=function(){this.listParent&&(t.detach(this.listParent),this.listParent=null,this.fileList=[],this.createFileList(this.filesData),this.actionButtons&&(this.removeActionButtons(),this.renderActionButtons(),this.checkActionButtonStatus()))},s.prototype.preRender=function(){this.localeText={Browse:"Browse...",Clear:"Clear",Upload:"Upload",dropFilesHint:"Or drop files here",invalidMaxFileSize:"File size is too large",invalidMinFileSize:"File size is too small",invalidFileType:"File type is not allowed",uploadFailedMessage:"File failed to upload",uploadSuccessMessage:"File uploaded successfully",removedSuccessMessage:"File removed successfully",removedFailedMessage:"Unable to remove file",inProgress:"Uploading",readyToUploadMessage:"Ready to upload",abort:"Abort",remove:"Remove",cancel:"Cancel",delete:"Delete file",pauseUpload:"File upload paused",pause:"Pause",resume:"Resume",retry:"Retry",fileUploadCancel:"File upload canceled",invalidFileSelection:"Invalid files selected",totalFiles:"Total files",size:"Size"},this.l10n=new t.L10n("uploader",this.localeText,this.locale),this.preLocaleObj=t.getValue("currentLocale",this.l10n),this.formRendered(),this.updateHTMLAttrToElement(),this.checkHTMLAttributes(!1);var e=t.getValue("ej2_instances",this.element);if("EJS-UPLOADER"===this.element.tagName){for(var i=this.createElement("input",{attrs:{type:"file"}}),s=0;s<this.element.attributes.length;s++)i.setAttribute(this.element.attributes[s].nodeName,this.element.attributes[s].nodeValue),i.innerHTML=this.element.innerHTML;i.hasAttribute("name")||i.setAttribute("name","UploadFiles"),this.element.appendChild(i),this.element=i,t.setValue("ej2_instances",e,this.element)}e[0].isPureReactComponent&&(t.isNullOrUndefined(e[0].props.name)?!t.isNullOrUndefined(e[0].props.id)&&t.isNullOrUndefined(e[0].props.name)?this.element.setAttribute("name",e[0].props.id):this.element.setAttribute("name","UploadFiles"):this.element.setAttribute("name",e[0].props.name)),t.isNullOrUndefined(this.element.getAttribute("name"))&&this.element.setAttribute("name",this.element.getAttribute("id")),this.element.hasAttribute("type")||this.element.setAttribute("type","file"),this.updateDirectoryAttributes(),this.keyConfigs={enter:"enter"},this.element.hasAttribute("tabindex")&&(this.tabIndex=this.element.getAttribute("tabindex")),this.browserName=t.Browser.info.name,this.uploaderName=this.element.getAttribute("name")},s.prototype.formRendered=function(){var e=t.closest(this.element,"form");if(!t.isNullOrUndefined(e))for(;e&&e!==document.documentElement;e=e.parentElement)"FORM"===e.tagName&&(this.isForm=!0,this.formElement=e,e.setAttribute("enctype","multipart/form-data"),e.setAttribute("encoding","multipart/form-data"))},s.prototype.getPersistData=function(){return this.addOnPersist(["filesData"])},s.prototype.getModuleName=function(){return"uploader"},s.prototype.updateDirectoryAttributes=function(){this.directoryUpload?(this.element.setAttribute("directory","true"),this.element.setAttribute("webkitdirectory","true")):(this.element.removeAttribute("directory"),this.element.removeAttribute("webkitdirectory"))},s.prototype.render=function(){this.renderBrowseButton(),this.initializeUpload(),this.updateHTMLAttrToWrapper(),this.wireEvents(),this.setMultipleSelection(),this.setExtensions(this.allowedExtensions),this.setRTL(),this.renderPreLoadFiles(),this.setControlStatus(),this.setCSSClass()},s.prototype.renderBrowseButton=function(){this.browseButton=this.createElement("button",{className:"e-css e-btn",attrs:{type:"button"}}),this.browseButton.setAttribute("tabindex",this.tabIndex),"string"==typeof this.buttons.browse?(this.browseButton.textContent="Browse..."===this.buttons.browse?this.localizedTexts("Browse"):this.buttons.browse,this.browseButton.setAttribute("title",this.browseButton.innerText)):this.browseButton.appendChild(this.buttons.browse),this.element.setAttribute("aria-label","Uploader")},s.prototype.renderActionButtons=function(){this.element.setAttribute("tabindex","-1"),this.actionButtons=this.createElement("div",{className:"e-upload-actions"}),this.uploadButton=this.createElement("button",{className:"e-file-upload-btn e-css e-btn e-flat e-primary",attrs:{type:"button",tabindex:this.btnTabIndex}}),this.clearButton=this.createElement("button",{className:"e-file-clear-btn e-css e-btn e-flat",attrs:{type:"button",tabindex:this.btnTabIndex}}),this.actionButtons.appendChild(this.clearButton),this.actionButtons.appendChild(this.uploadButton),this.renderButtonTemplates(),this.uploadWrapper.appendChild(this.actionButtons),this.browseButton.blur(),this.isPreloadFiles||this.uploadButton.focus(),this.wireActionButtonEvents()},s.prototype.serverActionButtonsEventBind=function(e){e&&!this.isForm&&(this.browseButton.blur(),this.actionButtons=e,this.uploadButton=this.actionButtons.querySelector(".e-file-upload-btn"),this.clearButton=this.actionButtons.querySelector(".e-file-clear-btn"),this.uploadButton.focus(),this.unwireActionButtonEvents(),this.wireActionButtonEvents(),this.checkActionButtonStatus())},s.prototype.wireActionButtonEvents=function(){t.EventHandler.add(this.uploadButton,"click",this.uploadButtonClick,this),t.EventHandler.add(this.clearButton,"click",this.clearButtonClick,this)},s.prototype.unwireActionButtonEvents=function(){t.EventHandler.remove(this.uploadButton,"click",this.uploadButtonClick),t.EventHandler.remove(this.clearButton,"click",this.clearButtonClick)},s.prototype.removeActionButtons=function(){this.actionButtons&&(this.unwireActionButtonEvents(),t.detach(this.actionButtons),this.actionButtons=null)},s.prototype.renderButtonTemplates=function(){if("string"==typeof this.buttons.browse?(this.browseButton.textContent="Browse..."===this.buttons.browse?this.localizedTexts("Browse"):this.buttons.browse,this.browseButton.setAttribute("title",this.browseButton.textContent)):(this.browseButton.innerHTML="",this.browseButton.appendChild(this.buttons.browse)),this.uploadButton){var e=t.isNullOrUndefined(this.buttons.upload)?"Upload":this.buttons.upload;this.buttons.upload=e,"string"==typeof this.buttons.upload?(this.uploadButton.textContent="Upload"===this.buttons.upload?this.localizedTexts("Upload"):this.buttons.upload,this.uploadButton.setAttribute("title",this.uploadButton.textContent)):(this.uploadButton.innerHTML="",this.uploadButton.appendChild(this.buttons.upload))}if(this.clearButton){var i=t.isNullOrUndefined(this.buttons.clear)?"Clear":this.buttons.clear;this.buttons.clear=i,"string"==typeof this.buttons.clear?(this.clearButton.textContent="Clear"===this.buttons.clear?this.localizedTexts("Clear"):this.buttons.clear,this.clearButton.setAttribute("title",this.clearButton.textContent)):(this.clearButton.innerHTML="",this.clearButton.appendChild(this.buttons.clear))}},s.prototype.initializeUpload=function(){this.element.setAttribute("tabindex","-1");var e=this.createElement("span",{className:"e-file-select"});this.element.parentElement.insertBefore(e,this.element),this.dropAreaWrapper=this.createElement("div",{className:"e-file-select-wrap"}),this.element.parentElement.insertBefore(this.dropAreaWrapper,this.element),e.appendChild(this.element),this.dropAreaWrapper.appendChild(this.browseButton),this.dropAreaWrapper.appendChild(e),this.uploadWrapper=this.createElement("div",{className:"e-upload e-control-wrapper"}),this.dropAreaWrapper.parentElement.insertBefore(this.uploadWrapper,this.dropAreaWrapper),this.uploadWrapper.appendChild(this.dropAreaWrapper),this.setDropArea()},s.prototype.renderPreLoadFiles=function(){if(this.files.length){if(this.enablePersistence&&this.filesData.length)return void this.createFileList(this.filesData);if(t.isNullOrUndefined(this.files[0].size))return;this.isPreloadFiles=!0;var e=[].slice.call(this.files),i=[];this.multiple||(this.clearData(),e=[e[0]]);for(var s=0,n=e;s<n.length;s++){var a=n[s],l={name:a.name+"."+a.type.split(".")[a.type.split(".").length-1],rawFile:"",size:a.size,status:this.localizedTexts("uploadSuccessMessage"),type:a.type,validationMessages:{minSize:"",maxSize:""},statusCode:"2"};i.push(l),this.filesData.push(l)}this.createFileList(i),this.autoUpload||!this.listParent||this.actionButtons||this.isForm&&!this.allowUpload()||!this.showFileList||this.renderActionButtons(),this.checkActionButtonStatus(),this.sequentialUpload&&(this.count=this.filesData.length-1),this.isPreloadFiles=!1}},s.prototype.checkActionButtonStatus=function(){if(this.actionButtons){var e=this.uploadWrapper.querySelectorAll("."+It).length+this.uploadWrapper.querySelectorAll(".e-upload-fails:not(.e-upload-progress)").length+this.uploadWrapper.querySelectorAll("span."+Ft).length+this.uploadWrapper.querySelectorAll("span."+Rt).length;e>0&&e===this.uploadWrapper.querySelectorAll("li").length?this.uploadButton.setAttribute("disabled","disabled"):this.uploadButton.removeAttribute("disabled")}},s.prototype.setDropArea=function(){var e=this.dropAreaWrapper.querySelector(".e-file-drop");if(this.dropArea){this.dropZoneElement="string"!=typeof this.dropArea?this.dropArea:t.select(this.dropArea,document);for(var i=this.element,s=!1;i.parentNode;)(i=i.parentNode)===this.dropZoneElement&&(s=!0,e?e.innerHTML=this.localizedTexts("dropFilesHint"):this.createDropTextHint());!s&&e&&t.remove(e)}else t.isNullOrUndefined(this.uploaderOptions)||void 0!==this.uploaderOptions.dropArea||(this.createDropTextHint(),this.dropZoneElement=this.uploadWrapper,this.setProperties({dropArea:this.uploadWrapper},!0));this.bindDropEvents()},s.prototype.updateDropArea=function(){if(this.dropArea)this.setDropArea();else{this.dropZoneElement=null;var e=this.dropAreaWrapper.querySelector(".e-file-drop");e&&t.remove(e)}},s.prototype.createDropTextHint=function(){var e=this.createElement("span",{className:kt});e.innerHTML=this.localizedTexts("dropFilesHint"),this.dropAreaWrapper.appendChild(e)},s.prototype.updateHTMLAttrToElement=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];_t.indexOf(s)<0&&this.element.setAttribute(s,this.htmlAttributes[s])}},s.prototype.updateHTMLAttrToWrapper=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.indexOf(s)>-1)if("class"===s){var n=this.htmlAttributes[s].replace(/\s+/g," ").trim();""!==n&&t.addClass([this.uploadWrapper],n.split(" "))}else if("style"===s){var a=this.uploadWrapper.getAttribute(s);a=t.isNullOrUndefined(a)?this.htmlAttributes[s]:a+this.htmlAttributes[s],this.uploadWrapper.setAttribute(s,a)}else this.uploadWrapper.setAttribute(s,this.htmlAttributes[s])}},s.prototype.setMultipleSelection=function(){if(this.multiple&&!this.element.hasAttribute("multiple")){var e=document.createAttribute("multiple");e.value="multiple",this.element.setAttributeNode(e)}else this.multiple||this.element.removeAttribute("multiple")},s.prototype.checkAutoUpload=function(e){this.autoUpload?(this.sequentialUpload?this.sequenceUpload(e):this.upload(e),this.removeActionButtons()):this.actionButtons||this.renderActionButtons(),this.checkActionButtonStatus()},s.prototype.sequenceUpload=function(e){if(this.filesData.length-e.length==0||"1"!==this.filesData[this.filesData.length-e.length-1].statusCode){++this.count;var t=!this.showFileList;"object"==typeof this.filesData[this.count]?(this.isFirstFileOnSelection=!1,this.upload(this.filesData[this.count],t),"0"===this.filesData[this.count].statusCode&&this.sequenceUpload(e)):--this.count}},s.prototype.setCSSClass=function(e){var i=this.cssClass;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(i=this.cssClass.replace(/\s+/g," ").trim()),t.isNullOrUndefined(this.cssClass)||""===i||t.addClass([this.uploadWrapper],i.split(i.indexOf(",")>-1?",":" "));var s=e;t.isNullOrUndefined(e)||(s=e.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e)||""===s||t.removeClass([this.uploadWrapper],s.split(" "))},s.prototype.wireEvents=function(){t.EventHandler.add(this.browseButton,"click",this.browseButtonClick,this),t.EventHandler.add(this.element,"change",this.onSelectFiles,this),t.EventHandler.add(document,"click",this.removeFocus,this),this.keyboardModule=new t.KeyboardEvents(this.uploadWrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.isForm&&t.EventHandler.add(this.formElement,"reset",this.resetForm,this)},s.prototype.unWireEvents=function(){t.EventHandler.remove(this.browseButton,"click",this.browseButtonClick),t.EventHandler.remove(this.element,"change",this.onSelectFiles),t.EventHandler.remove(document,"click",this.removeFocus),this.isForm&&t.EventHandler.remove(this.formElement,"reset",this.resetForm),this.keyboardModule&&this.keyboardModule.destroy()},s.prototype.resetForm=function(){this.clearAll()},s.prototype.keyActionHandler=function(e){var i=e.target;switch(e.action){case"enter":if(e.target===this.clearButton)this.clearButtonClick();else if(e.target===this.uploadButton)this.uploadButtonClick();else if(e.target===this.browseButton)this.browseButtonClick();else if(i.classList.contains(qt)){(s=this.getCurrentMetaData(null,e)).file.statusCode="4",s.file.status=this.localizedTexts("pauseUpload"),this.abortUpload(s,!1)}else if(i.classList.contains(Wt))this.resumeUpload(this.getCurrentMetaData(null,e),e);else if(i.classList.contains(Nt)){var s=this.getCurrentMetaData(null,e);if(t.isNullOrUndefined(s)){var n=e.target.parentElement,a=this.filesData[this.fileList.indexOf(n)];this.retry(a)}else s.file.statusCode="1",s.file.status=this.localizedTexts("readyToUploadMessage"),this.chunkUpload(s.file)}else this.removeFiles(e),i.classList.contains(At)||this.browseButton.focus();e.preventDefault(),e.stopPropagation()}},s.prototype.getCurrentMetaData=function(e,i){var s,n;if(t.isNullOrUndefined(e)){var a=i.target.parentElement;s=this.filesData[this.fileList.indexOf(a)]}else s=e;for(var l=0;l<this.uploadMetaData.length;l++)this.uploadMetaData[l].file.name===s.name&&(n=this.uploadMetaData[l]);return n},s.prototype.removeFocus=function(){this.uploadWrapper&&this.listParent&&this.listParent.querySelector("."+zt)&&(document.activeElement.blur(),this.listParent.querySelector("."+zt).classList.remove(zt))},s.prototype.browseButtonClick=function(){this.element.click()},s.prototype.uploadButtonClick=function(){this.sequentialUpload?this.sequenceUpload(this.filesData):this.upload(this.filesData)},s.prototype.clearButtonClick=function(){this.clearAll(),this.sequentialUpload&&(this.count=-1),this.actionCompleteCount=0},s.prototype.bindDropEvents=function(){this.dropZoneElement&&(t.EventHandler.add(this.dropZoneElement,"drop",this.dropElement,this),t.EventHandler.add(this.dropZoneElement,"dragover",this.dragHover,this),t.EventHandler.add(this.dropZoneElement,"dragleave",this.onDragLeave,this),t.EventHandler.add(this.dropZoneElement,"paste",this.onPasteFile,this),t.EventHandler.add(this.dropZoneElement,"dragenter",this.onDragEnter,this))},s.prototype.unBindDropEvents=function(){this.dropZoneElement&&(t.EventHandler.remove(this.dropZoneElement,"drop",this.dropElement),t.EventHandler.remove(this.dropZoneElement,"dragover",this.dragHover),t.EventHandler.remove(this.dropZoneElement,"dragleave",this.onDragLeave),t.EventHandler.remove(this.dropZoneElement,"dragenter",this.onDragEnter))},s.prototype.onDragEnter=function(e){this.enabled&&(this.dropZoneElement.classList.add(Ht),this.dragCounter=this.dragCounter+1,e.preventDefault(),e.stopPropagation())},s.prototype.onDragLeave=function(){this.enabled&&(this.dragCounter=this.dragCounter-1,this.dragCounter||this.dropZoneElement.classList.remove(Ht))},s.prototype.dragHover=function(e){this.enabled&&("Default"!==this.dropEffect&&(e.dataTransfer.dropEffect=this.dropEffect.toLowerCase()),e.preventDefault(),e.stopPropagation())},s.prototype.dropElement=function(e){this.dragCounter=0,this.dropZoneElement.classList.remove(Ht),this.onSelectFiles(e),e.preventDefault(),e.stopPropagation()},s.prototype.onPasteFile=function(e){var t=e.clipboardData.items;if(1===t.length){var i=[].slice.call(t)[0];"file"===i.kind&&i.type.match("^image/")&&this.renderSelectedFiles(e,[i.getAsFile()],!1,!0)}},s.prototype.getSelectedFiles=function(e){for(var t=[],i=this.fileList[e],s=this.getFilesData(),n=+i.getAttribute("data-files-count"),a=0,l=0;l<e;l++)a+=+this.fileList[l].getAttribute("data-files-count");for(var r=a;r<a+n;r++)t.push(s[r]);return t},s.prototype.removeFiles=function(e){if(this.enabled){var s=e.target.parentElement,n=this.fileList.indexOf(s),a=this.fileList[n],l=this.isFormUpload(),r=l?this.getSelectedFiles(n):this.getFilesInArray(this.filesData[n]);if(!t.isNullOrUndefined(r)){if(e.target.classList.contains(At)&&!l){if(r[0].statusCode="5",!t.isNullOrUndefined(a)){var o=a.querySelector("."+At);i.createSpinner({target:o,width:"20px"}),i.showSpinner(o)}this.sequentialUpload&&this.uploadSequential(),a.classList.contains(jt)||this.checkActionComplete(!0)}else t.closest(e.target,".e-spinner-pane")||this.remove(r,!1,!1,!0,e);this.element.value="",this.checkActionButtonStatus()}}},s.prototype.removeFilesData=function(e,i){var s;if(i)this.showFileList||(s=this.filesData.indexOf(e),this.filesData.splice(s,1));else{var n=this.getLiElement(e);t.isNullOrUndefined(n)||(t.detach(n),s=this.fileList.indexOf(n),this.fileList.splice(s,1),this.filesData.splice(s,1),0!==this.fileList.length||t.isNullOrUndefined(this.listParent)||(t.detach(this.listParent),this.listParent=null,this.removeActionButtons()),this.sequentialUpload&&s<=this.count&&--this.count)}},s.prototype.removeUploadedFile=function(e,i,s,n){var a=this,l=e,r=new t.Ajax(this.asyncSettings.removeUrl,"POST",!0,null);r.emitError=!1;var o=new FormData;r.beforeSend=function(t){i.currentRequest=r.httpRequest,s?a.removingEventCallback(i,o,l,e):a.trigger("removing",i,function(i){i.cancel?t.cancel=!0:a.removingEventCallback(i,o,l,e)})},r.onLoad=function(e){return a.removeCompleted(e,l,n),{}},r.onError=function(e){return a.removeFailed(e,l,n),{}},r.send(o)},s.prototype.removingEventCallback=function(e,s,n,a){var l=this.element.getAttribute("name"),r=this.getLiElement(a);if(!(t.isNullOrUndefined(r)||t.isNullOrUndefined(r.querySelector("."+Lt))&&t.isNullOrUndefined(r.querySelector("."+Pt)))){var o=r.querySelector("."+Lt)?r.querySelector("."+Lt):r.querySelector("."+Pt);i.createSpinner({target:o,width:"20px"}),i.showSpinner(o)}e.postRawFile&&!t.isNullOrUndefined(n.rawFile)&&""!==n.rawFile?s.append(l,n.rawFile,n.name):s.append(l,n.name),this.updateFormData(s,e.customFormData)},s.prototype.updateFormData=function(e,t){if(t.length>0&&t[0])for(var i=function(i){var s=t[i],n=Object.keys(s).map(function(e){return s[e]});e.append(Object.keys(s)[0],n)},s=0;s<t.length;s++)i(s)},s.prototype.updateCustomheader=function(e,t){if(t.length>0&&t[0])for(var i=function(i){var s=t[i],n=Object.keys(s).map(function(e){return s[e]});e.setRequestHeader(Object.keys(s)[0],n)},s=0;s<t.length;s++)i(s)},s.prototype.removeCompleted=function(e,t,i){var s=e&&e.currentTarget?this.getResponse(e):null,n=e.target;if(4===n.readyState&&n.status>=200&&n.status<=299){var a={e:e,response:s,operation:"remove",file:this.updateStatus(t,this.localizedTexts("removedSuccessMessage"),"2")};this.trigger("success",a),this.removeFilesData(t,i);var l=this.uploadedFilesData.indexOf(t);this.uploadedFilesData.splice(l,1),this.trigger("change",{files:this.uploadedFilesData})}else this.removeFailed(e,t,i)},s.prototype.removeFailed=function(e,s,n){var a={e:e,response:e&&e.currentTarget?this.getResponse(e):null,operation:"remove",file:this.updateStatus(s,this.localizedTexts("removedFailedMessage"),"0")};if(!n){var l=this.filesData.indexOf(s),r=this.fileList[l];if(r){r.classList.remove(Ft),r.classList.add(Vt);var o=r.querySelector("."+Ot);o&&(o.classList.remove(Ft),o.classList.add(Vt))}this.checkActionButtonStatus()}this.trigger("failure",a);var h=this.getLiElement(s);if(!t.isNullOrUndefined(h)&&!t.isNullOrUndefined(h.querySelector("."+Lt))){var d=h.querySelector("."+Lt);i.hideSpinner(d),t.detach(h.querySelector(".e-spinner-pane"))}},s.prototype.getFilesFromFolder=function(e){this.filesEntries=[];var t=this.multiple?e.dataTransfer.items:[e.dataTransfer.items[0]];if(this.checkDirectoryUpload(t))for(var i=function(i){var n=t[i].webkitGetAsEntry();if(n.isFile){var a=[];n.file(function(e){var t=n.fullPath;a.push({path:t,file:e})}),s.renderSelectedFiles(e,a,!0)}else n.isDirectory&&s.traverseFileTree(n,e)},s=this,n=0;n<t.length;n++)i(n)},s.prototype.checkDirectoryUpload=function(e){for(var t=0;e&&t<e.length;t++){if(e[t].webkitGetAsEntry().isDirectory)return!0}return!1},s.prototype.traverseFileTree=function(e,t){if(e.isFile)this.filesEntries.push(e);else if(e.isDirectory){var i=e.createReader();this.readFileFromDirectory(i,t)}},s.prototype.readFileFromDirectory=function(e,t){var i=this;e.readEntries(function(s){for(var n=0;n<s.length;n++)i.traverseFileTree(s[n],t);i.pushFilesEntries(t),s.length&&i.readFileFromDirectory(e)})},s.prototype.pushFilesEntries=function(e){for(var t=this,i=[],s=function(s){n.filesEntries[s].file(function(n){if(t.filesEntries.length){var a=t.filesEntries[s].fullPath;i.push({path:a,file:n}),s===t.filesEntries.length-1&&(t.filesEntries=[],t.renderSelectedFiles(e,i,!0))}})},n=this,a=0;a<this.filesEntries.length;a++)s(a)},s.prototype.onSelectFiles=function(e){if(this.enabled){var t;if("drop"===e.type)if(this.directoryUpload)this.getFilesFromFolder(e);else{var i=this.sortFilesList=e.dataTransfer.files;"msie"!==this.browserName&&"edge"!==this.browserName&&"safari"!==this.browserName&&(this.element.files=i),i.length>0&&(t=this.multiple?this.sortFileList(i):[i[0]],this.renderSelectedFiles(e,t))}else t=[].slice.call(e.target.files),this.renderSelectedFiles(e,t)}},s.prototype.getBase64=function(e){return new Promise(function(t,i){var s=new FileReader;s.readAsDataURL(e),s.onload=function(){return t(s.result)},s.onerror=function(e){return i(e)}})},s.prototype.renderSelectedFiles=function(e,t,i,s){var n=this;this.base64String=[];var a={event:e,cancel:!1,filesData:[],isModified:!1,modifiedFilesData:[],progressInterval:"",isCanceled:!1,currentRequest:null,customFormData:null};if(t.length<1)return a.isCanceled=!0,void this.trigger("selected",a);this.flag=!0;var l=[];this.multiple||(this.clearData(!0),t=[t[0]]);for(var r=0;r<t.length;r++){var o=i?t[r].file:t[r];this.updateInitialFileDetails(e,t,o,r,l,i,s)}a.filesData=l,this.allowedExtensions.indexOf("*")>-1&&(this.allTypes=!0),this.allTypes||(l=this.checkExtension(l)),this.trigger("selected",a,function(e){n._internalRenderSelect(e,l)})},s.prototype.updateInitialFileDetails=function(e,i,s,n,a,l,r){var o={name:l?i[n].path.substring(1,i[n].path.length):r?t.getUniqueID(s.name.substring(0,s.name.lastIndexOf(".")))+"."+this.getFileType(s.name):this.directoryUpload?i[n].webkitRelativePath:s.name,rawFile:s,size:s.size,status:this.localizedTexts("readyToUploadMessage"),type:this.getFileType(s.name),validationMessages:this.validatedFileSize(s.size),statusCode:"1",id:t.getUniqueID(s.name.substring(0,s.name.lastIndexOf(".")))+"."+this.getFileType(s.name)};r&&(o.fileSource="paste"),o.status=""!==o.validationMessages.minSize?this.localizedTexts("invalidMinFileSize"):""!==o.validationMessages.maxSize?this.localizedTexts("invalidMaxFileSize"):o.status,""===o.validationMessages.minSize&&""===o.validationMessages.maxSize||(o.statusCode="0"),a.push(o)},s.prototype._internalRenderSelect=function(e,i){if(!e.cancel){if(this.selectedFiles=this.selectedFiles.concat(i),this.btnTabIndex=this.disableKeyboardNavigation?"-1":"0",this.showFileList){if(e.isModified&&e.modifiedFilesData.length>0){for(var s=0;s<e.modifiedFilesData.length;s++)for(var n=0;n<i.length;n++)e.modifiedFilesData[s].id===i[n].id&&(e.modifiedFilesData[s].rawFile=i[n].rawFile);var a=this.allTypes?e.modifiedFilesData:this.checkExtension(e.modifiedFilesData);this.updateSortedFileList(a),this.filesData=a,this.isForm&&!this.allowUpload()||this.checkAutoUpload(a)}else this.createFileList(i,!0),this.filesData=this.filesData.concat(i),this.isForm&&!this.allowUpload()||this.checkAutoUpload(i);t.isNullOrUndefined(e.progressInterval)||""===e.progressInterval||(this.progressInterval=e.progressInterval)}else this.filesData=this.filesData.concat(i),this.autoUpload&&this.upload(this.filesData,!0);this.raiseActionComplete(),this.isFirstFileOnSelection=!0}},s.prototype.allowUpload=function(){var e=!1;return this.isForm&&!t.isNullOrUndefined(this.asyncSettings.saveUrl)&&""!==this.asyncSettings.saveUrl&&(e=!0),e},s.prototype.isFormUpload=function(){var e=!1;return!this.isForm||!t.isNullOrUndefined(this.asyncSettings.saveUrl)&&""!==this.asyncSettings.saveUrl||!t.isNullOrUndefined(this.asyncSettings.removeUrl)&&""!==this.asyncSettings.removeUrl||(e=!0),e},s.prototype.clearData=function(e){t.isNullOrUndefined(this.listParent)||(t.detach(this.listParent),this.listParent=null),"msie"===this.browserName||e||(this.element.value=""),this.fileList=[],this.filesData=[],this.removeActionButtons()},s.prototype.updateSortedFileList=function(e){var i=this.createElement("div",{id:"clonewrapper"}),s=-1;if(this.listParent){for(var n=0;n<this.listParent.querySelectorAll("li").length;n++){var a=this.listParent.querySelectorAll("li")[n];i.appendChild(a.cloneNode(!0))}for(var l=0,r=this.listParent.querySelectorAll("li");l<r.length;l++){var o=r[l];t.detach(o)}this.removeActionButtons();var h=[].slice.call(i.childNodes);t.detach(this.listParent),this.listParent=null,this.fileList=[],this.createParentUL();for(var d=0;d<e.length;d++){for(var u=0;u<this.filesData.length;u++)this.filesData[u].name===e[d].name&&(this.listParent.appendChild(h[u]),t.EventHandler.add(h[u].querySelector(".e-icons"),"click",this.removeFiles,this),this.fileList.push(h[u]),s=d);s!==d&&this.createFileList([e[d]])}}else this.createFileList(e)},s.prototype.isBlank=function(e){return!e||/^\s*$/.test(e)},s.prototype.checkExtension=function(e){var t=e;if(!this.isBlank(this.allowedExtensions)){for(var i=[],s=0,n=this.allowedExtensions.split(",");s<n.length;s++){var a=n[s];i.push(a.trim().toLocaleLowerCase())}for(var l=0;l<e.length;l++)-1===i.indexOf(("."+e[l].type).toLocaleLowerCase())&&(e[l].status=this.localizedTexts("invalidFileType"),e[l].statusCode="0")}return t},s.prototype.validatedFileSize=function(e){var t="",i="";e<this.minFileSize?t=this.localizedTexts("invalidMinFileSize"):e>this.maxFileSize?i=this.localizedTexts("invalidMaxFileSize"):(t="",i="");return{minSize:t,maxSize:i}},s.prototype.isPreLoadFile=function(e){for(var t=!1,i=0;i<this.files.length;i++)this.files[i].name===e.name.slice(0,e.name.lastIndexOf("."))&&this.files[i].type===e.type&&(t=!0);return t},s.prototype.createCustomfileList=function(e){this.createParentUL();for(var i=0,s=e;i<s.length;i++){var n=s[i],a=this.createElement("li",{className:Tt,attrs:{"data-file-name":n.name}});this.uploadTemplateFn=this.templateComplier(this.template);var l=this.uploadTemplateFn(n,this,"template",this.element.id+"Template",this.isStringTemplate,null,a);if(l){var r=[].slice.call(l);t.append(r,a)}var o=e.indexOf(n),h={element:a,fileInfo:n,index:o,isPreload:this.isPreLoadFile(n)},d={element:a,fileInfo:n,index:o,isPreload:this.isPreLoadFile(n)};this.trigger("rendering",h),this.trigger("fileListRendering",d),this.listParent.appendChild(a),this.fileList.push(a)}this.renderReactTemplates()},s.prototype.createParentUL=function(){t.isNullOrUndefined(this.listParent)&&(this.listParent=this.createElement("ul",{className:"e-upload-files"}),this.uploadWrapper.appendChild(this.listParent))},s.prototype.formFileList=function(e,i){var s=this.createElement("li",{className:Tt});s.setAttribute("data-files-count",e.length+"");for(var n,a=this.createElement("span",{className:Mt}),l=0,r=e;l<r.length;l++){var o=r[l],h=this.createElement("span",{className:"e-file-name"});h.innerHTML=this.getFileNameOnly(o.name);var d=this.createElement("span",{className:"e-file-type"}),u=this.getFileType(o.name);if(d.innerHTML="."+u,u||d.classList.add("e-hidden"),this.enableRtl){var c=this.createElement("span",{className:"e-rtl-container"});c.appendChild(d),c.appendChild(h),a.appendChild(c)}else a.appendChild(h),a.appendChild(d);this.truncateName(h),n=this.formValidateFileInfo(o,s)}s.appendChild(a),this.setListToFileInfo(e,s);var p=this.listParent.querySelectorAll("li").length,m=this.createElement("span");if(s.classList.contains(Xt)?(m.classList.add(Ot),m.classList.add(Xt),m.innerText=e.length>1?this.localizedTexts("invalidFileSelection"):n):(m.classList.add(e.length>1?"e-file-information":"e-file-size"),m.innerText=e.length>1?this.localizedTexts("totalFiles")+": "+e.length+" , "+this.localizedTexts("size")+": "+this.bytesToSize(this.getFileSize(e)):this.bytesToSize(e[0].size),this.createFormInput(e)),a.appendChild(m),t.isNullOrUndefined(s.querySelector(".e-icons"))){var f=this.createElement("span",{className:"e-icons",attrs:{tabindex:this.btnTabIndex}});"msie"===this.browserName&&f.classList.add("e-msie"),f.setAttribute("title",this.localizedTexts("remove")),s.appendChild(a),s.appendChild(f),t.EventHandler.add(f,"click",this.removeFiles,this),f.classList.add(Pt)}var v={element:s,fileInfo:this.mergeFileInfo(e,s),index:p,isPreload:this.isPreLoadFile(this.mergeFileInfo(e,s))},g={element:s,fileInfo:this.mergeFileInfo(e,s),index:p,isPreload:this.isPreLoadFile(this.mergeFileInfo(e,s))};this.trigger("rendering",v),this.trigger("fileListRendering",g),this.listParent.appendChild(s),this.fileList.push(s)},s.prototype.formValidateFileInfo=function(e,t){var i=e.status,s=this.validatedFileSize(e.size);""===s.minSize&&""===s.maxSize||(this.addInvalidClass(t),i=""!==s.minSize?this.localizedTexts("invalidMinFileSize"):""!==s.maxSize?this.localizedTexts("invalidMaxFileSize"):i);var n=this.checkExtension(this.getFilesInArray(e))[0].status;return n===this.localizedTexts("invalidFileType")&&(this.addInvalidClass(t),i=n),i},s.prototype.addInvalidClass=function(e){e.classList.add(Xt)},s.prototype.createFormInput=function(e){var t=this.element.cloneNode(!0);t.classList.add("e-hidden-file-input");for(var i=0,s=e;i<s.length;i++){s[i].input=t}t.setAttribute("name",this.uploaderName),this.uploadWrapper.querySelector(".e-file-select").appendChild(t),"msie"!==this.browserName&&"edge"!==this.browserName&&(this.element.value="")},s.prototype.getFileSize=function(e){for(var t=0,i=0,s=e;i<s.length;i++){t+=s[i].size}return t},s.prototype.mergeFileInfo=function(e,t){for(var i={name:"",rawFile:"",size:0,status:"",type:"",validationMessages:{minSize:"",maxSize:""},statusCode:"1",list:t},s=[],n="",a=0,l=e;a<l.length;a++){var r=l[a];s.push(r.name),n=r.type}return i.name=s.join(", "),i.size=this.getFileSize(e),i.type=n,i.status=this.statusForFormUpload(e,t),i},s.prototype.statusForFormUpload=function(e,t){for(var i,s=!0,n=0,a=e;n<a.length;n++){var l=a[n];i=l.status;var r=this.validatedFileSize(l.size);""===r.minSize&&""===r.maxSize||(s=!1,i=""!==r.minSize?this.localizedTexts("invalidMinFileSize"):""!==r.maxSize?this.localizedTexts("invalidMaxFileSize"):i);var o=this.checkExtension(this.getFilesInArray(l))[0].status;o===this.localizedTexts("invalidFileType")&&(s=!1,i=o)}return s?i=this.localizedTexts("totalFiles")+": "+e.length+" , "+this.localizedTexts("size")+": "+this.bytesToSize(this.getFileSize(e)):(t.classList.add(Xt),i=e.length>1?this.localizedTexts("invalidFileSelection"):i),i},s.prototype.formCustomFileList=function(e,i){this.createParentUL();var s=this.createElement("li",{className:Tt});s.setAttribute("data-files-count",e.length+""),this.setListToFileInfo(e,s);var n=this.mergeFileInfo(e,s);s.setAttribute("data-file-name",n.name),this.uploadTemplateFn=this.templateComplier(this.template);var a=this.uploadTemplateFn(n,this,"template",this.element.id+"Template",this.isStringTemplate,null,s);if(a){var l=[].slice.call(a);t.append(l,s)}var r=this.listParent.querySelectorAll("li").length;s.classList.contains(Xt)||this.createFormInput(e);var o={element:s,fileInfo:n,index:r,isPreload:this.isPreLoadFile(n)},h={element:s,fileInfo:n,index:r,isPreload:this.isPreLoadFile(n)};this.trigger("rendering",o),this.trigger("fileListRendering",h),this.listParent.appendChild(s),this.fileList.push(s),this.renderReactTemplates()},s.prototype.createFileList=function(e,i){if(this.createParentUL(),""===this.template||t.isNullOrUndefined(this.template))if(this.isFormUpload())this.uploadWrapper.classList.add("e-form-upload"),this.formFileList(e,this.element.files);else for(var s=0,n=e;s<n.length;s++){var a=n[s],l=this.createElement("li",{className:Tt,attrs:{"data-file-name":a.name,"data-files-count":"1"}}),r=this.createElement("span",{className:Mt}),o=this.createElement("span",{className:"e-file-name",attrs:{title:a.name}});o.innerHTML=this.getFileNameOnly(a.name);var h=this.createElement("span",{className:"e-file-type"}),d=this.getFileType(a.name);if(h.innerHTML="."+d,d||h.classList.add("e-hidden"),this.enableRtl){var u=this.createElement("span",{className:"e-rtl-container"});u.appendChild(h),u.appendChild(o),r.appendChild(u)}else r.appendChild(o),r.appendChild(h);var c=this.createElement("span",{className:"e-file-size"});c.innerHTML=this.bytesToSize(a.size),r.appendChild(c);var p=this.createElement("span",{className:Ot});r.appendChild(p),p.innerHTML=a.status,l.appendChild(r);var m=this.createElement("span",{className:" e-icons",attrs:{tabindex:this.btnTabIndex}});"msie"===this.browserName&&m.classList.add("e-msie"),m.setAttribute("title",this.localizedTexts("remove")),l.appendChild(m),t.EventHandler.add(m,"click",this.removeFiles,this),"2"===a.statusCode?(p.classList.add(Ft),m.classList.add(Lt),m.setAttribute("title",this.localizedTexts("delete"))):"1"!==a.statusCode&&(p.classList.remove(Ft),p.classList.add(It)),this.autoUpload&&"1"===a.statusCode&&""!==this.asyncSettings.saveUrl&&(p.innerHTML=""),m.classList.contains(Lt)||m.classList.add(Pt);var f=e.indexOf(a),v={element:l,fileInfo:a,index:f,isPreload:this.isPreLoadFile(a)},g={element:l,fileInfo:a,index:f,isPreload:this.isPreLoadFile(a)};this.trigger("rendering",v),this.trigger("fileListRendering",g),this.listParent.appendChild(l),this.fileList.push(l),this.truncateName(o);var y=this.flag;this.isPreLoadFile(a)&&(this.flag=!1,this.checkActionComplete(!0),this.flag=y)}else this.isFormUpload()?(this.uploadWrapper.classList.add("e-form-upload"),this.formCustomFileList(e,this.element.files)):this.createCustomfileList(e)},s.prototype.getSlicedName=function(e){var t=e.textContent;e.dataset.tail=t.slice(t.length-10)},s.prototype.setListToFileInfo=function(e,t){for(var i=0,s=e;i<s.length;i++){s[i].list=t}},s.prototype.truncateName=function(e){var t=e;"edge"!==this.browserName&&t.offsetWidth<t.scrollWidth?this.getSlicedName(t):t.offsetWidth+1<t.scrollWidth&&this.getSlicedName(t)},s.prototype.getFileType=function(e){var t,i=e.lastIndexOf(".");return i>=0&&(t=e.substring(i+1)),t||""},s.prototype.getFileNameOnly=function(e){var t=this.getFileType(e);return t=e.split("."+t)[0]},s.prototype.setInitialAttributes=function(){if(this.initialAttr.accept&&this.element.setAttribute("accept",this.initialAttr.accept),this.initialAttr.disabled&&this.element.setAttribute("disabled","disabled"),this.initialAttr.multiple){var e=document.createAttribute("multiple");this.element.setAttributeNode(e)}},s.prototype.filterfileList=function(e){for(var t=[],i=0;i<e.length;i++)this.getLiElement(e[i]).classList.contains(Ft)||t.push(e[i]);return t},s.prototype.updateStatus=function(e,i,s,n){if(void 0===n&&(n=!0),""===i||t.isNullOrUndefined(i)||""===s||t.isNullOrUndefined(s)||(e.status=i,e.statusCode=s),n){var a=this.getLiElement(e);t.isNullOrUndefined(a)||t.isNullOrUndefined(a.querySelector("."+Ot))||""===i||t.isNullOrUndefined(i)||(a.querySelector("."+Ot).textContent=i)}return e},s.prototype.getLiElement=function(e){for(var i,s=0;s<this.filesData.length;s++)t.isNullOrUndefined(e)||(t.isNullOrUndefined(this.filesData[s].id)||t.isNullOrUndefined(e.id)?this.filesData[s].name!==e.name:this.filesData[s].name!==e.name||this.filesData[s].id!==e.id)||(i=s);return this.fileList[i]},s.prototype.createProgressBar=function(e){var t=this.createElement("span",{className:Bt}),i=this.createElement("progressbar",{className:wt,attrs:{value:"0",max:"100"}}),s=this.createElement("span",{className:"e-progress-inner-wrap"});i.setAttribute("style","width: 0%");var n=this.createElement("span",{className:Ut});n.textContent="0%",s.appendChild(i),t.appendChild(s),t.appendChild(n),e.querySelector("."+Mt).appendChild(t)},s.prototype.updateProgressbar=function(e,i){if(!isNaN(Math.round(e.loaded/e.total*100))&&!t.isNullOrUndefined(i.querySelector("."+wt)))if(t.isNullOrUndefined(this.progressInterval)||""===this.progressInterval)this.changeProgressValue(i,Math.round(e.loaded/e.total*100).toString()+"%");else{var s=Math.round(e.loaded/e.total*100)%parseInt(this.progressInterval,10);0!==s&&100!==s||this.changeProgressValue(i,Math.round(e.loaded/e.total*100).toString()+"%")}},s.prototype.changeProgressValue=function(e,t){e.querySelector("."+wt).setAttribute("style","width:"+t),e.querySelector("."+Ut).textContent=t},s.prototype.uploadInProgress=function(e,i,s,n){var a=this.getLiElement(i);if(!t.isNullOrUndefined(a)||s){if(t.isNullOrUndefined(a))this.cancelUploadingFile(i,e,n);else{"5"===i.statusCode&&this.cancelUploadingFile(i,e,n,a),a.querySelectorAll("."+Bt).length>0||!a.querySelector("."+Ot)||(a.querySelector("."+Ot).classList.add(Rt),this.createProgressBar(a),this.updateProgressBarClasses(a,Rt),a.querySelector("."+Ot).classList.remove(Vt)),this.updateProgressbar(e,a);var l=a.querySelector("."+Pt);t.isNullOrUndefined(l)||(l.classList.add(At,Rt),l.setAttribute("title",this.localizedTexts("abort")),l.classList.remove(Pt))}var r={e:e,operation:"upload",file:this.updateStatus(i,this.localizedTexts("inProgress"),"3")};this.trigger("progress",r)}},s.prototype.cancelUploadingFile=function(e,s,n,a){var l=this;if("5"===e.statusCode){var r={event:s,fileData:e,cancel:!1,customFormData:[]};this.trigger("canceling",r,function(s){if(s.cancel){if(e.statusCode="3",!t.isNullOrUndefined(a)){var r=a.querySelector("."+At);t.isNullOrUndefined(r)||(i.hideSpinner(r),t.detach(a.querySelector(".e-spinner-pane")))}}else{n.emitError=!1,n.httpRequest.abort();var o=new FormData;if("5"===e.statusCode){var h=l.element.getAttribute("name");o.append(h,e.name),o.append("cancel-uploading",e.name),l.updateFormData(o,s.customFormData);var d=new t.Ajax(l.asyncSettings.removeUrl,"POST",!0,null);d.emitError=!1,d.onLoad=function(t){return l.removecanceledFile(t,e),{}},d.send(o)}}})}},s.prototype.removecanceledFile=function(e,s){var n=this.getLiElement(s);if(!n.querySelector("."+Nt)&&!t.isNullOrUndefined(n.querySelector("."+At))){this.updateStatus(s,this.localizedTexts("fileUploadCancel"),"5"),this.renderFailureState(e,s,n);var a=n.querySelector("."+Pt);t.isNullOrUndefined(n)||(i.hideSpinner(a),t.isNullOrUndefined(n.querySelector(".e-spinner-pane"))||t.detach(n.querySelector(".e-spinner-pane")));var l={event:e,response:e&&e.currentTarget?this.getResponse(e):null,operation:"cancel",file:s};this.trigger("success",l)}},s.prototype.renderFailureState=function(e,i,s){var n=this;this.updateProgressBarClasses(s,Vt),this.removeProgressbar(s,"failure"),t.isNullOrUndefined(s.querySelector(".e-file-status"))||s.querySelector(".e-file-status").classList.add(Vt);var a=s.querySelector("."+At);if(!t.isNullOrUndefined(a)){a.classList.remove(At,Rt),a.classList.add(Pt),a.setAttribute("title",this.localizedTexts("remove")),this.pauseButton=this.createElement("span",{className:"e-icons e-file-reload-btn",attrs:{tabindex:this.btnTabIndex}}),a.parentElement.insertBefore(this.pauseButton,a),this.pauseButton.setAttribute("title",this.localizedTexts("retry"));s.querySelector("."+Nt).addEventListener("click",function(e){n.reloadcanceledFile(e,i,s,!1)},!1)}},s.prototype.reloadcanceledFile=function(e,i,s,n){i.statusCode="1",i.status=this.localizedTexts("readyToUploadMessage"),n||(t.isNullOrUndefined(s.querySelector("."+Ot))||s.querySelector("."+Ot).classList.remove(Vt),t.isNullOrUndefined(s.querySelector("."+Nt))||t.detach(s.querySelector("."+Nt)),this.pauseButton=null),s.classList.add(jt),this.upload([i])},s.prototype.uploadComplete=function(e,i,s){var n=e.target;if(4===n.readyState&&n.status>=200&&n.status<=299){var a=this.getLiElement(i);if(t.isNullOrUndefined(a)&&(!s||t.isNullOrUndefined(s)))return;if(!t.isNullOrUndefined(a)){this.updateProgressBarClasses(a,Ft),this.removeProgressbar(a,"success");var l=a.querySelector("."+At);t.isNullOrUndefined(l)||(l.classList.add(Lt),l.setAttribute("title",this.localizedTexts("delete")),l.classList.remove(At),l.classList.remove(Rt))}this.raiseSuccessEvent(e,i)}else this.uploadFailed(e,i)},s.prototype.getResponse=function(e){var t=e.currentTarget;return{readyState:t.readyState,statusCode:t.status,statusText:t.statusText,headers:t.getAllResponseHeaders(),withCredentials:t.withCredentials}},s.prototype.raiseSuccessEvent=function(e,s){var n=this,a=e&&e.currentTarget?this.getResponse(e):null,l=this.localizedTexts("uploadSuccessMessage"),r={e:e,response:a,operation:"upload",file:this.updateStatus(s,l,"2",!1),statusText:l},o=this.getLiElement(s);if(!t.isNullOrUndefined(o)){var h=o.querySelector(".e-spinner-pane");t.isNullOrUndefined(h)||(i.hideSpinner(o),t.detach(h))}this.trigger("success",r,function(e){n.updateStatus(s,e.statusText,"2"),n.uploadedFilesData.push(s),n.trigger("change",{file:n.uploadedFilesData}),n.checkActionButtonStatus(),n.fileList.length>0&&(n.getLiElement(s).classList.contains(jt)?n.getLiElement(s).classList.remove(jt):(n.uploadSequential(),n.checkActionComplete(!0)))})},s.prototype.uploadFailed=function(e,i){var s=this,n=this.getLiElement(i),a=e&&e.currentTarget?this.getResponse(e):null,l=this.localizedTexts("uploadFailedMessage"),r={e:e,response:a,operation:"upload",file:this.updateStatus(i,l,"0",!1),statusText:l};t.isNullOrUndefined(n)||this.renderFailureState(e,i,n),this.trigger("failure",r,function(e){s.updateStatus(i,e.statusText,"0"),s.checkActionButtonStatus(),s.uploadSequential(),s.checkActionComplete(!0)})},s.prototype.uploadSequential=function(){this.sequentialUpload&&(this.autoUpload?this.checkAutoUpload(this.filesData):this.uploadButtonClick())},s.prototype.checkActionComplete=function(e){e?++this.actionCompleteCount:--this.actionCompleteCount,this.raiseActionComplete()},s.prototype.raiseActionComplete=function(){if(this.filesData.length===this.actionCompleteCount&&this.flag){this.flag=!1;var e={fileData:[]};e.fileData=this.getSelectedFileStatus(this.selectedFiles),this.trigger("actionComplete",e)}},s.prototype.getSelectedFileStatus=function(e){for(var t=[],i=0,s=0;s<e.length;s++)for(var n=e[s],a=0;a<this.filesData.length;a++)this.filesData[a].name===n.name&&(t[i]=this.filesData[a],++i);return t},s.prototype.updateProgressBarClasses=function(e,i){var s=e.querySelector("."+wt);t.isNullOrUndefined(s)||s.classList.add(i)},s.prototype.removeProgressbar=function(e,i){var s=this;t.isNullOrUndefined(e.querySelector("."+Bt))||(this.progressAnimation=new t.Animation({duration:1250}),this.progressAnimation.animate(e.querySelector("."+Bt),{name:"FadeOut"}),this.progressAnimation.animate(e.querySelector("."+Ut),{name:"FadeOut"}),setTimeout(function(){s.animateProgressBar(e,i)},750))},s.prototype.animateProgressBar=function(e,i){"success"===i?(e.classList.add(Ft),t.isNullOrUndefined(e.querySelector("."+Ot))||(e.querySelector("."+Ot).classList.remove(Rt),this.progressAnimation.animate(e.querySelector("."+Ot),{name:"FadeIn"}),e.querySelector("."+Ot).classList.add(Ft))):t.isNullOrUndefined(e.querySelector("."+Ot))||(e.querySelector("."+Ot).classList.remove(Rt),this.progressAnimation.animate(e.querySelector("."+Ot),{name:"FadeIn"}),e.querySelector("."+Ot).classList.add(Vt)),e.querySelector("."+Bt)&&t.detach(e.querySelector("."+Bt))},s.prototype.setExtensions=function(e){""===e||t.isNullOrUndefined(e)?this.element.removeAttribute("accept"):this.element.setAttribute("accept",e)},s.prototype.templateComplier=function(e){if(e)try{if(t.selectAll(e,document).length)return t.compile(t.select(e,document).innerHTML.trim())}catch(i){return t.compile(e)}},s.prototype.setRTL=function(){this.enableRtl?t.addClass([this.uploadWrapper],"e-rtl"):t.removeClass([this.uploadWrapper],"e-rtl")},s.prototype.localizedTexts=function(e){return this.l10n.setLocale(this.locale),this.l10n.getConstant(e)},s.prototype.setControlStatus=function(){this.enabled?(this.uploadWrapper.classList.contains(Dt)&&this.uploadWrapper.classList.remove(Dt),!t.isNullOrUndefined(this.browseButton)&&this.element.hasAttribute("disabled")&&(this.element.removeAttribute("disabled"),this.browseButton.removeAttribute("disabled")),!t.isNullOrUndefined(this.clearButton)&&this.clearButton.hasAttribute("disabled")&&this.clearButton.removeAttribute("disabled"),!t.isNullOrUndefined(this.uploadButton)&&this.uploadButton.hasAttribute("disabled")&&this.uploadButton.hasAttribute("disabled")):(this.uploadWrapper.classList.add(Dt),this.element.setAttribute("disabled","disabled"),this.browseButton.setAttribute("disabled","disabled"),t.isNullOrUndefined(this.clearButton)||this.clearButton.setAttribute("disabled","disabled"),t.isNullOrUndefined(this.uploadButton)||this.uploadButton.setAttribute("disabled","disabled"))},s.prototype.checkHTMLAttributes=function(e){for(var i=0,s=e?t.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["accept","multiple","disabled"];i<s.length;i++){var n=s[i];if(!t.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"accept":(t.isNullOrUndefined(this.uploaderOptions)||void 0===this.uploaderOptions.allowedExtensions||e)&&(this.setProperties({allowedExtensions:this.element.getAttribute("accept")},!e),this.initialAttr.accept=this.allowedExtensions);break;case"multiple":if(t.isNullOrUndefined(this.uploaderOptions)||void 0===this.uploaderOptions.multiple||e){var a="multiple"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n);this.setProperties({multiple:a},!e),this.initialAttr.multiple=!0}break;case"disabled":if(t.isNullOrUndefined(this.uploaderOptions)||void 0===this.uploaderOptions.enabled||e){var l="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n);this.setProperties({enabled:l},!e),this.initialAttr.disabled=!0}}}},s.prototype.chunkUpload=function(e,t,i){var s=Math.min(this.asyncSettings.chunkSize,e.size),n={chunkIndex:0,blob:e.rawFile.slice(0,s),file:e,start:0,end:s,retryCount:0,request:null};this.sendRequest(e,n,t,i)},s.prototype.sendRequest=function(e,i,s,n){var a=this,l=new FormData,r=e.rawFile.slice(i.start,i.end);l.append("chunkFile",r,e.name),l.append(this.uploaderName,r,e.name),l.append("chunk-index",i.chunkIndex.toString()),l.append("chunkIndex",i.chunkIndex.toString());var o=Math.max(Math.ceil(e.size/this.asyncSettings.chunkSize),1);l.append("total-chunk",o.toString()),l.append("totalChunk",o.toString());var h=new t.Ajax({url:this.asyncSettings.saveUrl,type:"POST",async:!0,contentType:null});h.emitError=!1,h.onLoad=function(e){return a.chunkUploadComplete(e,i,s),{}},h.onUploadProgress=function(e){return a.chunkUploadInProgress(e,i,s),{}};var d={fileData:e,customFormData:[],cancel:!1,chunkSize:0===this.asyncSettings.chunkSize?null:this.asyncSettings.chunkSize};h.beforeSend=function(t){d.currentRequest=h.httpRequest,d.currentChunkIndex=i.chunkIndex,0===d.currentChunkIndex?a.trigger("uploading",d,function(i){a.uploadingEventCallback(l,i,t,e)}):a.trigger("chunkUploading",d,function(i){a.uploadingEventCallback(l,i,t,e)})},h.onError=function(e){return a.chunkUploadFailed(e,i,s),{}},h.send(l),i.request=h},s.prototype.uploadingEventCallback=function(e,t,i,s){t.cancel?this.eventCancelByArgs(i,t,s):this.updateFormData(e,t.customFormData)},s.prototype.eventCancelByArgs=function(e,i,s){var n=this;if(e.cancel=!0,"5"!==i.fileData.statusCode){i.fileData.statusCode="5",i.fileData.status=this.localizedTexts("fileUploadCancel");var a=this.getLiElement(i.fileData);if(a){t.isNullOrUndefined(a.querySelector("."+Ot))||(a.querySelector("."+Ot).innerHTML=this.localizedTexts("fileUploadCancel"),a.querySelector("."+Ot).classList.add(Vt)),this.pauseButton=this.createElement("span",{className:"e-icons e-file-reload-btn",attrs:{tabindex:this.btnTabIndex}});var l=a.querySelector("."+Pt);l&&l.parentElement.insertBefore(this.pauseButton,l),this.pauseButton.setAttribute("title",this.localizedTexts("retry")),this.pauseButton.addEventListener("click",function(e){n.reloadcanceledFile(e,s,a)},!1),this.checkActionButtonStatus()}}},s.prototype.checkChunkUpload=function(){return!(this.asyncSettings.chunkSize<=0||t.isNullOrUndefined(this.asyncSettings.chunkSize))},s.prototype.chunkUploadComplete=function(e,s,n){var a,l=this,r=e.target;if(4===r.readyState&&r.status>=200&&r.status<300){var o=e&&e.currentTarget?this.getResponse(e):null,h=Math.max(Math.ceil(s.file.size/this.asyncSettings.chunkSize),1),d={event:e,file:s.file,chunkIndex:s.chunkIndex,totalChunk:h,chunkSize:this.asyncSettings.chunkSize,response:o};if(this.trigger("chunkSuccess",d),!t.isNullOrUndefined(n)&&n||(a=this.getLiElement(s.file)),this.updateMetaData(s),s.end===s.file.size&&(s.file.statusCode="3"),"5"===s.file.statusCode){var u={event:e,fileData:s.file,cancel:!1,customFormData:[]};this.trigger("canceling",u,function(e){if(e.cancel){s.file.statusCode="3";var o=a.querySelector("."+At);t.isNullOrUndefined(a)||t.isNullOrUndefined(o)||(i.hideSpinner(o),t.detach(a.querySelector(".e-spinner-pane"))),l.sendNextRequest(s)}else{s.request.emitError=!1,r.abort();var h=new FormData,d=l.element.getAttribute("name");h.append(d,s.file.name),h.append("cancel-uploading",s.file.name),h.append("cancelUploading",s.file.name),l.updateFormData(h,e.customFormData);var u=new t.Ajax(l.asyncSettings.removeUrl,"POST",!0,null);u.emitError=!1,u.onLoad=function(e){return l.removeChunkFile(e,s,n),{}},u.send(h)}})}else{if(h-1===s.chunkIndex&&h>s.chunkIndex){var c=this.pausedData.indexOf(s);return c>=0&&this.pausedData.splice(c,1),t.isNullOrUndefined(this.template)&&(t.isNullOrUndefined(n)||!n)&&a&&(a&&!t.isNullOrUndefined(a.querySelector("."+qt))&&t.detach(a.querySelector("."+qt)),this.removeChunkProgressBar(s)),void this.raiseSuccessEvent(e,s.file)}"4"!==s.file.statusCode&&this.sendNextRequest(s)}}else this.chunkUploadFailed(e,s)},s.prototype.sendNextRequest=function(e){e.start=e.end,e.end+=this.asyncSettings.chunkSize,e.end=Math.min(e.end,e.file.size),e.chunkIndex+=1,this.sendRequest(e.file,e)},s.prototype.removeChunkFile=function(e,s,n){if(t.isNullOrUndefined(this.template)&&t.isNullOrUndefined(n)&&!n){var a=this.getLiElement(s.file),l=a.querySelector("."+At),r=l;this.updateStatus(s.file,this.localizedTexts("fileUploadCancel"),"5"),this.updateProgressBarClasses(a,Vt),this.removeProgressbar(a,"failure"),l&&l.classList.remove(At),l&&l.classList.add(Pt),l&&l.setAttribute("title",this.localizedTexts("remove"));var o=a.querySelector("."+qt);o&&o.classList.add(Nt),o&&o.classList.remove(qt),o&&o.setAttribute("title",this.localizedTexts("retry")),t.isNullOrUndefined(a)||t.isNullOrUndefined(l)||t.isNullOrUndefined(a.querySelector(".e-spinner-pane"))||(i.hideSpinner(r),t.detach(a.querySelector(".e-spinner-pane")))}},s.prototype.pauseUpload=function(e,t,i){e.file.statusCode="4",e.file.status=this.localizedTexts("pause"),this.updateMetaData(e);var s={event:t||null,file:e.file,chunkIndex:e.chunkIndex,chunkCount:Math.round(e.file.size/this.asyncSettings.chunkSize),chunkSize:this.asyncSettings.chunkSize};this.abortUpload(e,i,s)},s.prototype.abortUpload=function(e,i,s){"4"!==e.file.statusCode&&(e.request.emitError=!1,e.request.httpRequest.abort());var n=this.getLiElement(e.file);if(t.isNullOrUndefined(this.template)&&(t.isNullOrUndefined(i)||!i)){var a=n.querySelector("."+qt);a.classList.remove(qt),a.classList.add(Wt),a.setAttribute("title",this.localizedTexts("resume")),a.nextElementSibling.classList.add(Pt),a.nextElementSibling.classList.remove(At),a.nextElementSibling.setAttribute("title",this.localizedTexts("remove"))}for(var l=0;l<this.pausedData.length;l++)this.pausedData[l].file.name===e.file.name&&this.pausedData.splice(l,1);this.pausedData.push(e),this.trigger("pausing",s)},s.prototype.resumeUpload=function(e,i,s){var n,a=this.getLiElement(e.file);t.isNullOrUndefined(a)||(n=a.querySelector("."+Wt)),t.isNullOrUndefined(n)||!t.isNullOrUndefined(s)&&s||(n.classList.remove(Wt),n.classList.add(qt),n.setAttribute("title",this.localizedTexts("pause")),n.nextElementSibling.classList.remove(Pt),n.nextElementSibling.classList.add(At),n.nextElementSibling.setAttribute("title",this.localizedTexts("abort"))),e.file.status=this.localizedTexts("inProgress"),e.file.statusCode="3",this.updateMetaData(e);var l={event:i||null,file:e.file,chunkIndex:e.chunkIndex,chunkCount:Math.round(e.file.size/this.asyncSettings.chunkSize),chunkSize:this.asyncSettings.chunkSize};this.trigger("resuming",l);for(var r=0;r<this.pausedData.length;r++)this.pausedData[r].end===this.pausedData[r].file.size?this.chunkUploadComplete(i,e,s):this.pausedData[r].file.name===e.file.name&&(this.pausedData[r].start=this.pausedData[r].end,this.pausedData[r].end=this.pausedData[r].end+this.asyncSettings.chunkSize,this.pausedData[r].end=Math.min(this.pausedData[r].end,this.pausedData[r].file.size),this.pausedData[r].chunkIndex=this.pausedData[r].chunkIndex+1,this.sendRequest(this.pausedData[r].file,this.pausedData[r],s))},s.prototype.updateMetaData=function(e){-1===this.uploadMetaData.indexOf(e)?this.uploadMetaData.push(e):(this.uploadMetaData.splice(this.uploadMetaData.indexOf(e),1),this.uploadMetaData.push(e))},s.prototype.removeChunkProgressBar=function(e){var i=this.getLiElement(e.file);if(!t.isNullOrUndefined(i)){this.updateProgressBarClasses(i,Ft),this.removeProgressbar(i,"success");var s=i.querySelector("."+At);t.isNullOrUndefined(s)||(s.classList.add(Lt),s.setAttribute("title",this.localizedTexts("delete")),s.classList.remove(At,Rt))}},s.prototype.chunkUploadFailed=function(e,i,s){var n,a=this,l=Math.max(Math.ceil(i.file.size/this.asyncSettings.chunkSize),1);!t.isNullOrUndefined(this.template)||!t.isNullOrUndefined(s)&&s||(n=this.getLiElement(i.file));var r=e&&e.currentTarget?this.getResponse(e):null,o={event:e,file:i.file,chunkIndex:i.chunkIndex,totalChunk:l,chunkSize:this.asyncSettings.chunkSize,cancel:!1,response:r};this.trigger("chunkFailure",o,function(l){if(!l.cancel)if(i.retryCount<a.asyncSettings.retryCount)setTimeout(function(){a.retryRequest(n,i,s)},a.asyncSettings.retryAfterDelay);else{if(!t.isNullOrUndefined(n)){var o=n.querySelector("."+qt)?n.querySelector("."+qt):n.querySelector("."+Wt);t.isNullOrUndefined(o)||(o.classList.add(Nt),o.classList.remove(qt,Wt)),a.updateProgressBarClasses(n,Vt),a.removeProgressbar(n,"failure"),n.querySelector(".e-icons").classList.remove(Rt);var h=n.querySelector("."+At)?n.querySelector("."+At):n.querySelector("."+Pt);h.classList.remove(At),t.isNullOrUndefined(n.querySelector("."+qt))||t.detach(n.querySelector("."+qt)),i.start>0?(h.classList.add(Lt),h.setAttribute("title",a.localizedTexts("delete"))):(h.classList.add(Pt),h.setAttribute("title",a.localizedTexts("remove")))}i.retryCount=0;var d=i.file,u=a.localizedTexts("uploadFailedMessage"),c={e:e,response:r,operation:"upload",file:a.updateStatus(d,u,"0",!1),statusText:u};a.trigger("failure",c,function(e){a.updateStatus(d,e.statusText,"0"),a.uploadSequential(),a.checkActionComplete(!0)})}})},s.prototype.retryRequest=function(e,i,s){t.isNullOrUndefined(this.template)&&(t.isNullOrUndefined(s)||!s)&&e&&this.updateProgressBarClasses(e,Vt),i.retryCount+=1,this.sendRequest(i.file,i)},s.prototype.checkPausePlayAction=function(e){var t=e.target,i=e.target.parentElement,s=this.fileList.indexOf(i),n=this.filesData[s],a=this.getCurrentMetaData(n);t.classList.contains(qt)?this.pauseUpload(a,e):t.classList.contains(Wt)?this.resumeUpload(a,e):t.classList.contains(Nt)&&(a.file.status===this.localizedTexts("fileUploadCancel")?this.retryUpload(a,!1):this.retryUpload(a,!0))},s.prototype.retryUpload=function(e,t){t?(e.end=e.end+this.asyncSettings.chunkSize,e.start=e.start+this.asyncSettings.chunkSize,this.sendRequest(e.file,e)):(e.file.statusCode="1",e.file.status=this.localizedTexts("readyToUploadMessage"),this.chunkUpload(e.file)),this.getLiElement(e.file).classList.add(jt)},s.prototype.chunkUploadInProgress=function(e,i,s){var n=this;if("4"!==i.file.statusCode){"4"!==i.file.statusCode&&"5"!==i.file.statusCode&&(i.file.statusCode="3",i.file.status=this.localizedTexts("inProgress")),this.updateMetaData(i);var a=this.getLiElement(i.file);if(!t.isNullOrUndefined(a)){var l=a.querySelector("."+Nt);if(t.isNullOrUndefined(l)||(l.classList.add(qt),l.setAttribute("title",this.localizedTexts("pause")),l.classList.remove(Nt)),!t.isNullOrUndefined(a)){if(!(a.querySelectorAll("."+Bt).length>0)){var r=a.querySelector("."+Ot);t.isNullOrUndefined(this.template)&&(r.classList.add(Rt),r.classList.remove(Vt),this.createProgressBar(a),this.updateProgressBarClasses(a,Rt));var o=a.querySelector("."+Pt)?a.querySelector("."+Pt):a.querySelector("."+Lt);t.isNullOrUndefined(o)||(o.classList.add(At),o.setAttribute("title",this.localizedTexts("abort")),o.classList.remove(Pt))}if(!isNaN(Math.round(e.loaded/e.total*100))&&t.isNullOrUndefined(this.template)&&"4"!==i.file.statusCode){var h=void 0,d=Math.ceil(i.file.size/this.asyncSettings.chunkSize)-1;this.asyncSettings.chunkSize&&d&&(h=Math.round(i.chunkIndex/d*100),this.changeProgressValue(a,h.toString()+"%"))}0===i.chunkIndex&&this.checkActionButtonStatus()}if(t.isNullOrUndefined(a.querySelector("."+qt))&&t.isNullOrUndefined(this.template)&&t.isNullOrUndefined(a.querySelector("."+Lt))){this.pauseButton=this.createElement("span",{className:"e-icons e-file-pause-btn",attrs:{tabindex:this.btnTabIndex}}),"msie"===this.browserName&&this.pauseButton.classList.add("e-msie");var u=a.querySelector("."+At);u.parentElement.insertBefore(this.pauseButton,u),this.pauseButton.setAttribute("title",this.localizedTexts("pause")),this.pauseButton.addEventListener("click",function(e){n.checkPausePlayAction(e)},!1)}}}},s.prototype.bytesToSize=function(e){var t=-1;if(!e)return"0.0 KB";do{e/=1024,t++}while(e>99);return t>=2&&(e*=1024,t=1),Math.max(e,0).toFixed(1)+" "+["KB","MB"][t]},s.prototype.sortFileList=function(e){for(var t=e=e||this.sortFilesList,i=[],s=0;s<t.length;s++)i.push(t[s].name);for(var n=[],a=0,l=i.sort();a<l.length;a++){var r=l[a];for(s=0;s<t.length;s++)r===t[s].name&&n.push(t[s])}return n},s.prototype.destroy=function(){this.element.value=null,this.clearTemplate(),this.clearAll(),this.unWireEvents(),this.unBindDropEvents(),this.multiple&&this.element.removeAttribute("multiple"),this.enabled||this.element.removeAttribute("disabled"),this.element.removeAttribute("accept"),this.setInitialAttributes();for(var i=0,s=["aria-label","directory","webkitdirectory","tabindex"];i<s.length;i++){var n=s[i];this.element.removeAttribute(n)}t.isNullOrUndefined(this.uploadWrapper)||(this.uploadWrapper.parentElement.appendChild(this.element),t.detach(this.uploadWrapper)),this.uploadWrapper=null,e.prototype.destroy.call(this)},s.prototype.upload=function(e,t){var i=this;if(e=e||this.filesData,this.sequentialUpload&&(this.isFirstFileOnSelection||t))this.sequenceUpload(e);else{var s=this.getFilesInArray(e);this.trigger("beforeUpload",{customFormData:[],currentRequest:null,cancel:!1},function(e){e.cancel||i.uploadFiles(s,t)})}},s.prototype.getFilesInArray=function(e){var t=[];return e instanceof Array?t=e:t.push(e),t},s.prototype.serverReadFileBase64=function(e,t,i){var s=this;return new Promise(function(n,a){var l=s.fileStreams[e].rawFile;try{var r=new FileReader;r.onload=function(e){return function(){try{var t=e.result,i=t?t.split(";base64,")[1]:null;n(i)}catch(e){a(e)}}}(r),r.readAsDataURL(l.slice(t,t+i))}catch(e){a(e)}})},s.prototype.uploadFileCount=function(e){var t=this.filesData;if(!t||0===t.length)return-1;return t.length},s.prototype.getFileRead=function(e,t){var i=this.filesData;if(!i||0===i.length)return-1;var s=i[e],n=this.newFileRef++;return this.fileStreams[n]=s,n},s.prototype.getFileInfo=function(e,t){var i=this.filesData;if(!i||0===i.length)return null;return i[e]?this.filesData[e]:null},s.prototype.uploadFiles=function(e,i){var s=[];if(""!==this.asyncSettings.saveUrl&&!t.isNullOrUndefined(this.asyncSettings.saveUrl)){if(!i||t.isNullOrUndefined(i))if(this.multiple)s=this.filterfileList(e);else{var n=[];n.push(e[0]),s=this.filterfileList(n)}else s=e;for(var a=0;a<s.length;a++)this.uploadFilesRequest(s,a,i)}},s.prototype.uploadFilesRequest=function(e,i,s){var n=this,a=this.checkChunkUpload(),l=new t.Ajax(this.asyncSettings.saveUrl,"POST",!0,null);l.emitError=!1;var r={fileData:e[i],customFormData:[],cancel:!1},o=new FormData;if(l.beforeSend=function(t){r.currentRequest=l.httpRequest,n.trigger("uploading",r,function(s){s.cancel&&n.eventCancelByArgs(t,s,e[i]),n.updateFormData(o,s.customFormData)})},"1"===e[i].statusCode){var h=this.element.getAttribute("name");o.append(h,e[i].rawFile,e[i].name),a&&e[i].size>this.asyncSettings.chunkSize?this.chunkUpload(e[i],s,i):(l.onLoad=function(t){return r.cancel?{}:(n.uploadComplete(t,e[i],s),{})},l.onUploadProgress=function(t){return r.cancel?{}:(n.uploadInProgress(t,e[i],s,l),{})},l.onError=function(t){return n.uploadFailed(t,e[i]),{}},l.send(o))}},s.prototype.spliceFiles=function(e){for(var t=this.fileList[e],i=this.getFilesData(),s=+t.getAttribute("data-files-count"),n=0,a=0;a<e;a++)n+=+this.fileList[a].getAttribute("data-files-count");for(var l=n+s-1;l>=n;l--)i.splice(l,1)},s.prototype.remove=function(e,i,s,n,a){var l=this;t.isNullOrUndefined(n)&&(n=!0);var r={event:a,cancel:!1,filesData:[],customFormData:[],postRawFile:n,currentRequest:null};this.trigger("beforeRemove",{cancel:!1,customFormData:[],currentRequest:null},function(n){if(!n.cancel)if(l.isFormUpload())r.filesData=e,l.trigger("removing",r,function(i){if(!i.cancel)for(var s=!1,n=void 0,a=0,r=l.getFilesInArray(e);a<r.length;a++){var o=r[a];if(s||(n=l.fileList.indexOf(o.list)),n>-1){var h=t.isNullOrUndefined(o.input)?null:o.input;h&&t.detach(h),l.spliceFiles(n),t.detach(l.fileList[n]),l.fileList.splice(n,1),s=!0,n=-1}}});else if(l.isForm&&(t.isNullOrUndefined(l.asyncSettings.removeUrl)||""===l.asyncSettings.removeUrl))r.filesData=l.getFilesData(),l.trigger("removing",r,function(e){e.cancel||l.clearAll()});else{var o=[];(e=t.isNullOrUndefined(e)?l.filesData:e)instanceof Array?o=e:o.push(e),r.filesData=o;for(var h=l.asyncSettings.removeUrl,d=""!==h&&!t.isNullOrUndefined(h),u=function(e){var t=l.uploadedFilesData.indexOf(e);("2"===e.statusCode||"4"===e.statusCode||"0"===e.statusCode&&-1!==t)&&d?l.removeUploadedFile(e,r,s,i):s?l.removeFilesData(e,i):l.trigger("removing",r,function(t){t.cancel||l.removeFilesData(e,i)}),a&&!a.target.classList.contains(Pt)&&l.checkActionComplete(!1)},c=0,p=o;c<p.length;c++){u(p[c])}}})},s.prototype.clearAll=function(){var e=this;if(t.isNullOrUndefined(this.listParent))return"msie"!==this.browserName&&(this.element.value=""),void(this.filesData=[]);var i={cancel:!1,filesData:this.filesData};this.trigger("clearing",i,function(t){t.cancel||(e.clearData(),e.actionCompleteCount=0,e.count=-1)})},s.prototype.getFilesData=function(e){return t.isNullOrUndefined(e)?this.filesData:this.getSelectedFiles(e)},s.prototype.pause=function(e,t){e=e||this.filesData;var i=this.getFilesInArray(e);this.pauseUploading(i,t)},s.prototype.pauseUploading=function(e,t){for(var i=this.getFiles(e),s=0;s<i.length;s++)"3"===i[s].statusCode&&this.pauseUpload(this.getCurrentMetaData(i[s],null),null,t)},s.prototype.getFiles=function(e){var i=[];return t.isNullOrUndefined(e)||e instanceof Array?i=e:i.push(e),i},s.prototype.resume=function(e,t){e=e||this.filesData;var i=this.getFilesInArray(e);this.resumeFiles(i,t)},s.prototype.resumeFiles=function(e,t){for(var i=this.getFiles(e),s=0;s<i.length;s++)"4"===i[s].statusCode&&this.resumeUpload(this.getCurrentMetaData(i[s],null),null,t)},s.prototype.retry=function(e,t,i){e=e||this.filesData;var s=this.getFilesInArray(e);this.sequentialUpload&&this.isFirstFileOnSelection&&(this.isFirstFileOnSelection=!1),this.retryFailedFiles(s,t,i)},s.prototype.retryFailedFiles=function(e,t,i){for(var s=this.getFiles(e),n=0;n<s.length;n++)if("5"===s[n].statusCode||"0"===s[n].statusCode)if(this.asyncSettings.chunkSize>0)this.retryUpload(this.getCurrentMetaData(s[n],null),t);else{var a=void 0;i||(a=this.fileList[this.filesData.indexOf(s[n])]),this.reloadcanceledFile(null,s[n],a,i)}},s.prototype.cancel=function(e){e=e||this.filesData;var t=this.getFilesInArray(e);this.cancelUpload(t)},s.prototype.cancelUpload=function(e){var t=this.getFiles(e);if(this.asyncSettings.chunkSize>0){for(var i=0;i<t.length;i++)if("3"===t[i].statusCode){var s=this.getCurrentMetaData(t[i],null);s.file.statusCode="5",s.file.status=this.localizedTexts("fileUploadCancel"),this.updateMetaData(s),this.showHideUploadSpinner(t[i])}}else for(i=0;i<t.length;i++)"3"===t[i].statusCode&&(t[i].statusCode="5",t[i].status=this.localizedTexts("fileUploadCancel"),this.showHideUploadSpinner(t[i]))},s.prototype.showHideUploadSpinner=function(e){var s=this.getLiElement(e);if(!t.isNullOrUndefined(s)&&t.isNullOrUndefined(this.template)){var n=s.querySelector("."+At);i.createSpinner({target:n,width:"20px"}),i.showSpinner(n)}},xt([t.Complex({saveUrl:"",removeUrl:""},Yt)],s.prototype,"asyncSettings",void 0),xt([t.Property(!1)],s.prototype,"sequentialUpload",void 0),xt([t.Property({})],s.prototype,"htmlAttributes",void 0),xt([t.Property("")],s.prototype,"cssClass",void 0),xt([t.Property(!0)],s.prototype,"enabled",void 0),xt([t.Property(null)],s.prototype,"template",void 0),xt([t.Property(!0)],s.prototype,"multiple",void 0),xt([t.Property(!0)],s.prototype,"autoUpload",void 0),xt([t.Complex({},Zt)],s.prototype,"buttons",void 0),xt([t.Property("")],s.prototype,"allowedExtensions",void 0),xt([t.Property(0)],s.prototype,"minFileSize",void 0),xt([t.Property(3e7)],s.prototype,"maxFileSize",void 0),xt([t.Property(null)],s.prototype,"dropArea",void 0),xt([t.Collection([{}],Kt)],s.prototype,"files",void 0),xt([t.Property(!0)],s.prototype,"showFileList",void 0),xt([t.Property(!1)],s.prototype,"directoryUpload",void 0),xt([t.Property("Default")],s.prototype,"dropEffect",void 0),xt([t.Event()],s.prototype,"created",void 0),xt([t.Event()],s.prototype,"actionComplete",void 0),xt([t.Event()],s.prototype,"rendering",void 0),xt([t.Event()],s.prototype,"beforeUpload",void 0),xt([t.Event()],s.prototype,"fileListRendering",void 0),xt([t.Event()],s.prototype,"selected",void 0),xt([t.Event()],s.prototype,"uploading",void 0),xt([t.Event()],s.prototype,"success",void 0),xt([t.Event()],s.prototype,"failure",void 0),xt([t.Event()],s.prototype,"removing",void 0),xt([t.Event()],s.prototype,"beforeRemove",void 0),xt([t.Event()],s.prototype,"clearing",void 0),xt([t.Event()],s.prototype,"progress",void 0),xt([t.Event()],s.prototype,"change",void 0),xt([t.Event()],s.prototype,"chunkSuccess",void 0),xt([t.Event()],s.prototype,"chunkFailure",void 0),xt([t.Event()],s.prototype,"chunkUploading",void 0),xt([t.Event()],s.prototype,"canceling",void 0),xt([t.Event()],s.prototype,"pausing",void 0),xt([t.Event()],s.prototype,"resuming",void 0),s=xt([t.NotifyPropertyChanges],s)}(t.Component),Jt=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)}}(),$t=function(e,t,i,s){var n,a=arguments.length,l=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(l=(a<3?n(l):a>3?n(t,i,l):n(t,i))||l);return a>3&&l&&Object.defineProperty(t,i,l),l},Qt="e-ctrl-btn",ei="e-switch-ctrl-btn",ti="e-value-switch-btn",ii="e-hide-hex-value",si="e-hide-opacity",ni="e-hide-switchable-value",ai="e-hide-value",li="e-hide-valueswitcher",ri="e-hsv-color",oi="e-selected-value",hi="e-mode-switch-btn",di="e-nocolor-item",ui="e-opacity-value",ci="e-palette",pi="e-color-palette",mi="e-color-picker",fi="e-preview-container",vi="e-previous",gi="e-show-value",yi="e-selected",bi="e-split-preview",Ei=["#000000","#f44336","#e91e63","#9c27b0","#673ab7","#2196f3","#03a9f4","#00bcd4","#009688","#ffeb3b","#ffffff","#ffebee","#fce4ec","#f3e5f5","#ede7f6","#e3f2fd","#e1f5fe","#e0f7fa","#e0f2f1","#fffde7","#f2f2f2","#ffcdd2","#f8bbd0","#e1bee7","#d1c4e9","#bbdefb","#b3e5fc","#b2ebf2","#b2dfdb","#fff9c4","#e6e6e6","#ef9a9a","#f48fb1","#ce93d8","#b39ddb","#90caf9","#81d4fa","#80deea","#80cbc4","#fff59d","#cccccc","#e57373","#f06292","#ba68c8","#9575cd","#64b5f6","#4fc3f7","#4dd0e1","#4db6ac","#fff176","#b3b3b3","#ef5350","#ec407a","#ab47bc","#7e57c2","#42a5f5","#29b6f6","#26c6da","#26a69a","#ffee58","#999999","#e53935","#d81b60","#8e24aa","#5e35b1","#1e88e5","#039be5","#00acc1","#00897b","#fdd835","#808080","#d32f2f","#c2185b","#7b1fa2","#512da8","#1976d2","#0288d1","#0097a7","#00796b","#fbc02d","#666666","#c62828","#ad1457","#6a1b9a","#4527a0","#1565c0","#0277bd","#00838f","#00695c","#f9a825","#4d4d4d","#b71c1c","#880e4f","#4a148c","#311b92","#0d47a1","#01579b","#006064","#004d40","#f57f17"],Ci=function(n){function a(e,t){return n.call(this,e,t)||this}return Jt(a,n),a.prototype.preRender=function(){var e=this.element;this.formElement=t.closest(this.element,"form"),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this);this.l10n=new t.L10n("colorpicker",{Apply:"Apply",Cancel:"Cancel",ModeSwitcher:"Switch Mode"},this.locale),e.getAttribute("ejs-for")&&!e.getAttribute("name")&&e.setAttribute("name",e.id)},a.prototype.render=function(){this.initWrapper(),this.inline?this.createWidget():this.createSplitBtn(),this.enableOpacity||t.addClass([this.container.parentElement],si),this.renderComplete()},a.prototype.initWrapper=function(){var e=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper"});this.element.parentNode.insertBefore(e,this.element),e.appendChild(this.element),t.attributes(this.element,{tabindex:"-1",spellcheck:"false"}),this.container=this.createElement("div",{className:"e-container"}),this.getWrapper().appendChild(this.container);var i=this.value?this.roundValue(this.value).toLowerCase():"#008000ff";this.noColor&&"Palette"===this.mode&&""===this.value&&(i="");var s=i.slice(0,7);t.isNullOrUndefined(this.initialInputValue)&&(this.initialInputValue=s),this.element.value=s,this.enableOpacity?this.setProperties({value:i},!0):this.setProperties({value:s},!0),this.enableRtl&&e.classList.add("e-rtl"),this.cssClass&&t.addClass([e],this.cssClass.split(" ")),this.tileRipple=t.rippleEffect(this.container,{selector:".e-tile"}),this.ctrlBtnRipple=t.rippleEffect(this.container,{selector:".e-btn"})},a.prototype.getWrapper=function(){return this.element.parentElement},a.prototype.createWidget=function(){"Palette"===this.mode?(this.createPalette(),this.inline||this.firstPaletteFocus()):(this.createPicker(),this.inline||this.getDragHandler().focus()),this.isRgb=!0,this.createInput(),this.createCtrlBtn(),this.disabled||this.wireEvents(),this.inline&&this.disabled&&this.toggleDisabled(!0),t.Browser.isDevice&&this.refreshPopupPos()},a.prototype.createSplitBtn=function(){var e=this,n=this.createElement("button",{className:"e-split-colorpicker"});this.getWrapper().appendChild(n),this.splitBtn=new s.SplitButton({iconCss:"e-selected-color",target:this.container,disabled:this.disabled,enableRtl:this.enableRtl,open:this.onOpen.bind(this),click:function(){e.trigger("change",{currentValue:{hex:e.value.slice(0,7),rgba:e.convertToRgbString(e.hexToRgb(e.value))},previousValue:{hex:null,rgba:null},value:e.value})}}),this.splitBtn.createElement=this.createElement,this.splitBtn.appendTo(n);var a=this.createElement("span",{className:bi});t.select(".e-selected-color",n).appendChild(a),a.style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value));var l=this.getPopupEle();if(t.addClass([l],"e-colorpicker-popup"),this.cssClass&&t.addClass([l],this.cssClass.split(" ")),t.Browser.isDevice){var r=this.getPopupInst();r.relateTo=document.body,r.position={X:"center",Y:"center"},r.targetType="container",r.collision={X:"fit",Y:"fit"},r.offsetY=4,l.style.zIndex=i.getZindexPartial(this.splitBtn.element).toString()}this.bindCallBackEvent()},a.prototype.onOpen=function(){this.trigger("open",{element:this.container})},a.prototype.getPopupInst=function(){return t.getInstance(this.getPopupEle(),i.Popup)},a.prototype.bindCallBackEvent=function(){var e=this;this.splitBtn.beforeOpen=function(i){var n=new s.Deferred;return e.trigger("beforeOpen",i,function(s){if(!s.cancel){var a=e.getPopupEle();a.style.top=t.formatUnit(0+pageYOffset),a.style.left=t.formatUnit(0+pageXOffset),a.style.display="block",e.createWidget(),a.style.display="",t.Browser.isDevice&&(e.modal=e.createElement("div"),e.modal.className="e-"+e.getModuleName()+" e-modal",e.modal.style.display="none",document.body.insertBefore(e.modal,a),document.body.className+=" e-colorpicker-overflow",e.modal.style.display="block",e.modal.style.zIndex=(Number(a.style.zIndex)-1).toString())}i.cancel=s.cancel,n.resolve(s)}),n},this.splitBtn.beforeClose=function(i){var n=new s.Deferred;if(t.isNullOrUndefined(i.event))n.resolve(i);else{var a={element:e.container,event:i.event,cancel:!1};e.trigger("beforeClose",a,function(s){t.Browser.isDevice&&i.event.target===e.modal&&(s.cancel=!0),s.cancel||e.onPopupClose(),i.cancel=s.cancel,n.resolve(s)})}return n}},a.prototype.onPopupClose=function(){this.unWireEvents(),this.destroyOtherComp(),this.container.style.width="",t.select("."+bi,this.splitBtn.element).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value)),this.container.innerHTML="",t.removeClass([this.container],[mi,pi]),t.Browser.isDevice&&this.modal&&(t.removeClass([document.body],"e-colorpicker-overflow"),this.modal.style.display="none",this.modal.outerHTML="",this.modal=null)},a.prototype.createPalette=function(){if(t.classList(this.container,[pi],[mi]),this.presetColors){var e=this.createElement("div",{className:"e-custom-palette"});this.appendElement(e);var i=Object.keys(this.presetColors);if(1===i.length)this.appendPalette(this.presetColors[i[0]],i[0],e);else for(var s=0,n=i.length;s<n;s++)this.appendPalette(this.presetColors[i[s]],i[s],e);t.selectAll(".e-row",e).length>10&&t.addClass([e],"e-palette-group")}else this.appendPalette(Ei,"default");"Palette"===this.mode&&!this.modeSwitcher&&this.noColor&&this.setNoColor();var a=parseInt(getComputedStyle(this.container).borderBottomWidth,10);this.container.style.width=t.formatUnit(this.container.children[0].offsetWidth+a+a),this.rgb=this.hexToRgb(this.roundValue(this.value)),this.hsv=this.rgbToHsv.apply(this,this.rgb)},a.prototype.firstPaletteFocus=function(){t.select("."+yi,this.container.children[0])||t.selectAll("."+ci,this.container)[0].focus()},a.prototype.appendPalette=function(e,t,i){var s=this.createElement("div",{className:ci,attrs:{tabindex:"0"}});i?i.appendChild(s):this.appendElement(s);for(var n,a,l,r=0,o=e.length;r<o;r++)0!==r&&r%this.columns!=0||(n=this.createElement("div",{className:"e-row",attrs:{role:"presentation"}}),s.appendChild(n)),l=this.roundValue(e[r]).toLowerCase(),a=this.createElement("span",{className:"e-tile",attrs:{role:"gridcell","aria-label":l,"aria-selected":"false"}}),this.trigger("beforeTileRender",{element:a,presetName:t,value:e[r]}),n.appendChild(a),this.value===l&&(this.addTileSelection(a),s.focus()),a.style.backgroundColor=this.convertToRgbString(this.hexToRgb(l))},a.prototype.setNoColor=function(){var e=this.container.querySelector(".e-row").children[0];e.classList.add(di),this.value||(e.classList.add(yi),t.closest(e,"."+ci).focus()),["aria-selected","aria-label"].forEach(function(t){e.removeAttribute(t)}),e.style.backgroundColor=""},a.prototype.appendElement=function(e,t){void 0===t&&(t=0);var i=this.container.children[t];i?this.container.insertBefore(e,i):this.container.appendChild(e)},a.prototype.addTileSelection=function(e){e.classList.add(yi),e.setAttribute("aria-selected","true")},a.prototype.createPicker=function(){t.classList(this.container,[mi],[pi]);var e=this.createElement("div",{className:"e-hsv-container"});this.appendElement(e),e.appendChild(this.createElement("div",{className:ri}));var i=this.createElement("span",{className:"e-handler",attrs:{tabindex:"0"}});e.appendChild(i),this.rgb=this.hexToRgb(this.value),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.setHsvContainerBg(),this.setHandlerPosition(),this.createSlider(),this.createDragTooltip()},a.prototype.setHsvContainerBg=function(e){void 0===e&&(e=this.hsv[0]),this.getHsvContainer().style.backgroundColor=this.convertToRgbString(this.hsvToRgb(e,100,100,1))},a.prototype.getHsvContainer=function(){return t.select(".e-hsv-container",this.container)},a.prototype.setHandlerPosition=function(){var e=this.getDragHandler(),i=t.select("."+ri,this.container);this.enableRtl?e.style.left=t.formatUnit(i.offsetWidth*Math.abs(100-this.hsv[1])/100):e.style.left=t.formatUnit(i.offsetWidth*this.hsv[1]/100),e.style.top=t.formatUnit(i.offsetHeight*(100-this.hsv[2])/100)},a.prototype.createSlider=function(){var e=this.createElement("div",{className:"e-slider-preview"});this.appendElement(e,1),this.createPreview(e);var t=this.createElement("div",{className:"e-colorpicker-slider"});e.insertBefore(t,e.children[0]);var i=this.createElement("div",{className:"e-hue-slider"});t.appendChild(i),this.hueSlider=new gt({value:this.hsv[0],min:0,max:359,enableRtl:this.enableRtl,enabled:!this.disabled,change:this.hueChange.bind(this)}),this.hueSlider.createElement=this.createElement,this.hueSlider.appendTo(i),this.enableOpacity&&(i=this.createElement("div",{className:"e-opacity-slider"}),t.appendChild(i),this.createOpacitySlider(i))},a.prototype.createOpacitySlider=function(e){this.opacitySlider=new gt({value:100*this.rgb[3],min:0,max:100,enableRtl:this.enableRtl,enabled:!this.disabled,change:this.opacityChange.bind(this)}),this.opacitySlider.createElement=this.createElement,this.opacitySlider.appendTo(e);var t=this.createElement("div",{className:"e-opacity-empty-track"});e.appendChild(t),this.updateOpacitySliderBg()},a.prototype.updateOpacitySliderBg=function(){var e=this.enableRtl?"to left":"to right",i=t.select(".e-opacity-empty-track",this.opacitySlider.element);i&&(i.style.background="linear-gradient("+e+", rgba("+this.rgb.slice(0,3)+", 0) 0%, "+this.convertToRgbString(this.rgb.slice(0,3))+" 100%)")},a.prototype.hueChange=function(e){this.hsv[0]=e.value,this.setHsvContainerBg(),this.convertToOtherFormat()},a.prototype.opacityChange=function(e){var t=e.value,i=this.rgbToHex(this.rgb);this.hsv[3]=t/100,this.rgb[3]=t/100;var s=this.rgbToHex(this.rgb);this.updateOpacityInput(t);var n=this.convertToRgbString(this.rgb);this.updatePreview(n),this.triggerEvent(s,i,n)},a.prototype.updateOpacityInput=function(e){if(this.enableOpacity&&!this.getWrapper().classList.contains(ai)){var i=t.getInstance(t.select("."+ui,this.container),Y);i.value=e,i.dataBind()}},a.prototype.createPreview=function(e){var t=this.createElement("div",{className:fi});e.appendChild(t);var i=this.createElement("span",{className:"e-preview e-current"});t.appendChild(i);var s=this.convertToRgbString(this.rgb);i.style.backgroundColor=s,i=this.createElement("span",{className:"e-preview "+vi}),t.appendChild(i),i.style.backgroundColor=s},a.prototype.isPicker=function(){return!this.container.classList.contains(pi)},a.prototype.getPopupEle=function(){return this.container.parentElement},a.prototype.createNumericInput=function(e,t,i,s){var n=this,a=new Y({value:t,placeholder:i,min:0,max:s,format:"###.##",showSpinButton:!1,floatLabelType:"Always",enableRtl:this.enableRtl,enabled:!this.disabled,readonly:!this.isPicker(),change:function(e){e.event&&n.inputHandler(e.event)}});a.createElement=this.createElement,a.appendTo(e)},a.prototype.createInput=function(){var t=this.isPicker(),i=this.getWrapper();if(t&&!i.classList.contains(ai)||!t&&i.classList.contains(gi)){var s=this.createElement("div",{className:oi});t?this.appendElement(s,2):this.appendElement(s,1);var n=this.createElement("div",{className:"e-input-container"});if(s.appendChild(n),i.classList.contains(li)||this.appendValueSwitchBtn(s),!i.classList.contains(ii)){var a=this.createElement("input",{className:"e-hex",attrs:{maxlength:"7",spellcheck:"false"}});n.appendChild(a),e.Input.createInput({element:a,floatLabelType:"Always",properties:{placeholder:"HEX",enableRtl:this.enableRtl,enabled:!this.disabled,readonly:!this.isPicker()}},this.createElement),e.Input.setValue(this.value.slice(0,7),a),a.addEventListener("input",this.inputHandler.bind(this))}if(!i.classList.contains(ni)){var l=void 0,r=void 0;this.isRgb?(l="RGB",r=this.rgb):(l="HSV",r=this.hsv);for(var o=["rh","gs","bv"],h=0;h<3;h++)this.createNumericInput(n.appendChild(this.createElement("input",{className:"e-"+o[h]+"-value"})),r[h],l[h],255);this.enableOpacity&&this.appendOpacityValue(n)}}},a.prototype.appendOpacityValue=function(e){this.createNumericInput(e.appendChild(this.createElement("input",{className:ui})),100*this.rgb[3],"A",100)},a.prototype.appendValueSwitchBtn=function(e){var t=this.createElement("button",{className:"e-icons e-css e-btn e-flat e-icon-btn "+ti});e.appendChild(t),this.isPicker()&&!this.getWrapper().classList.contains(ni)&&t.addEventListener("click",this.formatSwitchHandler.bind(this))},a.prototype.createCtrlBtn=function(){if(this.modeSwitcher||this.showButtons){this.l10n.setLocale(this.locale);var e=this.createElement("div",{className:ei});if(this.container.appendChild(e),this.showButtons){var t=this.createElement("div",{className:Qt});e.appendChild(t);var i=this.l10n.getConstant("Apply");t.appendChild(this.createElement("button",{innerHTML:i,className:"e-btn e-css e-flat e-primary e-small e-apply",attrs:{title:i}}));var s=this.l10n.getConstant("Cancel");t.appendChild(this.createElement("button",{innerHTML:s,className:"e-btn e-css e-flat e-small e-cancel",attrs:{title:s}}))}this.modeSwitcher&&this.appendModeSwitchBtn()}},a.prototype.appendModeSwitchBtn=function(){var e=this.createElement("button",{className:"e-icons e-btn e-flat e-icon-btn "+hi,attrs:{title:this.l10n.getConstant("ModeSwitcher")}});t.select("."+ei,this.container).insertBefore(e,t.select("."+Qt,this.container))},a.prototype.createDragTooltip=function(){var e=this,s=new i.Tooltip({opensOn:"Custom",showTipPointer:!1,cssClass:"e-color-picker-tooltip",beforeOpen:function(t){e.tooltipEle=t.element},animation:{open:{effect:"None"},close:{effect:"None"}}});s.createElement=this.createElement,s.appendTo(this.container),s.open(this.container),this.tooltipEle.style.zIndex=i.getZindexPartial(this.tooltipEle).toString(),t.select(".e-tip-content",this.tooltipEle).appendChild(this.createElement("div",{className:"e-tip-transparent"}))},a.prototype.getTooltipInst=function(){return t.getInstance(this.container,i.Tooltip)},a.prototype.setTooltipOffset=function(e){this.getTooltipInst().offsetY=e},a.prototype.toggleDisabled=function(e){e?this.getWrapper().classList.add("e-disabled"):this.getWrapper().classList.remove("e-disabled"),this.showButtons&&[].slice.call(t.selectAll(".e-btn",this.container)).forEach(function(i){e?t.attributes(i,{disabled:""}):i.removeAttribute("disabled")})},a.prototype.convertToRgbString=function(e){return e.length?4===e.length?"rgba("+e.join()+")":"rgb("+e.join()+")":""},a.prototype.convertToHsvString=function(e){return 4===e.length?"hsva("+e.join()+")":"hsv("+e.join()+")"},a.prototype.updateHsv=function(){this.hsv[1]=this.hsv[1]>100?100:this.hsv[1],this.hsv[2]=this.hsv[2]>100?100:this.hsv[2],this.setHandlerPosition()},a.prototype.convertToOtherFormat=function(e){void 0===e&&(e=!1);var t=this.rgbToHex(this.rgb);this.rgb=this.hsvToRgb.apply(this,this.hsv);var i=this.rgbToHex(this.rgb),s=this.convertToRgbString(this.rgb);this.updatePreview(s),this.updateInput(i),this.triggerEvent(i,t,s,e)},a.prototype.updateInput=function(i){var s=this.getWrapper();s.classList.contains(ai)||(s.classList.contains(ii)||e.Input.setValue(i.substr(0,7),t.select(".e-hex",this.container)),s.classList.contains(ni)||(this.isRgb?this.updateValue(this.rgb,!1):this.updateValue(this.hsv,!1)))},a.prototype.updatePreview=function(e){this.enableOpacity&&this.updateOpacitySliderBg(),t.select(".e-tip-transparent",this.tooltipEle).style.backgroundColor=e,t.select("."+fi+" .e-current",this.container).style.backgroundColor=e,t.select("."+fi+" ."+vi,this.container).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value))},a.prototype.getDragHandler=function(){return t.select(".e-handler",this.container)},a.prototype.removeTileSelection=function(){[].slice.call(t.selectAll("."+yi,this.container.children[0])).forEach(function(e){e.classList.remove(yi),e.setAttribute("aria-selected","false")})},a.prototype.convertRgbToNumberArray=function(e){return e.slice(e.indexOf("(")+1,e.indexOf(")")).split(",").map(function(e,t){return 3!==t?parseInt(e,10):parseFloat(e)})},a.prototype.getValue=function(e,t){if(e||(e=this.value),t=t?t.toLowerCase():"hex","r"===e[0]){var i=this.convertRgbToNumberArray(e);if("hex"===t||"hexa"===t){var s=this.rgbToHex(i);return"hex"===t?s.slice(0,7):s}return"hsv"===t?this.convertToHsvString(this.rgbToHsv.apply(this,i.slice(0,3))):"hsva"===t?this.convertToHsvString(this.rgbToHsv.apply(this,i)):"null"}if("h"===e[0]){i=this.hsvToRgb.apply(this,this.convertRgbToNumberArray(e));if("rgba"===t)return this.convertToRgbString(i);if("hex"===t||"hexa"===t){s=this.rgbToHex(i);return"hex"===t?s.slice(0,7):s}return"rgb"===t?this.convertToRgbString(i.slice(0,3)):"null"}e=this.roundValue(e);var n=this.hexToRgb(e);return"rgb"!==t&&"hsv"!==t||(n=n.slice(0,3)),"rgba"===t||"rgb"===t?this.convertToRgbString(n):"hsva"===t||"hsv"===t?this.convertToHsvString(this.rgbToHsv.apply(this,n)):"hex"===t?e.slice(0,7):"a"===t?n[3].toString():"null"},a.prototype.toggle=function(){this.container.parentElement.classList.contains("e-popup-close")?this.splitBtn.toggle():this.closePopup(null)},a.prototype.getModuleName=function(){return"colorpicker"},a.prototype.getPersistData=function(){return this.addOnPersist(["value"])},a.prototype.wireEvents=function(){if(this.isPicker()){var e=this.getDragHandler();t.EventHandler.add(e,"keydown",this.pickerKeyDown,this),t.EventHandler.add(this.getHsvContainer(),"mousedown touchstart",this.handlerDown,this),(this.modeSwitcher||this.showButtons)&&this.addCtrlSwitchEvent(),t.EventHandler.add(t.select("."+vi,this.container),"click",this.previewHandler,this)}else t.EventHandler.add(this.container,"click",this.paletteClickHandler,this),t.EventHandler.add(this.container,"keydown",this.paletteKeyDown,this)},a.prototype.formResetHandler=function(){this.value=this.initialInputValue,t.attributes(this.element,{value:this.initialInputValue})},a.prototype.addCtrlSwitchEvent=function(){var e=t.select("."+ei,this.container);e&&t.EventHandler.add(e,"click",this.btnClickHandler,this)},a.prototype.pickerKeyDown=function(e){switch(e.keyCode){case 39:this.handlerDragPosition(1,this.enableRtl?-1:1,e);break;case 37:this.handlerDragPosition(1,this.enableRtl?1:-1,e);break;case 38:this.handlerDragPosition(2,1,e);break;case 40:this.handlerDragPosition(2,-1,e);break;case 13:e.preventDefault();var t=this.rgbToHex(this.rgb);this.enterKeyHandler(t,e)}},a.prototype.enterKeyHandler=function(e,t){this.triggerChangeEvent(e),this.inline||(this.closePopup(t),this.splitBtn.element.focus())},a.prototype.closePopup=function(e){var t=this,i={element:this.container,event:e,cancel:!1};this.trigger("beforeClose",i,function(e){e.cancel||(t.splitBtn.toggle(),t.onPopupClose())})},a.prototype.triggerChangeEvent=function(e){var t=e.slice(0,7);this.trigger("change",{currentValue:{hex:t,rgba:this.convertToRgbString(this.rgb)},previousValue:{hex:this.value.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(this.value))},value:this.enableOpacity?e:t}),this.enableOpacity?this.setProperties({value:e},!0):this.setProperties({value:t},!0),this.element.value=t||"#000000"},a.prototype.handlerDragPosition=function(e,t,i){i.preventDefault(),this.hsv[e]+=t*(i.ctrlKey?1:3),this.hsv[e]<0&&(this.hsv[e]=0),this.updateHsv(),this.convertToOtherFormat(!0)},a.prototype.handlerDown=function(e){e.preventDefault(),"mousedown"===e.type?(this.clientX=Math.abs(e.pageX-pageXOffset),this.clientY=Math.abs(e.pageY-pageYOffset),this.setTooltipOffset(8)):(this.clientX=Math.abs(e.changedTouches[0].pageX-pageXOffset),this.clientY=Math.abs(e.changedTouches[0].pageY-pageYOffset),this.setTooltipOffset(-8)),this.setHsv(this.clientX,this.clientY),this.getDragHandler().style.transition="left .4s cubic-bezier(.25, .8, .25, 1), top .4s cubic-bezier(.25, .8, .25, 1)",this.updateHsv(),this.convertToOtherFormat(),this.getDragHandler().focus(),t.EventHandler.add(document,"mousemove touchmove",this.handlerMove,this),t.EventHandler.add(document,"mouseup touchend",this.handlerEnd,this)},a.prototype.handlerMove=function(e){"touchmove"!==e.type&&e.preventDefault();var i,s;"mousemove"===e.type?(i=Math.abs(e.pageX-pageXOffset),s=Math.abs(e.pageY-pageYOffset)):(i=Math.abs(e.changedTouches[0].pageX-pageXOffset),s=Math.abs(e.changedTouches[0].pageY-pageYOffset)),this.setHsv(i,s);var n=this.getDragHandler();this.updateHsv(),this.convertToOtherFormat(),this.getTooltipInst().refresh(n),this.tooltipEle.style.transform||(Math.abs(this.clientX-i)>8||Math.abs(this.clientY-s)>8)&&(t.select("."+ri,this.container).style.cursor="pointer",n.style.transition="none",this.inline||(this.tooltipEle.style.zIndex=(parseInt(this.getPopupEle().style.zIndex,10)+1).toString()),this.tooltipEle.style.transform="rotate(45deg)",n.classList.add("e-hide-handler"))},a.prototype.setHsv=function(e,i){var s=t.select("."+ri,this.container),n=s.getBoundingClientRect();e=this.enableRtl?e>n.right?0:Math.abs(e-n.right):e>n.left?Math.abs(e-n.left):0,i=i>n.top?Math.abs(i-n.top):0,this.hsv[2]=Math.round(10*Number(100*(s.offsetHeight-Math.max(0,Math.min(s.offsetHeight,i-s.offsetTop)))/s.offsetHeight))/10,this.hsv[1]=Math.round(10*Number(100*Math.max(0,Math.min(s.offsetWidth,e-s.offsetLeft))/s.offsetWidth))/10},a.prototype.handlerEnd=function(e){"touchend"!==e.type&&e.preventDefault(),t.EventHandler.remove(document,"mousemove touchmove",this.handlerMove),t.EventHandler.remove(document,"mouseup touchend",this.handlerEnd);var i=this.getDragHandler();t.select("."+ri,this.container).style.cursor="",this.tooltipEle.style.transform&&(this.tooltipEle.style.transform="",i.classList.remove("e-hide-handler")),this.inline||this.showButtons||this.closePopup(e)},a.prototype.btnClickHandler=function(e){var i=e.target;t.closest(i,"."+hi)?(e.stopPropagation(),this.switchToPalette()):(i.classList.contains("e-apply")||i.classList.contains("e-cancel"))&&this.ctrlBtnClick(i,e)},a.prototype.switchToPalette=function(){this.trigger("beforeModeSwitch",{element:this.container,mode:"Palette"}),this.unWireEvents(),this.destroyOtherComp(),t.detach(t.select(".e-slider-preview",this.container)),this.getWrapper().classList.contains(ai)||t.remove(t.select("."+oi,this.container)),t.detach(this.getHsvContainer()),this.createPalette(),this.firstPaletteFocus(),this.createInput(),this.refreshPopupPos(),this.wireEvents(),this.trigger("onModeSwitch",{element:this.container,mode:"Palette"})},a.prototype.refreshPopupPos=function(){if(!this.inline){var e=this.getPopupEle();e.style.left=t.formatUnit(0+pageXOffset),e.style.top=t.formatUnit(0+pageYOffset),this.getPopupInst().refreshPosition(this.splitBtn.element.parentElement)}},a.prototype.formatSwitchHandler=function(){this.isRgb?(this.updateValue(this.hsv,!0,3,[360,100,100]),this.isRgb=!1):(this.updateValue(this.rgb,!0,2),this.isRgb=!0)},a.prototype.updateValue=function(e,i,s,n){for(var a,l=["e-rh-value","e-gs-value","e-bv-value"],r=0,o=l.length;r<o;r++)(a=t.getInstance(t.select("."+l[r],this.container),Y)).value=Math.round(e[r]),i&&(a.placeholder=l[r].substr(s,1).toUpperCase(),a.max=n?n[r]:255),a.dataBind()},a.prototype.previewHandler=function(e){var i=e.target,s=this.rgbToHex(this.rgb);this.rgb=this.convertRgbToNumberArray(i.style.backgroundColor),this.rgb[3]||(this.rgb[3]=1);var n=this.rgbToHex(this.rgb),a=this.rgbToHsv.apply(this,this.rgb);a[0]!==this.hsv[0]&&(this.hueSlider.setProperties({value:a[0]},!0),this.hueSlider.refresh()),this.setHsvContainerBg(a[0]),this.enableOpacity&&a[3]!==this.hsv[3]&&(this.opacitySlider.setProperties({value:100*a[3]},!0),this.opacitySlider.refresh(),this.updateOpacitySliderBg()),this.hsv=a,this.setHandlerPosition(),this.updateInput(n),t.select("."+fi+" .e-current",this.container).style.backgroundColor=this.convertToRgbString(this.rgb),this.triggerEvent(n,s,this.convertToRgbString(this.rgb))},a.prototype.paletteClickHandler=function(e){e.preventDefault();var i=e.target;if(i.classList.contains("e-tile")){if(this.removeTileSelection(),this.addTileSelection(i),i.classList.contains(di))this.noColorTile();else{var s=i.getAttribute("aria-label"),n=this.rgbToHex(this.rgb);this.rgb=this.hexToRgb(this.roundValue(s)),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.getWrapper().classList.contains(gi)&&this.updateInput(s),this.triggerEvent(s,n,this.convertToRgbString(this.rgb))}this.inline||this.showButtons||this.closePopup(e)}else t.closest(i,"."+hi)?this.switchToPicker():i.classList.contains("e-apply")||i.classList.contains("e-cancel")?this.ctrlBtnClick(i,e):this.getWrapper().classList.contains(gi)&&t.closest(i,"."+ti)&&this.formatSwitchHandler()},a.prototype.noColorTile=function(e){void 0===e&&(e=!1);var t=this.rgbToHex(this.rgb);this.rgb=[],this.hsv=[],this.triggerEvent("",t,"",e)},a.prototype.switchToPicker=function(){var e=this.getWrapper();this.trigger("beforeModeSwitch",{element:this.container,mode:"Picker"}),this.unWireEvents(),[].slice.call(t.selectAll("."+ci,this.container)).forEach(function(e){t.detach(e)}),e.classList.contains(gi)&&t.detach(t.select("."+oi,this.container)),this.container.style.width="";var i=t.select(".e-custom-palette",this.container);this.presetColors&&t.remove(i),this.createPicker(),this.getDragHandler().focus(),this.createInput(),this.refreshPopupPos(),this.wireEvents(),this.trigger("onModeSwitch",{element:this.container,mode:"Picker"})},a.prototype.ctrlBtnClick=function(e,t){if(e.classList.contains("e-apply")){var i=this.rgbToHex(this.rgb);this.triggerChangeEvent(i)}this.inline||(this.closePopup(t),this.splitBtn.element.focus())},a.prototype.paletteKeyDown=function(e){var i=e.target;if(i.classList.contains(ci)){var s,n,a=[].slice.call(t.selectAll(".e-tile",i)),l=a.filter(function(e){return e.classList.contains("e-selected")}).pop();switch(!e.altKey&&e.keyCode){case 39:e.preventDefault(),s=l?a[this.tilePosition(a,l,this.enableRtl?-1:1)]:a[this.enableRtl?a.length-1:0],this.keySelectionChanges(s);break;case 37:e.preventDefault(),s=l?a[this.tilePosition(a,l,this.enableRtl?1:-1)]:a[this.enableRtl?0:a.length-1],this.keySelectionChanges(s);break;case 38:e.preventDefault(),s=a[n=l?this.tilePosition(a,l,-this.columns):0]?a[n]:a[n-this.columns],this.keySelectionChanges(s);break;case 40:e.preventDefault(),a[n=l?this.tilePosition(a,l,this.columns):a.length-1]?s=a[n]:(n%=a.length,s=a[n+=a[a.length-1].parentElement.childElementCount]),this.keySelectionChanges(s);break;case 13:if(e.preventDefault(),l){var r=l.getAttribute("aria-label");this.enterKeyHandler(r||"",e)}}}},a.prototype.keySelectionChanges=function(e){if(this.removeTileSelection(),this.addTileSelection(e),e.classList.contains(di))this.noColorTile(!0);else{var t=e.getAttribute("aria-label"),i=this.rgbToHex(this.rgb);this.rgb=this.hexToRgb(t),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.getWrapper().classList.contains(gi)&&this.updateInput(t),this.triggerEvent(t,i,this.convertToRgbString(this.rgb),!0)}},a.prototype.tilePosition=function(e,t,i){var s=(e=Array.prototype.slice.call(e)).length,n=this.columns-e[s-1].parentElement.childElementCount,a=e.indexOf(t);return(a+=i)<0?a+=s+n:a%=s+n,a},a.prototype.inputHandler=function(e){var i=e.target;if(i.value.length){var s,n;switch(t.select(".e-float-text",i.parentElement).textContent){case"HEX":var a="";if(("#"===i.value[0]&&5!==i.value.length||"#"!==i.value[0]&&4!==i.value.length)&&(a=this.roundValue(i.value)),9!==a.length)return;n=this.rgbToHex(this.rgb),this.rgb=this.hexToRgb(a+a.substr(-2)),this.inputValueChange(this.rgbToHsv.apply(this,this.rgb),n,i.value);break;case"R":this.rgb[0]!==Number(i.value)&&(n=this.rgbToHex(this.rgb),this.rgb[0]=Number(i.value),s=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(s,n));break;case"G":this.rgb[1]!==Number(i.value)&&(n=this.rgbToHex(this.rgb),this.rgb[1]=Number(i.value),s=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(s,n));break;case"B":this.rgb[2]!==Number(i.value)&&(n=this.rgbToHex(this.rgb),this.rgb[2]=Number(i.value),s=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(s,n));break;case"H":this.hueSlider.value=Number(i.value);break;case"S":this.hsv[1]!==Number(i.value)&&(this.hsv[1]=Number(i.value),this.updateHsv(),this.convertToOtherFormat());break;case"V":this.hsv[2]!==Number(i.value)&&(this.hsv[2]=Number(i.value),this.updateHsv(),this.convertToOtherFormat());break;case"A":this.opacitySlider.value=Number(i.value)}}},a.prototype.inputValueChange=function(e,t,i){e[0]!==this.hsv[0]&&(this.hueSlider.setProperties({value:e[0]},!0),this.hueSlider.refresh(),this.setHsvContainerBg(e[0])),this.hsv=e;var s=this.rgbToHex(this.rgb);this.setHandlerPosition(),this.updateInput(i||s);var n=this.convertToRgbString(this.rgb);this.updatePreview(n),this.triggerEvent(s,t,n)},a.prototype.triggerEvent=function(e,t,i,s){void 0===s&&(s=!1);var n=e.slice(0,7);this.showButtons||s?this.trigger("select",{currentValue:{hex:n,rgba:i},previousValue:{hex:t.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(t))}}):(this.trigger("change",{currentValue:{hex:n,rgba:i},previousValue:{hex:this.value.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(this.value))},value:e}),this.setProperties({value:e},!0),this.element.value=n||"#000000")},a.prototype.destroy=function(){var e=this,i=this.getWrapper();n.prototype.destroy.call(this),["tabindex","spellcheck"].forEach(function(t){e.element.removeAttribute(t)}),this.inline?(this.unWireEvents(),this.destroyOtherComp()):(this.isPopupOpen()&&(this.unWireEvents(),this.destroyOtherComp()),this.splitBtn.destroy(),this.splitBtn=null),this.tileRipple(),this.tileRipple=null,this.ctrlBtnRipple(),this.ctrlBtnRipple=null,this.element.nextElementSibling&&t.detach(this.element.nextElementSibling),i&&(i.parentElement.insertBefore(this.element,i),t.detach(i)),this.container=null,this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},a.prototype.destroyOtherComp=function(){if(this.isPicker()){this.hueSlider.destroy(),this.enableOpacity&&(this.opacitySlider.destroy(),this.opacitySlider=null),this.hueSlider=null;var e=this.getTooltipInst();e.close(),e.destroy(),this.tooltipEle=null}},a.prototype.isPopupOpen=function(){return this.getPopupEle().classList.contains("e-popup-open")},a.prototype.unWireEvents=function(){if(this.isPicker()){var e=this.getDragHandler();t.EventHandler.remove(e,"keydown",this.pickerKeyDown),t.EventHandler.remove(this.getHsvContainer(),"mousedown touchstart",this.handlerDown),(this.modeSwitcher||this.showButtons)&&t.EventHandler.remove(t.select("."+ei,this.container),"click",this.btnClickHandler),t.EventHandler.remove(t.select("."+vi,this.container),"click",this.previewHandler)}else t.EventHandler.remove(this.container,"click",this.paletteClickHandler),t.EventHandler.remove(this.container,"keydown",this.paletteKeyDown)},a.prototype.roundValue=function(e){if(!e)return"";"#"!==e[0]&&(e="#"+e);var t=e.length;if(4===t&&(e+="f",t=5),5===t){for(var i="",s=1,n=e.length;s<n;s++)i+=e.charAt(s)+e.charAt(s);e="#"+i,t=9}return 7===t&&(e+="ff"),e},a.prototype.hexToRgb=function(e){if(!e)return[];9!==(e=e.trim()).length&&(e=this.roundValue(e));var t=Number((parseInt(e.slice(-2),16)/255).toFixed(2));e=e.slice(1,7);var i=parseInt(e,16),s=[];return s.push(i>>16&255),s.push(i>>8&255),s.push(255&i),s.push(t),s},a.prototype.rgbToHsv=function(e,i,s,n){if(this.rgb&&!this.rgb.length)return[];e/=255,i/=255,s/=255;var a,l=Math.max(e,i,s),r=Math.min(e,i,s),o=l,h=l-r,d=0===l?0:h/l;if(l===r)a=0;else{switch(l){case e:a=(i-s)/h+(i<s?6:0);break;case i:a=(s-e)/h+2;break;case s:a=(e-i)/h+4}a/=6}var u=[Math.round(360*a),Math.round(1e3*d)/10,Math.round(1e3*o)/10];return t.isNullOrUndefined(n)||u.push(n),u},a.prototype.hsvToRgb=function(e,i,s,n){var a,l,r;if(i/=100,s/=100,0===i)return a=l=r=s,[Math.round(255*a),Math.round(255*l),Math.round(255*r),n];e/=60;var o=Math.floor(e),h=e-o,d=s*(1-i),u=s*(1-i*h),c=s*(1-i*(1-h));switch(o){case 0:a=s,l=c,r=d;break;case 1:a=u,l=s,r=d;break;case 2:a=d,l=s,r=c;break;case 3:a=d,l=u,r=s;break;case 4:a=c,l=d,r=s;break;default:a=s,l=d,r=u}var p=[Math.round(255*a),Math.round(255*l),Math.round(255*r)];return t.isNullOrUndefined(n)||p.push(n),p},a.prototype.rgbToHex=function(e){return e.length?"#"+this.hex(e[0])+this.hex(e[1])+this.hex(e[2])+(t.isNullOrUndefined(e[3])?"":0!==e[3]?(Math.round(255*e[3])+65536).toString(16).substr(-2):"00"):""},a.prototype.hex=function(e){return("0"+e.toString(16)).slice(-2)},a.prototype.changeModeSwitcherProp=function(e){var i=t.select("."+ei,this.container);e?i?this.appendModeSwitchBtn():(this.createCtrlBtn(),this.isPicker()&&!this.disabled&&this.addCtrlSwitchEvent()):i&&(this.showButtons?t.detach(t.select("."+hi,i)):t.remove(i))},a.prototype.changeShowBtnProps=function(e){var i=t.select("."+ei,this.container);e?(i&&t.remove(i),this.createCtrlBtn(),this.isPicker()&&!this.disabled&&this.addCtrlSwitchEvent()):this.modeSwitcher?t.detach(t.select("."+Qt,i)):t.remove(i)},a.prototype.changeValueProp=function(e){if(this.isPicker())this.rgb=this.hexToRgb(e),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.setHandlerPosition(),t.detach(t.closest(this.hueSlider.element,".e-slider-preview")),this.createSlider(),this.setHsvContainerBg(),this.updateInput(e),4===this.rgb.length&&this.updateOpacityInput(100*this.rgb[3]);else{this.removeTileSelection();var i=this.container.querySelector('span[aria-label="'+this.roundValue(e)+'"]');i&&this.addTileSelection(i)}},a.prototype.setInputEleProps=function(){t.remove(t.select("."+oi,this.container)),this.createInput()},a.prototype.changeDisabledProp=function(e){this.isPicker()&&(this.hueSlider.enabled=!e,this.opacitySlider.enabled=!e,this.setInputEleProps()),e?(this.toggleDisabled(!0),this.unWireEvents()):(this.toggleDisabled(!1),this.wireEvents())},a.prototype.changeCssClassProps=function(e,i){var s=this.getWrapper(),n=this.getPopupEle();i&&t.removeClass([s,n],i.split(" ")),e&&t.addClass([s,n],e.split(" "))},a.prototype.changeRtlProps=function(e){e?t.addClass([this.getWrapper()],"e-rtl"):t.removeClass([this.getWrapper()],"e-rtl")},a.prototype.changePaletteProps=function(){t.detach(this.container.children[0]),this.container.style.width="",this.createPalette()},a.prototype.changeOpacityProps=function(e){var i=this.getWrapper();e?(t.removeClass([this.container.parentElement],si),this.createOpacitySlider(t.select(".e-colorpicker-slider",this.container).appendChild(this.createElement("div",{className:"e-opacity-slider"}))),i.classList.contains(ai)||i.classList.contains(ni)||this.appendOpacityValue(t.select(".e-input-container",this.container))):(t.addClass([this.container.parentElement],si),this.opacitySlider.destroy(),t.remove(this.opacitySlider.element),this.opacitySlider=null,i.classList.contains(ai)||i.classList.contains(ni)||t.remove(t.select("."+ui,this.container).parentElement))},a.prototype.onPropertyChanged=function(e,i){var n=this;if(!t.isNullOrUndefined(e.value)){var a=this.roundValue(e.value);if(9===a.length){this.element.value=this.roundValue(a).slice(0,7);var l=this.splitBtn&&t.select("."+bi,this.splitBtn.element);l&&(l.style.backgroundColor=this.convertToRgbString(this.hexToRgb(e.value)))}else this.value=i.value}if(!this.inline&&t.isNullOrUndefined(e.inline)){if(this.splitBtn.setProperties(s.getModel(e,["disabled","enableRtl"])),!this.isPopupOpen())return this.changeCssClassProps(e.cssClass,i.cssClass),void this.changeRtlProps(e.enableRtl)}for(var r=function(s){switch(s){case"inline":e.inline?(o.getWrapper().appendChild(o.container),o.splitBtn.destroy(),t.detach(o.element.nextElementSibling),o.container.children.length||o.createWidget()):(o.destroyOtherComp(),o.unWireEvents(),o.container.innerHTML="",o.createSplitBtn());break;case"cssClass":o.changeCssClassProps(e.cssClass,i.cssClass);var a=e.cssClass.split(" ").concat(i.cssClass.split(" ")),l=0;(a=a.reduce(function(e,t){return e.indexOf(t)<0&&e.push(t),e},[])).forEach(function(e){if(0===l&&(e===ai||e===li||e===gi||e===ii||e===ni)){t.select("."+oi,n.container)&&t.remove(t.select("."+oi,n.container)),n.createInput(),l++}});break;case"enableRtl":o.isPicker()&&(o.hueSlider.enableRtl=e.enableRtl,o.enableOpacity&&(o.opacitySlider.enableRtl=e.enableRtl),o.setInputEleProps()),o.changeRtlProps(e.enableRtl);break;case"disabled":o.changeDisabledProp(e.disabled);break;case"value":o.value!==i.value&&o.changeValueProp(e.value);break;case"showButtons":o.changeShowBtnProps(e.showButtons);break;case"mode":"Picker"===e.mode?o.switchToPicker():o.switchToPalette();break;case"modeSwitcher":o.changeModeSwitcherProp(e.modeSwitcher);break;case"columns":case"presetColors":o.isPicker()||o.changePaletteProps();break;case"noColor":e.noColor?"Palette"!==o.mode||o.modeSwitcher||o.setNoColor():o.changePaletteProps();break;case"enableOpacity":o.changeOpacityProps(e.enableOpacity)}},o=this,h=0,d=Object.keys(e);h<d.length;h++){r(d[h])}},a.prototype.focusIn=function(){this.element.parentElement.focus()},$t([t.Property("#008000ff")],a.prototype,"value",void 0),$t([t.Property("")],a.prototype,"cssClass",void 0),$t([t.Property(!1)],a.prototype,"disabled",void 0),$t([t.Property("Picker")],a.prototype,"mode",void 0),$t([t.Property(!0)],a.prototype,"modeSwitcher",void 0),$t([t.Property(null)],a.prototype,"presetColors",void 0),$t([t.Property(!0)],a.prototype,"showButtons",void 0),$t([t.Property(10)],a.prototype,"columns",void 0),$t([t.Property(!1)],a.prototype,"inline",void 0),$t([t.Property(!1)],a.prototype,"noColor",void 0),$t([t.Property(!1)],a.prototype,"enablePersistence",void 0),$t([t.Property(!0)],a.prototype,"enableOpacity",void 0),$t([t.Event()],a.prototype,"select",void 0),$t([t.Event()],a.prototype,"change",void 0),$t([t.Event()],a.prototype,"beforeTileRender",void 0),$t([t.Event()],a.prototype,"beforeOpen",void 0),$t([t.Event()],a.prototype,"open",void 0),$t([t.Event()],a.prototype,"beforeClose",void 0),$t([t.Event()],a.prototype,"beforeModeSwitch",void 0),$t([t.Event()],a.prototype,"onModeSwitch",void 0),$t([t.Event()],a.prototype,"created",void 0),a=$t([t.NotifyPropertyChanges],a)}(t.Component),Si=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)}}(),xi=function(e,t,i,s){var n,a=arguments.length,l=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(l=(a<3?n(l):a>3?n(t,i,l):n(t,i))||l);return a>3&&l&&Object.defineProperty(t,i,l),l},ki=["title","style","class"],Ti=function(i){function s(e,t){var s=i.call(this,e,t)||this;return s.previousValue=null,s.isAngular=!1,s.isHiddenInput=!1,s.isForm=!1,s.inputPreviousValue=null,s.isVue=!1,s.textboxOptions=e,s}return Si(s,i),s.prototype.onPropertyChanged=function(i,s){for(var n=0,a=Object.keys(i);n<a.length;n++){switch(a[n]){case"floatLabelType":e.Input.removeFloating(this.textboxWrapper),e.Input.addFloating(this.respectiveElement,this.floatLabelType,this.placeholder);break;case"enabled":e.Input.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container),this.bindClearEvent();break;case"width":e.Input.setWidth(i.width,this.textboxWrapper.container);break;case"value":var l=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.isBlank(this.value)||(this.value=this.value.toString()),this.isProtectedOnChange=l,e.Input.setValue(this.value,this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value),this.inputPreviousValue=this.respectiveElement.value,(this.isAngular||this.isVue)&&!0===this.preventChange?(this.previousValue=this.isAngular?this.value:this.previousValue,this.preventChange=!1):(t.isNullOrUndefined(this.isAngular)||!this.isAngular||this.isAngular&&!this.preventChange||this.isAngular&&t.isNullOrUndefined(this.preventChange))&&this.raiseChangeEvent();break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.checkAttributes(!0),e.Input.validateInputType(this.textboxWrapper.container,this.element);break;case"readonly":e.Input.setReadonly(this.readonly,this.respectiveElement);break;case"type":"TEXTAREA"!==this.respectiveElement.tagName&&(this.respectiveElement.setAttribute("type",this.type),e.Input.validateInputType(this.textboxWrapper.container,this.element),this.raiseChangeEvent());break;case"showClearButton":"TEXTAREA"!==this.respectiveElement.tagName&&(e.Input.setClearButton(this.showClearButton,this.respectiveElement,this.textboxWrapper),this.bindClearEvent());break;case"enableRtl":e.Input.setEnableRtl(this.enableRtl,[this.textboxWrapper.container]);break;case"placeholder":e.Input.setPlaceholder(this.placeholder,this.respectiveElement);break;case"autocomplete":"on"!==this.autocomplete&&""!==this.autocomplete?this.respectiveElement.autocomplete=this.autocomplete:this.removeAttributes(["autocomplete"]);break;case"cssClass":this.updateCssClass(i.cssClass,s.cssClass);break;case"locale":this.globalize=new t.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),e.Input.setPlaceholder(this.placeholder,this.respectiveElement)}}},s.prototype.getModuleName=function(){return"textbox"},s.prototype.isBlank=function(e){return!e||/^\s*$/.test(e)},s.prototype.preRender=function(){if(this.cloneElement=this.element.cloneNode(!0),this.formElement=t.closest(this.element,"form"),t.isNullOrUndefined(this.formElement)||(this.isForm=!0),"EJS-TEXTBOX"===this.element.tagName){for(var e=t.getValue("ej2_instances",this.element),i=this.multiline?this.createElement("textarea"):this.createElement("input"),s=0;s<this.element.attributes.length;s++){"id"!==(l=this.element.attributes[s].nodeName)&&(i.setAttribute(l,this.element.attributes[s].nodeValue),i.innerHTML=this.element.innerHTML,"name"===l&&this.element.removeAttribute("name"))}this.element.appendChild(i),this.element=i,t.setValue("ej2_instances",e,this.element)}this.updateHTMLAttrToElement(),this.checkAttributes(!1),"TEXTAREA"!==this.element.tagName&&this.element.setAttribute("type",this.type),this.element.setAttribute("role","textbox"),this.globalize=new t.Internationalization(this.locale);var n={placeholder:this.placeholder};if(this.l10n=new t.L10n("textbox",n,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.element.hasAttribute("id")||this.element.setAttribute("id",t.getUniqueID("textbox")),this.element.hasAttribute("name")||this.element.setAttribute("name",this.element.getAttribute("id")),"INPUT"===this.element.tagName&&this.multiline){this.isHiddenInput=!0,this.textarea=this.createElement("textarea"),this.element.parentNode.insertBefore(this.textarea,this.element),this.element.setAttribute("type","hidden"),this.textarea.setAttribute("name",this.element.getAttribute("name")),this.element.removeAttribute("name"),this.textarea.setAttribute("role",this.element.getAttribute("role")),this.element.removeAttribute("role"),this.textarea.setAttribute("id",t.getUniqueID("textarea"));var a=["placeholder","disabled","value","readonly","type","autocomplete"];for(s=0;s<this.element.attributes.length;s++){var l=this.element.attributes[s].nodeName;this.element.hasAttribute(l)&&ki.indexOf(l)<0&&"id"!==l&&"type"!==l&&"e-mappinguid"!==l&&(this.textarea.setAttribute(l,this.element.attributes[s].nodeValue),a.indexOf(l)<0&&(this.element.removeAttribute(l),s--))}}},s.prototype.checkAttributes=function(e){for(var i=0,s=e?t.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly","type","autocomplete"];i<s.length;i++){var n=s[i];if(!t.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"disabled":if(t.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.enabled||e){var a="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n);this.setProperties({enabled:a},!e)}break;case"readonly":if(t.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.readonly||e){var l="readonly"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n);this.setProperties({readonly:l},!e)}break;case"placeholder":(t.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.placeholder||e)&&this.setProperties({placeholder:this.element.placeholder},!e);break;case"autocomplete":if(t.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.autocomplete||e){var r="off"===this.element.autocomplete?"off":"on";this.setProperties({autocomplete:r},!e)}break;case"value":(t.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.value||e)&&this.setProperties({value:this.element.value},!e);break;case"type":(t.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.type||e)&&this.setProperties({type:this.element.type},!e)}}},s.prototype.render=function(){var i=this.cssClass;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(i=this.getInputValidClassList(this.cssClass)),this.respectiveElement=this.isHiddenInput?this.textarea:this.element,this.textboxWrapper=e.Input.createInput({element:this.respectiveElement,floatLabelType:this.floatLabelType,properties:{enabled:this.enabled,enableRtl:this.enableRtl,cssClass:i,readonly:this.readonly,placeholder:this.placeholder,showClearButton:this.showClearButton}}),this.updateHTMLAttrToWrapper(),this.isHiddenInput&&this.respectiveElement.parentNode.insertBefore(this.element,this.respectiveElement),this.wireEvents(),t.isNullOrUndefined(this.value)||(e.Input.setValue(this.value,this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value)),t.isNullOrUndefined(this.value)||(this.initialValue=this.value,this.setInitialValue()),"on"!==this.autocomplete&&""!==this.autocomplete?this.respectiveElement.autocomplete=this.autocomplete:t.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.autocomplete||this.removeAttributes(["autocomplete"]),this.previousValue=this.value,this.inputPreviousValue=this.value,this.respectiveElement.defaultValue=this.respectiveElement.value,e.Input.setWidth(this.width,this.textboxWrapper.container),this.renderComplete()},s.prototype.updateHTMLAttrToWrapper=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if(ki.indexOf(s)>-1)if("class"===s){var n=this.getInputValidClassList(this.htmlAttributes[s]);""!==n&&t.addClass([this.textboxWrapper.container],n.split(" "))}else if("style"===s){var a=this.textboxWrapper.container.getAttribute(s);a=t.isNullOrUndefined(a)?this.htmlAttributes[s]:a+this.htmlAttributes[s],this.textboxWrapper.container.setAttribute(s,a)}else this.textboxWrapper.container.setAttribute(s,this.htmlAttributes[s])}},s.prototype.updateHTMLAttrToElement=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];ki.indexOf(s)<0&&this.element.setAttribute(s,this.htmlAttributes[s])}},s.prototype.updateCssClass=function(t,i){e.Input.setCssClass(this.getInputValidClassList(t),[this.textboxWrapper.container],this.getInputValidClassList(i))},s.prototype.getInputValidClassList=function(e){var i=e;return t.isNullOrUndefined(e)||""===e||(i=e.replace(/\s+/g," ").trim()),i},s.prototype.setInitialValue=function(){this.isAngular||this.respectiveElement.setAttribute("value",this.initialValue)},s.prototype.wireEvents=function(){t.EventHandler.add(this.respectiveElement,"focus",this.focusHandler,this),t.EventHandler.add(this.respectiveElement,"blur",this.focusOutHandler,this),t.EventHandler.add(this.respectiveElement,"input",this.inputHandler,this),t.EventHandler.add(this.respectiveElement,"change",this.changeHandler,this),this.isForm&&t.EventHandler.add(this.formElement,"reset",this.resetForm,this),this.bindClearEvent(),!t.isNullOrUndefined(this.textboxWrapper.container.querySelector(".e-float-text"))&&"Auto"===this.floatLabelType&&this.textboxWrapper.container.classList.contains("e-autofill")&&this.textboxWrapper.container.classList.contains("e-outline")&&t.EventHandler.add(this.textboxWrapper.container.querySelector(".e-float-text"),"animationstart",this.animationHandler,this)},s.prototype.animationHandler=function(){this.textboxWrapper.container.classList.add("e-valid-input");var e=this.textboxWrapper.container.querySelector(".e-float-text");t.isNullOrUndefined(e)||(e.classList.add("e-label-top"),e.classList.contains("e-label-bottom")&&e.classList.remove("e-label-bottom"))},s.prototype.resetValue=function(e){var t=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.value=e,this.isProtectedOnChange=t},s.prototype.resetForm=function(){if(this.isAngular?this.resetValue(""):this.resetValue(this.initialValue),!t.isNullOrUndefined(this.textboxWrapper)){var e=this.textboxWrapper.container.querySelector(".e-float-text");t.isNullOrUndefined(e)||(t.isNullOrUndefined(this.initialValue)||""===this.initialValue?(e.classList.add("e-label-bottom"),e.classList.remove("e-label-top")):""!==this.initialValue&&(e.classList.add("e-label-top"),e.classList.remove("e-label-bottom")))}},s.prototype.focusHandler=function(e){var t={container:this.textboxWrapper.container,event:e,value:this.value};this.trigger("focus",t)},s.prototype.focusOutHandler=function(e){null===this.previousValue&&null===this.value&&""===this.respectiveElement.value||this.previousValue===this.respectiveElement.value||this.raiseChangeEvent(e,!0);var t={container:this.textboxWrapper.container,event:e,value:this.value};this.trigger("blur",t)},s.prototype.inputHandler=function(e){var t={event:e,value:this.respectiveElement.value,previousValue:this.inputPreviousValue,container:this.textboxWrapper.container};this.inputPreviousValue=this.respectiveElement.value,this.isAngular&&(this.localChange({value:this.respectiveElement.value}),this.preventChange=!0),this.isVue&&(this.preventChange=!0),this.trigger("input",t),e.stopPropagation()},s.prototype.changeHandler=function(e){this.setProperties({value:this.respectiveElement.value},!0),this.raiseChangeEvent(e,!0),e.stopPropagation()},s.prototype.raiseChangeEvent=function(e,t){var i={event:e,value:this.value,previousValue:this.previousValue,container:this.textboxWrapper.container,isInteraction:t||!1,isInteracted:t||!1};this.preventChange=!1,this.trigger("change",i),this.previousValue=this.value},s.prototype.bindClearEvent=function(){this.showClearButton&&"TEXTAREA"!==this.respectiveElement.tagName&&(this.enabled?t.EventHandler.add(this.textboxWrapper.clearButton,"mousedown touchstart",this.resetInputHandler,this):t.EventHandler.remove(this.textboxWrapper.clearButton,"mousedown touchstart",this.resetInputHandler))},s.prototype.resetInputHandler=function(t){if(t.preventDefault(),!this.textboxWrapper.clearButton.classList.contains("e-clear-icon-hide")){e.Input.setValue("",this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value),this.setProperties({value:this.respectiveElement.value},!0);var i={event:t,value:this.respectiveElement.value,previousValue:this.inputPreviousValue,container:this.textboxWrapper.container};this.trigger("input",i),this.inputPreviousValue=this.respectiveElement.value,this.raiseChangeEvent(t,!0)}},s.prototype.unWireEvents=function(){t.EventHandler.remove(this.respectiveElement,"focus",this.focusHandler),t.EventHandler.remove(this.respectiveElement,"blur",this.focusOutHandler),t.EventHandler.remove(this.respectiveElement,"input",this.inputHandler),t.EventHandler.remove(this.respectiveElement,"change",this.changeHandler),this.isForm&&t.EventHandler.remove(this.formElement,"reset",this.resetForm),!t.isNullOrUndefined(this.textboxWrapper.container.querySelector(".e-float-text"))&&"Auto"===this.floatLabelType&&this.textboxWrapper.container.classList.contains("e-outline")&&this.textboxWrapper.container.classList.contains("e-autofill")&&t.EventHandler.remove(this.textboxWrapper.container.querySelector(".e-float-text"),"animationstart",this.animationHandler)},s.prototype.destroy=function(){this.unWireEvents(),"INPUT"===this.element.tagName&&this.multiline&&(t.detach(this.textboxWrapper.container.getElementsByTagName("textarea")[0]),this.respectiveElement=this.element,this.element.removeAttribute("type")),this.respectiveElement.value=this.respectiveElement.defaultValue,this.respectiveElement.classList.remove("e-input"),this.removeAttributes(["aria-placeholder","aria-disabled","aria-readonly","aria-labelledby"]),t.isNullOrUndefined(this.textboxWrapper)||(this.textboxWrapper.container.insertAdjacentElement("afterend",this.respectiveElement),t.detach(this.textboxWrapper.container)),this.textboxWrapper=null,i.prototype.destroy.call(this)},s.prototype.addIcon=function(t,i){e.Input.addIcon(t,i,this.textboxWrapper.container,this.respectiveElement,this.createElement)},s.prototype.getPersistData=function(){return this.addOnPersist(["value"])},s.prototype.addAttributes=function(t){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i];"disabled"===n?(this.setProperties({enabled:!1},!0),e.Input.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container)):"readonly"===n?(this.setProperties({readonly:!0},!0),e.Input.setReadonly(this.readonly,this.respectiveElement)):"class"===n?this.respectiveElement.classList.add(t[n]):"placeholder"===n?(this.setProperties({placeholder:t[n]},!0),e.Input.setPlaceholder(this.placeholder,this.respectiveElement)):("rows"===n&&this.respectiveElement.tagName,this.respectiveElement.setAttribute(n,t[n]))}},s.prototype.removeAttributes=function(t){for(var i=0,s=t;i<s.length;i++){var n=s[i];"disabled"===n?(this.setProperties({enabled:!0},!0),e.Input.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container)):"readonly"===n?(this.setProperties({readonly:!1},!0),e.Input.setReadonly(this.readonly,this.respectiveElement)):"placeholder"===n?(this.setProperties({placeholder:null},!0),e.Input.setPlaceholder(this.placeholder,this.respectiveElement)):this.respectiveElement.removeAttribute(n)}},s.prototype.focusIn=function(){document.activeElement!==this.respectiveElement&&this.enabled&&(this.respectiveElement.focus(),(this.textboxWrapper.container.classList.contains("e-input-group")||this.textboxWrapper.container.classList.contains("e-outline")||this.textboxWrapper.container.classList.contains("e-filled"))&&t.addClass([this.textboxWrapper.container],["e-input-focus"]))},s.prototype.focusOut=function(){document.activeElement===this.respectiveElement&&this.enabled&&(this.respectiveElement.blur(),(this.textboxWrapper.container.classList.contains("e-input-group")||this.textboxWrapper.container.classList.contains("e-outline")||this.textboxWrapper.container.classList.contains("e-filled"))&&t.removeClass([this.textboxWrapper.container],["e-input-focus"]))},xi([t.Property("text")],s.prototype,"type",void 0),xi([t.Property(!1)],s.prototype,"readonly",void 0),xi([t.Property(null)],s.prototype,"value",void 0),xi([t.Property("Never")],s.prototype,"floatLabelType",void 0),xi([t.Property("")],s.prototype,"cssClass",void 0),xi([t.Property(null)],s.prototype,"placeholder",void 0),xi([t.Property("on")],s.prototype,"autocomplete",void 0),xi([t.Property({})],s.prototype,"htmlAttributes",void 0),xi([t.Property(!1)],s.prototype,"multiline",void 0),xi([t.Property(!0)],s.prototype,"enabled",void 0),xi([t.Property(!1)],s.prototype,"showClearButton",void 0),xi([t.Property(!1)],s.prototype,"enablePersistence",void 0),xi([t.Property(null)],s.prototype,"width",void 0),xi([t.Event()],s.prototype,"created",void 0),xi([t.Event()],s.prototype,"destroyed",void 0),xi([t.Event()],s.prototype,"change",void 0),xi([t.Event()],s.prototype,"blur",void 0),xi([t.Event()],s.prototype,"focus",void 0),xi([t.Event()],s.prototype,"input",void 0),s=xi([t.NotifyPropertyChanges],s)}(t.Component);e.NumericTextBox=Y,e.regularExpressions=ie,e.createMask=n,e.applyMask=a,e.wireEvents=l,e.unwireEvents=r,e.bindClearEvent=o,e.unstrippedValue=u,e.strippedValue=c,e.maskInputMouseDownHandler=m,e.maskInputMouseUpHandler=f,e.maskInputFocusHandler=v,e.triggerFocus=g,e.maskInputBlurHandler=y,e.maskInputDropHandler=C,e.mobileRemoveFunction=k,e.setMaskValue=R,e.setElementValue=F,e.maskInput=function(e){var t=V(e);a.call(t);var i=c.call(this,this.element);this.prevValue=i,this.value=i,e.mask&&(r.call(t),l.call(t))},e.getVal=function(e){return c.call(M(e),e.element)},e.getMaskedVal=function(e){return u.call(M(e),e.element)},e.MaskUndo=se,e.MaskedTextBox=oe,e.TicksData=ue,e.ColorRangeData=ce,e.LimitData=pe,e.TooltipData=me,e.Slider=gt,e.regex=Et,e.FormValidator=Ct,e.FilesProp=Kt,e.ButtonsProps=Zt,e.AsyncSettings=Yt,e.Uploader=Gt,e.ColorPicker=Ci,e.TextBox=Ti,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
11
11
|
//# sourceMappingURL=ej2-inputs.umd.min.js.map
|