intl-tel-input 27.2.1 → 27.3.0

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.
@@ -1308,6 +1308,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1308
1308
  placeholderNumberType: "MOBILE",
1309
1309
  searchInputClass: "",
1310
1310
  separateDialCode: !1,
1311
+ strictRejectAnimation: !1,
1311
1312
  showFlags: !0,
1312
1313
  strictMode: !1,
1313
1314
  useFullscreenPopup: (() => {
@@ -1325,7 +1326,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1325
1326
  console.warn(`[intl-tel-input] ${e}`);
1326
1327
  }, B = (e, t, n) => {
1327
1328
  z(`Option '${e}' must be ${t}; got ${I(n)}. Ignoring.`);
1328
- }, ne = (e, t) => {
1329
+ }, V = (e, t) => {
1329
1330
  let n = "an array of iso2 country code strings";
1330
1331
  if (!Array.isArray(t)) return B(e, n, t), !1;
1331
1332
  let r = [];
@@ -1334,7 +1335,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1334
1335
  m(i.toLowerCase()) ? r.push(i) : z(`Invalid iso2 code in '${e}': '${i}'. Skipping.`);
1335
1336
  }
1336
1337
  return r;
1337
- }, re = (e) => {
1338
+ }, ne = (e) => {
1338
1339
  if (e === void 0) return {};
1339
1340
  if (!L(e)) return z(`The second argument must be an options object; got ${I(e)}. Using defaults.`), {};
1340
1341
  let t = {};
@@ -1356,6 +1357,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1356
1357
  case "showFlags":
1357
1358
  case "separateDialCode":
1358
1359
  case "strictMode":
1360
+ case "strictRejectAnimation":
1359
1361
  case "useFullscreenPopup":
1360
1362
  if (typeof r != "boolean") {
1361
1363
  B(n, "a boolean", r);
@@ -1382,7 +1384,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1382
1384
  case "countryOrder":
1383
1385
  if (r === null) t[n] = r;
1384
1386
  else {
1385
- let e = ne(n, r);
1387
+ let e = V(n, r);
1386
1388
  e !== !1 && (t[n] = e);
1387
1389
  }
1388
1390
  break;
@@ -1407,7 +1409,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1407
1409
  case "onlyCountries":
1408
1410
  if (r === null) t[n] = r;
1409
1411
  else {
1410
- let e = ne(n, r);
1412
+ let e = V(n, r);
1411
1413
  e !== !1 && (t[n] = e);
1412
1414
  }
1413
1415
  break;
@@ -1455,21 +1457,21 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1455
1457
  }
1456
1458
  }
1457
1459
  return t;
1458
- }, ie = (e) => {
1460
+ }, re = (e) => {
1459
1461
  e.initialCountry &&= e.initialCountry.toLowerCase(), e.onlyCountries?.length && (e.onlyCountries = e.onlyCountries.map((e) => e.toLowerCase())), e.excludeCountries?.length && (e.excludeCountries = e.excludeCountries.map((e) => e.toLowerCase())), e.countryOrder &&= e.countryOrder.map((e) => e.toLowerCase());
1460
- }, ae = (e) => {
1462
+ }, ie = (e) => {
1461
1463
  e.dropdownAlwaysOpen && (e.useFullscreenPopup = !1, e.allowDropdown = !0), e.useFullscreenPopup ? e.fixDropdownWidth = !1 : P() && (e.fixDropdownWidth = !0), e.onlyCountries?.length === 1 && (e.initialCountry = e.onlyCountries[0]), e.separateDialCode && (e.nationalMode = !1), e.allowDropdown && !e.showFlags && !e.separateDialCode && (e.nationalMode = !1), e.useFullscreenPopup && !e.dropdownContainer && (e.dropdownContainer = document.body), e.i18n = {
1462
1464
  ...M,
1463
1465
  ...e.i18n
1464
1466
  };
1465
- }, V = (e) => e.replace(/\D/g, ""), H = (e = "") => e.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(), U = (e) => Object.keys(e).filter((t) => !!e[t]).join(" "), W = (e, t, n) => {
1467
+ }, H = (e) => e.replace(/\D/g, ""), U = (e = "") => e.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(), W = (e) => Object.keys(e).filter((t) => !!e[t]).join(" "), G = (e, t, n) => {
1466
1468
  let r = document.createElement(e);
1467
1469
  return t && Object.entries(t).forEach(([e, t]) => r.setAttribute(e, t)), n && n.appendChild(r), r;
1468
- }, oe = () => `
1470
+ }, ae = () => `
1469
1471
  <svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" ${j.HIDDEN}="true">
1470
1472
  <circle cx="11" cy="11" r="7" />
1471
1473
  <line x1="21" y1="21" x2="16.65" y2="16.65" />
1472
- </svg>`, se = (e) => {
1474
+ </svg>`, oe = (e) => {
1473
1475
  let t = `iti-${e}-clear-mask`;
1474
1476
  return `
1475
1477
  <svg class="iti__search-clear-svg" width="12" height="12" viewBox="0 0 16 16" ${j.HIDDEN}="true" focusable="false">
@@ -1479,11 +1481,11 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1479
1481
  </mask>
1480
1482
  <circle cx="8" cy="8" r="8" class="iti__search-clear-bg" mask="url(#${t})" />
1481
1483
  </svg>`;
1482
- }, ce = () => `
1484
+ }, se = () => `
1483
1485
  <svg class="iti__country-check-svg" width="14" height="14" viewBox="0 0 16 16" fill="currentColor" focusable="false" ${j.HIDDEN}="true">
1484
1486
  <path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"/>
1485
- </svg>`, G = () => "\n <svg width=\"256\" height=\"256\" viewBox=\"0 0 512 512\" class=\"iti__globe-svg\">\n <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\"/>\n <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\"/>\n </svg>", le = (e, t) => {
1486
- let n = H(t), r = [], i = [], a = [], o = [], s = [], c = [];
1487
+ </svg>`, K = () => "\n <svg width=\"256\" height=\"256\" viewBox=\"0 0 512 512\" class=\"iti__globe-svg\">\n <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\"/>\n <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\"/>\n </svg>", ce = (e, t) => {
1488
+ let n = U(t), r = [], i = [], a = [], o = [], s = [], c = [];
1487
1489
  for (let t of e) t.iso2 === n ? r.push(t) : t.normalisedName.startsWith(n) ? i.push(t) : t.normalisedName.includes(n) ? a.push(t) : n === t.dialCode || n === t.dialCodePlus ? o.push(t) : t.dialCodePlus.includes(n) ? s.push(t) : t.initials.includes(n) && c.push(t);
1488
1490
  let l = (e, t) => e.priority - t.priority;
1489
1491
  return [
@@ -1494,11 +1496,11 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1494
1496
  ...s.sort(l),
1495
1497
  ...c
1496
1498
  ];
1497
- }, ue = (e, t) => {
1498
- let n = H(t);
1499
+ }, le = (e, t) => {
1500
+ let n = U(t);
1499
1501
  for (let t of e) if (t.normalisedName.startsWith(n)) return t;
1500
1502
  return null;
1501
- }, K = class e {
1503
+ }, q = class e {
1502
1504
  #e;
1503
1505
  #t;
1504
1506
  #n;
@@ -1543,7 +1545,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1543
1545
  this.#D(t), t.appendChild(this.telInputEl), this.#A(), this.#j(t), this.ensureDropdownWidthSet();
1544
1546
  }
1545
1547
  #E() {
1546
- let { allowDropdown: e, showFlags: t, containerClass: n, useFullscreenPopup: r } = this.#e, i = W("div", { class: U({
1548
+ let { allowDropdown: e, showFlags: t, containerClass: n, useFullscreenPopup: r } = this.#e, i = G("div", { class: W({
1547
1549
  iti: !0,
1548
1550
  "iti--allow-dropdown": e,
1549
1551
  "iti--show-flags": t,
@@ -1555,19 +1557,19 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1555
1557
  #D(e) {
