intl-tel-input 27.1.0 → 27.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  See the Github Releases page for changelog: https://github.com/jackocnr/intl-tel-input/releases
2
2
 
3
- Or to view a specific version, e.g. v27.1.0, update the URL accordingly, e.g. https://github.com/jackocnr/intl-tel-input/releases/tag/v27.1.0
3
+ Or to view a specific version, e.g. v27.1.2, update the URL accordingly, e.g. https://github.com/jackocnr/intl-tel-input/releases/tag/v27.1.2
4
4
 
5
5
  ## Breaking changes
6
6
 
@@ -10,11 +10,12 @@ var rawCountryData = [
10
10
  ],
11
11
  [
12
12
  "ax",
13
- // Åland Islands
13
+ // Åland Islands (AKA Aland Islands)
14
14
  "358",
15
15
  1,
16
16
  ["18", "4"],
17
17
  // (4 is a mobile range shared with FI)
18
+ // NOTE: https://en.wikipedia.org/wiki/Telephone%20numbers%20in%20%C3%85land says some 4XXX ranges (e.g. 4570) are specific to AX, but LPN doesn't respect this (https://libphonenumber.appspot.com/phonenumberparser?number=%2B3584570123456 says region=FI) so we won't either. Also it's too much of a maintenance burden to keep track of. Keep the 4 area code range here so that if the user selects AX and types this kind of number, we wont change the flag to FI. Whereas if they type a FI-only range then we will.
18
19
  "0"
19
20
  ],
20
21
  [
@@ -3572,6 +3573,9 @@ var Iti = class _Iti {
3572
3573
  this.#updateSelectedCountry(US.ISO2);
3573
3574
  }
3574
3575
  } else {
3576
+ if (isValidInitialCountry) {
3577
+ this.#updateSelectedCountry(resolvedInitialCountry);
3578
+ }
3575
3579
  this.#updateCountryFromNumber(value);
3576
3580
  }
3577
3581
  } else if (isValidInitialCountry) {
@@ -3654,6 +3658,14 @@ var Iti = class _Iti {
3654
3658
  this.#openDropdown();
3655
3659
  this.#ui.prefillSearchWithPlus();
3656
3660
  }
3661
+ //* Delete the character just typed (the one immediately before the caret). Used by Android workarounds where we can't preventDefault on keydown.
3662
+ #removeJustTypedChar(inputValue) {
3663
+ const currentCaretPos = this.#ui.telInputEl.selectionStart || 0;
3664
+ const valueBeforeCaret = inputValue.substring(0, currentCaretPos - 1);
3665
+ const valueAfterCaret = inputValue.substring(currentCaretPos);
3666
+ this.#setTelInputValue(valueBeforeCaret + valueAfterCaret);
3667
+ return currentCaretPos - 1;
3668
+ }
3657
3669
  //* Initialize the tel input listeners.
3658
3670
  #bindAllTelInputListeners() {
3659
3671
  this.#bindInputListener();
@@ -3678,13 +3690,20 @@ var Iti = class _Iti {
3678
3690
  }
3679
3691
  const inputValue = this.#getTelInputValue();
3680
3692
  if (this.#isAndroid && e?.data === "+" && separateDialCode && allowDropdown && countrySearch) {
3681
- const currentCaretPos = this.#ui.telInputEl.selectionStart || 0;
3682
- const valueBeforeCaret = inputValue.substring(0, currentCaretPos - 1);
3683
- const valueAfterCaret = inputValue.substring(currentCaretPos);
3684
- this.#setTelInputValue(valueBeforeCaret + valueAfterCaret);
3693
+ this.#removeJustTypedChar(inputValue);
3685
3694
  this.#openDropdownWithPlus();
3686
3695
  return;
3687
3696
  }
3697
+ if (this.#isAndroid && strictMode && (e?.data === " " || e?.data === "-" || e?.data === ".")) {
3698
+ const newCaretPos = this.#removeJustTypedChar(inputValue);
3699
+ this.#ui.telInputEl.setSelectionRange(newCaretPos, newCaretPos);
3700
+ this.#dispatchEvent(EVENTS.STRICT_REJECT, {
3701
+ source: "key",
3702
+ rejectedInput: e.data,
3703
+ reason: "invalid"
3704
+ });
3705
+ return;
3706
+ }
3688
3707
  if (this.#updateCountryFromNumber(inputValue)) {
3689
3708
  this.#dispatchCountryChangeEvent();
3690
3709
  }
@@ -4457,7 +4476,7 @@ var attachUtils = (source) => {
4457
4476
  } else {
4458
4477
  return Promise.reject(
4459
4478
  new TypeError(
4460
- `The argument passed to attachUtils must be a function that returns a promise for the utilities module, not ${typeof source}`
4479
+ `The argument passed to attachUtils must be a function that returns a promise for the utils module, not ${typeof source}`
4461
4480
  )
4462
4481
  );
4463
4482
  }
@@ -4502,7 +4521,7 @@ var intlTelInput = Object.assign(
4502
4521
  attachUtils,
4503
4522
  startedLoadingUtils: false,
4504
4523
  startedLoadingAutoCountry: false,
4505
- version: "27.1.0"
4524
+ version: "27.1.2"
4506
4525
  }
4507
4526
  );
4508
4527
  var intlTelInput_default = intlTelInput;
@@ -10,11 +10,12 @@ var rawCountryData = [
10
10
  ],
11
11
  [
12
12
  "ax",
13
- // Åland Islands
13
+ // Åland Islands (AKA Aland Islands)
14
14
  "358",
15
15
  1,
16
16
  ["18", "4"],
17
17
  // (4 is a mobile range shared with FI)
18
+ // NOTE: https://en.wikipedia.org/wiki/Telephone%20numbers%20in%20%C3%85land says some 4XXX ranges (e.g. 4570) are specific to AX, but LPN doesn't respect this (https://libphonenumber.appspot.com/phonenumberparser?number=%2B3584570123456 says region=FI) so we won't either. Also it's too much of a maintenance burden to keep track of. Keep the 4 area code range here so that if the user selects AX and types this kind of number, we wont change the flag to FI. Whereas if they type a FI-only range then we will.
18
19
  "0"
19
20
  ],
20
21
  [
@@ -3572,6 +3573,9 @@ var Iti = class _Iti {
3572
3573
  this.#updateSelectedCountry(US.ISO2);
3573
3574
  }
3574
3575
  } else {
3576
+ if (isValidInitialCountry) {
3577
+ this.#updateSelectedCountry(resolvedInitialCountry);
3578
+ }
3575
3579
  this.#updateCountryFromNumber(value);
3576
3580
  }
3577
3581
  } else if (isValidInitialCountry) {
@@ -3654,6 +3658,14 @@ var Iti = class _Iti {
3654
3658
  this.#openDropdown();
3655
3659
  this.#ui.prefillSearchWithPlus();
3656
3660
  }
3661
+ //* Delete the character just typed (the one immediately before the caret). Used by Android workarounds where we can't preventDefault on keydown.
3662
+ #removeJustTypedChar(inputValue) {
3663
+ const currentCaretPos = this.#ui.telInputEl.selectionStart || 0;
3664
+ const valueBeforeCaret = inputValue.substring(0, currentCaretPos - 1);
3665
+ const valueAfterCaret = inputValue.substring(currentCaretPos);
3666
+ this.#setTelInputValue(valueBeforeCaret + valueAfterCaret);
3667
+ return currentCaretPos - 1;
3668
+ }
3657
3669
  //* Initialize the tel input listeners.
3658
3670
  #bindAllTelInputListeners() {
3659
3671
  this.#bindInputListener();
@@ -3678,13 +3690,20 @@ var Iti = class _Iti {
3678
3690
  }
3679
3691
  const inputValue = this.#getTelInputValue();
3680
3692
  if (this.#isAndroid && e?.data === "+" && separateDialCode && allowDropdown && countrySearch) {
3681
- const currentCaretPos = this.#ui.telInputEl.selectionStart || 0;
3682
- const valueBeforeCaret = inputValue.substring(0, currentCaretPos - 1);
3683
- const valueAfterCaret = inputValue.substring(currentCaretPos);
3684
- this.#setTelInputValue(valueBeforeCaret + valueAfterCaret);
3693
+ this.#removeJustTypedChar(inputValue);
3685
3694
  this.#openDropdownWithPlus();
3686
3695
  return;
3687
3696
  }
3697
+ if (this.#isAndroid && strictMode && (e?.data === " " || e?.data === "-" || e?.data === ".")) {
3698
+ const newCaretPos = this.#removeJustTypedChar(inputValue);
3699
+ this.#ui.telInputEl.setSelectionRange(newCaretPos, newCaretPos);
3700
+ this.#dispatchEvent(EVENTS.STRICT_REJECT, {
3701
+ source: "key",
3702
+ rejectedInput: e.data,
3703
+ reason: "invalid"
3704
+ });
3705
+ return;
3706
+ }
3688
3707
  if (this.#updateCountryFromNumber(inputValue)) {
3689
3708
  this.#dispatchCountryChangeEvent();
3690
3709
  }
@@ -4457,7 +4476,7 @@ var attachUtils = (source) => {
4457
4476
  } else {
4458
4477
  return Promise.reject(
4459
4478
  new TypeError(
4460
- `The argument passed to attachUtils must be a function that returns a promise for the utilities module, not ${typeof source}`
4479
+ `The argument passed to attachUtils must be a function that returns a promise for the utils module, not ${typeof source}`
4461
4480
  )
4462
4481
  );
4463
4482
  }
@@ -4502,7 +4521,7 @@ var intlTelInput = Object.assign(
4502
4521
  attachUtils,
4503
4522
  startedLoadingUtils: false,
4504
4523
  startedLoadingAutoCountry: false,
4505
- version: "27.1.0"
4524
+ version: "27.1.2"
4506
4525
  }
4507
4526
  );
4508
4527
  var intlTelInput_default = intlTelInput;
package/dist/js/data.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * International Telephone Input v27.1.0
2
+ * International Telephone Input v27.1.2
3
3
  * git+https://github.com/jackocnr/intl-tel-input.git
4
4
  * Licensed under the MIT license
5
5
  */
