lizaui 6.0.5 → 6.0.6
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,5 +1,5 @@
|
|
|
1
1
|
import { j as c } from "../chunks/jsx-runtime-Cl_4eDuT.js";
|
|
2
|
-
import { useState as w, useRef as
|
|
2
|
+
import { useState as w, useRef as mt, useId as qe, useEffect as tt } from "react";
|
|
3
3
|
import { twMerge as k } from "../chunks/bundle-mjs-BcJXDvon.js";
|
|
4
4
|
import { c as ze } from "../chunks/utils-BFAOD39w.js";
|
|
5
5
|
import "../chunks/textarea-ClUh9LtQ.js";
|
|
@@ -567,27 +567,27 @@ function Kt(t, e) {
|
|
|
567
567
|
return n;
|
|
568
568
|
}
|
|
569
569
|
var br = ["MOBILE", "PREMIUM_RATE", "TOLL_FREE", "SHARED_COST", "VOIP", "PERSONAL_NUMBER", "PAGER", "UAN", "VOICEMAIL"];
|
|
570
|
-
function
|
|
570
|
+
function Ft(t, e, r) {
|
|
571
571
|
if (e = e || {}, !(!t.country && !t.countryCallingCode)) {
|
|
572
572
|
r = new y(r), r.selectNumberingPlan(t.country, t.countryCallingCode);
|
|
573
573
|
var n = e.v2 ? t.nationalNumber : t.phone;
|
|
574
574
|
if (E(n, r.nationalNumberPattern())) {
|
|
575
|
-
if (
|
|
576
|
-
return r.type("MOBILE") && r.type("MOBILE").pattern() === "" || !r.type("MOBILE") ||
|
|
575
|
+
if (gt(n, "FIXED_LINE", r))
|
|
576
|
+
return r.type("MOBILE") && r.type("MOBILE").pattern() === "" || !r.type("MOBILE") || gt(n, "MOBILE", r) ? "FIXED_LINE_OR_MOBILE" : "FIXED_LINE";
|
|
577
577
|
for (var d = pr(br), i; !(i = d()).done; ) {
|
|
578
578
|
var a = i.value;
|
|
579
|
-
if (
|
|
579
|
+
if (gt(n, a, r))
|
|
580
580
|
return a;
|
|
581
581
|
}
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
584
|
}
|
|
585
|
-
function
|
|
585
|
+
function gt(t, e, r) {
|
|
586
586
|
return e = r.type(e), !e || !e.pattern() || e.possibleLengths() && e.possibleLengths().indexOf(t.length) < 0 ? !1 : E(t, e.pattern());
|
|
587
587
|
}
|
|
588
588
|
function Nr(t, e, r) {
|
|
589
589
|
if (e = e || {}, r = new y(r), r.selectNumberingPlan(t.country, t.countryCallingCode), r.hasTypes())
|
|
590
|
-
return
|
|
590
|
+
return Ft(t, e, r.metadata) !== void 0;
|
|
591
591
|
var n = e.v2 ? t.nationalNumber : t.phone;
|
|
592
592
|
return E(n, r.nationalNumberPattern());
|
|
593
593
|
}
|
|
@@ -601,7 +601,7 @@ function Pr(t, e, r) {
|
|
|
601
601
|
var n = new y(r);
|
|
602
602
|
return n.selectNumberingPlan(e), n.numberingPlan.possibleLengths().indexOf(t.length) >= 0;
|
|
603
603
|
}
|
|
604
|
-
var
|
|
604
|
+
var At = 2, Sr = 17, xr = 3, p = "0-90-9٠-٩۰-۹", Er = "-‐-―−ー-", wr = "//", _r = "..", Fr = " ", Ar = "()()[]\\[\\]", Tr = "~⁓∼~", P = "".concat(Er).concat(wr).concat(_r).concat(Fr).concat(Ar).concat(Tr), $t = "++", Ir = new RegExp("([" + p + "])");
|
|
605
605
|
function Ae(t, e, r, n) {
|
|
606
606
|
if (e) {
|
|
607
607
|
var d = new y(n);
|
|
@@ -615,7 +615,7 @@ function Ae(t, e, r, n) {
|
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
|
-
function
|
|
618
|
+
function Nt(t, e) {
|
|
619
619
|
if (t && e.numberingPlan.nationalPrefixForParsing()) {
|
|
620
620
|
var r = new RegExp("^(?:" + e.numberingPlan.nationalPrefixForParsing() + ")"), n = r.exec(t);
|
|
621
621
|
if (n) {
|
|
@@ -643,8 +643,8 @@ function bt(t, e) {
|
|
|
643
643
|
nationalNumber: t
|
|
644
644
|
};
|
|
645
645
|
}
|
|
646
|
-
function
|
|
647
|
-
var r =
|
|
646
|
+
function Ct(t, e) {
|
|
647
|
+
var r = Nt(t, e), n = r.carrierCode, d = r.nationalNumber;
|
|
648
648
|
if (d !== t) {
|
|
649
649
|
if (!Or(t, d, e))
|
|
650
650
|
return {
|
|
@@ -676,7 +676,7 @@ function Te(t, e, r, n) {
|
|
|
676
676
|
var d = e ? ot(e, n) : r;
|
|
677
677
|
if (t.indexOf(d) === 0) {
|
|
678
678
|
n = new y(n), n.selectNumberingPlan(e, r);
|
|
679
|
-
var i = t.slice(d.length), a =
|
|
679
|
+
var i = t.slice(d.length), a = Ct(i, n), o = a.nationalNumber, u = Ct(t, n), $ = u.nationalNumber;
|
|
680
680
|
if (!E($, n.nationalNumberPattern()) && E(o, n.nationalNumberPattern()) || ut($, n) === "TOO_LONG")
|
|
681
681
|
return {
|
|
682
682
|
countryCallingCode: d,
|
|
@@ -687,7 +687,7 @@ function Te(t, e, r, n) {
|
|
|
687
687
|
number: t
|
|
688
688
|
};
|
|
689
689
|
}
|
|
690
|
-
function
|
|
690
|
+
function Tt(t, e, r, n) {
|
|
691
691
|
if (!t)
|
|
692
692
|
return {};
|
|
693
693
|
var d;
|
|
@@ -764,17 +764,17 @@ var Mr = ";ext=", O = function(e) {
|
|
|
764
764
|
return "([".concat(p, "]{1,").concat(e, "})");
|
|
765
765
|
};
|
|
766
766
|
function De(t) {
|
|
767
|
-
var e = "20", r = "15", n = "9", d = "6", i = "[ \\t,]*", a = "[:\\..]?[ \\t,-]*", o = "#?", u = "(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)", $ = "(?:[xx##~~]|int|int)", l = "[- ]+", h = "[ \\t]*", f = "(?:,{2}|;)", m = Mr + O(e),
|
|
768
|
-
return m + "|" +
|
|
767
|
+
var e = "20", r = "15", n = "9", d = "6", i = "[ \\t,]*", a = "[:\\..]?[ \\t,-]*", o = "#?", u = "(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)", $ = "(?:[xx##~~]|int|int)", l = "[- ]+", h = "[ \\t]*", f = "(?:,{2}|;)", m = Mr + O(e), v = i + u + a + O(e) + o, b = i + $ + a + O(n) + o, N = l + O(d) + "#", A = h + f + a + O(r) + o, L = h + "(?:,)+" + a + O(n) + o;
|
|
768
|
+
return m + "|" + v + "|" + b + "|" + N + "|" + A + "|" + L;
|
|
769
769
|
}
|
|
770
|
-
var jr = "[" + p + "]{" +
|
|
770
|
+
var jr = "[" + p + "]{" + At + "}", kr = "[" + $t + "]{0,1}(?:[" + P + "]*[" + p + "]){3,}[" + P + p + "]*", Gr = new RegExp("^[" + $t + "]{0,1}(?:[" + P + "]*[" + p + "]){1,2}$", "i"), Br = kr + // Phone number extensions
|
|
771
771
|
"(?:" + De() + ")?", Ur = new RegExp(
|
|
772
772
|
// Either a short two-digit-only phone number
|
|
773
773
|
"^" + jr + "$|^" + Br + "$",
|
|
774
774
|
"i"
|
|
775
775
|
);
|
|
776
776
|
function Hr(t) {
|
|
777
|
-
return t.length >=
|
|
777
|
+
return t.length >= At && Ur.test(t);
|
|
778
778
|
}
|
|
779
779
|
function Wr(t) {
|
|
780
780
|
return Gr.test(t);
|
|
@@ -874,9 +874,9 @@ function Qr(t, e, r, n) {
|
|
|
874
874
|
var d = n.countryCallingCode(), i = r.v2 ? t.nationalNumber : t.phone, a;
|
|
875
875
|
switch (e) {
|
|
876
876
|
case "NATIONAL":
|
|
877
|
-
return i ? (a = nt(i, t.carrierCode, "NATIONAL", n, r),
|
|
877
|
+
return i ? (a = nt(i, t.carrierCode, "NATIONAL", n, r), yt(a, t.ext, n, r.formatExtension)) : "";
|
|
878
878
|
case "INTERNATIONAL":
|
|
879
|
-
return i ? (a = nt(i, null, "INTERNATIONAL", n, r), a = "+".concat(d, " ").concat(a),
|
|
879
|
+
return i ? (a = nt(i, null, "INTERNATIONAL", n, r), a = "+".concat(d, " ").concat(a), yt(a, t.ext, n, r.formatExtension)) : "+".concat(d);
|
|
880
880
|
case "E.164":
|
|
881
881
|
return "+".concat(d).concat(i);
|
|
882
882
|
case "RFC3966":
|
|
@@ -892,7 +892,7 @@ function Qr(t, e, r, n) {
|
|
|
892
892
|
if (!r.fromCountry)
|
|
893
893
|
return;
|
|
894
894
|
var o = zr(i, t.carrierCode, d, r.fromCountry, n);
|
|
895
|
-
return
|
|
895
|
+
return yt(o, t.ext, n, r.formatExtension);
|
|
896
896
|
default:
|
|
897
897
|
throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(e, '"'));
|
|
898
898
|
}
|
|
@@ -918,7 +918,7 @@ function qr(t, e) {
|
|
|
918
918
|
return d;
|
|
919
919
|
}
|
|
920
920
|
}
|
|
921
|
-
function
|
|
921
|
+
function yt(t, e, r, n) {
|
|
922
922
|
return e ? n(t, e, r) : t;
|
|
923
923
|
}
|
|
924
924
|
function zr(t, e, r, n, d) {
|
|
@@ -1002,7 +1002,7 @@ var Me = /* @__PURE__ */ (function() {
|
|
|
1002
1002
|
var d = e;
|
|
1003
1003
|
if (!un.test(d))
|
|
1004
1004
|
throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');
|
|
1005
|
-
var i =
|
|
1005
|
+
var i = Tt(d, void 0, void 0, n), a = i.countryCallingCode, o = i.number;
|
|
1006
1006
|
if (r = o, e = a, !r)
|
|
1007
1007
|
throw new Error("Invalid `number` argument passed: too short");
|
|
1008
1008
|
}
|
|
@@ -1068,7 +1068,7 @@ var Me = /* @__PURE__ */ (function() {
|
|
|
1068
1068
|
}, {
|
|
1069
1069
|
key: "getType",
|
|
1070
1070
|
value: function() {
|
|
1071
|
-
return
|
|
1071
|
+
return Ft(this, {
|
|
1072
1072
|
v2: !0
|
|
1073
1073
|
}, this.getMetadata());
|
|
1074
1074
|
}
|
|
@@ -1108,13 +1108,13 @@ function on(t, e) {
|
|
|
1108
1108
|
};
|
|
1109
1109
|
}
|
|
1110
1110
|
var un = /^\+\d+$/;
|
|
1111
|
-
function
|
|
1111
|
+
function Pt(t) {
|
|
1112
1112
|
"@babel/helpers - typeof";
|
|
1113
|
-
return
|
|
1113
|
+
return Pt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
1114
1114
|
return typeof e;
|
|
1115
1115
|
} : function(e) {
|
|
1116
1116
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
1117
|
-
},
|
|
1117
|
+
}, Pt(t);
|
|
1118
1118
|
}
|
|
1119
1119
|
function $n(t, e, r) {
|
|
1120
1120
|
return Object.defineProperty(t, "prototype", { writable: !1 }), t;
|
|
@@ -1123,10 +1123,10 @@ function ln(t, e) {
|
|
|
1123
1123
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
1124
1124
|
}
|
|
1125
1125
|
function sn(t, e, r) {
|
|
1126
|
-
return e = H(e), fn(t,
|
|
1126
|
+
return e = H(e), fn(t, It() ? Reflect.construct(e, r || [], H(t).constructor) : e.apply(t, r));
|
|
1127
1127
|
}
|
|
1128
1128
|
function fn(t, e) {
|
|
1129
|
-
if (e && (
|
|
1129
|
+
if (e && (Pt(e) == "object" || typeof e == "function")) return e;
|
|
1130
1130
|
if (e !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
|
|
1131
1131
|
return cn(t);
|
|
1132
1132
|
}
|
|
@@ -1138,9 +1138,9 @@ function hn(t, e) {
|
|
|
1138
1138
|
if (typeof e != "function" && e !== null) throw new TypeError("Super expression must either be null or a function");
|
|
1139
1139
|
t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && U(t, e);
|
|
1140
1140
|
}
|
|
1141
|
-
function
|
|
1141
|
+
function St(t) {
|
|
1142
1142
|
var e = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
1143
|
-
return
|
|
1143
|
+
return St = function(n) {
|
|
1144
1144
|
if (n === null || !gn(n)) return n;
|
|
1145
1145
|
if (typeof n != "function") throw new TypeError("Super expression must either be null or a function");
|
|
1146
1146
|
if (e !== void 0) {
|
|
@@ -1151,22 +1151,22 @@ function Pt(t) {
|
|
|
1151
1151
|
return mn(n, arguments, H(this).constructor);
|
|
1152
1152
|
}
|
|
1153
1153
|
return d.prototype = Object.create(n.prototype, { constructor: { value: d, enumerable: !1, writable: !0, configurable: !0 } }), U(d, n);
|
|
1154
|
-
},
|
|
1154
|
+
}, St(t);
|
|
1155
1155
|
}
|
|
1156
1156
|
function mn(t, e, r) {
|
|
1157
|
-
if (
|
|
1157
|
+
if (It()) return Reflect.construct.apply(null, arguments);
|
|
1158
1158
|
var n = [null];
|
|
1159
1159
|
n.push.apply(n, e);
|
|
1160
1160
|
var d = new (t.bind.apply(t, n))();
|
|
1161
1161
|
return r && U(d, r.prototype), d;
|
|
1162
1162
|
}
|
|
1163
|
-
function
|
|
1163
|
+
function It() {
|
|
1164
1164
|
try {
|
|
1165
1165
|
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
1166
1166
|
}));
|
|
1167
1167
|
} catch {
|
|
1168
1168
|
}
|
|
1169
|
-
return (
|
|
1169
|
+
return (It = function() {
|
|
1170
1170
|
return !!t;
|
|
1171
1171
|
})();
|
|
1172
1172
|
}
|
|
@@ -1193,7 +1193,7 @@ var x = /* @__PURE__ */ (function(t) {
|
|
|
1193
1193
|
return ln(this, e), n = sn(this, e, [r]), Object.setPrototypeOf(n, e.prototype), n.name = n.constructor.name, n;
|
|
1194
1194
|
}
|
|
1195
1195
|
return hn(e, t), $n(e);
|
|
1196
|
-
})(/* @__PURE__ */
|
|
1196
|
+
})(/* @__PURE__ */ St(Error)), zt = new RegExp("(?:" + De() + ")$", "i");
|
|
1197
1197
|
function yn(t) {
|
|
1198
1198
|
var e = t.search(zt);
|
|
1199
1199
|
if (e < 0)
|
|
@@ -1384,7 +1384,7 @@ function ke(t, e) {
|
|
|
1384
1384
|
if (n.country(a), n.leadingDigits()) {
|
|
1385
1385
|
if (t && t.search(n.leadingDigits()) === 0)
|
|
1386
1386
|
return a;
|
|
1387
|
-
} else if (
|
|
1387
|
+
} else if (Ft({
|
|
1388
1388
|
phone: t,
|
|
1389
1389
|
country: a
|
|
1390
1390
|
}, void 0, n.metadata))
|
|
@@ -1400,12 +1400,12 @@ function Ge(t, e) {
|
|
|
1400
1400
|
metadata: d.metadata
|
|
1401
1401
|
});
|
|
1402
1402
|
}
|
|
1403
|
-
var Be = "+", En = "[\\-\\.\\(\\)]?", de = "([" + p + "]|" + En + ")", wn = "^\\" + Be + de + "*[" + p + "]" + de + "*$", _n = new RegExp(wn, "g"),
|
|
1403
|
+
var Be = "+", En = "[\\-\\.\\(\\)]?", de = "([" + p + "]|" + En + ")", wn = "^\\" + Be + de + "*[" + p + "]" + de + "*$", _n = new RegExp(wn, "g"), xt = p, Fn = "[" + xt + "]+((\\-)*[" + xt + "])*", An = "a-zA-Z", Tn = "[" + An + "]+((\\-)*[" + xt + "])*", In = "^(" + Fn + "\\.)*" + Tn + "\\.?$", On = new RegExp(In, "g"), ie = "tel:", Et = ";phone-context=", Rn = ";isub=";
|
|
1404
1404
|
function Dn(t) {
|
|
1405
|
-
var e = t.indexOf(
|
|
1405
|
+
var e = t.indexOf(Et);
|
|
1406
1406
|
if (e < 0)
|
|
1407
1407
|
return null;
|
|
1408
|
-
var r = e +
|
|
1408
|
+
var r = e + Et.length;
|
|
1409
1409
|
if (r >= t.length)
|
|
1410
1410
|
return "";
|
|
1411
1411
|
var n = t.indexOf(";", r);
|
|
@@ -1425,7 +1425,7 @@ function Mn(t, e) {
|
|
|
1425
1425
|
d = "", n.charAt(0) === Be && (d += n);
|
|
1426
1426
|
var i = t.indexOf(ie), a;
|
|
1427
1427
|
i >= 0 ? a = i + ie.length : a = 0;
|
|
1428
|
-
var o = t.indexOf(
|
|
1428
|
+
var o = t.indexOf(Et);
|
|
1429
1429
|
d += t.substring(a, o);
|
|
1430
1430
|
}
|
|
1431
1431
|
var u = d.indexOf(Rn);
|
|
@@ -1448,7 +1448,7 @@ function Bn(t, e, r) {
|
|
|
1448
1448
|
throw new x("INVALID_COUNTRY");
|
|
1449
1449
|
return {};
|
|
1450
1450
|
}
|
|
1451
|
-
if (!$ || $.length <
|
|
1451
|
+
if (!$ || $.length < At) {
|
|
1452
1452
|
if (e.v2)
|
|
1453
1453
|
throw new x("TOO_SHORT");
|
|
1454
1454
|
return {};
|
|
@@ -1462,16 +1462,16 @@ function Bn(t, e, r) {
|
|
|
1462
1462
|
var m = new Me(l, $, r.metadata);
|
|
1463
1463
|
return u && (m.country = u), f && (m.carrierCode = f), i && (m.ext = i), m.__countryCallingCodeSource = h, m;
|
|
1464
1464
|
}
|
|
1465
|
-
var
|
|
1465
|
+
var v = (e.extended ? r.hasSelectedNumberingPlan() : u) ? E($, r.nationalNumberPattern()) : !1;
|
|
1466
1466
|
return e.extended ? {
|
|
1467
1467
|
country: u,
|
|
1468
1468
|
countryCallingCode: l,
|
|
1469
1469
|
carrierCode: f,
|
|
1470
|
-
valid:
|
|
1471
|
-
possible:
|
|
1470
|
+
valid: v,
|
|
1471
|
+
possible: v ? !0 : !!(e.extended === !0 && r.possibleLengths() && Fe($, r)),
|
|
1472
1472
|
phone: $,
|
|
1473
1473
|
ext: i
|
|
1474
|
-
} :
|
|
1474
|
+
} : v ? Wn(u, $, i) : {};
|
|
1475
1475
|
}
|
|
1476
1476
|
function Un(t, e, r) {
|
|
1477
1477
|
if (t) {
|
|
@@ -1512,7 +1512,7 @@ function Wn(t, e, r) {
|
|
|
1512
1512
|
return r && (n.ext = r), n;
|
|
1513
1513
|
}
|
|
1514
1514
|
function Vn(t, e, r, n) {
|
|
1515
|
-
var d =
|
|
1515
|
+
var d = Tt(re(t), e, r, n.metadata), i = d.countryCallingCodeSource, a = d.countryCallingCode, o = d.number, u;
|
|
1516
1516
|
if (a)
|
|
1517
1517
|
n.selectNumberingPlan(a);
|
|
1518
1518
|
else if (o && (e || r))
|
|
@@ -1523,7 +1523,7 @@ function Vn(t, e, r, n) {
|
|
|
1523
1523
|
countryCallingCodeSource: i,
|
|
1524
1524
|
countryCallingCode: a
|
|
1525
1525
|
};
|
|
1526
|
-
var $ =
|
|
1526
|
+
var $ = Ct(re(o), n), l = $.nationalNumber, h = $.carrierCode, f = Ge(a, {
|
|
1527
1527
|
nationalNumber: l,
|
|
1528
1528
|
defaultCountry: e,
|
|
1529
1529
|
metadata: n
|
|
@@ -1933,7 +1933,7 @@ function he(t, e) {
|
|
|
1933
1933
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
1934
1934
|
return n;
|
|
1935
1935
|
}
|
|
1936
|
-
var C = "x",
|
|
1936
|
+
var C = "x", pt = new RegExp(C);
|
|
1937
1937
|
function rt(t, e) {
|
|
1938
1938
|
if (e < 1)
|
|
1939
1939
|
return "";
|
|
@@ -1958,9 +1958,9 @@ function Cd(t) {
|
|
|
1958
1958
|
function Pd(t, e, r) {
|
|
1959
1959
|
for (var n = bd(r.split("")), d; !(d = n()).done; ) {
|
|
1960
1960
|
var i = d.value;
|
|
1961
|
-
if (t.slice(e + 1).search(
|
|
1961
|
+
if (t.slice(e + 1).search(pt) < 0)
|
|
1962
1962
|
return;
|
|
1963
|
-
e = t.search(
|
|
1963
|
+
e = t.search(pt), t = t.replace(pt, i);
|
|
1964
1964
|
}
|
|
1965
1965
|
return [t, e];
|
|
1966
1966
|
}
|
|
@@ -2056,7 +2056,7 @@ var Od = /* @__PURE__ */ (function() {
|
|
|
2056
2056
|
if (d)
|
|
2057
2057
|
return {
|
|
2058
2058
|
op: "|",
|
|
2059
|
-
args: d.concat([
|
|
2059
|
+
args: d.concat([vt(i)])
|
|
2060
2060
|
};
|
|
2061
2061
|
if (i.length === 0)
|
|
2062
2062
|
throw new Error("Pattern is required");
|
|
@@ -2104,7 +2104,7 @@ var Od = /* @__PURE__ */ (function() {
|
|
|
2104
2104
|
if (i && this.parsePattern(i), this.getContext().instructions.length === 0)
|
|
2105
2105
|
throw new Error('No instructions found after "|" operator in an "or" group');
|
|
2106
2106
|
var o = this.getContext(), u = o.branches;
|
|
2107
|
-
u.push(
|
|
2107
|
+
u.push(vt(this.getContext().instructions)), this.endContext(), this.getContext().instructions.push({
|
|
2108
2108
|
op: "|",
|
|
2109
2109
|
args: u
|
|
2110
2110
|
});
|
|
@@ -2117,7 +2117,7 @@ var Od = /* @__PURE__ */ (function() {
|
|
|
2117
2117
|
this.getContext().branches = [];
|
|
2118
2118
|
else
|
|
2119
2119
|
throw new Error('"branches" not found in an "or" group context');
|
|
2120
|
-
this.getContext().branches.push(
|
|
2120
|
+
this.getContext().branches.push(vt(this.getContext().instructions)), this.getContext().instructions = [];
|
|
2121
2121
|
break;
|
|
2122
2122
|
case "[":
|
|
2123
2123
|
i && this.parsePattern(i), this.startContext({
|
|
@@ -2157,7 +2157,7 @@ var Dd = /[\(\)\[\]\?\:\|]/, Ld = new RegExp(
|
|
|
2157
2157
|
// any of:
|
|
2158
2158
|
"(\\||\\(\\?\\:|\\)|\\[|\\])"
|
|
2159
2159
|
);
|
|
2160
|
-
function
|
|
2160
|
+
function vt(t) {
|
|
2161
2161
|
return t.length === 1 ? t[0] : t;
|
|
2162
2162
|
}
|
|
2163
2163
|
function ye(t, e) {
|
|
@@ -2229,13 +2229,13 @@ var Hd = /* @__PURE__ */ (function() {
|
|
|
2229
2229
|
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, d = n.allowOverflow;
|
|
2230
2230
|
if (!r)
|
|
2231
2231
|
throw new Error("String is required");
|
|
2232
|
-
var i =
|
|
2232
|
+
var i = wt(r.split(""), this.matchTree, !0);
|
|
2233
2233
|
if (i && i.match && delete i.matchedChars, !(i && i.overflow && !d))
|
|
2234
2234
|
return i;
|
|
2235
2235
|
}
|
|
2236
2236
|
}]);
|
|
2237
2237
|
})();
|
|
2238
|
-
function
|
|
2238
|
+
function wt(t, e, r) {
|
|
2239
2239
|
if (typeof e == "string") {
|
|
2240
2240
|
var n = t.join("");
|
|
2241
2241
|
return e.indexOf(n) === 0 ? t.length === e.length ? {
|
|
@@ -2253,7 +2253,7 @@ function Et(t, e, r) {
|
|
|
2253
2253
|
}
|
|
2254
2254
|
if (Array.isArray(e)) {
|
|
2255
2255
|
for (var d = t.slice(), i = 0; i < e.length; ) {
|
|
2256
|
-
var a = e[i], o =
|
|
2256
|
+
var a = e[i], o = wt(d, a, r && i === e.length - 1);
|
|
2257
2257
|
if (o) {
|
|
2258
2258
|
if (o.overflow)
|
|
2259
2259
|
return o;
|
|
@@ -2288,7 +2288,7 @@ function Et(t, e, r) {
|
|
|
2288
2288
|
switch (e.op) {
|
|
2289
2289
|
case "|":
|
|
2290
2290
|
for (var u, $ = ye(e.args), l; !(l = $()).done; ) {
|
|
2291
|
-
var h = l.value, f =
|
|
2291
|
+
var h = l.value, f = wt(t, h, r);
|
|
2292
2292
|
if (f) {
|
|
2293
2293
|
if (f.overflow)
|
|
2294
2294
|
return f;
|
|
@@ -2309,9 +2309,9 @@ function Et(t, e, r) {
|
|
|
2309
2309
|
// matchedChars: ...
|
|
2310
2310
|
} : void 0;
|
|
2311
2311
|
case "[]":
|
|
2312
|
-
for (var m = ye(e.args),
|
|
2313
|
-
var
|
|
2314
|
-
if (t[0] ===
|
|
2312
|
+
for (var m = ye(e.args), v; !(v = m()).done; ) {
|
|
2313
|
+
var b = v.value;
|
|
2314
|
+
if (t[0] === b)
|
|
2315
2315
|
return t.length === 1 ? {
|
|
2316
2316
|
match: !0,
|
|
2317
2317
|
matchedChars: t
|
|
@@ -2319,7 +2319,7 @@ function Et(t, e, r) {
|
|
|
2319
2319
|
overflow: !0
|
|
2320
2320
|
} : {
|
|
2321
2321
|
match: !0,
|
|
2322
|
-
matchedChars: [
|
|
2322
|
+
matchedChars: [b]
|
|
2323
2323
|
};
|
|
2324
2324
|
}
|
|
2325
2325
|
return;
|
|
@@ -2387,7 +2387,7 @@ function Zd(t, e) {
|
|
|
2387
2387
|
}
|
|
2388
2388
|
return String(t);
|
|
2389
2389
|
}
|
|
2390
|
-
var
|
|
2390
|
+
var _t = "9", Jd = 15, Qd = rt(_t, Jd), qd = /[- ]/, zd = function() {
|
|
2391
2391
|
return /\[([^\[\]])*\]/g;
|
|
2392
2392
|
}, ti = function() {
|
|
2393
2393
|
return /\d(?=[^,}][^,}])/g;
|
|
@@ -2543,19 +2543,19 @@ var wt = "9", Jd = 15, Qd = rt(wt, Jd), qd = /[- ]/, zd = function() {
|
|
|
2543
2543
|
u = u.replace(zd(), "\\d").replace(ti(), "\\d");
|
|
2544
2544
|
var $ = Qd.match(u)[0];
|
|
2545
2545
|
if (!(d.length > $.length)) {
|
|
2546
|
-
var l = new RegExp("^" + u + "$"), h = d.replace(/\d/g,
|
|
2546
|
+
var l = new RegExp("^" + u + "$"), h = d.replace(/\d/g, _t);
|
|
2547
2547
|
l.test(h) && ($ = h);
|
|
2548
2548
|
var f = this.getFormatFormat(r, i), m;
|
|
2549
2549
|
if (this.shouldTryNationalPrefixFormattingRule(r, {
|
|
2550
2550
|
international: i,
|
|
2551
2551
|
nationalPrefix: a
|
|
2552
2552
|
})) {
|
|
2553
|
-
var
|
|
2554
|
-
if (dt(r.nationalPrefixFormattingRule()) === (a || "") + dt("$1") && (f =
|
|
2555
|
-
for (var
|
|
2556
|
-
f = f.replace(/\d/, C),
|
|
2553
|
+
var v = f.replace(Oe, r.nationalPrefixFormattingRule());
|
|
2554
|
+
if (dt(r.nationalPrefixFormattingRule()) === (a || "") + dt("$1") && (f = v, m = !0, a))
|
|
2555
|
+
for (var b = a.length; b > 0; )
|
|
2556
|
+
f = f.replace(/\d/, C), b--;
|
|
2557
2557
|
}
|
|
2558
|
-
var N = $.replace(new RegExp(u), f).replace(new RegExp(
|
|
2558
|
+
var N = $.replace(new RegExp(u), f).replace(new RegExp(_t, "g"), C);
|
|
2559
2559
|
return m || (o ? N = rt(C, o.length) + " " + N : a && (N = rt(C, a.length) + this.getSeparatorAfterNationalPrefix(r) + N)), i && (N = Ie(N)), N;
|
|
2560
2560
|
}
|
|
2561
2561
|
}
|
|
@@ -2698,7 +2698,7 @@ var fi = "[" + P + p + "]+", ci = new RegExp("^" + fi + "$", "i"), hi = "(?:[" +
|
|
|
2698
2698
|
}, {
|
|
2699
2699
|
key: "extractCountryCallingCode",
|
|
2700
2700
|
value: function(r) {
|
|
2701
|
-
var n =
|
|
2701
|
+
var n = Tt("+" + r.getDigitsWithoutInternationalPrefix(), this.defaultCountry, this.defaultCallingCode, this.metadata.metadata), d = n.countryCallingCode, i = n.number;
|
|
2702
2702
|
if (d)
|
|
2703
2703
|
return r.setCallingCode(d), r.update({
|
|
2704
2704
|
nationalSignificantNumber: i
|
|
@@ -2725,7 +2725,7 @@ var fi = "[" + P + p + "]+", ci = new RegExp("^" + fi + "$", "i"), hi = "(?:[" +
|
|
|
2725
2725
|
key: "extractNationalSignificantNumber",
|
|
2726
2726
|
value: function(r, n) {
|
|
2727
2727
|
if (this.hasSelectedNumberingPlan) {
|
|
2728
|
-
var d =
|
|
2728
|
+
var d = Nt(r, this.metadata), i = d.nationalPrefix, a = d.nationalNumber, o = d.carrierCode;
|
|
2729
2729
|
if (a !== r)
|
|
2730
2730
|
return this.onExtractedNationalNumber(i, o, a, r, n), !0;
|
|
2731
2731
|
}
|
|
@@ -2741,7 +2741,7 @@ var fi = "[" + P + p + "]+", ci = new RegExp("^" + fi + "$", "i"), hi = "(?:[" +
|
|
|
2741
2741
|
if (!this.hasExtractedNationalSignificantNumber)
|
|
2742
2742
|
return this.extractNationalSignificantNumber(r, d);
|
|
2743
2743
|
if (this.couldPossiblyExtractAnotherNationalSignificantNumber) {
|
|
2744
|
-
var i =
|
|
2744
|
+
var i = Nt(r, this.metadata), a = i.nationalPrefix, o = i.nationalNumber, u = i.carrierCode;
|
|
2745
2745
|
if (o !== n)
|
|
2746
2746
|
return this.onExtractedNationalNumber(a, u, o, r, d), !0;
|
|
2747
2747
|
}
|
|
@@ -3191,7 +3191,7 @@ var He = /* @__PURE__ */ (function() {
|
|
|
3191
3191
|
}
|
|
3192
3192
|
}]);
|
|
3193
3193
|
})();
|
|
3194
|
-
function
|
|
3194
|
+
function bt() {
|
|
3195
3195
|
return Ee(cd, arguments);
|
|
3196
3196
|
}
|
|
3197
3197
|
function R(t) {
|
|
@@ -3227,14 +3227,14 @@ const et = {
|
|
|
3227
3227
|
error: h,
|
|
3228
3228
|
value: f,
|
|
3229
3229
|
defaultCountry: m = "PE",
|
|
3230
|
-
disabled:
|
|
3230
|
+
disabled: v = !1
|
|
3231
3231
|
}) => {
|
|
3232
|
-
const [
|
|
3232
|
+
const [b, N] = w({
|
|
3233
3233
|
code: m,
|
|
3234
3234
|
name: et[m].name,
|
|
3235
3235
|
flag: et[m].flag,
|
|
3236
3236
|
callingCode: `+${Se(m)}`
|
|
3237
|
-
}), [A, L] = w(!1), [M,
|
|
3237
|
+
}), [A, L] = w(!1), [M, Ot] = w(""), [We, lt] = w(""), [Rt, st] = w(!1), [T, Ve] = w([]), [j, Dt] = w(""), [Ke, ft] = w([]), ct = mt(null), Lt = mt(null), Mt = mt(null), Xe = qe(), jt = t || Xe, kt = f !== void 0;
|
|
3238
3238
|
tt(() => {
|
|
3239
3239
|
const s = Object.keys(et).map((g) => {
|
|
3240
3240
|
const S = et[g];
|
|
@@ -3252,34 +3252,34 @@ const et = {
|
|
|
3252
3252
|
};
|
|
3253
3253
|
return document.addEventListener("mousedown", s), () => document.removeEventListener("mousedown", s);
|
|
3254
3254
|
}, []), tt(() => {
|
|
3255
|
-
if (
|
|
3255
|
+
if (kt && f && T.length > 0) {
|
|
3256
3256
|
const s = T.find((g) => f.startsWith(g.callingCode));
|
|
3257
3257
|
if (s) {
|
|
3258
3258
|
N(s);
|
|
3259
3259
|
const g = f.replace(s.callingCode, "").replace(/[^\d]/g, "");
|
|
3260
|
-
|
|
3260
|
+
Ot(g);
|
|
3261
3261
|
const I = new R(s.code).input(g);
|
|
3262
3262
|
lt(I);
|
|
3263
|
-
const _ =
|
|
3263
|
+
const _ = bt(f);
|
|
3264
3264
|
st(_);
|
|
3265
3265
|
}
|
|
3266
3266
|
}
|
|
3267
|
-
}, [f, T,
|
|
3267
|
+
}, [f, T, kt]);
|
|
3268
3268
|
const Ye = (s) => {
|
|
3269
|
-
const g = s.replace(/[^\d]/g, ""), I = new R(
|
|
3270
|
-
|
|
3271
|
-
const _ =
|
|
3269
|
+
const g = s.replace(/[^\d]/g, ""), I = new R(b.code).input(g);
|
|
3270
|
+
Ot(g), lt(I);
|
|
3271
|
+
const _ = b.callingCode + g, Bt = bt(_);
|
|
3272
3272
|
st(Bt), u?.(_, Bt);
|
|
3273
3273
|
}, Ze = (s) => {
|
|
3274
|
-
if (N(s), L(!1),
|
|
3274
|
+
if (N(s), L(!1), Dt(""), M) {
|
|
3275
3275
|
const S = new R(s.code).input(M);
|
|
3276
3276
|
lt(S);
|
|
3277
|
-
const I = s.callingCode + M, _ =
|
|
3277
|
+
const I = s.callingCode + M, _ = bt(I);
|
|
3278
3278
|
st(_), u?.(I, _);
|
|
3279
3279
|
}
|
|
3280
|
-
o?.(s), setTimeout(() =>
|
|
3280
|
+
o?.(s), setTimeout(() => Lt.current?.focus(), 100);
|
|
3281
3281
|
}, Je = () => {
|
|
3282
|
-
L(!A), A || setTimeout(() =>
|
|
3282
|
+
L(!A), A || setTimeout(() => Mt.current?.focus(), 100);
|
|
3283
3283
|
};
|
|
3284
3284
|
tt(() => {
|
|
3285
3285
|
if (!j.trim())
|
|
@@ -3291,14 +3291,14 @@ const et = {
|
|
|
3291
3291
|
ft(g);
|
|
3292
3292
|
}
|
|
3293
3293
|
}, [j, T]);
|
|
3294
|
-
const Qe = $,
|
|
3294
|
+
const Qe = $, Gt = h, ht = Qe && Gt;
|
|
3295
3295
|
return /* @__PURE__ */ c.jsxs("div", { className: k("w-full relative flex flex-col", a), children: [
|
|
3296
3296
|
r && /* @__PURE__ */ c.jsxs(
|
|
3297
3297
|
"label",
|
|
3298
3298
|
{
|
|
3299
|
-
htmlFor:
|
|
3299
|
+
htmlFor: jt,
|
|
3300
3300
|
className: ze("form-control-label block font-normal text-sm text-foreground mb-1", {
|
|
3301
|
-
"text-danger":
|
|
3301
|
+
"text-danger": ht
|
|
3302
3302
|
}),
|
|
3303
3303
|
children: [
|
|
3304
3304
|
r,
|
|
@@ -3314,7 +3314,7 @@ const et = {
|
|
|
3314
3314
|
"flex w-full min-w-0 transition-[color,box-shadow] outline-none rounded-md h-input-default",
|
|
3315
3315
|
"bg-white border border-input",
|
|
3316
3316
|
"disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
3317
|
-
|
|
3317
|
+
ht ? "border-danger aria-invalid:ring-danger/20" : "focus-within:border-primary focus-within:ring-primary/20",
|
|
3318
3318
|
"focus-within:ring-[3px]"
|
|
3319
3319
|
),
|
|
3320
3320
|
children: [
|
|
@@ -3329,8 +3329,8 @@ const et = {
|
|
|
3329
3329
|
"hover:bg-muted/20 focus:outline-none rounded-l-md"
|
|
3330
3330
|
),
|
|
3331
3331
|
children: [
|
|
3332
|
-
/* @__PURE__ */ c.jsx("span", { className: "text-lg", children:
|
|
3333
|
-
/* @__PURE__ */ c.jsx("span", { className: "text-sm font-medium text-foreground", children:
|
|
3332
|
+
/* @__PURE__ */ c.jsx("span", { className: "text-lg", children: b.flag }),
|
|
3333
|
+
/* @__PURE__ */ c.jsx("span", { className: "text-sm font-medium text-foreground", children: b.callingCode }),
|
|
3334
3334
|
/* @__PURE__ */ c.jsx(er, { className: `w-4 h-4 text-muted-foreground transition-transform ${A ? "rotate-180" : ""}` })
|
|
3335
3335
|
]
|
|
3336
3336
|
}
|
|
@@ -3341,10 +3341,10 @@ const et = {
|
|
|
3341
3341
|
/* @__PURE__ */ c.jsx(
|
|
3342
3342
|
"input",
|
|
3343
3343
|
{
|
|
3344
|
-
ref:
|
|
3344
|
+
ref: Mt,
|
|
3345
3345
|
type: "text",
|
|
3346
3346
|
value: j,
|
|
3347
|
-
onChange: (s) =>
|
|
3347
|
+
onChange: (s) => Dt(s.target.value),
|
|
3348
3348
|
placeholder: "Buscar país o código...",
|
|
3349
3349
|
className: "w-full pl-10 pr-3 py-2 h-9 border border-input rounded-md text-sm focus:outline-none focus:border-primary focus:ring-[3px] focus:ring-primary/20"
|
|
3350
3350
|
}
|
|
@@ -3357,13 +3357,13 @@ const et = {
|
|
|
3357
3357
|
onClick: () => Ze(s),
|
|
3358
3358
|
className: k(
|
|
3359
3359
|
"w-full flex items-center gap-3 px-3 py-1 text-sm transition",
|
|
3360
|
-
|
|
3360
|
+
b.code === s.code ? "bg-primary/5 border-l-2 border-primary" : "hover:bg-muted/20"
|
|
3361
3361
|
),
|
|
3362
3362
|
children: [
|
|
3363
3363
|
/* @__PURE__ */ c.jsx("span", { className: "text-lg", children: s.flag }),
|
|
3364
3364
|
/* @__PURE__ */ c.jsx("span", { className: "flex-1 text-left", children: s.name }),
|
|
3365
3365
|
/* @__PURE__ */ c.jsx("span", { className: "text-muted-foreground", children: s.callingCode }),
|
|
3366
|
-
|
|
3366
|
+
b.code === s.code && /* @__PURE__ */ c.jsx(rr, { className: "w-4 h-4 text-primary" })
|
|
3367
3367
|
]
|
|
3368
3368
|
},
|
|
3369
3369
|
s.code
|
|
@@ -3373,15 +3373,16 @@ const et = {
|
|
|
3373
3373
|
/* @__PURE__ */ c.jsx(
|
|
3374
3374
|
"input",
|
|
3375
3375
|
{
|
|
3376
|
-
ref:
|
|
3377
|
-
id:
|
|
3376
|
+
ref: Lt,
|
|
3377
|
+
id: jt,
|
|
3378
3378
|
type: "tel",
|
|
3379
3379
|
name: e,
|
|
3380
3380
|
value: We,
|
|
3381
3381
|
onChange: (s) => Ye(s.target.value),
|
|
3382
3382
|
onBlur: l,
|
|
3383
3383
|
placeholder: n,
|
|
3384
|
-
disabled:
|
|
3384
|
+
disabled: v,
|
|
3385
|
+
...v ? {} : { "aria-invalid": ht },
|
|
3385
3386
|
className: k(
|
|
3386
3387
|
"flex-1 px-3 py-1 h-input-default border-0 rounded-r-md bg-transparent focus:outline-none text-foreground text-sm",
|
|
3387
3388
|
i
|
|
@@ -3389,11 +3390,11 @@ const et = {
|
|
|
3389
3390
|
autoComplete: "tel"
|
|
3390
3391
|
}
|
|
3391
3392
|
),
|
|
3392
|
-
M && /* @__PURE__ */ c.jsx("div", { className: "flex items-center pr-3", children: /* @__PURE__ */ c.jsx("div", { className: `w-2 h-2 rounded-full ${
|
|
3393
|
+
M && /* @__PURE__ */ c.jsx("div", { className: "flex items-center pr-3", children: /* @__PURE__ */ c.jsx("div", { className: `w-2 h-2 rounded-full ${Rt ? "bg-green-500" : "bg-danger"}` }) })
|
|
3393
3394
|
]
|
|
3394
3395
|
}
|
|
3395
3396
|
),
|
|
3396
|
-
!
|
|
3397
|
+
!v && h && $ && /* @__PURE__ */ c.jsx(tr, { text: h || Gt || "" })
|
|
3397
3398
|
] });
|
|
3398
3399
|
};
|
|
3399
3400
|
export {
|