(()=>{var e={9222:function(e){e.exports=function(){return i={},e.m=t=[function(e,t,i){"use strict";i.r(t);var n={allowedTagList:["b","caption","cite","code","const","dd","del","div","dfn","dt","em","h1","h2","h3","h4","h5","h6","input","ins","kdb","label","li","option","output","p","q","s","sample","span","strong","td","th","u"]};Object.freeze(n.allowedTagList),Object.defineProperty(n,"allowedTagList",{configurable:!1,writable:!1}),n.keyCode={Backspace:8,Tab:9,Enter:13,Shift:16,Ctrl:17,Alt:18,Pause:19,CapsLock:20,Esc:27,Space:32,PageUp:33,PageDown:34,End:35,Home:36,LeftArrow:37,UpArrow:38,RightArrow:39,DownArrow:40,Insert:45,Delete:46,num0:48,num1:49,num2:50,num3:51,num4:52,num5:53,num6:54,num7:55,num8:56,num9:57,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,OSLeft:91,OSRight:92,ContextMenu:93,numpad0:96,numpad1:97,numpad2:98,numpad3:99,numpad4:100,numpad5:101,numpad6:102,numpad7:103,numpad8:104,numpad9:105,MultiplyNumpad:106,PlusNumpad:107,MinusNumpad:109,DotNumpad:110,SlashNumpad:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NumLock:144,ScrollLock:145,HyphenFirefox:173,MyComputer:182,MyCalculator:183,Semicolon:186,Equal:187,Comma:188,Hyphen:189,Dot:190,Slash:191,Backquote:192,LeftBracket:219,Backslash:220,RightBracket:221,Quote:222,Command:224,AltGraph:225,AndroidDefault:229},Object.freeze(n.keyCode),Object.defineProperty(n,"keyCode",{configurable:!1,writable:!1}),n.fromCharCodeKeyCode={0:"LaunchCalculator",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",91:"OS",92:"OSRight",93:"ContextMenu",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",173:"-",182:"MyComputer",183:"MyCalculator",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Meta",225:"AltGraph"},Object.freeze(n.fromCharCodeKeyCode),Object.defineProperty(n,"fromCharCodeKeyCode",{configurable:!1,writable:!1}),n.keyName={Unidentified:"Unidentified",AndroidDefault:"AndroidDefault",Alt:"Alt",AltGr:"AltGraph",CapsLock:"CapsLock",Ctrl:"Control",Fn:"Fn",FnLock:"FnLock",Hyper:"Hyper",Meta:"Meta",OSLeft:"OS",OSRight:"OS",Command:"OS",NumLock:"NumLock",ScrollLock:"ScrollLock",Shift:"Shift",Super:"Super",Symbol:"Symbol",SymbolLock:"SymbolLock",Enter:"Enter",Tab:"Tab",Space:" ",LeftArrow:"ArrowLeft",UpArrow:"ArrowUp",RightArrow:"ArrowRight",DownArrow:"ArrowDown",End:"End",Home:"Home",PageUp:"PageUp",PageDown:"PageDown",Backspace:"Backspace",Clear:"Clear",Copy:"Copy",CrSel:"CrSel",Cut:"Cut",Delete:"Delete",EraseEof:"EraseEof",ExSel:"ExSel",Insert:"Insert",Paste:"Paste",Redo:"Redo",Undo:"Undo",Accept:"Accept",Again:"Again",Attn:"Attn",Cancel:"Cancel",ContextMenu:"ContextMenu",Esc:"Escape",Execute:"Execute",Find:"Find",Finish:"Finish",Help:"Help",Pause:"Pause",Play:"Play",Props:"Props",Select:"Select",ZoomIn:"ZoomIn",ZoomOut:"ZoomOut",BrightnessDown:"BrightnessDown",BrightnessUp:"BrightnessUp",Eject:"Eject",LogOff:"LogOff",Power:"Power",PowerOff:"PowerOff",PrintScreen:"PrintScreen",Hibernate:"Hibernate",Standby:"Standby",WakeUp:"WakeUp",Compose:"Compose",Dead:"Dead",F1:"F1",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",F10:"F10",F11:"F11",F12:"F12",Print:"Print",num0:"0",num1:"1",num2:"2",num3:"3",num4:"4",num5:"5",num6:"6",num7:"7",num8:"8",num9:"9",a:"a",b:"b",c:"c",d:"d",e:"e",f:"f",g:"g",h:"h",i:"i",j:"j",k:"k",l:"l",m:"m",n:"n",o:"o",p:"p",q:"q",r:"r",s:"s",t:"t",u:"u",v:"v",w:"w",x:"x",y:"y",z:"z",A:"A",B:"B",C:"C",D:"D",E:"E",F:"F",G:"G",H:"H",I:"I",J:"J",K:"K",L:"L",M:"M",N:"N",O:"O",P:"P",Q:"Q",R:"R",S:"S",T:"T",U:"U",V:"V",W:"W",X:"X",Y:"Y",Z:"Z",Semicolon:";",Equal:"=",Comma:",",Hyphen:"-",Minus:"-",Plus:"+",Dot:".",Slash:"/",Backquote:"`",LeftParenthesis:"(",RightParenthesis:")",LeftBracket:"[",RightBracket:"]",Backslash:"\\",Quote:"'",numpad0:"0",numpad1:"1",numpad2:"2",numpad3:"3",numpad4:"4",numpad5:"5",numpad6:"6",numpad7:"7",numpad8:"8",numpad9:"9",NumpadDot:".",NumpadDotAlt:",",NumpadMultiply:"*",NumpadPlus:"+",NumpadMinus:"-",NumpadSubtract:"-",NumpadSlash:"/",NumpadDotObsoleteBrowsers:"Decimal",NumpadMultiplyObsoleteBrowsers:"Multiply",NumpadPlusObsoleteBrowsers:"Add",NumpadMinusObsoleteBrowsers:"Subtract",NumpadSlashObsoleteBrowsers:"Divide",_allFnKeys:["F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"],_someNonPrintableKeys:["Tab","Enter","Shift","ShiftLeft","ShiftRight","Control","ControlLeft","ControlRight","Alt","AltLeft","AltRight","Pause","CapsLock","Escape"],_directionKeys:["PageUp","PageDown","End","Home","ArrowDown","ArrowLeft","ArrowRight","ArrowUp"]},Object.freeze(n.keyName._allFnKeys),Object.freeze(n.keyName._someNonPrintableKeys),Object.freeze(n.keyName._directionKeys),Object.freeze(n.keyName),Object.defineProperty(n,"keyName",{configurable:!1,writable:!1}),Object.freeze(n);var a=n;function r(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||l(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=e[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!t||i.length!==t);n=!0);}catch(e){a=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}}(e,t)||l(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){if(e){if("string"==typeof e)return u(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(i):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var h=function(){function e(){!function(t){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this)}return function(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e,[{key:"isNull",value:function(e){return null===e}},{key:"isUndefined",value:function(e){return void 0===e}},{key:"isUndefinedOrNullOrEmpty",value:function(e){return null==e||""===e}},{key:"isString",value:function(e){return"string"==typeof e||e instanceof String}},{key:"isEmptyString",value:function(e){return""===e}},{key:"isBoolean",value:function(e){return"boolean"==typeof e}},{key:"isTrueOrFalseString",value:function(e){var t=String(e).toLowerCase();return"true"===t||"false"===t}},{key:"isObject",value:function(e){return"object"===c(e)&&null!==e&&!Array.isArray(e)}},{key:"isEmptyObj",value:function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}},{key:"isNumberStrict",value:function(e){return"number"==typeof e}},{key:"isNumber",value:function(e){return!this.isArray(e)&&!isNaN(parseFloat(e))&&isFinite(e)}},{key:"isDigit",value:function(e){return/\d/.test(e)}},{key:"isNumberOrArabic",value:function(e){var t=this.arabicToLatinNumbers(e,!1,!0,!0);return this.isNumber(t)}},{key:"isInt",value:function(e){return"number"==typeof e&&parseFloat(e)===parseInt(e,10)&&!isNaN(e)}},{key:"isFunction",value:function(e){return"function"==typeof e}},{key:"isIE11",value:function(){return"undefined"!=typeof window&&!!window.MSInputMethodContext&&!!document.documentMode}},{key:"contains",value:function(e,t){return!(!this.isString(e)||!this.isString(t)||""===e||""===t)&&-1!==e.indexOf(t)}},{key:"isInArray",value:function(e,t){return!(!this.isArray(t)||t===[]||this.isUndefined(e))&&-1!==t.indexOf(e)}},{key:"isArray",value:function(e){if("[object Array]"===Object.prototype.toString.call([]))return Array.isArray(e)||"object"===c(e)&&"[object Array]"===Object.prototype.toString.call(e);throw new Error("toString message changed for Object Array")}},{key:"isElement",value:function(e){return"undefined"!=typeof Element&&e instanceof Element}},{key:"isInputElement",value:function(e){return this.isElement(e)&&"input"===e.tagName.toLowerCase()}},{key:"decimalPlaces",value:function(e){var t=o(e.split("."),2)[1];return this.isUndefined(t)?0:t.length}},{key:"indexFirstNonZeroDecimalPlace",value:function(e){var t=o(String(Math.abs(e)).split("."),2)[1];if(this.isUndefined(t))return 0;var i=t.lastIndexOf("0");return-1===i?i=0:i+=2,i}},{key:"keyCodeNumber",value:function(e){return void 0===e.which?e.keyCode:e.which}},{key:"character",value:function(t){var i;if("Unidentified"===t.key||void 0===t.key||this.isSeleniumBot()){var n=this.keyCodeNumber(t);if(n===a.keyCode.AndroidDefault)return a.keyName.AndroidDefault;var r=a.fromCharCodeKeyCode[n];i=e.isUndefinedOrNullOrEmpty(r)?String.fromCharCode(n):r}else{var s;switch(t.key){case"Add":i=a.keyName.NumpadPlus;break;case"Apps":i=a.keyName.ContextMenu;break;case"Crsel":i=a.keyName.CrSel;break;case"Decimal":i=t.char?t.char:a.keyName.NumpadDot;break;case"Del":i="firefox"===(s=this.browser()).name&&s.version<=36||"ie"===s.name&&s.version<=9?a.keyName.Dot:a.keyName.Delete;break;case"Divide":i=a.keyName.NumpadSlash;break;case"Down":i=a.keyName.DownArrow;break;case"Esc":i=a.keyName.Esc;break;case"Exsel":i=a.keyName.ExSel;break;case"Left":i=a.keyName.LeftArrow;break;case"Meta":case"Super":i=a.keyName.OSLeft;break;case"Multiply":i=a.keyName.NumpadMultiply;break;case"Right":i=a.keyName.RightArrow;break;case"Spacebar":i=a.keyName.Space;break;case"Subtract":i=a.keyName.NumpadMinus;break;case"Up":i=a.keyName.UpArrow;break;default:i=t.key}}return i}},{key:"browser",value:function(){var e,t=navigator.userAgent,i=t.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(i[1])?{name:"ie",version:(e=/\brv[ :]+(\d+)/g.exec(t)||[])[1]||""}:"Chrome"===i[1]&&null!==(e=t.match(/\b(OPR|Edge)\/(\d+)/))?{name:e[1].replace("OPR","opera"),version:e[2]}:(i=i[2]?[i[1],i[2]]:[navigator.appName,navigator.appVersion,"-?"],null!==(e=t.match(/version\/(\d+)/i))&&i.splice(1,1,e[1]),{name:i[0].toLowerCase(),version:i[1]})}},{key:"isSeleniumBot",value:function(){return!0===window.navigator.webdriver}},{key:"isNegative",value:function(t,i,n){var a=1<arguments.length&&void 0!==i?i:"-",r=!(2<arguments.length&&void 0!==n)||n;return t===a||""!==t&&(e.isNumber(t)?t<0:r?this.contains(t,a):this.isNegativeStrict(t,a))}},{key:"isNegativeStrict",value:function(e,t){var i=1<arguments.length&&void 0!==t?t:"-";return e.charAt(0)===i}},{key:"isNegativeWithBrackets",value:function(e,t,i){return e.charAt(0)===t&&this.contains(e,i)}},{key:"isZeroOrHasNoValue",value:function(e){return!/[1-9]/g.test(e)}},{key:"setRawNegativeSign",value:function(e){return this.isNegativeStrict(e,"-")?e:"-".concat(e)}},{key:"replaceCharAt",value:function(e,t,i){return"".concat(e.substr(0,t)).concat(i).concat(e.substr(t+i.length))}},{key:"clampToRangeLimits",value:function(e,t){return Math.max(t.minimumValue,Math.min(t.maximumValue,e))}},{key:"countNumberCharactersOnTheCaretLeftSide",value:function(e,t,i){for(var n=new RegExp("[0-9".concat(i,"-]")),a=0,r=0;r<t;r++)n.test(e[r])&&a++;return a}},{key:"findCaretPositionInFormattedNumber",value:function(e,t,i,n){var a,r=i.length,s=e.length,o=0;for(a=0;a<r&&o<s&&o<t;a++)(e[o]===i[a]||"."===e[o]&&i[a]===n)&&o++;return a}},{key:"countCharInText",value:function(e,t){for(var i=0,n=0;n<t.length;n++)t[n]===e&&i++;return i}},{key:"convertCharacterCountToIndexPosition",value:function(e){return Math.max(e,e-1)}},{key:"getElementSelection",value:function(e){var t,i={};try{t=this.isUndefined(e.selectionStart)}catch(e){t=!1}try{if(t){var n=window.getSelection().getRangeAt(0);i.start=n.startOffset,i.end=n.endOffset,i.length=i.end-i.start}else i.start=e.selectionStart,i.end=e.selectionEnd,i.length=i.end-i.start}catch(e){i.start=0,i.end=0,i.length=0}return i}},{key:"setElementSelection",value:function(t,i,n){var a=2<arguments.length&&void 0!==n?n:null;if(this.isUndefinedOrNullOrEmpty(a)&&(a=i),this.isInputElement(t))t.setSelectionRange(i,a);else if(!e.isNull(t.firstChild)){var r=document.createRange();r.setStart(t.firstChild,i),r.setEnd(t.firstChild,a);var s=window.getSelection();s.removeAllRanges(),s.addRange(r)}}},{key:"throwError",value:function(e){throw new Error(e)}},{key:"warning",value:function(e,t){1<arguments.length&&void 0!==t&&!t||console.warn("Warning: ".concat(e))}},{key:"isWheelUpEvent",value:function(e){return e.deltaY||this.throwError("The event passed as a parameter is not a valid wheel event, '".concat(e.type,"' given.")),e.deltaY<0}},{key:"isWheelDownEvent",value:function(e){return e.deltaY||this.throwError("The event passed as a parameter is not a valid wheel event, '".concat(e.type,"' given.")),0<e.deltaY}},{key:"forceDecimalPlaces",value:function(e,t){var i=o(String(e).split("."),2),n=i[0],a=i[1];return a?"".concat(n,".").concat(a.substr(0,t)):e}},{key:"roundToNearest",value:function(e,t){var i=1<arguments.length&&void 0!==t?t:1e3;return 0===e?0:(0===i&&this.throwError("The `stepPlace` used to round is equal to `0`. This value must not be equal to zero."),Math.round(e/i)*i)}},{key:"modifyAndRoundToNearestAuto",value:function(e,t,i){e=Number(this.forceDecimalPlaces(e,i));var n=Math.abs(e);if(0<=n&&n<1){var a,r=Math.pow(10,-i);if(0===e)return t?r:-r;var s,o=i,l=this.indexFirstNonZeroDecimalPlace(e);return a=o-1<=l?r:Math.pow(10,-(l+1)),s=t?e+a:e-a,this.roundToNearest(s,a)}e=parseInt(e,10);var u,c=Math.abs(e).toString().length;switch(c){case 1:u=0;break;case 2:case 3:u=1;break;case 4:case 5:u=2;break;default:u=c-3}var h,m=Math.pow(10,u);return(h=t?e+m:e-m)<=10&&-10<=h?h:this.roundToNearest(h,m)}},{key:"addAndRoundToNearestAuto",value:function(e,t){return this.modifyAndRoundToNearestAuto(e,!0,t)}},{key:"subtractAndRoundToNearestAuto",value:function(e,t){return this.modifyAndRoundToNearestAuto(e,!1,t)}},{key:"arabicToLatinNumbers",value:function(e,t,i,n){var a=!(1<arguments.length&&void 0!==t)||t,r=2<arguments.length&&void 0!==i&&i,s=3<arguments.length&&void 0!==n&&n;if(this.isNull(e))return e;var o=e.toString();if(""===o)return e;if(null===o.match(/[٠١٢٣٤٥٦٧٨٩۴۵۶]/g))return a&&(o=Number(o)),o;r&&(o=o.replace(/٫/,".")),s&&(o=o.replace(/٬/g,"")),o=o.replace(/[٠١٢٣٤٥٦٧٨٩]/g,(function(e){return e.charCodeAt(0)-1632})).replace(/[۰۱۲۳۴۵۶۷۸۹]/g,(function(e){return e.charCodeAt(0)-1776}));var l=Number(o);return isNaN(l)?l:(a&&(o=l),o)}},{key:"triggerEvent",value:function(e,t,i,n,a){var r,s=1<arguments.length&&void 0!==t?t:document,o=2<arguments.length&&void 0!==i?i:null,l=!(3<arguments.length&&void 0!==n)||n,u=!(4<arguments.length&&void 0!==a)||a;window.CustomEvent?r=new CustomEvent(e,{detail:o,bubbles:l,cancelable:u}):(r=document.createEvent("CustomEvent")).initCustomEvent(e,l,u,{detail:o}),s.dispatchEvent(r)}},{key:"parseStr",value:function(e){var t,i,n,a,r={};if(0===e&&1/e<0&&(e="-0"),e=e.toString(),this.isNegativeStrict(e,"-")?(e=e.slice(1),r.s=-1):r.s=1,-1<(t=e.indexOf("."))&&(e=e.replace(".","")),t<0&&(t=e.length),(i=-1===e.search(/[1-9]/i)?e.length:e.search(/[1-9]/i))===(n=e.length))r.e=0,r.c=[0];else{for(a=n-1;"0"===e.charAt(a);--a)--n;for(--n,r.e=t-i-1,r.c=[],t=0;i<=n;i+=1)r.c[t]=+e.charAt(i),t+=1}return r}},{key:"testMinMax",value:function(e,t){var i=t.c,n=e.c,a=t.s,r=e.s,s=t.e,o=e.e;if(!i[0]||!n[0])return i[0]?a:n[0]?-r:0;if(a!==r)return a;var l=a<0;if(s!==o)return o<s^l?1:-1;for(a=-1,r=(s=i.length)<(o=n.length)?s:o,a+=1;a<r;a+=1)if(i[a]!==n[a])return i[a]>n[a]^l?1:-1;return s===o?0:o<s^l?1:-1}},{key:"randomString",value:function(e){var t=0<arguments.length&&void 0!==e?e:5;return Math.random().toString(36).substr(2,t)}},{key:"domElement",value:function(t){return e.isString(t)?document.querySelector(t):t}},{key:"getElementValue",value:function(e){return"input"===e.tagName.toLowerCase()?e.value:this.text(e)}},{key:"setElementValue",value:function(e,t){var i=1<arguments.length&&void 0!==t?t:null;"input"===e.tagName.toLowerCase()?e.value=i:e.textContent=i}},{key:"setInvalidState",value:function(e,t){var i=1<arguments.length&&void 0!==t?t:"Invalid";""!==i&&!this.isNull(i)||this.throwError("Cannot set the invalid state with an empty message."),e.setCustomValidity(i)}},{key:"setValidState",value:function(e){e.setCustomValidity("")}},{key:"cloneObject",value:function(e){return s({},e)}},{key:"camelize",value:function(e,t,i,n){var a=1<arguments.length&&void 0!==t?t:"-",r=!(2<arguments.length&&void 0!==i)||i,s=!(3<arguments.length&&void 0!==n)||n;if(this.isNull(e))return null;r&&(e=e.replace(/^data-/,""));var o=e.split(a).map((function(e){return"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1))}));return o=o.join(""),s&&(o="".concat(o.charAt(0).toLowerCase()).concat(o.slice(1))),o}},{key:"text",value:function(e){var t=e.nodeType;return t===Node.ELEMENT_NODE||t===Node.DOCUMENT_NODE||t===Node.DOCUMENT_FRAGMENT_NODE?e.textContent:t===Node.TEXT_NODE?e.nodeValue:""}},{key:"setText",value:function(e,t){var i=e.nodeType;i!==Node.ELEMENT_NODE&&i!==Node.DOCUMENT_NODE&&i!==Node.DOCUMENT_FRAGMENT_NODE||(e.textContent=t)}},{key:"filterOut",value:function(e,t){var i=this;return e.filter((function(e){return!i.isInArray(e,t)}))}},{key:"trimPaddedZerosFromDecimalPlaces",value:function(e){if(""===(e=String(e)))return"";var t=o(e.split("."),2),i=t[0],n=t[1];if(this.isUndefinedOrNullOrEmpty(n))return i;var a=n.replace(/0+$/g,"");return""===a?i:"".concat(i,".").concat(a)}},{key:"getHoveredElement",value:function(){var e=r(document.querySelectorAll(":hover"));return e[e.length-1]}},{key:"arrayTrim",value:function(e,t){var i=e.length;return 0===i||i<t?e:t<0?[]:(e.length=parseInt(t,10),e)}},{key:"arrayUnique",value:function(){var e;return r(new Set((e=[]).concat.apply(e,arguments)))}},{key:"mergeMaps",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return new Map(t.reduce((function(e,t){return e.concat(r(t))}),[]))}},{key:"objectKeyLookup",value:function(e,t){var i=Object.entries(e).find((function(e){return e[1]===t})),n=null;return void 0!==i&&(n=i[0]),n}},{key:"insertAt",value:function(e,t,i){if(i>(e=String(e)).length)throw new Error("The given index is out of the string range.");if(1!==t.length)throw new Error("The given string `char` should be only one character long.");return""===e&&0===i?t:"".concat(e.slice(0,i)).concat(t).concat(e.slice(i))}},{key:"scientificToDecimal",value:function(e){var t=Number(e);if(isNaN(t))return NaN;if(e=String(e),!this.contains(e,"e")&&!this.contains(e,"E"))return e;var i=o(e.split(/e/i),2),n=i[0],a=i[1],r=n<0;r&&(n=n.replace("-",""));var s=+a<0;s&&(a=a.replace("-",""));var l,u=o(n.split(/\./),2),c=u[0],h=u[1];return l=s?(l=c.length>a?this.insertAt(c,".",c.length-a):"0.".concat("0".repeat(a-c.length)).concat(c),"".concat(l).concat(h||"")):h?(n="".concat(c).concat(h),a<h.length?this.insertAt(n,".",+a+c.length):"".concat(n).concat("0".repeat(a-h.length))):(n=n.replace(".",""),"".concat(n).concat("0".repeat(Number(a)))),r&&(l="-".concat(l)),l}}]),e}(),m=function(){function e(t){if(function(t){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this),null===t)throw new Error("Invalid AST")}return function(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,[{key:"evaluate",value:function(e){if(null==e)throw new Error("Invalid AST sub-tree");if("number"===e.type)return e.value;if("unaryMinus"===e.type)return-this.evaluate(e.left);var t=this.evaluate(e.left),i=this.evaluate(e.right);switch(e.type){case"op_+":return Number(t)+Number(i);case"op_-":return t-i;case"op_*":return t*i;case"op_/":return t/i;default:throw new Error("Invalid operator '".concat(e.type,"'"))}}}]),e}(),g=function(){function e(){!function(t){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this)}return function(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e,[{key:"createNode",value:function(t,i,n){var a=new e;return a.type=t,a.left=i,a.right=n,a}},{key:"createUnaryNode",value:function(t){var i=new e;return i.type="unaryMinus",i.left=t,i.right=null,i}},{key:"createLeaf",value:function(t){var i=new e;return i.type="number",i.value=t,i}}]),e}();function d(e,t,i){!function(e){if(!(e instanceof d))throw new TypeError("Cannot call a class as a function")}(this),this.type=e,this.value=t,this.symbol=i}var v=function(){function e(t){!function(t){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this),this.text=t,this.textLength=t.length,this.index=0,this.token=new d("Error",0,0)}return function(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,[{key:"_skipSpaces",value:function(){for(;" "===this.text[this.index]&&this.index<=this.textLength;)this.index++}},{key:"getIndex",value:function(){return this.index}},{key:"getNextToken",value:function(e){var t=0<arguments.length&&void 0!==e?e:".";if(this._skipSpaces(),this.textLength===this.index)return this.token.type="EOT",this.token;if(h.isDigit(this.text[this.index]))return this.token.type="num",this.token.value=this._getNumber(t),this.token;switch(this.token.type="Error",this.text[this.index]){case"+":this.token.type="+";break;case"-":this.token.type="-";break;case"*":this.token.type="*";break;case"/":this.token.type="/";break;case"(":this.token.type="(";break;case")":this.token.type=")"}if("Error"===this.token.type)throw new Error("Unexpected token '".concat(this.token.symbol,"' at position '").concat(this.token.index,"' in the token function"));return this.token.symbol=this.text[this.index],this.index++,this.token}},{key:"_getNumber",value:function(e){this._skipSpaces();for(var t=this.index;this.index<=this.textLength&&h.isDigit(this.text[this.index]);)this.index++;for(this.text[this.index]===e&&this.index++;this.index<=this.textLength&&h.isDigit(this.text[this.index]);)this.index++;if(this.index===t)throw new Error("No number has been found while it was expected");return this.text.substring(t,this.index).replace(e,".")}}]),e}(),p=function(){function e(t){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:".";return function(t){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this),this.text=t,this.decimalCharacter=i,this.lexer=new v(t),this.token=this.lexer.getNextToken(this.decimalCharacter),this._exp()}return function(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,[{key:"_exp",value:function(){var e=this._term(),t=this._moreExp();return g.createNode("op_+",e,t)}},{key:"_moreExp",value:function(){var e,t;switch(this.token.type){case"+":return this.token=this.lexer.getNextToken(this.decimalCharacter),e=this._term(),t=this._moreExp(),g.createNode("op_+",t,e);case"-":return this.token=this.lexer.getNextToken(this.decimalCharacter),e=this._term(),t=this._moreExp(),g.createNode("op_-",t,e)}return g.createLeaf(0)}},{key:"_term",value:function(){var e=this._factor(),t=this._moreTerms();return g.createNode("op_*",e,t)}},{key:"_moreTerms",value:function(){var e,t;switch(this.token.type){case"*":return this.token=this.lexer.getNextToken(this.decimalCharacter),e=this._factor(),t=this._moreTerms(),g.createNode("op_*",t,e);case"/":return this.token=this.lexer.getNextToken(this.decimalCharacter),e=this._factor(),t=this._moreTerms(),g.createNode("op_/",t,e)}return g.createLeaf(1)}},{key:"_factor",value:function(){var e,t,i;switch(this.token.type){case"num":return i=this.token.value,this.token=this.lexer.getNextToken(this.decimalCharacter),g.createLeaf(i);case"-":return this.token=this.lexer.getNextToken(this.decimalCharacter),t=this._factor(),g.createUnaryNode(t);case"(":return this.token=this.lexer.getNextToken(this.decimalCharacter),e=this._exp(),this._match(")"),e;default:throw new Error("Unexpected token '".concat(this.token.symbol,"' with type '").concat(this.token.type,"' at position '").concat(this.token.index,"' in the factor function"))}}},{key:"_match",value:function(e){var t=this.lexer.getIndex()-1;if(this.text[t]!==e)throw new Error("Unexpected token '".concat(this.token.symbol,"' at position '").concat(t,"' in the match function"));this.token=this.lexer.getNextToken(this.decimalCharacter)}}]),e}();function f(e){return function(e){if(Array.isArray(e))return b(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||S(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=e[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!t||i.length!==t);n=!0);}catch(e){a=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}}(e,t)||S(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e,t){if(e){if("string"==typeof e)return b(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(i):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?b(e,t):void 0}}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function w(){return(w=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}function P(e){return(P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function O(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var k,N=function(){function e(){var t=this,i=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,a=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;!function(t){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this);var r=e._setArgumentsValues(i,n,a),s=r.domElement,o=r.initialValue,l=r.userOptions;if(this.domElement=s,this.defaultRawValue="",this._setSettings(l,!1),this._checkElement(),this.savedCancellableValue=null,this.historyTable=[],this.historyTableIndex=-1,this.onGoingRedo=!1,this.parentForm=this._getParentForm(),!this.runOnce&&this.settings.formatOnPageLoad)this._formatDefaultValueOnPageLoad(o);else{var u;if(h.isNull(o))switch(this.settings.emptyInputBehavior){case e.options.emptyInputBehavior.min:u=this.settings.minimumValue;break;case e.options.emptyInputBehavior.max:u=this.settings.maximumValue;break;case e.options.emptyInputBehavior.zero:u="0";break;case e.options.emptyInputBehavior.focus:case e.options.emptyInputBehavior.press:case e.options.emptyInputBehavior.always:case e.options.emptyInputBehavior.null:u="";break;default:u=this.settings.emptyInputBehavior}else u=o;this._setElementAndRawValue(u)}this.runOnce=!0,this.hasEventListeners=!1,(this.isInputElement||this.isContentEditable)&&(this.settings.noEventListeners||this._createEventListeners(),this._setWritePermissions(!0)),this._saveInitialValues(o),this.sessionStorageAvailable=this.constructor._storageTest(),this.storageNamePrefix="AUTO_",this._setPersistentStorageName(),this.validState=!0,this.isFocused=!1,this.isWheelEvent=!1,this.isDropEvent=!1,this.isEditing=!1,this.rawValueOnFocus=void 0,this.internalModification=!1,this.attributeToWatch=this._getAttributeToWatch(),this.getterSetter=Object.getOwnPropertyDescriptor(this.domElement.__proto__,this.attributeToWatch),this._addWatcher(),this.settings.createLocalList&&this._createLocalList(),this.constructor._addToGlobalList(this),this.global={set:function(e,i){var n=1<arguments.length&&void 0!==i?i:null;t.autoNumericLocalList.forEach((function(t){t.set(e,n)}))},setUnformatted:function(e,i){var n=1<arguments.length&&void 0!==i?i:null;t.autoNumericLocalList.forEach((function(t){t.setUnformatted(e,n)}))},get:function(e){var i=0<arguments.length&&void 0!==e?e:null,n=[];return t.autoNumericLocalList.forEach((function(e){n.push(e.get())})),t._executeCallback(n,i),n},getNumericString:function(e){var i=0<arguments.length&&void 0!==e?e:null,n=[];return t.autoNumericLocalList.forEach((function(e){n.push(e.getNumericString())})),t._executeCallback(n,i),n},getFormatted:function(e){var i=0<arguments.length&&void 0!==e?e:null,n=[];return t.autoNumericLocalList.forEach((function(e){n.push(e.getFormatted())})),t._executeCallback(n,i),n},getNumber:function(e){var i=0<arguments.length&&void 0!==e?e:null,n=[];return t.autoNumericLocalList.forEach((function(e){n.push(e.getNumber())})),t._executeCallback(n,i),n},getLocalized:function(e){var i=0<arguments.length&&void 0!==e?e:null,n=[];return t.autoNumericLocalList.forEach((function(e){n.push(e.getLocalized())})),t._executeCallback(n,i),n},reformat:function(){t.autoNumericLocalList.forEach((function(e){e.reformat()}))},unformat:function(){t.autoNumericLocalList.forEach((function(e){e.unformat()}))},unformatLocalized:function(e){var i=0<arguments.length&&void 0!==e?e:null;t.autoNumericLocalList.forEach((function(e){e.unformatLocalized(i)}))},update:function(){for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];t.autoNumericLocalList.forEach((function(e){e.update.apply(e,i)}))},isPristine:function(){var e=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],i=!0;return t.autoNumericLocalList.forEach((function(t){i&&!t.isPristine(e)&&(i=!1)})),i},clear:function(e){var i=0<arguments.length&&void 0!==e&&e;t.autoNumericLocalList.forEach((function(e){e.clear(i)}))},remove:function(){t.autoNumericLocalList.forEach((function(e){e.remove()}))},wipe:function(){t.autoNumericLocalList.forEach((function(e){e.wipe()}))},nuke:function(){t.autoNumericLocalList.forEach((function(e){e.nuke()}))},has:function(i){return i instanceof e?t.autoNumericLocalList.has(i.node()):t.autoNumericLocalList.has(i)},addObject:function(i){var n,a;a=i instanceof e?(n=i.node(),i):e.getAutoNumericElement(n=i),t._hasLocalList()||t._createLocalList();var r,s=a._getLocalList();0===s.size&&(a._createLocalList(),s=a._getLocalList()),(r=s instanceof Map?h.mergeMaps(t._getLocalList(),s):(t._addToLocalList(n,a),t._getLocalList())).forEach((function(e){e._setLocalList(r)}))},removeObject:function(i,n){var a,r,s=1<arguments.length&&void 0!==n&&n;r=i instanceof e?(a=i.node(),i):e.getAutoNumericElement(a=i);var o=t.autoNumericLocalList;t.autoNumericLocalList.delete(a),o.forEach((function(e){e._setLocalList(t.autoNumericLocalList)})),s||a!==t.node()?r._createLocalList():r._setLocalList(new Map)},empty:function(e){var i=0<arguments.length&&void 0!==e&&e;t.autoNumericLocalList.forEach((function(e){i?e._createLocalList():e._setLocalList(new Map)}))},elements:function(){var e=[];return t.autoNumericLocalList.forEach((function(t){e.push(t.node())})),e},getList:function(){return t.autoNumericLocalList},size:function(){return t.autoNumericLocalList.size}},this.options={reset:function(){return t.settings={rawValue:t.defaultRawValue},t.update(e.defaultSettings),t},allowDecimalPadding:function(e){return t.update({allowDecimalPadding:e}),t},alwaysAllowDecimalCharacter:function(e){return t.update({alwaysAllowDecimalCharacter:e}),t},caretPositionOnFocus:function(e){return t.settings.caretPositionOnFocus=e,t},createLocalList:function(e){return t.settings.createLocalList=e,t.settings.createLocalList?t._hasLocalList()||t._createLocalList():t._deleteLocalList(),t},currencySymbol:function(e){return t.update({currencySymbol:e}),t},currencySymbolPlacement:function(e){return t.update({currencySymbolPlacement:e}),t},decimalCharacter:function(e){return t.update({decimalCharacter:e}),t},decimalCharacterAlternative:function(e){return t.settings.decimalCharacterAlternative=e,t},decimalPlaces:function(e){return h.warning("Using `options.decimalPlaces()` instead of calling the specific `options.decimalPlacesRawValue()`, `options.decimalPlacesShownOnFocus()` and `options.decimalPlacesShownOnBlur()` methods will reset those options.\nPlease call the specific methods if you do not want to reset those.",t.settings.showWarnings),t.update({decimalPlaces:e}),t},decimalPlacesRawValue:function(e){return t.update({decimalPlacesRawValue:e}),t},decimalPlacesShownOnBlur:function(e){return t.update({decimalPlacesShownOnBlur:e}),t},decimalPlacesShownOnFocus:function(e){return t.update({decimalPlacesShownOnFocus:e}),t},defaultValueOverride:function(e){return t.update({defaultValueOverride:e}),t},digitalGroupSpacing:function(e){return t.update({digitalGroupSpacing:e}),t},digitGroupSeparator:function(e){return t.update({digitGroupSeparator:e}),t},divisorWhenUnfocused:function(e){return t.update({divisorWhenUnfocused:e}),t},emptyInputBehavior:function(i){return null===t.rawValue&&i!==e.options.emptyInputBehavior.null&&(h.warning("You are trying to modify the `emptyInputBehavior` option to something different than `'null'` (".concat(i,"), but the element raw value is currently set to `null`. This would result in an invalid `rawValue`. In order to fix that, the element value has been changed to the empty string `''`."),t.settings.showWarnings),t.rawValue=""),t.update({emptyInputBehavior:i}),t},eventBubbles:function(e){return t.settings.eventBubbles=e,t},eventIsCancelable:function(e){return t.settings.eventIsCancelable=e,t},failOnUnknownOption:function(e){return t.settings.failOnUnknownOption=e,t},formatOnPageLoad:function(e){return t.settings.formatOnPageLoad=e,t},formulaMode:function(e){return t.settings.formulaMode=e,t},historySize:function(e){return t.settings.historySize=e,t},invalidClass:function(e){return t.settings.invalidClass=e,t},isCancellable:function(e){return t.settings.isCancellable=e,t},leadingZero:function(e){return t.update({leadingZero:e}),t},maximumValue:function(e){return t.update({maximumValue:e}),t},minimumValue:function(e){return t.update({minimumValue:e}),t},modifyValueOnWheel:function(e){return t.settings.modifyValueOnWheel=e,t},negativeBracketsTypeOnBlur:function(e){return t.update({negativeBracketsTypeOnBlur:e}),t},negativePositiveSignPlacement:function(e){return t.update({negativePositiveSignPlacement:e}),t},negativeSignCharacter:function(e){return t.update({negativeSignCharacter:e}),t},noEventListeners:function(i){return i===e.options.noEventListeners.noEvents&&t.settings.noEventListeners===e.options.noEventListeners.addEvents&&t._removeEventListeners(),t.update({noEventListeners:i}),t},onInvalidPaste:function(e){return t.settings.onInvalidPaste=e,t},outputFormat:function(e){return t.settings.outputFormat=e,t},overrideMinMaxLimits:function(e){return t.update({overrideMinMaxLimits:e}),t},positiveSignCharacter:function(e){return t.update({positiveSignCharacter:e}),t},rawValueDivisor:function(e){return t.update({rawValueDivisor:e}),t},readOnly:function(e){return t.settings.readOnly=e,t._setWritePermissions(),t},roundingMethod:function(e){return t.update({roundingMethod:e}),t},saveValueToSessionStorage:function(e){return t.update({saveValueToSessionStorage:e}),t},symbolWhenUnfocused:function(e){return t.update({symbolWhenUnfocused:e}),t},selectNumberOnly:function(e){return t.settings.selectNumberOnly=e,t},selectOnFocus:function(e){return t.settings.selectOnFocus=e,t},serializeSpaces:function(e){return t.settings.serializeSpaces=e,t},showOnlyNumbersOnFocus:function(e){return t.update({showOnlyNumbersOnFocus:e}),t},showPositiveSign:function(e){return t.update({showPositiveSign:e}),t},showWarnings:function(e){return t.settings.showWarnings=e,t},styleRules:function(e){return t.update({styleRules:e}),t},suffixText:function(e){return t.update({suffixText:e}),t},unformatOnHover:function(e){return t.settings.unformatOnHover=e,t},unformatOnSubmit:function(e){return t.settings.unformatOnSubmit=e,t},valuesToStrings:function(e){return t.update({valuesToStrings:e}),t},watchExternalChanges:function(e){return t.update({watchExternalChanges:e}),t},wheelOn:function(e){return t.settings.wheelOn=e,t},wheelStep:function(e){return t.settings.wheelStep=e,t}},this._triggerEvent(e.events.initialized,this.domElement,{newValue:h.getElementValue(this.domElement),newRawValue:this.rawValue,error:null,aNElement:this})}var t,i;return i=[{key:"version",value:function(){return"4.6.0"}},{key:"_setArgumentsValues",value:function(e,t,i){h.isNull(e)&&h.throwError("At least one valid parameter is needed in order to initialize an AutoNumeric object");var n,a,r,s=h.isElement(e),o=h.isString(e),l=h.isObject(t),u=Array.isArray(t)&&0<t.length,c=h.isNumberOrArabic(t)||""===t,m=this._isPreDefinedOptionValid(t),g=h.isNull(t),d=h.isEmptyString(t),v=h.isObject(i),p=Array.isArray(i)&&0<i.length,f=h.isNull(i),y=this._isPreDefinedOptionValid(i);return s&&g&&f?(n=e,a=r=null):s&&c&&f?(n=e,r=t,a=null):s&&l&&f?(n=e,r=null,a=t):s&&m&&f?(n=e,r=null,a=this._getOptionObject(t)):s&&u&&f?(n=e,r=null,a=this.mergeOptions(t)):s&&(g||d)&&v?(n=e,r=null,a=i):s&&(g||d)&&p?(n=e,r=null,a=this.mergeOptions(i)):o&&g&&f?(n=document.querySelector(e),a=r=null):o&&l&&f?(n=document.querySelector(e),r=null,a=t):o&&m&&f?(n=document.querySelector(e),r=null,a=this._getOptionObject(t)):o&&u&&f?(n=document.querySelector(e),r=null,a=this.mergeOptions(t)):o&&(g||d)&&v?(n=document.querySelector(e),r=null,a=i):o&&(g||d)&&p?(n=document.querySelector(e),r=null,a=this.mergeOptions(i)):o&&c&&f?(n=document.querySelector(e),r=t,a=null):o&&c&&v?(n=document.querySelector(e),r=t,a=i):o&&c&&y?(n=document.querySelector(e),r=t,a=this._getOptionObject(i)):o&&c&&p?(n=document.querySelector(e),r=t,a=this.mergeOptions(i)):s&&c&&v?(n=e,r=t,a=i):s&&c&&y?(n=e,r=t,a=this._getOptionObject(i)):s&&c&&p?(n=e,r=t,a=this.mergeOptions(i)):h.throwError("The parameters given to the AutoNumeric object are not valid, '".concat(e,"', '").concat(t,"' and '").concat(i,"' given.")),h.isNull(n)&&h.throwError("The selector '".concat(e,"' did not select any valid DOM element. Please check on which element you called AutoNumeric.")),{domElement:n,initialValue:r,userOptions:a}}},{key:"mergeOptions",value:function(e){var t=this,i={};return e.forEach((function(e){w(i,t._getOptionObject(e))})),i}},{key:"_isPreDefinedOptionValid",value:function(t){return Object.prototype.hasOwnProperty.call(e.predefinedOptions,t)}},{key:"_getOptionObject",value:function(t){var i;return h.isString(t)?null==(i=e.getPredefinedOptions()[t])&&h.warning("The given pre-defined option [".concat(t,"] is not recognized by autoNumeric. Please check that pre-defined option name."),!0):i=t,i}},{key:"_doesFormHandlerListExists",value:function(){var e=P(window.aNFormHandlerMap);return"undefined"!==e&&"object"===e}},{key:"_createFormHandlerList",value:function(){window.aNFormHandlerMap=new Map}},{key:"_checkValuesToStringsArray",value:function(e,t){return h.isInArray(String(e),t)}},{key:"_checkValuesToStringsSettings",value:function(e,t){return this._checkValuesToStringsArray(e,Object.keys(t.valuesToStrings))}},{key:"_checkStringsToValuesSettings",value:function(e,t){return this._checkValuesToStringsArray(e,Object.values(t.valuesToStrings))}},{key:"_unformatAltHovered",value:function(e){e.hoveredWithAlt=!0,e.unformat()}},{key:"_reformatAltHovered",value:function(e){e.hoveredWithAlt=!1,e.reformat()}},{key:"_getChildANInputElement",value:function(e){var t=this,i=e.getElementsByTagName("input"),n=[];return Array.prototype.slice.call(i,0).forEach((function(e){t.test(e)&&n.push(e)})),n}},{key:"test",value:function(e){return this._isInGlobalList(h.domElement(e))}},{key:"_createWeakMap",value:function(e){window[e]=new WeakMap}},{key:"_createGlobalList",value:function(){this.autoNumericGlobalListName="autoNumericGlobalList",this._createWeakMap(this.autoNumericGlobalListName)}},{key:"_doesGlobalListExists",value:function(){var e=P(window[this.autoNumericGlobalListName]);return"undefined"!==e&&"object"===e}},{key:"_addToGlobalList",value:function(e){this._doesGlobalListExists()||this._createGlobalList();var t=e.node();if(this._isInGlobalList(t)){if(this._getFromGlobalList(t)===this)return;h.warning("A reference to the DOM element you just initialized already exists in the global AutoNumeric element list. Please make sure to not initialize the same DOM element multiple times.",e.getSettings().showWarnings)}window[this.autoNumericGlobalListName].set(t,e)}},{key:"_removeFromGlobalList",value:function(e){this._doesGlobalListExists()&&window[this.autoNumericGlobalListName].delete(e.node())}},{key:"_getFromGlobalList",value:function(e){return this._doesGlobalListExists()?window[this.autoNumericGlobalListName].get(e):null}},{key:"_isInGlobalList",value:function(e){return!!this._doesGlobalListExists()&&window[this.autoNumericGlobalListName].has(e)}},{key:"validate",value:function(t,i,n){var a=!(1<arguments.length&&void 0!==i)||i,r=2<arguments.length&&void 0!==n?n:null;!h.isUndefinedOrNullOrEmpty(t)&&h.isObject(t)||h.throwError("The userOptions are invalid ; it should be a valid object, [".concat(t,"] given."));var s,o=h.isObject(r);o||h.isNull(r)||h.throwError("The 'originalOptions' parameter is invalid ; it should either be a valid option object or `null`, [".concat(t,"] given.")),h.isNull(t)||this._convertOldOptionsToNewOnes(t),s=a?w({},this.getDefaultConfig(),t):t,h.isTrueOrFalseString(s.showWarnings)||h.isBoolean(s.showWarnings)||h.throwError("The debug option 'showWarnings' is invalid ; it should be either 'true' or 'false', [".concat(s.showWarnings,"] given."));var l,u=/^[0-9]+$/,c=/[0-9]+/,m=/^-?[0-9]+(\.?[0-9]+)?$/,g=/^[0-9]+(\.?[0-9]+)?$/;h.isTrueOrFalseString(s.allowDecimalPadding)||h.isBoolean(s.allowDecimalPadding)||s.allowDecimalPadding===e.options.allowDecimalPadding.floats||h.throwError("The decimal padding option 'allowDecimalPadding' is invalid ; it should either be `false`, `true` or `'floats'`, [".concat(s.allowDecimalPadding,"] given.")),s.allowDecimalPadding!==e.options.allowDecimalPadding.never&&"false"!==s.allowDecimalPadding||s.decimalPlaces===e.options.decimalPlaces.none&&s.decimalPlacesShownOnBlur===e.options.decimalPlacesShownOnBlur.none&&s.decimalPlacesShownOnFocus===e.options.decimalPlacesShownOnFocus.none||h.warning("Setting 'allowDecimalPadding' to [".concat(s.allowDecimalPadding,"] will override the current 'decimalPlaces*' settings [").concat(s.decimalPlaces,", ").concat(s.decimalPlacesShownOnBlur," and ").concat(s.decimalPlacesShownOnFocus,"]."),s.showWarnings),h.isTrueOrFalseString(s.alwaysAllowDecimalCharacter)||h.isBoolean(s.alwaysAllowDecimalCharacter)||h.throwError("The option 'alwaysAllowDecimalCharacter' is invalid ; it should either be `true` or `false`, [".concat(s.alwaysAllowDecimalCharacter,"] given.")),h.isNull(s.caretPositionOnFocus)||h.isInArray(s.caretPositionOnFocus,[e.options.caretPositionOnFocus.start,e.options.caretPositionOnFocus.end,e.options.caretPositionOnFocus.decimalLeft,e.options.caretPositionOnFocus.decimalRight])||h.throwError("The display on empty string option 'caretPositionOnFocus' is invalid ; it should either be `null`, 'focus', 'press', 'always' or 'zero', [".concat(s.caretPositionOnFocus,"] given.")),l=o?r:this._correctCaretPositionOnFocusAndSelectOnFocusOptions(t),h.isNull(l)||l.caretPositionOnFocus===e.options.caretPositionOnFocus.doNoForceCaretPosition||l.selectOnFocus!==e.options.selectOnFocus.select||h.warning("The 'selectOnFocus' option is set to 'select', which is in conflict with the 'caretPositionOnFocus' which is set to '".concat(l.caretPositionOnFocus,"'. As a result, if this has been called when instantiating an AutoNumeric object, the 'selectOnFocus' option is forced to 'doNotSelect'."),s.showWarnings),h.isInArray(s.digitGroupSeparator,[e.options.digitGroupSeparator.comma,e.options.digitGroupSeparator.dot,e.options.digitGroupSeparator.normalSpace,e.options.digitGroupSeparator.thinSpace,e.options.digitGroupSeparator.narrowNoBreakSpace,e.options.digitGroupSeparator.noBreakSpace,e.options.digitGroupSeparator.noSeparator,e.options.digitGroupSeparator.apostrophe,e.options.digitGroupSeparator.arabicThousandsSeparator,e.options.digitGroupSeparator.dotAbove,e.options.digitGroupSeparator.privateUseTwo])||h.throwError("The thousand separator character option 'digitGroupSeparator' is invalid ; it should be ',', '.', '٬', '˙', \"'\", '', ' ', ' ', ' ', ' ' or empty (''), [".concat(s.digitGroupSeparator,"] given.")),h.isTrueOrFalseString(s.showOnlyNumbersOnFocus)||h.isBoolean(s.showOnlyNumbersOnFocus)||h.throwError("The 'showOnlyNumbersOnFocus' option is invalid ; it should be either 'true' or 'false', [".concat(s.showOnlyNumbersOnFocus,"] given.")),h.isInArray(s.digitalGroupSpacing,[e.options.digitalGroupSpacing.two,e.options.digitalGroupSpacing.twoScaled,e.options.digitalGroupSpacing.three,e.options.digitalGroupSpacing.four])||2<=s.digitalGroupSpacing&&s.digitalGroupSpacing<=4||h.throwError("The grouping separator option for thousands 'digitalGroupSpacing' is invalid ; it should be '2', '2s', '3', or '4', [".concat(s.digitalGroupSpacing,"] given.")),h.isInArray(s.decimalCharacter,[e.options.decimalCharacter.comma,e.options.decimalCharacter.dot,e.options.decimalCharacter.middleDot,e.options.decimalCharacter.arabicDecimalSeparator,e.options.decimalCharacter.decimalSeparatorKeySymbol])||h.throwError("The decimal separator character option 'decimalCharacter' is invalid ; it should be '.', ',', '·', '⎖' or '٫', [".concat(s.decimalCharacter,"] given.")),s.decimalCharacter===s.digitGroupSeparator&&h.throwError("autoNumeric will not function properly when the decimal character 'decimalCharacter' [".concat(s.decimalCharacter,"] and the thousand separator 'digitGroupSeparator' [").concat(s.digitGroupSeparator,"] are the same character.")),h.isNull(s.decimalCharacterAlternative)||h.isString(s.decimalCharacterAlternative)||h.throwError("The alternate decimal separator character option 'decimalCharacterAlternative' is invalid ; it should be a string, [".concat(s.decimalCharacterAlternative,"] given.")),""===s.currencySymbol||h.isString(s.currencySymbol)||h.throwError("The currency symbol option 'currencySymbol' is invalid ; it should be a string, [".concat(s.currencySymbol,"] given.")),h.isInArray(s.currencySymbolPlacement,[e.options.currencySymbolPlacement.prefix,e.options.currencySymbolPlacement.suffix])||h.throwError("The placement of the currency sign option 'currencySymbolPlacement' is invalid ; it should either be 'p' (prefix) or 's' (suffix), [".concat(s.currencySymbolPlacement,"] given.")),h.isInArray(s.negativePositiveSignPlacement,[e.options.negativePositiveSignPlacement.prefix,e.options.negativePositiveSignPlacement.suffix,e.options.negativePositiveSignPlacement.left,e.options.negativePositiveSignPlacement.right,e.options.negativePositiveSignPlacement.none])||h.throwError("The placement of the negative sign option 'negativePositiveSignPlacement' is invalid ; it should either be 'p' (prefix), 's' (suffix), 'l' (left), 'r' (right) or 'null', [".concat(s.negativePositiveSignPlacement,"] given.")),h.isTrueOrFalseString(s.showPositiveSign)||h.isBoolean(s.showPositiveSign)||h.throwError("The show positive sign option 'showPositiveSign' is invalid ; it should be either 'true' or 'false', [".concat(s.showPositiveSign,"] given.")),h.isString(s.suffixText)&&(""===s.suffixText||!h.isNegative(s.suffixText,s.negativeSignCharacter)&&!c.test(s.suffixText))||h.throwError("The additional suffix option 'suffixText' is invalid ; it should not contains the negative sign '".concat(s.negativeSignCharacter,"' nor any numerical characters, [").concat(s.suffixText,"] given.")),h.isString(s.negativeSignCharacter)&&1===s.negativeSignCharacter.length&&!h.isUndefinedOrNullOrEmpty(s.negativeSignCharacter)&&!c.test(s.negativeSignCharacter)||h.throwError("The negative sign character option 'negativeSignCharacter' is invalid ; it should be a single character, and cannot be any numerical characters, [".concat(s.negativeSignCharacter,"] given.")),h.isString(s.positiveSignCharacter)&&1===s.positiveSignCharacter.length&&!h.isUndefinedOrNullOrEmpty(s.positiveSignCharacter)&&!c.test(s.positiveSignCharacter)||h.throwError("The positive sign character option 'positiveSignCharacter' is invalid ; it should be a single character, and cannot be any numerical characters, [".concat(s.positiveSignCharacter,"] given.\nIf you want to hide the positive sign character, you need to set the `showPositiveSign` option to `true`.")),s.negativeSignCharacter===s.positiveSignCharacter&&h.throwError("The positive 'positiveSignCharacter' and negative 'negativeSignCharacter' sign characters cannot be identical ; [".concat(s.negativeSignCharacter,"] given."));var d=y(h.isNull(s.negativeBracketsTypeOnBlur)?["",""]:s.negativeBracketsTypeOnBlur.split(","),2),v=d[0],p=d[1];(h.contains(s.digitGroupSeparator,s.negativeSignCharacter)||h.contains(s.decimalCharacter,s.negativeSignCharacter)||h.contains(s.decimalCharacterAlternative,s.negativeSignCharacter)||h.contains(v,s.negativeSignCharacter)||h.contains(p,s.negativeSignCharacter)||h.contains(s.suffixText,s.negativeSignCharacter))&&h.throwError("The negative sign character option 'negativeSignCharacter' is invalid ; it should not be equal or a part of the digit separator, the decimal character, the decimal character alternative, the negative brackets or the suffix text, [".concat(s.negativeSignCharacter,"] given.")),(h.contains(s.digitGroupSeparator,s.positiveSignCharacter)||h.contains(s.decimalCharacter,s.positiveSignCharacter)||h.contains(s.decimalCharacterAlternative,s.positiveSignCharacter)||h.contains(v,s.positiveSignCharacter)||h.contains(p,s.positiveSignCharacter)||h.contains(s.suffixText,s.positiveSignCharacter))&&h.throwError("The positive sign character option 'positiveSignCharacter' is invalid ; it should not be equal or a part of the digit separator, the decimal character, the decimal character alternative, the negative brackets or the suffix text, [".concat(s.positiveSignCharacter,"] given.")),h.isNull(s.overrideMinMaxLimits)||h.isInArray(s.overrideMinMaxLimits,[e.options.overrideMinMaxLimits.ceiling,e.options.overrideMinMaxLimits.floor,e.options.overrideMinMaxLimits.ignore,e.options.overrideMinMaxLimits.invalid])||h.throwError("The override min & max limits option 'overrideMinMaxLimits' is invalid ; it should either be 'ceiling', 'floor', 'ignore' or 'invalid', [".concat(s.overrideMinMaxLimits,"] given.")),s.overrideMinMaxLimits!==e.options.overrideMinMaxLimits.invalid&&s.overrideMinMaxLimits!==e.options.overrideMinMaxLimits.ignore&&(0<s.minimumValue||s.maximumValue<0)&&h.warning("You've set a `minimumValue` or a `maximumValue` excluding the value `0`. AutoNumeric will force the users to always have a valid value in the input, hence preventing them to clear the field. If you want to allow for temporary invalid values (ie. out-of-range), you should use the 'invalid' option for the 'overrideMinMaxLimits' setting."),h.isString(s.maximumValue)&&m.test(s.maximumValue)||h.throwError("The maximum possible value option 'maximumValue' is invalid ; it should be a string that represents a positive or negative number, [".concat(s.maximumValue,"] given.")),h.isString(s.minimumValue)&&m.test(s.minimumValue)||h.throwError("The minimum possible value option 'minimumValue' is invalid ; it should be a string that represents a positive or negative number, [".concat(s.minimumValue,"] given.")),parseFloat(s.minimumValue)>parseFloat(s.maximumValue)&&h.throwError("The minimum possible value option is greater than the maximum possible value option ; 'minimumValue' [".concat(s.minimumValue,"] should be smaller than 'maximumValue' [").concat(s.maximumValue,"].")),h.isInt(s.decimalPlaces)&&0<=s.decimalPlaces||h.isString(s.decimalPlaces)&&u.test(s.decimalPlaces)||h.throwError("The number of decimal places option 'decimalPlaces' is invalid ; it should be a positive integer, [".concat(s.decimalPlaces,"] given.")),h.isNull(s.decimalPlacesRawValue)||h.isInt(s.decimalPlacesRawValue)&&0<=s.decimalPlacesRawValue||h.isString(s.decimalPlacesRawValue)&&u.test(s.decimalPlacesRawValue)||h.throwError("The number of decimal places for the raw value option 'decimalPlacesRawValue' is invalid ; it should be a positive integer or `null`, [".concat(s.decimalPlacesRawValue,"] given.")),this._validateDecimalPlacesRawValue(s),h.isNull(s.decimalPlacesShownOnFocus)||u.test(String(s.decimalPlacesShownOnFocus))||h.throwError("The number of expanded decimal places option 'decimalPlacesShownOnFocus' is invalid ; it should be a positive integer or `null`, [".concat(s.decimalPlacesShownOnFocus,"] given.")),!h.isNull(s.decimalPlacesShownOnFocus)&&Number(s.decimalPlaces)>Number(s.decimalPlacesShownOnFocus)&&h.warning("The extended decimal places 'decimalPlacesShownOnFocus' [".concat(s.decimalPlacesShownOnFocus,"] should be greater than the 'decimalPlaces' [").concat(s.decimalPlaces,"] value. Currently, this will limit the ability of your user to manually change some of the decimal places. Do you really want to do that?"),s.showWarnings),(h.isNull(s.divisorWhenUnfocused)||g.test(s.divisorWhenUnfocused))&&0!==s.divisorWhenUnfocused&&"0"!==s.divisorWhenUnfocused&&1!==s.divisorWhenUnfocused&&"1"!==s.divisorWhenUnfocused||h.throwError("The divisor option 'divisorWhenUnfocused' is invalid ; it should be a positive number higher than one, preferably an integer, [".concat(s.divisorWhenUnfocused,"] given.")),h.isNull(s.decimalPlacesShownOnBlur)||u.test(s.decimalPlacesShownOnBlur)||h.throwError("The number of decimals shown when unfocused option 'decimalPlacesShownOnBlur' is invalid ; it should be a positive integer or `null`, [".concat(s.decimalPlacesShownOnBlur,"] given.")),h.isNull(s.symbolWhenUnfocused)||h.isString(s.symbolWhenUnfocused)||h.throwError("The symbol to show when unfocused option 'symbolWhenUnfocused' is invalid ; it should be a string, [".concat(s.symbolWhenUnfocused,"] given.")),h.isTrueOrFalseString(s.saveValueToSessionStorage)||h.isBoolean(s.saveValueToSessionStorage)||h.throwError("The save to session storage option 'saveValueToSessionStorage' is invalid ; it should be either 'true' or 'false', [".concat(s.saveValueToSessionStorage,"] given.")),h.isInArray(s.onInvalidPaste,[e.options.onInvalidPaste.error,e.options.onInvalidPaste.ignore,e.options.onInvalidPaste.clamp,e.options.onInvalidPaste.truncate,e.options.onInvalidPaste.replace])||h.throwError("The paste behavior option 'onInvalidPaste' is invalid ; it should either be 'error', 'ignore', 'clamp', 'truncate' or 'replace' (cf. documentation), [".concat(s.onInvalidPaste,"] given.")),h.isInArray(s.roundingMethod,[e.options.roundingMethod.halfUpSymmetric,e.options.roundingMethod.halfUpAsymmetric,e.options.roundingMethod.halfDownSymmetric,e.options.roundingMethod.halfDownAsymmetric,e.options.roundingMethod.halfEvenBankersRounding,e.options.roundingMethod.upRoundAwayFromZero,e.options.roundingMethod.downRoundTowardZero,e.options.roundingMethod.toCeilingTowardPositiveInfinity,e.options.roundingMethod.toFloorTowardNegativeInfinity,e.options.roundingMethod.toNearest05,e.options.roundingMethod.toNearest05Alt,e.options.roundingMethod.upToNext05,e.options.roundingMethod.downToNext05])||h.throwError("The rounding method option 'roundingMethod' is invalid ; it should either be 'S', 'A', 's', 'a', 'B', 'U', 'D', 'C', 'F', 'N05', 'CHF', 'U05' or 'D05' (cf. documentation), [".concat(s.roundingMethod,"] given.")),h.isNull(s.negativeBracketsTypeOnBlur)||h.isInArray(s.negativeBracketsTypeOnBlur,[e.options.negativeBracketsTypeOnBlur.parentheses,e.options.negativeBracketsTypeOnBlur.brackets,e.options.negativeBracketsTypeOnBlur.chevrons,e.options.negativeBracketsTypeOnBlur.curlyBraces,e.options.negativeBracketsTypeOnBlur.angleBrackets,e.options.negativeBracketsTypeOnBlur.japaneseQuotationMarks,e.options.negativeBracketsTypeOnBlur.halfBrackets,e.options.negativeBracketsTypeOnBlur.whiteSquareBrackets,e.options.negativeBracketsTypeOnBlur.quotationMarks,e.options.negativeBracketsTypeOnBlur.guillemets])||h.throwError("The brackets for negative values option 'negativeBracketsTypeOnBlur' is invalid ; it should either be '(,)', '[,]', '<,>', '{,}', '〈,〉', '｢,｣', '⸤,⸥', '⟦,⟧', '‹,›' or '«,»', [".concat(s.negativeBracketsTypeOnBlur,"] given.")),(h.isString(s.emptyInputBehavior)||h.isNumber(s.emptyInputBehavior))&&(h.isInArray(s.emptyInputBehavior,[e.options.emptyInputBehavior.focus,e.options.emptyInputBehavior.press,e.options.emptyInputBehavior.always,e.options.emptyInputBehavior.min,e.options.emptyInputBehavior.max,e.options.emptyInputBehavior.zero,e.options.emptyInputBehavior.null])||m.test(s.emptyInputBehavior))||h.throwError("The display on empty string option 'emptyInputBehavior' is invalid ; it should either be 'focus', 'press', 'always', 'min', 'max', 'zero', 'null', a number, or a string that represents a number, [".concat(s.emptyInputBehavior,"] given.")),s.emptyInputBehavior===e.options.emptyInputBehavior.zero&&(0<s.minimumValue||s.maximumValue<0)&&h.throwError("The 'emptyInputBehavior' option is set to 'zero', but this value is outside of the range defined by 'minimumValue' and 'maximumValue' [".concat(s.minimumValue,", ").concat(s.maximumValue,"].")),m.test(String(s.emptyInputBehavior))&&(this._isWithinRangeWithOverrideOption(s.emptyInputBehavior,s)||h.throwError("The 'emptyInputBehavior' option is set to a number or a string that represents a number, but its value [".concat(s.emptyInputBehavior,"] is outside of the range defined by the 'minimumValue' and 'maximumValue' options [").concat(s.minimumValue,", ").concat(s.maximumValue,"]."))),h.isTrueOrFalseString(s.eventBubbles)||h.isBoolean(s.eventBubbles)||h.throwError("The event bubbles option 'eventBubbles' is invalid ; it should be either 'true' or 'false', [".concat(s.eventBubbles,"] given.")),h.isTrueOrFalseString(s.eventIsCancelable)||h.isBoolean(s.eventIsCancelable)||h.throwError("The event is cancelable option 'eventIsCancelable' is invalid ; it should be either 'true' or 'false', [".concat(s.eventIsCancelable,"] given.")),!h.isBoolean(s.invalidClass)&&/^-?[_a-zA-Z]+[_a-zA-Z0-9-]*$/.test(s.invalidClass)||h.throwError("The name of the 'invalidClass' option is not a valid CSS class name ; it should not be empty, and should follow the '^-?[_a-zA-Z]+[_a-zA-Z0-9-]*$' regex, [".concat(s.invalidClass,"] given.")),h.isInArray(s.leadingZero,[e.options.leadingZero.allow,e.options.leadingZero.deny,e.options.leadingZero.keep])||h.throwError("The leading zero behavior option 'leadingZero' is invalid ; it should either be 'allow', 'deny' or 'keep', [".concat(s.leadingZero,"] given.")),h.isTrueOrFalseString(s.formatOnPageLoad)||h.isBoolean(s.formatOnPageLoad)||h.throwError("The format on initialization option 'formatOnPageLoad' is invalid ; it should be either 'true' or 'false', [".concat(s.formatOnPageLoad,"] given.")),h.isTrueOrFalseString(s.formulaMode)||h.isBoolean(s.formulaMode)||h.throwError("The formula mode option 'formulaMode' is invalid ; it should be either 'true' or 'false', [".concat(s.formulaMode,"] given.")),u.test(s.historySize)&&0!==s.historySize||h.throwError("The history size option 'historySize' is invalid ; it should be a positive integer, [".concat(s.historySize,"] given.")),h.isTrueOrFalseString(s.selectNumberOnly)||h.isBoolean(s.selectNumberOnly)||h.throwError("The select number only option 'selectNumberOnly' is invalid ; it should be either 'true' or 'false', [".concat(s.selectNumberOnly,"] given.")),h.isTrueOrFalseString(s.selectOnFocus)||h.isBoolean(s.selectOnFocus)||h.throwError("The select on focus option 'selectOnFocus' is invalid ; it should be either 'true' or 'false', [".concat(s.selectOnFocus,"] given.")),h.isNull(s.defaultValueOverride)||""===s.defaultValueOverride||m.test(s.defaultValueOverride)||h.throwError("The unformatted default value option 'defaultValueOverride' is invalid ; it should be a string that represents a positive or negative number, [".concat(s.defaultValueOverride,"] given.")),h.isTrueOrFalseString(s.unformatOnSubmit)||h.isBoolean(s.unformatOnSubmit)||h.throwError("The remove formatting on submit option 'unformatOnSubmit' is invalid ; it should be either 'true' or 'false', [".concat(s.unformatOnSubmit,"] given.")),h.isNull(s.valuesToStrings)||h.isObject(s.valuesToStrings)||h.throwError("The option 'valuesToStrings' is invalid ; it should be an object, ideally with 'key -> value' entries, [".concat(s.valuesToStrings,"] given.")),h.isNull(s.outputFormat)||h.isInArray(s.outputFormat,[e.options.outputFormat.string,e.options.outputFormat.number,e.options.outputFormat.dot,e.options.outputFormat.negativeDot,e.options.outputFormat.comma,e.options.outputFormat.negativeComma,e.options.outputFormat.dotNegative,e.options.outputFormat.commaNegative])||h.throwError("The custom locale format option 'outputFormat' is invalid ; it should either be null, 'string', 'number', '.', '-.', ',', '-,', '.-' or ',-', [".concat(s.outputFormat,"] given.")),h.isTrueOrFalseString(s.isCancellable)||h.isBoolean(s.isCancellable)||h.throwError("The cancellable behavior option 'isCancellable' is invalid ; it should be either 'true' or 'false', [".concat(s.isCancellable,"] given.")),h.isTrueOrFalseString(s.modifyValueOnWheel)||h.isBoolean(s.modifyValueOnWheel)||h.throwError("The increment/decrement on mouse wheel option 'modifyValueOnWheel' is invalid ; it should be either 'true' or 'false', [".concat(s.modifyValueOnWheel,"] given.")),h.isTrueOrFalseString(s.watchExternalChanges)||h.isBoolean(s.watchExternalChanges)||h.throwError("The option 'watchExternalChanges' is invalid ; it should be either 'true' or 'false', [".concat(s.watchExternalChanges,"] given.")),h.isInArray(s.wheelOn,[e.options.wheelOn.focus,e.options.wheelOn.hover])||h.throwError("The wheel behavior option 'wheelOn' is invalid ; it should either be 'focus' or 'hover', [".concat(s.wheelOn,"] given.")),(h.isString(s.wheelStep)||h.isNumber(s.wheelStep))&&("progressive"===s.wheelStep||g.test(s.wheelStep))&&0!==Number(s.wheelStep)||h.throwError("The wheel step value option 'wheelStep' is invalid ; it should either be the string 'progressive', or a number or a string that represents a positive number (excluding zero), [".concat(s.wheelStep,"] given.")),h.isInArray(s.serializeSpaces,[e.options.serializeSpaces.plus,e.options.serializeSpaces.percent])||h.throwError("The space replacement character option 'serializeSpaces' is invalid ; it should either be '+' or '%20', [".concat(s.serializeSpaces,"] given.")),h.isTrueOrFalseString(s.noEventListeners)||h.isBoolean(s.noEventListeners)||h.throwError("The option 'noEventListeners' that prevent the creation of event listeners is invalid ; it should be either 'true' or 'false', [".concat(s.noEventListeners,"] given.")),h.isNull(s.styleRules)||h.isObject(s.styleRules)&&(Object.prototype.hasOwnProperty.call(s.styleRules,"positive")||Object.prototype.hasOwnProperty.call(s.styleRules,"negative")||Object.prototype.hasOwnProperty.call(s.styleRules,"ranges")||Object.prototype.hasOwnProperty.call(s.styleRules,"userDefined"))||h.throwError("The option 'styleRules' is invalid ; it should be a correctly structured object, with one or more 'positive', 'negative', 'ranges' or 'userDefined' attributes, [".concat(s.styleRules,"] given.")),h.isNull(s.styleRules)||!Object.prototype.hasOwnProperty.call(s.styleRules,"userDefined")||h.isNull(s.styleRules.userDefined)||s.styleRules.userDefined.forEach((function(e){Object.prototype.hasOwnProperty.call(e,"callback")&&!h.isFunction(e.callback)&&h.throwError("The callback defined in the `userDefined` attribute is not a function, ".concat(P(e.callback)," given."))})),(h.isNull(s.rawValueDivisor)||g.test(s.rawValueDivisor))&&0!==s.rawValueDivisor&&"0"!==s.rawValueDivisor&&1!==s.rawValueDivisor&&"1"!==s.rawValueDivisor||h.throwError("The raw value divisor option 'rawValueDivisor' is invalid ; it should be a positive number higher than one, preferably an integer, [".concat(s.rawValueDivisor,"] given.")),h.isTrueOrFalseString(s.readOnly)||h.isBoolean(s.readOnly)||h.throwError("The option 'readOnly' is invalid ; it should be either 'true' or 'false', [".concat(s.readOnly,"] given.")),h.isTrueOrFalseString(s.unformatOnHover)||h.isBoolean(s.unformatOnHover)||h.throwError("The option 'unformatOnHover' is invalid ; it should be either 'true' or 'false', [".concat(s.unformatOnHover,"] given.")),h.isTrueOrFalseString(s.failOnUnknownOption)||h.isBoolean(s.failOnUnknownOption)||h.throwError("The debug option 'failOnUnknownOption' is invalid ; it should be either 'true' or 'false', [".concat(s.failOnUnknownOption,"] given.")),h.isTrueOrFalseString(s.createLocalList)||h.isBoolean(s.createLocalList)||h.throwError("The debug option 'createLocalList' is invalid ; it should be either 'true' or 'false', [".concat(s.createLocalList,"] given."))}},{key:"_validateDecimalPlacesRawValue",value:function(e){h.isNull(e.decimalPlacesRawValue)||(e.decimalPlacesRawValue<e.decimalPlaces&&h.warning("The number of decimal places to store in the raw value [".concat(e.decimalPlacesRawValue,"] is lower than the ones to display [").concat(e.decimalPlaces,"]. This will likely confuse your users.\nTo solve that, you'd need to either set `decimalPlacesRawValue` to `null`, or set a number of decimal places for the raw value equal of bigger than `decimalPlaces`."),e.showWarnings),e.decimalPlacesRawValue<e.decimalPlacesShownOnFocus&&h.warning("The number of decimal places to store in the raw value [".concat(e.decimalPlacesRawValue,"] is lower than the ones shown on focus [").concat(e.decimalPlacesShownOnFocus,"]. This will likely confuse your users.\nTo solve that, you'd need to either set `decimalPlacesRawValue` to `null`, or set a number of decimal places for the raw value equal of bigger than `decimalPlacesShownOnFocus`."),e.showWarnings),e.decimalPlacesRawValue<e.decimalPlacesShownOnBlur&&h.warning("The number of decimal places to store in the raw value [".concat(e.decimalPlacesRawValue,"] is lower than the ones shown when unfocused [").concat(e.decimalPlacesShownOnBlur,"]. This will likely confuse your users.\nTo solve that, you'd need to either set `decimalPlacesRawValue` to `null`, or set a number of decimal places for the raw value equal of bigger than `decimalPlacesShownOnBlur`."),e.showWarnings))}},{key:"areSettingsValid",value:function(e){var t=!0;try{this.validate(e,!0)}catch(e){t=!1}return t}},{key:"getDefaultConfig",value:function(){return e.defaultSettings}},{key:"getPredefinedOptions",value:function(){return e.predefinedOptions}},{key:"_generateOptionsObjectFromOptionsArray",value:function(e){var t,i=this;return h.isUndefinedOrNullOrEmpty(e)||0===e.length?t=null:(t={},1===e.length&&Array.isArray(e[0])?e[0].forEach((function(e){w(t,i._getOptionObject(e))})):1<=e.length&&e.forEach((function(e){w(t,i._getOptionObject(e))}))),t}},{key:"format",value:function(t){if(h.isUndefined(t)||null===t)return null;var i;i=h.isElement(t)?h.getElementValue(t):t,h.isString(i)||h.isNumber(i)||h.throwError('The value "'.concat(i,'" being "set" is not numeric and therefore cannot be used appropriately.'));for(var n=arguments.length,a=new Array(1<n?n-1:0),r=1;r<n;r++)a[r-1]=arguments[r];var s=this._generateOptionsObjectFromOptionsArray(a),o=w({},this.getDefaultConfig(),s);o.isNegativeSignAllowed=i<0,o.isPositiveSignAllowed=0<=i,this._setBrackets(o),this._cachesUsualRegularExpressions(o,{});var l=this._toNumericValue(i,o);return isNaN(Number(l))&&h.throwError("The value [".concat(l,"] that you are trying to format is not a recognized number.")),this._isWithinRangeWithOverrideOption(l,o)||(h.triggerEvent(e.events.formatted,document,{oldValue:null,newValue:null,oldRawValue:null,newRawValue:null,isPristine:null,error:"Range test failed",aNElement:null},!0,!0),h.throwError("The value [".concat(l,"] being set falls outside of the minimumValue [").concat(o.minimumValue,"] and maximumValue [").concat(o.maximumValue,"] range set for this element"))),o.valuesToStrings&&this._checkValuesToStringsSettings(i,o)?o.valuesToStrings[i]:(this._correctNegativePositiveSignPlacementOption(o),this._calculateDecimalPlacesOnInit(o),h.isUndefinedOrNullOrEmpty(o.rawValueDivisor)||0===o.rawValueDivisor||""===l||null===l||(l*=o.rawValueDivisor),l=this._roundFormattedValueShownOnFocus(l,o),l=this._modifyNegativeSignAndDecimalCharacterForFormattedValue(l,o),l=this._addGroupSeparators(l,o,!1,l))}},{key:"formatAndSet",value:function(e,t){var i=1<arguments.length&&void 0!==t?t:null,n=this.format(e,i);return h.setElementValue(e,n),n}},{key:"unformat",value:function(e){if(h.isNumberStrict(e))return e;var t;if(""===(t=h.isElement(e)?h.getElementValue(e):e))return"";if(h.isUndefined(t)||null===t)return null;(h.isArray(t)||h.isObject(t))&&h.throwError("A number or a string representing a number is needed to be able to unformat it, [".concat(t,"] given."));for(var i=arguments.length,n=new Array(1<i?i-1:0),a=1;a<i;a++)n[a-1]=arguments[a];var r=this._generateOptionsObjectFromOptionsArray(n),s=w({},this.getDefaultConfig(),r);if(s.isNegativeSignAllowed=!1,s.isPositiveSignAllowed=!0,t=t.toString(),s.valuesToStrings&&this._checkStringsToValuesSettings(t,s))return h.objectKeyLookup(s.valuesToStrings,t);if(h.isNegative(t,s.negativeSignCharacter))s.isNegativeSignAllowed=!0,s.isPositiveSignAllowed=!1;else if(!h.isNull(s.negativeBracketsTypeOnBlur)){var o=y(s.negativeBracketsTypeOnBlur.split(","),2);s.firstBracket=o[0],s.lastBracket=o[1],t.charAt(0)===s.firstBracket&&t.charAt(t.length-1)===s.lastBracket&&(s.isNegativeSignAllowed=!0,s.isPositiveSignAllowed=!1,t=this._removeBrackets(t,s,!1))}return t=this._convertToNumericString(t,s),new RegExp("[^+-0123456789.]","gi").test(t)?NaN:(this._correctNegativePositiveSignPlacementOption(s),s.decimalPlacesRawValue?s.originalDecimalPlacesRawValue=s.decimalPlacesRawValue:s.originalDecimalPlacesRawValue=s.decimalPlaces,this._calculateDecimalPlacesOnInit(s),h.isUndefinedOrNullOrEmpty(s.rawValueDivisor)||0===s.rawValueDivisor||""===t||null===t||(t/=s.rawValueDivisor),t=(t=this._roundRawValue(t,s)).replace(s.decimalCharacter,"."),t=this._toLocale(t,s.outputFormat,s))}},{key:"unformatAndSet",value:function(e,t){var i=1<arguments.length&&void 0!==t?t:null,n=this.unformat(e,i);return h.setElementValue(e,n),n}},{key:"localize",value:function(t,i){var n,a,r=1<arguments.length&&void 0!==i?i:null;return""===(n=h.isElement(t)?h.getElementValue(t):t)?"":(h.isNull(r)&&(r=e.defaultSettings),n=this.unformat(n,r),0===Number(n)&&r.leadingZero!==e.options.leadingZero.keep&&(n="0"),a=h.isNull(r)?r.outputFormat:e.defaultSettings.outputFormat,this._toLocale(n,a,r))}},{key:"localizeAndSet",value:function(e,t){var i=1<arguments.length&&void 0!==t?t:null,n=this.localize(e,i);return h.setElementValue(e,n),n}},{key:"isManagedByAutoNumeric",value:function(e){return this._isInGlobalList(h.domElement(e))}},{key:"getAutoNumericElement",value:function(e){var t=h.domElement(e);return this.isManagedByAutoNumeric(t)?this._getFromGlobalList(t):null}},{key:"set",value:function(e,t,i,n){var a,r=2<arguments.length&&void 0!==i?i:null,s=!(3<arguments.length&&void 0!==n)||n,o=h.domElement(e);return this.isManagedByAutoNumeric(o)?this.getAutoNumericElement(o).set(t,r,s):(a=!(!h.isNull(r)&&Object.prototype.hasOwnProperty.call(r,"showWarnings"))||r.showWarnings,h.warning("Impossible to find an AutoNumeric object for the given DOM element or selector.",a),null)}},{key:"getNumericString",value:function(e,t){var i=1<arguments.length&&void 0!==t?t:null;return this._get(e,"getNumericString",i)}},{key:"getFormatted",value:function(e,t){var i=1<arguments.length&&void 0!==t?t:null;return this._get(e,"getFormatted",i)}},{key:"getNumber",value:function(e,t){var i=1<arguments.length&&void 0!==t?t:null;return this._get(e,"getNumber",i)}},{key:"_get",value:function(e,t,i){var n=2<arguments.length&&void 0!==i?i:null,a=h.domElement(e);return this.isManagedByAutoNumeric(a)||h.throwError("Impossible to find an AutoNumeric object for the given DOM element or selector."),this.getAutoNumericElement(a)[t](n)}},{key:"getLocalized",value:function(e,t,i){var n=1<arguments.length&&void 0!==t?t:null,a=2<arguments.length&&void 0!==i?i:null,r=h.domElement(e);return this.isManagedByAutoNumeric(r)||h.throwError("Impossible to find an AutoNumeric object for the given DOM element or selector."),this.getAutoNumericElement(r).getLocalized(n,a)}},{key:"_stripAllNonNumberCharacters",value:function(e,t,i,n){return this._stripAllNonNumberCharactersExceptCustomDecimalChar(e,t,i,n).replace(t.decimalCharacter,".")}},{key:"_stripAllNonNumberCharactersExceptCustomDecimalChar",value:function(t,i,n,a){var r=(t=(t=this._normalizeCurrencySuffixAndNegativeSignCharacters(t,i)).replace(i.allowedAutoStrip,"")).match(i.numRegAutoStrip);if(t=r?[r[1],r[2],r[3]].join(""):"",i.leadingZero===e.options.leadingZero.allow||i.leadingZero===e.options.leadingZero.keep){var s="",o=y(t.split(i.decimalCharacter),2),l=o[0],u=o[1],c=l;h.contains(c,i.negativeSignCharacter)&&(s=i.negativeSignCharacter,c=c.replace(i.negativeSignCharacter,"")),""===s&&c.length>i.mIntPos&&"0"===c.charAt(0)&&(c=c.slice(1)),""!==s&&c.length>i.mIntNeg&&"0"===c.charAt(0)&&(c=c.slice(1)),t="".concat(s).concat(c).concat(h.isUndefined(u)?"":i.decimalCharacter+u)}return(n&&i.leadingZero===e.options.leadingZero.deny||!a&&i.leadingZero===e.options.leadingZero.allow)&&(t=t.replace(i.stripReg,"$1$2")),t}},{key:"_toggleNegativeBracket",value:function(e,t,i){return i?this._removeBrackets(e,t):this._addBrackets(e,t)}},{key:"_addBrackets",value:function(e,t){return h.isNull(t.negativeBracketsTypeOnBlur)?e:"".concat(t.firstBracket).concat(e.replace(t.negativeSignCharacter,"")).concat(t.lastBracket)}},{key:"_removeBrackets",value:function(e,t,i){var n,a=!(2<arguments.length&&void 0!==i)||i;return h.isNull(t.negativeBracketsTypeOnBlur)||e.charAt(0)!==t.firstBracket?e:(n=(n=e.replace(t.firstBracket,"")).replace(t.lastBracket,""),a?(n=n.replace(t.currencySymbol,""),this._mergeCurrencySignNegativePositiveSignAndValue(n,t,!0,!1)):"".concat(t.negativeSignCharacter).concat(n))}},{key:"_setBrackets",value:function(e){if(h.isNull(e.negativeBracketsTypeOnBlur))e.firstBracket="",e.lastBracket="";else{var t=y(e.negativeBracketsTypeOnBlur.split(","),2),i=t[0],n=t[1];e.firstBracket=i,e.lastBracket=n}}},{key:"_convertToNumericString",value:function(t,i){t=this._removeBrackets(t,i,!1),t=(t=this._normalizeCurrencySuffixAndNegativeSignCharacters(t,i)).replace(new RegExp("[".concat(i.digitGroupSeparator,"]"),"g"),""),"."!==i.decimalCharacter&&(t=t.replace(i.decimalCharacter,".")),h.isNegative(t)&&t.lastIndexOf("-")===t.length-1&&(t=t.replace("-",""),t="-".concat(t)),i.showPositiveSign&&(t=t.replace(i.positiveSignCharacter,""));var n=i.leadingZero!==e.options.leadingZero.keep,a=h.arabicToLatinNumbers(t,n,!1,!1);return isNaN(a)||(t=a.toString()),t}},{key:"_normalizeCurrencySuffixAndNegativeSignCharacters",value:function(t,i){return t=String(t),i.currencySymbol!==e.options.currencySymbol.none&&(t=t.replace(i.currencySymbol,"")),i.suffixText!==e.options.suffixText.none&&(t=t.replace(i.suffixText,"")),i.negativeSignCharacter!==e.options.negativeSignCharacter.hyphen&&(t=t.replace(i.negativeSignCharacter,"-")),t}},{key:"_toLocale",value:function(t,i,n){if(h.isNull(i)||i===e.options.outputFormat.string)return t;var a;switch(i){case e.options.outputFormat.number:a=Number(t);break;case e.options.outputFormat.dotNegative:a=h.isNegative(t)?t.replace("-","")+"-":t;break;case e.options.outputFormat.comma:case e.options.outputFormat.negativeComma:a=t.replace(".",",");break;case e.options.outputFormat.commaNegative:a=t.replace(".",","),a=h.isNegative(a)?a.replace("-","")+"-":a;break;case e.options.outputFormat.dot:case e.options.outputFormat.negativeDot:a=t;break;default:h.throwError("The given outputFormat [".concat(i,"] option is not recognized."))}return i!==e.options.outputFormat.number&&"-"!==n.negativeSignCharacter&&(a=a.replace("-",n.negativeSignCharacter)),a}},{key:"_modifyNegativeSignAndDecimalCharacterForFormattedValue",value:function(e,t){return"-"!==t.negativeSignCharacter&&(e=e.replace("-",t.negativeSignCharacter)),"."!==t.decimalCharacter&&(e=e.replace(".",t.decimalCharacter)),e}},{key:"_isElementValueEmptyOrOnlyTheNegativeSign",value:function(e,t){return""===e||e===t.negativeSignCharacter}},{key:"_orderValueCurrencySymbolAndSuffixText",value:function(t,i,n){var a;if(i.emptyInputBehavior===e.options.emptyInputBehavior.always||n)switch(i.negativePositiveSignPlacement){case e.options.negativePositiveSignPlacement.left:case e.options.negativePositiveSignPlacement.prefix:case e.options.negativePositiveSignPlacement.none:a=t+i.currencySymbol+i.suffixText;break;default:a=i.currencySymbol+t+i.suffixText}else a=t;return a}},{key:"_addGroupSeparators",value:function(t,i,n,a,r){var s,o=4<arguments.length&&void 0!==r?r:null;if(s=h.isNull(o)?h.isNegative(t,i.negativeSignCharacter)||h.isNegativeWithBrackets(t,i.firstBracket,i.lastBracket):o<0,t=this._stripAllNonNumberCharactersExceptCustomDecimalChar(t,i,!1,n),this._isElementValueEmptyOrOnlyTheNegativeSign(t,i))return this._orderValueCurrencySymbolAndSuffixText(t,i,!0);var l,u=h.isZeroOrHasNoValue(t);switch(s&&(t=t.replace("-","")),i.digitalGroupSpacing=i.digitalGroupSpacing.toString(),i.digitalGroupSpacing){case e.options.digitalGroupSpacing.two:l=/(\d)((\d)(\d{2}?)+)$/;break;case e.options.digitalGroupSpacing.twoScaled:l=/(\d)((?:\d{2}){0,2}\d{3}(?:(?:\d{2}){2}\d{3})*?)$/;break;case e.options.digitalGroupSpacing.four:l=/(\d)((\d{4}?)+)$/;break;case e.options.digitalGroupSpacing.three:default:l=/(\d)((\d{3}?)+)$/}var c,m=y(t.split(i.decimalCharacter),2),g=m[0],d=m[1];if(i.decimalCharacterAlternative&&h.isUndefined(d)){var v=y(t.split(i.decimalCharacterAlternative),2);g=v[0],d=v[1]}if(""!==i.digitGroupSeparator)for(;l.test(g);)g=g.replace(l,"$1".concat(i.digitGroupSeparator,"$2"));return t=0===(c=n?i.decimalPlacesShownOnFocus:i.decimalPlacesShownOnBlur)||h.isUndefined(d)?g:(d.length>c&&(d=d.substring(0,c)),"".concat(g).concat(i.decimalCharacter).concat(d)),t=e._mergeCurrencySignNegativePositiveSignAndValue(t,i,s,u),h.isNull(o)&&(o=a),null!==i.negativeBracketsTypeOnBlur&&(o<0||h.isNegativeStrict(t,i.negativeSignCharacter))&&(t=this._toggleNegativeBracket(t,i,n)),i.suffixText?"".concat(t).concat(i.suffixText):t}},{key:"_mergeCurrencySignNegativePositiveSignAndValue",value:function(t,i,n,a){var r,s="";if(n?s=i.negativeSignCharacter:i.showPositiveSign&&!a&&(s=i.positiveSignCharacter),i.currencySymbolPlacement===e.options.currencySymbolPlacement.prefix)if(i.negativePositiveSignPlacement!==e.options.negativePositiveSignPlacement.none&&(n||!n&&i.showPositiveSign&&!a))switch(i.negativePositiveSignPlacement){case e.options.negativePositiveSignPlacement.prefix:case e.options.negativePositiveSignPlacement.left:r="".concat(s).concat(i.currencySymbol).concat(t);break;case e.options.negativePositiveSignPlacement.right:r="".concat(i.currencySymbol).concat(s).concat(t);break;case e.options.negativePositiveSignPlacement.suffix:r="".concat(i.currencySymbol).concat(t).concat(s)}else r=i.currencySymbol+t;else if(i.currencySymbolPlacement===e.options.currencySymbolPlacement.suffix)if(i.negativePositiveSignPlacement!==e.options.negativePositiveSignPlacement.none&&(n||!n&&i.showPositiveSign&&!a))switch(i.negativePositiveSignPlacement){case e.options.negativePositiveSignPlacement.suffix:case e.options.negativePositiveSignPlacement.right:r="".concat(t).concat(i.currencySymbol).concat(s);break;case e.options.negativePositiveSignPlacement.left:r="".concat(t).concat(s).concat(i.currencySymbol);break;case e.options.negativePositiveSignPlacement.prefix:r="".concat(s).concat(t).concat(i.currencySymbol)}else r=t+i.currencySymbol;return r}},{key:"_truncateZeros",value:function(e,t){var i;switch(t){case 0:i=/(\.(?:\d*[1-9])?)0*$/;break;case 1:i=/(\.\d(?:\d*[1-9])?)0*$/;break;default:i=new RegExp("(\\.\\d{".concat(t,"}(?:\\d*[1-9])?)0*"))}return e=e.replace(i,"$1"),0===t&&(e=e.replace(/\.$/,"")),e}},{key:"_roundRawValue",value:function(e,t){return this._roundValue(e,t,t.decimalPlacesRawValue)}},{key:"_roundFormattedValueShownOnFocus",value:function(e,t){return this._roundValue(e,t,Number(t.decimalPlacesShownOnFocus))}},{key:"_roundFormattedValueShownOnBlur",value:function(e,t){return this._roundValue(e,t,Number(t.decimalPlacesShownOnBlur))}},{key:"_roundFormattedValueShownOnFocusOrBlur",value:function(e,t,i){return i?this._roundFormattedValueShownOnFocus(e,t):this._roundFormattedValueShownOnBlur(e,t)}},{key:"_roundValue",value:function(t,i,n){if(h.isNull(t))return t;if(t=""===t?"0":t.toString(),i.roundingMethod===e.options.roundingMethod.toNearest05||i.roundingMethod===e.options.roundingMethod.toNearest05Alt||i.roundingMethod===e.options.roundingMethod.upToNext05||i.roundingMethod===e.options.roundingMethod.downToNext05)return this._roundCloseTo05(t,i);var a,r=y(e._prepareValueForRounding(t,i),2),s=r[0],o=(t=r[1]).lastIndexOf("."),l=-1===o,u=y(t.split("."),2),c=u[0];if(!(0<u[1]||i.allowDecimalPadding!==e.options.allowDecimalPadding.never&&i.allowDecimalPadding!==e.options.allowDecimalPadding.floats))return 0===Number(t)?c:"".concat(s).concat(c);a=i.allowDecimalPadding===e.options.allowDecimalPadding.always||i.allowDecimalPadding===e.options.allowDecimalPadding.floats?n:0;var m,g=l?t.length-1:o,d=t.length-1-g,v="";if(d<=n){if(v=t,d<a){l&&(v="".concat(v).concat(i.decimalCharacter));for(var p="000000";d<a;)v+=p=p.substring(0,a-d),d+=p.length}else a<d?v=this._truncateZeros(v,a):0===d&&0===a&&(v=v.replace(/\.$/,""));return 0===Number(v)?v:"".concat(s).concat(v)}m=l?n-1:Number(n)+Number(o);var f,S=Number(t.charAt(m+1)),b=t.substring(0,m+1).split("");if(f="."===t.charAt(m)?t.charAt(m-1)%2:t.charAt(m)%2,this._shouldRoundUp(S,i,s,f))for(var w=b.length-1;0<=w;--w)if("."!==b[w]){if(b[w]=+b[w]+1,b[w]<10)break;0<w&&(b[w]="0")}return b=b.slice(0,m+1),v=this._truncateZeros(b.join(""),a),0===Number(v)?v:"".concat(s).concat(v)}},{key:"_roundCloseTo05",value:function(t,i){switch(i.roundingMethod){case e.options.roundingMethod.toNearest05:case e.options.roundingMethod.toNearest05Alt:t=(Math.round(20*t)/20).toString();break;case e.options.roundingMethod.upToNext05:t=(Math.ceil(20*t)/20).toString();break;default:t=(Math.floor(20*t)/20).toString()}return h.contains(t,".")?t.length-t.indexOf(".")<3?t+"0":t:t+".00"}},{key:"_prepareValueForRounding",value:function(t,i){var n="";return h.isNegativeStrict(t,"-")&&(n="-",t=t.replace("-","")),t.match(/^\d/)||(t="0".concat(t)),0===Number(t)&&(n=""),(0<Number(t)&&i.leadingZero!==e.options.leadingZero.keep||0<t.length&&i.leadingZero===e.options.leadingZero.allow)&&(t=t.replace(/^0*(\d)/,"$1")),[n,t]}},{key:"_shouldRoundUp",value:function(t,i,n,a){return 4<t&&i.roundingMethod===e.options.roundingMethod.halfUpSymmetric||4<t&&i.roundingMethod===e.options.roundingMethod.halfUpAsymmetric&&""===n||5<t&&i.roundingMethod===e.options.roundingMethod.halfUpAsymmetric&&"-"===n||5<t&&i.roundingMethod===e.options.roundingMethod.halfDownSymmetric||5<t&&i.roundingMethod===e.options.roundingMethod.halfDownAsymmetric&&""===n||4<t&&i.roundingMethod===e.options.roundingMethod.halfDownAsymmetric&&"-"===n||5<t&&i.roundingMethod===e.options.roundingMethod.halfEvenBankersRounding||5===t&&i.roundingMethod===e.options.roundingMethod.halfEvenBankersRounding&&1===a||0<t&&i.roundingMethod===e.options.roundingMethod.toCeilingTowardPositiveInfinity&&""===n||0<t&&i.roundingMethod===e.options.roundingMethod.toFloorTowardNegativeInfinity&&"-"===n||0<t&&i.roundingMethod===e.options.roundingMethod.upRoundAwayFromZero}},{key:"_truncateDecimalPlaces",value:function(e,t,i,n){i&&(e=this._roundFormattedValueShownOnFocus(e,t));var a=y(e.split(t.decimalCharacter),2),r=a[0],s=a[1];if(s&&s.length>n)if(0<n){var o=s.substring(0,n);e="".concat(r).concat(t.decimalCharacter).concat(o)}else e=r;return e}},{key:"_checkIfInRangeWithOverrideOption",value:function(t,i){if(h.isNull(t)&&i.emptyInputBehavior===e.options.emptyInputBehavior.null||i.overrideMinMaxLimits===e.options.overrideMinMaxLimits.ignore||i.overrideMinMaxLimits===e.options.overrideMinMaxLimits.invalid)return[!0,!0];t=(t=t.toString()).replace(",",".");var n,a=h.parseStr(i.minimumValue),r=h.parseStr(i.maximumValue),s=h.parseStr(t);switch(i.overrideMinMaxLimits){case e.options.overrideMinMaxLimits.floor:n=[-1<h.testMinMax(a,s),!0];break;case e.options.overrideMinMaxLimits.ceiling:n=[!0,h.testMinMax(r,s)<1];break;default:n=[-1<h.testMinMax(a,s),h.testMinMax(r,s)<1]}return n}},{key:"_isWithinRangeWithOverrideOption",value:function(e,t){var i=y(this._checkIfInRangeWithOverrideOption(e,t),2),n=i[0],a=i[1];return n&&a}},{key:"_cleanValueForRangeParse",value:function(e){return e=e.toString().replace(",","."),h.parseStr(e)}},{key:"_isMinimumRangeRespected",value:function(e,t){return-1<h.testMinMax(h.parseStr(t.minimumValue),this._cleanValueForRangeParse(e))}},{key:"_isMaximumRangeRespected",value:function(e,t){return h.testMinMax(h.parseStr(t.maximumValue),this._cleanValueForRangeParse(e))<1}},{key:"_readCookie",value:function(e){for(var t=e+"=",i=document.cookie.split(";"),n="",a=0;a<i.length;a+=1){for(n=i[a];" "===n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(t))return n.substring(t.length,n.length)}return null}},{key:"_storageTest",value:function(){var e="modernizr";try{return sessionStorage.setItem(e,e),sessionStorage.removeItem(e),!0}catch(e){return!1}}},{key:"_correctNegativePositiveSignPlacementOption",value:function(t){if(h.isNull(t.negativePositiveSignPlacement))if(h.isUndefined(t)||!h.isUndefinedOrNullOrEmpty(t.negativePositiveSignPlacement)||h.isUndefinedOrNullOrEmpty(t.currencySymbol))t.negativePositiveSignPlacement=e.options.negativePositiveSignPlacement.left;else switch(t.currencySymbolPlacement){case e.options.currencySymbolPlacement.suffix:t.negativePositiveSignPlacement=e.options.negativePositiveSignPlacement.prefix;break;case e.options.currencySymbolPlacement.prefix:t.negativePositiveSignPlacement=e.options.negativePositiveSignPlacement.left}}},{key:"_correctCaretPositionOnFocusAndSelectOnFocusOptions",value:function(t){return h.isNull(t)?null:(!h.isUndefinedOrNullOrEmpty(t.caretPositionOnFocus)&&h.isUndefinedOrNullOrEmpty(t.selectOnFocus)&&(t.selectOnFocus=e.options.selectOnFocus.doNotSelect),h.isUndefinedOrNullOrEmpty(t.caretPositionOnFocus)&&!h.isUndefinedOrNullOrEmpty(t.selectOnFocus)&&t.selectOnFocus===e.options.selectOnFocus.select&&(t.caretPositionOnFocus=e.options.caretPositionOnFocus.doNoForceCaretPosition),t)}},{key:"_calculateDecimalPlacesOnInit",value:function(t){this._validateDecimalPlacesRawValue(t),t.decimalPlacesShownOnFocus===e.options.decimalPlacesShownOnFocus.useDefault&&(t.decimalPlacesShownOnFocus=t.decimalPlaces),t.decimalPlacesShownOnBlur===e.options.decimalPlacesShownOnBlur.useDefault&&(t.decimalPlacesShownOnBlur=t.decimalPlaces),t.decimalPlacesRawValue===e.options.decimalPlacesRawValue.useDefault&&(t.decimalPlacesRawValue=t.decimalPlaces);var i=0;t.rawValueDivisor&&t.rawValueDivisor!==e.options.rawValueDivisor.none&&(i=String(t.rawValueDivisor).length-1)<0&&(i=0),t.decimalPlacesRawValue=Math.max(Math.max(t.decimalPlacesShownOnBlur,t.decimalPlacesShownOnFocus)+i,Number(t.originalDecimalPlacesRawValue)+i)}},{key:"_calculateDecimalPlacesOnUpdate",value:function(t,i){var n=1<arguments.length&&void 0!==i?i:null;this._validateDecimalPlacesRawValue(t),h.isNull(n)&&h.throwError("When updating the settings, the previous ones should be passed as an argument.");var a="decimalPlaces"in t;if(a||"decimalPlacesRawValue"in t||"decimalPlacesShownOnFocus"in t||"decimalPlacesShownOnBlur"in t||"rawValueDivisor"in t){a?("decimalPlacesShownOnFocus"in t&&t.decimalPlacesShownOnFocus!==e.options.decimalPlacesShownOnFocus.useDefault||(t.decimalPlacesShownOnFocus=t.decimalPlaces),"decimalPlacesShownOnBlur"in t&&t.decimalPlacesShownOnBlur!==e.options.decimalPlacesShownOnBlur.useDefault||(t.decimalPlacesShownOnBlur=t.decimalPlaces),"decimalPlacesRawValue"in t&&t.decimalPlacesRawValue!==e.options.decimalPlacesRawValue.useDefault||(t.decimalPlacesRawValue=t.decimalPlaces)):(h.isUndefined(t.decimalPlacesShownOnFocus)&&(t.decimalPlacesShownOnFocus=n.decimalPlacesShownOnFocus),h.isUndefined(t.decimalPlacesShownOnBlur)&&(t.decimalPlacesShownOnBlur=n.decimalPlacesShownOnBlur));var r=0;t.rawValueDivisor&&t.rawValueDivisor!==e.options.rawValueDivisor.none&&(r=String(t.rawValueDivisor).length-1)<0&&(r=0),t.decimalPlaces||t.decimalPlacesRawValue?t.decimalPlacesRawValue=Math.max(Math.max(t.decimalPlacesShownOnBlur,t.decimalPlacesShownOnFocus)+r,Number(t.decimalPlacesRawValue)+r):t.decimalPlacesRawValue=Math.max(Math.max(t.decimalPlacesShownOnBlur,t.decimalPlacesShownOnFocus)+r,Number(n.originalDecimalPlacesRawValue)+r)}}},{key:"_cachesUsualRegularExpressions",value:function(t,i){var n;n=t.negativeSignCharacter!==e.options.negativeSignCharacter.hyphen?"([-\\".concat(t.negativeSignCharacter,"]?)"):"(-?)",i.aNegRegAutoStrip=n,t.allowedAutoStrip=new RegExp("[^-0123456789\\".concat(t.decimalCharacter,"]"),"g"),t.numRegAutoStrip=new RegExp("".concat(n,"(?:\\").concat(t.decimalCharacter,"?([0-9]+\\").concat(t.decimalCharacter,"[0-9]+)|([0-9]*(?:\\").concat(t.decimalCharacter,"[0-9]*)?))")),t.stripReg=new RegExp("^".concat(i.aNegRegAutoStrip,"0*([0-9])")),t.formulaChars=new RegExp("[0-9".concat(t.decimalCharacter,"+\\-*/() ]"))}},{key:"_convertOldOptionsToNewOnes",value:function(e){var t={aSep:"digitGroupSeparator",nSep:"showOnlyNumbersOnFocus",dGroup:"digitalGroupSpacing",aDec:"decimalCharacter",altDec:"decimalCharacterAlternative",aSign:"currencySymbol",pSign:"currencySymbolPlacement",pNeg:"negativePositiveSignPlacement",aSuffix:"suffixText",oLimits:"overrideMinMaxLimits",vMax:"maximumValue",vMin:"minimumValue",mDec:"decimalPlacesOverride",eDec:"decimalPlacesShownOnFocus",scaleDecimal:"decimalPlacesShownOnBlur",aStor:"saveValueToSessionStorage",mRound:"roundingMethod",aPad:"allowDecimalPadding",nBracket:"negativeBracketsTypeOnBlur",wEmpty:"emptyInputBehavior",lZero:"leadingZero",aForm:"formatOnPageLoad",sNumber:"selectNumberOnly",anDefault:"defaultValueOverride",unSetOnSubmit:"unformatOnSubmit",outputType:"outputFormat",debug:"showWarnings",allowDecimalPadding:!0,alwaysAllowDecimalCharacter:!0,caretPositionOnFocus:!0,createLocalList:!0,currencySymbol:!0,currencySymbolPlacement:!0,decimalCharacter:!0,decimalCharacterAlternative:!0,decimalPlaces:!0,decimalPlacesRawValue:!0,decimalPlacesShownOnBlur:!0,decimalPlacesShownOnFocus:!0,defaultValueOverride:!0,digitalGroupSpacing:!0,digitGroupSeparator:!0,divisorWhenUnfocused:!0,emptyInputBehavior:!0,eventBubbles:!0,eventIsCancelable:!0,failOnUnknownOption:!0,formatOnPageLoad:!0,formulaMode:!0,historySize:!0,isCancellable:!0,leadingZero:!0,maximumValue:!0,minimumValue:!0,modifyValueOnWheel:!0,negativeBracketsTypeOnBlur:!0,negativePositiveSignPlacement:!0,negativeSignCharacter:!0,noEventListeners:!0,onInvalidPaste:!0,outputFormat:!0,overrideMinMaxLimits:!0,positiveSignCharacter:!0,rawValueDivisor:!0,readOnly:!0,roundingMethod:!0,saveValueToSessionStorage:!0,selectNumberOnly:!0,selectOnFocus:!0,serializeSpaces:!0,showOnlyNumbersOnFocus:!0,showPositiveSign:!0,showWarnings:!0,styleRules:!0,suffixText:!0,symbolWhenUnfocused:!0,unformatOnHover:!0,unformatOnSubmit:!0,valuesToStrings:!0,watchExternalChanges:!0,wheelOn:!0,wheelStep:!0,allowedAutoStrip:!0,formulaChars:!0,isNegativeSignAllowed:!0,isPositiveSignAllowed:!0,mIntNeg:!0,mIntPos:!0,numRegAutoStrip:!0,originalDecimalPlaces:!0,originalDecimalPlacesRawValue:!0,stripReg:!0};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(!0===t[i])continue;Object.prototype.hasOwnProperty.call(t,i)?(h.warning("You are using the deprecated option name '".concat(i,"'. Please use '").concat(t[i],"' instead from now on. The old option name will be dropped very soon™."),!0),e[t[i]]=e[i],delete e[i]):e.failOnUnknownOption&&h.throwError("Option name '".concat(i,"' is unknown. Please fix the options passed to autoNumeric"))}"mDec"in e&&h.warning("The old `mDec` option has been deprecated in favor of more accurate options ; `decimalPlaces`, `decimalPlacesRawValue`, `decimalPlacesShownOnFocus` and `decimalPlacesShownOnBlur`.",!0)}},{key:"_setNegativePositiveSignPermissions",value:function(e){e.isNegativeSignAllowed=e.minimumValue<0,e.isPositiveSignAllowed=0<=e.maximumValue}},{key:"_toNumericValue",value:function(e,t){var i;return h.isNumber(Number(e))?i=h.scientificToDecimal(e):(i=this._convertToNumericString(e.toString(),t),h.isNumber(Number(i))||(h.warning('The given value "'.concat(e,'" cannot be converted to a numeric one and therefore cannot be used appropriately.'),t.showWarnings),i=NaN)),i}},{key:"_checkIfInRange",value:function(e,t,i){var n=h.parseStr(e);return-1<h.testMinMax(t,n)&&h.testMinMax(i,n)<1}},{key:"_shouldSkipEventKey",value:function(e){var t=h.isInArray(e,a.keyName._allFnKeys),i=e===a.keyName.OSLeft||e===a.keyName.OSRight,n=e===a.keyName.ContextMenu,r=h.isInArray(e,a.keyName._someNonPrintableKeys),s=e===a.keyName.NumLock||e===a.keyName.ScrollLock||e===a.keyName.Insert||e===a.keyName.Command,o=e===a.keyName.Unidentified;return t||i||n||r||o||s}},{key:"_serialize",value:function(e,t,i,n,a){var r,s=this,o=1<arguments.length&&void 0!==t&&t,l=2<arguments.length&&void 0!==i?i:"unformatted",u=3<arguments.length&&void 0!==n?n:"+",c=4<arguments.length&&void 0!==a?a:null,m=[];return"object"===P(e)&&"form"===e.nodeName.toLowerCase()&&Array.prototype.slice.call(e.elements).forEach((function(e){if(e.name&&!e.disabled&&-1===["file","reset","submit","button"].indexOf(e.type))if("select-multiple"===e.type)Array.prototype.slice.call(e.options).forEach((function(t){t.selected&&(o?m.push({name:e.name,value:t.value}):m.push("".concat(encodeURIComponent(e.name),"=").concat(encodeURIComponent(t.value))))}));else if(-1===["checkbox","radio"].indexOf(e.type)||e.checked){var t,i;if(s.isManagedByAutoNumeric(e))switch(l){case"unformatted":i=s.getAutoNumericElement(e),h.isNull(i)||(t=s.unformat(e,i.getSettings()));break;case"localized":if(i=s.getAutoNumericElement(e),!h.isNull(i)){var n=h.cloneObject(i.getSettings());h.isNull(c)||(n.outputFormat=c),t=s.localize(e,n)}break;default:t=e.value}else t=e.value;h.isUndefined(t)&&h.throwError("This error should never be hit. If it has, something really wrong happened!"),o?m.push({name:e.name,value:t}):m.push("".concat(encodeURIComponent(e.name),"=").concat(encodeURIComponent(t)))}})),o?r=m:(r=m.join("&"),"+"===u&&(r=r.replace(/%20/g,"+"))),r}},{key:"_serializeNumericString",value:function(e,t){var i=1<arguments.length&&void 0!==t?t:"+";return this._serialize(e,!1,"unformatted",i)}},{key:"_serializeFormatted",value:function(e,t){var i=1<arguments.length&&void 0!==t?t:"+";return this._serialize(e,!1,"formatted",i)}},{key:"_serializeLocalized",value:function(e,t,i){var n=1<arguments.length&&void 0!==t?t:"+",a=2<arguments.length&&void 0!==i?i:null;return this._serialize(e,!1,"localized",n,a)}},{key:"_serializeNumericStringArray",value:function(e,t){var i=1<arguments.length&&void 0!==t?t:"+";return this._serialize(e,!0,"unformatted",i)}},{key:"_serializeFormattedArray",value:function(e,t){var i=1<arguments.length&&void 0!==t?t:"+";return this._serialize(e,!0,"formatted",i)}},{key:"_serializeLocalizedArray",value:function(e,t,i){var n=1<arguments.length&&void 0!==t?t:"+",a=2<arguments.length&&void 0!==i?i:null;return this._serialize(e,!0,"localized",n,a)}}],O((t=e).prototype,[{key:"_saveInitialValues",value:function(e){this.initialValueHtmlAttribute=h.scientificToDecimal(this.domElement.getAttribute("value")),h.isNull(this.initialValueHtmlAttribute)&&(this.initialValueHtmlAttribute=""),this.initialValue=e,h.isNull(this.initialValue)&&(this.initialValue="")}},{key:"_createEventListeners",value:function(){var t=this;this.formulaMode=!1,this._onFocusInFunc=function(e){t._onFocusIn(e)},this._onFocusInAndMouseEnterFunc=function(e){t._onFocusInAndMouseEnter(e)},this._onFocusFunc=function(){t._onFocus()},this._onKeydownFunc=function(e){t._onKeydown(e)},this._onKeypressFunc=function(e){t._onKeypress(e)},this._onKeyupFunc=function(e){t._onKeyup(e)},this._onFocusOutAndMouseLeaveFunc=function(e){t._onFocusOutAndMouseLeave(e)},this._onPasteFunc=function(e){t._onPaste(e)},this._onWheelFunc=function(e){t._onWheel(e)},this._onDropFunc=function(e){t._onDrop(e)},this._onKeydownGlobalFunc=function(e){t._onKeydownGlobal(e)},this._onKeyupGlobalFunc=function(e){t._onKeyupGlobal(e)},this.domElement.addEventListener("focusin",this._onFocusInFunc,!1),this.domElement.addEventListener("focus",this._onFocusInAndMouseEnterFunc,!1),this.domElement.addEventListener("focus",this._onFocusFunc,!1),this.domElement.addEventListener("mouseenter",this._onFocusInAndMouseEnterFunc,!1),this.domElement.addEventListener("keydown",this._onKeydownFunc,!1),this.domElement.addEventListener("keypress",this._onKeypressFunc,!1),this.domElement.addEventListener("keyup",this._onKeyupFunc,!1),this.domElement.addEventListener("blur",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.addEventListener("mouseleave",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.addEventListener("paste",this._onPasteFunc,!1),this.domElement.addEventListener("wheel",this._onWheelFunc,!1),this.domElement.addEventListener("drop",this._onDropFunc,!1),this._setupFormListener(),this.hasEventListeners=!0,e._doesGlobalListExists()||(document.addEventListener("keydown",this._onKeydownGlobalFunc,!1),document.addEventListener("keyup",this._onKeyupGlobalFunc,!1))}},{key:"_removeEventListeners",value:function(){this.domElement.removeEventListener("focusin",this._onFocusInFunc,!1),this.domElement.removeEventListener("focus",this._onFocusInAndMouseEnterFunc,!1),this.domElement.removeEventListener("focus",this._onFocusFunc,!1),this.domElement.removeEventListener("mouseenter",this._onFocusInAndMouseEnterFunc,!1),this.domElement.removeEventListener("blur",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.removeEventListener("mouseleave",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.removeEventListener("keydown",this._onKeydownFunc,!1),this.domElement.removeEventListener("keypress",this._onKeypressFunc,!1),this.domElement.removeEventListener("keyup",this._onKeyupFunc,!1),this.domElement.removeEventListener("paste",this._onPasteFunc,!1),this.domElement.removeEventListener("wheel",this._onWheelFunc,!1),this.domElement.removeEventListener("drop",this._onDropFunc,!1),this._removeFormListener(),this.hasEventListeners=!1,document.removeEventListener("keydown",this._onKeydownGlobalFunc,!1),document.removeEventListener("keyup",this._onKeyupGlobalFunc,!1)}},{key:"_updateEventListeners",value:function(){this.settings.noEventListeners||this.hasEventListeners||this._createEventListeners(),this.settings.noEventListeners&&this.hasEventListeners&&this._removeEventListeners()}},{key:"_setupFormListener",value:function(){var e=this;h.isNull(this.parentForm)||(this._onFormSubmitFunc=function(){e._onFormSubmit()},this._onFormResetFunc=function(){e._onFormReset()},this._hasParentFormCounter()?this._incrementParentFormCounter():(this._initializeFormCounterToOne(),this.parentForm.addEventListener("submit",this._onFormSubmitFunc,!1),this.parentForm.addEventListener("reset",this._onFormResetFunc,!1),this._storeFormHandlerFunction()))}},{key:"_removeFormListener",value:function(){if(!h.isNull(this.parentForm)){var e=this._getParentFormCounter();1===e?(this.parentForm.removeEventListener("submit",this._getFormHandlerFunction().submitFn,!1),this.parentForm.removeEventListener("reset",this._getFormHandlerFunction().resetFn,!1),this._removeFormDataSetInfo()):1<e?this._decrementParentFormCounter():h.throwError("The AutoNumeric object count on the form is incoherent.")}}},{key:"_hasParentFormCounter",value:function(){return"anCount"in this.parentForm.dataset}},{key:"_getParentFormCounter",value:function(){return Number(this.parentForm.dataset.anCount)}},{key:"_initializeFormCounterToOne",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;this._getFormElement(t).dataset.anCount=1}},{key:"_incrementParentFormCounter",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;this._getFormElement(t).dataset.anCount++}},{key:"_decrementParentFormCounter",value:function(){this.parentForm.dataset.anCount--}},{key:"_hasFormHandlerFunction",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return"anFormHandler"in this._getFormElement(t).dataset}},{key:"_getFormElement",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return h.isNull(t)?this.parentForm:t}},{key:"_storeFormHandlerFunction",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;this.constructor._doesFormHandlerListExists()||this.constructor._createFormHandlerList();var i=h.randomString();this._getFormElement(t).dataset.anFormHandler=i,window.aNFormHandlerMap.set(i,{submitFn:this._onFormSubmitFunc,resetFn:this._onFormResetFunc})}},{key:"_getFormHandlerKey",value:function(){this._hasFormHandlerFunction()||h.throwError("Unable to retrieve the form handler name");var e=this.parentForm.dataset.anFormHandler;return""===e&&h.throwError("The form handler name is invalid"),e}},{key:"_getFormHandlerFunction",value:function(){var e=this._getFormHandlerKey();return window.aNFormHandlerMap.get(e)}},{key:"_removeFormDataSetInfo",value:function(){this._decrementParentFormCounter(),window.aNFormHandlerMap.delete(this._getFormHandlerKey()),this.parentForm.removeAttribute("data-an-count"),this.parentForm.removeAttribute("data-an-form-handler")}},{key:"_setWritePermissions",value:function(e){0<arguments.length&&void 0!==e&&e&&this.domElement.readOnly||this.settings.readOnly?this._setReadOnly():this._setReadWrite()}},{key:"_setReadOnly",value:function(){this.isInputElement?this.domElement.readOnly=!0:this.domElement.setAttribute("contenteditable",!1)}},{key:"_setReadWrite",value:function(){this.isInputElement?this.domElement.readOnly=!1:this.domElement.setAttribute("contenteditable",!0)}},{key:"_addWatcher",value:function(){var e=this;if(!h.isUndefined(this.getterSetter)){var t=this.getterSetter,i=t.set,n=t.get;Object.defineProperty(this.domElement,this.attributeToWatch,{configurable:!0,get:function(){return n.call(e.domElement)},set:function(t){i.call(e.domElement,t),e.settings.watchExternalChanges&&!e.internalModification&&e.set(t)}})}}},{key:"_removeWatcher",value:function(){var e=this;if(!h.isUndefined(this.getterSetter)){var t=this.getterSetter,i=t.set,n=t.get;Object.defineProperty(this.domElement,this.attributeToWatch,{configurable:!0,get:function(){return n.call(e.domElement)},set:function(t){i.call(e.domElement,t)}})}}},{key:"_getAttributeToWatch",value:function(){var e;if(this.isInputElement)e="value";else{var t=this.domElement.nodeType;t===Node.ELEMENT_NODE||t===Node.DOCUMENT_NODE||t===Node.DOCUMENT_FRAGMENT_NODE?e="textContent":t===Node.TEXT_NODE&&(e="nodeValue")}return e}},{key:"_historyTableAdd",value:function(){var e=0===this.historyTable.length;if(e||this.rawValue!==this._historyTableCurrentValueUsed()){var t=!0;if(!e){var i=this.historyTableIndex+1;i<this.historyTable.length&&this.rawValue===this.historyTable[i].value?t=!1:h.arrayTrim(this.historyTable,this.historyTableIndex+1)}if(this.historyTableIndex++,t){var n=h.getElementSelection(this.domElement);this.selectionStart=n.start,this.selectionEnd=n.end,this.historyTable.push({value:this.rawValue,start:this.selectionStart+1,end:this.selectionEnd+1}),1<this.historyTable.length&&(this.historyTable[this.historyTableIndex-1].start=this.selectionStart,this.historyTable[this.historyTableIndex-1].end=this.selectionEnd)}this.historyTable.length>this.settings.historySize&&this._historyTableForget()}}},{key:"_historyTableUndoOrRedo",value:function(e){var t;if(0<arguments.length&&void 0!==e&&!e?(t=this.historyTableIndex+1<this.historyTable.length)&&this.historyTableIndex++:(t=0<this.historyTableIndex)&&this.historyTableIndex--,t){var i=this.historyTable[this.historyTableIndex];this.set(i.value,null,!1),h.setElementSelection(this.domElement,i.start,i.end)}}},{key:"_historyTableUndo",value:function(){this._historyTableUndoOrRedo(!0)}},{key:"_historyTableRedo",value:function(){this._historyTableUndoOrRedo(!1)}},{key:"_historyTableForget",value:function(e){for(var t=0<arguments.length&&void 0!==e?e:1,i=[],n=0;n<t;n++)i.push(this.historyTable.shift()),this.historyTableIndex--,this.historyTableIndex<0&&(this.historyTableIndex=0);return 1===i.length?i[0]:i}},{key:"_historyTableCurrentValueUsed",value:function(){var e=this.historyTableIndex;return e<0&&(e=0),h.isUndefinedOrNullOrEmpty(this.historyTable[e])?"":this.historyTable[e].value}},{key:"_parseStyleRules",value:function(){var e=this;h.isUndefinedOrNullOrEmpty(this.settings.styleRules)||""===this.rawValue||(h.isUndefinedOrNullOrEmpty(this.settings.styleRules.positive)||(0<=this.rawValue?this._addCSSClass(this.settings.styleRules.positive):this._removeCSSClass(this.settings.styleRules.positive)),h.isUndefinedOrNullOrEmpty(this.settings.styleRules.negative)||(this.rawValue<0?this._addCSSClass(this.settings.styleRules.negative):this._removeCSSClass(this.settings.styleRules.negative)),h.isUndefinedOrNullOrEmpty(this.settings.styleRules.ranges)||0===this.settings.styleRules.ranges.length||this.settings.styleRules.ranges.forEach((function(t){e.rawValue>=t.min&&e.rawValue<t.max?e._addCSSClass(t.class):e._removeCSSClass(t.class)})),h.isUndefinedOrNullOrEmpty(this.settings.styleRules.userDefined)||0===this.settings.styleRules.userDefined.length||this.settings.styleRules.userDefined.forEach((function(t){if(h.isFunction(t.callback))if(h.isString(t.classes))t.callback(e.rawValue)?e._addCSSClass(t.classes):e._removeCSSClass(t.classes);else if(h.isArray(t.classes))if(2===t.classes.length)t.callback(e.rawValue)?(e._addCSSClass(t.classes[0]),e._removeCSSClass(t.classes[1])):(e._removeCSSClass(t.classes[0]),e._addCSSClass(t.classes[1]));else if(2<t.classes.length){var i=t.callback(e.rawValue);h.isArray(i)?t.classes.forEach((function(t,n){h.isInArray(n,i)?e._addCSSClass(t):e._removeCSSClass(t)})):h.isInt(i)?t.classes.forEach((function(t,n){n===i?e._addCSSClass(t):e._removeCSSClass(t)})):h.isNull(i)?t.classes.forEach((function(t){e._removeCSSClass(t)})):h.throwError("The callback result is not an array nor a valid array index, ".concat(P(i)," given."))}else h.throwError("The classes attribute is not valid for the `styleRules` option.");else h.isUndefinedOrNullOrEmpty(t.classes)?t.callback(e):h.throwError("The callback/classes structure is not valid for the `styleRules` option.");else h.warning("The given `styleRules` callback is not a function, ".concat("undefined"==typeof callback?"undefined":P(callback)," given."),e.settings.showWarnings)})))}},{key:"_addCSSClass",value:function(e){this.domElement.classList.add(e)}},{key:"_removeCSSClass",value:function(e){this.domElement.classList.remove(e)}},{key:"update",value:function(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];Array.isArray(i)&&Array.isArray(i[0])&&(i=i[0]);var a=h.cloneObject(this.settings),r=this.rawValue,s={};h.isUndefinedOrNullOrEmpty(i)||0===i.length?s=null:1<=i.length&&i.forEach((function(t){e.constructor._isPreDefinedOptionValid(t)&&(t=e.constructor._getOptionObject(t)),w(s,t)}));try{this._setSettings(s,!0),this._setWritePermissions(),this._updateEventListeners(),this.set(r)}catch(t){return this._setSettings(a,!0),h.throwError("Unable to update the settings, those are invalid: [".concat(t,"]")),this}return this}},{key:"getSettings",value:function(){return this.settings}},{key:"set",value:function(t,i,n){var a,r=1<arguments.length&&void 0!==i?i:null,s=!(2<arguments.length&&void 0!==n)||n;if(h.isUndefined(t))return h.warning("You are trying to set an 'undefined' value ; an error could have occurred.",this.settings.showWarnings),this;if(h.isNull(r)||this._setSettings(r,!0),null===t&&this.settings.emptyInputBehavior!==e.options.emptyInputBehavior.null)return h.warning("You are trying to set the `null` value while the `emptyInputBehavior` option is set to ".concat(this.settings.emptyInputBehavior,". If you want to be able to set the `null` value, you need to change the 'emptyInputBehavior' option to `'null'`."),this.settings.showWarnings),this;if(null===t)return this._setElementAndRawValue(null,null,s),this._saveValueToPersistentStorage(),this;if(a=this.constructor._toNumericValue(t,this.settings),isNaN(Number(a)))return h.warning("The value you are trying to set results in `NaN`. The element value is set to the empty string instead.",this.settings.showWarnings),this.setValue("",s),this;if(""===a)switch(this.settings.emptyInputBehavior){case e.options.emptyInputBehavior.zero:a=0;break;case e.options.emptyInputBehavior.min:a=this.settings.minimumValue;break;case e.options.emptyInputBehavior.max:a=this.settings.maximumValue;break;default:h.isNumber(this.settings.emptyInputBehavior)&&(a=Number(this.settings.emptyInputBehavior))}if(""===a)return o=this.settings.emptyInputBehavior===e.options.emptyInputBehavior.always?this.settings.currencySymbol:"",this._setElementAndRawValue(o,"",s),this;var o,l=y(this.constructor._checkIfInRangeWithOverrideOption(a,this.settings),2),u=l[0],c=l[1];if(u&&c&&this.settings.valuesToStrings&&this._checkValuesToStrings(a))return this._setElementAndRawValue(this.settings.valuesToStrings[a],a,s),this._saveValueToPersistentStorage(),this;if(h.isZeroOrHasNoValue(a)&&(a="0"),u&&c){var m=this.constructor._roundRawValue(a,this.settings);return m=this._trimLeadingAndTrailingZeros(m.replace(this.settings.decimalCharacter,".")),a=this._getRawValueToFormat(a),a=this.isFocused?this.constructor._roundFormattedValueShownOnFocus(a,this.settings):(this.settings.divisorWhenUnfocused&&(a=(a/=this.settings.divisorWhenUnfocused).toString()),this.constructor._roundFormattedValueShownOnBlur(a,this.settings)),a=this.constructor._modifyNegativeSignAndDecimalCharacterForFormattedValue(a,this.settings),a=this.constructor._addGroupSeparators(a,this.settings,this.isFocused,this.rawValue,m),!this.isFocused&&this.settings.symbolWhenUnfocused&&(a="".concat(a).concat(this.settings.symbolWhenUnfocused)),(this.settings.decimalPlacesShownOnFocus||this.settings.divisorWhenUnfocused)&&this._saveValueToPersistentStorage(),this._setElementAndRawValue(a,m,s),this._setValidOrInvalidState(m),this}return this._triggerRangeEvents(u,c),h.throwError("The value [".concat(a,"] being set falls outside of the minimumValue [").concat(this.settings.minimumValue,"] and maximumValue [").concat(this.settings.maximumValue,"] range set for this element")),this._removeValueFromPersistentStorage(),this.setValue("",s),this}},{key:"setUnformatted",value:function(e,t){var i=1<arguments.length&&void 0!==t?t:null;if(null===e||h.isUndefined(e))return this;h.isNull(i)||this._setSettings(i,!0);var n=this.constructor._removeBrackets(e,this.settings),a=this.constructor._stripAllNonNumberCharacters(n,this.settings,!0,this.isFocused);return h.isNumber(a)||h.throwError("The value is not a valid one, it's not a numeric string nor a recognized currency."),this.constructor._isWithinRangeWithOverrideOption(a,this.settings)?this.setValue(e):h.throwError("The value is out of the range limits [".concat(this.settings.minimumValue,", ").concat(this.settings.maximumValue,"].")),this}},{key:"setValue",value:function(e,t){var i=!(1<arguments.length&&void 0!==t)||t;return this._setElementAndRawValue(e,i),this}},{key:"_setRawValue",value:function(t,i){var n=!(1<arguments.length&&void 0!==i)||i;if(this.rawValue!==t){var a=this.rawValue;this.rawValue=t,!h.isNull(this.settings.rawValueDivisor)&&0!==this.settings.rawValueDivisor&&""!==t&&null!==t&&this._isUserManuallyEditingTheValue()&&(this.rawValue/=this.settings.rawValueDivisor),this._triggerEvent(e.events.rawValueModified,this.domElement,{oldRawValue:a,newRawValue:this.rawValue,isPristine:this.isPristine(!0),error:null,aNElement:this}),this._parseStyleRules(),n&&this._historyTableAdd()}}},{key:"_setElementValue",value:function(t,i){var n=!(1<arguments.length&&void 0!==i)||i,a=h.getElementValue(this.domElement);return t!==a&&(this.internalModification=!0,h.setElementValue(this.domElement,t),this.internalModification=!1,n&&this._triggerEvent(e.events.formatted,this.domElement,{oldValue:a,newValue:t,oldRawValue:this.rawValue,newRawValue:this.rawValue,isPristine:this.isPristine(!1),error:null,aNElement:this})),this}},{key:"_setElementAndRawValue",value:function(e,t,i){var n=1<arguments.length&&void 0!==t?t:null,a=!(2<arguments.length&&void 0!==i)||i;return h.isNull(n)?n=e:h.isBoolean(n)&&(a=n,n=e),this._setElementValue(e),this._setRawValue(n,a),this}},{key:"_getRawValueToFormat",value:function(e){return h.isNull(this.settings.rawValueDivisor)||0===this.settings.rawValueDivisor||""===e||null===e?e:e*this.settings.rawValueDivisor}},{key:"_checkValuesToStrings",value:function(e){return this.constructor._checkValuesToStringsArray(e,this.valuesToStringsKeys)}},{key:"_isUserManuallyEditingTheValue",value:function(){return this.isFocused&&this.isEditing||this.isDropEvent}},{key:"_executeCallback",value:function(e,t){!h.isNull(t)&&h.isFunction(t)&&t(e,this)}},{key:"_triggerEvent",value:function(e,t,i){var n=1<arguments.length&&void 0!==t?t:document,a=2<arguments.length&&void 0!==i?i:null;h.triggerEvent(e,n,a,this.settings.eventBubbles,this.settings.eventIsCancelable)}},{key:"get",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return this.getNumericString(t)}},{key:"getNumericString",value:function(e){var t,i=0<arguments.length&&void 0!==e?e:null;return t=h.isNull(this.rawValue)?null:h.trimPaddedZerosFromDecimalPlaces(this.rawValue),this._executeCallback(t,i),t}},{key:"getFormatted",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;"value"in this.domElement||"textContent"in this.domElement||h.throwError("Unable to get the formatted string from the element.");var i=h.getElementValue(this.domElement);return this._executeCallback(i,t),i}},{key:"getNumber",value:function(e){var t,i=0<arguments.length&&void 0!==e?e:null;return t=null===this.rawValue?null:this.constructor._toLocale(this.getNumericString(),"number",this.settings),this._executeCallback(t,i),t}},{key:"getLocalized",value:function(t,i){var n,a,r=0<arguments.length&&void 0!==t?t:null,s=1<arguments.length&&void 0!==i?i:null;h.isFunction(r)&&h.isNull(s)&&(s=r,r=null),(n=h.isEmptyString(this.rawValue)?"":""+Number(this.rawValue))&&0===Number(n)&&this.settings.leadingZero!==e.options.leadingZero.keep&&(n="0"),a=h.isNull(r)?this.settings.outputFormat:r;var o=this.constructor._toLocale(n,a,this.settings);return this._executeCallback(o,s),o}},{key:"reformat",value:function(){return this.set(this.rawValue),this}},{key:"unformat",value:function(){return this._setElementValue(this.getNumericString()),this}},{key:"unformatLocalized",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return this._setElementValue(this.getLocalized(t)),this}},{key:"isPristine",value:function(e){return 0<arguments.length&&void 0!==e&&!e?this.initialValueHtmlAttribute===this.getFormatted():this.initialValue===this.getNumericString()}},{key:"select",value:function(){return this.settings.selectNumberOnly?this.selectNumber():this._defaultSelectAll(),this}},{key:"_defaultSelectAll",value:function(){h.setElementSelection(this.domElement,0,h.getElementValue(this.domElement).length)}},{key:"selectNumber",value:function(){var t,i,n=h.getElementValue(this.domElement),a=n.length,r=this.settings.currencySymbol.length,s=this.settings.currencySymbolPlacement,o=h.isNegative(n,this.settings.negativeSignCharacter)?1:0,l=this.settings.suffixText.length;if(t=s===e.options.currencySymbolPlacement.suffix?0:this.settings.negativePositiveSignPlacement===e.options.negativePositiveSignPlacement.left&&1==o&&0<r?r+1:r,s===e.options.currencySymbolPlacement.prefix)i=a-l;else switch(this.settings.negativePositiveSignPlacement){case e.options.negativePositiveSignPlacement.left:i=a-(l+r);break;case e.options.negativePositiveSignPlacement.right:i=0<r?a-(r+o+l):a-(r+l);break;default:i=a-(r+l)}return h.setElementSelection(this.domElement,t,i),this}},{key:"selectInteger",value:function(){var t=0,i=0<=this.rawValue;this.settings.currencySymbolPlacement!==e.options.currencySymbolPlacement.prefix&&(this.settings.currencySymbolPlacement!==e.options.currencySymbolPlacement.suffix||this.settings.negativePositiveSignPlacement!==e.options.negativePositiveSignPlacement.prefix&&this.settings.negativePositiveSignPlacement!==e.options.negativePositiveSignPlacement.none)||(this.settings.showPositiveSign&&i||!i&&this.settings.currencySymbolPlacement===e.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===e.options.negativePositiveSignPlacement.left)&&(t+=1),this.settings.currencySymbolPlacement===e.options.currencySymbolPlacement.prefix&&(t+=this.settings.currencySymbol.length);var n=h.getElementValue(this.domElement),a=n.indexOf(this.settings.decimalCharacter);return-1===a&&(a=this.settings.currencySymbolPlacement===e.options.currencySymbolPlacement.suffix?n.length-this.settings.currencySymbol.length:n.length,i||this.settings.negativePositiveSignPlacement!==e.options.negativePositiveSignPlacement.suffix&&this.settings.currencySymbolPlacement!==e.options.currencySymbolPlacement.suffix||--a,a-=this.settings.suffixText.length),h.setElementSelection(this.domElement,t,a),this}},{key:"selectDecimal",value:function(){var e,t,i=h.getElementValue(this.domElement).indexOf(this.settings.decimalCharacter);return e=-1===i?i=0:(i+=1,t=this.isFocused?this.settings.decimalPlacesShownOnFocus:this.settings.decimalPlacesShownOnBlur,i+Number(t)),h.setElementSelection(this.domElement,i,e),this}},{key:"node",value:function(){return this.domElement}},{key:"parent",value:function(){return this.domElement.parentNode}},{key:"detach",value:function(e){var t,i=0<arguments.length&&void 0!==e?e:null;return t=h.isNull(i)?this.domElement:i.node(),this._removeFromLocalList(t),this}},{key:"attach",value:function(e,t){var i=!(1<arguments.length&&void 0!==t)||t;return this._addToLocalList(e.node()),i&&e.update(this.settings),this}},{key:"formatOther",value:function(e,t){var i=1<arguments.length&&void 0!==t?t:null;return this._formatOrUnformatOther(!0,e,i)}},{key:"unformatOther",value:function(e,t){var i=1<arguments.length&&void 0!==t?t:null;return this._formatOrUnformatOther(!1,e,i)}},{key:"_formatOrUnformatOther",value:function(t,i,n){var a,r,s=2<arguments.length&&void 0!==n?n:null;if(a=h.isNull(s)?this.settings:this._cloneAndMergeSettings(s),h.isElement(i)){var o=h.getElementValue(i);return r=t?e.format(o,a):e.unformat(o,a),h.setElementValue(i,r),null}return t?e.format(i,a):e.unformat(i,a)}},{key:"init",value:function(t,i){var n=this,a=!(1<arguments.length&&void 0!==i)||i,r=!1,s=[];if(h.isString(t)?s=f(document.querySelectorAll(t)):h.isElement(t)?(s.push(t),r=!0):h.isArray(t)?s=t:h.throwError("The given parameters to the 'init' function are invalid."),0===s.length)return h.warning("No valid DOM elements were given hence no AutoNumeric object were instantiated.",!0),[];var o=this._getLocalList(),l=[];return s.forEach((function(t){var i=n.settings.createLocalList;a&&(n.settings.createLocalList=!1);var r=new e(t,h.getElementValue(t),n.settings);a&&(r._setLocalList(o),n._addToLocalList(t,r),n.settings.createLocalList=i),l.push(r)})),r?l[0]:l}},{key:"clear",value:function(t){if(0<arguments.length&&void 0!==t&&t){var i={emptyInputBehavior:e.options.emptyInputBehavior.focus};this.set("",i)}else this.set("");return this}},{key:"remove",value:function(){this._removeValueFromPersistentStorage(),this._removeEventListeners(),this._removeWatcher(),this._removeFromLocalList(this.domElement),this.constructor._removeFromGlobalList(this)}},{key:"wipe",value:function(){this._setElementValue("",!1),this.remove()}},{key:"nuke",value:function(){this.remove(),this.domElement.parentNode.removeChild(this.domElement)}},{key:"form",value:function(e){if(0<arguments.length&&void 0!==e&&e||h.isUndefinedOrNullOrEmpty(this.parentForm)){var t=this._getParentForm();if(!h.isNull(t)&&t!==this.parentForm){var i=this._getFormAutoNumericChildren(this.parentForm);this.parentForm.dataset.anCount=i.length,this._hasFormHandlerFunction(t)?this._incrementParentFormCounter(t):(this._storeFormHandlerFunction(t),this._initializeFormCounterToOne(t))}this.parentForm=t}return this.parentForm}},{key:"_getFormAutoNumericChildren",value:function(e){var t=this;return f(e.querySelectorAll("input")).filter((function(e){return t.constructor.isManagedByAutoNumeric(e)}))}},{key:"_getParentForm",value:function(){if("body"===this.domElement.tagName.toLowerCase())return null;var e,t=this.domElement;do{if(t=t.parentNode,h.isNull(t))return null;if("body"===(e=t.tagName?t.tagName.toLowerCase():""))break}while("form"!==e);return"form"===e?t:null}},{key:"formNumericString",value:function(){return this.constructor._serializeNumericString(this.form(),this.settings.serializeSpaces)}},{key:"formFormatted",value:function(){return this.constructor._serializeFormatted(this.form(),this.settings.serializeSpaces)}},{key:"formLocalized",value:function(e){var t,i=0<arguments.length&&void 0!==e?e:null;return t=h.isNull(i)?this.settings.outputFormat:i,this.constructor._serializeLocalized(this.form(),this.settings.serializeSpaces,t)}},{key:"formArrayNumericString",value:function(){return this.constructor._serializeNumericStringArray(this.form(),this.settings.serializeSpaces)}},{key:"formArrayFormatted",value:function(){return this.constructor._serializeFormattedArray(this.form(),this.settings.serializeSpaces)}},{key:"formArrayLocalized",value:function(e){var t,i=0<arguments.length&&void 0!==e?e:null;return t=h.isNull(i)?this.settings.outputFormat:i,this.constructor._serializeLocalizedArray(this.form(),this.settings.serializeSpaces,t)}},{key:"formJsonNumericString",value:function(){return JSON.stringify(this.formArrayNumericString())}},{key:"formJsonFormatted",value:function(){return JSON.stringify(this.formArrayFormatted())}},{key:"formJsonLocalized",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return JSON.stringify(this.formArrayLocalized(t))}},{key:"formUnformat",value:function(){return this.constructor._getChildANInputElement(this.form()).forEach((function(t){e.getAutoNumericElement(t).unformat()})),this}},{key:"formUnformatLocalized",value:function(){return this.constructor._getChildANInputElement(this.form()).forEach((function(t){e.getAutoNumericElement(t).unformatLocalized()})),this}},{key:"formReformat",value:function(){return this.constructor._getChildANInputElement(this.form()).forEach((function(t){e.getAutoNumericElement(t).reformat()})),this}},{key:"formSubmitNumericString",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return h.isNull(t)?(this.formUnformat(),this.form().submit(),this.formReformat()):h.isFunction(t)?t(this.formNumericString()):h.throwError("The given callback is not a function."),this}},{key:"formSubmitFormatted",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return h.isNull(t)?this.form().submit():h.isFunction(t)?t(this.formFormatted()):h.throwError("The given callback is not a function."),this}},{key:"formSubmitLocalized",value:function(e,t){var i=0<arguments.length&&void 0!==e?e:null,n=1<arguments.length&&void 0!==t?t:null;return h.isNull(n)?(this.formUnformatLocalized(),this.form().submit(),this.formReformat()):h.isFunction(n)?n(this.formLocalized(i)):h.throwError("The given callback is not a function."),this}},{key:"formSubmitArrayNumericString",value:function(e){return h.isFunction(e)?e(this.formArrayNumericString()):h.throwError("The given callback is not a function."),this}},{key:"formSubmitArrayFormatted",value:function(e){return h.isFunction(e)?e(this.formArrayFormatted()):h.throwError("The given callback is not a function."),this}},{key:"formSubmitArrayLocalized",value:function(e,t){var i=1<arguments.length&&void 0!==t?t:null;return h.isFunction(e)?e(this.formArrayLocalized(i)):h.throwError("The given callback is not a function."),this}},{key:"formSubmitJsonNumericString",value:function(e){return h.isFunction(e)?e(this.formJsonNumericString()):h.throwError("The given callback is not a function."),this}},{key:"formSubmitJsonFormatted",value:function(e){return h.isFunction(e)?e(this.formJsonFormatted()):h.throwError("The given callback is not a function."),this}},{key:"formSubmitJsonLocalized",value:function(e,t){var i=1<arguments.length&&void 0!==t?t:null;return h.isFunction(e)?e(this.formJsonLocalized(i)):h.throwError("The given callback is not a function."),this}},{key:"_createLocalList",value:function(){this.autoNumericLocalList=new Map,this._addToLocalList(this.domElement)}},{key:"_deleteLocalList",value:function(){delete this.autoNumericLocalList}},{key:"_setLocalList",value:function(e){this.autoNumericLocalList=e}},{key:"_getLocalList",value:function(){return this.autoNumericLocalList}},{key:"_hasLocalList",value:function(){return this.autoNumericLocalList instanceof Map&&0!==this.autoNumericLocalList.size}},{key:"_addToLocalList",value:function(e,t){var i=1<arguments.length&&void 0!==t?t:null;h.isNull(i)&&(i=this),h.isUndefined(this.autoNumericLocalList)?h.throwError("The local list provided does not exists when trying to add an element. [".concat(this.autoNumericLocalList,"] given.")):this.autoNumericLocalList.set(e,i)}},{key:"_removeFromLocalList",value:function(e){h.isUndefined(this.autoNumericLocalList)?this.settings.createLocalList&&h.throwError("The local list provided does not exists when trying to remove an element. [".concat(this.autoNumericLocalList,"] given.")):this.autoNumericLocalList.delete(e)}},{key:"_mergeSettings",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];w.apply(void 0,[this.settings].concat(t))}},{key:"_cloneAndMergeSettings",value:function(){for(var e={},t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return w.apply(void 0,[e,this.settings].concat(i)),e}},{key:"_updatePredefinedOptions",value:function(e,t){var i=1<arguments.length&&void 0!==t?t:null;return h.isNull(i)?this.update(e):(this._mergeSettings(e,i),this.update(this.settings)),this}},{key:"french",value:function(t){var i=0<arguments.length&&void 0!==t?t:null;return this._updatePredefinedOptions(e.getPredefinedOptions().French,i),this}},{key:"northAmerican",value:function(t){var i=0<arguments.length&&void 0!==t?t:null;return this._updatePredefinedOptions(e.getPredefinedOptions().NorthAmerican,i),this}},{key:"british",value:function(t){var i=0<arguments.length&&void 0!==t?t:null;return this._updatePredefinedOptions(e.getPredefinedOptions().British,i),this}},{key:"swiss",value:function(t){var i=0<arguments.length&&void 0!==t?t:null;return this._updatePredefinedOptions(e.getPredefinedOptions().Swiss,i),this}},{key:"japanese",value:function(t){var i=0<arguments.length&&void 0!==t?t:null;return this._updatePredefinedOptions(e.getPredefinedOptions().Japanese,i),this}},{key:"spanish",value:function(t){var i=0<arguments.length&&void 0!==t?t:null;return this._updatePredefinedOptions(e.getPredefinedOptions().Spanish,i),this}},{key:"chinese",value:function(t){var i=0<arguments.length&&void 0!==t?t:null;return this._updatePredefinedOptions(e.getPredefinedOptions().Chinese,i),this}},{key:"brazilian",value:function(t){var i=0<arguments.length&&void 0!==t?t:null;return this._updatePredefinedOptions(e.getPredefinedOptions().Brazilian,i),this}},{key:"_runCallbacksFoundInTheSettingsObject",value:function(){for(var e in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,e)){var t=this.settings[e];if("function"==typeof t)this.settings[e]=t(this,e);else{var i=this.domElement.getAttribute(e);i=h.camelize(i),"function"==typeof this.settings[i]&&(this.settings[e]=i(this,e))}}}},{key:"_setTrailingNegativeSignInfo",value:function(){this.isTrailingNegative=this.settings.currencySymbolPlacement===e.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===e.options.negativePositiveSignPlacement.suffix||this.settings.currencySymbolPlacement===e.options.currencySymbolPlacement.suffix&&(this.settings.negativePositiveSignPlacement===e.options.negativePositiveSignPlacement.left||this.settings.negativePositiveSignPlacement===e.options.negativePositiveSignPlacement.right)}},{key:"_modifyNegativeSignAndDecimalCharacterForRawValue",value:function(e){return"."!==this.settings.decimalCharacter&&(e=e.replace(this.settings.decimalCharacter,".")),"-"!==this.settings.negativeSignCharacter&&this.settings.isNegativeSignAllowed&&(e=e.replace(this.settings.negativeSignCharacter,"-")),e.match(/\d/)||(e+="0"),e}},{key:"_initialCaretPosition",value:function(t){h.isNull(this.settings.caretPositionOnFocus)&&this.settings.selectOnFocus===e.options.selectOnFocus.doNotSelect&&h.throwError("`_initialCaretPosition()` should never be called when the `caretPositionOnFocus` option is `null`.");var i=this.rawValue<0,n=h.isZeroOrHasNoValue(t),a=t.length,r=0,s=0,o=!1,l=0;this.settings.caretPositionOnFocus!==e.options.caretPositionOnFocus.start&&(r=(t=(t=(t=t.replace(this.settings.negativeSignCharacter,"")).replace(this.settings.positiveSignCharacter,"")).replace(this.settings.currencySymbol,"")).length,o=h.contains(t,this.settings.decimalCharacter),this.settings.caretPositionOnFocus!==e.options.caretPositionOnFocus.decimalLeft&&this.settings.caretPositionOnFocus!==e.options.caretPositionOnFocus.decimalRight||(l=o?(s=t.indexOf(this.settings.decimalCharacter),this.settings.decimalCharacter.length):(s=r,0)));var u="";i?u=this.settings.negativeSignCharacter:this.settings.showPositiveSign&&!n&&(u=this.settings.positiveSignCharacter);var c,m=u.length,g=this.settings.currencySymbol.length;if(this.settings.currencySymbolPlacement===e.options.currencySymbolPlacement.prefix){if(this.settings.caretPositionOnFocus===e.options.caretPositionOnFocus.start)if(this.settings.negativePositiveSignPlacement!==e.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!n))switch(this.settings.negativePositiveSignPlacement){case e.options.negativePositiveSignPlacement.prefix:case e.options.negativePositiveSignPlacement.left:case e.options.negativePositiveSignPlacement.right:c=m+g;break;case e.options.negativePositiveSignPlacement.suffix:c=g}else c=g;else if(this.settings.caretPositionOnFocus===e.options.caretPositionOnFocus.end)if(this.settings.negativePositiveSignPlacement!==e.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!n))switch(this.settings.negativePositiveSignPlacement){case e.options.negativePositiveSignPlacement.prefix:case e.options.negativePositiveSignPlacement.left:case e.options.negativePositiveSignPlacement.right:c=a;break;case e.options.negativePositiveSignPlacement.suffix:c=g+r}else c=a;else if(this.settings.caretPositionOnFocus===e.options.caretPositionOnFocus.decimalLeft)if(this.settings.negativePositiveSignPlacement!==e.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!n))switch(this.settings.negativePositiveSignPlacement){case e.options.negativePositiveSignPlacement.prefix:case e.options.negativePositiveSignPlacement.left:case e.options.negativePositiveSignPlacement.right:c=m+g+s;break;case e.options.negativePositiveSignPlacement.suffix:c=g+s}else c=g+s;else if(this.settings.caretPositionOnFocus===e.options.caretPositionOnFocus.decimalRight)if(this.settings.negativePositiveSignPlacement!==e.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!n))switch(this.settings.negativePositiveSignPlacement){case e.options.negativePositiveSignPlacement.prefix:case e.options.negativePositiveSignPlacement.left:case e.options.negativePositiveSignPlacement.right:c=m+g+s+l;break;case e.options.negativePositiveSignPlacement.suffix:c=g+s+l}else c=g+s+l}else if(this.settings.currencySymbolPlacement===e.options.currencySymbolPlacement.suffix)if(this.settings.caretPositionOnFocus===e.options.caretPositionOnFocus.start)if(this.settings.negativePositiveSignPlacement!==e.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!n))switch(this.settings.negativePositiveSignPlacement){case e.options.negativePositiveSignPlacement.suffix:case e.options.negativePositiveSignPlacement.right:case e.options.negativePositiveSignPlacement.left:c=0;break;case e.options.negativePositiveSignPlacement.prefix:c=m}else c=0;else if(this.settings.caretPositionOnFocus===e.options.caretPositionOnFocus.end)if(this.settings.negativePositiveSignPlacement!==e.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!n))switch(this.settings.negativePositiveSignPlacement){case e.options.negativePositiveSignPlacement.suffix:case e.options.negativePositiveSignPlacement.right:case e.options.negativePositiveSignPlacement.left:c=r;break;case e.options.negativePositiveSignPlacement.prefix:c=m+r}else c=r;else if(this.settings.caretPositionOnFocus===e.options.caretPositionOnFocus.decimalLeft)if(this.settings.negativePositiveSignPlacement!==e.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!n))switch(this.settings.negativePositiveSignPlacement){case e.options.negativePositiveSignPlacement.suffix:case e.options.negativePositiveSignPlacement.right:case e.options.negativePositiveSignPlacement.left:c=s;break;case e.options.negativePositiveSignPlacement.prefix:c=m+s}else c=s;else if(this.settings.caretPositionOnFocus===e.options.caretPositionOnFocus.decimalRight)if(this.settings.negativePositiveSignPlacement!==e.options.negativePositiveSignPlacement.none&&(i||!i&&this.settings.showPositiveSign&&!n))switch(this.settings.negativePositiveSignPlacement){case e.options.negativePositiveSignPlacement.suffix:case e.options.negativePositiveSignPlacement.right:case e.options.negativePositiveSignPlacement.left:c=s+l;break;case e.options.negativePositiveSignPlacement.prefix:c=m+s+l}else c=s+l;return c}},{key:"_triggerRangeEvents",value:function(t,i){t||this._triggerEvent(e.events.minRangeExceeded,this.domElement),i||this._triggerEvent(e.events.maxRangeExceeded,this.domElement)}},{key:"_setInvalidState",value:function(){this.isInputElement?h.setInvalidState(this.domElement):this._addCSSClass(this.settings.invalidClass),this._triggerEvent(e.events.invalidValue,this.domElement),this.validState=!1}},{key:"_setValidState",value:function(){this.isInputElement?h.setValidState(this.domElement):this._removeCSSClass(this.settings.invalidClass),this.validState||this._triggerEvent(e.events.correctedValue,this.domElement),this.validState=!0}},{key:"_setValidOrInvalidState",value:function(t){if(this.settings.overrideMinMaxLimits===e.options.overrideMinMaxLimits.invalid){var i=this.constructor._isMinimumRangeRespected(t,this.settings),n=this.constructor._isMaximumRangeRespected(t,this.settings);i&&n?this._setValidState():this._setInvalidState(),this._triggerRangeEvents(i,n)}}},{key:"_keepAnOriginalSettingsCopy",value:function(){this.originalDigitGroupSeparator=this.settings.digitGroupSeparator,this.originalCurrencySymbol=this.settings.currencySymbol,this.originalSuffixText=this.settings.suffixText}},{key:"_trimLeadingAndTrailingZeros",value:function(t){if(""===t||null===t)return t;if(this.settings.leadingZero!==e.options.leadingZero.keep){if(0===Number(t))return"0";t=t.replace(/^(-)?0+(?=\d)/g,"$1")}return h.contains(t,".")&&(t=t.replace(/(\.[0-9]*?)0+$/,"$1")),t.replace(/\.$/,"")}},{key:"_setPersistentStorageName",value:function(){this.settings.saveValueToSessionStorage&&(""===this.domElement.name||h.isUndefined(this.domElement.name)?this.rawValueStorageName="".concat(this.storageNamePrefix).concat(this.domElement.id):this.rawValueStorageName="".concat(this.storageNamePrefix).concat(decodeURIComponent(this.domElement.name)))}},{key:"_saveValueToPersistentStorage",value:function(){this.settings.saveValueToSessionStorage&&(this.sessionStorageAvailable?sessionStorage.setItem(this.rawValueStorageName,this.rawValue):document.cookie="".concat(this.rawValueStorageName,"=").concat(this.rawValue,"; expires= ; path=/"))}},{key:"_getValueFromPersistentStorage",value:function(){return this.settings.saveValueToSessionStorage?this.sessionStorageAvailable?sessionStorage.getItem(this.rawValueStorageName):this.constructor._readCookie(this.rawValueStorageName):(h.warning("`_getValueFromPersistentStorage()` is called but `settings.saveValueToSessionStorage` is false. There must be an error that needs fixing.",this.settings.showWarnings),null)}},{key:"_removeValueFromPersistentStorage",value:function(){if(this.settings.saveValueToSessionStorage)if(this.sessionStorageAvailable)sessionStorage.removeItem(this.rawValueStorageName);else{var e=new Date;e.setTime(e.getTime()-864e5);var t="; expires=".concat(e.toUTCString());document.cookie="".concat(this.rawValueStorageName,"='' ;").concat(t,"; path=/")}}},{key:"_getDefaultValue",value:function(e){var t=e.getAttribute("value");return h.isNull(t)?"":t}},{key:"_onFocusInAndMouseEnter",value:function(t){if(this.isEditing=!1,!this.formulaMode&&this.settings.unformatOnHover&&"mouseenter"===t.type&&t.altKey)this.constructor._unformatAltHovered(this);else if("focus"===t.type&&(this.isFocused=!0,this.rawValueOnFocus=this.rawValue),"focus"===t.type&&this.settings.unformatOnHover&&this.hoveredWithAlt&&this.constructor._reformatAltHovered(this),"focus"===t.type||"mouseenter"===t.type&&!this.isFocused){var i=null;this.settings.emptyInputBehavior===e.options.emptyInputBehavior.focus&&this.rawValue<0&&null!==this.settings.negativeBracketsTypeOnBlur&&this.settings.isNegativeSignAllowed&&(i=this.constructor._removeBrackets(h.getElementValue(this.domElement),this.settings));var n=this._getRawValueToFormat(this.rawValue);if(""!==n){var a=this.constructor._roundFormattedValueShownOnFocusOrBlur(n,this.settings,this.isFocused);i=this.settings.showOnlyNumbersOnFocus===e.options.showOnlyNumbersOnFocus.onlyNumbers?(this.settings.digitGroupSeparator="",this.settings.currencySymbol="",this.settings.suffixText="",a.replace(".",this.settings.decimalCharacter)):h.isNull(a)?"":this.constructor._addGroupSeparators(a.replace(".",this.settings.decimalCharacter),this.settings,this.isFocused,n)}h.isNull(i)?this.valueOnFocus="":this.valueOnFocus=i,this.lastVal=this.valueOnFocus;var r=this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(this.valueOnFocus,this.settings),s=this.constructor._orderValueCurrencySymbolAndSuffixText(this.valueOnFocus,this.settings,!0),o=r&&""!==s&&this.settings.emptyInputBehavior===e.options.emptyInputBehavior.focus;o&&(i=s),h.isNull(i)||this._setElementValue(i),o&&s===this.settings.currencySymbol&&this.settings.currencySymbolPlacement===e.options.currencySymbolPlacement.suffix&&h.setElementSelection(t.target,0)}}},{key:"_onFocus",value:function(){this.settings.isCancellable&&this._saveCancellableValue()}},{key:"_onFocusIn",value:function(e){this.settings.selectOnFocus?this.select():h.isNull(this.settings.caretPositionOnFocus)||h.setElementSelection(e.target,this._initialCaretPosition(h.getElementValue(this.domElement)))}},{key:"_enterFormulaMode",value:function(){this.settings.formulaMode&&(this.formulaMode=!0,h.setElementValue(this.domElement,"="),h.setElementSelection(this.domElement,1))}},{key:"_exitFormulaMode",value:function(){var t,i=h.getElementValue(this.domElement);i=i.replace(/^\s*=/,"");try{var n=new p(i,this.settings.decimalCharacter);t=(new m).evaluate(n)}catch(t){return this._triggerEvent(e.events.invalidFormula,this.domElement,{formula:i,aNElement:this}),this.reformat(),void(this.formulaMode=!1)}this._triggerEvent(e.events.validFormula,this.domElement,{formula:i,result:t,aNElement:this}),this.set(t),this.formulaMode=!1}},{key:"_acceptNonPrintableKeysInFormulaMode",value:function(){return this.eventKey===a.keyName.Backspace||this.eventKey===a.keyName.Delete||this.eventKey===a.keyName.LeftArrow||this.eventKey===a.keyName.RightArrow||this.eventKey===a.keyName.Home||this.eventKey===a.keyName.End}},{key:"_onKeydown",value:function(t){if(this.formatted=!1,this.isEditing=!0,this.formulaMode||this.isFocused||!this.settings.unformatOnHover||!t.altKey||this.domElement!==h.getHoveredElement()){if(this._updateEventKeyInfo(t),this.keydownEventCounter+=1,1===this.keydownEventCounter&&(this.initialValueOnFirstKeydown=h.getElementValue(t.target),this.initialRawValueOnFirstKeydown=this.rawValue),this.formulaMode){if(this.eventKey===a.keyName.Esc)return this.formulaMode=!1,void this.reformat();if(this.eventKey===a.keyName.Enter)return void this._exitFormulaMode();if(this._acceptNonPrintableKeysInFormulaMode())return}else if(this.eventKey===a.keyName.Equal)return void this._enterFormulaMode();if(this.domElement.readOnly||this.settings.readOnly||this.domElement.disabled)this.processed=!0;else{this.eventKey===a.keyName.Esc&&(t.preventDefault(),this.settings.isCancellable&&this.rawValue!==this.savedCancellableValue&&(this.set(this.savedCancellableValue),this._triggerEvent(e.events.native.input,t.target)),this.select());var i=h.getElementValue(t.target);if(this.eventKey===a.keyName.Enter&&this.rawValue!==this.rawValueOnFocus&&(this._triggerEvent(e.events.native.change,t.target),this.valueOnFocus=i,this.rawValueOnFocus=this.rawValue,this.settings.isCancellable&&this._saveCancellableValue()),this._updateInternalProperties(t),this._processNonPrintableKeysAndShortcuts(t))this.processed=!0;else if(this.eventKey===a.keyName.Backspace||this.eventKey===a.keyName.Delete){var n=this._processCharacterDeletion();if(this.processed=!0,!n)return void t.preventDefault();this._formatValue(t),(i=h.getElementValue(t.target))!==this.lastVal&&this.throwInput&&(this._triggerEvent(e.events.native.input,t.target),t.preventDefault()),this.lastVal=i,this.throwInput=!0}}}else this.constructor._unformatAltHovered(this)}},{key:"_onKeypress",value:function(t){if(this.formulaMode){if(this._acceptNonPrintableKeysInFormulaMode())return;if(this.settings.formulaChars.test(this.eventKey))return;t.preventDefault()}else if(this.eventKey!==a.keyName.Insert){var i=this.processed;if(this._updateInternalProperties(t),!this._processNonPrintableKeysAndShortcuts(t))if(i)t.preventDefault();else{if(this._processCharacterInsertion()){this._formatValue(t);var n=h.getElementValue(t.target);if(n!==this.lastVal&&this.throwInput)this._triggerEvent(e.events.native.input,t.target),t.preventDefault();else{if((this.eventKey===this.settings.decimalCharacter||this.eventKey===this.settings.decimalCharacterAlternative)&&h.getElementSelection(t.target).start===h.getElementSelection(t.target).end&&h.getElementSelection(t.target).start===n.indexOf(this.settings.decimalCharacter)){var r=h.getElementSelection(t.target).start+1;h.setElementSelection(t.target,r)}t.preventDefault()}return this.lastVal=h.getElementValue(t.target),this.throwInput=!0,void this._setValidOrInvalidState(this.rawValue)}t.preventDefault()}}}},{key:"_onKeyup",value:function(t){if(this.isEditing=!1,this.keydownEventCounter=0,!this.formulaMode)if(this.settings.isCancellable&&this.eventKey===a.keyName.Esc)t.preventDefault();else{if(this.eventKey===a.keyName.Z||this.eventKey===a.keyName.z){if(t.ctrlKey&&t.shiftKey)return t.preventDefault(),this._historyTableRedo(),void(this.onGoingRedo=!0);if(t.ctrlKey&&!t.shiftKey){if(!this.onGoingRedo)return t.preventDefault(),void this._historyTableUndo();this.onGoingRedo=!1}}if(this.onGoingRedo&&(t.ctrlKey||t.shiftKey)&&(this.onGoingRedo=!1),(t.ctrlKey||t.metaKey)&&this.eventKey===a.keyName.x){var i=h.getElementSelection(this.domElement).start,n=this.constructor._toNumericValue(h.getElementValue(t.target),this.settings);this.set(n),this._setCaretPosition(i)}if(this.eventKey===a.keyName.Alt&&this.settings.unformatOnHover&&this.hoveredWithAlt)this.constructor._reformatAltHovered(this);else if(!t.ctrlKey&&!t.metaKey||this.eventKey!==a.keyName.Backspace&&this.eventKey!==a.keyName.Delete){this._updateInternalProperties(t);var r=this._processNonPrintableKeysAndShortcuts(t);delete this.valuePartsBeforePaste;var s=h.getElementValue(t.target);if(!(r||""===s&&""===this.initialValueOnFirstKeydown)&&(s===this.settings.currencySymbol?this.settings.currencySymbolPlacement===e.options.currencySymbolPlacement.suffix?h.setElementSelection(t.target,0):h.setElementSelection(t.target,this.settings.currencySymbol.length):this.eventKey===a.keyName.Tab&&h.setElementSelection(t.target,0,s.length),(s===this.settings.suffixText||""===this.rawValue&&""!==this.settings.currencySymbol&&""!==this.settings.suffixText)&&h.setElementSelection(t.target,0),null!==this.settings.decimalPlacesShownOnFocus&&this._saveValueToPersistentStorage(),this.formatted||this._formatValue(t),this._setValidOrInvalidState(this.rawValue),this._saveRawValueForAndroid(),s!==this.initialValueOnFirstKeydown&&this._triggerEvent(e.events.formatted,t.target,{oldValue:this.initialValueOnFirstKeydown,newValue:s,oldRawValue:this.initialRawValueOnFirstKeydown,newRawValue:this.rawValue,isPristine:this.isPristine(!1),error:null,aNElement:this}),1<this.historyTable.length)){var o=h.getElementSelection(this.domElement);this.selectionStart=o.start,this.selectionEnd=o.end,this.historyTable[this.historyTableIndex].start=this.selectionStart,this.historyTable[this.historyTableIndex].end=this.selectionEnd}}else{var l=h.getElementValue(t.target);this._setRawValue(this._formatOrUnformatOther(!1,l))}}}},{key:"_saveRawValueForAndroid",value:function(){if(this.eventKey===a.keyName.AndroidDefault){var e=this.constructor._stripAllNonNumberCharactersExceptCustomDecimalChar(this.getFormatted(),this.settings,!0,this.isFocused);e=this.constructor._convertToNumericString(e,this.settings),this._setRawValue(e)}}},{key:"_onFocusOutAndMouseLeave",value:function(t){if(this.isEditing=!1,"mouseleave"!==t.type||!this.formulaMode)if(this.settings.unformatOnHover&&"mouseleave"===t.type&&this.hoveredWithAlt)this.constructor._reformatAltHovered(this);else if("mouseleave"===t.type&&!this.isFocused||"blur"===t.type){"blur"===t.type&&this.formulaMode&&this._exitFormulaMode(),this._saveValueToPersistentStorage(),this.settings.showOnlyNumbersOnFocus===e.options.showOnlyNumbersOnFocus.onlyNumbers&&(this.settings.digitGroupSeparator=this.originalDigitGroupSeparator,this.settings.currencySymbol=this.originalCurrencySymbol,this.settings.suffixText=this.originalSuffixText);var i=this._getRawValueToFormat(this.rawValue),n=h.isNull(i),a=y(this.constructor._checkIfInRangeWithOverrideOption(i,this.settings),2),r=a[0],s=a[1],o=!1;if(""===i||n||(this._triggerRangeEvents(r,s),this.settings.valuesToStrings&&this._checkValuesToStrings(i)&&(this._setElementValue(this.settings.valuesToStrings[i]),o=!0)),!o){var l;if(l=n||""===i?i:String(i),""===i||n){if(""===i)switch(this.settings.emptyInputBehavior){case e.options.emptyInputBehavior.zero:this._setRawValue("0"),l=this.constructor._roundValue("0",this.settings,0);break;case e.options.emptyInputBehavior.min:this._setRawValue(this.settings.minimumValue),l=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.minimumValue,this.settings,this.isFocused);break;case e.options.emptyInputBehavior.max:this._setRawValue(this.settings.maximumValue),l=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.maximumValue,this.settings,this.isFocused);break;default:h.isNumber(this.settings.emptyInputBehavior)&&(this._setRawValue(this.settings.emptyInputBehavior),l=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.emptyInputBehavior,this.settings,this.isFocused))}}else r&&s&&!this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(i,this.settings)?(l=this._modifyNegativeSignAndDecimalCharacterForRawValue(l),this.settings.divisorWhenUnfocused&&!h.isNull(l)&&(l=(l/=this.settings.divisorWhenUnfocused).toString()),l=this.constructor._roundFormattedValueShownOnBlur(l,this.settings),l=this.constructor._modifyNegativeSignAndDecimalCharacterForFormattedValue(l,this.settings)):this._triggerRangeEvents(r,s);var u=this.constructor._orderValueCurrencySymbolAndSuffixText(l,this.settings,!1);this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(l,this.settings)||n&&this.settings.emptyInputBehavior===e.options.emptyInputBehavior.null||(u=this.constructor._addGroupSeparators(l,this.settings,!1,i)),u===i&&""!==i&&this.settings.allowDecimalPadding!==e.options.allowDecimalPadding.never&&this.settings.allowDecimalPadding!==e.options.allowDecimalPadding.floats||(this.settings.symbolWhenUnfocused&&""!==i&&null!==i&&(u="".concat(u).concat(this.settings.symbolWhenUnfocused)),this._setElementValue(u))}this._setValidOrInvalidState(this.rawValue),"blur"===t.type&&this._onBlur(t)}}},{key:"_onPaste",value:function(t){if(t.preventDefault(),!(this.settings.readOnly||this.domElement.readOnly||this.domElement.disabled)){var i,n;window.clipboardData&&window.clipboardData.getData?i=window.clipboardData.getData("Text"):t.clipboardData&&t.clipboardData.getData?i=t.clipboardData.getData("text/plain"):h.throwError("Unable to retrieve the pasted value. Please use a modern browser (ie. Firefox or Chromium)."),n=t.target.tagName?t.target:t.explicitOriginalTarget;var a=h.getElementValue(n),r=n.selectionStart||0,s=n.selectionEnd||0,o=s-r;if(o===a.length){var l=this._preparePastedText(i),u=h.arabicToLatinNumbers(l,!1,!1,!1);return"."===u||""===u||"."!==u&&!h.isNumber(u)?(this.formatted=!0,void(this.settings.onInvalidPaste===e.options.onInvalidPaste.error&&h.throwError("The pasted value '".concat(i,"' is not a valid paste content.")))):(this.set(u),this.formatted=!0,void this._triggerEvent(e.events.native.input,n))}var c=h.isNegativeStrict(i,this.settings.negativeSignCharacter);c&&(i=i.slice(1,i.length));var m,g,d=this._preparePastedText(i);if("."!==(m="."===d?".":h.arabicToLatinNumbers(d,!1,!1,!1))&&(!h.isNumber(m)||""===m))return this.formatted=!0,void(this.settings.onInvalidPaste===e.options.onInvalidPaste.error&&h.throwError("The pasted value '".concat(i,"' is not a valid paste content.")));var v,p,f=h.isNegativeStrict(this.getNumericString(),this.settings.negativeSignCharacter);v=!(!c||f)&&(f=!0);var y=a.slice(0,r),S=a.slice(s,a.length);p=r!==s?this._preparePastedText(y+S):this._preparePastedText(a),f&&(p=h.setRawNegativeSign(p)),g=h.convertCharacterCountToIndexPosition(h.countNumberCharactersOnTheCaretLeftSide(a,r,this.settings.decimalCharacter)),v&&g++;var b=p.slice(0,g),w=p.slice(g,p.length),P=!1;"."===m&&(h.contains(b,".")&&(P=!0,b=b.replace(".","")),w=w.replace(".",""));var O=!1;switch(""===b&&"-"===w&&(b="-",O=!(w="")),this.settings.onInvalidPaste){case e.options.onInvalidPaste.truncate:case e.options.onInvalidPaste.replace:for(var k=h.parseStr(this.settings.minimumValue),N=h.parseStr(this.settings.maximumValue),E=p,_=0,C=b;_<m.length&&(p=(C+=m[_])+w,this.constructor._checkIfInRange(p,k,N));)E=p,_++;if(g+=_,O&&g++,this.settings.onInvalidPaste===e.options.onInvalidPaste.truncate){p=E,P&&g--;break}for(var F=g,x=E.length;_<m.length&&F<x;)if("."!==E[F]){if(p=h.replaceCharAt(E,F,m[_]),!this.constructor._checkIfInRange(p,k,N))break;E=p,_++,F++}else F++;g=F,P&&g--,p=E;break;case e.options.onInvalidPaste.error:case e.options.onInvalidPaste.ignore:case e.options.onInvalidPaste.clamp:default:if(p="".concat(b).concat(m).concat(w),r===s)g=h.convertCharacterCountToIndexPosition(h.countNumberCharactersOnTheCaretLeftSide(a,r,this.settings.decimalCharacter))+m.length;else if(""===w)g=h.convertCharacterCountToIndexPosition(h.countNumberCharactersOnTheCaretLeftSide(a,r,this.settings.decimalCharacter))+m.length,O&&g++;else{var V=h.convertCharacterCountToIndexPosition(h.countNumberCharactersOnTheCaretLeftSide(a,s,this.settings.decimalCharacter)),T=h.getElementValue(n).slice(r,s);g=V-o+h.countCharInText(this.settings.digitGroupSeparator,T)+m.length}v&&g++,P&&g--}if(h.isNumber(p)&&""!==p){var A=!1,L=!1;try{this.set(p),A=!0}catch(t){var I;switch(this.settings.onInvalidPaste){case e.options.onInvalidPaste.clamp:I=h.clampToRangeLimits(p,this.settings);try{this.set(I)}catch(t){h.throwError("Fatal error: Unable to set the clamped value '".concat(I,"'."))}A=L=!0,p=I;break;case e.options.onInvalidPaste.error:case e.options.onInvalidPaste.truncate:case e.options.onInvalidPaste.replace:h.throwError("The pasted value '".concat(i,"' results in a value '").concat(p,"' that is outside of the minimum [").concat(this.settings.minimumValue,"] and maximum [").concat(this.settings.maximumValue,"] value range."));case e.options.onInvalidPaste.ignore:default:return}}var B,M=h.getElementValue(n);if(A)switch(this.settings.onInvalidPaste){case e.options.onInvalidPaste.clamp:if(L){this.settings.currencySymbolPlacement===e.options.currencySymbolPlacement.suffix?h.setElementSelection(n,M.length-this.settings.currencySymbol.length):h.setElementSelection(n,M.length);break}case e.options.onInvalidPaste.error:case e.options.onInvalidPaste.ignore:case e.options.onInvalidPaste.truncate:case e.options.onInvalidPaste.replace:default:B=h.findCaretPositionInFormattedNumber(p,g,M,this.settings.decimalCharacter),h.setElementSelection(n,B)}A&&a!==M&&this._triggerEvent(e.events.native.input,n)}else this.settings.onInvalidPaste===e.options.onInvalidPaste.error&&h.throwError("The pasted value '".concat(i,"' would result into an invalid content '").concat(p,"'."))}}},{key:"_onBlur",value:function(t){this.isFocused=!1,this.isEditing=!1,this.rawValue!==this.rawValueOnFocus&&this._triggerEvent(e.events.native.change,t.target),this.rawValueOnFocus=void 0}},{key:"_onWheel",value:function(t){this.formulaMode||this.settings.readOnly||this.domElement.readOnly||this.domElement.disabled||this.settings.modifyValueOnWheel&&(this.settings.wheelOn===e.options.wheelOn.focus?this.isFocused?t.shiftKey||this.wheelAction(t):t.shiftKey&&this.wheelAction(t):this.settings.wheelOn===e.options.wheelOn.hover?t.shiftKey?(t.preventDefault(),window.scrollBy(0,h.isNegativeStrict(String(t.deltaY))?-50:50)):this.wheelAction(t):h.throwError("Unknown `wheelOn` option."))}},{key:"wheelAction",value:function(t){this.isWheelEvent=!0;var i,n=t.target.selectionStart||0,a=t.target.selectionEnd||0,r=this.rawValue;if(h.isUndefinedOrNullOrEmpty(r)?0<this.settings.minimumValue||this.settings.maximumValue<0?h.isWheelUpEvent(t)?i=this.settings.minimumValue:h.isWheelDownEvent(t)?i=this.settings.maximumValue:h.throwError("The event is not a 'wheel' event."):i=0:i=r,i=+i,h.isNumber(this.settings.wheelStep)){var s=+this.settings.wheelStep;h.isWheelUpEvent(t)?i+=s:h.isWheelDownEvent(t)&&(i-=s)}else h.isWheelUpEvent(t)?i=h.addAndRoundToNearestAuto(i,this.settings.decimalPlacesRawValue):h.isWheelDownEvent(t)&&(i=h.subtractAndRoundToNearestAuto(i,this.settings.decimalPlacesRawValue));(i=h.clampToRangeLimits(i,this.settings))!==+r&&(this.set(i),this._triggerEvent(e.events.native.input,t.target)),t.preventDefault(),this._setSelection(n,a),this.isWheelEvent=!1}},{key:"_onDrop",value:function(e){if(!this.formulaMode){var t;this.isDropEvent=!0,e.preventDefault(),t=h.isIE11()?"text":"text/plain";var i=e.dataTransfer.getData(t),n=this.unformatOther(i);this.set(n),this.isDropEvent=!1}}},{key:"_onFormSubmit",value:function(){var e=this;return this._getFormAutoNumericChildren(this.parentForm).map((function(t){return e.constructor.getAutoNumericElement(t)})).forEach((function(e){return e._unformatOnSubmit()})),!0}},{key:"_onFormReset",value:function(){var e=this;this._getFormAutoNumericChildren(this.parentForm).map((function(t){return e.constructor.getAutoNumericElement(t)})).forEach((function(t){var i=e._getDefaultValue(t.node());setTimeout((function(){return t.set(i)}),0)}))}},{key:"_unformatOnSubmit",value:function(){this.settings.unformatOnSubmit&&this._setElementValue(this.rawValue)}},{key:"_onKeydownGlobal",value:function(t){if(h.character(t)===a.keyName.Alt){var i=h.getHoveredElement();if(e.isManagedByAutoNumeric(i)){var n=e.getAutoNumericElement(i);!n.formulaMode&&n.settings.unformatOnHover&&this.constructor._unformatAltHovered(n)}}}},{key:"_onKeyupGlobal",value:function(t){if(h.character(t)===a.keyName.Alt){var i=h.getHoveredElement();if(e.isManagedByAutoNumeric(i)){var n=e.getAutoNumericElement(i);if(n.formulaMode||!n.settings.unformatOnHover)return;this.constructor._reformatAltHovered(n)}}}},{key:"_isElementTagSupported",value:function(){return h.isElement(this.domElement)||h.throwError("The DOM element is not valid, ".concat(this.domElement," given.")),h.isInArray(this.domElement.tagName.toLowerCase(),this.allowedTagList)}},{key:"_isInputElement",value:function(){return"input"===this.domElement.tagName.toLowerCase()}},{key:"_isInputTypeSupported",value:function(){return"text"===this.domElement.type||"hidden"===this.domElement.type||"tel"===this.domElement.type||h.isUndefinedOrNullOrEmpty(this.domElement.type)}},{key:"_checkElement",value:function(){var e=this.domElement.tagName.toLowerCase();this._isElementTagSupported()||h.throwError("The <".concat(e,"> tag is not supported by autoNumeric")),this._isInputElement()?(this._isInputTypeSupported()||h.throwError('The input type "'.concat(this.domElement.type,'" is not supported by autoNumeric')),this.isInputElement=!0):(this.isInputElement=!1,this.isContentEditable=this.domElement.hasAttribute("contenteditable")&&"true"===this.domElement.getAttribute("contenteditable"))}},{key:"_formatDefaultValueOnPageLoad",value:function(t){var i,n=0<arguments.length&&void 0!==t?t:null,a=!0;if(h.isNull(n)?(i=h.getElementValue(this.domElement).trim(),this.domElement.setAttribute("value",i)):i=n,this.isInputElement||this.isContentEditable){var r=this.constructor._toNumericValue(i,this.settings);if(this.domElement.hasAttribute("value")&&""!==this.domElement.getAttribute("value")){if(null!==this.settings.defaultValueOverride&&this.settings.defaultValueOverride.toString()!==i||null===this.settings.defaultValueOverride&&""!==i&&i!==this.domElement.getAttribute("value")||""!==i&&"hidden"===this.domElement.getAttribute("type")&&!h.isNumber(r)){if(this.settings.saveValueToSessionStorage&&(null!==this.settings.decimalPlacesShownOnFocus||this.settings.divisorWhenUnfocused)&&this._setRawValue(this._getValueFromPersistentStorage()),!this.settings.saveValueToSessionStorage){var s=this.constructor._removeBrackets(i,this.settings);(this.settings.negativePositiveSignPlacement===e.options.negativePositiveSignPlacement.suffix||this.settings.negativePositiveSignPlacement!==e.options.negativePositiveSignPlacement.prefix&&this.settings.currencySymbolPlacement===e.options.currencySymbolPlacement.suffix)&&""!==this.settings.negativeSignCharacter&&h.isNegative(i,this.settings.negativeSignCharacter)?this._setRawValue("-".concat(this.constructor._stripAllNonNumberCharacters(s,this.settings,!0,this.isFocused))):this._setRawValue(this.constructor._stripAllNonNumberCharacters(s,this.settings,!0,this.isFocused))}a=!1}}else isNaN(Number(r))||1/0===r?h.throwError("The value [".concat(i,"] used in the input is not a valid value autoNumeric can work with.")):(this.set(r),a=!1);if(""===i)switch(this.settings.emptyInputBehavior){case e.options.emptyInputBehavior.focus:case e.options.emptyInputBehavior.null:case e.options.emptyInputBehavior.press:break;case e.options.emptyInputBehavior.always:this._setElementValue(this.settings.currencySymbol);break;case e.options.emptyInputBehavior.min:this.set(this.settings.minimumValue);break;case e.options.emptyInputBehavior.max:this.set(this.settings.maximumValue);break;case e.options.emptyInputBehavior.zero:this.set("0");break;default:this.set(this.settings.emptyInputBehavior)}else a&&i===this.domElement.getAttribute("value")&&this.set(i)}else null!==this.settings.defaultValueOverride&&this.settings.defaultValueOverride!==i||this.set(i)}},{key:"_calculateVMinAndVMaxIntegerSizes",value:function(){var e=y(this.settings.maximumValue.toString().split("."),1)[0],t=y(this.settings.minimumValue||0===this.settings.minimumValue?this.settings.minimumValue.toString().split("."):[],1)[0];e=e.replace(this.settings.negativeSignCharacter,""),t=t.replace(this.settings.negativeSignCharacter,""),this.settings.mIntPos=Math.max(e.length,1),this.settings.mIntNeg=Math.max(t.length,1)}},{key:"_calculateValuesToStringsKeys",value:function(){this.settings.valuesToStrings?this.valuesToStringsKeys=Object.keys(this.settings.valuesToStrings):this.valuesToStringsKeys=[]}},{key:"_transformOptionsValuesToDefaultTypes",value:function(){for(var e in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,e)){var t=this.settings[e];"true"!==t&&"false"!==t||(this.settings[e]="true"===t),"number"==typeof t&&(this.settings[e]=t.toString())}}},{key:"_setSettings",value:function(e,t){var i=1<arguments.length&&void 0!==t&&t;!i&&h.isNull(e)||this.constructor._convertOldOptionsToNewOnes(e),i?("decimalPlacesRawValue"in e&&(this.settings.originalDecimalPlacesRawValue=e.decimalPlacesRawValue),"decimalPlaces"in e&&(this.settings.originalDecimalPlaces=e.decimalPlaces),this.constructor._calculateDecimalPlacesOnUpdate(e,this.settings),this._mergeSettings(e)):(this.settings={},this._mergeSettings(this.constructor.getDefaultConfig(),this.domElement.dataset,e,{rawValue:this.defaultRawValue}),this.caretFix=!1,this.throwInput=!0,this.allowedTagList=a.allowedTagList,this.runOnce=!1,this.hoveredWithAlt=!1),this._transformOptionsValuesToDefaultTypes(),this._runCallbacksFoundInTheSettingsObject(),this.constructor._correctNegativePositiveSignPlacementOption(this.settings),this.constructor._correctCaretPositionOnFocusAndSelectOnFocusOptions(this.settings),this.constructor._setNegativePositiveSignPermissions(this.settings),i||(h.isNull(e)||!e.decimalPlaces?this.settings.originalDecimalPlaces=null:this.settings.originalDecimalPlaces=e.decimalPlaces,this.settings.originalDecimalPlacesRawValue=this.settings.decimalPlacesRawValue,this.constructor._calculateDecimalPlacesOnInit(this.settings)),this._calculateVMinAndVMaxIntegerSizes(),this._setTrailingNegativeSignInfo(),this.regex={},this.constructor._cachesUsualRegularExpressions(this.settings,this.regex),this.constructor._setBrackets(this.settings),this._calculateValuesToStringsKeys(),h.isEmptyObj(this.settings)&&h.throwError("Unable to set the settings, those are invalid ; an empty object was given."),this.constructor.validate(this.settings,!1,e),this._keepAnOriginalSettingsCopy()}},{key:"_preparePastedText",value:function(e){return this.constructor._stripAllNonNumberCharacters(e,this.settings,!0,this.isFocused)}},{key:"_updateInternalProperties",value:function(){this.selection=h.getElementSelection(this.domElement),this.processed=!1}},{key:"_updateEventKeyInfo",value:function(e){this.eventKey=h.character(e)}},{key:"_saveCancellableValue",value:function(){this.savedCancellableValue=this.rawValue}},{key:"_setSelection",value:function(e,t){e=Math.max(e,0),t=Math.min(t,h.getElementValue(this.domElement).length),this.selection={start:e,end:t,length:t-e},h.setElementSelection(this.domElement,e,t)}},{key:"_setCaretPosition",value:function(e){this._setSelection(e,e)}},{key:"_getLeftAndRightPartAroundTheSelection",value:function(){var e=h.getElementValue(this.domElement);return[e.substring(0,this.selection.start),e.substring(this.selection.end,e.length)]}},{key:"_getUnformattedLeftAndRightPartAroundTheSelection",value:function(){var t=y(this._getLeftAndRightPartAroundTheSelection(),2),i=t[0],n=t[1];if(""===i&&""===n)return["",""];var r=!0;return this.eventKey!==a.keyName.Hyphen&&this.eventKey!==a.keyName.Minus||0!==Number(i)||(r=!1),this.isTrailingNegative&&(h.isNegative(n,this.settings.negativeSignCharacter)&&!h.isNegative(i,this.settings.negativeSignCharacter)||""===n&&h.isNegative(i,this.settings.negativeSignCharacter,!0))&&(i=i.replace(this.settings.negativeSignCharacter,""),n=n.replace(this.settings.negativeSignCharacter,""),i=i.replace("-",""),n=n.replace("-",""),i="-".concat(i)),[i=e._stripAllNonNumberCharactersExceptCustomDecimalChar(i,this.settings,r,this.isFocused),n=e._stripAllNonNumberCharactersExceptCustomDecimalChar(n,this.settings,!1,this.isFocused)]}},{key:"_normalizeParts",value:function(t,i){var n=!0;this.eventKey!==a.keyName.Hyphen&&this.eventKey!==a.keyName.Minus||0!==Number(t)||(n=!1),this.isTrailingNegative&&h.isNegative(i,this.settings.negativeSignCharacter)&&!h.isNegative(t,this.settings.negativeSignCharacter)&&(t="-".concat(t),i=i.replace(this.settings.negativeSignCharacter,"")),t=e._stripAllNonNumberCharactersExceptCustomDecimalChar(t,this.settings,n,this.isFocused),i=e._stripAllNonNumberCharactersExceptCustomDecimalChar(i,this.settings,!1,this.isFocused),this.settings.leadingZero!==e.options.leadingZero.deny||this.eventKey!==a.keyName.num0&&this.eventKey!==a.keyName.numpad0||0!==Number(t)||h.contains(t,this.settings.decimalCharacter)||""===i||(t=t.substring(0,t.length-1));var r=t+i;if(this.settings.decimalCharacter){var s=r.match(new RegExp("^".concat(this.regex.aNegRegAutoStrip,"\\").concat(this.settings.decimalCharacter)));s&&(r=(t=t.replace(s[1],s[1]+"0"))+i)}return[t,i,r]}},{key:"_setValueParts",value:function(t,i,n){var a=2<arguments.length&&void 0!==n&&n,r=y(this._normalizeParts(t,i),3),s=r[0],o=r[1],l=r[2],u=y(e._checkIfInRangeWithOverrideOption(l,this.settings),2),c=u[0],h=u[1];if(c&&h){var m=e._truncateDecimalPlaces(l,this.settings,a,this.settings.decimalPlacesRawValue).replace(this.settings.decimalCharacter,".");if(""===m||m===this.settings.negativeSignCharacter){var g;switch(this.settings.emptyInputBehavior){case e.options.emptyInputBehavior.focus:case e.options.emptyInputBehavior.press:case e.options.emptyInputBehavior.always:g="";break;case e.options.emptyInputBehavior.min:g=this.settings.minimumValue;break;case e.options.emptyInputBehavior.max:g=this.settings.maximumValue;break;case e.options.emptyInputBehavior.zero:g="0";break;case e.options.emptyInputBehavior.null:g=null;break;default:g=this.settings.emptyInputBehavior}this._setRawValue(g)}else this._setRawValue(this._trimLeadingAndTrailingZeros(m));var d=e._truncateDecimalPlaces(l,this.settings,a,this.settings.decimalPlacesShownOnFocus),v=s.length;return v>d.length&&(v=d.length),1===v&&"0"===s&&this.settings.leadingZero===e.options.leadingZero.deny&&(v=""===o||"0"===s&&""!==o?1:0),this._setElementValue(d,!1),this._setCaretPosition(v),!0}return this._triggerRangeEvents(c,h),!1}},{key:"_getSignPosition",value:function(){var t;if(this.settings.currencySymbol){var i=this.settings.currencySymbol.length,n=h.getElementValue(this.domElement);if(this.settings.currencySymbolPlacement===e.options.currencySymbolPlacement.prefix)t=this.settings.negativeSignCharacter&&n&&n.charAt(0)===this.settings.negativeSignCharacter?[1,i+1]:[0,i];else{var a=n.length;t=[a-i,a]}}else t=[1e3,-1];return t}},{key:"_expandSelectionOnSign",value:function(){var e=y(this._getSignPosition(),2),t=e[0],i=e[1],n=this.selection;n.start<i&&n.end>t&&((n.start<t||n.end>i)&&h.getElementValue(this.domElement).substring(Math.max(n.start,t),Math.min(n.end,i)).match(/^\s*$/)?n.start<t?this._setSelection(n.start,t):this._setSelection(i,n.end):this._setSelection(Math.min(n.start,t),Math.max(n.end,i)))}},{key:"_checkPaste",value:function(){if(!this.formatted&&!h.isUndefined(this.valuePartsBeforePaste)){var t=this.valuePartsBeforePaste,i=y(this._getLeftAndRightPartAroundTheSelection(),2),n=i[0],a=i[1];delete this.valuePartsBeforePaste;var r=n.substr(0,t[0].length)+e._stripAllNonNumberCharactersExceptCustomDecimalChar(n.substr(t[0].length),this.settings,!0,this.isFocused);this._setValueParts(r,a,!0)||(this._setElementValue(t.join(""),!1),this._setCaretPosition(t[0].length))}}},{key:"_processNonPrintableKeysAndShortcuts",value:function(e){if((e.ctrlKey||e.metaKey)&&"keyup"===e.type&&!h.isUndefined(this.valuePartsBeforePaste)||e.shiftKey&&this.eventKey===a.keyName.Insert)return this._checkPaste(),!1;if(this.constructor._shouldSkipEventKey(this.eventKey))return!0;if((e.ctrlKey||e.metaKey)&&this.eventKey===a.keyName.a)return this.settings.selectNumberOnly&&(e.preventDefault(),this.selectNumber()),!0;if((e.ctrlKey||e.metaKey)&&(this.eventKey===a.keyName.c||this.eventKey===a.keyName.v||this.eventKey===a.keyName.x))return"keydown"===e.type&&this._expandSelectionOnSign(),this.eventKey!==a.keyName.v&&this.eventKey!==a.keyName.Insert||("keydown"===e.type||"keypress"===e.type?h.isUndefined(this.valuePartsBeforePaste)&&(this.valuePartsBeforePaste=this._getLeftAndRightPartAroundTheSelection()):this._checkPaste()),"keydown"===e.type||"keypress"===e.type||this.eventKey===a.keyName.c;if(e.ctrlKey||e.metaKey)return!(this.eventKey===a.keyName.Z||this.eventKey===a.keyName.z);if(this.eventKey!==a.keyName.LeftArrow&&this.eventKey!==a.keyName.RightArrow)return h.isInArray(this.eventKey,a.keyName._directionKeys);if("keydown"===e.type&&!e.shiftKey){var t=h.getElementValue(this.domElement);this.eventKey!==a.keyName.LeftArrow||t.charAt(this.selection.start-2)!==this.settings.digitGroupSeparator&&t.charAt(this.selection.start-2)!==this.settings.decimalCharacter?this.eventKey!==a.keyName.RightArrow||t.charAt(this.selection.start+1)!==this.settings.digitGroupSeparator&&t.charAt(this.selection.start+1)!==this.settings.decimalCharacter||this._setCaretPosition(this.selection.start+1):this._setCaretPosition(this.selection.start-1)}return!0}},{key:"_processCharacterDeletionIfTrailingNegativeSign",value:function(t){var i=y(t,2),n=i[0],r=i[1],s=h.getElementValue(this.domElement),o=h.isNegative(s,this.settings.negativeSignCharacter);if(this.settings.currencySymbolPlacement===e.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===e.options.negativePositiveSignPlacement.suffix&&(this.eventKey===a.keyName.Backspace?(this.caretFix=this.selection.start>=s.indexOf(this.settings.suffixText)&&""!==this.settings.suffixText,"-"===s.charAt(this.selection.start-1)?n=n.substring(1):this.selection.start<=s.length-this.settings.suffixText.length&&(n=n.substring(0,n.length-1))):(this.caretFix=this.selection.start>=s.indexOf(this.settings.suffixText)&&""!==this.settings.suffixText,this.selection.start>=s.indexOf(this.settings.currencySymbol)+this.settings.currencySymbol.length&&(r=r.substring(1,r.length)),h.isNegative(n,this.settings.negativeSignCharacter)&&"-"===s.charAt(this.selection.start)&&(n=n.substring(1)))),this.settings.currencySymbolPlacement===e.options.currencySymbolPlacement.suffix)switch(this.settings.negativePositiveSignPlacement){case e.options.negativePositiveSignPlacement.left:this.caretFix=this.selection.start>=s.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length,this.eventKey===a.keyName.Backspace?this.selection.start===s.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length&&o?n=n.substring(1):"-"!==n&&(this.selection.start<=s.indexOf(this.settings.negativeSignCharacter)||!o)&&(n=n.substring(0,n.length-1)):("-"===n[0]&&(r=r.substring(1)),this.selection.start===s.indexOf(this.settings.negativeSignCharacter)&&o&&(n=n.substring(1)));break;case e.options.negativePositiveSignPlacement.right:this.caretFix=this.selection.start>=s.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length,this.eventKey===a.keyName.Backspace?this.selection.start===s.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length?n=n.substring(1):("-"!==n&&this.selection.start<=s.indexOf(this.settings.negativeSignCharacter)-this.settings.currencySymbol.length||""!==n&&!o)&&(n=n.substring(0,n.length-1)):(this.caretFix=this.selection.start>=s.indexOf(this.settings.currencySymbol)&&""!==this.settings.currencySymbol,this.selection.start===s.indexOf(this.settings.negativeSignCharacter)&&(n=n.substring(1)),r=r.substring(1))}return[n,r]}},{key:"_processCharacterDeletion",value:function(){var e,t;if(this.selection.length){this._expandSelectionOnSign();var i=y(this._getUnformattedLeftAndRightPartAroundTheSelection(),2);e=i[0],t=i[1]}else{var n=y(this._getUnformattedLeftAndRightPartAroundTheSelection(),2);if(e=n[0],t=n[1],""===e&&""===t&&(this.throwInput=!1),this.isTrailingNegative&&h.isNegative(h.getElementValue(this.domElement),this.settings.negativeSignCharacter)){var r=y(this._processCharacterDeletionIfTrailingNegativeSign([e,t]),2);e=r[0],t=r[1]}else this.eventKey===a.keyName.Backspace?e=e.substring(0,e.length-1):t=t.substring(1,t.length)}return!!this.constructor._isWithinRangeWithOverrideOption("".concat(e).concat(t),this.settings)&&(this._setValueParts(e,t),!0)}},{key:"_isDecimalCharacterInsertionAllowed",value:function(){return String(this.settings.decimalPlacesShownOnFocus)!==String(e.options.decimalPlacesShownOnFocus.none)&&String(this.settings.decimalPlaces)!==String(e.options.decimalPlaces.none)}},{key:"_processCharacterInsertion",value:function(){var e=y(this._getUnformattedLeftAndRightPartAroundTheSelection(),2),t=e[0],i=e[1];if(this.eventKey!==a.keyName.AndroidDefault&&(this.throwInput=!0),this.eventKey===this.settings.decimalCharacter||this.settings.decimalCharacterAlternative&&this.eventKey===this.settings.decimalCharacterAlternative){if(!this._isDecimalCharacterInsertionAllowed()||!this.settings.decimalCharacter)return!1;if(this.settings.alwaysAllowDecimalCharacter)t=t.replace(this.settings.decimalCharacter,""),i=i.replace(this.settings.decimalCharacter,"");else{if(h.contains(t,this.settings.decimalCharacter))return!0;if(0<i.indexOf(this.settings.decimalCharacter))return!0;0===i.indexOf(this.settings.decimalCharacter)&&(i=i.substr(1))}return this.settings.negativeSignCharacter&&h.contains(i,this.settings.negativeSignCharacter)&&(t="".concat(this.settings.negativeSignCharacter).concat(t),i=i.replace(this.settings.negativeSignCharacter,"")),this._setValueParts(t+this.settings.decimalCharacter,i),!0}if(("-"===this.eventKey||"+"===this.eventKey)&&this.settings.isNegativeSignAllowed)return""===t&&h.contains(i,"-")?i=i.replace("-",""):t=h.isNegativeStrict(t,"-")?t.replace("-",""):"".concat(this.settings.negativeSignCharacter).concat(t),this._setValueParts(t,i),!0;var n=Number(this.eventKey);return 0<=n&&n<=9?(this.settings.isNegativeSignAllowed&&""===t&&h.contains(i,"-")&&(t="-",i=i.substring(1,i.length)),this.settings.maximumValue<=0&&this.settings.minimumValue<this.settings.maximumValue&&!h.contains(h.getElementValue(this.domElement),this.settings.negativeSignCharacter)&&"0"!==this.eventKey&&(t="-".concat(t)),this._setValueParts("".concat(t).concat(this.eventKey),i),!0):this.throwInput=!1}},{key:"_formatValue",value:function(t){var i=h.getElementValue(this.domElement),n=y(this._getUnformattedLeftAndRightPartAroundTheSelection(),1)[0];if((""===this.settings.digitGroupSeparator||""!==this.settings.digitGroupSeparator&&!h.contains(i,this.settings.digitGroupSeparator))&&(""===this.settings.currencySymbol||""!==this.settings.currencySymbol&&!h.contains(i,this.settings.currencySymbol))){var r=y(i.split(this.settings.decimalCharacter),1)[0],s="";h.isNegative(r,this.settings.negativeSignCharacter)&&(s=this.settings.negativeSignCharacter,r=r.replace(this.settings.negativeSignCharacter,""),n=n.replace("-","")),""===s&&r.length>this.settings.mIntPos&&"0"===n.charAt(0)&&(n=n.slice(1)),s===this.settings.negativeSignCharacter&&r.length>this.settings.mIntNeg&&"0"===n.charAt(0)&&(n=n.slice(1)),this.isTrailingNegative||(n="".concat(s).concat(n))}var o=this.constructor._addGroupSeparators(i,this.settings,this.isFocused,this.rawValue),l=o.length;if(o){var u,c=n.split("");if((this.settings.negativePositiveSignPlacement===e.options.negativePositiveSignPlacement.suffix||this.settings.negativePositiveSignPlacement!==e.options.negativePositiveSignPlacement.prefix&&this.settings.currencySymbolPlacement===e.options.currencySymbolPlacement.suffix)&&c[0]===this.settings.negativeSignCharacter&&!this.settings.isNegativeSignAllowed&&(c.shift(),(this.eventKey===a.keyName.Backspace||this.eventKey===a.keyName.Delete)&&this.caretFix&&((this.settings.currencySymbolPlacement===e.options.currencySymbolPlacement.suffix&&this.settings.negativePositiveSignPlacement===e.options.negativePositiveSignPlacement.left||this.settings.currencySymbolPlacement===e.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===e.options.negativePositiveSignPlacement.suffix)&&(c.push(this.settings.negativeSignCharacter),this.caretFix="keydown"===t.type),this.settings.currencySymbolPlacement===e.options.currencySymbolPlacement.suffix&&this.settings.negativePositiveSignPlacement===e.options.negativePositiveSignPlacement.right))){var m=this.settings.currencySymbol.split(""),g=["\\","^","$",".","|","?","*","+","(",")","["],d=[];m.forEach((function(e,t){t=m[e],h.isInArray(t,g)?d.push("\\"+t):d.push(t)})),this.eventKey===a.keyName.Backspace&&"-"===this.settings.negativeSignCharacter&&d.push("-"),c.push(d.join("")),this.caretFix="keydown"===t.type}for(var v=0;v<c.length;v++)c[v].match("\\d")||(c[v]="\\"+c[v]);u=this.settings.currencySymbolPlacement===e.options.currencySymbolPlacement.suffix?new RegExp("^.*?".concat(c.join(".*?"))):new RegExp("^.*?".concat(this.settings.currencySymbol).concat(c.join(".*?")));var p=o.match(u);p?(l=p[0].length,this.settings.showPositiveSign&&(0===l&&p.input.charAt(0)===this.settings.positiveSignCharacter&&(l=1===p.input.indexOf(this.settings.currencySymbol)?this.settings.currencySymbol.length+1:1),0===l&&p.input.charAt(this.settings.currencySymbol.length)===this.settings.positiveSignCharacter&&(l=this.settings.currencySymbol.length+1)),(0===l&&o.charAt(0)!==this.settings.negativeSignCharacter||1===l&&o.charAt(0)===this.settings.negativeSignCharacter)&&this.settings.currencySymbol&&this.settings.currencySymbolPlacement===e.options.currencySymbolPlacement.prefix&&(l=this.settings.currencySymbol.length+(h.isNegativeStrict(o,this.settings.negativeSignCharacter)?1:0))):(this.settings.currencySymbol&&this.settings.currencySymbolPlacement===e.options.currencySymbolPlacement.suffix&&(l-=this.settings.currencySymbol.length),this.settings.suffixText&&(l-=this.settings.suffixText.length))}o!==i&&(this._setElementValue(o,!1),this._setCaretPosition(l)),this.formatted=!0}}]),O(t,i),e}();function E(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var i=document.createEvent("CustomEvent");return i.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),i}N.multiple=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,n=[];if(h.isObject(t)&&(i=t,t=null),h.isString(e))e=f(document.querySelectorAll(e));else if(h.isObject(e)){Object.prototype.hasOwnProperty.call(e,"rootElement")||h.throwError("The object passed to the 'multiple' function is invalid ; no 'rootElement' attribute found.");var a=f(e.rootElement.querySelectorAll("input"));e=Object.prototype.hasOwnProperty.call(e,"exclude")?(Array.isArray(e.exclude)||h.throwError("The 'exclude' array passed to the 'multiple' function is invalid."),h.filterOut(a,e.exclude)):a}else h.isArray(e)||h.throwError("The given parameters to the 'multiple' function are invalid.");if(0===e.length){var r=!0;return!h.isNull(i)&&h.isBoolean(i.showWarnings)&&(r=i.showWarnings),h.warning("No valid DOM elements were given hence no AutoNumeric objects were instantiated.",r),[]}var s=h.isArray(t)&&1<=t.length,o=!1,l=!1;if(s){var u=P(Number(t[0]));(o="number"===u&&!isNaN(Number(t[0])))||"string"!==u&&!isNaN(u)&&"object"!==u||(l=!0)}var c,m=!1;if(h.isArray(i)&&1<=i.length){var g=P(i[0]);"string"!==g&&"object"!==g||(m=!0)}c=l?N.mergeOptions(t):m?N.mergeOptions(i):i;var d,v=h.isNumber(t);return o&&(d=t.length),e.forEach((function(e,i){v?n.push(new N(e,t,c)):o&&i<=d?n.push(new N(e,t[i],c)):n.push(new N(e,null,c))})),n},Array.from||(Array.from=function(e){return[].slice.call(e)}),"undefined"!=typeof window&&"function"!=typeof window.CustomEvent&&(E.prototype=window.Event.prototype,window.CustomEvent=E),N.events={correctedValue:"autoNumeric:correctedValue",initialized:"autoNumeric:initialized",invalidFormula:"autoNumeric:invalidFormula",invalidValue:"autoNumeric:invalidValue",formatted:"autoNumeric:formatted",rawValueModified:"autoNumeric:rawValueModified",minRangeExceeded:"autoNumeric:minExceeded",maxRangeExceeded:"autoNumeric:maxExceeded",native:{input:"input",change:"change"},validFormula:"autoNumeric:validFormula"},Object.freeze(N.events.native),Object.freeze(N.events),Object.defineProperty(N,"events",{configurable:!1,writable:!1}),N.options={allowDecimalPadding:{always:!0,never:!1,floats:"floats"},alwaysAllowDecimalCharacter:{alwaysAllow:!0,doNotAllow:!1},caretPositionOnFocus:{start:"start",end:"end",decimalLeft:"decimalLeft",decimalRight:"decimalRight",doNoForceCaretPosition:null},createLocalList:{createList:!0,doNotCreateList:!1},currencySymbol:{none:"",currencySign:"¤",austral:"₳",australCentavo:"¢",baht:"฿",cedi:"₵",cent:"¢",colon:"₡",cruzeiro:"₢",dollar:"$",dong:"₫",drachma:"₯",dram:"​֏",european:"₠",euro:"€",florin:"ƒ",franc:"₣",guarani:"₲",hryvnia:"₴",kip:"₭",att:"ອັດ",lepton:"Λ.",lira:"₺",liraOld:"₤",lari:"₾",mark:"ℳ",mill:"₥",naira:"₦",peseta:"₧",peso:"₱",pfennig:"₰",pound:"£",real:"R$",riel:"៛",ruble:"₽",rupee:"₹",rupeeOld:"₨",shekel:"₪",shekelAlt:"ש״ח‎‎",taka:"৳",tenge:"₸",togrog:"₮",won:"₩",yen:"¥"},currencySymbolPlacement:{prefix:"p",suffix:"s"},decimalCharacter:{comma:",",dot:".",middleDot:"·",arabicDecimalSeparator:"٫",decimalSeparatorKeySymbol:"⎖"},decimalCharacterAlternative:{none:null,comma:",",dot:"."},decimalPlaces:{none:0,one:1,two:2,three:3,four:4,five:5,six:6},decimalPlacesRawValue:{useDefault:null,none:0,one:1,two:2,three:3,four:4,five:5,six:6},decimalPlacesShownOnBlur:{useDefault:null,none:0,one:1,two:2,three:3,four:4,five:5,six:6},decimalPlacesShownOnFocus:{useDefault:null,none:0,one:1,two:2,three:3,four:4,five:5,six:6},defaultValueOverride:{doNotOverride:null},digitalGroupSpacing:{two:"2",twoScaled:"2s",three:"3",four:"4"},digitGroupSeparator:{comma:",",dot:".",normalSpace:" ",thinSpace:" ",narrowNoBreakSpace:" ",noBreakSpace:" ",noSeparator:"",apostrophe:"'",arabicThousandsSeparator:"٬",dotAbove:"˙",privateUseTwo:"’"},divisorWhenUnfocused:{none:null,percentage:100,permille:1e3,basisPoint:1e4},emptyInputBehavior:{focus:"focus",press:"press",always:"always",zero:"zero",min:"min",max:"max",null:"null"},eventBubbles:{bubbles:!0,doesNotBubble:!1},eventIsCancelable:{isCancelable:!0,isNotCancelable:!1},failOnUnknownOption:{fail:!0,ignore:!1},formatOnPageLoad:{format:!0,doNotFormat:!1},formulaMode:{enabled:!0,disabled:!1},historySize:{verySmall:5,small:10,medium:20,large:50,veryLarge:100,insane:Number.MAX_SAFE_INTEGER},invalidClass:"an-invalid",isCancellable:{cancellable:!0,notCancellable:!1},leadingZero:{allow:"allow",deny:"deny",keep:"keep"},maximumValue:{tenTrillions:"10000000000000",oneBillion:"1000000000",zero:"0"},minimumValue:{tenTrillions:"-10000000000000",oneBillion:"-1000000000",zero:"0"},modifyValueOnWheel:{modifyValue:!0,doNothing:!1},negativeBracketsTypeOnBlur:{parentheses:"(,)",brackets:"[,]",chevrons:"<,>",curlyBraces:"{,}",angleBrackets:"〈,〉",japaneseQuotationMarks:"｢,｣",halfBrackets:"⸤,⸥",whiteSquareBrackets:"⟦,⟧",quotationMarks:"‹,›",guillemets:"«,»",none:null},negativePositiveSignPlacement:{prefix:"p",suffix:"s",left:"l",right:"r",none:null},negativeSignCharacter:{hyphen:"-",minus:"−",heavyMinus:"➖",fullWidthHyphen:"－",circledMinus:"⊖",squaredMinus:"⊟",triangleMinus:"⨺",plusMinus:"±",minusPlus:"∓",dotMinus:"∸",minusTilde:"≂",not:"¬"},noEventListeners:{noEvents:!0,addEvents:!1},onInvalidPaste:{error:"error",ignore:"ignore",clamp:"clamp",truncate:"truncate",replace:"replace"},outputFormat:{string:"string",number:"number",dot:".",negativeDot:"-.",comma:",",negativeComma:"-,",dotNegative:".-",commaNegative:",-",none:null},overrideMinMaxLimits:{ceiling:"ceiling",floor:"floor",ignore:"ignore",invalid:"invalid",doNotOverride:null},positiveSignCharacter:{plus:"+",fullWidthPlus:"＋",heavyPlus:"➕",doublePlus:"⧺",triplePlus:"⧻",circledPlus:"⊕",squaredPlus:"⊞",trianglePlus:"⨹",plusMinus:"±",minusPlus:"∓",dotPlus:"∔",altHebrewPlus:"﬩",normalSpace:" ",thinSpace:" ",narrowNoBreakSpace:" ",noBreakSpace:" "},rawValueDivisor:{none:null,percentage:100,permille:1e3,basisPoint:1e4},readOnly:{readOnly:!0,readWrite:!1},roundingMethod:{halfUpSymmetric:"S",halfUpAsymmetric:"A",halfDownSymmetric:"s",halfDownAsymmetric:"a",halfEvenBankersRounding:"B",upRoundAwayFromZero:"U",downRoundTowardZero:"D",toCeilingTowardPositiveInfinity:"C",toFloorTowardNegativeInfinity:"F",toNearest05:"N05",toNearest05Alt:"CHF",upToNext05:"U05",downToNext05:"D05"},saveValueToSessionStorage:{save:!0,doNotSave:!1},selectNumberOnly:{selectNumbersOnly:!0,selectAll:!1},selectOnFocus:{select:!0,doNotSelect:!1},serializeSpaces:{plus:"+",percent:"%20"},showOnlyNumbersOnFocus:{onlyNumbers:!0,showAll:!1},showPositiveSign:{show:!0,hide:!1},showWarnings:{show:!0,hide:!1},styleRules:{none:null,positiveNegative:{positive:"autoNumeric-positive",negative:"autoNumeric-negative"},range0To100With4Steps:{ranges:[{min:0,max:25,class:"autoNumeric-red"},{min:25,max:50,class:"autoNumeric-orange"},{min:50,max:75,class:"autoNumeric-yellow"},{min:75,max:100,class:"autoNumeric-green"}]},evenOdd:{userDefined:[{callback:function(e){return e%2==0},classes:["autoNumeric-even","autoNumeric-odd"]}]},rangeSmallAndZero:{userDefined:[{callback:function(e){return-1<=e&&e<0?0:0===Number(e)?1:0<e&&e<=1?2:null},classes:["autoNumeric-small-negative","autoNumeric-zero","autoNumeric-small-positive"]}]}},suffixText:{none:"",percentage:"%",permille:"‰",basisPoint:"‱"},symbolWhenUnfocused:{none:null,percentage:"%",permille:"‰",basisPoint:"‱"},unformatOnHover:{unformat:!0,doNotUnformat:!1},unformatOnSubmit:{unformat:!0,keepCurrentValue:!1},valuesToStrings:{none:null,zeroDash:{0:"-"},oneAroundZero:{"-1":"Min",1:"Max"}},watchExternalChanges:{watch:!0,doNotWatch:!1},wheelOn:{focus:"focus",hover:"hover"},wheelStep:{progressive:"progressive"}},k=N.options,Object.getOwnPropertyNames(k).forEach((function(e){"valuesToStrings"===e?Object.getOwnPropertyNames(k.valuesToStrings).forEach((function(e){h.isIE11()||null===k.valuesToStrings[e]||Object.freeze(k.valuesToStrings[e])})):"styleRules"!==e&&(h.isIE11()||null===k[e]||Object.freeze(k[e]))})),Object.freeze(k),Object.defineProperty(N,"options",{configurable:!1,writable:!1}),N.defaultSettings={allowDecimalPadding:N.options.allowDecimalPadding.always,alwaysAllowDecimalCharacter:N.options.alwaysAllowDecimalCharacter.doNotAllow,caretPositionOnFocus:N.options.caretPositionOnFocus.doNoForceCaretPosition,createLocalList:N.options.createLocalList.createList,currencySymbol:N.options.currencySymbol.none,currencySymbolPlacement:N.options.currencySymbolPlacement.prefix,decimalCharacter:N.options.decimalCharacter.dot,decimalCharacterAlternative:N.options.decimalCharacterAlternative.none,decimalPlaces:N.options.decimalPlaces.two,decimalPlacesRawValue:N.options.decimalPlacesRawValue.useDefault,decimalPlacesShownOnBlur:N.options.decimalPlacesShownOnBlur.useDefault,decimalPlacesShownOnFocus:N.options.decimalPlacesShownOnFocus.useDefault,defaultValueOverride:N.options.defaultValueOverride.doNotOverride,digitalGroupSpacing:N.options.digitalGroupSpacing.three,digitGroupSeparator:N.options.digitGroupSeparator.comma,divisorWhenUnfocused:N.options.divisorWhenUnfocused.none,emptyInputBehavior:N.options.emptyInputBehavior.focus,eventBubbles:N.options.eventBubbles.bubbles,eventIsCancelable:N.options.eventIsCancelable.isCancelable,failOnUnknownOption:N.options.failOnUnknownOption.ignore,formatOnPageLoad:N.options.formatOnPageLoad.format,formulaMode:N.options.formulaMode.disabled,historySize:N.options.historySize.medium,invalidClass:N.options.invalidClass,isCancellable:N.options.isCancellable.cancellable,leadingZero:N.options.leadingZero.deny,maximumValue:N.options.maximumValue.tenTrillions,minimumValue:N.options.minimumValue.tenTrillions,modifyValueOnWheel:N.options.modifyValueOnWheel.modifyValue,negativeBracketsTypeOnBlur:N.options.negativeBracketsTypeOnBlur.none,negativePositiveSignPlacement:N.options.negativePositiveSignPlacement.none,negativeSignCharacter:N.options.negativeSignCharacter.hyphen,noEventListeners:N.options.noEventListeners.addEvents,onInvalidPaste:N.options.onInvalidPaste.error,outputFormat:N.options.outputFormat.none,overrideMinMaxLimits:N.options.overrideMinMaxLimits.doNotOverride,positiveSignCharacter:N.options.positiveSignCharacter.plus,rawValueDivisor:N.options.rawValueDivisor.none,readOnly:N.options.readOnly.readWrite,roundingMethod:N.options.roundingMethod.halfUpSymmetric,saveValueToSessionStorage:N.options.saveValueToSessionStorage.doNotSave,selectNumberOnly:N.options.selectNumberOnly.selectNumbersOnly,selectOnFocus:N.options.selectOnFocus.select,serializeSpaces:N.options.serializeSpaces.plus,showOnlyNumbersOnFocus:N.options.showOnlyNumbersOnFocus.showAll,showPositiveSign:N.options.showPositiveSign.hide,showWarnings:N.options.showWarnings.show,styleRules:N.options.styleRules.none,suffixText:N.options.suffixText.none,symbolWhenUnfocused:N.options.symbolWhenUnfocused.none,unformatOnHover:N.options.unformatOnHover.unformat,unformatOnSubmit:N.options.unformatOnSubmit.keepCurrentValue,valuesToStrings:N.options.valuesToStrings.none,watchExternalChanges:N.options.watchExternalChanges.doNotWatch,wheelOn:N.options.wheelOn.focus,wheelStep:N.options.wheelStep.progressive},Object.freeze(N.defaultSettings),Object.defineProperty(N,"defaultSettings",{configurable:!1,writable:!1});var _={digitGroupSeparator:N.options.digitGroupSeparator.dot,decimalCharacter:N.options.decimalCharacter.comma,decimalCharacterAlternative:N.options.decimalCharacterAlternative.dot,currencySymbol:" €",currencySymbolPlacement:N.options.currencySymbolPlacement.suffix,negativePositiveSignPlacement:N.options.negativePositiveSignPlacement.prefix},C={digitGroupSeparator:N.options.digitGroupSeparator.comma,decimalCharacter:N.options.decimalCharacter.dot,currencySymbol:N.options.currencySymbol.dollar,currencySymbolPlacement:N.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:N.options.negativePositiveSignPlacement.right},F={digitGroupSeparator:N.options.digitGroupSeparator.comma,decimalCharacter:N.options.decimalCharacter.dot,currencySymbol:N.options.currencySymbol.yen,currencySymbolPlacement:N.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:N.options.negativePositiveSignPlacement.right};h.cloneObject(_).formulaMode=N.options.formulaMode.enabled;var x=h.cloneObject(_);x.minimumValue=0;var V=h.cloneObject(_);V.maximumValue=0,V.negativePositiveSignPlacement=N.options.negativePositiveSignPlacement.prefix;var T=h.cloneObject(_);T.digitGroupSeparator=N.options.digitGroupSeparator.normalSpace;var A=h.cloneObject(T);A.minimumValue=0;var L=h.cloneObject(T);L.maximumValue=0,L.negativePositiveSignPlacement=N.options.negativePositiveSignPlacement.prefix;var I=h.cloneObject(_);I.currencySymbol=N.options.currencySymbol.none,I.suffixText=" ".concat(N.options.suffixText.percentage),I.wheelStep=1e-4,I.rawValueDivisor=N.options.rawValueDivisor.percentage;var B=h.cloneObject(I);B.minimumValue=0;var M=h.cloneObject(I);M.maximumValue=0,M.negativePositiveSignPlacement=N.options.negativePositiveSignPlacement.prefix;var D=h.cloneObject(I);D.decimalPlaces=3;var R=h.cloneObject(B);R.decimalPlaces=3;var U=h.cloneObject(M);U.decimalPlaces=3,h.cloneObject(C).formulaMode=N.options.formulaMode.enabled;var j=h.cloneObject(C);j.minimumValue=0;var z=h.cloneObject(C);z.maximumValue=0,z.negativePositiveSignPlacement=N.options.negativePositiveSignPlacement.prefix;var K=h.cloneObject(z);K.negativeBracketsTypeOnBlur=N.options.negativeBracketsTypeOnBlur.parentheses;var G=h.cloneObject(C);G.currencySymbol=N.options.currencySymbol.none,G.suffixText=N.options.suffixText.percentage,G.wheelStep=1e-4,G.rawValueDivisor=N.options.rawValueDivisor.percentage;var W=h.cloneObject(G);W.minimumValue=0;var H=h.cloneObject(G);H.maximumValue=0,H.negativePositiveSignPlacement=N.options.negativePositiveSignPlacement.prefix;var Z=h.cloneObject(G);Z.decimalPlaces=3;var q=h.cloneObject(W);q.decimalPlaces=3;var $=h.cloneObject(H);$.decimalPlaces=3;var J=h.cloneObject(_);J.currencySymbol=N.options.currencySymbol.lira,N.predefinedOptions={euro:_,euroPos:x,euroNeg:V,euroSpace:T,euroSpacePos:A,euroSpaceNeg:L,percentageEU2dec:I,percentageEU2decPos:B,percentageEU2decNeg:M,percentageEU3dec:D,percentageEU3decPos:R,percentageEU3decNeg:U,dollar:C,dollarPos:j,dollarNeg:z,dollarNegBrackets:K,percentageUS2dec:G,percentageUS2decPos:W,percentageUS2decNeg:H,percentageUS3dec:Z,percentageUS3decPos:q,percentageUS3decNeg:$,French:_,Spanish:_,NorthAmerican:C,British:{digitGroupSeparator:N.options.digitGroupSeparator.comma,decimalCharacter:N.options.decimalCharacter.dot,currencySymbol:N.options.currencySymbol.pound,currencySymbolPlacement:N.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:N.options.negativePositiveSignPlacement.right},Swiss:{digitGroupSeparator:N.options.digitGroupSeparator.apostrophe,decimalCharacter:N.options.decimalCharacter.dot,currencySymbol:" CHF",currencySymbolPlacement:N.options.currencySymbolPlacement.suffix,negativePositiveSignPlacement:N.options.negativePositiveSignPlacement.prefix},Japanese:F,Chinese:F,Brazilian:{digitGroupSeparator:N.options.digitGroupSeparator.dot,decimalCharacter:N.options.decimalCharacter.comma,currencySymbol:N.options.currencySymbol.real,currencySymbolPlacement:N.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:N.options.negativePositiveSignPlacement.right},Turkish:J,dotDecimalCharCommaSeparator:{digitGroupSeparator:N.options.digitGroupSeparator.comma,decimalCharacter:N.options.decimalCharacter.dot},commaDecimalCharDotSeparator:{digitGroupSeparator:N.options.digitGroupSeparator.dot,decimalCharacter:N.options.decimalCharacter.comma,decimalCharacterAlternative:N.options.decimalCharacterAlternative.dot},integer:{decimalPlaces:0},integerPos:{minimumValue:N.options.minimumValue.zero,decimalPlaces:0},integerNeg:{maximumValue:N.options.maximumValue.zero,decimalPlaces:0},float:{allowDecimalPadding:N.options.allowDecimalPadding.never},floatPos:{allowDecimalPadding:N.options.allowDecimalPadding.never,minimumValue:N.options.minimumValue.zero,maximumValue:N.options.maximumValue.tenTrillions},floatNeg:{allowDecimalPadding:N.options.allowDecimalPadding.never,minimumValue:N.options.minimumValue.tenTrillions,maximumValue:N.options.maximumValue.zero},numeric:{digitGroupSeparator:N.options.digitGroupSeparator.noSeparator,decimalCharacter:N.options.decimalCharacter.dot,currencySymbol:N.options.currencySymbol.none},numericPos:{digitGroupSeparator:N.options.digitGroupSeparator.noSeparator,decimalCharacter:N.options.decimalCharacter.dot,currencySymbol:N.options.currencySymbol.none,minimumValue:N.options.minimumValue.zero,maximumValue:N.options.maximumValue.tenTrillions},numericNeg:{digitGroupSeparator:N.options.digitGroupSeparator.noSeparator,decimalCharacter:N.options.decimalCharacter.dot,currencySymbol:N.options.currencySymbol.none,minimumValue:N.options.minimumValue.tenTrillions,maximumValue:N.options.maximumValue.zero}},Object.getOwnPropertyNames(N.predefinedOptions).forEach((function(e){Object.freeze(N.predefinedOptions[e])})),Object.freeze(N.predefinedOptions),Object.defineProperty(N,"predefinedOptions",{configurable:!1,writable:!1}),t.default=N}],e.c=i,e.d=function(t,i,n){e.o(t,i)||Object.defineProperty(t,i,{enumerable:!0,get:n})},e.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},e.t=function(t,i){if(1&i&&(t=e(t)),8&i)return t;if(4&i&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&i&&"string"!=typeof t)for(var a in t)e.d(n,a,function(e){return t[e]}.bind(null,a));return n},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(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e.p="",e(e.s=0).default;function e(n){if(i[n])return i[n].exports;var a=i[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,e),a.l=!0,a.exports}var t,i}()}},t={};function i(n){var a=t[n];if(void 0!==a)return a.exports;var r=t[n]={exports:{}};return e[n].call(r.exports,r,r.exports,i),r.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=jQuery;var t=i.n(e);Shiny;var n=i(9222),a=i.n(n);Shiny.InputBinding.prototype.store=[],Shiny.InputBinding.prototype.updateStore=function(e,t){this.store[e.id]=t};var r=new Shiny.InputBinding;t().extend(r,{find:function(e){return t()(e).find(".autonumeric-input")},initialize:function(e){var i,n,r=t()(e).parent().find('script[data-for="'+e.id+'"]');(r=JSON.parse(r.html())).hasOwnProperty("format")?(i=new(a())(e,r.format),n=r.format.emptyInputBehavior):(i=new(a())(e,r.options),n=r.options.emptyInputBehavior),""===t()(e).val()&"null"===n&&i.set(null),this.updateStore(e,i)},getValue:function(e){return this.getAutonumeric(e).getNumber()},subscribe:function(e,i){t()(e).on("change.autonumericInputBinding keyup.autonumericInputBinding input.autonumericInputBinding",(function(e){i()}))},unsubscribe:function(e){t()(e).off(".autonumericInputBinding")},receiveMessage:function(e,i){var n=this.getAutonumeric(e);if(i.hasOwnProperty("value")&&n.set(i.value),i.hasOwnProperty("format")&&n.update(i.format),i.hasOwnProperty("options")&&n.update(i.options),i.hasOwnProperty("label")){var a=t()("#"+e.id+"-label");!function(e,t){if(void 0!==e){if(1!==t.length)throw new Error("labelNode must be of length 1");Array.isArray(e)&&0===e.length?t.addClass("shiny-label-null"):(t.html(e),t.removeClass("shiny-label-null"))}}(i.label,a)}t()(e).trigger("change")},getState:function(e){var i=this.getAutonumeric(e);return{label:t()(e).parent().parent().find('label[for="'+Shiny.$escape(e.id)+'"]').text(),value:i.getNumber(),options:i.getSettings()}},getRatePolicy:function(){return{policy:"debounce",delay:500}},getAutonumeric:function(e){return this.store[e.id]}}),Shiny.inputBindings.register(r,"shinyWidgets.autonumericInput")})()})();