import { r as I, aC as Y } from "./index-6wLGsgHc.js";
import { a as Ie } from "./index-GLEJ4uEg-C8vY6-j7.js";
const je = /* @__PURE__ */ Ie("div")({
  name: "NumberOverlayEditorStyle",
  class: "gdg-n15fjm3e",
  propsAsIs: !1
});
function he(e, t) {
  var r = {};
  for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
  if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var a = 0, n = Object.getOwnPropertySymbols(e); a < n.length; a++) t.indexOf(n[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[a]) && (r[n[a]] = e[n[a]]);
  return r;
}
var re;
(function(e) {
  e.event = "event", e.props = "prop";
})(re || (re = {}));
function H() {
}
function Be(e) {
  var t, r = void 0;
  return function() {
    for (var n = [], a = arguments.length; a--; ) n[a] = arguments[a];
    return t && n.length === t.length && n.every(function(u, l) {
      return u === t[l];
    }) || (t = n, r = e.apply(void 0, n)), r;
  };
}
function ae(e) {
  return !!(e || "").match(/\d/);
}
function X(e) {
  return e == null;
}
function Fe(e) {
  return typeof e == "number" && isNaN(e);
}
function Se(e) {
  return X(e) || Fe(e) || typeof e == "number" && !isFinite(e);
}
function be(e) {
  return e.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&");
}
function Me(e) {
  switch (e) {
    case "lakh":
      return /(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;
    case "wan":
      return /(\d)(?=(\d{4})+(?!\d))/g;
    case "thousand":
    default:
      return /(\d)(?=(\d{3})+(?!\d))/g;
  }
}
function ke(e, t, r) {
  var n = Me(r), a = e.search(/[1-9]/);
  return a = a === -1 ? e.length : a, e.substring(0, a) + e.substring(a, e.length).replace(n, "$1" + t);
}
function We(e) {
  var t = I.useRef(e);
  t.current = e;
  var r = I.useRef(function() {
    for (var n = [], a = arguments.length; a--; ) n[a] = arguments[a];
    return t.current.apply(t, n);
  });
  return r.current;
}
function fe(e, t) {
  t === void 0 && (t = !0);
  var r = e[0] === "-", n = r && t;
  e = e.replace("-", "");
  var a = e.split("."), u = a[0], l = a[1] || "";
  return {
    beforeDecimal: u,
    afterDecimal: l,
    hasNegation: r,
    addNegation: n
  };
}
function Ke(e) {
  if (!e) return e;
  var t = e[0] === "-";
  t && (e = e.substring(1, e.length));
  var r = e.split("."), n = r[0].replace(/^0+/, "") || "0", a = r[1] || "";
  return (t ? "-" : "") + n + (a ? "." + a : "");
}
function ye(e, t, r) {
  for (var n = "", a = r ? "0" : "", u = 0; u <= t - 1; u++) n += e[u] || a;
  return n;
}
function de(e, t) {
  return Array(t + 1).join(e);
}
function Ve(e) {
  var t = e + "", r = t[0] === "-" ? "-" : "";
  r && (t = t.substring(1));
  var n = t.split(/[eE]/g), a = n[0], u = n[1];
  if (u = Number(u), !u) return r + a;
  a = a.replace(".", "");
  var l = 1 + u, g = a.length;
  return l < 0 ? a = "0." + de("0", Math.abs(l)) + a : l >= g ? a = a + de("0", l - g) : a = (a.substring(0, l) || "0") + "." + a.substring(l), r + a;
}
function me(e, t, r) {
  if (["", "-"].indexOf(e) !== -1) return e;
  var n = (e.indexOf(".") !== -1 || r) && t, a = fe(e), u = a.beforeDecimal, l = a.afterDecimal, g = a.hasNegation, h = parseFloat("0." + (l || "0")), S = l.length <= t ? "0." + l : h.toFixed(t), p = S.split("."), v = u;
  u && Number(p[0]) && (v = u.split("").reverse().reduce(function(O, E, m) {
    return O.length > m ? (Number(O[0]) + Number(E)).toString() + O.substring(1, O.length) : E + O;
  }, p[0]));
  var V = ye(p[1] || "", t, r), b = g ? "-" : "", c = n ? "." : "";
  return "" + b + v + c + V;
}
function $(e, t) {
  if (e.value = e.value, e !== null) {
    if (e.createTextRange) {
      var r = e.createTextRange();
      return r.move("character", t), r.select(), !0;
    }
    return e.selectionStart || e.selectionStart === 0 ? (e.focus(), e.setSelectionRange(t, t), !0) : (e.focus(), !1);
  }
}
var we = Be(function(e, t) {
  for (var r = 0, n = 0, a = e.length, u = t.length; e[r] === t[r] && r < a; ) r++;
  for (; e[a - 1 - n] === t[u - 1 - n] && u - n > r && a - n > r; ) n++;
  return {
    from: {
      start: r,
      end: a - n
    },
    to: {
      start: r,
      end: u - n
    }
  };
}), Le = function(e, t) {
  var r = Math.min(e.selectionStart, t);
  return {
    from: {
      start: r,
      end: e.selectionEnd
    },
    to: {
      start: r,
      end: t
    }
  };
};
function Pe(e, t, r) {
  return Math.min(Math.max(e, t), r);
}
function ce(e) {
  return Math.max(e.selectionStart, e.selectionEnd);
}
function Ue() {
  return typeof navigator < "u" && !(navigator.platform && /iPhone|iPod/.test(navigator.platform));
}
function _e(e) {
  return {
    from: {
      start: 0,
      end: 0
    },
    to: {
      start: 0,
      end: e.length
    },
    lastValue: ""
  };
}
function qe(e) {
  var t = e.currentValue, r = e.formattedValue, n = e.currentValueIndex, a = e.formattedValueIndex;
  return t[n] === r[a];
}
function Ge(e, t, r, n, a, u, l) {
  l === void 0 && (l = qe);
  var g = a.findIndex(function(K) {
    return K;
  }), h = e.slice(0, g);
  !t && !r.startsWith(h) && (t = h, r = h + r, n = n + h.length);
  for (var S = r.length, p = e.length, v = {}, V = new Array(S), b = 0; b < S; b++) {
    V[b] = -1;
    for (var c = 0, O = p; c < O; c++) {
      var E = l({
        currentValue: r,
        lastValue: t,
        formattedValue: e,
        currentValueIndex: b,
        formattedValueIndex: c
      });
      if (E && v[c] !== !0) {
        V[b] = c, v[c] = !0;
        break;
      }
    }
  }
  for (var m = n; m < S && (V[m] === -1 || !u(r[m])); ) m++;
  var j = m === S || V[m] === -1 ? p : V[m];
  for (m = n - 1; m > 0 && V[m] === -1; ) m--;
  var B = m === -1 || V[m] === -1 ? 0 : V[m] + 1;
  return B > j ? j : n - B < j - n ? B : j;
}
function ge(e, t, r, n) {
  var a = e.length;
  if (t = Pe(t, 0, a), n === "left") {
    for (; t >= 0 && !r[t]; ) t--;
    t === -1 && (t = r.indexOf(!0));
  } else {
    for (; t <= a && !r[t]; ) t++;
    t > a && (t = r.lastIndexOf(!0));
  }
  return t === -1 && (t = a), t;
}
function He(e) {
  for (var t = Array.from({
    length: e.length + 1
  }).map(function() {
    return !0;
  }), r = 0, n = t.length; r < n; r++) t[r] = !!(ae(e[r]) || ae(e[r - 1]));
  return t;
}
function xe(e, t, r, n, a, u) {
  u === void 0 && (u = H);
  var l = We(function(c, O) {
    var E, m;
    return Se(c) ? (m = "", E = "") : typeof c == "number" || O ? (m = typeof c == "number" ? Ve(c) : c, E = n(m)) : (m = a(c, void 0), E = n(m)), {
      formattedValue: E,
      numAsString: m
    };
  }), g = I.useState(function() {
    return l(X(e) ? t : e, r);
  }), h = g[0], S = g[1], p = function(c, O) {
    c.formattedValue !== h.formattedValue && S({
      formattedValue: c.formattedValue,
      numAsString: c.value
    }), u(c, O);
  }, v = e, V = r;
  X(e) && (v = h.numAsString, V = !0);
  var b = l(v, V);
  return I.useMemo(function() {
    S(b);
  }, [b.formattedValue]), [h, p];
}
function Ze(e) {
  return e.replace(/[^0-9]/g, "");
}
function Je(e) {
  return e;
}
function $e(e) {
  var t = e.type;
  t === void 0 && (t = "text");
  var r = e.displayType;
  r === void 0 && (r = "input");
  var n = e.customInput, a = e.renderText, u = e.getInputRef, l = e.format;
  l === void 0 && (l = Je);
  var g = e.removeFormatting;
  g === void 0 && (g = Ze);
  var h = e.defaultValue, S = e.valueIsNumericString, p = e.onValueChange, v = e.isAllowed, V = e.onChange;
  V === void 0 && (V = H);
  var b = e.onKeyDown;
  b === void 0 && (b = H);
  var c = e.onMouseUp;
  c === void 0 && (c = H);
  var O = e.onFocus;
  O === void 0 && (O = H);
  var E = e.onBlur;
  E === void 0 && (E = H);
  var m = e.value, j = e.getCaretBoundary;
  j === void 0 && (j = He);
  var B = e.isValidInputCharacter;
  B === void 0 && (B = ae);
  var K = e.isCharacterSame, M = he(e, ["type", "displayType", "customInput", "renderText", "getInputRef", "format", "removeFormatting", "defaultValue", "valueIsNumericString", "onValueChange", "isAllowed", "onChange", "onKeyDown", "onMouseUp", "onFocus", "onBlur", "value", "getCaretBoundary", "isValidInputCharacter", "isCharacterSame"]), Z = xe(m, h, !!S, l, g, p), L = Z[0], w = L.formattedValue, k = L.numAsString, J = Z[1], W = I.useRef(), U = I.useRef({
    formattedValue: w,
    numAsString: k
  }), _ = function(o, i) {
    U.current = {
      formattedValue: o.formattedValue,
      numAsString: o.value
    }, J(o, i);
  }, z = I.useState(!1), ee = z[0], d = z[1], s = I.useRef(null), x = I.useRef({
    setCaretTimeout: null,
    focusTimeout: null
  });
  I.useEffect(function() {
    return d(!0), function() {
      clearTimeout(x.current.setCaretTimeout), clearTimeout(x.current.focusTimeout);
    };
  }, []);
  var C = l, A = function(o, i) {
    var f = parseFloat(i);
    return {
      formattedValue: o,
      value: i,
      floatValue: isNaN(f) ? void 0 : f
    };
  }, T = function(o, i, f) {
    o.selectionStart === 0 && o.selectionEnd === o.value.length || ($(o, i), x.current.setCaretTimeout = setTimeout(function() {
      o.value === f && o.selectionStart !== i && $(o, i);
    }, 0));
  }, R = function(o, i, f) {
    return ge(o, i, j(o), f);
  }, Q = function(o, i, f) {
    var D = j(i), F = Ge(i, w, o, f, D, B, K);
    return F = ge(i, F, D), F;
  }, oe = function(o) {
    var i = o.formattedValue;
    i === void 0 && (i = "");
    var f = o.input, D = o.source, F = o.event, N = o.numAsString, y;
    if (f) {
      var P = o.inputValue || f.value, q = ce(f);
      f.value = i, y = Q(P, i, q), y !== void 0 && T(f, y, i);
    }
    i !== w && _(A(i, N), {
      event: F,
      source: D
    });
  };
  I.useEffect(function() {
    var o = U.current, i = o.formattedValue, f = o.numAsString;
    (w !== i || k !== f) && _(A(w, k), {
      event: void 0,
      source: re.props
    });
  }, [w, k]);
  var te = s.current ? ce(s.current) : void 0, ne = typeof window < "u" ? I.useLayoutEffect : I.useEffect;
  ne(function() {
    var o = s.current;
    if (w !== U.current.formattedValue && o) {
      var i = Q(U.current.formattedValue, w, te);
      o.value = w, T(o, i, w);
    }
  }, [w]);
  var ie = function(o, i, f) {
    var D = i.target, F = W.current ? Le(W.current, D.selectionEnd) : we(w, o), N = Object.assign(Object.assign({}, F), {
      lastValue: w
    }), y = g(o, N), P = C(y);
    if (y = g(P, void 0), v && !v(A(P, y))) {
      var q = i.target, G = ce(q), se = Q(o, w, G);
      return q.value = w, T(q, se, w), !1;
    }
    return oe({
      formattedValue: P,
      numAsString: y,
      inputValue: o,
      event: i,
      source: f,
      input: i.target
    }), !0;
  }, le = function(o, i) {
    i === void 0 && (i = 0);
    var f = o.selectionStart, D = o.selectionEnd;
    W.current = {
      selectionStart: f,
      selectionEnd: D + i
    };
  }, Ne = function(o) {
    var i = o.target, f = i.value, D = ie(f, o, re.event);
    D && V(o), W.current = void 0;
  }, Oe = function(o) {
    var i = o.target, f = o.key, D = i.selectionStart, F = i.selectionEnd, N = i.value;
    N === void 0 && (N = "");
    var y;
    f === "ArrowLeft" || f === "Backspace" ? y = Math.max(D - 1, 0) : f === "ArrowRight" ? y = Math.min(D + 1, N.length) : f === "Delete" && (y = D);
    var P = 0;
    f === "Delete" && D === F && (P = 1);
    var q = f === "ArrowLeft" || f === "ArrowRight";
    if (y === void 0 || D !== F && !q) {
      b(o), le(i, P);
      return;
    }
    var G = y;
    if (q) {
      var se = f === "ArrowLeft" ? "left" : "right";
      G = R(N, y, se), G !== y && o.preventDefault();
    } else f === "Delete" && !B(N[y]) ? G = R(N, y, "right") : f === "Backspace" && !B(N[y]) && (G = R(N, y, "left"));
    G !== y && T(i, G, N), b(o), le(i, P);
  }, Ee = function(o) {
    var i = o.target, f = function() {
      var D = i.selectionStart, F = i.selectionEnd, N = i.value;
      if (N === void 0 && (N = ""), D === F) {
        var y = R(N, D);
        y !== D && T(i, y, N);
      }
    };
    f(), requestAnimationFrame(function() {
      f();
    }), c(o), le(i);
  }, Te = function(o) {
    o.persist && o.persist();
    var i = o.target, f = o.currentTarget;
    s.current = i, x.current.focusTimeout = setTimeout(function() {
      var D = i.selectionStart, F = i.selectionEnd, N = i.value;
      N === void 0 && (N = "");
      var y = R(N, D);
      y !== D && !(D === 0 && F === N.length) && T(i, y, N), O(Object.assign(Object.assign({}, o), {
        currentTarget: f
      }));
    }, 0);
  }, Ce = function(o) {
    s.current = null, clearTimeout(x.current.focusTimeout), clearTimeout(x.current.setCaretTimeout), E(o);
  }, Ae = ee && Ue() ? "numeric" : void 0, ve = Object.assign({
    inputMode: Ae
  }, M, {
    type: t,
    value: w,
    onChange: Ne,
    onKeyDown: Oe,
    onMouseUp: Ee,
    onFocus: Te,
    onBlur: Ce
  });
  if (r === "text") return a ? Y.createElement(Y.Fragment, null, a(w, M) || null) : Y.createElement("span", Object.assign({}, M, {
    ref: u
  }), w);
  if (n) {
    var Re = n;
    return Y.createElement(Re, Object.assign({}, ve, {
      ref: u
    }));
  }
  return Y.createElement("input", Object.assign({}, ve, {
    ref: u
  }));
}
function pe(e, t) {
  var r = t.decimalScale, n = t.fixedDecimalScale, a = t.prefix;
  a === void 0 && (a = "");
  var u = t.suffix;
  u === void 0 && (u = "");
  var l = t.allowNegative, g = t.thousandsGroupStyle;
  if (g === void 0 && (g = "thousand"), e === "" || e === "-") return e;
  var h = ue(t), S = h.thousandSeparator, p = h.decimalSeparator, v = r !== 0 && e.indexOf(".") !== -1 || r && n, V = fe(e, l), b = V.beforeDecimal, c = V.afterDecimal, O = V.addNegation;
  return r !== void 0 && (c = ye(c, r, !!n)), S && (b = ke(b, S, g)), a && (b = a + b), u && (c = c + u), O && (b = "-" + b), e = b + (v && p || "") + c, e;
}
function ue(e) {
  var t = e.decimalSeparator;
  t === void 0 && (t = ".");
  var r = e.thousandSeparator, n = e.allowedDecimalSeparators;
  return r === !0 && (r = ","), n || (n = [t, "."]), {
    decimalSeparator: t,
    thousandSeparator: r,
    allowedDecimalSeparators: n
  };
}
function ze(e, t) {
  e === void 0 && (e = "");
  var r = new RegExp("(-)"), n = new RegExp("(-)(.)*(-)"), a = r.test(e), u = n.test(e);
  return e = e.replace(/-/g, ""), a && !u && t && (e = "-" + e), e;
}
function Qe(e, t) {
  return new RegExp("(^-)|[0-9]|" + be(e), "g");
}
function Ye(e, t, r) {
  return e === "" ? !0 : !t?.match(/\d/) && !r?.match(/\d/) && typeof e == "string" && !isNaN(Number(e));
}
function Xe(e, t, r) {
  var n;
  t === void 0 && (t = _e(e));
  var a = r.allowNegative, u = r.prefix;
  u === void 0 && (u = "");
  var l = r.suffix;
  l === void 0 && (l = "");
  var g = r.decimalScale, h = t.from, S = t.to, p = S.start, v = S.end, V = ue(r), b = V.allowedDecimalSeparators, c = V.decimalSeparator, O = e[v] === c;
  if (ae(e) && (e === u || e === l) && t.lastValue === "") return e;
  if (v - p === 1 && b.indexOf(e[p]) !== -1) {
    var E = g === 0 ? "" : c;
    e = e.substring(0, p) + E + e.substring(p + 1, e.length);
  }
  var m = function(s, x, C) {
    var A = !1, T = !1;
    u.startsWith("-") ? A = !1 : s.startsWith("--") ? (A = !1, T = !0) : l.startsWith("-") && s.length === l.length ? A = !1 : s[0] === "-" && (A = !0);
    var R = A ? 1 : 0;
    return T && (R = 2), R && (s = s.substring(R), x -= R, C -= R), {
      value: s,
      start: x,
      end: C,
      hasNegation: A
    };
  }, j = m(e, p, v), B = j.hasNegation;
  n = j, e = n.value, p = n.start, v = n.end;
  var K = m(t.lastValue, h.start, h.end), M = K.start, Z = K.end, L = K.value, w = e.substring(p, v);
  e.length && L.length && (M > L.length - l.length || Z < u.length) && !(w && l.startsWith(w)) && (e = L);
  var k = 0;
  e.startsWith(u) ? k += u.length : p < u.length && (k = p), e = e.substring(k), v -= k;
  var J = e.length, W = e.length - l.length;
  e.endsWith(l) ? J = W : (v > W || v > e.length - l.length) && (J = v), e = e.substring(0, J), e = ze(B ? "-" + e : e, a), e = (e.match(Qe(c)) || []).join("");
  var U = e.indexOf(c);
  e = e.replace(new RegExp(be(c), "g"), function(s, x) {
    return x === U ? "." : "";
  });
  var _ = fe(e, a), z = _.beforeDecimal, ee = _.afterDecimal, d = _.addNegation;
  return S.end - S.start < h.end - h.start && z === "" && O && !parseFloat(ee) && (e = d ? "-" : ""), e;
}
function et(e, t) {
  var r = t.prefix;
  r === void 0 && (r = "");
  var n = t.suffix;
  n === void 0 && (n = "");
  var a = Array.from({
    length: e.length + 1
  }).map(function() {
    return !0;
  }), u = e[0] === "-";
  a.fill(!1, 0, r.length + (u ? 1 : 0));
  var l = e.length;
  return a.fill(!1, l - n.length + 1, l + 1), a;
}
function tt(e) {
  var t = ue(e), r = t.thousandSeparator, n = t.decimalSeparator, a = e.prefix;
  a === void 0 && (a = "");
  var u = e.allowNegative;
  if (u === void 0 && (u = !0), r === n) throw new Error(`
        Decimal separator can't be same as thousand separator.
        thousandSeparator: ` + r + ` (thousandSeparator = {true} is same as thousandSeparator = ",")
        decimalSeparator: ` + n + ` (default value for decimalSeparator is .)
     `);
  return a.startsWith("-") && u && (console.error(`
      Prefix can't start with '-' when allowNegative is true.
      prefix: ` + a + `
      allowNegative: ` + u + `
    `), u = !1), Object.assign(Object.assign({}, e), {
    allowNegative: u
  });
}
function rt(e) {
  e = tt(e), e.decimalSeparator, e.allowedDecimalSeparators, e.thousandsGroupStyle;
  var t = e.suffix, r = e.allowNegative, n = e.allowLeadingZeros, a = e.onKeyDown;
  a === void 0 && (a = H);
  var u = e.onBlur;
  u === void 0 && (u = H);
  var l = e.thousandSeparator, g = e.decimalScale, h = e.fixedDecimalScale, S = e.prefix;
  S === void 0 && (S = "");
  var p = e.defaultValue, v = e.value, V = e.valueIsNumericString, b = e.onValueChange, c = he(e, ["decimalSeparator", "allowedDecimalSeparators", "thousandsGroupStyle", "suffix", "allowNegative", "allowLeadingZeros", "onKeyDown", "onBlur", "thousandSeparator", "decimalScale", "fixedDecimalScale", "prefix", "defaultValue", "value", "valueIsNumericString", "onValueChange"]), O = ue(e), E = O.decimalSeparator, m = O.allowedDecimalSeparators, j = function(d) {
    return pe(d, e);
  }, B = function(d, s) {
    return Xe(d, s, e);
  }, K = X(v) ? p : v, M = V ?? Ye(K, S, t);
  X(v) ? X(p) || (M = M || typeof p == "number") : M = M || typeof v == "number";
  var Z = function(d) {
    return Se(d) ? d : (typeof d == "number" && (d = Ve(d)), M && typeof g == "number" ? me(d, g, !!h) : d);
  }, L = xe(Z(v), Z(p), !!M, j, B, b), w = L[0], k = w.numAsString, J = w.formattedValue, W = L[1], U = function(d) {
    var s = d.target, x = d.key, C = s.selectionStart, A = s.selectionEnd, T = s.value;
    if (T === void 0 && (T = ""), (x === "Backspace" || x === "Delete") && A < S.length) {
      d.preventDefault();
      return;
    }
    if (C !== A) {
      a(d);
      return;
    }
    x === "Backspace" && T[0] === "-" && C === S.length + 1 && r && $(s, 1), g && h && (x === "Backspace" && T[C - 1] === E ? ($(s, C - 1), d.preventDefault()) : x === "Delete" && T[C] === E && d.preventDefault()), m?.includes(x) && T[C] === E && $(s, C + 1);
    var R = l === !0 ? "," : l;
    x === "Backspace" && T[C - 1] === R && $(s, C - 1), x === "Delete" && T[C] === R && $(s, C + 1), a(d);
  }, _ = function(d) {
    var s = k;
    if (s.match(/\d/g) || (s = ""), n || (s = Ke(s)), h && g && (s = me(s, g, h)), s !== k) {
      var x = pe(s, e);
      W({
        formattedValue: x,
        value: s,
        floatValue: parseFloat(s)
      }, {
        event: d,
        source: re.event
      });
    }
    u(d);
  }, z = function(d) {
    return d === E ? !0 : ae(d);
  }, ee = function(d) {
    var s = d.currentValue, x = d.lastValue, C = d.formattedValue, A = d.currentValueIndex, T = d.formattedValueIndex, R = s[A], Q = C[T], oe = we(x, s), te = oe.to, ne = function(ie) {
      return B(ie).indexOf(".") + S.length;
    };
    return v === 0 && h && g && s[te.start] === E && ne(s) < A && ne(C) > T ? !1 : A >= te.start && A < te.end && m && m.includes(R) && Q === E ? !0 : R === Q;
  };
  return Object.assign(Object.assign({}, c), {
    value: J,
    valueIsNumericString: !1,
    isValidInputCharacter: z,
    isCharacterSame: ee,
    onValueChange: W,
    format: j,
    removeFormatting: B,
    getCaretBoundary: function(d) {
      return et(d, e);
    },
    onKeyDown: U,
    onBlur: _
  });
}
function at(e) {
  var t = rt(e);
  return Y.createElement($e, Object.assign({}, t));
}
function De() {
  return Intl.NumberFormat()?.formatToParts(1.1)?.find((e) => e.type === "decimal")?.value ?? ".";
}
function nt() {
  return De() === "." ? "," : ".";
}
const it = (e) => {
  const {
    value: t,
    onChange: r,
    disabled: n,
    highlight: a,
    validatedSelection: u,
    fixedDecimals: l,
    allowNegative: g,
    thousandSeparator: h,
    decimalSeparator: S
  } = e, p = I.useRef();
  return I.useLayoutEffect(() => {
    if (u !== void 0) {
      const v = typeof u == "number" ? [u, null] : u;
      p.current?.setSelectionRange(v[0], v[1]);
    }
  }, [u]), I.createElement(je, null, I.createElement(at, {
    autoFocus: !0,
    getInputRef: p,
    className: "gdg-input",
    onFocus: (v) => v.target.setSelectionRange(a ? 0 : v.target.value.length, v.target.value.length),
    disabled: n === !0,
    decimalScale: l,
    allowNegative: g,
    thousandSeparator: h ?? nt(),
    decimalSeparator: S ?? De(),
    value: Object.is(t, -0) ? "-" : t ?? "",
    // decimalScale={3}
    // prefix={"$"}
    onValueChange: r
  }));
};
export {
  it as default
};
//# sourceMappingURL=number-overlay-editor-BGJ9OD_Z-DOgsiuED.js.map