@@ -42,11 +42,12 @@ var _factory = (() => {
42
42
  ],
43
43
  [
44
44
  "ax",
45
- // Åland Islands
45
+ // Åland Islands (AKA Aland Islands)
46
46
  "358",
47
47
  1,
48
48
  ["18", "4"],
49
49
  // (4 is a mobile range shared with FI)
50
+ // NOTE: https://en.wikipedia.org/wiki/Telephone%20numbers%20in%20%C3%85land says some 4XXX ranges (e.g. 4570) are specific to AX, but LPN doesn't respect this (https://libphonenumber.appspot.com/phonenumberparser?number=%2B3584570123456 says region=FI) so we won't either. Also it's too much of a maintenance burden to keep track of. Keep the 4 area code range here so that if the user selects AX and types this kind of number, we wont change the flag to FI. Whereas if they type a FI-only range then we will.
50
51
  "0"
51
52
  ],
52
53
  [
@@ -1,5 +1,5 @@
1
1
  /*
2
- * International Telephone Input v27.1.0
2
+ * International Telephone Input v27.1.2
3
3
  * git+https://github.com/jackocnr/intl-tel-input.git
4
4
  * Licensed under the MIT license
5
5
  */
package/dist/js/data.mjs CHANGED
@@ -10,11 +10,12 @@ var rawCountryData = [
10
10
  ],
11
11
  [
12
12
  "ax",
13
- // Åland Islands
13
+ // Åland Islands (AKA Aland Islands)
14
14
  "358",
15
15
  1,
16
16
  ["18", "4"],
17
17
  // (4 is a mobile range shared with FI)
18
+ // NOTE: https://en.wikipedia.org/wiki/Telephone%20numbers%20in%20%C3%85land says some 4XXX ranges (e.g. 4570) are specific to AX, but LPN doesn't respect this (https://libphonenumber.appspot.com/phonenumberparser?number=%2B3584570123456 says region=FI) so we won't either. Also it's too much of a maintenance burden to keep track of. Keep the 4 area code range here so that if the user selects AX and types this kind of number, we wont change the flag to FI. Whereas if they type a FI-only range then we will.
18
19
  "0"
19
20
  ],
20
21
  [
@@ -1,5 +1,5 @@
1
1
  /*
2
- * International Telephone Input v27.1.0
2
+ * International Telephone Input v27.1.2
3
3
  * git+https://github.com/jackocnr/intl-tel-input.git
4
4
  * Licensed under the MIT license
5
5
  */
@@ -42,11 +42,12 @@ var _factory = (() => {
42
42
  ],
43
43
  [
44
44
  "ax",
45
- // Åland Islands
45
+ // Åland Islands (AKA Aland Islands)
46
46
  "358",
47
47
  1,
48
48
  ["18", "4"],
49
49
  // (4 is a mobile range shared with FI)
50
+ // NOTE: https://en.wikipedia.org/wiki/Telephone%20numbers%20in%20%C3%85land says some 4XXX ranges (e.g. 4570) are specific to AX, but LPN doesn't respect this (https://libphonenumber.appspot.com/phonenumberparser?number=%2B3584570123456 says region=FI) so we won't either. Also it's too much of a maintenance burden to keep track of. Keep the 4 area code range here so that if the user selects AX and types this kind of number, we wont change the flag to FI. Whereas if they type a FI-only range then we will.
50
51
  "0"
51
52
  ],
52
53
  [
@@ -3634,6 +3635,9 @@ var _factory = (() => {
3634
3635
  this.#updateSelectedCountry(US.ISO2);
3635
3636
  }
3636
3637
  } else {
3638
+ if (isValidInitialCountry) {
3639
+ this.#updateSelectedCountry(resolvedInitialCountry);
3640
+ }
3637
3641
  this.#updateCountryFromNumber(value);
3638
3642
  }
3639
3643
  } else if (isValidInitialCountry) {
@@ -3716,6 +3720,14 @@ var _factory = (() => {
3716
3720
  this.#openDropdown();
3717
3721
  this.#ui.prefillSearchWithPlus();
3718
3722
  }
3723
+ //* Delete the character just typed (the one immediately before the caret). Used by Android workarounds where we can't preventDefault on keydown.
3724
+ #removeJustTypedChar(inputValue) {
3725
+ const currentCaretPos = this.#ui.telInputEl.selectionStart || 0;
3726
+ const valueBeforeCaret = inputValue.substring(0, currentCaretPos - 1);
3727
+ const valueAfterCaret = inputValue.substring(currentCaretPos);
3728
+ this.#setTelInputValue(valueBeforeCaret + valueAfterCaret);
3729
+ return currentCaretPos - 1;
3730
+ }
3719
3731
  //* Initialize the tel input listeners.
3720
3732
  #bindAllTelInputListeners() {
3721
3733
  this.#bindInputListener();
@@ -3740,13 +3752,20 @@ var _factory = (() => {
3740
3752
  }
3741
3753
  const inputValue = this.#getTelInputValue();
3742
3754
  if (this.#isAndroid && e?.data === "+" && separateDialCode && allowDropdown && countrySearch) {
3743
- const currentCaretPos = this.#ui.telInputEl.selectionStart || 0;
3744
- const valueBeforeCaret = inputValue.substring(0, currentCaretPos - 1);
3745
- const valueAfterCaret = inputValue.substring(currentCaretPos);
3746
- this.#setTelInputValue(valueBeforeCaret + valueAfterCaret);
3755
+ this.#removeJustTypedChar(inputValue);
3747
3756
  this.#openDropdownWithPlus();
3748
3757
  return;
3749
3758
  }
3759
+ if (this.#isAndroid && strictMode && (e?.data === " " || e?.data === "-" || e?.data === ".")) {
3760
+ const newCaretPos = this.#removeJustTypedChar(inputValue);
3761
+ this.#ui.telInputEl.setSelectionRange(newCaretPos, newCaretPos);
3762
+ this.#dispatchEvent(EVENTS.STRICT_REJECT, {
3763
+ source: "key",
3764
+ rejectedInput: e.data,
3765
+ reason: "invalid"
3766
+ });
3767
+ return;
3768
+ }
3750
3769
  if (this.#updateCountryFromNumber(inputValue)) {
3751
3770
  this.#dispatchCountryChangeEvent();
3752
3771
  }
@@ -4519,7 +4538,7 @@ var _factory = (() => {
4519
4538
  } else {
4520
4539
  return Promise.reject(
4521
4540
  new TypeError(
4522
- `The argument passed to attachUtils must be a function that returns a promise for the utilities module, not ${typeof source}`
4541
+ `The argument passed to attachUtils must be a function that returns a promise for the utils module, not ${typeof source}`
4523
4542
  )
4524
4543
  );
4525
4544
  }
@@ -4564,7 +4583,7 @@ var _factory = (() => {
4564
4583
  attachUtils,
4565
4584
  startedLoadingUtils: false,
4566
4585
  startedLoadingAutoCountry: false,
4567
- version: "27.1.0"
4586
+ version: "27.1.2"
4568
4587
  }
4569
4588
  );
4570
4589
  var intlTelInput_default = intlTelInput;
@@ -1,9 +1,9 @@
1
1
  /*
2
- * International Telephone Input v27.1.0
2
+ * International Telephone Input v27.1.2
3
3
  * git+https://github.com/jackocnr/intl-tel-input.git
4
4
  * Licensed under the MIT license
5
5
  */
6
- "use strict";var _factory=(()=>{var X=Object.defineProperty;var Dt=Object.getOwnPropertyDescriptor;var _t=Object.getOwnPropertyNames;var Ot=Object.prototype.hasOwnProperty;var St=(n,t)=>{for(var e in t)X(n,e,{get:t[e],enumerable:!0})},Pt=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of _t(t))!Ot.call(n,s)&&s!==e&&X(n,s,{get:()=>t[s],enumerable:!(i=Dt(t,s))||i.enumerable});return n};var Rt=n=>Pt(X({},"__esModule",{value:!0}),n);var Kt={};St(Kt,{Iti:()=>U,default:()=>Gt});var Mt=[["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"]],q=[];for(let n of Mt)q.push({name:"",iso2:n[0],dialCode:n[1],priority:n[2]||0,areaCodes:n[3]||null,nationalPrefix:n[4]||null,normalisedName:"",initials:"",dialCodePlus:""});var xt=new Set(q.map(n=>n.iso2)),S=n=>xt.has(n),M=q;var L={OPEN_COUNTRY_DROPDOWN:"open:countrydropdown",CLOSE_COUNTRY_DROPDOWN:"close:countrydropdown",COUNTRY_CHANGE:"countrychange",INPUT:"input",STRICT_REJECT:"strict:reject"},h={HIDE:"iti__hide",V_HIDE:"iti__v-hide",ARROW_UP:"iti__arrow--up",GLOBE:"iti__globe",FLAG:"iti__flag",LOADING:"iti__loading",COUNTRY_ITEM:"iti__country",HIGHLIGHT:"iti__highlight"},E={ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",SPACE:" ",ENTER:"Enter",ESC:"Escape",TAB:"Tab"},J={PASTE:"insertFromPaste",DELETE_FORWARD:"deleteContentForward"},v={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},Z={UNKNOWN_NUMBER_TYPE:-99,UNKNOWN_VALIDATION_ERROR:-99},A={NARROW_VIEWPORT_WIDTH:500,FALLBACK_SELECTED_WITH_DIAL_WIDTH:78,FALLBACK_SELECTED_NO_DIAL_WIDTH:42,INPUT_PADDING_EXTRA_LEFT:6,DROPDOWN_MARGIN:3,FALLBACK_DROPDOWN_HEIGHT:200},B={PLUS:"+",NANP:"1"},V={ISO2:"gb",DIAL_CODE:"44",MOBILE_PREFIX:"7",MOBILE_CORE_LENGTH:10},ot={ISO2:"us",DIAL_CODE:"1"},x={AGGRESSIVE:"aggressive",POLITE:"polite",OFF:"off"},W={AUTO:"auto"},Ht=["FIXED_LINE","MOBILE","FIXED_LINE_OR_MOBILE","TOLL_FREE","PREMIUM_RATE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL","UNKNOWN"],$=new Set(Ht),w={ISO2:"countryCode",DIAL_CODE:"dialCode",INSTANCE_ID:"intlTelInputId"},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 kt={selectedCountryAriaLabel:"Change country for phone number, currently selected ${countryName} (${dialCode})",noCountrySelected:"Select country for phone number",countryListAriaLabel:"List of countries",searchPlaceholder:"Search",clearSearchAriaLabel:"Clear search",searchEmptyState:"No results found",searchSummaryAria(n){return n===0?"No results found":n===1?"1 result found":`${n} results found`}},lt=kt;var tt=n=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(n).matches,ct=()=>tt(`(max-width: ${A.NARROW_VIEWPORT_WIDTH}px)`),Ut=()=>{if(typeof navigator<"u"&&typeof window<"u"){let n=tt("(max-height: 600px)"),t=tt("(pointer: coarse)");return ct()||t&&n}return!1},G={allowDropdown:!0,allowedNumberTypes:["MOBILE","FIXED_LINE"],allowNumberExtensions:!1,allowPhonewords:!1,autoPlaceholder:x.POLITE,containerClass:"",countryNameLocale:"en",countryOrder:null,countrySearch:!0,customPlaceholder:null,dropdownAlwaysOpen:!1,dropdownContainer:null,excludeCountries:null,fixDropdownWidth:!0,formatAsYouType:!0,formatOnDisplay:!0,geoIpLookup:null,hiddenInput:null,i18n:{},initialCountry:"",loadUtils:null,nationalMode:!0,onlyCountries:null,placeholderNumberType:"MOBILE",searchInputClass:"",separateDialCode:!1,showFlags:!0,strictMode:!1,useFullscreenPopup:Ut()},dt=n=>JSON.stringify(n),rt=n=>!!n&&typeof n=="object"&&!Array.isArray(n),Wt=n=>typeof n=="function",$t=n=>{if(!n||typeof n!="object")return!1;let t=n;return t.nodeType===1&&typeof t.tagName=="string"&&typeof t.appendChild=="function"},at=new Set(Object.values(x)),j=n=>{console.warn(`[intl-tel-input] ${n}`)},b=(n,t,e)=>{j(`Option '${n}' must be ${t}; got ${dt(e)}. Ignoring.`)},ut=(n,t)=>{let e="an array of iso2 country code strings";if(!Array.isArray(t))return b(n,e,t),!1;let i=[];for(let s of t){if(typeof s!="string")return b(n,e,t),!1;let o=s.toLowerCase();S(o)?i.push(s):j(`Invalid iso2 code in '${n}': '${s}'. Skipping.`)}return i},ht=n=>{if(n===void 0)return{};if(!rt(n)){let e=`The second argument must be an options object; got ${dt(n)}. Using defaults.`;return j(e),{}}let t={};for(let[e,i]of Object.entries(n)){if(!Object.hasOwn(G,e)){j(`Unknown option '${e}'. Ignoring.`);continue}switch(e){case"allowDropdown":case"allowNumberExtensions":case"allowPhonewords":case"countrySearch":case"dropdownAlwaysOpen":case"fixDropdownWidth":case"formatAsYouType":case"formatOnDisplay":case"nationalMode":case"showFlags":case"separateDialCode":case"strictMode":case"useFullscreenPopup":if(typeof i!="boolean"){b(e,"a boolean",i);break}t[e]=i;break;case"autoPlaceholder":if(typeof i!="string"||!at.has(i)){let s=Array.from(at).join(", ");b("autoPlaceholder",`one of ${s}`,i);break}t[e]=i;break;case"containerClass":case"searchInputClass":case"countryNameLocale":if(typeof i!="string"){b(e,"a string",i);break}t[e]=i;break;case"countryOrder":{if(i===null)t[e]=i;else{let s=ut(e,i);s!==!1&&(t[e]=s)}break}case"customPlaceholder":case"geoIpLookup":case"hiddenInput":case"loadUtils":if(i!==null&&!Wt(i)){b(e,"a function or null",i);break}t[e]=i;break;case"dropdownContainer":if(i!==null&&!$t(i)){b("dropdownContainer","an HTMLElement or null",i);break}t[e]=i;break;case"excludeCountries":case"onlyCountries":{if(i===null)t[e]=i;else{let s=ut(e,i);s!==!1&&(t[e]=s)}break}case"i18n":if(i&&!rt(i)){b("i18n","an object",i);break}t[e]=i;break;case"initialCountry":{if(typeof i!="string"){b("initialCountry","a string",i);break}let s=i.toLowerCase();if(s&&s!==W.AUTO&&!S(s)){b("initialCountry","a valid iso2 country code or 'auto'",i);break}t[e]=i;break}case"placeholderNumberType":if(typeof i!="string"||!$.has(i)){let s=Array.from($).join(", ");b("placeholderNumberType",`one of ${s}`,i);break}t[e]=i;break;case"allowedNumberTypes":if(i!==null){if(!Array.isArray(i)){b("allowedNumberTypes","an array of number types or null",i);break}let s=!0;for(let o of i)if(typeof o!="string"||!$.has(o)){let l=Array.from($).join(", ");b("allowedNumberTypes",`an array of valid number types (${l})`,o),s=!1;break}s&&(t[e]=i)}else t[e]=null;break}}return t},pt=n=>{n.initialCountry&&(n.initialCountry=n.initialCountry.toLowerCase()),n.onlyCountries?.length&&(n.onlyCountries=n.onlyCountries.map(t=>t.toLowerCase())),n.excludeCountries?.length&&(n.excludeCountries=n.excludeCountries.map(t=>t.toLowerCase())),n.countryOrder&&(n.countryOrder=n.countryOrder.map(t=>t.toLowerCase()))},ft=n=>{n.dropdownAlwaysOpen&&(n.useFullscreenPopup=!1,n.allowDropdown=!0),n.useFullscreenPopup?n.fixDropdownWidth=!1:ct()&&(n.fixDropdownWidth=!0),n.onlyCountries?.length===1&&(n.initialCountry=n.onlyCountries[0]),n.separateDialCode&&(n.nationalMode=!1),n.allowDropdown&&!n.showFlags&&!n.separateDialCode&&(n.nationalMode=!1),n.useFullscreenPopup&&!n.dropdownContainer&&(n.dropdownContainer=document.body),n.i18n={...lt,...n.i18n}};var N=n=>n.replace(/\D/g,""),F=(n="")=>n.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase();var K=n=>Object.keys(n).filter(t=>!!n[t]).join(" "),f=(n,t,e)=>{let i=document.createElement(n);return t&&Object.entries(t).forEach(([s,o])=>i.setAttribute(s,o)),e&&e.appendChild(i),i};var mt=()=>`
6
+ "use strict";var _factory=(()=>{var X=Object.defineProperty;var Dt=Object.getOwnPropertyDescriptor;var _t=Object.getOwnPropertyNames;var Ot=Object.prototype.hasOwnProperty;var St=(n,t)=>{for(var e in t)X(n,e,{get:t[e],enumerable:!0})},Rt=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of _t(t))!Ot.call(n,s)&&s!==e&&X(n,s,{get:()=>t[s],enumerable:!(i=Dt(t,s))||i.enumerable});return n};var Pt=n=>Rt(X({},"__esModule",{value:!0}),n);var Kt={};St(Kt,{Iti:()=>k,default:()=>Gt});var Mt=[["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"]],q=[];for(let n of Mt)q.push({name:"",iso2:n[0],dialCode:n[1],priority:n[2]||0,areaCodes:n[3]||null,nationalPrefix:n[4]||null,normalisedName:"",initials:"",dialCodePlus:""});var xt=new Set(q.map(n=>n.iso2)),O=n=>xt.has(n),P=q;var I={OPEN_COUNTRY_DROPDOWN:"open:countrydropdown",CLOSE_COUNTRY_DROPDOWN:"close:countrydropdown",COUNTRY_CHANGE:"countrychange",INPUT:"input",STRICT_REJECT:"strict:reject"},h={HIDE:"iti__hide",V_HIDE:"iti__v-hide",ARROW_UP:"iti__arrow--up",GLOBE:"iti__globe",FLAG:"iti__flag",LOADING:"iti__loading",COUNTRY_ITEM:"iti__country",HIGHLIGHT:"iti__highlight"},E={ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",SPACE:" ",ENTER:"Enter",ESC:"Escape",TAB:"Tab"},J={PASTE:"insertFromPaste",DELETE_FORWARD:"deleteContentForward"},v={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},Z={UNKNOWN_NUMBER_TYPE:-99,UNKNOWN_VALIDATION_ERROR:-99},A={NARROW_VIEWPORT_WIDTH:500,FALLBACK_SELECTED_WITH_DIAL_WIDTH:78,FALLBACK_SELECTED_NO_DIAL_WIDTH:42,INPUT_PADDING_EXTRA_LEFT:6,DROPDOWN_MARGIN:3,FALLBACK_DROPDOWN_HEIGHT:200},B={PLUS:"+",NANP:"1"},j={ISO2:"gb",DIAL_CODE:"44",MOBILE_PREFIX:"7",MOBILE_CORE_LENGTH:10},ot={ISO2:"us",DIAL_CODE:"1"},M={AGGRESSIVE:"aggressive",POLITE:"polite",OFF:"off"},U={AUTO:"auto"},Ht=["FIXED_LINE","MOBILE","FIXED_LINE_OR_MOBILE","TOLL_FREE","PREMIUM_RATE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL","UNKNOWN"],W=new Set(Ht),w={ISO2:"countryCode",DIAL_CODE:"dialCode",INSTANCE_ID:"intlTelInputId"},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 kt={selectedCountryAriaLabel:"Change country for phone number, currently selected ${countryName} (${dialCode})",noCountrySelected:"Select country for phone number",countryListAriaLabel:"List of countries",searchPlaceholder:"Search",clearSearchAriaLabel:"Clear search",searchEmptyState:"No results found",searchSummaryAria(n){return n===0?"No results found":n===1?"1 result found":`${n} results found`}},lt=kt;var tt=n=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(n).matches,ct=()=>tt(`(max-width: ${A.NARROW_VIEWPORT_WIDTH}px)`),Ut=()=>{if(typeof navigator<"u"&&typeof window<"u"){let n=tt("(max-height: 600px)"),t=tt("(pointer: coarse)");return ct()||t&&n}return!1},G={allowDropdown:!0,allowedNumberTypes:["MOBILE","FIXED_LINE"],allowNumberExtensions:!1,allowPhonewords:!1,autoPlaceholder:M.POLITE,containerClass:"",countryNameLocale:"en",countryOrder:null,countrySearch:!0,customPlaceholder:null,dropdownAlwaysOpen:!1,dropdownContainer:null,excludeCountries:null,fixDropdownWidth:!0,formatAsYouType:!0,formatOnDisplay:!0,geoIpLookup:null,hiddenInput:null,i18n:{},initialCountry:"",loadUtils:null,nationalMode:!0,onlyCountries:null,placeholderNumberType:"MOBILE",searchInputClass:"",separateDialCode:!1,showFlags:!0,strictMode:!1,useFullscreenPopup:Ut()},dt=n=>JSON.stringify(n),rt=n=>!!n&&typeof n=="object"&&!Array.isArray(n),Wt=n=>typeof n=="function",$t=n=>{if(!n||typeof n!="object")return!1;let t=n;return t.nodeType===1&&typeof t.tagName=="string"&&typeof t.appendChild=="function"},at=new Set(Object.values(M)),V=n=>{console.warn(`[intl-tel-input] ${n}`)},b=(n,t,e)=>{V(`Option '${n}' must be ${t}; got ${dt(e)}. Ignoring.`)},ut=(n,t)=>{let e="an array of iso2 country code strings";if(!Array.isArray(t))return b(n,e,t),!1;let i=[];for(let s of t){if(typeof s!="string")return b(n,e,t),!1;let o=s.toLowerCase();O(o)?i.push(s):V(`Invalid iso2 code in '${n}': '${s}'. Skipping.`)}return i},ht=n=>{if(n===void 0)return{};if(!rt(n)){let e=`The second argument must be an options object; got ${dt(n)}. Using defaults.`;return V(e),{}}let t={};for(let[e,i]of Object.entries(n)){if(!Object.hasOwn(G,e)){V(`Unknown option '${e}'. Ignoring.`);continue}switch(e){case"allowDropdown":case"allowNumberExtensions":case"allowPhonewords":case"countrySearch":case"dropdownAlwaysOpen":case"fixDropdownWidth":case"formatAsYouType":case"formatOnDisplay":case"nationalMode":case"showFlags":case"separateDialCode":case"strictMode":case"useFullscreenPopup":if(typeof i!="boolean"){b(e,"a boolean",i);break}t[e]=i;break;case"autoPlaceholder":if(typeof i!="string"||!at.has(i)){let s=Array.from(at).join(", ");b("autoPlaceholder",`one of ${s}`,i);break}t[e]=i;break;case"containerClass":case"searchInputClass":case"countryNameLocale":if(typeof i!="string"){b(e,"a string",i);break}t[e]=i;break;case"countryOrder":{if(i===null)t[e]=i;else{let s=ut(e,i);s!==!1&&(t[e]=s)}break}case"customPlaceholder":case"geoIpLookup":case"hiddenInput":case"loadUtils":if(i!==null&&!Wt(i)){b(e,"a function or null",i);break}t[e]=i;break;case"dropdownContainer":if(i!==null&&!$t(i)){b("dropdownContainer","an HTMLElement or null",i);break}t[e]=i;break;case"excludeCountries":case"onlyCountries":{if(i===null)t[e]=i;else{let s=ut(e,i);s!==!1&&(t[e]=s)}break}case"i18n":if(i&&!rt(i)){b("i18n","an object",i);break}t[e]=i;break;case"initialCountry":{if(typeof i!="string"){b("initialCountry","a string",i);break}let s=i.toLowerCase();if(s&&s!==U.AUTO&&!O(s)){b("initialCountry","a valid iso2 country code or 'auto'",i);break}t[e]=i;break}case"placeholderNumberType":if(typeof i!="string"||!W.has(i)){let s=Array.from(W).join(", ");b("placeholderNumberType",`one of ${s}`,i);break}t[e]=i;break;case"allowedNumberTypes":if(i!==null){if(!Array.isArray(i)){b("allowedNumberTypes","an array of number types or null",i);break}let s=!0;for(let o of i)if(typeof o!="string"||!W.has(o)){let l=Array.from(W).join(", ");b("allowedNumberTypes",`an array of valid number types (${l})`,o),s=!1;break}s&&(t[e]=i)}else t[e]=null;break}}return t},pt=n=>{n.initialCountry&&(n.initialCountry=n.initialCountry.toLowerCase()),n.onlyCountries?.length&&(n.onlyCountries=n.onlyCountries.map(t=>t.toLowerCase())),n.excludeCountries?.length&&(n.excludeCountries=n.excludeCountries.map(t=>t.toLowerCase())),n.countryOrder&&(n.countryOrder=n.countryOrder.map(t=>t.toLowerCase()))},ft=n=>{n.dropdownAlwaysOpen&&(n.useFullscreenPopup=!1,n.allowDropdown=!0),n.useFullscreenPopup?n.fixDropdownWidth=!1:ct()&&(n.fixDropdownWidth=!0),n.onlyCountries?.length===1&&(n.initialCountry=n.onlyCountries[0]),n.separateDialCode&&(n.nationalMode=!1),n.allowDropdown&&!n.showFlags&&!n.separateDialCode&&(n.nationalMode=!1),n.useFullscreenPopup&&!n.dropdownContainer&&(n.dropdownContainer=document.body),n.i18n={...lt,...n.i18n}};var N=n=>n.replace(/\D/g,""),$=(n="")=>n.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase();var K=n=>Object.keys(n).filter(t=>!!n[t]).join(" "),f=(n,t,e)=>{let i=document.createElement(n);return t&&Object.entries(t).forEach(([s,o])=>i.setAttribute(s,o)),e&&e.appendChild(i),i};var mt=()=>`
7
7
  <svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" ${p.HIDDEN}="true">
8
8
  <circle cx="11" cy="11" r="7" />
9
9
  <line x1="21" y1="21" x2="16.65" y2="16.65" />
@@ -21,5 +21,5 @@
21
21
  <svg width="256" height="256" viewBox="0 0 512 512" class="iti__globe-svg">
22
22
  <path d="M508 213a240 240 0 0 0-449-87l-2 5-2 5c-8 14-13 30-17 46a65 65 0 0 1 56 4c16-10 35-19 56-27l9-3c-6 23-10 48-10 74h-16l4 6c3 4 5 8 6 13h6c0 22 3 44 8 65l2 10-25-10-4 5 12 18 9 3 6 2 8 3 9 26 1 2 16-7h1l-5-13-1-2c24 6 49 9 75 10v26l11 10 7 7v-30l1-13c22 0 44-3 65-8l10-2-21 48-1 1a317 317 0 0 1-14 23l-21 5h-2c6 16 7 33 1 50a240 240 0 0 0 211-265m-401-56-11 6c19-44 54-79 98-98-11 20-21 44-29 69-21 6-40 15-58 23m154 182v4c-29-1-57-6-81-13-7-25-12-52-13-81h94zm0-109h-94c1-29 6-56 13-81 24-7 52-12 81-13zm0-112c-22 1-44 4-65 8l-10 2 12-30 9-17 1-2a332 332 0 0 1 13-23c13-4 26-6 40-7zm187 69 6 4c4 12 6 25 6 38v1h-68c-1-26-4-51-10-74l48 20 1 1 14 8zm-14-44 10 20c-20-11-43-21-68-29-8-25-18-49-29-69 37 16 67 44 87 78M279 49h1c13 1 27 3 39 7l14 23 1 2a343 343 0 0 1 12 26l2 5 6 16c-23-6-48-9-74-10h-1zm0 87h1c29 1 56 6 81 13 7 24 12 51 12 80v1h-94zm2 207h-2v-94h95c-1 29-6 56-13 81-24 7-51 12-80 13m86 60-20 10c11-20 21-43 29-68 25-8 48-18 68-29-16 37-43 67-77 87m87-115-7 5-16 9-2 1a337 337 0 0 1-47 21c6-24 9-49 10-75h68c0 13-2 27-6 39"/>
23
23
  <path d="m261 428-2-2-22-21a40 40 0 0 0-32-11h-1a37 37 0 0 0-18 8l-1 1-4 2-2 2-5 4c-9-3-36-31-47-44s-32-45-34-55l3-2a151 151 0 0 0 11-9v-1a39 39 0 0 0 5-48l-3-3-11-19-3-4-5-7h-1l-3-3-4-3-5-2a35 35 0 0 0-16-3h-5c-4 1-14 5-24 11l-4 2-4 3-4 2c-9 8-17 17-18 27a380 380 0 0 0 212 259h3c12 0 25-10 36-21l10-12 6-11a39 39 0 0 0-8-40"/>
24
- </svg>`;var Et=(n,t)=>{let e=F(t),i=[],s=[],o=[],l=[],r=[],a=[];for(let c of n)c.iso2===e?i.push(c):c.normalisedName.startsWith(e)?s.push(c):c.normalisedName.includes(e)?o.push(c):e===c.dialCode||e===c.dialCodePlus?l.push(c):c.dialCodePlus.includes(e)?r.push(c):c.initials.includes(e)&&a.push(c);let d=(c,m)=>c.priority-m.priority;return[...i,...s,...o,...l.sort(d),...r.sort(d),...a]},gt=(n,t)=>{let e=F(t);for(let i of n)if(i.normalisedName.startsWith(e))return i;return null};var H=class n{#t;#i;#N;#m="";#b;#L=null;#_;#f;#e;#a;#C;#o;#s;#h;#l;#u;#n;#c;#A;#v;#U;#r;#y=null;#d=null;#O=new Map;#w=null;telInputEl;hadInitialPlaceholder;constructor(t,e,i){t.dataset[w.INSTANCE_ID]=i.toString(),this.telInputEl=t,this.#t=e,this.#i=i,this.hadInitialPlaceholder=!!t.getAttribute("placeholder"),this.#N=!!this.telInputEl.closest("[dir=rtl]"),this.#m=this.telInputEl.style.paddingLeft}static validateInput(t){let e=t?.tagName;if(!(!!t&&typeof t=="object"&&e==="INPUT"&&typeof t.setAttribute=="function")){let s=Object.prototype.toString.call(t);throw new TypeError(`The first argument must be an HTMLInputElement, not ${s}`)}}buildMarkup(t){this.#b=t,this.telInputEl.classList.add("iti__tel-input"),this.telInputEl.hasAttribute("type")||this.telInputEl.setAttribute("type","tel"),this.telInputEl.hasAttribute("autocomplete")||this.telInputEl.setAttribute("autocomplete","tel"),this.telInputEl.hasAttribute("inputmode")||this.telInputEl.setAttribute("inputmode","tel");let e=this.#G();this.#K(e),e.appendChild(this.telInputEl),this.#X(),this.#p(e),this.ensureDropdownWidthSet()}#G(){let{allowDropdown:t,showFlags:e,containerClass:i,useFullscreenPopup:s}=this.#t,o=K({iti:!0,"iti--allow-dropdown":t,"iti--show-flags":e,"iti--inline-dropdown":!s,[i]:!!i}),l=f("div",{class:o});return this.#N&&l.setAttribute("dir","ltr"),this.telInputEl.before(l),l}#K(t){let{allowDropdown:e,separateDialCode:i,showFlags:s}=this.#t;if(!e&&!s&&!i)return;this.#f=f("div",{class:`iti__country-container ${h.V_HIDE}`},t),e?(this.#e=f("button",{type:"button",class:"iti__selected-country",[p.EXPANDED]:"false",[p.LABEL]:this.#t.i18n.noCountrySelected,[p.HASPOPUP]:"dialog",[p.CONTROLS]:`iti-${this.#i}__dropdown-content`},this.#f),this.telInputEl.disabled&&this.#e.setAttribute("disabled","true")):this.#e=f("div",{class:"iti__selected-country"},this.#f);let o=f("div",{class:"iti__selected-country-primary"},this.#e);this.#a=f("div",{class:h.FLAG},o),e&&(this.#o=f("div",{class:"iti__arrow",[p.HIDDEN]:"true"},o)),i&&(this.#C=f("div",{class:"iti__selected-dial-code"},this.#e)),e&&this.#Y()}ensureDropdownWidthSet(){let{fixDropdownWidth:t,allowDropdown:e}=this.#t;if(!e||!t||this.#s.style.width)return;let i=this.telInputEl.offsetWidth;i>0&&(this.#s.style.width=`${i}px`)}#Y(){let{fixDropdownWidth:t,useFullscreenPopup:e,countrySearch:i,i18n:s,dropdownContainer:o,containerClass:l}=this.#t,r=t?"":"iti--flexible-dropdown-width";if(this.#s=f("div",{id:`iti-${this.#i}__dropdown-content`,class:`iti__dropdown-content ${h.HIDE} ${r}`,role:"dialog",[p.MODAL]:"true"}),this.#N&&this.#s.setAttribute("dir","rtl"),i&&this.#z(),this.#n=f("ul",{class:"iti__country-list",id:`iti-${this.#i}__country-listbox`,role:"listbox",[p.LABEL]:s.countryListAriaLabel},this.#s),this.#x(),i&&this.#$(),e||(this.#_=this.#W(),i&&(this.#s.style.height=`${this.#_}px`)),o){let a=K({iti:!0,"iti--container":!0,"iti--fullscreen-popup":e,"iti--inline-dropdown":!e,[l]:!!l});this.#r=f("div",{class:a}),this.#r.appendChild(this.#s)}else this.#f.appendChild(this.#s)}#z(){let{i18n:t,searchInputClass:e}=this.#t,i=f("div",{class:"iti__search-input-wrapper"},this.#s);this.#h=f("span",{class:"iti__search-icon",[p.HIDDEN]:"true"},i),this.#h.innerHTML=mt(),this.#l=f("input",{id:`iti-${this.#i}__search-input`,type:"search",class:`iti__search-input ${e}`,placeholder:t.searchPlaceholder,role:"combobox",[p.EXPANDED]:"true",[p.LABEL]:t.searchPlaceholder,[p.CONTROLS]:`iti-${this.#i}__country-listbox`,[p.AUTOCOMPLETE]:"list",autocomplete:"off"},i),this.#u=f("button",{type:"button",class:`iti__search-clear ${h.HIDE}`,[p.LABEL]:t.clearSearchAriaLabel,tabindex:"-1"},i),this.#u.innerHTML=Ct(this.#i),this.#U=f("span",{class:"iti__a11y-text"},this.#s),this.#v=f("div",{class:`iti__no-results ${h.HIDE}`,[p.HIDDEN]:"true"},this.#s),this.#v.textContent=t.searchEmptyState??null}#X(){this.#f&&(this.#T(),this.#f.classList.remove(h.V_HIDE))}#p(t){let{hiddenInput:e}=this.#t;if(!e)return;let i=this.telInputEl.getAttribute("name")||"",s=e(i);if(s.phone){let o=this.telInputEl.form?.querySelector(`input[name="${s.phone}"]`);o?this.#c=o:(this.#c=f("input",{type:"hidden",name:s.phone}),t.appendChild(this.#c))}if(s.country){let o=this.telInputEl.form?.querySelector(`input[name="${s.country}"]`);o?this.#A=o:(this.#A=f("input",{type:"hidden",name:s.country}),t.appendChild(this.#A))}}#x(){let t=document.createDocumentFragment();for(let e=0;e<this.#b.length;e++){let i=this.#b[e],s=K({[h.COUNTRY_ITEM]:!0}),o=f("li",{id:`iti-${this.#i}__item-${i.iso2}`,class:s,tabindex:"-1",role:"option",[p.SELECTED]:"false"});o.dataset[w.DIAL_CODE]=i.dialCode,o.dataset[w.ISO2]=i.iso2,this.#O.set(i.iso2,o),this.#t.showFlags&&f("div",{class:`${h.FLAG} iti__${i.iso2}`},o);let l=f("span",{class:"iti__country-name"},o);l.textContent=`${i.name} `;let r=f("span",{class:"iti__dial-code"},l);this.#N&&r.setAttribute("dir","ltr"),r.textContent=`(+${i.dialCode})`,t.appendChild(o)}this.#n.appendChild(t)}#T(){if(this.#e){let t=this.#t.separateDialCode?A.FALLBACK_SELECTED_WITH_DIAL_WIDTH:A.FALLBACK_SELECTED_NO_DIAL_WIDTH,i=(this.#e.offsetWidth||this.#q()||t)+A.INPUT_PADDING_EXTRA_LEFT;this.telInputEl.style.paddingLeft=`${i}px`}}static#S(){let t;try{t=window.top.document.body}catch{t=document.body}return t}#q(){if(!this.telInputEl.parentNode)return 0;let t=n.#S(),e=this.telInputEl.parentNode.cloneNode(!1);e.style.visibility="hidden",t.appendChild(e);let i=this.#f.cloneNode();e.appendChild(i);let s=this.#e.cloneNode(!0);i.appendChild(s);let o=s.offsetWidth;return t.removeChild(e),o}#W(){let t=n.#S();this.#s.classList.remove(h.HIDE);let e=f("div",{class:"iti iti--inline-dropdown"});e.appendChild(this.#s),e.style.visibility="hidden",t.appendChild(e);let i=this.#s.offsetHeight;return t.removeChild(e),e.style.visibility="",this.#s.classList.add(h.HIDE),i>0?i:A.FALLBACK_DROPDOWN_HEIGHT}#$(){let{i18n:t}=this.#t,e=this.#n.childElementCount;this.#U.textContent=t.searchSummaryAria(e)}#E(t){let e;t===""?e=this.#b:e=Et(this.#b,t),this.#tt(e)}prefillSearchWithPlus(){this.#l.value="+",this.#l.focus(),this.#E("")}#P(){let t=this.#l.value.trim();this.#E(t),this.#l.value?this.#u.classList.remove(h.HIDE):this.#u.classList.add(h.HIDE)}#H(){this.#L&&clearTimeout(this.#L),this.#L=setTimeout(()=>{this.#P(),this.#L=null},Q.SEARCH_DEBOUNCE_MS)}#J(){this.#l.value="",this.#l.focus(),this.#P()}#D(t){let e=this.#n,i=e.getBoundingClientRect(),s=t.getBoundingClientRect(),o=s.top-i.top+e.scrollTop;s.top<i.top?e.scrollTop=o:s.bottom>i.bottom&&(e.scrollTop=o-i.height+s.height)}#g(t,e=!0){if(this.#d?.classList.remove(h.HIGHLIGHT),t){if(t.classList.add(h.HIGHLIGHT),this.#t.countrySearch){let i=t.getAttribute("id")||"";this.#l.setAttribute(p.ACTIVE_DESCENDANT,i)}e&&this.#D(t),this.#d=t}else this.#d=null}bindHiddenInputSubmitListener(t,e,i){let s=this.telInputEl.form;!s||!this.#c&&!this.#A||s.addEventListener("submit",()=>{this.#c&&(this.#c.value=e()),this.#A&&(this.#A.value=i())},{signal:t})}bindAllInitialDropdownListeners(t,e,i){let s=this.telInputEl.closest("label");s&&s.addEventListener("click",o=>{this.isDropdownOpen()?o.preventDefault():this.telInputEl.focus()},{signal:t}),this.#e.addEventListener("click",()=>{!this.isDropdownOpen()&&!this.telInputEl.disabled&&!this.telInputEl.readOnly&&e()},{signal:t}),this.#f.addEventListener("keydown",o=>{let l=[E.ARROW_UP,E.ARROW_DOWN,E.SPACE,E.ENTER];!this.isDropdownOpen()&&l.includes(o.key)&&(o.preventDefault(),o.stopPropagation(),e()),o.key===E.TAB&&i()},{signal:t})}openDropdown(t,e){let{countrySearch:i,dropdownAlwaysOpen:s,dropdownContainer:o}=this.#t;if(this.#w=new AbortController,this.ensureDropdownWidthSet(),o)this.#et();else{let r=this.#k(),a=this.telInputEl.offsetHeight+A.DROPDOWN_MARGIN;r?this.#s.style.top=`${a}px`:this.#s.style.bottom=`${a}px`}this.#s.classList.remove(h.HIDE),this.#e.setAttribute(p.EXPANDED,"true");let l=this.#y??this.#n.firstElementChild;l&&this.#g(l),i&&!s&&this.#l.focus(),this.#t.useFullscreenPopup&&this.#r&&window.visualViewport&&window.visualViewport.addEventListener("resize",()=>{this.#it(),this.#d&&this.#D(this.#d)},{signal:this.#w.signal}),this.#o.classList.add(h.ARROW_UP),this.#R(t,e)}#R(t,e){let i=this.#w.signal;this.#F(i),this.#I(i,t),this.#t.dropdownAlwaysOpen||this.#B(i,e),this.#V(i,t,e),this.#t.countrySearch&&this.#M(i),!this.#t.useFullscreenPopup&&this.#t.dropdownContainer&&window.addEventListener("scroll",e,{signal:i})}#F(t){this.#n.addEventListener("mouseover",e=>{let i=e.target?.closest(`.${h.COUNTRY_ITEM}`);i&&this.#g(i,!1)},{signal:t})}#I(t,e){this.#n.addEventListener("click",i=>{let s=i.target?.closest(`.${h.COUNTRY_ITEM}`);s&&e(s)},{signal:t})}#B(t,e){setTimeout(()=>{document.documentElement.addEventListener("click",i=>{this.#s.contains(i.target)||e()},{signal:t})},0)}#V(t,e,i){let s="",o=null,l=r=>{[E.ARROW_UP,E.ARROW_DOWN,E.ENTER,E.ESC].includes(r.key)&&(r.preventDefault(),r.stopPropagation(),r.key===E.ARROW_UP||r.key===E.ARROW_DOWN?this.#Q(r.key):r.key===E.ENTER&&!r.isComposing?e(this.#d):r.key===E.ESC&&(i(),this.#e.focus())),!this.#t.countrySearch&&v.HIDDEN_SEARCH_CHAR.test(r.key)&&(r.stopPropagation(),o&&clearTimeout(o),s+=r.key.toLowerCase(),this.#j(s),o=setTimeout(()=>{s=""},Q.HIDDEN_SEARCH_RESET_MS))};document.addEventListener("keydown",l,{signal:t})}#M(t){this.#l.addEventListener("input",()=>this.#H(),{signal:t}),this.#u.addEventListener("click",()=>this.#J(),{signal:t})}#j(t){let e=gt(this.#b,t);if(e){let i=this.#O.get(e.iso2);this.#g(i)}}#Q(t){let e=t===E.ARROW_UP?this.#d?.previousElementSibling:this.#d?.nextElementSibling;!e&&this.#n.childElementCount>1&&(e=t===E.ARROW_UP?this.#n.lastElementChild:this.#n.firstElementChild),e&&this.#g(e)}#Z(t){if(this.#y&&this.#y.dataset[w.ISO2]!==t&&(this.#y.setAttribute(p.SELECTED,"false"),this.#y.querySelector(".iti__country-check")?.remove(),this.#y=null),t&&!this.#y){let e=this.#n.querySelector(`[data-country-code="${t}"]`);if(e){e.setAttribute(p.SELECTED,"true");let i=f("span",{class:"iti__country-check",[p.HIDDEN]:"true"},e);i.innerHTML=yt(),this.#y=e,this.#t.dropdownAlwaysOpen&&this.#g(e)}}}#tt(t){this.#n.replaceChildren();let e=!0;for(let i of t){let s=this.#O.get(i.iso2);s&&(this.#n.appendChild(s),e&&(this.#g(s,!1),e=!1))}e?(this.#g(null),this.#v&&this.#v.classList.remove(h.HIDE)):this.#v&&this.#v.classList.add(h.HIDE),this.#n.scrollTop=0,this.#$()}closeDropdown(){let{countrySearch:t,dropdownContainer:e}=this.#t;this.#w.abort(),this.#w=null,this.#s.classList.add(h.HIDE),this.#e.setAttribute(p.EXPANDED,"false"),t&&(this.#l.removeAttribute(p.ACTIVE_DESCENDANT),this.#l.value="",this.#P(),this.#d&&(this.#d.classList.remove(h.HIGHLIGHT),this.#d=null)),this.#o.classList.remove(h.ARROW_UP),e?(this.#r.remove(),this.#r.style.top="",this.#r.style.bottom="",this.#r.style.paddingLeft="",this.#r.style.paddingRight=""):(this.#s.style.top="",this.#s.style.bottom="")}#k(){if(this.#t.dropdownAlwaysOpen)return!0;let t=this.telInputEl.getBoundingClientRect(),e=t.top,i=window.innerHeight-t.bottom;return i>=this.#_||i>=e}#et(){let{dropdownContainer:t,useFullscreenPopup:e}=this.#t;if(e){if(window.innerWidth>=A.NARROW_VIEWPORT_WIDTH){let i=this.telInputEl.getBoundingClientRect();this.#r.style.paddingLeft=`${i.left}px`,this.#r.style.paddingRight=`${window.innerWidth-i.right}px`}}else{let i=this.telInputEl.getBoundingClientRect();this.#r.style.left=`${i.left}px`,this.#k()?this.#r.style.top=`${i.bottom+A.DROPDOWN_MARGIN}px`:(this.#r.style.top="unset",this.#r.style.bottom=`${window.innerHeight-i.top+A.DROPDOWN_MARGIN}px`)}t.appendChild(this.#r)}#it(){let t=window.visualViewport;if(!t||!this.#r)return;let e=window.innerHeight-t.height;this.#r.style.bottom=`${e}px`}isDropdownOpen(){return!this.#s.classList.contains(h.HIDE)}setLoading(t){this.#a.classList.toggle(h.LOADING,t)}isLoading(){return this.#a.classList.contains(h.LOADING)}setDisabled(t){this.telInputEl.disabled=t,this.#e&&(t?this.#e.setAttribute("disabled","true"):this.#e.removeAttribute("disabled"))}setReadonly(t){this.telInputEl.readOnly=t,this.#e&&(t?this.#e.setAttribute("disabled","true"):this.#e.removeAttribute("disabled"))}setCountry(t){let{allowDropdown:e,showFlags:i,separateDialCode:s,i18n:o}=this.#t,l=t?.name,r=t?.dialCode,a=t?.iso2??"";if(e&&this.#Z(a),this.#e){let d=a&&i?`${h.FLAG} iti__${a}`:`${h.FLAG} ${h.GLOBE}`,c,m,y;a?(m=l,c=o.selectedCountryAriaLabel.replace("${countryName}",l).replace("${dialCode}",`+${r}`),y=i?"":et()):(m=o.noCountrySelected,c=o.noCountrySelected,y=et()),this.#a.className=d,this.#e.setAttribute("title",m),this.#e.setAttribute(p.LABEL,c),this.#a.innerHTML=y}if(s){let d=r?`+${r}`:"";this.#C.textContent=d,this.#T()}}destroy(){this.telInputEl.iti=void 0,delete this.telInputEl.dataset[w.INSTANCE_ID],this.telInputEl.style.paddingLeft=this.#m;let t=this.telInputEl.parentNode;t&&(t.before(this.telInputEl),t.remove()),this.#O.clear()}};var bt=n=>{let{onlyCountries:t,excludeCountries:e}=n;return t?.length?M.filter(i=>t.includes(i.iso2)):e?.length?M.filter(i=>!e.includes(i.iso2)):[...M]},It=(n,t)=>{let{countryNameLocale:e,i18n:i}=t,s;try{typeof Intl<"u"&&typeof Intl.DisplayNames=="function"?s=new Intl.DisplayNames(e,{type:"region"}):s=null}catch(o){console.error(o),s=null}for(let o of n)o.name=i[o.iso2]||s?.of(o.iso2.toUpperCase())||""},Lt=n=>{let t=new Set,e=0,i={},s=(l,r)=>{if(!l||!r)return;r.length>e&&(e=r.length),Object.hasOwn(i,r)||(i[r]=[]);let a=i[r];a.includes(l)||a.push(l)},o=[...n].sort((l,r)=>l.priority-r.priority);for(let l of o){t.has(l.dialCode)||t.add(l.dialCode);for(let r=1;r<l.dialCode.length;r++){let a=l.dialCode.substring(0,r);s(l.iso2,a)}if(s(l.iso2,l.dialCode),l.areaCodes){let r=i[l.dialCode][0];for(let a of l.areaCodes){for(let d=1;d<a.length;d++){let c=a.substring(0,d),m=l.dialCode+c;s(r,m),s(l.iso2,m)}s(l.iso2,l.dialCode+a)}}}return{dialCodes:t,dialCodeMaxLength:e,dialCodeToIso2Map:i}},At=(n,t)=>{let{countryOrder:e}=t;n.sort((i,s)=>{if(e){let o=e.indexOf(i.iso2),l=e.indexOf(s.iso2),r=o>-1,a=l>-1;if(r||a)return r&&a?o-l:r?-1:1}return i.name.localeCompare(s.name)})},vt=n=>{for(let t of n)t.normalisedName=F(t.name),t.initials=t.normalisedName.split(/[^a-z]/).map(e=>e[0]).join(""),t.dialCodePlus=`+${t.dialCode}`};var Ft=new Set(["800","808","870","881","882","883","888","979"]),it=n=>{let t=N(n).slice(0,3);return n.startsWith("+")&&Ft.has(t)};var st=(n,t,e,i)=>{if(!e||!t)return n;let s=`+${i.dialCode}`,o=n[s.length]===" "||n[s.length]==="-"?s.length+1:s.length;return n.substring(o)},wt=(n,t,e,i,s)=>{let o=e?e.formatNumberAsYouType(n,i?.iso2):n,l=i?.dialCode;return s&&t.charAt(0)!=="+"&&o.includes(`+${l}`)?(o.split(`+${l}`)[1]||"").trim():o};var Tt=(n,t,e,i)=>{if(e===0&&!i)return 0;let s=0;for(let o=0;o<t.length;o++){if(/[+0-9]/.test(t[o])&&s++,s===n&&!i)return o+1;if(i&&s===n+1)return o}return t.length};var Bt=new Set(["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"]),nt=n=>{let t=N(n);if(t.startsWith(B.NANP)&&t.length>=4){let e=t.substring(1,4);return Bt.has(e)}return!1};var Y=class{#t;constructor(t){t&&this.#i(t)}#i(t){/[\u0660-\u0669]/.test(t)?this.#t="arabic-indic":/[\u06F0-\u06F9]/.test(t)?this.#t="persian":this.#t="ascii"}denormalise(t){if(!this.#t||this.#t==="ascii")return t;let e=this.#t==="arabic-indic"?1632:1776;return t.replace(/[0-9]/g,i=>String.fromCharCode(e+Number(i)))}normalise(t){if(!t)return"";if(this.#i(t),this.#t==="ascii")return t;let e=this.#t==="arabic-indic"?1632:1776,i=this.#t==="arabic-indic"?/[\u0660-\u0669]/g:/[\u06F0-\u06F9]/g;return t.replace(i,s=>String.fromCharCode(48+(s.charCodeAt(0)-e)))}isAscii(){return!this.#t||this.#t==="ascii"}};var Vt=0,k=n=>{if(!u.utils)throw new Error(`intlTelInput.utils is required for ${n}(). See: https://intl-tel-input.com/docs/utils`)},Nt=()=>{let n,t;return{promise:new Promise((i,s)=>{n=i,t=s}),resolve:n,reject:t}},U=class n{id;promise;#t;#i;#N;#m;#b;#L;#_;#f;#e=null;#a=null;#C;#o=!0;#s;#h;#l;#u;constructor(t,e={}){this.id=Vt++,H.validateInput(t);let i=ht(e);this.#i={...G,...i},pt(this.#i),ft(this.#i),this.#t=new H(t,this.#i,this.id),this.#N=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),this.#h=new Y(t.value),this.promise=this.#A(this.#i),this.#m=bt(this.#i);let{dialCodes:s,dialCodeMaxLength:o,dialCodeToIso2Map:l}=Lt(this.#m);this.#_=s,this.#b=o,this.#L=l,this.#f=new Map(this.#m.map(r=>[r.iso2,r])),this.#v()}#n(){let t=this.#t.telInputEl.value.trim();return this.#h.normalise(t)}#c(t){this.#t.telInputEl.value=this.#h.denormalise(t)}#A(t){let{initialCountry:e,geoIpLookup:i,loadUtils:s}=t,o=e===W.AUTO&&!!i,l=!!s&&!u.utils;return o&&(this.#l=Nt()),l&&(this.#u=Nt()),Promise.all([this.#l?.promise,this.#u?.promise]).then(()=>{})}#v(){this.#s=new AbortController,this.#U(),this.#t.buildMarkup(this.#m),this.#r(),this.#y(),this.#d(),this.#i.dropdownAlwaysOpen&&this.#x()}#U(){It(this.#m,this.#i),At(this.#m,this.#i),vt(this.#m)}#r(t=!1){let e=this.#t.telInputEl.getAttribute("value"),i=this.#h.normalise(e??""),s=this.#n(),l=i&&i.startsWith("+")&&(!s||!s.startsWith("+"))?i:s,r=this.#R(l),a=nt(l),{initialCountry:d,geoIpLookup:c}=this.#i,m=d===W.AUTO&&c,y=m&&u.autoCountry?u.autoCountry:d,I=m&&!t&&!u.autoCountry,C=S(y);r?a?C?this.#E(y):I||this.#E(ot.ISO2):this.#S(l):C?this.#E(y):I||this.#E(""),l&&this.#T(l)}#y(){this.#G(),this.#i.allowDropdown&&this.#t.bindAllInitialDropdownListeners(this.#s.signal,()=>this.#x(),()=>this.#D()),this.#t.bindHiddenInputSubmitListener(this.#s.signal,()=>this.getNumber(),()=>this.#e?.iso2||"")}#d(){if(this.#u){let{loadUtils:t}=this.#i,e=()=>{u.attachUtils(t)?.catch(()=>{})};u.documentReady()?e():window.addEventListener("load",e,{signal:this.#s.signal})}this.#l&&(this.#e?this.#l.resolve():this.#O())}#O(){if(u.autoCountry){this.#j();return}if(this.#t.setLoading(!0),!u.startedLoadingAutoCountry&&(u.startedLoadingAutoCountry=!0,typeof this.#i.geoIpLookup=="function")){let t=(i="")=>{let s=i.toLowerCase();S(s)?(u.autoCountry=s,setTimeout(()=>n.forEachInstance("handleAutoCountryLoaded"))):n.forEachInstance("handleAutoCountryFailure")},e=()=>{n.forEachInstance("handleAutoCountryFailure")};this.#i.geoIpLookup(t,e)}}#w(){this.#x(),this.#t.prefillSearchWithPlus()}#G(){this.#K(),this.#Y(),this.#z()}#K(){let{strictMode:t,formatAsYouType:e,separateDialCode:i,allowDropdown:s,countrySearch:o}=this.#i,l=!1;v.ALPHA_UNICODE.test(this.#n())&&(l=!0);let r=a=>{if(a?.detail&&a.detail.isCountryChange)return;let d=this.#n();if(this.#N&&a?.data==="+"&&i&&s&&o){let C=this.#t.telInputEl.selectionStart||0,P=d.substring(0,C-1),D=d.substring(C);this.#c(P+D),this.#w();return}this.#S(d)&&this.#M();let c=a?.data&&v.NON_PLUS_NUMERIC.test(a.data),m=a?.inputType===J.PASTE&&d;c||m&&!t?l=!0:v.NON_PLUS_NUMERIC.test(d)||(l=!1);let y=a?.detail&&a.detail.isSetNumber,I=this.#h.isAscii();if(e&&!l&&!y&&I){let C=this.#t.telInputEl.selectionStart||0,D=d.substring(0,C).replace(v.NON_PLUS_NUMERIC_GLOBAL,"").length,O=a?.inputType===J.DELETE_FORWARD,g=this.#I(),T=wt(g,d,u.utils,this.#e,i),_=Tt(D,T,C,O);this.#c(T),this.#t.telInputEl.setSelectionRange(_,_)}if(i&&d.startsWith("+")&&this.#e?.dialCode){let C=st(d,!0,i,this.#e);this.#c(C)}};this.#t.telInputEl.addEventListener("input",r,{signal:this.#s.signal})}#Y(){let{strictMode:t,separateDialCode:e,allowDropdown:i,countrySearch:s}=this.#i;if(!t&&!e)return;let o=l=>{if(!l.key||l.key.length!==1||l.altKey||l.ctrlKey||l.metaKey)return;if(e&&i&&s&&l.key==="+"){l.preventDefault(),this.#w();return}if(!t)return;let r=this.#n(),d=!r.startsWith("+")&&this.#t.telInputEl.selectionStart===0&&l.key==="+",c=this.#h.normalise(l.key),m=/^[0-9]$/.test(c),y=e?m:d||m,I=this.#t.telInputEl,C=I.selectionStart,P=I.selectionEnd,D=r.slice(0,C??void 0),O=r.slice(P??void 0),g=D+c+O,T=this.#F(g),_=!1;u.utils&&this.#a&&(_=u.utils.getCoreNumber(T,this.#e?.iso2).length>this.#a);let z=this.#W(T)!==null;(!y||_&&!z&&!d)&&(this.#p(L.STRICT_REJECT,{source:"key",rejectedInput:l.key,reason:y?"max-length":"invalid"}),l.preventDefault())};this.#t.telInputEl.addEventListener("keydown",o,{signal:this.#s.signal})}#z(){if(!this.#i.strictMode)return;let t=e=>{e.preventDefault();let i=this.#t.telInputEl,s=i.selectionStart,o=i.selectionEnd,l=this.#n(),r=l.slice(0,s??void 0),a=l.slice(o??void 0),d=this.#e?.iso2,c=e.clipboardData.getData("text"),m=this.#h.normalise(c),y=s===0&&o>0,I=!l.startsWith("+")||y,C=m.replace(v.NON_PLUS_NUMERIC_GLOBAL,""),P=C.startsWith("+"),D=C.replace(/\+/g,""),O=P&&I?`+${D}`:D,g=r+O+a,T=O!==m?"invalid":null;if(g.length>5&&u.utils){let R=u.utils.getCoreNumber(g,d);for(;R.length===0&&g.length>0;)g=g.slice(0,-1),R=u.utils.getCoreNumber(g,d);if(!R){this.#p(L.STRICT_REJECT,{source:"paste",rejectedInput:c,reason:"max-length"});return}if(this.#a&&R.length>this.#a)if(i.selectionEnd===l.length){let z=R.length-this.#a;g=g.slice(0,g.length-z),T="max-length"}else{this.#p(L.STRICT_REJECT,{source:"paste",rejectedInput:c,reason:"max-length"});return}}this.#c(g);let _=s+O.length;i.setSelectionRange(_,_),i.dispatchEvent(new InputEvent("input",{bubbles:!0})),T&&this.#p(L.STRICT_REJECT,{source:"paste",rejectedInput:c,reason:T})};this.#t.telInputEl.addEventListener("paste",t,{signal:this.#s.signal})}#X(t){let e=Number(this.#t.telInputEl.getAttribute("maxlength"));return e&&t.length>e?t.substring(0,e):t}#p(t,e={}){let i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e});this.#t.telInputEl.dispatchEvent(i)}#x(){this.#t.openDropdown(t=>this.#J(t),()=>this.#D()),this.#p(L.OPEN_COUNTRY_DROPDOWN)}#T(t){let{formatOnDisplay:e,nationalMode:i,separateDialCode:s}=this.#i,o=t;if(e&&u.utils&&this.#e){let l=it(t),r=i&&!l||!o.startsWith("+")&&!s,{NATIONAL:a,INTERNATIONAL:d}=u.utils.numberFormat,c=r?a:d;o=u.utils.formatNumber(o,this.#e?.iso2,c)}o=this.#B(o),this.#c(o)}#S(t){let e=this.#W(t);return e!==null?this.#E(e):!1}#q(t){let e=this.#e?.dialCode,i=this.#e?.nationalPrefix;if(t.startsWith("+")||!e)return t;let l=i&&t.startsWith(i)&&!this.#i.separateDialCode?t.substring(1):t;return`+${e}${l}`}#W(t){let e=t.indexOf("+"),i=e>0?t.substring(e):t,s=this.#e?.iso2;i=this.#q(i);let o=this.#R(i,!0),l=N(i);if(o){let r=N(o),a=this.#L[r];return a.length===1?a[0]===s?null:a[0]:this.#$(a,r,l)}else if(i.startsWith("+")&&l.length){let r=this.#e?.dialCode||"";return r&&r.startsWith(l)?null:""}else if((!i||i==="+")&&!s&&this.#C)return this.#C;return null}#$(t,e,i){let s=this.#e?.iso2,o=this.#e?.dialCode;if(!s&&this.#C&&t.includes(this.#C))return this.#C;if(o===B.NANP&&nt(i))return null;let r=this.#e?.areaCodes,a=this.#e?.priority;if(r){let I=r.map(C=>`${o}${C}`);for(let C of I)if(i.startsWith(C))return null}let c=r&&!(a===0)&&i.length>e.length,m=s&&t.includes(s)&&!c,y=s===t[0];return!m&&!y?t[0]:null}#E(t){let e=this.#e?.iso2||"";return this.#e=t?this.#f.get(t):null,this.#e&&(this.#C=this.#e.iso2),this.#t.setCountry(this.#e),this.#H(),this.#P(),e!==t}#P(){let{strictMode:t,placeholderNumberType:e,allowedNumberTypes:i}=this.#i;if(!t||!u.utils)return;let s=this.#e?.iso2;if(!s){this.#a=null;return}let o=u.utils.numberType[e],l=u.utils.getExampleNumber(s,!1,o,!0),r=l;for(;u.utils.isPossibleNumber(l,s,i);)r=l,l+="0";let a=u.utils.getCoreNumber(r,s);this.#a=a.length,s==="by"&&(this.#a=a.length+1)}#H(){let{autoPlaceholder:t,placeholderNumberType:e,nationalMode:i,customPlaceholder:s}=this.#i,o=t===x.AGGRESSIVE||!this.#t.hadInitialPlaceholder&&t===x.POLITE;if(!u.utils||!o)return;let l=u.utils.numberType[e],r=this.#e?u.utils.getExampleNumber(this.#e.iso2,i,l):"";r=this.#B(r),typeof s=="function"&&(r=s(r,this.#e)),this.#t.telInputEl.setAttribute("placeholder",r)}#J(t){if(!t)return;let e=t.dataset[w.ISO2],i=this.#E(e);this.#D();let s=t.dataset[w.DIAL_CODE];if(this.#g(s),this.#i.formatOnDisplay){let o=this.#n();this.#T(o)}this.#t.telInputEl.focus(),i&&(this.#M(),this.#p(L.INPUT,{isCountryChange:!0}))}#D(t){!this.#t.isDropdownOpen()||this.#i.dropdownAlwaysOpen&&!t||(this.#t.closeDropdown(),this.#p(L.CLOSE_COUNTRY_DROPDOWN))}#g(t){let e=this.#n();if(!e.startsWith("+"))return;let i=`+${t}`,s=this.#R(e),o;s?o=e.replace(s,i):o=i,this.#c(o)}#R(t,e){if(!t.startsWith("+"))return"";let i="",s="",o=!1;for(let l=0;l<t.length;l++){let r=t.charAt(l);if(!/[0-9]/.test(r))continue;if(s+=r,!!!this.#L[s])break;if(this.#_.has(s)){if(i=t.substring(0,l+1),o=!0,!e)break}else e&&o&&(i=t.substring(0,l+1));if(s.length===this.#b)break}return i}#F(t){let e=this.#e?.dialCode,i=N(t);return(this.#i.separateDialCode&&!t.startsWith("+")&&e&&i?`+${e}`:"")+t}#I(){let t=this.#n();return this.#F(t)}#B(t){let e=!!this.#R(t),i=st(t,e,this.#i.separateDialCode,this.#e);return this.#X(i)}#V(){let t=this.#e;if(!t)return null;let{iso2:e,dialCode:i,name:s}=t;return{iso2:e,dialCode:i,name:s}}#M(){let t=this.#V();this.#p(L.COUNTRY_CHANGE,t)}#j(){if(!(!this.#l||!u.autoCountry)){if(!this.#o){this.#l.resolve();return}this.#t.isLoading()?this.setCountry(u.autoCountry):this.#C=u.autoCountry,this.#t.setLoading(!1),this.#l.resolve()}}#Q(){if(!this.#o){this.#l?.reject();return}this.#r(!0),this.#t.setLoading(!1),this.#l?.reject()}#Z(){if(!this.#o){this.#u?.resolve();return}if(!u.utils){this.#u?.resolve();return}let t=this.#n();t&&this.#T(t),this.#e&&(this.#H(),this.#P()),this.#u?.resolve()}#tt(t){if(!this.#o){this.#u?.reject(t);return}this.#u?.reject(t)}destroy(){this.#o&&(this.#o=!1,this.#i.allowDropdown&&this.#D(!0),this.#s.abort(),this.#t.destroy(),u.instances.delete(String(this.id)))}isActive(){return this.#o}getExtension(){return this.#o?(k("getExtension"),u.utils.getExtension(this.#I(),this.#e?.iso2)):""}getNumber(t){if(!this.#o)return"";k("getNumber");let e=this.#e?.iso2,i=this.#I(),s=u.utils.formatNumber(i,e,t);return this.#h.denormalise(s)}getNumberType(){return this.#o?(k("getNumberType"),u.utils.getNumberType(this.#I(),this.#e?.iso2)):Z.UNKNOWN_NUMBER_TYPE}getSelectedCountryData(){return this.#V()}getValidationError(){if(!this.#o)return Z.UNKNOWN_VALIDATION_ERROR;k("getValidationError");let t=this.#e?.iso2;return u.utils.getValidationError(this.#I(),t)}isValidNumber(){if(!this.#o)return null;k("isValidNumber");let t=this.#e?.dialCode,e=this.#e?.iso2,i=this.#I(),s=u.utils.getCoreNumber(i,e);if(s){if(t===V.DIAL_CODE&&s[0]===V.MOBILE_PREFIX&&s.length!==V.MOBILE_CORE_LENGTH)return!1;if(!v.ALPHA_UNICODE.test(i)&&t){let l=i.startsWith("+")?i.slice(1+t.length):i,r=N(l).length;if(s.length>r)return!1}}return this.#k("possible")}isValidNumberPrecise(){return this.#o?(k("isValidNumberPrecise"),this.#k("precise")):null}#k(t){let{allowNumberExtensions:e,allowPhonewords:i,allowedNumberTypes:s}=this.#i,o=this.#e?.iso2,l=this.#I();return!this.#e&&!it(l)||!(t==="precise"?u.utils.isValidNumber:u.utils.isPossibleNumber)(l,o,s)?!1:v.ALPHA_UNICODE.test(l)?!!u.utils.getExtension(l,o)?e:i:!0}setCountry(t){if(!this.#o)return;let e=t?.toLowerCase();if(!S(e))throw new Error(`Invalid iso2 code: '${e}'`);let i=this.#e?.iso2;if(t&&e!==i||!t&&i){if(this.#E(e),this.#g(this.#e?.dialCode||""),this.#i.formatOnDisplay){let o=this.#n();this.#T(o)}this.#M(),this.#p(L.INPUT,{isCountryChange:!0})}}setNumber(t){if(!this.#o)return;let e=this.#h.normalise(t),i=this.#S(e);this.#T(e),i&&this.#M(),this.#p(L.INPUT,{isSetNumber:!0})}setPlaceholderNumberType(t){this.#o&&(this.#i.placeholderNumberType=t,this.#H())}setDisabled(t){this.#o&&this.#t.setDisabled(t)}setReadonly(t){this.#o&&this.#t.setReadonly(t)}static forEachInstance(t,...e){let i=[...u.instances.values()],s=e[0];i.forEach(o=>{if(o instanceof n)switch(t){case"handleUtilsLoaded":o.#Z();break;case"handleUtilsFailure":o.#tt(s);break;case"handleAutoCountryLoaded":o.#j();break;case"handleAutoCountryFailure":o.#Q();break}})}},jt=n=>{if(!u.utils&&!u.startedLoadingUtils){let t;if(typeof n=="function")try{t=Promise.resolve(n())}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 n}`));return u.startedLoadingUtils=!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 u.utils=i,U.forEachInstance("handleUtilsLoaded"),!0}).catch(e=>{throw U.forEachInstance("handleUtilsFailure",e),e})}return null},u=Object.assign((n,t)=>{let e=new U(n,t);return u.instances.set(String(e.id),e),n.iti=e,e},{defaults:G,documentReady:()=>document.readyState==="complete",getCountryData:()=>M,getInstance:n=>{let t=n.dataset[w.INSTANCE_ID];return t?u.instances.get(t)??null:null},instances:new Map,attachUtils:jt,startedLoadingUtils:!1,startedLoadingAutoCountry:!1,version:"27.1.0"}),Gt=u;return Rt(Kt);})();
24
+ </svg>`;var Et=(n,t)=>{let e=$(t),i=[],s=[],o=[],l=[],r=[],a=[];for(let c of n)c.iso2===e?i.push(c):c.normalisedName.startsWith(e)?s.push(c):c.normalisedName.includes(e)?o.push(c):e===c.dialCode||e===c.dialCodePlus?l.push(c):c.dialCodePlus.includes(e)?r.push(c):c.initials.includes(e)&&a.push(c);let d=(c,m)=>c.priority-m.priority;return[...i,...s,...o,...l.sort(d),...r.sort(d),...a]},gt=(n,t)=>{let e=$(t);for(let i of n)if(i.normalisedName.startsWith(e))return i;return null};var x=class n{#t;#i;#L;#y="";#b;#A=null;#D;#C;#e;#a;#E;#o;#s;#p;#l;#u;#n;#c;#v;#w;#H;#r;#g=null;#d=null;#_=new Map;#T=null;telInputEl;hadInitialPlaceholder;constructor(t,e,i){t.dataset[w.INSTANCE_ID]=i.toString(),this.telInputEl=t,this.#t=e,this.#i=i,this.hadInitialPlaceholder=!!t.getAttribute("placeholder"),this.#L=!!this.telInputEl.closest("[dir=rtl]"),this.#y=this.telInputEl.style.paddingLeft}static validateInput(t){let e=t?.tagName;if(!(!!t&&typeof t=="object"&&e==="INPUT"&&typeof t.setAttribute=="function")){let s=Object.prototype.toString.call(t);throw new TypeError(`The first argument must be an HTMLInputElement, not ${s}`)}}buildMarkup(t){this.#b=t,this.telInputEl.classList.add("iti__tel-input"),this.telInputEl.hasAttribute("type")||this.telInputEl.setAttribute("type","tel"),this.telInputEl.hasAttribute("autocomplete")||this.telInputEl.setAttribute("autocomplete","tel"),this.telInputEl.hasAttribute("inputmode")||this.telInputEl.setAttribute("inputmode","tel");let e=this.#k();this.#z(e),e.appendChild(this.telInputEl),this.#J(),this.#Q(e),this.ensureDropdownWidthSet()}#k(){let{allowDropdown:t,showFlags:e,containerClass:i,useFullscreenPopup:s}=this.#t,o=K({iti:!0,"iti--allow-dropdown":t,"iti--show-flags":e,"iti--inline-dropdown":!s,[i]:!!i}),l=f("div",{class:o});return this.#L&&l.setAttribute("dir","ltr"),this.telInputEl.before(l),l}#z(t){let{allowDropdown:e,separateDialCode:i,showFlags:s}=this.#t;if(!e&&!s&&!i)return;this.#C=f("div",{class:`iti__country-container ${h.V_HIDE}`},t),e?(this.#e=f("button",{type:"button",class:"iti__selected-country",[p.EXPANDED]:"false",[p.LABEL]:this.#t.i18n.noCountrySelected,[p.HASPOPUP]:"dialog",[p.CONTROLS]:`iti-${this.#i}__dropdown-content`},this.#C),this.telInputEl.disabled&&this.#e.setAttribute("disabled","true")):this.#e=f("div",{class:"iti__selected-country"},this.#C);let o=f("div",{class:"iti__selected-country-primary"},this.#e);this.#a=f("div",{class:h.FLAG},o),e&&(this.#o=f("div",{class:"iti__arrow",[p.HIDDEN]:"true"},o)),i&&(this.#E=f("div",{class:"iti__selected-dial-code"},this.#e)),e&&this.#X()}ensureDropdownWidthSet(){let{fixDropdownWidth:t,allowDropdown:e}=this.#t;if(!e||!t||this.#s.style.width)return;let i=this.telInputEl.offsetWidth;i>0&&(this.#s.style.width=`${i}px`)}#X(){let{fixDropdownWidth:t,useFullscreenPopup:e,countrySearch:i,i18n:s,dropdownContainer:o,containerClass:l}=this.#t,r=t?"":"iti--flexible-dropdown-width";if(this.#s=f("div",{id:`iti-${this.#i}__dropdown-content`,class:`iti__dropdown-content ${h.HIDE} ${r}`,role:"dialog",[p.MODAL]:"true"}),this.#L&&this.#s.setAttribute("dir","rtl"),i&&this.#q(),this.#n=f("ul",{class:"iti__country-list",id:`iti-${this.#i}__country-listbox`,role:"listbox",[p.LABEL]:s.countryListAriaLabel},this.#s),this.#h(),i&&this.#M(),e||(this.#D=this.#Z(),i&&(this.#s.style.height=`${this.#D}px`)),o){let a=K({iti:!0,"iti--container":!0,"iti--fullscreen-popup":e,"iti--inline-dropdown":!e,[l]:!!l});this.#r=f("div",{class:a}),this.#r.appendChild(this.#s)}else this.#C.appendChild(this.#s)}#q(){let{i18n:t,searchInputClass:e}=this.#t,i=f("div",{class:"iti__search-input-wrapper"},this.#s);this.#p=f("span",{class:"iti__search-icon",[p.HIDDEN]:"true"},i),this.#p.innerHTML=mt(),this.#l=f("input",{id:`iti-${this.#i}__search-input`,type:"search",class:`iti__search-input ${e}`,placeholder:t.searchPlaceholder,role:"combobox",[p.EXPANDED]:"true",[p.LABEL]:t.searchPlaceholder,[p.CONTROLS]:`iti-${this.#i}__country-listbox`,[p.AUTOCOMPLETE]:"list",autocomplete:"off"},i),this.#u=f("button",{type:"button",class:`iti__search-clear ${h.HIDE}`,[p.LABEL]:t.clearSearchAriaLabel,tabindex:"-1"},i),this.#u.innerHTML=Ct(this.#i),this.#H=f("span",{class:"iti__a11y-text"},this.#s),this.#w=f("div",{class:`iti__no-results ${h.HIDE}`,[p.HIDDEN]:"true"},this.#s),this.#w.textContent=t.searchEmptyState??null}#J(){this.#C&&(this.#O(),this.#C.classList.remove(h.V_HIDE))}#Q(t){let{hiddenInput:e}=this.#t;if(!e)return;let i=this.telInputEl.getAttribute("name")||"",s=e(i);if(s.phone){let o=this.telInputEl.form?.querySelector(`input[name="${s.phone}"]`);o?this.#c=o:(this.#c=f("input",{type:"hidden",name:s.phone}),t.appendChild(this.#c))}if(s.country){let o=this.telInputEl.form?.querySelector(`input[name="${s.country}"]`);o?this.#v=o:(this.#v=f("input",{type:"hidden",name:s.country}),t.appendChild(this.#v))}}#h(){let t=document.createDocumentFragment();for(let e=0;e<this.#b.length;e++){let i=this.#b[e],s=K({[h.COUNTRY_ITEM]:!0}),o=f("li",{id:`iti-${this.#i}__item-${i.iso2}`,class:s,tabindex:"-1",role:"option",[p.SELECTED]:"false"});o.dataset[w.DIAL_CODE]=i.dialCode,o.dataset[w.ISO2]=i.iso2,this.#_.set(i.iso2,o),this.#t.showFlags&&f("div",{class:`${h.FLAG} iti__${i.iso2}`},o);let l=f("span",{class:"iti__country-name"},o);l.textContent=`${i.name} `;let r=f("span",{class:"iti__dial-code"},l);this.#L&&r.setAttribute("dir","ltr"),r.textContent=`(+${i.dialCode})`,t.appendChild(o)}this.#n.appendChild(t)}#O(){if(this.#e){let t=this.#t.separateDialCode?A.FALLBACK_SELECTED_WITH_DIAL_WIDTH:A.FALLBACK_SELECTED_NO_DIAL_WIDTH,i=(this.#e.offsetWidth||this.#P()||t)+A.INPUT_PADDING_EXTRA_LEFT;this.telInputEl.style.paddingLeft=`${i}px`}}static#N(){let t;try{t=window.top.document.body}catch{t=document.body}return t}#P(){if(!this.telInputEl.parentNode)return 0;let t=n.#N(),e=this.telInputEl.parentNode.cloneNode(!1);e.style.visibility="hidden",t.appendChild(e);let i=this.#C.cloneNode();e.appendChild(i);let s=this.#e.cloneNode(!0);i.appendChild(s);let o=s.offsetWidth;return t.removeChild(e),o}#Z(){let t=n.#N();this.#s.classList.remove(h.HIDE);let e=f("div",{class:"iti iti--inline-dropdown"});e.appendChild(this.#s),e.style.visibility="hidden",t.appendChild(e);let i=this.#s.offsetHeight;return t.removeChild(e),e.style.visibility="",this.#s.classList.add(h.HIDE),i>0?i:A.FALLBACK_DROPDOWN_HEIGHT}#M(){let{i18n:t}=this.#t,e=this.#n.childElementCount;this.#H.textContent=t.searchSummaryAria(e)}#U(t){let e;t===""?e=this.#b:e=Et(this.#b,t),this.#et(e)}prefillSearchWithPlus(){this.#l.value="+",this.#l.focus(),this.#U("")}#f(){let t=this.#l.value.trim();this.#U(t),this.#l.value?this.#u.classList.remove(h.HIDE):this.#u.classList.add(h.HIDE)}#W(){this.#A&&clearTimeout(this.#A),this.#A=setTimeout(()=>{this.#f(),this.#A=null},Q.SEARCH_DEBOUNCE_MS)}#x(){this.#l.value="",this.#l.focus(),this.#f()}#$(t){let e=this.#n,i=e.getBoundingClientRect(),s=t.getBoundingClientRect(),o=s.top-i.top+e.scrollTop;s.top<i.top?e.scrollTop=o:s.bottom>i.bottom&&(e.scrollTop=o-i.height+s.height)}#m(t,e=!0){if(this.#d?.classList.remove(h.HIGHLIGHT),t){if(t.classList.add(h.HIGHLIGHT),this.#t.countrySearch){let i=t.getAttribute("id")||"";this.#l.setAttribute(p.ACTIVE_DESCENDANT,i)}e&&this.#$(t),this.#d=t}else this.#d=null}bindHiddenInputSubmitListener(t,e,i){let s=this.telInputEl.form;!s||!this.#c&&!this.#v||s.addEventListener("submit",()=>{this.#c&&(this.#c.value=e()),this.#v&&(this.#v.value=i())},{signal:t})}bindAllInitialDropdownListeners(t,e,i){let s=this.telInputEl.closest("label");s&&s.addEventListener("click",o=>{this.isDropdownOpen()?o.preventDefault():this.telInputEl.focus()},{signal:t}),this.#e.addEventListener("click",()=>{!this.isDropdownOpen()&&!this.telInputEl.disabled&&!this.telInputEl.readOnly&&e()},{signal:t}),this.#C.addEventListener("keydown",o=>{let l=[E.ARROW_UP,E.ARROW_DOWN,E.SPACE,E.ENTER];!this.isDropdownOpen()&&l.includes(o.key)&&(o.preventDefault(),o.stopPropagation(),e()),o.key===E.TAB&&i()},{signal:t})}openDropdown(t,e){let{countrySearch:i,dropdownAlwaysOpen:s,dropdownContainer:o}=this.#t;if(this.#T=new AbortController,this.ensureDropdownWidthSet(),o)this.#Y();else{let r=this.#K(),a=this.telInputEl.offsetHeight+A.DROPDOWN_MARGIN;r?this.#s.style.top=`${a}px`:this.#s.style.bottom=`${a}px`}this.#s.classList.remove(h.HIDE),this.#e.setAttribute(p.EXPANDED,"true");let l=this.#g??this.#n.firstElementChild;l&&this.#m(l),i&&!s&&this.#l.focus(),this.#t.useFullscreenPopup&&this.#r&&window.visualViewport&&window.visualViewport.addEventListener("resize",()=>{this.#it(),this.#d&&this.#$(this.#d)},{signal:this.#T.signal}),this.#o.classList.add(h.ARROW_UP),this.#F(t,e)}#F(t,e){let i=this.#T.signal;this.#S(i),this.#B(i,t),this.#t.dropdownAlwaysOpen||this.#I(i,e),this.#j(i,t,e),this.#t.countrySearch&&this.#V(i),!this.#t.useFullscreenPopup&&this.#t.dropdownContainer&&window.addEventListener("scroll",e,{signal:i})}#S(t){this.#n.addEventListener("mouseover",e=>{let i=e.target?.closest(`.${h.COUNTRY_ITEM}`);i&&this.#m(i,!1)},{signal:t})}#B(t,e){this.#n.addEventListener("click",i=>{let s=i.target?.closest(`.${h.COUNTRY_ITEM}`);s&&e(s)},{signal:t})}#I(t,e){setTimeout(()=>{document.documentElement.addEventListener("click",i=>{this.#s.contains(i.target)||e()},{signal:t})},0)}#j(t,e,i){let s="",o=null,l=r=>{[E.ARROW_UP,E.ARROW_DOWN,E.ENTER,E.ESC].includes(r.key)&&(r.preventDefault(),r.stopPropagation(),r.key===E.ARROW_UP||r.key===E.ARROW_DOWN?this.#G(r.key):r.key===E.ENTER&&!r.isComposing?e(this.#d):r.key===E.ESC&&(i(),this.#e.focus())),!this.#t.countrySearch&&v.HIDDEN_SEARCH_CHAR.test(r.key)&&(r.stopPropagation(),o&&clearTimeout(o),s+=r.key.toLowerCase(),this.#R(s),o=setTimeout(()=>{s=""},Q.HIDDEN_SEARCH_RESET_MS))};document.addEventListener("keydown",l,{signal:t})}#V(t){this.#l.addEventListener("input",()=>this.#W(),{signal:t}),this.#u.addEventListener("click",()=>this.#x(),{signal:t})}#R(t){let e=gt(this.#b,t);if(e){let i=this.#_.get(e.iso2);this.#m(i)}}#G(t){let e=t===E.ARROW_UP?this.#d?.previousElementSibling:this.#d?.nextElementSibling;!e&&this.#n.childElementCount>1&&(e=t===E.ARROW_UP?this.#n.lastElementChild:this.#n.firstElementChild),e&&this.#m(e)}#tt(t){if(this.#g&&this.#g.dataset[w.ISO2]!==t&&(this.#g.setAttribute(p.SELECTED,"false"),this.#g.querySelector(".iti__country-check")?.remove(),this.#g=null),t&&!this.#g){let e=this.#n.querySelector(`[data-country-code="${t}"]`);if(e){e.setAttribute(p.SELECTED,"true");let i=f("span",{class:"iti__country-check",[p.HIDDEN]:"true"},e);i.innerHTML=yt(),this.#g=e,this.#t.dropdownAlwaysOpen&&this.#m(e)}}}#et(t){this.#n.replaceChildren();let e=!0;for(let i of t){let s=this.#_.get(i.iso2);s&&(this.#n.appendChild(s),e&&(this.#m(s,!1),e=!1))}e?(this.#m(null),this.#w&&this.#w.classList.remove(h.HIDE)):this.#w&&this.#w.classList.add(h.HIDE),this.#n.scrollTop=0,this.#M()}closeDropdown(){let{countrySearch:t,dropdownContainer:e}=this.#t;this.#T.abort(),this.#T=null,this.#s.classList.add(h.HIDE),this.#e.setAttribute(p.EXPANDED,"false"),t&&(this.#l.removeAttribute(p.ACTIVE_DESCENDANT),this.#l.value="",this.#f(),this.#d&&(this.#d.classList.remove(h.HIGHLIGHT),this.#d=null)),this.#o.classList.remove(h.ARROW_UP),e?(this.#r.remove(),this.#r.style.top="",this.#r.style.bottom="",this.#r.style.paddingLeft="",this.#r.style.paddingRight=""):(this.#s.style.top="",this.#s.style.bottom="")}#K(){if(this.#t.dropdownAlwaysOpen)return!0;let t=this.telInputEl.getBoundingClientRect(),e=t.top,i=window.innerHeight-t.bottom;return i>=this.#D||i>=e}#Y(){let{dropdownContainer:t,useFullscreenPopup:e}=this.#t;if(e){if(window.innerWidth>=A.NARROW_VIEWPORT_WIDTH){let i=this.telInputEl.getBoundingClientRect();this.#r.style.paddingLeft=`${i.left}px`,this.#r.style.paddingRight=`${window.innerWidth-i.right}px`}}else{let i=this.telInputEl.getBoundingClientRect();this.#r.style.left=`${i.left}px`,this.#K()?this.#r.style.top=`${i.bottom+A.DROPDOWN_MARGIN}px`:(this.#r.style.top="unset",this.#r.style.bottom=`${window.innerHeight-i.top+A.DROPDOWN_MARGIN}px`)}t.appendChild(this.#r)}#it(){let t=window.visualViewport;if(!t||!this.#r)return;let e=window.innerHeight-t.height;this.#r.style.bottom=`${e}px`}isDropdownOpen(){return!this.#s.classList.contains(h.HIDE)}setLoading(t){this.#a.classList.toggle(h.LOADING,t)}isLoading(){return this.#a.classList.contains(h.LOADING)}setDisabled(t){this.telInputEl.disabled=t,this.#e&&(t?this.#e.setAttribute("disabled","true"):this.#e.removeAttribute("disabled"))}setReadonly(t){this.telInputEl.readOnly=t,this.#e&&(t?this.#e.setAttribute("disabled","true"):this.#e.removeAttribute("disabled"))}setCountry(t){let{allowDropdown:e,showFlags:i,separateDialCode:s,i18n:o}=this.#t,l=t?.name,r=t?.dialCode,a=t?.iso2??"";if(e&&this.#tt(a),this.#e){let d=a&&i?`${h.FLAG} iti__${a}`:`${h.FLAG} ${h.GLOBE}`,c,m,y;a?(m=l,c=o.selectedCountryAriaLabel.replace("${countryName}",l).replace("${dialCode}",`+${r}`),y=i?"":et()):(m=o.noCountrySelected,c=o.noCountrySelected,y=et()),this.#a.className=d,this.#e.setAttribute("title",m),this.#e.setAttribute(p.LABEL,c),this.#a.innerHTML=y}if(s){let d=r?`+${r}`:"";this.#E.textContent=d,this.#O()}}destroy(){this.telInputEl.iti=void 0,delete this.telInputEl.dataset[w.INSTANCE_ID],this.telInputEl.style.paddingLeft=this.#y;let t=this.telInputEl.parentNode;t&&(t.before(this.telInputEl),t.remove()),this.#_.clear()}};var bt=n=>{let{onlyCountries:t,excludeCountries:e}=n;return t?.length?P.filter(i=>t.includes(i.iso2)):e?.length?P.filter(i=>!e.includes(i.iso2)):[...P]},It=(n,t)=>{let{countryNameLocale:e,i18n:i}=t,s;try{typeof Intl<"u"&&typeof Intl.DisplayNames=="function"?s=new Intl.DisplayNames(e,{type:"region"}):s=null}catch(o){console.error(o),s=null}for(let o of n)o.name=i[o.iso2]||s?.of(o.iso2.toUpperCase())||""},Lt=n=>{let t=new Set,e=0,i={},s=(l,r)=>{if(!l||!r)return;r.length>e&&(e=r.length),Object.hasOwn(i,r)||(i[r]=[]);let a=i[r];a.includes(l)||a.push(l)},o=[...n].sort((l,r)=>l.priority-r.priority);for(let l of o){t.has(l.dialCode)||t.add(l.dialCode);for(let r=1;r<l.dialCode.length;r++){let a=l.dialCode.substring(0,r);s(l.iso2,a)}if(s(l.iso2,l.dialCode),l.areaCodes){let r=i[l.dialCode][0];for(let a of l.areaCodes){for(let d=1;d<a.length;d++){let c=a.substring(0,d),m=l.dialCode+c;s(r,m),s(l.iso2,m)}s(l.iso2,l.dialCode+a)}}}return{dialCodes:t,dialCodeMaxLength:e,dialCodeToIso2Map:i}},At=(n,t)=>{let{countryOrder:e}=t;n.sort((i,s)=>{if(e){let o=e.indexOf(i.iso2),l=e.indexOf(s.iso2),r=o>-1,a=l>-1;if(r||a)return r&&a?o-l:r?-1:1}return i.name.localeCompare(s.name)})},vt=n=>{for(let t of n)t.normalisedName=$(t.name),t.initials=t.normalisedName.split(/[^a-z]/).map(e=>e[0]).join(""),t.dialCodePlus=`+${t.dialCode}`};var Ft=new Set(["800","808","870","881","882","883","888","979"]),it=n=>{let t=N(n).slice(0,3);return n.startsWith("+")&&Ft.has(t)};var st=(n,t,e,i)=>{if(!e||!t)return n;let s=`+${i.dialCode}`,o=n[s.length]===" "||n[s.length]==="-"?s.length+1:s.length;return n.substring(o)},wt=(n,t,e,i,s)=>{let o=e?e.formatNumberAsYouType(n,i?.iso2):n,l=i?.dialCode;return s&&t.charAt(0)!=="+"&&o.includes(`+${l}`)?(o.split(`+${l}`)[1]||"").trim():o};var Tt=(n,t,e,i)=>{if(e===0&&!i)return 0;let s=0;for(let o=0;o<t.length;o++){if(/[+0-9]/.test(t[o])&&s++,s===n&&!i)return o+1;if(i&&s===n+1)return o}return t.length};var Bt=new Set(["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"]),nt=n=>{let t=N(n);if(t.startsWith(B.NANP)&&t.length>=4){let e=t.substring(1,4);return Bt.has(e)}return!1};var Y=class{#t;constructor(t){t&&this.#i(t)}#i(t){/[\u0660-\u0669]/.test(t)?this.#t="arabic-indic":/[\u06F0-\u06F9]/.test(t)?this.#t="persian":this.#t="ascii"}denormalise(t){if(!this.#t||this.#t==="ascii")return t;let e=this.#t==="arabic-indic"?1632:1776;return t.replace(/[0-9]/g,i=>String.fromCharCode(e+Number(i)))}normalise(t){if(!t)return"";if(this.#i(t),this.#t==="ascii")return t;let e=this.#t==="arabic-indic"?1632:1776,i=this.#t==="arabic-indic"?/[\u0660-\u0669]/g:/[\u06F0-\u06F9]/g;return t.replace(i,s=>String.fromCharCode(48+(s.charCodeAt(0)-e)))}isAscii(){return!this.#t||this.#t==="ascii"}};var jt=0,H=n=>{if(!u.utils)throw new Error(`intlTelInput.utils is required for ${n}(). See: https://intl-tel-input.com/docs/utils`)},Nt=()=>{let n,t;return{promise:new Promise((i,s)=>{n=i,t=s}),resolve:n,reject:t}},k=class n{id;promise;#t;#i;#L;#y;#b;#A;#D;#C;#e=null;#a=null;#E;#o=!0;#s;#p;#l;#u;constructor(t,e={}){this.id=jt++,x.validateInput(t);let i=ht(e);this.#i={...G,...i},pt(this.#i),ft(this.#i),this.#t=new x(t,this.#i,this.id),this.#L=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),this.#p=new Y(t.value),this.promise=this.#v(this.#i),this.#y=bt(this.#i);let{dialCodes:s,dialCodeMaxLength:o,dialCodeToIso2Map:l}=Lt(this.#y);this.#D=s,this.#b=o,this.#A=l,this.#C=new Map(this.#y.map(r=>[r.iso2,r])),this.#w()}#n(){let t=this.#t.telInputEl.value.trim();return this.#p.normalise(t)}#c(t){this.#t.telInputEl.value=this.#p.denormalise(t)}#v(t){let{initialCountry:e,geoIpLookup:i,loadUtils:s}=t,o=e===U.AUTO&&!!i,l=!!s&&!u.utils;return o&&(this.#l=Nt()),l&&(this.#u=Nt()),Promise.all([this.#l?.promise,this.#u?.promise]).then(()=>{})}#w(){this.#s=new AbortController,this.#H(),this.#t.buildMarkup(this.#y),this.#r(),this.#g(),this.#d(),this.#i.dropdownAlwaysOpen&&this.#O()}#H(){It(this.#y,this.#i),At(this.#y,this.#i),vt(this.#y)}#r(t=!1){let e=this.#t.telInputEl.getAttribute("value"),i=this.#p.normalise(e??""),s=this.#n(),l=i&&i.startsWith("+")&&(!s||!s.startsWith("+"))?i:s,r=this.#S(l),a=nt(l),{initialCountry:d,geoIpLookup:c}=this.#i,m=d===U.AUTO&&c,y=m&&u.autoCountry?u.autoCountry:d,L=m&&!t&&!u.autoCountry,C=O(y);r?a?C?this.#f(y):L||this.#f(ot.ISO2):(C&&this.#f(y),this.#P(l)):C?this.#f(y):L||this.#f(""),l&&this.#N(l)}#g(){this.#z(),this.#i.allowDropdown&&this.#t.bindAllInitialDropdownListeners(this.#s.signal,()=>this.#O(),()=>this.#m()),this.#t.bindHiddenInputSubmitListener(this.#s.signal,()=>this.getNumber(),()=>this.#e?.iso2||"")}#d(){if(this.#u){let{loadUtils:t}=this.#i,e=()=>{u.attachUtils(t)?.catch(()=>{})};u.documentReady()?e():window.addEventListener("load",e,{signal:this.#s.signal})}this.#l&&(this.#e?this.#l.resolve():this.#_())}#_(){if(u.autoCountry){this.#G();return}if(this.#t.setLoading(!0),!u.startedLoadingAutoCountry&&(u.startedLoadingAutoCountry=!0,typeof this.#i.geoIpLookup=="function")){let t=(i="")=>{let s=i.toLowerCase();O(s)?(u.autoCountry=s,setTimeout(()=>n.forEachInstance("handleAutoCountryLoaded"))):n.forEachInstance("handleAutoCountryFailure")},e=()=>{n.forEachInstance("handleAutoCountryFailure")};this.#i.geoIpLookup(t,e)}}#T(){this.#O(),this.#t.prefillSearchWithPlus()}#k(t){let e=this.#t.telInputEl.selectionStart||0,i=t.substring(0,e-1),s=t.substring(e);return this.#c(i+s),e-1}#z(){this.#X(),this.#q(),this.#J()}#X(){let{strictMode:t,formatAsYouType:e,separateDialCode:i,allowDropdown:s,countrySearch:o}=this.#i,l=!1;v.ALPHA_UNICODE.test(this.#n())&&(l=!0);let r=a=>{if(a?.detail&&a.detail.isCountryChange)return;let d=this.#n();if(this.#L&&a?.data==="+"&&i&&s&&o){this.#k(d),this.#T();return}if(this.#L&&t&&(a?.data===" "||a?.data==="-"||a?.data===".")){let C=this.#k(d);this.#t.telInputEl.setSelectionRange(C,C),this.#h(I.STRICT_REJECT,{source:"key",rejectedInput:a.data,reason:"invalid"});return}this.#P(d)&&this.#R();let c=a?.data&&v.NON_PLUS_NUMERIC.test(a.data),m=a?.inputType===J.PASTE&&d;c||m&&!t?l=!0:v.NON_PLUS_NUMERIC.test(d)||(l=!1);let y=a?.detail&&a.detail.isSetNumber,L=this.#p.isAscii();if(e&&!l&&!y&&L){let C=this.#t.telInputEl.selectionStart||0,S=d.substring(0,C).replace(v.NON_PLUS_NUMERIC_GLOBAL,"").length,_=a?.inputType===J.DELETE_FORWARD,g=this.#I(),T=wt(g,d,u.utils,this.#e,i),D=Tt(S,T,C,_);this.#c(T),this.#t.telInputEl.setSelectionRange(D,D)}if(i&&d.startsWith("+")&&this.#e?.dialCode){let C=st(d,!0,i,this.#e);this.#c(C)}};this.#t.telInputEl.addEventListener("input",r,{signal:this.#s.signal})}#q(){let{strictMode:t,separateDialCode:e,allowDropdown:i,countrySearch:s}=this.#i;if(!t&&!e)return;let o=l=>{if(!l.key||l.key.length!==1||l.altKey||l.ctrlKey||l.metaKey)return;if(e&&i&&s&&l.key==="+"){l.preventDefault(),this.#T();return}if(!t)return;let r=this.#n(),d=!r.startsWith("+")&&this.#t.telInputEl.selectionStart===0&&l.key==="+",c=this.#p.normalise(l.key),m=/^[0-9]$/.test(c),y=e?m:d||m,L=this.#t.telInputEl,C=L.selectionStart,F=L.selectionEnd,S=r.slice(0,C??void 0),_=r.slice(F??void 0),g=S+c+_,T=this.#B(g),D=!1;u.utils&&this.#a&&(D=u.utils.getCoreNumber(T,this.#e?.iso2).length>this.#a);let z=this.#M(T)!==null;(!y||D&&!z&&!d)&&(this.#h(I.STRICT_REJECT,{source:"key",rejectedInput:l.key,reason:y?"max-length":"invalid"}),l.preventDefault())};this.#t.telInputEl.addEventListener("keydown",o,{signal:this.#s.signal})}#J(){if(!this.#i.strictMode)return;let t=e=>{e.preventDefault();let i=this.#t.telInputEl,s=i.selectionStart,o=i.selectionEnd,l=this.#n(),r=l.slice(0,s??void 0),a=l.slice(o??void 0),d=this.#e?.iso2,c=e.clipboardData.getData("text"),m=this.#p.normalise(c),y=s===0&&o>0,L=!l.startsWith("+")||y,C=m.replace(v.NON_PLUS_NUMERIC_GLOBAL,""),F=C.startsWith("+"),S=C.replace(/\+/g,""),_=F&&L?`+${S}`:S,g=r+_+a,T=_!==m?"invalid":null;if(g.length>5&&u.utils){let R=u.utils.getCoreNumber(g,d);for(;R.length===0&&g.length>0;)g=g.slice(0,-1),R=u.utils.getCoreNumber(g,d);if(!R){this.#h(I.STRICT_REJECT,{source:"paste",rejectedInput:c,reason:"max-length"});return}if(this.#a&&R.length>this.#a)if(i.selectionEnd===l.length){let z=R.length-this.#a;g=g.slice(0,g.length-z),T="max-length"}else{this.#h(I.STRICT_REJECT,{source:"paste",rejectedInput:c,reason:"max-length"});return}}this.#c(g);let D=s+_.length;i.setSelectionRange(D,D),i.dispatchEvent(new InputEvent("input",{bubbles:!0})),T&&this.#h(I.STRICT_REJECT,{source:"paste",rejectedInput:c,reason:T})};this.#t.telInputEl.addEventListener("paste",t,{signal:this.#s.signal})}#Q(t){let e=Number(this.#t.telInputEl.getAttribute("maxlength"));return e&&t.length>e?t.substring(0,e):t}#h(t,e={}){let i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e});this.#t.telInputEl.dispatchEvent(i)}#O(){this.#t.openDropdown(t=>this.#$(t),()=>this.#m()),this.#h(I.OPEN_COUNTRY_DROPDOWN)}#N(t){let{formatOnDisplay:e,nationalMode:i,separateDialCode:s}=this.#i,o=t;if(e&&u.utils&&this.#e){let l=it(t),r=i&&!l||!o.startsWith("+")&&!s,{NATIONAL:a,INTERNATIONAL:d}=u.utils.numberFormat,c=r?a:d;o=u.utils.formatNumber(o,this.#e?.iso2,c)}o=this.#j(o),this.#c(o)}#P(t){let e=this.#M(t);return e!==null?this.#f(e):!1}#Z(t){let e=this.#e?.dialCode,i=this.#e?.nationalPrefix;if(t.startsWith("+")||!e)return t;let l=i&&t.startsWith(i)&&!this.#i.separateDialCode?t.substring(1):t;return`+${e}${l}`}#M(t){let e=t.indexOf("+"),i=e>0?t.substring(e):t,s=this.#e?.iso2;i=this.#Z(i);let o=this.#S(i,!0),l=N(i);if(o){let r=N(o),a=this.#A[r];return a.length===1?a[0]===s?null:a[0]:this.#U(a,r,l)}else if(i.startsWith("+")&&l.length){let r=this.#e?.dialCode||"";return r&&r.startsWith(l)?null:""}else if((!i||i==="+")&&!s&&this.#E)return this.#E;return null}#U(t,e,i){let s=this.#e?.iso2,o=this.#e?.dialCode;if(!s&&this.#E&&t.includes(this.#E))return this.#E;if(o===B.NANP&&nt(i))return null;let r=this.#e?.areaCodes,a=this.#e?.priority;if(r){let L=r.map(C=>`${o}${C}`);for(let C of L)if(i.startsWith(C))return null}let c=r&&!(a===0)&&i.length>e.length,m=s&&t.includes(s)&&!c,y=s===t[0];return!m&&!y?t[0]:null}#f(t){let e=this.#e?.iso2||"";return this.#e=t?this.#C.get(t):null,this.#e&&(this.#E=this.#e.iso2),this.#t.setCountry(this.#e),this.#x(),this.#W(),e!==t}#W(){let{strictMode:t,placeholderNumberType:e,allowedNumberTypes:i}=this.#i;if(!t||!u.utils)return;let s=this.#e?.iso2;if(!s){this.#a=null;return}let o=u.utils.numberType[e],l=u.utils.getExampleNumber(s,!1,o,!0),r=l;for(;u.utils.isPossibleNumber(l,s,i);)r=l,l+="0";let a=u.utils.getCoreNumber(r,s);this.#a=a.length,s==="by"&&(this.#a=a.length+1)}#x(){let{autoPlaceholder:t,placeholderNumberType:e,nationalMode:i,customPlaceholder:s}=this.#i,o=t===M.AGGRESSIVE||!this.#t.hadInitialPlaceholder&&t===M.POLITE;if(!u.utils||!o)return;let l=u.utils.numberType[e],r=this.#e?u.utils.getExampleNumber(this.#e.iso2,i,l):"";r=this.#j(r),typeof s=="function"&&(r=s(r,this.#e)),this.#t.telInputEl.setAttribute("placeholder",r)}#$(t){if(!t)return;let e=t.dataset[w.ISO2],i=this.#f(e);this.#m();let s=t.dataset[w.DIAL_CODE];if(this.#F(s),this.#i.formatOnDisplay){let o=this.#n();this.#N(o)}this.#t.telInputEl.focus(),i&&(this.#R(),this.#h(I.INPUT,{isCountryChange:!0}))}#m(t){!this.#t.isDropdownOpen()||this.#i.dropdownAlwaysOpen&&!t||(this.#t.closeDropdown(),this.#h(I.CLOSE_COUNTRY_DROPDOWN))}#F(t){let e=this.#n();if(!e.startsWith("+"))return;let i=`+${t}`,s=this.#S(e),o;s?o=e.replace(s,i):o=i,this.#c(o)}#S(t,e){if(!t.startsWith("+"))return"";let i="",s="",o=!1;for(let l=0;l<t.length;l++){let r=t.charAt(l);if(!/[0-9]/.test(r))continue;if(s+=r,!!!this.#A[s])break;if(this.#D.has(s)){if(i=t.substring(0,l+1),o=!0,!e)break}else e&&o&&(i=t.substring(0,l+1));if(s.length===this.#b)break}return i}#B(t){let e=this.#e?.dialCode,i=N(t);return(this.#i.separateDialCode&&!t.startsWith("+")&&e&&i?`+${e}`:"")+t}#I(){let t=this.#n();return this.#B(t)}#j(t){let e=!!this.#S(t),i=st(t,e,this.#i.separateDialCode,this.#e);return this.#Q(i)}#V(){let t=this.#e;if(!t)return null;let{iso2:e,dialCode:i,name:s}=t;return{iso2:e,dialCode:i,name:s}}#R(){let t=this.#V();this.#h(I.COUNTRY_CHANGE,t)}#G(){if(!(!this.#l||!u.autoCountry)){if(!this.#o){this.#l.resolve();return}this.#t.isLoading()?this.setCountry(u.autoCountry):this.#E=u.autoCountry,this.#t.setLoading(!1),this.#l.resolve()}}#tt(){if(!this.#o){this.#l?.reject();return}this.#r(!0),this.#t.setLoading(!1),this.#l?.reject()}#et(){if(!this.#o){this.#u?.resolve();return}if(!u.utils){this.#u?.resolve();return}let t=this.#n();t&&this.#N(t),this.#e&&(this.#x(),this.#W()),this.#u?.resolve()}#K(t){if(!this.#o){this.#u?.reject(t);return}this.#u?.reject(t)}destroy(){this.#o&&(this.#o=!1,this.#i.allowDropdown&&this.#m(!0),this.#s.abort(),this.#t.destroy(),u.instances.delete(String(this.id)))}isActive(){return this.#o}getExtension(){return this.#o?(H("getExtension"),u.utils.getExtension(this.#I(),this.#e?.iso2)):""}getNumber(t){if(!this.#o)return"";H("getNumber");let e=this.#e?.iso2,i=this.#I(),s=u.utils.formatNumber(i,e,t);return this.#p.denormalise(s)}getNumberType(){return this.#o?(H("getNumberType"),u.utils.getNumberType(this.#I(),this.#e?.iso2)):Z.UNKNOWN_NUMBER_TYPE}getSelectedCountryData(){return this.#V()}getValidationError(){if(!this.#o)return Z.UNKNOWN_VALIDATION_ERROR;H("getValidationError");let t=this.#e?.iso2;return u.utils.getValidationError(this.#I(),t)}isValidNumber(){if(!this.#o)return null;H("isValidNumber");let t=this.#e?.dialCode,e=this.#e?.iso2,i=this.#I(),s=u.utils.getCoreNumber(i,e);if(s){if(t===j.DIAL_CODE&&s[0]===j.MOBILE_PREFIX&&s.length!==j.MOBILE_CORE_LENGTH)return!1;if(!v.ALPHA_UNICODE.test(i)&&t){let l=i.startsWith("+")?i.slice(1+t.length):i,r=N(l).length;if(s.length>r)return!1}}return this.#Y("possible")}isValidNumberPrecise(){return this.#o?(H("isValidNumberPrecise"),this.#Y("precise")):null}#Y(t){let{allowNumberExtensions:e,allowPhonewords:i,allowedNumberTypes:s}=this.#i,o=this.#e?.iso2,l=this.#I();return!this.#e&&!it(l)||!(t==="precise"?u.utils.isValidNumber:u.utils.isPossibleNumber)(l,o,s)?!1:v.ALPHA_UNICODE.test(l)?!!u.utils.getExtension(l,o)?e:i:!0}setCountry(t){if(!this.#o)return;let e=t?.toLowerCase();if(!O(e))throw new Error(`Invalid iso2 code: '${e}'`);let i=this.#e?.iso2;if(t&&e!==i||!t&&i){if(this.#f(e),this.#F(this.#e?.dialCode||""),this.#i.formatOnDisplay){let o=this.#n();this.#N(o)}this.#R(),this.#h(I.INPUT,{isCountryChange:!0})}}setNumber(t){if(!this.#o)return;let e=this.#p.normalise(t),i=this.#P(e);this.#N(e),i&&this.#R(),this.#h(I.INPUT,{isSetNumber:!0})}setPlaceholderNumberType(t){this.#o&&(this.#i.placeholderNumberType=t,this.#x())}setDisabled(t){this.#o&&this.#t.setDisabled(t)}setReadonly(t){this.#o&&this.#t.setReadonly(t)}static forEachInstance(t,...e){let i=[...u.instances.values()],s=e[0];i.forEach(o=>{if(o instanceof n)switch(t){case"handleUtilsLoaded":o.#et();break;case"handleUtilsFailure":o.#K(s);break;case"handleAutoCountryLoaded":o.#G();break;case"handleAutoCountryFailure":o.#tt();break}})}},Vt=n=>{if(!u.utils&&!u.startedLoadingUtils){let t;if(typeof n=="function")try{t=Promise.resolve(n())}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 utils module, not ${typeof n}`));return u.startedLoadingUtils=!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 u.utils=i,k.forEachInstance("handleUtilsLoaded"),!0}).catch(e=>{throw k.forEachInstance("handleUtilsFailure",e),e})}return null},u=Object.assign((n,t)=>{let e=new k(n,t);return u.instances.set(String(e.id),e),n.iti=e,e},{defaults:G,documentReady:()=>document.readyState==="complete",getCountryData:()=>P,getInstance:n=>{let t=n.dataset[w.INSTANCE_ID];return t?u.instances.get(t)??null:null},instances:new Map,attachUtils:Vt,startedLoadingUtils:!1,startedLoadingAutoCountry:!1,version:"27.1.2"}),Gt=u;return Pt(Kt);})();
25
25
  var intlTelInput = _factory.default;