1 | {"version":3,"sources":["webpack://AutoNumeric/webpack/universalModuleDefinition","webpack://AutoNumeric/webpack/bootstrap","webpack://AutoNumeric/./src/AutoNumeric.js","webpack://AutoNumeric/./src/AutoNumericOptions.js","webpack://AutoNumeric/./src/AutoNumericEnum.js","webpack://AutoNumeric/./src/AutoNumericHelper.js","webpack://AutoNumeric/./src/AutoNumericPredefinedOptions.js","webpack://AutoNumeric/./src/AutoNumericDefaultSettings.js","webpack://AutoNumeric/./src/AutoNumericEvents.js","webpack://AutoNumeric/./src/main.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","r","value","n","__esModule","object","property","prototype","hasOwnProperty","p","s","AutoNumeric","arg1","arguments","length","undefined","_this","this","arg2","arg3","_classCallCheck","_AutoNumeric$_setArgu","_setArgumentsValues","domElement","initialValue","userOptions","defaultRawValue","_setSettings","_checkElement","savedCancellableValue","historyTable","historyTableIndex","onGoingRedo","parentForm","_getParentForm","runOnce","settings","formatOnPageLoad","_formatDefaultValueOnPageLoad","valueToSet","_AutoNumericHelper2","default","isNull","emptyInputBehavior","options","zero","null","_setElementAndRawValue","isInputElement","isContentEditable","noEventListeners","_createEventListeners","_setReadOnly","_saveInitialValues","sessionStorageAvailable","constructor","_storageTest","storageNamePrefix","_setPersistentStorageName","isFocused","isWheelEvent","isDropEvent","isEditing","internalModification","attributeToWatch","_getAttributeToWatch","getterSetter","getOwnPropertyDescriptor","__proto__","_addWatcher","createLocalList","_createLocalList","_addToGlobalList","global","set","newValue","autoNumericLocalList","forEach","aNObject","setUnformatted","callback","result","push","_executeCallback","getNumericString","getFormatted","getNumber","getLocalized","reformat","unformat","unformatLocalized","forcedOutputFormat","update","_len","newOptions","Array","_key","apply","isPristine","checkOnlyRawValue","clear","forceClearAll","remove","wipe","nuke","has","domElementOrAutoNumericObject","node","addObject","otherAutoNumericObject","getAutoNumericElement","_hasLocalList","otherANLocalList","_getLocalList","size","mergedLocalLists","Map","mergeMaps","_addToLocalList","_setLocalList","removeObject","keepCurrentANObject","initialCompleteLocalList","delete","empty","keepEachANObjectInItsOwnList","elements","getList","reset","rawValue","defaultSettings","allowDecimalPadding","_allowDecimalPadding","caretPositionOnFocus","_caretPositionOnFocus","_createLocalList2","_deleteLocalList","currencySymbol","_currencySymbol","currencySymbolPlacement","_currencySymbolPlacement","decimalCharacter","_decimalCharacter","decimalCharacterAlternative","_decimalCharacterAlternative","decimalPlaces","_decimalPlaces","warning","showWarnings","decimalPlacesRawValue","_decimalPlacesRawValue","decimalPlacesShownOnBlur","_decimalPlacesShownOnBlur","decimalPlacesShownOnFocus","_decimalPlacesShownOnFocus","defaultValueOverride","_defaultValueOverride","digitalGroupSpacing","_digitalGroupSpacing","digitGroupSeparator","_digitGroupSeparator","divisorWhenUnfocused","_divisorWhenUnfocused","_emptyInputBehavior","eventBubbles","_eventBubbles","eventIsCancelable","_eventIsCancelable","failOnUnknownOption","_failOnUnknownOption","_formatOnPageLoad","historySize","_historySize","isCancellable","_isCancellable","leadingZero","_leadingZero","maximumValue","_maximumValue","minimumValue","_minimumValue","modifyValueOnWheel","_modifyValueOnWheel","negativeBracketsTypeOnBlur","_negativeBracketsTypeOnBlur","negativePositiveSignPlacement","_negativePositiveSignPlacement","negativeSignCharacter","_negativeSignCharacter","_noEventListeners","noEvents","addEvents","_removeEventListeners","onInvalidPaste","_onInvalidPaste","outputFormat","_outputFormat","overrideMinMaxLimits","_overrideMinMaxLimits","positiveSignCharacter","_positiveSignCharacter","rawValueDivisor","_rawValueDivisor","readOnly","_readOnly","roundingMethod","_roundingMethod","saveValueToSessionStorage","_saveValueToSessionStorage","symbolWhenUnfocused","_symbolWhenUnfocused","selectNumberOnly","_selectNumberOnly","selectOnFocus","_selectOnFocus","serializeSpaces","_serializeSpaces","showOnlyNumbersOnFocus","_showOnlyNumbersOnFocus","showPositiveSign","_showPositiveSign","_showWarnings","styleRules","_styleRules","suffixText","_suffixText","unformatOnHover","_unformatOnHover","unformatOnSubmit","_unformatOnSubmit2","valuesToStrings","_valuesToStrings","watchExternalChanges","_watchExternalChanges","wheelOn","_wheelOn","wheelStep","_wheelStep","_triggerEvent","events","initialized","getElementValue","newRawValue","error","aNElement","initialValueHtmlAttribute","scientificToDecimal","getAttribute","_this2","_onFocusInFunc","e","_onFocusIn","_onFocusInAndMouseEnterFunc","_onFocusInAndMouseEnter","_onFocusFunc","_onFocus","_onKeydownFunc","_onKeydown","_onKeypressFunc","_onKeypress","_onKeyupFunc","_onKeyup","_onFocusOutAndMouseLeaveFunc","_onFocusOutAndMouseLeave","_onPasteFunc","_onPaste","_onWheelFunc","_onWheel","_onDropFunc","_onDrop","_onKeydownGlobalFunc","_onKeydownGlobal","_onKeyupGlobalFunc","_onKeyupGlobal","addEventListener","_setupFormListener","_doesGlobalListExists","document","removeEventListener","_removeFormListener","_this3","_onFormSubmitFunc","_onFormSubmit","_hasParentFormCounter","_incrementParentFormCounter","_initializeFormCounterToOne","_storeFormHandlerFunction","anCount","_getParentFormCounter","_getFormHandlerFunction","_removeFormDataSetInfo","_decrementParentFormCounter","throwError","dataset","Number","formElement","_getFormElement","_doesFormHandlerListExists","_createFormHandlerList","formHandlerName","randomString","anFormHandler","aNFormHandlerMap","_hasFormHandlerFunction","_getFormHandlerKey","removeAttribute","_this4","isUndefined","_getterSetter","setter","val","_this5","_getterSetter2","nodeType","Node","ELEMENT_NODE","DOCUMENT_NODE","DOCUMENT_FRAGMENT_NODE","TEXT_NODE","isEmptyHistoryTable","_historyTableCurrentValueUsed","addNewHistoryState","nextHistoryStateIndex","arrayTrim","selection","getElementSelection","selectionStart","start","selectionEnd","end","_historyTableForget","check","undoInfo","setElementSelection","_historyTableUndoOrRedo","numberOfEntriesToForget","shiftedAway","shift","indexToUse","isUndefinedOrNullOrEmpty","_this6","positive","_addCSSClass","_removeCSSClass","negative","ranges","range","min","max","class","userDefined","userObject","isFunction","isString","classes","isArray","callbackResult","userClass","index","isInArray","isInt","_typeof","cssClassName","classList","add","_this7","_len2","_key2","originalSettings","cloneObject","numericString","optionsToUse","optionObject","_isPreDefinedOptionValid","_getOptionObject","_extends","saveChangeToHistory","_saveValueToPersistentStorage","_toNumericValue","isNaN","setValue","_constructor$_checkIf","_checkIfInRangeWithOverrideOption","_constructor$_checkIf2","_slicedToArray","minTest","maxTest","_checkValuesToStrings","isZeroOrHasNoValue","forcedRawValue","_roundRawValue","_trimLeadingAndTrailingZeros","replace","_getRawValueToFormat","_roundFormattedValueShownOnFocus","toString","_roundFormattedValueShownOnBlur","_modifyNegativeSignAndDecimalCharacterForFormattedValue","_addGroupSeparators","minRangeExceeded","maxRangeExceeded","_removeValueFromPersistentStorage","always","strippedValue","_removeBrackets","normalizedValue","_stripAllNonNumberCharacters","isNumber","_constructor$_checkIf3","_constructor$_checkIf4","oldRawValue","_isUserManuallyEditingTheValue","rawValueModified","_parseStyleRules","_historyTableAdd","newElementValue","sendFormattedEvent","oldElementValue","setElementValue","formatted","oldValue","isBoolean","_setElementValue","_setRawValue","_checkValuesToStringsArray","valuesToStringsKeys","eventName","element","detail","triggerEvent","trimPaddedZerosFromDecimalPlaces","_toLocale","isEmptyString","keep","outputFormatToUse","selectNumber","_defaultSelectAll","unformattedValue","valueLen","currencySymbolSize","negLen","isNegative","suffixTextLen","suffix","left","prefix","right","isPositive","none","elementValue","indexOf","decimalCount","parentNode","otherAnElement","domElementToDetach","_removeFromLocalList","reFormat","valueOrElement","optionOverride","_formatOrUnformatOther","stringOrElement","isFormatting","valueOrStringOrElement","settingsToUse","_cloneAndMergeSettings","isElement","format","domElementOrArrayOrString","_this8","attached","returnASingleAutoNumericObject","domElementsArray","querySelectorAll","currentLocalList","autoNumericObjectsArray","originalCreateLocalListSetting","newAutoNumericElement","temporaryForcedOptions","focus","_removeWatcher","_removeFromGlobalList","removeChild","newParentForm","oldANChildren","_getFormAutoNumericChildren","_this9","inputList","filter","input","isManagedByAutoNumeric","tagName","toLowerCase","_serializeNumericString","form","_serializeFormatted","_serializeLocalized","_serializeNumericStringArray","_serializeFormattedArray","_serializeLocalizedArray","JSON","stringify","formArrayNumericString","formArrayFormatted","formArrayLocalized","_getChildANInputElement","formUnformat","submit","formReformat","formNumericString","formFormatted","formUnformatLocalized","formLocalized","formJsonNumericString","formJsonFormatted","formJsonLocalized","localList","autoNumericObject","_len3","newSettings","_key3","concat","_len4","_key4","predefinedOption","_mergeSettings","_updatePredefinedOptions","getPredefinedOptions","French","NorthAmerican","British","Swiss","Japanese","Spanish","Chinese","Brazilian","key","htmlAttribute","camelize","isTrailingNegative","firstBracket","lastBracket","_settings$negativeBra","split","_settings$negativeBra2","isNegativeSignAllowed","match","doNotSelect","isValueNegative","totalLength","valueSize","integerSize","hasDecimalChar","offsetDecimalChar","contains","decimalLeft","decimalRight","signToUse","positiveNegativeSignSize","caretPosition","originalDigitGroupSeparator","originalCurrencySymbol","originalSuffixText","rawValueStorageName","id","decodeURIComponent","sessionStorage","setItem","cookie","getItem","_readCookie","removeItem","date","Date","setTime","getTime","expires","toUTCString","type","altKey","_unformatAltHovered","hoveredWithAlt","_reformatAltHovered","elementValueToSet","rawValueToFormat","roundedValue","onlyNumbers","valueOnFocus","lastVal","isEmptyValue","_isElementValueEmptyOrOnlyTheNegativeSign","orderedValue","_orderValueCurrencySymbolAndSuffixText","orderedValueTest","target","_saveCancellableValue","select","_initialCaretPosition","getHoveredElement","_updateEventKeyInfo","initialValueOnKeydown","initialRawValueOnKeydown","processed","eventKey","_AutoNumericEnum2","keyName","Esc","preventDefault","native","targetValue","Enter","change","_updateInternalProperties","_processNonPrintableKeysAndShortcuts","Backspace","Delete","_processCharacterDeletion","_formatValue","throwInput","Insert","_processCharacterInsertion","position","Z","z","ctrlKey","shiftKey","_historyTableRedo","_historyTableUndo","metaKey","x","cutNumber","_setCaretPosition","Alt","skip","valuePartsBeforePaste","Tab","_saveRawValueForAndroid","AndroidDefault","_stripAllNonNumberCharactersExceptCustomDecimalChar","_convertToNumericString","isRawValueNull","_constructor$_checkIf5","_constructor$_checkIf6","elementValueIsAlreadySet","String","_roundValue","_modifyNegativeSignAndDecimalCharacterForRawValue","groupedValue","never","floats","_onBlur","disabled","rawPastedText","clipboardData","getData","eventTarget","explicitOriginalTarget","initialFormattedValue","selectionSize","untranslatedPastedText","_preparePastedText","pastedRawValue","arabicToLatinNumbers","isPasteNegative","isNegativeStrict","slice","pastedText","caretPositionOnInitialTextAfterPasting","isInitialValueNegative","isPasteNegativeAndInitialValueIsPositive","leftPartContainedADot","leftPart","rightPart","truncate","leftFormattedPart","rightFormattedPart","setRawNegativeSign","convertCharacterCountToIndexPosition","countNumberCharactersOnTheCaretLeftSide","minParse","parseStr","maxParse","lastGoodKnownResult","pastedTextIndex","modifiedLeftPart","_checkIfInRange","lastGoodKnownResultIndex","lastGoodKnownResultSize","replaceCharAt","ignore","clamp","leftFormattedPart2","rightFormattedPart2","indexSelectionEndInRawValue","selectedText","countCharInText","valueHasBeenSet","valueHasBeenClamped","clampedValue","clampToRangeLimits","caretPositionInFormattedNumber","findCaretPositionInFormattedNumber","wheelAction","hover","scrollBy","deltaY","currentUnformattedValue","isWheelUpEvent","isWheelDownEvent","step","addAndRoundToNearestAuto","subtractAndRoundToNearestAuto","_setSelection","isIE11","droppedText","dataTransfer","cleanedValue","unformatOther","_this10","map","_unformatOnSubmit","character","hoveredElement","anElement","allowedTagList","currentElementTag","_isElementTagSupported","_isInputElement","_isInputTypeSupported","hasAttribute","forcedInitialValue","currentValue","trim","setAttribute","unLocalizedCurrentValue","_getValueFromPersistentStorage","toStrip","Infinity","_settings$maximumValu","maximumValueIntegerPart","_ref","minimumValueIntegerPart","mIntPos","Math","mIntNeg","keys","_convertOldOptionsToNewOnes","originalDecimalPlacesRawValue","originalDecimalPlaces","_calculateDecimalPlacesOnUpdate","getDefaultConfig","caretFix","_transformOptionsValuesToDefaultTypes","_runCallbacksFoundInTheSettingsObject","_correctNegativePositiveSignPlacementOption","_correctCaretPositionOnFocusAndSelectOnFocusOptions","_setNegativePositiveSignPermissions","_calculateDecimalPlacesOnInit","_calculateVMinAndVMaxIntegerSizes","_setTrailingNegativeSignInfo","regex","_cachesUsualRegularExpressions","_setBrackets","_calculateValuesToStringsKeys","isEmptyObj","validate","_keepAnOriginalSettingsCopy","text","substring","_getLeftAndRightPartA","_getLeftAndRightPartAroundTheSelection","_getLeftAndRightPartA2","stripZeros","Hyphen","Minus","deny","num0","numpad0","RegExp","aNegRegAutoStrip","isPaste","_normalizeParts2","_normalizeParts","_normalizeParts3","normalizedLeft","normalizedRight","normalizedNewValue","_AutoNumeric$_checkIf","_AutoNumeric$_checkIf2","testValue","_truncateDecimalPlaces","valueToSetOnEmpty","roundedValueToShow","currencySymbolLen","charAt","_getSignPosition2","_getSignPosition","_getSignPosition3","signPosition","currencySymbolPosition","oldParts","_getLeftAndRightPartA3","_getLeftAndRightPartA4","substr","_setValueParts","join","_checkPaste","_shouldSkipEventKey","a","v","_expandSelectionOnSign","LeftArrow","RightArrow","_directionKeys","_ref4","_ref3","isValNegative","_getUnformattedLeftAn3","_getUnformattedLeftAndRightPartAroundTheSelection","_getUnformattedLeftAn4","_getUnformattedLeftAn","_getUnformattedLeftAn2","_processCharacterDele","_processCharacterDeletionIfTrailingNegativeSign","_processCharacterDele2","_getUnformattedLeftAn5","_getUnformattedLeftAn6","_isDecimalCharacterInsertionAllowed","eventNumber","_getUnformattedLeftAn7","_elementValue$split","subParts","negativeSign","leftAr","signParts","escapeChr","escapedParts","miniParts","leftReg","newLeft","isArg1Element","isArg1String","isArg2Object","isObject","isArg2Array","isArg2Number","isNumberOrArabic","isArg2PreDefinedOptionName","isArg2Null","isArg2EmptyString","isArg3Object","isArg3Array","isArg3Null","isArg3PreDefinedOptionName","mergeOptions","querySelector","optionsArray","_this11","mergedOptions","optionObjectOrPredefinedOptionString","preDefinedOptionName","predefinedOptions","optionObjectOrPredefinedName","stringsArray","values","formNode","_this12","getElementsByTagName","autoNumericInputs","test","domElementOrSelector","_isInGlobalList","weakMapName","WeakMap","autoNumericGlobalListName","_createWeakMap","_createGlobalList","_getFromGlobalList","getSettings","shouldExtendDefaultOptions","originalOptions","isOriginalOptionAnObject","isTrueOrFalseString","testPositiveInteger","testNumericalCharacters","testFloatOrIntegerAndPossibleNegativeSign","testPositiveFloatOrInteger","doNoForceCaretPosition","comma","dot","normalSpace","thinSpace","narrowNoBreakSpace","noBreakSpace","noSeparator","apostrophe","arabicThousandsSeparator","dotAbove","two","twoScaled","three","four","middleDot","arabicDecimalSeparator","decimalSeparatorKeySymbol","_ref5","_ref6","leftBracket","rightBracket","ceiling","floor","parseFloat","_validateDecimalPlacesRawValue","halfUpSymmetric","halfUpAsymmetric","halfDownSymmetric","halfDownAsymmetric","halfEvenBankersRounding","upRoundAwayFromZero","downRoundTowardZero","toCeilingTowardPositiveInfinity","toFloorTowardNegativeInfinity","toNearest05","toNearest05Alt","upToNext05","downToNext05","parentheses","brackets","chevrons","curlyBraces","angleBrackets","japaneseQuotationMarks","halfBrackets","whiteSquareBrackets","quotationMarks","guillemets","press","allow","string","number","negativeDot","negativeComma","dotNegative","commaNegative","plus","percent","rule","isValid","_this13","optionsResult","numericStringOrDomElement","_len5","_key5","_generateOptionsObjectFromOptionsArray","isPositiveSignAllowed","valueString","_checkIfInRangeWithOv","_checkIfInRangeWithOv2","_checkValuesToStringsSettings","formattedValue","isNumberStrict","_len6","_key6","_checkStringsToValuesSettings","objectKeyLookup","_settings$negativeBra3","_settings$negativeBra4","NaN","localizedValue","localize","_get","getFunction","_normalizeCurrencySuffixAndNegativeSignCharacters","allowedAutoStrip","numRegAutoStrip","_s$split","_s$split2","integerPart","decimalPart","modifiedIntegerPart","stripReg","_addBrackets","rearrangeSignsAndValueOrder","_mergeCurrencySignNegativePositiveSignAndValue","lastIndexOf","convertToNumber","temp","hyphen","locale","signOnEmpty","inputValue","currentRawValue","isNegativeWithBrackets","digitalGroup","_inputValue$split","_inputValue$split2","_inputValue$split3","_inputValue$split4","decimalPlacesToRoundTo","_toggleNegativeBracket","roundedInputValue","decimalPlacesNeeded","_roundCloseTo05","_AutoNumeric$_prepare","_prepareValueForRounding","_AutoNumeric$_prepare2","decimalCharacterPosition","inputValueHasNoDot","_inputValue$split5","temporaryDecimalPlacesOverride","decimalPositionToUse","checkDecimalPlaces","inputValueRounded","zeros","_truncateZeros","roundedStrLength","lastDigit","inputValueArray","odd","_shouldRoundUp","round","ceil","_value$split","_value$split2","modifiedDecimalPart","valParse","testMinMax","nameEQ","ca","mod","useDefault","additionalDecimalPlacesRawValue","currentSettings","decimalPlacesInOptions","negativeSignReg","oldOptionsConverter","aSep","nSep","dGroup","aDec","altDec","aSign","pSign","pNeg","aSuffix","oLimits","vMax","vMin","mDec","eDec","scaleDecimal","aStor","mRound","aPad","nBracket","wEmpty","lZero","aForm","sNumber","anDefault","unSetOnSubmit","outputType","debug","option","parsedMinValue","parsedMaxValue","parsedValue","eventKeyName","isFnKeys","_allFnKeys","isOSKeys","OSLeft","OSRight","isContextMenu","ContextMenu","isSomeNonPrintableKeys","_someNonPrintableKeys","isOtherNonPrintableKeys","NumLock","ScrollLock","Command","isUnrecognizableKeys","Unidentified","intoAnArray","formatType","_this14","serializedSpaceCharacter","nodeName","selected","encodeURIComponent","checked","valueResult","anObject","finalResult","_serialize","multiple","rootElement","exclude","filterOut","secondArgumentIsInitialValueArray","secondArgumentIsOptionArray","typeOfFirstArrayElement","thirdArgumentIsOptionArray","isInitialValueNumber","initialValueArraySize","CustomEvent","event","params","bubbles","cancelable","evt","createEvent","initCustomEvent","Event","from","_AutoNumeric","_AutoNumeric2","createList","doNotCreateList","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","riel","ruble","rupee","rupeeOld","shekel","shekelAlt","taka","tenge","togrog","won","yen","one","five","six","doNotOverride","percentage","permille","basisPoint","doesNotBubble","isCancelable","isNotCancelable","fail","doNotFormat","verySmall","small","medium","large","veryLarge","insane","MAX_SAFE_INTEGER","cancellable","notCancellable","tenTrillions","tenTrillionsNoDecimals","oneBillion","modifyValue","doNothing","minus","heavyMinus","fullWidthHyphen","circledMinus","squaredMinus","triangleMinus","plusMinus","minusPlus","dotMinus","minusTilde","not","fullWidthPlus","heavyPlus","doublePlus","triplePlus","circledPlus","squaredPlus","trianglePlus","dotPlus","altHebrewPlus","readWrite","save","doNotSave","selectNumbersOnly","selectAll","showAll","show","hide","positiveNegative","range0To100With4Steps","evenOdd","rangeSmallAndZero","doNotUnformat","keepCurrentValue","zeroDash","0","oneAroundZero","-1","1","watch","doNotWatch","progressive","AutoNumericEnum","keyCode","Shift","Ctrl","Pause","CapsLock","Space","PageUp","PageDown","End","Home","UpArrow","DownArrow","num1","num2","num3","num4","num5","num6","num7","num8","num9","b","f","g","h","j","k","q","t","u","w","y","numpad1","numpad2","numpad3","numpad4","numpad5","numpad6","numpad7","numpad8","numpad9","MultiplyNumpad","PlusNumpad","MinusNumpad","DotNumpad","SlashNumpad","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12","HyphenFirefox","MyComputer","MyCalculator","Semicolon","Equal","Comma","Dot","Slash","Backquote","LeftBracket","Backslash","RightBracket","Quote","AltGraph","fromCharCodeKeyCode","8","9","13","16","17","18","19","20","27","32","33","34","35","36","37","38","39","40","45","46","48","49","50","51","52","53","54","55","56","57","91","92","93","96","97","98","99","100","101","102","103","104","105","106","107","109","110","111","112","113","114","115","116","117","118","119","120","121","122","123","144","145","173","182","183","186","187","188","189","190","191","192","219","220","221","222","224","225","AltGr","Fn","FnLock","Hyper","Meta","Super","Symbol","SymbolLock","Clear","Copy","CrSel","Cut","EraseEof","ExSel","Paste","Redo","Undo","Accept","Again","Attn","Cancel","Execute","Find","Finish","Help","Play","Props","Select","ZoomIn","ZoomOut","BrightnessDown","BrightnessUp","Eject","LogOff","Power","PowerOff","PrintScreen","Hibernate","Standby","WakeUp","Compose","Dead","Print","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Plus","NumpadDot","NumpadDotAlt","NumpadMultiply","NumpadPlus","NumpadMinus","NumpadSubtract","NumpadSlash","NumpadDotObsoleteBrowsers","NumpadMultiplyObsoleteBrowsers","NumpadPlusObsoleteBrowsers","NumpadMinusObsoleteBrowsers","NumpadSlashObsoleteBrowsers","_AutoNumericEnum","AutoNumericHelper","str","lowercaseValue","reference","obj","prop","isFinite","latinConvertedNumber","parseInt","func","MSInputMethodContext","documentMode","needle","array","arr","Error","Element","_str$split","_String$split","abs","which","isSeleniumBot","keyCodeNumber","potentialResult","fromCharCode","browser","version","ua","navigator","userAgent","tem","exec","appName","appVersion","splice","webdriver","numberOrNumericString","checkEverywhere","newCharacter","formattedNumberString","numberDotOrNegativeSign","numberDotAndNegativeSignCount","rawNumberString","caretPositionInRawValue","formattedNumberStringSize","rawNumberStringSize","formattedNumberStringIndex","rawNumberStringIndex","charCounter","characterCount","isSelectionStartUndefined","selectionInfo","getSelection","getRangeAt","startOffset","endOffset","setSelectionRange","firstChild","createRange","setStart","setEnd","removeAllRanges","addRange","message","console","warn","wheelEvent","_String$split3","_String$split4","stepPlace","isAddition","forceDecimalPlaces","absValue","rawValueMinimumOffset","pow","offset","minimumOffsetFirstDecimalPlaceIndex","indexFirstNonZeroDecimalPlace","roundToNearest","lengthValue","decimalPlacesLimit","modifyAndRoundToNearestAuto","arabicNumbers","returnANumber","parseDecimalCharacter","parseThousandSeparator","charCodeAt","resultAsNumber","dispatchEvent","nL","search","xc","yc","xNeg","strLength","random","textContent","separator","removeData","skipFirstWord","word","toUpperCase","nodeValue","excludedElements","_numericString$split","_numericString$split2","trimmedDecimalPart","hoveredElements","arrLength","_toConsumableArray","Set","mapObjects","reduce","as","entries","find","char","numericValue","includes","_val$split","_val$split2","exponent","isNegativeExponent","int","float","insertAt","repeat","japanese","euroPos","euroNeg","euroSpace","euroSpacePos","euroSpaceNeg","percentageEU2dec","percentageEU2decPos","percentageEU2decNeg","percentageEU3dec","percentageEU3decPos","percentageEU3decNeg","dollarPos","dollarNeg","dollarNegBrackets","percentageUS2dec","percentageUS2decPos","percentageUS2decNeg","percentageUS3dec","percentageUS3decPos","percentageUS3decNeg","dotDecimalCharCommaSeparator","commaDecimalCharDotSeparator","integer","integerPos","integerNeg","floatPos","floatNeg","numeric","numericPos","numericNeg"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,UAAAH,GACA,iBAAAC,QACAA,QAAA,YAAAD,IAEAD,EAAA,YAAAC,IARA,CASCK,OAAA,WACD,mBCTA,IAAAC,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAP,QAGA,IAAAC,EAAAI,EAAAE,IACAC,EAAAD,EACAE,GAAA,EACAT,YAUA,OANAU,EAAAH,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAQ,GAAA,EAGAR,EAAAD,QA2CA,OAtCAM,EAAAM,EAAAF,EAGAJ,EAAAO,EAAAR,EAGAC,EAAAQ,EAAA,SAAAd,EAAAe,EAAAC,GACAV,EAAAW,EAAAjB,EAAAe,IACAG,OAAAC,eAAAnB,EAAAe,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAV,EAAAiB,EAAA,SAAAvB,GACAkB,OAAAC,eAAAnB,EAAA,cAAiDwB,OAAA,KAIjDlB,EAAAmB,EAAA,SAAAxB,GACA,IAAAe,EAAAf,KAAAyB,WACA,WAA2B,OAAAzB,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAK,EAAAQ,EAAAE,EAAA,IAAAA,GACAA,GAIAV,EAAAW,EAAA,SAAAU,EAAAC,GAAsD,OAAAV,OAAAW,UAAAC,eAAAnB,KAAAgB,EAAAC,IAGtDtB,EAAAyB,EAAA,GAIAzB,IAAA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C,EAAAljC,QAAmC,UAC/BzC,IADyC,WAErC,OACIgP,YAAkB,0BAClBmL,UAAkB,wBAClBP,iBAAkB,+BAClBb,iBAAkB,0BAClBC,iBAAkB,0BAClB+M,QACIvH,MAAQ,QACR0H,OAAQ,6FChBxB,QAAAlnB,EAAA,MACAA,EAAA,MACAA,EAAA,MACAA,EAAA,MACAA,EAAA","file":"autoNumeric.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"AutoNumeric\"] = factory();\n\telse\n\t\troot[\"AutoNumeric\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 7);\n","/**\n * AutoNumeric.js\n *\n * @version 4.2.4\n * @date 2018-02-27 UTC 21:00\n *\n * @authors Bob Knothe, Alexandre Bonneau\n * @contributors Sokolov Yura and others, cf. AUTHORS\n * @copyright 2009 Robert J. Knothe\n * @since 2009-08-09\n *\n * @summary autoNumeric is a standalone Javascript library\n * that provides live *as-you-type* formatting for\n * international numbers and currencies.\n *\n * @link http://autonumeric.org\n *\n * Note : Some functions are borrowed from big.js\n * @see https://github.com/MikeMcl/big.js/\n *\n * Please report any bugs to https://github.com/autoNumeric/autoNumeric\n *\n * @license Released under the MIT License\n * @link http://www.opensource.org/licenses/mit-license.php\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sub license, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n\n//TODO Prevent having to enter relative path in the js files (ie. using `./AutoNumericHelper` instead of just `AutoNumericHelper`) (cf. http://moduscreate.com/es6-es2015-import-no-relative-path-webpack/)\nimport AutoNumericHelper from './AutoNumericHelper';\nimport AutoNumericEnum from './AutoNumericEnum';\n\n/**\n * Class declaration for the AutoNumeric object.\n *\n * An AutoNumeric element is an object wrapper that keeps a reference to the DOM element it manages (usually an <input> one), and provides autoNumeric-specific variables and functions.\n */\nexport default class AutoNumeric {\n /**\n * Initialize the AutoNumeric object onto the given DOM element, and attach the settings and related event listeners to it.\n * The options passed as a parameter is an object that contains the settings (ie. {digitGroupSeparator: \".\", decimalCharacter: \",\", currencySymbol: '€ '})\n *\n * @example\n * anElement = new AutoNumeric(domElement); // With the default options\n * anElement = new AutoNumeric(domElement, { options }); // With one option object\n * anElement = new AutoNumeric(domElement, 'euroPos'); // With a named pre-defined string\n * anElement = new AutoNumeric(domElement, [{ options1 }, 'euroPos', { options2 }]); // With multiple option objects (the latest option overwriting the previous ones)\n * anElement = new AutoNumeric(domElement, null, { options }); // With one option object, and a failed initial value\n * anElement = new AutoNumeric(domElement).french(); // With one pre-defined language object\n * anElement = new AutoNumeric(domElement).french({ options });// With one pre-defined language object and additional options that will override the defaults\n *\n * // ...or init and set the value in one call :\n * anElement = new AutoNumeric(domElement, 12345.789); // With the default options, and an initial value\n * anElement = new AutoNumeric(domElement, 12345.789, { options });\n * anElement = new AutoNumeric(domElement, '12345.789', { options });\n * anElement = new AutoNumeric(domElement, 12345.789, 'euroPos');\n * anElement = new AutoNumeric(domElement, 12345.789, [{ options1 }, 'euroPos', { options2 }]);\n * anElement = new AutoNumeric(domElement, 12345.789).french({ options });\n * anElement = new AutoNumeric(domElement, 12345.789, { options }).french({ options }); // Not really helpful, but possible\n *\n * // The AutoNumeric constructor class can also accept a string as a css selector. Under the hood this use `QuerySelector` and limit itself to only the first element it finds.\n * anElement = new AutoNumeric('.myCssClass > input');\n * anElement = new AutoNumeric('.myCssClass > input', { options });\n * anElement = new AutoNumeric('.myCssClass > input', 'euroPos');\n * anElement = new AutoNumeric('.myCssClass > input', [{ options1 }, 'euroPos', { options2 }]);\n * anElement = new AutoNumeric('.myCssClass > input', 12345.789);\n * anElement = new AutoNumeric('.myCssClass > input', 12345.789, { options });\n * anElement = new AutoNumeric('.myCssClass > input', 12345.789, 'euroPos');\n * anElement = new AutoNumeric('.myCssClass > input', 12345.789, [{ options1 }, 'euroPos', { options2 }]);\n * anElement = new AutoNumeric('.myCssClass > input', null, { options }); // With a failed initial value\n * anElement = new AutoNumeric('.myCssClass > input', 12345.789).french({ options });\n *\n * @param {object|Array|number|string} arg1\n * @param {object|Array|number|string|null} arg2\n * @param {object|Array|number|string|null} arg3\n * @throws\n */\n constructor(arg1 = null, arg2 = null, arg3 = null) {\n // --------------------------------------------------------\n // -------------- Initialization\n // Initialize the arguments\n const { domElement, initialValue, userOptions } = AutoNumeric._setArgumentsValues(arg1, arg2, arg3);\n\n // Initialize the element\n this.domElement = domElement;\n\n // Generate the settings\n this.defaultRawValue = ''; // The default raw value to set when initializing an AutoNumeric object\n this._setSettings(userOptions, false);\n //TODO If `styleRules` is not null, add by default a class 'autoNumeric' that adds transition to color, background-color, border-color properties\n // Check if the DOM element is supported\n this._checkElement();\n\n // Store the additional attributes inside the AutoNumeric object\n // Note: This variable is needed and not a duplicate of `initialValueOnKeydown` nor `valueOnFocus` since it serves a different purpose and has a different lifecycle\n this.savedCancellableValue = null;\n\n // Initialize the undo/redo variables\n this.historyTable = []; // Keep track of *all* valid states of the element value\n this.historyTableIndex = -1; // Pointer to the current undo/redo state. This will be set to '0' during initialization since it first adds itself.\n this.onGoingRedo = false; // Variable that keeps track if a 'redo' is ongoing (in order to prevent an 'undo' to be launch when releasing the shift key before the ctrl key after a 'redo' shortcut)\n\n // Initialize the parent form element, if any\n this.parentForm = this._getParentForm();\n\n // Set the initial value if it exists and if the `formatOnPageLoad` option will allow it\n if (!this.runOnce && this.settings.formatOnPageLoad) {\n // Format the element value if needed\n this._formatDefaultValueOnPageLoad(initialValue);\n } else {\n // Otherwise set the `rawValue` and the element value, but do not format the latter yet\n let valueToSet;\n if (AutoNumericHelper.isNull(initialValue)) {\n switch (this.settings.emptyInputBehavior) {\n case AutoNumeric.options.emptyInputBehavior.zero:\n valueToSet = '0';\n break;\n // In order to stay consistent when `formatOnPageLoad` is set to `true`, it's still impossible so set the `null` value as the initial value\n case AutoNumeric.options.emptyInputBehavior.null:\n default :\n valueToSet = '';\n }\n } else {\n valueToSet = initialValue;\n }\n\n this._setElementAndRawValue(valueToSet);\n }\n\n this.runOnce = true;\n\n // Add the events listeners only on input elements\n if (this.isInputElement || this.isContentEditable) {\n if (!this.settings.noEventListeners) {\n //XXX Here we make sure the global list is created after creating the event listeners, to only create the event listeners on `document` once\n this._createEventListeners();\n }\n\n this._setReadOnly();\n }\n\n // Save the initial values (html attribute + element.value) for the pristine test\n this._saveInitialValues(initialValue);\n \n // Setup the data for the persistent storage solution (ie. sessionStorage or cookies)\n this.sessionStorageAvailable = this.constructor._storageTest();\n this.storageNamePrefix = 'AUTO_'; // The prefix for the raw value storage name variable can be modified here\n this._setPersistentStorageName();\n\n // --------------------------------------------------------\n // -------------- Tracking\n // Keep track if the element is currently focused\n this.isFocused = false;\n // Keep track if a mouse wheel event is currently ongoing\n this.isWheelEvent = false;\n // Keep track if a drop event is currently ongoing\n this.isDropEvent = false;\n // Keep track if the user is currently editing the element\n this.isEditing = false;\n // Watch any external changes to the element value/textContent/nodeValue and `set()` the new value so that it gets formatted/saved in the history\n this.internalModification = false; // This is temporarily set to `true` only when the AutoNumeric object does update the element value\n this.attributeToWatch = this._getAttributeToWatch();\n this.getterSetter = Object.getOwnPropertyDescriptor(this.domElement.__proto__, this.attributeToWatch);\n this._addWatcher();\n\n if (this.settings.createLocalList) {\n // Keep track of every AutoNumeric elements that this object initialized\n this._createLocalList();\n }\n\n // Keep track of all AutoNumeric elements in the current web page\n this.constructor._addToGlobalList(this);\n\n // --------------------------------------------------------\n // -------------- Methods\n // Create the global functions\n this.global = {\n /**\n * Set the same given element value for each elements in the local AutoNumeric element list, and format those elements immediately\n *\n * @param {number|string} newValue The value must be a number or a numeric string\n * @param {object} options A settings object that will override the current settings. Note: the update is done only if the `newValue` is defined.\n */\n set: (newValue, options = null) => {\n this.autoNumericLocalList.forEach(aNObject => {\n aNObject.set(newValue, options);\n });\n },\n\n /**\n * Set the value given value directly as the DOM element value, without formatting it beforehand.\n * This sets the same unformatted value for each elements in the local AutoNumeric element list.\n *\n * @param {number|string} value\n * @param {object} options\n */\n setUnformatted: (value, options = null) => {\n this.autoNumericLocalList.forEach(aNObject => {\n aNObject.setUnformatted(value, options);\n });\n },\n\n /**\n * This is an alias of the `getNumericString()` function, and should not be used anymore.\n *\n * @param {function|null} callback If a callback is passed, then the result is passed to it as its first argument, and the AutoNumeric object has its second\n * @returns {Array<string>}\n * @deprecated\n */\n get: (callback = null) => {\n const result = [];\n this.autoNumericLocalList.forEach(aNObject => {\n result.push(aNObject.get());\n });\n this._executeCallback(result, callback);\n\n return result;\n },\n\n /**\n * Return an array of the unformatted values (as a string) of each AutoNumeric element of the local AutoNumeric element list\n *\n * @param {function|null} callback If a callback is passed, then the result is passed to it as its first argument, and the AutoNumeric object has its second\n * @returns {Array<string>}\n */\n getNumericString: (callback = null) => {\n const result = [];\n this.autoNumericLocalList.forEach(aNObject => {\n result.push(aNObject.getNumericString());\n });\n this._executeCallback(result, callback);\n\n return result;\n },\n\n /**\n * Return an array of the current formatted values (as a string) of each AutoNumeric element of the local AutoNumeric element list\n *\n * @param {function|null} callback If a callback is passed, then the result is passed to it as its first argument, and the AutoNumeric object has its second\n * @returns {Array<string>}\n */\n getFormatted: (callback = null) => {\n const result = [];\n this.autoNumericLocalList.forEach(aNObject => {\n result.push(aNObject.getFormatted());\n });\n this._executeCallback(result, callback);\n\n return result;\n },\n\n /**\n * Return an array of the element unformatted values (as a real Javascript number), for each element of the local AutoNumeric element list\n *\n * @param {function|null} callback If a callback is passed, then the result is passed to it as its first argument, and the AutoNumeric object has its second\n * @returns {Array<number>}\n */\n getNumber: (callback = null) => {\n const result = [];\n this.autoNumericLocalList.forEach(aNObject => {\n result.push(aNObject.getNumber());\n });\n this._executeCallback(result, callback);\n\n return result;\n },\n\n /**\n * Returns the unformatted values (following the `outputFormat` setting) of each element of the local AutoNumeric element list into an array\n *\n * @param {function|null} callback If a callback is passed, then the result is passed to it as its first argument, and the AutoNumeric object has its second\n * @returns {Array<string>}\n */\n getLocalized: (callback = null) => {\n const result = [];\n this.autoNumericLocalList.forEach(aNObject => {\n result.push(aNObject.getLocalized());\n });\n this._executeCallback(result, callback);\n\n return result;\n },\n\n /**\n * Force each element of the local AutoNumeric element list to reformat its value\n */\n reformat: () => {\n this.autoNumericLocalList.forEach(aNObject => {\n aNObject.reformat();\n });\n },\n\n /**\n * Remove the formatting and keep only the raw unformatted value (as a numericString) in each elements of the local AutoNumeric element list\n */\n unformat: () => {\n this.autoNumericLocalList.forEach(aNObject => {\n aNObject.unformat();\n });\n },\n\n /**\n * Remove the formatting and keep only the localized unformatted value in the element, with the option to override the default outputFormat if needed\n *\n * @param {null|string} forcedOutputFormat If set to something different than `null`, then this is used as an overriding outputFormat option\n */\n unformatLocalized: (forcedOutputFormat = null) => {\n this.autoNumericLocalList.forEach(aNObject => {\n aNObject.unformatLocalized(forcedOutputFormat);\n });\n },\n\n /**\n * Updates the AutoNumeric settings, and immediately format the elements accordingly, for each elements of the local AutoNumeric element list\n *\n * @param {object} newOptions This can be either one or more option objects\n */\n update: (...newOptions) => {\n this.autoNumericLocalList.forEach(aNObject => {\n aNObject.update(...newOptions);\n });\n },\n\n /**\n * Return `true` if *all* the autoNumeric-managed elements are pristine, if their raw value hasn't changed.\n * By default, this returns `true` if the raw unformatted value is still the same even if the formatted one has changed (due to a configuration update for instance).\n *\n * @param {boolean} checkOnlyRawValue If set to `true`, the pristine value is done on the raw unformatted value, not the formatted one. If set to `false`, this also checks that the formatted value hasn't changed.\n * @returns {boolean}\n */\n isPristine: (checkOnlyRawValue = true) => {\n let isPristine = true;\n this.autoNumericLocalList.forEach(aNObject => {\n if (isPristine && !aNObject.isPristine(checkOnlyRawValue)) {\n isPristine = false;\n }\n });\n\n return isPristine;\n },\n\n /**\n * Execute the `clear()` method on each AutoNumeric object in the local AutoNumeric element list\n *\n * @param {boolean} forceClearAll\n */\n clear: (forceClearAll = false) => {\n this.autoNumericLocalList.forEach(aNObject => {\n aNObject.clear(forceClearAll);\n });\n },\n\n /**\n * Execute the `remove()` method on each AutoNumeric object in the local AutoNumeric element list\n */\n remove: () => {\n this.autoNumericLocalList.forEach(aNObject => {\n aNObject.remove();\n });\n },\n\n /**\n * Execute the `wipe()` method on each AutoNumeric object in the local AutoNumeric element list\n */\n wipe: () => {\n this.autoNumericLocalList.forEach(aNObject => {\n aNObject.wipe();\n });\n },\n\n /**\n * Execute the `nuke()` method on each AutoNumeric object in the local AutoNumeric element list\n */\n nuke: () => {\n this.autoNumericLocalList.forEach(aNObject => {\n aNObject.nuke();\n });\n },\n\n /**\n * Return `true` if the given AutoNumeric object (or DOM element) is in the local AutoNumeric element list\n *\n * @param {HTMLElement|HTMLInputElement|AutoNumeric} domElementOrAutoNumericObject\n * @returns {*}\n */\n has: domElementOrAutoNumericObject => {\n let result;\n if (domElementOrAutoNumericObject instanceof AutoNumeric) {\n result = this.autoNumericLocalList.has(domElementOrAutoNumericObject.node());\n } else {\n result = this.autoNumericLocalList.has(domElementOrAutoNumericObject);\n }\n\n return result;\n },\n\n /**\n * Add an existing AutoNumeric object (or DOM element) to the local AutoNumeric element list, using the DOM element as the key.\n * This manages the case where `addObject` is used on an AutoNumeric object that already has multiple elements in its local list.\n *\n * @param {HTMLElement|HTMLInputElement|AutoNumeric} domElementOrAutoNumericObject\n */\n addObject: domElementOrAutoNumericObject => {\n // Start with the same data, whatever the user passed as arguments\n let domElement;\n let otherAutoNumericObject;\n if (domElementOrAutoNumericObject instanceof AutoNumeric) {\n domElement = domElementOrAutoNumericObject.node();\n otherAutoNumericObject = domElementOrAutoNumericObject;\n } else {\n domElement = domElementOrAutoNumericObject;\n otherAutoNumericObject = AutoNumeric.getAutoNumericElement(domElement);\n }\n\n // Check if the current autoNumeric object has a local list\n if (!this._hasLocalList()) {\n this._createLocalList();\n }\n\n // Check if the other autoNumeric object has a local list...\n let otherANLocalList = otherAutoNumericObject._getLocalList();\n if (otherANLocalList.size === 0) {\n // Special case if the other AutoNumeric object has an empty local list, then populate itself to it\n otherAutoNumericObject._createLocalList();\n otherANLocalList = otherAutoNumericObject._getLocalList(); // Update the other local list\n }\n\n let mergedLocalLists;\n if (otherANLocalList instanceof Map) {\n // ...If it does, merge the local lists together\n mergedLocalLists = AutoNumericHelper.mergeMaps(this._getLocalList(), otherANLocalList);\n } else {\n // ...If not, just set the current local list onto the other AutoNumeric object\n // We need to specify the AutoNumeric object, otherwise the `_addToLocalList` function would not correctly add the AutoNumeric object since we would not have a reference to it, but a reference to the current AutoNumeric object on which is called this method.\n this._addToLocalList(domElement, otherAutoNumericObject);\n mergedLocalLists = this._getLocalList();\n }\n\n // Update the resulting list, on all the objects of that local list (so that we can indifferently use `init()` on any object belonging to that list)\n mergedLocalLists.forEach(aNObject => {\n aNObject._setLocalList(mergedLocalLists);\n });\n },\n\n /**\n * Remove the given AutoNumeric object (or DOM element) from the local AutoNumeric element list, using the DOM element as the key.\n * If this function attempts to remove the current AutoNumeric object from the local list, a warning is shown, but the deletion is still done.\n *\n * Special cases :\n * - If the current object removes itself, then it's removed from the shared local list, then a new empty local list is used/created\n * - If another object remove this object, then a local list with only this object is used/created\n *\n * @param {HTMLElement|HTMLInputElement|AutoNumeric} domElementOrAutoNumericObject\n * @param {boolean} keepCurrentANObject If set to `false`, then the function will also remove the current AutoNumeric object if asked, otherwise it will ignore it and print a warning message\n */\n removeObject: (domElementOrAutoNumericObject, keepCurrentANObject = false) => {\n // Start with the same data, whatever the user passed as arguments\n let domElement;\n let otherAutoNumericObject;\n if (domElementOrAutoNumericObject instanceof AutoNumeric) {\n domElement = domElementOrAutoNumericObject.node();\n otherAutoNumericObject = domElementOrAutoNumericObject;\n } else {\n domElement = domElementOrAutoNumericObject;\n otherAutoNumericObject = AutoNumeric.getAutoNumericElement(domElement);\n }\n\n // Remove the other object from the local list\n const initialCompleteLocalList = this.autoNumericLocalList;\n this.autoNumericLocalList.delete(domElement);\n\n // Update the local list for all objects in it\n initialCompleteLocalList.forEach(aNObject => {\n aNObject._setLocalList(this.autoNumericLocalList);\n });\n\n if (!keepCurrentANObject && domElement === this.node()) {\n // This object is removed by itself\n // Empty the object local list\n otherAutoNumericObject._setLocalList(new Map);\n } else {\n // This object is removed by another object\n // Set the local list for the removed object, with only this object in it\n otherAutoNumericObject._createLocalList();\n }\n },\n\n /**\n * Remove all elements from the shared list, effectively emptying it.\n * This is the equivalent of calling `detach()` on each of its elements.\n *\n * @param {boolean} keepEachANObjectInItsOwnList If set to `true`, then instead of completely emptying the local list of each AutoNumeric objects, each one of those keeps itself in its own local list\n */\n empty: (keepEachANObjectInItsOwnList = false) => {\n const initialCompleteLocalList = this.autoNumericLocalList;\n\n // Update the local list for all objects in it\n initialCompleteLocalList.forEach(aNObject => {\n if (keepEachANObjectInItsOwnList) {\n aNObject._createLocalList();\n } else {\n aNObject._setLocalList(new Map);\n }\n });\n },\n\n /**\n * Return an array containing all the AutoNumeric DOM elements that have been initialized by each other\n *\n * @returns {Array<HTMLElement>}\n */\n elements: () => {\n const result = [];\n this.autoNumericLocalList.forEach(aNObject => {\n result.push(aNObject.node());\n });\n\n return result;\n },\n\n /**\n * Return the `Map` object directly\n * @returns {Map}\n */\n getList: () => this.autoNumericLocalList,\n\n /**\n * Return the number of element in the local AutoNumeric element list\n * @returns {number}\n */\n size: () => this.autoNumericLocalList.size,\n };\n\n // Create the functions that will allow to change each setting one by one\n /**\n * For each options, we define if we need to reformat the element content (does changing the options should change the way its value is displayed?).\n * If yes, then we use the `update()` for force a reformat, otherwise, we just update the `settings` object.\n */\n this.options = {\n /**\n * Reset any options set previously, by overwriting them with the default settings\n *\n * @returns {AutoNumeric}\n */\n reset : () => {\n //TODO Add a `settings` parameter so that the user can reset to a specific set of settings. This is different than update since it drops any non-default settings before using those new settings.\n this.settings = { rawValue : this.defaultRawValue }; // Here we pass the default rawValue in order to prevent showing a warning that we try to set an `undefined` value\n this.update(AutoNumeric.defaultSettings);\n\n return this;\n },\n allowDecimalPadding : allowDecimalPadding => {\n this.update({ allowDecimalPadding });\n\n return this;\n },\n caretPositionOnFocus : caretPositionOnFocus => { //FIXME test this\n this.settings.caretPositionOnFocus = caretPositionOnFocus;\n\n return this;\n },\n createLocalList : createLocalList => {\n this.settings.createLocalList = createLocalList;\n\n // Delete the local list when this is set to `false`, create it if this is set to `true` and there is not pre-existing list\n if (this.settings.createLocalList) {\n if (!this._hasLocalList()) {\n this._createLocalList();\n }\n } else {\n this._deleteLocalList();\n }\n\n return this;\n },\n currencySymbol : currencySymbol => {\n this.update({ currencySymbol });\n\n return this;\n },\n currencySymbolPlacement : currencySymbolPlacement => {\n this.update({ currencySymbolPlacement });\n\n return this;\n },\n decimalCharacter : decimalCharacter => {\n this.update({ decimalCharacter });\n\n return this;\n },\n decimalCharacterAlternative : decimalCharacterAlternative => {\n this.settings.decimalCharacterAlternative = decimalCharacterAlternative;\n\n return this;\n },\n /**\n * Update the decimal places globally, which means this override any previously set number of decimal shown on focus, on blur, or in the raw value.\n *\n * @param {int} decimalPlaces\n * @returns {AutoNumeric}\n */\n decimalPlaces : decimalPlaces => {\n AutoNumericHelper.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.', this.settings.showWarnings);\n this.update({ decimalPlaces });\n\n return this;\n },\n decimalPlacesRawValue : decimalPlacesRawValue => { //FIXME test this\n this.update({ decimalPlacesRawValue });\n\n return this;\n },\n decimalPlacesShownOnBlur : decimalPlacesShownOnBlur => {\n this.update({ decimalPlacesShownOnBlur });\n\n return this;\n },\n decimalPlacesShownOnFocus : decimalPlacesShownOnFocus => {\n this.update({ decimalPlacesShownOnFocus });\n\n return this;\n },\n defaultValueOverride : defaultValueOverride => {\n this.update({ defaultValueOverride });\n\n return this;\n },\n digitalGroupSpacing : digitalGroupSpacing => {\n this.update({ digitalGroupSpacing });\n\n return this;\n },\n digitGroupSeparator : digitGroupSeparator => {\n this.update({ digitGroupSeparator });\n\n return this;\n },\n divisorWhenUnfocused : divisorWhenUnfocused => {\n this.update({ divisorWhenUnfocused });\n\n return this;\n },\n emptyInputBehavior : emptyInputBehavior => {\n if (this.rawValue === null && emptyInputBehavior !== AutoNumeric.options.emptyInputBehavior.null) {\n // Special case : if the current `rawValue` is `null` and the `emptyInputBehavior` is changed to something else than `'null'`, then it makes that `rawValue` invalid.\n // Here we can either prevent the option update and throw an error, or still accept the option update and update the value from `null` to `''`.\n // We cannot keep `rawValue` to `null` since if `emptyInputBehavior` is not set to `null`, lots of function assume `rawValue` is a string.\n AutoNumericHelper.warning(`You are trying to modify the \\`emptyInputBehavior\\` option to something different than \\`'null'\\` (${emptyInputBehavior}), 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 \\`''\\`.`, this.settings.showWarnings);\n this.rawValue = '';\n }\n\n this.update({ emptyInputBehavior });\n\n return this;\n },\n eventBubbles : eventBubbles => {\n this.settings.eventBubbles = eventBubbles;\n\n return this;\n },\n eventIsCancelable : eventIsCancelable => {\n this.settings.eventIsCancelable = eventIsCancelable;\n\n return this;\n },\n failOnUnknownOption : failOnUnknownOption => {\n this.settings.failOnUnknownOption = failOnUnknownOption; //FIXME test this\n\n return this;\n },\n formatOnPageLoad : formatOnPageLoad => {\n this.settings.formatOnPageLoad = formatOnPageLoad; //FIXME test this\n\n return this;\n },\n historySize : historySize => {\n this.settings.historySize = historySize;\n\n return this;\n },\n isCancellable : isCancellable => {\n this.settings.isCancellable = isCancellable; //FIXME test this\n\n return this;\n },\n leadingZero : leadingZero => {\n this.update({ leadingZero });\n\n return this;\n },\n maximumValue : maximumValue => {\n this.update({ maximumValue });\n\n return this;\n },\n minimumValue : minimumValue => {\n this.update({ minimumValue });\n\n return this;\n },\n modifyValueOnWheel : modifyValueOnWheel => {\n this.settings.modifyValueOnWheel = modifyValueOnWheel; //FIXME test this\n\n return this;\n },\n negativeBracketsTypeOnBlur : negativeBracketsTypeOnBlur => {\n this.update({ negativeBracketsTypeOnBlur });\n\n return this;\n },\n negativePositiveSignPlacement: negativePositiveSignPlacement => {\n this.update({ negativePositiveSignPlacement });\n\n return this;\n },\n negativeSignCharacter : negativeSignCharacter => {\n this.update({ negativeSignCharacter });\n\n return this;\n },\n noEventListeners : noEventListeners => { //FIXME test this\n if (noEventListeners === AutoNumeric.options.noEventListeners.noEvents && this.settings.noEventListeners === AutoNumeric.options.noEventListeners.addEvents) {\n // Remove the events once\n this._removeEventListeners();\n }\n\n this.update({ noEventListeners });\n\n return this;\n },\n onInvalidPaste : onInvalidPaste => {\n this.settings.onInvalidPaste = onInvalidPaste; //FIXME test this\n\n return this;\n },\n outputFormat : outputFormat => {\n this.settings.outputFormat = outputFormat;\n\n return this;\n },\n overrideMinMaxLimits : overrideMinMaxLimits => {\n this.update({ overrideMinMaxLimits });\n\n return this;\n },\n positiveSignCharacter : positiveSignCharacter => {\n this.update({ positiveSignCharacter });\n\n return this;\n },\n rawValueDivisor : rawValueDivisor => {\n this.update({ rawValueDivisor });\n\n return this;\n },\n readOnly : readOnly => { //FIXME test this\n this.settings.readOnly = readOnly;\n this._setReadOnly();\n\n return this;\n },\n roundingMethod : roundingMethod => {\n this.update({ roundingMethod });\n\n return this;\n },\n saveValueToSessionStorage : saveValueToSessionStorage => {\n this.update({ saveValueToSessionStorage });\n\n return this;\n },\n symbolWhenUnfocused : symbolWhenUnfocused => {\n this.update({ symbolWhenUnfocused });\n\n return this;\n },\n selectNumberOnly : selectNumberOnly => {\n this.settings.selectNumberOnly = selectNumberOnly; //FIXME test this\n\n return this;\n },\n selectOnFocus : selectOnFocus => {\n this.settings.selectOnFocus = selectOnFocus; //FIXME test this\n\n return this;\n },\n serializeSpaces : serializeSpaces => {\n this.settings.serializeSpaces = serializeSpaces; //FIXME test this\n\n return this;\n },\n showOnlyNumbersOnFocus : showOnlyNumbersOnFocus => {\n this.update({ showOnlyNumbersOnFocus });\n\n return this;\n },\n showPositiveSign : showPositiveSign => {\n this.update({ showPositiveSign });\n\n return this;\n },\n showWarnings : showWarnings => {\n this.settings.showWarnings = showWarnings; //FIXME test this\n\n return this;\n },\n styleRules : styleRules => {\n this.update({ styleRules });\n\n return this;\n },\n suffixText : suffixText => {\n this.update({ suffixText });\n\n return this;\n },\n unformatOnHover : unformatOnHover => {\n this.settings.unformatOnHover = unformatOnHover; //FIXME test this\n\n return this;\n },\n unformatOnSubmit : unformatOnSubmit => {\n this.settings.unformatOnSubmit = unformatOnSubmit; //FIXME test this\n\n return this;\n },\n valuesToStrings : valuesToStrings => {\n this.update({ valuesToStrings });\n\n return this;\n },\n watchExternalChanges : watchExternalChanges => { //FIXME test this\n this.update({ watchExternalChanges });\n\n return this;\n },\n wheelOn : wheelOn => {\n this.settings.wheelOn = wheelOn; //FIXME test this\n\n return this;\n },\n wheelStep : wheelStep => {\n this.settings.wheelStep = wheelStep; //FIXME test this\n\n return this;\n },\n };\n\n // Once the autoNumeric element has been initialized, broadcast that message with additional info.\n // Note: When using `AutoNumeric.multiple()`, one event is sent *per* element initialized\n this._triggerEvent(AutoNumeric.events.initialized, this.domElement, {\n newValue : AutoNumericHelper.getElementValue(this.domElement),\n newRawValue: this.rawValue,\n error : null,\n aNElement : this,\n });\n }\n\n /**\n * Return the autoNumeric version number (for debugging purpose)\n *\n * @returns {string}\n */\n static version() {\n return '4.2.4';\n }\n\n /**\n * Take the parameters given to the AutoNumeric object, and output the three variables that are needed to finish initializing it :\n * - domElement : The target DOM element\n * - initialValue : The initial value, or `null` if none is given\n * - userOptions : The option object\n *\n * @param {object|Array|number|string} arg1\n * @param {object|Array|number|string|null} arg2\n * @param {object|Array|number|string|null} arg3\n * @returns {{domElement: *, initialValue: *, userOptions: *}}\n * @throws\n * @private\n */\n static _setArgumentsValues(arg1, arg2, arg3) {\n // Basic check on the argument count\n if (AutoNumericHelper.isNull(arg1)) {\n AutoNumericHelper.throwError('At least one valid parameter is needed in order to initialize an AutoNumeric object');\n }\n\n // Prepare the arguments in order to create the AutoNumeric object with the right values\n // Test the argument types\n const isArg1Element = AutoNumericHelper.isElement(arg1);\n const isArg1String = AutoNumericHelper.isString(arg1);\n\n const isArg2Object = AutoNumericHelper.isObject(arg2);\n const isArg2Array = Array.isArray(arg2) && arg2.length > 0;\n const isArg2Number = AutoNumericHelper.isNumberOrArabic(arg2) || arg2 === '';\n const isArg2PreDefinedOptionName = this._isPreDefinedOptionValid(arg2);\n const isArg2Null = AutoNumericHelper.isNull(arg2);\n const isArg2EmptyString = AutoNumericHelper.isEmptyString(arg2);\n\n const isArg3Object = AutoNumericHelper.isObject(arg3);\n const isArg3Array = Array.isArray(arg3) && arg3.length > 0;\n const isArg3Null = AutoNumericHelper.isNull(arg3);\n const isArg3PreDefinedOptionName = this._isPreDefinedOptionValid(arg3);\n\n // Given the parameters passed, sort the data and return a stable state before the initialization\n let domElement;\n let userOptions;\n let initialValue;\n\n //TODO Simplify those tests -->\n if (isArg1Element && isArg2Null && isArg3Null) {\n // new AutoNumeric(domElement); // With the default options\n domElement = arg1;\n initialValue = null;\n userOptions = null;\n } else if (isArg1Element && isArg2Number && isArg3Null) {\n // new AutoNumeric(domElement, 12345.789); // With the default options, and an initial value\n // new AutoNumeric(domElement, '12345.789');\n domElement = arg1;\n initialValue = arg2;\n userOptions = null;\n } else if (isArg1Element && isArg2Object && isArg3Null) {\n // new AutoNumeric(domElement, { options }); // With one option object\n domElement = arg1;\n initialValue = null;\n userOptions = arg2;\n } else if (isArg1Element && isArg2PreDefinedOptionName && isArg3Null) {\n // new AutoNumeric(domElement, 'euroPos'); // With one pre-defined option name\n domElement = arg1;\n initialValue = null;\n userOptions = this._getOptionObject(arg2);\n } else if (isArg1Element && isArg2Array && isArg3Null) {\n // new AutoNumeric(domElement, [{ options1 }, { options2 }]); // With multiple option objects (the latest option overwriting the previous ones)\n domElement = arg1;\n initialValue = null;\n userOptions = this.mergeOptions(arg2);\n } else if (isArg1Element && (isArg2Null || isArg2EmptyString) && isArg3Object) {\n // new AutoNumeric(domElement, null, { options }); // With one option object\n domElement = arg1;\n initialValue = null;\n userOptions = arg3;\n } else if (isArg1Element && (isArg2Null || isArg2EmptyString) && isArg3Array) {\n // new AutoNumeric(domElement, null, [{ options1 }, { options2 }]); // With multiple option objects\n domElement = arg1;\n initialValue = null;\n userOptions = this.mergeOptions(arg3);\n } else if (isArg1String && isArg2Null && isArg3Null) {\n // new AutoNumeric('.myCssClass > input');\n domElement = document.querySelector(arg1);\n initialValue = null;\n userOptions = null;\n } else if (isArg1String && isArg2Object && isArg3Null) {\n // new AutoNumeric('.myCssClass > input', { options });\n domElement = document.querySelector(arg1);\n initialValue = null;\n userOptions = arg2;\n } else if (isArg1String && isArg2PreDefinedOptionName && isArg3Null) {\n // new AutoNumeric('.myCssClass > input', 'euroPos');\n domElement = document.querySelector(arg1);\n initialValue = null;\n userOptions = this._getOptionObject(arg2);\n } else if (isArg1String && isArg2Array && isArg3Null) {\n // new AutoNumeric('.myCssClass > input', [{ options1 }, { options2 }]); // With multiple option objects\n domElement = document.querySelector(arg1);\n initialValue = null;\n userOptions = this.mergeOptions(arg2);\n } else if (isArg1String && (isArg2Null || isArg2EmptyString) && isArg3Object) {\n // new AutoNumeric('.myCssClass > input', null, { options });\n domElement = document.querySelector(arg1);\n initialValue = null;\n userOptions = arg3;\n } else if (isArg1String && (isArg2Null || isArg2EmptyString) && isArg3Array) {\n // new AutoNumeric('.myCssClass > input', null, [{ options1 }, { options2 }]); // With multiple option objects\n domElement = document.querySelector(arg1);\n initialValue = null;\n userOptions = this.mergeOptions(arg3);\n } else if (isArg1String && isArg2Number && isArg3Null) {\n // new AutoNumeric('.myCssClass > input', 12345.789);\n // new AutoNumeric('.myCssClass > input', '12345.789');\n // new AutoNumeric('.myCssClass > input', '');\n domElement = document.querySelector(arg1);\n initialValue = arg2;\n userOptions = null;\n } else if (isArg1String && isArg2Number && isArg3Object) {\n // new AutoNumeric('.myCssClass > input', 12345.789, { options });\n // new AutoNumeric('.myCssClass > input', '12345.789', { options });\n // new AutoNumeric('.myCssClass > input', '', { options });\n domElement = document.querySelector(arg1);\n initialValue = arg2;\n userOptions = arg3;\n } else if (isArg1String && isArg2Number && isArg3PreDefinedOptionName) {\n // new AutoNumeric('.myCssClass > input', 12345.789, 'euroPos');\n // new AutoNumeric('.myCssClass > input', '12345.789', 'euroPos');\n // new AutoNumeric('.myCssClass > input', '', 'euroPos');\n domElement = document.querySelector(arg1);\n initialValue = arg2;\n userOptions = this._getOptionObject(arg3);\n } else if (isArg1Element && isArg2Number && isArg3Object) {\n // new AutoNumeric(domElement, 12345.789, { options });\n // new AutoNumeric(domElement, '12345.789', { options });\n // new AutoNumeric(domElement, '', { options });\n domElement = arg1;\n initialValue = arg2;\n userOptions = arg3;\n } else if (isArg1Element && isArg2Number && isArg3PreDefinedOptionName) {\n // new AutoNumeric(domElement, 12345.789, 'euroPos');\n // new AutoNumeric(domElement, '12345.789', 'euroPos');\n // new AutoNumeric(domElement, '', 'euroPos');\n domElement = arg1;\n initialValue = arg2;\n userOptions = this._getOptionObject(arg3);\n } else if (isArg1Element && isArg2Number && isArg3Array) {\n // new AutoNumeric(domElement, 12345.789, [{ options1 }, { options2 }]);\n // new AutoNumeric(domElement, '12345.789', [{ options1 }, { options2 }]);\n // new AutoNumeric(domElement, '', [{ options1 }, { options2 }]);\n domElement = arg1;\n initialValue = arg2;\n userOptions = this.mergeOptions(arg3);\n } else {\n AutoNumericHelper.throwError(`The parameters given to the AutoNumeric object are not valid, '${arg1}', '${arg2}' and '${arg3}' given.`);\n }\n\n if (AutoNumericHelper.isNull(domElement)) {\n AutoNumericHelper.throwError(`The selector '${arg1}' did not select any valid DOM element. Please check on which element you called AutoNumeric.`);\n }\n\n return { domElement, initialValue, userOptions };\n }\n\n /**\n * Merge the option objects found in the given array `optionsArray`.\n * If a `string` is found, then we try to get the related pre-defined option using that string as its name.\n * When merging the options, the latest option overwrite any previously set. This allows to fine tune a pre-defined option for instance.\n *\n * @param {Array<object|string>} optionsArray\n * @returns {{}}\n */\n static mergeOptions(optionsArray) {\n // This allows the user to use multiple options (strings or objects) in an array, and overwrite the previous one with the next option element ; this is useful to tune the wanted format\n const mergedOptions = {};\n optionsArray.forEach(optionObjectOrPredefinedOptionString => {\n Object.assign(mergedOptions, this._getOptionObject(optionObjectOrPredefinedOptionString));\n });\n\n return mergedOptions;\n }\n\n /**\n * Return `true` if the given pre-defined option name is an attribute of the `AutoNumeric.predefinedOptions` object\n *\n * @param {string} preDefinedOptionName\n * @returns {boolean}\n * @private\n */\n static _isPreDefinedOptionValid(preDefinedOptionName) {\n return AutoNumeric.predefinedOptions.hasOwnProperty(preDefinedOptionName);\n }\n\n /**\n * Return an option object based on the given parameter.\n * If `optionObjectOrPredefinedName` is as string, then we retrieve the pre-defined option object, if it's an object, we use it as is.\n *\n * @param {object|string} optionObjectOrPredefinedName\n * @returns {object}\n */\n static _getOptionObject(optionObjectOrPredefinedName) {\n let options;\n if (AutoNumericHelper.isString(optionObjectOrPredefinedName)) {\n options = AutoNumeric.getPredefinedOptions()[optionObjectOrPredefinedName];\n if (options === void(0) || options === null) {\n // If the given pre-defined name does not exist, warn that something is wrong, and continue the execution of the initialization\n AutoNumericHelper.warning(`The given pre-defined option [${optionObjectOrPredefinedName}] is not recognized by autoNumeric. Please check that pre-defined option name.`, true);\n }\n } else { // A `settings` object\n options = optionObjectOrPredefinedName;\n }\n\n return options;\n }\n\n /**\n * Save the initial element values for later use in the pristine test.\n * Those values are :\n * - the html attribute (ie. <input value='42'>), and\n * - the script `value` (ie. `let domElement.value`)\n *\n * @param {null|number|string} initialValue\n * @private\n */\n _saveInitialValues(initialValue) {\n // Keep the very first initial values (in the html attribute and set by the script). This is needed to check if the element is pristine.\n // Save the html attribute 'value'\n this.initialValueHtmlAttribute = AutoNumericHelper.scientificToDecimal(this.domElement.getAttribute('value'));\n if (AutoNumericHelper.isNull(this.initialValueHtmlAttribute)) {\n // Set the default empty value attribute instead of `null`, since if the initial value is null, the empty string is used\n this.initialValueHtmlAttribute = '';\n }\n\n // Save the 'script' value\n this.initialValue = initialValue;\n if (AutoNumericHelper.isNull(this.initialValue)) {\n // Same as above\n this.initialValue = '';\n }\n }\n\n /**\n * Generate all the event listeners for the given DOM element\n * @private\n */\n _createEventListeners() {\n // Create references to the event handler functions, so we can then cleanly removes those listeners if needed\n // That would not be possible if we used closures directly in the event handler declarations\n this._onFocusInFunc = e => { this._onFocusIn(e); };\n this._onFocusInAndMouseEnterFunc = e => { this._onFocusInAndMouseEnter(e); };\n this._onFocusFunc = () => { this._onFocus(); };\n this._onKeydownFunc = e => { this._onKeydown(e); };\n this._onKeypressFunc = e => { this._onKeypress(e); };\n this._onKeyupFunc = e => { this._onKeyup(e); };\n this._onFocusOutAndMouseLeaveFunc = e => { this._onFocusOutAndMouseLeave(e); };\n this._onPasteFunc = e => { this._onPaste(e); };\n this._onWheelFunc = e => { this._onWheel(e); };\n this._onDropFunc = e => { this._onDrop(e); };\n this._onKeydownGlobalFunc = e => { this._onKeydownGlobal(e); };\n this._onKeyupGlobalFunc = e => { this._onKeyupGlobal(e); };\n\n // Add the event listeners\n this.domElement.addEventListener('focusin', this._onFocusInFunc, false);\n this.domElement.addEventListener('focus', this._onFocusInAndMouseEnterFunc, false);\n this.domElement.addEventListener('focus', this._onFocusFunc, false);\n this.domElement.addEventListener('mouseenter', this._onFocusInAndMouseEnterFunc, false);\n this.domElement.addEventListener('keydown', this._onKeydownFunc, false);\n this.domElement.addEventListener('keypress', this._onKeypressFunc, false);\n this.domElement.addEventListener('keyup', this._onKeyupFunc, false);\n this.domElement.addEventListener('blur', this._onFocusOutAndMouseLeaveFunc, false);\n this.domElement.addEventListener('mouseleave', this._onFocusOutAndMouseLeaveFunc, false);\n this.domElement.addEventListener('paste', this._onPasteFunc, false);\n this.domElement.addEventListener('wheel', this._onWheelFunc, false);\n this.domElement.addEventListener('drop', this._onDropFunc, false);\n this._setupFormListener();\n\n // Create one global event listener for the keyup event on the document object, which will be shared by all the autoNumeric elements\n if (!AutoNumeric._doesGlobalListExists()) {\n document.addEventListener('keydown', this._onKeydownGlobalFunc, false);\n document.addEventListener('keyup', this._onKeyupGlobalFunc, false);\n }\n }\n\n /**\n * Remove all the autoNumeric-related event listeners for the given DOM element\n * @private\n */\n _removeEventListeners() {\n this.domElement.removeEventListener('focusin', this._onFocusInFunc, false);\n this.domElement.removeEventListener('focus', this._onFocusInAndMouseEnterFunc, false);\n this.domElement.removeEventListener('focus', this._onFocusFunc, false);\n this.domElement.removeEventListener('mouseenter', this._onFocusInAndMouseEnterFunc, false);\n this.domElement.removeEventListener('blur', this._onFocusOutAndMouseLeaveFunc, false);\n this.domElement.removeEventListener('mouseleave', this._onFocusOutAndMouseLeaveFunc, false);\n this.domElement.removeEventListener('keydown', this._onKeydownFunc, false);\n this.domElement.removeEventListener('keypress', this._onKeypressFunc, false);\n this.domElement.removeEventListener('keyup', this._onKeyupFunc, false);\n this.domElement.removeEventListener('paste', this._onPasteFunc, false);\n this.domElement.removeEventListener('wheel', this._onWheelFunc, false);\n this.domElement.removeEventListener('drop', this._onDropFunc, false);\n this._removeFormListener();\n\n document.removeEventListener('keydown', this._onKeydownGlobalFunc, false);\n document.removeEventListener('keyup', this._onKeyupGlobalFunc, false);\n }\n\n /**\n * Mark the parent <form> so that other AutoNumeric object will not add more listeners.\n * Add a counter so that when removing the AutoNumeric object, we only remove the submit listener if that count is equal to 0.\n * Also keep a reference to the 'submit' event handler function to be able to remove that handler later if the `_removeFormListener()` function is called from another AutoNumeric object.\n *\n * @private\n */\n _setupFormListener() {\n if (!AutoNumericHelper.isNull(this.parentForm)) {\n // Setup the handler function\n this._onFormSubmitFunc = () => { this._onFormSubmit(); };\n\n // Check if the parent form already has the AutoNumeric mark\n if (this._hasParentFormCounter()) {\n this._incrementParentFormCounter();\n } else {\n // If not, add the counter\n this._initializeFormCounterToOne();\n // And add the submit event listener\n this.parentForm.addEventListener('submit', this._onFormSubmitFunc, false);\n // Also keep a reference to the handler function so that we can remove it later\n this._storeFormHandlerFunction();\n }\n }\n }\n\n /**\n * Remove the form 'submit' event listener, as well as the `dataset` info (`anCount` and `anFormHandler`) from the parent form, only when there are only one AutoNumeric child element left in that <form>.\n * Otherwise decrement the `anCount`.\n *\n * @private\n */\n _removeFormListener() {\n if (!AutoNumericHelper.isNull(this.parentForm)) {\n // Check the parent form counter value\n const anCount = this._getParentFormCounter();\n\n if (anCount === 1) {\n // If it's 1, remove the listener\n this.parentForm.removeEventListener('submit', this._getFormHandlerFunction(), false);\n // Also remove the dataset info\n this._removeFormDataSetInfo();\n } else if (anCount > 1) {\n // Otherwise if it's >1 decrement the counter\n this._decrementParentFormCounter();\n } else {\n // If it's <1, throw an error\n AutoNumericHelper.throwError(`The AutoNumeric object count on the form is incoherent.`);\n }\n }\n }\n\n /**\n * Return `true` if the parent form has the form counter attribute\n *\n * @returns {boolean}\n * @private\n */\n _hasParentFormCounter() {\n return 'anCount' in this.parentForm.dataset;\n }\n\n /**\n * Return the count of AutoNumeric form children\n *\n * @returns {number}\n * @private\n */\n _getParentFormCounter() {\n return Number(this.parentForm.dataset.anCount);\n }\n\n /**\n * Set the count of AutoNumeric form children to 1 for the given form element, or if none are passed, the current `this.parentForm` one.\n *\n * @param {HTMLFormElement|null} formElement\n * @private\n */\n _initializeFormCounterToOne(formElement = null) {\n this._getFormElement(formElement).dataset.anCount = 1;\n }\n\n /**\n * Increment the AutoNumeric form children count for the given form element, or if none are passed, the current `this.parentForm` one.\n *\n * @param {HTMLFormElement|null} formElement\n * @private\n */\n _incrementParentFormCounter(formElement = null) {\n this._getFormElement(formElement).dataset.anCount++;\n }\n\n /**\n * Decrement the AutoNumeric form children count for the current `this.parentForm` form element.\n *\n * @private\n */\n _decrementParentFormCounter() {\n this.parentForm.dataset.anCount--;\n }\n\n /**\n * Return `true` if the global form handler list exists on the `window` object.\n *\n * @returns {boolean}\n * @private\n */\n static _doesFormHandlerListExists() {\n const type = typeof window.aNFormHandlerMap;\n\n return type !== 'undefined' && type === 'object';\n }\n\n /**\n * Create the global form handler list on the `window` object.\n *\n * @private\n */\n static _createFormHandlerList() {\n window.aNFormHandlerMap = new Map(); // I would have used a `WeakMap` here, but that does not allow using non-object for keys\n }\n\n /**\n * Return `true` if the given form element, or if none are passed, the current `this.parentForm` one has a form handler name.\n *\n * @param {HTMLFormElement|null} formElement\n * @returns {boolean}\n * @private\n */\n _hasFormHandlerFunction(formElement = null) {\n return 'anFormHandler' in this._getFormElement(formElement).dataset;\n }\n\n /**\n * Return the given form element, or defaults to `this.parentForm` if no argument is passed.\n *\n * @param {HTMLFormElement|null} formElement\n * @returns {*}\n * @private\n */\n _getFormElement(formElement = null) {\n let formElementToUse;\n if (!AutoNumericHelper.isNull(formElement)) {\n formElementToUse = formElement;\n } else {\n formElementToUse = this.parentForm;\n }\n\n return formElementToUse;\n }\n\n /**\n * Generate a form handler unique name and store it in the global form handler list.\n * This also save that name in the dataset of the given form element.\n *\n * @param {HTMLFormElement|null} formElement\n * @private\n */\n _storeFormHandlerFunction(formElement = null) {\n // Create the weakMap if it does not exist\n if (!this.constructor._doesFormHandlerListExists()) {\n this.constructor._createFormHandlerList();\n }\n\n // Generate a unique name and save it in the form dataset\n const formHandlerName = AutoNumericHelper.randomString();\n this._getFormElement(formElement).dataset.anFormHandler = formHandlerName;\n\n // Add the form handler name and handle function reference to the WeakMap\n window.aNFormHandlerMap.set(formHandlerName, this._onFormSubmitFunc);\n }\n\n /**\n * Return the form handler key name from the parent form element, for the global form handler list.\n *\n * @returns {string|*}\n * @private\n */\n _getFormHandlerKey() {\n if (!this._hasFormHandlerFunction()) {\n AutoNumericHelper.throwError(`Unable to retrieve the form handler name`);\n }\n\n const formHandlerName = this.parentForm.dataset.anFormHandler;\n if (formHandlerName === '') {\n AutoNumericHelper.throwError(`The form handler name is invalid`);\n }\n\n return formHandlerName;\n }\n\n /**\n * Return the 'submit' event handler function used for the parent form.\n *\n * @returns {function}\n * @private\n */\n _getFormHandlerFunction() {\n const formHandlerName = this._getFormHandlerKey();\n\n return window.aNFormHandlerMap.get(formHandlerName);\n }\n\n /**\n * Remove the dataset attributes `data-an-count` and `data-an-form-handler` from the parent form element.\n *\n * @private\n */\n _removeFormDataSetInfo() {\n // Just in case, set the counter to 0\n this._decrementParentFormCounter();\n // Remove the form handler function from the FormHandlerFunction Map\n window.aNFormHandlerMap.delete(this._getFormHandlerKey());\n // Lastly, remove the dataset attributes\n this.parentForm.removeAttribute('data-an-count');\n this.parentForm.removeAttribute('data-an-form-handler');\n }\n\n /**\n * Set the element attribute 'readonly' according to the current settings.\n *\n * @private\n */\n _setReadOnly() {\n if (this.isInputElement && this.settings.readOnly) {\n this.domElement.readOnly = true;\n }\n }\n\n /**\n * Add a watcher so that any external change to the AutoNumeric-managed element would be detected.\n * As soon as such change is detected, AutoNumeric then tries to `set()` the value so that it gets formatted and stored in the history.\n * //XXX For now, this only works when watching the `value` attribute, not the `textContent` one\n * @private\n */\n _addWatcher() {\n // `getterSetter` can be undefined when a non-input element is used\n if (!AutoNumericHelper.isUndefined(this.getterSetter)) {\n const { set: setter, get: getter } = this.getterSetter;\n Object.defineProperty(this.domElement, this.attributeToWatch, {\n configurable: true, // This is needed in some rare cases\n get : () => getter.call(this.domElement),\n set : val => {\n setter.call(this.domElement, val);\n // Only `set()` the value if the modification comes from an external source\n if (this.settings.watchExternalChanges && !this.internalModification) {\n this.set(val);\n }\n },\n });\n }\n\n //FIXME The code above fails for the `textContent` attribute since `this.getterSetter` is undefined when using `getOwnPropertyDescriptor()`\n /* //XXX The code below *almost* work for the textContent, but breaks some unit tests\n this.valueWatched = this.domElement[this.attributeToWatch];\n Object.defineProperty(this.domElement, this.attributeToWatch, {\n configurable: true, // This is needed in some rare cases\n get : () => this.valueWatched,\n set : val => {\n this.valueWatched = val;\n // Only `set()` the value if the modification comes from an external source\n if (this.settings.watchExternalChanges && !this.internalModification) {\n this.set(val);\n }\n },\n });\n */\n }\n\n /**\n * Remove the watcher on the AutoNumeric-managed element\n * Note: This needs to be called when the AutoNumeric element is 'removed', otherwise the getter/setter stays on the DOM element and that can lead to problem if the user initialize another AutoNumeric object on it.\n * @private\n */\n _removeWatcher() {\n // `getterSetter` can be undefined when a non-input element is used\n if (!AutoNumericHelper.isUndefined(this.getterSetter)) {\n const { set: setter, get: getter } = this.getterSetter;\n Object.defineProperty(this.domElement, this.attributeToWatch, {\n configurable: true, // This is needed in some rare cases\n get : () => getter.call(this.domElement),\n set : val => {\n setter.call(this.domElement, val);\n },\n });\n }\n\n //FIXME The code above fails for the `textContent` attribute since `this.getterSetter` is undefined when using `getOwnPropertyDescriptor()`\n /* //XXX The code below *almost* work for the textContent, but breaks some unit tests\n this.valueWatched = this.domElement[this.attributeToWatch];\n Object.defineProperty(this.domElement, this.attributeToWatch, {\n configurable: true, // This is needed in some rare cases\n get : () => this.valueWatched,\n set : val => {\n this.valueWatched = val;\n },\n });\n */\n }\n\n /**\n * Return the name of the object attribute that store the current formatted data in the DOM element.\n *\n * @returns {string}\n * @private\n */\n _getAttributeToWatch() {\n let attributeToWatch;\n if (this.isInputElement) {\n attributeToWatch = 'value';\n } else {\n const nodeType = this.domElement.nodeType;\n if (nodeType === Node.ELEMENT_NODE ||\n nodeType === Node.DOCUMENT_NODE ||\n nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n attributeToWatch = 'textContent';\n } else if (nodeType === Node.TEXT_NODE) {\n attributeToWatch = 'nodeValue';\n }\n }\n\n return attributeToWatch;\n }\n\n /**\n * Save the current raw value into the history table, along with the selection information.\n *\n * If the user has done some undos and tries to enter:\n * - a new and different number than the 'next' state, this drops the rest of the history table\n * - the very same number that result in the same rawValue than the 'next' state, we only move the history table pointer to the next state\n *\n * @private\n */\n _historyTableAdd() {\n //TODO Add a `this.settings.saveSelectionsIntoHistory` option to prevent saving the selections (in order to gain performance)\n const isEmptyHistoryTable = this.historyTable.length === 0;\n // Only add a new value if it's different than the previous one (to prevent infinitely adding values on mouseover for instance)\n if (isEmptyHistoryTable || this.rawValue !== this._historyTableCurrentValueUsed()) {\n // Trim the history table if the user changed the value of an intermediary state\n let addNewHistoryState = true;\n if (!isEmptyHistoryTable) {\n // If some undo has been done and the user type the exact same data than the next entry after the current history pointer, do no drop the rest of the 'redo' list, and just advance the historyTableIndex\n const nextHistoryStateIndex = this.historyTableIndex + 1;\n if (nextHistoryStateIndex < this.historyTable.length && this.rawValue === this.historyTable[nextHistoryStateIndex].value) {\n // If the character input result in the same state than the next one, do not remove the next history states nor add a new one\n addNewHistoryState = false;\n } else {\n // First remove anything that is after the current index\n AutoNumericHelper.arrayTrim(this.historyTable, this.historyTableIndex + 1);\n }\n }\n\n // Update the history pointer\n this.historyTableIndex++;\n\n // Add the new history state, if needed\n if (addNewHistoryState) {\n // Save the selection info\n const selection = AutoNumericHelper.getElementSelection(this.domElement);\n this.selectionStart = selection.start;\n this.selectionEnd = selection.end;\n\n // Then add the new raw value\n this.historyTable.push({\n // Save the rawValue and selection start/end\n value: this.rawValue,\n // The selection for this element is temporary, and will be updated when the next history state will be recorded.\n // That way, we are always sure we save the last caret or selection positions just before the value is changed. Otherwise we would only save those positions when the value is first changed, and would not take into account that the user could move the caret around afterward.\n // For instance, this is needed if the user change the element value, and immediately undo it ; if he then does a redo, he'll see the value and the right selection\n // To sum up; The selection position are not always +1 character, since it could also be '2' if a group separator is added when entering one character. That's why the current history state caret/selection position is updated on each `keyup` event.\n start: this.selectionStart + 1, // Here we add one since the user added one character too\n end : this.selectionEnd + 1,\n });\n\n // Update the selection in the previous entry, in order to keep track of the updated caret/selection positions\n if (this.historyTable.length > 1) {\n this.historyTable[this.historyTableIndex - 1].start = this.selectionStart;\n this.historyTable[this.historyTableIndex - 1].end = this.selectionEnd;\n }\n }\n\n // Limit the history table size according to the `historySize` option\n if (this.historyTable.length > this.settings.historySize) {\n this._historyTableForget();\n }\n }\n }\n\n /**\n * Debug function for the history table\n * @private\n */\n /*\n _debugHistoryTable() {\n let i = 0;\n let mark;\n this.historyTable.forEach(history => {\n if (this.historyTableIndex === i) {\n mark = '> ';\n } else {\n mark = '';\n }\n console.log(`${mark}${i++}: ${history.value} ${history.start}|${history.end} [onGoingRedo: ${this.onGoingRedo}]`); //DEBUG\n });\n }\n */\n\n /**\n * 'Undo' or 'Redo' the last/next user entry in the history table.\n * This does not modify the history table, only the pointer to the current state.\n *\n * @param {boolean} undo If set to `true`, then this function does an 'Undo', otherwise it does a 'Redo'\n * @private\n */\n _historyTableUndoOrRedo(undo = true) {\n let check;\n if (undo) {\n // Only 'undo' if there are some info to undo\n check = this.historyTableIndex > 0;\n if (check) {\n this.historyTableIndex--;\n }\n } else {\n // Only 'redo' if there are some info to redo at the end of the history table\n check = this.historyTableIndex + 1 < this.historyTable.length;\n if (check) {\n this.historyTableIndex++;\n }\n }\n\n if (check) {\n // Set the value back\n const undoInfo = this.historyTable[this.historyTableIndex];\n this.set(undoInfo.value, null, false); // next or previous raw value\n\n // Set the selection back\n AutoNumericHelper.setElementSelection(this.domElement, undoInfo.start, undoInfo.end);\n }\n }\n\n /**\n * 'Undo' the last user entry by going back one entry in the history table.\n * This keeps the following entries in order to allow for a 'redo'.\n * This does not modify the history table, only the pointer to the current state.\n * @private\n */\n _historyTableUndo() {\n this._historyTableUndoOrRedo(true);\n }\n\n /**\n * 'Redo' the next user entry in the history table.\n * This does not modify the history table, only the pointer to the current state.\n * @private\n */\n _historyTableRedo() {\n this._historyTableUndoOrRedo(false);\n }\n\n /**\n * Reset the history table to its initial state, and select the value.\n * @private\n */\n /*\n resetHistoryTable() { //FIXME Test this\n this.set(this.rawValue, null, false);\n this.select();\n const selection = AutoNumericHelper.getElementSelection(this.domElement);\n this.historyTableIndex = 0;\n this.historyTable = [{\n // Save the rawValue and selection start/end\n value: this.rawValue,\n start: selection.start,\n end : selection.end,\n }];\n }\n */\n\n /**\n * Make the history table forget its first N elements, shifting its indexes in the process.\n * `N` being given as the `numberOfEntriesToForget` parameter.\n *\n * @param {Number} numberOfEntriesToForget\n * @returns {object|Array<object>} The discarded objects, in an Array.\n * @private\n */\n _historyTableForget(numberOfEntriesToForget = 1) {\n const shiftedAway = [];\n for (let i = 0; i < numberOfEntriesToForget; i++) {\n shiftedAway.push(this.historyTable.shift());\n // Update the history table index accordingly\n this.historyTableIndex--;\n if (this.historyTableIndex < 0) {\n // In case this function is called more times than there is states in the history table\n this.historyTableIndex = 0;\n }\n }\n\n if (shiftedAway.length === 1) {\n return shiftedAway[0];\n }\n\n return shiftedAway;\n }\n\n /**\n * Return the currently used value from the history table.\n *\n * @returns {string|number}\n * @private\n */\n _historyTableCurrentValueUsed() {\n let indexToUse = this.historyTableIndex;\n if (indexToUse < 0) {\n indexToUse = 0;\n }\n\n let result;\n if (AutoNumericHelper.isUndefinedOrNullOrEmpty(this.historyTable[indexToUse])) {\n result = '';\n } else {\n result = this.historyTable[indexToUse].value;\n }\n\n return result;\n }\n\n /**\n * Parse the `styleRules` option and run the test for each given rules, either pre-defined ones like `positive`, `negative` and `ranges`, or user defined callbacks within the `userDefined` attribute.\n * @private\n */\n _parseStyleRules() {\n if (AutoNumericHelper.isUndefinedOrNullOrEmpty(this.settings.styleRules) || this.rawValue === '') {\n return;\n }\n\n // 'positive' attribute\n if (!AutoNumericHelper.isUndefinedOrNullOrEmpty(this.settings.styleRules.positive)) {\n if (this.rawValue >= 0) {\n this._addCSSClass(this.settings.styleRules.positive);\n } else {\n this._removeCSSClass(this.settings.styleRules.positive);\n }\n }\n\n // 'negative' attribute\n if (!AutoNumericHelper.isUndefinedOrNullOrEmpty(this.settings.styleRules.negative)) {\n if (this.rawValue < 0) {\n this._addCSSClass(this.settings.styleRules.negative);\n } else {\n this._removeCSSClass(this.settings.styleRules.negative);\n }\n }\n\n // 'ranges' attribute\n if (!AutoNumericHelper.isUndefinedOrNullOrEmpty(this.settings.styleRules.ranges) && this.settings.styleRules.ranges.length !== 0) {\n this.settings.styleRules.ranges.forEach(range => {\n if (this.rawValue >= range.min && this.rawValue < range.max) {\n this._addCSSClass(range.class);\n } else {\n this._removeCSSClass(range.class);\n }\n });\n }\n\n // 'userDefined' attribute\n //TODO Also pass the old raw value as a parameter, and not only the new raw value\n if (!AutoNumericHelper.isUndefinedOrNullOrEmpty(this.settings.styleRules.userDefined) && this.settings.styleRules.userDefined.length !== 0) {\n this.settings.styleRules.userDefined.forEach(userObject => {\n if (AutoNumericHelper.isFunction(userObject.callback)) {\n // Test for the type of the `classes` attribute, which changes the function behavior\n if (AutoNumericHelper.isString(userObject.classes)) {\n // If 'classes' is a string, set it if `true`, remove it if `false`\n if (userObject.callback(this.rawValue)) {\n this._addCSSClass(userObject.classes);\n } else {\n this._removeCSSClass(userObject.classes);\n }\n } else if (AutoNumericHelper.isArray(userObject.classes)) {\n if (userObject.classes.length === 2) {\n // If 'classes' is an array with only 2 elements, set the first class if `true`, the second if `false`\n if (userObject.callback(this.rawValue)) {\n this._addCSSClass(userObject.classes[0]);\n this._removeCSSClass(userObject.classes[1]);\n } else {\n this._removeCSSClass(userObject.classes[0]);\n this._addCSSClass(userObject.classes[1]);\n }\n } else if (userObject.classes.length > 2) {\n // The callback returns an array of indexes to use on the `classes` array\n const callbackResult = userObject.callback(this.rawValue);\n if (AutoNumericHelper.isArray(callbackResult)) {\n // If multiple indexes are returned\n userObject.classes.forEach((userClass, index) => {\n if (AutoNumericHelper.isInArray(index, callbackResult)) {\n this._addCSSClass(userClass);\n } else {\n this._removeCSSClass(userClass);\n }\n });\n } else if (AutoNumericHelper.isInt(callbackResult)) {\n // If only one index is returned\n userObject.classes.forEach((userClass, index) => {\n if (index === callbackResult) {\n this._addCSSClass(userClass);\n } else {\n this._removeCSSClass(userClass);\n }\n });\n } else if (AutoNumericHelper.isNull(callbackResult)) {\n // Remove all the classes\n userObject.classes.forEach(userClass => {\n this._removeCSSClass(userClass);\n });\n } else {\n AutoNumericHelper.throwError(`The callback result is not an array nor a valid array index, ${typeof callbackResult} given.`);\n }\n } else {\n AutoNumericHelper.throwError('The classes attribute is not valid for the `styleRules` option.');\n }\n } else if (AutoNumericHelper.isUndefinedOrNullOrEmpty(userObject.classes)) {\n // If 'classes' is `undefined` or `null`, then the callback is called with the AutoNumeric object passed as a parameter\n userObject.callback(this);\n } else {\n AutoNumericHelper.throwError('The callback/classes structure is not valid for the `styleRules` option.');\n }\n } else {\n AutoNumericHelper.warning(`The given \\`styleRules\\` callback is not a function, ${typeof callback} given.`, this.settings.showWarnings);\n }\n });\n }\n }\n\n /**\n * Add the given CSS class to the DOM element.\n *\n * @param {string} cssClassName\n * @private\n */\n _addCSSClass(cssClassName) {\n this.domElement.classList.add(cssClassName);\n }\n\n /**\n * Remove the given CSS class from the DOM element.\n *\n * @param {string} cssClassName\n * @private\n */\n _removeCSSClass(cssClassName) {\n this.domElement.classList.remove(cssClassName);\n }\n\n // This are the public function available on each autoNumeric-managed element\n\n /**\n * Method that updates the AutoNumeric settings, and immediately format the element accordingly.\n * The options passed as parameter(s) is either one or many objects that each contains some settings, ie. :\n * {\n * digitGroupSeparator: \".\",\n * decimalCharacter: \",\",\n * currencySymbol: '€ ',\n * }\n * If multiple options are passed, the latter overwrite the previous ones.\n *\n * Note: If the new settings are not validated, or the call to `set()` fails, then the previous valid settings are reverted back to.\n *\n * @example anElement.update({ options }) // Updates the settings\n * @example anElement.update({ options1 }, { options2 }) // Updates the settings with multiple option objects\n * @example anElement.update([{ options1 }, { options2 }]) // Updates the settings with multiple option objects in a single array\n *\n * @param {object|string|array} newOptions\n * @returns {AutoNumeric}\n */\n update(...newOptions) {\n if (Array.isArray(newOptions) && Array.isArray(newOptions[0])) {\n // Allows to pass a single array of options\n newOptions = newOptions[0];\n }\n\n // Keep a copy of the original settings before changing them, in case they do not validate correctly, so we can switch back to them\n const originalSettings = AutoNumericHelper.cloneObject(this.settings); //TODO Check that the `styleRules` option is correctly cloned (due to depth cloning limitation)\n\n // Store the current unformatted input value\n const numericString = this.rawValue;\n\n // Generate a single option object with the settings from the latter overwriting those from the former\n let optionsToUse = {};\n if (AutoNumericHelper.isUndefinedOrNullOrEmpty(newOptions) || newOptions.length === 0) {\n optionsToUse = null;\n } else if (newOptions.length >= 1) {\n newOptions.forEach(optionObject => {\n if (this.constructor._isPreDefinedOptionValid(optionObject)) {\n // The option object is a predefined option name (ie. 'euro')\n optionObject = this.constructor._getOptionObject(optionObject);\n }\n\n Object.assign(optionsToUse, optionObject);\n });\n }\n\n // Update the settings\n try {\n this._setSettings(optionsToUse, true);\n\n // Reformat the input value with the new settings\n // Note: we always `set`, even when `numericString` is the empty string '', since `emptyInputBehavior` (set to `always` or `zero`) can change how the empty input is formatted\n this.set(numericString);\n } catch (error) {\n // If the settings validation fails, then we switch back to the previous valid settings\n this._setSettings(originalSettings, true); // `_setSettings()` is used here instead of directly doing `this.settings = originalSettings;` since lots of side variables are calculated from the settings, and we need to get those back to their previous state. Note: `_setSettings()` is called in the 'update' mode in order to correctly set back the `originalDecimalPlacesRawValue` value.\n AutoNumericHelper.throwError(`Unable to update the settings, those are invalid: [${error}]`);\n\n return this;\n }\n\n return this;\n }\n\n /**\n * Return the options object containing all the current autoNumeric settings in effect.\n * You can then directly access each option by using its name : `anElement.getSettings().optionNameAutoCompleted`.\n *\n * @example\n * anElement.getSettings()\n * anElement.getSettings().decimalCharacter // Return the decimalCharacter setting as a string - any valid option name can be used\n *\n * @returns {object}\n */\n getSettings() {\n return this.settings;\n }\n\n /**\n * Set the given element value, and format it immediately.\n * Additionally, this `set()` method can accept options that will be merged into the current AutoNumeric element, taking precedence over any previous settings.\n *\n * @example anElement.set('12345.67') // Formats the value\n * @example anElement.set(12345.67) // Formats the value\n * @example anElement.set(12345.67, { decimalCharacter : ',' }) // Update the settings and formats the value in one go\n * @example anElement.northAmerican().set('$12,345.67') // Set an already formatted value (this does not _exactly_ respect the currency symbol/negative placements, but only remove all non-numbers characters, according to the ones given in the settings)\n * @example anElement.set(null) // Set the rawValue and element value to `null`\n *\n * @param {number|string|null} newValue The value must be a Number, a numeric string or `null` (if `emptyInputBehavior` is set to `'null'`)\n * @param {object} options A settings object that will override the current settings. Note: the update is done only if the `newValue` is defined.\n * @param {boolean} saveChangeToHistory If set to `true`, then the change is recorded in the history table\n * @returns {AutoNumeric}\n * @throws\n */\n set(newValue, options = null, saveChangeToHistory = true) {\n //TODO Add the `saveSettings` options. If `true`, then when `options` is passed, then it overwrite the current `this.settings`. If `false` the `options` are only used once and `this.settings` is not modified\n if (AutoNumericHelper.isUndefined(newValue)) {\n AutoNumericHelper.warning(`You are trying to set an 'undefined' value ; an error could have occurred.`, this.settings.showWarnings);\n return this;\n }\n\n // The options update is done only if the `newValue` is not `undefined`\n if (!AutoNumericHelper.isNull(options)) {\n this._setSettings(options, true); // We do not call `update` here since this would call `set` too\n }\n\n if (newValue === null && this.settings.emptyInputBehavior !== AutoNumeric.options.emptyInputBehavior.null) {\n AutoNumericHelper.warning(`You are trying to set the \\`null\\` value while the \\`emptyInputBehavior\\` option is set to ${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);\n return this;\n }\n\n let value;\n if (newValue === null) {\n //TODO Merge this into a global `if (newValue === null) {` test, with the test above\n // Here this.settings.emptyInputBehavior === AutoNumeric.options.emptyInputBehavior.null\n this._setElementAndRawValue(null, null, saveChangeToHistory);\n this._saveValueToPersistentStorage();\n\n return this;\n }\n\n value = this.constructor._toNumericValue(newValue, this.settings);\n if (isNaN(Number(value))) {\n //TODO Do not modify the element value if the newValue results in `NaN`. Make sure the settings, if modified, are revert back too.\n AutoNumericHelper.warning(`The value you are trying to set results in \\`NaN\\`. The element value is set to the empty string instead.`, this.settings.showWarnings);\n this.setValue('', saveChangeToHistory);\n\n return this;\n }\n \n if (value === '' && this.settings.emptyInputBehavior === AutoNumeric.options.emptyInputBehavior.zero) {\n // Keep the value zero inside the element\n value = 0;\n }\n\n if (value !== '') {\n const [minTest, maxTest] = this.constructor._checkIfInRangeWithOverrideOption(value, this.settings);\n\n // Modify the formatted value if the rawValue is found in the `valuesToStrings` option\n if (minTest && maxTest && this.settings.valuesToStrings && this._checkValuesToStrings(value)) {\n // Set the raw value normally, and the formatted value with the corresponding string\n this._setElementAndRawValue(this.settings.valuesToStrings[value], value, saveChangeToHistory);\n this._saveValueToPersistentStorage();\n\n return this;\n }\n\n // This test is needed by the `showPositiveSign` option\n const isZero = AutoNumericHelper.isZeroOrHasNoValue(value);\n if (isZero) {\n value = '0';\n }\n\n if (minTest && maxTest) {\n let forcedRawValue = this.constructor._roundRawValue(value, this.settings);\n forcedRawValue = this._trimLeadingAndTrailingZeros(forcedRawValue.replace(this.settings.decimalCharacter, '.')); // Move the `setRawValue` call after the `setElementValue` one\n value = this._getRawValueToFormat(value); // Multiply the raw value to obtain the formatted value\n\n // Round the given value according to the object state (focused/unfocused)\n if (this.isFocused) {\n value = this.constructor._roundFormattedValueShownOnFocus(value, this.settings);\n } else {\n if (this.settings.divisorWhenUnfocused) {\n value = value / this.settings.divisorWhenUnfocused;\n value = value.toString();\n }\n\n value = this.constructor._roundFormattedValueShownOnBlur(value, this.settings);\n }\n\n value = this.constructor._modifyNegativeSignAndDecimalCharacterForFormattedValue(value, this.settings);\n value = this.constructor._addGroupSeparators(value, this.settings, this.isFocused, this.rawValue, forcedRawValue);\n if (!this.isFocused && this.settings.symbolWhenUnfocused) {\n value = `${value}${this.settings.symbolWhenUnfocused}`;\n }\n\n if (this.settings.decimalPlacesShownOnFocus || this.settings.divisorWhenUnfocused) {\n this._saveValueToPersistentStorage();\n }\n\n this._setElementAndRawValue(value, forcedRawValue, saveChangeToHistory);\n\n return this;\n } else {\n if (!minTest) {\n this._triggerEvent(AutoNumeric.events.minRangeExceeded, this.domElement);\n }\n\n if (!maxTest) {\n this._triggerEvent(AutoNumeric.events.maxRangeExceeded, this.domElement);\n }\n\n AutoNumericHelper.throwError(`The value [${value}] being set falls outside of the minimumValue [${this.settings.minimumValue}] and maximumValue [${this.settings.maximumValue}] range set for this element`);\n\n this._removeValueFromPersistentStorage();\n this.setValue('', saveChangeToHistory); //TODO Shouldn't we just drop that faulty newValue and keep the previous one? This is behind a `throwError()` call anyway..\n\n return this;\n }\n } else {\n // Here, `value` equal the empty string `''`\n let result;\n if (this.settings.emptyInputBehavior === AutoNumeric.options.emptyInputBehavior.always) {\n // Keep the currency symbol as per emptyInputBehavior\n result = this.settings.currencySymbol;\n } else {\n result = '';\n }\n\n this._setElementAndRawValue(result, '', saveChangeToHistory);\n\n return this;\n }\n }\n\n /**\n * Set the given value directly as the DOM element value, without formatting it beforehand.\n * You can also set the value and update the setting in one go (the value will again not be formatted immediately).\n *\n * @param {number|string} value\n * @param {object} options\n * @returns {AutoNumeric}\n * @throws\n */\n setUnformatted(value, options = null) {\n //TODO Should we use `AutoNumeric.unformat()` here and set the unformatted result in case `value` is formatted?\n if (value === null || AutoNumericHelper.isUndefined(value)) {\n return this;\n }\n\n // The options update is done only if the `value` is not null\n if (!AutoNumericHelper.isNull(options)) {\n this._setSettings(options, true); // We do not call `update` here since this would call `set` too\n }\n\n const strippedValue = this.constructor._removeBrackets(value, this.settings);\n const normalizedValue = this.constructor._stripAllNonNumberCharacters(strippedValue, this.settings, true, this.isFocused);\n if (!AutoNumericHelper.isNumber(normalizedValue)) {\n AutoNumericHelper.throwError(`The value is not a valid one, it's not a numeric string nor a recognized currency.`);\n }\n\n const [minTest, maxTest] = this.constructor._checkIfInRangeWithOverrideOption(normalizedValue, this.settings);\n if (minTest && maxTest) {\n // If the `normalizedValue` is in the range\n this.setValue(value);\n } else {\n AutoNumericHelper.throwError(`The value is out of the range limits [${this.settings.minimumValue}, ${this.settings.maximumValue}].`);\n }\n\n return this;\n }\n\n /**\n * Set the given value directly as the DOM element value, without formatting it beforehand, and without checking its validity.\n * This also updates the `rawValue` with the given `newValue`, without checking it too ; if it's not formatted like a number recognized by Javascript, this *will* likely make other AutoNumeric methods fail.\n *\n * @param {string|number|null} newValue The new value to set on the element\n * @param {boolean} saveChangeToHistory If set to `true`, then the change is recorded in the history array, otherwise it is not\n * @returns {AutoNumeric}\n */\n setValue(newValue, saveChangeToHistory = true) {\n this._setElementAndRawValue(newValue, saveChangeToHistory);\n\n return this;\n }\n\n /**\n * Save the raw value inside the AutoNumeric object.\n *\n * @param {number|string|null} rawValue The numeric value as understood by Javascript like a `Number`\n * @param {boolean} saveChangeToHistory If set to `true`, then the change is recorded in the history array, otherwise it is not\n * @private\n */\n _setRawValue(rawValue, saveChangeToHistory = true) {\n // Only set the raw value if the given value is different than the current one\n if (this.rawValue !== rawValue) { //TODO Manage the case where one value is a string while the other is a number?\n const oldRawValue = this.rawValue;\n // Update the raw value\n this.rawValue = rawValue; // By default, if the `rawValue` is changed programmatically\n\n if ((!AutoNumericHelper.isNull(this.settings.rawValueDivisor) && this.settings.rawValueDivisor !== 0) && // Only divide if the `rawValueDivisor` option is set\n rawValue !== '' && rawValue !== null && // Do not modify the `rawValue` if it's an empty string or null\n this._isUserManuallyEditingTheValue()) { // If the user is manually changing the element value\n this.rawValue /= this.settings.rawValueDivisor;\n }\n\n // Broadcast the `rawValueModified` event since the `rawValue` has been modified\n this._triggerEvent(AutoNumeric.events.rawValueModified, this.domElement, {\n oldRawValue,\n newRawValue: this.rawValue,\n isPristine : this.isPristine(true),\n error : null,\n aNElement : this,\n });\n\n // Change the element style or use the relevant callbacks\n this._parseStyleRules();\n\n if (saveChangeToHistory) {\n // Save in the history the last known raw value and formatted result selection\n this._historyTableAdd();\n }\n }\n }\n\n /**\n * Set the given value on the DOM element, without affecting the `rawValue`.\n * This send an 'autoNumeric:formatted' event if the new value is different than the old one.\n *\n * @param {number|string} newElementValue\n * @param {boolean} sendFormattedEvent If set to `true`, then the `AutoNumeric.events.formatted` event is sent if the value has changed\n * @returns {AutoNumeric}\n * @private\n */\n _setElementValue(newElementValue, sendFormattedEvent = true) {\n //TODO Use an internal attribute to track the current value of the element `formattedValue` (like its counterpart `rawValue`). This would allow us to avoid calling `getElementValue` many times\n const oldElementValue = AutoNumericHelper.getElementValue(this.domElement);\n\n // Only update the value if it's different from the current one\n if (newElementValue !== oldElementValue) {\n this.internalModification = true;\n AutoNumericHelper.setElementValue(this.domElement, newElementValue);\n this.internalModification = false;\n\n if (sendFormattedEvent) {\n this._triggerEvent(AutoNumeric.events.formatted, this.domElement, {\n oldValue : oldElementValue,\n newValue : newElementValue,\n oldRawValue: this.rawValue,\n newRawValue: this.rawValue,\n isPristine : this.isPristine(false),\n error : null,\n aNElement : this,\n });\n }\n }\n\n return this;\n }\n\n /**\n * Set the given value on the DOM element, and the raw value on `this.rawValue`, if both are given.\n * If only one value is given, then both the DOM element value and the raw value are set with that value.\n * The third argument `saveChangeToHistory` defines if the change should be recorded in the history array.\n * Note: if the second argument `rawValue` is a boolean, we consider that is really is the `saveChangeToHistory` argument.\n *\n * @param {number|string|null} newElementValue\n * @param {number|string|null|boolean} rawValue\n * @param {boolean} saveChangeToHistory\n * @returns {AutoNumeric}\n * @private\n */\n _setElementAndRawValue(newElementValue, rawValue = null, saveChangeToHistory = true) {\n if (AutoNumericHelper.isNull(rawValue)) {\n rawValue = newElementValue;\n } else if (AutoNumericHelper.isBoolean(rawValue)) {\n saveChangeToHistory = rawValue;\n rawValue = newElementValue;\n }\n\n //XXX The order here is important ; the value should first be set on the element, then and only then we should update the raw value\n // In the `set()` function, we make sure to call `_setRawValue` *after* `setElementValue` so that if `_setRawValue` calls a callback that modify the `rawValue`, then the new value is set correctly (after `setElementValue` briefly set its value first)\n this._setElementValue(newElementValue);\n this._setRawValue(rawValue, saveChangeToHistory);\n\n return this;\n }\n\n /**\n * Return the multiplied raw value with the `rawValueDivisor`.\n * This is used to display different values between the raw and formatted values.\n *\n * @param {number|string|null} rawValue The numeric value as understood by Javascript like a `Number`\n * @returns {number|string|null}\n * @private\n */\n _getRawValueToFormat(rawValue) {\n let rawValueForTheElementValue;\n if ((!AutoNumericHelper.isNull(this.settings.rawValueDivisor) && this.settings.rawValueDivisor !== 0) && // Only multiply if the `rawValueDivisor` option is set\n rawValue !== '' && rawValue !== null) { // Do not modify the `rawValue` if it's an empty string or null\n // !this._isUserManuallyEditingTheValue()) { // If the user is NOT manually changing the element value, but that is done programmatically\n rawValueForTheElementValue = rawValue * this.settings.rawValueDivisor;\n } else {\n rawValueForTheElementValue = rawValue;\n }\n\n return rawValueForTheElementValue;\n }\n\n /**\n * Check if the given value has a corresponding key in the `valuesToStrings` option object.\n *\n * @param {number|string} value\n * @returns {boolean} Returns `true` if such a key is found.\n * @private\n */\n _checkValuesToStrings(value) {\n return this.constructor._checkValuesToStringsArray(value, this.valuesToStringsKeys);\n }\n\n /**\n * Check if the given value has a corresponding key in the `stringsArray` array.\n *\n * @param {number|string} key\n * @param {array} stringsArray Array where the `key` is checked against its keys\n * @returns {boolean} Returns `true` if such a key is found.\n * @private\n */\n static _checkValuesToStringsArray(key, stringsArray) {\n return AutoNumericHelper.isInArray(String(key), stringsArray);\n }\n\n /**\n * Static helper for checking if the given `key` is found in the settings' `valuesToStrings` option object.\n *\n * @param {number|string} key\n * @param {object} settings\n * @returns {boolean}\n * @private\n */\n static _checkValuesToStringsSettings(key, settings) {\n return this._checkValuesToStringsArray(key, Object.keys(settings.valuesToStrings));\n }\n\n /**\n * Static helper for checking if the given `value` is found in the settings' `valuesToStrings` option object.\n *\n * @param {number|string} value\n * @param {object} settings\n * @returns {boolean}\n * @private\n */\n static _checkStringsToValuesSettings(value, settings) {\n return this._checkValuesToStringsArray(value, Object.values(settings.valuesToStrings));\n }\n\n /**\n * Return `true` if the user is currently modifying the element value manually.\n *\n * @returns {boolean}\n * @private\n */\n _isUserManuallyEditingTheValue() {\n // return (this.isFocused && this.isEditing) || this.isWheelEvent || this.isDropEvent;\n return (this.isFocused && this.isEditing) || this.isDropEvent;\n }\n\n /**\n * Execute the given callback function using the given result as its first parameter, and the AutoNumeric object as its second.\n *\n * @param {number|string|Array|null} result\n * @param {function|null} callback If a callback is passed, then the result is passed to it as its first argument, and the AutoNumeric object has its second\n * @private\n */\n _executeCallback(result, callback) {\n if (!AutoNumericHelper.isNull(callback) && AutoNumericHelper.isFunction(callback)) {\n callback(result, this);\n }\n }\n\n /**\n * Trigger the given event on the given element with the given detail.\n * This takes into account the `eventBubbles` and `eventIsCancelable` options.\n *\n * @param {string} eventName\n * @param {HTMLElement|HTMLDocument|EventTarget} element\n * @param {object} detail\n * @private\n */\n _triggerEvent(eventName, element = document, detail = null) {\n AutoNumericHelper.triggerEvent(eventName, element, detail, this.settings.eventBubbles, this.settings.eventIsCancelable);\n }\n\n /**\n * Alias of the `getNumericString()` function.\n * Developers should use one of the more explicit function names to get what they want :\n * - a numeric string : `getNumericString()`\n * - a formatted string : `getFormatted()`\n * - a number : `getNumber()`, or\n * - a localized numeric string : `getLocalized()`\n *\n * @usage anElement.get();\n *\n * @param {function|null} callback If a callback is passed, then the result is passed to it as its first argument, and the AutoNumeric object has its second\n *\n * @deprecated\n * @returns {string|null}\n */\n get(callback = null) {\n return this.getNumericString(callback);\n }\n\n /**\n * Return the unformatted value as a string.\n * This can also return `null` if `rawValue` is null.\n *\n * @usage anElement.getNumericString();\n *\n * @param {function|null} callback If a callback is passed, then the result is passed to it as its first argument, and the AutoNumeric object has its second\n *\n * @returns {string|null}\n */\n getNumericString(callback = null) {\n let result;\n if (AutoNumericHelper.isNull(this.rawValue)) {\n result = null;\n } else {\n // Always return a numeric string\n // The following statement gets rid of the trailing zeros in the decimal places since the current method does not pad decimals\n result = AutoNumericHelper.trimPaddedZerosFromDecimalPlaces(this.rawValue);\n }\n\n this._executeCallback(result, callback);\n\n return result;\n }\n\n /**\n * Return the current formatted value of the AutoNumeric element as a string\n *\n * @usage anElement.getFormatted()\n *\n * @param {function|null} callback If a callback is passed, then the result is passed to it as its first argument, and the AutoNumeric object has its second\n *\n * @returns {string}\n */\n getFormatted(callback = null) {\n if (!('value' in this.domElement || 'textContent' in this.domElement)) {\n // Make sure `.value` or `.textContent' exists before trying to access those properties\n AutoNumericHelper.throwError('Unable to get the formatted string from the element.');\n }\n\n const result = AutoNumericHelper.getElementValue(this.domElement);\n this._executeCallback(result, callback);\n\n return result;\n }\n\n /**\n * Return the element unformatted value as a real Javascript number.\n * Warning: This can lead to precision problems with big numbers that should be stored as strings.\n *\n * @usage anElement.getNumber()\n *\n * @param {function|null} callback If a callback is passed, then the result is passed to it as its first argument, and the AutoNumeric object has its second\n *\n * @returns {number|null}\n */\n getNumber(callback = null) {\n let result;\n if (this.rawValue === null) {\n result = null;\n } else {\n result = this.constructor._toLocale(this.getNumericString(), 'number', this.settings);\n }\n\n this._executeCallback(result, callback);\n\n return result;\n }\n\n /**\n * Returns the unformatted value, but following the `outputFormat` setting, which means the output can either be :\n * - a string (that could or could not represent a number (ie. \"12345,67-\")), or\n * - a plain number (if the setting 'number' is used).\n *\n * By default the returned values are an ISO numeric string \"1234.56\" or \"-1234.56\" where the decimal character is a period.\n * Check the \"outputFormat\" option definition for more details.\n *\n * @usage anElement.getLocalized();\n *\n * @param {null|string|function} forcedOutputFormat If set to something different than `null`, then this is used as an overriding outputFormat option\n * @param {function|null} callback If a callback is passed, then the result is passed to it as its first argument, and the AutoNumeric object has its second\n *\n * @returns {*}\n */\n getLocalized(forcedOutputFormat = null, callback = null) {\n // First, check if only a callback has been passed, and if so, sanitize the parameters\n if (AutoNumericHelper.isFunction(forcedOutputFormat) && AutoNumericHelper.isNull(callback)) {\n callback = forcedOutputFormat;\n forcedOutputFormat = null;\n }\n\n // Then get the localized value\n let value;\n if (AutoNumericHelper.isEmptyString(this.rawValue)) {\n value = '';\n } else {\n // Here I use `this.rawValue` instead of `this.getNumericString()` since the current input value could be unformatted with a localization (ie. '1234567,89-').\n // I also convert the rawValue to a number, then back to a string in order to drop the decimal part if the rawValue is an integer.\n value = ''+Number(this.rawValue);\n }\n\n if (value !== '' && Number(value) === 0 && this.settings.leadingZero !== AutoNumeric.options.leadingZero.keep) {\n value = '0';\n }\n\n let outputFormatToUse;\n if (AutoNumericHelper.isNull(forcedOutputFormat)) {\n outputFormatToUse = this.settings.outputFormat;\n } else {\n outputFormatToUse = forcedOutputFormat;\n }\n\n const result = this.constructor._toLocale(value, outputFormatToUse, this.settings);\n this._executeCallback(result, callback);\n\n return result;\n }\n\n /**\n * Force the element to reformat its value again (just in case the formatting has been lost).\n * This can be used right after a form submission for instance (after a previous call to `unformat`).\n *\n * @example anElement.reformat()\n *\n * @returns {AutoNumeric}\n */\n reformat() {\n // `this.rawValue` is used instead of `this.domElement.value` because when the content is `unformatLocalized`, it can become a string that cannot be converted to a number easily\n this.set(this.rawValue);\n\n return this;\n }\n\n /**\n * Remove the formatting and keep only the raw unformatted value in the element (as a numericString)\n * Note: this is loosely based on the previous 'unSet()' function\n *\n * By default, values are returned as ISO numeric strings (ie. \"1234.56\" or \"-1234.56\"), where the decimal character is a period.\n * @example anElement.unformat()\n *\n * @returns {AutoNumeric}\n */\n unformat() {\n this._setElementValue(this.getNumericString());\n\n return this;\n }\n\n /**\n * Remove the formatting and keep only the localized unformatted value in the element, with the option to override the default outputFormat if needed\n *\n * Locale formats are supported \"1234.56-\" or \"1234,56\" or \"-1234,56 or \"1234,56-\", or even plain numbers.\n * Take a look at the `outputFormat` option definition in the default settings for more details.\n *\n * @param {null|string} forcedOutputFormat If set to something different than `null`, then this is used as an overriding outputFormat option\n * @returns {AutoNumeric}\n */\n unformatLocalized(forcedOutputFormat = null) {\n this._setElementValue(this.getLocalized(forcedOutputFormat));\n\n return this;\n }\n\n /**\n * Return `true` if the current value is the same as when the element got initialized.\n * Note: By default, this returns `true` if the raw unformatted value is still the same even if the formatted one has changed (due to a configuration update for instance).\n * In order to test if the formatted value is the same (which means neither the raw value nor the settings have been changed), then you must pass `false` as its argument.\n *\n * @param {boolean} checkOnlyRawValue If set to `true`, the pristine value is done on the raw unformatted value, not the formatted one. If set to `false`, this also checks that the formatted value hasn't changed.\n * @returns {boolean}\n */\n isPristine(checkOnlyRawValue = true) {\n let result;\n if (checkOnlyRawValue) {\n result = this.initialValue === this.getNumericString();\n } else {\n result = this.initialValueHtmlAttribute === this.getFormatted();\n }\n\n return result;\n }\n\n /**\n * Select the formatted element content, based on the `selectNumberOnly` option\n *\n * @returns {AutoNumeric}\n */\n select() {\n if (this.settings.selectNumberOnly) {\n this.selectNumber();\n } else {\n this._defaultSelectAll();\n }\n\n return this;\n }\n\n /**\n * Select the whole element content (including the currency symbol).\n * @private\n */\n _defaultSelectAll() {\n AutoNumericHelper.setElementSelection(this.domElement, 0, AutoNumericHelper.getElementValue(this.domElement).length);\n }\n\n /**\n * Select only the numbers in the formatted element content, leaving out the currency symbol, whatever the value of the `selectNumberOnly` option\n *\n * @returns {AutoNumeric}\n */\n selectNumber() {\n //TODO Make sure the selection is ok when showPositiveSign is set to `true` (select the negative sign, but not the positive one)\n const unformattedValue = AutoNumericHelper.getElementValue(this.domElement);\n const valueLen = unformattedValue.length;\n const currencySymbolSize = this.settings.currencySymbol.length;\n const currencySymbolPlacement = this.settings.currencySymbolPlacement;\n const negLen = (!AutoNumericHelper.isNegative(unformattedValue, this.settings.negativeSignCharacter))?0:1;\n const suffixTextLen = this.settings.suffixText.length;\n\n let start;\n if (currencySymbolPlacement === AutoNumeric.options.currencySymbolPlacement.suffix) {\n start = 0;\n } else if (this.settings.negativePositiveSignPlacement === AutoNumeric.options.negativePositiveSignPlacement.left &&\n negLen === 1 && currencySymbolSize > 0) {\n start = currencySymbolSize + 1;\n } else {\n start = currencySymbolSize;\n }\n\n let end;\n if (currencySymbolPlacement === AutoNumeric.options.currencySymbolPlacement.prefix) {\n end = valueLen - suffixTextLen;\n } else {\n switch (this.settings.negativePositiveSignPlacement) {\n case AutoNumeric.options.negativePositiveSignPlacement.left:\n end = valueLen - (suffixTextLen + currencySymbolSize);\n break;\n case AutoNumeric.options.negativePositiveSignPlacement.right:\n if (currencySymbolSize > 0) {\n end = valueLen - (currencySymbolSize + negLen + suffixTextLen);\n } else {\n end = valueLen - (currencySymbolSize + suffixTextLen);\n }\n break;\n default :\n end = valueLen - (currencySymbolSize + suffixTextLen);\n }\n }\n\n AutoNumericHelper.setElementSelection(this.domElement, start, end);\n\n return this;\n }\n\n /**\n * Select only the integer part in the formatted element content, whatever the value of `selectNumberOnly`\n *\n * @returns {AutoNumeric}\n */\n selectInteger() {\n let start = 0;\n const isPositive = this.rawValue >= 0;\n\n // Negative or positive sign, if any\n if (this.settings.currencySymbolPlacement === AutoNumeric.options.currencySymbolPlacement.prefix ||\n (this.settings.currencySymbolPlacement === AutoNumeric.options.currencySymbolPlacement.suffix &&\n (this.settings.negativePositiveSignPlacement === AutoNumeric.options.negativePositiveSignPlacement.prefix ||\n this.settings.negativePositiveSignPlacement === AutoNumeric.options.negativePositiveSignPlacement.none))) {\n if ((this.settings.showPositiveSign && isPositive) || // This only exclude the positive sign from being selected\n (!isPositive && this.settings.currencySymbolPlacement === AutoNumeric.options.currencySymbolPlacement.prefix && this.settings.negativePositiveSignPlacement === AutoNumeric.options.negativePositiveSignPlacement.left)) { // And this exclude the negative sign from being selected in this special case : '-€ 1.234,57suffixText'\n start = start + 1;\n }\n }\n\n // Currency symbol\n if (this.settings.currencySymbolPlacement === AutoNumeric.options.currencySymbolPlacement.prefix) {\n start = start + this.settings.currencySymbol.length;\n }\n\n // Calculate the selection end position\n const elementValue = AutoNumericHelper.getElementValue(this.domElement);\n let end = elementValue.indexOf(this.settings.decimalCharacter);\n if (end === -1) {\n // No decimal character found\n if (this.settings.currencySymbolPlacement === AutoNumeric.options.currencySymbolPlacement.suffix) {\n end = elementValue.length - this.settings.currencySymbol.length;\n } else {\n end = elementValue.length;\n }\n\n // Trailing negative sign\n if (!isPositive &&\n (this.settings.negativePositiveSignPlacement === AutoNumeric.options.negativePositiveSignPlacement.suffix ||\n this.settings.currencySymbolPlacement === AutoNumeric.options.currencySymbolPlacement.suffix)) {\n end = end - 1;\n }\n\n // Avoid selecting the suffix test\n end = end - this.settings.suffixText.length;\n }\n\n AutoNumericHelper.setElementSelection(this.domElement, start, end);\n\n return this;\n }\n\n /**\n * Select only the decimal part in the formatted element content, whatever the value of `selectNumberOnly`\n * Multiple cases are possible :\n * +1.234,57suffixText\n *\n * € +1.234,57suffixText\n * +€ 1.234,57suffixText\n * € 1.234,57+suffixText\n *\n * 1.234,57+ €suffixText\n * 1.234,57 €+suffixText\n * +1.234,57 €suffixText\n *\n * @returns {AutoNumeric}\n */\n selectDecimal() {\n let start = AutoNumericHelper.getElementValue(this.domElement).indexOf(this.settings.decimalCharacter);\n let end;\n\n if (start === -1) {\n // The decimal character has not been found, we deselect all\n start = 0;\n end = 0;\n } else {\n // A decimal character has been found\n start = start + 1; // We add 1 to exclude the decimal character from the selection\n\n let decimalCount;\n if (this.isFocused) {\n decimalCount = this.settings.decimalPlacesShownOnFocus;\n } else {\n decimalCount = this.settings.decimalPlacesShownOnBlur;\n }\n\n end = start + Number(decimalCount);\n }\n\n AutoNumericHelper.setElementSelection(this.domElement, start, end);\n\n return this;\n }\n\n /**\n * Return the DOM element reference of the autoNumeric-managed element\n *\n * @returns {HTMLElement|HTMLInputElement}\n */\n node() {\n return this.domElement;\n }\n\n /**\n * Return the DOM element reference of the parent node of the autoNumeric-managed element\n *\n * @returns {HTMLElement|HTMLInputElement|Node}\n */\n parent() {\n return this.domElement.parentNode;\n }\n\n /**\n * Detach the current AutoNumeric element from the shared local 'init' list.\n * This means any changes made on that local shared list will not be transmitted to that element anymore.\n * Note : The user can provide another AutoNumeric element, and detach this one instead of the current one.\n *\n * @param {AutoNumeric} otherAnElement\n * @returns {AutoNumeric}\n */\n detach(otherAnElement = null) { //FIXME test this\n let domElementToDetach;\n if (!AutoNumericHelper.isNull(otherAnElement)) {\n domElementToDetach = otherAnElement.node();\n } else {\n domElementToDetach = this.domElement;\n }\n\n this._removeFromLocalList(domElementToDetach); //FIXME What happens if the selected dom element does not exist in the list?\n\n return this;\n }\n\n /**\n * Attach the given AutoNumeric element to the shared local 'init' list.\n * When doing that, by default the DOM content is left untouched.\n * The user can force a reformat with the new shared list options by passing a second argument to `true`.\n *\n * @param {AutoNumeric} otherAnElement\n * @param {boolean} reFormat\n * @returns {AutoNumeric}\n */\n attach(otherAnElement, reFormat = true) { //FIXME test this\n this._addToLocalList(otherAnElement.node()); //FIXME Should we make sure the element is not already in the list?\n if (reFormat) {\n otherAnElement.update(this.settings);\n }\n\n return this;\n }\n\n /**\n * Format and return the given value, or set the formatted value into the given DOM element if one is passed as an argument.\n * By default, this use the current element settings.\n * The user can override any option of its choosing by passing an option object.\n *\n * @param {number|HTMLElement|HTMLInputElement} valueOrElement\n * @param {null|object} optionOverride\n * @returns {string|null}\n */\n formatOther(valueOrElement, optionOverride = null) { //FIXME test this\n return this._formatOrUnformatOther(true, valueOrElement, optionOverride);\n }\n\n /**\n * Unformat and return the raw numeric string corresponding to the given value, or directly set the unformatted value into the given DOM element if one is passed as an argument.\n * By default, this use the current element settings.\n * The user can override any option of its choosing by passing an option object.\n\n * @param {string|HTMLElement|HTMLInputElement} stringOrElement\n * @param {null|object} optionOverride\n * @returns {string|null}\n */\n unformatOther(stringOrElement, optionOverride = null) { //FIXME test this\n return this._formatOrUnformatOther(false, stringOrElement, optionOverride);\n }\n\n /**\n * Method that either format or unformat the value of another element.\n *\n * - Format and return the given value, or set the formatted value into the given DOM element if one is passed as an argument.\n * - Unformat and return the raw numeric string corresponding to the given value, or directly set the unformatted value into the given DOM element if one is passed as an argument.\n *\n * By default, this use the current element settings.\n * The user can override any option of its choosing by passing an option object.\n *\n * @param {boolean} isFormatting If set to `true`, then the method formats, otherwise if set to `false`, it unformats\n * @param {number|string|HTMLElement|HTMLInputElement} valueOrStringOrElement\n * @param {null|object} optionOverride\n * @returns {string|null}\n * @private\n */\n _formatOrUnformatOther(isFormatting, valueOrStringOrElement, optionOverride = null) { //FIXME test this\n // If the user wants to override the current element settings temporarily\n let settingsToUse;\n if (!AutoNumericHelper.isNull(optionOverride)) {\n settingsToUse = this._cloneAndMergeSettings(optionOverride);\n } else {\n settingsToUse = this.settings;\n }\n\n // Then the unformatting is done...\n let result;\n if (AutoNumericHelper.isElement(valueOrStringOrElement)) {\n // ...either directly on the DOM element value\n const elementValue = AutoNumericHelper.getElementValue(valueOrStringOrElement);\n if (isFormatting) {\n result = AutoNumeric.format(elementValue, settingsToUse);\n }\n else {\n result = AutoNumeric.unformat(elementValue, settingsToUse);\n }\n\n AutoNumericHelper.setElementValue(valueOrStringOrElement, result); //TODO Use `unformatAndSet` and `formatAndSet`instead\n\n return null;\n }\n\n // ...or on the given value\n if (isFormatting) {\n result = AutoNumeric.format(valueOrStringOrElement, settingsToUse);\n }\n else {\n result = AutoNumeric.unformat(valueOrStringOrElement, settingsToUse);\n }\n\n return result;\n }\n\n /**\n * Use the current AutoNumeric element settings to initialize the DOM element(s) given as a parameter.\n * Doing so will *link* the AutoNumeric elements together since they will share the same local AutoNumeric element list.\n * (cf. prototype pattern : https://en.wikipedia.org/wiki/Prototype_pattern)\n *\n * You can `init` either a single DOM element (in that case an AutoNumeric object will be returned), or an array of DOM elements or a string that will be used as a CSS selector. In the latter cases, an array of AutoNumeric objects will then be returned (or an empty array if nothing gets selected by the CSS selector).\n *\n * Use case : Once you have an AutoNumeric element already setup correctly with the right options, you can use it as many times you want to initialize as many other DOM elements as needed.\n * Note : this works only on elements that can be managed by autoNumeric.\n *\n * @param {HTMLElement|HTMLInputElement|Array<HTMLElement|HTMLInputElement>|string} domElementOrArrayOrString\n * @param {boolean} attached If set to `false`, then the newly generated AutoNumeric element will not share the same local element list\n * @returns {AutoNumeric|[AutoNumeric]}\n */\n init(domElementOrArrayOrString, attached = true) {\n let returnASingleAutoNumericObject = false; // By default, this function returns an array of AutoNumeric objects\n let domElementsArray = [];\n if (AutoNumericHelper.isString(domElementOrArrayOrString)) {\n domElementsArray = [... document.querySelectorAll(domElementOrArrayOrString)]; // Convert a NodeList to an Array\n } else if (AutoNumericHelper.isElement(domElementOrArrayOrString)) {\n domElementsArray.push(domElementOrArrayOrString);\n returnASingleAutoNumericObject = true; // Special case when only one DOM element is passed as a parameter\n } else if (AutoNumericHelper.isArray(domElementOrArrayOrString)) {\n domElementsArray = domElementOrArrayOrString;\n } else {\n AutoNumericHelper.throwError(`The given parameters to the 'init' function are invalid.`);\n }\n\n if (domElementsArray.length === 0) {\n AutoNumericHelper.warning(`No valid DOM elements were given hence no AutoNumeric object were instantiated.`, true);\n\n return [];\n }\n\n const currentLocalList = this._getLocalList();\n const autoNumericObjectsArray = [];\n\n // Instantiate (and link depending on `attached`) each AutoNumeric objects\n domElementsArray.forEach(domElement => {\n // Initialize the new AutoNumeric element\n const originalCreateLocalListSetting = this.settings.createLocalList;\n if (attached) {\n // Temporary variable to know if we should create the local list during the initialization (since we'll remove it afterwards)\n this.settings.createLocalList = false;\n }\n\n const newAutoNumericElement = new AutoNumeric(domElement, AutoNumericHelper.getElementValue(domElement), this.settings);\n\n // Set the common shared local list if needed\n // If the user wants to create a detached new AutoNumeric element, then skip the following step that bind the two elements together by default\n if (attached) {\n // 1) Set the local list reference to point to the initializer's one\n newAutoNumericElement._setLocalList(currentLocalList);\n\n // 2) Add the new element to that existing list\n this._addToLocalList(domElement, newAutoNumericElement); // Here we use the *new* AutoNumeric object reference to add to the local list, since we'll need the reference to `this` in the methods to points to that new AutoNumeric object.\n this.settings.createLocalList = originalCreateLocalListSetting;\n }\n\n autoNumericObjectsArray.push(newAutoNumericElement);\n });\n\n if (returnASingleAutoNumericObject) {\n // If a single DOM element was used as the parameter, then we return an AutoNumeric object directly\n return autoNumericObjectsArray[0];\n }\n\n // ...otherwise we return an Array of AutoNumeric objects\n return autoNumericObjectsArray;\n }\n\n /**\n * Reset the element value either to the empty string '', or the currency sign, depending on the `emptyInputBehavior` option value.\n * If you set the `forceClearAll` argument to `true`, then the `emptyInputBehavior` option is overridden and the whole input is clear, including any currency sign.\n *\n * @param {boolean} forceClearAll\n * @returns {AutoNumeric}\n */\n clear(forceClearAll = false) {\n if (forceClearAll) {\n const temporaryForcedOptions = {\n emptyInputBehavior: AutoNumeric.options.emptyInputBehavior.focus,\n };\n this.set('', temporaryForcedOptions);\n } else {\n this.set('');\n }\n\n return this;\n }\n\n /**\n * Remove the autoNumeric data and event listeners from the element, but keep the element content intact.\n * This also clears the value from sessionStorage (or cookie, depending on browser supports).\n * Note: this does not remove the formatting.\n *\n * @example anElement.remove()\n */\n remove() {\n this._removeValueFromPersistentStorage();\n this._removeEventListeners();\n this._removeWatcher();\n\n // Also remove the element from the local AutoNumeric list\n this._removeFromLocalList(this.domElement);\n // Also remove the element from the global AutoNumeric list\n this.constructor._removeFromGlobalList(this);\n }\n\n /**\n * Remove the autoNumeric data and event listeners from the element, and reset its value to the empty string ''.\n * This also clears the value from sessionStorage (or cookie, depending on browser supports).\n *\n * @example anElement.wipe()\n */\n wipe() {\n this._setElementValue('', false); // Do not send the 'AutoNumeric.events.formatted' event when wiping an AutoNumeric object\n this.remove();\n }\n\n /**\n * Remove the autoNumeric data and event listeners from the element, and delete the DOM element altogether\n */\n nuke() {\n this.remove();\n // Remove the element from the DOM\n this.domElement.parentNode.removeChild(this.domElement);\n }\n\n\n // Special functions that really work on the parent <form> element, instead of the <input> element itself\n\n /**\n * Return a reference to the parent <form> element if it exists, otherwise return `null`.\n * If the parent form element as already been found, this directly return a reference to it.\n * However, you can force AutoNumeric to search again for its reference by passing `true` as a parameter to this method.\n * This method updates the `this.parentForm` attribute.\n *\n * In either case, whenever a new parent form is set for the current AutoNumeric element, we make sure to update the anCount and anFormHandler attributes on both the old form and the new one (for instance in case the user moved the input elements with `appendChild()` since AutoNumeric cannot not detect that).\n *\n * @param {boolean} forceSearch If set to `true`, the parent form is searched again, even if `this.parentForm` is already set.\n * @returns {HTMLFormElement|null}\n */\n form(forceSearch = false) {\n if (forceSearch || AutoNumericHelper.isUndefinedOrNullOrEmpty(this.parentForm)) {\n const newParentForm = this._getParentForm();\n if (!AutoNumericHelper.isNull(newParentForm) && newParentForm !== this.parentForm) {\n // If the current parent form exists and is different from the previous parent form\n\n // Search for all the AutoNumeric elements in the old parent form\n const oldANChildren = this._getFormAutoNumericChildren(this.parentForm);\n // Update the anCount with the correct number of AutoNumeric elements\n this.parentForm.dataset.anCount = oldANChildren.length;\n\n // Check if the new parent form already has a anFormHandler name\n if (this._hasFormHandlerFunction(newParentForm)) {\n this._incrementParentFormCounter(newParentForm); // Increment its counter\n } else {\n // Create one and set the anCount to 1\n this._storeFormHandlerFunction(newParentForm);\n this._initializeFormCounterToOne(newParentForm);\n }\n }\n\n this.parentForm = newParentForm;\n }\n\n return this.parentForm;\n }\n\n /**\n * Return an array of the AutoNumeric-managed elements for the given form element is passed, otherwise for the current `this.parentForm` element.\n *\n * @param {HTMLFormElement|null} formElement\n * @returns {Array.<HTMLInputElement>}\n * @private\n */\n _getFormAutoNumericChildren(formElement) {\n // Search for all the child AutoNumeric elements in that parent form\n //XXX This only search for <input> elements, not contenteditable non-input tag ones, for now\n const inputList = [... formElement.querySelectorAll('input')];\n\n return inputList.filter(input => this.constructor.isManagedByAutoNumeric(input));\n }\n\n /**\n * Return a reference to the parent <form> element if it exists, otherwise return `null`.\n *\n * @returns {HTMLFormElement|null}\n * @private\n */\n _getParentForm() {\n if (this.domElement.tagName.toLowerCase() === 'body') {\n return null;\n }\n\n let node = this.domElement;\n let tagName;\n do {\n node = node.parentNode;\n if (AutoNumericHelper.isNull(node)) {\n // Special case when using templates with frameworks like Vue.js, where the input element can be 'detached' when initializing the DOM structure\n return null;\n }\n\n if (node.tagName) {\n tagName = node.tagName.toLowerCase();\n } else {\n tagName = '';\n }\n\n if (tagName === 'body') {\n // Get out of the loop if we get up to the `<body>` element\n break;\n }\n } while (tagName !== 'form');\n\n if (tagName === 'form') {\n return node;\n } else {\n return null;\n }\n }\n\n /**\n * Return a string in standard URL-encoded notation with the form input values being unformatted.\n * This string can be used as a query for instance.\n *\n * @returns {string}\n */\n formNumericString() {\n return this.constructor._serializeNumericString(this.form(), this.settings.serializeSpaces);\n }\n\n /**\n * Return a string in standard URL-encoded notation with the form input values being formatted.\n *\n * @returns {string}\n */\n formFormatted() {\n return this.constructor._serializeFormatted(this.form(), this.settings.serializeSpaces);\n }\n\n /**\n * Return a string in standard URL-encoded notation with the form input values, with localized values.\n * The default output format can be overridden by passing the option as a parameter.\n *\n * @param {null|string} forcedOutputFormat If set to something different than `null`, then this is used as an overriding outputFormat option\n * @returns {string}\n */\n formLocalized(forcedOutputFormat = null) {\n let outputFormatToUse;\n if (AutoNumericHelper.isNull(forcedOutputFormat)) {\n outputFormatToUse = this.settings.outputFormat;\n } else {\n outputFormatToUse = forcedOutputFormat;\n }\n\n return this.constructor._serializeLocalized(this.form(), this.settings.serializeSpaces, outputFormatToUse);\n }\n\n /**\n * Return an array containing an object for each form <input> element.\n * Those objects are of the following structure `{ name: foo, value: '42' }`, where the `name` is the DOM element name, and the `value` is an unformatted numeric string.\n *\n * @returns {Array}\n */\n formArrayNumericString() {\n return this.constructor._serializeNumericStringArray(this.form(), this.settings.serializeSpaces);\n }\n\n /**\n * Return an array containing an object for each form <input> element.\n * Those objects are of the following structure `{ name: foo, value: '42' }`, where the `name` is the DOM element name, and the `value` is the formatted string.\n *\n * @returns {Array}\n */\n formArrayFormatted() {\n return this.constructor._serializeFormattedArray(this.form(), this.settings.serializeSpaces);\n }\n\n /**\n * Return an array containing an object for each form <input> element.\n * Those objects are of the following structure `{ name: foo, value: '42' }`, where the `name` is the DOM element name, and the `value` is the localized numeric string.\n *\n * @param {null|string} forcedOutputFormat If set to something different than `null`, then this is used as an overriding outputFormat option\n * @returns {Array}\n */\n formArrayLocalized(forcedOutputFormat = null) {\n let outputFormatToUse;\n if (AutoNumericHelper.isNull(forcedOutputFormat)) {\n outputFormatToUse = this.settings.outputFormat;\n } else {\n outputFormatToUse = forcedOutputFormat;\n }\n\n return this.constructor._serializeLocalizedArray(this.form(), this.settings.serializeSpaces, outputFormatToUse);\n }\n\n /**\n * Return a JSON string containing an object representing the form input values.\n * This is based on the result of the `formArrayNumericString()` function.\n *\n * @returns {string}\n */\n formJsonNumericString() {\n return JSON.stringify(this.formArrayNumericString());\n }\n\n /**\n * Return a JSON string containing an object representing the form input values.\n * This is based on the result of the `formArrayFormatted()` function.\n *\n * @returns {string}\n */\n formJsonFormatted() {\n return JSON.stringify(this.formArrayFormatted());\n }\n\n /**\n * Return a JSON string containing an object representing the form input values.\n * This is based on the result of the `formArrayLocalized()` function.\n *\n * @param {null|string} forcedOutputFormat If set to something different than `null`, then this is used as an overriding outputFormat option\n * @returns {string}\n */\n formJsonLocalized(forcedOutputFormat = null) {\n return JSON.stringify(this.formArrayLocalized(forcedOutputFormat));\n }\n\n /**\n * Unformat all the autoNumeric-managed elements that are a child of the parent <form> element of this DOM element, to numeric strings\n *\n * @returns {AutoNumeric}\n */\n formUnformat() { //FIXME test this\n const inputs = this.constructor._getChildANInputElement(this.form());\n inputs.forEach(input => {\n AutoNumeric.getAutoNumericElement(input).unformat();\n });\n\n return this;\n }\n\n /**\n * Unformat all the autoNumeric-managed elements that are a child of the parent <form> element of this DOM element, to localized strings\n *\n * @returns {AutoNumeric}\n */\n formUnformatLocalized() { //FIXME test this\n const inputs = this.constructor._getChildANInputElement(this.form());\n inputs.forEach(input => {\n AutoNumeric.getAutoNumericElement(input).unformatLocalized();\n });\n\n return this;\n }\n\n /**\n * Reformat all the autoNumeric-managed elements that are a child of the parent <form> element of this DOM element\n *\n * @returns {AutoNumeric}\n */\n formReformat() { //FIXME test this\n const inputs = this.constructor._getChildANInputElement(this.form());\n inputs.forEach(input => {\n AutoNumeric.getAutoNumericElement(input).reformat();\n });\n\n return this;\n }\n\n /**\n * Convert the input values to numeric strings, submit the form, then reformat those back.\n * The function can either take a callback, or not. If it doesn't, the default `form.submit()` function will be called.\n * Otherwise, it runs `callback(value)` with `value` being equal to the result of `formNumericString()`.\n *\n * @param {function|null} callback\n * @returns {AutoNumeric}\n */\n formSubmitNumericString(callback = null) { //FIXME test this\n if (AutoNumericHelper.isNull(callback)) {\n this.formUnformat();\n this.form().submit();\n this.formReformat();\n } else if (AutoNumericHelper.isFunction(callback)) {\n callback(this.formNumericString());\n } else {\n AutoNumericHelper.throwError(`The given callback is not a function.`);\n }\n\n return this;\n }\n\n /**\n * Submit the form with the current formatted values.\n * The function can either take a callback, or not. If it doesn't, the default `form.submit()` function will be called.\n * Otherwise, it runs `callback(value)` with `value` being equal to the result of `formFormatted()`.\n *\n * @param {function|null} callback\n * @returns {AutoNumeric}\n */\n formSubmitFormatted(callback = null) { //FIXME test this\n if (AutoNumericHelper.isNull(callback)) {\n this.form().submit();\n } else if (AutoNumericHelper.isFunction(callback)) {\n callback(this.formFormatted());\n } else {\n AutoNumericHelper.throwError(`The given callback is not a function.`);\n }\n\n return this;\n }\n\n /**\n * Convert the input values to localized strings, submit the form, then reformat those back.\n * The function can either take a callback, or not. If it doesn't, the default `form.submit()` function will be called.\n * Otherwise, it runs `callback(value)` with `value` being equal to the result of `formLocalized()`.\n *\n * @param {null|string} forcedOutputFormat If set to something different than `null`, then this is used as an overriding outputFormat option\n * @param {function|null} callback\n * @returns {AutoNumeric}\n */\n formSubmitLocalized(forcedOutputFormat = null, callback = null) { //FIXME test this\n if (AutoNumericHelper.isNull(callback)) {\n this.formUnformatLocalized();\n this.form().submit();\n this.formReformat();\n } else if (AutoNumericHelper.isFunction(callback)) {\n callback(this.formLocalized(forcedOutputFormat));\n } else {\n AutoNumericHelper.throwError(`The given callback is not a function.`);\n }\n\n return this;\n }\n\n /**\n * Generate an array of numeric strings from the `<input>` elements, and pass it to the given callback.\n * Under the hood, the array is generated via a call to `formArrayNumericString()`.\n *\n * @param {function} callback\n * @returns {AutoNumeric}\n */\n formSubmitArrayNumericString(callback) { //FIXME test this\n if (AutoNumericHelper.isFunction(callback)) {\n callback(this.formArrayNumericString());\n } else {\n AutoNumericHelper.throwError(`The given callback is not a function.`);\n }\n\n return this;\n }\n\n /**\n * Generate an array of the current formatted values from the `<input>` elements, and pass it to the given callback.\n * Under the hood, the array is generated via a call to `formArrayFormatted()`.\n *\n * @param {function} callback\n * @returns {AutoNumeric}\n */\n formSubmitArrayFormatted(callback) { //FIXME test this\n if (AutoNumericHelper.isFunction(callback)) {\n callback(this.formArrayFormatted());\n } else {\n AutoNumericHelper.throwError(`The given callback is not a function.`);\n }\n\n return this;\n }\n\n /**\n * Generate an array of localized strings from the `<input>` elements, and pass it to the given callback.\n * Under the hood, the array is generated via a call to `formArrayLocalized()`.\n *\n * @param {function} callback\n * @param {null|string} forcedOutputFormat If set to something different than `null`, then this is used as an overriding outputFormat option\n * @returns {AutoNumeric}\n */\n formSubmitArrayLocalized(callback, forcedOutputFormat = null) { //FIXME test this\n if (AutoNumericHelper.isFunction(callback)) {\n callback(this.formArrayLocalized(forcedOutputFormat));\n } else {\n AutoNumericHelper.throwError(`The given callback is not a function.`);\n }\n\n return this;\n }\n\n /**\n * Generate a JSON string with the numeric strings values from the `<input>` elements, and pass it to the given callback.\n * Under the hood, the array is generated via a call to `formJsonNumericString()`.\n *\n * @param {function} callback\n * @returns {AutoNumeric}\n */\n formSubmitJsonNumericString(callback) { //FIXME test this\n if (AutoNumericHelper.isFunction(callback)) {\n callback(this.formJsonNumericString());\n } else {\n AutoNumericHelper.throwError(`The given callback is not a function.`);\n }\n\n return this;\n }\n\n /**\n * Generate a JSON string with the current formatted values from the `<input>` elements, and pass it to the given callback.\n * Under the hood, the array is generated via a call to `formJsonFormatted()`.\n *\n * @param {function} callback\n * @returns {AutoNumeric}\n */\n formSubmitJsonFormatted(callback) { //FIXME test this\n if (AutoNumericHelper.isFunction(callback)) {\n callback(this.formJsonFormatted());\n } else {\n AutoNumericHelper.throwError(`The given callback is not a function.`);\n }\n\n return this;\n }\n\n /**\n * Generate a JSON string with the localized strings values from the `<input>` elements, and pass it to the given callback.\n * Under the hood, the array is generated via a call to `formJsonLocalized()`.\n *\n * @param {function} callback\n * @param {null|string} forcedOutputFormat If set to something different than `null`, then this is used as an overriding outputFormat option\n * @returns {AutoNumeric}\n */\n formSubmitJsonLocalized(callback, forcedOutputFormat = null) { //FIXME test this\n if (AutoNumericHelper.isFunction(callback)) {\n callback(this.formJsonLocalized(forcedOutputFormat));\n } else {\n AutoNumericHelper.throwError(`The given callback is not a function.`);\n }\n\n return this;\n }\n\n /**\n * Unformat the given AutoNumeric element, and update the `hoveredWithAlt` variable.\n *\n * @param {AutoNumeric} anElement\n * @private\n */\n static _unformatAltHovered(anElement) {\n anElement.hoveredWithAlt = true;\n anElement.unformat();\n }\n\n /**\n * Reformat the given AutoNumeric element, and update the `hoveredWithAlt` variable.\n *\n * @param {AutoNumeric} anElement\n * @private\n */\n static _reformatAltHovered(anElement) {\n anElement.hoveredWithAlt = false;\n anElement.reformat();\n }\n\n /**\n * Return an array of autoNumeric elements, child of the <form> element passed as a parameter.\n *\n * @param {HTMLElement} formNode\n * @returns {Array}\n * @private\n */\n static _getChildANInputElement(formNode) { //FIXME test this\n const inputList = formNode.getElementsByTagName('input');\n\n // Loop this list and keep only the inputs that are managed by AutoNumeric\n const autoNumericInputs = [];\n const inputElements = Array.prototype.slice.call(inputList, 0);\n inputElements.forEach(input => {\n if (this.test(input)) {\n autoNumericInputs.push(input);\n }\n });\n\n return autoNumericInputs;\n }\n\n // Static methods\n /**\n * Test if the given DOM element, or the element selected by the given selector string is already managed by AutoNumeric (if it has been initialized on the current page).\n *\n * @param {HTMLElement|string} domElementOrSelector Accepts either directly a DOM element to test, or a string selector (that will return one and only one element, if any)\n * @returns {boolean}\n */\n static test(domElementOrSelector) {\n return this._isInGlobalList(AutoNumericHelper.domElement(domElementOrSelector));\n }\n\n /**\n * Create a WeakMap with the given name.\n *\n * @param {string} weakMapName\n * @private\n */\n static _createWeakMap(weakMapName) {\n window[weakMapName] = new WeakMap();\n }\n\n /**\n * Create a list of all the AutoNumeric elements that are initialized on the current page.\n * This is needed in order to determine if a given dom element is already managed by autoNumeric.\n * This uses a WeakMap in order to limit potential garbage collection problems.\n * (cf. my tests on http://codepen.io/AnotherLinuxUser/pen/pRQGaM?editors=1011)\n * @private\n */\n static _createGlobalList() {\n // The check that this global list does not exists already is done in the add and remove functions already\n this.autoNumericGlobalListName = 'autoNumericGlobalList'; //XXX This looks weird to set a variable on `this.` in a static method, but that really declare that variable like a static property\n // Note: I should not get any memory leaks for referencing the DOM element in the `value`, this DOM element also being the `key`, according to the spec : http://www.ecma-international.org/ecma-262/6.0/#sec-weakmap-objects\n this._createWeakMap(this.autoNumericGlobalListName);\n }\n\n /**\n * Return `true` if the global AutoNumeric element list exists.\n *\n * @returns {boolean}\n * @private\n */\n static _doesGlobalListExists() {\n const type = typeof window[this.autoNumericGlobalListName];\n return type !== 'undefined' &&\n type === 'object';\n }\n\n /**\n * Add the given object to the global AutoNumeric element list.\n *\n * @param {AutoNumeric} autoNumericObject\n * @private\n */\n static _addToGlobalList(autoNumericObject) {\n if (!this._doesGlobalListExists()) {\n this._createGlobalList();\n }\n\n const domElement = autoNumericObject.node();\n // This checks if the object is not already in the global list before adding it.\n // This could happen if an AutoNumeric element is initialized, then the DOM element is removed directly via `removeChild` (hence the reference does not get removed from the global list), then it get recreated and initialized again\n if (this._isInGlobalList(domElement)) {\n if (this._getFromGlobalList(domElement) === this) {\n // Do not add this AutoNumeric object again since it's already in that global list\n return;\n } else {\n // Print a warning to warn that the domElement already has a reference in the global map (but we cannot for sure starts deleting those old references since they could still be used by another AutoNumeric object)\n AutoNumericHelper.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.`, autoNumericObject.getSettings().showWarnings);\n }\n }\n\n window[this.autoNumericGlobalListName].set(domElement, autoNumericObject);\n }\n\n /**\n * Remove the given object from the global AutoNumeric element list.\n *\n * @param {AutoNumeric} autoNumericObject\n * @private\n */\n static _removeFromGlobalList(autoNumericObject) { //FIXME test this\n if (this._doesGlobalListExists()) {\n window[this.autoNumericGlobalListName].delete(autoNumericObject.node());\n }\n }\n\n /**\n * Return the value associated to the key `domElement` passed as a parameter.\n * The value is the AutoNumeric object that manages the DOM element `domElement`.\n *\n * @param {HTMLElement|HTMLInputElement} domElement\n * @returns {null|AutoNumeric}\n * @private\n */\n static _getFromGlobalList(domElement) { //FIXME test this\n if (this._doesGlobalListExists()) {\n return window[this.autoNumericGlobalListName].get(domElement);\n }\n\n return null;\n }\n\n /**\n * Check if the given DOM element is in the global AutoNumeric element list.\n *\n * @param {HTMLElement|HTMLInputElement} domElement\n * @returns {boolean}\n * @private\n */\n static _isInGlobalList(domElement) { //FIXME test this\n if (!this._doesGlobalListExists()) {\n return false;\n }\n\n return window[this.autoNumericGlobalListName].has(domElement);\n }\n\n /**\n * Create a `Map` that will stores all the autoNumeric elements that are initialized from this current element.\n * @private\n */\n _createLocalList() {\n this.autoNumericLocalList = new Map();\n this._addToLocalList(this.domElement);\n }\n\n /**\n * In some rare cases, you could want to delete the local list generated during the element initialization (in order to use another one instead for instance).\n * @private\n */\n _deleteLocalList() {\n delete this.autoNumericLocalList;\n }\n\n /**\n * Set the local list with the given Map object.\n *\n * @param {Map} localList\n * @private\n */\n _setLocalList(localList) {\n this.autoNumericLocalList = localList;\n }\n\n /**\n * Return the local list Map object.\n *\n * @returns {*|Map}\n * @private\n */\n _getLocalList() {\n return this.autoNumericLocalList;\n }\n\n /**\n * Return `true` if the AutoNumeric object has a local list defined already and has at least one element in it (itself usually).\n *\n * @returns {boolean}\n * @private\n */\n _hasLocalList() {\n return this.autoNumericLocalList instanceof Map && this.autoNumericLocalList.size !== 0;\n }\n\n /**\n * Add the given object to the local autoNumeric element list.\n * Note: in order to keep a coherent list, we only add DOM elements in it, not the autoNumeric object.\n *\n * @param {HTMLElement|HTMLInputElement} domElement\n * @param {AutoNumeric} autoNumericObject A reference to the AutoNumeric object that manage the given DOM element\n * @throws\n * @private\n */\n _addToLocalList(domElement, autoNumericObject = null) {\n if (AutoNumericHelper.isNull(autoNumericObject)) {\n autoNumericObject = this;\n }\n\n if (!AutoNumericHelper.isUndefined(this.autoNumericLocalList)) {\n this.autoNumericLocalList.set(domElement, autoNumericObject); // Use the DOM element as key, and the AutoNumeric object as the value\n } else {\n AutoNumericHelper.throwError(`The local list provided does not exists when trying to add an element. [${this.autoNumericLocalList}] given.`);\n }\n }\n\n /**\n * Remove the given object from the local autoNumeric element list.\n *\n * @param {HTMLElement|HTMLInputElement} domElement\n * @private\n */\n _removeFromLocalList(domElement) {\n if (!AutoNumericHelper.isUndefined(this.autoNumericLocalList)) {\n this.autoNumericLocalList.delete(domElement);\n } else if (this.settings.createLocalList) {\n AutoNumericHelper.throwError(`The local list provided does not exists when trying to remove an element. [${this.autoNumericLocalList}] given.`);\n }\n }\n\n /**\n * Merge the `newSettings` given as parameters into the current element settings.\n *\n * WARNING: Using `Object.assign()` here means the merge is not recursive and only one depth is merged.\n * cf. http://stackoverflow.com/a/39188108/2834898\n * cf. tests on http://codepen.io/AnotherLinuxUser/pen/KaJORq?editors=0011\n *\n * @param {object} newSettings\n * @private\n */\n _mergeSettings(...newSettings) {\n Object.assign(this.settings, ...newSettings);\n }\n\n /**\n * Return a new object with the current element settings merged with the new settings.\n *\n * @param {object} newSettings\n * @returns {object}\n * @private\n */\n _cloneAndMergeSettings(...newSettings) {\n const result = {};\n Object.assign(result, this.settings, ...newSettings);\n\n return result;\n }\n\n /**\n * Validate the given option object.\n * If the options are valid, this function returns nothing, otherwise if the options are invalid, this function throws an error.\n *\n * This tests if the options are not conflicting and are well formatted.\n * This function is lenient since it only tests the settings properties ; it ignores any other properties the options object could have.\n *\n * @param {*} userOptions\n * @param {Boolean} shouldExtendDefaultOptions If `true`, then this function will extends the `userOptions` passed by the user, with the default options.\n * @param {object|null} originalOptions The user can pass the original options (and not the one that are generated from the default settings and the various usability corrections), in order to add compatibility and conflicts checks.\n * @throws Error This throws if the `userOptions` are not valid\n */\n static validate(userOptions, shouldExtendDefaultOptions = true, originalOptions = null) {\n if (AutoNumericHelper.isUndefinedOrNullOrEmpty(userOptions) || !AutoNumericHelper.isObject(userOptions)) {\n AutoNumericHelper.throwError(`The userOptions are invalid ; it should be a valid object, [${userOptions}] given.`);\n }\n\n const isOriginalOptionAnObject = AutoNumericHelper.isObject(originalOptions);\n if (!isOriginalOptionAnObject && !AutoNumericHelper.isNull(originalOptions)) {\n AutoNumericHelper.throwError(`The 'originalOptions' parameter is invalid ; it should either be a valid option object or \\`null\\`, [${userOptions}] given.`);\n }\n\n // If the user used old options, we convert them to new ones\n if (!AutoNumericHelper.isNull(userOptions)) {\n this._convertOldOptionsToNewOnes(userOptions);\n }\n\n // The user can choose if the `userOptions` has already been extended with the default options, or not\n let options;\n if (shouldExtendDefaultOptions) {\n options = Object.assign({}, this.getDefaultConfig(), userOptions);\n } else {\n options = userOptions;\n }\n\n // First things first, we test that the `showWarnings` option is valid\n if (!AutoNumericHelper.isTrueOrFalseString(options.showWarnings) && !AutoNumericHelper.isBoolean(options.showWarnings)) {\n AutoNumericHelper.throwError(`The debug option 'showWarnings' is invalid ; it should be either 'false' or 'true', [${options.showWarnings}] given.`);\n }\n\n // Define the regular expressions needed for the following tests\n const testPositiveInteger = /^[0-9]+$/;\n const testNumericalCharacters = /[0-9]+/;\n // const testFloatAndPossibleNegativeSign = /^-?[0-9]+(\\.?[0-9]+)$/;\n const testFloatOrIntegerAndPossibleNegativeSign = /^-?[0-9]+(\\.?[0-9]+)?$/;\n const testPositiveFloatOrInteger = /^[0-9]+(\\.?[0-9]+)?$/;\n\n // Then tests the options individually\n if (!AutoNumericHelper.isTrueOrFalseString(options.allowDecimalPadding) &&\n !AutoNumericHelper.isBoolean(options.allowDecimalPadding) &&\n options.allowDecimalPadding !== AutoNumeric.options.allowDecimalPadding.floats) {\n AutoNumericHelper.throwError(`The decimal padding option 'allowDecimalPadding' is invalid ; it should either be \\`false\\`, \\`true\\` or \\`'floats'\\`, [${options.allowDecimalPadding}] given.`);\n }\n\n if ((options.allowDecimalPadding === AutoNumeric.options.allowDecimalPadding.never ||\n options.allowDecimalPadding === 'false') &&\n (options.decimalPlaces !== AutoNumeric.options.decimalPlaces.none ||\n options.decimalPlacesShownOnBlur !== AutoNumeric.options.decimalPlacesShownOnBlur.none ||\n options.decimalPlacesShownOnFocus !== AutoNumeric.options.decimalPlacesShownOnFocus.none)) {\n AutoNumericHelper.warning(`Setting 'allowDecimalPadding' to [${options.allowDecimalPadding}] will override the current 'decimalPlaces*' settings [${options.decimalPlaces}, ${options.decimalPlacesShownOnBlur} and ${options.decimalPlacesShownOnFocus}].`, options.showWarnings);\n }\n\n if (!AutoNumericHelper.isNull(options.caretPositionOnFocus) && !AutoNumericHelper.isInArray(options.caretPositionOnFocus, [\n AutoNumeric.options.caretPositionOnFocus.start,\n AutoNumeric.options.caretPositionOnFocus.end,\n AutoNumeric.options.caretPositionOnFocus.decimalLeft,\n AutoNumeric.options.caretPositionOnFocus.decimalRight,\n ])) {\n AutoNumericHelper.throwError(`The display on empty string option 'caretPositionOnFocus' is invalid ; it should either be \\`null\\`, 'focus', 'press', 'always' or 'zero', [${options.caretPositionOnFocus}] given.`);\n }\n\n // Special case here for `caretPositionOnFocus` and `selectOnFocus` where we need to check the original non-tempered version of the options in order to check for conflicts, since using the default settings remove those and would prevent us warning the user that his option object is not correct.\n let optionsToUse;\n if (isOriginalOptionAnObject) {\n optionsToUse = originalOptions;\n } else {\n optionsToUse = this._correctCaretPositionOnFocusAndSelectOnFocusOptions(userOptions);\n }\n\n if (!AutoNumericHelper.isNull(optionsToUse) &&\n ((optionsToUse.caretPositionOnFocus !== AutoNumeric.options.caretPositionOnFocus.doNoForceCaretPosition &&\n optionsToUse.selectOnFocus === AutoNumeric.options.selectOnFocus.select))) {\n AutoNumericHelper.warning(`The 'selectOnFocus' option is set to 'select', which is in conflict with the 'caretPositionOnFocus' which is set to '${optionsToUse.caretPositionOnFocus}'. As a result, if this has been called when instantiating an AutoNumeric object, the 'selectOnFocus' option is forced to 'doNotSelect'.`, options.showWarnings);\n }\n\n if (!AutoNumericHelper.isInArray(options.digitGroupSeparator, [\n AutoNumeric.options.digitGroupSeparator.comma,\n AutoNumeric.options.digitGroupSeparator.dot,\n AutoNumeric.options.digitGroupSeparator.normalSpace,\n AutoNumeric.options.digitGroupSeparator.thinSpace,\n AutoNumeric.options.digitGroupSeparator.narrowNoBreakSpace,\n AutoNumeric.options.digitGroupSeparator.noBreakSpace,\n AutoNumeric.options.digitGroupSeparator.noSeparator,\n AutoNumeric.options.digitGroupSeparator.apostrophe,\n AutoNumeric.options.digitGroupSeparator.arabicThousandsSeparator,\n AutoNumeric.options.digitGroupSeparator.dotAbove,\n ])) {\n AutoNumericHelper.throwError(`The thousand separator character option 'digitGroupSeparator' is invalid ; it should be ',', '.', '٬', '˙', \"'\", ' ', '\\u2009', '\\u202f', '\\u00a0' or empty (''), [${options.digitGroupSeparator}] given.`);\n }\n\n if (!AutoNumericHelper.isTrueOrFalseString(options.showOnlyNumbersOnFocus) && !AutoNumericHelper.isBoolean(options.showOnlyNumbersOnFocus)) {\n AutoNumericHelper.throwError(`The 'showOnlyNumbersOnFocus' option is invalid ; it should be either 'false' or 'true', [${options.showOnlyNumbersOnFocus}] given.`);\n }\n\n if (!AutoNumericHelper.isInArray(options.digitalGroupSpacing, [\n AutoNumeric.options.digitalGroupSpacing.two,\n AutoNumeric.options.digitalGroupSpacing.twoScaled,\n AutoNumeric.options.digitalGroupSpacing.three,\n AutoNumeric.options.digitalGroupSpacing.four,\n ]) && !(options.digitalGroupSpacing >= 2 && options.digitalGroupSpacing <= 4)) {\n AutoNumericHelper.throwError(`The grouping separator option for thousands 'digitalGroupSpacing' is invalid ; it should be '2', '2s', '3', or '4', [${options.digitalGroupSpacing}] given.`);\n }\n\n if (!AutoNumericHelper.isInArray(options.decimalCharacter, [\n AutoNumeric.options.decimalCharacter.comma,\n AutoNumeric.options.decimalCharacter.dot,\n AutoNumeric.options.decimalCharacter.middleDot,\n AutoNumeric.options.decimalCharacter.arabicDecimalSeparator,\n AutoNumeric.options.decimalCharacter.decimalSeparatorKeySymbol,\n ])) {\n AutoNumericHelper.throwError(`The decimal separator character option 'decimalCharacter' is invalid ; it should be '.', ',', '·', '⎖' or '٫', [${options.decimalCharacter}] given.`);\n }\n\n // Checks if the decimal and thousand characters are the same\n if (options.decimalCharacter === options.digitGroupSeparator) {\n AutoNumericHelper.throwError(`autoNumeric will not function properly when the decimal character 'decimalCharacter' [${options.decimalCharacter}] and the thousand separator 'digitGroupSeparator' [${options.digitGroupSeparator}] are the same character.`);\n }\n\n if (!AutoNumericHelper.isNull(options.decimalCharacterAlternative) && !AutoNumericHelper.isString(options.decimalCharacterAlternative)) {\n AutoNumericHelper.throwError(`The alternate decimal separator character option 'decimalCharacterAlternative' is invalid ; it should be a string, [${options.decimalCharacterAlternative}] given.`);\n }\n\n if (options.currencySymbol !== '' && !AutoNumericHelper.isString(options.currencySymbol)) {\n AutoNumericHelper.throwError(`The currency symbol option 'currencySymbol' is invalid ; it should be a string, [${options.currencySymbol}] given.`);\n }\n\n if (!AutoNumericHelper.isInArray(options.currencySymbolPlacement, [\n AutoNumeric.options.currencySymbolPlacement.prefix,\n AutoNumeric.options.currencySymbolPlacement.suffix,\n ])) {\n AutoNumericHelper.throwError(`The placement of the currency sign option 'currencySymbolPlacement' is invalid ; it should either be 'p' (prefix) or 's' (suffix), [${options.currencySymbolPlacement}] given.`);\n }\n\n if (!AutoNumericHelper.isInArray(options.negativePositiveSignPlacement, [\n AutoNumeric.options.negativePositiveSignPlacement.prefix,\n AutoNumeric.options.negativePositiveSignPlacement.suffix,\n AutoNumeric.options.negativePositiveSignPlacement.left,\n AutoNumeric.options.negativePositiveSignPlacement.right,\n AutoNumeric.options.negativePositiveSignPlacement.none,\n ])) {\n AutoNumericHelper.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', [${options.negativePositiveSignPlacement}] given.`);\n }\n\n if (!AutoNumericHelper.isTrueOrFalseString(options.showPositiveSign) && !AutoNumericHelper.isBoolean(options.showPositiveSign)) {\n AutoNumericHelper.throwError(`The show positive sign option 'showPositiveSign' is invalid ; it should be either 'false' or 'true', [${options.showPositiveSign}] given.`);\n }\n\n if (!AutoNumericHelper.isString(options.suffixText) || (options.suffixText !== '' && (AutoNumericHelper.isNegative(options.suffixText, options.negativeSignCharacter) || testNumericalCharacters.test(options.suffixText)))) {\n AutoNumericHelper.throwError(`The additional suffix option 'suffixText' is invalid ; it should not contains the negative sign '${this.settings.negativeSignCharacter}' nor any numerical characters, [${options.suffixText}] given.`);\n }\n\n if (!AutoNumericHelper.isString(options.negativeSignCharacter) ||\n options.negativeSignCharacter.length !== 1 ||\n AutoNumericHelper.isUndefinedOrNullOrEmpty(options.negativeSignCharacter) ||\n testNumericalCharacters.test(options.negativeSignCharacter)) {\n AutoNumericHelper.throwError(`The negative sign character option 'negativeSignCharacter' is invalid ; it should be a single character, and cannot be any numerical characters, [${options.negativeSignCharacter}] given.`);\n }\n\n if (!AutoNumericHelper.isString(options.positiveSignCharacter) ||\n options.positiveSignCharacter.length !== 1 ||\n AutoNumericHelper.isUndefinedOrNullOrEmpty(options.positiveSignCharacter) ||\n testNumericalCharacters.test(options.positiveSignCharacter)) {\n AutoNumericHelper.throwError(`The positive sign character option 'positiveSignCharacter' is invalid ; it should be a single character, and cannot be any numerical characters, [${options.positiveSignCharacter}] given.\\nIf you want to hide the positive sign character, you need to set the \\`showPositiveSign\\` option to \\`true\\`.`);\n }\n\n if (options.negativeSignCharacter === options.positiveSignCharacter) {\n AutoNumericHelper.throwError(`The positive 'positiveSignCharacter' and negative 'negativeSignCharacter' sign characters cannot be identical ; [${options.negativeSignCharacter}] given.`);\n }\n\n const [leftBracket, rightBracket] = AutoNumericHelper.isNull(options.negativeBracketsTypeOnBlur)?['', '']:options.negativeBracketsTypeOnBlur.split(',');\n if (AutoNumericHelper.contains(options.digitGroupSeparator, options.negativeSignCharacter) ||\n AutoNumericHelper.contains(options.decimalCharacter, options.negativeSignCharacter) ||\n AutoNumericHelper.contains(options.decimalCharacterAlternative, options.negativeSignCharacter) ||\n AutoNumericHelper.contains(leftBracket, options.negativeSignCharacter) ||\n AutoNumericHelper.contains(rightBracket, options.negativeSignCharacter) ||\n AutoNumericHelper.contains(options.suffixText, options.negativeSignCharacter)) {\n AutoNumericHelper.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, [${options.negativeSignCharacter}] given.`);\n }\n\n if (AutoNumericHelper.contains(options.digitGroupSeparator, options.positiveSignCharacter) ||\n AutoNumericHelper.contains(options.decimalCharacter, options.positiveSignCharacter) ||\n AutoNumericHelper.contains(options.decimalCharacterAlternative, options.positiveSignCharacter) ||\n AutoNumericHelper.contains(leftBracket, options.positiveSignCharacter) ||\n AutoNumericHelper.contains(rightBracket, options.positiveSignCharacter) ||\n AutoNumericHelper.contains(options.suffixText, options.positiveSignCharacter)) {\n AutoNumericHelper.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, [${options.positiveSignCharacter}] given.`);\n }\n\n if (!AutoNumericHelper.isNull(options.overrideMinMaxLimits) && !AutoNumericHelper.isInArray(options.overrideMinMaxLimits, [\n AutoNumeric.options.overrideMinMaxLimits.ceiling,\n AutoNumeric.options.overrideMinMaxLimits.floor,\n AutoNumeric.options.overrideMinMaxLimits.ignore,\n ])) {\n AutoNumericHelper.throwError(`The override min & max limits option 'overrideMinMaxLimits' is invalid ; it should either be 'ceiling', 'floor' or 'ignore', [${options.overrideMinMaxLimits}] given.`);\n }\n\n if (!AutoNumericHelper.isString(options.maximumValue) || !testFloatOrIntegerAndPossibleNegativeSign.test(options.maximumValue)) {\n AutoNumericHelper.throwError(`The maximum possible value option 'maximumValue' is invalid ; it should be a string that represents a positive or negative number, [${options.maximumValue}] given.`);\n }\n\n if (!AutoNumericHelper.isString(options.minimumValue) || !testFloatOrIntegerAndPossibleNegativeSign.test(options.minimumValue)) {\n AutoNumericHelper.throwError(`The minimum possible value option 'minimumValue' is invalid ; it should be a string that represents a positive or negative number, [${options.minimumValue}] given.`);\n }\n\n if (parseFloat(options.minimumValue) > parseFloat(options.maximumValue)) {\n AutoNumericHelper.throwError(`The minimum possible value option is greater than the maximum possible value option ; 'minimumValue' [${options.minimumValue}] should be smaller than 'maximumValue' [${options.maximumValue}].`);\n }\n\n if (!((AutoNumericHelper.isInt(options.decimalPlaces) && options.decimalPlaces >= 0) || // If integer option\n (AutoNumericHelper.isString(options.decimalPlaces) && testPositiveInteger.test(options.decimalPlaces))) // If string option\n ) {\n AutoNumericHelper.throwError(`The number of decimal places option 'decimalPlaces' is invalid ; it should be a positive integer, [${options.decimalPlaces}] given.`);\n }\n\n if (!(AutoNumericHelper.isNull(options.decimalPlacesRawValue) ||\n (AutoNumericHelper.isInt(options.decimalPlacesRawValue) && options.decimalPlacesRawValue >= 0) || // If integer option\n (AutoNumericHelper.isString(options.decimalPlacesRawValue) && testPositiveInteger.test(options.decimalPlacesRawValue))) // If string option\n ) {\n AutoNumericHelper.throwError(`The number of decimal places for the raw value option 'decimalPlacesRawValue' is invalid ; it should be a positive integer or \\`null\\`, [${options.decimalPlacesRawValue}] given.`);\n }\n\n // Checks if the number of decimal places for the raw value is lower than the `decimalPlaces`, `decimalPlacesShownOnFocus` and/or `decimalPlacesShownOnBlur` options\n this._validateDecimalPlacesRawValue(options);\n\n if (!AutoNumericHelper.isNull(options.decimalPlacesShownOnFocus) &&\n !testPositiveInteger.test(String(options.decimalPlacesShownOnFocus))) {\n AutoNumericHelper.throwError(`The number of expanded decimal places option 'decimalPlacesShownOnFocus' is invalid ; it should be a positive integer or \\`null\\`, [${options.decimalPlacesShownOnFocus}] given.`);\n }\n\n // Checks if the extended decimal places \"decimalPlacesShownOnFocus\" is greater than the decimal places number `decimalPlaces`\n if (!AutoNumericHelper.isNull(options.decimalPlacesShownOnFocus) && Number(options.decimalPlaces) > Number(options.decimalPlacesShownOnFocus)) {\n AutoNumericHelper.warning(`The extended decimal places 'decimalPlacesShownOnFocus' [${options.decimalPlacesShownOnFocus}] should be greater than the 'decimalPlaces' [${options.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?`, options.showWarnings);\n }\n\n if (!AutoNumericHelper.isNull(options.divisorWhenUnfocused) &&\n !testPositiveFloatOrInteger.test(options.divisorWhenUnfocused) ||\n options.divisorWhenUnfocused === 0 || options.divisorWhenUnfocused === '0' ||\n options.divisorWhenUnfocused === 1 || options.divisorWhenUnfocused === '1') {\n AutoNumericHelper.throwError(`The divisor option 'divisorWhenUnfocused' is invalid ; it should be a positive number higher than one, preferably an integer, [${options.divisorWhenUnfocused}] given.`);\n }\n\n if (!AutoNumericHelper.isNull(options.decimalPlacesShownOnBlur) && !testPositiveInteger.test(options.decimalPlacesShownOnBlur)) {\n AutoNumericHelper.throwError(`The number of decimals shown when unfocused option 'decimalPlacesShownOnBlur' is invalid ; it should be a positive integer or \\`null\\`, [${options.decimalPlacesShownOnBlur}] given.`);\n }\n\n if (!AutoNumericHelper.isNull(options.symbolWhenUnfocused) && !AutoNumericHelper.isString(options.symbolWhenUnfocused)) {\n AutoNumericHelper.throwError(`The symbol to show when unfocused option 'symbolWhenUnfocused' is invalid ; it should be a string, [${options.symbolWhenUnfocused}] given.`);\n }\n\n if (!AutoNumericHelper.isTrueOrFalseString(options.saveValueToSessionStorage) && !AutoNumericHelper.isBoolean(options.saveValueToSessionStorage)) {\n AutoNumericHelper.throwError(`The save to session storage option 'saveValueToSessionStorage' is invalid ; it should be either 'false' or 'true', [${options.saveValueToSessionStorage}] given.`);\n }\n\n if (!AutoNumericHelper.isInArray(options.onInvalidPaste, [\n AutoNumeric.options.onInvalidPaste.error,\n AutoNumeric.options.onInvalidPaste.ignore,\n AutoNumeric.options.onInvalidPaste.clamp,\n AutoNumeric.options.onInvalidPaste.truncate,\n AutoNumeric.options.onInvalidPaste.replace,\n ])) {\n AutoNumericHelper.throwError(`The paste behavior option 'onInvalidPaste' is invalid ; it should either be 'error', 'ignore', 'clamp', 'truncate' or 'replace' (cf. documentation), [${options.onInvalidPaste}] given.`);\n }\n\n if (!AutoNumericHelper.isInArray(options.roundingMethod, [\n AutoNumeric.options.roundingMethod.halfUpSymmetric,\n AutoNumeric.options.roundingMethod.halfUpAsymmetric,\n AutoNumeric.options.roundingMethod.halfDownSymmetric,\n AutoNumeric.options.roundingMethod.halfDownAsymmetric,\n AutoNumeric.options.roundingMethod.halfEvenBankersRounding,\n AutoNumeric.options.roundingMethod.upRoundAwayFromZero,\n AutoNumeric.options.roundingMethod.downRoundTowardZero,\n AutoNumeric.options.roundingMethod.toCeilingTowardPositiveInfinity,\n AutoNumeric.options.roundingMethod.toFloorTowardNegativeInfinity,\n AutoNumeric.options.roundingMethod.toNearest05,\n AutoNumeric.options.roundingMethod.toNearest05Alt,\n AutoNumeric.options.roundingMethod.upToNext05,\n AutoNumeric.options.roundingMethod.downToNext05,\n ])) {\n AutoNumericHelper.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), [${options.roundingMethod}] given.`);\n }\n\n if (!AutoNumericHelper.isNull(options.negativeBracketsTypeOnBlur) && !AutoNumericHelper.isInArray(options.negativeBracketsTypeOnBlur, [\n AutoNumeric.options.negativeBracketsTypeOnBlur.parentheses,\n AutoNumeric.options.negativeBracketsTypeOnBlur.brackets,\n AutoNumeric.options.negativeBracketsTypeOnBlur.chevrons,\n AutoNumeric.options.negativeBracketsTypeOnBlur.curlyBraces,\n AutoNumeric.options.negativeBracketsTypeOnBlur.angleBrackets,\n AutoNumeric.options.negativeBracketsTypeOnBlur.japaneseQuotationMarks,\n AutoNumeric.options.negativeBracketsTypeOnBlur.halfBrackets,\n AutoNumeric.options.negativeBracketsTypeOnBlur.whiteSquareBrackets,\n AutoNumeric.options.negativeBracketsTypeOnBlur.quotationMarks,\n AutoNumeric.options.negativeBracketsTypeOnBlur.guillemets,\n ])) {\n AutoNumericHelper.throwError(`The brackets for negative values option 'negativeBracketsTypeOnBlur' is invalid ; it should either be '(,)', '[,]', '<,>', '{,}', '〈,〉', '「,」', '⸤,⸥', '⟦,⟧', '‹,›' or '«,»', [${options.negativeBracketsTypeOnBlur}] given.`);\n }\n\n if (!AutoNumericHelper.isInArray(options.emptyInputBehavior, [\n AutoNumeric.options.emptyInputBehavior.focus,\n AutoNumeric.options.emptyInputBehavior.press,\n AutoNumeric.options.emptyInputBehavior.always,\n AutoNumeric.options.emptyInputBehavior.zero,\n AutoNumeric.options.emptyInputBehavior.null,\n ])) {\n AutoNumericHelper.throwError(`The display on empty string option 'emptyInputBehavior' is invalid ; it should either be 'focus', 'press', 'always', 'zero' or 'null', [${options.emptyInputBehavior}] given.`);\n }\n\n if (options.emptyInputBehavior === AutoNumeric.options.emptyInputBehavior.zero &&\n (options.minimumValue > 0 || options.maximumValue < 0)) {\n AutoNumericHelper.throwError(`The 'emptyInputBehavior' option is set to 'zero', but this value is outside of the range defined by 'minimumValue' and 'maximumValue' [${options.minimumValue}, ${options.maximumValue}].`);\n }\n\n if (!AutoNumericHelper.isTrueOrFalseString(options.eventBubbles) && !AutoNumericHelper.isBoolean(options.eventBubbles)) {\n AutoNumericHelper.throwError(`The event bubbles option 'eventBubbles' is invalid ; it should be either 'true' or 'false', [${options.eventBubbles}] given.`);\n }\n\n if (!AutoNumericHelper.isTrueOrFalseString(options.eventIsCancelable) && !AutoNumericHelper.isBoolean(options.eventIsCancelable)) {\n AutoNumericHelper.throwError(`The event is cancelable option 'eventIsCancelable' is invalid ; it should be either 'true' or 'false', [${options.eventIsCancelable}] given.`);\n }\n\n if (!AutoNumericHelper.isInArray(options.leadingZero, [\n AutoNumeric.options.leadingZero.allow,\n AutoNumeric.options.leadingZero.deny,\n AutoNumeric.options.leadingZero.keep,\n ])) {\n AutoNumericHelper.throwError(`The leading zero behavior option 'leadingZero' is invalid ; it should either be 'allow', 'deny' or 'keep', [${options.leadingZero}] given.`);\n }\n\n if (!AutoNumericHelper.isTrueOrFalseString(options.formatOnPageLoad) && !AutoNumericHelper.isBoolean(options.formatOnPageLoad)) {\n AutoNumericHelper.throwError(`The format on initialization option 'formatOnPageLoad' is invalid ; it should be either 'false' or 'true', [${options.formatOnPageLoad}] given.`);\n }\n\n if (!testPositiveInteger.test(options.historySize) || options.historySize === 0) {\n AutoNumericHelper.throwError(`The history size option 'historySize' is invalid ; it should be a positive integer, [${options.historySize}] given.`);\n }\n\n if (!AutoNumericHelper.isTrueOrFalseString(options.selectNumberOnly) && !AutoNumericHelper.isBoolean(options.selectNumberOnly)) {\n AutoNumericHelper.throwError(`The select number only option 'selectNumberOnly' is invalid ; it should be either 'false' or 'true', [${options.selectNumberOnly}] given.`);\n }\n\n if (!AutoNumericHelper.isTrueOrFalseString(options.selectOnFocus) && !AutoNumericHelper.isBoolean(options.selectOnFocus)) {\n AutoNumericHelper.throwError(`The select on focus option 'selectOnFocus' is invalid ; it should be either 'false' or 'true', [${options.selectOnFocus}] given.`);\n }\n\n if (!AutoNumericHelper.isNull(options.defaultValueOverride) && (options.defaultValueOverride !== '' && !testFloatOrIntegerAndPossibleNegativeSign.test(options.defaultValueOverride))) {\n AutoNumericHelper.throwError(`The unformatted default value option 'defaultValueOverride' is invalid ; it should be a string that represents a positive or negative number, [${options.defaultValueOverride}] given.`);\n }\n\n if (!AutoNumericHelper.isTrueOrFalseString(options.unformatOnSubmit) && !AutoNumericHelper.isBoolean(options.unformatOnSubmit)) {\n AutoNumericHelper.throwError(`The remove formatting on submit option 'unformatOnSubmit' is invalid ; it should be either 'false' or 'true', [${options.unformatOnSubmit}] given.`);\n }\n\n if (!AutoNumericHelper.isNull(options.valuesToStrings) &&\n !(AutoNumericHelper.isObject(options.valuesToStrings))) {\n AutoNumericHelper.throwError(`The option 'valuesToStrings' is invalid ; it should be an object, ideally with 'key -> value' entries, [${options.valuesToStrings}] given.`);\n }\n\n if (!AutoNumericHelper.isNull(options.outputFormat) && !AutoNumericHelper.isInArray(options.outputFormat, [\n AutoNumeric.options.outputFormat.string,\n AutoNumeric.options.outputFormat.number,\n AutoNumeric.options.outputFormat.dot,\n AutoNumeric.options.outputFormat.negativeDot,\n AutoNumeric.options.outputFormat.comma,\n AutoNumeric.options.outputFormat.negativeComma,\n AutoNumeric.options.outputFormat.dotNegative,\n AutoNumeric.options.outputFormat.commaNegative,\n ])) {\n AutoNumericHelper.throwError(`The custom locale format option 'outputFormat' is invalid ; it should either be null, 'string', 'number', '.', '-.', ',', '-,', '.-' or ',-', [${options.outputFormat}] given.`);\n }\n\n if (!AutoNumericHelper.isTrueOrFalseString(options.isCancellable) && !AutoNumericHelper.isBoolean(options.isCancellable)) {\n AutoNumericHelper.throwError(`The cancellable behavior option 'isCancellable' is invalid ; it should be either 'false' or 'true', [${options.isCancellable}] given.`);\n }\n\n if (!AutoNumericHelper.isTrueOrFalseString(options.modifyValueOnWheel) && !AutoNumericHelper.isBoolean(options.modifyValueOnWheel)) {\n AutoNumericHelper.throwError(`The increment/decrement on mouse wheel option 'modifyValueOnWheel' is invalid ; it should be either 'false' or 'true', [${options.modifyValueOnWheel}] given.`);\n }\n\n if (!AutoNumericHelper.isTrueOrFalseString(options.watchExternalChanges) && !AutoNumericHelper.isBoolean(options.watchExternalChanges)) {\n AutoNumericHelper.throwError(`The option 'watchExternalChanges' is invalid ; it should be either 'false' or 'true', [${options.watchExternalChanges}] given.`);\n }\n\n if (!AutoNumericHelper.isInArray(options.wheelOn, [\n AutoNumeric.options.wheelOn.focus,\n AutoNumeric.options.wheelOn.hover,\n ])) {\n AutoNumericHelper.throwError(`The wheel behavior option 'wheelOn' is invalid ; it should either be 'focus' or 'hover', [${options.wheelOn}] given.`);\n }\n\n if (!(AutoNumericHelper.isString(options.wheelStep) || AutoNumericHelper.isNumber(options.wheelStep)) ||\n (options.wheelStep !== 'progressive' && !testPositiveFloatOrInteger.test(options.wheelStep)) ||\n Number(options.wheelStep) === 0) {\n // A step equal to '0' is rejected\n AutoNumericHelper.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), [${options.wheelStep}] given.`);\n }\n\n if (!AutoNumericHelper.isInArray(options.serializeSpaces, [\n AutoNumeric.options.serializeSpaces.plus,\n AutoNumeric.options.serializeSpaces.percent,\n ])) {\n AutoNumericHelper.throwError(`The space replacement character option 'serializeSpaces' is invalid ; it should either be '+' or '%20', [${options.serializeSpaces}] given.`);\n }\n\n if (!AutoNumericHelper.isTrueOrFalseString(options.noEventListeners) && !AutoNumericHelper.isBoolean(options.noEventListeners)) {\n AutoNumericHelper.throwError(`The option 'noEventListeners' that prevent the creation of event listeners is invalid ; it should be either 'false' or 'true', [${options.noEventListeners}] given.`);\n }\n\n if (!AutoNumericHelper.isNull(options.styleRules) &&\n !(AutoNumericHelper.isObject(options.styleRules) &&\n ((options.styleRules.hasOwnProperty('positive') ||\n options.styleRules.hasOwnProperty('negative') ||\n options.styleRules.hasOwnProperty('ranges') ||\n options.styleRules.hasOwnProperty('userDefined'))))) {\n AutoNumericHelper.throwError(`The option 'styleRules' is invalid ; it should be a correctly structured object, with one or more 'positive', 'negative', 'ranges' or 'userDefined' attributes, [${options.styleRules}] given.`);\n }\n\n // Deeper tests of the `styleRules` object : Check that the callback, if defined, is a function\n if (!AutoNumericHelper.isNull(options.styleRules) &&\n options.styleRules.hasOwnProperty('userDefined') &&\n !AutoNumericHelper.isNull(options.styleRules.userDefined)) {\n options.styleRules.userDefined.forEach(rule => {\n if (rule.hasOwnProperty('callback') && !AutoNumericHelper.isFunction(rule.callback)) {\n AutoNumericHelper.throwError(`The callback defined in the \\`userDefined\\` attribute is not a function, ${typeof rule.callback} given.`);\n }\n });\n }\n\n if (!AutoNumericHelper.isNull(options.rawValueDivisor) &&\n !testPositiveFloatOrInteger.test(options.rawValueDivisor) ||\n options.rawValueDivisor === 0 || options.rawValueDivisor === '0' ||\n options.rawValueDivisor === 1 || options.rawValueDivisor === '1') {\n AutoNumericHelper.throwError(`The raw value divisor option 'rawValueDivisor' is invalid ; it should be a positive number higher than one, preferably an integer, [${options.rawValueDivisor}] given.`);\n }\n\n if (!AutoNumericHelper.isTrueOrFalseString(options.readOnly) && !AutoNumericHelper.isBoolean(options.readOnly)) {\n AutoNumericHelper.throwError(`The option 'readOnly' is invalid ; it should be either 'false' or 'true', [${options.readOnly}] given.`);\n }\n\n if (!AutoNumericHelper.isTrueOrFalseString(options.unformatOnHover) && !AutoNumericHelper.isBoolean(options.unformatOnHover)) {\n AutoNumericHelper.throwError(`The option 'unformatOnHover' is invalid ; it should be either 'false' or 'true', [${options.unformatOnHover}] given.`);\n }\n\n if (!AutoNumericHelper.isTrueOrFalseString(options.failOnUnknownOption) && !AutoNumericHelper.isBoolean(options.failOnUnknownOption)) {\n AutoNumericHelper.throwError(`The debug option 'failOnUnknownOption' is invalid ; it should be either 'false' or 'true', [${options.failOnUnknownOption}] given.`);\n }\n\n if (!AutoNumericHelper.isTrueOrFalseString(options.createLocalList) && !AutoNumericHelper.isBoolean(options.createLocalList)) {\n AutoNumericHelper.throwError(`The debug option 'createLocalList' is invalid ; it should be either 'false' or 'true', [${options.createLocalList}] given.`);\n }\n }\n\n /**\n * Check the `decimalPlaces*` options and output the relevant warnings if some of those will get overwritten during the initialization or settings update.\n *\n * @param {object} options\n * @private\n */\n static _validateDecimalPlacesRawValue(options) {\n // Checks if the number of decimal places for the raw value is lower than the `decimalPlaces`, `decimalPlacesShownOnFocus` and/or `decimalPlacesShownOnBlur` options\n if (!AutoNumericHelper.isNull(options.decimalPlacesRawValue)) {\n if (options.decimalPlacesRawValue < options.decimalPlaces) {\n AutoNumericHelper.warning(`The number of decimal places to store in the raw value [${options.decimalPlacesRawValue}] is lower than the ones to display [${options.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\\`.`, options.showWarnings);\n }\n\n if (options.decimalPlacesRawValue < options.decimalPlacesShownOnFocus) {\n AutoNumericHelper.warning(`The number of decimal places to store in the raw value [${options.decimalPlacesRawValue}] is lower than the ones shown on focus [${options.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\\`.`, options.showWarnings);\n }\n\n if (options.decimalPlacesRawValue < options.decimalPlacesShownOnBlur) {\n AutoNumericHelper.warning(`The number of decimal places to store in the raw value [${options.decimalPlacesRawValue}] is lower than the ones shown when unfocused [${options.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\\`.`, options.showWarnings);\n }\n }\n }\n\n /**\n * Return `true` if the settings/options are valid, `false` otherwise.\n *\n * @param {object} options\n * @returns {boolean}\n */\n static areSettingsValid(options) {\n let isValid = true;\n try {\n this.validate(options, true);\n } catch (error) {\n isValid = false;\n }\n\n return isValid;\n }\n\n /**\n * Return the default autoNumeric settings.\n *\n * @returns {object}\n */\n static getDefaultConfig() {\n return AutoNumeric.defaultSettings;\n }\n\n /**\n * Return all the predefined language options in one object.\n * You can also access a specific language object directly by using `AutoNumeric.getPredefinedOptions().French` for instance.\n *\n * @returns {object}\n */\n static getPredefinedOptions() {\n return AutoNumeric.predefinedOptions;\n }\n\n /**\n * Analyse the given array `options` and return a single 'merged' option objet.\n * `options` can be `null`, or an array of an option objects, or an array containing another array of option objects / strings (pre-defined option names)\n *\n * @param {null|Array<object|string|Array<string|object>>} options\n * @returns {null|object}\n * @private\n */\n static _generateOptionsObjectFromOptionsArray(options) {\n let optionsResult;\n if (AutoNumericHelper.isUndefinedOrNullOrEmpty(options) || options.length === 0) {\n optionsResult = null;\n } else {\n optionsResult = {};\n if (options.length === 1 && Array.isArray(options[0])) {\n options[0].forEach(optionObject => {\n // Using `_getOptionObject()` allows using pre-defined names in the `options` array\n Object.assign(optionsResult, this._getOptionObject(optionObject));\n });\n } else if (options.length >= 1) {\n options.forEach(optionObject => {\n Object.assign(optionsResult, this._getOptionObject(optionObject));\n });\n }\n }\n\n return optionsResult;\n }\n\n /**\n * Format the given number (or numeric string) with the given options. This returns the formatted value as a string.\n * This can also format the given DOM element value with the given options and returns the formatted value as a string.\n * Note : This function does *not* update that element value with the newly formatted value.\n * This basically allows to get the formatted value without first having to initialize an AutoNumeric object.\n *\n * @param {number|string|HTMLElement|HTMLInputElement} numericStringOrDomElement A number, or a string that represent a javascript number, or a DOM element\n * @param {object|null} options Multiple objects can be passed, the latter overwriting the settings from the former ones\n * @returns {string|null}\n */\n static format(numericStringOrDomElement, ...options) {\n if (AutoNumericHelper.isUndefined(numericStringOrDomElement) || numericStringOrDomElement === null) {\n return null;\n }\n\n // Retrieve the value to format\n let value;\n if (AutoNumericHelper.isElement(numericStringOrDomElement)) {\n value = AutoNumericHelper.getElementValue(numericStringOrDomElement);\n } else {\n value = numericStringOrDomElement;\n }\n\n if (!AutoNumericHelper.isString(value) && !AutoNumericHelper.isNumber(value)) {\n AutoNumericHelper.throwError(`The value \"${value}\" being \"set\" is not numeric and therefore cannot be used appropriately.`);\n }\n\n // Manage options\n const optionsToUse = this._generateOptionsObjectFromOptionsArray(options);\n\n // Initiate a very basic settings object\n const settings = Object.assign({}, this.getDefaultConfig(), optionsToUse);\n settings.isNegativeSignAllowed = value < 0;\n settings.isPositiveSignAllowed = value >= 0;\n\n const regex = {};\n this._cachesUsualRegularExpressions(settings, regex); // This is needed by `_stripAllNonNumberCharactersExceptCustomDecimalChar` that uses those regex\n\n // Check the validity of the `value` parameter\n // Convert the value to a numeric string, stripping unnecessary characters in the process\n let valueString = this._toNumericValue(value, settings);\n if (isNaN(Number(valueString))) {\n AutoNumericHelper.throwError(`The value [${valueString}] that you are trying to format is not a recognized number.`);\n }\n\n // Basic tests to check if the given valueString is valid\n const [minTest, maxTest] = this._checkIfInRangeWithOverrideOption(valueString, settings);\n if (!minTest || !maxTest) {\n // Throw a custom event\n this._triggerEvent(AutoNumeric.events.formatted, document, {\n oldValue : null,\n newValue : null,\n oldRawValue: null,\n newRawValue: null,\n isPristine : null,\n error : 'Range test failed',\n aNElement : null,\n });\n AutoNumericHelper.throwError(`The value [${valueString}] being set falls outside of the minimumValue [${settings.minimumValue}] and maximumValue [${settings.maximumValue}] range set for this element`);\n }\n\n // Directly format any `valuesToStrings` values, if found\n if (settings.valuesToStrings && this._checkValuesToStringsSettings(value, settings)) {\n return settings.valuesToStrings[value];\n }\n\n // Generate the `negativePositiveSignPlacement` option as needed\n this._correctNegativePositiveSignPlacementOption(settings);\n // Calculate the needed decimal places\n this._calculateDecimalPlacesOnInit(settings);\n\n // Multiply the raw value with `rawValueDivisor` if defined\n if ((!AutoNumericHelper.isUndefinedOrNullOrEmpty(settings.rawValueDivisor) && settings.rawValueDivisor !== 0) && // Only divide if the `rawValueDivisor` option is set\n valueString !== '' && valueString !== null) { // Do not modify the `valueString` if it's an empty string or null\n valueString *= settings.rawValueDivisor;\n }\n\n // Everything is ok, proceed to rounding, formatting and grouping\n valueString = this._roundFormattedValueShownOnFocus(valueString, settings);\n valueString = this._modifyNegativeSignAndDecimalCharacterForFormattedValue(valueString, settings);\n valueString = this._addGroupSeparators(valueString, settings, false, valueString);\n\n return valueString;\n }\n\n /**\n * Format the given DOM element value, and set the resulting value back as the element value.\n *\n * @param {HTMLElement|HTMLInputElement} domElement\n * @param {object} options\n * @returns {string|null}\n */\n static formatAndSet(domElement, options = null) { //FIXME test this\n const formattedValue = this.format(domElement, options);\n AutoNumericHelper.setElementValue(domElement, formattedValue);\n\n return formattedValue;\n }\n\n /**\n * Unformat the given formatted string with the given options. This returns a numeric string.\n * It can also unformat the given DOM element value with the given options and returns the unformatted numeric string.\n * Note: This does *not* update that element value.\n * This basically allows to get the unformatted value without first having to initialize an AutoNumeric object.\n *\n * @param {string|number|HTMLElement|HTMLInputElement} numericStringOrDomElement A number, or a string that represent a javascript number, or a DOM element\n * @param {object|null} options Multiple objects can be passed, the latter overwriting the settings from the former ones\n * @returns {string|number|NaN}\n */\n static unformat(numericStringOrDomElement, ...options) {\n if (AutoNumericHelper.isNumberStrict(numericStringOrDomElement)) {\n // Giving an unformatted value should return the same unformatted value, whatever the options passed as a parameter\n return numericStringOrDomElement;\n }\n\n // Retrieve the value to unformat\n let value;\n if (AutoNumericHelper.isElement(numericStringOrDomElement)) {\n value = AutoNumericHelper.getElementValue(numericStringOrDomElement);\n } else {\n value = numericStringOrDomElement;\n }\n\n if (value === '') {\n // This allows to be coherent when serializing forms with empty inputs. Fix issue #512.\n return '';\n }\n\n if (AutoNumericHelper.isUndefined(value) || value === null) {\n return null;\n }\n\n if (AutoNumericHelper.isArray(value) || AutoNumericHelper.isObject(value)) {\n // Check the validity of the `value` parameter\n AutoNumericHelper.throwError(`A number or a string representing a number is needed to be able to unformat it, [${value}] given.`);\n }\n\n // Manage options\n const optionsToUse = this._generateOptionsObjectFromOptionsArray(options);\n\n // Generate the settings\n const settings = Object.assign({}, this.getDefaultConfig(), optionsToUse);\n settings.isNegativeSignAllowed = false;\n settings.isPositiveSignAllowed = true;\n value = value.toString();\n\n // Directly unformat any `valuesToStrings` values, if found\n if (settings.valuesToStrings && this._checkStringsToValuesSettings(value, settings)) {\n return AutoNumericHelper.objectKeyLookup(settings.valuesToStrings, value);\n }\n\n // This checks if a negative sign is anywhere in the `value`, not just on the very first character (ie. '12345.67-')\n if (AutoNumericHelper.isNegative(value, settings.negativeSignCharacter)) {\n settings.isNegativeSignAllowed = true;\n settings.isPositiveSignAllowed = false;\n } else if (!AutoNumericHelper.isNull(settings.negativeBracketsTypeOnBlur)) {\n [settings.firstBracket, settings.lastBracket] = settings.negativeBracketsTypeOnBlur.split(',');\n if (value.charAt(0) === settings.firstBracket &&\n value.charAt(value.length - 1) === settings.lastBracket) {\n settings.isNegativeSignAllowed = true;\n settings.isPositiveSignAllowed = false;\n value = this._removeBrackets(value, settings, false);\n }\n }\n\n value = this._convertToNumericString(value, settings);\n const unwantedCharacters = new RegExp(`[^+-0123456789.]`, 'gi');\n if (unwantedCharacters.test(value)) {\n return NaN;\n }\n\n // Generate the `negativePositiveSignPlacement` option as needed\n this._correctNegativePositiveSignPlacementOption(settings);\n // Calculate the needed decimal places\n if (settings.decimalPlacesRawValue) { // `originalDecimalPlacesRawValue` needs to be defined\n settings.originalDecimalPlacesRawValue = settings.decimalPlacesRawValue;\n } else {\n settings.originalDecimalPlacesRawValue = settings.decimalPlaces;\n }\n\n this._calculateDecimalPlacesOnInit(settings);\n\n // Divide the raw value with `rawValueDivisor` if defined\n if ((!AutoNumericHelper.isUndefinedOrNullOrEmpty(settings.rawValueDivisor) && settings.rawValueDivisor !== 0) && // Only divide if the `rawValueDivisor` option is set\n value !== '' && value !== null) { // Do not modify the `value` if it's an empty string or null\n value /= settings.rawValueDivisor;\n }\n\n value = this._roundRawValue(value, settings);\n value = value.replace(settings.decimalCharacter, '.'); // Here we need to convert back the decimal character to a period since `_roundValue` adds it in some cases\n value = this._toLocale(value, settings.outputFormat, settings);\n\n return value;\n }\n\n /**\n * Unformat the given DOM element value, and set the resulting value back as the element value.\n *\n * @param {HTMLElement|HTMLInputElement} domElement\n * @param {object} options\n * @returns {*}\n */\n static unformatAndSet(domElement, options = null) { //FIXME test this\n const unformattedValue = this.unformat(domElement, options);\n AutoNumericHelper.setElementValue(domElement, unformattedValue);\n\n return unformattedValue;\n }\n\n /**\n * Unformat and localize the given formatted string with the given options. This returns a numeric string.\n * It can also unformat and localize the given DOM element value with the given options and returns the unformatted numeric string.\n * Note: This does *not* update that element value.\n * This basically allows to get the localized value without first having to initialize an AutoNumeric object.\n *\n * @param {string|number|HTMLElement|HTMLInputElement} numericStringOrDomElement\n * @param {object} settings\n * @returns {*}\n */\n static localize(numericStringOrDomElement, settings = null) {\n let value;\n if (AutoNumericHelper.isElement(numericStringOrDomElement)) {\n value = AutoNumericHelper.getElementValue(numericStringOrDomElement);\n } else {\n value = numericStringOrDomElement;\n }\n\n if (value === '') {\n // This allows to be coherent when serializing forms with empty inputs. Fix issue #512.\n return '';\n }\n\n if (AutoNumericHelper.isNull(settings)) {\n settings = AutoNumeric.defaultSettings;\n }\n\n value = this.unformat(value, settings);\n\n //XXX The following code is pretty close to the one you can find in `getLocalized()`, but different enough so we won't refactor it.\n if (Number(value) === 0 && settings.leadingZero !== AutoNumeric.options.leadingZero.keep) {\n value = '0';\n }\n\n let outputFormatToUse;\n if (AutoNumericHelper.isNull(settings)) {\n outputFormatToUse = settings.outputFormat;\n } else {\n outputFormatToUse = AutoNumeric.defaultSettings.outputFormat;\n }\n\n return this._toLocale(value, outputFormatToUse, settings);\n }\n\n static localizeAndSet(domElement, options = null) { //FIXME test this\n const localizedValue = this.localize(domElement, options);\n AutoNumericHelper.setElementValue(domElement, localizedValue);\n\n return localizedValue;\n }\n\n /**\n * Return `true` if the given DOM element has an AutoNumeric object that manages it.\n * This function also accepts a selector string.\n *\n * @param {HTMLElement|string} domElementOrSelector Accepts either directly a DOM element to test, or a string selector (that will return one and only one element, if any)\n * @returns {boolean}\n */\n static isManagedByAutoNumeric(domElementOrSelector) { //FIXME test this\n return this._isInGlobalList(AutoNumericHelper.domElement(domElementOrSelector));\n }\n\n /**\n * Return the AutoNumeric object that manages the given DOM element.\n * This function also accepts a selector string.\n *\n * @param {HTMLElement|string} domElementOrSelector Accepts either directly a DOM element to test, or a string selector (that will return one and only one element, if any)\n * @returns {null|AutoNumeric}\n */\n static getAutoNumericElement(domElementOrSelector) {\n const domElement = AutoNumericHelper.domElement(domElementOrSelector);\n\n if (!this.isManagedByAutoNumeric(domElement)) {\n return null;\n }\n\n return this._getFromGlobalList(domElement);\n }\n\n /**\n * Set the given element value, and format it immediately.\n * Return `null` if no AutoNumeric object is found, else, return the AutoNumeric object.\n *\n * @param {HTMLElement|string} domElementOrSelector Either a DOM element reference, or a selector string can be used\n * @param {number|string|null} newValue The value must be a Number, a numeric string or `null` (if `emptyInputBehavior` is set to `'null'`)\n * @param {object} options A settings object that will override the current settings. Note: the update is done only if the `newValue` is defined.\n * @param {boolean} saveChangeToHistory If set to `true`, then the change is recorded in the history table\n * @returns {AutoNumeric|null}\n */\n static set(domElementOrSelector, newValue, options = null, saveChangeToHistory = true) {\n const domElement = AutoNumericHelper.domElement(domElementOrSelector);\n\n if (!this.isManagedByAutoNumeric(domElement)) {\n let showWarnings;\n if (!AutoNumericHelper.isNull(options) && options.hasOwnProperty('showWarnings')) {\n showWarnings = options.showWarnings;\n } else {\n showWarnings = true;\n }\n\n AutoNumericHelper.warning(`Impossible to find an AutoNumeric object for the given DOM element or selector.`, showWarnings);\n\n return null;\n }\n\n return this.getAutoNumericElement(domElement).set(newValue, options, saveChangeToHistory);\n }\n\n /**\n * Return the unformatted value as a string from the given DOM element or query selector.\n * This can also return `null` if `rawValue` is null.\n *\n * @param {HTMLElement|string} domElementOrSelector\n * @param {function|null} callback\n * @returns {string|null}\n */\n static getNumericString(domElementOrSelector, callback = null) {\n return this._get(domElementOrSelector, AutoNumeric.getNumericString.name, callback);\n }\n\n /**\n * Return the current formatted value of the AutoNumeric element as a string, from the given DOM element or query selector.\n *\n * @param {HTMLElement|string} domElementOrSelector\n * @param {function|null} callback\n * @returns {string}\n */\n static getFormatted(domElementOrSelector, callback = null) {\n return this._get(domElementOrSelector, AutoNumeric.getFormatted.name, callback);\n }\n\n /**\n * Return the element unformatted value as a real Javascript number, from the given DOM element or query selector.\n * Warning: This can lead to precision problems with big numbers that should be stored as strings.\n *\n * @param {HTMLElement|string} domElementOrSelector\n * @param {function|null} callback\n * @returns {number|null}\n */\n static getNumber(domElementOrSelector, callback = null) {\n return this._get(domElementOrSelector, AutoNumeric.getNumber.name, callback);\n }\n\n /**\n * DRY the code between the static `get*` functions\n *\n * @param {HTMLElement|string} domElementOrSelector\n * @param {string} getFunction The name of the non-static `get*` function as a string\n * @param {function|null} callback\n * @returns {*}\n * @private\n */\n static _get(domElementOrSelector, getFunction, callback = null) {\n const domElement = AutoNumericHelper.domElement(domElementOrSelector);\n\n if (!this.isManagedByAutoNumeric(domElement)) {\n AutoNumericHelper.throwError(`Impossible to find an AutoNumeric object for the given DOM element or selector.`);\n }\n\n return this.getAutoNumericElement(domElement)[getFunction](callback);\n }\n\n /**\n * Returns the unformatted value following the `outputFormat` setting, from the given DOM element or query selector.\n * See the non-static `getLocalized()` method documentation for more details.\n *\n * @param {HTMLElement|string} domElementOrSelector\n * @param {null|string|function} forcedOutputFormat\n * @param {function|null} callback\n * @returns {*}\n */\n static getLocalized(domElementOrSelector, forcedOutputFormat = null, callback = null) {\n const domElement = AutoNumericHelper.domElement(domElementOrSelector);\n\n if (!this.isManagedByAutoNumeric(domElement)) {\n AutoNumericHelper.throwError(`Impossible to find an AutoNumeric object for the given DOM element or selector.`);\n }\n\n return this.getAutoNumericElement(domElement).getLocalized(forcedOutputFormat, callback);\n }\n\n // Pre-defined options can be called to update the current default options with their specificities\n //XXX A better way would be to not initialize first, but that's not possible since `new` is called first and we do not pass the language options (ie. `French`) to the constructor\n\n /**\n * Update the AutoNumeric object with the predefined options, and possibly some option overrides.\n *\n * @param {object} predefinedOption\n * @param {object} optionOverride\n * @private\n * @returns {AutoNumeric}\n */\n _updatePredefinedOptions(predefinedOption, optionOverride = null) {\n if (!AutoNumericHelper.isNull(optionOverride)) {\n this._mergeSettings(predefinedOption, optionOverride);\n this.update(this.settings);\n } else {\n this.update(predefinedOption);\n }\n\n return this;\n }\n\n /**\n * Update the settings to use the French pre-defined language options.\n * Those pre-defined options can be overridden by passing an option object as a parameter.\n *\n * @param {object} optionOverride\n * @returns {AutoNumeric}\n */\n french(optionOverride = null) {\n this._updatePredefinedOptions(AutoNumeric.getPredefinedOptions().French, optionOverride);\n\n return this;\n }\n\n /**\n * Update the settings to use the North American pre-defined language options.\n * Those pre-defined options can be overridden by passing an option object as a parameter.\n *\n * @param {object} optionOverride\n * @returns {AutoNumeric}\n */\n northAmerican(optionOverride = null) {\n this._updatePredefinedOptions(AutoNumeric.getPredefinedOptions().NorthAmerican, optionOverride);\n\n return this;\n }\n\n /**\n * Update the settings to use the British pre-defined language options.\n * Those pre-defined options can be overridden by passing an option object as a parameter.\n *\n * @param {object} optionOverride\n * @returns {AutoNumeric}\n */\n british(optionOverride = null) {\n this._updatePredefinedOptions(AutoNumeric.getPredefinedOptions().British, optionOverride);\n\n return this;\n }\n\n /**\n * Update the settings to use the Swiss pre-defined language options.\n * Those pre-defined options can be overridden by passing an option object as a parameter.\n *\n * @param {object} optionOverride\n * @returns {AutoNumeric}\n */\n swiss(optionOverride = null) {\n this._updatePredefinedOptions(AutoNumeric.getPredefinedOptions().Swiss, optionOverride);\n\n return this;\n }\n\n /**\n * Update the settings to use the Japanese pre-defined language options.\n * Those pre-defined options can be overridden by passing an option object as a parameter.\n *\n * @param {object} optionOverride\n * @returns {AutoNumeric}\n */\n japanese(optionOverride = null) {\n this._updatePredefinedOptions(AutoNumeric.getPredefinedOptions().Japanese, optionOverride);\n\n return this;\n }\n\n /**\n * Update the settings to use the Spanish pre-defined language options.\n * Those pre-defined options can be overridden by passing an option object as a parameter.\n *\n * @param {object} optionOverride\n * @returns {AutoNumeric}\n */\n spanish(optionOverride = null) {\n this._updatePredefinedOptions(AutoNumeric.getPredefinedOptions().Spanish, optionOverride);\n\n return this;\n }\n\n /**\n * Update the settings to use the Chinese pre-defined language options.\n * Those pre-defined options can be overridden by passing an option object as a parameter.\n *\n * @param {object} optionOverride\n * @returns {AutoNumeric}\n */\n chinese(optionOverride = null) {\n this._updatePredefinedOptions(AutoNumeric.getPredefinedOptions().Chinese, optionOverride);\n\n return this;\n }\n\n /**\n * Update the settings to use the Brazilian pre-defined language options.\n * Those pre-defined options can be overridden by passing an option object as a parameter.\n *\n * @param {object} optionOverride\n * @returns {AutoNumeric}\n */\n brazilian(optionOverride = null) {\n this._updatePredefinedOptions(AutoNumeric.getPredefinedOptions().Brazilian, optionOverride);\n\n return this;\n }\n\n\n // Internal private functions\n /**\n * Run any callbacks found in the settings object in order to set the settings value back.\n * Any parameter can have a callback defined.\n * The callback takes the current AutoNumeric element as the first argument, and the key name as the second.\n * @example callback(this, 'currencySymbol')\n */\n _runCallbacksFoundInTheSettingsObject() { //FIXME test this\n // Loops through the this.settings object (option array) to find the following\n for (const key in this.settings) {\n if (this.settings.hasOwnProperty(key)) {\n const value = this.settings[key];\n\n if (typeof value === 'function') {\n this.settings[key] = value(this, key);\n } else {\n // Calls the attached function from the html5 data. For instance: <tag data-currency-symbol=\"functionName\"></tag>\n let htmlAttribute = this.domElement.getAttribute(key); //TODO Use `dataset` instead of `getAttribute` when we won't need to support obsolete browsers\n htmlAttribute = AutoNumericHelper.camelize(htmlAttribute);\n if (typeof this.settings[htmlAttribute] === 'function') {\n this.settings[key] = htmlAttribute(this, key);\n }\n }\n }\n }\n }\n\n /**\n * Keep track if the settings configuration leads to a trailing negative sign (only when the raw value is negative), so we do not have to test the settings values every time we need to know that.\n * `isTrailingNegative` is set to `true` if the settings result in a trailing negative character, `false` otherwise.\n * Note: This returns `true` even if the raw value is positive.\n * @private\n */\n _setTrailingNegativeSignInfo() {\n this.isTrailingNegative = (this.settings.currencySymbolPlacement === AutoNumeric.options.currencySymbolPlacement.prefix && this.settings.negativePositiveSignPlacement === AutoNumeric.options.negativePositiveSignPlacement.suffix) ||\n (this.settings.currencySymbolPlacement === AutoNumeric.options.currencySymbolPlacement.suffix &&\n (this.settings.negativePositiveSignPlacement === AutoNumeric.options.negativePositiveSignPlacement.left || this.settings.negativePositiveSignPlacement === AutoNumeric.options.negativePositiveSignPlacement.right));\n }\n\n /**\n * Strip all the unwanted non-number characters.\n * However it does not reorder the localized negative sign.\n *\n * @param {string} s\n * @param {object} settings\n * @param {boolean} stripZeros If set to `false`, then the leading zero(s) are not stripped, otherwise if set to `true`, the `leadingZero` option is followed\n * @param {boolean} isFocused If the element is focused, then this is `true`\n * @returns {string}\n * @private\n */\n static _stripAllNonNumberCharacters(s, settings, stripZeros, isFocused) {\n return this._stripAllNonNumberCharactersExceptCustomDecimalChar(s, settings, stripZeros, isFocused).replace(settings.decimalCharacter, '.');\n }\n\n /**\n * Strip all unwanted non-number characters except the custom decimal character.\n *\n * It converts the custom negative sign and removes the positive sign (custom or not).\n * This keeps :\n * - the numbers,\n * - the normal negative sign '-' if any,\n * - and the *custom* decimal character.\n *\n * @param {string} s\n * @param {object} settings\n * @param {boolean} stripZeros If set to `false`, then the leading zero(s) are not stripped, otherwise if set to `true`, the `leadingZero` option is followed\n * @param {boolean} isFocused If the element is focused, then this is `true`\n * @returns {string|*}\n */\n static _stripAllNonNumberCharactersExceptCustomDecimalChar(s, settings, stripZeros, isFocused) {\n //XXX Note; this function is static since we need to pass a `settings` object when calling the static `AutoNumeric.format()` method\n //TODO This function is called 10 times (sic!) on each key input, couldn't we lower that number? cf. issue #325\n s = this._normalizeCurrencySuffixAndNegativeSignCharacters(s, settings);\n\n // Then remove all the characters that are not numbers, the normal negative sign '-', or the custom decimal character (note: this also remove any custom positive sign)\n s = s.replace(settings.allowedAutoStrip, '');\n\n // Get only number string\n const m = s.match(settings.numRegAutoStrip);\n s = m ? [m[1], m[2], m[3]].join('') : '';\n\n if (settings.leadingZero === AutoNumeric.options.leadingZero.allow || settings.leadingZero === AutoNumeric.options.leadingZero.keep) {\n let negativeSign = '';\n const [integerPart, decimalPart] = s.split(settings.decimalCharacter);\n let modifiedIntegerPart = integerPart;\n if (AutoNumericHelper.contains(modifiedIntegerPart, settings.negativeSignCharacter)) {\n negativeSign = settings.negativeSignCharacter;\n modifiedIntegerPart = modifiedIntegerPart.replace(settings.negativeSignCharacter, '');\n }\n\n // Strip leading zero on positive value if needed\n if (negativeSign === '' && modifiedIntegerPart.length > settings.mIntPos && modifiedIntegerPart.charAt(0) === '0') {\n modifiedIntegerPart = modifiedIntegerPart.slice(1);\n }\n\n // Strip leading zero on negative value if needed\n if (negativeSign !== '' && modifiedIntegerPart.length > settings.mIntNeg && modifiedIntegerPart.charAt(0) === '0') {\n modifiedIntegerPart = modifiedIntegerPart.slice(1);\n }\n\n s = `${negativeSign}${modifiedIntegerPart}${AutoNumericHelper.isUndefined(decimalPart)?'':settings.decimalCharacter + decimalPart}`;\n }\n\n if ((stripZeros && settings.leadingZero === AutoNumeric.options.leadingZero.deny) ||\n (!isFocused && settings.leadingZero === AutoNumeric.options.leadingZero.allow)) {\n s = s.replace(settings.stripReg, '$1$2');\n }\n\n return s;\n }\n\n /**\n * Sets or removes brackets on negative values, depending on the focus state, which is passed as `isFocused`.\n * The focus state is 'stored' in that object property.\n *\n * @param {string} value\n * @param {object} settings\n * @param {boolean} isFocused\n * @returns {*}\n */\n static _toggleNegativeBracket(value, settings, isFocused) {\n //XXX Note; this function is static since we need to pass a `settings` object when calling the static `AutoNumeric.format()` method\n let result;\n if (isFocused) {\n result = this._removeBrackets(value, settings);\n } else {\n result = this._addBrackets(value, settings);\n }\n\n return result;\n }\n\n /**\n * Add the bracket types specified in the `settings` object, to the given string `value`.\n *\n * @param {string} value\n * @param {object} settings\n * @returns {string}\n * @private\n */\n static _addBrackets(value, settings) {\n if (AutoNumericHelper.isNull(settings.negativeBracketsTypeOnBlur)) {\n return value;\n }\n\n return `${settings.firstBracket}${value.replace(settings.negativeSignCharacter, '')}${settings.lastBracket}`;\n }\n\n /**\n * Remove the bracket types specified in the `settings` object, from the given string `value`.\n *\n * @param {string} value\n * @param {object} settings\n * @param {boolean} rearrangeSignsAndValueOrder If set to `true`, then only the brackets are remove and a negative sign is added, without reordering the negative sign, currency symbol and value according to the settings.\n * @returns {string}\n * @private\n */\n static _removeBrackets(value, settings, rearrangeSignsAndValueOrder = true) {\n let result;\n if (!AutoNumericHelper.isNull(settings.negativeBracketsTypeOnBlur) && value.charAt(0) === settings.firstBracket) {\n // Remove the brackets if they are present\n result = value.replace(settings.firstBracket, '');\n result = result.replace(settings.lastBracket, '');\n\n // Add back the negative sign at the right place\n if (rearrangeSignsAndValueOrder) {\n // First we need to remove the currency symbol from the value, since we want to be able to add back the negative sign at the right place (including between the value and the currency sign)\n result = result.replace(settings.currencySymbol, '');\n result = this._mergeCurrencySignNegativePositiveSignAndValue(result, settings, true, false); //TODO This assume the value is negative and non-empty. Is this always the case?\n } else {\n // Here we only want to add the negative sign since we removed the brackets, without reordering\n result = `${settings.negativeSignCharacter}${result}`;\n }\n } else {\n result = value;\n }\n\n return result;\n }\n\n /**\n * Analyze the `negativeBracketsTypeOnBlur` options and keep track of the first and last bracket characters to use.\n * @private\n */\n _setBrackets() {\n if (AutoNumericHelper.isNull(this.settings.negativeBracketsTypeOnBlur)) {\n this.settings.firstBracket = '';\n this.settings.lastBracket = '';\n } else {\n [this.settings.firstBracket, this.settings.lastBracket] = this.settings.negativeBracketsTypeOnBlur.split(',');\n }\n }\n\n /**\n * Return a number as a numeric string that can be typecast to a Number that Javascript will understand.\n *\n * This function returns the given string by stripping:\n * - the currency sign (currencySymbol),\n * - the grouping separators (digitalGroupSpacing),\n * - the suffix text (suffixText),\n * - the positive sign (positiveSignCharacter),\n * - the brackets if any,\n * - by replacing the negative sign character with an hyphen,\n * - and by replacing the decimal character (decimalCharacter) by a dot.\n *\n * Lastly, it also put the negative sign back to its normal position if needed.\n * Bonus; it converts any arabic numbers found to the latin ones.\n *\n * @param {string} s\n * @param {object} settings\n * @returns {string|void|*}\n */\n static _convertToNumericString(s, settings) {\n // Remove the custom brackets\n s = this._removeBrackets(s, settings, false);\n s = this._normalizeCurrencySuffixAndNegativeSignCharacters(s, settings);\n\n // Remove the grouping separators (thousands separators usually)\n s = s.replace(new RegExp(`[${settings.digitGroupSeparator}]`, 'g'), '');\n\n // Replace the decimal character by a dot\n if (settings.decimalCharacter !== '.') {\n s = s.replace(settings.decimalCharacter, '.');\n }\n\n // Move the trailing negative sign, if any, to the usual leftmost position\n if (AutoNumericHelper.isNegative(s) && s.lastIndexOf('-') === s.length - 1) {\n s = s.replace('-', '');\n s = `-${s}`;\n }\n\n // Replace the custom positive sign\n if (settings.showPositiveSign) {\n s = s.replace(settings.positiveSignCharacter, '');\n }\n\n // Convert arabic numbers to latin ones, if any\n const convertToNumber = settings.leadingZero !== AutoNumeric.options.leadingZero.keep;\n const temp = AutoNumericHelper.arabicToLatinNumbers(s, convertToNumber, false, false);\n if (!isNaN(temp)) {\n s = temp.toString();\n }\n\n return s;\n }\n\n /**\n * Removes the currency symbol and the suffix text from the given string, and replace the custom negative sign with an hyphen.\n *\n * @param {string} s\n * @param {object} settings\n * @returns {string | *}\n * @private\n */\n static _normalizeCurrencySuffixAndNegativeSignCharacters(s, settings) {\n s = String(s); // Typecast to to a string, in case that the given value is a number\n\n // Remove the currency symbol\n if (settings.currencySymbol !== AutoNumeric.options.currencySymbol.none) {\n s = s.replace(settings.currencySymbol, '');\n }\n\n // Remove the suffixText\n if (settings.suffixText !== AutoNumeric.options.suffixText.none) {\n s = s.replace(settings.suffixText, '');\n }\n\n // Replace the custom negative sign with an hyphen\n if (settings.negativeSignCharacter !== AutoNumeric.options.negativeSignCharacter.hyphen) {\n s = s.replace(settings.negativeSignCharacter, '-');\n }\n\n return s;\n }\n\n /**\n * Converts the ISO numeric string to the locale decimal and minus sign placement.\n * See the \"outputFormat\" option definition for more details.\n * Note: If the `outputFormat` is set to a number, the custom `negativeSignCharacter` is ignored.\n *\n * @param {string|null} value The unformatted value\n * @param {string|null} locale\n * @param {object} settings\n * @returns {*}\n */\n static _toLocale(value, locale, settings) {\n if (AutoNumericHelper.isNull(locale) || locale === AutoNumeric.options.outputFormat.string) {\n return value;\n }\n\n let result;\n switch (locale) {\n case AutoNumeric.options.outputFormat.number:\n result = Number(value);\n break;\n case AutoNumeric.options.outputFormat.dotNegative:\n result = AutoNumericHelper.isNegative(value) ? value.replace('-', '') + '-' : value;\n break;\n case AutoNumeric.options.outputFormat.comma:\n case AutoNumeric.options.outputFormat.negativeComma:\n result = value.replace('.', ',');\n break;\n case AutoNumeric.options.outputFormat.commaNegative:\n result = value.replace('.', ',');\n result = AutoNumericHelper.isNegative(result) ? result.replace('-', '') + '-' : result;\n break;\n // The default case\n case AutoNumeric.options.outputFormat.dot:\n case AutoNumeric.options.outputFormat.negativeDot:\n result = value;\n break;\n default :\n AutoNumericHelper.throwError(`The given outputFormat [${locale}] option is not recognized.`);\n }\n\n if (locale !== AutoNumeric.options.outputFormat.number && settings.negativeSignCharacter !== '-') {\n // Modify the default minus sign with the custom one, if any\n result = result.replace('-', settings.negativeSignCharacter);\n }\n\n return result;\n }\n\n /**\n * Modify the negative sign and the decimal character of the given string value to an hyphen (-) and a dot (.) in order to make that value 'typecastable' to a real number.\n *\n * @param {string} s The formatted value\n * @returns {string} The value with the 'normal' minus sign and decimal character\n */\n _modifyNegativeSignAndDecimalCharacterForRawValue(s) {\n if (this.settings.decimalCharacter !== '.') {\n s = s.replace(this.settings.decimalCharacter, '.');\n }\n\n if (this.settings.negativeSignCharacter !== '-' && this.settings.isNegativeSignAllowed) {\n s = s.replace(this.settings.negativeSignCharacter, '-');\n }\n\n if (!s.match(/\\d/)) {\n // The default value returned by `get` is not formatted with decimals\n s += '0';\n }\n\n return s;\n }\n\n /**\n * Modify the negative sign and the decimal character to use those defined in the settings.\n *\n * @param {string} s\n * @param {object} settings\n * @returns {string}\n */\n static _modifyNegativeSignAndDecimalCharacterForFormattedValue(s, settings) {\n //XXX Note; this function is static since we need to pass a `settings` object when calling the static `AutoNumeric.format()` method\n if (settings.negativeSignCharacter !== '-') {\n s = s.replace('-', settings.negativeSignCharacter);\n }\n\n if (settings.decimalCharacter !== '.') {\n s = s.replace('.', settings.decimalCharacter);\n }\n\n return s;\n }\n\n /**\n * Return `true` if the given value is empty or is equal to the negative sign character defined in the given settings.\n *\n * @param {string} value\n * @param {object} settings\n * @returns {boolean}\n * @private\n */\n static _isElementValueEmptyOrOnlyTheNegativeSign(value, settings) {\n return value === '' || value === settings.negativeSignCharacter;\n }\n\n /**\n * Return the value with the currency symbol and the suffix text ordered according to the given settings.\n *\n * @param {string} value\n * @param {object} settings\n * @param {boolean} signOnEmpty\n * @returns {*}\n * @private\n */\n static _orderValueCurrencySymbolAndSuffixText(value, settings, signOnEmpty) {\n let result;\n if (settings.emptyInputBehavior === AutoNumeric.options.emptyInputBehavior.always || signOnEmpty) {\n if (settings.negativePositiveSignPlacement === AutoNumeric.options.negativePositiveSignPlacement.left) {\n result = value + settings.currencySymbol + settings.suffixText;\n } else {\n result = settings.currencySymbol + value + settings.suffixText;\n }\n } else {\n result = value;\n }\n\n return result;\n }\n\n /**\n * Modify the input value by adding the group separators, as defined in the settings, and the negative brackets if needed.\n *\n * @param {string} inputValue The formatted value (ie. with the `decimalCharacter` defined in the settings, not the raw value)\n * @param {object} settings\n * @param {boolean} isFocused\n * @param {number|string|null} currentRawValue The object current raw value (`this.rawValue`)\n * @param {number|string|null} forcedRawValue If this is set, then this rawValue is used instead of the one passed through the `settings` object. This is useful is some very specific cases where we need to set the raw value *after* settings the formatted value, using the `_addGroupSeparators()` method.\n * @returns {*}\n */\n static _addGroupSeparators(inputValue, settings, isFocused, currentRawValue, forcedRawValue = null) {\n //TODO Test if `inputValue` === '', and return '' directly if that's the case,\n //XXX Note; this function is static since we need to pass a `settings` object when calling the static `AutoNumeric.format()` method\n let isValueNegative;\n if (!AutoNumericHelper.isNull(forcedRawValue)) {\n // Prefer directly testing if the raw value is negative in order for the test to be more performant than manipulating the formatted value\n isValueNegative = forcedRawValue < 0;\n } else {\n isValueNegative = AutoNumericHelper.isNegative(inputValue, settings.negativeSignCharacter) || AutoNumericHelper.isNegativeWithBrackets(inputValue, settings.firstBracket, settings.lastBracket); // Test if the value is negative before removing the negative sign\n }\n\n inputValue = this._stripAllNonNumberCharactersExceptCustomDecimalChar(inputValue, settings, false, isFocused);\n\n if (this._isElementValueEmptyOrOnlyTheNegativeSign(inputValue, settings)) {\n return this._orderValueCurrencySymbolAndSuffixText(inputValue, settings, true);\n }\n\n const isZeroOrHasNoValue = AutoNumericHelper.isZeroOrHasNoValue(inputValue);\n\n // Temporarily remove the negative sign if present\n if (isValueNegative) {\n inputValue = inputValue.replace('-', ''); // At this point the `inputValue` has been normalized with a 'normal' negative sign `'-'` //TODO Check that comment validity, since `_stripAllNonNumberCharactersExceptCustomDecimalChar` *does not* convert the negative sign\n }\n\n settings.digitalGroupSpacing = settings.digitalGroupSpacing.toString();\n let digitalGroup;\n switch (settings.digitalGroupSpacing) {\n case AutoNumeric.options.digitalGroupSpacing.two:\n digitalGroup = /(\\d)((\\d)(\\d{2}?)+)$/;\n break;\n case AutoNumeric.options.digitalGroupSpacing.twoScaled:\n digitalGroup = /(\\d)((?:\\d{2}){0,2}\\d{3}(?:(?:\\d{2}){2}\\d{3})*?)$/;\n break;\n case AutoNumeric.options.digitalGroupSpacing.four:\n digitalGroup = /(\\d)((\\d{4}?)+)$/;\n break;\n case AutoNumeric.options.digitalGroupSpacing.three:\n default :\n digitalGroup = /(\\d)((\\d{3}?)+)$/;\n }\n\n // Splits the string at the decimal string\n let [integerPart, decimalPart] = inputValue.split(settings.decimalCharacter);\n if (settings.decimalCharacterAlternative && AutoNumericHelper.isUndefined(decimalPart)) {\n [integerPart, decimalPart] = inputValue.split(settings.decimalCharacterAlternative);\n }\n\n if (settings.digitGroupSeparator !== '') {\n // Re-inserts the thousand separator via a regular expression\n while (digitalGroup.test(integerPart)) {\n integerPart = integerPart.replace(digitalGroup, `$1${settings.digitGroupSeparator}$2`);\n }\n }\n\n // Find out how many decimal places should be kept, depending on the object state (isFocused)\n let decimalPlacesToRoundTo;\n if (isFocused) {\n decimalPlacesToRoundTo = settings.decimalPlacesShownOnFocus;\n } else {\n decimalPlacesToRoundTo = settings.decimalPlacesShownOnBlur;\n }\n\n if (decimalPlacesToRoundTo !== 0 && !AutoNumericHelper.isUndefined(decimalPart)) {\n if (decimalPart.length > decimalPlacesToRoundTo) {\n // Trim the excessive number of decimal places\n decimalPart = decimalPart.substring(0, decimalPlacesToRoundTo);\n }\n\n // Joins the whole number with the decimal value\n inputValue = `${integerPart}${settings.decimalCharacter}${decimalPart}`;\n } else {\n // Otherwise if it's an integer\n inputValue = integerPart;\n }\n\n // Add back the negative/positive sign and the currency symbol, at the right positions\n inputValue = AutoNumeric._mergeCurrencySignNegativePositiveSignAndValue(inputValue, settings, isValueNegative, isZeroOrHasNoValue); //TODO this function is called again in `_toggleNegativeBracket` if the brackets are removed; let's DRY this\n\n if (AutoNumericHelper.isNull(forcedRawValue)) {\n // If the raw value is not forced, use the default one from the settings object\n forcedRawValue = currentRawValue;\n }\n\n // Toggle the negative sign and brackets\n if (settings.negativeBracketsTypeOnBlur !== null && (forcedRawValue < 0 || AutoNumericHelper.isNegativeStrict(inputValue, settings.negativeSignCharacter))) {\n inputValue = this._toggleNegativeBracket(inputValue, settings, isFocused);\n }\n\n let result;\n if (settings.suffixText) {\n result = `${inputValue}${settings.suffixText}`;\n } else {\n result = inputValue;\n }\n\n return result;\n }\n\n /**\n * Return a semi-formatted string where the input value, the negative or positive sign, and the currency symbol are stitched together at the right positions, using the options set in the `settings` object.\n * Note : the `inputValue` is usually not a numeric string since the grouping symbols are already added to it at this point.\n *\n * @param {string} inputValue\n * @param {object} settings\n * @param {boolean} isValueNegative\n * @param {boolean} isZeroOrHasNoValue\n * @returns {*}\n * @throws\n * @private\n */\n static _mergeCurrencySignNegativePositiveSignAndValue(inputValue, settings, isValueNegative, isZeroOrHasNoValue) {\n let signToUse = '';\n if (isValueNegative) {\n signToUse = settings.negativeSignCharacter;\n } else if (settings.showPositiveSign && !isZeroOrHasNoValue) {\n signToUse = settings.positiveSignCharacter;\n }\n\n let result;\n if (settings.currencySymbolPlacement === AutoNumeric.options.currencySymbolPlacement.prefix) {\n if (settings.negativePositiveSignPlacement !== AutoNumeric.options.negativePositiveSignPlacement.none &&\n (isValueNegative || (!isValueNegative && settings.showPositiveSign && !isZeroOrHasNoValue))) {\n switch (settings.negativePositiveSignPlacement) {\n case AutoNumeric.options.negativePositiveSignPlacement.prefix:\n case AutoNumeric.options.negativePositiveSignPlacement.left:\n result = `${signToUse}${settings.currencySymbol}${inputValue}`;\n break;\n case AutoNumeric.options.negativePositiveSignPlacement.right:\n result = `${settings.currencySymbol}${signToUse}${inputValue}`;\n break;\n case AutoNumeric.options.negativePositiveSignPlacement.suffix:\n result = `${settings.currencySymbol}${inputValue}${signToUse}`;\n break;\n }\n } else {\n result = settings.currencySymbol + inputValue;\n }\n } else if (settings.currencySymbolPlacement === AutoNumeric.options.currencySymbolPlacement.suffix) {\n if (settings.negativePositiveSignPlacement !== AutoNumeric.options.negativePositiveSignPlacement.none &&\n (isValueNegative || (!isValueNegative && settings.showPositiveSign && !isZeroOrHasNoValue))) {\n switch (settings.negativePositiveSignPlacement) {\n case AutoNumeric.options.negativePositiveSignPlacement.suffix:\n case AutoNumeric.options.negativePositiveSignPlacement.right:\n result = `${inputValue}${settings.currencySymbol}${signToUse}`;\n break;\n case AutoNumeric.options.negativePositiveSignPlacement.left:\n result = `${inputValue}${signToUse}${settings.currencySymbol}`;\n break;\n case AutoNumeric.options.negativePositiveSignPlacement.prefix:\n result = `${signToUse}${inputValue}${settings.currencySymbol}`;\n break;\n }\n } else {\n result = inputValue + settings.currencySymbol;\n }\n }\n\n return result;\n }\n\n /**\n * Calculate where to put the caret position on focus if the element content is not selected.\n * This calculation is affected by the `caretPositionOnFocus` option which can be either `null`, `'start'`, `'end'`, `'decimalLeft'` or 'decimalRight'`, and will decide where to put the caret (on the left or right of the value or the decimal character, respectively) :\n * - `null` : the caret position is not forced\n * - `'start'` : the caret is positioned on the left hand side of the value\n * - `'end'` : the caret is positioned on the right hand side of the value\n * - `'decimalLeft'` : the caret is positioned on the left side of the decimal character\n * - `'decimalRight'` : the caret is positioned on the right side of the decimal character\n *\n * @param {string} value The formatted string stripped of the currency symbol and negative/positive sign\n * @returns {number}\n * @throws\n * @private\n */\n _initialCaretPosition(value) {\n if (AutoNumericHelper.isNull(this.settings.caretPositionOnFocus) &&\n this.settings.selectOnFocus === AutoNumeric.options.selectOnFocus.doNotSelect) {\n AutoNumericHelper.throwError('`_initialCaretPosition()` should never be called when the `caretPositionOnFocus` option is `null`.');\n }\n\n const isValueNegative = this.rawValue < 0;\n const isZeroOrHasNoValue = AutoNumericHelper.isZeroOrHasNoValue(value);\n const totalLength = value.length;\n\n let valueSize = 0;\n let integerSize = 0;\n let hasDecimalChar = false;\n let offsetDecimalChar = 0;\n if (this.settings.caretPositionOnFocus !== AutoNumeric.options.caretPositionOnFocus.start) {\n value = value.replace(this.settings.negativeSignCharacter, '');\n value = value.replace(this.settings.positiveSignCharacter, '');\n value = value.replace(this.settings.currencySymbol, '');\n valueSize = value.length;\n hasDecimalChar = AutoNumericHelper.contains(value, this.settings.decimalCharacter);\n\n if (this.settings.caretPositionOnFocus === AutoNumeric.options.caretPositionOnFocus.decimalLeft ||\n this.settings.caretPositionOnFocus === AutoNumeric.options.caretPositionOnFocus.decimalRight) {\n if (hasDecimalChar) {\n integerSize = value.indexOf(this.settings.decimalCharacter);\n offsetDecimalChar = this.settings.decimalCharacter.length;\n } else {\n integerSize = valueSize;\n offsetDecimalChar = 0;\n }\n }\n }\n\n let signToUse = '';\n if (isValueNegative) {\n signToUse = this.settings.negativeSignCharacter;\n } else if (this.settings.showPositiveSign && !isZeroOrHasNoValue) {\n signToUse = this.settings.positiveSignCharacter;\n }\n\n const positiveNegativeSignSize = signToUse.length;\n const currencySymbolSize = this.settings.currencySymbol.length;\n\n // Calculate the caret position based on `currencySymbolPlacement`, `negativePositiveSignPlacement` and `caretPositionOnFocus`\n let caretPosition;\n if (this.settings.currencySymbolPlacement === AutoNumeric.options.currencySymbolPlacement.prefix) {\n if (this.settings.caretPositionOnFocus === AutoNumeric.options.caretPositionOnFocus.start) {\n if (this.settings.negativePositiveSignPlacement !== AutoNumeric.options.negativePositiveSignPlacement.none &&\n (isValueNegative || (!isValueNegative && this.settings.showPositiveSign && !isZeroOrHasNoValue))) {\n switch (this.settings.negativePositiveSignPlacement) {\n case AutoNumeric.options.negativePositiveSignPlacement.prefix: // +€|12.34\n case AutoNumeric.options.negativePositiveSignPlacement.left: // +€|12.34\n case AutoNumeric.options.negativePositiveSignPlacement.right: // €+|12.34\n caretPosition = positiveNegativeSignSize + currencySymbolSize;\n break;\n case AutoNumeric.options.negativePositiveSignPlacement.suffix: // €|12.34+\n caretPosition = currencySymbolSize;\n break;\n }\n } else { // €|12.34\n caretPosition = currencySymbolSize;\n }\n } else if (this.settings.caretPositionOnFocus === AutoNumeric.options.caretPositionOnFocus.end) {\n if (this.settings.negativePositiveSignPlacement !== AutoNumeric.options.negativePositiveSignPlacement.none &&\n (isValueNegative || (!isValueNegative && this.settings.showPositiveSign && !isZeroOrHasNoValue))) {\n switch (this.settings.negativePositiveSignPlacement) {\n case AutoNumeric.options.negativePositiveSignPlacement.prefix: // +€12.34|\n case AutoNumeric.options.negativePositiveSignPlacement.left: // +€12.34|\n case AutoNumeric.options.negativePositiveSignPlacement.right: // €+12.34|\n caretPosition = totalLength;\n break;\n case AutoNumeric.options.negativePositiveSignPlacement.suffix: // €12.34|+\n caretPosition = currencySymbolSize + valueSize;\n break;\n }\n } else { // €12.34|\n caretPosition = totalLength;\n }\n } else if (this.settings.caretPositionOnFocus === AutoNumeric.options.caretPositionOnFocus.decimalLeft) {\n if (this.settings.negativePositiveSignPlacement !== AutoNumeric.options.negativePositiveSignPlacement.none &&\n (isValueNegative || (!isValueNegative && this.settings.showPositiveSign && !isZeroOrHasNoValue))) {\n switch (this.settings.negativePositiveSignPlacement) {\n case AutoNumeric.options.negativePositiveSignPlacement.prefix: // +€12|.34\n case AutoNumeric.options.negativePositiveSignPlacement.left: // +€12|.34\n case AutoNumeric.options.negativePositiveSignPlacement.right: // €+12|.34\n caretPosition = positiveNegativeSignSize + currencySymbolSize + integerSize;\n break;\n case AutoNumeric.options.negativePositiveSignPlacement.suffix: // €12|.34+\n caretPosition = currencySymbolSize + integerSize;\n break;\n }\n } else { // €12|.34\n caretPosition = currencySymbolSize + integerSize;\n }\n } else if (this.settings.caretPositionOnFocus === AutoNumeric.options.caretPositionOnFocus.decimalRight) {\n if (this.settings.negativePositiveSignPlacement !== AutoNumeric.options.negativePositiveSignPlacement.none &&\n (isValueNegative || (!isValueNegative && this.settings.showPositiveSign && !isZeroOrHasNoValue))) {\n switch (this.settings.negativePositiveSignPlacement) {\n case AutoNumeric.options.negativePositiveSignPlacement.prefix: // +€12.|34\n case AutoNumeric.options.negativePositiveSignPlacement.left: // +€12.|34\n case AutoNumeric.options.negativePositiveSignPlacement.right: // €+12.|34\n caretPosition = positiveNegativeSignSize + currencySymbolSize + integerSize + offsetDecimalChar;\n break;\n case AutoNumeric.options.negativePositiveSignPlacement.suffix: // €12.|34+\n caretPosition = currencySymbolSize + integerSize + offsetDecimalChar;\n break;\n }\n } else { // €12.|34\n caretPosition = currencySymbolSize + integerSize + offsetDecimalChar;\n }\n }\n } else if (this.settings.currencySymbolPlacement === AutoNumeric.options.currencySymbolPlacement.suffix) {\n if (this.settings.caretPositionOnFocus === AutoNumeric.options.caretPositionOnFocus.start) {\n if (this.settings.negativePositiveSignPlacement !== AutoNumeric.options.negativePositiveSignPlacement.none &&\n (isValueNegative || (!isValueNegative && this.settings.showPositiveSign && !isZeroOrHasNoValue))) {\n switch (this.settings.negativePositiveSignPlacement) {\n case AutoNumeric.options.negativePositiveSignPlacement.suffix: // |12.34€+\n case AutoNumeric.options.negativePositiveSignPlacement.right: // |12.34€+\n case AutoNumeric.options.negativePositiveSignPlacement.left: // |12.34+€\n caretPosition = 0;\n break;\n case AutoNumeric.options.negativePositiveSignPlacement.prefix: // +|12.34€\n caretPosition = positiveNegativeSignSize;\n break;\n }\n } else { // |12.34€\n caretPosition = 0;\n }\n } else if (this.settings.caretPositionOnFocus === AutoNumeric.options.caretPositionOnFocus.end) {\n if (this.settings.negativePositiveSignPlacement !== AutoNumeric.options.negativePositiveSignPlacement.none &&\n (isValueNegative || (!isValueNegative && this.settings.showPositiveSign && !isZeroOrHasNoValue))) {\n switch (this.settings.negativePositiveSignPlacement) {\n case AutoNumeric.options.negativePositiveSignPlacement.suffix: // 12.34|€+\n case AutoNumeric.options.negativePositiveSignPlacement.right: // 12.34|€+\n case AutoNumeric.options.negativePositiveSignPlacement.left: // 12.34|+€\n caretPosition = valueSize;\n break;\n case AutoNumeric.options.negativePositiveSignPlacement.prefix: // +12.34|€\n caretPosition = positiveNegativeSignSize + valueSize;\n break;\n }\n } else { // 12.34|€\n caretPosition = valueSize;\n }\n } else if (this.settings.caretPositionOnFocus === AutoNumeric.options.caretPositionOnFocus.decimalLeft) {\n if (this.settings.negativePositiveSignPlacement !== AutoNumeric.options.negativePositiveSignPlacement.none &&\n (isValueNegative || (!isValueNegative && this.settings.showPositiveSign && !isZeroOrHasNoValue))) {\n switch (this.settings.negativePositiveSignPlacement) {\n case AutoNumeric.options.negativePositiveSignPlacement.suffix: // 12|.34€+\n case AutoNumeric.options.negativePositiveSignPlacement.right: // 12|.34€+\n case AutoNumeric.options.negativePositiveSignPlacement.left: // 12|.34+€\n caretPosition = integerSize;\n break;\n case AutoNumeric.options.negativePositiveSignPlacement.prefix: // +12|.34€\n caretPosition = positiveNegativeSignSize + integerSize;\n break;\n }\n } else { // 12|.34€\n caretPosition = integerSize;\n }\n } else if (this.settings.caretPositionOnFocus === AutoNumeric.options.caretPositionOnFocus.decimalRight) {\n if (this.settings.negativePositiveSignPlacement !== AutoNumeric.options.negativePositiveSignPlacement.none &&\n (isValueNegative || (!isValueNegative && this.settings.showPositiveSign && !isZeroOrHasNoValue))) {\n switch (this.settings.negativePositiveSignPlacement) {\n case AutoNumeric.options.negativePositiveSignPlacement.suffix: // 12.|34€+\n case AutoNumeric.options.negativePositiveSignPlacement.right: // 12.|34€+\n case AutoNumeric.options.negativePositiveSignPlacement.left: // 12.|34+€\n caretPosition = integerSize + offsetDecimalChar;\n break;\n case AutoNumeric.options.negativePositiveSignPlacement.prefix: // +12.|34€\n caretPosition = positiveNegativeSignSize + integerSize + offsetDecimalChar;\n break;\n }\n } else { // 12.|34€\n caretPosition = integerSize + offsetDecimalChar;\n }\n }\n }\n\n return caretPosition;\n }\n\n /**\n * Truncate the trailing zeroes to the given number of decimal places\n *\n * @param {string} roundedInputValue\n * @param {int} decimalPlacesNeeded The number of decimal places to keep\n * @returns {string}\n */\n static _truncateZeros(roundedInputValue, decimalPlacesNeeded) {\n let regex;\n switch (decimalPlacesNeeded) {\n case 0:\n // Prevents padding - removes trailing zeros until the first significant digit is encountered\n regex = /(\\.(?:\\d*[1-9])?)0*$/;\n break;\n case 1:\n // Allows padding when decimalPlacesNeeded equals one - leaves one zero trailing the decimal character\n regex = /(\\.\\d(?:\\d*[1-9])?)0*$/;\n break;\n default :\n // Removes superfluous zeros after the decimalPlacesNeeded length\n regex = new RegExp(`(\\\\.\\\\d{${decimalPlacesNeeded}}(?:\\\\d*[1-9])?)0*`);\n }\n\n // If there are no decimal places, we don't need a decimal point at the end\n roundedInputValue = roundedInputValue.replace(regex, '$1');\n if (decimalPlacesNeeded === 0) {\n roundedInputValue = roundedInputValue.replace(/\\.$/, '');\n }\n\n return roundedInputValue;\n }\n\n /**\n * Round the given `value` with the number of decimal places to keep for the raw value.\n *\n * @param {string|null} value An unformatted numeric value\n * @param {object} settings\n * @returns {*}\n * @private\n */\n static _roundRawValue(value, settings) {\n return this._roundValue(value, settings, settings.decimalPlacesRawValue);\n }\n\n /**\n * Round the given `value` with the number of decimal places to show for the element is focused.\n *\n * @param {string|null} value An unformatted numeric value\n * @param {object} settings\n * @returns {*}\n * @private\n */\n static _roundFormattedValueShownOnFocus(value, settings) {\n return this._roundValue(value, settings, Number(settings.decimalPlacesShownOnFocus));\n }\n\n /**\n * Round the given `value` with the number of decimal places to show for the element is unfocused.\n *\n * @param {string|null} value An unformatted numeric value\n * @param {object} settings\n * @returns {*}\n * @private\n */\n static _roundFormattedValueShownOnBlur(value, settings) {\n return this._roundValue(value, settings, Number(settings.decimalPlacesShownOnBlur));\n }\n\n /**\n * Round the input value using the rounding method defined in the settings.\n * This function accepts multiple rounding methods. See the documentation for more details about those.\n *\n * Note : This is handled as text since JavaScript math functions can return inaccurate values.\n *\n * @param {string|null} inputValue An unformatted numeric value\n * @param {object} settings\n * @param {int} decimalPlacesToRoundTo\n * @returns {*}\n */\n static _roundValue(inputValue, settings, decimalPlacesToRoundTo) {\n //XXX Note; this function is static since we need to pass a `settings` object when calling the static `AutoNumeric.format()` method\n if (AutoNumericHelper.isNull(inputValue)) {\n // Prevent rounding a `null` value\n return inputValue;\n }\n\n //TODO Divide this function to make it easier to understand\n inputValue = (inputValue === '') ? '0' : inputValue.toString();\n if (settings.roundingMethod === AutoNumeric.options.roundingMethod.toNearest05 ||\n settings.roundingMethod === AutoNumeric.options.roundingMethod.toNearest05Alt ||\n settings.roundingMethod === AutoNumeric.options.roundingMethod.upToNext05 ||\n settings.roundingMethod === AutoNumeric.options.roundingMethod.downToNext05) {\n return this._roundCloseTo05(inputValue, settings);\n }\n\n const [negativeSign, preparedValue] = AutoNumeric._prepareValueForRounding(inputValue, settings);\n inputValue = preparedValue;\n\n const decimalCharacterPosition = inputValue.lastIndexOf('.');\n const inputValueHasNoDot = decimalCharacterPosition === -1; // No dot character is found in the `inputValue`\n const [, decimalPart] = inputValue.split('.'); // Here the decimal character is always a period '.'\n const hasDecimals = decimalPart > 0;\n\n // If no decimals are detected\n if (!hasDecimals &&\n (settings.allowDecimalPadding === AutoNumeric.options.allowDecimalPadding.never ||\n settings.allowDecimalPadding === AutoNumeric.options.allowDecimalPadding.floats)) {\n return (Number(inputValue) === 0) ? inputValue : `${negativeSign}${inputValue}`;\n }\n\n // Else there are some decimal places that may need to be rounded\n // Sets the truncate zero method\n let temporaryDecimalPlacesOverride;\n if (settings.allowDecimalPadding === AutoNumeric.options.allowDecimalPadding.always ||\n settings.allowDecimalPadding === AutoNumeric.options.allowDecimalPadding.floats) {\n temporaryDecimalPlacesOverride = decimalPlacesToRoundTo;\n } else {\n temporaryDecimalPlacesOverride = 0;\n }\n\n // Define the decimal position to use (use the very last position if there are no dot in the initial inputValue)\n const decimalPositionToUse = inputValueHasNoDot ? inputValue.length - 1 : decimalCharacterPosition;\n // Checks decimal places to determine if rounding is required\n let checkDecimalPlaces = (inputValue.length - 1) - decimalPositionToUse;\n let inputValueRounded = '';\n\n // Check if no rounding is required\n if (checkDecimalPlaces <= decimalPlacesToRoundTo) {\n // Check if we need to pad with zeros\n inputValueRounded = inputValue;\n if (checkDecimalPlaces < temporaryDecimalPlacesOverride) {\n if (inputValueHasNoDot) {\n inputValueRounded = `${inputValueRounded}${settings.decimalCharacter}`;\n }\n\n let zeros = '000000'; //TODO Change that string with a longer one to prevent having to loop numerous times in the next `while` statement?\n while (checkDecimalPlaces < temporaryDecimalPlacesOverride) {\n zeros = zeros.substring(0, temporaryDecimalPlacesOverride - checkDecimalPlaces);\n inputValueRounded += zeros;\n checkDecimalPlaces += zeros.length;\n }\n } else if (checkDecimalPlaces > temporaryDecimalPlacesOverride) {\n inputValueRounded = this._truncateZeros(inputValueRounded, temporaryDecimalPlacesOverride);\n } else if (checkDecimalPlaces === 0 && temporaryDecimalPlacesOverride === 0) {\n // Remove any trailing dot, if any\n inputValueRounded = inputValueRounded.replace(/\\.$/, '');\n }\n\n return (Number(inputValueRounded) === 0) ? inputValueRounded : `${negativeSign}${inputValueRounded}`;\n }\n\n // Rounded length of the string after rounding\n let roundedStrLength;\n if (inputValueHasNoDot) {\n roundedStrLength = decimalPlacesToRoundTo - 1;\n } else {\n roundedStrLength = Number(decimalPlacesToRoundTo) + Number(decimalCharacterPosition);\n }\n\n const lastDigit = Number(inputValue.charAt(roundedStrLength + 1));\n let inputValueArray = inputValue.substring(0, roundedStrLength + 1).split('');\n let odd;\n if (inputValue.charAt(roundedStrLength) === '.') {\n odd = inputValue.charAt(roundedStrLength - 1) % 2;\n } else {\n odd = inputValue.charAt(roundedStrLength) % 2;\n }\n\n if (this._shouldRoundUp(lastDigit, settings, negativeSign, odd)) {\n // Round up the last digit if required, and continue until no more 9's are found\n for (let i = (inputValueArray.length - 1); i >= 0; i -= 1) {\n if (inputValueArray[i] !== '.') {\n inputValueArray[i] = +inputValueArray[i] + 1;\n if (inputValueArray[i] < 10) {\n break;\n }\n\n if (i > 0) {\n inputValueArray[i] = '0';\n }\n }\n }\n }\n\n // Reconstruct the string, converting any 10's to 0's\n inputValueArray = inputValueArray.slice(0, roundedStrLength + 1);\n\n // Return the rounded value\n inputValueRounded = this._truncateZeros(inputValueArray.join(''), temporaryDecimalPlacesOverride);\n\n return (Number(inputValueRounded) === 0) ? inputValueRounded : `${negativeSign}${inputValueRounded}`;\n }\n\n /**\n * Round the `value` when the rounding method deals with '.05'\n *\n * @param {string} value\n * @param {object} settings\n * @returns {string}\n * @private\n */\n static _roundCloseTo05(value, settings) {\n switch (settings.roundingMethod) {\n case AutoNumeric.options.roundingMethod.toNearest05:\n case AutoNumeric.options.roundingMethod.toNearest05Alt:\n value = (Math.round(value * 20) / 20).toString();\n break;\n case AutoNumeric.options.roundingMethod.upToNext05:\n value = (Math.ceil(value * 20) / 20).toString();\n break;\n default :\n value = (Math.floor(value * 20) / 20).toString();\n }\n\n let result;\n if (!AutoNumericHelper.contains(value, '.')) {\n result = value + '.00';\n } else if (value.length - value.indexOf('.') < 3) {\n result = value + '0';\n } else {\n result = value;\n }\n\n return result;\n }\n\n /**\n * Modify the given `value` in order to make it usable for the rest of the rounding function.\n * This convert the `value` to a positive one, trim any leading zeros and make sure it does not starts with a leading dot.\n *\n * @param {string} value The unformatted value\n * @param {object} settings\n * @returns {[string, string]}\n * @private\n */\n static _prepareValueForRounding(value, settings) {\n // Checks if `inputValue` is a negative value\n let negativeSign = '';\n if (AutoNumericHelper.isNegativeStrict(value, '-')) { // The value being unformatted, we check for the minus sign\n negativeSign = '-';\n\n // Removes the negative sign that will be added back later if required\n value = value.replace('-', '');\n }\n\n // Append a zero if the first character is not a digit (then it is likely a dot)\n if (!value.match(/^\\d/)) {\n value = `0${value}`;\n }\n\n // Determines if the value is equal to zero. If it is, remove the negative sign\n if (Number(value) === 0) {\n negativeSign = '';\n }\n\n // Trims leading zero's as needed\n if ((Number(value) > 0 && settings.leadingZero !== AutoNumeric.options.leadingZero.keep) ||\n (value.length > 0 && settings.leadingZero === AutoNumeric.options.leadingZero.allow)) {\n value = value.replace(/^0*(\\d)/, '$1');\n }\n\n return [negativeSign, value];\n }\n\n /**\n * Return `true` if a round up should be done given the last digit, the settings and other information about the value.\n *\n * @param {number} lastDigit\n * @param {object} settings\n * @param {string} negativeSign This variable comes from `_prepareValueForRounding()`, which return `'-'` if the initial value was negative\n * @param {number} odd\n * @returns {boolean}\n * @private\n */\n static _shouldRoundUp(lastDigit, settings, negativeSign, odd) {\n return (lastDigit > 4 && settings.roundingMethod === AutoNumeric.options.roundingMethod.halfUpSymmetric) || // Round half up symmetric\n (lastDigit > 4 && settings.roundingMethod === AutoNumeric.options.roundingMethod.halfUpAsymmetric && negativeSign === '') || // Round half up asymmetric positive values\n (lastDigit > 5 && settings.roundingMethod === AutoNumeric.options.roundingMethod.halfUpAsymmetric && negativeSign === '-') || // Round half up asymmetric negative values\n (lastDigit > 5 && settings.roundingMethod === AutoNumeric.options.roundingMethod.halfDownSymmetric) || // Round half down symmetric\n (lastDigit > 5 && settings.roundingMethod === AutoNumeric.options.roundingMethod.halfDownAsymmetric && negativeSign === '') || // Round half down asymmetric positive values\n (lastDigit > 4 && settings.roundingMethod === AutoNumeric.options.roundingMethod.halfDownAsymmetric && negativeSign === '-') || // Round half down asymmetric negative values\n (lastDigit > 5 && settings.roundingMethod === AutoNumeric.options.roundingMethod.halfEvenBankersRounding) ||\n (lastDigit === 5 && settings.roundingMethod === AutoNumeric.options.roundingMethod.halfEvenBankersRounding && odd === 1) ||\n (lastDigit > 0 && settings.roundingMethod === AutoNumeric.options.roundingMethod.toCeilingTowardPositiveInfinity && negativeSign === '') ||\n (lastDigit > 0 && settings.roundingMethod === AutoNumeric.options.roundingMethod.toFloorTowardNegativeInfinity && negativeSign === '-') ||\n (lastDigit > 0 && settings.roundingMethod === AutoNumeric.options.roundingMethod.upRoundAwayFromZero); // Round up away from zero\n }\n\n /**\n * Truncates the decimal part of a number to the given number of decimal places `decimalPlacesToRoundTo`.\n *\n * @param {string} value\n * @param {object} settings\n * @param {boolean} isPaste\n * @param {int} decimalPlacesToRoundTo\n * @returns {*}\n */\n static _truncateDecimalPlaces(value, settings, isPaste, decimalPlacesToRoundTo) {\n if (isPaste) {\n value = this._roundFormattedValueShownOnFocus(value, settings);\n }\n\n const [integerPart, decimalPart] = value.split(settings.decimalCharacter);\n\n // Truncate the decimal part to the satisfying length since we would round it anyway\n if (decimalPart && decimalPart.length > decimalPlacesToRoundTo) {\n if (decimalPlacesToRoundTo > 0) {\n const modifiedDecimalPart = decimalPart.substring(0, decimalPlacesToRoundTo);\n value = `${integerPart}${settings.decimalCharacter}${modifiedDecimalPart}`;\n } else {\n value = integerPart;\n }\n }\n\n return value;\n }\n\n /**\n * Check that the number satisfy the format conditions\n * and lays between settings.minimumValue and settings.maximumValue\n * and the string length does not exceed the digits in settings.minimumValue and settings.maximumValue\n *\n * @param {string} value\n * @param {object} settings\n * @returns {*}\n */\n static _checkIfInRangeWithOverrideOption(value, settings) {\n if (AutoNumericHelper.isNull(value) && settings.emptyInputBehavior === AutoNumeric.options.emptyInputBehavior.null) {\n // When the `null` value is accepted as the `rawValue`, the limits are ignored\n return [true, true];\n }\n\n value = value.toString();\n value = value.replace(',', '.');\n const minParse = AutoNumericHelper.parseStr(settings.minimumValue);\n const maxParse = AutoNumericHelper.parseStr(settings.maximumValue);\n const valParse = AutoNumericHelper.parseStr(value);\n\n let result;\n switch (settings.overrideMinMaxLimits) {\n case AutoNumeric.options.overrideMinMaxLimits.floor:\n result = [AutoNumericHelper.testMinMax(minParse, valParse) > -1, true];\n break;\n case AutoNumeric.options.overrideMinMaxLimits.ceiling:\n result = [true, AutoNumericHelper.testMinMax(maxParse, valParse) < 1];\n break;\n case AutoNumeric.options.overrideMinMaxLimits.ignore:\n result = [true, true];\n break;\n default:\n result = [AutoNumericHelper.testMinMax(minParse, valParse) > -1, AutoNumericHelper.testMinMax(maxParse, valParse) < 1];\n }\n\n return result;\n }\n\n /**\n * Original settings saved for use when the `decimalPlacesShownOnFocus` and `showOnlyNumbersOnFocus` options are used.\n * Those original settings are used exclusively in the `focusin` and `focusout` event handlers.\n */\n _keepAnOriginalSettingsCopy() {\n this.originalDigitGroupSeparator = this.settings.digitGroupSeparator;\n this.originalCurrencySymbol = this.settings.currencySymbol;\n this.originalSuffixText = this.settings.suffixText;\n }\n\n /**\n * Original settings saved for use when `decimalPlacesShownOnFocus` & `showOnlyNumbersOnFocus` options are being used.\n * This is taken from Quirksmode.\n *\n * @param {string} name\n * @returns {*}\n */\n static _readCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n let c = '';\n for (let i = 0; i < ca.length; i += 1) {\n c = ca[i];\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length);\n }\n if (c.indexOf(nameEQ) === 0) {\n return c.substring(nameEQ.length, c.length);\n }\n }\n\n return null;\n }\n\n /**\n * Test if sessionStorage is supported.\n * This is taken from Modernizr.\n *\n * @returns {boolean}\n */\n static _storageTest() {\n const mod = 'modernizr';\n try {\n sessionStorage.setItem(mod, mod);\n sessionStorage.removeItem(mod);\n return true;\n } catch (e) {\n return false;\n }\n }\n\n /**\n * Removes any zeros in excess in the front and back of the given `value`, according to the `settings`.\n * This also manages the cases where the decimal point is on the far left or far right of the `value`.\n *\n * @param {string} value\n * @returns {string|null}\n */\n _trimLeadingAndTrailingZeros(value) {\n // Return the empty string is the value is already empty. This prevent converting that value to '0'.\n if (value === '' || value === null) {\n return value;\n }\n\n if (this.settings.leadingZero !== AutoNumeric.options.leadingZero.keep) {\n if (Number(value) === 0) {\n // Return '0' if the value is zero\n return '0';\n }\n\n // Trim the leading zeros, while leaving one zero to the left of the decimal point if needed\n value = value.replace(/^(-)?0+(?=\\d)/g,'$1');\n }\n\n //TODO remove this from that function and use `trimPaddedZerosFromDecimalPlaces()` instead\n // Trim the trailing zeros after the last decimal place not being a zero (ie. 1.2300 -> 1.23)\n if (AutoNumericHelper.contains(value, '.')) {\n value = value.replace(/(\\.[0-9]*?)0+$/, '$1');\n }\n\n // Remove any trailing decimal point\n value = value.replace(/\\.$/, '');\n\n return value;\n }\n\n /**\n * Generate the name for the persistent stored data variable\n * @private\n */\n _setPersistentStorageName() {\n if (this.settings.saveValueToSessionStorage) {\n if (this.domElement.name !== '' && !AutoNumericHelper.isUndefined(this.domElement.name)) {\n this.rawValueStorageName = `${this.storageNamePrefix}${decodeURIComponent(this.domElement.name)}`;\n } else {\n this.rawValueStorageName = `${this.storageNamePrefix}${this.domElement.id}`;\n }\n }\n }\n\n /**\n * Save the raw Value into sessionStorage or a cookie depending on what the browser is supporting.\n * @private\n */\n _saveValueToPersistentStorage() {\n if (this.settings.saveValueToSessionStorage) {\n if (this.sessionStorageAvailable) {\n sessionStorage.setItem(this.rawValueStorageName, this.rawValue);\n } else {\n // Use cookies for obsolete browsers that do not support sessionStorage (ie. IE 6 & 7)\n document.cookie = `${this.rawValueStorageName}=${this.rawValue}; expires= ; path=/`;\n }\n }\n }\n\n /**\n * Retrieve the raw value from sessionStorage or the cookie depending on what the browser is supporting.\n *\n * @returns {*}\n * @private\n */\n _getValueFromPersistentStorage() {\n if (this.settings.saveValueToSessionStorage) {\n let result;\n if (this.sessionStorageAvailable) {\n result = sessionStorage.getItem(this.rawValueStorageName);\n } else {\n result = this._readCookie(this.rawValueStorageName);\n }\n\n return result;\n }\n\n AutoNumericHelper.warning('`_getValueFromPersistentStorage()` is called but `settings.saveValueToSessionStorage` is false. There must be an error that needs fixing.', this.settings.showWarnings);\n\n return null;\n }\n\n /**\n * Remove the raw value data from sessionStorage or the cookie depending on what the browser is supporting.\n * @private\n */\n _removeValueFromPersistentStorage() {\n if (this.settings.saveValueToSessionStorage) {\n if (this.sessionStorageAvailable) {\n sessionStorage.removeItem(this.rawValueStorageName);\n } else {\n const date = new Date();\n date.setTime(date.getTime() - 86400000); // -86400000 === -1 * 24 * 60 * 60 * 1000\n const expires = `; expires=${date.toUTCString()}`;\n document.cookie = `${this.rawValueStorageName}='' ;${expires}; path=/`;\n }\n }\n }\n\n /**\n * Handler for 'focusin' and 'mouseenter' events\n * On focusin, multiple things happens :\n * - If `Alt` is pressed, unformat\n * - Remove the separators if `showOnlyNumbersOnFocus` is set\n * - Depending on `emptyInputBehavior`, reformat the empty formatted value\n * - Display the correct number of decimal places (on focus/blur)\n * - Place the caret correctly if the element is empty\n *\n * Note: On focusin, the `rawValue` is never changed. Only the formatted value can be modified.\n *\n * @param {Event} e\n * @private\n */\n _onFocusInAndMouseEnter(e) {\n this.isEditing = false; // Just in case no `keyUp` event have been sent (ie. if the user lost the focus from the current window while typing)\n //TODO Create separate handlers for the focus and mouseenter events\n\n if (this.settings.unformatOnHover && e.type === 'mouseenter' && e.altKey) {\n this.constructor._unformatAltHovered(this);\n\n return;\n }\n\n if (e.type === 'focus') { //TODO Move that back to the 'focus' event handler when the separation between the 'focus' and 'mouseenter' handler will be done\n // Keep track if the element is currently focused\n this.isFocused = true;\n }\n\n if (e.type === 'focus' && this.settings.unformatOnHover && this.hoveredWithAlt) {\n this.constructor._reformatAltHovered(this);\n }\n\n if (e.type === 'focus' || e.type === 'mouseenter' && !this.isFocused) {\n let elementValueToSet = null; // Store the value we want to set on the element, and only call `_setElementValue()` once\n\n if (this.settings.emptyInputBehavior === AutoNumeric.options.emptyInputBehavior.focus &&\n this.rawValue < 0 && this.settings.negativeBracketsTypeOnBlur !== null && this.settings.isNegativeSignAllowed) { //FIXME this is called a second time in _addGroupSeparators too. Prevent this, if possible.\n // Only remove the brackets if the value is negative\n elementValueToSet = this.constructor._removeBrackets(AutoNumericHelper.getElementValue(this.domElement), this.settings);\n //FIXME The element value is set here, why continue and set it again later in that same parent logic block?\n }\n\n // Use the `rawValue`, multiplied by `rawValueDivisor` if defined\n const rawValueToFormat = this._getRawValueToFormat(this.rawValue);\n\n // Modify the element value according to the number of decimal places to show on focus or the `showOnlyNumbersOnFocus` option\n if (rawValueToFormat !== '') {\n // Round the given value according to the object state (focus/unfocused)\n let roundedValue;\n if (this.isFocused) {\n roundedValue = this.constructor._roundFormattedValueShownOnFocus(rawValueToFormat, this.settings);\n } else {\n roundedValue = this.constructor._roundFormattedValueShownOnBlur(rawValueToFormat, this.settings);\n }\n\n if (this.settings.showOnlyNumbersOnFocus === AutoNumeric.options.showOnlyNumbersOnFocus.onlyNumbers) {\n //TODO Use a `this.settingsOverride` object instead of modifying the `this.settings` object\n this.settings.digitGroupSeparator = '';\n this.settings.currencySymbol = '';\n this.settings.suffixText = '';\n elementValueToSet = roundedValue.replace('.', this.settings.decimalCharacter);\n } else {\n let formattedValue;\n if (AutoNumericHelper.isNull(roundedValue)) {\n formattedValue = '';\n } else {\n formattedValue = this.constructor._addGroupSeparators(roundedValue.replace('.', this.settings.decimalCharacter), this.settings, this.isFocused, rawValueToFormat);\n }\n\n elementValueToSet = formattedValue;\n }\n }\n\n // In order to send a 'native' change event when blurring the input, we need to first store the initial input value on focus.\n if (AutoNumericHelper.isNull(elementValueToSet)) {\n this.valueOnFocus = '';\n } else {\n this.valueOnFocus = elementValueToSet;\n }\n\n this.lastVal = this.valueOnFocus;\n const isEmptyValue = this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(this.valueOnFocus, this.settings);\n const orderedValue = this.constructor._orderValueCurrencySymbolAndSuffixText(this.valueOnFocus, this.settings, true); // This displays the currency sign on hover even if the rawValue is empty\n const orderedValueTest = (isEmptyValue && orderedValue !== '') && this.settings.emptyInputBehavior === AutoNumeric.options.emptyInputBehavior.focus;\n if (orderedValueTest) {\n elementValueToSet = orderedValue;\n }\n\n if (!AutoNumericHelper.isNull(elementValueToSet)) {\n this._setElementValue(elementValueToSet);\n }\n\n if (orderedValueTest && orderedValue === this.settings.currencySymbol && this.settings.currencySymbolPlacement === AutoNumeric.options.currencySymbolPlacement.suffix) {\n // If there is a currency symbol and its on the right hand side, then we place the caret accordingly on the far left side\n AutoNumericHelper.setElementSelection(e.target, 0);\n }\n }\n }\n\n /**\n * Handler for the 'focus' event.\n * We update the info of the focused state in the `this.isFocused` variable when the element gets focused.\n * @private\n */\n _onFocus() {\n if (this.settings.isCancellable) {\n // Save the current unformatted value for later use by the 'cancellable' feature\n this._saveCancellableValue();\n }\n }\n\n /**\n * Handler for the 'focusin' event.\n * This is called before the 'focus' event, and is necessary to change the selection on focus under Firefox for instance.\n *\n * @param {Event} e\n * @private\n */\n _onFocusIn(e) {\n if (this.settings.selectOnFocus) {\n // The whole input content is selected on focus (following the `selectOnFocus` and `selectNumberOnly` options)\n //XXX Firefox <47 does not respect this selection...Oh well.\n this.select();\n } else {\n // Or we decide where to put the caret using the `caretPositionOnFocus` option\n if (!AutoNumericHelper.isNull(this.settings.caretPositionOnFocus)) {\n AutoNumericHelper.setElementSelection(e.target, this._initialCaretPosition(AutoNumericHelper.getElementValue(this.domElement)));\n }\n }\n }\n\n /**\n * Handler for 'keydown' events.\n * The user just started pushing any key, hence one event is sent.\n *\n * Note :\n * By default a 'normal' input output those events in the right order when inputting a character key (ie. 'a') :\n * - keydown\n * - keypress\n * - input\n * - keyup\n *\n * ...when inputting a modifier key (ie. 'ctrl') :\n * - keydown\n * - keyup\n *\n * If 'delete' or 'backspace' is entered, the following events are sent :\n * - keydown\n * - input\n * - keyup\n *\n * If 'enter' is entered and the value has not changed, the following events are sent :\n * - keydown\n * - keypress\n * - keyup\n *\n * If 'enter' is entered and the value has been changed, the following events are sent :\n * - keydown\n * - keypress\n * - change\n * - keyup\n *\n * When a paste is done, the following events are sent :\n * - input (if paste is done with the mouse)\n *\n * - keydown (if paste is done with ctrl+v)\n * - keydown\n * - input\n * - keyup\n * - keyup\n *\n * @param {KeyboardEvent} e\n */\n _onKeydown(e) {\n this.formatted = false; // Keep track if the element has been formatted already. If that's the case, prevent further format calculations.\n this.isEditing = true; // Keep track if the user is currently editing the element manually\n\n if (!this.isFocused && this.settings.unformatOnHover && e.altKey && this.domElement === AutoNumericHelper.getHoveredElement()) {\n // Here I prevent calling _unformatAltHovered if the element is already focused, since the global 'keydown' listener will pick it up as well\n this.constructor._unformatAltHovered(this);\n\n return;\n }\n\n this._updateEventKeyInfo(e);\n this.initialValueOnKeydown = AutoNumericHelper.getElementValue(e.target); // This is needed in `onKeyup()` to check if the value as changed during the key press\n this.initialRawValueOnKeydown = this.rawValue;\n\n if (this.domElement.readOnly) {\n this.processed = true;\n\n return;\n }\n\n if (this.eventKey === AutoNumericEnum.keyName.Esc) {\n //XXX The default 'Escape' key behavior differs between Firefox and Chrome, Firefox already having a built-in 'cancellable-like' feature. This is why we call `e.preventDefault()` here instead of just when `isCancellable` is set to `true`. This allow us to keep the same behavior across browsers.\n e.preventDefault();\n\n if (this.settings.isCancellable) {\n // If the user wants to cancel his modifications:\n // We set back the saved value\n if (this.rawValue !== this.savedCancellableValue) {\n // Do not set the value again if it has not changed\n this.set(this.savedCancellableValue);\n // And we need to send an 'input' event when setting back the initial value in order to make other scripts aware of the value change...\n this._triggerEvent(AutoNumeric.events.native.input, e.target);\n }\n }\n\n // ..and lastly we update the caret selection, even if the option `isCancellable` is false\n this.select();\n //TODO Add an option to select either the integer or decimal part with `Esc`\n }\n\n // The \"enter\" key throws a `change` event if the value has changed since the `focus` event\n let targetValue = AutoNumericHelper.getElementValue(e.target);\n if (this.eventKey === AutoNumericEnum.keyName.Enter && this.valueOnFocus !== targetValue) {\n this._triggerEvent(AutoNumeric.events.native.change, e.target);\n this.valueOnFocus = targetValue;\n\n if (this.settings.isCancellable) {\n // If the user activated the 'cancellable' feature, we save the validated value when 'Enter' is hit\n this._saveCancellableValue();\n }\n }\n\n this._updateInternalProperties(e);\n\n if (this._processNonPrintableKeysAndShortcuts(e)) {\n this.processed = true;\n\n return;\n }\n\n // Check if the key is a delete/backspace key\n if (this.eventKey === AutoNumericEnum.keyName.Backspace || this.eventKey === AutoNumericEnum.keyName.Delete) {\n this._processCharacterDeletion(); // Because backspace and delete only triggers keydown and keyup events, not keypress\n this.processed = true;\n this._formatValue(e);\n\n // If and only if the resulting value has changed after that backspace/delete, then we have to send an 'input' event like browsers normally do.\n targetValue = AutoNumericHelper.getElementValue(e.target); // Update the value since it could have been changed during the deletion\n if ((targetValue !== this.lastVal) && this.throwInput) {\n // Throw an input event when a character deletion is detected\n this._triggerEvent(AutoNumeric.events.native.input, e.target);\n e.preventDefault(); // ...and immediately prevent the browser to delete a second character\n }\n\n this.lastVal = targetValue;\n this.throwInput = true;\n }\n }\n\n /**\n * Handler for 'keypress' events.\n * The user is still pressing the key, which will output a character (ie. '2') continuously until it releases the key.\n * Note: 'keypress' events are not sent for delete keys like Backspace/Delete.\n *\n * @param {KeyboardEvent} e\n */\n _onKeypress(e) {\n if (this.eventKey === AutoNumericEnum.keyName.Insert) {\n return;\n }\n\n const processed = this.processed;\n this._updateInternalProperties(e);\n\n if (this._processNonPrintableKeysAndShortcuts(e)) {\n return;\n }\n\n if (processed) {\n e.preventDefault();\n\n return;\n }\n\n const isCharacterInsertionAllowed = this._processCharacterInsertion();\n if (isCharacterInsertionAllowed) {\n this._formatValue(e);\n const targetValue = AutoNumericHelper.getElementValue(e.target);\n if ((targetValue !== this.lastVal) && this.throwInput) {\n // Throws input event on adding a character\n this._triggerEvent(AutoNumeric.events.native.input, e.target);\n e.preventDefault(); // ...and immediately prevent the browser to add a second character\n } else {\n if ((this.eventKey === this.settings.decimalCharacter || this.eventKey === this.settings.decimalCharacterAlternative) &&\n (AutoNumericHelper.getElementSelection(e.target).start === AutoNumericHelper.getElementSelection(e.target).end) &&\n AutoNumericHelper.getElementSelection(e.target).start === targetValue.indexOf(this.settings.decimalCharacter)) {\n const position = AutoNumericHelper.getElementSelection(e.target).start + 1;\n AutoNumericHelper.setElementSelection(e.target, position);\n }\n\n e.preventDefault();\n }\n\n this.lastVal = AutoNumericHelper.getElementValue(e.target);\n this.throwInput = true;\n\n return;\n }\n\n e.preventDefault();\n }\n\n /**\n * Handler for 'keyup' events.\n * The user just released any key, hence one event is sent.\n *\n * @param {KeyboardEvent} e\n */\n _onKeyup(e) {\n this.isEditing = false;\n\n if (this.settings.isCancellable && this.eventKey === AutoNumericEnum.keyName.Esc) {\n // If the user wants to cancel its modifications, we drop the 'keyup' event for the Esc key\n e.preventDefault();\n\n return;\n }\n\n // Manage the undo/redo events\n if (this.eventKey === AutoNumericEnum.keyName.Z || this.eventKey === AutoNumericEnum.keyName.z) {\n if (e.ctrlKey && e.shiftKey) {\n // Redo\n e.preventDefault();\n this._historyTableRedo();\n this.onGoingRedo = true;\n\n return;\n } else if (e.ctrlKey && !e.shiftKey) {\n if (this.onGoingRedo) {\n // Prevent an 'undo' to be launch when releasing the shift key before the ctrl key after a 'redo' shortcut\n this.onGoingRedo = false;\n } else {\n e.preventDefault();\n // Undo\n this._historyTableUndo();\n\n return;\n }\n }\n }\n\n if (this.onGoingRedo && (e.ctrlKey || e.shiftKey)) {\n // Special case where if the user has entered `Control+Shift+z`, then release `z`, keeping `Control` or `Shift` pressed, then `this.onGoingRedo` is never changed back to `false` when the user release `Control` or `Shift`\n this.onGoingRedo = false;\n }\n\n // Manage the Cut event\n if ((e.ctrlKey || e.metaKey) && this.eventKey === AutoNumericEnum.keyName.x) {\n // Save the caret position at the start of the selection\n const caretPosition = AutoNumericHelper.getElementSelection(this.domElement).start;\n // Convert the remaining 'formatted' numbers in a Js number\n const cutNumber = this.constructor._toNumericValue(AutoNumericHelper.getElementValue(e.target), this.settings);\n // Try to set that value with `set()`\n this.set(cutNumber);\n // Set back the initial caret position\n this._setCaretPosition(caretPosition);\n }\n\n // Manage the reformat when hovered with the Alt key pressed\n if (this.eventKey === AutoNumericEnum.keyName.Alt && this.hoveredWithAlt) {\n this.constructor._reformatAltHovered(this);\n\n return;\n }\n\n this._updateInternalProperties(e);\n\n const skip = this._processNonPrintableKeysAndShortcuts(e);\n delete this.valuePartsBeforePaste;\n const targetValue = AutoNumericHelper.getElementValue(e.target);\n if (skip || targetValue === '') {\n return;\n }\n\n // Added to properly place the caret when only the currency sign is present\n if (targetValue === this.settings.currencySymbol) {\n if (this.settings.currencySymbolPlacement === AutoNumeric.options.currencySymbolPlacement.suffix) {\n AutoNumericHelper.setElementSelection(e.target, 0);\n } else {\n AutoNumericHelper.setElementSelection(e.target, this.settings.currencySymbol.length);\n }\n } else if (this.eventKey === AutoNumericEnum.keyName.Tab) {\n AutoNumericHelper.setElementSelection(e.target, 0, targetValue.length);\n }\n\n if ((targetValue === this.settings.suffixText) ||\n (this.rawValue === '' && this.settings.currencySymbol !== '' && this.settings.suffixText !== '')) {\n AutoNumericHelper.setElementSelection(e.target, 0);\n }\n\n // Saves the extended decimal to preserve the data when navigating away from the page\n if (this.settings.decimalPlacesShownOnFocus !== null) {\n this._saveValueToPersistentStorage();\n }\n\n if (!this.formatted) { //TODO Is this line needed? Considering that onKeydown and onKeypress both finish by setting it to false...\n this._formatValue(e);\n }\n\n // Force the `rawValue` update on Android Chrome\n this._saveRawValueForAndroid();\n\n // If the input value has changed during the key press event chain, an event is sent to alert that a formatting has been done (cf. Issue #187)\n if (targetValue !== this.initialValueOnKeydown) {\n this._triggerEvent(AutoNumeric.events.formatted, e.target, {\n oldValue : this.initialValueOnKeydown,\n newValue : targetValue,\n oldRawValue: this.initialRawValueOnKeydown,\n newRawValue: this.rawValue,\n isPristine : this.isPristine(false),\n error : null,\n aNElement : this,\n });\n }\n\n // Update the selection of the current element of the history table\n if (this.historyTable.length > 1) {\n const selection = AutoNumericHelper.getElementSelection(this.domElement);\n this.selectionStart = selection.start;\n this.selectionEnd = selection.end;\n this.historyTable[this.historyTableIndex].start = this.selectionStart;\n this.historyTable[this.historyTableIndex].end = this.selectionEnd;\n }\n }\n\n /**\n * On Android Chrome, the `rawValue` is not updated when the user changes the input value.\n * This function updates the `rawValue` accordingly.\n * @private\n */\n _saveRawValueForAndroid() {\n if (this.eventKey === AutoNumericEnum.keyName.AndroidDefault) {\n let normalizedValue = this.constructor._stripAllNonNumberCharactersExceptCustomDecimalChar(this.getFormatted(), this.settings, true, this.isFocused);\n normalizedValue = this.constructor._convertToNumericString(normalizedValue, this.settings);\n\n this._setRawValue(normalizedValue);\n }\n }\n\n /**\n * Handler for 'focusout' events\n * On focusout, multiple things happens :\n * - The element value is formatted back if the `Alt` key was pressed,\n * - The element value is formatted back if `showOnlyNumbersOnFocus` was set to only show numbers,\n * - The element value is multiplied by `rawValueDivisor` on `blur`\n *\n * Note: On focusout, the `rawValue` is never changed. Only the formatted value can be modified.\n *\n * @param {Event} e\n */\n _onFocusOutAndMouseLeave(e) {\n this.isEditing = false; // Just in case no `keyUp` event have been sent (if the user lost the focus to the window while typing)\n\n //TODO Create separate handlers for blur and mouseleave\n //FIXME Do not call `set()` if the current raw value is the same as the one we are trying to set (currently, on focus out, `set()` is always called, even if the value has not changed\n if (this.settings.unformatOnHover && e.type === 'mouseleave' && this.hoveredWithAlt) {\n this.constructor._reformatAltHovered(this);\n\n return;\n }\n\n if ((e.type === 'mouseleave' && !this.isFocused) || e.type === 'blur') {\n this._saveValueToPersistentStorage();\n if (this.settings.showOnlyNumbersOnFocus === AutoNumeric.options.showOnlyNumbersOnFocus.onlyNumbers) {\n this.settings.digitGroupSeparator = this.originalDigitGroupSeparator;\n this.settings.currencySymbol = this.originalCurrencySymbol;\n this.settings.suffixText = this.originalSuffixText;\n }\n\n // Use the rawValue, multiplied by `rawValueDivisor` if defined\n const rawValueToFormat = this._getRawValueToFormat(this.rawValue);\n const isRawValueNull = AutoNumericHelper.isNull(rawValueToFormat);\n const [minTest, maxTest] = this.constructor._checkIfInRangeWithOverrideOption(rawValueToFormat, this.settings);\n\n // Directly set the formatted value if the `rawValue` is found in `valuesToStrings`\n let elementValueIsAlreadySet = false;\n if (rawValueToFormat !== '' && !isRawValueNull) {\n if (!minTest) {\n this._triggerEvent(AutoNumeric.events.minRangeExceeded, this.domElement);\n }\n\n if (!maxTest) {\n this._triggerEvent(AutoNumeric.events.maxRangeExceeded, this.domElement);\n }\n\n if (this.settings.valuesToStrings && this._checkValuesToStrings(rawValueToFormat)) {\n // Set the formatted value with the corresponding string\n this._setElementValue(this.settings.valuesToStrings[rawValueToFormat]);\n elementValueIsAlreadySet = true;\n }\n }\n\n // Only generate the formatted value if no `valuesToStrings` have been found\n if (!elementValueIsAlreadySet) {\n let value;\n if (isRawValueNull || rawValueToFormat === '') {\n value = rawValueToFormat;\n } else {\n value = String(rawValueToFormat);\n }\n\n if (rawValueToFormat !== '' && !isRawValueNull) {\n if (minTest && maxTest && !this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(rawValueToFormat, this.settings)) {\n value = this._modifyNegativeSignAndDecimalCharacterForRawValue(value);\n\n if (this.settings.divisorWhenUnfocused && !AutoNumericHelper.isNull(value)) {\n value = value / this.settings.divisorWhenUnfocused;\n value = value.toString();\n }\n\n value = this.constructor._roundFormattedValueShownOnBlur(value, this.settings);\n value = this.constructor._modifyNegativeSignAndDecimalCharacterForFormattedValue(value, this.settings);\n } else {\n if (!minTest) {\n this._triggerEvent(AutoNumeric.events.minRangeExceeded, this.domElement);\n }\n\n if (!maxTest) {\n this._triggerEvent(AutoNumeric.events.maxRangeExceeded, this.domElement);\n }\n }\n } else if (rawValueToFormat === '' && this.settings.emptyInputBehavior === AutoNumeric.options.emptyInputBehavior.zero) {\n this._setRawValue('0');\n value = this.constructor._roundValue('0', this.settings, 0);\n }\n\n\n let groupedValue = this.constructor._orderValueCurrencySymbolAndSuffixText(value, this.settings, false);\n if (!(this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(value, this.settings) ||\n (isRawValueNull && this.settings.emptyInputBehavior === AutoNumeric.options.emptyInputBehavior.null))) {\n groupedValue = this.constructor._addGroupSeparators(value, this.settings, false, rawValueToFormat);\n }\n\n // Testing for `allowDecimalPadding.never` or `allowDecimalPadding.floats` is needed to make sure we do not keep a trailing decimalCharacter (like '500.') in the element, since the raw value would still be a correctly formatted integer ('500')\n if (groupedValue !== rawValueToFormat ||\n rawValueToFormat === '' || // This make sure we get rid on any currency symbol or suffix that might have been added on focus\n this.settings.allowDecimalPadding === AutoNumeric.options.allowDecimalPadding.never ||\n this.settings.allowDecimalPadding === AutoNumeric.options.allowDecimalPadding.floats) {\n if (this.settings.symbolWhenUnfocused && rawValueToFormat !== '' && rawValueToFormat !== null) {\n groupedValue = `${groupedValue}${this.settings.symbolWhenUnfocused}`;\n }\n\n this._setElementValue(groupedValue);\n }\n\n if (groupedValue !== this.valueOnFocus) {\n this._triggerEvent(AutoNumeric.events.native.change, this.domElement);\n delete this.valueOnFocus;\n }\n }\n\n this._onBlur(e);\n }\n }\n\n /**\n * Handler for 'paste' event\n *\n * @param {Event|ClipboardEvent} e\n */\n _onPaste(e) {\n //FIXME When pasting '000' on a thousand group selection, the whole selection gets deleted, and only one '0' is pasted (cf. issue #302)\n // The event is prevented by default, since otherwise the user would be able to paste invalid characters into the input\n e.preventDefault();\n\n if (this.settings.readOnly || this.domElement.readOnly || this.domElement.disabled) {\n // Do not allow pasting in a readonly element (fix issue #505)\n return;\n }\n\n let rawPastedText;\n if (window.clipboardData && window.clipboardData.getData) {\n // Special case for the obsolete and non-standard IE browsers 10 and 11\n rawPastedText = window.clipboardData.getData('Text');\n } else if (e.clipboardData && e.clipboardData.getData) {\n // Normal case with modern browsers\n rawPastedText = e.clipboardData.getData('text/plain');\n } else {\n AutoNumericHelper.throwError('Unable to retrieve the pasted value. Please use a modern browser (ie. Firefox or Chromium).');\n }\n\n // Fix for firefox paste handling on `contenteditable` elements where `e.target` is the the text node, not the element\n let eventTarget;\n if (!e.target.tagName) {\n eventTarget = e.explicitOriginalTarget;\n } else {\n eventTarget = e.target;\n }\n\n // 0. Special case if the user has selected all the input text before pasting\n const initialFormattedValue = AutoNumericHelper.getElementValue(eventTarget);\n const selectionStart = eventTarget.selectionStart || 0;\n const selectionEnd = eventTarget.selectionEnd || 0;\n const selectionSize = selectionEnd - selectionStart;\n\n if (selectionSize === initialFormattedValue.length) { // If all the element text is selected\n //TODO Refactor this with the tests below\n // Since the whole element content will be replaced, no need to complicate things and directly test for the validity of the pasted content, then set the `rawValue` and caret position (fix issue #482)\n // 1. Strip all thousand separators, brackets and currency sign, and convert the decimal character to a dot\n const untranslatedPastedText = this._preparePastedText(rawPastedText);\n const pastedRawValue = AutoNumericHelper.arabicToLatinNumbers(untranslatedPastedText, false, false, false); // Allow pasting arabic numbers\n\n // 2. Check that the paste is a valid number once it has been normalized to a raw value\n if (pastedRawValue === '.' || pastedRawValue === '' || (pastedRawValue !== '.' && !AutoNumericHelper.isNumber(pastedRawValue))) {\n this.formatted = true; // This prevent the `keyup` event on the `v` key during a paste to try to format an empty value.\n // If the user tries to paste a single decimal character (that has been translated to '.' already) or the empty value, ignore the paste\n if (this.settings.onInvalidPaste === AutoNumeric.options.onInvalidPaste.error) {\n AutoNumericHelper.throwError(`The pasted value '${rawPastedText}' is not a valid paste content.`);\n }\n\n return;\n }\n\n // 3. Then try to set it as the new value. The `set()` method will run the additional tests (ie. limits) as needed.\n this.set(pastedRawValue);\n this.formatted = true;\n\n // 4. Return since the job is done\n return;\n }\n\n // 1. Check if the paste has a negative sign (only if it's the first character), and store that information for later use\n const isPasteNegative = AutoNumericHelper.isNegativeStrict(rawPastedText, this.settings.negativeSignCharacter);\n if (isPasteNegative) {\n // 1a. Remove the negative sign from the pasted text\n rawPastedText = rawPastedText.slice(1, rawPastedText.length);\n }\n\n // 2. Strip all thousand separators, brackets and currency sign, and convert the decimal character to a dot\n const untranslatedPastedText = this._preparePastedText(rawPastedText);\n\n let pastedText;\n if (untranslatedPastedText === '.') {\n // Special case : If the user tries to paste a single decimal character (that has been translated to '.' already)\n pastedText = '.';\n } else {\n // Normal case\n // Allow pasting arabic numbers\n pastedText = AutoNumericHelper.arabicToLatinNumbers(untranslatedPastedText, false, false, false);\n }\n\n // 3. Test if the paste is valid (only has numbers and eventually a decimal character). If it's not valid, stop here.\n if (pastedText !== '.' && (!AutoNumericHelper.isNumber(pastedText) || pastedText === '')) {\n this.formatted = true; // This prevent the `keyup` event on the `v` key during a paste to try to format an empty value (fix issue #484)\n if (this.settings.onInvalidPaste === AutoNumeric.options.onInvalidPaste.error) {\n AutoNumericHelper.throwError(`The pasted value '${rawPastedText}' is not a valid paste content.`);\n }\n\n return;\n }\n\n // 4. Calculate the paste result\n let caretPositionOnInitialTextAfterPasting;\n let isInitialValueNegative = AutoNumericHelper.isNegativeStrict(this.getNumericString(), this.settings.negativeSignCharacter);\n let isPasteNegativeAndInitialValueIsPositive;\n let result;\n\n // If the pasted content is negative, then the result will be negative too\n if (isPasteNegative && !isInitialValueNegative) {\n isInitialValueNegative = true;\n isPasteNegativeAndInitialValueIsPositive = true;\n }\n else {\n isPasteNegativeAndInitialValueIsPositive = false;\n }\n\n let leftPartContainedADot = false;\n let leftPart;\n let rightPart;\n switch (this.settings.onInvalidPaste) {\n /* 4a. Truncate paste behavior:\n * Insert as many numbers as possible on the right hand side of the caret from the pasted text content, until the input reach its range limit.\n * If there is more characters in the clipboard once a limit is reached, drop the extraneous characters.\n * Otherwise paste all the numbers in the clipboard.\n * While doing so, we check if the result is within the minimum and maximum values allowed, and stop as soon as we encounter one of those.\n *\n * 4b. Replace paste behavior:\n * Idem than the 'truncate' paste behavior, except that when a range limit is hit, we try to replace the subsequent initial numbers with the pasted ones, until we hit the range limit a second (and last) time, or we run out of numbers to paste\n */\n /* eslint no-case-declarations: 0 */\n case AutoNumeric.options.onInvalidPaste.truncate:\n case AutoNumeric.options.onInvalidPaste.replace:\n const leftFormattedPart = initialFormattedValue.slice(0, selectionStart);\n const rightFormattedPart = initialFormattedValue.slice(selectionEnd, initialFormattedValue.length);\n\n if (selectionStart !== selectionEnd) {\n // a. If there is a selection, remove the selected part, and return the left and right part\n result = this._preparePastedText(leftFormattedPart + rightFormattedPart);\n } else {\n // b. Else if this is only one caret (and therefore no selection), then return the left and right part\n result = this._preparePastedText(initialFormattedValue);\n }\n\n // Add back the negative sign if needed\n if (isInitialValueNegative) {\n result = AutoNumericHelper.setRawNegativeSign(result);\n }\n\n // Build the unformatted result string\n caretPositionOnInitialTextAfterPasting = AutoNumericHelper.convertCharacterCountToIndexPosition(AutoNumericHelper.countNumberCharactersOnTheCaretLeftSide(initialFormattedValue, selectionStart, this.settings.decimalCharacter));\n if (isPasteNegativeAndInitialValueIsPositive) {\n // If the initial paste is negative and the initial value is not, then I must offset the caret position by one place to the right to take the additional hyphen into account\n caretPositionOnInitialTextAfterPasting++;\n //TODO Quid if the negative sign is not on the left (negativePositiveSignPlacement and currencySymbolPlacement)?\n }\n\n leftPart = result.slice(0, caretPositionOnInitialTextAfterPasting);\n rightPart = result.slice(caretPositionOnInitialTextAfterPasting, result.length);\n if (pastedText === '.') {\n if (AutoNumericHelper.contains(leftPart, '.')) {\n // If I remove a dot here, then I need to update the caret position (decrement it by 1) when positioning it\n // To do so, we keep that info in order to modify the caret position later\n leftPartContainedADot = true;\n leftPart = leftPart.replace('.', '');\n }\n\n rightPart = rightPart.replace('.', '');\n }\n // -- Here, we are good to go to continue on the same basis\n\n // c. Add numbers one by one at the caret position, while testing if the result is valid and within the range of the minimum and maximum value\n // Continue until you either run out of numbers to paste, or that you get out of the range limits\n const minParse = AutoNumericHelper.parseStr(this.settings.minimumValue);\n const maxParse = AutoNumericHelper.parseStr(this.settings.maximumValue);\n let lastGoodKnownResult = result; // This is set as the default, in case we do not add even one number\n let pastedTextIndex = 0;\n let modifiedLeftPart = leftPart;\n\n while (pastedTextIndex < pastedText.length) {\n // Modify the result with another pasted character\n modifiedLeftPart += pastedText[pastedTextIndex];\n result = modifiedLeftPart + rightPart;\n\n // Check the range limits\n if (!this.constructor._checkIfInRange(result, minParse, maxParse)) {\n // The result is out of the range limits, stop the loop here\n break;\n }\n\n // Save the last good known result\n lastGoodKnownResult = result;\n\n // Update the local variables for the next loop\n pastedTextIndex++;\n }\n\n // Update the last caret position where to insert a new number\n caretPositionOnInitialTextAfterPasting += pastedTextIndex;\n\n //XXX Here we have the result for the `truncate` option\n if (this.settings.onInvalidPaste === AutoNumeric.options.onInvalidPaste.truncate) {\n //TODO If the user as defined a truncate callback and there are still some numbers (that will be dropped), then call this callback with the initial paste as well as the remaining numbers\n result = lastGoodKnownResult;\n\n if (leftPartContainedADot) {\n // If a dot has been removed for the part on the left of the caret, we decrement the caret index position\n caretPositionOnInitialTextAfterPasting--;\n }\n break;\n }\n //XXX ...else we need to continue modifying the result for the 'replace' option\n\n // d. Until there are numbers to paste, replace the initial numbers one by one, and still do the range test.\n // Stop when you have no more numbers to paste, or if you are out of the range limits.\n // If you do get to the range limits, use the previous known good value within those limits.\n // Note: The numbers are replaced one by one, in the integer then decimal part, while ignoring the decimal character\n //TODO What should happen if the user try to paste a decimal number? Should we override the current initial decimal character in favor of this new one? If we do, then we have to recalculate the vMin/vMax from the start in order to take into account this new decimal character position..\n let lastGoodKnownResultIndex = caretPositionOnInitialTextAfterPasting;\n const lastGoodKnownResultSize = lastGoodKnownResult.length;\n\n while (pastedTextIndex < pastedText.length && lastGoodKnownResultIndex < lastGoodKnownResultSize) {\n if (lastGoodKnownResult[lastGoodKnownResultIndex] === '.') {\n // We skip the decimal character 'replacement'. That way, we do not change the decimal character position regarding the remaining numbers.\n lastGoodKnownResultIndex++;\n continue;\n }\n\n // This replace one character at a time\n result = AutoNumericHelper.replaceCharAt(lastGoodKnownResult, lastGoodKnownResultIndex, pastedText[pastedTextIndex]);\n\n // Check the range limits\n if (!this.constructor._checkIfInRange(result, minParse, maxParse)) {\n // The result is out of the range limits, stop the loop here\n break;\n }\n\n // Save the last good known result\n lastGoodKnownResult = result;\n\n // Update the local variables for the next loop\n pastedTextIndex++;\n lastGoodKnownResultIndex++;\n }\n\n // Update the last caret position where to insert a new number\n caretPositionOnInitialTextAfterPasting = lastGoodKnownResultIndex;\n\n if (leftPartContainedADot) {\n // If a dot has been removed for the part on the left of the caret, we decrement the caret index position\n caretPositionOnInitialTextAfterPasting--;\n }\n\n result = lastGoodKnownResult;\n\n break;\n /* 4c. Normal paste behavior:\n * Insert the pasted number inside the current unformatted text, at the right caret position or selection\n */\n case AutoNumeric.options.onInvalidPaste.error:\n case AutoNumeric.options.onInvalidPaste.ignore:\n case AutoNumeric.options.onInvalidPaste.clamp:\n default:\n // 1. Generate the unformatted result\n const leftFormattedPart2 = initialFormattedValue.slice(0, selectionStart);\n const rightFormattedPart2 = initialFormattedValue.slice(selectionEnd, initialFormattedValue.length);\n\n if (selectionStart !== selectionEnd) {\n // a. If there is a selection, remove the selected part, and return the left and right part\n result = this._preparePastedText(leftFormattedPart2 + rightFormattedPart2);\n } else {\n // b. Else if this is only one caret (and therefore no selection), then return the left and right part\n result = this._preparePastedText(initialFormattedValue);\n }\n\n // Add back the negative sign if needed\n if (isInitialValueNegative) {\n result = AutoNumericHelper.setRawNegativeSign(result);\n }\n\n // Build the unformatted result string\n caretPositionOnInitialTextAfterPasting = AutoNumericHelper.convertCharacterCountToIndexPosition(AutoNumericHelper.countNumberCharactersOnTheCaretLeftSide(initialFormattedValue, selectionStart, this.settings.decimalCharacter));\n if (isPasteNegativeAndInitialValueIsPositive) {\n // If the initial paste is negative and the initial value is not, then I must offset the caret position by one place to the right to take the additional hyphen into account\n caretPositionOnInitialTextAfterPasting++;\n //TODO Quid if the negative sign is not on the left (negativePositiveSignPlacement and currencySymbolPlacement)?\n }\n\n leftPart = result.slice(0, caretPositionOnInitialTextAfterPasting);\n rightPart = result.slice(caretPositionOnInitialTextAfterPasting, result.length);\n if (pastedText === '.') {\n // If the user only paste a single decimal character, then we remove the previously existing one (if any)\n if (AutoNumericHelper.contains(leftPart, '.')) {\n // If I remove a dot here, then I need to update the caret position (decrement it by 1) when positioning it\n // To do so, we keep that info in order to modify the caret position later\n leftPartContainedADot = true;\n leftPart = leftPart.replace('.', '');\n }\n\n rightPart = rightPart.replace('.', '');\n }\n // -- Here, we are good to go to continue on the same basis\n\n // Generate the unformatted result\n result = `${leftPart}${pastedText}${rightPart}`;\n\n // 2. Calculate the caret position in the unformatted value, for later use\n if (selectionStart === selectionEnd) {\n // There is no selection, then the caret position is set after the pasted text\n const indexWherePastedTextHasBeenInserted = AutoNumericHelper.convertCharacterCountToIndexPosition(AutoNumericHelper.countNumberCharactersOnTheCaretLeftSide(initialFormattedValue, selectionStart, this.settings.decimalCharacter));\n caretPositionOnInitialTextAfterPasting = indexWherePastedTextHasBeenInserted + pastedText.length; // I must not count the characters that have been removed from the pasted text (ie. '.')\n } else if (rightPart === '') {\n // If the user selected from the caret position to the end of the input (on the far right)\n caretPositionOnInitialTextAfterPasting = AutoNumericHelper.convertCharacterCountToIndexPosition(AutoNumericHelper.countNumberCharactersOnTheCaretLeftSide(initialFormattedValue, selectionStart, this.settings.decimalCharacter)) + pastedText.length;\n } else {\n // Normal case\n const indexSelectionEndInRawValue = AutoNumericHelper.convertCharacterCountToIndexPosition(AutoNumericHelper.countNumberCharactersOnTheCaretLeftSide(initialFormattedValue, selectionEnd, this.settings.decimalCharacter));\n\n // Here I must not count the characters that have been removed from the pasted text (ie. '.'), or the thousand separators in the initial selected text\n const selectedText = AutoNumericHelper.getElementValue(eventTarget).slice(selectionStart, selectionEnd);\n caretPositionOnInitialTextAfterPasting = indexSelectionEndInRawValue - selectionSize + AutoNumericHelper.countCharInText(this.settings.digitGroupSeparator, selectedText) + pastedText.length;\n }\n\n // Modify the caret position for special cases, only if the whole input has not been selected\n if (isPasteNegativeAndInitialValueIsPositive) {\n // If the pasted value has a negative sign ('-'), but the initial value does not, offset the index by one\n caretPositionOnInitialTextAfterPasting++;\n }\n\n if (leftPartContainedADot) {\n // If a dot has been removed for the part on the left of the caret, we decrement the caret index position\n caretPositionOnInitialTextAfterPasting--;\n }\n }\n\n // 5. Check if the result is a valid number, if not, drop the paste and do nothing.\n if (!AutoNumericHelper.isNumber(result) || result === '') {\n if (this.settings.onInvalidPaste === AutoNumeric.options.onInvalidPaste.error) {\n AutoNumericHelper.throwError(`The pasted value '${rawPastedText}' would result into an invalid content '${result}'.`); //TODO Should we send a warning instead of throwing an error?\n //TODO This is not DRY ; refactor with above\n }\n return;\n }\n\n // 6. If it's a valid number, check if it falls inside the minimum and maximum value. If this fails, modify the value following this procedure :\n /*\n * If 'error' (this is the default) :\n * - Normal paste behavior.\n * - Try to set the new value, if it fails, then throw an error in the console.\n * - Do not change the input value, do not change the current selection.\n * If 'ignore' :\n * - Normal paste behavior.\n * - Try to set the new value, if it fails, do nothing more.\n * - Do not change the input value, do not change the current selection.\n * If 'clamp' :\n * - Normal paste behavior.\n * - Try to set the new value, if it fails, set the value to the minimum or maximum limit, whichever is closest to the\n * paste result.\n * - Change the caret position to be positioned on the left hand side of the decimal character.\n * If 'truncate' :\n * - Truncate paste behavior.\n * - Try to set the new value, until it fails (if the result is out of the min and max value limits).\n * - Drop the remaining non-pasted numbers, and keep the last known non-failing result.\n * - Change the caret position to be positioned after the last pasted character.\n * If 'replace' :\n * - Replace paste behavior.\n * - Try to set the new value, until it fails (if the result is out of the min and max value limits).\n * - Then try to replace as many numbers as possible with the pasted ones. Once it fails, keep the last known non-failing result.\n * - Change the caret position to be positioned after the last pasted character.\n */\n let valueHasBeenSet = false;\n let valueHasBeenClamped = false;\n try {\n this.set(result);\n valueHasBeenSet = true;\n } catch (error) {\n let clampedValue;\n switch (this.settings.onInvalidPaste) {\n case AutoNumeric.options.onInvalidPaste.clamp:\n clampedValue = AutoNumericHelper.clampToRangeLimits(result, this.settings);\n try {\n this.set(clampedValue);\n } catch (error) {\n AutoNumericHelper.throwError(`Fatal error: Unable to set the clamped value '${clampedValue}'.`);\n }\n\n valueHasBeenClamped = true;\n valueHasBeenSet = true;\n result = clampedValue; // This is used only for setting the caret position later\n break;\n case AutoNumeric.options.onInvalidPaste.error:\n case AutoNumeric.options.onInvalidPaste.truncate:\n case AutoNumeric.options.onInvalidPaste.replace:\n // Throw an error message\n AutoNumericHelper.throwError(`The pasted value '${rawPastedText}' results in a value '${result}' that is outside of the minimum [${this.settings.minimumValue}] and maximum [${this.settings.maximumValue}] value range.`);\n // falls through\n case AutoNumeric.options.onInvalidPaste.ignore:\n // Do nothing\n // falls through\n default :\n return; // ...and nothing else should be changed\n }\n }\n\n // 7. Then lastly, set the caret position at the right logical place\n const targetValue = AutoNumericHelper.getElementValue(eventTarget);\n let caretPositionInFormattedNumber;\n if (valueHasBeenSet) {\n switch (this.settings.onInvalidPaste) {\n case AutoNumeric.options.onInvalidPaste.clamp:\n if (valueHasBeenClamped) {\n if (this.settings.currencySymbolPlacement === AutoNumeric.options.currencySymbolPlacement.suffix) {\n AutoNumericHelper.setElementSelection(eventTarget, targetValue.length - this.settings.currencySymbol.length); // This puts the caret on the right of the last decimal place\n } else {\n AutoNumericHelper.setElementSelection(eventTarget, targetValue.length); // ..and this on the far right\n }\n\n break;\n } // else if the value has not been clamped, the default behavior is used...\n // falls through\n case AutoNumeric.options.onInvalidPaste.error:\n case AutoNumeric.options.onInvalidPaste.ignore:\n case AutoNumeric.options.onInvalidPaste.truncate:\n case AutoNumeric.options.onInvalidPaste.replace:\n default :\n // Whenever one or multiple characters are pasted, this means we have to manage the potential thousand separators that could be added by the formatting\n caretPositionInFormattedNumber = AutoNumericHelper.findCaretPositionInFormattedNumber(result, caretPositionOnInitialTextAfterPasting, targetValue, this.settings.decimalCharacter);\n AutoNumericHelper.setElementSelection(eventTarget, caretPositionInFormattedNumber);\n }\n }\n\n // 8. We make sure we send an input event only if the result is different than the initial value before the paste\n if (valueHasBeenSet && initialFormattedValue !== targetValue) {\n // On a 'normal' non-autoNumeric input, an `input` event is sent when a paste is done. We mimic that.\n this._triggerEvent(AutoNumeric.events.native.input, eventTarget);\n }\n }\n\n /**\n * When focusing out of the input, we check if the value has changed, and if it has, then we send a `change` event (since the native one would have been prevented by `e.preventDefault()` called in the other event listeners).\n * We also update the info of the focused state in the `this.isFocused` variable.\n *\n * @param {Event} e\n */\n _onBlur(e) {\n // Keep track if the element is currently focused\n this.isFocused = false;\n // Keep track if the user is currently editing the element\n this.isEditing = false;\n\n if (AutoNumericHelper.getElementValue(e.target) !== this.valueOnFocus) {\n this._triggerEvent(AutoNumeric.events.native.change, e.target);\n }\n }\n\n /**\n * Handler for 'wheel' event\n *\n * @param {WheelEvent} e\n */\n _onWheel(e) {\n if (this.settings.readOnly || this.domElement.readOnly || this.domElement.disabled) {\n // Do not allow scrolling in a readonly element (fix issue #541)\n return;\n }\n\n if (this.settings.modifyValueOnWheel) {\n if (this.settings.wheelOn === AutoNumeric.options.wheelOn.focus) {\n if (this.isFocused) {\n if (!e.shiftKey) {\n this.wheelAction(e);\n }\n } else if (e.shiftKey) {\n this.wheelAction(e);\n }\n } else if (this.settings.wheelOn === AutoNumeric.options.wheelOn.hover) {\n if (!e.shiftKey) {\n this.wheelAction(e);\n } else {\n // Note: When not `defaultPrevented`, Shift + mouse wheel is reserved by the browsers for horizontal scrolling.\n // Hence, using the Shift key with the `wheelOn` 'hover' option will only scroll the page if we prevent the default behavior\n e.preventDefault(); // Do not scroll horizontally\n\n // Scroll vertically\n window.scrollBy(0, AutoNumericHelper.isNegativeStrict(String(e.deltaY))?-50:50); // `e.deltaY` is usually too small compared to how the page is scrolled. That's why we use a fixed offset.\n }\n } else {\n AutoNumericHelper.throwError('Unknown `wheelOn` option.');\n }\n }\n }\n\n /**\n * Increment or decrement the element value according to the `wheelStep` option chosen\n *\n * @param {WheelEvent} e The `wheel` event\n */\n wheelAction(e) {\n this.isWheelEvent = true; // Keep the info that we are currently managing a mouse wheel event\n\n // 0) First, save the caret position so we can set it back once the value has been changed\n const selectionStart = e.target.selectionStart || 0;\n const selectionEnd = e.target.selectionEnd || 0;\n\n // 1) Get the unformatted value\n const currentUnformattedValue = this.rawValue;\n\n let result;\n if (AutoNumericHelper.isUndefinedOrNullOrEmpty(currentUnformattedValue)) {\n // If by default the input is empty, start at '0'\n if (this.settings.minimumValue > 0 || this.settings.maximumValue < 0) {\n // or if '0' is not between min and max value, 'minimumValue' if the user does a wheelup, 'maximumValue' if the user does a wheeldown\n if (AutoNumericHelper.isWheelUpEvent(e)) {\n result = this.settings.minimumValue;\n } else if (AutoNumericHelper.isWheelDownEvent(e)) {\n result = this.settings.maximumValue;\n } else {\n AutoNumericHelper.throwError(`The event is not a 'wheel' event.`);\n }\n } else {\n result = 0;\n }\n } else {\n result = currentUnformattedValue;\n }\n\n result = +result; // Typecast to a number needed for the following addition/subtraction\n\n // 2) Increment/Decrement the value\n // But first, choose the increment/decrement method ; fixed or progressive\n if (AutoNumericHelper.isNumber(this.settings.wheelStep)) {\n const step = +this.settings.wheelStep; // Typecast to a number needed for the following addition/subtraction\n // Fixed method\n // This is the simplest method, where a fixed offset in added/subtracted from the current value\n if (AutoNumericHelper.isWheelUpEvent(e)) { // Increment\n result += step;\n } else if (AutoNumericHelper.isWheelDownEvent(e)) { // Decrement\n result -= step;\n }\n } else {\n // Progressive method\n // For this method, we calculate an offset that is in relation to the size of the current number (using only the integer part size).\n // The bigger the number, the bigger the offset (usually the number count in the integer part minus 3, except for small numbers where a different behavior is better for the user experience).\n //TODO Known limitation : The progressive method does not play well with numbers between 0 and 1 where to modify the decimal places the rawValue first has to go from '1' to '0'\n if (AutoNumericHelper.isWheelUpEvent(e)) { // Increment\n result = AutoNumericHelper.addAndRoundToNearestAuto(result, this.settings.decimalPlacesRawValue);\n } else if (AutoNumericHelper.isWheelDownEvent(e)) { // Decrement\n result = AutoNumericHelper.subtractAndRoundToNearestAuto(result, this.settings.decimalPlacesRawValue);\n }\n }\n\n // 3) Set the new value so it gets formatted\n // First clamp the result if needed\n result = AutoNumericHelper.clampToRangeLimits(result, this.settings);\n if (result !== +currentUnformattedValue) {\n // Only 'set' the value if it has changed. For instance 'set' should not happen if the user hits a limit and continue to try to go past it since we clamp the value.\n this.set(result);\n\n // Since we changed the input value, we send a native `input` event\n this._triggerEvent(AutoNumeric.events.native.input, e.target);\n }\n\n //XXX Do not prevent if the value is not modified? From a UX point of view, preventing the wheel event when the user use it on top of an autoNumeric element should always be done, even if the value does not change. Perhaps that could affect other scripts relying on this event to be sent though.\n e.preventDefault(); // We prevent the page to scroll while we increment/decrement the value\n\n // 4) Finally, we set back the caret position/selection\n // There is no need to take into account the fact that the number count could be different at the end of the wheel event ; it would be too complex and most of the time unreliable\n this._setSelection(selectionStart, selectionEnd);\n\n this.isWheelEvent = false; // Set back the mouse wheel indicator to its default\n }\n\n /**\n * Handler for 'drop' event\n *\n * @param {DragEvent} e\n */\n _onDrop(e) {\n // Note: by default browsers already prevent the drop on readOnly and disabled elements\n this.isDropEvent = true;\n e.preventDefault();\n let format;\n if (AutoNumericHelper.isIE11()) {\n format = 'text';\n } else {\n format = 'text/plain';\n }\n\n const droppedText = e.dataTransfer.getData(format);\n const cleanedValue = this.unformatOther(droppedText);\n this.set(cleanedValue);\n this.isDropEvent = false;\n }\n\n /**\n * Handler for 'submit' events happening on the parent <form> element.\n * If `unformatOnSubmit` is set to `true`, the element value is first unformatted before the form is submitted.\n *\n * @returns {boolean}\n */\n _onFormSubmit() {\n // Search for all the AutoNumeric children of the form element and call the `_unformatOnSubmit()` function\n const inputElements = this._getFormAutoNumericChildren(this.parentForm);\n const aNElements = inputElements.map(aNElement => this.constructor.getAutoNumericElement(aNElement));\n aNElements.forEach(aNElement => aNElement._unformatOnSubmit());\n\n return true;\n }\n\n /**\n * Unformat the element value according to the `unformatOnSubmit` option\n *\n * @private\n */\n _unformatOnSubmit() {\n if (this.settings.unformatOnSubmit) {\n this._setElementValue(this.rawValue);\n }\n }\n\n /**\n * Listen for the `alt` key keydown event globally, and if the event is caught, unformat the AutoNumeric element that is hovered by the mouse.\n *\n * @param {KeyboardEvent} e\n * @private\n */\n _onKeydownGlobal(e) {\n //TODO Find a way to keep the caret position between the alt keyup/keydown states\n if (AutoNumericHelper.character(e) === AutoNumericEnum.keyName.Alt) {\n const hoveredElement = AutoNumericHelper.getHoveredElement();\n if (AutoNumeric.isManagedByAutoNumeric(hoveredElement)) {\n const anElement = AutoNumeric.getAutoNumericElement(hoveredElement);\n this.constructor._unformatAltHovered(anElement);\n }\n }\n }\n\n /**\n * Listen for the `alt` key keyup event globally, and if the event is caught, reformat the AutoNumeric element that is hovered by the mouse.\n *\n * @param {KeyboardEvent} e\n * @private\n */\n _onKeyupGlobal(e) {\n if (AutoNumericHelper.character(e) === AutoNumericEnum.keyName.Alt) {\n const hoveredElement = AutoNumericHelper.getHoveredElement();\n if (AutoNumeric.isManagedByAutoNumeric(hoveredElement)) {\n const anElement = AutoNumeric.getAutoNumericElement(hoveredElement);\n this.constructor._reformatAltHovered(anElement);\n }\n }\n }\n\n /**\n * Return `true` if the DOM element is supported by autoNumeric.\n * A supported element is an element whitelisted in the `allowedTagList`.\n *\n * @returns {boolean}\n * @private\n */\n _isElementTagSupported() {\n if (!AutoNumericHelper.isElement(this.domElement)) {\n AutoNumericHelper.throwError(`The DOM element is not valid, ${this.domElement} given.`);\n }\n\n return AutoNumericHelper.isInArray(this.domElement.tagName.toLowerCase(), this.allowedTagList);\n }\n\n /**\n * Return `true` in the DOM element is an <input>.\n *\n * @returns {boolean}\n * @private\n */\n _isInputElement() {\n return this.domElement.tagName.toLowerCase() === 'input';\n }\n\n /**\n * Return `true` if the input type is supported by AutoNumeric\n *\n * @returns {boolean}\n * @throws\n */\n _isInputTypeSupported() {\n return (this.domElement.type === 'text' ||\n this.domElement.type === 'hidden' ||\n this.domElement.type === 'tel' ||\n AutoNumericHelper.isUndefinedOrNullOrEmpty(this.domElement.type));\n }\n\n /**\n * Check if the DOM element is supported by autoNumeric.\n * A supported element is either an <input> element with the right 'type' attribute, or a tag whitelisted in the `allowedTagList`.\n * If the check fails, this method throws.\n * This function also set the info `this.isInputElement` which keep tracks if the DOM element is an <input> or not, and the `this.isContentEditable` if the element has the `contenteditable` attribute set to `true`.\n *\n * @throws\n * @private\n */\n _checkElement() {\n const currentElementTag = this.domElement.tagName.toLowerCase();\n\n if (!this._isElementTagSupported()) {\n AutoNumericHelper.throwError(`The <${currentElementTag}> tag is not supported by autoNumeric`);\n }\n\n if (this._isInputElement()) {\n if (!this._isInputTypeSupported()) {\n AutoNumericHelper.throwError(`The input type \"${this.domElement.type}\" is not supported by autoNumeric`);\n }\n\n this.isInputElement = true;\n } else {\n this.isInputElement = false;\n this.isContentEditable = this.domElement.hasAttribute('contenteditable') && this.domElement.getAttribute('contenteditable') === 'true';\n }\n }\n\n /**\n * Formats the default value on page load.\n * This is called only if the `formatOnPageLoad` option is set to `true`.\n *\n * @param {number|string|null} forcedInitialValue The value that should be used for initialization, in place on the eventual html one\n */\n _formatDefaultValueOnPageLoad(forcedInitialValue = null) {\n let setValue = true;\n let currentValue;\n if (!AutoNumericHelper.isNull(forcedInitialValue)) {\n currentValue = forcedInitialValue;\n } else {\n // Make sure the initial value does not have any superfluous whitespaces around it (Fix issue #479)\n currentValue = AutoNumericHelper.getElementValue(this.domElement).trim();\n // Correct the DOM attribute in case some whitespaces were present\n this.domElement.setAttribute('value', currentValue);\n }\n\n if (this.isInputElement || this.isContentEditable) {\n /*\n * If the input value has been set by the dev, but not directly as an attribute in the html, then it takes\n * precedence and should get formatted during the initialization (if this input value is a valid number and that the\n * developer wants it formatted on init (cf. the `settings.formatOnPageLoad` option)).\n * Note; this is true whatever the developer has set for `data-default-value-override` in the html (asp.net users).\n *\n * In other words : if `defaultValueOverride` is not null, it means the developer is trying to prevent postback problems.\n * But if `input.value` is set to a number, and the html `value` attribute is not set, then it means the dev has\n * changed the input value, and then it means we should not overwrite his own decision to do so.\n * Hence, if `defaultValueOverride` is not null, but `input.value` is a number and `this.domElement.hasAttribute('value')`\n * is false, we should ignore `defaultValueOverride` altogether.\n */\n const unLocalizedCurrentValue = this.constructor._toNumericValue(currentValue, this.settings); // This allows to use a localized value on startup\n if (!this.domElement.hasAttribute('value') || this.domElement.getAttribute('value') === '') {\n // Check if the `value` is valid or not\n if (!isNaN(Number(unLocalizedCurrentValue)) && Infinity !== unLocalizedCurrentValue) {\n this.set(unLocalizedCurrentValue);\n setValue = false;\n } else {\n // If not, inform the developer that nothing usable has been provided\n AutoNumericHelper.throwError(`The value [${currentValue}] used in the input is not a valid value autoNumeric can work with.`);\n }\n } else {\n /* Checks for :\n * - page reload from back button, and\n * - ASP.net form post back\n * The following HTML data attribute is REQUIRED (data-an-default=\"same value as the value attribute\")\n * example: <asp:TextBox runat=\"server\" id=\"someID\" text=\"1234.56\" data-an-default=\"1234.56\">\n */\n if ((this.settings.defaultValueOverride !== null && this.settings.defaultValueOverride.toString() !== currentValue) ||\n (this.settings.defaultValueOverride === null && currentValue !== '' && currentValue !== this.domElement.getAttribute('value')) ||\n (currentValue !== '' && this.domElement.getAttribute('type') === 'hidden' && !AutoNumericHelper.isNumber(unLocalizedCurrentValue))) {\n if (this.settings.saveValueToSessionStorage && (this.settings.decimalPlacesShownOnFocus !== null || this.settings.divisorWhenUnfocused)) {\n this._setRawValue(this._getValueFromPersistentStorage());\n }\n\n // If the decimalPlacesShownOnFocus value should NOT be saved in sessionStorage\n if (!this.settings.saveValueToSessionStorage) {\n const toStrip = this.constructor._removeBrackets(currentValue, this.settings);\n if ((this.settings.negativePositiveSignPlacement === AutoNumeric.options.negativePositiveSignPlacement.suffix ||\n (this.settings.negativePositiveSignPlacement !== AutoNumeric.options.negativePositiveSignPlacement.prefix && this.settings.currencySymbolPlacement === AutoNumeric.options.currencySymbolPlacement.suffix)) &&\n this.settings.negativeSignCharacter !== '' &&\n AutoNumericHelper.isNegative(currentValue, this.settings.negativeSignCharacter)) {\n this._setRawValue(`-${this.constructor._stripAllNonNumberCharacters(toStrip, this.settings, true, this.isFocused)}`);\n } else {\n this._setRawValue(this.constructor._stripAllNonNumberCharacters(toStrip, this.settings, true, this.isFocused));\n }\n }\n\n setValue = false;\n }\n }\n\n if (currentValue === '') {\n switch (this.settings.emptyInputBehavior) {\n case AutoNumeric.options.emptyInputBehavior.focus:\n setValue = false;\n break;\n //TODO What about the `AutoNumeric.options.emptyInputBehavior.press` value?\n case AutoNumeric.options.emptyInputBehavior.always:\n this._setElementValue(this.settings.currencySymbol);\n setValue = false;\n break;\n case AutoNumeric.options.emptyInputBehavior.zero:\n this.set('0');\n setValue = false;\n break;\n default :\n //\n }\n } else if (setValue && currentValue === this.domElement.getAttribute('value')) {\n this.set(currentValue);\n }\n } else if (this.settings.defaultValueOverride === null ||\n this.settings.defaultValueOverride === currentValue) {\n this.set(currentValue);\n }\n }\n\n /**\n * Enhance the user experience by modifying the default `negativePositiveSignPlacement` option depending on `currencySymbol` and `currencySymbolPlacement`.\n *\n * If the user has not set the placement of the negative sign (`negativePositiveSignPlacement`), but has set a currency symbol (`currencySymbol`),\n * then we modify the default value of `negativePositiveSignPlacement` in order to keep the resulting output logical by default :\n * - \"$-1,234.56\" instead of \"-$1,234.56\" ({currencySymbol: \"$\", negativePositiveSignPlacement: \"r\"})\n * - \"-1,234.56$\" instead of \"1,234.56-$\" ({currencySymbol: \"$\", currencySymbolPlacement: \"s\", negativePositiveSignPlacement: \"p\"})\n *\n * @param {object} settings\n */\n static _correctNegativePositiveSignPlacementOption(settings) {\n //XXX Note; this function is static since we need to pass a `settings` object when calling the static `AutoNumeric.format()` method\n // If negativePositiveSignPlacement is already set, we do not overwrite it\n if (!AutoNumericHelper.isNull(settings.negativePositiveSignPlacement)) {\n return;\n }\n\n if (!AutoNumericHelper.isUndefined(settings) &&\n AutoNumericHelper.isUndefinedOrNullOrEmpty(settings.negativePositiveSignPlacement) &&\n !AutoNumericHelper.isUndefinedOrNullOrEmpty(settings.currencySymbol)) {\n switch (settings.currencySymbolPlacement) {\n case AutoNumeric.options.currencySymbolPlacement.suffix:\n settings.negativePositiveSignPlacement = AutoNumeric.options.negativePositiveSignPlacement.prefix; // Default -1,234.56 €\n break;\n case AutoNumeric.options.currencySymbolPlacement.prefix:\n settings.negativePositiveSignPlacement = AutoNumeric.options.negativePositiveSignPlacement.left; // Default -$1,234.56\n break;\n default :\n //\n }\n } else {\n // Sets the default value if `negativePositiveSignPlacement` is `null`\n settings.negativePositiveSignPlacement = AutoNumeric.options.negativePositiveSignPlacement.left;\n }\n }\n\n /**\n * Correct the `caretPositionOnFocus` and `selectOnFocus` options, since setting both leads to a conflict.\n * This method directly modifies the `options` object passed as a parameter, then returns it.\n * It returns `null` if the given option is `null`.\n *\n * @param {object} options The options passed as an argument by the user\n * @returns {object|null}\n * @private\n */\n static _correctCaretPositionOnFocusAndSelectOnFocusOptions(options) {\n if (AutoNumericHelper.isNull(options)) {\n return null;\n }\n\n // If the user has set the `caretPositionOnFocus` option, do not set `selectOnFocus` to `true` by default\n if (!AutoNumericHelper.isUndefinedOrNullOrEmpty(options.caretPositionOnFocus) && AutoNumericHelper.isUndefinedOrNullOrEmpty(options.selectOnFocus)) {\n options.selectOnFocus = AutoNumeric.options.selectOnFocus.doNotSelect;\n }\n\n // If the user has set the `selectOnFocus` option to `true`, set `caretPositionOnFocus` to `doNoForceCaretPosition`\n if (AutoNumericHelper.isUndefinedOrNullOrEmpty(options.caretPositionOnFocus) && !AutoNumericHelper.isUndefinedOrNullOrEmpty(options.selectOnFocus) && options.selectOnFocus === AutoNumeric.options.selectOnFocus.select) {\n options.caretPositionOnFocus = AutoNumeric.options.caretPositionOnFocus.doNoForceCaretPosition;\n }\n\n return options;\n }\n\n /**\n * Calculate the number de decimal places to be used by the AutoNumeric object, for each of its state, and for its formatted and raw value.\n * By default, the `rawValue` precision is the same as the formatted value one.\n *\n * This method is called during the AutoNumeric object initialization. This assumes some internal variable state.\n *\n * This methods set the following options accordingly to their own value and the mandatory `decimalPlaces` option:\n * - decimalPlacesRawValue (nullable)\n * - decimalPlacesShownOnBlur (nullable)\n * - decimalPlacesShownOnFocus (nullable)\n *\n * Note: the `decimalPlaces` option is only used here and only serve to define those three previous options value.\n * AutoNumeric will then *only* use `decimalPlacesRawValue`, `decimalPlacesShownOnBlur` and `decimalPlacesShownOnFocus` from there.\n *\n * This methods directly modifies the `settings` object passed as a parameter.\n *\n * @param {object} settings This is an object with the new settings to use.\n * @private\n */\n static _calculateDecimalPlacesOnInit(settings) {\n // Check the `decimalPlaces*` options and output any warnings as needed, before modifying those options\n this._validateDecimalPlacesRawValue(settings);\n\n // Initialization phase\n //XXX This assumes at this stage, `settings.decimalPlaces` as been set from the default options\n\n // Overwrite the `decimalPlaces*` values if the `decimalPlaces*` options are not set in the `settings`\n // Sets `decimalPlacesShownOnBlur` (previously known as `scaleDecimalPlaces`)\n if (settings.decimalPlacesShownOnFocus === AutoNumeric.options.decimalPlacesShownOnFocus.useDefault) {\n settings.decimalPlacesShownOnFocus = settings.decimalPlaces;\n }\n\n if (settings.decimalPlacesShownOnBlur === AutoNumeric.options.decimalPlacesShownOnBlur.useDefault) {\n settings.decimalPlacesShownOnBlur = settings.decimalPlaces;\n }\n\n if (settings.decimalPlacesRawValue === AutoNumeric.options.decimalPlacesRawValue.useDefault) {\n settings.decimalPlacesRawValue = settings.decimalPlaces;\n }\n\n // Add the additional decimal places to the raw value\n let additionalDecimalPlacesRawValue = 0;\n if (settings.rawValueDivisor && settings.rawValueDivisor !== AutoNumeric.options.rawValueDivisor.none) {\n additionalDecimalPlacesRawValue = String(settings.rawValueDivisor).length - 1; // ie. Dividing by '100' adds 2 decimal places to the needed precision\n if (additionalDecimalPlacesRawValue < 0) {\n additionalDecimalPlacesRawValue = 0;\n }\n }\n\n settings.decimalPlacesRawValue = Math.max(\n Math.max(settings.decimalPlacesShownOnBlur, settings.decimalPlacesShownOnFocus) + additionalDecimalPlacesRawValue,\n Number(settings.originalDecimalPlacesRawValue) + additionalDecimalPlacesRawValue\n );\n }\n\n /**\n * Recalculate the number de decimal places to be used by the AutoNumeric object, for each of its state, and for its formatted and raw value.\n * By default, the `rawValue` precision is the same as the formatted value one.\n *\n * This method is close to the one called during initialization, `_calculateDecimalPlacesOnInit()`, but with slight difference so that the `decimalPlaces*` options are correctly updated as needed.\n *\n * This methods set the following options accordingly to their own value and the mandatory `decimalPlaces` option:\n * - decimalPlacesRawValue (nullable)\n * - decimalPlacesShownOnBlur (nullable)\n * - decimalPlacesShownOnFocus (nullable)\n *\n * Note: the `decimalPlaces` option is only used here and only serve to define those three previous options value.\n * AutoNumeric will then *only* use `decimalPlacesRawValue`, `decimalPlacesShownOnBlur` and `decimalPlacesShownOnFocus` from there.\n *\n * This methods directly modifies the `settings` object passed as a parameter.\n *\n * @param {object} settings This is an object with the new settings to use.\n * @param {object} currentSettings This is the current settings (`this.settings`) used by the element.\n * @private\n */\n static _calculateDecimalPlacesOnUpdate(settings, currentSettings = null) {\n // Check the `decimalPlaces*` options and output any warnings as needed, before modifying those options\n this._validateDecimalPlacesRawValue(settings);\n\n // Update phase\n if (AutoNumericHelper.isNull(currentSettings)) {\n AutoNumericHelper.throwError(`When updating the settings, the previous ones should be passed as an argument.`);\n }\n\n const decimalPlacesInOptions = 'decimalPlaces' in settings;\n if (!(decimalPlacesInOptions ||\n 'decimalPlacesRawValue' in settings ||\n 'decimalPlacesShownOnFocus' in settings ||\n 'decimalPlacesShownOnBlur' in settings ||\n 'rawValueDivisor' in settings)) {\n // Do Nothing if no decimal places-related options are modified\n return;\n }\n\n // Overwrite the `decimalPlaces*` values if the `decimalPlaces*` options are not set in the `settings`\n if (decimalPlacesInOptions) {\n if (!('decimalPlacesShownOnFocus' in settings) ||\n settings.decimalPlacesShownOnFocus === AutoNumeric.options.decimalPlacesShownOnFocus.useDefault) {\n settings.decimalPlacesShownOnFocus = settings.decimalPlaces;\n }\n\n if (!('decimalPlacesShownOnBlur' in settings) ||\n settings.decimalPlacesShownOnBlur === AutoNumeric.options.decimalPlacesShownOnBlur.useDefault) {\n settings.decimalPlacesShownOnBlur = settings.decimalPlaces;\n }\n\n if (!('decimalPlacesRawValue' in settings) ||\n settings.decimalPlacesRawValue === AutoNumeric.options.decimalPlacesRawValue.useDefault) {\n settings.decimalPlacesRawValue = settings.decimalPlaces;\n }\n } else {\n if (AutoNumericHelper.isUndefined(settings.decimalPlacesShownOnFocus)) {\n settings.decimalPlacesShownOnFocus = currentSettings.decimalPlacesShownOnFocus;\n }\n\n if (AutoNumericHelper.isUndefined(settings.decimalPlacesShownOnBlur)) {\n settings.decimalPlacesShownOnBlur = currentSettings.decimalPlacesShownOnBlur;\n }\n }\n\n // Add the additional decimal places to the raw value\n let additionalDecimalPlacesRawValue = 0;\n if (settings.rawValueDivisor && settings.rawValueDivisor !== AutoNumeric.options.rawValueDivisor.none) {\n additionalDecimalPlacesRawValue = String(settings.rawValueDivisor).length - 1; // ie. Dividing by '100' adds 2 decimal places to the needed precision\n if (additionalDecimalPlacesRawValue < 0) {\n additionalDecimalPlacesRawValue = 0;\n }\n }\n\n if (!settings.decimalPlaces && !settings.decimalPlacesRawValue) {\n settings.decimalPlacesRawValue = Math.max(\n Math.max(settings.decimalPlacesShownOnBlur, settings.decimalPlacesShownOnFocus) + additionalDecimalPlacesRawValue,\n Number(currentSettings.originalDecimalPlacesRawValue) + additionalDecimalPlacesRawValue\n );\n } else {\n settings.decimalPlacesRawValue = Math.max(\n Math.max(settings.decimalPlacesShownOnBlur, settings.decimalPlacesShownOnFocus) + additionalDecimalPlacesRawValue,\n Number(settings.decimalPlacesRawValue) + additionalDecimalPlacesRawValue\n );\n }\n }\n\n /**\n * Analyze and save the minimumValue and maximumValue integer size for later uses\n * @private\n */\n _calculateVMinAndVMaxIntegerSizes() {\n let [maximumValueIntegerPart] = this.settings.maximumValue.toString().split('.');\n let [minimumValueIntegerPart] = (!this.settings.minimumValue && this.settings.minimumValue !== 0)?[]:this.settings.minimumValue.toString().split('.');\n maximumValueIntegerPart = maximumValueIntegerPart.replace(this.settings.negativeSignCharacter, '');\n minimumValueIntegerPart = minimumValueIntegerPart.replace(this.settings.negativeSignCharacter, '');\n\n this.settings.mIntPos = Math.max(maximumValueIntegerPart.length, 1);\n this.settings.mIntNeg = Math.max(minimumValueIntegerPart.length, 1);\n }\n\n /**\n * Calculate once what are the `valuesToStrings` option keys.\n * @private\n */\n _calculateValuesToStringsKeys() {\n if (this.settings.valuesToStrings) {\n this.valuesToStringsKeys = Object.keys(this.settings.valuesToStrings);\n } else {\n this.valuesToStringsKeys = [];\n }\n }\n\n /**\n * Caches regular expressions for _stripAllNonNumberCharactersExceptCustomDecimalChar\n *\n * @param {object} settings\n * @param {object} regex\n */\n static _cachesUsualRegularExpressions(settings, regex) {\n // Test if there is a negative character in the string\n let negativeSignReg;\n if (settings.negativeSignCharacter !== AutoNumeric.options.negativeSignCharacter.hyphen) {\n negativeSignReg = `([-\\\\${settings.negativeSignCharacter}]?)`;\n } else {\n negativeSignReg = '(-?)';\n }\n\n regex.aNegRegAutoStrip = negativeSignReg;\n settings.allowedAutoStrip = new RegExp(`[^-0123456789\\\\${settings.decimalCharacter}]`, 'g');\n settings.numRegAutoStrip = new RegExp(`${negativeSignReg}(?:\\\\${settings.decimalCharacter}?([0-9]+\\\\${settings.decimalCharacter}[0-9]+)|([0-9]*(?:\\\\${settings.decimalCharacter}[0-9]*)?))`);\n\n // Using this regex version `^${regex.aNegRegAutoStrip}0*(\\\\d|$)` entirely clear the input on blur\n settings.stripReg = new RegExp(`^${regex.aNegRegAutoStrip}0*([0-9])`);\n }\n\n /**\n * Modify the user settings to make them 'exploitable' later.\n */\n _transformOptionsValuesToDefaultTypes() {\n for (const key in this.settings) {\n if (this.settings.hasOwnProperty(key)) {\n const value = this.settings[key];\n\n // Convert the strings 'true' and 'false' to booleans\n if (value === 'true' || value === 'false') {\n this.settings[key] = value === 'true';\n }\n\n // Convert numbers in options to strings\n //TODO Only transform the values of type 'Number' to 'String' if it's a currency number (so that we can have big numbers). Do not convert other numbers (ie. `historySize`)\n if (typeof value === 'number') {\n this.settings[key] = value.toString();\n }\n }\n }\n }\n\n /**\n * Convert the old settings options name to new ones.\n *\n * @param {object} options\n */\n static _convertOldOptionsToNewOnes(options) {\n //TODO Delete this function once the old options are not used anymore\n const oldOptionsConverter = {\n // Old option names, with their corresponding new names\n aSep : 'digitGroupSeparator',\n nSep : 'showOnlyNumbersOnFocus',\n dGroup : 'digitalGroupSpacing',\n aDec : 'decimalCharacter',\n altDec : 'decimalCharacterAlternative',\n aSign : 'currencySymbol',\n pSign : 'currencySymbolPlacement',\n pNeg : 'negativePositiveSignPlacement',\n aSuffix : 'suffixText',\n oLimits : 'overrideMinMaxLimits',\n vMax : 'maximumValue',\n vMin : 'minimumValue',\n mDec : 'decimalPlacesOverride',\n eDec : 'decimalPlacesShownOnFocus',\n scaleDecimal : 'decimalPlacesShownOnBlur',\n aStor : 'saveValueToSessionStorage',\n mRound : 'roundingMethod',\n aPad : 'allowDecimalPadding',\n nBracket : 'negativeBracketsTypeOnBlur',\n wEmpty : 'emptyInputBehavior',\n lZero : 'leadingZero',\n aForm : 'formatOnPageLoad',\n sNumber : 'selectNumberOnly',\n anDefault : 'defaultValueOverride',\n unSetOnSubmit : 'unformatOnSubmit',\n outputType : 'outputFormat',\n debug : 'showWarnings',\n\n // Current options :\n allowDecimalPadding : true,\n caretPositionOnFocus : true,\n createLocalList : true,\n currencySymbol : true,\n currencySymbolPlacement : true,\n decimalCharacter : true,\n decimalCharacterAlternative : true,\n decimalPlaces : true,\n decimalPlacesRawValue : true,\n decimalPlacesShownOnBlur : true,\n decimalPlacesShownOnFocus : true,\n defaultValueOverride : true,\n digitalGroupSpacing : true,\n digitGroupSeparator : true,\n divisorWhenUnfocused : true,\n emptyInputBehavior : true,\n eventBubbles : true,\n eventIsCancelable : true,\n failOnUnknownOption : true,\n formatOnPageLoad : true,\n historySize : true,\n isCancellable : true,\n leadingZero : true,\n maximumValue : true,\n minimumValue : true,\n modifyValueOnWheel : true,\n negativeBracketsTypeOnBlur : true,\n negativePositiveSignPlacement : true,\n negativeSignCharacter : true,\n noEventListeners : true,\n onInvalidPaste : true,\n outputFormat : true,\n overrideMinMaxLimits : true,\n positiveSignCharacter : true,\n rawValueDivisor : true,\n readOnly : true,\n roundingMethod : true,\n saveValueToSessionStorage : true,\n selectNumberOnly : true,\n selectOnFocus : true,\n serializeSpaces : true,\n showOnlyNumbersOnFocus : true,\n showPositiveSign : true,\n showWarnings : true,\n styleRules : true,\n suffixText : true,\n symbolWhenUnfocused : true,\n unformatOnHover : true,\n unformatOnSubmit : true,\n valuesToStrings : true,\n watchExternalChanges : true,\n wheelOn : true,\n wheelStep : true,\n\n // Additional information that are added to the `settings` object :\n //TODO Find a way to exclude those internal data from the settings object (ideally by using another object, or better yet, class attributes) -->\n allowedAutoStrip : true,\n isNegativeSignAllowed : true,\n isPositiveSignAllowed : true,\n mIntNeg : true,\n mIntPos : true,\n numRegAutoStrip : true,\n originalDecimalPlaces : true,\n originalDecimalPlacesRawValue : true,\n stripReg : true,\n };\n\n for (const option in options) {\n if (options.hasOwnProperty(option)) {\n if (oldOptionsConverter[option] === true) {\n // If the option is a 'new' option, we continue looping\n continue;\n }\n\n if (oldOptionsConverter.hasOwnProperty(option)) {\n // Else we have an 'old' option name\n AutoNumericHelper.warning(`You are using the deprecated option name '${option}'. Please use '${oldOptionsConverter[option]}' instead from now on. The old option name will be dropped very soon™.`, true);\n\n // Then we modify the initial option object to use the new options instead of the old ones\n options[oldOptionsConverter[option]] = options[option];\n delete options[option];\n } else if (options.failOnUnknownOption) {\n // ...or the option name is unknown. This means there is a problem with the options object, therefore we throw an error.\n AutoNumericHelper.throwError(`Option name '${option}' is unknown. Please fix the options passed to autoNumeric`);\n }\n }\n }\n\n if ('mDec' in options) {\n AutoNumericHelper.warning('The old `mDec` option has been deprecated in favor of more accurate options ; `decimalPlaces`, `decimalPlacesRawValue`, `decimalPlacesShownOnFocus` and `decimalPlacesShownOnBlur`.', true);\n }\n }\n\n /**\n * Analyse the settings/options passed by the user, validate and clean them, then set them into `this.settings`.\n * Note: This sets the settings to `null` if somehow the settings objet is undefined or empty\n * If only `decimalPlaces` is defined in the option, overwrite the other decimalPlaces* options, otherwise, use those options\n *\n * @param {object} options\n * @param {boolean} update - If set to `true`, then the settings already exists and this function only updates them instead of recreating them from scratch\n * @throws\n */\n _setSettings(options, update = false) {\n // If the user used old options, we convert them to new ones\n if (update || !AutoNumericHelper.isNull(options)) {\n this.constructor._convertOldOptionsToNewOnes(options);\n }\n\n if (update) {\n // The settings are updated\n // Update the original data, if it has changed\n const decimalPlacesRawValueInOptions = 'decimalPlacesRawValue' in options;\n if (decimalPlacesRawValueInOptions) {\n this.settings.originalDecimalPlacesRawValue = options.decimalPlacesRawValue;\n }\n\n const decimalPlacesInOptions = 'decimalPlaces' in options;\n if (decimalPlacesInOptions) {\n this.settings.originalDecimalPlaces = options.decimalPlaces;\n }\n\n // Then update all the `decimalPlaces*` options\n this.constructor._calculateDecimalPlacesOnUpdate(options, this.settings);\n\n // Finally generate the updated settings object to use\n this._mergeSettings(options); //TODO Check that the `styleRules` option is correctly cloned (due to depth cloning limitation)\n } else {\n // The settings are generated for the first time\n this.settings = {};\n // If we couldn't grab any settings, create them from the default ones and combine them with the options passed as a parameter as well as with the HTML5 `data-*` info (via `this.domElement.dataset`), if any.\n this._mergeSettings(this.constructor.getDefaultConfig(), this.domElement.dataset, options, { rawValue : this.defaultRawValue });\n this.caretFix = false;\n this.throwInput = true; // Throw input event\n this.allowedTagList = AutoNumericEnum.allowedTagList;\n this.runOnce = false;\n this.hoveredWithAlt = false; // Keep tracks if the current AutoNumeric element is hovered by the mouse cursor while `Alt` is pressed\n }\n\n // Modify the user settings to make them 'exploitable'\n this._transformOptionsValuesToDefaultTypes();\n\n // Immediately run the callbacks that could update the settings object\n this._runCallbacksFoundInTheSettingsObject();\n\n // Improve the `negativePositiveSignPlacement` option if needed\n this.constructor._correctNegativePositiveSignPlacementOption(this.settings);\n\n // Set the `caretPositionOnFocus` and `selectOnFocus` options so that they do not conflict, if one of those have been set manually by the user.\n // If order to check that, we take a look at the original options the user passed as an argument, not `this.settings` that have been merged with the default settings. //TODO Check the validity of that comment\n this.constructor._correctCaretPositionOnFocusAndSelectOnFocusOptions(this.settings);\n\n // Define if the negative or positive signs are allowed\n this.constructor._setNegativePositiveSignPermissions(this.settings);\n\n // Calculate the number of decimal places (during the element initialization)\n if (!update) {\n // Make sure the `originalDecimalPlaces` info is set\n if (AutoNumericHelper.isNull(options) || !options.decimalPlaces) {\n this.settings.originalDecimalPlaces = null;\n } else {\n this.settings.originalDecimalPlaces = options.decimalPlaces;\n }\n\n // Save the `originalDecimalPlacesRawValue` info\n this.settings.originalDecimalPlacesRawValue = this.settings.decimalPlacesRawValue;\n\n // Then update all the `decimalPlaces*` options\n this.constructor._calculateDecimalPlacesOnInit(this.settings);\n }\n\n // Additional changes to the settings object\n this._calculateVMinAndVMaxIntegerSizes();\n this._setTrailingNegativeSignInfo();\n this.regex = {}; // Create the object that will store the regular expressions\n this.constructor._cachesUsualRegularExpressions(this.settings, this.regex);\n this._setBrackets();\n this._calculateValuesToStringsKeys();\n\n // Validate the settings. Both tests throws if necessary.\n if (AutoNumericHelper.isEmptyObj(this.settings)) {\n AutoNumericHelper.throwError('Unable to set the settings, those are invalid ; an empty object was given.');\n }\n\n this.constructor.validate(this.settings, false, options);\n\n // Original settings saved for use when decimalPlacesShownOnFocus, divisorWhenUnfocused & showOnlyNumbersOnFocus options are being used\n this._keepAnOriginalSettingsCopy();\n }\n\n /**\n * Define if the negative or positive signs are allowed, and update the given settings object directly.\n *\n * @param {object} settings\n * @private\n */\n static _setNegativePositiveSignPermissions(settings) {\n settings.isNegativeSignAllowed = settings.minimumValue < 0;\n settings.isPositiveSignAllowed = settings.maximumValue >= 0;\n }\n\n /**\n * Convert the `value` parameter that can either be :\n * - a real number,\n * - a number represented in the scientific notation (ie. -123.4567e-6)\n * - a string representing a real number, or\n * - a string representing a localized number (with specific group separators and decimal character),\n * ...to a string representing a real 'javascript' number (ie. '1234' or '1234.567').\n *\n * This function returns `NaN` if such conversion fails.\n *\n * @param {int|float|string} value\n * @param {object} settings\n * @returns {string|NaN}\n */\n static _toNumericValue(value, settings) {\n //XXX Note; this function is static since we need to pass a `settings` object when calling the static `AutoNumeric.format()` method\n let result;\n if (AutoNumericHelper.isNumber(Number(value))) {\n // The value has either already been stripped, or a 'real' javascript number is passed as a parameter\n result = AutoNumericHelper.scientificToDecimal(value);\n } else {\n // Else if it's a string that `Number()` cannot typecast, then we try to convert the localized numeric string to a numeric one\n // Convert the value to a numeric string, stripping unnecessary characters in the process\n result = this._convertToNumericString(value.toString(), settings);\n\n // If the result is still not a numeric string, then we throw a warning\n if (!AutoNumericHelper.isNumber(Number(result))) {\n AutoNumericHelper.warning(`The given value \"${value}\" cannot be converted to a numeric one and therefore cannot be used appropriately.`, settings.showWarnings);\n result = NaN;\n }\n }\n\n return result;\n }\n\n /**\n * Return the pasted text that will be used, by stripping most non-numeric characters\n *\n * @param {string} text\n * @returns {string}\n */\n _preparePastedText(text) {\n return this.constructor._stripAllNonNumberCharacters(text, this.settings, true, this.isFocused);\n }\n\n /**\n * Return TRUE if the given value (a number as a string) is within the range set in the settings `minimumValue` and `maximumValue`, FALSE otherwise.\n *\n * @param {string} value\n * @param {object} parsedMinValue Parsed via the `parseStr()` function\n * @param {object} parsedMaxValue Parsed via the `parseStr()` function\n * @returns {boolean}\n */\n static _checkIfInRange(value, parsedMinValue, parsedMaxValue) {\n const parsedValue = AutoNumericHelper.parseStr(value);\n return AutoNumericHelper.testMinMax(parsedMinValue, parsedValue) > -1 && AutoNumericHelper.testMinMax(parsedMaxValue, parsedValue) < 1;\n }\n\n /**\n * Update the selection values as well as resets the internal state of the current AutoNumeric object.\n * This keeps tracks of the current selection and resets the 'processed' state.\n *\n * Note : This state can change between the keydown, keypress and keyup events, that's why\n * this function is called on each event handler.\n *\n * @private\n */\n _updateInternalProperties() {\n this.selection = AutoNumericHelper.getElementSelection(this.domElement);\n this.processed = false;\n }\n\n /**\n * Update the `event.key` attribute that triggered the given event.\n *\n * `event.key` describes:\n * - the key name (if a non-printable character),\n * - or directly the character that result from the key press used to trigger the event.\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key\n * The key list is described here:\n * @link https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values\n *\n * @param {Event|KeyboardEvent} e\n * @private\n */\n _updateEventKeyInfo(e) {\n this.eventKey = AutoNumericHelper.character(e);\n }\n\n /**\n * Save the unformatted element value.\n * This is used in the 'cancellable' feature where the element value is saved on focus and input validation, to be used if the user wants to cancel his modifications by hitting the 'Escape' key.\n *\n * @private\n */\n _saveCancellableValue() {\n this.savedCancellableValue = this.rawValue;\n }\n\n /**\n * Set the text selection inside the input with the given start and end position.\n *\n * @param {int} start\n * @param {int} end\n * @private\n */\n _setSelection(start, end) {\n //TODO use this function to replace the direct calls to `setElementSelection()`, wherever possible\n start = Math.max(start, 0);\n end = Math.min(end, AutoNumericHelper.getElementValue(this.domElement).length);\n this.selection = {\n start,\n end,\n length: end - start,\n };\n\n AutoNumericHelper.setElementSelection(this.domElement, start, end);\n }\n\n /**\n * Set the caret position inside the input at the given position.\n *\n * @param {int} position\n * @private\n */\n _setCaretPosition(position) {\n this._setSelection(position, position);\n }\n\n /**\n * Return an array containing the string parts located on the left and right side of the caret or selection.\n * Those parts are left 'untouched', ie. formatted by autoNumeric.\n *\n * @returns {[string, string]} The parts on the left and right of the caret or selection\n * @private\n */\n _getLeftAndRightPartAroundTheSelection() {\n const value = AutoNumericHelper.getElementValue(this.domElement);\n const left = value.substring(0, this.selection.start);\n const right = value.substring(this.selection.end, value.length);\n\n return [left, right];\n }\n\n /**\n * Return an array containing the string parts located on the left and right side of the caret or selection.\n * Those parts are unformatted (stripped) of any non-numbers characters, and any trailing negative character is put back on the left hand side of the number.\n *\n * @returns {[string, string]} The parts on the left and right of the caret or selection, unformatted.\n * @private\n */\n _getUnformattedLeftAndRightPartAroundTheSelection() {\n let [left, right] = this._getLeftAndRightPartAroundTheSelection();\n if (left === '' && right === '') {\n return ['', ''];\n }\n\n // If changing the sign and `left` is equal to the number zero, prevent stripping the leading zero(s)\n let stripZeros = true;\n if ((this.eventKey === AutoNumericEnum.keyName.Hyphen || this.eventKey === AutoNumericEnum.keyName.Minus) && Number(left) === 0) {\n stripZeros = false;\n }\n\n //TODO DRY that with `_normalizeParts()` -->\n if (this.isTrailingNegative &&\n ((AutoNumericHelper.isNegative(right, this.settings.negativeSignCharacter) && // The caret is placed on the left of the negative sign\n !AutoNumericHelper.isNegative(left, this.settings.negativeSignCharacter)) ||\n (right === '' && // ..or the caret is placed on the far right of the input (Fix issue #481)\n AutoNumericHelper.isNegative(left, this.settings.negativeSignCharacter, true)))) {\n left = left.replace(this.settings.negativeSignCharacter, '');\n right = right.replace(this.settings.negativeSignCharacter, '');\n // This is done here because `_getUnformattedLeftAndRightPartAroundTheSelection()` is called multiple times during the same key event, and at one point the left/right value has been normalized already..\n left = left.replace('-', '');\n right = right.replace('-', '');\n\n // Then finally set back the normalized minus character at the right place\n left = `-${left}`;\n }\n\n left = AutoNumeric._stripAllNonNumberCharactersExceptCustomDecimalChar(left, this.settings, stripZeros, this.isFocused);\n right = AutoNumeric._stripAllNonNumberCharactersExceptCustomDecimalChar(right, this.settings, false, this.isFocused);\n\n return [left, right];\n }\n\n /**\n * Strip parts from excess characters and leading zeros.\n *\n * @param {string} left\n * @param {string} right\n * @returns {[*,*,*]}\n * @private\n */\n _normalizeParts(left, right) {\n //TODO Refactor with `_getUnformattedLeftAndRightPartAroundTheSelection` which share a lot of similar code\n // If changing the sign and left is equal to the number zero - prevents stripping the leading zeros\n let stripZeros = true;\n if ((this.eventKey === AutoNumericEnum.keyName.Hyphen || this.eventKey === AutoNumericEnum.keyName.Minus) && Number(left) === 0) {\n stripZeros = false;\n }\n\n if (this.isTrailingNegative &&\n AutoNumericHelper.isNegative(right, this.settings.negativeSignCharacter) &&\n !AutoNumericHelper.isNegative(left, this.settings.negativeSignCharacter)) {\n // Only set the negative sign if the value is negative\n left = `-${left}`;\n right = right.replace(this.settings.negativeSignCharacter, '');\n }\n\n left = AutoNumeric._stripAllNonNumberCharactersExceptCustomDecimalChar(left, this.settings, stripZeros, this.isFocused);\n right = AutoNumeric._stripAllNonNumberCharactersExceptCustomDecimalChar(right, this.settings, false, this.isFocused);\n\n // Prevents multiple leading zeros from being entered\n if (this.settings.leadingZero === AutoNumeric.options.leadingZero.deny &&\n (this.eventKey === AutoNumericEnum.keyName.num0 || this.eventKey === AutoNumericEnum.keyName.numpad0) &&\n Number(left) === 0 &&\n // If `right` is not empty and the first character is not `decimalCharacter`\n !AutoNumericHelper.contains(left, this.settings.decimalCharacter) && right !== '') {\n left = left.substring(0, left.length - 1);\n }\n\n // Insert zero there is a leading dot\n let newValue = left + right;\n if (this.settings.decimalCharacter) {\n const m = newValue.match(new RegExp(`^${this.regex.aNegRegAutoStrip}\\\\${this.settings.decimalCharacter}`));\n if (m) {\n left = left.replace(m[1], m[1] + '0');\n newValue = left + right;\n }\n }\n\n return [left, right, newValue];\n }\n\n /**\n * Set the formatted element value as well as the `rawValue`.\n * This returns `true` if the element and raw value have been modified, `false` otherwise.\n * This method also adjust the caret position according to the `leadingZero` option and the normalized value. //TODO What about the cursor *selection*?\n *\n * @param {string} left\n * @param {string} right\n * @param {boolean} isPaste\n * @returns {boolean}\n * @private\n */\n _setValueParts(left, right, isPaste = false) {\n const [normalizedLeft, normalizedRight, normalizedNewValue] = this._normalizeParts(left, right);\n const [minTest, maxTest] = AutoNumeric._checkIfInRangeWithOverrideOption(normalizedNewValue, this.settings);\n\n if (minTest && maxTest) {\n // First, set the raw value\n const roundedRawValue = AutoNumeric._truncateDecimalPlaces(normalizedNewValue, this.settings, isPaste, this.settings.decimalPlacesRawValue);\n const testValue = roundedRawValue.replace(this.settings.decimalCharacter, '.');\n\n if (testValue === '' || testValue === this.settings.negativeSignCharacter) {\n let valueToSetOnEmpty;\n switch (this.settings.emptyInputBehavior) {\n case AutoNumeric.options.emptyInputBehavior.zero:\n valueToSetOnEmpty = '0';\n break;\n case AutoNumeric.options.emptyInputBehavior.null:\n valueToSetOnEmpty = null;\n break;\n default :\n valueToSetOnEmpty = '';\n }\n\n this._setRawValue(valueToSetOnEmpty);\n } else {\n this._setRawValue(this._trimLeadingAndTrailingZeros(testValue));\n }\n\n // Then set the formatted value\n const roundedValueToShow = AutoNumeric._truncateDecimalPlaces(normalizedNewValue, this.settings, isPaste, this.settings.decimalPlacesShownOnFocus);\n let position = normalizedLeft.length;\n if (position > roundedValueToShow.length) {\n position = roundedValueToShow.length;\n }\n\n // Make sure when the user enter a '0' on the far left with a leading zero option set to 'deny', that the caret does not moves since the input is dropped (fix issue #283)\n if (position === 1 && normalizedLeft === '0' && this.settings.leadingZero === AutoNumeric.options.leadingZero.deny) {\n // If the user enter `0`, then the caret is put on the right side of it (Fix issue #299)\n if (normalizedRight === '' || normalizedLeft === '0' && normalizedRight !== '') {\n position = 1;\n } else {\n position = 0;\n }\n }\n\n this._setElementValue(roundedValueToShow, false);\n this._setCaretPosition(position);\n\n return true;\n }\n\n if (!minTest) {\n this._triggerEvent(AutoNumeric.events.minRangeExceeded, this.domElement);\n } else if (!maxTest) {\n this._triggerEvent(AutoNumeric.events.maxRangeExceeded, this.domElement);\n }\n\n return false;\n }\n\n /**\n * Helper function for `_expandSelectionOnSign()`.\n *\n * @returns {Array} Array containing [signPosition, currencySymbolPosition] of a formatted value\n * @private\n */\n _getSignPosition() {\n let result;\n if (this.settings.currencySymbol) {\n const currencySymbolLen = this.settings.currencySymbol.length;\n const value = AutoNumericHelper.getElementValue(this.domElement);\n if (this.settings.currencySymbolPlacement === AutoNumeric.options.currencySymbolPlacement.prefix) {\n const hasNeg = this.settings.negativeSignCharacter && value && value.charAt(0) === this.settings.negativeSignCharacter;\n if (hasNeg) {\n result = [1, currencySymbolLen + 1];\n } else {\n result = [0, currencySymbolLen];\n }\n } else {\n const valueLen = value.length;\n result = [valueLen - currencySymbolLen, valueLen];\n }\n } else {\n result = [1000, -1];\n }\n\n return result;\n }\n\n /**\n * Expands selection to cover whole sign\n * Prevents partial deletion/copying/overwriting of a sign\n * @private\n */\n _expandSelectionOnSign() {\n const [signPosition, currencySymbolPosition] = this._getSignPosition();\n const selection = this.selection;\n\n // If selection catches something except sign and catches only space from sign\n if (selection.start < currencySymbolPosition && selection.end > signPosition) {\n // Then select without empty space\n if ((selection.start < signPosition || selection.end > currencySymbolPosition) &&\n AutoNumericHelper.getElementValue(this.domElement).substring(Math.max(selection.start, signPosition), Math.min(selection.end, currencySymbolPosition))\n .match(/^\\s*$/)) {\n if (selection.start < signPosition) {\n this._setSelection(selection.start, signPosition);\n } else {\n this._setSelection(currencySymbolPosition, selection.end);\n }\n } else {\n // Else select with whole sign\n this._setSelection(Math.min(selection.start, signPosition), Math.max(selection.end, currencySymbolPosition));\n }\n }\n }\n\n /**\n * Try to strip pasted value to digits\n */\n _checkPaste() {\n // Do not process anything if the value has already been formatted\n if (this.formatted) {\n return;\n }\n\n if (!AutoNumericHelper.isUndefined(this.valuePartsBeforePaste)) {\n const oldParts = this.valuePartsBeforePaste;\n const [left, right] = this._getLeftAndRightPartAroundTheSelection();\n\n // Try to strip the pasted value first\n delete this.valuePartsBeforePaste;\n\n const modifiedLeftPart = left.substr(0, oldParts[0].length) + AutoNumeric._stripAllNonNumberCharactersExceptCustomDecimalChar(left.substr(oldParts[0].length), this.settings, true, this.isFocused);\n if (!this._setValueParts(modifiedLeftPart, right, true)) {\n this._setElementValue(oldParts.join(''), false);\n this._setCaretPosition(oldParts[0].length);\n }\n }\n }\n\n /**\n * Return `true` if the given key should be ignored or not.\n *\n * @param {string} eventKeyName\n * @returns {boolean}\n * @private\n */\n static _shouldSkipEventKey(eventKeyName) {\n const isFnKeys = AutoNumericHelper.isInArray(eventKeyName, AutoNumericEnum.keyName._allFnKeys);\n const isOSKeys = eventKeyName === AutoNumericEnum.keyName.OSLeft || eventKeyName === AutoNumericEnum.keyName.OSRight;\n const isContextMenu = eventKeyName === AutoNumericEnum.keyName.ContextMenu;\n const isSomeNonPrintableKeys = AutoNumericHelper.isInArray(eventKeyName, AutoNumericEnum.keyName._someNonPrintableKeys);\n const isOtherNonPrintableKeys = eventKeyName === AutoNumericEnum.keyName.NumLock ||\n eventKeyName === AutoNumericEnum.keyName.ScrollLock ||\n eventKeyName === AutoNumericEnum.keyName.Insert ||\n eventKeyName === AutoNumericEnum.keyName.Command;\n const isUnrecognizableKeys = eventKeyName === AutoNumericEnum.keyName.Unidentified;\n\n return isFnKeys || isOSKeys || isContextMenu || isSomeNonPrintableKeys || isUnrecognizableKeys || isOtherNonPrintableKeys;\n }\n\n /**\n * Process copying, cutting and pasting, as well as undo/redoing and cursor moving.\n * Return `true` if further processing should not be performed.\n *\n * @param {KeyboardEvent} e\n * @returns {boolean}\n * @private\n */\n _processNonPrintableKeysAndShortcuts(e) {\n // Catch the ctrl up on ctrl-v\n if (((e.ctrlKey || e.metaKey) && e.type === 'keyup' && !AutoNumericHelper.isUndefined(this.valuePartsBeforePaste)) || (e.shiftKey && this.eventKey === AutoNumericEnum.keyName.Insert)) {\n //TODO Move this test inside the `onKeyup` handler\n this._checkPaste();\n\n return false;\n }\n\n // Skip all function keys (F1-F12), Windows keys, tab and other special keys\n if (this.constructor._shouldSkipEventKey(this.eventKey)) {\n return true;\n }\n\n // If a \"Select all\" keyboard shortcut is detected (ctrl + a)\n if ((e.ctrlKey || e.metaKey) && this.eventKey === AutoNumericEnum.keyName.a) {\n if (this.settings.selectNumberOnly) {\n // `preventDefault()` is used here to prevent the browser to first select all the input text (including the currency sign), otherwise we would see that whole selection first in a flash, then the selection with only the number part without the currency sign.\n e.preventDefault();\n //TODO replace `selectNumber` by `select`?\n this.selectNumber();\n }\n\n return true;\n }\n\n // If a \"Copy\", \"Paste\" or \"Cut\" keyboard shortcut is detected (respectively 'ctrl + c', 'ctrl + v' or 'ctrl + x')\n if ((e.ctrlKey || e.metaKey) &&\n (this.eventKey === AutoNumericEnum.keyName.c ||\n this.eventKey === AutoNumericEnum.keyName.v ||\n this.eventKey === AutoNumericEnum.keyName.x)) {\n if (e.type === 'keydown') {\n this._expandSelectionOnSign();\n }\n\n // Try to prevent wrong paste\n if (this.eventKey === AutoNumericEnum.keyName.v || this.eventKey === AutoNumericEnum.keyName.Insert) {\n if (e.type === 'keydown' || e.type === 'keypress') {\n if (AutoNumericHelper.isUndefined(this.valuePartsBeforePaste)) {\n this.valuePartsBeforePaste = this._getLeftAndRightPartAroundTheSelection();\n }\n } else {\n this._checkPaste();\n }\n }\n\n return e.type === 'keydown' || e.type === 'keypress' || this.eventKey === AutoNumericEnum.keyName.c;\n }\n\n\n // The undo shortcut\n if (e.ctrlKey || e.metaKey) {\n if (this.eventKey === AutoNumericEnum.keyName.Z || this.eventKey === AutoNumericEnum.keyName.z) {\n return false;\n } else {\n return true;\n }\n }\n\n // Jump over the thousand separator\n //TODO Move this test inside the `onKeydown` handler\n if (this.eventKey === AutoNumericEnum.keyName.LeftArrow || this.eventKey === AutoNumericEnum.keyName.RightArrow) {\n if (e.type === 'keydown' && !e.shiftKey) {\n const value = AutoNumericHelper.getElementValue(this.domElement);\n if (this.eventKey === AutoNumericEnum.keyName.LeftArrow &&\n (value.charAt(this.selection.start - 2) === this.settings.digitGroupSeparator ||\n value.charAt(this.selection.start - 2) === this.settings.decimalCharacter)) {\n this._setCaretPosition(this.selection.start - 1);\n } else if (this.eventKey === AutoNumericEnum.keyName.RightArrow &&\n (value.charAt(this.selection.start + 1) === this.settings.digitGroupSeparator ||\n value.charAt(this.selection.start + 1) === this.settings.decimalCharacter)) {\n this._setCaretPosition(this.selection.start + 1);\n }\n }\n\n return true;\n }\n\n return AutoNumericHelper.isInArray(this.eventKey, AutoNumericEnum.keyName._directionKeys);\n }\n\n /**\n * Process deletion of characters when the minus sign is to the right of the numeric characters.\n *\n * @param {string} left The part on the left of the caret or selection\n * @param {string} right The part on the right of the caret or selection\n * @returns {[string, string]}\n * @private\n */\n _processCharacterDeletionIfTrailingNegativeSign([left, right]) {\n const value = AutoNumericHelper.getElementValue(this.domElement);\n const isValNegative = AutoNumericHelper.isNegative(value, this.settings.negativeSignCharacter);\n\n if (this.settings.currencySymbolPlacement === AutoNumeric.options.currencySymbolPlacement.prefix && this.settings.negativePositiveSignPlacement === AutoNumeric.options.negativePositiveSignPlacement.suffix) {\n if (this.eventKey === AutoNumericEnum.keyName.Backspace) {\n this.caretFix = (this.selection.start >= value.indexOf(this.settings.suffixText) && this.settings.suffixText !== '');\n if (value.charAt(this.selection.start - 1) === '-') {\n left = left.substring(1);\n } else if (this.selection.start <= value.length - this.settings.suffixText.length) {\n left = left.substring(0, left.length - 1);\n }\n } else {\n this.caretFix = (this.selection.start >= value.indexOf(this.settings.suffixText) && this.settings.suffixText !== '');\n if (this.selection.start >= value.indexOf(this.settings.currencySymbol) + this.settings.currencySymbol.length) {\n right = right.substring(1, right.length);\n }\n if (AutoNumericHelper.isNegative(left, this.settings.negativeSignCharacter) && value.charAt(this.selection.start) === '-') {\n left = left.substring(1);\n }\n }\n }\n\n if (this.settings.currencySymbolPlacement === AutoNumeric.options.currencySymbolPlacement.suffix) {\n switch (this.settings.negativePositiveSignPlacement) {\n case AutoNumeric.options.negativePositiveSignPlacement.left:\n this.caretFix = (this.selection.start >= value.indexOf(this.settings.negativeSignCharacter) + this.settings.negativeSignCharacter.length);\n if (this.eventKey === AutoNumericEnum.keyName.Backspace) {\n if (this.selection.start === (value.indexOf(this.settings.negativeSignCharacter) + this.settings.negativeSignCharacter.length) && isValNegative) {\n left = left.substring(1);\n } else if (left !== '-' && ((this.selection.start <= value.indexOf(this.settings.negativeSignCharacter)) || !isValNegative)) {\n left = left.substring(0, left.length - 1);\n }\n } else {\n if (left[0] === '-') {\n right = right.substring(1);\n }\n if (this.selection.start === value.indexOf(this.settings.negativeSignCharacter) && isValNegative) {\n left = left.substring(1);\n }\n }\n break;\n case AutoNumeric.options.negativePositiveSignPlacement.right:\n this.caretFix = (this.selection.start >= value.indexOf(this.settings.negativeSignCharacter) + this.settings.negativeSignCharacter.length);\n if (this.eventKey === AutoNumericEnum.keyName.Backspace) {\n if (this.selection.start === (value.indexOf(this.settings.negativeSignCharacter) + this.settings.negativeSignCharacter.length)) {\n left = left.substring(1);\n } else if (left !== '-' && this.selection.start <= (value.indexOf(this.settings.negativeSignCharacter) - this.settings.currencySymbol.length)) {\n left = left.substring(0, left.length - 1);\n } else if (left !== '' && !isValNegative) {\n left = left.substring(0, left.length - 1);\n }\n } else {\n this.caretFix = (this.selection.start >= value.indexOf(this.settings.currencySymbol) && this.settings.currencySymbol !== '');\n if (this.selection.start === value.indexOf(this.settings.negativeSignCharacter)) {\n left = left.substring(1);\n }\n\n right = right.substring(1);\n }\n break;\n }\n }\n\n return [left, right];\n }\n\n /**\n * Process the deletion of characters.\n */\n _processCharacterDeletion() {\n let left;\n let right;\n\n if (!this.selection.length) {\n [left, right] = this._getUnformattedLeftAndRightPartAroundTheSelection();\n if (left === '' && right === '') {\n this.throwInput = false;\n }\n\n if (this.isTrailingNegative && AutoNumericHelper.isNegative(AutoNumericHelper.getElementValue(this.domElement), this.settings.negativeSignCharacter)) {\n [left, right] = this._processCharacterDeletionIfTrailingNegativeSign([left, right]);\n } else {\n if (this.eventKey === AutoNumericEnum.keyName.Backspace) {\n left = left.substring(0, left.length - 1);\n } else {\n right = right.substring(1, right.length);\n }\n }\n } else {\n this._expandSelectionOnSign();\n [left, right] = this._getUnformattedLeftAndRightPartAroundTheSelection();\n }\n\n this._setValueParts(left, right);\n }\n\n /**\n * Return `true` if a decimal character is allowed to be typed.\n * If the number of decimal places shown on focus is zero, then the decimal character is not allowed.\n *\n * @returns {boolean}\n * @private\n */\n _isDecimalCharacterInsertionAllowed() {\n return String(this.settings.decimalPlacesShownOnFocus) !== String(AutoNumeric.options.decimalPlacesShownOnFocus.none) &&\n String(this.settings.decimalPlaces) !== String(AutoNumeric.options.decimalPlaces.none);\n }\n\n /**\n * Return `true` if the key is allowed.\n * This function decides if the key pressed should be dropped or accepted, and modify the value 'on-the-fly' accordingly.\n * //TODO This should use another function in order to separate the test and the modification\n *\n * @returns {boolean}\n */\n _processCharacterInsertion() {\n let [left, right] = this._getUnformattedLeftAndRightPartAroundTheSelection();\n if (this.eventKey !== AutoNumericEnum.keyName.AndroidDefault) {\n this.throwInput = true;\n }\n\n // Start rules when the decimal character key is pressed always use numeric pad dot to insert decimal separator\n // Do not allow decimal character if no decimal part allowed\n if (this.eventKey === this.settings.decimalCharacter ||\n (this.settings.decimalCharacterAlternative && this.eventKey === this.settings.decimalCharacterAlternative)) {\n if (!this._isDecimalCharacterInsertionAllowed() || !this.settings.decimalCharacter) {\n return false;\n }\n\n // Do not allow decimal character before negativeSignCharacter character\n if (this.settings.negativeSignCharacter && AutoNumericHelper.contains(right, this.settings.negativeSignCharacter)) {\n return true;\n }\n\n // Do not allow a decimal character if another decimal character is already present\n if (AutoNumericHelper.contains(left, this.settings.decimalCharacter)) {\n return true;\n }\n\n if (right.indexOf(this.settings.decimalCharacter) > 0) {\n return true;\n }\n\n if (right.indexOf(this.settings.decimalCharacter) === 0) {\n right = right.substr(1);\n }\n\n this._setValueParts(left + this.settings.decimalCharacter, right);\n\n return true;\n }\n\n // Prevent entering the minus sign if it's not allowed (Note: `this.settings.isNegativeSignAllowed` is only set to `true` if the minimumValue is lower than zero, allowing negative numbers to be entered)\n if ((this.eventKey === '-' || this.eventKey === '+') && this.settings.isNegativeSignAllowed) {\n // Here, the left and right parts have been normalized already, hence the minus sign usage\n if (left === '' && AutoNumericHelper.contains(right, '-')) {\n // The value is originally negative (with a trailing negative sign)\n right = right.replace('-', '');\n } else if (AutoNumericHelper.isNegative(left, '-')) {\n // The value is originally negative (with a leading negative sign)\n // Remove the negative sign, effectively converting the value to a positive one\n left = left.replace('-', ''); //TODO replace with '+' if `showPositiveSign` too?\n } else {\n // The value is originally positive, so we toggle the state to a negative one (unformatted, which means even with a trailing negative sign, we add the minus sign on the far left)\n left = `${this.settings.negativeSignCharacter}${left}`;\n }\n\n this._setValueParts(left, right);\n\n return true;\n }\n\n const eventNumber = Number(this.eventKey);\n if (eventNumber >= 0 && eventNumber <= 9) {\n // If the user tries to insert a digit\n if (this.settings.isNegativeSignAllowed && left === '' && AutoNumericHelper.contains(right, '-')) {\n // ...and that digit is before the minus sign\n left = '-';\n right = right.substring(1, right.length);\n }\n\n if (this.settings.maximumValue <= 0 &&\n this.settings.minimumValue < this.settings.maximumValue &&\n !AutoNumericHelper.contains(AutoNumericHelper.getElementValue(this.domElement), this.settings.negativeSignCharacter) &&\n this.eventKey !== '0') {\n left = `-${left}`;\n }\n\n this._setValueParts(`${left}${this.eventKey}`, right);\n\n return true;\n }\n\n // Prevent any other characters\n this.throwInput = false;\n\n return false;\n }\n\n /**\n * Formatting of just processed value while keeping the cursor position\n *\n * @param {Event} e\n * @private\n */\n _formatValue(e) {\n //TODO Break apart and simplify this really long function\n const elementValue = AutoNumericHelper.getElementValue(this.domElement);\n let [left] = this._getUnformattedLeftAndRightPartAroundTheSelection();\n\n // No grouping separator and no currency sign\n if ((this.settings.digitGroupSeparator === '' || (this.settings.digitGroupSeparator !== '' && !AutoNumericHelper.contains(elementValue, this.settings.digitGroupSeparator))) &&\n (this.settings.currencySymbol === '' || (this.settings.currencySymbol !== '' && !AutoNumericHelper.contains(elementValue, this.settings.currencySymbol)))) {\n let [subParts] = elementValue.split(this.settings.decimalCharacter);\n let negativeSign = '';\n if (AutoNumericHelper.isNegative(subParts, this.settings.negativeSignCharacter)) {\n negativeSign = this.settings.negativeSignCharacter;\n subParts = subParts.replace(this.settings.negativeSignCharacter, '');\n left = left.replace('-', ''); // Here we modify the unformatted value (with the 'normal' minus sign)\n }\n\n // Strip leading zero on positive value if needed\n if (negativeSign === '' && subParts.length > this.settings.mIntPos && left.charAt(0) === '0') {\n left = left.slice(1);\n }\n\n // Strip leading zero on negative value if needed\n if (negativeSign === this.settings.negativeSignCharacter && subParts.length > this.settings.mIntNeg && left.charAt(0) === '0') {\n left = left.slice(1);\n }\n\n if (!this.isTrailingNegative) { // Only add the minus sign if it's needed on that side of the numbers\n left = `${negativeSign}${left}`;\n }\n }\n\n const value = this.constructor._addGroupSeparators(elementValue, this.settings, this.isFocused, this.rawValue);\n let position = value.length;\n if (value) {\n // Prepare regexp which searches for cursor position from unformatted left part\n const leftAr = left.split('');\n\n // Fixes caret position with trailing minus sign\n if ((this.settings.negativePositiveSignPlacement === AutoNumeric.options.negativePositiveSignPlacement.suffix ||\n (this.settings.negativePositiveSignPlacement !== AutoNumeric.options.negativePositiveSignPlacement.prefix && this.settings.currencySymbolPlacement === AutoNumeric.options.currencySymbolPlacement.suffix)) &&\n leftAr[0] === this.settings.negativeSignCharacter && !this.settings.isNegativeSignAllowed) {\n leftAr.shift(); // Remove the negative sign character\n\n if ((this.eventKey === AutoNumericEnum.keyName.Backspace || this.eventKey === AutoNumericEnum.keyName.Delete) &&\n this.caretFix) {\n if ((this.settings.currencySymbolPlacement === AutoNumeric.options.currencySymbolPlacement.suffix && this.settings.negativePositiveSignPlacement === AutoNumeric.options.negativePositiveSignPlacement.left) ||\n (this.settings.currencySymbolPlacement === AutoNumeric.options.currencySymbolPlacement.prefix && this.settings.negativePositiveSignPlacement === AutoNumeric.options.negativePositiveSignPlacement.suffix)) {\n leftAr.push(this.settings.negativeSignCharacter);\n this.caretFix = e.type === 'keydown';\n }\n\n if (this.settings.currencySymbolPlacement === AutoNumeric.options.currencySymbolPlacement.suffix &&\n this.settings.negativePositiveSignPlacement === AutoNumeric.options.negativePositiveSignPlacement.right) {\n const signParts = this.settings.currencySymbol.split('');\n const escapeChr = ['\\\\', '^', '$', '.', '|', '?', '*', '+', '(', ')', '['];\n const escapedParts = [];\n signParts.forEach((i, miniParts) => {\n miniParts = signParts[i];\n if (AutoNumericHelper.isInArray(miniParts, escapeChr)) {\n escapedParts.push('\\\\' + miniParts);\n } else {\n escapedParts.push(miniParts);\n }\n });\n\n if (this.eventKey === AutoNumericEnum.keyName.Backspace && this.settings.negativeSignCharacter === '-') {\n escapedParts.push('-');\n }\n\n // Pushing the escaped sign\n leftAr.push(escapedParts.join(''));\n this.caretFix = e.type === 'keydown';\n }\n }\n }\n\n for (let i = 0; i < leftAr.length; i++) {\n if (!leftAr[i].match('\\\\d')) {\n leftAr[i] = '\\\\' + leftAr[i];\n }\n }\n\n const leftReg = new RegExp('^.*?' + leftAr.join('.*?'));\n\n // Search cursor position in formatted value\n const newLeft = value.match(leftReg);\n if (newLeft) {\n position = newLeft[0].length;\n\n // If the positive sign is shown, calculate the caret position accordingly\n if (this.settings.showPositiveSign) {\n if (position === 0 && newLeft.input.charAt(0) === this.settings.positiveSignCharacter) {\n position = (newLeft.input.indexOf(this.settings.currencySymbol) === 1) ? this.settings.currencySymbol.length + 1 : 1;\n }\n\n if (position === 0 && newLeft.input.charAt(this.settings.currencySymbol.length) === this.settings.positiveSignCharacter) {\n position = this.settings.currencySymbol.length + 1;\n }\n }\n\n // If we are just before the sign which is in prefix position\n if (((position === 0 && value.charAt(0) !== this.settings.negativeSignCharacter) || (position === 1 && value.charAt(0) === this.settings.negativeSignCharacter)) && this.settings.currencySymbol && this.settings.currencySymbolPlacement === AutoNumeric.options.currencySymbolPlacement.prefix) {\n // Place caret after prefix sign\n //TODO Should the test be 'isNegative' instead of 'isNegativeStrict' in order to search for '-' everywhere in the string?\n position = this.settings.currencySymbol.length + (AutoNumericHelper.isNegativeStrict(value, this.settings.negativeSignCharacter) ? 1 : 0);\n }\n } else {\n if (this.settings.currencySymbol && this.settings.currencySymbolPlacement === AutoNumeric.options.currencySymbolPlacement.suffix) {\n // If we could not find a place for cursor and have a sign as a suffix\n // Place caret before suffix currency sign\n position -= this.settings.currencySymbol.length;\n }\n\n if (this.settings.suffixText) {\n // If we could not find a place for cursor and have a suffix\n // Place caret before suffix\n position -= this.settings.suffixText.length;\n }\n }\n }\n\n // Only update the value if it has changed. This prevents modifying the selection, if any.\n if (value !== elementValue) {\n this._setElementValue(value, false);\n this._setCaretPosition(position);\n }\n\n this.formatted = true; //TODO Rename `this.formatted` to `this._formatExecuted`, since it's possible this function does not need to format anything (in the case where the keycode is dropped for instance)\n }\n\n /**\n * Serialize the form child <input> element values to a string, or an Array.\n * The output format is defined with the `formatType` argument.\n * This is loosely based upon http://stackoverflow.com/a/40705993/2834898.\n *\n * @param {HTMLFormElement} form\n * @param {boolean} intoAnArray If `true`, instead of generating a string, it generates an Array.\n * @param {string} formatType If `'unformatted'`, then the AutoNumeric elements values are unformatted, if `'localized'`, then the AutoNumeric elements values are localized, and if `'formatted'`, then the AutoNumeric elements values are kept formatted. In either way, this function does not modify the value of each DOM element, but only affect the value that is returned by that serialize function.\n * @param {string} serializedSpaceCharacter Can either be the '+' character, or the '%20' string.\n * @param {string|null} forcedOutputFormat If set, then this is the format that is used for the localization, instead of the default `outputFormat` option.\n * @returns {string|Array}\n * @private\n */\n static _serialize(form, intoAnArray = false, formatType = 'unformatted', serializedSpaceCharacter = '+', forcedOutputFormat = null) {\n const result = [];\n\n if (typeof form === 'object' && form.nodeName.toLowerCase() === 'form') {\n Array.prototype.slice.call(form.elements).forEach(element => {\n if (element.name &&\n !element.disabled &&\n ['file', 'reset', 'submit', 'button'].indexOf(element.type) === -1) {\n if (element.type === 'select-multiple') {\n Array.prototype.slice.call(element.options).forEach(option => {\n if (option.selected) {\n //TODO Should we unformat/format/localize the selection option (which be default should be read-only)?\n if (intoAnArray) {\n result.push({ name: element.name, value: option.value });\n } else { // into a string\n result.push(`${encodeURIComponent(element.name)}=${encodeURIComponent(option.value)}`);\n }\n }\n });\n } else if (['checkbox', 'radio'].indexOf(element.type) === -1 || element.checked) {\n let valueResult;\n if (this.isManagedByAutoNumeric(element)) {\n let anObject;\n switch (formatType) {\n case 'unformatted':\n anObject = this.getAutoNumericElement(element);\n if (!AutoNumericHelper.isNull(anObject)) {\n valueResult = this.unformat(element, anObject.getSettings());\n }\n\n break;\n case 'localized':\n anObject = this.getAutoNumericElement(element);\n if (!AutoNumericHelper.isNull(anObject)) {\n // Here I need to clone the setting object, otherwise I would modify it when changing the `outputFormat` option value\n const currentSettings = AutoNumericHelper.cloneObject(anObject.getSettings());\n if (!AutoNumericHelper.isNull(forcedOutputFormat)) {\n currentSettings.outputFormat = forcedOutputFormat;\n }\n\n valueResult = this.localize(element, currentSettings);\n }\n\n break;\n case 'formatted':\n default:\n valueResult = element.value;\n }\n } else {\n valueResult = element.value;\n }\n\n if (AutoNumericHelper.isUndefined(valueResult)) {\n AutoNumericHelper.throwError('This error should never be hit. If it has, something really wrong happened!');\n }\n\n if (intoAnArray) {\n result.push({ name: element.name, value: valueResult });\n } else { // into a string\n result.push(`${encodeURIComponent(element.name)}=${encodeURIComponent(valueResult)}`);\n }\n }\n }\n });\n }\n\n let finalResult;\n\n if (intoAnArray) {\n // Result as an Array\n // Note: `serializedSpaceCharacter` does not affect the array result since we do not change the space character for this one\n finalResult = result;\n } else {\n // Result as a string\n finalResult = result.join('&');\n\n if ('+' === serializedSpaceCharacter) {\n finalResult = finalResult.replace(/%20/g, '+');\n }\n }\n\n return finalResult;\n }\n\n /**\n * Serialize the form values to a string, outputting numeric strings for each AutoNumeric-managed element values.\n *\n * @param {HTMLFormElement} form\n * @param {string} serializedSpaceCharacter\n * @returns {string}\n */\n static _serializeNumericString(form, serializedSpaceCharacter = '+') {\n return this._serialize(form, false, 'unformatted', serializedSpaceCharacter);\n }\n\n /**\n * Serialize the form values to a string, outputting the formatted value as strings for each AutoNumeric-managed elements.\n *\n * @param {HTMLFormElement} form\n * @param {string} serializedSpaceCharacter\n * @returns {string}\n */\n static _serializeFormatted(form, serializedSpaceCharacter = '+') {\n return this._serialize(form, false, 'formatted', serializedSpaceCharacter);\n }\n\n /**\n * Serialize the form values to a string, outputting localized strings for each AutoNumeric-managed element values.\n *\n * @param {HTMLFormElement} form\n * @param {string} serializedSpaceCharacter\n * @param {string|null} forcedOutputFormat If set, then this is the format that is used for the localization, instead of the default `outputFormat` option.\n * @returns {string}\n */\n static _serializeLocalized(form, serializedSpaceCharacter = '+', forcedOutputFormat = null) {\n return this._serialize(form, false, 'localized', serializedSpaceCharacter, forcedOutputFormat);\n }\n\n /**\n * Generate an Array with the form values, outputting numeric strings for each AutoNumeric-managed element values.\n *\n * @param {HTMLFormElement} form\n * @param {string} serializedSpaceCharacter\n * @returns {Array}\n */\n static _serializeNumericStringArray(form, serializedSpaceCharacter = '+') {\n return this._serialize(form, true, 'unformatted', serializedSpaceCharacter);\n }\n\n /**\n * Generate an Array with the form values, outputting the formatted value as strings for each AutoNumeric-managed elements.\n *\n * @param {HTMLFormElement} form\n * @param {string} serializedSpaceCharacter\n * @returns {Array}\n */\n static _serializeFormattedArray(form, serializedSpaceCharacter = '+') {\n return this._serialize(form, true, 'formatted', serializedSpaceCharacter);\n }\n\n /**\n * Generate an Array with the form values, outputting localized strings for each AutoNumeric-managed element values.\n *\n * @param {HTMLFormElement} form\n * @param {string} serializedSpaceCharacter\n * @param {string|null} forcedOutputFormat If set, then this is the format that is used for the localization, instead of the default `outputFormat` option.\n * @returns {Array}\n */\n static _serializeLocalizedArray(form, serializedSpaceCharacter = '+', forcedOutputFormat = null) {\n return this._serialize(form, true, 'localized', serializedSpaceCharacter, forcedOutputFormat);\n }\n}\n\n/**\n * Initialize multiple DOM elements in one call (and possibly pass multiple values that will be mapped to each DOM element).\n *\n * @example\n * // Init multiple DOM elements in one call (and possibly pass multiple values that will be mapped to each DOM element)\n * [anElement1, anElement2, anElement3] = AutoNumeric.multiple([domElement1, domElement2, domElement3], { options });\n * [anElement1, anElement2, anElement3] = AutoNumeric.multiple([domElement1, domElement2, domElement3], [{ options }, 'euroPos']);\n * [anElement1, anElement2, anElement3] = AutoNumeric.multiple([domElement1, domElement2, domElement3], 12345.789, { options });\n * [anElement1, anElement2, anElement3] = AutoNumeric.multiple([domElement1, domElement2, domElement3], 12345.789, [{ options }, 'euroPos']);\n * [anElement1, anElement2, anElement3] = AutoNumeric.multiple.french([domElement1, domElement2, domElement3], [12345.789, 234.78, null], { options });\n * [anElement1, anElement2, anElement3] = AutoNumeric.multiple.french([domElement1, domElement2, domElement3], [12345.789, 234.78, null], [{ options }, 'euroPos']);\n *\n * // Special case, if a <form> element is passed (or any other 'parent' (or 'root') DOM element), then autoNumeric will initialize each child `<input>` elements recursively, ignoring those referenced in the `exclude` attribute\n * [anElement1, anElement2] = AutoNumeric.multiple({ rootElement: formElement }, { options });\n * [anElement1, anElement2] = AutoNumeric.multiple({ rootElement: formElement, exclude : [hiddenElement, tokenElement] }, { options });\n * [anElement1, anElement2] = AutoNumeric.multiple({ rootElement: formElement, exclude : [hiddenElement, tokenElement] }, [12345.789, null], { options });\n *\n * // If you want to select multiple elements via a css selector, then you must use the `multiple` function. Under the hood `QuerySelectorAll` is used.\n * [anElement1, anElement2] = AutoNumeric.multiple('.myCssClass > input', { options }); // This always return an Array, even if there is only one element selected\n * [anElement1, anElement2] = AutoNumeric.multiple('.myCssClass > input', [null, 12345.789], { options }); // Idem above, but with passing the initial values too\n *\n * @param {string|Array|{ rootElement: HTMLElement }|{ rootElement: HTMLElement, exclude: Array<HTMLInputElement>}} arg1\n * @param {number|Array|object|null} initialValue\n * @param {object|Array|null} options\n * @returns {Array}\n */\nAutoNumeric.multiple = (arg1, initialValue = null, options = null) => {\n const result = [];\n\n // Analyze the arguments and transform them to make them exploitable\n if (AutoNumericHelper.isObject(initialValue)) {\n // If the user gave an option object as the second argument, instead of the initial values\n options = initialValue;\n initialValue = null;\n }\n\n if (AutoNumericHelper.isString(arg1)) {\n arg1 = [... document.querySelectorAll(arg1)]; // Convert a NodeList to an Array (cf. http://stackoverflow.com/a/37297292/2834898)\n } else if (AutoNumericHelper.isObject(arg1)) {\n if (!arg1.hasOwnProperty('rootElement')) {\n AutoNumericHelper.throwError(`The object passed to the 'multiple' function is invalid ; no 'rootElement' attribute found.`);\n }\n\n // Retrieve the DOM element list from the given <form> element\n const elements = [... arg1.rootElement.querySelectorAll('input')];\n if (arg1.hasOwnProperty('exclude')) {\n if (!Array.isArray(arg1.exclude)) {\n AutoNumericHelper.throwError(`The 'exclude' array passed to the 'multiple' function is invalid.`);\n }\n\n // Filter out the excluded elements\n arg1 = AutoNumericHelper.filterOut(elements, arg1.exclude);\n } else {\n arg1 = elements;\n }\n } else if (!AutoNumericHelper.isArray(arg1)) {\n AutoNumericHelper.throwError(`The given parameters to the 'multiple' function are invalid.`);\n }\n\n if (arg1.length === 0) {\n let showWarnings = true;\n if (!AutoNumericHelper.isNull(options) && AutoNumericHelper.isBoolean(options.showWarnings)) {\n showWarnings = options.showWarnings;\n }\n\n AutoNumericHelper.warning(`No valid DOM elements were given hence no AutoNumeric object were instantiated.`, showWarnings);\n\n return [];\n }\n\n // At this point, we know `arg1` is an array of DOM elements\n\n // This function can be initialized with two types of array, one for the initial values, and/or one for the options.\n // So we need to find out if an array is detected if the user passed an array of initial values, or an array of options\n // Therefore, we analyze the content of the arrays for the second and third arguments\n // ...for the second parameter :\n const isInitialValueArray = AutoNumericHelper.isArray(initialValue);\n const isInitialValueArrayAndNotEmpty = isInitialValueArray && initialValue.length >= 1;\n let secondArgumentIsInitialValueArray = false;\n let secondArgumentIsOptionArray = false;\n // Any of the arrays can be either an array of initial values, or an array of option object/pre-defined option names\n if (isInitialValueArrayAndNotEmpty) {\n const typeOfFirstArrayElement = typeof Number(initialValue[0]);\n // First we test the second argument\n secondArgumentIsInitialValueArray = typeOfFirstArrayElement === 'number' && !isNaN(Number(initialValue[0]));\n\n if (!secondArgumentIsInitialValueArray) {\n // If the second argument is an array, but not an array of values, check if it's instead an array of options/pre-defined option names\n if (typeOfFirstArrayElement === 'string' || isNaN(typeOfFirstArrayElement) || typeOfFirstArrayElement === 'object') {\n secondArgumentIsOptionArray = true;\n }\n }\n }\n\n // ...for the third parameter :\n const isOptionsArrayAndNotEmpty = AutoNumericHelper.isArray(options) && options.length >= 1;\n let thirdArgumentIsOptionArray = false;\n if (isOptionsArrayAndNotEmpty) {\n const typeOfFirstArrayElement = typeof options[0];\n if (typeOfFirstArrayElement === 'string' || typeOfFirstArrayElement === 'object') {\n // If the third argument is an array of options/pre-defined option names\n thirdArgumentIsOptionArray = true;\n }\n }\n\n // Depending of our findings, we generate the options variable to use `optionsToUse`, either directly, or merged\n let optionsToUse;\n if (secondArgumentIsOptionArray) {\n optionsToUse = AutoNumeric.mergeOptions(initialValue);\n } else if (thirdArgumentIsOptionArray) {\n optionsToUse = AutoNumeric.mergeOptions(options);\n } else {\n optionsToUse = options;\n }\n\n\n // Initialize the initial values\n const isInitialValueNumber = AutoNumericHelper.isNumber(initialValue);\n let initialValueArraySize;\n if (secondArgumentIsInitialValueArray) {\n initialValueArraySize = initialValue.length;\n }\n\n // Instantiate each AutoNumeric objects\n arg1.forEach((domElement, index) => {\n if (isInitialValueNumber) {\n // We set the same value for each elements\n result.push(new AutoNumeric(domElement, initialValue, optionsToUse));\n } else if (secondArgumentIsInitialValueArray && index <= initialValueArraySize) {\n result.push(new AutoNumeric(domElement, initialValue[index], optionsToUse));\n } else {\n result.push(new AutoNumeric(domElement, null, optionsToUse));\n }\n });\n\n return result;\n};\n\n/**\n * Polyfill for obsolete browsers like IE\n */\n(function() {\n// Polyfill for `CustomEvent` (cf. https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent)\nif (typeof window === 'undefined' || window.CustomEvent === 'function') {\n return false;\n}\n\nfunction CustomEvent(event, params) {\n params = params || { bubbles: false, cancelable: false, detail: void(0) };\n const evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\n return evt;\n}\n\nCustomEvent.prototype = window.Event.prototype;\nwindow.CustomEvent = CustomEvent;\n\n// Polyfill for `Array.from()` (Fix issue #495)\nif (!Array.from) {\n Array.from = object => [].slice.call(object);\n}\n})();\n","/**\n * Options for autoNumeric.js\n * @author Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>\n * @copyright © 2016 Alexandre Bonneau\n *\n * The MIT License (http://www.opensource.org/licenses/mit-license.php)\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sub license, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n\nimport AutoNumeric from './AutoNumeric';\n\n/**\n * Options values enumeration\n */\nObject.defineProperty(AutoNumeric, 'options', {\n get() {\n return {\n /* Defines if the decimal places should be padded with zeroes\n * `true` : always pad decimals with zeros (ie. '12.3400')\n * `false` : never pad with zeros (ie. '12.34')\n * `'floats'` : pad with zeroes only when there are decimals (ie. '12' and '12.3400')\n * Note: setting allowDecimalPadding to 'false' will override the 'decimalPlaces' setting.\n */\n allowDecimalPadding: {\n always: true,\n never : false,\n floats: 'floats',\n },\n\n /* Defines where should be positioned the caret on focus\n * null : Do not enforce any caret positioning on focus (this is needed when using `selectOnFocus`)\n * `'start'` : put the caret of the far left side of the value (excluding the positive/negative sign and currency symbol, if any)\n * `'end'` : put the caret of the far right side of the value (excluding the positive/negative sign and currency symbol, if any)\n * `'decimalLeft'` : put the caret of the left of the decimal character if any\n * `'decimalRight'` : put the caret of the right of the decimal character if any\n */\n caretPositionOnFocus: {\n start : 'start',\n end : 'end',\n decimalLeft : 'decimalLeft',\n decimalRight : 'decimalRight',\n doNoForceCaretPosition: null,\n },\n\n /* Defines if a local list of AutoNumeric objects should be kept when initializing this object.\n * This list is used by the `global.*` functions.\n */\n createLocalList: {\n createList : true,\n doNotCreateList: false,\n },\n\n /* Defines the currency symbol string.\n * It can be a string of more than one character (allowing for instance to use a space on either side of it, example: '$ ' or ' $')\n * cf. https://en.wikipedia.org/wiki/Currency_symbol\n */\n currencySymbol: {\n none : '',\n currencySign : '¤',\n austral : '₳', // ARA\n australCentavo: '¢',\n baht : '฿', // THB\n cedi : '₵', // GHS\n cent : '¢',\n colon : '₡', // CRC\n cruzeiro : '₢', // BRB - Not used anymore since 1993\n dollar : '$',\n dong : '₫', // VND\n drachma : '₯', // GRD (or 'Δρχ.' or 'Δρ.')\n dram : '֏', // AMD\n european : '₠', // XEU (old currency before the Euro)\n euro : '€', // EUR\n florin : 'ƒ',\n franc : '₣', // FRF\n guarani : '₲', // PYG\n hryvnia : '₴', // грн\n kip : '₭', // LAK\n att : 'ອັດ', // cents of the Kip\n lepton : 'Λ.', // cents of the Drachma\n lira : '₺', // TRY\n liraOld : '₤',\n lari : '₾', // GEL\n mark : 'ℳ',\n mill : '₥',\n naira : '₦', // NGN\n peseta : '₧',\n peso : '₱', // PHP\n pfennig : '₰', // cents of the Mark\n pound : '£',\n real : 'R$', // Brazilian real\n riel : '៛', // KHR\n ruble : '₽', // RUB\n rupee : '₹', // INR\n rupeeOld : '₨',\n shekel : '₪',\n shekelAlt : 'ש״ח',\n taka : '৳', // BDT\n tenge : '₸', // KZT\n togrog : '₮', // MNT\n won : '₩',\n yen : '¥',\n },\n\n /* Defines where the currency symbol should be placed (before of after the numbers)\n * for prefix currencySymbolPlacement: \"p\" (default)\n * for suffix currencySymbolPlacement: \"s\"\n */\n currencySymbolPlacement: {\n prefix: 'p',\n suffix: 's',\n },\n\n /* Defines what decimal separator character is used\n */\n decimalCharacter: {\n comma : ',',\n dot : '.',\n middleDot : '·',\n arabicDecimalSeparator : '٫',\n decimalSeparatorKeySymbol: '⎖',\n },\n\n /* Allow to declare an alternative decimal separator which is automatically replaced by `decimalCharacter` when typed.\n * This is used by countries that use a comma ',' as the decimal character and have keyboards with a numeric pads that have\n * a period 'full stop' as the decimal character (France or Spain for instance).\n */\n decimalCharacterAlternative: {\n none : null,\n comma: ',',\n dot : '.',\n },\n\n /* Defines the default number of decimal places to show on the formatted value, and keep for the precision.\n * Incidentally, since we need to be able to show that many decimal places, this also defines the raw value precision by default.\n */\n decimalPlaces: {\n none : 0,\n one : 1,\n two : 2,\n three: 3,\n four : 4,\n five : 5,\n six : 6,\n },\n\n /* Defines how many decimal places should be kept for the raw value (ie. This is the precision for float values).\n *\n * If this option is set to `null` (which is the default), then the value of `decimalPlaces` is used for `decimalPlacesRawValue` as well.\n * Note: Setting this to a lower number of decimal places than the one to be shown will lead to confusion for the users.\n */\n decimalPlacesRawValue: {\n useDefault: null,\n none : 0,\n one : 1,\n two : 2,\n three : 3,\n four : 4,\n five : 5,\n six : 6,\n },\n\n /* Defines how many decimal places should be visible when the element is unfocused.\n * If this is set to `null`, then this option is ignored, and the `decimalPlaces` option value will be used instead.\n * This means this is optional ; if omitted the decimal places will be the same when the input has the focus.\n *\n * This option can be used in conjonction with the two other `scale*` options, which allows to display a different formatted value when the element is unfocused, while another formatted value is shown when focused.\n * For those `scale*` options to have any effect, `divisorWhenUnfocused` must not be `null`.\n */\n decimalPlacesShownOnBlur: {\n useDefault: null,\n none : 0,\n one : 1,\n two : 2,\n three : 3,\n four : 4,\n five : 5,\n six : 6,\n },\n\n /* Defines how many decimal places should be visible when the element has the focus.\n * If this is set to `null`, then this option is ignored, and the `decimalPlaces` option value will be used instead.\n *\n * Example:\n * For instance if `decimalPlacesShownOnFocus` is set to `5` and the default number of decimal places is `2`, then on focus `1,000.12345` will be shown, while without focus `1,000.12` will be set back.\n * Note 1: the results depends on the rounding method used.\n * Note 2: the `getNumericString()` method returns the extended decimal places\n */\n decimalPlacesShownOnFocus: {\n useDefault: null,\n none : 0,\n one : 1,\n two : 2,\n three : 3,\n four : 4,\n five : 5,\n six : 6,\n },\n\n /* Helper option for ASP.NET postback\n * This should be set as the value of the unformatted default value\n * examples:\n * no default value=\"\" {defaultValueOverride: \"\"}\n * value=1234.56 {defaultValueOverride: '1234.56'}\n */\n defaultValueOverride: {\n doNotOverride: null,\n },\n\n /* Defines how many numbers should be grouped together (usually for the thousand separator)\n * - \"2\", results in 99,99,99,999 India's lakhs\n * - \"2s\", results in 99,999,99,99,999 India's lakhs scaled\n * - \"3\", results in 999,999,999 (default)\n * - \"4\", results in 9999,9999,9999 used in some Asian countries\n * Note: This option does not accept other grouping choice.\n */\n digitalGroupSpacing: {\n two : '2',\n twoScaled: '2s',\n three : '3',\n four : '4',\n },\n\n /* Defines the thousand grouping separator character\n * Example : If `'.'` is set, then you'll get `'1.234.567'`\n */\n digitGroupSeparator: {\n comma : ',',\n dot : '.',\n normalSpace : ' ',\n thinSpace : '\\u2009',\n narrowNoBreakSpace : '\\u202f',\n noBreakSpace : '\\u00a0',\n noSeparator : '',\n apostrophe : `'`,\n arabicThousandsSeparator: '٬',\n dotAbove : '˙',\n },\n\n /* The `divisorWhenUnfocused` divide the element value on focus.\n * On blur, the element value is multiplied back.\n *\n * Example : Display percentages using { divisorWhenUnfocused: 100 } (or directly in the Html with `<input data-divisor-when-unfocused=\"100\">`)\n * The divisor value does not need to be an integer, but please understand that Javascript has limited accuracy in math ; use with caution.\n * Note: The `getNumericString` method returns the full value, including the 'hidden' decimals.\n */\n divisorWhenUnfocused: {\n none : null,\n percentage: 100,\n permille : 1000,\n basisPoint: 10000,\n },\n\n /* Defines what should be displayed in the element if the raw value is an empty string ('').\n * - 'focus' : The currency sign is displayed when the input receives focus (default)\n * - 'press' : The currency sign is displayed whenever a key is being pressed\n * - 'always' : The currency sign is always displayed\n * - 'zero' : A zero is displayed ('rounded' with or without a currency sign) if the input has no value on focus out\n * - 'null' : When the element is empty, the `rawValue` and the element value/text is set to `null`. This also allows to set the value to `null` using `anElement.set(null)`.\n */\n emptyInputBehavior: {\n null : 'null',\n focus : 'focus',\n press : 'press',\n always: 'always',\n zero : 'zero',\n },\n\n /* Defines if the custom and native events triggered by AutoNumeric should bubble up or not.\n */\n eventBubbles: {\n bubbles: true,\n doesNotBubble: false,\n },\n\n /* Defines if the custom and native events triggered by AutoNumeric should be cancelable.\n */\n eventIsCancelable: {\n isCancelable: true,\n isNotCancelable: false,\n },\n\n /* This option is the 'strict mode' (aka 'debug' mode), which allows autoNumeric to strictly analyse the options passed, and fails if an unknown options is used in the settings object.\n * You should set that to `true` if you want to make sure you are only using 'pure' autoNumeric settings objects in your code.\n * If you see uncaught errors in the console and your code starts to fail, this means somehow those options gets polluted by another program (which usually happens when using frameworks).\n */\n failOnUnknownOption: {\n fail : true,\n ignore: false,\n },\n\n /* Determine if the default value will be formatted on initialization.\n */\n formatOnPageLoad: {\n format : true, // automatically formats the default value on initialization\n doNotFormat: false, // will not format the default value on initialization\n },\n\n /* Set the undo/redo history table size.\n * Each record keeps the raw value as well and the last known caret/selection positions.\n */\n historySize: {\n verySmall: 5,\n small : 10,\n medium : 20,\n large : 50,\n veryLarge: 100,\n insane : Number.MAX_SAFE_INTEGER,\n },\n\n /* Allow the user to 'cancel' and undo the changes he made to the given autonumeric-managed element, by pressing the 'Escape' key.\n * Whenever the user 'validate' the input (either by hitting 'Enter', or blurring the element), the new value is saved for subsequent 'cancellation'.\n *\n * The process :\n * - save the input value on focus\n * - if the user change the input value, and hit `Escape`, then the initial value saved on focus is set back\n * - on the other hand if the user either have used `Enter` to validate (`Enter` throws a change event) his entries, or if the input value has been changed by another script in the mean time, then we save the new input value\n * - on a successful 'cancel', select the whole value (while respecting the `selectNumberOnly` option)\n * - bonus; if the value has not changed, hitting 'Esc' just select all the input value (while respecting the `selectNumberOnly` option)\n */\n isCancellable: {\n cancellable : true,\n notCancellable: false,\n },\n\n /* Controls the leading zero behavior\n * - 'allow' : allows leading zeros to be entered. Zeros will be truncated when entering additional digits. On focusout zeros will be deleted\n * - 'deny' : allows only one leading zero on values that are between 1 and -1\n * - 'keep' : allows leading zeros to be entered. on focusout zeros will be retained\n */\n leadingZero: {\n allow: 'allow',\n deny : 'deny',\n keep : 'keep',\n },\n\n /* Defines the maximum possible value a user can enter.\n * Notes:\n * - this value must be a string and use the period for the decimal point\n * - this value needs to be larger than `minimumValue`\n */\n maximumValue: {\n tenTrillions : '9999999999999.99', // 9.999.999.999.999,99 ~= 10000 billions\n tenTrillionsNoDecimals: '9999999999999', //FIXME Update all those limits to the 'real' numbers\n oneBillion : '999999999.99',\n zero : '0',\n },\n\n /* Defines the minimum possible value a user can enter.\n * Notes:\n * - this value must be a string and use the period for the decimal point\n * - this value needs to be smaller than `maximumValue`\n * - if this is superior to 0, then you'll effectively prevent your user to entirely delete the content of your element\n */\n minimumValue: {\n tenTrillions : '-9999999999999.99', // -9.999.999.999.999,99 ~= 10000 billions\n tenTrillionsNoDecimals: '-9999999999999',\n oneBillion : '-999999999.99',\n zero : '0',\n },\n\n /* Allows the user to increment or decrement the element value with the mouse wheel.\n * The wheel behavior can be modified by the `wheelStep` option.\n * This `wheelStep` option can be used in two ways, either by setting:\n * - a 'fixed' step value (`wheelStep : 1000`), or\n * - the 'progressive' string (`wheelStep : 'progressive'`), which will then activate a special mode where the step is automatically calculated based on the element value size.\n *\n * Note :\n * You can activate/deactivate the wheel event for each `wheelOn` option value by using the 'Shift' modifier key while using the mouse wheel.\n */\n modifyValueOnWheel: {\n modifyValue: true,\n doNothing : false,\n },\n\n /* Adds brackets on negative values (ie. transforms '-$ 999.99' to '($999.99)')\n * Those brackets are visible only when the field does NOT have the focus.\n * The left and right symbols should be enclosed in quotes and separated by a comma.\n */\n negativeBracketsTypeOnBlur: {\n parentheses : '(,)',\n brackets : '[,]',\n chevrons : '<,>',\n curlyBraces : '{,}',\n angleBrackets : '〈,〉',\n japaneseQuotationMarks: '「,」',\n halfBrackets : '⸤,⸥',\n whiteSquareBrackets : '⟦,⟧',\n quotationMarks : '‹,›',\n guillemets : '«,»',\n none : null, // This is the default value, which deactivate this feature\n },\n\n /* Placement of the negative/positive sign relative to the `currencySymbol` option.\n *\n * Example:\n * -1,234.56 => default no options required\n * -$1,234.56 => {currencySymbol: \"$\"} or {currencySymbol: \"$\", negativePositiveSignPlacement: \"l\"}\n * $-1,234.56 => {currencySymbol: \"$\", negativePositiveSignPlacement: \"r\"} // Default if negativePositiveSignPlacement is 'null' and currencySymbol is not empty\n * -1,234.56$ => {currencySymbol: \"$\", currencySymbolPlacement: \"s\", negativePositiveSignPlacement: \"p\"} // Default if negativePositiveSignPlacement is 'null' and currencySymbol is not empty\n * 1,234.56- => {negativePositiveSignPlacement: \"s\"}\n * $1,234.56- => {currencySymbol: \"$\", negativePositiveSignPlacement: \"s\"}\n * 1,234.56-$ => {currencySymbol: \"$\", currencySymbolPlacement: \"s\"}\n * 1,234.56$- => {currencySymbol: \"$\", currencySymbolPlacement: \"s\", negativePositiveSignPlacement: \"r\"}\n */\n negativePositiveSignPlacement: {\n prefix: 'p',\n suffix: 's',\n left : 'l',\n right : 'r',\n none : null,\n },\n\n /* Defines the negative sign symbol.\n * It can be a string of only one character.\n */\n negativeSignCharacter: {\n hyphen : '-',\n minus : '−',\n heavyMinus : '➖',\n fullWidthHyphen: '-',\n circledMinus : '⊖',\n squaredMinus : '⊟',\n triangleMinus : '⨺',\n plusMinus : '±',\n minusPlus : '∓',\n dotMinus : '∸',\n minusTilde : '≂',\n not : '¬',\n },\n\n /* Defines if the element should have event listeners activated on it.\n * By default, those event listeners are only added to <input> elements and html element with the `contenteditable` attribute set to `true`, but not on the other html tags.\n * This allows to initialize elements without any event listeners.\n * Warning: Since AutoNumeric will not check the input content after its initialization, using some autoNumeric methods afterwards *will* probably leads to formatting problems.\n */\n noEventListeners: {\n noEvents : true,\n addEvents: false,\n },\n\n /* Manage how autoNumeric react when the user tries to paste an invalid number.\n * - 'error' : (This is the default behavior) The input value is not changed and an error is output in the console.\n * - 'ignore' : idem than 'error', but fail silently without outputting any error/warning in the console.\n * - 'clamp' : if the pasted value is either too small or too big regarding the minimumValue and maximumValue range, then the result is clamped to those limits.\n * - 'truncate' : autoNumeric will insert as many pasted numbers it can at the initial caret/selection, until everything is pasted, or the range limit is hit.\n * The non-pasted numbers are dropped and therefore not used at all.\n * - 'replace' : autoNumeric will first insert as many pasted numbers it can at the initial caret/selection, then if the range limit is hit, it will try\n * to replace one by one the remaining initial numbers (on the right side of the caret) with the rest of the pasted numbers.\n *\n * Note 1 : A paste content starting with a negative sign '-' will be accepted anywhere in the input, and will set the resulting value as a negative number\n * Note 2 : A paste content starting with a number will be accepted, even if the rest is gibberish (ie. '123foobar456').\n * Only the first number will be used (here '123').\n * Note 3 : The paste event works with the `decimalPlacesShownOnFocus` option too.\n */\n onInvalidPaste: {\n error : 'error',\n ignore : 'ignore',\n clamp : 'clamp',\n truncate: 'truncate',\n replace : 'replace',\n },\n\n /* Defines how the value should be formatted when wanting a 'localized' version of it.\n * - null or 'string' => 'nnnn.nn' or '-nnnn.nn' as text type. This is the default behavior.\n * - 'number' => nnnn.nn or -nnnn.nn as a Number (Warning: this works only for integers inferior to Number.MAX_SAFE_INTEGER)\n * - ',' or '-,' => 'nnnn,nn' or '-nnnn,nn'\n * - '.-' => 'nnnn.nn' or 'nnnn.nn-'\n * - ',-' => 'nnnn,nn' or 'nnnn,nn-'\n *\n * Note: The hyphen '-' is translated to the custom negative sign defined in `negativeSignCharacter`\n */\n outputFormat: {\n string : 'string',\n number : 'number',\n dot : '.',\n negativeDot : '-.',\n comma : ',',\n negativeComma: '-,',\n dotNegative : '.-',\n commaNegative: ',-',\n none : null,\n },\n\n /* Override the minimum and maximum limits\n * overrideMinMaxLimits: \"ceiling\" adheres to maximumValue and ignores minimumValue settings\n * overrideMinMaxLimits: \"floor\" adheres to minimumValue and ignores maximumValue settings\n * overrideMinMaxLimits: \"ignore\" ignores both minimumValue & maximumValue\n */\n overrideMinMaxLimits: {\n ceiling : 'ceiling',\n floor : 'floor',\n ignore : 'ignore',\n doNotOverride: null,\n },\n\n /* Defines the positive sign symbol.\n * It can be a string of only one character.\n * This is shown only if `showPositiveSign` is set to `true`.\n */\n positiveSignCharacter: {\n plus : '+',\n fullWidthPlus : '+',\n heavyPlus : '➕',\n doublePlus : '⧺',\n triplePlus : '⧻',\n circledPlus : '⊕',\n squaredPlus : '⊞',\n trianglePlus : '⨹',\n plusMinus : '±',\n minusPlus : '∓',\n dotPlus : '∔',\n altHebrewPlus : '﬩',\n normalSpace : ' ',\n thinSpace : '\\u2009',\n narrowNoBreakSpace: '\\u202f',\n noBreakSpace : '\\u00a0',\n },\n\n /* The `rawValueDivisor` divides the formatted value shown in the AutoNumeric element and store the result in `rawValue`.\n * @example { rawValueDivisor: '100' } or <input data-raw-value-divisor=\"100\">\n * Given the `0.01234` raw value, the formatted value will be displayed as `'1.234'`.\n * This is useful when displaying percentage for instance, and avoid the need to divide/multiply by 100 between the number shown and the raw value.\n */\n rawValueDivisor: {\n none : null,\n percentage: 100,\n permille : 1000,\n basisPoint: 10000,\n },\n\n /* Defines if the <input> element should be set as read only on initialization.\n * When set to `true`, then the `readonly` html property is added to the <input> element on initialization.\n */\n readOnly: {\n readOnly : true,\n readWrite: false,\n },\n\n /* Defines the rounding method to use.\n * roundingMethod: \"S\", Round-Half-Up Symmetric (default)\n * roundingMethod: \"A\", Round-Half-Up Asymmetric\n * roundingMethod: \"s\", Round-Half-Down Symmetric (lower case s)\n * roundingMethod: \"a\", Round-Half-Down Asymmetric (lower case a)\n * roundingMethod: \"B\", Round-Half-Even \"Bankers Rounding\"\n * roundingMethod: \"U\", Round Up \"Round-Away-From-Zero\"\n * roundingMethod: \"D\", Round Down \"Round-Toward-Zero\" - same as truncate\n * roundingMethod: \"C\", Round to Ceiling \"Toward Positive Infinity\"\n * roundingMethod: \"F\", Round to Floor \"Toward Negative Infinity\"\n * roundingMethod: \"N05\" Rounds to the nearest .05 => same as \"CHF\" used in 1.9X and still valid\n * roundingMethod: \"U05\" Rounds up to next .05\n * roundingMethod: \"D05\" Rounds down to next .05\n */\n roundingMethod: {\n halfUpSymmetric : 'S',\n halfUpAsymmetric : 'A',\n halfDownSymmetric : 's',\n halfDownAsymmetric : 'a',\n halfEvenBankersRounding : 'B',\n upRoundAwayFromZero : 'U',\n downRoundTowardZero : 'D',\n toCeilingTowardPositiveInfinity: 'C',\n toFloorTowardNegativeInfinity : 'F',\n toNearest05 : 'N05',\n toNearest05Alt : 'CHF',\n upToNext05 : 'U05',\n downToNext05 : 'D05',\n },\n\n /* Set to `true` to allow the `decimalPlacesShownOnFocus` value to be saved with sessionStorage\n * If IE 6 or 7 is detected, the value will be saved as a session cookie.\n */\n saveValueToSessionStorage: {\n save : true,\n doNotSave: false,\n },\n\n /* Determine if the select all keyboard command will select the complete input text, or only the input numeric value\n * Note : If the currency symbol is between the numeric value and the negative sign, only the numeric value will be selected\n */\n selectNumberOnly: {\n selectNumbersOnly: true,\n selectAll : false,\n },\n\n /* Defines if the element value should be selected on focus.\n * Note: The selection is done using the `selectNumberOnly` option.\n */\n selectOnFocus: {\n select : true,\n doNotSelect: false,\n },\n\n /* Defines how the serialize functions should treat the spaces.\n * Those spaces ' ' can either be converted to the plus sign '+', which is the default, or to '%20'.\n * Both values being valid per the spec (http://www.w3.org/Addressing/URL/uri-spec.html).\n * Also see the summed up answer on http://stackoverflow.com/a/33939287.\n *\n * tl;dr : Spaces should be converted to '%20' before the '?' sign, then converted to '+' after.\n * In our case since we serialize the query, we use '+' as the default (but allow the user to get back the old *wrong* behavior).\n */\n serializeSpaces: {\n plus : '+',\n percent: '%20',\n },\n\n /* Defines if the element value should be converted to the raw value on focus (and back to the formatted on blur).\n * If set to `true`, then autoNumeric remove the thousand separator, currency symbol and suffix on focus.\n * Example:\n * If the input value is '$ 1,999.88 suffix', on focus it becomes '1999.88' and back to '$ 1,999.88 suffix' on blur.\n */\n showOnlyNumbersOnFocus: {\n onlyNumbers: true,\n showAll : false,\n },\n\n /* Allow the positive sign symbol `+` to be displayed for positive numbers.\n * By default, this positive sign is not shown.\n * The sign placement is controlled by the 'negativePositiveSignPlacement' option, mimicking the negative sign placement rules.\n */\n showPositiveSign: {\n show: true,\n hide: false,\n },\n\n /* Defines if warnings should be shown in the console.\n * Those warnings can be ignored, but are usually printed when something could be improved by the user (ie. option conflicts).\n */\n showWarnings: {\n show: true, // All warning are shown\n hide: false, // No warnings are shown, only the thrown errors\n },\n\n /* Defines the rules that calculate the CSS class(es) to apply on the element, based on the raw unformatted value.\n * This can also be used to call callbacks whenever the `rawValue` is updated.\n * Important: all callbacks must return `null` if no ranges/userDefined classes are selected\n * @example\n * {\n * positive : 'autoNumeric-positive', // Or `null` to not use it\n * negative : 'autoNumeric-negative',\n * ranges : [\n * { min: 0, max: 25, class: 'autoNumeric-red' },\n * { min: 25, max: 50, class: 'autoNumeric-orange' },\n * { min: 50, max: 75, class: 'autoNumeric-yellow' },\n * { min: 75, max: Number.MAX_SAFE_INTEGER, class: 'autoNumeric-green' },\n * ],\n * userDefined: [\n * // If 'classes' is a string, set it if `true`, remove it if `false`\n * { callback: rawValue => { return true; }, classes: 'thisIsTrue' },\n * // If 'classes' is an array with only 2 elements, set the first class if `true`, the second if `false`\n * { callback: rawValue => rawValue % 2 === 0, classes: ['autoNumeric-even', 'autoNumeric-odd'] },\n * // Return only one index to use on the `classes` array (here, 'class3')\n * { callback: rawValue => { return 2; }, classes: ['class1', 'class2', 'class3'] },\n * // Return an array of indexes to use on the `classes` array (here, 'class1' and 'class3')\n * { callback: rawValue => { return [0, 2]; }, classes: ['class1', 'class2', 'class3'] },\n * // If 'classes' is `undefined` or `null`, then the callback is called with the AutoNumeric object passed as a parameter\n * { callback: anElement => { return anElement.getFormatted(); } },\n * ],\n * }\n */\n styleRules: {\n none : null,\n positiveNegative : {\n positive: 'autoNumeric-positive',\n negative: 'autoNumeric-negative',\n },\n range0To100With4Steps: {\n ranges: [\n { min: 0, max: 25, class: 'autoNumeric-red' },\n { min: 25, max: 50, class: 'autoNumeric-orange' },\n { min: 50, max: 75, class: 'autoNumeric-yellow' },\n { min: 75, max: 100, class: 'autoNumeric-green' },\n ],\n },\n evenOdd : {\n userDefined: [\n { callback: rawValue => rawValue % 2 === 0, classes: ['autoNumeric-even', 'autoNumeric-odd'] },\n ],\n },\n rangeSmallAndZero : {\n userDefined: [\n {\n callback : rawValue => {\n if (rawValue >= -1 && rawValue < 0) {\n return 0;\n }\n if (Number(rawValue) === 0) {\n return 1;\n }\n if (rawValue > 0 && rawValue <= 1) {\n return 2;\n }\n\n return null; // In case the rawValue is outside those ranges\n },\n classes: [\n 'autoNumeric-small-negative',\n 'autoNumeric-zero',\n 'autoNumeric-small-positive',\n ],\n },\n ],\n },\n },\n\n /* Add a text on the right hand side of the element value.\n * This suffix text can have any characters in its string, except numeric characters and the negative/positive sign.\n * Example: ' dollars'\n */\n suffixText: {\n none : '',\n percentage: '%',\n permille : '‰',\n basisPoint: '‱',\n },\n\n /* The three options (divisorWhenUnfocused, decimalPlacesShownOnBlur & symbolWhenUnfocused) handle scaling of the input when the input does not have focus\n * Please note that the non-scaled value is held in data and it is advised that you use the `saveValueToSessionStorage` option to ensure retaining the value\n * [\"divisor\", \"decimal places\", \"symbol\"]\n * Example: with the following options set {divisorWhenUnfocused: '1000', decimalPlacesShownOnBlur: '1', symbolWhenUnfocused: ' K'}\n * Example: focusin value \"1,111.11\" focusout value \"1.1 K\"\n */\n\n /* The `symbolWhenUnfocused` option is a symbol placed as a suffix when not in focus.\n * This is optional too.\n */\n symbolWhenUnfocused: {\n none : null,\n percentage: '%',\n permille : '‰',\n basisPoint: '‱',\n },\n\n /* Defines if the element value should be unformatted when the user hover his mouse over it while holding the `Alt` key.\n * Unformatting there means that this removes any non-number characters and displays the *raw* value, as understood by Javascript (ie. `12.34` is a valid number, while `12,34` is not).\n *\n * We reformat back before anything else if :\n * - the user focus on the element by tabbing or clicking into it,\n * - the user releases the `Alt` key, and\n * - if we detect a mouseleave event.\n *\n * We unformat again if :\n * - while the mouse is over the element, the user hit `Alt` again\n */\n unformatOnHover: {\n unformat : true,\n doNotUnformat: false, //TODO Rename to `keepFormat`\n },\n\n /* Removes the formatting and use the raw value in each autoNumeric elements of the parent form element, on the form `submit` event.\n * The output format is a numeric string (nnnn.nn or -nnnn.nn).\n */\n unformatOnSubmit: {\n unformat : true,\n keepCurrentValue: false,\n },\n\n /* Provides a way for automatically replacing the formatted value with a pre-defined string, when the raw value is equal to a specific value\n * Here you can specify as many 'conversion' as needed.\n */\n valuesToStrings: {\n none : null,\n zeroDash : {\n 0: '-',\n },\n oneAroundZero: {\n '-1': 'Min',\n 1 : 'Max',\n },\n },\n\n /* Defines if the AutoNumeric element should watch external changes made without using `.set()`, but by using the basic `aNElement.node().value = 42` notation.\n * If set to `watch`, then AutoNumeric will format the new value using `.set()` internally.\n * Otherwise it will neither format it, nor save it in the history.\n */\n watchExternalChanges: {\n watch : true,\n doNotWatch: false,\n },\n\n /* Defines when the wheel event will increment or decrement the element value.\n * When set to `'focus'`, the AutoNumeric-managed element needs to be focused for the wheel event to change the value.\n * When set to `'hover'`, using the wheel event while the mouse is hovering the element is sufficient (no focus needed).\n *\n * Note :\n * When `wheelOn` is set to `'focus'`, you can use the 'Shift' modifier key while using the mouse wheel in order to temporarily activate the increment/decrement feature even if the element is not focused.\n * When `wheelOn` is set to `'hover'`, you can use the 'Shift' modifier key while using the mouse wheel in order to temporarily disable the increment/decrement feature even if the element is not hovered.\n */\n wheelOn: {\n focus: 'focus',\n hover: 'hover',\n },\n\n /* That option is linked to the `modifyValueOnWheel` one and will only be used if the latter is set to `true`.\n * This option will modify the wheel behavior and can be used in two ways, either by setting :\n * - a 'fixed' step value (a positive float or integer number `1000`), or\n * - the `'progressive'` string.\n *\n * The 'fixed' mode always increment/decrement the element value by that amount, while respecting the `minimumValue` and `maximumValue` settings.\n * The 'progressive' mode will increment/decrement the element value based on its current value. The bigger the number, the bigger the step, and vice versa.\n */\n wheelStep: {\n progressive: 'progressive',\n },\n };\n },\n});\n","/**\n * Enumerations for autoNumeric.js\n * @author Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>\n * @copyright © 2016 Alexandre Bonneau\n *\n * The MIT License (http://www.opensource.org/licenses/mit-license.php)\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sub license, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n\n/**\n * Object that store the helper enumerations\n * @type {{ allowedTagList: [string], keyCode: {}, fromCharCodeKeyCode: [string], keyName: {} }}\n */\nconst AutoNumericEnum = {\n /**\n * List of allowed tag on which autoNumeric can be used.\n */\n get allowedTagList() {\n return [\n 'b',\n 'caption',\n 'cite',\n 'code',\n 'const',\n 'dd',\n 'del',\n 'div',\n 'dfn',\n 'dt',\n 'em',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'input',\n 'ins',\n 'kdb',\n 'label',\n 'li',\n 'option',\n 'output',\n 'p',\n 'q',\n 's',\n 'sample',\n 'span',\n 'strong',\n 'td',\n 'th',\n 'u',\n ];\n },\n\n /**\n * Wrapper variable that hold named keyboard keys with their respective keyCode as seen in DOM events.\n * cf. https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode\n *\n * This deprecated information is used for obsolete browsers.\n * @deprecated\n */\n get keyCode() {\n return {\n Backspace : 8,\n Tab : 9,\n // No 10, 11\n // 12 === NumpadEqual on Windows\n // 12 === NumLock on Mac\n Enter : 13,\n // 14 reserved, but not used\n // 15 does not exists\n Shift : 16,\n Ctrl : 17,\n Alt : 18,\n Pause : 19,\n CapsLock : 20,\n // 21, 22, 23, 24, 25 : Asiatic key codes\n // 26 does not exists\n Esc : 27,\n // 28, 29, 30, 31 : Convert, NonConvert, Accept and ModeChange keys\n Space : 32,\n PageUp : 33,\n PageDown : 34,\n End : 35,\n Home : 36,\n LeftArrow : 37,\n UpArrow : 38,\n RightArrow : 39,\n DownArrow : 40,\n Insert : 45,\n Delete : 46,\n num0 : 48,\n num1 : 49,\n num2 : 50,\n num3 : 51,\n num4 : 52,\n num5 : 53,\n num6 : 54,\n num7 : 55,\n num8 : 56,\n num9 : 57,\n a : 65,\n b : 66,\n c : 67,\n d : 68,\n e : 69,\n f : 70,\n g : 71,\n h : 72,\n i : 73,\n j : 74,\n k : 75,\n l : 76,\n m : 77,\n n : 78,\n o : 79,\n p : 80,\n q : 81,\n r : 82,\n s : 83,\n t : 84,\n u : 85,\n v : 86,\n w : 87,\n x : 88,\n y : 89,\n z : 90,\n OSLeft : 91,\n OSRight : 92,\n ContextMenu : 93,\n numpad0 : 96,\n numpad1 : 97,\n numpad2 : 98,\n numpad3 : 99,\n numpad4 : 100,\n numpad5 : 101,\n numpad6 : 102,\n numpad7 : 103,\n numpad8 : 104,\n numpad9 : 105,\n MultiplyNumpad: 106,\n PlusNumpad : 107,\n MinusNumpad : 109,\n DotNumpad : 110,\n SlashNumpad : 111,\n F1 : 112,\n F2 : 113,\n F3 : 114,\n F4 : 115,\n F5 : 116,\n F6 : 117,\n F7 : 118,\n F8 : 119,\n F9 : 120,\n F10 : 121,\n F11 : 122,\n F12 : 123,\n NumLock : 144,\n ScrollLock : 145,\n HyphenFirefox : 173, // On the latest Linux and Windows OS, cf. https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode and https://bugzilla.mozilla.org/show_bug.cgi?id=787504 and https://stackoverflow.com/a/35473259/2834898\n MyComputer : 182,\n MyCalculator : 183,\n Semicolon : 186,\n Equal : 187,\n Comma : 188,\n Hyphen : 189,\n Dot : 190,\n Slash : 191,\n Backquote : 192,\n LeftBracket : 219,\n Backslash : 220,\n RightBracket : 221,\n Quote : 222,\n Command : 224,\n AltGraph : 225,\n AndroidDefault: 229, // Android Chrome returns the same keycode number 229 for all keys pressed\n };\n },\n\n /**\n * This object is the reverse of `keyCode`, and is used to translate the key code to named keys when no valid characters can be obtained by `String.fromCharCode`.\n * This object keys correspond to the `event.keyCode` number, and returns the corresponding key name (à la event.key)\n */\n get fromCharCodeKeyCode() {\n return {\n 0 : 'LaunchCalculator',\n 8 : 'Backspace',\n 9 : 'Tab',\n 13 : 'Enter',\n 16 : 'Shift',\n 17 : 'Ctrl',\n 18 : 'Alt',\n 19 : 'Pause',\n 20 : 'CapsLock',\n 27 : 'Escape',\n 32 : ' ',\n 33 : 'PageUp',\n 34 : 'PageDown',\n 35 : 'End',\n 36 : 'Home',\n 37 : 'ArrowLeft',\n 38 : 'ArrowUp',\n 39 : 'ArrowRight',\n 40 : 'ArrowDown',\n 45 : 'Insert',\n 46 : 'Delete',\n 48 : '0',\n 49 : '1',\n 50 : '2',\n 51 : '3',\n 52 : '4',\n 53 : '5',\n 54 : '6',\n 55 : '7',\n 56 : '8',\n 57 : '9',\n // 65: 'a',\n // 66: 'b',\n // 67: 'c',\n // 68: 'd',\n // 69: 'e',\n // 70: 'f',\n // 71: 'g',\n // 72: 'h',\n // 73: 'i',\n // 74: 'j',\n // 75: 'k',\n // 76: 'l',\n // 77: 'm',\n // 78: 'n',\n // 79: 'o',\n // 80: 'p',\n // 81: 'q',\n // 82: 'r',\n // 83: 's',\n // 84: 't',\n // 85: 'u',\n // 86: 'v',\n // 87: 'w',\n // 88: 'x',\n // 89: 'y',\n // 90: 'z',\n 91 : 'OS', // Note: Firefox and Chrome reports 'OS' instead of 'OSLeft'\n 92 : 'OSRight',\n 93 : 'ContextMenu',\n 96 : '0',\n 97 : '1',\n 98 : '2',\n 99 : '3',\n 100: '4',\n 101: '5',\n 102: '6',\n 103: '7',\n 104: '8',\n 105: '9',\n 106: '*',\n 107: '+',\n 109: '-', // The 'NumpadSubtract' code\n 110: '.',\n 111: '/',\n 112: 'F1',\n 113: 'F2',\n 114: 'F3',\n 115: 'F4',\n 116: 'F5',\n 117: 'F6',\n 118: 'F7',\n 119: 'F8',\n 120: 'F9',\n 121: 'F10',\n 122: 'F11',\n 123: 'F12',\n 144: 'NumLock',\n 145: 'ScrollLock',\n 173: '-', // The 'Minus' sign on Firefox. This is only needed when using the Selenium bot though.\n 182: 'MyComputer',\n 183: 'MyCalculator',\n 186: ';',\n 187: '=',\n 188: ',',\n 189: '-', // The 'Minus' sign on all other browsers\n 190: '.',\n 191: '/',\n 192: '`',\n 219: '[',\n 220: '\\\\',\n 221: ']',\n 222: '\\'',\n 224: 'Meta',\n 225: 'AltGraph',\n };\n },\n\n /**\n * Wrapper variable that hold named keyboard keys with their respective key name (as set in KeyboardEvent.key).\n * Those names are listed here :\n * @link https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values\n */\n get keyName() {\n return {\n // Special values\n Unidentified : 'Unidentified',\n AndroidDefault: 'AndroidDefault',\n\n // Modifier keys\n Alt : 'Alt',\n AltGr : 'AltGraph',\n CapsLock : 'CapsLock', // Under Chrome, e.key is empty for CapsLock\n Ctrl : 'Control',\n Fn : 'Fn',\n FnLock : 'FnLock',\n Hyper : 'Hyper', // 'OS' under Firefox\n Meta : 'Meta',\n OSLeft : 'OS',\n OSRight : 'OS',\n Command : 'OS',\n NumLock : 'NumLock',\n ScrollLock: 'ScrollLock',\n Shift : 'Shift',\n Super : 'Super', // 'OS' under Firefox\n Symbol : 'Symbol',\n SymbolLock: 'SymbolLock',\n\n // Whitespace keys\n Enter: 'Enter',\n Tab : 'Tab',\n Space: ' ', // 'Spacebar' for Firefox <37, and IE9\n\n // Navigation keys\n LeftArrow : 'ArrowLeft', // 'Left' for Firefox <=36, and IE9\n UpArrow : 'ArrowUp', // 'Up' for Firefox <=36, and IE9\n RightArrow: 'ArrowRight', // 'Right' for Firefox <=36, and IE9\n DownArrow : 'ArrowDown', // 'Down' for Firefox <=36, and IE9\n End : 'End',\n Home : 'Home',\n PageUp : 'PageUp',\n PageDown : 'PageDown',\n\n // Editing keys\n Backspace: 'Backspace',\n Clear : 'Clear',\n Copy : 'Copy',\n CrSel : 'CrSel', // 'Crsel' for Firefox <=36, and IE9\n Cut : 'Cut',\n Delete : 'Delete', // 'Del' for Firefox <=36, and IE9\n EraseEof : 'EraseEof',\n ExSel : 'ExSel', // 'Exsel' for Firefox <=36, and IE9\n Insert : 'Insert',\n Paste : 'Paste',\n Redo : 'Redo',\n Undo : 'Undo',\n\n // UI keys\n Accept : 'Accept',\n Again : 'Again',\n Attn : 'Attn', // 'Unidentified' for Firefox, Chrome, and IE9 ('KanaMode' when using the Japanese keyboard layout)\n Cancel : 'Cancel',\n ContextMenu: 'ContextMenu', // 'Apps' for Firefox <=36, and IE9\n Esc : 'Escape', // 'Esc' for Firefox <=36, and IE9\n Execute : 'Execute',\n Find : 'Find',\n Finish : 'Finish', // 'Unidentified' for Firefox, Chrome, and IE9 ('Katakana' when using the Japanese keyboard layout)\n Help : 'Help',\n Pause : 'Pause',\n Play : 'Play',\n Props : 'Props',\n Select : 'Select',\n ZoomIn : 'ZoomIn',\n ZoomOut : 'ZoomOut',\n\n // Device keys\n BrightnessDown: 'BrightnessDown',\n BrightnessUp : 'BrightnessUp',\n Eject : 'Eject',\n LogOff : 'LogOff',\n Power : 'Power',\n PowerOff : 'PowerOff',\n PrintScreen : 'PrintScreen',\n Hibernate : 'Hibernate', // 'Unidentified' for Firefox <=37\n Standby : 'Standby', // 'Unidentified' for Firefox <=36, and IE9\n WakeUp : 'WakeUp',\n\n // IME and composition keys\n Compose: 'Compose',\n Dead : 'Dead',\n\n // Function keys\n F1 : 'F1',\n F2 : 'F2',\n F3 : 'F3',\n F4 : 'F4',\n F5 : 'F5',\n F6 : 'F6',\n F7 : 'F7',\n F8 : 'F8',\n F9 : 'F9',\n F10: 'F10',\n F11: 'F11',\n F12: 'F12',\n\n // Document keys\n Print: 'Print',\n\n // 'Normal' keys\n num0 : '0',\n num1 : '1',\n num2 : '2',\n num3 : '3',\n num4 : '4',\n num5 : '5',\n num6 : '6',\n num7 : '7',\n num8 : '8',\n num9 : '9',\n a : 'a',\n b : 'b',\n c : 'c',\n d : 'd',\n e : 'e',\n f : 'f',\n g : 'g',\n h : 'h',\n i : 'i',\n j : 'j',\n k : 'k',\n l : 'l',\n m : 'm',\n n : 'n',\n o : 'o',\n p : 'p',\n q : 'q',\n r : 'r',\n s : 's',\n t : 't',\n u : 'u',\n v : 'v',\n w : 'w',\n x : 'x',\n y : 'y',\n z : 'z',\n A : 'A',\n B : 'B',\n C : 'C',\n D : 'D',\n E : 'E',\n F : 'F',\n G : 'G',\n H : 'H',\n I : 'I',\n J : 'J',\n K : 'K',\n L : 'L',\n M : 'M',\n N : 'N',\n O : 'O',\n P : 'P',\n Q : 'Q',\n R : 'R',\n S : 'S',\n T : 'T',\n U : 'U',\n V : 'V',\n W : 'W',\n X : 'X',\n Y : 'Y',\n Z : 'Z',\n Semicolon : ';',\n Equal : '=',\n Comma : ',',\n Hyphen : '-',\n Minus : '-',\n Plus : '+',\n Dot : '.',\n Slash : '/',\n Backquote : '`',\n LeftBracket : '[',\n RightBracket : ']',\n Backslash : '\\\\',\n Quote : '\\'',\n\n // Numeric keypad keys\n numpad0 : '0',\n numpad1 : '1',\n numpad2 : '2',\n numpad3 : '3',\n numpad4 : '4',\n numpad5 : '5',\n numpad6 : '6',\n numpad7 : '7',\n numpad8 : '8',\n numpad9 : '9',\n NumpadDot : '.',\n NumpadDotAlt : ',', // Modern browsers automatically adapt the character sent by this key to the decimal character of the current language\n NumpadMultiply : '*',\n NumpadPlus : '+',\n NumpadMinus : '-',\n NumpadSubtract : '-',\n NumpadSlash : '/',\n NumpadDotObsoleteBrowsers : 'Decimal',\n NumpadMultiplyObsoleteBrowsers: 'Multiply',\n NumpadPlusObsoleteBrowsers : 'Add',\n NumpadMinusObsoleteBrowsers : 'Subtract',\n NumpadSlashObsoleteBrowsers : 'Divide',\n\n // Special arrays for quicker tests\n _allFnKeys : ['F1', 'F2', 'F3', 'F4', 'F5', 'F6', 'F7', 'F8', 'F9', 'F10', 'F11', 'F12'],\n _someNonPrintableKeys: ['Tab', 'Enter', 'Shift', 'ShiftLeft', 'ShiftRight', 'Control', 'ControlLeft', 'ControlRight', 'Alt', 'AltLeft', 'AltRight', 'Pause', 'CapsLock', 'Escape'],\n _directionKeys : ['PageUp', 'PageDown', 'End', 'Home', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'ArrowUp'],\n };\n },\n};\n\nexport default AutoNumericEnum;\n","/**\n * Helper functions for autoNumeric.js\n * @author Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>\n * @copyright © 2016 Alexandre Bonneau\n *\n * The MIT License (http://www.opensource.org/licenses/mit-license.php)\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sub license, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n\nimport AutoNumericEnum from './AutoNumericEnum';\n\n/**\n * Static class that holds all the helper functions autoNumeric uses.\n * Note : none of the functions in there are aware of any autoNumeric internals (which means there are no references to autoNumeric-specific info like options names or data structures).\n */\nexport default class AutoNumericHelper {\n /**\n * Return `true` if the `value` is null\n *\n * @static\n * @param {*} value The value to test\n * @returns {boolean} Return `true` if the `value` is null, FALSE otherwise\n */\n static isNull(value) {\n return value === null;\n }\n\n /**\n * Return `true` if the `value` is undefined\n *\n * @static\n * @param {*} value The value to test\n * @returns {boolean} Return `true` if the `value` is undefined, FALSE otherwise\n */\n static isUndefined(value) {\n return value === void(0);\n }\n\n /**\n * Return `true` if the `value` is undefined, null or empty\n *\n * @param {*} value\n * @returns {boolean}\n */\n static isUndefinedOrNullOrEmpty(value) {\n return value === null || value === void(0) || '' === value;\n }\n\n /**\n * Return `true` if the given parameter is a String\n *\n * @param {*} str\n * @returns {boolean}\n */\n static isString(str) {\n return (typeof str === 'string' || str instanceof String);\n }\n /**\n * Return `true` if the `value` is an empty string ''\n *\n * @static\n * @param {*} value The value to test\n * @returns {boolean} Return `true` if the `value` is an empty string '', FALSE otherwise\n */\n static isEmptyString(value) {\n return value === '';\n }\n\n /**\n * Return `true` if the parameter is a boolean\n *\n * @static\n * @param {*} value\n * @returns {boolean}\n */\n static isBoolean(value) {\n return typeof(value) === 'boolean';\n }\n\n /**\n * Return `true` if the parameter is a string 'true' or 'false'\n *\n * This function accepts any cases for those strings.\n * @param {string} value\n * @returns {boolean}\n */\n static isTrueOrFalseString(value) {\n const lowercaseValue = String(value).toLowerCase();\n return lowercaseValue === 'true' || lowercaseValue === 'false';\n }\n\n /**\n * Return `true` if the parameter is an object\n *\n * @param {*} reference\n * @returns {boolean}\n */\n static isObject(reference) {\n return typeof reference === 'object' && reference !== null && !Array.isArray(reference);\n }\n\n /**\n * Return `true` if the given object is empty\n * cf. http://stackoverflow.com/questions/679915/how-do-i-test-for-an-empty-javascript-object and http://jsperf.com/empty-object-test\n *\n * @param {object} obj\n * @returns {boolean}\n */\n static isEmptyObj(obj) {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Return `true` if the parameter is a real number (and not a numeric string).\n *\n * @param {*} n\n * @returns {boolean}\n */\n static isNumberStrict(n) {\n return typeof n === 'number';\n }\n\n /**\n * Return `true` if the parameter is a number (or a number written as a string).\n *\n * @param {*} n\n * @returns {boolean}\n */\n static isNumber(n) {\n return !this.isArray(n) && !isNaN(parseFloat(n)) && isFinite(n);\n }\n\n /**\n * Return `true` if the parameter is a number (or a number written as a string).\n * This version also accepts Arabic and Persian numbers.\n *\n * @param {*} n\n * @returns {boolean}\n */\n static isNumberOrArabic(n) {\n const latinConvertedNumber = this.arabicToLatinNumbers(n, false, true, true);\n return this.isNumber(latinConvertedNumber);\n }\n\n /**\n * Return `true` if the parameter is an integer (and not a float).\n *\n * @param {*} n\n * @returns {boolean}\n */\n static isInt(n) {\n return typeof n === 'number' && parseFloat(n) === parseInt(n, 10) && !isNaN(n);\n }\n\n /**\n * Return `true` if the parameter is a function.\n *\n * @param {function} func\n * @returns {boolean}\n */\n static isFunction(func) {\n return typeof func === 'function';\n }\n\n /**\n * Return `true` if the current browser is the obsolete Internet Explorer 11 (IE11) one\n * cf. https://stackoverflow.com/a/21825207/2834898\n *\n * @returns {boolean}\n */\n static isIE11() {\n // noinspection JSUnresolvedVariable\n return !!window.MSInputMethodContext && !!document.documentMode;\n }\n\n /**\n * Return `true` is the string `str` contains the string `needle`\n * Note: this function does not coerce the parameters types\n *\n * @param {string} str\n * @param {string} needle\n * @returns {boolean}\n */\n static contains(str, needle) {\n //TODO Use `Array.prototype.includes()` when available (cf. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes)\n if (!this.isString(str) || !this.isString(needle) || str === '' || needle === '') {\n return false;\n }\n\n return str.indexOf(needle) !== -1;\n }\n\n /**\n * Return `true` if the `needle` is in the array\n *\n * @param {*} needle\n * @param {Array} array\n * @returns {boolean}\n */\n static isInArray(needle, array) {\n if (!this.isArray(array) || array === [] || this.isUndefined(needle)) {\n return false;\n }\n\n return array.indexOf(needle) !== -1;\n }\n\n /**\n * Return `true` if the parameter is an Array\n * //TODO Replace this by the default `Array.isArray()` function?\n *\n * @param {*} arr\n * @throws Error\n * @returns {*|boolean}\n */\n static isArray(arr) {\n if (Object.prototype.toString.call([]) === '[object Array]') { // Make sure an array has a class attribute of [object Array]\n // Test passed, now check if is an Array\n return Array.isArray(arr) || (typeof arr === 'object' && Object.prototype.toString.call(arr) === '[object Array]');\n }\n else {\n throw new Error('toString message changed for Object Array'); // Verify that the string returned by `toString` does not change in the future (cf. http://stackoverflow.com/a/8365215)\n }\n }\n\n /**\n * Return `true` if the parameter is a DOM element\n * cf. http://stackoverflow.com/a/4754104/2834898\n *\n * @param {*} obj\n * @returns {boolean}\n */\n static isElement(obj) {\n // return !!(obj && obj.nodeName);\n // return obj && 'nodeType' in obj;\n // return obj instanceof Element || obj instanceof HTMLInputElement || obj instanceof HTMLElement;\n if (typeof Element === 'undefined') {\n // This test is needed in environnements where the Element object does not exist (ie. in web workers)\n return false;\n }\n\n return obj instanceof Element;\n }\n\n /**\n * Return `true` in the given DOM element is an <input>.\n *\n * @param {HTMLElement|HTMLInputElement} domElement\n * @returns {boolean}\n * @private\n */\n static isInputElement(domElement) {\n return this.isElement(domElement) && domElement.tagName.toLowerCase() === 'input';\n }\n\n /**\n * Return `true` if the parameter is a string that represents a float number, and that number has a decimal part\n *\n * @param {string} str\n * @returns {boolean}\n */\n // static hasDecimals(str) {\n // const [, decimalPart] = str.split('.');\n // return !isUndefined(decimalPart);\n // }\n\n /**\n * Return the number of decimal places if the parameter is a string that represents a float number, and that number has a decimal part.\n *\n * @param {string} str\n * @returns {int}\n */\n static decimalPlaces(str) {\n const [, decimalPart] = str.split('.');\n if (!this.isUndefined(decimalPart)) {\n return decimalPart.length;\n }\n\n return 0;\n }\n\n /**\n * Return the index of the first non-zero decimal place in the given value.\n * The index starts after the decimal point, if any, and begins at '1'.\n * If no decimal places are found in the value, this function returns `0`.\n *\n * @example\n * indexFirstNonZeroDecimalPlace('0.00') -> 0\n * indexFirstNonZeroDecimalPlace('1.00') -> 0\n * indexFirstNonZeroDecimalPlace('0.12') -> 1\n * indexFirstNonZeroDecimalPlace('0.1234') -> 1\n * indexFirstNonZeroDecimalPlace('0.01234') -> 2\n * indexFirstNonZeroDecimalPlace('0.001234') -> 3\n * indexFirstNonZeroDecimalPlace('0.0001234') -> 4\n *\n * @param {number} value\n * @returns {Number|number}\n */\n static indexFirstNonZeroDecimalPlace(value) {\n const [, decimalPart] = String(Math.abs(value)).split('.');\n\n if (this.isUndefined(decimalPart)) {\n return 0;\n }\n\n let result = decimalPart.lastIndexOf('0');\n if (result === -1) {\n result = 0;\n } else {\n result += 2;\n }\n\n return result;\n }\n\n /**\n * Return the code for the key used to generate the given event.\n *\n * @param {Event} event\n * @returns {string|Number}\n */\n static keyCodeNumber(event) {\n // `event.keyCode` and `event.which` are deprecated, `KeyboardEvent.key` (https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) must be used now\n // Also, do note that Firefox generate a 'keypress' event (e.keyCode === 0) for the keys that do not print a character (ie. 'Insert', 'Delete', 'Fn' keys, 'PageUp', 'PageDown' etc.). 'Shift' on the other hand does not generate a keypress event.\n return (typeof event.which === 'undefined')?event.keyCode:event.which;\n }\n\n /**\n * Return the character from the event key code.\n * If the KeyboardEvent does not represent a printable character, then the key name is used (ie. 'Meta', 'Shift', 'F1', etc.)\n * @example character(50) => '2'\n *\n * @param {KeyboardEvent} event\n * @returns {string}\n */\n static character(event) {\n let result;\n if (event.key === 'Unidentified' || event.key === void(0) || this.isSeleniumBot()) {\n //XXX The selenium geckodriver do not understand `event.key`, hence when using it, we need to rely on the old deprecated `keyCode` attribute, cf. upstream issue https://github.com/mozilla/geckodriver/issues/440\n // Use the old deprecated keyCode property, if the new `key` one is not supported\n const keyCode = this.keyCodeNumber(event);\n if (keyCode === AutoNumericEnum.keyCode.AndroidDefault) {\n return AutoNumericEnum.keyName.AndroidDefault;\n }\n\n const potentialResult = AutoNumericEnum.fromCharCodeKeyCode[keyCode];\n if (!AutoNumericHelper.isUndefinedOrNullOrEmpty(potentialResult)) {\n // Since `String.fromCharCode` do not return named keys for some keys ('Escape' and 'Enter' for instance), we convert the characters to the key names\n result = potentialResult;\n } else {\n result = String.fromCharCode(keyCode);\n }\n } else {\n let browser;\n switch (event.key) {\n // Manages all the special cases for obsolete browsers that return the non-standard names\n case 'Add':\n result = AutoNumericEnum.keyName.NumpadPlus;\n break;\n case 'Apps':\n result = AutoNumericEnum.keyName.ContextMenu;\n break;\n case 'Crsel':\n result = AutoNumericEnum.keyName.CrSel;\n break;\n case 'Decimal':\n result = AutoNumericEnum.keyName.NumpadDot;\n break;\n case 'Del':\n browser = this.browser();\n if ((browser.name === 'firefox' && browser.version <= 36) ||\n (browser.name === 'ie' && browser.version <= 9)) {\n // Special workaround for the obsolete browser IE11 which output a 'Delete' key when using the numpad 'dot' one! This fixes issue #401\n // This workaround break the usage of the 'Delete' key for Firefox <=36, and IE9, since those browser send 'Del' instead of 'Delete', therefore we only use it for those obsolete browsers\n result = AutoNumericEnum.keyName.Dot;\n } else {\n result = AutoNumericEnum.keyName.Delete;\n }\n break;\n case 'Divide':\n result = AutoNumericEnum.keyName.NumpadSlash;\n break;\n case 'Down':\n result = AutoNumericEnum.keyName.DownArrow;\n break;\n case 'Esc':\n result = AutoNumericEnum.keyName.Esc;\n break;\n case 'Exsel':\n result = AutoNumericEnum.keyName.ExSel;\n break;\n case 'Left':\n result = AutoNumericEnum.keyName.LeftArrow;\n break;\n case 'Meta':\n case 'Super':\n result = AutoNumericEnum.keyName.OSLeft;\n break;\n case 'Multiply':\n result = AutoNumericEnum.keyName.NumpadMultiply;\n break;\n case 'Right':\n result = AutoNumericEnum.keyName.RightArrow;\n break;\n case 'Spacebar':\n result = AutoNumericEnum.keyName.Space;\n break;\n case 'Subtract':\n result = AutoNumericEnum.keyName.NumpadMinus;\n break;\n case 'Up':\n result = AutoNumericEnum.keyName.UpArrow;\n break;\n default:\n // The normal case\n result = event.key;\n }\n }\n\n return result;\n }\n\n /**\n * Return an object containing the name and version of the current browser.\n * @example `browserVersion()` => { name: 'Firefox', version: '42' }\n * Based on http://stackoverflow.com/a/38080051/2834898\n *\n * @returns {{ name: string, version: string }}\n */\n static browser() {\n const ua = navigator.userAgent;\n let tem;\n let M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || [];\n\n if (/trident/i.test(M[1])) {\n tem = /\\brv[ :]+(\\d+)/g.exec(ua) || [];\n return { name: 'ie', version: (tem[1] || '') };\n }\n\n if (M[1] === 'Chrome') {\n tem = ua.match(/\\b(OPR|Edge)\\/(\\d+)/);\n if (tem !== null) {\n return { name: tem[1].replace('OPR', 'opera'), version: tem[2] };\n }\n }\n\n M = M[2]?[M[1], M[2]]:[navigator.appName, navigator.appVersion, '-?'];\n if ((tem = ua.match(/version\\/(\\d+)/i)) !== null) {\n M.splice(1, 1, tem[1]);\n }\n\n return { name: M[0].toLowerCase(), version: M[1] };\n }\n\n /**\n * Check if the browser is controlled by Selenium.\n * Note: This only works within the geckodriver.\n * cf. http://stackoverflow.com/questions/33225947/can-a-website-detect-when-you-are-using-selenium-with-chromedriver\n *\n * @returns {boolean}\n */\n static isSeleniumBot() {\n // noinspection JSUnresolvedVariable\n return window.navigator.webdriver === true;\n }\n\n /**\n * Return `true` if the given number is negative, or if the given string contains a negative sign :\n * - everywhere in the string (by default), or\n * - on the first character only if the `checkEverywhere` parameter is set to `false`.\n *\n * @param {number|string} numberOrNumericString A Number, or a number represented by a string\n * @param {string} negativeSignCharacter The single character that represent the negative sign\n * @param {boolean} checkEverywhere If TRUE, then the negative sign is search everywhere in the numeric string (this is needed for instance if the string is '1234.56-')\n * @returns {boolean}\n */\n static isNegative(numberOrNumericString, negativeSignCharacter = '-', checkEverywhere = true) {\n if (numberOrNumericString === negativeSignCharacter) {\n return true;\n }\n\n if (numberOrNumericString === '') {\n return false;\n }\n\n if (AutoNumericHelper.isNumber(numberOrNumericString)) {\n return numberOrNumericString < 0;\n }\n\n if (checkEverywhere) {\n return this.contains(numberOrNumericString, negativeSignCharacter);\n }\n\n return this.isNegativeStrict(numberOrNumericString, negativeSignCharacter);\n }\n\n /**\n * Return `true` if the given string contains a negative sign on the first character (on the far left).\n *\n * @example isNegativeStrict('1234.56') => false\n * @example isNegativeStrict('1234.56-') => false\n * @example isNegativeStrict('-1234.56') => true\n * @example isNegativeStrict('-1,234.56 €') => true\n *\n * @param {string} numericString\n * @param {string} negativeSignCharacter The single character that represent the negative sign\n * @returns {boolean}\n */\n static isNegativeStrict(numericString, negativeSignCharacter = '-') {\n return numericString.charAt(0) === negativeSignCharacter;\n }\n\n /**\n * Return `true` if the very first character is the opening bracket, and if the rest of the `valueString` also has the closing bracket.\n *\n * @param {string} valueString\n * @param {string} leftBracket\n * @param {string} rightBracket\n * @returns {boolean}\n */\n static isNegativeWithBrackets(valueString, leftBracket, rightBracket) {\n return valueString.charAt(0) === leftBracket && this.contains(valueString, rightBracket);\n }\n\n /**\n * Return `true` if the formatted or unformatted numeric string represent the value 0 (ie. '0,00 €'), or is empty (' €').\n * This works since we test if there are any numbers from 1 to 9 in the string. If there is none, then the number is zero (or the string is empty).\n *\n * @param {string} numericString\n * @returns {boolean}\n */\n static isZeroOrHasNoValue(numericString) {\n return !(/[1-9]/g).test(numericString);\n }\n\n /**\n * Return the negative version of the value (represented as a string) given as a parameter.\n * The numeric string is a valid Javascript number when typecast to a `Number`.\n *\n * @param {string} value\n * @returns {*}\n */\n static setRawNegativeSign(value) {\n if (!this.isNegativeStrict(value, '-')) {\n return `-${value}`;\n }\n\n return value;\n }\n\n /**\n * Replace the character at the position `index` in the string `string` by the character(s) `newCharacter`.\n *\n * @param {string} string\n * @param {int} index\n * @param {string} newCharacter\n * @returns {string}\n */\n static replaceCharAt(string, index, newCharacter) {\n return `${string.substr(0, index)}${newCharacter}${string.substr(index + newCharacter.length)}`;\n }\n\n /**\n * Return the value clamped to the nearest minimum/maximum value, as defined in the settings.\n *\n * @param {string|number} value\n * @param {object} settings\n * @returns {number}\n */\n static clampToRangeLimits(value, settings) {\n //XXX This function always assume `settings.minimumValue` is lower than `settings.maximumValue`\n return Math.max(settings.minimumValue, Math.min(settings.maximumValue, value));\n }\n\n /**\n * Return the number of number or dot characters on the left side of the caret, in a formatted number.\n *\n * @param {string} formattedNumberString\n * @param {int} caretPosition This must be a positive integer\n * @param {string} decimalCharacter\n * @returns {number}\n */\n static countNumberCharactersOnTheCaretLeftSide(formattedNumberString, caretPosition, decimalCharacter) {\n // Here we count the dot and report it as a number character too, since it will 'stay' in the Javascript number when unformatted\n const numberDotOrNegativeSign = new RegExp(`[0-9${decimalCharacter}-]`); // No need to escape the decimal character here, since it's in `[]`\n\n let numberDotAndNegativeSignCount = 0;\n for (let i = 0; i < caretPosition; i++) {\n // Test if the character is a number, a dot or an hyphen. If it is, count it, otherwise ignore it\n if (numberDotOrNegativeSign.test(formattedNumberString[i])) {\n numberDotAndNegativeSignCount++;\n }\n }\n\n return numberDotAndNegativeSignCount;\n }\n\n /**\n * Walk the `formattedNumberString` from left to right, one char by one, counting the `formattedNumberStringIndex`.\n * If the char is in the `rawNumberString` (starting at index 0), then `rawNumberStringIndex++`, and continue until\n * there is no more characters in `rawNumberString`) or that `rawNumberStringIndex === caretPositionInRawValue`.\n * When you stop, the `formattedNumberStringIndex` is the position where the caret should be set.\n *\n * @example\n * 1234567|89.01 : position 7 (rawNumberString)\n * 123.456.7|89,01 : position 9 (formattedNumberString)\n *\n * @param {string} rawNumberString\n * @param {int} caretPositionInRawValue\n * @param {string} formattedNumberString\n * @param {string} decimalCharacter\n * @returns {*}\n */\n static findCaretPositionInFormattedNumber(rawNumberString, caretPositionInRawValue, formattedNumberString, decimalCharacter) {\n const formattedNumberStringSize = formattedNumberString.length;\n const rawNumberStringSize = rawNumberString.length;\n\n let formattedNumberStringIndex;\n let rawNumberStringIndex = 0;\n for (formattedNumberStringIndex = 0;\n formattedNumberStringIndex < formattedNumberStringSize &&\n rawNumberStringIndex < rawNumberStringSize &&\n rawNumberStringIndex < caretPositionInRawValue;\n formattedNumberStringIndex++) {\n if (rawNumberString[rawNumberStringIndex] === formattedNumberString[formattedNumberStringIndex] ||\n (rawNumberString[rawNumberStringIndex] === '.' && formattedNumberString[formattedNumberStringIndex] === decimalCharacter)) {\n rawNumberStringIndex++;\n }\n }\n\n return formattedNumberStringIndex;\n }\n\n /**\n * Count the number of occurrence of the given character, in the given text.\n *\n * @param {string} character\n * @param {string} text\n * @returns {number}\n */\n static countCharInText(character, text) {\n let charCounter = 0;\n for (let i = 0; i < text.length; i++) {\n if (text[i] === character) {\n charCounter++;\n }\n }\n\n return charCounter;\n }\n\n /**\n * Return the index that can be used to set the caret position.\n * This takes into account that the position is starting at '0', not 1.\n *\n * @param {int} characterCount\n * @returns {number}\n */\n static convertCharacterCountToIndexPosition(characterCount) {\n return Math.max(characterCount, characterCount - 1);\n }\n\n /**\n * Cross browser routine for getting selected range/cursor position.\n * Note: this also works with edge cases like contenteditable-enabled elements, and hidden inputs.\n *\n * @param {HTMLInputElement|EventTarget} element\n * @returns {{}}\n */\n static getElementSelection(element) {\n const position = {};\n\n let isSelectionStartUndefined;\n try {\n isSelectionStartUndefined = this.isUndefined(element.selectionStart);\n } catch (error) {\n isSelectionStartUndefined = false;\n }\n\n try {\n if (isSelectionStartUndefined) {\n const selection = window.getSelection();\n const selectionInfo = selection.getRangeAt(0);\n position.start = selectionInfo.startOffset;\n position.end = selectionInfo.endOffset;\n position.length = position.end - position.start;\n } else {\n position.start = element.selectionStart;\n position.end = element.selectionEnd;\n position.length = position.end - position.start;\n }\n } catch (error) {\n // Manages the cases where :\n // - the 'contenteditable' elements that have no selections\n // - the <input> element is of type 'hidden'\n position.start = 0;\n position.end = 0;\n position.length = 0;\n }\n\n return position;\n }\n\n /**\n * Cross browser routine for setting selected range/cursor position\n *\n * @param {HTMLInputElement|EventTarget} element\n * @param {int} start\n * @param {int|null} end\n */\n static setElementSelection(element, start, end = null) {\n if (this.isUndefinedOrNullOrEmpty(end)) {\n end = start;\n }\n\n if (this.isInputElement(element)) {\n element.setSelectionRange(start, end);\n } else if (!AutoNumericHelper.isNull(element.firstChild)) {\n const range = document.createRange();\n range.setStart(element.firstChild, start);\n range.setEnd(element.firstChild, end);\n const selection = window.getSelection();\n selection.removeAllRanges();\n selection.addRange(range);\n }\n }\n\n /**\n * Function that throw error messages\n *\n * @param {string} message\n * @throws\n */\n static throwError(message) {\n throw new Error(message);\n }\n\n /**\n * Function that display a warning messages, according to the debug level.\n *\n * @param {string} message\n * @param {boolean} showWarning If FALSE, then the warning message is not displayed\n */\n static warning(message, showWarning = true) {\n if (showWarning) {\n /* eslint no-console: 0 */\n console.warn(`Warning: ${message}`);\n }\n }\n\n /**\n * Return `true` if the given event is a wheelup event\n *\n * @param {WheelEvent} wheelEvent\n * @returns {boolean}\n */\n static isWheelUpEvent(wheelEvent) {\n if (!wheelEvent.deltaY) {\n this.throwError(`The event passed as a parameter is not a valid wheel event, '${wheelEvent.type}' given.`);\n }\n\n return wheelEvent.deltaY < 0;\n }\n\n /**\n * Return `true` if the given event is a wheeldown event\n *\n * @param {WheelEvent} wheelEvent\n * @returns {boolean}\n */\n static isWheelDownEvent(wheelEvent) {\n if (!wheelEvent.deltaY) {\n this.throwError(`The event passed as a parameter is not a valid wheel event, '${wheelEvent.type}' given.`);\n }\n\n return wheelEvent.deltaY > 0;\n }\n\n /**\n * Return the given raw value truncated at the given number of decimal places `decimalPlaces`.\n * This function does not round the value.\n *\n * @example\n * forceDecimalPlaces(123.45678, 0) -> '123.45678'\n * forceDecimalPlaces(123.45678, 1) -> '123.4'\n * forceDecimalPlaces(123.45678, 2) -> '123.45'\n * forceDecimalPlaces(123.45678, 3) -> '123.456'\n *\n * @param {number} value\n * @param {int} decimalPlaces\n * @returns {number|string}\n */\n static forceDecimalPlaces(value, decimalPlaces) {\n // We could make sure `decimalPlaces` is an integer and positive, but we'll leave that to the dev calling this function.\n const [integerPart, decimalPart] = String(value).split('.');\n if (!decimalPart) {\n return value;\n }\n\n return `${integerPart}.${decimalPart.substr(0, decimalPlaces)}`;\n }\n\n /**\n * Return the 'nearest rounded' value, according to the given step size.\n * @example roundToNearest(264789, 10000)) => 260000\n *\n * @param {number} value\n * @param {number} stepPlace\n * @returns {*}\n */\n static roundToNearest(value, stepPlace = 1000) {\n if (0 === value) {\n return 0;\n }\n\n if (stepPlace === 0) {\n this.throwError('The `stepPlace` used to round is equal to `0`. This value must not be equal to zero.');\n }\n\n return Math.round(value / stepPlace) * stepPlace;\n }\n\n /**\n * Return the 'nearest rounded' value by automatically adding or subtracting the calculated offset to the initial value.\n * This is done without having to pass a step to this function, and based on the size of the given `value`.\n *\n * @example Calculated offset\n * 1 -> 1 (1)\n * 14 -> 10 (10)\n * 143 -> 140 (10)\n * 1.278 -> 1.300 (100)\n * 28.456 -> 28.500 (100)\n * 276.345 -> 276.000 (1.000)\n * 4.534.061 -> 4.530.000 (10.000)\n * 66.723.844 -> 66.700.000 (100.000)\n * 257.833.411 -> 258.000.000 (1.000.000)\n *\n * Initial Added Offset\n * 2 decimalPlacesRawValue : 1.12 -> 2.00 (1)\n * 3 decimalPlacesRawValue : 1.123 -> 2.000 (1)\n *\n * Special case when the `value` to round is between -1 and 1, excluded :\n * @example\n * Number of Initial Result Calculated\n * decimal places value (add) offset\n * 2 decimalPlacesRawValue : 0.12 -> 0.13 (0.01) : Math.pow(10, -2)\n * 2 decimalPlacesRawValue : 0.01 -> 0.02 (0.01)\n * 2 decimalPlacesRawValue : 0.00 -> 0.01 (0.01)\n *\n * 3 decimalPlacesRawValue : 0.123 -> 0.133 (0.01) : Math.pow(10, -2)\n * 3 decimalPlacesRawValue : 0.012 -> 0.013 (0.001) : Math.pow(10, -3)\n * 3 decimalPlacesRawValue : 0.001 -> 0.001 (0.001)\n * 3 decimalPlacesRawValue : 0.000 -> 0.001 (0.001)\n *\n * 4 decimalPlacesRawValue : 0.4123 -> 0.4200 (0.01) : Math.pow(10, -2)\n * 4 decimalPlacesRawValue : 0.0412 -> 0.0420 (0.001) : Math.pow(10, -3)\n * 4 decimalPlacesRawValue : 0.0041 -> 0.0042 (0.0001) : Math.pow(10, -4)\n * 4 decimalPlacesRawValue : 0.0004 -> 0.0005 (0.0001)\n * 4 decimalPlacesRawValue : 0.0000 -> 0.0001 (0.0001)\n *\n * @param {number} value\n * @param {boolean} isAddition\n * @param {int} decimalPlacesRawValue The precision needed by the `rawValue`\n * @returns {*}\n */\n static modifyAndRoundToNearestAuto(value, isAddition, decimalPlacesRawValue) {\n value = Number(this.forceDecimalPlaces(value, decimalPlacesRawValue)); // Make sure that '0.13000000001' is converted to the number of rawValue decimal places '0.13'\n\n const absValue = Math.abs(value);\n if (absValue >= 0 && absValue < 1) {\n const rawValueMinimumOffset = Math.pow(10, -decimalPlacesRawValue);\n if (value === 0) {\n // 4 decimalPlacesRawValue : 0.0000 -> 0.0001 (0.0001)\n return (isAddition)?rawValueMinimumOffset:-rawValueMinimumOffset;\n }\n\n let offset;\n const minimumOffsetFirstDecimalPlaceIndex = decimalPlacesRawValue;\n // Find where is the first non-zero decimal places\n const indexFirstNonZeroDecimalPlace = this.indexFirstNonZeroDecimalPlace(value);\n if (indexFirstNonZeroDecimalPlace >= minimumOffsetFirstDecimalPlaceIndex - 1) {\n /* 4 decimalPlacesRawValue : 0.0041 -> 0.0042 (0.0001) : Math.pow(10, -4)\n * 4 decimalPlacesRawValue : 0.0004 -> 0.0005 (0.0001)\n */\n offset = rawValueMinimumOffset;\n } else {\n offset = Math.pow(10, -(indexFirstNonZeroDecimalPlace + 1));\n }\n\n let result;\n if (isAddition) {\n result = value + offset;\n } else {\n result = value - offset;\n }\n\n return this.roundToNearest(result, offset);\n } else {\n // For values >= 1\n value = parseInt(value, 10);\n const lengthValue = Math.abs(value).toString().length; // `Math.abs()` is needed here to omit the negative sign '-' in case of a negative value\n\n let pow;\n switch (lengthValue) {\n // Special cases for small numbers\n case 1:\n pow = 0;\n break;\n case 2:\n case 3:\n pow = 1;\n break;\n case 4:\n case 5:\n pow = 2;\n break;\n // Default behavior\n default:\n pow = lengthValue - 3;\n }\n const offset = Math.pow(10, pow);\n\n let result;\n if (isAddition) {\n result = value + offset;\n } else {\n result = value - offset;\n }\n\n if (result <= 10 && result >= -10) {\n return result;\n }\n\n return this.roundToNearest(result, offset);\n }\n }\n\n /**\n * Return the 'nearest rounded' value automatically by adding the calculated offset to the initial value.\n * This will limit the result to the given number of decimal places `decimalPlacesLimit`.\n *\n * @param {number} value\n * @param {int} decimalPlacesLimit\n * @returns {*}\n */\n static addAndRoundToNearestAuto(value, decimalPlacesLimit) {\n return this.modifyAndRoundToNearestAuto(value, true, decimalPlacesLimit);\n }\n\n /**\n * Return the 'nearest rounded' value automatically by subtracting the calculated offset to the initial value.\n * This will limit the result to the given number of decimal places `decimalPlacesLimit`.\n *\n * @param {number} value\n * @param {int} decimalPlacesLimit\n * @returns {*}\n */\n static subtractAndRoundToNearestAuto(value, decimalPlacesLimit) {\n return this.modifyAndRoundToNearestAuto(value, false, decimalPlacesLimit);\n }\n\n /**\n * Take an arabic number as a string and return a javascript number.\n * By default, this function does not try to convert the arabic decimal and thousand separator characters.\n * This returns `NaN` is the conversion is not possible.\n * Based on http://stackoverflow.com/a/17025392/2834898\n *\n * @param {string} arabicNumbers\n * @param {boolean} returnANumber If `true`, return a Number, otherwise return a String\n * @param {boolean} parseDecimalCharacter\n * @param {boolean} parseThousandSeparator\n * @returns {string|number|NaN}\n */\n static arabicToLatinNumbers(arabicNumbers, returnANumber = true, parseDecimalCharacter = false, parseThousandSeparator = false) {\n if (this.isNull(arabicNumbers)) {\n return arabicNumbers;\n }\n\n let result = arabicNumbers.toString();\n if (result === '') {\n return arabicNumbers;\n }\n\n if (result.match(/[٠١٢٣٤٥٦٧٨٩۴۵۶]/g) === null) {\n // If no Arabic/Persian numbers are found, return the numeric string or number directly\n if (returnANumber) {\n result = Number(result);\n }\n\n return result;\n }\n\n if (parseDecimalCharacter) {\n result = result.replace(/٫/, '.'); // Decimal character\n }\n\n if (parseThousandSeparator) {\n result = result.replace(/٬/g, ''); // Thousand separator\n }\n\n // Replace the numbers only\n result = result.replace(/[٠١٢٣٤٥٦٧٨٩]/g, d => d.charCodeAt(0) - 1632) // Arabic numbers\n .replace(/[۰۱۲۳۴۵۶۷۸۹]/g, d => d.charCodeAt(0) - 1776); // Persian numbers\n\n // `NaN` has precedence over the string `'NaN'`\n const resultAsNumber = Number(result);\n if (isNaN(resultAsNumber)) {\n return resultAsNumber;\n }\n\n if (returnANumber) {\n result = resultAsNumber;\n }\n\n return result;\n }\n\n /**\n * Create a custom event and immediately sent it from the given element.\n * By default, if no element is given, the event is thrown from `document`.\n *\n * @param {string} eventName\n * @param {HTMLElement|HTMLDocument|EventTarget} element\n * @param {object} detail\n * @param {boolean} bubbles Set to `true` if the event must bubble up\n * @param {boolean} cancelable Set to `true` if the event must be cancelable\n */\n static triggerEvent(eventName, element = document, detail = null, bubbles = true, cancelable = true) {\n let event;\n if (window.CustomEvent) {\n event = new CustomEvent(eventName, { detail, bubbles , cancelable }); // This is not supported by default by IE ; We use the polyfill for IE9 and later.\n } else {\n event = document.createEvent('CustomEvent');\n event.initCustomEvent(eventName, bubbles, cancelable, { detail });\n }\n\n element.dispatchEvent(event);\n }\n\n /**\n * Function to parse minimumValue, maximumValue & the input value to prepare for testing to determine if the value falls within the min / max range.\n * Return an object example: minimumValue: \"999999999999999.99\" returns the following \"{s: -1, e: 12, c: Array[15]}\".\n *\n * This function is adapted from Big.js https://github.com/MikeMcl/big.js/. Many thanks to Mike.\n *\n * @param {number|string} n A numeric value.\n * @returns {{}}\n */\n static parseStr(n) {\n const x = {}; // A Big number instance.\n let e;\n let i;\n let nL;\n let j;\n\n // Minus zero?\n if (n === 0 && 1 / n < 0) {\n n = '-0';\n }\n\n // Determine sign. 1 positive, -1 negative\n n = n.toString();\n if (this.isNegativeStrict(n, '-')) {\n n = n.slice(1);\n x.s = -1;\n } else {\n x.s = 1;\n }\n\n // Decimal point?\n e = n.indexOf('.');\n if (e > -1) {\n n = n.replace('.', '');\n }\n\n // Length of string if no decimal character\n if (e < 0) {\n // Integer\n e = n.length;\n }\n\n // Determine leading zeros\n i = (n.search(/[1-9]/i) === -1) ? n.length : n.search(/[1-9]/i);\n nL = n.length;\n if (i === nL) {\n // Zero\n x.e = 0;\n x.c = [0];\n } else {\n // Determine trailing zeros\n for (j = nL - 1; n.charAt(j) === '0'; j -= 1) {\n nL -= 1;\n }\n nL -= 1;\n\n // Decimal location\n x.e = e - i - 1;\n x.c = [];\n\n // Convert string to array of digits without leading/trailing zeros\n for (e = 0; i <= nL; i += 1) {\n x.c[e] = +n.charAt(i);\n e += 1;\n }\n }\n\n return x;\n }\n\n /**\n * Function to test if the input value falls with the Min / Max settings.\n * This uses the parsed strings for the above parseStr function.\n *\n * This function is adapted from Big.js https://github.com/MikeMcl/big.js/. Many thanks to Mike.\n *\n * @param {object} y Big number instance\n * @param {object} x Big number instance\n * @returns {*}\n */\n static testMinMax(y, x) {\n const xc = x.c;\n const yc = y.c;\n let i = x.s;\n let j = y.s;\n let k = x.e;\n let l = y.e;\n\n // Either zero?\n if (!xc[0] || !yc[0]) {\n let result;\n if (!xc[0]) {\n result = !yc[0]?0:-j;\n } else {\n result = i;\n }\n return result;\n }\n\n // Signs differ?\n if (i !== j) {\n return i;\n }\n const xNeg = i < 0;\n\n // Compare exponents\n if (k !== l) {\n return (k > l ^ xNeg)?1:-1;\n }\n i = -1;\n k = xc.length;\n l = yc.length;\n j = (k < l) ? k : l;\n\n // Compare digit by digit\n for (i += 1; i < j; i += 1) {\n if (xc[i] !== yc[i]) {\n return (xc[i] > yc[i] ^ xNeg)?1:-1;\n }\n }\n\n // Compare lengths\n let result;\n if (k === l) {\n result = 0;\n } else {\n result = (k > l ^ xNeg)?1:-1;\n }\n\n return result;\n }\n\n /**\n * Generate a random string.\n * cf. http://stackoverflow.com/a/8084248/2834898\n *\n * @param {Number} strLength Length of the generated string (in character count)\n * @returns {string}\n */\n static randomString(strLength = 5) {\n return Math.random()\n .toString(36)\n .substr(2, strLength);\n }\n\n /**\n * Return the DOM element when passed either a DOM element or a selector string.\n *\n * @param {HTMLElement|string} domElementOrSelector\n * @returns {HTMLElement}\n */\n static domElement(domElementOrSelector) {\n let domElement;\n if (AutoNumericHelper.isString(domElementOrSelector)) {\n domElement = document.querySelector(domElementOrSelector);\n } else {\n domElement = domElementOrSelector;\n }\n\n return domElement;\n }\n\n /**\n * Retrieve the current element value.\n *\n * @param {HTMLElement|HTMLInputElement|EventTarget} element\n * @returns {number|string|null}\n */\n static getElementValue(element) {\n if (element.tagName.toLowerCase() === 'input') {\n return element.value;\n }\n\n return this.text(element);\n }\n\n /**\n * Modify the element value directly.\n *\n * @param {HTMLElement|HTMLInputElement} element\n * @param {number|string|null} value\n */\n static setElementValue(element, value = null) {\n if (element.tagName.toLowerCase() === 'input') {\n element.value = value;\n } else {\n element.textContent = value;\n }\n }\n\n /**\n * This clone the given object, and return it.\n * WARNING: This does not do a deep cloning.\n * cf. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign#Examples\n * //TODO Add a `deep` option to clone object with more than one depth\n *\n * @param {object} obj\n * @returns {object}\n */\n static cloneObject(obj) {\n return Object.assign({}, obj);\n }\n\n /**\n * Return a 'camelized' version of the given string.\n * By default, this assume that :\n * - the separators are hyphens '-',\n * - the 'data-' string should be removed, and\n * - that the very first word should not be capitalized.\n *\n * @example camelize('data-currency-symbol') => 'currencySymbol'\n *\n * @param {string} str Text to camelize\n * @param {string} separator Character that separate each word\n * @param {boolean} removeData If set to `true`, remove the `data-` part that you can find on some html attributes\n * @param {boolean} skipFirstWord If set to `true`, do not capitalize the very first word\n * @returns {string|null}\n */\n static camelize(str, separator = '-', removeData = true, skipFirstWord = true) {\n if (this.isNull(str)) {\n return null;\n }\n\n if (removeData) {\n str = str.replace(/^data-/, '');\n }\n\n // Cut the string into words\n const words = str.split(separator);\n\n // Capitalize each word\n let result = words.map(word => `${word.charAt(0).toUpperCase()}${word.slice(1)}`);\n\n // Then concatenate them back\n result = result.join('');\n\n if (skipFirstWord) {\n // Skip the very first letter\n result = `${result.charAt(0).toLowerCase()}${result.slice(1)}`;\n }\n\n return result;\n }\n\n /**\n * Return the text component of the given DOM element.\n *\n * @param {Element} domElement\n * @returns {string}\n */\n static text(domElement) {\n const nodeType = domElement.nodeType;\n\n let result;\n // cf. https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType\n if (nodeType === Node.ELEMENT_NODE ||\n nodeType === Node.DOCUMENT_NODE ||\n nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n result = domElement.textContent;\n } else if (nodeType === Node.TEXT_NODE) {\n result = domElement.nodeValue;\n } else {\n result = '';\n }\n\n return result;\n }\n\n /**\n * Set the text content of the given DOM element.\n * @param {Element} domElement\n * @param {string} text\n */\n static setText(domElement, text) {\n const nodeType = domElement.nodeType;\n if (nodeType === Node.ELEMENT_NODE ||\n nodeType === Node.DOCUMENT_NODE ||\n nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n domElement.textContent = text;\n }\n //TODO Display a warning if that function does not do anything?\n }\n\n /**\n * Filter out the given `arr` array with the elements found in `excludedElements`.\n * This returns a new array and does not modify the source.\n * cf. verification here : http://codepen.io/AnotherLinuxUser/pen/XpvrMg?editors=0012\n *\n * @param {Array} arr\n * @param {Array} excludedElements\n * @returns {*|Array.<T>}\n */\n static filterOut(arr, excludedElements) {\n return arr.filter(element => !this.isInArray(element, excludedElements));\n }\n\n /**\n * Remove the trailing zeros in the decimal part of a number.\n *\n * @param {string} numericString\n * @returns {*}\n */\n static trimPaddedZerosFromDecimalPlaces(numericString) {\n numericString = String(numericString);\n if (numericString === '') {\n return '';\n }\n\n const [integerPart, decimalPart] = numericString.split('.');\n if (this.isUndefinedOrNullOrEmpty(decimalPart)) {\n return integerPart;\n }\n\n const trimmedDecimalPart = decimalPart.replace(/0+$/g, '');\n\n let result;\n if (trimmedDecimalPart === '') {\n result = integerPart;\n } else {\n result = `${integerPart}.${trimmedDecimalPart}`;\n }\n\n return result;\n }\n\n /**\n * Return the top-most hovered item by the mouse cursor.\n *\n * @returns {*}\n */\n static getHoveredElement() {\n const hoveredElements = [...document.querySelectorAll(':hover')];\n return hoveredElements[hoveredElements.length - 1];\n }\n\n /**\n * Return the given array trimmed to the given length.\n * @example arrayTrim([1, 2, 3, 4], 2) -> [1, 2]\n *\n * @param {Array} array\n * @param {Number} length\n * @returns {*}\n */\n static arrayTrim(array, length) {\n const arrLength = array.length;\n if (arrLength === 0 || length > arrLength) {\n // Also manage the case where `length` is higher than the current length\n return array;\n }\n\n if (length < 0) {\n return [];\n }\n\n array.length = parseInt(length, 10);\n\n return array;\n }\n\n /**\n * Merge all the given arrays by keeping only unique elements, and return an array with de-duplicated values.\n * cf. http://stackoverflow.com/a/27664971/2834898\n *\n * @param {...array} arrays\n * @returns {[*]}\n */\n static arrayUnique(...arrays) { //FIXME à tester\n return [...new Set([].concat(...arrays))];\n }\n\n /**\n * Merge all the given Maps by keeping only unique elements, and return a new Map with de-duplicated keys.\n *\n * @param {...Map} mapObjects\n * @returns {Map}\n */\n static mergeMaps(...mapObjects) {\n return new Map(mapObjects.reduce((as, b) => as.concat([...b]), []));\n }\n\n /**\n * Search the given `value` in the object `obj`, and return the very first key it finds\n *\n * @param {object} obj\n * @param {string|number} value\n * @returns {*|null}\n */\n static objectKeyLookup(obj, value) {\n const result = Object.entries(obj).find(array => array[1] === value);\n let key = null;\n if (result !== void(0)) {\n key = result[0];\n }\n\n return key;\n }\n\n /**\n * Insert the single character `char` in the string `str` at the given position `index`\n *\n * @param {string} str\n * @param {string} char\n * @param {int} index\n * @returns {string}\n */\n static insertAt(str, char, index) {\n str = String(str);\n\n if (index > str.length) {\n throw new Error(`The given index is out of the string range.`);\n }\n\n if (char.length !== 1) {\n throw new Error('The given string `char` should be only one character long.');\n }\n\n if (str === '' && index === 0) {\n return char;\n }\n\n return `${str.slice(0, index)}${char}${str.slice(index)}`;\n }\n\n /**\n * Convert the given scientific notation to the 'expanded' decimal notation\n *\n * @example scientificToDecimal('-123.4567e-6') returns '-0.0001234567'\n *\n * @param {number|string} val\n * @returns {number|string}\n */\n static scientificToDecimal(val) {\n // Check that the val is a Number\n const numericValue = Number(val);\n if (isNaN(numericValue)) {\n return NaN;\n }\n\n // Check if the number is in a scientific notation\n val = String(val);\n const isScientific = val.includes('e') || val.includes('E');\n\n if (!isScientific) {\n return val;\n }\n\n // Convert the scientific notation to a numeric string\n let [value, exponent] = val.split(/e/i);\n const isNegative = value < 0;\n if (isNegative) {\n value = value.replace('-', '');\n }\n\n const isNegativeExponent = +exponent < 0;\n if (isNegativeExponent) {\n exponent = exponent.replace('-', ''); // Remove the negative sign\n }\n\n const [int, float] = value.split(/\\./);\n\n let result;\n if (isNegativeExponent) {\n if (int.length > exponent) {\n // Place the decimal point at the int length count minus exponent\n result = this.insertAt(int, '.', int.length - exponent);\n } else {\n // If that decimal point is greater than the int length, pad with zeros (ie. Number('-123.4567e-6') --> -0.0001234567)\n result = `0.${'0'.repeat(exponent - int.length)}${int}`;\n }\n\n result = `${result}${float?float:''}`;\n } else { // Positive exponent\n if (float) {\n value = `${int}${float}`; // Remove the '.', if any\n if (exponent < float.length) {\n result = this.insertAt(value, '.', +exponent + int.length);\n } else {\n result = `${value}${'0'.repeat(exponent - float.length)}`;\n }\n } else {\n value = value.replace('.', ''); // Single case where val is '1.e4'\n result = `${value}${'0'.repeat(Number(exponent))}`;\n }\n }\n\n if (isNegative) {\n // Put back the negative sign, if any\n result = `-${result}`;\n }\n\n return result;\n }\n}\n","/**\n * Pre-defined options for autoNumeric.js\n * @author Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>\n * @copyright © 2016 Alexandre Bonneau\n *\n * The MIT License (http://www.opensource.org/licenses/mit-license.php)\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sub license, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n\nimport AutoNumeric from './AutoNumeric';\nimport AutoNumericHelper from './AutoNumericHelper';\n\nconst euro = { // Français\n digitGroupSeparator : AutoNumeric.options.digitGroupSeparator.dot, // or '\\u202f'\n decimalCharacter : AutoNumeric.options.decimalCharacter.comma,\n decimalCharacterAlternative : AutoNumeric.options.decimalCharacterAlternative.dot,\n currencySymbol : '\\u202f€',\n currencySymbolPlacement : AutoNumeric.options.currencySymbolPlacement.suffix,\n negativePositiveSignPlacement: AutoNumeric.options.negativePositiveSignPlacement.prefix,\n};\n\nconst dollar = {\n digitGroupSeparator : AutoNumeric.options.digitGroupSeparator.comma,\n decimalCharacter : AutoNumeric.options.decimalCharacter.dot,\n currencySymbol : AutoNumeric.options.currencySymbol.dollar,\n currencySymbolPlacement : AutoNumeric.options.currencySymbolPlacement.prefix,\n negativePositiveSignPlacement: AutoNumeric.options.negativePositiveSignPlacement.right,\n};\n\nconst japanese = { // 日本語\n digitGroupSeparator : AutoNumeric.options.digitGroupSeparator.comma,\n decimalCharacter : AutoNumeric.options.decimalCharacter.dot,\n currencySymbol : AutoNumeric.options.currencySymbol.yen,\n currencySymbolPlacement : AutoNumeric.options.currencySymbolPlacement.prefix,\n negativePositiveSignPlacement: AutoNumeric.options.negativePositiveSignPlacement.right,\n};\n\n\n// Here we need to clone the initial objects in order to be able to edit the clones without affecting the originals\nconst euroPos = AutoNumericHelper.cloneObject(euro);\neuroPos.minimumValue = 0;\nconst euroNeg = AutoNumericHelper.cloneObject(euro);\neuroNeg.maximumValue = 0;\neuroNeg.negativePositiveSignPlacement = AutoNumeric.options.negativePositiveSignPlacement.prefix;\n\nconst euroSpace = AutoNumericHelper.cloneObject(euro);\neuroSpace.digitGroupSeparator = AutoNumeric.options.digitGroupSeparator.normalSpace;\nconst euroSpacePos = AutoNumericHelper.cloneObject(euroSpace);\neuroSpacePos.minimumValue = 0;\nconst euroSpaceNeg = AutoNumericHelper.cloneObject(euroSpace);\neuroSpaceNeg.maximumValue = 0;\neuroSpaceNeg.negativePositiveSignPlacement = AutoNumeric.options.negativePositiveSignPlacement.prefix;\n\nconst percentageEU2dec = AutoNumericHelper.cloneObject(euro);\npercentageEU2dec.currencySymbol = AutoNumeric.options.currencySymbol.none;\npercentageEU2dec.suffixText = `\\u202f${AutoNumeric.options.suffixText.percentage}`;\npercentageEU2dec.wheelStep = 0.0001; // This targets the `rawValue`, not the formatted one\npercentageEU2dec.rawValueDivisor = AutoNumeric.options.rawValueDivisor.percentage;\nconst percentageEU2decPos = AutoNumericHelper.cloneObject(percentageEU2dec);\npercentageEU2decPos.minimumValue = 0;\nconst percentageEU2decNeg = AutoNumericHelper.cloneObject(percentageEU2dec);\npercentageEU2decNeg.maximumValue = 0;\npercentageEU2decNeg.negativePositiveSignPlacement = AutoNumeric.options.negativePositiveSignPlacement.prefix;\n\nconst percentageEU3dec = AutoNumericHelper.cloneObject(percentageEU2dec);\npercentageEU3dec.decimalPlaces = 3;\nconst percentageEU3decPos = AutoNumericHelper.cloneObject(percentageEU2decPos);\npercentageEU3decPos.decimalPlaces = 3;\nconst percentageEU3decNeg = AutoNumericHelper.cloneObject(percentageEU2decNeg);\npercentageEU3decNeg.decimalPlaces = 3;\n\nconst dollarPos = AutoNumericHelper.cloneObject(dollar);\ndollarPos.minimumValue = 0;\nconst dollarNeg = AutoNumericHelper.cloneObject(dollar);\ndollarNeg.maximumValue = 0;\ndollarNeg.negativePositiveSignPlacement = AutoNumeric.options.negativePositiveSignPlacement.prefix;\nconst dollarNegBrackets = AutoNumericHelper.cloneObject(dollarNeg);\ndollarNegBrackets.negativeBracketsTypeOnBlur = AutoNumeric.options.negativeBracketsTypeOnBlur.parentheses;\n\nconst percentageUS2dec = AutoNumericHelper.cloneObject(dollar);\npercentageUS2dec.currencySymbol = AutoNumeric.options.currencySymbol.none;\npercentageUS2dec.suffixText = AutoNumeric.options.suffixText.percentage;\npercentageUS2dec.wheelStep = 0.0001;\npercentageEU2dec.rawValueDivisor = AutoNumeric.options.rawValueDivisor.percentage;\nconst percentageUS2decPos = AutoNumericHelper.cloneObject(percentageUS2dec);\npercentageUS2decPos.minimumValue = 0;\nconst percentageUS2decNeg = AutoNumericHelper.cloneObject(percentageUS2dec);\npercentageUS2decNeg.maximumValue = 0;\npercentageUS2decNeg.negativePositiveSignPlacement = AutoNumeric.options.negativePositiveSignPlacement.prefix;\n\nconst percentageUS3dec = AutoNumericHelper.cloneObject(percentageUS2dec);\npercentageUS3dec.decimalPlaces = 3;\nconst percentageUS3decPos = AutoNumericHelper.cloneObject(percentageUS2decPos);\npercentageUS3decPos.decimalPlaces = 3;\nconst percentageUS3decNeg = AutoNumericHelper.cloneObject(percentageUS2decNeg);\npercentageUS3decNeg.decimalPlaces = 3;\n\n/**\n * Predefined options for the most common languages\n */\nObject.defineProperty(AutoNumeric, 'predefinedOptions', {\n get() {\n return {\n euro,\n euroPos,\n euroNeg,\n euroSpace,\n euroSpacePos,\n euroSpaceNeg,\n percentageEU2dec,\n percentageEU2decPos,\n percentageEU2decNeg,\n percentageEU3dec,\n percentageEU3decPos,\n percentageEU3decNeg,\n dollar,\n dollarPos,\n dollarNeg,\n dollarNegBrackets,\n percentageUS2dec,\n percentageUS2decPos,\n percentageUS2decNeg,\n percentageUS3dec,\n percentageUS3decPos,\n percentageUS3decNeg,\n French : euro, // Français\n Spanish : euro, // Español\n NorthAmerican : dollar,\n British : {\n digitGroupSeparator : AutoNumeric.options.digitGroupSeparator.comma,\n decimalCharacter : AutoNumeric.options.decimalCharacter.dot,\n currencySymbol : AutoNumeric.options.currencySymbol.pound,\n currencySymbolPlacement : AutoNumeric.options.currencySymbolPlacement.prefix,\n negativePositiveSignPlacement: AutoNumeric.options.negativePositiveSignPlacement.right,\n },\n Swiss : { // Suisse\n digitGroupSeparator : AutoNumeric.options.digitGroupSeparator.apostrophe,\n decimalCharacter : AutoNumeric.options.decimalCharacter.dot,\n currencySymbol : '\\u202fCHF',\n currencySymbolPlacement : AutoNumeric.options.currencySymbolPlacement.suffix,\n negativePositiveSignPlacement: AutoNumeric.options.negativePositiveSignPlacement.prefix,\n },\n Japanese : japanese, // 日本語\n Chinese : japanese, // 中国語 (Chinese)\n Brazilian : {\n digitGroupSeparator : AutoNumeric.options.digitGroupSeparator.dot,\n decimalCharacter : AutoNumeric.options.decimalCharacter.comma,\n currencySymbol : AutoNumeric.options.currencySymbol.real,\n currencySymbolPlacement : AutoNumeric.options.currencySymbolPlacement.prefix,\n negativePositiveSignPlacement: AutoNumeric.options.negativePositiveSignPlacement.right,\n },\n dotDecimalCharCommaSeparator: {\n digitGroupSeparator: AutoNumeric.options.digitGroupSeparator.comma,\n decimalCharacter : AutoNumeric.options.decimalCharacter.dot,\n },\n commaDecimalCharDotSeparator: {\n digitGroupSeparator : AutoNumeric.options.digitGroupSeparator.dot,\n decimalCharacter : AutoNumeric.options.decimalCharacter.comma,\n decimalCharacterAlternative: AutoNumeric.options.decimalCharacterAlternative.dot,\n },\n integer : {\n decimalPlaces: 0,\n },\n integerPos : {\n minimumValue : AutoNumeric.options.minimumValue.zero,\n decimalPlaces: 0,\n },\n integerNeg : {\n maximumValue : AutoNumeric.options.maximumValue.zero,\n decimalPlaces: 0,\n },\n float : {\n allowDecimalPadding: AutoNumeric.options.allowDecimalPadding.never,\n },\n floatPos : {\n allowDecimalPadding: AutoNumeric.options.allowDecimalPadding.never,\n minimumValue : AutoNumeric.options.minimumValue.zero,\n maximumValue : AutoNumeric.options.maximumValue.tenTrillions,\n },\n floatNeg : {\n allowDecimalPadding: AutoNumeric.options.allowDecimalPadding.never,\n minimumValue : AutoNumeric.options.minimumValue.tenTrillions,\n maximumValue : AutoNumeric.options.maximumValue.zero,\n },\n numeric : {\n digitGroupSeparator: AutoNumeric.options.digitGroupSeparator.noSeparator,\n decimalCharacter : AutoNumeric.options.decimalCharacter.dot,\n currencySymbol : AutoNumeric.options.currencySymbol.none,\n },\n numericPos : {\n digitGroupSeparator: AutoNumeric.options.digitGroupSeparator.noSeparator,\n decimalCharacter : AutoNumeric.options.decimalCharacter.dot,\n currencySymbol : AutoNumeric.options.currencySymbol.none,\n minimumValue : AutoNumeric.options.minimumValue.zero,\n maximumValue : AutoNumeric.options.maximumValue.tenTrillions,\n },\n numericNeg : {\n digitGroupSeparator: AutoNumeric.options.digitGroupSeparator.noSeparator,\n decimalCharacter : AutoNumeric.options.decimalCharacter.dot,\n currencySymbol : AutoNumeric.options.currencySymbol.none,\n minimumValue : AutoNumeric.options.minimumValue.tenTrillions,\n maximumValue : AutoNumeric.options.maximumValue.zero,\n },\n };\n },\n});\n","/**\n * Default settings for autoNumeric.js\n * @author Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>\n * @copyright © 2016 Alexandre Bonneau\n *\n * The MIT License (http://www.opensource.org/licenses/mit-license.php)\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sub license, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n\nimport AutoNumeric from './AutoNumeric';\nimport AutoNumericOptions from './AutoNumericOptions';\n\n/* eslint no-unused-vars: 0 */\n\n/**\n * The defaults options.\n * These can be overridden by the following methods:\n * - HTML5 data attributes (ie. `<input type=\"text\" data-currency-symbol=\" €\">`)\n * - Options passed to the `update` method (ie. `anElement.update({ currencySymbol: ' €' });`), or simply during the initialization (ie. `new AutoNumeric(domElement, { options });`)\n */\nObject.defineProperty(AutoNumeric, 'defaultSettings', {\n get() {\n return {\n allowDecimalPadding : AutoNumeric.options.allowDecimalPadding.always,\n caretPositionOnFocus : AutoNumeric.options.caretPositionOnFocus.doNoForceCaretPosition,\n createLocalList : AutoNumeric.options.createLocalList.createList,\n currencySymbol : AutoNumeric.options.currencySymbol.none,\n currencySymbolPlacement : AutoNumeric.options.currencySymbolPlacement.prefix,\n decimalCharacter : AutoNumeric.options.decimalCharacter.dot,\n decimalCharacterAlternative : AutoNumeric.options.decimalCharacterAlternative.none,\n decimalPlaces : AutoNumeric.options.decimalPlaces.two,\n decimalPlacesRawValue : AutoNumeric.options.decimalPlacesRawValue.useDefault,\n decimalPlacesShownOnBlur : AutoNumeric.options.decimalPlacesShownOnBlur.useDefault,\n decimalPlacesShownOnFocus : AutoNumeric.options.decimalPlacesShownOnFocus.useDefault,\n defaultValueOverride : AutoNumeric.options.defaultValueOverride.doNotOverride,\n digitalGroupSpacing : AutoNumeric.options.digitalGroupSpacing.three,\n digitGroupSeparator : AutoNumeric.options.digitGroupSeparator.comma,\n divisorWhenUnfocused : AutoNumeric.options.divisorWhenUnfocused.none,\n emptyInputBehavior : AutoNumeric.options.emptyInputBehavior.focus,\n eventBubbles : AutoNumeric.options.eventBubbles.bubbles,\n eventIsCancelable : AutoNumeric.options.eventIsCancelable.isCancelable,\n failOnUnknownOption : AutoNumeric.options.failOnUnknownOption.ignore,\n formatOnPageLoad : AutoNumeric.options.formatOnPageLoad.format,\n historySize : AutoNumeric.options.historySize.medium,\n isCancellable : AutoNumeric.options.isCancellable.cancellable,\n leadingZero : AutoNumeric.options.leadingZero.deny,\n maximumValue : AutoNumeric.options.maximumValue.tenTrillions,\n minimumValue : AutoNumeric.options.minimumValue.tenTrillions,\n modifyValueOnWheel : AutoNumeric.options.modifyValueOnWheel.modifyValue,\n negativeBracketsTypeOnBlur : AutoNumeric.options.negativeBracketsTypeOnBlur.none,\n negativePositiveSignPlacement: AutoNumeric.options.negativePositiveSignPlacement.none,\n negativeSignCharacter : AutoNumeric.options.negativeSignCharacter.hyphen,\n noEventListeners : AutoNumeric.options.noEventListeners.addEvents,\n //TODO Shouldn't we use `truncate` as the default value?\n onInvalidPaste : AutoNumeric.options.onInvalidPaste.error,\n outputFormat : AutoNumeric.options.outputFormat.none,\n overrideMinMaxLimits : AutoNumeric.options.overrideMinMaxLimits.doNotOverride,\n positiveSignCharacter : AutoNumeric.options.positiveSignCharacter.plus,\n rawValueDivisor : AutoNumeric.options.rawValueDivisor.none,\n readOnly : AutoNumeric.options.readOnly.readWrite,\n roundingMethod : AutoNumeric.options.roundingMethod.halfUpSymmetric,\n saveValueToSessionStorage : AutoNumeric.options.saveValueToSessionStorage.doNotSave,\n selectNumberOnly : AutoNumeric.options.selectNumberOnly.selectNumbersOnly,\n selectOnFocus : AutoNumeric.options.selectOnFocus.select,\n serializeSpaces : AutoNumeric.options.serializeSpaces.plus,\n showOnlyNumbersOnFocus : AutoNumeric.options.showOnlyNumbersOnFocus.showAll,\n showPositiveSign : AutoNumeric.options.showPositiveSign.hide,\n showWarnings : AutoNumeric.options.showWarnings.show,\n styleRules : AutoNumeric.options.styleRules.none,\n suffixText : AutoNumeric.options.suffixText.none,\n symbolWhenUnfocused : AutoNumeric.options.symbolWhenUnfocused.none,\n unformatOnHover : AutoNumeric.options.unformatOnHover.unformat,\n unformatOnSubmit : AutoNumeric.options.unformatOnSubmit.keepCurrentValue,\n valuesToStrings : AutoNumeric.options.valuesToStrings.none,\n watchExternalChanges : AutoNumeric.options.watchExternalChanges.doNotWatch,\n wheelOn : AutoNumeric.options.wheelOn.focus,\n wheelStep : AutoNumeric.options.wheelStep.progressive,\n };\n },\n});\n\n","/**\n * Options for autoNumeric.js\n * @author Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>\n * @copyright © 2017 Alexandre Bonneau\n *\n * The MIT License (http://www.opensource.org/licenses/mit-license.php)\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sub license, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n\nimport AutoNumeric from './AutoNumeric';\n\n/**\n * Event list managed by AutoNumeric\n *\n * @type {{initialized: string, formatted: string, minRangeExceeded: string, maxRangeExceeded: string, native: {input: string, change: string}}}\n */\nObject.defineProperty(AutoNumeric, 'events', {\n get() {\n return {\n initialized : 'autoNumeric:initialized',\n formatted : 'autoNumeric:formatted',\n rawValueModified: 'autoNumeric:rawValueModified',\n minRangeExceeded: 'autoNumeric:minExceeded',\n maxRangeExceeded: 'autoNumeric:maxExceeded',\n native : {\n input : 'input',\n change: 'change',\n },\n };\n },\n});\n","/**\n * Babel + Webpack workaround for autoNumeric\n *\n * @author Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>\n * @copyright © 2017 Alexandre Bonneau\n *\n * The MIT License (http://www.opensource.org/licenses/mit-license.php)\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sub license, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n\nimport AutoNumeric from './AutoNumeric';\nimport AutoNumericEvents from './AutoNumericEvents';\nimport AutoNumericOptions from './AutoNumericOptions';\nimport AutoNumericDefaultSettings from './AutoNumericDefaultSettings';\nimport AutoNumericPredefinedOptions from './AutoNumericPredefinedOptions';\n\n/* eslint no-unused-vars: 0 */\n\n/**\n * This file serve as the main entry point to the library.\n *\n * @type {AutoNumeric}\n */\nexport default AutoNumeric;\n"],"sourceRoot":""} |