1556
1558
  let { allowDropdown: t, separateDialCode: n, showFlags: r } = this.#e;
1557
1559
  if (!t && !r && !n) return;
1558
- this.#s = W("div", { class: `iti__country-container ${_.V_HIDE}` }, e), t ? (this.#c = W("button", {
1560
+ this.#s = G("div", { class: `iti__country-container ${_.V_HIDE}` }, e), t ? (this.#c = G("button", {
1559
1561
  type: "button",
1560
1562
  class: "iti__selected-country",
1561
1563
  [j.EXPANDED]: "false",
1562
1564
  [j.LABEL]: this.#e.i18n.noCountrySelected,
1563
1565
  [j.HASPOPUP]: "dialog",
1564
1566
  [j.CONTROLS]: `iti-${this.#t}__dropdown-content`
1565
- }, this.#s), this.telInputEl.disabled && this.#c.setAttribute("disabled", "true")) : this.#c = W("div", { class: "iti__selected-country" }, this.#s);
1566
- let i = W("div", { class: "iti__selected-country-primary" }, this.#c);
1567
- this.#l = W("div", { class: _.FLAG }, i), t && (this.#d = W("div", {
1567
+ }, this.#s), this.telInputEl.disabled && this.#c.setAttribute("disabled", "true")) : this.#c = G("div", { class: "iti__selected-country" }, this.#s);
1568
+ let i = G("div", { class: "iti__selected-country-primary" }, this.#c);
1569
+ this.#l = G("div", { class: _.FLAG }, i), t && (this.#d = G("div", {
1568
1570
  class: "iti__arrow",
1569
1571
  [j.HIDDEN]: "true"
1570
- }, i)), n && (this.#u = W("div", { class: "iti__selected-dial-code" }, this.#c)), t && this.#O();
1572
+ }, i)), n && (this.#u = G("div", { class: "iti__selected-dial-code" }, this.#c)), t && this.#O();
1571
1573
  }
1572
1574
  ensureDropdownWidthSet() {
1573
1575
  let { fixDropdownWidth: e, allowDropdown: t } = this.#e;
@@ -1577,17 +1579,17 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1577
1579
  }
1578
1580
  #O() {
1579
1581
  let { fixDropdownWidth: e, useFullscreenPopup: t, countrySearch: n, i18n: r, dropdownContainer: i, containerClass: a } = this.#e, o = e ? "" : "iti--flexible-dropdown-width";
1580
- this.#f = W("div", {
1582
+ this.#f = G("div", {
1581
1583
  id: `iti-${this.#t}__dropdown-content`,
1582
1584
  class: `iti__dropdown-content ${_.HIDE} ${o}`,
1583
1585
  role: "dialog",
1584
1586
  [j.MODAL]: "true"
1585
- }), this.#n && this.#f.setAttribute("dir", "rtl"), n && this.#k(), this.#g = W("ul", {
1587
+ }), this.#n && this.#f.setAttribute("dir", "rtl"), n && this.#k(), this.#g = G("ul", {
1586
1588
  class: "iti__country-list",
1587
1589
  id: `iti-${this.#t}__country-listbox`,
1588
1590
  role: "listbox",
1589
1591
  [j.LABEL]: r.countryListAriaLabel
1590
- }, this.#f), this.#M(), n && this.#L(), t || (this.#o = this.#I(), n && (this.#f.style.height = `${this.#o}px`)), i ? (this.#x = W("div", { class: U({
1592
+ }, this.#f), this.#M(), n && this.#L(), t || (this.#o = this.#I(), n && (this.#f.style.height = `${this.#o}px`)), i ? (this.#x = G("div", { class: W({
1591
1593
  iti: !0,
1592
1594
  "iti--container": !0,
1593
1595
  "iti--fullscreen-popup": t,
@@ -1596,11 +1598,11 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1596
1598
  }) }), this.#x.appendChild(this.#f)) : this.#s.appendChild(this.#f);
1597
1599
  }
1598
1600
  #k() {
1599
- let { i18n: e, searchInputClass: t } = this.#e, n = W("div", { class: "iti__search-input-wrapper" }, this.#f);
1600
- this.#p = W("span", {
1601
+ let { i18n: e, searchInputClass: t } = this.#e, n = G("div", { class: "iti__search-input-wrapper" }, this.#f);
1602
+ this.#p = G("span", {
1601
1603
  class: "iti__search-icon",
1602
1604
  [j.HIDDEN]: "true"
1603
- }, n), this.#p.innerHTML = oe(), this.#m = W("input", {
1605
+ }, n), this.#p.innerHTML = ae(), this.#m = G("input", {
1604
1606
  id: `iti-${this.#t}__search-input`,
1605
1607
  type: "search",
1606
1608
  class: `iti__search-input ${t}`,
@@ -1611,12 +1613,12 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1611
1613
  [j.CONTROLS]: `iti-${this.#t}__country-listbox`,
1612
1614
  [j.AUTOCOMPLETE]: "list",
1613
1615
  autocomplete: "off"
1614
- }, n), this.#h = W("button", {
1616
+ }, n), this.#h = G("button", {
1615
1617
  type: "button",
1616
1618
  class: `iti__search-clear ${_.HIDE}`,
1617
1619
  [j.LABEL]: e.clearSearchAriaLabel,
1618
1620
  tabindex: "-1"
1619
- }, n), this.#h.innerHTML = se(this.#t), this.#b = W("span", { class: "iti__a11y-text" }, this.#f), this.#y = W("div", {
1621
+ }, n), this.#h.innerHTML = oe(this.#t), this.#b = G("span", { class: "iti__a11y-text" }, this.#f), this.#y = G("div", {
1620
1622
  class: `iti__no-results ${_.HIDE}`,
1621
1623
  [j.HIDDEN]: "true"
1622
1624
  }, this.#f), this.#y.textContent = e.searchEmptyState ?? null;
@@ -1630,14 +1632,14 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1630
1632
  let n = t(this.telInputEl.getAttribute("name") || "");
1631
1633
  if (n.phone) {
1632
1634
  let t = this.telInputEl.form?.querySelector(`input[name="${n.phone}"]`);
1633
- t ? this.#_ = t : (this.#_ = W("input", {
1635
+ t ? this.#_ = t : (this.#_ = G("input", {
1634
1636
  type: "hidden",
1635
1637
  name: n.phone
1636
1638
  }), e.appendChild(this.#_));
1637
1639
  }
1638
1640
  if (n.country) {
1639
1641
  let t = this.telInputEl.form?.querySelector(`input[name="${n.country}"]`);
1640
- t ? this.#v = t : (this.#v = W("input", {
1642
+ t ? this.#v = t : (this.#v = G("input", {
1641
1643
  type: "hidden",
1642
1644
  name: n.country
1643
1645
  }), e.appendChild(this.#v));
@@ -1646,17 +1648,17 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1646
1648
  #M() {
1647
1649
  let e = document.createDocumentFragment();
1648
1650
  for (let t = 0; t < this.#i.length; t++) {
1649
- let n = this.#i[t], r = U({ [_.COUNTRY_ITEM]: !0 }), i = W("li", {
1651
+ let n = this.#i[t], r = W({ [_.COUNTRY_ITEM]: !0 }), i = G("li", {
1650
1652
  id: `iti-${this.#t}__item-${n.iso2}`,
1651
1653
  class: r,
1652
1654
  tabindex: "-1",
1653
1655
  role: "option",
1654
1656
  [j.SELECTED]: "false"
1655
1657
  });
1656
- i.dataset[A.DIAL_CODE] = n.dialCode, i.dataset[A.ISO2] = n.iso2, this.#w.set(n.iso2, i), this.#e.showFlags && W("div", { class: `${_.FLAG} iti__${n.iso2}` }, i);
1657
- let a = W("span", { class: "iti__country-name" }, i);
1658
+ i.dataset[A.DIAL_CODE] = n.dialCode, i.dataset[A.ISO2] = n.iso2, this.#w.set(n.iso2, i), this.#e.showFlags && G("div", { class: `${_.FLAG} iti__${n.iso2}` }, i);
1659
+ let a = G("span", { class: "iti__country-name" }, i);
1658
1660
  a.textContent = `${n.name} `;
