intl-tel-input 25.5.0 → 25.5.2
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 +260 -317
- package/angular/build/IntlTelInputWithUtils.js +474 -447
- package/build/css/intlTelInput.css +5 -0
- package/build/js/data.js +1 -1
- package/build/js/data.min.js +1 -1
- package/build/js/intlTelInput.js +5 -4
- package/build/js/intlTelInput.min.js +2 -2
- package/build/js/intlTelInputWithUtils.js +5 -4
- package/build/js/intlTelInputWithUtils.min.js +2 -2
- package/package.json +4 -4
- package/react/README.md +1 -1
- package/react/build/IntlTelInput.cjs +4 -3
- package/react/build/IntlTelInput.js +4 -3
- package/react/build/IntlTelInputWithUtils.cjs +4 -3
- package/react/build/IntlTelInputWithUtils.js +4 -3
- package/vue/README.md +1 -1
- package/vue/build/IntlTelInput.mjs +4 -4
- package/vue/build/IntlTelInputWithUtils.mjs +4 -4
- 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
- package/angular/build/intl-tel-input.js +0 -1812
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
-
if (decorator = decorators[i])
|
|
7
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
-
if (kind && result) __defProp(target, key, result);
|
|
9
|
-
return result;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
// src/js/intl-tel-input/data.ts
|
|
1
|
+
// angular/build/temp/intl-tel-input/data.js
|
|
13
2
|
var rawCountryData = [
|
|
14
3
|
[
|
|
15
4
|
"af",
|
|
@@ -1350,7 +1339,7 @@ for (let i = 0; i < rawCountryData.length; i++) {
|
|
|
1350
1339
|
}
|
|
1351
1340
|
var data_default = allCountries;
|
|
1352
1341
|
|
|
1353
|
-
//
|
|
1342
|
+
// angular/build/temp/intl-tel-input/i18n/en/countries.js
|
|
1354
1343
|
var countryTranslations = {
|
|
1355
1344
|
ad: "Andorra",
|
|
1356
1345
|
ae: "United Arab Emirates",
|
|
@@ -1597,7 +1586,7 @@ var countryTranslations = {
|
|
|
1597
1586
|
};
|
|
1598
1587
|
var countries_default = countryTranslations;
|
|
1599
1588
|
|
|
1600
|
-
//
|
|
1589
|
+
// angular/build/temp/intl-tel-input/i18n/en/interface.js
|
|
1601
1590
|
var interfaceTranslations = {
|
|
1602
1591
|
selectedCountryAriaLabel: "Selected country",
|
|
1603
1592
|
noCountrySelected: "No country selected",
|
|
@@ -1612,11 +1601,11 @@ var interfaceTranslations = {
|
|
|
1612
1601
|
};
|
|
1613
1602
|
var interface_default = interfaceTranslations;
|
|
1614
1603
|
|
|
1615
|
-
//
|
|
1616
|
-
var allTranslations = {
|
|
1604
|
+
// angular/build/temp/intl-tel-input/i18n/en/index.js
|
|
1605
|
+
var allTranslations = Object.assign(Object.assign({}, countries_default), interface_default);
|
|
1617
1606
|
var en_default = allTranslations;
|
|
1618
1607
|
|
|
1619
|
-
//
|
|
1608
|
+
// angular/build/temp/intl-tel-input.js
|
|
1620
1609
|
for (let i = 0; i < data_default.length; i++) {
|
|
1621
1610
|
data_default[i].name = en_default[data_default[i].iso2];
|
|
1622
1611
|
}
|
|
@@ -1670,9 +1659,7 @@ var defaults = {
|
|
|
1670
1659
|
useFullscreenPopup: typeof navigator !== "undefined" && typeof window !== "undefined" ? (
|
|
1671
1660
|
//* We cannot just test screen size as some smartphones/website meta tags will report desktop resolutions.
|
|
1672
1661
|
//* Note: to target Android Mobiles (and not Tablets), we must find 'Android' and 'Mobile'
|
|
1673
|
-
/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
|
|
1674
|
-
navigator.userAgent
|
|
1675
|
-
) || window.innerWidth <= 500
|
|
1662
|
+
/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth <= 500
|
|
1676
1663
|
) : false,
|
|
1677
1664
|
//* The number type to enforce during validation.
|
|
1678
1665
|
validationNumberTypes: ["MOBILE"]
|
|
@@ -1765,6 +1752,7 @@ var Iti = class {
|
|
|
1765
1752
|
}
|
|
1766
1753
|
this.isAndroid = typeof navigator !== "undefined" ? /Android/i.test(navigator.userAgent) : false;
|
|
1767
1754
|
this.isRTL = !!this.telInput.closest("[dir=rtl]");
|
|
1755
|
+
this.telInput.dir = "ltr";
|
|
1768
1756
|
const showOnDefaultSide = this.options.allowDropdown || this.options.separateDialCode;
|
|
1769
1757
|
this.showSelectedCountryOnLeft = this.isRTL ? !showOnDefaultSide : showOnDefaultSide;
|
|
1770
1758
|
if (this.options.separateDialCode) {
|
|
@@ -1774,7 +1762,7 @@ var Iti = class {
|
|
|
1774
1762
|
this.originalPaddingLeft = this.telInput.style.paddingLeft;
|
|
1775
1763
|
}
|
|
1776
1764
|
}
|
|
1777
|
-
this.options.i18n = {
|
|
1765
|
+
this.options.i18n = Object.assign(Object.assign({}, en_default), this.options.i18n);
|
|
1778
1766
|
const autoCountryPromise = new Promise((resolve, reject) => {
|
|
1779
1767
|
this.resolveAutoCountryPromise = resolve;
|
|
1780
1768
|
this.rejectAutoCountryPromise = reject;
|
|
@@ -1843,19 +1831,11 @@ var Iti = class {
|
|
|
1843
1831
|
_processAllCountries() {
|
|
1844
1832
|
const { onlyCountries, excludeCountries } = this.options;
|
|
1845
1833
|
if (onlyCountries.length) {
|
|
1846
|
-
const lowerCaseOnlyCountries = onlyCountries.map(
|
|
1847
|
-
|
|
1848
|
-
);
|
|
1849
|
-
this.countries = data_default.filter(
|
|
1850
|
-
(country) => lowerCaseOnlyCountries.includes(country.iso2)
|
|
1851
|
-
);
|
|
1834
|
+
const lowerCaseOnlyCountries = onlyCountries.map((country) => country.toLowerCase());
|
|
1835
|
+
this.countries = data_default.filter((country) => lowerCaseOnlyCountries.includes(country.iso2));
|
|
1852
1836
|
} else if (excludeCountries.length) {
|
|
1853
|
-
const lowerCaseExcludeCountries = excludeCountries.map(
|
|
1854
|
-
|
|
1855
|
-
);
|
|
1856
|
-
this.countries = data_default.filter(
|
|
1857
|
-
(country) => !lowerCaseExcludeCountries.includes(country.iso2)
|
|
1858
|
-
);
|
|
1837
|
+
const lowerCaseExcludeCountries = excludeCountries.map((country) => country.toLowerCase());
|
|
1838
|
+
this.countries = data_default.filter((country) => !lowerCaseExcludeCountries.includes(country.iso2));
|
|
1859
1839
|
} else {
|
|
1860
1840
|
this.countries = data_default;
|
|
1861
1841
|
}
|
|
@@ -1900,22 +1880,12 @@ var Iti = class {
|
|
|
1900
1880
|
}
|
|
1901
1881
|
//* Generate all of the markup for the plugin: the selected country overlay, and the dropdown.
|
|
1902
1882
|
_generateMarkup() {
|
|
1883
|
+
var _a, _b, _c;
|
|
1903
1884
|
this.telInput.classList.add("iti__tel-input");
|
|
1904
1885
|
if (!this.telInput.hasAttribute("autocomplete") && !(this.telInput.form && this.telInput.form.hasAttribute("autocomplete"))) {
|
|
1905
1886
|
this.telInput.setAttribute("autocomplete", "off");
|
|
1906
1887
|
}
|
|
1907
|
-
const {
|
|
1908
|
-
allowDropdown,
|
|
1909
|
-
separateDialCode,
|
|
1910
|
-
showFlags,
|
|
1911
|
-
containerClass,
|
|
1912
|
-
hiddenInput,
|
|
1913
|
-
dropdownContainer,
|
|
1914
|
-
fixDropdownWidth,
|
|
1915
|
-
useFullscreenPopup,
|
|
1916
|
-
countrySearch,
|
|
1917
|
-
i18n
|
|
1918
|
-
} = this.options;
|
|
1888
|
+
const { allowDropdown, separateDialCode, showFlags, containerClass, hiddenInput, dropdownContainer, fixDropdownWidth, useFullscreenPopup, countrySearch, i18n } = this.options;
|
|
1919
1889
|
let parentClass = "iti";
|
|
1920
1890
|
if (allowDropdown) {
|
|
1921
1891
|
parentClass += " iti--allow-dropdown";
|
|
@@ -1930,62 +1900,38 @@ var Iti = class {
|
|
|
1930
1900
|
parentClass += " iti--inline-dropdown";
|
|
1931
1901
|
}
|
|
1932
1902
|
const wrapper = createEl("div", { class: parentClass });
|
|
1933
|
-
this.telInput.parentNode
|
|
1903
|
+
(_a = this.telInput.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(wrapper, this.telInput);
|
|
1934
1904
|
if (allowDropdown || showFlags || separateDialCode) {
|
|
1935
|
-
this.countryContainer = createEl(
|
|
1936
|
-
"div",
|
|
1937
|
-
{ class: "iti__country-container" },
|
|
1938
|
-
wrapper
|
|
1939
|
-
);
|
|
1905
|
+
this.countryContainer = createEl("div", { class: "iti__country-container" }, wrapper);
|
|
1940
1906
|
if (this.showSelectedCountryOnLeft) {
|
|
1941
1907
|
this.countryContainer.style.left = "0px";
|
|
1942
1908
|
} else {
|
|
1943
1909
|
this.countryContainer.style.right = "0px";
|
|
1944
1910
|
}
|
|
1945
1911
|
if (allowDropdown) {
|
|
1946
|
-
this.selectedCountry = createEl(
|
|
1947
|
-
"button",
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
"role": "combobox"
|
|
1956
|
-
},
|
|
1957
|
-
this.countryContainer
|
|
1958
|
-
);
|
|
1912
|
+
this.selectedCountry = createEl("button", {
|
|
1913
|
+
type: "button",
|
|
1914
|
+
class: "iti__selected-country",
|
|
1915
|
+
"aria-expanded": "false",
|
|
1916
|
+
"aria-label": this.options.i18n.selectedCountryAriaLabel,
|
|
1917
|
+
"aria-haspopup": "true",
|
|
1918
|
+
"aria-controls": `iti-${this.id}__dropdown-content`,
|
|
1919
|
+
"role": "combobox"
|
|
1920
|
+
}, this.countryContainer);
|
|
1959
1921
|
if (this.telInput.disabled) {
|
|
1960
1922
|
this.selectedCountry.setAttribute("disabled", "true");
|
|
1961
1923
|
}
|
|
1962
1924
|
} else {
|
|
1963
|
-
this.selectedCountry = createEl(
|
|
1964
|
-
"div",
|
|
1965
|
-
{ class: "iti__selected-country" },
|
|
1966
|
-
this.countryContainer
|
|
1967
|
-
);
|
|
1925
|
+
this.selectedCountry = createEl("div", { class: "iti__selected-country" }, this.countryContainer);
|
|
1968
1926
|
}
|
|
1969
1927
|
const selectedCountryPrimary = createEl("div", { class: "iti__selected-country-primary" }, this.selectedCountry);
|
|
1970
1928
|
this.selectedCountryInner = createEl("div", { class: "iti__flag" }, selectedCountryPrimary);
|
|
1971
|
-
this.selectedCountryA11yText = createEl(
|
|
1972
|
-
"span",
|
|
1973
|
-
{ class: "iti__a11y-text" },
|
|
1974
|
-
this.selectedCountryInner
|
|
1975
|
-
);
|
|
1929
|
+
this.selectedCountryA11yText = createEl("span", { class: "iti__a11y-text" }, this.selectedCountryInner);
|
|
1976
1930
|
if (allowDropdown) {
|
|
1977
|
-
this.dropdownArrow = createEl(
|
|
1978
|
-
"div",
|
|
1979
|
-
{ class: "iti__arrow", "aria-hidden": "true" },
|
|
1980
|
-
selectedCountryPrimary
|
|
1981
|
-
);
|
|
1931
|
+
this.dropdownArrow = createEl("div", { class: "iti__arrow", "aria-hidden": "true" }, selectedCountryPrimary);
|
|
1982
1932
|
}
|
|
1983
1933
|
if (separateDialCode) {
|
|
1984
|
-
this.selectedDialCode = createEl(
|
|
1985
|
-
"div",
|
|
1986
|
-
{ class: "iti__selected-dial-code" },
|
|
1987
|
-
this.selectedCountry
|
|
1988
|
-
);
|
|
1934
|
+
this.selectedDialCode = createEl("div", { class: "iti__selected-dial-code", "aria-hidden": "true", dir: "ltr" }, this.selectedCountry);
|
|
1989
1935
|
}
|
|
1990
1936
|
if (allowDropdown) {
|
|
1991
1937
|
const extraClasses = fixDropdownWidth ? "" : "iti--flexible-dropdown-width";
|
|
@@ -1994,37 +1940,25 @@ var Iti = class {
|
|
|
1994
1940
|
class: `iti__dropdown-content iti__hide ${extraClasses}`
|
|
1995
1941
|
});
|
|
1996
1942
|
if (countrySearch) {
|
|
1997
|
-
this.searchInput = createEl(
|
|
1998
|
-
"
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
},
|
|
2010
|
-
this.dropdownContent
|
|
2011
|
-
);
|
|
2012
|
-
this.searchResultsA11yText = createEl(
|
|
2013
|
-
"span",
|
|
2014
|
-
{ class: "iti__a11y-text" },
|
|
2015
|
-
this.dropdownContent
|
|
2016
|
-
);
|
|
1943
|
+
this.searchInput = createEl("input", {
|
|
1944
|
+
type: "text",
|
|
1945
|
+
class: "iti__search-input",
|
|
1946
|
+
placeholder: i18n.searchPlaceholder,
|
|
1947
|
+
role: "combobox",
|
|
1948
|
+
"aria-expanded": "true",
|
|
1949
|
+
"aria-label": i18n.searchPlaceholder,
|
|
1950
|
+
"aria-controls": `iti-${this.id}__country-listbox`,
|
|
1951
|
+
"aria-autocomplete": "list",
|
|
1952
|
+
"autocomplete": "off"
|
|
1953
|
+
}, this.dropdownContent);
|
|
1954
|
+
this.searchResultsA11yText = createEl("span", { class: "iti__a11y-text" }, this.dropdownContent);
|
|
2017
1955
|
}
|
|
2018
|
-
this.countryList = createEl(
|
|
2019
|
-
"
|
|
2020
|
-
{
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
"aria-label": i18n.countryListAriaLabel
|
|
2025
|
-
},
|
|
2026
|
-
this.dropdownContent
|
|
2027
|
-
);
|
|
1956
|
+
this.countryList = createEl("ul", {
|
|
1957
|
+
class: "iti__country-list",
|
|
1958
|
+
id: `iti-${this.id}__country-listbox`,
|
|
1959
|
+
role: "listbox",
|
|
1960
|
+
"aria-label": i18n.countryListAriaLabel
|
|
1961
|
+
}, this.dropdownContent);
|
|
2028
1962
|
this._appendListItems();
|
|
2029
1963
|
if (countrySearch) {
|
|
2030
1964
|
this._updateSearchResultsText();
|
|
@@ -2052,7 +1986,7 @@ var Iti = class {
|
|
|
2052
1986
|
const telInputName = this.telInput.getAttribute("name") || "";
|
|
2053
1987
|
const names = hiddenInput(telInputName);
|
|
2054
1988
|
if (names.phone) {
|
|
2055
|
-
const existingInput = this.telInput.form
|
|
1989
|
+
const existingInput = (_b = this.telInput.form) === null || _b === void 0 ? void 0 : _b.querySelector(`input[name="${names.phone}"]`);
|
|
2056
1990
|
if (existingInput) {
|
|
2057
1991
|
this.hiddenInput = existingInput;
|
|
2058
1992
|
} else {
|
|
@@ -2064,7 +1998,7 @@ var Iti = class {
|
|
|
2064
1998
|
}
|
|
2065
1999
|
}
|
|
2066
2000
|
if (names.country) {
|
|
2067
|
-
const existingInput = this.telInput.form
|
|
2001
|
+
const existingInput = (_c = this.telInput.form) === null || _c === void 0 ? void 0 : _c.querySelector(`input[name="${names.country}"]`);
|
|
2068
2002
|
if (existingInput) {
|
|
2069
2003
|
this.hiddenInputCountry = existingInput;
|
|
2070
2004
|
} else {
|
|
@@ -2082,26 +2016,22 @@ var Iti = class {
|
|
|
2082
2016
|
for (let i = 0; i < this.countries.length; i++) {
|
|
2083
2017
|
const c = this.countries[i];
|
|
2084
2018
|
const extraClass = i === 0 ? "iti__highlight" : "";
|
|
2085
|
-
const listItem = createEl(
|
|
2086
|
-
|
|
2087
|
-
{
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
"aria-selected": "false"
|
|
2095
|
-
},
|
|
2096
|
-
this.countryList
|
|
2097
|
-
);
|
|
2019
|
+
const listItem = createEl("li", {
|
|
2020
|
+
id: `iti-${this.id}__item-${c.iso2}`,
|
|
2021
|
+
class: `iti__country ${extraClass}`,
|
|
2022
|
+
tabindex: "-1",
|
|
2023
|
+
role: "option",
|
|
2024
|
+
"data-dial-code": c.dialCode,
|
|
2025
|
+
"data-country-code": c.iso2,
|
|
2026
|
+
"aria-selected": "false"
|
|
2027
|
+
}, this.countryList);
|
|
2098
2028
|
c.nodeById[this.id] = listItem;
|
|
2099
2029
|
let content = "";
|
|
2100
2030
|
if (this.options.showFlags) {
|
|
2101
2031
|
content += `<div class='iti__flag iti__${c.iso2}'></div>`;
|
|
2102
2032
|
}
|
|
2103
2033
|
content += `<span class='iti__country-name'>${c.name}</span>`;
|
|
2104
|
-
content += `<span class='iti__dial-code'>+${c.dialCode}</span>`;
|
|
2034
|
+
content += `<span class='iti__dial-code' dir='ltr'>+${c.dialCode}</span>`;
|
|
2105
2035
|
listItem.insertAdjacentHTML("beforeend", content);
|
|
2106
2036
|
}
|
|
2107
2037
|
}
|
|
@@ -2148,6 +2078,7 @@ var Iti = class {
|
|
|
2148
2078
|
}
|
|
2149
2079
|
//* Update hidden input on form submit.
|
|
2150
2080
|
_initHiddenInputListener() {
|
|
2081
|
+
var _a;
|
|
2151
2082
|
this._handleHiddenInputSubmit = () => {
|
|
2152
2083
|
if (this.hiddenInput) {
|
|
2153
2084
|
this.hiddenInput.value = this.getNumber();
|
|
@@ -2156,10 +2087,7 @@ var Iti = class {
|
|
|
2156
2087
|
this.hiddenInputCountry.value = this.getSelectedCountryData().iso2 || "";
|
|
2157
2088
|
}
|
|
2158
2089
|
};
|
|
2159
|
-
this.telInput.form
|
|
2160
|
-
"submit",
|
|
2161
|
-
this._handleHiddenInputSubmit
|
|
2162
|
-
);
|
|
2090
|
+
(_a = this.telInput.form) === null || _a === void 0 ? void 0 : _a.addEventListener("submit", this._handleHiddenInputSubmit);
|
|
2163
2091
|
}
|
|
2164
2092
|
//* initialise the dropdown listeners.
|
|
2165
2093
|
_initDropdownListeners() {
|
|
@@ -2191,18 +2119,16 @@ var Iti = class {
|
|
|
2191
2119
|
this._closeDropdown();
|
|
2192
2120
|
}
|
|
2193
2121
|
};
|
|
2194
|
-
this.countryContainer.addEventListener(
|
|
2195
|
-
"keydown",
|
|
2196
|
-
this._handleCountryContainerKeydown
|
|
2197
|
-
);
|
|
2122
|
+
this.countryContainer.addEventListener("keydown", this._handleCountryContainerKeydown);
|
|
2198
2123
|
}
|
|
2199
2124
|
//* Init many requests: utils script / geo ip lookup.
|
|
2200
2125
|
_initRequests() {
|
|
2201
2126
|
let { loadUtils, initialCountry, geoIpLookup } = this.options;
|
|
2202
2127
|
if (loadUtils && !intlTelInput.utils) {
|
|
2203
2128
|
this._handlePageLoad = () => {
|
|
2129
|
+
var _a;
|
|
2204
2130
|
window.removeEventListener("load", this._handlePageLoad);
|
|
2205
|
-
intlTelInput.attachUtils(loadUtils)
|
|
2131
|
+
(_a = intlTelInput.attachUtils(loadUtils)) === null || _a === void 0 ? void 0 : _a.catch(() => {
|
|
2206
2132
|
});
|
|
2207
2133
|
};
|
|
2208
2134
|
if (intlTelInput.documentReady()) {
|
|
@@ -2227,23 +2153,20 @@ var Iti = class {
|
|
|
2227
2153
|
} else if (!intlTelInput.startedLoadingAutoCountry) {
|
|
2228
2154
|
intlTelInput.startedLoadingAutoCountry = true;
|
|
2229
2155
|
if (typeof this.options.geoIpLookup === "function") {
|
|
2230
|
-
this.options.geoIpLookup(
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
} else {
|
|
2238
|
-
this._setInitialState(true);
|
|
2239
|
-
forEachInstance("rejectAutoCountryPromise");
|
|
2240
|
-
}
|
|
2241
|
-
},
|
|
2242
|
-
() => {
|
|
2156
|
+
this.options.geoIpLookup((iso2 = "") => {
|
|
2157
|
+
const iso2Lower = iso2.toLowerCase();
|
|
2158
|
+
const isValidIso2 = iso2Lower && this._getCountryData(iso2Lower, true);
|
|
2159
|
+
if (isValidIso2) {
|
|
2160
|
+
intlTelInput.autoCountry = iso2Lower;
|
|
2161
|
+
setTimeout(() => forEachInstance("handleAutoCountry"));
|
|
2162
|
+
} else {
|
|
2243
2163
|
this._setInitialState(true);
|
|
2244
2164
|
forEachInstance("rejectAutoCountryPromise");
|
|
2245
2165
|
}
|
|
2246
|
-
)
|
|
2166
|
+
}, () => {
|
|
2167
|
+
this._setInitialState(true);
|
|
2168
|
+
forEachInstance("rejectAutoCountryPromise");
|
|
2169
|
+
});
|
|
2247
2170
|
}
|
|
2248
2171
|
}
|
|
2249
2172
|
}
|
|
@@ -2260,7 +2183,7 @@ var Iti = class {
|
|
|
2260
2183
|
userOverrideFormatting = true;
|
|
2261
2184
|
}
|
|
2262
2185
|
this._handleInputEvent = (e) => {
|
|
2263
|
-
if (this.isAndroid && e
|
|
2186
|
+
if (this.isAndroid && (e === null || e === void 0 ? void 0 : e.data) === "+" && separateDialCode && allowDropdown && countrySearch) {
|
|
2264
2187
|
const currentCaretPos = this.telInput.selectionStart || 0;
|
|
2265
2188
|
const valueBeforeCaret = this.telInput.value.substring(0, currentCaretPos - 1);
|
|
2266
2189
|
const valueAfterCaret = this.telInput.value.substring(currentCaretPos);
|
|
@@ -2271,19 +2194,19 @@ var Iti = class {
|
|
|
2271
2194
|
if (this._updateCountryFromNumber(this.telInput.value)) {
|
|
2272
2195
|
this._triggerCountryChange();
|
|
2273
2196
|
}
|
|
2274
|
-
const isFormattingChar = e
|
|
2275
|
-
const isPaste = e
|
|
2197
|
+
const isFormattingChar = (e === null || e === void 0 ? void 0 : e.data) && /[^+0-9]/.test(e.data);
|
|
2198
|
+
const isPaste = (e === null || e === void 0 ? void 0 : e.inputType) === "insertFromPaste" && this.telInput.value;
|
|
2276
2199
|
if (isFormattingChar || isPaste && !strictMode) {
|
|
2277
2200
|
userOverrideFormatting = true;
|
|
2278
2201
|
} else if (!/[^+0-9]/.test(this.telInput.value)) {
|
|
2279
2202
|
userOverrideFormatting = false;
|
|
2280
2203
|
}
|
|
2281
|
-
const disableFormatOnSetNumber = e
|
|
2204
|
+
const disableFormatOnSetNumber = (e === null || e === void 0 ? void 0 : e.detail) && e.detail["isSetNumber"] && !formatOnDisplay;
|
|
2282
2205
|
if (formatAsYouType && !userOverrideFormatting && !disableFormatOnSetNumber) {
|
|
2283
2206
|
const currentCaretPos = this.telInput.selectionStart || 0;
|
|
2284
2207
|
const valueBeforeCaret = this.telInput.value.substring(0, currentCaretPos);
|
|
2285
2208
|
const relevantCharsBeforeCaret = valueBeforeCaret.replace(/[^+0-9]/g, "").length;
|
|
2286
|
-
const isDeleteForwards = e
|
|
2209
|
+
const isDeleteForwards = (e === null || e === void 0 ? void 0 : e.inputType) === "deleteContentForward";
|
|
2287
2210
|
const formattedValue = this._formatNumberAsYouType();
|
|
2288
2211
|
const newCaretPos = translateCursorPosition(relevantCharsBeforeCaret, formattedValue, currentCaretPos, isDeleteForwards);
|
|
2289
2212
|
this.telInput.value = formattedValue;
|
|
@@ -2374,17 +2297,16 @@ var Iti = class {
|
|
|
2374
2297
|
//* We only bind dropdown listeners when the dropdown is open.
|
|
2375
2298
|
_bindDropdownListeners() {
|
|
2376
2299
|
this._handleMouseoverCountryList = (e) => {
|
|
2377
|
-
|
|
2300
|
+
var _a;
|
|
2301
|
+
const listItem = (_a = e.target) === null || _a === void 0 ? void 0 : _a.closest(".iti__country");
|
|
2378
2302
|
if (listItem) {
|
|
2379
2303
|
this._highlightListItem(listItem, false);
|
|
2380
2304
|
}
|
|
2381
2305
|
};
|
|
2382
|
-
this.countryList.addEventListener(
|
|
2383
|
-
"mouseover",
|
|
2384
|
-
this._handleMouseoverCountryList
|
|
2385
|
-
);
|
|
2306
|
+
this.countryList.addEventListener("mouseover", this._handleMouseoverCountryList);
|
|
2386
2307
|
this._handleClickCountryList = (e) => {
|
|
2387
|
-
|
|
2308
|
+
var _a;
|
|
2309
|
+
const listItem = (_a = e.target) === null || _a === void 0 ? void 0 : _a.closest(".iti__country");
|
|
2388
2310
|
if (listItem) {
|
|
2389
2311
|
this._selectListItem(listItem);
|
|
2390
2312
|
}
|
|
@@ -2397,10 +2319,7 @@ var Iti = class {
|
|
|
2397
2319
|
}
|
|
2398
2320
|
isOpening = false;
|
|
2399
2321
|
};
|
|
2400
|
-
document.documentElement.addEventListener(
|
|
2401
|
-
"click",
|
|
2402
|
-
this._handleClickOffToClose
|
|
2403
|
-
);
|
|
2322
|
+
document.documentElement.addEventListener("click", this._handleClickOffToClose);
|
|
2404
2323
|
let query = "";
|
|
2405
2324
|
let queryTimer = null;
|
|
2406
2325
|
this._handleKeydownOnDropdown = (e) => {
|
|
@@ -2469,16 +2388,45 @@ var Iti = class {
|
|
|
2469
2388
|
let noCountriesAddedYet = true;
|
|
2470
2389
|
this.countryList.innerHTML = "";
|
|
2471
2390
|
const normalisedQuery = normaliseString(query);
|
|
2391
|
+
const queryLength = normalisedQuery.length;
|
|
2392
|
+
const iso2Matches = [];
|
|
2393
|
+
const nameStartWith = [];
|
|
2394
|
+
const nameContains = [];
|
|
2395
|
+
const dialCodeMatches = [];
|
|
2396
|
+
const dialCodeContains = [];
|
|
2397
|
+
const initialsMatches = [];
|
|
2472
2398
|
for (let i = 0; i < this.countries.length; i++) {
|
|
2473
2399
|
const c = this.countries[i];
|
|
2474
2400
|
const normalisedCountryName = normaliseString(c.name);
|
|
2475
2401
|
const countryInitials = c.name.split(/[^a-zA-ZÀ-ÿа-яА-Я]/).map((word) => word[0]).join("").toLowerCase();
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2402
|
+
if (isReset || queryLength === 0) {
|
|
2403
|
+
nameContains.push(c);
|
|
2404
|
+
} else if (c.iso2.toLowerCase() === normalisedQuery) {
|
|
2405
|
+
iso2Matches.push(c);
|
|
2406
|
+
} else if (normalisedCountryName.startsWith(normalisedQuery)) {
|
|
2407
|
+
nameStartWith.push(c);
|
|
2408
|
+
} else if (normalisedCountryName.includes(normalisedQuery)) {
|
|
2409
|
+
nameContains.push(c);
|
|
2410
|
+
} else if (normalisedQuery === c.dialCode || normalisedQuery === `+${c.dialCode}`) {
|
|
2411
|
+
dialCodeMatches.push(c);
|
|
2412
|
+
} else if (`+${c.dialCode}`.includes(normalisedQuery)) {
|
|
2413
|
+
dialCodeContains.push(c);
|
|
2414
|
+
} else if (countryInitials.includes(normalisedQuery)) {
|
|
2415
|
+
initialsMatches.push(c);
|
|
2416
|
+
}
|
|
2417
|
+
}
|
|
2418
|
+
const matchedCountries = [
|
|
2419
|
+
...iso2Matches.sort((a, b) => a.priority - b.priority),
|
|
2420
|
+
...nameStartWith.sort((a, b) => a.priority - b.priority),
|
|
2421
|
+
...nameContains.sort((a, b) => a.priority - b.priority),
|
|
2422
|
+
...dialCodeMatches.sort((a, b) => a.priority - b.priority),
|
|
2423
|
+
...dialCodeContains.sort((a, b) => a.priority - b.priority),
|
|
2424
|
+
...initialsMatches.sort((a, b) => a.priority - b.priority)
|
|
2425
|
+
];
|
|
2426
|
+
for (const c of matchedCountries) {
|
|
2427
|
+
const listItem = c.nodeById[this.id];
|
|
2428
|
+
if (listItem) {
|
|
2429
|
+
this.countryList.appendChild(listItem);
|
|
2482
2430
|
if (noCountriesAddedYet) {
|
|
2483
2431
|
this._highlightListItem(listItem, false);
|
|
2484
2432
|
noCountriesAddedYet = false;
|
|
@@ -2511,7 +2459,8 @@ var Iti = class {
|
|
|
2511
2459
|
}
|
|
2512
2460
|
//* Highlight the next/prev item in the list (and ensure it is visible).
|
|
2513
2461
|
_handleUpDownKey(key) {
|
|
2514
|
-
|
|
2462
|
+
var _a, _b;
|
|
2463
|
+
let next = key === "ArrowUp" ? (_a = this.highlightedItem) === null || _a === void 0 ? void 0 : _a.previousElementSibling : (_b = this.highlightedItem) === null || _b === void 0 ? void 0 : _b.nextElementSibling;
|
|
2515
2464
|
if (!next && this.countryList.childElementCount > 1) {
|
|
2516
2465
|
next = key === "ArrowUp" ? this.countryList.lastElementChild : this.countryList.firstElementChild;
|
|
2517
2466
|
}
|
|
@@ -2534,11 +2483,7 @@ var Iti = class {
|
|
|
2534
2483
|
const useNational = this.options.nationalMode || number.charAt(0) !== "+" && !this.options.separateDialCode;
|
|
2535
2484
|
const { NATIONAL, INTERNATIONAL } = intlTelInput.utils.numberFormat;
|
|
2536
2485
|
const format = useNational ? NATIONAL : INTERNATIONAL;
|
|
2537
|
-
number = intlTelInput.utils.formatNumber(
|
|
2538
|
-
number,
|
|
2539
|
-
this.selectedCountryData.iso2,
|
|
2540
|
-
format
|
|
2541
|
-
);
|
|
2486
|
+
number = intlTelInput.utils.formatNumber(number, this.selectedCountryData.iso2, format);
|
|
2542
2487
|
}
|
|
2543
2488
|
number = this._beforeSetNumber(number);
|
|
2544
2489
|
this.telInput.value = number;
|
|
@@ -2681,12 +2626,7 @@ var Iti = class {
|
|
|
2681
2626
|
if (strictMode && intlTelInput.utils) {
|
|
2682
2627
|
if (iso2) {
|
|
2683
2628
|
const numberType = intlTelInput.utils.numberType[placeholderNumberType];
|
|
2684
|
-
let exampleNumber = intlTelInput.utils.getExampleNumber(
|
|
2685
|
-
iso2,
|
|
2686
|
-
false,
|
|
2687
|
-
numberType,
|
|
2688
|
-
true
|
|
2689
|
-
);
|
|
2629
|
+
let exampleNumber = intlTelInput.utils.getExampleNumber(iso2, false, numberType, true);
|
|
2690
2630
|
let validNumber = exampleNumber;
|
|
2691
2631
|
while (intlTelInput.utils.isPossibleNumber(exampleNumber, iso2, validationNumberTypes)) {
|
|
2692
2632
|
validNumber = exampleNumber;
|
|
@@ -2737,20 +2677,11 @@ var Iti = class {
|
|
|
2737
2677
|
}
|
|
2738
2678
|
//* Update the input placeholder to an example number from the currently selected country.
|
|
2739
2679
|
_updatePlaceholder() {
|
|
2740
|
-
const {
|
|
2741
|
-
autoPlaceholder,
|
|
2742
|
-
placeholderNumberType,
|
|
2743
|
-
nationalMode,
|
|
2744
|
-
customPlaceholder
|
|
2745
|
-
} = this.options;
|
|
2680
|
+
const { autoPlaceholder, placeholderNumberType, nationalMode, customPlaceholder } = this.options;
|
|
2746
2681
|
const shouldSetPlaceholder = autoPlaceholder === "aggressive" || !this.hadInitialPlaceholder && autoPlaceholder === "polite";
|
|
2747
2682
|
if (intlTelInput.utils && shouldSetPlaceholder) {
|
|
2748
2683
|
const numberType = intlTelInput.utils.numberType[placeholderNumberType];
|
|
2749
|
-
let placeholder = this.selectedCountryData.iso2 ? intlTelInput.utils.getExampleNumber(
|
|
2750
|
-
this.selectedCountryData.iso2,
|
|
2751
|
-
nationalMode,
|
|
2752
|
-
numberType
|
|
2753
|
-
) : "";
|
|
2684
|
+
let placeholder = this.selectedCountryData.iso2 ? intlTelInput.utils.getExampleNumber(this.selectedCountryData.iso2, nationalMode, numberType) : "";
|
|
2754
2685
|
placeholder = this._beforeSetNumber(placeholder);
|
|
2755
2686
|
if (typeof customPlaceholder === "function") {
|
|
2756
2687
|
placeholder = customPlaceholder(placeholder, this.selectedCountryData);
|
|
@@ -2760,9 +2691,7 @@ var Iti = class {
|
|
|
2760
2691
|
}
|
|
2761
2692
|
//* Called when the user selects a list item from the dropdown.
|
|
2762
2693
|
_selectListItem(listItem) {
|
|
2763
|
-
const countryChanged = this._setCountry(
|
|
2764
|
-
listItem.getAttribute("data-country-code")
|
|
2765
|
-
);
|
|
2694
|
+
const countryChanged = this._setCountry(listItem.getAttribute("data-country-code"));
|
|
2766
2695
|
this._closeDropdown();
|
|
2767
2696
|
this._updateDialCode(listItem.getAttribute("data-dial-code"));
|
|
2768
2697
|
this.telInput.focus();
|
|
@@ -2786,14 +2715,8 @@ var Iti = class {
|
|
|
2786
2715
|
if (this.options.countrySearch) {
|
|
2787
2716
|
this.searchInput.removeEventListener("input", this._handleSearchChange);
|
|
2788
2717
|
}
|
|
2789
|
-
document.documentElement.removeEventListener(
|
|
2790
|
-
|
|
2791
|
-
this._handleClickOffToClose
|
|
2792
|
-
);
|
|
2793
|
-
this.countryList.removeEventListener(
|
|
2794
|
-
"mouseover",
|
|
2795
|
-
this._handleMouseoverCountryList
|
|
2796
|
-
);
|
|
2718
|
+
document.documentElement.removeEventListener("click", this._handleClickOffToClose);
|
|
2719
|
+
this.countryList.removeEventListener("mouseover", this._handleMouseoverCountryList);
|
|
2797
2720
|
this.countryList.removeEventListener("click", this._handleClickCountryList);
|
|
2798
2721
|
if (this.options.dropdownContainer) {
|
|
2799
2722
|
if (!this.options.useFullscreenPopup) {
|
|
@@ -2943,18 +2866,13 @@ var Iti = class {
|
|
|
2943
2866
|
//********************
|
|
2944
2867
|
//* Remove plugin.
|
|
2945
2868
|
destroy() {
|
|
2869
|
+
var _a, _b;
|
|
2946
2870
|
this.telInput.iti = void 0;
|
|
2947
2871
|
const { allowDropdown, separateDialCode } = this.options;
|
|
2948
2872
|
if (allowDropdown) {
|
|
2949
2873
|
this._closeDropdown();
|
|
2950
|
-
this.selectedCountry.removeEventListener(
|
|
2951
|
-
|
|
2952
|
-
this._handleClickSelectedCountry
|
|
2953
|
-
);
|
|
2954
|
-
this.countryContainer.removeEventListener(
|
|
2955
|
-
"keydown",
|
|
2956
|
-
this._handleCountryContainerKeydown
|
|
2957
|
-
);
|
|
2874
|
+
this.selectedCountry.removeEventListener("click", this._handleClickSelectedCountry);
|
|
2875
|
+
this.countryContainer.removeEventListener("keydown", this._handleCountryContainerKeydown);
|
|
2958
2876
|
const label = this.telInput.closest("label");
|
|
2959
2877
|
if (label) {
|
|
2960
2878
|
label.removeEventListener("click", this._handleLabelClick);
|
|
@@ -2977,17 +2895,14 @@ var Iti = class {
|
|
|
2977
2895
|
}
|
|
2978
2896
|
}
|
|
2979
2897
|
const wrapper = this.telInput.parentNode;
|
|
2980
|
-
wrapper
|
|
2981
|
-
wrapper
|
|
2898
|
+
(_a = wrapper === null || wrapper === void 0 ? void 0 : wrapper.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(this.telInput, wrapper);
|
|
2899
|
+
(_b = wrapper === null || wrapper === void 0 ? void 0 : wrapper.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(wrapper);
|
|
2982
2900
|
delete intlTelInput.instances[this.id];
|
|
2983
2901
|
}
|
|
2984
2902
|
//* Get the extension from the current number.
|
|
2985
2903
|
getExtension() {
|
|
2986
2904
|
if (intlTelInput.utils) {
|
|
2987
|
-
return intlTelInput.utils.getExtension(
|
|
2988
|
-
this._getFullNumber(),
|
|
2989
|
-
this.selectedCountryData.iso2
|
|
2990
|
-
);
|
|
2905
|
+
return intlTelInput.utils.getExtension(this._getFullNumber(), this.selectedCountryData.iso2);
|
|
2991
2906
|
}
|
|
2992
2907
|
return "";
|
|
2993
2908
|
}
|
|
@@ -2995,21 +2910,14 @@ var Iti = class {
|
|
|
2995
2910
|
getNumber(format) {
|
|
2996
2911
|
if (intlTelInput.utils) {
|
|
2997
2912
|
const { iso2 } = this.selectedCountryData;
|
|
2998
|
-
return intlTelInput.utils.formatNumber(
|
|
2999
|
-
this._getFullNumber(),
|
|
3000
|
-
iso2,
|
|
3001
|
-
format
|
|
3002
|
-
);
|
|
2913
|
+
return intlTelInput.utils.formatNumber(this._getFullNumber(), iso2, format);
|
|
3003
2914
|
}
|
|
3004
2915
|
return "";
|
|
3005
2916
|
}
|
|
3006
2917
|
//* Get the type of the entered number e.g. landline/mobile.
|
|
3007
2918
|
getNumberType() {
|
|
3008
2919
|
if (intlTelInput.utils) {
|
|
3009
|
-
return intlTelInput.utils.getNumberType(
|
|
3010
|
-
this._getFullNumber(),
|
|
3011
|
-
this.selectedCountryData.iso2
|
|
3012
|
-
);
|
|
2920
|
+
return intlTelInput.utils.getNumberType(this._getFullNumber(), this.selectedCountryData.iso2);
|
|
3013
2921
|
}
|
|
3014
2922
|
return -99;
|
|
3015
2923
|
}
|
|
@@ -3063,7 +2971,7 @@ var Iti = class {
|
|
|
3063
2971
|
}
|
|
3064
2972
|
//* Update the selected country, and update the input val accordingly.
|
|
3065
2973
|
setCountry(iso2) {
|
|
3066
|
-
const iso2Lower = iso2
|
|
2974
|
+
const iso2Lower = iso2 === null || iso2 === void 0 ? void 0 : iso2.toLowerCase();
|
|
3067
2975
|
const currentCountry = this.selectedCountryData.iso2;
|
|
3068
2976
|
const isCountryChange = iso2 && iso2Lower !== currentCountry || !iso2 && currentCountry;
|
|
3069
2977
|
if (isCountryChange) {
|
|
@@ -3109,7 +3017,7 @@ var attachUtils = (source) => {
|
|
|
3109
3017
|
}
|
|
3110
3018
|
intlTelInput.startedLoadingUtilsScript = true;
|
|
3111
3019
|
return loadCall.then((module) => {
|
|
3112
|
-
const utils2 = module
|
|
3020
|
+
const utils2 = module === null || module === void 0 ? void 0 : module.default;
|
|
3113
3021
|
if (!utils2 || typeof utils2 !== "object") {
|
|
3114
3022
|
throw new TypeError("The loader function passed to attachUtils did not resolve to a module object with utils as its default export.");
|
|
3115
3023
|
}
|
|
@@ -3123,44 +3031,42 @@ var attachUtils = (source) => {
|
|
|
3123
3031
|
}
|
|
3124
3032
|
return null;
|
|
3125
3033
|
};
|
|
3126
|
-
var intlTelInput = Object.assign(
|
|
3127
|
-
(input, options)
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3034
|
+
var intlTelInput = Object.assign((input, options) => {
|
|
3035
|
+
const iti = new Iti(input, options);
|
|
3036
|
+
iti._init();
|
|
3037
|
+
input.setAttribute("data-intl-tel-input-id", iti.id.toString());
|
|
3038
|
+
intlTelInput.instances[iti.id] = iti;
|
|
3039
|
+
input.iti = iti;
|
|
3040
|
+
return iti;
|
|
3041
|
+
}, {
|
|
3042
|
+
defaults,
|
|
3043
|
+
//* Using a static var like this allows us to mock it in the tests.
|
|
3044
|
+
documentReady: () => document.readyState === "complete",
|
|
3045
|
+
//* Get the country data object.
|
|
3046
|
+
getCountryData: () => data_default,
|
|
3047
|
+
//* A getter for the plugin instance.
|
|
3048
|
+
getInstance: (input) => {
|
|
3049
|
+
const id2 = input.getAttribute("data-intl-tel-input-id");
|
|
3050
|
+
return id2 ? intlTelInput.instances[id2] : null;
|
|
3134
3051
|
},
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
getInstance: (input) => {
|
|
3143
|
-
const id2 = input.getAttribute("data-intl-tel-input-id");
|
|
3144
|
-
return id2 ? intlTelInput.instances[id2] : null;
|
|
3145
|
-
},
|
|
3146
|
-
//* A map from instance ID to instance object.
|
|
3147
|
-
instances: {},
|
|
3148
|
-
attachUtils,
|
|
3149
|
-
startedLoadingUtilsScript: false,
|
|
3150
|
-
startedLoadingAutoCountry: false,
|
|
3151
|
-
version: "25.4.7"
|
|
3152
|
-
}
|
|
3153
|
-
);
|
|
3052
|
+
//* A map from instance ID to instance object.
|
|
3053
|
+
instances: {},
|
|
3054
|
+
attachUtils,
|
|
3055
|
+
startedLoadingUtilsScript: false,
|
|
3056
|
+
startedLoadingAutoCountry: false,
|
|
3057
|
+
version: "25.5.2"
|
|
3058
|
+
});
|
|
3154
3059
|
var intl_tel_input_default = intlTelInput;
|
|
3155
3060
|
|
|
3156
|
-
// build/
|
|
3061
|
+
// angular/build/temp/intl-tel-input/utils.js
|
|
3157
3062
|
(function() {
|
|
3158
3063
|
var k = this || self;
|
|
3159
3064
|
function m(a, b) {
|
|
3160
3065
|
a = a.split(".");
|
|
3161
3066
|
var c = k;
|
|
3162
3067
|
a[0] in c || "undefined" == typeof c.execScript || c.execScript("var " + a[0]);
|
|
3163
|
-
for (var d; a.length && (d = a.shift()); )
|
|
3068
|
+
for (var d; a.length && (d = a.shift()); )
|
|
3069
|
+
a.length || void 0 === b ? c[d] && c[d] !== Object.prototype[d] ? c = c[d] : c = c[d] = {} : c[d] = b;
|
|
3164
3070
|
}
|
|
3165
3071
|
function n(a, b) {
|
|
3166
3072
|
function c() {
|
|
@@ -3170,7 +3076,8 @@ var intl_tel_input_default = intlTelInput;
|
|
|
3170
3076
|
a.prototype = new c();
|
|
3171
3077
|
a.prototype.constructor = a;
|
|
3172
3078
|
a.sa = function(d, e, f) {
|
|
3173
|
-
for (var g = Array(arguments.length - 2), h = 2; h < arguments.length; h++)
|
|
3079
|
+
for (var g = Array(arguments.length - 2), h = 2; h < arguments.length; h++)
|
|
3080
|
+
g[h - 2] = arguments[h];
|
|
3174
3081
|
return b.prototype[e].apply(d, g);
|
|
3175
3082
|
};
|
|
3176
3083
|
}
|
|
@@ -3178,13 +3085,15 @@ var intl_tel_input_default = intlTelInput;
|
|
|
3178
3085
|
function aa(a) {
|
|
3179
3086
|
const b = [];
|
|
3180
3087
|
let c = 0;
|
|
3181
|
-
for (const d in a)
|
|
3088
|
+
for (const d in a)
|
|
3089
|
+
b[c++] = a[d];
|
|
3182
3090
|
return b;
|
|
3183
3091
|
}
|
|
3184
3092
|
;
|
|
3185
3093
|
var da = class {
|
|
3186
3094
|
constructor(a) {
|
|
3187
|
-
if (ba !== ba)
|
|
3095
|
+
if (ba !== ba)
|
|
3096
|
+
throw Error("SafeUrl is not meant to be built directly");
|
|
3188
3097
|
this.g = a;
|
|
3189
3098
|
}
|
|
3190
3099
|
toString() {
|
|
@@ -3196,7 +3105,8 @@ var intl_tel_input_default = intlTelInput;
|
|
|
3196
3105
|
const ea = {};
|
|
3197
3106
|
class fa {
|
|
3198
3107
|
constructor() {
|
|
3199
|
-
if (ea !== ea)
|
|
3108
|
+
if (ea !== ea)
|
|
3109
|
+
throw Error("SafeStyle is not meant to be built directly");
|
|
3200
3110
|
}
|
|
3201
3111
|
toString() {
|
|
3202
3112
|
return "".toString();
|
|
@@ -3206,7 +3116,8 @@ var intl_tel_input_default = intlTelInput;
|
|
|
3206
3116
|
const ha = {};
|
|
3207
3117
|
class ia {
|
|
3208
3118
|
constructor() {
|
|
3209
|
-
if (ha !== ha)
|
|
3119
|
+
if (ha !== ha)
|
|
3120
|
+
throw Error("SafeStyleSheet is not meant to be built directly");
|
|
3210
3121
|
}
|
|
3211
3122
|
toString() {
|
|
3212
3123
|
return "".toString();
|
|
@@ -3217,7 +3128,8 @@ var intl_tel_input_default = intlTelInput;
|
|
|
3217
3128
|
class ka {
|
|
3218
3129
|
constructor() {
|
|
3219
3130
|
var a = k.trustedTypes && k.trustedTypes.emptyHTML || "";
|
|
3220
|
-
if (ja !== ja)
|
|
3131
|
+
if (ja !== ja)
|
|
3132
|
+
throw Error("SafeHtml is not meant to be built directly");
|
|
3221
3133
|
this.g = a;
|
|
3222
3134
|
}
|
|
3223
3135
|
toString() {
|
|
@@ -3285,8 +3197,10 @@ var intl_tel_input_default = intlTelInput;
|
|
|
3285
3197
|
var g = 11 == e.h || 10 == e.h;
|
|
3286
3198
|
if (e.l) {
|
|
3287
3199
|
e = u(b, f);
|
|
3288
|
-
for (var h = 0; h < e.length; h++)
|
|
3289
|
-
|
|
3200
|
+
for (var h = 0; h < e.length; h++)
|
|
3201
|
+
va(a, f, g ? e[h].clone() : e[h]);
|
|
3202
|
+
} else
|
|
3203
|
+
e = v(b, f), g ? (g = v(a, f)) ? wa(g, e) : t(a, f, e.clone()) : t(a, f, e);
|
|
3290
3204
|
}
|
|
3291
3205
|
}
|
|
3292
3206
|
}
|
|
@@ -3300,14 +3214,18 @@ var intl_tel_input_default = intlTelInput;
|
|
|
3300
3214
|
}
|
|
3301
3215
|
function v(a, b) {
|
|
3302
3216
|
var c = a.h[b];
|
|
3303
|
-
if (null == c)
|
|
3217
|
+
if (null == c)
|
|
3218
|
+
return null;
|
|
3304
3219
|
if (a.l) {
|
|
3305
3220
|
if (!(b in a.g)) {
|
|
3306
3221
|
var d = a.l, e = a.j[b];
|
|
3307
|
-
if (null != c)
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3222
|
+
if (null != c)
|
|
3223
|
+
if (e.l) {
|
|
3224
|
+
for (var f = [], g = 0; g < c.length; g++)
|
|
3225
|
+
f[g] = d.h(e, c[g]);
|
|
3226
|
+
c = f;
|
|
3227
|
+
} else
|
|
3228
|
+
c = d.h(e, c);
|
|
3311
3229
|
return a.g[b] = c;
|
|
3312
3230
|
}
|
|
3313
3231
|
return a.g[b];
|
|
@@ -3319,18 +3237,24 @@ var intl_tel_input_default = intlTelInput;
|
|
|
3319
3237
|
return a.j[b].l ? d[c || 0] : d;
|
|
3320
3238
|
}
|
|
3321
3239
|
function w(a, b) {
|
|
3322
|
-
if (q(a, b))
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3240
|
+
if (q(a, b))
|
|
3241
|
+
a = r(a, b);
|
|
3242
|
+
else
|
|
3243
|
+
a: {
|
|
3244
|
+
a = a.j[b];
|
|
3245
|
+
if (void 0 === a.j)
|
|
3246
|
+
if (b = a.s, b === Boolean)
|
|
3247
|
+
a.j = false;
|
|
3248
|
+
else if (b === Number)
|
|
3249
|
+
a.j = 0;
|
|
3250
|
+
else if (b === String)
|
|
3251
|
+
a.j = a.o ? "0" : "";
|
|
3252
|
+
else {
|
|
3253
|
+
a = new b();
|
|
3254
|
+
break a;
|
|
3255
|
+
}
|
|
3256
|
+
a = a.j;
|
|
3331
3257
|
}
|
|
3332
|
-
a = a.j;
|
|
3333
|
-
}
|
|
3334
3258
|
return a;
|
|
3335
3259
|
}
|
|
3336
3260
|
function u(a, b) {
|
|
@@ -3350,7 +3274,8 @@ var intl_tel_input_default = intlTelInput;
|
|
|
3350
3274
|
}
|
|
3351
3275
|
function y(a, b) {
|
|
3352
3276
|
var c = [], d;
|
|
3353
|
-
for (d in b)
|
|
3277
|
+
for (d in b)
|
|
3278
|
+
0 != d && c.push(new la(d, b[d]));
|
|
3354
3279
|
return new ta(a, c);
|
|
3355
3280
|
}
|
|
3356
3281
|
;
|
|
@@ -3361,13 +3286,18 @@ var intl_tel_input_default = intlTelInput;
|
|
|
3361
3286
|
throw Error("Unimplemented");
|
|
3362
3287
|
};
|
|
3363
3288
|
z.prototype.h = function(a, b) {
|
|
3364
|
-
if (11 == a.h || 10 == a.h)
|
|
3365
|
-
|
|
3366
|
-
if (
|
|
3289
|
+
if (11 == a.h || 10 == a.h)
|
|
3290
|
+
return b instanceof p ? b : this.g(a.s.prototype.m(), b);
|
|
3291
|
+
if (14 == a.h)
|
|
3292
|
+
return "string" === typeof b && xa.test(b) && (a = Number(b), 0 < a) ? a : b;
|
|
3293
|
+
if (!a.o)
|
|
3294
|
+
return b;
|
|
3367
3295
|
a = a.s;
|
|
3368
3296
|
if (a === String) {
|
|
3369
|
-
if ("number" === typeof b)
|
|
3370
|
-
|
|
3297
|
+
if ("number" === typeof b)
|
|
3298
|
+
return String(b);
|
|
3299
|
+
} else if (a === Number && "string" === typeof b && ("Infinity" === b || "-Infinity" === b || "NaN" === b || xa.test(b)))
|
|
3300
|
+
return Number(b);
|
|
3371
3301
|
return b;
|
|
3372
3302
|
};
|
|
3373
3303
|
var xa = /^-?[0-9]+$/;
|
|
@@ -3399,7 +3329,9 @@ var intl_tel_input_default = intlTelInput;
|
|
|
3399
3329
|
};
|
|
3400
3330
|
D.prototype.g = function(a, b, c) {
|
|
3401
3331
|
this.h += String(a);
|
|
3402
|
-
if (null != b)
|
|
3332
|
+
if (null != b)
|
|
3333
|
+
for (let d = 1; d < arguments.length; d++)
|
|
3334
|
+
this.h += arguments[d];
|
|
3403
3335
|
return this;
|
|
3404
3336
|
};
|
|
3405
3337
|
function E(a) {
|
|
@@ -8947,7 +8879,8 @@ var intl_tel_input_default = intlTelInput;
|
|
|
8947
8879
|
return null != a && (1 != x(a, 9) || -1 != u(a, 9)[0]);
|
|
8948
8880
|
}
|
|
8949
8881
|
function O(a, b) {
|
|
8950
|
-
for (var c = new D(), d, e = a.length, f = 0; f < e; ++f)
|
|
8882
|
+
for (var c = new D(), d, e = a.length, f = 0; f < e; ++f)
|
|
8883
|
+
d = a.charAt(f), d = b[d.toUpperCase()], null != d && c.g(d);
|
|
8951
8884
|
return c.toString();
|
|
8952
8885
|
}
|
|
8953
8886
|
function Ya(a) {
|
|
@@ -8959,12 +8892,15 @@ var intl_tel_input_default = intlTelInput;
|
|
|
8959
8892
|
K.prototype.format = function(a, b) {
|
|
8960
8893
|
if (0 == r(a, 2) && q(a, 5)) {
|
|
8961
8894
|
var c = w(a, 5);
|
|
8962
|
-
if (0 < c.length)
|
|
8895
|
+
if (0 < c.length)
|
|
8896
|
+
return c;
|
|
8963
8897
|
}
|
|
8964
8898
|
c = w(a, 1);
|
|
8965
8899
|
var d = Q(a);
|
|
8966
|
-
if (0 == b)
|
|
8967
|
-
|
|
8900
|
+
if (0 == b)
|
|
8901
|
+
return Za(c, 0, d, "");
|
|
8902
|
+
if (!(c in J))
|
|
8903
|
+
return d;
|
|
8968
8904
|
var e = R(this, c, S(c));
|
|
8969
8905
|
a = q(a, 3) && 0 != r(a, 3).length ? 3 == b ? ";ext=" + r(a, 3) : q(e, 13) ? r(e, 13) + w(a, 3) : " ext. " + w(a, 3) : "";
|
|
8970
8906
|
a: {
|
|
@@ -8981,17 +8917,15 @@ var intl_tel_input_default = intlTelInput;
|
|
|
8981
8917
|
}
|
|
8982
8918
|
e = null;
|
|
8983
8919
|
}
|
|
8984
|
-
null != e && (g = e, e = w(g, 2), f = new RegExp(r(g, 1)), w(
|
|
8985
|
-
g,
|
|
8986
|
-
5
|
|
8987
|
-
), g = w(g, 4), d = 2 == b && null != g && 0 < g.length ? d.replace(f, e.replace(Sa, g)) : d.replace(f, e), 3 == b && (d = d.replace(RegExp("^[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E]+"), ""), d = d.replace(RegExp("[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E]+", "g"), "-")));
|
|
8920
|
+
null != e && (g = e, e = w(g, 2), f = new RegExp(r(g, 1)), w(g, 5), g = w(g, 4), d = 2 == b && null != g && 0 < g.length ? d.replace(f, e.replace(Sa, g)) : d.replace(f, e), 3 == b && (d = d.replace(RegExp("^[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E]+"), ""), d = d.replace(RegExp("[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E]+", "g"), "-")));
|
|
8988
8921
|
return Za(c, b, d, a);
|
|
8989
8922
|
};
|
|
8990
8923
|
function R(a, b, c) {
|
|
8991
8924
|
return "001" == c ? T(a, "" + b) : T(a, c);
|
|
8992
8925
|
}
|
|
8993
8926
|
function Q(a) {
|
|
8994
|
-
if (!q(a, 2))
|
|
8927
|
+
if (!q(a, 2))
|
|
8928
|
+
return "";
|
|
8995
8929
|
var b = "" + r(a, 2);
|
|
8996
8930
|
return q(a, 4) && r(a, 4) && 0 < w(a, 8) ? Array(w(a, 8) + 1).join("0") + b : b;
|
|
8997
8931
|
}
|
|
@@ -9037,7 +8971,8 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9037
8971
|
function $a(a, b) {
|
|
9038
8972
|
var c = ab(a, b);
|
|
9039
8973
|
a = R(a, w(b, 1), c);
|
|
9040
|
-
if (null == a)
|
|
8974
|
+
if (null == a)
|
|
8975
|
+
return -1;
|
|
9041
8976
|
b = Q(b);
|
|
9042
8977
|
return bb(b, a);
|
|
9043
8978
|
}
|
|
@@ -9045,12 +8980,14 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9045
8980
|
return V(a, r(b, 1)) ? V(a, r(b, 5)) ? 4 : V(a, r(b, 4)) ? 3 : V(a, r(b, 6)) ? 5 : V(a, r(b, 8)) ? 6 : V(a, r(b, 7)) ? 7 : V(a, r(b, 21)) ? 8 : V(a, r(b, 25)) ? 9 : V(a, r(b, 28)) ? 10 : V(a, r(b, 2)) ? r(b, 18) || V(a, r(b, 3)) ? 2 : 0 : !r(b, 18) && V(a, r(b, 3)) ? 1 : -1 : -1;
|
|
9046
8981
|
}
|
|
9047
8982
|
function T(a, b) {
|
|
9048
|
-
if (null == b)
|
|
8983
|
+
if (null == b)
|
|
8984
|
+
return null;
|
|
9049
8985
|
b = b.toUpperCase();
|
|
9050
8986
|
var c = a.g[b];
|
|
9051
8987
|
if (null == c) {
|
|
9052
8988
|
c = Da[b];
|
|
9053
|
-
if (null == c)
|
|
8989
|
+
if (null == c)
|
|
8990
|
+
return null;
|
|
9054
8991
|
c = new C().g(H.m(), c);
|
|
9055
8992
|
a.g[b] = c;
|
|
9056
8993
|
}
|
|
@@ -9068,28 +9005,32 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9068
9005
|
return e;
|
|
9069
9006
|
}
|
|
9070
9007
|
function ab(a, b) {
|
|
9071
|
-
if (null == b)
|
|
9008
|
+
if (null == b)
|
|
9009
|
+
return null;
|
|
9072
9010
|
var c = w(b, 1);
|
|
9073
9011
|
c = J[c];
|
|
9074
|
-
if (null == c)
|
|
9075
|
-
|
|
9076
|
-
else
|
|
9077
|
-
|
|
9078
|
-
|
|
9079
|
-
|
|
9080
|
-
|
|
9081
|
-
|
|
9082
|
-
|
|
9012
|
+
if (null == c)
|
|
9013
|
+
a = null;
|
|
9014
|
+
else if (1 == c.length)
|
|
9015
|
+
a = c[0];
|
|
9016
|
+
else
|
|
9017
|
+
a: {
|
|
9018
|
+
b = Q(b);
|
|
9019
|
+
for (var d, e = c.length, f = 0; f < e; f++) {
|
|
9020
|
+
d = c[f];
|
|
9021
|
+
var g = T(a, d);
|
|
9022
|
+
if (q(g, 23)) {
|
|
9023
|
+
if (0 == b.search(r(g, 23))) {
|
|
9024
|
+
a = d;
|
|
9025
|
+
break a;
|
|
9026
|
+
}
|
|
9027
|
+
} else if (-1 != bb(b, g)) {
|
|
9083
9028
|
a = d;
|
|
9084
9029
|
break a;
|
|
9085
9030
|
}
|
|
9086
|
-
} else if (-1 != bb(b, g)) {
|
|
9087
|
-
a = d;
|
|
9088
|
-
break a;
|
|
9089
9031
|
}
|
|
9032
|
+
a = null;
|
|
9090
9033
|
}
|
|
9091
|
-
a = null;
|
|
9092
|
-
}
|
|
9093
9034
|
return a;
|
|
9094
9035
|
}
|
|
9095
9036
|
function S(a) {
|
|
@@ -9098,42 +9039,55 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9098
9039
|
}
|
|
9099
9040
|
function db(a, b) {
|
|
9100
9041
|
a = T(a, b);
|
|
9101
|
-
if (null == a)
|
|
9042
|
+
if (null == a)
|
|
9043
|
+
throw Error("Invalid region code: " + b);
|
|
9102
9044
|
return w(a, 10);
|
|
9103
9045
|
}
|
|
9104
9046
|
function W(a, b, c, d) {
|
|
9105
9047
|
var e = U(c, d), f = 0 == x(e, 9) ? u(r(c, 1), 9) : u(e, 9);
|
|
9106
9048
|
e = u(e, 10);
|
|
9107
|
-
if (2 == d)
|
|
9108
|
-
|
|
9109
|
-
|
|
9049
|
+
if (2 == d)
|
|
9050
|
+
if (Xa(U(c, 0)))
|
|
9051
|
+
a = U(c, 1), Xa(a) && (f = f.concat(0 == x(a, 9) ? u(r(c, 1), 9) : u(a, 9)), f.sort(), 0 == e.length ? e = u(a, 10) : (e = e.concat(u(a, 10)), e.sort()));
|
|
9052
|
+
else
|
|
9053
|
+
return W(a, b, c, 1);
|
|
9054
|
+
if (-1 == f[0])
|
|
9055
|
+
return 5;
|
|
9110
9056
|
b = b.length;
|
|
9111
|
-
if (-1 < e.indexOf(b))
|
|
9057
|
+
if (-1 < e.indexOf(b))
|
|
9058
|
+
return 4;
|
|
9112
9059
|
c = f[0];
|
|
9113
9060
|
return c == b ? 0 : c > b ? 2 : f[f.length - 1] < b ? 3 : -1 < f.indexOf(b, 1) ? 0 : 5;
|
|
9114
9061
|
}
|
|
9115
9062
|
function X(a, b, c) {
|
|
9116
9063
|
var d = Q(b);
|
|
9117
9064
|
b = w(b, 1);
|
|
9118
|
-
if (!(b in J))
|
|
9065
|
+
if (!(b in J))
|
|
9066
|
+
return 1;
|
|
9119
9067
|
b = R(a, b, S(b));
|
|
9120
9068
|
return W(a, d, b, c);
|
|
9121
9069
|
}
|
|
9122
9070
|
function eb(a, b) {
|
|
9123
9071
|
a = a.toString();
|
|
9124
|
-
if (0 == a.length || "0" == a.charAt(0))
|
|
9125
|
-
|
|
9072
|
+
if (0 == a.length || "0" == a.charAt(0))
|
|
9073
|
+
return 0;
|
|
9074
|
+
for (var c, d = a.length, e = 1; 3 >= e && e <= d; ++e)
|
|
9075
|
+
if (c = parseInt(a.substring(0, e), 10), c in J)
|
|
9076
|
+
return b.g(a.substring(e)), c;
|
|
9126
9077
|
return 0;
|
|
9127
9078
|
}
|
|
9128
9079
|
function fb(a, b, c, d, e, f) {
|
|
9129
|
-
if (0 == b.length)
|
|
9080
|
+
if (0 == b.length)
|
|
9081
|
+
return 0;
|
|
9130
9082
|
b = new D(b);
|
|
9131
9083
|
var g;
|
|
9132
9084
|
null != c && (g = r(c, 11));
|
|
9133
9085
|
null == g && (g = "NonMatch");
|
|
9134
9086
|
var h = b.toString();
|
|
9135
|
-
if (0 == h.length)
|
|
9136
|
-
|
|
9087
|
+
if (0 == h.length)
|
|
9088
|
+
g = 20;
|
|
9089
|
+
else if (L.test(h))
|
|
9090
|
+
h = h.replace(L, ""), E(b), b.g(Va(h)), g = 1;
|
|
9137
9091
|
else {
|
|
9138
9092
|
h = new RegExp(g);
|
|
9139
9093
|
Wa(b);
|
|
@@ -9142,17 +9096,21 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9142
9096
|
h = g.match(h)[0].length;
|
|
9143
9097
|
var l = g.substring(h).match(Ia);
|
|
9144
9098
|
l && null != l[1] && 0 < l[1].length && "0" == O(l[1], Ea) ? g = false : (E(b), b.g(g.substring(h)), g = true);
|
|
9145
|
-
} else
|
|
9099
|
+
} else
|
|
9100
|
+
g = false;
|
|
9146
9101
|
g = g ? 5 : 20;
|
|
9147
9102
|
}
|
|
9148
9103
|
e && t(f, 6, g);
|
|
9149
9104
|
if (20 != g) {
|
|
9150
|
-
if (2 >= b.h.length)
|
|
9105
|
+
if (2 >= b.h.length)
|
|
9106
|
+
throw Error("Phone number too short after IDD");
|
|
9151
9107
|
a = eb(b, d);
|
|
9152
|
-
if (0 != a)
|
|
9108
|
+
if (0 != a)
|
|
9109
|
+
return t(f, 1, a), a;
|
|
9153
9110
|
throw Error("Invalid country calling code");
|
|
9154
9111
|
}
|
|
9155
|
-
if (null != c && (g = w(c, 10), h = "" + g, l = b.toString(), 0 == l.lastIndexOf(h, 0) && (h = new D(l.substring(h.length)), l = r(c, 1), l = new RegExp(w(l, 2)), gb(h, c, null), h = h.toString(), !N(l, b.toString()) && N(l, h) || 3 == W(a, b.toString(), c, -1))))
|
|
9112
|
+
if (null != c && (g = w(c, 10), h = "" + g, l = b.toString(), 0 == l.lastIndexOf(h, 0) && (h = new D(l.substring(h.length)), l = r(c, 1), l = new RegExp(w(l, 2)), gb(h, c, null), h = h.toString(), !N(l, b.toString()) && N(l, h) || 3 == W(a, b.toString(), c, -1))))
|
|
9113
|
+
return d.g(h), e && t(f, 6, 10), t(f, 1, g), g;
|
|
9156
9114
|
t(f, 1, 0);
|
|
9157
9115
|
return 0;
|
|
9158
9116
|
}
|
|
@@ -9165,36 +9123,46 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9165
9123
|
var h = N(f, d), l = e.length - 1;
|
|
9166
9124
|
b = r(b, 16);
|
|
9167
9125
|
if (null == b || 0 == b.length || null == e[l] || 0 == e[l].length) {
|
|
9168
|
-
if (!h || N(f, d.substring(e[0].length)))
|
|
9169
|
-
|
|
9126
|
+
if (!h || N(f, d.substring(e[0].length)))
|
|
9127
|
+
null != c && 0 < l && null != e[l] && c.g(e[1]), a.set(d.substring(e[0].length));
|
|
9128
|
+
} else if (d = d.replace(g, b), !h || N(f, d))
|
|
9129
|
+
null != c && 0 < l && c.g(e[1]), a.set(d);
|
|
9170
9130
|
}
|
|
9171
9131
|
}
|
|
9172
9132
|
}
|
|
9173
9133
|
function Y(a, b, c) {
|
|
9174
|
-
if (!P(c) && 0 < b.length && "+" != b.charAt(0))
|
|
9134
|
+
if (!P(c) && 0 < b.length && "+" != b.charAt(0))
|
|
9135
|
+
throw Error("Invalid country calling code");
|
|
9175
9136
|
return hb(a, b, c, true);
|
|
9176
9137
|
}
|
|
9177
9138
|
function hb(a, b, c, d) {
|
|
9178
|
-
if (null == b)
|
|
9179
|
-
|
|
9139
|
+
if (null == b)
|
|
9140
|
+
throw Error("The string supplied did not seem to be a phone number");
|
|
9141
|
+
if (250 < b.length)
|
|
9142
|
+
throw Error("The string supplied is too long to be a phone number");
|
|
9180
9143
|
var e = new D();
|
|
9181
9144
|
var f = b.indexOf(";phone-context=");
|
|
9182
|
-
if (-1 === f)
|
|
9183
|
-
|
|
9145
|
+
if (-1 === f)
|
|
9146
|
+
f = null;
|
|
9147
|
+
else if (f += 15, f >= b.length)
|
|
9148
|
+
f = "";
|
|
9184
9149
|
else {
|
|
9185
9150
|
var g = b.indexOf(";", f);
|
|
9186
9151
|
f = -1 !== g ? b.substring(f, g) : b.substring(f);
|
|
9187
9152
|
}
|
|
9188
9153
|
var h = f;
|
|
9189
9154
|
null == h ? g = true : 0 === h.length ? g = false : (g = Na.exec(h), h = Oa.exec(h), g = null !== g || null !== h);
|
|
9190
|
-
if (!g)
|
|
9191
|
-
|
|
9155
|
+
if (!g)
|
|
9156
|
+
throw Error("The string supplied did not seem to be a phone number");
|
|
9157
|
+
null != f ? ("+" === f.charAt(0) && e.g(f), f = b.indexOf("tel:"), e.g(b.substring(0 <= f ? f + 4 : 0, b.indexOf(";phone-context=")))) : (f = e.g, g = b !== null && b !== void 0 ? b : "", h = g.search(Ja), 0 <= h ? (g = g.substring(h), g = g.replace(La, ""), h = g.search(Ka), 0 <= h && (g = g.substring(0, h))) : g = "", f.call(e, g));
|
|
9192
9158
|
f = e.toString();
|
|
9193
9159
|
g = f.indexOf(";isub=");
|
|
9194
9160
|
0 < g && (E(e), e.g(f.substring(0, g)));
|
|
9195
|
-
if (!Ua(e.toString()))
|
|
9161
|
+
if (!Ua(e.toString()))
|
|
9162
|
+
throw Error("The string supplied did not seem to be a phone number");
|
|
9196
9163
|
f = e.toString();
|
|
9197
|
-
if (!(P(c) || null != f && 0 < f.length && L.test(f)))
|
|
9164
|
+
if (!(P(c) || null != f && 0 < f.length && L.test(f)))
|
|
9165
|
+
throw Error("Invalid country calling code");
|
|
9198
9166
|
f = new I();
|
|
9199
9167
|
d && t(f, 5, b);
|
|
9200
9168
|
a: {
|
|
@@ -9202,12 +9170,13 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9202
9170
|
g = b.search(Qa);
|
|
9203
9171
|
if (0 <= g && Ua(b.substring(0, g))) {
|
|
9204
9172
|
h = b.match(Qa);
|
|
9205
|
-
for (var l = h.length, A = 1; A < l; ++A)
|
|
9206
|
-
|
|
9207
|
-
|
|
9208
|
-
|
|
9209
|
-
|
|
9210
|
-
|
|
9173
|
+
for (var l = h.length, A = 1; A < l; ++A)
|
|
9174
|
+
if (null != h[A] && 0 < h[A].length) {
|
|
9175
|
+
E(e);
|
|
9176
|
+
e.g(b.substring(0, g));
|
|
9177
|
+
b = h[A];
|
|
9178
|
+
break a;
|
|
9179
|
+
}
|
|
9211
9180
|
}
|
|
9212
9181
|
b = "";
|
|
9213
9182
|
}
|
|
@@ -9220,23 +9189,25 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9220
9189
|
h = fb(a, l, g, b, d, f);
|
|
9221
9190
|
} catch (ca) {
|
|
9222
9191
|
if ("Invalid country calling code" == ca.message && L.test(l)) {
|
|
9223
|
-
if (l = l.replace(L, ""), h = fb(a, l, g, b, d, f), 0 == h)
|
|
9224
|
-
|
|
9225
|
-
|
|
9226
|
-
|
|
9227
|
-
|
|
9228
|
-
|
|
9229
|
-
|
|
9230
|
-
|
|
9231
|
-
if (2 > b.h.length) throw Error("The string supplied is too short to be a phone number");
|
|
9192
|
+
if (l = l.replace(L, ""), h = fb(a, l, g, b, d, f), 0 == h)
|
|
9193
|
+
throw ca;
|
|
9194
|
+
} else
|
|
9195
|
+
throw ca;
|
|
9196
|
+
}
|
|
9197
|
+
0 != h ? (e = S(h), e != c && (g = R(a, h, e))) : (Wa(e), b.g(e.toString()), null != c ? (h = w(g, 10), t(f, 1, h)) : d && (delete f.h[6], f.g && delete f.g[6]));
|
|
9198
|
+
if (2 > b.h.length)
|
|
9199
|
+
throw Error("The string supplied is too short to be a phone number");
|
|
9232
9200
|
null != g && (c = new D(), e = new D(b.toString()), gb(e, g, c), a = W(a, e.toString(), g, -1), 2 != a && 4 != a && 5 != a && (b = e, d && 0 < c.toString().length && t(f, 7, c.toString())));
|
|
9233
9201
|
d = b.toString();
|
|
9234
9202
|
a = d.length;
|
|
9235
|
-
if (2 > a)
|
|
9236
|
-
|
|
9203
|
+
if (2 > a)
|
|
9204
|
+
throw Error("The string supplied is too short to be a phone number");
|
|
9205
|
+
if (17 < a)
|
|
9206
|
+
throw Error("The string supplied is too long to be a phone number");
|
|
9237
9207
|
if (1 < d.length && "0" == d.charAt(0)) {
|
|
9238
9208
|
t(f, 4, true);
|
|
9239
|
-
for (a = 1; a < d.length - 1 && "0" == d.charAt(a); )
|
|
9209
|
+
for (a = 1; a < d.length - 1 && "0" == d.charAt(a); )
|
|
9210
|
+
a++;
|
|
9240
9211
|
1 != a && t(f, 8, a);
|
|
9241
9212
|
}
|
|
9242
9213
|
t(f, 2, parseInt(d, 10));
|
|
@@ -9277,7 +9248,8 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9277
9248
|
function nb(a) {
|
|
9278
9249
|
for (var b = a.j.length, c = 0; c < b; ++c) {
|
|
9279
9250
|
var d = a.j[c], e = w(d, 1);
|
|
9280
|
-
if (a.da == e)
|
|
9251
|
+
if (a.da == e)
|
|
9252
|
+
return false;
|
|
9281
9253
|
var f = a;
|
|
9282
9254
|
var g = d, h = w(g, 1);
|
|
9283
9255
|
E(f.v);
|
|
@@ -9286,7 +9258,8 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9286
9258
|
var A = "999999999999999".match(h)[0];
|
|
9287
9259
|
A.length < l.g.h.length ? l = "" : (l = A.replace(new RegExp(h, "g"), g), l = l.replace(RegExp("9", "g"), "\u2008"));
|
|
9288
9260
|
0 < l.length ? (f.v.g(l), f = true) : f = false;
|
|
9289
|
-
if (f)
|
|
9261
|
+
if (f)
|
|
9262
|
+
return a.da = e, a.ha = mb.test(r(d, 4)), a.$ = 0, true;
|
|
9290
9263
|
}
|
|
9291
9264
|
return a.u = false;
|
|
9292
9265
|
}
|
|
@@ -9304,8 +9277,10 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9304
9277
|
if (!a.u) {
|
|
9305
9278
|
if (!a.la) {
|
|
9306
9279
|
if (qb(a)) {
|
|
9307
|
-
if (rb(a))
|
|
9308
|
-
|
|
9280
|
+
if (rb(a))
|
|
9281
|
+
return sb(a);
|
|
9282
|
+
} else if (0 < a.o.length && (b = a.g.toString(), E(a.g), a.g.g(a.o), a.g.g(b), b = a.h.toString(), c = b.lastIndexOf(a.o), E(a.h), a.h.g(b.substring(0, c))), a.o != tb(a))
|
|
9283
|
+
return a.h.g(" "), sb(a);
|
|
9309
9284
|
}
|
|
9310
9285
|
return a.s.toString();
|
|
9311
9286
|
}
|
|
@@ -9315,14 +9290,18 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9315
9290
|
case 2:
|
|
9316
9291
|
return a.s.toString();
|
|
9317
9292
|
case 3:
|
|
9318
|
-
if (qb(a))
|
|
9319
|
-
|
|
9293
|
+
if (qb(a))
|
|
9294
|
+
a.ea = true;
|
|
9295
|
+
else
|
|
9296
|
+
return a.o = tb(a), ub(a);
|
|
9320
9297
|
default:
|
|
9321
|
-
if (a.ea)
|
|
9298
|
+
if (a.ea)
|
|
9299
|
+
return rb(a) && (a.ea = false), a.h.toString() + a.g.toString();
|
|
9322
9300
|
if (0 < a.j.length) {
|
|
9323
9301
|
b = vb(a, b);
|
|
9324
9302
|
c = wb(a);
|
|
9325
|
-
if (0 < c.length)
|
|
9303
|
+
if (0 < c.length)
|
|
9304
|
+
return c;
|
|
9326
9305
|
ob(a, a.g.toString());
|
|
9327
9306
|
return nb(a) ? xb(a) : a.u ? Z(a, b) : a.s.toString();
|
|
9328
9307
|
}
|
|
@@ -9341,7 +9320,8 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9341
9320
|
function wb(a) {
|
|
9342
9321
|
for (var b = a.g.toString(), c = a.j.length, d = 0; d < c; ++d) {
|
|
9343
9322
|
var e = a.j[d], f = w(e, 1);
|
|
9344
|
-
if (new RegExp("^(?:" + f + ")$").test(b) && (a.ha = mb.test(r(e, 4)), e = b.replace(new RegExp(f, "g"), r(e, 2)), e = Z(a, e), O(e, Fa) == a.ba))
|
|
9323
|
+
if (new RegExp("^(?:" + f + ")$").test(b) && (a.ha = mb.test(r(e, 4)), e = b.replace(new RegExp(f, "g"), r(e, 2)), e = Z(a, e), O(e, Fa) == a.ba))
|
|
9324
|
+
return e;
|
|
9345
9325
|
}
|
|
9346
9326
|
return "";
|
|
9347
9327
|
}
|
|
@@ -9365,15 +9345,18 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9365
9345
|
function xb(a) {
|
|
9366
9346
|
var b = a.g.toString(), c = b.length;
|
|
9367
9347
|
if (0 < c) {
|
|
9368
|
-
for (var d = "", e = 0; e < c; e++)
|
|
9348
|
+
for (var d = "", e = 0; e < c; e++)
|
|
9349
|
+
d = vb(a, b.charAt(e));
|
|
9369
9350
|
return a.u ? Z(a, d) : a.s.toString();
|
|
9370
9351
|
}
|
|
9371
9352
|
return a.h.toString();
|
|
9372
9353
|
}
|
|
9373
9354
|
function tb(a) {
|
|
9374
9355
|
var b = a.g.toString(), c = 0;
|
|
9375
|
-
if (1 != r(a.l, 10))
|
|
9376
|
-
|
|
9356
|
+
if (1 != r(a.l, 10))
|
|
9357
|
+
var d = false;
|
|
9358
|
+
else
|
|
9359
|
+
d = a.g.toString(), d = "1" == d.charAt(0) && "0" != d.charAt(1) && "1" != d.charAt(1);
|
|
9377
9360
|
d ? (c = 1, a.h.g("1").g(" "), a.ca = true) : q(a.l, 15) && (d = new RegExp("^(?:" + r(a.l, 15) + ")"), d = b.match(d), null != d && null != d[0] && 0 < d[0].length && (a.ca = true, c = d[0].length, a.h.g(b.substring(0, c))));
|
|
9378
9361
|
E(a.g);
|
|
9379
9362
|
a.g.g(b.substring(c));
|
|
@@ -9385,9 +9368,11 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9385
9368
|
return null != c && null != c[0] && 0 < c[0].length ? (a.ca = true, c = c[0].length, E(a.g), a.g.g(b.substring(c)), E(a.h), a.h.g(b.substring(0, c)), "+" != b.charAt(0) && a.h.g(" "), true) : false;
|
|
9386
9369
|
}
|
|
9387
9370
|
function rb(a) {
|
|
9388
|
-
if (0 == a.g.h.length)
|
|
9371
|
+
if (0 == a.g.h.length)
|
|
9372
|
+
return false;
|
|
9389
9373
|
var b = new D(), c = eb(a.g, b);
|
|
9390
|
-
if (0 == c)
|
|
9374
|
+
if (0 == c)
|
|
9375
|
+
return false;
|
|
9391
9376
|
E(a.g);
|
|
9392
9377
|
a.g.g(b.toString());
|
|
9393
9378
|
b = S(c);
|
|
@@ -9419,9 +9404,10 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9419
9404
|
try {
|
|
9420
9405
|
const c = a.replace(/[^+0-9]/g, ""), d = new ib(b);
|
|
9421
9406
|
b = "";
|
|
9422
|
-
for (let e = 0; e < c.length; e++)
|
|
9407
|
+
for (let e = 0; e < c.length; e++)
|
|
9408
|
+
d.ja = pb(d, c.charAt(e)), b = d.ja;
|
|
9423
9409
|
return b;
|
|
9424
|
-
} catch {
|
|
9410
|
+
} catch (_a) {
|
|
9425
9411
|
return a;
|
|
9426
9412
|
}
|
|
9427
9413
|
});
|
|
@@ -9430,7 +9416,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9430
9416
|
const e = K.g(), f = Y(e, a, b);
|
|
9431
9417
|
var d = X(e, f, -1);
|
|
9432
9418
|
return 0 == d || 4 == d ? e.format(f, "undefined" === typeof c ? 0 : c) : a;
|
|
9433
|
-
} catch {
|
|
9419
|
+
} catch (_a) {
|
|
9434
9420
|
return a;
|
|
9435
9421
|
}
|
|
9436
9422
|
});
|
|
@@ -9453,14 +9439,14 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9453
9439
|
h = null;
|
|
9454
9440
|
}
|
|
9455
9441
|
return l.format(h, d ? 0 : b ? 2 : 1);
|
|
9456
|
-
} catch {
|
|
9442
|
+
} catch (_a) {
|
|
9457
9443
|
return "";
|
|
9458
9444
|
}
|
|
9459
9445
|
});
|
|
9460
9446
|
m("intlTelInputUtilsTemp.getExtension", (a, b) => {
|
|
9461
9447
|
try {
|
|
9462
9448
|
return r(Y(K.g(), a, b), 3);
|
|
9463
|
-
} catch {
|
|
9449
|
+
} catch (_a) {
|
|
9464
9450
|
return "";
|
|
9465
9451
|
}
|
|
9466
9452
|
});
|
|
@@ -9468,12 +9454,13 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9468
9454
|
try {
|
|
9469
9455
|
const c = K.g(), d = Y(c, a, b);
|
|
9470
9456
|
return $a(c, d);
|
|
9471
|
-
} catch {
|
|
9457
|
+
} catch (_a) {
|
|
9472
9458
|
return -99;
|
|
9473
9459
|
}
|
|
9474
9460
|
});
|
|
9475
9461
|
m("intlTelInputUtilsTemp.getValidationError", (a, b) => {
|
|
9476
|
-
if (!b)
|
|
9462
|
+
if (!b)
|
|
9463
|
+
return 1;
|
|
9477
9464
|
try {
|
|
9478
9465
|
const c = K.g(), d = Y(c, a, b);
|
|
9479
9466
|
return X(c, d, -1);
|
|
@@ -9490,7 +9477,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9490
9477
|
return f && g.includes($a(d, e));
|
|
9491
9478
|
}
|
|
9492
9479
|
return f;
|
|
9493
|
-
} catch {
|
|
9480
|
+
} catch (_a) {
|
|
9494
9481
|
return false;
|
|
9495
9482
|
}
|
|
9496
9483
|
});
|
|
@@ -9499,18 +9486,20 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9499
9486
|
const d = K.g(), e = Y(d, a, b);
|
|
9500
9487
|
if (c) {
|
|
9501
9488
|
yb(c);
|
|
9502
|
-
for (let f of c)
|
|
9489
|
+
for (let f of c)
|
|
9490
|
+
if (0 === X(d, e, zb[f]))
|
|
9491
|
+
return true;
|
|
9503
9492
|
return false;
|
|
9504
9493
|
}
|
|
9505
9494
|
return 0 === X(d, e, -1);
|
|
9506
|
-
} catch {
|
|
9495
|
+
} catch (_a) {
|
|
9507
9496
|
return false;
|
|
9508
9497
|
}
|
|
9509
9498
|
});
|
|
9510
9499
|
m("intlTelInputUtilsTemp.getCoreNumber", (a, b) => {
|
|
9511
9500
|
try {
|
|
9512
9501
|
return r(Y(K.g(), a, b), 2).toString();
|
|
9513
|
-
} catch {
|
|
9502
|
+
} catch (_a) {
|
|
9514
9503
|
return "";
|
|
9515
9504
|
}
|
|
9516
9505
|
});
|
|
@@ -9523,13 +9512,15 @@ var utils = globalContext.intlTelInputUtilsTemp;
|
|
|
9523
9512
|
delete globalContext.intlTelInputUtilsTemp;
|
|
9524
9513
|
var utils_default = utils;
|
|
9525
9514
|
|
|
9526
|
-
//
|
|
9515
|
+
// angular/build/temp/intl-tel-input/intlTelInputWithUtils.js
|
|
9527
9516
|
intl_tel_input_default.utils = utils_default;
|
|
9528
9517
|
var intlTelInputWithUtils_default = intl_tel_input_default;
|
|
9529
9518
|
|
|
9530
|
-
// angular/
|
|
9531
|
-
import { Component, Input, ViewChild, Output, EventEmitter, forwardRef } from "@angular/core";
|
|
9519
|
+
// angular/build/temp/intl-tel-input/angularWithUtils.js
|
|
9520
|
+
import { Component, Input, ViewChild, ElementRef, Output, EventEmitter, forwardRef } from "@angular/core";
|
|
9532
9521
|
import { NG_VALUE_ACCESSOR, NG_VALIDATORS } from "@angular/forms";
|
|
9522
|
+
import * as i0 from "@angular/core";
|
|
9523
|
+
var _c0 = ["inputRef"];
|
|
9533
9524
|
var PHONE_ERROR_MESSAGES = [
|
|
9534
9525
|
"invalid",
|
|
9535
9526
|
"invalid-country-code",
|
|
@@ -9550,13 +9541,10 @@ var IntlTelInputComponent = class {
|
|
|
9550
9541
|
this.errorCodeChange = new EventEmitter();
|
|
9551
9542
|
this.iti = null;
|
|
9552
9543
|
this.countryChangeHandler = () => this.handleInput();
|
|
9553
|
-
// eslint-disable-next-line class-methods-use-this
|
|
9554
9544
|
this.onChange = () => {
|
|
9555
9545
|
};
|
|
9556
|
-
// eslint-disable-next-line class-methods-use-this
|
|
9557
9546
|
this.onTouched = () => {
|
|
9558
9547
|
};
|
|
9559
|
-
// eslint-disable-next-line class-methods-use-this
|
|
9560
9548
|
this.onValidatorChange = () => {
|
|
9561
9549
|
};
|
|
9562
9550
|
}
|
|
@@ -9573,12 +9561,14 @@ var IntlTelInputComponent = class {
|
|
|
9573
9561
|
}
|
|
9574
9562
|
}
|
|
9575
9563
|
ngAfterViewInit() {
|
|
9564
|
+
var _a;
|
|
9576
9565
|
if (this.initialValue) {
|
|
9577
|
-
this.iti
|
|
9566
|
+
(_a = this.iti) === null || _a === void 0 ? void 0 : _a.setNumber(this.initialValue);
|
|
9578
9567
|
}
|
|
9579
9568
|
}
|
|
9580
9569
|
handleInput() {
|
|
9581
|
-
if (!this.iti)
|
|
9570
|
+
if (!this.iti)
|
|
9571
|
+
return;
|
|
9582
9572
|
const num = this.iti.getNumber() || "";
|
|
9583
9573
|
const countryIso = this.iti.getSelectedCountryData().iso2 || "";
|
|
9584
9574
|
this.numberChange.emit(num);
|
|
@@ -9604,7 +9594,8 @@ var IntlTelInputComponent = class {
|
|
|
9604
9594
|
return this.inputRef.nativeElement;
|
|
9605
9595
|
}
|
|
9606
9596
|
ngOnDestroy() {
|
|
9607
|
-
|
|
9597
|
+
var _a;
|
|
9598
|
+
(_a = this.iti) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
9608
9599
|
this.inputRef.nativeElement.removeEventListener("countrychange", this.countryChangeHandler);
|
|
9609
9600
|
}
|
|
9610
9601
|
applyInputProps() {
|
|
@@ -9649,41 +9640,52 @@ var IntlTelInputComponent = class {
|
|
|
9649
9640
|
this.onValidatorChange = fn;
|
|
9650
9641
|
}
|
|
9651
9642
|
};
|
|
9652
|
-
|
|
9653
|
-
|
|
9654
|
-
|
|
9655
|
-
|
|
9656
|
-
|
|
9657
|
-
|
|
9658
|
-
|
|
9659
|
-
|
|
9660
|
-
|
|
9661
|
-
|
|
9662
|
-
|
|
9663
|
-
|
|
9664
|
-
|
|
9665
|
-
|
|
9666
|
-
|
|
9667
|
-
|
|
9668
|
-
|
|
9669
|
-
|
|
9670
|
-
|
|
9671
|
-
|
|
9672
|
-
|
|
9673
|
-
|
|
9674
|
-
|
|
9675
|
-
|
|
9676
|
-
|
|
9677
|
-
|
|
9678
|
-
|
|
9679
|
-
|
|
9680
|
-
|
|
9681
|
-
|
|
9682
|
-
|
|
9683
|
-
|
|
9684
|
-
|
|
9685
|
-
|
|
9686
|
-
|
|
9643
|
+
IntlTelInputComponent.\u0275fac = function IntlTelInputComponent_Factory(__ngFactoryType__) {
|
|
9644
|
+
return new (__ngFactoryType__ || IntlTelInputComponent)();
|
|
9645
|
+
};
|
|
9646
|
+
IntlTelInputComponent.\u0275cmp = /* @__PURE__ */ i0.\u0275\u0275defineComponent({ type: IntlTelInputComponent, selectors: [["intl-tel-input"]], viewQuery: function IntlTelInputComponent_Query(rf, ctx) {
|
|
9647
|
+
if (rf & 1) {
|
|
9648
|
+
i0.\u0275\u0275viewQuery(_c0, 7);
|
|
9649
|
+
}
|
|
9650
|
+
if (rf & 2) {
|
|
9651
|
+
let _t;
|
|
9652
|
+
i0.\u0275\u0275queryRefresh(_t = i0.\u0275\u0275loadQuery()) && (ctx.inputRef = _t.first);
|
|
9653
|
+
}
|
|
9654
|
+
}, inputs: { initialValue: "initialValue", usePreciseValidation: "usePreciseValidation", inputProps: "inputProps", disabled: "disabled", initOptions: "initOptions" }, outputs: { numberChange: "numberChange", countryChange: "countryChange", validityChange: "validityChange", errorCodeChange: "errorCodeChange" }, features: [i0.\u0275\u0275ProvidersFeature([
|
|
9655
|
+
{
|
|
9656
|
+
provide: NG_VALUE_ACCESSOR,
|
|
9657
|
+
useExisting: forwardRef(() => IntlTelInputComponent),
|
|
9658
|
+
multi: true
|
|
9659
|
+
},
|
|
9660
|
+
{
|
|
9661
|
+
provide: NG_VALIDATORS,
|
|
9662
|
+
useExisting: forwardRef(() => IntlTelInputComponent),
|
|
9663
|
+
multi: true
|
|
9664
|
+
}
|
|
9665
|
+
])], decls: 2, vars: 1, consts: [["inputRef", ""], ["type", "tel", 3, "input", "blur", "disabled"]], template: function IntlTelInputComponent_Template(rf, ctx) {
|
|
9666
|
+
if (rf & 1) {
|
|
9667
|
+
const _r1 = i0.\u0275\u0275getCurrentView();
|
|
9668
|
+
i0.\u0275\u0275elementStart(0, "input", 1, 0);
|
|
9669
|
+
i0.\u0275\u0275listener("input", function IntlTelInputComponent_Template_input_input_0_listener() {
|
|
9670
|
+
i0.\u0275\u0275restoreView(_r1);
|
|
9671
|
+
return i0.\u0275\u0275resetView(ctx.handleInput());
|
|
9672
|
+
})("blur", function IntlTelInputComponent_Template_input_blur_0_listener() {
|
|
9673
|
+
i0.\u0275\u0275restoreView(_r1);
|
|
9674
|
+
return i0.\u0275\u0275resetView(ctx.handleBlur());
|
|
9675
|
+
});
|
|
9676
|
+
i0.\u0275\u0275elementEnd();
|
|
9677
|
+
}
|
|
9678
|
+
if (rf & 2) {
|
|
9679
|
+
i0.\u0275\u0275property("disabled", ctx.disabled);
|
|
9680
|
+
}
|
|
9681
|
+
}, encapsulation: 2 });
|
|
9682
|
+
(() => {
|
|
9683
|
+
(typeof ngDevMode === "undefined" || ngDevMode) && i0.\u0275setClassMetadata(IntlTelInputComponent, [{
|
|
9684
|
+
type: Component,
|
|
9685
|
+
args: [{
|
|
9686
|
+
selector: "intl-tel-input",
|
|
9687
|
+
standalone: true,
|
|
9688
|
+
template: `
|
|
9687
9689
|
<input
|
|
9688
9690
|
type="tel"
|
|
9689
9691
|
#inputRef
|
|
@@ -9692,20 +9694,45 @@ IntlTelInputComponent = __decorateClass([
|
|
|
9692
9694
|
[disabled]="disabled"
|
|
9693
9695
|
/>
|
|
9694
9696
|
`,
|
|
9695
|
-
|
|
9696
|
-
|
|
9697
|
-
|
|
9698
|
-
|
|
9699
|
-
|
|
9700
|
-
|
|
9701
|
-
|
|
9702
|
-
|
|
9703
|
-
|
|
9704
|
-
|
|
9705
|
-
|
|
9706
|
-
|
|
9707
|
-
|
|
9708
|
-
],
|
|
9697
|
+
providers: [
|
|
9698
|
+
{
|
|
9699
|
+
provide: NG_VALUE_ACCESSOR,
|
|
9700
|
+
useExisting: forwardRef(() => IntlTelInputComponent),
|
|
9701
|
+
multi: true
|
|
9702
|
+
},
|
|
9703
|
+
{
|
|
9704
|
+
provide: NG_VALIDATORS,
|
|
9705
|
+
useExisting: forwardRef(() => IntlTelInputComponent),
|
|
9706
|
+
multi: true
|
|
9707
|
+
}
|
|
9708
|
+
]
|
|
9709
|
+
}]
|
|
9710
|
+
}], null, { inputRef: [{
|
|
9711
|
+
type: ViewChild,
|
|
9712
|
+
args: ["inputRef", { static: true }]
|
|
9713
|
+
}], initialValue: [{
|
|
9714
|
+
type: Input
|
|
9715
|
+
}], usePreciseValidation: [{
|
|
9716
|
+
type: Input
|
|
9717
|
+
}], inputProps: [{
|
|
9718
|
+
type: Input
|
|
9719
|
+
}], disabled: [{
|
|
9720
|
+
type: Input
|
|
9721
|
+
}], initOptions: [{
|
|
9722
|
+
type: Input
|
|
9723
|
+
}], numberChange: [{
|
|
9724
|
+
type: Output
|
|
9725
|
+
}], countryChange: [{
|
|
9726
|
+
type: Output
|
|
9727
|
+
}], validityChange: [{
|
|
9728
|
+
type: Output
|
|
9729
|
+
}], errorCodeChange: [{
|
|
9730
|
+
type: Output
|
|
9731
|
+
}] });
|
|
9732
|
+
})();
|
|
9733
|
+
(() => {
|
|
9734
|
+
(typeof ngDevMode === "undefined" || ngDevMode) && i0.\u0275setClassDebugInfo(IntlTelInputComponent, { className: "IntlTelInputComponent", filePath: "intl-tel-input/angularwithutils.ts", lineNumber: 43 });
|
|
9735
|
+
})();
|
|
9709
9736
|
export {
|
|
9710
9737
|
IntlTelInputComponent,
|
|
9711
9738
|
PHONE_ERROR_MESSAGES,
|