{"version":3,"sources":["../src/number/index.ts","../src/number/number-format.tsx","../src/number/format-number.ts","../src/number/parse-number.ts","../src/utils/input.ts","../src/number/validate.ts","../src/number/use-number-format.ts","../src/set-native-value.ts"],"sourcesContent":["export { NumberFormat } from \"./number-format\";\nexport type { NumberFormatProps } from \"./number-format\";\nexport { useNumberFormat } from \"./use-number-format\";\nexport type { UseNumberFormatOptions } from \"./use-number-format\";\nexport { formatNumber } from \"./format-number\";\nexport { parseNumber } from \"./parse-number\";\nexport type { NumberFormatOptions, NumberFormatValues } from \"./types\";\n","import React, { forwardRef, useLayoutEffect, useReducer, useRef } from \"react\";\nimport type { NumberFormatOptions, NumberFormatValues } from \"./types\";\nimport { formatNumber } from \"./format-number\";\nimport { parseNumber, digitsBeforeCaret, resolveCaret } from \"./parse-number\";\nimport { isInputFocused, setInputSelection } from \"../utils/input\";\nimport { warnOnSeparatorCollision } from \"./validate\";\n\nexport interface NumberFormatProps\n  extends NumberFormatOptions,\n    Omit<React.InputHTMLAttributes<HTMLInputElement>, \"value\" | \"onChange\" | \"prefix\"> {\n  value?: string | number;\n  onValueChange?: (values: NumberFormatValues) => void;\n  isAllowed?: (values: NumberFormatValues) => boolean;\n}\n\nexport const NumberFormat = forwardRef<HTMLInputElement, NumberFormatProps>(function NumberFormat(\n  props,\n  forwardedRef\n) {\n  const {\n    value = \"\",\n    onValueChange,\n    isAllowed,\n    thousandSeparator,\n    decimalSeparator,\n    decimalScale,\n    fixedDecimalScale,\n    prefix,\n    suffix,\n    allowNegative,\n    allowLeadingZeros,\n    ...domProps\n  } = props;\n\n  const options: NumberFormatOptions = {\n    thousandSeparator,\n    decimalSeparator,\n    decimalScale,\n    fixedDecimalScale,\n    prefix,\n    suffix,\n    allowNegative,\n    allowLeadingZeros\n  };\n\n  warnOnSeparatorCollision(options);\n\n  const innerRef = useRef<HTMLInputElement | null>(null);\n  const caretRef = useRef<number | null>(null);\n  const lastFormattedRef = useRef<string>(\"\");\n  const lastValuesRef = useRef<NumberFormatValues | null>(null);\n\n  // A controlled parent may call onValueChange with a floatValue that is\n  // Object.is-equal to its current state (e.g. typing \"12.\" after \"12\" still\n  // parses to 12). React then bails out of re-rendering that parent's\n  // subtree entirely — our component never re-renders — and its own\n  // controlled-input restoration afterwards resets the DOM's raw value back\n  // to the last-committed prop, destroying the in-progress edit before our\n  // `formatted` derivation above ever gets a chance to run. Forcing our OWN\n  // render here (independent of whatever the parent decides) guarantees a\n  // real commit happens with the preserved `formatted` string, so the DOM\n  // node's committed value is updated and nothing gets restored away.\n  const [, forceUpdate] = useReducer((n: number) => n + 1, 0);\n\n  // Controlled display: normally derive the shown string from the `value` prop.\n  // BUT when the prop is numerically equal to the values we last emitted via\n  // onValueChange (the consumer echoing back e.g. floatValue), keep the exact\n  // in-progress formatted string — otherwise a trailing decimal separator or\n  // trailing zeros the user is mid-typing get destroyed by the lossy number\n  // round-trip (e.g. \"12.\" -> 12 -> \"12\", eating the \".\").\n  const propFloatValue =\n    typeof value === \"number\"\n      ? value\n      : parseNumber(String(value ?? \"\"), options).floatValue;\n  const formatted =\n    lastValuesRef.current !== null && propFloatValue === lastValuesRef.current.floatValue\n      ? lastValuesRef.current.formattedValue\n      : formatNumber(value ?? \"\", options);\n  lastFormattedRef.current = formatted;\n\n  function handleChange(event: React.ChangeEvent<HTMLInputElement>): void {\n    const el = event.target;\n    const caret = el.selectionStart ?? el.value.length;\n    const digits = digitsBeforeCaret(el.value, caret);\n    const values = parseNumber(el.value, options);\n\n    if (isAllowed && !isAllowed(values)) {\n      // Revert: restore the previous formatted value AND put the caret back where\n      // it was BEFORE the rejected keystroke. Derive that from how many chars the\n      // rejected edit added, not from caretRef (which the layout effect has already\n      // nulled by the time the next keystroke fires — that made it always fall back\n      // to end-of-string and jump the caret on mid-string edits).\n      const typedCaret = el.selectionStart ?? el.value.length;\n      const lengthDelta = el.value.length - lastFormattedRef.current.length;\n      const revertCaret = Math.max(0, typedCaret - lengthDelta);\n      el.value = lastFormattedRef.current;\n      if (isInputFocused(el)) setInputSelection(el, revertCaret, revertCaret);\n      return;\n    }\n\n    caretRef.current = resolveCaret(values, digits, options);\n    lastValuesRef.current = values;\n    forceUpdate();\n    onValueChange?.(values);\n  }\n\n  // After a controlled re-render, restore the caret we computed in onChange\n  // (React resets it to the end for controlled inputs).\n  useLayoutEffect(() => {\n    const el = innerRef.current;\n    if (el && caretRef.current !== null && isInputFocused(el)) {\n      setInputSelection(el, caretRef.current, caretRef.current);\n      caretRef.current = null;\n    }\n  });\n\n  function setRef(el: HTMLInputElement | null): void {\n    innerRef.current = el;\n    if (typeof forwardedRef === \"function\") forwardedRef(el);\n    else if (forwardedRef) (forwardedRef as React.MutableRefObject<HTMLInputElement | null>).current = el;\n  }\n\n  return <input {...domProps} ref={setRef} value={formatted} onChange={handleChange} />;\n});\n\nNumberFormat.displayName = \"NumberFormat\";\n","import type { NumberFormatOptions } from \"./types\";\n\nexport interface NumberParts {\n  negative: boolean;\n  int: string;\n  frac: string;\n  hasSeparator: boolean;\n}\n\nexport function resolveSeparators(options: NumberFormatOptions): { thousand: string; decimal: string } {\n  const decimal = options.decimalSeparator ?? \".\";\n  let thousand = \"\";\n  if (options.thousandSeparator === true) thousand = \",\";\n  else if (typeof options.thousandSeparator === \"string\") thousand = options.thousandSeparator;\n  return { thousand, decimal };\n}\n\nfunction extract(raw: string, decimal: string, options: NumberFormatOptions): NumberParts {\n  const allowNegative = options.allowNegative ?? true;\n  const negative = allowNegative && raw.indexOf(\"-\") !== -1;\n\n  const sepIndex = decimal ? raw.indexOf(decimal) : -1;\n  const hasSeparator = sepIndex !== -1;\n  const intRaw = hasSeparator ? raw.slice(0, sepIndex) : raw;\n  const fracRaw = hasSeparator ? raw.slice(sepIndex + decimal.length) : \"\";\n\n  let int = intRaw.replace(/\\D/g, \"\");\n  let frac = fracRaw.replace(/\\D/g, \"\");\n\n  if (!(options.allowLeadingZeros ?? false)) {\n    int = int.replace(/^0+(?=\\d)/, \"\");\n  }\n  if (options.decimalScale !== undefined) {\n    frac = frac.slice(0, options.decimalScale);\n  }\n  return { negative, int, frac, hasSeparator };\n}\n\n// Tokenize a user-facing formatted string (strips prefix/suffix, uses opts separators).\nexport function tokenize(rawInput: string, options: NumberFormatOptions): NumberParts {\n  const { decimal } = resolveSeparators(options);\n  let s = rawInput;\n  if (options.prefix && s.startsWith(options.prefix)) s = s.slice(options.prefix.length);\n  if (options.suffix && s.endsWith(options.suffix)) s = s.slice(0, s.length - options.suffix.length);\n  return extract(s, decimal, options);\n}\n\n// Tokenize a canonical numeric string (from a JS number): always \".\" decimal, no affixes.\nfunction tokenizeCanonical(canonical: string, options: NumberFormatOptions): NumberParts {\n  return extract(canonical, \".\", options);\n}\n\nfunction group(int: string, thousand: string): string {\n  if (!thousand || int.length <= 3) return int;\n  return int.replace(/\\B(?=(\\d{3})+(?!\\d))/g, thousand);\n}\n\nexport function buildFormatted(parts: NumberParts, options: NumberFormatOptions): string {\n  const { thousand, decimal } = resolveSeparators(options);\n  const prefix = options.prefix ?? \"\";\n  const suffix = options.suffix ?? \"\";\n  const fixed = options.fixedDecimalScale ?? false;\n  const scale = options.decimalScale;\n\n  const hasFrac = parts.frac.length > 0;\n  const isEmpty = parts.int === \"\" && !hasFrac && !parts.hasSeparator;\n  if (isEmpty) {\n    return parts.negative ? `${prefix}-${suffix}` : \"\";\n  }\n\n  let intDisplay = parts.int;\n  if (intDisplay === \"\" && (hasFrac || parts.hasSeparator)) intDisplay = \"0\";\n\n  let body = group(intDisplay, thousand);\n\n  if (fixed && scale !== undefined && scale > 0) {\n    body += decimal + parts.frac.slice(0, scale).padEnd(scale, \"0\");\n  } else if (hasFrac) {\n    body += decimal + parts.frac;\n  } else if (parts.hasSeparator) {\n    body += decimal; // trailing separator while typing \"1.\"\n  }\n\n  return `${prefix}${parts.negative ? \"-\" : \"\"}${body}${suffix}`;\n}\n\nfunction numberToString(n: number): string {\n  if (!Number.isFinite(n)) return \"\";\n  const s = String(n);\n  if (s.indexOf(\"e\") === -1 && s.indexOf(\"E\") === -1) return s;\n  // Expand exponential notation (e.g. \"1e+21\", \"1e-7\") to a plain decimal string\n  // so tokenize() doesn't read the exponent's digits/\"-\" as value characters.\n  // Precision is bounded by JS's own float precision; this only guards extreme\n  // magnitudes reachable via a numeric value prop (typing never yields \"e\").\n  const sign = n < 0 ? \"-\" : \"\";\n  const abs = Math.abs(n);\n  // abs >= 1 with an exponent means a huge integer (>= 1e21, where every double\n  // is integer-valued); BigInt expands it without an exponent. toFixed alone\n  // fails here because it also switches to exponential notation at >= 1e21.\n  const expanded =\n    abs >= 1\n      ? BigInt(Math.trunc(abs)).toString()\n      : abs.toFixed(20).replace(/0+$/, \"\").replace(/\\.$/, \"\");\n  return sign + expanded;\n}\n\nexport function formatNumber(input: string | number, options: NumberFormatOptions): string {\n  const parts =\n    typeof input === \"number\"\n      ? tokenizeCanonical(numberToString(input), options)\n      : tokenize(input, options);\n  return buildFormatted(parts, options);\n}\n","import type { NumberFormatOptions, NumberFormatValues } from \"./types\";\nimport { tokenize, buildFormatted, resolveSeparators, type NumberParts } from \"./format-number\";\n\nfunction buildValue(parts: NumberParts): string {\n  const sign = parts.negative ? \"-\" : \"\";\n  let int = parts.int;\n  if (int === \"\" && (parts.frac !== \"\" || parts.hasSeparator)) int = \"0\";\n  let v = sign + int;\n  if (parts.frac !== \"\") v += \".\" + parts.frac;\n  else if (parts.hasSeparator) v += \".\";\n  return v;\n}\n\nexport function parseNumber(formatted: string, options: NumberFormatOptions): NumberFormatValues {\n  const parts = tokenize(formatted, options);\n  const value = buildValue(parts);\n  const formattedValue = buildFormatted(parts, options);\n\n  // No digit characters entered at all (e.g. \"\", \"-\", \".\", \"-.\") → no numeric value.\n  const hasNoDigits = parts.int === \"\" && parts.frac === \"\";\n  const parsed = parseFloat(value);\n  const floatValue = hasNoDigits || Number.isNaN(parsed) ? undefined : parsed;\n\n  return { value, formattedValue, floatValue };\n}\n\nexport function digitsBeforeCaret(value: string, caret: number): number {\n  let count = 0;\n  for (let i = 0; i < caret && i < value.length; i++) {\n    if (value[i] >= \"0\" && value[i] <= \"9\") count++;\n  }\n  return count;\n}\n\nexport function caretAfterReformat(nextFormatted: string, digitsBefore: number): number {\n  if (digitsBefore <= 0) {\n    // place caret before the first digit (after any prefix/sign)\n    const firstDigit = nextFormatted.search(/\\d/);\n    return firstDigit === -1 ? nextFormatted.length : firstDigit;\n  }\n  let seen = 0;\n  let i = 0;\n  for (; i < nextFormatted.length; i++) {\n    if (nextFormatted[i] >= \"0\" && nextFormatted[i] <= \"9\") {\n      seen++;\n      if (seen === digitsBefore) return i + 1;\n    }\n  }\n  return nextFormatted.length;\n}\n\nexport function resolveCaret(\n  values: NumberFormatValues,\n  digitsBefore: number,\n  options: NumberFormatOptions\n): number {\n  const caret = caretAfterReformat(values.formattedValue, digitsBefore);\n  // caretAfterReformat is digit-anchored and can't see a just-typed trailing\n  // decimal separator with no fraction digit yet (e.g. \"1,234.\" right after\n  // the \".\" is typed) — it lands the caret BEFORE that separator. Step past it\n  // so the next keystroke goes into the fraction rather than ahead of the \".\".\n  if (values.value.endsWith(\".\")) {\n    const { decimal } = resolveSeparators(options);\n    if (decimal && values.formattedValue.slice(caret, caret + decimal.length) === decimal) {\n      return caret + decimal.length;\n    }\n  }\n  return caret;\n}\n","import type { Selection } from \"../types\";\n\nexport function setInputSelection(\n  input: HTMLInputElement,\n  start: number,\n  end?: number\n): void {\n  if (end === undefined) {\n    end = start;\n  }\n  input.setSelectionRange(start, end);\n}\n\nexport function getInputSelection(input: HTMLInputElement): Required<Selection> {\n  const start = input.selectionStart;\n  const end = input.selectionEnd;\n\n  return {\n    start,\n    end,\n    length: (end ?? 0) - (start ?? 0)\n  };\n}\n\nexport function isInputFocused(input: HTMLInputElement): boolean {\n  const inputDocument = input.ownerDocument;\n  return inputDocument.hasFocus() && inputDocument.activeElement === input;\n}\n","import type { NumberFormatOptions } from \"./types\";\nimport { resolveSeparators } from \"./format-number\";\n\nconst warned = new Set<string>();\n\n// Dev-only guard: thousandSeparator and decimalSeparator must differ, or the\n// value cannot be parsed correctly. Mirrors src/validate-props.ts's style.\nexport function warnOnSeparatorCollision(options: NumberFormatOptions): void {\n  if (process.env.NODE_ENV === \"production\") return;\n  const { thousand, decimal } = resolveSeparators(options);\n  if (thousand && thousand === decimal) {\n    if (warned.has(thousand)) return;\n    warned.add(thousand);\n    console.error(\n      `react-input-mask-format: thousandSeparator and decimalSeparator must differ (both are \"${thousand}\"). The value will not parse correctly.`\n    );\n  }\n}\n","import { useRef, useCallback } from \"react\";\nimport type React from \"react\";\nimport type { NumberFormatOptions, NumberFormatValues } from \"./types\";\nimport { formatNumber } from \"./format-number\";\nimport { parseNumber, digitsBeforeCaret, resolveCaret } from \"./parse-number\";\nimport { setNativeValue } from \"../set-native-value\";\nimport { isInputFocused, setInputSelection } from \"../utils/input\";\nimport { warnOnSeparatorCollision } from \"./validate\";\n\nexport interface UseNumberFormatOptions extends NumberFormatOptions {\n  onValueChange?: (values: NumberFormatValues) => void;\n}\n\nconst IS_JSDOM =\n  typeof navigator !== \"undefined\" && navigator.userAgent.includes(\"jsdom\");\n\nexport function useNumberFormat(\n  options: UseNumberFormatOptions\n): React.RefCallback<HTMLInputElement> {\n  warnOnSeparatorCollision(options);\n\n  const optionsRef = useRef(options);\n  optionsRef.current = options;\n\n  const inputRef = useRef<HTMLInputElement | null>(null);\n  const handlerRef = useRef<((event: Event) => void) | null>(null);\n\n  return useCallback((el: HTMLInputElement | null) => {\n    if (el) {\n      const handler = (): void => {\n        const opts = optionsRef.current;\n        const caret = el.selectionStart ?? el.value.length;\n        const digits = digitsBeforeCaret(el.value, caret);\n        const values = parseNumber(el.value, opts);\n        setNativeValue(el, values.formattedValue);\n        if (isInputFocused(el)) {\n          const next = resolveCaret(values, digits, opts);\n          setInputSelection(el, next, next);\n        }\n        // JSDOM-ONLY: resync @testing-library/user-event v14's shadow-value cache.\n        // setNativeValue above bypasses React's value tracker; under jsdom that\n        // leaves user-event's per-input shadow value stale, corrupting masking from\n        // ~the 4th keystroke. A plain (idempotent) reassignment resyncs it.\n        // MUST NOT run in a real browser: there, microtasks drain BETWEEN event\n        // listeners, so this write would fight React; real browsers read the live\n        // DOM and need no resync. onValueChange (below) is called directly, not via\n        // React's tracker, so it is unaffected in either environment.\n        if (IS_JSDOM) {\n          queueMicrotask(() => {\n            if (el.value !== values.formattedValue) return;\n            el.value = values.formattedValue;\n            if (isInputFocused(el)) {\n              const c = resolveCaret(values, digits, opts);\n              setInputSelection(el, c, c);\n            }\n          });\n        }\n        opts.onValueChange?.(values);\n      };\n      el.addEventListener(\"input\", handler);\n      handlerRef.current = handler;\n      inputRef.current = el;\n      // format any initial (defaultValue) content\n      if (el.value) {\n        setNativeValue(el, formatNumber(el.value, optionsRef.current));\n      }\n    } else {\n      if (inputRef.current && handlerRef.current) {\n        inputRef.current.removeEventListener(\"input\", handlerRef.current);\n      }\n      inputRef.current = null;\n      handlerRef.current = null;\n    }\n  }, []);\n}\n","// Write to input.value through the native prototype setter so React's\n// internal value tracker stays stale. The user's keystroke `input` event then\n// bubbles into React's root listener, which sees masked value != stale tracker\n// and fires the consumer's onChange with the masked value. Using the tracked\n// (React-wrapped) setter instead would suppress that onChange.\nexport function setNativeValue(input: HTMLInputElement, value: string): void {\n  const descriptor = Object.getOwnPropertyDescriptor(\n    HTMLInputElement.prototype,\n    \"value\"\n  );\n  const setter = descriptor && descriptor.set;\n  if (setter) {\n    setter.call(input, value);\n  } else {\n    input.value = value;\n  }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAuE;;;ACShE,SAAS,kBAAkB,SAAqE;AATvG;AAUE,QAAM,WAAU,aAAQ,qBAAR,YAA4B;AAC5C,MAAI,WAAW;AACf,MAAI,QAAQ,sBAAsB,KAAM,YAAW;AAAA,WAC1C,OAAO,QAAQ,sBAAsB,SAAU,YAAW,QAAQ;AAC3E,SAAO,EAAE,UA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