1659
- let o = W("span", { class: "iti__dial-code" }, a);
1661
+ let o = G("span", { class: "iti__dial-code" }, a);
1660
1662
  this.#n && o.setAttribute("dir", "ltr"), o.textContent = `(+${n.dialCode})`, e.appendChild(i);
1661
1663
  }
1662
1664
  this.#g.appendChild(e);
@@ -1690,7 +1692,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1690
1692
  #I() {
1691
1693
  let t = e.#P();
1692
1694
  this.#f.classList.remove(_.HIDE);
1693
- let n = W("div", { class: "iti iti--inline-dropdown" });
1695
+ let n = G("div", { class: "iti iti--inline-dropdown" });
1694
1696
  n.appendChild(this.#f), n.style.visibility = "hidden", t.appendChild(n);
1695
1697
  let r = this.#f.offsetHeight;
1696
1698
  return t.removeChild(n), n.style.visibility = "", this.#f.classList.add(_.HIDE), r > 0 ? r : C.FALLBACK_DROPDOWN_HEIGHT;
@@ -1701,7 +1703,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1701
1703
  }
1702
1704
  #R(e) {
1703
1705
  let t;
1704
- t = e === "" ? this.#i : le(this.#i, e), this.#$(t);
1706
+ t = e === "" ? this.#i : ce(this.#i, e), this.#$(t);
1705
1707
  }
1706
1708
  prefillSearchWithPlus() {
1707
1709
  this.#m.value = "+", this.#m.focus(), this.#R("");
@@ -1806,7 +1808,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1806
1808
  this.#m.addEventListener("input", () => this.#B(), { signal: e }), this.#h.addEventListener("click", () => this.#V(), { signal: e });
1807
1809
  }
1808
1810
  #X(e) {
