import { a as $458b0a5536c1a7cf$export$40bfa8c7b0832715, e as $03deb23ff14920c4$export$4eaf04e54aa8eed6, n as $a1ea59d68270f0dd$export$f8168d8dd8fd66e6, M as $c87311424ea30a05$export$186c6964ca17d99, s as $c87311424ea30a05$export$a11b0059900ceec8, b as $c87311424ea30a05$export$fedb369cb70207f1 } from "./useHover-LmGemtHE.js";
import { a as $9446cca9a3875146$export$cb6e0bb50bc19463, $ as $9446cca9a3875146$export$7d15b64cf5a3a4c4 } from "./number-7sOvrqo0.js";
import { $ as $e5be200c675c3b3a$export$fc1a364ae1f3ff10, b as $e5be200c675c3b3a$export$a763b9476acd3eb } from "./useFormValidation-CUtZcedF.js";
import { $ as $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5 } from "./NumberFormatter-DA8u1Ot7.js";
import { useCallback, useEffect, useRef, useState, useMemo } from "react";
import { e as $8ae05eaa5c114e9c$export$7f54fc3180508a52, b as $3ef42575df84b30b$export$9d1611c77c2fe928, d as $bdb11010cef70236$export$f680877a34711e37, p as $ff5963eb1fccf552$export$e08e3b67e392101e } from "./utils-cvK1vxO7.js";
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-D2C6R0DK.js";
import { $ as $99facab73266f662$export$5add1d006293d136 } from "./useFormReset-yV9VVy9R.js";
import { $ as $9ab94262bd0047c7$export$420e68273165f4ec } from "./useFocusRing-CUxgjvAY.js";
import { $ as $e9faafb641e167db$export$90fc3a17d93f704c } from "./useEvent-BifIGnVS.js";
import { d as $2d73ec29415bd339$export$712718f7aec83d5 } from "./Input-ChJaTNa5.js";
import { $ as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "./useLocalizedStringFormatter-eaZiN2tE.js";
import { $ as $a916eb452884faea$export$b7a616150fdb9f44 } from "./useNumberFormatter-BCmkV-7c.js";
import { d as $319e236875307eab$export$d10ae4f68404609a, c as $319e236875307eab$export$a9b970dcc4ae71a9 } from "./Button-npzfSoYo.js";
const $6c7bd7858deea686$var$CURRENCY_SIGN_REGEX = new RegExp("^.*\\(.*\\).*$");
const $6c7bd7858deea686$var$NUMBERING_SYSTEMS = [
  "latn",
  "arab",
  "hanidec",
  "deva",
  "beng",
  "fullwide"
];
class $6c7bd7858deea686$export$cd11ab140839f11d {
  /**
  * Parses the given string to a number. Returns NaN if a valid number could not be parsed.
  */
  parse(value) {
    return $6c7bd7858deea686$var$getNumberParserImpl(this.locale, this.options, value).parse(value);
  }
  /**
  * Returns whether the given string could potentially be a valid number. This should be used to
  * validate user input as the user types. If a `minValue` or `maxValue` is provided, the validity
  * of the minus/plus sign characters can be checked.
  */
  isValidPartialNumber(value, minValue, maxValue) {
    return $6c7bd7858deea686$var$getNumberParserImpl(this.locale, this.options, value).isValidPartialNumber(value, minValue, maxValue);
  }
  /**
  * Returns a numbering system for which the given string is valid in the current locale.
  * If no numbering system could be detected, the default numbering system for the current
  * locale is returned.
  */
  getNumberingSystem(value) {
    return $6c7bd7858deea686$var$getNumberParserImpl(this.locale, this.options, value).options.numberingSystem;
  }
  constructor(locale, options = {}) {
    this.locale = locale;
    this.options = options;
  }
}
const $6c7bd7858deea686$var$numberParserCache = /* @__PURE__ */ new Map();
function $6c7bd7858deea686$var$getNumberParserImpl(locale, options, value) {
  let defaultParser = $6c7bd7858deea686$var$getCachedNumberParser(locale, options);
  if (!locale.includes("-nu-") && !defaultParser.isValidPartialNumber(value)) {
    for (let numberingSystem of $6c7bd7858deea686$var$NUMBERING_SYSTEMS) if (numberingSystem !== defaultParser.options.numberingSystem) {
      let parser = $6c7bd7858deea686$var$getCachedNumberParser(locale + (locale.includes("-u-") ? "-nu-" : "-u-nu-") + numberingSystem, options);
      if (parser.isValidPartialNumber(value)) return parser;
    }
  }
  return defaultParser;
}
function $6c7bd7858deea686$var$getCachedNumberParser(locale, options) {
  let cacheKey = locale + (options ? Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join() : "");
  let parser = $6c7bd7858deea686$var$numberParserCache.get(cacheKey);
  if (!parser) {
    parser = new $6c7bd7858deea686$var$NumberParserImpl(locale, options);
    $6c7bd7858deea686$var$numberParserCache.set(cacheKey, parser);
  }
  return parser;
}
class $6c7bd7858deea686$var$NumberParserImpl {
  parse(value) {
    let fullySanitizedValue = this.sanitize(value);
    if (this.symbols.group)
      fullySanitizedValue = $6c7bd7858deea686$var$replaceAll(fullySanitizedValue, this.symbols.group, "");
    if (this.symbols.decimal) fullySanitizedValue = fullySanitizedValue.replace(this.symbols.decimal, ".");
    if (this.symbols.minusSign) fullySanitizedValue = fullySanitizedValue.replace(this.symbols.minusSign, "-");
    fullySanitizedValue = fullySanitizedValue.replace(this.symbols.numeral, this.symbols.index);
    if (this.options.style === "percent") {
      let isNegative = fullySanitizedValue.indexOf("-");
      fullySanitizedValue = fullySanitizedValue.replace("-", "");
      fullySanitizedValue = fullySanitizedValue.replace("+", "");
      let index = fullySanitizedValue.indexOf(".");
      if (index === -1) index = fullySanitizedValue.length;
      fullySanitizedValue = fullySanitizedValue.replace(".", "");
      if (index - 2 === 0) fullySanitizedValue = `0.${fullySanitizedValue}`;
      else if (index - 2 === -1) fullySanitizedValue = `0.0${fullySanitizedValue}`;
      else if (index - 2 === -2) fullySanitizedValue = "0.00";
      else fullySanitizedValue = `${fullySanitizedValue.slice(0, index - 2)}.${fullySanitizedValue.slice(index - 2)}`;
      if (isNegative > -1) fullySanitizedValue = `-${fullySanitizedValue}`;
    }
    let newValue = fullySanitizedValue ? +fullySanitizedValue : NaN;
    if (isNaN(newValue)) return NaN;
    if (this.options.style === "percent") {
      var _this_options_minimumFractionDigits, _this_options_maximumFractionDigits;
      let options = {
        ...this.options,
        style: "decimal",
        minimumFractionDigits: Math.min(((_this_options_minimumFractionDigits = this.options.minimumFractionDigits) !== null && _this_options_minimumFractionDigits !== void 0 ? _this_options_minimumFractionDigits : 0) + 2, 20),
        maximumFractionDigits: Math.min(((_this_options_maximumFractionDigits = this.options.maximumFractionDigits) !== null && _this_options_maximumFractionDigits !== void 0 ? _this_options_maximumFractionDigits : 0) + 2, 20)
      };
      return new $6c7bd7858deea686$export$cd11ab140839f11d(this.locale, options).parse(new $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5(this.locale, options).format(newValue));
    }
    if (this.options.currencySign === "accounting" && $6c7bd7858deea686$var$CURRENCY_SIGN_REGEX.test(value)) newValue = -1 * newValue;
    return newValue;
  }
  sanitize(value) {
    value = value.replace(this.symbols.literals, "");
    if (this.symbols.minusSign) value = value.replace("-", this.symbols.minusSign);
    if (this.options.numberingSystem === "arab") {
      if (this.symbols.decimal) {
        value = value.replace(",", this.symbols.decimal);
        value = value.replace(String.fromCharCode(1548), this.symbols.decimal);
      }
      if (this.symbols.group) value = $6c7bd7858deea686$var$replaceAll(value, ".", this.symbols.group);
    }
    if (this.symbols.group === "’" && value.includes("'")) value = $6c7bd7858deea686$var$replaceAll(value, "'", this.symbols.group);
    if (this.options.locale === "fr-FR" && this.symbols.group) {
      value = $6c7bd7858deea686$var$replaceAll(value, " ", this.symbols.group);
      value = $6c7bd7858deea686$var$replaceAll(value, /\u00A0/g, this.symbols.group);
    }
    return value;
  }
  isValidPartialNumber(value, minValue = -Infinity, maxValue = Infinity) {
    value = this.sanitize(value);
    if (this.symbols.minusSign && value.startsWith(this.symbols.minusSign) && minValue < 0) value = value.slice(this.symbols.minusSign.length);
    else if (this.symbols.plusSign && value.startsWith(this.symbols.plusSign) && maxValue > 0) value = value.slice(this.symbols.plusSign.length);
    if (this.symbols.group && value.startsWith(this.symbols.group)) return false;
    if (this.symbols.decimal && value.indexOf(this.symbols.decimal) > -1 && this.options.maximumFractionDigits === 0) return false;
    if (this.symbols.group) value = $6c7bd7858deea686$var$replaceAll(value, this.symbols.group, "");
    value = value.replace(this.symbols.numeral, "");
    if (this.symbols.decimal) value = value.replace(this.symbols.decimal, "");
    return value.length === 0;
  }
  constructor(locale, options = {}) {
    this.locale = locale;
    if (options.roundingIncrement !== 1 && options.roundingIncrement != null) {
      if (options.maximumFractionDigits == null && options.minimumFractionDigits == null) {
        options.maximumFractionDigits = 0;
        options.minimumFractionDigits = 0;
      } else if (options.maximumFractionDigits == null) options.maximumFractionDigits = options.minimumFractionDigits;
      else if (options.minimumFractionDigits == null) options.minimumFractionDigits = options.maximumFractionDigits;
    }
    this.formatter = new Intl.NumberFormat(locale, options);
    this.options = this.formatter.resolvedOptions();
    this.symbols = $6c7bd7858deea686$var$getSymbols(locale, this.formatter, this.options, options);
    var _this_options_minimumFractionDigits, _this_options_maximumFractionDigits;
    if (this.options.style === "percent" && (((_this_options_minimumFractionDigits = this.options.minimumFractionDigits) !== null && _this_options_minimumFractionDigits !== void 0 ? _this_options_minimumFractionDigits : 0) > 18 || ((_this_options_maximumFractionDigits = this.options.maximumFractionDigits) !== null && _this_options_maximumFractionDigits !== void 0 ? _this_options_maximumFractionDigits : 0) > 18)) console.warn("NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.");
  }
}
const $6c7bd7858deea686$var$nonLiteralParts = /* @__PURE__ */ new Set([
  "decimal",
  "fraction",
  "integer",
  "minusSign",
  "plusSign",
  "group"
]);
const $6c7bd7858deea686$var$pluralNumbers = [
  0,
  4,
  2,
  1,
  11,
  20,
  3,
  7,
  100,
  21,
  0.1,
  1.1
];
function $6c7bd7858deea686$var$getSymbols(locale, formatter, intlOptions, originalOptions) {
  var _allParts_find, _posAllParts_find, _decimalParts_find, _allParts_find1;
  let symbolFormatter = new Intl.NumberFormat(locale, {
    ...intlOptions,
    // Resets so we get the full range of symbols
    minimumSignificantDigits: 1,
    maximumSignificantDigits: 21,
    roundingIncrement: 1,
    roundingPriority: "auto",
    roundingMode: "halfExpand"
  });
  let allParts = symbolFormatter.formatToParts(-10000.111);
  let posAllParts = symbolFormatter.formatToParts(10000.111);
  let pluralParts = $6c7bd7858deea686$var$pluralNumbers.map((n) => symbolFormatter.formatToParts(n));
  var _allParts_find_value;
  let minusSign = (_allParts_find_value = (_allParts_find = allParts.find((p) => p.type === "minusSign")) === null || _allParts_find === void 0 ? void 0 : _allParts_find.value) !== null && _allParts_find_value !== void 0 ? _allParts_find_value : "-";
  let plusSign = (_posAllParts_find = posAllParts.find((p) => p.type === "plusSign")) === null || _posAllParts_find === void 0 ? void 0 : _posAllParts_find.value;
  if (!plusSign && ((originalOptions === null || originalOptions === void 0 ? void 0 : originalOptions.signDisplay) === "exceptZero" || (originalOptions === null || originalOptions === void 0 ? void 0 : originalOptions.signDisplay) === "always")) plusSign = "+";
  let decimalParts = new Intl.NumberFormat(locale, {
    ...intlOptions,
    minimumFractionDigits: 2,
    maximumFractionDigits: 2
  }).formatToParts(1e-3);
  let decimal = (_decimalParts_find = decimalParts.find((p) => p.type === "decimal")) === null || _decimalParts_find === void 0 ? void 0 : _decimalParts_find.value;
  let group = (_allParts_find1 = allParts.find((p) => p.type === "group")) === null || _allParts_find1 === void 0 ? void 0 : _allParts_find1.value;
  let allPartsLiterals = allParts.filter((p) => !$6c7bd7858deea686$var$nonLiteralParts.has(p.type)).map((p) => $6c7bd7858deea686$var$escapeRegex(p.value));
  let pluralPartsLiterals = pluralParts.flatMap((p) => p.filter((p2) => !$6c7bd7858deea686$var$nonLiteralParts.has(p2.type)).map((p2) => $6c7bd7858deea686$var$escapeRegex(p2.value)));
  let sortedLiterals = [
    .../* @__PURE__ */ new Set([
      ...allPartsLiterals,
      ...pluralPartsLiterals
    ])
  ].sort((a, b) => b.length - a.length);
  let literals = sortedLiterals.length === 0 ? new RegExp("[\\p{White_Space}]", "gu") : new RegExp(`${sortedLiterals.join("|")}|[\\p{White_Space}]`, "gu");
  let numerals = [
    ...new Intl.NumberFormat(intlOptions.locale, {
      useGrouping: false
    }).format(9876543210)
  ].reverse();
  let indexes = new Map(numerals.map((d, i) => [
    d,
    i
  ]));
  let numeral = new RegExp(`[${numerals.join("")}]`, "g");
  let index = (d) => String(indexes.get(d));
  return {
    minusSign,
    plusSign,
    decimal,
    group,
    literals,
    numeral,
    index
  };
}
function $6c7bd7858deea686$var$replaceAll(str, find, replace) {
  if (str.replaceAll) return str.replaceAll(find, replace);
  return str.split(find).join(replace);
}
function $6c7bd7858deea686$var$escapeRegex(string) {
  return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
function $7d0a636d7a4dcefd$export$2123ff2b87c81ca(props, ref) {
  let { onScroll, isDisabled } = props;
  let onScrollHandler = useCallback((e) => {
    if (e.ctrlKey) return;
    e.preventDefault();
    e.stopPropagation();
    if (onScroll) onScroll({
      deltaX: e.deltaX,
      deltaY: e.deltaY
    });
  }, [
    onScroll
  ]);
  $e9faafb641e167db$export$90fc3a17d93f704c(ref, "wheel", isDisabled ? void 0 : onScrollHandler);
}
function $d841c8010a73d545$var$supportsNativeBeforeInputEvent() {
  return typeof window !== "undefined" && window.InputEvent && typeof InputEvent.prototype.getTargetRanges === "function";
}
function $d841c8010a73d545$export$4f384c9210e583c3(props, state, inputRef) {
  let onBeforeInputFallback = $8ae05eaa5c114e9c$export$7f54fc3180508a52((e) => {
    let input = inputRef.current;
    if (!input) return;
    let nextValue = null;
    switch (e.inputType) {
      case "historyUndo":
      case "historyRedo":
        return;
      case "insertLineBreak":
        return;
      case "deleteContent":
      case "deleteByCut":
      case "deleteByDrag":
        nextValue = input.value.slice(0, input.selectionStart) + input.value.slice(input.selectionEnd);
        break;
      case "deleteContentForward":
        nextValue = input.selectionEnd === input.selectionStart ? input.value.slice(0, input.selectionStart) + input.value.slice(input.selectionEnd + 1) : input.value.slice(0, input.selectionStart) + input.value.slice(input.selectionEnd);
        break;
      case "deleteContentBackward":
        nextValue = input.selectionEnd === input.selectionStart ? input.value.slice(0, input.selectionStart - 1) + input.value.slice(input.selectionStart) : input.value.slice(0, input.selectionStart) + input.value.slice(input.selectionEnd);
        break;
      case "deleteSoftLineBackward":
      case "deleteHardLineBackward":
        nextValue = input.value.slice(input.selectionStart);
        break;
      default:
        if (e.data != null) nextValue = input.value.slice(0, input.selectionStart) + e.data + input.value.slice(input.selectionEnd);
        break;
    }
    if (nextValue == null || !state.validate(nextValue)) e.preventDefault();
  });
  useEffect(() => {
    if (!$d841c8010a73d545$var$supportsNativeBeforeInputEvent() || !inputRef.current) return;
    let input = inputRef.current;
    input.addEventListener("beforeinput", onBeforeInputFallback, false);
    return () => {
      input.removeEventListener("beforeinput", onBeforeInputFallback, false);
    };
  }, [
    inputRef,
    onBeforeInputFallback
  ]);
  let onBeforeInput = !$d841c8010a73d545$var$supportsNativeBeforeInputEvent() ? (e) => {
    let nextValue = e.target.value.slice(0, e.target.selectionStart) + e.data + e.target.value.slice(e.target.selectionEnd);
    if (!state.validate(nextValue)) e.preventDefault();
  } : null;
  let { labelProps, inputProps: textFieldProps, descriptionProps, errorMessageProps, ...validation } = $2d73ec29415bd339$export$712718f7aec83d5(props, inputRef);
  let compositionStartState = useRef(null);
  return {
    inputProps: $3ef42575df84b30b$export$9d1611c77c2fe928(textFieldProps, {
      onBeforeInput,
      onCompositionStart() {
        let { value, selectionStart, selectionEnd } = inputRef.current;
        compositionStartState.current = {
          value,
          selectionStart,
          selectionEnd
        };
      },
      onCompositionEnd() {
        if (inputRef.current && !state.validate(inputRef.current.value)) {
          let { value, selectionStart, selectionEnd } = compositionStartState.current;
          inputRef.current.value = value;
          inputRef.current.setSelectionRange(selectionStart, selectionEnd);
          state.setInputValue(value);
        }
      }
    }),
    labelProps,
    descriptionProps,
    errorMessageProps,
    ...validation
  };
}
function $de67e98908f0c6ee$export$7f629e9dc1ecf37c(props) {
  let { minValue, maxValue, step, formatOptions, value, defaultValue = NaN, onChange, locale, isDisabled, isReadOnly } = props;
  if (value === null) value = NaN;
  if (value !== void 0 && !isNaN(value)) {
    if (step !== void 0 && !isNaN(step)) value = $9446cca9a3875146$export$cb6e0bb50bc19463(value, minValue, maxValue, step);
    else value = $9446cca9a3875146$export$7d15b64cf5a3a4c4(value, minValue, maxValue);
  }
  if (!isNaN(defaultValue)) {
    if (step !== void 0 && !isNaN(step)) defaultValue = $9446cca9a3875146$export$cb6e0bb50bc19463(defaultValue, minValue, maxValue, step);
    else defaultValue = $9446cca9a3875146$export$7d15b64cf5a3a4c4(defaultValue, minValue, maxValue);
  }
  let [numberValue, setNumberValue] = $458b0a5536c1a7cf$export$40bfa8c7b0832715(value, isNaN(defaultValue) ? NaN : defaultValue, onChange);
  let [initialValue] = useState(numberValue);
  let [inputValue, setInputValue] = useState(() => isNaN(numberValue) ? "" : new $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5(locale, formatOptions).format(numberValue));
  let numberParser = useMemo(() => new $6c7bd7858deea686$export$cd11ab140839f11d(locale, formatOptions), [
    locale,
    formatOptions
  ]);
  let numberingSystem = useMemo(() => numberParser.getNumberingSystem(inputValue), [
    numberParser,
    inputValue
  ]);
  let formatter = useMemo(() => new $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5(locale, {
    ...formatOptions,
    numberingSystem
  }), [
    locale,
    formatOptions,
    numberingSystem
  ]);
  let intlOptions = useMemo(() => formatter.resolvedOptions(), [
    formatter
  ]);
  let format = useCallback((value2) => isNaN(value2) || value2 === null ? "" : formatter.format(value2), [
    formatter
  ]);
  let validation = $e5be200c675c3b3a$export$fc1a364ae1f3ff10({
    ...props,
    value: numberValue
  });
  let clampStep = step !== void 0 && !isNaN(step) ? step : 1;
  if (intlOptions.style === "percent" && (step === void 0 || isNaN(step))) clampStep = 0.01;
  let [prevValue, setPrevValue] = useState(numberValue);
  let [prevLocale, setPrevLocale] = useState(locale);
  let [prevFormatOptions, setPrevFormatOptions] = useState(formatOptions);
  if (!Object.is(numberValue, prevValue) || locale !== prevLocale || formatOptions !== prevFormatOptions) {
    setInputValue(format(numberValue));
    setPrevValue(numberValue);
    setPrevLocale(locale);
    setPrevFormatOptions(formatOptions);
  }
  let parsedValue = useMemo(() => numberParser.parse(inputValue), [
    numberParser,
    inputValue
  ]);
  let commit = () => {
    if (!inputValue.length) {
      setNumberValue(NaN);
      setInputValue(value === void 0 ? "" : format(numberValue));
      return;
    }
    if (isNaN(parsedValue)) {
      setInputValue(format(numberValue));
      return;
    }
    let clampedValue;
    if (step === void 0 || isNaN(step)) clampedValue = $9446cca9a3875146$export$7d15b64cf5a3a4c4(parsedValue, minValue, maxValue);
    else clampedValue = $9446cca9a3875146$export$cb6e0bb50bc19463(parsedValue, minValue, maxValue, step);
    clampedValue = numberParser.parse(format(clampedValue));
    setNumberValue(clampedValue);
    setInputValue(format(value === void 0 ? clampedValue : numberValue));
    validation.commitValidation();
  };
  let safeNextStep = (operation, minMax = 0) => {
    let prev = parsedValue;
    if (isNaN(prev)) {
      let newValue = isNaN(minMax) ? 0 : minMax;
      return $9446cca9a3875146$export$cb6e0bb50bc19463(newValue, minValue, maxValue, clampStep);
    } else {
      let newValue = $9446cca9a3875146$export$cb6e0bb50bc19463(prev, minValue, maxValue, clampStep);
      if (operation === "+" && newValue > prev || operation === "-" && newValue < prev) return newValue;
      return $9446cca9a3875146$export$cb6e0bb50bc19463($de67e98908f0c6ee$var$handleDecimalOperation(operation, prev, clampStep), minValue, maxValue, clampStep);
    }
  };
  let increment = () => {
    let newValue = safeNextStep("+", minValue);
    if (newValue === numberValue) setInputValue(format(newValue));
    setNumberValue(newValue);
    validation.commitValidation();
  };
  let decrement = () => {
    let newValue = safeNextStep("-", maxValue);
    if (newValue === numberValue) setInputValue(format(newValue));
    setNumberValue(newValue);
    validation.commitValidation();
  };
  let incrementToMax = () => {
    if (maxValue != null) {
      setNumberValue($9446cca9a3875146$export$cb6e0bb50bc19463(maxValue, minValue, maxValue, clampStep));
      validation.commitValidation();
    }
  };
  let decrementToMin = () => {
    if (minValue != null) {
      setNumberValue(minValue);
      validation.commitValidation();
    }
  };
  let canIncrement = useMemo(() => !isDisabled && !isReadOnly && (isNaN(parsedValue) || maxValue === void 0 || isNaN(maxValue) || $9446cca9a3875146$export$cb6e0bb50bc19463(parsedValue, minValue, maxValue, clampStep) > parsedValue || $de67e98908f0c6ee$var$handleDecimalOperation("+", parsedValue, clampStep) <= maxValue), [
    isDisabled,
    isReadOnly,
    minValue,
    maxValue,
    clampStep,
    parsedValue
  ]);
  let canDecrement = useMemo(() => !isDisabled && !isReadOnly && (isNaN(parsedValue) || minValue === void 0 || isNaN(minValue) || $9446cca9a3875146$export$cb6e0bb50bc19463(parsedValue, minValue, maxValue, clampStep) < parsedValue || $de67e98908f0c6ee$var$handleDecimalOperation("-", parsedValue, clampStep) >= minValue), [
    isDisabled,
    isReadOnly,
    minValue,
    maxValue,
    clampStep,
    parsedValue
  ]);
  let validate = (value2) => numberParser.isValidPartialNumber(value2, minValue, maxValue);
  return {
    ...validation,
    validate,
    increment,
    incrementToMax,
    decrement,
    decrementToMin,
    canIncrement,
    canDecrement,
    minValue,
    maxValue,
    numberValue: parsedValue,
    defaultNumberValue: isNaN(defaultValue) ? initialValue : defaultValue,
    setNumberValue,
    setInputValue,
    inputValue,
    commit
  };
}
function $de67e98908f0c6ee$var$handleDecimalOperation(operator, value1, value2) {
  let result = operator === "+" ? value1 + value2 : value1 - value2;
  if (value1 % 1 !== 0 || value2 % 1 !== 0) {
    const value1Decimal = value1.toString().split(".");
    const value2Decimal = value2.toString().split(".");
    const value1DecimalLength = value1Decimal[1] && value1Decimal[1].length || 0;
    const value2DecimalLength = value2Decimal[1] && value2Decimal[1].length || 0;
    const multiplier = Math.pow(10, Math.max(value1DecimalLength, value2DecimalLength));
    value1 = Math.round(value1 * multiplier);
    value2 = Math.round(value2 * multiplier);
    result = operator === "+" ? value1 + value2 : value1 - value2;
    result /= multiplier;
  }
  return result;
}
var $ed6aae4e5f766f1e$exports = {};
$ed6aae4e5f766f1e$exports = {
  "Empty": `فارغ`
};
var $38854e2b175151fa$exports = {};
$38854e2b175151fa$exports = {
  "Empty": `Изпразни`
};
var $15b25ab20f3945b2$exports = {};
$15b25ab20f3945b2$exports = {
  "Empty": `Prázdné`
};
var $692a4298b6b649a2$exports = {};
$692a4298b6b649a2$exports = {
  "Empty": `Tom`
};
var $1c6e1539193f1243$exports = {};
$1c6e1539193f1243$exports = {
  "Empty": `Leer`
};
var $1e8678632c464b6d$exports = {};
$1e8678632c464b6d$exports = {
  "Empty": `Άδειο`
};
var $4adc85d9bf5b9eed$exports = {};
$4adc85d9bf5b9eed$exports = {
  "Empty": `Empty`
};
var $41c4b2bb61dafbca$exports = {};
$41c4b2bb61dafbca$exports = {
  "Empty": `Vacío`
};
var $405f8b24f5dd2a60$exports = {};
$405f8b24f5dd2a60$exports = {
  "Empty": `Tühjenda`
};
var $7efe3ed02b9b9dd4$exports = {};
$7efe3ed02b9b9dd4$exports = {
  "Empty": `Tyhjä`
};
var $99fc4c101d92daf3$exports = {};
$99fc4c101d92daf3$exports = {
  "Empty": `Vide`
};
var $f9e155e6e8cacaa2$exports = {};
$f9e155e6e8cacaa2$exports = {
  "Empty": `ריק`
};
var $c31b5e8e9a249fd5$exports = {};
$c31b5e8e9a249fd5$exports = {
  "Empty": `Prazno`
};
var $9c5435bc17499bd9$exports = {};
$9c5435bc17499bd9$exports = {
  "Empty": `Üres`
};
var $6d1fc8e84d8165e1$exports = {};
$6d1fc8e84d8165e1$exports = {
  "Empty": `Vuoto`
};
var $46ea6b3641b83e71$exports = {};
$46ea6b3641b83e71$exports = {
  "Empty": `空`
};
var $0e3cc9a288289dc5$exports = {};
$0e3cc9a288289dc5$exports = {
  "Empty": `비어 있음`
};
var $4ff2bb25c0089ffb$exports = {};
$4ff2bb25c0089ffb$exports = {
  "Empty": `Tuščias`
};
var $6cf33cd4c010a2fb$exports = {};
$6cf33cd4c010a2fb$exports = {
  "Empty": `Tukšs`
};
var $5a9f8486f8b8837e$exports = {};
$5a9f8486f8b8837e$exports = {
  "Empty": `Tom`
};
var $583f94d807f6ecea$exports = {};
$583f94d807f6ecea$exports = {
  "Empty": `Leeg`
};
var $cc4dcfeea2b4050d$exports = {};
$cc4dcfeea2b4050d$exports = {
  "Empty": `Pusty`
};
var $68ac2954d56e12b4$exports = {};
$68ac2954d56e12b4$exports = {
  "Empty": `Vazio`
};
var $fdb0616f309780b0$exports = {};
$fdb0616f309780b0$exports = {
  "Empty": `Vazio`
};
var $fe1eccf4ee1d6f52$exports = {};
$fe1eccf4ee1d6f52$exports = {
  "Empty": `Gol`
};
var $a38b6c4e18725976$exports = {};
$a38b6c4e18725976$exports = {
  "Empty": `Не заполнено`
};
var $6c14ae2b766b652c$exports = {};
$6c14ae2b766b652c$exports = {
  "Empty": `Prázdne`
};
var $8f1c9692e16dc5eb$exports = {};
$8f1c9692e16dc5eb$exports = {
  "Empty": `Prazen`
};
var $d2aa7abea627cafa$exports = {};
$d2aa7abea627cafa$exports = {
  "Empty": `Prazno`
};
var $676b82e4b56408e6$exports = {};
$676b82e4b56408e6$exports = {
  "Empty": `Tomt`
};
var $14c9042552d7ce08$exports = {};
$14c9042552d7ce08$exports = {
  "Empty": `Boş`
};
var $393254ebcb66c9f5$exports = {};
$393254ebcb66c9f5$exports = {
  "Empty": `Пусто`
};
var $d49d621f310cf6ce$exports = {};
$d49d621f310cf6ce$exports = {
  "Empty": `空`
};
var $94b60c866ca5dfe6$exports = {};
$94b60c866ca5dfe6$exports = {
  "Empty": `空白`
};
var $a99895ee3dc79e61$exports = {};
$a99895ee3dc79e61$exports = {
  "ar-AE": $ed6aae4e5f766f1e$exports,
  "bg-BG": $38854e2b175151fa$exports,
  "cs-CZ": $15b25ab20f3945b2$exports,
  "da-DK": $692a4298b6b649a2$exports,
  "de-DE": $1c6e1539193f1243$exports,
  "el-GR": $1e8678632c464b6d$exports,
  "en-US": $4adc85d9bf5b9eed$exports,
  "es-ES": $41c4b2bb61dafbca$exports,
  "et-EE": $405f8b24f5dd2a60$exports,
  "fi-FI": $7efe3ed02b9b9dd4$exports,
  "fr-FR": $99fc4c101d92daf3$exports,
  "he-IL": $f9e155e6e8cacaa2$exports,
  "hr-HR": $c31b5e8e9a249fd5$exports,
  "hu-HU": $9c5435bc17499bd9$exports,
  "it-IT": $6d1fc8e84d8165e1$exports,
  "ja-JP": $46ea6b3641b83e71$exports,
  "ko-KR": $0e3cc9a288289dc5$exports,
  "lt-LT": $4ff2bb25c0089ffb$exports,
  "lv-LV": $6cf33cd4c010a2fb$exports,
  "nb-NO": $5a9f8486f8b8837e$exports,
  "nl-NL": $583f94d807f6ecea$exports,
  "pl-PL": $cc4dcfeea2b4050d$exports,
  "pt-BR": $68ac2954d56e12b4$exports,
  "pt-PT": $fdb0616f309780b0$exports,
  "ro-RO": $fe1eccf4ee1d6f52$exports,
  "ru-RU": $a38b6c4e18725976$exports,
  "sk-SK": $6c14ae2b766b652c$exports,
  "sl-SI": $8f1c9692e16dc5eb$exports,
  "sr-SP": $d2aa7abea627cafa$exports,
  "sv-SE": $676b82e4b56408e6$exports,
  "tr-TR": $14c9042552d7ce08$exports,
  "uk-UA": $393254ebcb66c9f5$exports,
  "zh-CN": $d49d621f310cf6ce$exports,
  "zh-TW": $94b60c866ca5dfe6$exports
};
function $parcel$interopDefault$1(a) {
  return a && a.__esModule ? a.default : a;
}
function $d2e8511e6f209edf$export$e908e06f4b8e3402(props) {
  const _async = useRef(void 0);
  let { value, textValue, minValue, maxValue, isDisabled, isReadOnly, isRequired, onIncrement, onIncrementPage, onDecrement, onDecrementPage, onDecrementToMin, onIncrementToMax } = props;
  const stringFormatter = $fca6afa0e843324b$export$f12b703ca79dfbb1($parcel$interopDefault$1($a99895ee3dc79e61$exports), "@react-aria/spinbutton");
  const clearAsync = () => clearTimeout(_async.current);
  useEffect(() => {
    return () => clearAsync();
  }, []);
  let onKeyDown = (e) => {
    if (e.ctrlKey || e.metaKey || e.shiftKey || e.altKey || isReadOnly || e.nativeEvent.isComposing) return;
    switch (e.key) {
      case "PageUp":
        if (onIncrementPage) {
          e.preventDefault();
          onIncrementPage === null || onIncrementPage === void 0 ? void 0 : onIncrementPage();
          break;
        }
      // fallthrough!
      case "ArrowUp":
      case "Up":
        if (onIncrement) {
          e.preventDefault();
          onIncrement === null || onIncrement === void 0 ? void 0 : onIncrement();
        }
        break;
      case "PageDown":
        if (onDecrementPage) {
          e.preventDefault();
          onDecrementPage === null || onDecrementPage === void 0 ? void 0 : onDecrementPage();
          break;
        }
      // fallthrough
      case "ArrowDown":
      case "Down":
        if (onDecrement) {
          e.preventDefault();
          onDecrement === null || onDecrement === void 0 ? void 0 : onDecrement();
        }
        break;
      case "Home":
        if (onDecrementToMin) {
          e.preventDefault();
          onDecrementToMin === null || onDecrementToMin === void 0 ? void 0 : onDecrementToMin();
        }
        break;
      case "End":
        if (onIncrementToMax) {
          e.preventDefault();
          onIncrementToMax === null || onIncrementToMax === void 0 ? void 0 : onIncrementToMax();
        }
        break;
    }
  };
  let isFocused = useRef(false);
  let onFocus = () => {
    isFocused.current = true;
  };
  let onBlur = () => {
    isFocused.current = false;
  };
  let ariaTextValue = textValue === "" ? stringFormatter.format("Empty") : (textValue || `${value}`).replace("-", "−");
  useEffect(() => {
    if (isFocused.current) {
      $319e236875307eab$export$d10ae4f68404609a("assertive");
      $319e236875307eab$export$a9b970dcc4ae71a9(ariaTextValue, "assertive");
    }
  }, [
    ariaTextValue
  ]);
  const onIncrementPressStart = $8ae05eaa5c114e9c$export$7f54fc3180508a52((initialStepDelay) => {
    clearAsync();
    onIncrement === null || onIncrement === void 0 ? void 0 : onIncrement();
    _async.current = window.setTimeout(() => {
      if (maxValue === void 0 || isNaN(maxValue) || value === void 0 || isNaN(value) || value < maxValue) onIncrementPressStart(60);
    }, initialStepDelay);
  });
  const onDecrementPressStart = $8ae05eaa5c114e9c$export$7f54fc3180508a52((initialStepDelay) => {
    clearAsync();
    onDecrement === null || onDecrement === void 0 ? void 0 : onDecrement();
    _async.current = window.setTimeout(() => {
      if (minValue === void 0 || isNaN(minValue) || value === void 0 || isNaN(value) || value > minValue) onDecrementPressStart(60);
    }, initialStepDelay);
  });
  let cancelContextMenu = (e) => {
    e.preventDefault();
  };
  let { addGlobalListener, removeAllGlobalListeners } = $03deb23ff14920c4$export$4eaf04e54aa8eed6();
  return {
    spinButtonProps: {
      role: "spinbutton",
      "aria-valuenow": value !== void 0 && !isNaN(value) ? value : void 0,
      "aria-valuetext": ariaTextValue,
      "aria-valuemin": minValue,
      "aria-valuemax": maxValue,
      "aria-disabled": isDisabled || void 0,
      "aria-readonly": isReadOnly || void 0,
      "aria-required": isRequired || void 0,
      onKeyDown,
      onFocus,
      onBlur
    },
    incrementButtonProps: {
      onPressStart: () => {
        onIncrementPressStart(400);
        addGlobalListener(window, "contextmenu", cancelContextMenu);
      },
      onPressEnd: () => {
        clearAsync();
        removeAllGlobalListeners();
      },
      onFocus,
      onBlur
    },
    decrementButtonProps: {
      onPressStart: () => {
        onDecrementPressStart(400);
        addGlobalListener(window, "contextmenu", cancelContextMenu);
      },
      onPressEnd: () => {
        clearAsync();
        removeAllGlobalListeners();
      },
      onFocus,
      onBlur
    }
  };
}
var $fb78e0f6ab6349ed$exports = {};
$fb78e0f6ab6349ed$exports = {
  "decrease": (args) => `خفض ${args.fieldLabel}`,
  "increase": (args) => `زيادة ${args.fieldLabel}`,
  "numberField": `حقل رقمي`
};
var $2776acdd9959a647$exports = {};
$2776acdd9959a647$exports = {
  "decrease": (args) => `Намаляване ${args.fieldLabel}`,
  "increase": (args) => `Усилване ${args.fieldLabel}`,
  "numberField": `Номер на полето`
};
var $741954410a365ad3$exports = {};
$741954410a365ad3$exports = {
  "decrease": (args) => `Snížit ${args.fieldLabel}`,
  "increase": (args) => `Zvýšit ${args.fieldLabel}`,
  "numberField": `Číselné pole`
};
var $8321ed0f8ab642f0$exports = {};
$8321ed0f8ab642f0$exports = {
  "decrease": (args) => `Reducer ${args.fieldLabel}`,
  "increase": (args) => `Øg ${args.fieldLabel}`,
  "numberField": `Talfelt`
};
var $92978e0c4ecafa32$exports = {};
$92978e0c4ecafa32$exports = {
  "decrease": (args) => `${args.fieldLabel} verringern`,
  "increase": (args) => `${args.fieldLabel} erhöhen`,
  "numberField": `Nummernfeld`
};
var $ac5ff71962864a84$exports = {};
$ac5ff71962864a84$exports = {
  "decrease": (args) => `Μείωση ${args.fieldLabel}`,
  "increase": (args) => `Αύξηση ${args.fieldLabel}`,
  "numberField": `Πεδίο αριθμού`
};
var $efe4685e2440d8be$exports = {};
$efe4685e2440d8be$exports = {
  "decrease": (args) => `Decrease ${args.fieldLabel}`,
  "increase": (args) => `Increase ${args.fieldLabel}`,
  "numberField": `Number field`
};
var $e50a9a48739b90e1$exports = {};
$e50a9a48739b90e1$exports = {
  "decrease": (args) => `Reducir ${args.fieldLabel}`,
  "increase": (args) => `Aumentar ${args.fieldLabel}`,
  "numberField": `Campo de número`
};
var $6e0d5294ecbb8ab6$exports = {};
$6e0d5294ecbb8ab6$exports = {
  "decrease": (args) => `Vähenda ${args.fieldLabel}`,
  "increase": (args) => `Suurenda ${args.fieldLabel}`,
  "numberField": `Numbri väli`
};
var $e7129d65f607f77f$exports = {};
$e7129d65f607f77f$exports = {
  "decrease": (args) => `Vähennä ${args.fieldLabel}`,
  "increase": (args) => `Lisää ${args.fieldLabel}`,
  "numberField": `Numerokenttä`
};
var $d72adf5b20573e34$exports = {};
$d72adf5b20573e34$exports = {
  "decrease": (args) => `Diminuer ${args.fieldLabel}`,
  "increase": (args) => `Augmenter ${args.fieldLabel}`,
  "numberField": `Champ de nombre`
};
var $a25c707e88b844a7$exports = {};
$a25c707e88b844a7$exports = {
  "decrease": (args) => `הקטן ${args.fieldLabel}`,
  "increase": (args) => `הגדל ${args.fieldLabel}`,
  "numberField": `שדה מספר`
};
var $69b41140b9a4ca54$exports = {};
$69b41140b9a4ca54$exports = {
  "decrease": (args) => `Smanji ${args.fieldLabel}`,
  "increase": (args) => `Povećaj ${args.fieldLabel}`,
  "numberField": `Polje broja`
};
var $81dab28f37f59d1a$exports = {};
$81dab28f37f59d1a$exports = {
  "decrease": (args) => `${args.fieldLabel} csökkentése`,
  "increase": (args) => `${args.fieldLabel} növelése`,
  "numberField": `Számmező`
};
var $866555b31f2d7711$exports = {};
$866555b31f2d7711$exports = {
  "decrease": (args) => `Riduci ${args.fieldLabel}`,
  "increase": (args) => `Aumenta ${args.fieldLabel}`,
  "numberField": `Campo numero`
};
var $dafcd55d52b9d371$exports = {};
$dafcd55d52b9d371$exports = {
  "decrease": (args) => `${args.fieldLabel}を縮小`,
  "increase": (args) => `${args.fieldLabel}を拡大`,
  "numberField": `数値フィールド`
};
var $f090c1f8c5da0145$exports = {};
$f090c1f8c5da0145$exports = {
  "decrease": (args) => `${args.fieldLabel} 감소`,
  "increase": (args) => `${args.fieldLabel} 증가`,
  "numberField": `번호 필드`
};
var $6f10f3a13360a75c$exports = {};
$6f10f3a13360a75c$exports = {
  "decrease": (args) => `Sumažinti ${args.fieldLabel}`,
  "increase": (args) => `Padidinti ${args.fieldLabel}`,
  "numberField": `Numerio laukas`
};
var $47432cefd4b7bd1b$exports = {};
$47432cefd4b7bd1b$exports = {
  "decrease": (args) => `Samazināšana ${args.fieldLabel}`,
  "increase": (args) => `Palielināšana ${args.fieldLabel}`,
  "numberField": `Skaitļu lauks`
};
var $dc578a950a2bf23d$exports = {};
$dc578a950a2bf23d$exports = {
  "decrease": (args) => `Reduser ${args.fieldLabel}`,
  "increase": (args) => `Øk ${args.fieldLabel}`,
  "numberField": `Tallfelt`
};
var $353f1bfca4dc395a$exports = {};
$353f1bfca4dc395a$exports = {
  "decrease": (args) => `${args.fieldLabel} verlagen`,
  "increase": (args) => `${args.fieldLabel} verhogen`,
  "numberField": `Getalveld`
};
var $241bc0bbd870e982$exports = {};
$241bc0bbd870e982$exports = {
  "decrease": (args) => `Zmniejsz ${args.fieldLabel}`,
  "increase": (args) => `Zwiększ ${args.fieldLabel}`,
  "numberField": `Pole numeru`
};
var $da3005c7bd72b0a8$exports = {};
$da3005c7bd72b0a8$exports = {
  "decrease": (args) => `Diminuir ${args.fieldLabel}`,
  "increase": (args) => `Aumentar ${args.fieldLabel}`,
  "numberField": `Campo de número`
};
var $cf48bfc540882310$exports = {};
$cf48bfc540882310$exports = {
  "decrease": (args) => `Diminuir ${args.fieldLabel}`,
  "increase": (args) => `Aumentar ${args.fieldLabel}`,
  "numberField": `Campo numérico`
};
var $b63a28c481ab9ee3$exports = {};
$b63a28c481ab9ee3$exports = {
  "decrease": (args) => `Scădere ${args.fieldLabel}`,
  "increase": (args) => `Creștere ${args.fieldLabel}`,
  "numberField": `Câmp numeric`
};
var $19f9df95c2464ab6$exports = {};
$19f9df95c2464ab6$exports = {
  "decrease": (args) => `Уменьшение ${args.fieldLabel}`,
  "increase": (args) => `Увеличение ${args.fieldLabel}`,
  "numberField": `Числовое поле`
};
var $b272932a685e8482$exports = {};
$b272932a685e8482$exports = {
  "decrease": (args) => `Znížiť ${args.fieldLabel}`,
  "increase": (args) => `Zvýšiť ${args.fieldLabel}`,
  "numberField": `Číselné pole`
};
var $cbaf8b5b61f9e544$exports = {};
$cbaf8b5b61f9e544$exports = {
  "decrease": (args) => `Upadati ${args.fieldLabel}`,
  "increase": (args) => `Povečajte ${args.fieldLabel}`,
  "numberField": `Številčno polje`
};
var $e0a3af6ac1449b2f$exports = {};
$e0a3af6ac1449b2f$exports = {
  "decrease": (args) => `Smanji ${args.fieldLabel}`,
  "increase": (args) => `Povećaj ${args.fieldLabel}`,
  "numberField": `Polje broja`
};
var $71e167d2458a6019$exports = {};
$71e167d2458a6019$exports = {
  "decrease": (args) => `Minska ${args.fieldLabel}`,
  "increase": (args) => `Öka ${args.fieldLabel}`,
  "numberField": `Nummerfält`
};
var $3719245abc082946$exports = {};
$3719245abc082946$exports = {
  "decrease": (args) => `${args.fieldLabel} azalt`,
  "increase": (args) => `${args.fieldLabel} arttır`,
  "numberField": `Sayı alanı`
};
var $2ccc589e2f51824d$exports = {};
$2ccc589e2f51824d$exports = {
  "decrease": (args) => `Зменшити ${args.fieldLabel}`,
  "increase": (args) => `Збільшити ${args.fieldLabel}`,
  "numberField": `Поле номера`
};
var $e1103cb9b4c13942$exports = {};
$e1103cb9b4c13942$exports = {
  "decrease": (args) => `降低 ${args.fieldLabel}`,
  "increase": (args) => `提高 ${args.fieldLabel}`,
  "numberField": `数字字段`
};
var $448607634f80dccb$exports = {};
$448607634f80dccb$exports = {
  "decrease": (args) => `縮小 ${args.fieldLabel}`,
  "increase": (args) => `放大 ${args.fieldLabel}`,
  "numberField": `數字欄位`
};
var $280a227d7cb94b92$exports = {};
$280a227d7cb94b92$exports = {
  "ar-AE": $fb78e0f6ab6349ed$exports,
  "bg-BG": $2776acdd9959a647$exports,
  "cs-CZ": $741954410a365ad3$exports,
  "da-DK": $8321ed0f8ab642f0$exports,
  "de-DE": $92978e0c4ecafa32$exports,
  "el-GR": $ac5ff71962864a84$exports,
  "en-US": $efe4685e2440d8be$exports,
  "es-ES": $e50a9a48739b90e1$exports,
  "et-EE": $6e0d5294ecbb8ab6$exports,
  "fi-FI": $e7129d65f607f77f$exports,
  "fr-FR": $d72adf5b20573e34$exports,
  "he-IL": $a25c707e88b844a7$exports,
  "hr-HR": $69b41140b9a4ca54$exports,
  "hu-HU": $81dab28f37f59d1a$exports,
  "it-IT": $866555b31f2d7711$exports,
  "ja-JP": $dafcd55d52b9d371$exports,
  "ko-KR": $f090c1f8c5da0145$exports,
  "lt-LT": $6f10f3a13360a75c$exports,
  "lv-LV": $47432cefd4b7bd1b$exports,
  "nb-NO": $dc578a950a2bf23d$exports,
  "nl-NL": $353f1bfca4dc395a$exports,
  "pl-PL": $241bc0bbd870e982$exports,
  "pt-BR": $da3005c7bd72b0a8$exports,
  "pt-PT": $cf48bfc540882310$exports,
  "ro-RO": $b63a28c481ab9ee3$exports,
  "ru-RU": $19f9df95c2464ab6$exports,
  "sk-SK": $b272932a685e8482$exports,
  "sl-SI": $cbaf8b5b61f9e544$exports,
  "sr-SP": $e0a3af6ac1449b2f$exports,
  "sv-SE": $71e167d2458a6019$exports,
  "tr-TR": $3719245abc082946$exports,
  "uk-UA": $2ccc589e2f51824d$exports,
  "zh-CN": $e1103cb9b4c13942$exports,
  "zh-TW": $448607634f80dccb$exports
};
function $parcel$interopDefault(a) {
  return a && a.__esModule ? a.default : a;
}
function $81397a9303501bda$export$23f548e970bdf099(props, state, inputRef) {
  let { id, decrementAriaLabel, incrementAriaLabel, isDisabled, isReadOnly, isRequired, minValue, maxValue, autoFocus, label, formatOptions, onBlur = () => {
  }, onFocus, onFocusChange, onKeyDown, onKeyUp, description, errorMessage, isWheelDisabled, ...otherProps } = props;
  let { increment, incrementToMax, decrement, decrementToMin, numberValue, inputValue, commit, commitValidation } = state;
  const stringFormatter = $fca6afa0e843324b$export$f12b703ca79dfbb1($parcel$interopDefault($280a227d7cb94b92$exports), "@react-aria/numberfield");
  let inputId = $bdb11010cef70236$export$f680877a34711e37(id);
  let { focusProps } = $a1ea59d68270f0dd$export$f8168d8dd8fd66e6({
    onBlur() {
      commit();
    }
  });
  let numberFormatter = $a916eb452884faea$export$b7a616150fdb9f44(formatOptions);
  let intlOptions = useMemo(() => numberFormatter.resolvedOptions(), [
    numberFormatter
  ]);
  let textValueFormatter = $a916eb452884faea$export$b7a616150fdb9f44({
    ...formatOptions,
    currencySign: void 0
  });
  let textValue = useMemo(() => isNaN(numberValue) ? "" : textValueFormatter.format(numberValue), [
    textValueFormatter,
    numberValue
  ]);
  let { spinButtonProps, incrementButtonProps: incButtonProps, decrementButtonProps: decButtonProps } = $d2e8511e6f209edf$export$e908e06f4b8e3402({
    isDisabled,
    isReadOnly,
    isRequired,
    maxValue,
    minValue,
    onIncrement: increment,
    onIncrementToMax: incrementToMax,
    onDecrement: decrement,
    onDecrementToMin: decrementToMin,
    value: numberValue,
    textValue
  });
  let [focusWithin, setFocusWithin] = useState(false);
  let { focusWithinProps } = $9ab94262bd0047c7$export$420e68273165f4ec({
    isDisabled,
    onFocusWithinChange: setFocusWithin
  });
  let onWheel = useCallback((e) => {
    if (Math.abs(e.deltaY) <= Math.abs(e.deltaX)) return;
    if (e.deltaY > 0) increment();
    else if (e.deltaY < 0) decrement();
  }, [
    decrement,
    increment
  ]);
  let scrollingDisabled = isWheelDisabled || isDisabled || isReadOnly || !focusWithin;
  $7d0a636d7a4dcefd$export$2123ff2b87c81ca({
    onScroll: onWheel,
    isDisabled: scrollingDisabled
  }, inputRef);
  var _intlOptions_maximumFractionDigits;
  let hasDecimals = ((_intlOptions_maximumFractionDigits = intlOptions.maximumFractionDigits) !== null && _intlOptions_maximumFractionDigits !== void 0 ? _intlOptions_maximumFractionDigits : 0) > 0;
  let hasNegative = state.minValue === void 0 || isNaN(state.minValue) || state.minValue < 0;
  let inputMode = "numeric";
  if ($c87311424ea30a05$export$186c6964ca17d99()) {
    if (hasNegative) inputMode = "text";
    else if (hasDecimals) inputMode = "decimal";
  } else if ($c87311424ea30a05$export$a11b0059900ceec8()) {
    if (hasNegative) inputMode = "numeric";
    else if (hasDecimals) inputMode = "decimal";
  }
  let onChange = (value) => {
    if (state.validate(value)) state.setInputValue(value);
  };
  let domProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props);
  let onKeyDownEnter = useCallback((e) => {
    if (e.nativeEvent.isComposing) return;
    if (e.key === "Enter") {
      commit();
      commitValidation();
    } else e.continuePropagation();
  }, [
    commit,
    commitValidation
  ]);
  let { isInvalid, validationErrors, validationDetails } = state.displayValidation;
  let { labelProps, inputProps: textFieldProps, descriptionProps, errorMessageProps } = $d841c8010a73d545$export$4f384c9210e583c3({
    ...otherProps,
    ...domProps,
    // These props are added to a hidden input rather than the formatted textfield.
    name: void 0,
    form: void 0,
    label,
    autoFocus,
    isDisabled,
    isReadOnly,
    isRequired,
    validate: void 0,
    [$e5be200c675c3b3a$export$a763b9476acd3eb]: state,
    value: inputValue,
    defaultValue: "!",
    autoComplete: "off",
    "aria-label": props["aria-label"] || void 0,
    "aria-labelledby": props["aria-labelledby"] || void 0,
    id: inputId,
    type: "text",
    inputMode,
    onChange,
    onBlur,
    onFocus,
    onFocusChange,
    onKeyDown: useMemo(() => $ff5963eb1fccf552$export$e08e3b67e392101e(onKeyDownEnter, onKeyDown), [
      onKeyDownEnter,
      onKeyDown
    ]),
    onKeyUp,
    description,
    errorMessage
  }, state, inputRef);
  $99facab73266f662$export$5add1d006293d136(inputRef, state.defaultNumberValue, state.setNumberValue);
  let inputProps = $3ef42575df84b30b$export$9d1611c77c2fe928(spinButtonProps, focusProps, textFieldProps, {
    // override the spinbutton role, we can't focus a spin button with VO
    role: null,
    // ignore aria-roledescription on iOS so that required state will announce when it is present
    "aria-roledescription": !$c87311424ea30a05$export$fedb369cb70207f1() ? stringFormatter.format("numberField") : null,
    "aria-valuemax": null,
    "aria-valuemin": null,
    "aria-valuenow": null,
    "aria-valuetext": null,
    autoCorrect: "off",
    spellCheck: "false"
  });
  if (props.validationBehavior === "native") inputProps["aria-required"] = void 0;
  let onButtonPressStart = (e) => {
    var _inputRef_current;
    if (document.activeElement === inputRef.current) return;
    if (e.pointerType === "mouse") (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus();
    else e.target.focus();
  };
  let fieldLabel = props["aria-label"] || (typeof props.label === "string" ? props.label : "");
  let ariaLabelledby;
  if (!fieldLabel) ariaLabelledby = props.label != null ? labelProps.id : props["aria-labelledby"];
  let incrementId = $bdb11010cef70236$export$f680877a34711e37();
  let decrementId = $bdb11010cef70236$export$f680877a34711e37();
  let incrementButtonProps = $3ef42575df84b30b$export$9d1611c77c2fe928(incButtonProps, {
    "aria-label": incrementAriaLabel || stringFormatter.format("increase", {
      fieldLabel
    }).trim(),
    id: ariaLabelledby && !incrementAriaLabel ? incrementId : null,
    "aria-labelledby": ariaLabelledby && !incrementAriaLabel ? `${incrementId} ${ariaLabelledby}` : null,
    "aria-controls": inputId,
    excludeFromTabOrder: true,
    preventFocusOnPress: true,
    allowFocusWhenDisabled: true,
    isDisabled: !state.canIncrement,
    onPressStart: onButtonPressStart
  });
  let decrementButtonProps = $3ef42575df84b30b$export$9d1611c77c2fe928(decButtonProps, {
    "aria-label": decrementAriaLabel || stringFormatter.format("decrease", {
      fieldLabel
    }).trim(),
    id: ariaLabelledby && !decrementAriaLabel ? decrementId : null,
    "aria-labelledby": ariaLabelledby && !decrementAriaLabel ? `${decrementId} ${ariaLabelledby}` : null,
    "aria-controls": inputId,
    excludeFromTabOrder: true,
    preventFocusOnPress: true,
    allowFocusWhenDisabled: true,
    isDisabled: !state.canDecrement,
    onPressStart: onButtonPressStart
  });
  return {
    groupProps: {
      ...focusWithinProps,
      role: "group",
      "aria-disabled": isDisabled,
      "aria-invalid": isInvalid ? "true" : void 0
    },
    labelProps,
    inputProps,
    incrementButtonProps,
    decrementButtonProps,
    errorMessageProps,
    descriptionProps,
    isInvalid,
    validationErrors,
    validationDetails
  };
}
export {
  $de67e98908f0c6ee$export$7f629e9dc1ecf37c as $,
  $81397a9303501bda$export$23f548e970bdf099 as a,
  $d2e8511e6f209edf$export$e908e06f4b8e3402 as b,
  $7d0a636d7a4dcefd$export$2123ff2b87c81ca as c,
  $d841c8010a73d545$export$4f384c9210e583c3 as d
};
