UNPKG

@syncfusion/ej2-inputs

Version:

A package of Essential JS 2 input components such as Textbox, Color-picker, Masked-textbox, Numeric-textbox, Slider, Upload, and Form-validator that is used to get input from the users.

10 lines 369 kB
/*! * filename: ej2-inputs.min.js * version : 23.1.38 * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing * licensing@syncfusion.com. Any infringement will be prosecuted under * applicable laws. */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("SyncfusionBase"),require("SyncfusionPopups"),require("SyncfusionSplitbuttons")):"function"==typeof define&&define.amd?define(["SyncfusionBase","SyncfusionPopups","SyncfusionSplitbuttons"],e):"object"==typeof exports?exports.SyncfusionInputs=e(require("SyncfusionBase"),require("SyncfusionPopups"),require("SyncfusionSplitbuttons")):t.SyncfusionInputs=e(t.SyncfusionBase,t.SyncfusionPopups,t.SyncfusionSplitbuttons)}(this,function(t,e,i){return function(t){function e(s){if(i[s])return i[s].exports;var n=i[s]={i:s,l:!1,exports:{}};return t[s].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var i={};return e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,i,s){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:s})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=20)}([function(e,i){e.exports=t},function(t,e,i){"use strict";i.d(e,"a",function(){return s});var s,n=i(0),a=(i.n(n),{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"});!function(t){function e(t,e){var r=i.i(n.isNullOrUndefined)(e)?n.createElement:e,l={container:null,buttons:[],clearButton:null};if(K=t.floatLabelType,Y=t.bindClearAction,i.i(n.isNullOrUndefined)(t.floatLabelType)||"Never"===t.floatLabelType?(l.container=E(t,a.INPUTGROUP,a.INPUTCUSTOMTAG,"span",r),t.element.parentNode.insertBefore(l.container,t.element),i.i(n.addClass)([t.element],a.INPUT),l.container.appendChild(t.element)):u(t,l,r),s(t),i.i(n.isNullOrUndefined)(t.properties)||i.i(n.isNullOrUndefined)(t.properties.showClearButton)||!t.properties.showClearButton||(N(t.properties.showClearButton,t.element,l,!0,r),l.clearButton.setAttribute("role","button"),l.container.classList.contains(a.FLOATINPUT)&&i.i(n.addClass)([l.container],a.INPUTGROUP)),!i.i(n.isNullOrUndefined)(t.buttons))for(var o=0;o<t.buttons.length;o++)l.buttons.push(_(t.buttons[o],l.container,r));return i.i(n.isNullOrUndefined)(t.element)||"TEXTAREA"!==t.element.tagName||i.i(n.addClass)([l.container],a.TEXTAREA),X(l.container,t.element),l=p(t,l),V(l.container,r),Z=l,l}function s(e){r(e.floatLabelType,e.element),e.element.addEventListener("focus",function(){var i=v(this);(i.classList.contains("e-input-group")||i.classList.contains("e-outline")||i.classList.contains("e-filled"))&&i.classList.add("e-input-focus"),"Auto"===e.floatLabelType&&setTimeout(function(){t.calculateWidth(e.element,i)},80)}),e.element.addEventListener("blur",function(){var i=v(this);(i.classList.contains("e-input-group")||i.classList.contains("e-outline")||i.classList.contains("e-filled"))&&i.classList.remove("e-input-focus"),"Auto"===e.floatLabelType&&""===e.element.value&&setTimeout(function(){t.calculateWidth(e.element,i)},80)}),e.element.addEventListener("input",function(){r(K,e.element)})}function r(t,e){var s=e.value,a=e.parentElement,r=a.parentElement;""===s||i.i(n.isNullOrUndefined)(s)?"Always"!==t&&(a&&a.classList.contains("e-input-group")?a.classList.remove("e-valid-input"):r&&r.classList.contains("e-input-group")&&r.classList.remove("e-valid-input")):a&&a.classList.contains("e-input-group")?a.classList.add("e-valid-input"):r&&r.classList.contains("e-input-group")&&r.classList.add("e-valid-input")}function l(){var t=v(this).getElementsByClassName("e-float-text")[0];i.i(n.isNullOrUndefined)(t)||(i.i(n.addClass)([t],a.LABELTOP),t.classList.contains(a.LABELBOTTOM)&&i.i(n.removeClass)([t],a.LABELBOTTOM))}function o(){var t=v(this);if(t.getElementsByTagName("textarea")[0]?""===t.getElementsByTagName("textarea")[0].value:""===t.getElementsByTagName("input")[0].value){var e=t.getElementsByClassName("e-float-text")[0];i.i(n.isNullOrUndefined)(e)||(e.classList.contains(a.LABELTOP)&&i.i(n.removeClass)([e],a.LABELTOP),i.i(n.addClass)([e],a.LABELBOTTOM))}}function h(t){t.addEventListener("focus",l),t.addEventListener("blur",o)}function d(t){t.removeEventListener("focus",l),t.removeEventListener("blur",o)}function u(t,e,s){var r=i.i(n.isNullOrUndefined)(s)?n.createElement:s;"Auto"===t.floatLabelType&&h(t.element),i.i(n.isNullOrUndefined)(e.container)?(e.container=E(t,a.FLOATINPUT,a.FLOATCUSTOMTAG,"div",r),e.container.classList.add(a.INPUTGROUP),t.element.parentNode&&t.element.parentNode.insertBefore(e.container,t.element)):(i.i(n.isNullOrUndefined)(t.customTag)||e.container.classList.add(a.FLOATCUSTOMTAG),e.container.classList.add(a.FLOATINPUT));var l=r("span",{className:a.FLOATLINE}),o=r("label",{className:a.FLOATTEXT});if(i.i(n.isNullOrUndefined)(t.element.id)||""===t.element.id||(o.id="label_"+t.element.id.replace(/ /g,"_"),i.i(n.attributes)(t.element,{"aria-labelledby":o.id})),i.i(n.isNullOrUndefined)(t.element.placeholder)||""===t.element.placeholder||(o.innerText=x(t.element.placeholder),t.element.removeAttribute("placeholder")),i.i(n.isNullOrUndefined)(t.properties)||i.i(n.isNullOrUndefined)(t.properties.placeholder)||""===t.properties.placeholder||(o.innerText=x(t.properties.placeholder)),o.innerText||e.container.classList.add(a.NOFLOATLABEL),e.container.classList.contains("e-float-icon-left")){var d=e.container.querySelector(".e-input-in-wrap");d.appendChild(t.element),d.appendChild(l),d.appendChild(o)}else e.container.appendChild(t.element),e.container.appendChild(l),e.container.appendChild(o);f(t.element.value,o),"Always"===t.floatLabelType&&(o.classList.contains(a.LABELBOTTOM)&&i.i(n.removeClass)([o],a.LABELBOTTOM),i.i(n.addClass)([o],a.LABELTOP)),"Auto"===t.floatLabelType&&(t.element.addEventListener("input",function(e){f(t.element.value,o,t.element)}),t.element.addEventListener("blur",function(e){f(t.element.value,o)})),i.i(n.isNullOrUndefined)(t.element.getAttribute("id"))||o.setAttribute("for",t.element.getAttribute("id"))}function c(t,e){"Always"===t&&e.classList.contains("e-outline")&&e.classList.add("e-valid-input")}function p(t,e){if(!i.i(n.isNullOrUndefined)(t.properties))for(var s=0,a=Object.keys(t.properties);s<a.length;s++){var r=a[s];switch(r){case"cssClass":T(t.properties.cssClass,[e.container]),c(t.floatLabelType,e.container);break;case"enabled":H(t.properties.enabled,t.element,t.floatLabelType,e.container);break;case"enableRtl":w(t.properties.enableRtl,[e.container]);break;case"placeholder":L(t.properties.placeholder,t.element);break;case"readonly":O(t.properties.readonly,t.element)}}return e}function m(t,e,s){i.i(n.isNullOrUndefined)(e)||(t&&!s?i.i(n.removeClass)([e],a.CLEARICONHIDE):i.i(n.addClass)([e],a.CLEARICONHIDE))}function f(t,e,s){if(void 0===s&&(s=null),t)i.i(n.addClass)([e],a.LABELTOP),e.classList.contains(a.LABELBOTTOM)&&i.i(n.removeClass)([e],a.LABELBOTTOM);else{(null==s||s!==document.activeElement)&&(e.classList.contains(a.LABELTOP)&&i.i(n.removeClass)([e],a.LABELTOP),i.i(n.addClass)([e],a.LABELBOTTOM))}}function v(t){var e=i.i(n.isNullOrUndefined)(t.parentNode)?t:t.parentNode;return e&&e.classList.contains("e-input-in-wrap")&&(e=e.parentNode),e}function g(t,e,s,r){var l=i.i(n.isNullOrUndefined)(r)?n.createElement:r,o=l("span",{className:a.CLEARICON}),h=e.container;if(i.i(n.isNullOrUndefined)(s)){(e.container.classList.contains(a.FLOATINPUT)?e.container.querySelector("."+a.FLOATTEXT):t).insertAdjacentElement("afterend",o)}else h.appendChild(o);return i.i(n.addClass)([o],a.CLEARICONHIDE),y(t,o,h),o.setAttribute("aria-label","close"),o}function y(t,e,s){(void 0===Y||Y)&&e.addEventListener("click",function(s){t.classList.contains(a.DISABLE)||t.readOnly||(s.preventDefault(),t!==document.activeElement&&t.focus(),t.value="",i.i(n.addClass)([e],a.CLEARICONHIDE))}),t.addEventListener("input",function(i){m(t.value,e)}),t.addEventListener("focus",function(i){m(t.value,e,t.readOnly)}),t.addEventListener("blur",function(s){setTimeout(function(){i.i(n.isNullOrUndefined)(e)||(i.i(n.addClass)([e],a.CLEARICONHIDE),e=!i.i(n.isNullOrUndefined)(t)&&t.classList.contains("e-combobox")?null:e)},200)})}function b(){Z=null}function C(t,e){if(v(t).classList.contains(a.FLOATINPUT)&&"Auto"===e){var i=v(t).getElementsByClassName("e-float-text")[0];f(t.value,i,t)}}function E(t,e,s,a,r){var l,o=i.i(n.isNullOrUndefined)(r)?n.createElement:r;return i.i(n.isNullOrUndefined)(t.customTag)?l=o(a,{className:e}):(l=o(t.customTag,{className:e}),l.classList.add(s)),l.classList.add("e-control-wrapper"),l}function x(t){var e="";if(!i.i(n.isNullOrUndefined)(t)&&""!==t){var s=document.createElement("span");s.innerHTML='<input placeholder="'+t+'"/>';e=s.children[0].placeholder}return e}function S(t,e,s,l){if(e.value=t,"Auto"===s&&""===t&&k(e,e.parentElement),i.i(n.isNullOrUndefined)(s)||"Auto"!==s||C(e,s),!i.i(n.isNullOrUndefined)(l)&&l){var o=v(e);if(!i.i(n.isNullOrUndefined)(o)){var h=o.getElementsByClassName(a.CLEARICON)[0];i.i(n.isNullOrUndefined)(h)||(e.value&&!i.i(n.isNullOrUndefined)(o)&&o.classList.contains("e-input-focus")?i.i(n.removeClass)([h],a.CLEARICONHIDE):i.i(n.addClass)([h],a.CLEARICONHIDE))}}r(s,e)}function T(t,e,s){i.i(n.isNullOrUndefined)(s)||""===s||i.i(n.removeClass)(e,s.split(" ")),i.i(n.isNullOrUndefined)(t)||""===t||i.i(n.addClass)(e,t.split(" "))}function k(t,e,s){var a="multiselect"===s?t:t.clientWidth-parseInt(getComputedStyle(t,null).getPropertyValue("padding-left"),10);i.i(n.isNullOrUndefined)(e.getElementsByClassName("e-float-text-content")[0])||(e.getElementsByClassName("e-float-text-content")[0].classList.contains("e-float-text-overflow")&&e.getElementsByClassName("e-float-text-content")[0].classList.remove("e-float-text-overflow"),(a<e.getElementsByClassName("e-float-text-content")[0].clientWidth||a===e.getElementsByClassName("e-float-text-content")[0].clientWidth)&&e.getElementsByClassName("e-float-text-content")[0].classList.add("e-float-text-overflow"))}function P(t,e){"number"==typeof t?e.style.width=i.i(n.formatUnit)(t):"string"==typeof t&&(e.style.width=t.match(/px|%|em/)?t:i.i(n.formatUnit)(t)),k(e.firstChild,e)}function L(t,e){t=x(t);var s=v(e);s.classList.contains(a.FLOATINPUT)?i.i(n.isNullOrUndefined)(t)||""===t?(s.classList.add(a.NOFLOATLABEL),s.getElementsByClassName("e-float-text-content")[0]?s.getElementsByClassName(a.FLOATTEXT)[0].children[0].textContent="":s.getElementsByClassName(a.FLOATTEXT)[0].textContent=""):(s.getElementsByClassName("e-float-text-content")[0]?s.getElementsByClassName(a.FLOATTEXT)[0].children[0].textContent=t:s.getElementsByClassName(a.FLOATTEXT)[0].textContent=t,s.classList.remove(a.NOFLOATLABEL),e.removeAttribute("placeholder")):i.i(n.isNullOrUndefined)(t)||""===t?e.removeAttribute("placeholder"):i.i(n.attributes)(e,{placeholder:t})}function O(t,e,s){t?i.i(n.attributes)(e,{readonly:""}):e.removeAttribute("readonly"),i.i(n.isNullOrUndefined)(s)||C(e,s)}function w(t,e){t?i.i(n.addClass)(e,a.RTL):i.i(n.removeClass)(e,a.RTL)}function H(t,e,s,r){var l={disabled:"disabled","aria-disabled":"true"},o=!i.i(n.isNullOrUndefined)(r);t?(e.classList.remove(a.DISABLE),A(l,e),o&&i.i(n.removeClass)([r],a.DISABLE)):(e.classList.add(a.DISABLE),B(l,e),o&&i.i(n.addClass)([r],a.DISABLE)),i.i(n.isNullOrUndefined)(s)||C(e,s)}function N(t,e,s,a,r){var l=i.i(n.isNullOrUndefined)(r)?n.createElement:r;t?s.clearButton=g(e,s,a,l):(i.i(n.remove)(s.clearButton),s.clearButton=null)}function A(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i],r=v(e);"disabled"===n&&e.classList.remove(a.DISABLE),"disabled"===n&&r.classList.contains(a.INPUTGROUP)&&r.classList.remove(a.DISABLE),"placeholder"===n&&r.classList.contains(a.FLOATINPUT)?r.getElementsByClassName(a.FLOATTEXT)[0].textContent="":e.removeAttribute(n)}}function B(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i],r=v(e);"disabled"===n&&e.classList.add(a.DISABLE),"disabled"===n&&r.classList.contains(a.INPUTGROUP)&&r.classList.add(a.DISABLE),"placeholder"===n&&r.classList.contains(a.FLOATINPUT)?r.getElementsByClassName(a.FLOATTEXT)[0].textContent=t[""+n]:e.setAttribute(n,t[""+n])}}function U(t){var e=t.container;if(!i.i(n.isNullOrUndefined)(e)&&e.classList.contains(a.FLOATINPUT)){var s=e.querySelector("textarea")?e.querySelector("textarea"):e.querySelector("input"),r=e.querySelector("."+a.FLOATTEXT).textContent,l=null!==e.querySelector(".e-clear-icon");i.i(n.detach)(e.querySelector("."+a.FLOATLINE)),i.i(n.detach)(e.querySelector("."+a.FLOATTEXT)),i.i(n.classList)(e,[a.INPUTGROUP],[a.FLOATINPUT]),d(s),i.i(n.attributes)(s,{placeholder:r}),s.classList.add(a.INPUT),l||"INPUT"!==s.tagName||s.removeAttribute("required")}}function R(t,e,s,r){var l=i.i(n.isNullOrUndefined)(r)?n.createElement:r,o=i.i(n.closest)(t,"."+a.INPUTGROUP);if(K=e,"Never"!==e){var h=o.tagName;h="DIV"!==h&&"SPAN"!==h?h:null;var d={element:t,floatLabelType:e,customTag:h,properties:{placeholder:s}},p=o.querySelector(".e-clear-icon"),m={container:o};t.classList.remove(a.INPUT),u(d,m,l),V(m.container,l),k(d.element,m.container);var f=o.classList.contains("e-float-icon-left");if(i.i(n.isNullOrUndefined)(p))if(f){var v=o.querySelector(".e-input-in-wrap");p=v.querySelector(".e-input-group-icon")}else p=o.querySelector(".e-input-group-icon");if(i.i(n.isNullOrUndefined)(p))f&&(p=o.querySelector(".e-input-group-icon"));else{var g=o.querySelector("."+a.FLOATLINE),y=o.querySelector("."+a.FLOATTEXT),b=f?o.querySelector(".e-input-in-wrap"):o;b.insertBefore(t,p),b.insertBefore(g,p),b.insertBefore(y,p)}}c(e,t.parentElement)}function V(t,e){if(t.classList.contains("e-outline")&&t.getElementsByClassName("e-float-text")[0]){var i=e("span",{className:a.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 F(t,e){for(var i=0;i<e.length;i++)M(t,e[parseInt(i.toString())].container)}function M(t,e,s){var a=[];a.push(s);var r=i.i(n.isNullOrUndefined)(s)?e.querySelectorAll(".e-input-group-icon"):a;if(t&&r.length>0)for(var l=0;l<r.length;l++)r[parseInt(l.toString())].addEventListener("mousedown",D,!1),r[parseInt(l.toString())].addEventListener("mouseup",z,!1);else if(r.length>0)for(var l=0;l<r.length;l++)r[parseInt(l.toString())].removeEventListener("mousedown",D,this),r[parseInt(l.toString())].removeEventListener("mouseup",z,this)}function I(t,e){t.classList.contains("e-disabled")||t.querySelector("input").readOnly||e.classList.add("e-input-btn-ripple")}function D(){for(var t=this,e=this.parentElement;!e.classList.contains("e-input-group");)e=e.parentElement;I(e,t)}function z(){var t=this;setTimeout(function(){t.classList.remove("e-input-btn-ripple")},500)}function q(t,e){var i=e("span",{className:t});return i.classList.add("e-input-group-icon"),i}function W(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++){var o=l[r];_(o,i,n)}else for(var h=0,d=a;h<d.length;h++){var o=d[h];j(o,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 j(t,e,s,a){var r=i.i(n.isNullOrUndefined)(a)?n.createElement:a,l=q(t,r);e.classList.add("e-float-icon-left");var o=e.querySelector(".e-input-in-wrap");if(i.i(n.isNullOrUndefined)(o)){o=r("span",{className:"e-input-in-wrap"}),s.parentNode.insertBefore(o,s);var h=e.querySelectorAll(s.tagName+" ~ *");o.appendChild(s);for(var d=0;d<h.length;d++){var u=h[parseInt(d.toString())],c=o.parentElement;u.classList.contains("e-float-line")&&(c&&c.classList.contains("e-filled")||!c)||o.appendChild(u)}}return o.parentNode.insertBefore(l,o),M(!0,e,l),l}function _(t,e,s){var a=i.i(n.isNullOrUndefined)(s)?n.createElement:s,r=q(t,a);return(e.classList.contains("e-float-icon-left")?e.querySelector(".e-input-in-wrap"):e).appendChild(r),M(!0,e,r),r}function X(t,e){"hidden"===e.type?t.classList.add("e-hidden"):t.classList.contains("e-hidden")&&t.classList.remove("e-hidden")}var K,Z={container:null,buttons:[],clearButton:null},Y=!0;t.createInput=e,t.bindInitialEvent=s,t.wireFloatingEvents=h,t.wireClearBtnEvents=y,t.destroy=b,t.setValue=S,t.setCssClass=T,t.calculateWidth=k,t.setWidth=P,t.setPlaceholder=L,t.setReadonly=O,t.setEnableRtl=w,t.setEnabled=H,t.setClearButton=N,t.removeAttributes=A,t.addAttributes=B,t.removeFloating=U,t.addFloating=R,t.createSpanElement=V,t.setRipple=F,t.addIcon=W,t.prependSpan=j,t.appendSpan=_,t.validateInputType=X}(s||(s={}))},function(t,i){t.exports=e},function(t,e,i){"use strict";var s=i(21);i.d(e,"a",function(){return s.a}),i.d(e,"b",function(){return s.b}),i.d(e,"c",function(){return s.c}),i.d(e,"d",function(){return s.d}),i.d(e,"e",function(){return s.e}),i.d(e,"f",function(){return s.f}),i.d(e,"g",function(){return s.g}),i.d(e,"h",function(){return s.h}),i.d(e,"i",function(){return s.i}),i.d(e,"j",function(){return s.j}),i.d(e,"k",function(){return s.k}),i.d(e,"l",function(){return s.l}),i.d(e,"m",function(){return s.m}),i.d(e,"n",function(){return s.n}),i.d(e,"o",function(){return s.o}),i.d(e,"p",function(){return s.p}),i.d(e,"q",function(){return s.q}),i.d(e,"r",function(){return s.r}),i.d(e,"s",function(){return s.s}),i.d(e,"t",function(){return s.t}),i.d(e,"u",function(){return s.u}),i.d(e,"v",function(){return s.v})},function(t,e,i){"use strict";var s=i(1);i.d(e,"a",function(){return s.a})},function(t,e,i){"use strict";var s=i(24);i.d(e,"a",function(){return s.a})},function(t,e,i){"use strict";i.d(e,"a",function(){return a});var s=i(0),n=(i.n(s),this&&this.__extends||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)}}()),a=function(t){function e(){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.clearArray=[],e.isBlazor=!1,e.isResponsive=!1,e.signPointsColl=[],e.signRatioPointsColl=[],e}return n(e,t),e.prototype.initialize=function(t,e){this.element=t,this.canvasContext=this.element.getContext("2d"),this.canvasContext.canvas.tabIndex=-1,e&&(this.dotnetRef=e,this.isBlazor=!0,this.signatureValue&&this.loadPersistedSignature()),this.setHTMLProperties(),i.i(s.isNullOrUndefined)(this.signatureValue)&&this.updateSnapCollection(!0),this.wireEvents(),this.isBlazor||this.trigger("created",null)},e.prototype.wireEvents=function(){!i.i(s.isNullOrUndefined)(this.pointColl)||this.isReadOnly||this.disabled?this.pointColl&&(s.EventHandler.add(this.canvasContext.canvas,"mousemove touchmove",this.mouseMoveHandler,this),s.EventHandler.add(this.canvasContext.canvas,"mouseup touchend",this.mouseUpHandler,this),s.EventHandler.add(document,"mouseup",this.mouseUpHandler,this)):(s.EventHandler.add(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler,this),s.EventHandler.add(this.canvasContext.canvas,"keydown",this.keyboardHandler,this),window.addEventListener("resize",this.resizeHandler.bind(this)))},e.prototype.unwireEvents=function(t){"mouseup"===t||"touchend"===t?(s.EventHandler.remove(this.canvasContext.canvas,"mousemove touchmove",this.mouseMoveHandler),s.EventHandler.remove(this.canvasContext.canvas,"mouseup touchend",this.mouseUpHandler),s.EventHandler.remove(document,"mouseup",this.mouseUpHandler)):(s.EventHandler.remove(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler),s.EventHandler.remove(this.canvasContext.canvas,"keydown",this.keyboardHandler),window.removeEventListener("resize",this.resizeHandler))},e.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.scale(1,1),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)},e.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())},e.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))},e.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=[]},e.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()}},e.prototype.resizeHandler=function(){var t=this;if(this.isResponsive){this.canvasContext.canvas.width=this.element.offsetWidth,this.canvasContext.canvas.height=this.element.offsetHeight,this.canvasContext.scale(1,1);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{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)}}},e.prototype.beginStroke=function(t){this.internalRefresh(),this.updateStroke(t)},e.prototype.updateStroke=function(t){var e=this.createPoint(t);this.addPoint(e)},e.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))},e.prototype.delay=function(){this.previous=Date.now(),this.timeout=null,this.updateStroke(this.storedArgs),this.timeout||(this.storedArgs=null)},e.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())},e.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}},e.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()))},e.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},e.prototype.endDraw=function(){var t=this.pointColl.length>2,e=this.pointColl[0];!t&&e&&this.strokeDraw(e)},e.prototype.curveDraw=function(t,e){var i,s,n,a,r,l,o,h,d,u,c=this.canvasContext,p=e-t,m=this.bezierLengthCalc(),f=2*Math.ceil(m);for(c.beginPath(),s=0;s<f;s++)n=s/f,a=n*n,r=a*n,l=1-n,o=l*l,h=o*l,d=h*this.startPoint.x,d+=3*o*n*this.controlPoint1.x,d+=3*l*a*this.controlPoint2.x,d+=r*this.endPoint.x,u=h*this.startPoint.y,u+=3*o*n*this.controlPoint1.y,u+=3*l*a*this.controlPoint2.y,u+=r*this.endPoint.y,i=Math.min(t+r*p,this.maxStrokeWidth),this.arcDraw(d,u,i);c.closePath(),c.fill(),this.isSignatureEmpty=!1},e.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},e.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)},e.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),d=Math.sqrt(a*a+r*r),u=l.x-o.x,c=l.y-o.y,p=d/(h+d),m={x:o.x+u*p,y:o.y+c*p},f=e.x-m.x,v=e.y-m.y;return{controlPoint1:this.point(l.x+f,l.y+v,0),controlPoint2:this.point(o.x+f,o.y+v,0)}},e.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},e.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},e.prototype.pointVelocityCalc=function(t){return this.time!==t.time?this.distanceTo(t)/(this.time-t.time):0},e.prototype.distanceTo=function(t){return Math.sqrt(Math.pow(this.pointX-t.x,2)+Math.pow(this.pointY-t.y,2))},e.prototype.isRead=function(t){t?s.EventHandler.remove(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler):this.disabled||s.EventHandler.add(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler,this)},e.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))},e.prototype.updateSnapCollection=function(t){if(i.i(s.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 e=this.createElement("canvas",{className:"e-"+this.getModuleName()+"-wrapper"}),n=e.getContext("2d");e.width=this.canvasContext.canvas.width,e.height=this.canvasContext.canvas.height,n.drawImage(this.canvasContext.canvas,0,0,e.width,e.height),this.snapColl.push(e.toDataURL())}else this.snapColl.push(this.canvasContext.canvas.toDataURL());t&&this.clearArray.push(this.incStep)},e.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))},e.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()},e.prototype.loadPersistedSignature=function(){if(!i.i(s.isNullOrUndefined)(this.signatureValue)){var t=this,e=new Image;e.src=this.signatureValue,e.onload=function(){t.canvasContext.clearRect(0,0,t.element.width,t.element.height),t.canvasContext.drawImage(e,0,0),t.updateSnapCollection()},this.isSignatureEmpty=!1}},e.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})},e.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)},e.prototype.internalRefresh=function(){this.pointColl=[],this.lastVelocity=0,this.lastWidth=(this.minStrokeWidth+this.maxStrokeWidth)/2},e.prototype.refresh=function(){this.isResponsive=!1,this.setHTMLProperties(),this.resizeHandler(),this.internalRefresh()},e.prototype.clear=function(){var t={actionName:"clear"};this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height),this.internalRefresh(),this.signRatioPointsColl=[],this.updateSnapCollection(!0),this.isSignatureEmpty=!0,this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","Clear"):this.trigger("change",t)},e.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)},e.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)},e.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)}},e.prototype.isEmpty=function(){return this.isSignatureEmpty},e.prototype.canUndo=function(){return this.incStep>0},e.prototype.canRedo=function(){return this.incStep<this.snapColl.length-1},e.prototype.draw=function(t,e,n,a,r){var l={actionName:"draw-text"};this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height),e=e||"Arial",n=n||30,this.canvasContext.font=n+"px "+e;var o=this.element.width/2,h=this.element.height/2;i.i(s.isNullOrUndefined)(a)&&i.i(s.isNullOrUndefined)(r)?(this.canvasContext.textAlign="center",this.canvasContext.textBaseline="middle"):(o=i.i(s.isNullOrUndefined)(a)?o:a,h=i.i(s.isNullOrUndefined)(r)?h+n/2:r+n/2),this.canvasContext.fillText(t,o,h),this.updateSnapCollection(),this.isSignatureEmpty=!1,this.trigger("change",l)},e.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=!1},e.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)}}},e.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{var 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()},e.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--},e.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--},e.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+'">',a=i.innerHTML,r=n+a+"</svg>",l="data:image/svg+xml;base64,"+btoa(r);return null==t?l:(this.download(this.getBlob(l),t+".svg"),null)},e.prototype.saveAsBlob=function(){return this.getBlob(this.canvasContext.canvas.toDataURL("image/png"))},e.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")},e.prototype.getModuleName=function(){return"signature"},e.prototype.getPersistData=function(){return this.signatureValue=this.snapColl[this.incStep],this.addOnPersist(["signatureValue"])},e.prototype.destroy=function(){"image-editor"!==this.getModuleName()&&(this.unwireEvents(null),i.i(s.removeClass)([this.element],"e-"+this.getModuleName()),this.element.removeAttribute("tabindex"),this.pointColl=null),t.prototype.destroy.call(this)},e.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)}},e}(s.Component)},function(t,e,i){"use strict";i.d(e,"b",function(){return l}),i.d(e,"c",function(){return o}),i.d(e,"d",function(){return h}),i.d(e,"e",function(){return d}),i.d(e,"a",function(){return c});var s=i(0),n=(i.n(s),i(2)),a=(i.n(n),this&&this.__extends||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)}}()),r=this&&this.__decorate||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},l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),r([i.i(s.Property)("None")],e.prototype,"placement",void 0),r([i.i(s.Property)(10)],e.prototype,"largeStep",void 0),r([i.i(s.Property)(1)],e.prototype,"smallStep",void 0),r([i.i(s.Property)(!1)],e.prototype,"showSmallTicks",void 0),r([i.i(s.Property)(null)],e.prototype,"format",void 0),e}(s.ChildProperty),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),r([i.i(s.Property)(null)],e.prototype,"color",void 0),r([i.i(s.Property)(null)],e.prototype,"start",void 0),r([i.i(s.Property)(null)],e.prototype,"end",void 0),e}(s.ChildProperty),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),r([i.i(s.Property)(!1)],e.prototype,"enabled",void 0),r([i.i(s.Property)(null)],e.prototype,"minStart",void 0),r([i.i(s.Property)(null)],e.prototype,"minEnd",void 0),r([i.i(s.Property)(null)],e.prototype,"maxStart",void 0),r([i.i(s.Property)(null)],e.prototype,"maxEnd",void 0),r([i.i(s.Property)(!1)],e.prototype,"startHandleFixed",void 0),r([i.i(s.Property)(!1)],e.prototype,"endHandleFixed",void 0),e}(s.ChildProperty),d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),r([i.i(s.Property)("")],e.prototype,"cssClass",void 0),r([i.i(s.Property)("Before")],e.prototype,"placement",void 0),r([i.i(s.Property)("Focus")],e.prototype,"showOn",void 0),r([i.i(s.Property)(!1)],e.prototype,"isVisible",void 0),r([i.i(s.Property)(null)],e.prototype,"format",void 0),e}(s.ChildProperty),u={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"},c=function(t){function e(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 a(e,t),e.prototype.preRender=function(){var t={incrementTitle:"Increase",decrementTitle:"Decrease"};this.l10n=new s.L10n("slider",t,this.locale),this.isElementFocused=!1,this.tickElementCollection=[],this.tooltipFormatInfo={},this.ticksFormatInfo={},this.initCultureInfo(),this.initCultureFunc(),this.formChecker()},e.prototype.formChecker=function(){var t=i.i(s.closest)(this.element,"form");t?(this.isForm=!0,i.i(s.isNullOrUndefined)(this.formResetValue)||this.setProperties({value:this.formResetValue},!0),this.formResetValue=this.value,"Range"!==this.type||!i.i(s.isNullOrUndefined)(this.formResetValue)&&"object"==typeof this.formResetValue?i.i(s.isNullOrUndefined)(this.formResetValue)&&(this.formResetValue=parseFloat(i.i(s.formatUnit)(this.min))):this.formResetValue=[parseFloat(i.i(s.formatUnit)(this.min)),parseFloat(i.i(s.formatUnit)(this.max))],this.formElement=t):this.isForm=!1},e.prototype.initCultureFunc=function(){this.internationalization=new s.Internationalization(this.locale)},e.prototype.initCultureInfo=function(){this.tooltipFormatInfo.format=i.i(s.isNullOrUndefined)(this.tooltip.format)?null:this.tooltip.format,this.ticksFormatInfo.format=i.i(s.isNullOrUndefined)(this.ticks.format)?null:this.ticks.format},e.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}},e.prototype.formatNumber=function(t){var e=this.numberOfDecimals(t);return this.internationalization.getNumberFormat({maximumFractionDigits:e,minimumFractionDigits:e,useGrouping:!1})(t)},e.prototype.numberOfDecimals=function(t){var e=t.toString().split(".")[1];return e&&e.length?e.length:0},e.prototype.makeRoundNumber=function(t,e){var i=e||0;return Number(t.toFixed(i))},e.prototype.fractionalToInteger=function(t){t=0===this.numberOfDecimals(t)?Number(t).toFixed(this.noOfDecimals):t;for(var e=1,i=0;i<this.noOfDecimals;i++)e*=10;return t=Number((t*e).toFixed(0))},e.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)},e.prototype.initialize=function(){i.i(s.addClass)([this.element],u.root),this.setCSSClass()},e.prototype.setElementWidth=function(t){i.i(s.isNullOrUndefined)(t)||i.i(s.isNullOrUndefined)(this.sliderContainer)||("number"==typeof t?this.sliderContainer.style.width=i.i(s.formatUnit)(t):"string"==typeof t&&(this.sliderContainer.style.width=t.match(/px|%|em/)?t:i.i(s.formatUnit)(t)))},e.prototype.setCSSClass=function(t){t&&i.i(s.removeClass)([this.element],t.split(" ")),this.cssClass&&i.i(s.addClass)([this.element],this.cssClass.split(" "))},e.prototype.setEnabled=function(){this.enabled?(i.i(s.removeClass)([this.sliderContainer],[u.sliderDisabled]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.remove(u.sliderDisabled),this.wireEvents()):(i.i(s.addClass)([this.sliderContainer],[u.sliderDisabled]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.add(u.sliderDisabled),this.unwireEvents())},e.prototype.getTheme=function(t){return window.getComputedStyle(t,":after").getPropertyValue("content").replace(/['"]+/g,"")},e.prototype.initRender=function(){this.sliderContainer=this.createElement("div",{className:u.sliderContainer+" "+u.controlWrapper}),this.element.parentNode.insertBefore(this.sliderContainer,this.element),this.sliderContainer.appendChild(this.element),this.sliderTrack=this.createElement("div",{className:u.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:i.i(s.isNullOrUndefined)(this.value)?this.min.toString():this.value.toString(),name:this.element.getAttribute("name")||this.element.getAttribute("id")||"_"+(1e3*Math.random()).toFixed(0)+"slider",class:u.sliderHiddenInput}}),this.hiddenInput.tabIndex=-1,this.sliderContainer.appendChild(this.hiddenInput),this.showButtons&&this.setButtons(),this.setEnableRTL(),"Range"===this.type?this.rangeValueUpdate():this.value=i.i(s.isNullOrUndefined)(this.value)?parseFloat(i.i(s.formatUnit)(this.min.toString())):this.value,this.previousVal="Range"!==this.type?this.checkHandleValue(parseFloat(i.i(s.formatUnit)(this.value.toString()))):[this.checkHandleValue(parseFloat(i.i(s.formatUnit)(this.value[0].toString()))),this.checkHandleValue(parseFloat(i.i(s.formatUnit)(this.value[1].toString())))],this.previousChanged=this.previousVal,i.i(s.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?i.i(s.removeClass)([this.sliderContainer],[u.sliderDisabled]):i.i(s.addClass)([this.sliderContainer],[u.sliderDisabled]),this.readonly?i.i(s.addClass)([this.sliderContainer],[u.readonly]):i.i(s.removeClass)([this.sliderContainer],[u.readonly])},e.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.isBootstrap5="bootstrap5"===this.getTheme(this.sliderContainer),this.isFluent="FluentUI"===this.getTheme(this.sliderContainer),this.isMaterialTooltip=(this.isMaterial||this.isMaterial3)&&"Range"!==this.type&&this.tooltip.isVisible},e.prototype.createRangeBar=function(){"Default"!==this.type&&(this.rangeBar=this.createElement("div",{attrs:{class:u.rangeBar}}),this.element.appendChild(this.rangeBar),this.drag&&"Range"===this.type&&("Horizontal"===this.orientation?this.rangeBar.classList.add(u.dragHorizontal):this.rangeBar.classList.add(u.dragVertical)))},e.prototype.createLimitBar=function(){var t="Range"!==this.type?u.limitBarDefault:u.limitBarFirst;t+=" "+u.limits,thi