1809
- let t = ue(this.#i, e);
1811
+ let t = le(this.#i, e);
1810
1812
  if (t) {
1811
1813
  let e = this.#w.get(t.iso2);
1812
1814
  this.#U(e);
@@ -1821,11 +1823,11 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1821
1823
  let t = this.#g.querySelector(`[data-country-code="${e}"]`);
1822
1824
  if (t) {
1823
1825
  t.setAttribute(j.SELECTED, "true");
1824
- let e = W("span", {
1826
+ let e = G("span", {
1825
1827
  class: "iti__country-check",
1826
1828
  [j.HIDDEN]: "true"
1827
1829
  }, t);
1828
- e.innerHTML = ce(), this.#S = t, this.#e.dropdownAlwaysOpen && this.#U(t);
1830
+ e.innerHTML = se(), this.#S = t, this.#e.dropdownAlwaysOpen && this.#U(t);
1829
1831
  }
1830
1832
  }
1831
1833
  }
@@ -1885,7 +1887,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1885
1887
  let { allowDropdown: t, showFlags: n, separateDialCode: r, i18n: i } = this.#e, a = e?.name, o = e?.dialCode, s = e?.iso2 ?? "";
1886
1888
  if (t && this.#Q(s), this.#c) {
1887
1889
  let e = s && n ? `${_.FLAG} iti__${s}` : `${_.FLAG} ${_.GLOBE}`, t, r, c;
1888
- s ? (r = a, t = i.selectedCountryAriaLabel.replace("${countryName}", a).replace("${dialCode}", `+${o}`), c = n ? "" : G()) : (r = i.noCountrySelected, t = i.noCountrySelected, c = G()), this.#l.className = e, this.#c.setAttribute("title", r), this.#c.setAttribute(j.LABEL, t), this.#l.innerHTML = c;
1890
+ s ? (r = a, t = i.selectedCountryAriaLabel.replace("${countryName}", a).replace("${dialCode}", `+${o}`), c = n ? "" : K()) : (r = i.noCountrySelected, t = i.noCountrySelected, c = K()), this.#l.className = e, this.#c.setAttribute("title", r), this.#c.setAttribute(j.LABEL, t), this.#l.innerHTML = c;
1889
1891
  }
1890
1892
  if (r) {
1891
1893
  let e = o ? `+${o}` : "";
@@ -1897,10 +1899,10 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1897
1899
  let e = this.telInputEl.parentNode;
1898
1900
  e && (e.before(this.telInputEl), e.remove()), this.#w.clear();
1899
1901
  }
1900
- }, de = (e) => {
1902
+ }, ue = (e) => {
1901
1903
  let { onlyCountries: t, excludeCountries: n } = e;
1902
1904
  return t?.length ? h.filter((e) => t.includes(e.iso2)) : n?.length ? h.filter((e) => !n.includes(e.iso2)) : [...h];
1903
- }, fe = (e, t) => {
1905
+ }, de = (e, t) => {
1904
1906
  let { countryNameLocale: n, i18n: r } = t, i;
1905
1907
  try {
1906
1908
  i = typeof Intl < "u" && typeof Intl.DisplayNames == "function" ? new Intl.DisplayNames(n, { type: "region" }) : null;
@@ -1908,7 +1910,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1908
1910
  console.error(e), i = null;
1909
1911
  }
1910
1912
  for (let t of e) t.name = r[t.iso2] || i?.of(t.iso2.toUpperCase()) || "";
1911
- }, pe = (e) => {
1913
+ }, fe = (e) => {
1912
1914
  let t = /* @__PURE__ */ new Set(), n = 0, r = {}, i = (e, t) => {
1913
1915
  if (!e || !t) return;
1914
1916
  t.length > n && (n = t.length), Object.hasOwn(r, t) || (r[t] = []);
@@ -1937,7 +1939,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1937
1939
  dialCodeMaxLength: n,
1938
1940
  dialCodeToIso2Map: r
1939
1941
  };
1940
- }, me = (e, t) => {
1942
+ }, pe = (e, t) => {
1941
1943
  let { countryOrder: n } = t;
1942
1944
  e.sort((e, t) => {
1943
1945
  if (n) {
@@ -1946,9 +1948,9 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1946
1948
  }
1947
1949
  return e.name.localeCompare(t.name);
1948
1950
  });
1949
- }, he = (e) => {
1950
- for (let t of e) t.normalisedName = H(t.name), t.initials = t.normalisedName.split(/[^a-z]/).map((e) => e[0]).join(""), t.dialCodePlus = `+${t.dialCode}`;
1951
- }, ge = /* @__PURE__ */ new Set([
1951
+ }, me = (e) => {
1952
+ for (let t of e) t.normalisedName = U(t.name), t.initials = t.normalisedName.split(/[^a-z]/).map((e) => e[0]).join(""), t.dialCodePlus = `+${t.dialCode}`;
1953
+ }, he = /* @__PURE__ */ new Set([
1952
1954
  "800",
1953
1955
  "808",
1954
1956
  "870",
@@ -1957,17 +1959,17 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1957
1959
  "883",
1958
1960
  "888",
1959
1961
  "979"
1960
- ]), q = (e) => {
1961
- let t = V(e).slice(0, 3);
1962
- return e.startsWith("+") && ge.has(t);
1963
- }, J = (e, t, n, r) => {
1962
+ ]), J = (e) => {
1963
+ let t = H(e).slice(0, 3);
1964
+ return e.startsWith("+") && he.has(t);
1965
+ }, Y = (e, t, n, r) => {
1964
1966
  if (!n || !t) return e;
1965
1967
  let i = `+${r.dialCode}`, a = e[i.length] === " " || e[i.length] === "-" ? i.length + 1 : i.length;
1966
1968
  return e.substring(a);
1967
- }, _e = (e, t, n, r, i) => {
1969
+ }, ge = (e, t, n, r, i) => {
1968
1970
  let a = n ? n.formatNumberAsYouType(e, r?.iso2) : e, o = r?.dialCode;
1969
1971
  return i && t.charAt(0) !== "+" && a.includes(`+${o}`) ? (a.split(`+${o}`)[1] || "").trim() : a;
1970
- }, ve = (e, t, n, r) => {
1972
+ }, _e = (e, t, n, r) => {
1971
1973
  if (n === 0 && !r) return 0;
1972
1974
  let i = 0;
1973
1975
  for (let n = 0; n < t.length; n++) {
@@ -1975,7 +1977,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1975
1977
  if (r && i === e + 1) return n;
1976
1978
  }
1977
1979
  return t.length;
1978
- }, ye = /* @__PURE__ */ new Set([
1980
+ }, ve = /* @__PURE__ */ new Set([
1979
1981
  "800",
1980
1982
  "822",
1981
1983
  "833",
@@ -1993,11 +1995,11 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1993
1995
  "887",
1994
1996
  "888",
1995
1997
  "889"
1996
- ]), Y = (e) => {
1997
- let t = V(e);
1998
+ ]), ye = (e) => {
1999
+ let t = H(e);
1998
2000
  if (t.startsWith(w.NANP) && t.length >= 4) {
1999
2001
  let e = t.substring(1, 4);
2000
- return ye.has(e);
2002
+ return ve.has(e);
2001
2003
  }
2002
2004
  return !1;
2003
2005
  }, be = class {
@@ -2054,13 +2056,13 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
2054
2056
  #h;
2055
2057
  #g;
2056
2058
  constructor(e, t = {}) {
2057
- this.id = xe++, K.validateInput(e);
2058
- let n = re(t);
2059
+ this.id = xe++, q.validateInput(e);
2060
+ let n = ne(t);
2059
2061
  this.#t = {
2060
2062
  ...F,
2061
2063
  ...n
2062
- }, ie(this.#t), ae(this.#t), this.#e = new K(e, this.#t, this.id), this.#n = typeof navigator < "u" && /Android/i.test(navigator.userAgent), this.#p = new be(e.value), this.promise = this.#y(this.#t), this.#r = de(this.#t);
2063
- let { dialCodes: r, dialCodeMaxLength: i, dialCodeToIso2Map: a } = pe(this.#r);
2064
+ }, re(this.#t), ie(this.#t), this.#e = new q(e, this.#t, this.id), this.#n = typeof navigator < "u" && /Android/i.test(navigator.userAgent), this.#p = new be(e.value), this.promise = this.#y(this.#t), this.#r = ue(this.#t);
2065
+ let { dialCodes: r, dialCodeMaxLength: i, dialCodeToIso2Map: a } = fe(this.#r);
2064
2066
  this.#o = r, this.#i = i, this.#a = a, this.#s = new Map(this.#r.map((e) => [e.iso2, e])), this.#b();
2065
2067
  }
2066
2068
  #_() {
@@ -2075,17 +2077,17 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
2075
2077
  return i && (this.#h = Se()), a && (this.#g = Se()), Promise.all([this.#h?.promise, this.#g?.promise]).then(() => {});
2076
2078
  }
2077
2079
  #b() {
2078
- this.#f = new AbortController(), this.#x(), this.#e.buildMarkup(this.#r), this.#S(), this.#C(), this.#w(), this.#t.dropdownAlwaysOpen && this.#V();
2080
+ this.#f = new AbortController(), this.#x(), this.#e.buildMarkup(this.#r), this.#S(), this.#C(), this.#w(), this.#t.dropdownAlwaysOpen && this.#H();
2079
2081
  }
2080
2082
  #x() {
2081
- fe(this.#r, this.#t), me(this.#r, this.#t), he(this.#r);
2083
+ de(this.#r, this.#t), pe(this.#r, this.#t), me(this.#r);
2082
2084
  }
2083
2085
  #S(e = !1) {
2084
- let t = this.#e.telInputEl.getAttribute("value"), n = this.#p.normalise(t ?? ""), r = this.#_(), i = n && n.startsWith("+") && (!r || !r.startsWith("+")) ? n : r, a = this.#$(i), o = Y(i), { initialCountry: s, geoIpLookup: c } = this.#t, l = s === O.AUTO && c, u = l && Q.autoCountry ? Q.autoCountry : s, d = l && !e && !Q.autoCountry, f = m(u);
2085
- a ? o ? f ? this.#q(u) : d || this.#q(E.ISO2) : (f && this.#q(u), this.#U(i)) : f ? this.#q(u) : d || this.#q(""), i && this.#H(i);
2086
+ let t = this.#e.telInputEl.getAttribute("value"), n = this.#p.normalise(t ?? ""), r = this.#_(), i = n && n.startsWith("+") && (!r || !r.startsWith("+")) ? n : r, a = this.#ee(i), o = ye(i), { initialCountry: s, geoIpLookup: c } = this.#t, l = s === O.AUTO && c, u = l && Q.autoCountry ? Q.autoCountry : s, d = l && !e && !Q.autoCountry, f = m(u);
2087
+ a ? o ? f ? this.#J(u) : d || this.#J(E.ISO2) : (f && this.#J(u), this.#W(i)) : f ? this.#J(u) : d || this.#J(""), i && this.#U(i);
2086
2088
  }
2087
2089
  #C() {
2088
- this.#O(), this.#t.allowDropdown && this.#e.bindAllInitialDropdownListeners(this.#f.signal, () => this.#V(), () => this.#Z()), this.#e.bindHiddenInputSubmitListener(this.#f.signal, () => this.getNumber(), () => this.#c?.iso2 || "");
2090
+ this.#O(), this.#t.allowDropdown && this.#e.bindAllInitialDropdownListeners(this.#f.signal, () => this.#H(), () => this.#Q()), this.#e.bindHiddenInputSubmitListener(this.#f.signal, () => this.getNumber(), () => this.#c?.iso2 || "");
2089
2091
  }
2090
2092
  #w() {
2091
2093
  if (this.#g) {
@@ -2098,7 +2100,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
2098
2100
  }
2099
2101
  #T() {
2100
2102
  if (Q.autoCountry) {
2101
- this.#ae();
2103
+ this.#oe();
2102
2104
  return;
2103
2105
  }
2104
2106
  this.#e.setLoading(!0), !Q.startedLoadingAutoCountry && (Q.startedLoadingAutoCountry = !0, typeof this.#t.geoIpLookup == "function" && this.#t.geoIpLookup((t = "") => {
@@ -2109,7 +2111,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
2109
2111
  }));
2110
2112
  }
2111
2113
  #E() {
2112
- this.#V(), this.#e.prefillSearchWithPlus();
2114
+ this.#H(), this.#e.prefillSearchWithPlus();
2113
2115
  }
2114
2116
  #D(e) {
2115
2117
  let t = this.#e.telInputEl.selectionStart || 0, n = e.substring(0, t - 1), r = e.substring(t);
@@ -2123,19 +2125,19 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
2123
2125
  }
2124
2126
  #A(e, t) {
2125
2127
  let n = this.#D(e);
2126
- this.#e.telInputEl.setSelectionRange(n, n), this.#B(g.STRICT_REJECT, {
2128
+ this.#e.telInputEl.setSelectionRange(n, n), this.#B(), this.#V(g.STRICT_REJECT, {
2127
2129
  source: "key",
2128
2130
  rejectedInput: t,
2129
2131
  reason: "invalid"
2130
2132
  });
2131
2133
  }
2132
2134
  #j(e, t) {
2133
- let n = this.#e.telInputEl.selectionStart || 0, r = e.substring(0, n).replace(b.NON_PLUS_NUMERIC_GLOBAL, "").length, i = _e(this.#te(), e, Q.utils, this.#c, this.#t.separateDialCode), a = ve(r, i, n, t);
2135
+ let n = this.#e.telInputEl.selectionStart || 0, r = e.substring(0, n).replace(b.NON_PLUS_NUMERIC_GLOBAL, "").length, i = ge(this.#ne(), e, Q.utils, this.#c, this.#t.separateDialCode), a = _e(r, i, n, t);
2134
2136
  this.#v(i), this.#e.telInputEl.setSelectionRange(a, a);
