intl-tel-input 25.4.8 → 25.5.1
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.
- package/README.md +5 -5
- package/angular/build/IntlTelInput.js +258 -316
- package/angular/build/IntlTelInputWithUtils.js +472 -446
- package/angular/build/intl-tel-input.js +46 -12
- package/build/js/data.js +1 -1
- package/build/js/data.min.js +1 -1
- package/build/js/intlTelInput.js +38 -9
- package/build/js/intlTelInput.min.js +2 -2
- package/build/js/intlTelInputWithUtils.js +38 -9
- package/build/js/intlTelInputWithUtils.min.js +2 -2
- package/package.json +4 -4
- package/react/README.md +1 -1
- package/react/build/IntlTelInput.cjs +37 -8
- package/react/build/IntlTelInput.js +37 -8
- package/react/build/IntlTelInputWithUtils.cjs +37 -8
- package/react/build/IntlTelInputWithUtils.js +37 -8
- package/vue/README.md +1 -1
- package/vue/build/IntlTelInput.mjs +144 -135
- package/vue/build/IntlTelInputWithUtils.mjs +488 -479
- package/angular/build/IntlTelInput.cjs +0 -3358
- package/angular/build/IntlTelInput.d.ts +0 -1671
- package/angular/build/IntlTelInputWithUtils.cjs +0 -9732
- package/angular/build/intl-tel-input/angular.js +0 -205
- package/angular/build/intl-tel-input/angularWithUtils.js +0 -206
- package/angular/build/intl-tel-input/data.js +0 -1096
- package/angular/build/intl-tel-input/i18n/ar/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/ar/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/ar/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/bg/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/bg/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/bg/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/bn/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/bn/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/bn/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/bs/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/bs/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/bs/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/ca/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/ca/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/ca/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/cs/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/cs/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/cs/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/da/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/da/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/da/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/de/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/de/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/de/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/ee/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/ee/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/ee/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/el/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/el/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/el/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/en/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/en/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/en/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/es/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/es/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/es/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/fa/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/fa/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/fa/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/fi/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/fi/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/fi/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/fr/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/fr/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/fr/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/hi/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/hi/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/hi/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/hr/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/hr/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/hr/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/hu/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/hu/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/hu/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/id/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/id/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/id/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/index.js +0 -40
- package/angular/build/intl-tel-input/i18n/it/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/it/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/it/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/ja/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/ja/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/ja/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/ko/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/ko/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/ko/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/mr/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/mr/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/mr/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/nl/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/nl/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/nl/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/no/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/no/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/no/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/pl/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/pl/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/pl/interface.js +0 -24
- package/angular/build/intl-tel-input/i18n/pt/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/pt/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/pt/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/ro/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/ro/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/ro/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/ru/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/ru/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/ru/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/sk/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/sk/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/sk/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/sv/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/sv/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/sv/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/te/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/te/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/te/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/th/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/th/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/th/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/tr/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/tr/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/tr/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/types.js +0 -1
- package/angular/build/intl-tel-input/i18n/uk/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/uk/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/uk/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/ur/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/ur/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/ur/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/uz/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/uz/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/uz/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/vi/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/vi/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/vi/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/zh/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/zh/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/zh/interface.js +0 -13
- package/angular/build/intl-tel-input/intlTelInputWithUtils.js +0 -4
- package/angular/build/intl-tel-input/utils.js +0 -1341
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mergeModels as
|
|
1
|
+
import { mergeModels as n2, useModel as M2, ref as I1, onMounted as D2, watch as P2, onUnmounted as x2, withDirectives as R2, createElementBlock as B2, openBlock as k2, mergeProps as O2, vModelText as G2 } from "vue";
|
|
2
2
|
const s2 = [
|
|
3
3
|
[
|
|
4
4
|
"af",
|
|
@@ -1323,9 +1323,9 @@ const s2 = [
|
|
|
1323
1323
|
"263"
|
|
1324
1324
|
]
|
|
1325
1325
|
], W = [];
|
|
1326
|
-
for (let
|
|
1327
|
-
const e = s2[
|
|
1328
|
-
W[
|
|
1326
|
+
for (let I = 0; I < s2.length; I++) {
|
|
1327
|
+
const e = s2[I];
|
|
1328
|
+
W[I] = {
|
|
1329
1329
|
name: "",
|
|
1330
1330
|
// this is now populated in the plugin
|
|
1331
1331
|
iso2: e[0],
|
|
@@ -1591,8 +1591,8 @@ const F2 = {
|
|
|
1591
1591
|
ac: "Ascension Island",
|
|
1592
1592
|
xk: "Kosovo"
|
|
1593
1593
|
}, u2 = { ...F2, ...U2 };
|
|
1594
|
-
for (let
|
|
1595
|
-
W[
|
|
1594
|
+
for (let I = 0; I < W.length; I++)
|
|
1595
|
+
W[I].name = u2[W[I].iso2];
|
|
1596
1596
|
let V2 = 0;
|
|
1597
1597
|
const l2 = {
|
|
1598
1598
|
//* Whether or not to allow the dropdown.
|
|
@@ -1667,46 +1667,46 @@ const l2 = {
|
|
|
1667
1667
|
"887",
|
|
1668
1668
|
"888",
|
|
1669
1669
|
"889"
|
|
1670
|
-
], c1 = (
|
|
1671
|
-
const e = c1(
|
|
1670
|
+
], c1 = (I) => I.replace(/\D/g, ""), r2 = (I = "") => I.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(), o2 = (I) => {
|
|
1671
|
+
const e = c1(I);
|
|
1672
1672
|
if (e.charAt(0) === "1") {
|
|
1673
|
-
const
|
|
1674
|
-
return K2.includes(
|
|
1673
|
+
const i = e.substr(1, 3);
|
|
1674
|
+
return K2.includes(i);
|
|
1675
1675
|
}
|
|
1676
1676
|
return !1;
|
|
1677
|
-
}, H2 = (
|
|
1678
|
-
if (
|
|
1677
|
+
}, H2 = (I, e, i, s) => {
|
|
1678
|
+
if (i === 0 && !s)
|
|
1679
1679
|
return 0;
|
|
1680
1680
|
let o = 0;
|
|
1681
1681
|
for (let a = 0; a < e.length; a++) {
|
|
1682
|
-
if (/[+0-9]/.test(e[a]) && o++, o ===
|
|
1682
|
+
if (/[+0-9]/.test(e[a]) && o++, o === I && !s)
|
|
1683
1683
|
return a + 1;
|
|
1684
|
-
if (s && o ===
|
|
1684
|
+
if (s && o === I + 1)
|
|
1685
1685
|
return a;
|
|
1686
1686
|
}
|
|
1687
1687
|
return e.length;
|
|
1688
|
-
},
|
|
1689
|
-
const s = document.createElement(
|
|
1690
|
-
return e && Object.entries(e).forEach(([o, a]) => s.setAttribute(o, a)),
|
|
1691
|
-
}, $1 = (
|
|
1692
|
-
const { instances:
|
|
1693
|
-
Object.values(
|
|
1688
|
+
}, E = (I, e, i) => {
|
|
1689
|
+
const s = document.createElement(I);
|
|
1690
|
+
return e && Object.entries(e).forEach(([o, a]) => s.setAttribute(o, a)), i && i.appendChild(s), s;
|
|
1691
|
+
}, $1 = (I, ...e) => {
|
|
1692
|
+
const { instances: i } = y;
|
|
1693
|
+
Object.values(i).forEach((s) => s[I](...e));
|
|
1694
1694
|
};
|
|
1695
1695
|
class j2 {
|
|
1696
|
-
constructor(e,
|
|
1697
|
-
this.id = V2++, this.telInput = e, this.highlightedItem = null, this.options = Object.assign({}, l2,
|
|
1696
|
+
constructor(e, i = {}) {
|
|
1697
|
+
this.id = V2++, this.telInput = e, this.highlightedItem = null, this.options = Object.assign({}, l2, i), this.hadInitialPlaceholder = !!e.getAttribute("placeholder");
|
|
1698
1698
|
}
|
|
1699
1699
|
//* Can't be private as it's called from intlTelInput convenience wrapper.
|
|
1700
1700
|
_init() {
|
|
1701
1701
|
this.options.useFullscreenPopup && (this.options.fixDropdownWidth = !1), this.options.onlyCountries.length === 1 && (this.options.initialCountry = this.options.onlyCountries[0]), this.options.separateDialCode && (this.options.nationalMode = !1), this.options.allowDropdown && !this.options.showFlags && !this.options.separateDialCode && (this.options.nationalMode = !1), this.options.useFullscreenPopup && !this.options.dropdownContainer && (this.options.dropdownContainer = document.body), this.isAndroid = typeof navigator < "u" ? /Android/i.test(navigator.userAgent) : !1, this.isRTL = !!this.telInput.closest("[dir=rtl]");
|
|
1702
1702
|
const e = this.options.allowDropdown || this.options.separateDialCode;
|
|
1703
1703
|
this.showSelectedCountryOnLeft = this.isRTL ? !e : e, this.options.separateDialCode && (this.isRTL ? this.originalPaddingRight = this.telInput.style.paddingRight : this.originalPaddingLeft = this.telInput.style.paddingLeft), this.options.i18n = { ...u2, ...this.options.i18n };
|
|
1704
|
-
const
|
|
1704
|
+
const i = new Promise((o, a) => {
|
|
1705
1705
|
this.resolveAutoCountryPromise = o, this.rejectAutoCountryPromise = a;
|
|
1706
1706
|
}), s = new Promise((o, a) => {
|
|
1707
1707
|
this.resolveUtilsScriptPromise = o, this.rejectUtilsScriptPromise = a;
|
|
1708
1708
|
});
|
|
1709
|
-
this.promise = Promise.all([
|
|
1709
|
+
this.promise = Promise.all([i, s]), this.selectedCountryData = {}, this._processCountryData(), this._generateMarkup(), this._setInitialState(), this._initListeners(), this._initRequests();
|
|
1710
1710
|
}
|
|
1711
1711
|
//********************
|
|
1712
1712
|
//* PRIVATE METHODS
|
|
@@ -1717,28 +1717,28 @@ class j2 {
|
|
|
1717
1717
|
}
|
|
1718
1718
|
//* Sort countries by countryOrder option (if present), then name.
|
|
1719
1719
|
_sortCountries() {
|
|
1720
|
-
this.options.countryOrder && (this.options.countryOrder = this.options.countryOrder.map((e) => e.toLowerCase())), this.countries.sort((e,
|
|
1720
|
+
this.options.countryOrder && (this.options.countryOrder = this.options.countryOrder.map((e) => e.toLowerCase())), this.countries.sort((e, i) => {
|
|
1721
1721
|
const { countryOrder: s } = this.options;
|
|
1722
1722
|
if (s) {
|
|
1723
|
-
const o = s.indexOf(e.iso2), a = s.indexOf(
|
|
1723
|
+
const o = s.indexOf(e.iso2), a = s.indexOf(i.iso2), c = o > -1, g = a > -1;
|
|
1724
1724
|
if (c || g)
|
|
1725
1725
|
return c && g ? o - a : c ? -1 : 1;
|
|
1726
1726
|
}
|
|
1727
|
-
return e.name.localeCompare(
|
|
1727
|
+
return e.name.localeCompare(i.name);
|
|
1728
1728
|
});
|
|
1729
1729
|
}
|
|
1730
1730
|
//* Add a dial code to this.dialCodeToIso2Map.
|
|
1731
|
-
_addToDialCodeMap(e,
|
|
1732
|
-
|
|
1733
|
-
for (let a = 0; a < this.dialCodeToIso2Map[
|
|
1734
|
-
if (this.dialCodeToIso2Map[
|
|
1731
|
+
_addToDialCodeMap(e, i, s) {
|
|
1732
|
+
i.length > this.dialCodeMaxLen && (this.dialCodeMaxLen = i.length), this.dialCodeToIso2Map.hasOwnProperty(i) || (this.dialCodeToIso2Map[i] = []);
|
|
1733
|
+
for (let a = 0; a < this.dialCodeToIso2Map[i].length; a++)
|
|
1734
|
+
if (this.dialCodeToIso2Map[i][a] === e)
|
|
1735
1735
|
return;
|
|
1736
|
-
const o = s !== void 0 ? s : this.dialCodeToIso2Map[
|
|
1737
|
-
this.dialCodeToIso2Map[
|
|
1736
|
+
const o = s !== void 0 ? s : this.dialCodeToIso2Map[i].length;
|
|
1737
|
+
this.dialCodeToIso2Map[i][o] = e;
|
|
1738
1738
|
}
|
|
1739
1739
|
//* Process onlyCountries or excludeCountries array if present.
|
|
1740
1740
|
_processAllCountries() {
|
|
1741
|
-
const { onlyCountries: e, excludeCountries:
|
|
1741
|
+
const { onlyCountries: e, excludeCountries: i } = this.options;
|
|
1742
1742
|
if (e.length) {
|
|
1743
1743
|
const s = e.map(
|
|
1744
1744
|
(o) => o.toLowerCase()
|
|
@@ -1746,8 +1746,8 @@ class j2 {
|
|
|
1746
1746
|
this.countries = W.filter(
|
|
1747
1747
|
(o) => s.includes(o.iso2)
|
|
1748
1748
|
);
|
|
1749
|
-
} else if (
|
|
1750
|
-
const s =
|
|
1749
|
+
} else if (i.length) {
|
|
1750
|
+
const s = i.map(
|
|
1751
1751
|
(o) => o.toLowerCase()
|
|
1752
1752
|
);
|
|
1753
1753
|
this.countries = W.filter(
|
|
@@ -1759,39 +1759,39 @@ class j2 {
|
|
|
1759
1759
|
//* Translate Countries by object literal provided on config.
|
|
1760
1760
|
_translateCountryNames() {
|
|
1761
1761
|
for (let e = 0; e < this.countries.length; e++) {
|
|
1762
|
-
const
|
|
1763
|
-
this.options.i18n.hasOwnProperty(
|
|
1762
|
+
const i = this.countries[e].iso2.toLowerCase();
|
|
1763
|
+
this.options.i18n.hasOwnProperty(i) && (this.countries[e].name = this.options.i18n[i]);
|
|
1764
1764
|
}
|
|
1765
1765
|
}
|
|
1766
1766
|
//* Generate this.dialCodes and this.dialCodeToIso2Map.
|
|
1767
1767
|
_processDialCodes() {
|
|
1768
1768
|
this.dialCodes = {}, this.dialCodeMaxLen = 0, this.dialCodeToIso2Map = {};
|
|
1769
1769
|
for (let e = 0; e < this.countries.length; e++) {
|
|
1770
|
-
const
|
|
1771
|
-
this.dialCodes[
|
|
1770
|
+
const i = this.countries[e];
|
|
1771
|
+
this.dialCodes[i.dialCode] || (this.dialCodes[i.dialCode] = !0), this._addToDialCodeMap(i.iso2, i.dialCode, i.priority);
|
|
1772
1772
|
}
|
|
1773
1773
|
for (let e = 0; e < this.countries.length; e++) {
|
|
1774
|
-
const
|
|
1775
|
-
if (
|
|
1776
|
-
const s = this.dialCodeToIso2Map[
|
|
1777
|
-
for (let o = 0; o <
|
|
1778
|
-
const a =
|
|
1774
|
+
const i = this.countries[e];
|
|
1775
|
+
if (i.areaCodes) {
|
|
1776
|
+
const s = this.dialCodeToIso2Map[i.dialCode][0];
|
|
1777
|
+
for (let o = 0; o < i.areaCodes.length; o++) {
|
|
1778
|
+
const a = i.areaCodes[o];
|
|
1779
1779
|
for (let c = 1; c < a.length; c++) {
|
|
1780
|
-
const g = a.substr(0, c), f =
|
|
1781
|
-
this._addToDialCodeMap(s, f), this._addToDialCodeMap(
|
|
1780
|
+
const g = a.substr(0, c), f = i.dialCode + g;
|
|
1781
|
+
this._addToDialCodeMap(s, f), this._addToDialCodeMap(i.iso2, f);
|
|
1782
1782
|
}
|
|
1783
|
-
this._addToDialCodeMap(
|
|
1783
|
+
this._addToDialCodeMap(i.iso2, i.dialCode + a);
|
|
1784
1784
|
}
|
|
1785
1785
|
}
|
|
1786
1786
|
}
|
|
1787
1787
|
}
|
|
1788
1788
|
//* Generate all of the markup for the plugin: the selected country overlay, and the dropdown.
|
|
1789
1789
|
_generateMarkup() {
|
|
1790
|
-
var
|
|
1790
|
+
var C, m, x;
|
|
1791
1791
|
this.telInput.classList.add("iti__tel-input"), !this.telInput.hasAttribute("autocomplete") && !(this.telInput.form && this.telInput.form.hasAttribute("autocomplete")) && this.telInput.setAttribute("autocomplete", "off");
|
|
1792
1792
|
const {
|
|
1793
1793
|
allowDropdown: e,
|
|
1794
|
-
separateDialCode:
|
|
1794
|
+
separateDialCode: i,
|
|
1795
1795
|
showFlags: s,
|
|
1796
1796
|
containerClass: o,
|
|
1797
1797
|
hiddenInput: a,
|
|
@@ -1799,17 +1799,17 @@ class j2 {
|
|
|
1799
1799
|
fixDropdownWidth: g,
|
|
1800
1800
|
useFullscreenPopup: f,
|
|
1801
1801
|
countrySearch: v,
|
|
1802
|
-
i18n:
|
|
1802
|
+
i18n: b
|
|
1803
1803
|
} = this.options;
|
|
1804
|
-
let
|
|
1805
|
-
e && (
|
|
1806
|
-
const L =
|
|
1807
|
-
if ((
|
|
1808
|
-
this.countryContainer =
|
|
1804
|
+
let S = "iti";
|
|
1805
|
+
e && (S += " iti--allow-dropdown"), s && (S += " iti--show-flags"), o && (S += ` ${o}`), f || (S += " iti--inline-dropdown");
|
|
1806
|
+
const L = E("div", { class: S });
|
|
1807
|
+
if ((C = this.telInput.parentNode) == null || C.insertBefore(L, this.telInput), e || s || i) {
|
|
1808
|
+
this.countryContainer = E(
|
|
1809
1809
|
"div",
|
|
1810
1810
|
{ class: "iti__country-container" },
|
|
1811
1811
|
L
|
|
1812
|
-
), this.showSelectedCountryOnLeft ? this.countryContainer.style.left = "0px" : this.countryContainer.style.right = "0px", e ? (this.selectedCountry =
|
|
1812
|
+
), this.showSelectedCountryOnLeft ? this.countryContainer.style.left = "0px" : this.countryContainer.style.right = "0px", e ? (this.selectedCountry = E(
|
|
1813
1813
|
"button",
|
|
1814
1814
|
{
|
|
1815
1815
|
type: "button",
|
|
@@ -1821,77 +1821,77 @@ class j2 {
|
|
|
1821
1821
|
role: "combobox"
|
|
1822
1822
|
},
|
|
1823
1823
|
this.countryContainer
|
|
1824
|
-
), this.telInput.disabled && this.selectedCountry.setAttribute("disabled", "true")) : this.selectedCountry =
|
|
1824
|
+
), this.telInput.disabled && this.selectedCountry.setAttribute("disabled", "true")) : this.selectedCountry = E(
|
|
1825
1825
|
"div",
|
|
1826
1826
|
{ class: "iti__selected-country" },
|
|
1827
1827
|
this.countryContainer
|
|
1828
1828
|
);
|
|
1829
|
-
const
|
|
1830
|
-
if (this.selectedCountryInner =
|
|
1829
|
+
const O = E("div", { class: "iti__selected-country-primary" }, this.selectedCountry);
|
|
1830
|
+
if (this.selectedCountryInner = E("div", { class: "iti__flag" }, O), this.selectedCountryA11yText = E(
|
|
1831
1831
|
"span",
|
|
1832
1832
|
{ class: "iti__a11y-text" },
|
|
1833
1833
|
this.selectedCountryInner
|
|
1834
|
-
), e && (this.dropdownArrow =
|
|
1834
|
+
), e && (this.dropdownArrow = E(
|
|
1835
1835
|
"div",
|
|
1836
1836
|
{ class: "iti__arrow", "aria-hidden": "true" },
|
|
1837
|
-
|
|
1838
|
-
)),
|
|
1837
|
+
O
|
|
1838
|
+
)), i && (this.selectedDialCode = E(
|
|
1839
1839
|
"div",
|
|
1840
|
-
{ class: "iti__selected-dial-code" },
|
|
1840
|
+
{ class: "iti__selected-dial-code", "aria-hidden": "true" },
|
|
1841
1841
|
this.selectedCountry
|
|
1842
1842
|
)), e) {
|
|
1843
|
-
const
|
|
1844
|
-
if (this.dropdownContent =
|
|
1843
|
+
const T = g ? "" : "iti--flexible-dropdown-width";
|
|
1844
|
+
if (this.dropdownContent = E("div", {
|
|
1845
1845
|
id: `iti-${this.id}__dropdown-content`,
|
|
1846
|
-
class: `iti__dropdown-content iti__hide ${
|
|
1847
|
-
}), v && (this.searchInput =
|
|
1846
|
+
class: `iti__dropdown-content iti__hide ${T}`
|
|
1847
|
+
}), v && (this.searchInput = E(
|
|
1848
1848
|
"input",
|
|
1849
1849
|
{
|
|
1850
1850
|
type: "text",
|
|
1851
1851
|
class: "iti__search-input",
|
|
1852
|
-
placeholder:
|
|
1852
|
+
placeholder: b.searchPlaceholder,
|
|
1853
1853
|
role: "combobox",
|
|
1854
1854
|
"aria-expanded": "true",
|
|
1855
|
-
"aria-label":
|
|
1855
|
+
"aria-label": b.searchPlaceholder,
|
|
1856
1856
|
"aria-controls": `iti-${this.id}__country-listbox`,
|
|
1857
1857
|
"aria-autocomplete": "list",
|
|
1858
1858
|
autocomplete: "off"
|
|
1859
1859
|
},
|
|
1860
1860
|
this.dropdownContent
|
|
1861
|
-
), this.searchResultsA11yText =
|
|
1861
|
+
), this.searchResultsA11yText = E(
|
|
1862
1862
|
"span",
|
|
1863
1863
|
{ class: "iti__a11y-text" },
|
|
1864
1864
|
this.dropdownContent
|
|
1865
|
-
)), this.countryList =
|
|
1865
|
+
)), this.countryList = E(
|
|
1866
1866
|
"ul",
|
|
1867
1867
|
{
|
|
1868
1868
|
class: "iti__country-list",
|
|
1869
1869
|
id: `iti-${this.id}__country-listbox`,
|
|
1870
1870
|
role: "listbox",
|
|
1871
|
-
"aria-label":
|
|
1871
|
+
"aria-label": b.countryListAriaLabel
|
|
1872
1872
|
},
|
|
1873
1873
|
this.dropdownContent
|
|
1874
1874
|
), this._appendListItems(), v && this._updateSearchResultsText(), c) {
|
|
1875
|
-
let
|
|
1876
|
-
o && (
|
|
1875
|
+
let G = "iti iti--container";
|
|
1876
|
+
o && (G += ` ${o}`), f ? G += " iti--fullscreen-popup" : G += " iti--inline-dropdown", this.dropdown = E("div", { class: G }), this.dropdown.appendChild(this.dropdownContent);
|
|
1877
1877
|
} else
|
|
1878
1878
|
this.countryContainer.appendChild(this.dropdownContent);
|
|
1879
1879
|
}
|
|
1880
1880
|
}
|
|
1881
1881
|
if (L.appendChild(this.telInput), this._updateInputPadding(), a) {
|
|
1882
|
-
const
|
|
1883
|
-
if (
|
|
1884
|
-
const
|
|
1885
|
-
|
|
1882
|
+
const O = this.telInput.getAttribute("name") || "", T = a(O);
|
|
1883
|
+
if (T.phone) {
|
|
1884
|
+
const G = (m = this.telInput.form) == null ? void 0 : m.querySelector(`input[name="${T.phone}"]`);
|
|
1885
|
+
G ? this.hiddenInput = G : (this.hiddenInput = E("input", {
|
|
1886
1886
|
type: "hidden",
|
|
1887
|
-
name:
|
|
1887
|
+
name: T.phone
|
|
1888
1888
|
}), L.appendChild(this.hiddenInput));
|
|
1889
1889
|
}
|
|
1890
|
-
if (
|
|
1891
|
-
const
|
|
1892
|
-
|
|
1890
|
+
if (T.country) {
|
|
1891
|
+
const G = (x = this.telInput.form) == null ? void 0 : x.querySelector(`input[name="${T.country}"]`);
|
|
1892
|
+
G ? this.hiddenInputCountry = G : (this.hiddenInputCountry = E("input", {
|
|
1893
1893
|
type: "hidden",
|
|
1894
|
-
name:
|
|
1894
|
+
name: T.country
|
|
1895
1895
|
}), L.appendChild(this.hiddenInputCountry));
|
|
1896
1896
|
}
|
|
1897
1897
|
}
|
|
@@ -1899,34 +1899,34 @@ class j2 {
|
|
|
1899
1899
|
//* For each country: add a country list item <li> to the countryList <ul> container.
|
|
1900
1900
|
_appendListItems() {
|
|
1901
1901
|
for (let e = 0; e < this.countries.length; e++) {
|
|
1902
|
-
const
|
|
1902
|
+
const i = this.countries[e], s = e === 0 ? "iti__highlight" : "", o = E(
|
|
1903
1903
|
"li",
|
|
1904
1904
|
{
|
|
1905
|
-
id: `iti-${this.id}__item-${
|
|
1905
|
+
id: `iti-${this.id}__item-${i.iso2}`,
|
|
1906
1906
|
class: `iti__country ${s}`,
|
|
1907
1907
|
tabindex: "-1",
|
|
1908
1908
|
role: "option",
|
|
1909
|
-
"data-dial-code":
|
|
1910
|
-
"data-country-code":
|
|
1909
|
+
"data-dial-code": i.dialCode,
|
|
1910
|
+
"data-country-code": i.iso2,
|
|
1911
1911
|
"aria-selected": "false"
|
|
1912
1912
|
},
|
|
1913
1913
|
this.countryList
|
|
1914
1914
|
);
|
|
1915
|
-
|
|
1915
|
+
i.nodeById[this.id] = o;
|
|
1916
1916
|
let a = "";
|
|
1917
|
-
this.options.showFlags && (a += `<div class='iti__flag iti__${
|
|
1917
|
+
this.options.showFlags && (a += `<div class='iti__flag iti__${i.iso2}'></div>`), a += `<span class='iti__country-name'>${i.name}</span>`, a += `<span class='iti__dial-code'>+${i.dialCode}</span>`, o.insertAdjacentHTML("beforeend", a);
|
|
1918
1918
|
}
|
|
1919
1919
|
}
|
|
1920
1920
|
//* Set the initial state of the input value and the selected country by:
|
|
1921
1921
|
//* 1. Extracting a dial code from the given number
|
|
1922
1922
|
//* 2. Using explicit initialCountry
|
|
1923
1923
|
_setInitialState(e = !1) {
|
|
1924
|
-
const
|
|
1924
|
+
const i = this.telInput.getAttribute("value"), s = this.telInput.value, a = i && i.charAt(0) === "+" && (!s || s.charAt(0) !== "+") ? i : s, c = this._getDialCode(a), g = o2(a), { initialCountry: f, geoIpLookup: v } = this.options, b = f === "auto" && v;
|
|
1925
1925
|
if (c && !g)
|
|
1926
1926
|
this._updateCountryFromNumber(a);
|
|
1927
|
-
else if (!
|
|
1928
|
-
const
|
|
1929
|
-
|
|
1927
|
+
else if (!b || e) {
|
|
1928
|
+
const S = f ? f.toLowerCase() : "";
|
|
1929
|
+
S && this._getCountryData(S, !0) ? this._setCountry(S) : c && g ? this._setCountry("us") : this._setCountry();
|
|
1930
1930
|
}
|
|
1931
1931
|
a && this._updateValFromNumber(a);
|
|
1932
1932
|
}
|
|
@@ -1946,14 +1946,14 @@ class j2 {
|
|
|
1946
1946
|
}
|
|
1947
1947
|
//* initialise the dropdown listeners.
|
|
1948
1948
|
_initDropdownListeners() {
|
|
1949
|
-
this._handleLabelClick = (
|
|
1950
|
-
this.dropdownContent.classList.contains("iti__hide") ? this.telInput.focus() :
|
|
1949
|
+
this._handleLabelClick = (i) => {
|
|
1950
|
+
this.dropdownContent.classList.contains("iti__hide") ? this.telInput.focus() : i.preventDefault();
|
|
1951
1951
|
};
|
|
1952
1952
|
const e = this.telInput.closest("label");
|
|
1953
1953
|
e && e.addEventListener("click", this._handleLabelClick), this._handleClickSelectedCountry = () => {
|
|
1954
1954
|
this.dropdownContent.classList.contains("iti__hide") && !this.telInput.disabled && !this.telInput.readOnly && this._openDropdown();
|
|
1955
|
-
}, this.selectedCountry.addEventListener("click", this._handleClickSelectedCountry), this._handleCountryContainerKeydown = (
|
|
1956
|
-
this.dropdownContent.classList.contains("iti__hide") && ["ArrowUp", "ArrowDown", " ", "Enter"].includes(
|
|
1955
|
+
}, this.selectedCountry.addEventListener("click", this._handleClickSelectedCountry), this._handleCountryContainerKeydown = (i) => {
|
|
1956
|
+
this.dropdownContent.classList.contains("iti__hide") && ["ArrowUp", "ArrowDown", " ", "Enter"].includes(i.key) && (i.preventDefault(), i.stopPropagation(), this._openDropdown()), i.key === "Tab" && this._closeDropdown();
|
|
1957
1957
|
}, this.countryContainer.addEventListener(
|
|
1958
1958
|
"keydown",
|
|
1959
1959
|
this._handleCountryContainerKeydown
|
|
@@ -1961,19 +1961,19 @@ class j2 {
|
|
|
1961
1961
|
}
|
|
1962
1962
|
//* Init many requests: utils script / geo ip lookup.
|
|
1963
1963
|
_initRequests() {
|
|
1964
|
-
let { loadUtils: e, initialCountry:
|
|
1965
|
-
e && !
|
|
1964
|
+
let { loadUtils: e, initialCountry: i, geoIpLookup: s } = this.options;
|
|
1965
|
+
e && !y.utils ? (this._handlePageLoad = () => {
|
|
1966
1966
|
var a;
|
|
1967
|
-
window.removeEventListener("load", this._handlePageLoad), (a =
|
|
1967
|
+
window.removeEventListener("load", this._handlePageLoad), (a = y.attachUtils(e)) == null || a.catch(() => {
|
|
1968
1968
|
});
|
|
1969
|
-
},
|
|
1969
|
+
}, y.documentReady() ? this._handlePageLoad() : window.addEventListener("load", this._handlePageLoad)) : this.resolveUtilsScriptPromise(), i === "auto" && s && !this.selectedCountryData.iso2 ? this._loadAutoCountry() : this.resolveAutoCountryPromise();
|
|
1970
1970
|
}
|
|
1971
1971
|
//* Perform the geo ip lookup.
|
|
1972
1972
|
_loadAutoCountry() {
|
|
1973
|
-
|
|
1973
|
+
y.autoCountry ? this.handleAutoCountry() : y.startedLoadingAutoCountry || (y.startedLoadingAutoCountry = !0, typeof this.options.geoIpLookup == "function" && this.options.geoIpLookup(
|
|
1974
1974
|
(e = "") => {
|
|
1975
|
-
const
|
|
1976
|
-
|
|
1975
|
+
const i = e.toLowerCase();
|
|
1976
|
+
i && this._getCountryData(i, !0) ? (y.autoCountry = i, setTimeout(() => $1("handleAutoCountry"))) : (this._setInitialState(!0), $1("rejectAutoCountryPromise"));
|
|
1977
1977
|
},
|
|
1978
1978
|
() => {
|
|
1979
1979
|
this._setInitialState(!0), $1("rejectAutoCountryPromise");
|
|
@@ -1985,21 +1985,21 @@ class j2 {
|
|
|
1985
1985
|
}
|
|
1986
1986
|
//* Initialize the tel input listeners.
|
|
1987
1987
|
_initTelInputListeners() {
|
|
1988
|
-
const { strictMode: e, formatAsYouType:
|
|
1988
|
+
const { strictMode: e, formatAsYouType: i, separateDialCode: s, formatOnDisplay: o, allowDropdown: a, countrySearch: c } = this.options;
|
|
1989
1989
|
let g = !1;
|
|
1990
1990
|
new RegExp("\\p{L}", "u").test(this.telInput.value) && (g = !0), this._handleInputEvent = (f) => {
|
|
1991
1991
|
if (this.isAndroid && (f == null ? void 0 : f.data) === "+" && s && a && c) {
|
|
1992
|
-
const L = this.telInput.selectionStart || 0,
|
|
1993
|
-
this.telInput.value =
|
|
1992
|
+
const L = this.telInput.selectionStart || 0, C = this.telInput.value.substring(0, L - 1), m = this.telInput.value.substring(L);
|
|
1993
|
+
this.telInput.value = C + m, this._openDropdownWithPlus();
|
|
1994
1994
|
return;
|
|
1995
1995
|
}
|
|
1996
1996
|
this._updateCountryFromNumber(this.telInput.value) && this._triggerCountryChange();
|
|
1997
|
-
const v = (f == null ? void 0 : f.data) && /[^+0-9]/.test(f.data),
|
|
1998
|
-
v ||
|
|
1999
|
-
const
|
|
2000
|
-
if (
|
|
2001
|
-
const L = this.telInput.selectionStart || 0,
|
|
2002
|
-
this.telInput.value =
|
|
1997
|
+
const v = (f == null ? void 0 : f.data) && /[^+0-9]/.test(f.data), b = (f == null ? void 0 : f.inputType) === "insertFromPaste" && this.telInput.value;
|
|
1998
|
+
v || b && !e ? g = !0 : /[^+0-9]/.test(this.telInput.value) || (g = !1);
|
|
1999
|
+
const S = (f == null ? void 0 : f.detail) && f.detail.isSetNumber && !o;
|
|
2000
|
+
if (i && !g && !S) {
|
|
2001
|
+
const L = this.telInput.selectionStart || 0, m = this.telInput.value.substring(0, L).replace(/[^+0-9]/g, "").length, x = (f == null ? void 0 : f.inputType) === "deleteContentForward", O = this._formatNumberAsYouType(), T = H2(m, O, L, x);
|
|
2002
|
+
this.telInput.value = O, this.telInput.setSelectionRange(T, T);
|
|
2003
2003
|
}
|
|
2004
2004
|
}, this.telInput.addEventListener("input", this._handleInputEvent), (e || s) && (this._handleKeydownEvent = (f) => {
|
|
2005
2005
|
if (f.key && f.key.length === 1 && !f.altKey && !f.ctrlKey && !f.metaKey) {
|
|
@@ -2008,30 +2008,30 @@ class j2 {
|
|
|
2008
2008
|
return;
|
|
2009
2009
|
}
|
|
2010
2010
|
if (e) {
|
|
2011
|
-
const v = this.telInput.value,
|
|
2012
|
-
(!
|
|
2011
|
+
const v = this.telInput.value, S = !(v.charAt(0) === "+") && this.telInput.selectionStart === 0 && f.key === "+", L = /^[0-9]$/.test(f.key), C = s ? L : S || L, m = v.slice(0, this.telInput.selectionStart) + f.key + v.slice(this.telInput.selectionEnd), x = this._getFullNumber(m), O = y.utils.getCoreNumber(x, this.selectedCountryData.iso2), T = this.maxCoreNumberLength && O.length > this.maxCoreNumberLength, f1 = this._getNewCountryFromNumber(x) !== null;
|
|
2012
|
+
(!C || T && !f1 && !S) && f.preventDefault();
|
|
2013
2013
|
}
|
|
2014
2014
|
}
|
|
2015
2015
|
}, this.telInput.addEventListener("keydown", this._handleKeydownEvent));
|
|
2016
2016
|
}
|
|
2017
2017
|
//* Adhere to the input's maxlength attr.
|
|
2018
2018
|
_cap(e) {
|
|
2019
|
-
const
|
|
2020
|
-
return
|
|
2019
|
+
const i = parseInt(this.telInput.getAttribute("maxlength") || "", 10);
|
|
2020
|
+
return i && e.length > i ? e.substr(0, i) : e;
|
|
2021
2021
|
}
|
|
2022
2022
|
//* Trigger a custom event on the input.
|
|
2023
|
-
_trigger(e,
|
|
2023
|
+
_trigger(e, i = {}) {
|
|
2024
2024
|
const s = new CustomEvent(e, {
|
|
2025
2025
|
bubbles: !0,
|
|
2026
2026
|
cancelable: !0,
|
|
2027
|
-
detail:
|
|
2027
|
+
detail: i
|
|
2028
2028
|
});
|
|
2029
2029
|
this.telInput.dispatchEvent(s);
|
|
2030
2030
|
}
|
|
2031
2031
|
//* Open the dropdown.
|
|
2032
2032
|
_openDropdown() {
|
|
2033
|
-
const { fixDropdownWidth: e, countrySearch:
|
|
2034
|
-
if (e && (this.dropdownContent.style.width = `${this.telInput.offsetWidth}px`), this.dropdownContent.classList.remove("iti__hide"), this.selectedCountry.setAttribute("aria-expanded", "true"), this._setDropdownPosition(),
|
|
2033
|
+
const { fixDropdownWidth: e, countrySearch: i } = this.options;
|
|
2034
|
+
if (e && (this.dropdownContent.style.width = `${this.telInput.offsetWidth}px`), this.dropdownContent.classList.remove("iti__hide"), this.selectedCountry.setAttribute("aria-expanded", "true"), this._setDropdownPosition(), i) {
|
|
2035
2035
|
const s = this.countryList.firstElementChild;
|
|
2036
2036
|
s && (this._highlightListItem(s, !1), this.countryList.scrollTop = 0), this.searchInput.focus();
|
|
2037
2037
|
}
|
|
@@ -2040,8 +2040,8 @@ class j2 {
|
|
|
2040
2040
|
//* Set the dropdown position
|
|
2041
2041
|
_setDropdownPosition() {
|
|
2042
2042
|
if (this.options.dropdownContainer && this.options.dropdownContainer.appendChild(this.dropdown), !this.options.useFullscreenPopup) {
|
|
2043
|
-
const e = this.telInput.getBoundingClientRect(),
|
|
2044
|
-
this.options.dropdownContainer && (this.dropdown.style.top = `${e.top +
|
|
2043
|
+
const e = this.telInput.getBoundingClientRect(), i = this.telInput.offsetHeight;
|
|
2044
|
+
this.options.dropdownContainer && (this.dropdown.style.top = `${e.top + i}px`, this.dropdown.style.left = `${e.left}px`, this._handleWindowScroll = () => this._closeDropdown(), window.addEventListener("scroll", this._handleWindowScroll));
|
|
2045
2045
|
}
|
|
2046
2046
|
}
|
|
2047
2047
|
//* We only bind dropdown listeners when the dropdown is open.
|
|
@@ -2065,10 +2065,10 @@ class j2 {
|
|
|
2065
2065
|
"click",
|
|
2066
2066
|
this._handleClickOffToClose
|
|
2067
2067
|
);
|
|
2068
|
-
let
|
|
2068
|
+
let i = "", s = null;
|
|
2069
2069
|
if (this._handleKeydownOnDropdown = (o) => {
|
|
2070
|
-
["ArrowUp", "ArrowDown", "Enter", "Escape"].includes(o.key) && (o.preventDefault(), o.stopPropagation(), o.key === "ArrowUp" || o.key === "ArrowDown" ? this._handleUpDownKey(o.key) : o.key === "Enter" ? this._handleEnterKey() : o.key === "Escape" && this._closeDropdown()), !this.options.countrySearch && /^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(o.key) && (o.stopPropagation(), s && clearTimeout(s),
|
|
2071
|
-
|
|
2070
|
+
["ArrowUp", "ArrowDown", "Enter", "Escape"].includes(o.key) && (o.preventDefault(), o.stopPropagation(), o.key === "ArrowUp" || o.key === "ArrowDown" ? this._handleUpDownKey(o.key) : o.key === "Enter" ? this._handleEnterKey() : o.key === "Escape" && this._closeDropdown()), !this.options.countrySearch && /^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(o.key) && (o.stopPropagation(), s && clearTimeout(s), i += o.key.toLowerCase(), this._searchForCountry(i), s = setTimeout(() => {
|
|
2071
|
+
i = "";
|
|
2072
2072
|
}, 1e3));
|
|
2073
2073
|
}, document.addEventListener("keydown", this._handleKeydownOnDropdown), this.options.countrySearch) {
|
|
2074
2074
|
const o = () => {
|
|
@@ -2085,8 +2085,8 @@ class j2 {
|
|
|
2085
2085
|
}
|
|
2086
2086
|
//* Hidden search (countrySearch disabled): Find the first list item whose name starts with the query string.
|
|
2087
2087
|
_searchForCountry(e) {
|
|
2088
|
-
for (let
|
|
2089
|
-
const s = this.countries[
|
|
2088
|
+
for (let i = 0; i < this.countries.length; i++) {
|
|
2089
|
+
const s = this.countries[i];
|
|
2090
2090
|
if (s.name.substr(0, e.length).toLowerCase() === e) {
|
|
2091
2091
|
const a = s.nodeById[this.id];
|
|
2092
2092
|
this._highlightListItem(a, !1), this._scrollTo(a);
|
|
@@ -2095,30 +2095,39 @@ class j2 {
|
|
|
2095
2095
|
}
|
|
2096
2096
|
}
|
|
2097
2097
|
//* Country search enabled: Filter the countries according to the search query.
|
|
2098
|
-
_filterCountries(e,
|
|
2098
|
+
_filterCountries(e, i = !1) {
|
|
2099
2099
|
let s = !0;
|
|
2100
2100
|
this.countryList.innerHTML = "";
|
|
2101
|
-
const o = r2(e);
|
|
2102
|
-
for (let
|
|
2103
|
-
const
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2101
|
+
const o = r2(e), a = o.length, c = [], g = [], f = [], v = [], b = [], S = [];
|
|
2102
|
+
for (let C = 0; C < this.countries.length; C++) {
|
|
2103
|
+
const m = this.countries[C], x = r2(m.name), O = m.name.split(/[^a-zA-ZÀ-ÿа-яА-Я]/).map((T) => T[0]).join("").toLowerCase();
|
|
2104
|
+
i || a === 0 ? f.push(m) : m.iso2.toLowerCase() === o ? c.push(m) : x.startsWith(o) ? g.push(m) : x.includes(o) ? f.push(m) : o === m.dialCode || o === `+${m.dialCode}` ? v.push(m) : `+${m.dialCode}`.includes(o) ? b.push(m) : O.includes(o) && S.push(m);
|
|
2105
|
+
}
|
|
2106
|
+
const L = [
|
|
2107
|
+
...c.sort((C, m) => C.priority - m.priority),
|
|
2108
|
+
...g.sort((C, m) => C.priority - m.priority),
|
|
2109
|
+
...f.sort((C, m) => C.priority - m.priority),
|
|
2110
|
+
...v.sort((C, m) => C.priority - m.priority),
|
|
2111
|
+
...b.sort((C, m) => C.priority - m.priority),
|
|
2112
|
+
...S.sort((C, m) => C.priority - m.priority)
|
|
2113
|
+
];
|
|
2114
|
+
for (const C of L) {
|
|
2115
|
+
const m = C.nodeById[this.id];
|
|
2116
|
+
m && (this.countryList.appendChild(m), s && (this._highlightListItem(m, !1), s = !1));
|
|
2108
2117
|
}
|
|
2109
2118
|
s && this._highlightListItem(null, !1), this.countryList.scrollTop = 0, this._updateSearchResultsText();
|
|
2110
2119
|
}
|
|
2111
2120
|
//* Update search results text (for a11y).
|
|
2112
2121
|
_updateSearchResultsText() {
|
|
2113
|
-
const { i18n: e } = this.options,
|
|
2122
|
+
const { i18n: e } = this.options, i = this.countryList.childElementCount;
|
|
2114
2123
|
let s;
|
|
2115
|
-
"searchResultsText" in e ? s = e.searchResultsText(
|
|
2124
|
+
"searchResultsText" in e ? s = e.searchResultsText(i) : i === 0 ? s = e.zeroSearchResults : i === 1 ? s = e.oneSearchResult : s = e.multipleSearchResults.replace("${count}", i.toString()), this.searchResultsA11yText.textContent = s;
|
|
2116
2125
|
}
|
|
2117
2126
|
//* Highlight the next/prev item in the list (and ensure it is visible).
|
|
2118
2127
|
_handleUpDownKey(e) {
|
|
2119
2128
|
var s, o;
|
|
2120
|
-
let
|
|
2121
|
-
!
|
|
2129
|
+
let i = e === "ArrowUp" ? (s = this.highlightedItem) == null ? void 0 : s.previousElementSibling : (o = this.highlightedItem) == null ? void 0 : o.nextElementSibling;
|
|
2130
|
+
!i && this.countryList.childElementCount > 1 && (i = e === "ArrowUp" ? this.countryList.lastElementChild : this.countryList.firstElementChild), i && (this._scrollTo(i), this._highlightListItem(i, !1));
|
|
2122
2131
|
}
|
|
2123
2132
|
//* Select the currently highlighted item.
|
|
2124
2133
|
_handleEnterKey() {
|
|
@@ -2127,36 +2136,36 @@ class j2 {
|
|
|
2127
2136
|
//* Update the input's value to the given val (format first if possible)
|
|
2128
2137
|
//* NOTE: this is called from _setInitialState, handleUtils and setNumber.
|
|
2129
2138
|
_updateValFromNumber(e) {
|
|
2130
|
-
let
|
|
2131
|
-
if (this.options.formatOnDisplay &&
|
|
2132
|
-
const s = this.options.nationalMode ||
|
|
2133
|
-
|
|
2134
|
-
|
|
2139
|
+
let i = e;
|
|
2140
|
+
if (this.options.formatOnDisplay && y.utils && this.selectedCountryData) {
|
|
2141
|
+
const s = this.options.nationalMode || i.charAt(0) !== "+" && !this.options.separateDialCode, { NATIONAL: o, INTERNATIONAL: a } = y.utils.numberFormat, c = s ? o : a;
|
|
2142
|
+
i = y.utils.formatNumber(
|
|
2143
|
+
i,
|
|
2135
2144
|
this.selectedCountryData.iso2,
|
|
2136
2145
|
c
|
|
2137
2146
|
);
|
|
2138
2147
|
}
|
|
2139
|
-
|
|
2148
|
+
i = this._beforeSetNumber(i), this.telInput.value = i;
|
|
2140
2149
|
}
|
|
2141
2150
|
//* Check if need to select a new country based on the given number
|
|
2142
2151
|
//* Note: called from _setInitialState, keyup handler, setNumber.
|
|
2143
2152
|
_updateCountryFromNumber(e) {
|
|
2144
|
-
const
|
|
2145
|
-
return
|
|
2153
|
+
const i = this._getNewCountryFromNumber(e);
|
|
2154
|
+
return i !== null ? this._setCountry(i) : !1;
|
|
2146
2155
|
}
|
|
2147
2156
|
_ensureHasDialCode(e) {
|
|
2148
|
-
const { dialCode:
|
|
2149
|
-
if (e.charAt(0) === "+" || !
|
|
2157
|
+
const { dialCode: i, nationalPrefix: s } = this.selectedCountryData;
|
|
2158
|
+
if (e.charAt(0) === "+" || !i)
|
|
2150
2159
|
return e;
|
|
2151
2160
|
const c = s && e.charAt(0) === s && !this.options.separateDialCode ? e.substring(1) : e;
|
|
2152
|
-
return `+${
|
|
2161
|
+
return `+${i}${c}`;
|
|
2153
2162
|
}
|
|
2154
2163
|
// Get the country ISO2 code from the given number
|
|
2155
2164
|
// BUT ONLY IF ITS CHANGED FROM THE CURRENTLY SELECTED COUNTRY
|
|
2156
2165
|
// NOTE: consider refactoring this to be more clear
|
|
2157
2166
|
_getNewCountryFromNumber(e) {
|
|
2158
|
-
const
|
|
2159
|
-
let s =
|
|
2167
|
+
const i = e.indexOf("+");
|
|
2168
|
+
let s = i ? e.substring(i) : e;
|
|
2160
2169
|
const o = this.selectedCountryData.iso2, a = this.selectedCountryData.dialCode;
|
|
2161
2170
|
s = this._ensureHasDialCode(s);
|
|
2162
2171
|
const c = this._getDialCode(s, !0), g = c1(s);
|
|
@@ -2164,11 +2173,11 @@ class j2 {
|
|
|
2164
2173
|
const f = c1(c), v = this.dialCodeToIso2Map[f];
|
|
2165
2174
|
if (!o && this.defaultCountry && v.includes(this.defaultCountry))
|
|
2166
2175
|
return this.defaultCountry;
|
|
2167
|
-
const
|
|
2168
|
-
if (!(a === "1" && o2(g)) && !
|
|
2169
|
-
for (let
|
|
2170
|
-
if (v[
|
|
2171
|
-
return v[
|
|
2176
|
+
const b = this.selectedCountryData.areaCodes && g.length > f.length, S = o && v.includes(o) && !b;
|
|
2177
|
+
if (!(a === "1" && o2(g)) && !S) {
|
|
2178
|
+
for (let C = 0; C < v.length; C++)
|
|
2179
|
+
if (v[C])
|
|
2180
|
+
return v[C];
|
|
2172
2181
|
}
|
|
2173
2182
|
} else {
|
|
2174
2183
|
if (s.charAt(0) === "+" && g.length)
|
|
@@ -2179,34 +2188,34 @@ class j2 {
|
|
|
2179
2188
|
return null;
|
|
2180
2189
|
}
|
|
2181
2190
|
//* Remove highlighting from other list items and highlight the given item.
|
|
2182
|
-
_highlightListItem(e,
|
|
2191
|
+
_highlightListItem(e, i) {
|
|
2183
2192
|
const s = this.highlightedItem;
|
|
2184
2193
|
if (s && (s.classList.remove("iti__highlight"), s.setAttribute("aria-selected", "false")), this.highlightedItem = e, this.highlightedItem) {
|
|
2185
2194
|
this.highlightedItem.classList.add("iti__highlight"), this.highlightedItem.setAttribute("aria-selected", "true");
|
|
2186
2195
|
const o = this.highlightedItem.getAttribute("id") || "";
|
|
2187
2196
|
this.selectedCountry.setAttribute("aria-activedescendant", o), this.options.countrySearch && this.searchInput.setAttribute("aria-activedescendant", o);
|
|
2188
2197
|
}
|
|
2189
|
-
|
|
2198
|
+
i && this.highlightedItem.focus();
|
|
2190
2199
|
}
|
|
2191
2200
|
//* Find the country data for the given iso2 code
|
|
2192
2201
|
//* the ignoreOnlyCountriesOption is only used during init() while parsing the onlyCountries array
|
|
2193
|
-
_getCountryData(e,
|
|
2202
|
+
_getCountryData(e, i) {
|
|
2194
2203
|
for (let s = 0; s < this.countries.length; s++)
|
|
2195
2204
|
if (this.countries[s].iso2 === e)
|
|
2196
2205
|
return this.countries[s];
|
|
2197
|
-
if (
|
|
2206
|
+
if (i)
|
|
2198
2207
|
return null;
|
|
2199
2208
|
throw new Error(`No country data for '${e}'`);
|
|
2200
2209
|
}
|
|
2201
2210
|
//* Update the selected country, dial code (if separateDialCode), placeholder, title, and active list item.
|
|
2202
2211
|
//* Note: called from _setInitialState, _updateCountryFromNumber, _selectListItem, setCountry.
|
|
2203
2212
|
_setCountry(e) {
|
|
2204
|
-
const { separateDialCode:
|
|
2213
|
+
const { separateDialCode: i, showFlags: s, i18n: o } = this.options, a = this.selectedCountryData.iso2 ? this.selectedCountryData : {};
|
|
2205
2214
|
if (this.selectedCountryData = e ? this._getCountryData(e, !1) || {} : {}, this.selectedCountryData.iso2 && (this.defaultCountry = this.selectedCountryData.iso2), this.selectedCountryInner) {
|
|
2206
2215
|
let c = "", g = "";
|
|
2207
2216
|
e && s ? (c = `iti__flag iti__${e}`, g = `${this.selectedCountryData.name} +${this.selectedCountryData.dialCode}`) : (c = "iti__flag iti__globe", g = o.noCountrySelected), this.selectedCountryInner.className = c, this.selectedCountryA11yText.textContent = g;
|
|
2208
2217
|
}
|
|
2209
|
-
if (this._setSelectedCountryTitleAttribute(e,
|
|
2218
|
+
if (this._setSelectedCountryTitleAttribute(e, i), i) {
|
|
2210
2219
|
const c = this.selectedCountryData.dialCode ? `+${this.selectedCountryData.dialCode}` : "";
|
|
2211
2220
|
this.selectedDialCode.innerHTML = c, this._updateInputPadding();
|
|
2212
2221
|
}
|
|
@@ -2215,34 +2224,34 @@ class j2 {
|
|
|
2215
2224
|
//* Update the input padding to make space for the selected country/dial code.
|
|
2216
2225
|
_updateInputPadding() {
|
|
2217
2226
|
if (this.selectedCountry) {
|
|
2218
|
-
const
|
|
2219
|
-
this.showSelectedCountryOnLeft ? this.telInput.style.paddingLeft = `${
|
|
2227
|
+
const i = (this.selectedCountry.offsetWidth || this._getHiddenSelectedCountryWidth()) + 6;
|
|
2228
|
+
this.showSelectedCountryOnLeft ? this.telInput.style.paddingLeft = `${i}px` : this.telInput.style.paddingRight = `${i}px`;
|
|
2220
2229
|
}
|
|
2221
2230
|
}
|
|
2222
2231
|
//* Update the maximum valid number length for the currently selected country.
|
|
2223
2232
|
_updateMaxLength() {
|
|
2224
|
-
const { strictMode: e, placeholderNumberType:
|
|
2225
|
-
if (e &&
|
|
2233
|
+
const { strictMode: e, placeholderNumberType: i, validationNumberTypes: s } = this.options, { iso2: o } = this.selectedCountryData;
|
|
2234
|
+
if (e && y.utils)
|
|
2226
2235
|
if (o) {
|
|
2227
|
-
const a =
|
|
2228
|
-
let c =
|
|
2236
|
+
const a = y.utils.numberType[i];
|
|
2237
|
+
let c = y.utils.getExampleNumber(
|
|
2229
2238
|
o,
|
|
2230
2239
|
!1,
|
|
2231
2240
|
a,
|
|
2232
2241
|
!0
|
|
2233
2242
|
), g = c;
|
|
2234
|
-
for (;
|
|
2243
|
+
for (; y.utils.isPossibleNumber(c, o, s); )
|
|
2235
2244
|
g = c, c += "0";
|
|
2236
|
-
const f =
|
|
2245
|
+
const f = y.utils.getCoreNumber(g, o);
|
|
2237
2246
|
this.maxCoreNumberLength = f.length, o === "by" && (this.maxCoreNumberLength = f.length + 1);
|
|
2238
2247
|
} else
|
|
2239
2248
|
this.maxCoreNumberLength = null;
|
|
2240
2249
|
}
|
|
2241
|
-
_setSelectedCountryTitleAttribute(e = null,
|
|
2250
|
+
_setSelectedCountryTitleAttribute(e = null, i) {
|
|
2242
2251
|
if (!this.selectedCountry)
|
|
2243
2252
|
return;
|
|
2244
2253
|
let s;
|
|
2245
|
-
e && !
|
|
2254
|
+
e && !i ? s = `${this.selectedCountryData.name}: +${this.selectedCountryData.dialCode}` : e ? s = this.selectedCountryData.name : s = "Unknown", this.selectedCountry.setAttribute("title", s);
|
|
2246
2255
|
}
|
|
2247
2256
|
//* When the input is in a hidden container during initialisation, we must inject some markup
|
|
2248
2257
|
//* into the end of the DOM to calculate the correct offsetWidth.
|
|
@@ -2252,10 +2261,10 @@ class j2 {
|
|
|
2252
2261
|
if (this.telInput.parentNode) {
|
|
2253
2262
|
const e = this.telInput.parentNode.cloneNode(!1);
|
|
2254
2263
|
e.style.visibility = "hidden", document.body.appendChild(e);
|
|
2255
|
-
const
|
|
2256
|
-
e.appendChild(
|
|
2264
|
+
const i = this.countryContainer.cloneNode();
|
|
2265
|
+
e.appendChild(i);
|
|
2257
2266
|
const s = this.selectedCountry.cloneNode(!0);
|
|
2258
|
-
|
|
2267
|
+
i.appendChild(s);
|
|
2259
2268
|
const o = s.offsetWidth;
|
|
2260
2269
|
return document.body.removeChild(e), o;
|
|
2261
2270
|
}
|
|
@@ -2265,13 +2274,13 @@ class j2 {
|
|
|
2265
2274
|
_updatePlaceholder() {
|
|
2266
2275
|
const {
|
|
2267
2276
|
autoPlaceholder: e,
|
|
2268
|
-
placeholderNumberType:
|
|
2277
|
+
placeholderNumberType: i,
|
|
2269
2278
|
nationalMode: s,
|
|
2270
2279
|
customPlaceholder: o
|
|
2271
2280
|
} = this.options, a = e === "aggressive" || !this.hadInitialPlaceholder && e === "polite";
|
|
2272
|
-
if (
|
|
2273
|
-
const c =
|
|
2274
|
-
let g = this.selectedCountryData.iso2 ?
|
|
2281
|
+
if (y.utils && a) {
|
|
2282
|
+
const c = y.utils.numberType[i];
|
|
2283
|
+
let g = this.selectedCountryData.iso2 ? y.utils.getExampleNumber(
|
|
2275
2284
|
this.selectedCountryData.iso2,
|
|
2276
2285
|
s,
|
|
2277
2286
|
c
|
|
@@ -2281,10 +2290,10 @@ class j2 {
|
|
|
2281
2290
|
}
|
|
2282
2291
|
//* Called when the user selects a list item from the dropdown.
|
|
2283
2292
|
_selectListItem(e) {
|
|
2284
|
-
const
|
|
2293
|
+
const i = this._setCountry(
|
|
2285
2294
|
e.getAttribute("data-country-code")
|
|
2286
2295
|
);
|
|
2287
|
-
this._closeDropdown(), this._updateDialCode(e.getAttribute("data-dial-code")), this.telInput.focus(),
|
|
2296
|
+
this._closeDropdown(), this._updateDialCode(e.getAttribute("data-dial-code")), this.telInput.focus(), i && this._triggerCountryChange();
|
|
2288
2297
|
}
|
|
2289
2298
|
//* Close the dropdown and unbind any listeners.
|
|
2290
2299
|
_closeDropdown() {
|
|
@@ -2298,34 +2307,34 @@ class j2 {
|
|
|
2298
2307
|
}
|
|
2299
2308
|
//* Check if an element is visible within it's container, else scroll until it is.
|
|
2300
2309
|
_scrollTo(e) {
|
|
2301
|
-
const
|
|
2310
|
+
const i = this.countryList, s = document.documentElement.scrollTop, o = i.offsetHeight, a = i.getBoundingClientRect().top + s, c = a + o, g = e.offsetHeight, f = e.getBoundingClientRect().top + s, v = f + g, b = f - a + i.scrollTop;
|
|
2302
2311
|
if (f < a)
|
|
2303
|
-
|
|
2312
|
+
i.scrollTop = b;
|
|
2304
2313
|
else if (v > c) {
|
|
2305
|
-
const
|
|
2306
|
-
|
|
2314
|
+
const S = o - g;
|
|
2315
|
+
i.scrollTop = b - S;
|
|
2307
2316
|
}
|
|
2308
2317
|
}
|
|
2309
2318
|
//* Replace any existing dial code with the new one
|
|
2310
2319
|
//* Note: called from _selectListItem and setCountry
|
|
2311
2320
|
_updateDialCode(e) {
|
|
2312
|
-
const
|
|
2321
|
+
const i = this.telInput.value, s = `+${e}`;
|
|
2313
2322
|
let o;
|
|
2314
|
-
if (
|
|
2315
|
-
const a = this._getDialCode(
|
|
2316
|
-
a ? o =
|
|
2323
|
+
if (i.charAt(0) === "+") {
|
|
2324
|
+
const a = this._getDialCode(i);
|
|
2325
|
+
a ? o = i.replace(a, s) : o = s, this.telInput.value = o;
|
|
2317
2326
|
}
|
|
2318
2327
|
}
|
|
2319
2328
|
//* Try and extract a valid international dial code from a full telephone number.
|
|
2320
2329
|
//* Note: returns the raw string inc plus character and any whitespace/dots etc.
|
|
2321
|
-
_getDialCode(e,
|
|
2330
|
+
_getDialCode(e, i) {
|
|
2322
2331
|
let s = "";
|
|
2323
2332
|
if (e.charAt(0) === "+") {
|
|
2324
2333
|
let o = "";
|
|
2325
2334
|
for (let a = 0; a < e.length; a++) {
|
|
2326
2335
|
const c = e.charAt(a);
|
|
2327
2336
|
if (!isNaN(parseInt(c, 10))) {
|
|
2328
|
-
if (o += c,
|
|
2337
|
+
if (o += c, i)
|
|
2329
2338
|
this.dialCodeToIso2Map[o] && (s = e.substr(0, a + 1));
|
|
2330
2339
|
else if (this.dialCodes[o]) {
|
|
2331
2340
|
s = e.substr(0, a + 1);
|
|
@@ -2340,23 +2349,23 @@ class j2 {
|
|
|
2340
2349
|
}
|
|
2341
2350
|
//* Get the input val, adding the dial code if separateDialCode is enabled.
|
|
2342
2351
|
_getFullNumber(e) {
|
|
2343
|
-
const
|
|
2352
|
+
const i = e || this.telInput.value.trim(), { dialCode: s } = this.selectedCountryData;
|
|
2344
2353
|
let o;
|
|
2345
|
-
const a = c1(
|
|
2346
|
-
return this.options.separateDialCode &&
|
|
2354
|
+
const a = c1(i);
|
|
2355
|
+
return this.options.separateDialCode && i.charAt(0) !== "+" && s && a ? o = `+${s}` : o = "", o + i;
|
|
2347
2356
|
}
|
|
2348
2357
|
//* Remove the dial code if separateDialCode is enabled also cap the length if the input has a maxlength attribute
|
|
2349
2358
|
_beforeSetNumber(e) {
|
|
2350
|
-
let
|
|
2359
|
+
let i = e;
|
|
2351
2360
|
if (this.options.separateDialCode) {
|
|
2352
|
-
let s = this._getDialCode(
|
|
2361
|
+
let s = this._getDialCode(i);
|
|
2353
2362
|
if (s) {
|
|
2354
2363
|
s = `+${this.selectedCountryData.dialCode}`;
|
|
2355
|
-
const o =
|
|
2356
|
-
|
|
2364
|
+
const o = i[s.length] === " " || i[s.length] === "-" ? s.length + 1 : s.length;
|
|
2365
|
+
i = i.substr(o);
|
|
2357
2366
|
}
|
|
2358
2367
|
}
|
|
2359
|
-
return this._cap(
|
|
2368
|
+
return this._cap(i);
|
|
2360
2369
|
}
|
|
2361
2370
|
//* Trigger the 'countrychange' event.
|
|
2362
2371
|
_triggerCountryChange() {
|
|
@@ -2364,19 +2373,19 @@ class j2 {
|
|
|
2364
2373
|
}
|
|
2365
2374
|
//* Format the number as the user types.
|
|
2366
2375
|
_formatNumberAsYouType() {
|
|
2367
|
-
const e = this._getFullNumber(),
|
|
2368
|
-
return this.options.separateDialCode && this.telInput.value.charAt(0) !== "+" &&
|
|
2376
|
+
const e = this._getFullNumber(), i = y.utils ? y.utils.formatNumberAsYouType(e, this.selectedCountryData.iso2) : e, { dialCode: s } = this.selectedCountryData;
|
|
2377
|
+
return this.options.separateDialCode && this.telInput.value.charAt(0) !== "+" && i.includes(`+${s}`) ? (i.split(`+${s}`)[1] || "").trim() : i;
|
|
2369
2378
|
}
|
|
2370
2379
|
//**************************
|
|
2371
2380
|
//* SECRET PUBLIC METHODS
|
|
2372
2381
|
//**************************
|
|
2373
2382
|
//* This is called when the geoip call returns.
|
|
2374
2383
|
handleAutoCountry() {
|
|
2375
|
-
this.options.initialCountry === "auto" &&
|
|
2384
|
+
this.options.initialCountry === "auto" && y.autoCountry && (this.defaultCountry = y.autoCountry, this.selectedCountryData.iso2 || this.selectedCountryInner.classList.contains("iti__globe") || this.setCountry(this.defaultCountry), this.resolveAutoCountryPromise());
|
|
2376
2385
|
}
|
|
2377
2386
|
//* This is called when the utils request completes.
|
|
2378
2387
|
handleUtils() {
|
|
2379
|
-
|
|
2388
|
+
y.utils && (this.telInput.value && this._updateValFromNumber(this.telInput.value), this.selectedCountryData.iso2 && (this._updatePlaceholder(), this._updateMaxLength())), this.resolveUtilsScriptPromise();
|
|
2380
2389
|
}
|
|
2381
2390
|
//********************
|
|
2382
2391
|
//* PUBLIC METHODS
|
|
@@ -2385,7 +2394,7 @@ class j2 {
|
|
|
2385
2394
|
destroy() {
|
|
2386
2395
|
var a, c;
|
|
2387
2396
|
this.telInput.iti = void 0;
|
|
2388
|
-
const { allowDropdown: e, separateDialCode:
|
|
2397
|
+
const { allowDropdown: e, separateDialCode: i } = this.options;
|
|
2389
2398
|
if (e) {
|
|
2390
2399
|
this._closeDropdown(), this.selectedCountry.removeEventListener(
|
|
2391
2400
|
"click",
|
|
@@ -2398,24 +2407,24 @@ class j2 {
|
|
|
2398
2407
|
g && g.removeEventListener("click", this._handleLabelClick);
|
|
2399
2408
|
}
|
|
2400
2409
|
const { form: s } = this.telInput;
|
|
2401
|
-
this._handleHiddenInputSubmit && s && s.removeEventListener("submit", this._handleHiddenInputSubmit), this.telInput.removeEventListener("input", this._handleInputEvent), this._handleKeydownEvent && this.telInput.removeEventListener("keydown", this._handleKeydownEvent), this.telInput.removeAttribute("data-intl-tel-input-id"),
|
|
2410
|
+
this._handleHiddenInputSubmit && s && s.removeEventListener("submit", this._handleHiddenInputSubmit), this.telInput.removeEventListener("input", this._handleInputEvent), this._handleKeydownEvent && this.telInput.removeEventListener("keydown", this._handleKeydownEvent), this.telInput.removeAttribute("data-intl-tel-input-id"), i && (this.isRTL ? this.telInput.style.paddingRight = this.originalPaddingRight : this.telInput.style.paddingLeft = this.originalPaddingLeft);
|
|
2402
2411
|
const o = this.telInput.parentNode;
|
|
2403
|
-
(a = o == null ? void 0 : o.parentNode) == null || a.insertBefore(this.telInput, o), (c = o == null ? void 0 : o.parentNode) == null || c.removeChild(o), delete
|
|
2412
|
+
(a = o == null ? void 0 : o.parentNode) == null || a.insertBefore(this.telInput, o), (c = o == null ? void 0 : o.parentNode) == null || c.removeChild(o), delete y.instances[this.id];
|
|
2404
2413
|
}
|
|
2405
2414
|
//* Get the extension from the current number.
|
|
2406
2415
|
getExtension() {
|
|
2407
|
-
return
|
|
2416
|
+
return y.utils ? y.utils.getExtension(
|
|
2408
2417
|
this._getFullNumber(),
|
|
2409
2418
|
this.selectedCountryData.iso2
|
|
2410
2419
|
) : "";
|
|
2411
2420
|
}
|
|
2412
2421
|
//* Format the number to the given format.
|
|
2413
2422
|
getNumber(e) {
|
|
2414
|
-
if (
|
|
2415
|
-
const { iso2:
|
|
2416
|
-
return
|
|
2423
|
+
if (y.utils) {
|
|
2424
|
+
const { iso2: i } = this.selectedCountryData;
|
|
2425
|
+
return y.utils.formatNumber(
|
|
2417
2426
|
this._getFullNumber(),
|
|
2418
|
-
|
|
2427
|
+
i,
|
|
2419
2428
|
e
|
|
2420
2429
|
);
|
|
2421
2430
|
}
|
|
@@ -2423,7 +2432,7 @@ class j2 {
|
|
|
2423
2432
|
}
|
|
2424
2433
|
//* Get the type of the entered number e.g. landline/mobile.
|
|
2425
2434
|
getNumberType() {
|
|
2426
|
-
return
|
|
2435
|
+
return y.utils ? y.utils.getNumberType(
|
|
2427
2436
|
this._getFullNumber(),
|
|
2428
2437
|
this.selectedCountryData.iso2
|
|
2429
2438
|
) : -99;
|
|
@@ -2434,9 +2443,9 @@ class j2 {
|
|
|
2434
2443
|
}
|
|
2435
2444
|
//* Get the validation error.
|
|
2436
2445
|
getValidationError() {
|
|
2437
|
-
if (
|
|
2446
|
+
if (y.utils) {
|
|
2438
2447
|
const { iso2: e } = this.selectedCountryData;
|
|
2439
|
-
return
|
|
2448
|
+
return y.utils.getValidationError(this._getFullNumber(), e);
|
|
2440
2449
|
}
|
|
2441
2450
|
return -99;
|
|
2442
2451
|
}
|
|
@@ -2444,39 +2453,39 @@ class j2 {
|
|
|
2444
2453
|
isValidNumber() {
|
|
2445
2454
|
if (!this.selectedCountryData.iso2)
|
|
2446
2455
|
return !1;
|
|
2447
|
-
const e = this._getFullNumber(),
|
|
2448
|
-
if (
|
|
2449
|
-
const s = e.substring(0,
|
|
2456
|
+
const e = this._getFullNumber(), i = e.search(new RegExp("\\p{L}", "u"));
|
|
2457
|
+
if (i > -1) {
|
|
2458
|
+
const s = e.substring(0, i), o = this._utilsIsPossibleNumber(s), a = this._utilsIsPossibleNumber(e);
|
|
2450
2459
|
return o && a;
|
|
2451
2460
|
}
|
|
2452
2461
|
return this._utilsIsPossibleNumber(e);
|
|
2453
2462
|
}
|
|
2454
2463
|
_utilsIsPossibleNumber(e) {
|
|
2455
|
-
return
|
|
2464
|
+
return y.utils ? y.utils.isPossibleNumber(e, this.selectedCountryData.iso2, this.options.validationNumberTypes) : null;
|
|
2456
2465
|
}
|
|
2457
2466
|
//* Validate the input val (precise)
|
|
2458
2467
|
isValidNumberPrecise() {
|
|
2459
2468
|
if (!this.selectedCountryData.iso2)
|
|
2460
2469
|
return !1;
|
|
2461
|
-
const e = this._getFullNumber(),
|
|
2462
|
-
if (
|
|
2463
|
-
const s = e.substring(0,
|
|
2470
|
+
const e = this._getFullNumber(), i = e.search(new RegExp("\\p{L}", "u"));
|
|
2471
|
+
if (i > -1) {
|
|
2472
|
+
const s = e.substring(0, i), o = this._utilsIsValidNumber(s), a = this._utilsIsValidNumber(e);
|
|
2464
2473
|
return o && a;
|
|
2465
2474
|
}
|
|
2466
2475
|
return this._utilsIsValidNumber(e);
|
|
2467
2476
|
}
|
|
2468
2477
|
_utilsIsValidNumber(e) {
|
|
2469
|
-
return
|
|
2478
|
+
return y.utils ? y.utils.isValidNumber(e, this.selectedCountryData.iso2, this.options.validationNumberTypes) : null;
|
|
2470
2479
|
}
|
|
2471
2480
|
//* Update the selected country, and update the input val accordingly.
|
|
2472
2481
|
setCountry(e) {
|
|
2473
|
-
const
|
|
2474
|
-
(e &&
|
|
2482
|
+
const i = e == null ? void 0 : e.toLowerCase(), s = this.selectedCountryData.iso2;
|
|
2483
|
+
(e && i !== s || !e && s) && (this._setCountry(i), this._updateDialCode(this.selectedCountryData.dialCode), this._triggerCountryChange());
|
|
2475
2484
|
}
|
|
2476
2485
|
//* Set the input value and update the country.
|
|
2477
2486
|
setNumber(e) {
|
|
2478
|
-
const
|
|
2479
|
-
this._updateValFromNumber(e),
|
|
2487
|
+
const i = this._updateCountryFromNumber(e);
|
|
2488
|
+
this._updateValFromNumber(e), i && this._triggerCountryChange(), this._trigger("input", { isSetNumber: !0 });
|
|
2480
2489
|
}
|
|
2481
2490
|
//* Set the placeholder number typ
|
|
2482
2491
|
setPlaceholderNumberType(e) {
|
|
@@ -2486,31 +2495,31 @@ class j2 {
|
|
|
2486
2495
|
this.telInput.disabled = e, e ? this.selectedCountry.setAttribute("disabled", "true") : this.selectedCountry.removeAttribute("disabled");
|
|
2487
2496
|
}
|
|
2488
2497
|
}
|
|
2489
|
-
const W2 = (
|
|
2490
|
-
if (!
|
|
2498
|
+
const W2 = (I) => {
|
|
2499
|
+
if (!y.utils && !y.startedLoadingUtilsScript) {
|
|
2491
2500
|
let e;
|
|
2492
|
-
if (typeof
|
|
2501
|
+
if (typeof I == "function")
|
|
2493
2502
|
try {
|
|
2494
|
-
e = Promise.resolve(
|
|
2495
|
-
} catch (
|
|
2496
|
-
return Promise.reject(
|
|
2503
|
+
e = Promise.resolve(I());
|
|
2504
|
+
} catch (i) {
|
|
2505
|
+
return Promise.reject(i);
|
|
2497
2506
|
}
|
|
2498
2507
|
else
|
|
2499
|
-
return Promise.reject(new TypeError(`The argument passed to attachUtils must be a function that returns a promise for the utilities module, not ${typeof
|
|
2500
|
-
return
|
|
2501
|
-
const s =
|
|
2508
|
+
return Promise.reject(new TypeError(`The argument passed to attachUtils must be a function that returns a promise for the utilities module, not ${typeof I}`));
|
|
2509
|
+
return y.startedLoadingUtilsScript = !0, e.then((i) => {
|
|
2510
|
+
const s = i == null ? void 0 : i.default;
|
|
2502
2511
|
if (!s || typeof s != "object")
|
|
2503
2512
|
throw new TypeError("The loader function passed to attachUtils did not resolve to a module object with utils as its default export.");
|
|
2504
|
-
return
|
|
2505
|
-
}).catch((
|
|
2506
|
-
throw $1("rejectUtilsScriptPromise",
|
|
2513
|
+
return y.utils = s, $1("handleUtils"), !0;
|
|
2514
|
+
}).catch((i) => {
|
|
2515
|
+
throw $1("rejectUtilsScriptPromise", i), i;
|
|
2507
2516
|
});
|
|
2508
2517
|
}
|
|
2509
2518
|
return null;
|
|
2510
|
-
},
|
|
2511
|
-
(
|
|
2512
|
-
const
|
|
2513
|
-
return
|
|
2519
|
+
}, y = Object.assign(
|
|
2520
|
+
(I, e) => {
|
|
2521
|
+
const i = new j2(I, e);
|
|
2522
|
+
return i._init(), I.setAttribute("data-intl-tel-input-id", i.id.toString()), y.instances[i.id] = i, I.iti = i, i;
|
|
2514
2523
|
},
|
|
2515
2524
|
{
|
|
2516
2525
|
defaults: l2,
|
|
@@ -2519,38 +2528,38 @@ const W2 = (y) => {
|
|
|
2519
2528
|
//* Get the country data object.
|
|
2520
2529
|
getCountryData: () => W,
|
|
2521
2530
|
//* A getter for the plugin instance.
|
|
2522
|
-
getInstance: (
|
|
2523
|
-
const e =
|
|
2524
|
-
return e ?
|
|
2531
|
+
getInstance: (I) => {
|
|
2532
|
+
const e = I.getAttribute("data-intl-tel-input-id");
|
|
2533
|
+
return e ? y.instances[e] : null;
|
|
2525
2534
|
},
|
|
2526
2535
|
//* A map from instance ID to instance object.
|
|
2527
2536
|
instances: {},
|
|
2528
2537
|
attachUtils: W2,
|
|
2529
2538
|
startedLoadingUtilsScript: !1,
|
|
2530
2539
|
startedLoadingAutoCountry: !1,
|
|
2531
|
-
version: "25.
|
|
2540
|
+
version: "25.5.1"
|
|
2532
2541
|
}
|
|
2533
2542
|
);
|
|
2534
2543
|
(function() {
|
|
2535
|
-
var
|
|
2544
|
+
var I = this || self;
|
|
2536
2545
|
function e(d, t) {
|
|
2537
2546
|
d = d.split(".");
|
|
2538
|
-
var $ =
|
|
2547
|
+
var $ = I;
|
|
2539
2548
|
d[0] in $ || typeof $.execScript > "u" || $.execScript("var " + d[0]);
|
|
2540
|
-
for (var
|
|
2549
|
+
for (var n; d.length && (n = d.shift()); ) d.length || t === void 0 ? $[n] && $[n] !== Object.prototype[n] ? $ = $[n] : $ = $[n] = {} : $[n] = t;
|
|
2541
2550
|
}
|
|
2542
|
-
function
|
|
2551
|
+
function i(d, t) {
|
|
2543
2552
|
function $() {
|
|
2544
2553
|
}
|
|
2545
|
-
$.prototype = t.prototype, d.ma = t.prototype, d.prototype = new $(), d.prototype.constructor = d, d.sa = function(
|
|
2554
|
+
$.prototype = t.prototype, d.ma = t.prototype, d.prototype = new $(), d.prototype.constructor = d, d.sa = function(n, r, u) {
|
|
2546
2555
|
for (var l = Array(arguments.length - 2), h = 2; h < arguments.length; h++) l[h - 2] = arguments[h];
|
|
2547
|
-
return t.prototype[r].apply(
|
|
2556
|
+
return t.prototype[r].apply(n, l);
|
|
2548
2557
|
};
|
|
2549
2558
|
}
|
|
2550
2559
|
function s(d) {
|
|
2551
2560
|
const t = [];
|
|
2552
2561
|
let $ = 0;
|
|
2553
|
-
for (const
|
|
2562
|
+
for (const n in d) t[$++] = d[n];
|
|
2554
2563
|
return t;
|
|
2555
2564
|
}
|
|
2556
2565
|
var o = class {
|
|
@@ -2583,32 +2592,32 @@ const W2 = (y) => {
|
|
|
2583
2592
|
}
|
|
2584
2593
|
}
|
|
2585
2594
|
new v();
|
|
2586
|
-
const
|
|
2587
|
-
class
|
|
2595
|
+
const b = {};
|
|
2596
|
+
class S {
|
|
2588
2597
|
constructor() {
|
|
2589
|
-
var t =
|
|
2590
|
-
if (
|
|
2598
|
+
var t = I.trustedTypes && I.trustedTypes.emptyHTML || "";
|
|
2599
|
+
if (b !== b) throw Error("SafeHtml is not meant to be built directly");
|
|
2591
2600
|
this.g = t;
|
|
2592
2601
|
}
|
|
2593
2602
|
toString() {
|
|
2594
2603
|
return this.g.toString();
|
|
2595
2604
|
}
|
|
2596
2605
|
}
|
|
2597
|
-
new
|
|
2606
|
+
new S();
|
|
2598
2607
|
function L(d, t) {
|
|
2599
2608
|
switch (this.g = d, this.l = !!t.aa, this.h = t.i, this.s = t.type, this.o = !1, this.h) {
|
|
2609
|
+
case x:
|
|
2610
|
+
case O:
|
|
2611
|
+
case T:
|
|
2600
2612
|
case G:
|
|
2601
|
-
case F:
|
|
2602
|
-
case M:
|
|
2603
|
-
case k:
|
|
2604
2613
|
case f1:
|
|
2605
|
-
case
|
|
2606
|
-
case
|
|
2614
|
+
case m:
|
|
2615
|
+
case C:
|
|
2607
2616
|
this.o = !0;
|
|
2608
2617
|
}
|
|
2609
2618
|
this.j = t.defaultValue;
|
|
2610
2619
|
}
|
|
2611
|
-
var
|
|
2620
|
+
var C = 1, m = 2, x = 3, O = 4, T = 6, G = 16, f1 = 18;
|
|
2612
2621
|
function h2(d, t) {
|
|
2613
2622
|
for (this.h = d, this.g = {}, d = 0; d < t.length; d++) {
|
|
2614
2623
|
var $ = t[d];
|
|
@@ -2620,48 +2629,48 @@ const W2 = (y) => {
|
|
|
2620
2629
|
return t.g - $.g;
|
|
2621
2630
|
}), d;
|
|
2622
2631
|
}
|
|
2623
|
-
function
|
|
2632
|
+
function R() {
|
|
2624
2633
|
this.h = {}, this.j = this.m().g, this.g = this.l = null;
|
|
2625
2634
|
}
|
|
2626
|
-
|
|
2627
|
-
return
|
|
2628
|
-
},
|
|
2635
|
+
R.prototype.has = function(d) {
|
|
2636
|
+
return B(this, d.g);
|
|
2637
|
+
}, R.prototype.get = function(d, t) {
|
|
2629
2638
|
return p(this, d.g, t);
|
|
2630
|
-
},
|
|
2631
|
-
|
|
2632
|
-
},
|
|
2639
|
+
}, R.prototype.set = function(d, t) {
|
|
2640
|
+
M(this, d.g, t);
|
|
2641
|
+
}, R.prototype.add = function(d, t) {
|
|
2633
2642
|
S1(this, d.g, t);
|
|
2634
2643
|
};
|
|
2635
2644
|
function v1(d, t) {
|
|
2636
|
-
for (var $ = c2(d.m()),
|
|
2637
|
-
var r = $[
|
|
2638
|
-
if (
|
|
2645
|
+
for (var $ = c2(d.m()), n = 0; n < $.length; n++) {
|
|
2646
|
+
var r = $[n], u = r.g;
|
|
2647
|
+
if (B(t, u)) {
|
|
2639
2648
|
d.g && delete d.g[r.g];
|
|
2640
2649
|
var l = r.h == 11 || r.h == 10;
|
|
2641
2650
|
if (r.l) {
|
|
2642
2651
|
r = P(t, u);
|
|
2643
2652
|
for (var h = 0; h < r.length; h++) S1(d, u, l ? r[h].clone() : r[h]);
|
|
2644
|
-
} else r =
|
|
2653
|
+
} else r = i1(t, u), l ? (l = i1(d, u)) ? v1(l, r) : M(d, u, r.clone()) : M(d, u, r);
|
|
2645
2654
|
}
|
|
2646
2655
|
}
|
|
2647
2656
|
}
|
|
2648
|
-
|
|
2657
|
+
R.prototype.clone = function() {
|
|
2649
2658
|
var d = new this.constructor();
|
|
2650
2659
|
return d != this && (d.h = {}, d.g && (d.g = {}), v1(d, this)), d;
|
|
2651
2660
|
};
|
|
2652
|
-
function
|
|
2661
|
+
function B(d, t) {
|
|
2653
2662
|
return d.h[t] != null;
|
|
2654
2663
|
}
|
|
2655
|
-
function
|
|
2664
|
+
function i1(d, t) {
|
|
2656
2665
|
var $ = d.h[t];
|
|
2657
2666
|
if ($ == null) return null;
|
|
2658
2667
|
if (d.l) {
|
|
2659
2668
|
if (!(t in d.g)) {
|
|
2660
|
-
var
|
|
2669
|
+
var n = d.l, r = d.j[t];
|
|
2661
2670
|
if ($ != null) if (r.l) {
|
|
2662
|
-
for (var u = [], l = 0; l < $.length; l++) u[l] =
|
|
2671
|
+
for (var u = [], l = 0; l < $.length; l++) u[l] = n.h(r, $[l]);
|
|
2663
2672
|
$ = u;
|
|
2664
|
-
} else $ =
|
|
2673
|
+
} else $ = n.h(r, $);
|
|
2665
2674
|
return d.g[t] = $;
|
|
2666
2675
|
}
|
|
2667
2676
|
return d.g[t];
|
|
@@ -2669,11 +2678,11 @@ const W2 = (y) => {
|
|
|
2669
2678
|
return $;
|
|
2670
2679
|
}
|
|
2671
2680
|
function p(d, t, $) {
|
|
2672
|
-
var
|
|
2673
|
-
return d.j[t].l ?
|
|
2681
|
+
var n = i1(d, t);
|
|
2682
|
+
return d.j[t].l ? n[$ || 0] : n;
|
|
2674
2683
|
}
|
|
2675
|
-
function
|
|
2676
|
-
if (
|
|
2684
|
+
function w(d, t) {
|
|
2685
|
+
if (B(d, t)) d = p(d, t);
|
|
2677
2686
|
else d: {
|
|
2678
2687
|
if (d = d.j[t], d.j === void 0) if (t = d.s, t === Boolean) d.j = !1;
|
|
2679
2688
|
else if (t === Number) d.j = 0;
|
|
@@ -2687,20 +2696,20 @@ const W2 = (y) => {
|
|
|
2687
2696
|
return d;
|
|
2688
2697
|
}
|
|
2689
2698
|
function P(d, t) {
|
|
2690
|
-
return
|
|
2699
|
+
return i1(d, t) || [];
|
|
2691
2700
|
}
|
|
2692
2701
|
function K(d, t) {
|
|
2693
|
-
return d.j[t].l ?
|
|
2702
|
+
return d.j[t].l ? B(d, t) ? d.h[t].length : 0 : B(d, t) ? 1 : 0;
|
|
2694
2703
|
}
|
|
2695
|
-
function
|
|
2704
|
+
function M(d, t, $) {
|
|
2696
2705
|
d.h[t] = $, d.g && (d.g[t] = $);
|
|
2697
2706
|
}
|
|
2698
2707
|
function S1(d, t, $) {
|
|
2699
2708
|
d.h[t] || (d.h[t] = []), d.h[t].push($), d.g && delete d.g[t];
|
|
2700
2709
|
}
|
|
2701
|
-
function
|
|
2702
|
-
var $ = [],
|
|
2703
|
-
for (
|
|
2710
|
+
function n1(d, t) {
|
|
2711
|
+
var $ = [], n;
|
|
2712
|
+
for (n in t) n != 0 && $.push(new L(n, t[n]));
|
|
2704
2713
|
return new h2(d, $);
|
|
2705
2714
|
}
|
|
2706
2715
|
function s1() {
|
|
@@ -2708,7 +2717,7 @@ const W2 = (y) => {
|
|
|
2708
2717
|
s1.prototype.g = function(d) {
|
|
2709
2718
|
throw new d.h(), Error("Unimplemented");
|
|
2710
2719
|
}, s1.prototype.h = function(d, t) {
|
|
2711
|
-
if (d.h == 11 || d.h == 10) return t instanceof
|
|
2720
|
+
if (d.h == 11 || d.h == 10) return t instanceof R ? t : this.g(d.s.prototype.m(), t);
|
|
2712
2721
|
if (d.h == 14) return typeof t == "string" && w1.test(t) && (d = Number(t), 0 < d) ? d : t;
|
|
2713
2722
|
if (!d.o) return t;
|
|
2714
2723
|
if (d = d.s, d === String) {
|
|
@@ -2719,73 +2728,73 @@ const W2 = (y) => {
|
|
|
2719
2728
|
var w1 = /^-?[0-9]+$/;
|
|
2720
2729
|
function p1() {
|
|
2721
2730
|
}
|
|
2722
|
-
|
|
2731
|
+
i(p1, s1), p1.prototype.g = function(d, t) {
|
|
2723
2732
|
return d = new d.h(), d.l = this, d.h = t, d.g = {}, d;
|
|
2724
2733
|
};
|
|
2725
2734
|
function q() {
|
|
2726
2735
|
}
|
|
2727
|
-
|
|
2736
|
+
i(q, p1), q.prototype.h = function(d, t) {
|
|
2728
2737
|
return d.h == 8 ? !!t : s1.prototype.h.apply(this, arguments);
|
|
2729
2738
|
}, q.prototype.g = function(d, t) {
|
|
2730
2739
|
return q.ma.g.call(this, d, t);
|
|
2731
2740
|
};
|
|
2732
|
-
function
|
|
2741
|
+
function A(d, t) {
|
|
2733
2742
|
d != null && this.g.apply(this, arguments);
|
|
2734
2743
|
}
|
|
2735
|
-
|
|
2744
|
+
A.prototype.h = "", A.prototype.set = function(d) {
|
|
2736
2745
|
this.h = "" + d;
|
|
2737
|
-
},
|
|
2738
|
-
if (this.h += String(d), t != null) for (let
|
|
2746
|
+
}, A.prototype.g = function(d, t, $) {
|
|
2747
|
+
if (this.h += String(d), t != null) for (let n = 1; n < arguments.length; n++) this.h += arguments[n];
|
|
2739
2748
|
return this;
|
|
2740
2749
|
};
|
|
2741
|
-
function
|
|
2750
|
+
function k(d) {
|
|
2742
2751
|
d.h = "";
|
|
2743
2752
|
}
|
|
2744
|
-
|
|
2753
|
+
A.prototype.toString = function() {
|
|
2745
2754
|
return this.h;
|
|
2746
2755
|
};
|
|
2747
2756
|
function z() {
|
|
2748
|
-
|
|
2757
|
+
R.call(this);
|
|
2749
2758
|
}
|
|
2750
|
-
|
|
2759
|
+
i(z, R);
|
|
2751
2760
|
var b1 = null;
|
|
2752
|
-
function
|
|
2753
|
-
|
|
2761
|
+
function N() {
|
|
2762
|
+
R.call(this);
|
|
2754
2763
|
}
|
|
2755
|
-
|
|
2764
|
+
i(N, R);
|
|
2756
2765
|
var L1 = null;
|
|
2757
2766
|
function Z() {
|
|
2758
|
-
|
|
2767
|
+
R.call(this);
|
|
2759
2768
|
}
|
|
2760
|
-
|
|
2769
|
+
i(Z, R);
|
|
2761
2770
|
var N1 = null;
|
|
2762
2771
|
z.prototype.m = function() {
|
|
2763
2772
|
var d = b1;
|
|
2764
|
-
return d || (b1 = d =
|
|
2765
|
-
}, z.m = z.prototype.m,
|
|
2773
|
+
return d || (b1 = d = n1(z, { 0: { name: "NumberFormat", ia: "i18n.phonenumbers.NumberFormat" }, 1: { name: "pattern", required: !0, i: 9, type: String }, 2: { name: "format", required: !0, i: 9, type: String }, 3: { name: "leading_digits_pattern", aa: !0, i: 9, type: String }, 4: { name: "national_prefix_formatting_rule", i: 9, type: String }, 6: { name: "national_prefix_optional_when_formatting", i: 8, defaultValue: !1, type: Boolean }, 5: { name: "domestic_carrier_code_formatting_rule", i: 9, type: String } })), d;
|
|
2774
|
+
}, z.m = z.prototype.m, N.prototype.m = function() {
|
|
2766
2775
|
var d = L1;
|
|
2767
|
-
return d || (L1 = d =
|
|
2768
|
-
},
|
|
2776
|
+
return d || (L1 = d = n1(N, { 0: { name: "PhoneNumberDesc", ia: "i18n.phonenumbers.PhoneNumberDesc" }, 2: { name: "national_number_pattern", i: 9, type: String }, 9: { name: "possible_length", aa: !0, i: 5, type: Number }, 10: { name: "possible_length_local_only", aa: !0, i: 5, type: Number }, 6: { name: "example_number", i: 9, type: String } })), d;
|
|
2777
|
+
}, N.m = N.prototype.m, Z.prototype.m = function() {
|
|
2769
2778
|
var d = N1;
|
|
2770
|
-
return d || (N1 = d =
|
|
2779
|
+
return d || (N1 = d = n1(Z, {
|
|
2771
2780
|
0: { name: "PhoneMetadata", ia: "i18n.phonenumbers.PhoneMetadata" },
|
|
2772
|
-
1: { name: "general_desc", i: 11, type:
|
|
2773
|
-
2: { name: "fixed_line", i: 11, type:
|
|
2774
|
-
3: { name: "mobile", i: 11, type:
|
|
2775
|
-
4: { name: "toll_free", i: 11, type:
|
|
2776
|
-
5: { name: "premium_rate", i: 11, type:
|
|
2777
|
-
6: { name: "shared_cost", i: 11, type:
|
|
2778
|
-
7: { name: "personal_number", i: 11, type:
|
|
2779
|
-
8: { name: "voip", i: 11, type:
|
|
2780
|
-
21: { name: "pager", i: 11, type:
|
|
2781
|
-
25: { name: "uan", i: 11, type:
|
|
2782
|
-
27: { name: "emergency", i: 11, type:
|
|
2783
|
-
28: { name: "voicemail", i: 11, type:
|
|
2784
|
-
29: { name: "short_code", i: 11, type:
|
|
2785
|
-
30: { name: "standard_rate", i: 11, type:
|
|
2786
|
-
31: { name: "carrier_specific", i: 11, type:
|
|
2787
|
-
33: { name: "sms_services", i: 11, type:
|
|
2788
|
-
24: { name: "no_international_dialling", i: 11, type:
|
|
2781
|
+
1: { name: "general_desc", i: 11, type: N },
|
|
2782
|
+
2: { name: "fixed_line", i: 11, type: N },
|
|
2783
|
+
3: { name: "mobile", i: 11, type: N },
|
|
2784
|
+
4: { name: "toll_free", i: 11, type: N },
|
|
2785
|
+
5: { name: "premium_rate", i: 11, type: N },
|
|
2786
|
+
6: { name: "shared_cost", i: 11, type: N },
|
|
2787
|
+
7: { name: "personal_number", i: 11, type: N },
|
|
2788
|
+
8: { name: "voip", i: 11, type: N },
|
|
2789
|
+
21: { name: "pager", i: 11, type: N },
|
|
2790
|
+
25: { name: "uan", i: 11, type: N },
|
|
2791
|
+
27: { name: "emergency", i: 11, type: N },
|
|
2792
|
+
28: { name: "voicemail", i: 11, type: N },
|
|
2793
|
+
29: { name: "short_code", i: 11, type: N },
|
|
2794
|
+
30: { name: "standard_rate", i: 11, type: N },
|
|
2795
|
+
31: { name: "carrier_specific", i: 11, type: N },
|
|
2796
|
+
33: { name: "sms_services", i: 11, type: N },
|
|
2797
|
+
24: { name: "no_international_dialling", i: 11, type: N },
|
|
2789
2798
|
9: { name: "id", required: !0, i: 9, type: String },
|
|
2790
2799
|
10: { name: "country_code", i: 5, type: Number },
|
|
2791
2800
|
11: { name: "international_prefix", i: 9, type: String },
|
|
@@ -2806,13 +2815,13 @@ const W2 = (y) => {
|
|
|
2806
2815
|
})), d;
|
|
2807
2816
|
}, Z.m = Z.prototype.m;
|
|
2808
2817
|
function H() {
|
|
2809
|
-
|
|
2818
|
+
R.call(this);
|
|
2810
2819
|
}
|
|
2811
|
-
|
|
2820
|
+
i(H, R);
|
|
2812
2821
|
var T1 = null, f2 = { ra: 0, qa: 1, pa: 5, oa: 10, na: 20 };
|
|
2813
2822
|
H.prototype.m = function() {
|
|
2814
2823
|
var d = T1;
|
|
2815
|
-
return d || (T1 = d =
|
|
2824
|
+
return d || (T1 = d = n1(H, { 0: { name: "PhoneNumber", ia: "i18n.phonenumbers.PhoneNumber" }, 1: { name: "country_code", required: !0, i: 5, type: Number }, 2: { name: "national_number", required: !0, i: 4, type: Number }, 3: { name: "extension", i: 9, type: String }, 4: { name: "italian_leading_zero", i: 8, type: Boolean }, 8: { name: "number_of_leading_zeros", i: 5, defaultValue: 1, type: Number }, 5: { name: "raw_input", i: 9, type: String }, 6: { name: "country_code_source", i: 14, defaultValue: 0, type: f2 }, 7: {
|
|
2816
2825
|
name: "preferred_domestic_carrier_code",
|
|
2817
2826
|
i: 9,
|
|
2818
2827
|
type: String
|
|
@@ -8252,10 +8261,10 @@ const W2 = (y) => {
|
|
|
8252
8261
|
function J(d) {
|
|
8253
8262
|
return "([0-90-9٠-٩۰-۹]{1," + d + "})";
|
|
8254
8263
|
}
|
|
8255
|
-
function
|
|
8264
|
+
function M1() {
|
|
8256
8265
|
return ";ext=" + J("20") + "|[ \\t,]*(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)[:\\..]?[ \\t,-]*" + (J("20") + "#?|[ \\t,]*(?:[xx##~~]|int|int)[:\\..]?[ \\t,-]*") + (J("9") + "#?|[- ]+") + (J("6") + "#|[ \\t]*(?:,{2}|;)[:\\..]?[ \\t,-]*") + (J("15") + "#?|[ \\t]*(?:,)+[:\\..]?[ \\t,-]*") + (J("9") + "#?");
|
|
8257
8266
|
}
|
|
8258
|
-
var
|
|
8267
|
+
var D1 = new RegExp("(?:" + M1() + ")$", "i"), w2 = new RegExp("^[0-90-9٠-٩۰-۹]{2}$|^[++]*(?:[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~*]*[0-90-9٠-٩۰-۹]){3,}[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~*A-Za-z0-90-9٠-٩۰-۹]*(?:" + M1() + ")?$", "i"), b2 = /(\$\d)/, L2 = /^\(?\$1\)?$/;
|
|
8259
8268
|
function P1(d) {
|
|
8260
8269
|
return 2 > d.length ? !1 : U(w2, d);
|
|
8261
8270
|
}
|
|
@@ -8264,13 +8273,13 @@ const W2 = (y) => {
|
|
|
8264
8273
|
}
|
|
8265
8274
|
function R1(d) {
|
|
8266
8275
|
var t = x1(d.toString());
|
|
8267
|
-
|
|
8276
|
+
k(d), d.g(t);
|
|
8268
8277
|
}
|
|
8269
8278
|
function B1(d) {
|
|
8270
8279
|
return d != null && (K(d, 9) != 1 || P(d, 9)[0] != -1);
|
|
8271
8280
|
}
|
|
8272
8281
|
function r1(d, t) {
|
|
8273
|
-
for (var $ = new
|
|
8282
|
+
for (var $ = new A(), n, r = d.length, u = 0; u < r; ++u) n = d.charAt(u), n = t[n.toUpperCase()], n != null && $.g(n);
|
|
8274
8283
|
return $.toString();
|
|
8275
8284
|
}
|
|
8276
8285
|
function k1(d) {
|
|
@@ -8280,51 +8289,51 @@ const W2 = (y) => {
|
|
|
8280
8289
|
return d != null && isNaN(d) && d.toUpperCase() in A1;
|
|
8281
8290
|
}
|
|
8282
8291
|
D.prototype.format = function(d, t) {
|
|
8283
|
-
if (p(d, 2) == 0 &&
|
|
8284
|
-
var $ =
|
|
8292
|
+
if (p(d, 2) == 0 && B(d, 5)) {
|
|
8293
|
+
var $ = w(d, 5);
|
|
8285
8294
|
if (0 < $.length) return $;
|
|
8286
8295
|
}
|
|
8287
|
-
$ =
|
|
8288
|
-
var
|
|
8289
|
-
if (t == 0) return O1($, 0,
|
|
8290
|
-
if (!($ in X)) return
|
|
8296
|
+
$ = w(d, 1);
|
|
8297
|
+
var n = t1(d);
|
|
8298
|
+
if (t == 0) return O1($, 0, n, "");
|
|
8299
|
+
if (!($ in X)) return n;
|
|
8291
8300
|
var r = d1(this, $, e1($));
|
|
8292
|
-
d =
|
|
8301
|
+
d = B(d, 3) && p(d, 3).length != 0 ? t == 3 ? ";ext=" + p(d, 3) : B(r, 13) ? p(r, 13) + w(d, 3) : " ext. " + w(d, 3) : "";
|
|
8293
8302
|
d: {
|
|
8294
8303
|
r = P(r, 20).length == 0 || t == 2 ? P(r, 19) : P(r, 20);
|
|
8295
8304
|
for (var u, l = r.length, h = 0; h < l; ++h) {
|
|
8296
8305
|
u = r[h];
|
|
8297
|
-
var
|
|
8298
|
-
if ((
|
|
8306
|
+
var _ = K(u, 3);
|
|
8307
|
+
if ((_ == 0 || n.search(p(u, 3, _ - 1)) == 0) && (_ = new RegExp(p(u, 1)), U(_, n))) {
|
|
8299
8308
|
r = u;
|
|
8300
8309
|
break d;
|
|
8301
8310
|
}
|
|
8302
8311
|
}
|
|
8303
8312
|
r = null;
|
|
8304
8313
|
}
|
|
8305
|
-
return r != null && (l = r, r =
|
|
8314
|
+
return r != null && (l = r, r = w(l, 2), u = new RegExp(p(l, 1)), w(
|
|
8306
8315
|
l,
|
|
8307
8316
|
5
|
|
8308
|
-
), l =
|
|
8317
|
+
), l = w(l, 4), n = t == 2 && l != null && 0 < l.length ? n.replace(u, r.replace(b2, l)) : n.replace(u, r), t == 3 && (n = n.replace(RegExp("^[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]+"), ""), n = n.replace(RegExp("[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]+", "g"), "-"))), O1($, t, n, d);
|
|
8309
8318
|
};
|
|
8310
8319
|
function d1(d, t, $) {
|
|
8311
8320
|
return $ == "001" ? j(d, "" + t) : j(d, $);
|
|
8312
8321
|
}
|
|
8313
8322
|
function t1(d) {
|
|
8314
|
-
if (!
|
|
8323
|
+
if (!B(d, 2)) return "";
|
|
8315
8324
|
var t = "" + p(d, 2);
|
|
8316
|
-
return
|
|
8325
|
+
return B(d, 4) && p(d, 4) && 0 < w(d, 8) ? Array(w(d, 8) + 1).join("0") + t : t;
|
|
8317
8326
|
}
|
|
8318
|
-
function O1(d, t, $,
|
|
8327
|
+
function O1(d, t, $, n) {
|
|
8319
8328
|
switch (t) {
|
|
8320
8329
|
case 0:
|
|
8321
|
-
return "+" + d + $ +
|
|
8330
|
+
return "+" + d + $ + n;
|
|
8322
8331
|
case 1:
|
|
8323
|
-
return "+" + d + " " + $ +
|
|
8332
|
+
return "+" + d + " " + $ + n;
|
|
8324
8333
|
case 3:
|
|
8325
|
-
return "tel:+" + d + "-" + $ +
|
|
8334
|
+
return "tel:+" + d + "-" + $ + n;
|
|
8326
8335
|
default:
|
|
8327
|
-
return $ +
|
|
8336
|
+
return $ + n;
|
|
8328
8337
|
}
|
|
8329
8338
|
}
|
|
8330
8339
|
function u1(d, t) {
|
|
@@ -8356,10 +8365,10 @@ const W2 = (y) => {
|
|
|
8356
8365
|
}
|
|
8357
8366
|
function G1(d, t) {
|
|
8358
8367
|
var $ = F1(d, t);
|
|
8359
|
-
return d = d1(d,
|
|
8368
|
+
return d = d1(d, w(t, 1), $), d == null ? -1 : (t = t1(t), C1(t, d));
|
|
8360
8369
|
}
|
|
8361
8370
|
function C1(d, t) {
|
|
8362
|
-
return
|
|
8371
|
+
return F(d, p(t, 1)) ? F(d, p(t, 5)) ? 4 : F(d, p(t, 4)) ? 3 : F(d, p(t, 6)) ? 5 : F(d, p(t, 8)) ? 6 : F(d, p(t, 7)) ? 7 : F(d, p(t, 21)) ? 8 : F(d, p(t, 25)) ? 9 : F(d, p(t, 28)) ? 10 : F(d, p(t, 2)) ? p(t, 18) || F(d, p(t, 3)) ? 2 : 0 : !p(t, 18) && F(d, p(t, 3)) ? 1 : -1 : -1;
|
|
8363
8372
|
}
|
|
8364
8373
|
function j(d, t) {
|
|
8365
8374
|
if (t == null) return null;
|
|
@@ -8371,31 +8380,31 @@ const W2 = (y) => {
|
|
|
8371
8380
|
}
|
|
8372
8381
|
return $;
|
|
8373
8382
|
}
|
|
8374
|
-
function
|
|
8383
|
+
function F(d, t) {
|
|
8375
8384
|
var $ = d.length;
|
|
8376
|
-
return 0 < K(t, 9) && P(t, 9).indexOf($) == -1 ? !1 : U(
|
|
8385
|
+
return 0 < K(t, 9) && P(t, 9).indexOf($) == -1 ? !1 : U(w(t, 2), d);
|
|
8377
8386
|
}
|
|
8378
8387
|
function N2(d, t) {
|
|
8379
|
-
var $ = F1(d, t),
|
|
8380
|
-
return r == null || $ != "001" &&
|
|
8388
|
+
var $ = F1(d, t), n = w(t, 1), r = d1(d, n, $);
|
|
8389
|
+
return r == null || $ != "001" && n != U1(d, $) ? r = !1 : (d = t1(t), r = C1(d, r) != -1), r;
|
|
8381
8390
|
}
|
|
8382
8391
|
function F1(d, t) {
|
|
8383
8392
|
if (t == null) return null;
|
|
8384
|
-
var $ =
|
|
8393
|
+
var $ = w(t, 1);
|
|
8385
8394
|
if ($ = X[$], $ == null) d = null;
|
|
8386
8395
|
else if ($.length == 1) d = $[0];
|
|
8387
8396
|
else d: {
|
|
8388
8397
|
t = t1(t);
|
|
8389
|
-
for (var
|
|
8390
|
-
|
|
8391
|
-
var l = j(d,
|
|
8392
|
-
if (
|
|
8398
|
+
for (var n, r = $.length, u = 0; u < r; u++) {
|
|
8399
|
+
n = $[u];
|
|
8400
|
+
var l = j(d, n);
|
|
8401
|
+
if (B(l, 23)) {
|
|
8393
8402
|
if (t.search(p(l, 23)) == 0) {
|
|
8394
|
-
d =
|
|
8403
|
+
d = n;
|
|
8395
8404
|
break d;
|
|
8396
8405
|
}
|
|
8397
8406
|
} else if (C1(t, l) != -1) {
|
|
8398
|
-
d =
|
|
8407
|
+
d = n;
|
|
8399
8408
|
break d;
|
|
8400
8409
|
}
|
|
8401
8410
|
}
|
|
@@ -8408,54 +8417,54 @@ const W2 = (y) => {
|
|
|
8408
8417
|
}
|
|
8409
8418
|
function U1(d, t) {
|
|
8410
8419
|
if (d = j(d, t), d == null) throw Error("Invalid region code: " + t);
|
|
8411
|
-
return
|
|
8420
|
+
return w(d, 10);
|
|
8412
8421
|
}
|
|
8413
|
-
function l1(d, t, $,
|
|
8414
|
-
var r = u1($,
|
|
8415
|
-
if (r = P(r, 10),
|
|
8422
|
+
function l1(d, t, $, n) {
|
|
8423
|
+
var r = u1($, n), u = K(r, 9) == 0 ? P(p($, 1), 9) : P(r, 9);
|
|
8424
|
+
if (r = P(r, 10), n == 2) if (B1(u1($, 0))) d = u1($, 1), B1(d) && (u = u.concat(K(d, 9) == 0 ? P(p($, 1), 9) : P(d, 9)), u.sort(), r.length == 0 ? r = P(d, 10) : (r = r.concat(P(d, 10)), r.sort()));
|
|
8416
8425
|
else return l1(d, t, $, 1);
|
|
8417
8426
|
return u[0] == -1 ? 5 : (t = t.length, -1 < r.indexOf(t) ? 4 : ($ = u[0], $ == t ? 0 : $ > t ? 2 : u[u.length - 1] < t ? 3 : -1 < u.indexOf(t, 1) ? 0 : 5));
|
|
8418
8427
|
}
|
|
8419
8428
|
function a1(d, t, $) {
|
|
8420
|
-
var
|
|
8421
|
-
return t =
|
|
8429
|
+
var n = t1(t);
|
|
8430
|
+
return t = w(t, 1), t in X ? (t = d1(d, t, e1(t)), l1(d, n, t, $)) : 1;
|
|
8422
8431
|
}
|
|
8423
8432
|
function V1(d, t) {
|
|
8424
8433
|
if (d = d.toString(), d.length == 0 || d.charAt(0) == "0") return 0;
|
|
8425
|
-
for (var $,
|
|
8434
|
+
for (var $, n = d.length, r = 1; 3 >= r && r <= n; ++r) if ($ = parseInt(d.substring(0, r), 10), $ in X) return t.g(d.substring(r)), $;
|
|
8426
8435
|
return 0;
|
|
8427
8436
|
}
|
|
8428
|
-
function K1(d, t, $,
|
|
8437
|
+
function K1(d, t, $, n, r, u) {
|
|
8429
8438
|
if (t.length == 0) return 0;
|
|
8430
|
-
t = new
|
|
8439
|
+
t = new A(t);
|
|
8431
8440
|
var l;
|
|
8432
8441
|
$ != null && (l = p($, 11)), l == null && (l = "NonMatch");
|
|
8433
8442
|
var h = t.toString();
|
|
8434
8443
|
if (h.length == 0) l = 20;
|
|
8435
|
-
else if (Q.test(h)) h = h.replace(Q, ""),
|
|
8444
|
+
else if (Q.test(h)) h = h.replace(Q, ""), k(t), t.g(x1(h)), l = 1;
|
|
8436
8445
|
else {
|
|
8437
8446
|
if (h = new RegExp(l), R1(t), l = t.toString(), l.search(h) == 0) {
|
|
8438
8447
|
h = l.match(h)[0].length;
|
|
8439
|
-
var
|
|
8440
|
-
|
|
8448
|
+
var _ = l.substring(h).match(E1);
|
|
8449
|
+
_ && _[1] != null && 0 < _[1].length && r1(_[1], g1) == "0" ? l = !1 : (k(t), t.g(l.substring(h)), l = !0);
|
|
8441
8450
|
} else l = !1;
|
|
8442
8451
|
l = l ? 5 : 20;
|
|
8443
8452
|
}
|
|
8444
|
-
if (r &&
|
|
8453
|
+
if (r && M(u, 6, l), l != 20) {
|
|
8445
8454
|
if (2 >= t.h.length) throw Error("Phone number too short after IDD");
|
|
8446
|
-
if (d = V1(t,
|
|
8455
|
+
if (d = V1(t, n), d != 0) return M(u, 1, d), d;
|
|
8447
8456
|
throw Error("Invalid country calling code");
|
|
8448
8457
|
}
|
|
8449
|
-
return $ != null && (l =
|
|
8458
|
+
return $ != null && (l = w($, 10), h = "" + l, _ = t.toString(), _.lastIndexOf(h, 0) == 0 && (h = new A(_.substring(h.length)), _ = p($, 1), _ = new RegExp(w(_, 2)), H1(h, $, null), h = h.toString(), !U(_, t.toString()) && U(_, h) || l1(d, t.toString(), $, -1) == 3)) ? (n.g(h), r && M(u, 6, 10), M(u, 1, l), l) : (M(u, 1, 0), 0);
|
|
8450
8459
|
}
|
|
8451
8460
|
function H1(d, t, $) {
|
|
8452
|
-
var
|
|
8461
|
+
var n = d.toString(), r = n.length, u = p(t, 15);
|
|
8453
8462
|
if (r != 0 && u != null && u.length != 0) {
|
|
8454
8463
|
var l = new RegExp("^(?:" + u + ")");
|
|
8455
|
-
if (r = l.exec(
|
|
8456
|
-
u = new RegExp(
|
|
8457
|
-
var h = U(u,
|
|
8458
|
-
t = p(t, 16), t == null || t.length == 0 || r[
|
|
8464
|
+
if (r = l.exec(n)) {
|
|
8465
|
+
u = new RegExp(w(p(t, 1), 2));
|
|
8466
|
+
var h = U(u, n), _ = r.length - 1;
|
|
8467
|
+
t = p(t, 16), t == null || t.length == 0 || r[_] == null || r[_].length == 0 ? (!h || U(u, n.substring(r[0].length))) && ($ != null && 0 < _ && r[_] != null && $.g(r[1]), d.set(n.substring(r[0].length))) : (n = n.replace(l, t), (!h || U(u, n)) && ($ != null && 0 < _ && $.g(r[1]), d.set(n)));
|
|
8459
8468
|
}
|
|
8460
8469
|
}
|
|
8461
8470
|
}
|
|
@@ -8463,10 +8472,10 @@ const W2 = (y) => {
|
|
|
8463
8472
|
if (!o1($) && 0 < t.length && t.charAt(0) != "+") throw Error("Invalid country calling code");
|
|
8464
8473
|
return j1(d, t, $, !0);
|
|
8465
8474
|
}
|
|
8466
|
-
function j1(d, t, $,
|
|
8475
|
+
function j1(d, t, $, n) {
|
|
8467
8476
|
if (t == null) throw Error("The string supplied did not seem to be a phone number");
|
|
8468
8477
|
if (250 < t.length) throw Error("The string supplied is too long to be a phone number");
|
|
8469
|
-
var r = new
|
|
8478
|
+
var r = new A(), u = t.indexOf(";phone-context=");
|
|
8470
8479
|
if (u === -1) u = null;
|
|
8471
8480
|
else if (u += 15, u >= t.length) u = "";
|
|
8472
8481
|
else {
|
|
@@ -8474,47 +8483,47 @@ const W2 = (y) => {
|
|
|
8474
8483
|
u = l !== -1 ? t.substring(u, l) : t.substring(u);
|
|
8475
8484
|
}
|
|
8476
8485
|
var h = u;
|
|
8477
|
-
if (h == null ? l = !0 : h.length === 0 ? l = !1 : (l = v2.exec(h), h = S2.exec(h), l = l !== null || h !== null), !l || (u != null ? (u.charAt(0) === "+" && r.g(u), u = t.indexOf("tel:"), r.g(t.substring(0 <= u ? u + 4 : 0, t.indexOf(";phone-context=")))) : (u = r.g, l = t ?? "", h = l.search(m2), 0 <= h ? (l = l.substring(h), l = l.replace(_2, ""), h = l.search(y2), 0 <= h && (l = l.substring(0, h))) : l = "", u.call(r, l)), u = r.toString(), l = u.indexOf(";isub="), 0 < l && (
|
|
8486
|
+
if (h == null ? l = !0 : h.length === 0 ? l = !1 : (l = v2.exec(h), h = S2.exec(h), l = l !== null || h !== null), !l || (u != null ? (u.charAt(0) === "+" && r.g(u), u = t.indexOf("tel:"), r.g(t.substring(0 <= u ? u + 4 : 0, t.indexOf(";phone-context=")))) : (u = r.g, l = t ?? "", h = l.search(m2), 0 <= h ? (l = l.substring(h), l = l.replace(_2, ""), h = l.search(y2), 0 <= h && (l = l.substring(0, h))) : l = "", u.call(r, l)), u = r.toString(), l = u.indexOf(";isub="), 0 < l && (k(r), r.g(u.substring(0, l))), !P1(r.toString()))) throw Error("The string supplied did not seem to be a phone number");
|
|
8478
8487
|
if (u = r.toString(), !(o1($) || u != null && 0 < u.length && Q.test(u))) throw Error("Invalid country calling code");
|
|
8479
|
-
u = new H(),
|
|
8488
|
+
u = new H(), n && M(u, 5, t);
|
|
8480
8489
|
d: {
|
|
8481
|
-
if (t = r.toString(), l = t.search(
|
|
8482
|
-
h = t.match(
|
|
8483
|
-
for (var
|
|
8484
|
-
|
|
8490
|
+
if (t = r.toString(), l = t.search(D1), 0 <= l && P1(t.substring(0, l))) {
|
|
8491
|
+
h = t.match(D1);
|
|
8492
|
+
for (var _ = h.length, V = 1; V < _; ++V) if (h[V] != null && 0 < h[V].length) {
|
|
8493
|
+
k(r), r.g(t.substring(0, l)), t = h[V];
|
|
8485
8494
|
break d;
|
|
8486
8495
|
}
|
|
8487
8496
|
}
|
|
8488
8497
|
t = "";
|
|
8489
8498
|
}
|
|
8490
|
-
0 < t.length &&
|
|
8499
|
+
0 < t.length && M(u, 3, t), l = j(d, $), t = new A(), h = 0, _ = r.toString();
|
|
8491
8500
|
try {
|
|
8492
|
-
h = K1(d,
|
|
8501
|
+
h = K1(d, _, l, t, n, u);
|
|
8493
8502
|
} catch (_1) {
|
|
8494
|
-
if (_1.message == "Invalid country calling code" && Q.test(
|
|
8495
|
-
if (
|
|
8503
|
+
if (_1.message == "Invalid country calling code" && Q.test(_)) {
|
|
8504
|
+
if (_ = _.replace(Q, ""), h = K1(d, _, l, t, n, u), h == 0) throw _1;
|
|
8496
8505
|
} else throw _1;
|
|
8497
8506
|
}
|
|
8498
|
-
if (h != 0 ? (r = e1(h), r != $ && (l = d1(d, h, r))) : (R1(r), t.g(r.toString()), $ != null ? (h =
|
|
8507
|
+
if (h != 0 ? (r = e1(h), r != $ && (l = d1(d, h, r))) : (R1(r), t.g(r.toString()), $ != null ? (h = w(l, 10), M(
|
|
8499
8508
|
u,
|
|
8500
8509
|
1,
|
|
8501
8510
|
h
|
|
8502
|
-
)) :
|
|
8511
|
+
)) : n && (delete u.h[6], u.g && delete u.g[6])), 2 > t.h.length || (l != null && ($ = new A(), r = new A(t.toString()), H1(r, l, $), d = l1(d, r.toString(), l, -1), d != 2 && d != 4 && d != 5 && (t = r, n && 0 < $.toString().length && M(u, 7, $.toString()))), n = t.toString(), d = n.length, 2 > d)) throw Error("The string supplied is too short to be a phone number");
|
|
8503
8512
|
if (17 < d) throw Error("The string supplied is too long to be a phone number");
|
|
8504
|
-
if (1 <
|
|
8505
|
-
for (
|
|
8506
|
-
d != 1 &&
|
|
8513
|
+
if (1 < n.length && n.charAt(0) == "0") {
|
|
8514
|
+
for (M(u, 4, !0), d = 1; d < n.length - 1 && n.charAt(d) == "0"; ) d++;
|
|
8515
|
+
d != 1 && M(u, 8, d);
|
|
8507
8516
|
}
|
|
8508
|
-
return
|
|
8517
|
+
return M(u, 2, parseInt(n, 10)), u;
|
|
8509
8518
|
}
|
|
8510
8519
|
function U(d, t) {
|
|
8511
8520
|
return !!((d = t.match(new RegExp("^(?:" + (typeof d == "string" ? d : d.source) + ")$", "i"))) && d[0].length == t.length);
|
|
8512
8521
|
}
|
|
8513
8522
|
function T2(d) {
|
|
8514
|
-
this.fa = RegExp(" "), this.ja = "", this.v = new
|
|
8523
|
+
this.fa = RegExp(" "), this.ja = "", this.v = new A(), this.da = "", this.s = new A(), this.ba = new A(), this.u = !0, this.ea = this.ca = this.la = !1, this.ga = D.g(), this.$ = 0, this.h = new A(), this.ha = !1, this.o = "", this.g = new A(), this.j = [], this.ka = d, this.l = Z1(this, this.ka);
|
|
8515
8524
|
}
|
|
8516
8525
|
var W1 = new Z();
|
|
8517
|
-
|
|
8526
|
+
M(W1, 11, "NA");
|
|
8518
8527
|
var A2 = RegExp("^[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*\\$1[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*(\\$\\d[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*)*$"), z1 = /[- ]/;
|
|
8519
8528
|
function Z1(d, t) {
|
|
8520
8529
|
var $ = d.ga;
|
|
@@ -8522,21 +8531,21 @@ const W2 = (y) => {
|
|
|
8522
8531
|
}
|
|
8523
8532
|
function Y1(d) {
|
|
8524
8533
|
for (var t = d.j.length, $ = 0; $ < t; ++$) {
|
|
8525
|
-
var
|
|
8534
|
+
var n = d.j[$], r = w(n, 1);
|
|
8526
8535
|
if (d.da == r) return !1;
|
|
8527
|
-
var u = d, l =
|
|
8528
|
-
|
|
8529
|
-
var
|
|
8530
|
-
l =
|
|
8536
|
+
var u = d, l = n, h = w(l, 1);
|
|
8537
|
+
k(u.v);
|
|
8538
|
+
var _ = u;
|
|
8539
|
+
l = w(l, 2);
|
|
8531
8540
|
var V = "999999999999999".match(h)[0];
|
|
8532
|
-
if (V.length <
|
|
8541
|
+
if (V.length < _.g.h.length ? _ = "" : (_ = V.replace(new RegExp(h, "g"), l), _ = _.replace(RegExp("9", "g"), " ")), 0 < _.length ? (u.v.g(_), u = !0) : u = !1, u) return d.da = r, d.ha = z1.test(p(n, 4)), d.$ = 0, !0;
|
|
8533
8542
|
}
|
|
8534
8543
|
return d.u = !1;
|
|
8535
8544
|
}
|
|
8536
8545
|
function J1(d, t) {
|
|
8537
|
-
for (var $ = [],
|
|
8546
|
+
for (var $ = [], n = t.length - 3, r = d.j.length, u = 0; u < r; ++u) {
|
|
8538
8547
|
var l = d.j[u];
|
|
8539
|
-
K(l, 3) == 0 ? $.push(d.j[u]) : (l = p(l, 3, Math.min(
|
|
8548
|
+
K(l, 3) == 0 ? $.push(d.j[u]) : (l = p(l, 3, Math.min(n, K(l, 3) - 1)), t.search(l) == 0 && $.push(d.j[u]));
|
|
8540
8549
|
}
|
|
8541
8550
|
d.j = $;
|
|
8542
8551
|
}
|
|
@@ -8547,7 +8556,7 @@ const W2 = (y) => {
|
|
|
8547
8556
|
if (!d.la) {
|
|
8548
8557
|
if (t2(d)) {
|
|
8549
8558
|
if (e2(d)) return q1(d);
|
|
8550
|
-
} else if (0 < d.o.length && (t = d.g.toString(),
|
|
8559
|
+
} else if (0 < d.o.length && (t = d.g.toString(), k(d.g), d.g.g(d.o), d.g.g(t), t = d.h.toString(), $ = t.lastIndexOf(d.o), k(d.h), d.h.g(t.substring(0, $))), d.o != d2(d)) return d.h.g(" "), q1(d);
|
|
8551
8560
|
}
|
|
8552
8561
|
return d.s.toString();
|
|
8553
8562
|
}
|
|
@@ -8564,11 +8573,11 @@ const W2 = (y) => {
|
|
|
8564
8573
|
}
|
|
8565
8574
|
}
|
|
8566
8575
|
function q1(d) {
|
|
8567
|
-
return d.u = !0, d.ea = !1, d.j = [], d.$ = 0,
|
|
8576
|
+
return d.u = !0, d.ea = !1, d.j = [], d.$ = 0, k(d.v), d.da = "", m1(d);
|
|
8568
8577
|
}
|
|
8569
8578
|
function X1(d) {
|
|
8570
|
-
for (var t = d.g.toString(), $ = d.j.length,
|
|
8571
|
-
var r = d.j[
|
|
8579
|
+
for (var t = d.g.toString(), $ = d.j.length, n = 0; n < $; ++n) {
|
|
8580
|
+
var r = d.j[n], u = w(r, 1);
|
|
8572
8581
|
if (new RegExp("^(?:" + u + ")$").test(t) && (d.ha = z1.test(p(r, 4)), r = t.replace(new RegExp(u, "g"), p(r, 2)), r = h1(d, r), r1(r, p2) == d.ba)) return r;
|
|
8573
8582
|
}
|
|
8574
8583
|
return "";
|
|
@@ -8580,9 +8589,9 @@ const W2 = (y) => {
|
|
|
8580
8589
|
function m1(d) {
|
|
8581
8590
|
var t = d.g.toString();
|
|
8582
8591
|
if (3 <= t.length) {
|
|
8583
|
-
for (var $ = d.ca && d.o.length == 0 && 0 < K(d.l, 20) ? P(d.l, 20) : P(d.l, 19),
|
|
8592
|
+
for (var $ = d.ca && d.o.length == 0 && 0 < K(d.l, 20) ? P(d.l, 20) : P(d.l, 19), n = $.length, r = 0; r < n; ++r) {
|
|
8584
8593
|
var u = $[r];
|
|
8585
|
-
0 < d.o.length && k1(
|
|
8594
|
+
0 < d.o.length && k1(w(u, 4)) && !p(u, 6) && !B(u, 5) || (d.o.length != 0 || d.ca || k1(w(u, 4)) || p(u, 6)) && A2.test(w(u, 2)) && d.j.push(u);
|
|
8586
8595
|
}
|
|
8587
8596
|
return J1(d, t), t = X1(d), 0 < t.length ? t : Y1(d) ? Q1(d) : d.s.toString();
|
|
8588
8597
|
}
|
|
@@ -8591,42 +8600,42 @@ const W2 = (y) => {
|
|
|
8591
8600
|
function Q1(d) {
|
|
8592
8601
|
var t = d.g.toString(), $ = t.length;
|
|
8593
8602
|
if (0 < $) {
|
|
8594
|
-
for (var
|
|
8595
|
-
return d.u ? h1(d,
|
|
8603
|
+
for (var n = "", r = 0; r < $; r++) n = $2(d, t.charAt(r));
|
|
8604
|
+
return d.u ? h1(d, n) : d.s.toString();
|
|
8596
8605
|
}
|
|
8597
8606
|
return d.h.toString();
|
|
8598
8607
|
}
|
|
8599
8608
|
function d2(d) {
|
|
8600
8609
|
var t = d.g.toString(), $ = 0;
|
|
8601
|
-
if (p(d.l, 10) != 1) var
|
|
8602
|
-
else
|
|
8603
|
-
return
|
|
8610
|
+
if (p(d.l, 10) != 1) var n = !1;
|
|
8611
|
+
else n = d.g.toString(), n = n.charAt(0) == "1" && n.charAt(1) != "0" && n.charAt(1) != "1";
|
|
8612
|
+
return n ? ($ = 1, d.h.g("1").g(" "), d.ca = !0) : B(d.l, 15) && (n = new RegExp("^(?:" + p(d.l, 15) + ")"), n = t.match(n), n != null && n[0] != null && 0 < n[0].length && (d.ca = !0, $ = n[0].length, d.h.g(t.substring(0, $)))), k(d.g), d.g.g(t.substring($)), t.substring(0, $);
|
|
8604
8613
|
}
|
|
8605
8614
|
function t2(d) {
|
|
8606
8615
|
var t = d.ba.toString(), $ = new RegExp("^(?:\\+|" + p(d.l, 11) + ")");
|
|
8607
|
-
return $ = t.match($), $ != null && $[0] != null && 0 < $[0].length ? (d.ca = !0, $ = $[0].length,
|
|
8616
|
+
return $ = t.match($), $ != null && $[0] != null && 0 < $[0].length ? (d.ca = !0, $ = $[0].length, k(d.g), d.g.g(t.substring($)), k(d.h), d.h.g(t.substring(0, $)), t.charAt(0) != "+" && d.h.g(" "), !0) : !1;
|
|
8608
8617
|
}
|
|
8609
8618
|
function e2(d) {
|
|
8610
8619
|
if (d.g.h.length == 0) return !1;
|
|
8611
|
-
var t = new
|
|
8612
|
-
return $ == 0 ? !1 : (
|
|
8620
|
+
var t = new A(), $ = V1(d.g, t);
|
|
8621
|
+
return $ == 0 ? !1 : (k(d.g), d.g.g(t.toString()), t = e1($), t == "001" ? d.l = j(d.ga, "" + $) : t != d.ka && (d.l = Z1(d, t)), d.h.g("" + $).g(" "), d.o = "", !0);
|
|
8613
8622
|
}
|
|
8614
8623
|
function $2(d, t) {
|
|
8615
8624
|
var $ = d.v.toString();
|
|
8616
8625
|
if (0 <= $.substring(d.$).search(d.fa)) {
|
|
8617
|
-
var
|
|
8618
|
-
return t = $.replace(d.fa, t),
|
|
8626
|
+
var n = $.search(d.fa);
|
|
8627
|
+
return t = $.replace(d.fa, t), k(d.v), d.v.g(t), d.$ = n, t.substring(0, d.$ + 1);
|
|
8619
8628
|
}
|
|
8620
8629
|
return d.j.length == 1 && (d.u = !1), d.da = "", d.s.toString();
|
|
8621
8630
|
}
|
|
8622
|
-
const
|
|
8631
|
+
const i2 = (d) => {
|
|
8623
8632
|
d.includes("FIXED_LINE_OR_MOBILE") ? (d.includes("MOBILE") || d.push("MOBILE"), d.includes("FIXED_LINE") || d.push("FIXED_LINE")) : (d.includes("MOBILE") || d.includes("FIXED_LINE")) && d.push("FIXED_LINE_OR_MOBILE");
|
|
8624
8633
|
}, y1 = { FIXED_LINE: 0, MOBILE: 1, FIXED_LINE_OR_MOBILE: 2, TOLL_FREE: 3, PREMIUM_RATE: 4, SHARED_COST: 5, VOIP: 6, PERSONAL_NUMBER: 7, PAGER: 8, UAN: 9, VOICEMAIL: 10, UNKNOWN: -1 };
|
|
8625
8634
|
e("intlTelInputUtilsTemp", {}), e("intlTelInputUtilsTemp.formatNumberAsYouType", (d, t) => {
|
|
8626
8635
|
try {
|
|
8627
|
-
const $ = d.replace(/[^+0-9]/g, ""),
|
|
8636
|
+
const $ = d.replace(/[^+0-9]/g, ""), n = new T2(t);
|
|
8628
8637
|
t = "";
|
|
8629
|
-
for (let r = 0; r < $.length; r++)
|
|
8638
|
+
for (let r = 0; r < $.length; r++) n.ja = E2(n, $.charAt(r)), t = n.ja;
|
|
8630
8639
|
return t;
|
|
8631
8640
|
} catch {
|
|
8632
8641
|
return d;
|
|
@@ -8634,20 +8643,20 @@ const W2 = (y) => {
|
|
|
8634
8643
|
}), e("intlTelInputUtilsTemp.formatNumber", (d, t, $) => {
|
|
8635
8644
|
try {
|
|
8636
8645
|
const r = D.g(), u = Y(r, d, t);
|
|
8637
|
-
var
|
|
8638
|
-
return
|
|
8646
|
+
var n = a1(r, u, -1);
|
|
8647
|
+
return n == 0 || n == 4 ? r.format(u, typeof $ > "u" ? 0 : $) : d;
|
|
8639
8648
|
} catch {
|
|
8640
8649
|
return d;
|
|
8641
8650
|
}
|
|
8642
|
-
}), e("intlTelInputUtilsTemp.getExampleNumber", (d, t, $,
|
|
8651
|
+
}), e("intlTelInputUtilsTemp.getExampleNumber", (d, t, $, n) => {
|
|
8643
8652
|
try {
|
|
8644
|
-
const
|
|
8653
|
+
const _ = D.g();
|
|
8645
8654
|
d: {
|
|
8646
|
-
var r =
|
|
8655
|
+
var r = _;
|
|
8647
8656
|
if (o1(d)) {
|
|
8648
8657
|
var u = u1(j(r, d), $);
|
|
8649
8658
|
try {
|
|
8650
|
-
if (
|
|
8659
|
+
if (B(u, 6)) {
|
|
8651
8660
|
var l = p(u, 6), h = j1(r, l, d, !1);
|
|
8652
8661
|
break d;
|
|
8653
8662
|
}
|
|
@@ -8656,7 +8665,7 @@ const W2 = (y) => {
|
|
|
8656
8665
|
}
|
|
8657
8666
|
h = null;
|
|
8658
8667
|
}
|
|
8659
|
-
return
|
|
8668
|
+
return _.format(h, n ? 0 : t ? 2 : 1);
|
|
8660
8669
|
} catch {
|
|
8661
8670
|
return "";
|
|
8662
8671
|
}
|
|
@@ -8668,26 +8677,26 @@ const W2 = (y) => {
|
|
|
8668
8677
|
}
|
|
8669
8678
|
}), e("intlTelInputUtilsTemp.getNumberType", (d, t) => {
|
|
8670
8679
|
try {
|
|
8671
|
-
const $ = D.g(),
|
|
8672
|
-
return G1($,
|
|
8680
|
+
const $ = D.g(), n = Y($, d, t);
|
|
8681
|
+
return G1($, n);
|
|
8673
8682
|
} catch {
|
|
8674
8683
|
return -99;
|
|
8675
8684
|
}
|
|
8676
8685
|
}), e("intlTelInputUtilsTemp.getValidationError", (d, t) => {
|
|
8677
8686
|
if (!t) return 1;
|
|
8678
8687
|
try {
|
|
8679
|
-
const $ = D.g(),
|
|
8680
|
-
return a1($,
|
|
8688
|
+
const $ = D.g(), n = Y($, d, t);
|
|
8689
|
+
return a1($, n, -1);
|
|
8681
8690
|
} catch ($) {
|
|
8682
8691
|
return $.message === "Invalid country calling code" ? 1 : 3 >= d.length || $.message === "Phone number too short after IDD" || $.message === "The string supplied is too short to be a phone number" ? 2 : $.message === "The string supplied is too long to be a phone number" ? 3 : -99;
|
|
8683
8692
|
}
|
|
8684
8693
|
}), e("intlTelInputUtilsTemp.isValidNumber", (d, t, $) => {
|
|
8685
8694
|
try {
|
|
8686
|
-
const
|
|
8695
|
+
const n = D.g(), r = Y(n, d, t), u = N2(n, r);
|
|
8687
8696
|
if ($) {
|
|
8688
|
-
|
|
8697
|
+
i2($);
|
|
8689
8698
|
const l = $.map((h) => y1[h]);
|
|
8690
|
-
return u && l.includes(G1(
|
|
8699
|
+
return u && l.includes(G1(n, r));
|
|
8691
8700
|
}
|
|
8692
8701
|
return u;
|
|
8693
8702
|
} catch {
|
|
@@ -8695,13 +8704,13 @@ const W2 = (y) => {
|
|
|
8695
8704
|
}
|
|
8696
8705
|
}), e("intlTelInputUtilsTemp.isPossibleNumber", (d, t, $) => {
|
|
8697
8706
|
try {
|
|
8698
|
-
const
|
|
8707
|
+
const n = D.g(), r = Y(n, d, t);
|
|
8699
8708
|
if ($) {
|
|
8700
|
-
|
|
8701
|
-
for (let u of $) if (a1(
|
|
8709
|
+
i2($);
|
|
8710
|
+
for (let u of $) if (a1(n, r, y1[u]) === 0) return !0;
|
|
8702
8711
|
return !1;
|
|
8703
8712
|
}
|
|
8704
|
-
return a1(
|
|
8713
|
+
return a1(n, r, -1) === 0;
|
|
8705
8714
|
} catch {
|
|
8706
8715
|
return !1;
|
|
8707
8716
|
}
|
|
@@ -8715,10 +8724,10 @@ const W2 = (y) => {
|
|
|
8715
8724
|
})();
|
|
8716
8725
|
const a2 = typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : void 0, z2 = a2.intlTelInputUtilsTemp;
|
|
8717
8726
|
delete a2.intlTelInputUtilsTemp;
|
|
8718
|
-
|
|
8727
|
+
y.utils = z2;
|
|
8719
8728
|
const Y2 = {
|
|
8720
8729
|
__name: "IntlTelInputWithUtils",
|
|
8721
|
-
props: /* @__PURE__ */
|
|
8730
|
+
props: /* @__PURE__ */ n2({
|
|
8722
8731
|
disabled: {
|
|
8723
8732
|
type: Boolean,
|
|
8724
8733
|
default: !1
|
|
@@ -8742,45 +8751,45 @@ const Y2 = {
|
|
|
8742
8751
|
},
|
|
8743
8752
|
modelModifiers: {}
|
|
8744
8753
|
}),
|
|
8745
|
-
emits: /* @__PURE__ */
|
|
8754
|
+
emits: /* @__PURE__ */ n2([
|
|
8746
8755
|
"changeNumber",
|
|
8747
8756
|
"changeCountry",
|
|
8748
8757
|
"changeValidity",
|
|
8749
8758
|
"changeErrorCode"
|
|
8750
8759
|
], ["update:modelValue"]),
|
|
8751
|
-
setup(
|
|
8752
|
-
const s =
|
|
8753
|
-
let
|
|
8754
|
-
f.value !==
|
|
8760
|
+
setup(I, { expose: e, emit: i }) {
|
|
8761
|
+
const s = M2(I, "modelValue"), o = I, a = i, c = I1(), g = I1(), f = I1(!1), v = () => g.value ? o.options.strictMode ? g.value.isValidNumberPrecise() : g.value.isValidNumber() : null, b = () => {
|
|
8762
|
+
let C = v();
|
|
8763
|
+
f.value !== C && (f.value = C, a("changeValidity", !!C), a(
|
|
8755
8764
|
"changeErrorCode",
|
|
8756
|
-
|
|
8765
|
+
C ? null : g.value.getValidationError()
|
|
8757
8766
|
));
|
|
8758
|
-
},
|
|
8759
|
-
var
|
|
8760
|
-
a("changeNumber", ((
|
|
8767
|
+
}, S = () => {
|
|
8768
|
+
var C;
|
|
8769
|
+
a("changeNumber", ((C = g.value) == null ? void 0 : C.getNumber()) ?? ""), b();
|
|
8761
8770
|
}, L = () => {
|
|
8762
|
-
var
|
|
8763
|
-
a("changeCountry", ((
|
|
8771
|
+
var C;
|
|
8772
|
+
a("changeCountry", ((C = g.value) == null ? void 0 : C.getSelectedCountryData().iso2) ?? ""), S(), b();
|
|
8764
8773
|
};
|
|
8765
|
-
return
|
|
8766
|
-
c.value && (g.value =
|
|
8774
|
+
return D2(() => {
|
|
8775
|
+
c.value && (g.value = y(c.value, o.options), o.value && g.value.setNumber(o.value), o.disabled && g.value.setDisabled(o.disabled), f.value = v());
|
|
8767
8776
|
}), P2(
|
|
8768
8777
|
() => o.disabled,
|
|
8769
|
-
(
|
|
8770
|
-
var
|
|
8771
|
-
return (
|
|
8778
|
+
(C) => {
|
|
8779
|
+
var m;
|
|
8780
|
+
return (m = g.value) == null ? void 0 : m.setDisabled(C);
|
|
8772
8781
|
}
|
|
8773
8782
|
), x2(() => {
|
|
8774
|
-
var
|
|
8775
|
-
return (
|
|
8776
|
-
}), e({ instance: g, input: c }), (
|
|
8783
|
+
var C;
|
|
8784
|
+
return (C = g.value) == null ? void 0 : C.destroy();
|
|
8785
|
+
}), e({ instance: g, input: c }), (C, m) => R2((k2(), B2("input", O2({
|
|
8777
8786
|
ref_key: "input",
|
|
8778
8787
|
ref: c,
|
|
8779
|
-
"onUpdate:modelValue":
|
|
8788
|
+
"onUpdate:modelValue": m[0] || (m[0] = (x) => s.value = x),
|
|
8780
8789
|
type: "tel",
|
|
8781
8790
|
onCountrychange: L,
|
|
8782
|
-
onInput:
|
|
8783
|
-
},
|
|
8791
|
+
onInput: S
|
|
8792
|
+
}, I.inputProps), null, 16)), [
|
|
8784
8793
|
[
|
|
8785
8794
|
G2,
|
|
8786
8795
|
s.value,
|