{"version":3,"file":"seniorsistemas-angular-components-numeric-mask.mjs","sources":["../../projects/angular-components/numeric-mask/src/lib/numeric-mask/numeric-mask.directive.ts","../../projects/angular-components/numeric-mask/src/lib/numeric-mask/numeric-mask.module.ts","../../projects/angular-components/numeric-mask/src/seniorsistemas-angular-components-numeric-mask.ts"],"sourcesContent":["import {\n    Directive,\n    DestroyRef,\n    ElementRef,\n    forwardRef,\n    inject,\n    input,\n    model,\n    OnChanges,\n    OnInit,\n    output,\n    Renderer2,\n    SimpleChanges,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {\n    AbstractControl,\n    ControlValueAccessor,\n    NG_VALIDATORS,\n    NG_VALUE_ACCESSOR,\n    ValidationErrors,\n    Validator,\n} from '@angular/forms';\n\nimport { LocaleService } from '@seniorsistemas/angular-components/locale';\nimport BigNumber from 'bignumber.js';\n\n/**\n * @description Diretiva de máscara numérica com suporte a internacionalização.\n *\n * Formata valores numéricos de acordo com o locale especificado, aplicando\n * separadores de milhar e decimal adequados, com suporte a valores negativos,\n * controle de casas decimais mín/máx e notação científica.\n *\n * @example\n * ```html\n * <input\n *   type=\"text\"\n *   sNumericMask\n *   [locale]=\"'pt-BR'\"\n *   [minDecimalPlaces]=\"2\"\n *   [maxDecimalPlaces]=\"2\"\n *   [allowNegative]=\"true\"\n *   [(ngModel)]=\"value\"\n * />\n * ```\n * @category Numeric\n */\n@Directive({\n    selector: '[sNumericMask]',\n    standalone: true,\n    host: {\n        '(input)': 'onInput($event)',\n        '(focus)': 'onFocus()',\n        '(blur)': 'onBlur()',\n        '(paste)': 'onPaste($event)',\n        '(keydown)': 'onKeyDown($event)',\n        '(keypress)': 'onKeyPress($event)',\n        '[style.text-align]': '\"right\"',\n        '[attr.maxLength]': 'maxLength',\n        '[attr.placeholder]': 'placeholder()',\n    },\n    providers: [\n        {\n            provide: NG_VALUE_ACCESSOR,\n            useExisting: forwardRef(() => NumericMaskDirective),\n            multi: true,\n        },\n        {\n            provide: NG_VALIDATORS,\n            useExisting: forwardRef(() => NumericMaskDirective),\n            multi: true,\n        },\n    ],\n})\nexport class NumericMaskDirective implements OnInit, OnChanges, ControlValueAccessor, Validator {\n    /**\n     * Locale for formatting (e.g. 'pt-BR', 'en-US', 'de-DE')\n     * If not provided, uses the locale from LocaleService\n     */\n    public locale = input<string | undefined>(undefined);\n\n    /**\n     * Minimum number of decimal places to display\n     * @default 0\n     */\n    public minDecimalPlaces = input(0);\n\n    /**\n     * Maximum number of decimal places allowed\n     * @default 10\n     */\n    public maxDecimalPlaces = input(10);\n\n    /**\n     * Allows negative values\n     * @default false\n     */\n    public allowNegative = input(false);\n\n    /**\n     * Enables scientific notation support\n     * @default true\n     */\n    public allowScientificNotation = input(true);\n\n    /**\n     * Minimum value allowed\n     */\n    public min = input<number | undefined>(undefined);\n\n    /**\n     * Maximum value allowed\n     */\n    public max = input<number | undefined>(undefined);\n\n    /**\n     * Blocks typing/pasting decimal digits beyond maxDecimalPlaces.\n     * When maxDecimalPlaces is 0, the decimal separator itself cannot be entered.\n     * @default true\n     */\n    public blockDecimalOverflow = input(true);\n\n    /**\n     * Strategy applied on blur when blockDecimalOverflow is false.\n     * 'preserve' keeps the model at full precision; only the display is truncated (legacy behavior).\n     * 'truncate' cuts the excess decimals without rounding (towards zero), updating the model too.\n     * 'roundUp' always rounds to the next representable value above (ceiling), updating the model too.\n     * 'roundDown' always rounds to the next representable value below (floor), updating the model too.\n     * Has no effect while blockDecimalOverflow is true.\n     * @default 'preserve'\n     */\n    public decimalRoundingMode = input<'preserve' | 'truncate' | 'roundUp' | 'roundDown'>('preserve');\n\n    /**\n     * Maximum number of significant digits accepted by the field (integer + decimal part).\n     * Opt-in: when left `undefined` (default), there is no total-digit limit, no native `maxLength`\n     * is applied, pasted values are never rejected, and `placeholder` is never auto-calculated —\n     * i.e. the directive behaves exactly as before this input existed.\n     */\n    public precision = input<number | undefined>(undefined);\n\n    /**\n     * Placeholder text shown when the field is empty. When `precision` is set and this is left\n     * unset, it is auto-calculated from `minDecimalPlaces` (e.g. `0,00`); has no effect otherwise.\n     */\n    public placeholder = model<string | undefined>(undefined);\n\n    /**\n     * Emitted when a pasted value is rejected for exceeding `precision`. Only fires when\n     * `precision` is set; emits the rejected pasted text.\n     */\n    public pasteRejected = output<string>();\n\n    /** Native `maxLength` attribute, auto-calculated from `precision` when it is set. */\n    public maxLength: number | undefined;\n\n    private readonly elementRef = inject(ElementRef<HTMLInputElement>);\n    private readonly renderer = inject(Renderer2);\n    private readonly localeService = inject(LocaleService, { optional: true });\n    private readonly _destroyRef = inject(DestroyRef);\n\n    private onChange: (value: string | null) => void = () => {};\n    private onTouched: () => void = () => {};\n    public decimalSeparator = model(',');\n    public thousandSeparator = model('.');\n    protected currentLocale = 'pt-BR';\n    private lastModelValue: string | null = null;\n    /** `protected`: subclasses with their own deprecated separator aliases (e.g. `BignumberInputDirective`) set this directly. */\n    protected _decimalSeparatorExplicit = false;\n    /** `protected`: see `_decimalSeparatorExplicit`. */\n    protected _thousandSeparatorExplicit = false;\n    private _lastAutoPlaceholder: string | undefined;\n\n    public ngOnChanges(changes: SimpleChanges): void {\n        if (changes['locale'] && !changes['locale'].firstChange && this.locale()) {\n            this.currentLocale = this.locale()!;\n            this.updateSeparators();\n            this.setInputMode();\n        }\n        // Preserves an explicitly bound separator across later locale-driven recalculations\n        // (see `updateSeparators`): `changes['X']` is only present when the parent template\n        // actually binds that input (Angular never reports unbound inputs here, not even on\n        // the first change), so consumers who never touch these two keep today's locale-derived\n        // behavior. Checked by key presence alone — NOT the current value's truthiness, which\n        // would wrongly treat an intentional `[thousandSeparator]=\"''\"` (no grouping) as \"not\n        // explicit\" and let a later locale change silently restore grouping.\n        if (changes['decimalSeparator']) {\n            this._decimalSeparatorExplicit = true;\n        }\n        if (changes['thousandSeparator']) {\n            this._thousandSeparatorExplicit = true;\n        }\n        if (\n            changes['precision'] ||\n            changes['minDecimalPlaces'] ||\n            changes['maxDecimalPlaces'] ||\n            changes['decimalSeparator'] ||\n            changes['thousandSeparator']\n        ) {\n            this.calculateMaxLength();\n        }\n        if (changes['precision'] || changes['minDecimalPlaces'] || changes['decimalSeparator']) {\n            this.updatePlaceholder();\n        }\n    }\n\n    public ngOnInit(): void {\n        if (this.minDecimalPlaces() > this.maxDecimalPlaces()) {\n            throw new Error(\n                `NumericMaskDirective: minDecimalPlaces (${this.minDecimalPlaces()}) cannot be greater than maxDecimalPlaces (${this.maxDecimalPlaces()})`,\n            );\n        }\n\n        this.updatePlaceholder();\n\n        if (this.locale()) {\n            this.currentLocale = this.locale()!;\n            this.updateSeparators();\n            this.setInputMode();\n        } else if (this.localeService) {\n            this.localeService\n                .get()\n                .pipe(takeUntilDestroyed(this._destroyRef))\n                .subscribe(() => {\n                    this.currentLocale = this.localeService!.getLocaleOptions()?.locale || 'pt-BR';\n                    this.updateSeparators();\n                    this.setInputMode();\n                });\n        } else {\n            this.updateSeparators();\n            this.setInputMode();\n        }\n    }\n\n    /**\n     * Listener for input events (typing)\n     */\n    public onInput(event: Event): void {\n        const input = event.target as HTMLInputElement;\n        let value = input.value;\n        value = this.normalizeSeparators(value);\n        this.processInputValue(value);\n    }\n\n    /**\n     * Listener for focus events (gaining focus)\n     */\n    public onFocus(): void {\n        const input = this.elementRef.nativeElement;\n        const currentValue = input.value;\n\n        if (!currentValue || currentValue.trim() === '') {\n            return;\n        }\n\n        if (this.lastModelValue) {\n            const displayValue = this.lastModelValue.replace('.', this.decimalSeparator());\n            this.renderer.setProperty(input, 'value', displayValue);\n            input.select();\n            return;\n        }\n\n        const modelValue = this.toModelValue(currentValue);\n\n        if (!modelValue) {\n            return;\n        }\n\n        const displayValue = modelValue.replace('.', this.decimalSeparator());\n        this.renderer.setProperty(input, 'value', displayValue);\n        input.select();\n    }\n\n    /**\n     * Listener for blur events (focus loss)\n     */\n    public onBlur(): void {\n        this.onTouched();\n\n        const currentValue = this.elementRef.nativeElement.value;\n\n        if (!currentValue || currentValue.trim() === '') {\n            this.onChange(null);\n            this.lastModelValue = null;\n            return;\n        }\n\n        let modelValue = this.toModelValue(currentValue);\n\n        if (!modelValue) {\n            this.onChange(null);\n            this.lastModelValue = null;\n            return;\n        }\n\n        const roundingMode = this.decimalRoundingMode();\n        if (!this.blockDecimalOverflow() && roundingMode !== 'preserve') {\n            const rounded = this.truncateToDecimalPlaces(\n                new BigNumber(modelValue),\n                this.maxDecimalPlaces(),\n                this.resolveRoundingMode(roundingMode),\n            );\n            modelValue = rounded.toFixed();\n        }\n\n        this.lastModelValue = modelValue;\n        const displayValue = this.fromModelValue(modelValue);\n        this.renderer.setProperty(this.elementRef.nativeElement, 'value', displayValue);\n        this.onChange(modelValue);\n    }\n\n    /**\n     * Listener for paste events (clipboard). When `precision` is set and the pasted value would\n     * exceed it, the paste is rejected outright (nothing is written) and `pasteRejected` fires.\n     */\n    public onPaste(event: ClipboardEvent): void {\n        const pastedText = event.clipboardData?.getData('text') || '';\n        const precision = this.precision();\n\n        if (precision !== undefined && this.exceedsPrecision(pastedText, precision)) {\n            event.preventDefault();\n            this.pasteRejected.emit(pastedText);\n            return;\n        }\n\n        event.preventDefault();\n\n        let value = this.parseClipboardValue(pastedText);\n\n        this.processInputValue(value);\n    }\n\n    /**\n     * Whether a raw pasted string, once stripped of separators, has more significant digits\n     * than `precision` allows.\n     * @private\n     */\n    private exceedsPrecision(text: string, precision: number): boolean {\n        const thousandSep = this.thousandSeparator();\n        const numericText = text\n            .replace(new RegExp(this.escapeRegex(thousandSep), 'g'), '')\n            .replace(this.decimalSeparator(), '.');\n        const [intPart, decimalPart = ''] = numericText.split('.');\n        const totalDigits =\n            intPart.replace(/\\D/g, '').length + decimalPart.slice(0, this.maxDecimalPlaces()).length;\n        return totalDigits > precision;\n    }\n\n    /**\n     * Listener for special keys (+ and -)\n     */\n    public onKeyDown(event: KeyboardEvent): void {\n        const key = event.key;\n\n        if (key === '-' || key === '+') {\n            const input = this.elementRef.nativeElement;\n            const value = input.value;\n            const cursorPosition = input.selectionStart || 0;\n\n            if (key === '-' && this.allowScientificNotation()) {\n                const charBeforeCursor = value[cursorPosition - 1];\n                if (charBeforeCursor === 'e' || charBeforeCursor === 'E') {\n                    return;\n                }\n            }\n\n            event.preventDefault();\n            if (!this.allowNegative()) {\n                return;\n            }\n\n            this.toggleSign(value, key === '-');\n        }\n    }\n\n    /**\n     * Listener for keypress to block invalid characters\n     */\n    public onKeyPress(event: KeyboardEvent): void {\n        const key = event.key;\n        const input = this.elementRef.nativeElement;\n        const cursorPosition = input.selectionStart || 0;\n        const value = input.value;\n\n        if ((key === '-' || key === '+') && this.allowScientificNotation()) {\n            const charBeforeCursor = value[cursorPosition - 1];\n            if (charBeforeCursor === 'e' || charBeforeCursor === 'E') {\n                return;\n            }\n        }\n\n        if (key === '+' || key === '-') {\n            event.preventDefault();\n            return;\n        }\n\n        const isDigit = /^[0-9]$/.test(key);\n        const isDecimalSeparator = key === ',' || key === '.';\n        const isScientificNotation = (key === 'e' || key === 'E') && this.allowScientificNotation();\n        const isControlKey = event.ctrlKey || event.metaKey || event.altKey;\n        const isSpecialKey = [\n            'Backspace',\n            'Tab',\n            'Enter',\n            'Escape',\n            'ArrowLeft',\n            'ArrowRight',\n            'Delete',\n            'Home',\n            'End',\n        ].includes(key);\n\n        if (isScientificNotation) {\n            if (value.includes('e') || value.includes('E')) {\n                event.preventDefault();\n                return;\n            }\n\n            const charBeforeCursor = value[cursorPosition - 1];\n            if (!charBeforeCursor || !/^[0-9]$/.test(charBeforeCursor)) {\n                event.preventDefault();\n                return;\n            }\n        }\n\n        if (!isDigit && !isDecimalSeparator && !isScientificNotation && !isControlKey && !isSpecialKey) {\n            event.preventDefault();\n        }\n    }\n\n    /**\n     * Updates separators according to the locale. An explicitly bound `decimalSeparator`/\n     * `thousandSeparator` (tracked in `ngOnChanges`) is restored afterwards, so a locale\n     * change never silently overrides a value the consumer set on purpose.\n     */\n    protected updateSeparators(): void {\n        const explicitDecimal = this._decimalSeparatorExplicit ? this.decimalSeparator() : undefined;\n        const explicitThousand = this._thousandSeparatorExplicit ? this.thousandSeparator() : undefined;\n\n        const formatted = new Intl.NumberFormat(this.currentLocale).format(1234.5);\n        this.thousandSeparator.set(formatted[1]);\n        this.decimalSeparator.set(formatted[5]);\n\n        if (explicitDecimal !== undefined) {\n            this.decimalSeparator.set(explicitDecimal);\n        }\n        if (explicitThousand !== undefined) {\n            this.thousandSeparator.set(explicitThousand);\n        }\n\n        this.calculateMaxLength();\n        this.updatePlaceholder();\n    }\n\n    /**\n     * Auto-calculates the native `maxLength` from `precision`, sized for the current separators\n     * and `maxDecimalPlaces`. No-op (leaves `maxLength` unset) while `precision` is `undefined`.\n     * `protected`: subclasses that map their own deprecated inputs into `minDecimalPlaces`/\n     * `maxDecimalPlaces`/`thousandSeparator` outside of a tracked `changes` key call this directly.\n     */\n    protected calculateMaxLength(): void {\n        const precision = this.precision();\n        if (precision === undefined) {\n            this.maxLength = undefined;\n            return;\n        }\n\n        const scale = this.maxDecimalPlaces();\n        const decSepLength = this.decimalSeparator()?.length ?? 0;\n        const thoSepLength = this.thousandSeparator()?.length ?? 0;\n        const DIGITS_GROUP_SIZE = 3;\n\n        let maxLength = precision + (scale ? decSepLength : 0);\n        maxLength += Math.ceil((precision - scale) / DIGITS_GROUP_SIZE - 1) * thoSepLength;\n\n        this.maxLength = maxLength;\n    }\n\n    /**\n     * Auto-calculates `placeholder` (e.g. `0,00`) from `minDecimalPlaces`, without overwriting\n     * a value the consumer set explicitly. No-op while `precision` is `undefined`.\n     * `protected`: see `calculateMaxLength`.\n     */\n    protected updatePlaceholder(): void {\n        if (this.precision() === undefined) return;\n\n        const scale = this.minDecimalPlaces();\n        const autoPlaceholder = scale ? `0${this.decimalSeparator()}${''.padEnd(scale, '0')}` : '0';\n\n        if (this.placeholder() === undefined || this.placeholder() === this._lastAutoPlaceholder) {\n            this.placeholder.set(autoPlaceholder);\n        }\n\n        this._lastAutoPlaceholder = autoPlaceholder;\n    }\n\n    /**\n     * Processes input value and updates the input and model\n     * @private\n     */\n    private processInputValue(value: string): void {\n        if (!this.decimalSeparator() || !this.thousandSeparator()) {\n            this.updateSeparators();\n        }\n\n        if (this.blockDecimalOverflow()) {\n            value = this.applyBlockLimit(value);\n        }\n\n        this.renderer.setProperty(this.elementRef.nativeElement, 'value', value);\n\n        const modelValue = this.toModelValue(value);\n\n        // During typing, clear the stored model value so onFocus will recalculate\n        this.lastModelValue = null;\n\n        this.onChange(modelValue);\n    }\n\n    /**\n     * Sets inputmode for numeric keyboard on mobile devices\n     * @private\n     */\n    private setInputMode(): void {\n        this.renderer.setAttribute(this.elementRef.nativeElement, 'inputmode', 'decimal');\n        this.renderer.setAttribute(this.elementRef.nativeElement, 'autocomplete', 'off');\n    }\n\n    /**\n     * Removes separators from a formatted value\n     * @private\n     */\n    private removeSeparators(value: string): string {\n        if (!this.thousandSeparator()) {\n            return value;\n        }\n\n        const thousandRegex = new RegExp(this.escapeRegex(this.thousandSeparator()), 'g');\n\n        return value.replace(thousandRegex, '');\n    }\n\n    /**\n     * Strips unnecessary trailing zeros from decimal part\n     * @private\n     */\n    private stripTrailingZeros(value: string): string {\n        const parts = value.split(this.decimalSeparator());\n        if (parts.length === 2) {\n            const decimalPart = parts[1].replace(/0+$/, '');\n            return decimalPart.length > 0 ? parts[0] + this.decimalSeparator() + decimalPart : parts[0];\n        }\n        return value;\n    }\n\n    /**\n     * Normalizes separators during typing\n     * @private\n     */\n    private normalizeSeparators(value: string): string {\n        value = this.removeSeparators(value);\n\n        if (this.decimalSeparator() === ',') {\n            value = value.replace(/\\./g, ',');\n        } else if (this.decimalSeparator() === '.') {\n            value = value.replace(/,/g, '.');\n        }\n\n        const parts = value.split(this.decimalSeparator());\n        if (parts.length > 2) {\n            value = parts[0] + this.decimalSeparator() + parts.slice(1).join('');\n        }\n\n        return value;\n    }\n\n    /**\n     * Escapes special characters for use in regex\n     * @private\n     */\n    private escapeRegex(str: string): string {\n        return str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n    }\n\n    /**\n     * Truncates (or rounds, depending on roundingMode) a number to the specified decimal places\n     * @private\n     */\n    private truncateToDecimalPlaces(\n        bigNumber: BigNumber,\n        decimalPlaces: number,\n        roundingMode: BigNumber.RoundingMode = BigNumber.ROUND_DOWN,\n    ): BigNumber {\n        if (decimalPlaces < 0) {\n            return bigNumber;\n        }\n        const multiplier = new BigNumber(10).pow(decimalPlaces);\n        return bigNumber.multipliedBy(multiplier).integerValue(roundingMode).dividedBy(multiplier);\n    }\n\n    /**\n     * Maps decimalRoundingMode to the corresponding BigNumber rounding mode\n     * @private\n     */\n    private resolveRoundingMode(mode: 'truncate' | 'roundUp' | 'roundDown'): BigNumber.RoundingMode {\n        if (mode === 'roundUp') {\n            return BigNumber.ROUND_CEIL;\n        }\n        if (mode === 'roundDown') {\n            return BigNumber.ROUND_FLOOR;\n        }\n        return BigNumber.ROUND_DOWN;\n    }\n\n    /**\n     * Limits the decimal part of a value being typed/pasted to maxDecimalPlaces,\n     * preserving any scientific notation exponent untouched\n     * @private\n     */\n    private applyBlockLimit(value: string): string {\n        const maxDecimals = this.maxDecimalPlaces();\n        const eIndex = value.search(/[eE]/);\n        const mantissa = eIndex >= 0 ? value.slice(0, eIndex) : value;\n        const exponent = eIndex >= 0 ? value.slice(eIndex) : '';\n\n        const sepIndex = mantissa.indexOf(this.decimalSeparator());\n        if (sepIndex === -1) {\n            return value;\n        }\n\n        if (maxDecimals === 0) {\n            return mantissa.slice(0, sepIndex) + exponent;\n        }\n\n        return mantissa.slice(0, sepIndex + 1 + maxDecimals) + exponent;\n    }\n\n    /**\n     * Parses a string value to its numeric representation, handling separators and sign\n     * Returns BigNumber to preserve full precision and optional number conversion\n     * @private\n     */\n    private parseStringToValue(value: string): { bigNumber: BigNumber; numeric: number; isNegative: boolean } {\n        const isNegative = value.startsWith('-');\n        let numericStr = value.replace(/^-/, '');\n\n        // Guarded: an empty thousandSeparator (e.g. \"no grouping\") must not reach `new RegExp`,\n        // since a bare escaped-empty pattern (`new RegExp('\\\\' + '')`) throws\n        // \"Invalid regular expression: \\ at end of pattern\".\n        const thousandSep = this.thousandSeparator();\n        if (thousandSep) {\n            numericStr = numericStr.replace(new RegExp(this.escapeRegex(thousandSep), 'g'), '');\n        }\n        const decimalSep = this.decimalSeparator();\n        if (decimalSep) {\n            numericStr = numericStr.replace(new RegExp(this.escapeRegex(decimalSep), 'g'), '.');\n        }\n\n        if (numericStr === '.' || numericStr === '') {\n            numericStr = '0';\n        } else if (numericStr.startsWith('.')) {\n            numericStr = '0' + numericStr;\n        }\n\n        let bigNumber = new BigNumber(numericStr);\n        if (bigNumber.isNaN()) {\n            bigNumber = new BigNumber(0);\n        }\n\n        if (isNegative && this.allowNegative()) {\n            bigNumber = bigNumber.negated();\n        }\n\n        return { bigNumber, numeric: bigNumber.toNumber(), isNegative };\n    }\n\n    /**\n     * Groups an integer digit string (optionally signed) using `thousandSeparator`.\n     *\n     * Previously this used `Intl.NumberFormat(currentLocale)` and then tried to strip the\n     * locale's own grouping via `.split(decimalSeparator())`, which (a) ignored a custom\n     * `thousandSeparator` entirely — always falling back to the locale's own grouping\n     * character instead, e.g. `thousandSeparator=\"\"` had no effect — and (b) corrupted the\n     * result whenever the locale's grouping character happened to equal `decimalSeparator`\n     * (e.g. a custom `decimalSeparator=\".\"` under `pt-BR`, which groups thousands with `.`\n     * too): `\"1.234\".split('.')[0]` returned `\"1\"` instead of `\"1234\"`. Grouping the digits\n     * directly with the directive's own (already locale/explicit-resolved) `thousandSeparator`\n     * avoids the detour through `Intl.NumberFormat` and both bugs.\n     * @private\n     */\n    private groupIntegerDigits(integerPart: string): string {\n        const numericValue = parseInt(integerPart, 10) || 0;\n        const isNegative = numericValue < 0;\n        const digits = Math.abs(numericValue).toString();\n        const sep = this.thousandSeparator();\n        const grouped = sep ? digits.replace(/\\B(?=(\\d{3})+(?!\\d))/g, sep) : digits;\n        return isNegative ? `-${grouped}` : grouped;\n    }\n\n    /**\n     * Formats a numeric value according to the locale\n     * Truncates (never rounds) to maxDecimalPlaces and pads with zeros to minDecimalPlaces\n     * @private\n     */\n    private formatNumeric(numeric: number | BigNumber): string {\n        let bigNumeric = numeric instanceof BigNumber ? numeric : new BigNumber(numeric);\n\n        const truncatedValue = this.truncateToDecimalPlaces(bigNumeric, this.maxDecimalPlaces());\n\n        const valueStr = truncatedValue.toFixed(Math.max(this.minDecimalPlaces(), this.maxDecimalPlaces()));\n\n        let formattedValue = valueStr.replace('.', this.decimalSeparator());\n\n        const parts = formattedValue.split(this.decimalSeparator());\n        const integerPart = parts[0];\n        let decimalPart = parts[1] || '';\n\n        const formattedInteger = this.groupIntegerDigits(integerPart);\n\n        const effectiveDecimalPlaces = decimalPart.replace(/0+$/, '').length;\n\n        const decimalPlacesToShow = Math.max(\n            this.minDecimalPlaces(),\n            Math.min(effectiveDecimalPlaces, this.maxDecimalPlaces()),\n        );\n\n        decimalPart = decimalPart.substring(0, decimalPlacesToShow).padEnd(decimalPlacesToShow, '0');\n\n        return decimalPart ? formattedInteger + this.decimalSeparator() + decimalPart : formattedInteger;\n    }\n\n    /**\n     * Converts the formatted value to the model format (international standard string)\n     * Always returns decimal notation, never scientific notation\n     * Stores the full precision value without truncation\n     * @private\n     */\n    private toModelValue(formattedValue: string): string | null {\n        if (!formattedValue || formattedValue.trim() === '') {\n            return null;\n        }\n        const { bigNumber } = this.parseStringToValue(formattedValue);\n        return bigNumber.toFixed();\n    }\n\n    /**\n     * Converts the model value to display format\n     * @private\n     */\n    private fromModelValue(modelValue: string | number | null): string {\n        if (modelValue === null || modelValue === undefined || modelValue === '') {\n            return '';\n        }\n        const bigNumber = new BigNumber(modelValue);\n        if (bigNumber.isNaN()) {\n            return '';\n        }\n        return this.formatNumeric(bigNumber);\n    }\n\n    /**\n     * Processes pasted value from clipboard\n     * Converts scientific notation to decimal using BigNumber\n     * @private\n     */\n    private parseClipboardValue(text: string): string {\n        if (this.allowScientificNotation() && /[eE]/.test(text)) {\n            try {\n                const bigNumeric = new BigNumber(text);\n                if (!bigNumeric.isNaN()) {\n                    return bigNumeric.toFixed().replace('.', this.decimalSeparator());\n                }\n            } catch {\n                void 0;\n            }\n        }\n        return this.normalizeSeparators(text);\n    }\n\n    /**\n     * Toggles the sign (- or +) of a value\n     * @private\n     */\n    private toggleSign(value: string, makeNegative: boolean): void {\n        const input = this.elementRef.nativeElement;\n        let newValue = value;\n\n        if (makeNegative && !newValue.startsWith('-')) {\n            newValue = '-' + newValue;\n        } else if (!makeNegative && newValue.startsWith('-')) {\n            newValue = newValue.substring(1);\n        } else {\n            return;\n        }\n\n        this.renderer.setProperty(input, 'value', newValue);\n        const modelValue = this.toModelValue(newValue);\n        this.lastModelValue = null;\n        this.onChange(modelValue);\n    }\n\n    public writeValue(value: string | number | null): void {\n        if (!this.decimalSeparator() || !this.thousandSeparator()) {\n            this.updateSeparators();\n        }\n        const hasFocus = document.activeElement === this.elementRef.nativeElement;\n        if (hasFocus) {\n            const formattedValue = this.fromModelValue(value);\n            const rawValue = this.stripTrailingZeros(this.removeSeparators(formattedValue));\n            this.renderer.setProperty(this.elementRef.nativeElement, 'value', rawValue);\n        } else {\n            const formattedValue = this.fromModelValue(value);\n            this.renderer.setProperty(this.elementRef.nativeElement, 'value', formattedValue);\n        }\n    }\n\n    public registerOnChange(fn: (value: string | null) => void): void {\n        this.onChange = fn;\n    }\n\n    public registerOnTouched(fn: () => void): void {\n        this.onTouched = fn;\n    }\n\n    public setDisabledState(isDisabled: boolean): void {\n        this.renderer.setProperty(this.elementRef.nativeElement, 'disabled', isDisabled);\n    }\n\n    public validate(control: AbstractControl): ValidationErrors | null {\n        const controlValue: string | number | null | undefined = control.value;\n\n        if (!controlValue) {\n            return null;\n        }\n\n        // The model may be set programmatically as a `number` (e.g. `patchValue` with a backend DTO),\n        // even though the value this directive emits is always a decimal `string`.\n        const value = String(controlValue);\n        const numericValue = parseFloat(value);\n\n        if (isNaN(numericValue)) {\n            return null;\n        }\n\n        if (!this.allowNegative() && numericValue < 0) {\n            return { negativeNotAllowed: true };\n        }\n\n        const minValue = this.min();\n        if (minValue !== undefined && numericValue < minValue) {\n            return {\n                min: {\n                    min: minValue,\n                    actual: numericValue,\n                },\n            };\n        }\n\n        const maxValue = this.max();\n        if (maxValue !== undefined && numericValue > maxValue) {\n            return {\n                max: {\n                    max: maxValue,\n                    actual: numericValue,\n                },\n            };\n        }\n\n        const decimalPart = value.split('.')[1];\n\n        if (decimalPart && decimalPart.length > this.maxDecimalPlaces()) {\n            return {\n                excessiveDecimalPlaces: {\n                    max: this.maxDecimalPlaces(),\n                    actual: decimalPart.length,\n                },\n            };\n        }\n\n        const precision = this.precision();\n        if (precision !== undefined) {\n            const numericStr = String(value).replace('-', '');\n            const [intPart, decPart = ''] = numericStr.split('.');\n            const totalDigits = intPart.length + decPart.length;\n\n            if (totalDigits > precision) {\n                return {\n                    exceedsPrecision: {\n                        precision,\n                        actual: totalDigits,\n                    },\n                };\n            }\n        }\n\n        return null;\n    }\n}\n\n","import { NgModule } from '@angular/core';\n\nimport { NumericMaskDirective } from './numeric-mask.directive';\n\n/**\n * @deprecated Será removido na v20. Importe diretamente o standalone `NumericMaskDirective` (de\n * `@seniorsistemas/angular-components/numeric-mask`) no lugar deste módulo.\n *\n * Migração automática (também executada pelo `ng update` na v20):\n * `ng generate @seniorsistemas/angular-components:migrate-modules-to-standalone`\n */\n@NgModule({\n    imports: [NumericMaskDirective],\n    exports: [NumericMaskDirective],\n})\nexport class CurrencyMaskModule {}\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AA2BA;;;;;;;;;;;;;;;;;;;;AAoBG;MA4BU,oBAAoB,CAAA;AAC7B;;;AAGG;AACI,IAAA,MAAM,GAAG,KAAK,CAAqB,SAAS,CAAC,CAAC;AAErD;;;AAGG;AACI,IAAA,gBAAgB,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AAEnC;;;AAGG;AACI,IAAA,gBAAgB,GAAG,KAAK,CAAC,EAAE,CAA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