2135
2137
  }
2136
2138
  #M(e) {
2137
- if (e.startsWith("+") && this.#c && this.#$(e)) {
2138
- let t = J(e, !0, !0, this.#c);
2139
+ if (e.startsWith("+") && this.#c && this.#ee(e)) {
2140
+ let t = Y(e, !0, !0, this.#c);
2139
2141
  this.#v(t);
2140
2142
  }
2141
2143
  }
@@ -2154,7 +2156,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
2154
2156
  this.#A(s, e.data);
2155
2157
  return;
2156
2158
  }
2157
- this.#U(s) && this.#ie();
2159
+ this.#W(s) && this.#ae();
2158
2160
  let c = e?.data && b.NON_PLUS_NUMERIC.test(e.data), l = e?.inputType === y.PASTE && s;
2159
2161
  c || l && !t ? this.#m = !0 : b.NON_PLUS_NUMERIC.test(s) || (this.#m = !1), n && !this.#m && !o?.isSetNumber && this.#p.isAscii() && this.#j(s, e?.inputType === y.DELETE_FORWARD), r && this.#M(s);
2160
2162
  };
@@ -2170,10 +2172,10 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
2170
2172
  return;
2171
2173
  }
2172
2174
  if (!t) return;
2173
- let a = this.#_(), o = !a.startsWith("+") && this.#e.telInputEl.selectionStart === 0 && e.key === "+", s = this.#p.normalise(e.key), c = /^[0-9]$/.test(s), l = n ? c : o || c, u = this.#e.telInputEl, d = u.selectionStart, f = u.selectionEnd, p = a.slice(0, d ?? void 0), m = a.slice(f ?? void 0), h = p + s + m, _ = this.#ee(h), v = !1;
2175
+ let a = this.#_(), o = !a.startsWith("+") && this.#e.telInputEl.selectionStart === 0 && e.key === "+", s = this.#p.normalise(e.key), c = /^[0-9]$/.test(s), l = n ? c : o || c, u = this.#e.telInputEl, d = u.selectionStart, f = u.selectionEnd, p = a.slice(0, d ?? void 0), m = a.slice(f ?? void 0), h = p + s + m, _ = this.#te(h), v = !1;
2174
2176
  Q.utils && this.#l && (v = Q.utils.getCoreNumber(_, this.#c?.iso2).length > this.#l);
2175
- let y = this.#G(_) !== null;
2176
- (!l || v && !y && !o) && (this.#B(g.STRICT_REJECT, {
2177
+ let y = this.#K(_) !== null;
2178
+ (!l || v && !y && !o) && (this.#B(), this.#V(g.STRICT_REJECT, {
2177
2179
  source: "key",
2178
2180
  rejectedInput: e.key,
2179
2181
  reason: l ? "max-length" : "invalid"
@@ -2189,7 +2191,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
2189
2191
  let e = Q.utils.getCoreNumber(_, s);
2190
2192
  for (; e.length === 0 && _.length > 0;) _ = _.slice(0, -1), e = Q.utils.getCoreNumber(_, s);
2191
2193
  if (!e) {
2192
- this.#B(g.STRICT_REJECT, {
2194
+ this.#B(), this.#V(g.STRICT_REJECT, {
2193
2195
  source: "paste",
2194
2196
  rejectedInput: c,
2195
2197
  reason: "max-length"
@@ -2200,7 +2202,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
2200
2202
  let t = e.length - this.#l;
2201
2203
  _ = _.slice(0, _.length - t), v = "max-length";
2202
2204
  } else {
2203
- this.#B(g.STRICT_REJECT, {
2205
+ this.#B(), this.#V(g.STRICT_REJECT, {
2204
2206
  source: "paste",
2205
2207
  rejectedInput: c,
2206
2208
  reason: "max-length"
@@ -2210,17 +2212,22 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
2210
2212
  }
2211
2213
  this.#v(_);
2212
2214
  let y = n + h.length;
2213
- t.setSelectionRange(y, y), t.dispatchEvent(new InputEvent("input", { bubbles: !0 })), v && this.#B(g.STRICT_REJECT, {
2215
+ t.setSelectionRange(y, y), t.dispatchEvent(new InputEvent("input", { bubbles: !0 })), v && (l.length > 0 && h.length === 0 && this.#B(), this.#V(g.STRICT_REJECT, {
2214
2216
  source: "paste",
2215
2217
  rejectedInput: c,
2216
2218
  reason: v
2217
- });
2219
+ }));
2218
2220
  };
2219
2221
  #z(e) {
2220
2222
  let t = Number(this.#e.telInputEl.getAttribute("maxlength"));
2221
2223
  return t && e.length > t ? e.substring(0, t) : e;
2222
2224
  }
2223
- #B(e, t = {}) {
2225
+ #B() {
2226
+ if (!this.#t.strictRejectAnimation) return;
2227
+ let e = this.#e.telInputEl.parentElement;
2228
+ e && (e.classList.remove("iti__strict-reject-animation"), e.offsetWidth, e.classList.add("iti__strict-reject-animation"));
2229
+ }
2230
+ #V(e, t = {}) {
2224
2231
  let n = new CustomEvent(e, {
2225
2232
  bubbles: !0,
2226
2233
  cancelable: !0,
@@ -2228,42 +2235,42 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
2228
2235
  });
2229
2236
  this.#e.telInputEl.dispatchEvent(n);
2230
2237
  }
2231
- #V() {
2232
- this.#e.openDropdown((e) => this.#X(e), () => this.#Z()), this.#B(g.OPEN_COUNTRY_DROPDOWN);
2238
+ #H() {
2239
+ this.#e.openDropdown((e) => this.#Z(e), () => this.#Q()), this.#V(g.OPEN_COUNTRY_DROPDOWN);
2233
2240
  }
2234
- #H(e) {
2241
+ #U(e) {
2235
2242
  let { formatOnDisplay: t, nationalMode: n, separateDialCode: r } = this.#t, i = e;
2236
2243
  if (t && Q.utils && this.#c) {
2237
- let t = q(e), a = n && !t || !i.startsWith("+") && !r, { NATIONAL: o, INTERNATIONAL: s } = Q.utils.numberFormat, c = a ? o : s;
2244
+ let t = J(e), a = n && !t || !i.startsWith("+") && !r, { NATIONAL: o, INTERNATIONAL: s } = Q.utils.numberFormat, c = a ? o : s;
2238
2245
  i = Q.utils.formatNumber(i, this.#c?.iso2, c);
2239
2246
  }
2240
- i = this.#ne(i), this.#v(i);
2241
- }
2242
- #U(e) {
2243
- let t = this.#G(e);
2244
- return t === null ? !1 : this.#q(t);
2247
+ i = this.#re(i), this.#v(i);
2245
2248
  }
2246
2249
  #W(e) {
2250
+ let t = this.#K(e);
2251
+ return t === null ? !1 : this.#J(t);
2252
+ }
2253
+ #G(e) {
2247
2254
  let t = this.#c?.dialCode, n = this.#c?.nationalPrefix;
2248
2255
  return e.startsWith("+") || !t ? e : `+${t}${n && e.startsWith(n) && !this.#t.separateDialCode ? e.substring(1) : e}`;
2249
2256
  }
2250
- #G(e) {
2257
+ #K(e) {
2251
2258
  let t = e.indexOf("+"), n = t > 0 ? e.substring(t) : e, r = this.#c?.iso2;
