{"version":3,"sources":["node_modules/ngx-mask/fesm2022/ngx-mask.mjs"],"sourcesContent":["import * as i0 from '@angular/core';\nimport { InjectionToken, EventEmitter, inject, Injectable, ElementRef, Renderer2, makeEnvironmentProviders, Directive, Input, Output, HostListener, Pipe } from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\nimport { NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';\nvar MaskExpression = /*#__PURE__*/function (MaskExpression) {\n MaskExpression[\"SEPARATOR\"] = \"separator\";\n MaskExpression[\"PERCENT\"] = \"percent\";\n MaskExpression[\"IP\"] = \"IP\";\n MaskExpression[\"CPF_CNPJ\"] = \"CPF_CNPJ\";\n MaskExpression[\"MONTH\"] = \"M\";\n MaskExpression[\"MONTHS\"] = \"M0\";\n MaskExpression[\"MINUTE\"] = \"m\";\n MaskExpression[\"HOUR\"] = \"h\";\n MaskExpression[\"HOURS\"] = \"H\";\n MaskExpression[\"MINUTES\"] = \"m0\";\n MaskExpression[\"HOURS_HOUR\"] = \"Hh\";\n MaskExpression[\"SECONDS\"] = \"s0\";\n MaskExpression[\"HOURS_MINUTES_SECONDS\"] = \"Hh:m0:s0\";\n MaskExpression[\"EMAIL_MASK\"] = \"A*@A*.A*\";\n MaskExpression[\"HOURS_MINUTES\"] = \"Hh:m0\";\n MaskExpression[\"MINUTES_SECONDS\"] = \"m0:s0\";\n MaskExpression[\"DAYS_MONTHS_YEARS\"] = \"d0/M0/0000\";\n MaskExpression[\"DAYS_MONTHS\"] = \"d0/M0\";\n MaskExpression[\"DAYS\"] = \"d0\";\n MaskExpression[\"DAY\"] = \"d\";\n MaskExpression[\"SECOND\"] = \"s\";\n MaskExpression[\"LETTER_S\"] = \"S\";\n MaskExpression[\"DOT\"] = \".\";\n MaskExpression[\"COMMA\"] = \",\";\n MaskExpression[\"CURLY_BRACKETS_LEFT\"] = \"{\";\n MaskExpression[\"CURLY_BRACKETS_RIGHT\"] = \"}\";\n MaskExpression[\"MINUS\"] = \"-\";\n MaskExpression[\"OR\"] = \"||\";\n MaskExpression[\"HASH\"] = \"#\";\n MaskExpression[\"EMPTY_STRING\"] = \"\";\n MaskExpression[\"SYMBOL_STAR\"] = \"*\";\n MaskExpression[\"SYMBOL_QUESTION\"] = \"?\";\n MaskExpression[\"SLASH\"] = \"/\";\n MaskExpression[\"WHITE_SPACE\"] = \" \";\n MaskExpression[\"NUMBER_ZERO\"] = \"0\";\n MaskExpression[\"NUMBER_NINE\"] = \"9\";\n MaskExpression[\"BACKSPACE\"] = \"Backspace\";\n MaskExpression[\"DELETE\"] = \"Delete\";\n MaskExpression[\"ARROW_LEFT\"] = \"ArrowLeft\";\n MaskExpression[\"ARROW_UP\"] = \"ArrowUp\";\n MaskExpression[\"DOUBLE_ZERO\"] = \"00\";\n return MaskExpression;\n}(MaskExpression || {});\nconst NGX_MASK_CONFIG = new InjectionToken('ngx-mask config');\nconst NEW_CONFIG = new InjectionToken('new ngx-mask config');\nconst INITIAL_CONFIG = new InjectionToken('initial ngx-mask config');\nconst initialConfig = {\n suffix: '',\n prefix: '',\n thousandSeparator: ' ',\n decimalMarker: ['.', ','],\n clearIfNotMatch: false,\n showTemplate: false,\n showMaskTyped: false,\n placeHolderCharacter: '_',\n dropSpecialCharacters: true,\n hiddenInput: null,\n shownMaskExpression: '',\n separatorLimit: '',\n allowNegativeNumbers: false,\n validation: true,\n specialCharacters: ['-', '/', '(', ')', '.', ':', ' ', '+', ',', '@', '[', ']', '\"', \"'\"],\n leadZeroDateTime: false,\n apm: false,\n leadZero: false,\n keepCharacterPositions: false,\n triggerOnMaskChange: false,\n inputTransformFn: value => value,\n outputTransformFn: value => value,\n maskFilled: new EventEmitter(),\n patterns: {\n '0': {\n pattern: new RegExp('\\\\d')\n },\n '9': {\n pattern: new RegExp('\\\\d'),\n optional: true\n },\n X: {\n pattern: new RegExp('\\\\d'),\n symbol: '*'\n },\n A: {\n pattern: new RegExp('[a-zA-Z0-9]')\n },\n S: {\n pattern: new RegExp('[a-zA-Z]')\n },\n U: {\n pattern: new RegExp('[A-Z]')\n },\n L: {\n pattern: new RegExp('[a-z]')\n },\n d: {\n pattern: new RegExp('\\\\d')\n },\n m: {\n pattern: new RegExp('\\\\d')\n },\n M: {\n pattern: new RegExp('\\\\d')\n },\n H: {\n pattern: new RegExp('\\\\d')\n },\n h: {\n pattern: new RegExp('\\\\d')\n },\n s: {\n pattern: new RegExp('\\\\d')\n }\n }\n};\nconst timeMasks = [MaskExpression.HOURS_MINUTES_SECONDS, MaskExpression.HOURS_MINUTES, MaskExpression.MINUTES_SECONDS];\nconst withoutValidation = [MaskExpression.PERCENT, MaskExpression.HOURS_HOUR, MaskExpression.SECONDS, MaskExpression.MINUTES, MaskExpression.SEPARATOR, MaskExpression.DAYS_MONTHS_YEARS, MaskExpression.DAYS_MONTHS, MaskExpression.DAYS, MaskExpression.MONTHS];\nlet NgxMaskApplierService = /*#__PURE__*/(() => {\n class NgxMaskApplierService {\n _config = inject(NGX_MASK_CONFIG);\n dropSpecialCharacters = this._config.dropSpecialCharacters;\n hiddenInput = this._config.hiddenInput;\n showTemplate;\n clearIfNotMatch = this._config.clearIfNotMatch;\n specialCharacters = this._config.specialCharacters;\n patterns = this._config.patterns;\n prefix = this._config.prefix;\n suffix = this._config.suffix;\n thousandSeparator = this._config.thousandSeparator;\n decimalMarker = this._config.decimalMarker;\n customPattern;\n showMaskTyped = this._config.showMaskTyped;\n placeHolderCharacter = this._config.placeHolderCharacter;\n validation = this._config.validation;\n separatorLimit = this._config.separatorLimit;\n allowNegativeNumbers = this._config.allowNegativeNumbers;\n leadZeroDateTime = this._config.leadZeroDateTime;\n leadZero = this._config.leadZero;\n apm = this._config.apm;\n inputTransformFn = this._config.inputTransformFn;\n outputTransformFn = this._config.outputTransformFn;\n keepCharacterPositions = this._config.keepCharacterPositions;\n _shift = new Set();\n plusOnePosition = false;\n maskExpression = '';\n actualValue = '';\n showKeepCharacterExp = '';\n shownMaskExpression = '';\n deletedSpecialCharacter = false;\n ipError;\n cpfCnpjError;\n applyMaskWithPattern(inputValue, maskAndPattern) {\n const [mask, customPattern] = maskAndPattern;\n this.customPattern = customPattern;\n return this.applyMask(inputValue, mask);\n }\n applyMask(inputValue, maskExpression, position = 0, justPasted = false, backspaced = false, cb = () => {}) {\n if (!maskExpression || typeof inputValue !== 'string') {\n return MaskExpression.EMPTY_STRING;\n }\n let cursor = 0;\n let result = '';\n let multi = false;\n let backspaceShift = false;\n let shift = 1;\n let stepBack = false;\n let processedValue = inputValue;\n let processedPosition = position;\n if (processedValue.slice(0, this.prefix.length) === this.prefix) {\n processedValue = processedValue.slice(this.prefix.length, processedValue.length);\n }\n if (!!this.suffix && processedValue.length > 0) {\n processedValue = this.checkAndRemoveSuffix(processedValue);\n }\n if (processedValue === '(' && this.prefix) {\n processedValue = '';\n }\n const inputArray = processedValue.toString().split(MaskExpression.EMPTY_STRING);\n if (this.allowNegativeNumbers && processedValue.slice(cursor, cursor + 1) === MaskExpression.MINUS) {\n result += processedValue.slice(cursor, cursor + 1);\n }\n if (maskExpression === MaskExpression.IP) {\n const valuesIP = processedValue.split(MaskExpression.DOT);\n this.ipError = this._validIP(valuesIP);\n maskExpression = '099.099.099.099';\n }\n const arr = [];\n for (let i = 0; i < processedValue.length; i++) {\n if (processedValue[i]?.match('\\\\d')) {\n arr.push(processedValue[i] ?? MaskExpression.EMPTY_STRING);\n }\n }\n if (maskExpression === MaskExpression.CPF_CNPJ) {\n this.cpfCnpjError = arr.length !== 11 && arr.length !== 14;\n if (arr.length > 11) {\n maskExpression = '00.000.000/0000-00';\n } else {\n maskExpression = '000.000.000-00';\n }\n }\n if (maskExpression.startsWith(MaskExpression.PERCENT)) {\n if (processedValue.match('[a-z]|[A-Z]') || processedValue.match(/[-!$%^&*()_+|~=`{}\\[\\]:\";'<>?,\\/.]/) && !backspaced) {\n processedValue = this._stripToDecimal(processedValue);\n const precision = this.getPrecision(maskExpression);\n processedValue = this.checkInputPrecision(processedValue, precision, this.decimalMarker);\n }\n const decimalMarker = typeof this.decimalMarker === 'string' ? this.decimalMarker : MaskExpression.DOT;\n if (processedValue.indexOf(decimalMarker) > 0 && !this.percentage(processedValue.substring(0, processedValue.indexOf(decimalMarker)))) {\n let base = processedValue.substring(0, processedValue.indexOf(decimalMarker) - 1);\n if (this.allowNegativeNumbers && processedValue.slice(cursor, cursor + 1) === MaskExpression.MINUS && !backspaced) {\n base = processedValue.substring(0, processedValue.indexOf(decimalMarker));\n }\n processedValue = `${base}${processedValue.substring(processedValue.indexOf(decimalMarker), processedValue.length)}`;\n }\n let value = '';\n this.allowNegativeNumbers && processedValue.slice(cursor, cursor + 1) === MaskExpression.MINUS ? value = `${MaskExpression.MINUS}${processedValue.slice(cursor + 1, cursor + processedValue.length)}` : value = processedValue;\n if (this.percentage(value)) {\n result = this._splitPercentZero(processedValue);\n } else {\n result = this._splitPercentZero(processedValue.substring(0, processedValue.length - 1));\n }\n } else if (maskExpression.startsWith(MaskExpression.SEPARATOR)) {\n if (processedValue.match('[wа-яА-Я]') || processedValue.match('[ЁёА-я]') || processedValue.match('[a-z]|[A-Z]') || processedValue.match(/[-@#!$%\\\\^&*()_£¬'+|~=`{}\\]:\";<>.?/]/) || processedValue.match('[^A-Za-z0-9,]')) {\n processedValue = this._stripToDecimal(processedValue);\n }\n const precision = this.getPrecision(maskExpression);\n const decimalMarker = Array.isArray(this.decimalMarker) ? this.thousandSeparator === MaskExpression.DOT ? MaskExpression.COMMA : MaskExpression.DOT : this.decimalMarker;\n if (precision === 0) {\n processedValue = this.allowNegativeNumbers ? processedValue.length > 2 && processedValue[0] === MaskExpression.MINUS && processedValue[1] === MaskExpression.NUMBER_ZERO && processedValue[2] !== this.thousandSeparator && processedValue[2] !== MaskExpression.COMMA && processedValue[2] !== MaskExpression.DOT ? '-' + processedValue.slice(2, processedValue.length) : processedValue[0] === MaskExpression.NUMBER_ZERO && processedValue.length > 1 && processedValue[1] !== this.thousandSeparator && processedValue[1] !== MaskExpression.COMMA && processedValue[1] !== MaskExpression.DOT ? processedValue.slice(1, processedValue.length) : processedValue : processedValue.length > 1 && processedValue[0] === MaskExpression.NUMBER_ZERO && processedValue[1] !== this.thousandSeparator && processedValue[1] !== MaskExpression.COMMA && processedValue[1] !== MaskExpression.DOT ? processedValue.slice(1, processedValue.length) : processedValue;\n } else {\n if (processedValue[0] === decimalMarker && processedValue.length > 1) {\n processedValue = MaskExpression.NUMBER_ZERO + processedValue.slice(0, processedValue.length + 1);\n this.plusOnePosition = true;\n }\n if (processedValue[0] === MaskExpression.NUMBER_ZERO && processedValue[1] !== decimalMarker && processedValue[1] !== this.thousandSeparator) {\n processedValue = processedValue.length > 1 ? processedValue.slice(0, 1) + decimalMarker + processedValue.slice(1, processedValue.length + 1) : processedValue;\n this.plusOnePosition = true;\n }\n if (this.allowNegativeNumbers && processedValue[0] === MaskExpression.MINUS && (processedValue[1] === decimalMarker || processedValue[1] === MaskExpression.NUMBER_ZERO)) {\n processedValue = processedValue[1] === decimalMarker && processedValue.length > 2 ? processedValue.slice(0, 1) + MaskExpression.NUMBER_ZERO + processedValue.slice(1, processedValue.length) : processedValue[1] === MaskExpression.NUMBER_ZERO && processedValue.length > 2 && processedValue[2] !== decimalMarker ? processedValue.slice(0, 2) + decimalMarker + processedValue.slice(2, processedValue.length) : processedValue;\n this.plusOnePosition = true;\n }\n }\n if (backspaced) {\n const inputValueAfterZero = processedValue.slice(this._findFirstNonZeroDigitIndex(processedValue), processedValue.length);\n const positionOfZeroOrDecimalMarker = processedValue[processedPosition] === MaskExpression.NUMBER_ZERO || processedValue[processedPosition] === decimalMarker;\n const zeroIndexNumberZero = processedValue[0] === MaskExpression.NUMBER_ZERO;\n const zeroIndexMinus = processedValue[0] === MaskExpression.MINUS;\n const zeroIndexThousand = processedValue[0] === this.thousandSeparator;\n const firstIndexDecimalMarker = processedValue[1] === decimalMarker;\n const firstIndexNumberZero = processedValue[1] === MaskExpression.NUMBER_ZERO;\n const secondIndexDecimalMarker = processedValue[2] === decimalMarker;\n if (zeroIndexNumberZero && firstIndexDecimalMarker && positionOfZeroOrDecimalMarker && processedPosition < 2) {\n processedValue = inputValueAfterZero;\n }\n if (zeroIndexMinus && firstIndexNumberZero && secondIndexDecimalMarker && positionOfZeroOrDecimalMarker && processedPosition < 3) {\n processedValue = MaskExpression.MINUS + inputValueAfterZero;\n }\n if (inputValueAfterZero !== MaskExpression.MINUS && (processedPosition === 0 && (zeroIndexNumberZero || zeroIndexThousand) || this.allowNegativeNumbers && processedPosition === 1 && zeroIndexMinus && !firstIndexNumberZero)) {\n processedValue = zeroIndexMinus ? MaskExpression.MINUS + inputValueAfterZero : inputValueAfterZero;\n }\n }\n const thousandSeparatorCharEscaped = this._charToRegExpExpression(this.thousandSeparator);\n let invalidChars = '@#!$%^&*()_+|~=`{}\\\\[\\\\]:\\\\s,\\\\.\";<>?\\\\/'.replace(thousandSeparatorCharEscaped, '');\n if (Array.isArray(this.decimalMarker)) {\n for (const marker of this.decimalMarker) {\n invalidChars = invalidChars.replace(this._charToRegExpExpression(marker), MaskExpression.EMPTY_STRING);\n }\n } else {\n invalidChars = invalidChars.replace(this._charToRegExpExpression(this.decimalMarker), '');\n }\n const invalidCharRegexp = new RegExp('[' + invalidChars + ']');\n if (processedValue.match(invalidCharRegexp)) {\n processedValue = processedValue.substring(0, processedValue.length - 1);\n }\n processedValue = this.checkInputPrecision(processedValue, precision, this.decimalMarker);\n const strForSep = processedValue.replace(new RegExp(thousandSeparatorCharEscaped, 'g'), '');\n result = this._formatWithSeparators(strForSep, this.thousandSeparator, this.decimalMarker, precision);\n const commaShift = result.indexOf(MaskExpression.COMMA) - processedValue.indexOf(MaskExpression.COMMA);\n const shiftStep = result.length - processedValue.length;\n const backspacedDecimalMarkerWithSeparatorLimit = backspaced && result.length < inputValue.length && this.separatorLimit;\n if ((result[processedPosition - 1] === this.thousandSeparator || result[processedPosition - this.prefix.length]) && this.prefix && backspaced) {\n processedPosition = processedPosition - 1;\n } else if (shiftStep > 0 && result[processedPosition] !== this.thousandSeparator || backspacedDecimalMarkerWithSeparatorLimit) {\n backspaceShift = true;\n let _shift = 0;\n do {\n this._shift.add(processedPosition + _shift);\n _shift++;\n } while (_shift < shiftStep);\n } else if (result[processedPosition - 1] === this.thousandSeparator || shiftStep === -4 || shiftStep === -3 || result[processedPosition] === this.thousandSeparator) {\n this._shift.clear();\n this._shift.add(processedPosition - 1);\n } else if (commaShift !== 0 && processedPosition > 0 && !(result.indexOf(MaskExpression.COMMA) >= processedPosition && processedPosition > 3) || !(result.indexOf(MaskExpression.DOT) >= processedPosition && processedPosition > 3) && shiftStep <= 0) {\n this._shift.clear();\n backspaceShift = true;\n shift = shiftStep;\n processedPosition += shiftStep;\n this._shift.add(processedPosition);\n } else {\n this._shift.clear();\n }\n } else {\n for (let i = 0, inputSymbol = inputArray[0]; i < inputArray.length; i++, inputSymbol = inputArray[i] ?? MaskExpression.EMPTY_STRING) {\n if (cursor === maskExpression.length) {\n break;\n }\n const symbolStarInPattern = MaskExpression.SYMBOL_STAR in this.patterns;\n if (this._checkSymbolMask(inputSymbol, maskExpression[cursor] ?? MaskExpression.EMPTY_STRING) && maskExpression[cursor + 1] === MaskExpression.SYMBOL_QUESTION) {\n result += inputSymbol;\n cursor += 2;\n } else if (maskExpression[cursor + 1] === MaskExpression.SYMBOL_STAR && multi && this._checkSymbolMask(inputSymbol, maskExpression[cursor + 2] ?? MaskExpression.EMPTY_STRING)) {\n result += inputSymbol;\n cursor += 3;\n multi = false;\n } else if (this._checkSymbolMask(inputSymbol, maskExpression[cursor] ?? MaskExpression.EMPTY_STRING) && maskExpression[cursor + 1] === MaskExpression.SYMBOL_STAR && !symbolStarInPattern) {\n result += inputSymbol;\n multi = true;\n } else if (maskExpression[cursor + 1] === MaskExpression.SYMBOL_QUESTION && this._checkSymbolMask(inputSymbol, maskExpression[cursor + 2] ?? MaskExpression.EMPTY_STRING)) {\n result += inputSymbol;\n cursor += 3;\n } else if (this._checkSymbolMask(inputSymbol, maskExpression[cursor] ?? MaskExpression.EMPTY_STRING)) {\n if (maskExpression[cursor] === MaskExpression.HOURS) {\n if (this.apm ? Number(inputSymbol) > 9 : Number(inputSymbol) > 2) {\n processedPosition = !this.leadZeroDateTime ? processedPosition + 1 : processedPosition;\n cursor += 1;\n this._shiftStep(maskExpression, cursor, inputArray.length);\n i--;\n if (this.leadZeroDateTime) {\n result += '0';\n }\n continue;\n }\n }\n if (maskExpression[cursor] === MaskExpression.HOUR) {\n if (this.apm ? result.length === 1 && Number(result) > 1 || result === '1' && Number(inputSymbol) > 2 || processedValue.slice(cursor - 1, cursor).length === 1 && Number(processedValue.slice(cursor - 1, cursor)) > 2 || processedValue.slice(cursor - 1, cursor) === '1' && Number(inputSymbol) > 2 : result === '2' && Number(inputSymbol) > 3 || (result.slice(cursor - 2, cursor) === '2' || result.slice(cursor - 3, cursor) === '2' || result.slice(cursor - 4, cursor) === '2' || result.slice(cursor - 1, cursor) === '2') && Number(inputSymbol) > 3 && cursor > 10) {\n processedPosition = processedPosition + 1;\n cursor += 1;\n i--;\n continue;\n }\n }\n if (maskExpression[cursor] === MaskExpression.MINUTE || maskExpression[cursor] === MaskExpression.SECOND) {\n if (Number(inputSymbol) > 5) {\n processedPosition = !this.leadZeroDateTime ? processedPosition + 1 : processedPosition;\n cursor += 1;\n this._shiftStep(maskExpression, cursor, inputArray.length);\n i--;\n if (this.leadZeroDateTime) {\n result += '0';\n }\n continue;\n }\n }\n const daysCount = 31;\n const inputValueCursor = processedValue[cursor];\n const inputValueCursorPlusOne = processedValue[cursor + 1];\n const inputValueCursorPlusTwo = processedValue[cursor + 2];\n const inputValueCursorMinusOne = processedValue[cursor - 1];\n const inputValueCursorMinusTwo = processedValue[cursor - 2];\n const inputValueSliceMinusThreeMinusOne = processedValue.slice(cursor - 3, cursor - 1);\n const inputValueSliceMinusOnePlusOne = processedValue.slice(cursor - 1, cursor + 1);\n const inputValueSliceCursorPlusTwo = processedValue.slice(cursor, cursor + 2);\n const inputValueSliceMinusTwoCursor = processedValue.slice(cursor - 2, cursor);\n if (maskExpression[cursor] === MaskExpression.DAY) {\n const maskStartWithMonth = maskExpression.slice(0, 2) === MaskExpression.MONTHS;\n const startWithMonthInput = maskExpression.slice(0, 2) === MaskExpression.MONTHS && this.specialCharacters.includes(inputValueCursorMinusTwo);\n if (Number(inputSymbol) > 3 && this.leadZeroDateTime || !maskStartWithMonth && (Number(inputValueSliceCursorPlusTwo) > daysCount || Number(inputValueSliceMinusOnePlusOne) > daysCount || this.specialCharacters.includes(inputValueCursorPlusOne)) || (startWithMonthInput ? Number(inputValueSliceMinusOnePlusOne) > daysCount || !this.specialCharacters.includes(inputValueCursor) && this.specialCharacters.includes(inputValueCursorPlusTwo) || this.specialCharacters.includes(inputValueCursor) : Number(inputValueSliceCursorPlusTwo) > daysCount || this.specialCharacters.includes(inputValueCursorPlusOne) && !backspaced)) {\n processedPosition = !this.leadZeroDateTime ? processedPosition + 1 : processedPosition;\n cursor += 1;\n this._shiftStep(maskExpression, cursor, inputArray.length);\n i--;\n if (this.leadZeroDateTime) {\n result += '0';\n }\n continue;\n }\n }\n if (maskExpression[cursor] === MaskExpression.MONTH) {\n const monthsCount = 12;\n const withoutDays = cursor === 0 && (Number(inputSymbol) > 2 || Number(inputValueSliceCursorPlusTwo) > monthsCount || this.specialCharacters.includes(inputValueCursorPlusOne) && !backspaced);\n const specialChart = maskExpression.slice(cursor + 2, cursor + 3);\n const day1monthInput = inputValueSliceMinusThreeMinusOne.includes(specialChart) && maskExpression.includes('d0') && (this.specialCharacters.includes(inputValueCursorMinusTwo) && Number(inputValueSliceMinusOnePlusOne) > monthsCount && !this.specialCharacters.includes(inputValueCursor) || this.specialCharacters.includes(inputValueCursor));\n const day2monthInput = Number(inputValueSliceMinusThreeMinusOne) <= daysCount && !this.specialCharacters.includes(inputValueSliceMinusThreeMinusOne) && this.specialCharacters.includes(inputValueCursorMinusOne) && (Number(inputValueSliceCursorPlusTwo) > monthsCount || this.specialCharacters.includes(inputValueCursorPlusOne));\n const day2monthInputDot = Number(inputValueSliceCursorPlusTwo) > monthsCount && cursor === 5 || this.specialCharacters.includes(inputValueCursorPlusOne) && cursor === 5;\n const day1monthPaste = Number(inputValueSliceMinusThreeMinusOne) > daysCount && !this.specialCharacters.includes(inputValueSliceMinusThreeMinusOne) && !this.specialCharacters.includes(inputValueSliceMinusTwoCursor) && Number(inputValueSliceMinusTwoCursor) > monthsCount && maskExpression.includes('d0');\n const day2monthPaste = Number(inputValueSliceMinusThreeMinusOne) <= daysCount && !this.specialCharacters.includes(inputValueSliceMinusThreeMinusOne) && !this.specialCharacters.includes(inputValueCursorMinusOne) && Number(inputValueSliceMinusOnePlusOne) > monthsCount;\n if (Number(inputSymbol) > 1 && this.leadZeroDateTime || withoutDays || day1monthInput || day2monthPaste || day1monthPaste || day2monthInput || day2monthInputDot && !this.leadZeroDateTime) {\n processedPosition = !this.leadZeroDateTime ? processedPosition + 1 : processedPosition;\n cursor += 1;\n this._shiftStep(maskExpression, cursor, inputArray.length);\n i--;\n if (this.leadZeroDateTime) {\n result += '0';\n }\n continue;\n }\n }\n result += inputSymbol;\n cursor++;\n } else if (this.specialCharacters.includes(inputSymbol) && maskExpression[cursor] === inputSymbol) {\n result += inputSymbol;\n cursor++;\n } else if (this.specialCharacters.indexOf(maskExpression[cursor] ?? MaskExpression.EMPTY_STRING) !== -1) {\n result += maskExpression[cursor];\n cursor++;\n this._shiftStep(maskExpression, cursor, inputArray.length);\n i--;\n } else if (maskExpression[cursor] === MaskExpression.NUMBER_NINE && this.showMaskTyped) {\n this._shiftStep(maskExpression, cursor, inputArray.length);\n } else if (this.patterns[maskExpression[cursor] ?? MaskExpression.EMPTY_STRING] && this.patterns[maskExpression[cursor] ?? MaskExpression.EMPTY_STRING]?.optional) {\n if (!!inputArray[cursor] && maskExpression !== '099.099.099.099' && maskExpression !== '000.000.000-00' && maskExpression !== '00.000.000/0000-00' && !maskExpression.match(/^9+\\.0+$/) && !this.patterns[maskExpression[cursor] ?? MaskExpression.EMPTY_STRING]?.optional) {\n result += inputArray[cursor];\n }\n if (maskExpression.includes(MaskExpression.NUMBER_NINE + MaskExpression.SYMBOL_STAR) && maskExpression.includes(MaskExpression.NUMBER_ZERO + MaskExpression.SYMBOL_STAR)) {\n cursor++;\n }\n cursor++;\n i--;\n } else if (this.maskExpression[cursor + 1] === MaskExpression.SYMBOL_STAR && this._findSpecialChar(this.maskExpression[cursor + 2] ?? MaskExpression.EMPTY_STRING) && this._findSpecialChar(inputSymbol) === this.maskExpression[cursor + 2] && multi) {\n cursor += 3;\n result += inputSymbol;\n } else if (this.maskExpression[cursor + 1] === MaskExpression.SYMBOL_QUESTION && this._findSpecialChar(this.maskExpression[cursor + 2] ?? MaskExpression.EMPTY_STRING) && this._findSpecialChar(inputSymbol) === this.maskExpression[cursor + 2] && multi) {\n cursor += 3;\n result += inputSymbol;\n } else if (this.showMaskTyped && this.specialCharacters.indexOf(inputSymbol) < 0 && inputSymbol !== this.placeHolderCharacter && this.placeHolderCharacter.length === 1) {\n stepBack = true;\n }\n }\n }\n if (result.length + 1 === maskExpression.length && this.specialCharacters.indexOf(maskExpression[maskExpression.length - 1] ?? MaskExpression.EMPTY_STRING) !== -1) {\n result += maskExpression[maskExpression.length - 1];\n }\n let newPosition = processedPosition + 1;\n while (this._shift.has(newPosition)) {\n shift++;\n newPosition++;\n }\n let actualShift = justPasted && !maskExpression.startsWith(MaskExpression.SEPARATOR) ? cursor : this._shift.has(processedPosition) ? shift : 0;\n if (stepBack) {\n actualShift--;\n }\n cb(actualShift, backspaceShift);\n if (shift < 0) {\n this._shift.clear();\n }\n let onlySpecial = false;\n if (backspaced) {\n onlySpecial = inputArray.every(char => this.specialCharacters.includes(char));\n }\n let res = `${this.prefix}${onlySpecial ? MaskExpression.EMPTY_STRING : result}${this.showMaskTyped ? '' : this.suffix}`;\n if (result.length === 0) {\n res = !this.dropSpecialCharacters ? `${this.prefix}${result}` : `${result}`;\n }\n const isSpecialCharacterMaskFirstSymbol = processedValue.length === 1 && this.specialCharacters.includes(maskExpression[0]) && processedValue !== maskExpression[0];\n if (!this._checkSymbolMask(processedValue, maskExpression[1]) && isSpecialCharacterMaskFirstSymbol) {\n return '';\n }\n if (result.includes(MaskExpression.MINUS) && this.prefix && this.allowNegativeNumbers) {\n if (backspaced && result === MaskExpression.MINUS) {\n return '';\n }\n res = `${MaskExpression.MINUS}${this.prefix}${result.split(MaskExpression.MINUS).join(MaskExpression.EMPTY_STRING)}${this.suffix}`;\n }\n return res;\n }\n _findDropSpecialChar(inputSymbol) {\n if (Array.isArray(this.dropSpecialCharacters)) {\n return this.dropSpecialCharacters.find(val => val === inputSymbol);\n }\n return this._findSpecialChar(inputSymbol);\n }\n _findSpecialChar(inputSymbol) {\n return this.specialCharacters.find(val => val === inputSymbol);\n }\n _checkSymbolMask(inputSymbol, maskSymbol) {\n this.patterns = this.customPattern ? this.customPattern : this.patterns;\n return (this.patterns[maskSymbol]?.pattern && this.patterns[maskSymbol]?.pattern.test(inputSymbol)) ?? false;\n }\n _formatWithSeparators = (str, thousandSeparatorChar, decimalChars, precision) => {\n let x = [];\n let decimalChar = '';\n if (Array.isArray(decimalChars)) {\n const regExp = new RegExp(decimalChars.map(v => '[\\\\^$.|?*+()'.indexOf(v) >= 0 ? `\\\\${v}` : v).join('|'));\n x = str.split(regExp);\n decimalChar = str.match(regExp)?.[0] ?? MaskExpression.EMPTY_STRING;\n } else {\n x = str.split(decimalChars);\n decimalChar = decimalChars;\n }\n const decimals = x.length > 1 ? `${decimalChar}${x[1]}` : MaskExpression.EMPTY_STRING;\n let res = x[0] ?? MaskExpression.EMPTY_STRING;\n const separatorLimit = this.separatorLimit.replace(/\\s/g, MaskExpression.EMPTY_STRING);\n if (separatorLimit && +separatorLimit) {\n if (res[0] === MaskExpression.MINUS) {\n res = `-${res.slice(1, res.length).slice(0, separatorLimit.length)}`;\n } else {\n res = res.slice(0, separatorLimit.length);\n }\n }\n const rgx = /(\\d+)(\\d{3})/;\n while (thousandSeparatorChar && rgx.test(res)) {\n res = res.replace(rgx, '$1' + thousandSeparatorChar + '$2');\n }\n if (typeof precision === 'undefined') {\n return res + decimals;\n } else if (precision === 0) {\n return res;\n }\n return res + decimals.substring(0, precision + 1);\n };\n percentage = str => {\n const sanitizedStr = str.replace(',', '.');\n const value = Number(this.allowNegativeNumbers && str.includes(MaskExpression.MINUS) ? sanitizedStr.slice(1, str.length) : sanitizedStr);\n return !isNaN(value) && value >= 0 && value <= 100;\n };\n getPrecision = maskExpression => {\n const x = maskExpression.split(MaskExpression.DOT);\n if (x.length > 1) {\n return Number(x[x.length - 1]);\n }\n return Infinity;\n };\n checkAndRemoveSuffix = inputValue => {\n for (let i = this.suffix?.length - 1; i >= 0; i--) {\n const substr = this.suffix.substring(i, this.suffix?.length);\n if (inputValue.includes(substr) && i !== this.suffix?.length - 1 && (i - 1 < 0 || !inputValue.includes(this.suffix.substring(i - 1, this.suffix?.length)))) {\n return inputValue.replace(substr, MaskExpression.EMPTY_STRING);\n }\n }\n return inputValue;\n };\n checkInputPrecision = (inputValue, precision, decimalMarker) => {\n let processedInputValue = inputValue;\n let processedDecimalMarker = decimalMarker;\n if (precision < Infinity) {\n if (Array.isArray(processedDecimalMarker)) {\n const marker = processedDecimalMarker.find(dm => dm !== this.thousandSeparator);\n processedDecimalMarker = marker ? marker : processedDecimalMarker[0];\n }\n const precisionRegEx = new RegExp(this._charToRegExpExpression(processedDecimalMarker) + `\\\\d{${precision}}.*$`);\n const precisionMatch = processedInputValue.match(precisionRegEx);\n const precisionMatchLength = (precisionMatch && precisionMatch[0]?.length) ?? 0;\n if (precisionMatchLength - 1 > precision) {\n const diff = precisionMatchLength - 1 - precision;\n processedInputValue = processedInputValue.substring(0, processedInputValue.length - diff);\n }\n if (precision === 0 && this._compareOrIncludes(processedInputValue[processedInputValue.length - 1], processedDecimalMarker, this.thousandSeparator)) {\n processedInputValue = processedInputValue.substring(0, processedInputValue.length - 1);\n }\n }\n return processedInputValue;\n };\n _stripToDecimal(str) {\n return str.split(MaskExpression.EMPTY_STRING).filter((i, idx) => {\n const isDecimalMarker = typeof this.decimalMarker === 'string' ? i === this.decimalMarker : this.decimalMarker.includes(i);\n return i.match('^-?\\\\d') || i === this.thousandSeparator || isDecimalMarker || i === MaskExpression.MINUS && idx === 0 && this.allowNegativeNumbers;\n }).join(MaskExpression.EMPTY_STRING);\n }\n _charToRegExpExpression(char) {\n if (char) {\n const charsToEscape = '[\\\\^$.|?*+()';\n return char === ' ' ? '\\\\s' : charsToEscape.indexOf(char) >= 0 ? `\\\\${char}` : char;\n }\n return char;\n }\n _shiftStep(maskExpression, cursor, inputLength) {\n const shiftStep = /[*?]/g.test(maskExpression.slice(0, cursor)) ? inputLength : cursor;\n this._shift.add(shiftStep + this.prefix.length || 0);\n }\n _compareOrIncludes(value, comparedValue, excludedValue) {\n return Array.isArray(comparedValue) ? comparedValue.filter(v => v !== excludedValue).includes(value) : value === comparedValue;\n }\n _validIP(valuesIP) {\n return !(valuesIP.length === 4 && !valuesIP.some((value, index) => {\n if (valuesIP.length !== index + 1) {\n return value === MaskExpression.EMPTY_STRING || Number(value) > 255;\n }\n return value === MaskExpression.EMPTY_STRING || Number(value.substring(0, 3)) > 255;\n }));\n }\n _splitPercentZero(value) {\n if (value === MaskExpression.MINUS && this.allowNegativeNumbers) {\n return value;\n }\n const decimalIndex = typeof this.decimalMarker === 'string' ? value.indexOf(this.decimalMarker) : value.indexOf(MaskExpression.DOT);\n const emptyOrMinus = this.allowNegativeNumbers && value.includes(MaskExpression.MINUS) ? '-' : '';\n if (decimalIndex === -1) {\n const parsedValue = parseInt(emptyOrMinus ? value.slice(1, value.length) : value, 10);\n return isNaN(parsedValue) ? MaskExpression.EMPTY_STRING : `${emptyOrMinus}${parsedValue}`;\n } else {\n const integerPart = parseInt(value.replace('-', '').substring(0, decimalIndex), 10);\n const decimalPart = value.substring(decimalIndex + 1);\n const integerString = isNaN(integerPart) ? '' : integerPart.toString();\n const decimal = typeof this.decimalMarker === 'string' ? this.decimalMarker : MaskExpression.DOT;\n return integerString === MaskExpression.EMPTY_STRING ? MaskExpression.EMPTY_STRING : `${emptyOrMinus}${integerString}${decimal}${decimalPart}`;\n }\n }\n _findFirstNonZeroDigitIndex(inputString) {\n for (let i = 0; i < inputString.length; i++) {\n const char = inputString[i];\n if (char && char >= '1' && char <= '9') {\n return i;\n }\n }\n return -1;\n }\n static ɵfac = function NgxMaskApplierService_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || NgxMaskApplierService)();\n };\n static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: NgxMaskApplierService,\n factory: NgxMaskApplierService.ɵfac\n });\n }\n return NgxMaskApplierService;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\nlet NgxMaskService = /*#__PURE__*/(() => {\n class NgxMaskService extends NgxMaskApplierService {\n isNumberValue = false;\n maskIsShown = '';\n selStart = null;\n selEnd = null;\n writingValue = false;\n maskChanged = false;\n _maskExpressionArray = [];\n triggerOnMaskChange = false;\n _previousValue = '';\n _currentValue = '';\n _emitValue = false;\n _start;\n _end;\n onChange = _ => {};\n _elementRef = inject(ElementRef, {\n optional: true\n });\n document = inject(DOCUMENT);\n _config = inject(NGX_MASK_CONFIG);\n _renderer = inject(Renderer2, {\n optional: true\n });\n applyMask(inputValue, maskExpression, position = 0, justPasted = false, backspaced = false, cb = () => {}) {\n if (!maskExpression) {\n return inputValue !== this.actualValue ? this.actualValue : inputValue;\n }\n this.maskIsShown = this.showMaskTyped ? this.showMaskInInput() : MaskExpression.EMPTY_STRING;\n if (this.maskExpression === MaskExpression.IP && this.showMaskTyped) {\n this.maskIsShown = this.showMaskInInput(inputValue || MaskExpression.HASH);\n }\n if (this.maskExpression === MaskExpression.CPF_CNPJ && this.showMaskTyped) {\n this.maskIsShown = this.showMaskInInput(inputValue || MaskExpression.HASH);\n }\n if (!inputValue && this.showMaskTyped) {\n this.formControlResult(this.prefix);\n return `${this.prefix}${this.maskIsShown}${this.suffix}`;\n }\n const getSymbol = !!inputValue && typeof this.selStart === 'number' ? inputValue[this.selStart] ?? MaskExpression.EMPTY_STRING : MaskExpression.EMPTY_STRING;\n let newInputValue = '';\n let newPosition = position;\n if (this.hiddenInput !== null && !this.writingValue) {\n let actualResult = inputValue && inputValue.length === 1 ? inputValue.split(MaskExpression.EMPTY_STRING) : this.actualValue.split(MaskExpression.EMPTY_STRING);\n if (typeof this.selStart === 'object' && typeof this.selEnd === 'object') {\n this.selStart = Number(this.selStart);\n this.selEnd = Number(this.selEnd);\n } else {\n inputValue !== MaskExpression.EMPTY_STRING && actualResult.length ? typeof this.selStart === 'number' && typeof this.selEnd === 'number' ? inputValue.length > actualResult.length ? actualResult.splice(this.selStart, 0, getSymbol) : inputValue.length < actualResult.length ? actualResult.length - inputValue.length === 1 ? backspaced ? actualResult.splice(this.selStart - 1, 1) : actualResult.splice(inputValue.length - 1, 1) : actualResult.splice(this.selStart, this.selEnd - this.selStart) : null : null : actualResult = [];\n }\n if (this.showMaskTyped && !this.hiddenInput) {\n newInputValue = this.removeMask(inputValue);\n }\n newInputValue = this.actualValue.length && actualResult.length <= inputValue.length ? this.shiftTypedSymbols(actualResult.join(MaskExpression.EMPTY_STRING)) : inputValue;\n }\n if (justPasted && (this.hiddenInput || !this.hiddenInput)) {\n newInputValue = inputValue;\n }\n if (backspaced && this.specialCharacters.indexOf(this.maskExpression[newPosition] ?? MaskExpression.EMPTY_STRING) !== -1 && this.showMaskTyped && !this.prefix) {\n newInputValue = this._currentValue;\n }\n if (this.deletedSpecialCharacter && newPosition) {\n if (this.specialCharacters.includes(this.actualValue.slice(newPosition, newPosition + 1))) {\n newPosition = newPosition + 1;\n } else if (maskExpression.slice(newPosition - 1, newPosition + 1) !== MaskExpression.MONTHS) {\n newPosition = newPosition - 2;\n }\n this.deletedSpecialCharacter = false;\n }\n if (this.showMaskTyped && this.placeHolderCharacter.length === 1 && !this.leadZeroDateTime) {\n newInputValue = this.removeMask(inputValue);\n }\n if (this.maskChanged) {\n newInputValue = inputValue;\n } else {\n newInputValue = Boolean(newInputValue) && newInputValue.length ? newInputValue : inputValue;\n }\n if (this.showMaskTyped && this.keepCharacterPositions && this.actualValue && !justPasted && !this.writingValue) {\n const value = this.dropSpecialCharacters ? this.removeMask(this.actualValue) : this.actualValue;\n this.formControlResult(value);\n return this.actualValue ? this.actualValue : `${this.prefix}${this.maskIsShown}${this.suffix}`;\n }\n const result = super.applyMask(newInputValue, maskExpression, newPosition, justPasted, backspaced, cb);\n this.actualValue = this.getActualValue(result);\n if (this.thousandSeparator === MaskExpression.DOT && this.decimalMarker === MaskExpression.DOT) {\n this.decimalMarker = MaskExpression.COMMA;\n }\n if (this.maskExpression.startsWith(MaskExpression.SEPARATOR) && this.dropSpecialCharacters === true) {\n this.specialCharacters = this.specialCharacters.filter(item => !this._compareOrIncludes(item, this.decimalMarker, this.thousandSeparator));\n }\n if (result || result === '') {\n this._previousValue = this._currentValue;\n this._currentValue = result;\n this._emitValue = this._previousValue !== this._currentValue || this.maskChanged || this.writingValue || this._previousValue === this._currentValue && justPasted;\n }\n this._emitValue ? this.writingValue && this.triggerOnMaskChange ? requestAnimationFrame(() => this.formControlResult(result)) : this.formControlResult(result) : '';\n if (!this.showMaskTyped || this.showMaskTyped && this.hiddenInput) {\n if (this.hiddenInput) {\n if (backspaced) {\n return this.hideInput(result, this.maskExpression);\n }\n return `${this.hideInput(result, this.maskExpression)}${this.maskIsShown.slice(result.length)}`;\n }\n return result;\n }\n const resLen = result.length;\n const prefNmask = `${this.prefix}${this.maskIsShown}${this.suffix}`;\n if (this.maskExpression.includes(MaskExpression.HOURS)) {\n const countSkipedSymbol = this._numberSkipedSymbols(result);\n return `${result}${prefNmask.slice(resLen + countSkipedSymbol)}`;\n } else if (this.maskExpression === MaskExpression.IP || this.maskExpression === MaskExpression.CPF_CNPJ) {\n return `${result}${prefNmask}`;\n }\n return `${result}${prefNmask.slice(resLen)}`;\n }\n _numberSkipedSymbols(value) {\n const regex = /(^|\\D)(\\d\\D)/g;\n let match = regex.exec(value);\n let countSkipedSymbol = 0;\n while (match != null) {\n countSkipedSymbol += 1;\n match = regex.exec(value);\n }\n return countSkipedSymbol;\n }\n applyValueChanges(position, justPasted, backspaced, cb = () => {}) {\n const formElement = this._elementRef?.nativeElement;\n if (!formElement) {\n return;\n }\n formElement.value = this.applyMask(formElement.value, this.maskExpression, position, justPasted, backspaced, cb);\n if (formElement === this._getActiveElement()) {\n return;\n }\n this.clearIfNotMatchFn();\n }\n hideInput(inputValue, maskExpression) {\n return inputValue.split(MaskExpression.EMPTY_STRING).map((curr, index) => {\n if (this.patterns && this.patterns[maskExpression[index] ?? MaskExpression.EMPTY_STRING] && this.patterns[maskExpression[index] ?? MaskExpression.EMPTY_STRING]?.symbol) {\n return this.patterns[maskExpression[index] ?? MaskExpression.EMPTY_STRING]?.symbol;\n }\n return curr;\n }).join(MaskExpression.EMPTY_STRING);\n }\n getActualValue(res) {\n const compare = res.split(MaskExpression.EMPTY_STRING).filter((symbol, i) => {\n const maskChar = this.maskExpression[i] ?? MaskExpression.EMPTY_STRING;\n return this._checkSymbolMask(symbol, maskChar) || this.specialCharacters.includes(maskChar) && symbol === maskChar;\n });\n if (compare.join(MaskExpression.EMPTY_STRING) === res) {\n return compare.join(MaskExpression.EMPTY_STRING);\n }\n return res;\n }\n shiftTypedSymbols(inputValue) {\n let symbolToReplace = '';\n const newInputValue = inputValue && inputValue.split(MaskExpression.EMPTY_STRING).map((currSymbol, index) => {\n if (this.specialCharacters.includes(inputValue[index + 1] ?? MaskExpression.EMPTY_STRING) && inputValue[index + 1] !== this.maskExpression[index + 1]) {\n symbolToReplace = currSymbol;\n return inputValue[index + 1];\n }\n if (symbolToReplace.length) {\n const replaceSymbol = symbolToReplace;\n symbolToReplace = MaskExpression.EMPTY_STRING;\n return replaceSymbol;\n }\n return currSymbol;\n }) || [];\n return newInputValue.join(MaskExpression.EMPTY_STRING);\n }\n numberToString(value) {\n if (!value && value !== 0 || this.maskExpression.startsWith(MaskExpression.SEPARATOR) && (this.leadZero || !this.dropSpecialCharacters) || this.maskExpression.startsWith(MaskExpression.SEPARATOR) && this.separatorLimit.length > 14 && String(value).length > 14) {\n return String(value);\n }\n return Number(value).toLocaleString('fullwide', {\n useGrouping: false,\n maximumFractionDigits: 20\n }).replace(`/${MaskExpression.MINUS}/`, MaskExpression.MINUS);\n }\n showMaskInInput(inputVal) {\n if (this.showMaskTyped && !!this.shownMaskExpression) {\n if (this.maskExpression.length !== this.shownMaskExpression.length) {\n throw new Error('Mask expression must match mask placeholder length');\n } else {\n return this.shownMaskExpression;\n }\n } else if (this.showMaskTyped) {\n if (inputVal) {\n if (this.maskExpression === MaskExpression.IP) {\n return this._checkForIp(inputVal);\n }\n if (this.maskExpression === MaskExpression.CPF_CNPJ) {\n return this._checkForCpfCnpj(inputVal);\n }\n }\n if (this.placeHolderCharacter.length === this.maskExpression.length) {\n return this.placeHolderCharacter;\n }\n return this.maskExpression.replace(/\\w/g, this.placeHolderCharacter);\n }\n return '';\n }\n clearIfNotMatchFn() {\n const formElement = this._elementRef?.nativeElement;\n if (!formElement) {\n return;\n }\n if (this.clearIfNotMatch && this.prefix.length + this.maskExpression.length + this.suffix.length !== formElement.value.replace(this.placeHolderCharacter, MaskExpression.EMPTY_STRING).length) {\n this.formElementProperty = ['value', MaskExpression.EMPTY_STRING];\n this.applyMask('', this.maskExpression);\n }\n }\n set formElementProperty([name, value]) {\n if (!this._renderer || !this._elementRef) {\n return;\n }\n Promise.resolve().then(() => this._renderer?.setProperty(this._elementRef?.nativeElement, name, value));\n }\n checkDropSpecialCharAmount(mask) {\n const chars = mask.split(MaskExpression.EMPTY_STRING).filter(item => this._findDropSpecialChar(item));\n return chars.length;\n }\n removeMask(inputValue) {\n return this._removeMask(this._removeSuffix(this._removePrefix(inputValue)), this.specialCharacters.concat('_').concat(this.placeHolderCharacter));\n }\n _checkForIp(inputVal) {\n if (inputVal === MaskExpression.HASH) {\n return `${this.placeHolderCharacter}.${this.placeHolderCharacter}.${this.placeHolderCharacter}.${this.placeHolderCharacter}`;\n }\n const arr = [];\n for (let i = 0; i < inputVal.length; i++) {\n const value = inputVal[i] ?? MaskExpression.EMPTY_STRING;\n if (!value) {\n continue;\n }\n if (value.match('\\\\d')) {\n arr.push(value);\n }\n }\n if (arr.length <= 3) {\n return `${this.placeHolderCharacter}.${this.placeHolderCharacter}.${this.placeHolderCharacter}`;\n }\n if (arr.length > 3 && arr.length <= 6) {\n return `${this.placeHolderCharacter}.${this.placeHolderCharacter}`;\n }\n if (arr.length > 6 && arr.length <= 9) {\n return this.placeHolderCharacter;\n }\n if (arr.length > 9 && arr.length <= 12) {\n return '';\n }\n return '';\n }\n _checkForCpfCnpj(inputVal) {\n const cpf = `${this.placeHolderCharacter}${this.placeHolderCharacter}${this.placeHolderCharacter}` + `.${this.placeHolderCharacter}${this.placeHolderCharacter}${this.placeHolderCharacter}` + `.${this.placeHolderCharacter}${this.placeHolderCharacter}${this.placeHolderCharacter}` + `-${this.placeHolderCharacter}${this.placeHolderCharacter}`;\n const cnpj = `${this.placeHolderCharacter}${this.placeHolderCharacter}` + `.${this.placeHolderCharacter}${this.placeHolderCharacter}${this.placeHolderCharacter}` + `.${this.placeHolderCharacter}${this.placeHolderCharacter}${this.placeHolderCharacter}` + `/${this.placeHolderCharacter}${this.placeHolderCharacter}${this.placeHolderCharacter}${this.placeHolderCharacter}` + `-${this.placeHolderCharacter}${this.placeHolderCharacter}`;\n if (inputVal === MaskExpression.HASH) {\n return cpf;\n }\n const arr = [];\n for (let i = 0; i < inputVal.length; i++) {\n const value = inputVal[i] ?? MaskExpression.EMPTY_STRING;\n if (!value) {\n continue;\n }\n if (value.match('\\\\d')) {\n arr.push(value);\n }\n }\n if (arr.length <= 3) {\n return cpf.slice(arr.length, cpf.length);\n }\n if (arr.length > 3 && arr.length <= 6) {\n return cpf.slice(arr.length + 1, cpf.length);\n }\n if (arr.length > 6 && arr.length <= 9) {\n return cpf.slice(arr.length + 2, cpf.length);\n }\n if (arr.length > 9 && arr.length < 11) {\n return cpf.slice(arr.length + 3, cpf.length);\n }\n if (arr.length === 11) {\n return '';\n }\n if (arr.length === 12) {\n if (inputVal.length === 17) {\n return cnpj.slice(16, cnpj.length);\n }\n return cnpj.slice(15, cnpj.length);\n }\n if (arr.length > 12 && arr.length <= 14) {\n return cnpj.slice(arr.length + 4, cnpj.length);\n }\n return '';\n }\n _getActiveElement(document = this.document) {\n const shadowRootEl = document?.activeElement?.shadowRoot;\n if (!shadowRootEl?.activeElement) {\n return document.activeElement;\n } else {\n return this._getActiveElement(shadowRootEl);\n }\n }\n formControlResult(inputValue) {\n if (this.writingValue && !inputValue) {\n this.onChange('');\n return;\n }\n if (this.writingValue || !this.triggerOnMaskChange && this.maskChanged) {\n this.triggerOnMaskChange && this.maskChanged ? this.onChange(this.outputTransformFn(this._toNumber(this._checkSymbols(this._removeSuffix(this._removePrefix(inputValue)))))) : '';\n this.maskChanged = false;\n return;\n }\n if (Array.isArray(this.dropSpecialCharacters)) {\n this.onChange(this.outputTransformFn(this._toNumber(this._checkSymbols(this._removeMask(this._removeSuffix(this._removePrefix(inputValue)), this.dropSpecialCharacters)))));\n } else if (this.dropSpecialCharacters || !this.dropSpecialCharacters && this.prefix === inputValue) {\n this.onChange(this.outputTransformFn(this._toNumber(this._checkSymbols(this._removeSuffix(this._removePrefix(inputValue))))));\n } else {\n this.onChange(this.outputTransformFn(this._toNumber(inputValue)));\n }\n }\n _toNumber(value) {\n if (!this.isNumberValue || value === MaskExpression.EMPTY_STRING) {\n return value;\n }\n if (this.maskExpression.startsWith(MaskExpression.SEPARATOR) && (this.leadZero || !this.dropSpecialCharacters)) {\n return value;\n }\n if (String(value).length > 14 && this.maskExpression.startsWith(MaskExpression.SEPARATOR)) {\n return String(value);\n }\n const num = Number(value);\n if (this.maskExpression.startsWith(MaskExpression.SEPARATOR) && Number.isNaN(num)) {\n const val = String(value).replace(',', '.');\n return Number(val);\n }\n return Number.isNaN(num) ? value : num;\n }\n _removeMask(value, specialCharactersForRemove) {\n if (this.maskExpression.startsWith(MaskExpression.PERCENT) && value.includes(MaskExpression.DOT)) {\n return value;\n }\n return value ? value.replace(this._regExpForRemove(specialCharactersForRemove), MaskExpression.EMPTY_STRING) : value;\n }\n _removePrefix(value) {\n if (!this.prefix) {\n return value;\n }\n return value ? value.replace(this.prefix, MaskExpression.EMPTY_STRING) : value;\n }\n _removeSuffix(value) {\n if (!this.suffix) {\n return value;\n }\n return value ? value.replace(this.suffix, MaskExpression.EMPTY_STRING) : value;\n }\n _retrieveSeparatorValue(result) {\n let specialCharacters = Array.isArray(this.dropSpecialCharacters) ? this.specialCharacters.filter(v => {\n return this.dropSpecialCharacters.includes(v);\n }) : this.specialCharacters;\n if (!this.deletedSpecialCharacter && this._checkPatternForSpace() && result.includes(MaskExpression.WHITE_SPACE) && this.maskExpression.includes(MaskExpression.SYMBOL_STAR)) {\n specialCharacters = specialCharacters.filter(char => char !== MaskExpression.WHITE_SPACE);\n }\n return this._removeMask(result, specialCharacters);\n }\n _regExpForRemove(specialCharactersForRemove) {\n return new RegExp(specialCharactersForRemove.map(item => `\\\\${item}`).join('|'), 'gi');\n }\n _replaceDecimalMarkerToDot(value) {\n const markers = Array.isArray(this.decimalMarker) ? this.decimalMarker : [this.decimalMarker];\n return value.replace(this._regExpForRemove(markers), MaskExpression.DOT);\n }\n _checkSymbols(result) {\n let processedResult = result;\n if (processedResult === MaskExpression.EMPTY_STRING) {\n return processedResult;\n }\n if (this.maskExpression.startsWith(MaskExpression.PERCENT) && this.decimalMarker === MaskExpression.COMMA) {\n processedResult = processedResult.replace(MaskExpression.COMMA, MaskExpression.DOT);\n }\n const separatorPrecision = this._retrieveSeparatorPrecision(this.maskExpression);\n const separatorValue = this._replaceDecimalMarkerToDot(this._retrieveSeparatorValue(processedResult));\n if (!this.isNumberValue) {\n return separatorValue;\n }\n if (separatorPrecision) {\n if (processedResult === this.decimalMarker) {\n return null;\n }\n if (separatorValue.length > 14) {\n return String(separatorValue);\n }\n return this._checkPrecision(this.maskExpression, separatorValue);\n } else {\n return separatorValue;\n }\n }\n _checkPatternForSpace() {\n for (const key in this.patterns) {\n if (this.patterns[key] && this.patterns[key]?.hasOwnProperty('pattern')) {\n const patternString = this.patterns[key]?.pattern.toString();\n const pattern = this.patterns[key]?.pattern;\n if (patternString?.includes(MaskExpression.WHITE_SPACE) && pattern?.test(this.maskExpression)) {\n return true;\n }\n }\n }\n return false;\n }\n _retrieveSeparatorPrecision(maskExpretion) {\n const matcher = maskExpretion.match(new RegExp(`^separator\\\\.([^d]*)`));\n return matcher ? Number(matcher[1]) : null;\n }\n _checkPrecision(separatorExpression, separatorValue) {\n const separatorPrecision = this.getPrecision(separatorExpression);\n let value = separatorValue;\n if (separatorExpression.indexOf('2') > 0 || this.leadZero && Number(separatorPrecision) > 0) {\n if (this.decimalMarker === MaskExpression.COMMA && this.leadZero) {\n value = value.replace(',', '.');\n }\n return this.leadZero ? Number(value).toFixed(Number(separatorPrecision)) : Number(value).toFixed(2);\n }\n return this.numberToString(value);\n }\n _repeatPatternSymbols(maskExp) {\n return maskExp.match(/{[0-9]+}/) && maskExp.split(MaskExpression.EMPTY_STRING).reduce((accum, currVal, index) => {\n this._start = currVal === MaskExpression.CURLY_BRACKETS_LEFT ? index : this._start;\n if (currVal !== MaskExpression.CURLY_BRACKETS_RIGHT) {\n return this._findSpecialChar(currVal) ? accum + currVal : accum;\n }\n this._end = index;\n const repeatNumber = Number(maskExp.slice(this._start + 1, this._end));\n const replaceWith = new Array(repeatNumber + 1).join(maskExp[this._start - 1]);\n if (maskExp.slice(0, this._start).length > 1 && maskExp.includes(MaskExpression.LETTER_S)) {\n const symbols = maskExp.slice(0, this._start - 1);\n return symbols.includes(MaskExpression.CURLY_BRACKETS_LEFT) ? accum + replaceWith : symbols + accum + replaceWith;\n } else {\n return accum + replaceWith;\n }\n }, '') || maskExp;\n }\n currentLocaleDecimalMarker() {\n return 1.1.toLocaleString().substring(1, 2);\n }\n static ɵfac = /* @__PURE__ */(() => {\n let ɵNgxMaskService_BaseFactory;\n return function NgxMaskService_Factory(__ngFactoryType__) {\n return (ɵNgxMaskService_BaseFactory || (ɵNgxMaskService_BaseFactory = i0.ɵɵgetInheritedFactory(NgxMaskService)))(__ngFactoryType__ || NgxMaskService);\n };\n })();\n static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: NgxMaskService,\n factory: NgxMaskService.ɵfac\n });\n }\n return NgxMaskService;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\nfunction _configFactory() {\n const initConfig = inject(INITIAL_CONFIG);\n const configValue = inject(NEW_CONFIG);\n return configValue instanceof Function ? {\n ...initConfig,\n ...configValue()\n } : {\n ...initConfig,\n ...configValue\n };\n}\nfunction provideNgxMask(configValue) {\n return [{\n provide: NEW_CONFIG,\n useValue: configValue\n }, {\n provide: INITIAL_CONFIG,\n useValue: initialConfig\n }, {\n provide: NGX_MASK_CONFIG,\n useFactory: _configFactory\n }, NgxMaskService];\n}\nfunction provideEnvironmentNgxMask(configValue) {\n return makeEnvironmentProviders(provideNgxMask(configValue));\n}\nlet NgxMaskDirective = /*#__PURE__*/(() => {\n class NgxMaskDirective {\n maskExpression = '';\n specialCharacters = [];\n patterns = {};\n prefix = '';\n suffix = '';\n thousandSeparator = ' ';\n decimalMarker = '.';\n dropSpecialCharacters = null;\n hiddenInput = null;\n showMaskTyped = null;\n placeHolderCharacter = null;\n shownMaskExpression = null;\n showTemplate = null;\n clearIfNotMatch = null;\n validation = null;\n separatorLimit = null;\n allowNegativeNumbers = null;\n leadZeroDateTime = null;\n leadZero = null;\n triggerOnMaskChange = null;\n apm = null;\n inputTransformFn = null;\n outputTransformFn = null;\n keepCharacterPositions = null;\n maskFilled = new EventEmitter();\n _maskValue = '';\n _inputValue;\n _position = null;\n _code;\n _maskExpressionArray = [];\n _allowFewMaskChangeMask = false;\n _justPasted = false;\n _isFocused = false;\n _isComposing = false;\n document = inject(DOCUMENT);\n _maskService = inject(NgxMaskService, {\n self: true\n });\n _config = inject(NGX_MASK_CONFIG);\n onChange = _ => {};\n onTouch = () => {};\n ngOnChanges(changes) {\n const {\n maskExpression,\n specialCharacters,\n patterns,\n prefix,\n suffix,\n thousandSeparator,\n decimalMarker,\n dropSpecialCharacters,\n hiddenInput,\n showMaskTyped,\n placeHolderCharacter,\n shownMaskExpression,\n showTemplate,\n clearIfNotMatch,\n validation,\n separatorLimit,\n allowNegativeNumbers,\n leadZeroDateTime,\n leadZero,\n triggerOnMaskChange,\n apm,\n inputTransformFn,\n outputTransformFn,\n keepCharacterPositions\n } = changes;\n if (maskExpression) {\n if (maskExpression.currentValue !== maskExpression.previousValue && !maskExpression.firstChange) {\n this._maskService.maskChanged = true;\n }\n if (maskExpression.currentValue && maskExpression.currentValue.split(MaskExpression.OR).length > 1) {\n this._maskExpressionArray = maskExpression.currentValue.split(MaskExpression.OR).sort((a, b) => {\n return a.length - b.length;\n });\n this._setMask();\n } else {\n this._maskExpressionArray = [];\n this._maskValue = maskExpression.currentValue || MaskExpression.EMPTY_STRING;\n this._maskService.maskExpression = this._maskValue;\n }\n }\n if (specialCharacters) {\n if (!specialCharacters.currentValue || !Array.isArray(specialCharacters.currentValue)) {\n return;\n } else {\n this._maskService.specialCharacters = specialCharacters.currentValue || [];\n }\n }\n if (allowNegativeNumbers) {\n this._maskService.allowNegativeNumbers = allowNegativeNumbers.currentValue;\n if (this._maskService.allowNegativeNumbers) {\n this._maskService.specialCharacters = this._maskService.specialCharacters.filter(c => c !== MaskExpression.MINUS);\n }\n }\n if (patterns && patterns.currentValue) {\n this._maskService.patterns = patterns.currentValue;\n }\n if (apm && apm.currentValue) {\n this._maskService.apm = apm.currentValue;\n }\n if (prefix) {\n this._maskService.prefix = prefix.currentValue;\n }\n if (suffix) {\n this._maskService.suffix = suffix.currentValue;\n }\n if (thousandSeparator) {\n this._maskService.thousandSeparator = thousandSeparator.currentValue;\n }\n if (decimalMarker) {\n this._maskService.decimalMarker = decimalMarker.currentValue;\n }\n if (dropSpecialCharacters) {\n this._maskService.dropSpecialCharacters = dropSpecialCharacters.currentValue;\n }\n if (hiddenInput) {\n this._maskService.hiddenInput = hiddenInput.currentValue;\n }\n if (showMaskTyped) {\n this._maskService.showMaskTyped = showMaskTyped.currentValue;\n if (showMaskTyped.previousValue === false && showMaskTyped.currentValue === true && this._isFocused) {\n requestAnimationFrame(() => {\n this._maskService._elementRef?.nativeElement.click();\n });\n }\n }\n if (placeHolderCharacter) {\n this._maskService.placeHolderCharacter = placeHolderCharacter.currentValue;\n }\n if (shownMaskExpression) {\n this._maskService.shownMaskExpression = shownMaskExpression.currentValue;\n }\n if (showTemplate) {\n this._maskService.showTemplate = showTemplate.currentValue;\n }\n if (clearIfNotMatch) {\n this._maskService.clearIfNotMatch = clearIfNotMatch.currentValue;\n }\n if (validation) {\n this._maskService.validation = validation.currentValue;\n }\n if (separatorLimit) {\n this._maskService.separatorLimit = separatorLimit.currentValue;\n }\n if (leadZeroDateTime) {\n this._maskService.leadZeroDateTime = leadZeroDateTime.currentValue;\n }\n if (leadZero) {\n this._maskService.leadZero = leadZero.currentValue;\n }\n if (triggerOnMaskChange) {\n this._maskService.triggerOnMaskChange = triggerOnMaskChange.currentValue;\n }\n if (inputTransformFn) {\n this._maskService.inputTransformFn = inputTransformFn.currentValue;\n }\n if (outputTransformFn) {\n this._maskService.outputTransformFn = outputTransformFn.currentValue;\n }\n if (keepCharacterPositions) {\n this._maskService.keepCharacterPositions = keepCharacterPositions.currentValue;\n }\n this._applyMask();\n }\n validate({\n value\n }) {\n const processedValue = typeof value === 'number' ? String(value) : value;\n if (!this._maskService.validation || !this._maskValue) {\n return null;\n }\n if (this._maskService.ipError) {\n return this._createValidationError(processedValue);\n }\n if (this._maskService.cpfCnpjError) {\n return this._createValidationError(processedValue);\n }\n if (this._maskValue.startsWith(MaskExpression.SEPARATOR)) {\n return null;\n }\n if (withoutValidation.includes(this._maskValue)) {\n return null;\n }\n if (this._maskService.clearIfNotMatch) {\n return null;\n }\n if (timeMasks.includes(this._maskValue)) {\n return this._validateTime(processedValue);\n }\n if (this._maskValue === MaskExpression.EMAIL_MASK) {\n const emailPattern = /^[^@]+@[^@]+\\.[^@]+$/;\n if (!emailPattern.test(processedValue) && processedValue) {\n return this._createValidationError(processedValue);\n } else {\n return null;\n }\n }\n if (processedValue && processedValue.length >= 1) {\n let counterOfOpt = 0;\n if (this._maskValue.includes(MaskExpression.CURLY_BRACKETS_LEFT) && this._maskValue.includes(MaskExpression.CURLY_BRACKETS_RIGHT)) {\n const lengthInsideCurlyBrackets = this._maskValue.slice(this._maskValue.indexOf(MaskExpression.CURLY_BRACKETS_LEFT) + 1, this._maskValue.indexOf(MaskExpression.CURLY_BRACKETS_RIGHT));\n return lengthInsideCurlyBrackets === String(processedValue.length) ? null : this._createValidationError(processedValue);\n }\n if (this._maskValue.startsWith(MaskExpression.PERCENT)) {\n return null;\n }\n for (const key in this._maskService.patterns) {\n if (this._maskService.patterns[key]?.optional) {\n if (this._maskValue.indexOf(key) !== this._maskValue.lastIndexOf(key)) {\n const opt = this._maskValue.split(MaskExpression.EMPTY_STRING).filter(i => i === key).join(MaskExpression.EMPTY_STRING);\n counterOfOpt += opt.length;\n } else if (this._maskValue.indexOf(key) !== -1) {\n counterOfOpt++;\n }\n if (this._maskValue.indexOf(key) !== -1 && processedValue.length >= this._maskValue.indexOf(key)) {\n return null;\n }\n if (counterOfOpt === this._maskValue.length) {\n return null;\n }\n }\n }\n if (this._maskValue.indexOf(MaskExpression.SYMBOL_STAR) > 1 && processedValue.length < this._maskValue.indexOf(MaskExpression.SYMBOL_STAR) || this._maskValue.indexOf(MaskExpression.SYMBOL_QUESTION) > 1 && processedValue.length < this._maskValue.indexOf(MaskExpression.SYMBOL_QUESTION)) {\n return this._createValidationError(processedValue);\n }\n if (this._maskValue.indexOf(MaskExpression.SYMBOL_STAR) === -1 || this._maskValue.indexOf(MaskExpression.SYMBOL_QUESTION) === -1) {\n const array = this._maskValue.split('*');\n const length = this._maskService.dropSpecialCharacters ? this._maskValue.length - this._maskService.checkDropSpecialCharAmount(this._maskValue) - counterOfOpt : this.prefix ? this._maskValue.length + this.prefix.length - counterOfOpt : this._maskValue.length - counterOfOpt;\n if (array.length === 1) {\n if (processedValue.length < length) {\n return this._createValidationError(processedValue);\n }\n }\n if (array.length > 1) {\n const lastIndexArray = array[array.length - 1];\n if (lastIndexArray && this._maskService.specialCharacters.includes(lastIndexArray[0]) && String(processedValue).includes(lastIndexArray[0] ?? '') && !this.dropSpecialCharacters) {\n const special = value.split(lastIndexArray[0]);\n return special[special.length - 1].length === lastIndexArray.length - 1 ? null : this._createValidationError(processedValue);\n } else if ((lastIndexArray && !this._maskService.specialCharacters.includes(lastIndexArray[0]) || !lastIndexArray || this._maskService.dropSpecialCharacters) && processedValue.length >= length - 1) {\n return null;\n } else {\n return this._createValidationError(processedValue);\n }\n }\n }\n if (this._maskValue.indexOf(MaskExpression.SYMBOL_STAR) === 1 || this._maskValue.indexOf(MaskExpression.SYMBOL_QUESTION) === 1) {\n return null;\n }\n }\n if (value) {\n this.maskFilled.emit();\n return null;\n }\n return null;\n }\n onPaste() {\n this._justPasted = true;\n }\n onFocus() {\n this._isFocused = true;\n }\n onModelChange(value) {\n if ((value === MaskExpression.EMPTY_STRING || value === null || typeof value === 'undefined') && this._maskService.actualValue) {\n this._maskService.actualValue = this._maskService.getActualValue(MaskExpression.EMPTY_STRING);\n }\n }\n onInput(e) {\n if (this._isComposing) {\n return;\n }\n const el = e.target;\n const transformedValue = this._maskService.inputTransformFn(el.value);\n if (el.type !== 'number') {\n if (typeof transformedValue === 'string' || typeof transformedValue === 'number') {\n el.value = transformedValue.toString();\n this._inputValue = el.value;\n this._setMask();\n if (!this._maskValue) {\n this.onChange(el.value);\n return;\n }\n let position = el.selectionStart === 1 ? el.selectionStart + this._maskService.prefix.length : el.selectionStart;\n if (this.showMaskTyped && this.keepCharacterPositions && this._maskService.placeHolderCharacter.length === 1) {\n const inputSymbol = el.value.slice(position - 1, position);\n const prefixLength = this.prefix.length;\n const checkSymbols = this._maskService._checkSymbolMask(inputSymbol, this._maskService.maskExpression[position - 1 - prefixLength] ?? MaskExpression.EMPTY_STRING);\n const checkSpecialCharacter = this._maskService._checkSymbolMask(inputSymbol, this._maskService.maskExpression[position + 1 - prefixLength] ?? MaskExpression.EMPTY_STRING);\n const selectRangeBackspace = this._maskService.selStart === this._maskService.selEnd;\n const selStart = Number(this._maskService.selStart) - prefixLength;\n const selEnd = Number(this._maskService.selEnd) - prefixLength;\n const backspaceOrDelete = this._code === MaskExpression.BACKSPACE || this._code === MaskExpression.DELETE;\n if (backspaceOrDelete) {\n if (!selectRangeBackspace) {\n if (this._maskService.selStart === prefixLength) {\n this._maskService.actualValue = `${this.prefix}${this._maskService.maskIsShown.slice(0, selEnd)}${this._inputValue.split(this.prefix).join('')}`;\n } else if (this._maskService.selStart === this._maskService.maskIsShown.length + prefixLength) {\n this._maskService.actualValue = `${this._inputValue}${this._maskService.maskIsShown.slice(selStart, selEnd)}`;\n } else {\n this._maskService.actualValue = `${this.prefix}${this._inputValue.split(this.prefix).join('').slice(0, selStart)}${this._maskService.maskIsShown.slice(selStart, selEnd)}${this._maskService.actualValue.slice(selEnd + prefixLength, this._maskService.maskIsShown.length + prefixLength)}${this.suffix}`;\n }\n } else if (!this._maskService.specialCharacters.includes(this._maskService.maskExpression.slice(position - this.prefix.length, position + 1 - this.prefix.length)) && selectRangeBackspace) {\n if (selStart === 1 && this.prefix) {\n this._maskService.actualValue = `${this.prefix}${this._maskService.placeHolderCharacter}${el.value.split(this.prefix).join('').split(this.suffix).join('')}${this.suffix}`;\n position = position - 1;\n } else {\n const part1 = el.value.substring(0, position);\n const part2 = el.value.substring(position);\n this._maskService.actualValue = `${part1}${this._maskService.placeHolderCharacter}${part2}`;\n }\n }\n position = this._code === MaskExpression.DELETE ? position + 1 : position;\n }\n if (!backspaceOrDelete) {\n if (!checkSymbols && !checkSpecialCharacter && selectRangeBackspace) {\n position = Number(el.selectionStart) - 1;\n } else if (this._maskService.specialCharacters.includes(el.value.slice(position, position + 1)) && checkSpecialCharacter && !this._maskService.specialCharacters.includes(el.value.slice(position + 1, position + 2))) {\n this._maskService.actualValue = `${el.value.slice(0, position - 1)}${el.value.slice(position, position + 1)}${inputSymbol}${el.value.slice(position + 2)}`;\n position = position + 1;\n } else if (checkSymbols) {\n if (el.value.length === 1 && position === 1) {\n this._maskService.actualValue = `${this.prefix}${inputSymbol}${this._maskService.maskIsShown.slice(1, this._maskService.maskIsShown.length)}${this.suffix}`;\n } else {\n this._maskService.actualValue = `${el.value.slice(0, position - 1)}${inputSymbol}${el.value.slice(position + 1).split(this.suffix).join('')}${this.suffix}`;\n }\n } else if (this.prefix && el.value.length === 1 && position - prefixLength === 1 && this._maskService._checkSymbolMask(el.value, this._maskService.maskExpression[position - 1 - prefixLength] ?? MaskExpression.EMPTY_STRING)) {\n this._maskService.actualValue = `${this.prefix}${el.value}${this._maskService.maskIsShown.slice(1, this._maskService.maskIsShown.length)}${this.suffix}`;\n }\n }\n }\n let caretShift = 0;\n let backspaceShift = false;\n if (this._code === MaskExpression.DELETE && MaskExpression.SEPARATOR) {\n this._maskService.deletedSpecialCharacter = true;\n }\n if (this._inputValue.length >= this._maskService.maskExpression.length - 1 && this._code !== MaskExpression.BACKSPACE && this._maskService.maskExpression === MaskExpression.DAYS_MONTHS_YEARS && position < 10) {\n const inputSymbol = this._inputValue.slice(position - 1, position);\n el.value = this._inputValue.slice(0, position - 1) + inputSymbol + this._inputValue.slice(position + 1);\n }\n if (this._maskService.maskExpression === MaskExpression.DAYS_MONTHS_YEARS && this.leadZeroDateTime) {\n if (position < 3 && Number(el.value) > 31 && Number(el.value) < 40 || position === 5 && Number(el.value.slice(3, 5)) > 12) {\n position = position + 2;\n }\n }\n if (this._maskService.maskExpression === MaskExpression.HOURS_MINUTES_SECONDS && this.apm) {\n if (this._justPasted && el.value.slice(0, 2) === MaskExpression.DOUBLE_ZERO) {\n el.value = el.value.slice(1, 2) + el.value.slice(2, el.value.length);\n }\n el.value = el.value === MaskExpression.DOUBLE_ZERO ? MaskExpression.NUMBER_ZERO : el.value;\n }\n this._maskService.applyValueChanges(position, this._justPasted, this._code === MaskExpression.BACKSPACE || this._code === MaskExpression.DELETE, (shift, _backspaceShift) => {\n this._justPasted = false;\n caretShift = shift;\n backspaceShift = _backspaceShift;\n });\n if (this._getActiveElement() !== el) {\n return;\n }\n if (this._maskService.plusOnePosition) {\n position = position + 1;\n this._maskService.plusOnePosition = false;\n }\n if (this._maskExpressionArray.length) {\n if (this._code === MaskExpression.BACKSPACE) {\n const specialChartMinusOne = this.specialCharacters.includes(this._maskService.actualValue.slice(position - 1, position));\n const specialChartPlusOne = this.specialCharacters.includes(this._maskService.actualValue.slice(position, position + 1));\n if (this._allowFewMaskChangeMask && !specialChartPlusOne) {\n position = el.selectionStart + 1;\n this._allowFewMaskChangeMask = false;\n } else {\n position = specialChartMinusOne ? position - 1 : position;\n }\n } else {\n position = el.selectionStart === 1 ? el.selectionStart + this._maskService.prefix.length : el.selectionStart;\n }\n }\n this._position = this._position === 1 && this._inputValue.length === 1 ? null : this._position;\n let positionToApply = this._position ? this._inputValue.length + position + caretShift : position + (this._code === MaskExpression.BACKSPACE && !backspaceShift ? 0 : caretShift);\n if (positionToApply > this._getActualInputLength()) {\n positionToApply = el.value === this._maskService.decimalMarker && el.value.length === 1 ? this._getActualInputLength() + 1 : this._getActualInputLength();\n }\n if (positionToApply < 0) {\n positionToApply = 0;\n }\n el.setSelectionRange(positionToApply, positionToApply);\n this._position = null;\n } else {\n console.warn('Ngx-mask writeValue work with string | number, your current value:', typeof transformedValue);\n }\n } else {\n if (!this._maskValue) {\n this.onChange(el.value);\n return;\n }\n this._maskService.applyValueChanges(el.value.length, this._justPasted, this._code === MaskExpression.BACKSPACE || this._code === MaskExpression.DELETE);\n }\n }\n onCompositionStart() {\n this._isComposing = true;\n }\n onCompositionEnd(e) {\n this._isComposing = false;\n this._justPasted = true;\n this.onInput(e);\n }\n onBlur(e) {\n if (this._maskValue) {\n const el = e.target;\n if (this._maskService.leadZero && el.value.length > 0 && typeof this._maskService.decimalMarker === 'string') {\n const maskExpression = this._maskService.maskExpression;\n const precision = Number(this._maskService.maskExpression.slice(maskExpression.length - 1, maskExpression.length));\n if (precision > 0) {\n el.value = this._maskService.suffix ? el.value.split(this._maskService.suffix).join('') : el.value;\n const decimalPart = el.value.split(this._maskService.decimalMarker)[1];\n el.value = el.value.includes(this._maskService.decimalMarker) ? el.value + MaskExpression.NUMBER_ZERO.repeat(precision - decimalPart.length) + this._maskService.suffix : el.value + this._maskService.decimalMarker + MaskExpression.NUMBER_ZERO.repeat(precision) + this._maskService.suffix;\n this._maskService.actualValue = el.value;\n }\n }\n this._maskService.clearIfNotMatchFn();\n }\n this._isFocused = false;\n this.onTouch();\n }\n onClick(e) {\n if (!this._maskValue) {\n return;\n }\n const el = e.target;\n const posStart = 0;\n const posEnd = 0;\n if (el !== null && el.selectionStart !== null && el.selectionStart === el.selectionEnd && el.selectionStart > this._maskService.prefix.length && e.keyCode !== 38) {\n if (this._maskService.showMaskTyped && !this.keepCharacterPositions) {\n this._maskService.maskIsShown = this._maskService.showMaskInInput();\n if (el.setSelectionRange && this._maskService.prefix + this._maskService.maskIsShown === el.value) {\n el.focus();\n el.setSelectionRange(posStart, posEnd);\n } else {\n if (el.selectionStart > this._maskService.actualValue.length) {\n el.setSelectionRange(this._maskService.actualValue.length, this._maskService.actualValue.length);\n }\n }\n }\n }\n const nextValue = el && (el.value === this._maskService.prefix ? this._maskService.prefix + this._maskService.maskIsShown : el.value);\n if (el && el.value !== nextValue) {\n el.value = nextValue;\n }\n if (el && el.type !== 'number' && (el.selectionStart || el.selectionEnd) <= this._maskService.prefix.length) {\n const specialCharactersAtTheStart = this._maskService.maskExpression.match(new RegExp(`^[${this._maskService.specialCharacters.map(c => `\\\\${c}`).join('')}]+`))?.[0].length || 0;\n el.selectionStart = this._maskService.prefix.length + specialCharactersAtTheStart;\n return;\n }\n if (el && el.selectionEnd > this._getActualInputLength()) {\n el.selectionEnd = this._getActualInputLength();\n }\n }\n onKeyDown(e) {\n if (!this._maskValue) {\n return;\n }\n if (this._isComposing) {\n if (e.key === 'Enter') {\n this.onCompositionEnd(e);\n }\n return;\n }\n this._code = e.code ? e.code : e.key;\n const el = e.target;\n this._inputValue = el.value;\n this._setMask();\n if (el.type !== 'number') {\n if (e.key === MaskExpression.ARROW_UP) {\n e.preventDefault();\n }\n if (e.key === MaskExpression.ARROW_LEFT || e.key === MaskExpression.BACKSPACE || e.key === MaskExpression.DELETE) {\n if (e.key === MaskExpression.BACKSPACE && el.value.length === 0) {\n el.selectionStart = el.selectionEnd;\n }\n if (e.key === MaskExpression.BACKSPACE && el.selectionStart !== 0) {\n this.specialCharacters = this.specialCharacters?.length ? this.specialCharacters : this._config.specialCharacters;\n if (this.prefix.length > 1 && el.selectionStart <= this.prefix.length) {\n el.setSelectionRange(this.prefix.length, el.selectionEnd);\n } else {\n if (this._inputValue.length !== el.selectionStart && el.selectionStart !== 1) {\n while (this.specialCharacters.includes((this._inputValue[el.selectionStart - 1] ?? MaskExpression.EMPTY_STRING).toString()) && (this.prefix.length >= 1 && el.selectionStart > this.prefix.length || this.prefix.length === 0)) {\n el.setSelectionRange(el.selectionStart - 1, el.selectionEnd);\n }\n }\n }\n }\n this.checkSelectionOnDeletion(el);\n if (this._maskService.prefix.length && el.selectionStart <= this._maskService.prefix.length && el.selectionEnd <= this._maskService.prefix.length) {\n e.preventDefault();\n }\n const cursorStart = el.selectionStart;\n if (e.key === MaskExpression.BACKSPACE && !el.readOnly && cursorStart === 0 && el.selectionEnd === el.value.length && el.value.length !== 0) {\n this._position = this._maskService.prefix ? this._maskService.prefix.length : 0;\n this._maskService.applyMask(this._maskService.prefix, this._maskService.maskExpression, this._position);\n }\n }\n if (!!this.suffix && this.suffix.length > 1 && this._inputValue.length - this.suffix.length < el.selectionStart) {\n el.setSelectionRange(this._inputValue.length - this.suffix.length, this._inputValue.length);\n } else if (e.code === 'KeyA' && e.ctrlKey || e.code === 'KeyA' && e.metaKey) {\n el.setSelectionRange(0, this._getActualInputLength());\n e.preventDefault();\n }\n this._maskService.selStart = el.selectionStart;\n this._maskService.selEnd = el.selectionEnd;\n }\n }\n async writeValue(controlValue) {\n let value = controlValue;\n if (typeof value === 'object' && value !== null && 'value' in value) {\n if ('disable' in value) {\n this.setDisabledState(Boolean(value.disable));\n }\n value = value.value;\n }\n if (value !== null) {\n value = this.inputTransformFn ? this.inputTransformFn(value) : value;\n }\n if (typeof value === 'string' || typeof value === 'number' || value === null || typeof value === 'undefined') {\n if (value === null || typeof value === 'undefined' || value === '') {\n this._maskService._currentValue = '';\n this._maskService._previousValue = '';\n }\n let inputValue = value;\n if (typeof inputValue === 'number' || this._maskValue.startsWith(MaskExpression.SEPARATOR)) {\n inputValue = String(inputValue);\n const localeDecimalMarker = this._maskService.currentLocaleDecimalMarker();\n if (!Array.isArray(this._maskService.decimalMarker)) {\n inputValue = this._maskService.decimalMarker !== localeDecimalMarker ? inputValue.replace(localeDecimalMarker, this._maskService.decimalMarker) : inputValue;\n }\n if (this._maskService.leadZero && inputValue && this.maskExpression && this.dropSpecialCharacters !== false) {\n inputValue = this._maskService._checkPrecision(this._maskService.maskExpression, inputValue);\n }\n if (this._maskService.decimalMarker === MaskExpression.COMMA || Array.isArray(this._maskService.decimalMarker) && this._maskService.thousandSeparator === MaskExpression.DOT) {\n inputValue = inputValue.toString().replace(MaskExpression.DOT, MaskExpression.COMMA);\n }\n if (this.maskExpression?.startsWith(MaskExpression.SEPARATOR) && this.leadZero) {\n requestAnimationFrame(() => {\n this._maskService.applyMask(inputValue?.toString() ?? '', this._maskService.maskExpression);\n });\n }\n this._maskService.isNumberValue = true;\n }\n if (typeof inputValue !== 'string') {\n inputValue = '';\n }\n this._inputValue = inputValue;\n this._setMask();\n if (inputValue && this._maskService.maskExpression || this._maskService.maskExpression && (this._maskService.prefix || this._maskService.showMaskTyped)) {\n if (typeof this.inputTransformFn !== 'function') {\n this._maskService.writingValue = true;\n }\n this._maskService.formElementProperty = ['value', this._maskService.applyMask(inputValue, this._maskService.maskExpression)];\n if (typeof this.inputTransformFn !== 'function') {\n this._maskService.writingValue = false;\n }\n } else {\n this._maskService.formElementProperty = ['value', inputValue];\n }\n this._inputValue = inputValue;\n } else {\n console.warn('Ngx-mask writeValue work with string | number, your current value:', typeof value);\n }\n }\n registerOnChange(fn) {\n this._maskService.onChange = this.onChange = fn;\n }\n registerOnTouched(fn) {\n this.onTouch = fn;\n }\n _getActiveElement(document = this.document) {\n const shadowRootEl = document?.activeElement?.shadowRoot;\n if (!shadowRootEl?.activeElement) {\n return document.activeElement;\n } else {\n return this._getActiveElement(shadowRootEl);\n }\n }\n checkSelectionOnDeletion(el) {\n el.selectionStart = Math.min(Math.max(this.prefix.length, el.selectionStart), this._inputValue.length - this.suffix.length);\n el.selectionEnd = Math.min(Math.max(this.prefix.length, el.selectionEnd), this._inputValue.length - this.suffix.length);\n }\n setDisabledState(isDisabled) {\n this._maskService.formElementProperty = ['disabled', isDisabled];\n }\n _applyMask() {\n this._maskService.maskExpression = this._maskService._repeatPatternSymbols(this._maskValue || '');\n this._maskService.formElementProperty = ['value', this._maskService.applyMask(this._inputValue, this._maskService.maskExpression)];\n }\n _validateTime(value) {\n const rowMaskLen = this._maskValue.split(MaskExpression.EMPTY_STRING).filter(s => s !== ':').length;\n if (!value) {\n return null;\n }\n if (+(value[value.length - 1] ?? -1) === 0 && value.length < rowMaskLen || value.length <= rowMaskLen - 2) {\n return this._createValidationError(value);\n }\n return null;\n }\n _getActualInputLength() {\n return this._maskService.actualValue.length || this._maskService.actualValue.length + this._maskService.prefix.length;\n }\n _createValidationError(actualValue) {\n return {\n mask: {\n requiredMask: this._maskValue,\n actualValue\n }\n };\n }\n _setMask() {\n this._maskExpressionArray.some(mask => {\n const specialChart = mask.split(MaskExpression.EMPTY_STRING).some(char => this._maskService.specialCharacters.includes(char));\n if (specialChart && this._inputValue && this._areAllCharactersInEachStringSame(this._maskExpressionArray) || mask.includes(MaskExpression.CURLY_BRACKETS_LEFT)) {\n const test = this._maskService.removeMask(this._inputValue)?.length <= this._maskService.removeMask(mask)?.length;\n if (test) {\n this._maskValue = this.maskExpression = this._maskService.maskExpression = mask.includes(MaskExpression.CURLY_BRACKETS_LEFT) ? this._maskService._repeatPatternSymbols(mask) : mask;\n return test;\n } else {\n if (this._code === MaskExpression.BACKSPACE) {\n this._allowFewMaskChangeMask = true;\n }\n const expression = this._maskExpressionArray[this._maskExpressionArray.length - 1] ?? MaskExpression.EMPTY_STRING;\n this._maskValue = this.maskExpression = this._maskService.maskExpression = expression.includes(MaskExpression.CURLY_BRACKETS_LEFT) ? this._maskService._repeatPatternSymbols(expression) : expression;\n }\n } else {\n const check = this._maskService.removeMask(this._inputValue)?.split(MaskExpression.EMPTY_STRING).every((character, index) => {\n const indexMask = mask.charAt(index);\n return this._maskService._checkSymbolMask(character, indexMask);\n });\n if (check || this._justPasted) {\n this._maskValue = this.maskExpression = this._maskService.maskExpression = mask;\n return check;\n }\n }\n });\n }\n _areAllCharactersInEachStringSame(array) {\n const specialCharacters = this._maskService.specialCharacters;\n function removeSpecialCharacters(str) {\n const regex = new RegExp(`[${specialCharacters.map(ch => `\\\\${ch}`).join('')}]`, 'g');\n return str.replace(regex, '');\n }\n const processedArr = array.map(removeSpecialCharacters);\n return processedArr.every(str => {\n const uniqueCharacters = new Set(str);\n return uniqueCharacters.size === 1;\n });\n }\n static ɵfac = function NgxMaskDirective_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || NgxMaskDirective)();\n };\n static ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: NgxMaskDirective,\n selectors: [[\"input\", \"mask\", \"\"], [\"textarea\", \"mask\", \"\"]],\n hostBindings: function NgxMaskDirective_HostBindings(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵlistener(\"paste\", function NgxMaskDirective_paste_HostBindingHandler() {\n return ctx.onPaste();\n })(\"focus\", function NgxMaskDirective_focus_HostBindingHandler($event) {\n return ctx.onFocus($event);\n })(\"ngModelChange\", function NgxMaskDirective_ngModelChange_HostBindingHandler($event) {\n return ctx.onModelChange($event);\n })(\"input\", function NgxMaskDirective_input_HostBindingHandler($event) {\n return ctx.onInput($event);\n })(\"compositionstart\", function NgxMaskDirective_compositionstart_HostBindingHandler($event) {\n return ctx.onCompositionStart($event);\n })(\"compositionend\", function NgxMaskDirective_compositionend_HostBindingHandler($event) {\n return ctx.onCompositionEnd($event);\n })(\"blur\", function NgxMaskDirective_blur_HostBindingHandler($event) {\n return ctx.onBlur($event);\n })(\"click\", function NgxMaskDirective_click_HostBindingHandler($event) {\n return ctx.onClick($event);\n })(\"keydown\", function NgxMaskDirective_keydown_HostBindingHandler($event) {\n return ctx.onKeyDown($event);\n });\n }\n },\n inputs: {\n maskExpression: [0, \"mask\", \"maskExpression\"],\n specialCharacters: \"specialCharacters\",\n patterns: \"patterns\",\n prefix: \"prefix\",\n suffix: \"suffix\",\n thousandSeparator: \"thousandSeparator\",\n decimalMarker: \"decimalMarker\",\n dropSpecialCharacters: \"dropSpecialCharacters\",\n hiddenInput: \"hiddenInput\",\n showMaskTyped: \"showMaskTyped\",\n placeHolderCharacter: \"placeHolderCharacter\",\n shownMaskExpression: \"shownMaskExpression\",\n showTemplate: \"showTemplate\",\n clearIfNotMatch: \"clearIfNotMatch\",\n validation: \"validation\",\n separatorLimit: \"separatorLimit\",\n allowNegativeNumbers: \"allowNegativeNumbers\",\n leadZeroDateTime: \"leadZeroDateTime\",\n leadZero: \"leadZero\",\n triggerOnMaskChange: \"triggerOnMaskChange\",\n apm: \"apm\",\n inputTransformFn: \"inputTransformFn\",\n outputTransformFn: \"outputTransformFn\",\n keepCharacterPositions: \"keepCharacterPositions\"\n },\n outputs: {\n maskFilled: \"maskFilled\"\n },\n exportAs: [\"mask\", \"ngxMask\"],\n standalone: true,\n features: [i0.ɵɵProvidersFeature([{\n provide: NG_VALUE_ACCESSOR,\n useExisting: NgxMaskDirective,\n multi: true\n }, {\n provide: NG_VALIDATORS,\n useExisting: NgxMaskDirective,\n multi: true\n }, NgxMaskService]), i0.ɵɵNgOnChangesFeature]\n });\n }\n return NgxMaskDirective;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\nlet NgxMaskPipe = /*#__PURE__*/(() => {\n class NgxMaskPipe {\n defaultOptions = inject(NGX_MASK_CONFIG);\n _maskService = inject(NgxMaskService);\n _maskExpressionArray = [];\n mask = '';\n transform(value, mask, {\n patterns,\n ...config\n } = {}) {\n let processedValue = value;\n const currentConfig = {\n maskExpression: mask,\n ...this.defaultOptions,\n ...config,\n patterns: {\n ...this._maskService.patterns,\n ...patterns\n }\n };\n Object.entries(currentConfig).forEach(([key, val]) => {\n this._maskService[key] = val;\n });\n if (mask.includes('||')) {\n const maskParts = mask.split('||');\n if (maskParts.length > 1) {\n this._maskExpressionArray = maskParts.sort((a, b) => a.length - b.length);\n this._setMask(processedValue);\n return this._maskService.applyMask(`${processedValue}`, this.mask);\n } else {\n this._maskExpressionArray = [];\n return this._maskService.applyMask(`${processedValue}`, this.mask);\n }\n }\n if (mask.includes(MaskExpression.CURLY_BRACKETS_LEFT)) {\n return this._maskService.applyMask(`${processedValue}`, this._maskService._repeatPatternSymbols(mask));\n }\n if (mask.startsWith(MaskExpression.SEPARATOR)) {\n if (config.decimalMarker) {\n this._maskService.decimalMarker = config.decimalMarker;\n }\n if (config.thousandSeparator) {\n this._maskService.thousandSeparator = config.thousandSeparator;\n }\n if (config.leadZero) {\n this._maskService.leadZero = config.leadZero;\n }\n processedValue = String(processedValue);\n const localeDecimalMarker = this._maskService.currentLocaleDecimalMarker();\n if (!Array.isArray(this._maskService.decimalMarker)) {\n processedValue = this._maskService.decimalMarker !== localeDecimalMarker ? processedValue.replace(localeDecimalMarker, this._maskService.decimalMarker) : processedValue;\n }\n if (this._maskService.leadZero && processedValue && this._maskService.dropSpecialCharacters !== false) {\n processedValue = this._maskService._checkPrecision(mask, processedValue);\n }\n if (this._maskService.decimalMarker === MaskExpression.COMMA) {\n processedValue = processedValue.replace(MaskExpression.DOT, MaskExpression.COMMA);\n }\n this._maskService.isNumberValue = true;\n }\n if (processedValue === null || typeof processedValue === 'undefined') {\n return this._maskService.applyMask('', mask);\n }\n return this._maskService.applyMask(`${processedValue}`, mask);\n }\n _setMask(value) {\n if (this._maskExpressionArray.length > 0) {\n this._maskExpressionArray.some(mask => {\n const test = this._maskService.removeMask(value)?.length <= this._maskService.removeMask(mask)?.length;\n if (value && test) {\n this.mask = mask;\n return test;\n } else {\n const expression = this._maskExpressionArray[this._maskExpressionArray.length - 1] ?? MaskExpression.EMPTY_STRING;\n this.mask = expression;\n }\n });\n }\n }\n static ɵfac = function NgxMaskPipe_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || NgxMaskPipe)();\n };\n static ɵpipe = /* @__PURE__ */i0.ɵɵdefinePipe({\n name: \"mask\",\n type: NgxMaskPipe,\n pure: true,\n standalone: true\n });\n }\n return NgxMaskPipe;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\nexport { INITIAL_CONFIG, NEW_CONFIG, NGX_MASK_CONFIG, NgxMaskDirective, NgxMaskPipe, NgxMaskService, initialConfig, provideEnvironmentNgxMask, provideNgxMask, timeMasks, withoutValidation };\n"],"mappings":"4KAIA,IAAIA,EAA8B,SAAUA,EAAgB,CAC1D,OAAAA,EAAe,UAAe,YAC9BA,EAAe,QAAa,UAC5BA,EAAe,GAAQ,KACvBA,EAAe,SAAc,WAC7BA,EAAe,MAAW,IAC1BA,EAAe,OAAY,KAC3BA,EAAe,OAAY,IAC3BA,EAAe,KAAU,IACzBA,EAAe,MAAW,IAC1BA,EAAe,QAAa,KAC5BA,EAAe,WAAgB,KAC/BA,EAAe,QAAa,KAC5BA,EAAe,sBAA2B,WAC1CA,EAAe,WAAgB,WAC/BA,EAAe,cAAmB,QAClCA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P,WAAY,YACd,EACA,SAAU,CAAC,OAAQ,SAAS,EAC5B,WAAY,GACZ,SAAU,CAAIC,GAAmB,CAAC,CAChC,QAASC,GACT,YAAa3G,EACb,MAAO,EACT,EAAG,CACD,QAAS4G,GACT,YAAa5G,EACb,MAAO,EACT,EAAGK,CAAc,CAAC,EAAMwG,CAAoB,CAC9C,CAAC,GAntBH,IAAM9G,EAANC,EAqtBA,OAAOD,CACT,GAAG","names":["MaskExpression","NGX_MASK_CONFIG","InjectionToken","NEW_CONFIG","INITIAL_CONFIG","initialConfig","value","EventEmitter","timeMasks","withoutValidation","NgxMaskApplierService","_NgxMaskApplierService","__publicField","inject","str","thousandSeparatorChar","decimalChars","precision","x","decimalChar","regExp","v","decimals","res","separatorLimit","rgx","sanitizedStr","maskExpression","inputValue","i","substr","decimalMarker","processedInputValue","processedDecimalMarker","marker","dm","precisionRegEx","precisionMatch","precisionMatchLength","diff","maskAndPattern","mask","customPattern","position","justPasted","backspaced","cb","cursor","result","multi","backspaceShift","shift","stepBack","processedValue","processedPosition","inputArray","valuesIP","arr","base","inputValueAfterZero","positionOfZeroOrDecimalMarker","zeroIndexNumberZero","zeroIndexMinus","zeroIndexThousand","firstIndexDecimalMarker","firstIndexNumberZero","secondIndexDecimalMarker","thousandSeparatorCharEscaped","invalidChars","invalidCharRegexp","strForSep","commaShift","shiftStep","backspacedDecimalMarkerWithSeparatorLimit","_shift","inputSymbol","symbolStarInPattern","daysCount","inputValueCursor","inputValueCursorPlusOne","inputValueCursorPlusTwo","inputValueCursorMinusOne","inputValueCursorMinusTwo","inputValueSliceMinusThreeMinusOne","inputValueSliceMinusOnePlusOne","inputValueSliceCursorPlusTwo","inputValueSliceMinusTwoCursor","maskStartWithMonth","startWithMonthInput","withoutDays","specialChart","day1monthInput","day2monthInput","day2monthInputDot","day1monthPaste","day2monthPaste","newPosition","actualShift","onlySpecial","char","isSpecialCharacterMaskFirstSymbol","val","maskSymbol","idx","isDecimalMarker","inputLength","comparedValue","excludedValue","index","decimalIndex","emptyOrMinus","parsedValue","integerPart","decimalPart","integerString","decimal","inputString","__ngFactoryType__","ɵɵdefineInjectable","NgxMaskService","_NgxMaskService","_","ElementRef","DOCUMENT","Renderer2","getSymbol","newInputValue","actualResult","item","resLen","prefNmask","countSkipedSymbol","regex","match","formElement","curr","compare","symbol","maskChar","symbolToReplace","currSymbol","replaceSymbol","inputVal","name","cpf","cnpj","document","shadowRootEl","num","specialCharactersForRemove","specialCharacters","markers","processedResult","separatorPrecision","separatorValue","key","patternString","pattern","maskExpretion","matcher","separatorExpression","maskExp","accum","currVal","repeatNumber","replaceWith","symbols","ɵNgxMaskService_BaseFactory","ɵɵgetInheritedFactory","_configFactory","initConfig","configValue","__spreadValues","provideNgxMask","NgxMaskDirective","_NgxMaskDirective","__publicField","EventEmitter","inject","DOCUMENT","NgxMaskService","NGX_MASK_CONFIG","_","changes","maskExpression","specialCharacters","patterns","prefix","suffix","thousandSeparator","decimalMarker","dropSpecialCharacters","hiddenInput","showMaskTyped","placeHolderCharacter","shownMaskExpression","showTemplate","clearIfNotMatch","validation","separatorLimit","allowNegativeNumbers","leadZeroDateTime","leadZero","triggerOnMaskChange","apm","inputTransformFn","outputTransformFn","keepCharacterPositions","MaskExpression","a","b","c","value","processedValue","withoutValidation","timeMasks","counterOfOpt","key","opt","i","array","length","lastIndexArray","special","e","el","transformedValue","position","inputSymbol","prefixLength","checkSymbols","checkSpecialCharacter","selectRangeBackspace","selStart","selEnd","backspaceOrDelete","part1","part2","caretShift","backspaceShift","shift","_backspaceShift","specialChartMinusOne","specialChartPlusOne","positionToApply","precision","decimalPart","posStart","posEnd","nextValue","specialCharactersAtTheStart","cursorStart","controlValue","__async","inputValue","localeDecimalMarker","fn","document","shadowRootEl","isDisabled","rowMaskLen","s","actualValue","mask","char","test","expression","check","character","index","indexMask","removeSpecialCharacters","str","regex","ch","__ngFactoryType__","ɵɵdefineDirective","rf","ctx","ɵɵlistener","$event","ɵɵProvidersFeature","NG_VALUE_ACCESSOR","NG_VALIDATORS","ɵɵNgOnChangesFeature"],"x_google_ignoreList":[0]}