intl-tel-input 28.0.3 → 28.0.4

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/dist/js/data.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * International Telephone Input v28.0.3
2
+ * International Telephone Input v28.0.4
3
3
  * git+https://github.com/jackocnr/intl-tel-input.git
4
4
  * Licensed under the MIT license
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*
2
- * International Telephone Input v28.0.3
2
+ * International Telephone Input v28.0.4
3
3
  * git+https://github.com/jackocnr/intl-tel-input.git
4
4
  * Licensed under the MIT license
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*
2
- * International Telephone Input v28.0.3
2
+ * International Telephone Input v28.0.4
3
3
  * git+https://github.com/jackocnr/intl-tel-input.git
4
4
  * Licensed under the MIT license
5
5
  */
@@ -2285,31 +2285,50 @@ var _factory = (() => {
2285
2285
  };
2286
2286
 
2287
2287
  // packages/core/src/js/core/icons.ts
2288
- var buildSearchIcon = () => `
2289
- <svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" ${ARIA.HIDDEN}="true">
2290
- <circle cx="11" cy="11" r="7" />
2291
- <line x1="21" y1="21" x2="16.65" y2="16.65" />
2292
- </svg>`;
2288
+ var SVG_NS = "http://www.w3.org/2000/svg";
2289
+ var buildSvg = ([tag, attrs, children]) => {
2290
+ const el = document.createElementNS(SVG_NS, tag);
2291
+ if (attrs) {
2292
+ for (const k in attrs) {
2293
+ el.setAttribute(k, String(attrs[k]));
2294
+ }
2295
+ }
2296
+ if (children) {
2297
+ for (const c of children) {
2298
+ el.appendChild(buildSvg(c));
2299
+ }
2300
+ }
2301
+ return el;
2302
+ };
2303
+ var buildSearchIcon = () => buildSvg(
2304
+ ["svg", { class: "iti__search-icon-svg", width: 14, height: 14, viewBox: "0 0 24 24", focusable: "false", [ARIA.HIDDEN]: "true" }, [
2305
+ ["circle", { cx: 11, cy: 11, r: 7 }],
2306
+ ["line", { x1: 21, y1: 21, x2: 16.65, y2: 16.65 }]
2307
+ ]]
2308
+ );
2293
2309
  var buildClearIcon = (id) => {
2294
2310
  const maskId = `iti-${id}-clear-mask`;
2295
- return `
2296
- <svg class="iti__search-clear-svg" width="12" height="12" viewBox="0 0 16 16" ${ARIA.HIDDEN}="true" focusable="false">
2297
- <mask id="${maskId}" maskUnits="userSpaceOnUse">
2298
- <rect width="16" height="16" fill="white" />
2299
- <path d="M5.2 5.2 L10.8 10.8 M10.8 5.2 L5.2 10.8" stroke="black" stroke-linecap="round" class="iti__search-clear-x" />
2300
- </mask>
2301
- <circle cx="8" cy="8" r="8" class="iti__search-clear-bg" mask="url(#${maskId})" />
2302
- </svg>`;
2311
+ return buildSvg(
2312
+ ["svg", { class: "iti__search-clear-svg", width: 12, height: 12, viewBox: "0 0 16 16", [ARIA.HIDDEN]: "true", focusable: "false" }, [
2313
+ ["mask", { id: maskId, maskUnits: "userSpaceOnUse" }, [
2314
+ ["rect", { width: 16, height: 16, fill: "white" }],
2315
+ ["path", { d: "M5.2 5.2 L10.8 10.8 M10.8 5.2 L5.2 10.8", stroke: "black", "stroke-linecap": "round", class: "iti__search-clear-x" }]
2316
+ ]],
2317
+ ["circle", { cx: 8, cy: 8, r: 8, class: "iti__search-clear-bg", mask: `url(#${maskId})` }]
2318
+ ]]
2319
+ );
2303
2320
  };
2304
- var buildCheckIcon = () => `
2305
- <svg class="iti__country-check-svg" width="14" height="14" viewBox="0 0 16 16" fill="currentColor" focusable="false" ${ARIA.HIDDEN}="true">
2306
- <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"/>
2307
- </svg>`;
2308
- var buildGlobeIcon = () => `
2309
- <svg width="256" height="256" viewBox="0 0 512 512" class="iti__globe-svg">
2310
- <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"/>
2311
- <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"/>
2312
- </svg>`;
2321
+ var buildCheckIcon = () => buildSvg(
2322
+ ["svg", { class: "iti__country-check-svg", width: 14, height: 14, viewBox: "0 0 16 16", fill: "currentColor", focusable: "false", [ARIA.HIDDEN]: "true" }, [
2323
+ ["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" }]
2324
+ ]]
2325
+ );
2326
+ var buildGlobeIcon = () => buildSvg(
2327
+ ["svg", { width: 256, height: 256, viewBox: "0 0 512 512", class: "iti__globe-svg" }, [
2328
+ ["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" }],
2329
+ ["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" }]
2330
+ ]]
2331
+ );
2313
2332
 
2314
2333
  // packages/core/src/js/core/countrySearch.ts