2252
- n = this.#W(n);
2253
- let i = this.#$(n, !0), a = V(n);
2259
+ n = this.#G(n);
2260
+ let i = this.#ee(n, !0), a = H(n);
2254
2261
  if (i) {
2255
- let e = V(i), t = this.#a[e];
2256
- return t.length === 1 ? t[0] === r ? null : t[0] : this.#K(t, e, a);
2262
+ let e = H(i), t = this.#a[e];
2263
+ return t.length === 1 ? t[0] === r ? null : t[0] : this.#q(t, e, a);
2257
2264
  } else if (n.startsWith("+") && a.length) {
2258
2265
  let e = this.#c?.dialCode || "";
2259
2266
  return e && e.startsWith(a) ? null : "";
2260
2267
  } else if ((!n || n === "+") && !r && this.#u) return this.#u;
2261
2268
  return null;
2262
2269
  }
2263
- #K(e, t, n) {
2270
+ #q(e, t, n) {
2264
2271
  let r = this.#c?.iso2, i = this.#c?.dialCode;
2265
2272
  if (!r && this.#u && e.includes(this.#u)) return this.#u;
2266
- if (i === w.NANP && Y(n)) return null;
2273
+ if (i === w.NANP && ye(n)) return null;
2267
2274
  let a = this.#c?.areaCodes, o = this.#c?.priority;
2268
2275
  if (a) {
2269
2276
  let e = a.map((e) => `${i}${e}`);
@@ -2272,11 +2279,11 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
2272
2279
  let s = a && o !== 0 && n.length > t.length, c = r && e.includes(r) && !s, l = r === e[0];
2273
2280
  return !c && !l ? e[0] : null;
2274
2281
  }
2275
- #q(e) {
2282
+ #J(e) {
2276
2283
  let t = this.#c?.iso2 || "";
2277
- return this.#c = e ? this.#s.get(e) : null, this.#c && (this.#u = this.#c.iso2), this.#e.setCountry(this.#c), this.#Y(), this.#J(), t !== e;
2284
+ return this.#c = e ? this.#s.get(e) : null, this.#c && (this.#u = this.#c.iso2), this.#e.setCountry(this.#c), this.#X(), this.#Y(), t !== e;
2278
2285
  }
2279
- #J() {
2286
+ #Y() {
2280
2287
  let { strictMode: e, placeholderNumberType: t, allowedNumberTypes: n } = this.#t;
2281
2288
  if (!e || !Q.utils) return;
2282
2289
  let r = this.#c?.iso2;
@@ -2289,33 +2296,33 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
2289
2296
  let s = Q.utils.getCoreNumber(o, r);
2290
2297
  this.#l = s.length, r === "by" && (this.#l = s.length + 1);
2291
2298
  }
2292
- #Y() {
2299
+ #X() {
2293
2300
  let { autoPlaceholder: e, placeholderNumberType: t, nationalMode: n, customPlaceholder: r } = this.#t, i = e === D.AGGRESSIVE || !this.#e.hadInitialPlaceholder && e === D.POLITE;
2294
2301
  if (!Q.utils || !i) return;
2295
2302
  let a = Q.utils.numberType[t], o = this.#c ? Q.utils.getExampleNumber(this.#c.iso2, n, a) : "";
2296
- o = this.#ne(o), typeof r == "function" && (o = r(o, this.#c)), this.#e.telInputEl.setAttribute("placeholder", o);
2303
+ o = this.#re(o), typeof r == "function" && (o = r(o, this.#c)), this.#e.telInputEl.setAttribute("placeholder", o);
2297
2304
  }
2298
- #X(e) {
2305
+ #Z(e) {
2299
2306
  if (!e) return;
2300
- let t = e.dataset[A.ISO2], n = this.#q(t);
2301
- this.#Z();
2307
+ let t = e.dataset[A.ISO2], n = this.#J(t);
2308
+ this.#Q();
2302
2309
  let r = e.dataset[A.DIAL_CODE];
2303
- if (this.#Q(r), this.#t.formatOnDisplay) {
2310
+ if (this.#$(r), this.#t.formatOnDisplay) {
2304
2311
  let e = this.#_();
2305
- this.#H(e);
2312
+ this.#U(e);
2306
2313
  }
2307
- this.#e.telInputEl.focus(), n && (this.#ie(), this.#B(g.INPUT, { isCountryChange: !0 }));
2308
- }
2309
- #Z(e) {
2310
- !this.#e.isDropdownOpen() || this.#t.dropdownAlwaysOpen && !e || (this.#e.closeDropdown(), this.#B(g.CLOSE_COUNTRY_DROPDOWN));
2314
+ this.#e.telInputEl.focus(), n && (this.#ae(), this.#V(g.INPUT, { isCountryChange: !0 }));
2311
2315
  }
2312
2316
  #Q(e) {
2317
+ !this.#e.isDropdownOpen() || this.#t.dropdownAlwaysOpen && !e || (this.#e.closeDropdown(), this.#V(g.CLOSE_COUNTRY_DROPDOWN));
2318
+ }
2319
+ #$(e) {
2313
2320
  let t = this.#_();
2314
2321
  if (!t.startsWith("+")) return;
2315
- let n = `+${e}`, r = this.#$(t), i;
2322
+ let n = `+${e}`, r = this.#ee(t), i;
2316
2323
  i = r ? t.replace(r, n) : n, this.#v(i);
2317
2324
  }
2318
- #$(e, t) {
2325
+ #ee(e, t) {
2319
2326
  if (!e.startsWith("+")) return "";
2320
2327
  let n = "", r = "", i = !1;
2321
2328
  for (let a = 0; a < e.length; a++) {
@@ -2330,19 +2337,19 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
2330
2337
  }
2331
2338
  return n;
2332
2339
  }
2333
- #ee(e) {
2334
- let t = this.#c?.dialCode, n = V(e);
2340
+ #te(e) {
2341
+ let t = this.#c?.dialCode, n = H(e);
2335
2342
  return (this.#t.separateDialCode && !e.startsWith("+") && t && n ? `+${t}` : "") + e;
2336
2343
  }
2337
- #te() {
2344
+ #ne() {
2338
2345
  let e = this.#_();
2339
- return this.#ee(e);
2346
+ return this.#te(e);
2340
2347
  }
2341
- #ne(e) {
2342
- let t = J(e, !!this.#$(e), this.#t.separateDialCode, this.#c);
2348
+ #re(e) {
2349
+ let t = Y(e, !!this.#ee(e), this.#t.separateDialCode, this.#c);
2343
2350
  return this.#z(t);
2344
2351
  }
2345
- #re() {
2352
+ #ie() {
2346
2353
  let e = this.#c;
2347
2354
  if (!e) return null;
2348
2355
  let { iso2: t, dialCode: n, name: r } = e;
@@ -2352,11 +2359,11 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
2352
2359
  name: r
2353
2360
  };
2354
2361
  }
2355
- #ie() {
2356
- let e = this.#re();
2357
- this.#B(g.COUNTRY_CHANGE, e);
2358
- }
2359
2362
  #ae() {
2363
+ let e = this.#ie();
2364
+ this.#V(g.COUNTRY_CHANGE, e);
2365
+ }
2366
+ #oe() {
2360
2367
  if (!(!this.#h || !Q.autoCountry)) {
2361
2368
  if (!this.#d) {
2362
2369
  this.#h.resolve();
@@ -2365,14 +2372,14 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
2365
2372
  this.#e.isLoading() ? this.setCountry(Q.autoCountry) : this.#u = Q.autoCountry, this.#e.setLoading(!1), this.#h.resolve();
2366
2373
  }
2367
2374
  }
2368
- #oe() {
2375
+ #se() {
2369
2376
  if (!this.#d) {
2370
2377
  this.#h?.reject();
2371
2378
  return;
2372
2379
  }
2373
2380
  this.#S(!0), this.#e.setLoading(!1), this.#h?.reject();
2374
2381
  }
2375
- #se() {
2382
+ #ce() {
2376
2383
  if (!this.#d) {
2377
2384
  this.#g?.resolve();
2378
2385
  return;
@@ -2382,9 +2389,9 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
2382
2389
  return;
2383
2390
  }
2384
2391
  let e = this.#_();
