intl-tel-input 25.11.2 → 25.11.3
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/README.md +1 -1
- package/angular/build/IntlTelInput.js +4 -3
- package/angular/build/IntlTelInputWithUtils.js +13 -12
- package/angular/build/types/modules/constants.d.ts +1 -0
- package/angular/build/types/modules/types/public-api.d.ts +4 -2
- package/build/js/data.js +1 -1
- package/build/js/data.min.js +1 -1
- package/build/js/intlTelInput.d.ts +5 -2
- package/build/js/intlTelInput.js +5 -4
- package/build/js/intlTelInput.min.js +3 -3
- package/build/js/intlTelInputWithUtils.js +14 -13
- package/build/js/intlTelInputWithUtils.min.js +3 -3
- package/build/js/utils.js +9 -9
- package/package.json +1 -1
- package/react/README.md +1 -1
- package/react/build/IntlTelInput.cjs +4 -3
- package/react/build/IntlTelInput.d.ts +5 -2
- package/react/build/IntlTelInput.js +4 -3
- package/react/build/IntlTelInputWithUtils.cjs +13 -12
- package/react/build/IntlTelInputWithUtils.js +13 -12
- package/vue/README.md +1 -1
- package/vue/build/IntlTelInput.mjs +65 -64
- package/vue/build/IntlTelInputWithUtils.mjs +166 -165
package/README.md
CHANGED
|
@@ -81,16 +81,16 @@ _Note: We have now dropped support for all versions of Internet Explorer because
|
|
|
81
81
|
## Getting Started (Using a CDN)
|
|
82
82
|
1. Add the CSS
|
|
83
83
|
```html
|
|
84
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/intl-tel-input@25.11.
|
|
84
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/intl-tel-input@25.11.3/build/css/intlTelInput.css">
|
|
85
85
|
```
|
|
86
86
|
|
|
87
87
|
2. Add the plugin script and initialise it on your input element
|
|
88
88
|
```html
|
|
89
|
-
<script src="https://cdn.jsdelivr.net/npm/intl-tel-input@25.11.
|
|
89
|
+
<script src="https://cdn.jsdelivr.net/npm/intl-tel-input@25.11.3/build/js/intlTelInput.min.js"></script>
|
|
90
90
|
<script>
|
|
91
91
|
const input = document.querySelector("#phone");
|
|
92
92
|
window.intlTelInput(input, {
|
|
93
|
-
loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.11.
|
|
93
|
+
loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.11.3/build/js/utils.js"),
|
|
94
94
|
});
|
|
95
95
|
</script>
|
|
96
96
|
```
|
|
@@ -333,7 +333,7 @@ The `loadUtils` option takes a function which returns a Promise which resolves t
|
|
|
333
333
|
```js
|
|
334
334
|
// (A) import utils module from a CDN
|
|
335
335
|
intlTelInput(htmlInputElement, {
|
|
336
|
-
loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.11.
|
|
336
|
+
loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.11.3/build/js/utils.js"),
|
|
337
337
|
});
|
|
338
338
|
|
|
339
339
|
// (B) import utils module from your own hosted version of utils.js
|
|
@@ -617,7 +617,7 @@ The `loadUtils` option takes a function that returns a Promise resolving to the
|
|
|
617
617
|
```js
|
|
618
618
|
// (A) import utils module from a CDN
|
|
619
619
|
intlTelInput(htmlInputElement, {
|
|
620
|
-
loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.11.
|
|
620
|
+
loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.11.3/build/js/utils.js"),
|
|
621
621
|
});
|
|
622
622
|
|
|
623
623
|
// (B) import utils module from your own hosted version of utils.js
|
package/angular/README.md
CHANGED
|
@@ -29,7 +29,7 @@ import "intl-tel-input/styles";
|
|
|
29
29
|
|
|
30
30
|
See the [Validation demo](https://github.com/jackocnr/intl-tel-input/blob/master/angular/demo/validation/validation.component.ts) for a more fleshed-out example of how to handle validation.
|
|
31
31
|
|
|
32
|
-
A note on the utils script (~260KB): if you're lazy loading the IntlTelInput chunk (and so less worried about filesize) then you can just import IntlTelInput from `"intl-tel-input/angularWithUtils"`, to include the utils script. Alternatively, if you use the main `"intl-tel-input/angular"` import, then you should couple this with the `loadUtils` initialisation option - you will need to host the [utils.js](https://github.com/jackocnr/intl-tel-input/blob/master/build/js/utils.js) file, and then set the `loadUtils` option to that URL, or alternatively just point it to a CDN hosted version e.g. `"https://cdn.jsdelivr.net/npm/intl-tel-input@25.11.
|
|
32
|
+
A note on the utils script (~260KB): if you're lazy loading the IntlTelInput chunk (and so less worried about filesize) then you can just import IntlTelInput from `"intl-tel-input/angularWithUtils"`, to include the utils script. Alternatively, if you use the main `"intl-tel-input/angular"` import, then you should couple this with the `loadUtils` initialisation option - you will need to host the [utils.js](https://github.com/jackocnr/intl-tel-input/blob/master/build/js/utils.js) file, and then set the `loadUtils` option to that URL, or alternatively just point it to a CDN hosted version e.g. `"https://cdn.jsdelivr.net/npm/intl-tel-input@25.11.3/build/js/utils.js"`.
|
|
33
33
|
|
|
34
34
|
## Props
|
|
35
35
|
Here's a list of all of the current props you can pass to the IntlTelInput Angular component.
|
|
@@ -2043,7 +2043,8 @@ var US = {
|
|
|
2043
2043
|
};
|
|
2044
2044
|
var PLACEHOLDER_MODES = {
|
|
2045
2045
|
AGGRESSIVE: "aggressive",
|
|
2046
|
-
POLITE: "polite"
|
|
2046
|
+
POLITE: "polite",
|
|
2047
|
+
OFF: "off"
|
|
2047
2048
|
};
|
|
2048
2049
|
var INITIAL_COUNTRY = {
|
|
2049
2050
|
AUTO: "auto"
|
|
@@ -3464,7 +3465,7 @@ var Iti = class _Iti {
|
|
|
3464
3465
|
//* Update the input placeholder to an example number from the currently selected country.
|
|
3465
3466
|
_updatePlaceholder() {
|
|
3466
3467
|
const { autoPlaceholder, placeholderNumberType, nationalMode, customPlaceholder } = this.options;
|
|
3467
|
-
const shouldSetPlaceholder = autoPlaceholder ===
|
|
3468
|
+
const shouldSetPlaceholder = autoPlaceholder === PLACEHOLDER_MODES.AGGRESSIVE || !this.ui.hadInitialPlaceholder && autoPlaceholder === PLACEHOLDER_MODES.POLITE;
|
|
3468
3469
|
if (intlTelInput.utils && shouldSetPlaceholder) {
|
|
3469
3470
|
const numberType = intlTelInput.utils.numberType[placeholderNumberType];
|
|
3470
3471
|
let placeholder = this.selectedCountryData.iso2 ? intlTelInput.utils.getExampleNumber(this.selectedCountryData.iso2, nationalMode, numberType) : "";
|
|
@@ -3798,7 +3799,7 @@ var intlTelInput = Object.assign((input, options) => {
|
|
|
3798
3799
|
attachUtils,
|
|
3799
3800
|
startedLoadingUtilsScript: false,
|
|
3800
3801
|
startedLoadingAutoCountry: false,
|
|
3801
|
-
version: "25.11.
|
|
3802
|
+
version: "25.11.3"
|
|
3802
3803
|
});
|
|
3803
3804
|
var intl_tel_input_default = intlTelInput;
|
|
3804
3805
|
|
|
@@ -2043,7 +2043,8 @@ var US = {
|
|
|
2043
2043
|
};
|
|
2044
2044
|
var PLACEHOLDER_MODES = {
|
|
2045
2045
|
AGGRESSIVE: "aggressive",
|
|
2046
|
-
POLITE: "polite"
|
|
2046
|
+
POLITE: "polite",
|
|
2047
|
+
OFF: "off"
|
|
2047
2048
|
};
|
|
2048
2049
|
var INITIAL_COUNTRY = {
|
|
2049
2050
|
AUTO: "auto"
|
|
@@ -3464,7 +3465,7 @@ var Iti = class _Iti {
|
|
|
3464
3465
|
//* Update the input placeholder to an example number from the currently selected country.
|
|
3465
3466
|
_updatePlaceholder() {
|
|
3466
3467
|
const { autoPlaceholder, placeholderNumberType, nationalMode, customPlaceholder } = this.options;
|
|
3467
|
-
const shouldSetPlaceholder = autoPlaceholder ===
|
|
3468
|
+
const shouldSetPlaceholder = autoPlaceholder === PLACEHOLDER_MODES.AGGRESSIVE || !this.ui.hadInitialPlaceholder && autoPlaceholder === PLACEHOLDER_MODES.POLITE;
|
|
3468
3469
|
if (intlTelInput.utils && shouldSetPlaceholder) {
|
|
3469
3470
|
const numberType = intlTelInput.utils.numberType[placeholderNumberType];
|
|
3470
3471
|
let placeholder = this.selectedCountryData.iso2 ? intlTelInput.utils.getExampleNumber(this.selectedCountryData.iso2, nationalMode, numberType) : "";
|
|
@@ -3798,7 +3799,7 @@ var intlTelInput = Object.assign((input, options) => {
|
|
|
3798
3799
|
attachUtils,
|
|
3799
3800
|
startedLoadingUtilsScript: false,
|
|
3800
3801
|
startedLoadingAutoCountry: false,
|
|
3801
|
-
version: "25.11.
|
|
3802
|
+
version: "25.11.3"
|
|
3802
3803
|
});
|
|
3803
3804
|
var intl_tel_input_default = intlTelInput;
|
|
3804
3805
|
|
|
@@ -5573,7 +5574,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
5573
5574
|
,
|
|
5574
5575
|
,
|
|
5575
5576
|
[9]
|
|
5576
|
-
], [, , "7(?:060\\d|19(?:[0-
|
|
5577
|
+
], [, , "7(?:060\\d|19(?:[0-5]\\d|6[0-6]))\\d{4}|(?:60[1-8]|7(?:0[2-5]|[2379]\\d))\\d{6}", , , , "601123456", , , [9]], [, , "800\\d{6}", , , , "800123456", , , [9]], [, , "9(?:0[05689]|76)\\d{6}", , , , "900123456", , , [9]], [, , "8[134]\\d{7}", , , , "811234567", , , [9]], [, , "70[01]\\d{6}", , , , "700123456", , , [9]], [, , "9[17]0\\d{6}", , , , "910123456", , , [9]], "CZ", 420, "00", , , , , , , , [[, "(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-8]|9[015-7]"]], [, "(\\d{2})(\\d{3})(\\d{3})(\\d{2})", "$1 $2 $3 $4", ["96"]], [
|
|
5577
5578
|
,
|
|
5578
5579
|
"(\\d{2})(\\d{3})(\\d{3})(\\d{3})",
|
|
5579
5580
|
"$1 $2 $3 $4",
|
|
@@ -5906,7 +5907,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
5906
5907
|
,
|
|
5907
5908
|
[, , "[5-9]\\d{8}", , , , , , , [9]],
|
|
5908
5909
|
[, , "96906(?:0[0-8]|1[1-9]|[2-9]\\d)\\d\\d|9(?:69(?:0[0-57-9]|[1-9]\\d)|73(?:[0-8]\\d|9[1-9]))\\d{4}|(?:8(?:[1356]\\d|[28][0-8]|[47][1-9])|9(?:[135]\\d|[268][0-8]|4[1-9]|7[124-9]))\\d{6}", , , , "810123456"],
|
|
5909
|
-
[, , "(?:
|
|
5910
|
+
[, , "96906(?:09|10)\\d\\d|(?:590(?:10[0-2]|600)|97390\\d)\\d{3}|(?:6\\d|7[1-48])\\d{7}", , , , "612345678"],
|
|
5910
5911
|
[, , "[89]00\\d{6}", , , , "800123456"],
|
|
5911
5912
|
[, , "80[367]\\d{6}", , , , "803123456"],
|
|
5912
5913
|
[, , "90[12]\\d{6}", , , , "901123456"],
|
|
@@ -6139,7 +6140,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
6139
6140
|
GE: [, [, , "(?:[3-57]\\d\\d|800)\\d{6}", , , , , , , [9], [6, 7]], [, , "(?:3(?:[256]\\d|4[124-9]|7[0-4])|4(?:1\\d|2[2-7]|3[1-79]|4[2-8]|7[239]|9[1-7]))\\d{6}", , , , "322123456", , , , [6, 7]], [
|
|
6140
6141
|
,
|
|
6141
6142
|
,
|
|
6142
|
-
"5(?:(?:(?:0555|1(?:[17]77|555))[5-9]|757(?:7[7-9]|8[01]))\\d|22252[0-4])\\d\\d|5(?:0(?:0[17]0|505)|1(?:0[01]0|1(?:07|33|51))|2(?:0[02]0|2[25]2)|3(?:0[03]0|3[35]3)|(?:40[04]|900)0|5222)[0-4]\\d{3}|(?:5(?:0(?:0(?:0\\d|
|
|
6143
|
+
"5(?:(?:(?:0555|1(?:[17]77|555))[5-9]|757(?:7[7-9]|8[01]))\\d|22252[0-4])\\d\\d|5(?:0(?:0[17]0|505)|1(?:0[01]0|1(?:07|33|51))|2(?:0[02]0|2[25]2)|3(?:0[03]0|3[35]3)|(?:40[04]|900)0|5222)[0-4]\\d{3}|(?:5(?:0(?:0(?:0\\d|1[12]|22|3[0-6]|44|5[05]|77|88|9[09])|(?:[14]\\d|77)\\d|22[02])|1(?:1(?:[03][01]|[124]\\d|5[2-6]|7[0-4])|4\\d\\d)|[23]555|4(?:4\\d\\d|555)|5(?:[0157-9]\\d\\d|200|333|444)|6[89]\\d\\d|7(?:(?:[0147-9]\\d|22)\\d|5(?:00|[57]5))|8(?:0(?:[018]\\d|2[0-4])|5(?:55|8[89])|8(?:55|88))|9(?:090|[1-35-9]\\d\\d))|790\\d\\d)\\d{4}",
|
|
6143
6144
|
,
|
|
6144
6145
|
,
|
|
6145
6146
|
,
|
|
@@ -6383,7 +6384,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
6383
6384
|
,
|
|
6384
6385
|
,
|
|
6385
6386
|
[8]
|
|
6386
|
-
], [, , "(?:4(?:44[0-35-9]|6(?:4[0-57-9]|6[0-
|
|
6387
|
+
], [, , "(?:4(?:44[0-35-9]|6(?:4[0-57-9]|6[0-6])|7(?:3[0-4]|4[0-48]|6[0-5]))|5(?:35[4-8]|73[0-6]|95[0-8])|6(?:26[013-8]|(?:66|78)[0-5])|70(?:7[1-8]|8[0-8])|84(?:4[0-2]|8[0-35-9])|9(?:29[013-9]|39[014-9]|59[0-467]|899))\\d{4}|(?:4(?:4[0-35-9]|6[0-357-9]|7[0-25])|5(?:[1-59][0-46-9]|6[0-4689]|7[0-246-9])|6(?:0[1-9]|[13-59]\\d|[268][0-57-9]|7[0-79])|70[1-59]|84[0-39]|9(?:0[1-9]|1[02-9]|[2358][0-8]|[467]\\d))\\d{5}", , , , "51234567", , , [8]], [, , "800\\d{6}", , , , "800123456", , , [9]], [
|
|
6387
6388
|
,
|
|
6388
6389
|
,
|
|
6389
6390
|
"900(?:[0-24-9]\\d{7}|3\\d{1,4})",
|
|
@@ -6820,7 +6821,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
6820
6821
|
,
|
|
6821
6822
|
[-1]
|
|
6822
6823
|
]],
|
|
6823
|
-
JO: [, [, , "(?:(?:[2689]|7\\d)\\d|32|53)\\d{6}", , , , , , , [8, 9]], [
|
|
6824
|
+
JO: [, [, , "(?:(?:[2689]|7\\d)\\d|32|427|53)\\d{6}", , , , , , , [8, 9]], [
|
|
6824
6825
|
,
|
|
6825
6826
|
,
|
|
6826
6827
|
"87(?:000|90[01])\\d{3}|(?:2(?:6(?:2[0-35-9]|3[0-578]|4[24-7]|5[0-24-8]|[6-8][023]|9[0-3])|7(?:0[1-79]|10|2[014-7]|3[0-689]|4[019]|5[0-3578]))|32(?:0[1-69]|1[1-35-7]|2[024-7]|3\\d|4[0-3]|[5-7][023])|53(?:0[0-3]|[13][023]|2[0-59]|49|5[0-35-9]|6[15]|7[45]|8[1-6]|9[0-36-9])|6(?:2(?:[05]0|22)|3(?:00|33)|4(?:0[0-25]|1[2-7]|2[0569]|[38][07-9]|4[025689]|6[0-589]|7\\d|9[0-2])|5(?:[01][056]|2[034]|3[0-57-9]|4[178]|5[0-69]|6[0-35-9]|7[1-379]|8[0-68]|9[0239]))|87(?:20|7[078]|99))\\d{4}",
|
|
@@ -6831,7 +6832,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
6831
6832
|
,
|
|
6832
6833
|
,
|
|
6833
6834
|
[8]
|
|
6834
|
-
], [, , "7(?:[78][0-25-9]|9\\d)\\d{6}", , , , "790123456", , , [9]], [, , "80\\d{6}", , , , "80012345", , , [8]], [, , "9\\d{7}", , , , "90012345", , , [8]], [, , "85\\d{6}", , , , "85012345", , , [8]], [, , "70\\d{7}", , , , "700123456", , , [9]], [, , , , , , , , , [-1]], "JO", 962, "00", "0", , , "0", , , , [[, "(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[2356]|87"], "(0$1)"], [, "(\\d{3})(\\d{5,6})", "$1 $2", ["[89]"], "0$1"], [, "(\\d{2})(\\d{7})", "$1 $2", ["70"], "0$1"], [, "(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["
|
|
6835
|
+
], [, , "(?:427|7(?:[78][0-25-9]|9\\d))\\d{6}", , , , "790123456", , , [9]], [, , "80\\d{6}", , , , "80012345", , , [8]], [, , "9\\d{7}", , , , "90012345", , , [8]], [, , "85\\d{6}", , , , "85012345", , , [8]], [, , "70\\d{7}", , , , "700123456", , , [9]], [, , , , , , , , , [-1]], "JO", 962, "00", "0", , , "0", , , , [[, "(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[2356]|87"], "(0$1)"], [, "(\\d{3})(\\d{5,6})", "$1 $2", ["[89]"], "0$1"], [, "(\\d{2})(\\d{7})", "$1 $2", ["70"], "0$1"], [, "(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["[47]"], "0$1"]], , [
|
|
6835
6836
|
,
|
|
6836
6837
|
,
|
|
6837
6838
|
"74(?:66|77)\\d{5}",
|
|
@@ -7161,7 +7162,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
7161
7162
|
,
|
|
7162
7163
|
"5002345678"
|
|
7163
7164
|
], [, , , , , , , , , [-1]], "LC", 1, "011", "1", , , "([2-8]\\d{6})$|1", "758$1", , , , , [, , , , , , , , , [-1]], , "758", [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]]],
|
|
7164
|
-
LI: [, [, , "[68]\\d{8}|(?:[2378]\\d|90)\\d{5}", , , , , , , [7, 9]], [, , "(?:2(?:01|1[27]|2[024]|3\\d|6[02-578]|96)|3(?:[24]0|33|7[0135-7]|8[048]|9[0269]))\\d{4}", , , , "2345678", , , [7]], [, , "(?:6(?:(?:4[5-9]|5\\d)\\d|6(?:[024-
|
|
7165
|
+
LI: [, [, , "[68]\\d{8}|(?:[2378]\\d|90)\\d{5}", , , , , , , [7, 9]], [, , "(?:2(?:01|1[27]|2[024]|3\\d|6[02-578]|96)|3(?:[24]0|33|7[0135-7]|8[048]|9[0269]))\\d{4}", , , , "2345678", , , [7]], [, , "(?:6(?:(?:4[5-9]|5\\d)\\d|6(?:[024-68]\\d|1[01]|3[7-9]|70))\\d|7(?:[37-9]\\d|42|56))\\d{4}", , , , "660234567"], [, , "8002[28]\\d\\d|80(?:05\\d|9)\\d{4}", , , , "8002222"], [
|
|
7165
7166
|
,
|
|
7166
7167
|
,
|
|
7167
7168
|
"90(?:02[258]|1(?:23|3[14])|66[136])\\d\\d",
|
|
@@ -9006,7 +9007,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9006
9007
|
], [
|
|
9007
9008
|
,
|
|
9008
9009
|
,
|
|
9009
|
-
"3052(?:0[0-8]|[1-9]\\d)\\d{4}|(?:2742|305[3-9])\\d{6}|(?:472|983)[2-47-9]\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-47-9]|1[02-9]|2[
|
|
9010
|
+
"3052(?:0[0-8]|[1-9]\\d)\\d{4}|(?:2742|305[3-9])\\d{6}|(?:472|983)[2-47-9]\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-47-9]|1[02-9]|2[013-79]|3[0-24679]|4[167]|5[0-2]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-269])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-247]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}",
|
|
9010
9011
|
,
|
|
9011
9012
|
,
|
|
9012
9013
|
,
|
|
@@ -9018,7 +9019,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9018
9019
|
], [
|
|
9019
9020
|
,
|
|
9020
9021
|
,
|
|
9021
|
-
"3052(?:0[0-8]|[1-9]\\d)\\d{4}|(?:2742|305[3-9])\\d{6}|(?:472|983)[2-47-9]\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-47-9]|1[02-9]|2[
|
|
9022
|
+
"3052(?:0[0-8]|[1-9]\\d)\\d{4}|(?:2742|305[3-9])\\d{6}|(?:472|983)[2-47-9]\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-47-9]|1[02-9]|2[013-79]|3[0-24679]|4[167]|5[0-2]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-269])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-247]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}",
|
|
9022
9023
|
,
|
|
9023
9024
|
,
|
|
9024
9025
|
,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Country, Iso2 } from "../../intl-tel-input/data";
|
|
2
2
|
import type { I18n } from "../../intl-tel-input/i18n/types";
|
|
3
3
|
import type { Iti } from "../../intl-tel-input";
|
|
4
|
+
import type { PLACEHOLDER_MODES } from "../constants";
|
|
4
5
|
export type UtilsLoader = () => Promise<{
|
|
5
6
|
default: ItiUtils;
|
|
6
7
|
}>;
|
|
@@ -23,14 +24,15 @@ export type ItiUtils = {
|
|
|
23
24
|
numberType: Record<string, number>;
|
|
24
25
|
};
|
|
25
26
|
export type NumberType = "FIXED_LINE_OR_MOBILE" | "FIXED_LINE" | "MOBILE" | "PAGER" | "PERSONAL_NUMBER" | "PREMIUM_RATE" | "SHARED_COST" | "TOLL_FREE" | "UAN" | "UNKNOWN" | "VOICEMAIL" | "VOIP";
|
|
27
|
+
type ValueOf<T> = T[keyof T];
|
|
26
28
|
export interface AllOptions {
|
|
27
29
|
allowDropdown: boolean;
|
|
28
30
|
allowPhonewords: boolean;
|
|
29
|
-
autoPlaceholder:
|
|
31
|
+
autoPlaceholder: ValueOf<typeof PLACEHOLDER_MODES>;
|
|
30
32
|
containerClass: string;
|
|
31
33
|
countryOrder: Iso2[] | null;
|
|
32
34
|
countrySearch: boolean;
|
|
33
|
-
customPlaceholder: ((selectedCountryPlaceholder: string, selectedCountryData:
|
|
35
|
+
customPlaceholder: ((selectedCountryPlaceholder: string, selectedCountryData: SelectedCountryData) => string) | null;
|
|
34
36
|
dropdownContainer: HTMLElement | null;
|
|
35
37
|
excludeCountries: Iso2[];
|
|
36
38
|
fixDropdownWidth: boolean;
|
package/build/js/data.js
CHANGED
package/build/js/data.min.js
CHANGED
|
@@ -116,6 +116,7 @@ declare module "modules/constants" {
|
|
|
116
116
|
export const PLACEHOLDER_MODES: {
|
|
117
117
|
readonly AGGRESSIVE: "aggressive";
|
|
118
118
|
readonly POLITE: "polite";
|
|
119
|
+
readonly OFF: "off";
|
|
119
120
|
};
|
|
120
121
|
export const INITIAL_COUNTRY: {
|
|
121
122
|
readonly AUTO: "auto";
|
|
@@ -140,6 +141,7 @@ declare module "modules/types/public-api" {
|
|
|
140
141
|
import type { Country, Iso2 } from "intl-tel-input/data";
|
|
141
142
|
import type { I18n } from "intl-tel-input/i18n/types";
|
|
142
143
|
import type { Iti } from "intl-tel-input";
|
|
144
|
+
import type { PLACEHOLDER_MODES } from "modules/constants";
|
|
143
145
|
export type UtilsLoader = () => Promise<{
|
|
144
146
|
default: ItiUtils;
|
|
145
147
|
}>;
|
|
@@ -162,14 +164,15 @@ declare module "modules/types/public-api" {
|
|
|
162
164
|
numberType: Record<string, number>;
|
|
163
165
|
};
|
|
164
166
|
export type NumberType = "FIXED_LINE_OR_MOBILE" | "FIXED_LINE" | "MOBILE" | "PAGER" | "PERSONAL_NUMBER" | "PREMIUM_RATE" | "SHARED_COST" | "TOLL_FREE" | "UAN" | "UNKNOWN" | "VOICEMAIL" | "VOIP";
|
|
167
|
+
type ValueOf<T> = T[keyof T];
|
|
165
168
|
export interface AllOptions {
|
|
166
169
|
allowDropdown: boolean;
|
|
167
170
|
allowPhonewords: boolean;
|
|
168
|
-
autoPlaceholder:
|
|
171
|
+
autoPlaceholder: ValueOf<typeof PLACEHOLDER_MODES>;
|
|
169
172
|
containerClass: string;
|
|
170
173
|
countryOrder: Iso2[] | null;
|
|
171
174
|
countrySearch: boolean;
|
|
172
|
-
customPlaceholder: ((selectedCountryPlaceholder: string, selectedCountryData:
|
|
175
|
+
customPlaceholder: ((selectedCountryPlaceholder: string, selectedCountryData: SelectedCountryData) => string) | null;
|
|
173
176
|
dropdownContainer: HTMLElement | null;
|
|
174
177
|
excludeCountries: Iso2[];
|
|
175
178
|
fixDropdownWidth: boolean;
|
package/build/js/intlTelInput.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* International Telephone Input v25.11.
|
|
2
|
+
* International Telephone Input v25.11.3
|
|
3
3
|
* https://github.com/jackocnr/intl-tel-input.git
|
|
4
4
|
* Licensed under the MIT license
|
|
5
5
|
*/
|
|
@@ -2084,7 +2084,8 @@ var factoryOutput = (() => {
|
|
|
2084
2084
|
};
|
|
2085
2085
|
var PLACEHOLDER_MODES = {
|
|
2086
2086
|
AGGRESSIVE: "aggressive",
|
|
2087
|
-
POLITE: "polite"
|
|
2087
|
+
POLITE: "polite",
|
|
2088
|
+
OFF: "off"
|
|
2088
2089
|
};
|
|
2089
2090
|
var INITIAL_COUNTRY = {
|
|
2090
2091
|
AUTO: "auto"
|
|
@@ -3667,7 +3668,7 @@ var factoryOutput = (() => {
|
|
|
3667
3668
|
nationalMode,
|
|
3668
3669
|
customPlaceholder
|
|
3669
3670
|
} = this.options;
|
|
3670
|
-
const shouldSetPlaceholder = autoPlaceholder ===
|
|
3671
|
+
const shouldSetPlaceholder = autoPlaceholder === PLACEHOLDER_MODES.AGGRESSIVE || !this.ui.hadInitialPlaceholder && autoPlaceholder === PLACEHOLDER_MODES.POLITE;
|
|
3671
3672
|
if (intlTelInput.utils && shouldSetPlaceholder) {
|
|
3672
3673
|
const numberType = intlTelInput.utils.numberType[placeholderNumberType];
|
|
3673
3674
|
let placeholder = this.selectedCountryData.iso2 ? intlTelInput.utils.getExampleNumber(
|
|
@@ -4036,7 +4037,7 @@ var factoryOutput = (() => {
|
|
|
4036
4037
|
attachUtils,
|
|
4037
4038
|
startedLoadingUtilsScript: false,
|
|
4038
4039
|
startedLoadingAutoCountry: false,
|
|
4039
|
-
version: "25.11.
|
|
4040
|
+
version: "25.11.3"
|
|
4040
4041
|
}
|
|
4041
4042
|
);
|
|
4042
4043
|
var intl_tel_input_default = intlTelInput;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* International Telephone Input v25.11.
|
|
2
|
+
* International Telephone Input v25.11.3
|
|
3
3
|
* https://github.com/jackocnr/intl-tel-input.git
|
|
4
4
|
* Licensed under the MIT license
|
|
5
5
|
*/
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
}
|
|
14
14
|
}(() => {
|
|
15
15
|
|
|
16
|
-
var factoryOutput=(()=>{var k=Object.defineProperty;var ht=Object.getOwnPropertyDescriptor;var pt=Object.getOwnPropertyNames;var Ct=Object.prototype.hasOwnProperty;var mt=(r,t)=>{for(var e in t)k(r,e,{get:t[e],enumerable:!0})},yt=(r,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of pt(t))!Ct.call(r,n)&&n!==e&&k(r,n,{get:()=>t[n],enumerable:!(i=ht(t,n))||i.enumerable});return r};var ft=r=>yt(k({},"__esModule",{value:!0}),r);var At={};mt(At,{Iti:()=>H,default:()=>Dt});var gt=[["af","93",0,null,"0"],["ax","358",1,["18","4"],"0"],["al","355",0,null,"0"],["dz","213",0,null,"0"],["as","1",5,["684"],"1"],["ad","376"],["ao","244"],["ai","1",6,["264"],"1"],["ag","1",7,["268"],"1"],["ar","54",0,null,"0"],["am","374",0,null,"0"],["aw","297"],["ac","247"],["au","61",0,["4"],"0"],["at","43",0,null,"0"],["az","994",0,null,"0"],["bs","1",8,["242"],"1"],["bh","973"],["bd","880",0,null,"0"],["bb","1",9,["246"],"1"],["by","375",0,null,"8"],["be","32",0,null,"0"],["bz","501"],["bj","229"],["bm","1",10,["441"],"1"],["bt","975"],["bo","591",0,null,"0"],["ba","387",0,null,"0"],["bw","267"],["br","55",0,null,"0"],["io","246"],["vg","1",11,["284"],"1"],["bn","673"],["bg","359",0,null,"0"],["bf","226"],["bi","257"],["kh","855",0,null,"0"],["cm","237"],["ca","1",1,["204","226","236","249","250","257","263","289","306","343","354","365","367","368","382","403","416","418","428","431","437","438","450","468","474","506","514","519","548","579","581","584","587","604","613","639","647","672","683","705","709","742","753","778","780","782","807","819","825","867","873","879","902","905","942"],"1"],["cv","238"],["bq","599",1,["3","4","7"]],["ky","1",12,["345"],"1"],["cf","236"],["td","235"],["cl","56"],["cn","86",0,null,"0"],["cx","61",2,["4","89164"],"0"],["cc","61",1,["4","89162"],"0"],["co","57",0,null,"0"],["km","269"],["cg","242"],["cd","243",0,null,"0"],["ck","682"],["cr","506"],["ci","225"],["hr","385",0,null,"0"],["cu","53",0,null,"0"],["cw","599",0],["cy","357"],["cz","420"],["dk","45"],["dj","253"],["dm","1",13,["767"],"1"],["do","1",2,["809","829","849"],"1"],["ec","593",0,null,"0"],["eg","20",0,null,"0"],["sv","503"],["gq","240"],["er","291",0,null,"0"],["ee","372"],["sz","268"],["et","251",0,null,"0"],["fk","500"],["fo","298"],["fj","679"],["fi","358",0,["4"],"0"],["fr","33",0,null,"0"],["gf","594",0,null,"0"],["pf","689"],["ga","241"],["gm","220"],["ge","995",0,null,"0"],["de","49",0,null,"0"],["gh","233",0,null,"0"],["gi","350"],["gr","30"],["gl","299"],["gd","1",14,["473"],"1"],["gp","590",0,null,"0"],["gu","1",15,["671"],"1"],["gt","502"],["gg","44",1,["1481","7781","7839","7911"],"0"],["gn","224"],["gw","245"],["gy","592"],["ht","509"],["hn","504"],["hk","852"],["hu","36",0,null,"06"],["is","354"],["in","91",0,null,"0"],["id","62",0,null,"0"],["ir","98",0,null,"0"],["iq","964",0,null,"0"],["ie","353",0,null,"0"],["im","44",2,["1624","74576","7524","7624","7924"],"0"],["il","972",0,null,"0"],["it","39",0,["3"]],["jm","1",4,["658","876"],"1"],["jp","81",0,null,"0"],["je","44",3,["1534","7509","7700","7797","7829","7937"],"0"],["jo","962",0,null,"0"],["kz","7",1,["33","7"],"8"],["ke","254",0,null,"0"],["ki","686",0,null,"0"],["xk","383",0,null,"0"],["kw","965"],["kg","996",0,null,"0"],["la","856",0,null,"0"],["lv","371"],["lb","961",0,null,"0"],["ls","266"],["lr","231",0,null,"0"],["ly","218",0,null,"0"],["li","423",0,null,"0"],["lt","370",0,null,"0"],["lu","352"],["mo","853"],["mg","261",0,null,"0"],["mw","265",0,null,"0"],["my","60",0,null,"0"],["mv","960"],["ml","223"],["mt","356"],["mh","692",0,null,"1"],["mq","596",0,null,"0"],["mr","222"],["mu","230"],["yt","262",1,["269","639"],"0"],["mx","52"],["fm","691"],["md","373",0,null,"0"],["mc","377",0,null,"0"],["mn","976",0,null,"0"],["me","382",0,null,"0"],["ms","1",16,["664"],"1"],["ma","212",0,["6","7"],"0"],["mz","258"],["mm","95",0,null,"0"],["na","264",0,null,"0"],["nr","674"],["np","977",0,null,"0"],["nl","31",0,null,"0"],["nc","687"],["nz","64",0,null,"0"],["ni","505"],["ne","227"],["ng","234",0,null,"0"],["nu","683"],["nf","672"],["kp","850",0,null,"0"],["mk","389",0,null,"0"],["mp","1",17,["670"],"1"],["no","47",0,["4","9"]],["om","968"],["pk","92",0,null,"0"],["pw","680"],["ps","970",0,null,"0"],["pa","507"],["pg","675"],["py","595",0,null,"0"],["pe","51",0,null,"0"],["ph","63",0,null,"0"],["pl","48"],["pt","351"],["pr","1",3,["787","939"],"1"],["qa","974"],["re","262",0,null,"0"],["ro","40",0,null,"0"],["ru","7",0,["33"],"8"],["rw","250",0,null,"0"],["ws","685"],["sm","378"],["st","239"],["sa","966",0,null,"0"],["sn","221"],["rs","381",0,null,"0"],["sc","248"],["sl","232",0,null,"0"],["sg","65"],["sx","1",21,["721"],"1"],["sk","421",0,null,"0"],["si","386",0,null,"0"],["sb","677"],["so","252",0,null,"0"],["za","27",0,null,"0"],["kr","82",0,null,"0"],["ss","211",0,null,"0"],["es","34"],["lk","94",0,null,"0"],["bl","590",1,null,"0"],["sh","290"],["kn","1",18,["869"],"1"],["lc","1",19,["758"],"1"],["mf","590",2,null,"0"],["pm","508",0,null,"0"],["vc","1",20,["784"],"1"],["sd","249",0,null,"0"],["sr","597"],["sj","47",1,["4","79","9"]],["se","46",0,null,"0"],["ch","41",0,null,"0"],["sy","963",0,null,"0"],["tw","886",0,null,"0"],["tj","992"],["tz","255",0,null,"0"],["th","66",0,null,"0"],["tl","670"],["tg","228"],["tk","690"],["to","676"],["tt","1",22,["868"],"1"],["tn","216"],["tr","90",0,null,"0"],["tm","993",0,null,"8"],["tc","1",23,["649"],"1"],["tv","688"],["vi","1",24,["340"],"1"],["ug","256",0,null,"0"],["ua","380",0,null,"0"],["ae","971",0,null,"0"],["gb","44",0,null,"0"],["us","1",0,null,"1"],["uy","598",0,null,"0"],["uz","998"],["vu","678"],["va","39",1,["06698","3"]],["ve","58",0,null,"0"],["vn","84",0,null,"0"],["wf","681"],["eh","212",1,["5288","5289","6","7"],"0"],["ye","967",0,null,"0"],["zm","260",0,null,"0"],["zw","263",0,null,"0"]],V=[];for(let r of gt)V.push({name:"",iso2:r[0],dialCode:r[1],priority:r[2]||0,areaCodes:r[3]||null,nodeById:{},nationalPrefix:r[4]||null,normalisedName:"",initials:"",dialCodePlus:""});var L=V;var It={ad:"Andorra",ae:"United Arab Emirates",af:"Afghanistan",ag:"Antigua & Barbuda",ai:"Anguilla",al:"Albania",am:"Armenia",ao:"Angola",ar:"Argentina",as:"American Samoa",at:"Austria",au:"Australia",aw:"Aruba",ax:"\xC5land Islands",az:"Azerbaijan",ba:"Bosnia & Herzegovina",bb:"Barbados",bd:"Bangladesh",be:"Belgium",bf:"Burkina Faso",bg:"Bulgaria",bh:"Bahrain",bi:"Burundi",bj:"Benin",bl:"St. Barth\xE9lemy",bm:"Bermuda",bn:"Brunei",bo:"Bolivia",bq:"Caribbean Netherlands",br:"Brazil",bs:"Bahamas",bt:"Bhutan",bw:"Botswana",by:"Belarus",bz:"Belize",ca:"Canada",cc:"Cocos (Keeling) Islands",cd:"Congo - Kinshasa",cf:"Central African Republic",cg:"Congo - Brazzaville",ch:"Switzerland",ci:"C\xF4te d\u2019Ivoire",ck:"Cook Islands",cl:"Chile",cm:"Cameroon",cn:"China",co:"Colombia",cr:"Costa Rica",cu:"Cuba",cv:"Cape Verde",cw:"Cura\xE7ao",cx:"Christmas Island",cy:"Cyprus",cz:"Czechia",de:"Germany",dj:"Djibouti",dk:"Denmark",dm:"Dominica",do:"Dominican Republic",dz:"Algeria",ec:"Ecuador",ee:"Estonia",eg:"Egypt",eh:"Western Sahara",er:"Eritrea",es:"Spain",et:"Ethiopia",fi:"Finland",fj:"Fiji",fk:"Falkland Islands",fm:"Micronesia",fo:"Faroe Islands",fr:"France",ga:"Gabon",gb:"United Kingdom",gd:"Grenada",ge:"Georgia",gf:"French Guiana",gg:"Guernsey",gh:"Ghana",gi:"Gibraltar",gl:"Greenland",gm:"Gambia",gn:"Guinea",gp:"Guadeloupe",gq:"Equatorial Guinea",gr:"Greece",gt:"Guatemala",gu:"Guam",gw:"Guinea-Bissau",gy:"Guyana",hk:"Hong Kong SAR China",hn:"Honduras",hr:"Croatia",ht:"Haiti",hu:"Hungary",id:"Indonesia",ie:"Ireland",il:"Israel",im:"Isle of Man",in:"India",io:"British Indian Ocean Territory",iq:"Iraq",ir:"Iran",is:"Iceland",it:"Italy",je:"Jersey",jm:"Jamaica",jo:"Jordan",jp:"Japan",ke:"Kenya",kg:"Kyrgyzstan",kh:"Cambodia",ki:"Kiribati",km:"Comoros",kn:"St. Kitts & Nevis",kp:"North Korea",kr:"South Korea",kw:"Kuwait",ky:"Cayman Islands",kz:"Kazakhstan",la:"Laos",lb:"Lebanon",lc:"St. Lucia",li:"Liechtenstein",lk:"Sri Lanka",lr:"Liberia",ls:"Lesotho",lt:"Lithuania",lu:"Luxembourg",lv:"Latvia",ly:"Libya",ma:"Morocco",mc:"Monaco",md:"Moldova",me:"Montenegro",mf:"St. Martin",mg:"Madagascar",mh:"Marshall Islands",mk:"North Macedonia",ml:"Mali",mm:"Myanmar (Burma)",mn:"Mongolia",mo:"Macao SAR China",mp:"Northern Mariana Islands",mq:"Martinique",mr:"Mauritania",ms:"Montserrat",mt:"Malta",mu:"Mauritius",mv:"Maldives",mw:"Malawi",mx:"Mexico",my:"Malaysia",mz:"Mozambique",na:"Namibia",nc:"New Caledonia",ne:"Niger",nf:"Norfolk Island",ng:"Nigeria",ni:"Nicaragua",nl:"Netherlands",no:"Norway",np:"Nepal",nr:"Nauru",nu:"Niue",nz:"New Zealand",om:"Oman",pa:"Panama",pe:"Peru",pf:"French Polynesia",pg:"Papua New Guinea",ph:"Philippines",pk:"Pakistan",pl:"Poland",pm:"St. Pierre & Miquelon",pr:"Puerto Rico",ps:"Palestinian Territories",pt:"Portugal",pw:"Palau",py:"Paraguay",qa:"Qatar",re:"R\xE9union",ro:"Romania",rs:"Serbia",ru:"Russia",rw:"Rwanda",sa:"Saudi Arabia",sb:"Solomon Islands",sc:"Seychelles",sd:"Sudan",se:"Sweden",sg:"Singapore",sh:"St. Helena",si:"Slovenia",sj:"Svalbard & Jan Mayen",sk:"Slovakia",sl:"Sierra Leone",sm:"San Marino",sn:"Senegal",so:"Somalia",sr:"Suriname",ss:"South Sudan",st:"S\xE3o Tom\xE9 & Pr\xEDncipe",sv:"El Salvador",sx:"Sint Maarten",sy:"Syria",sz:"Eswatini",tc:"Turks & Caicos Islands",td:"Chad",tg:"Togo",th:"Thailand",tj:"Tajikistan",tk:"Tokelau",tl:"Timor-Leste",tm:"Turkmenistan",tn:"Tunisia",to:"Tonga",tr:"Turkey",tt:"Trinidad & Tobago",tv:"Tuvalu",tw:"Taiwan",tz:"Tanzania",ua:"Ukraine",ug:"Uganda",us:"United States",uy:"Uruguay",uz:"Uzbekistan",va:"Vatican City",vc:"St. Vincent & Grenadines",ve:"Venezuela",vg:"British Virgin Islands",vi:"U.S. Virgin Islands",vn:"Vietnam",vu:"Vanuatu",wf:"Wallis & Futuna",ws:"Samoa",ye:"Yemen",yt:"Mayotte",za:"South Africa",zm:"Zambia",zw:"Zimbabwe"},j=It;var bt={selectedCountryAriaLabel:"Change country, selected ${countryName} (${dialCode})",noCountrySelected:"Select country",countryListAriaLabel:"List of countries",searchPlaceholder:"Search",clearSearchAriaLabel:"Clear search",zeroSearchResults:"No results found",oneSearchResult:"1 result found",multipleSearchResults:"${count} results found",ac:"Ascension Island",xk:"Kosovo"},Y=bt;var vt={...j,...Y},U=vt;var D={OPEN_COUNTRY_DROPDOWN:"open:countrydropdown",CLOSE_COUNTRY_DROPDOWN:"close:countrydropdown",COUNTRY_CHANGE:"countrychange",INPUT:"input"},h={HIDE:"iti__hide",V_HIDE:"iti__v-hide",ARROW_UP:"iti__arrow--up",GLOBE:"iti__globe",FLAG:"iti__flag",COUNTRY_ITEM:"iti__country",HIGHLIGHT:"iti__highlight"},y={ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",SPACE:" ",ENTER:"Enter",ESC:"Escape",TAB:"Tab"},B={PASTE:"insertFromPaste",DELETE_FWD:"deleteContentForward"},N={ALPHA_UNICODE:/\p{L}/u,NON_PLUS_NUMERIC:/[^+0-9]/,NON_PLUS_NUMERIC_GLOBAL:/[^+0-9]/g,HIDDEN_SEARCH_CHAR:/^[a-zA-ZÀ-ÿа-яА-Я ]$/},q={SEARCH_DEBOUNCE_MS:100,HIDDEN_SEARCH_RESET_MS:1e3,NEXT_TICK:0},W={UNKNOWN_NUMBER_TYPE:-99,UNKNOWN_VALIDATION_ERROR:-99},S={SANE_SELECTED_WITH_DIAL_WIDTH:78,SANE_SELECTED_NO_DIAL_WIDTH:42,INPUT_PADDING_EXTRA_LEFT:6},P={PLUS:"+",NANP:"1"},M={ISO2:"gb",DIAL_CODE:"44",MOBILE_PREFIX:"7",MOBILE_CORE_LENGTH:10},X={ISO2:"us",DIAL_CODE:"1"},J={AGGRESSIVE:"aggressive",POLITE:"polite"},O={AUTO:"auto"},F={COUNTRY_CODE:"countryCode",DIAL_CODE:"dialCode"},p={EXPANDED:"aria-expanded",LABEL:"aria-label",SELECTED:"aria-selected",ACTIVE_DESCENDANT:"aria-activedescendant",HASPOPUP:"aria-haspopup",CONTROLS:"aria-controls",HIDDEN:"aria-hidden",AUTOCOMPLETE:"aria-autocomplete",MODAL:"aria-modal"};var $=r=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(r).matches,_t=()=>{if(typeof navigator<"u"&&typeof window<"u"){let r=/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),t=$("(max-width: 500px)"),e=$("(max-height: 600px)"),i=$("(pointer: coarse)");return r||t||i&&e}return!1},G={allowPhonewords:!1,allowDropdown:!0,autoPlaceholder:J.POLITE,containerClass:"",countryOrder:null,countrySearch:!0,customPlaceholder:null,dropdownContainer:null,excludeCountries:[],fixDropdownWidth:!0,formatAsYouType:!0,formatOnDisplay:!0,geoIpLookup:null,hiddenInput:null,i18n:{},initialCountry:"",loadUtils:null,nationalMode:!0,onlyCountries:[],placeholderNumberType:"MOBILE",showFlags:!0,separateDialCode:!1,strictMode:!1,useFullscreenPopup:_t(),validationNumberTypes:["MOBILE"]},Q=(r,t)=>{r.useFullscreenPopup&&(r.fixDropdownWidth=!1),r.onlyCountries.length===1&&(r.initialCountry=r.onlyCountries[0]),r.separateDialCode&&(r.nationalMode=!1),r.allowDropdown&&!r.showFlags&&!r.separateDialCode&&(r.nationalMode=!1),r.useFullscreenPopup&&!r.dropdownContainer&&(r.dropdownContainer=document.body),r.i18n={...t,...r.i18n}};var w=r=>r.replace(/\D/g,""),x=(r="")=>r.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase();var Z=(r,t)=>{let e=x(t),i=[],n=[],s=[],o=[],a=[],u=[];for(let c of r)c.iso2===e?i.push(c):c.normalisedName.startsWith(e)?n.push(c):c.normalisedName.includes(e)?s.push(c):e===c.dialCode||e===c.dialCodePlus?o.push(c):c.dialCodePlus.includes(e)?a.push(c):c.initials.includes(e)&&u.push(c);let d=(c,m)=>c.priority-m.priority;return[...i.sort(d),...n.sort(d),...s.sort(d),...o.sort(d),...a.sort(d),...u.sort(d)]},tt=(r,t)=>{let e=t.toLowerCase();for(let i of r)if(i.name.toLowerCase().startsWith(e))return i;return null};var R=r=>Object.keys(r).filter(t=>!!r[t]).join(" "),C=(r,t,e)=>{let i=document.createElement(r);return t&&Object.entries(t).forEach(([n,s])=>i.setAttribute(n,s)),e&&e.appendChild(i),i};var et=()=>`
|
|
16
|
+
var factoryOutput=(()=>{var U=Object.defineProperty;var ht=Object.getOwnPropertyDescriptor;var pt=Object.getOwnPropertyNames;var Ct=Object.prototype.hasOwnProperty;var mt=(r,t)=>{for(var e in t)U(r,e,{get:t[e],enumerable:!0})},yt=(r,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of pt(t))!Ct.call(r,n)&&n!==e&&U(r,n,{get:()=>t[n],enumerable:!(i=ht(t,n))||i.enumerable});return r};var ft=r=>yt(U({},"__esModule",{value:!0}),r);var At={};mt(At,{Iti:()=>k,default:()=>wt});var gt=[["af","93",0,null,"0"],["ax","358",1,["18","4"],"0"],["al","355",0,null,"0"],["dz","213",0,null,"0"],["as","1",5,["684"],"1"],["ad","376"],["ao","244"],["ai","1",6,["264"],"1"],["ag","1",7,["268"],"1"],["ar","54",0,null,"0"],["am","374",0,null,"0"],["aw","297"],["ac","247"],["au","61",0,["4"],"0"],["at","43",0,null,"0"],["az","994",0,null,"0"],["bs","1",8,["242"],"1"],["bh","973"],["bd","880",0,null,"0"],["bb","1",9,["246"],"1"],["by","375",0,null,"8"],["be","32",0,null,"0"],["bz","501"],["bj","229"],["bm","1",10,["441"],"1"],["bt","975"],["bo","591",0,null,"0"],["ba","387",0,null,"0"],["bw","267"],["br","55",0,null,"0"],["io","246"],["vg","1",11,["284"],"1"],["bn","673"],["bg","359",0,null,"0"],["bf","226"],["bi","257"],["kh","855",0,null,"0"],["cm","237"],["ca","1",1,["204","226","236","249","250","257","263","289","306","343","354","365","367","368","382","403","416","418","428","431","437","438","450","468","474","506","514","519","548","579","581","584","587","604","613","639","647","672","683","705","709","742","753","778","780","782","807","819","825","867","873","879","902","905","942"],"1"],["cv","238"],["bq","599",1,["3","4","7"]],["ky","1",12,["345"],"1"],["cf","236"],["td","235"],["cl","56"],["cn","86",0,null,"0"],["cx","61",2,["4","89164"],"0"],["cc","61",1,["4","89162"],"0"],["co","57",0,null,"0"],["km","269"],["cg","242"],["cd","243",0,null,"0"],["ck","682"],["cr","506"],["ci","225"],["hr","385",0,null,"0"],["cu","53",0,null,"0"],["cw","599",0],["cy","357"],["cz","420"],["dk","45"],["dj","253"],["dm","1",13,["767"],"1"],["do","1",2,["809","829","849"],"1"],["ec","593",0,null,"0"],["eg","20",0,null,"0"],["sv","503"],["gq","240"],["er","291",0,null,"0"],["ee","372"],["sz","268"],["et","251",0,null,"0"],["fk","500"],["fo","298"],["fj","679"],["fi","358",0,["4"],"0"],["fr","33",0,null,"0"],["gf","594",0,null,"0"],["pf","689"],["ga","241"],["gm","220"],["ge","995",0,null,"0"],["de","49",0,null,"0"],["gh","233",0,null,"0"],["gi","350"],["gr","30"],["gl","299"],["gd","1",14,["473"],"1"],["gp","590",0,null,"0"],["gu","1",15,["671"],"1"],["gt","502"],["gg","44",1,["1481","7781","7839","7911"],"0"],["gn","224"],["gw","245"],["gy","592"],["ht","509"],["hn","504"],["hk","852"],["hu","36",0,null,"06"],["is","354"],["in","91",0,null,"0"],["id","62",0,null,"0"],["ir","98",0,null,"0"],["iq","964",0,null,"0"],["ie","353",0,null,"0"],["im","44",2,["1624","74576","7524","7624","7924"],"0"],["il","972",0,null,"0"],["it","39",0,["3"]],["jm","1",4,["658","876"],"1"],["jp","81",0,null,"0"],["je","44",3,["1534","7509","7700","7797","7829","7937"],"0"],["jo","962",0,null,"0"],["kz","7",1,["33","7"],"8"],["ke","254",0,null,"0"],["ki","686",0,null,"0"],["xk","383",0,null,"0"],["kw","965"],["kg","996",0,null,"0"],["la","856",0,null,"0"],["lv","371"],["lb","961",0,null,"0"],["ls","266"],["lr","231",0,null,"0"],["ly","218",0,null,"0"],["li","423",0,null,"0"],["lt","370",0,null,"0"],["lu","352"],["mo","853"],["mg","261",0,null,"0"],["mw","265",0,null,"0"],["my","60",0,null,"0"],["mv","960"],["ml","223"],["mt","356"],["mh","692",0,null,"1"],["mq","596",0,null,"0"],["mr","222"],["mu","230"],["yt","262",1,["269","639"],"0"],["mx","52"],["fm","691"],["md","373",0,null,"0"],["mc","377",0,null,"0"],["mn","976",0,null,"0"],["me","382",0,null,"0"],["ms","1",16,["664"],"1"],["ma","212",0,["6","7"],"0"],["mz","258"],["mm","95",0,null,"0"],["na","264",0,null,"0"],["nr","674"],["np","977",0,null,"0"],["nl","31",0,null,"0"],["nc","687"],["nz","64",0,null,"0"],["ni","505"],["ne","227"],["ng","234",0,null,"0"],["nu","683"],["nf","672"],["kp","850",0,null,"0"],["mk","389",0,null,"0"],["mp","1",17,["670"],"1"],["no","47",0,["4","9"]],["om","968"],["pk","92",0,null,"0"],["pw","680"],["ps","970",0,null,"0"],["pa","507"],["pg","675"],["py","595",0,null,"0"],["pe","51",0,null,"0"],["ph","63",0,null,"0"],["pl","48"],["pt","351"],["pr","1",3,["787","939"],"1"],["qa","974"],["re","262",0,null,"0"],["ro","40",0,null,"0"],["ru","7",0,["33"],"8"],["rw","250",0,null,"0"],["ws","685"],["sm","378"],["st","239"],["sa","966",0,null,"0"],["sn","221"],["rs","381",0,null,"0"],["sc","248"],["sl","232",0,null,"0"],["sg","65"],["sx","1",21,["721"],"1"],["sk","421",0,null,"0"],["si","386",0,null,"0"],["sb","677"],["so","252",0,null,"0"],["za","27",0,null,"0"],["kr","82",0,null,"0"],["ss","211",0,null,"0"],["es","34"],["lk","94",0,null,"0"],["bl","590",1,null,"0"],["sh","290"],["kn","1",18,["869"],"1"],["lc","1",19,["758"],"1"],["mf","590",2,null,"0"],["pm","508",0,null,"0"],["vc","1",20,["784"],"1"],["sd","249",0,null,"0"],["sr","597"],["sj","47",1,["4","79","9"]],["se","46",0,null,"0"],["ch","41",0,null,"0"],["sy","963",0,null,"0"],["tw","886",0,null,"0"],["tj","992"],["tz","255",0,null,"0"],["th","66",0,null,"0"],["tl","670"],["tg","228"],["tk","690"],["to","676"],["tt","1",22,["868"],"1"],["tn","216"],["tr","90",0,null,"0"],["tm","993",0,null,"8"],["tc","1",23,["649"],"1"],["tv","688"],["vi","1",24,["340"],"1"],["ug","256",0,null,"0"],["ua","380",0,null,"0"],["ae","971",0,null,"0"],["gb","44",0,null,"0"],["us","1",0,null,"1"],["uy","598",0,null,"0"],["uz","998"],["vu","678"],["va","39",1,["06698","3"]],["ve","58",0,null,"0"],["vn","84",0,null,"0"],["wf","681"],["eh","212",1,["5288","5289","6","7"],"0"],["ye","967",0,null,"0"],["zm","260",0,null,"0"],["zw","263",0,null,"0"]],j=[];for(let r of gt)j.push({name:"",iso2:r[0],dialCode:r[1],priority:r[2]||0,areaCodes:r[3]||null,nodeById:{},nationalPrefix:r[4]||null,normalisedName:"",initials:"",dialCodePlus:""});var L=j;var It={ad:"Andorra",ae:"United Arab Emirates",af:"Afghanistan",ag:"Antigua & Barbuda",ai:"Anguilla",al:"Albania",am:"Armenia",ao:"Angola",ar:"Argentina",as:"American Samoa",at:"Austria",au:"Australia",aw:"Aruba",ax:"\xC5land Islands",az:"Azerbaijan",ba:"Bosnia & Herzegovina",bb:"Barbados",bd:"Bangladesh",be:"Belgium",bf:"Burkina Faso",bg:"Bulgaria",bh:"Bahrain",bi:"Burundi",bj:"Benin",bl:"St. Barth\xE9lemy",bm:"Bermuda",bn:"Brunei",bo:"Bolivia",bq:"Caribbean Netherlands",br:"Brazil",bs:"Bahamas",bt:"Bhutan",bw:"Botswana",by:"Belarus",bz:"Belize",ca:"Canada",cc:"Cocos (Keeling) Islands",cd:"Congo - Kinshasa",cf:"Central African Republic",cg:"Congo - Brazzaville",ch:"Switzerland",ci:"C\xF4te d\u2019Ivoire",ck:"Cook Islands",cl:"Chile",cm:"Cameroon",cn:"China",co:"Colombia",cr:"Costa Rica",cu:"Cuba",cv:"Cape Verde",cw:"Cura\xE7ao",cx:"Christmas Island",cy:"Cyprus",cz:"Czechia",de:"Germany",dj:"Djibouti",dk:"Denmark",dm:"Dominica",do:"Dominican Republic",dz:"Algeria",ec:"Ecuador",ee:"Estonia",eg:"Egypt",eh:"Western Sahara",er:"Eritrea",es:"Spain",et:"Ethiopia",fi:"Finland",fj:"Fiji",fk:"Falkland Islands",fm:"Micronesia",fo:"Faroe Islands",fr:"France",ga:"Gabon",gb:"United Kingdom",gd:"Grenada",ge:"Georgia",gf:"French Guiana",gg:"Guernsey",gh:"Ghana",gi:"Gibraltar",gl:"Greenland",gm:"Gambia",gn:"Guinea",gp:"Guadeloupe",gq:"Equatorial Guinea",gr:"Greece",gt:"Guatemala",gu:"Guam",gw:"Guinea-Bissau",gy:"Guyana",hk:"Hong Kong SAR China",hn:"Honduras",hr:"Croatia",ht:"Haiti",hu:"Hungary",id:"Indonesia",ie:"Ireland",il:"Israel",im:"Isle of Man",in:"India",io:"British Indian Ocean Territory",iq:"Iraq",ir:"Iran",is:"Iceland",it:"Italy",je:"Jersey",jm:"Jamaica",jo:"Jordan",jp:"Japan",ke:"Kenya",kg:"Kyrgyzstan",kh:"Cambodia",ki:"Kiribati",km:"Comoros",kn:"St. Kitts & Nevis",kp:"North Korea",kr:"South Korea",kw:"Kuwait",ky:"Cayman Islands",kz:"Kazakhstan",la:"Laos",lb:"Lebanon",lc:"St. Lucia",li:"Liechtenstein",lk:"Sri Lanka",lr:"Liberia",ls:"Lesotho",lt:"Lithuania",lu:"Luxembourg",lv:"Latvia",ly:"Libya",ma:"Morocco",mc:"Monaco",md:"Moldova",me:"Montenegro",mf:"St. Martin",mg:"Madagascar",mh:"Marshall Islands",mk:"North Macedonia",ml:"Mali",mm:"Myanmar (Burma)",mn:"Mongolia",mo:"Macao SAR China",mp:"Northern Mariana Islands",mq:"Martinique",mr:"Mauritania",ms:"Montserrat",mt:"Malta",mu:"Mauritius",mv:"Maldives",mw:"Malawi",mx:"Mexico",my:"Malaysia",mz:"Mozambique",na:"Namibia",nc:"New Caledonia",ne:"Niger",nf:"Norfolk Island",ng:"Nigeria",ni:"Nicaragua",nl:"Netherlands",no:"Norway",np:"Nepal",nr:"Nauru",nu:"Niue",nz:"New Zealand",om:"Oman",pa:"Panama",pe:"Peru",pf:"French Polynesia",pg:"Papua New Guinea",ph:"Philippines",pk:"Pakistan",pl:"Poland",pm:"St. Pierre & Miquelon",pr:"Puerto Rico",ps:"Palestinian Territories",pt:"Portugal",pw:"Palau",py:"Paraguay",qa:"Qatar",re:"R\xE9union",ro:"Romania",rs:"Serbia",ru:"Russia",rw:"Rwanda",sa:"Saudi Arabia",sb:"Solomon Islands",sc:"Seychelles",sd:"Sudan",se:"Sweden",sg:"Singapore",sh:"St. Helena",si:"Slovenia",sj:"Svalbard & Jan Mayen",sk:"Slovakia",sl:"Sierra Leone",sm:"San Marino",sn:"Senegal",so:"Somalia",sr:"Suriname",ss:"South Sudan",st:"S\xE3o Tom\xE9 & Pr\xEDncipe",sv:"El Salvador",sx:"Sint Maarten",sy:"Syria",sz:"Eswatini",tc:"Turks & Caicos Islands",td:"Chad",tg:"Togo",th:"Thailand",tj:"Tajikistan",tk:"Tokelau",tl:"Timor-Leste",tm:"Turkmenistan",tn:"Tunisia",to:"Tonga",tr:"Turkey",tt:"Trinidad & Tobago",tv:"Tuvalu",tw:"Taiwan",tz:"Tanzania",ua:"Ukraine",ug:"Uganda",us:"United States",uy:"Uruguay",uz:"Uzbekistan",va:"Vatican City",vc:"St. Vincent & Grenadines",ve:"Venezuela",vg:"British Virgin Islands",vi:"U.S. Virgin Islands",vn:"Vietnam",vu:"Vanuatu",wf:"Wallis & Futuna",ws:"Samoa",ye:"Yemen",yt:"Mayotte",za:"South Africa",zm:"Zambia",zw:"Zimbabwe"},Y=It;var bt={selectedCountryAriaLabel:"Change country, selected ${countryName} (${dialCode})",noCountrySelected:"Select country",countryListAriaLabel:"List of countries",searchPlaceholder:"Search",clearSearchAriaLabel:"Clear search",zeroSearchResults:"No results found",oneSearchResult:"1 result found",multipleSearchResults:"${count} results found",ac:"Ascension Island",xk:"Kosovo"},q=bt;var vt={...Y,...q},B=vt;var w={OPEN_COUNTRY_DROPDOWN:"open:countrydropdown",CLOSE_COUNTRY_DROPDOWN:"close:countrydropdown",COUNTRY_CHANGE:"countrychange",INPUT:"input"},h={HIDE:"iti__hide",V_HIDE:"iti__v-hide",ARROW_UP:"iti__arrow--up",GLOBE:"iti__globe",FLAG:"iti__flag",COUNTRY_ITEM:"iti__country",HIGHLIGHT:"iti__highlight"},y={ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",SPACE:" ",ENTER:"Enter",ESC:"Escape",TAB:"Tab"},W={PASTE:"insertFromPaste",DELETE_FWD:"deleteContentForward"},N={ALPHA_UNICODE:/\p{L}/u,NON_PLUS_NUMERIC:/[^+0-9]/,NON_PLUS_NUMERIC_GLOBAL:/[^+0-9]/g,HIDDEN_SEARCH_CHAR:/^[a-zA-ZÀ-ÿа-яА-Я ]$/},X={SEARCH_DEBOUNCE_MS:100,HIDDEN_SEARCH_RESET_MS:1e3,NEXT_TICK:0},F={UNKNOWN_NUMBER_TYPE:-99,UNKNOWN_VALIDATION_ERROR:-99},P={SANE_SELECTED_WITH_DIAL_WIDTH:78,SANE_SELECTED_NO_DIAL_WIDTH:42,INPUT_PADDING_EXTRA_LEFT:6},M={PLUS:"+",NANP:"1"},O={ISO2:"gb",DIAL_CODE:"44",MOBILE_PREFIX:"7",MOBILE_CORE_LENGTH:10},J={ISO2:"us",DIAL_CODE:"1"},A={AGGRESSIVE:"aggressive",POLITE:"polite",OFF:"off"},x={AUTO:"auto"},$={COUNTRY_CODE:"countryCode",DIAL_CODE:"dialCode"},p={EXPANDED:"aria-expanded",LABEL:"aria-label",SELECTED:"aria-selected",ACTIVE_DESCENDANT:"aria-activedescendant",HASPOPUP:"aria-haspopup",CONTROLS:"aria-controls",HIDDEN:"aria-hidden",AUTOCOMPLETE:"aria-autocomplete",MODAL:"aria-modal"};var G=r=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(r).matches,Et=()=>{if(typeof navigator<"u"&&typeof window<"u"){let r=/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),t=G("(max-width: 500px)"),e=G("(max-height: 600px)"),i=G("(pointer: coarse)");return r||t||i&&e}return!1},K={allowPhonewords:!1,allowDropdown:!0,autoPlaceholder:A.POLITE,containerClass:"",countryOrder:null,countrySearch:!0,customPlaceholder:null,dropdownContainer:null,excludeCountries:[],fixDropdownWidth:!0,formatAsYouType:!0,formatOnDisplay:!0,geoIpLookup:null,hiddenInput:null,i18n:{},initialCountry:"",loadUtils:null,nationalMode:!0,onlyCountries:[],placeholderNumberType:"MOBILE",showFlags:!0,separateDialCode:!1,strictMode:!1,useFullscreenPopup:Et(),validationNumberTypes:["MOBILE"]},Q=(r,t)=>{r.useFullscreenPopup&&(r.fixDropdownWidth=!1),r.onlyCountries.length===1&&(r.initialCountry=r.onlyCountries[0]),r.separateDialCode&&(r.nationalMode=!1),r.allowDropdown&&!r.showFlags&&!r.separateDialCode&&(r.nationalMode=!1),r.useFullscreenPopup&&!r.dropdownContainer&&(r.dropdownContainer=document.body),r.i18n={...t,...r.i18n}};var D=r=>r.replace(/\D/g,""),R=(r="")=>r.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase();var Z=(r,t)=>{let e=R(t),i=[],n=[],s=[],o=[],a=[],u=[];for(let c of r)c.iso2===e?i.push(c):c.normalisedName.startsWith(e)?n.push(c):c.normalisedName.includes(e)?s.push(c):e===c.dialCode||e===c.dialCodePlus?o.push(c):c.dialCodePlus.includes(e)?a.push(c):c.initials.includes(e)&&u.push(c);let d=(c,m)=>c.priority-m.priority;return[...i.sort(d),...n.sort(d),...s.sort(d),...o.sort(d),...a.sort(d),...u.sort(d)]},tt=(r,t)=>{let e=t.toLowerCase();for(let i of r)if(i.name.toLowerCase().startsWith(e))return i;return null};var H=r=>Object.keys(r).filter(t=>!!r[t]).join(" "),C=(r,t,e)=>{let i=document.createElement(r);return t&&Object.entries(t).forEach(([n,s])=>i.setAttribute(n,s)),e&&e.appendChild(i),i};var et=()=>`
|
|
17
17
|
<svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" ${p.HIDDEN}="true">
|
|
18
18
|
<circle cx="11" cy="11" r="7" />
|
|
19
19
|
<line x1="21" y1="21" x2="16.65" y2="16.65" />
|
|
@@ -24,7 +24,7 @@ var factoryOutput=(()=>{var k=Object.defineProperty;var ht=Object.getOwnProperty
|
|
|
24
24
|
<path d="M5.2 5.2 L10.8 10.8 M10.8 5.2 L5.2 10.8" stroke="black" stroke-linecap="round" class="iti__search-clear-x" />
|
|
25
25
|
</mask>
|
|
26
26
|
<circle cx="8" cy="8" r="8" class="iti__search-clear-bg" mask="url(#${t})" />
|
|
27
|
-
</svg>`};var A=class{constructor(t,e,i){this.highlightedItem=null;t.dataset.intlTelInputId=i.toString(),this.telInput=t,this.options=e,this.id=i,this.a=!!t.getAttribute("placeholder"),this.isRTL=!!this.telInput.closest("[dir=rtl]"),this.options.separateDialCode&&(this.o=this.telInput.style.paddingLeft)}generateMarkup(t){this.countries=t,this._at();let e=this._au();this._av(e),e.appendChild(this.telInput),this._ay(),this._az(e)}_at(){this.telInput.classList.add("iti__tel-input"),!this.telInput.hasAttribute("autocomplete")&&!this.telInput.form?.hasAttribute("autocomplete")&&this.telInput.setAttribute("autocomplete","off")}_au(){let{allowDropdown:t,showFlags:e,containerClass:i,useFullscreenPopup:n}=this.options,s=R({iti:!0,"iti--allow-dropdown":t,"iti--show-flags":e,"iti--inline-dropdown":!n,[i]:!!i}),o=C("div",{class:s});return this.isRTL&&o.setAttribute("dir","ltr"),this.telInput.before(o),o}_av(t){let{allowDropdown:e,separateDialCode:i,showFlags:n}=this.options;if(e||n||i){this.countryContainer=C("div",{class:`iti__country-container ${h.V_HIDE}`},t),e?(this.selectedCountry=C("button",{type:"button",class:"iti__selected-country",[p.EXPANDED]:"false",[p.LABEL]:this.options.i18n.noCountrySelected,[p.HASPOPUP]:"dialog",[p.CONTROLS]:`iti-${this.id}__dropdown-content`},this.countryContainer),this.telInput.disabled&&this.selectedCountry.setAttribute("disabled","true")):this.selectedCountry=C("div",{class:"iti__selected-country"},this.countryContainer);let s=C("div",{class:"iti__selected-country-primary"},this.selectedCountry);this.selectedCountryInner=C("div",{class:h.FLAG},s),e&&(this.dropdownArrow=C("div",{class:"iti__arrow",[p.HIDDEN]:"true"},s)),i&&(this.selectedDialCode=C("div",{class:"iti__selected-dial-code"},this.selectedCountry)),e&&this._aw()}}_aw(){let{fixDropdownWidth:t,useFullscreenPopup:e,countrySearch:i,i18n:n,dropdownContainer:s,containerClass:o}=this.options,a=t?"":"iti--flexible-dropdown-width";if(this.dropdownContent=C("div",{id:`iti-${this.id}__dropdown-content`,class:`iti__dropdown-content ${h.HIDE} ${a}`,role:"dialog",[p.MODAL]:"true"}),this.isRTL&&this.dropdownContent.setAttribute("dir","rtl"),i&&this._ax(),this.countryList=C("ul",{class:"iti__country-list",id:`iti-${this.id}__country-listbox`,role:"listbox",[p.LABEL]:n.countryListAriaLabel},this.dropdownContent),this._ba(),i&&this.updateSearchResultsA11yText(),s){let u=R({iti:!0,"iti--container":!0,"iti--fullscreen-popup":e,"iti--inline-dropdown":!e,[o]:!!o});this.dropdown=C("div",{class:u}),this.dropdown.appendChild(this.dropdownContent)}else this.countryContainer.appendChild(this.dropdownContent)}_ax(){let{i18n:t}=this.options,e=C("div",{class:"iti__search-input-wrapper"},this.dropdownContent);this.searchIcon=C("span",{class:"iti__search-icon",[p.HIDDEN]:"true"},e),this.searchIcon.innerHTML=et(),this.searchInput=C("input",{id:`iti-${this.id}__search-input`,type:"search",class:"iti__search-input",placeholder:t.searchPlaceholder,role:"combobox",[p.EXPANDED]:"true",[p.LABEL]:t.searchPlaceholder,[p.CONTROLS]:`iti-${this.id}__country-listbox`,[p.AUTOCOMPLETE]:"list",autocomplete:"off"},e),this.k=C("button",{type:"button",class:`iti__search-clear ${h.HIDE}`,[p.LABEL]:t.clearSearchAriaLabel,tabindex:"-1"},e),this.k.innerHTML=it(this.id),this.l=C("span",{class:"iti__a11y-text"},this.dropdownContent),this.searchNoResults=C("div",{class:`iti__no-results ${h.HIDE}`,[p.HIDDEN]:"true"},this.dropdownContent),this.searchNoResults.textContent=t.zeroSearchResults}_ay(){this.countryContainer&&(this.updateInputPadding(),this.countryContainer.classList.remove(h.V_HIDE))}_az(t){let{hiddenInput:e}=this.options;if(e){let i=this.telInput.getAttribute("name")||"",n=e(i);if(n.phone){let s=this.telInput.form?.querySelector(`input[name="${n.phone}"]`);s?this.hiddenInput=s:(this.hiddenInput=C("input",{type:"hidden",name:n.phone}),t.appendChild(this.hiddenInput))}if(n.country){let s=this.telInput.form?.querySelector(`input[name="${n.country}"]`);s?this.m=s:(this.m=C("input",{type:"hidden",name:n.country}),t.appendChild(this.m))}}}_ba(){let t=document.createDocumentFragment();for(let e=0;e<this.countries.length;e++){let i=this.countries[e],n=R({[h.COUNTRY_ITEM]:!0,[h.HIGHLIGHT]:e===0}),s=C("li",{id:`iti-${this.id}__item-${i.iso2}`,class:n,tabindex:"-1",role:"option",[p.SELECTED]:"false"});s.dataset.dialCode=i.dialCode,s.dataset.countryCode=i.iso2,i.nodeById[this.id]=s,this.options.showFlags&&C("div",{class:`${h.FLAG} iti__${i.iso2}`},s);let o=C("span",{class:"iti__country-name"},s);o.textContent=i.name;let a=C("span",{class:"iti__dial-code"},s);this.isRTL&&a.setAttribute("dir","ltr"),a.textContent=`+${i.dialCode}`,t.appendChild(s)}this.countryList.appendChild(t)}updateInputPadding(){if(this.selectedCountry){let t=this.options.separateDialCode?S.SANE_SELECTED_WITH_DIAL_WIDTH:S.SANE_SELECTED_NO_DIAL_WIDTH,i=(this.selectedCountry.offsetWidth||this._bb()||t)+S.INPUT_PADDING_EXTRA_LEFT;this.telInput.style.paddingLeft=`${i}px`}}_bb(){if(this.telInput.parentNode){let t;try{t=window.top.document.body}catch{t=document.body}let e=this.telInput.parentNode.cloneNode(!1);e.style.visibility="hidden",t.appendChild(e);let i=this.countryContainer.cloneNode();e.appendChild(i);let n=this.selectedCountry.cloneNode(!0);i.appendChild(n);let s=n.offsetWidth;return t.removeChild(e),s}return 0}updateSearchResultsA11yText(){let{i18n:t}=this.options,e=this.countryList.childElementCount,i;e===0?i=t.zeroSearchResults:t.searchResultsText?i=t.searchResultsText(e):e===1?i=t.oneSearchResult:i=t.multipleSearchResults.replace("${count}",e.toString()),this.l.textContent=i}scrollTo(t){let e=this.countryList,i=document.documentElement.scrollTop,n=e.offsetHeight,s=e.getBoundingClientRect().top+i,o=s+n,a=t.offsetHeight,u=t.getBoundingClientRect().top+i,d=u+a,c=u-s+e.scrollTop;if(u<s)e.scrollTop=c;else if(d>o){let m=n-a;e.scrollTop=c-m}}highlightListItem(t,e){let i=this.highlightedItem;if(i&&(i.classList.remove(h.HIGHLIGHT),i.setAttribute(p.SELECTED,"false")),this.highlightedItem=t,this.highlightedItem&&(this.highlightedItem.classList.add(h.HIGHLIGHT),this.highlightedItem.setAttribute(p.SELECTED,"true"),this.options.countrySearch)){let n=this.highlightedItem.getAttribute("id")||"";this.searchInput.setAttribute(p.ACTIVE_DESCENDANT,n)}e&&this.highlightedItem.focus()}filterCountries(t){this.countryList.innerHTML="";let e=!0;for(let i of t){let n=i.nodeById[this.id];n&&(this.countryList.appendChild(n),e&&(this.highlightListItem(n,!1),e=!1))}e?(this.highlightListItem(null,!1),this.searchNoResults&&this.searchNoResults.classList.remove(h.HIDE)):this.searchNoResults&&this.searchNoResults.classList.add(h.HIDE),this.countryList.scrollTop=0,this.updateSearchResultsA11yText()}destroy(){this.telInput.iti=void 0,delete this.telInput.dataset.intlTelInputId,this.options.separateDialCode&&(this.telInput.style.paddingLeft=this.o);let t=this.telInput.parentNode;t.before(this.telInput),t.remove(),this.telInput=null,this.countryContainer=null,this.selectedCountry=null,this.selectedCountryInner=null,this.selectedDialCode=null,this.dropdownArrow=null,this.dropdownContent=null,this.searchInput=null,this.searchIcon=null,this.k=null,this.searchNoResults=null,this.l=null,this.countryList=null,this.dropdown=null,this.hiddenInput=null,this.m=null,this.highlightedItem=null;for(let e of this.countries)delete e.nodeById[this.id];this.countries=null}};var nt=r=>{let{onlyCountries:t,excludeCountries:e}=r;if(t.length){let i=t.map(n=>n.toLowerCase());return L.filter(n=>i.includes(n.iso2))}else if(e.length){let i=e.map(n=>n.toLowerCase());return L.filter(n=>!i.includes(n.iso2))}return L},st=(r,t)=>{for(let e of r){let i=e.iso2.toLowerCase();t.i18n[i]&&(e.name=t.i18n[i])}},ot=(r,t)=>{let e=new Set,i=0,n={},s=(o,a,u)=>{if(!o||!a)return;a.length>i&&(i=a.length),n.hasOwnProperty(a)||(n[a]=[]);let d=n[a];if(d.includes(o))return;let c=u!==void 0?u:d.length;d[c]=o};for(let o of r){e.has(o.dialCode)||e.add(o.dialCode);for(let a=1;a<o.dialCode.length;a++){let u=o.dialCode.substring(0,a);s(o.iso2,u)}s(o.iso2,o.dialCode,o.priority)}(t.onlyCountries.length||t.excludeCountries.length)&&e.forEach(o=>{n[o]=n[o].filter(Boolean)});for(let o of r)if(o.areaCodes){let a=n[o.dialCode][0];for(let u of o.areaCodes){for(let d=1;d<u.length;d++){let c=u.substring(0,d),m=o.dialCode+c;s(a,m),s(o.iso2,m)}s(o.iso2,o.dialCode+u)}}return{dialCodes:e,dialCodeMaxLen:i,dialCodeToIso2Map:n}},rt=(r,t)=>{t.countryOrder&&(t.countryOrder=t.countryOrder.map(e=>e.toLowerCase())),r.sort((e,i)=>{let{countryOrder:n}=t;if(n){let s=n.indexOf(e.iso2),o=n.indexOf(i.iso2),a=s>-1,u=o>-1;if(a||u)return a&&u?s-o:a?-1:1}return e.name.localeCompare(i.name)})},at=r=>{for(let t of r)t.normalisedName=x(t.name),t.initials=t.normalisedName.split(/[^a-z]/).map(e=>e[0]).join(""),t.dialCodePlus=`+${t.dialCode}`};var lt=(r,t,e,i)=>{let n=r;if(e&&t){t=`+${i.dialCode}`;let s=n[t.length]===" "||n[t.length]==="-"?t.length+1:t.length;n=n.substring(s)}return n},ut=(r,t,e,i,n)=>{let s=e?e.formatNumberAsYouType(r,i.iso2):r,{dialCode:o}=i;return n&&t.charAt(0)!=="+"&&s.includes(`+${o}`)?(s.split(`+${o}`)[1]||"").trim():s};var dt=(r,t,e,i)=>{if(e===0&&!i)return 0;let n=0;for(let s=0;s<t.length;s++){if(/[+0-9]/.test(t[s])&&n++,n===r&&!i)return s+1;if(i&&n===r+1)return s}return t.length};var Et=["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"],K=r=>{let t=w(r);if(t.startsWith(P.NANP)&&t.length>=4){let e=t.substring(1,4);return Et.includes(e)}return!1};for(let r of L)r.name=U[r.iso2];var Lt=0,Nt=new Set(L.map(r=>r.iso2)),z=r=>Nt.has(r),H=class r{constructor(t,e={}){this.id=Lt++,this.options={...G,...e},Q(this.options,U),this.ui=new A(t,this.options,this.id),this.i=r._b(),this.promise=this._c(),this.countries=nt(this.options);let{dialCodes:i,dialCodeMaxLen:n,dialCodeToIso2Map:s}=ot(this.countries,this.options);this.dialCodes=i,this.dialCodeMaxLen=n,this.dialCodeToIso2Map=s,this.j=new Map(this.countries.map(o=>[o.iso2,o])),this._init()}static _b(){return typeof navigator<"u"?/Android/i.test(navigator.userAgent):!1}_c(){let t=new Promise((i,n)=>{this.b=i,this.c=n}),e=new Promise((i,n)=>{this.d=i,this.e=n});return Promise.all([t,e])}_init(){this.selectedCountryData={},this.g=new AbortController,this._a(),this.ui.generateMarkup(this.countries),this._d(),this._e(),this._h()}_a(){st(this.countries,this.options),rt(this.countries,this.options),at(this.countries)}_d(t=!1){let e=this.ui.telInput.getAttribute("value"),i=this.ui.telInput.value,s=e&&e.startsWith("+")&&(!i||!i.startsWith("+"))?e:i,o=this._ao(s),a=K(s),{initialCountry:u,geoIpLookup:d}=this.options,c=u===O.AUTO&&d;if(o&&!a)this._ai(s);else if(!c||t){let m=u?u.toLowerCase():"";z(m)?this._aj(m):o&&a?this._aj(X.ISO2):this._aj("")}s&&this._ah(s)}_e(){this._j(),this.options.allowDropdown&&this._g(),(this.ui.hiddenInput||this.ui.m)&&this.ui.telInput.form&&this._f()}_f(){let t=()=>{this.ui.hiddenInput&&(this.ui.hiddenInput.value=this.getNumber()),this.ui.m&&(this.ui.m.value=this.selectedCountryData.iso2||"")};this.ui.telInput.form?.addEventListener("submit",t,{signal:this.g.signal})}_g(){let t=this.g.signal,e=o=>{this.ui.dropdownContent.classList.contains(h.HIDE)?this.ui.telInput.focus():o.preventDefault()},i=this.ui.telInput.closest("label");i&&i.addEventListener("click",e,{signal:t});let n=()=>{this.ui.dropdownContent.classList.contains(h.HIDE)&&!this.ui.telInput.disabled&&!this.ui.telInput.readOnly&&this._l()};this.ui.selectedCountry.addEventListener("click",n,{signal:t});let s=o=>{this.ui.dropdownContent.classList.contains(h.HIDE)&&[y.ARROW_UP,y.ARROW_DOWN,y.SPACE,y.ENTER].includes(o.key)&&(o.preventDefault(),o.stopPropagation(),this._l()),o.key===y.TAB&&this._am()};this.ui.countryContainer.addEventListener("keydown",s,{signal:t})}_h(){let{loadUtils:t,initialCountry:e,geoIpLookup:i}=this.options;if(t&&!l.utils){let s=()=>{l.attachUtils(t)?.catch(()=>{})};if(l.documentReady())s();else{let o=()=>{s()};window.addEventListener("load",o,{signal:this.g.signal})}}else this.d();e===O.AUTO&&i&&!this.selectedCountryData.iso2?this._i():this.b()}_i(){l.autoCountry?this.handleAutoCountry():l.startedLoadingAutoCountry||(l.startedLoadingAutoCountry=!0,typeof this.options.geoIpLookup=="function"&&this.options.geoIpLookup((t="")=>{let e=t.toLowerCase();z(e)?(l.autoCountry=e,setTimeout(()=>T("handleAutoCountry"))):(this._d(!0),T("rejectAutoCountryPromise"))},()=>{this._d(!0),T("rejectAutoCountryPromise")}))}_m(){this._l(),this.ui.searchInput.value="+",this._ae("")}_j(){this._p(),this._n(),this._o()}_p(){let{strictMode:t,formatAsYouType:e,separateDialCode:i,allowDropdown:n,countrySearch:s}=this.options,o=!1;N.ALPHA_UNICODE.test(this.ui.telInput.value)&&(o=!0);let a=u=>{if(this.i&&u?.data==="+"&&i&&n&&s){let g=this.ui.telInput.selectionStart||0,_=this.ui.telInput.value.substring(0,g-1),b=this.ui.telInput.value.substring(g);this.ui.telInput.value=_+b,this._m();return}this._ai(this.ui.telInput.value)&&this._ar();let d=u?.data&&N.NON_PLUS_NUMERIC.test(u.data),c=u?.inputType===B.PASTE&&this.ui.telInput.value;d||c&&!t?o=!0:N.NON_PLUS_NUMERIC.test(this.ui.telInput.value)||(o=!1);let m=u?.detail&&u.detail.isSetNumber;if(e&&!o&&!m){let g=this.ui.telInput.selectionStart||0,b=this.ui.telInput.value.substring(0,g).replace(N.NON_PLUS_NUMERIC_GLOBAL,"").length,E=u?.inputType===B.DELETE_FWD,f=this._ap(),I=ut(f,this.ui.telInput.value,l.utils,this.selectedCountryData,this.options.separateDialCode),v=dt(b,I,g,E);this.ui.telInput.value=I,this.ui.telInput.setSelectionRange(v,v)}};this.ui.telInput.addEventListener("input",a,{signal:this.g.signal})}_n(){let{strictMode:t,separateDialCode:e,allowDropdown:i,countrySearch:n}=this.options;if(t||e){let s=o=>{if(o.key&&o.key.length===1&&!o.altKey&&!o.ctrlKey&&!o.metaKey){if(e&&i&&n&&o.key==="+"){o.preventDefault(),this._m();return}if(t){let a=this.ui.telInput.value,d=!a.startsWith("+")&&this.ui.telInput.selectionStart===0&&o.key==="+",c=/^[0-9]$/.test(o.key),m=e?c:d||c,g=a.slice(0,this.ui.telInput.selectionStart)+o.key+a.slice(this.ui.telInput.selectionEnd),_=this._ap(g),b=l.utils.getCoreNumber(_,this.selectedCountryData.iso2),E=this.n&&b.length>this.n,I=this._s(_)!==null;(!m||E&&!I&&!d)&&o.preventDefault()}}};this.ui.telInput.addEventListener("keydown",s,{signal:this.g.signal})}}_o(){if(this.options.strictMode){let t=e=>{e.preventDefault();let i=this.ui.telInput,n=i.selectionStart,s=i.selectionEnd,o=i.value.slice(0,n),a=i.value.slice(s),u=this.selectedCountryData.iso2,d=e.clipboardData.getData("text"),c=n===0&&s>0,m=!i.value.startsWith("+")||c,g=d.replace(N.NON_PLUS_NUMERIC_GLOBAL,""),_=g.startsWith("+"),b=g.replace(/\+/g,""),E=_&&m?`+${b}`:b,f=o+E+a,I=l.utils.getCoreNumber(f,u);for(;I.length===0&&f.length>0;)f=f.slice(0,-1),I=l.utils.getCoreNumber(f,u);if(!I)return;if(this.n&&I.length>this.n)if(i.selectionEnd===i.value.length){let ct=I.length-this.n;f=f.slice(0,f.length-ct)}else return;i.value=f;let v=n+E.length;i.setSelectionRange(v,v),i.dispatchEvent(new InputEvent("input",{bubbles:!0}))};this.ui.telInput.addEventListener("paste",t,{signal:this.g.signal})}}_k(t){let e=Number(this.ui.telInput.getAttribute("maxlength"));return e&&t.length>e?t.substring(0,e):t}_as(t,e={}){let i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e});this.ui.telInput.dispatchEvent(i)}_l(){let{fixDropdownWidth:t,countrySearch:e}=this.options;if(this.h=new AbortController,t&&(this.ui.dropdownContent.style.width=`${this.ui.telInput.offsetWidth}px`),this.ui.dropdownContent.classList.remove(h.HIDE),this.ui.selectedCountry.setAttribute(p.EXPANDED,"true"),this._x(),e){let i=this.ui.countryList.firstElementChild;i&&(this.ui.highlightListItem(i,!1),this.ui.countryList.scrollTop=0),this.ui.searchInput.focus()}this._y(),this.ui.dropdownArrow.classList.add(h.ARROW_UP),this._as(D.OPEN_COUNTRY_DROPDOWN)}_x(){if(this.options.dropdownContainer&&this.options.dropdownContainer.appendChild(this.ui.dropdown),!this.options.useFullscreenPopup){let t=this.ui.telInput.getBoundingClientRect(),e=this.ui.telInput.offsetHeight;if(this.options.dropdownContainer){this.ui.dropdown.style.top=`${t.top+e}px`,this.ui.dropdown.style.left=`${t.left}px`;let i=()=>this._am();window.addEventListener("scroll",i,{signal:this.h.signal})}}}_y(){let t=this.h.signal;this._z(t),this._aa(t),this._ab(t),this._ac(t),this.options.countrySearch&&this._ad(t)}_z(t){let e=i=>{let n=i.target?.closest(`.${h.COUNTRY_ITEM}`);n&&this.ui.highlightListItem(n,!1)};this.ui.countryList.addEventListener("mouseover",e,{signal:t})}_aa(t){let e=i=>{let n=i.target?.closest(`.${h.COUNTRY_ITEM}`);n&&this._al(n)};this.ui.countryList.addEventListener("click",e,{signal:t})}_ab(t){let e=i=>{!!i.target.closest(`#iti-${this.id}__dropdown-content`)||this._am()};setTimeout(()=>{document.documentElement.addEventListener("click",e,{signal:t})},0)}_ac(t){let e="",i=null,n=s=>{[y.ARROW_UP,y.ARROW_DOWN,y.ENTER,y.ESC].includes(s.key)&&(s.preventDefault(),s.stopPropagation(),s.key===y.ARROW_UP||s.key===y.ARROW_DOWN?this._af(s.key):s.key===y.ENTER?this._ag():s.key===y.ESC&&this._am()),!this.options.countrySearch&&N.HIDDEN_SEARCH_CHAR.test(s.key)&&(s.stopPropagation(),i&&clearTimeout(i),e+=s.key.toLowerCase(),this._q(e),i=setTimeout(()=>{e=""},q.HIDDEN_SEARCH_RESET_MS))};document.addEventListener("keydown",n,{signal:t})}_ad(t){let e=()=>{let o=this.ui.searchInput.value.trim();this._ae(o),this.ui.searchInput.value?this.ui.k.classList.remove(h.HIDE):this.ui.k.classList.add(h.HIDE)},i=null,n=()=>{i&&clearTimeout(i),i=setTimeout(()=>{e(),i=null},100)};this.ui.searchInput.addEventListener("input",n,{signal:t});let s=()=>{this.ui.searchInput.value="",this.ui.searchInput.focus(),e()};this.ui.k.addEventListener("click",s,{signal:t})}_q(t){let e=tt(this.countries,t);if(e){let i=e.nodeById[this.id];this.ui.highlightListItem(i,!1),this.ui.scrollTo(i)}}_ae(t){let e;t===""?e=this.countries:e=Z(this.countries,t),this.ui.filterCountries(e)}_af(t){let e=t===y.ARROW_UP?this.ui.highlightedItem?.previousElementSibling:this.ui.highlightedItem?.nextElementSibling;!e&&this.ui.countryList.childElementCount>1&&(e=t===y.ARROW_UP?this.ui.countryList.lastElementChild:this.ui.countryList.firstElementChild),e&&(this.ui.scrollTo(e),this.ui.highlightListItem(e,!1))}_ag(){this.ui.highlightedItem&&this._al(this.ui.highlightedItem)}_ah(t){let e=t;if(this.options.formatOnDisplay&&l.utils&&this.selectedCountryData){let i=this.options.nationalMode||!e.startsWith("+")&&!this.options.separateDialCode,{NATIONAL:n,INTERNATIONAL:s}=l.utils.numberFormat,o=i?n:s;e=l.utils.formatNumber(e,this.selectedCountryData.iso2,o)}e=this._aq(e),this.ui.telInput.value=e}_ai(t){let e=this._s(t);return e!==null?this._aj(e):!1}_r(t){let{dialCode:e,nationalPrefix:i}=this.selectedCountryData;if(t.startsWith("+")||!e)return t;let o=i&&t.startsWith(i)&&!this.options.separateDialCode?t.substring(1):t;return`+${e}${o}`}_s(t){let e=t.indexOf("+"),i=e?t.substring(e):t,n=this.selectedCountryData.iso2,s=this.selectedCountryData.dialCode;i=this._r(i);let o=this._ao(i,!0),a=w(i);if(o){let u=w(o),d=this.dialCodeToIso2Map[u];if(d.length===1)return d[0]===n?null:d[0];if(!n&&this.f&&d.includes(this.f))return this.f;if(s===P.NANP&&K(a))return null;let{areaCodes:m,priority:g}=this.selectedCountryData;if(m){let I=m.map(v=>`${s}${v}`);for(let v of I)if(a.startsWith(v))return null}let b=m&&!(g===0)&&a.length>u.length,E=n&&d.includes(n)&&!b,f=n===d[0];if(!E&&!f)return d[0]}else{if(i.startsWith("+")&&a.length)return"";if((!i||i==="+")&&!n)return this.f}return null}_aj(t){let{separateDialCode:e,showFlags:i,i18n:n}=this.options,s=this.selectedCountryData.iso2||"";if(this.selectedCountryData=t?this.j.get(t):{},this.selectedCountryData.iso2&&(this.f=this.selectedCountryData.iso2),this.ui.selectedCountry){let o=t&&i?`${h.FLAG} iti__${t}`:`${h.FLAG} ${h.GLOBE}`,a,u;if(t){let{name:d,dialCode:c}=this.selectedCountryData;u=d,a=n.selectedCountryAriaLabel.replace("${countryName}",d).replace("${dialCode}",`+${c}`)}else u=n.noCountrySelected,a=n.noCountrySelected;this.ui.selectedCountryInner.className=o,this.ui.selectedCountry.setAttribute("title",u),this.ui.selectedCountry.setAttribute(p.LABEL,a)}if(e){let o=this.selectedCountryData.dialCode?`+${this.selectedCountryData.dialCode}`:"";this.ui.selectedDialCode.textContent=o,this.ui.updateInputPadding()}return this._ak(),this._t(),s!==t}_t(){let{strictMode:t,placeholderNumberType:e,validationNumberTypes:i}=this.options,{iso2:n}=this.selectedCountryData;if(t&&l.utils)if(n){let s=l.utils.numberType[e],o=l.utils.getExampleNumber(n,!1,s,!0),a=o;for(;l.utils.isPossibleNumber(o,n,i);)a=o,o+="0";let u=l.utils.getCoreNumber(a,n);this.n=u.length,n==="by"&&(this.n=u.length+1)}else this.n=null}_ak(){let{autoPlaceholder:t,placeholderNumberType:e,nationalMode:i,customPlaceholder:n}=this.options,s=t==="aggressive"||!this.ui.a&&t==="polite";if(l.utils&&s){let o=l.utils.numberType[e],a=this.selectedCountryData.iso2?l.utils.getExampleNumber(this.selectedCountryData.iso2,i,o):"";a=this._aq(a),typeof n=="function"&&(a=n(a,this.selectedCountryData)),this.ui.telInput.setAttribute("placeholder",a)}}_al(t){let e=t.dataset[F.COUNTRY_CODE],i=this._aj(e);this._am();let n=t.dataset[F.DIAL_CODE];this._an(n),this.options.formatOnDisplay&&this._ah(this.ui.telInput.value),this.ui.telInput.focus(),i&&this._ar()}_am(){this.ui.dropdownContent.classList.contains(h.HIDE)||(this.ui.dropdownContent.classList.add(h.HIDE),this.ui.selectedCountry.setAttribute(p.EXPANDED,"false"),this.ui.highlightedItem&&this.ui.highlightedItem.setAttribute(p.SELECTED,"false"),this.options.countrySearch&&this.ui.searchInput.removeAttribute(p.ACTIVE_DESCENDANT),this.ui.dropdownArrow.classList.remove(h.ARROW_UP),this.h.abort(),this.h=null,this.options.dropdownContainer&&this.ui.dropdown.remove(),this._as(D.CLOSE_COUNTRY_DROPDOWN))}_an(t){let e=this.ui.telInput.value,i=`+${t}`,n;if(e.startsWith("+")){let s=this._ao(e);s?n=e.replace(s,i):n=i,this.ui.telInput.value=n}}_ao(t,e){let i="";if(t.startsWith("+")){let n="";for(let s=0;s<t.length;s++){let o=t.charAt(s);if(/[0-9]/.test(o)){if(n+=o,!!!this.dialCodeToIso2Map[n])break;if(e)i=t.substring(0,s+1);else if(this.dialCodes.has(n)){i=t.substring(0,s+1);break}if(n.length===this.dialCodeMaxLen)break}}}return i}_ap(t){let e=t||this.ui.telInput.value.trim(),{dialCode:i}=this.selectedCountryData,n,s=w(e);return this.options.separateDialCode&&!e.startsWith("+")&&i&&s?n=`+${i}`:n="",n+e}_aq(t){let e=this._ao(t),i=lt(t,e,this.options.separateDialCode,this.selectedCountryData);return this._k(i)}_ar(){this._as(D.COUNTRY_CHANGE)}handleAutoCountry(){this.options.initialCountry===O.AUTO&&l.autoCountry&&(this.f=l.autoCountry,this.selectedCountryData.iso2||this.ui.selectedCountryInner.classList.contains(h.GLOBE)||this.setCountry(this.f),this.b())}handleUtils(){l.utils&&(this.ui.telInput.value&&this._ah(this.ui.telInput.value),this.selectedCountryData.iso2&&(this._ak(),this._t())),this.d()}destroy(){this.ui.telInput&&(this.options.allowDropdown&&this._am(),this.g.abort(),this.g=null,this.ui.destroy(),l.instances instanceof Map?l.instances.delete(this.id):delete l.instances[this.id])}getExtension(){return l.utils?l.utils.getExtension(this._ap(),this.selectedCountryData.iso2):""}getNumber(t){if(l.utils){let{iso2:e}=this.selectedCountryData;return l.utils.formatNumber(this._ap(),e,t)}return""}getNumberType(){return l.utils?l.utils.getNumberType(this._ap(),this.selectedCountryData.iso2):W.UNKNOWN_NUMBER_TYPE}getSelectedCountryData(){return this.selectedCountryData}getValidationError(){if(l.utils){let{iso2:t}=this.selectedCountryData;return l.utils.getValidationError(this._ap(),t)}return W.UNKNOWN_VALIDATION_ERROR}isValidNumber(){let{dialCode:t,iso2:e}=this.selectedCountryData;if(t===M.DIAL_CODE&&l.utils){let i=this._ap(),n=l.utils.getCoreNumber(i,e);if(n[0]===M.MOBILE_PREFIX&&n.length!==M.MOBILE_CORE_LENGTH)return!1}return this._v(!1)}isValidNumberPrecise(){return this._v(!0)}_u(t){return l.utils?l.utils.isPossibleNumber(t,this.selectedCountryData.iso2,this.options.validationNumberTypes):null}_v(t){if(!l.utils)return null;if(!this.selectedCountryData.iso2)return!1;let e=o=>t?this._w(o):this._u(o),i=this._ap(),n=i.search(N.ALPHA_UNICODE);if(n>-1&&!this.options.allowPhonewords){let o=i.substring(0,n),a=e(o),u=e(i);return a&&u}return e(i)}_w(t){return l.utils?l.utils.isValidNumber(t,this.selectedCountryData.iso2,this.options.validationNumberTypes):null}setCountry(t){let e=t?.toLowerCase();if(!z(e))throw new Error(`Invalid country code: '${e}'`);let i=this.selectedCountryData.iso2;(t&&e!==i||!t&&i)&&(this._aj(e),this._an(this.selectedCountryData.dialCode),this.options.formatOnDisplay&&this._ah(this.ui.telInput.value),this._ar())}setNumber(t){let e=this._ai(t);this._ah(t),e&&this._ar(),this._as(D.INPUT,{isSetNumber:!0})}setPlaceholderNumberType(t){this.options.placeholderNumberType=t,this._ak()}setDisabled(t){this.ui.telInput.disabled=t,t?this.ui.selectedCountry.setAttribute("disabled","true"):this.ui.selectedCountry.removeAttribute("disabled")}},wt=r=>{if(!l.utils&&!l.startedLoadingUtilsScript){let t;if(typeof r=="function")try{t=Promise.resolve(r())}catch(e){return Promise.reject(e)}else return Promise.reject(new TypeError(`The argument passed to attachUtils must be a function that returns a promise for the utilities module, not ${typeof r}`));return l.startedLoadingUtilsScript=!0,t.then(e=>{let i=e?.default;if(!i||typeof i!="object")throw new TypeError("The loader function passed to attachUtils did not resolve to a module object with utils as its default export.");return l.utils=i,T("handleUtils"),!0}).catch(e=>{throw T("rejectUtilsScriptPromise",e),e})}return null},T=(r,...t)=>{Object.values(l.instances).forEach(e=>{let i=e[r];typeof i=="function"&&i.apply(e,t)})},l=Object.assign((r,t)=>{let e=new H(r,t);return l.instances[e.id]=e,r.iti=e,e},{defaults:G,documentReady:()=>document.readyState==="complete",getCountryData:()=>L,getInstance:r=>{let t=r.dataset.intlTelInputId;return t?l.instances[t]:null},instances:{},attachUtils:wt,startedLoadingUtilsScript:!1,startedLoadingAutoCountry:!1,version:"25.11.2"}),Dt=l;return ft(At);})();
|
|
27
|
+
</svg>`};var T=class{constructor(t,e,i){this.highlightedItem=null;t.dataset.intlTelInputId=i.toString(),this.telInput=t,this.options=e,this.id=i,this.a=!!t.getAttribute("placeholder"),this.isRTL=!!this.telInput.closest("[dir=rtl]"),this.options.separateDialCode&&(this.o=this.telInput.style.paddingLeft)}generateMarkup(t){this.countries=t,this._at();let e=this._au();this._av(e),e.appendChild(this.telInput),this._ay(),this._az(e)}_at(){this.telInput.classList.add("iti__tel-input"),!this.telInput.hasAttribute("autocomplete")&&!this.telInput.form?.hasAttribute("autocomplete")&&this.telInput.setAttribute("autocomplete","off")}_au(){let{allowDropdown:t,showFlags:e,containerClass:i,useFullscreenPopup:n}=this.options,s=H({iti:!0,"iti--allow-dropdown":t,"iti--show-flags":e,"iti--inline-dropdown":!n,[i]:!!i}),o=C("div",{class:s});return this.isRTL&&o.setAttribute("dir","ltr"),this.telInput.before(o),o}_av(t){let{allowDropdown:e,separateDialCode:i,showFlags:n}=this.options;if(e||n||i){this.countryContainer=C("div",{class:`iti__country-container ${h.V_HIDE}`},t),e?(this.selectedCountry=C("button",{type:"button",class:"iti__selected-country",[p.EXPANDED]:"false",[p.LABEL]:this.options.i18n.noCountrySelected,[p.HASPOPUP]:"dialog",[p.CONTROLS]:`iti-${this.id}__dropdown-content`},this.countryContainer),this.telInput.disabled&&this.selectedCountry.setAttribute("disabled","true")):this.selectedCountry=C("div",{class:"iti__selected-country"},this.countryContainer);let s=C("div",{class:"iti__selected-country-primary"},this.selectedCountry);this.selectedCountryInner=C("div",{class:h.FLAG},s),e&&(this.dropdownArrow=C("div",{class:"iti__arrow",[p.HIDDEN]:"true"},s)),i&&(this.selectedDialCode=C("div",{class:"iti__selected-dial-code"},this.selectedCountry)),e&&this._aw()}}_aw(){let{fixDropdownWidth:t,useFullscreenPopup:e,countrySearch:i,i18n:n,dropdownContainer:s,containerClass:o}=this.options,a=t?"":"iti--flexible-dropdown-width";if(this.dropdownContent=C("div",{id:`iti-${this.id}__dropdown-content`,class:`iti__dropdown-content ${h.HIDE} ${a}`,role:"dialog",[p.MODAL]:"true"}),this.isRTL&&this.dropdownContent.setAttribute("dir","rtl"),i&&this._ax(),this.countryList=C("ul",{class:"iti__country-list",id:`iti-${this.id}__country-listbox`,role:"listbox",[p.LABEL]:n.countryListAriaLabel},this.dropdownContent),this._ba(),i&&this.updateSearchResultsA11yText(),s){let u=H({iti:!0,"iti--container":!0,"iti--fullscreen-popup":e,"iti--inline-dropdown":!e,[o]:!!o});this.dropdown=C("div",{class:u}),this.dropdown.appendChild(this.dropdownContent)}else this.countryContainer.appendChild(this.dropdownContent)}_ax(){let{i18n:t}=this.options,e=C("div",{class:"iti__search-input-wrapper"},this.dropdownContent);this.searchIcon=C("span",{class:"iti__search-icon",[p.HIDDEN]:"true"},e),this.searchIcon.innerHTML=et(),this.searchInput=C("input",{id:`iti-${this.id}__search-input`,type:"search",class:"iti__search-input",placeholder:t.searchPlaceholder,role:"combobox",[p.EXPANDED]:"true",[p.LABEL]:t.searchPlaceholder,[p.CONTROLS]:`iti-${this.id}__country-listbox`,[p.AUTOCOMPLETE]:"list",autocomplete:"off"},e),this.k=C("button",{type:"button",class:`iti__search-clear ${h.HIDE}`,[p.LABEL]:t.clearSearchAriaLabel,tabindex:"-1"},e),this.k.innerHTML=it(this.id),this.l=C("span",{class:"iti__a11y-text"},this.dropdownContent),this.searchNoResults=C("div",{class:`iti__no-results ${h.HIDE}`,[p.HIDDEN]:"true"},this.dropdownContent),this.searchNoResults.textContent=t.zeroSearchResults}_ay(){this.countryContainer&&(this.updateInputPadding(),this.countryContainer.classList.remove(h.V_HIDE))}_az(t){let{hiddenInput:e}=this.options;if(e){let i=this.telInput.getAttribute("name")||"",n=e(i);if(n.phone){let s=this.telInput.form?.querySelector(`input[name="${n.phone}"]`);s?this.hiddenInput=s:(this.hiddenInput=C("input",{type:"hidden",name:n.phone}),t.appendChild(this.hiddenInput))}if(n.country){let s=this.telInput.form?.querySelector(`input[name="${n.country}"]`);s?this.m=s:(this.m=C("input",{type:"hidden",name:n.country}),t.appendChild(this.m))}}}_ba(){let t=document.createDocumentFragment();for(let e=0;e<this.countries.length;e++){let i=this.countries[e],n=H({[h.COUNTRY_ITEM]:!0,[h.HIGHLIGHT]:e===0}),s=C("li",{id:`iti-${this.id}__item-${i.iso2}`,class:n,tabindex:"-1",role:"option",[p.SELECTED]:"false"});s.dataset.dialCode=i.dialCode,s.dataset.countryCode=i.iso2,i.nodeById[this.id]=s,this.options.showFlags&&C("div",{class:`${h.FLAG} iti__${i.iso2}`},s);let o=C("span",{class:"iti__country-name"},s);o.textContent=i.name;let a=C("span",{class:"iti__dial-code"},s);this.isRTL&&a.setAttribute("dir","ltr"),a.textContent=`+${i.dialCode}`,t.appendChild(s)}this.countryList.appendChild(t)}updateInputPadding(){if(this.selectedCountry){let t=this.options.separateDialCode?P.SANE_SELECTED_WITH_DIAL_WIDTH:P.SANE_SELECTED_NO_DIAL_WIDTH,i=(this.selectedCountry.offsetWidth||this._bb()||t)+P.INPUT_PADDING_EXTRA_LEFT;this.telInput.style.paddingLeft=`${i}px`}}_bb(){if(this.telInput.parentNode){let t;try{t=window.top.document.body}catch{t=document.body}let e=this.telInput.parentNode.cloneNode(!1);e.style.visibility="hidden",t.appendChild(e);let i=this.countryContainer.cloneNode();e.appendChild(i);let n=this.selectedCountry.cloneNode(!0);i.appendChild(n);let s=n.offsetWidth;return t.removeChild(e),s}return 0}updateSearchResultsA11yText(){let{i18n:t}=this.options,e=this.countryList.childElementCount,i;e===0?i=t.zeroSearchResults:t.searchResultsText?i=t.searchResultsText(e):e===1?i=t.oneSearchResult:i=t.multipleSearchResults.replace("${count}",e.toString()),this.l.textContent=i}scrollTo(t){let e=this.countryList,i=document.documentElement.scrollTop,n=e.offsetHeight,s=e.getBoundingClientRect().top+i,o=s+n,a=t.offsetHeight,u=t.getBoundingClientRect().top+i,d=u+a,c=u-s+e.scrollTop;if(u<s)e.scrollTop=c;else if(d>o){let m=n-a;e.scrollTop=c-m}}highlightListItem(t,e){let i=this.highlightedItem;if(i&&(i.classList.remove(h.HIGHLIGHT),i.setAttribute(p.SELECTED,"false")),this.highlightedItem=t,this.highlightedItem&&(this.highlightedItem.classList.add(h.HIGHLIGHT),this.highlightedItem.setAttribute(p.SELECTED,"true"),this.options.countrySearch)){let n=this.highlightedItem.getAttribute("id")||"";this.searchInput.setAttribute(p.ACTIVE_DESCENDANT,n)}e&&this.highlightedItem.focus()}filterCountries(t){this.countryList.innerHTML="";let e=!0;for(let i of t){let n=i.nodeById[this.id];n&&(this.countryList.appendChild(n),e&&(this.highlightListItem(n,!1),e=!1))}e?(this.highlightListItem(null,!1),this.searchNoResults&&this.searchNoResults.classList.remove(h.HIDE)):this.searchNoResults&&this.searchNoResults.classList.add(h.HIDE),this.countryList.scrollTop=0,this.updateSearchResultsA11yText()}destroy(){this.telInput.iti=void 0,delete this.telInput.dataset.intlTelInputId,this.options.separateDialCode&&(this.telInput.style.paddingLeft=this.o);let t=this.telInput.parentNode;t.before(this.telInput),t.remove(),this.telInput=null,this.countryContainer=null,this.selectedCountry=null,this.selectedCountryInner=null,this.selectedDialCode=null,this.dropdownArrow=null,this.dropdownContent=null,this.searchInput=null,this.searchIcon=null,this.k=null,this.searchNoResults=null,this.l=null,this.countryList=null,this.dropdown=null,this.hiddenInput=null,this.m=null,this.highlightedItem=null;for(let e of this.countries)delete e.nodeById[this.id];this.countries=null}};var nt=r=>{let{onlyCountries:t,excludeCountries:e}=r;if(t.length){let i=t.map(n=>n.toLowerCase());return L.filter(n=>i.includes(n.iso2))}else if(e.length){let i=e.map(n=>n.toLowerCase());return L.filter(n=>!i.includes(n.iso2))}return L},st=(r,t)=>{for(let e of r){let i=e.iso2.toLowerCase();t.i18n[i]&&(e.name=t.i18n[i])}},ot=(r,t)=>{let e=new Set,i=0,n={},s=(o,a,u)=>{if(!o||!a)return;a.length>i&&(i=a.length),n.hasOwnProperty(a)||(n[a]=[]);let d=n[a];if(d.includes(o))return;let c=u!==void 0?u:d.length;d[c]=o};for(let o of r){e.has(o.dialCode)||e.add(o.dialCode);for(let a=1;a<o.dialCode.length;a++){let u=o.dialCode.substring(0,a);s(o.iso2,u)}s(o.iso2,o.dialCode,o.priority)}(t.onlyCountries.length||t.excludeCountries.length)&&e.forEach(o=>{n[o]=n[o].filter(Boolean)});for(let o of r)if(o.areaCodes){let a=n[o.dialCode][0];for(let u of o.areaCodes){for(let d=1;d<u.length;d++){let c=u.substring(0,d),m=o.dialCode+c;s(a,m),s(o.iso2,m)}s(o.iso2,o.dialCode+u)}}return{dialCodes:e,dialCodeMaxLen:i,dialCodeToIso2Map:n}},rt=(r,t)=>{t.countryOrder&&(t.countryOrder=t.countryOrder.map(e=>e.toLowerCase())),r.sort((e,i)=>{let{countryOrder:n}=t;if(n){let s=n.indexOf(e.iso2),o=n.indexOf(i.iso2),a=s>-1,u=o>-1;if(a||u)return a&&u?s-o:a?-1:1}return e.name.localeCompare(i.name)})},at=r=>{for(let t of r)t.normalisedName=R(t.name),t.initials=t.normalisedName.split(/[^a-z]/).map(e=>e[0]).join(""),t.dialCodePlus=`+${t.dialCode}`};var lt=(r,t,e,i)=>{let n=r;if(e&&t){t=`+${i.dialCode}`;let s=n[t.length]===" "||n[t.length]==="-"?t.length+1:t.length;n=n.substring(s)}return n},ut=(r,t,e,i,n)=>{let s=e?e.formatNumberAsYouType(r,i.iso2):r,{dialCode:o}=i;return n&&t.charAt(0)!=="+"&&s.includes(`+${o}`)?(s.split(`+${o}`)[1]||"").trim():s};var dt=(r,t,e,i)=>{if(e===0&&!i)return 0;let n=0;for(let s=0;s<t.length;s++){if(/[+0-9]/.test(t[s])&&n++,n===r&&!i)return s+1;if(i&&n===r+1)return s}return t.length};var _t=["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"],z=r=>{let t=D(r);if(t.startsWith(M.NANP)&&t.length>=4){let e=t.substring(1,4);return _t.includes(e)}return!1};for(let r of L)r.name=B[r.iso2];var Lt=0,Nt=new Set(L.map(r=>r.iso2)),V=r=>Nt.has(r),k=class r{constructor(t,e={}){this.id=Lt++,this.options={...K,...e},Q(this.options,B),this.ui=new T(t,this.options,this.id),this.i=r._b(),this.promise=this._c(),this.countries=nt(this.options);let{dialCodes:i,dialCodeMaxLen:n,dialCodeToIso2Map:s}=ot(this.countries,this.options);this.dialCodes=i,this.dialCodeMaxLen=n,this.dialCodeToIso2Map=s,this.j=new Map(this.countries.map(o=>[o.iso2,o])),this._init()}static _b(){return typeof navigator<"u"?/Android/i.test(navigator.userAgent):!1}_c(){let t=new Promise((i,n)=>{this.b=i,this.c=n}),e=new Promise((i,n)=>{this.d=i,this.e=n});return Promise.all([t,e])}_init(){this.selectedCountryData={},this.g=new AbortController,this._a(),this.ui.generateMarkup(this.countries),this._d(),this._e(),this._h()}_a(){st(this.countries,this.options),rt(this.countries,this.options),at(this.countries)}_d(t=!1){let e=this.ui.telInput.getAttribute("value"),i=this.ui.telInput.value,s=e&&e.startsWith("+")&&(!i||!i.startsWith("+"))?e:i,o=this._ao(s),a=z(s),{initialCountry:u,geoIpLookup:d}=this.options,c=u===x.AUTO&&d;if(o&&!a)this._ai(s);else if(!c||t){let m=u?u.toLowerCase():"";V(m)?this._aj(m):o&&a?this._aj(J.ISO2):this._aj("")}s&&this._ah(s)}_e(){this._j(),this.options.allowDropdown&&this._g(),(this.ui.hiddenInput||this.ui.m)&&this.ui.telInput.form&&this._f()}_f(){let t=()=>{this.ui.hiddenInput&&(this.ui.hiddenInput.value=this.getNumber()),this.ui.m&&(this.ui.m.value=this.selectedCountryData.iso2||"")};this.ui.telInput.form?.addEventListener("submit",t,{signal:this.g.signal})}_g(){let t=this.g.signal,e=o=>{this.ui.dropdownContent.classList.contains(h.HIDE)?this.ui.telInput.focus():o.preventDefault()},i=this.ui.telInput.closest("label");i&&i.addEventListener("click",e,{signal:t});let n=()=>{this.ui.dropdownContent.classList.contains(h.HIDE)&&!this.ui.telInput.disabled&&!this.ui.telInput.readOnly&&this._l()};this.ui.selectedCountry.addEventListener("click",n,{signal:t});let s=o=>{this.ui.dropdownContent.classList.contains(h.HIDE)&&[y.ARROW_UP,y.ARROW_DOWN,y.SPACE,y.ENTER].includes(o.key)&&(o.preventDefault(),o.stopPropagation(),this._l()),o.key===y.TAB&&this._am()};this.ui.countryContainer.addEventListener("keydown",s,{signal:t})}_h(){let{loadUtils:t,initialCountry:e,geoIpLookup:i}=this.options;if(t&&!l.utils){let s=()=>{l.attachUtils(t)?.catch(()=>{})};if(l.documentReady())s();else{let o=()=>{s()};window.addEventListener("load",o,{signal:this.g.signal})}}else this.d();e===x.AUTO&&i&&!this.selectedCountryData.iso2?this._i():this.b()}_i(){l.autoCountry?this.handleAutoCountry():l.startedLoadingAutoCountry||(l.startedLoadingAutoCountry=!0,typeof this.options.geoIpLookup=="function"&&this.options.geoIpLookup((t="")=>{let e=t.toLowerCase();V(e)?(l.autoCountry=e,setTimeout(()=>S("handleAutoCountry"))):(this._d(!0),S("rejectAutoCountryPromise"))},()=>{this._d(!0),S("rejectAutoCountryPromise")}))}_m(){this._l(),this.ui.searchInput.value="+",this._ae("")}_j(){this._p(),this._n(),this._o()}_p(){let{strictMode:t,formatAsYouType:e,separateDialCode:i,allowDropdown:n,countrySearch:s}=this.options,o=!1;N.ALPHA_UNICODE.test(this.ui.telInput.value)&&(o=!0);let a=u=>{if(this.i&&u?.data==="+"&&i&&n&&s){let g=this.ui.telInput.selectionStart||0,E=this.ui.telInput.value.substring(0,g-1),b=this.ui.telInput.value.substring(g);this.ui.telInput.value=E+b,this._m();return}this._ai(this.ui.telInput.value)&&this._ar();let d=u?.data&&N.NON_PLUS_NUMERIC.test(u.data),c=u?.inputType===W.PASTE&&this.ui.telInput.value;d||c&&!t?o=!0:N.NON_PLUS_NUMERIC.test(this.ui.telInput.value)||(o=!1);let m=u?.detail&&u.detail.isSetNumber;if(e&&!o&&!m){let g=this.ui.telInput.selectionStart||0,b=this.ui.telInput.value.substring(0,g).replace(N.NON_PLUS_NUMERIC_GLOBAL,"").length,_=u?.inputType===W.DELETE_FWD,f=this._ap(),I=ut(f,this.ui.telInput.value,l.utils,this.selectedCountryData,this.options.separateDialCode),v=dt(b,I,g,_);this.ui.telInput.value=I,this.ui.telInput.setSelectionRange(v,v)}};this.ui.telInput.addEventListener("input",a,{signal:this.g.signal})}_n(){let{strictMode:t,separateDialCode:e,allowDropdown:i,countrySearch:n}=this.options;if(t||e){let s=o=>{if(o.key&&o.key.length===1&&!o.altKey&&!o.ctrlKey&&!o.metaKey){if(e&&i&&n&&o.key==="+"){o.preventDefault(),this._m();return}if(t){let a=this.ui.telInput.value,d=!a.startsWith("+")&&this.ui.telInput.selectionStart===0&&o.key==="+",c=/^[0-9]$/.test(o.key),m=e?c:d||c,g=a.slice(0,this.ui.telInput.selectionStart)+o.key+a.slice(this.ui.telInput.selectionEnd),E=this._ap(g),b=l.utils.getCoreNumber(E,this.selectedCountryData.iso2),_=this.n&&b.length>this.n,I=this._s(E)!==null;(!m||_&&!I&&!d)&&o.preventDefault()}}};this.ui.telInput.addEventListener("keydown",s,{signal:this.g.signal})}}_o(){if(this.options.strictMode){let t=e=>{e.preventDefault();let i=this.ui.telInput,n=i.selectionStart,s=i.selectionEnd,o=i.value.slice(0,n),a=i.value.slice(s),u=this.selectedCountryData.iso2,d=e.clipboardData.getData("text"),c=n===0&&s>0,m=!i.value.startsWith("+")||c,g=d.replace(N.NON_PLUS_NUMERIC_GLOBAL,""),E=g.startsWith("+"),b=g.replace(/\+/g,""),_=E&&m?`+${b}`:b,f=o+_+a,I=l.utils.getCoreNumber(f,u);for(;I.length===0&&f.length>0;)f=f.slice(0,-1),I=l.utils.getCoreNumber(f,u);if(!I)return;if(this.n&&I.length>this.n)if(i.selectionEnd===i.value.length){let ct=I.length-this.n;f=f.slice(0,f.length-ct)}else return;i.value=f;let v=n+_.length;i.setSelectionRange(v,v),i.dispatchEvent(new InputEvent("input",{bubbles:!0}))};this.ui.telInput.addEventListener("paste",t,{signal:this.g.signal})}}_k(t){let e=Number(this.ui.telInput.getAttribute("maxlength"));return e&&t.length>e?t.substring(0,e):t}_as(t,e={}){let i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e});this.ui.telInput.dispatchEvent(i)}_l(){let{fixDropdownWidth:t,countrySearch:e}=this.options;if(this.h=new AbortController,t&&(this.ui.dropdownContent.style.width=`${this.ui.telInput.offsetWidth}px`),this.ui.dropdownContent.classList.remove(h.HIDE),this.ui.selectedCountry.setAttribute(p.EXPANDED,"true"),this._x(),e){let i=this.ui.countryList.firstElementChild;i&&(this.ui.highlightListItem(i,!1),this.ui.countryList.scrollTop=0),this.ui.searchInput.focus()}this._y(),this.ui.dropdownArrow.classList.add(h.ARROW_UP),this._as(w.OPEN_COUNTRY_DROPDOWN)}_x(){if(this.options.dropdownContainer&&this.options.dropdownContainer.appendChild(this.ui.dropdown),!this.options.useFullscreenPopup){let t=this.ui.telInput.getBoundingClientRect(),e=this.ui.telInput.offsetHeight;if(this.options.dropdownContainer){this.ui.dropdown.style.top=`${t.top+e}px`,this.ui.dropdown.style.left=`${t.left}px`;let i=()=>this._am();window.addEventListener("scroll",i,{signal:this.h.signal})}}}_y(){let t=this.h.signal;this._z(t),this._aa(t),this._ab(t),this._ac(t),this.options.countrySearch&&this._ad(t)}_z(t){let e=i=>{let n=i.target?.closest(`.${h.COUNTRY_ITEM}`);n&&this.ui.highlightListItem(n,!1)};this.ui.countryList.addEventListener("mouseover",e,{signal:t})}_aa(t){let e=i=>{let n=i.target?.closest(`.${h.COUNTRY_ITEM}`);n&&this._al(n)};this.ui.countryList.addEventListener("click",e,{signal:t})}_ab(t){let e=i=>{!!i.target.closest(`#iti-${this.id}__dropdown-content`)||this._am()};setTimeout(()=>{document.documentElement.addEventListener("click",e,{signal:t})},0)}_ac(t){let e="",i=null,n=s=>{[y.ARROW_UP,y.ARROW_DOWN,y.ENTER,y.ESC].includes(s.key)&&(s.preventDefault(),s.stopPropagation(),s.key===y.ARROW_UP||s.key===y.ARROW_DOWN?this._af(s.key):s.key===y.ENTER?this._ag():s.key===y.ESC&&this._am()),!this.options.countrySearch&&N.HIDDEN_SEARCH_CHAR.test(s.key)&&(s.stopPropagation(),i&&clearTimeout(i),e+=s.key.toLowerCase(),this._q(e),i=setTimeout(()=>{e=""},X.HIDDEN_SEARCH_RESET_MS))};document.addEventListener("keydown",n,{signal:t})}_ad(t){let e=()=>{let o=this.ui.searchInput.value.trim();this._ae(o),this.ui.searchInput.value?this.ui.k.classList.remove(h.HIDE):this.ui.k.classList.add(h.HIDE)},i=null,n=()=>{i&&clearTimeout(i),i=setTimeout(()=>{e(),i=null},100)};this.ui.searchInput.addEventListener("input",n,{signal:t});let s=()=>{this.ui.searchInput.value="",this.ui.searchInput.focus(),e()};this.ui.k.addEventListener("click",s,{signal:t})}_q(t){let e=tt(this.countries,t);if(e){let i=e.nodeById[this.id];this.ui.highlightListItem(i,!1),this.ui.scrollTo(i)}}_ae(t){let e;t===""?e=this.countries:e=Z(this.countries,t),this.ui.filterCountries(e)}_af(t){let e=t===y.ARROW_UP?this.ui.highlightedItem?.previousElementSibling:this.ui.highlightedItem?.nextElementSibling;!e&&this.ui.countryList.childElementCount>1&&(e=t===y.ARROW_UP?this.ui.countryList.lastElementChild:this.ui.countryList.firstElementChild),e&&(this.ui.scrollTo(e),this.ui.highlightListItem(e,!1))}_ag(){this.ui.highlightedItem&&this._al(this.ui.highlightedItem)}_ah(t){let e=t;if(this.options.formatOnDisplay&&l.utils&&this.selectedCountryData){let i=this.options.nationalMode||!e.startsWith("+")&&!this.options.separateDialCode,{NATIONAL:n,INTERNATIONAL:s}=l.utils.numberFormat,o=i?n:s;e=l.utils.formatNumber(e,this.selectedCountryData.iso2,o)}e=this._aq(e),this.ui.telInput.value=e}_ai(t){let e=this._s(t);return e!==null?this._aj(e):!1}_r(t){let{dialCode:e,nationalPrefix:i}=this.selectedCountryData;if(t.startsWith("+")||!e)return t;let o=i&&t.startsWith(i)&&!this.options.separateDialCode?t.substring(1):t;return`+${e}${o}`}_s(t){let e=t.indexOf("+"),i=e?t.substring(e):t,n=this.selectedCountryData.iso2,s=this.selectedCountryData.dialCode;i=this._r(i);let o=this._ao(i,!0),a=D(i);if(o){let u=D(o),d=this.dialCodeToIso2Map[u];if(d.length===1)return d[0]===n?null:d[0];if(!n&&this.f&&d.includes(this.f))return this.f;if(s===M.NANP&&z(a))return null;let{areaCodes:m,priority:g}=this.selectedCountryData;if(m){let I=m.map(v=>`${s}${v}`);for(let v of I)if(a.startsWith(v))return null}let b=m&&!(g===0)&&a.length>u.length,_=n&&d.includes(n)&&!b,f=n===d[0];if(!_&&!f)return d[0]}else{if(i.startsWith("+")&&a.length)return"";if((!i||i==="+")&&!n)return this.f}return null}_aj(t){let{separateDialCode:e,showFlags:i,i18n:n}=this.options,s=this.selectedCountryData.iso2||"";if(this.selectedCountryData=t?this.j.get(t):{},this.selectedCountryData.iso2&&(this.f=this.selectedCountryData.iso2),this.ui.selectedCountry){let o=t&&i?`${h.FLAG} iti__${t}`:`${h.FLAG} ${h.GLOBE}`,a,u;if(t){let{name:d,dialCode:c}=this.selectedCountryData;u=d,a=n.selectedCountryAriaLabel.replace("${countryName}",d).replace("${dialCode}",`+${c}`)}else u=n.noCountrySelected,a=n.noCountrySelected;this.ui.selectedCountryInner.className=o,this.ui.selectedCountry.setAttribute("title",u),this.ui.selectedCountry.setAttribute(p.LABEL,a)}if(e){let o=this.selectedCountryData.dialCode?`+${this.selectedCountryData.dialCode}`:"";this.ui.selectedDialCode.textContent=o,this.ui.updateInputPadding()}return this._ak(),this._t(),s!==t}_t(){let{strictMode:t,placeholderNumberType:e,validationNumberTypes:i}=this.options,{iso2:n}=this.selectedCountryData;if(t&&l.utils)if(n){let s=l.utils.numberType[e],o=l.utils.getExampleNumber(n,!1,s,!0),a=o;for(;l.utils.isPossibleNumber(o,n,i);)a=o,o+="0";let u=l.utils.getCoreNumber(a,n);this.n=u.length,n==="by"&&(this.n=u.length+1)}else this.n=null}_ak(){let{autoPlaceholder:t,placeholderNumberType:e,nationalMode:i,customPlaceholder:n}=this.options,s=t===A.AGGRESSIVE||!this.ui.a&&t===A.POLITE;if(l.utils&&s){let o=l.utils.numberType[e],a=this.selectedCountryData.iso2?l.utils.getExampleNumber(this.selectedCountryData.iso2,i,o):"";a=this._aq(a),typeof n=="function"&&(a=n(a,this.selectedCountryData)),this.ui.telInput.setAttribute("placeholder",a)}}_al(t){let e=t.dataset[$.COUNTRY_CODE],i=this._aj(e);this._am();let n=t.dataset[$.DIAL_CODE];this._an(n),this.options.formatOnDisplay&&this._ah(this.ui.telInput.value),this.ui.telInput.focus(),i&&this._ar()}_am(){this.ui.dropdownContent.classList.contains(h.HIDE)||(this.ui.dropdownContent.classList.add(h.HIDE),this.ui.selectedCountry.setAttribute(p.EXPANDED,"false"),this.ui.highlightedItem&&this.ui.highlightedItem.setAttribute(p.SELECTED,"false"),this.options.countrySearch&&this.ui.searchInput.removeAttribute(p.ACTIVE_DESCENDANT),this.ui.dropdownArrow.classList.remove(h.ARROW_UP),this.h.abort(),this.h=null,this.options.dropdownContainer&&this.ui.dropdown.remove(),this._as(w.CLOSE_COUNTRY_DROPDOWN))}_an(t){let e=this.ui.telInput.value,i=`+${t}`,n;if(e.startsWith("+")){let s=this._ao(e);s?n=e.replace(s,i):n=i,this.ui.telInput.value=n}}_ao(t,e){let i="";if(t.startsWith("+")){let n="";for(let s=0;s<t.length;s++){let o=t.charAt(s);if(/[0-9]/.test(o)){if(n+=o,!!!this.dialCodeToIso2Map[n])break;if(e)i=t.substring(0,s+1);else if(this.dialCodes.has(n)){i=t.substring(0,s+1);break}if(n.length===this.dialCodeMaxLen)break}}}return i}_ap(t){let e=t||this.ui.telInput.value.trim(),{dialCode:i}=this.selectedCountryData,n,s=D(e);return this.options.separateDialCode&&!e.startsWith("+")&&i&&s?n=`+${i}`:n="",n+e}_aq(t){let e=this._ao(t),i=lt(t,e,this.options.separateDialCode,this.selectedCountryData);return this._k(i)}_ar(){this._as(w.COUNTRY_CHANGE)}handleAutoCountry(){this.options.initialCountry===x.AUTO&&l.autoCountry&&(this.f=l.autoCountry,this.selectedCountryData.iso2||this.ui.selectedCountryInner.classList.contains(h.GLOBE)||this.setCountry(this.f),this.b())}handleUtils(){l.utils&&(this.ui.telInput.value&&this._ah(this.ui.telInput.value),this.selectedCountryData.iso2&&(this._ak(),this._t())),this.d()}destroy(){this.ui.telInput&&(this.options.allowDropdown&&this._am(),this.g.abort(),this.g=null,this.ui.destroy(),l.instances instanceof Map?l.instances.delete(this.id):delete l.instances[this.id])}getExtension(){return l.utils?l.utils.getExtension(this._ap(),this.selectedCountryData.iso2):""}getNumber(t){if(l.utils){let{iso2:e}=this.selectedCountryData;return l.utils.formatNumber(this._ap(),e,t)}return""}getNumberType(){return l.utils?l.utils.getNumberType(this._ap(),this.selectedCountryData.iso2):F.UNKNOWN_NUMBER_TYPE}getSelectedCountryData(){return this.selectedCountryData}getValidationError(){if(l.utils){let{iso2:t}=this.selectedCountryData;return l.utils.getValidationError(this._ap(),t)}return F.UNKNOWN_VALIDATION_ERROR}isValidNumber(){let{dialCode:t,iso2:e}=this.selectedCountryData;if(t===O.DIAL_CODE&&l.utils){let i=this._ap(),n=l.utils.getCoreNumber(i,e);if(n[0]===O.MOBILE_PREFIX&&n.length!==O.MOBILE_CORE_LENGTH)return!1}return this._v(!1)}isValidNumberPrecise(){return this._v(!0)}_u(t){return l.utils?l.utils.isPossibleNumber(t,this.selectedCountryData.iso2,this.options.validationNumberTypes):null}_v(t){if(!l.utils)return null;if(!this.selectedCountryData.iso2)return!1;let e=o=>t?this._w(o):this._u(o),i=this._ap(),n=i.search(N.ALPHA_UNICODE);if(n>-1&&!this.options.allowPhonewords){let o=i.substring(0,n),a=e(o),u=e(i);return a&&u}return e(i)}_w(t){return l.utils?l.utils.isValidNumber(t,this.selectedCountryData.iso2,this.options.validationNumberTypes):null}setCountry(t){let e=t?.toLowerCase();if(!V(e))throw new Error(`Invalid country code: '${e}'`);let i=this.selectedCountryData.iso2;(t&&e!==i||!t&&i)&&(this._aj(e),this._an(this.selectedCountryData.dialCode),this.options.formatOnDisplay&&this._ah(this.ui.telInput.value),this._ar())}setNumber(t){let e=this._ai(t);this._ah(t),e&&this._ar(),this._as(w.INPUT,{isSetNumber:!0})}setPlaceholderNumberType(t){this.options.placeholderNumberType=t,this._ak()}setDisabled(t){this.ui.telInput.disabled=t,t?this.ui.selectedCountry.setAttribute("disabled","true"):this.ui.selectedCountry.removeAttribute("disabled")}},Dt=r=>{if(!l.utils&&!l.startedLoadingUtilsScript){let t;if(typeof r=="function")try{t=Promise.resolve(r())}catch(e){return Promise.reject(e)}else return Promise.reject(new TypeError(`The argument passed to attachUtils must be a function that returns a promise for the utilities module, not ${typeof r}`));return l.startedLoadingUtilsScript=!0,t.then(e=>{let i=e?.default;if(!i||typeof i!="object")throw new TypeError("The loader function passed to attachUtils did not resolve to a module object with utils as its default export.");return l.utils=i,S("handleUtils"),!0}).catch(e=>{throw S("rejectUtilsScriptPromise",e),e})}return null},S=(r,...t)=>{Object.values(l.instances).forEach(e=>{let i=e[r];typeof i=="function"&&i.apply(e,t)})},l=Object.assign((r,t)=>{let e=new k(r,t);return l.instances[e.id]=e,r.iti=e,e},{defaults:K,documentReady:()=>document.readyState==="complete",getCountryData:()=>L,getInstance:r=>{let t=r.dataset.intlTelInputId;return t?l.instances[t]:null},instances:{},attachUtils:Dt,startedLoadingUtilsScript:!1,startedLoadingAutoCountry:!1,version:"25.11.3"}),wt=l;return ft(At);})();
|
|
28
28
|
|
|
29
29
|
// UMD
|
|
30
30
|
return factoryOutput.default;
|