2315
2334
  var buildSearchTokens = (countries) => {
@@ -2662,7 +2681,7 @@ var _factory = (() => {
2662
2681
  },
2663
2682
  searchWrapper
2664
2683
  );
2665
- this.#searchIconEl.innerHTML = buildSearchIcon();
2684
+ this.#searchIconEl.appendChild(buildSearchIcon());
2666
2685
  this.#searchInputEl = createEl(
2667
2686
  "input",
2668
2687
  {
@@ -2691,7 +2710,7 @@ var _factory = (() => {
2691
2710
  },
2692
2711
  searchWrapper
2693
2712
  );
2694
- this.#searchClearButtonEl.innerHTML = buildClearIcon(this.#id);
2713
+ this.#searchClearButtonEl.appendChild(buildClearIcon(this.#id));
2695
2714
  this.#searchResultsLiveRegionEl = createEl(
2696
2715
  "span",
2697
2716
  { class: "iti__a11y-text" },
@@ -3191,7 +3210,7 @@ var _factory = (() => {
3191
3210
  { class: "iti__country-check", [ARIA.HIDDEN]: "true" },
3192
3211
  newListItem
3193
3212
  );
3194
- checkIcon.innerHTML = buildCheckIcon();
3213
+ checkIcon.appendChild(buildCheckIcon());
3195
3214
  this.#selectedListItemEl = newListItem;
3196
3215
  if (this.#options.dropdownAlwaysOpen) {
3197
3216
  this.#highlightListItem(newListItem);
@@ -3336,20 +3355,27 @@ var _factory = (() => {
3336
3355
  }
3337
3356
  if (this.#selectedCountryEl) {
3338
3357
  const flagClass = iso2 && showFlags ? `${CLASSES.FLAG} iti__${iso2}` : `${CLASSES.FLAG} ${CLASSES.GLOBE}`;
3339
- let ariaLabel, title, flagInnerHtml;
3358
+ let ariaLabel, title;
3359
+ let flagContent = null;
3340
3360
  if (iso2) {
3341
3361
  title = name;
3342
3362
  ariaLabel = i18n.selectedCountryAriaLabel.replace("${countryName}", name).replace("${dialCode}", `+${dialCode}`);
3343
- flagInnerHtml = showFlags ? "" : buildGlobeIcon();
3363
+ if (!showFlags) {
3364
+ flagContent = buildGlobeIcon();
3365
+ }
3344
3366
  } else {
3345
3367
  title = i18n.noCountrySelected;
3346
3368
  ariaLabel = i18n.noCountrySelected;
3347
- flagInnerHtml = buildGlobeIcon();
3369
+ flagContent = buildGlobeIcon();
3348
3370
  }
3349
3371
  this.#selectedFlagEl.className = flagClass;
3350
3372
  this.#selectedCountryEl.setAttribute("title", title);
3351
3373
  this.#selectedCountryEl.setAttribute(ARIA.LABEL, ariaLabel);
3352
- this.#selectedFlagEl.innerHTML = flagInnerHtml;
3374
+ if (flagContent) {
3375
+ this.#selectedFlagEl.replaceChildren(flagContent);
3376
+ } else {
3377
+ this.#selectedFlagEl.replaceChildren();
3378
+ }
3353
3379
  }
3354
3380
  if (separateDialCode) {
3355
3381
  const fullDialCode = dialCode ? `+${dialCode}` : "";
@@ -4668,7 +4694,7 @@ var _factory = (() => {
4668
4694
  attachUtils,
4669
4695
  startedLoadingUtils: false,
4670
4696
  startedLoadingAutoCountry: false,
4671
- version: "28.0.3",
4697
+ version: "28.0.4",
4672
4698
  NUMBER_FORMAT,
4673
4699
  NUMBER_TYPE,
4674
4700
  VALIDATION_ERROR
@@ -1,25 +1,7 @@
1
1
  /*
2
- * International Telephone Input v28.0.3
2
+ * International Telephone Input v28.0.4
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 J=Object.defineProperty;var _t=Object.getOwnPropertyDescriptor;var St=Object.getOwnPropertyNames;var Rt=Object.prototype.hasOwnProperty;var Mt=(n,t)=>{for(var e in t)J(n,e,{get:t[e],enumerable:!0})},Pt=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of St(t))!Rt.call(n,s)&&s!==e&&J(n,s,{get:()=>t[s],enumerable:!(i=_t(t,s))||i.enumerable});return n};var xt=n=>Pt(J({},"__esModule",{value:!0}),n);var Xt={};Mt(Xt,{Iti:()=>W,NUMBER_FORMAT:()=>x,NUMBER_TYPE:()=>w,VALIDATION_ERROR:()=>G,default:()=>zt});var Ht=[["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 Ht)Q.push({name:"",iso2:n[0],dialCode:n[1],priority:n[2]||0,areaCodes:n[3]||null,nationalPrefix:n[4]||null});var kt=new Set(Q.map(n=>n.iso2)),D=n=>kt.has(n),R=Q;var I={OPEN_COUNTRY_DROPDOWN:"open:countrydropdown",CLOSE_COUNTRY_DROPDOWN:"close:countrydropdown",COUNTRY_CHANGE:"countrychange",INPUT:"input",STRICT_REJECT:"strict:reject"},c={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"},y={ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",SPACE:" ",ENTER:"Enter",ESC:"Escape",TAB:"Tab"},Z={PASTE:"insertFromPaste",DELETE_FORWARD:"deleteContentForward"},A={ALPHA_UNICODE:/\p{L}/u,NON_PLUS_NUMERIC:/[^+0-9]/,NON_PLUS_NUMERIC_GLOBAL:/[^+0-9]/g,HIDDEN_SEARCH_CHAR:/^[a-zA-ZÀ-ÿа-яА-Я ]$/},tt={SEARCH_DEBOUNCE_MS:100,HIDDEN_SEARCH_RESET_MS:1e3,NEXT_TICK:0},L={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},j={PLUS:"+",NANP:"1"},V={ISO2:"gb",DIAL_CODE:"44",MOBILE_PREFIX:"7",MOBILE_CORE_LENGTH:10},at={ISO2:"us",DIAL_CODE:"1"},M={AGGRESSIVE:"aggressive",POLITE:"polite",OFF:"off"},F={AUTO:"auto"},Ut=["E164","INTERNATIONAL","NATIONAL","RFC3966"],P=["FIXED_LINE","MOBILE","FIXED_LINE_OR_MOBILE","TOLL_FREE","PREMIUM_RATE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL","UNKNOWN"],Wt=["IS_POSSIBLE","INVALID_COUNTRY_CODE","TOO_SHORT","TOO_LONG","IS_POSSIBLE_LOCAL_ONLY","INVALID_LENGTH"],et=n=>Object.fromEntries(n.map(t=>[t,t])),x=et(Ut),w=et(P),G=et(Wt),T={ISO2:"iso2",DIAL_CODE:"dialCode",INSTANCE_ID:"intlTelInputId"},h={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 Bt={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`}},ut=Bt;var st=n=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(n).matches,ht=()=>st(`(max-width: ${L.NARROW_VIEWPORT_WIDTH}px)`),Ft=()=>{if(typeof navigator<"u"&&typeof window<"u"){let n=st("(max-height: 600px)"),t=st("(pointer: coarse)");return ht()||t&&n}return!1},K={allowDropdown:!0,allowedNumberTypes:[w.MOBILE,w.FIXED_LINE],allowNumberExtensions:!1,allowPhonewords:!1,autoPlaceholder:M.POLITE,containerClass:"",countryNameLocale:"en",countryNameOverrides:{},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:!1,onlyCountries:null,placeholderNumberType:w.MOBILE,searchInputClass:"",separateDialCode:!0,strictRejectAnimation:!0,showFlags:!0,strictMode:!0,useFullscreenPopup:Ft()},pt=n=>JSON.stringify(n),it=n=>!!n&&typeof n=="object"&&!Array.isArray(n),$t=n=>typeof n=="function",jt=n=>{if(!n||typeof n!="object")return!1;let t=n;return t.nodeType===1&&typeof t.tagName=="string"&&typeof t.appendChild=="function"},ct=new Set(Object.values(M)),Y=n=>{console.warn(`[intl-tel-input] ${n}`)},C=(n,t,e)=>{Y(`Option '${n}' must be ${t}; got ${pt(e)}. Ignoring.`)},dt=(n,t)=>{let e="an array of iso2 country code strings";if(!Array.isArray(t))return C(n,e,t),!1;let i=[];for(let s of t){if(typeof s!="string")return C(n,e,t),!1;let o=s.toLowerCase();D(o)?i.push(s):Y(`Invalid iso2 code in '${n}': '${s}'. Skipping.`)}return i},ft=n=>{if(n===void 0)return{};if(!it(n)){let e=`The second argument must be an options object; got ${pt(n)}. Using defaults.`;return Y(e),{}}let t={};for(let[e,i]of Object.entries(n)){if(!Object.hasOwn(K,e)){Y(`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"strictRejectAnimation":case"useFullscreenPopup":if(typeof i!="boolean"){C(e,"a boolean",i);break}t[e]=i;break;case"autoPlaceholder":if(typeof i!="string"||!ct.has(i)){let s=Array.from(ct).join(", ");C("autoPlaceholder",`one of ${s}`,i);break}t[e]=i;break;case"containerClass":case"searchInputClass":case"countryNameLocale":if(typeof i!="string"){C(e,"a string",i);break}t[e]=i;break;case"countryOrder":{if(i===null)t[e]=i;else{let s=dt(e,i);s!==!1&&(t[e]=s)}break}case"customPlaceholder":case"geoIpLookup":case"hiddenInput":case"loadUtils":if(i!==null&&!$t(i)){C(e,"a function or null",i);break}t[e]=i;break;case"dropdownContainer":if(i!==null&&!jt(i)){C("dropdownContainer","an HTMLElement or null",i);break}t[e]=i;break;case"excludeCountries":case"onlyCountries":{if(i===null)t[e]=i;else{let s=dt(e,i);s!==!1&&(t[e]=s)}break}case"i18n":if(i&&!it(i)){C("i18n","an object",i);break}t[e]=i;break;case"countryNameOverrides":if(i&&!it(i)){C("countryNameOverrides","an object",i);break}t[e]=i;break;case"initialCountry":{if(typeof i!="string"){C("initialCountry","a string",i);break}let s=i.toLowerCase();if(s&&s!==F.AUTO&&!D(s)){C("initialCountry","a valid iso2 country code or 'auto'",i);break}t[e]=i;break}case"placeholderNumberType":if(typeof i!="string"||!P.includes(i)){let s=P.join(", ");C("placeholderNumberType",`one of ${s}`,i);break}t[e]=i;break;case"allowedNumberTypes":if(i!==null){if(!Array.isArray(i)){C("allowedNumberTypes","an array of number types or null",i);break}let s=!0;for(let o of i)if(typeof o!="string"||!P.includes(o)){let r=P.join(", ");C("allowedNumberTypes",`an array of valid number types (${r})`,o),s=!1;break}s&&(t[e]=i)}else t[e]=null;break}}return t},mt=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()))},Et=n=>{n.dropdownAlwaysOpen&&(n.useFullscreenPopup=!1,n.allowDropdown=!0),n.useFullscreenPopup?n.fixDropdownWidth=!1:ht()&&(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={...ut,...n.i18n}};var N=n=>n.replace(/\D/g,""),z=(n="")=>n.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase();var X=n=>Object.keys(n).filter(t=>!!n[t]).join(" "),p=(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 yt=()=>`
7
- <svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" ${h.HIDDEN}="true">
8
- <circle cx="11" cy="11" r="7" />
9
- <line x1="21" y1="21" x2="16.65" y2="16.65" />
10
- </svg>`,Ct=n=>{let t=`iti-${n}-clear-mask`;return`
11
- <svg class="iti__search-clear-svg" width="12" height="12" viewBox="0 0 16 16" ${h.HIDDEN}="true" focusable="false">
12
- <mask id="${t}" maskUnits="userSpaceOnUse">
13
- <rect width="16" height="16" fill="white" />
14
- <path d="M5.2 5.2 L10.8 10.8 M10.8 5.2 L5.2 10.8" stroke="black" stroke-linecap="round" class="iti__search-clear-x" />
15
- </mask>
16
- <circle cx="8" cy="8" r="8" class="iti__search-clear-bg" mask="url(#${t})" />
17
- </svg>`},gt=()=>`
18
- <svg class="iti__country-check-svg" width="14" height="14" viewBox="0 0 16 16" fill="currentColor" focusable="false" ${h.HIDDEN}="true">
19
- <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"/>
20
- </svg>`,nt=()=>`
21
- <svg width="256" height="256" viewBox="0 0 512 512" class="iti__globe-svg">
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
- <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 It=n=>{let t=new Map;for(let e of n){let i=z(e.name),s=i.split(/[^a-z]/).map(o=>o[0]).join("");t.set(e.iso2,{normalisedName:i,initials:s,dialCodePlus:`+${e.dialCode}`})}return t},bt=(n,t,e)=>{let i=z(e),s=[],o=[],r=[],l=[],a=[],f=[];for(let d of n){let m=t.get(d.iso2);d.iso2===i?s.push(d):m.normalisedName.startsWith(i)?o.push(d):m.normalisedName.includes(i)?r.push(d):i===d.dialCode||i===m.dialCodePlus?l.push(d):m.dialCodePlus.includes(i)?a.push(d):m.initials.includes(i)&&f.push(d)}let E=(d,m)=>d.priority-m.priority;return[...s,...o,...r,...l.sort(E),...a.sort(E),...f]},Lt=(n,t,e)=>{let i=z(e);for(let s of n){let{normalisedName:o}=t.get(s.iso2);if(o.startsWith(i))return s}return null};var H=class n{#t;static toAscii(t){return t?t.replace(/[٠-٩]/g,e=>String.fromCharCode(48+(e.charCodeAt(0)-1632))).replace(/[۰-۹]/g,e=>String.fromCharCode(48+(e.charCodeAt(0)-1776))):""}constructor(t){t&&this.#i(t)}#i(t){/[٠-٩]/.test(t)?this.#t="arabic-indic":/[۰-۹]/.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){return t?(this.#i(t),this.#t==="ascii"?t:n.toAscii(t)):""}isAscii(){return!this.#t||this.#t==="ascii"}};var k=class n{#t;#i;#A;#C="";#b;#w;#D=null;#_;#E;#e;#c;#g;#o;#s;#m;#l;#u;#n;#a;#h;#T;#k;#r;#y=null;#p=null;#S=new Map;#O=null;telInputEl;hadInitialPlaceholder;constructor(t,e,i){t.dataset[T.INSTANCE_ID]=i.toString(),this.telInputEl=t,this.#t=e,this.#i=i,this.hadInitialPlaceholder=!!t.getAttribute("placeholder"),this.#A=!!this.telInputEl.closest("[dir=rtl]"),this.#C=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,e){this.#b=t,this.#w=e,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 i=this.#U();this.#W(i),i.appendChild(this.telInputEl),this.#J(),this.#Q(i),this.ensureDropdownWidthSet()}#U(){let{allowDropdown:t,showFlags:e,containerClass:i,useFullscreenPopup:s}=this.#t,o=X({iti:!0,"iti--allow-dropdown":t,"iti--show-flags":e,"iti--inline-dropdown":!s,[i]:!!i}),r=p("div",{class:o});return this.#A&&r.setAttribute("dir","ltr"),this.telInputEl.before(r),r}#W(t){let{allowDropdown:e,separateDialCode:i,showFlags:s}=this.#t;if(!e&&!s&&!i)return;this.#E=p("div",{class:`iti__country-container ${c.V_HIDE}`},t),e?(this.#e=p("button",{type:"button",class:"iti__selected-country",[h.EXPANDED]:"false",[h.LABEL]:this.#t.i18n.noCountrySelected,[h.HASPOPUP]:"dialog",[h.CONTROLS]:`iti-${this.#i}__dropdown-content`},this.#E),this.telInputEl.disabled&&this.#e.setAttribute("disabled","true")):this.#e=p("div",{class:"iti__selected-country"},this.#E);let o=p("div",{class:"iti__selected-country-primary"},this.#e);this.#c=p("div",{class:c.FLAG},o),e&&(this.#o=p("div",{class:"iti__arrow",[h.HIDDEN]:"true"},o)),i&&(this.#g=p("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:r}=this.#t,l=t?"":"iti--flexible-dropdown-width";if(this.#s=p("div",{id:`iti-${this.#i}__dropdown-content`,class:`iti__dropdown-content ${c.HIDE} ${l}`,role:"dialog",[h.MODAL]:"true"}),this.#A&&this.#s.setAttribute("dir","rtl"),i&&this.#q(),this.#n=p("ul",{class:"iti__country-list",id:`iti-${this.#i}__country-listbox`,role:"listbox",[h.LABEL]:s.countryListAriaLabel},this.#s),this.#Z(),i&&this.#$(),e||(this.#_=this.#et(),i&&(this.#s.style.height=`${this.#_}px`)),o){let a=X({iti:!0,"iti--container":!0,"iti--fullscreen-popup":e,"iti--inline-dropdown":!e,[r]:!!r});this.#r=p("div",{class:a}),this.#r.appendChild(this.#s)}else this.#E.appendChild(this.#s)}#q(){let{i18n:t,searchInputClass:e}=this.#t,i=p("div",{class:"iti__search-input-wrapper"},this.#s);this.#m=p("span",{class:"iti__search-icon",[h.HIDDEN]:"true"},i),this.#m.innerHTML=yt(),this.#l=p("input",{id:`iti-${this.#i}__search-input`,type:"search",class:`iti__search-input ${e}`,placeholder:t.searchPlaceholder,role:"combobox",[h.EXPANDED]:"true",[h.LABEL]:t.searchPlaceholder,[h.CONTROLS]:`iti-${this.#i}__country-listbox`,[h.AUTOCOMPLETE]:"list",autocomplete:"off"},i),this.#u=p("button",{type:"button",class:`iti__search-clear ${c.HIDE}`,[h.LABEL]:t.clearSearchAriaLabel,tabindex:"-1"},i),this.#u.innerHTML=Ct(this.#i),this.#k=p("span",{class:"iti__a11y-text"},this.#s),this.#T=p("div",{class:`iti__no-results ${c.HIDE}`,[h.HIDDEN]:"true"},this.#s),this.#T.textContent=t.searchEmptyState??null}#J(){this.#E&&(this.#B(),this.#E.classList.remove(c.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.#a=o:(this.#a=p("input",{type:"hidden",name:s.phone}),t.appendChild(this.#a))}if(s.country){let o=this.telInputEl.form?.querySelector(`input[name="${s.country}"]`);o?this.#h=o:(this.#h=p("input",{type:"hidden",name:s.country}),t.appendChild(this.#h))}}#Z(){let t=document.createDocumentFragment();for(let e=0;e<this.#b.length;e++){let i=this.#b[e],s=X({[c.COUNTRY_ITEM]:!0}),o=p("li",{id:`iti-${this.#i}__item-${i.iso2}`,class:s,tabindex:"-1",role:"option",[h.SELECTED]:"false"});o.dataset[T.DIAL_CODE]=i.dialCode,o.dataset[T.ISO2]=i.iso2,this.#S.set(i.iso2,o),this.#t.showFlags&&p("div",{class:`${c.FLAG} iti__${i.iso2}`},o);let r=p("span",{class:"iti__country-name"},o);r.textContent=`${i.name} `;let l=p("span",{class:"iti__dial-code"},r);this.#A&&l.setAttribute("dir","ltr"),l.textContent=`(+${i.dialCode})`,t.appendChild(o)}this.#n.appendChild(t)}#B(){if(this.#e){let t=this.#t.separateDialCode?L.FALLBACK_SELECTED_WITH_DIAL_WIDTH:L.FALLBACK_SELECTED_NO_DIAL_WIDTH,i=(this.#e.offsetWidth||this.#tt()||t)+L.INPUT_PADDING_EXTRA_LEFT;this.telInputEl.style.paddingLeft=`${i}px`}}static#F(){let t;try{t=window.top.document.body}catch{t=document.body}return t}#tt(){if(!this.telInputEl.parentNode)return 0;let t=n.#F(),e=this.telInputEl.parentNode.cloneNode(!1);e.style.visibility="hidden",t.appendChild(e);let i=this.#E.cloneNode();e.appendChild(i);let s=this.#e.cloneNode(!0);i.appendChild(s);let o=s.offsetWidth;return t.removeChild(e),o}#et(){let t=n.#F();this.#s.classList.remove(c.HIDE);let e=p("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(c.HIDE),i>0?i:L.FALLBACK_DROPDOWN_HEIGHT}#$(){let{i18n:t}=this.#t,e=this.#n.childElementCount;this.#k.textContent=t.searchSummaryAria(e)}#j(t){let e;if(t==="")e=this.#b;else{let i=H.toAscii(t);e=bt(this.#b,this.#w,i)}this.#Y(e)}prefillSearchWithPlus(){this.#l.value="+",this.#l.focus(),this.#j("")}#P(){let t=this.#l.value.trim();this.#j(t),this.#l.value?this.#u.classList.remove(c.HIDE):this.#u.classList.add(c.HIDE)}#v(){this.#D&&clearTimeout(this.#D),this.#D=setTimeout(()=>{this.#P(),this.#D=null},tt.SEARCH_DEBOUNCE_MS)}#d(){this.#l.value="",this.#l.focus(),this.#P()}#R(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)}#f(t,e=!0){if(this.#p?.classList.remove(c.HIGHLIGHT),t){if(t.classList.add(c.HIGHLIGHT),this.#t.countrySearch){let i=t.getAttribute("id")||"";this.#l.setAttribute(h.ACTIVE_DESCENDANT,i)}e&&this.#R(t),this.#p=t}else this.#p=null}bindHiddenInputSubmitListener(t,e,i){let s=this.telInputEl.form;!s||!this.#a&&!this.#h||s.addEventListener("submit",()=>{this.#a&&(this.#a.value=e()),this.#h&&(this.#h.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.#E.addEventListener("keydown",o=>{let r=[y.ARROW_UP,y.ARROW_DOWN,y.SPACE,y.ENTER];!this.isDropdownOpen()&&r.includes(o.key)&&(o.preventDefault(),o.stopPropagation(),e()),o.key===y.TAB&&i()},{signal:t})}openDropdown(t,e){let{countrySearch:i,dropdownAlwaysOpen:s,dropdownContainer:o}=this.#t;if(this.#O=new AbortController,this.ensureDropdownWidthSet(),o)this.#K();else{let l=this.#N(),a=this.telInputEl.offsetHeight+L.DROPDOWN_MARGIN;l?this.#s.style.top=`${a}px`:this.#s.style.bottom=`${a}px`}this.#s.classList.remove(c.HIDE),this.#e.setAttribute(h.EXPANDED,"true");let r=this.#y??this.#n.firstElementChild;r&&this.#f(r),i&&!s&&this.#l.focus(),this.#t.useFullscreenPopup&&this.#r&&window.visualViewport&&window.visualViewport.addEventListener("resize",()=>{this.#L(),this.#p&&this.#R(this.#p)},{signal:this.#O.signal}),this.#o.classList.add(c.ARROW_UP),this.#x(t,e)}#x(t,e){let i=this.#O.signal;this.#it(i),this.#V(i,t),this.#t.dropdownAlwaysOpen||this.#st(i,e),this.#I(i,t,e),this.#t.countrySearch&&this.#G(i),!this.#t.useFullscreenPopup&&this.#t.dropdownContainer&&window.addEventListener("scroll",e,{signal:i})}#it(t){this.#n.addEventListener("mouseover",e=>{let i=e.target?.closest(`.${c.COUNTRY_ITEM}`);i&&this.#f(i,!1)},{signal:t})}#V(t,e){this.#n.addEventListener("click",i=>{let s=i.target?.closest(`.${c.COUNTRY_ITEM}`);s&&e(s)},{signal:t})}#st(t,e){setTimeout(()=>{document.documentElement.addEventListener("click",i=>{this.#s.contains(i.target)||e()},{signal:t})},0)}#I(t,e,i){let s="",o=null,r=l=>{[y.ARROW_UP,y.ARROW_DOWN,y.ENTER,y.ESC].includes(l.key)&&(l.preventDefault(),l.stopPropagation(),l.key===y.ARROW_UP||l.key===y.ARROW_DOWN?this.#nt(l.key):l.key===y.ENTER&&!l.isComposing?e(this.#p):l.key===y.ESC&&(i(),this.#e.focus())),!this.#t.countrySearch&&l.target!==this.telInputEl&&A.HIDDEN_SEARCH_CHAR.test(l.key)&&(l.stopPropagation(),o&&clearTimeout(o),s+=l.key.toLowerCase(),this.#H(s),o=setTimeout(()=>{s=""},tt.HIDDEN_SEARCH_RESET_MS))};document.addEventListener("keydown",r,{signal:t})}#G(t){this.#l.addEventListener("input",()=>this.#v(),{signal:t}),this.#u.addEventListener("click",()=>this.#d(),{signal:t})}#H(t){let e=Lt(this.#b,this.#w,t);if(e){let i=this.#S.get(e.iso2);this.#f(i)}}#nt(t){let e=t===y.ARROW_UP?this.#p?.previousElementSibling:this.#p?.nextElementSibling;!e&&this.#n.childElementCount>1&&(e=t===y.ARROW_UP?this.#n.lastElementChild:this.#n.firstElementChild),e&&this.#f(e)}#M(t){if(this.#y&&this.#y.dataset[T.ISO2]!==t&&(this.#y.setAttribute(h.SELECTED,"false"),this.#y.querySelector(".iti__country-check")?.remove(),this.#y=null),t&&!this.#y){let e=this.#n.querySelector(`[data-iso2="${t}"]`);if(e){e.setAttribute(h.SELECTED,"true");let i=p("span",{class:"iti__country-check",[h.HIDDEN]:"true"},e);i.innerHTML=gt(),this.#y=e,this.#t.dropdownAlwaysOpen&&this.#f(e)}}}#Y(t){this.#n.replaceChildren();let e=!0;for(let i of t){let s=this.#S.get(i.iso2);s&&(this.#n.appendChild(s),e&&(this.#f(s,!1),e=!1))}e?(this.#f(null),this.#T&&this.#T.classList.remove(c.HIDE)):this.#T&&this.#T.classList.add(c.HIDE),this.#n.scrollTop=0,this.#$()}closeDropdown(){let{countrySearch:t,dropdownContainer:e}=this.#t;this.#O.abort(),this.#O=null,this.#s.classList.add(c.HIDE),this.#e.setAttribute(h.EXPANDED,"false"),t&&(this.#l.removeAttribute(h.ACTIVE_DESCENDANT),this.#l.value="",this.#P(),this.#p&&(this.#p.classList.remove(c.HIGHLIGHT),this.#p=null)),this.#o.classList.remove(c.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="")}#N(){if(this.#t.dropdownAlwaysOpen)return!0;let t=this.telInputEl.getBoundingClientRect(),e=t.top,i=window.innerHeight-t.bottom;return i>=this.#_||i>=e}#K(){let{dropdownContainer:t,useFullscreenPopup:e}=this.#t;if(e){if(window.innerWidth>=L.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.#N()?this.#r.style.top=`${i.bottom+L.DROPDOWN_MARGIN}px`:(this.#r.style.top="unset",this.#r.style.bottom=`${window.innerHeight-i.top+L.DROPDOWN_MARGIN}px`)}t.appendChild(this.#r)}#L(){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(c.HIDE)}setLoading(t){this.#c.classList.toggle(c.LOADING,t)}isLoading(){return this.#c.classList.contains(c.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,r=t?.name,l=t?.dialCode,a=t?.iso2??"";if(e&&this.#M(a),this.#e){let f=a&&i?`${c.FLAG} iti__${a}`:`${c.FLAG} ${c.GLOBE}`,E,d,m;a?(d=r,E=o.selectedCountryAriaLabel.replace("${countryName}",r).replace("${dialCode}",`+${l}`),m=i?"":nt()):(d=o.noCountrySelected,E=o.noCountrySelected,m=nt()),this.#c.className=f,this.#e.setAttribute("title",d),this.#e.setAttribute(h.LABEL,E),this.#c.innerHTML=m}if(s){let f=l?`+${l}`:"";this.#g.textContent=f,this.#B()}}destroy(){this.telInputEl.iti=void 0,delete this.telInputEl.dataset[T.INSTANCE_ID],this.telInputEl.style.paddingLeft=this.#C;let t=this.telInputEl.parentNode;t&&(t.before(this.telInputEl),t.remove()),this.#S.clear()}};var At=n=>{let{onlyCountries:t,excludeCountries:e}=n;return t?.length?R.filter(i=>t.includes(i.iso2)):e?.length?R.filter(i=>!e.includes(i.iso2)):[...R]},Tt=(n,t)=>{let{countryNameLocale:e,countryNameOverrides: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())||""},vt=n=>{let t=new Set,e=0,i={},s=(r,l)=>{if(!r||!l)return;l.length>e&&(e=l.length),Object.hasOwn(i,l)||(i[l]=[]);let a=i[l];a.includes(r)||a.push(r)},o=[...n].sort((r,l)=>r.priority-l.priority);for(let r of o){t.has(r.dialCode)||t.add(r.dialCode);for(let l=1;l<r.dialCode.length;l++){let a=r.dialCode.substring(0,l);s(r.iso2,a)}if(s(r.iso2,r.dialCode),r.areaCodes){let l=i[r.dialCode][0];for(let a of r.areaCodes){for(let f=1;f<a.length;f++){let E=a.substring(0,f),d=r.dialCode+E;s(l,d),s(r.iso2,d)}s(r.iso2,r.dialCode+a)}}}return{dialCodes:t,dialCodeMaxLength:e,dialCodeToIso2Map:i}},Nt=(n,t)=>{let{countryOrder:e}=t;n.sort((i,s)=>{if(e){let o=e.indexOf(i.iso2),r=e.indexOf(s.iso2),l=o>-1,a=r>-1;if(l||a)return l&&a?o-r:l?-1:1}return i.name.localeCompare(s.name)})};var Vt=new Set(["800","808","870","881","882","883","888","979"]),ot=n=>{let t=N(n).slice(0,3);return n.startsWith("+")&&Vt.has(t)};var rt=(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,r=i?.dialCode;return s&&t.charAt(0)!=="+"&&o.includes(`+${r}`)?(o.split(`+${r}`)[1]||"").trim():o};var Dt=(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 Gt=new Set(["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"]),lt=n=>{let t=N(n);if(t.startsWith(j.NANP)&&t.length>=4){let e=t.substring(1,4);return Gt.has(e)}return!1};var Yt=0,U=n=>{if(!u.utils)throw new Error(`intlTelInput.utils is required for ${n}(). See: https://intl-tel-input.com/docs/utils`)},Ot=()=>{let n,t;return{promise:new Promise((i,s)=>{n=i,t=s}),resolve:n,reject:t}},W=class n{id;promise;#t;#i;#A;#C;#b;#w;#D;#_;#E;#e=null;#c=null;#g;#o=!0;#s;#m;#l=!1;#u;#n;constructor(t,e={}){this.id=Yt++,k.validateInput(t);let i=ft(e);this.#i={...K,...i},mt(this.#i),Et(this.#i),this.#t=new k(t,this.#i,this.id),this.#A=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),this.#m=new H(t.value),this.promise=this.#T(this.#i),this.#C=At(this.#i);let{dialCodes:s,dialCodeMaxLength:o,dialCodeToIso2Map:r}=vt(this.#C);this.#D=s,this.#b=o,this.#w=r,this.#_=new Map(this.#C.map(l=>[l.iso2,l])),this.#k()}#a(){let t=this.#t.telInputEl.value.trim();return this.#m.normalise(t)}#h(t){this.#t.telInputEl.value=this.#m.denormalise(t)}#T(t){let{initialCountry:e,geoIpLookup:i,loadUtils:s}=t,o=e===F.AUTO&&!!i,r=!!s&&!u.utils;return o&&(this.#u=Ot()),r&&(this.#n=Ot()),Promise.all([this.#u?.promise,this.#n?.promise]).then(()=>{})}#k(){this.#s=new AbortController,this.#r(),this.#t.buildMarkup(this.#C,this.#E),this.#y(),this.#p(),this.#S(),this.#i.dropdownAlwaysOpen&&this.#R()}#r(){Tt(this.#C,this.#i),Nt(this.#C,this.#i),this.#E=It(this.#C)}#y(t=!1){let e=this.#t.telInputEl.getAttribute("value"),i=this.#m.normalise(e??""),s=this.#a(),r=i&&i.startsWith("+")&&(!s||!s.startsWith("+"))?i:s,l=this.#N(r),a=lt(r),{initialCountry:f,geoIpLookup:E}=this.#i,d=f===F.AUTO&&E,m=d&&u.autoCountry?u.autoCountry:f,v=d&&!t&&!u.autoCountry,b=D(m);l?a?b?this.#I(m):v||this.#I(at.ISO2):(b&&this.#I(m),this.#x(r)):b?this.#I(m):v||this.#I(""),r&&this.#f(r)}#p(){this.#X(),this.#i.allowDropdown&&this.#t.bindAllInitialDropdownListeners(this.#s.signal,()=>this.#R(),()=>this.#M()),this.#t.bindHiddenInputSubmitListener(this.#s.signal,()=>this.getNumber(),()=>this.#e?.iso2||"")}#S(){if(this.#n){let{loadUtils:t}=this.#i,e=()=>{u.attachUtils(t).catch(()=>{})};u.documentReady()?e():window.addEventListener("load",e,{signal:this.#s.signal})}this.#u&&(this.#e?this.#u.resolve():this.#O())}async#O(){if(u.autoCountry){this.#rt();return}if(this.#t.setLoading(!0),!u.startedLoadingAutoCountry&&(u.startedLoadingAutoCountry=!0,typeof this.#i.geoIpLookup=="function"))try{let t=await this.#i.geoIpLookup(),e=typeof t=="string"?t.toLowerCase():"";if(!D(e)){n.forEachInstance("handleAutoCountryFailure");return}u.autoCountry=e,setTimeout(()=>n.forEachInstance("handleAutoCountryLoaded"))}catch{n.forEachInstance("handleAutoCountryFailure")}}#U(){this.#R(),this.#t.prefillSearchWithPlus()}#W(t){let e=this.#t.telInputEl.selectionStart||0,i=t.substring(0,e-1),s=t.substring(e);return this.#h(i+s),e-1}#X(){this.#B(),this.#tt(),this.#$()}#q(t){this.#W(t),this.#U()}#J(t,e){let i=this.#W(t);this.#t.telInputEl.setSelectionRange(i,i),this.#v(),this.#d(I.STRICT_REJECT,{source:"key",rejectedInput:e,reason:"invalid"})}#Q(t,e){let i=this.#t.telInputEl.selectionStart||0,o=t.substring(0,i).replace(A.NON_PLUS_NUMERIC_GLOBAL,"").length,r=this.#L(),l=wt(r,t,u.utils,this.#e,this.#i.separateDialCode),a=Dt(o,l,i,e);this.#h(l),this.#t.telInputEl.setSelectionRange(a,a)}#Z(t){if(t.startsWith("+")&&this.#e&&this.#N(t)){let e=rt(t,!0,!0,this.#e);this.#h(e)}}#B(){this.#l=A.ALPHA_UNICODE.test(this.#a()),this.#t.telInputEl.addEventListener("input",this.#F,{signal:this.#s.signal})}#F=t=>{let{strictMode:e,formatAsYouType:i,separateDialCode:s,allowDropdown:o,countrySearch:r}=this.#i,l=t?.detail;if(l?.isCountryChange)return;let a=this.#a();if(this.#A&&t?.data==="+"&&s&&o&&r){this.#q(a);return}if(this.#A&&e&&(t?.data===" "||t?.data==="-"||t?.data===".")){this.#J(a,t.data);return}this.#x(a)&&this.#z();let f=t?.data&&A.NON_PLUS_NUMERIC.test(t.data),E=t?.inputType===Z.PASTE&&a;f||E&&!e?this.#l=!0:A.NON_PLUS_NUMERIC.test(a)||(this.#l=!1),i&&!this.#l&&!l?.isSetNumber&&this.#m.isAscii()&&this.#Q(a,t?.inputType===Z.DELETE_FORWARD),s&&this.#Z(a)};#tt(){let{strictMode:t,separateDialCode:e}=this.#i;!t&&!e||this.#t.telInputEl.addEventListener("keydown",this.#et,{signal:this.#s.signal})}#et=t=>{let{strictMode:e,separateDialCode:i,allowDropdown:s,countrySearch:o}=this.#i;if(!t.key||t.key.length!==1||t.altKey||t.ctrlKey||t.metaKey)return;if(i&&s&&o&&t.key==="+"){t.preventDefault(),this.#U();return}if(!e)return;let r=this.#a(),a=!r.startsWith("+")&&this.#t.telInputEl.selectionStart===0&&t.key==="+",f=this.#m.normalise(t.key),E=/^[0-9]$/.test(f),d=i?E:a||E,m=this.#t.telInputEl,v=m.selectionStart,b=m.selectionEnd,$=r.slice(0,v??void 0),O=r.slice(b??void 0),g=$+f+O,_=this.#K(g),B=!1;u.utils&&this.#c&&(B=u.utils.getCoreNumber(_,this.#e?.iso2).length>this.#c);let q=this.#V(_)!==null;(!d||B&&!q&&!a)&&(this.#v(),this.#d(I.STRICT_REJECT,{source:"key",rejectedInput:t.key,reason:d?"max-length":"invalid"}),t.preventDefault())};#$(){this.#i.strictMode&&this.#t.telInputEl.addEventListener("paste",this.#j,{signal:this.#s.signal})}#j=t=>{t.preventDefault();let e=this.#t.telInputEl,i=e.selectionStart,s=e.selectionEnd,o=this.#a(),r=o.slice(0,i??void 0),l=o.slice(s??void 0),a=this.#e?.iso2,f=t.clipboardData.getData("text"),E=this.#m.normalise(f),d=i===0&&s>0,m=!o.startsWith("+")||d,v=E.replace(A.NON_PLUS_NUMERIC_GLOBAL,""),b=v.startsWith("+"),$=v.replace(/\+/g,""),O=b&&m?`+${$}`:$,g=r+O+l,_=O!==E?"invalid":null;if(g.length>30){this.#v(),this.#d(I.STRICT_REJECT,{source:"paste",rejectedInput:f,reason:"max-length"});return}if(g.length>5&&u.utils){let S=u.utils.getCoreNumber(g,a);for(;S.length===0&&g.length>0;)g=g.slice(0,-1),S=u.utils.getCoreNumber(g,a);if(!S){this.#v(),this.#d(I.STRICT_REJECT,{source:"paste",rejectedInput:f,reason:"max-length"});return}if(this.#c&&S.length>this.#c)if(e.selectionEnd===o.length){let q=S.length-this.#c;g=g.slice(0,g.length-q),_="max-length"}else{this.#v(),this.#d(I.STRICT_REJECT,{source:"paste",rejectedInput:f,reason:"max-length"});return}}this.#h(g);let B=i+O.length;e.setSelectionRange(B,B),e.dispatchEvent(new InputEvent("input",{bubbles:!0})),_&&(E.length>0&&O.length===0&&this.#v(),this.#d(I.STRICT_REJECT,{source:"paste",rejectedInput:f,reason:_}))};#P(t){let e=Number(this.#t.telInputEl.getAttribute("maxlength"));return e&&t.length>e?t.substring(0,e):t}#v(){if(!this.#i.strictRejectAnimation)return;let t=this.#t.telInputEl.parentElement;t&&(t.classList.remove("iti__strict-reject-animation"),t.offsetWidth,t.classList.add("iti__strict-reject-animation"))}#d(t,e={}){let i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e});this.#t.telInputEl.dispatchEvent(i)}#R(){this.#t.openDropdown(t=>this.#nt(t),()=>this.#M()),this.#d(I.OPEN_COUNTRY_DROPDOWN)}#f(t){let{formatOnDisplay:e,nationalMode:i,separateDialCode:s}=this.#i,o=t;if(e&&u.utils&&this.#e){let r=ot(t),a=i&&!r||!o.startsWith("+")&&!s?x.NATIONAL:x.INTERNATIONAL;o=u.utils.formatNumber(o,this.#e?.iso2,a)}o=this.#ot(o),this.#h(o)}#x(t){let e=this.#V(t);return e!==null?this.#I(e):!1}#it(t){let e=this.#e?.dialCode,i=this.#e?.nationalPrefix;if(t.startsWith("+")||!e)return t;let r=i&&t.startsWith(i)&&!this.#i.separateDialCode?t.substring(1):t;return`+${e}${r}`}#V(t){let e=t.indexOf("+"),i=e>0?t.substring(e):t,s=this.#e?.iso2;i=this.#it(i);let o=this.#N(i,!0),r=N(i);if(o){let l=N(o),a=this.#w[l];return a.length===1?a[0]===s?null:a[0]:this.#st(a,l,r)}else if(i.startsWith("+")&&r.length){let l=this.#e?.dialCode||"";return l&&l.startsWith(r)?null:""}else if((!i||i==="+")&&!s&&this.#g)return this.#g;return null}#st(t,e,i){let s=this.#e?.iso2,o=this.#e?.dialCode;if(!s&&this.#g&&t.includes(this.#g))return this.#g;if(o===j.NANP&&lt(i))return null;let l=this.#e?.areaCodes,a=this.#e?.priority;if(l){let v=l.map(b=>`${o}${b}`);for(let b of v)if(i.startsWith(b))return null}let E=l&&!(a===0)&&i.length>e.length,d=s&&t.includes(s)&&!E,m=s===t[0];return!d&&!m?t[0]:null}#I(t){let e=this.#e?.iso2||"";return this.#e=t?this.#_.get(t):null,this.#e&&(this.#g=this.#e.iso2),this.#t.setCountry(this.#e),this.#H(),this.#G(),e!==t}#G(){let{strictMode:t,placeholderNumberType:e,allowedNumberTypes:i}=this.#i;if(!t||!u.utils)return;let s=this.#e?.iso2;if(!s){this.#c=null;return}let o=u.utils.getExampleNumber(s,!1,e,!0),r=o;for(;u.utils.isPossibleNumber(o,s,i);)r=o,o+="0";let l=u.utils.getCoreNumber(r,s);this.#c=l.length,s==="by"&&(this.#c=l.length+1)}#H(){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 r=this.#e?u.utils.getExampleNumber(this.#e.iso2,i,e):"";r=this.#ot(r),typeof s=="function"&&(r=s(r,this.#e)),this.#t.telInputEl.setAttribute("placeholder",r)}#nt(t){if(!t)return;let e=t.dataset[T.ISO2],i=this.#I(e);this.#M();let s=t.dataset[T.DIAL_CODE];if(this.#Y(s),this.#i.formatOnDisplay){let o=this.#a();this.#f(o)}this.#t.telInputEl.focus(),i&&(this.#z(),this.#d(I.INPUT,{isCountryChange:!0}))}#M(t){!this.#t.isDropdownOpen()||this.#i.dropdownAlwaysOpen&&!t||(this.#t.closeDropdown(),this.#d(I.CLOSE_COUNTRY_DROPDOWN))}#Y(t){let e=this.#a();if(!e.startsWith("+"))return;let i=`+${t}`,s=this.#N(e),o;s?o=e.replace(s,i):o=i,this.#h(o)}#N(t,e){if(!t.startsWith("+"))return"";let i="",s="",o=!1;for(let r=0;r<t.length;r++){let l=t.charAt(r);if(!/[0-9]/.test(l))continue;if(s+=l,!!!this.#w[s])break;if(this.#D.has(s)){if(i=t.substring(0,r+1),o=!0,!e)break}else e&&o&&(i=t.substring(0,r+1));if(s.length===this.#b)break}return i}#K(t){let e=this.#e?.dialCode,i=N(t);return(this.#i.separateDialCode&&!t.startsWith("+")&&e&&i?`+${e}`:"")+t}#L(){let t=this.#a();return this.#K(t)}#ot(t){let e=!!this.#N(t),i=rt(t,e,this.#i.separateDialCode,this.#e);return this.#P(i)}#z(){this.#d(I.COUNTRY_CHANGE,this.#e??null)}#rt(){if(!(!this.#u||!u.autoCountry)){if(!this.#o){this.#u.resolve();return}this.#t.isLoading()?this.setCountry(u.autoCountry):this.#g=u.autoCountry,this.#t.setLoading(!1),this.#u.resolve()}}#at(){if(!this.#o){this.#u?.reject();return}this.#y(!0),this.#t.setLoading(!1),this.#u?.reject()}#ut(){if(!this.#o){this.#n?.resolve();return}if(!u.utils){this.#n?.resolve();return}let t=this.#a();t&&this.#f(t),this.#e&&(this.#H(),this.#G()),this.#n?.resolve()}#ct(t){if(!this.#o){this.#n?.reject(t);return}this.#n?.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?(U("getExtension"),u.utils.getExtension(this.#L(),this.#e?.iso2)):""}getNumber(t){if(!this.#o)return"";U("getNumber");let e=this.#e?.iso2,i=this.#L(),s=u.utils.formatNumber(i,e,t);return this.#m.denormalise(s)}getNumberType(){return this.#o?(U("getNumberType"),u.utils.getNumberType(this.#L(),this.#e?.iso2)):null}getSelectedCountryData(){return this.#e??null}getValidationError(){if(!this.#o)return null;U("getValidationError");let t=this.#e?.iso2;return u.utils.getValidationError(this.#L(),t)}isValidNumber(){if(!this.#o)return null;U("isValidNumber");let t=this.#e?.dialCode,e=this.#e?.iso2,i=this.#L(),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(!A.ALPHA_UNICODE.test(i)&&t){let r=i.startsWith("+")?i.slice(1+t.length):i,l=N(r).length;if(s.length>l)return!1}}return this.#lt("possible")}isValidNumberPrecise(){return this.#o?(U("isValidNumberPrecise"),this.#lt("precise")):null}#lt(t){let{allowNumberExtensions:e,allowPhonewords:i,allowedNumberTypes:s}=this.#i,o=this.#e?.iso2,r=this.#L();return!this.#e&&!ot(r)||!(t==="precise"?u.utils.isValidNumber:u.utils.isPossibleNumber)(r,o,s)?!1:A.ALPHA_UNICODE.test(r)?!!u.utils.getExtension(r,o)?e:i:!0}setCountry(t){if(!this.#o)return;let e=t?.toLowerCase();if(!D(e))throw new Error(`Invalid iso2 code: '${e}'`);let i=this.#e?.iso2;if(t&&e!==i||!t&&i){if(this.#I(e),this.#Y(this.#e?.dialCode||""),this.#i.formatOnDisplay){let o=this.#a();this.#f(o)}this.#z(),this.#d(I.INPUT,{isCountryChange:!0})}}setNumber(t){if(!this.#o)return;let e=this.#m.normalise(t),i=this.#x(e);this.#f(e),i&&this.#z(),this.#d(I.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.#ut();break;case"handleUtilsFailure":o.#ct(s);break;case"handleAutoCountryLoaded":o.#rt();break;case"handleAutoCountryFailure":o.#at();break}})}},Kt=async n=>{if(u.utils||u.startedLoadingUtils)return null;if(typeof n!="function")throw new TypeError(`The argument passed to attachUtils must be a function that returns a promise for the utils module, not ${typeof n}`);u.startedLoadingUtils=!0;try{let e=(await n())?.default;if(!e||typeof e!="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=e,W.forEachInstance("handleUtilsLoaded"),!0}catch(t){throw W.forEachInstance("handleUtilsFailure",t),t}},u=Object.assign((n,t)=>{let e=new W(n,t);return u.instances.set(String(e.id),e),n.iti=e,e},{defaults:K,documentReady:()=>document.readyState==="complete",getCountryData:()=>R,getInstance:n=>{let t=n.dataset[T.INSTANCE_ID];return t?u.instances.get(t)??null:null},instances:new Map,attachUtils:Kt,startedLoadingUtils:!1,startedLoadingAutoCountry:!1,version:"28.0.3",NUMBER_FORMAT:x,NUMBER_TYPE:w,VALIDATION_ERROR:G}),zt=u;return xt(Xt);})();
6
+ "use strict";var _factory=(()=>{var Q=Object.defineProperty;var _t=Object.getOwnPropertyDescriptor;var Rt=Object.getOwnPropertyNames;var Mt=Object.prototype.hasOwnProperty;var Pt=(n,t)=>{for(var e in t)Q(n,e,{get:t[e],enumerable:!0})},xt=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Rt(t))!Mt.call(n,s)&&s!==e&&Q(n,s,{get:()=>t[s],enumerable:!(i=_t(t,s))||i.enumerable});return n};var Ht=n=>xt(Q({},"__esModule",{value:!0}),n);var Jt={};Pt(Jt,{Iti:()=>W,NUMBER_FORMAT:()=>x,NUMBER_TYPE:()=>w,VALIDATION_ERROR:()=>Y,default:()=>qt});var kt=[["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"]],Z=[];for(let n of kt)Z.push({name:"",iso2:n[0],dialCode:n[1],priority:n[2]||0,areaCodes:n[3]||null,nationalPrefix:n[4]||null});var Ut=new Set(Z.map(n=>n.iso2)),D=n=>Ut.has(n),R=Z;var I={OPEN_COUNTRY_DROPDOWN:"open:countrydropdown",CLOSE_COUNTRY_DROPDOWN:"close:countrydropdown",COUNTRY_CHANGE:"countrychange",INPUT:"input",STRICT_REJECT:"strict:reject"},c={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"},C={ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",SPACE:" ",ENTER:"Enter",ESC:"Escape",TAB:"Tab"},tt={PASTE:"insertFromPaste",DELETE_FORWARD:"deleteContentForward"},A={ALPHA_UNICODE:/\p{L}/u,NON_PLUS_NUMERIC:/[^+0-9]/,NON_PLUS_NUMERIC_GLOBAL:/[^+0-9]/g,HIDDEN_SEARCH_CHAR:/^[a-zA-ZÀ-ÿа-яА-Я ]$/},et={SEARCH_DEBOUNCE_MS:100,HIDDEN_SEARCH_RESET_MS:1e3,NEXT_TICK:0},L={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},V={PLUS:"+",NANP:"1"},G={ISO2:"gb",DIAL_CODE:"44",MOBILE_PREFIX:"7",MOBILE_CORE_LENGTH:10},ut={ISO2:"us",DIAL_CODE:"1"},M={AGGRESSIVE:"aggressive",POLITE:"polite",OFF:"off"},F={AUTO:"auto"},Wt=["E164","INTERNATIONAL","NATIONAL","RFC3966"],P=["FIXED_LINE","MOBILE","FIXED_LINE_OR_MOBILE","TOLL_FREE","PREMIUM_RATE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL","UNKNOWN"],Bt=["IS_POSSIBLE","INVALID_COUNTRY_CODE","TOO_SHORT","TOO_LONG","IS_POSSIBLE_LOCAL_ONLY","INVALID_LENGTH"],it=n=>Object.fromEntries(n.map(t=>[t,t])),x=it(Wt),w=it(P),Y=it(Bt),T={ISO2:"iso2",DIAL_CODE:"dialCode",INSTANCE_ID:"intlTelInputId"},h={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 Ft={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`}},ct=Ft;var nt=n=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(n).matches,pt=()=>nt(`(max-width: ${L.NARROW_VIEWPORT_WIDTH}px)`),$t=()=>{if(typeof navigator<"u"&&typeof window<"u"){let n=nt("(max-height: 600px)"),t=nt("(pointer: coarse)");return pt()||t&&n}return!1},z={allowDropdown:!0,allowedNumberTypes:[w.MOBILE,w.FIXED_LINE],allowNumberExtensions:!1,allowPhonewords:!1,autoPlaceholder:M.POLITE,containerClass:"",countryNameLocale:"en",countryNameOverrides:{},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:!1,onlyCountries:null,placeholderNumberType:w.MOBILE,searchInputClass:"",separateDialCode:!0,strictRejectAnimation:!0,showFlags:!0,strictMode:!0,useFullscreenPopup:$t()},ft=n=>JSON.stringify(n),st=n=>!!n&&typeof n=="object"&&!Array.isArray(n),jt=n=>typeof n=="function",Vt=n=>{if(!n||typeof n!="object")return!1;let t=n;return t.nodeType===1&&typeof t.tagName=="string"&&typeof t.appendChild=="function"},dt=new Set(Object.values(M)),K=n=>{console.warn(`[intl-tel-input] ${n}`)},y=(n,t,e)=>{K(`Option '${n}' must be ${t}; got ${ft(e)}. Ignoring.`)},ht=(n,t)=>{let e="an array of iso2 country code strings";if(!Array.isArray(t))return y(n,e,t),!1;let i=[];for(let s of t){if(typeof s!="string")return y(n,e,t),!1;let o=s.toLowerCase();D(o)?i.push(s):K(`Invalid iso2 code in '${n}': '${s}'. Skipping.`)}return i},mt=n=>{if(n===void 0)return{};if(!st(n)){let e=`The second argument must be an options object; got ${ft(n)}. Using defaults.`;return K(e),{}}let t={};for(let[e,i]of Object.entries(n)){if(!Object.hasOwn(z,e)){K(`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"strictRejectAnimation":case"useFullscreenPopup":if(typeof i!="boolean"){y(e,"a boolean",i);break}t[e]=i;break;case"autoPlaceholder":if(typeof i!="string"||!dt.has(i)){let s=Array.from(dt).join(", ");y("autoPlaceholder",`one of ${s}`,i);break}t[e]=i;break;case"containerClass":case"searchInputClass":case"countryNameLocale":if(typeof i!="string"){y(e,"a string",i);break}t[e]=i;break;case"countryOrder":{if(i===null)t[e]=i;else{let s=ht(e,i);s!==!1&&(t[e]=s)}break}case"customPlaceholder":case"geoIpLookup":case"hiddenInput":case"loadUtils":if(i!==null&&!jt(i)){y(e,"a function or null",i);break}t[e]=i;break;case"dropdownContainer":if(i!==null&&!Vt(i)){y("dropdownContainer","an HTMLElement or null",i);break}t[e]=i;break;case"excludeCountries":case"onlyCountries":{if(i===null)t[e]=i;else{let s=ht(e,i);s!==!1&&(t[e]=s)}break}case"i18n":if(i&&!st(i)){y("i18n","an object",i);break}t[e]=i;break;case"countryNameOverrides":if(i&&!st(i)){y("countryNameOverrides","an object",i);break}t[e]=i;break;case"initialCountry":{if(typeof i!="string"){y("initialCountry","a string",i);break}let s=i.toLowerCase();if(s&&s!==F.AUTO&&!D(s)){y("initialCountry","a valid iso2 country code or 'auto'",i);break}t[e]=i;break}case"placeholderNumberType":if(typeof i!="string"||!P.includes(i)){let s=P.join(", ");y("placeholderNumberType",`one of ${s}`,i);break}t[e]=i;break;case"allowedNumberTypes":if(i!==null){if(!Array.isArray(i)){y("allowedNumberTypes","an array of number types or null",i);break}let s=!0;for(let o of i)if(typeof o!="string"||!P.includes(o)){let r=P.join(", ");y("allowedNumberTypes",`an array of valid number types (${r})`,o),s=!1;break}s&&(t[e]=i)}else t[e]=null;break}}return t},Et=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()))},Ct=n=>{n.dropdownAlwaysOpen&&(n.useFullscreenPopup=!1,n.allowDropdown=!0),n.useFullscreenPopup?n.fixDropdownWidth=!1:pt()&&(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={...ct,...n.i18n}};var N=n=>n.replace(/\D/g,""),X=(n="")=>n.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase();var q=n=>Object.keys(n).filter(t=>!!n[t]).join(" "),p=(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 Gt="http://www.w3.org/2000/svg",$=([n,t,e])=>{let i=document.createElementNS(Gt,n);if(t)for(let s in t)i.setAttribute(s,String(t[s]));if(e)for(let s of e)i.appendChild($(s));return i},yt=()=>$(["svg",{class:"iti__search-icon-svg",width:14,height:14,viewBox:"0 0 24 24",focusable:"false",[h.HIDDEN]:"true"},[["circle",{cx:11,cy:11,r:7}],["line",{x1:21,y1:21,x2:16.65,y2:16.65}]]]),gt=n=>{let t=`iti-${n}-clear-mask`;return $(["svg",{class:"iti__search-clear-svg",width:12,height:12,viewBox:"0 0 16 16",[h.HIDDEN]:"true",focusable:"false"},[["mask",{id:t,maskUnits:"userSpaceOnUse"},[["rect",{width:16,height:16,fill:"white"}],["path",{d:"M5.2 5.2 L10.8 10.8 M10.8 5.2 L5.2 10.8",stroke:"black","stroke-linecap":"round",class:"iti__search-clear-x"}]]],["circle",{cx:8,cy:8,r:8,class:"iti__search-clear-bg",mask:`url(#${t})`}]]])},It=()=>$(["svg",{class:"iti__country-check-svg",width:14,height:14,viewBox:"0 0 16 16",fill:"currentColor",focusable:"false",[h.HIDDEN]:"true"},[["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"}]]]),ot=()=>$(["svg",{width:256,height:256,viewBox:"0 0 512 512",class:"iti__globe-svg"},[["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"}],["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"}]]]);var bt=n=>{let t=new Map;for(let e of n){let i=X(e.name),s=i.split(/[^a-z]/).map(o=>o[0]).join("");t.set(e.iso2,{normalisedName:i,initials:s,dialCodePlus:`+${e.dialCode}`})}return t},Lt=(n,t,e)=>{let i=X(e),s=[],o=[],r=[],l=[],a=[],f=[];for(let d of n){let m=t.get(d.iso2);d.iso2===i?s.push(d):m.normalisedName.startsWith(i)?o.push(d):m.normalisedName.includes(i)?r.push(d):i===d.dialCode||i===m.dialCodePlus?l.push(d):m.dialCodePlus.includes(i)?a.push(d):m.initials.includes(i)&&f.push(d)}let E=(d,m)=>d.priority-m.priority;return[...s,...o,...r,...l.sort(E),...a.sort(E),...f]},At=(n,t,e)=>{let i=X(e);for(let s of n){let{normalisedName:o}=t.get(s.iso2);if(o.startsWith(i))return s}return null};var H=class n{#t;static toAscii(t){return t?t.replace(/[٠-٩]/g,e=>String.fromCharCode(48+(e.charCodeAt(0)-1632))).replace(/[۰-۹]/g,e=>String.fromCharCode(48+(e.charCodeAt(0)-1776))):""}constructor(t){t&&this.#i(t)}#i(t){/[٠-٩]/.test(t)?this.#t="arabic-indic":/[۰-۹]/.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){return t?(this.#i(t),this.#t==="ascii"?t:n.toAscii(t)):""}isAscii(){return!this.#t||this.#t==="ascii"}};var k=class n{#t;#i;#A;#y="";#b;#w;#D=null;#S;#E;#e;#u;#g;#o;#s;#m;#l;#c;#n;#a;#h;#T;#k;#r;#C=null;#p=null;#_=new Map;#O=null;telInputEl;hadInitialPlaceholder;constructor(t,e,i){t.dataset[T.INSTANCE_ID]=i.toString(),this.telInputEl=t,this.#t=e,this.#i=i,this.hadInitialPlaceholder=!!t.getAttribute("placeholder"),this.#A=!!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,e){this.#b=t,this.#w=e,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 i=this.#U();this.#W(i),i.appendChild(this.telInputEl),this.#J(),this.#Q(i),this.ensureDropdownWidthSet()}#U(){let{allowDropdown:t,showFlags:e,containerClass:i,useFullscreenPopup:s}=this.#t,o=q({iti:!0,"iti--allow-dropdown":t,"iti--show-flags":e,"iti--inline-dropdown":!s,[i]:!!i}),r=p("div",{class:o});return this.#A&&r.setAttribute("dir","ltr"),this.telInputEl.before(r),r}#W(t){let{allowDropdown:e,separateDialCode:i,showFlags:s}=this.#t;if(!e&&!s&&!i)return;this.#E=p("div",{class:`iti__country-container ${c.V_HIDE}`},t),e?(this.#e=p("button",{type:"button",class:"iti__selected-country",[h.EXPANDED]:"false",[h.LABEL]:this.#t.i18n.noCountrySelected,[h.HASPOPUP]:"dialog",[h.CONTROLS]:`iti-${this.#i}__dropdown-content`},this.#E),this.telInputEl.disabled&&this.#e.setAttribute("disabled","true")):this.#e=p("div",{class:"iti__selected-country"},this.#E);let o=p("div",{class:"iti__selected-country-primary"},this.#e);this.#u=p("div",{class:c.FLAG},o),e&&(this.#o=p("div",{class:"iti__arrow",[h.HIDDEN]:"true"},o)),i&&(this.#g=p("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:r}=this.#t,l=t?"":"iti--flexible-dropdown-width";if(this.#s=p("div",{id:`iti-${this.#i}__dropdown-content`,class:`iti__dropdown-content ${c.HIDE} ${l}`,role:"dialog",[h.MODAL]:"true"}),this.#A&&this.#s.setAttribute("dir","rtl"),i&&this.#q(),this.#n=p("ul",{class:"iti__country-list",id:`iti-${this.#i}__country-listbox`,role:"listbox",[h.LABEL]:s.countryListAriaLabel},this.#s),this.#Z(),i&&this.#$(),e||(this.#S=this.#et(),i&&(this.#s.style.height=`${this.#S}px`)),o){let a=q({iti:!0,"iti--container":!0,"iti--fullscreen-popup":e,"iti--inline-dropdown":!e,[r]:!!r});this.#r=p("div",{class:a}),this.#r.appendChild(this.#s)}else this.#E.appendChild(this.#s)}#q(){let{i18n:t,searchInputClass:e}=this.#t,i=p("div",{class:"iti__search-input-wrapper"},this.#s);this.#m=p("span",{class:"iti__search-icon",[h.HIDDEN]:"true"},i),this.#m.appendChild(yt()),this.#l=p("input",{id:`iti-${this.#i}__search-input`,type:"search",class:`iti__search-input ${e}`,placeholder:t.searchPlaceholder,role:"combobox",[h.EXPANDED]:"true",[h.LABEL]:t.searchPlaceholder,[h.CONTROLS]:`iti-${this.#i}__country-listbox`,[h.AUTOCOMPLETE]:"list",autocomplete:"off"},i),this.#c=p("button",{type:"button",class:`iti__search-clear ${c.HIDE}`,[h.LABEL]:t.clearSearchAriaLabel,tabindex:"-1"},i),this.#c.appendChild(gt(this.#i)),this.#k=p("span",{class:"iti__a11y-text"},this.#s),this.#T=p("div",{class:`iti__no-results ${c.HIDE}`,[h.HIDDEN]:"true"},this.#s),this.#T.textContent=t.searchEmptyState??null}#J(){this.#E&&(this.#B(),this.#E.classList.remove(c.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.#a=o:(this.#a=p("input",{type:"hidden",name:s.phone}),t.appendChild(this.#a))}if(s.country){let o=this.telInputEl.form?.querySelector(`input[name="${s.country}"]`);o?this.#h=o:(this.#h=p("input",{type:"hidden",name:s.country}),t.appendChild(this.#h))}}#Z(){let t=document.createDocumentFragment();for(let e=0;e<this.#b.length;e++){let i=this.#b[e],s=q({[c.COUNTRY_ITEM]:!0}),o=p("li",{id:`iti-${this.#i}__item-${i.iso2}`,class:s,tabindex:"-1",role:"option",[h.SELECTED]:"false"});o.dataset[T.DIAL_CODE]=i.dialCode,o.dataset[T.ISO2]=i.iso2,this.#_.set(i.iso2,o),this.#t.showFlags&&p("div",{class:`${c.FLAG} iti__${i.iso2}`},o);let r=p("span",{class:"iti__country-name"},o);r.textContent=`${i.name} `;let l=p("span",{class:"iti__dial-code"},r);this.#A&&l.setAttribute("dir","ltr"),l.textContent=`(+${i.dialCode})`,t.appendChild(o)}this.#n.appendChild(t)}#B(){if(this.#e){let t=this.#t.separateDialCode?L.FALLBACK_SELECTED_WITH_DIAL_WIDTH:L.FALLBACK_SELECTED_NO_DIAL_WIDTH,i=(this.#e.offsetWidth||this.#tt()||t)+L.INPUT_PADDING_EXTRA_LEFT;this.telInputEl.style.paddingLeft=`${i}px`}}static#F(){let t;try{t=window.top.document.body}catch{t=document.body}return t}#tt(){if(!this.telInputEl.parentNode)return 0;let t=n.#F(),e=this.telInputEl.parentNode.cloneNode(!1);e.style.visibility="hidden",t.appendChild(e);let i=this.#E.cloneNode();e.appendChild(i);let s=this.#e.cloneNode(!0);i.appendChild(s);let o=s.offsetWidth;return t.removeChild(e),o}#et(){let t=n.#F();this.#s.classList.remove(c.HIDE);let e=p("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(c.HIDE),i>0?i:L.FALLBACK_DROPDOWN_HEIGHT}#$(){let{i18n:t}=this.#t,e=this.#n.childElementCount;this.#k.textContent=t.searchSummaryAria(e)}#j(t){let e;if(t==="")e=this.#b;else{let i=H.toAscii(t);e=Lt(this.#b,this.#w,i)}this.#Y(e)}prefillSearchWithPlus(){this.#l.value="+",this.#l.focus(),this.#j("")}#P(){let t=this.#l.value.trim();this.#j(t),this.#l.value?this.#c.classList.remove(c.HIDE):this.#c.classList.add(c.HIDE)}#v(){this.#D&&clearTimeout(this.#D),this.#D=setTimeout(()=>{this.#P(),this.#D=null},et.SEARCH_DEBOUNCE_MS)}#d(){this.#l.value="",this.#l.focus(),this.#P()}#R(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)}#f(t,e=!0){if(this.#p?.classList.remove(c.HIGHLIGHT),t){if(t.classList.add(c.HIGHLIGHT),this.#t.countrySearch){let i=t.getAttribute("id")||"";this.#l.setAttribute(h.ACTIVE_DESCENDANT,i)}e&&this.#R(t),this.#p=t}else this.#p=null}bindHiddenInputSubmitListener(t,e,i){let s=this.telInputEl.form;!s||!this.#a&&!this.#h||s.addEventListener("submit",()=>{this.#a&&(this.#a.value=e()),this.#h&&(this.#h.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.#E.addEventListener("keydown",o=>{let r=[C.ARROW_UP,C.ARROW_DOWN,C.SPACE,C.ENTER];!this.isDropdownOpen()&&r.includes(o.key)&&(o.preventDefault(),o.stopPropagation(),e()),o.key===C.TAB&&i()},{signal:t})}openDropdown(t,e){let{countrySearch:i,dropdownAlwaysOpen:s,dropdownContainer:o}=this.#t;if(this.#O=new AbortController,this.ensureDropdownWidthSet(),o)this.#K();else{let l=this.#N(),a=this.telInputEl.offsetHeight+L.DROPDOWN_MARGIN;l?this.#s.style.top=`${a}px`:this.#s.style.bottom=`${a}px`}this.#s.classList.remove(c.HIDE),this.#e.setAttribute(h.EXPANDED,"true");let r=this.#C??this.#n.firstElementChild;r&&this.#f(r),i&&!s&&this.#l.focus(),this.#t.useFullscreenPopup&&this.#r&&window.visualViewport&&window.visualViewport.addEventListener("resize",()=>{this.#L(),this.#p&&this.#R(this.#p)},{signal:this.#O.signal}),this.#o.classList.add(c.ARROW_UP),this.#x(t,e)}#x(t,e){let i=this.#O.signal;this.#it(i),this.#V(i,t),this.#t.dropdownAlwaysOpen||this.#st(i,e),this.#I(i,t,e),this.#t.countrySearch&&this.#G(i),!this.#t.useFullscreenPopup&&this.#t.dropdownContainer&&window.addEventListener("scroll",e,{signal:i})}#it(t){this.#n.addEventListener("mouseover",e=>{let i=e.target?.closest(`.${c.COUNTRY_ITEM}`);i&&this.#f(i,!1)},{signal:t})}#V(t,e){this.#n.addEventListener("click",i=>{let s=i.target?.closest(`.${c.COUNTRY_ITEM}`);s&&e(s)},{signal:t})}#st(t,e){setTimeout(()=>{document.documentElement.addEventListener("click",i=>{this.#s.contains(i.target)||e()},{signal:t})},0)}#I(t,e,i){let s="",o=null,r=l=>{[C.ARROW_UP,C.ARROW_DOWN,C.ENTER,C.ESC].includes(l.key)&&(l.preventDefault(),l.stopPropagation(),l.key===C.ARROW_UP||l.key===C.ARROW_DOWN?this.#nt(l.key):l.key===C.ENTER&&!l.isComposing?e(this.#p):l.key===C.ESC&&(i(),this.#e.focus())),!this.#t.countrySearch&&l.target!==this.telInputEl&&A.HIDDEN_SEARCH_CHAR.test(l.key)&&(l.stopPropagation(),o&&clearTimeout(o),s+=l.key.toLowerCase(),this.#H(s),o=setTimeout(()=>{s=""},et.HIDDEN_SEARCH_RESET_MS))};document.addEventListener("keydown",r,{signal:t})}#G(t){this.#l.addEventListener("input",()=>this.#v(),{signal:t}),this.#c.addEventListener("click",()=>this.#d(),{signal:t})}#H(t){let e=At(this.#b,this.#w,t);if(e){let i=this.#_.get(e.iso2);this.#f(i)}}#nt(t){let e=t===C.ARROW_UP?this.#p?.previousElementSibling:this.#p?.nextElementSibling;!e&&this.#n.childElementCount>1&&(e=t===C.ARROW_UP?this.#n.lastElementChild:this.#n.firstElementChild),e&&this.#f(e)}#M(t){if(this.#C&&this.#C.dataset[T.ISO2]!==t&&(this.#C.setAttribute(h.SELECTED,"false"),this.#C.querySelector(".iti__country-check")?.remove(),this.#C=null),t&&!this.#C){let e=this.#n.querySelector(`[data-iso2="${t}"]`);e&&(e.setAttribute(h.SELECTED,"true"),p("span",{class:"iti__country-check",[h.HIDDEN]:"true"},e).appendChild(It()),this.#C=e,this.#t.dropdownAlwaysOpen&&this.#f(e))}}#Y(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.#f(s,!1),e=!1))}e?(this.#f(null),this.#T&&this.#T.classList.remove(c.HIDE)):this.#T&&this.#T.classList.add(c.HIDE),this.#n.scrollTop=0,this.#$()}closeDropdown(){let{countrySearch:t,dropdownContainer:e}=this.#t;this.#O.abort(),this.#O=null,this.#s.classList.add(c.HIDE),this.#e.setAttribute(h.EXPANDED,"false"),t&&(this.#l.removeAttribute(h.ACTIVE_DESCENDANT),this.#l.value="",this.#P(),this.#p&&(this.#p.classList.remove(c.HIGHLIGHT),this.#p=null)),this.#o.classList.remove(c.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="")}#N(){if(this.#t.dropdownAlwaysOpen)return!0;let t=this.telInputEl.getBoundingClientRect(),e=t.top,i=window.innerHeight-t.bottom;return i>=this.#S||i>=e}#K(){let{dropdownContainer:t,useFullscreenPopup:e}=this.#t;if(e){if(window.innerWidth>=L.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.#N()?this.#r.style.top=`${i.bottom+L.DROPDOWN_MARGIN}px`:(this.#r.style.top="unset",this.#r.style.bottom=`${window.innerHeight-i.top+L.DROPDOWN_MARGIN}px`)}t.appendChild(this.#r)}#L(){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(c.HIDE)}setLoading(t){this.#u.classList.toggle(c.LOADING,t)}isLoading(){return this.#u.classList.contains(c.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,r=t?.name,l=t?.dialCode,a=t?.iso2??"";if(e&&this.#M(a),this.#e){let f=a&&i?`${c.FLAG} iti__${a}`:`${c.FLAG} ${c.GLOBE}`,E,d,m=null;a?(d=r,E=o.selectedCountryAriaLabel.replace("${countryName}",r).replace("${dialCode}",`+${l}`),i||(m=ot())):(d=o.noCountrySelected,E=o.noCountrySelected,m=ot()),this.#u.className=f,this.#e.setAttribute("title",d),this.#e.setAttribute(h.LABEL,E),m?this.#u.replaceChildren(m):this.#u.replaceChildren()}if(s){let f=l?`+${l}`:"";this.#g.textContent=f,this.#B()}}destroy(){this.telInputEl.iti=void 0,delete this.telInputEl.dataset[T.INSTANCE_ID],this.telInputEl.style.paddingLeft=this.#y;let t=this.telInputEl.parentNode;t&&(t.before(this.telInputEl),t.remove()),this.#_.clear()}};var Tt=n=>{let{onlyCountries:t,excludeCountries:e}=n;return t?.length?R.filter(i=>t.includes(i.iso2)):e?.length?R.filter(i=>!e.includes(i.iso2)):[...R]},vt=(n,t)=>{let{countryNameLocale:e,countryNameOverrides: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())||""},Nt=n=>{let t=new Set,e=0,i={},s=(r,l)=>{if(!r||!l)return;l.length>e&&(e=l.length),Object.hasOwn(i,l)||(i[l]=[]);let a=i[l];a.includes(r)||a.push(r)},o=[...n].sort((r,l)=>r.priority-l.priority);for(let r of o){t.has(r.dialCode)||t.add(r.dialCode);for(let l=1;l<r.dialCode.length;l++){let a=r.dialCode.substring(0,l);s(r.iso2,a)}if(s(r.iso2,r.dialCode),r.areaCodes){let l=i[r.dialCode][0];for(let a of r.areaCodes){for(let f=1;f<a.length;f++){let E=a.substring(0,f),d=r.dialCode+E;s(l,d),s(r.iso2,d)}s(r.iso2,r.dialCode+a)}}}return{dialCodes:t,dialCodeMaxLength:e,dialCodeToIso2Map:i}},wt=(n,t)=>{let{countryOrder:e}=t;n.sort((i,s)=>{if(e){let o=e.indexOf(i.iso2),r=e.indexOf(s.iso2),l=o>-1,a=r>-1;if(l||a)return l&&a?o-r:l?-1:1}return i.name.localeCompare(s.name)})};var Yt=new Set(["800","808","870","881","882","883","888","979"]),rt=n=>{let t=N(n).slice(0,3);return n.startsWith("+")&&Yt.has(t)};var lt=(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)},Dt=(n,t,e,i,s)=>{let o=e?e.formatNumberAsYouType(n,i?.iso2):n,r=i?.dialCode;return s&&t.charAt(0)!=="+"&&o.includes(`+${r}`)?(o.split(`+${r}`)[1]||"").trim():o};var Ot=(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 Kt=new Set(["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"]),at=n=>{let t=N(n);if(t.startsWith(V.NANP)&&t.length>=4){let e=t.substring(1,4);return Kt.has(e)}return!1};var zt=0,U=n=>{if(!u.utils)throw new Error(`intlTelInput.utils is required for ${n}(). See: https://intl-tel-input.com/docs/utils`)},St=()=>{let n,t;return{promise:new Promise((i,s)=>{n=i,t=s}),resolve:n,reject:t}},W=class n{id;promise;#t;#i;#A;#y;#b;#w;#D;#S;#E;#e=null;#u=null;#g;#o=!0;#s;#m;#l=!1;#c;#n;constructor(t,e={}){this.id=zt++,k.validateInput(t);let i=mt(e);this.#i={...z,...i},Et(this.#i),Ct(this.#i),this.#t=new k(t,this.#i,this.id),this.#A=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),this.#m=new H(t.value),this.promise=this.#T(this.#i),this.#y=Tt(this.#i);let{dialCodes:s,dialCodeMaxLength:o,dialCodeToIso2Map:r}=Nt(this.#y);this.#D=s,this.#b=o,this.#w=r,this.#S=new Map(this.#y.map(l=>[l.iso2,l])),this.#k()}#a(){let t=this.#t.telInputEl.value.trim();return this.#m.normalise(t)}#h(t){this.#t.telInputEl.value=this.#m.denormalise(t)}#T(t){let{initialCountry:e,geoIpLookup:i,loadUtils:s}=t,o=e===F.AUTO&&!!i,r=!!s&&!u.utils;return o&&(this.#c=St()),r&&(this.#n=St()),Promise.all([this.#c?.promise,this.#n?.promise]).then(()=>{})}#k(){this.#s=new AbortController,this.#r(),this.#t.buildMarkup(this.#y,this.#E),this.#C(),this.#p(),this.#_(),this.#i.dropdownAlwaysOpen&&this.#R()}#r(){vt(this.#y,this.#i),wt(this.#y,this.#i),this.#E=bt(this.#y)}#C(t=!1){let e=this.#t.telInputEl.getAttribute("value"),i=this.#m.normalise(e??""),s=this.#a(),r=i&&i.startsWith("+")&&(!s||!s.startsWith("+"))?i:s,l=this.#N(r),a=at(r),{initialCountry:f,geoIpLookup:E}=this.#i,d=f===F.AUTO&&E,m=d&&u.autoCountry?u.autoCountry:f,v=d&&!t&&!u.autoCountry,b=D(m);l?a?b?this.#I(m):v||this.#I(ut.ISO2):(b&&this.#I(m),this.#x(r)):b?this.#I(m):v||this.#I(""),r&&this.#f(r)}#p(){this.#X(),this.#i.allowDropdown&&this.#t.bindAllInitialDropdownListeners(this.#s.signal,()=>this.#R(),()=>this.#M()),this.#t.bindHiddenInputSubmitListener(this.#s.signal,()=>this.getNumber(),()=>this.#e?.iso2||"")}#_(){if(this.#n){let{loadUtils:t}=this.#i,e=()=>{u.attachUtils(t).catch(()=>{})};u.documentReady()?e():window.addEventListener("load",e,{signal:this.#s.signal})}this.#c&&(this.#e?this.#c.resolve():this.#O())}async#O(){if(u.autoCountry){this.#rt();return}if(this.#t.setLoading(!0),!u.startedLoadingAutoCountry&&(u.startedLoadingAutoCountry=!0,typeof this.#i.geoIpLookup=="function"))try{let t=await this.#i.geoIpLookup(),e=typeof t=="string"?t.toLowerCase():"";if(!D(e)){n.forEachInstance("handleAutoCountryFailure");return}u.autoCountry=e,setTimeout(()=>n.forEachInstance("handleAutoCountryLoaded"))}catch{n.forEachInstance("handleAutoCountryFailure")}}#U(){this.#R(),this.#t.prefillSearchWithPlus()}#W(t){let e=this.#t.telInputEl.selectionStart||0,i=t.substring(0,e-1),s=t.substring(e);return this.#h(i+s),e-1}#X(){this.#B(),this.#tt(),this.#$()}#q(t){this.#W(t),this.#U()}#J(t,e){let i=this.#W(t);this.#t.telInputEl.setSelectionRange(i,i),this.#v(),this.#d(I.STRICT_REJECT,{source:"key",rejectedInput:e,reason:"invalid"})}#Q(t,e){let i=this.#t.telInputEl.selectionStart||0,o=t.substring(0,i).replace(A.NON_PLUS_NUMERIC_GLOBAL,"").length,r=this.#L(),l=Dt(r,t,u.utils,this.#e,this.#i.separateDialCode),a=Ot(o,l,i,e);this.#h(l),this.#t.telInputEl.setSelectionRange(a,a)}#Z(t){if(t.startsWith("+")&&this.#e&&this.#N(t)){let e=lt(t,!0,!0,this.#e);this.#h(e)}}#B(){this.#l=A.ALPHA_UNICODE.test(this.#a()),this.#t.telInputEl.addEventListener("input",this.#F,{signal:this.#s.signal})}#F=t=>{let{strictMode:e,formatAsYouType:i,separateDialCode:s,allowDropdown:o,countrySearch:r}=this.#i,l=t?.detail;if(l?.isCountryChange)return;let a=this.#a();if(this.#A&&t?.data==="+"&&s&&o&&r){this.#q(a);return}if(this.#A&&e&&(t?.data===" "||t?.data==="-"||t?.data===".")){this.#J(a,t.data);return}this.#x(a)&&this.#z();let f=t?.data&&A.NON_PLUS_NUMERIC.test(t.data),E=t?.inputType===tt.PASTE&&a;f||E&&!e?this.#l=!0:A.NON_PLUS_NUMERIC.test(a)||(this.#l=!1),i&&!this.#l&&!l?.isSetNumber&&this.#m.isAscii()&&this.#Q(a,t?.inputType===tt.DELETE_FORWARD),s&&this.#Z(a)};#tt(){let{strictMode:t,separateDialCode:e}=this.#i;!t&&!e||this.#t.telInputEl.addEventListener("keydown",this.#et,{signal:this.#s.signal})}#et=t=>{let{strictMode:e,separateDialCode:i,allowDropdown:s,countrySearch:o}=this.#i;if(!t.key||t.key.length!==1||t.altKey||t.ctrlKey||t.metaKey)return;if(i&&s&&o&&t.key==="+"){t.preventDefault(),this.#U();return}if(!e)return;let r=this.#a(),a=!r.startsWith("+")&&this.#t.telInputEl.selectionStart===0&&t.key==="+",f=this.#m.normalise(t.key),E=/^[0-9]$/.test(f),d=i?E:a||E,m=this.#t.telInputEl,v=m.selectionStart,b=m.selectionEnd,j=r.slice(0,v??void 0),O=r.slice(b??void 0),g=j+f+O,S=this.#K(g),B=!1;u.utils&&this.#u&&(B=u.utils.getCoreNumber(S,this.#e?.iso2).length>this.#u);let J=this.#V(S)!==null;(!d||B&&!J&&!a)&&(this.#v(),this.#d(I.STRICT_REJECT,{source:"key",rejectedInput:t.key,reason:d?"max-length":"invalid"}),t.preventDefault())};#$(){this.#i.strictMode&&this.#t.telInputEl.addEventListener("paste",this.#j,{signal:this.#s.signal})}#j=t=>{t.preventDefault();let e=this.#t.telInputEl,i=e.selectionStart,s=e.selectionEnd,o=this.#a(),r=o.slice(0,i??void 0),l=o.slice(s??void 0),a=this.#e?.iso2,f=t.clipboardData.getData("text"),E=this.#m.normalise(f),d=i===0&&s>0,m=!o.startsWith("+")||d,v=E.replace(A.NON_PLUS_NUMERIC_GLOBAL,""),b=v.startsWith("+"),j=v.replace(/\+/g,""),O=b&&m?`+${j}`:j,g=r+O+l,S=O!==E?"invalid":null;if(g.length>30){this.#v(),this.#d(I.STRICT_REJECT,{source:"paste",rejectedInput:f,reason:"max-length"});return}if(g.length>5&&u.utils){let _=u.utils.getCoreNumber(g,a);for(;_.length===0&&g.length>0;)g=g.slice(0,-1),_=u.utils.getCoreNumber(g,a);if(!_){this.#v(),this.#d(I.STRICT_REJECT,{source:"paste",rejectedInput:f,reason:"max-length"});return}if(this.#u&&_.length>this.#u)if(e.selectionEnd===o.length){let J=_.length-this.#u;g=g.slice(0,g.length-J),S="max-length"}else{this.#v(),this.#d(I.STRICT_REJECT,{source:"paste",rejectedInput:f,reason:"max-length"});return}}this.#h(g);let B=i+O.length;e.setSelectionRange(B,B),e.dispatchEvent(new InputEvent("input",{bubbles:!0})),S&&(E.length>0&&O.length===0&&this.#v(),this.#d(I.STRICT_REJECT,{source:"paste",rejectedInput:f,reason:S}))};#P(t){let e=Number(this.#t.telInputEl.getAttribute("maxlength"));return e&&t.length>e?t.substring(0,e):t}#v(){if(!this.#i.strictRejectAnimation)return;let t=this.#t.telInputEl.parentElement;t&&(t.classList.remove("iti__strict-reject-animation"),t.offsetWidth,t.classList.add("iti__strict-reject-animation"))}#d(t,e={}){let i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e});this.#t.telInputEl.dispatchEvent(i)}#R(){this.#t.openDropdown(t=>this.#nt(t),()=>this.#M()),this.#d(I.OPEN_COUNTRY_DROPDOWN)}#f(t){let{formatOnDisplay:e,nationalMode:i,separateDialCode:s}=this.#i,o=t;if(e&&u.utils&&this.#e){let r=rt(t),a=i&&!r||!o.startsWith("+")&&!s?x.NATIONAL:x.INTERNATIONAL;o=u.utils.formatNumber(o,this.#e?.iso2,a)}o=this.#ot(o),this.#h(o)}#x(t){let e=this.#V(t);return e!==null?this.#I(e):!1}#it(t){let e=this.#e?.dialCode,i=this.#e?.nationalPrefix;if(t.startsWith("+")||!e)return t;let r=i&&t.startsWith(i)&&!this.#i.separateDialCode?t.substring(1):t;return`+${e}${r}`}#V(t){let e=t.indexOf("+"),i=e>0?t.substring(e):t,s=this.#e?.iso2;i=this.#it(i);let o=this.#N(i,!0),r=N(i);if(o){let l=N(o),a=this.#w[l];return a.length===1?a[0]===s?null:a[0]:this.#st(a,l,r)}else if(i.startsWith("+")&&r.length){let l=this.#e?.dialCode||"";return l&&l.startsWith(r)?null:""}else if((!i||i==="+")&&!s&&this.#g)return this.#g;return null}#st(t,e,i){let s=this.#e?.iso2,o=this.#e?.dialCode;if(!s&&this.#g&&t.includes(this.#g))return this.#g;if(o===V.NANP&&at(i))return null;let l=this.#e?.areaCodes,a=this.#e?.priority;if(l){let v=l.map(b=>`${o}${b}`);for(let b of v)if(i.startsWith(b))return null}let E=l&&!(a===0)&&i.length>e.length,d=s&&t.includes(s)&&!E,m=s===t[0];return!d&&!m?t[0]:null}#I(t){let e=this.#e?.iso2||"";return this.#e=t?this.#S.get(t):null,this.#e&&(this.#g=this.#e.iso2),this.#t.setCountry(this.#e),this.#H(),this.#G(),e!==t}#G(){let{strictMode:t,placeholderNumberType:e,allowedNumberTypes:i}=this.#i;if(!t||!u.utils)return;let s=this.#e?.iso2;if(!s){this.#u=null;return}let o=u.utils.getExampleNumber(s,!1,e,!0),r=o;for(;u.utils.isPossibleNumber(o,s,i);)r=o,o+="0";let l=u.utils.getCoreNumber(r,s);this.#u=l.length,s==="by"&&(this.#u=l.length+1)}#H(){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 r=this.#e?u.utils.getExampleNumber(this.#e.iso2,i,e):"";r=this.#ot(r),typeof s=="function"&&(r=s(r,this.#e)),this.#t.telInputEl.setAttribute("placeholder",r)}#nt(t){if(!t)return;let e=t.dataset[T.ISO2],i=this.#I(e);this.#M();let s=t.dataset[T.DIAL_CODE];if(this.#Y(s),this.#i.formatOnDisplay){let o=this.#a();this.#f(o)}this.#t.telInputEl.focus(),i&&(this.#z(),this.#d(I.INPUT,{isCountryChange:!0}))}#M(t){!this.#t.isDropdownOpen()||this.#i.dropdownAlwaysOpen&&!t||(this.#t.closeDropdown(),this.#d(I.CLOSE_COUNTRY_DROPDOWN))}#Y(t){let e=this.#a();if(!e.startsWith("+"))return;let i=`+${t}`,s=this.#N(e),o;s?o=e.replace(s,i):o=i,this.#h(o)}#N(t,e){if(!t.startsWith("+"))return"";let i="",s="",o=!1;for(let r=0;r<t.length;r++){let l=t.charAt(r);if(!/[0-9]/.test(l))continue;if(s+=l,!!!this.#w[s])break;if(this.#D.has(s)){if(i=t.substring(0,r+1),o=!0,!e)break}else e&&o&&(i=t.substring(0,r+1));if(s.length===this.#b)break}return i}#K(t){let e=this.#e?.dialCode,i=N(t);return(this.#i.separateDialCode&&!t.startsWith("+")&&e&&i?`+${e}`:"")+t}#L(){let t=this.#a();return this.#K(t)}#ot(t){let e=!!this.#N(t),i=lt(t,e,this.#i.separateDialCode,this.#e);return this.#P(i)}#z(){this.#d(I.COUNTRY_CHANGE,this.#e??null)}#rt(){if(!(!this.#c||!u.autoCountry)){if(!this.#o){this.#c.resolve();return}this.#t.isLoading()?this.setCountry(u.autoCountry):this.#g=u.autoCountry,this.#t.setLoading(!1),this.#c.resolve()}}#at(){if(!this.#o){this.#c?.reject();return}this.#C(!0),this.#t.setLoading(!1),this.#c?.reject()}#ut(){if(!this.#o){this.#n?.resolve();return}if(!u.utils){this.#n?.resolve();return}let t=this.#a();t&&this.#f(t),this.#e&&(this.#H(),this.#G()),this.#n?.resolve()}#ct(t){if(!this.#o){this.#n?.reject(t);return}this.#n?.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?(U("getExtension"),u.utils.getExtension(this.#L(),this.#e?.iso2)):""}getNumber(t){if(!this.#o)return"";U("getNumber");let e=this.#e?.iso2,i=this.#L(),s=u.utils.formatNumber(i,e,t);return this.#m.denormalise(s)}getNumberType(){return this.#o?(U("getNumberType"),u.utils.getNumberType(this.#L(),this.#e?.iso2)):null}getSelectedCountryData(){return this.#e??null}getValidationError(){if(!this.#o)return null;U("getValidationError");let t=this.#e?.iso2;return u.utils.getValidationError(this.#L(),t)}isValidNumber(){if(!this.#o)return null;U("isValidNumber");let t=this.#e?.dialCode,e=this.#e?.iso2,i=this.#L(),s=u.utils.getCoreNumber(i,e);if(s){if(t===G.DIAL_CODE&&s[0]===G.MOBILE_PREFIX&&s.length!==G.MOBILE_CORE_LENGTH)return!1;if(!A.ALPHA_UNICODE.test(i)&&t){let r=i.startsWith("+")?i.slice(1+t.length):i,l=N(r).length;if(s.length>l)return!1}}return this.#lt("possible")}isValidNumberPrecise(){return this.#o?(U("isValidNumberPrecise"),this.#lt("precise")):null}#lt(t){let{allowNumberExtensions:e,allowPhonewords:i,allowedNumberTypes:s}=this.#i,o=this.#e?.iso2,r=this.#L();return!this.#e&&!rt(r)||!(t==="precise"?u.utils.isValidNumber:u.utils.isPossibleNumber)(r,o,s)?!1:A.ALPHA_UNICODE.test(r)?!!u.utils.getExtension(r,o)?e:i:!0}setCountry(t){if(!this.#o)return;let e=t?.toLowerCase();if(!D(e))throw new Error(`Invalid iso2 code: '${e}'`);let i=this.#e?.iso2;if(t&&e!==i||!t&&i){if(this.#I(e),this.#Y(this.#e?.dialCode||""),this.#i.formatOnDisplay){let o=this.#a();this.#f(o)}this.#z(),this.#d(I.INPUT,{isCountryChange:!0})}}setNumber(t){if(!this.#o)return;let e=this.#m.normalise(t),i=this.#x(e);this.#f(e),i&&this.#z(),this.#d(I.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.#ut();break;case"handleUtilsFailure":o.#ct(s);break;case"handleAutoCountryLoaded":o.#rt();break;case"handleAutoCountryFailure":o.#at();break}})}},Xt=async n=>{if(u.utils||u.startedLoadingUtils)return null;if(typeof n!="function")throw new TypeError(`The argument passed to attachUtils must be a function that returns a promise for the utils module, not ${typeof n}`);u.startedLoadingUtils=!0;try{let e=(await n())?.default;if(!e||typeof e!="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=e,W.forEachInstance("handleUtilsLoaded"),!0}catch(t){throw W.forEachInstance("handleUtilsFailure",t),t}},u=Object.assign((n,t)=>{let e=new W(n,t);return u.instances.set(String(e.id),e),n.iti=e,e},{defaults:z,documentReady:()=>document.readyState==="complete",getCountryData:()=>R,getInstance:n=>{let t=n.dataset[T.INSTANCE_ID];return t?u.instances.get(t)??null:null},instances:new Map,attachUtils:Xt,startedLoadingUtils:!1,startedLoadingAutoCountry:!1,version:"28.0.4",NUMBER_FORMAT:x,NUMBER_TYPE:w,VALIDATION_ERROR:Y}),qt=u;return Ht(Jt);})();
25
7
  var intlTelInput = _factory.default;