2385
- e && this.#H(e), this.#c && (this.#Y(), this.#J()), this.#g?.resolve();
2392
+ e && this.#U(e), this.#c && (this.#X(), this.#Y()), this.#g?.resolve();
2386
2393
  }
2387
- #ce(e) {
2394
+ #le(e) {
2388
2395
  if (!this.#d) {
2389
2396
  this.#g?.reject(e);
2390
2397
  return;
@@ -2392,51 +2399,51 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
2392
2399
  this.#g?.reject(e);
2393
2400
  }
2394
2401
  destroy() {
2395
- this.#d && (this.#d = !1, this.#t.allowDropdown && this.#Z(!0), this.#f.abort(), this.#e.destroy(), Q.instances.delete(String(this.id)));
2402
+ this.#d && (this.#d = !1, this.#t.allowDropdown && this.#Q(!0), this.#f.abort(), this.#e.destroy(), Q.instances.delete(String(this.id)));
2396
2403
  }
2397
2404
  isActive() {
2398
2405
  return this.#d;
2399
2406
  }
2400
2407
  getExtension() {
2401
- return this.#d ? (X("getExtension"), Q.utils.getExtension(this.#te(), this.#c?.iso2)) : "";
2408
+ return this.#d ? (X("getExtension"), Q.utils.getExtension(this.#ne(), this.#c?.iso2)) : "";
2402
2409
  }
