@syncfusion/ej2-inputs 30.1.37 → 30.1.38

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.
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * filename: ej2-inputs.min.js
3
- * version : 30.1.37
3
+ * version : 30.1.38
4
4
  * Copyright Syncfusion Inc. 2001 - 2024. 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
- this.ej=this.ej||{},this.ej.inputs=function(t,e,i,s,n){"use strict";function a(){if(e.attributes(this.element,{role:"textbox",autocomplete:"off",autocapitalize:"off",spellcheck:"false","aria-live":"assertive"}),this.mask){for(var t=this.mask.split("]"),i=0;i<t.length;i++)if("\\"===t[i][t[i].length-1]){t[i]=t[i]+"]";for(var s=t[i].split("["),n=0;n<s.length;n++)"\\"===s[n][s[n].length-1]&&(s[n]=s[n]+"["),v.call(this,s[n])}else if((s=t[i].split("[")).length>1)for(var a=!1,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):v.call(this,s[n]);else v.call(this,s[0]);if(this.escapeMaskValue=this.hiddenMask,this.promptMask=this.hiddenMask.replace(/[09?LCAa#&]/g,this.promptChar),!e.isNullOrUndefined(this.customCharacters))for(i=0;i<this.promptMask.length;i++)e.isNullOrUndefined(this.customCharacters[this.promptMask[i]])||(this.promptMask=this.promptMask.replace(new RegExp(this.promptMask[i],"g"),this.promptChar));var r=0;if(this.hiddenMask.match(new RegExp(/\\/)))for(i=0;i<this.hiddenMask.length;i++){n=0;i>=1&&(n=i),n-=r=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-r,this.promptMask.length),this.escapeMaskValue=this.escapeMaskValue.substring(0,n)+this.escapeMaskValue.substring(i+1-r,this.escapeMaskValue.length)),"\\"===this.hiddenMask[i]&&(this.promptMask=this.promptMask.substring(0,n)+this.hiddenMask[i+1]+this.promptMask.substring(i+2-r,this.promptMask.length),this.escapeMaskValue=this.escapeMaskValue.substring(0,n)+this.escapeMaskValue[i+1]+this.escapeMaskValue.substring(i+2-r,this.escapeMaskValue.length))}else this.promptMask=this.promptMask.replace(/[>|<]/g,""),this.escapeMaskValue=this.hiddenMask.replace(/[>|<]/g,"");e.attributes(this.element,{"aria-invalid":"false"})}}function r(){W.call(this,this.promptMask),z.call(this,this.value)}function l(){e.EventHandler.add(this.element,"keydown",k,this),e.EventHandler.add(this.element,"keypress",A,this),e.EventHandler.add(this.element,"keyup",N,this),e.EventHandler.add(this.element,"input",P,this),e.EventHandler.add(this.element,"focus",y,this),e.EventHandler.add(this.element,"blur",E,this),e.EventHandler.add(this.element,"paste",S,this),e.EventHandler.add(this.element,"cut",x,this),e.EventHandler.add(this.element,"drop",T,this),e.EventHandler.add(this.element,"mousedown",f,this),e.EventHandler.add(this.element,"mouseup",g,this),this.enabled&&(h.call(this),this.formElement&&e.EventHandler.add(this.formElement,"reset",d,this))}function o(){e.EventHandler.remove(this.element,"keydown",k),e.EventHandler.remove(this.element,"keypress",A),e.EventHandler.remove(this.element,"keyup",N),e.EventHandler.remove(this.element,"input",P),e.EventHandler.remove(this.element,"focus",y),e.EventHandler.remove(this.element,"blur",E),e.EventHandler.remove(this.element,"paste",S),e.EventHandler.remove(this.element,"cut",x),e.EventHandler.remove(this.element,"drop",T),e.EventHandler.remove(this.element,"mousedown",f),e.EventHandler.remove(this.element,"mouseup",g),this.formElement&&e.EventHandler.remove(this.formElement,"reset",d)}function h(){this.showClearButton&&e.EventHandler.add(this.inputObj.clearButton,"mousedown touchstart",u,this)}function u(t){t.preventDefault(),this.inputObj.clearButton.classList.contains("e-clear-icon-hide")&&!this.inputObj.container.classList.contains("e-static-clear")||(p.call(this,t),this.value="")}function p(t){var e=this.element.value;W.call(this,this.promptMask),this.redoCollec.unshift({value:this.promptMask,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),H.call(this,t,e),this.element.setSelectionRange(0,0)}function d(){"EJS-MASKEDTEXTBOX"===this.element.tagName?W.call(this,this.promptMask):this.value=this.initInputValue}function c(t){return t.value}function m(t,i){var s="",n=0,a=!1,r=e.isNullOrUndefined(i)?e.isNullOrUndefined(t)||e.isNullOrUndefined(this)?i:t.value:i;if(r!==this.promptMask)for(var l=0;l<this.customRegExpCollec.length;l++)a&&(a=!1),">"!==this.customRegExpCollec[n]&&"<"!==this.customRegExpCollec[n]&&"|"!==this.customRegExpCollec[n]&&"\\"!==this.customRegExpCollec[n]||(--l,a=!0),a||r[l]!==this.promptChar&&!e.isNullOrUndefined(this.customRegExpCollec[n])&&(this._callPasteHandler||!e.isNullOrUndefined(this.regExpCollec[this.customRegExpCollec[n]])&&!this.maskedRegExp.includes(this.customRegExpCollec[n])||this.customRegExpCollec[n].length>2&&"["===this.customRegExpCollec[n][0]&&"]"===this.customRegExpCollec[n][this.customRegExpCollec[n].length-1]||!e.isNullOrUndefined(this.customCharacters)&&!e.isNullOrUndefined(this.customCharacters[this.customRegExpCollec[n]]))&&""!==r&&(s+=r[l]),++n;return(null===this.mask||""===this.mask&&void 0!==this.value)&&(s=r),s}function v(t){for(var i=0;i<t.length;i++)this.hiddenMask+=t[i],"\\"!==t[i]?this.customRegExpCollec.push(t[i]):"\\"!==t[i]||e.isNullOrUndefined(this.regExpCollec[t[i+1]])||this.maskedRegExp.push(t[i+1])}function f(){this.isClicked=!0}function g(){this.isClicked=!1}function y(t){var i=this,s=this.element,n=0,a=m.call(this,s),r=!1,l=!1,o={selectionStart:s.selectionStart,event:t,value:this.value,maskedValue:s.value,container:e.isNullOrUndefined(this.inputObj)?this.inputObj:this.inputObj.container,selectionEnd:s.selectionEnd};if(this.isClicked||b.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)r=!0;else for(var t=s.selectionStart;t<i.promptMask.length;t++){if(s.value[t]===i.promptChar){r=!0;break}if(s.value[t]!==i.promptMask[t]){r=!1;break}}}),setTimeout(function(){var t=s.selectionStart-1;if(t===i.promptMask.length-1||s.value[t]===i.promptChar)l=!0;else for(var e=t;e>=0;e--){if(s.value[e]===i.promptChar){l=!0;break}if(s.value[e]!==i.promptMask[e]){l=!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(){(r||l)&&(s.selectionEnd=n,s.selectionStart=n),o={selectionStart:s.selectionStart,event:t,value:i.value,maskedValue:s.value,container:e.isNullOrUndefined(i.inputObj)?i.inputObj:i.inputObj.container,selectionEnd:s.selectionEnd},b.call(i,o,s)},110);break}e.isNullOrUndefined(s.value.match(C(this.promptChar)))&&(o={selectionStart:s.selectionStart,event:t,value:this.value,maskedValue:s.value,container:e.isNullOrUndefined(this.inputObj)?this.inputObj:this.inputObj.container,selectionEnd:s.selectionEnd},b.call(this,o,s)),this.isClicked=!1}}function b(t,e){this.trigger("focus",t,function(t){e.selectionStart=t.selectionStart,e.selectionEnd=t.selectionEnd})}function C(t){return e.isNullOrUndefined(t)?t:t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function E(t){if(this.blurEventArgs={event:t,value:this.value,maskedValue:this.element.value,container:e.isNullOrUndefined(this.inputObj)?this.inputObj:this.inputObj.container},this.trigger("blur",this.blurEventArgs),this.mask&&(this.isFocus=!1,this.placeholder&&this.element.value===this.promptMask&&"Always"!==this.floatLabelType)){W.call(this,"");var i=this.element.parentNode.querySelector(".e-float-text");"Auto"===this.floatLabelType&&!e.isNullOrUndefined(i)&&i.classList.contains(lt)&&e.removeClass([i],lt)}}function S(t){var e=this;if(this.mask&&!this.readonly){var i=this.element.selectionStart,s=this.element.selectionEnd,n=this.element.value;W.call(this,""),this._callPasteHandler=!0,setTimeout(function(){var a=e.element.value.replace(/ /g,"");e.redoCollec.length>0&&e.redoCollec[0].value===e.element.value&&(a=m.call(e,e.element)),W.call(e,n),e.element.selectionStart=i,e.element.selectionEnd=s;var r=0;e.maskKeyPress=!0;do{U.call(e,a[r],!1,null),++r}while(r<a.length);if(e.maskKeyPress=!1,e._callPasteHandler=!1,e.element.value===n){var l=0;e.maskKeyPress=!0;do{U.call(e,a[l],!1,null),++l}while(l<a.length);e.maskKeyPress=!1}else H.call(e,t,n)},1)}}function x(t){var e=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(){W.call(e,a),e.element.selectionStart=e.element.selectionEnd=s,e.element.value!==i&&H.call(e,t,null)},0)}}function T(t){t.preventDefault()}function P(t){if(!0!==e.Browser.isIE||""!==this.element.value||"Never"!==this.floatLabelType){var i={ctrlKey:!1,keyCode:229};if(e.extend(t,i),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||L.call(this,t),this.element.value.length>this.promptMask.length){var s=this.element.selectionStart,n=this.element.value.length-this.promptMask.length,a=this.element.value.substring(s-n,s);this.maskKeyPress=!1;var r=0;do{U.call(this,a[r],t.ctrlKey,t),++r}while(r<a.length);this.element.value!==this.preEleVal&&H.call(this,t,null)}var l=m.call(this,this.element);this.prevValue=l,this.value=l,""===l&&(W.call(this,this.promptMask),this.element.setSelectionRange(0,0))}}}function k(t){if(this.mask&&!this.readonly){229!==t.keyCode&&(!t.ctrlKey||89!==t.keyCode&&90!==t.keyCode||t.preventDefault(),L.call(this,t));var e=this.element.value;if(t.ctrlKey&&(89===t.keyCode||90===t.keyCode)){var i=void 0;90===t.keyCode&&this.undoCollec.length>0&&e!==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}),W.call(this,i.value),this.element.selectionStart=i.startIndex,this.element.selectionEnd=i.endIndex,this.undoCollec.splice(this.undoCollec.length-1,1)):89===t.keyCode&&this.redoCollec.length>0&&e!==this.redoCollec[0].value&&(i=this.redoCollec[0],this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),W.call(this,i.value),this.element.selectionStart=i.startIndex,this.element.selectionEnd=i.endIndex,this.redoCollec.splice(0,1))}}}function O(){var t,e=this.element.selectionStart,i=this.element.selectionEnd;this.redoCollec.length>0?(t=this.redoCollec[0],W.call(this,t.value),t.startIndex-e==1?(this.element.selectionStart=t.startIndex,this.element.selectionEnd=t.endIndex):(this.element.selectionStart=e+1,this.element.selectionEnd=i+1)):(W.call(this,this.promptMask),this.element.selectionStart=this.element.selectionEnd=e)}function w(t,e,i){return"input"===i.type&&(t=!1,e=this.element.value,W.call(this,this.promptMask),z.call(this,e)),t}function L(t){var i,s=!1,n=!1;this.element.value.length<this.promptMask.length&&(s=!0,i=this.element.value,s=w.call(this,s,i,t),O.call(this)),this.element.value.length>=this.promptMask.length&&"input"===t.type&&(s=w.call(this,s,i,t));var a=this.element.selectionStart,r=this.element.selectionEnd,l=this.element.selectionStart,o=this.element.selectionEnd,h=this.hiddenMask.replace(/[>|\\<]/g,""),u=h[l-1],p=this.element.selectionEnd;if(s||8===t.keyCode||46===t.keyCode){this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:o});var d=!1,c=this.element.value;if(l>0||(8===t.keyCode||46===t.keyCode)&&l<this.element.value.length&&this.element.selectionEnd-l!==this.element.value.length){var m=l;l!==o?(l=o,46===t.keyCode&&(d=!0)):46===t.keyCode?++m:--m;for(var v=l;8===t.keyCode||s||d?v>m:v<m;8===t.keyCode||s||d?v--:v++)for(var f=l;8===t.keyCode||s||d?f>0:f<this.element.value.length;8===t.keyCode||s||d?f--:f++){var g=void 0;(8===t.keyCode||d)&&(a!==r&&a!==l||a===r)||s?(u=h[f-1],g=l-1):(u=h[f],g=l,++l);var y=this.element.value[g];if(e.isNullOrUndefined(this.regExpCollec[""+u])&&!e.isNullOrUndefined(this.customCharacters)&&e.isNullOrUndefined(this.customCharacters[""+u])&&this.hiddenMask[g]!==this.promptChar&&"["!==this.customRegExpCollec[g][0]&&"]"!==this.customRegExpCollec[g][this.customRegExpCollec[g].length-1]||this.promptMask[g]!==this.promptChar&&e.isNullOrUndefined(this.customCharacters))this.element.selectionStart=this.element.selectionEnd=g,t.preventDefault(),46!==t.keyCode||d||++this.element.selectionStart;else{var b=this.element.value,C=this.promptChar,E=b.substring(0,g)+C+b.substring(l,b.length);W.call(this,E),t.preventDefault(),46!==t.keyCode||d||g++,this.element.selectionStart=this.element.selectionEnd=g,n=!0}if(l=this.element.selectionStart,!n&&8===t.keyCode||d||!n&&46!==t.keyCode?g=l-1:(g=l,n=!1),y=this.element.value[g],a!==r&&this.element.selectionStart===a||this.promptMask[g]===this.promptChar||y!==this.promptMask[g]&&this.promptMask[g]!==this.promptChar&&!e.isNullOrUndefined(this.customCharacters))break}}46===t.keyCode&&d&&n&&(this.element.selectionStart=this.element.selectionEnd=p),0===this.element.selectionStart&&this.element.selectionEnd===this.element.value.length&&(W.call(this,this.promptMask),t.preventDefault(),this.element.selectionStart=this.element.selectionEnd=l),this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),this.element.value!==c&&H.call(this,t,i)}}function A(t){if(this.mask&&!this.readonly){var e=this.element.value;if(!t.ctrlKey&&!t.metaKey||(t.ctrlKey||t.metaKey)&&"KeyA"!==t.code&&"KeyY"!==t.code&&"KeyZ"!==t.code&&"KeyX"!==t.code&&"KeyC"!==t.code&&"KeyV"!==t.code){this.maskKeyPress=!0;var i=t.key;"Spacebar"===i&&(i=String.fromCharCode(t.keyCode)),i?i&&1===i.length&&(U.call(this,i,t.ctrlKey,t),t.preventDefault()):(this.isIosInvalid=!0,U.call(this,String.fromCharCode(t.keyCode),t.ctrlKey,t),t.preventDefault(),this.isIosInvalid=!1),32===t.keyCode&&" "===i&&" "===this.promptChar&&(this.element.selectionStart=this.element.selectionEnd=this.element.selectionStart-i.length)}this.element.value!==e&&H.call(this,t,e)}}function H(t,i){var s=this.isProtectedOnChange;if(!e.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=m.call(this,this.element)),e.isNullOrUndefined(t)||(this.changeEventArgs.isInteracted=!0,this.changeEventArgs.isInteraction=!0,this.changeEventArgs.event=t),this.isProtectedOnChange=!0,this.value=this.changeEventArgs.value,this.isProtectedOnChange=s,e.merge(n,this.changeEventArgs),this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",n)}this.preEleVal=this.element.value,this.prevValue=m.call(this,this.element)}function N(t){if(this.mask&&!this.readonly){var i=void 0;if(this.maskKeyPress||229!==t.keyCode)M.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,r=this.element.value.substring(n-a,n);if(this.undoCollec.length>0){i=this.undoCollec[this.undoCollec.length-1];var l=this.element.selectionStart;s=i.value;var o=i.value.substring(l-a,l);i=this.redoCollec[0],r=r.trim();var h=e.Browser.isAndroid&&""===r;h||o===r||i.value.substring(l-a,l)===r?h&&V.call(this,t,l-1,this.element.selectionEnd-1,r,t.ctrlKey,!1):U.call(this,r,t.ctrlKey,t)}else s=this.promptMask,U.call(this,r,t.ctrlKey,t);this.maskKeyPress=!1,H.call(this,t,s)}}var u=m.call(this,this.element);(0!==this.element.selectionStart||this.promptMask!==this.element.value||""!==u||""===u&&this.value!==u)&&(this.prevValue=u,this.value=u)}else H.call(this,t);if(0===this.element.selectionStart&&0===this.element.selectionEnd){var p=this.element;setTimeout(function(){p.setSelectionRange(0,0)},0)}}function B(t){if(t.length>1&&this.promptMask.length+t.length<this.element.value.length){var e=this.redoCollec[0].value.substring(0,this.redoCollec[0].startIndex)+t+this.redoCollec[0].value.substring(this.redoCollec[0].startIndex,this.redoCollec[0].value.length);W.call(this,e),this.element.selectionStart=this.element.selectionEnd=this.redoCollec[0].startIndex+t.length}this.element.selectionStart=this.element.selectionStart-t.length,this.element.selectionEnd=this.element.selectionEnd-t.length}function I(t){this.maskKeyPress||B.call(this,t)}function U(t,i,s){if(I.call(this,t),!e.isNullOrUndefined(this)&&!e.isNullOrUndefined(t))for(var n,a,r=this.element.selectionStart,l=r,o=!1,h=this.element.value,u=!1,p=!1,d=0;d<t.length;d++){var c=t[d];if(r=this.element.selectionStart,this.maskKeyPress||l!==r||(r+=d),!this.maskKeyPress||r<this.promptMask.length){for(v=r;v<this.promptMask.length;v++)n=this.escapeMaskValue[r],"\\"===this.hiddenMask[r]&&this.hiddenMask[r+1]===t&&(p=!0),(e.isNullOrUndefined(this.regExpCollec[""+n])&&(e.isNullOrUndefined(this.customCharacters)||!e.isNullOrUndefined(this.customCharacters)&&e.isNullOrUndefined(this.customCharacters[""+n]))&&this.hiddenMask[r]!==this.promptChar&&"["!==this.customRegExpCollec[r][0]&&"]"!==this.customRegExpCollec[r][this.customRegExpCollec[r].length-1]||this.promptMask[r]!==this.promptChar&&e.isNullOrUndefined(this.customCharacters)||this.promptChar===n&&this.escapeMaskValue===this.mask)&&(this.element.selectionStart=this.element.selectionEnd=r+1,r=this.element.selectionStart,n=this.hiddenMask[r]);if(e.isNullOrUndefined(this.customCharacters)||e.isNullOrUndefined(this.customCharacters[""+n]))!e.isNullOrUndefined(this.regExpCollec[""+n])&&c.match(new RegExp(this.regExpCollec[""+n]))&&this.promptMask[r]===this.promptChar?o=!0:this.promptMask[r]===this.promptChar&&"["===this.customRegExpCollec[r][0]&&"]"===this.customRegExpCollec[r][this.customRegExpCollec[r].length-1]&&c.match(new RegExp(this.customRegExpCollec[r]))&&(o=!0);else for(var m=this.customCharacters[""+n].split(","),v=0;v<m.length;v++)if(c.match(new RegExp("["+m[v]+"]"))){o=!0;break}if((!this.maskKeyPress||r<this.hiddenMask.length)&&o){if(0===d)if(this.maskKeyPress)this.undoCollec.push({value:h,startIndex:r,endIndex:r});else{var f=this.element.selectionStart,g=this.element.selectionEnd;this.redoCollec.length>0?(a=this.redoCollec[0].value,W.call(this,a),this.undoCollec.push(this.redoCollec[0])):(this.undoCollec.push({value:this.promptMask,startIndex:r,endIndex:r}),a=this.promptMask,W.call(this,a)),this.element.selectionStart=f,this.element.selectionEnd=g}r=this.element.selectionStart,R.call(this,s,r,c,a,p),u=!0,d===t.length-1&&this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),o=!1}else r=this.element.selectionStart,V.call(this,s,r,l,t,i,u);d!==t.length-1||o||(!e.Browser.isAndroid||e.Browser.isAndroid&&r<this.promptMask.length)&&this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd})}else 1!==t.length||i||e.isNullOrUndefined(s)||F.call(this)}}function R(t,e,i,s,n){if(this.hiddenMask.length>this.promptMask.length&&(i=D.call(this,i,this.element.value)),!n){var a=this.element.value,r=a.substring(0,e)+i+a.substring(e+1,a.length);W.call(this,r),this.element.selectionStart=this.element.selectionEnd=e+1}}function V(t,i,s,n,a,r){if(!this.maskKeyPress){var l=this.element.value;i>=this.promptMask.length?W.call(this,l.substring(0,i)):(s===i?W.call(this,l.substring(0,i)+l.substring(i+1,l.length)):this.promptMask.length===this.element.value.length?W.call(this,l.substring(0,i)+l.substring(i,l.length)):W.call(this,l.substring(0,s)+l.substring(s+1,l.length)),this.element.selectionStart=this.element.selectionEnd=r||this.element.value[s]!==this.promptChar?i:s),F.call(this)}1!==n.length||a||e.isNullOrUndefined(t)||F.call(this)}function F(){var t=this,i=this.element.parentNode,s=200;i.classList.contains(nt)||i.classList.contains(at)?e.addClass([i],st):e.addClass([this.element],st),!0===this.isIosInvalid&&(s=400),e.attributes(this.element,{"aria-invalid":"true"}),setTimeout(function(){t.maskKeyPress||M.call(t)},s)}function M(){var t=this.element.parentNode;e.isNullOrUndefined(t)||e.removeClass([t],st),e.removeClass([this.element],st),e.attributes(this.element,{"aria-invalid":"false"})}function D(t,e){var i,s,n=e,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]){t=t.toUpperCase();break}if("<"===i[s]){t=t.toLowerCase();break}if("|"===i[s])break}--s}return t}function z(t){if(this.mask&&void 0!==t&&(void 0===this.prevValue||this.prevValue!==t)){if(this.maskKeyPress=!0,W.call(this,this.promptMask),""===t||null===t&&"Never"===this.floatLabelType&&this.placeholder||(this.element.selectionStart=0,this.element.selectionEnd=0),null!==t)for(var i=0;i<t.length;i++)U.call(this,t[i],!1,null);var s=m.call(this,this.element);this.prevValue=s,this.value=s,H.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&&!e.isNullOrUndefined(n)&&n.classList.contains(lt)&&!this.isFocus&&(e.removeClass([n],lt),e.addClass([n],ot),W.call(this,""))}(null===this.mask||""===this.mask&&void 0!==this.value)&&W.call(this,this.value)}function W(i,s){!this.isFocus&&"Auto"===this.floatLabelType&&this.placeholder&&e.isNullOrUndefined(this.value)&&(i="");var n=m.call(this,s||this.element,i);null===n||""===n?(t.Input.setValue(i,s||this.element,this.floatLabelType,!1),this.showClearButton&&this.inputObj.clearButton.classList.add("e-clear-icon-hide")):t.Input.setValue(i,s||this.element,this.floatLabelType,this.showClearButton)}function q(t){var e=j(t);r.call(e);var i=m.call(this,this.element);this.prevValue=i,this.value=i,t.mask&&(o.call(e),l.call(e))}function j(t){e.addClass([t.element],rt);var i={element:t.element,mask:t.mask,promptMask:"",hiddenMask:"",escapeMaskValue:"",promptChar:t.promptChar?t.promptChar.length>1?t.promptChar=t.promptChar[0]:t.promptChar:"_",value:t.value?t.value:null,regExpCollec:ht,customRegExpCollec:[],customCharacters:t.customCharacters,undoCollec:[],redoCollec:[],maskKeyPress:!1,prevValue:""};return a.call(i),i}function _(t){return m.call(K(t),t.element)}function X(t){return c.call(K(t),t.element)}function K(t){var i;return!e.isNullOrUndefined(t)&&t.element.classList.contains(rt)&&(i=j(t)),i}var Y={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",FLOATTEXTCONTENT:"e-float-text-content",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"},Z=["title","style","class"];!function(t){function i(t,i){t.element.__eventHandlers={};var s=e.isNullOrUndefined(i)?e.createElement:i,n={container:null,buttons:[],clearButton:null};if(pt=t.floatLabelType,dt=t.bindClearAction,e.isNullOrUndefined(t.floatLabelType)||"Never"===t.floatLabelType?(n.container=H(t,Y.INPUTGROUP,Y.INPUTCUSTOMTAG,"span",s),t.element.parentNode.insertBefore(n.container,t.element),e.addClass([t.element],Y.INPUT),n.container.appendChild(t.element)):v(t,n,s),r(t),e.isNullOrUndefined(t.properties)||e.isNullOrUndefined(t.properties.showClearButton)||!t.properties.showClearButton||(z(t.properties.showClearButton,t.element,n,!0,s),n.clearButton.setAttribute("role","button"),n.container.classList.contains(Y.FLOATINPUT)&&e.addClass([n.container],Y.INPUTGROUP)),!e.isNullOrUndefined(t.buttons))for(var a=0;a<t.buttons.length;a++)n.buttons.push(nt(t.buttons[a],n.container,s));return e.isNullOrUndefined(t.element)||"TEXTAREA"!==t.element.tagName||e.addClass([n.container],Y.TEXTAREA),at(n.container,t.element),n=y(t,n),X(n.container,s),n}function s(e){var i=E(e.element);(i.classList.contains("e-input-group")||i.classList.contains("e-outline")||i.classList.contains("e-filled"))&&i.classList.add("e-input-focus"),"Never"!==e.floatLabelType&&setTimeout(function(){t.calculateWidth(e.element,i)},80)}function n(e){var i=E(e.element);(i.classList.contains("e-input-group")||i.classList.contains("e-outline")||i.classList.contains("e-filled"))&&i.classList.remove("e-input-focus"),"Never"!==e.floatLabelType&&setTimeout(function(){t.calculateWidth(e.element,i)},80)}function a(t){o(t.floatLabelType,t.element)}function r(t){o(t.floatLabelType,t.element);var e=function(){return s(t)},i=function(){return n(t)},r=function(){return a(t)};t.element.addEventListener("focus",e),t.element.addEventListener("blur",i),t.element.addEventListener("input",r),t.element.__eventHandlers.inputFocusHandler={focusHandler:e},t.element.__eventHandlers.inputBlurHandler={blurHandler:i},t.element.__eventHandlers.inputHandler={inputHandler:r}}function l(t){if(!e.isNullOrUndefined(t.element)&&!(e.isNullOrUndefined(t.element.__eventHandlers)||e.isNullOrUndefined(t.element.__eventHandlers.inputFocusHandler)||e.isNullOrUndefined(t.element.__eventHandlers.inputBlurHandler)||e.isNullOrUndefined(t.element.__eventHandlers.inputHandler))){var i=t.element.__eventHandlers.inputFocusHandler.focusHandler,s=t.element.__eventHandlers.inputBlurHandler.blurHandler,n=t.element.__eventHandlers.inputHandler.inputHandler;t.element.removeEventListener("focus",i),t.element.removeEventListener("blur",s),t.element.removeEventListener("input",n),delete t.element.__eventHandlers.inputFocusHandler,delete t.element.__eventHandlers.inputBlurHandler,delete t.element.__eventHandlers.inputHandler}}function o(t,i){var s=i.value,n=i.parentElement,a=n&&n.parentElement;""===s||e.isNullOrUndefined(s)?"Always"!==t&&(n&&n.classList.contains("e-input-group")?n.classList.remove("e-valid-input"):a&&a.classList.contains("e-input-group")&&a.classList.remove("e-valid-input")):n&&n.classList.contains("e-input-group")?n.classList.add("e-valid-input"):a&&a.classList.contains("e-input-group")&&a.classList.add("e-valid-input")}function h(){var t=E(this).getElementsByClassName("e-float-text")[0];e.isNullOrUndefined(t)||(e.addClass([t],Y.LABELTOP),t.classList.contains(Y.LABELBOTTOM)&&e.removeClass([t],Y.LABELBOTTOM))}function u(){var t=E(this);if(t.getElementsByTagName("textarea")[0]?""===t.getElementsByTagName("textarea")[0].value:""===t.getElementsByTagName("input")[0].value){var i=t.getElementsByClassName("e-float-text")[0];e.isNullOrUndefined(i)||(i.classList.contains(Y.LABELTOP)&&e.removeClass([i],Y.LABELTOP),e.addClass([i],Y.LABELBOTTOM))}}function p(t){t.addEventListener("focus",h),t.addEventListener("blur",u)}function d(t){e.isNullOrUndefined(t)||(t.removeEventListener("focus",h),t.removeEventListener("blur",u))}function c(t){A(t.element,t.floatLabelType)}function m(t){A(t.element,t.floatLabelType)}function v(t,i,s){var n=e.isNullOrUndefined(s)?e.createElement:s;"Auto"===t.floatLabelType&&p(t.element),e.isNullOrUndefined(i.container)?(i.container=H(t,Y.FLOATINPUT,Y.FLOATCUSTOMTAG,"div",n),i.container.classList.add(Y.INPUTGROUP),t.element.parentNode&&t.element.parentNode.insertBefore(i.container,t.element)):(e.isNullOrUndefined(t.customTag)||i.container.classList.add(Y.FLOATCUSTOMTAG),i.container.classList.add(Y.FLOATINPUT));var a=n("span",{className:Y.FLOATLINE}),r=n("label",{className:Y.FLOATTEXT});if(e.isNullOrUndefined(t.element.id)||""===t.element.id||(r.id="label_"+t.element.id.replace(/ /g,"_"),e.attributes(t.element,{"aria-labelledby":r.id})),e.isNullOrUndefined(t.element.placeholder)||""===t.element.placeholder||(r.innerText=N(t.element.placeholder),t.element.removeAttribute("placeholder")),e.isNullOrUndefined(t.properties)||e.isNullOrUndefined(t.properties.placeholder)||""===t.properties.placeholder||(r.innerText=N(t.properties.placeholder)),r.innerText||i.container.classList.add(Y.NOFLOATLABEL),i.container.classList.contains("e-float-icon-left")){var l=i.container.querySelector(".e-input-in-wrap");l.appendChild(t.element),l.appendChild(a),l.appendChild(r)}else i.container.appendChild(t.element),i.container.appendChild(a),i.container.appendChild(r);if(C(t.element.value,r),"Always"===t.floatLabelType&&(r.classList.contains(Y.LABELBOTTOM)&&e.removeClass([r],Y.LABELBOTTOM),e.addClass([r],Y.LABELTOP)),"Auto"===t.floatLabelType){var o=function(){return c(t)},h=function(){return m(t)};t.element.addEventListener("input",o),t.element.addEventListener("blur",h),t.element.__eventHandlers.floatInputHandler={inputFloatHandler:o},t.element.__eventHandlers.floatBlurHandler={blurFloatHandler:h}}else f(t);e.isNullOrUndefined(t.element.getAttribute("id"))||r.setAttribute("for",t.element.getAttribute("id"))}function f(t){if(!(e.isNullOrUndefined(t.element)||e.isNullOrUndefined(t.element.__eventHandlers)||e.isNullOrUndefined(t.element.__eventHandlers.floatInputHandler)||e.isNullOrUndefined(t.element.__eventHandlers.floatBlurHandler))){var i=t.element.__eventHandlers.floatInputHandler.inputFloatHandler,s=t.element.__eventHandlers.floatBlurHandler.blurFloatHandler;t.element.removeEventListener("input",i),t.element.removeEventListener("blur",s),delete t.element.__eventHandlers.floatInputHandler,delete t.element.__eventHandlers.floatBlurHandler}}function g(t,e){"Always"===t&&e.classList.contains("e-outline")&&e.classList.add("e-valid-input")}function y(t,i){if(!e.isNullOrUndefined(t.properties))for(var s=0,n=Object.keys(t.properties);s<n.length;s++)switch(n[s]){case"cssClass":I(t.properties.cssClass,[i.container]),g(t.floatLabelType,i.container);break;case"enabled":D(t.properties.enabled,t.element,t.floatLabelType,i.container);break;case"enableRtl":M(t.properties.enableRtl,[i.container]);break;case"placeholder":V(t.properties.placeholder,t.element);break;case"readonly":F(t.properties.readonly,t.element)}return i}function b(t,i,s){e.isNullOrUndefined(i)||(t&&!s?e.removeClass([i],Y.CLEARICONHIDE):e.addClass([i],Y.CLEARICONHIDE))}function C(t,i,s){void 0===s&&(s=null),t?(e.addClass([i],Y.LABELTOP),i.classList.contains(Y.LABELBOTTOM)&&e.removeClass([i],Y.LABELBOTTOM)):(null==s||s!==document.activeElement)&&(i.classList.contains(Y.LABELTOP)&&e.removeClass([i],Y.LABELTOP),e.addClass([i],Y.LABELBOTTOM))}function E(t){var i=e.isNullOrUndefined(t.parentNode)?t:t.parentNode;return i&&i.classList.contains("e-input-in-wrap")&&(i=i.parentNode),i}function S(t,i,s,n){var a=(e.isNullOrUndefined(n)?e.createElement:n)("span",{className:Y.CLEARICON}),r=i.container;return e.isNullOrUndefined(s)?(i.container.classList.contains(Y.FLOATINPUT)?i.container.querySelector("."+Y.FLOATTEXT):t).insertAdjacentElement("afterend",a):r.appendChild(a),e.addClass([a],Y.CLEARICONHIDE),O(t,a),a.setAttribute("aria-label","close"),a}function x(t,i,s){i.classList.contains(Y.DISABLE)||i.readOnly||(t.preventDefault(),i!==document.activeElement&&i.focus(),i.value="",e.addClass([s],Y.CLEARICONHIDE))}function T(t,e){b(t.value,e)}function P(t,e){b(t.value,e,t.readOnly)}function k(t,i){setTimeout(function(){e.isNullOrUndefined(i)||(e.addClass([i],Y.CLEARICONHIDE),i=!e.isNullOrUndefined(t)&&t.classList.contains("e-combobox")?null:i)},200)}function O(t,e,i){if(void 0===dt||dt){var s=function(i){return x(i,t,e)};e.addEventListener("click",s),t.__eventHandlers.clearClickHandler={clickHandlerEvent:s}}var n=function(){return T(t,e)},a=function(){return P(t,e)},r=function(){return k(t,e)};t.addEventListener("input",n),t.addEventListener("focus",a),t.addEventListener("blur",r),t.__eventHandlers.clearInputHandler={inputHandlerEvent:n},t.__eventHandlers.clearFocusHandler={focusHandlerEvent:a},t.__eventHandlers.clearBlurHandler={blurHandlerEvent:r}}function w(t,i){if(!e.isNullOrUndefined(t)&&!e.isNullOrUndefined(t.__eventHandlers)){if(!e.isNullOrUndefined(t.__eventHandlers.clearClickHandler)){var s=t.__eventHandlers.clearClickHandler.clickHandlerEvent;(void 0===dt||dt)&&(e.isNullOrUndefined(i)||i.removeEventListener("click",s)),delete t.__eventHandlers.clearClickHandler}if(!e.isNullOrUndefined(t.__eventHandlers.clearInputHandler)&&!e.isNullOrUndefined(t.__eventHandlers.clearFocusHandler)&&!e.isNullOrUndefined(t.__eventHandlers.clearBlurHandler)){var n=t.__eventHandlers.clearInputHandler.inputHandlerEvent,a=t.__eventHandlers.clearFocusHandler.focusHandlerEvent,r=t.__eventHandlers.clearBlurHandler.blurHandlerEvent;t.removeEventListener("input",n),t.removeEventListener("focus",a),t.removeEventListener("blur",r),delete t.__eventHandlers.clearInputHandler,delete t.__eventHandlers.clearFocusHandler,delete t.__eventHandlers.clearBlurHandler}}}function L(t,i){void 0===i&&(i=null),l(t),"Auto"===t.floatLabelType&&f(t),t.properties.showClearButton&&w(t.element,i),e.isNullOrUndefined(t.buttons)||G(!1,null,t.buttons),d(t.element),e.isNullOrUndefined(t.element)||(delete t.element.__eventHandlers,t.element.classList.contains(Y.INPUT)&&t.element.classList.remove(Y.INPUT))}function A(t,e){if(E(t).classList.contains(Y.FLOATINPUT)&&"Auto"===e){var i=E(t).getElementsByClassName("e-float-text")[0];C(t.value,i,t)}}function H(t,i,s,n,a){var r,l=e.isNullOrUndefined(a)?e.createElement:a;return e.isNullOrUndefined(t.customTag)?r=l(n,{className:i}):(r=l(t.customTag,{className:i})).classList.add(s),r.classList.add("e-control-wrapper"),r}function N(t){var i="";if(!e.isNullOrUndefined(t)&&""!==t){var s=document.createElement("span");s.innerHTML='<input placeholder="'+t+'"/>',i=s.children[0].placeholder}return i}function B(t,i,s,n){if(i.value=t,"Never"!==s&&U(i,i.parentElement),e.isNullOrUndefined(s)||"Auto"!==s||A(i,s),!e.isNullOrUndefined(n)&&n){var a=E(i);if(!e.isNullOrUndefined(a)){var r=a.getElementsByClassName(Y.CLEARICON)[0];e.isNullOrUndefined(r)||(i.value&&!e.isNullOrUndefined(a)&&a.classList.contains("e-input-focus")?e.removeClass([r],Y.CLEARICONHIDE):e.addClass([r],Y.CLEARICONHIDE))}}o(s,i)}function I(t,i,s){e.isNullOrUndefined(s)||""===s||e.removeClass(i,s.split(" ")),e.isNullOrUndefined(t)||""===t||e.addClass(i,t.split(" "))}function U(t,i,s){if("multiselect"===s||$(t)){var n="multiselect"===s?t:t.clientWidth-parseInt(getComputedStyle(t,null).getPropertyValue("padding-left"),10);e.isNullOrUndefined(i)||e.isNullOrUndefined(i.getElementsByClassName("e-float-text-content")[0])||(i.getElementsByClassName("e-float-text-content")[0].classList.contains("e-float-text-overflow")&&i.getElementsByClassName("e-float-text-content")[0].classList.remove("e-float-text-overflow"),(n<i.getElementsByClassName("e-float-text-content")[0].clientWidth||n===i.getElementsByClassName("e-float-text-content")[0].clientWidth)&&i.getElementsByClassName("e-float-text-content")[0].classList.add("e-float-text-overflow"))}}function R(t,i){"number"==typeof t?i.style.width=e.formatUnit(t):"string"==typeof t&&(i.style.width=t.match(/px|%|em/)?t:e.formatUnit(t)),U(i.firstChild,i)}function V(t,i){t=N(t);var s=E(i);if(s.classList.contains(Y.FLOATINPUT))if(e.isNullOrUndefined(t)||""===t){s.classList.add(Y.NOFLOATLABEL);var n=s.getElementsByClassName("e-float-text-content")[0];if(n)n.children[0].textContent="";else{a=s.getElementsByClassName(Y.FLOATTEXT)[0];e.isNullOrUndefined(a)||(a.textContent="")}}else{if((n=s.getElementsByClassName("e-float-text-content")[0])&&n.children[0])n.children[0].textContent=t;else{var a=s.getElementsByClassName(Y.FLOATTEXT)[0];e.isNullOrUndefined(a)||(a.textContent=t)}s.classList.remove(Y.NOFLOATLABEL),i.removeAttribute("placeholder")}else e.isNullOrUndefined(t)||""===t?i.removeAttribute("placeholder"):e.attributes(i,{placeholder:t})}function F(t,i,s){t?e.attributes(i,{readonly:""}):i.removeAttribute("readonly"),e.isNullOrUndefined(s)||A(i,s)}function M(t,i){t?e.addClass(i,Y.RTL):e.removeClass(i,Y.RTL)}function D(t,i,s,n){var a={disabled:"","aria-disabled":"true"},r=!e.isNullOrUndefined(n);t?(i.classList.remove(Y.DISABLE),W(a,i),r&&e.removeClass([n],Y.DISABLE)):(i.classList.add(Y.DISABLE),q(a,i),r&&e.addClass([n],Y.DISABLE)),e.isNullOrUndefined(s)||A(i,s)}function z(t,i,s,n,a){var r=e.isNullOrUndefined(a)?e.createElement:a;t?s.clearButton=S(i,s,n,r):(e.remove(s.clearButton),s.clearButton=null)}function W(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i],a=E(e);"disabled"===n&&e.classList.remove(Y.DISABLE),"disabled"===n&&a.classList.contains(Y.INPUTGROUP)&&a.classList.remove(Y.DISABLE),"placeholder"===n&&a.classList.contains(Y.FLOATINPUT)?a.getElementsByClassName(Y.FLOATTEXT)[0].textContent="":e.removeAttribute(n)}}function q(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i],a=E(e);"disabled"===n&&e.classList.add(Y.DISABLE),"disabled"===n&&a.classList.contains(Y.INPUTGROUP)&&a.classList.add(Y.DISABLE),"placeholder"===n&&a.classList.contains(Y.FLOATINPUT)?a.getElementsByClassName(Y.FLOATTEXT)[0].textContent=t[""+n]:e.setAttribute(n,t[""+n])}}function j(t){var i=t.container;if(!e.isNullOrUndefined(i)&&i.classList.contains(Y.FLOATINPUT)){var s=i.querySelector("textarea")?i.querySelector("textarea"):i.querySelector("input"),n=i.querySelector("."+Y.FLOATTEXT).textContent,a=null!==i.querySelector(".e-clear-icon");e.detach(i.querySelector("."+Y.FLOATLINE)),e.detach(i.querySelector("."+Y.FLOATTEXT)),e.classList(i,[Y.INPUTGROUP],[Y.FLOATINPUT]),d(s),e.attributes(s,{placeholder:n}),s.classList.add(Y.INPUT),a||"INPUT"!==s.tagName||s.removeAttribute("required")}}function _(t,i,s,n){var a=e.isNullOrUndefined(n)?e.createElement:n,r=e.closest(t,"."+Y.INPUTGROUP);pt=i;var l=r.tagName,o={element:t,floatLabelType:i,customTag:l="DIV"!==l&&"SPAN"!==l?l:null,properties:{placeholder:s}};if("Never"!==i){var h=r.querySelector(".e-clear-icon"),u={container:r};t.classList.remove(Y.INPUT),v(o,u,a),X(u.container,a),U(o.element,u.container);var p=r.classList.contains("e-float-icon-left");if(e.isNullOrUndefined(h)&&(h=p?r.querySelector(".e-input-in-wrap").querySelector(".e-input-group-icon"):r.querySelector(".e-input-group-icon")),e.isNullOrUndefined(h))p&&(h=r.querySelector(".e-input-group-icon"));else{var d=r.querySelector("."+Y.FLOATLINE),c=r.querySelector("."+Y.FLOATTEXT),m=p?r.querySelector(".e-input-in-wrap"):r;m.insertBefore(t,h),m.insertBefore(d,h),m.insertBefore(c,h)}}else f(o);g(i,t.parentElement)}function X(t,e){if(t.classList.contains("e-outline")&&t.getElementsByClassName("e-float-text")[0]){var i=e("span",{className:Y.FLOATTEXTCONTENT});i.innerHTML=t.getElementsByClassName("e-float-text")[0].innerHTML,t.getElementsByClassName("e-float-text")[0].innerHTML="",t.getElementsByClassName("e-float-text")[0].appendChild(i)}}function K(t,e){for(var i=0;i<e.length;i++)G(t,e[parseInt(i.toString(),10)].container)}function G(t,i,s){var n=[];n.push(s);var a=e.isNullOrUndefined(s)?i.querySelectorAll(".e-input-group-icon"):n;if(t&&a.length>0)for(r=0;r<a.length;r++)a[parseInt(r.toString(),10)].addEventListener("mousedown",Q,!1),a[parseInt(r.toString(),10)].addEventListener("mouseup",tt,!1);else if(a.length>0)for(var r=0;r<a.length;r++)a[parseInt(r.toString(),10)].removeEventListener("mousedown",Q,this),a[parseInt(r.toString(),10)].removeEventListener("mouseup",tt,this)}function J(t,e){t.classList.contains("e-disabled")||t.querySelector("input").readOnly||e.classList.add("e-input-btn-ripple")}function $(t){if(!t)return!1;for(var e=t;e&&e!==document.body;){if("none"===window.getComputedStyle(e).display)return!1;e=e.parentElement}return!0}function Q(){for(var t=this,e=this.parentElement;!e.classList.contains("e-input-group");)e=e.parentElement;J(e,t)}function tt(){var t=this;setTimeout(function(){t.classList.remove("e-input-btn-ripple")},500)}function et(t,e){var i=e("span",{className:t});return i.classList.add("e-input-group-icon"),i}function it(t,e,i,s,n){var a="string"==typeof e?e.split(","):e;if("append"===t.toLowerCase())for(var r=0,l=a;r<l.length;r++)nt(u=l[r],i,n);else for(var o=0,h=a;o<h.length;o++){var u=h[o];st(u,i,s,n)}i.getElementsByClassName("e-input-group-icon")[0]&&i.getElementsByClassName("e-float-text-overflow")[0]&&i.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon")}function st(t,i,s,n){var a=e.isNullOrUndefined(n)?e.createElement:n,r=et(t,a);i.classList.add("e-float-icon-left");var l=i.querySelector(".e-input-in-wrap");if(e.isNullOrUndefined(l)){l=a("span",{className:"e-input-in-wrap"}),s.parentNode.insertBefore(l,s);var o=i.querySelectorAll(s.tagName+" ~ *");l.appendChild(s);for(var h=0;h<o.length;h++){var u=o[parseInt(h.toString(),10)],p=l.parentElement;u.classList.contains("e-float-line")&&(p&&p.classList.contains("e-filled")||!p)||l.appendChild(u)}}return l.parentNode.insertBefore(r,l),G(!0,i,r),r}function nt(t,i,s){var n=et(t,e.isNullOrUndefined(s)?e.createElement:s);return(i.classList.contains("e-float-icon-left")?i.querySelector(".e-input-in-wrap"):i).appendChild(n),G(!0,i,n),n}function at(t,e){"hidden"===e.type?t.classList.add("e-hidden"):t.classList.contains("e-hidden")&&t.classList.remove("e-hidden")}function rt(t,i){if(!e.isNullOrUndefined(t))for(var s=0,n=Object.keys(t);s<n.length;s++){var a=n[s];Z.indexOf(a)<0&&i.setAttribute(a,t[""+a])}}function lt(t,e,i){I(ot(t),[i],ot(e))}function ot(t){var i=t;return e.isNullOrUndefined(t)||""===t||(i=t.replace(/\s+/g," ").trim()),i}function ht(t,i){if(!e.isNullOrUndefined(t))for(var s=0,n=Object.keys(t);s<n.length;s++){var a=n[s];if(Z.indexOf(a)>-1)if("class"===a){var r=this.getInputValidClassList(t[""+a]);""!==r&&e.addClass([i],r.split(" "))}else if("style"===a){var l=i.getAttribute(a);l=e.isNullOrUndefined(l)?t[""+a]:l+t[""+a],i.setAttribute(a,l)}else i.setAttribute(a,t[""+a])}}function ut(t){return!t||/^\s*$/.test(t)}var pt,dt=!0;t.createInput=i,t.bindInitialEvent=r,t.wireFloatingEvents=p,t.wireClearBtnEvents=O,t.destroy=L,t.setValue=B,t.setCssClass=I,t.calculateWidth=U,t.setWidth=R,t.setPlaceholder=V,t.setReadonly=F,t.setEnableRtl=M,t.setEnabled=D,t.setClearButton=z,t.removeAttributes=W,t.addAttributes=q,t.removeFloating=j,t.addFloating=_,t.createSpanElement=X,t.setRipple=K,t.addIcon=it,t.prependSpan=st,t.appendSpan=nt,t.validateInputType=at,t.updateHTMLAttributesToElement=rt,t.updateCssClass=lt,t.getInputValidClassList=ot,t.updateHTMLAttributesToWrapper=ht,t.isBlank=ut}(t.Input||(t.Input={}));var G=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),J=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},$="e-input-group-icon",Q=new RegExp("^(-)?(\\d*)$"),tt=["title","style","class"],et=0,it=function(i){function s(t,e){var s=i.call(this,t,e)||this;return s.preventChange=!1,s.isDynamicChange=!1,s.numericOptions=t,s}return G(s,i),s.prototype.preRender=function(){this.isPrevFocused=!1,this.decimalSeparator=".",this.intRegExp=new RegExp("/^(-)?(d*)$/"),this.isCalled=!1;var t=e.getValue("ej2_instances",this.element);if(this.cloneElement=this.element.cloneNode(!0),e.removeClass([this.cloneElement],["e-control","e-numerictextbox","e-lib"]),this.angularTagName=null,this.formEle=e.closest(this.element,"form"),"EJS-NUMERICTEXTBOX"===this.element.tagName){this.angularTagName=this.element.tagName;var i=this.createElement("input"),s=0;for(s;s<this.element.attributes.length;s++){var n=this.element.attributes[s].nodeName;"id"!==n&&"class"!==n?(i.setAttribute(this.element.attributes[s].nodeName,this.element.attributes[s].nodeValue),i.innerHTML=this.element.innerHTML):"class"===n&&i.setAttribute(n,this.element.className.split(" ").filter(function(t){return 0!==t.indexOf("ng-")}).join(" "))}this.element.hasAttribute("name")&&this.element.removeAttribute("name"),this.element.classList.remove("e-control","e-numerictextbox"),this.element.appendChild(i),this.element=i,e.setValue("ej2_instances",t,this.element)}e.attributes(this.element,{role:"spinbutton",tabindex:"0",autocomplete:"off"});var a={incrementTitle:"Increment value",decrementTitle:"Decrement value",placeholder:this.placeholder};this.l10n=new e.L10n("numerictextbox",a,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.element.hasAttribute("id")||this.element.setAttribute("id",e.getUniqueID("numerictextbox")),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.element.hasAttribute("aria-labelledby")||this.element.hasAttribute("placeholder")||this.element.hasAttribute("aria-label")||this.element.setAttribute("aria-label","numerictextbox"),!e.isNullOrUndefined(e.closest(this.element,"fieldset"))&&e.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete())},s.prototype.checkAttributes=function(t){for(var i=0,s=t?e.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(!e.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"disabled":if(e.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.enabled||t){var a="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n);this.setProperties({enabled:a},!t)}break;case"readonly":if(e.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.readonly||t){var r="readonly"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n);this.setProperties({readonly:r},!t)}break;case"placeholder":(e.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"value":if(e.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.value||t){var l=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));this.setProperties(e.setValue(n,l,{}),!t)}break;case"min":if(e.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.min||t){var o=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));null===o||isNaN(o)||this.setProperties(e.setValue(n,o,{}),!t)}break;case"max":if(e.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.max||t){var h=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));null===h||isNaN(h)||this.setProperties(e.setValue(n,h,{}),!t)}break;case"step":if(e.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.step||t){var u=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));null===u||isNaN(u)||this.setProperties(e.setValue(n,u,{}),!t)}break;case"style":this.inputStyle=this.element.getAttribute(n);break;case"name":this.inputName=this.element.getAttribute(n);break;default:var p=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));(null!==p&&!isNaN(p)||"value"===n)&&this.setProperties(e.setValue(n,p,{}),!0)}}},s.prototype.updatePlaceholder=function(){this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0)},s.prototype.initCultureFunc=function(){this.instance=new e.Internationalization(this.locale)},s.prototype.initCultureInfo=function(){this.cultureInfo.format=this.format,null!==e.getValue("currency",this)&&(e.setValue("currency",this.currency,this.cultureInfo),this.setProperties({currencyCode:this.currency},!0))},s.prototype.createWrapper=function(){var i=this.cssClass;e.isNullOrUndefined(this.cssClass)||""===this.cssClass||(i=this.getNumericValidClassList(this.cssClass));var s=t.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&&e.attributes(this.element,{"aria-readonly":"true"}),this.hiddenInput=this.createElement("input",{attrs:{type:"text","data-validateHidden":"true","aria-label":"hidden",class:"e-numeric-hidden"}}),this.inputName=null!==this.inputName?this.inputName:this.element.id,this.element.removeAttribute("name"),this.isAngular&&"EJS-NUMERICTEXTBOX"===this.angularTagName&&this.cloneElement.id.length>0?e.attributes(this.hiddenInput,{name:this.cloneElement.id}):e.attributes(this.hiddenInput,{name:this.inputName}),this.container.insertBefore(this.hiddenInput,this.container.childNodes[1]),this.updateDataAttribute(!1),null!==this.inputStyle&&e.attributes(this.container,{style:this.inputStyle})},s.prototype.updateDataAttribute=function(t){var e={};if(t)e=this.htmlAttributes;else for(var i=0;i<this.element.attributes.length;i++)e[this.element.attributes[i].name]=this.element.getAttribute(this.element.attributes[i].name);for(var s=0,n=Object.keys(e);s<n.length;s++){var a=n[s];0===a.indexOf("data")&&this.hiddenInput.setAttribute(a,e[""+a])}},s.prototype.updateHTMLAttrToElement=function(){if(!e.isNullOrUndefined(this.htmlAttributes))for(var t=0,i=Object.keys(this.htmlAttributes);t<i.length;t++){var s=i[t];tt.indexOf(s)<0&&this.element.setAttribute(s,this.htmlAttributes[""+s])}},s.prototype.updateCssClass=function(e,i){t.Input.setCssClass(this.getNumericValidClassList(e),[this.container],this.getNumericValidClassList(i))},s.prototype.getNumericValidClassList=function(t){var i=t;return e.isNullOrUndefined(t)||""===t||(i=t.replace(/\s+/g," ").trim()),i},s.prototype.updateHTMLAttrToWrapper=function(){if(!e.isNullOrUndefined(this.htmlAttributes))for(var t=0,i=Object.keys(this.htmlAttributes);t<i.length;t++){var s=i[t];if(tt.indexOf(s)>-1)if("class"===s){var n=this.getNumericValidClassList(this.htmlAttributes[""+s]);""!==n&&e.addClass([this.container],n.split(" "))}else if("style"===s){var a=this.container.getAttribute(s);a=e.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(t){e.isNullOrUndefined(t)||("number"==typeof t?this.container.style.width=e.formatUnit(t):"string"==typeof t&&(this.container.style.width=t.match(/px|%|em/)?t:e.formatUnit(t)))},s.prototype.spinBtnCreation=function(){this.spinDown=t.Input.appendSpan($+" e-spin-down",this.container,this.createElement),e.attributes(this.spinDown,{title:this.l10n.getConstant("decrementTitle")}),this.spinUp=t.Input.appendSpan($+" e-spin-up",this.container,this.createElement),e.attributes(this.spinUp,{title: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),this.min!==-Number.MAX_VALUE&&e.attributes(this.element,{"aria-valuemin":this.min.toString()}),this.max!==Number.MAX_VALUE&&e.attributes(this.element,{"aria-valuemax":this.max.toString()})},s.prototype.formattedValue=function(t,e){return this.instance.getNumberFormat({maximumFractionDigits:t,minimumFractionDigits:t,useGrouping:!1})(e)},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(t,e){this.isInteract=!0;var i=this.isFocused?this.instance.getNumberParser({format:"n"})(this.element.value):this.value;this.changeValue(this.performAction(i,this.step,t)),this.raiseChangeEvent(e)},s.prototype.checkErrorClass=function(){this.isValidState?e.removeClass([this.container],"e-error"):e.addClass([this.container],"e-error"),e.attributes(this.element,{"aria-invalid":this.isValidState?"false":"true"})},s.prototype.bindClearEvent=function(){this.showClearButton&&e.EventHandler.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this)},s.prototype.resetHandler=function(t){t.preventDefault(),this.inputWrapper.clearButton.classList.contains("e-clear-icon-hide")&&!this.inputWrapper.container.classList.contains("e-static-clear")||this.clear(t),this.isInteract=!0,this.raiseChangeEvent(t)},s.prototype.clear=function(t){if(this.setProperties({value:null},!0),this.setElementValue(""),this.hiddenInput.value="",e.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(){e.isNullOrUndefined(this.spinDown)||e.attributes(this.spinDown,{title:this.l10n.getConstant("decrementTitle"),"aria-label":this.l10n.getConstant("decrementTitle")}),e.isNullOrUndefined(this.spinUp)||e.attributes(this.spinUp,{title:this.l10n.getConstant("incrementTitle"),"aria-label":this.l10n.getConstant("incrementTitle")})},s.prototype.wireEvents=function(){e.EventHandler.add(this.element,"focus",this.focusHandler,this),e.EventHandler.add(this.element,"blur",this.focusOutHandler,this),e.EventHandler.add(this.element,"keydown",this.keyDownHandler,this),e.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),e.EventHandler.add(this.element,"input",this.inputHandler,this),e.EventHandler.add(this.element,"keypress",this.keyPressHandler,this),e.EventHandler.add(this.element,"change",this.changeHandler,this),e.EventHandler.add(this.element,"paste",this.pasteHandler,this),this.enabled&&(this.bindClearEvent(),this.formEle&&e.EventHandler.add(this.formEle,"reset",this.resetFormHandler,this))},s.prototype.wireSpinBtnEvents=function(){e.EventHandler.add(this.spinUp,e.Browser.touchStartEvent,this.mouseDownOnSpinner,this),e.EventHandler.add(this.spinDown,e.Browser.touchStartEvent,this.mouseDownOnSpinner,this),e.EventHandler.add(this.spinUp,e.Browser.touchEndEvent,this.mouseUpOnSpinner,this),e.EventHandler.add(this.spinDown,e.Browser.touchEndEvent,this.mouseUpOnSpinner,this),e.EventHandler.add(this.spinUp,e.Browser.touchMoveEvent,this.touchMoveOnSpinner,this),e.EventHandler.add(this.spinDown,e.Browser.touchMoveEvent,this.touchMoveOnSpinner,this)},s.prototype.unwireEvents=function(){e.EventHandler.remove(this.element,"focus",this.focusHandler),e.EventHandler.remove(this.element,"blur",this.focusOutHandler),e.EventHandler.remove(this.element,"keyup",this.keyUpHandler),e.EventHandler.remove(this.element,"input",this.inputHandler),e.EventHandler.remove(this.element,"keydown",this.keyDownHandler),e.EventHandler.remove(this.element,"keypress",this.keyPressHandler),e.EventHandler.remove(this.element,"change",this.changeHandler),e.EventHandler.remove(this.element,"paste",this.pasteHandler),this.formEle&&e.EventHandler.remove(this.formEle,"reset",this.resetFormHandler)},s.prototype.unwireSpinBtnEvents=function(){e.EventHandler.remove(this.spinUp,e.Browser.touchStartEvent,this.mouseDownOnSpinner),e.EventHandler.remove(this.spinDown,e.Browser.touchStartEvent,this.mouseDownOnSpinner),e.EventHandler.remove(this.spinUp,e.Browser.touchEndEvent,this.mouseUpOnSpinner),e.EventHandler.remove(this.spinDown,e.Browser.touchEndEvent,this.mouseUpOnSpinner),e.EventHandler.remove(this.spinUp,e.Browser.touchMoveEvent,this.touchMoveOnSpinner),e.EventHandler.remove(this.spinDown,e.Browser.touchMoveEvent,this.touchMoveOnSpinner)},s.prototype.changeHandler=function(t){t.stopPropagation(),this.element.value.length||this.setProperties({value:null},!0);var e=this.instance.getNumberParser({format:"n"})(this.element.value);this.updateValue(e,t)},s.prototype.raiseChangeEvent=function(t){if(this.inputValue=e.isNullOrUndefined(this.inputValue)||isNaN(this.inputValue)?null:this.inputValue,this.prevValue!==this.value||this.prevValue!==this.inputValue){var i={};this.changeEventArgs={value:this.value,previousValue:this.prevValue,isInteracted:this.isInteract,isInteraction:this.isInteract,event:t},t&&(this.changeEventArgs.event=t),void 0===this.changeEventArgs.event&&(this.changeEventArgs.isInteracted=!1,this.changeEventArgs.isInteraction=!1),e.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 t=this;if(this.enabled&&!this.readonly){var e=this.element.value;setTimeout(function(){t.numericRegex().test(t.element.value)||t.setElementValue(e)})}},s.prototype.preventHandler=function(){var t=this,i=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform);setTimeout(function(){if(t.element.selectionStart>0){var s=t.element.selectionStart,n=t.element.selectionStart-1,a=t.element.value.split(""),r=e.getNumericObject(t.locale),l=e.getValue("decimal",r),o=l.charCodeAt(0);" "===t.element.value[n]&&t.element.selectionStart>0&&!i?(e.isNullOrUndefined(t.prevVal)?t.element.value=t.element.value.trim():0!==n?t.element.value=t.prevVal:0===n&&(t.element.value=t.element.value.trim()),t.element.setSelectionRange(n,n)):isNaN(parseFloat(t.element.value[t.element.selectionStart-1]))&&45!==t.element.value[t.element.selectionStart-1].charCodeAt(0)?(a.indexOf(t.element.value[t.element.selectionStart-1])!==a.lastIndexOf(t.element.value[t.element.selectionStart-1])&&t.element.value[t.element.selectionStart-1].charCodeAt(0)===o||t.element.value[t.element.selectionStart-1].charCodeAt(0)!==o)&&(t.element.value=t.element.value.substring(0,n)+t.element.value.substring(s,t.element.value.length),t.element.setSelectionRange(n,n),isNaN(parseFloat(t.element.value[t.element.selectionStart-1]))&&t.element.selectionStart>0&&t.element.value.length&&t.preventHandler()):isNaN(parseFloat(t.element.value[t.element.selectionStart-2]))&&t.element.selectionStart>1&&45!==t.element.value[t.element.selectionStart-2].charCodeAt(0)&&(a.indexOf(t.element.value[t.element.selectionStart-2])!==a.lastIndexOf(t.element.value[t.element.selectionStart-2])&&t.element.value[t.element.selectionStart-2].charCodeAt(0)===o||t.element.value[t.element.selectionStart-2].charCodeAt(0)!==o)&&(t.element.setSelectionRange(n,n),t.nextEle=t.element.value[t.element.selectionStart],t.cursorPosChanged=!0,t.preventHandler()),!0===t.cursorPosChanged&&t.element.value[t.element.selectionStart]===t.nextEle&&isNaN(parseFloat(t.element.value[t.element.selectionStart-1]))&&(t.element.setSelectionRange(t.element.selectionStart+1,t.element.selectionStart+1),t.cursorPosChanged=!1,t.nextEle=null),""===t.element.value.trim()&&t.element.setSelectionRange(0,0),t.element.selectionStart>0&&(45===t.element.value[t.element.selectionStart-1].charCodeAt(0)&&t.element.selectionStart>1&&(e.isNullOrUndefined(t.prevVal)||(t.element.value=t.prevVal),t.element.setSelectionRange(t.element.selectionStart,t.element.selectionStart)),t.element.value[t.element.selectionStart-1]===l&&0===t.decimals&&t.validateDecimalOnType&&(t.element.value=t.element.value.substring(0,n)+t.element.value.substring(s,t.element.value.length))),t.prevVal=t.element.value}})},s.prototype.keyUpHandler=function(){if(this.enabled&&!this.readonly){!(!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform))&&e.Browser.isDevice&&this.preventHandler();var t=this.instance.getNumberParser({format:"n"})(this.element.value);if(t=null===t||isNaN(t)?null:t,this.hiddenInput.value=t||0===t?t.toString():null,e.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(t){var i=this;if(this.enabled&&!this.readonly){var s=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform);if((navigator.userAgent.toLowerCase().indexOf("firefox")>-1||s)&&e.Browser.isDevice&&this.preventHandler(),this.isAngular&&this.element.value!==e.getValue("decimal",e.getNumericObject(this.locale))&&this.element.value!==e.getValue("minusSign",e.getNumericObject(this.locale))){var n=this.instance.getNumberParser({format:"n"})(this.element.value);n=isNaN(n)?null:n,i.localChange({value:n}),this.preventChange=!0}if(this.isVue){var a=this.instance.getNumberParser({format:"n"})(this.element.value),r=this.instance.getNumberParser({format:"n"})(this.elementPrevValue);(new RegExp("[^0-9]+$").test(this.element.value)||(-1!==this.elementPrevValue.indexOf(".")||-1!==this.elementPrevValue.indexOf("-"))&&"0"===this.element.value[this.element.value.length-1])&&(a=this.value);var l={event:t,value:null===a||isNaN(a)?null:a,previousValue:null===r||isNaN(r)?null:r};this.preventChange=!0,this.elementPrevValue=this.element.value,this.trigger("input",l)}}},s.prototype.keyDownHandler=function(t){if(!this.readonly)switch(t.keyCode){case 38:t.preventDefault(),this.action("increment",t);break;case 40:t.preventDefault(),this.action("decrement",t)}},s.prototype.performAction=function(t,e,i){(null===t||isNaN(t))&&(t=0);var s="increment"===i?t+e:t-e;return s=this.correctRounding(t,e,s),this.strictMode?this.trimValue(s):s},s.prototype.correctRounding=function(t,e,i){var s=new RegExp("[,.](.*)"),n=s.test(t.toString()),a=s.test(e.toString());if(n||a){var r=n?s.exec(t.toString())[0].length:0,l=a?s.exec(e.toString())[0].length:0,o=Math.max(r,l);return t=this.roundValue(i,o)}return i},s.prototype.roundValue=function(t,e){e=e||0;var i=Math.pow(10,e);return t*=i,t=Math.round(t)/i},s.prototype.updateValue=function(t,e){e&&(this.isInteract=!0),null===t||isNaN(t)||this.decimals&&(t=this.roundNumber(t,this.decimals)),this.inputValue=t,this.isVue&&this.element&&this.element.hasAttribute("modelvalue")&&this.isDynamicChange||this.changeValue(null===t||isNaN(t)?null:this.strictMode?this.trimValue(t):t),this.isDynamicChange||this.raiseChangeEvent(e)},s.prototype.updateCurrency=function(t,i){e.setValue(t,i,this.cultureInfo),this.updateValue(this.value)},s.prototype.changeValue=function(t){if(t||0===t){var e=this.getNumberOfDecimals(t);this.setProperties({value:this.roundNumber(t,e)},!0)}else t=null,this.setProperties({value:t},!0);this.modifyText(),this.strictMode||this.validateState()},s.prototype.modifyText=function(){if(this.value||0===this.value){var t=this.formatNumber(),i=this.isFocused?t:this.instance.getNumberFormat(this.cultureInfo)(this.value);this.setElementValue(i),e.attributes(this.element,{"aria-valuenow":t}),e.isNullOrUndefined(this.hiddenInput)||(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(e,i){t.Input.setValue(e,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(t){var i,s=new RegExp("[eE][-+]?([0-9]+)"),n=t.toString();if(s.test(n)){var a=s.exec(n);e.isNullOrUndefined(a)||(n=t.toFixed(Math.min(parseInt(a[1],10),20)))}var r=n.split(".")[1];return i=r&&r.length?r.length:0,null!==this.decimals&&(i=i<this.decimals?i:this.decimals),i},s.prototype.formatNumber=function(){var t=this.getNumberOfDecimals(this.value);return this.instance.getNumberFormat({maximumFractionDigits:t,minimumFractionDigits:t,useGrouping:!1})(this.value)},s.prototype.trimValue=function(t){return t>this.max?this.max:t<this.min?this.min:t},s.prototype.roundNumber=function(t,e){var i=t,s=e||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(t){return t.preventDefault(),!1},s.prototype.keyPressHandler=function(t){if(!this.enabled||this.readonly)return!0;if(!e.Browser.isDevice&&"11.0"===e.Browser.info.version&&13===t.keyCode){var i=this.instance.getNumberParser({format:"n"})(this.element.value);return this.updateValue(i,t),!0}if(0===t.which||t.metaKey||t.ctrlKey||8===t.keyCode||13===t.keyCode)return!0;var s=String.fromCharCode(t.which),n=e.getValue("decimal",e.getNumericObject(this.locale)),a="NumpadDecimal"===t.code&&s!==n;a&&(s=n);var r=this.element.value;if(r=r.substring(0,this.element.selectionStart)+s+r.substring(this.element.selectionEnd),this.numericRegex().test(r)){if(a){var l=this.element.selectionStart+1;this.element.value=r,this.element.setSelectionRange(l,l),t.preventDefault(),t.stopPropagation()}return!0}return t.preventDefault(),t.stopPropagation(),!1},s.prototype.numericRegex=function(){var t=e.getNumericObject(this.locale),i=e.getValue("decimal",t),s="*";return"."===i&&(i="\\"+i),0===this.decimals&&this.validateDecimalOnType?Q:(this.decimals&&this.validateDecimalOnType&&(s="{0,"+this.decimals+"}"),new RegExp("^\\s*(-)?(((\\d+("+i+"\\d"+s+")?)|("+i+"\\d"+s+")))?$"))},s.prototype.mouseWheel=function(t){t.preventDefault();var e,i=t;i.wheelDelta?e=i.wheelDelta/120:i.detail&&(e=-i.detail/3),e>0?this.action("increment",t):e<0&&this.action("decrement",t),this.cancelEvent(t)},s.prototype.focusHandler=function(t){var i=this;if(clearTimeout(et),this.focusEventArgs={event:t,value:this.value,container:this.container},this.trigger("focus",this.focusEventArgs),this.enabled&&!this.readonly){if(this.isFocused=!0,this.prevValue=this.value,this.value||0===this.value){var s=this.formatNumber();if(this.setElementValue(s),!this.isPrevFocused)if(e.Browser.isDevice||"11.0"!==e.Browser.info.version){var n=e.Browser.isDevice&&e.Browser.isIos?600:0;et=setTimeout(function(){i.element.setSelectionRange(0,s.length)},n)}else this.element.setSelectionRange(0,s.length)}e.Browser.isDevice||e.EventHandler.add(this.element,"mousewheel DOMMouseScroll",this.mouseWheel,this)}},s.prototype.focusOutHandler=function(t){var i=this;if(this.blurEventArgs={event:t,value:this.value,container:this.container},this.trigger("blur",this.blurEventArgs),this.enabled&&!this.readonly){if(this.isPrevFocused){if(t.preventDefault(),e.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),e.Browser.isDevice||e.EventHandler.remove(this.element,"mousewheel DOMMouseScroll",this.mouseWheel)}if(e.closest(this.element,"form")){var r=this.element.nextElementSibling,l=document.createEvent("FocusEvent");l.initEvent("focusout",!1,!0),r.dispatchEvent(l)}}},s.prototype.mouseDownOnSpinner=function(t){var i=this;if(this.isFocused&&(this.isPrevFocused=!0,t.preventDefault()),this.getElementData(t)){this.getElementData(t);var s=t.currentTarget,n=s.classList.contains("e-spin-up")?"increment":"decrement";e.EventHandler.add(s,"mouseleave",this.mouseUpClick,this),this.timeOut=setInterval(function(){i.isCalled=!0,i.action(n,t)},150),e.EventHandler.add(document,"mouseup",this.mouseUpClick,this)}},s.prototype.touchMoveOnSpinner=function(t){var e;if("touchmove"===t.type){var i=t.touches;e=i.length&&document.elementFromPoint(i[0].pageX,i[0].pageY)}else e=document.elementFromPoint(t.clientX,t.clientY);e.classList.contains($)||clearInterval(this.timeOut)},s.prototype.mouseUpOnSpinner=function(t){if(this.prevValue=this.value,this.isPrevFocused&&(this.element.focus(),e.Browser.isDevice||(this.isPrevFocused=!1)),e.Browser.isDevice||t.preventDefault(),this.getElementData(t)){var i=t.currentTarget,s=i.classList.contains("e-spin-up")?"increment":"decrement";if(e.EventHandler.remove(i,"mouseleave",this.mouseUpClick),this.isCalled||this.action(s,t),this.isCalled=!1,e.EventHandler.remove(document,"mouseup",this.mouseUpClick),e.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(t){return!(t.which&&3===t.which||t.button&&2===t.button||!this.enabled||this.readonly)&&(clearInterval(this.timeOut),!0)},s.prototype.floatLabelTypeUpdate=function(){t.Input.removeFloating(this.inputWrapper);var e=this.hiddenInput;this.hiddenInput.remove(),t.Input.addFloating(this.element,this.floatLabelType,this.placeholder,this.createElement),this.container.insertBefore(e,this.container.childNodes[1])},s.prototype.mouseUpClick=function(t){t.stopPropagation(),clearInterval(this.timeOut),this.isCalled=!1,this.spinUp&&e.EventHandler.remove(this.spinUp,"mouseleave",this.mouseUpClick),this.spinDown&&e.EventHandler.remove(this.spinDown,"mouseleave",this.mouseUpClick)},s.prototype.increment=function(t){void 0===t&&(t=this.step),this.isInteract=!1,this.changeValue(this.performAction(this.value,t,"increment")),this.raiseChangeEvent()},s.prototype.decrement=function(t){void 0===t&&(t=this.step),this.isInteract=!1,this.changeValue(this.performAction(this.value,t,"decrement")),this.raiseChangeEvent()},s.prototype.destroy=function(){this.unwireEvents(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),e.detach(this.hiddenInput),this.showSpinButton&&(this.unwireSpinBtnEvents(),e.detach(this.spinUp),e.detach(this.spinDown));for(var s=["aria-labelledby","role","autocomplete","aria-readonly","aria-disabled","autocapitalize","spellcheck","aria-autocomplete","tabindex","aria-valuemin","aria-valuemax","aria-valuenow","aria-invalid"],n=0;n<s.length;n++)this.element.removeAttribute(s[n]);this.element.classList.remove("e-input"),this.container.insertAdjacentElement("afterend",this.element),e.detach(this.container),this.spinUp=null,this.spinDown=null,this.container=null,this.hiddenInput=null,this.changeEventArgs=null,this.blurEventArgs=null,this.focusEventArgs=null,this.inputWrapper=null,t.Input.destroy({element:this.element,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),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(),e.addClass([this.container],["e-input-focus"]))},s.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.element.blur(),e.removeClass([this.container],["e-input-focus"]))},s.prototype.getPersistData=function(){var t=["value"];return this.addOnPersist(t)},s.prototype.onPropertyChanged=function(i,s){for(var n=0,a=Object.keys(i);n<a.length;n++){var r=a[n];switch(r){case"width":this.setElementWidth(i.width),t.Input.calculateWidth(this.element,this.container);break;case"cssClass":this.updateCssClass(i.cssClass,s.cssClass);break;case"enabled":t.Input.setEnabled(i.enabled,this.element),this.bindClearEvent();break;case"enableRtl":t.Input.setEnableRtl(i.enableRtl,[this.container]);break;case"readonly":t.Input.setReadonly(i.readonly,this.element),this.readonly?e.attributes(this.element,{"aria-readonly":"true"}):this.element.removeAttribute("aria-readonly");break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.updateDataAttribute(!0),this.checkAttributes(!0),t.Input.validateInputType(this.container,this.element);break;case"placeholder":t.Input.setPlaceholder(i.placeholder,this.element),t.Input.calculateWidth(this.element,this.container);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":e.setValue(r,e.getValue(r,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(),t.Input.setPlaceholder(this.placeholder,this.element),this.updateValue(this.value);break;case"currency":var l=e.getValue(r,i);this.setProperties({currencyCode:l},!0),this.updateCurrency(r,l);break;case"currencyCode":var o=e.getValue(r,i);this.setProperties({currency:o},!0),this.updateCurrency("currency",o);break;case"format":e.setValue(r,e.getValue(r,i),this),this.initCultureInfo(),this.updateValue(this.value);break;case"decimals":this.decimals=i.decimals,this.updateValue(this.value)}}},s.prototype.updateClearButton=function(e){t.Input.setClearButton(e.showClearButton,this.element,this.inputWrapper,void 0,this.createElement),this.bindClearEvent()},s.prototype.updateSpinButton=function(t){t.showSpinButton?this.spinBtnCreation():(e.detach(this.spinUp),e.detach(this.spinDown))},s.prototype.getModuleName=function(){return"numerictextbox"},J([e.Property("")],s.prototype,"cssClass",void 0),J([e.Property(null)],s.prototype,"value",void 0),J([e.Property(-Number.MAX_VALUE)],s.prototype,"min",void 0),J([e.Property(Number.MAX_VALUE)],s.prototype,"max",void 0),J([e.Property(1)],s.prototype,"step",void 0),J([e.Property(null)],s.prototype,"width",void 0),J([e.Property(null)],s.prototype,"placeholder",void 0),J([e.Property({})],s.prototype,"htmlAttributes",void 0),J([e.Property(!0)],s.prototype,"showSpinButton",void 0),J([e.Property(!1)],s.prototype,"readonly",void 0),J([e.Property(!0)],s.prototype,"enabled",void 0),J([e.Property(!1)],s.prototype,"showClearButton",void 0),J([e.Property(!1)],s.prototype,"enablePersistence",void 0),J([e.Property("n2")],s.prototype,"format",void 0),J([e.Property(null)],s.prototype,"decimals",void 0),J([e.Property(null)],s.prototype,"currency",void 0),J([e.Property(null)],s.prototype,"currencyCode",void 0),J([e.Property(!0)],s.prototype,"strictMode",void 0),J([e.Property(!1)],s.prototype,"validateDecimalOnType",void 0),J([e.Property("Never")],s.prototype,"floatLabelType",void 0),J([e.Event()],s.prototype,"created",void 0),J([e.Event()],s.prototype,"destroyed",void 0),J([e.Event()],s.prototype,"change",void 0),J([e.Event()],s.prototype,"focus",void 0),J([e.Event()],s.prototype,"blur",void 0),s=J([e.NotifyPropertyChanges],s)}(e.Component),st="e-error",nt="e-input-group",at="e-float-input",rt="e-utility-mask",lt="e-label-top",ot="e-label-bottom",ht={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 ]"},ut=function(){function t(){}return t}(),pt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),dt=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},ct=["title","style","class"],mt=function(i){function s(t,e){var s=i.call(this,t,e)||this;return s.initInputValue="",s.preventChange=!1,s.isClicked=!1,s.maskOptions=t,s}return pt(s,i),s.prototype.getModuleName=function(){return"maskedtextbox"},s.prototype.preRender=function(){this.promptMask="",this.hiddenMask="",this.escapeMaskValue="",this.regExpCollec=ht,this.customRegExpCollec=[],this.maskedRegExp=[],this.undoCollec=[],this.redoCollec=[],this.changeEventArgs={},this.focusEventArgs={},this.blurEventArgs={},this.maskKeyPress=!1,this.isFocus=!1,this.isInitial=!1,this.isIosInvalid=!1;var t=e.getValue("ej2_instances",this.element);if(this.cloneElement=this.element.cloneNode(!0),e.removeClass([this.cloneElement],["e-control","e-maskedtextbox","e-lib"]),this.angularTagName=null,this.formElement=e.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.hasAttribute("name")&&this.element.removeAttribute("name"),this.element.classList.remove("e-control","e-maskedtextbox"),this.element.classList.add("e-mask-container"),this.element.appendChild(i),this.element=i,e.setValue("ej2_instances",t,this.element)}this.updateHTMLAttrToElement(),this.checkHtmlAttributes(!1),this.formElement&&(this.initInputValue=this.value)},s.prototype.getPersistData=function(){var t=["value"];return this.addOnPersist(t)},s.prototype.render=function(){"input"===this.element.tagName.toLowerCase()&&("Never"===this.floatLabelType&&e.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,e.Browser.isDevice||"11.0"!==e.Browser.info.version&&"edge"!==e.Browser.info.name||this.element.blur(),e.Browser.isDevice&&e.Browser.isIos&&this.element.blur(),(this.element.getAttribute("value")||this.value)&&this.element.setAttribute("value",this.element.value),!e.isNullOrUndefined(e.closest(this.element,"fieldset"))&&e.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.element.hasAttribute("aria-labelledby")||this.element.hasAttribute("placeholder")||this.element.hasAttribute("aria-label")||this.element.setAttribute("aria-label","maskedtextbox"),this.renderComplete())},s.prototype.updateHTMLAttrToElement=function(){if(!e.isNullOrUndefined(this.htmlAttributes))for(var t=0,i=Object.keys(this.htmlAttributes);t<i.length;t++){var s=i[t];ct.indexOf(s)<0&&this.element.setAttribute(s,this.htmlAttributes[""+s])}},s.prototype.updateCssClass=function(e,i){t.Input.setCssClass(this.getValidClassList(e),[this.inputObj.container],this.getValidClassList(i))},s.prototype.getValidClassList=function(t){var i=t;return e.isNullOrUndefined(t)||""===t||(i=t.replace(/\s+/g," ").trim()),i},s.prototype.updateHTMLAttrToWrapper=function(){if(!e.isNullOrUndefined(this.htmlAttributes))for(var t=0,i=Object.keys(this.htmlAttributes);t<i.length;t++){var s=i[t];if(ct.indexOf(s)>-1)if("class"===s){var n=this.htmlAttributes[""+s].replace(/\s+/g," ").trim();""!==n&&e.addClass([this.inputObj.container],n.split(" "))}else if("style"===s){var a=this.inputObj.container.getAttribute(s);a=e.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&&this.promptChar.length>1&&(this.promptChar=this.promptChar[0]),a.call(this),r.call(this),(null===this.mask||""===this.mask&&void 0!==this.value)&&W.call(this,this.value);var t=m.call(this,this.element);this.prevValue=t,this.value=t,this.isInitial||o.call(this),l.call(this)},s.prototype.setMaskPlaceholder=function(e,i){(i||this.placeholder)&&(t.Input.setPlaceholder(this.placeholder,this.element),(this.element.value===this.promptMask&&e&&"Always"!==this.floatLabelType||this.element.value===this.promptMask&&"Never"===this.floatLabelType)&&W.call(this,""))},s.prototype.setWidth=function(t){if(!e.isNullOrUndefined(t))if("number"==typeof t)this.inputObj.container.style.width=e.formatUnit(t),this.element.style.width=e.formatUnit(t);else if("string"==typeof t){var i=t.match(/px|%|em/)?t:e.formatUnit(t);this.inputObj.container.style.width=i,this.element.style.width=i}},s.prototype.checkHtmlAttributes=function(t){for(var i=0,s=t?e.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly"];i<s.length;i++){var n=s[i];if(!e.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"placeholder":(e.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"disabled":if(e.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.enabled||t){var a="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n);this.setProperties({enabled:a},!t)}break;case"value":(e.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.value||t)&&this.setProperties({value:this.element.value},!t);break;case"readonly":if(e.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.readonly||t){var r="readonly"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n);this.setProperties({readonly:r},!t)}}}},s.prototype.createWrapper=function(){var i=this.cssClass;e.isNullOrUndefined(this.cssClass)||""===this.cssClass||(i=this.getValidClassList(this.cssClass)),this.inputObj=t.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(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++)switch(n[s]){case"value":z.call(this,this.value),this.placeholder&&!this.isFocus&&this.setMaskPlaceholder(!1,!1),""===this.value&&null!=i.value&&(this.element.selectionStart=0,this.element.selectionEnd=0);break;case"placeholder":this.setMaskPlaceholder(!0,!0);break;case"width":this.setWidth(e.width),t.Input.calculateWidth(this.element,this.inputObj.container);break;case"cssClass":this.updateCssClass(e.cssClass,i.cssClass);break;case"enabled":t.Input.setEnabled(e.enabled,this.element,this.floatLabelType,this.inputObj.container);break;case"readonly":t.Input.setReadonly(e.readonly,this.element);break;case"enableRtl":t.Input.setEnableRtl(e.enableRtl,[this.inputObj.container]);break;case"customCharacters":this.customCharacters=e.customCharacters,this.resetMaskedTextBox();break;case"showClearButton":t.Input.setClearButton(e.showClearButton,this.element,this.inputObj,void 0,this.createElement),h.call(this);break;case"floatLabelType":this.floatLabelType=e.floatLabelType,t.Input.removeFloating(this.inputObj),t.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=e.mask,this.maskedRegExp=[],this.updateValue(a);break;case"promptChar":e.promptChar.length>1&&(e.promptChar=e.promptChar[0]),e.promptChar?this.promptChar=e.promptChar:this.promptChar="_";var r=this.element.value.replace(new RegExp("["+i.promptChar+"]","g"),this.promptChar);this.promptMask===this.element.value&&(r=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=[],W.call(this,r)}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange},s.prototype.updateValue=function(t){this.resetMaskedTextBox(),z.call(this,t)},s.prototype.getMaskedValue=function(){return c.call(this,this.element)},s.prototype.focusIn=function(){document.activeElement!==this.element&&this.enabled&&(this.isFocus=!0,this.element.focus(),e.addClass([this.inputObj.container],["e-input-focus"]))},s.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.isFocus=!1,this.element.blur(),e.removeClass([this.inputObj.container],["e-input-focus"]))},s.prototype.destroy=function(){o.call(this),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]);for(var s=["aria-labelledby","role","autocomplete","aria-readonly","aria-disabled","autocapitalize","spellcheck","aria-autocomplete","aria-live","aria-invalid"],n=0;n<s.length;n++)this.element.removeAttribute(s[n]);this.element.classList.remove("e-input"),this.inputObj&&(this.inputObj.container.insertAdjacentElement("afterend",this.element),e.detach(this.inputObj.container)),this.blurEventArgs=null,t.Input.destroy({element:this.element,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),this.changeEventArgs=null,this.inputObj=null,i.prototype.destroy.call(this)},dt([e.Property(null)],s.prototype,"cssClass",void 0),dt([e.Property(null)],s.prototype,"width",void 0),dt([e.Property(null)],s.prototype,"placeholder",void 0),dt([e.Property("Never")],s.prototype,"floatLabelType",void 0),dt([e.Property({})],s.prototype,"htmlAttributes",void 0),dt([e.Property(!0)],s.prototype,"enabled",void 0),dt([e.Property(!1)],s.prototype,"readonly",void 0),dt([e.Property(!1)],s.prototype,"showClearButton",void 0),dt([e.Property(!1)],s.prototype,"enablePersistence",void 0),dt([e.Property(null)],s.prototype,"mask",void 0),dt([e.Property("_")],s.prototype,"promptChar",void 0),dt([e.Property(null)],s.prototype,"value",void 0),dt([e.Property(null)],s.prototype,"customCharacters",void 0),dt([e.Event()],s.prototype,"created",void 0),dt([e.Event()],s.prototype,"destroyed",void 0),dt([e.Event()],s.prototype,"change",void 0),dt([e.Event()],s.prototype,"focus",void 0),dt([e.Event()],s.prototype,"blur",void 0),s=dt([e.NotifyPropertyChanges],s)}(e.Component),vt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),ft=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},gt=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return vt(i,t),ft([e.Property("None")],i.prototype,"placement",void 0),ft([e.Property(10)],i.prototype,"largeStep",void 0),ft([e.Property(1)],i.prototype,"smallStep",void 0),ft([e.Property(!1)],i.prototype,"showSmallTicks",void 0),ft([e.Property(null)],i.prototype,"format",void 0),i}(e.ChildProperty),yt=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return vt(i,t),ft([e.Property(null)],i.prototype,"color",void 0),ft([e.Property(null)],i.prototype,"start",void 0),ft([e.Property(null)],i.prototype,"end",void 0),i}(e.ChildProperty),bt=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return vt(i,t),ft([e.Property(!1)],i.prototype,"enabled",void 0),ft([e.Property(null)],i.prototype,"minStart",void 0),ft([e.Property(null)],i.prototype,"minEnd",void 0),ft([e.Property(null)],i.prototype,"maxStart",void 0),ft([e.Property(null)],i.prototype,"maxEnd",void 0),ft([e.Property(!1)],i.prototype,"startHandleFixed",void 0),ft([e.Property(!1)],i.prototype,"endHandleFixed",void 0),i}(e.ChildProperty),Ct=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return vt(i,t),ft([e.Property("")],i.prototype,"cssClass",void 0),ft([e.Property("Before")],i.prototype,"placement",void 0),ft([e.Property("Focus")],i.prototype,"showOn",void 0),ft([e.Property(!1)],i.prototype,"isVisible",void 0),ft([e.Property(null)],i.prototype,"format",void 0),i}(e.ChildProperty),Et={root:"e-slider",rtl:"e-rtl",sliderHiddenInput:"e-slider-input",controlWrapper:"e-control-wrapper",sliderHandle:"e-handle",rangeBar:"e-range",sliderButton:"e-slider-button",firstButton:"e-first-button",secondButton:"e-second-button",scale:"e-scale",tick:"e-tick",large:"e-large",tickValue:"e-tick-value",sliderTooltip:"e-slider-tooltip",sliderHover:"e-slider-hover",sliderFirstHandle:"e-handle-first",sliderSecondHandle:"e-handle-second",sliderDisabled:"e-disabled",sliderContainer:"e-slider-container",horizontalTooltipBefore:"e-slider-horizontal-before",horizontalTooltipAfter:"e-slider-horizontal-after",verticalTooltipBefore:"e-slider-vertical-before",verticalTooltipAfter:"e-slider-vertical-after",materialTooltip:"e-material-tooltip",materialTooltipOpen:"e-material-tooltip-open",materialTooltipActive:"e-tooltip-active",materialSlider:"e-material-slider",sliderTrack:"e-slider-track",sliderHorizantalColor:"e-slider-horizantal-color",sliderVerticalColor:"e-slider-vertical-color",sliderHandleFocused:"e-handle-focused",verticalSlider:"e-vertical",horizontalSlider:"e-horizontal",sliderHandleStart:"e-handle-start",sliderTooltipStart:"e-material-tooltip-start",sliderTabHandle:"e-tab-handle",sliderButtonIcon:"e-button-icon",sliderSmallSize:"e-small-size",sliderTickPosition:"e-tick-pos",sliderFirstTick:"e-first-tick",sliderLastTick:"e-last-tick",sliderButtonClass:"e-slider-btn",sliderTooltipWrapper:"e-tooltip-wrap",sliderTabTrack:"e-tab-track",sliderTabRange:"e-tab-range",sliderActiveHandle:"e-handle-active",sliderMaterialHandle:"e-material-handle",sliderMaterialRange:"e-material-range",sliderMaterialDefault:"e-material-default",materialTooltipShow:"e-material-tooltip-show",materialTooltipHide:"e-material-tooltip-hide",readonly:"e-read-only",limits:"e-limits",limitBarDefault:"e-limit-bar",limitBarFirst:"e-limit-first",limitBarSecond:"e-limit-second",dragHorizontal:"e-drag-horizontal",dragVertical:"e-drag-vertical"},St=function(t){function s(e,i){var s=t.call(this,e,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 vt(s,t),s.prototype.preRender=function(){var t={incrementTitle:"Increase",decrementTitle:"Decrease"};this.l10n=new e.L10n("slider",t,this.locale),this.isElementFocused=!1,this.tickElementCollection=[],this.tooltipFormatInfo={},this.ticksFormatInfo={},this.initCultureInfo(),this.initCultureFunc(),this.formChecker()},s.prototype.formChecker=function(){var t=e.closest(this.element,"form");t?(this.isForm=!0,e.isNullOrUndefined(this.formResetValue)||this.setProperties({value:this.formResetValue},!0),this.formResetValue=this.value,"Range"!==this.type||!e.isNullOrUndefined(this.formResetValue)&&"object"==typeof this.formResetValue?e.isNullOrUndefined(this.formResetValue)&&(this.formResetValue=parseFloat(e.formatUnit(this.min))):this.formResetValue=[parseFloat(e.formatUnit(this.min)),parseFloat(e.formatUnit(this.max))],this.formElement=t):this.isForm=!1},s.prototype.initCultureFunc=function(){this.internationalization=new e.Internationalization(this.locale)},s.prototype.initCultureInfo=function(){this.tooltipFormatInfo.format=e.isNullOrUndefined(this.tooltip.format)?null:this.tooltip.format,this.ticksFormatInfo.format=e.isNullOrUndefined(this.ticks.format)?null:this.ticks.format},s.prototype.formatString=function(t,e){var i=null,s=null;if(t||0===t){i=this.formatNumber(t);var n=this.numberOfDecimals(t);s=this.internationalization.getNumberFormat(e)(this.makeRoundNumber(t,n))}return{elementVal:i,formatString:s}},s.prototype.formatNumber=function(t){var e=this.numberOfDecimals(t);return this.internationalization.getNumberFormat({maximumFractionDigits:e,minimumFractionDigits:e,useGrouping:!1})(t)},s.prototype.numberOfDecimals=function(t){var e=t.toString().split(".")[1];return e&&e.length?e.length:0},s.prototype.makeRoundNumber=function(t,e){var i=e||0;return Number(t.toFixed(i))},s.prototype.render=function(){var t=this;this.initialize(),this.initRender(),this.wireEvents(),this.setZindex(),this.renderComplete(),"EJS-SLIDER"===this.element.tagName&&"none"===this.getTheme(this.sliderContainer)&&setTimeout(function(){t.refresh()},0)},s.prototype.initialize=function(){e.addClass([this.element],Et.root),this.setCSSClass()},s.prototype.setElementWidth=function(t){e.isNullOrUndefined(t)||e.isNullOrUndefined(this.sliderContainer)||("number"==typeof t?this.sliderContainer.style.width=e.formatUnit(t):"string"==typeof t&&(this.sliderContainer.style.width=t.match(/px|%|em/)?t:e.formatUnit(t)))},s.prototype.setCSSClass=function(t){t&&e.removeClass([this.element],t.split(" ")),this.cssClass&&e.addClass([this.element],this.cssClass.split(" "))},s.prototype.setEnabled=function(){this.enabled?(e.removeClass([this.sliderContainer],[Et.sliderDisabled]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.remove(Et.sliderDisabled),this.wireEvents()):(e.addClass([this.sliderContainer],[Et.sliderDisabled]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.add(Et.sliderDisabled),this.unwireEvents())},s.prototype.getTheme=function(t){return window.getComputedStyle(t,":after").getPropertyValue("content").replace(/['"]+/g,"")},s.prototype.initRender=function(){this.sliderContainer=this.createElement("div",{className:Et.sliderContainer+" "+Et.controlWrapper}),this.element.parentNode.insertBefore(this.sliderContainer,this.element),this.sliderContainer.appendChild(this.element),this.sliderTrack=this.createElement("div",{className:Et.sliderTrack}),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:e.isNullOrUndefined(this.value)?e.isNullOrUndefined(this.min)?"0":this.min.toString():this.value.toString(),name:this.element.getAttribute("name")||this.element.getAttribute("id")||"_"+(1e3*Math.random()).toFixed(0)+"slider",class:Et.sliderHiddenInput}}),this.hiddenInput.tabIndex=-1,this.sliderContainer.appendChild(this.hiddenInput),this.showButtons&&this.setButtons(),this.setEnableRTL(),"Range"===this.type?this.rangeValueUpdate():this.value=e.isNullOrUndefined(this.value)?e.isNullOrUndefined(this.min)?0:parseFloat(e.formatUnit(this.min.toString())):this.value,this.previousVal="Range"!==this.type?this.checkHandleValue(parseFloat(e.formatUnit(this.value.toString()))):[this.checkHandleValue(parseFloat(e.formatUnit(this.value[0].toString()))),this.checkHandleValue(parseFloat(e.formatUnit(this.value[1].toString())))],this.previousChanged=this.previousVal,e.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?e.removeClass([this.sliderContainer],[Et.sliderDisabled]):e.addClass([this.sliderContainer],[Et.sliderDisabled]),this.readonly?e.addClass([this.sliderContainer],[Et.readonly]):e.removeClass([this.sliderContainer],[Et.readonly])},s.prototype.getThemeInitialization=function(){this.isMaterial="material"===this.getTheme(this.sliderContainer)||"material-dark"===this.getTheme(this.sliderContainer),this.isMaterial3="Material3"===this.getTheme(this.sliderContainer)||"Material3-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.isTailwind3="tailwind3"===this.getTheme(this.sliderContainer)||"tailwind3-dark"===this.getTheme(this.sliderContainer),this.isBootstrap5="bootstrap5"===this.getTheme(this.sliderContainer),this.isFluent="FluentUI"===this.getTheme(this.sliderContainer),this.isFluent2="fluent2"===this.getTheme(this.sliderContainer),this.isBootstrap5Dot3="bootstrap5.3"===this.getTheme(this.sliderContainer),this.isMaterialTooltip=(this.isMaterial||this.isMaterial3)&&"Range"!==this.type&&this.tooltip.isVisible},s.prototype.createRangeBar=function(){"Default"!==this.type&&(this.rangeBar=this.createElement("div",{attrs:{class:Et.rangeBar}}),this.element.appendChild(this.rangeBar),this.drag&&"Range"===this.type&&("Horizontal"===this.orientation?this.rangeBar.classList.add(Et.dragHorizontal):this.rangeBar.classList.add(Et.dragVertical)))},s.prototype.createLimitBar=function(){var t="Range"!==this.type?Et.limitBarDefault:Et.limitBarFirst;t+=" "+Et.limits,this.limitBarFirst=this.createElement("div",{attrs:{class:t}}),this.element.appendChild(this.limitBarFirst),"Range"===this.type&&(this.limitBarSecond=this.createElement("div",{attrs:{class:Et.limitBarSecond+" "+Et.limits}}),this.element.appendChild(this.limitBarSecond))},s.prototype.setOrientClass=function(){"Vertical"!==this.orientation?(this.sliderContainer.classList.remove(Et.verticalSlider),this.sliderContainer.classList.add(Et.horizontalSlider),this.firstHandle.setAttribute("aria-orientation","horizontal"),"Range"===this.type&&this.secondHandle.setAttribute("aria-orientation","horizontal")):(this.sliderContainer.classList.remove(Et.horizontalSlider),this.sliderContainer.classList.add(Et.verticalSlider),this.firstHandle.setAttribute("aria-orientation","vertical"),"Range"===this.type&&this.secondHandle.setAttribute("aria-orientation","vertical"))},s.prototype.setAriaAttributes=function(t){var i=this,s=this.min,n=this.max;!e.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&(s=this.customValues[0],n=this.customValues[this.customValues.length-1]),"Range"!==this.type?e.attributes(t,{"aria-valuemin":e.isNullOrUndefined(s)?"0":s.toString(),"aria-valuemax":e.isNullOrUndefined(n)?"100":n.toString()}):(!e.isNullOrUndefined(this.customValues)&&this.customValues.length>0?[[e.isNullOrUndefined(s)?"":s.toString(),this.value.length>1&&!e.isNullOrUndefined(this.customValues[this.value[1]])?this.customValues[this.value[1]].toString():""],[this.value.length>0&&!e.isNullOrUndefined(this.customValues[this.value[0]])?this.customValues[this.value[0]].toString():"",e.isNullOrUndefined(n)?"":n.toString()]]:[[e.isNullOrUndefined(s)?"":s.toString(),this.value.length>1&&!e.isNullOrUndefined(this.value[1])?this.value[1].toString():""],[this.value.length>0&&!e.isNullOrUndefined(this.value[0])?this.value[0].toString():"",e.isNullOrUndefined(n)?"":n.toString()]]).forEach(function(t,s){var n=0===s?i.firstHandle:i.secondHandle;n&&e.attributes(n,{"aria-valuemin":t[0],"aria-valuemax":t[1]})})},s.prototype.createSecondHandle=function(){this.secondHandle=this.createElement("div",{attrs:{class:Et.sliderHandle,role:"slider",tabIndex:"0","aria-label":"slider"}}),this.secondHandle.classList.add(Et.sliderSecondHandle),this.element.appendChild(this.secondHandle)},s.prototype.createFirstHandle=function(){this.firstHandle=this.createElement("div",{attrs:{class:Et.sliderHandle,role:"slider",tabIndex:"0","aria-label":"slider"}}),this.firstHandle.classList.add(Et.sliderFirstHandle),this.element.appendChild(this.firstHandle),this.isMaterialTooltip&&(this.materialHandle=this.createElement("div",{attrs:{class:Et.sliderHandle+" "+Et.sliderMaterialHandle}}),this.element.appendChild(this.materialHandle))},s.prototype.wireFirstHandleEvt=function(t){t?(e.EventHandler.remove(this.firstHandle,"mousedown touchstart",this.handleFocus),e.EventHandler.remove(this.firstHandle,"transitionend",this.transitionEnd),e.EventHandler.remove(this.firstHandle,"mouseenter touchenter",this.handleOver),e.EventHandler.remove(this.firstHandle,"mouseleave touchend",this.handleLeave)):(e.EventHandler.add(this.firstHandle,"mousedown touchstart",this.handleFocus,this),e.EventHandler.add(this.firstHandle,"transitionend",this.transitionEnd,this),e.EventHandler.add(this.firstHandle,"mouseenter touchenter",this.handleOver,this),e.EventHandler.add(this.firstHandle,"mouseleave touchend",this.handleLeave,this))},s.prototype.wireSecondHandleEvt=function(t){t?(e.EventHandler.remove(this.secondHandle,"mousedown touchstart",this.handleFocus),e.EventHandler.remove(this.secondHandle,"transitionend",this.transitionEnd),e.EventHandler.remove(this.secondHandle,"mouseenter touchenter",this.handleOver),e.EventHandler.remove(this.secondHandle,"mouseleave touchend",this.handleLeave)):(e.EventHandler.add(this.secondHandle,"mousedown touchstart",this.handleFocus,this),e.EventHandler.add(this.secondHandle,"transitionend",this.transitionEnd,this),e.EventHandler.add(this.secondHandle,"mouseenter touchenter",this.handleOver,this),e.EventHandler.add(this.secondHandle,"mouseleave touchend",this.handleLeave,this))},s.prototype.handleStart=function(){"Range"!==this.type&&(this.firstHandle.classList[0===this.handlePos1?"add":"remove"](Et.sliderHandleStart),this.isMaterialTooltip&&(this.materialHandle.classList[0===this.handlePos1?"add":"remove"](Et.sliderHandleStart),this.tooltipElement&&this.tooltipElement.classList[0===this.handlePos1?"add":"remove"](Et.sliderTooltipStart)))},s.prototype.transitionEnd=function(t){"transform"!==t.propertyName&&(this.handleStart(),this.enableAnimation||(this.getHandle().style.transition="none"),"Default"!==this.type&&(this.rangeBar.style.transition="none"),(this.isMaterial||this.isMaterial3)&&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(Et.sliderHandleFocused)&&this.firstHandle.classList.remove(Et.sliderHandleFocused),"Range"===this.type&&this.secondHandle.classList.contains(Et.sliderHandleFocused)&&this.secondHandle.classList.remove(Et.sliderHandleFocused)},s.prototype.handleFocus=function(t){this.focusSliderElement(),this.sliderBarClick(t),t.currentTarget===this.firstHandle?(this.firstHandle.classList.add(Et.sliderHandleFocused),this.firstHandle.classList.add(Et.sliderTabHandle)):(this.secondHandle.classList.add(Et.sliderHandleFocused),this.secondHandle.classList.add(Et.sliderTabHandle)),e.EventHandler.add(document,"mousemove touchmove",this.sliderBarMove,this),e.EventHandler.add(document,"mouseup touchend",this.sliderBarUp,this)},s.prototype.handleOver=function(t){this.tooltip.isVisible&&"Hover"===this.tooltip.showOn&&this.tooltipToggle(t.currentTarget),"Default"===this.type&&this.tooltipToggle(this.getHandle())},s.prototype.handleLeave=function(t){!this.tooltip.isVisible||"Hover"!==this.tooltip.showOn||t.currentTarget.classList.contains(Et.sliderHandleFocused)||t.currentTarget.classList.contains(Et.sliderTabHandle)||this.closeTooltip()},s.prototype.setHandler=function(){this.createFirstHandle(),"Range"===this.type&&this.createSecondHandle()},s.prototype.setEnableRTL=function(){this.enableRtl&&"Vertical"!==this.orientation?e.addClass([this.sliderContainer],Et.rtl):e.removeClass([this.sliderContainer],Et.rtl);var t="Vertical"!==this.orientation?this.horDir:this.verDir;this.enableRtl?(this.horDir="right",this.verDir="bottom"):(this.horDir="left",this.verDir="bottom"),t!==("Vertical"!==this.orientation?this.horDir:this.verDir)&&"Horizontal"===this.orientation&&(e.setStyleAttribute(this.firstHandle,{right:"",left:"auto"}),"Range"===this.type&&e.setStyleAttribute(this.secondHandle,{top:"",left:"auto"})),this.setBarColor()},s.prototype.tooltipValue=function(){var t,i=this,s={value:this.value,text:""};this.initialTooltip&&(this.initialTooltip=!1,this.setTooltipContent(),s.text=t="function"==typeof this.tooltipObj.content?this.tooltipObj.content():this.tooltipObj.content,this.trigger("tooltipChange",s,function(s){if(i.addTooltipClass(s.text),t!==s.text){i.customAriaText=s.text,i.enableHtmlSanitizer?s.text=e.SanitizeHtmlHelper.sanitize(s.text.toString()):s.text=s.text.toString();var n=function(){return s.text};i.tooltipObj.content=e.initializeCSPTemplate(n),i.setAriaAttrValue(i.firstHandle),"Range"===i.type&&i.setAriaAttrValue(i.secondHandle)}}),this.isMaterialTooltip&&this.setPreviousVal("change",this.value))},s.prototype.setTooltipContent=function(){var t=this.formatContent(this.tooltipFormatInfo,!1),i=function(){return t};this.tooltipObj.content=e.initializeCSPTemplate(i)},s.prototype.formatContent=function(t,i){var s="",n=this.handleVal1,a=this.handleVal2;return!e.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?e.isNullOrUndefined(this.tooltip)||e.isNullOrUndefined(this.tooltip.format)?a.toString()+" - "+n.toString():this.formatString(a,t).elementVal+" - "+this.formatString(n,t).elementVal:e.isNullOrUndefined(this.tooltip)||e.isNullOrUndefined(this.tooltip.format)?n.toString()+" - "+a.toString():this.formatString(n,t).elementVal+" - "+this.formatString(a,t).elementVal:e.isNullOrUndefined(n)||(s=e.isNullOrUndefined(this.tooltip)||e.isNullOrUndefined(this.tooltip.format)?n.toString():this.formatString(n,t).elementVal),s):("Range"===this.type?s=this.enableRtl&&"Vertical"!==this.orientation?e.isNullOrUndefined(t.format)?a.toString()+" - "+n.toString():this.formatString(a,t).formatString+" - "+this.formatString(n,t).formatString:e.isNullOrUndefined(t.format)?n.toString()+" - "+a.toString():this.formatString(n,t).formatString+" - "+this.formatString(a,t).formatString:e.isNullOrUndefined(n)||(s=e.isNullOrUndefined(t.format)?n.toString():this.formatString(n,t).formatString),s)},s.prototype.addTooltipClass=function(t){if(this.isMaterialTooltip){var e=t.toString().length;if(this.tooltipElement){i=e>4?{oldCss:Et.sliderMaterialDefault,newCss:Et.sliderMaterialRange}:{oldCss:Et.sliderMaterialRange,newCss:Et.sliderMaterialDefault};this.tooltipElement.classList.remove(i.oldCss),this.tooltipElement.classList.contains(i.newCss)||(this.tooltipElement.classList.add(i.newCss),this.tooltipElement.style.transform=e>4?"scale(1)":this.getTooltipTransformProperties(this.previousTooltipClass).rotate)}else{var i=e>4?Et.sliderMaterialRange:Et.sliderMaterialDefault;this.tooltipObj.cssClass=Et.sliderTooltip+" "+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(t){this.tooltipElement=t.element,this.tooltip.cssClass&&e.addClass([this.tooltipElement],this.tooltip.cssClass.split(" ").filter(function(t){return t})),t.target.removeAttribute("aria-describedby"),this.isMaterialTooltip&&(this.tooltipElement.firstElementChild.classList.add(Et.materialTooltipHide),this.handleStart(),this.setTooltipTransform())},s.prototype.tooltipCollision=function(t){if(this.isBootstrap||this.isBootstrap4||(this.isMaterial||this.isMaterial3)&&!this.isMaterialTooltip){var e=this.isBootstrap4?3:6;switch(t){case"TopCenter":this.tooltipObj.setProperties({offsetY:-e},!1);break;case"BottomCenter":this.tooltipObj.setProperties({offsetY:e},!1);break;case"LeftCenter":this.tooltipObj.setProperties({offsetX:-e},!1);break;case"RightCenter":this.tooltipObj.setProperties({offsetX:e},!1)}}},s.prototype.materialTooltipEventCallBack=function(t){this.sliderBarClick(t),e.EventHandler.add(document,"mousemove touchmove",this.sliderBarMove,this),e.EventHandler.add(document,"mouseup touchend",this.sliderBarUp,this)},s.prototype.wireMaterialTooltipEvent=function(t){this.isMaterialTooltip&&(t?e.EventHandler.remove(this.tooltipElement,"mousedown touchstart",this.materialTooltipEventCallBack):e.EventHandler.add(this.tooltipElement,"mousedown touchstart",this.materialTooltipEventCallBack,this))},s.prototype.tooltipPositionCalculation=function(t){var e;switch(t){case"TopCenter":e=Et.horizontalTooltipBefore;break;case"BottomCenter":e=Et.horizontalTooltipAfter;break;case"LeftCenter":e=Et.verticalTooltipBefore;break;case"RightCenter":e=Et.verticalTooltipAfter}return e},s.prototype.getTooltipTransformProperties=function(t){var e;if(this.tooltipElement){var i="Horizontal"===this.orientation?this.tooltipElement.clientHeight+14-this.tooltipElement.clientHeight/2:this.tooltipElement.clientWidth+14-this.tooltipElement.clientWidth/2;e="Horizontal"===this.orientation?t===Et.horizontalTooltipBefore?{rotate:"rotate(45deg)",translate:"translateY("+i+"px)"}:{rotate:"rotate(225deg)",translate:"translateY("+-i+"px)"}:t===Et.verticalTooltipBefore?{rotate:"rotate(-45deg)",translate:"translateX("+i+"px)"}:{rotate:"rotate(-225deg)",translate:"translateX("+-i+"px)"}}return e},s.prototype.openMaterialTooltip=function(){var t=this;if(this.isMaterialTooltip){this.refreshTooltip(this.firstHandle);var e=this.tooltipElement.firstElementChild;e.classList.remove(Et.materialTooltipHide),e.classList.add(Et.materialTooltipShow),this.firstHandle.style.cursor="default",this.tooltipElement.style.transition=this.scaleTransform,this.tooltipElement.classList.add(Et.materialTooltipOpen),this.materialHandle.style.transform="scale(0)",e.innerText.length>4?this.tooltipElement.style.transform="scale(1)":this.tooltipElement.style.transform=this.getTooltipTransformProperties(this.previousTooltipClass).rotate,"Default"===this.type?setTimeout(function(){t.tooltipElement&&(t.tooltipElement.style.transition=t.transition.handle)},2500):setTimeout(function(){t.tooltipElement&&(t.tooltipElement.style.transition="none")},2500)}},s.prototype.closeMaterialTooltip=function(){var t=this;if(this.isMaterialTooltip){var e=this.tooltipElement.firstElementChild;this.tooltipElement.style.transition=this.scaleTransform,e.classList.remove(Et.materialTooltipShow),e.classList.add(Et.materialTooltipHide),this.firstHandle.style.cursor="-webkit-grab",this.firstHandle.style.cursor="grab",this.materialHandle&&(this.materialHandle.style.transform="scale(1)"),this.tooltipElement.classList.remove(Et.materialTooltipOpen),this.setTooltipTransform(),this.tooltipTarget=void 0,setTimeout(function(){t.tooltipElement&&(t.tooltipElement.style.transition="none")},2500)}},s.prototype.checkTooltipPosition=function(t){var e=this.tooltipPositionCalculation(t.collidedPosition);void 0!==this.tooltipCollidedPosition&&this.tooltipCollidedPosition===t.collidedPosition&&t.element.classList.contains(e)||(this.isMaterialTooltip&&(void 0!==e&&(t.element.classList.remove(this.previousTooltipClass),t.element.classList.add(e),this.previousTooltipClass=e),t.element.style.transform&&t.element.classList.contains(Et.materialTooltipOpen)&&t.element.firstElementChild.innerText.length<=4&&(t.element.style.transform=this.getTooltipTransformProperties(this.previousTooltipClass).rotate)),this.tooltipCollidedPosition=t.collidedPosition),this.isMaterialTooltip&&this.tooltipElement&&-1!==this.tooltipElement.style.transform.indexOf("translate")&&this.setTooltipTransform()},s.prototype.setTooltipTransform=function(){var t=this.getTooltipTransformProperties(this.previousTooltipClass);e.isNullOrUndefined(this.tooltipElement)||(this.tooltipElement.firstElementChild.innerText.length>4?this.tooltipElement.style.transform=t.translate+" scale(0.01)":this.tooltipElement.style.transform=t.translate+" "+t.rotate+" scale(0.01)")},s.prototype.renderTooltip=function(){this.tooltipObj=new i.Tooltip({showTipPointer:this.isBootstrap||this.isMaterial||this.isMaterial3||this.isBootstrap4||this.isTailwind||this.isTailwind3||this.isBootstrap5||this.isFluent||this.isFluent2||this.isBootstrap5Dot3,cssClass:Et.sliderTooltip,height:this.isMaterial||this.isMaterial3?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 t="Auto"===this.tooltip.showOn?"Hover":this.tooltip.showOn;this.setProperties({tooltip:{showOn:t}},!0),this.tooltipObj.position=this.tooltipPlacement(),this.tooltipCollision(this.tooltipObj.position),[this.firstHandle,this.rangeBar,this.secondHandle].forEach(function(t){e.isNullOrUndefined(t)||(t.style.transition="none")}),this.isMaterialTooltip&&(this.sliderContainer.classList.add(Et.materialSlider),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:Et.sliderButton+" "+Et.firstButton}),this.firstBtn.appendChild(this.createElement("span",{className:Et.sliderButtonIcon})),(this.isTailwind||this.isTailwind3)&&this.firstBtn.querySelector("span").classList.add("e-icons"),this.firstBtn.tabIndex=-1,this.secondBtn=this.createElement("div",{className:Et.sliderButton+" "+Et.secondButton}),this.secondBtn.appendChild(this.createElement("span",{className:Et.sliderButtonIcon})),(this.isTailwind||this.isTailwind3)&&this.secondBtn.querySelector("span").classList.add("e-icons"),this.secondBtn.tabIndex=-1,this.sliderContainer.classList.add(Et.sliderButtonClass),this.sliderContainer.appendChild(this.firstBtn),this.sliderContainer.appendChild(this.secondBtn),this.sliderContainer.appendChild(this.element),this.buttonTitle()},s.prototype.buttonTitle=function(){var t=this.enableRtl&&"Vertical"!==this.orientation;this.l10n.setLocale(this.locale);var i=this.l10n.getConstant("decrementTitle"),s=this.l10n.getConstant("incrementTitle");e.attributes(t?this.secondBtn:this.firstBtn,{"aria-label":i,title:i}),e.attributes(t?this.firstBtn:this.secondBtn,{"aria-label":s,title:s})},s.prototype.buttonFocusOut=function(){(this.isMaterial||this.isMaterial3)&&this.getHandle().classList.remove("e-large-thumb-size")},s.prototype.repeatButton=function(t){var e,i=this.handleValueUpdate(),s=this.enableRtl&&"Vertical"!==this.orientation;t.target.parentElement.classList.contains(Et.firstButton)||t.target.classList.contains(Et.firstButton)?e=s?this.add(i,parseFloat(this.step.toString()),!0):this.add(i,parseFloat(this.step.toString()),!1):(t.target.parentElement.classList.contains(Et.secondButton)||t.target.classList.contains(Et.secondButton))&&(e=s?this.add(i,parseFloat(this.step.toString()),!1):this.add(i,parseFloat(this.step.toString()),!0)),this.limits.enabled&&(e=this.getLimitCorrectedValues(e)),e>=this.min&&e<=this.max&&(this.changeHandleValue(e),this.tooltipToggle(this.getHandle()))},s.prototype.repeatHandlerMouse=function(t){t.preventDefault(),"mousedown"!==t.type&&"touchstart"!==t.type||(this.buttonClick(t),this.repeatInterval=setInterval(this.repeatButton.bind(this),180,t))},s.prototype.materialChange=function(){this.getHandle().classList.contains("e-large-thumb-size")||this.getHandle().classList.add("e-large-thumb-size")},s.prototype.focusHandle=function(){this.getHandle().classList.contains(Et.sliderTabHandle)||this.getHandle().classList.add(Et.sliderTabHandle)},s.prototype.repeatHandlerUp=function(t){this.changeEvent("changed",t),this.closeTooltip(),clearInterval(this.repeatInterval),this.getHandle().focus()},s.prototype.customTickCounter=function(t){var i=4;return!e.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&(t>4&&(i=3),t>7&&(i=2),t>14&&(i=1),t>28&&(i=0)),i},s.prototype.renderScale=function(){var t="Vertical"===this.orientation?"v":"h";this.ul=this.createElement("ul",{className:Et.scale+" e-"+t+"-scale "+Et.tick+"-"+this.ticks.placement.toLowerCase(),attrs:{role:"presentation","aria-hidden":"true"}}),this.ul.style.zIndex="-1",e.Browser.isAndroid&&"h"===t&&this.ul.classList.add(Et.sliderTickPosition);var i=this.ticks.smallStep;this.ticks.showSmallTicks?i<=0&&(i=parseFloat(e.formatUnit(this.step))):i=this.ticks.largeStep>0?this.ticks.largeStep:parseFloat(e.formatUnit(this.max))-parseFloat(e.formatUnit(this.min));var s=parseFloat(e.formatUnit(this.min)),n=parseFloat(e.formatUnit(this.max)),a=parseFloat(e.formatUnit(i)),r=!e.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&this.customValues.length-1,l=this.customTickCounter(r),o=!e.isNullOrUndefined(this.customValues)&&this.customValues.length>0?r*l+r:Math.abs((n-s)/a);this.element.appendChild(this.ul);var h,u=parseFloat(this.min.toString());"v"===t&&(u=parseFloat(this.max.toString()));var p,d=0,c=100/o;c===1/0&&(c=5);for(var m=0,v=!e.isNullOrUndefined(this.customValues)&&this.customValues.length>0?this.customValues.length-1:0,f=0;m<=o;m++){if(h=this.createElement("li",{attrs:{class:Et.tick,role:"presentation","aria-hidden":"true"}}),!e.isNullOrUndefined(this.customValues)&&this.customValues.length>0)(p=m%(l+1)==0)&&("h"===t?(u=this.customValues[f],f++):(u=this.customValues[v],v--),h.setAttribute("title",u.toString()));else if(h.setAttribute("title",u.toString()),0===this.numberOfDecimals(this.max)&&0===this.numberOfDecimals(this.min)&&0===this.numberOfDecimals(this.step))if("h"===t){b=(u-parseFloat(this.min.toString()))%this.ticks.largeStep;p=Math.abs(b)<1e-10||Math.abs(this.ticks.largeStep-b)<1e-10}else{b=Math.abs(u-parseFloat(this.max.toString()))%this.ticks.largeStep;p=Math.abs(b)<1e-10||Math.abs(this.ticks.largeStep-b)<1e-10}else{var g=this.ticks.largeStep,y=u;if("h"===t){b=(y-s)%g;p=Math.abs(b)<1e-10||Math.abs(g-b)<1e-10}else{var b=Math.abs(y-parseFloat(n.toString()))%g;p=Math.abs(b)<1e-10||Math.abs(g-b)<1e-10}}p&&h.classList.add(Et.large),"h"===t?h.style.width=c+"%":h.style.height=c+"%";var C=p?"Both"===this.ticks.placement?2:1:0;if(p)for(var E=0;E<C;E++)this.createTick(h,u);else e.isNullOrUndefined(this.customValues)&&this.formatTicksValue(h,u);this.ul.appendChild(h),this.tickElementCollection.push(h);var S=void 0;e.isNullOrUndefined(this.customValues)&&(S=this.numberOfDecimals(i)>this.numberOfDecimals(u)?this.numberOfDecimals(i):this.numberOfDecimals(u),u="h"===t?this.makeRoundNumber(u+i,S):this.min>this.max?this.makeRoundNumber(u+i,S):this.makeRoundNumber(u-i,S),d=this.makeRoundNumber(d+i,S))}this.ticksAlignment(t,c)},s.prototype.ticksAlignment=function(t,e,i){void 0===i&&(i=!0),this.firstChild=this.ul.firstElementChild,this.lastChild=this.ul.lastElementChild,this.firstChild.classList.add(Et.sliderFirstTick),this.lastChild.classList.add(Et.sliderLastTick),this.sliderContainer.classList.add(Et.scale+"-"+this.ticks.placement.toLowerCase()),"h"===t?(this.firstChild.style.width=e/2+"%",this.lastChild.style.width=e/2+"%"):(this.firstChild.style.height=e/2+"%",this.lastChild.style.height=e/2+"%");var s={ticksWrapper:this.ul,tickElements:this.tickElementCollection};i&&this.trigger("renderedTicks",s),this.scaleAlignment()},s.prototype.createTick=function(t,i){var s=this.createElement("span",{className:Et.tickValue+" "+Et.tick+"-"+this.ticks.placement.toLowerCase(),attrs:{role:"presentation","aria-hidden":"true"}});t.appendChild(s),e.isNullOrUndefined(this.customValues)?this.formatTicksValue(t,i,s):this.enableHtmlSanitizer?s.innerHTML=e.SanitizeHtmlHelper.sanitize(i.toString()):s.innerHTML=i.toString()},s.prototype.formatTicksValue=function(t,i,s){var n=this,a=this.formatNumber(i),r={value:i,text:e.isNullOrUndefined(this.ticks)||e.isNullOrUndefined(this.ticks.format)?a:this.formatString(i,this.ticksFormatInfo).formatString,tickElement:t};this.trigger("renderingTicks",r,function(i){t.setAttribute("title",i.text.toString()),s&&(n.enableHtmlSanitizer?s.innerHTML=e.SanitizeHtmlHelper.sanitize(i.text.toString()):s.innerHTML=i.text.toString())})},s.prototype.scaleAlignment=function(){this.tickValuePosition(),"Vertical"===this.orientation?this.element.getBoundingClientRect().width<=15?this.sliderContainer.classList.add(Et.sliderSmallSize):this.sliderContainer.classList.remove(Et.sliderSmallSize):this.element.getBoundingClientRect().height<=15?this.sliderContainer.classList.add(Et.sliderSmallSize):this.sliderContainer.classList.remove(Et.sliderSmallSize)},s.prototype.tickValuePosition=function(){this.firstChild=this.element.querySelector("ul").children[0];var t,i,s=this.firstChild.getBoundingClientRect(),n=this.ticks.smallStep,a=Math.abs(parseFloat(e.formatUnit(this.max))-parseFloat(e.formatUnit(this.min)))/n;this.firstChild.children.length>0&&(t=this.firstChild.children[0].getBoundingClientRect());var r,l=[this.sliderContainer.querySelectorAll("."+Et.tick+"."+Et.large+" ."+Et.tickValue)];r="Both"===this.ticks.placement?[].slice.call(l[0],2):[].slice.call(l[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=-t.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=-t.width/2+"px";for(h=0;h<r.length;h++)i=r[h].getBoundingClientRect(),"Vertical"===this.orientation?e.setStyleAttribute(r[h],{top:(o-i.height)/2+"px"}):e.setStyleAttribute(r[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.sliderLastTick),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.sliderLastTick),this.firstChild.style.left=this.firstHandle.style.left)),"Vertical"===this.orientation&&this.firstChild.classList.remove(Et.sliderLastTick))},s.prototype.setAriaAttrValue=function(t){var i,s=!e.isNullOrUndefined(this.ticks)&&!e.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(t),"Range"!==this.type?e.attributes(t,{"aria-valuenow":a,"aria-valuetext":n}):this.enableRtl?t===this.firstHandle?e.attributes(t,{"aria-valuenow":a.split(" - ")[1],"aria-valuetext":i[1]}):e.attributes(t,{"aria-valuenow":a.split(" - ")[0],"aria-valuetext":i[0]}):t===this.firstHandle?e.attributes(t,{"aria-valuenow":a.split(" - ")[0],"aria-valuetext":i[0]}):e.attributes(t,{"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(t){return t="MinRange"===this.type||"Default"===this.type?this.getLimitValueAndPosition(t,this.limits.minStart,this.limits.minEnd)[0]:1===this.activeHandle?this.getLimitValueAndPosition(t,this.limits.minStart,this.limits.minEnd)[0]:this.getLimitValueAndPosition(t,this.limits.maxStart,this.limits.maxEnd)[0]},s.prototype.focusSliderElement=function(){this.isElementFocused||(this.element.focus(),this.isElementFocused=!0)},s.prototype.buttonClick=function(t){this.focusSliderElement();var i,s=this.enableRtl&&"Vertical"!==this.orientation,n=this.handleValueUpdate();40===t.keyCode||37===t.keyCode||t.currentTarget.classList.contains(Et.firstButton)?i=s?this.add(n,parseFloat(this.step.toString()),!0):this.add(n,parseFloat(this.step.toString()),!1):38===t.keyCode||39===t.keyCode||t.currentTarget.classList.contains(Et.secondButton)?i=s?this.add(n,parseFloat(this.step.toString()),!1):this.add(n,parseFloat(this.step.toString()),!0):33===t.keyCode||t.currentTarget.classList.contains(Et.firstButton)?i=s?this.add(n,parseFloat(this.ticks.largeStep.toString()),!1):this.add(n,parseFloat(this.ticks.largeStep.toString()),!0):34===t.keyCode||t.currentTarget.classList.contains(Et.secondButton)?i=s?this.add(n,parseFloat(this.ticks.largeStep.toString()),!0):this.add(n,parseFloat(this.ticks.largeStep.toString()),!1):36===t.keyCode?i=parseFloat(this.min<this.max?this.min.toString():this.max.toString()):35===t.keyCode&&(i=parseFloat(this.min<this.max?this.max.toString():this.min.toString())),this.limits.enabled&&(i=this.getLimitCorrectedValues(i)),this.changeHandleValue(i),!this.isMaterial&&!this.isMaterial3||this.tooltip.isVisible||this.getHandle().classList.contains(Et.sliderTabHandle)||this.materialChange(),this.tooltipToggle(this.getHandle()),this.getHandle().focus(),this.focusHandle(),t.currentTarget.classList.contains(Et.firstButton)&&e.EventHandler.add(this.firstBtn,"mouseup touchend",this.buttonUp,this),t.currentTarget.classList.contains(Et.secondButton)&&e.EventHandler.add(this.secondBtn,"mouseup touchend",this.buttonUp,this)},s.prototype.tooltipToggle=function(t){this.isMaterialTooltip?this.tooltipElement.classList.contains(Et.materialTooltipOpen)?this.refreshTooltip(this.firstHandle):this.openMaterialTooltip():this.tooltipElement?this.refreshTooltip(t):this.openTooltip(t)},s.prototype.buttonUp=function(t){t.currentTarget.classList.contains(Et.firstButton)&&e.EventHandler.remove(this.firstBtn,"mouseup touchend",this.buttonUp),t.currentTarget.classList.contains(Et.secondButton)&&e.EventHandler.remove(this.secondBtn,"mouseup touchend",this.buttonUp)},s.prototype.setRangeBar=function(){"Horizontal"!==this.orientation||e.isNullOrUndefined(this.rangeBar)?e.isNullOrUndefined(this.rangeBar)||("MinRange"===this.type?(this.rangeBar.style.bottom=this.min>this.max?this.handlePos1+"px":"0px",e.setStyleAttribute(this.rangeBar,{height:e.isNullOrUndefined(this.handlePos1)?0:this.min>this.max?this.element.clientHeight-this.handlePos1+"px":this.handlePos1+"px"})):(this.rangeBar.style.bottom=this.min>this.max?this.handlePos2+"px":this.handlePos1+"px",e.setStyleAttribute(this.rangeBar,{height:this.min>this.max?this.handlePos1-this.handlePos2+"px":this.handlePos2-this.handlePos1+"px"}))):"MinRange"===this.type?(this.enableRtl?this.rangeBar.style.right="0px":this.rangeBar.style.left="0px",e.setStyleAttribute(this.rangeBar,{width:e.isNullOrUndefined(this.handlePos1)?0:this.handlePos1+"px"})):(this.enableRtl?this.rangeBar.style.right=this.handlePos1+"px":this.rangeBar.style.left=this.handlePos1+"px",e.setStyleAttribute(this.rangeBar,{width:this.handlePos2-this.handlePos1+"px"}))},s.prototype.checkValidValueAndPos=function(t){return t=this.checkHandleValue(t),t=this.checkHandlePosition(t)},s.prototype.setLimitBarPositions=function(t,e,i,s){"Horizontal"===this.orientation?this.enableRtl?(this.limitBarFirst.style.right=t+"px",this.limitBarFirst.style.width=e-t+"px"):(this.limitBarFirst.style.left=t+"px",this.limitBarFirst.style.width=e-t+"px"):(this.limitBarFirst.style.bottom=(this.min<this.max?t:e)+"px",this.limitBarFirst.style.height=(this.min<this.max?e-t: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=(this.min<this.max?i:s)+"px",this.limitBarSecond.style.height=(this.min<this.max?s-i:i-s)+"px"))},s.prototype.setLimitBar=function(){if("Default"===this.type||"MinRange"===this.type){var t=this.getLimitValueAndPosition(this.limits.minStart,this.limits.minStart,this.limits.minEnd,!0)[0];t=this.checkValidValueAndPos(t);var e=this.getLimitValueAndPosition(this.limits.minEnd,this.limits.minStart,this.limits.minEnd,!0)[0];e=this.checkValidValueAndPos(e),this.setLimitBarPositions(t,e)}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(t,i,s,n){return e.isNullOrUndefined(i)&&(i=this.min<this.max?this.min:this.max,e.isNullOrUndefined(t)&&n&&(t=i)),e.isNullOrUndefined(s)&&(s=this.min<this.max?this.max:this.min,e.isNullOrUndefined(t)&&n&&(t=s)),t<i&&(t=i),t>s&&(t=s),[t,this.checkHandlePosition(t)]},s.prototype.setValue=function(){if(!e.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&(this.min=0,this.max=this.customValues.length-1,this.setBarColor()),this.setAriaAttributes(this.firstHandle),this.handleVal1=e.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,e.isNullOrUndefined(this.activeHandle)&&(this.activeHandle="Range"===this.type?2:1),"Default"===this.type||"MinRange"===this.type){if(this.limits.enabled){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.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(e.formatUnit(this.min)),parseFloat(e.formatUnit(this.max))])},s.prototype.validateRangeValue=function(){this.rangeValueUpdate(),this.setRangeValue()},s.prototype.modifyZindex=function(){"Range"!==this.type||e.isNullOrUndefined(this.firstHandle)||e.isNullOrUndefined(this.secondHandle)?this.isMaterialTooltip&&this.tooltipElement&&(this.tooltipElement.style.zIndex=i.getZindexPartial(this.element)+""):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+"")},s.prototype.setHandlePosition=function(t){var i,s=this,n=1===this.activeHandle?this.handlePos1:this.handlePos2;i=this.isMaterialTooltip?[this.firstHandle,this.materialHandle]:[this.getHandle()],this.handleStart(),i.forEach(function(t){e.isNullOrUndefined(t)||("Horizontal"===s.orientation?s.enableRtl?t.style.right=n+"px":t.style.left=n+"px":t.style.bottom=n+"px")}),this.changeEvent("change",t)},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(t,e){var i="change"===t?this.previousVal:this.previousChanged;if("Range"!==this.type)this.setProperties({value:this.handleVal1},!0),i===this.value||this.isMaterialTooltip&&this.initialTooltip||(this.trigger(t,this.changeEventArgs(t,e)),this.initialTooltip=!0,this.setPreviousVal(t,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(t,this.changeEventArgs(t,e)),this.initialTooltip=!0,this.setPreviousVal(t,this.value)),this.setAriaAttrValue(this.getHandle())}this.hiddenInput.value=this.value.toString()},s.prototype.changeEventArgs=function(t,i){var s;return this.tooltip.isVisible&&this.tooltipObj&&this.initialTooltip?(this.tooltipValue(),s={value:this.value,previousValue:"change"===t?this.previousVal:this.previousChanged,action:t,text:"function"==typeof this.tooltipObj.content?this.tooltipObj.content():this.tooltipObj.content,isInteracted:!e.isNullOrUndefined(i)}):s={value:this.value,previousValue:"change"===t?this.previousVal:this.previousChanged,action:t,text:e.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:!e.isNullOrUndefined(i)},s},s.prototype.setPreviousVal=function(t,e){"change"===t?this.previousVal=e:this.previousChanged=e},s.prototype.updateRangeValue=function(){var t=this.value.toString().split(",").map(Number);if(this.enableRtl&&"Vertical"!==this.orientation||this.rtl?this.value=[t[1],t[0]]:this.value=[t[0],t[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.min<this.max&&this.handlePos1>this.handlePos2&&(this.handlePos1=this.handlePos2,this.handleVal1=this.handleVal2),this.min>this.max&&this.handlePos1<this.handlePos2&&(this.handlePos2=this.handlePos1,this.handleVal2=this.handleVal1),this.preHandlePos1=this.handlePos1,this.preHandlePos2=this.handlePos2,this.limits.enabled){this.activeHandle=1;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.activeHandle=2,e=this.getLimitValueAndPosition(this.handleVal2,this.limits.maxStart,this.limits.maxEnd),this.handleVal2=e[0],this.handlePos2=e[1],this.preHandlePos2=this.handlePos2}},s.prototype.checkHandlePosition=function(t){var i;return t=100*(t-parseFloat(e.formatUnit(this.min)))/(parseFloat(e.formatUnit(this.max))-parseFloat(e.formatUnit(this.min))),i="Horizontal"===this.orientation?this.element.getBoundingClientRect().width*(t/100):this.element.getBoundingClientRect().height*(t/100),parseFloat(e.formatUnit(this.max))===parseFloat(e.formatUnit(this.min))&&(i="Horizontal"===this.orientation?this.element.getBoundingClientRect().width:this.element.getBoundingClientRect().height),i},s.prototype.checkHandleValue=function(t){if(this.min===this.max)return parseFloat(e.formatUnit(this.max));var i=this.tempStartEnd();return t<i.start?t=i.start:t>i.end&&(t=i.end),t},s.prototype.reposition=function(){var t=this;e.isNullOrUndefined(this.firstHandle)||(this.firstHandle.style.transition="none"),"Default"===this.type||e.isNullOrUndefined(this.rangeBar)||(this.rangeBar.style.transition="none"),"Range"!==this.type||e.isNullOrUndefined(this.secondHandle)||(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&&!e.isNullOrUndefined(this.materialHandle)&&(this.enableRtl?this.materialHandle.style.right=this.handlePos1+"px":this.materialHandle.style.left=this.handlePos1+"px"),"MinRange"!==this.type||e.isNullOrUndefined(this.rangeBar)?"Range"!==this.type||e.isNullOrUndefined(this.secondHandle)||e.isNullOrUndefined(this.rangeBar)||(this.enableRtl?(this.secondHandle.style.right=this.handlePos2+"px",this.rangeBar.style.right=this.handlePos1+"px"):(this.secondHandle.style.left=this.handlePos2+"px",this.rangeBar.style.left=this.handlePos1+"px"),e.setStyleAttribute(this.rangeBar,{width:this.handlePos2-this.handlePos1+"px"})):(this.enableRtl?this.rangeBar.style.right="0px":this.rangeBar.style.left="0px",e.setStyleAttribute(this.rangeBar,{width:e.isNullOrUndefined(this.handlePos1)?0: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=this.min>this.max?this.handlePos1+"px":"0px",e.setStyleAttribute(this.rangeBar,{height:e.isNullOrUndefined(this.handlePos1)?0:this.min>this.max?this.element.clientHeight-this.handlePos1+"px":this.handlePos1+"px"})):"Range"===this.type&&(this.secondHandle.style.bottom=this.handlePos2+"px",this.rangeBar.style.bottom=this.min>this.max?this.handlePos2+"px":this.handlePos1+"px",e.setStyleAttribute(this.rangeBar,{height:this.min>this.max?this.handlePos1-this.handlePos2+"px":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.isNullOrUndefined(t.firstHandle)||(t.firstHandle.style.transition=t.scaleTransform),"Range"!==t.type||e.isNullOrUndefined(t.secondHandle)||(t.secondHandle.style.transition=t.scaleTransform)}),this.refreshTooltip(this.tooltipTarget),this.setBarColor()},s.prototype.changeHandleValue=function(t){var e=null;1===this.activeHandle?(this.limits.enabled&&this.limits.startHandleFixed||(this.handleVal1=this.checkHandleValue(t),this.handlePos1=this.checkHandlePosition(this.handleVal1),"Range"===this.type&&(this.handlePos1>this.handlePos2&&this.min<this.max||this.handlePos1<this.handlePos2&&this.min>this.max)&&(this.handlePos1=this.handlePos2,this.handleVal1=this.handleVal2),this.handlePos1!==this.preHandlePos1&&(e=this.preHandlePos1=this.handlePos1)),this.modifyZindex()):(this.limits.enabled&&this.limits.endHandleFixed||(this.handleVal2=this.checkHandleValue(t),this.handlePos2=this.checkHandlePosition(this.handleVal2),"Range"===this.type&&(this.handlePos2<this.handlePos1&&this.min<this.max||this.handlePos2>this.handlePos1&&this.min>this.max)&&(this.handlePos2=this.handlePos1,this.handleVal2=this.handleVal1),this.handlePos2!==this.preHandlePos2&&(e=this.preHandlePos2=this.handlePos2)),this.modifyZindex()),null!==e&&("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(t){if(this.min===this.max)return 100;if("Horizontal"===this.orientation){var e=t.x-this.element.getBoundingClientRect().left,i=this.element.offsetWidth/100;this.val=e/i}else{var s=t.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(t){0===this.step&&(this.step=1);var i=parseFloat(e.formatUnit(this.step))/((parseFloat(e.formatUnit(this.max))-parseFloat(e.formatUnit(this.min)))/100),s=t%Math.abs(i);return 0!==s&&(i/2>s?t-=s:t+=Math.abs(i)-s),t},s.prototype.add=function(t,e,i){var s=Math.pow(10,3);return i?(Math.round(t*s)+Math.round(e*s))/s:(Math.round(t*s)-Math.round(e*s))/s},s.prototype.positionToValue=function(t){var i,s=parseFloat(e.formatUnit(this.max))-parseFloat(e.formatUnit(this.min));return i="Horizontal"===this.orientation?t/this.element.getBoundingClientRect().width*s:t/this.element.getBoundingClientRect().height*s,this.add(i,parseFloat(this.min.toString()),!0)},s.prototype.sliderBarClick=function(t){t.preventDefault();var e;"mousedown"===t.type||"mouseup"===t.type||"click"===t.type?e={x:t.clientX,y:t.clientY}:"touchend"!==t.type&&"touchstart"!==t.type||(e={x:t.changedTouches[0].clientX,y:t.changedTouches[0].clientY});var i=this.xyToPosition(e),s=this.positionToValue(i);if("Range"===this.type&&(this.min<this.max&&this.handlePos2-i<i-this.handlePos1||this.min>this.max&&this.handlePos1-i>i-this.handlePos2))this.activeHandle=2,this.limits.enabled&&this.limits.endHandleFixed||(this.limits.enabled&&(s=(n=this.getLimitValueAndPosition(s,this.limits.maxStart,this.limits.maxEnd))[0],i=n[1]),this.secondHandle.classList.add(Et.sliderActiveHandle),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=this.getLimitValueAndPosition(s,this.limits.minStart,this.limits.minEnd);s=n[0],i=n[1]}this.firstHandle.classList.add(Et.sliderActiveHandle),this.handlePos1=this.preHandlePos1=i,this.handleVal1=s}this.modifyZindex(),this.firstHandle.focus()}this.isMaterialTooltip&&this.tooltipElement.classList.add(Et.materialTooltipActive);var a=this.element.querySelector("."+Et.sliderTabHandle);a&&this.getHandle()!==a&&a.classList.remove(Et.sliderTabHandle);var r=1===this.activeHandle?this.firstHandle:this.secondHandle;if(("click"===t.type||"mousedown"===t.type)&&t.target===r){var l=t.clientX,o=t.clientY;document.elementFromPoint(l,o)}if(this.checkRepeatedValue(s)){var h=(this.isMaterial||this.isMaterial3)&&this.tooltip.isVisible?this.transitionOnMaterialTooltip:this.transition;this.getHandle().style.transition=h.handle,"Default"!==this.type&&(this.rangeBar.style.transition=h.rangeBar),this.setHandlePosition(t),this.isMaterialTooltip&&(this.initialTooltip=!1),t.target!==r&&this.changeEvent("changed",t),"Default"!==this.type&&this.setRangeBar()}},s.prototype.handleValueAdjust=function(t,e,i){1===i?(this.handleVal1=e,this.handleVal2=this.handleVal1+this.minDiff):2===i&&(this.handleVal2=e,this.handleVal1=this.handleVal2-this.minDiff),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.handlePos2=this.checkHandlePosition(this.handleVal2)},s.prototype.dragRangeBarMove=function(t){var e,i;"touchmove"!==t.type&&t.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"===t.type?(n=(e=[t.clientX,t.clientY])[0],a=e[1]):(n=(i=[t.changedTouches[0].clientX,t.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.min>this.max?(this.handlePos2=this.xyToPosition(s),this.handleVal2=this.positionToValue(this.handlePos2)):(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.min>this.max?(this.handlePos1=this.xyToPosition(s),this.handleVal1=this.positionToValue(this.handlePos1)):(this.handlePos2=this.xyToPosition(s),this.handleVal2=this.positionToValue(this.handlePos2)),this.limits.enabled){var r=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd);this.handleVal1=r[0],this.handlePos1=r[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),r=this.getLimitValueAndPosition(this.handleVal2,this.limits.maxStart,this.limits.maxEnd),this.handleVal2=r[0],this.handlePos2=r[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.min>this.max?this.min:this.max)&&this.handleValueAdjust(this.handleVal2,this.min>this.max?this.min:this.max,2),this.handleVal1===(this.min>this.max?this.max:this.min)&&this.handleValueAdjust(this.handleVal1,this.min>this.max?this.max:this.min,1)}this.activeHandle=1,this.setHandlePosition(t),this.activeHandle=2,this.setHandlePosition(t),this.tooltipToggle(this.rangeBar),this.setRangeBar()},s.prototype.sliderBarUp=function(t){this.changeEvent("changed",t),this.handleFocusOut(),this.firstHandle.classList.remove(Et.sliderActiveHandle),"Range"===this.type&&(this.initialTooltip=!1,this.secondHandle.classList.remove(Et.sliderActiveHandle)),this.closeTooltip(),(this.isMaterial||this.isMaterial3)&&(this.getHandle().classList.remove("e-large-thumb-size"),this.isMaterialTooltip&&this.tooltipElement.classList.remove(Et.materialTooltipActive)),e.EventHandler.remove(document,"mousemove touchmove",this.sliderBarMove),e.EventHandler.remove(document,"mouseup touchend",this.sliderBarUp)},s.prototype.sliderBarMove=function(t){"touchmove"!==t.type&&t.preventDefault();var e;e="mousemove"===t.type?{x:t.clientX,y:t.clientY}:{x:t.changedTouches[0].clientX,y:t.changedTouches[0].clientY};var i=this.xyToPosition(e),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(Et.sliderActiveHandle)}if("Range"===this.type)if(1===this.activeHandle)this.firstHandle.classList.add(Et.sliderActiveHandle),this.limits.enabled&&this.limits.startHandleFixed||((this.min<this.max&&i>this.handlePos2||this.min>this.max&&i<this.handlePos2)&&(i=this.handlePos2,s=this.handleVal2),i!==this.preHandlePos1&&(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(Et.sliderActiveHandle),!(this.limits.enabled&&this.limits.endHandleFixed||((this.min<this.max&&i<this.handlePos1||this.min>this.max&&i>this.handlePos1)&&(i=this.handlePos1,s=this.handleVal1),i===this.preHandlePos2)))){if(this.limits.enabled){var a=this.getLimitValueAndPosition(s,this.limits.maxStart,this.limits.maxEnd);s=a[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(t),!this.isMaterial&&!this.isMaterial3||this.tooltip.isVisible||this.getHandle().classList.contains(Et.sliderTabHandle)||this.materialChange(),this.tooltipToggle(this.getHandle()),"Default"!==this.type&&this.setRangeBar())},s.prototype.dragRangeBarUp=function(t){this.rangeBarDragged?this.isDragComplete=!0:(this.focusSliderElement(),this.sliderBarClick(t)),this.changeEvent("changed",t),this.closeTooltip(),e.EventHandler.remove(document,"mousemove touchmove",this.dragRangeBarMove),e.EventHandler.remove(document,"mouseup touchend",this.dragRangeBarUp),this.rangeBarDragged=!1},s.prototype.checkRepeatedValue=function(t){if("Range"===this.type){if(t===(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(t===this.previousVal)return 0;return 1},s.prototype.refreshTooltip=function(t){this.tooltip.isVisible&&this.tooltipObj&&(this.tooltipValue(),t&&(this.tooltipObj.refresh(t),this.tooltipTarget=t))},s.prototype.openTooltip=function(t){this.tooltip.isVisible&&this.tooltipObj&&!this.isMaterialTooltip&&(this.tooltipValue(),this.tooltipObj.open(t),this.tooltipTarget=t)},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(t){switch(t.keyCode){case 37:case 38:case 39:case 40:case 33:case 34:case 36:case 35:t.preventDefault(),this.buttonClick(t)}},s.prototype.wireButtonEvt=function(t){t?(e.EventHandler.remove(this.firstBtn,"mouseleave touchleave",this.buttonFocusOut),e.EventHandler.remove(this.secondBtn,"mouseleave touchleave",this.buttonFocusOut),e.EventHandler.remove(this.firstBtn,"mousedown touchstart",this.repeatHandlerMouse),e.EventHandler.remove(this.firstBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp),e.EventHandler.remove(this.secondBtn,"mousedown touchstart",this.repeatHandlerMouse),e.EventHandler.remove(this.secondBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp),e.EventHandler.remove(this.firstBtn,"focusout",this.sliderFocusOut),e.EventHandler.remove(this.secondBtn,"focusout",this.sliderFocusOut)):(e.EventHandler.add(this.firstBtn,"mouseleave touchleave",this.buttonFocusOut,this),e.EventHandler.add(this.secondBtn,"mouseleave touchleave",this.buttonFocusOut,this),e.EventHandler.add(this.firstBtn,"mousedown touchstart",this.repeatHandlerMouse,this),e.EventHandler.add(this.firstBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp,this),e.EventHandler.add(this.secondBtn,"mousedown touchstart",this.repeatHandlerMouse,this),e.EventHandler.add(this.secondBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp,this),e.EventHandler.add(this.firstBtn,"focusout",this.sliderFocusOut,this),e.EventHandler.add(this.secondBtn,"focusout",this.sliderFocusOut,this))},s.prototype.rangeBarMousedown=function(t){var i,s;if(t.preventDefault(),this.focusSliderElement(),"Range"===this.type&&this.drag&&t.target===this.rangeBar){var n=void 0,a=void 0;"mousedown"===t.type?(n=(i=[t.clientX,t.clientY])[0],a=i[1]):"touchstart"===t.type&&(n=(s=[t.changedTouches[0].clientX,t.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 r=this.element.querySelector("."+Et.sliderTabHandle);r&&r.classList.remove(Et.sliderTabHandle),e.EventHandler.add(document,"mousemove touchmove",this.dragRangeBarMove,this),e.EventHandler.add(document,"mouseup touchend",this.dragRangeBarUp,this)}},s.prototype.elementClick=function(t){if(this.isDragComplete)return void(this.isDragComplete=!1);t.preventDefault(),this.focusSliderElement(),this.sliderBarClick(t),this.focusHandle()},s.prototype.wireEvents=function(){this.onresize=this.reposition.bind(this),window.addEventListener("resize",this.onresize),this.enabled&&!this.readonly&&(e.EventHandler.add(this.element,"click",this.elementClick,this),"Range"===this.type&&this.drag&&e.EventHandler.add(this.rangeBar,"mousedown touchstart",this.rangeBarMousedown,this),e.EventHandler.add(this.sliderContainer,"keydown",this.keyDown,this),e.EventHandler.add(this.sliderContainer,"keyup",this.keyUp,this),e.EventHandler.add(this.element,"focusout",this.sliderFocusOut,this),e.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&&e.EventHandler.add(this.formElement,"reset",this.formResetHandler,this))},s.prototype.unwireEvents=function(){e.EventHandler.remove(this.element,"click",this.elementClick),"Range"===this.type&&this.drag&&e.EventHandler.remove(this.rangeBar,"mousedown touchstart",this.rangeBarMousedown),e.EventHandler.remove(this.sliderContainer,"keydown",this.keyDown),e.EventHandler.remove(this.sliderContainer,"keyup",this.keyUp),e.EventHandler.remove(this.element,"focusout",this.sliderFocusOut),e.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),e.EventHandler.remove(this.element,"reset",this.formResetHandler)},s.prototype.formResetHandler=function(){this.setProperties({value:this.formResetValue},!0),this.setValue()},s.prototype.keyUp=function(t){if(9===t.keyCode&&t.target.classList.contains(Et.sliderHandle)&&(this.focusSliderElement(),!t.target.classList.contains(Et.sliderTabHandle))){this.element.querySelector("."+Et.sliderTabHandle)&&this.element.querySelector("."+Et.sliderTabHandle).classList.remove(Et.sliderTabHandle),t.target.classList.add(Et.sliderTabHandle);var e=t.target.parentElement;if(e===this.element&&(e.querySelector("."+Et.sliderTrack).classList.add(Et.sliderTabTrack),"Range"!==this.type&&"MinRange"!==this.type||e.querySelector("."+Et.rangeBar).classList.add(Et.sliderTabRange)),"Range"===this.type){var i=t.target.previousSibling;i&&i.classList.contains(Et.sliderHandle)?this.activeHandle=2:this.activeHandle=1}this.getHandle().focus(),this.tooltipToggle(this.getHandle())}this.closeTooltip(),this.changeEvent("changed",t)},s.prototype.hover=function(t){if(!e.isNullOrUndefined(t))if("mouseover"===t.type||"touchmove"===t.type||"mousemove"===t.type||"pointermove"===t.type||"touchstart"===t.type)this.sliderContainer.classList.add(Et.sliderHover);else{this.sliderContainer.classList.remove(Et.sliderHover);var i=t.currentTarget;this.tooltip.isVisible&&"Always"!==this.tooltip.showOn&&this.tooltipObj&&this.isMaterialTooltip&&!i.classList.contains(Et.sliderHandleFocused)&&!i.classList.contains(Et.sliderTabHandle)&&this.closeMaterialTooltip()}},s.prototype.sliderFocusOut=function(t){t.relatedTarget!==this.secondHandle&&t.relatedTarget!==this.firstHandle&&t.relatedTarget!==this.element&&t.relatedTarget!==this.firstBtn&&t.relatedTarget!==this.secondBtn&&(this.closeMaterialTooltip(),this.closeTooltip(),this.element.querySelector("."+Et.sliderTabHandle)&&this.element.querySelector("."+Et.sliderTabHandle).classList.remove(Et.sliderTabHandle),this.element.querySelector("."+Et.sliderTabTrack)&&(this.element.querySelector("."+Et.sliderTabTrack).classList.remove(Et.sliderTabTrack),"Range"!==this.type&&"MinRange"!==this.type||!this.element.querySelector("."+Et.sliderTabRange)||this.element.querySelector("."+Et.sliderTabRange).classList.remove(Et.sliderTabRange)),this.hiddenInput.focus(),this.hiddenInput.blur(),this.isElementFocused=!1)},s.prototype.removeElement=function(t){t.parentNode&&t.parentNode.removeChild(t)},s.prototype.changeSliderType=function(t,i){this.isMaterialTooltip&&this.materialHandle&&(this.sliderContainer.classList.remove(Et.materialSlider),this.removeElement(this.materialHandle),this.materialHandle=void 0),this.removeElement(this.firstHandle),this.firstHandle=void 0,"Default"!==t&&("Range"===t&&(this.removeElement(this.secondHandle),this.secondHandle=void 0),this.removeElement(this.rangeBar),this.rangeBar=void 0),this.tooltip.isVisible&&!e.isNullOrUndefined(this.tooltipObj)&&(this.tooltipObj.destroy(),this.tooltipElement=void 0,this.tooltipCollidedPosition=void 0),this.limits.enabled&&("MinRange"===t||"Default"===t?e.isNullOrUndefined(this.limitBarFirst)||(this.removeElement(this.limitBarFirst),this.limitBarFirst=void 0):e.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(!this.enabled),"Range"===this.type&&this.wireSecondHandleEvt(!this.enabled),this.setValue(),this.tooltip.isVisible&&(this.renderTooltip(),this.wireMaterialTooltipEvent(!1)),this.setBarColor(),"tooltip"!==i&&this.updateConfig(),this.readonly&&(this.sliderContainer.classList.remove(Et.readonly),this.setReadOnly())},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 t=this.enableRtl&&"Vertical"!==this.orientation;e.attributes(t?this.secondBtn:this.firstBtn,{"aria-label":"Decrease",title:"Decrease"}),e.attributes(t?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?(e.isNullOrUndefined(this.limitBarFirst)&&"Range"!==this.type&&this.createLimitBar(),e.isNullOrUndefined(this.limitBarFirst)&&e.isNullOrUndefined(this.limitBarSecond)&&"Range"===this.type&&this.createLimitBar(),this.setLimitBar(),this.setValue()):(e.isNullOrUndefined(this.limitBarFirst)||e.detach(this.limitBarFirst),e.isNullOrUndefined(this.limitBarSecond)||e.detach(this.limitBarSecond))},s.prototype.getPersistData=function(){var t=["value"];return this.addOnPersist(t)},s.prototype.destroy=function(){t.prototype.destroy.call(this),this.unwireEvents(),window.removeEventListener("resize",this.onresize),e.removeClass([this.sliderContainer],[Et.sliderDisabled]),this.firstHandle.removeAttribute("aria-orientation"),"Range"===this.type&&this.secondHandle.removeAttribute("aria-orientation"),this.sliderContainer.parentNode&&this.sliderContainer.parentNode.insertBefore(this.element,this.sliderContainer),e.detach(this.sliderContainer),this.tooltip.isVisible&&this.tooltipObj.destroy(),this.element.innerHTML="",this.hiddenInput=null,this.sliderContainer=null,this.sliderTrack=null,this.rangeBar=null,this.firstHandle=null,this.secondHandle=null,this.tickElementCollection=null,this.ul=null,this.firstBtn=null,this.secondBtn=null,this.materialHandle=null,this.tooltipObj=null,this.tooltipTarget=null,this.limitBarFirst=null,this.limitBarSecond=null,this.firstChild=null,this.lastChild=null,this.tooltipElement=null},s.prototype.onPropertyChanged=function(t,i){for(var s=this,n=0,a=Object.keys(t);n<a.length;n++){var r=a[n];switch(r){case"cssClass":this.setCSSClass(i.cssClass);break;case"value":if(t&&i){var l=e.isNullOrUndefined(t.value)?"Range"===this.type?[this.min,this.max]:this.min:t.value;this.setProperties({value:l},!0),e.isNullOrUndefined(i.value)||i.value.toString()===l.toString()||(this.setValue(),this.refreshTooltip(this.tooltipTarget),"Range"===this.type&&(e.isNullOrUndefined(t.value)||i.value[1]===l[1]?this.activeHandle=1:this.activeHandle=2))}break;case"min":case"step":case"max":this.setMinMaxValue();break;case"tooltip":e.isNullOrUndefined(t.tooltip)||e.isNullOrUndefined(i.tooltip)||(this.initialTooltip=!0,this.setTooltip(r),this.showButtons||this.wireEvents());break;case"type":e.isNullOrUndefined(i)||!Object.keys(i).length||e.isNullOrUndefined(i.type)||(this.changeSliderType(i.type,r),this.setZindex());break;case"enableRtl":i.enableRtl!==t.enableRtl&&"Vertical"!==this.orientation&&(this.rtl=i.enableRtl,this.changeRtl());break;case"limits":this.limitsPropertyChange();break;case"orientation":this.changeOrientation();break;case"ticks":e.isNullOrUndefined(this.sliderContainer.querySelector("."+Et.scale))||(e.detach(this.ul),Array.prototype.forEach.call(this.sliderContainer.classList,function(t){t.match(/e-scale-/)&&s.sliderContainer.classList.remove(t)})),"None"!==this.ticks.placement&&(this.renderScale(),this.setZindex());break;case"locale":this.showButtons&&this.buttonTitle();break;case"showButtons":t.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(Et.sliderButtonClass),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(t.width),this.setMinMaxValue(),this.limits&&this.limitsPropertyChange()}}},s.prototype.setReadOnly=function(){this.readonly?(this.unwireEvents(),this.sliderContainer.classList.add(Et.readonly)):(this.wireEvents(),this.sliderContainer.classList.remove(Et.readonly))},s.prototype.setMinMaxValue=function(){var t=this;this.setValue(),this.refreshTooltip(this.tooltipTarget),e.isNullOrUndefined(this.sliderContainer.querySelector("."+Et.scale))||this.ul&&(e.detach(this.ul),Array.prototype.forEach.call(this.sliderContainer.classList,function(e){e.match(/e-scale-/)&&t.sliderContainer.classList.remove(e)})),"None"!==this.ticks.placement&&(this.renderScale(),this.setZindex())},s.prototype.setZindex=function(){this.zIndex=6,e.isNullOrUndefined(this.ticks)||"None"===this.ticks.placement||e.isNullOrUndefined(this.ul)||e.isNullOrUndefined(this.element)||(this.ul.style.zIndex=this.zIndex+-7+"",this.element.style.zIndex=this.zIndex+2+""),this.isMaterial||this.isMaterial3||e.isNullOrUndefined(this.ticks)||"Both"!==this.ticks.placement||(this.element.style.zIndex=this.zIndex+2+""),e.isNullOrUndefined(this.firstHandle)||(this.firstHandle.style.zIndex=this.zIndex+3+""),"Range"!==this.type||e.isNullOrUndefined(this.secondHandle)||(this.secondHandle.style.zIndex=this.zIndex+4+"")},s.prototype.setTooltip=function(t){this.changeSliderType(this.type,t)},s.prototype.setBarColor=function(){for(var t,i,s=this.sliderTrack.lastElementChild;s;)this.sliderTrack.removeChild(s),s=this.sliderTrack.lastElementChild;for(var n=0;n<this.colorRange.length;n++)if(!e.isNullOrUndefined(this.colorRange[n].start)&&!e.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),r=this.checkHandlePosition(this.colorRange[n].end),l=this.createElement("div");l.style.backgroundColor=this.colorRange[n].color,l.style.border="1px solid "+this.colorRange[n].color,"Horizontal"===this.orientation?(i=Et.sliderHorizantalColor,t=this.enableRtl?e.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),l.style.width=r-a+"px",l.style.left=t+"px"):(i=Et.sliderVerticalColor,t=this.checkHandlePosition(this.colorRange[n].start),l.style.height=r-a+"px",l.style.bottom=t+"px"),l.classList.add(i),this.sliderTrack.appendChild(l)}},s.prototype.getModuleName=function(){return"slider"},ft([e.Property(null)],s.prototype,"value",void 0),ft([e.Property(null)],s.prototype,"customValues",void 0),ft([e.Property(1)],s.prototype,"step",void 0),ft([e.Property(null)],s.prototype,"width",void 0),ft([e.Property(0)],s.prototype,"min",void 0),ft([e.Property(100)],s.prototype,"max",void 0),ft([e.Property(!1)],s.prototype,"readonly",void 0),ft([e.Property("Default")],s.prototype,"type",void 0),ft([e.Collection([{}],yt)],s.prototype,"colorRange",void 0),ft([e.Complex({},gt)],s.prototype,"ticks",void 0),ft([e.Complex({},bt)],s.prototype,"limits",void 0),ft([e.Property(!0)],s.prototype,"enabled",void 0),ft([e.Complex({},Ct)],s.prototype,"tooltip",void 0),ft([e.Property(!1)],s.prototype,"showButtons",void 0),ft([e.Property(!0)],s.prototype,"enableAnimation",void 0),ft([e.Property("Horizontal")],s.prototype,"orientation",void 0),ft([e.Property("")],s.prototype,"cssClass",void 0),ft([e.Property(!0)],s.prototype,"enableHtmlSanitizer",void 0),ft([e.Event()],s.prototype,"created",void 0),ft([e.Event()],s.prototype,"change",void 0),ft([e.Event()],s.prototype,"changed",void 0),ft([e.Event()],s.prototype,"renderingTicks",void 0),ft([e.Event()],s.prototype,"renderedTicks",void 0),ft([e.Event()],s.prototype,"tooltipChange",void 0),s=ft([e.NotifyPropertyChanges],s)}(e.Component),xt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Tt=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},Pt={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(t){t[t.Message=0]="Message",t[t.Label=1]="Label"}(t.ErrorOption||(t.ErrorOption={}));var kt=function(i){function s(t,s){var n=i.call(this,s,t)||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 e.L10n("formValidator",n.defaultMessages,n.locale),n.locale&&n.localeFunc(),e.onIntlChange.on("notifyExternalChange",n.afterLocalization,n),t="string"==typeof t?e.select(t,document):t,null!=n.element)return n.element.setAttribute("novalidate",""),n.inputElements=e.selectAll(n.selectQuery,n.element),n.createHTML5Rules(),n.wireEvents(),n}xt(s,i),n=s,s.prototype.addRules=function(t,i){t&&(this.rules.hasOwnProperty(t)?e.extend(this.rules[""+t],i,{}):this.rules[""+t]=i)},s.prototype.removeRules=function(t,i){if(t||i)if(this.rules[""+t]&&!i)delete this.rules[""+t];else{if(e.isNullOrUndefined(this.rules[""+t]&&i))return;for(var s=0;s<i.length;s++)delete this.rules[""+t][i[parseInt(s.toString(),10)]]}else this.rules={}},s.prototype.validate=function(t){var e=Object.keys(this.rules);if(t&&e.length)return this.validateRules(t),-1!==e.indexOf(t)&&0===this.errorRules.filter(function(e){return e.name===t}).length;this.errorRules=[];for(var i=0,s=e;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(t){return this.inputElement=e.select('[name="'+t+'"]',this.element),this.inputElement},s.prototype.destroy=function(){this.reset(),this.unwireEvents(),this.rules={};for(var t=0,s=e.selectAll("."+this.errorClass+", ."+this.validClass,this.element);t<s.length;t++){var n=s[t];e.detach(n)}i.prototype.destroy.call(this),this.infoElement=null,e.onIntlChange.off("notifyExternalChange",this.afterLocalization)},s.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"locale":this.localeFunc()}},s.prototype.localeFunc=function(){for(var t=0,e=Object.keys(this.defaultMessages);t<e.length;t++){var i=e[t];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(t){this.locale=t.locale,this.localeFunc()},s.prototype.refresh=function(){this.unwireEvents(),this.inputElements=e.selectAll(this.selectQuery,this.element),this.wireEvents()},s.prototype.clearForm=function(){this.errorRules=[],this.validated=[];for(var t=0,i=e.selectAll(this.selectQuery,this.element);t<i.length;t++){var s=i[t];s.removeAttribute("aria-invalid");var n=s.parentElement,a=n.parentElement;n.classList.contains("e-control-wrapper")||n.classList.contains("e-wrapper")||s.classList.contains("e-input")&&n.classList.contains("e-input-group")?n.classList.remove(this.errorClass):null!=a&&(a.classList.contains("e-control-wrapper")||a.classList.contains("e-wrapper"))?a.classList.remove(this.errorClass):s.classList.remove(this.errorClass),s.name.length>0&&(this.getInputElement(s.name),this.getErrorElement(s.name),this.hideMessage(s.name)),n.classList.contains("e-control-wrapper")||n.classList.contains("e-wrapper")||s.classList.contains("e-input")&&n.classList.contains("e-input-group")?n.classList.remove(this.validClass):null!=a&&(a.classList.contains("e-control-wrapper")||a.classList.contains("e-wrapper"))?a.classList.remove(this.validClass):s.classList.remove(this.validClass)}},s.prototype.createHTML5Rules=function(){for(var t=["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"],e=["hidden","email","url","date","number","tel"],i=0,s=this.inputElements;i<s.length;i++){for(var n=s[i],a={},r=0,l=t;r<l.length;r++){var o=l[r];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!==e.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(t,e,i,s){var n=i.split("-"),a=["required","creditcard","phone","maxlength","minlength","range","regex","equalto"],r=n[n.length-1],l=n[n.length-2];if(-1!==a.indexOf(r))switch(r){case"required":this.defRule(t,e,"required",s);break;case"creditcard":this.defRule(t,e,"creditcard",s);break;case"phone":this.defRule(t,e,"tel",s)}else if(-1!==a.indexOf(l))switch(l){case"maxlength":this.defRule(t,e,"maxLength",s);break;case"minlength":this.defRule(t,e,"minLength",s);break;case"range":var o=t.getAttribute("data-val-range-min"),h=t.getAttribute("data-val-range-max");this.defRule(t,e,"range",[o,h]);break;case"equalto":var u=t.getAttribute(i).split(".");this.defRule(t,e,"equalTo",u[u.length-1]);break;case"regex":this.defRule(t,e,"regex",s)}},s.prototype.defRule=function(t,e,i,s){var n,a=t.getAttribute("data-"+i+"-message"),r=t.getAttribute("data-val-"+i);this.rules[t.name]&&"validateHidden"!==i&&"hidden"!==i&&(this.getInputElement(t.name),n=this.getErrorMessage(this.rules[t.name][""+i],i)),a?s=[s,a]:r?s=[s,r]:n&&(s=[s,n]),e[""+i]=s},s.prototype.wireEvents=function(){for(var t=0,i=this.inputElements;t<i.length;t++){var s=i[t];n.isCheckable(s)?e.EventHandler.add(s,"click",this.clickHandler,this):"SELECT"===s.tagName?e.EventHandler.add(s,"change",this.changeHandler,this):(e.EventHandler.add(s,"focusout",this.focusOutHandler,this),e.EventHandler.add(s,"keyup",this.keyUpHandler,this))}e.EventHandler.add(this.element,"submit",this.submitHandler,this),e.EventHandler.add(this.element,"reset",this.resetHandler,this)},s.prototype.unwireEvents=function(){for(var t=0,i=this.inputElements;t<i.length;t++){var s=i[t];e.EventHandler.clearEvents(s)}e.EventHandler.remove(this.element,"submit",this.submitHandler),e.EventHandler.remove(this.element,"reset",this.resetHandler)},s.prototype.focusOutHandler=function(t){this.trigger("focusout",t);var e=t.target;this.rules[e.name]&&(this.rules[e.name][this.required]||e.value.length>0?this.validate(e.name):-1===this.validated.indexOf(e.name)&&this.validated.push(e.name))},s.prototype.keyUpHandler=function(t){this.trigger("keyup",t);var e=t.target,i=[16,17,18,20,35,36,37,38,39,40,45,144,225];(9!==t.which||this.rules[e.name]&&(!this.rules[e.name]||this.rules[e.name][this.required]))&&-1!==this.validated.indexOf(e.name)&&this.rules[e.name]&&-1===i.indexOf(t.which)&&this.validate(e.name)},s.prototype.clickHandler=function(t){this.trigger("click",t);var e=t.target;"submit"!==e.type?this.validate(e.name):null!==e.getAttribute("formnovalidate")&&(this.allowSubmit=!0)},s.prototype.changeHandler=function(t){this.trigger("change",t);var e=t.target;this.validate(e.name)},s.prototype.submitHandler=function(t){this.trigger("submit",t),this.allowSubmit||this.validate()?this.allowSubmit=!1:t.preventDefault()},s.prototype.resetHandler=function(){this.clearForm()},s.prototype.validateRules=function(t){if(this.rules[""+t]){var e=Object.keys(this.rules[""+t]),i=!1,s=!1,n=e.indexOf("validateHidden"),a=e.indexOf("hidden");if(this.getInputElement(t),-1!==a&&(i=!0),-1!==n&&(s=!0),!i||i&&s){-1!==n&&e.splice(n,1),-1!==a&&e.splice(a-1,1),this.getErrorElement(t);for(var r=0,l=e;r<l.length;r++){var o=l[r],h=this.getErrorMessage(this.rules[""+t][""+o],o),u={name:t,message:h},p={inputName:t,element:this.inputElement,message:h};if(!this.isValid(t,o)&&!this.inputElement.classList.contains(this.ignore)){this.removeErrorRules(t),this.errorRules.push(u),this.inputElement.setAttribute("aria-invalid","true"),this.inputElement.setAttribute("aria-describedby",this.inputElement.id+"-info");var d=this.inputElement.parentElement,c=d.parentElement;d.classList.contains("e-control-wrapper")||d.classList.contains("e-wrapper")||this.inputElement.classList.contains("e-input")&&d.classList.contains("e-input-group")?(d.classList.add(this.errorClass),d.classList.remove(this.validClass)):null!=c&&(c.classList.contains("e-control-wrapper")||c.classList.contains("e-wrapper"))?(c.classList.add(this.errorClass),c.classList.remove(this.validClass)):(this.inputElement.classList.add(this.errorClass),this.inputElement.classList.remove(this.validClass)),this.infoElement?this.showMessage(u):this.createErrorElement(t,u.message,this.inputElement),p.errorElement=this.infoElement,p.status="failure",d.classList.contains("e-control-wrapper")||d.classList.contains("e-wrapper")||this.inputElement.classList.contains("e-input")&&d.classList.contains("e-input-group")?(d.classList.add(this.errorClass),d.classList.remove(this.validClass)):null!=c&&(c.classList.contains("e-control-wrapper")||c.classList.contains("e-wrapper"))?(c.classList.add(this.errorClass),c.classList.remove(this.validClass)):(this.inputElement.classList.add(this.errorClass),this.inputElement.classList.remove(this.validClass)),this.optionalValidationStatus(t,p),this.trigger("validationComplete",p),"required"===o&&this.inputElement.setAttribute("aria-required","true");break}this.hideMessage(t),p.status="success",this.trigger("validationComplete",p)}}}},s.prototype.optionalValidationStatus=function(t,i){this.rules[""+t][this.required]||this.inputElement.value.length||e.isNullOrUndefined(this.infoElement)||(this.infoElement.innerHTML=this.inputElement.value,this.infoElement.setAttribute("aria-invalid","false"),i.status="",this.hideMessage(t))},s.prototype.isValid=function(t,i){var s=this.rules[""+t][""+i],a=s instanceof Array&&"string"==typeof s[1]?s[0]:s,r=this.rules[""+t][""+i],l="min"!==i&&"max"!==i||!this.rules[""+t].date||"string"!=typeof this.rules[""+t].date?null:this.rules[""+t].date,o={value:this.inputElement.value,param:a,element:this.inputElement,formElement:this.element,format:l,culture:this.locale};return this.trigger("validationBegin",o),!o.param&&"required"===i||(r&&"function"==typeof r[0]?r[0].call(this,{element:this.inputElement,value:this.inputElement.value}):n.isCheckable(this.inputElement)?"required"!==i||e.selectAll('input[name="'+t+'"]:checked',this.element).length>0:n.checkValidator[""+i](o))},s.prototype.getErrorMessage=function(t,i){var s=this.inputElement.getAttribute("data-"+i+"-message")?this.inputElement.getAttribute("data-"+i+"-message"):t instanceof Array&&"string"==typeof t[1]?t[1]:0!==Object.keys(this.localyMessage).length?this.localyMessage[""+i]:this.defaultMessages[""+i],n=s.match(/{(\d)}/g);if(!e.isNullOrUndefined(n))for(var a=0;a<n.length;a++){var r=t instanceof Array?t[parseInt(a.toString(),10)]:t;s=s.replace(n[parseInt(a.toString(),10)],r)}return s},s.prototype.createErrorElement=function(i,s,n){var a=e.createElement(this.errorElement,{className:this.errorClass,innerHTML:s,attrs:{for:i}});if(this.errorOption===t.ErrorOption.Message&&(a.classList.remove(this.errorClass),a.classList.add("e-message"),a=e.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 r=n.getAttribute("data-msg-containerid");e.select("#"+r,this.element).appendChild(a)}else if(null!=this.customPlacement)this.customPlacement.call(this,this.inputElement,a);else{var l=this.inputElement.parentElement,o=l.parentElement;l.classList.contains("e-control-wrapper")||l.classList.contains("e-wrapper")?o.insertBefore(a,l.nextSibling):o.classList.contains("e-control-wrapper")||o.classList.contains("e-wrapper")?o.parentElement.insertBefore(a,o.nextSibling):l.insertBefore(a,this.inputElement.nextSibling)}a.style.display="block",this.getErrorElement(i),this.validated.push(i),this.checkRequired(i)},s.prototype.getErrorElement=function(t){return this.infoElement=e.select(this.errorElement+"."+this.errorClass,this.inputElement.parentElement),this.infoElement||(this.infoElement=e.select(this.errorElement+"."+this.errorClass+'[for="'+t+'"]',this.element)),this.infoElement},s.prototype.removeErrorRules=function(t){for(var e=0;e<this.errorRules.length;e++)this.errorRules[parseInt(e.toString(),10)].name===t&&this.errorRules.splice(e,1)},s.prototype.showMessage=function(t){this.infoElement.style.display="block",this.infoElement.innerHTML=t.message,this.checkRequired(t.name)},s.prototype.hideMessage=function(t){if(this.infoElement){this.infoElement.style.display="none",this.removeErrorRules(t);var e=this.inputElement.parentElement,i=e.parentElement;e.classList.contains("e-control-wrapper")||e.classList.contains("e-wrapper")||this.inputElement.classList.contains("e-input")&&e.classList.contains("e-input-group")?(e.classList.add(this.validClass),e.classList.remove(this.errorClass)):null!=i&&(i.classList.contains("e-control-wrapper")||i.classList.contains("e-wrapper"))?(i.classList.add(this.validClass),i.classList.remove(this.errorClass)):(this.inputElement.classList.add(this.validClass),this.inputElement.classList.remove(this.errorClass)),this.inputElement.setAttribute("aria-invalid","false")}},s.prototype.checkRequired=function(t){this.rules[""+t][this.required]||this.inputElement.value.length||e.isNullOrUndefined(this.infoElement)||(this.infoElement.innerHTML=this.inputElement.value,this.infoElement.setAttribute("aria-invalid","false"),this.hideMessage(t))},s.isCheckable=function(t){var e=t.getAttribute("type");return e&&("checkbox"===e||"radio"===e||"submit"===e)};var n;return s.checkValidator={required:function(t){return isNaN(Date.parse(t.value))?t.value.toString().length>0:!isNaN(new Date(t.value).getTime())},email:function(t){return Pt.EMAIL.test(t.value)},url:function(t){return Pt.URL.test(t.value)},dateIso:function(t){return Pt.DATE_ISO.test(t.value)},tel:function(t){return Pt.PHONE.test(t.value)},creditcard:function(t){return Pt.CREDITCARD.test(t.value)},number:function(t){return!isNaN(Number(t.value))&&-1===String(t.value).indexOf(" ")},digits:function(t){return Pt.DIGITS.test(t.value)},maxLength:function(t){return t.value.length<=Number(t.param)},minLength:function(t){return t.value.length>=Number(t.param)},rangeLength:function(t){var e=t.param;return t.value.length>=e[0]&&t.value.length<=e[1]},range:function(t){var e=t.param;return!isNaN(Number(t.value))&&Number(t.value)>=e[0]&&Number(t.value)<=e[1]},date:function(t){if(e.isNullOrUndefined(t.param)||"string"!=typeof t.param||""===t.param)return!isNaN(new Date(t.value).getTime());var i=t.culture&&""!==t.culture?new e.Internationalization(t.culture):new e.Internationalization,s={format:t.param.toString(),type:"dateTime",skeleton:"yMd"},n=i.parseDate(t.value,s);return!e.isNullOrUndefined(n)&&n instanceof Date&&!isNaN(+n)},max:function(t){if(!isNaN(Number(t.value)))return+t.value<=+t.param;if(t.format&&""!==t.format){var i=t.culture&&""!==t.culture?new e.Internationalization(t.culture):new e.Internationalization,s={format:t.format.toString(),type:"dateTime",skeleton:"yMd"},n=i.parseDate(t.value,s),a="string"==typeof t.param?i.parseDate(JSON.parse(JSON.stringify(t.param)),s):t.param;return new Date(n).getTime()<=new Date(a).getTime()}return new Date(t.value).getTime()<=new Date(JSON.parse(JSON.stringify(t.param))).getTime()},min:function(t){if(isNaN(Number(t.value))){if(-1!==t.value.indexOf(",")){var i=t.value.replace(/,/g,"");return parseFloat(i)>=Number(t.param)}if(t.format&&""!==t.format){var s=t.culture&&""!==t.culture?new e.Internationalization(t.culture):new e.Internationalization,n={format:t.format.toString(),type:"dateTime",skeleton:"yMd"},a=s.parseDate(t.value,n),r="string"==typeof t.param?s.parseDate(JSON.parse(JSON.stringify(t.param)),n):t.param;return new Date(a).getTime()>=new Date(r).getTime()}return new Date(t.value).getTime()>=new Date(JSON.parse(JSON.stringify(t.param))).getTime()}return+t.value>=+t.param},regex:function(t){return new RegExp(t.param).test(t.value)},equalTo:function(t){var e=t.formElement.querySelector("#"+t.param);return t.param=e.value,t.param===t.value}},Tt([e.Property("")],s.prototype,"locale",void 0),Tt([e.Property("e-hidden")],s.prototype,"ignore",void 0),Tt([e.Property()],s.prototype,"rules",void 0),Tt([e.Property("e-error")],s.prototype,"errorClass",void 0),Tt([e.Property("e-valid")],s.prototype,"validClass",void 0),Tt([e.Property("label")],s.prototype,"errorElement",void 0),Tt([e.Property("div")],s.prototype,"errorContainer",void 0),Tt([e.Property(t.ErrorOption.Label)],s.prototype,"errorOption",void 0),Tt([e.Event()],s.prototype,"focusout",void 0),Tt([e.Event()],s.prototype,"keyup",void 0),Tt([e.Event()],s.prototype,"click",void 0),Tt([e.Event()],s.prototype,"change",void 0),Tt([e.Event()],s.prototype,"submit",void 0),Tt([e.Event()],s.prototype,"validationBegin",void 0),Tt([e.Event()],s.prototype,"validationComplete",void 0),Tt([e.Event()],s.prototype,"customPlacement",void 0),s=n=Tt([e.NotifyPropertyChanges],s)}(e.Base),Ot=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),wt=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},Lt="e-upload-file-list",At="e-file-status",Ht="e-file-remove-btn",Nt="e-file-delete-btn",Bt="e-file-abort-btn",It="e-file-reload-btn",Ut="e-upload-progress-wrap",Rt="e-upload-progress-bar",Vt="e-upload-success",Ft="e-upload-fails",Mt="e-file-pause-btn",Dt=["title","style","class"],zt=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Ot(i,t),wt([e.Property("")],i.prototype,"name",void 0),wt([e.Property(null)],i.prototype,"size",void 0),wt([e.Property("")],i.prototype,"type",void 0),i}(e.ChildProperty),Wt=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Ot(i,t),wt([e.Property("Browse...")],i.prototype,"browse",void 0),wt([e.Property("Upload")],i.prototype,"upload",void 0),wt([e.Property("Clear")],i.prototype,"clear",void 0),i}(e.ChildProperty),qt=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Ot(i,t),wt([e.Property("")],i.prototype,"saveUrl",void 0),wt([e.Property("")],i.prototype,"removeUrl",void 0),wt([e.Property(0)],i.prototype,"chunkSize",void 0),wt([e.Property(3)],i.prototype,"retryCount",void 0),wt([e.Property(500)],i.prototype,"retryAfterDelay",void 0),i}(e.ChildProperty),jt=function(t){function s(e,i){var s=t.call(this,e,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=e,s}return Ot(s,t),s.prototype.onPropertyChanged=function(t,i){for(var s=0,n=Object.keys(t);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=e.isNullOrUndefined(this.buttons.browse)?"":this.buttons.browse,this.buttons.clear=e.isNullOrUndefined(this.buttons.clear)?"":this.buttons.clear,this.buttons.upload=e.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.isReact?this.reRenderFileList():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=e.getValue("currentLocale",this.l10n);break;case"cssClass":this.setCSSClass(i.cssClass)}},s.prototype.setLocalizedTexts=function(){e.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&&!e.isNullOrUndefined(this.uploadWrapper.querySelector(".e-file-drop"))&&(this.uploadWrapper.querySelector(".e-file-drop").innerHTML=this.localizedTexts("dropFilesHint"))),this.updateFileList())},s.prototype.getKeyValue=function(t){for(var e,i=0,s=Object.keys(this.preLocaleObj);i<s.length;i++){var n=s[i];this.preLocaleObj[""+n]===t&&(e=n)}return e},s.prototype.updateFileList=function(){if(this.fileList.length>0&&!e.isNullOrUndefined(this.uploadWrapper.querySelector(".e-upload-files")))for(var t=0;t<this.fileList.length;t++)this.fileList[t].querySelector(".e-file-status").innerHTML=this.localizedTexts(this.getKeyValue(this.filesData[t].status)),this.filesData[t].status=this.localizedTexts(this.getKeyValue(this.filesData[t].status)),this.fileList[t].classList.contains(Vt)&&this.fileList[t].querySelector(".e-icons").setAttribute("title",this.localizedTexts("delete")),this.fileList[t].querySelector(".e-file-play-btn")&&this.fileList[t].querySelector(".e-icons").setAttribute("title",this.localizedTexts("resume")),this.fileList[t].querySelector(".e-file-remove-btn")&&this.fileList[t].querySelector(".e-icons").setAttribute("title",this.localizedTexts("remove")),this.fileList[t].querySelector(".e-file-reload-btn")&&this.fileList[t].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&&(e.detach(this.listParent),this.listParent=null,this.fileList=[],this.internalCreateFileList(this.filesData),this.actionButtons&&(this.removeActionButtons(),this.renderActionButtons(),this.checkActionButtonStatus()))},s.prototype.preRender=function(){this.localeText={Browse:"Browse...",Clear:"Clear",Upload:"Upload",invalidFileName:"File Name is not allowed",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 e.L10n("uploader",this.localeText,this.locale),this.preLocaleObj=e.getValue("currentLocale",this.l10n),this.formRendered(),this.updateHTMLAttrToElement(),this.checkHTMLAttributes(!1);var t=e.getValue("ej2_instances",this.element);if("EJS-UPLOADER"===this.element.tagName){var i=this.createElement("input",{attrs:{type:"file"}}),s=0;for(s;s<this.element.attributes.length;s++)"id"!==this.element.attributes[s].nodeName?i.setAttribute(this.element.attributes[s].nodeName,this.element.attributes[s].nodeValue):"id"===this.element.attributes[s].nodeName&&i.setAttribute(this.element.attributes[s].nodeName,e.getUniqueID("uploader")),i.innerHTML=this.element.innerHTML;i.hasAttribute("name")||i.setAttribute("name","UploadFiles"),this.element.appendChild(i),this.element=i,e.setValue("ej2_instances",t,this.element)}t[0].isPureReactComponent&&(e.isNullOrUndefined(t[0].props.name)?!e.isNullOrUndefined(t[0].props.id)&&e.isNullOrUndefined(t[0].props.name)?this.element.setAttribute("name",t[0].props.id):this.element.setAttribute("name","UploadFiles"):this.element.setAttribute("name",t[0].props.name)),e.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=e.Browser.info.name,this.uploaderName=this.element.getAttribute("name")},s.prototype.formRendered=function(){var t=e.closest(this.element,"form");if(!e.isNullOrUndefined(t))for(;t&&t!==document.documentElement;t=t.parentElement)"FORM"===t.tagName&&(this.isForm=!0,this.formElement=t,t.setAttribute("enctype","multipart/form-data"),t.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,"aria-label":this.localizedTexts("Upload")}}),this.clearButton=this.createElement("button",{className:"e-file-clear-btn e-css e-btn e-flat",attrs:{type:"button",tabindex:this.btnTabIndex,"aria-label":this.localizedTexts("Clear")}}),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(t){t&&!this.isForm&&(this.browseButton.blur(),this.actionButtons=t,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(){e.EventHandler.add(this.uploadButton,"click",this.uploadButtonClick,this),e.EventHandler.add(this.clearButton,"click",this.clearButtonClick,this)},s.prototype.unwireActionButtonEvents=function(){e.EventHandler.remove(this.uploadButton,"click",this.uploadButtonClick),e.EventHandler.remove(this.clearButton,"click",this.clearButtonClick)},s.prototype.removeActionButtons=function(){this.actionButtons&&(this.unwireActionButtonEvents(),e.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 t=e.isNullOrUndefined(this.buttons.upload)?"Upload":this.buttons.upload;this.buttons.upload=t,"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=e.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 t=this.createElement("span",{className:"e-file-select"});this.element.parentElement.insertBefore(t,this.element),this.dropAreaWrapper=this.createElement("div",{className:"e-file-select-wrap"}),this.element.parentElement.insertBefore(this.dropAreaWrapper,this.element),t.appendChild(this.element),this.dropAreaWrapper.appendChild(this.browseButton),this.dropAreaWrapper.appendChild(t),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.internalCreateFileList(this.filesData);if(e.isNullOrUndefined(this.files[0].size))return;this.isPreloadFiles=!0;var t=[].slice.call(this.files),i=[];this.multiple||(this.clearData(),t=[t[0]]);for(var s=0,n=t;s<n.length;s++){var a=n[s],r={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(r),this.filesData.push(r)}this.internalCreateFileList(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 t=this.uploadWrapper.querySelectorAll(".e-validation-fails").length+this.uploadWrapper.querySelectorAll(".e-upload-fails:not(.e-upload-progress)").length+this.uploadWrapper.querySelectorAll("span."+Vt).length+this.uploadWrapper.querySelectorAll("span.e-upload-progress").length;t>0&&t===this.uploadWrapper.querySelectorAll("li").length?this.uploadButton.setAttribute("disabled","disabled"):this.uploadButton.removeAttribute("disabled")}},s.prototype.setDropArea=function(){var t=this.dropAreaWrapper.querySelector(".e-file-drop");if(this.dropArea){this.dropZoneElement="string"!=typeof this.dropArea?this.dropArea:e.select(this.dropArea,document);for(var i=this.element,s=!1;i.parentNode;)(i=i.parentNode)===this.dropZoneElement&&(s=!0,t?t.innerHTML=this.localizedTexts("dropFilesHint"):this.createDropTextHint());!s&&t&&e.remove(t)}else e.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 t=this.dropAreaWrapper.querySelector(".e-file-drop");t&&e.remove(t)}},s.prototype.createDropTextHint=function(){var t=this.createElement("span",{className:"e-file-drop"});t.innerHTML=this.localizedTexts("dropFilesHint"),this.dropAreaWrapper.appendChild(t)},s.prototype.updateHTMLAttrToElement=function(){if(!e.isNullOrUndefined(this.htmlAttributes))for(var t=0,i=Object.keys(this.htmlAttributes);t<i.length;t++){var s=i[t];Dt.indexOf(s)<0&&this.element.setAttribute(s,this.htmlAttributes[""+s])}},s.prototype.updateHTMLAttrToWrapper=function(){if(!e.isNullOrUndefined(this.htmlAttributes))for(var t=0,i=Object.keys(this.htmlAttributes);t<i.length;t++){var s=i[t];if(Dt.indexOf(s)>-1)if("class"===s){var n=this.htmlAttributes[""+s].replace(/\s+/g," ").trim();""!==n&&e.addClass([this.uploadWrapper],n.split(" "))}else if("style"===s){var a=this.uploadWrapper.getAttribute(s);a=e.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 t=document.createAttribute("multiple");t.value="multiple",this.element.setAttributeNode(t)}else this.multiple||this.element.removeAttribute("multiple")},s.prototype.checkAutoUpload=function(t){this.autoUpload?(this.sequentialUpload?this.sequenceUpload(t):this.upload(t),this.removeActionButtons()):this.actionButtons||this.renderActionButtons(),this.checkActionButtonStatus()},s.prototype.sequenceUpload=function(t){if(this.filesData.length-t.length==0||"1"!==this.filesData[this.filesData.length-t.length-1].statusCode){(this.multiple||this.count<0)&&++this.count;var e=!this.showFileList;"object"==typeof this.filesData[this.count]?(this.isFirstFileOnSelection=!1,this.upload(this.filesData[this.count],e),"0"===this.filesData[this.count].statusCode&&this.sequenceUpload(t)):--this.count}},s.prototype.setCSSClass=function(t){var i=t;e.isNullOrUndefined(t)||(i=t.replace(/\s+/g," ").trim()),e.isNullOrUndefined(t)||""===i||e.removeClass([this.uploadWrapper],i.split(" "));var s=this.cssClass;e.isNullOrUndefined(this.cssClass)||""===this.cssClass||(s=this.cssClass.replace(/\s+/g," ").trim()),e.isNullOrUndefined(this.cssClass)||""===s||e.addClass([this.uploadWrapper],s.split(s.indexOf(",")>-1?",":" "))},s.prototype.wireEvents=function(){e.EventHandler.add(this.browseButton,"click",this.browseButtonClick,this),e.EventHandler.add(this.element,"change",this.onSelectFiles,this),e.EventHandler.add(document,"click",this.removeFocus,this),this.keyboardModule=new e.KeyboardEvents(this.uploadWrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.isForm&&e.EventHandler.add(this.formElement,"reset",this.resetForm,this)},s.prototype.unWireEvents=function(){e.EventHandler.remove(this.browseButton,"click",this.browseButtonClick),e.EventHandler.remove(this.element,"change",this.onSelectFiles),e.EventHandler.remove(document,"click",this.removeFocus),this.isForm&&e.EventHandler.remove(this.formElement,"reset",this.resetForm),this.keyboardModule&&this.keyboardModule.destroy()},s.prototype.resetForm=function(){this.clearAll()},s.prototype.keyActionHandler=function(t){var i=t.target;switch(t.action){case"enter":if(t.target===this.clearButton)this.clearButtonClick();else if(t.target===this.uploadButton)this.uploadButtonClick();else if(t.target===this.browseButton)this.browseButtonClick();else if(i.classList.contains(Mt))(s=this.getCurrentMetaData(null,t)).file.statusCode="4",s.file.status=this.localizedTexts("pauseUpload"),this.abortUpload(s,!1);else if(i.classList.contains("e-file-play-btn"))this.resumeUpload(this.getCurrentMetaData(null,t),t);else if(i.classList.contains(It)){var s=this.getCurrentMetaData(null,t);if(e.isNullOrUndefined(s)){var n=t.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(t),i.classList.contains(Bt)||this.browseButton.focus();t.preventDefault(),t.stopPropagation()}},s.prototype.getCurrentMetaData=function(t,i){var s,n;if(e.isNullOrUndefined(t)){var a=i.target.parentElement;s=this.filesData[this.fileList.indexOf(a)]}else s=t;for(var r=0;r<this.uploadMetaData.length;r++)this.uploadMetaData[r].file.name===s.name&&(n=this.uploadMetaData[r]);return n},s.prototype.removeFocus=function(){this.uploadWrapper&&this.listParent&&this.listParent.querySelector(".e-clear-icon-focus")&&(document.activeElement.blur(),this.listParent.querySelector(".e-clear-icon-focus").classList.remove("e-clear-icon-focus"))},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&&(e.EventHandler.add(this.dropZoneElement,"drop",this.dropElement,this),e.EventHandler.add(this.dropZoneElement,"dragover",this.dragHover,this),e.EventHandler.add(this.dropZoneElement,"dragleave",this.onDragLeave,this),e.EventHandler.add(this.dropZoneElement,"paste",this.onPasteFile,this),e.EventHandler.add(this.dropZoneElement,"dragenter",this.onDragEnter,this))},s.prototype.unBindDropEvents=function(){this.dropZoneElement&&(e.EventHandler.remove(this.dropZoneElement,"drop",this.dropElement),e.EventHandler.remove(this.dropZoneElement,"dragover",this.dragHover),e.EventHandler.remove(this.dropZoneElement,"dragleave",this.onDragLeave),e.EventHandler.remove(this.dropZoneElement,"dragenter",this.onDragEnter))},s.prototype.onDragEnter=function(t){this.enabled&&(this.dropZoneElement.classList.add("e-upload-drag-hover"),this.dragCounter=this.dragCounter+1,t.preventDefault(),t.stopPropagation())},s.prototype.onDragLeave=function(){this.enabled&&(this.dragCounter=this.dragCounter-1,this.dragCounter||this.dropZoneElement.classList.remove("e-upload-drag-hover"))},s.prototype.dragHover=function(t){this.enabled&&("Default"!==this.dropEffect&&(t.dataTransfer.dropEffect=this.dropEffect.toLowerCase()),t.preventDefault(),t.stopPropagation())},s.prototype.dropElement=function(t){this.dragCounter=0,this.dropZoneElement.classList.remove("e-upload-drag-hover"),this.onSelectFiles(t),t.preventDefault(),t.stopPropagation()},s.prototype.onPasteFile=function(t){var i=t.clipboardData.items;if("paste"===t.type&&"msie"!==this.browserName&&"edge"!==this.browserName&&"safari"!==this.browserName&&(this.element.files=t.clipboardData.files),1===i.length||this.multiple)for(var s=0;s<i.length;s++){var n=[].slice.call(i)[s];e.isNullOrUndefined(n.getAsFile())||"file"!==n.kind&&!n.type.match("^image/")||this.renderSelectedFiles(t,[n.getAsFile()],!1,!0)}},s.prototype.getSelectedFiles=function(t){for(var e=[],i=this.fileList[t],s=this.getFilesData(),n=+i.getAttribute("data-files-count"),a=0,r=0;r<t;r++)a+=+this.fileList[r].getAttribute("data-files-count");for(var l=a;l<a+n;l++)e.push(s[l]);return e},s.prototype.removeFiles=function(t){if(this.enabled){var s=t.target.parentElement,n=this.fileList.indexOf(s),a=this.fileList[n],r=this.isFormUpload(),l=r?this.getSelectedFiles(n):this.getFilesInArray(this.filesData[n]);if(!e.isNullOrUndefined(l)){if(t.target.classList.contains(Bt)&&!r){if(l[0].statusCode="5",!e.isNullOrUndefined(a)){var o=a.querySelector("."+Bt);i.createSpinner({target:o,width:"20px"}),i.showSpinner(o)}this.sequentialUpload&&this.uploadSequential(),a.classList.contains("e-restrict-retry")||this.checkActionComplete(!0)}else e.closest(t.target,".e-spinner-pane")||this.remove(l,!1,!1,!0,t);if(this.isForm&&a&&a.classList.contains("e-file-invalid")&&(this.element.value=""),this.checkActionButtonStatus(),this.actionButtons&&this.clearButton&&this.uploadWrapper){var h=this.uploadWrapper.querySelectorAll(".e-upload-progress-bar.e-upload-progress:not(.e-upload-success):not(.e-upload-fails)");1===h.length&&s.contains(h[0])&&this.clearButton.hasAttribute("disabled")&&this.clearButton.removeAttribute("disabled")}}}},s.prototype.removeFilesData=function(t,i){var s;if(i)return void(this.showFileList||(s=this.filesData.indexOf(t),this.filesData.splice(s,1)));var n=this.getLiElement(t);e.isNullOrUndefined(n)||(this.element.value="",e.detach(n),s=this.fileList.indexOf(n),this.fileList.splice(s,1),this.filesData.splice(s,1),0!==this.fileList.length||e.isNullOrUndefined(this.listParent)||(e.detach(this.listParent),this.listParent=null,this.removeActionButtons()),this.sequentialUpload&&s<=this.count&&--this.count)},s.prototype.removeUploadedFile=function(t,i,s,n){var a=this,r=t,l=new e.Ajax(this.asyncSettings.removeUrl,"POST",!0,null);l.emitError=!1;var o=new FormData;l.beforeSend=function(e){i.currentRequest=l.httpRequest,s?a.removingEventCallback(i,o,r,t):a.trigger("removing",i,function(i){i.cancel?e.cancel=!0:a.removingEventCallback(i,o,r,t)})},l.onLoad=function(t){return a.removeCompleted(t,r,n),{}},l.onError=function(t){return a.removeFailed(t,r,n),{}},l.send(o)},s.prototype.removingEventCallback=function(t,s,n,a){var r=this.element.getAttribute("name"),l=this.getLiElement(a);if(!(e.isNullOrUndefined(l)||e.isNullOrUndefined(l.querySelector("."+Nt))&&e.isNullOrUndefined(l.querySelector("."+Ht)))){var o=l.querySelector("."+Nt)?l.querySelector("."+Nt):l.querySelector("."+Ht);i.createSpinner({target:o,width:"20px"}),i.showSpinner(o)}t.postRawFile&&!e.isNullOrUndefined(n.rawFile)&&""!==n.rawFile?s.append(r,n.rawFile,n.name):s.append(r,n.name),this.updateFormData(s,t.customFormData)},s.prototype.updateFormData=function(t,e){if(e.length>0&&e[0])for(var i=0;i<e.length;i++)!function(i){var s=e[i],n=Object.keys(s).map(function(t){return s[""+t]});t.append(Object.keys(s)[0],n)}(i)},s.prototype.updateCustomheader=function(t,e){if(e.length>0&&e[0])for(var i=0;i<e.length;i++)!function(i){var s=e[i],n=Object.keys(s).map(function(t){return s[""+t]});t.setRequestHeader(Object.keys(s)[0],n)}(i)},s.prototype.removeCompleted=function(t,e,i){var s=t&&t.currentTarget?this.getResponse(t):null,n=t.target;if(4===n.readyState&&n.status>=200&&n.status<=299){var a={e:t,response:s,operation:"remove",file:this.updateStatus(e,this.localizedTexts("removedSuccessMessage"),"2")};this.trigger("success",a),this.removeFilesData(e,i);var r=this.uploadedFilesData.indexOf(e);this.uploadedFilesData.splice(r,1),this.trigger("change",{files:this.uploadedFilesData})}else this.removeFailed(t,e,i)},s.prototype.removeFailed=function(t,s,n){var a={e:t,response:t&&t.currentTarget?this.getResponse(t):null,operation:"remove",file:this.updateStatus(s,this.localizedTexts("removedFailedMessage"),"0")};if(!n){var r=this.filesData.indexOf(s),l=this.fileList[r];if(l){l.classList.remove(Vt),l.classList.add(Ft);var o=l.querySelector("."+At);o&&(o.classList.remove(Vt),o.classList.add(Ft))}this.checkActionButtonStatus()}this.trigger("failure",a);var h=this.getLiElement(s);if(!e.isNullOrUndefined(h)&&!e.isNullOrUndefined(h.querySelector("."+Nt))){var u=h.querySelector("."+Nt);i.hideSpinner(u),e.detach(h.querySelector(".e-spinner-pane"))}},s.prototype.getFilesFromFolder=function(t){this.filesEntries=[];var e=this.multiple?t.dataTransfer.items:[t.dataTransfer.items[0]];if(this.checkDirectoryUpload(e))for(var i=this,s=0;s<e.length;s++)!function(s){var n=e[s].webkitGetAsEntry();if(n.isFile){var a=[];n.file(function(t){var e=n.fullPath;a.push({path:e,file:t})}),i.renderSelectedFiles(t,a,!0)}else n.isDirectory&&i.traverseFileTree(n,t)}(s)},s.prototype.checkDirectoryUpload=function(t){for(var e=0;t&&e<t.length;e++)if(t[e].webkitGetAsEntry().isDirectory)return!0;return!1},s.prototype.traverseFileTree=function(t,e){if(t.isFile)this.filesEntries.push(t);else if(t.isDirectory){var i=t.createReader();this.readFileFromDirectory(i,e)}},s.prototype.readFileFromDirectory=function(t,e){var i=this;t.readEntries(function(s){for(var n=0;n<s.length;n++)i.traverseFileTree(s[n],e);i.pushFilesEntries(e),s.length&&i.readFileFromDirectory(t)})},s.prototype.pushFilesEntries=function(t){for(var e=this,i=[],s=this,n=0;n<this.filesEntries.length;n++)!function(n){s.filesEntries[n].file(function(s){if(e.filesEntries.length){var a=e.filesEntries[n].fullPath;i.push({path:a,file:s}),n===e.filesEntries.length-1&&(e.filesEntries=[],e.renderSelectedFiles(t,i,!0))}})}(n)},s.prototype.onSelectFiles=function(t){if(this.enabled){var e;if("drop"===t.type)if(this.directoryUpload)this.getFilesFromFolder(t);else{var i=this.sortFilesList=t.dataTransfer.files;"msie"!==this.browserName&&"edge"!==this.browserName&&"safari"!==this.browserName&&(this.element.files=i),i.length>0&&(e=this.multiple?this.sortFileList(i):[i[0]],this.renderSelectedFiles(t,e))}else e=[].slice.call(t.target.files),this.renderSelectedFiles(t,e);(this.isAngular||this.isReact)&&t.stopPropagation()}},s.prototype.getBase64=function(t){return new Promise(function(e,i){var s=new FileReader;s.readAsDataURL(t),s.onload=function(){return e(s.result)},s.onerror=function(t){return i(t)}})},s.prototype.renderSelectedFiles=function(t,i,s,n){var a=this;this.base64String=[];var r={event:t,cancel:!1,filesData:[],isModified:!1,modifiedFilesData:[],progressInterval:"",isCanceled:!1,currentRequest:null,customFormData:null};if(i.length<1)return r.isCanceled=!0,void this.trigger("selected",r);this.flag=!0;var l=[];this.multiple||(this.clearData(!0),this.actionCompleteCount=0,i=[i[0]]);for(h=0;h<i.length;h++){var o=s?i[h].file:i[h];this.updateInitialFileDetails(t,i,o,h,l,s,n)}if(r.filesData=l,!e.isNullOrUndefined(this.allowedExtensions)&&this.allowedExtensions.indexOf("*")>-1&&(this.allTypes=!0),this.enableHtmlSanitizer)for(var h=0;h<l.length;h++){for(var u=e.SanitizeHtmlHelper.beforeSanitize(),p=e.SanitizeHtmlHelper.serializeValue(u,l[parseInt(h.toString(),10)].name),d=l[parseInt(h.toString(),10)].name,c=!1,m=0;m<d.length;m++)if(d.charCodeAt(m)>127){c=!0;break}var v=/<([a-z][a-z0-9]*)\b[^>]*>(.*?)<\/\1>/i.test(d);if(p!==l[parseInt(h.toString(),10)].name&&(!c||v)){var f=i[parseInt(h.toString(),10)].name.replace(/[\u00A0-\u9999<>\\&]/g,function(t){return"&#"+t.charCodeAt(0)+";"});l[parseInt(h.toString(),10)].name=f,l[parseInt(h.toString(),10)].status=this.localizedTexts("invalidFileName"),l[parseInt(h.toString(),10)].statusCode="0"}}this.allTypes||(l=this.checkExtension(l)),this.trigger("selected",r,function(t){a._internalRenderSelect(t,l)})},s.prototype.updateInitialFileDetails=function(t,i,s,n,a,r,l){var o={name:r?i[n].path.substring(1,i[n].path.length):l?e.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:e.getUniqueID(s.name.substring(0,s.name.lastIndexOf(".")))+"."+this.getFileType(s.name)};l&&(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",this.checkActionComplete(!0)),a.push(o)},s.prototype._internalRenderSelect=function(t,i){if(!t.cancel){if(this.selectedFiles=this.selectedFiles.concat(i),this.btnTabIndex=this.disableKeyboardNavigation?"-1":"0",this.showFileList){if(t.isModified&&t.modifiedFilesData.length>0){for(var s=0;s<t.modifiedFilesData.length;s++)for(var n=0;n<i.length;n++)t.modifiedFilesData[s].id===i[n].id&&(t.modifiedFilesData[s].rawFile=i[n].rawFile);var a=this.allTypes?t.modifiedFilesData:this.checkExtension(t.modifiedFilesData);this.updateSortedFileList(a),this.filesData=this.filesData.concat(a),this.isForm&&!this.allowUpload()||this.checkAutoUpload(a)}else{if(this.internalCreateFileList(i),this.autoUpload&&this.sequenceUpload&&this.sequentialUpload&&this.filesData.length>0&&"2"!==this.filesData[this.filesData.length-1].statusCode&&"0"!==this.filesData[this.filesData.length-1].statusCode)return void(this.filesData=this.filesData.concat(i));this.filesData=this.filesData.concat(i),this.isForm&&!this.allowUpload()||this.checkAutoUpload(i)}e.isNullOrUndefined(t.progressInterval)||""===t.progressInterval||(this.progressInterval=t.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 t=!1;return this.isForm&&!e.isNullOrUndefined(this.asyncSettings.saveUrl)&&""!==this.asyncSettings.saveUrl&&(t=!0),t},s.prototype.isFormUpload=function(){var t=!1;return!this.isForm||!e.isNullOrUndefined(this.asyncSettings.saveUrl)&&""!==this.asyncSettings.saveUrl||!e.isNullOrUndefined(this.asyncSettings.removeUrl)&&""!==this.asyncSettings.removeUrl||(t=!0),t},s.prototype.clearData=function(t){e.isNullOrUndefined(this.listParent)||(e.detach(this.listParent),this.listParent=null),"msie"===this.browserName||t||(this.element.value=""),this.fileList=[],this.filesData=[],this.removeActionButtons()},s.prototype.updateSortedFileList=function(t){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))}this.removeActionButtons();var r=[].slice.call(i.childNodes);this.createParentUL();for(var l=0;l<t.length;l++){for(var o=0;o<this.filesData.length;o++)this.filesData[o].name===t[l].name&&(this.listParent.appendChild(r[o]),e.EventHandler.add(r[o].querySelector(".e-icons"),"click",this.removeFiles,this),this.fileList.push(r[o]),s=l);s!==l&&this.internalCreateFileList([t[l]])}}else this.internalCreateFileList(t)},s.prototype.isBlank=function(t){return!t||/^\s*$/.test(t)},s.prototype.checkGenericExtension=function(t,e){var i=[];switch(t.toLowerCase()){case"image/*":i.push("jpg","jpeg","png","gif","bmp","tiff","svg","webp","heic");break;case"audio/*":i.push("mp3","wav","aac","flac","ogg","m4a");break;case"video/*":i.push("mp4","mov","avi","mkv","flv","wmv","webm","mpeg");break;case"application/*":i.push("doc","docx","xls","xlsx","ppt","pptx","zip","rar","7z","tar","pdf");break;case"text/*":i.push("txt","csv","html","css","js","json","xml","md")}return i.includes(e.toLowerCase())},s.prototype.checkExtension=function(t){var i=t;if(!this.isBlank(this.allowedExtensions)){for(var s=[],n=0,a=e.isNullOrUndefined(s)?[""]:this.allowedExtensions.split(",");n<a.length;n++){var r=a[n];s.push(r.trim().toLocaleLowerCase())}for(var l=0;l<t.length;l++){var o=-1!==t[l].type.indexOf(".")?t[l].type.replace(".",""):t[l].type;-1!==s[0].indexOf("/*")?this.checkGenericExtension(s[0],o)||(t[l].status=this.localizedTexts("invalidFileType"),t[l].statusCode="0"):-1===s.indexOf(("."+o).toLocaleLowerCase())&&(t[l].status=this.localizedTexts("invalidFileType"),t[l].statusCode="0")}}return i},s.prototype.validatedFileSize=function(t){var e="",i="";return t<this.minFileSize?e=this.localizedTexts("invalidMinFileSize"):t>this.maxFileSize?i=this.localizedTexts("invalidMaxFileSize"):(e="",i=""),{minSize:e,maxSize:i}},s.prototype.isPreLoadFile=function(t){for(var e=!1,i=0;i<this.files.length;i++)this.files[i].name===t.name.slice(0,t.name.lastIndexOf("."))&&this.files[i].type===t.type&&(e=!0);return e},s.prototype.createCustomfileList=function(t){this.createParentUL();for(var i=0,s=t;i<s.length;i++){var n=s[i],a=this.createElement("li",{className:Lt,attrs:{"data-file-name":n.name}});this.uploadTemplateFn=this.templateComplier(this.template);var r=this.uploadTemplateFn(n,this,"template",this.element.id+"Template",this.isStringTemplate,null,a);if(r){var l=[].slice.call(r);e.append(l,a)}var o=t.indexOf(n),h={element:a,fileInfo:n,index:o,isPreload:this.isPreLoadFile(n)},u={element:a,fileInfo:n,index:o,isPreload:this.isPreLoadFile(n)};this.trigger("rendering",h),this.trigger("fileListRendering",u),this.listParent.appendChild(a),this.fileList.push(a)}this.renderReactTemplates()},s.prototype.createParentUL=function(){e.isNullOrUndefined(this.listParent)&&(this.listParent=this.createElement("ul",{className:"e-upload-files"}),this.uploadWrapper.appendChild(this.listParent))},s.prototype.formFileList=function(t,i){var s=this.createElement("li",{className:Lt});s.setAttribute("data-files-count",t.length+"");for(var n,a=this.createElement("span",{className:"e-file-container"}),r=0,l=t;r<l.length;r++){var o=l[r],h=this.createElement("span",{className:"e-file-name"});h.innerHTML=this.getFileNameOnly(o.name);var u=this.createElement("span",{className:"e-file-type"}),p=this.getFileType(o.name);if(u.innerHTML="."+p,p||u.classList.add("e-hidden"),this.enableRtl){var d=this.createElement("span",{className:"e-rtl-container"});d.appendChild(u),d.appendChild(h),a.appendChild(d)}else a.appendChild(h),a.appendChild(u);this.truncateName(h),n=this.formValidateFileInfo(o,s)}s.appendChild(a),this.setListToFileInfo(t,s);var c=this.listParent.querySelectorAll("li").length,m=this.createElement("span");if(s.classList.contains("e-file-invalid")?(m.classList.add(At),m.classList.add("e-file-invalid"),m.innerText=t.length>1?this.localizedTexts("invalidFileSelection"):n):(m.classList.add(t.length>1?"e-file-information":"e-file-size"),m.innerText=t.length>1?this.localizedTexts("totalFiles")+": "+t.length+" , "+this.localizedTexts("size")+": "+this.bytesToSize(this.getFileSize(t)):this.bytesToSize(t[0].size),this.createFormInput(t)),a.appendChild(m),e.isNullOrUndefined(s.querySelector(".e-icons"))){var v=this.createElement("span",{className:"e-icons",attrs:{tabindex:this.btnTabIndex}});"msie"===this.browserName&&v.classList.add("e-msie"),v.setAttribute("title",this.localizedTexts("remove")),s.appendChild(a),s.appendChild(v),e.EventHandler.add(v,"click",this.removeFiles,this),v.classList.add(Ht)}var f={element:s,fileInfo:this.mergeFileInfo(t,s),index:c,isPreload:this.isPreLoadFile(this.mergeFileInfo(t,s))},g={element:s,fileInfo:this.mergeFileInfo(t,s),index:c,isPreload:this.isPreLoadFile(this.mergeFileInfo(t,s))};this.trigger("rendering",f),this.trigger("fileListRendering",g),this.listParent.appendChild(s),this.fileList.push(s)},s.prototype.formValidateFileInfo=function(t,e){var i=t.status,s=this.validatedFileSize(t.size);""===s.minSize&&""===s.maxSize||(this.addInvalidClass(e),i=""!==s.minSize?this.localizedTexts("invalidMinFileSize"):""!==s.maxSize?this.localizedTexts("invalidMaxFileSize"):i);var n=this.checkExtension(this.getFilesInArray(t))[0].status;return n===this.localizedTexts("invalidFileType")&&(this.addInvalidClass(e),i=n),i},s.prototype.addInvalidClass=function(t){t.classList.add("e-file-invalid")},s.prototype.createFormInput=function(t){if("safari"!==this.browserName){var i=this.element.cloneNode(!0);i.classList.add("e-hidden-file-input");for(var s=0,n=t;s<n.length;s++)n[s].input=i;i.setAttribute("id",e.getUniqueID("hiddenUploader")),i.setAttribute("name",this.uploaderName),this.uploadWrapper.querySelector(".e-file-select").appendChild(i),"msie"!==this.browserName&&"edge"!==this.browserName&&(this.element.value="")}},s.prototype.getFileSize=function(t){for(var e=0,i=0,s=t;i<s.length;i++)e+=s[i].size;return e},s.prototype.mergeFileInfo=function(t,e){for(var i={name:"",rawFile:"",size:0,status:"",type:"",validationMessages:{minSize:"",maxSize:""},statusCode:"1",list:e},s=[],n="",a=0,r=t;a<r.length;a++){var l=r[a];s.push(l.name),n=l.type}return i.name=s.join(", "),i.size=this.getFileSize(t),i.type=n,i.status=this.statusForFormUpload(t,e),i},s.prototype.statusForFormUpload=function(t,e){for(var i,s=!0,n=0,a=t;n<a.length;n++){var r=a[n];i=r.status;var l=this.validatedFileSize(r.size);""===l.minSize&&""===l.maxSize||(s=!1,i=""!==l.minSize?this.localizedTexts("invalidMinFileSize"):""!==l.maxSize?this.localizedTexts("invalidMaxFileSize"):i);var o=this.checkExtension(this.getFilesInArray(r))[0].status;o===this.localizedTexts("invalidFileType")&&(s=!1,i=o)}return s?i=this.localizedTexts("totalFiles")+": "+t.length+" , "+this.localizedTexts("size")+": "+this.bytesToSize(this.getFileSize(t)):(e.classList.add("e-file-invalid"),i=t.length>1?this.localizedTexts("invalidFileSelection"):i),i},s.prototype.formCustomFileList=function(t,i){this.createParentUL();var s=this.createElement("li",{className:Lt});s.setAttribute("data-files-count",t.length+""),this.setListToFileInfo(t,s);var n=this.mergeFileInfo(t,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 r=[].slice.call(a);e.append(r,s)}var l=this.listParent.querySelectorAll("li").length;s.classList.contains("e-file-invalid")||this.createFormInput(t);var o={element:s,fileInfo:n,index:l,isPreload:this.isPreLoadFile(n)},h={element:s,fileInfo:n,index:l,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(t){this.filesData=this.filesData&&this.filesData.length>0?this.filesData.concat(t):t,this.internalCreateFileList(t)},s.prototype.internalCreateFileList=function(t){if(this.createParentUL(),""===this.template||e.isNullOrUndefined(this.template))if(this.isFormUpload())this.uploadWrapper.classList.add("e-form-upload"),this.formFileList(t,this.element.files);else for(var i=0,s=t;i<s.length;i++){var n=s[i],a=this.createElement("li",{className:Lt,attrs:{"data-file-name":n.name,"data-files-count":"1"}}),r=this.createElement("span",{className:"e-file-container"}),l=this.createElement("span",{className:"e-file-name",attrs:{title:n.name}});l.innerHTML=this.getFileNameOnly(n.name);var o=this.createElement("span",{className:"e-file-type"}),h=this.getFileType(n.name);if(o.innerHTML="."+h,h||o.classList.add("e-hidden"),this.enableRtl){var u=this.createElement("span",{className:"e-rtl-container"});u.appendChild(o),u.appendChild(l),r.appendChild(u)}else r.appendChild(l),r.appendChild(o);var p=this.createElement("span",{className:"e-file-size"});p.innerHTML=this.bytesToSize(n.size),r.appendChild(p);var d=this.createElement("span",{className:At});r.appendChild(d),d.innerHTML=n.status,a.appendChild(r);var c=this.createElement("span",{className:" e-icons",attrs:{tabindex:this.btnTabIndex}});"msie"===this.browserName&&c.classList.add("e-msie"),c.setAttribute("title",this.localizedTexts("remove")),a.appendChild(c),e.EventHandler.add(c,"click",this.removeFiles,this),"2"===n.statusCode?(d.classList.add(Vt),c.classList.add(Nt),c.setAttribute("title",this.localizedTexts("delete")),c.setAttribute("aria-label",this.localizedTexts("delete"))):"1"!==n.statusCode&&(d.classList.remove(Vt),d.classList.add("e-validation-fails")),this.autoUpload&&"1"===n.statusCode&&""!==this.asyncSettings.saveUrl&&(d.innerHTML=""),c.classList.contains(Nt)||(c.classList.add(Ht),c.setAttribute("aria-label",this.localizedTexts("remove")));var m=t.indexOf(n),v={element:a,fileInfo:n,index:m,isPreload:this.isPreLoadFile(n)},f={element:a,fileInfo:n,index:m,isPreload:this.isPreLoadFile(n)};this.trigger("rendering",v),this.trigger("fileListRendering",f),this.listParent.appendChild(a),this.fileList.push(a),this.truncateName(l);var g=this.flag;this.isPreLoadFile(n)&&(this.flag=!1,this.checkActionComplete(!0),this.flag=g)}else this.isFormUpload()?(this.uploadWrapper.classList.add("e-form-upload"),this.formCustomFileList(t,this.element.files)):this.createCustomfileList(t)},s.prototype.getSlicedName=function(t){var e=t.textContent;t.dataset.tail=e.slice(e.length-10)},s.prototype.setListToFileInfo=function(t,e){for(var i=0,s=t;i<s.length;i++)s[i].list=e},s.prototype.truncateName=function(t){var e=t;"edge"!==this.browserName&&e.offsetWidth<e.scrollWidth?this.getSlicedName(e):e.offsetWidth+1<e.scrollWidth&&this.getSlicedName(e)},s.prototype.getFileType=function(t){var e,i=t.lastIndexOf(".");return i>=0&&(e=t.substring(i+1)),e||""},s.prototype.getFileNameOnly=function(t){var e=this.getFileType(t);return e=t.split("."+e)[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 t=document.createAttribute("multiple");this.element.setAttributeNode(t)}},s.prototype.filterfileList=function(t){for(var i,s=[],n=0;n<t.length;n++)i=this.getLiElement(t[n]),e.isNullOrUndefined(i)||i.classList.contains(Vt)?this.showFileList||"File uploaded successfully"===t[n].status||s.push(t[n]):s.push(t[n]);return s},s.prototype.updateStatus=function(t,i,s,n){if(void 0===n&&(n=!0),""===i||e.isNullOrUndefined(i)||""===s||e.isNullOrUndefined(s)||(t.status=i,t.statusCode=s),n){var a=this.getLiElement(t);e.isNullOrUndefined(a)||e.isNullOrUndefined(a.querySelector("."+At))||""===i||e.isNullOrUndefined(i)||(a.querySelector("."+At).textContent=i)}return t},s.prototype.getLiElement=function(t){for(var i,s=0;s<this.filesData.length;s++)e.isNullOrUndefined(t)||(e.isNullOrUndefined(this.filesData[s].id)||e.isNullOrUndefined(t.id)?this.filesData[s].name!==t.name:this.filesData[s].name!==t.name||this.filesData[s].id!==t.id)||(i=s);return this.fileList[i]},s.prototype.createProgressBar=function(t){var e=this.createElement("span",{className:Ut}),i=this.createElement("progressbar",{className:Rt,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:"e-progress-bar-text"});n.textContent="0%",s.appendChild(i),e.appendChild(s),e.appendChild(n),t.querySelector(".e-file-container").appendChild(e)},s.prototype.updateProgressbar=function(t,i){if(!isNaN(Math.round(t.loaded/t.total*100))&&!e.isNullOrUndefined(i.querySelector("."+Rt)))if(e.isNullOrUndefined(this.progressInterval)||""===this.progressInterval)this.changeProgressValue(i,Math.round(t.loaded/t.total*100).toString()+"%");else{var s=Math.round(t.loaded/t.total*100)%parseInt(this.progressInterval,10);0!==s&&100!==s||this.changeProgressValue(i,Math.round(t.loaded/t.total*100).toString()+"%")}},s.prototype.changeProgressValue=function(t,e){t.querySelector("."+Rt).setAttribute("style","width:"+e),t.querySelector(".e-progress-bar-text").textContent=e},s.prototype.uploadInProgress=function(t,i,s,n){var a=this.getLiElement(i);if(!e.isNullOrUndefined(a)||s){if(e.isNullOrUndefined(a))this.cancelUploadingFile(i,t,n);else{"5"===i.statusCode&&this.cancelUploadingFile(i,t,n,a),a.querySelectorAll("."+Ut).length>0||!a.querySelector("."+At)||(a.querySelector("."+At).classList.add("e-upload-progress"),this.createProgressBar(a),this.updateProgressBarClasses(a,"e-upload-progress"),a.querySelector("."+At).classList.remove(Ft)),this.updateProgressbar(t,a);var r=a.querySelector("."+Ht);e.isNullOrUndefined(r)||(r.classList.add(Bt,"e-upload-progress"),r.setAttribute("title",this.localizedTexts("abort")),r.classList.remove(Ht))}var l={e:t,operation:"upload",file:this.updateStatus(i,this.localizedTexts("inProgress"),"3")};this.trigger("progress",l)}},s.prototype.cancelUploadingFile=function(t,s,n,a){var r=this;if("5"===t.statusCode){var l={event:s,fileData:t,cancel:!1,customFormData:[],currentRequest:null};this.trigger("canceling",l,function(s){if(s.cancel){if(t.statusCode="3",!e.isNullOrUndefined(a)){var l=a.querySelector("."+Bt);e.isNullOrUndefined(l)||(i.hideSpinner(l),e.detach(a.querySelector(".e-spinner-pane")))}}else{n.emitError=!1,n.httpRequest.abort();var o=new FormData;if("5"===t.statusCode){var h=r.element.getAttribute("name");o.append(h,t.name),o.append("cancel-uploading",t.name),r.updateFormData(o,s.customFormData);var u=new e.Ajax(r.asyncSettings.removeUrl,"POST",!0,null);u.emitError=!1,u.beforeSend=function(t){s.currentRequest&&r.updateCustomheader(u.httpRequest,s.currentRequest)},u.onLoad=function(e){return r.removecanceledFile(e,t),{}},u.send(o)}}})}},s.prototype.removecanceledFile=function(t,s){var n=this.getLiElement(s);if(!(e.isNullOrUndefined(n)||n.querySelector("."+It)||e.isNullOrUndefined(n.querySelector("."+Bt)))){this.updateStatus(s,this.localizedTexts("fileUploadCancel"),"5"),this.renderFailureState(t,s,n);var a=n.querySelector("."+Ht);e.isNullOrUndefined(n)||(i.hideSpinner(a),e.isNullOrUndefined(n.querySelector(".e-spinner-pane"))||e.detach(n.querySelector(".e-spinner-pane")));var r={event:t,response:t&&t.currentTarget?this.getResponse(t):null,operation:"cancel",file:s};this.trigger("success",r)}},s.prototype.renderFailureState=function(t,i,s){var n=this;this.updateProgressBarClasses(s,Ft),this.removeProgressbar(s,"failure"),e.isNullOrUndefined(s.querySelector(".e-file-status"))||s.querySelector(".e-file-status").classList.add(Ft);var a=s.querySelector("."+Bt);e.isNullOrUndefined(a)||(a.classList.remove(Bt,"e-upload-progress"),a.classList.add(Ht),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")),this.pauseButton.setAttribute("aria-label",this.localizedTexts("retry")),s.querySelector("."+It).addEventListener("click",function(t){n.reloadcanceledFile(t,i,s,!1)},!1))},s.prototype.reloadcanceledFile=function(t,i,s,n){i.statusCode="1",i.status=this.localizedTexts("readyToUploadMessage"),n||(e.isNullOrUndefined(s.querySelector("."+At))||s.querySelector("."+At).classList.remove(Ft),e.isNullOrUndefined(s.querySelector("."+It))||e.detach(s.querySelector("."+It)),this.pauseButton=null),e.isNullOrUndefined(s)||s.classList.add("e-restrict-retry"),this.upload([i])},s.prototype.uploadComplete=function(t,i,s){var n=t.target;if(4===n.readyState&&n.status>=200&&n.status<=299){var a=this.getLiElement(i);if(e.isNullOrUndefined(a)&&(!s||e.isNullOrUndefined(s))&&this.showFileList)return;if(!e.isNullOrUndefined(a)){this.updateProgressBarClasses(a,Vt),this.removeProgressbar(a,"success");var r=a.querySelector("."+Bt);e.isNullOrUndefined(r)||(r.classList.add(Nt),r.setAttribute("title",this.localizedTexts("delete")),r.setAttribute("aria-label",this.localizedTexts("delete")),r.classList.remove(Bt),r.classList.remove("e-upload-progress"))}this.raiseSuccessEvent(t,i)}else this.uploadFailed(t,i)},s.prototype.getResponse=function(t){var e=t.currentTarget;return{readyState:e.readyState,statusCode:e.status,statusText:e.statusText,headers:e.getAllResponseHeaders(),withCredentials:e.withCredentials}},s.prototype.raiseSuccessEvent=function(t,s){var n=this,a=t&&t.currentTarget?this.getResponse(t):null,r=this.localizedTexts("uploadSuccessMessage"),l={e:t,response:a,operation:"upload",file:this.updateStatus(s,r,"2",!1),statusText:r},o=this.getLiElement(s);if(!e.isNullOrUndefined(o)){var h=o.querySelector(".e-spinner-pane");e.isNullOrUndefined(h)||(i.hideSpinner(o),e.detach(h))}this.trigger("success",l,function(t){n.updateStatus(s,t.statusText,"2"),n.multiple?n.uploadedFilesData.push(s):n.uploadedFilesData=[s],n.trigger("change",{file:n.uploadedFilesData}),n.checkActionButtonStatus(),n.fileList.length>0?n.getLiElement(s).classList.contains("e-restrict-retry")?n.getLiElement(s).classList.remove("e-restrict-retry"):(n.uploadSequential(),n.checkActionComplete(!0)):n.showFileList||n.checkActionComplete(!0)})},s.prototype.uploadFailed=function(t,i){var s=this,n=this.getLiElement(i),a=t&&t.currentTarget?this.getResponse(t):null,r=this.localizedTexts("uploadFailedMessage"),l={e:t,response:a,operation:"upload",file:this.updateStatus(i,r,"0",!1),statusText:r};e.isNullOrUndefined(n)||this.renderFailureState(t,i,n),this.trigger("failure",l,function(t){s.updateStatus(i,t.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(t){t?++this.actionCompleteCount:--this.actionCompleteCount,this.raiseActionComplete()},s.prototype.raiseActionComplete=function(){if(this.filesData.length===this.actionCompleteCount&&this.flag){this.flag=!1;var t={fileData:[]};t.fileData=this.getSelectedFileStatus(this.selectedFiles),this.trigger("actionComplete",t)}},s.prototype.getSelectedFileStatus=function(t){for(var e=[],i=0,s=0;s<t.length;s++)for(var n=t[s],a=0;a<this.filesData.length;a++)if(this.filesData[a].name===n.name&&this.filesData[a].status===n.status){e[i]=this.filesData[a],++i;break}return e},s.prototype.updateProgressBarClasses=function(t,i){var s=t.querySelector("."+Rt);e.isNullOrUndefined(s)||(s.classList.add(i),this.actionButtons&&this.clearButton&&this.uploadWrapper&&("e-upload-progress"!==i||this.clearButton.hasAttribute("disabled")?"e-upload-success"!==i&&"e-upload-fails"!==i||0!==this.uploadWrapper.querySelectorAll(".e-upload-progress-bar.e-upload-progress:not(.e-upload-success):not(.e-upload-fails)").length||!this.clearButton.hasAttribute("disabled")||this.clearButton.removeAttribute("disabled"):this.clearButton.setAttribute("disabled","disabled")))},s.prototype.removeProgressbar=function(t,i){var s=this;e.isNullOrUndefined(t.querySelector("."+Ut))||(this.progressAnimation=new e.Animation({duration:1250}),this.progressAnimation.animate(t.querySelector("."+Ut),{name:"FadeOut"}),this.progressAnimation.animate(t.querySelector(".e-progress-bar-text"),{name:"FadeOut"}),setTimeout(function(){s.animateProgressBar(t,i)},750))},s.prototype.animateProgressBar=function(t,i){"success"===i?(t.classList.add(Vt),e.isNullOrUndefined(t.querySelector("."+At))||(t.querySelector("."+At).classList.remove("e-upload-progress"),this.progressAnimation.animate(t.querySelector("."+At),{name:"FadeIn"}),t.querySelector("."+At).classList.add(Vt))):e.isNullOrUndefined(t.querySelector("."+At))||(t.querySelector("."+At).classList.remove("e-upload-progress"),this.progressAnimation.animate(t.querySelector("."+At),{name:"FadeIn"}),t.querySelector("."+At).classList.add(Ft)),t.querySelector("."+Ut)&&e.detach(t.querySelector("."+Ut))},s.prototype.setExtensions=function(t){""===t||e.isNullOrUndefined(t)?this.element.removeAttribute("accept"):this.element.setAttribute("accept",t)},s.prototype.templateComplier=function(t){if(t)try{return"function"!=typeof t&&e.selectAll(t,document).length?e.compile(e.select(t,document).innerHTML.trim()):e.compile(t)}catch(i){return e.compile(t)}},s.prototype.setRTL=function(){this.enableRtl?e.addClass([this.uploadWrapper],"e-rtl"):e.removeClass([this.uploadWrapper],"e-rtl")},s.prototype.localizedTexts=function(t){return this.l10n.setLocale(this.locale),this.l10n.getConstant(t)},s.prototype.setControlStatus=function(){this.enabled?(this.uploadWrapper.classList.contains("e-disabled")&&this.uploadWrapper.classList.remove("e-disabled"),!e.isNullOrUndefined(this.browseButton)&&this.element.hasAttribute("disabled")&&(this.element.removeAttribute("disabled"),this.browseButton.removeAttribute("disabled")),!e.isNullOrUndefined(this.clearButton)&&this.clearButton.hasAttribute("disabled")&&this.clearButton.removeAttribute("disabled"),!e.isNullOrUndefined(this.uploadButton)&&this.uploadButton.hasAttribute("disabled")&&this.uploadButton.hasAttribute("disabled")):(this.uploadWrapper.classList.add("e-disabled"),this.element.setAttribute("disabled","disabled"),this.browseButton.setAttribute("disabled","disabled"),e.isNullOrUndefined(this.clearButton)||this.clearButton.setAttribute("disabled","disabled"),e.isNullOrUndefined(this.uploadButton)||this.uploadButton.setAttribute("disabled","disabled"))},s.prototype.checkHTMLAttributes=function(t){for(var i=0,s=t?e.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["accept","multiple","disabled"];i<s.length;i++){var n=s[i];if(!e.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"accept":(e.isNullOrUndefined(this.uploaderOptions)||void 0===this.uploaderOptions.allowedExtensions||t)&&(this.setProperties({allowedExtensions:this.element.getAttribute("accept")},!t),this.initialAttr.accept=this.allowedExtensions);break;case"multiple":if(e.isNullOrUndefined(this.uploaderOptions)||void 0===this.uploaderOptions.multiple||t){var a="multiple"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n);this.setProperties({multiple:a},!t),this.initialAttr.multiple=!0}break;case"disabled":if(e.isNullOrUndefined(this.uploaderOptions)||void 0===this.uploaderOptions.enabled||t){var r="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n);this.setProperties({enabled:r},!t),this.initialAttr.disabled=!0}}}},s.prototype.chunkUpload=function(t,e,i){var s=Math.min(this.asyncSettings.chunkSize,t.size),n={chunkIndex:0,blob:t.rawFile.slice(0,s),file:t,start:0,end:s,retryCount:0,request:null};this.sendRequest(t,n,e,i)},s.prototype.sendRequest=function(t,i,s,n){var a=this,r=new FormData,l=t.rawFile.slice(i.start,i.end);r.append(this.uploaderName,l,t.name),r.append("chunk-index",i.chunkIndex.toString()),r.append("chunkIndex",i.chunkIndex.toString());var o=Math.max(Math.ceil(t.size/this.asyncSettings.chunkSize),1);r.append("total-chunk",o.toString()),r.append("totalChunk",o.toString());var h=new e.Ajax({url:this.asyncSettings.saveUrl,type:"POST",async:!0,contentType:null});h.emitError=!1,h.onLoad=function(t){return a.chunkUploadComplete(t,i,s),{}},h.onUploadProgress=function(t){return a.chunkUploadInProgress(t,i,s),{}};var u={fileData:t,customFormData:[],cancel:!1,chunkSize:0===this.asyncSettings.chunkSize?null:this.asyncSettings.chunkSize};h.beforeSend=function(e){u.currentRequest=h.httpRequest,u.currentChunkIndex=i.chunkIndex,0===u.currentChunkIndex?a.trigger("uploading",u,function(i){a.uploadingEventCallback(r,i,e,t)}):a.trigger("chunkUploading",u,function(i){a.uploadingEventCallback(r,i,e,t)})},h.onError=function(t){return a.chunkUploadFailed(t,i,s),{}},h.send(r),i.request=h},s.prototype.uploadingEventCallback=function(t,e,i,s){e.cancel?this.eventCancelByArgs(i,e,s):this.updateFormData(t,e.customFormData)},s.prototype.eventCancelByArgs=function(t,i,s){var n=this;if(t.cancel=!0,"5"!==i.fileData.statusCode){i.fileData.statusCode="5",i.fileData.status=this.localizedTexts("fileUploadCancel");var a=this.getLiElement(i.fileData);if(a){e.isNullOrUndefined(a.querySelector("."+At))||(a.querySelector("."+At).innerHTML=this.localizedTexts("fileUploadCancel"),a.querySelector("."+At).classList.add(Ft)),this.pauseButton=this.createElement("span",{className:"e-icons e-file-reload-btn",attrs:{tabindex:this.btnTabIndex}});var r=a.querySelector("."+Ht);r&&r.parentElement.insertBefore(this.pauseButton,r),this.pauseButton.setAttribute("title",this.localizedTexts("retry")),this.pauseButton.addEventListener("click",function(t){n.reloadcanceledFile(t,s,a)},!1),this.checkActionButtonStatus()}}},s.prototype.checkChunkUpload=function(){return!(this.asyncSettings.chunkSize<=0||e.isNullOrUndefined(this.asyncSettings.chunkSize))},s.prototype.chunkUploadComplete=function(t,s,n){var a,r=this,l=t.target;if(4===l.readyState&&l.status>=200&&l.status<300){var o=t&&t.currentTarget?this.getResponse(t):null,h=Math.max(Math.ceil(s.file.size/this.asyncSettings.chunkSize),1),u={event:t,file:s.file,chunkIndex:s.chunkIndex,totalChunk:h,chunkSize:this.asyncSettings.chunkSize,response:o};if(this.trigger("chunkSuccess",u),!e.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 p={event:t,fileData:s.file,cancel:!1,customFormData:[]};this.trigger("canceling",p,function(t){if(t.cancel){s.file.statusCode="3";var o=a.querySelector("."+Bt);e.isNullOrUndefined(a)||e.isNullOrUndefined(o)||(i.hideSpinner(o),e.detach(a.querySelector(".e-spinner-pane"))),r.sendNextRequest(s)}else{s.request.emitError=!1,l.abort();var h=new FormData,u=r.element.getAttribute("name");h.append(u,s.file.name),h.append("cancel-uploading",s.file.name),h.append("cancelUploading",s.file.name),r.updateFormData(h,t.customFormData);var p=new e.Ajax(r.asyncSettings.removeUrl,"POST",!0,null);p.emitError=!1,p.onLoad=function(t){return r.removeChunkFile(t,s,n),{}},p.send(h)}})}else{if(h-1===s.chunkIndex&&h>s.chunkIndex){var d=this.pausedData.indexOf(s);return d>=0&&this.pausedData.splice(d,1),e.isNullOrUndefined(this.template)&&(e.isNullOrUndefined(n)||!n)&&a&&(a&&!e.isNullOrUndefined(a.querySelector("."+Mt))&&e.detach(a.querySelector("."+Mt)),this.removeChunkProgressBar(s)),void this.raiseSuccessEvent(t,s.file)}"4"!==s.file.statusCode&&this.sendNextRequest(s)}}else this.chunkUploadFailed(t,s)},s.prototype.sendNextRequest=function(t){t.start=t.end,t.end+=this.asyncSettings.chunkSize,t.end=Math.min(t.end,t.file.size),t.chunkIndex+=1,this.sendRequest(t.file,t)},s.prototype.removeChunkFile=function(t,s,n){if(e.isNullOrUndefined(this.template)&&e.isNullOrUndefined(n)&&!n){var a=this.getLiElement(s.file),r=a.querySelector("."+Bt),l=r;this.updateStatus(s.file,this.localizedTexts("fileUploadCancel"),"5"),this.updateProgressBarClasses(a,Ft),this.removeProgressbar(a,"failure"),r&&(r.classList.remove(Bt),r.classList.add(Ht),r.setAttribute("title",this.localizedTexts("remove")));var o=a.querySelector("."+Mt);o&&(o.classList.add(It),o.classList.remove(Mt),o.setAttribute("title",this.localizedTexts("retry"))),e.isNullOrUndefined(a)||e.isNullOrUndefined(r)||e.isNullOrUndefined(a.querySelector(".e-spinner-pane"))||(i.hideSpinner(l),e.detach(a.querySelector(".e-spinner-pane")))}},s.prototype.pauseUpload=function(t,e,i){t.file.statusCode="4",t.file.status=this.localizedTexts("pause"),this.updateMetaData(t);var s={event:e||null,file:t.file,chunkIndex:t.chunkIndex,chunkCount:Math.round(t.file.size/this.asyncSettings.chunkSize),chunkSize:this.asyncSettings.chunkSize};this.abortUpload(t,i,s),this.sequentialUpload&&this.uploadSequential()},s.prototype.abortUpload=function(t,i,s){"4"!==t.file.statusCode&&(t.request.emitError=!1,t.request.httpRequest.abort());var n=this.getLiElement(t.file);if(e.isNullOrUndefined(this.template)&&(e.isNullOrUndefined(i)||!i)&&n){var a=n.querySelector("."+Mt);a.classList.remove(Mt),a.classList.add("e-file-play-btn"),a.setAttribute("title",this.localizedTexts("resume")),a.nextElementSibling.classList.add(Ht),a.nextElementSibling.classList.remove(Bt),a.nextElementSibling.setAttribute("title",this.localizedTexts("remove"))}for(var r=0;r<this.pausedData.length;r++)this.pausedData[r].file.name===t.file.name&&this.pausedData.splice(r,1);this.pausedData.push(t),this.trigger("pausing",s)},s.prototype.resumeUpload=function(t,i,s){var n,a=this.getLiElement(t.file);e.isNullOrUndefined(a)||(n=a.querySelector(".e-file-play-btn")),e.isNullOrUndefined(n)||!e.isNullOrUndefined(s)&&s||(n.classList.remove("e-file-play-btn"),n.classList.add(Mt),n.setAttribute("title",this.localizedTexts("pause")),n.nextElementSibling.classList.remove(Ht),n.nextElementSibling.classList.add(Bt),n.nextElementSibling.setAttribute("title",this.localizedTexts("abort"))),t.file.status=this.localizedTexts("inProgress"),t.file.statusCode="3",this.updateMetaData(t);var r={event:i||null,file:t.file,chunkIndex:t.chunkIndex,chunkCount:Math.round(t.file.size/this.asyncSettings.chunkSize),chunkSize:this.asyncSettings.chunkSize};this.trigger("resuming",r);for(var l=0;l<this.pausedData.length;l++)this.pausedData[l].end===this.pausedData[l].file.size?this.chunkUploadComplete(i,t,s):this.pausedData[l].file.name===t.file.name&&(this.pausedData[l].start=this.pausedData[l].end,this.pausedData[l].end=this.pausedData[l].end+this.asyncSettings.chunkSize,this.pausedData[l].end=Math.min(this.pausedData[l].end,this.pausedData[l].file.size),this.pausedData[l].chunkIndex=this.pausedData[l].chunkIndex+1,this.sendRequest(this.pausedData[l].file,this.pausedData[l],s))},s.prototype.updateMetaData=function(t){-1===this.uploadMetaData.indexOf(t)?this.uploadMetaData.push(t):(this.uploadMetaData.splice(this.uploadMetaData.indexOf(t),1),this.uploadMetaData.push(t))},s.prototype.removeChunkProgressBar=function(t){var i=this.getLiElement(t.file);if(!e.isNullOrUndefined(i)){this.updateProgressBarClasses(i,Vt),this.removeProgressbar(i,"success");var s=i.querySelector("."+Bt);e.isNullOrUndefined(s)||(s.classList.add(Nt),s.setAttribute("title",this.localizedTexts("delete")),s.classList.remove(Bt,"e-upload-progress"))}},s.prototype.chunkUploadFailed=function(t,i,s){var n,a=this,r=Math.max(Math.ceil(i.file.size/this.asyncSettings.chunkSize),1);!e.isNullOrUndefined(this.template)||!e.isNullOrUndefined(s)&&s||(n=this.getLiElement(i.file));var l=t&&t.currentTarget?this.getResponse(t):null,o={event:t,file:i.file,chunkIndex:i.chunkIndex,totalChunk:r,chunkSize:this.asyncSettings.chunkSize,cancel:!1,response:l};this.trigger("chunkFailure",o,function(r){if(!r.cancel)if(i.retryCount<a.asyncSettings.retryCount)setTimeout(function(){a.retryRequest(n,i,s)},a.asyncSettings.retryAfterDelay);else{if(!e.isNullOrUndefined(n)){var o=n.querySelector("."+Mt)?n.querySelector("."+Mt):n.querySelector(".e-file-play-btn");e.isNullOrUndefined(o)||(o.classList.add(It),o.classList.remove(Mt,"e-file-play-btn")),a.updateProgressBarClasses(n,Ft),a.removeProgressbar(n,"failure"),n.querySelector(".e-icons").classList.remove("e-upload-progress");var h=n.querySelector("."+Bt)?n.querySelector("."+Bt):n.querySelector("."+Ht);h.classList.remove(Bt),e.isNullOrUndefined(n.querySelector("."+Mt))||e.detach(n.querySelector("."+Mt)),i.start>0?(h.classList.add(Nt),h.setAttribute("title",a.localizedTexts("delete"))):(h.classList.add(Ht),h.setAttribute("title",a.localizedTexts("remove")))}i.retryCount=0;var u=i.file,p=a.localizedTexts("uploadFailedMessage"),d={e:t,response:l,operation:"upload",file:a.updateStatus(u,p,"0",!1),statusText:p};a.trigger("failure",d,function(t){a.updateStatus(u,t.statusText,"0"),a.uploadSequential(),a.checkActionComplete(!0)})}})},s.prototype.retryRequest=function(t,i,s){e.isNullOrUndefined(this.template)&&(e.isNullOrUndefined(s)||!s)&&t&&this.updateProgressBarClasses(t,Ft),i&&(i.retryCount+=1,this.sendRequest(i.file,i))},s.prototype.checkPausePlayAction=function(t){var e=t.target,i=t.target.parentElement,s=this.fileList.indexOf(i),n=this.filesData[s],a=this.getCurrentMetaData(n);e.classList.contains(Mt)?this.pauseUpload(a,t):e.classList.contains("e-file-play-btn")?this.resumeUpload(a,t):e.classList.contains(It)&&(a.file.status===this.localizedTexts("fileUploadCancel")?this.retryUpload(a,!1):this.retryUpload(a,!0))},s.prototype.retryUpload=function(t,e){e?(t.end=t.end+this.asyncSettings.chunkSize,t.start=t.start+this.asyncSettings.chunkSize,this.sendRequest(t.file,t)):(t.file.statusCode="1",t.file.status=this.localizedTexts("readyToUploadMessage"),this.chunkUpload(t.file)),this.getLiElement(t.file).classList.add("e-restrict-retry")},s.prototype.chunkUploadInProgress=function(t,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(!e.isNullOrUndefined(a)){var r=a.querySelector("."+It);if(e.isNullOrUndefined(r)||(r.classList.add(Mt),r.setAttribute("title",this.localizedTexts("pause")),r.classList.remove(It)),!e.isNullOrUndefined(a)){if(!(a.querySelectorAll("."+Ut).length>0)){var l=a.querySelector("."+At);e.isNullOrUndefined(this.template)&&(l.classList.add("e-upload-progress"),l.classList.remove(Ft),this.createProgressBar(a),this.updateProgressBarClasses(a,"e-upload-progress"));var o=a.querySelector("."+Ht)?a.querySelector("."+Ht):a.querySelector("."+Nt);e.isNullOrUndefined(o)||(o.classList.add(Bt),o.setAttribute("title",this.localizedTexts("abort")),o.classList.remove(Ht))}if(!isNaN(Math.round(t.loaded/t.total*100))&&e.isNullOrUndefined(this.template)&&"4"!==i.file.statusCode){var h=void 0,u=Math.ceil(i.file.size/this.asyncSettings.chunkSize)-1;this.asyncSettings.chunkSize&&u&&(h=Math.round(i.chunkIndex/u*100),this.changeProgressValue(a,h.toString()+"%"))}0===i.chunkIndex&&this.checkActionButtonStatus()}if(e.isNullOrUndefined(a.querySelector("."+Mt))&&e.isNullOrUndefined(this.template)&&e.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 p=a.querySelector("."+Bt);p.parentElement.insertBefore(this.pauseButton,p),this.pauseButton.setAttribute("title",this.localizedTexts("pause")),this.pauseButton.addEventListener("click",function(t){n.checkPausePlayAction(t)},!1)}}}},s.prototype.bytesToSize=function(t){var e=-1;if(!t)return"0.0 KB";do{t/=1024,e++}while(t>99);return e>=2&&(t*=1024,e=1),Math.max(t,0).toFixed(1)+" "+["KB","MB"][e]},s.prototype.sortFileList=function(t){for(var e=t=t||this.sortFilesList,i=[],s=0;s<e.length;s++)i.push(e[s].name);for(var n=[],a=0,r=i.sort();a<r.length;a++)for(var l=r[a],s=0;s<e.length;s++)l===e[s].name&&n.push(e[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)}e.isNullOrUndefined(this.uploadWrapper)||(this.uploadWrapper.parentElement.appendChild(this.element),e.detach(this.uploadWrapper)),this.uploadWrapper=null,this.uploadWrapper=null,this.browseButton=null,this.dropAreaWrapper=null,this.dropZoneElement=null,this.dropArea=null,this.keyboardModule=null,this.clearButton=null,this.uploadButton=null,t.prototype.destroy.call(this)},s.prototype.upload=function(t,e){var i=this;if(t=t||this.filesData,this.sequentialUpload&&(this.isFirstFileOnSelection||e))this.sequenceUpload(t);else{var s=this.getFilesInArray(t),n={customFormData:[],currentRequest:null,cancel:!1};this.trigger("beforeUpload",n,function(t){t.cancel||(i.customFormDatas=t.customFormData&&t.customFormData.length>0?t.customFormData:i.customFormDatas,i.uploadFiles(s,e))})}},s.prototype.getFilesInArray=function(t){var e=[];return t&&(t instanceof Array?e=t:e.push(t)),e},s.prototype.serverReadFileBase64=function(t,e,i){var s=this;return new Promise(function(n,a){var r=s.fileStreams[t].rawFile;try{var l=new FileReader;l.onload=function(t){return function(){try{var e=t.result,i=e?e.split(";base64,")[1]:null;n(i)}catch(t){a(t)}}}(l),l.readAsDataURL(r.slice(e,e+i))}catch(t){a(t)}})},s.prototype.uploadFileCount=function(t){var e=this.filesData;return e&&0!==e.length?e.length:-1},s.prototype.getFileRead=function(t,e){var i=this.filesData;if(!i||0===i.length)return-1;var s=i[t],n=this.newFileRef++;return this.fileStreams[n]=s,n},s.prototype.uploadFiles=function(t,i){var s=[];if(""!==this.asyncSettings.saveUrl&&!e.isNullOrUndefined(this.asyncSettings.saveUrl)){if(!i||e.isNullOrUndefined(i))if(this.multiple)s=this.filterfileList(t);else{var n=[];n.push(t[0]),s=this.filterfileList(n)}else s=t;for(var a=0;a<s.length;a++)this.uploadFilesRequest(s,a,i)}},s.prototype.uploadFilesRequest=function(t,i,s){var n=this,a=this.checkChunkUpload(),r=new e.Ajax(this.asyncSettings.saveUrl,"POST",!0,null);r.emitError=!1;var l={fileData:t[i],customFormData:[],cancel:!1},o=new FormData;if(r.beforeSend=function(e){l.currentRequest=r.httpRequest,n.trigger("uploading",l,function(s){s.cancel&&n.eventCancelByArgs(e,s,t[i]),n.customFormDatas&&n.customFormDatas.length>0&&n.updateFormData(o,n.customFormDatas),n.updateFormData(o,s.customFormData)})},"1"===t[i].statusCode){var h=this.element.getAttribute("name");o.append(h,t[i].rawFile,t[i].name),a&&t[i].size>this.asyncSettings.chunkSize?this.chunkUpload(t[i],s,i):(r.onLoad=function(e){return l.cancel?{}:(n.uploadComplete(e,t[i],s),{})},r.onUploadProgress=function(e){return l.cancel?{}:(n.uploadInProgress(e,t[i],s,r),{})},r.onError=function(e){return n.uploadFailed(e,t[i]),{}},r.send(o))}},s.prototype.spliceFiles=function(t){for(var e=this.fileList[t],i=this.getFilesData(),s=+e.getAttribute("data-files-count"),n=0,a=0;a<t;a++)n+=+this.fileList[a].getAttribute("data-files-count");for(var r=n+s-1;r>=n;r--)i.splice(r,1)},s.prototype.remove=function(t,i,s,n,a){var r=this;e.isNullOrUndefined(n)&&(n=!0);var l={event:a,cancel:!1,filesData:[],customFormData:[],postRawFile:n,currentRequest:null},o={cancel:!1,customFormData:[],currentRequest:null};this.trigger("beforeRemove",o,function(n){if(!n.cancel)if(r.isFormUpload())l.filesData=t,r.trigger("removing",l,function(i){if(!i.cancel)for(var s=!1,n=void 0,a=0,l=r.getFilesInArray(t);a<l.length;a++){var o=l[a];if(s||(n=r.fileList.indexOf(o.list)),n>-1){var h=e.isNullOrUndefined(o.input)?null:o.input;h&&e.detach(h),r.spliceFiles(n),e.detach(r.fileList[n]),r.fileList.splice(n,1),s=!0,n=-1}}});else if(r.isForm&&(e.isNullOrUndefined(r.asyncSettings.removeUrl)||""===r.asyncSettings.removeUrl))l.filesData=r.getFilesData(),r.trigger("removing",l,function(t){t.cancel||r.clearAll()});else{var o=[];(t=e.isNullOrUndefined(t)?r.filesData:t)instanceof Array?o=t:o.push(t),l.filesData=o;for(var h=r.asyncSettings.removeUrl,u=""!==h&&!e.isNullOrUndefined(h),p=0,d=o;p<d.length;p++)!function(t){var e=r.uploadedFilesData.indexOf(t);("2"===t.statusCode||"4"===t.statusCode||"0"===t.statusCode&&-1!==e)&&u?r.removeUploadedFile(t,l,s,i):s?r.removeFilesData(t,i):r.trigger("removing",l,function(e){e.cancel||r.removeFilesData(t,i)}),a&&!a.target.classList.contains(Ht)&&r.checkActionComplete(!1)}(d[p])}})},s.prototype.clearAll=function(){var t=this;if(e.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(e){e.cancel||(t.clearData(),t.actionCompleteCount=0,t.count=-1)})},s.prototype.getFilesData=function(t){return e.isNullOrUndefined(t)?this.filesData:this.getSelectedFiles(t)},s.prototype.pause=function(t,e){t=t||this.filesData;var i=this.getFilesInArray(t);this.pauseUploading(i,e)},s.prototype.pauseUploading=function(t,e){for(var i=this.getFiles(t),s=0;s<i.length;s++)"3"===i[s].statusCode&&this.pauseUpload(this.getCurrentMetaData(i[s],null),null,e)},s.prototype.getFiles=function(t){var i=[];return e.isNullOrUndefined(t)||t instanceof Array?i=t:i.push(t),i},s.prototype.resume=function(t,e){t=t||this.filesData;var i=this.getFilesInArray(t);this.resumeFiles(i,e)},s.prototype.resumeFiles=function(t,e){for(var i=this.getFiles(t),s=0;s<i.length;s++)"4"===i[s].statusCode&&this.resumeUpload(this.getCurrentMetaData(i[s],null),null,e)},s.prototype.retry=function(t,e,i){t=t||this.filesData;var s=this.getFilesInArray(t);this.sequentialUpload&&this.isFirstFileOnSelection&&(this.isFirstFileOnSelection=!1),this.retryFailedFiles(s,e,i)},s.prototype.retryFailedFiles=function(t,e,i){for(var s=this.getFiles(t),n=0;n<s.length;n++)if("5"===s[n].statusCode||"0"===s[n].statusCode)if(this.asyncSettings.chunkSize>0&&this.getCurrentMetaData(s[n],null))this.retryUpload(this.getCurrentMetaData(s[n],null),e);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(t){t=t||this.filesData;var e=this.getFilesInArray(t);this.cancelUpload(e)},s.prototype.cancelUpload=function(t){var e=this.getFiles(t);if(this.asyncSettings.chunkSize>0){for(s=0;s<e.length;s++)if("3"===e[s].statusCode){var i=this.getCurrentMetaData(e[s],null);i.file.statusCode="5",i.file.status=this.localizedTexts("fileUploadCancel"),this.updateMetaData(i),this.showHideUploadSpinner(e[s])}}else for(var s=0;s<e.length;s++)"3"===e[s].statusCode&&(e[s].statusCode="5",e[s].status=this.localizedTexts("fileUploadCancel"),this.showHideUploadSpinner(e[s]))},s.prototype.showHideUploadSpinner=function(t){var s=this.getLiElement(t);if(!e.isNullOrUndefined(s)&&e.isNullOrUndefined(this.template)){var n=s.querySelector("."+Bt);i.createSpinner({target:n,width:"20px"}),i.showSpinner(n)}},wt([e.Complex({saveUrl:"",removeUrl:""},qt)],s.prototype,"asyncSettings",void 0),wt([e.Property(!1)],s.prototype,"sequentialUpload",void 0),wt([e.Property({})],s.prototype,"htmlAttributes",void 0),wt([e.Property("")],s.prototype,"cssClass",void 0),wt([e.Property(!0)],s.prototype,"enabled",void 0),wt([e.Property(null)],s.prototype,"template",void 0),wt([e.Property(!0)],s.prototype,"multiple",void 0),wt([e.Property(!0)],s.prototype,"autoUpload",void 0),wt([e.Property(!0)],s.prototype,"enableHtmlSanitizer",void 0),wt([e.Complex({},Wt)],s.prototype,"buttons",void 0),wt([e.Property("")],s.prototype,"allowedExtensions",void 0),wt([e.Property(0)],s.prototype,"minFileSize",void 0),wt([e.Property(3e7)],s.prototype,"maxFileSize",void 0),wt([e.Property(null)],s.prototype,"dropArea",void 0),wt([e.Collection([{}],zt)],s.prototype,"files",void 0),wt([e.Property(!0)],s.prototype,"showFileList",void 0),wt([e.Property(!1)],s.prototype,"directoryUpload",void 0),wt([e.Property("Default")],s.prototype,"dropEffect",void 0),wt([e.Event()],s.prototype,"created",void 0),wt([e.Event()],s.prototype,"actionComplete",void 0),wt([e.Event()],s.prototype,"rendering",void 0),wt([e.Event()],s.prototype,"beforeUpload",void 0),wt([e.Event()],s.prototype,"fileListRendering",void 0),wt([e.Event()],s.prototype,"selected",void 0),wt([e.Event()],s.prototype,"uploading",void 0),wt([e.Event()],s.prototype,"success",void 0),wt([e.Event()],s.prototype,"failure",void 0),wt([e.Event()],s.prototype,"removing",void 0),wt([e.Event()],s.prototype,"beforeRemove",void 0),wt([e.Event()],s.prototype,"clearing",void 0),wt([e.Event()],s.prototype,"progress",void 0),wt([e.Event()],s.prototype,"change",void 0),wt([e.Event()],s.prototype,"chunkSuccess",void 0),wt([e.Event()],s.prototype,"chunkFailure",void 0),wt([e.Event()],s.prototype,"chunkUploading",void 0),wt([e.Event()],s.prototype,"canceling",void 0),wt([e.Event()],s.prototype,"pausing",void 0),wt([e.Event()],s.prototype,"resuming",void 0),s=wt([e.NotifyPropertyChanges],s)}(e.Component),_t=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Xt=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},Kt="e-apply",Yt="e-ctrl-btn",Zt="e-switch-ctrl-btn",Gt="e-hide-hex-value",Jt="e-hide-switchable-value",$t="e-hide-value",Qt="e-hsv-color",te="e-selected-value",ee="e-mode-switch-btn",ie="e-nocolor-item",se="e-opacity-value",ne="e-preview-container",ae="e-show-value",re="e-selected",le="e-tile",oe={default:["#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"]},he=function(n){function a(t,e){var i=n.call(this,t,e)||this;return i.recentColors=[],i}return _t(a,n),a.prototype.preRender=function(){var t=this.element;this.formElement=e.closest(this.element,"form"),this.formElement&&e.EventHandler.add(this.formElement,"reset",this.formResetHandler,this);var i={Apply:"Apply",Cancel:"Cancel",ModeSwitcher:"Switch Mode",RecentColors:"Recent colors"};this.l10n=new e.L10n("colorpicker",i,this.locale),t.getAttribute("ejs-for")&&!t.getAttribute("name")&&t.setAttribute("name",t.id)},a.prototype.render=function(){this.initWrapper(),this.inline?this.createWidget():this.createSplitBtn(),this.enableOpacity||e.addClass([this.container.parentElement],"e-hide-opacity"),this.renderComplete()},a.prototype.initWrapper=function(){var t=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper"});this.element.parentNode.insertBefore(t,this.element),t.appendChild(this.element),e.attributes(this.element,{tabindex:"-1",spellcheck:"false","aria-label":"colorpicker"}),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);e.isNullOrUndefined(this.initialInputValue)&&(this.initialInputValue=s),this.element.value=s,this.enableOpacity?this.setProperties({value:i},!0):this.setProperties({value:s},!0),this.enableRtl&&t.classList.add("e-rtl"),this.cssClass&&e.addClass([t],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.tileRipple=e.rippleEffect(this.container,{selector:"."+le}),this.ctrlBtnRipple=e.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),e.Browser.isDevice&&this.refreshPopupPos()},a.prototype.createSplitBtn=function(){var t=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,createPopupOnClick:this.createPopupOnClick,open:this.onOpen.bind(this),click:function(){var e=new MouseEvent("click",{bubbles:!0,cancelable:!1});t.trigger("change",{currentValue:{hex:t.value.slice(0,7),rgba:t.convertToRgbString(t.hexToRgb(t.value))},previousValue:{hex:null,rgba:null},value:t.value,event:e})}}),this.splitBtn.createElement=this.createElement,this.splitBtn.appendTo(n),this.splitBtn.element.setAttribute("aria-label","colorpicker");var a=this.createElement("span",{className:"e-split-preview"});e.select(".e-selected-color",n).appendChild(a),a.style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value));var r=this.getPopupEle();if(e.addClass([r],"e-colorpicker-popup"),this.cssClass){var l=this.cssClass.replace(/\s+/g," ").trim().split(" ");r&&e.addClass([r],l),this.splitBtn&&this.splitBtn.activeElem&&this.splitBtn.activeElem[0]&&e.addClass([this.splitBtn.activeElem[0]],l),this.splitBtn&&this.splitBtn.activeElem&&this.splitBtn.activeElem[1]&&e.addClass([this.splitBtn.activeElem[1]],l),this.splitBtn&&this.splitBtn.element&&this.splitBtn.element.parentElement&&e.addClass([this.splitBtn.element.parentElement],l)}if(e.Browser.isDevice&&!this.createPopupOnClick){var o=this.getPopupInst();o.relateTo=document.body,o.position={X:"center",Y:"center"},o.targetType="container",o.collision={X:"fit",Y:"fit"},o.offsetY=4,r.style.zIndex=i.getZindexPartial(this.splitBtn.element).toString()}this.bindCallBackEvent()},a.prototype.onOpen=function(){if(this.trigger("open",{element:this.container}),!e.Browser.isDevice){var t=this.getPopupInst();i.isCollide(t.element).length>0&&(t.collision={X:"flip",Y:"fit"},t.position={X:"right",Y:"bottom"},t.targetType="container")}},a.prototype.getPopupInst=function(){return e.getInstance(this.getPopupEle(),i.Popup)},a.prototype.bindCallBackEvent=function(){var t=this;this.splitBtn.beforeOpen=function(n){var a=new s.Deferred;return t.trigger("beforeOpen",n,function(s){if(!s.cancel){var r=t.getPopupEle();if(r.style.top=e.formatUnit(0+pageYOffset),r.style.left=e.formatUnit(0+pageXOffset),r.style.display="block",t.createWidget(),r.style.display="",e.Browser.isDevice){if(t.createPopupOnClick){var l=t.getPopupInst();l.relateTo=document.body,l.position={X:"center",Y:"center"},l.targetType="container",l.collision={X:"fit",Y:"fit"},l.offsetY=4,r.style.zIndex=i.getZindexPartial(t.splitBtn.element).toString()}t.modal=t.createElement("div"),t.modal.className="e-"+t.getModuleName()+" e-modal",t.modal.style.display="none",document.body.insertBefore(t.modal,r),document.body.className+=" e-colorpicker-overflow",t.modal.style.display="block",t.modal.style.zIndex=(Number(r.style.zIndex)-1).toString()}}n.cancel=s.cancel,a.resolve(s)}),a},this.splitBtn.beforeClose=function(i){var n=new s.Deferred;if(e.isNullOrUndefined(i.event))n.resolve(i);else{var a={element:t.container,event:i.event,cancel:!1};t.trigger("beforeClose",a,function(s){e.Browser.isDevice&&i.event.target===t.modal&&(s.cancel=!0),s.cancel||(t.onPopupClose(),"keydown"===i.event.type&&27===i.event.keyCode&&t.splitBtn.element.focus()),i.cancel=s.cancel,n.resolve(s)})}return n}},a.prototype.onPopupClose=function(){this.unWireEvents(),this.destroyOtherComp(),this.container.style.width="",e.select(".e-split-preview",this.splitBtn.element).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value)),this.container.innerHTML="",e.removeClass([this.container],["e-color-picker","e-color-palette"]),e.Browser.isDevice&&this.modal&&(e.removeClass([document.body],"e-colorpicker-overflow"),this.modal.style.display="none",this.modal.outerHTML="",this.modal=null)},a.prototype.createPalette=function(){if(e.classList(this.container,["e-color-palette"],["e-color-picker"]),this.presetColors){var t=this.createElement("div",{className:"e-custom-palette"});this.appendElement(t);var i=Object.keys(this.presetColors);if(1===i.length)this.appendPalette(this.presetColors[i[0]],i[0],t);else for(var s=0,n=i.length;s<n;s++)this.appendPalette(this.presetColors[i[s]],i[s],t);e.selectAll(".e-row",t).length>10&&e.addClass([t],"e-palette-group")}else this.appendPalette(oe.default,"default");"Palette"===this.mode&&!this.modeSwitcher&&this.noColor&&this.setNoColor(),this.showRecentColors&&this.recentColors&&this.recentColors.length>0&&this.renderRecentColor();var a=parseInt(getComputedStyle(this.container).borderBottomWidth,10);this.container.style.width=e.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.renderRecentColor=function(){var t=this,i=this.container.querySelector(".e-clr-pal-rec-wpr");i&&e.detach(i);var s=this.createElement("div",{className:"e-clr-pal-rec-wpr"}),n=this.container.querySelector(".e-switch-ctrl-btn");n?this.container.insertBefore(s,n):this.container.appendChild(s);var a=this.createElement("label",{className:"e-recent-clr-span"});if(a.textContent=this.l10n.getConstant("RecentColors"),s.appendChild(a),this.recentColors.length>0){for(this.recentColors=this.recentColors.filter(function(e,i){return t.recentColors.indexOf(e)===i});this.recentColors.length>10;)this.recentColors.pop();this.appendPalette(this.recentColors,"recent-color",s)}},a.prototype.firstPaletteFocus=function(){e.select("."+re,this.container.children[0])||e.selectAll(".e-palette",this.container)[0].focus()},a.prototype.appendPalette=function(t,e,i){var s=this.createElement("div",{className:"e-palette",attrs:{tabindex:"0",role:"grid"}});"recent-color"===e&&s.classList.add("e-recent-palette"),i?i.appendChild(s):this.appendElement(s);for(var n,a,r,l=0,o=t.length;l<o;l++)0!==l&&l%this.columns!=0||(n=this.createElement("div",{className:"e-row",attrs:{role:"row"}}),s.appendChild(n)),r=this.roundValue(t[l]).toLowerCase(),a=this.createElement("span",{className:le,attrs:{role:"gridcell","aria-label":r,"aria-selected":"false"}}),this.trigger("beforeTileRender",{element:a,presetName:e,value:t[l]}),n.appendChild(a),this.value===r&&"recent-color"!==e&&(this.addTileSelection(a),s.focus()),a.style.backgroundColor=this.convertToRgbString(this.hexToRgb(r))},a.prototype.setNoColor=function(){var t=this.container.querySelector(".e-row").children[0];t.classList.add(ie),this.value||(t.classList.add(re),e.closest(t,".e-palette").focus()),["aria-selected","aria-label"].forEach(function(e){t.removeAttribute(e)}),t.style.backgroundColor=""},a.prototype.appendElement=function(t,e){void 0===e&&(e=0);var i=this.container.children[e];i?this.container.insertBefore(t,i):this.container.appendChild(t)},a.prototype.addTileSelection=function(t){t&&(t.classList.add(re),t.setAttribute("aria-selected","true"))},a.prototype.createPicker=function(){e.classList(this.container,["e-color-picker"],["e-color-palette"]);var t=this.createElement("div",{className:"e-hsv-container"});this.appendElement(t),t.appendChild(this.createElement("div",{className:Qt}));var i=this.createElement("span",{className:"e-handler",attrs:{tabindex:"0"}});t.appendChild(i),null!==this.value&&""!==this.value||(this.value="#008000ff"),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(t){void 0===t&&(t=this.hsv[0]),this.getHsvContainer().style.backgroundColor=this.convertToRgbString(this.hsvToRgb(t,100,100,1))},a.prototype.getHsvContainer=function(){return e.select(".e-hsv-container",this.container)},a.prototype.setHandlerPosition=function(){var t=this.getDragHandler(),i=e.select("."+Qt,this.container);this.enableRtl?t.style.left=e.formatUnit((i.offsetWidth-t.offsetWidth/2.5)*Math.abs(100-this.hsv[1])/100):t.style.left=e.formatUnit((i.offsetWidth-t.offsetWidth/2.5)*this.hsv[1]/100),t.style.top=e.formatUnit((i.offsetHeight-t.offsetHeight/2.5)*(100-this.hsv[2])/100)},a.prototype.createSlider=function(){var t=this.createElement("div",{className:"e-slider-preview"});this.appendElement(t,1),this.createPreview(t);var e=this.createElement("div",{className:"e-colorpicker-slider"});t.insertBefore(e,t.children[0]);var i=this.createElement("div",{className:"e-hue-slider"});e.appendChild(i),this.hueSlider=new St({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"}),e.appendChild(i),this.createOpacitySlider(i))},a.prototype.createOpacitySlider=function(t){this.opacitySlider=new St({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(t);var e=this.createElement("div",{className:"e-opacity-empty-track"});t.appendChild(e),this.updateOpacitySliderBg()},a.prototype.updateOpacitySliderBg=function(){var t=this.enableRtl?"to left":"to right",i=e.select(".e-opacity-empty-track",this.opacitySlider.element);i&&(i.style.background="linear-gradient("+t+", rgba("+this.rgb.slice(0,3)+", 0) 0%, "+this.convertToRgbString(this.rgb.slice(0,3))+" 100%)")},a.prototype.hueChange=function(t){this.hsv[0]=t.value,this.setHsvContainerBg(),this.convertToOtherFormat()},a.prototype.opacityChange=function(t){var e=t.value,i=this.rgbToHex(this.rgb);this.hsv[3]=e/100,this.rgb[3]=e/100;var s=this.rgbToHex(this.rgb);this.updateOpacityInput(e);var n=this.convertToRgbString(this.rgb);this.updatePreview(n),this.triggerEvent(s,i,n)},a.prototype.updateOpacityInput=function(t){if(this.enableOpacity&&!this.getWrapper().classList.contains($t)){var i=e.getInstance(e.select("."+se,this.container),it);i.value=t,i.dataBind()}},a.prototype.createPreview=function(t){var e=this.createElement("div",{className:ne});t.appendChild(e);var i=this.createElement("span",{className:"e-preview e-current"});e.appendChild(i);var s=this.convertToRgbString(this.rgb);i.style.backgroundColor=s,i=this.createElement("span",{className:"e-preview e-previous"}),e.appendChild(i),i.style.backgroundColor=s},a.prototype.isPicker=function(){return!this.container.classList.contains("e-color-palette")},a.prototype.getPopupEle=function(){return this.container.parentElement},a.prototype.createNumericInput=function(t,e,i,s){var n=this,a=new it({value:e,placeholder:i,min:0,max:s,format:"###.##",showSpinButton:!1,floatLabelType:"Always",enableRtl:this.enableRtl,enabled:!this.disabled,readonly:!this.isPicker(),change:function(t){t.event&&n.inputHandler(t.event)}});a.createElement=this.createElement,a.appendTo(t)},a.prototype.createInput=function(){var e=this.isPicker(),i=this.getWrapper();if(e&&!i.classList.contains($t)||!e&&i.classList.contains(ae)){var s=this.createElement("div",{className:te});e?this.appendElement(s,2):this.appendElement(s,1);var n=this.createElement("div",{className:"e-input-container"});if(s.appendChild(n),i.classList.contains("e-hide-valueswitcher")||this.appendValueSwitchBtn(s),!i.classList.contains(Gt)){var a=this.createElement("input",{className:"e-hex",attrs:{maxlength:"7",spellcheck:"false","aria-label":"HEX"}});n.appendChild(a),t.Input.createInput({element:a,floatLabelType:"Always",properties:{placeholder:"HEX",enableRtl:this.enableRtl,enabled:!this.disabled,readonly:!this.isPicker()}},this.createElement),t.Input.setValue(this.value.slice(0,7),a),a.addEventListener("input",this.inputHandler.bind(this))}if(!i.classList.contains(Jt)){var r=void 0,l=void 0;this.isRgb?(r="RGB",l=this.rgb):(r="HSV",l=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"})),l[h],r[h],255);this.enableOpacity&&this.appendOpacityValue(n)}}},a.prototype.appendOpacityValue=function(t){this.createNumericInput(t.appendChild(this.createElement("input",{className:se})),100*this.rgb[3],"A",100)},a.prototype.appendValueSwitchBtn=function(t){var e=this.createElement("button",{className:"e-icons e-css e-btn e-flat e-icon-btn e-value-switch-btn",attrs:{title:"Toggle format"}});t.appendChild(e),this.isPicker()&&!this.getWrapper().classList.contains(Jt)&&e.addEventListener("click",this.formatSwitchHandler.bind(this))},a.prototype.createCtrlBtn=function(){if(this.modeSwitcher||this.showButtons){this.l10n.setLocale(this.locale);var t=this.createElement("div",{className:Zt});if(this.container.appendChild(t),this.showButtons){var e=this.createElement("div",{className:Yt});t.appendChild(e);var i=this.l10n.getConstant("Apply");e.appendChild(this.createElement("button",{innerHTML:i,className:"e-btn e-css e-flat e-primary e-small "+Kt,attrs:{title:i}}));var s=this.l10n.getConstant("Cancel");e.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 t=this.createElement("button",{className:"e-icons e-btn e-flat e-icon-btn "+ee,attrs:{title:this.l10n.getConstant("ModeSwitcher")}});e.select("."+Zt,this.container).insertBefore(t,e.select("."+Yt,this.container))},a.prototype.createDragTooltip=function(){var t=this,s=new i.Tooltip({opensOn:"Custom",showTipPointer:!1,cssClass:"e-color-picker-tooltip",htmlAttributes:{title:"tooltip"},beforeOpen:function(e){t.tooltipEle=e.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(),this.tooltipEle.setAttribute("aria-label","colorpicker-tooltip"),e.select(".e-tip-content",this.tooltipEle).appendChild(this.createElement("div",{className:"e-tip-transparent"}))},a.prototype.getTooltipInst=function(){return e.getInstance(this.container,i.Tooltip)},a.prototype.setTooltipOffset=function(t){this.getTooltipInst().offsetY=t},a.prototype.toggleDisabled=function(t){t?this.getWrapper().classList.add("e-disabled"):this.getWrapper().classList.remove("e-disabled"),this.showButtons&&[].slice.call(e.selectAll(".e-btn",this.container)).forEach(function(i){t?e.attributes(i,{disabled:""}):i.removeAttribute("disabled")})},a.prototype.convertToRgbString=function(t){return t.length?4===t.length?"rgba("+t.join()+")":"rgb("+t.join()+")":""},a.prototype.convertToHsvString=function(t){return 4===t.length?"hsva("+t.join()+")":"hsv("+t.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(t,e){void 0===t&&(t=!1);var i=this.rgbToHex(this.rgb);this.rgb=this.hsvToRgb.apply(this,this.hsv);var s=this.rgbToHex(this.rgb),n=this.convertToRgbString(this.rgb);this.updatePreview(n),this.updateInput(s),this.triggerEvent(s,i,n,t,e)},a.prototype.updateInput=function(i){var s=this.getWrapper();s.classList.contains($t)||(s.classList.contains(Gt)||t.Input.setValue(i.substr(0,7),e.select(".e-hex",this.container)),s.classList.contains(Jt)||(this.isRgb?this.updateValue(this.rgb,!1):this.updateValue(this.hsv,!1)))},a.prototype.updatePreview=function(t){this.enableOpacity&&this.updateOpacitySliderBg(),e.select(".e-tip-transparent",this.tooltipEle).style.backgroundColor=t,e.select("."+ne+" .e-current",this.container).style.backgroundColor=t,e.select("."+ne+" .e-previous",this.container).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value))},a.prototype.getDragHandler=function(){return e.select(".e-handler",this.container)},a.prototype.removeTileSelection=function(){[].slice.call(e.selectAll("."+re,this.container)).forEach(function(t){t.classList.remove(re),t.setAttribute("aria-selected","false")})},a.prototype.convertRgbToNumberArray=function(t){return t.slice(t.indexOf("(")+1,t.indexOf(")")).split(",").map(function(t,e){return 3!==e?parseInt(t,10):parseFloat(t)})},a.prototype.getValue=function(t,e){if(t||(t=this.value),e=e?e.toLowerCase():"hex","r"===t[0]){i=this.convertRgbToNumberArray(t);if("hex"===e||"hexa"===e){s=this.rgbToHex(i);return"hex"===e?s.slice(0,7):s}return"hsv"===e?this.convertToHsvString(this.rgbToHsv.apply(this,i.slice(0,3))):"hsva"===e?this.convertToHsvString(this.rgbToHsv.apply(this,i)):"null"}if("h"===t[0]){var i=this.hsvToRgb.apply(this,this.convertRgbToNumberArray(t));if("rgba"===e)return this.convertToRgbString(i);if("hex"===e||"hexa"===e){var s=this.rgbToHex(i);return"hex"===e?s.slice(0,7):s}return"rgb"===e?this.convertToRgbString(i.slice(0,3)):"null"}t=this.roundValue(t);var n=this.hexToRgb(t);return"rgb"!==e&&"hsv"!==e||(n=n.slice(0,3)),"rgba"===e||"rgb"===e?this.convertToRgbString(n):"hsva"===e||"hsv"===e?this.convertToHsvString(this.rgbToHsv.apply(this,n)):"hex"===e?t.slice(0,7):"a"===e?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 t=this.getDragHandler();e.EventHandler.add(t,"keydown",this.pickerKeyDown,this);var i=e.select("."+Yt,this.container);i&&e.EventHandler.add(i,"keydown",this.ctrlBtnKeyDown,this),e.EventHandler.add(this.getHsvContainer(),"mousedown touchstart",this.handlerDown,this),(this.modeSwitcher||this.showButtons)&&this.addCtrlSwitchEvent(),e.EventHandler.add(e.select(".e-previous",this.container),"click",this.previewHandler,this)}else e.EventHandler.add(this.container,"click",this.paletteClickHandler,this),e.EventHandler.add(this.container,"keydown",this.paletteKeyDown,this)},a.prototype.formResetHandler=function(){this.value=this.initialInputValue,e.attributes(this.element,{value:this.initialInputValue})},a.prototype.addCtrlSwitchEvent=function(){var t=e.select("."+Zt,this.container);t&&e.EventHandler.add(t,"click",this.btnClickHandler,this)},a.prototype.ctrlBtnKeyDown=function(t){if(13===t.keyCode){if(e.select("."+Kt,this.container)){var i=this.rgbToHex(this.rgb);this.triggerChangeEvent(i)}this.splitBtn.element.focus()}},a.prototype.pickerKeyDown=function(t){switch(t.keyCode){case 39:this.handlerDragPosition(1,this.enableRtl?-1:1,t);break;case 37:this.handlerDragPosition(1,this.enableRtl?1:-1,t);break;case 38:this.handlerDragPosition(2,1,t);break;case 40:this.handlerDragPosition(2,-1,t);break;case 13:t.preventDefault();var e=this.rgbToHex(this.rgb);this.enterKeyHandler(e)}},a.prototype.enterKeyHandler=function(t){this.triggerChangeEvent(t),this.inline||this.splitBtn.element.focus()},a.prototype.closePopup=function(t){var e=this,i={element:this.container,event:t,cancel:!1};this.trigger("beforeClose",i,function(t){t.cancel||(e.splitBtn.toggle(),e.onPopupClose())})},a.prototype.triggerChangeEvent=function(t,e){var i=t.slice(0,7);this.trigger("change",{currentValue:{hex:i,rgba:this.convertToRgbString(this.rgb)},event:e,previousValue:{hex:this.value.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(this.value))},value:this.enableOpacity?t:i}),this.showRecentColors&&(this.recentColors.unshift(i),this.inline&&this.renderRecentColor()),this.enableOpacity?this.setProperties({value:t},!0):this.setProperties({value:i},!0),this.element.value=i||"#000000"},a.prototype.handlerDragPosition=function(t,e,i){i.preventDefault(),this.hsv[t]+=e*(i.ctrlKey?1:3),this.hsv[t]<0&&(this.hsv[t]=0),this.updateHsv(),this.convertToOtherFormat(!0,i)},a.prototype.handlerDown=function(t){t.preventDefault(),"mousedown"===t.type?(this.clientX=Math.abs(t.pageX-pageXOffset),this.clientY=Math.abs(t.pageY-pageYOffset),this.setTooltipOffset(8)):(this.clientX=Math.abs(t.changedTouches[0].pageX-pageXOffset),this.clientY=Math.abs(t.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(!1,t),this.getDragHandler().focus(),e.EventHandler.add(document,"mousemove touchmove",this.handlerMove,this),e.EventHandler.add(document,"mouseup touchend",this.handlerEnd,this)},a.prototype.handlerMove=function(t){"touchmove"!==t.type&&t.preventDefault();var i,s;"mousemove"===t.type?(i=Math.abs(t.pageX-pageXOffset),s=Math.abs(t.pageY-pageYOffset)):(i=Math.abs(t.changedTouches[0].pageX-pageXOffset),s=Math.abs(t.changedTouches[0].pageY-pageYOffset)),this.setHsv(i,s);var n=this.getDragHandler();this.updateHsv(),this.convertToOtherFormat(!1,t),this.getTooltipInst().refresh(n),this.tooltipEle.style.transform||(Math.abs(this.clientX-i)>8||Math.abs(this.clientY-s)>8)&&(e.select("."+Qt,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(t,i){var s=e.select("."+Qt,this.container),n=s.getBoundingClientRect();t=this.enableRtl?t>n.right?0:Math.abs(t-n.right):t>n.left?Math.abs(t-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,t-s.offsetLeft))/s.offsetWidth))/10},a.prototype.handlerEnd=function(t){"touchend"!==t.type&&t.preventDefault(),e.EventHandler.remove(document,"mousemove touchmove",this.handlerMove),e.EventHandler.remove(document,"mouseup touchend",this.handlerEnd);var i=this.getDragHandler();e.select("."+Qt,this.container).style.cursor="",this.tooltipEle.style.transform&&(this.tooltipEle.style.transform="",i.classList.remove("e-hide-handler")),this.inline||this.showButtons||this.closePopup(t)},a.prototype.btnClickHandler=function(t){var i=t.target;e.closest(i,"."+ee)?(t.stopPropagation(),this.switchToPalette()):(i.classList.contains(Kt)||i.classList.contains("e-cancel"))&&this.ctrlBtnClick(i,t)},a.prototype.switchToPalette=function(){this.trigger("beforeModeSwitch",{element:this.container,mode:"Palette"}),this.unWireEvents(),this.destroyOtherComp(),e.detach(e.select(".e-slider-preview",this.container)),this.getWrapper().classList.contains($t)||e.remove(e.select("."+te,this.container)),e.detach(this.getHsvContainer()),this.createPalette(),this.firstPaletteFocus(),this.createInput(),this.refreshPopupPos(),this.element.parentElement&&this.element.parentElement.parentElement&&this.element.parentElement.parentElement.classList.contains("e-ie-ddb-popup")&&this.refreshImageEditorPopupPos(),this.wireEvents(),this.trigger("onModeSwitch",{element:this.container,mode:"Palette"})},a.prototype.refreshImageEditorPopupPos=function(){if(e.Browser.isDevice){var t=this.getPopupEle();t.style.left=e.formatUnit(0+pageXOffset),t.style.top=e.formatUnit(0+pageYOffset);var i=document.querySelector("#"+this.element.parentElement.parentElement.id.split("-popup")[0]);i&&t.parentElement.ej2_instances[0].refreshPosition(i)}},a.prototype.refreshPopupPos=function(){if(!this.inline){var t=this.getPopupEle();t.style.left=e.formatUnit(0+pageXOffset),t.style.top=e.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(t,i,s,n){for(var a,r=["e-rh-value","e-gs-value","e-bv-value"],l=0,o=r.length;l<o;l++)(a=e.getInstance(e.select("."+r[l],this.container),it)).value=Math.round(t[l]),i&&(a.placeholder=r[l].substr(s,1).toUpperCase(),a.max=n?n[l]:255),a.dataBind()},a.prototype.previewHandler=function(t){var i=t.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),e.select("."+ne+" .e-current",this.container).style.backgroundColor=this.convertToRgbString(this.rgb),this.triggerEvent(n,s,this.convertToRgbString(this.rgb),!1,t)},a.prototype.paletteClickHandler=function(t){t.preventDefault();var i=t.target;if(i.classList.contains(le)){if(this.removeTileSelection(),this.addTileSelection(i),i.classList.contains(ie))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(ae)&&this.updateInput(s),this.triggerEvent(s,n,this.convertToRgbString(this.rgb),!1,t)}this.inline||this.showButtons||this.closePopup(t)}else e.closest(i,"."+ee)?this.switchToPicker():i.classList.contains(Kt)||i.classList.contains("e-cancel")?this.ctrlBtnClick(i,t):this.getWrapper().classList.contains(ae)&&e.closest(i,".e-value-switch-btn")&&this.formatSwitchHandler()},a.prototype.noColorTile=function(t){void 0===t&&(t=!1);var e=this.rgbToHex(this.rgb);this.rgb=[],this.hsv=[],this.triggerEvent("",e,"",t)},a.prototype.switchToPicker=function(){var t=this.getWrapper();this.trigger("beforeModeSwitch",{element:this.container,mode:"Picker"}),this.unWireEvents(),[].slice.call(e.selectAll(".e-palette",this.container)).forEach(function(t){e.detach(t)}),this.container.querySelector(".e-clr-pal-rec-wpr")&&e.detach(this.container.querySelector(".e-clr-pal-rec-wpr")),t.classList.contains(ae)&&e.detach(e.select("."+te,this.container)),this.container.style.width="";var i=e.select(".e-custom-palette",this.container);this.presetColors&&e.remove(i),this.createPicker(),this.getDragHandler().focus(),this.createInput(),this.refreshPopupPos(),this.element.parentElement&&this.element.parentElement.parentElement&&this.element.parentElement.parentElement.classList.contains("e-ie-ddb-popup")&&this.refreshImageEditorPopupPos(),this.wireEvents(),this.trigger("onModeSwitch",{element:this.container,mode:"Picker"})},a.prototype.ctrlBtnClick=function(t,e){if(t.classList.contains(Kt)){var i=this.rgbToHex(this.rgb);this.triggerChangeEvent(i,e)}if(this.inline){if(t.classList.contains("e-cancel")){var s={element:this.container,event:e,cancel:!1};this.trigger("beforeClose",s)}}else this.closePopup(e),this.splitBtn.element.focus()},a.prototype.paletteKeyDown=function(t){var i=t.target;if(i.classList.contains("e-palette")){var s,n,a=[].slice.call(e.selectAll("."+le,i)),r=a.filter(function(t){return t.classList.contains("e-selected")}).pop();switch(!t.altKey&&t.keyCode){case 39:t.preventDefault(),s=r?a[this.tilePosition(a,r,this.enableRtl?-1:1)]:a[this.enableRtl?a.length-1:0],this.keySelectionChanges(s);break;case 37:t.preventDefault(),s=r?a[this.tilePosition(a,r,this.enableRtl?1:-1)]:a[this.enableRtl?0:a.length-1],this.keySelectionChanges(s);break;case 38:t.preventDefault(),s=a[n=r?this.tilePosition(a,r,-this.columns):0]?a[n]:a[n-this.columns],this.keySelectionChanges(s);break;case 40:t.preventDefault(),a[n=r?this.tilePosition(a,r,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(t.preventDefault(),r){var l=r.getAttribute("aria-label");this.enterKeyHandler(l||"")}}}},a.prototype.keySelectionChanges=function(t){if(this.removeTileSelection(),this.addTileSelection(t),t.classList.contains(ie))this.noColorTile(!0);else{var e=t.getAttribute("aria-label"),i=this.rgbToHex(this.rgb);this.rgb=this.hexToRgb(e),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.getWrapper().classList.contains(ae)&&this.updateInput(e),this.triggerEvent(e,i,this.convertToRgbString(this.rgb),!0)}},a.prototype.tilePosition=function(t,e,i){var s=(t=Array.prototype.slice.call(t)).length,n=this.columns-t[s-1].parentElement.childElementCount,a=t.indexOf(e);return a+=i,a<0?a+=s+n:a%=s+n,a},a.prototype.inputHandler=function(t){var i=t.target;if(i.value.length){var s,n;switch(e.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,t);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,null,t));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,null,t));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,null,t));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(!1,t));break;case"V":this.hsv[2]!==Number(i.value)&&(this.hsv[2]=Number(i.value),this.updateHsv(),this.convertToOtherFormat(!1,t));break;case"A":this.opacitySlider.value=Number(i.value)}}},a.prototype.inputValueChange=function(t,e,i,s){t[0]!==this.hsv[0]&&(this.hueSlider.setProperties({value:t[0]},!0),this.hueSlider.refresh(),this.setHsvContainerBg(t[0])),this.hsv=t;var n=this.rgbToHex(this.rgb);this.setHandlerPosition(),this.updateInput(i||n);var a=this.convertToRgbString(this.rgb);this.updatePreview(a),this.triggerEvent(n,e,a,!1,s)},a.prototype.triggerEvent=function(t,i,s,n,a){void 0===n&&(n=!1);var r=t.slice(0,7);e.isNullOrUndefined(a)&&(a=new MouseEvent("click",{bubbles:!0,cancelable:!1})),this.showButtons||n?this.trigger("select",{currentValue:{hex:r,rgba:s},event:a,previousValue:{hex:i.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(i))}}):(this.trigger("change",{currentValue:{hex:r,rgba:s},event:a,previousValue:{hex:this.value.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(this.value))},value:t}),this.showRecentColors&&(this.recentColors.unshift(r),this.inline&&this.renderRecentColor()),this.enableOpacity?this.setProperties({value:t},!0):this.setProperties({value:r},!0),this.element.value=r||"#000000")},a.prototype.destroy=function(){var t=this,i=this.getWrapper();n.prototype.destroy.call(this),["tabindex","spellcheck"].forEach(function(e){t.element.removeAttribute(e)}),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&&e.detach(this.element.nextElementSibling),i&&(i.parentElement.insertBefore(this.element,i),e.detach(i)),this.container=null,this.formElement&&e.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},a.prototype.destroyOtherComp=function(){if(this.isPicker()){for(var t=e.closest(this.hueSlider.element,".e-color-picker").querySelectorAll(".e-numerictextbox"),i=0;i<t.length;i++)e.getInstance(t[i],it).destroy();this.hueSlider.destroy(),this.enableOpacity&&(this.opacitySlider.destroy(),this.opacitySlider=null),this.hueSlider=null;var s=this.getTooltipInst();s.close(),s.destroy(),this.tooltipEle=null}},a.prototype.isPopupOpen=function(){return this.getPopupEle().classList.contains("e-popup-open")},a.prototype.unWireEvents=function(){if(this.isPicker()){var t=this.getDragHandler();e.EventHandler.remove(t,"keydown",this.pickerKeyDown);var i=e.select("."+Yt,this.container);i&&e.EventHandler.remove(i,"keydown",this.ctrlBtnKeyDown),e.EventHandler.remove(this.getHsvContainer(),"mousedown touchstart",this.handlerDown),(this.modeSwitcher||this.showButtons)&&e.EventHandler.remove(e.select("."+Zt,this.container),"click",this.btnClickHandler),e.EventHandler.remove(e.select(".e-previous",this.container),"click",this.previewHandler)}else e.EventHandler.remove(this.container,"click",this.paletteClickHandler),e.EventHandler.remove(this.container,"keydown",this.paletteKeyDown)},a.prototype.roundValue=function(t){if(!t)return"";"#"!==t[0]&&(t="#"+t);var e=t.length;if(4===e&&(t+="f",e=5),5===e){for(var i="",s=1,n=t.length;s<n;s++)i+=t.charAt(s)+t.charAt(s);t="#"+i,e=9}return 7===e&&(t+="ff"),t},a.prototype.hexToRgb=function(t){if(!t)return[];9!==(t=t.trim()).length&&(t=this.roundValue(t));var e=Number((parseInt(t.slice(-2),16)/255).toFixed(2));t=t.slice(1,7);var i=parseInt(t,16),s=[];return s.push(i>>16&255),s.push(i>>8&255),s.push(255&i),s.push(e),s},a.prototype.rgbToHsv=function(t,i,s,n){if(this.rgb&&!this.rgb.length)return[];t/=255,i/=255,s/=255;var a,r=Math.max(t,i,s),l=Math.min(t,i,s),o=r,h=r-l,u=0===r?0:h/r;if(r===l)a=0;else{switch(r){case t:a=(i-s)/h+(i<s?6:0);break;case i:a=(s-t)/h+2;break;case s:a=(t-i)/h+4}a/=6}var p=[Math.round(360*a),Math.round(1e3*u)/10,Math.round(1e3*o)/10];return e.isNullOrUndefined(n)||p.push(n),p},a.prototype.hsvToRgb=function(t,i,s,n){var a,r,l;if(i/=100,s/=100,0===i)return a=r=l=s,[Math.round(255*a),Math.round(255*r),Math.round(255*l),n];t/=60;var o=Math.floor(t),h=t-o,u=s*(1-i),p=s*(1-i*h),d=s*(1-i*(1-h));switch(o){case 0:a=s,r=d,l=u;break;case 1:a=p,r=s,l=u;break;case 2:a=u,r=s,l=d;break;case 3:a=u,r=p,l=s;break;case 4:a=d,r=u,l=s;break;default:a=s,r=u,l=p}var c=[Math.round(255*a),Math.round(255*r),Math.round(255*l)];return e.isNullOrUndefined(n)||c.push(n),c},a.prototype.rgbToHex=function(t){return t.length?"#"+this.hex(t[0])+this.hex(t[1])+this.hex(t[2])+(e.isNullOrUndefined(t[3])?"":0!==t[3]?(Math.round(255*t[3])+65536).toString(16).substr(-2):"00"):""},a.prototype.hex=function(t){return("0"+t.toString(16)).slice(-2)},a.prototype.changeModeSwitcherProp=function(t){var i=e.select("."+Zt,this.container);t?i?this.appendModeSwitchBtn():(this.createCtrlBtn(),this.isPicker()&&!this.disabled&&this.addCtrlSwitchEvent()):i&&(this.showButtons?e.detach(e.select("."+ee,i)):e.remove(i))},a.prototype.changeShowBtnProps=function(t){var i=e.select("."+Zt,this.container);t?(i&&e.remove(i),this.createCtrlBtn(),this.isPicker()&&!this.disabled&&this.addCtrlSwitchEvent()):this.modeSwitcher?e.detach(e.select("."+Yt,i)):e.remove(i)},a.prototype.changeValueProp=function(t){if(this.isPicker())this.rgb=this.hexToRgb(t),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.setHandlerPosition(),e.detach(e.closest(this.hueSlider.element,".e-slider-preview")),this.createSlider(),this.setHsvContainerBg(),this.updateInput(t),4===this.rgb.length&&this.updateOpacityInput(100*this.rgb[3]);else{this.removeTileSelection();var i=this.container.querySelector('span[aria-label="'+this.roundValue(t)+'"]');i&&this.addTileSelection(i)}},a.prototype.setInputEleProps=function(){e.remove(e.select("."+te,this.container)),this.createInput()},a.prototype.changeDisabledProp=function(t){this.isPicker()&&(this.hueSlider.enabled=!t,this.opacitySlider.enabled=!t,this.setInputEleProps()),t?(this.toggleDisabled(!0),this.unWireEvents()):(this.toggleDisabled(!1),this.wireEvents())},a.prototype.changeCssClassProps=function(t,i){var s=this.getWrapper(),n=this.getPopupEle();i&&(e.removeClass([s,n],i.split(" ")),this.splitBtn&&this.splitBtn.activeElem&&this.splitBtn.activeElem[0]&&this.splitBtn.activeElem[1]&&e.removeClass([this.splitBtn.activeElem[0],this.splitBtn.activeElem[1]],i.split(" ")),this.splitBtn&&this.splitBtn.element&&this.splitBtn.element.parentElement&&e.removeClass([this.splitBtn.element.parentElement],i.split(" "))),t&&(e.addClass([s,n],t.replace(/\s+/g," ").trim().split(" ")),this.splitBtn&&this.splitBtn.activeElem&&this.splitBtn.activeElem[0]&&this.splitBtn.activeElem[1]&&e.addClass([this.splitBtn.activeElem[0],this.splitBtn.activeElem[1]],t.replace(/\s+/g," ").trim().split(" ")),this.splitBtn&&this.splitBtn.element&&this.splitBtn.element.parentElement&&e.addClass([this.splitBtn.element.parentElement],t.replace(/\s+/g," ").trim().split(" ")))},a.prototype.changeRtlProps=function(t){t?e.addClass([this.getWrapper()],"e-rtl"):e.removeClass([this.getWrapper()],"e-rtl")},a.prototype.changePaletteProps=function(){e.detach(this.container.children[0]),this.container.style.width="",this.createPalette()},a.prototype.changeOpacityProps=function(t){var i=this.getWrapper();t?(e.removeClass([this.container.parentElement],"e-hide-opacity"),this.createOpacitySlider(e.select(".e-colorpicker-slider",this.container).appendChild(this.createElement("div",{className:"e-opacity-slider"}))),i.classList.contains($t)||i.classList.contains(Jt)||this.appendOpacityValue(e.select(".e-input-container",this.container))):(e.addClass([this.container.parentElement],"e-hide-opacity"),this.opacitySlider.destroy(),e.remove(this.opacitySlider.element),this.opacitySlider=null,i.classList.contains($t)||i.classList.contains(Jt)||e.remove(e.select("."+se,this.container).parentElement))},a.prototype.onPropertyChanged=function(t,i){var n=this;if(!e.isNullOrUndefined(t.value)){var a=this.roundValue(t.value);if(9===a.length)this.element.value=this.roundValue(a).slice(0,7),(r=this.splitBtn&&e.select(".e-split-preview",this.splitBtn.element))&&(r.style.backgroundColor=this.convertToRgbString(this.hexToRgb(t.value)));else if(this.noColor&&"Palette"===this.mode&&""===this.value){var r=this.splitBtn&&e.select(".e-split-preview",this.splitBtn.element);r.style.backgroundColor=""}else this.value=i.value}if(!this.inline&&e.isNullOrUndefined(t.inline)){var l=["disabled","enableRtl"];if(this.splitBtn.setProperties(s.getModel(t,l)),!this.isPopupOpen())return this.changeCssClassProps(t.cssClass,i.cssClass),void this.changeRtlProps(t.enableRtl)}for(var o=this,h=0,u=Object.keys(t);h<u.length;h++)!function(s){switch(s){case"inline":t.inline?(o.getWrapper().appendChild(o.container),o.splitBtn.destroy(),e.detach(o.element.nextElementSibling),o.container.children.length||o.createWidget()):(o.destroyOtherComp(),o.unWireEvents(),o.container.innerHTML="",o.createSplitBtn());break;case"cssClass":o.changeCssClassProps(t.cssClass,i.cssClass);var a=t.cssClass.split(" ").concat(i.cssClass.split(" ")),r=0;(a=a.reduce(function(t,e){return t.indexOf(e)<0&&t.push(e),t},[])).forEach(function(t){0!==r||t!==$t&&"e-hide-valueswitcher"!==t&&t!==ae&&t!==Gt&&t!==Jt||(e.select("."+te,n.container)&&e.remove(e.select("."+te,n.container)),n.createInput(),r++)});break;case"enableRtl":o.isPicker()&&(o.hueSlider.enableRtl=t.enableRtl,o.enableOpacity&&(o.opacitySlider.enableRtl=t.enableRtl),o.setInputEleProps()),o.changeRtlProps(t.enableRtl);break;case"disabled":o.changeDisabledProp(t.disabled);break;case"value":o.value!==i.value&&o.changeValueProp(t.value);break;case"showButtons":o.changeShowBtnProps(t.showButtons);break;case"mode":"Picker"===t.mode?o.switchToPicker():o.switchToPalette();break;case"modeSwitcher":o.changeModeSwitcherProp(t.modeSwitcher);break;case"columns":case"presetColors":o.isPicker()||o.changePaletteProps();break;case"noColor":t.noColor?"Palette"!==o.mode||o.modeSwitcher||o.setNoColor():o.changePaletteProps();break;case"enableOpacity":o.changeOpacityProps(t.enableOpacity);break;case"showRecentColors":if(!t.showRecentColors){var l=o.container.querySelector(".e-clr-pal-rec-wpr");l&&e.detach(l)}o.recentColors=[]}}(u[h])},a.prototype.focusIn=function(){this.element.parentElement.focus()},Xt([e.Property("#008000ff")],a.prototype,"value",void 0),Xt([e.Property("")],a.prototype,"cssClass",void 0),Xt([e.Property(!1)],a.prototype,"disabled",void 0),Xt([e.Property("Picker")],a.prototype,"mode",void 0),Xt([e.Property(!0)],a.prototype,"modeSwitcher",void 0),Xt([e.Property(null)],a.prototype,"presetColors",void 0),Xt([e.Property(!0)],a.prototype,"showButtons",void 0),Xt([e.Property(10)],a.prototype,"columns",void 0),Xt([e.Property(!1)],a.prototype,"inline",void 0),Xt([e.Property(!1)],a.prototype,"noColor",void 0),Xt([e.Property(!1)],a.prototype,"enablePersistence",void 0),Xt([e.Property(!0)],a.prototype,"enableOpacity",void 0),Xt([e.Property(!1)],a.prototype,"createPopupOnClick",void 0),Xt([e.Property(!1)],a.prototype,"showRecentColors",void 0),Xt([e.Event()],a.prototype,"select",void 0),Xt([e.Event()],a.prototype,"change",void 0),Xt([e.Event()],a.prototype,"beforeTileRender",void 0),Xt([e.Event()],a.prototype,"beforeOpen",void 0),Xt([e.Event()],a.prototype,"open",void 0),Xt([e.Event()],a.prototype,"beforeClose",void 0),Xt([e.Event()],a.prototype,"beforeModeSwitch",void 0),Xt([e.Event()],a.prototype,"onModeSwitch",void 0),Xt([e.Event()],a.prototype,"created",void 0),a=Xt([e.NotifyPropertyChanges],a)}(e.Component),ue=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),pe=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},de=function(i){function s(t,e){var s=i.call(this,t,e)||this;return s.previousValue=null,s.isHiddenInput=!1,s.isForm=!1,s.inputPreviousValue=null,s.textboxOptions=t,s}return ue(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":t.Input.removeFloating(this.textboxWrapper),t.Input.addFloating(this.respectiveElement,this.floatLabelType,this.placeholder);break;case"enabled":t.Input.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container),this.bindClearEvent();break;case"width":t.Input.setWidth(i.width,this.textboxWrapper.container);break;case"value":var r=this.isProtectedOnChange;this.isProtectedOnChange=!0,t.Input.isBlank(this.value)||(this.value=this.value.toString()),this.isProtectedOnChange=r,t.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):(e.isNullOrUndefined(this.isAngular)||!this.isAngular||this.isAngular&&!this.preventChange||this.isAngular&&e.isNullOrUndefined(this.preventChange))&&this.raiseChangeEvent();break;case"htmlAttributes":this.updateHTMLAttributesToElement(),this.updateHTMLAttributesToWrapper(),this.checkAttributes(!0),this.multiline&&!e.isNullOrUndefined(this.textarea)?t.Input.validateInputType(this.textboxWrapper.container,this.textarea):t.Input.validateInputType(this.textboxWrapper.container,this.element);break;case"readonly":t.Input.setReadonly(this.readonly,this.respectiveElement);break;case"type":"TEXTAREA"!==this.respectiveElement.tagName&&(this.respectiveElement.setAttribute("type",this.type),t.Input.validateInputType(this.textboxWrapper.container,this.element),this.raiseChangeEvent());break;case"showClearButton":t.Input.setClearButton(this.showClearButton,this.respectiveElement,this.textboxWrapper),this.bindClearEvent();break;case"enableRtl":t.Input.setEnableRtl(this.enableRtl,[this.textboxWrapper.container]);break;case"placeholder":t.Input.setPlaceholder(this.placeholder,this.respectiveElement),t.Input.calculateWidth(this.respectiveElement,this.textboxWrapper.container);break;case"autocomplete":"on"!==this.autocomplete&&""!==this.autocomplete?this.respectiveElement.autocomplete=this.autocomplete:this.removeAttributes(["autocomplete"]);break;case"cssClass":t.Input.updateCssClass(i.cssClass,s.cssClass,this.textboxWrapper.container);break;case"locale":this.globalize=new e.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),t.Input.setPlaceholder(this.placeholder,this.respectiveElement)}},s.prototype.getModuleName=function(){return"textbox"},s.prototype.preRender=function(){if(this.cloneElement=this.element.cloneNode(!0),this.formElement=e.closest(this.element,"form"),e.isNullOrUndefined(this.formElement)||(this.isForm=!0),"EJS-TEXTBOX"===this.element.tagName){var t=e.getValue("ej2_instances",this.element),i=this.multiline?this.createElement("textarea"):this.createElement("input");for(a=0;a<this.element.attributes.length;a++)"id"!==(r=this.element.attributes[a].nodeName)&&"class"!==r?(i.setAttribute(r,this.element.attributes[a].nodeValue),i.innerHTML=this.element.innerHTML,"name"===r&&this.element.removeAttribute("name")):"class"===r&&i.setAttribute(r,this.element.className.split(" ").filter(function(t){return 0!==t.indexOf("ng-")}).join(" "));this.element.appendChild(i),this.element=i,e.setValue("ej2_instances",t,this.element)}this.updateHTMLAttributesToElement(),this.checkAttributes(!1),!e.isNullOrUndefined(this.textboxOptions)&&void 0!==this.textboxOptions.value||""===this.element.value||this.setProperties({value:this.element.value},!0),"TEXTAREA"!==this.element.tagName&&this.element.setAttribute("type",this.type),("text"===this.type||"INPUT"===this.element.tagName&&this.multiline&&this.isReact)&&this.element.setAttribute("role","textbox"),this.globalize=new e.Internationalization(this.locale);var s={placeholder:this.placeholder};if(this.l10n=new e.L10n("textbox",s,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.element.hasAttribute("id")||this.element.setAttribute("id",e.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",e.getUniqueID("textarea"));for(var n=["placeholder","disabled","value","readonly","type","autocomplete"],a=0;a<this.element.attributes.length;a++){var r=this.element.attributes[a].nodeName;this.element.hasAttribute(r)&&Z.indexOf(r)<0&&"id"!==r&&"type"!==r&&"e-mappinguid"!==r&&(this.textarea.setAttribute(r,this.element.attributes[a].nodeValue),n.indexOf(r)<0&&(this.element.removeAttribute(r),a--))}}},s.prototype.checkAttributes=function(t){for(var i=0,s=t?e.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly","type","autocomplete"];i<s.length;i++){var n=s[i];if(!e.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"disabled":if(e.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.enabled||t){var a="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n);this.setProperties({enabled:a},!t)}break;case"readonly":if(e.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.readonly||t){var r="readonly"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n);this.setProperties({readonly:r},!t)}break;case"placeholder":(e.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"autocomplete":if(e.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.autocomplete||t){var l="off"===this.element.autocomplete?"off":"on";this.setProperties({autocomplete:l},!t)}break;case"value":(e.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.value||t)&&""!==this.element.value&&this.setProperties({value:this.element.value},!t);break;case"type":(e.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.type||t)&&this.setProperties({type:this.element.type},!t)}}},s.prototype.render=function(){var i=this.cssClass;e.isNullOrUndefined(this.cssClass)||""===this.cssClass||(i=t.Input.getInputValidClassList(this.cssClass)),this.respectiveElement=this.isHiddenInput?this.textarea:this.element,this.textboxWrapper=t.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.updateHTMLAttributesToWrapper(),this.isHiddenInput&&this.respectiveElement.parentNode.insertBefore(this.element,this.respectiveElement),this.wireEvents(),e.isNullOrUndefined(this.value)||(t.Input.setValue(this.value,this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value)),e.isNullOrUndefined(this.value)||(this.initialValue=this.value,this.setInitialValue()),"on"!==this.autocomplete&&""!==this.autocomplete?this.respectiveElement.autocomplete=this.autocomplete:e.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,t.Input.setWidth(this.width,this.textboxWrapper.container),!e.isNullOrUndefined(e.closest(this.element,"fieldset"))&&e.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.element.hasAttribute("aria-labelledby")||this.element.hasAttribute("placeholder")||this.element.hasAttribute("aria-label")||this.element.setAttribute("aria-label","textbox"),this.renderComplete()},s.prototype.updateHTMLAttributesToWrapper=function(){t.Input.updateHTMLAttributesToWrapper(this.htmlAttributes,this.textboxWrapper.container)},s.prototype.updateHTMLAttributesToElement=function(){t.Input.updateHTMLAttributesToElement(this.htmlAttributes,this.respectiveElement?this.respectiveElement:this.multiline&&!e.isNullOrUndefined(this.textarea)?this.textarea:this.element)},s.prototype.setInitialValue=function(){this.isAngular||this.respectiveElement.setAttribute("value",this.initialValue)},s.prototype.wireEvents=function(){e.EventHandler.add(this.respectiveElement,"focus",this.focusHandler,this),e.EventHandler.add(this.respectiveElement,"blur",this.focusOutHandler,this),e.EventHandler.add(this.respectiveElement,"keydown",this.keydownHandler,this),e.EventHandler.add(this.respectiveElement,"input",this.inputHandler,this),e.EventHandler.add(this.respectiveElement,"change",this.changeHandler,this),this.isForm&&e.EventHandler.add(this.formElement,"reset",this.resetForm,this),this.bindClearEvent(),!e.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")&&e.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 t=this.textboxWrapper.container.querySelector(".e-float-text");e.isNullOrUndefined(t)||(t.classList.add("e-label-top"),t.classList.contains("e-label-bottom")&&t.classList.remove("e-label-bottom"))},s.prototype.resetValue=function(t){var e=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.value=t,null!=t||!this.textboxWrapper.container.classList.contains("e-valid-input")||"Always"===this.floatLabelType&&this.textboxWrapper.container.classList.contains("e-outline")||this.textboxWrapper.container.classList.remove("e-valid-input"),this.isProtectedOnChange=e},s.prototype.resetForm=function(){if(this.isAngular?this.resetValue(""):this.resetValue(this.initialValue),!e.isNullOrUndefined(this.textboxWrapper)){var t=this.textboxWrapper.container.querySelector(".e-float-text");e.isNullOrUndefined(t)||"Always"===this.floatLabelType||(e.isNullOrUndefined(this.initialValue)||""===this.initialValue?(t.classList.add("e-label-bottom"),t.classList.remove("e-label-top")):""!==this.initialValue&&(t.classList.add("e-label-top"),t.classList.remove("e-label-bottom")))}},s.prototype.focusHandler=function(t){var e={container:this.textboxWrapper.container,event:t,value:this.value};this.trigger("focus",e)},s.prototype.focusOutHandler=function(t){null===this.previousValue&&null===this.value&&""===this.respectiveElement.value||this.previousValue===this.value||this.raiseChangeEvent(t,!0);var e={container:this.textboxWrapper.container,event:t,value:this.value};this.trigger("blur",e)},s.prototype.keydownHandler=function(t){13!==t.keyCode&&9!==t.keyCode||!(null!==this.previousValue&&""!==this.previousValue||null!==this.value&&""!==this.value||""!==this.respectiveElement.value)||this.setProperties({value:this.respectiveElement.value},!0)},s.prototype.inputHandler=function(t){var e=this,i={event:t,value:this.respectiveElement.value,previousValue:this.inputPreviousValue,container:this.textboxWrapper.container};this.inputPreviousValue=this.respectiveElement.value,this.isAngular&&(e.localChange({value:this.respectiveElement.value}),this.preventChange=!0),this.isVue&&(this.preventChange=!0),this.trigger("input",i),t.stopPropagation()},s.prototype.changeHandler=function(t){this.setProperties({value:this.respectiveElement.value},!0),this.previousValue!==this.value&&this.raiseChangeEvent(t,!0),t.stopPropagation()},s.prototype.raiseChangeEvent=function(t,i){var s={event:t,value:this.value,previousValue:this.previousValue,container:this.textboxWrapper.container,isInteraction:i||!1,isInteracted:i||!1};this.preventChange=!1,this.trigger("change",s),this.previousValue=this.value,"INPUT"===this.element.tagName&&this.multiline&&"mozilla"===e.Browser.info.name&&(this.element.value=this.respectiveElement.value)},s.prototype.bindClearEvent=function(){this.showClearButton&&(this.enabled?e.EventHandler.add(this.textboxWrapper.clearButton,"mousedown touchstart",this.resetInputHandler,this):e.EventHandler.remove(this.textboxWrapper.clearButton,"mousedown touchstart",this.resetInputHandler))},s.prototype.resetInputHandler=function(i){if(i.preventDefault(),!this.textboxWrapper.clearButton.classList.contains("e-clear-icon-hide")||this.textboxWrapper.container.classList.contains("e-static-clear")){t.Input.setValue("",this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value),this.setProperties({value:this.respectiveElement.value},!0);var s={event:i,value:this.respectiveElement.value,previousValue:this.inputPreviousValue,container:this.textboxWrapper.container};if(this.trigger("input",s),this.inputPreviousValue=this.respectiveElement.value,this.raiseChangeEvent(i,!0),e.closest(this.element,"form")){var n=this.element,a=document.createEvent("KeyboardEvent");a.initEvent("keyup",!1,!0),n.dispatchEvent(a)}}},s.prototype.unWireEvents=function(){e.EventHandler.remove(this.respectiveElement,"focus",this.focusHandler),e.EventHandler.remove(this.respectiveElement,"blur",this.focusOutHandler),e.EventHandler.remove(this.respectiveElement,"keydown",this.keydownHandler),e.EventHandler.remove(this.respectiveElement,"input",this.inputHandler),e.EventHandler.remove(this.respectiveElement,"change",this.changeHandler),this.isForm&&e.EventHandler.remove(this.formElement,"reset",this.resetForm),!e.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")&&e.EventHandler.remove(this.textboxWrapper.container.querySelector(".e-float-text"),"animationstart",this.animationHandler)},s.prototype.destroy=function(){this.unWireEvents(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),"INPUT"===this.element.tagName&&this.multiline&&(e.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-disabled","aria-readonly","aria-labelledby"]),e.isNullOrUndefined(this.textboxWrapper)||(this.textboxWrapper.container.insertAdjacentElement("afterend",this.respectiveElement),e.detach(this.textboxWrapper.container)),this.textboxWrapper=null,t.Input.destroy({element:this.respectiveElement,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),i.prototype.destroy.call(this)},s.prototype.addIcon=function(e,i){t.Input.addIcon(e,i,this.textboxWrapper.container,this.respectiveElement,this.createElement)},s.prototype.getPersistData=function(){var t=["value"];return this.addOnPersist(t)},s.prototype.addAttributes=function(e){for(var i=0,s=Object.keys(e);i<s.length;i++){var n=s[i];"disabled"===n?(this.setProperties({enabled:!1},!0),t.Input.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container)):"readonly"===n?(this.setProperties({readonly:!0},!0),t.Input.setReadonly(this.readonly,this.respectiveElement)):"class"===n?this.respectiveElement.classList.add(e[""+n]):"placeholder"===n?(this.setProperties({placeholder:e[""+n]},!0),t.Input.setPlaceholder(this.placeholder,this.respectiveElement)):("rows"===n&&this.respectiveElement.tagName,this.respectiveElement.setAttribute(n,e[""+n]))}},s.prototype.removeAttributes=function(e){for(var i=0,s=e;i<s.length;i++){var n=s[i];"disabled"===n?(this.setProperties({enabled:!0},!0),t.Input.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container)):"readonly"===n?(this.setProperties({readonly:!1},!0),t.Input.setReadonly(this.readonly,this.respectiveElement)):"placeholder"===n?(this.setProperties({placeholder:null},!0),t.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"))&&e.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"))&&e.removeClass([this.textboxWrapper.container],["e-input-focus"]))},pe([e.Property("text")],s.prototype,"type",void 0),pe([e.Property(!1)],s.prototype,"readonly",void 0),pe([e.Property(null)],s.prototype,"value",void 0),pe([e.Property("Never")],s.prototype,"floatLabelType",void 0),pe([e.Property("")],s.prototype,"cssClass",void 0),pe([e.Property(null)],s.prototype,"placeholder",void 0),pe([e.Property("on")],s.prototype,"autocomplete",void 0),pe([e.Property({})],s.prototype,"htmlAttributes",void 0),pe([e.Property(!1)],s.prototype,"multiline",void 0),pe([e.Property(!0)],s.prototype,"enabled",void 0),pe([e.Property(!1)],s.prototype,"showClearButton",void 0),pe([e.Property(!1)],s.prototype,"enablePersistence",void 0),pe([e.Property(null)],s.prototype,"width",void 0),pe([e.Event()],s.prototype,"created",void 0),pe([e.Event()],s.prototype,"destroyed",void 0),pe([e.Event()],s.prototype,"change",void 0),pe([e.Event()],s.prototype,"blur",void 0),pe([e.Event()],s.prototype,"focus",void 0),pe([e.Event()],s.prototype,"input",void 0),s=pe([e.NotifyPropertyChanges],s)}(e.Component),ce=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),me=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},ve="e-auto-width",fe=function(i){function s(t,e){var s=i.call(this,t,e)||this;return s.previousValue=null,s.isForm=!1,s.inputPreviousValue=null,s.textareaOptions=t,s}return ce(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":t.Input.removeFloating(this.textareaWrapper),t.Input.addFloating(this.element,this.floatLabelType,this.placeholder),"Never"===this.floatLabelType&&this.element.removeAttribute("aria-labelledby");break;case"enabled":t.Input.setEnabled(this.enabled,this.element,this.floatLabelType,this.textareaWrapper.container),this.bindClearEvent(),this.enabled||"None"===this.resizeMode?this.element.classList.add(this.getCurrentResizeClass(this.resizeMode)):(this.element.classList.remove(this.getCurrentResizeClass(this.resizeMode)),this.element.classList.add("e-resize-none"));break;case"width":"None"!==this.resizeMode&&"Vertical"!==this.resizeMode?(this.setElementWidth(i.width),this.textareaWrapper.container.classList.add(ve)):(this.textareaWrapper.container.classList.contains(ve)&&this.textareaWrapper.container.classList.remove(ve),t.Input.setWidth(i.width,this.textareaWrapper.container));break;case"value":var r=this.isProtectedOnChange;this.isProtectedOnChange=!0,t.Input.isBlank(this.value)||(this.value=this.value.toString()),this.isProtectedOnChange=r,t.Input.setValue(this.value,this.element,this.floatLabelType,this.showClearButton),this.inputPreviousValue=this.element.value,(this.isAngular||this.isVue)&&!0===this.preventChange?(this.previousValue=this.isAngular?this.value:this.previousValue,this.preventChange=!1):(e.isNullOrUndefined(this.isAngular)||!this.isAngular||this.isAngular&&!this.preventChange||this.isAngular&&e.isNullOrUndefined(this.preventChange))&&this.raiseChangeEvent();break;case"htmlAttributes":this.updateHTMLAttributesToElement(),this.updateHTMLAttributesToWrapper(),this.checkAttributes(!0),t.Input.validateInputType(this.textareaWrapper.container,this.element);break;case"readonly":t.Input.setReadonly(this.readonly,this.element),this.readonly?this.element.setAttribute("aria-readonly","true"):this.element.removeAttribute("aria-readonly");break;case"showClearButton":t.Input.setClearButton(this.showClearButton,this.element,this.textareaWrapper),this.bindClearEvent();break;case"enableRtl":t.Input.setEnableRtl(this.enableRtl,[this.textareaWrapper.container]);break;case"placeholder":t.Input.setPlaceholder(this.placeholder,this.element),t.Input.calculateWidth(this.element,this.textareaWrapper.container);break;case"cssClass":t.Input.updateCssClass(i.cssClass,s.cssClass,this.textareaWrapper.container);break;case"locale":this.globalize=new e.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),t.Input.setPlaceholder(this.placeholder,this.element);break;case"rows":this.rows&&this.element.setAttribute("rows",this.rows.toString());break;case"cols":this.cols&&(this.element.setAttribute("cols",this.cols.toString()),null==this.width&&this.textareaWrapper.container.classList.add(ve));break;case"maxLength":this.maxLength&&this.element.setAttribute("maxlength",this.maxLength.toString());break;case"resizeMode":if(this.enabled){if(this.element.classList.contains(this.getCurrentResizeClass(s.resizeMode))&&this.element.classList.remove(this.getCurrentResizeClass(s.resizeMode)),this.element.classList.add(this.getCurrentResizeClass(this.resizeMode)),!this.element.style.width||"None"!==this.resizeMode&&"Vertical"!==this.resizeMode){var l=this.element.offsetWidth;this.element.style.width=l+"px",this.textareaWrapper.container.style.width&&(this.textareaWrapper.container.style.width="")}else t.Input.setWidth(this.element.style.width,this.textareaWrapper.container);this.setWrapperWidth()}}},s.prototype.preRender=function(){if(this.formElement=e.closest(this.element,"form"),e.isNullOrUndefined(this.formElement)||(this.isForm=!0),"EJS-TEXTAREA"===this.element.tagName||"EJS-SMARTTEXTAREA"===this.element.tagName){var t=e.getValue("ej2_instances",this.element),i=this.createElement("textarea"),s=0;for(s;s<this.element.attributes.length;s++){var n=this.element.attributes[s].nodeName;"id"!==n&&"class"!==n?(i.setAttribute(n,this.element.attributes[s].nodeValue),i.innerHTML=this.element.innerHTML,"name"===n&&this.element.removeAttribute("name")):"class"===n&&i.setAttribute(n,this.element.className.split(" ").filter(function(t){return 0!==t.indexOf("ng-")}).join(" "))}this.element.appendChild(i),this.element=i,e.setValue("ej2_instances",t,this.element)}this.updateHTMLAttributesToElement(),this.checkAttributes(!1),!e.isNullOrUndefined(this.textareaOptions)&&void 0!==this.textareaOptions.value||""===this.element.value||this.setProperties({value:this.element.value},!0),this.globalize=new e.Internationalization(this.locale);var a={placeholder:this.placeholder};this.l10n=new e.L10n("textarea",a,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.element.hasAttribute("id")||this.element.setAttribute("id",e.getUniqueID("textbox")),this.element.hasAttribute("name")||this.element.setAttribute("name",this.element.getAttribute("id")),this.rows&&this.element.setAttribute("rows",this.rows.toString()),this.cols&&this.element.setAttribute("cols",this.cols.toString()),this.maxLength&&this.element.setAttribute("maxlength",this.maxLength.toString()),!this.element.style.resize&&this.enabled&&this.element.classList.add(this.getCurrentResizeClass(this.resizeMode)),this.enabled&&this.element.setAttribute("aria-multiline","true")},s.prototype.render=function(){var i=this.cssClass;e.isNullOrUndefined(this.cssClass)||""===this.cssClass||(i=t.Input.getInputValidClassList(this.cssClass)),this.textareaWrapper=t.Input.createInput({element:this.element,floatLabelType:this.floatLabelType,properties:{enabled:this.enabled,enableRtl:this.enableRtl,cssClass:i,readonly:this.readonly,placeholder:this.placeholder,showClearButton:this.showClearButton}}),this.updateHTMLAttributesToWrapper(),this.wireEvents(),e.isNullOrUndefined(this.value)||t.Input.setValue(this.value,this.element,this.floatLabelType,this.showClearButton),e.isNullOrUndefined(this.value)||(this.initialValue=this.value,this.isAngular||this.element.setAttribute("value",this.initialValue)),this.previousValue=this.value,this.inputPreviousValue=this.value,this.element.defaultValue=this.element.value,t.Input.setWidth(this.width,this.textareaWrapper.container),this.setWrapperWidth(),this.renderComplete()},s.prototype.getModuleName=function(){return"textarea"},s.prototype.getPersistData=function(){var t=["value"];return this.addOnPersist(t)},s.prototype.checkAttributes=function(t){for(var i=0,s=t?e.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly"];i<s.length;i++){var n=s[i];if(!e.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"disabled":if(e.isNullOrUndefined(this.textareaOptions)||void 0===this.textareaOptions.enabled||t){var a="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n);this.setProperties({enabled:a},!t)}break;case"readonly":if(e.isNullOrUndefined(this.textareaOptions)||void 0===this.textareaOptions.readonly||t){var r="readonly"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n);this.setProperties({readonly:r},!t)}break;case"placeholder":(e.isNullOrUndefined(this.textareaOptions)||void 0===this.textareaOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"value":(e.isNullOrUndefined(this.textareaOptions)||void 0===this.textareaOptions.value||t)&&""!==this.element.value&&this.setProperties({value:this.element.value},!t)}}},s.prototype.wireEvents=function(){e.EventHandler.add(this.element,"focus",this.focusHandler,this),e.EventHandler.add(this.element,"blur",this.focusOutHandler,this),e.EventHandler.add(this.element,"keydown",this.keydownHandler,this),e.EventHandler.add(this.element,"input",this.inputHandler,this),e.EventHandler.add(this.element,"change",this.changeHandler,this),this.isForm&&e.EventHandler.add(this.formElement,"reset",this.resetForm,this),this.bindClearEvent()},s.prototype.unWireEvents=function(){e.EventHandler.remove(this.element,"focus",this.focusHandler),e.EventHandler.remove(this.element,"blur",this.focusOutHandler),e.EventHandler.remove(this.element,"keydown",this.keydownHandler),e.EventHandler.remove(this.element,"input",this.inputHandler),e.EventHandler.remove(this.element,"change",this.changeHandler),this.isForm&&e.EventHandler.remove(this.formElement,"reset",this.resetForm)},s.prototype.destroy=function(){this.unWireEvents(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),this.element.value=this.element.defaultValue,this.element.classList.remove("e-input","e-resize-x","e-resize-y","e-resize-xy","e-resize-none"),this.textareaWrapper.container.style.width.includes("%")&&e.EventHandler.remove(this.element,"mousemove",this.onMouseMove),this.removeAttributes(["aria-disabled","aria-readonly","aria-labelledby","aria-multiline"]),e.isNullOrUndefined(this.textareaWrapper)||(this.textareaWrapper.container.insertAdjacentElement("afterend",this.element),e.detach(this.textareaWrapper.container)),this.textareaWrapper=null,t.Input.destroy({element:this.element,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),this.formElement=null,i.prototype.destroy.call(this)},s.prototype.focusHandler=function(t){var e={container:this.textareaWrapper.container,event:t,value:this.value};this.trigger("focus",e)},s.prototype.focusOutHandler=function(t){null===this.previousValue&&null===this.value||this.previousValue===this.value||this.raiseChangeEvent(t,!0);var e={container:this.textareaWrapper.container,event:t,value:this.value};this.trigger("blur",e)},s.prototype.keydownHandler=function(t){13!==t.keyCode&&9!==t.keyCode||!(null!==this.previousValue&&""!==this.previousValue||null!==this.value&&""!==this.value||""!==this.element.value)||this.setProperties({value:this.element.value},!0)},s.prototype.inputHandler=function(t){var e=this,i={event:t,value:this.element.value,previousValue:this.inputPreviousValue,container:this.textareaWrapper.container};this.inputPreviousValue=this.element.value,this.isAngular&&(e.localChange({value:this.element.value}),this.preventChange=!0),this.isVue&&(this.preventChange=!0),this.trigger("input",i),t.stopPropagation()},s.prototype.changeHandler=function(t){this.setProperties({value:this.element.value},!0),this.previousValue!==this.value&&this.raiseChangeEvent(t,!0),t.stopPropagation()},s.prototype.raiseChangeEvent=function(t,e){var i={event:t,value:this.value,previousValue:this.previousValue,container:this.textareaWrapper.container,isInteraction:e||!1,isInteracted:e||!1};this.preventChange=!1,this.trigger("change",i),this.previousValue=this.value},s.prototype.updateHTMLAttributesToWrapper=function(){t.Input.updateHTMLAttributesToWrapper(this.htmlAttributes,this.textareaWrapper.container)},s.prototype.updateHTMLAttributesToElement=function(){t.Input.updateHTMLAttributesToElement(this.htmlAttributes,this.element)},s.prototype.bindClearEvent=function(){this.showClearButton&&(this.enabled?e.EventHandler.add(this.textareaWrapper.clearButton,"mousedown touchstart",this.resetInputHandler,this):e.EventHandler.remove(this.textareaWrapper.clearButton,"mousedown touchstart",this.resetInputHandler))},s.prototype.resetInputHandler=function(i){i.preventDefault(),this.textareaWrapper.clearButton.classList.contains("e-clear-icon-hide")&&!this.textareaWrapper.container.classList.contains("e-static-clear")||(t.Input.setValue("",this.element,this.floatLabelType,this.showClearButton),this.setProperties({value:this.element.value},!0));var s={event:i,value:this.element.value,previousValue:this.inputPreviousValue,container:this.textareaWrapper.container};if(this.trigger("input",s),this.inputPreviousValue=this.element.value,this.raiseChangeEvent(i,!0),e.closest(this.element,"form")){var n=this.element,a=document.createEvent("KeyboardEvent");a.initEvent("keyup",!1,!0),n.dispatchEvent(a)}},s.prototype.addAttributes=function(e){for(var i=0,s=Object.keys(e);i<s.length;i++){var n=s[i];"disabled"===n?(this.setProperties({enabled:!1},!0),t.Input.setEnabled(this.enabled,this.element,this.floatLabelType,this.textareaWrapper.container)):"readonly"===n?(this.setProperties({readonly:!0},!0),t.Input.setReadonly(this.readonly,this.element)):"class"===n?this.element.classList.add(e[""+n]):"placeholder"===n?(this.setProperties({placeholder:e[""+n]},!0),t.Input.setPlaceholder(this.placeholder,this.element)):this.element.setAttribute(n,e[""+n])}},s.prototype.removeAttributes=function(e){for(var i=0,s=e;i<s.length;i++){var n=s[i];"disabled"===n?(this.setProperties({enabled:!0},!0),t.Input.setEnabled(this.enabled,this.element,this.floatLabelType,this.textareaWrapper.container)):"readonly"===n?(this.setProperties({readonly:!1},!0),t.Input.setReadonly(this.readonly,this.element)):"placeholder"===n?(this.setProperties({placeholder:null},!0),t.Input.setPlaceholder(this.placeholder,this.element)):this.element.removeAttribute(n)}},s.prototype.focusIn=function(){document.activeElement!==this.element&&this.enabled&&(this.element.focus(),(this.textareaWrapper.container.classList.contains("e-input-group")||this.textareaWrapper.container.classList.contains("e-outline")||this.textareaWrapper.container.classList.contains("e-filled"))&&e.addClass([this.textareaWrapper.container],["e-input-focus"]))},s.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.element.blur(),(this.textareaWrapper.container.classList.contains("e-input-group")||this.textareaWrapper.container.classList.contains("e-outline")||this.textareaWrapper.container.classList.contains("e-filled"))&&e.removeClass([this.textareaWrapper.container],["e-input-focus"]))},s.prototype.setWrapperWidth=function(){this.enabled&&("None"!==this.resizeMode&&"Vertical"!==this.resizeMode||this.cols||this.element.getAttribute("cols"))?("None"===this.resizeMode||"Vertical"===this.resizeMode||this.textareaWrapper.container.style.width.includes("%")||this.setElementWidth(this.textareaWrapper.container.style.width),this.textareaWrapper.container.style.width.includes("%")||(this.textareaWrapper.container.classList.add(ve),this.textareaWrapper.container.style.width=""),this.textareaWrapper.container.style.width.includes("%")&&e.EventHandler.add(this.element,"mousemove",this.onMouseMove,this)):this.textareaWrapper.container.classList.contains(ve)&&this.textareaWrapper.container.classList.remove(ve)},s.prototype.onMouseMove=function(){var t=this;if("auto"!==this.textareaWrapper.container.style.width){var e=this.element.style.width;setTimeout(function(){var i=t.element.style.width;e!==i&&(t.textareaWrapper.container.style.width="auto")},5)}},s.prototype.resetForm=function(){if(this.isAngular?this.resetValue(""):this.resetValue(this.initialValue),!e.isNullOrUndefined(this.textareaWrapper)){var t=this.textareaWrapper.container.querySelector(".e-float-text");e.isNullOrUndefined(t)||"Always"===this.floatLabelType||(e.isNullOrUndefined(this.initialValue)||""===this.initialValue?(t.classList.add("e-label-bottom"),t.classList.remove("e-label-top")):""!==this.initialValue&&(t.classList.add("e-label-top"),t.classList.remove("e-label-bottom")))}},s.prototype.resetValue=function(t){var e=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.value=t,null!=t||!this.textareaWrapper.container.classList.contains("e-valid-input")||"Always"===this.floatLabelType&&this.textareaWrapper.container.classList.contains("e-outline")||this.textareaWrapper.container.classList.remove("e-valid-input"),this.isProtectedOnChange=e},s.prototype.setElementWidth=function(t){"number"==typeof t?this.element.style.width=e.formatUnit(t):"string"==typeof t&&(this.element.style.width=t.match(/px|%|em/)?t:e.formatUnit(t))},s.prototype.getCurrentResizeClass=function(t){return"None"===t?"e-resize-none":"Both"===t?"e-resize-xy":"Horizontal"===t?"e-resize-x":"e-resize-y"},me([e.Property(!1)],s.prototype,"readonly",void 0),me([e.Property(null)],s.prototype,"value",void 0),me([e.Property("Never")],s.prototype,"floatLabelType",void 0),me([e.Property("")],s.prototype,"cssClass",void 0),me([e.Property(null)],s.prototype,"placeholder",void 0),me([e.Property({})],s.prototype,"htmlAttributes",void 0),me([e.Property(!0)],s.prototype,"enabled",void 0),me([e.Property(!1)],s.prototype,"showClearButton",void 0),me([e.Property(!1)],s.prototype,"enablePersistence",void 0),me([e.Property(null)],s.prototype,"width",void 0),me([e.Property("Both")],s.prototype,"resizeMode",void 0),me([e.Property(null)],s.prototype,"maxLength",void 0),me([e.Property(null)],s.prototype,"cols",void 0),me([e.Property(null)],s.prototype,"rows",void 0),me([e.Event()],s.prototype,"created",void 0),me([e.Event()],s.prototype,"destroyed",void 0),me([e.Event()],s.prototype,"change",void 0),me([e.Event()],s.prototype,"blur",void 0),me([e.Event()],s.prototype,"focus",void 0),me([e.Event()],s.prototype,"input",void 0),s=me([e.NotifyPropertyChanges],s)}(e.Component),ge=function(){function t(){}return t.createStyledDiv=function(t,e){var i=document.createElement("div"),s={position:"absolute",left:-9999,top:0,zIndex:-2e3};this.properties.forEach(function(e){s[""+e]=getComputedStyle(t)[e]}),Object.keys(s).forEach(function(t){i.style[""+t]=s[""+t]});var n=t.offsetWidth-t.clientWidth;return i.style.width=t.clientWidth+n+"px",i.innerHTML=e,t&&t.parentNode&&t.parentNode.insertBefore(i,t.nextSibling),i},t.createCaretMarker=function(t,e){var i=this.createStyledDiv(t,e),s=i.ownerDocument.getElementById("caret-position-marker"),n={left:s.offsetLeft,top:s.offsetTop,height:s.offsetHeight};return i&&i.parentNode&&i.parentNode.removeChild(i),n},t.escapeHtml=function(t){return t.replace(/<|>|`|"|&/g,"?").replace(/\r\n|\r|\n/g,"<br/>")},t.getCaretPosition=function(t){var e=t.selectionStart||0,i=t.value.slice(0,e),s=t.value.slice(e),n='<span style="position: relative; display: inline;">'+this.escapeHtml(i)+"</span>";n+='<span id="caret-position-marker" style="position: relative; display: inline;">|</span>',n+='<span style="position: relative; display: inline;">'+this.escapeHtml(s)+"</span>";var a=this.createCaretMarker(t,n);return a.pos=e,a},t.adjustScrollToCaretPosition=function(t){var e=this.getCaretPosition(t),i=parseFloat(window.getComputedStyle(t).lineHeight);e.top>t.clientHeight+t.scrollTop-i&&(t.scrollTop=e.top-t.clientHeight+i)},t.getTextAreaPosition=function(t){var e=window.getComputedStyle(t),i=this.getCaretPosition(t);return{top:i.top+parseFloat(e.borderTopWidth)+t.offsetTop-t.scrollTop,left:i.left+parseFloat(e.borderLeftWidth)+t.offsetLeft-t.scrollLeft-.25,height:i.height,elemStyle:e}},t.insertCharacter=function(t,e){var i=t.selectionStart,s=t.selectionEnd;t.value=t.value.substring(0,i)+e+t.value.substring(s),i+=e.length,t.setSelectionRange(i,i)},t.properties=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopWidth","boxSizing","fontFamily","fontSize","fontWeight","height","letterSpacing","lineHeight","marginBottom","marginLeft","marginRight","marginTop","outlineWidth","overflow","overflowX","overflowY","paddingBottom","paddingLeft","paddingRight","paddingTop","textAlign","textOverflow","textTransform","whiteSpace","wordBreak","wordWrap","width"],t}(),ye=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),be=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},Ce=function(t,e,i,s){return new(i||(i=Promise))(function(n,a){function r(t){try{o(s.next(t))}catch(t){a(t)}}function l(t){try{o(s.throw(t))}catch(t){a(t)}}function o(t){t.done?n(t.value):new i(function(e){e(t.value)}).then(r,l)}o((s=s.apply(t,e||[])).next())})},Ee=function(t,e){function i(t){return function(e){return s([t,e])}}function s(i){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,a&&(r=2&i[0]?a.return:i[0]?a.throw||((r=a.return)&&r.call(a),0):a.next)&&!(r=r.call(a,i[1])).done)return r;switch(a=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,a=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(r=o.trys,!(r=r.length>0&&r[r.length-1])&&(6===i[0]||2===i[0])){o=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){o.label=i[1];break}if(6===i[0]&&o.label<r[1]){o.label=r[1],r=i;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(i);break}r[2]&&o.ops.pop(),o.trys.pop();continue}i=e.call(t,o)}catch(t){i=[6,t],a=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}var n,a,r,l,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return l={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l};!function(t){t.System="system",t.User="user",t.Assistant="assistant"}(t.ChatMessageRole||(t.ChatMessageRole={}));var Se=function(i){function s(t,e){return i.call(this,t,e)||this}return ye(s,i),s.prototype.render=function(){if(i.prototype.render.call(this),this.element instanceof HTMLTextAreaElement){this.textArea=this.element;var t=e.createElement("smart-textarea");if(t.classList.add("e-smart-textarea"),this.textArea.after(t),"None"!==this.showSuggestionOnPopup){var s="Enable"===this.showSuggestionOnPopup?"false":"true";this.textArea.setAttribute("data-inline-suggestions",s)}this.suggestionDisplay=this.shouldShowInlineSuggestions(this.textArea)?new xe(t,this.textArea):new Te(t,this.textArea)}},s.prototype.wireEvents=function(){var t=this;i.prototype.wireEvents.call(this),e.EventHandler.add(this.element,"keyup",this.handleKeyUp,this),e.EventHandler.add(this.element,"keydown",this.handleKeyDown,this),e.EventHandler.add(this.element,"mousedown",this.removeExistingOrPendingSuggestion,this),e.EventHandler.add(this.element,"focusout",this.removeExistingOrPendingSuggestion,this),this.element.addEventListener("scroll",function(){return t.suggestionDisplay.reject()},{passive:!0})},s.prototype.unWireEvents=function(){var t=this;i.prototype.unWireEvents.call(this),e.EventHandler.remove(this.element,"keyup",this.handleKeyUp),e.EventHandler.remove(this.element,"keydown",this.handleKeyDown),e.EventHandler.remove(this.element,"mousedown",this.removeExistingOrPendingSuggestion),e.EventHandler.remove(this.element,"focusout",this.removeExistingOrPendingSuggestion),this.element.removeEventListener("scroll",function(){return t.suggestionDisplay.reject()})},s.prototype.keydownHandler=function(){},s.prototype.shouldShowInlineSuggestions=function(t){var e=t.getAttribute("data-inline-suggestions");return e?"true"===e.toLowerCase():!("ontouchstart"in window)},s.prototype.handleKeyDown=function(t){switch(t.key){case"Tab":this.suggestionDisplay.isShowing()&&(this.suggestionDisplay.accept(),t.preventDefault());break;case"Alt":case"Control":case"Shift":case"Command":break;default:this.suggestionDisplay.isShowing()&&this.suggestionDisplay.currentSuggestion.startsWith(t.key)?(ge.insertCharacter(this.textArea,t.key),t.preventDefault(),this.suggestionDisplay.show(this.suggestionDisplay.currentSuggestion.substring(t.key.length)),ge.adjustScrollToCaretPosition(this.textArea)):this.removeExistingOrPendingSuggestion()}},s.prototype.handleKeyUp=function(){var t=this;this.suggestionDisplay.isShowing()||(clearTimeout(this.typingDebounceTimeout),this.typingDebounceTimeout=setTimeout(function(){return t.handleTypingPaused()},350))},s.prototype.handleTypingPaused=function(){return Ce(this,void 0,void 0,function(){return Ee(this,function(t){switch(t.label){case 0:return document.activeElement!==this.textArea?[2]:this.textArea.selectionStart!==this.textArea.selectionEnd||this.textArea.selectionStart!==this.textArea.value.length&&"\n"!==this.textArea.value[this.textArea.selectionStart]?[3,2]:[4,this.requestSuggestionAsync()];case 1:t.sent(),t.label=2;case 2:return[2]}})})},s.prototype.removeExistingOrPendingSuggestion=function(){clearTimeout(this.typingDebounceTimeout),this.pendingSuggestionAbort&&(this.pendingSuggestionAbort.abort(),this.pendingSuggestionAbort=null),this.suggestionDisplay.reject()},s.prototype.createSuggestionPrompt=function(e,i){var s="Predict what text the user in the given ROLE would insert at the cursor position indicated by ^^^.\nOnly give predictions for which you have an EXTREMELY high confidence that the user would insert that EXACT text.\nDo not make up new information. If you are not sure, just reply with NO_PREDICTION.\n\nRULES:\n1. Reply with OK:, then in square brackets the predicted text, then END_INSERTION, and no other output.\n2. When a specific value or quantity cannot be inferred and would need to be provided, use the word NEED_INFO.\n3. If there is not enough information to predict any words that the user would type next, just reply with the word NO_PREDICTION.\n4. NEVER invent new information. If you can not be sure what the user is about to type, ALWAYS stop the prediction with END_INSERTION.",n=this.UserPhrases;if(n&&n.length>0){s+="\nAlways try to use variations on the following phrases as part of the predictions:\n";for(var a=0,r=n;a<r.length;a++)s+="- "+r[a]+"\n"}return{messages:[{role:t.ChatMessageRole.System,content:s},{role:t.ChatMessageRole.User,content:"ROLE: Family member sending a text\nUSER_TEXT: Hey, it is a nice day - the weather is ^^^"},{role:t.ChatMessageRole.Assistant,content:"OK:[great!]END_INSERTION"},{role:t.ChatMessageRole.User,content:"ROLE: Customer service assistant\nUSER_TEXT: You can find more information on^^^\n\nAlternatively, phone us."},{role:t.ChatMessageRole.Assistant,content:"OK:[ our website at NEED_INFO]END_INSERTION"},{role:t.ChatMessageRole.User,content:"ROLE: Casual\nUSER_TEXT: Oh I see!\n\nWell sure thing, we can"},{role:t.ChatMessageRole.Assistant,content:"OK:[ help you out with that!]END_INSERTION"},{role:t.ChatMessageRole.User,content:"ROLE: Storyteller\nUSER_TEXT: Sir Digby Chicken Caesar, also know^^^"},{role:t.ChatMessageRole.Assistant,content:"OK:[n as NEED_INFO]END_INSERTION"},{role:t.ChatMessageRole.User,content:"ROLE: Customer support agent\nUSER_TEXT: Goodbye for now.^^^"},{role:t.ChatMessageRole.Assistant,content:"NO_PREDICTION END_INSERTION"},{role:t.ChatMessageRole.User,content:"ROLE: Pirate\nUSER_TEXT: Have you found^^^"},{role:t.ChatMessageRole.Assistant,content:"OK:[ the treasure, me hearties?]END_INSERTION"},{role:t.ChatMessageRole.User,content:"ROLE: "+this.userRole+"\nUSER_TEXT: "+e+"^^^"+i}],temperature:0,maxTokens:400,stopSequences:["END_INSERTION","NEED_INFO"],frequencyPenalty:0,presencePenalty:0}},s.prototype.requestSuggestionAsync=function(){return Ce(this,void 0,void 0,function(){var t,e,i,s,n;return Ee(this,function(a){switch(a.label){case 0:return this.pendingSuggestionAbort?(this.pendingSuggestionAbort.abort(),[2]):(this.pendingSuggestionAbort=new AbortController,t={textAreaValue:this.textArea.value,cursorPosition:this.textArea.selectionStart},e={textBefore:t.textAreaValue.substring(0,t.cursorPosition),textAfter:t.textAreaValue.substring(t.cursorPosition)},i=this.createSuggestionPrompt(e.textBefore,e.textAfter),"function"!=typeof this.aiSuggestionHandler?[3,2]:[4,this.aiSuggestionHandler(i)]);case 1:n=a.sent(),s=this.validateSuggestion(n,e.textBefore),a.label=2;case 2:return s&&t.textAreaValue===this.textArea.value&&t.cursorPosition===this.textArea.selectionStart&&(s.endsWith(" ")||(s+=" "),this.suggestionDisplay.show(s)),[2]}})})},s.prototype.validateSuggestion=function(t,e){var i;if("string"!=typeof t||t.length<=5||0!==t.indexOf("OK:["))return"";var s=this.indexOfAny(t,[".","?","!"]);return s>0&&t.length>s+1&&" "===t[s+1]&&(t=t.substring(0,s+1)),i=t.substring(4).replace(/[\]\s]+$/,""),e.length>0&&" "===e[e.length-1]&&(i=i.replace(/^\s+/,"")),i},s.prototype.indexOfAny=function(t,e){for(var i=0;i<t.length;i++)if(-1!==e.indexOf(t[""+i]))return i;return-1},s.prototype.getModuleName=function(){return"smarttextarea"},s.prototype.destroy=function(){i.prototype.destroy.call(this),this.textArea=null,this.suggestionDisplay=null,this.typingDebounceTimeout=null},be([e.Property("")],s.prototype,"userRole",void 0),be([e.Property([])],s.prototype,"UserPhrases",void 0),be([e.Property()],s.prototype,"aiSuggestionHandler",void 0),be([e.Property("None")],s.prototype,"showSuggestionOnPopup",void 0),s}(fe),xe=function(){function t(t,e){this.owner=t,this.textArea=e,this.latestSuggestionText="",this.suggestionStartPos=null,this.suggestionEndPos=null,this.virtualCaret=null,this.originalValueProperty=this.getOriginalValueProperty(e,"value")}return Object.defineProperty(t.prototype,"value",{get:function(){var t=this.originalValueProperty.get.call(this.textArea);return this.isShowing()?t.substring(0,this.suggestionStartPos)+t.substring(this.suggestionEndPos):t},set:function(t){this.originalValueProperty.set.call(this.textArea,t)},enumerable:!0,configurable:!0}),t.prototype.getOriginalValueProperty=function(t,e){for(;t;){var i=Object.getOwnPropertyDescriptor(t,e);if(i)return i;t=Object.getPrototypeOf(t)}throw new Error("Property "+e+" not found on object or its prototype chain")},Object.defineProperty(t.prototype,"valueIncludingSuggestion",{get:function(){return this.originalValueProperty.get.call(this.textArea)},set:function(t){this.originalValueProperty.set.call(this.textArea,t)},enumerable:!0,configurable:!0}),t.prototype.isShowing=function(){return null!==this.suggestionStartPos},t.prototype.show=function(t){this.latestSuggestionText=t,this.suggestionStartPos=this.textArea.selectionStart,this.suggestionEndPos=this.suggestionStartPos+t.length,this.textArea.setAttribute("data-suggestion-visible",""),this.valueIncludingSuggestion=this.valueIncludingSuggestion.substring(0,this.suggestionStartPos)+t+this.valueIncludingSuggestion.substring(this.suggestionStartPos),this.textArea.setSelectionRange(this.suggestionStartPos,this.suggestionEndPos),this.virtualCaret||(this.virtualCaret=new Pe(this.owner,this.textArea)),this.virtualCaret.show()},Object.defineProperty(t.prototype,"currentSuggestion",{get:function(){return this.latestSuggestionText},enumerable:!0,configurable:!0}),t.prototype.accept=function(){this.textArea.setSelectionRange(this.suggestionEndPos,this.suggestionEndPos),this.suggestionStartPos=null,this.suggestionEndPos=null,this.virtualCaret&&this.virtualCaret.hide(),this.textArea.removeAttribute("data-suggestion-visible"),ge.adjustScrollToCaretPosition(this.textArea)},t.prototype.reject=function(){if(this.isShowing()){var t=this.textArea.selectionStart,e=this.textArea.selectionEnd;this.valueIncludingSuggestion=this.valueIncludingSuggestion.substring(0,this.suggestionStartPos)+this.valueIncludingSuggestion.substring(this.suggestionEndPos),this.suggestionStartPos===t&&this.suggestionEndPos===e&&this.textArea.setSelectionRange(t,t),this.suggestionStartPos=null,this.suggestionEndPos=null,this.textArea.removeAttribute("data-suggestion-visible"),this.virtualCaret&&this.virtualCaret.hide()}},t}(),Te=function(){function t(t,e){var i=this;this.latestSuggestionText="",this.showing=!1,this.textArea=e,this.suggestionElement=document.createElement("div"),this.suggestionElement.classList.add("smart-textarea-suggestion-overlay"),this.suggestionElement.addEventListener("mousedown",function(t){return i.handleSuggestionClicked(t)}),this.suggestionElement.addEventListener("touchend",function(t){return i.handleSuggestionClicked(t)}),this.suggestionPrefixElement=document.createElement("span"),this.suggestionTextElement=document.createElement("span"),this.suggestionElement.appendChild(this.suggestionPrefixElement),this.suggestionElement.appendChild(this.suggestionTextElement),this.suggestionPrefixElement.style.opacity="0.3";var s=window.getComputedStyle(this.textArea);this.suggestionElement.style.font=s.font,this.suggestionElement.style.marginTop=1.4*parseFloat(s.fontSize)+"px",t.appendChild(this.suggestionElement)}return Object.defineProperty(t.prototype,"currentSuggestion",{get:function(){return this.latestSuggestionText},enumerable:!0,configurable:!0}),t.prototype.show=function(t){this.latestSuggestionText=t,this.suggestionPrefixElement.textContent=" "!==t[0]?this.getPrefixText(this.textArea,20):"",this.suggestionTextElement.textContent=t;var e=ge.getTextAreaPosition(this.textArea),i=this.suggestionElement.style;i.minWidth=null,this.suggestionElement.classList.add("smart-textarea-suggestion-overlay-visible"),i.zIndex=this.textArea.style.zIndex+1,i.top=e.top+"px";var s=e.left-this.suggestionPrefixElement.offsetWidth;(!i.left||Math.abs(parseFloat(i.left)-s)>10)&&(i.left=s+"px"),this.showing=!0;var n=window.getComputedStyle(this.suggestionElement),a=parseFloat(n.lineHeight),r=parseFloat(n.paddingTop),l=parseFloat(n.paddingBottom),o=Math.round((this.suggestionElement.offsetHeight-r-l)/a);if(o>2){var h=this.suggestionElement.offsetWidth;i.minWidth="calc(min(70vw, "+o*h/2+"px))"}var u=this.suggestionElement.getBoundingClientRect();u.right>document.body.clientWidth-20&&(i.left="calc("+(parseFloat(i.left)-(u.right-document.body.clientWidth))+"px - 2rem)")},t.prototype.accept=function(){this.showing&&(ge.insertCharacter(this.textArea,this.currentSuggestion),ge.adjustScrollToCaretPosition(this.textArea),this.hide())},t.prototype.reject=function(){this.hide()},t.prototype.hide=function(){this.showing&&(this.showing=!1,this.suggestionElement.classList.remove("smart-textarea-suggestion-overlay-visible"))},t.prototype.isShowing=function(){return this.showing},t.prototype.handleSuggestionClicked=function(t){t.preventDefault(),t.stopImmediatePropagation(),this.accept()},t.prototype.getPrefixText=function(t,e){for(var i=t.value,s=t.selectionStart,n=s-1;n>s-e;n--)if(n<0||/\s/.test(i[""+n]))return i.substring(n+1,s);return""},t}(),Pe=function(){function t(t,e){this.textArea=e,this.caretDiv=document.createElement("div"),this.caretDiv.classList.add("smart-textarea-caret"),t.appendChild(this.caretDiv)}return t.prototype.show=function(){var t=ge.getTextAreaPosition(this.textArea),e=this.caretDiv.style;e.display="block",e.top=t.top+"px",e.left=t.left+"px",e.height=t.height+"px",e.zIndex=this.textArea.style.zIndex,e.backgroundColor=t.elemStyle.caretColor},t.prototype.hide=function(){this.caretDiv.style.display="none"},t}(),ke=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Oe=function(t){function i(){var e=null!==t&&t.apply(this,arguments)||this;return e.minDistance=5,e.previous=0,e.interval=30,e.timeout=null,e.isSignatureEmpty=!0,e.backgroundLoaded=null,e.isBlazor=!1,e.isResponsive=!1,e.signPointsColl=[],e.signRatioPointsColl=[],e.canRedraw=!0,e}return ke(i,t),i.prototype.initialize=function(t,i){this.clearArray=[],this.element=t,this.canvasContext=this.element.getContext("2d"),this.canvasContext.canvas.tabIndex=-1,i&&(this.dotnetRef=i,this.isBlazor=!0,this.signatureValue&&this.loadPersistedSignature()),this.setHTMLProperties(),e.isNullOrUndefined(this.signatureValue)&&this.updateSnapCollection(!0),this.wireEvents(),this.isBlazor||this.trigger("created",null)},i.prototype.wireEvents=function(){!e.isNullOrUndefined(this.pointColl)||this.isReadOnly||this.disabled?this.pointColl&&(e.EventHandler.add(this.canvasContext.canvas,"mousemove touchmove",this.mouseMoveHandler,this),e.EventHandler.add(this.canvasContext.canvas,"mouseup touchend",this.mouseUpHandler,this),e.EventHandler.add(document,"mouseup",this.mouseUpHandler,this)):(e.EventHandler.add(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler,this),e.EventHandler.add(this.canvasContext.canvas,"keydown",this.keyboardHandler,this),window.addEventListener("resize",this.resizeHandler.bind(this)))},i.prototype.unwireEvents=function(t){"mouseup"===t||"touchend"===t?(this.canvasContext&&(e.EventHandler.remove(this.canvasContext.canvas,"mousemove touchmove",this.mouseMoveHandler),e.EventHandler.remove(this.canvasContext.canvas,"mouseup touchend",this.mouseUpHandler)),e.EventHandler.remove(document,"mouseup",this.mouseUpHandler)):(this.canvasContext&&(e.EventHandler.remove(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler),e.EventHandler.remove(this.canvasContext.canvas,"keydown",this.keyboardHandler)),window.removeEventListener("resize",this.resizeHandler))},i.prototype.setHTMLProperties=function(){150===this.element.height&&300===this.element.width&&0!==this.element.offsetHeight&&0!==this.element.offsetWidth?(this.element.height=this.element.offsetHeight,this.element.width=this.element.offsetWidth,this.isResponsive=!0):this.element.height===this.element.offsetHeight-1&&this.element.width===this.element.offsetWidth-1||0===this.element.offsetHeight||0===this.element.offsetWidth||(this.element.height=this.element.offsetHeight,this.element.width=this.element.offsetWidth),this.canvasContext.fillStyle=this.strokeColor,this.tempCanvas=this.createElement("canvas",{className:"e-"+this.getModuleName()+"-temp"}),this.tempContext=this.tempCanvas.getContext("2d"),this.tempCanvas.width=this.element.width,this.tempCanvas.height=this.element.height,this.backgroundImage?(this.canvasContext.canvas.style.backgroundImage="url("+this.backgroundImage+")",this.canvasContext.canvas.style.backgroundRepeat="no-repeat",this.saveWithBackground&&this.setBackgroundImage(this.backgroundImage,"temp")):this.backgroundColor&&(this.canvasContext.canvas.style.backgroundColor=this.backgroundColor)},i.prototype.mouseDownHandler=function(t){1!==t.buttons&&2!==t.buttons&&"touchstart"!==t.type||("touchstart"===t.type&&(t.preventDefault(),t.stopPropagation()),this.beginStroke(t),this.wireEvents())},i.prototype.mouseMoveHandler=function(t){1!==t.buttons&&2!==t.buttons&&"touchmove"!==t.type||("touchmove"===t.type&&(t.preventDefault(),t.stopPropagation()),this.interval?this.updateStrokeWithThrottle(t):this.updateStroke(t))},i.prototype.mouseUpHandler=function(t){var e={actionName:"strokeUpdate"};"touchstart"===t.type&&(t.preventDefault(),t.stopPropagation()),this.endDraw(),this.updateSnapCollection(),this.unwireEvents(t.type),this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","mouseUp"):this.trigger("change",e),this.signatureValue=this.snapColl[this.incStep];for(var i=0;i<this.signPointsColl.length;i++)this.signRatioPointsColl.push({x:this.signPointsColl[i].x/this.canvasContext.canvas.width,y:this.signPointsColl[i].y/this.canvasContext.canvas.height});this.signPointsColl=[]},i.prototype.keyboardHandler=function(t){var e=this,i={fileName:"Signature",type:"Png",cancel:!1};switch(t.key){case"Delete":this.clear();break;case t.ctrlKey&&"s":this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","beforeSave"):this.trigger("beforeSave",i,function(t){i.cancel||e.save(t.type,t.fileName)}),t.preventDefault(),t.stopImmediatePropagation();break;case t.ctrlKey&&"z":this.undo();break;case t.ctrlKey&&"y":this.redo()}},i.prototype.resizeHandler=function(){var t=this;if(this.isResponsive&&this.canRedraw&&this.canvasContext&&this.element){this.canvasContext.canvas.width=this.element.offsetWidth,this.canvasContext.canvas.height=this.element.offsetHeight,this.canvasContext.scale(1,1),this.canvasContext.fillStyle=this.strokeColor;for(var e=(this.minStrokeWidth+this.maxStrokeWidth)/2,i=0;i<this.signRatioPointsColl.length;i++)this.arcDraw(this.signRatioPointsColl[i].x*this.canvasContext.canvas.width,this.signRatioPointsColl[i].y*this.canvasContext.canvas.height,e);this.signPointsColl=[],this.canvasContext.closePath(),this.canvasContext.fill()}else if(this.canvasContext&&this.element){var s=new Image;s.src=this.snapColl[this.incStep],s.onload=function(){t.canvasContext.clearRect(0,0,t.element.width,t.element.height),t.canvasContext.drawImage(s,0,0,t.element.width,t.element.height)}}},i.prototype.beginStroke=function(t){this.internalRefresh(),this.updateStroke(t)},i.prototype.updateStroke=function(t){var e=this.createPoint(t);this.addPoint(e)},i.prototype.updateStrokeWithThrottle=function(t){var e=Date.now(),i=this.interval-(e-this.previous);this.storedArgs=t,i<=0||i>this.interval?(this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.previous=e,this.updateStroke(this.storedArgs),this.timeout||(this.storedArgs=null)):this.timeout||(this.timeout=window.setTimeout(this.delay.bind(this),i))},i.prototype.delay=function(){this.previous=Date.now(),this.timeout=null,this.updateStroke(this.storedArgs),this.timeout||(this.storedArgs=null)},i.prototype.createPoint=function(t){var e=this.canvasContext.canvas.getBoundingClientRect();return"mousedown"===t.type||"mousemove"===t.type?this.point(t.clientX-e.left,t.clientY-e.top,(new Date).getTime()):this.point(t.touches[0].clientX-e.left,t.touches[0].clientY-e.top,(new Date).getTime())},i.prototype.point=function(t,e,i){return this.pointX=t,this.pointY=e,this.time=i||(new Date).getTime(),{x:this.pointX,y:this.pointY,time:this.time}},i.prototype.addPoint=function(t){var e,i,s=this.pointColl,n=s.length>0&&s[s.length-1],a=!!n&&this.distanceTo(n)<=this.minDistance;n&&n&&a||(s.push(t),s.length>2&&(3===s.length&&s.unshift(s[0]),e=this.calculateCurveControlPoints(s[0],s[1],s[2]).controlPoint2,i=this.calculateCurveControlPoints(s[1],s[2],s[3]).controlPoint1,this.startPoint=s[1],this.controlPoint1=e,this.controlPoint2=i,this.endPoint=s[2],this.startDraw(),s.shift()))},i.prototype.startDraw=function(){var t;t=this.pointVelocityCalc(this.startPoint),t=this.velocity*t+(1-this.velocity)*this.lastVelocity;var e=Math.max(this.maxStrokeWidth/(t+1),this.minStrokeWidth);this.curveDraw(this.lastWidth,e),this.lastVelocity=t,this.lastWidth=e},i.prototype.endDraw=function(){if(!e.isNullOrUndefined(this.pointColl)){var t=this.pointColl.length>2,i=this.pointColl[0];!t&&i&&this.strokeDraw(i)}},i.prototype.curveDraw=function(t,e){var i,s,n,a,r,l,o,h,u,p,d=this.canvasContext,c=e-t,m=this.bezierLengthCalc(),v=2*Math.ceil(m);for(d.beginPath(),s=0;s<v;s++)r=(a=(n=s/v)*n)*n,u=(h=(o=(l=1-n)*l)*l)*this.startPoint.x,u+=3*o*n*this.controlPoint1.x,u+=3*l*a*this.controlPoint2.x,u+=r*this.endPoint.x,p=h*this.startPoint.y,p+=3*o*n*this.controlPoint1.y,p+=3*l*a*this.controlPoint2.y,p+=r*this.endPoint.y,i=Math.min(t+r*c,this.maxStrokeWidth),this.arcDraw(u,p,i);d.closePath(),d.fill(),this.isSignatureEmpty=!1},i.prototype.strokeDraw=function(t){var e=this.canvasContext,i=(this.minStrokeWidth+this.maxStrokeWidth)/2;e.beginPath(),this.arcDraw(t.x,t.y,i),e.closePath(),e.fill(),this.isSignatureEmpty=!1},i.prototype.arcDraw=function(t,e,i){this.signPointsColl.push({x:t,y:e});var s=this.canvasContext;s.moveTo(t,e),s.arc(t,e,i,0,2*Math.PI,!1)},i.prototype.calculateCurveControlPoints=function(t,e,i){var s=t.x-e.x,n=t.y-e.y,a=e.x-i.x,r=e.y-i.y,l={x:(t.x+e.x)/2,y:(t.y+e.y)/2},o={x:(e.x+i.x)/2,y:(e.y+i.y)/2},h=Math.sqrt(s*s+n*n),u=Math.sqrt(a*a+r*r),p=l.x-o.x,d=l.y-o.y,c=u/(h+u),m={x:o.x+p*c,y:o.y+d*c},v=e.x-m.x,f=e.y-m.y;return{controlPoint1:this.point(l.x+v,l.y+f,0),controlPoint2:this.point(o.x+v,o.y+f,0)}},i.prototype.bezierLengthCalc=function(){var t,e,i,s,n,a,r,l,o=0;for(t=0;t<=10;t++)e=t/10,i=this.bezierPointCalc(e,this.startPoint.x,this.controlPoint1.x,this.controlPoint2.x,this.endPoint.x),s=this.bezierPointCalc(e,this.startPoint.y,this.controlPoint1.y,this.controlPoint2.y,this.endPoint.y),t>0&&(r=i-n,l=s-a,o+=Math.sqrt(r*r+l*l)),n=i,a=s;return o},i.prototype.bezierPointCalc=function(t,e,i,s,n){return e*(1-t)*(1-t)*(1-t)+3*i*(1-t)*(1-t)*t+3*s*(1-t)*t*t+n*t*t*t},i.prototype.pointVelocityCalc=function(t){return this.time!==t.time?this.distanceTo(t)/(this.time-t.time):0},i.prototype.distanceTo=function(t){return Math.sqrt(Math.pow(this.pointX-t.x,2)+Math.pow(this.pointY-t.y,2))},i.prototype.isRead=function(t){t?e.EventHandler.remove(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler):this.disabled||e.EventHandler.add(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler,this)},i.prototype.enableOrDisable=function(t){this.disabled=t,t?(this.canvasContext.canvas.style.filter="opacity(0.5)",this.isRead(!0)):(this.canvasContext.canvas.style.filter="",this.isRead(!1))},i.prototype.updateSnapCollection=function(t){if(e.isNullOrUndefined(this.incStep)?(this.incStep=-1,this.incStep++,this.snapColl=[],this.clearArray=[]):this.incStep++,this.incStep<this.snapColl.length&&(this.snapColl.length=this.incStep),this.incStep>0){var i=this.createElement("canvas",{className:"e-"+this.getModuleName()+"-wrapper"}),s=i.getContext("2d");this.canvasContext&&(i.width=this.canvasContext.canvas.width,i.height=this.canvasContext.canvas.height,s.drawImage(this.canvasContext.canvas,0,0,i.width,i.height),this.snapColl.push(i.toDataURL()))}else this.snapColl.push(this.canvasContext.canvas.toDataURL());t&&this.clearArray.push(this.incStep)},i.prototype.setBackgroundImage=function(t,e){var i=this,s=new Image;s.crossOrigin="anonymous",s.src=t,"temp"===e?s.onload=function(){i.tempContext.globalCompositeOperation="source-over",i.tempContext.drawImage(s,0,0,i.element.width,i.element.height)}:(s.onload=function(){i.canvasContext.globalCompositeOperation="source-over",i.canvasContext.drawImage(s,0,0,i.element.width,i.element.height),i.updateSnapCollection(),i.saveBackground(!0)},this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height))},i.prototype.setBackgroundColor=function(t){var e=this.canvasContext;e.strokeStyle=t;var i,s;for(i=1;i<=e.canvas.width;i++)for(s=1;s<=e.canvas.height;s++)e.strokeRect(0,0,i,s);this.updateSnapCollection()},i.prototype.loadPersistedSignature=function(){if(!e.isNullOrUndefined(this.signatureValue)){var t=this,i=new Image;i.src=this.signatureValue,i.onload=function(){t.canvasContext.clearRect(0,0,t.element.width,t.element.height),t.canvasContext.drawImage(i,0,0),t.updateSnapCollection()},this.isSignatureEmpty=!1}},i.prototype.getBlob=function(t){for(var e=t.split(","),i=e[0].match(/:(.*?);/)[1],s=atob(e[1]),n=s.length,a=new Uint8Array(n);n--;)a[n]=s.charCodeAt(n);return new Blob([a],{type:i})},i.prototype.download=function(t,e){var i=URL.createObjectURL(t),s=document.createElement("a");s.href=i,s.target="_parent",s.download=e,(document.body||document.documentElement).appendChild(s),s.click(),s.parentNode.removeChild(s)},i.prototype.internalRefresh=function(){this.pointColl=[],this.lastVelocity=0,this.lastWidth=(this.minStrokeWidth+this.maxStrokeWidth)/2},i.prototype.refresh=function(){this.isResponsive=!1,this.setHTMLProperties(),this.resizeHandler(),this.internalRefresh()},i.prototype.clear=function(){var t={actionName:"clear"};this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height),this.tempContext.clearRect(0,0,this.tempContext.canvas.width,this.tempContext.canvas.height),this.saveWithBackground&&this.backgroundImage&&this.setBackgroundImage(this.backgroundImage,"temp"),this.internalRefresh(),this.signRatioPointsColl=[],this.updateSnapCollection(!0),this.isSignatureEmpty=this.canRedraw=!0,this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","Clear"):this.trigger("change",t)},i.prototype.undo=function(){var t={actionName:"undo"},e=this;if(this.incStep>0){this.incStep--;var i=new Image;i.src=this.snapColl[this.incStep],i.onload=function(){e.canvasContext.clearRect(0,0,e.element.width,e.element.height),e.canvasContext.drawImage(i,0,0,e.element.width,e.element.height)}}this.isClear(),this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","Undo"):this.trigger("change",t)},i.prototype.redo=function(){var t={actionName:"redo"},e=this;if(this.incStep<this.snapColl.length-1){this.incStep++;var i=new Image;i.src=this.snapColl[this.incStep],i.onload=function(){e.canvasContext.clearRect(0,0,e.element.width,e.element.height),e.canvasContext.drawImage(i,0,0,e.element.width,e.element.height)}}this.isClear(),this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","Redo"):this.trigger("change",t)},i.prototype.isClear=function(){if(this.clearArray){for(var t=!1,e=0;e<this.clearArray.length;e++)this.clearArray[e]===this.incStep&&(this.isSignatureEmpty=!0,t=!0);t||(this.isSignatureEmpty=!1)}},i.prototype.isEmpty=function(){return this.isSignatureEmpty},i.prototype.canUndo=function(){return this.incStep>0},i.prototype.canRedo=function(){return this.incStep<this.snapColl.length-1},i.prototype.draw=function(t,i,s,n,a){var r={actionName:"draw-text"};this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height),i=i||"Arial",s=s||30,this.canvasContext.font=s+"px "+i;var l=this.element.width/2,o=this.element.height/2;e.isNullOrUndefined(n)&&e.isNullOrUndefined(a)?(this.canvasContext.textAlign="center",this.canvasContext.textBaseline="middle"):(l=e.isNullOrUndefined(n)?l:n,o=e.isNullOrUndefined(a)?o+s/2:a+s/2),this.canvasContext.fillText(t,l,o),this.updateSnapCollection(),this.isSignatureEmpty=!1,this.trigger("change",r)},i.prototype.load=function(t,e,i){i=i||this.element.height,e=e||this.element.width,this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height);var s=this,n=new Image;n.src=t,"data"!==t.slice(0,4)&&(n.crossOrigin="anonymous"),n.onload=function(){Promise.all([createImageBitmap(n,0,0,e,i)]).then(function(n){var a=document.createElement("canvas");a.width=e,a.height=i,a.getContext("2d").drawImage(n[0],0,0),"data"!==t.slice(0,4)&&(s.canvasContext.globalCompositeOperation="source-over"),s.canvasContext.drawImage(a,0,0,e,i,0,0,s.element.width,s.element.height),s.updateSnapCollection()})},this.isSignatureEmpty=this.canRedraw=!1},i.prototype.saveBackground=function(t){var e;if(e=t&&this.backgroundImage?this.snapColl[this.incStep-1]:this.snapColl[this.incStep],t||(this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height),this.backgroundImage?this.setBackgroundImage(this.backgroundImage):this.backgroundColor&&(this.setBackgroundColor(this.backgroundColor),t=!0)),t){var i=this,s=new Image;s.crossOrigin="anonymous",s.src=e,s.onload=function(){i.backgroundLoaded=!0,i.canvasContext.globalCompositeOperation="source-over",i.canvasContext.drawImage(s,0,0,i.element.width,i.element.height),i.save(i.fileType,i.fileName)}}},i.prototype.save=function(t,e){if(this.saveWithBackground&&null==this.backgroundLoaded&&(this.backgroundImage||this.backgroundColor))this.backgroundLoaded=!1,this.fileType=t,this.fileName=e,this.saveBackground(!1);else if("Svg"===t)e=e||"Signature",this.toSVG(e);else if("Jpeg"===t)if(e=e||"Signature",!this.saveWithBackground||this.saveWithBackground&&!this.backgroundImage&&!this.backgroundColor)this.toJPEG(e);else{i=this.canvasContext.canvas.toDataURL("image/jpeg");this.download(this.getBlob(i),e+".jpeg")}else{e=e||"Signature";var i=this.canvasContext.canvas.toDataURL("image/png");this.download(this.getBlob(i),e+".png")}this.saveWithBackground&&this.backgroundLoaded&&this.resetSnap()},i.prototype.resetSnap=function(){this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height);var t=this,e=new Image;e.src=this.snapColl[this.incStep-1],e.onload=function(){t.canvasContext.drawImage(e,0,0,t.element.width,t.element.height),t.updateSnapCollection()},this.backgroundLoaded=null,this.snapColl.pop(),this.incStep--,this.snapColl.pop(),this.incStep--},i.prototype.toJPEG=function(t){var e=this,i=this.snapColl[this.incStep];this.setBackgroundColor("#ffffff");var s=this,n=new Image;n.crossOrigin="anonymous",n.src=i,n.onload=function(){s.canvasContext.globalCompositeOperation="source-over",s.canvasContext.drawImage(n,0,0,s.element.width,s.element.height);var i=s.canvasContext.canvas.toDataURL("image/jpeg");s.download(s.getBlob(i),t+".jpeg"),s.canvasContext.clearRect(0,0,s.canvasContext.canvas.width,s.canvasContext.canvas.height),e.resizeHandler()},this.snapColl.pop(),this.incStep--},i.prototype.toSVG=function(t,e){var i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.setAttribute("width",this.canvasContext.canvas.width.toString()),i.setAttribute("height",this.canvasContext.canvas.height.toString());var s=document.createElementNS("http://www.w3.org/2000/svg","image");s.setAttributeNS(null,"height",this.canvasContext.canvas.height.toString()),s.setAttributeNS(null,"width",this.canvasContext.canvas.width.toString()),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e),i.appendChild(s);var n='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+this.canvasContext.canvas.width+'" height="'+this.canvasContext.canvas.height+'">'+i.innerHTML+"</svg>",a="data:image/svg+xml;base64,"+btoa(n);return null==t?a:(this.download(this.getBlob(a),t+".svg"),null)},i.prototype.saveAsBlob=function(){return this.getBlob(this.canvasContext.canvas.toDataURL("image/png"))},i.prototype.getSignature=function(t){return this.saveWithBackground&&this.backgroundColor&&!this.backgroundImage?(this.tempContext.fillStyle=this.backgroundColor,this.tempContext.fillRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height)):this.backgroundColor||this.backgroundImage||"Jpeg"!==t||(this.tempContext.fillStyle="#fff",this.tempContext.fillRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height)),this.tempContext.drawImage(this.element,0,0),"Jpeg"===t?this.tempCanvas.toDataURL("image/jpeg"):"Svg"===t?this.toSVG(null,this.tempCanvas.toDataURL("image/png")):this.tempCanvas.toDataURL("image/png")},i.prototype.getModuleName=function(){return"signature"},i.prototype.getPersistData=function(){return this.signatureValue=this.snapColl[this.incStep],this.addOnPersist(["signatureValue"])},i.prototype.destroy=function(){"image-editor"!==this.getModuleName()&&(this.unwireEvents(null),e.removeClass([this.element],"e-"+this.getModuleName()),this.element.removeAttribute("tabindex"),this.pointColl=null,this.tempContext=null,this.tempCanvas=null,this.canvasContext=null),t.prototype.destroy.call(this),this.element=null},i.prototype.propertyChanged=function(t,e){var i=this.canvasContext;switch(t){case"backgroundColor":i.canvas.style.backgroundColor=e,this.backgroundColor=e;break;case"backgroundImage":i.canvas.style.backgroundImage="url("+e+")",this.backgroundImage=e,this.saveWithBackground&&this.setBackgroundImage(this.backgroundImage,"temp");break;case"strokeColor":i.fillStyle=e,this.strokeColor=e;break;case"saveWithBackground":this.saveWithBackground=e;break;case"maxStrokeWidth":this.maxStrokeWidth=e;break;case"minStrokeWidth":this.minStrokeWidth=e;break;case"velocity":this.velocity=e;break;case"isReadOnly":this.isRead(e);break;case"disabled":this.enableOrDisable(e)}},i}(e.Component),we=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Le=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},Ae=function(t){function i(e,i){return t.call(this,e,i)||this}return we(i,t),i.prototype.preRender=function(){},i.prototype.render=function(){this.initialize()},i.prototype.initialize=function(){this.element.setAttribute("role","img"),this.element.setAttribute("aria-label","signature"),e.addClass([this.element],"e-"+this.getModuleName()),t.prototype.initialize.call(this,this.element),this.enablePersistence&&this.loadPersistedSignature()},i.prototype.getModuleName=function(){return t.prototype.getModuleName.call(this)},i.prototype.getPersistData=function(){return t.prototype.getPersistData.call(this)},i.prototype.onPropertyChanged=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++){var a=n[s];switch(a){case"backgroundColor":t.prototype.propertyChanged.call(this,a,e.backgroundColor);break;case"backgroundImage":t.prototype.propertyChanged.call(this,a,e.backgroundImage);break;case"strokeColor":e.strokeColor!==i.strokeColor&&t.prototype.propertyChanged.call(this,a,e.strokeColor);break;case"maxStrokeWidth":e.maxStrokeWidth!==i.maxStrokeWidth&&t.prototype.propertyChanged.call(this,a,e.maxStrokeWidth);break;case"minStrokeWidth":e.minStrokeWidth!==i.minStrokeWidth&&t.prototype.propertyChanged.call(this,a,e.minStrokeWidth);break;case"velocity":e.velocity!==i.velocity&&t.prototype.propertyChanged.call(this,a,e.velocity);break;case"saveWithBackground":t.prototype.propertyChanged.call(this,a,e.saveWithBackground);break;case"isReadOnly":t.prototype.propertyChanged.call(this,a,e.isReadOnly);break;case"disabled":t.prototype.propertyChanged.call(this,a,e.disabled)}}},Le([e.Property("")],i.prototype,"backgroundColor",void 0),Le([e.Property("")],i.prototype,"backgroundImage",void 0),Le([e.Property(!1)],i.prototype,"disabled",void 0),Le([e.Property(!1)],i.prototype,"isReadOnly",void 0),Le([e.Property(!0)],i.prototype,"saveWithBackground",void 0),Le([e.Property("#000000")],i.prototype,"strokeColor",void 0),Le([e.Property(.5)],i.prototype,"minStrokeWidth",void 0),Le([e.Property(2)],i.prototype,"maxStrokeWidth",void 0),Le([e.Property(.7)],i.prototype,"velocity",void 0),Le([e.Property("en-US")],i.prototype,"locale",void 0),Le([e.Property(!1)],i.prototype,"enableRtl",void 0),Le([e.Property(!1)],i.prototype,"enablePersistence",void 0),Le([e.Event()],i.prototype,"beforeSave",void 0),Le([e.Event()],i.prototype,"change",void 0),Le([e.Event()],i.prototype,"created",void 0),i=Le([e.NotifyPropertyChanges],i)}(Oe),He=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Ne=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},Be="e-rating-icon e-icons e-star-filled",Ie="e-rating-selected";!function(t){t.Top="Top",t.Bottom="Bottom",t.Left="Left",t.Right="Right"}(t.LabelPosition||(t.LabelPosition={})),function(t){t.Full="Full",t.Half="Half",t.Quarter="Quarter",t.Exact="Exact"}(t.PrecisionType||(t.PrecisionType={}));var Ue=function(s){function n(t,e){var i=s.call(this,t,e)||this;return i.itemElements=[],i}return He(n,s),n.prototype.preRender=function(){this.element.id||(this.element.id=e.getUniqueID("e-"+this.getModuleName())),this.keyConfigs={downarrow:"downarrow",leftarrow:"leftarrow",rightarrow:"rightarrow",uparrow:"uparrow",space:"space"},this.tooltipOpen=!1,this.isTouchSelected=!1,e.closest(this.element,"form")&&this.element.getAttribute("value")&&this.setProperties({value:this.element.getAttribute("value")},!0)},n.prototype.render=function(){this.initialize(),this.updateMinValue(),this.updateTemplateFunction(),this.triggerChange(null,this.value,!1,!0),this.renderItems(),this.displayLabel()},n.prototype.initialize=function(){this.wrapper=this.createElement("div",{className:"e-"+this.getModuleName()+"-container "}),this.element.parentNode.insertBefore(this.wrapper,this.element),this.wrapper.appendChild(this.element),null==this.element.getAttribute("name")&&this.element.setAttribute("name",this.element.id),e.attributes(this.element,{"aria-label":"rating"}),this.renderItemList(),this.updateReset(),this.readOnly&&this.wrapper.classList.add("e-rating-readonly"),this.visible||this.wrapper.classList.add("e-rating-hidden"),this.enableRtl&&this.wrapper.classList.add("e-rtl"),this.enableAnimation&&this.wrapper.classList.add("e-rating-animation"),this.cssClass&&e.addClass([this.wrapper],this.cssClass.split(" ")),this.updateTooltip(),this.wireKeyboardEvent(),this.updateDisabled()},n.prototype.updateDisabled=function(){this.wrapper.classList[this.disabled?"add":"remove"]("e-disabled"),e.attributes(this.ratingItemList,{tabindex:this.disabled?"-1":"0"}),this.updateResetButton()},n.prototype.updateResetButton=function(){if(this.allowReset){this.resetElement&&this.resetElement.blur();var t=this.value<=this.min||this.disabled;this.resetElement.classList[t?"add":"remove"]("e-disabled"),e.attributes(this.resetElement,{tabindex:t?"-1":"0","aria-hidden":t.toString()})}},n.prototype.renderItemList=function(){var t=this;this.ratingItemList=this.createElement("div",{className:"e-rating-item-list",id:this.element.id+"_item-list"}),e.attributes(this.ratingItemList,{"aria-label":"rating",role:"slider"}),this.wrapper.appendChild(this.ratingItemList),e.EventHandler.add(this.ratingItemList,"touchmove",function(e){return t.touchMoveHandler(e)},this),e.EventHandler.add(this.ratingItemList,e.Browser.touchEndEvent,this.touchEndHandler,this)},n.prototype.touchMoveHandler=function(t){this.isTouchSelected||(this.wrapper.classList.add("e-rating-touch"),this.isTouchSelected=!0),this.wrapper.classList.add("e-touch-select");var e=this.ratingItemList.getBoundingClientRect(),i=(t.touches[0].clientX-e.x)/e.width*this.itemsCount;i=(i=this.enableRtl?this.itemsCount-i:i)<this.min?this.min:i>this.itemsCount?this.itemsCount:i;var s=0===(i=this.validateValue(i))?null:this.itemElements[parseInt((Math.ceil(i)-1).toString(),10)];if(i===this.currentValue)return void(this.showTooltip&&s&&this.openRatingTooltip(s,!1));var n=this.currentValue;this.triggerChange(t,i),this.updateCurrentValue(i),this.showTooltip&&(s?(Math.ceil(i)!==Math.ceil(n)&&this.closeRatingTooltip(),this.openRatingTooltip(s,!0)):this.closeRatingTooltip())},n.prototype.touchEndHandler=function(){this.closeRatingTooltip(),this.wrapper.classList.remove("e-touch-select")},n.prototype.updateTemplateFunction=function(){this.emptyTemplateFunction=this.emptyTemplate?this.getTemplateString(this.emptyTemplate):null,this.fullTemplateFunction=this.fullTemplate?this.getTemplateString(this.fullTemplate):null},n.prototype.renderItems=function(){for(var t=this,i=0;i<this.itemsCount;i++){var s=this.createElement("span",{className:"e-rating-item-container"}),n=this.createElement("span",{className:"e-rating-item"}),a=this.getRatingValue(this.value,i);this.renderItemContent(n,a,i,!1),s.appendChild(n),this.wireItemsEvents(s,i+1),this.itemElements.push(s);var r={element:s,value:i+1};this.trigger("beforeItemRender",r,function(e){t.ratingItemList.appendChild(e.element)})}e.attributes(this.ratingItemList,{"aria-valuemax":this.itemsCount.toString()}),this.updateItemValue(!1)},n.prototype.renderItemContent=function(t,i,s,n){n&&this.removeItemContent(t),this.fullTemplate&&1===i?(t.classList.add("e-rating-full"),e.append(this.fullTemplateFunction({index:s,ratingValue:i},this,"ratingFullTemplate",this.element.id+"fullTemplate",this.isStringTemplate),t)):this.emptyTemplate?(t.classList.add("e-rating-empty"),e.append(this.emptyTemplateFunction({index:s,ratingValue:i},this,"ratingEmptyTemplate",this.element.id+"emptyTemplate",this.isStringTemplate),t)):e.addClass([t],Be.split(" "))},n.prototype.removeItemContent=function(t){t.classList.remove("e-rating-full","e-rating-empty"),e.removeClass([t],Be.split(" ")),t.firstChild&&(t.innerHTML="")},n.prototype.updateTooltip=function(){this.showTooltip?(this.tooltipObj=new i.Tooltip({target:".e-rating-item-container",windowCollision:!0,opensOn:"Custom",cssClass:this.cssClass?"e-rating-tooltip "+this.cssClass:"e-rating-tooltip"}),this.tooltipObj.appendTo(this.ratingItemList)):e.isNullOrUndefined(this.tooltipObj)||(this.tooltipObj.destroy(),this.tooltipObj=null)},n.prototype.updateMinValue=function(){this.setProperties({min:this.validateValue(this.min)},!0),this.min>0&&this.value<this.min&&this.triggerChange(null,this.min,!1),e.attributes(this.ratingItemList,{"aria-valuemin":this.min.toString()})},n.prototype.validateValue=function(e){return e=e>this.itemsCount?this.itemsCount:e<0?0:this.precision===t.PrecisionType.Full||this.enableSingleSelection?Math.round(e):this.precision===t.PrecisionType.Half?Math.round(2*e)/2:this.precision===t.PrecisionType.Quarter?Math.round(4*e)/4:Math.round(10*e)/10},n.prototype.getRatingValue=function(t,e){return this.enableSingleSelection?t>e&&t<=e+1?1:0:t>=e+1?1:t<e?0:t-e},n.prototype.updateItemValue=function(i){void 0===i&&(i=!0),i&&this.isReact&&this.clearTemplate(["ratingEmptyTemplate","ratingFullTemplate"]);for(var s=0;s<this.itemsCount;s++){var n=this.itemElements[parseInt(s.toString(),10)];n.classList.remove(Ie,"e-rating-intermediate","e-selected-value");var a=this.getRatingValue(this.currentValue,s);1===a?n.classList.add(Ie):a>0?n.classList.add("e-rating-intermediate"):this.precision===t.PrecisionType.Full&&s+1<=this.value&&!this.enableSingleSelection&&n.classList.add("e-selected-value"),i&&this.updateItemContent(a,s),n.style.setProperty("--rating-value",100*a+"%"),n.classList[0===this.value&&0===s||this.value===s+1||a>0&&a<1?"add":"remove"]("e-rating-focus")}i&&this.renderReactTemplates(),this.updateResetButton(),e.attributes(this.ratingItemList,{"aria-valuenow":this.currentValue.toString()}),e.attributes(this.element,{value:this.value.toString()})},n.prototype.updateItemContent=function(t,i){if(this.fullTemplate||this.emptyTemplate){var s=this.itemElements[parseInt(i.toString(),10)].querySelector(".e-rating-item");if(this.fullTemplate&&1===t){if(!this.isReact&&s.classList.contains("e-rating-full"))return;this.removeItemContent(s),s.classList.add("e-rating-full"),e.append(this.fullTemplateFunction({ratingValue:t,index:i},this,"ratingFullTemplate",this.element.id+"fullTemplate"+i,this.isStringTemplate),s)}else if(this.emptyTemplate){if(!this.isReact&&s.classList.contains("e-rating-empty"))return;this.removeItemContent(s),s.classList.add("e-rating-empty"),e.append(this.emptyTemplateFunction({ratingValue:t,index:i},this,"ratingEmptyTemplate",this.element.id+"emptyTemplate"+i,this.isStringTemplate),s)}else this.removeItemContent(s),e.addClass([s],Be.split(" "))}},n.prototype.updateTooltipContent=function(t){var i=this;if(this.showTooltip){this.isReact&&this.clearTemplate(["ratingTooltipTemplate"]);var s;if(this.tooltipTemplate){s=this.createElement("span",{className:"e-rating-tooltip-content"});var n=this.getTemplateString(this.tooltipTemplate);e.append(n({value:this.currentValue},this,"ratingTooltipTemplate",this.element.id+"tooltipTemplate",this.isStringTemplate),s),this.tooltipObj.setProperties({content:s},t),this.isAngular&&setTimeout(function(){var t=i.ratingItemList.querySelectorAll(".e-rating-item-container."+Ie);i.tooltipObj.refresh(t[t.length-1])})}else s=this.currentValue.toString(),this.tooltipObj.setProperties({content:e.initializeCSPTemplate(function(){return s})},t);this.renderReactTemplates()}},n.prototype.getTemplateString=function(t){var i="";try{if("function"!=typeof t){var s=e.select(t);i=s?"SCRIPT"===s.tagName?s.innerHTML:s.outerHTML:t}else i=t}catch(e){i=t}return e.compile(i)},n.prototype.displayLabel=function(){this.showLabel?(this.spanLabel=this.createElement("span",{className:"e-rating-label"}),this.updateLabel(),this.updateLabelPosition()):this.wrapper.contains(this.spanLabel)&&(e.remove(this.spanLabel),this.spanLabel=null)},n.prototype.updateLabel=function(){if(this.showLabel)if(this.labelTemplate){this.isReact&&this.clearTemplate(["ratingLabelTemplate"]),this.spanLabel.firstChild&&(this.spanLabel.innerHTML="");var t=this.getTemplateString(this.labelTemplate);e.append(t({value:this.currentValue},this,"ratingLabelTemplate",this.element.id+"labelTemplate",this.isStringTemplate),this.spanLabel),this.renderReactTemplates()}else this.spanLabel.textContent=this.currentValue+" / "+this.itemsCount},n.prototype.updateReset=function(){this.allowReset?(this.resetElement=this.createElement("span",{className:"e-icons e-reset",attrs:{"aria-label":"resetbutton",role:"button"}}),this.updateResetButton(),e.EventHandler.add(this.resetElement,"click",this.resetClicked,this),this.wrapper.insertBefore(this.resetElement,this.ratingItemList)):this.wrapper.contains(this.resetElement)&&(e.remove(this.resetElement),this.resetElement=null)},n.prototype.updateLabelPosition=function(){this.clearLabelPosition(),this.spanLabel.classList.add("e-label-"+this.labelPosition.toLowerCase()),"Left"===this.labelPosition||"Top"===this.labelPosition?this.wrapper.firstChild.after(this.spanLabel):this.wrapper.appendChild(this.spanLabel)},n.prototype.clearLabelPosition=function(){var t=this.spanLabel.classList.value.match(/(e-label-[top|bottom|right|left]+)/g);t&&e.removeClass([this.spanLabel],t)},n.prototype.wireItemsEvents=function(t,i){var s=this;e.EventHandler.add(t,"click",function(t){return s.clickHandler(t)},this),e.EventHandler.add(t,"mousemove",function(t){return s.mouseMoveHandler(i,t)},this),e.EventHandler.add(t,"mouseleave",this.mouseLeaveHandler,this)},n.prototype.clickHandler=function(t){this.currentValue=this.min>0&&this.currentValue<this.min?this.min:this.currentValue,this.triggerChange(t,this.currentValue),this.updateItemValue(),this.updateLabel(),this.updateResetButton()},n.prototype.updateValueChange=function(t,e,i){void 0===i&&(i=!0),this.triggerChange(t,e,i),this.updateItemValue(),this.updateLabel()},n.prototype.triggerChange=function(t,e,i,s){void 0===i&&(i=!0),void 0===s&&(s=!1);var n=this;if(e=this.validateValue(e),this.currentValue=e,this.currentValue!==this.value){var a={event:t,isInteracted:i,value:e,previousValue:this.value};this.setProperties({value:e},!0),this.isAngular&&!s&&n.localChange({value:e}),s||this.trigger("valueChanged",a)}},n.prototype.mouseMoveHandler=function(t,e){this.isTouchSelected&&(this.wrapper.classList.remove("e-rating-touch"),this.isTouchSelected=!1);var i=this.calculateCurrentValue(t,e);i=this.validateValue(i);var s=this.itemElements[parseInt((t-1).toString(),10)];if(i===this.currentValue)return void this.openRatingTooltip(s,!1);this.updateCurrentValue(i),this.openRatingTooltip(s,!0);var n={element:s,event:e,value:i};this.trigger("onItemHover",n)},n.prototype.openRatingTooltip=function(t,e){this.showTooltip&&(this.tooltipOpen?e&&(this.updateTooltipContent(!0),this.tooltipObj.refresh(t)):(this.updateTooltipContent(!1),this.tooltipObj.open(t),this.tooltipOpen=!0))},n.prototype.closeRatingTooltip=function(){this.tooltipOpen&&(this.tooltipObj.close(),this.tooltipOpen=!1)},n.prototype.updateCurrentValue=function(t){this.currentValue=t,this.updateItemValue(),this.updateLabel()},n.prototype.mouseLeaveHandler=function(){this.closeRatingTooltip(),this.updateCurrentValue(this.value)},n.prototype.calculateCurrentValue=function(e,i){var s=e;return this.enableSingleSelection||this.precision===t.PrecisionType.Full||(s=i.offsetX/this.itemElements[e-1].clientWidth,s=this.enableRtl?1-s:s,this.precision===t.PrecisionType.Quarter?s=s<=.25?.25:s<=.5?.5:s<.75?.75:1:this.precision===t.PrecisionType.Half&&(s=s<=.5?.5:1),s=s+e-1),s},n.prototype.reset=function(){this.resetClicked(null,!1)},n.prototype.resetClicked=function(t,e){void 0===e&&(e=!0),this.updateValueChange(t,this.min,e),this.updateResetButton()},n.prototype.wireKeyboardEvent=function(){this.keyboardModuleRating=new e.KeyboardEvents(this.wrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},n.prototype.keyActionHandler=function(t){if(t.preventDefault(),!this.disabled&&!this.readOnly){if(t.target.classList.contains("e-rating-item-list"))switch(t.action){case"uparrow":this.handleNavigation(t,!0);break;case"downarrow":this.handleNavigation(t,!1);break;case"leftarrow":this.handleNavigation(t,this.enableRtl);break;case"rightarrow":this.handleNavigation(t,!this.enableRtl)}if(this.allowReset&&t.target.classList.contains("e-reset"))switch(t.action){case"space":this.resetClicked(t)}}},n.prototype.handleNavigation=function(e,i){if(!i&&this.value>this.min||i&&this.value<this.itemsCount){var s=this.precision===t.PrecisionType.Full||this.enableSingleSelection?1:this.precision===t.PrecisionType.Half?.5:this.precision===t.PrecisionType.Quarter?.25:Math.round(1)/10;s=i?this.value+s:this.value-s,this.updateValueChange(e,s),this.updateResetButton()}},n.prototype.updateContent=function(){this.isReact&&this.clearTemplate(["ratingEmptyTemplate","ratingFullTemplate"]);for(var t=0;t<this.itemsCount;t++){var e=this.itemElements[parseInt(t.toString(),10)].firstElementChild;this.renderItemContent(e,this.getRatingValue(this.value,t),t,!0)}},n.prototype.getModuleName=function(){return"rating"},n.prototype.getPersistData=function(){return this.addOnPersist([])},n.prototype.removeItemElements=function(){for(var t=0;t<this.itemElements.length;t++)e.remove(this.itemElements[parseInt(t.toString(),10)]);this.itemElements=[]},n.prototype.destroy=function(){var t=this;s.prototype.destroy.call(this),this.removeItemElements(),this.clearTemplate(),this.spanLabel&&(e.remove(this.spanLabel),this.spanLabel=null),this.resetElement&&(e.remove(this.resetElement),this.resetElement=null),this.showTooltip&&(this.tooltipObj.destroy(),this.tooltipObj=null),e.remove(this.ratingItemList),this.ratingItemList=null,this.wrapper.parentNode.insertBefore(this.element,this.wrapper),e.remove(this.wrapper),this.wrapper=null,this.keyboardModuleRating.destroy(),this.keyboardModuleRating=null,["value","aria-label","name"].forEach(function(e){t.element.removeAttribute(e)})},n.prototype.onPropertyChanged=function(t,i){for(var s=0,n=Object.keys(t);s<n.length;s++)switch(n[s]){case"value":this.updateValueChange(null,this.value>this.min?this.value:this.min,!1);break;case"min":this.updateMinValue(),this.updateItemValue(),this.updateLabel();break;case"showLabel":this.displayLabel();break;case"visible":this.wrapper.classList[this.visible?"remove":"add"]("e-rating-hidden");break;case"disabled":this.updateDisabled();break;case"readOnly":this.wrapper.classList[this.readOnly?"add":"remove"]("e-rating-readonly");break;case"allowReset":this.updateReset();break;case"enableRtl":this.wrapper.classList[this.enableRtl?"add":"remove"]("e-rtl");break;case"cssClass":i.cssClass&&e.removeClass([this.wrapper],i.cssClass.split(" ")),t.cssClass&&e.addClass([this.wrapper],t.cssClass.split(" ")),this.tooltipObj&&this.tooltipObj.setProperties({cssClass:this.cssClass?"e-rating-tooltip "+this.cssClass:"e-rating-tooltip"});break;case"labelPosition":this.updateLabelPosition();break;case"showTooltip":this.updateTooltip();break;case"precision":this.updateMinValue(),this.triggerChange(null,this.value,!1),this.updateItemValue(),this.updateLabel();break;case"enableSingleSelection":this.updateValueChange(null,this.currentValue,!1);break;case"enableAnimation":this.wrapper.classList[this.enableAnimation?"add":"remove"]("e-rating-animation");break;case"emptyTemplate":case"fullTemplate":this.updateTemplateFunction(),this.updateContent();break;case"labelTemplate":this.updateLabel();break;case"itemsCount":this.removeItemElements(),this.renderItems(),this.updateLabel()}},Ne([e.Property(!1)],n.prototype,"allowReset",void 0),Ne([e.Property("")],n.prototype,"cssClass",void 0),Ne([e.Property(!1)],n.prototype,"disabled",void 0),Ne([e.Property("")],n.prototype,"emptyTemplate",void 0),Ne([e.Property(!0)],n.prototype,"enableAnimation",void 0),Ne([e.Property(!1)],n.prototype,"enableSingleSelection",void 0),Ne([e.Property("")],n.prototype,"fullTemplate",void 0),Ne([e.Property(5)],n.prototype,"itemsCount",void 0),Ne([e.Property(t.LabelPosition.Right)],n.prototype,"labelPosition",void 0),Ne([e.Property("")],n.prototype,"labelTemplate",void 0),Ne([e.Property(0)],n.prototype,"min",void 0),Ne([e.Property(t.PrecisionType.Full)],n.prototype,"precision",void 0),Ne([e.Property(!1)],n.prototype,"readOnly",void 0),Ne([e.Property(!1)],n.prototype,"showLabel",void 0),Ne([e.Property(!0)],n.prototype,"showTooltip",void 0),Ne([e.Property("")],n.prototype,"tooltipTemplate",void 0),Ne([e.Property(0)],n.prototype,"value",void 0),Ne([e.Property(!0)],n.prototype,"visible",void 0),Ne([e.Event()],n.prototype,"beforeItemRender",void 0),Ne([e.Event()],n.prototype,"created",void 0),Ne([e.Event()],n.prototype,"onItemHover",void 0),Ne([e.Event()],n.prototype,"valueChanged",void 0),n=Ne([e.NotifyPropertyChanges],n)}(e.Component),Re=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Ve=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r};!function(t){t.Number="number",t.Text="text",t.Password="password"}(t.OtpInputType||(t.OtpInputType={})),function(t){t.Outlined="outlined",t.Underlined="underlined",t.Filled="filled"}(t.OtpInputStyle||(t.OtpInputStyle={})),function(t){t.None="none",t.Uppercase="uppercase",t.Lowercase="lowercase"}(t.TextTransform||(t.TextTransform={}));var Fe=function(i){function s(t,e){var s=i.call(this,t,e)||this;return s.inputs=[],s.previousValue="",s.separatorElements=[],s.shouldFireFocus=!0,s.shouldFireBlur=!0,s.isFocusInCalled=!1,s.isFocusOutCalled=!1,s.handleWheelEvent=function(t){t.preventDefault()},s}return Re(s,i),s.prototype.preRender=function(){this.element.id||(this.element.id=e.getUniqueID("e-"+this.getModuleName()))},s.prototype.render=function(){this.initialize()},s.prototype.initialize=function(){e.attributes(this.element,{role:"group"}),this.renderInputs(),this.renderSeparator(1,this.inputs.length),this.addPlaceHolder(),this.updateCssClass(this.cssClass),this.updateVariantClass(),this.updateAriaLabel(this.ariaLabels),this.setElementAttributes(this.htmlAttributes,this.element),this.enableRtl&&this.element.classList.add("e-rtl"),this.previousValue=this.value.toString(),this.autoFocus&&this.focusIn()},s.prototype.renderInputs=function(){this.hiddenInputEle=this.createElement("input",{id:"otpInput_hidden",attrs:{name:this.element.id,type:"hidden",value:"number"===this.type?this.value.toString().replace(/\D/g,""):this.value.toString(),autoComplete:"off"}}),this.element.appendChild(this.hiddenInputEle);for(var t=0;t<this.length;t++)this.createOtpInput(t)},s.prototype.createOtpInput=function(t){var e=this.getDefaultValue(),i="";if(e){var s=e[parseInt(t.toString(),10)];"number"===this.type?isNaN(Number(s))||(i=s):i=s||""}var n=this.createElement("input",{id:this.element.id+"-"+(t+1),className:"e-otp-input-field e-input",attrs:{maxlength:"1",type:this.type,inputmode:this.htmlAttributes.inputmode||("number"===this.type?"numeric":"text")}});this.disabled&&n.setAttribute("disabled","disabled"),this.element.appendChild(n),this.inputs.push(n),i&&(n.value=i),this.wireEvents(n,t)},s.prototype.renderSeparator=function(t,e){if(this.separator.length>0)for(var i=t;i<e;i++){var s=this.createElement("span",{className:"e-otp-separator"});s.textContent=this.separator,this.separatorElements.push(s),this.element.insertBefore(s,this.inputs[parseInt(i.toString(),10)])}},s.prototype.updateSeparatorValue=function(){var t=this;""===this.separator?(this.separatorElements.forEach(function(t){return e.remove(t)}),this.separatorElements=[]):this.separatorElements.forEach(function(e){e.textContent=t.separator})},s.prototype.addPlaceHolder=function(){for(var t=0;t<this.inputs.length;t++){var e=this.placeholder.length<=1?this.placeholder:this.placeholder.charAt(t);this.setElementAttributes({placeholder:e},this.inputs[parseInt(t.toString(),10)])}},s.prototype.updateInputType=function(t){var e=this.htmlAttributes.inputmode||("number"===t?"numeric":"text");this.inputs.forEach(function(i){i.type=t,i.setAttribute("inputmode",e)})},s.prototype.getDefaultValue=function(){var t="number"==typeof this.value?this.value.toString():this.value;this.textTransform&&(t=this.getTransformedText(t));var e=t.replace(/\s/g,"");return e.length>0?e.split(""):void 0},s.prototype.getTransformedText=function(e){return this.textTransform.toLowerCase()===t.TextTransform.Lowercase?e.toLowerCase():this.textTransform.toLowerCase()===t.TextTransform.Uppercase?e.toUpperCase():e},s.prototype.handleInputChange=function(t,e){var i=this.inputs[parseInt(t.toString(),10)];if(i&&t<this.length-1&&i.value.length>0){var s=this.inputs[parseInt(t.toString(),10)+1];this.shouldFireFocus=this.shouldFireBlur=!1,s.focus(),s&&s.value.length>0&&s.select()}var n=e.target;n.value.length>1&&(n.value=n.value.slice(0,1)),this.textTransform&&(n.value=this.getTransformedText(n.value)),this.triggerInputEvent(t,e),this.triggerValuechanged(e,!0)},s.prototype.handleKeyAction=function(t,e){e.key.length>1&&!(0===t&&"Backspace"===e.key||t===this.length-1&&"Delete"===e.key)&&(this.shouldFireFocus=this.shouldFireBlur=!1);var i=this.inputs[parseInt(t.toString(),10)],s=this.inputs[parseInt(t.toString(),10)-1],n=this.inputs[parseInt(t.toString(),10)+1];if("Delete"===e.key){var a="";i.value.length>0?(a=i.value,i.value=""):t!==this.inputs.length-1&&(a=n.value,n.value="",n.focus()),a.length>0&&this.triggerInputEvent(t,e)}else if("Backspace"===e.key){if(0!==t&&0===i.value.length){var r=s.value;s.value="",s.focus(),r.length>0&&this.triggerInputEvent(t,e)}}else"ArrowLeft"===e.key||"ArrowRight"===e.key?("ArrowLeft"===e.key&&t>0?(s.focus(),s.select()):"ArrowRight"===e.key&&t<this.inputs.length-1&&(n.focus(),n.select()),e.preventDefault()):"ArrowUp"===e.key||"ArrowDown"===e.key?e.preventDefault():"Tab"===e.key||e.shiftKey||e.ctrlKey||"number"===this.type&&/\D/.test(e.key.toLocaleLowerCase())&&e.preventDefault()},s.prototype.handleSelection=function(t){var e=this.inputs[parseInt(t.toString(),10)];e.value&&e.select()},s.prototype.handleFocus=function(t,i){if(e.addClass([this.inputs[parseInt(t.toString(),10)]],"e-otp-input-focus"),this.shouldFireFocus){var s={element:this.element,event:i,index:t,isInteracted:!this.isFocusInCalled,value:this.value};this.trigger("focus",s)}this.shouldFireFocus=!0},s.prototype.handleBlur=function(t,i){if(e.removeClass([this.inputs[parseInt(t.toString(),10)]],"e-otp-input-focus"),this.shouldFireBlur){var s={element:this.element,event:i,value:this.value,index:t,isInteracted:!this.isFocusOutCalled};this.trigger("blur",s)}this.shouldFireBlur=!0},s.prototype.handlePaste=function(t,e){var i=e.clipboardData;if(i){for(var s=i.getData("text").split(""),n=0,a=t;a<this.inputs.length;a++)s.length>0&&s[parseInt(n.toString(),10)]&&(this.inputs[parseInt(a.toString(),10)].value=s[parseInt(n.toString(),10)],n++,this.updateValueProperty());this.focusIn(),this.triggerValuechanged(e,!0)}},s.prototype.triggerInputEvent=function(t,e){var i=this.value.toString();this.updateValueProperty();var s={element:this.element,event:e,previousValue:i,value:this.value.toString(),index:t};this.trigger("input",s)},s.prototype.triggerValuechanged=function(t,e){if(this.length===this.value.toString().length&&this.previousValue!==this.value){var i={element:this.element,event:t,isInteracted:e||!1,previousValue:this.previousValue,value:this.value};this.trigger("valueChanged",i),this.previousValue=this.value.toString()}},s.prototype.wireEvents=function(t,i){e.EventHandler.add(t,"focus",this.handleFocus.bind(this,i),this),e.EventHandler.add(t,"blur",this.handleBlur.bind(this,i),this),e.EventHandler.add(t,"input",this.handleInputChange.bind(this,i),this),e.EventHandler.add(t,"keydown",this.handleKeyAction.bind(this,i),this),e.EventHandler.add(t,"click",this.handleSelection.bind(this,i),this),e.EventHandler.add(t,"paste",this.handlePaste.bind(this,i),this),e.EventHandler.add(t,"wheel",this.handleWheelEvent,this)},s.prototype.unWireEvents=function(){for(var t=0;t<this.inputs.length;t++){var i=this.inputs[parseInt(t.toString(),10)];e.EventHandler.remove(i,"focus",this.handleFocus.bind(this,t)),e.EventHandler.remove(i,"blur",this.handleBlur.bind(this,t)),e.EventHandler.remove(i,"input",this.handleInputChange.bind(this,t)),e.EventHandler.remove(i,"keydown",this.handleKeyAction.bind(this,t)),e.EventHandler.remove(i,"click",this.handleSelection.bind(this,t)),e.EventHandler.remove(i,"paste",this.handlePaste.bind(this,t)),e.EventHandler.remove(i,"wheel",this.handleWheelEvent)}},s.prototype.updateValueProperty=function(){var t="";this.inputs.forEach(function(e){t+=e.value});var e=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.value="number"==typeof this.value?parseInt(t,10):t,this.isProtectedOnChange=e,this.hiddenInputEle.value=this.value.toString()},s.prototype.updateInputValue=function(t){var e=this.value.toString();this.textTransform&&(e=this.getTransformedText(e));for(var i=t.toString(),s=0;s<this.inputs.length;s++)i.charAt(s)!==e.charAt(s)&&(this.inputs[parseInt(s.toString(),10)].value=e.charAt(s),this.hiddenInputEle.value=e);this.focusIn()},s.prototype.updateCssClass=function(t,e){void 0===e&&(e="");var i,s,n;e&&(n=e.trim().split(" "),(i=this.element.classList).remove.apply(i,n)),t&&(n=t.trim().split(" "),(s=this.element.classList).add.apply(s,n))},s.prototype.updateVariantClass=function(){var t="outlined"===this.stylingMode.toLocaleLowerCase()?"outline":this.stylingMode.toLocaleLowerCase(),i=["underlined","filled","outline"];-1!==i.indexOf(t)&&(e.removeClass([this.element],i.map(function(t){return"e-"+t})),e.addClass([this.element],"e-"+t))},s.prototype.updateAriaLabel=function(t){this.inputs.forEach(function(e,i){var s="Enter Otp Character "+(i+1),n=t&&t.length>0?t[parseInt(i.toString(),10)]||s:s;e.setAttribute("aria-label",n)})},s.prototype.updateDisabledState=function(){var t=this;this.inputs.forEach(function(e){t.disabled?e.setAttribute("disabled","disabled"):e.removeAttribute("disabled")})},s.prototype.setElementAttributes=function(t,i){if(!e.isNullOrUndefined(t))for(var s in t)if("class"===s){var n=t.class.replace(/\s+/g," ").trim();n&&e.addClass([i],n.split(" "))}else"inputmode"===s?this.setInputMode(t[""+s]):"name"===s&&this.element.id===i.id?this.hiddenInputEle.setAttribute(s,t[""+s]):i.setAttribute(s,t[""+s])},s.prototype.setInputMode=function(t){for(var e=0;e<this.inputs.length;e++)this.inputs[parseInt(e.toString(),10)].setAttribute("inputmode",t)},s.prototype.handleLengthChange=function(t,i){if(t-i>0){for(n=i;n<t;n++)this.createOtpInput(n);this.renderSeparator(i,t),this.addPlaceHolder(),this.updateAriaLabel(this.ariaLabels)}else if(t>=0&&this.inputs.length>0){for(n=t;n<this.inputs.length;n++)e.remove(this.inputs[parseInt(n.toString(),10)]);if(this.inputs.splice(t),this.separatorElements.length>0){for(var s=0===t?0:t-1,n=s;n<this.separatorElements.length;n++)e.remove(this.separatorElements[parseInt(n.toString(),10)]);this.separatorElements.splice(s)}}},s.prototype.getModuleName=function(){return"otpinput"},s.prototype.getPersistData=function(){return this.addOnPersist([])},s.prototype.destroy=function(){i.prototype.destroy.call(this),this.unWireEvents(),this.inputs.forEach(function(t){e.remove(t)}),this.separatorElements.forEach(function(t){e.remove(t)}),e.remove(this.hiddenInputEle),e.removeClass([this.element],["e-underlined","e-filled","e-outline","e-rtl"]),this.cssClass&&e.removeClass([this.element],this.cssClass.trim().split(" ")),this.element.removeAttribute("role"),this.inputs=[],this.separatorElements=[],this.hiddenInputEle=null},s.prototype.focusIn=function(){this.isFocusInCalled=!0;for(var t=this.inputs.length-1,e=0;e<this.inputs.length;e++)if(!(this.inputs[parseInt(e.toString(),10)].value.length>0)){t=e;break}this.inputs[parseInt(t.toString(),10)].focus(),this.isFocusInCalled=!1},s.prototype.focusOut=function(){this.isFocusOutCalled=!0,this.inputs.forEach(function(t){t.blur()}),this.isFocusOutCalled=!1},s.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"textTransform":this.updateInputValue(this.value);break;case"value":this.updateInputValue(e.value),this.triggerValuechanged();break;case"placeholder":this.addPlaceHolder();break;case"disabled":this.updateDisabledState();break;case"cssClass":this.updateCssClass(t.cssClass,e.cssClass);break;case"separator":""===e.separator?this.renderSeparator(1,this.inputs.length):this.updateSeparatorValue();break;case"htmlAttributes":this.setElementAttributes(t.htmlAttributes,this.element);break;case"type":this.updateInputType(t.type);break;case"stylingMode":this.updateVariantClass();break;case"ariaLabels":this.updateAriaLabel(t.ariaLabels);break;case"length":this.handleLengthChange(t.length,e.length);break;case"enableRtl":this.element.classList[this.enableRtl?"add":"remove"]("e-rtl");break;case"autoFocus":this.autoFocus&&this.focusIn()}},Ve([e.Property(4)],s.prototype,"length",void 0),Ve([e.Property("")],s.prototype,"value",void 0),Ve([e.Property(t.OtpInputType.Number)],s.prototype,"type",void 0),Ve([e.Property("")],s.prototype,"separator",void 0),Ve([e.Property("")],s.prototype,"placeholder",void 0),Ve([e.Property(t.OtpInputStyle.Outlined)],s.prototype,"stylingMode",void 0),Ve([e.Property(!1)],s.prototype,"disabled",void 0),Ve([e.Property("")],s.prototype,"cssClass",void 0),Ve([e.Property(!1)],s.prototype,"autoFocus",void 0),Ve([e.Property(t.TextTransform.None)],s.prototype,"textTransform",void 0),Ve([e.Property({})],s.prototype,"htmlAttributes",void 0),Ve([e.Property([])],s.prototype,"ariaLabels",void 0),Ve([e.Event()],s.prototype,"created",void 0),Ve([e.Event()],s.prototype,"valueChanged",void 0),Ve([e.Event()],s.prototype,"focus",void 0),Ve([e.Event()],s.prototype,"blur",void 0),Ve([e.Event()],s.prototype,"input",void 0),s=Ve([e.NotifyPropertyChanges],s)}(e.Component),Me=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),De=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},ze=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Me(i,t),De([e.Property("")],i.prototype,"content",void 0),De([e.Property("")],i.prototype,"stopContent",void 0),De([e.Property("")],i.prototype,"iconCss",void 0),De([e.Property("")],i.prototype,"stopIconCss",void 0),De([e.Property("Left")],i.prototype,"iconPosition",void 0),De([e.Property(!1)],i.prototype,"isPrimary",void 0),i}(e.ChildProperty),We=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Me(i,t),De([e.Property("Start listening")],i.prototype,"content",void 0),De([e.Property("Stop listening")],i.prototype,"stopContent",void 0),De([e.Property("TopCenter")],i.prototype,"position",void 0),i}(e.ChildProperty);!function(t){t.Inactive="Inactive",t.Listening="Listening",t.Stopped="Stopped"}(t.SpeechToTextState||(t.SpeechToTextState={}));var qe=function(s){function a(t,e){var i=s.call(this,t,e)||this;return i.fullTranscript="",i.isClicked=!1,i.isUserInteracted=!1,i.hasStarted=!1,i}return Me(a,s),a.prototype.preRender=function(){this.element.id||(this.element.id=e.getUniqueID("e-"+this.getModuleName()))},a.prototype.getDirective=function(){return"EJS-SPEECHTOTEXT"},a.prototype.getModuleName=function(){return"speech-to-text"},a.prototype.getPersistData=function(){return this.addOnPersist([])},a.prototype.render=function(){this.renderSpeechToText(),this.initializeSpeechRecognition(),e.isNullOrUndefined(this.listeningState)||this.handleStateChange(),this.wireEvents()},a.prototype.initializeLocale=function(){this.l10n=new e.L10n(this.getModuleName(),{abortedError:"Speech recognition was aborted.",audioCaptureError:"No microphone detected. Ensure your microphone is connected.",defaultError:"An unknown error occurred.",networkError:"Network error occurred. Check your internet connection.",noSpeechError:"No speech detected. Please speak into the microphone.",notAllowedError:"Microphone access denied. Allow microphone permissions.",serviceNotAllowedError:"Speech recognition service is not allowed in this context.",unsupportedBrowserError:"The browser does not support the SpeechRecognition API.",startAriaLabel:"Press to start speaking and transcribe your words",stopAriaLabel:"Press to stop speaking and end transcription",startTooltipText:"Start listening",stopTooltipText:"Stop listening"},this.locale)},a.prototype.renderSpeechToText=function(){this.initializeLocale();var t=e.isNullOrUndefined(this.buttonSettings.iconCss)||""===this.buttonSettings.iconCss?"e-icons e-listen-icon":this.buttonSettings.iconCss;this.buttonInst=new n.Button({iconCss:t,isPrimary:this.buttonSettings.isPrimary,cssClass:this.updateButtonCssClass(),disabled:this.disabled,content:this.buttonSettings.content,iconPosition:this.buttonSettings.iconPosition,enableRtl:this.enableRtl}),this.buttonInst.appendTo(this.element),this.updateTooltip(),this.updateCssClass(this.cssClass,""),this.updateAriaLabel(),e.isNullOrUndefined(this.htmlAttributes)||this.addHtmlAttributes(this.htmlAttributes)},a.prototype.updateAriaLabel=function(){var t;t=this.htmlAttributes&&this.htmlAttributes["aria-label"]?this.htmlAttributes["aria-label"]:this.micOn?this.l10n.getConstant("stopAriaLabel"):this.l10n.getConstant("startAriaLabel"),this.element.setAttribute("aria-label",t)},a.prototype.updateCssClass=function(t,i){i&&e.removeClass([this.element],i.trim().split(" ")),t&&e.addClass([this.element],t.trim().split(" "))},a.prototype.updateButtonCssClass=function(){var t;return""===(this.isClicked?this.buttonSettings.stopContent:this.buttonSettings.content)&&(t="e-round"),this.micOn&&(t+=" e-listening-state"),t},a.prototype.updateTooltip=function(){this.showTooltip?(this.tooltipSettings&&("Start listening"===this.tooltipSettings.content&&(this.tooltipSettings.content=this.l10n.getConstant("startTooltipText")),"Stop listening"===this.tooltipSettings.stopContent&&(this.tooltipSettings.stopContent=this.l10n.getConstant("stopTooltipText"))),this.tooltipInst=new i.Tooltip({content:this.hasStarted?this.tooltipSettings.stopContent:this.tooltipSettings.content,position:this.tooltipSettings.position,windowCollision:!0,cssClass:this.cssClass?"e-speech-to-text-tooltip "+this.cssClass:"e-speech-to-text-tooltip",opensOn:"Hover",enableRtl:this.enableRtl}),this.tooltipInst.appendTo(this.element)):e.isNullOrUndefined(this.tooltipInst)||(this.tooltipInst.destroy(),this.tooltipInst=null)},a.prototype.handleStateChange=function(){if(!this.disabled)if(this.listeningState===t.SpeechToTextState.Listening)this.micOn=!0,this.startSpeechRecognition();else if(this.listeningState===t.SpeechToTextState.Inactive||this.listeningState===t.SpeechToTextState.Stopped)if(this.micOn)this.micOn=!1,this.stopSpeechRecognition();else{var e=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.listeningState=t.SpeechToTextState.Inactive,this.isProtectedOnChange=e}},a.prototype.addHtmlAttributes=function(t){if(t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&this.element.setAttribute(e,t[e])},a.prototype.removeHtmlAttributes=function(t){if(t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&this.element.removeAttribute(e)},a.prototype.wireEvents=function(){e.EventHandler.add(this.element,"click",this.handleButtonClick,this)},a.prototype.unWireEvents=function(){e.EventHandler.remove(this.element,"click",this.handleButtonClick)},a.prototype.handleButtonClick=function(t){this.isUserInteracted=!0,this.micOn=!this.micOn,this.micOn?this.startSpeechRecognition(t):this.stopSpeechRecognition(t)},a.prototype.triggerUnSupportedError=function(){var t={error:"unsupported-browser",errorMessage:this.l10n.getConstant("unsupportedBrowserError")};this.trigger("onError",t)},a.prototype.initializeSpeechRecognition=function(){var e=this,i=window,s=i.SpeechRecognition||i.webkitSpeechRecognition;if(!s)return void this.triggerUnSupportedError();this.recognition=new s,this.recognition.continuous=!0,this.recognition.lang=this.lang,this.recognition.interimResults=this.allowInterimResults,this.recognition.onstart=function(i){var s=e.isProtectedOnChange;e.isProtectedOnChange=!0,e.transcript=e.fullTranscript="",e.isProtectedOnChange=s;var n={cancel:!1,listeningState:t.SpeechToTextState.Listening,event:i,isInteracted:e.isUserInteracted};e.trigger("onStart",n,function(){n.cancel?(e.recognition.abort(),e.micOn=!1):e.handleStartRecognition()})},this.recognition.onend=function(t){e.hasStarted&&(e.micOn=!1,e.handleStopRecognition(t))},this.recognition.onerror=function(t){var i="";switch(t.error){case"not-allowed":i=e.l10n.getConstant("notAllowedError");break;case"audio-capture":i=e.l10n.getConstant("audioCaptureError");break;case"network":i=e.l10n.getConstant("networkError");break;case"no-speech":i=e.l10n.getConstant("noSpeechError");break;case"aborted":i=e.l10n.getConstant("abortedError");break;case"service-not-allowed":i=e.l10n.getConstant("serviceNotAllowedError");break;default:i=e.l10n.getConstant("defaultError")}var s={event:t,error:t.error,errorMessage:i};e.trigger("onError",s),e.isUserInteracted=!1},this.recognition.onresult=function(t){var i=t.results[t.resultIndex],s="",n=e.isProtectedOnChange;e.isProtectedOnChange=!0,i.isFinal?(e.fullTranscript+=i[0].transcript,e.transcript=e.fullTranscript):(s+=i[0].transcript,e.transcript=e.fullTranscript+s);var a={event:t,transcript:e.transcript,isInterimResult:!i.isFinal};e.trigger("transcriptChanged",a,function(){if(a.transcript!==e.transcript){var t=e.isProtectedOnChange;e.isProtectedOnChange=!0,e.transcript=e.fullTranscript=a.transcript,e.isProtectedOnChange=t}}),e.isProtectedOnChange=n}},a.prototype.handleStartRecognition=function(){var i=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.hasStarted=!0,this.listeningState=t.SpeechToTextState.Listening,e.isNullOrUndefined(this.tooltipInst)||(this.tooltipInst.content=this.tooltipSettings.stopContent),this.updateAriaLabel(),this.isClicked=!0,this.buttonInst.cssClass=this.updateButtonCssClass(),this.buttonInst.content=this.buttonSettings.stopContent;var s=e.isNullOrUndefined(this.buttonSettings.stopIconCss)||""===this.buttonSettings.stopIconCss?"e-icons e-listen-stop":this.buttonSettings.stopIconCss;this.buttonInst.iconCss=s,this.isProtectedOnChange=i},a.prototype.triggerUnSupportedStart=function(e){var i=this,s=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.transcript="",this.isProtectedOnChange=s;var n={cancel:!1,listeningState:t.SpeechToTextState.Listening,event:e,isInteracted:this.isUserInteracted};this.trigger("onStart",n,function(){n.cancel||i.handleStartRecognition()})},a.prototype.startSpeechRecognition=function(t){this.hasStarted||(this.recognition?this.recognition.start():this.triggerUnSupportedStart(t))},a.prototype.stopSpeechRecognition=function(t){this.recognition?this.recognition.stop():this.handleStopRecognition(t)},a.prototype.handleStopRecognition=function(i){if(this.hasStarted){var s=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.listeningState=t.SpeechToTextState.Stopped,e.isNullOrUndefined(this.tooltipInst)||(this.tooltipInst.content=this.tooltipSettings.content),this.updateAriaLabel(),this.isClicked=!1,this.buttonInst.cssClass=this.updateButtonCssClass(),this.buttonInst.content=this.buttonSettings.content;var n={listeningState:t.SpeechToTextState.Stopped,event:i,isInteracted:this.isUserInteracted};this.trigger("onStop",n),this.listeningState=t.SpeechToTextState.Inactive;var a=e.isNullOrUndefined(this.buttonSettings.iconCss)||""===this.buttonSettings.iconCss?"e-icons e-listen-icon":this.buttonSettings.iconCss;this.buttonInst.iconCss=a,this.hasStarted=!1,this.isProtectedOnChange=s}},a.prototype.buttonSettingsChanges=function(t,i){if(t.content===i.content&&t.stopContent===i.stopContent||(this.buttonInst.content=this.hasStarted?this.buttonSettings.stopContent:this.buttonSettings.content,this.buttonInst.cssClass=this.updateButtonCssClass()),t.iconCss!==i.iconCss||t.stopIconCss!==i.stopIconCss){var s=e.isNullOrUndefined(this.buttonSettings.iconCss)||""===this.buttonSettings.iconCss?"e-icons e-listen-icon":this.buttonSettings.iconCss,n=e.isNullOrUndefined(this.buttonSettings.stopIconCss)||""===this.buttonSettings.stopIconCss?"e-icons e-listen-stop":this.buttonSettings.stopIconCss;this.buttonInst.iconCss=this.hasStarted?n:s}t.iconPosition!==i.iconPosition&&(this.buttonInst.iconPosition=this.buttonSettings.iconPosition),t.isPrimary!==i.isPrimary&&(this.buttonInst.isPrimary=this.buttonSettings.isPrimary)},a.prototype.destroyAndNullify=function(t){t&&(t.destroy(),t=null)},a.prototype.destroy=function(){s.prototype.destroy.call(this),this.unWireEvents(),this.destroyAndNullify(this.buttonInst),this.destroyAndNullify(this.tooltipInst),this.recognition=null,this.micOn=null,this.htmlAttributes=this.tooltipSettings=this.buttonSettings=null,this.element.classList.remove("e-rtl")},a.prototype.startListening=function(){this.disabled||this.isClicked||(this.isUserInteracted=!1,this.micOn=!0,this.startSpeechRecognition())},a.prototype.stopListening=function(){!this.disabled&&this.isClicked&&(this.isUserInteracted=!1,this.micOn=!1,this.stopSpeechRecognition())},a.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"lang":this.recognition&&(this.recognition.lang=this.lang);break;case"allowInterimResults":this.recognition&&(this.recognition.interimResults=this.allowInterimResults);break;case"buttonSettings":this.buttonSettingsChanges(e.buttonSettings,t.buttonSettings);break;case"cssClass":this.updateCssClass(t.cssClass,e.cssClass);break;case"disabled":this.buttonInst.disabled=this.disabled,this.handleStateChange();break;case"htmlAttributes":this.removeHtmlAttributes(e.htmlAttributes),this.addHtmlAttributes(t.htmlAttributes);break;case"listeningState":this.handleStateChange();break;case"tooltipSettings":case"showTooltip":this.updateTooltip();break;case"transcript":this.transcript=this.fullTranscript=t.transcript;break;case"enableRtl":this.buttonInst.enableRtl=this.tooltipInst.enableRtl=this.enableRtl;break;case"locale":this.l10n.setLocale(this.locale),this.updateAriaLabel(),this.updateTooltip()}},De([e.Property("")],a.prototype,"transcript",void 0),De([e.Property("")],a.prototype,"lang",void 0),De([e.Property(!0)],a.prototype,"allowInterimResults",void 0),De([e.Property(!0)],a.prototype,"showTooltip",void 0),De([e.Property("Inactive")],a.prototype,"listeningState",void 0),De([e.Complex({},ze)],a.prototype,"buttonSettings",void 0),De([e.Complex({},We)],a.prototype,"tooltipSettings",void 0),De([e.Property(!1)],a.prototype,"disabled",void 0),De([e.Property("")],a.prototype,"cssClass",void 0),De([e.Property({})],a.prototype,"htmlAttributes",void 0),De([e.Event()],a.prototype,"created",void 0),De([e.Event()],a.prototype,"onStart",void 0),De([e.Event()],a.prototype,"onStop",void 0),De([e.Event()],a.prototype,"onError",void 0),De([e.Event()],a.prototype,"transcriptChanged",void 0),a=De([e.NotifyPropertyChanges],a)}(e.Component);return t.AsyncSettings=qt,t.ButtonSettings=ze,t.ButtonsProps=Wt,t.ColorPicker=he,t.ColorRangeData=yt,t.FilesProp=zt,t.FormValidator=kt,t.LimitData=bt,t.MaskUndo=ut,t.MaskedTextBox=mt,t.NumericTextBox=it,t.OtpInput=Fe,t.Rating=Ue,t.Signature=Ae,t.SignatureBase=Oe,t.Slider=St,t.SmartTextArea=Se,t.SpeechToText=qe,t.TEXTBOX_FOCUS="e-input-focus",t.TextArea=fe,t.TextBox=de,t.TicksData=gt,t.TooltipData=Ct,t.TooltipSettings=We,t.Uploader=jt,t.applyMask=r,t.bindClearEvent=h,t.containerAttributes=Z,t.createMask=a,t.escapeRegExp=C,t.getMaskedVal=X,t.getVal=_,t.maskInput=q,t.maskInputBlurHandler=E,t.maskInputDropHandler=T,t.maskInputFocusHandler=y,t.maskInputMouseDownHandler=f,t.maskInputMouseUpHandler=g,t.mobileRemoveFunction=O,t.regex=Pt,t.regularExpressions=ht,t.setElementValue=W,t.setMaskValue=z,t.strippedValue=m,t.triggerFocus=b,t.unstrippedValue=c,t.unwireEvents=o,t.wireEvents=l,t}({},ej.base,ej.popups,ej.splitbuttons,ej.buttons),this.ejs=ej;
10
+ this.ej=this.ej||{},this.ej.inputs=function(t,e,i,s,n){"use strict";function a(){if(e.attributes(this.element,{role:"textbox",autocomplete:"off",autocapitalize:"off",spellcheck:"false","aria-live":"assertive"}),this.mask){for(var t=this.mask.split("]"),i=0;i<t.length;i++)if("\\"===t[i][t[i].length-1]){t[i]=t[i]+"]";for(var s=t[i].split("["),n=0;n<s.length;n++)"\\"===s[n][s[n].length-1]&&(s[n]=s[n]+"["),v.call(this,s[n])}else if((s=t[i].split("[")).length>1)for(var a=!1,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):v.call(this,s[n]);else v.call(this,s[0]);if(this.escapeMaskValue=this.hiddenMask,this.promptMask=this.hiddenMask.replace(/[09?LCAa#&]/g,this.promptChar),!e.isNullOrUndefined(this.customCharacters))for(i=0;i<this.promptMask.length;i++)e.isNullOrUndefined(this.customCharacters[this.promptMask[i]])||(this.promptMask=this.promptMask.replace(new RegExp(this.promptMask[i],"g"),this.promptChar));var r=0;if(this.hiddenMask.match(new RegExp(/\\/)))for(i=0;i<this.hiddenMask.length;i++){n=0;i>=1&&(n=i),n-=r=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-r,this.promptMask.length),this.escapeMaskValue=this.escapeMaskValue.substring(0,n)+this.escapeMaskValue.substring(i+1-r,this.escapeMaskValue.length)),"\\"===this.hiddenMask[i]&&(this.promptMask=this.promptMask.substring(0,n)+this.hiddenMask[i+1]+this.promptMask.substring(i+2-r,this.promptMask.length),this.escapeMaskValue=this.escapeMaskValue.substring(0,n)+this.escapeMaskValue[i+1]+this.escapeMaskValue.substring(i+2-r,this.escapeMaskValue.length))}else this.promptMask=this.promptMask.replace(/[>|<]/g,""),this.escapeMaskValue=this.hiddenMask.replace(/[>|<]/g,"");e.attributes(this.element,{"aria-invalid":"false"})}}function r(){W.call(this,this.promptMask),z.call(this,this.value)}function l(){e.EventHandler.add(this.element,"keydown",k,this),e.EventHandler.add(this.element,"keypress",A,this),e.EventHandler.add(this.element,"keyup",N,this),e.EventHandler.add(this.element,"input",P,this),e.EventHandler.add(this.element,"focus",y,this),e.EventHandler.add(this.element,"blur",E,this),e.EventHandler.add(this.element,"paste",S,this),e.EventHandler.add(this.element,"cut",x,this),e.EventHandler.add(this.element,"drop",T,this),e.EventHandler.add(this.element,"mousedown",f,this),e.EventHandler.add(this.element,"mouseup",g,this),this.enabled&&(h.call(this),this.formElement&&e.EventHandler.add(this.formElement,"reset",d,this))}function o(){e.EventHandler.remove(this.element,"keydown",k),e.EventHandler.remove(this.element,"keypress",A),e.EventHandler.remove(this.element,"keyup",N),e.EventHandler.remove(this.element,"input",P),e.EventHandler.remove(this.element,"focus",y),e.EventHandler.remove(this.element,"blur",E),e.EventHandler.remove(this.element,"paste",S),e.EventHandler.remove(this.element,"cut",x),e.EventHandler.remove(this.element,"drop",T),e.EventHandler.remove(this.element,"mousedown",f),e.EventHandler.remove(this.element,"mouseup",g),this.formElement&&e.EventHandler.remove(this.formElement,"reset",d)}function h(){this.showClearButton&&e.EventHandler.add(this.inputObj.clearButton,"mousedown touchstart",u,this)}function u(t){t.preventDefault(),this.inputObj.clearButton.classList.contains("e-clear-icon-hide")&&!this.inputObj.container.classList.contains("e-static-clear")||(p.call(this,t),this.value="")}function p(t){var e=this.element.value;W.call(this,this.promptMask),this.redoCollec.unshift({value:this.promptMask,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),H.call(this,t,e),this.element.setSelectionRange(0,0)}function d(){"EJS-MASKEDTEXTBOX"===this.element.tagName?W.call(this,this.promptMask):this.value=this.initInputValue}function c(t){return t.value}function m(t,i){var s="",n=0,a=!1,r=e.isNullOrUndefined(i)?e.isNullOrUndefined(t)||e.isNullOrUndefined(this)?i:t.value:i;if(r!==this.promptMask)for(var l=0;l<this.customRegExpCollec.length;l++)a&&(a=!1),">"!==this.customRegExpCollec[n]&&"<"!==this.customRegExpCollec[n]&&"|"!==this.customRegExpCollec[n]&&"\\"!==this.customRegExpCollec[n]||(--l,a=!0),a||r[l]!==this.promptChar&&!e.isNullOrUndefined(this.customRegExpCollec[n])&&(this._callPasteHandler||!e.isNullOrUndefined(this.regExpCollec[this.customRegExpCollec[n]])&&!this.maskedRegExp.includes(this.customRegExpCollec[n])||this.customRegExpCollec[n].length>2&&"["===this.customRegExpCollec[n][0]&&"]"===this.customRegExpCollec[n][this.customRegExpCollec[n].length-1]||!e.isNullOrUndefined(this.customCharacters)&&!e.isNullOrUndefined(this.customCharacters[this.customRegExpCollec[n]]))&&""!==r&&(s+=r[l]),++n;return(null===this.mask||""===this.mask&&void 0!==this.value)&&(s=r),s}function v(t){for(var i=0;i<t.length;i++)this.hiddenMask+=t[i],"\\"!==t[i]?this.customRegExpCollec.push(t[i]):"\\"!==t[i]||e.isNullOrUndefined(this.regExpCollec[t[i+1]])||this.maskedRegExp.push(t[i+1])}function f(){this.isClicked=!0}function g(){this.isClicked=!1}function y(t){var i=this,s=this.element,n=0,a=m.call(this,s),r=!1,l=!1,o={selectionStart:s.selectionStart,event:t,value:this.value,maskedValue:s.value,container:e.isNullOrUndefined(this.inputObj)?this.inputObj:this.inputObj.container,selectionEnd:s.selectionEnd};if(this.isClicked||b.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)r=!0;else for(var t=s.selectionStart;t<i.promptMask.length;t++){if(s.value[t]===i.promptChar){r=!0;break}if(s.value[t]!==i.promptMask[t]){r=!1;break}}}),setTimeout(function(){var t=s.selectionStart-1;if(t===i.promptMask.length-1||s.value[t]===i.promptChar)l=!0;else for(var e=t;e>=0;e--){if(s.value[e]===i.promptChar){l=!0;break}if(s.value[e]!==i.promptMask[e]){l=!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(){(r||l)&&(s.selectionEnd=n,s.selectionStart=n),o={selectionStart:s.selectionStart,event:t,value:i.value,maskedValue:s.value,container:e.isNullOrUndefined(i.inputObj)?i.inputObj:i.inputObj.container,selectionEnd:s.selectionEnd},b.call(i,o,s)},110);break}e.isNullOrUndefined(s.value.match(C(this.promptChar)))&&(o={selectionStart:s.selectionStart,event:t,value:this.value,maskedValue:s.value,container:e.isNullOrUndefined(this.inputObj)?this.inputObj:this.inputObj.container,selectionEnd:s.selectionEnd},b.call(this,o,s)),this.isClicked=!1}}function b(t,e){this.trigger("focus",t,function(t){e.selectionStart=t.selectionStart,e.selectionEnd=t.selectionEnd})}function C(t){return e.isNullOrUndefined(t)?t:t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function E(t){if(this.blurEventArgs={event:t,value:this.value,maskedValue:this.element.value,container:e.isNullOrUndefined(this.inputObj)?this.inputObj:this.inputObj.container},this.trigger("blur",this.blurEventArgs),this.mask&&(this.isFocus=!1,this.placeholder&&this.element.value===this.promptMask&&"Always"!==this.floatLabelType)){W.call(this,"");var i=this.element.parentNode.querySelector(".e-float-text");"Auto"===this.floatLabelType&&!e.isNullOrUndefined(i)&&i.classList.contains(lt)&&e.removeClass([i],lt)}}function S(t){var e=this;if(this.mask&&!this.readonly){var i=this.element.selectionStart,s=this.element.selectionEnd,n=this.element.value;W.call(this,""),this._callPasteHandler=!0,setTimeout(function(){var a=e.element.value.replace(/ /g,"");e.redoCollec.length>0&&e.redoCollec[0].value===e.element.value&&(a=m.call(e,e.element)),W.call(e,n),e.element.selectionStart=i,e.element.selectionEnd=s;var r=0;e.maskKeyPress=!0;do{U.call(e,a[r],!1,null),++r}while(r<a.length);if(e.maskKeyPress=!1,e._callPasteHandler=!1,e.element.value===n){var l=0;e.maskKeyPress=!0;do{U.call(e,a[l],!1,null),++l}while(l<a.length);e.maskKeyPress=!1}else H.call(e,t,n)},1)}}function x(t){var e=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(){W.call(e,a),e.element.selectionStart=e.element.selectionEnd=s,e.element.value!==i&&H.call(e,t,null)},0)}}function T(t){t.preventDefault()}function P(t){if(!0!==e.Browser.isIE||""!==this.element.value||"Never"!==this.floatLabelType){var i={ctrlKey:!1,keyCode:229};if(e.extend(t,i),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||L.call(this,t),this.element.value.length>this.promptMask.length){var s=this.element.selectionStart,n=this.element.value.length-this.promptMask.length,a=this.element.value.substring(s-n,s);this.maskKeyPress=!1;var r=0;do{U.call(this,a[r],t.ctrlKey,t),++r}while(r<a.length);this.element.value!==this.preEleVal&&H.call(this,t,null)}var l=m.call(this,this.element);this.prevValue=l,this.value=l,""===l&&(W.call(this,this.promptMask),this.element.setSelectionRange(0,0))}}}function k(t){if(this.mask&&!this.readonly){229!==t.keyCode&&(!t.ctrlKey||89!==t.keyCode&&90!==t.keyCode||t.preventDefault(),L.call(this,t));var e=this.element.value;if(t.ctrlKey&&(89===t.keyCode||90===t.keyCode)){var i=void 0;90===t.keyCode&&this.undoCollec.length>0&&e!==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}),W.call(this,i.value),this.element.selectionStart=i.startIndex,this.element.selectionEnd=i.endIndex,this.undoCollec.splice(this.undoCollec.length-1,1)):89===t.keyCode&&this.redoCollec.length>0&&e!==this.redoCollec[0].value&&(i=this.redoCollec[0],this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),W.call(this,i.value),this.element.selectionStart=i.startIndex,this.element.selectionEnd=i.endIndex,this.redoCollec.splice(0,1))}}}function O(){var t,e=this.element.selectionStart,i=this.element.selectionEnd;this.redoCollec.length>0?(t=this.redoCollec[0],W.call(this,t.value),t.startIndex-e==1?(this.element.selectionStart=t.startIndex,this.element.selectionEnd=t.endIndex):(this.element.selectionStart=e+1,this.element.selectionEnd=i+1)):(W.call(this,this.promptMask),this.element.selectionStart=this.element.selectionEnd=e)}function w(t,e,i){return"input"===i.type&&(t=!1,e=this.element.value,W.call(this,this.promptMask),z.call(this,e)),t}function L(t){var i,s=!1,n=!1;this.element.value.length<this.promptMask.length&&(s=!0,i=this.element.value,s=w.call(this,s,i,t),O.call(this)),this.element.value.length>=this.promptMask.length&&"input"===t.type&&(s=w.call(this,s,i,t));var a=this.element.selectionStart,r=this.element.selectionEnd,l=this.element.selectionStart,o=this.element.selectionEnd,h=this.hiddenMask.replace(/[>|\\<]/g,""),u=h[l-1],p=this.element.selectionEnd;if(s||8===t.keyCode||46===t.keyCode){this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:o});var d=!1,c=this.element.value;if(l>0||(8===t.keyCode||46===t.keyCode)&&l<this.element.value.length&&this.element.selectionEnd-l!==this.element.value.length){var m=l;l!==o?(l=o,46===t.keyCode&&(d=!0)):46===t.keyCode?++m:--m;for(var v=l;8===t.keyCode||s||d?v>m:v<m;8===t.keyCode||s||d?v--:v++)for(var f=l;8===t.keyCode||s||d?f>0:f<this.element.value.length;8===t.keyCode||s||d?f--:f++){var g=void 0;(8===t.keyCode||d)&&(a!==r&&a!==l||a===r)||s?(u=h[f-1],g=l-1):(u=h[f],g=l,++l);var y=this.element.value[g];if(e.isNullOrUndefined(this.regExpCollec[""+u])&&!e.isNullOrUndefined(this.customCharacters)&&e.isNullOrUndefined(this.customCharacters[""+u])&&this.hiddenMask[g]!==this.promptChar&&"["!==this.customRegExpCollec[g][0]&&"]"!==this.customRegExpCollec[g][this.customRegExpCollec[g].length-1]||this.promptMask[g]!==this.promptChar&&e.isNullOrUndefined(this.customCharacters))this.element.selectionStart=this.element.selectionEnd=g,t.preventDefault(),46!==t.keyCode||d||++this.element.selectionStart;else{var b=this.element.value,C=this.promptChar,E=b.substring(0,g)+C+b.substring(l,b.length);W.call(this,E),t.preventDefault(),46!==t.keyCode||d||g++,this.element.selectionStart=this.element.selectionEnd=g,n=!0}if(l=this.element.selectionStart,!n&&8===t.keyCode||d||!n&&46!==t.keyCode?g=l-1:(g=l,n=!1),y=this.element.value[g],a!==r&&this.element.selectionStart===a||this.promptMask[g]===this.promptChar||y!==this.promptMask[g]&&this.promptMask[g]!==this.promptChar&&!e.isNullOrUndefined(this.customCharacters))break}}46===t.keyCode&&d&&n&&(this.element.selectionStart=this.element.selectionEnd=p),0===this.element.selectionStart&&this.element.selectionEnd===this.element.value.length&&(W.call(this,this.promptMask),t.preventDefault(),this.element.selectionStart=this.element.selectionEnd=l),this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),this.element.value!==c&&H.call(this,t,i)}}function A(t){if(this.mask&&!this.readonly){var e=this.element.value;if(!t.ctrlKey&&!t.metaKey||(t.ctrlKey||t.metaKey)&&"KeyA"!==t.code&&"KeyY"!==t.code&&"KeyZ"!==t.code&&"KeyX"!==t.code&&"KeyC"!==t.code&&"KeyV"!==t.code){this.maskKeyPress=!0;var i=t.key;"Spacebar"===i&&(i=String.fromCharCode(t.keyCode)),i?i&&1===i.length&&(U.call(this,i,t.ctrlKey,t),t.preventDefault()):(this.isIosInvalid=!0,U.call(this,String.fromCharCode(t.keyCode),t.ctrlKey,t),t.preventDefault(),this.isIosInvalid=!1),32===t.keyCode&&" "===i&&" "===this.promptChar&&(this.element.selectionStart=this.element.selectionEnd=this.element.selectionStart-i.length)}this.element.value!==e&&H.call(this,t,e)}}function H(t,i){var s=this.isProtectedOnChange;if(!e.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=m.call(this,this.element)),e.isNullOrUndefined(t)||(this.changeEventArgs.isInteracted=!0,this.changeEventArgs.isInteraction=!0,this.changeEventArgs.event=t),this.isProtectedOnChange=!0,this.value=this.changeEventArgs.value,this.isProtectedOnChange=s,e.merge(n,this.changeEventArgs),this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",n)}this.preEleVal=this.element.value,this.prevValue=m.call(this,this.element)}function N(t){if(this.mask&&!this.readonly){var i=void 0;if(this.maskKeyPress||229!==t.keyCode)M.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,r=this.element.value.substring(n-a,n);if(this.undoCollec.length>0){i=this.undoCollec[this.undoCollec.length-1];var l=this.element.selectionStart;s=i.value;var o=i.value.substring(l-a,l);i=this.redoCollec[0],r=r.trim();var h=e.Browser.isAndroid&&""===r;h||o===r||i.value.substring(l-a,l)===r?h&&V.call(this,t,l-1,this.element.selectionEnd-1,r,t.ctrlKey,!1):U.call(this,r,t.ctrlKey,t)}else s=this.promptMask,U.call(this,r,t.ctrlKey,t);this.maskKeyPress=!1,H.call(this,t,s)}}var u=m.call(this,this.element);(0!==this.element.selectionStart||this.promptMask!==this.element.value||""!==u||""===u&&this.value!==u)&&(this.prevValue=u,this.value=u)}else H.call(this,t);if(0===this.element.selectionStart&&0===this.element.selectionEnd){var p=this.element;setTimeout(function(){p.setSelectionRange(0,0)},0)}}function B(t){if(t.length>1&&this.promptMask.length+t.length<this.element.value.length){var e=this.redoCollec[0].value.substring(0,this.redoCollec[0].startIndex)+t+this.redoCollec[0].value.substring(this.redoCollec[0].startIndex,this.redoCollec[0].value.length);W.call(this,e),this.element.selectionStart=this.element.selectionEnd=this.redoCollec[0].startIndex+t.length}this.element.selectionStart=this.element.selectionStart-t.length,this.element.selectionEnd=this.element.selectionEnd-t.length}function I(t){this.maskKeyPress||B.call(this,t)}function U(t,i,s){if(I.call(this,t),!e.isNullOrUndefined(this)&&!e.isNullOrUndefined(t))for(var n,a,r=this.element.selectionStart,l=r,o=!1,h=this.element.value,u=!1,p=!1,d=0;d<t.length;d++){var c=t[d];if(r=this.element.selectionStart,this.maskKeyPress||l!==r||(r+=d),!this.maskKeyPress||r<this.promptMask.length){for(v=r;v<this.promptMask.length;v++)n=this.escapeMaskValue[r],"\\"===this.hiddenMask[r]&&this.hiddenMask[r+1]===t&&(p=!0),(e.isNullOrUndefined(this.regExpCollec[""+n])&&(e.isNullOrUndefined(this.customCharacters)||!e.isNullOrUndefined(this.customCharacters)&&e.isNullOrUndefined(this.customCharacters[""+n]))&&this.hiddenMask[r]!==this.promptChar&&"["!==this.customRegExpCollec[r][0]&&"]"!==this.customRegExpCollec[r][this.customRegExpCollec[r].length-1]||this.promptMask[r]!==this.promptChar&&e.isNullOrUndefined(this.customCharacters)||this.promptChar===n&&this.escapeMaskValue===this.mask)&&(this.element.selectionStart=this.element.selectionEnd=r+1,r=this.element.selectionStart,n=this.hiddenMask[r]);if(e.isNullOrUndefined(this.customCharacters)||e.isNullOrUndefined(this.customCharacters[""+n]))!e.isNullOrUndefined(this.regExpCollec[""+n])&&c.match(new RegExp(this.regExpCollec[""+n]))&&this.promptMask[r]===this.promptChar?o=!0:this.promptMask[r]===this.promptChar&&"["===this.customRegExpCollec[r][0]&&"]"===this.customRegExpCollec[r][this.customRegExpCollec[r].length-1]&&c.match(new RegExp(this.customRegExpCollec[r]))&&(o=!0);else for(var m=this.customCharacters[""+n].split(","),v=0;v<m.length;v++)if(c.match(new RegExp("["+m[v]+"]"))){o=!0;break}if((!this.maskKeyPress||r<this.hiddenMask.length)&&o){if(0===d)if(this.maskKeyPress)this.undoCollec.push({value:h,startIndex:r,endIndex:r});else{var f=this.element.selectionStart,g=this.element.selectionEnd;this.redoCollec.length>0?(a=this.redoCollec[0].value,W.call(this,a),this.undoCollec.push(this.redoCollec[0])):(this.undoCollec.push({value:this.promptMask,startIndex:r,endIndex:r}),a=this.promptMask,W.call(this,a)),this.element.selectionStart=f,this.element.selectionEnd=g}r=this.element.selectionStart,R.call(this,s,r,c,a,p),u=!0,d===t.length-1&&this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),o=!1}else r=this.element.selectionStart,V.call(this,s,r,l,t,i,u);d!==t.length-1||o||(!e.Browser.isAndroid||e.Browser.isAndroid&&r<this.promptMask.length)&&this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd})}else 1!==t.length||i||e.isNullOrUndefined(s)||F.call(this)}}function R(t,e,i,s,n){if(this.hiddenMask.length>this.promptMask.length&&(i=D.call(this,i,this.element.value)),!n){var a=this.element.value,r=a.substring(0,e)+i+a.substring(e+1,a.length);W.call(this,r),this.element.selectionStart=this.element.selectionEnd=e+1}}function V(t,i,s,n,a,r){if(!this.maskKeyPress){var l=this.element.value;i>=this.promptMask.length?W.call(this,l.substring(0,i)):(s===i?W.call(this,l.substring(0,i)+l.substring(i+1,l.length)):this.promptMask.length===this.element.value.length?W.call(this,l.substring(0,i)+l.substring(i,l.length)):W.call(this,l.substring(0,s)+l.substring(s+1,l.length)),this.element.selectionStart=this.element.selectionEnd=r||this.element.value[s]!==this.promptChar?i:s),F.call(this)}1!==n.length||a||e.isNullOrUndefined(t)||F.call(this)}function F(){var t=this,i=this.element.parentNode,s=200;i.classList.contains(nt)||i.classList.contains(at)?e.addClass([i],st):e.addClass([this.element],st),!0===this.isIosInvalid&&(s=400),e.attributes(this.element,{"aria-invalid":"true"}),setTimeout(function(){t.maskKeyPress||M.call(t)},s)}function M(){var t=this.element.parentNode;e.isNullOrUndefined(t)||e.removeClass([t],st),e.removeClass([this.element],st),e.attributes(this.element,{"aria-invalid":"false"})}function D(t,e){var i,s,n=e,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]){t=t.toUpperCase();break}if("<"===i[s]){t=t.toLowerCase();break}if("|"===i[s])break}--s}return t}function z(t){if(this.mask&&void 0!==t&&(void 0===this.prevValue||this.prevValue!==t)){if(this.maskKeyPress=!0,W.call(this,this.promptMask),""===t||null===t&&"Never"===this.floatLabelType&&this.placeholder||(this.element.selectionStart=0,this.element.selectionEnd=0),null!==t)for(var i=0;i<t.length;i++)U.call(this,t[i],!1,null);var s=m.call(this,this.element);this.prevValue=s,this.value=s,H.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&&!e.isNullOrUndefined(n)&&n.classList.contains(lt)&&!this.isFocus&&(e.removeClass([n],lt),e.addClass([n],ot),W.call(this,""))}(null===this.mask||""===this.mask&&void 0!==this.value)&&W.call(this,this.value)}function W(i,s){!this.isFocus&&"Auto"===this.floatLabelType&&this.placeholder&&e.isNullOrUndefined(this.value)&&(i="");var n=m.call(this,s||this.element,i);null===n||""===n?(t.Input.setValue(i,s||this.element,this.floatLabelType,!1),this.showClearButton&&this.inputObj.clearButton.classList.add("e-clear-icon-hide")):t.Input.setValue(i,s||this.element,this.floatLabelType,this.showClearButton)}function q(t){var e=j(t);r.call(e);var i=m.call(this,this.element);this.prevValue=i,this.value=i,t.mask&&(o.call(e),l.call(e))}function j(t){e.addClass([t.element],rt);var i={element:t.element,mask:t.mask,promptMask:"",hiddenMask:"",escapeMaskValue:"",promptChar:t.promptChar?t.promptChar.length>1?t.promptChar=t.promptChar[0]:t.promptChar:"_",value:t.value?t.value:null,regExpCollec:ht,customRegExpCollec:[],customCharacters:t.customCharacters,undoCollec:[],redoCollec:[],maskKeyPress:!1,prevValue:""};return a.call(i),i}function _(t){return m.call(K(t),t.element)}function X(t){return c.call(K(t),t.element)}function K(t){var i;return!e.isNullOrUndefined(t)&&t.element.classList.contains(rt)&&(i=j(t)),i}var Y={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",FLOATTEXTCONTENT:"e-float-text-content",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"},Z=["title","style","class"];!function(t){function i(t,i){t.element.__eventHandlers={};var s=e.isNullOrUndefined(i)?e.createElement:i,n={container:null,buttons:[],clearButton:null};if(pt=t.floatLabelType,dt=t.bindClearAction,e.isNullOrUndefined(t.floatLabelType)||"Never"===t.floatLabelType?(n.container=H(t,Y.INPUTGROUP,Y.INPUTCUSTOMTAG,"span",s),t.element.parentNode.insertBefore(n.container,t.element),e.addClass([t.element],Y.INPUT),n.container.appendChild(t.element)):v(t,n,s),r(t),e.isNullOrUndefined(t.properties)||e.isNullOrUndefined(t.properties.showClearButton)||!t.properties.showClearButton||(z(t.properties.showClearButton,t.element,n,!0,s),n.clearButton.setAttribute("role","button"),n.container.classList.contains(Y.FLOATINPUT)&&e.addClass([n.container],Y.INPUTGROUP)),!e.isNullOrUndefined(t.buttons))for(var a=0;a<t.buttons.length;a++)n.buttons.push(nt(t.buttons[a],n.container,s));return e.isNullOrUndefined(t.element)||"TEXTAREA"!==t.element.tagName||e.addClass([n.container],Y.TEXTAREA),at(n.container,t.element),n=y(t,n),X(n.container,s),n}function s(e){var i=E(e.element);(i.classList.contains("e-input-group")||i.classList.contains("e-outline")||i.classList.contains("e-filled"))&&i.classList.add("e-input-focus"),"Never"!==e.floatLabelType&&setTimeout(function(){t.calculateWidth(e.element,i)},80)}function n(e){var i=E(e.element);(i.classList.contains("e-input-group")||i.classList.contains("e-outline")||i.classList.contains("e-filled"))&&i.classList.remove("e-input-focus"),"Never"!==e.floatLabelType&&setTimeout(function(){t.calculateWidth(e.element,i)},80)}function a(t){o(t.floatLabelType,t.element)}function r(t){o(t.floatLabelType,t.element);var e=function(){return s(t)},i=function(){return n(t)},r=function(){return a(t)};t.element.addEventListener("focus",e),t.element.addEventListener("blur",i),t.element.addEventListener("input",r),t.element.__eventHandlers.inputFocusHandler={focusHandler:e},t.element.__eventHandlers.inputBlurHandler={blurHandler:i},t.element.__eventHandlers.inputHandler={inputHandler:r}}function l(t){if(!e.isNullOrUndefined(t.element)&&!(e.isNullOrUndefined(t.element.__eventHandlers)||e.isNullOrUndefined(t.element.__eventHandlers.inputFocusHandler)||e.isNullOrUndefined(t.element.__eventHandlers.inputBlurHandler)||e.isNullOrUndefined(t.element.__eventHandlers.inputHandler))){var i=t.element.__eventHandlers.inputFocusHandler.focusHandler,s=t.element.__eventHandlers.inputBlurHandler.blurHandler,n=t.element.__eventHandlers.inputHandler.inputHandler;t.element.removeEventListener("focus",i),t.element.removeEventListener("blur",s),t.element.removeEventListener("input",n),delete t.element.__eventHandlers.inputFocusHandler,delete t.element.__eventHandlers.inputBlurHandler,delete t.element.__eventHandlers.inputHandler}}function o(t,i){var s=i.value,n=i.parentElement,a=n&&n.parentElement;""===s||e.isNullOrUndefined(s)?"Always"!==t&&(n&&n.classList.contains("e-input-group")?n.classList.remove("e-valid-input"):a&&a.classList.contains("e-input-group")&&a.classList.remove("e-valid-input")):n&&n.classList.contains("e-input-group")?n.classList.add("e-valid-input"):a&&a.classList.contains("e-input-group")&&a.classList.add("e-valid-input")}function h(){var t=E(this).getElementsByClassName("e-float-text")[0];e.isNullOrUndefined(t)||(e.addClass([t],Y.LABELTOP),t.classList.contains(Y.LABELBOTTOM)&&e.removeClass([t],Y.LABELBOTTOM))}function u(){var t=E(this);if(t.getElementsByTagName("textarea")[0]?""===t.getElementsByTagName("textarea")[0].value:""===t.getElementsByTagName("input")[0].value){var i=t.getElementsByClassName("e-float-text")[0];e.isNullOrUndefined(i)||(i.classList.contains(Y.LABELTOP)&&e.removeClass([i],Y.LABELTOP),e.addClass([i],Y.LABELBOTTOM))}}function p(t){t.addEventListener("focus",h),t.addEventListener("blur",u)}function d(t){e.isNullOrUndefined(t)||(t.removeEventListener("focus",h),t.removeEventListener("blur",u))}function c(t){A(t.element,t.floatLabelType)}function m(t){A(t.element,t.floatLabelType)}function v(t,i,s){var n=e.isNullOrUndefined(s)?e.createElement:s;"Auto"===t.floatLabelType&&p(t.element),e.isNullOrUndefined(i.container)?(i.container=H(t,Y.FLOATINPUT,Y.FLOATCUSTOMTAG,"div",n),i.container.classList.add(Y.INPUTGROUP),t.element.parentNode&&t.element.parentNode.insertBefore(i.container,t.element)):(e.isNullOrUndefined(t.customTag)||i.container.classList.add(Y.FLOATCUSTOMTAG),i.container.classList.add(Y.FLOATINPUT));var a=n("span",{className:Y.FLOATLINE}),r=n("label",{className:Y.FLOATTEXT});if(e.isNullOrUndefined(t.element.id)||""===t.element.id||(r.id="label_"+t.element.id.replace(/ /g,"_"),e.attributes(t.element,{"aria-labelledby":r.id})),e.isNullOrUndefined(t.element.placeholder)||""===t.element.placeholder||(r.innerText=N(t.element.placeholder),t.element.removeAttribute("placeholder")),e.isNullOrUndefined(t.properties)||e.isNullOrUndefined(t.properties.placeholder)||""===t.properties.placeholder||(r.innerText=N(t.properties.placeholder)),r.innerText||i.container.classList.add(Y.NOFLOATLABEL),i.container.classList.contains("e-float-icon-left")){var l=i.container.querySelector(".e-input-in-wrap");l.appendChild(t.element),l.appendChild(a),l.appendChild(r)}else i.container.appendChild(t.element),i.container.appendChild(a),i.container.appendChild(r);if(C(t.element.value,r),"Always"===t.floatLabelType&&(r.classList.contains(Y.LABELBOTTOM)&&e.removeClass([r],Y.LABELBOTTOM),e.addClass([r],Y.LABELTOP)),"Auto"===t.floatLabelType){var o=function(){return c(t)},h=function(){return m(t)};t.element.addEventListener("input",o),t.element.addEventListener("blur",h),t.element.__eventHandlers.floatInputHandler={inputFloatHandler:o},t.element.__eventHandlers.floatBlurHandler={blurFloatHandler:h}}else f(t);e.isNullOrUndefined(t.element.getAttribute("id"))||r.setAttribute("for",t.element.getAttribute("id"))}function f(t){if(!(e.isNullOrUndefined(t.element)||e.isNullOrUndefined(t.element.__eventHandlers)||e.isNullOrUndefined(t.element.__eventHandlers.floatInputHandler)||e.isNullOrUndefined(t.element.__eventHandlers.floatBlurHandler))){var i=t.element.__eventHandlers.floatInputHandler.inputFloatHandler,s=t.element.__eventHandlers.floatBlurHandler.blurFloatHandler;t.element.removeEventListener("input",i),t.element.removeEventListener("blur",s),delete t.element.__eventHandlers.floatInputHandler,delete t.element.__eventHandlers.floatBlurHandler}}function g(t,e){"Always"===t&&e.classList.contains("e-outline")&&e.classList.add("e-valid-input")}function y(t,i){if(!e.isNullOrUndefined(t.properties))for(var s=0,n=Object.keys(t.properties);s<n.length;s++)switch(n[s]){case"cssClass":I(t.properties.cssClass,[i.container]),g(t.floatLabelType,i.container);break;case"enabled":D(t.properties.enabled,t.element,t.floatLabelType,i.container);break;case"enableRtl":M(t.properties.enableRtl,[i.container]);break;case"placeholder":V(t.properties.placeholder,t.element);break;case"readonly":F(t.properties.readonly,t.element)}return i}function b(t,i,s){e.isNullOrUndefined(i)||(t&&!s?e.removeClass([i],Y.CLEARICONHIDE):e.addClass([i],Y.CLEARICONHIDE))}function C(t,i,s){void 0===s&&(s=null),t?(e.addClass([i],Y.LABELTOP),i.classList.contains(Y.LABELBOTTOM)&&e.removeClass([i],Y.LABELBOTTOM)):(null==s||s!==document.activeElement)&&(i.classList.contains(Y.LABELTOP)&&e.removeClass([i],Y.LABELTOP),e.addClass([i],Y.LABELBOTTOM))}function E(t){var i=e.isNullOrUndefined(t.parentNode)?t:t.parentNode;return i&&i.classList.contains("e-input-in-wrap")&&(i=i.parentNode),i}function S(t,i,s,n){var a=(e.isNullOrUndefined(n)?e.createElement:n)("span",{className:Y.CLEARICON}),r=i.container;return e.isNullOrUndefined(s)?(i.container.classList.contains(Y.FLOATINPUT)?i.container.querySelector("."+Y.FLOATTEXT):t).insertAdjacentElement("afterend",a):r.appendChild(a),e.addClass([a],Y.CLEARICONHIDE),O(t,a),a.setAttribute("aria-label","close"),a}function x(t,i,s){i.classList.contains(Y.DISABLE)||i.readOnly||(t.preventDefault(),i!==document.activeElement&&i.focus(),i.value="",e.addClass([s],Y.CLEARICONHIDE))}function T(t,e){b(t.value,e)}function P(t,e){b(t.value,e,t.readOnly)}function k(t,i){setTimeout(function(){e.isNullOrUndefined(i)||(e.addClass([i],Y.CLEARICONHIDE),i=!e.isNullOrUndefined(t)&&t.classList.contains("e-combobox")?null:i)},200)}function O(t,e,i){if(void 0===dt||dt){var s=function(i){return x(i,t,e)};e.addEventListener("click",s),t.__eventHandlers.clearClickHandler={clickHandlerEvent:s}}var n=function(){return T(t,e)},a=function(){return P(t,e)},r=function(){return k(t,e)};t.addEventListener("input",n),t.addEventListener("focus",a),t.addEventListener("blur",r),t.__eventHandlers.clearInputHandler={inputHandlerEvent:n},t.__eventHandlers.clearFocusHandler={focusHandlerEvent:a},t.__eventHandlers.clearBlurHandler={blurHandlerEvent:r}}function w(t,i){if(!e.isNullOrUndefined(t)&&!e.isNullOrUndefined(t.__eventHandlers)){if(!e.isNullOrUndefined(t.__eventHandlers.clearClickHandler)){var s=t.__eventHandlers.clearClickHandler.clickHandlerEvent;(void 0===dt||dt)&&(e.isNullOrUndefined(i)||i.removeEventListener("click",s)),delete t.__eventHandlers.clearClickHandler}if(!e.isNullOrUndefined(t.__eventHandlers.clearInputHandler)&&!e.isNullOrUndefined(t.__eventHandlers.clearFocusHandler)&&!e.isNullOrUndefined(t.__eventHandlers.clearBlurHandler)){var n=t.__eventHandlers.clearInputHandler.inputHandlerEvent,a=t.__eventHandlers.clearFocusHandler.focusHandlerEvent,r=t.__eventHandlers.clearBlurHandler.blurHandlerEvent;t.removeEventListener("input",n),t.removeEventListener("focus",a),t.removeEventListener("blur",r),delete t.__eventHandlers.clearInputHandler,delete t.__eventHandlers.clearFocusHandler,delete t.__eventHandlers.clearBlurHandler}}}function L(t,i){void 0===i&&(i=null),l(t),"Auto"===t.floatLabelType&&f(t),t.properties.showClearButton&&w(t.element,i),e.isNullOrUndefined(t.buttons)||G(!1,null,t.buttons),d(t.element),e.isNullOrUndefined(t.element)||(delete t.element.__eventHandlers,t.element.classList.contains(Y.INPUT)&&t.element.classList.remove(Y.INPUT))}function A(t,e){if(E(t).classList.contains(Y.FLOATINPUT)&&"Auto"===e){var i=E(t).getElementsByClassName("e-float-text")[0];C(t.value,i,t)}}function H(t,i,s,n,a){var r,l=e.isNullOrUndefined(a)?e.createElement:a;return e.isNullOrUndefined(t.customTag)?r=l(n,{className:i}):(r=l(t.customTag,{className:i})).classList.add(s),r.classList.add("e-control-wrapper"),r}function N(t){var i="";if(!e.isNullOrUndefined(t)&&""!==t){var s=document.createElement("span");s.innerHTML='<input placeholder="'+t+'"/>',i=s.children[0].placeholder}return i}function B(t,i,s,n){if(i.value=t,"Never"!==s&&U(i,i.parentElement),e.isNullOrUndefined(s)||"Auto"!==s||A(i,s),!e.isNullOrUndefined(n)&&n){var a=E(i);if(!e.isNullOrUndefined(a)){var r=a.getElementsByClassName(Y.CLEARICON)[0];e.isNullOrUndefined(r)||(i.value&&!e.isNullOrUndefined(a)&&a.classList.contains("e-input-focus")?e.removeClass([r],Y.CLEARICONHIDE):e.addClass([r],Y.CLEARICONHIDE))}}o(s,i)}function I(t,i,s){e.isNullOrUndefined(s)||""===s||e.removeClass(i,s.split(" ")),e.isNullOrUndefined(t)||""===t||e.addClass(i,t.split(" "))}function U(t,i,s){if("multiselect"===s||$(t)){var n="multiselect"===s?t:t.clientWidth-parseInt(getComputedStyle(t,null).getPropertyValue("padding-left"),10);e.isNullOrUndefined(i)||e.isNullOrUndefined(i.getElementsByClassName("e-float-text-content")[0])||(i.getElementsByClassName("e-float-text-content")[0].classList.contains("e-float-text-overflow")&&i.getElementsByClassName("e-float-text-content")[0].classList.remove("e-float-text-overflow"),(n<i.getElementsByClassName("e-float-text-content")[0].clientWidth||n===i.getElementsByClassName("e-float-text-content")[0].clientWidth)&&i.getElementsByClassName("e-float-text-content")[0].classList.add("e-float-text-overflow"))}}function R(t,i){"number"==typeof t?i.style.width=e.formatUnit(t):"string"==typeof t&&(i.style.width=t.match(/px|%|em/)?t:e.formatUnit(t)),U(i.firstChild,i)}function V(t,i){t=N(t);var s=E(i);if(s.classList.contains(Y.FLOATINPUT))if(e.isNullOrUndefined(t)||""===t){s.classList.add(Y.NOFLOATLABEL);var n=s.getElementsByClassName("e-float-text-content")[0];if(n)n.children[0].textContent="";else{a=s.getElementsByClassName(Y.FLOATTEXT)[0];e.isNullOrUndefined(a)||(a.textContent="")}}else{if((n=s.getElementsByClassName("e-float-text-content")[0])&&n.children[0])n.children[0].textContent=t;else{var a=s.getElementsByClassName(Y.FLOATTEXT)[0];e.isNullOrUndefined(a)||(a.textContent=t)}s.classList.remove(Y.NOFLOATLABEL),i.removeAttribute("placeholder")}else e.isNullOrUndefined(t)||""===t?i.removeAttribute("placeholder"):e.attributes(i,{placeholder:t})}function F(t,i,s){t?e.attributes(i,{readonly:""}):i.removeAttribute("readonly"),e.isNullOrUndefined(s)||A(i,s)}function M(t,i){t?e.addClass(i,Y.RTL):e.removeClass(i,Y.RTL)}function D(t,i,s,n){var a={disabled:"","aria-disabled":"true"},r=!e.isNullOrUndefined(n);t?(i.classList.remove(Y.DISABLE),W(a,i),r&&e.removeClass([n],Y.DISABLE)):(i.classList.add(Y.DISABLE),q(a,i),r&&e.addClass([n],Y.DISABLE)),e.isNullOrUndefined(s)||A(i,s)}function z(t,i,s,n,a){var r=e.isNullOrUndefined(a)?e.createElement:a;t?s.clearButton=S(i,s,n,r):(e.remove(s.clearButton),s.clearButton=null)}function W(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i],a=E(e);"disabled"===n&&e.classList.remove(Y.DISABLE),"disabled"===n&&a.classList.contains(Y.INPUTGROUP)&&a.classList.remove(Y.DISABLE),"placeholder"===n&&a.classList.contains(Y.FLOATINPUT)?a.getElementsByClassName(Y.FLOATTEXT)[0].textContent="":e.removeAttribute(n)}}function q(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i],a=E(e);"disabled"===n&&e.classList.add(Y.DISABLE),"disabled"===n&&a.classList.contains(Y.INPUTGROUP)&&a.classList.add(Y.DISABLE),"placeholder"===n&&a.classList.contains(Y.FLOATINPUT)?a.getElementsByClassName(Y.FLOATTEXT)[0].textContent=t[""+n]:e.setAttribute(n,t[""+n])}}function j(t){var i=t.container;if(!e.isNullOrUndefined(i)&&i.classList.contains(Y.FLOATINPUT)){var s=i.querySelector("textarea")?i.querySelector("textarea"):i.querySelector("input"),n=i.querySelector("."+Y.FLOATTEXT).textContent,a=null!==i.querySelector(".e-clear-icon");e.detach(i.querySelector("."+Y.FLOATLINE)),e.detach(i.querySelector("."+Y.FLOATTEXT)),e.classList(i,[Y.INPUTGROUP],[Y.FLOATINPUT]),d(s),e.attributes(s,{placeholder:n}),s.classList.add(Y.INPUT),a||"INPUT"!==s.tagName||s.removeAttribute("required")}}function _(t,i,s,n){var a=e.isNullOrUndefined(n)?e.createElement:n,r=e.closest(t,"."+Y.INPUTGROUP);pt=i;var l=r.tagName,o={element:t,floatLabelType:i,customTag:l="DIV"!==l&&"SPAN"!==l?l:null,properties:{placeholder:s}};if("Never"!==i){var h=r.querySelector(".e-clear-icon"),u={container:r};t.classList.remove(Y.INPUT),v(o,u,a),X(u.container,a),U(o.element,u.container);var p=r.classList.contains("e-float-icon-left");if(e.isNullOrUndefined(h)&&(h=p?r.querySelector(".e-input-in-wrap").querySelector(".e-input-group-icon"):r.querySelector(".e-input-group-icon")),e.isNullOrUndefined(h))p&&(h=r.querySelector(".e-input-group-icon"));else{var d=r.querySelector("."+Y.FLOATLINE),c=r.querySelector("."+Y.FLOATTEXT),m=p?r.querySelector(".e-input-in-wrap"):r;m.insertBefore(t,h),m.insertBefore(d,h),m.insertBefore(c,h)}}else f(o);g(i,t.parentElement)}function X(t,e){if(t.classList.contains("e-outline")&&t.getElementsByClassName("e-float-text")[0]){var i=e("span",{className:Y.FLOATTEXTCONTENT});i.innerHTML=t.getElementsByClassName("e-float-text")[0].innerHTML,t.getElementsByClassName("e-float-text")[0].innerHTML="",t.getElementsByClassName("e-float-text")[0].appendChild(i)}}function K(t,e){for(var i=0;i<e.length;i++)G(t,e[parseInt(i.toString(),10)].container)}function G(t,i,s){var n=[];n.push(s);var a=e.isNullOrUndefined(s)?i.querySelectorAll(".e-input-group-icon"):n;if(t&&a.length>0)for(r=0;r<a.length;r++)a[parseInt(r.toString(),10)].addEventListener("mousedown",Q,!1),a[parseInt(r.toString(),10)].addEventListener("mouseup",tt,!1);else if(a.length>0)for(var r=0;r<a.length;r++)a[parseInt(r.toString(),10)].removeEventListener("mousedown",Q,this),a[parseInt(r.toString(),10)].removeEventListener("mouseup",tt,this)}function J(t,e){t.classList.contains("e-disabled")||t.querySelector("input").readOnly||e.classList.add("e-input-btn-ripple")}function $(t){if(!t)return!1;for(var e=t;e&&e!==document.body;){if("none"===window.getComputedStyle(e).display)return!1;e=e.parentElement}return!0}function Q(){for(var t=this,e=this.parentElement;!e.classList.contains("e-input-group");)e=e.parentElement;J(e,t)}function tt(){var t=this;setTimeout(function(){t.classList.remove("e-input-btn-ripple")},500)}function et(t,e){var i=e("span",{className:t});return i.classList.add("e-input-group-icon"),i}function it(t,e,i,s,n){var a="string"==typeof e?e.split(","):e;if("append"===t.toLowerCase())for(var r=0,l=a;r<l.length;r++)nt(u=l[r],i,n);else for(var o=0,h=a;o<h.length;o++){var u=h[o];st(u,i,s,n)}i.getElementsByClassName("e-input-group-icon")[0]&&i.getElementsByClassName("e-float-text-overflow")[0]&&i.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon")}function st(t,i,s,n){var a=e.isNullOrUndefined(n)?e.createElement:n,r=et(t,a);i.classList.add("e-float-icon-left");var l=i.querySelector(".e-input-in-wrap");if(e.isNullOrUndefined(l)){l=a("span",{className:"e-input-in-wrap"}),s.parentNode.insertBefore(l,s);var o=i.querySelectorAll(s.tagName+" ~ *");l.appendChild(s);for(var h=0;h<o.length;h++){var u=o[parseInt(h.toString(),10)],p=l.parentElement;u.classList.contains("e-float-line")&&(p&&p.classList.contains("e-filled")||!p)||l.appendChild(u)}}return l.parentNode.insertBefore(r,l),G(!0,i,r),r}function nt(t,i,s){var n=et(t,e.isNullOrUndefined(s)?e.createElement:s);return(i.classList.contains("e-float-icon-left")?i.querySelector(".e-input-in-wrap"):i).appendChild(n),G(!0,i,n),n}function at(t,e){"hidden"===e.type?t.classList.add("e-hidden"):t.classList.contains("e-hidden")&&t.classList.remove("e-hidden")}function rt(t,i){if(!e.isNullOrUndefined(t))for(var s=0,n=Object.keys(t);s<n.length;s++){var a=n[s];Z.indexOf(a)<0&&i.setAttribute(a,t[""+a])}}function lt(t,e,i){I(ot(t),[i],ot(e))}function ot(t){var i=t;return e.isNullOrUndefined(t)||""===t||(i=t.replace(/\s+/g," ").trim()),i}function ht(t,i){if(!e.isNullOrUndefined(t))for(var s=0,n=Object.keys(t);s<n.length;s++){var a=n[s];if(Z.indexOf(a)>-1)if("class"===a){var r=this.getInputValidClassList(t[""+a]);""!==r&&e.addClass([i],r.split(" "))}else if("style"===a){var l=i.getAttribute(a);l=e.isNullOrUndefined(l)?t[""+a]:l+t[""+a],i.setAttribute(a,l)}else i.setAttribute(a,t[""+a])}}function ut(t){return!t||/^\s*$/.test(t)}var pt,dt=!0;t.createInput=i,t.bindInitialEvent=r,t.wireFloatingEvents=p,t.wireClearBtnEvents=O,t.destroy=L,t.setValue=B,t.setCssClass=I,t.calculateWidth=U,t.setWidth=R,t.setPlaceholder=V,t.setReadonly=F,t.setEnableRtl=M,t.setEnabled=D,t.setClearButton=z,t.removeAttributes=W,t.addAttributes=q,t.removeFloating=j,t.addFloating=_,t.createSpanElement=X,t.setRipple=K,t.addIcon=it,t.prependSpan=st,t.appendSpan=nt,t.validateInputType=at,t.updateHTMLAttributesToElement=rt,t.updateCssClass=lt,t.getInputValidClassList=ot,t.updateHTMLAttributesToWrapper=ht,t.isBlank=ut}(t.Input||(t.Input={}));var G=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),J=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},$="e-input-group-icon",Q=new RegExp("^(-)?(\\d*)$"),tt=["title","style","class"],et=0,it=function(i){function s(t,e){var s=i.call(this,t,e)||this;return s.preventChange=!1,s.isDynamicChange=!1,s.numericOptions=t,s}return G(s,i),s.prototype.preRender=function(){this.isPrevFocused=!1,this.decimalSeparator=".",this.intRegExp=new RegExp("/^(-)?(d*)$/"),this.isCalled=!1;var t=e.getValue("ej2_instances",this.element);if(this.cloneElement=this.element.cloneNode(!0),e.removeClass([this.cloneElement],["e-control","e-numerictextbox","e-lib"]),this.angularTagName=null,this.formEle=e.closest(this.element,"form"),"EJS-NUMERICTEXTBOX"===this.element.tagName){this.angularTagName=this.element.tagName;var i=this.createElement("input"),s=0;for(s;s<this.element.attributes.length;s++){var n=this.element.attributes[s].nodeName;"id"!==n&&"class"!==n?(i.setAttribute(this.element.attributes[s].nodeName,this.element.attributes[s].nodeValue),i.innerHTML=this.element.innerHTML):"class"===n&&i.setAttribute(n,this.element.className.split(" ").filter(function(t){return 0!==t.indexOf("ng-")}).join(" "))}this.element.hasAttribute("name")&&this.element.removeAttribute("name"),this.element.classList.remove("e-control","e-numerictextbox"),this.element.appendChild(i),this.element=i,e.setValue("ej2_instances",t,this.element)}e.attributes(this.element,{role:"spinbutton",tabindex:"0",autocomplete:"off"});var a={incrementTitle:"Increment value",decrementTitle:"Decrement value",placeholder:this.placeholder};this.l10n=new e.L10n("numerictextbox",a,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.element.hasAttribute("id")||this.element.setAttribute("id",e.getUniqueID("numerictextbox")),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.element.hasAttribute("aria-labelledby")||this.element.hasAttribute("placeholder")||this.element.hasAttribute("aria-label")||this.element.setAttribute("aria-label","numerictextbox"),!e.isNullOrUndefined(e.closest(this.element,"fieldset"))&&e.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete())},s.prototype.checkAttributes=function(t){for(var i=0,s=t?e.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(!e.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"disabled":if(e.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.enabled||t){var a="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n);this.setProperties({enabled:a},!t)}break;case"readonly":if(e.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.readonly||t){var r="readonly"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n);this.setProperties({readonly:r},!t)}break;case"placeholder":(e.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"value":if(e.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.value||t){var l=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));this.setProperties(e.setValue(n,l,{}),!t)}break;case"min":if(e.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.min||t){var o=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));null===o||isNaN(o)||this.setProperties(e.setValue(n,o,{}),!t)}break;case"max":if(e.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.max||t){var h=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));null===h||isNaN(h)||this.setProperties(e.setValue(n,h,{}),!t)}break;case"step":if(e.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.step||t){var u=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));null===u||isNaN(u)||this.setProperties(e.setValue(n,u,{}),!t)}break;case"style":this.inputStyle=this.element.getAttribute(n);break;case"name":this.inputName=this.element.getAttribute(n);break;default:var p=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));(null!==p&&!isNaN(p)||"value"===n)&&this.setProperties(e.setValue(n,p,{}),!0)}}},s.prototype.updatePlaceholder=function(){this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0)},s.prototype.initCultureFunc=function(){this.instance=new e.Internationalization(this.locale)},s.prototype.initCultureInfo=function(){this.cultureInfo.format=this.format,null!==e.getValue("currency",this)&&(e.setValue("currency",this.currency,this.cultureInfo),this.setProperties({currencyCode:this.currency},!0))},s.prototype.createWrapper=function(){var i=this.cssClass;e.isNullOrUndefined(this.cssClass)||""===this.cssClass||(i=this.getNumericValidClassList(this.cssClass));var s=t.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&&e.attributes(this.element,{"aria-readonly":"true"}),this.hiddenInput=this.createElement("input",{attrs:{type:"text","data-validateHidden":"true","aria-label":"hidden",class:"e-numeric-hidden"}}),this.inputName=null!==this.inputName?this.inputName:this.element.id,this.element.removeAttribute("name"),this.isAngular&&"EJS-NUMERICTEXTBOX"===this.angularTagName&&this.cloneElement.id.length>0?e.attributes(this.hiddenInput,{name:this.cloneElement.id}):e.attributes(this.hiddenInput,{name:this.inputName}),this.container.insertBefore(this.hiddenInput,this.container.childNodes[1]),this.updateDataAttribute(!1),null!==this.inputStyle&&e.attributes(this.container,{style:this.inputStyle})},s.prototype.updateDataAttribute=function(t){var e={};if(t)e=this.htmlAttributes;else for(var i=0;i<this.element.attributes.length;i++)e[this.element.attributes[i].name]=this.element.getAttribute(this.element.attributes[i].name);for(var s=0,n=Object.keys(e);s<n.length;s++){var a=n[s];0===a.indexOf("data")&&this.hiddenInput.setAttribute(a,e[""+a])}},s.prototype.updateHTMLAttrToElement=function(){if(!e.isNullOrUndefined(this.htmlAttributes))for(var t=0,i=Object.keys(this.htmlAttributes);t<i.length;t++){var s=i[t];tt.indexOf(s)<0&&this.element.setAttribute(s,this.htmlAttributes[""+s])}},s.prototype.updateCssClass=function(e,i){t.Input.setCssClass(this.getNumericValidClassList(e),[this.container],this.getNumericValidClassList(i))},s.prototype.getNumericValidClassList=function(t){var i=t;return e.isNullOrUndefined(t)||""===t||(i=t.replace(/\s+/g," ").trim()),i},s.prototype.updateHTMLAttrToWrapper=function(){if(!e.isNullOrUndefined(this.htmlAttributes))for(var t=0,i=Object.keys(this.htmlAttributes);t<i.length;t++){var s=i[t];if(tt.indexOf(s)>-1)if("class"===s){var n=this.getNumericValidClassList(this.htmlAttributes[""+s]);""!==n&&e.addClass([this.container],n.split(" "))}else if("style"===s){var a=this.container.getAttribute(s);a=e.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(t){e.isNullOrUndefined(t)||("number"==typeof t?this.container.style.width=e.formatUnit(t):"string"==typeof t&&(this.container.style.width=t.match(/px|%|em/)?t:e.formatUnit(t)))},s.prototype.spinBtnCreation=function(){this.spinDown=t.Input.appendSpan($+" e-spin-down",this.container,this.createElement),e.attributes(this.spinDown,{title:this.l10n.getConstant("decrementTitle")}),this.spinUp=t.Input.appendSpan($+" e-spin-up",this.container,this.createElement),e.attributes(this.spinUp,{title: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),this.min!==-Number.MAX_VALUE&&e.attributes(this.element,{"aria-valuemin":this.min.toString()}),this.max!==Number.MAX_VALUE&&e.attributes(this.element,{"aria-valuemax":this.max.toString()})},s.prototype.formattedValue=function(t,e){return this.instance.getNumberFormat({maximumFractionDigits:t,minimumFractionDigits:t,useGrouping:!1})(e)},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(t,e){this.isInteract=!0;var i=this.isFocused?this.instance.getNumberParser({format:"n"})(this.element.value):this.value;this.changeValue(this.performAction(i,this.step,t)),this.raiseChangeEvent(e)},s.prototype.checkErrorClass=function(){this.isValidState?e.removeClass([this.container],"e-error"):e.addClass([this.container],"e-error"),e.attributes(this.element,{"aria-invalid":this.isValidState?"false":"true"})},s.prototype.bindClearEvent=function(){this.showClearButton&&e.EventHandler.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this)},s.prototype.resetHandler=function(t){t.preventDefault(),this.inputWrapper.clearButton.classList.contains("e-clear-icon-hide")&&!this.inputWrapper.container.classList.contains("e-static-clear")||this.clear(t),this.isInteract=!0,this.raiseChangeEvent(t)},s.prototype.clear=function(t){if(this.setProperties({value:null},!0),this.setElementValue(""),this.hiddenInput.value="",e.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(){e.isNullOrUndefined(this.spinDown)||e.attributes(this.spinDown,{title:this.l10n.getConstant("decrementTitle"),"aria-label":this.l10n.getConstant("decrementTitle")}),e.isNullOrUndefined(this.spinUp)||e.attributes(this.spinUp,{title:this.l10n.getConstant("incrementTitle"),"aria-label":this.l10n.getConstant("incrementTitle")})},s.prototype.wireEvents=function(){e.EventHandler.add(this.element,"focus",this.focusHandler,this),e.EventHandler.add(this.element,"blur",this.focusOutHandler,this),e.EventHandler.add(this.element,"keydown",this.keyDownHandler,this),e.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),e.EventHandler.add(this.element,"input",this.inputHandler,this),e.EventHandler.add(this.element,"keypress",this.keyPressHandler,this),e.EventHandler.add(this.element,"change",this.changeHandler,this),e.EventHandler.add(this.element,"paste",this.pasteHandler,this),this.enabled&&(this.bindClearEvent(),this.formEle&&e.EventHandler.add(this.formEle,"reset",this.resetFormHandler,this))},s.prototype.wireSpinBtnEvents=function(){e.EventHandler.add(this.spinUp,e.Browser.touchStartEvent,this.mouseDownOnSpinner,this),e.EventHandler.add(this.spinDown,e.Browser.touchStartEvent,this.mouseDownOnSpinner,this),e.EventHandler.add(this.spinUp,e.Browser.touchEndEvent,this.mouseUpOnSpinner,this),e.EventHandler.add(this.spinDown,e.Browser.touchEndEvent,this.mouseUpOnSpinner,this),e.EventHandler.add(this.spinUp,e.Browser.touchMoveEvent,this.touchMoveOnSpinner,this),e.EventHandler.add(this.spinDown,e.Browser.touchMoveEvent,this.touchMoveOnSpinner,this)},s.prototype.unwireEvents=function(){e.EventHandler.remove(this.element,"focus",this.focusHandler),e.EventHandler.remove(this.element,"blur",this.focusOutHandler),e.EventHandler.remove(this.element,"keyup",this.keyUpHandler),e.EventHandler.remove(this.element,"input",this.inputHandler),e.EventHandler.remove(this.element,"keydown",this.keyDownHandler),e.EventHandler.remove(this.element,"keypress",this.keyPressHandler),e.EventHandler.remove(this.element,"change",this.changeHandler),e.EventHandler.remove(this.element,"paste",this.pasteHandler),this.formEle&&e.EventHandler.remove(this.formEle,"reset",this.resetFormHandler)},s.prototype.unwireSpinBtnEvents=function(){e.EventHandler.remove(this.spinUp,e.Browser.touchStartEvent,this.mouseDownOnSpinner),e.EventHandler.remove(this.spinDown,e.Browser.touchStartEvent,this.mouseDownOnSpinner),e.EventHandler.remove(this.spinUp,e.Browser.touchEndEvent,this.mouseUpOnSpinner),e.EventHandler.remove(this.spinDown,e.Browser.touchEndEvent,this.mouseUpOnSpinner),e.EventHandler.remove(this.spinUp,e.Browser.touchMoveEvent,this.touchMoveOnSpinner),e.EventHandler.remove(this.spinDown,e.Browser.touchMoveEvent,this.touchMoveOnSpinner)},s.prototype.changeHandler=function(t){t.stopPropagation(),this.element.value.length||this.setProperties({value:null},!0);var e=this.instance.getNumberParser({format:"n"})(this.element.value);this.updateValue(e,t)},s.prototype.raiseChangeEvent=function(t){if(this.inputValue=e.isNullOrUndefined(this.inputValue)||isNaN(this.inputValue)?null:this.inputValue,this.prevValue!==this.value||this.prevValue!==this.inputValue){var i={};this.changeEventArgs={value:this.value,previousValue:this.prevValue,isInteracted:this.isInteract,isInteraction:this.isInteract,event:t},t&&(this.changeEventArgs.event=t),void 0===this.changeEventArgs.event&&(this.changeEventArgs.isInteracted=!1,this.changeEventArgs.isInteraction=!1),e.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 t=this;if(this.enabled&&!this.readonly){var e=this.element.value;setTimeout(function(){t.numericRegex().test(t.element.value)||t.setElementValue(e)})}},s.prototype.preventHandler=function(){var t=this,i=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform);setTimeout(function(){if(t.element.selectionStart>0){var s=t.element.selectionStart,n=t.element.selectionStart-1,a=t.element.value.split(""),r=e.getNumericObject(t.locale),l=e.getValue("decimal",r),o=l.charCodeAt(0);" "===t.element.value[n]&&t.element.selectionStart>0&&!i?(e.isNullOrUndefined(t.prevVal)?t.element.value=t.element.value.trim():0!==n?t.element.value=t.prevVal:0===n&&(t.element.value=t.element.value.trim()),t.element.setSelectionRange(n,n)):isNaN(parseFloat(t.element.value[t.element.selectionStart-1]))&&45!==t.element.value[t.element.selectionStart-1].charCodeAt(0)?(a.indexOf(t.element.value[t.element.selectionStart-1])!==a.lastIndexOf(t.element.value[t.element.selectionStart-1])&&t.element.value[t.element.selectionStart-1].charCodeAt(0)===o||t.element.value[t.element.selectionStart-1].charCodeAt(0)!==o)&&(t.element.value=t.element.value.substring(0,n)+t.element.value.substring(s,t.element.value.length),t.element.setSelectionRange(n,n),isNaN(parseFloat(t.element.value[t.element.selectionStart-1]))&&t.element.selectionStart>0&&t.element.value.length&&t.preventHandler()):isNaN(parseFloat(t.element.value[t.element.selectionStart-2]))&&t.element.selectionStart>1&&45!==t.element.value[t.element.selectionStart-2].charCodeAt(0)&&(a.indexOf(t.element.value[t.element.selectionStart-2])!==a.lastIndexOf(t.element.value[t.element.selectionStart-2])&&t.element.value[t.element.selectionStart-2].charCodeAt(0)===o||t.element.value[t.element.selectionStart-2].charCodeAt(0)!==o)&&(t.element.setSelectionRange(n,n),t.nextEle=t.element.value[t.element.selectionStart],t.cursorPosChanged=!0,t.preventHandler()),!0===t.cursorPosChanged&&t.element.value[t.element.selectionStart]===t.nextEle&&isNaN(parseFloat(t.element.value[t.element.selectionStart-1]))&&(t.element.setSelectionRange(t.element.selectionStart+1,t.element.selectionStart+1),t.cursorPosChanged=!1,t.nextEle=null),""===t.element.value.trim()&&t.element.setSelectionRange(0,0),t.element.selectionStart>0&&(45===t.element.value[t.element.selectionStart-1].charCodeAt(0)&&t.element.selectionStart>1&&(e.isNullOrUndefined(t.prevVal)||(t.element.value=t.prevVal),t.element.setSelectionRange(t.element.selectionStart,t.element.selectionStart)),t.element.value[t.element.selectionStart-1]===l&&0===t.decimals&&t.validateDecimalOnType&&(t.element.value=t.element.value.substring(0,n)+t.element.value.substring(s,t.element.value.length))),t.prevVal=t.element.value}})},s.prototype.keyUpHandler=function(){if(this.enabled&&!this.readonly){!(!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform))&&e.Browser.isDevice&&this.preventHandler();var t=this.instance.getNumberParser({format:"n"})(this.element.value);if(t=null===t||isNaN(t)?null:t,this.hiddenInput.value=t||0===t?t.toString():null,e.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(t){var i=this;if(this.enabled&&!this.readonly){var s=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform);if((navigator.userAgent.toLowerCase().indexOf("firefox")>-1||s)&&e.Browser.isDevice&&this.preventHandler(),this.isAngular&&this.element.value!==e.getValue("decimal",e.getNumericObject(this.locale))&&this.element.value!==e.getValue("minusSign",e.getNumericObject(this.locale))&&this.numericRegex().test(this.element.value)){var n=this.instance.getNumberParser({format:"n"})(this.element.value);n=isNaN(n)?null:n,i.localChange({value:n}),this.preventChange=!0}if(this.isVue){var a=this.instance.getNumberParser({format:"n"})(this.element.value),r=this.instance.getNumberParser({format:"n"})(this.elementPrevValue);(new RegExp("[^0-9]+$").test(this.element.value)||(-1!==this.elementPrevValue.indexOf(".")||-1!==this.elementPrevValue.indexOf("-"))&&"0"===this.element.value[this.element.value.length-1])&&(a=this.value);var l={event:t,value:null===a||isNaN(a)?null:a,previousValue:null===r||isNaN(r)?null:r};this.preventChange=!0,this.elementPrevValue=this.element.value,this.trigger("input",l)}}},s.prototype.keyDownHandler=function(t){if(!this.readonly)switch(t.keyCode){case 38:t.preventDefault(),this.action("increment",t);break;case 40:t.preventDefault(),this.action("decrement",t)}},s.prototype.performAction=function(t,e,i){(null===t||isNaN(t))&&(t=0);var s="increment"===i?t+e:t-e;return s=this.correctRounding(t,e,s),this.strictMode?this.trimValue(s):s},s.prototype.correctRounding=function(t,e,i){var s=new RegExp("[,.](.*)"),n=s.test(t.toString()),a=s.test(e.toString());if(n||a){var r=n?s.exec(t.toString())[0].length:0,l=a?s.exec(e.toString())[0].length:0,o=Math.max(r,l);return t=this.roundValue(i,o)}return i},s.prototype.roundValue=function(t,e){e=e||0;var i=Math.pow(10,e);return t*=i,t=Math.round(t)/i},s.prototype.updateValue=function(t,e){e&&(this.isInteract=!0),null===t||isNaN(t)||this.decimals&&(t=this.roundNumber(t,this.decimals)),this.inputValue=t,this.isVue&&this.element&&this.element.hasAttribute("modelvalue")&&this.isDynamicChange||this.changeValue(null===t||isNaN(t)?null:this.strictMode?this.trimValue(t):t),this.isDynamicChange||this.raiseChangeEvent(e)},s.prototype.updateCurrency=function(t,i){e.setValue(t,i,this.cultureInfo),this.updateValue(this.value)},s.prototype.changeValue=function(t){if(t||0===t){var e=this.getNumberOfDecimals(t);this.setProperties({value:this.roundNumber(t,e)},!0)}else t=null,this.setProperties({value:t},!0);this.modifyText(),this.strictMode||this.validateState()},s.prototype.modifyText=function(){if(this.value||0===this.value){var t=this.formatNumber(),i=this.isFocused?t:this.instance.getNumberFormat(this.cultureInfo)(this.value);this.setElementValue(i),e.attributes(this.element,{"aria-valuenow":t}),e.isNullOrUndefined(this.hiddenInput)||(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(e,i){t.Input.setValue(e,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(t){var i,s=new RegExp("[eE][-+]?([0-9]+)"),n=t.toString();if(s.test(n)){var a=s.exec(n);e.isNullOrUndefined(a)||(n=t.toFixed(Math.min(parseInt(a[1],10),20)))}var r=n.split(".")[1];return i=r&&r.length?r.length:0,null!==this.decimals&&(i=i<this.decimals?i:this.decimals),i},s.prototype.formatNumber=function(){var t=this.getNumberOfDecimals(this.value);return this.instance.getNumberFormat({maximumFractionDigits:t,minimumFractionDigits:t,useGrouping:!1})(this.value)},s.prototype.trimValue=function(t){return t>this.max?this.max:t<this.min?this.min:t},s.prototype.roundNumber=function(t,e){var i=t,s=e||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(t){return t.preventDefault(),!1},s.prototype.keyPressHandler=function(t){if(!this.enabled||this.readonly)return!0;if(!e.Browser.isDevice&&"11.0"===e.Browser.info.version&&13===t.keyCode){var i=this.instance.getNumberParser({format:"n"})(this.element.value);return this.updateValue(i,t),!0}if(0===t.which||t.metaKey||t.ctrlKey||8===t.keyCode||13===t.keyCode)return!0;var s=String.fromCharCode(t.which),n=e.getValue("decimal",e.getNumericObject(this.locale)),a="NumpadDecimal"===t.code&&s!==n;a&&(s=n);var r=this.element.value;if(r=r.substring(0,this.element.selectionStart)+s+r.substring(this.element.selectionEnd),this.numericRegex().test(r)){if(a){var l=this.element.selectionStart+1;this.element.value=r,this.element.setSelectionRange(l,l),t.preventDefault(),t.stopPropagation()}return!0}return t.preventDefault(),t.stopPropagation(),!1},s.prototype.numericRegex=function(){var t=e.getNumericObject(this.locale),i=e.getValue("decimal",t),s="*";return"."===i&&(i="\\"+i),0===this.decimals&&this.validateDecimalOnType?Q:(this.decimals&&this.validateDecimalOnType&&(s="{0,"+this.decimals+"}"),new RegExp("^\\s*(-)?(((\\d+("+i+"\\d"+s+")?)|("+i+"\\d"+s+")))?$"))},s.prototype.mouseWheel=function(t){t.preventDefault();var e,i=t;i.wheelDelta?e=i.wheelDelta/120:i.detail&&(e=-i.detail/3),e>0?this.action("increment",t):e<0&&this.action("decrement",t),this.cancelEvent(t)},s.prototype.focusHandler=function(t){var i=this;if(clearTimeout(et),this.focusEventArgs={event:t,value:this.value,container:this.container},this.trigger("focus",this.focusEventArgs),this.enabled&&!this.readonly){if(this.isFocused=!0,this.prevValue=this.value,this.value||0===this.value){var s=this.formatNumber();if(this.setElementValue(s),!this.isPrevFocused)if(e.Browser.isDevice||"11.0"!==e.Browser.info.version){var n=e.Browser.isDevice&&e.Browser.isIos?600:0;et=setTimeout(function(){i.element.setSelectionRange(0,s.length)},n)}else this.element.setSelectionRange(0,s.length)}e.Browser.isDevice||e.EventHandler.add(this.element,"mousewheel DOMMouseScroll",this.mouseWheel,this)}},s.prototype.focusOutHandler=function(t){var i=this;if(this.blurEventArgs={event:t,value:this.value,container:this.container},this.trigger("blur",this.blurEventArgs),this.enabled&&!this.readonly){if(this.isPrevFocused){if(t.preventDefault(),e.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),e.Browser.isDevice||e.EventHandler.remove(this.element,"mousewheel DOMMouseScroll",this.mouseWheel)}if(e.closest(this.element,"form")){var r=this.element.nextElementSibling,l=document.createEvent("FocusEvent");l.initEvent("focusout",!1,!0),r.dispatchEvent(l)}}},s.prototype.mouseDownOnSpinner=function(t){var i=this;if(this.isFocused&&(this.isPrevFocused=!0,t.preventDefault()),this.getElementData(t)){this.getElementData(t);var s=t.currentTarget,n=s.classList.contains("e-spin-up")?"increment":"decrement";e.EventHandler.add(s,"mouseleave",this.mouseUpClick,this),this.timeOut=setInterval(function(){i.isCalled=!0,i.action(n,t)},150),e.EventHandler.add(document,"mouseup",this.mouseUpClick,this)}},s.prototype.touchMoveOnSpinner=function(t){var e;if("touchmove"===t.type){var i=t.touches;e=i.length&&document.elementFromPoint(i[0].pageX,i[0].pageY)}else e=document.elementFromPoint(t.clientX,t.clientY);e.classList.contains($)||clearInterval(this.timeOut)},s.prototype.mouseUpOnSpinner=function(t){if(this.prevValue=this.value,this.isPrevFocused&&(this.element.focus(),e.Browser.isDevice||(this.isPrevFocused=!1)),e.Browser.isDevice||t.preventDefault(),this.getElementData(t)){var i=t.currentTarget,s=i.classList.contains("e-spin-up")?"increment":"decrement";if(e.EventHandler.remove(i,"mouseleave",this.mouseUpClick),this.isCalled||this.action(s,t),this.isCalled=!1,e.EventHandler.remove(document,"mouseup",this.mouseUpClick),e.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(t){return!(t.which&&3===t.which||t.button&&2===t.button||!this.enabled||this.readonly)&&(clearInterval(this.timeOut),!0)},s.prototype.floatLabelTypeUpdate=function(){t.Input.removeFloating(this.inputWrapper);var e=this.hiddenInput;this.hiddenInput.remove(),t.Input.addFloating(this.element,this.floatLabelType,this.placeholder,this.createElement),this.container.insertBefore(e,this.container.childNodes[1])},s.prototype.mouseUpClick=function(t){t.stopPropagation(),clearInterval(this.timeOut),this.isCalled=!1,this.spinUp&&e.EventHandler.remove(this.spinUp,"mouseleave",this.mouseUpClick),this.spinDown&&e.EventHandler.remove(this.spinDown,"mouseleave",this.mouseUpClick)},s.prototype.increment=function(t){void 0===t&&(t=this.step),this.isInteract=!1,this.changeValue(this.performAction(this.value,t,"increment")),this.raiseChangeEvent()},s.prototype.decrement=function(t){void 0===t&&(t=this.step),this.isInteract=!1,this.changeValue(this.performAction(this.value,t,"decrement")),this.raiseChangeEvent()},s.prototype.destroy=function(){this.unwireEvents(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),e.detach(this.hiddenInput),this.showSpinButton&&(this.unwireSpinBtnEvents(),e.detach(this.spinUp),e.detach(this.spinDown));for(var s=["aria-labelledby","role","autocomplete","aria-readonly","aria-disabled","autocapitalize","spellcheck","aria-autocomplete","tabindex","aria-valuemin","aria-valuemax","aria-valuenow","aria-invalid"],n=0;n<s.length;n++)this.element.removeAttribute(s[n]);this.element.classList.remove("e-input"),this.container.insertAdjacentElement("afterend",this.element),e.detach(this.container),this.spinUp=null,this.spinDown=null,this.container=null,this.hiddenInput=null,this.changeEventArgs=null,this.blurEventArgs=null,this.focusEventArgs=null,this.inputWrapper=null,t.Input.destroy({element:this.element,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),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(),e.addClass([this.container],["e-input-focus"]))},s.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.element.blur(),e.removeClass([this.container],["e-input-focus"]))},s.prototype.getPersistData=function(){var t=["value"];return this.addOnPersist(t)},s.prototype.onPropertyChanged=function(i,s){for(var n=0,a=Object.keys(i);n<a.length;n++){var r=a[n];switch(r){case"width":this.setElementWidth(i.width),t.Input.calculateWidth(this.element,this.container);break;case"cssClass":this.updateCssClass(i.cssClass,s.cssClass);break;case"enabled":t.Input.setEnabled(i.enabled,this.element),this.bindClearEvent();break;case"enableRtl":t.Input.setEnableRtl(i.enableRtl,[this.container]);break;case"readonly":t.Input.setReadonly(i.readonly,this.element),this.readonly?e.attributes(this.element,{"aria-readonly":"true"}):this.element.removeAttribute("aria-readonly");break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.updateDataAttribute(!0),this.checkAttributes(!0),t.Input.validateInputType(this.container,this.element);break;case"placeholder":t.Input.setPlaceholder(i.placeholder,this.element),t.Input.calculateWidth(this.element,this.container);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":e.setValue(r,e.getValue(r,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(),t.Input.setPlaceholder(this.placeholder,this.element),this.updateValue(this.value);break;case"currency":var l=e.getValue(r,i);this.setProperties({currencyCode:l},!0),this.updateCurrency(r,l);break;case"currencyCode":var o=e.getValue(r,i);this.setProperties({currency:o},!0),this.updateCurrency("currency",o);break;case"format":e.setValue(r,e.getValue(r,i),this),this.initCultureInfo(),this.updateValue(this.value);break;case"decimals":this.decimals=i.decimals,this.updateValue(this.value)}}},s.prototype.updateClearButton=function(e){t.Input.setClearButton(e.showClearButton,this.element,this.inputWrapper,void 0,this.createElement),this.bindClearEvent()},s.prototype.updateSpinButton=function(t){t.showSpinButton?this.spinBtnCreation():(e.detach(this.spinUp),e.detach(this.spinDown))},s.prototype.getModuleName=function(){return"numerictextbox"},J([e.Property("")],s.prototype,"cssClass",void 0),J([e.Property(null)],s.prototype,"value",void 0),J([e.Property(-Number.MAX_VALUE)],s.prototype,"min",void 0),J([e.Property(Number.MAX_VALUE)],s.prototype,"max",void 0),J([e.Property(1)],s.prototype,"step",void 0),J([e.Property(null)],s.prototype,"width",void 0),J([e.Property(null)],s.prototype,"placeholder",void 0),J([e.Property({})],s.prototype,"htmlAttributes",void 0),J([e.Property(!0)],s.prototype,"showSpinButton",void 0),J([e.Property(!1)],s.prototype,"readonly",void 0),J([e.Property(!0)],s.prototype,"enabled",void 0),J([e.Property(!1)],s.prototype,"showClearButton",void 0),J([e.Property(!1)],s.prototype,"enablePersistence",void 0),J([e.Property("n2")],s.prototype,"format",void 0),J([e.Property(null)],s.prototype,"decimals",void 0),J([e.Property(null)],s.prototype,"currency",void 0),J([e.Property(null)],s.prototype,"currencyCode",void 0),J([e.Property(!0)],s.prototype,"strictMode",void 0),J([e.Property(!1)],s.prototype,"validateDecimalOnType",void 0),J([e.Property("Never")],s.prototype,"floatLabelType",void 0),J([e.Event()],s.prototype,"created",void 0),J([e.Event()],s.prototype,"destroyed",void 0),J([e.Event()],s.prototype,"change",void 0),J([e.Event()],s.prototype,"focus",void 0),J([e.Event()],s.prototype,"blur",void 0),s=J([e.NotifyPropertyChanges],s)}(e.Component),st="e-error",nt="e-input-group",at="e-float-input",rt="e-utility-mask",lt="e-label-top",ot="e-label-bottom",ht={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 ]"},ut=function(){function t(){}return t}(),pt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),dt=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},ct=["title","style","class"],mt=function(i){function s(t,e){var s=i.call(this,t,e)||this;return s.initInputValue="",s.preventChange=!1,s.isClicked=!1,s.maskOptions=t,s}return pt(s,i),s.prototype.getModuleName=function(){return"maskedtextbox"},s.prototype.preRender=function(){this.promptMask="",this.hiddenMask="",this.escapeMaskValue="",this.regExpCollec=ht,this.customRegExpCollec=[],this.maskedRegExp=[],this.undoCollec=[],this.redoCollec=[],this.changeEventArgs={},this.focusEventArgs={},this.blurEventArgs={},this.maskKeyPress=!1,this.isFocus=!1,this.isInitial=!1,this.isIosInvalid=!1;var t=e.getValue("ej2_instances",this.element);if(this.cloneElement=this.element.cloneNode(!0),e.removeClass([this.cloneElement],["e-control","e-maskedtextbox","e-lib"]),this.angularTagName=null,this.formElement=e.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.hasAttribute("name")&&this.element.removeAttribute("name"),this.element.classList.remove("e-control","e-maskedtextbox"),this.element.classList.add("e-mask-container"),this.element.appendChild(i),this.element=i,e.setValue("ej2_instances",t,this.element)}this.updateHTMLAttrToElement(),this.checkHtmlAttributes(!1),this.formElement&&(this.initInputValue=this.value)},s.prototype.getPersistData=function(){var t=["value"];return this.addOnPersist(t)},s.prototype.render=function(){"input"===this.element.tagName.toLowerCase()&&("Never"===this.floatLabelType&&e.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,e.Browser.isDevice||"11.0"!==e.Browser.info.version&&"edge"!==e.Browser.info.name||this.element.blur(),e.Browser.isDevice&&e.Browser.isIos&&this.element.blur(),(this.element.getAttribute("value")||this.value)&&this.element.setAttribute("value",this.element.value),!e.isNullOrUndefined(e.closest(this.element,"fieldset"))&&e.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.element.hasAttribute("aria-labelledby")||this.element.hasAttribute("placeholder")||this.element.hasAttribute("aria-label")||this.element.setAttribute("aria-label","maskedtextbox"),this.renderComplete())},s.prototype.updateHTMLAttrToElement=function(){if(!e.isNullOrUndefined(this.htmlAttributes))for(var t=0,i=Object.keys(this.htmlAttributes);t<i.length;t++){var s=i[t];ct.indexOf(s)<0&&this.element.setAttribute(s,this.htmlAttributes[""+s])}},s.prototype.updateCssClass=function(e,i){t.Input.setCssClass(this.getValidClassList(e),[this.inputObj.container],this.getValidClassList(i))},s.prototype.getValidClassList=function(t){var i=t;return e.isNullOrUndefined(t)||""===t||(i=t.replace(/\s+/g," ").trim()),i},s.prototype.updateHTMLAttrToWrapper=function(){if(!e.isNullOrUndefined(this.htmlAttributes))for(var t=0,i=Object.keys(this.htmlAttributes);t<i.length;t++){var s=i[t];if(ct.indexOf(s)>-1)if("class"===s){var n=this.htmlAttributes[""+s].replace(/\s+/g," ").trim();""!==n&&e.addClass([this.inputObj.container],n.split(" "))}else if("style"===s){var a=this.inputObj.container.getAttribute(s);a=e.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&&this.promptChar.length>1&&(this.promptChar=this.promptChar[0]),a.call(this),r.call(this),(null===this.mask||""===this.mask&&void 0!==this.value)&&W.call(this,this.value);var t=m.call(this,this.element);this.prevValue=t,this.value=t,this.isInitial||o.call(this),l.call(this)},s.prototype.setMaskPlaceholder=function(e,i){(i||this.placeholder)&&(t.Input.setPlaceholder(this.placeholder,this.element),(this.element.value===this.promptMask&&e&&"Always"!==this.floatLabelType||this.element.value===this.promptMask&&"Never"===this.floatLabelType)&&W.call(this,""))},s.prototype.setWidth=function(t){if(!e.isNullOrUndefined(t))if("number"==typeof t)this.inputObj.container.style.width=e.formatUnit(t),this.element.style.width=e.formatUnit(t);else if("string"==typeof t){var i=t.match(/px|%|em/)?t:e.formatUnit(t);this.inputObj.container.style.width=i,this.element.style.width=i}},s.prototype.checkHtmlAttributes=function(t){for(var i=0,s=t?e.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly"];i<s.length;i++){var n=s[i];if(!e.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"placeholder":(e.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"disabled":if(e.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.enabled||t){var a="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n);this.setProperties({enabled:a},!t)}break;case"value":(e.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.value||t)&&this.setProperties({value:this.element.value},!t);break;case"readonly":if(e.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.readonly||t){var r="readonly"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n);this.setProperties({readonly:r},!t)}}}},s.prototype.createWrapper=function(){var i=this.cssClass;e.isNullOrUndefined(this.cssClass)||""===this.cssClass||(i=this.getValidClassList(this.cssClass)),this.inputObj=t.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(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++)switch(n[s]){case"value":z.call(this,this.value),this.placeholder&&!this.isFocus&&this.setMaskPlaceholder(!1,!1),""===this.value&&null!=i.value&&(this.element.selectionStart=0,this.element.selectionEnd=0);break;case"placeholder":this.setMaskPlaceholder(!0,!0);break;case"width":this.setWidth(e.width),t.Input.calculateWidth(this.element,this.inputObj.container);break;case"cssClass":this.updateCssClass(e.cssClass,i.cssClass);break;case"enabled":t.Input.setEnabled(e.enabled,this.element,this.floatLabelType,this.inputObj.container);break;case"readonly":t.Input.setReadonly(e.readonly,this.element);break;case"enableRtl":t.Input.setEnableRtl(e.enableRtl,[this.inputObj.container]);break;case"customCharacters":this.customCharacters=e.customCharacters,this.resetMaskedTextBox();break;case"showClearButton":t.Input.setClearButton(e.showClearButton,this.element,this.inputObj,void 0,this.createElement),h.call(this);break;case"floatLabelType":this.floatLabelType=e.floatLabelType,t.Input.removeFloating(this.inputObj),t.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=e.mask,this.maskedRegExp=[],this.updateValue(a);break;case"promptChar":e.promptChar.length>1&&(e.promptChar=e.promptChar[0]),e.promptChar?this.promptChar=e.promptChar:this.promptChar="_";var r=this.element.value.replace(new RegExp("["+i.promptChar+"]","g"),this.promptChar);this.promptMask===this.element.value&&(r=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=[],W.call(this,r)}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange},s.prototype.updateValue=function(t){this.resetMaskedTextBox(),z.call(this,t)},s.prototype.getMaskedValue=function(){return c.call(this,this.element)},s.prototype.focusIn=function(){document.activeElement!==this.element&&this.enabled&&(this.isFocus=!0,this.element.focus(),e.addClass([this.inputObj.container],["e-input-focus"]))},s.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.isFocus=!1,this.element.blur(),e.removeClass([this.inputObj.container],["e-input-focus"]))},s.prototype.destroy=function(){o.call(this),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]);for(var s=["aria-labelledby","role","autocomplete","aria-readonly","aria-disabled","autocapitalize","spellcheck","aria-autocomplete","aria-live","aria-invalid"],n=0;n<s.length;n++)this.element.removeAttribute(s[n]);this.element.classList.remove("e-input"),this.inputObj&&(this.inputObj.container.insertAdjacentElement("afterend",this.element),e.detach(this.inputObj.container)),this.blurEventArgs=null,t.Input.destroy({element:this.element,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),this.changeEventArgs=null,this.inputObj=null,i.prototype.destroy.call(this)},dt([e.Property(null)],s.prototype,"cssClass",void 0),dt([e.Property(null)],s.prototype,"width",void 0),dt([e.Property(null)],s.prototype,"placeholder",void 0),dt([e.Property("Never")],s.prototype,"floatLabelType",void 0),dt([e.Property({})],s.prototype,"htmlAttributes",void 0),dt([e.Property(!0)],s.prototype,"enabled",void 0),dt([e.Property(!1)],s.prototype,"readonly",void 0),dt([e.Property(!1)],s.prototype,"showClearButton",void 0),dt([e.Property(!1)],s.prototype,"enablePersistence",void 0),dt([e.Property(null)],s.prototype,"mask",void 0),dt([e.Property("_")],s.prototype,"promptChar",void 0),dt([e.Property(null)],s.prototype,"value",void 0),dt([e.Property(null)],s.prototype,"customCharacters",void 0),dt([e.Event()],s.prototype,"created",void 0),dt([e.Event()],s.prototype,"destroyed",void 0),dt([e.Event()],s.prototype,"change",void 0),dt([e.Event()],s.prototype,"focus",void 0),dt([e.Event()],s.prototype,"blur",void 0),s=dt([e.NotifyPropertyChanges],s)}(e.Component),vt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),ft=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},gt=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return vt(i,t),ft([e.Property("None")],i.prototype,"placement",void 0),ft([e.Property(10)],i.prototype,"largeStep",void 0),ft([e.Property(1)],i.prototype,"smallStep",void 0),ft([e.Property(!1)],i.prototype,"showSmallTicks",void 0),ft([e.Property(null)],i.prototype,"format",void 0),i}(e.ChildProperty),yt=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return vt(i,t),ft([e.Property(null)],i.prototype,"color",void 0),ft([e.Property(null)],i.prototype,"start",void 0),ft([e.Property(null)],i.prototype,"end",void 0),i}(e.ChildProperty),bt=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return vt(i,t),ft([e.Property(!1)],i.prototype,"enabled",void 0),ft([e.Property(null)],i.prototype,"minStart",void 0),ft([e.Property(null)],i.prototype,"minEnd",void 0),ft([e.Property(null)],i.prototype,"maxStart",void 0),ft([e.Property(null)],i.prototype,"maxEnd",void 0),ft([e.Property(!1)],i.prototype,"startHandleFixed",void 0),ft([e.Property(!1)],i.prototype,"endHandleFixed",void 0),i}(e.ChildProperty),Ct=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return vt(i,t),ft([e.Property("")],i.prototype,"cssClass",void 0),ft([e.Property("Before")],i.prototype,"placement",void 0),ft([e.Property("Focus")],i.prototype,"showOn",void 0),ft([e.Property(!1)],i.prototype,"isVisible",void 0),ft([e.Property(null)],i.prototype,"format",void 0),i}(e.ChildProperty),Et={root:"e-slider",rtl:"e-rtl",sliderHiddenInput:"e-slider-input",controlWrapper:"e-control-wrapper",sliderHandle:"e-handle",rangeBar:"e-range",sliderButton:"e-slider-button",firstButton:"e-first-button",secondButton:"e-second-button",scale:"e-scale",tick:"e-tick",large:"e-large",tickValue:"e-tick-value",sliderTooltip:"e-slider-tooltip",sliderHover:"e-slider-hover",sliderFirstHandle:"e-handle-first",sliderSecondHandle:"e-handle-second",sliderDisabled:"e-disabled",sliderContainer:"e-slider-container",horizontalTooltipBefore:"e-slider-horizontal-before",horizontalTooltipAfter:"e-slider-horizontal-after",verticalTooltipBefore:"e-slider-vertical-before",verticalTooltipAfter:"e-slider-vertical-after",materialTooltip:"e-material-tooltip",materialTooltipOpen:"e-material-tooltip-open",materialTooltipActive:"e-tooltip-active",materialSlider:"e-material-slider",sliderTrack:"e-slider-track",sliderHorizantalColor:"e-slider-horizantal-color",sliderVerticalColor:"e-slider-vertical-color",sliderHandleFocused:"e-handle-focused",verticalSlider:"e-vertical",horizontalSlider:"e-horizontal",sliderHandleStart:"e-handle-start",sliderTooltipStart:"e-material-tooltip-start",sliderTabHandle:"e-tab-handle",sliderButtonIcon:"e-button-icon",sliderSmallSize:"e-small-size",sliderTickPosition:"e-tick-pos",sliderFirstTick:"e-first-tick",sliderLastTick:"e-last-tick",sliderButtonClass:"e-slider-btn",sliderTooltipWrapper:"e-tooltip-wrap",sliderTabTrack:"e-tab-track",sliderTabRange:"e-tab-range",sliderActiveHandle:"e-handle-active",sliderMaterialHandle:"e-material-handle",sliderMaterialRange:"e-material-range",sliderMaterialDefault:"e-material-default",materialTooltipShow:"e-material-tooltip-show",materialTooltipHide:"e-material-tooltip-hide",readonly:"e-read-only",limits:"e-limits",limitBarDefault:"e-limit-bar",limitBarFirst:"e-limit-first",limitBarSecond:"e-limit-second",dragHorizontal:"e-drag-horizontal",dragVertical:"e-drag-vertical"},St=function(t){function s(e,i){var s=t.call(this,e,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 vt(s,t),s.prototype.preRender=function(){var t={incrementTitle:"Increase",decrementTitle:"Decrease"};this.l10n=new e.L10n("slider",t,this.locale),this.isElementFocused=!1,this.tickElementCollection=[],this.tooltipFormatInfo={},this.ticksFormatInfo={},this.initCultureInfo(),this.initCultureFunc(),this.formChecker()},s.prototype.formChecker=function(){var t=e.closest(this.element,"form");t?(this.isForm=!0,e.isNullOrUndefined(this.formResetValue)||this.setProperties({value:this.formResetValue},!0),this.formResetValue=this.value,"Range"!==this.type||!e.isNullOrUndefined(this.formResetValue)&&"object"==typeof this.formResetValue?e.isNullOrUndefined(this.formResetValue)&&(this.formResetValue=parseFloat(e.formatUnit(this.min))):this.formResetValue=[parseFloat(e.formatUnit(this.min)),parseFloat(e.formatUnit(this.max))],this.formElement=t):this.isForm=!1},s.prototype.initCultureFunc=function(){this.internationalization=new e.Internationalization(this.locale)},s.prototype.initCultureInfo=function(){this.tooltipFormatInfo.format=e.isNullOrUndefined(this.tooltip.format)?null:this.tooltip.format,this.ticksFormatInfo.format=e.isNullOrUndefined(this.ticks.format)?null:this.ticks.format},s.prototype.formatString=function(t,e){var i=null,s=null;if(t||0===t){i=this.formatNumber(t);var n=this.numberOfDecimals(t);s=this.internationalization.getNumberFormat(e)(this.makeRoundNumber(t,n))}return{elementVal:i,formatString:s}},s.prototype.formatNumber=function(t){var e=this.numberOfDecimals(t);return this.internationalization.getNumberFormat({maximumFractionDigits:e,minimumFractionDigits:e,useGrouping:!1})(t)},s.prototype.numberOfDecimals=function(t){var e=t.toString().split(".")[1];return e&&e.length?e.length:0},s.prototype.makeRoundNumber=function(t,e){var i=e||0;return Number(t.toFixed(i))},s.prototype.render=function(){var t=this;this.initialize(),this.initRender(),this.wireEvents(),this.setZindex(),this.renderComplete(),"EJS-SLIDER"===this.element.tagName&&"none"===this.getTheme(this.sliderContainer)&&setTimeout(function(){t.refresh()},0)},s.prototype.initialize=function(){e.addClass([this.element],Et.root),this.setCSSClass()},s.prototype.setElementWidth=function(t){e.isNullOrUndefined(t)||e.isNullOrUndefined(this.sliderContainer)||("number"==typeof t?this.sliderContainer.style.width=e.formatUnit(t):"string"==typeof t&&(this.sliderContainer.style.width=t.match(/px|%|em/)?t:e.formatUnit(t)))},s.prototype.setCSSClass=function(t){t&&e.removeClass([this.element],t.split(" ")),this.cssClass&&e.addClass([this.element],this.cssClass.split(" "))},s.prototype.setEnabled=function(){this.enabled?(e.removeClass([this.sliderContainer],[Et.sliderDisabled]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.remove(Et.sliderDisabled),this.wireEvents()):(e.addClass([this.sliderContainer],[Et.sliderDisabled]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.add(Et.sliderDisabled),this.unwireEvents())},s.prototype.getTheme=function(t){return window.getComputedStyle(t,":after").getPropertyValue("content").replace(/['"]+/g,"")},s.prototype.initRender=function(){this.sliderContainer=this.createElement("div",{className:Et.sliderContainer+" "+Et.controlWrapper}),this.element.parentNode.insertBefore(this.sliderContainer,this.element),this.sliderContainer.appendChild(this.element),this.sliderTrack=this.createElement("div",{className:Et.sliderTrack}),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:e.isNullOrUndefined(this.value)?e.isNullOrUndefined(this.min)?"0":this.min.toString():this.value.toString(),name:this.element.getAttribute("name")||this.element.getAttribute("id")||"_"+(1e3*Math.random()).toFixed(0)+"slider",class:Et.sliderHiddenInput}}),this.hiddenInput.tabIndex=-1,this.sliderContainer.appendChild(this.hiddenInput),this.showButtons&&this.setButtons(),this.setEnableRTL(),"Range"===this.type?this.rangeValueUpdate():this.value=e.isNullOrUndefined(this.value)?e.isNullOrUndefined(this.min)?0:parseFloat(e.formatUnit(this.min.toString())):this.value,this.previousVal="Range"!==this.type?this.checkHandleValue(parseFloat(e.formatUnit(this.value.toString()))):[this.checkHandleValue(parseFloat(e.formatUnit(this.value[0].toString()))),this.checkHandleValue(parseFloat(e.formatUnit(this.value[1].toString())))],this.previousChanged=this.previousVal,e.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?e.removeClass([this.sliderContainer],[Et.sliderDisabled]):e.addClass([this.sliderContainer],[Et.sliderDisabled]),this.readonly?e.addClass([this.sliderContainer],[Et.readonly]):e.removeClass([this.sliderContainer],[Et.readonly])},s.prototype.getThemeInitialization=function(){this.isMaterial="material"===this.getTheme(this.sliderContainer)||"material-dark"===this.getTheme(this.sliderContainer),this.isMaterial3="Material3"===this.getTheme(this.sliderContainer)||"Material3-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.isTailwind3="tailwind3"===this.getTheme(this.sliderContainer)||"tailwind3-dark"===this.getTheme(this.sliderContainer),this.isBootstrap5="bootstrap5"===this.getTheme(this.sliderContainer),this.isFluent="FluentUI"===this.getTheme(this.sliderContainer),this.isFluent2="fluent2"===this.getTheme(this.sliderContainer),this.isBootstrap5Dot3="bootstrap5.3"===this.getTheme(this.sliderContainer),this.isMaterialTooltip=(this.isMaterial||this.isMaterial3)&&"Range"!==this.type&&this.tooltip.isVisible},s.prototype.createRangeBar=function(){"Default"!==this.type&&(this.rangeBar=this.createElement("div",{attrs:{class:Et.rangeBar}}),this.element.appendChild(this.rangeBar),this.drag&&"Range"===this.type&&("Horizontal"===this.orientation?this.rangeBar.classList.add(Et.dragHorizontal):this.rangeBar.classList.add(Et.dragVertical)))},s.prototype.createLimitBar=function(){var t="Range"!==this.type?Et.limitBarDefault:Et.limitBarFirst;t+=" "+Et.limits,this.limitBarFirst=this.createElement("div",{attrs:{class:t}}),this.element.appendChild(this.limitBarFirst),"Range"===this.type&&(this.limitBarSecond=this.createElement("div",{attrs:{class:Et.limitBarSecond+" "+Et.limits}}),this.element.appendChild(this.limitBarSecond))},s.prototype.setOrientClass=function(){"Vertical"!==this.orientation?(this.sliderContainer.classList.remove(Et.verticalSlider),this.sliderContainer.classList.add(Et.horizontalSlider),this.firstHandle.setAttribute("aria-orientation","horizontal"),"Range"===this.type&&this.secondHandle.setAttribute("aria-orientation","horizontal")):(this.sliderContainer.classList.remove(Et.horizontalSlider),this.sliderContainer.classList.add(Et.verticalSlider),this.firstHandle.setAttribute("aria-orientation","vertical"),"Range"===this.type&&this.secondHandle.setAttribute("aria-orientation","vertical"))},s.prototype.setAriaAttributes=function(t){var i=this,s=this.min,n=this.max;!e.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&(s=this.customValues[0],n=this.customValues[this.customValues.length-1]),"Range"!==this.type?e.attributes(t,{"aria-valuemin":e.isNullOrUndefined(s)?"0":s.toString(),"aria-valuemax":e.isNullOrUndefined(n)?"100":n.toString()}):(!e.isNullOrUndefined(this.customValues)&&this.customValues.length>0?[[e.isNullOrUndefined(s)?"":s.toString(),this.value.length>1&&!e.isNullOrUndefined(this.customValues[this.value[1]])?this.customValues[this.value[1]].toString():""],[this.value.length>0&&!e.isNullOrUndefined(this.customValues[this.value[0]])?this.customValues[this.value[0]].toString():"",e.isNullOrUndefined(n)?"":n.toString()]]:[[e.isNullOrUndefined(s)?"":s.toString(),this.value.length>1&&!e.isNullOrUndefined(this.value[1])?this.value[1].toString():""],[this.value.length>0&&!e.isNullOrUndefined(this.value[0])?this.value[0].toString():"",e.isNullOrUndefined(n)?"":n.toString()]]).forEach(function(t,s){var n=0===s?i.firstHandle:i.secondHandle;n&&e.attributes(n,{"aria-valuemin":t[0],"aria-valuemax":t[1]})})},s.prototype.createSecondHandle=function(){this.secondHandle=this.createElement("div",{attrs:{class:Et.sliderHandle,role:"slider",tabIndex:"0","aria-label":"slider"}}),this.secondHandle.classList.add(Et.sliderSecondHandle),this.element.appendChild(this.secondHandle)},s.prototype.createFirstHandle=function(){this.firstHandle=this.createElement("div",{attrs:{class:Et.sliderHandle,role:"slider",tabIndex:"0","aria-label":"slider"}}),this.firstHandle.classList.add(Et.sliderFirstHandle),this.element.appendChild(this.firstHandle),this.isMaterialTooltip&&(this.materialHandle=this.createElement("div",{attrs:{class:Et.sliderHandle+" "+Et.sliderMaterialHandle}}),this.element.appendChild(this.materialHandle))},s.prototype.wireFirstHandleEvt=function(t){t?(e.EventHandler.remove(this.firstHandle,"mousedown touchstart",this.handleFocus),e.EventHandler.remove(this.firstHandle,"transitionend",this.transitionEnd),e.EventHandler.remove(this.firstHandle,"mouseenter touchenter",this.handleOver),e.EventHandler.remove(this.firstHandle,"mouseleave touchend",this.handleLeave)):(e.EventHandler.add(this.firstHandle,"mousedown touchstart",this.handleFocus,this),e.EventHandler.add(this.firstHandle,"transitionend",this.transitionEnd,this),e.EventHandler.add(this.firstHandle,"mouseenter touchenter",this.handleOver,this),e.EventHandler.add(this.firstHandle,"mouseleave touchend",this.handleLeave,this))},s.prototype.wireSecondHandleEvt=function(t){t?(e.EventHandler.remove(this.secondHandle,"mousedown touchstart",this.handleFocus),e.EventHandler.remove(this.secondHandle,"transitionend",this.transitionEnd),e.EventHandler.remove(this.secondHandle,"mouseenter touchenter",this.handleOver),e.EventHandler.remove(this.secondHandle,"mouseleave touchend",this.handleLeave)):(e.EventHandler.add(this.secondHandle,"mousedown touchstart",this.handleFocus,this),e.EventHandler.add(this.secondHandle,"transitionend",this.transitionEnd,this),e.EventHandler.add(this.secondHandle,"mouseenter touchenter",this.handleOver,this),e.EventHandler.add(this.secondHandle,"mouseleave touchend",this.handleLeave,this))},s.prototype.handleStart=function(){"Range"!==this.type&&(this.firstHandle.classList[0===this.handlePos1?"add":"remove"](Et.sliderHandleStart),this.isMaterialTooltip&&(this.materialHandle.classList[0===this.handlePos1?"add":"remove"](Et.sliderHandleStart),this.tooltipElement&&this.tooltipElement.classList[0===this.handlePos1?"add":"remove"](Et.sliderTooltipStart)))},s.prototype.transitionEnd=function(t){"transform"!==t.propertyName&&(this.handleStart(),this.enableAnimation||(this.getHandle().style.transition="none"),"Default"!==this.type&&(this.rangeBar.style.transition="none"),(this.isMaterial||this.isMaterial3)&&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(Et.sliderHandleFocused)&&this.firstHandle.classList.remove(Et.sliderHandleFocused),"Range"===this.type&&this.secondHandle.classList.contains(Et.sliderHandleFocused)&&this.secondHandle.classList.remove(Et.sliderHandleFocused)},s.prototype.handleFocus=function(t){this.focusSliderElement(),this.sliderBarClick(t),t.currentTarget===this.firstHandle?(this.firstHandle.classList.add(Et.sliderHandleFocused),this.firstHandle.classList.add(Et.sliderTabHandle)):(this.secondHandle.classList.add(Et.sliderHandleFocused),this.secondHandle.classList.add(Et.sliderTabHandle)),e.EventHandler.add(document,"mousemove touchmove",this.sliderBarMove,this),e.EventHandler.add(document,"mouseup touchend",this.sliderBarUp,this)},s.prototype.handleOver=function(t){this.tooltip.isVisible&&"Hover"===this.tooltip.showOn&&this.tooltipToggle(t.currentTarget),"Default"===this.type&&this.tooltipToggle(this.getHandle())},s.prototype.handleLeave=function(t){!this.tooltip.isVisible||"Hover"!==this.tooltip.showOn||t.currentTarget.classList.contains(Et.sliderHandleFocused)||t.currentTarget.classList.contains(Et.sliderTabHandle)||this.closeTooltip()},s.prototype.setHandler=function(){this.createFirstHandle(),"Range"===this.type&&this.createSecondHandle()},s.prototype.setEnableRTL=function(){this.enableRtl&&"Vertical"!==this.orientation?e.addClass([this.sliderContainer],Et.rtl):e.removeClass([this.sliderContainer],Et.rtl);var t="Vertical"!==this.orientation?this.horDir:this.verDir;this.enableRtl?(this.horDir="right",this.verDir="bottom"):(this.horDir="left",this.verDir="bottom"),t!==("Vertical"!==this.orientation?this.horDir:this.verDir)&&"Horizontal"===this.orientation&&(e.setStyleAttribute(this.firstHandle,{right:"",left:"auto"}),"Range"===this.type&&e.setStyleAttribute(this.secondHandle,{top:"",left:"auto"})),this.setBarColor()},s.prototype.tooltipValue=function(){var t,i=this,s={value:this.value,text:""};this.initialTooltip&&(this.initialTooltip=!1,this.setTooltipContent(),s.text=t="function"==typeof this.tooltipObj.content?this.tooltipObj.content():this.tooltipObj.content,this.trigger("tooltipChange",s,function(s){if(i.addTooltipClass(s.text),t!==s.text){i.customAriaText=s.text,i.enableHtmlSanitizer?s.text=e.SanitizeHtmlHelper.sanitize(s.text.toString()):s.text=s.text.toString();var n=function(){return s.text};i.tooltipObj.content=e.initializeCSPTemplate(n),i.setAriaAttrValue(i.firstHandle),"Range"===i.type&&i.setAriaAttrValue(i.secondHandle)}}),this.isMaterialTooltip&&this.setPreviousVal("change",this.value))},s.prototype.setTooltipContent=function(){var t=this.formatContent(this.tooltipFormatInfo,!1),i=function(){return t};this.tooltipObj.content=e.initializeCSPTemplate(i)},s.prototype.formatContent=function(t,i){var s="",n=this.handleVal1,a=this.handleVal2;return!e.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?e.isNullOrUndefined(this.tooltip)||e.isNullOrUndefined(this.tooltip.format)?a.toString()+" - "+n.toString():this.formatString(a,t).elementVal+" - "+this.formatString(n,t).elementVal:e.isNullOrUndefined(this.tooltip)||e.isNullOrUndefined(this.tooltip.format)?n.toString()+" - "+a.toString():this.formatString(n,t).elementVal+" - "+this.formatString(a,t).elementVal:e.isNullOrUndefined(n)||(s=e.isNullOrUndefined(this.tooltip)||e.isNullOrUndefined(this.tooltip.format)?n.toString():this.formatString(n,t).elementVal),s):("Range"===this.type?s=this.enableRtl&&"Vertical"!==this.orientation?e.isNullOrUndefined(t.format)?a.toString()+" - "+n.toString():this.formatString(a,t).formatString+" - "+this.formatString(n,t).formatString:e.isNullOrUndefined(t.format)?n.toString()+" - "+a.toString():this.formatString(n,t).formatString+" - "+this.formatString(a,t).formatString:e.isNullOrUndefined(n)||(s=e.isNullOrUndefined(t.format)?n.toString():this.formatString(n,t).formatString),s)},s.prototype.addTooltipClass=function(t){if(this.isMaterialTooltip){var e=t.toString().length;if(this.tooltipElement){i=e>4?{oldCss:Et.sliderMaterialDefault,newCss:Et.sliderMaterialRange}:{oldCss:Et.sliderMaterialRange,newCss:Et.sliderMaterialDefault};this.tooltipElement.classList.remove(i.oldCss),this.tooltipElement.classList.contains(i.newCss)||(this.tooltipElement.classList.add(i.newCss),this.tooltipElement.style.transform=e>4?"scale(1)":this.getTooltipTransformProperties(this.previousTooltipClass).rotate)}else{var i=e>4?Et.sliderMaterialRange:Et.sliderMaterialDefault;this.tooltipObj.cssClass=Et.sliderTooltip+" "+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(t){this.tooltipElement=t.element,this.tooltip.cssClass&&e.addClass([this.tooltipElement],this.tooltip.cssClass.split(" ").filter(function(t){return t})),t.target.removeAttribute("aria-describedby"),this.isMaterialTooltip&&(this.tooltipElement.firstElementChild.classList.add(Et.materialTooltipHide),this.handleStart(),this.setTooltipTransform())},s.prototype.tooltipCollision=function(t){if(this.isBootstrap||this.isBootstrap4||(this.isMaterial||this.isMaterial3)&&!this.isMaterialTooltip){var e=this.isBootstrap4?3:6;switch(t){case"TopCenter":this.tooltipObj.setProperties({offsetY:-e},!1);break;case"BottomCenter":this.tooltipObj.setProperties({offsetY:e},!1);break;case"LeftCenter":this.tooltipObj.setProperties({offsetX:-e},!1);break;case"RightCenter":this.tooltipObj.setProperties({offsetX:e},!1)}}},s.prototype.materialTooltipEventCallBack=function(t){this.sliderBarClick(t),e.EventHandler.add(document,"mousemove touchmove",this.sliderBarMove,this),e.EventHandler.add(document,"mouseup touchend",this.sliderBarUp,this)},s.prototype.wireMaterialTooltipEvent=function(t){this.isMaterialTooltip&&(t?e.EventHandler.remove(this.tooltipElement,"mousedown touchstart",this.materialTooltipEventCallBack):e.EventHandler.add(this.tooltipElement,"mousedown touchstart",this.materialTooltipEventCallBack,this))},s.prototype.tooltipPositionCalculation=function(t){var e;switch(t){case"TopCenter":e=Et.horizontalTooltipBefore;break;case"BottomCenter":e=Et.horizontalTooltipAfter;break;case"LeftCenter":e=Et.verticalTooltipBefore;break;case"RightCenter":e=Et.verticalTooltipAfter}return e},s.prototype.getTooltipTransformProperties=function(t){var e;if(this.tooltipElement){var i="Horizontal"===this.orientation?this.tooltipElement.clientHeight+14-this.tooltipElement.clientHeight/2:this.tooltipElement.clientWidth+14-this.tooltipElement.clientWidth/2;e="Horizontal"===this.orientation?t===Et.horizontalTooltipBefore?{rotate:"rotate(45deg)",translate:"translateY("+i+"px)"}:{rotate:"rotate(225deg)",translate:"translateY("+-i+"px)"}:t===Et.verticalTooltipBefore?{rotate:"rotate(-45deg)",translate:"translateX("+i+"px)"}:{rotate:"rotate(-225deg)",translate:"translateX("+-i+"px)"}}return e},s.prototype.openMaterialTooltip=function(){var t=this;if(this.isMaterialTooltip){this.refreshTooltip(this.firstHandle);var e=this.tooltipElement.firstElementChild;e.classList.remove(Et.materialTooltipHide),e.classList.add(Et.materialTooltipShow),this.firstHandle.style.cursor="default",this.tooltipElement.style.transition=this.scaleTransform,this.tooltipElement.classList.add(Et.materialTooltipOpen),this.materialHandle.style.transform="scale(0)",e.innerText.length>4?this.tooltipElement.style.transform="scale(1)":this.tooltipElement.style.transform=this.getTooltipTransformProperties(this.previousTooltipClass).rotate,"Default"===this.type?setTimeout(function(){t.tooltipElement&&(t.tooltipElement.style.transition=t.transition.handle)},2500):setTimeout(function(){t.tooltipElement&&(t.tooltipElement.style.transition="none")},2500)}},s.prototype.closeMaterialTooltip=function(){var t=this;if(this.isMaterialTooltip){var e=this.tooltipElement.firstElementChild;this.tooltipElement.style.transition=this.scaleTransform,e.classList.remove(Et.materialTooltipShow),e.classList.add(Et.materialTooltipHide),this.firstHandle.style.cursor="-webkit-grab",this.firstHandle.style.cursor="grab",this.materialHandle&&(this.materialHandle.style.transform="scale(1)"),this.tooltipElement.classList.remove(Et.materialTooltipOpen),this.setTooltipTransform(),this.tooltipTarget=void 0,setTimeout(function(){t.tooltipElement&&(t.tooltipElement.style.transition="none")},2500)}},s.prototype.checkTooltipPosition=function(t){var e=this.tooltipPositionCalculation(t.collidedPosition);void 0!==this.tooltipCollidedPosition&&this.tooltipCollidedPosition===t.collidedPosition&&t.element.classList.contains(e)||(this.isMaterialTooltip&&(void 0!==e&&(t.element.classList.remove(this.previousTooltipClass),t.element.classList.add(e),this.previousTooltipClass=e),t.element.style.transform&&t.element.classList.contains(Et.materialTooltipOpen)&&t.element.firstElementChild.innerText.length<=4&&(t.element.style.transform=this.getTooltipTransformProperties(this.previousTooltipClass).rotate)),this.tooltipCollidedPosition=t.collidedPosition),this.isMaterialTooltip&&this.tooltipElement&&-1!==this.tooltipElement.style.transform.indexOf("translate")&&this.setTooltipTransform()},s.prototype.setTooltipTransform=function(){var t=this.getTooltipTransformProperties(this.previousTooltipClass);e.isNullOrUndefined(this.tooltipElement)||(this.tooltipElement.firstElementChild.innerText.length>4?this.tooltipElement.style.transform=t.translate+" scale(0.01)":this.tooltipElement.style.transform=t.translate+" "+t.rotate+" scale(0.01)")},s.prototype.renderTooltip=function(){this.tooltipObj=new i.Tooltip({showTipPointer:this.isBootstrap||this.isMaterial||this.isMaterial3||this.isBootstrap4||this.isTailwind||this.isTailwind3||this.isBootstrap5||this.isFluent||this.isFluent2||this.isBootstrap5Dot3,cssClass:Et.sliderTooltip,height:this.isMaterial||this.isMaterial3?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 t="Auto"===this.tooltip.showOn?"Hover":this.tooltip.showOn;this.setProperties({tooltip:{showOn:t}},!0),this.tooltipObj.position=this.tooltipPlacement(),this.tooltipCollision(this.tooltipObj.position),[this.firstHandle,this.rangeBar,this.secondHandle].forEach(function(t){e.isNullOrUndefined(t)||(t.style.transition="none")}),this.isMaterialTooltip&&(this.sliderContainer.classList.add(Et.materialSlider),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:Et.sliderButton+" "+Et.firstButton}),this.firstBtn.appendChild(this.createElement("span",{className:Et.sliderButtonIcon})),(this.isTailwind||this.isTailwind3)&&this.firstBtn.querySelector("span").classList.add("e-icons"),this.firstBtn.tabIndex=-1,this.secondBtn=this.createElement("div",{className:Et.sliderButton+" "+Et.secondButton}),this.secondBtn.appendChild(this.createElement("span",{className:Et.sliderButtonIcon})),(this.isTailwind||this.isTailwind3)&&this.secondBtn.querySelector("span").classList.add("e-icons"),this.secondBtn.tabIndex=-1,this.sliderContainer.classList.add(Et.sliderButtonClass),this.sliderContainer.appendChild(this.firstBtn),this.sliderContainer.appendChild(this.secondBtn),this.sliderContainer.appendChild(this.element),this.buttonTitle()},s.prototype.buttonTitle=function(){var t=this.enableRtl&&"Vertical"!==this.orientation;this.l10n.setLocale(this.locale);var i=this.l10n.getConstant("decrementTitle"),s=this.l10n.getConstant("incrementTitle");e.attributes(t?this.secondBtn:this.firstBtn,{"aria-label":i,title:i}),e.attributes(t?this.firstBtn:this.secondBtn,{"aria-label":s,title:s})},s.prototype.buttonFocusOut=function(){(this.isMaterial||this.isMaterial3)&&this.getHandle().classList.remove("e-large-thumb-size")},s.prototype.repeatButton=function(t){var e,i=this.handleValueUpdate(),s=this.enableRtl&&"Vertical"!==this.orientation;t.target.parentElement.classList.contains(Et.firstButton)||t.target.classList.contains(Et.firstButton)?e=s?this.add(i,parseFloat(this.step.toString()),!0):this.add(i,parseFloat(this.step.toString()),!1):(t.target.parentElement.classList.contains(Et.secondButton)||t.target.classList.contains(Et.secondButton))&&(e=s?this.add(i,parseFloat(this.step.toString()),!1):this.add(i,parseFloat(this.step.toString()),!0)),this.limits.enabled&&(e=this.getLimitCorrectedValues(e)),e>=this.min&&e<=this.max&&(this.changeHandleValue(e),this.tooltipToggle(this.getHandle()))},s.prototype.repeatHandlerMouse=function(t){t.preventDefault(),"mousedown"!==t.type&&"touchstart"!==t.type||(this.buttonClick(t),this.repeatInterval=setInterval(this.repeatButton.bind(this),180,t))},s.prototype.materialChange=function(){this.getHandle().classList.contains("e-large-thumb-size")||this.getHandle().classList.add("e-large-thumb-size")},s.prototype.focusHandle=function(){this.getHandle().classList.contains(Et.sliderTabHandle)||this.getHandle().classList.add(Et.sliderTabHandle)},s.prototype.repeatHandlerUp=function(t){this.changeEvent("changed",t),this.closeTooltip(),clearInterval(this.repeatInterval),this.getHandle().focus()},s.prototype.customTickCounter=function(t){var i=4;return!e.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&(t>4&&(i=3),t>7&&(i=2),t>14&&(i=1),t>28&&(i=0)),i},s.prototype.renderScale=function(){var t="Vertical"===this.orientation?"v":"h";this.ul=this.createElement("ul",{className:Et.scale+" e-"+t+"-scale "+Et.tick+"-"+this.ticks.placement.toLowerCase(),attrs:{role:"presentation","aria-hidden":"true"}}),this.ul.style.zIndex="-1",e.Browser.isAndroid&&"h"===t&&this.ul.classList.add(Et.sliderTickPosition);var i=this.ticks.smallStep;this.ticks.showSmallTicks?i<=0&&(i=parseFloat(e.formatUnit(this.step))):i=this.ticks.largeStep>0?this.ticks.largeStep:parseFloat(e.formatUnit(this.max))-parseFloat(e.formatUnit(this.min));var s=parseFloat(e.formatUnit(this.min)),n=parseFloat(e.formatUnit(this.max)),a=parseFloat(e.formatUnit(i)),r=!e.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&this.customValues.length-1,l=this.customTickCounter(r),o=!e.isNullOrUndefined(this.customValues)&&this.customValues.length>0?r*l+r:Math.abs((n-s)/a);this.element.appendChild(this.ul);var h,u=parseFloat(this.min.toString());"v"===t&&(u=parseFloat(this.max.toString()));var p,d=0,c=100/o;c===1/0&&(c=5);for(var m=0,v=!e.isNullOrUndefined(this.customValues)&&this.customValues.length>0?this.customValues.length-1:0,f=0;m<=o;m++){if(h=this.createElement("li",{attrs:{class:Et.tick,role:"presentation","aria-hidden":"true"}}),!e.isNullOrUndefined(this.customValues)&&this.customValues.length>0)(p=m%(l+1)==0)&&("h"===t?(u=this.customValues[f],f++):(u=this.customValues[v],v--),h.setAttribute("title",u.toString()));else if(h.setAttribute("title",u.toString()),0===this.numberOfDecimals(this.max)&&0===this.numberOfDecimals(this.min)&&0===this.numberOfDecimals(this.step))if("h"===t){b=(u-parseFloat(this.min.toString()))%this.ticks.largeStep;p=Math.abs(b)<1e-10||Math.abs(this.ticks.largeStep-b)<1e-10}else{b=Math.abs(u-parseFloat(this.max.toString()))%this.ticks.largeStep;p=Math.abs(b)<1e-10||Math.abs(this.ticks.largeStep-b)<1e-10}else{var g=this.ticks.largeStep,y=u;if("h"===t){b=(y-s)%g;p=Math.abs(b)<1e-10||Math.abs(g-b)<1e-10}else{var b=Math.abs(y-parseFloat(n.toString()))%g;p=Math.abs(b)<1e-10||Math.abs(g-b)<1e-10}}p&&h.classList.add(Et.large),"h"===t?h.style.width=c+"%":h.style.height=c+"%";var C=p?"Both"===this.ticks.placement?2:1:0;if(p)for(var E=0;E<C;E++)this.createTick(h,u);else e.isNullOrUndefined(this.customValues)&&this.formatTicksValue(h,u);this.ul.appendChild(h),this.tickElementCollection.push(h);var S=void 0;e.isNullOrUndefined(this.customValues)&&(S=this.numberOfDecimals(i)>this.numberOfDecimals(u)?this.numberOfDecimals(i):this.numberOfDecimals(u),u="h"===t?this.makeRoundNumber(u+i,S):this.min>this.max?this.makeRoundNumber(u+i,S):this.makeRoundNumber(u-i,S),d=this.makeRoundNumber(d+i,S))}this.ticksAlignment(t,c)},s.prototype.ticksAlignment=function(t,e,i){void 0===i&&(i=!0),this.firstChild=this.ul.firstElementChild,this.lastChild=this.ul.lastElementChild,this.firstChild.classList.add(Et.sliderFirstTick),this.lastChild.classList.add(Et.sliderLastTick),this.sliderContainer.classList.add(Et.scale+"-"+this.ticks.placement.toLowerCase()),"h"===t?(this.firstChild.style.width=e/2+"%",this.lastChild.style.width=e/2+"%"):(this.firstChild.style.height=e/2+"%",this.lastChild.style.height=e/2+"%");var s={ticksWrapper:this.ul,tickElements:this.tickElementCollection};i&&this.trigger("renderedTicks",s),this.scaleAlignment()},s.prototype.createTick=function(t,i){var s=this.createElement("span",{className:Et.tickValue+" "+Et.tick+"-"+this.ticks.placement.toLowerCase(),attrs:{role:"presentation","aria-hidden":"true"}});t.appendChild(s),e.isNullOrUndefined(this.customValues)?this.formatTicksValue(t,i,s):this.enableHtmlSanitizer?s.innerHTML=e.SanitizeHtmlHelper.sanitize(i.toString()):s.innerHTML=i.toString()},s.prototype.formatTicksValue=function(t,i,s){var n=this,a=this.formatNumber(i),r={value:i,text:e.isNullOrUndefined(this.ticks)||e.isNullOrUndefined(this.ticks.format)?a:this.formatString(i,this.ticksFormatInfo).formatString,tickElement:t};this.trigger("renderingTicks",r,function(i){t.setAttribute("title",i.text.toString()),s&&(n.enableHtmlSanitizer?s.innerHTML=e.SanitizeHtmlHelper.sanitize(i.text.toString()):s.innerHTML=i.text.toString())})},s.prototype.scaleAlignment=function(){this.tickValuePosition(),"Vertical"===this.orientation?this.element.getBoundingClientRect().width<=15?this.sliderContainer.classList.add(Et.sliderSmallSize):this.sliderContainer.classList.remove(Et.sliderSmallSize):this.element.getBoundingClientRect().height<=15?this.sliderContainer.classList.add(Et.sliderSmallSize):this.sliderContainer.classList.remove(Et.sliderSmallSize)},s.prototype.tickValuePosition=function(){this.firstChild=this.element.querySelector("ul").children[0];var t,i,s=this.firstChild.getBoundingClientRect(),n=this.ticks.smallStep,a=Math.abs(parseFloat(e.formatUnit(this.max))-parseFloat(e.formatUnit(this.min)))/n;this.firstChild.children.length>0&&(t=this.firstChild.children[0].getBoundingClientRect());var r,l=[this.sliderContainer.querySelectorAll("."+Et.tick+"."+Et.large+" ."+Et.tickValue)];r="Both"===this.ticks.placement?[].slice.call(l[0],2):[].slice.call(l[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=-t.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=-t.width/2+"px";for(h=0;h<r.length;h++)i=r[h].getBoundingClientRect(),"Vertical"===this.orientation?e.setStyleAttribute(r[h],{top:(o-i.height)/2+"px"}):e.setStyleAttribute(r[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.sliderLastTick),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.sliderLastTick),this.firstChild.style.left=this.firstHandle.style.left)),"Vertical"===this.orientation&&this.firstChild.classList.remove(Et.sliderLastTick))},s.prototype.setAriaAttrValue=function(t){var i,s=!e.isNullOrUndefined(this.ticks)&&!e.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(t),"Range"!==this.type?e.attributes(t,{"aria-valuenow":a,"aria-valuetext":n}):this.enableRtl?t===this.firstHandle?e.attributes(t,{"aria-valuenow":a.split(" - ")[1],"aria-valuetext":i[1]}):e.attributes(t,{"aria-valuenow":a.split(" - ")[0],"aria-valuetext":i[0]}):t===this.firstHandle?e.attributes(t,{"aria-valuenow":a.split(" - ")[0],"aria-valuetext":i[0]}):e.attributes(t,{"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(t){return t="MinRange"===this.type||"Default"===this.type?this.getLimitValueAndPosition(t,this.limits.minStart,this.limits.minEnd)[0]:1===this.activeHandle?this.getLimitValueAndPosition(t,this.limits.minStart,this.limits.minEnd)[0]:this.getLimitValueAndPosition(t,this.limits.maxStart,this.limits.maxEnd)[0]},s.prototype.focusSliderElement=function(){this.isElementFocused||(this.element.focus(),this.isElementFocused=!0)},s.prototype.buttonClick=function(t){this.focusSliderElement();var i,s=this.enableRtl&&"Vertical"!==this.orientation,n=this.handleValueUpdate();40===t.keyCode||37===t.keyCode||t.currentTarget.classList.contains(Et.firstButton)?i=s?this.add(n,parseFloat(this.step.toString()),!0):this.add(n,parseFloat(this.step.toString()),!1):38===t.keyCode||39===t.keyCode||t.currentTarget.classList.contains(Et.secondButton)?i=s?this.add(n,parseFloat(this.step.toString()),!1):this.add(n,parseFloat(this.step.toString()),!0):33===t.keyCode||t.currentTarget.classList.contains(Et.firstButton)?i=s?this.add(n,parseFloat(this.ticks.largeStep.toString()),!1):this.add(n,parseFloat(this.ticks.largeStep.toString()),!0):34===t.keyCode||t.currentTarget.classList.contains(Et.secondButton)?i=s?this.add(n,parseFloat(this.ticks.largeStep.toString()),!0):this.add(n,parseFloat(this.ticks.largeStep.toString()),!1):36===t.keyCode?i=parseFloat(this.min<this.max?this.min.toString():this.max.toString()):35===t.keyCode&&(i=parseFloat(this.min<this.max?this.max.toString():this.min.toString())),this.limits.enabled&&(i=this.getLimitCorrectedValues(i)),this.changeHandleValue(i),!this.isMaterial&&!this.isMaterial3||this.tooltip.isVisible||this.getHandle().classList.contains(Et.sliderTabHandle)||this.materialChange(),this.tooltipToggle(this.getHandle()),this.getHandle().focus(),this.focusHandle(),t.currentTarget.classList.contains(Et.firstButton)&&e.EventHandler.add(this.firstBtn,"mouseup touchend",this.buttonUp,this),t.currentTarget.classList.contains(Et.secondButton)&&e.EventHandler.add(this.secondBtn,"mouseup touchend",this.buttonUp,this)},s.prototype.tooltipToggle=function(t){this.isMaterialTooltip?this.tooltipElement.classList.contains(Et.materialTooltipOpen)?this.refreshTooltip(this.firstHandle):this.openMaterialTooltip():this.tooltipElement?this.refreshTooltip(t):this.openTooltip(t)},s.prototype.buttonUp=function(t){t.currentTarget.classList.contains(Et.firstButton)&&e.EventHandler.remove(this.firstBtn,"mouseup touchend",this.buttonUp),t.currentTarget.classList.contains(Et.secondButton)&&e.EventHandler.remove(this.secondBtn,"mouseup touchend",this.buttonUp)},s.prototype.setRangeBar=function(){"Horizontal"!==this.orientation||e.isNullOrUndefined(this.rangeBar)?e.isNullOrUndefined(this.rangeBar)||("MinRange"===this.type?(this.rangeBar.style.bottom=this.min>this.max?this.handlePos1+"px":"0px",e.setStyleAttribute(this.rangeBar,{height:e.isNullOrUndefined(this.handlePos1)?0:this.min>this.max?this.element.clientHeight-this.handlePos1+"px":this.handlePos1+"px"})):(this.rangeBar.style.bottom=this.min>this.max?this.handlePos2+"px":this.handlePos1+"px",e.setStyleAttribute(this.rangeBar,{height:this.min>this.max?this.handlePos1-this.handlePos2+"px":this.handlePos2-this.handlePos1+"px"}))):"MinRange"===this.type?(this.enableRtl?this.rangeBar.style.right="0px":this.rangeBar.style.left="0px",e.setStyleAttribute(this.rangeBar,{width:e.isNullOrUndefined(this.handlePos1)?0:this.handlePos1+"px"})):(this.enableRtl?this.rangeBar.style.right=this.handlePos1+"px":this.rangeBar.style.left=this.handlePos1+"px",e.setStyleAttribute(this.rangeBar,{width:this.handlePos2-this.handlePos1+"px"}))},s.prototype.checkValidValueAndPos=function(t){return t=this.checkHandleValue(t),t=this.checkHandlePosition(t)},s.prototype.setLimitBarPositions=function(t,e,i,s){"Horizontal"===this.orientation?this.enableRtl?(this.limitBarFirst.style.right=t+"px",this.limitBarFirst.style.width=e-t+"px"):(this.limitBarFirst.style.left=t+"px",this.limitBarFirst.style.width=e-t+"px"):(this.limitBarFirst.style.bottom=(this.min<this.max?t:e)+"px",this.limitBarFirst.style.height=(this.min<this.max?e-t: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=(this.min<this.max?i:s)+"px",this.limitBarSecond.style.height=(this.min<this.max?s-i:i-s)+"px"))},s.prototype.setLimitBar=function(){if("Default"===this.type||"MinRange"===this.type){var t=this.getLimitValueAndPosition(this.limits.minStart,this.limits.minStart,this.limits.minEnd,!0)[0];t=this.checkValidValueAndPos(t);var e=this.getLimitValueAndPosition(this.limits.minEnd,this.limits.minStart,this.limits.minEnd,!0)[0];e=this.checkValidValueAndPos(e),this.setLimitBarPositions(t,e)}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(t,i,s,n){return e.isNullOrUndefined(i)&&(i=this.min<this.max?this.min:this.max,e.isNullOrUndefined(t)&&n&&(t=i)),e.isNullOrUndefined(s)&&(s=this.min<this.max?this.max:this.min,e.isNullOrUndefined(t)&&n&&(t=s)),t<i&&(t=i),t>s&&(t=s),[t,this.checkHandlePosition(t)]},s.prototype.setValue=function(){if(!e.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&(this.min=0,this.max=this.customValues.length-1,this.setBarColor()),this.setAriaAttributes(this.firstHandle),this.handleVal1=e.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,e.isNullOrUndefined(this.activeHandle)&&(this.activeHandle="Range"===this.type?2:1),"Default"===this.type||"MinRange"===this.type){if(this.limits.enabled){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.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(e.formatUnit(this.min)),parseFloat(e.formatUnit(this.max))])},s.prototype.validateRangeValue=function(){this.rangeValueUpdate(),this.setRangeValue()},s.prototype.modifyZindex=function(){"Range"!==this.type||e.isNullOrUndefined(this.firstHandle)||e.isNullOrUndefined(this.secondHandle)?this.isMaterialTooltip&&this.tooltipElement&&(this.tooltipElement.style.zIndex=i.getZindexPartial(this.element)+""):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+"")},s.prototype.setHandlePosition=function(t){var i,s=this,n=1===this.activeHandle?this.handlePos1:this.handlePos2;i=this.isMaterialTooltip?[this.firstHandle,this.materialHandle]:[this.getHandle()],this.handleStart(),i.forEach(function(t){e.isNullOrUndefined(t)||("Horizontal"===s.orientation?s.enableRtl?t.style.right=n+"px":t.style.left=n+"px":t.style.bottom=n+"px")}),this.changeEvent("change",t)},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(t,e){var i="change"===t?this.previousVal:this.previousChanged;if("Range"!==this.type)this.setProperties({value:this.handleVal1},!0),i===this.value||this.isMaterialTooltip&&this.initialTooltip||(this.trigger(t,this.changeEventArgs(t,e)),this.initialTooltip=!0,this.setPreviousVal(t,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(t,this.changeEventArgs(t,e)),this.initialTooltip=!0,this.setPreviousVal(t,this.value)),this.setAriaAttrValue(this.getHandle())}this.hiddenInput.value=this.value.toString()},s.prototype.changeEventArgs=function(t,i){var s;return this.tooltip.isVisible&&this.tooltipObj&&this.initialTooltip?(this.tooltipValue(),s={value:this.value,previousValue:"change"===t?this.previousVal:this.previousChanged,action:t,text:"function"==typeof this.tooltipObj.content?this.tooltipObj.content():this.tooltipObj.content,isInteracted:!e.isNullOrUndefined(i)}):s={value:this.value,previousValue:"change"===t?this.previousVal:this.previousChanged,action:t,text:e.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:!e.isNullOrUndefined(i)},s},s.prototype.setPreviousVal=function(t,e){"change"===t?this.previousVal=e:this.previousChanged=e},s.prototype.updateRangeValue=function(){var t=this.value.toString().split(",").map(Number);if(this.enableRtl&&"Vertical"!==this.orientation||this.rtl?this.value=[t[1],t[0]]:this.value=[t[0],t[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.min<this.max&&this.handlePos1>this.handlePos2&&(this.handlePos1=this.handlePos2,this.handleVal1=this.handleVal2),this.min>this.max&&this.handlePos1<this.handlePos2&&(this.handlePos2=this.handlePos1,this.handleVal2=this.handleVal1),this.preHandlePos1=this.handlePos1,this.preHandlePos2=this.handlePos2,this.limits.enabled){this.activeHandle=1;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.activeHandle=2,e=this.getLimitValueAndPosition(this.handleVal2,this.limits.maxStart,this.limits.maxEnd),this.handleVal2=e[0],this.handlePos2=e[1],this.preHandlePos2=this.handlePos2}},s.prototype.checkHandlePosition=function(t){var i;return t=100*(t-parseFloat(e.formatUnit(this.min)))/(parseFloat(e.formatUnit(this.max))-parseFloat(e.formatUnit(this.min))),i="Horizontal"===this.orientation?this.element.getBoundingClientRect().width*(t/100):this.element.getBoundingClientRect().height*(t/100),parseFloat(e.formatUnit(this.max))===parseFloat(e.formatUnit(this.min))&&(i="Horizontal"===this.orientation?this.element.getBoundingClientRect().width:this.element.getBoundingClientRect().height),i},s.prototype.checkHandleValue=function(t){if(this.min===this.max)return parseFloat(e.formatUnit(this.max));var i=this.tempStartEnd();return t<i.start?t=i.start:t>i.end&&(t=i.end),t},s.prototype.reposition=function(){var t=this;e.isNullOrUndefined(this.firstHandle)||(this.firstHandle.style.transition="none"),"Default"===this.type||e.isNullOrUndefined(this.rangeBar)||(this.rangeBar.style.transition="none"),"Range"!==this.type||e.isNullOrUndefined(this.secondHandle)||(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&&!e.isNullOrUndefined(this.materialHandle)&&(this.enableRtl?this.materialHandle.style.right=this.handlePos1+"px":this.materialHandle.style.left=this.handlePos1+"px"),"MinRange"!==this.type||e.isNullOrUndefined(this.rangeBar)?"Range"!==this.type||e.isNullOrUndefined(this.secondHandle)||e.isNullOrUndefined(this.rangeBar)||(this.enableRtl?(this.secondHandle.style.right=this.handlePos2+"px",this.rangeBar.style.right=this.handlePos1+"px"):(this.secondHandle.style.left=this.handlePos2+"px",this.rangeBar.style.left=this.handlePos1+"px"),e.setStyleAttribute(this.rangeBar,{width:this.handlePos2-this.handlePos1+"px"})):(this.enableRtl?this.rangeBar.style.right="0px":this.rangeBar.style.left="0px",e.setStyleAttribute(this.rangeBar,{width:e.isNullOrUndefined(this.handlePos1)?0: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=this.min>this.max?this.handlePos1+"px":"0px",e.setStyleAttribute(this.rangeBar,{height:e.isNullOrUndefined(this.handlePos1)?0:this.min>this.max?this.element.clientHeight-this.handlePos1+"px":this.handlePos1+"px"})):"Range"===this.type&&(this.secondHandle.style.bottom=this.handlePos2+"px",this.rangeBar.style.bottom=this.min>this.max?this.handlePos2+"px":this.handlePos1+"px",e.setStyleAttribute(this.rangeBar,{height:this.min>this.max?this.handlePos1-this.handlePos2+"px":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.isNullOrUndefined(t.firstHandle)||(t.firstHandle.style.transition=t.scaleTransform),"Range"!==t.type||e.isNullOrUndefined(t.secondHandle)||(t.secondHandle.style.transition=t.scaleTransform)}),this.refreshTooltip(this.tooltipTarget),this.setBarColor()},s.prototype.changeHandleValue=function(t){var e=null;1===this.activeHandle?(this.limits.enabled&&this.limits.startHandleFixed||(this.handleVal1=this.checkHandleValue(t),this.handlePos1=this.checkHandlePosition(this.handleVal1),"Range"===this.type&&(this.handlePos1>this.handlePos2&&this.min<this.max||this.handlePos1<this.handlePos2&&this.min>this.max)&&(this.handlePos1=this.handlePos2,this.handleVal1=this.handleVal2),this.handlePos1!==this.preHandlePos1&&(e=this.preHandlePos1=this.handlePos1)),this.modifyZindex()):(this.limits.enabled&&this.limits.endHandleFixed||(this.handleVal2=this.checkHandleValue(t),this.handlePos2=this.checkHandlePosition(this.handleVal2),"Range"===this.type&&(this.handlePos2<this.handlePos1&&this.min<this.max||this.handlePos2>this.handlePos1&&this.min>this.max)&&(this.handlePos2=this.handlePos1,this.handleVal2=this.handleVal1),this.handlePos2!==this.preHandlePos2&&(e=this.preHandlePos2=this.handlePos2)),this.modifyZindex()),null!==e&&("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(t){if(this.min===this.max)return 100;if("Horizontal"===this.orientation){var e=t.x-this.element.getBoundingClientRect().left,i=this.element.offsetWidth/100;this.val=e/i}else{var s=t.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(t){0===this.step&&(this.step=1);var i=parseFloat(e.formatUnit(this.step))/((parseFloat(e.formatUnit(this.max))-parseFloat(e.formatUnit(this.min)))/100),s=t%Math.abs(i);return 0!==s&&(i/2>s?t-=s:t+=Math.abs(i)-s),t},s.prototype.add=function(t,e,i){var s=Math.pow(10,3);return i?(Math.round(t*s)+Math.round(e*s))/s:(Math.round(t*s)-Math.round(e*s))/s},s.prototype.positionToValue=function(t){var i,s=parseFloat(e.formatUnit(this.max))-parseFloat(e.formatUnit(this.min));return i="Horizontal"===this.orientation?t/this.element.getBoundingClientRect().width*s:t/this.element.getBoundingClientRect().height*s,this.add(i,parseFloat(this.min.toString()),!0)},s.prototype.sliderBarClick=function(t){t.preventDefault();var e;"mousedown"===t.type||"mouseup"===t.type||"click"===t.type?e={x:t.clientX,y:t.clientY}:"touchend"!==t.type&&"touchstart"!==t.type||(e={x:t.changedTouches[0].clientX,y:t.changedTouches[0].clientY});var i=this.xyToPosition(e),s=this.positionToValue(i);if("Range"===this.type&&(this.min<this.max&&this.handlePos2-i<i-this.handlePos1||this.min>this.max&&this.handlePos1-i>i-this.handlePos2))this.activeHandle=2,this.limits.enabled&&this.limits.endHandleFixed||(this.limits.enabled&&(s=(n=this.getLimitValueAndPosition(s,this.limits.maxStart,this.limits.maxEnd))[0],i=n[1]),this.secondHandle.classList.add(Et.sliderActiveHandle),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=this.getLimitValueAndPosition(s,this.limits.minStart,this.limits.minEnd);s=n[0],i=n[1]}this.firstHandle.classList.add(Et.sliderActiveHandle),this.handlePos1=this.preHandlePos1=i,this.handleVal1=s}this.modifyZindex(),this.firstHandle.focus()}this.isMaterialTooltip&&this.tooltipElement.classList.add(Et.materialTooltipActive);var a=this.element.querySelector("."+Et.sliderTabHandle);a&&this.getHandle()!==a&&a.classList.remove(Et.sliderTabHandle);var r=1===this.activeHandle?this.firstHandle:this.secondHandle;if(("click"===t.type||"mousedown"===t.type)&&t.target===r){var l=t.clientX,o=t.clientY;document.elementFromPoint(l,o)}if(this.checkRepeatedValue(s)){var h=(this.isMaterial||this.isMaterial3)&&this.tooltip.isVisible?this.transitionOnMaterialTooltip:this.transition;this.getHandle().style.transition=h.handle,"Default"!==this.type&&(this.rangeBar.style.transition=h.rangeBar),this.setHandlePosition(t),this.isMaterialTooltip&&(this.initialTooltip=!1),t.target!==r&&this.changeEvent("changed",t),"Default"!==this.type&&this.setRangeBar()}},s.prototype.handleValueAdjust=function(t,e,i){1===i?(this.handleVal1=e,this.handleVal2=this.handleVal1+this.minDiff):2===i&&(this.handleVal2=e,this.handleVal1=this.handleVal2-this.minDiff),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.handlePos2=this.checkHandlePosition(this.handleVal2)},s.prototype.dragRangeBarMove=function(t){var e,i;"touchmove"!==t.type&&t.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"===t.type?(n=(e=[t.clientX,t.clientY])[0],a=e[1]):(n=(i=[t.changedTouches[0].clientX,t.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.min>this.max?(this.handlePos2=this.xyToPosition(s),this.handleVal2=this.positionToValue(this.handlePos2)):(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.min>this.max?(this.handlePos1=this.xyToPosition(s),this.handleVal1=this.positionToValue(this.handlePos1)):(this.handlePos2=this.xyToPosition(s),this.handleVal2=this.positionToValue(this.handlePos2)),this.limits.enabled){var r=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd);this.handleVal1=r[0],this.handlePos1=r[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),r=this.getLimitValueAndPosition(this.handleVal2,this.limits.maxStart,this.limits.maxEnd),this.handleVal2=r[0],this.handlePos2=r[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.min>this.max?this.min:this.max)&&this.handleValueAdjust(this.handleVal2,this.min>this.max?this.min:this.max,2),this.handleVal1===(this.min>this.max?this.max:this.min)&&this.handleValueAdjust(this.handleVal1,this.min>this.max?this.max:this.min,1)}this.activeHandle=1,this.setHandlePosition(t),this.activeHandle=2,this.setHandlePosition(t),this.tooltipToggle(this.rangeBar),this.setRangeBar()},s.prototype.sliderBarUp=function(t){this.changeEvent("changed",t),this.handleFocusOut(),this.firstHandle.classList.remove(Et.sliderActiveHandle),"Range"===this.type&&(this.initialTooltip=!1,this.secondHandle.classList.remove(Et.sliderActiveHandle)),this.closeTooltip(),(this.isMaterial||this.isMaterial3)&&(this.getHandle().classList.remove("e-large-thumb-size"),this.isMaterialTooltip&&this.tooltipElement.classList.remove(Et.materialTooltipActive)),e.EventHandler.remove(document,"mousemove touchmove",this.sliderBarMove),e.EventHandler.remove(document,"mouseup touchend",this.sliderBarUp)},s.prototype.sliderBarMove=function(t){"touchmove"!==t.type&&t.preventDefault();var e;e="mousemove"===t.type?{x:t.clientX,y:t.clientY}:{x:t.changedTouches[0].clientX,y:t.changedTouches[0].clientY};var i=this.xyToPosition(e),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(Et.sliderActiveHandle)}if("Range"===this.type)if(1===this.activeHandle)this.firstHandle.classList.add(Et.sliderActiveHandle),this.limits.enabled&&this.limits.startHandleFixed||((this.min<this.max&&i>this.handlePos2||this.min>this.max&&i<this.handlePos2)&&(i=this.handlePos2,s=this.handleVal2),i!==this.preHandlePos1&&(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(Et.sliderActiveHandle),!(this.limits.enabled&&this.limits.endHandleFixed||((this.min<this.max&&i<this.handlePos1||this.min>this.max&&i>this.handlePos1)&&(i=this.handlePos1,s=this.handleVal1),i===this.preHandlePos2)))){if(this.limits.enabled){var a=this.getLimitValueAndPosition(s,this.limits.maxStart,this.limits.maxEnd);s=a[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(t),!this.isMaterial&&!this.isMaterial3||this.tooltip.isVisible||this.getHandle().classList.contains(Et.sliderTabHandle)||this.materialChange(),this.tooltipToggle(this.getHandle()),"Default"!==this.type&&this.setRangeBar())},s.prototype.dragRangeBarUp=function(t){this.rangeBarDragged?this.isDragComplete=!0:(this.focusSliderElement(),this.sliderBarClick(t)),this.changeEvent("changed",t),this.closeTooltip(),e.EventHandler.remove(document,"mousemove touchmove",this.dragRangeBarMove),e.EventHandler.remove(document,"mouseup touchend",this.dragRangeBarUp),this.rangeBarDragged=!1},s.prototype.checkRepeatedValue=function(t){if("Range"===this.type){if(t===(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(t===this.previousVal)return 0;return 1},s.prototype.refreshTooltip=function(t){this.tooltip.isVisible&&this.tooltipObj&&(this.tooltipValue(),t&&(this.tooltipObj.refresh(t),this.tooltipTarget=t))},s.prototype.openTooltip=function(t){this.tooltip.isVisible&&this.tooltipObj&&!this.isMaterialTooltip&&(this.tooltipValue(),this.tooltipObj.open(t),this.tooltipTarget=t)},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(t){switch(t.keyCode){case 37:case 38:case 39:case 40:case 33:case 34:case 36:case 35:t.preventDefault(),this.buttonClick(t)}},s.prototype.wireButtonEvt=function(t){t?(e.EventHandler.remove(this.firstBtn,"mouseleave touchleave",this.buttonFocusOut),e.EventHandler.remove(this.secondBtn,"mouseleave touchleave",this.buttonFocusOut),e.EventHandler.remove(this.firstBtn,"mousedown touchstart",this.repeatHandlerMouse),e.EventHandler.remove(this.firstBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp),e.EventHandler.remove(this.secondBtn,"mousedown touchstart",this.repeatHandlerMouse),e.EventHandler.remove(this.secondBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp),e.EventHandler.remove(this.firstBtn,"focusout",this.sliderFocusOut),e.EventHandler.remove(this.secondBtn,"focusout",this.sliderFocusOut)):(e.EventHandler.add(this.firstBtn,"mouseleave touchleave",this.buttonFocusOut,this),e.EventHandler.add(this.secondBtn,"mouseleave touchleave",this.buttonFocusOut,this),e.EventHandler.add(this.firstBtn,"mousedown touchstart",this.repeatHandlerMouse,this),e.EventHandler.add(this.firstBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp,this),e.EventHandler.add(this.secondBtn,"mousedown touchstart",this.repeatHandlerMouse,this),e.EventHandler.add(this.secondBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp,this),e.EventHandler.add(this.firstBtn,"focusout",this.sliderFocusOut,this),e.EventHandler.add(this.secondBtn,"focusout",this.sliderFocusOut,this))},s.prototype.rangeBarMousedown=function(t){var i,s;if(t.preventDefault(),this.focusSliderElement(),"Range"===this.type&&this.drag&&t.target===this.rangeBar){var n=void 0,a=void 0;"mousedown"===t.type?(n=(i=[t.clientX,t.clientY])[0],a=i[1]):"touchstart"===t.type&&(n=(s=[t.changedTouches[0].clientX,t.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 r=this.element.querySelector("."+Et.sliderTabHandle);r&&r.classList.remove(Et.sliderTabHandle),e.EventHandler.add(document,"mousemove touchmove",this.dragRangeBarMove,this),e.EventHandler.add(document,"mouseup touchend",this.dragRangeBarUp,this)}},s.prototype.elementClick=function(t){if(this.isDragComplete)return void(this.isDragComplete=!1);t.preventDefault(),this.focusSliderElement(),this.sliderBarClick(t),this.focusHandle()},s.prototype.wireEvents=function(){this.onresize=this.reposition.bind(this),window.addEventListener("resize",this.onresize),this.enabled&&!this.readonly&&(e.EventHandler.add(this.element,"click",this.elementClick,this),"Range"===this.type&&this.drag&&e.EventHandler.add(this.rangeBar,"mousedown touchstart",this.rangeBarMousedown,this),e.EventHandler.add(this.sliderContainer,"keydown",this.keyDown,this),e.EventHandler.add(this.sliderContainer,"keyup",this.keyUp,this),e.EventHandler.add(this.element,"focusout",this.sliderFocusOut,this),e.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&&e.EventHandler.add(this.formElement,"reset",this.formResetHandler,this))},s.prototype.unwireEvents=function(){e.EventHandler.remove(this.element,"click",this.elementClick),"Range"===this.type&&this.drag&&e.EventHandler.remove(this.rangeBar,"mousedown touchstart",this.rangeBarMousedown),e.EventHandler.remove(this.sliderContainer,"keydown",this.keyDown),e.EventHandler.remove(this.sliderContainer,"keyup",this.keyUp),e.EventHandler.remove(this.element,"focusout",this.sliderFocusOut),e.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),e.EventHandler.remove(this.element,"reset",this.formResetHandler)},s.prototype.formResetHandler=function(){this.setProperties({value:this.formResetValue},!0),this.setValue()},s.prototype.keyUp=function(t){if(9===t.keyCode&&t.target.classList.contains(Et.sliderHandle)&&(this.focusSliderElement(),!t.target.classList.contains(Et.sliderTabHandle))){this.element.querySelector("."+Et.sliderTabHandle)&&this.element.querySelector("."+Et.sliderTabHandle).classList.remove(Et.sliderTabHandle),t.target.classList.add(Et.sliderTabHandle);var e=t.target.parentElement;if(e===this.element&&(e.querySelector("."+Et.sliderTrack).classList.add(Et.sliderTabTrack),"Range"!==this.type&&"MinRange"!==this.type||e.querySelector("."+Et.rangeBar).classList.add(Et.sliderTabRange)),"Range"===this.type){var i=t.target.previousSibling;i&&i.classList.contains(Et.sliderHandle)?this.activeHandle=2:this.activeHandle=1}this.getHandle().focus(),this.tooltipToggle(this.getHandle())}this.closeTooltip(),this.changeEvent("changed",t)},s.prototype.hover=function(t){if(!e.isNullOrUndefined(t))if("mouseover"===t.type||"touchmove"===t.type||"mousemove"===t.type||"pointermove"===t.type||"touchstart"===t.type)this.sliderContainer.classList.add(Et.sliderHover);else{this.sliderContainer.classList.remove(Et.sliderHover);var i=t.currentTarget;this.tooltip.isVisible&&"Always"!==this.tooltip.showOn&&this.tooltipObj&&this.isMaterialTooltip&&!i.classList.contains(Et.sliderHandleFocused)&&!i.classList.contains(Et.sliderTabHandle)&&this.closeMaterialTooltip()}},s.prototype.sliderFocusOut=function(t){t.relatedTarget!==this.secondHandle&&t.relatedTarget!==this.firstHandle&&t.relatedTarget!==this.element&&t.relatedTarget!==this.firstBtn&&t.relatedTarget!==this.secondBtn&&(this.closeMaterialTooltip(),this.closeTooltip(),this.element.querySelector("."+Et.sliderTabHandle)&&this.element.querySelector("."+Et.sliderTabHandle).classList.remove(Et.sliderTabHandle),this.element.querySelector("."+Et.sliderTabTrack)&&(this.element.querySelector("."+Et.sliderTabTrack).classList.remove(Et.sliderTabTrack),"Range"!==this.type&&"MinRange"!==this.type||!this.element.querySelector("."+Et.sliderTabRange)||this.element.querySelector("."+Et.sliderTabRange).classList.remove(Et.sliderTabRange)),this.hiddenInput.focus(),this.hiddenInput.blur(),this.isElementFocused=!1)},s.prototype.removeElement=function(t){t.parentNode&&t.parentNode.removeChild(t)},s.prototype.changeSliderType=function(t,i){this.isMaterialTooltip&&this.materialHandle&&(this.sliderContainer.classList.remove(Et.materialSlider),this.removeElement(this.materialHandle),this.materialHandle=void 0),this.removeElement(this.firstHandle),this.firstHandle=void 0,"Default"!==t&&("Range"===t&&(this.removeElement(this.secondHandle),this.secondHandle=void 0),this.removeElement(this.rangeBar),this.rangeBar=void 0),this.tooltip.isVisible&&!e.isNullOrUndefined(this.tooltipObj)&&(this.tooltipObj.destroy(),this.tooltipElement=void 0,this.tooltipCollidedPosition=void 0),this.limits.enabled&&("MinRange"===t||"Default"===t?e.isNullOrUndefined(this.limitBarFirst)||(this.removeElement(this.limitBarFirst),this.limitBarFirst=void 0):e.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(!this.enabled),"Range"===this.type&&this.wireSecondHandleEvt(!this.enabled),this.setValue(),this.tooltip.isVisible&&(this.renderTooltip(),this.wireMaterialTooltipEvent(!1)),this.setBarColor(),"tooltip"!==i&&this.updateConfig(),this.readonly&&(this.sliderContainer.classList.remove(Et.readonly),this.setReadOnly())},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 t=this.enableRtl&&"Vertical"!==this.orientation;e.attributes(t?this.secondBtn:this.firstBtn,{"aria-label":"Decrease",title:"Decrease"}),e.attributes(t?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?(e.isNullOrUndefined(this.limitBarFirst)&&"Range"!==this.type&&this.createLimitBar(),e.isNullOrUndefined(this.limitBarFirst)&&e.isNullOrUndefined(this.limitBarSecond)&&"Range"===this.type&&this.createLimitBar(),this.setLimitBar(),this.setValue()):(e.isNullOrUndefined(this.limitBarFirst)||e.detach(this.limitBarFirst),e.isNullOrUndefined(this.limitBarSecond)||e.detach(this.limitBarSecond))},s.prototype.getPersistData=function(){var t=["value"];return this.addOnPersist(t)},s.prototype.destroy=function(){t.prototype.destroy.call(this),this.unwireEvents(),window.removeEventListener("resize",this.onresize),e.removeClass([this.sliderContainer],[Et.sliderDisabled]),this.firstHandle.removeAttribute("aria-orientation"),"Range"===this.type&&this.secondHandle.removeAttribute("aria-orientation"),this.sliderContainer.parentNode&&this.sliderContainer.parentNode.insertBefore(this.element,this.sliderContainer),e.detach(this.sliderContainer),this.tooltip.isVisible&&this.tooltipObj.destroy(),this.element.innerHTML="",this.hiddenInput=null,this.sliderContainer=null,this.sliderTrack=null,this.rangeBar=null,this.firstHandle=null,this.secondHandle=null,this.tickElementCollection=null,this.ul=null,this.firstBtn=null,this.secondBtn=null,this.materialHandle=null,this.tooltipObj=null,this.tooltipTarget=null,this.limitBarFirst=null,this.limitBarSecond=null,this.firstChild=null,this.lastChild=null,this.tooltipElement=null},s.prototype.onPropertyChanged=function(t,i){for(var s=this,n=0,a=Object.keys(t);n<a.length;n++){var r=a[n];switch(r){case"cssClass":this.setCSSClass(i.cssClass);break;case"value":if(t&&i){var l=e.isNullOrUndefined(t.value)?"Range"===this.type?[this.min,this.max]:this.min:t.value;this.setProperties({value:l},!0),e.isNullOrUndefined(i.value)||i.value.toString()===l.toString()||(this.setValue(),this.refreshTooltip(this.tooltipTarget),"Range"===this.type&&(e.isNullOrUndefined(t.value)||i.value[1]===l[1]?this.activeHandle=1:this.activeHandle=2))}break;case"min":case"step":case"max":this.setMinMaxValue();break;case"tooltip":e.isNullOrUndefined(t.tooltip)||e.isNullOrUndefined(i.tooltip)||(this.initialTooltip=!0,this.setTooltip(r),this.showButtons||this.wireEvents());break;case"type":e.isNullOrUndefined(i)||!Object.keys(i).length||e.isNullOrUndefined(i.type)||(this.changeSliderType(i.type,r),this.setZindex());break;case"enableRtl":i.enableRtl!==t.enableRtl&&"Vertical"!==this.orientation&&(this.rtl=i.enableRtl,this.changeRtl());break;case"limits":this.limitsPropertyChange();break;case"orientation":this.changeOrientation();break;case"ticks":e.isNullOrUndefined(this.sliderContainer.querySelector("."+Et.scale))||(e.detach(this.ul),Array.prototype.forEach.call(this.sliderContainer.classList,function(t){t.match(/e-scale-/)&&s.sliderContainer.classList.remove(t)})),"None"!==this.ticks.placement&&(this.renderScale(),this.setZindex());break;case"locale":this.showButtons&&this.buttonTitle();break;case"showButtons":t.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(Et.sliderButtonClass),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(t.width),this.setMinMaxValue(),this.limits&&this.limitsPropertyChange()}}},s.prototype.setReadOnly=function(){this.readonly?(this.unwireEvents(),this.sliderContainer.classList.add(Et.readonly)):(this.wireEvents(),this.sliderContainer.classList.remove(Et.readonly))},s.prototype.setMinMaxValue=function(){var t=this;this.setValue(),this.refreshTooltip(this.tooltipTarget),e.isNullOrUndefined(this.sliderContainer.querySelector("."+Et.scale))||this.ul&&(e.detach(this.ul),Array.prototype.forEach.call(this.sliderContainer.classList,function(e){e.match(/e-scale-/)&&t.sliderContainer.classList.remove(e)})),"None"!==this.ticks.placement&&(this.renderScale(),this.setZindex())},s.prototype.setZindex=function(){this.zIndex=6,e.isNullOrUndefined(this.ticks)||"None"===this.ticks.placement||e.isNullOrUndefined(this.ul)||e.isNullOrUndefined(this.element)||(this.ul.style.zIndex=this.zIndex+-7+"",this.element.style.zIndex=this.zIndex+2+""),this.isMaterial||this.isMaterial3||e.isNullOrUndefined(this.ticks)||"Both"!==this.ticks.placement||(this.element.style.zIndex=this.zIndex+2+""),e.isNullOrUndefined(this.firstHandle)||(this.firstHandle.style.zIndex=this.zIndex+3+""),"Range"!==this.type||e.isNullOrUndefined(this.secondHandle)||(this.secondHandle.style.zIndex=this.zIndex+4+"")},s.prototype.setTooltip=function(t){this.changeSliderType(this.type,t)},s.prototype.setBarColor=function(){for(var t,i,s=this.sliderTrack.lastElementChild;s;)this.sliderTrack.removeChild(s),s=this.sliderTrack.lastElementChild;for(var n=0;n<this.colorRange.length;n++)if(!e.isNullOrUndefined(this.colorRange[n].start)&&!e.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),r=this.checkHandlePosition(this.colorRange[n].end),l=this.createElement("div");l.style.backgroundColor=this.colorRange[n].color,l.style.border="1px solid "+this.colorRange[n].color,"Horizontal"===this.orientation?(i=Et.sliderHorizantalColor,t=this.enableRtl?e.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),l.style.width=r-a+"px",l.style.left=t+"px"):(i=Et.sliderVerticalColor,t=this.checkHandlePosition(this.colorRange[n].start),l.style.height=r-a+"px",l.style.bottom=t+"px"),l.classList.add(i),this.sliderTrack.appendChild(l)}},s.prototype.getModuleName=function(){return"slider"},ft([e.Property(null)],s.prototype,"value",void 0),ft([e.Property(null)],s.prototype,"customValues",void 0),ft([e.Property(1)],s.prototype,"step",void 0),ft([e.Property(null)],s.prototype,"width",void 0),ft([e.Property(0)],s.prototype,"min",void 0),ft([e.Property(100)],s.prototype,"max",void 0),ft([e.Property(!1)],s.prototype,"readonly",void 0),ft([e.Property("Default")],s.prototype,"type",void 0),ft([e.Collection([{}],yt)],s.prototype,"colorRange",void 0),ft([e.Complex({},gt)],s.prototype,"ticks",void 0),ft([e.Complex({},bt)],s.prototype,"limits",void 0),ft([e.Property(!0)],s.prototype,"enabled",void 0),ft([e.Complex({},Ct)],s.prototype,"tooltip",void 0),ft([e.Property(!1)],s.prototype,"showButtons",void 0),ft([e.Property(!0)],s.prototype,"enableAnimation",void 0),ft([e.Property("Horizontal")],s.prototype,"orientation",void 0),ft([e.Property("")],s.prototype,"cssClass",void 0),ft([e.Property(!0)],s.prototype,"enableHtmlSanitizer",void 0),ft([e.Event()],s.prototype,"created",void 0),ft([e.Event()],s.prototype,"change",void 0),ft([e.Event()],s.prototype,"changed",void 0),ft([e.Event()],s.prototype,"renderingTicks",void 0),ft([e.Event()],s.prototype,"renderedTicks",void 0),ft([e.Event()],s.prototype,"tooltipChange",void 0),s=ft([e.NotifyPropertyChanges],s)}(e.Component),xt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Tt=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},Pt={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(t){t[t.Message=0]="Message",t[t.Label=1]="Label"}(t.ErrorOption||(t.ErrorOption={}));var kt=function(i){function s(t,s){var n=i.call(this,s,t)||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 e.L10n("formValidator",n.defaultMessages,n.locale),n.locale&&n.localeFunc(),e.onIntlChange.on("notifyExternalChange",n.afterLocalization,n),t="string"==typeof t?e.select(t,document):t,null!=n.element)return n.element.setAttribute("novalidate",""),n.inputElements=e.selectAll(n.selectQuery,n.element),n.createHTML5Rules(),n.wireEvents(),n}xt(s,i),n=s,s.prototype.addRules=function(t,i){t&&(this.rules.hasOwnProperty(t)?e.extend(this.rules[""+t],i,{}):this.rules[""+t]=i)},s.prototype.removeRules=function(t,i){if(t||i)if(this.rules[""+t]&&!i)delete this.rules[""+t];else{if(e.isNullOrUndefined(this.rules[""+t]&&i))return;for(var s=0;s<i.length;s++)delete this.rules[""+t][i[parseInt(s.toString(),10)]]}else this.rules={}},s.prototype.validate=function(t){var e=Object.keys(this.rules);if(t&&e.length)return this.validateRules(t),-1!==e.indexOf(t)&&0===this.errorRules.filter(function(e){return e.name===t}).length;this.errorRules=[];for(var i=0,s=e;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(t){return this.inputElement=e.select('[name="'+t+'"]',this.element),this.inputElement},s.prototype.destroy=function(){this.reset(),this.unwireEvents(),this.rules={};for(var t=0,s=e.selectAll("."+this.errorClass+", ."+this.validClass,this.element);t<s.length;t++){var n=s[t];e.detach(n)}i.prototype.destroy.call(this),this.infoElement=null,e.onIntlChange.off("notifyExternalChange",this.afterLocalization)},s.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"locale":this.localeFunc()}},s.prototype.localeFunc=function(){for(var t=0,e=Object.keys(this.defaultMessages);t<e.length;t++){var i=e[t];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(t){this.locale=t.locale,this.localeFunc()},s.prototype.refresh=function(){this.unwireEvents(),this.inputElements=e.selectAll(this.selectQuery,this.element),this.wireEvents()},s.prototype.clearForm=function(){this.errorRules=[],this.validated=[];for(var t=0,i=e.selectAll(this.selectQuery,this.element);t<i.length;t++){var s=i[t];s.removeAttribute("aria-invalid");var n=s.parentElement,a=n.parentElement;n.classList.contains("e-control-wrapper")||n.classList.contains("e-wrapper")||s.classList.contains("e-input")&&n.classList.contains("e-input-group")?n.classList.remove(this.errorClass):null!=a&&(a.classList.contains("e-control-wrapper")||a.classList.contains("e-wrapper"))?a.classList.remove(this.errorClass):s.classList.remove(this.errorClass),s.name.length>0&&(this.getInputElement(s.name),this.getErrorElement(s.name),this.hideMessage(s.name)),n.classList.contains("e-control-wrapper")||n.classList.contains("e-wrapper")||s.classList.contains("e-input")&&n.classList.contains("e-input-group")?n.classList.remove(this.validClass):null!=a&&(a.classList.contains("e-control-wrapper")||a.classList.contains("e-wrapper"))?a.classList.remove(this.validClass):s.classList.remove(this.validClass)}},s.prototype.createHTML5Rules=function(){for(var t=["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"],e=["hidden","email","url","date","number","tel"],i=0,s=this.inputElements;i<s.length;i++){for(var n=s[i],a={},r=0,l=t;r<l.length;r++){var o=l[r];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!==e.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(t,e,i,s){var n=i.split("-"),a=["required","creditcard","phone","maxlength","minlength","range","regex","equalto"],r=n[n.length-1],l=n[n.length-2];if(-1!==a.indexOf(r))switch(r){case"required":this.defRule(t,e,"required",s);break;case"creditcard":this.defRule(t,e,"creditcard",s);break;case"phone":this.defRule(t,e,"tel",s)}else if(-1!==a.indexOf(l))switch(l){case"maxlength":this.defRule(t,e,"maxLength",s);break;case"minlength":this.defRule(t,e,"minLength",s);break;case"range":var o=t.getAttribute("data-val-range-min"),h=t.getAttribute("data-val-range-max");this.defRule(t,e,"range",[o,h]);break;case"equalto":var u=t.getAttribute(i).split(".");this.defRule(t,e,"equalTo",u[u.length-1]);break;case"regex":this.defRule(t,e,"regex",s)}},s.prototype.defRule=function(t,e,i,s){var n,a=t.getAttribute("data-"+i+"-message"),r=t.getAttribute("data-val-"+i);this.rules[t.name]&&"validateHidden"!==i&&"hidden"!==i&&(this.getInputElement(t.name),n=this.getErrorMessage(this.rules[t.name][""+i],i)),a?s=[s,a]:r?s=[s,r]:n&&(s=[s,n]),e[""+i]=s},s.prototype.wireEvents=function(){for(var t=0,i=this.inputElements;t<i.length;t++){var s=i[t];n.isCheckable(s)?e.EventHandler.add(s,"click",this.clickHandler,this):"SELECT"===s.tagName?e.EventHandler.add(s,"change",this.changeHandler,this):(e.EventHandler.add(s,"focusout",this.focusOutHandler,this),e.EventHandler.add(s,"keyup",this.keyUpHandler,this))}e.EventHandler.add(this.element,"submit",this.submitHandler,this),e.EventHandler.add(this.element,"reset",this.resetHandler,this)},s.prototype.unwireEvents=function(){for(var t=0,i=this.inputElements;t<i.length;t++){var s=i[t];e.EventHandler.clearEvents(s)}e.EventHandler.remove(this.element,"submit",this.submitHandler),e.EventHandler.remove(this.element,"reset",this.resetHandler)},s.prototype.focusOutHandler=function(t){this.trigger("focusout",t);var e=t.target;this.rules[e.name]&&(this.rules[e.name][this.required]||e.value.length>0?this.validate(e.name):-1===this.validated.indexOf(e.name)&&this.validated.push(e.name))},s.prototype.keyUpHandler=function(t){this.trigger("keyup",t);var e=t.target,i=[16,17,18,20,35,36,37,38,39,40,45,144,225];(9!==t.which||this.rules[e.name]&&(!this.rules[e.name]||this.rules[e.name][this.required]))&&-1!==this.validated.indexOf(e.name)&&this.rules[e.name]&&-1===i.indexOf(t.which)&&this.validate(e.name)},s.prototype.clickHandler=function(t){this.trigger("click",t);var e=t.target;"submit"!==e.type?this.validate(e.name):null!==e.getAttribute("formnovalidate")&&(this.allowSubmit=!0)},s.prototype.changeHandler=function(t){this.trigger("change",t);var e=t.target;this.validate(e.name)},s.prototype.submitHandler=function(t){this.trigger("submit",t),this.allowSubmit||this.validate()?this.allowSubmit=!1:t.preventDefault()},s.prototype.resetHandler=function(){this.clearForm()},s.prototype.validateRules=function(t){if(this.rules[""+t]){var e=Object.keys(this.rules[""+t]),i=!1,s=!1,n=e.indexOf("validateHidden"),a=e.indexOf("hidden");if(this.getInputElement(t),-1!==a&&(i=!0),-1!==n&&(s=!0),!i||i&&s){-1!==n&&e.splice(n,1),-1!==a&&e.splice(a-1,1),this.getErrorElement(t);for(var r=0,l=e;r<l.length;r++){var o=l[r],h=this.getErrorMessage(this.rules[""+t][""+o],o),u={name:t,message:h},p={inputName:t,element:this.inputElement,message:h};if(!this.isValid(t,o)&&!this.inputElement.classList.contains(this.ignore)){this.removeErrorRules(t),this.errorRules.push(u),this.inputElement.setAttribute("aria-invalid","true"),this.inputElement.setAttribute("aria-describedby",this.inputElement.id+"-info");var d=this.inputElement.parentElement,c=d.parentElement;d.classList.contains("e-control-wrapper")||d.classList.contains("e-wrapper")||this.inputElement.classList.contains("e-input")&&d.classList.contains("e-input-group")?(d.classList.add(this.errorClass),d.classList.remove(this.validClass)):null!=c&&(c.classList.contains("e-control-wrapper")||c.classList.contains("e-wrapper"))?(c.classList.add(this.errorClass),c.classList.remove(this.validClass)):(this.inputElement.classList.add(this.errorClass),this.inputElement.classList.remove(this.validClass)),this.infoElement?this.showMessage(u):this.createErrorElement(t,u.message,this.inputElement),p.errorElement=this.infoElement,p.status="failure",d.classList.contains("e-control-wrapper")||d.classList.contains("e-wrapper")||this.inputElement.classList.contains("e-input")&&d.classList.contains("e-input-group")?(d.classList.add(this.errorClass),d.classList.remove(this.validClass)):null!=c&&(c.classList.contains("e-control-wrapper")||c.classList.contains("e-wrapper"))?(c.classList.add(this.errorClass),c.classList.remove(this.validClass)):(this.inputElement.classList.add(this.errorClass),this.inputElement.classList.remove(this.validClass)),this.optionalValidationStatus(t,p),this.trigger("validationComplete",p),"required"===o&&this.inputElement.setAttribute("aria-required","true");break}this.hideMessage(t),p.status="success",this.trigger("validationComplete",p)}}}},s.prototype.optionalValidationStatus=function(t,i){this.rules[""+t][this.required]||this.inputElement.value.length||e.isNullOrUndefined(this.infoElement)||(this.infoElement.innerHTML=this.inputElement.value,this.infoElement.setAttribute("aria-invalid","false"),i.status="",this.hideMessage(t))},s.prototype.isValid=function(t,i){var s=this.rules[""+t][""+i],a=s instanceof Array&&"string"==typeof s[1]?s[0]:s,r=this.rules[""+t][""+i],l="min"!==i&&"max"!==i||!this.rules[""+t].date||"string"!=typeof this.rules[""+t].date?null:this.rules[""+t].date,o={value:this.inputElement.value,param:a,element:this.inputElement,formElement:this.element,format:l,culture:this.locale};return this.trigger("validationBegin",o),!o.param&&"required"===i||(r&&"function"==typeof r[0]?r[0].call(this,{element:this.inputElement,value:this.inputElement.value}):n.isCheckable(this.inputElement)?"required"!==i||e.selectAll('input[name="'+t+'"]:checked',this.element).length>0:n.checkValidator[""+i](o))},s.prototype.getErrorMessage=function(t,i){var s=this.inputElement.getAttribute("data-"+i+"-message")?this.inputElement.getAttribute("data-"+i+"-message"):t instanceof Array&&"string"==typeof t[1]?t[1]:0!==Object.keys(this.localyMessage).length?this.localyMessage[""+i]:this.defaultMessages[""+i],n=s.match(/{(\d)}/g);if(!e.isNullOrUndefined(n))for(var a=0;a<n.length;a++){var r=t instanceof Array?t[parseInt(a.toString(),10)]:t;s=s.replace(n[parseInt(a.toString(),10)],r)}return s},s.prototype.createErrorElement=function(i,s,n){var a=e.createElement(this.errorElement,{className:this.errorClass,innerHTML:s,attrs:{for:i}});if(this.errorOption===t.ErrorOption.Message&&(a.classList.remove(this.errorClass),a.classList.add("e-message"),a=e.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 r=n.getAttribute("data-msg-containerid");e.select("#"+r,this.element).appendChild(a)}else if(null!=this.customPlacement)this.customPlacement.call(this,this.inputElement,a);else{var l=this.inputElement.parentElement,o=l.parentElement;l.classList.contains("e-control-wrapper")||l.classList.contains("e-wrapper")?o.insertBefore(a,l.nextSibling):o.classList.contains("e-control-wrapper")||o.classList.contains("e-wrapper")?o.parentElement.insertBefore(a,o.nextSibling):l.insertBefore(a,this.inputElement.nextSibling)}a.style.display="block",this.getErrorElement(i),this.validated.push(i),this.checkRequired(i)},s.prototype.getErrorElement=function(t){return this.infoElement=e.select(this.errorElement+"."+this.errorClass,this.inputElement.parentElement),this.infoElement||(this.infoElement=e.select(this.errorElement+"."+this.errorClass+'[for="'+t+'"]',this.element)),this.infoElement},s.prototype.removeErrorRules=function(t){for(var e=0;e<this.errorRules.length;e++)this.errorRules[parseInt(e.toString(),10)].name===t&&this.errorRules.splice(e,1)},s.prototype.showMessage=function(t){this.infoElement.style.display="block",this.infoElement.innerHTML=t.message,this.checkRequired(t.name)},s.prototype.hideMessage=function(t){if(this.infoElement){this.infoElement.style.display="none",this.removeErrorRules(t);var e=this.inputElement.parentElement,i=e.parentElement;e.classList.contains("e-control-wrapper")||e.classList.contains("e-wrapper")||this.inputElement.classList.contains("e-input")&&e.classList.contains("e-input-group")?(e.classList.add(this.validClass),e.classList.remove(this.errorClass)):null!=i&&(i.classList.contains("e-control-wrapper")||i.classList.contains("e-wrapper"))?(i.classList.add(this.validClass),i.classList.remove(this.errorClass)):(this.inputElement.classList.add(this.validClass),this.inputElement.classList.remove(this.errorClass)),this.inputElement.setAttribute("aria-invalid","false")}},s.prototype.checkRequired=function(t){this.rules[""+t][this.required]||this.inputElement.value.length||e.isNullOrUndefined(this.infoElement)||(this.infoElement.innerHTML=this.inputElement.value,this.infoElement.setAttribute("aria-invalid","false"),this.hideMessage(t))},s.isCheckable=function(t){var e=t.getAttribute("type");return e&&("checkbox"===e||"radio"===e||"submit"===e)};var n;return s.checkValidator={required:function(t){return isNaN(Date.parse(t.value))?t.value.toString().length>0:!isNaN(new Date(t.value).getTime())},email:function(t){return Pt.EMAIL.test(t.value)},url:function(t){return Pt.URL.test(t.value)},dateIso:function(t){return Pt.DATE_ISO.test(t.value)},tel:function(t){return Pt.PHONE.test(t.value)},creditcard:function(t){return Pt.CREDITCARD.test(t.value)},number:function(t){return!isNaN(Number(t.value))&&-1===String(t.value).indexOf(" ")},digits:function(t){return Pt.DIGITS.test(t.value)},maxLength:function(t){return t.value.length<=Number(t.param)},minLength:function(t){return t.value.length>=Number(t.param)},rangeLength:function(t){var e=t.param;return t.value.length>=e[0]&&t.value.length<=e[1]},range:function(t){var e=t.param;return!isNaN(Number(t.value))&&Number(t.value)>=e[0]&&Number(t.value)<=e[1]},date:function(t){if(e.isNullOrUndefined(t.param)||"string"!=typeof t.param||""===t.param)return!isNaN(new Date(t.value).getTime());var i=t.culture&&""!==t.culture?new e.Internationalization(t.culture):new e.Internationalization,s={format:t.param.toString(),type:"dateTime",skeleton:"yMd"},n=i.parseDate(t.value,s);return!e.isNullOrUndefined(n)&&n instanceof Date&&!isNaN(+n)},max:function(t){if(!isNaN(Number(t.value)))return+t.value<=+t.param;if(t.format&&""!==t.format){var i=t.culture&&""!==t.culture?new e.Internationalization(t.culture):new e.Internationalization,s={format:t.format.toString(),type:"dateTime",skeleton:"yMd"},n=i.parseDate(t.value,s),a="string"==typeof t.param?i.parseDate(JSON.parse(JSON.stringify(t.param)),s):t.param;return new Date(n).getTime()<=new Date(a).getTime()}return new Date(t.value).getTime()<=new Date(JSON.parse(JSON.stringify(t.param))).getTime()},min:function(t){if(isNaN(Number(t.value))){if(-1!==t.value.indexOf(",")){var i=t.value.replace(/,/g,"");return parseFloat(i)>=Number(t.param)}if(t.format&&""!==t.format){var s=t.culture&&""!==t.culture?new e.Internationalization(t.culture):new e.Internationalization,n={format:t.format.toString(),type:"dateTime",skeleton:"yMd"},a=s.parseDate(t.value,n),r="string"==typeof t.param?s.parseDate(JSON.parse(JSON.stringify(t.param)),n):t.param;return new Date(a).getTime()>=new Date(r).getTime()}return new Date(t.value).getTime()>=new Date(JSON.parse(JSON.stringify(t.param))).getTime()}return+t.value>=+t.param},regex:function(t){return new RegExp(t.param).test(t.value)},equalTo:function(t){var e=t.formElement.querySelector("#"+t.param);return t.param=e.value,t.param===t.value}},Tt([e.Property("")],s.prototype,"locale",void 0),Tt([e.Property("e-hidden")],s.prototype,"ignore",void 0),Tt([e.Property()],s.prototype,"rules",void 0),Tt([e.Property("e-error")],s.prototype,"errorClass",void 0),Tt([e.Property("e-valid")],s.prototype,"validClass",void 0),Tt([e.Property("label")],s.prototype,"errorElement",void 0),Tt([e.Property("div")],s.prototype,"errorContainer",void 0),Tt([e.Property(t.ErrorOption.Label)],s.prototype,"errorOption",void 0),Tt([e.Event()],s.prototype,"focusout",void 0),Tt([e.Event()],s.prototype,"keyup",void 0),Tt([e.Event()],s.prototype,"click",void 0),Tt([e.Event()],s.prototype,"change",void 0),Tt([e.Event()],s.prototype,"submit",void 0),Tt([e.Event()],s.prototype,"validationBegin",void 0),Tt([e.Event()],s.prototype,"validationComplete",void 0),Tt([e.Event()],s.prototype,"customPlacement",void 0),s=n=Tt([e.NotifyPropertyChanges],s)}(e.Base),Ot=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),wt=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},Lt="e-upload-file-list",At="e-file-status",Ht="e-file-remove-btn",Nt="e-file-delete-btn",Bt="e-file-abort-btn",It="e-file-reload-btn",Ut="e-upload-progress-wrap",Rt="e-upload-progress-bar",Vt="e-upload-success",Ft="e-upload-fails",Mt="e-file-pause-btn",Dt=["title","style","class"],zt=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Ot(i,t),wt([e.Property("")],i.prototype,"name",void 0),wt([e.Property(null)],i.prototype,"size",void 0),wt([e.Property("")],i.prototype,"type",void 0),i}(e.ChildProperty),Wt=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Ot(i,t),wt([e.Property("Browse...")],i.prototype,"browse",void 0),wt([e.Property("Upload")],i.prototype,"upload",void 0),wt([e.Property("Clear")],i.prototype,"clear",void 0),i}(e.ChildProperty),qt=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Ot(i,t),wt([e.Property("")],i.prototype,"saveUrl",void 0),wt([e.Property("")],i.prototype,"removeUrl",void 0),wt([e.Property(0)],i.prototype,"chunkSize",void 0),wt([e.Property(3)],i.prototype,"retryCount",void 0),wt([e.Property(500)],i.prototype,"retryAfterDelay",void 0),i}(e.ChildProperty),jt=function(t){function s(e,i){var s=t.call(this,e,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=e,s}return Ot(s,t),s.prototype.onPropertyChanged=function(t,i){for(var s=0,n=Object.keys(t);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=e.isNullOrUndefined(this.buttons.browse)?"":this.buttons.browse,this.buttons.clear=e.isNullOrUndefined(this.buttons.clear)?"":this.buttons.clear,this.buttons.upload=e.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.isReact?this.reRenderFileList():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=e.getValue("currentLocale",this.l10n);break;case"cssClass":this.setCSSClass(i.cssClass)}},s.prototype.setLocalizedTexts=function(){e.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&&!e.isNullOrUndefined(this.uploadWrapper.querySelector(".e-file-drop"))&&(this.uploadWrapper.querySelector(".e-file-drop").innerHTML=this.localizedTexts("dropFilesHint"))),this.updateFileList())},s.prototype.getKeyValue=function(t){for(var e,i=0,s=Object.keys(this.preLocaleObj);i<s.length;i++){var n=s[i];this.preLocaleObj[""+n]===t&&(e=n)}return e},s.prototype.updateFileList=function(){if(this.fileList.length>0&&!e.isNullOrUndefined(this.uploadWrapper.querySelector(".e-upload-files")))for(var t=0;t<this.fileList.length;t++)this.fileList[t].querySelector(".e-file-status").innerHTML=this.localizedTexts(this.getKeyValue(this.filesData[t].status)),this.filesData[t].status=this.localizedTexts(this.getKeyValue(this.filesData[t].status)),this.fileList[t].classList.contains(Vt)&&this.fileList[t].querySelector(".e-icons").setAttribute("title",this.localizedTexts("delete")),this.fileList[t].querySelector(".e-file-play-btn")&&this.fileList[t].querySelector(".e-icons").setAttribute("title",this.localizedTexts("resume")),this.fileList[t].querySelector(".e-file-remove-btn")&&this.fileList[t].querySelector(".e-icons").setAttribute("title",this.localizedTexts("remove")),this.fileList[t].querySelector(".e-file-reload-btn")&&this.fileList[t].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&&(e.detach(this.listParent),this.listParent=null,this.fileList=[],this.internalCreateFileList(this.filesData),this.actionButtons&&(this.removeActionButtons(),this.renderActionButtons(),this.checkActionButtonStatus()))},s.prototype.preRender=function(){this.localeText={Browse:"Browse...",Clear:"Clear",Upload:"Upload",invalidFileName:"File Name is not allowed",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 e.L10n("uploader",this.localeText,this.locale),this.preLocaleObj=e.getValue("currentLocale",this.l10n),this.formRendered(),this.updateHTMLAttrToElement(),this.checkHTMLAttributes(!1);var t=e.getValue("ej2_instances",this.element);if("EJS-UPLOADER"===this.element.tagName){var i=this.createElement("input",{attrs:{type:"file"}}),s=0;for(s;s<this.element.attributes.length;s++)"id"!==this.element.attributes[s].nodeName?i.setAttribute(this.element.attributes[s].nodeName,this.element.attributes[s].nodeValue):"id"===this.element.attributes[s].nodeName&&i.setAttribute(this.element.attributes[s].nodeName,e.getUniqueID("uploader")),i.innerHTML=this.element.innerHTML;i.hasAttribute("name")||i.setAttribute("name","UploadFiles"),this.element.appendChild(i),this.element=i,e.setValue("ej2_instances",t,this.element)}t[0].isPureReactComponent&&(e.isNullOrUndefined(t[0].props.name)?!e.isNullOrUndefined(t[0].props.id)&&e.isNullOrUndefined(t[0].props.name)?this.element.setAttribute("name",t[0].props.id):this.element.setAttribute("name","UploadFiles"):this.element.setAttribute("name",t[0].props.name)),e.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=e.Browser.info.name,this.uploaderName=this.element.getAttribute("name")},s.prototype.formRendered=function(){var t=e.closest(this.element,"form");if(!e.isNullOrUndefined(t))for(;t&&t!==document.documentElement;t=t.parentElement)"FORM"===t.tagName&&(this.isForm=!0,this.formElement=t,t.setAttribute("enctype","multipart/form-data"),t.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,"aria-label":this.localizedTexts("Upload")}}),this.clearButton=this.createElement("button",{className:"e-file-clear-btn e-css e-btn e-flat",attrs:{type:"button",tabindex:this.btnTabIndex,"aria-label":this.localizedTexts("Clear")}}),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(t){t&&!this.isForm&&(this.browseButton.blur(),this.actionButtons=t,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(){e.EventHandler.add(this.uploadButton,"click",this.uploadButtonClick,this),e.EventHandler.add(this.clearButton,"click",this.clearButtonClick,this)},s.prototype.unwireActionButtonEvents=function(){e.EventHandler.remove(this.uploadButton,"click",this.uploadButtonClick),e.EventHandler.remove(this.clearButton,"click",this.clearButtonClick)},s.prototype.removeActionButtons=function(){this.actionButtons&&(this.unwireActionButtonEvents(),e.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 t=e.isNullOrUndefined(this.buttons.upload)?"Upload":this.buttons.upload;this.buttons.upload=t,"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=e.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 t=this.createElement("span",{className:"e-file-select"});this.element.parentElement.insertBefore(t,this.element),this.dropAreaWrapper=this.createElement("div",{className:"e-file-select-wrap"}),this.element.parentElement.insertBefore(this.dropAreaWrapper,this.element),t.appendChild(this.element),this.dropAreaWrapper.appendChild(this.browseButton),this.dropAreaWrapper.appendChild(t),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.internalCreateFileList(this.filesData);if(e.isNullOrUndefined(this.files[0].size))return;this.isPreloadFiles=!0;var t=[].slice.call(this.files),i=[];this.multiple||(this.clearData(),t=[t[0]]);for(var s=0,n=t;s<n.length;s++){var a=n[s],r={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(r),this.filesData.push(r)}this.internalCreateFileList(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 t=this.uploadWrapper.querySelectorAll(".e-validation-fails").length+this.uploadWrapper.querySelectorAll(".e-upload-fails:not(.e-upload-progress)").length+this.uploadWrapper.querySelectorAll("span."+Vt).length+this.uploadWrapper.querySelectorAll("span.e-upload-progress").length;t>0&&t===this.uploadWrapper.querySelectorAll("li").length?this.uploadButton.setAttribute("disabled","disabled"):this.uploadButton.removeAttribute("disabled")}},s.prototype.setDropArea=function(){var t=this.dropAreaWrapper.querySelector(".e-file-drop");if(this.dropArea){this.dropZoneElement="string"!=typeof this.dropArea?this.dropArea:e.select(this.dropArea,document);for(var i=this.element,s=!1;i.parentNode;)(i=i.parentNode)===this.dropZoneElement&&(s=!0,t?t.innerHTML=this.localizedTexts("dropFilesHint"):this.createDropTextHint());!s&&t&&e.remove(t)}else e.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 t=this.dropAreaWrapper.querySelector(".e-file-drop");t&&e.remove(t)}},s.prototype.createDropTextHint=function(){var t=this.createElement("span",{className:"e-file-drop"});t.innerHTML=this.localizedTexts("dropFilesHint"),this.dropAreaWrapper.appendChild(t)},s.prototype.updateHTMLAttrToElement=function(){if(!e.isNullOrUndefined(this.htmlAttributes))for(var t=0,i=Object.keys(this.htmlAttributes);t<i.length;t++){var s=i[t];Dt.indexOf(s)<0&&this.element.setAttribute(s,this.htmlAttributes[""+s])}},s.prototype.updateHTMLAttrToWrapper=function(){if(!e.isNullOrUndefined(this.htmlAttributes))for(var t=0,i=Object.keys(this.htmlAttributes);t<i.length;t++){var s=i[t];if(Dt.indexOf(s)>-1)if("class"===s){var n=this.htmlAttributes[""+s].replace(/\s+/g," ").trim();""!==n&&e.addClass([this.uploadWrapper],n.split(" "))}else if("style"===s){var a=this.uploadWrapper.getAttribute(s);a=e.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 t=document.createAttribute("multiple");t.value="multiple",this.element.setAttributeNode(t)}else this.multiple||this.element.removeAttribute("multiple")},s.prototype.checkAutoUpload=function(t){this.autoUpload?(this.sequentialUpload?this.sequenceUpload(t):this.upload(t),this.removeActionButtons()):this.actionButtons||this.renderActionButtons(),this.checkActionButtonStatus()},s.prototype.sequenceUpload=function(t){if(this.filesData.length-t.length==0||"1"!==this.filesData[this.filesData.length-t.length-1].statusCode){(this.multiple||this.count<0)&&++this.count;var e=!this.showFileList;"object"==typeof this.filesData[this.count]?(this.isFirstFileOnSelection=!1,this.upload(this.filesData[this.count],e),"0"===this.filesData[this.count].statusCode&&this.sequenceUpload(t)):--this.count}},s.prototype.setCSSClass=function(t){var i=t;e.isNullOrUndefined(t)||(i=t.replace(/\s+/g," ").trim()),e.isNullOrUndefined(t)||""===i||e.removeClass([this.uploadWrapper],i.split(" "));var s=this.cssClass;e.isNullOrUndefined(this.cssClass)||""===this.cssClass||(s=this.cssClass.replace(/\s+/g," ").trim()),e.isNullOrUndefined(this.cssClass)||""===s||e.addClass([this.uploadWrapper],s.split(s.indexOf(",")>-1?",":" "))},s.prototype.wireEvents=function(){e.EventHandler.add(this.browseButton,"click",this.browseButtonClick,this),e.EventHandler.add(this.element,"change",this.onSelectFiles,this),e.EventHandler.add(document,"click",this.removeFocus,this),this.keyboardModule=new e.KeyboardEvents(this.uploadWrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.isForm&&e.EventHandler.add(this.formElement,"reset",this.resetForm,this)},s.prototype.unWireEvents=function(){e.EventHandler.remove(this.browseButton,"click",this.browseButtonClick),e.EventHandler.remove(this.element,"change",this.onSelectFiles),e.EventHandler.remove(document,"click",this.removeFocus),this.isForm&&e.EventHandler.remove(this.formElement,"reset",this.resetForm),this.keyboardModule&&this.keyboardModule.destroy()},s.prototype.resetForm=function(){this.clearAll()},s.prototype.keyActionHandler=function(t){var i=t.target;switch(t.action){case"enter":if(t.target===this.clearButton)this.clearButtonClick();else if(t.target===this.uploadButton)this.uploadButtonClick();else if(t.target===this.browseButton)this.browseButtonClick();else if(i.classList.contains(Mt))(s=this.getCurrentMetaData(null,t)).file.statusCode="4",s.file.status=this.localizedTexts("pauseUpload"),this.abortUpload(s,!1);else if(i.classList.contains("e-file-play-btn"))this.resumeUpload(this.getCurrentMetaData(null,t),t);else if(i.classList.contains(It)){var s=this.getCurrentMetaData(null,t);if(e.isNullOrUndefined(s)){var n=t.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(t),i.classList.contains(Bt)||this.browseButton.focus();t.preventDefault(),t.stopPropagation()}},s.prototype.getCurrentMetaData=function(t,i){var s,n;if(e.isNullOrUndefined(t)){var a=i.target.parentElement;s=this.filesData[this.fileList.indexOf(a)]}else s=t;for(var r=0;r<this.uploadMetaData.length;r++)this.uploadMetaData[r].file.name===s.name&&(n=this.uploadMetaData[r]);return n},s.prototype.removeFocus=function(){this.uploadWrapper&&this.listParent&&this.listParent.querySelector(".e-clear-icon-focus")&&(document.activeElement.blur(),this.listParent.querySelector(".e-clear-icon-focus").classList.remove("e-clear-icon-focus"))},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&&(e.EventHandler.add(this.dropZoneElement,"drop",this.dropElement,this),e.EventHandler.add(this.dropZoneElement,"dragover",this.dragHover,this),e.EventHandler.add(this.dropZoneElement,"dragleave",this.onDragLeave,this),e.EventHandler.add(this.dropZoneElement,"paste",this.onPasteFile,this),e.EventHandler.add(this.dropZoneElement,"dragenter",this.onDragEnter,this))},s.prototype.unBindDropEvents=function(){this.dropZoneElement&&(e.EventHandler.remove(this.dropZoneElement,"drop",this.dropElement),e.EventHandler.remove(this.dropZoneElement,"dragover",this.dragHover),e.EventHandler.remove(this.dropZoneElement,"dragleave",this.onDragLeave),e.EventHandler.remove(this.dropZoneElement,"dragenter",this.onDragEnter))},s.prototype.onDragEnter=function(t){this.enabled&&(this.dropZoneElement.classList.add("e-upload-drag-hover"),this.dragCounter=this.dragCounter+1,t.preventDefault(),t.stopPropagation())},s.prototype.onDragLeave=function(){this.enabled&&(this.dragCounter=this.dragCounter-1,this.dragCounter||this.dropZoneElement.classList.remove("e-upload-drag-hover"))},s.prototype.dragHover=function(t){this.enabled&&("Default"!==this.dropEffect&&(t.dataTransfer.dropEffect=this.dropEffect.toLowerCase()),t.preventDefault(),t.stopPropagation())},s.prototype.dropElement=function(t){this.dragCounter=0,this.dropZoneElement.classList.remove("e-upload-drag-hover"),this.onSelectFiles(t),t.preventDefault(),t.stopPropagation()},s.prototype.onPasteFile=function(t){var i=t.clipboardData.items;if("paste"===t.type&&"msie"!==this.browserName&&"edge"!==this.browserName&&"safari"!==this.browserName&&(this.element.files=t.clipboardData.files),1===i.length||this.multiple)for(var s=0;s<i.length;s++){var n=[].slice.call(i)[s];e.isNullOrUndefined(n.getAsFile())||"file"!==n.kind&&!n.type.match("^image/")||this.renderSelectedFiles(t,[n.getAsFile()],!1,!0)}},s.prototype.getSelectedFiles=function(t){for(var e=[],i=this.fileList[t],s=this.getFilesData(),n=+i.getAttribute("data-files-count"),a=0,r=0;r<t;r++)a+=+this.fileList[r].getAttribute("data-files-count");for(var l=a;l<a+n;l++)e.push(s[l]);return e},s.prototype.removeFiles=function(t){if(this.enabled){var s=t.target.parentElement,n=this.fileList.indexOf(s),a=this.fileList[n],r=this.isFormUpload(),l=r?this.getSelectedFiles(n):this.getFilesInArray(this.filesData[n]);if(!e.isNullOrUndefined(l)){if(t.target.classList.contains(Bt)&&!r){if(l[0].statusCode="5",!e.isNullOrUndefined(a)){var o=a.querySelector("."+Bt);i.createSpinner({target:o,width:"20px"}),i.showSpinner(o)}this.sequentialUpload&&this.uploadSequential(),a.classList.contains("e-restrict-retry")||this.checkActionComplete(!0)}else e.closest(t.target,".e-spinner-pane")||this.remove(l,!1,!1,!0,t);if(this.isForm&&a&&a.classList.contains("e-file-invalid")&&(this.element.value=""),this.checkActionButtonStatus(),this.actionButtons&&this.clearButton&&this.uploadWrapper){var h=this.uploadWrapper.querySelectorAll(".e-upload-progress-bar.e-upload-progress:not(.e-upload-success):not(.e-upload-fails)");1===h.length&&s.contains(h[0])&&this.clearButton.hasAttribute("disabled")&&this.clearButton.removeAttribute("disabled")}}}},s.prototype.removeFilesData=function(t,i){var s;if(i)return void(this.showFileList||(s=this.filesData.indexOf(t),this.filesData.splice(s,1)));var n=this.getLiElement(t);e.isNullOrUndefined(n)||(this.element.value="",e.detach(n),s=this.fileList.indexOf(n),this.fileList.splice(s,1),this.filesData.splice(s,1),0!==this.fileList.length||e.isNullOrUndefined(this.listParent)||(e.detach(this.listParent),this.listParent=null,this.removeActionButtons()),this.sequentialUpload&&s<=this.count&&--this.count)},s.prototype.removeUploadedFile=function(t,i,s,n){var a=this,r=t,l=new e.Ajax(this.asyncSettings.removeUrl,"POST",!0,null);l.emitError=!1;var o=new FormData;l.beforeSend=function(e){i.currentRequest=l.httpRequest,s?a.removingEventCallback(i,o,r,t):a.trigger("removing",i,function(i){i.cancel?e.cancel=!0:a.removingEventCallback(i,o,r,t)})},l.onLoad=function(t){return a.removeCompleted(t,r,n),{}},l.onError=function(t){return a.removeFailed(t,r,n),{}},l.send(o)},s.prototype.removingEventCallback=function(t,s,n,a){var r=this.element.getAttribute("name"),l=this.getLiElement(a);if(!(e.isNullOrUndefined(l)||e.isNullOrUndefined(l.querySelector("."+Nt))&&e.isNullOrUndefined(l.querySelector("."+Ht)))){var o=l.querySelector("."+Nt)?l.querySelector("."+Nt):l.querySelector("."+Ht);i.createSpinner({target:o,width:"20px"}),i.showSpinner(o)}t.postRawFile&&!e.isNullOrUndefined(n.rawFile)&&""!==n.rawFile?s.append(r,n.rawFile,n.name):s.append(r,n.name),this.updateFormData(s,t.customFormData)},s.prototype.updateFormData=function(t,e){if(e.length>0&&e[0])for(var i=0;i<e.length;i++)!function(i){var s=e[i],n=Object.keys(s).map(function(t){return s[""+t]});t.append(Object.keys(s)[0],n)}(i)},s.prototype.updateCustomheader=function(t,e){if(e.length>0&&e[0])for(var i=0;i<e.length;i++)!function(i){var s=e[i],n=Object.keys(s).map(function(t){return s[""+t]});t.setRequestHeader(Object.keys(s)[0],n)}(i)},s.prototype.removeCompleted=function(t,e,i){var s=t&&t.currentTarget?this.getResponse(t):null,n=t.target;if(4===n.readyState&&n.status>=200&&n.status<=299){var a={e:t,response:s,operation:"remove",file:this.updateStatus(e,this.localizedTexts("removedSuccessMessage"),"2")};this.trigger("success",a),this.removeFilesData(e,i);var r=this.uploadedFilesData.indexOf(e);this.uploadedFilesData.splice(r,1),this.trigger("change",{files:this.uploadedFilesData})}else this.removeFailed(t,e,i)},s.prototype.removeFailed=function(t,s,n){var a={e:t,response:t&&t.currentTarget?this.getResponse(t):null,operation:"remove",file:this.updateStatus(s,this.localizedTexts("removedFailedMessage"),"0")};if(!n){var r=this.filesData.indexOf(s),l=this.fileList[r];if(l){l.classList.remove(Vt),l.classList.add(Ft);var o=l.querySelector("."+At);o&&(o.classList.remove(Vt),o.classList.add(Ft))}this.checkActionButtonStatus()}this.trigger("failure",a);var h=this.getLiElement(s);if(!e.isNullOrUndefined(h)&&!e.isNullOrUndefined(h.querySelector("."+Nt))){var u=h.querySelector("."+Nt);i.hideSpinner(u),e.detach(h.querySelector(".e-spinner-pane"))}},s.prototype.getFilesFromFolder=function(t){this.filesEntries=[];var e=this.multiple?t.dataTransfer.items:[t.dataTransfer.items[0]];if(this.checkDirectoryUpload(e))for(var i=this,s=0;s<e.length;s++)!function(s){var n=e[s].webkitGetAsEntry();if(n.isFile){var a=[];n.file(function(t){var e=n.fullPath;a.push({path:e,file:t})}),i.renderSelectedFiles(t,a,!0)}else n.isDirectory&&i.traverseFileTree(n,t)}(s)},s.prototype.checkDirectoryUpload=function(t){for(var e=0;t&&e<t.length;e++)if(t[e].webkitGetAsEntry().isDirectory)return!0;return!1},s.prototype.traverseFileTree=function(t,e){if(t.isFile)this.filesEntries.push(t);else if(t.isDirectory){var i=t.createReader();this.readFileFromDirectory(i,e)}},s.prototype.readFileFromDirectory=function(t,e){var i=this;t.readEntries(function(s){for(var n=0;n<s.length;n++)i.traverseFileTree(s[n],e);i.pushFilesEntries(e),s.length&&i.readFileFromDirectory(t)})},s.prototype.pushFilesEntries=function(t){for(var e=this,i=[],s=this,n=0;n<this.filesEntries.length;n++)!function(n){s.filesEntries[n].file(function(s){if(e.filesEntries.length){var a=e.filesEntries[n].fullPath;i.push({path:a,file:s}),n===e.filesEntries.length-1&&(e.filesEntries=[],e.renderSelectedFiles(t,i,!0))}})}(n)},s.prototype.onSelectFiles=function(t){if(this.enabled){var e;if("drop"===t.type)if(this.directoryUpload)this.getFilesFromFolder(t);else{var i=this.sortFilesList=t.dataTransfer.files;"msie"!==this.browserName&&"edge"!==this.browserName&&"safari"!==this.browserName&&(this.element.files=i),i.length>0&&(e=this.multiple?this.sortFileList(i):[i[0]],this.renderSelectedFiles(t,e))}else e=[].slice.call(t.target.files),this.renderSelectedFiles(t,e);(this.isAngular||this.isReact)&&t.stopPropagation()}},s.prototype.getBase64=function(t){return new Promise(function(e,i){var s=new FileReader;s.readAsDataURL(t),s.onload=function(){return e(s.result)},s.onerror=function(t){return i(t)}})},s.prototype.renderSelectedFiles=function(t,i,s,n){var a=this;this.base64String=[];var r={event:t,cancel:!1,filesData:[],isModified:!1,modifiedFilesData:[],progressInterval:"",isCanceled:!1,currentRequest:null,customFormData:null};if(i.length<1)return r.isCanceled=!0,void this.trigger("selected",r);this.flag=!0;var l=[];this.multiple||(this.clearData(!0),this.actionCompleteCount=0,i=[i[0]]);for(h=0;h<i.length;h++){var o=s?i[h].file:i[h];this.updateInitialFileDetails(t,i,o,h,l,s,n)}if(r.filesData=l,!e.isNullOrUndefined(this.allowedExtensions)&&this.allowedExtensions.indexOf("*")>-1&&(this.allTypes=!0),this.enableHtmlSanitizer)for(var h=0;h<l.length;h++){for(var u=e.SanitizeHtmlHelper.beforeSanitize(),p=e.SanitizeHtmlHelper.serializeValue(u,l[parseInt(h.toString(),10)].name),d=l[parseInt(h.toString(),10)].name,c=!1,m=0;m<d.length;m++)if(d.charCodeAt(m)>127){c=!0;break}var v=/<([a-z][a-z0-9]*)\b[^>]*>(.*?)<\/\1>/i.test(d);if(p!==l[parseInt(h.toString(),10)].name&&(!c||v)){var f=i[parseInt(h.toString(),10)].name.replace(/[\u00A0-\u9999<>\\&]/g,function(t){return"&#"+t.charCodeAt(0)+";"});l[parseInt(h.toString(),10)].name=f,l[parseInt(h.toString(),10)].status=this.localizedTexts("invalidFileName"),l[parseInt(h.toString(),10)].statusCode="0"}}this.allTypes||(l=this.checkExtension(l)),this.trigger("selected",r,function(t){a._internalRenderSelect(t,l)})},s.prototype.updateInitialFileDetails=function(t,i,s,n,a,r,l){var o={name:r?i[n].path.substring(1,i[n].path.length):l?e.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:e.getUniqueID(s.name.substring(0,s.name.lastIndexOf(".")))+"."+this.getFileType(s.name)};l&&(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",this.checkActionComplete(!0)),a.push(o)},s.prototype._internalRenderSelect=function(t,i){if(!t.cancel){if(this.selectedFiles=this.selectedFiles.concat(i),this.btnTabIndex=this.disableKeyboardNavigation?"-1":"0",this.showFileList){if(t.isModified&&t.modifiedFilesData.length>0){for(var s=0;s<t.modifiedFilesData.length;s++)for(var n=0;n<i.length;n++)t.modifiedFilesData[s].id===i[n].id&&(t.modifiedFilesData[s].rawFile=i[n].rawFile);var a=this.allTypes?t.modifiedFilesData:this.checkExtension(t.modifiedFilesData);this.updateSortedFileList(a),this.filesData=this.filesData.concat(a),this.isForm&&!this.allowUpload()||this.checkAutoUpload(a)}else{if(this.internalCreateFileList(i),this.autoUpload&&this.sequenceUpload&&this.sequentialUpload&&this.filesData.length>0&&"2"!==this.filesData[this.filesData.length-1].statusCode&&"0"!==this.filesData[this.filesData.length-1].statusCode)return void(this.filesData=this.filesData.concat(i));this.filesData=this.filesData.concat(i),this.isForm&&!this.allowUpload()||this.checkAutoUpload(i)}e.isNullOrUndefined(t.progressInterval)||""===t.progressInterval||(this.progressInterval=t.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 t=!1;return this.isForm&&!e.isNullOrUndefined(this.asyncSettings.saveUrl)&&""!==this.asyncSettings.saveUrl&&(t=!0),t},s.prototype.isFormUpload=function(){var t=!1;return!this.isForm||!e.isNullOrUndefined(this.asyncSettings.saveUrl)&&""!==this.asyncSettings.saveUrl||!e.isNullOrUndefined(this.asyncSettings.removeUrl)&&""!==this.asyncSettings.removeUrl||(t=!0),t},s.prototype.clearData=function(t){e.isNullOrUndefined(this.listParent)||(e.detach(this.listParent),this.listParent=null),"msie"===this.browserName||t||(this.element.value=""),this.fileList=[],this.filesData=[],this.removeActionButtons()},s.prototype.updateSortedFileList=function(t){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))}this.removeActionButtons();var r=[].slice.call(i.childNodes);this.createParentUL();for(var l=0;l<t.length;l++){for(var o=0;o<this.filesData.length;o++)this.filesData[o].name===t[l].name&&(this.listParent.appendChild(r[o]),e.EventHandler.add(r[o].querySelector(".e-icons"),"click",this.removeFiles,this),this.fileList.push(r[o]),s=l);s!==l&&this.internalCreateFileList([t[l]])}}else this.internalCreateFileList(t)},s.prototype.isBlank=function(t){return!t||/^\s*$/.test(t)},s.prototype.checkGenericExtension=function(t,e){var i=[];switch(t.toLowerCase()){case"image/*":i.push("jpg","jpeg","png","gif","bmp","tiff","svg","webp","heic");break;case"audio/*":i.push("mp3","wav","aac","flac","ogg","m4a");break;case"video/*":i.push("mp4","mov","avi","mkv","flv","wmv","webm","mpeg");break;case"application/*":i.push("doc","docx","xls","xlsx","ppt","pptx","zip","rar","7z","tar","pdf");break;case"text/*":i.push("txt","csv","html","css","js","json","xml","md")}return i.includes(e.toLowerCase())},s.prototype.checkExtension=function(t){var i=t;if(!this.isBlank(this.allowedExtensions)){for(var s=[],n=0,a=e.isNullOrUndefined(s)?[""]:this.allowedExtensions.split(",");n<a.length;n++){var r=a[n];s.push(r.trim().toLocaleLowerCase())}for(var l=0;l<t.length;l++){var o=-1!==t[l].type.indexOf(".")?t[l].type.replace(".",""):t[l].type;-1!==s[0].indexOf("/*")?this.checkGenericExtension(s[0],o)||(t[l].status=this.localizedTexts("invalidFileType"),t[l].statusCode="0"):-1===s.indexOf(("."+o).toLocaleLowerCase())&&(t[l].status=this.localizedTexts("invalidFileType"),t[l].statusCode="0")}}return i},s.prototype.validatedFileSize=function(t){var e="",i="";return t<this.minFileSize?e=this.localizedTexts("invalidMinFileSize"):t>this.maxFileSize?i=this.localizedTexts("invalidMaxFileSize"):(e="",i=""),{minSize:e,maxSize:i}},s.prototype.isPreLoadFile=function(t){for(var e=!1,i=0;i<this.files.length;i++)this.files[i].name===t.name.slice(0,t.name.lastIndexOf("."))&&this.files[i].type===t.type&&(e=!0);return e},s.prototype.createCustomfileList=function(t){this.createParentUL();for(var i=0,s=t;i<s.length;i++){var n=s[i],a=this.createElement("li",{className:Lt,attrs:{"data-file-name":n.name}});this.uploadTemplateFn=this.templateComplier(this.template);var r=this.uploadTemplateFn(n,this,"template",this.element.id+"Template",this.isStringTemplate,null,a);if(r){var l=[].slice.call(r);e.append(l,a)}var o=t.indexOf(n),h={element:a,fileInfo:n,index:o,isPreload:this.isPreLoadFile(n)},u={element:a,fileInfo:n,index:o,isPreload:this.isPreLoadFile(n)};this.trigger("rendering",h),this.trigger("fileListRendering",u),this.listParent.appendChild(a),this.fileList.push(a)}this.renderReactTemplates()},s.prototype.createParentUL=function(){e.isNullOrUndefined(this.listParent)&&(this.listParent=this.createElement("ul",{className:"e-upload-files"}),this.uploadWrapper.appendChild(this.listParent))},s.prototype.formFileList=function(t,i){var s=this.createElement("li",{className:Lt});s.setAttribute("data-files-count",t.length+"");for(var n,a=this.createElement("span",{className:"e-file-container"}),r=0,l=t;r<l.length;r++){var o=l[r],h=this.createElement("span",{className:"e-file-name"});h.innerHTML=this.getFileNameOnly(o.name);var u=this.createElement("span",{className:"e-file-type"}),p=this.getFileType(o.name);if(u.innerHTML="."+p,p||u.classList.add("e-hidden"),this.enableRtl){var d=this.createElement("span",{className:"e-rtl-container"});d.appendChild(u),d.appendChild(h),a.appendChild(d)}else a.appendChild(h),a.appendChild(u);this.truncateName(h),n=this.formValidateFileInfo(o,s)}s.appendChild(a),this.setListToFileInfo(t,s);var c=this.listParent.querySelectorAll("li").length,m=this.createElement("span");if(s.classList.contains("e-file-invalid")?(m.classList.add(At),m.classList.add("e-file-invalid"),m.innerText=t.length>1?this.localizedTexts("invalidFileSelection"):n):(m.classList.add(t.length>1?"e-file-information":"e-file-size"),m.innerText=t.length>1?this.localizedTexts("totalFiles")+": "+t.length+" , "+this.localizedTexts("size")+": "+this.bytesToSize(this.getFileSize(t)):this.bytesToSize(t[0].size),this.createFormInput(t)),a.appendChild(m),e.isNullOrUndefined(s.querySelector(".e-icons"))){var v=this.createElement("span",{className:"e-icons",attrs:{tabindex:this.btnTabIndex}});"msie"===this.browserName&&v.classList.add("e-msie"),v.setAttribute("title",this.localizedTexts("remove")),s.appendChild(a),s.appendChild(v),e.EventHandler.add(v,"click",this.removeFiles,this),v.classList.add(Ht)}var f={element:s,fileInfo:this.mergeFileInfo(t,s),index:c,isPreload:this.isPreLoadFile(this.mergeFileInfo(t,s))},g={element:s,fileInfo:this.mergeFileInfo(t,s),index:c,isPreload:this.isPreLoadFile(this.mergeFileInfo(t,s))};this.trigger("rendering",f),this.trigger("fileListRendering",g),this.listParent.appendChild(s),this.fileList.push(s)},s.prototype.formValidateFileInfo=function(t,e){var i=t.status,s=this.validatedFileSize(t.size);""===s.minSize&&""===s.maxSize||(this.addInvalidClass(e),i=""!==s.minSize?this.localizedTexts("invalidMinFileSize"):""!==s.maxSize?this.localizedTexts("invalidMaxFileSize"):i);var n=this.checkExtension(this.getFilesInArray(t))[0].status;return n===this.localizedTexts("invalidFileType")&&(this.addInvalidClass(e),i=n),i},s.prototype.addInvalidClass=function(t){t.classList.add("e-file-invalid")},s.prototype.createFormInput=function(t){if("safari"!==this.browserName){var i=this.element.cloneNode(!0);i.classList.add("e-hidden-file-input");for(var s=0,n=t;s<n.length;s++)n[s].input=i;i.setAttribute("id",e.getUniqueID("hiddenUploader")),i.setAttribute("name",this.uploaderName),this.uploadWrapper.querySelector(".e-file-select").appendChild(i),"msie"!==this.browserName&&"edge"!==this.browserName&&(this.element.value="")}},s.prototype.getFileSize=function(t){for(var e=0,i=0,s=t;i<s.length;i++)e+=s[i].size;return e},s.prototype.mergeFileInfo=function(t,e){for(var i={name:"",rawFile:"",size:0,status:"",type:"",validationMessages:{minSize:"",maxSize:""},statusCode:"1",list:e},s=[],n="",a=0,r=t;a<r.length;a++){var l=r[a];s.push(l.name),n=l.type}return i.name=s.join(", "),i.size=this.getFileSize(t),i.type=n,i.status=this.statusForFormUpload(t,e),i},s.prototype.statusForFormUpload=function(t,e){for(var i,s=!0,n=0,a=t;n<a.length;n++){var r=a[n];i=r.status;var l=this.validatedFileSize(r.size);""===l.minSize&&""===l.maxSize||(s=!1,i=""!==l.minSize?this.localizedTexts("invalidMinFileSize"):""!==l.maxSize?this.localizedTexts("invalidMaxFileSize"):i);var o=this.checkExtension(this.getFilesInArray(r))[0].status;o===this.localizedTexts("invalidFileType")&&(s=!1,i=o)}return s?i=this.localizedTexts("totalFiles")+": "+t.length+" , "+this.localizedTexts("size")+": "+this.bytesToSize(this.getFileSize(t)):(e.classList.add("e-file-invalid"),i=t.length>1?this.localizedTexts("invalidFileSelection"):i),i},s.prototype.formCustomFileList=function(t,i){this.createParentUL();var s=this.createElement("li",{className:Lt});s.setAttribute("data-files-count",t.length+""),this.setListToFileInfo(t,s);var n=this.mergeFileInfo(t,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 r=[].slice.call(a);e.append(r,s)}var l=this.listParent.querySelectorAll("li").length;s.classList.contains("e-file-invalid")||this.createFormInput(t);var o={element:s,fileInfo:n,index:l,isPreload:this.isPreLoadFile(n)},h={element:s,fileInfo:n,index:l,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(t){this.filesData=this.filesData&&this.filesData.length>0?this.filesData.concat(t):t,this.internalCreateFileList(t)},s.prototype.internalCreateFileList=function(t){if(this.createParentUL(),""===this.template||e.isNullOrUndefined(this.template))if(this.isFormUpload())this.uploadWrapper.classList.add("e-form-upload"),this.formFileList(t,this.element.files);else for(var i=0,s=t;i<s.length;i++){var n=s[i],a=this.createElement("li",{className:Lt,attrs:{"data-file-name":n.name,"data-files-count":"1"}}),r=this.createElement("span",{className:"e-file-container"}),l=this.createElement("span",{className:"e-file-name",attrs:{title:n.name}});l.innerHTML=this.getFileNameOnly(n.name);var o=this.createElement("span",{className:"e-file-type"}),h=this.getFileType(n.name);if(o.innerHTML="."+h,h||o.classList.add("e-hidden"),this.enableRtl){var u=this.createElement("span",{className:"e-rtl-container"});u.appendChild(o),u.appendChild(l),r.appendChild(u)}else r.appendChild(l),r.appendChild(o);var p=this.createElement("span",{className:"e-file-size"});p.innerHTML=this.bytesToSize(n.size),r.appendChild(p);var d=this.createElement("span",{className:At});r.appendChild(d),d.innerHTML=n.status,a.appendChild(r);var c=this.createElement("span",{className:" e-icons",attrs:{tabindex:this.btnTabIndex}});"msie"===this.browserName&&c.classList.add("e-msie"),c.setAttribute("title",this.localizedTexts("remove")),a.appendChild(c),e.EventHandler.add(c,"click",this.removeFiles,this),"2"===n.statusCode?(d.classList.add(Vt),c.classList.add(Nt),c.setAttribute("title",this.localizedTexts("delete")),c.setAttribute("aria-label",this.localizedTexts("delete"))):"1"!==n.statusCode&&(d.classList.remove(Vt),d.classList.add("e-validation-fails")),this.autoUpload&&"1"===n.statusCode&&""!==this.asyncSettings.saveUrl&&(d.innerHTML=""),c.classList.contains(Nt)||(c.classList.add(Ht),c.setAttribute("aria-label",this.localizedTexts("remove")));var m=t.indexOf(n),v={element:a,fileInfo:n,index:m,isPreload:this.isPreLoadFile(n)},f={element:a,fileInfo:n,index:m,isPreload:this.isPreLoadFile(n)};this.trigger("rendering",v),this.trigger("fileListRendering",f),this.listParent.appendChild(a),this.fileList.push(a),this.truncateName(l);var g=this.flag;this.isPreLoadFile(n)&&(this.flag=!1,this.checkActionComplete(!0),this.flag=g)}else this.isFormUpload()?(this.uploadWrapper.classList.add("e-form-upload"),this.formCustomFileList(t,this.element.files)):this.createCustomfileList(t)},s.prototype.getSlicedName=function(t){var e=t.textContent;t.dataset.tail=e.slice(e.length-10)},s.prototype.setListToFileInfo=function(t,e){for(var i=0,s=t;i<s.length;i++)s[i].list=e},s.prototype.truncateName=function(t){var e=t;"edge"!==this.browserName&&e.offsetWidth<e.scrollWidth?this.getSlicedName(e):e.offsetWidth+1<e.scrollWidth&&this.getSlicedName(e)},s.prototype.getFileType=function(t){var e,i=t.lastIndexOf(".");return i>=0&&(e=t.substring(i+1)),e||""},s.prototype.getFileNameOnly=function(t){var e=this.getFileType(t);return e=t.split("."+e)[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 t=document.createAttribute("multiple");this.element.setAttributeNode(t)}},s.prototype.filterfileList=function(t){for(var i,s=[],n=0;n<t.length;n++)i=this.getLiElement(t[n]),e.isNullOrUndefined(i)||i.classList.contains(Vt)?this.showFileList||"File uploaded successfully"===t[n].status||s.push(t[n]):s.push(t[n]);return s},s.prototype.updateStatus=function(t,i,s,n){if(void 0===n&&(n=!0),""===i||e.isNullOrUndefined(i)||""===s||e.isNullOrUndefined(s)||(t.status=i,t.statusCode=s),n){var a=this.getLiElement(t);e.isNullOrUndefined(a)||e.isNullOrUndefined(a.querySelector("."+At))||""===i||e.isNullOrUndefined(i)||(a.querySelector("."+At).textContent=i)}return t},s.prototype.getLiElement=function(t){for(var i,s=0;s<this.filesData.length;s++)e.isNullOrUndefined(t)||(e.isNullOrUndefined(this.filesData[s].id)||e.isNullOrUndefined(t.id)?this.filesData[s].name!==t.name:this.filesData[s].name!==t.name||this.filesData[s].id!==t.id)||(i=s);return this.fileList[i]},s.prototype.createProgressBar=function(t){var e=this.createElement("span",{className:Ut}),i=this.createElement("progressbar",{className:Rt,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:"e-progress-bar-text"});n.textContent="0%",s.appendChild(i),e.appendChild(s),e.appendChild(n),t.querySelector(".e-file-container").appendChild(e)},s.prototype.updateProgressbar=function(t,i){if(!isNaN(Math.round(t.loaded/t.total*100))&&!e.isNullOrUndefined(i.querySelector("."+Rt)))if(e.isNullOrUndefined(this.progressInterval)||""===this.progressInterval)this.changeProgressValue(i,Math.round(t.loaded/t.total*100).toString()+"%");else{var s=Math.round(t.loaded/t.total*100)%parseInt(this.progressInterval,10);0!==s&&100!==s||this.changeProgressValue(i,Math.round(t.loaded/t.total*100).toString()+"%")}},s.prototype.changeProgressValue=function(t,e){t.querySelector("."+Rt).setAttribute("style","width:"+e),t.querySelector(".e-progress-bar-text").textContent=e},s.prototype.uploadInProgress=function(t,i,s,n){var a=this.getLiElement(i);if(!e.isNullOrUndefined(a)||s){if(e.isNullOrUndefined(a))this.cancelUploadingFile(i,t,n);else{"5"===i.statusCode&&this.cancelUploadingFile(i,t,n,a),a.querySelectorAll("."+Ut).length>0||!a.querySelector("."+At)||(a.querySelector("."+At).classList.add("e-upload-progress"),this.createProgressBar(a),this.updateProgressBarClasses(a,"e-upload-progress"),a.querySelector("."+At).classList.remove(Ft)),this.updateProgressbar(t,a);var r=a.querySelector("."+Ht);e.isNullOrUndefined(r)||(r.classList.add(Bt,"e-upload-progress"),r.setAttribute("title",this.localizedTexts("abort")),r.classList.remove(Ht))}var l={e:t,operation:"upload",file:this.updateStatus(i,this.localizedTexts("inProgress"),"3")};this.trigger("progress",l)}},s.prototype.cancelUploadingFile=function(t,s,n,a){var r=this;if("5"===t.statusCode){var l={event:s,fileData:t,cancel:!1,customFormData:[],currentRequest:null};this.trigger("canceling",l,function(s){if(s.cancel){if(t.statusCode="3",!e.isNullOrUndefined(a)){var l=a.querySelector("."+Bt);e.isNullOrUndefined(l)||(i.hideSpinner(l),e.detach(a.querySelector(".e-spinner-pane")))}}else{n.emitError=!1,n.httpRequest.abort();var o=new FormData;if("5"===t.statusCode){var h=r.element.getAttribute("name");o.append(h,t.name),o.append("cancel-uploading",t.name),r.updateFormData(o,s.customFormData);var u=new e.Ajax(r.asyncSettings.removeUrl,"POST",!0,null);u.emitError=!1,u.beforeSend=function(t){s.currentRequest&&r.updateCustomheader(u.httpRequest,s.currentRequest)},u.onLoad=function(e){return r.removecanceledFile(e,t),{}},u.send(o)}}})}},s.prototype.removecanceledFile=function(t,s){var n=this.getLiElement(s);if(!(e.isNullOrUndefined(n)||n.querySelector("."+It)||e.isNullOrUndefined(n.querySelector("."+Bt)))){this.updateStatus(s,this.localizedTexts("fileUploadCancel"),"5"),this.renderFailureState(t,s,n);var a=n.querySelector("."+Ht);e.isNullOrUndefined(n)||(i.hideSpinner(a),e.isNullOrUndefined(n.querySelector(".e-spinner-pane"))||e.detach(n.querySelector(".e-spinner-pane")));var r={event:t,response:t&&t.currentTarget?this.getResponse(t):null,operation:"cancel",file:s};this.trigger("success",r)}},s.prototype.renderFailureState=function(t,i,s){var n=this;this.updateProgressBarClasses(s,Ft),this.removeProgressbar(s,"failure"),e.isNullOrUndefined(s.querySelector(".e-file-status"))||s.querySelector(".e-file-status").classList.add(Ft);var a=s.querySelector("."+Bt);e.isNullOrUndefined(a)||(a.classList.remove(Bt,"e-upload-progress"),a.classList.add(Ht),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")),this.pauseButton.setAttribute("aria-label",this.localizedTexts("retry")),s.querySelector("."+It).addEventListener("click",function(t){n.reloadcanceledFile(t,i,s,!1)},!1))},s.prototype.reloadcanceledFile=function(t,i,s,n){i.statusCode="1",i.status=this.localizedTexts("readyToUploadMessage"),n||(e.isNullOrUndefined(s.querySelector("."+At))||s.querySelector("."+At).classList.remove(Ft),e.isNullOrUndefined(s.querySelector("."+It))||e.detach(s.querySelector("."+It)),this.pauseButton=null),e.isNullOrUndefined(s)||s.classList.add("e-restrict-retry"),this.upload([i])},s.prototype.uploadComplete=function(t,i,s){var n=t.target;if(4===n.readyState&&n.status>=200&&n.status<=299){var a=this.getLiElement(i);if(e.isNullOrUndefined(a)&&(!s||e.isNullOrUndefined(s))&&this.showFileList)return;if(!e.isNullOrUndefined(a)){this.updateProgressBarClasses(a,Vt),this.removeProgressbar(a,"success");var r=a.querySelector("."+Bt);e.isNullOrUndefined(r)||(r.classList.add(Nt),r.setAttribute("title",this.localizedTexts("delete")),r.setAttribute("aria-label",this.localizedTexts("delete")),r.classList.remove(Bt),r.classList.remove("e-upload-progress"))}this.raiseSuccessEvent(t,i)}else this.uploadFailed(t,i)},s.prototype.getResponse=function(t){var e=t.currentTarget;return{readyState:e.readyState,statusCode:e.status,statusText:e.statusText,headers:e.getAllResponseHeaders(),withCredentials:e.withCredentials}},s.prototype.raiseSuccessEvent=function(t,s){var n=this,a=t&&t.currentTarget?this.getResponse(t):null,r=this.localizedTexts("uploadSuccessMessage"),l={e:t,response:a,operation:"upload",file:this.updateStatus(s,r,"2",!1),statusText:r},o=this.getLiElement(s);if(!e.isNullOrUndefined(o)){var h=o.querySelector(".e-spinner-pane");e.isNullOrUndefined(h)||(i.hideSpinner(o),e.detach(h))}this.trigger("success",l,function(t){n.updateStatus(s,t.statusText,"2"),n.multiple?n.uploadedFilesData.push(s):n.uploadedFilesData=[s],n.trigger("change",{file:n.uploadedFilesData}),n.checkActionButtonStatus(),n.fileList.length>0?n.getLiElement(s).classList.contains("e-restrict-retry")?n.getLiElement(s).classList.remove("e-restrict-retry"):(n.uploadSequential(),n.checkActionComplete(!0)):n.showFileList||n.checkActionComplete(!0)})},s.prototype.uploadFailed=function(t,i){var s=this,n=this.getLiElement(i),a=t&&t.currentTarget?this.getResponse(t):null,r=this.localizedTexts("uploadFailedMessage"),l={e:t,response:a,operation:"upload",file:this.updateStatus(i,r,"0",!1),statusText:r};e.isNullOrUndefined(n)||this.renderFailureState(t,i,n),this.trigger("failure",l,function(t){s.updateStatus(i,t.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(t){t?++this.actionCompleteCount:--this.actionCompleteCount,this.raiseActionComplete()},s.prototype.raiseActionComplete=function(){if(this.filesData.length===this.actionCompleteCount&&this.flag){this.flag=!1;var t={fileData:[]};t.fileData=this.getSelectedFileStatus(this.selectedFiles),this.trigger("actionComplete",t)}},s.prototype.getSelectedFileStatus=function(t){for(var e=[],i=0,s=0;s<t.length;s++)for(var n=t[s],a=0;a<this.filesData.length;a++)if(this.filesData[a].name===n.name&&this.filesData[a].status===n.status){e[i]=this.filesData[a],++i;break}return e},s.prototype.updateProgressBarClasses=function(t,i){var s=t.querySelector("."+Rt);e.isNullOrUndefined(s)||(s.classList.add(i),this.actionButtons&&this.clearButton&&this.uploadWrapper&&("e-upload-progress"!==i||this.clearButton.hasAttribute("disabled")?"e-upload-success"!==i&&"e-upload-fails"!==i||0!==this.uploadWrapper.querySelectorAll(".e-upload-progress-bar.e-upload-progress:not(.e-upload-success):not(.e-upload-fails)").length||!this.clearButton.hasAttribute("disabled")||this.clearButton.removeAttribute("disabled"):this.clearButton.setAttribute("disabled","disabled")))},s.prototype.removeProgressbar=function(t,i){var s=this;e.isNullOrUndefined(t.querySelector("."+Ut))||(this.progressAnimation=new e.Animation({duration:1250}),this.progressAnimation.animate(t.querySelector("."+Ut),{name:"FadeOut"}),this.progressAnimation.animate(t.querySelector(".e-progress-bar-text"),{name:"FadeOut"}),setTimeout(function(){s.animateProgressBar(t,i)},750))},s.prototype.animateProgressBar=function(t,i){"success"===i?(t.classList.add(Vt),e.isNullOrUndefined(t.querySelector("."+At))||(t.querySelector("."+At).classList.remove("e-upload-progress"),this.progressAnimation.animate(t.querySelector("."+At),{name:"FadeIn"}),t.querySelector("."+At).classList.add(Vt))):e.isNullOrUndefined(t.querySelector("."+At))||(t.querySelector("."+At).classList.remove("e-upload-progress"),this.progressAnimation.animate(t.querySelector("."+At),{name:"FadeIn"}),t.querySelector("."+At).classList.add(Ft)),t.querySelector("."+Ut)&&e.detach(t.querySelector("."+Ut))},s.prototype.setExtensions=function(t){""===t||e.isNullOrUndefined(t)?this.element.removeAttribute("accept"):this.element.setAttribute("accept",t)},s.prototype.templateComplier=function(t){if(t)try{return"function"!=typeof t&&e.selectAll(t,document).length?e.compile(e.select(t,document).innerHTML.trim()):e.compile(t)}catch(i){return e.compile(t)}},s.prototype.setRTL=function(){this.enableRtl?e.addClass([this.uploadWrapper],"e-rtl"):e.removeClass([this.uploadWrapper],"e-rtl")},s.prototype.localizedTexts=function(t){return this.l10n.setLocale(this.locale),this.l10n.getConstant(t)},s.prototype.setControlStatus=function(){this.enabled?(this.uploadWrapper.classList.contains("e-disabled")&&this.uploadWrapper.classList.remove("e-disabled"),!e.isNullOrUndefined(this.browseButton)&&this.element.hasAttribute("disabled")&&(this.element.removeAttribute("disabled"),this.browseButton.removeAttribute("disabled")),!e.isNullOrUndefined(this.clearButton)&&this.clearButton.hasAttribute("disabled")&&this.clearButton.removeAttribute("disabled"),!e.isNullOrUndefined(this.uploadButton)&&this.uploadButton.hasAttribute("disabled")&&this.uploadButton.hasAttribute("disabled")):(this.uploadWrapper.classList.add("e-disabled"),this.element.setAttribute("disabled","disabled"),this.browseButton.setAttribute("disabled","disabled"),e.isNullOrUndefined(this.clearButton)||this.clearButton.setAttribute("disabled","disabled"),e.isNullOrUndefined(this.uploadButton)||this.uploadButton.setAttribute("disabled","disabled"))},s.prototype.checkHTMLAttributes=function(t){for(var i=0,s=t?e.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["accept","multiple","disabled"];i<s.length;i++){var n=s[i];if(!e.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"accept":(e.isNullOrUndefined(this.uploaderOptions)||void 0===this.uploaderOptions.allowedExtensions||t)&&(this.setProperties({allowedExtensions:this.element.getAttribute("accept")},!t),this.initialAttr.accept=this.allowedExtensions);break;case"multiple":if(e.isNullOrUndefined(this.uploaderOptions)||void 0===this.uploaderOptions.multiple||t){var a="multiple"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n);this.setProperties({multiple:a},!t),this.initialAttr.multiple=!0}break;case"disabled":if(e.isNullOrUndefined(this.uploaderOptions)||void 0===this.uploaderOptions.enabled||t){var r="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n);this.setProperties({enabled:r},!t),this.initialAttr.disabled=!0}}}},s.prototype.chunkUpload=function(t,e,i){var s=Math.min(this.asyncSettings.chunkSize,t.size),n={chunkIndex:0,blob:t.rawFile.slice(0,s),file:t,start:0,end:s,retryCount:0,request:null};this.sendRequest(t,n,e,i)},s.prototype.sendRequest=function(t,i,s,n){var a=this,r=new FormData,l=t.rawFile.slice(i.start,i.end);r.append(this.uploaderName,l,t.name),r.append("chunk-index",i.chunkIndex.toString()),r.append("chunkIndex",i.chunkIndex.toString());var o=Math.max(Math.ceil(t.size/this.asyncSettings.chunkSize),1);r.append("total-chunk",o.toString()),r.append("totalChunk",o.toString());var h=new e.Ajax({url:this.asyncSettings.saveUrl,type:"POST",async:!0,contentType:null});h.emitError=!1,h.onLoad=function(t){return a.chunkUploadComplete(t,i,s),{}},h.onUploadProgress=function(t){return a.chunkUploadInProgress(t,i,s),{}};var u={fileData:t,customFormData:[],cancel:!1,chunkSize:0===this.asyncSettings.chunkSize?null:this.asyncSettings.chunkSize};h.beforeSend=function(e){u.currentRequest=h.httpRequest,u.currentChunkIndex=i.chunkIndex,0===u.currentChunkIndex?a.trigger("uploading",u,function(i){a.uploadingEventCallback(r,i,e,t)}):a.trigger("chunkUploading",u,function(i){a.uploadingEventCallback(r,i,e,t)})},h.onError=function(t){return a.chunkUploadFailed(t,i,s),{}},h.send(r),i.request=h},s.prototype.uploadingEventCallback=function(t,e,i,s){e.cancel?this.eventCancelByArgs(i,e,s):this.updateFormData(t,e.customFormData)},s.prototype.eventCancelByArgs=function(t,i,s){var n=this;if(t.cancel=!0,"5"!==i.fileData.statusCode){i.fileData.statusCode="5",i.fileData.status=this.localizedTexts("fileUploadCancel");var a=this.getLiElement(i.fileData);if(a){e.isNullOrUndefined(a.querySelector("."+At))||(a.querySelector("."+At).innerHTML=this.localizedTexts("fileUploadCancel"),a.querySelector("."+At).classList.add(Ft)),this.pauseButton=this.createElement("span",{className:"e-icons e-file-reload-btn",attrs:{tabindex:this.btnTabIndex}});var r=a.querySelector("."+Ht);r&&r.parentElement.insertBefore(this.pauseButton,r),this.pauseButton.setAttribute("title",this.localizedTexts("retry")),this.pauseButton.addEventListener("click",function(t){n.reloadcanceledFile(t,s,a)},!1),this.checkActionButtonStatus()}}},s.prototype.checkChunkUpload=function(){return!(this.asyncSettings.chunkSize<=0||e.isNullOrUndefined(this.asyncSettings.chunkSize))},s.prototype.chunkUploadComplete=function(t,s,n){var a,r=this,l=t.target;if(4===l.readyState&&l.status>=200&&l.status<300){var o=t&&t.currentTarget?this.getResponse(t):null,h=Math.max(Math.ceil(s.file.size/this.asyncSettings.chunkSize),1),u={event:t,file:s.file,chunkIndex:s.chunkIndex,totalChunk:h,chunkSize:this.asyncSettings.chunkSize,response:o};if(this.trigger("chunkSuccess",u),!e.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 p={event:t,fileData:s.file,cancel:!1,customFormData:[]};this.trigger("canceling",p,function(t){if(t.cancel){s.file.statusCode="3";var o=a.querySelector("."+Bt);e.isNullOrUndefined(a)||e.isNullOrUndefined(o)||(i.hideSpinner(o),e.detach(a.querySelector(".e-spinner-pane"))),r.sendNextRequest(s)}else{s.request.emitError=!1,l.abort();var h=new FormData,u=r.element.getAttribute("name");h.append(u,s.file.name),h.append("cancel-uploading",s.file.name),h.append("cancelUploading",s.file.name),r.updateFormData(h,t.customFormData);var p=new e.Ajax(r.asyncSettings.removeUrl,"POST",!0,null);p.emitError=!1,p.onLoad=function(t){return r.removeChunkFile(t,s,n),{}},p.send(h)}})}else{if(h-1===s.chunkIndex&&h>s.chunkIndex){var d=this.pausedData.indexOf(s);return d>=0&&this.pausedData.splice(d,1),e.isNullOrUndefined(this.template)&&(e.isNullOrUndefined(n)||!n)&&a&&(a&&!e.isNullOrUndefined(a.querySelector("."+Mt))&&e.detach(a.querySelector("."+Mt)),this.removeChunkProgressBar(s)),void this.raiseSuccessEvent(t,s.file)}"4"!==s.file.statusCode&&this.sendNextRequest(s)}}else this.chunkUploadFailed(t,s)},s.prototype.sendNextRequest=function(t){t.start=t.end,t.end+=this.asyncSettings.chunkSize,t.end=Math.min(t.end,t.file.size),t.chunkIndex+=1,this.sendRequest(t.file,t)},s.prototype.removeChunkFile=function(t,s,n){if(e.isNullOrUndefined(this.template)&&e.isNullOrUndefined(n)&&!n){var a=this.getLiElement(s.file),r=a.querySelector("."+Bt),l=r;this.updateStatus(s.file,this.localizedTexts("fileUploadCancel"),"5"),this.updateProgressBarClasses(a,Ft),this.removeProgressbar(a,"failure"),r&&(r.classList.remove(Bt),r.classList.add(Ht),r.setAttribute("title",this.localizedTexts("remove")));var o=a.querySelector("."+Mt);o&&(o.classList.add(It),o.classList.remove(Mt),o.setAttribute("title",this.localizedTexts("retry"))),e.isNullOrUndefined(a)||e.isNullOrUndefined(r)||e.isNullOrUndefined(a.querySelector(".e-spinner-pane"))||(i.hideSpinner(l),e.detach(a.querySelector(".e-spinner-pane")))}},s.prototype.pauseUpload=function(t,e,i){t.file.statusCode="4",t.file.status=this.localizedTexts("pause"),this.updateMetaData(t);var s={event:e||null,file:t.file,chunkIndex:t.chunkIndex,chunkCount:Math.round(t.file.size/this.asyncSettings.chunkSize),chunkSize:this.asyncSettings.chunkSize};this.abortUpload(t,i,s),this.sequentialUpload&&this.uploadSequential()},s.prototype.abortUpload=function(t,i,s){"4"!==t.file.statusCode&&(t.request.emitError=!1,t.request.httpRequest.abort());var n=this.getLiElement(t.file);if(e.isNullOrUndefined(this.template)&&(e.isNullOrUndefined(i)||!i)&&n){var a=n.querySelector("."+Mt);a.classList.remove(Mt),a.classList.add("e-file-play-btn"),a.setAttribute("title",this.localizedTexts("resume")),a.nextElementSibling.classList.add(Ht),a.nextElementSibling.classList.remove(Bt),a.nextElementSibling.setAttribute("title",this.localizedTexts("remove"))}for(var r=0;r<this.pausedData.length;r++)this.pausedData[r].file.name===t.file.name&&this.pausedData.splice(r,1);this.pausedData.push(t),this.trigger("pausing",s)},s.prototype.resumeUpload=function(t,i,s){var n,a=this.getLiElement(t.file);e.isNullOrUndefined(a)||(n=a.querySelector(".e-file-play-btn")),e.isNullOrUndefined(n)||!e.isNullOrUndefined(s)&&s||(n.classList.remove("e-file-play-btn"),n.classList.add(Mt),n.setAttribute("title",this.localizedTexts("pause")),n.nextElementSibling.classList.remove(Ht),n.nextElementSibling.classList.add(Bt),n.nextElementSibling.setAttribute("title",this.localizedTexts("abort"))),t.file.status=this.localizedTexts("inProgress"),t.file.statusCode="3",this.updateMetaData(t);var r={event:i||null,file:t.file,chunkIndex:t.chunkIndex,chunkCount:Math.round(t.file.size/this.asyncSettings.chunkSize),chunkSize:this.asyncSettings.chunkSize};this.trigger("resuming",r);for(var l=0;l<this.pausedData.length;l++)this.pausedData[l].end===this.pausedData[l].file.size?this.chunkUploadComplete(i,t,s):this.pausedData[l].file.name===t.file.name&&(this.pausedData[l].start=this.pausedData[l].end,this.pausedData[l].end=this.pausedData[l].end+this.asyncSettings.chunkSize,this.pausedData[l].end=Math.min(this.pausedData[l].end,this.pausedData[l].file.size),this.pausedData[l].chunkIndex=this.pausedData[l].chunkIndex+1,this.sendRequest(this.pausedData[l].file,this.pausedData[l],s))},s.prototype.updateMetaData=function(t){-1===this.uploadMetaData.indexOf(t)?this.uploadMetaData.push(t):(this.uploadMetaData.splice(this.uploadMetaData.indexOf(t),1),this.uploadMetaData.push(t))},s.prototype.removeChunkProgressBar=function(t){var i=this.getLiElement(t.file);if(!e.isNullOrUndefined(i)){this.updateProgressBarClasses(i,Vt),this.removeProgressbar(i,"success");var s=i.querySelector("."+Bt);e.isNullOrUndefined(s)||(s.classList.add(Nt),s.setAttribute("title",this.localizedTexts("delete")),s.classList.remove(Bt,"e-upload-progress"))}},s.prototype.chunkUploadFailed=function(t,i,s){var n,a=this,r=Math.max(Math.ceil(i.file.size/this.asyncSettings.chunkSize),1);!e.isNullOrUndefined(this.template)||!e.isNullOrUndefined(s)&&s||(n=this.getLiElement(i.file));var l=t&&t.currentTarget?this.getResponse(t):null,o={event:t,file:i.file,chunkIndex:i.chunkIndex,totalChunk:r,chunkSize:this.asyncSettings.chunkSize,cancel:!1,response:l};this.trigger("chunkFailure",o,function(r){if(!r.cancel)if(i.retryCount<a.asyncSettings.retryCount)setTimeout(function(){a.retryRequest(n,i,s)},a.asyncSettings.retryAfterDelay);else{if(!e.isNullOrUndefined(n)){var o=n.querySelector("."+Mt)?n.querySelector("."+Mt):n.querySelector(".e-file-play-btn");e.isNullOrUndefined(o)||(o.classList.add(It),o.classList.remove(Mt,"e-file-play-btn")),a.updateProgressBarClasses(n,Ft),a.removeProgressbar(n,"failure"),n.querySelector(".e-icons").classList.remove("e-upload-progress");var h=n.querySelector("."+Bt)?n.querySelector("."+Bt):n.querySelector("."+Ht);h.classList.remove(Bt),e.isNullOrUndefined(n.querySelector("."+Mt))||e.detach(n.querySelector("."+Mt)),i.start>0?(h.classList.add(Nt),h.setAttribute("title",a.localizedTexts("delete"))):(h.classList.add(Ht),h.setAttribute("title",a.localizedTexts("remove")))}i.retryCount=0;var u=i.file,p=a.localizedTexts("uploadFailedMessage"),d={e:t,response:l,operation:"upload",file:a.updateStatus(u,p,"0",!1),statusText:p};a.trigger("failure",d,function(t){a.updateStatus(u,t.statusText,"0"),a.uploadSequential(),a.checkActionComplete(!0)})}})},s.prototype.retryRequest=function(t,i,s){e.isNullOrUndefined(this.template)&&(e.isNullOrUndefined(s)||!s)&&t&&this.updateProgressBarClasses(t,Ft),i&&(i.retryCount+=1,this.sendRequest(i.file,i))},s.prototype.checkPausePlayAction=function(t){var e=t.target,i=t.target.parentElement,s=this.fileList.indexOf(i),n=this.filesData[s],a=this.getCurrentMetaData(n);e.classList.contains(Mt)?this.pauseUpload(a,t):e.classList.contains("e-file-play-btn")?this.resumeUpload(a,t):e.classList.contains(It)&&(a.file.status===this.localizedTexts("fileUploadCancel")?this.retryUpload(a,!1):this.retryUpload(a,!0))},s.prototype.retryUpload=function(t,e){e?(t.end=t.end+this.asyncSettings.chunkSize,t.start=t.start+this.asyncSettings.chunkSize,this.sendRequest(t.file,t)):(t.file.statusCode="1",t.file.status=this.localizedTexts("readyToUploadMessage"),this.chunkUpload(t.file)),this.getLiElement(t.file).classList.add("e-restrict-retry")},s.prototype.chunkUploadInProgress=function(t,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(!e.isNullOrUndefined(a)){var r=a.querySelector("."+It);if(e.isNullOrUndefined(r)||(r.classList.add(Mt),r.setAttribute("title",this.localizedTexts("pause")),r.classList.remove(It)),!e.isNullOrUndefined(a)){if(!(a.querySelectorAll("."+Ut).length>0)){var l=a.querySelector("."+At);e.isNullOrUndefined(this.template)&&(l.classList.add("e-upload-progress"),l.classList.remove(Ft),this.createProgressBar(a),this.updateProgressBarClasses(a,"e-upload-progress"));var o=a.querySelector("."+Ht)?a.querySelector("."+Ht):a.querySelector("."+Nt);e.isNullOrUndefined(o)||(o.classList.add(Bt),o.setAttribute("title",this.localizedTexts("abort")),o.classList.remove(Ht))}if(!isNaN(Math.round(t.loaded/t.total*100))&&e.isNullOrUndefined(this.template)&&"4"!==i.file.statusCode){var h=void 0,u=Math.ceil(i.file.size/this.asyncSettings.chunkSize)-1;this.asyncSettings.chunkSize&&u&&(h=Math.round(i.chunkIndex/u*100),this.changeProgressValue(a,h.toString()+"%"))}0===i.chunkIndex&&this.checkActionButtonStatus()}if(e.isNullOrUndefined(a.querySelector("."+Mt))&&e.isNullOrUndefined(this.template)&&e.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 p=a.querySelector("."+Bt);p.parentElement.insertBefore(this.pauseButton,p),this.pauseButton.setAttribute("title",this.localizedTexts("pause")),this.pauseButton.addEventListener("click",function(t){n.checkPausePlayAction(t)},!1)}}}},s.prototype.bytesToSize=function(t){var e=-1;if(!t)return"0.0 KB";do{t/=1024,e++}while(t>99);return e>=2&&(t*=1024,e=1),Math.max(t,0).toFixed(1)+" "+["KB","MB"][e]},s.prototype.sortFileList=function(t){for(var e=t=t||this.sortFilesList,i=[],s=0;s<e.length;s++)i.push(e[s].name);for(var n=[],a=0,r=i.sort();a<r.length;a++)for(var l=r[a],s=0;s<e.length;s++)l===e[s].name&&n.push(e[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)}e.isNullOrUndefined(this.uploadWrapper)||(this.uploadWrapper.parentElement.appendChild(this.element),e.detach(this.uploadWrapper)),this.uploadWrapper=null,this.uploadWrapper=null,this.browseButton=null,this.dropAreaWrapper=null,this.dropZoneElement=null,this.dropArea=null,this.keyboardModule=null,this.clearButton=null,this.uploadButton=null,t.prototype.destroy.call(this)},s.prototype.upload=function(t,e){var i=this;if(t=t||this.filesData,this.sequentialUpload&&(this.isFirstFileOnSelection||e))this.sequenceUpload(t);else{var s=this.getFilesInArray(t),n={customFormData:[],currentRequest:null,cancel:!1};this.trigger("beforeUpload",n,function(t){t.cancel||(i.customFormDatas=t.customFormData&&t.customFormData.length>0?t.customFormData:i.customFormDatas,i.uploadFiles(s,e))})}},s.prototype.getFilesInArray=function(t){var e=[];return t&&(t instanceof Array?e=t:e.push(t)),e},s.prototype.serverReadFileBase64=function(t,e,i){var s=this;return new Promise(function(n,a){var r=s.fileStreams[t].rawFile;try{var l=new FileReader;l.onload=function(t){return function(){try{var e=t.result,i=e?e.split(";base64,")[1]:null;n(i)}catch(t){a(t)}}}(l),l.readAsDataURL(r.slice(e,e+i))}catch(t){a(t)}})},s.prototype.uploadFileCount=function(t){var e=this.filesData;return e&&0!==e.length?e.length:-1},s.prototype.getFileRead=function(t,e){var i=this.filesData;if(!i||0===i.length)return-1;var s=i[t],n=this.newFileRef++;return this.fileStreams[n]=s,n},s.prototype.uploadFiles=function(t,i){var s=[];if(""!==this.asyncSettings.saveUrl&&!e.isNullOrUndefined(this.asyncSettings.saveUrl)){if(!i||e.isNullOrUndefined(i))if(this.multiple)s=this.filterfileList(t);else{var n=[];n.push(t[0]),s=this.filterfileList(n)}else s=t;for(var a=0;a<s.length;a++)this.uploadFilesRequest(s,a,i)}},s.prototype.uploadFilesRequest=function(t,i,s){var n=this,a=this.checkChunkUpload(),r=new e.Ajax(this.asyncSettings.saveUrl,"POST",!0,null);r.emitError=!1;var l={fileData:t[i],customFormData:[],cancel:!1},o=new FormData;if(r.beforeSend=function(e){l.currentRequest=r.httpRequest,n.trigger("uploading",l,function(s){s.cancel&&n.eventCancelByArgs(e,s,t[i]),n.customFormDatas&&n.customFormDatas.length>0&&n.updateFormData(o,n.customFormDatas),n.updateFormData(o,s.customFormData)})},"1"===t[i].statusCode){var h=this.element.getAttribute("name");o.append(h,t[i].rawFile,t[i].name),a&&t[i].size>this.asyncSettings.chunkSize?this.chunkUpload(t[i],s,i):(r.onLoad=function(e){return l.cancel?{}:(n.uploadComplete(e,t[i],s),{})},r.onUploadProgress=function(e){return l.cancel?{}:(n.uploadInProgress(e,t[i],s,r),{})},r.onError=function(e){return n.uploadFailed(e,t[i]),{}},r.send(o))}},s.prototype.spliceFiles=function(t){for(var e=this.fileList[t],i=this.getFilesData(),s=+e.getAttribute("data-files-count"),n=0,a=0;a<t;a++)n+=+this.fileList[a].getAttribute("data-files-count");for(var r=n+s-1;r>=n;r--)i.splice(r,1)},s.prototype.remove=function(t,i,s,n,a){var r=this;e.isNullOrUndefined(n)&&(n=!0);var l={event:a,cancel:!1,filesData:[],customFormData:[],postRawFile:n,currentRequest:null},o={cancel:!1,customFormData:[],currentRequest:null};this.trigger("beforeRemove",o,function(n){if(!n.cancel)if(r.isFormUpload())l.filesData=t,r.trigger("removing",l,function(i){if(!i.cancel)for(var s=!1,n=void 0,a=0,l=r.getFilesInArray(t);a<l.length;a++){var o=l[a];if(s||(n=r.fileList.indexOf(o.list)),n>-1){var h=e.isNullOrUndefined(o.input)?null:o.input;h&&e.detach(h),r.spliceFiles(n),e.detach(r.fileList[n]),r.fileList.splice(n,1),s=!0,n=-1}}});else if(r.isForm&&(e.isNullOrUndefined(r.asyncSettings.removeUrl)||""===r.asyncSettings.removeUrl))l.filesData=r.getFilesData(),r.trigger("removing",l,function(t){t.cancel||r.clearAll()});else{var o=[];(t=e.isNullOrUndefined(t)?r.filesData:t)instanceof Array?o=t:o.push(t),l.filesData=o;for(var h=r.asyncSettings.removeUrl,u=""!==h&&!e.isNullOrUndefined(h),p=0,d=o;p<d.length;p++)!function(t){var e=r.uploadedFilesData.indexOf(t);("2"===t.statusCode||"4"===t.statusCode||"0"===t.statusCode&&-1!==e)&&u?r.removeUploadedFile(t,l,s,i):s?r.removeFilesData(t,i):r.trigger("removing",l,function(e){e.cancel||r.removeFilesData(t,i)}),a&&!a.target.classList.contains(Ht)&&r.checkActionComplete(!1)}(d[p])}})},s.prototype.clearAll=function(){var t=this;if(e.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(e){e.cancel||(t.clearData(),t.actionCompleteCount=0,t.count=-1)})},s.prototype.getFilesData=function(t){return e.isNullOrUndefined(t)?this.filesData:this.getSelectedFiles(t)},s.prototype.pause=function(t,e){t=t||this.filesData;var i=this.getFilesInArray(t);this.pauseUploading(i,e)},s.prototype.pauseUploading=function(t,e){for(var i=this.getFiles(t),s=0;s<i.length;s++)"3"===i[s].statusCode&&this.pauseUpload(this.getCurrentMetaData(i[s],null),null,e)},s.prototype.getFiles=function(t){var i=[];return e.isNullOrUndefined(t)||t instanceof Array?i=t:i.push(t),i},s.prototype.resume=function(t,e){t=t||this.filesData;var i=this.getFilesInArray(t);this.resumeFiles(i,e)},s.prototype.resumeFiles=function(t,e){for(var i=this.getFiles(t),s=0;s<i.length;s++)"4"===i[s].statusCode&&this.resumeUpload(this.getCurrentMetaData(i[s],null),null,e)},s.prototype.retry=function(t,e,i){t=t||this.filesData;var s=this.getFilesInArray(t);this.sequentialUpload&&this.isFirstFileOnSelection&&(this.isFirstFileOnSelection=!1),this.retryFailedFiles(s,e,i)},s.prototype.retryFailedFiles=function(t,e,i){for(var s=this.getFiles(t),n=0;n<s.length;n++)if("5"===s[n].statusCode||"0"===s[n].statusCode)if(this.asyncSettings.chunkSize>0&&this.getCurrentMetaData(s[n],null))this.retryUpload(this.getCurrentMetaData(s[n],null),e);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(t){t=t||this.filesData;var e=this.getFilesInArray(t);this.cancelUpload(e)},s.prototype.cancelUpload=function(t){var e=this.getFiles(t);if(this.asyncSettings.chunkSize>0){for(s=0;s<e.length;s++)if("3"===e[s].statusCode){var i=this.getCurrentMetaData(e[s],null);i.file.statusCode="5",i.file.status=this.localizedTexts("fileUploadCancel"),this.updateMetaData(i),this.showHideUploadSpinner(e[s])}}else for(var s=0;s<e.length;s++)"3"===e[s].statusCode&&(e[s].statusCode="5",e[s].status=this.localizedTexts("fileUploadCancel"),this.showHideUploadSpinner(e[s]))},s.prototype.showHideUploadSpinner=function(t){var s=this.getLiElement(t);if(!e.isNullOrUndefined(s)&&e.isNullOrUndefined(this.template)){var n=s.querySelector("."+Bt);i.createSpinner({target:n,width:"20px"}),i.showSpinner(n)}},wt([e.Complex({saveUrl:"",removeUrl:""},qt)],s.prototype,"asyncSettings",void 0),wt([e.Property(!1)],s.prototype,"sequentialUpload",void 0),wt([e.Property({})],s.prototype,"htmlAttributes",void 0),wt([e.Property("")],s.prototype,"cssClass",void 0),wt([e.Property(!0)],s.prototype,"enabled",void 0),wt([e.Property(null)],s.prototype,"template",void 0),wt([e.Property(!0)],s.prototype,"multiple",void 0),wt([e.Property(!0)],s.prototype,"autoUpload",void 0),wt([e.Property(!0)],s.prototype,"enableHtmlSanitizer",void 0),wt([e.Complex({},Wt)],s.prototype,"buttons",void 0),wt([e.Property("")],s.prototype,"allowedExtensions",void 0),wt([e.Property(0)],s.prototype,"minFileSize",void 0),wt([e.Property(3e7)],s.prototype,"maxFileSize",void 0),wt([e.Property(null)],s.prototype,"dropArea",void 0),wt([e.Collection([{}],zt)],s.prototype,"files",void 0),wt([e.Property(!0)],s.prototype,"showFileList",void 0),wt([e.Property(!1)],s.prototype,"directoryUpload",void 0),wt([e.Property("Default")],s.prototype,"dropEffect",void 0),wt([e.Event()],s.prototype,"created",void 0),wt([e.Event()],s.prototype,"actionComplete",void 0),wt([e.Event()],s.prototype,"rendering",void 0),wt([e.Event()],s.prototype,"beforeUpload",void 0),wt([e.Event()],s.prototype,"fileListRendering",void 0),wt([e.Event()],s.prototype,"selected",void 0),wt([e.Event()],s.prototype,"uploading",void 0),wt([e.Event()],s.prototype,"success",void 0),wt([e.Event()],s.prototype,"failure",void 0),wt([e.Event()],s.prototype,"removing",void 0),wt([e.Event()],s.prototype,"beforeRemove",void 0),wt([e.Event()],s.prototype,"clearing",void 0),wt([e.Event()],s.prototype,"progress",void 0),wt([e.Event()],s.prototype,"change",void 0),wt([e.Event()],s.prototype,"chunkSuccess",void 0),wt([e.Event()],s.prototype,"chunkFailure",void 0),wt([e.Event()],s.prototype,"chunkUploading",void 0),wt([e.Event()],s.prototype,"canceling",void 0),wt([e.Event()],s.prototype,"pausing",void 0),wt([e.Event()],s.prototype,"resuming",void 0),s=wt([e.NotifyPropertyChanges],s)}(e.Component),_t=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Xt=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},Kt="e-apply",Yt="e-ctrl-btn",Zt="e-switch-ctrl-btn",Gt="e-hide-hex-value",Jt="e-hide-switchable-value",$t="e-hide-value",Qt="e-hsv-color",te="e-selected-value",ee="e-mode-switch-btn",ie="e-nocolor-item",se="e-opacity-value",ne="e-preview-container",ae="e-show-value",re="e-selected",le="e-tile",oe={default:["#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"]},he=function(n){function a(t,e){var i=n.call(this,t,e)||this;return i.recentColors=[],i}return _t(a,n),a.prototype.preRender=function(){var t=this.element;this.formElement=e.closest(this.element,"form"),this.formElement&&e.EventHandler.add(this.formElement,"reset",this.formResetHandler,this);var i={Apply:"Apply",Cancel:"Cancel",ModeSwitcher:"Switch Mode",RecentColors:"Recent colors"};this.l10n=new e.L10n("colorpicker",i,this.locale),t.getAttribute("ejs-for")&&!t.getAttribute("name")&&t.setAttribute("name",t.id)},a.prototype.render=function(){this.initWrapper(),this.inline?this.createWidget():this.createSplitBtn(),this.enableOpacity||e.addClass([this.container.parentElement],"e-hide-opacity"),this.renderComplete()},a.prototype.initWrapper=function(){var t=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper"});this.element.parentNode.insertBefore(t,this.element),t.appendChild(this.element),e.attributes(this.element,{tabindex:"-1",spellcheck:"false","aria-label":"colorpicker"}),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);e.isNullOrUndefined(this.initialInputValue)&&(this.initialInputValue=s),this.element.value=s,this.enableOpacity?this.setProperties({value:i},!0):this.setProperties({value:s},!0),this.enableRtl&&t.classList.add("e-rtl"),this.cssClass&&e.addClass([t],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.tileRipple=e.rippleEffect(this.container,{selector:"."+le}),this.ctrlBtnRipple=e.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),e.Browser.isDevice&&this.refreshPopupPos()},a.prototype.createSplitBtn=function(){var t=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,createPopupOnClick:this.createPopupOnClick,open:this.onOpen.bind(this),click:function(){var e=new MouseEvent("click",{bubbles:!0,cancelable:!1});t.trigger("change",{currentValue:{hex:t.value.slice(0,7),rgba:t.convertToRgbString(t.hexToRgb(t.value))},previousValue:{hex:null,rgba:null},value:t.value,event:e})}}),this.splitBtn.createElement=this.createElement,this.splitBtn.appendTo(n),this.splitBtn.element.setAttribute("aria-label","colorpicker");var a=this.createElement("span",{className:"e-split-preview"});e.select(".e-selected-color",n).appendChild(a),a.style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value));var r=this.getPopupEle();if(e.addClass([r],"e-colorpicker-popup"),this.cssClass){var l=this.cssClass.replace(/\s+/g," ").trim().split(" ");r&&e.addClass([r],l),this.splitBtn&&this.splitBtn.activeElem&&this.splitBtn.activeElem[0]&&e.addClass([this.splitBtn.activeElem[0]],l),this.splitBtn&&this.splitBtn.activeElem&&this.splitBtn.activeElem[1]&&e.addClass([this.splitBtn.activeElem[1]],l),this.splitBtn&&this.splitBtn.element&&this.splitBtn.element.parentElement&&e.addClass([this.splitBtn.element.parentElement],l)}if(e.Browser.isDevice&&!this.createPopupOnClick){var o=this.getPopupInst();o.relateTo=document.body,o.position={X:"center",Y:"center"},o.targetType="container",o.collision={X:"fit",Y:"fit"},o.offsetY=4,r.style.zIndex=i.getZindexPartial(this.splitBtn.element).toString()}this.bindCallBackEvent()},a.prototype.onOpen=function(){if(this.trigger("open",{element:this.container}),!e.Browser.isDevice){var t=this.getPopupInst();i.isCollide(t.element).length>0&&(t.collision={X:"flip",Y:"fit"},t.position={X:"right",Y:"bottom"},t.targetType="container")}},a.prototype.getPopupInst=function(){return e.getInstance(this.getPopupEle(),i.Popup)},a.prototype.bindCallBackEvent=function(){var t=this;this.splitBtn.beforeOpen=function(n){var a=new s.Deferred;return t.trigger("beforeOpen",n,function(s){if(!s.cancel){var r=t.getPopupEle();if(r.style.top=e.formatUnit(0+pageYOffset),r.style.left=e.formatUnit(0+pageXOffset),r.style.display="block",t.createWidget(),r.style.display="",e.Browser.isDevice){if(t.createPopupOnClick){var l=t.getPopupInst();l.relateTo=document.body,l.position={X:"center",Y:"center"},l.targetType="container",l.collision={X:"fit",Y:"fit"},l.offsetY=4,r.style.zIndex=i.getZindexPartial(t.splitBtn.element).toString()}t.modal=t.createElement("div"),t.modal.className="e-"+t.getModuleName()+" e-modal",t.modal.style.display="none",document.body.insertBefore(t.modal,r),document.body.className+=" e-colorpicker-overflow",t.modal.style.display="block",t.modal.style.zIndex=(Number(r.style.zIndex)-1).toString()}}n.cancel=s.cancel,a.resolve(s)}),a},this.splitBtn.beforeClose=function(i){var n=new s.Deferred;if(e.isNullOrUndefined(i.event))n.resolve(i);else{var a={element:t.container,event:i.event,cancel:!1};t.trigger("beforeClose",a,function(s){e.Browser.isDevice&&i.event.target===t.modal&&(s.cancel=!0),s.cancel||(t.onPopupClose(),"keydown"===i.event.type&&27===i.event.keyCode&&t.splitBtn.element.focus()),i.cancel=s.cancel,n.resolve(s)})}return n}},a.prototype.onPopupClose=function(){this.unWireEvents(),this.destroyOtherComp(),this.container.style.width="",e.select(".e-split-preview",this.splitBtn.element).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value)),this.container.innerHTML="",e.removeClass([this.container],["e-color-picker","e-color-palette"]),e.Browser.isDevice&&this.modal&&(e.removeClass([document.body],"e-colorpicker-overflow"),this.modal.style.display="none",this.modal.outerHTML="",this.modal=null)},a.prototype.createPalette=function(){if(e.classList(this.container,["e-color-palette"],["e-color-picker"]),this.presetColors){var t=this.createElement("div",{className:"e-custom-palette"});this.appendElement(t);var i=Object.keys(this.presetColors);if(1===i.length)this.appendPalette(this.presetColors[i[0]],i[0],t);else for(var s=0,n=i.length;s<n;s++)this.appendPalette(this.presetColors[i[s]],i[s],t);e.selectAll(".e-row",t).length>10&&e.addClass([t],"e-palette-group")}else this.appendPalette(oe.default,"default");"Palette"===this.mode&&!this.modeSwitcher&&this.noColor&&this.setNoColor(),this.showRecentColors&&this.recentColors&&this.recentColors.length>0&&this.renderRecentColor();var a=parseInt(getComputedStyle(this.container).borderBottomWidth,10);this.container.style.width=e.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.renderRecentColor=function(){var t=this,i=this.container.querySelector(".e-clr-pal-rec-wpr");i&&e.detach(i);var s=this.createElement("div",{className:"e-clr-pal-rec-wpr"}),n=this.container.querySelector(".e-switch-ctrl-btn");n?this.container.insertBefore(s,n):this.container.appendChild(s);var a=this.createElement("label",{className:"e-recent-clr-span"});if(a.textContent=this.l10n.getConstant("RecentColors"),s.appendChild(a),this.recentColors.length>0){for(this.recentColors=this.recentColors.filter(function(e,i){return t.recentColors.indexOf(e)===i});this.recentColors.length>10;)this.recentColors.pop();this.appendPalette(this.recentColors,"recent-color",s)}},a.prototype.firstPaletteFocus=function(){e.select("."+re,this.container.children[0])||e.selectAll(".e-palette",this.container)[0].focus()},a.prototype.appendPalette=function(t,e,i){var s=this.createElement("div",{className:"e-palette",attrs:{tabindex:"0",role:"grid"}});"recent-color"===e&&s.classList.add("e-recent-palette"),i?i.appendChild(s):this.appendElement(s);for(var n,a,r,l=0,o=t.length;l<o;l++)0!==l&&l%this.columns!=0||(n=this.createElement("div",{className:"e-row",attrs:{role:"row"}}),s.appendChild(n)),r=this.roundValue(t[l]).toLowerCase(),a=this.createElement("span",{className:le,attrs:{role:"gridcell","aria-label":r,"aria-selected":"false"}}),this.trigger("beforeTileRender",{element:a,presetName:e,value:t[l]}),n.appendChild(a),this.value===r&&"recent-color"!==e&&(this.addTileSelection(a),s.focus()),a.style.backgroundColor=this.convertToRgbString(this.hexToRgb(r))},a.prototype.setNoColor=function(){var t=this.container.querySelector(".e-row").children[0];t.classList.add(ie),this.value||(t.classList.add(re),e.closest(t,".e-palette").focus()),["aria-selected","aria-label"].forEach(function(e){t.removeAttribute(e)}),t.style.backgroundColor=""},a.prototype.appendElement=function(t,e){void 0===e&&(e=0);var i=this.container.children[e];i?this.container.insertBefore(t,i):this.container.appendChild(t)},a.prototype.addTileSelection=function(t){t&&(t.classList.add(re),t.setAttribute("aria-selected","true"))},a.prototype.createPicker=function(){e.classList(this.container,["e-color-picker"],["e-color-palette"]);var t=this.createElement("div",{className:"e-hsv-container"});this.appendElement(t),t.appendChild(this.createElement("div",{className:Qt}));var i=this.createElement("span",{className:"e-handler",attrs:{tabindex:"0"}});t.appendChild(i),null!==this.value&&""!==this.value||(this.value="#008000ff"),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(t){void 0===t&&(t=this.hsv[0]),this.getHsvContainer().style.backgroundColor=this.convertToRgbString(this.hsvToRgb(t,100,100,1))},a.prototype.getHsvContainer=function(){return e.select(".e-hsv-container",this.container)},a.prototype.setHandlerPosition=function(){var t=this.getDragHandler(),i=e.select("."+Qt,this.container);this.enableRtl?t.style.left=e.formatUnit((i.offsetWidth-t.offsetWidth/2.5)*Math.abs(100-this.hsv[1])/100):t.style.left=e.formatUnit((i.offsetWidth-t.offsetWidth/2.5)*this.hsv[1]/100),t.style.top=e.formatUnit((i.offsetHeight-t.offsetHeight/2.5)*(100-this.hsv[2])/100)},a.prototype.createSlider=function(){var t=this.createElement("div",{className:"e-slider-preview"});this.appendElement(t,1),this.createPreview(t);var e=this.createElement("div",{className:"e-colorpicker-slider"});t.insertBefore(e,t.children[0]);var i=this.createElement("div",{className:"e-hue-slider"});e.appendChild(i),this.hueSlider=new St({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"}),e.appendChild(i),this.createOpacitySlider(i))},a.prototype.createOpacitySlider=function(t){this.opacitySlider=new St({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(t);var e=this.createElement("div",{className:"e-opacity-empty-track"});t.appendChild(e),this.updateOpacitySliderBg()},a.prototype.updateOpacitySliderBg=function(){var t=this.enableRtl?"to left":"to right",i=e.select(".e-opacity-empty-track",this.opacitySlider.element);i&&(i.style.background="linear-gradient("+t+", rgba("+this.rgb.slice(0,3)+", 0) 0%, "+this.convertToRgbString(this.rgb.slice(0,3))+" 100%)")},a.prototype.hueChange=function(t){this.hsv[0]=t.value,this.setHsvContainerBg(),this.convertToOtherFormat()},a.prototype.opacityChange=function(t){var e=t.value,i=this.rgbToHex(this.rgb);this.hsv[3]=e/100,this.rgb[3]=e/100;var s=this.rgbToHex(this.rgb);this.updateOpacityInput(e);var n=this.convertToRgbString(this.rgb);this.updatePreview(n),this.triggerEvent(s,i,n)},a.prototype.updateOpacityInput=function(t){if(this.enableOpacity&&!this.getWrapper().classList.contains($t)){var i=e.getInstance(e.select("."+se,this.container),it);i.value=t,i.dataBind()}},a.prototype.createPreview=function(t){var e=this.createElement("div",{className:ne});t.appendChild(e);var i=this.createElement("span",{className:"e-preview e-current"});e.appendChild(i);var s=this.convertToRgbString(this.rgb);i.style.backgroundColor=s,i=this.createElement("span",{className:"e-preview e-previous"}),e.appendChild(i),i.style.backgroundColor=s},a.prototype.isPicker=function(){return!this.container.classList.contains("e-color-palette")},a.prototype.getPopupEle=function(){return this.container.parentElement},a.prototype.createNumericInput=function(t,e,i,s){var n=this,a=new it({value:e,placeholder:i,min:0,max:s,format:"###.##",showSpinButton:!1,floatLabelType:"Always",enableRtl:this.enableRtl,enabled:!this.disabled,readonly:!this.isPicker(),change:function(t){t.event&&n.inputHandler(t.event)}});a.createElement=this.createElement,a.appendTo(t)},a.prototype.createInput=function(){var e=this.isPicker(),i=this.getWrapper();if(e&&!i.classList.contains($t)||!e&&i.classList.contains(ae)){var s=this.createElement("div",{className:te});e?this.appendElement(s,2):this.appendElement(s,1);var n=this.createElement("div",{className:"e-input-container"});if(s.appendChild(n),i.classList.contains("e-hide-valueswitcher")||this.appendValueSwitchBtn(s),!i.classList.contains(Gt)){var a=this.createElement("input",{className:"e-hex",attrs:{maxlength:"7",spellcheck:"false","aria-label":"HEX"}});n.appendChild(a),t.Input.createInput({element:a,floatLabelType:"Always",properties:{placeholder:"HEX",enableRtl:this.enableRtl,enabled:!this.disabled,readonly:!this.isPicker()}},this.createElement),t.Input.setValue(this.value.slice(0,7),a),a.addEventListener("input",this.inputHandler.bind(this))}if(!i.classList.contains(Jt)){var r=void 0,l=void 0;this.isRgb?(r="RGB",l=this.rgb):(r="HSV",l=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"})),l[h],r[h],255);this.enableOpacity&&this.appendOpacityValue(n)}}},a.prototype.appendOpacityValue=function(t){this.createNumericInput(t.appendChild(this.createElement("input",{className:se})),100*this.rgb[3],"A",100)},a.prototype.appendValueSwitchBtn=function(t){var e=this.createElement("button",{className:"e-icons e-css e-btn e-flat e-icon-btn e-value-switch-btn",attrs:{title:"Toggle format"}});t.appendChild(e),this.isPicker()&&!this.getWrapper().classList.contains(Jt)&&e.addEventListener("click",this.formatSwitchHandler.bind(this))},a.prototype.createCtrlBtn=function(){if(this.modeSwitcher||this.showButtons){this.l10n.setLocale(this.locale);var t=this.createElement("div",{className:Zt});if(this.container.appendChild(t),this.showButtons){var e=this.createElement("div",{className:Yt});t.appendChild(e);var i=this.l10n.getConstant("Apply");e.appendChild(this.createElement("button",{innerHTML:i,className:"e-btn e-css e-flat e-primary e-small "+Kt,attrs:{title:i}}));var s=this.l10n.getConstant("Cancel");e.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 t=this.createElement("button",{className:"e-icons e-btn e-flat e-icon-btn "+ee,attrs:{title:this.l10n.getConstant("ModeSwitcher")}});e.select("."+Zt,this.container).insertBefore(t,e.select("."+Yt,this.container))},a.prototype.createDragTooltip=function(){var t=this,s=new i.Tooltip({opensOn:"Custom",showTipPointer:!1,cssClass:"e-color-picker-tooltip",htmlAttributes:{title:"tooltip"},beforeOpen:function(e){t.tooltipEle=e.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(),this.tooltipEle.setAttribute("aria-label","colorpicker-tooltip"),e.select(".e-tip-content",this.tooltipEle).appendChild(this.createElement("div",{className:"e-tip-transparent"}))},a.prototype.getTooltipInst=function(){return e.getInstance(this.container,i.Tooltip)},a.prototype.setTooltipOffset=function(t){this.getTooltipInst().offsetY=t},a.prototype.toggleDisabled=function(t){t?this.getWrapper().classList.add("e-disabled"):this.getWrapper().classList.remove("e-disabled"),this.showButtons&&[].slice.call(e.selectAll(".e-btn",this.container)).forEach(function(i){t?e.attributes(i,{disabled:""}):i.removeAttribute("disabled")})},a.prototype.convertToRgbString=function(t){return t.length?4===t.length?"rgba("+t.join()+")":"rgb("+t.join()+")":""},a.prototype.convertToHsvString=function(t){return 4===t.length?"hsva("+t.join()+")":"hsv("+t.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(t,e){void 0===t&&(t=!1);var i=this.rgbToHex(this.rgb);this.rgb=this.hsvToRgb.apply(this,this.hsv);var s=this.rgbToHex(this.rgb),n=this.convertToRgbString(this.rgb);this.updatePreview(n),this.updateInput(s),this.triggerEvent(s,i,n,t,e)},a.prototype.updateInput=function(i){var s=this.getWrapper();s.classList.contains($t)||(s.classList.contains(Gt)||t.Input.setValue(i.substr(0,7),e.select(".e-hex",this.container)),s.classList.contains(Jt)||(this.isRgb?this.updateValue(this.rgb,!1):this.updateValue(this.hsv,!1)))},a.prototype.updatePreview=function(t){this.enableOpacity&&this.updateOpacitySliderBg(),e.select(".e-tip-transparent",this.tooltipEle).style.backgroundColor=t,e.select("."+ne+" .e-current",this.container).style.backgroundColor=t,e.select("."+ne+" .e-previous",this.container).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value))},a.prototype.getDragHandler=function(){return e.select(".e-handler",this.container)},a.prototype.removeTileSelection=function(){[].slice.call(e.selectAll("."+re,this.container)).forEach(function(t){t.classList.remove(re),t.setAttribute("aria-selected","false")})},a.prototype.convertRgbToNumberArray=function(t){return t.slice(t.indexOf("(")+1,t.indexOf(")")).split(",").map(function(t,e){return 3!==e?parseInt(t,10):parseFloat(t)})},a.prototype.getValue=function(t,e){if(t||(t=this.value),e=e?e.toLowerCase():"hex","r"===t[0]){i=this.convertRgbToNumberArray(t);if("hex"===e||"hexa"===e){s=this.rgbToHex(i);return"hex"===e?s.slice(0,7):s}return"hsv"===e?this.convertToHsvString(this.rgbToHsv.apply(this,i.slice(0,3))):"hsva"===e?this.convertToHsvString(this.rgbToHsv.apply(this,i)):"null"}if("h"===t[0]){var i=this.hsvToRgb.apply(this,this.convertRgbToNumberArray(t));if("rgba"===e)return this.convertToRgbString(i);if("hex"===e||"hexa"===e){var s=this.rgbToHex(i);return"hex"===e?s.slice(0,7):s}return"rgb"===e?this.convertToRgbString(i.slice(0,3)):"null"}t=this.roundValue(t);var n=this.hexToRgb(t);return"rgb"!==e&&"hsv"!==e||(n=n.slice(0,3)),"rgba"===e||"rgb"===e?this.convertToRgbString(n):"hsva"===e||"hsv"===e?this.convertToHsvString(this.rgbToHsv.apply(this,n)):"hex"===e?t.slice(0,7):"a"===e?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 t=this.getDragHandler();e.EventHandler.add(t,"keydown",this.pickerKeyDown,this);var i=e.select("."+Yt,this.container);i&&e.EventHandler.add(i,"keydown",this.ctrlBtnKeyDown,this),e.EventHandler.add(this.getHsvContainer(),"mousedown touchstart",this.handlerDown,this),(this.modeSwitcher||this.showButtons)&&this.addCtrlSwitchEvent(),e.EventHandler.add(e.select(".e-previous",this.container),"click",this.previewHandler,this)}else e.EventHandler.add(this.container,"click",this.paletteClickHandler,this),e.EventHandler.add(this.container,"keydown",this.paletteKeyDown,this)},a.prototype.formResetHandler=function(){this.value=this.initialInputValue,e.attributes(this.element,{value:this.initialInputValue})},a.prototype.addCtrlSwitchEvent=function(){var t=e.select("."+Zt,this.container);t&&e.EventHandler.add(t,"click",this.btnClickHandler,this)},a.prototype.ctrlBtnKeyDown=function(t){if(13===t.keyCode){if(e.select("."+Kt,this.container)){var i=this.rgbToHex(this.rgb);this.triggerChangeEvent(i)}this.splitBtn.element.focus()}},a.prototype.pickerKeyDown=function(t){switch(t.keyCode){case 39:this.handlerDragPosition(1,this.enableRtl?-1:1,t);break;case 37:this.handlerDragPosition(1,this.enableRtl?1:-1,t);break;case 38:this.handlerDragPosition(2,1,t);break;case 40:this.handlerDragPosition(2,-1,t);break;case 13:t.preventDefault();var e=this.rgbToHex(this.rgb);this.enterKeyHandler(e)}},a.prototype.enterKeyHandler=function(t){this.triggerChangeEvent(t),this.inline||this.splitBtn.element.focus()},a.prototype.closePopup=function(t){var e=this,i={element:this.container,event:t,cancel:!1};this.trigger("beforeClose",i,function(t){t.cancel||(e.splitBtn.toggle(),e.onPopupClose())})},a.prototype.triggerChangeEvent=function(t,e){var i=t.slice(0,7);this.trigger("change",{currentValue:{hex:i,rgba:this.convertToRgbString(this.rgb)},event:e,previousValue:{hex:this.value.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(this.value))},value:this.enableOpacity?t:i}),this.showRecentColors&&(this.recentColors.unshift(i),this.inline&&this.renderRecentColor()),this.enableOpacity?this.setProperties({value:t},!0):this.setProperties({value:i},!0),this.element.value=i||"#000000"},a.prototype.handlerDragPosition=function(t,e,i){i.preventDefault(),this.hsv[t]+=e*(i.ctrlKey?1:3),this.hsv[t]<0&&(this.hsv[t]=0),this.updateHsv(),this.convertToOtherFormat(!0,i)},a.prototype.handlerDown=function(t){t.preventDefault(),"mousedown"===t.type?(this.clientX=Math.abs(t.pageX-pageXOffset),this.clientY=Math.abs(t.pageY-pageYOffset),this.setTooltipOffset(8)):(this.clientX=Math.abs(t.changedTouches[0].pageX-pageXOffset),this.clientY=Math.abs(t.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(!1,t),this.getDragHandler().focus(),e.EventHandler.add(document,"mousemove touchmove",this.handlerMove,this),e.EventHandler.add(document,"mouseup touchend",this.handlerEnd,this)},a.prototype.handlerMove=function(t){"touchmove"!==t.type&&t.preventDefault();var i,s;"mousemove"===t.type?(i=Math.abs(t.pageX-pageXOffset),s=Math.abs(t.pageY-pageYOffset)):(i=Math.abs(t.changedTouches[0].pageX-pageXOffset),s=Math.abs(t.changedTouches[0].pageY-pageYOffset)),this.setHsv(i,s);var n=this.getDragHandler();this.updateHsv(),this.convertToOtherFormat(!1,t),this.getTooltipInst().refresh(n),this.tooltipEle.style.transform||(Math.abs(this.clientX-i)>8||Math.abs(this.clientY-s)>8)&&(e.select("."+Qt,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(t,i){var s=e.select("."+Qt,this.container),n=s.getBoundingClientRect();t=this.enableRtl?t>n.right?0:Math.abs(t-n.right):t>n.left?Math.abs(t-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,t-s.offsetLeft))/s.offsetWidth))/10},a.prototype.handlerEnd=function(t){"touchend"!==t.type&&t.preventDefault(),e.EventHandler.remove(document,"mousemove touchmove",this.handlerMove),e.EventHandler.remove(document,"mouseup touchend",this.handlerEnd);var i=this.getDragHandler();e.select("."+Qt,this.container).style.cursor="",this.tooltipEle.style.transform&&(this.tooltipEle.style.transform="",i.classList.remove("e-hide-handler")),this.inline||this.showButtons||this.closePopup(t)},a.prototype.btnClickHandler=function(t){var i=t.target;e.closest(i,"."+ee)?(t.stopPropagation(),this.switchToPalette()):(i.classList.contains(Kt)||i.classList.contains("e-cancel"))&&this.ctrlBtnClick(i,t)},a.prototype.switchToPalette=function(){this.trigger("beforeModeSwitch",{element:this.container,mode:"Palette"}),this.unWireEvents(),this.destroyOtherComp(),e.detach(e.select(".e-slider-preview",this.container)),this.getWrapper().classList.contains($t)||e.remove(e.select("."+te,this.container)),e.detach(this.getHsvContainer()),this.createPalette(),this.firstPaletteFocus(),this.createInput(),this.refreshPopupPos(),this.element.parentElement&&this.element.parentElement.parentElement&&this.element.parentElement.parentElement.classList.contains("e-ie-ddb-popup")&&this.refreshImageEditorPopupPos(),this.wireEvents(),this.trigger("onModeSwitch",{element:this.container,mode:"Palette"})},a.prototype.refreshImageEditorPopupPos=function(){if(e.Browser.isDevice){var t=this.getPopupEle();t.style.left=e.formatUnit(0+pageXOffset),t.style.top=e.formatUnit(0+pageYOffset);var i=document.querySelector("#"+this.element.parentElement.parentElement.id.split("-popup")[0]);i&&t.parentElement.ej2_instances[0].refreshPosition(i)}},a.prototype.refreshPopupPos=function(){if(!this.inline){var t=this.getPopupEle();t.style.left=e.formatUnit(0+pageXOffset),t.style.top=e.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(t,i,s,n){for(var a,r=["e-rh-value","e-gs-value","e-bv-value"],l=0,o=r.length;l<o;l++)(a=e.getInstance(e.select("."+r[l],this.container),it)).value=Math.round(t[l]),i&&(a.placeholder=r[l].substr(s,1).toUpperCase(),a.max=n?n[l]:255),a.dataBind()},a.prototype.previewHandler=function(t){var i=t.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),e.select("."+ne+" .e-current",this.container).style.backgroundColor=this.convertToRgbString(this.rgb),this.triggerEvent(n,s,this.convertToRgbString(this.rgb),!1,t)},a.prototype.paletteClickHandler=function(t){t.preventDefault();var i=t.target;if(i.classList.contains(le)){if(this.removeTileSelection(),this.addTileSelection(i),i.classList.contains(ie))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(ae)&&this.updateInput(s),this.triggerEvent(s,n,this.convertToRgbString(this.rgb),!1,t)}this.inline||this.showButtons||this.closePopup(t)}else e.closest(i,"."+ee)?this.switchToPicker():i.classList.contains(Kt)||i.classList.contains("e-cancel")?this.ctrlBtnClick(i,t):this.getWrapper().classList.contains(ae)&&e.closest(i,".e-value-switch-btn")&&this.formatSwitchHandler()},a.prototype.noColorTile=function(t){void 0===t&&(t=!1);var e=this.rgbToHex(this.rgb);this.rgb=[],this.hsv=[],this.triggerEvent("",e,"",t)},a.prototype.switchToPicker=function(){var t=this.getWrapper();this.trigger("beforeModeSwitch",{element:this.container,mode:"Picker"}),this.unWireEvents(),[].slice.call(e.selectAll(".e-palette",this.container)).forEach(function(t){e.detach(t)}),this.container.querySelector(".e-clr-pal-rec-wpr")&&e.detach(this.container.querySelector(".e-clr-pal-rec-wpr")),t.classList.contains(ae)&&e.detach(e.select("."+te,this.container)),this.container.style.width="";var i=e.select(".e-custom-palette",this.container);this.presetColors&&e.remove(i),this.createPicker(),this.getDragHandler().focus(),this.createInput(),this.refreshPopupPos(),this.element.parentElement&&this.element.parentElement.parentElement&&this.element.parentElement.parentElement.classList.contains("e-ie-ddb-popup")&&this.refreshImageEditorPopupPos(),this.wireEvents(),this.trigger("onModeSwitch",{element:this.container,mode:"Picker"})},a.prototype.ctrlBtnClick=function(t,e){if(t.classList.contains(Kt)){var i=this.rgbToHex(this.rgb);this.triggerChangeEvent(i,e)}if(this.inline){if(t.classList.contains("e-cancel")){var s={element:this.container,event:e,cancel:!1};this.trigger("beforeClose",s)}}else this.closePopup(e),this.splitBtn.element.focus()},a.prototype.paletteKeyDown=function(t){var i=t.target;if(i.classList.contains("e-palette")){var s,n,a=[].slice.call(e.selectAll("."+le,i)),r=a.filter(function(t){return t.classList.contains("e-selected")}).pop();switch(!t.altKey&&t.keyCode){case 39:t.preventDefault(),s=r?a[this.tilePosition(a,r,this.enableRtl?-1:1)]:a[this.enableRtl?a.length-1:0],this.keySelectionChanges(s);break;case 37:t.preventDefault(),s=r?a[this.tilePosition(a,r,this.enableRtl?1:-1)]:a[this.enableRtl?0:a.length-1],this.keySelectionChanges(s);break;case 38:t.preventDefault(),s=a[n=r?this.tilePosition(a,r,-this.columns):0]?a[n]:a[n-this.columns],this.keySelectionChanges(s);break;case 40:t.preventDefault(),a[n=r?this.tilePosition(a,r,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(t.preventDefault(),r){var l=r.getAttribute("aria-label");this.enterKeyHandler(l||"")}}}},a.prototype.keySelectionChanges=function(t){if(this.removeTileSelection(),this.addTileSelection(t),t.classList.contains(ie))this.noColorTile(!0);else{var e=t.getAttribute("aria-label"),i=this.rgbToHex(this.rgb);this.rgb=this.hexToRgb(e),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.getWrapper().classList.contains(ae)&&this.updateInput(e),this.triggerEvent(e,i,this.convertToRgbString(this.rgb),!0)}},a.prototype.tilePosition=function(t,e,i){var s=(t=Array.prototype.slice.call(t)).length,n=this.columns-t[s-1].parentElement.childElementCount,a=t.indexOf(e);return a+=i,a<0?a+=s+n:a%=s+n,a},a.prototype.inputHandler=function(t){var i=t.target;if(i.value.length){var s,n;switch(e.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,t);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,null,t));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,null,t));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,null,t));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(!1,t));break;case"V":this.hsv[2]!==Number(i.value)&&(this.hsv[2]=Number(i.value),this.updateHsv(),this.convertToOtherFormat(!1,t));break;case"A":this.opacitySlider.value=Number(i.value)}}},a.prototype.inputValueChange=function(t,e,i,s){t[0]!==this.hsv[0]&&(this.hueSlider.setProperties({value:t[0]},!0),this.hueSlider.refresh(),this.setHsvContainerBg(t[0])),this.hsv=t;var n=this.rgbToHex(this.rgb);this.setHandlerPosition(),this.updateInput(i||n);var a=this.convertToRgbString(this.rgb);this.updatePreview(a),this.triggerEvent(n,e,a,!1,s)},a.prototype.triggerEvent=function(t,i,s,n,a){void 0===n&&(n=!1);var r=t.slice(0,7);e.isNullOrUndefined(a)&&(a=new MouseEvent("click",{bubbles:!0,cancelable:!1})),this.showButtons||n?this.trigger("select",{currentValue:{hex:r,rgba:s},event:a,previousValue:{hex:i.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(i))}}):(this.trigger("change",{currentValue:{hex:r,rgba:s},event:a,previousValue:{hex:this.value.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(this.value))},value:t}),this.showRecentColors&&(this.recentColors.unshift(r),this.inline&&this.renderRecentColor()),this.enableOpacity?this.setProperties({value:t},!0):this.setProperties({value:r},!0),this.element.value=r||"#000000")},a.prototype.destroy=function(){var t=this,i=this.getWrapper();n.prototype.destroy.call(this),["tabindex","spellcheck"].forEach(function(e){t.element.removeAttribute(e)}),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&&e.detach(this.element.nextElementSibling),i&&(i.parentElement.insertBefore(this.element,i),e.detach(i)),this.container=null,this.formElement&&e.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},a.prototype.destroyOtherComp=function(){if(this.isPicker()){for(var t=e.closest(this.hueSlider.element,".e-color-picker").querySelectorAll(".e-numerictextbox"),i=0;i<t.length;i++)e.getInstance(t[i],it).destroy();this.hueSlider.destroy(),this.enableOpacity&&(this.opacitySlider.destroy(),this.opacitySlider=null),this.hueSlider=null;var s=this.getTooltipInst();s.close(),s.destroy(),this.tooltipEle=null}},a.prototype.isPopupOpen=function(){return this.getPopupEle().classList.contains("e-popup-open")},a.prototype.unWireEvents=function(){if(this.isPicker()){var t=this.getDragHandler();e.EventHandler.remove(t,"keydown",this.pickerKeyDown);var i=e.select("."+Yt,this.container);i&&e.EventHandler.remove(i,"keydown",this.ctrlBtnKeyDown),e.EventHandler.remove(this.getHsvContainer(),"mousedown touchstart",this.handlerDown),(this.modeSwitcher||this.showButtons)&&e.EventHandler.remove(e.select("."+Zt,this.container),"click",this.btnClickHandler),e.EventHandler.remove(e.select(".e-previous",this.container),"click",this.previewHandler)}else e.EventHandler.remove(this.container,"click",this.paletteClickHandler),e.EventHandler.remove(this.container,"keydown",this.paletteKeyDown)},a.prototype.roundValue=function(t){if(!t)return"";"#"!==t[0]&&(t="#"+t);var e=t.length;if(4===e&&(t+="f",e=5),5===e){for(var i="",s=1,n=t.length;s<n;s++)i+=t.charAt(s)+t.charAt(s);t="#"+i,e=9}return 7===e&&(t+="ff"),t},a.prototype.hexToRgb=function(t){if(!t)return[];9!==(t=t.trim()).length&&(t=this.roundValue(t));var e=Number((parseInt(t.slice(-2),16)/255).toFixed(2));t=t.slice(1,7);var i=parseInt(t,16),s=[];return s.push(i>>16&255),s.push(i>>8&255),s.push(255&i),s.push(e),s},a.prototype.rgbToHsv=function(t,i,s,n){if(this.rgb&&!this.rgb.length)return[];t/=255,i/=255,s/=255;var a,r=Math.max(t,i,s),l=Math.min(t,i,s),o=r,h=r-l,u=0===r?0:h/r;if(r===l)a=0;else{switch(r){case t:a=(i-s)/h+(i<s?6:0);break;case i:a=(s-t)/h+2;break;case s:a=(t-i)/h+4}a/=6}var p=[Math.round(360*a),Math.round(1e3*u)/10,Math.round(1e3*o)/10];return e.isNullOrUndefined(n)||p.push(n),p},a.prototype.hsvToRgb=function(t,i,s,n){var a,r,l;if(i/=100,s/=100,0===i)return a=r=l=s,[Math.round(255*a),Math.round(255*r),Math.round(255*l),n];t/=60;var o=Math.floor(t),h=t-o,u=s*(1-i),p=s*(1-i*h),d=s*(1-i*(1-h));switch(o){case 0:a=s,r=d,l=u;break;case 1:a=p,r=s,l=u;break;case 2:a=u,r=s,l=d;break;case 3:a=u,r=p,l=s;break;case 4:a=d,r=u,l=s;break;default:a=s,r=u,l=p}var c=[Math.round(255*a),Math.round(255*r),Math.round(255*l)];return e.isNullOrUndefined(n)||c.push(n),c},a.prototype.rgbToHex=function(t){return t.length?"#"+this.hex(t[0])+this.hex(t[1])+this.hex(t[2])+(e.isNullOrUndefined(t[3])?"":0!==t[3]?(Math.round(255*t[3])+65536).toString(16).substr(-2):"00"):""},a.prototype.hex=function(t){return("0"+t.toString(16)).slice(-2)},a.prototype.changeModeSwitcherProp=function(t){var i=e.select("."+Zt,this.container);t?i?this.appendModeSwitchBtn():(this.createCtrlBtn(),this.isPicker()&&!this.disabled&&this.addCtrlSwitchEvent()):i&&(this.showButtons?e.detach(e.select("."+ee,i)):e.remove(i))},a.prototype.changeShowBtnProps=function(t){var i=e.select("."+Zt,this.container);t?(i&&e.remove(i),this.createCtrlBtn(),this.isPicker()&&!this.disabled&&this.addCtrlSwitchEvent()):this.modeSwitcher?e.detach(e.select("."+Yt,i)):e.remove(i)},a.prototype.changeValueProp=function(t){if(this.isPicker())this.rgb=this.hexToRgb(t),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.setHandlerPosition(),e.detach(e.closest(this.hueSlider.element,".e-slider-preview")),this.createSlider(),this.setHsvContainerBg(),this.updateInput(t),4===this.rgb.length&&this.updateOpacityInput(100*this.rgb[3]);else{this.removeTileSelection();var i=this.container.querySelector('span[aria-label="'+this.roundValue(t)+'"]');i&&this.addTileSelection(i)}},a.prototype.setInputEleProps=function(){e.remove(e.select("."+te,this.container)),this.createInput()},a.prototype.changeDisabledProp=function(t){this.isPicker()&&(this.hueSlider.enabled=!t,this.opacitySlider.enabled=!t,this.setInputEleProps()),t?(this.toggleDisabled(!0),this.unWireEvents()):(this.toggleDisabled(!1),this.wireEvents())},a.prototype.changeCssClassProps=function(t,i){var s=this.getWrapper(),n=this.getPopupEle();i&&(e.removeClass([s,n],i.split(" ")),this.splitBtn&&this.splitBtn.activeElem&&this.splitBtn.activeElem[0]&&this.splitBtn.activeElem[1]&&e.removeClass([this.splitBtn.activeElem[0],this.splitBtn.activeElem[1]],i.split(" ")),this.splitBtn&&this.splitBtn.element&&this.splitBtn.element.parentElement&&e.removeClass([this.splitBtn.element.parentElement],i.split(" "))),t&&(e.addClass([s,n],t.replace(/\s+/g," ").trim().split(" ")),this.splitBtn&&this.splitBtn.activeElem&&this.splitBtn.activeElem[0]&&this.splitBtn.activeElem[1]&&e.addClass([this.splitBtn.activeElem[0],this.splitBtn.activeElem[1]],t.replace(/\s+/g," ").trim().split(" ")),this.splitBtn&&this.splitBtn.element&&this.splitBtn.element.parentElement&&e.addClass([this.splitBtn.element.parentElement],t.replace(/\s+/g," ").trim().split(" ")))},a.prototype.changeRtlProps=function(t){t?e.addClass([this.getWrapper()],"e-rtl"):e.removeClass([this.getWrapper()],"e-rtl")},a.prototype.changePaletteProps=function(){e.detach(this.container.children[0]),this.container.style.width="",this.createPalette()},a.prototype.changeOpacityProps=function(t){var i=this.getWrapper();t?(e.removeClass([this.container.parentElement],"e-hide-opacity"),this.createOpacitySlider(e.select(".e-colorpicker-slider",this.container).appendChild(this.createElement("div",{className:"e-opacity-slider"}))),i.classList.contains($t)||i.classList.contains(Jt)||this.appendOpacityValue(e.select(".e-input-container",this.container))):(e.addClass([this.container.parentElement],"e-hide-opacity"),this.opacitySlider.destroy(),e.remove(this.opacitySlider.element),this.opacitySlider=null,i.classList.contains($t)||i.classList.contains(Jt)||e.remove(e.select("."+se,this.container).parentElement))},a.prototype.onPropertyChanged=function(t,i){var n=this;if(!e.isNullOrUndefined(t.value)){var a=this.roundValue(t.value);if(9===a.length)this.element.value=this.roundValue(a).slice(0,7),(r=this.splitBtn&&e.select(".e-split-preview",this.splitBtn.element))&&(r.style.backgroundColor=this.convertToRgbString(this.hexToRgb(t.value)));else if(this.noColor&&"Palette"===this.mode&&""===this.value){var r=this.splitBtn&&e.select(".e-split-preview",this.splitBtn.element);r.style.backgroundColor=""}else this.value=i.value}if(!this.inline&&e.isNullOrUndefined(t.inline)){var l=["disabled","enableRtl"];if(this.splitBtn.setProperties(s.getModel(t,l)),!this.isPopupOpen())return this.changeCssClassProps(t.cssClass,i.cssClass),void this.changeRtlProps(t.enableRtl)}for(var o=this,h=0,u=Object.keys(t);h<u.length;h++)!function(s){switch(s){case"inline":t.inline?(o.getWrapper().appendChild(o.container),o.splitBtn.destroy(),e.detach(o.element.nextElementSibling),o.container.children.length||o.createWidget()):(o.destroyOtherComp(),o.unWireEvents(),o.container.innerHTML="",o.createSplitBtn());break;case"cssClass":o.changeCssClassProps(t.cssClass,i.cssClass);var a=t.cssClass.split(" ").concat(i.cssClass.split(" ")),r=0;(a=a.reduce(function(t,e){return t.indexOf(e)<0&&t.push(e),t},[])).forEach(function(t){0!==r||t!==$t&&"e-hide-valueswitcher"!==t&&t!==ae&&t!==Gt&&t!==Jt||(e.select("."+te,n.container)&&e.remove(e.select("."+te,n.container)),n.createInput(),r++)});break;case"enableRtl":o.isPicker()&&(o.hueSlider.enableRtl=t.enableRtl,o.enableOpacity&&(o.opacitySlider.enableRtl=t.enableRtl),o.setInputEleProps()),o.changeRtlProps(t.enableRtl);break;case"disabled":o.changeDisabledProp(t.disabled);break;case"value":o.value!==i.value&&o.changeValueProp(t.value);break;case"showButtons":o.changeShowBtnProps(t.showButtons);break;case"mode":"Picker"===t.mode?o.switchToPicker():o.switchToPalette();break;case"modeSwitcher":o.changeModeSwitcherProp(t.modeSwitcher);break;case"columns":case"presetColors":o.isPicker()||o.changePaletteProps();break;case"noColor":t.noColor?"Palette"!==o.mode||o.modeSwitcher||o.setNoColor():o.changePaletteProps();break;case"enableOpacity":o.changeOpacityProps(t.enableOpacity);break;case"showRecentColors":if(!t.showRecentColors){var l=o.container.querySelector(".e-clr-pal-rec-wpr");l&&e.detach(l)}o.recentColors=[]}}(u[h])},a.prototype.focusIn=function(){this.element.parentElement.focus()},Xt([e.Property("#008000ff")],a.prototype,"value",void 0),Xt([e.Property("")],a.prototype,"cssClass",void 0),Xt([e.Property(!1)],a.prototype,"disabled",void 0),Xt([e.Property("Picker")],a.prototype,"mode",void 0),Xt([e.Property(!0)],a.prototype,"modeSwitcher",void 0),Xt([e.Property(null)],a.prototype,"presetColors",void 0),Xt([e.Property(!0)],a.prototype,"showButtons",void 0),Xt([e.Property(10)],a.prototype,"columns",void 0),Xt([e.Property(!1)],a.prototype,"inline",void 0),Xt([e.Property(!1)],a.prototype,"noColor",void 0),Xt([e.Property(!1)],a.prototype,"enablePersistence",void 0),Xt([e.Property(!0)],a.prototype,"enableOpacity",void 0),Xt([e.Property(!1)],a.prototype,"createPopupOnClick",void 0),Xt([e.Property(!1)],a.prototype,"showRecentColors",void 0),Xt([e.Event()],a.prototype,"select",void 0),Xt([e.Event()],a.prototype,"change",void 0),Xt([e.Event()],a.prototype,"beforeTileRender",void 0),Xt([e.Event()],a.prototype,"beforeOpen",void 0),Xt([e.Event()],a.prototype,"open",void 0),Xt([e.Event()],a.prototype,"beforeClose",void 0),Xt([e.Event()],a.prototype,"beforeModeSwitch",void 0),Xt([e.Event()],a.prototype,"onModeSwitch",void 0),Xt([e.Event()],a.prototype,"created",void 0),a=Xt([e.NotifyPropertyChanges],a)}(e.Component),ue=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),pe=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},de=function(i){function s(t,e){var s=i.call(this,t,e)||this;return s.previousValue=null,s.isHiddenInput=!1,s.isForm=!1,s.inputPreviousValue=null,s.textboxOptions=t,s}return ue(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":t.Input.removeFloating(this.textboxWrapper),t.Input.addFloating(this.respectiveElement,this.floatLabelType,this.placeholder);break;case"enabled":t.Input.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container),this.bindClearEvent();break;case"width":t.Input.setWidth(i.width,this.textboxWrapper.container);break;case"value":var r=this.isProtectedOnChange;this.isProtectedOnChange=!0,t.Input.isBlank(this.value)||(this.value=this.value.toString()),this.isProtectedOnChange=r,t.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):(e.isNullOrUndefined(this.isAngular)||!this.isAngular||this.isAngular&&!this.preventChange||this.isAngular&&e.isNullOrUndefined(this.preventChange))&&this.raiseChangeEvent();break;case"htmlAttributes":this.updateHTMLAttributesToElement(),this.updateHTMLAttributesToWrapper(),this.checkAttributes(!0),this.multiline&&!e.isNullOrUndefined(this.textarea)?t.Input.validateInputType(this.textboxWrapper.container,this.textarea):t.Input.validateInputType(this.textboxWrapper.container,this.element);break;case"readonly":t.Input.setReadonly(this.readonly,this.respectiveElement);break;case"type":"TEXTAREA"!==this.respectiveElement.tagName&&(this.respectiveElement.setAttribute("type",this.type),t.Input.validateInputType(this.textboxWrapper.container,this.element),this.raiseChangeEvent());break;case"showClearButton":t.Input.setClearButton(this.showClearButton,this.respectiveElement,this.textboxWrapper),this.bindClearEvent();break;case"enableRtl":t.Input.setEnableRtl(this.enableRtl,[this.textboxWrapper.container]);break;case"placeholder":t.Input.setPlaceholder(this.placeholder,this.respectiveElement),t.Input.calculateWidth(this.respectiveElement,this.textboxWrapper.container);break;case"autocomplete":"on"!==this.autocomplete&&""!==this.autocomplete?this.respectiveElement.autocomplete=this.autocomplete:this.removeAttributes(["autocomplete"]);break;case"cssClass":t.Input.updateCssClass(i.cssClass,s.cssClass,this.textboxWrapper.container);break;case"locale":this.globalize=new e.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),t.Input.setPlaceholder(this.placeholder,this.respectiveElement)}},s.prototype.getModuleName=function(){return"textbox"},s.prototype.preRender=function(){if(this.cloneElement=this.element.cloneNode(!0),this.formElement=e.closest(this.element,"form"),e.isNullOrUndefined(this.formElement)||(this.isForm=!0),"EJS-TEXTBOX"===this.element.tagName){var t=e.getValue("ej2_instances",this.element),i=this.multiline?this.createElement("textarea"):this.createElement("input");for(a=0;a<this.element.attributes.length;a++)"id"!==(r=this.element.attributes[a].nodeName)&&"class"!==r?(i.setAttribute(r,this.element.attributes[a].nodeValue),i.innerHTML=this.element.innerHTML,"name"===r&&this.element.removeAttribute("name")):"class"===r&&i.setAttribute(r,this.element.className.split(" ").filter(function(t){return 0!==t.indexOf("ng-")}).join(" "));this.element.appendChild(i),this.element=i,e.setValue("ej2_instances",t,this.element)}this.updateHTMLAttributesToElement(),this.checkAttributes(!1),!e.isNullOrUndefined(this.textboxOptions)&&void 0!==this.textboxOptions.value||""===this.element.value||this.setProperties({value:this.element.value},!0),"TEXTAREA"!==this.element.tagName&&this.element.setAttribute("type",this.type),("text"===this.type||"INPUT"===this.element.tagName&&this.multiline&&this.isReact)&&this.element.setAttribute("role","textbox"),this.globalize=new e.Internationalization(this.locale);var s={placeholder:this.placeholder};if(this.l10n=new e.L10n("textbox",s,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.element.hasAttribute("id")||this.element.setAttribute("id",e.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",e.getUniqueID("textarea"));for(var n=["placeholder","disabled","value","readonly","type","autocomplete"],a=0;a<this.element.attributes.length;a++){var r=this.element.attributes[a].nodeName;this.element.hasAttribute(r)&&Z.indexOf(r)<0&&"id"!==r&&"type"!==r&&"e-mappinguid"!==r&&(this.textarea.setAttribute(r,this.element.attributes[a].nodeValue),n.indexOf(r)<0&&(this.element.removeAttribute(r),a--))}}},s.prototype.checkAttributes=function(t){for(var i=0,s=t?e.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly","type","autocomplete"];i<s.length;i++){var n=s[i];if(!e.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"disabled":if(e.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.enabled||t){var a="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n);this.setProperties({enabled:a},!t)}break;case"readonly":if(e.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.readonly||t){var r="readonly"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n);this.setProperties({readonly:r},!t)}break;case"placeholder":(e.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"autocomplete":if(e.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.autocomplete||t){var l="off"===this.element.autocomplete?"off":"on";this.setProperties({autocomplete:l},!t)}break;case"value":(e.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.value||t)&&""!==this.element.value&&this.setProperties({value:this.element.value},!t);break;case"type":(e.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.type||t)&&this.setProperties({type:this.element.type},!t)}}},s.prototype.render=function(){var i=this.cssClass;e.isNullOrUndefined(this.cssClass)||""===this.cssClass||(i=t.Input.getInputValidClassList(this.cssClass)),this.respectiveElement=this.isHiddenInput?this.textarea:this.element,this.textboxWrapper=t.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.updateHTMLAttributesToWrapper(),this.isHiddenInput&&this.respectiveElement.parentNode.insertBefore(this.element,this.respectiveElement),this.wireEvents(),e.isNullOrUndefined(this.value)||(t.Input.setValue(this.value,this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value)),e.isNullOrUndefined(this.value)||(this.initialValue=this.value,this.setInitialValue()),"on"!==this.autocomplete&&""!==this.autocomplete?this.respectiveElement.autocomplete=this.autocomplete:e.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,t.Input.setWidth(this.width,this.textboxWrapper.container),!e.isNullOrUndefined(e.closest(this.element,"fieldset"))&&e.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.element.hasAttribute("aria-labelledby")||this.element.hasAttribute("placeholder")||this.element.hasAttribute("aria-label")||this.element.setAttribute("aria-label","textbox"),this.renderComplete()},s.prototype.updateHTMLAttributesToWrapper=function(){t.Input.updateHTMLAttributesToWrapper(this.htmlAttributes,this.textboxWrapper.container)},s.prototype.updateHTMLAttributesToElement=function(){t.Input.updateHTMLAttributesToElement(this.htmlAttributes,this.respectiveElement?this.respectiveElement:this.multiline&&!e.isNullOrUndefined(this.textarea)?this.textarea:this.element)},s.prototype.setInitialValue=function(){this.isAngular||this.respectiveElement.setAttribute("value",this.initialValue)},s.prototype.wireEvents=function(){e.EventHandler.add(this.respectiveElement,"focus",this.focusHandler,this),e.EventHandler.add(this.respectiveElement,"blur",this.focusOutHandler,this),e.EventHandler.add(this.respectiveElement,"keydown",this.keydownHandler,this),e.EventHandler.add(this.respectiveElement,"input",this.inputHandler,this),e.EventHandler.add(this.respectiveElement,"change",this.changeHandler,this),this.isForm&&e.EventHandler.add(this.formElement,"reset",this.resetForm,this),this.bindClearEvent(),!e.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")&&e.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 t=this.textboxWrapper.container.querySelector(".e-float-text");e.isNullOrUndefined(t)||(t.classList.add("e-label-top"),t.classList.contains("e-label-bottom")&&t.classList.remove("e-label-bottom"))},s.prototype.resetValue=function(t){var e=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.value=t,null!=t||!this.textboxWrapper.container.classList.contains("e-valid-input")||"Always"===this.floatLabelType&&this.textboxWrapper.container.classList.contains("e-outline")||this.textboxWrapper.container.classList.remove("e-valid-input"),this.isProtectedOnChange=e},s.prototype.resetForm=function(){if(this.isAngular?this.resetValue(""):this.resetValue(this.initialValue),!e.isNullOrUndefined(this.textboxWrapper)){var t=this.textboxWrapper.container.querySelector(".e-float-text");e.isNullOrUndefined(t)||"Always"===this.floatLabelType||(e.isNullOrUndefined(this.initialValue)||""===this.initialValue?(t.classList.add("e-label-bottom"),t.classList.remove("e-label-top")):""!==this.initialValue&&(t.classList.add("e-label-top"),t.classList.remove("e-label-bottom")))}},s.prototype.focusHandler=function(t){var e={container:this.textboxWrapper.container,event:t,value:this.value};this.trigger("focus",e)},s.prototype.focusOutHandler=function(t){null===this.previousValue&&null===this.value&&""===this.respectiveElement.value||this.previousValue===this.value||this.raiseChangeEvent(t,!0);var e={container:this.textboxWrapper.container,event:t,value:this.value};this.trigger("blur",e)},s.prototype.keydownHandler=function(t){13!==t.keyCode&&9!==t.keyCode||!(null!==this.previousValue&&""!==this.previousValue||null!==this.value&&""!==this.value||""!==this.respectiveElement.value)||this.setProperties({value:this.respectiveElement.value},!0)},s.prototype.inputHandler=function(t){var e=this,i={event:t,value:this.respectiveElement.value,previousValue:this.inputPreviousValue,container:this.textboxWrapper.container};this.inputPreviousValue=this.respectiveElement.value,this.isAngular&&(e.localChange({value:this.respectiveElement.value}),this.preventChange=!0),this.isVue&&(this.preventChange=!0),this.trigger("input",i),t.stopPropagation()},s.prototype.changeHandler=function(t){this.setProperties({value:this.respectiveElement.value},!0),this.previousValue!==this.value&&this.raiseChangeEvent(t,!0),t.stopPropagation()},s.prototype.raiseChangeEvent=function(t,i){var s={event:t,value:this.value,previousValue:this.previousValue,container:this.textboxWrapper.container,isInteraction:i||!1,isInteracted:i||!1};this.preventChange=!1,this.trigger("change",s),this.previousValue=this.value,"INPUT"===this.element.tagName&&this.multiline&&"mozilla"===e.Browser.info.name&&(this.element.value=this.respectiveElement.value)},s.prototype.bindClearEvent=function(){this.showClearButton&&(this.enabled?e.EventHandler.add(this.textboxWrapper.clearButton,"mousedown touchstart",this.resetInputHandler,this):e.EventHandler.remove(this.textboxWrapper.clearButton,"mousedown touchstart",this.resetInputHandler))},s.prototype.resetInputHandler=function(i){if(i.preventDefault(),!this.textboxWrapper.clearButton.classList.contains("e-clear-icon-hide")||this.textboxWrapper.container.classList.contains("e-static-clear")){t.Input.setValue("",this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value),this.setProperties({value:this.respectiveElement.value},!0);var s={event:i,value:this.respectiveElement.value,previousValue:this.inputPreviousValue,container:this.textboxWrapper.container};if(this.trigger("input",s),this.inputPreviousValue=this.respectiveElement.value,this.raiseChangeEvent(i,!0),e.closest(this.element,"form")){var n=this.element,a=document.createEvent("KeyboardEvent");a.initEvent("keyup",!1,!0),n.dispatchEvent(a)}}},s.prototype.unWireEvents=function(){e.EventHandler.remove(this.respectiveElement,"focus",this.focusHandler),e.EventHandler.remove(this.respectiveElement,"blur",this.focusOutHandler),e.EventHandler.remove(this.respectiveElement,"keydown",this.keydownHandler),e.EventHandler.remove(this.respectiveElement,"input",this.inputHandler),e.EventHandler.remove(this.respectiveElement,"change",this.changeHandler),this.isForm&&e.EventHandler.remove(this.formElement,"reset",this.resetForm),!e.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")&&e.EventHandler.remove(this.textboxWrapper.container.querySelector(".e-float-text"),"animationstart",this.animationHandler)},s.prototype.destroy=function(){this.unWireEvents(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),"INPUT"===this.element.tagName&&this.multiline&&(e.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-disabled","aria-readonly","aria-labelledby"]),e.isNullOrUndefined(this.textboxWrapper)||(this.textboxWrapper.container.insertAdjacentElement("afterend",this.respectiveElement),e.detach(this.textboxWrapper.container)),this.textboxWrapper=null,t.Input.destroy({element:this.respectiveElement,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),i.prototype.destroy.call(this)},s.prototype.addIcon=function(e,i){t.Input.addIcon(e,i,this.textboxWrapper.container,this.respectiveElement,this.createElement)},s.prototype.getPersistData=function(){var t=["value"];return this.addOnPersist(t)},s.prototype.addAttributes=function(e){for(var i=0,s=Object.keys(e);i<s.length;i++){var n=s[i];"disabled"===n?(this.setProperties({enabled:!1},!0),t.Input.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container)):"readonly"===n?(this.setProperties({readonly:!0},!0),t.Input.setReadonly(this.readonly,this.respectiveElement)):"class"===n?this.respectiveElement.classList.add(e[""+n]):"placeholder"===n?(this.setProperties({placeholder:e[""+n]},!0),t.Input.setPlaceholder(this.placeholder,this.respectiveElement)):("rows"===n&&this.respectiveElement.tagName,this.respectiveElement.setAttribute(n,e[""+n]))}},s.prototype.removeAttributes=function(e){for(var i=0,s=e;i<s.length;i++){var n=s[i];"disabled"===n?(this.setProperties({enabled:!0},!0),t.Input.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container)):"readonly"===n?(this.setProperties({readonly:!1},!0),t.Input.setReadonly(this.readonly,this.respectiveElement)):"placeholder"===n?(this.setProperties({placeholder:null},!0),t.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"))&&e.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"))&&e.removeClass([this.textboxWrapper.container],["e-input-focus"]))},pe([e.Property("text")],s.prototype,"type",void 0),pe([e.Property(!1)],s.prototype,"readonly",void 0),pe([e.Property(null)],s.prototype,"value",void 0),pe([e.Property("Never")],s.prototype,"floatLabelType",void 0),pe([e.Property("")],s.prototype,"cssClass",void 0),pe([e.Property(null)],s.prototype,"placeholder",void 0),pe([e.Property("on")],s.prototype,"autocomplete",void 0),pe([e.Property({})],s.prototype,"htmlAttributes",void 0),pe([e.Property(!1)],s.prototype,"multiline",void 0),pe([e.Property(!0)],s.prototype,"enabled",void 0),pe([e.Property(!1)],s.prototype,"showClearButton",void 0),pe([e.Property(!1)],s.prototype,"enablePersistence",void 0),pe([e.Property(null)],s.prototype,"width",void 0),pe([e.Event()],s.prototype,"created",void 0),pe([e.Event()],s.prototype,"destroyed",void 0),pe([e.Event()],s.prototype,"change",void 0),pe([e.Event()],s.prototype,"blur",void 0),pe([e.Event()],s.prototype,"focus",void 0),pe([e.Event()],s.prototype,"input",void 0),s=pe([e.NotifyPropertyChanges],s)}(e.Component),ce=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),me=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},ve="e-auto-width",fe=function(i){function s(t,e){var s=i.call(this,t,e)||this;return s.previousValue=null,s.isForm=!1,s.inputPreviousValue=null,s.textareaOptions=t,s}return ce(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":t.Input.removeFloating(this.textareaWrapper),t.Input.addFloating(this.element,this.floatLabelType,this.placeholder),"Never"===this.floatLabelType&&this.element.removeAttribute("aria-labelledby");break;case"enabled":t.Input.setEnabled(this.enabled,this.element,this.floatLabelType,this.textareaWrapper.container),this.bindClearEvent(),this.enabled||"None"===this.resizeMode?this.element.classList.add(this.getCurrentResizeClass(this.resizeMode)):(this.element.classList.remove(this.getCurrentResizeClass(this.resizeMode)),this.element.classList.add("e-resize-none"));break;case"width":"None"!==this.resizeMode&&"Vertical"!==this.resizeMode?(this.setElementWidth(i.width),this.textareaWrapper.container.classList.add(ve)):(this.textareaWrapper.container.classList.contains(ve)&&this.textareaWrapper.container.classList.remove(ve),t.Input.setWidth(i.width,this.textareaWrapper.container));break;case"value":var r=this.isProtectedOnChange;this.isProtectedOnChange=!0,t.Input.isBlank(this.value)||(this.value=this.value.toString()),this.isProtectedOnChange=r,t.Input.setValue(this.value,this.element,this.floatLabelType,this.showClearButton),this.inputPreviousValue=this.element.value,(this.isAngular||this.isVue)&&!0===this.preventChange?(this.previousValue=this.isAngular?this.value:this.previousValue,this.preventChange=!1):(e.isNullOrUndefined(this.isAngular)||!this.isAngular||this.isAngular&&!this.preventChange||this.isAngular&&e.isNullOrUndefined(this.preventChange))&&this.raiseChangeEvent();break;case"htmlAttributes":this.updateHTMLAttributesToElement(),this.updateHTMLAttributesToWrapper(),this.checkAttributes(!0),t.Input.validateInputType(this.textareaWrapper.container,this.element);break;case"readonly":t.Input.setReadonly(this.readonly,this.element),this.readonly?this.element.setAttribute("aria-readonly","true"):this.element.removeAttribute("aria-readonly");break;case"showClearButton":t.Input.setClearButton(this.showClearButton,this.element,this.textareaWrapper),this.bindClearEvent();break;case"enableRtl":t.Input.setEnableRtl(this.enableRtl,[this.textareaWrapper.container]);break;case"placeholder":t.Input.setPlaceholder(this.placeholder,this.element),t.Input.calculateWidth(this.element,this.textareaWrapper.container);break;case"cssClass":t.Input.updateCssClass(i.cssClass,s.cssClass,this.textareaWrapper.container);break;case"locale":this.globalize=new e.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),t.Input.setPlaceholder(this.placeholder,this.element);break;case"rows":this.rows&&this.element.setAttribute("rows",this.rows.toString());break;case"cols":this.cols&&(this.element.setAttribute("cols",this.cols.toString()),null==this.width&&this.textareaWrapper.container.classList.add(ve));break;case"maxLength":this.maxLength&&this.element.setAttribute("maxlength",this.maxLength.toString());break;case"resizeMode":if(this.enabled){if(this.element.classList.contains(this.getCurrentResizeClass(s.resizeMode))&&this.element.classList.remove(this.getCurrentResizeClass(s.resizeMode)),this.element.classList.add(this.getCurrentResizeClass(this.resizeMode)),!this.element.style.width||"None"!==this.resizeMode&&"Vertical"!==this.resizeMode){var l=this.element.offsetWidth;this.element.style.width=l+"px",this.textareaWrapper.container.style.width&&(this.textareaWrapper.container.style.width="")}else t.Input.setWidth(this.element.style.width,this.textareaWrapper.container);this.setWrapperWidth()}}},s.prototype.preRender=function(){if(this.formElement=e.closest(this.element,"form"),e.isNullOrUndefined(this.formElement)||(this.isForm=!0),"EJS-TEXTAREA"===this.element.tagName||"EJS-SMARTTEXTAREA"===this.element.tagName){var t=e.getValue("ej2_instances",this.element),i=this.createElement("textarea"),s=0;for(s;s<this.element.attributes.length;s++){var n=this.element.attributes[s].nodeName;"id"!==n&&"class"!==n?(i.setAttribute(n,this.element.attributes[s].nodeValue),i.innerHTML=this.element.innerHTML,"name"===n&&this.element.removeAttribute("name")):"class"===n&&i.setAttribute(n,this.element.className.split(" ").filter(function(t){return 0!==t.indexOf("ng-")}).join(" "))}this.element.appendChild(i),this.element=i,e.setValue("ej2_instances",t,this.element)}this.updateHTMLAttributesToElement(),this.checkAttributes(!1),!e.isNullOrUndefined(this.textareaOptions)&&void 0!==this.textareaOptions.value||""===this.element.value||this.setProperties({value:this.element.value},!0),this.globalize=new e.Internationalization(this.locale);var a={placeholder:this.placeholder};this.l10n=new e.L10n("textarea",a,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.element.hasAttribute("id")||this.element.setAttribute("id",e.getUniqueID("textbox")),this.element.hasAttribute("name")||this.element.setAttribute("name",this.element.getAttribute("id")),this.rows&&this.element.setAttribute("rows",this.rows.toString()),this.cols&&this.element.setAttribute("cols",this.cols.toString()),this.maxLength&&this.element.setAttribute("maxlength",this.maxLength.toString()),!this.element.style.resize&&this.enabled&&this.element.classList.add(this.getCurrentResizeClass(this.resizeMode)),this.enabled&&this.element.setAttribute("aria-multiline","true")},s.prototype.render=function(){var i=this.cssClass;e.isNullOrUndefined(this.cssClass)||""===this.cssClass||(i=t.Input.getInputValidClassList(this.cssClass)),this.textareaWrapper=t.Input.createInput({element:this.element,floatLabelType:this.floatLabelType,properties:{enabled:this.enabled,enableRtl:this.enableRtl,cssClass:i,readonly:this.readonly,placeholder:this.placeholder,showClearButton:this.showClearButton}}),this.updateHTMLAttributesToWrapper(),this.wireEvents(),e.isNullOrUndefined(this.value)||t.Input.setValue(this.value,this.element,this.floatLabelType,this.showClearButton),e.isNullOrUndefined(this.value)||(this.initialValue=this.value,this.isAngular||this.element.setAttribute("value",this.initialValue)),this.previousValue=this.value,this.inputPreviousValue=this.value,this.element.defaultValue=this.element.value,t.Input.setWidth(this.width,this.textareaWrapper.container),this.setWrapperWidth(),this.renderComplete()},s.prototype.getModuleName=function(){return"textarea"},s.prototype.getPersistData=function(){var t=["value"];return this.addOnPersist(t)},s.prototype.checkAttributes=function(t){for(var i=0,s=t?e.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly"];i<s.length;i++){var n=s[i];if(!e.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"disabled":if(e.isNullOrUndefined(this.textareaOptions)||void 0===this.textareaOptions.enabled||t){var a="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n);this.setProperties({enabled:a},!t)}break;case"readonly":if(e.isNullOrUndefined(this.textareaOptions)||void 0===this.textareaOptions.readonly||t){var r="readonly"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n);this.setProperties({readonly:r},!t)}break;case"placeholder":(e.isNullOrUndefined(this.textareaOptions)||void 0===this.textareaOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"value":(e.isNullOrUndefined(this.textareaOptions)||void 0===this.textareaOptions.value||t)&&""!==this.element.value&&this.setProperties({value:this.element.value},!t)}}},s.prototype.wireEvents=function(){e.EventHandler.add(this.element,"focus",this.focusHandler,this),e.EventHandler.add(this.element,"blur",this.focusOutHandler,this),e.EventHandler.add(this.element,"keydown",this.keydownHandler,this),e.EventHandler.add(this.element,"input",this.inputHandler,this),e.EventHandler.add(this.element,"change",this.changeHandler,this),this.isForm&&e.EventHandler.add(this.formElement,"reset",this.resetForm,this),this.bindClearEvent()},s.prototype.unWireEvents=function(){e.EventHandler.remove(this.element,"focus",this.focusHandler),e.EventHandler.remove(this.element,"blur",this.focusOutHandler),e.EventHandler.remove(this.element,"keydown",this.keydownHandler),e.EventHandler.remove(this.element,"input",this.inputHandler),e.EventHandler.remove(this.element,"change",this.changeHandler),this.isForm&&e.EventHandler.remove(this.formElement,"reset",this.resetForm)},s.prototype.destroy=function(){this.unWireEvents(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),this.element.value=this.element.defaultValue,this.element.classList.remove("e-input","e-resize-x","e-resize-y","e-resize-xy","e-resize-none"),this.textareaWrapper.container.style.width.includes("%")&&e.EventHandler.remove(this.element,"mousemove",this.onMouseMove),this.removeAttributes(["aria-disabled","aria-readonly","aria-labelledby","aria-multiline"]),e.isNullOrUndefined(this.textareaWrapper)||(this.textareaWrapper.container.insertAdjacentElement("afterend",this.element),e.detach(this.textareaWrapper.container)),this.textareaWrapper=null,t.Input.destroy({element:this.element,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),this.formElement=null,i.prototype.destroy.call(this)},s.prototype.focusHandler=function(t){var e={container:this.textareaWrapper.container,event:t,value:this.value};this.trigger("focus",e)},s.prototype.focusOutHandler=function(t){null===this.previousValue&&null===this.value||this.previousValue===this.value||this.raiseChangeEvent(t,!0);var e={container:this.textareaWrapper.container,event:t,value:this.value};this.trigger("blur",e)},s.prototype.keydownHandler=function(t){13!==t.keyCode&&9!==t.keyCode||!(null!==this.previousValue&&""!==this.previousValue||null!==this.value&&""!==this.value||""!==this.element.value)||this.setProperties({value:this.element.value},!0)},s.prototype.inputHandler=function(t){var e=this,i={event:t,value:this.element.value,previousValue:this.inputPreviousValue,container:this.textareaWrapper.container};this.inputPreviousValue=this.element.value,this.isAngular&&(e.localChange({value:this.element.value}),this.preventChange=!0),this.isVue&&(this.preventChange=!0),this.trigger("input",i),t.stopPropagation()},s.prototype.changeHandler=function(t){this.setProperties({value:this.element.value},!0),this.previousValue!==this.value&&this.raiseChangeEvent(t,!0),t.stopPropagation()},s.prototype.raiseChangeEvent=function(t,e){var i={event:t,value:this.value,previousValue:this.previousValue,container:this.textareaWrapper.container,isInteraction:e||!1,isInteracted:e||!1};this.preventChange=!1,this.trigger("change",i),this.previousValue=this.value},s.prototype.updateHTMLAttributesToWrapper=function(){t.Input.updateHTMLAttributesToWrapper(this.htmlAttributes,this.textareaWrapper.container)},s.prototype.updateHTMLAttributesToElement=function(){t.Input.updateHTMLAttributesToElement(this.htmlAttributes,this.element)},s.prototype.bindClearEvent=function(){this.showClearButton&&(this.enabled?e.EventHandler.add(this.textareaWrapper.clearButton,"mousedown touchstart",this.resetInputHandler,this):e.EventHandler.remove(this.textareaWrapper.clearButton,"mousedown touchstart",this.resetInputHandler))},s.prototype.resetInputHandler=function(i){i.preventDefault(),this.textareaWrapper.clearButton.classList.contains("e-clear-icon-hide")&&!this.textareaWrapper.container.classList.contains("e-static-clear")||(t.Input.setValue("",this.element,this.floatLabelType,this.showClearButton),this.setProperties({value:this.element.value},!0));var s={event:i,value:this.element.value,previousValue:this.inputPreviousValue,container:this.textareaWrapper.container};if(this.trigger("input",s),this.inputPreviousValue=this.element.value,this.raiseChangeEvent(i,!0),e.closest(this.element,"form")){var n=this.element,a=document.createEvent("KeyboardEvent");a.initEvent("keyup",!1,!0),n.dispatchEvent(a)}},s.prototype.addAttributes=function(e){for(var i=0,s=Object.keys(e);i<s.length;i++){var n=s[i];"disabled"===n?(this.setProperties({enabled:!1},!0),t.Input.setEnabled(this.enabled,this.element,this.floatLabelType,this.textareaWrapper.container)):"readonly"===n?(this.setProperties({readonly:!0},!0),t.Input.setReadonly(this.readonly,this.element)):"class"===n?this.element.classList.add(e[""+n]):"placeholder"===n?(this.setProperties({placeholder:e[""+n]},!0),t.Input.setPlaceholder(this.placeholder,this.element)):this.element.setAttribute(n,e[""+n])}},s.prototype.removeAttributes=function(e){for(var i=0,s=e;i<s.length;i++){var n=s[i];"disabled"===n?(this.setProperties({enabled:!0},!0),t.Input.setEnabled(this.enabled,this.element,this.floatLabelType,this.textareaWrapper.container)):"readonly"===n?(this.setProperties({readonly:!1},!0),t.Input.setReadonly(this.readonly,this.element)):"placeholder"===n?(this.setProperties({placeholder:null},!0),t.Input.setPlaceholder(this.placeholder,this.element)):this.element.removeAttribute(n)}},s.prototype.focusIn=function(){document.activeElement!==this.element&&this.enabled&&(this.element.focus(),(this.textareaWrapper.container.classList.contains("e-input-group")||this.textareaWrapper.container.classList.contains("e-outline")||this.textareaWrapper.container.classList.contains("e-filled"))&&e.addClass([this.textareaWrapper.container],["e-input-focus"]))},s.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.element.blur(),(this.textareaWrapper.container.classList.contains("e-input-group")||this.textareaWrapper.container.classList.contains("e-outline")||this.textareaWrapper.container.classList.contains("e-filled"))&&e.removeClass([this.textareaWrapper.container],["e-input-focus"]))},s.prototype.setWrapperWidth=function(){this.enabled&&("None"!==this.resizeMode&&"Vertical"!==this.resizeMode||this.cols||this.element.getAttribute("cols"))?("None"===this.resizeMode||"Vertical"===this.resizeMode||this.textareaWrapper.container.style.width.includes("%")||this.setElementWidth(this.textareaWrapper.container.style.width),this.textareaWrapper.container.style.width.includes("%")||(this.textareaWrapper.container.classList.add(ve),this.textareaWrapper.container.style.width=""),this.textareaWrapper.container.style.width.includes("%")&&e.EventHandler.add(this.element,"mousemove",this.onMouseMove,this)):this.textareaWrapper.container.classList.contains(ve)&&this.textareaWrapper.container.classList.remove(ve)},s.prototype.onMouseMove=function(){var t=this;if("auto"!==this.textareaWrapper.container.style.width){var e=this.element.style.width;setTimeout(function(){var i=t.element.style.width;e!==i&&(t.textareaWrapper.container.style.width="auto")},5)}},s.prototype.resetForm=function(){if(this.isAngular?this.resetValue(""):this.resetValue(this.initialValue),!e.isNullOrUndefined(this.textareaWrapper)){var t=this.textareaWrapper.container.querySelector(".e-float-text");e.isNullOrUndefined(t)||"Always"===this.floatLabelType||(e.isNullOrUndefined(this.initialValue)||""===this.initialValue?(t.classList.add("e-label-bottom"),t.classList.remove("e-label-top")):""!==this.initialValue&&(t.classList.add("e-label-top"),t.classList.remove("e-label-bottom")))}},s.prototype.resetValue=function(t){var e=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.value=t,null!=t||!this.textareaWrapper.container.classList.contains("e-valid-input")||"Always"===this.floatLabelType&&this.textareaWrapper.container.classList.contains("e-outline")||this.textareaWrapper.container.classList.remove("e-valid-input"),this.isProtectedOnChange=e},s.prototype.setElementWidth=function(t){"number"==typeof t?this.element.style.width=e.formatUnit(t):"string"==typeof t&&(this.element.style.width=t.match(/px|%|em/)?t:e.formatUnit(t))},s.prototype.getCurrentResizeClass=function(t){return"None"===t?"e-resize-none":"Both"===t?"e-resize-xy":"Horizontal"===t?"e-resize-x":"e-resize-y"},me([e.Property(!1)],s.prototype,"readonly",void 0),me([e.Property(null)],s.prototype,"value",void 0),me([e.Property("Never")],s.prototype,"floatLabelType",void 0),me([e.Property("")],s.prototype,"cssClass",void 0),me([e.Property(null)],s.prototype,"placeholder",void 0),me([e.Property({})],s.prototype,"htmlAttributes",void 0),me([e.Property(!0)],s.prototype,"enabled",void 0),me([e.Property(!1)],s.prototype,"showClearButton",void 0),me([e.Property(!1)],s.prototype,"enablePersistence",void 0),me([e.Property(null)],s.prototype,"width",void 0),me([e.Property("Both")],s.prototype,"resizeMode",void 0),me([e.Property(null)],s.prototype,"maxLength",void 0),me([e.Property(null)],s.prototype,"cols",void 0),me([e.Property(null)],s.prototype,"rows",void 0),me([e.Event()],s.prototype,"created",void 0),me([e.Event()],s.prototype,"destroyed",void 0),me([e.Event()],s.prototype,"change",void 0),me([e.Event()],s.prototype,"blur",void 0),me([e.Event()],s.prototype,"focus",void 0),me([e.Event()],s.prototype,"input",void 0),s=me([e.NotifyPropertyChanges],s)}(e.Component),ge=function(){function t(){}return t.createStyledDiv=function(t,e){var i=document.createElement("div"),s={position:"absolute",left:-9999,top:0,zIndex:-2e3};this.properties.forEach(function(e){s[""+e]=getComputedStyle(t)[e]}),Object.keys(s).forEach(function(t){i.style[""+t]=s[""+t]});var n=t.offsetWidth-t.clientWidth;return i.style.width=t.clientWidth+n+"px",i.innerHTML=e,t&&t.parentNode&&t.parentNode.insertBefore(i,t.nextSibling),i},t.createCaretMarker=function(t,e){var i=this.createStyledDiv(t,e),s=i.ownerDocument.getElementById("caret-position-marker"),n={left:s.offsetLeft,top:s.offsetTop,height:s.offsetHeight};return i&&i.parentNode&&i.parentNode.removeChild(i),n},t.escapeHtml=function(t){return t.replace(/<|>|`|"|&/g,"?").replace(/\r\n|\r|\n/g,"<br/>")},t.getCaretPosition=function(t){var e=t.selectionStart||0,i=t.value.slice(0,e),s=t.value.slice(e),n='<span style="position: relative; display: inline;">'+this.escapeHtml(i)+"</span>";n+='<span id="caret-position-marker" style="position: relative; display: inline;">|</span>',n+='<span style="position: relative; display: inline;">'+this.escapeHtml(s)+"</span>";var a=this.createCaretMarker(t,n);return a.pos=e,a},t.adjustScrollToCaretPosition=function(t){var e=this.getCaretPosition(t),i=parseFloat(window.getComputedStyle(t).lineHeight);e.top>t.clientHeight+t.scrollTop-i&&(t.scrollTop=e.top-t.clientHeight+i)},t.getTextAreaPosition=function(t){var e=window.getComputedStyle(t),i=this.getCaretPosition(t);return{top:i.top+parseFloat(e.borderTopWidth)+t.offsetTop-t.scrollTop,left:i.left+parseFloat(e.borderLeftWidth)+t.offsetLeft-t.scrollLeft-.25,height:i.height,elemStyle:e}},t.insertCharacter=function(t,e){var i=t.selectionStart,s=t.selectionEnd;t.value=t.value.substring(0,i)+e+t.value.substring(s),i+=e.length,t.setSelectionRange(i,i)},t.properties=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopWidth","boxSizing","fontFamily","fontSize","fontWeight","height","letterSpacing","lineHeight","marginBottom","marginLeft","marginRight","marginTop","outlineWidth","overflow","overflowX","overflowY","paddingBottom","paddingLeft","paddingRight","paddingTop","textAlign","textOverflow","textTransform","whiteSpace","wordBreak","wordWrap","width"],t}(),ye=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),be=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},Ce=function(t,e,i,s){return new(i||(i=Promise))(function(n,a){function r(t){try{o(s.next(t))}catch(t){a(t)}}function l(t){try{o(s.throw(t))}catch(t){a(t)}}function o(t){t.done?n(t.value):new i(function(e){e(t.value)}).then(r,l)}o((s=s.apply(t,e||[])).next())})},Ee=function(t,e){function i(t){return function(e){return s([t,e])}}function s(i){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,a&&(r=2&i[0]?a.return:i[0]?a.throw||((r=a.return)&&r.call(a),0):a.next)&&!(r=r.call(a,i[1])).done)return r;switch(a=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,a=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(r=o.trys,!(r=r.length>0&&r[r.length-1])&&(6===i[0]||2===i[0])){o=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){o.label=i[1];break}if(6===i[0]&&o.label<r[1]){o.label=r[1],r=i;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(i);break}r[2]&&o.ops.pop(),o.trys.pop();continue}i=e.call(t,o)}catch(t){i=[6,t],a=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}var n,a,r,l,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return l={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l};!function(t){t.System="system",t.User="user",t.Assistant="assistant"}(t.ChatMessageRole||(t.ChatMessageRole={}));var Se=function(i){function s(t,e){return i.call(this,t,e)||this}return ye(s,i),s.prototype.render=function(){if(i.prototype.render.call(this),this.element instanceof HTMLTextAreaElement){this.textArea=this.element;var t=e.createElement("smart-textarea");if(t.classList.add("e-smart-textarea"),this.textArea.after(t),"None"!==this.showSuggestionOnPopup){var s="Enable"===this.showSuggestionOnPopup?"false":"true";this.textArea.setAttribute("data-inline-suggestions",s)}this.suggestionDisplay=this.shouldShowInlineSuggestions(this.textArea)?new xe(t,this.textArea):new Te(t,this.textArea)}},s.prototype.wireEvents=function(){var t=this;i.prototype.wireEvents.call(this),e.EventHandler.add(this.element,"keyup",this.handleKeyUp,this),e.EventHandler.add(this.element,"keydown",this.handleKeyDown,this),e.EventHandler.add(this.element,"mousedown",this.removeExistingOrPendingSuggestion,this),e.EventHandler.add(this.element,"focusout",this.removeExistingOrPendingSuggestion,this),this.element.addEventListener("scroll",function(){return t.suggestionDisplay.reject()},{passive:!0})},s.prototype.unWireEvents=function(){var t=this;i.prototype.unWireEvents.call(this),e.EventHandler.remove(this.element,"keyup",this.handleKeyUp),e.EventHandler.remove(this.element,"keydown",this.handleKeyDown),e.EventHandler.remove(this.element,"mousedown",this.removeExistingOrPendingSuggestion),e.EventHandler.remove(this.element,"focusout",this.removeExistingOrPendingSuggestion),this.element.removeEventListener("scroll",function(){return t.suggestionDisplay.reject()})},s.prototype.keydownHandler=function(){},s.prototype.shouldShowInlineSuggestions=function(t){var e=t.getAttribute("data-inline-suggestions");return e?"true"===e.toLowerCase():!("ontouchstart"in window)},s.prototype.handleKeyDown=function(t){switch(t.key){case"Tab":this.suggestionDisplay.isShowing()&&(this.suggestionDisplay.accept(),t.preventDefault());break;case"Alt":case"Control":case"Shift":case"Command":break;default:this.suggestionDisplay.isShowing()&&this.suggestionDisplay.currentSuggestion.startsWith(t.key)?(ge.insertCharacter(this.textArea,t.key),t.preventDefault(),this.suggestionDisplay.show(this.suggestionDisplay.currentSuggestion.substring(t.key.length)),ge.adjustScrollToCaretPosition(this.textArea)):this.removeExistingOrPendingSuggestion()}},s.prototype.handleKeyUp=function(){var t=this;this.suggestionDisplay.isShowing()||(clearTimeout(this.typingDebounceTimeout),this.typingDebounceTimeout=setTimeout(function(){return t.handleTypingPaused()},350))},s.prototype.handleTypingPaused=function(){return Ce(this,void 0,void 0,function(){return Ee(this,function(t){switch(t.label){case 0:return document.activeElement!==this.textArea?[2]:this.textArea.selectionStart!==this.textArea.selectionEnd||this.textArea.selectionStart!==this.textArea.value.length&&"\n"!==this.textArea.value[this.textArea.selectionStart]?[3,2]:[4,this.requestSuggestionAsync()];case 1:t.sent(),t.label=2;case 2:return[2]}})})},s.prototype.removeExistingOrPendingSuggestion=function(){clearTimeout(this.typingDebounceTimeout),this.pendingSuggestionAbort&&(this.pendingSuggestionAbort.abort(),this.pendingSuggestionAbort=null),this.suggestionDisplay.reject()},s.prototype.createSuggestionPrompt=function(e,i){var s="Predict what text the user in the given ROLE would insert at the cursor position indicated by ^^^.\nOnly give predictions for which you have an EXTREMELY high confidence that the user would insert that EXACT text.\nDo not make up new information. If you are not sure, just reply with NO_PREDICTION.\n\nRULES:\n1. Reply with OK:, then in square brackets the predicted text, then END_INSERTION, and no other output.\n2. When a specific value or quantity cannot be inferred and would need to be provided, use the word NEED_INFO.\n3. If there is not enough information to predict any words that the user would type next, just reply with the word NO_PREDICTION.\n4. NEVER invent new information. If you can not be sure what the user is about to type, ALWAYS stop the prediction with END_INSERTION.",n=this.UserPhrases;if(n&&n.length>0){s+="\nAlways try to use variations on the following phrases as part of the predictions:\n";for(var a=0,r=n;a<r.length;a++)s+="- "+r[a]+"\n"}return{messages:[{role:t.ChatMessageRole.System,content:s},{role:t.ChatMessageRole.User,content:"ROLE: Family member sending a text\nUSER_TEXT: Hey, it is a nice day - the weather is ^^^"},{role:t.ChatMessageRole.Assistant,content:"OK:[great!]END_INSERTION"},{role:t.ChatMessageRole.User,content:"ROLE: Customer service assistant\nUSER_TEXT: You can find more information on^^^\n\nAlternatively, phone us."},{role:t.ChatMessageRole.Assistant,content:"OK:[ our website at NEED_INFO]END_INSERTION"},{role:t.ChatMessageRole.User,content:"ROLE: Casual\nUSER_TEXT: Oh I see!\n\nWell sure thing, we can"},{role:t.ChatMessageRole.Assistant,content:"OK:[ help you out with that!]END_INSERTION"},{role:t.ChatMessageRole.User,content:"ROLE: Storyteller\nUSER_TEXT: Sir Digby Chicken Caesar, also know^^^"},{role:t.ChatMessageRole.Assistant,content:"OK:[n as NEED_INFO]END_INSERTION"},{role:t.ChatMessageRole.User,content:"ROLE: Customer support agent\nUSER_TEXT: Goodbye for now.^^^"},{role:t.ChatMessageRole.Assistant,content:"NO_PREDICTION END_INSERTION"},{role:t.ChatMessageRole.User,content:"ROLE: Pirate\nUSER_TEXT: Have you found^^^"},{role:t.ChatMessageRole.Assistant,content:"OK:[ the treasure, me hearties?]END_INSERTION"},{role:t.ChatMessageRole.User,content:"ROLE: "+this.userRole+"\nUSER_TEXT: "+e+"^^^"+i}],temperature:0,maxTokens:400,stopSequences:["END_INSERTION","NEED_INFO"],frequencyPenalty:0,presencePenalty:0}},s.prototype.requestSuggestionAsync=function(){return Ce(this,void 0,void 0,function(){var t,e,i,s,n;return Ee(this,function(a){switch(a.label){case 0:return this.pendingSuggestionAbort?(this.pendingSuggestionAbort.abort(),[2]):(this.pendingSuggestionAbort=new AbortController,t={textAreaValue:this.textArea.value,cursorPosition:this.textArea.selectionStart},e={textBefore:t.textAreaValue.substring(0,t.cursorPosition),textAfter:t.textAreaValue.substring(t.cursorPosition)},i=this.createSuggestionPrompt(e.textBefore,e.textAfter),"function"!=typeof this.aiSuggestionHandler?[3,2]:[4,this.aiSuggestionHandler(i)]);case 1:n=a.sent(),s=this.validateSuggestion(n,e.textBefore),a.label=2;case 2:return s&&t.textAreaValue===this.textArea.value&&t.cursorPosition===this.textArea.selectionStart&&(s.endsWith(" ")||(s+=" "),this.suggestionDisplay.show(s)),[2]}})})},s.prototype.validateSuggestion=function(t,e){var i;if("string"!=typeof t||t.length<=5||0!==t.indexOf("OK:["))return"";var s=this.indexOfAny(t,[".","?","!"]);return s>0&&t.length>s+1&&" "===t[s+1]&&(t=t.substring(0,s+1)),i=t.substring(4).replace(/[\]\s]+$/,""),e.length>0&&" "===e[e.length-1]&&(i=i.replace(/^\s+/,"")),i},s.prototype.indexOfAny=function(t,e){for(var i=0;i<t.length;i++)if(-1!==e.indexOf(t[""+i]))return i;return-1},s.prototype.getModuleName=function(){return"smarttextarea"},s.prototype.destroy=function(){i.prototype.destroy.call(this),this.textArea=null,this.suggestionDisplay=null,this.typingDebounceTimeout=null},be([e.Property("")],s.prototype,"userRole",void 0),be([e.Property([])],s.prototype,"UserPhrases",void 0),be([e.Property()],s.prototype,"aiSuggestionHandler",void 0),be([e.Property("None")],s.prototype,"showSuggestionOnPopup",void 0),s}(fe),xe=function(){function t(t,e){this.owner=t,this.textArea=e,this.latestSuggestionText="",this.suggestionStartPos=null,this.suggestionEndPos=null,this.virtualCaret=null,this.originalValueProperty=this.getOriginalValueProperty(e,"value")}return Object.defineProperty(t.prototype,"value",{get:function(){var t=this.originalValueProperty.get.call(this.textArea);return this.isShowing()?t.substring(0,this.suggestionStartPos)+t.substring(this.suggestionEndPos):t},set:function(t){this.originalValueProperty.set.call(this.textArea,t)},enumerable:!0,configurable:!0}),t.prototype.getOriginalValueProperty=function(t,e){for(;t;){var i=Object.getOwnPropertyDescriptor(t,e);if(i)return i;t=Object.getPrototypeOf(t)}throw new Error("Property "+e+" not found on object or its prototype chain")},Object.defineProperty(t.prototype,"valueIncludingSuggestion",{get:function(){return this.originalValueProperty.get.call(this.textArea)},set:function(t){this.originalValueProperty.set.call(this.textArea,t)},enumerable:!0,configurable:!0}),t.prototype.isShowing=function(){return null!==this.suggestionStartPos},t.prototype.show=function(t){this.latestSuggestionText=t,this.suggestionStartPos=this.textArea.selectionStart,this.suggestionEndPos=this.suggestionStartPos+t.length,this.textArea.setAttribute("data-suggestion-visible",""),this.valueIncludingSuggestion=this.valueIncludingSuggestion.substring(0,this.suggestionStartPos)+t+this.valueIncludingSuggestion.substring(this.suggestionStartPos),this.textArea.setSelectionRange(this.suggestionStartPos,this.suggestionEndPos),this.virtualCaret||(this.virtualCaret=new Pe(this.owner,this.textArea)),this.virtualCaret.show()},Object.defineProperty(t.prototype,"currentSuggestion",{get:function(){return this.latestSuggestionText},enumerable:!0,configurable:!0}),t.prototype.accept=function(){this.textArea.setSelectionRange(this.suggestionEndPos,this.suggestionEndPos),this.suggestionStartPos=null,this.suggestionEndPos=null,this.virtualCaret&&this.virtualCaret.hide(),this.textArea.removeAttribute("data-suggestion-visible"),ge.adjustScrollToCaretPosition(this.textArea)},t.prototype.reject=function(){if(this.isShowing()){var t=this.textArea.selectionStart,e=this.textArea.selectionEnd;this.valueIncludingSuggestion=this.valueIncludingSuggestion.substring(0,this.suggestionStartPos)+this.valueIncludingSuggestion.substring(this.suggestionEndPos),this.suggestionStartPos===t&&this.suggestionEndPos===e&&this.textArea.setSelectionRange(t,t),this.suggestionStartPos=null,this.suggestionEndPos=null,this.textArea.removeAttribute("data-suggestion-visible"),this.virtualCaret&&this.virtualCaret.hide()}},t}(),Te=function(){function t(t,e){var i=this;this.latestSuggestionText="",this.showing=!1,this.textArea=e,this.suggestionElement=document.createElement("div"),this.suggestionElement.classList.add("smart-textarea-suggestion-overlay"),this.suggestionElement.addEventListener("mousedown",function(t){return i.handleSuggestionClicked(t)}),this.suggestionElement.addEventListener("touchend",function(t){return i.handleSuggestionClicked(t)}),this.suggestionPrefixElement=document.createElement("span"),this.suggestionTextElement=document.createElement("span"),this.suggestionElement.appendChild(this.suggestionPrefixElement),this.suggestionElement.appendChild(this.suggestionTextElement),this.suggestionPrefixElement.style.opacity="0.3";var s=window.getComputedStyle(this.textArea);this.suggestionElement.style.font=s.font,this.suggestionElement.style.marginTop=1.4*parseFloat(s.fontSize)+"px",t.appendChild(this.suggestionElement)}return Object.defineProperty(t.prototype,"currentSuggestion",{get:function(){return this.latestSuggestionText},enumerable:!0,configurable:!0}),t.prototype.show=function(t){this.latestSuggestionText=t,this.suggestionPrefixElement.textContent=" "!==t[0]?this.getPrefixText(this.textArea,20):"",this.suggestionTextElement.textContent=t;var e=ge.getTextAreaPosition(this.textArea),i=this.suggestionElement.style;i.minWidth=null,this.suggestionElement.classList.add("smart-textarea-suggestion-overlay-visible"),i.zIndex=this.textArea.style.zIndex+1,i.top=e.top+"px";var s=e.left-this.suggestionPrefixElement.offsetWidth;(!i.left||Math.abs(parseFloat(i.left)-s)>10)&&(i.left=s+"px"),this.showing=!0;var n=window.getComputedStyle(this.suggestionElement),a=parseFloat(n.lineHeight),r=parseFloat(n.paddingTop),l=parseFloat(n.paddingBottom),o=Math.round((this.suggestionElement.offsetHeight-r-l)/a);if(o>2){var h=this.suggestionElement.offsetWidth;i.minWidth="calc(min(70vw, "+o*h/2+"px))"}var u=this.suggestionElement.getBoundingClientRect();u.right>document.body.clientWidth-20&&(i.left="calc("+(parseFloat(i.left)-(u.right-document.body.clientWidth))+"px - 2rem)")},t.prototype.accept=function(){this.showing&&(ge.insertCharacter(this.textArea,this.currentSuggestion),ge.adjustScrollToCaretPosition(this.textArea),this.hide())},t.prototype.reject=function(){this.hide()},t.prototype.hide=function(){this.showing&&(this.showing=!1,this.suggestionElement.classList.remove("smart-textarea-suggestion-overlay-visible"))},t.prototype.isShowing=function(){return this.showing},t.prototype.handleSuggestionClicked=function(t){t.preventDefault(),t.stopImmediatePropagation(),this.accept()},t.prototype.getPrefixText=function(t,e){for(var i=t.value,s=t.selectionStart,n=s-1;n>s-e;n--)if(n<0||/\s/.test(i[""+n]))return i.substring(n+1,s);return""},t}(),Pe=function(){function t(t,e){this.textArea=e,this.caretDiv=document.createElement("div"),this.caretDiv.classList.add("smart-textarea-caret"),t.appendChild(this.caretDiv)}return t.prototype.show=function(){var t=ge.getTextAreaPosition(this.textArea),e=this.caretDiv.style;e.display="block",e.top=t.top+"px",e.left=t.left+"px",e.height=t.height+"px",e.zIndex=this.textArea.style.zIndex,e.backgroundColor=t.elemStyle.caretColor},t.prototype.hide=function(){this.caretDiv.style.display="none"},t}(),ke=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Oe=function(t){function i(){var e=null!==t&&t.apply(this,arguments)||this;return e.minDistance=5,e.previous=0,e.interval=30,e.timeout=null,e.isSignatureEmpty=!0,e.backgroundLoaded=null,e.isBlazor=!1,e.isResponsive=!1,e.signPointsColl=[],e.signRatioPointsColl=[],e.canRedraw=!0,e}return ke(i,t),i.prototype.initialize=function(t,i){this.clearArray=[],this.element=t,this.canvasContext=this.element.getContext("2d"),this.canvasContext.canvas.tabIndex=-1,i&&(this.dotnetRef=i,this.isBlazor=!0,this.signatureValue&&this.loadPersistedSignature()),this.setHTMLProperties(),e.isNullOrUndefined(this.signatureValue)&&this.updateSnapCollection(!0),this.wireEvents(),this.isBlazor||this.trigger("created",null)},i.prototype.wireEvents=function(){!e.isNullOrUndefined(this.pointColl)||this.isReadOnly||this.disabled?this.pointColl&&(e.EventHandler.add(this.canvasContext.canvas,"mousemove touchmove",this.mouseMoveHandler,this),e.EventHandler.add(this.canvasContext.canvas,"mouseup touchend",this.mouseUpHandler,this),e.EventHandler.add(document,"mouseup",this.mouseUpHandler,this)):(e.EventHandler.add(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler,this),e.EventHandler.add(this.canvasContext.canvas,"keydown",this.keyboardHandler,this),window.addEventListener("resize",this.resizeHandler.bind(this)))},i.prototype.unwireEvents=function(t){"mouseup"===t||"touchend"===t?(this.canvasContext&&(e.EventHandler.remove(this.canvasContext.canvas,"mousemove touchmove",this.mouseMoveHandler),e.EventHandler.remove(this.canvasContext.canvas,"mouseup touchend",this.mouseUpHandler)),e.EventHandler.remove(document,"mouseup",this.mouseUpHandler)):(this.canvasContext&&(e.EventHandler.remove(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler),e.EventHandler.remove(this.canvasContext.canvas,"keydown",this.keyboardHandler)),window.removeEventListener("resize",this.resizeHandler))},i.prototype.setHTMLProperties=function(){150===this.element.height&&300===this.element.width&&0!==this.element.offsetHeight&&0!==this.element.offsetWidth?(this.element.height=this.element.offsetHeight,this.element.width=this.element.offsetWidth,this.isResponsive=!0):this.element.height===this.element.offsetHeight-1&&this.element.width===this.element.offsetWidth-1||0===this.element.offsetHeight||0===this.element.offsetWidth||(this.element.height=this.element.offsetHeight,this.element.width=this.element.offsetWidth),this.canvasContext.fillStyle=this.strokeColor,this.tempCanvas=this.createElement("canvas",{className:"e-"+this.getModuleName()+"-temp"}),this.tempContext=this.tempCanvas.getContext("2d"),this.tempCanvas.width=this.element.width,this.tempCanvas.height=this.element.height,this.backgroundImage?(this.canvasContext.canvas.style.backgroundImage="url("+this.backgroundImage+")",this.canvasContext.canvas.style.backgroundRepeat="no-repeat",this.saveWithBackground&&this.setBackgroundImage(this.backgroundImage,"temp")):this.backgroundColor&&(this.canvasContext.canvas.style.backgroundColor=this.backgroundColor)},i.prototype.mouseDownHandler=function(t){1!==t.buttons&&2!==t.buttons&&"touchstart"!==t.type||("touchstart"===t.type&&(t.preventDefault(),t.stopPropagation()),this.beginStroke(t),this.wireEvents())},i.prototype.mouseMoveHandler=function(t){1!==t.buttons&&2!==t.buttons&&"touchmove"!==t.type||("touchmove"===t.type&&(t.preventDefault(),t.stopPropagation()),this.interval?this.updateStrokeWithThrottle(t):this.updateStroke(t))},i.prototype.mouseUpHandler=function(t){var e={actionName:"strokeUpdate"};"touchstart"===t.type&&(t.preventDefault(),t.stopPropagation()),this.endDraw(),this.updateSnapCollection(),this.unwireEvents(t.type),this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","mouseUp"):this.trigger("change",e),this.signatureValue=this.snapColl[this.incStep];for(var i=0;i<this.signPointsColl.length;i++)this.signRatioPointsColl.push({x:this.signPointsColl[i].x/this.canvasContext.canvas.width,y:this.signPointsColl[i].y/this.canvasContext.canvas.height});this.signPointsColl=[]},i.prototype.keyboardHandler=function(t){var e=this,i={fileName:"Signature",type:"Png",cancel:!1};switch(t.key){case"Delete":this.clear();break;case t.ctrlKey&&"s":this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","beforeSave"):this.trigger("beforeSave",i,function(t){i.cancel||e.save(t.type,t.fileName)}),t.preventDefault(),t.stopImmediatePropagation();break;case t.ctrlKey&&"z":this.undo();break;case t.ctrlKey&&"y":this.redo()}},i.prototype.resizeHandler=function(){var t=this;if(this.isResponsive&&this.canRedraw&&this.canvasContext&&this.element){this.canvasContext.canvas.width=this.element.offsetWidth,this.canvasContext.canvas.height=this.element.offsetHeight,this.canvasContext.scale(1,1),this.canvasContext.fillStyle=this.strokeColor;for(var e=(this.minStrokeWidth+this.maxStrokeWidth)/2,i=0;i<this.signRatioPointsColl.length;i++)this.arcDraw(this.signRatioPointsColl[i].x*this.canvasContext.canvas.width,this.signRatioPointsColl[i].y*this.canvasContext.canvas.height,e);this.signPointsColl=[],this.canvasContext.closePath(),this.canvasContext.fill()}else if(this.canvasContext&&this.element){var s=new Image;s.src=this.snapColl[this.incStep],s.onload=function(){t.canvasContext.clearRect(0,0,t.element.width,t.element.height),t.canvasContext.drawImage(s,0,0,t.element.width,t.element.height)}}},i.prototype.beginStroke=function(t){this.internalRefresh(),this.updateStroke(t)},i.prototype.updateStroke=function(t){var e=this.createPoint(t);this.addPoint(e)},i.prototype.updateStrokeWithThrottle=function(t){var e=Date.now(),i=this.interval-(e-this.previous);this.storedArgs=t,i<=0||i>this.interval?(this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.previous=e,this.updateStroke(this.storedArgs),this.timeout||(this.storedArgs=null)):this.timeout||(this.timeout=window.setTimeout(this.delay.bind(this),i))},i.prototype.delay=function(){this.previous=Date.now(),this.timeout=null,this.updateStroke(this.storedArgs),this.timeout||(this.storedArgs=null)},i.prototype.createPoint=function(t){var e=this.canvasContext.canvas.getBoundingClientRect();return"mousedown"===t.type||"mousemove"===t.type?this.point(t.clientX-e.left,t.clientY-e.top,(new Date).getTime()):this.point(t.touches[0].clientX-e.left,t.touches[0].clientY-e.top,(new Date).getTime())},i.prototype.point=function(t,e,i){return this.pointX=t,this.pointY=e,this.time=i||(new Date).getTime(),{x:this.pointX,y:this.pointY,time:this.time}},i.prototype.addPoint=function(t){var e,i,s=this.pointColl,n=s.length>0&&s[s.length-1],a=!!n&&this.distanceTo(n)<=this.minDistance;n&&n&&a||(s.push(t),s.length>2&&(3===s.length&&s.unshift(s[0]),e=this.calculateCurveControlPoints(s[0],s[1],s[2]).controlPoint2,i=this.calculateCurveControlPoints(s[1],s[2],s[3]).controlPoint1,this.startPoint=s[1],this.controlPoint1=e,this.controlPoint2=i,this.endPoint=s[2],this.startDraw(),s.shift()))},i.prototype.startDraw=function(){var t;t=this.pointVelocityCalc(this.startPoint),t=this.velocity*t+(1-this.velocity)*this.lastVelocity;var e=Math.max(this.maxStrokeWidth/(t+1),this.minStrokeWidth);this.curveDraw(this.lastWidth,e),this.lastVelocity=t,this.lastWidth=e},i.prototype.endDraw=function(){if(!e.isNullOrUndefined(this.pointColl)){var t=this.pointColl.length>2,i=this.pointColl[0];!t&&i&&this.strokeDraw(i)}},i.prototype.curveDraw=function(t,e){var i,s,n,a,r,l,o,h,u,p,d=this.canvasContext,c=e-t,m=this.bezierLengthCalc(),v=2*Math.ceil(m);for(d.beginPath(),s=0;s<v;s++)r=(a=(n=s/v)*n)*n,u=(h=(o=(l=1-n)*l)*l)*this.startPoint.x,u+=3*o*n*this.controlPoint1.x,u+=3*l*a*this.controlPoint2.x,u+=r*this.endPoint.x,p=h*this.startPoint.y,p+=3*o*n*this.controlPoint1.y,p+=3*l*a*this.controlPoint2.y,p+=r*this.endPoint.y,i=Math.min(t+r*c,this.maxStrokeWidth),this.arcDraw(u,p,i);d.closePath(),d.fill(),this.isSignatureEmpty=!1},i.prototype.strokeDraw=function(t){var e=this.canvasContext,i=(this.minStrokeWidth+this.maxStrokeWidth)/2;e.beginPath(),this.arcDraw(t.x,t.y,i),e.closePath(),e.fill(),this.isSignatureEmpty=!1},i.prototype.arcDraw=function(t,e,i){this.signPointsColl.push({x:t,y:e});var s=this.canvasContext;s.moveTo(t,e),s.arc(t,e,i,0,2*Math.PI,!1)},i.prototype.calculateCurveControlPoints=function(t,e,i){var s=t.x-e.x,n=t.y-e.y,a=e.x-i.x,r=e.y-i.y,l={x:(t.x+e.x)/2,y:(t.y+e.y)/2},o={x:(e.x+i.x)/2,y:(e.y+i.y)/2},h=Math.sqrt(s*s+n*n),u=Math.sqrt(a*a+r*r),p=l.x-o.x,d=l.y-o.y,c=u/(h+u),m={x:o.x+p*c,y:o.y+d*c},v=e.x-m.x,f=e.y-m.y;return{controlPoint1:this.point(l.x+v,l.y+f,0),controlPoint2:this.point(o.x+v,o.y+f,0)}},i.prototype.bezierLengthCalc=function(){var t,e,i,s,n,a,r,l,o=0;for(t=0;t<=10;t++)e=t/10,i=this.bezierPointCalc(e,this.startPoint.x,this.controlPoint1.x,this.controlPoint2.x,this.endPoint.x),s=this.bezierPointCalc(e,this.startPoint.y,this.controlPoint1.y,this.controlPoint2.y,this.endPoint.y),t>0&&(r=i-n,l=s-a,o+=Math.sqrt(r*r+l*l)),n=i,a=s;return o},i.prototype.bezierPointCalc=function(t,e,i,s,n){return e*(1-t)*(1-t)*(1-t)+3*i*(1-t)*(1-t)*t+3*s*(1-t)*t*t+n*t*t*t},i.prototype.pointVelocityCalc=function(t){return this.time!==t.time?this.distanceTo(t)/(this.time-t.time):0},i.prototype.distanceTo=function(t){return Math.sqrt(Math.pow(this.pointX-t.x,2)+Math.pow(this.pointY-t.y,2))},i.prototype.isRead=function(t){t?e.EventHandler.remove(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler):this.disabled||e.EventHandler.add(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler,this)},i.prototype.enableOrDisable=function(t){this.disabled=t,t?(this.canvasContext.canvas.style.filter="opacity(0.5)",this.isRead(!0)):(this.canvasContext.canvas.style.filter="",this.isRead(!1))},i.prototype.updateSnapCollection=function(t){if(e.isNullOrUndefined(this.incStep)?(this.incStep=-1,this.incStep++,this.snapColl=[],this.clearArray=[]):this.incStep++,this.incStep<this.snapColl.length&&(this.snapColl.length=this.incStep),this.incStep>0){var i=this.createElement("canvas",{className:"e-"+this.getModuleName()+"-wrapper"}),s=i.getContext("2d");this.canvasContext&&(i.width=this.canvasContext.canvas.width,i.height=this.canvasContext.canvas.height,s.drawImage(this.canvasContext.canvas,0,0,i.width,i.height),this.snapColl.push(i.toDataURL()))}else this.snapColl.push(this.canvasContext.canvas.toDataURL());t&&this.clearArray.push(this.incStep)},i.prototype.setBackgroundImage=function(t,e){var i=this,s=new Image;s.crossOrigin="anonymous",s.src=t,"temp"===e?s.onload=function(){i.tempContext.globalCompositeOperation="source-over",i.tempContext.drawImage(s,0,0,i.element.width,i.element.height)}:(s.onload=function(){i.canvasContext.globalCompositeOperation="source-over",i.canvasContext.drawImage(s,0,0,i.element.width,i.element.height),i.updateSnapCollection(),i.saveBackground(!0)},this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height))},i.prototype.setBackgroundColor=function(t){var e=this.canvasContext;e.strokeStyle=t;var i,s;for(i=1;i<=e.canvas.width;i++)for(s=1;s<=e.canvas.height;s++)e.strokeRect(0,0,i,s);this.updateSnapCollection()},i.prototype.loadPersistedSignature=function(){if(!e.isNullOrUndefined(this.signatureValue)){var t=this,i=new Image;i.src=this.signatureValue,i.onload=function(){t.canvasContext.clearRect(0,0,t.element.width,t.element.height),t.canvasContext.drawImage(i,0,0),t.updateSnapCollection()},this.isSignatureEmpty=!1}},i.prototype.getBlob=function(t){for(var e=t.split(","),i=e[0].match(/:(.*?);/)[1],s=atob(e[1]),n=s.length,a=new Uint8Array(n);n--;)a[n]=s.charCodeAt(n);return new Blob([a],{type:i})},i.prototype.download=function(t,e){var i=URL.createObjectURL(t),s=document.createElement("a");s.href=i,s.target="_parent",s.download=e,(document.body||document.documentElement).appendChild(s),s.click(),s.parentNode.removeChild(s)},i.prototype.internalRefresh=function(){this.pointColl=[],this.lastVelocity=0,this.lastWidth=(this.minStrokeWidth+this.maxStrokeWidth)/2},i.prototype.refresh=function(){this.isResponsive=!1,this.setHTMLProperties(),this.resizeHandler(),this.internalRefresh()},i.prototype.clear=function(){var t={actionName:"clear"};this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height),this.tempContext.clearRect(0,0,this.tempContext.canvas.width,this.tempContext.canvas.height),this.saveWithBackground&&this.backgroundImage&&this.setBackgroundImage(this.backgroundImage,"temp"),this.internalRefresh(),this.signRatioPointsColl=[],this.updateSnapCollection(!0),this.isSignatureEmpty=this.canRedraw=!0,this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","Clear"):this.trigger("change",t)},i.prototype.undo=function(){var t={actionName:"undo"},e=this;if(this.incStep>0){this.incStep--;var i=new Image;i.src=this.snapColl[this.incStep],i.onload=function(){e.canvasContext.clearRect(0,0,e.element.width,e.element.height),e.canvasContext.drawImage(i,0,0,e.element.width,e.element.height)}}this.isClear(),this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","Undo"):this.trigger("change",t)},i.prototype.redo=function(){var t={actionName:"redo"},e=this;if(this.incStep<this.snapColl.length-1){this.incStep++;var i=new Image;i.src=this.snapColl[this.incStep],i.onload=function(){e.canvasContext.clearRect(0,0,e.element.width,e.element.height),e.canvasContext.drawImage(i,0,0,e.element.width,e.element.height)}}this.isClear(),this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","Redo"):this.trigger("change",t)},i.prototype.isClear=function(){if(this.clearArray){for(var t=!1,e=0;e<this.clearArray.length;e++)this.clearArray[e]===this.incStep&&(this.isSignatureEmpty=!0,t=!0);t||(this.isSignatureEmpty=!1)}},i.prototype.isEmpty=function(){return this.isSignatureEmpty},i.prototype.canUndo=function(){return this.incStep>0},i.prototype.canRedo=function(){return this.incStep<this.snapColl.length-1},i.prototype.draw=function(t,i,s,n,a){var r={actionName:"draw-text"};this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height),i=i||"Arial",s=s||30,this.canvasContext.font=s+"px "+i;var l=this.element.width/2,o=this.element.height/2;e.isNullOrUndefined(n)&&e.isNullOrUndefined(a)?(this.canvasContext.textAlign="center",this.canvasContext.textBaseline="middle"):(l=e.isNullOrUndefined(n)?l:n,o=e.isNullOrUndefined(a)?o+s/2:a+s/2),this.canvasContext.fillText(t,l,o),this.updateSnapCollection(),this.isSignatureEmpty=!1,this.trigger("change",r)},i.prototype.load=function(t,e,i){i=i||this.element.height,e=e||this.element.width,this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height);var s=this,n=new Image;n.src=t,"data"!==t.slice(0,4)&&(n.crossOrigin="anonymous"),n.onload=function(){Promise.all([createImageBitmap(n,0,0,e,i)]).then(function(n){var a=document.createElement("canvas");a.width=e,a.height=i,a.getContext("2d").drawImage(n[0],0,0),"data"!==t.slice(0,4)&&(s.canvasContext.globalCompositeOperation="source-over"),s.canvasContext.drawImage(a,0,0,e,i,0,0,s.element.width,s.element.height),s.updateSnapCollection()})},this.isSignatureEmpty=this.canRedraw=!1},i.prototype.saveBackground=function(t){var e;if(e=t&&this.backgroundImage?this.snapColl[this.incStep-1]:this.snapColl[this.incStep],t||(this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height),this.backgroundImage?this.setBackgroundImage(this.backgroundImage):this.backgroundColor&&(this.setBackgroundColor(this.backgroundColor),t=!0)),t){var i=this,s=new Image;s.crossOrigin="anonymous",s.src=e,s.onload=function(){i.backgroundLoaded=!0,i.canvasContext.globalCompositeOperation="source-over",i.canvasContext.drawImage(s,0,0,i.element.width,i.element.height),i.save(i.fileType,i.fileName)}}},i.prototype.save=function(t,e){if(this.saveWithBackground&&null==this.backgroundLoaded&&(this.backgroundImage||this.backgroundColor))this.backgroundLoaded=!1,this.fileType=t,this.fileName=e,this.saveBackground(!1);else if("Svg"===t)e=e||"Signature",this.toSVG(e);else if("Jpeg"===t)if(e=e||"Signature",!this.saveWithBackground||this.saveWithBackground&&!this.backgroundImage&&!this.backgroundColor)this.toJPEG(e);else{i=this.canvasContext.canvas.toDataURL("image/jpeg");this.download(this.getBlob(i),e+".jpeg")}else{e=e||"Signature";var i=this.canvasContext.canvas.toDataURL("image/png");this.download(this.getBlob(i),e+".png")}this.saveWithBackground&&this.backgroundLoaded&&this.resetSnap()},i.prototype.resetSnap=function(){this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height);var t=this,e=new Image;e.src=this.snapColl[this.incStep-1],e.onload=function(){t.canvasContext.drawImage(e,0,0,t.element.width,t.element.height),t.updateSnapCollection()},this.backgroundLoaded=null,this.snapColl.pop(),this.incStep--,this.snapColl.pop(),this.incStep--},i.prototype.toJPEG=function(t){var e=this,i=this.snapColl[this.incStep];this.setBackgroundColor("#ffffff");var s=this,n=new Image;n.crossOrigin="anonymous",n.src=i,n.onload=function(){s.canvasContext.globalCompositeOperation="source-over",s.canvasContext.drawImage(n,0,0,s.element.width,s.element.height);var i=s.canvasContext.canvas.toDataURL("image/jpeg");s.download(s.getBlob(i),t+".jpeg"),s.canvasContext.clearRect(0,0,s.canvasContext.canvas.width,s.canvasContext.canvas.height),e.resizeHandler()},this.snapColl.pop(),this.incStep--},i.prototype.toSVG=function(t,e){var i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.setAttribute("width",this.canvasContext.canvas.width.toString()),i.setAttribute("height",this.canvasContext.canvas.height.toString());var s=document.createElementNS("http://www.w3.org/2000/svg","image");s.setAttributeNS(null,"height",this.canvasContext.canvas.height.toString()),s.setAttributeNS(null,"width",this.canvasContext.canvas.width.toString()),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e),i.appendChild(s);var n='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+this.canvasContext.canvas.width+'" height="'+this.canvasContext.canvas.height+'">'+i.innerHTML+"</svg>",a="data:image/svg+xml;base64,"+btoa(n);return null==t?a:(this.download(this.getBlob(a),t+".svg"),null)},i.prototype.saveAsBlob=function(){return this.getBlob(this.canvasContext.canvas.toDataURL("image/png"))},i.prototype.getSignature=function(t){return this.saveWithBackground&&this.backgroundColor&&!this.backgroundImage?(this.tempContext.fillStyle=this.backgroundColor,this.tempContext.fillRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height)):this.backgroundColor||this.backgroundImage||"Jpeg"!==t||(this.tempContext.fillStyle="#fff",this.tempContext.fillRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height)),this.tempContext.drawImage(this.element,0,0),"Jpeg"===t?this.tempCanvas.toDataURL("image/jpeg"):"Svg"===t?this.toSVG(null,this.tempCanvas.toDataURL("image/png")):this.tempCanvas.toDataURL("image/png")},i.prototype.getModuleName=function(){return"signature"},i.prototype.getPersistData=function(){return this.signatureValue=this.snapColl[this.incStep],this.addOnPersist(["signatureValue"])},i.prototype.destroy=function(){"image-editor"!==this.getModuleName()&&(this.unwireEvents(null),e.removeClass([this.element],"e-"+this.getModuleName()),this.element.removeAttribute("tabindex"),this.pointColl=null,this.tempContext=null,this.tempCanvas=null,this.canvasContext=null),t.prototype.destroy.call(this),this.element=null},i.prototype.propertyChanged=function(t,e){var i=this.canvasContext;switch(t){case"backgroundColor":i.canvas.style.backgroundColor=e,this.backgroundColor=e;break;case"backgroundImage":i.canvas.style.backgroundImage="url("+e+")",this.backgroundImage=e,this.saveWithBackground&&this.setBackgroundImage(this.backgroundImage,"temp");break;case"strokeColor":i.fillStyle=e,this.strokeColor=e;break;case"saveWithBackground":this.saveWithBackground=e;break;case"maxStrokeWidth":this.maxStrokeWidth=e;break;case"minStrokeWidth":this.minStrokeWidth=e;break;case"velocity":this.velocity=e;break;case"isReadOnly":this.isRead(e);break;case"disabled":this.enableOrDisable(e)}},i}(e.Component),we=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Le=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},Ae=function(t){function i(e,i){return t.call(this,e,i)||this}return we(i,t),i.prototype.preRender=function(){},i.prototype.render=function(){this.initialize()},i.prototype.initialize=function(){this.element.setAttribute("role","img"),this.element.setAttribute("aria-label","signature"),e.addClass([this.element],"e-"+this.getModuleName()),t.prototype.initialize.call(this,this.element),this.enablePersistence&&this.loadPersistedSignature()},i.prototype.getModuleName=function(){return t.prototype.getModuleName.call(this)},i.prototype.getPersistData=function(){return t.prototype.getPersistData.call(this)},i.prototype.onPropertyChanged=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++){var a=n[s];switch(a){case"backgroundColor":t.prototype.propertyChanged.call(this,a,e.backgroundColor);break;case"backgroundImage":t.prototype.propertyChanged.call(this,a,e.backgroundImage);break;case"strokeColor":e.strokeColor!==i.strokeColor&&t.prototype.propertyChanged.call(this,a,e.strokeColor);break;case"maxStrokeWidth":e.maxStrokeWidth!==i.maxStrokeWidth&&t.prototype.propertyChanged.call(this,a,e.maxStrokeWidth);break;case"minStrokeWidth":e.minStrokeWidth!==i.minStrokeWidth&&t.prototype.propertyChanged.call(this,a,e.minStrokeWidth);break;case"velocity":e.velocity!==i.velocity&&t.prototype.propertyChanged.call(this,a,e.velocity);break;case"saveWithBackground":t.prototype.propertyChanged.call(this,a,e.saveWithBackground);break;case"isReadOnly":t.prototype.propertyChanged.call(this,a,e.isReadOnly);break;case"disabled":t.prototype.propertyChanged.call(this,a,e.disabled)}}},Le([e.Property("")],i.prototype,"backgroundColor",void 0),Le([e.Property("")],i.prototype,"backgroundImage",void 0),Le([e.Property(!1)],i.prototype,"disabled",void 0),Le([e.Property(!1)],i.prototype,"isReadOnly",void 0),Le([e.Property(!0)],i.prototype,"saveWithBackground",void 0),Le([e.Property("#000000")],i.prototype,"strokeColor",void 0),Le([e.Property(.5)],i.prototype,"minStrokeWidth",void 0),Le([e.Property(2)],i.prototype,"maxStrokeWidth",void 0),Le([e.Property(.7)],i.prototype,"velocity",void 0),Le([e.Property("en-US")],i.prototype,"locale",void 0),Le([e.Property(!1)],i.prototype,"enableRtl",void 0),Le([e.Property(!1)],i.prototype,"enablePersistence",void 0),Le([e.Event()],i.prototype,"beforeSave",void 0),Le([e.Event()],i.prototype,"change",void 0),Le([e.Event()],i.prototype,"created",void 0),i=Le([e.NotifyPropertyChanges],i)}(Oe),He=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Ne=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},Be="e-rating-icon e-icons e-star-filled",Ie="e-rating-selected";!function(t){t.Top="Top",t.Bottom="Bottom",t.Left="Left",t.Right="Right"}(t.LabelPosition||(t.LabelPosition={})),function(t){t.Full="Full",t.Half="Half",t.Quarter="Quarter",t.Exact="Exact"}(t.PrecisionType||(t.PrecisionType={}));var Ue=function(s){function n(t,e){var i=s.call(this,t,e)||this;return i.itemElements=[],i}return He(n,s),n.prototype.preRender=function(){this.element.id||(this.element.id=e.getUniqueID("e-"+this.getModuleName())),this.keyConfigs={downarrow:"downarrow",leftarrow:"leftarrow",rightarrow:"rightarrow",uparrow:"uparrow",space:"space"},this.tooltipOpen=!1,this.isTouchSelected=!1,e.closest(this.element,"form")&&this.element.getAttribute("value")&&this.setProperties({value:this.element.getAttribute("value")},!0)},n.prototype.render=function(){this.initialize(),this.updateMinValue(),this.updateTemplateFunction(),this.triggerChange(null,this.value,!1,!0),this.renderItems(),this.displayLabel()},n.prototype.initialize=function(){this.wrapper=this.createElement("div",{className:"e-"+this.getModuleName()+"-container "}),this.element.parentNode.insertBefore(this.wrapper,this.element),this.wrapper.appendChild(this.element),null==this.element.getAttribute("name")&&this.element.setAttribute("name",this.element.id),e.attributes(this.element,{"aria-label":"rating"}),this.renderItemList(),this.updateReset(),this.readOnly&&this.wrapper.classList.add("e-rating-readonly"),this.visible||this.wrapper.classList.add("e-rating-hidden"),this.enableRtl&&this.wrapper.classList.add("e-rtl"),this.enableAnimation&&this.wrapper.classList.add("e-rating-animation"),this.cssClass&&e.addClass([this.wrapper],this.cssClass.split(" ")),this.updateTooltip(),this.wireKeyboardEvent(),this.updateDisabled()},n.prototype.updateDisabled=function(){this.wrapper.classList[this.disabled?"add":"remove"]("e-disabled"),e.attributes(this.ratingItemList,{tabindex:this.disabled?"-1":"0"}),this.updateResetButton()},n.prototype.updateResetButton=function(){if(this.allowReset){this.resetElement&&this.resetElement.blur();var t=this.value<=this.min||this.disabled;this.resetElement.classList[t?"add":"remove"]("e-disabled"),e.attributes(this.resetElement,{tabindex:t?"-1":"0","aria-hidden":t.toString()})}},n.prototype.renderItemList=function(){var t=this;this.ratingItemList=this.createElement("div",{className:"e-rating-item-list",id:this.element.id+"_item-list"}),e.attributes(this.ratingItemList,{"aria-label":"rating",role:"slider"}),this.wrapper.appendChild(this.ratingItemList),e.EventHandler.add(this.ratingItemList,"touchmove",function(e){return t.touchMoveHandler(e)},this),e.EventHandler.add(this.ratingItemList,e.Browser.touchEndEvent,this.touchEndHandler,this)},n.prototype.touchMoveHandler=function(t){this.isTouchSelected||(this.wrapper.classList.add("e-rating-touch"),this.isTouchSelected=!0),this.wrapper.classList.add("e-touch-select");var e=this.ratingItemList.getBoundingClientRect(),i=(t.touches[0].clientX-e.x)/e.width*this.itemsCount;i=(i=this.enableRtl?this.itemsCount-i:i)<this.min?this.min:i>this.itemsCount?this.itemsCount:i;var s=0===(i=this.validateValue(i))?null:this.itemElements[parseInt((Math.ceil(i)-1).toString(),10)];if(i===this.currentValue)return void(this.showTooltip&&s&&this.openRatingTooltip(s,!1));var n=this.currentValue;this.triggerChange(t,i),this.updateCurrentValue(i),this.showTooltip&&(s?(Math.ceil(i)!==Math.ceil(n)&&this.closeRatingTooltip(),this.openRatingTooltip(s,!0)):this.closeRatingTooltip())},n.prototype.touchEndHandler=function(){this.closeRatingTooltip(),this.wrapper.classList.remove("e-touch-select")},n.prototype.updateTemplateFunction=function(){this.emptyTemplateFunction=this.emptyTemplate?this.getTemplateString(this.emptyTemplate):null,this.fullTemplateFunction=this.fullTemplate?this.getTemplateString(this.fullTemplate):null},n.prototype.renderItems=function(){for(var t=this,i=0;i<this.itemsCount;i++){var s=this.createElement("span",{className:"e-rating-item-container"}),n=this.createElement("span",{className:"e-rating-item"}),a=this.getRatingValue(this.value,i);this.renderItemContent(n,a,i,!1),s.appendChild(n),this.wireItemsEvents(s,i+1),this.itemElements.push(s);var r={element:s,value:i+1};this.trigger("beforeItemRender",r,function(e){t.ratingItemList.appendChild(e.element)})}e.attributes(this.ratingItemList,{"aria-valuemax":this.itemsCount.toString()}),this.updateItemValue(!1)},n.prototype.renderItemContent=function(t,i,s,n){n&&this.removeItemContent(t),this.fullTemplate&&1===i?(t.classList.add("e-rating-full"),e.append(this.fullTemplateFunction({index:s,ratingValue:i},this,"ratingFullTemplate",this.element.id+"fullTemplate",this.isStringTemplate),t)):this.emptyTemplate?(t.classList.add("e-rating-empty"),e.append(this.emptyTemplateFunction({index:s,ratingValue:i},this,"ratingEmptyTemplate",this.element.id+"emptyTemplate",this.isStringTemplate),t)):e.addClass([t],Be.split(" "))},n.prototype.removeItemContent=function(t){t.classList.remove("e-rating-full","e-rating-empty"),e.removeClass([t],Be.split(" ")),t.firstChild&&(t.innerHTML="")},n.prototype.updateTooltip=function(){this.showTooltip?(this.tooltipObj=new i.Tooltip({target:".e-rating-item-container",windowCollision:!0,opensOn:"Custom",cssClass:this.cssClass?"e-rating-tooltip "+this.cssClass:"e-rating-tooltip"}),this.tooltipObj.appendTo(this.ratingItemList)):e.isNullOrUndefined(this.tooltipObj)||(this.tooltipObj.destroy(),this.tooltipObj=null)},n.prototype.updateMinValue=function(){this.setProperties({min:this.validateValue(this.min)},!0),this.min>0&&this.value<this.min&&this.triggerChange(null,this.min,!1),e.attributes(this.ratingItemList,{"aria-valuemin":this.min.toString()})},n.prototype.validateValue=function(e){return e=e>this.itemsCount?this.itemsCount:e<0?0:this.precision===t.PrecisionType.Full||this.enableSingleSelection?Math.round(e):this.precision===t.PrecisionType.Half?Math.round(2*e)/2:this.precision===t.PrecisionType.Quarter?Math.round(4*e)/4:Math.round(10*e)/10},n.prototype.getRatingValue=function(t,e){return this.enableSingleSelection?t>e&&t<=e+1?1:0:t>=e+1?1:t<e?0:t-e},n.prototype.updateItemValue=function(i){void 0===i&&(i=!0),i&&this.isReact&&this.clearTemplate(["ratingEmptyTemplate","ratingFullTemplate"]);for(var s=0;s<this.itemsCount;s++){var n=this.itemElements[parseInt(s.toString(),10)];n.classList.remove(Ie,"e-rating-intermediate","e-selected-value");var a=this.getRatingValue(this.currentValue,s);1===a?n.classList.add(Ie):a>0?n.classList.add("e-rating-intermediate"):this.precision===t.PrecisionType.Full&&s+1<=this.value&&!this.enableSingleSelection&&n.classList.add("e-selected-value"),i&&this.updateItemContent(a,s),n.style.setProperty("--rating-value",100*a+"%"),n.classList[0===this.value&&0===s||this.value===s+1||a>0&&a<1?"add":"remove"]("e-rating-focus")}i&&this.renderReactTemplates(),this.updateResetButton(),e.attributes(this.ratingItemList,{"aria-valuenow":this.currentValue.toString()}),e.attributes(this.element,{value:this.value.toString()})},n.prototype.updateItemContent=function(t,i){if(this.fullTemplate||this.emptyTemplate){var s=this.itemElements[parseInt(i.toString(),10)].querySelector(".e-rating-item");if(this.fullTemplate&&1===t){if(!this.isReact&&s.classList.contains("e-rating-full"))return;this.removeItemContent(s),s.classList.add("e-rating-full"),e.append(this.fullTemplateFunction({ratingValue:t,index:i},this,"ratingFullTemplate",this.element.id+"fullTemplate"+i,this.isStringTemplate),s)}else if(this.emptyTemplate){if(!this.isReact&&s.classList.contains("e-rating-empty"))return;this.removeItemContent(s),s.classList.add("e-rating-empty"),e.append(this.emptyTemplateFunction({ratingValue:t,index:i},this,"ratingEmptyTemplate",this.element.id+"emptyTemplate"+i,this.isStringTemplate),s)}else this.removeItemContent(s),e.addClass([s],Be.split(" "))}},n.prototype.updateTooltipContent=function(t){var i=this;if(this.showTooltip){this.isReact&&this.clearTemplate(["ratingTooltipTemplate"]);var s;if(this.tooltipTemplate){s=this.createElement("span",{className:"e-rating-tooltip-content"});var n=this.getTemplateString(this.tooltipTemplate);e.append(n({value:this.currentValue},this,"ratingTooltipTemplate",this.element.id+"tooltipTemplate",this.isStringTemplate),s),this.tooltipObj.setProperties({content:s},t),this.isAngular&&setTimeout(function(){var t=i.ratingItemList.querySelectorAll(".e-rating-item-container."+Ie);i.tooltipObj.refresh(t[t.length-1])})}else s=this.currentValue.toString(),this.tooltipObj.setProperties({content:e.initializeCSPTemplate(function(){return s})},t);this.renderReactTemplates()}},n.prototype.getTemplateString=function(t){var i="";try{if("function"!=typeof t){var s=e.select(t);i=s?"SCRIPT"===s.tagName?s.innerHTML:s.outerHTML:t}else i=t}catch(e){i=t}return e.compile(i)},n.prototype.displayLabel=function(){this.showLabel?(this.spanLabel=this.createElement("span",{className:"e-rating-label"}),this.updateLabel(),this.updateLabelPosition()):this.wrapper.contains(this.spanLabel)&&(e.remove(this.spanLabel),this.spanLabel=null)},n.prototype.updateLabel=function(){if(this.showLabel)if(this.labelTemplate){this.isReact&&this.clearTemplate(["ratingLabelTemplate"]),this.spanLabel.firstChild&&(this.spanLabel.innerHTML="");var t=this.getTemplateString(this.labelTemplate);e.append(t({value:this.currentValue},this,"ratingLabelTemplate",this.element.id+"labelTemplate",this.isStringTemplate),this.spanLabel),this.renderReactTemplates()}else this.spanLabel.textContent=this.currentValue+" / "+this.itemsCount},n.prototype.updateReset=function(){this.allowReset?(this.resetElement=this.createElement("span",{className:"e-icons e-reset",attrs:{"aria-label":"resetbutton",role:"button"}}),this.updateResetButton(),e.EventHandler.add(this.resetElement,"click",this.resetClicked,this),this.wrapper.insertBefore(this.resetElement,this.ratingItemList)):this.wrapper.contains(this.resetElement)&&(e.remove(this.resetElement),this.resetElement=null)},n.prototype.updateLabelPosition=function(){this.clearLabelPosition(),this.spanLabel.classList.add("e-label-"+this.labelPosition.toLowerCase()),"Left"===this.labelPosition||"Top"===this.labelPosition?this.wrapper.firstChild.after(this.spanLabel):this.wrapper.appendChild(this.spanLabel)},n.prototype.clearLabelPosition=function(){var t=this.spanLabel.classList.value.match(/(e-label-[top|bottom|right|left]+)/g);t&&e.removeClass([this.spanLabel],t)},n.prototype.wireItemsEvents=function(t,i){var s=this;e.EventHandler.add(t,"click",function(t){return s.clickHandler(t)},this),e.EventHandler.add(t,"mousemove",function(t){return s.mouseMoveHandler(i,t)},this),e.EventHandler.add(t,"mouseleave",this.mouseLeaveHandler,this)},n.prototype.clickHandler=function(t){this.currentValue=this.min>0&&this.currentValue<this.min?this.min:this.currentValue,this.triggerChange(t,this.currentValue),this.updateItemValue(),this.updateLabel(),this.updateResetButton()},n.prototype.updateValueChange=function(t,e,i){void 0===i&&(i=!0),this.triggerChange(t,e,i),this.updateItemValue(),this.updateLabel()},n.prototype.triggerChange=function(t,e,i,s){void 0===i&&(i=!0),void 0===s&&(s=!1);var n=this;if(e=this.validateValue(e),this.currentValue=e,this.currentValue!==this.value){var a={event:t,isInteracted:i,value:e,previousValue:this.value};this.setProperties({value:e},!0),this.isAngular&&!s&&n.localChange({value:e}),s||this.trigger("valueChanged",a)}},n.prototype.mouseMoveHandler=function(t,e){this.isTouchSelected&&(this.wrapper.classList.remove("e-rating-touch"),this.isTouchSelected=!1);var i=this.calculateCurrentValue(t,e);i=this.validateValue(i);var s=this.itemElements[parseInt((t-1).toString(),10)];if(i===this.currentValue)return void this.openRatingTooltip(s,!1);this.updateCurrentValue(i),this.openRatingTooltip(s,!0);var n={element:s,event:e,value:i};this.trigger("onItemHover",n)},n.prototype.openRatingTooltip=function(t,e){this.showTooltip&&(this.tooltipOpen?e&&(this.updateTooltipContent(!0),this.tooltipObj.refresh(t)):(this.updateTooltipContent(!1),this.tooltipObj.open(t),this.tooltipOpen=!0))},n.prototype.closeRatingTooltip=function(){this.tooltipOpen&&(this.tooltipObj.close(),this.tooltipOpen=!1)},n.prototype.updateCurrentValue=function(t){this.currentValue=t,this.updateItemValue(),this.updateLabel()},n.prototype.mouseLeaveHandler=function(){this.closeRatingTooltip(),this.updateCurrentValue(this.value)},n.prototype.calculateCurrentValue=function(e,i){var s=e;return this.enableSingleSelection||this.precision===t.PrecisionType.Full||(s=i.offsetX/this.itemElements[e-1].clientWidth,s=this.enableRtl?1-s:s,this.precision===t.PrecisionType.Quarter?s=s<=.25?.25:s<=.5?.5:s<.75?.75:1:this.precision===t.PrecisionType.Half&&(s=s<=.5?.5:1),s=s+e-1),s},n.prototype.reset=function(){this.resetClicked(null,!1)},n.prototype.resetClicked=function(t,e){void 0===e&&(e=!0),this.updateValueChange(t,this.min,e),this.updateResetButton()},n.prototype.wireKeyboardEvent=function(){this.keyboardModuleRating=new e.KeyboardEvents(this.wrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},n.prototype.keyActionHandler=function(t){if(t.preventDefault(),!this.disabled&&!this.readOnly){if(t.target.classList.contains("e-rating-item-list"))switch(t.action){case"uparrow":this.handleNavigation(t,!0);break;case"downarrow":this.handleNavigation(t,!1);break;case"leftarrow":this.handleNavigation(t,this.enableRtl);break;case"rightarrow":this.handleNavigation(t,!this.enableRtl)}if(this.allowReset&&t.target.classList.contains("e-reset"))switch(t.action){case"space":this.resetClicked(t)}}},n.prototype.handleNavigation=function(e,i){if(!i&&this.value>this.min||i&&this.value<this.itemsCount){var s=this.precision===t.PrecisionType.Full||this.enableSingleSelection?1:this.precision===t.PrecisionType.Half?.5:this.precision===t.PrecisionType.Quarter?.25:Math.round(1)/10;s=i?this.value+s:this.value-s,this.updateValueChange(e,s),this.updateResetButton()}},n.prototype.updateContent=function(){this.isReact&&this.clearTemplate(["ratingEmptyTemplate","ratingFullTemplate"]);for(var t=0;t<this.itemsCount;t++){var e=this.itemElements[parseInt(t.toString(),10)].firstElementChild;this.renderItemContent(e,this.getRatingValue(this.value,t),t,!0)}},n.prototype.getModuleName=function(){return"rating"},n.prototype.getPersistData=function(){return this.addOnPersist([])},n.prototype.removeItemElements=function(){for(var t=0;t<this.itemElements.length;t++)e.remove(this.itemElements[parseInt(t.toString(),10)]);this.itemElements=[]},n.prototype.destroy=function(){var t=this;s.prototype.destroy.call(this),this.removeItemElements(),this.clearTemplate(),this.spanLabel&&(e.remove(this.spanLabel),this.spanLabel=null),this.resetElement&&(e.remove(this.resetElement),this.resetElement=null),this.showTooltip&&(this.tooltipObj.destroy(),this.tooltipObj=null),e.remove(this.ratingItemList),this.ratingItemList=null,this.wrapper.parentNode.insertBefore(this.element,this.wrapper),e.remove(this.wrapper),this.wrapper=null,this.keyboardModuleRating.destroy(),this.keyboardModuleRating=null,["value","aria-label","name"].forEach(function(e){t.element.removeAttribute(e)})},n.prototype.onPropertyChanged=function(t,i){for(var s=0,n=Object.keys(t);s<n.length;s++)switch(n[s]){case"value":this.updateValueChange(null,this.value>this.min?this.value:this.min,!1);break;case"min":this.updateMinValue(),this.updateItemValue(),this.updateLabel();break;case"showLabel":this.displayLabel();break;case"visible":this.wrapper.classList[this.visible?"remove":"add"]("e-rating-hidden");break;case"disabled":this.updateDisabled();break;case"readOnly":this.wrapper.classList[this.readOnly?"add":"remove"]("e-rating-readonly");break;case"allowReset":this.updateReset();break;case"enableRtl":this.wrapper.classList[this.enableRtl?"add":"remove"]("e-rtl");break;case"cssClass":i.cssClass&&e.removeClass([this.wrapper],i.cssClass.split(" ")),t.cssClass&&e.addClass([this.wrapper],t.cssClass.split(" ")),this.tooltipObj&&this.tooltipObj.setProperties({cssClass:this.cssClass?"e-rating-tooltip "+this.cssClass:"e-rating-tooltip"});break;case"labelPosition":this.updateLabelPosition();break;case"showTooltip":this.updateTooltip();break;case"precision":this.updateMinValue(),this.triggerChange(null,this.value,!1),this.updateItemValue(),this.updateLabel();break;case"enableSingleSelection":this.updateValueChange(null,this.currentValue,!1);break;case"enableAnimation":this.wrapper.classList[this.enableAnimation?"add":"remove"]("e-rating-animation");break;case"emptyTemplate":case"fullTemplate":this.updateTemplateFunction(),this.updateContent();break;case"labelTemplate":this.updateLabel();break;case"itemsCount":this.removeItemElements(),this.renderItems(),this.updateLabel()}},Ne([e.Property(!1)],n.prototype,"allowReset",void 0),Ne([e.Property("")],n.prototype,"cssClass",void 0),Ne([e.Property(!1)],n.prototype,"disabled",void 0),Ne([e.Property("")],n.prototype,"emptyTemplate",void 0),Ne([e.Property(!0)],n.prototype,"enableAnimation",void 0),Ne([e.Property(!1)],n.prototype,"enableSingleSelection",void 0),Ne([e.Property("")],n.prototype,"fullTemplate",void 0),Ne([e.Property(5)],n.prototype,"itemsCount",void 0),Ne([e.Property(t.LabelPosition.Right)],n.prototype,"labelPosition",void 0),Ne([e.Property("")],n.prototype,"labelTemplate",void 0),Ne([e.Property(0)],n.prototype,"min",void 0),Ne([e.Property(t.PrecisionType.Full)],n.prototype,"precision",void 0),Ne([e.Property(!1)],n.prototype,"readOnly",void 0),Ne([e.Property(!1)],n.prototype,"showLabel",void 0),Ne([e.Property(!0)],n.prototype,"showTooltip",void 0),Ne([e.Property("")],n.prototype,"tooltipTemplate",void 0),Ne([e.Property(0)],n.prototype,"value",void 0),Ne([e.Property(!0)],n.prototype,"visible",void 0),Ne([e.Event()],n.prototype,"beforeItemRender",void 0),Ne([e.Event()],n.prototype,"created",void 0),Ne([e.Event()],n.prototype,"onItemHover",void 0),Ne([e.Event()],n.prototype,"valueChanged",void 0),n=Ne([e.NotifyPropertyChanges],n)}(e.Component),Re=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Ve=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r};!function(t){t.Number="number",t.Text="text",t.Password="password"}(t.OtpInputType||(t.OtpInputType={})),function(t){t.Outlined="outlined",t.Underlined="underlined",t.Filled="filled"}(t.OtpInputStyle||(t.OtpInputStyle={})),function(t){t.None="none",t.Uppercase="uppercase",t.Lowercase="lowercase"}(t.TextTransform||(t.TextTransform={}));var Fe=function(i){function s(t,e){var s=i.call(this,t,e)||this;return s.inputs=[],s.previousValue="",s.separatorElements=[],s.shouldFireFocus=!0,s.shouldFireBlur=!0,s.isFocusInCalled=!1,s.isFocusOutCalled=!1,s.handleWheelEvent=function(t){t.preventDefault()},s}return Re(s,i),s.prototype.preRender=function(){this.element.id||(this.element.id=e.getUniqueID("e-"+this.getModuleName()))},s.prototype.render=function(){this.initialize()},s.prototype.initialize=function(){e.attributes(this.element,{role:"group"}),this.renderInputs(),this.renderSeparator(1,this.inputs.length),this.addPlaceHolder(),this.updateCssClass(this.cssClass),this.updateVariantClass(),this.updateAriaLabel(this.ariaLabels),this.setElementAttributes(this.htmlAttributes,this.element),this.enableRtl&&this.element.classList.add("e-rtl"),this.previousValue=this.value.toString(),this.autoFocus&&this.focusIn()},s.prototype.renderInputs=function(){this.hiddenInputEle=this.createElement("input",{id:"otpInput_hidden",attrs:{name:this.element.id,type:"hidden",value:"number"===this.type?this.value.toString().replace(/\D/g,""):this.value.toString(),autoComplete:"off"}}),this.element.appendChild(this.hiddenInputEle);for(var t=0;t<this.length;t++)this.createOtpInput(t)},s.prototype.createOtpInput=function(t){var e=this.getDefaultValue(),i="";if(e){var s=e[parseInt(t.toString(),10)];"number"===this.type?isNaN(Number(s))||(i=s):i=s||""}var n=this.createElement("input",{id:this.element.id+"-"+(t+1),className:"e-otp-input-field e-input",attrs:{maxlength:"1",type:this.type,inputmode:this.htmlAttributes.inputmode||("number"===this.type?"numeric":"text")}});this.disabled&&n.setAttribute("disabled","disabled"),this.element.appendChild(n),this.inputs.push(n),i&&(n.value=i),this.wireEvents(n,t)},s.prototype.renderSeparator=function(t,e){if(this.separator.length>0)for(var i=t;i<e;i++){var s=this.createElement("span",{className:"e-otp-separator"});s.textContent=this.separator,this.separatorElements.push(s),this.element.insertBefore(s,this.inputs[parseInt(i.toString(),10)])}},s.prototype.updateSeparatorValue=function(){var t=this;""===this.separator?(this.separatorElements.forEach(function(t){return e.remove(t)}),this.separatorElements=[]):this.separatorElements.forEach(function(e){e.textContent=t.separator})},s.prototype.addPlaceHolder=function(){for(var t=0;t<this.inputs.length;t++){var e=this.placeholder.length<=1?this.placeholder:this.placeholder.charAt(t);this.setElementAttributes({placeholder:e},this.inputs[parseInt(t.toString(),10)])}},s.prototype.updateInputType=function(t){var e=this.htmlAttributes.inputmode||("number"===t?"numeric":"text");this.inputs.forEach(function(i){i.type=t,i.setAttribute("inputmode",e)})},s.prototype.getDefaultValue=function(){var t="number"==typeof this.value?this.value.toString():this.value;this.textTransform&&(t=this.getTransformedText(t));var e=t.replace(/\s/g,"");return e.length>0?e.split(""):void 0},s.prototype.getTransformedText=function(e){return this.textTransform.toLowerCase()===t.TextTransform.Lowercase?e.toLowerCase():this.textTransform.toLowerCase()===t.TextTransform.Uppercase?e.toUpperCase():e},s.prototype.handleInputChange=function(t,e){var i=this.inputs[parseInt(t.toString(),10)];if(i&&t<this.length-1&&i.value.length>0){var s=this.inputs[parseInt(t.toString(),10)+1];this.shouldFireFocus=this.shouldFireBlur=!1,s.focus(),s&&s.value.length>0&&s.select()}var n=e.target;n.value.length>1&&(n.value=n.value.slice(0,1)),this.textTransform&&(n.value=this.getTransformedText(n.value)),this.triggerInputEvent(t,e),this.triggerValuechanged(e,!0)},s.prototype.handleKeyAction=function(t,e){e.key.length>1&&!(0===t&&"Backspace"===e.key||t===this.length-1&&"Delete"===e.key)&&(this.shouldFireFocus=this.shouldFireBlur=!1);var i=this.inputs[parseInt(t.toString(),10)],s=this.inputs[parseInt(t.toString(),10)-1],n=this.inputs[parseInt(t.toString(),10)+1];if("Delete"===e.key){var a="";i.value.length>0?(a=i.value,i.value=""):t!==this.inputs.length-1&&(a=n.value,n.value="",n.focus()),a.length>0&&this.triggerInputEvent(t,e)}else if("Backspace"===e.key){if(0!==t&&0===i.value.length){var r=s.value;s.value="",s.focus(),r.length>0&&this.triggerInputEvent(t,e)}}else"ArrowLeft"===e.key||"ArrowRight"===e.key?("ArrowLeft"===e.key&&t>0?(s.focus(),s.select()):"ArrowRight"===e.key&&t<this.inputs.length-1&&(n.focus(),n.select()),e.preventDefault()):"ArrowUp"===e.key||"ArrowDown"===e.key?e.preventDefault():"Tab"===e.key||e.shiftKey||e.ctrlKey||"number"===this.type&&/\D/.test(e.key.toLocaleLowerCase())&&e.preventDefault()},s.prototype.handleSelection=function(t){var e=this.inputs[parseInt(t.toString(),10)];e.value&&e.select()},s.prototype.handleFocus=function(t,i){if(e.addClass([this.inputs[parseInt(t.toString(),10)]],"e-otp-input-focus"),this.shouldFireFocus){var s={element:this.element,event:i,index:t,isInteracted:!this.isFocusInCalled,value:this.value};this.trigger("focus",s)}this.shouldFireFocus=!0},s.prototype.handleBlur=function(t,i){if(e.removeClass([this.inputs[parseInt(t.toString(),10)]],"e-otp-input-focus"),this.shouldFireBlur){var s={element:this.element,event:i,value:this.value,index:t,isInteracted:!this.isFocusOutCalled};this.trigger("blur",s)}this.shouldFireBlur=!0},s.prototype.handlePaste=function(t,e){var i=e.clipboardData;if(i){for(var s=i.getData("text").split(""),n=0,a=t;a<this.inputs.length;a++)s.length>0&&s[parseInt(n.toString(),10)]&&(this.inputs[parseInt(a.toString(),10)].value=s[parseInt(n.toString(),10)],n++,this.updateValueProperty());this.focusIn(),this.triggerValuechanged(e,!0)}},s.prototype.triggerInputEvent=function(t,e){var i=this.value.toString();this.updateValueProperty();var s={element:this.element,event:e,previousValue:i,value:this.value.toString(),index:t};this.trigger("input",s)},s.prototype.triggerValuechanged=function(t,e){if(this.length===this.value.toString().length&&this.previousValue!==this.value){var i={element:this.element,event:t,isInteracted:e||!1,previousValue:this.previousValue,value:this.value};this.trigger("valueChanged",i),this.previousValue=this.value.toString()}},s.prototype.wireEvents=function(t,i){e.EventHandler.add(t,"focus",this.handleFocus.bind(this,i),this),e.EventHandler.add(t,"blur",this.handleBlur.bind(this,i),this),e.EventHandler.add(t,"input",this.handleInputChange.bind(this,i),this),e.EventHandler.add(t,"keydown",this.handleKeyAction.bind(this,i),this),e.EventHandler.add(t,"click",this.handleSelection.bind(this,i),this),e.EventHandler.add(t,"paste",this.handlePaste.bind(this,i),this),e.EventHandler.add(t,"wheel",this.handleWheelEvent,this)},s.prototype.unWireEvents=function(){for(var t=0;t<this.inputs.length;t++){var i=this.inputs[parseInt(t.toString(),10)];e.EventHandler.remove(i,"focus",this.handleFocus.bind(this,t)),e.EventHandler.remove(i,"blur",this.handleBlur.bind(this,t)),e.EventHandler.remove(i,"input",this.handleInputChange.bind(this,t)),e.EventHandler.remove(i,"keydown",this.handleKeyAction.bind(this,t)),e.EventHandler.remove(i,"click",this.handleSelection.bind(this,t)),e.EventHandler.remove(i,"paste",this.handlePaste.bind(this,t)),e.EventHandler.remove(i,"wheel",this.handleWheelEvent)}},s.prototype.updateValueProperty=function(){var t="";this.inputs.forEach(function(e){t+=e.value});var e=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.value="number"==typeof this.value?parseInt(t,10):t,this.isProtectedOnChange=e,this.hiddenInputEle.value=this.value.toString()},s.prototype.updateInputValue=function(t){var e=this.value.toString();this.textTransform&&(e=this.getTransformedText(e));for(var i=t.toString(),s=0;s<this.inputs.length;s++)i.charAt(s)!==e.charAt(s)&&(this.inputs[parseInt(s.toString(),10)].value=e.charAt(s),this.hiddenInputEle.value=e);this.focusIn()},s.prototype.updateCssClass=function(t,e){void 0===e&&(e="");var i,s,n;e&&(n=e.trim().split(" "),(i=this.element.classList).remove.apply(i,n)),t&&(n=t.trim().split(" "),(s=this.element.classList).add.apply(s,n))},s.prototype.updateVariantClass=function(){var t="outlined"===this.stylingMode.toLocaleLowerCase()?"outline":this.stylingMode.toLocaleLowerCase(),i=["underlined","filled","outline"];-1!==i.indexOf(t)&&(e.removeClass([this.element],i.map(function(t){return"e-"+t})),e.addClass([this.element],"e-"+t))},s.prototype.updateAriaLabel=function(t){this.inputs.forEach(function(e,i){var s="Enter Otp Character "+(i+1),n=t&&t.length>0?t[parseInt(i.toString(),10)]||s:s;e.setAttribute("aria-label",n)})},s.prototype.updateDisabledState=function(){var t=this;this.inputs.forEach(function(e){t.disabled?e.setAttribute("disabled","disabled"):e.removeAttribute("disabled")})},s.prototype.setElementAttributes=function(t,i){if(!e.isNullOrUndefined(t))for(var s in t)if("class"===s){var n=t.class.replace(/\s+/g," ").trim();n&&e.addClass([i],n.split(" "))}else"inputmode"===s?this.setInputMode(t[""+s]):"name"===s&&this.element.id===i.id?this.hiddenInputEle.setAttribute(s,t[""+s]):i.setAttribute(s,t[""+s])},s.prototype.setInputMode=function(t){for(var e=0;e<this.inputs.length;e++)this.inputs[parseInt(e.toString(),10)].setAttribute("inputmode",t)},s.prototype.handleLengthChange=function(t,i){if(t-i>0){for(n=i;n<t;n++)this.createOtpInput(n);this.renderSeparator(i,t),this.addPlaceHolder(),this.updateAriaLabel(this.ariaLabels)}else if(t>=0&&this.inputs.length>0){for(n=t;n<this.inputs.length;n++)e.remove(this.inputs[parseInt(n.toString(),10)]);if(this.inputs.splice(t),this.separatorElements.length>0){for(var s=0===t?0:t-1,n=s;n<this.separatorElements.length;n++)e.remove(this.separatorElements[parseInt(n.toString(),10)]);this.separatorElements.splice(s)}}},s.prototype.getModuleName=function(){return"otpinput"},s.prototype.getPersistData=function(){return this.addOnPersist([])},s.prototype.destroy=function(){i.prototype.destroy.call(this),this.unWireEvents(),this.inputs.forEach(function(t){e.remove(t)}),this.separatorElements.forEach(function(t){e.remove(t)}),e.remove(this.hiddenInputEle),e.removeClass([this.element],["e-underlined","e-filled","e-outline","e-rtl"]),this.cssClass&&e.removeClass([this.element],this.cssClass.trim().split(" ")),this.element.removeAttribute("role"),this.inputs=[],this.separatorElements=[],this.hiddenInputEle=null},s.prototype.focusIn=function(){this.isFocusInCalled=!0;for(var t=this.inputs.length-1,e=0;e<this.inputs.length;e++)if(!(this.inputs[parseInt(e.toString(),10)].value.length>0)){t=e;break}this.inputs[parseInt(t.toString(),10)].focus(),this.isFocusInCalled=!1},s.prototype.focusOut=function(){this.isFocusOutCalled=!0,this.inputs.forEach(function(t){t.blur()}),this.isFocusOutCalled=!1},s.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"textTransform":this.updateInputValue(this.value);break;case"value":this.updateInputValue(e.value),this.triggerValuechanged();break;case"placeholder":this.addPlaceHolder();break;case"disabled":this.updateDisabledState();break;case"cssClass":this.updateCssClass(t.cssClass,e.cssClass);break;case"separator":""===e.separator?this.renderSeparator(1,this.inputs.length):this.updateSeparatorValue();break;case"htmlAttributes":this.setElementAttributes(t.htmlAttributes,this.element);break;case"type":this.updateInputType(t.type);break;case"stylingMode":this.updateVariantClass();break;case"ariaLabels":this.updateAriaLabel(t.ariaLabels);break;case"length":this.handleLengthChange(t.length,e.length);break;case"enableRtl":this.element.classList[this.enableRtl?"add":"remove"]("e-rtl");break;case"autoFocus":this.autoFocus&&this.focusIn()}},Ve([e.Property(4)],s.prototype,"length",void 0),Ve([e.Property("")],s.prototype,"value",void 0),Ve([e.Property(t.OtpInputType.Number)],s.prototype,"type",void 0),Ve([e.Property("")],s.prototype,"separator",void 0),Ve([e.Property("")],s.prototype,"placeholder",void 0),Ve([e.Property(t.OtpInputStyle.Outlined)],s.prototype,"stylingMode",void 0),Ve([e.Property(!1)],s.prototype,"disabled",void 0),Ve([e.Property("")],s.prototype,"cssClass",void 0),Ve([e.Property(!1)],s.prototype,"autoFocus",void 0),Ve([e.Property(t.TextTransform.None)],s.prototype,"textTransform",void 0),Ve([e.Property({})],s.prototype,"htmlAttributes",void 0),Ve([e.Property([])],s.prototype,"ariaLabels",void 0),Ve([e.Event()],s.prototype,"created",void 0),Ve([e.Event()],s.prototype,"valueChanged",void 0),Ve([e.Event()],s.prototype,"focus",void 0),Ve([e.Event()],s.prototype,"blur",void 0),Ve([e.Event()],s.prototype,"input",void 0),s=Ve([e.NotifyPropertyChanges],s)}(e.Component),Me=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),De=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},ze=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Me(i,t),De([e.Property("")],i.prototype,"content",void 0),De([e.Property("")],i.prototype,"stopContent",void 0),De([e.Property("")],i.prototype,"iconCss",void 0),De([e.Property("")],i.prototype,"stopIconCss",void 0),De([e.Property("Left")],i.prototype,"iconPosition",void 0),De([e.Property(!1)],i.prototype,"isPrimary",void 0),i}(e.ChildProperty),We=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Me(i,t),De([e.Property("Start listening")],i.prototype,"content",void 0),De([e.Property("Stop listening")],i.prototype,"stopContent",void 0),De([e.Property("TopCenter")],i.prototype,"position",void 0),i}(e.ChildProperty);!function(t){t.Inactive="Inactive",t.Listening="Listening",t.Stopped="Stopped"}(t.SpeechToTextState||(t.SpeechToTextState={}));var qe=function(s){function a(t,e){var i=s.call(this,t,e)||this;return i.fullTranscript="",i.isClicked=!1,i.isUserInteracted=!1,i.hasStarted=!1,i}return Me(a,s),a.prototype.preRender=function(){this.element.id||(this.element.id=e.getUniqueID("e-"+this.getModuleName()))},a.prototype.getDirective=function(){return"EJS-SPEECHTOTEXT"},a.prototype.getModuleName=function(){return"speech-to-text"},a.prototype.getPersistData=function(){return this.addOnPersist([])},a.prototype.render=function(){this.renderSpeechToText(),this.initializeSpeechRecognition(),e.isNullOrUndefined(this.listeningState)||this.handleStateChange(),this.wireEvents()},a.prototype.initializeLocale=function(){this.l10n=new e.L10n(this.getModuleName(),{abortedError:"Speech recognition was aborted.",audioCaptureError:"No microphone detected. Ensure your microphone is connected.",defaultError:"An unknown error occurred.",networkError:"Network error occurred. Check your internet connection.",noSpeechError:"No speech detected. Please speak into the microphone.",notAllowedError:"Microphone access denied. Allow microphone permissions.",serviceNotAllowedError:"Speech recognition service is not allowed in this context.",unsupportedBrowserError:"The browser does not support the SpeechRecognition API.",startAriaLabel:"Press to start speaking and transcribe your words",stopAriaLabel:"Press to stop speaking and end transcription",startTooltipText:"Start listening",stopTooltipText:"Stop listening"},this.locale)},a.prototype.renderSpeechToText=function(){this.initializeLocale();var t=e.isNullOrUndefined(this.buttonSettings.iconCss)||""===this.buttonSettings.iconCss?"e-icons e-listen-icon":this.buttonSettings.iconCss;this.buttonInst=new n.Button({iconCss:t,isPrimary:this.buttonSettings.isPrimary,cssClass:this.updateButtonCssClass(),disabled:this.disabled,content:this.buttonSettings.content,iconPosition:this.buttonSettings.iconPosition,enableRtl:this.enableRtl}),this.buttonInst.appendTo(this.element),this.updateTooltip(),this.updateCssClass(this.cssClass,""),this.updateAriaLabel(),e.isNullOrUndefined(this.htmlAttributes)||this.addHtmlAttributes(this.htmlAttributes)},a.prototype.updateAriaLabel=function(){var t;t=this.htmlAttributes&&this.htmlAttributes["aria-label"]?this.htmlAttributes["aria-label"]:this.micOn?this.l10n.getConstant("stopAriaLabel"):this.l10n.getConstant("startAriaLabel"),this.element.setAttribute("aria-label",t)},a.prototype.updateCssClass=function(t,i){i&&e.removeClass([this.element],i.trim().split(" ")),t&&e.addClass([this.element],t.trim().split(" "))},a.prototype.updateButtonCssClass=function(){var t;return""===(this.isClicked?this.buttonSettings.stopContent:this.buttonSettings.content)&&(t="e-round"),this.micOn&&(t+=" e-listening-state"),t},a.prototype.updateTooltip=function(){this.showTooltip?(this.tooltipSettings&&("Start listening"===this.tooltipSettings.content&&(this.tooltipSettings.content=this.l10n.getConstant("startTooltipText")),"Stop listening"===this.tooltipSettings.stopContent&&(this.tooltipSettings.stopContent=this.l10n.getConstant("stopTooltipText"))),this.tooltipInst=new i.Tooltip({content:this.hasStarted?this.tooltipSettings.stopContent:this.tooltipSettings.content,position:this.tooltipSettings.position,windowCollision:!0,cssClass:this.cssClass?"e-speech-to-text-tooltip "+this.cssClass:"e-speech-to-text-tooltip",opensOn:"Hover",enableRtl:this.enableRtl}),this.tooltipInst.appendTo(this.element)):e.isNullOrUndefined(this.tooltipInst)||(this.tooltipInst.destroy(),this.tooltipInst=null)},a.prototype.handleStateChange=function(){if(!this.disabled)if(this.listeningState===t.SpeechToTextState.Listening)this.micOn=!0,this.startSpeechRecognition();else if(this.listeningState===t.SpeechToTextState.Inactive||this.listeningState===t.SpeechToTextState.Stopped)if(this.micOn)this.micOn=!1,this.stopSpeechRecognition();else{var e=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.listeningState=t.SpeechToTextState.Inactive,this.isProtectedOnChange=e}},a.prototype.addHtmlAttributes=function(t){if(t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&this.element.setAttribute(e,t[e])},a.prototype.removeHtmlAttributes=function(t){if(t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&this.element.removeAttribute(e)},a.prototype.wireEvents=function(){e.EventHandler.add(this.element,"click",this.handleButtonClick,this)},a.prototype.unWireEvents=function(){e.EventHandler.remove(this.element,"click",this.handleButtonClick)},a.prototype.handleButtonClick=function(t){this.isUserInteracted=!0,this.micOn=!this.micOn,this.micOn?this.startSpeechRecognition(t):this.stopSpeechRecognition(t)},a.prototype.triggerUnSupportedError=function(){var t={error:"unsupported-browser",errorMessage:this.l10n.getConstant("unsupportedBrowserError")};this.trigger("onError",t)},a.prototype.initializeSpeechRecognition=function(){var e=this,i=window,s=i.SpeechRecognition||i.webkitSpeechRecognition;if(!s)return void this.triggerUnSupportedError();this.recognition=new s,this.recognition.continuous=!0,this.recognition.lang=this.lang,this.recognition.interimResults=this.allowInterimResults,this.recognition.onstart=function(i){var s=e.isProtectedOnChange;e.isProtectedOnChange=!0,e.transcript=e.fullTranscript="",e.isProtectedOnChange=s;var n={cancel:!1,listeningState:t.SpeechToTextState.Listening,event:i,isInteracted:e.isUserInteracted};e.trigger("onStart",n,function(){n.cancel?(e.recognition.abort(),e.micOn=!1):e.handleStartRecognition()})},this.recognition.onend=function(t){e.hasStarted&&(e.micOn=!1,e.handleStopRecognition(t))},this.recognition.onerror=function(t){var i="";switch(t.error){case"not-allowed":i=e.l10n.getConstant("notAllowedError");break;case"audio-capture":i=e.l10n.getConstant("audioCaptureError");break;case"network":i=e.l10n.getConstant("networkError");break;case"no-speech":i=e.l10n.getConstant("noSpeechError");break;case"aborted":i=e.l10n.getConstant("abortedError");break;case"service-not-allowed":i=e.l10n.getConstant("serviceNotAllowedError");break;default:i=e.l10n.getConstant("defaultError")}var s={event:t,error:t.error,errorMessage:i};e.trigger("onError",s),e.isUserInteracted=!1},this.recognition.onresult=function(t){var i=t.results[t.resultIndex],s="",n=e.isProtectedOnChange;e.isProtectedOnChange=!0,i.isFinal?(e.fullTranscript+=i[0].transcript,e.transcript=e.fullTranscript):(s+=i[0].transcript,e.transcript=e.fullTranscript+s);var a={event:t,transcript:e.transcript,isInterimResult:!i.isFinal};e.trigger("transcriptChanged",a,function(){if(a.transcript!==e.transcript){var t=e.isProtectedOnChange;e.isProtectedOnChange=!0,e.transcript=e.fullTranscript=a.transcript,e.isProtectedOnChange=t}}),e.isProtectedOnChange=n}},a.prototype.handleStartRecognition=function(){var i=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.hasStarted=!0,this.listeningState=t.SpeechToTextState.Listening,e.isNullOrUndefined(this.tooltipInst)||(this.tooltipInst.content=this.tooltipSettings.stopContent),this.updateAriaLabel(),this.isClicked=!0,this.buttonInst.cssClass=this.updateButtonCssClass(),this.buttonInst.content=this.buttonSettings.stopContent;var s=e.isNullOrUndefined(this.buttonSettings.stopIconCss)||""===this.buttonSettings.stopIconCss?"e-icons e-listen-stop":this.buttonSettings.stopIconCss;this.buttonInst.iconCss=s,this.isProtectedOnChange=i},a.prototype.triggerUnSupportedStart=function(e){var i=this,s=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.transcript="",this.isProtectedOnChange=s;var n={cancel:!1,listeningState:t.SpeechToTextState.Listening,event:e,isInteracted:this.isUserInteracted};this.trigger("onStart",n,function(){n.cancel||i.handleStartRecognition()})},a.prototype.startSpeechRecognition=function(t){this.hasStarted||(this.recognition?this.recognition.start():this.triggerUnSupportedStart(t))},a.prototype.stopSpeechRecognition=function(t){this.recognition?this.recognition.stop():this.handleStopRecognition(t)},a.prototype.handleStopRecognition=function(i){if(this.hasStarted){var s=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.listeningState=t.SpeechToTextState.Stopped,e.isNullOrUndefined(this.tooltipInst)||(this.tooltipInst.content=this.tooltipSettings.content),this.updateAriaLabel(),this.isClicked=!1,this.buttonInst.cssClass=this.updateButtonCssClass(),this.buttonInst.content=this.buttonSettings.content;var n={listeningState:t.SpeechToTextState.Stopped,event:i,isInteracted:this.isUserInteracted};this.trigger("onStop",n),this.listeningState=t.SpeechToTextState.Inactive;var a=e.isNullOrUndefined(this.buttonSettings.iconCss)||""===this.buttonSettings.iconCss?"e-icons e-listen-icon":this.buttonSettings.iconCss;this.buttonInst.iconCss=a,this.hasStarted=!1,this.isProtectedOnChange=s}},a.prototype.buttonSettingsChanges=function(t,i){if(t.content===i.content&&t.stopContent===i.stopContent||(this.buttonInst.content=this.hasStarted?this.buttonSettings.stopContent:this.buttonSettings.content,this.buttonInst.cssClass=this.updateButtonCssClass()),t.iconCss!==i.iconCss||t.stopIconCss!==i.stopIconCss){var s=e.isNullOrUndefined(this.buttonSettings.iconCss)||""===this.buttonSettings.iconCss?"e-icons e-listen-icon":this.buttonSettings.iconCss,n=e.isNullOrUndefined(this.buttonSettings.stopIconCss)||""===this.buttonSettings.stopIconCss?"e-icons e-listen-stop":this.buttonSettings.stopIconCss;this.buttonInst.iconCss=this.hasStarted?n:s}t.iconPosition!==i.iconPosition&&(this.buttonInst.iconPosition=this.buttonSettings.iconPosition),t.isPrimary!==i.isPrimary&&(this.buttonInst.isPrimary=this.buttonSettings.isPrimary)},a.prototype.destroyAndNullify=function(t){t&&(t.destroy(),t=null)},a.prototype.destroy=function(){s.prototype.destroy.call(this),this.unWireEvents(),this.destroyAndNullify(this.buttonInst),this.destroyAndNullify(this.tooltipInst),this.recognition=null,this.micOn=null,this.htmlAttributes=this.tooltipSettings=this.buttonSettings=null,this.element.classList.remove("e-rtl")},a.prototype.startListening=function(){this.disabled||this.isClicked||(this.isUserInteracted=!1,this.micOn=!0,this.startSpeechRecognition())},a.prototype.stopListening=function(){!this.disabled&&this.isClicked&&(this.isUserInteracted=!1,this.micOn=!1,this.stopSpeechRecognition())},a.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"lang":this.recognition&&(this.recognition.lang=this.lang);break;case"allowInterimResults":this.recognition&&(this.recognition.interimResults=this.allowInterimResults);break;case"buttonSettings":this.buttonSettingsChanges(e.buttonSettings,t.buttonSettings);break;case"cssClass":this.updateCssClass(t.cssClass,e.cssClass);break;case"disabled":this.buttonInst.disabled=this.disabled,this.handleStateChange();break;case"htmlAttributes":this.removeHtmlAttributes(e.htmlAttributes),this.addHtmlAttributes(t.htmlAttributes);break;case"listeningState":this.handleStateChange();break;case"tooltipSettings":case"showTooltip":this.updateTooltip();break;case"transcript":this.transcript=this.fullTranscript=t.transcript;break;case"enableRtl":this.buttonInst.enableRtl=this.tooltipInst.enableRtl=this.enableRtl;break;case"locale":this.l10n.setLocale(this.locale),this.updateAriaLabel(),this.updateTooltip()}},De([e.Property("")],a.prototype,"transcript",void 0),De([e.Property("")],a.prototype,"lang",void 0),De([e.Property(!0)],a.prototype,"allowInterimResults",void 0),De([e.Property(!0)],a.prototype,"showTooltip",void 0),De([e.Property("Inactive")],a.prototype,"listeningState",void 0),De([e.Complex({},ze)],a.prototype,"buttonSettings",void 0),De([e.Complex({},We)],a.prototype,"tooltipSettings",void 0),De([e.Property(!1)],a.prototype,"disabled",void 0),De([e.Property("")],a.prototype,"cssClass",void 0),De([e.Property({})],a.prototype,"htmlAttributes",void 0),De([e.Event()],a.prototype,"created",void 0),De([e.Event()],a.prototype,"onStart",void 0),De([e.Event()],a.prototype,"onStop",void 0),De([e.Event()],a.prototype,"onError",void 0),De([e.Event()],a.prototype,"transcriptChanged",void 0),a=De([e.NotifyPropertyChanges],a)}(e.Component);return t.AsyncSettings=qt,t.ButtonSettings=ze,t.ButtonsProps=Wt,t.ColorPicker=he,t.ColorRangeData=yt,t.FilesProp=zt,t.FormValidator=kt,t.LimitData=bt,t.MaskUndo=ut,t.MaskedTextBox=mt,t.NumericTextBox=it,t.OtpInput=Fe,t.Rating=Ue,t.Signature=Ae,t.SignatureBase=Oe,t.Slider=St,t.SmartTextArea=Se,t.SpeechToText=qe,t.TEXTBOX_FOCUS="e-input-focus",t.TextArea=fe,t.TextBox=de,t.TicksData=gt,t.TooltipData=Ct,t.TooltipSettings=We,t.Uploader=jt,t.applyMask=r,t.bindClearEvent=h,t.containerAttributes=Z,t.createMask=a,t.escapeRegExp=C,t.getMaskedVal=X,t.getVal=_,t.maskInput=q,t.maskInputBlurHandler=E,t.maskInputDropHandler=T,t.maskInputFocusHandler=y,t.maskInputMouseDownHandler=f,t.maskInputMouseUpHandler=g,t.mobileRemoveFunction=O,t.regex=Pt,t.regularExpressions=ht,t.setElementValue=W,t.setMaskValue=z,t.strippedValue=m,t.triggerFocus=b,t.unstrippedValue=c,t.unwireEvents=o,t.wireEvents=l,t}({},ej.base,ej.popups,ej.splitbuttons,ej.buttons),this.ejs=ej;
11
11
  //# sourceMappingURL=ej2-inputs.min.js.map