@livestore/devtools-vite 0.4.0-dev.26 → 0.4.0-dev.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
- import { s as Te, R as X, r as T } from "./devtools-react-bundle-DdRG383z.js";
2
- const Be = /* @__PURE__ */ Te("div")({
1
+ import { s as Be, R as Y, r as O } from "./devtools-react-bundle-BLoMnEMJ.js";
2
+ const Fe = /* @__PURE__ */ Be("div")({
3
3
  name: "NumberOverlayEditorStyle",
4
4
  class: "gdg-n15fjm3e",
5
5
  propsAsIs: !1
6
6
  });
7
- function Se(e, t) {
7
+ function pe(e, t) {
8
8
  var r = {};
9
9
  for (var n in e)
10
10
  Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
@@ -13,13 +13,13 @@ function Se(e, t) {
13
13
  t.indexOf(n[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[a]) && (r[n[a]] = e[n[a]]);
14
14
  return r;
15
15
  }
16
- var re;
16
+ var ee;
17
17
  (function(e) {
18
18
  e.event = "event", e.props = "prop";
19
- })(re || (re = {}));
19
+ })(ee || (ee = {}));
20
20
  function q() {
21
21
  }
22
- function Fe(e) {
22
+ function _e(e) {
23
23
  var t, r = void 0;
24
24
  return function() {
25
25
  for (var n = [], a = arguments.length; a--; ) n[a] = arguments[a];
@@ -31,19 +31,19 @@ function Fe(e) {
31
31
  function ae(e) {
32
32
  return !!(e || "").match(/\d/);
33
33
  }
34
- function Y(e) {
34
+ function z(e) {
35
35
  return e == null;
36
36
  }
37
- function _e(e) {
37
+ function je(e) {
38
38
  return typeof e == "number" && isNaN(e);
39
39
  }
40
- function pe(e) {
41
- return Y(e) || _e(e) || typeof e == "number" && !isFinite(e);
42
- }
43
40
  function xe(e) {
41
+ return z(e) || je(e) || typeof e == "number" && !isFinite(e);
42
+ }
43
+ function ye(e) {
44
44
  return e.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&");
45
45
  }
46
- function je(e) {
46
+ function Me(e) {
47
47
  switch (e) {
48
48
  case "lakh":
49
49
  return /(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;
@@ -54,19 +54,19 @@ function je(e) {
54
54
  }
55
55
  }
56
56
  function Le(e, t, r) {
57
- var n = je(r), a = e.search(/[1-9]/);
57
+ var n = Me(r), a = e.search(/[1-9]/);
58
58
  return a = a === -1 ? e.length : a, e.substring(0, a) + e.substring(a, e.length).replace(n, "$1" + t);
59
59
  }
60
- function Me(e) {
61
- var t = T.useRef(e);
60
+ function de(e) {
61
+ var t = O.useRef(e);
62
62
  t.current = e;
63
- var r = T.useRef(function() {
63
+ var r = O.useRef(function() {
64
64
  for (var n = [], a = arguments.length; a--; ) n[a] = arguments[a];
65
65
  return t.current.apply(t, n);
66
66
  });
67
67
  return r.current;
68
68
  }
69
- function se(e, t) {
69
+ function ce(e, t) {
70
70
  t === void 0 && (t = !0);
71
71
  var r = e[0] === "-", n = r && t;
72
72
  e = e.replace("-", "");
@@ -86,35 +86,35 @@ function ke(e) {
86
86
  var r = e.split("."), n = r[0].replace(/^0+/, "") || "0", a = r[1] || "";
87
87
  return (t ? "-" : "") + n + (a ? "." + a : "");
88
88
  }
89
- function ye(e, t, r) {
89
+ function be(e, t, r) {
90
90
  for (var n = "", a = r ? "0" : "", i = 0; i <= t - 1; i++)
91
91
  n += e[i] || a;
92
92
  return n;
93
93
  }
94
- function de(e, t) {
94
+ function ge(e, t) {
95
95
  return Array(t + 1).join(e);
96
96
  }
97
- function be(e) {
97
+ function Ve(e) {
98
98
  var t = e + "", r = t[0] === "-" ? "-" : "";
99
99
  r && (t = t.substring(1));
100
100
  var n = t.split(/[eE]/g), a = n[0], i = n[1];
101
101
  if (i = Number(i), !i)
102
102
  return r + a;
103
103
  a = a.replace(".", "");
104
- var f = 1 + i, m = a.length;
105
- return f < 0 ? a = "0." + de("0", Math.abs(f)) + a : f >= m ? a = a + de("0", f - m) : a = (a.substring(0, f) || "0") + "." + a.substring(f), r + a;
104
+ var f = 1 + i, S = a.length;
105
+ return f < 0 ? a = "0." + ge("0", Math.abs(f)) + a : f >= S ? a = a + ge("0", f - S) : a = (a.substring(0, f) || "0") + "." + a.substring(f), r + a;
106
106
  }
107
- function ge(e, t, r) {
107
+ function me(e, t, r) {
108
108
  if (["", "-"].indexOf(e) !== -1)
109
109
  return e;
110
- var n = (e.indexOf(".") !== -1 || r) && t, a = se(e), i = a.beforeDecimal, f = a.afterDecimal, m = a.hasNegation, S = parseFloat("0." + (f || "0")), p = f.length <= t ? "0." + f : S.toFixed(t), h = p.split("."), c = i;
110
+ var n = (e.indexOf(".") !== -1 || r) && t, a = ce(e), i = a.beforeDecimal, f = a.afterDecimal, S = a.hasNegation, m = parseFloat("0." + (f || "0")), p = f.length <= t ? "0." + f : m.toFixed(t), h = p.split("."), c = i;
111
111
  i && Number(h[0]) && (c = i.split("").reverse().reduce(function(I, C, g) {
112
112
  return I.length > g ? (Number(I[0]) + Number(C)).toString() + I.substring(1, I.length) : C + I;
113
113
  }, h[0]));
114
- var x = ye(h[1] || "", t, r), y = m ? "-" : "", s = n ? "." : "";
115
- return "" + y + c + s + x;
114
+ var x = be(h[1] || "", t, r), y = S ? "-" : "", l = n ? "." : "";
115
+ return "" + y + c + l + x;
116
116
  }
117
- function H(e, t) {
117
+ function J(e, t) {
118
118
  if (e.value = e.value, e !== null) {
119
119
  if (e.createTextRange) {
120
120
  var r = e.createTextRange();
@@ -123,7 +123,7 @@ function H(e, t) {
123
123
  return e.selectionStart || e.selectionStart === 0 ? (e.focus(), e.setSelectionRange(t, t), !0) : (e.focus(), !1);
124
124
  }
125
125
  }
126
- var Ve = Fe(function(e, t) {
126
+ var Ne = _e(function(e, t) {
127
127
  for (var r = 0, n = 0, a = e.length, i = t.length; e[r] === t[r] && r < a; )
128
128
  r++;
129
129
  for (; e[a - 1 - n] === t[i - 1 - n] && i - n > r && a - n > r; )
@@ -142,7 +142,7 @@ var Ve = Fe(function(e, t) {
142
142
  function Ke(e, t, r) {
143
143
  return Math.min(Math.max(e, t), r);
144
144
  }
145
- function ce(e) {
145
+ function se(e) {
146
146
  return Math.max(e.selectionStart, e.selectionEnd);
147
147
  }
148
148
  function We() {
@@ -167,22 +167,22 @@ function $e(e) {
167
167
  }
168
168
  function Ge(e, t, r, n, a, i, f) {
169
169
  f === void 0 && (f = $e);
170
- var m = a.findIndex(function(k) {
170
+ var S = a.findIndex(function(k) {
171
171
  return k;
172
- }), S = e.slice(0, m);
173
- !t && !r.startsWith(S) && (t = S, r = S + r, n = n + S.length);
172
+ }), m = e.slice(0, S);
173
+ !t && !r.startsWith(m) && (t = m, r = m + r, n = n + m.length);
174
174
  for (var p = r.length, h = e.length, c = {}, x = new Array(p), y = 0; y < p; y++) {
175
175
  x[y] = -1;
176
- for (var s = 0, I = h; s < I; s++) {
176
+ for (var l = 0, I = h; l < I; l++) {
177
177
  var C = f({
178
178
  currentValue: r,
179
179
  lastValue: t,
180
180
  formattedValue: e,
181
181
  currentValueIndex: y,
182
- formattedValueIndex: s
182
+ formattedValueIndex: l
183
183
  });
184
- if (C && c[s] !== !0) {
185
- x[y] = s, c[s] = !0;
184
+ if (C && c[l] !== !0) {
185
+ x[y] = l, c[l] = !0;
186
186
  break;
187
187
  }
188
188
  }
@@ -195,7 +195,7 @@ function Ge(e, t, r, n, a, i, f) {
195
195
  var F = g === -1 || x[g] === -1 ? 0 : x[g] + 1;
196
196
  return F > B ? B : n - F < B - n ? F : B;
197
197
  }
198
- function me(e, t, r, n) {
198
+ function he(e, t, r, n) {
199
199
  var a = e.length;
200
200
  if (t = Ke(t, 0, a), n === "left") {
201
201
  for (; t >= 0 && !r[t]; )
@@ -215,24 +215,33 @@ function Ze(e) {
215
215
  t[r] = !!(ae(e[r]) || ae(e[r - 1]));
216
216
  return t;
217
217
  }
218
- function Ne(e, t, r, n, a, i) {
218
+ function we(e, t, r, n, a, i) {
219
219
  i === void 0 && (i = q);
220
- var f = Me(function(s, I) {
220
+ var f = de(function(l, I) {
221
221
  var C, g;
222
- return pe(s) ? (g = "", C = "") : typeof s == "number" || I ? (g = typeof s == "number" ? be(s) : s, C = n(g)) : (g = a(s, void 0), C = n(g)), { formattedValue: C, numAsString: g };
223
- }), m = T.useState(function() {
224
- return f(Y(e) ? t : e, r);
225
- }), S = m[0], p = m[1], h = function(s, I) {
226
- s.formattedValue !== S.formattedValue && p({
227
- formattedValue: s.formattedValue,
228
- numAsString: s.value
229
- }), i(s, I);
230
- }, c = e, x = r;
231
- Y(e) && (c = S.numAsString, x = !0);
222
+ return xe(l) ? (g = "", C = "") : typeof l == "number" || I ? (g = typeof l == "number" ? Ve(l) : l, C = n(g)) : (g = a(l, void 0), C = n(g)), { formattedValue: C, numAsString: g };
223
+ }), S = O.useState(function() {
224
+ return f(z(e) ? t : e, r);
225
+ }), m = S[0], p = S[1], h = de(function(l, I) {
226
+ l.formattedValue !== m.formattedValue && p({
227
+ formattedValue: l.formattedValue,
228
+ numAsString: l.value
229
+ }), i(l, I);
230
+ }), c = e, x = r;
231
+ z(e) && (c = m.numAsString, x = !0);
232
232
  var y = f(c, x);
233
- return T.useMemo(function() {
233
+ return O.useMemo(function() {
234
234
  p(y);
235
- }, [y.formattedValue]), [S, h];
235
+ }, [y.formattedValue]), O.useEffect(function() {
236
+ if (!z(t) && z(e) && m.formattedValue !== "") {
237
+ var l = parseFloat(m.numAsString);
238
+ h({
239
+ formattedValue: m.formattedValue,
240
+ value: m.numAsString,
241
+ floatValue: isNaN(l) ? void 0 : l
242
+ }, { event: void 0, source: ee.props });
243
+ }
244
+ }, []), [m, h];
236
245
  }
237
246
  function qe(e) {
238
247
  return e.replace(/[^0-9]/g, "");
@@ -247,14 +256,14 @@ function He(e) {
247
256
  r === void 0 && (r = "input");
248
257
  var n = e.customInput, a = e.renderText, i = e.getInputRef, f = e.format;
249
258
  f === void 0 && (f = ze);
250
- var m = e.removeFormatting;
251
- m === void 0 && (m = qe);
252
- var S = e.defaultValue, p = e.valueIsNumericString, h = e.onValueChange, c = e.isAllowed, x = e.onChange;
259
+ var S = e.removeFormatting;
260
+ S === void 0 && (S = qe);
261
+ var m = e.defaultValue, p = e.valueIsNumericString, h = e.onValueChange, c = e.isAllowed, x = e.onChange;
253
262
  x === void 0 && (x = q);
254
263
  var y = e.onKeyDown;
255
264
  y === void 0 && (y = q);
256
- var s = e.onMouseUp;
257
- s === void 0 && (s = q);
265
+ var l = e.onMouseUp;
266
+ l === void 0 && (l = q);
258
267
  var I = e.onFocus;
259
268
  I === void 0 && (I = q);
260
269
  var C = e.onBlur;
@@ -263,13 +272,13 @@ function He(e) {
263
272
  B === void 0 && (B = Ze);
264
273
  var F = e.isValidInputCharacter;
265
274
  F === void 0 && (F = ae);
266
- var k = e.isCharacterSame, j = Se(e, ["type", "displayType", "customInput", "renderText", "getInputRef", "format", "removeFormatting", "defaultValue", "valueIsNumericString", "onValueChange", "isAllowed", "onChange", "onKeyDown", "onMouseUp", "onFocus", "onBlur", "value", "getCaretBoundary", "isValidInputCharacter", "isCharacterSame"]), z = Ne(g, S, !!p, f, m, h), P = z[0], V = P.formattedValue, L = P.numAsString, W = z[1], M = T.useRef(), U = T.useRef({ formattedValue: V, numAsString: L }), $ = function(o, u) {
275
+ var k = e.isCharacterSame, j = pe(e, ["type", "displayType", "customInput", "renderText", "getInputRef", "format", "removeFormatting", "defaultValue", "valueIsNumericString", "onValueChange", "isAllowed", "onChange", "onKeyDown", "onMouseUp", "onFocus", "onBlur", "value", "getCaretBoundary", "isValidInputCharacter", "isCharacterSame"]), H = we(g, m, !!p, f, S, h), P = H[0], V = P.formattedValue, M = P.numAsString, W = H[1], L = O.useRef(), U = O.useRef({ formattedValue: V, numAsString: M }), $ = function(o, u) {
267
276
  U.current = { formattedValue: o.formattedValue, numAsString: o.value }, W(o, u);
268
- }, J = T.useState(!1), ee = J[0], d = J[1], l = T.useRef(null), N = T.useRef({
277
+ }, Q = O.useState(!1), te = Q[0], d = Q[1], s = O.useRef(null), N = O.useRef({
269
278
  setCaretTimeout: null,
270
279
  focusTimeout: null
271
280
  });
272
- T.useEffect(function() {
281
+ O.useEffect(function() {
273
282
  return d(!0), function() {
274
283
  clearTimeout(N.current.setCaretTimeout), clearTimeout(N.current.focusTimeout);
275
284
  };
@@ -282,43 +291,43 @@ function He(e) {
282
291
  floatValue: isNaN(v) ? void 0 : v
283
292
  };
284
293
  }, E = function(o, u, v) {
285
- o.selectionStart === 0 && o.selectionEnd === o.value.length || (H(o, u), N.current.setCaretTimeout = setTimeout(function() {
286
- o.value === v && o.selectionStart !== u && H(o, u);
294
+ o.selectionStart === 0 && o.selectionEnd === o.value.length || (J(o, u), N.current.setCaretTimeout = setTimeout(function() {
295
+ o.value === v && o.selectionStart !== u && J(o, u);
287
296
  }, 0));
288
- }, O = function(o, u, v) {
289
- return me(o, u, B(o), v);
290
- }, Q = function(o, u, v) {
297
+ }, T = function(o, u, v) {
298
+ return he(o, u, B(o), v);
299
+ }, X = function(o, u, v) {
291
300
  var w = B(u), _ = Ge(u, V, o, v, w, F, k);
292
- return _ = me(u, _, w), _;
301
+ return _ = he(u, _, w), _;
293
302
  }, oe = function(o) {
294
303
  var u = o.formattedValue;
295
304
  u === void 0 && (u = "");
296
305
  var v = o.input, w = o.source, _ = o.event, D = o.numAsString, b;
297
306
  if (v) {
298
- var K = o.inputValue || v.value, G = ce(v);
299
- v.value = u, b = Q(K, u, G), b !== void 0 && E(v, b, u);
307
+ var K = o.inputValue || v.value, G = se(v);
308
+ v.value = u, b = X(K, u, G), b !== void 0 && E(v, b, u);
300
309
  }
301
310
  u !== V && $(A(u, D), { event: _, source: w });
302
311
  };
303
- T.useEffect(function() {
312
+ O.useEffect(function() {
304
313
  var o = U.current, u = o.formattedValue, v = o.numAsString;
305
- (V !== u || L !== v) && $(A(V, L), {
314
+ (V !== u || M !== v) && $(A(V, M), {
306
315
  event: void 0,
307
- source: re.props
316
+ source: ee.props
308
317
  });
309
- }, [V, L]);
310
- var te = l.current ? ce(l.current) : void 0, ne = typeof window < "u" ? T.useLayoutEffect : T.useEffect;
318
+ }, [V, M]);
319
+ var re = s.current ? se(s.current) : void 0, ne = typeof window < "u" ? O.useLayoutEffect : O.useEffect;
311
320
  ne(function() {
312
- var o = l.current;
321
+ var o = s.current;
313
322
  if (V !== U.current.formattedValue && o) {
314
- var u = Q(U.current.formattedValue, V, te);
323
+ var u = X(U.current.formattedValue, V, re);
315
324
  o.value = V, E(o, u, V);
316
325
  }
317
326
  }, [V]);
318
327
  var ue = function(o, u, v) {
319
- var w = u.target, _ = M.current ? Pe(M.current, w.selectionEnd) : Ve(V, o), D = Object.assign(Object.assign({}, _), { lastValue: V }), b = m(o, D), K = R(b);
320
- if (b = m(K, void 0), c && !c(A(K, b))) {
321
- var G = u.target, Z = ce(G), le = Q(o, V, Z);
328
+ var w = u.target, _ = L.current ? Pe(L.current, w.selectionEnd) : Ne(V, o), D = Object.assign(Object.assign({}, _), { lastValue: V }), b = S(o, D), K = R(b);
329
+ if (b = S(K, void 0), c && !c(A(K, b))) {
330
+ var G = u.target, Z = se(G), le = X(o, V, Z);
322
331
  return G.value = V, E(G, le, V), !1;
323
332
  }
324
333
  return oe({
@@ -332,11 +341,11 @@ function He(e) {
332
341
  }, fe = function(o, u) {
333
342
  u === void 0 && (u = 0);
334
343
  var v = o.selectionStart, w = o.selectionEnd;
335
- M.current = { selectionStart: v, selectionEnd: w + u };
336
- }, De = function(o) {
337
- var u = o.target, v = u.value, w = ue(v, o, re.event);
338
- w && x(o), M.current = void 0;
344
+ L.current = { selectionStart: v, selectionEnd: w + u };
339
345
  }, Ie = function(o) {
346
+ var u = o.target, v = u.value, w = ue(v, o, ee.event);
347
+ w && x(o), L.current = void 0;
348
+ }, Ce = function(o) {
340
349
  var u = o.target, v = o.key, w = u.selectionStart, _ = u.selectionEnd, D = u.value;
341
350
  D === void 0 && (D = "");
342
351
  var b;
@@ -351,58 +360,58 @@ function He(e) {
351
360
  var Z = b;
352
361
  if (G) {
353
362
  var le = v === "ArrowLeft" ? "left" : "right";
354
- Z = O(D, b, le), Z !== b && o.preventDefault();
355
- } else v === "Delete" && !F(D[b]) ? Z = O(D, b, "right") : v === "Backspace" && !F(D[b]) && (Z = O(D, b, "left"));
363
+ Z = T(D, b, le), Z !== b && o.preventDefault();
364
+ } else v === "Delete" && !F(D[b]) ? Z = T(D, b, "right") : v === "Backspace" && !F(D[b]) && (Z = T(D, b, "left"));
356
365
  Z !== b && E(u, Z, D), y(o), fe(u, K);
357
- }, Ce = function(o) {
366
+ }, Ee = function(o) {
358
367
  var u = o.target, v = function() {
359
368
  var w = u.selectionStart, _ = u.selectionEnd, D = u.value;
360
369
  if (D === void 0 && (D = ""), w === _) {
361
- var b = O(D, w);
370
+ var b = T(D, w);
362
371
  b !== w && E(u, b, D);
363
372
  }
364
373
  };
365
374
  v(), requestAnimationFrame(function() {
366
375
  v();
367
- }), s(o), fe(u);
368
- }, Ee = function(o) {
376
+ }), l(o), fe(u);
377
+ }, Re = function(o) {
369
378
  o.persist && o.persist();
370
379
  var u = o.target, v = o.currentTarget;
371
- l.current = u, N.current.focusTimeout = setTimeout(function() {
380
+ s.current = u, N.current.focusTimeout = setTimeout(function() {
372
381
  var w = u.selectionStart, _ = u.selectionEnd, D = u.value;
373
382
  D === void 0 && (D = "");
374
- var b = O(D, w);
383
+ var b = T(D, w);
375
384
  b !== w && !(w === 0 && _ === D.length) && E(u, b, D), I(Object.assign(Object.assign({}, o), { currentTarget: v }));
376
385
  }, 0);
377
- }, Re = function(o) {
378
- l.current = null, clearTimeout(N.current.focusTimeout), clearTimeout(N.current.setCaretTimeout), C(o);
379
- }, Ae = ee && We() ? "numeric" : void 0, ve = Object.assign({ inputMode: Ae }, j, {
386
+ }, Ae = function(o) {
387
+ s.current = null, clearTimeout(N.current.focusTimeout), clearTimeout(N.current.setCaretTimeout), C(o);
388
+ }, Oe = te && We() ? "numeric" : void 0, ve = Object.assign({ inputMode: Oe }, j, {
380
389
  type: t,
381
390
  value: V,
382
- onChange: De,
383
- onKeyDown: Ie,
384
- onMouseUp: Ce,
385
- onFocus: Ee,
386
- onBlur: Re
391
+ onChange: Ie,
392
+ onKeyDown: Ce,
393
+ onMouseUp: Ee,
394
+ onFocus: Re,
395
+ onBlur: Ae
387
396
  });
388
397
  if (r === "text")
389
- return a ? X.createElement(X.Fragment, null, a(V, j) || null) : X.createElement("span", Object.assign({}, j, { ref: i }), V);
398
+ return a ? Y.createElement(Y.Fragment, null, a(V, j) || null) : Y.createElement("span", Object.assign({}, j, { ref: i }), V);
390
399
  if (n) {
391
- var Oe = n;
392
- return X.createElement(Oe, Object.assign({}, ve, { ref: i }));
400
+ var Te = n;
401
+ return Y.createElement(Te, Object.assign({}, ve, { ref: i }));
393
402
  }
394
- return X.createElement("input", Object.assign({}, ve, { ref: i }));
403
+ return Y.createElement("input", Object.assign({}, ve, { ref: i }));
395
404
  }
396
- function he(e, t) {
405
+ function Se(e, t) {
397
406
  var r = t.decimalScale, n = t.fixedDecimalScale, a = t.prefix;
398
407
  a === void 0 && (a = "");
399
408
  var i = t.suffix;
400
409
  i === void 0 && (i = "");
401
- var f = t.allowNegative, m = t.thousandsGroupStyle;
402
- if (m === void 0 && (m = "thousand"), e === "" || e === "-")
410
+ var f = t.allowNegative, S = t.thousandsGroupStyle;
411
+ if (S === void 0 && (S = "thousand"), e === "" || e === "-")
403
412
  return e;
404
- var S = ie(t), p = S.thousandSeparator, h = S.decimalSeparator, c = r !== 0 && e.indexOf(".") !== -1 || r && n, x = se(e, f), y = x.beforeDecimal, s = x.afterDecimal, I = x.addNegation;
405
- return r !== void 0 && (s = ye(s, r, !!n)), p && (y = Le(y, p, m)), a && (y = a + y), i && (s = s + i), I && (y = "-" + y), e = y + (c && h || "") + s, e;
413
+ var m = ie(t), p = m.thousandSeparator, h = m.decimalSeparator, c = r !== 0 && e.indexOf(".") !== -1 || r && n, x = ce(e, f), y = x.beforeDecimal, l = x.afterDecimal, I = x.addNegation;
414
+ return r !== void 0 && (l = be(l, r, !!n)), p && (y = Le(y, p, S)), a && (y = a + y), i && (l = l + i), I && (y = "-" + y), e = y + (c && h || "") + l, e;
406
415
  }
407
416
  function ie(e) {
408
417
  var t = e.decimalSeparator;
@@ -420,7 +429,7 @@ function Je(e, t) {
420
429
  return e = e.replace(/-/g, ""), a && !i && t && (e = "-" + e), e;
421
430
  }
422
431
  function Qe(e, t) {
423
- return new RegExp("(^-)|[0-9]|" + xe(e), "g");
432
+ return new RegExp("(^-)|[0-9]|" + ye(e), "g");
424
433
  }
425
434
  function Xe(e, t, r) {
426
435
  return e === "" ? !0 : !t?.match(/\d/) && !r?.match(/\d/) && typeof e == "string" && !isNaN(Number(e));
@@ -432,32 +441,32 @@ function Ye(e, t, r) {
432
441
  i === void 0 && (i = "");
433
442
  var f = r.suffix;
434
443
  f === void 0 && (f = "");
435
- var m = r.decimalScale, S = t.from, p = t.to, h = p.start, c = p.end, x = ie(r), y = x.allowedDecimalSeparators, s = x.decimalSeparator, I = e[c] === s;
444
+ var S = r.decimalScale, m = t.from, p = t.to, h = p.start, c = p.end, x = ie(r), y = x.allowedDecimalSeparators, l = x.decimalSeparator, I = e[c] === l;
436
445
  if (ae(e) && (e === i || e === f) && t.lastValue === "")
437
446
  return e;
438
447
  if (c - h === 1 && y.indexOf(e[h]) !== -1) {
439
- var C = m === 0 ? "" : s;
448
+ var C = S === 0 ? "" : l;
440
449
  e = e.substring(0, h) + C + e.substring(h + 1, e.length);
441
450
  }
442
- var g = function(l, N, R) {
451
+ var g = function(s, N, R) {
443
452
  var A = !1, E = !1;
444
- i.startsWith("-") ? A = !1 : l.startsWith("--") ? (A = !1, E = !0) : f.startsWith("-") && l.length === f.length ? A = !1 : l[0] === "-" && (A = !0);
445
- var O = A ? 1 : 0;
446
- return E && (O = 2), O && (l = l.substring(O), N -= O, R -= O), { value: l, start: N, end: R, hasNegation: A };
453
+ i.startsWith("-") ? A = !1 : s.startsWith("--") ? (A = !1, E = !0) : f.startsWith("-") && s.length === f.length ? A = !1 : s[0] === "-" && (A = !0);
454
+ var T = A ? 1 : 0;
455
+ return E && (T = 2), T && (s = s.substring(T), N -= T, R -= T), { value: s, start: N, end: R, hasNegation: A };
447
456
  }, B = g(e, h, c), F = B.hasNegation;
448
457
  n = B, e = n.value, h = n.start, c = n.end;
449
- var k = g(t.lastValue, S.start, S.end), j = k.start, z = k.end, P = k.value, V = e.substring(h, c);
450
- e.length && P.length && (j > P.length - f.length || z < i.length) && !(V && f.startsWith(V)) && (e = P);
451
- var L = 0;
452
- e.startsWith(i) ? L += i.length : h < i.length && (L = h), e = e.substring(L), c -= L;
453
- var W = e.length, M = e.length - f.length;
454
- e.endsWith(f) ? W = M : (c > M || c > e.length - f.length) && (W = c), e = e.substring(0, W), e = Je(F ? "-" + e : e, a), e = (e.match(Qe(s)) || []).join("");
455
- var U = e.indexOf(s);
456
- e = e.replace(new RegExp(xe(s), "g"), function(l, N) {
458
+ var k = g(t.lastValue, m.start, m.end), j = k.start, H = k.end, P = k.value, V = e.substring(h, c);
459
+ e.length && P.length && (j > P.length - f.length || H < i.length) && !(V && f.startsWith(V)) && (e = P);
460
+ var M = 0;
461
+ e.startsWith(i) ? M += i.length : h < i.length && (M = h), e = e.substring(M), c -= M;
462
+ var W = e.length, L = e.length - f.length;
463
+ e.endsWith(f) ? W = L : (c > L || c > e.length - f.length) && (W = c), e = e.substring(0, W), e = Je(F ? "-" + e : e, a), e = (e.match(Qe(l)) || []).join("");
464
+ var U = e.indexOf(l);
465
+ e = e.replace(new RegExp(ye(l), "g"), function(s, N) {
457
466
  return N === U ? "." : "";
458
467
  });
459
- var $ = se(e, a), J = $.beforeDecimal, ee = $.afterDecimal, d = $.addNegation;
460
- return p.end - p.start < S.end - S.start && J === "" && I && !parseFloat(ee) && (e = d ? "-" : ""), e;
468
+ var $ = ce(e, a), Q = $.beforeDecimal, te = $.afterDecimal, d = $.addNegation;
469
+ return p.end - p.start < m.end - m.start && Q === "" && I && !parseFloat(te) && (e = d ? "-" : ""), e;
461
470
  }
462
471
  function et(e, t) {
463
472
  var r = t.prefix;
@@ -467,7 +476,7 @@ function et(e, t) {
467
476
  var a = Array.from({ length: e.length + 1 }).map(function() {
468
477
  return !0;
469
478
  }), i = e[0] === "-";
470
- a.fill(!1, 0, r.length + (i ? 1 : 0));
479
+ a.fill(!1, 0, Math.min(r.length + (i ? 1 : 0), e.length));
471
480
  var f = e.length;
472
481
  return a.fill(!1, f - n.length + 1, f + 1), a;
473
482
  }
@@ -493,19 +502,19 @@ function rt(e) {
493
502
  a === void 0 && (a = q);
494
503
  var i = e.onBlur;
495
504
  i === void 0 && (i = q);
496
- var f = e.thousandSeparator, m = e.decimalScale, S = e.fixedDecimalScale, p = e.prefix;
505
+ var f = e.thousandSeparator, S = e.decimalScale, m = e.fixedDecimalScale, p = e.prefix;
497
506
  p === void 0 && (p = "");
498
- var h = e.defaultValue, c = e.value, x = e.valueIsNumericString, y = e.onValueChange, s = Se(e, ["decimalSeparator", "allowedDecimalSeparators", "thousandsGroupStyle", "suffix", "allowNegative", "allowLeadingZeros", "onKeyDown", "onBlur", "thousandSeparator", "decimalScale", "fixedDecimalScale", "prefix", "defaultValue", "value", "valueIsNumericString", "onValueChange"]), I = ie(e), C = I.decimalSeparator, g = I.allowedDecimalSeparators, B = function(d) {
499
- return he(d, e);
500
- }, F = function(d, l) {
501
- return Ye(d, l, e);
502
- }, k = Y(c) ? h : c, j = x ?? Xe(k, p, t);
503
- Y(c) ? Y(h) || (j = j || typeof h == "number") : j = j || typeof c == "number";
504
- var z = function(d) {
505
- return pe(d) ? d : (typeof d == "number" && (d = be(d)), j && typeof m == "number" ? ge(d, m, !!S) : d);
506
- }, P = Ne(z(c), z(h), !!j, B, F, y), V = P[0], L = V.numAsString, W = V.formattedValue, M = P[1], U = function(d) {
507
- var l = d.target, N = d.key, R = l.selectionStart, A = l.selectionEnd, E = l.value;
508
- if (E === void 0 && (E = ""), (N === "Backspace" || N === "Delete") && A < p.length) {
507
+ var h = e.defaultValue, c = e.value, x = e.valueIsNumericString, y = e.onValueChange, l = pe(e, ["decimalSeparator", "allowedDecimalSeparators", "thousandsGroupStyle", "suffix", "allowNegative", "allowLeadingZeros", "onKeyDown", "onBlur", "thousandSeparator", "decimalScale", "fixedDecimalScale", "prefix", "defaultValue", "value", "valueIsNumericString", "onValueChange"]), I = ie(e), C = I.decimalSeparator, g = I.allowedDecimalSeparators, B = function(d) {
508
+ return Se(d, e);
509
+ }, F = function(d, s) {
510
+ return Ye(d, s, e);
511
+ }, k = z(c) ? h : c, j = x ?? Xe(k, p, t);
512
+ z(c) ? z(h) || (j = j || typeof h == "number") : j = j || typeof c == "number";
513
+ var H = function(d) {
514
+ return xe(d) ? d : (typeof d == "number" && (d = Ve(d)), j && typeof S == "number" ? me(d, S, !!m) : d);
515
+ }, P = we(H(c), H(h), !!j, B, F, y), V = P[0], M = V.numAsString, W = V.formattedValue, L = P[1], U = function(d) {
516
+ var s = d.target, N = d.key, R = s.selectionStart, A = s.selectionEnd, E = s.value;
517
+ if (E === void 0 && (E = ""), (N === "Backspace" || N === "Delete") && A < p.length && E !== "-") {
509
518
  d.preventDefault();
510
519
  return;
511
520
  }
@@ -513,37 +522,37 @@ function rt(e) {
513
522
  a(d);
514
523
  return;
515
524
  }
516
- N === "Backspace" && E[0] === "-" && R === p.length + 1 && r && H(l, 1), m && S && (N === "Backspace" && E[R - 1] === C ? (H(l, R - 1), d.preventDefault()) : N === "Delete" && E[R] === C && d.preventDefault()), g?.includes(N) && E[R] === C && H(l, R + 1);
517
- var O = f === !0 ? "," : f;
518
- N === "Backspace" && E[R - 1] === O && H(l, R - 1), N === "Delete" && E[R] === O && H(l, R + 1), a(d);
525
+ N === "Backspace" && E[0] === "-" && R === p.length + 1 && r && J(s, 1), S && m && (N === "Backspace" && E[R - 1] === C ? (J(s, R - 1), d.preventDefault()) : N === "Delete" && E[R] === C && d.preventDefault()), g?.includes(N) && E[R] === C && J(s, R + 1);
526
+ var T = f === !0 ? "," : f;
527
+ N === "Backspace" && E[R - 1] === T && J(s, R - 1), N === "Delete" && E[R] === T && J(s, R + 1), a(d);
519
528
  }, $ = function(d) {
520
- var l = L;
521
- if (l.match(/\d/g) || (l = ""), n || (l = ke(l)), S && m && (l = ge(l, m, S)), l !== L) {
522
- var N = he(l, e);
523
- M({
529
+ var s = M;
530
+ if (s.match(/\d/g) || (s = ""), n || (s = ke(s)), m && S && (s = me(s, S, m)), s !== M) {
531
+ var N = Se(s, e);
532
+ L({
524
533
  formattedValue: N,
525
- value: l,
526
- floatValue: parseFloat(l)
534
+ value: s,
535
+ floatValue: parseFloat(s)
527
536
  }, {
528
537
  event: d,
529
- source: re.event
538
+ source: ee.event
530
539
  });
531
540
  }
532
541
  i(d);
533
- }, J = function(d) {
542
+ }, Q = function(d) {
534
543
  return d === C ? !0 : ae(d);
535
- }, ee = function(d) {
536
- var l = d.currentValue, N = d.lastValue, R = d.formattedValue, A = d.currentValueIndex, E = d.formattedValueIndex, O = l[A], Q = R[E], oe = Ve(N, l), te = oe.to, ne = function(ue) {
544
+ }, te = function(d) {
545
+ var s = d.currentValue, N = d.lastValue, R = d.formattedValue, A = d.currentValueIndex, E = d.formattedValueIndex, T = s[A], X = R[E], oe = Ne(N, s), re = oe.to, ne = function(ue) {
537
546
  return F(ue).indexOf(".") + p.length;
538
547
  };
539
- return c === 0 && S && m && l[te.start] === C && ne(l) < A && ne(R) > E ? !1 : A >= te.start && A < te.end && g && g.includes(O) && Q === C ? !0 : O === Q;
548
+ return c === 0 && m && S && s[re.start] === C && ne(s) < A && ne(R) > E ? !1 : A >= re.start && A < re.end && g && g.includes(T) && X === C ? !0 : T === X;
540
549
  };
541
- return Object.assign(Object.assign({}, s), {
550
+ return Object.assign(Object.assign({}, l), {
542
551
  value: W,
543
552
  valueIsNumericString: !1,
544
- isValidInputCharacter: J,
545
- isCharacterSame: ee,
546
- onValueChange: M,
553
+ isValidInputCharacter: Q,
554
+ isCharacterSame: te,
555
+ onValueChange: L,
547
556
  format: B,
548
557
  removeFormatting: F,
549
558
  getCaretBoundary: function(d) {
@@ -555,34 +564,34 @@ function rt(e) {
555
564
  }
556
565
  function at(e) {
557
566
  var t = rt(e);
558
- return X.createElement(He, Object.assign({}, t));
567
+ return Y.createElement(He, Object.assign({}, t));
559
568
  }
560
- function we() {
569
+ function De() {
561
570
  return Intl.NumberFormat()?.formatToParts(1.1)?.find((r) => r.type === "decimal")?.value ?? ".";
562
571
  }
563
572
  function nt() {
564
- return we() === "." ? "," : ".";
573
+ return De() === "." ? "," : ".";
565
574
  }
566
575
  const ot = (e) => {
567
- const { value: t, onChange: r, disabled: n, highlight: a, validatedSelection: i, fixedDecimals: f, allowNegative: m, thousandSeparator: S, decimalSeparator: p } = e, h = T.useRef();
568
- return T.useLayoutEffect(() => {
576
+ const { value: t, onChange: r, disabled: n, highlight: a, validatedSelection: i, fixedDecimals: f, allowNegative: S, thousandSeparator: m, decimalSeparator: p } = e, h = O.useRef();
577
+ return O.useLayoutEffect(() => {
569
578
  if (i !== void 0) {
570
579
  const c = typeof i == "number" ? [i, null] : i;
571
580
  h.current?.setSelectionRange(c[0], c[1]);
572
581
  }
573
- }, [i]), T.createElement(
574
- Be,
582
+ }, [i]), O.createElement(
583
+ Fe,
575
584
  null,
576
- T.createElement(at, {
585
+ O.createElement(at, {
577
586
  autoFocus: !0,
578
587
  getInputRef: h,
579
588
  className: "gdg-input",
580
589
  onFocus: (c) => c.target.setSelectionRange(a ? 0 : c.target.value.length, c.target.value.length),
581
590
  disabled: n === !0,
582
591
  decimalScale: f,
583
- allowNegative: m,
584
- thousandSeparator: S ?? nt(),
585
- decimalSeparator: p ?? we(),
592
+ allowNegative: S,
593
+ thousandSeparator: m ?? nt(),
594
+ decimalSeparator: p ?? De(),
586
595
  value: Object.is(t, -0) ? "-" : t ?? "",
587
596
  // decimalScale={3}
588
597
  // prefix={"$"}