2403
2410
  getNumber(e) {
2404
2411
  if (!this.#d) return "";
2405
2412
  X("getNumber");
2406
- let t = this.#c?.iso2, n = this.#te(), r = Q.utils.formatNumber(n, t, e);
2413
+ let t = this.#c?.iso2, n = this.#ne(), r = Q.utils.formatNumber(n, t, e);
2407
2414
  return this.#p.denormalise(r);
2408
2415
  }
2409
2416
  getNumberType() {
2410
- return this.#d ? (X("getNumberType"), Q.utils.getNumberType(this.#te(), this.#c?.iso2)) : S.UNKNOWN_NUMBER_TYPE;
2417
+ return this.#d ? (X("getNumberType"), Q.utils.getNumberType(this.#ne(), this.#c?.iso2)) : S.UNKNOWN_NUMBER_TYPE;
2411
2418
  }
2412
2419
  getSelectedCountryData() {
2413
- return this.#re();
2420
+ return this.#ie();
2414
2421
  }
2415
2422
  getValidationError() {
2416
2423
  if (!this.#d) return S.UNKNOWN_VALIDATION_ERROR;
2417
2424
  X("getValidationError");
2418
2425
  let e = this.#c?.iso2;
2419
- return Q.utils.getValidationError(this.#te(), e);
2426
+ return Q.utils.getValidationError(this.#ne(), e);
2420
2427
  }
2421
2428
  isValidNumber() {
2422
2429
  if (!this.#d) return null;
2423
2430
  X("isValidNumber");
2424
- let e = this.#c?.dialCode, t = this.#c?.iso2, n = this.#te(), r = Q.utils.getCoreNumber(n, t);
2431
+ let e = this.#c?.dialCode, t = this.#c?.iso2, n = this.#ne(), r = Q.utils.getCoreNumber(n, t);
2425
2432
  if (r) {
2426
2433
  if (e === T.DIAL_CODE && r[0] === T.MOBILE_PREFIX && r.length !== T.MOBILE_CORE_LENGTH) return !1;
2427
2434
  if (!b.ALPHA_UNICODE.test(n) && e) {
2428
- let t = V(n.startsWith("+") ? n.slice(1 + e.length) : n).length;
2435
+ let t = H(n.startsWith("+") ? n.slice(1 + e.length) : n).length;
2429
2436
  if (r.length > t) return !1;
2430
2437
  }
2431
2438
  }
2432
- return this.#le("possible");
2439
+ return this.#ue("possible");
2433
2440
  }
2434
2441
  isValidNumberPrecise() {
2435
- return this.#d ? (X("isValidNumberPrecise"), this.#le("precise")) : null;
2442
+ return this.#d ? (X("isValidNumberPrecise"), this.#ue("precise")) : null;
2436
2443
  }
2437
- #le(e) {
2438
- let { allowNumberExtensions: t, allowPhonewords: n, allowedNumberTypes: r } = this.#t, i = this.#c?.iso2, a = this.#te();
2439
- return !this.#c && !q(a) || !(e === "precise" ? Q.utils.isValidNumber : Q.utils.isPossibleNumber)(a, i, r) ? !1 : b.ALPHA_UNICODE.test(a) ? Q.utils.getExtension(a, i) ? t : n : !0;
2444
+ #ue(e) {
2445
+ let { allowNumberExtensions: t, allowPhonewords: n, allowedNumberTypes: r } = this.#t, i = this.#c?.iso2, a = this.#ne();
2446
+ return !this.#c && !J(a) || !(e === "precise" ? Q.utils.isValidNumber : Q.utils.isPossibleNumber)(a, i, r) ? !1 : b.ALPHA_UNICODE.test(a) ? Q.utils.getExtension(a, i) ? t : n : !0;
2440
2447
  }
2441
2448
  setCountry(e) {
2442
2449
  if (!this.#d) return;
@@ -2444,20 +2451,20 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
2444
2451
  if (!m(t)) throw Error(`Invalid iso2 code: '${t}'`);
2445
2452
  let n = this.#c?.iso2;
2446
2453
  if (e && t !== n || !e && n) {
2447
- if (this.#q(t), this.#Q(this.#c?.dialCode || ""), this.#t.formatOnDisplay) {
2454
+ if (this.#J(t), this.#$(this.#c?.dialCode || ""), this.#t.formatOnDisplay) {
2448
2455
  let e = this.#_();
2449
- this.#H(e);
2456
+ this.#U(e);
2450
2457
  }
2451
- this.#ie(), this.#B(g.INPUT, { isCountryChange: !0 });
2458
+ this.#ae(), this.#V(g.INPUT, { isCountryChange: !0 });
2452
2459
  }
2453
2460
  }
2454
2461
  setNumber(e) {
2455
2462
  if (!this.#d) return;
2456
- let t = this.#p.normalise(e), n = this.#U(t);
2457
- this.#H(t), n && this.#ie(), this.#B(g.INPUT, { isSetNumber: !0 });
2463
+ let t = this.#p.normalise(e), n = this.#W(t);
2464
+ this.#U(t), n && this.#ae(), this.#V(g.INPUT, { isSetNumber: !0 });
2458
2465
  }
2459
2466
  setPlaceholderNumberType(e) {
2460
- this.#d && (this.#t.placeholderNumberType = e, this.#Y());
2467
+ this.#d && (this.#t.placeholderNumberType = e, this.#X());
2461
2468
  }
2462
2469
  setDisabled(e) {
2463
2470
  this.#d && this.#e.setDisabled(e);
@@ -2470,16 +2477,16 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
2470
2477
  r.forEach((n) => {
2471
2478
  if (n instanceof e) switch (t) {
2472
2479
  case "handleUtilsLoaded":
2473
- n.#se();
2480
+ n.#ce();
2474
2481
  break;
2475
2482
  case "handleUtilsFailure":
2476
- n.#ce(i);
2483
+ n.#le(i);
2477
2484
  break;
2478
2485
  case "handleAutoCountryLoaded":
2479
- n.#ae();
2486
+ n.#oe();
2480
2487
  break;
2481
2488
  case "handleAutoCountryFailure":
2482
- n.#oe();
2489
+ n.#se();
2483
2490
  break;
2484
2491
  }
2485
2492
  });
@@ -2517,7 +2524,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
2517
2524
  },
2518
2525
  startedLoadingUtils: !1,
2519
2526
  startedLoadingAutoCountry: !1,
2520
- version: "27.2.1"
2527
+ version: "27.3.0"
2521
2528
  }), $ = Q, Ce = /* @__PURE__ */ n({
2522
2529
  inheritAttrs: !1,
2523
2530
  __name: "IntlTelInput",
@@ -2563,6 +2570,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
2563
2570
  placeholderNumberType: {},
2564
2571
  searchInputClass: {},
2565
2572
  separateDialCode: { type: Boolean },
2573
+ strictRejectAnimation: { type: Boolean },
2566
2574
  showFlags: { type: Boolean },
2567
2575
  strictMode: { type: Boolean },
2568
2576
  useFullscreenPopup: { type: Boolean }
@@ -2587,61 +2595,61 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
2587
2595
  "readonly",
2588
2596
  "onInput",
2589
2597
  "oninput"
2590
- ]), _ = e(() => {
2598
+ ]), _ = c(""), v = e(() => {
2591
2599
  let e = p.inputProps ?? {}, t = {};
2592
- for (let [n, r] of Object.entries(e)) g.has(n) ? h(n) : t[n] = r;
2600
+ for (let [n, r] of Object.entries(e)) g.has(n) ? h(n) : n === "class" ? t[n] = `${_.value} ${r}` : t[n] = r;
2593
2601
  return t;
2594
- }), v = e(() => p.modelValue ?? p.initialValue ?? ""), y = r(), b = Object.keys($.defaults), x = e(() => {
2595
- let e = y?.vnode.props ?? {}, t = new Set(Object.keys(e).map((e) => e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()))), n = {};
2596
- return b.forEach((e) => {
2602
+ }), y = e(() => p.modelValue ?? p.initialValue ?? ""), b = r(), x = Object.keys($.defaults), S = e(() => {
2603
+ let e = b?.vnode.props ?? {}, t = new Set(Object.keys(e).map((e) => e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()))), n = {};
2604
+ return x.forEach((e) => {
2597
2605
  if (!t.has(e)) return;
2598
2606
  let r = p[e];
2599
2607
  r !== void 0 && (n[e] = r);
2600
2608
  }), n;
2601
- }), S = c(null), C = l(null), w = c(), T = c(), E = c(), D = c(), O = !1, k = () => (p.usePreciseValidation ? C.value.isValidNumberPrecise() : C.value.isValidNumber()) ?? !1, A = () => {
2602
- if (!C.value?.isActive()) return;
2609
+ }), C = c(null), w = l(null), T = c(), E = c(), D = c(), O = c(), k = !1, A = () => (p.usePreciseValidation ? w.value.isValidNumberPrecise() : w.value.isValidNumber()) ?? !1, j = () => {
2610
+ if (!w.value?.isActive()) return;
2603
2611
  if (!$.utils) {
2604
- O = !0;
2612
+ k = !0;
2605
2613
  return;
2606
2614
  }
2607
- let e = k(), t = e ? null : C.value.getValidationError();
2608
- e !== E.value && (E.value = e, m("changeValidity", e)), t !== D.value && (D.value = t, m("changeErrorCode", t));
2609
- }, j = () => {
2610
- if (!C.value?.isActive()) return;
2615
+ let e = A(), t = e ? null : w.value.getValidationError();
2616
+ e !== D.value && (D.value = e, m("changeValidity", e)), t !== O.value && (O.value = t, m("changeErrorCode", t));
2617
+ }, M = () => {
2618
+ if (!w.value?.isActive()) return;
2611
2619
  if (!$.utils) {
2612
- O = !0;
2620
+ k = !0;
2613
2621
  return;
2614
2622
  }
2615
- let e = C.value.getNumber() ?? "";
2616
- e !== w.value && (w.value = e, m("changeNumber", e), m("update:modelValue", e)), A();
2617
- }, M = () => {
2618
- if (!C.value?.isActive()) return;
2619
- let e = C.value.getSelectedCountryData()?.iso2 ?? "";
2620
- e !== T.value && (T.value = e, m("changeCountry", e)), j();
2621
- }, N = () => m("openCountryDropdown"), P = () => m("closeCountryDropdown"), F = (e) => {
2623
+ let e = w.value.getNumber() ?? "";
2624
+ e !== T.value && (T.value = e, m("changeNumber", e), m("update:modelValue", e)), j();
2625
+ }, N = () => {
2626
+ if (!w.value?.isActive()) return;
2627
+ let e = w.value.getSelectedCountryData()?.iso2 ?? "";
2628
+ e !== E.value && (E.value = e, m("changeCountry", e)), M();
2629
+ }, P = () => m("openCountryDropdown"), F = () => m("closeCountryDropdown"), I = (e) => {
2622
2630
  let { source: t, rejectedInput: n, reason: r } = e.detail;
2623
2631
  m("strictReject", t, n, r);
2624
2632
  };
2625
2633
  return a(() => {
2626
- S.value && (C.value = $(S.value, x.value), S.value.addEventListener("open:countrydropdown", N), S.value.addEventListener("close:countrydropdown", P), S.value.addEventListener("strict:reject", F), p.disabled && C.value.setDisabled(p.disabled), p.readonly && C.value.setReadonly(p.readonly), T.value = C.value.getSelectedCountryData()?.iso2 ?? "", C.value.promise.then(() => {
2627
- C.value?.isActive() && (v.value && C.value.setNumber(v.value), O ? (O = !1, M()) : (w.value = C.value.getNumber() ?? "", E.value = k(), D.value = E.value ? null : C.value.getValidationError()));
2634
+ C.value && (w.value = $(C.value, S.value), _.value = C.value.className, C.value.addEventListener("open:countrydropdown", P), C.value.addEventListener("close:countrydropdown", F), C.value.addEventListener("strict:reject", I), p.disabled && w.value.setDisabled(p.disabled), p.readonly && w.value.setReadonly(p.readonly), E.value = w.value.getSelectedCountryData()?.iso2 ?? "", w.value.promise.then(() => {
2635
+ w.value?.isActive() && (y.value && w.value.setNumber(y.value), k ? (k = !1, N()) : (T.value = w.value.getNumber() ?? "", D.value = A(), O.value = D.value ? null : w.value.getValidationError()));
2628
2636
  }));
2629
- }), u(() => p.disabled, (e) => C.value?.setDisabled(e)), u(() => p.readonly, (e) => C.value?.setReadonly(e)), u(() => v.value, (e) => {
2630
- C.value && C.value.promise.then(() => {
2631
- if (!C.value?.isActive()) return;
2632
- let t = e ?? "", n = C.value.getNumber() ?? "";
2633
- document.activeElement === S.value || n === t || (C.value.setNumber(t), A());
2637
+ }), u(() => p.disabled, (e) => w.value?.setDisabled(e)), u(() => p.readonly, (e) => w.value?.setReadonly(e)), u(() => y.value, (e) => {
2638
+ w.value && w.value.promise.then(() => {
2639
+ if (!w.value?.isActive()) return;
2640
+ let t = e ?? "", n = w.value.getNumber() ?? "";
2641
+ document.activeElement === C.value || n === t || (w.value.setNumber(t), j());
2634
2642
  });
2635
2643
  }, { flush: "post" }), o(() => {
2636
- S.value && (S.value.removeEventListener("open:countrydropdown", N), S.value.removeEventListener("close:countrydropdown", P), S.value.removeEventListener("strict:reject", F)), C.value?.destroy();
2644
+ C.value && (C.value.removeEventListener("open:countrydropdown", P), C.value.removeEventListener("close:countrydropdown", F), C.value.removeEventListener("strict:reject", I)), w.value?.destroy();
2637
2645
  }), d({
2638
- instance: C,
2639
- input: S
2640
- }), (e, n) => (s(), t("input", i(_.value, {
2646
+ instance: w,
2647
+ input: C
2648
+ }), (e, n) => (s(), t("input", i(v.value, {
2641
2649
  ref_key: "input",
2642
- ref: S,
2650
+ ref: C,
2643
2651
  type: "tel",
2644
- onInput: M
2652
+ onInput: N
2645
2653
  }), null, 16));
2646
2654
  }
2647
2655
  });