intl-tel-input
Version:
A JavaScript plugin for entering and validating international telephone numbers
16 lines (14 loc) • 299 kB
JavaScript
/*
* International Telephone Input v24.5.1
* https://github.com/jackocnr/intl-tel-input.git
* Licensed under the MIT license
*/
// UMD
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory();
} else {
window.intlTelInput = factory();
}
}(() => {
var factoryOutput=(()=>{var I1=Object.defineProperty;var D2=Object.getOwnPropertyDescriptor;var P2=Object.getOwnPropertyNames;var x2=Object.prototype.hasOwnProperty;var R2=(m,e)=>{for(var n in e)I1(m,n,{get:e[n],enumerable:!0})},O2=(m,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of P2(e))!x2.call(m,u)&&u!==n&&I1(m,u,{get:()=>e[u],enumerable:!(r=D2(e,u))||r.enumerable});return m};var k2=m=>O2(I1({},"__esModule",{value:!0}),m);var z2={};R2(z2,{default:()=>W2});var r2=[["af","93"],["ax","358",1,["18"]],["al","355"],["dz","213"],["as","1",5,["684"]],["ad","376"],["ao","244"],["ai","1",6,["264"]],["ag","1",7,["268"]],["ar","54"],["am","374"],["aw","297"],["ac","247"],["au","61",0],["at","43"],["az","994"],["bs","1",8,["242"]],["bh","973"],["bd","880"],["bb","1",9,["246"]],["by","375"],["be","32"],["bz","501"],["bj","229"],["bm","1",10,["441"]],["bt","975"],["bo","591"],["ba","387"],["bw","267"],["br","55"],["io","246"],["vg","1",11,["284"]],["bn","673"],["bg","359"],["bf","226"],["bi","257"],["kh","855"],["cm","237"],["ca","1",1,["204","226","236","249","250","263","289","306","343","354","365","367","368","382","387","403","416","418","428","431","437","438","450","584","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"]],["cv","238"],["bq","599",1,["3","4","7"]],["ky","1",12,["345"]],["cf","236"],["td","235"],["cl","56"],["cn","86"],["cx","61",2,["89164"]],["cc","61",1,["89162"]],["co","57"],["km","269"],["cg","242"],["cd","243"],["ck","682"],["cr","506"],["ci","225"],["hr","385"],["cu","53"],["cw","599",0],["cy","357"],["cz","420"],["dk","45"],["dj","253"],["dm","1",13,["767"]],["do","1",2,["809","829","849"]],["ec","593"],["eg","20"],["sv","503"],["gq","240"],["er","291"],["ee","372"],["sz","268"],["et","251"],["fk","500"],["fo","298"],["fj","679"],["fi","358",0],["fr","33"],["gf","594"],["pf","689"],["ga","241"],["gm","220"],["ge","995"],["de","49"],["gh","233"],["gi","350"],["gr","30"],["gl","299"],["gd","1",14,["473"]],["gp","590",0],["gu","1",15,["671"]],["gt","502"],["gg","44",1,["1481","7781","7839","7911"]],["gn","224"],["gw","245"],["gy","592"],["ht","509"],["hn","504"],["hk","852"],["hu","36"],["is","354"],["in","91"],["id","62"],["ir","98"],["iq","964"],["ie","353"],["im","44",2,["1624","74576","7524","7924","7624"]],["il","972"],["it","39",0],["jm","1",4,["876","658"]],["jp","81"],["je","44",3,["1534","7509","7700","7797","7829","7937"]],["jo","962"],["kz","7",1,["33","7"]],["ke","254"],["ki","686"],["xk","383"],["kw","965"],["kg","996"],["la","856"],["lv","371"],["lb","961"],["ls","266"],["lr","231"],["ly","218"],["li","423"],["lt","370"],["lu","352"],["mo","853"],["mg","261"],["mw","265"],["my","60"],["mv","960"],["ml","223"],["mt","356"],["mh","692"],["mq","596"],["mr","222"],["mu","230"],["yt","262",1,["269","639"]],["mx","52"],["fm","691"],["md","373"],["mc","377"],["mn","976"],["me","382"],["ms","1",16,["664"]],["ma","212",0],["mz","258"],["mm","95"],["na","264"],["nr","674"],["np","977"],["nl","31"],["nc","687"],["nz","64"],["ni","505"],["ne","227"],["ng","234"],["nu","683"],["nf","672"],["kp","850"],["mk","389"],["mp","1",17,["670"]],["no","47",0],["om","968"],["pk","92"],["pw","680"],["ps","970"],["pa","507"],["pg","675"],["py","595"],["pe","51"],["ph","63"],["pl","48"],["pt","351"],["pr","1",3,["787","939"]],["qa","974"],["re","262",0],["ro","40"],["ru","7",0],["rw","250"],["ws","685"],["sm","378"],["st","239"],["sa","966"],["sn","221"],["rs","381"],["sc","248"],["sl","232"],["sg","65"],["sx","1",21,["721"]],["sk","421"],["si","386"],["sb","677"],["so","252"],["za","27"],["kr","82"],["ss","211"],["es","34"],["lk","94"],["bl","590",1],["sh","290"],["kn","1",18,["869"]],["lc","1",19,["758"]],["mf","590",2],["pm","508"],["vc","1",20,["784"]],["sd","249"],["sr","597"],["sj","47",1,["79"]],["se","46"],["ch","41"],["sy","963"],["tw","886"],["tj","992"],["tz","255"],["th","66"],["tl","670"],["tg","228"],["tk","690"],["to","676"],["tt","1",22,["868"]],["tn","216"],["tr","90"],["tm","993"],["tc","1",23,["649"]],["tv","688"],["ug","256"],["ua","380"],["ae","971"],["gb","44",0],["us","1",0],["uy","598"],["vi","1",24,["340"]],["uz","998"],["vu","678"],["va","39",1,["06698"]],["ve","58"],["vn","84"],["wf","681"],["eh","212",1,["5288","5289"]],["ye","967"],["zm","260"],["zw","263"]],o2=[];for(let m=0;m<r2.length;m++){let e=r2[m];o2[m]={name:"",iso2:e[0],dialCode:e[1],priority:e[2]||0,areaCodes:e[3]||null,nodeById:{}}}var K=o2;var B2={ad:"Andorra",ae:"United Arab Emirates",af:"Afghanistan",ag:"Antigua & Barbuda",ai:"Anguilla",al:"Albania",am:"Armenia",ao:"Angola",ar:"Argentina",as:"American Samoa",at:"Austria",au:"Australia",aw:"Aruba",ax:"\xC5land Islands",az:"Azerbaijan",ba:"Bosnia & Herzegovina",bb:"Barbados",bd:"Bangladesh",be:"Belgium",bf:"Burkina Faso",bg:"Bulgaria",bh:"Bahrain",bi:"Burundi",bj:"Benin",bl:"St. Barth\xE9lemy",bm:"Bermuda",bn:"Brunei",bo:"Bolivia",bq:"Caribbean Netherlands",br:"Brazil",bs:"Bahamas",bt:"Bhutan",bw:"Botswana",by:"Belarus",bz:"Belize",ca:"Canada",cc:"Cocos (Keeling) Islands",cd:"Congo - Kinshasa",cf:"Central African Republic",cg:"Congo - Brazzaville",ch:"Switzerland",ci:"C\xF4te d\u2019Ivoire",ck:"Cook Islands",cl:"Chile",cm:"Cameroon",cn:"China",co:"Colombia",cr:"Costa Rica",cu:"Cuba",cv:"Cape Verde",cw:"Cura\xE7ao",cx:"Christmas Island",cy:"Cyprus",cz:"Czechia",de:"Germany",dj:"Djibouti",dk:"Denmark",dm:"Dominica",do:"Dominican Republic",dz:"Algeria",ec:"Ecuador",ee:"Estonia",eg:"Egypt",eh:"Western Sahara",er:"Eritrea",es:"Spain",et:"Ethiopia",fi:"Finland",fj:"Fiji",fk:"Falkland Islands",fm:"Micronesia",fo:"Faroe Islands",fr:"France",ga:"Gabon",gb:"United Kingdom",gd:"Grenada",ge:"Georgia",gf:"French Guiana",gg:"Guernsey",gh:"Ghana",gi:"Gibraltar",gl:"Greenland",gm:"Gambia",gn:"Guinea",gp:"Guadeloupe",gq:"Equatorial Guinea",gr:"Greece",gt:"Guatemala",gu:"Guam",gw:"Guinea-Bissau",gy:"Guyana",hk:"Hong Kong SAR China",hn:"Honduras",hr:"Croatia",ht:"Haiti",hu:"Hungary",id:"Indonesia",ie:"Ireland",il:"Israel",im:"Isle of Man",in:"India",io:"British Indian Ocean Territory",iq:"Iraq",ir:"Iran",is:"Iceland",it:"Italy",je:"Jersey",jm:"Jamaica",jo:"Jordan",jp:"Japan",ke:"Kenya",kg:"Kyrgyzstan",kh:"Cambodia",ki:"Kiribati",km:"Comoros",kn:"St. Kitts & Nevis",kp:"North Korea",kr:"South Korea",kw:"Kuwait",ky:"Cayman Islands",kz:"Kazakhstan",la:"Laos",lb:"Lebanon",lc:"St. Lucia",li:"Liechtenstein",lk:"Sri Lanka",lr:"Liberia",ls:"Lesotho",lt:"Lithuania",lu:"Luxembourg",lv:"Latvia",ly:"Libya",ma:"Morocco",mc:"Monaco",md:"Moldova",me:"Montenegro",mf:"St. Martin",mg:"Madagascar",mh:"Marshall Islands",mk:"North Macedonia",ml:"Mali",mm:"Myanmar (Burma)",mn:"Mongolia",mo:"Macao SAR China",mp:"Northern Mariana Islands",mq:"Martinique",mr:"Mauritania",ms:"Montserrat",mt:"Malta",mu:"Mauritius",mv:"Maldives",mw:"Malawi",mx:"Mexico",my:"Malaysia",mz:"Mozambique",na:"Namibia",nc:"New Caledonia",ne:"Niger",nf:"Norfolk Island",ng:"Nigeria",ni:"Nicaragua",nl:"Netherlands",no:"Norway",np:"Nepal",nr:"Nauru",nu:"Niue",nz:"New Zealand",om:"Oman",pa:"Panama",pe:"Peru",pf:"French Polynesia",pg:"Papua New Guinea",ph:"Philippines",pk:"Pakistan",pl:"Poland",pm:"St. Pierre & Miquelon",pr:"Puerto Rico",ps:"Palestinian Territories",pt:"Portugal",pw:"Palau",py:"Paraguay",qa:"Qatar",re:"R\xE9union",ro:"Romania",rs:"Serbia",ru:"Russia",rw:"Rwanda",sa:"Saudi Arabia",sb:"Solomon Islands",sc:"Seychelles",sd:"Sudan",se:"Sweden",sg:"Singapore",sh:"St. Helena",si:"Slovenia",sj:"Svalbard & Jan Mayen",sk:"Slovakia",sl:"Sierra Leone",sm:"San Marino",sn:"Senegal",so:"Somalia",sr:"Suriname",ss:"South Sudan",st:"S\xE3o Tom\xE9 & Pr\xEDncipe",sv:"El Salvador",sx:"Sint Maarten",sy:"Syria",sz:"Eswatini",tc:"Turks & Caicos Islands",td:"Chad",tg:"Togo",th:"Thailand",tj:"Tajikistan",tk:"Tokelau",tl:"Timor-Leste",tm:"Turkmenistan",tn:"Tunisia",to:"Tonga",tr:"Turkey",tt:"Trinidad & Tobago",tv:"Tuvalu",tw:"Taiwan",tz:"Tanzania",ua:"Ukraine",ug:"Uganda",us:"United States",uy:"Uruguay",uz:"Uzbekistan",va:"Vatican City",vc:"St. Vincent & Grenadines",ve:"Venezuela",vg:"British Virgin Islands",vi:"U.S. Virgin Islands",vn:"Vietnam",vu:"Vanuatu",wf:"Wallis & Futuna",ws:"Samoa",ye:"Yemen",yt:"Mayotte",za:"South Africa",zm:"Zambia",zw:"Zimbabwe"},s2=B2;var G2={selectedCountryAriaLabel:"Selected country",noCountrySelected:"No country selected",countryListAriaLabel:"List of countries",searchPlaceholder:"Search",zeroSearchResults:"No results found",oneSearchResult:"1 result found",multipleSearchResults:"${count} results found",ac:"Ascension Island",xk:"Kosovo"},u2=G2;var H2={...s2,...u2},_1=H2;for(let m=0;m<K.length;m++)K[m].name=_1[K[m].iso2];var F2=0,h2={allowDropdown:!0,autoPlaceholder:"polite",containerClass:"",countryOrder:null,countrySearch:!0,customPlaceholder:null,dropdownContainer:null,excludeCountries:[],fixDropdownWidth:!0,formatAsYouType:!0,formatOnDisplay:!0,geoIpLookup:null,hiddenInput:null,i18n:{},initialCountry:"",nationalMode:!0,onlyCountries:[],placeholderNumberType:"MOBILE",showFlags:!0,separateDialCode:!1,strictMode:!1,useFullscreenPopup:typeof navigator<"u"&&typeof window<"u"?/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=500:!1,utilsScript:"",validationNumberType:"MOBILE"},U2=["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"],c1=m=>m.replace(/\D/g,""),a2=(m="")=>m.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase(),l2=m=>{let e=c1(m);if(e.charAt(0)==="1"){let n=e.substr(1,3);return U2.indexOf(n)!==-1}return!1},K2=(m,e,n,r)=>{if(n===0&&!r)return 0;let u=0;for(let l=0;l<e.length;l++){if(/[+0-9]/.test(e[l])&&u++,u===m&&!r)return l+1;if(r&&u===m+1)return l}return e.length},L=(m,e,n)=>{let r=document.createElement(m);return e&&Object.entries(e).forEach(([u,l])=>r.setAttribute(u,l)),n&&n.appendChild(r),r},$1=m=>{let{instances:e}=g;Object.values(e).forEach(n=>n[m]())},b1=class{constructor(e,n={}){this.id=F2++,this.telInput=e,this.highlightedItem=null,this.options=Object.assign({},h2,n),this.hadInitialPlaceholder=!!e.getAttribute("placeholder")}_init(){this.options.useFullscreenPopup&&(this.options.fixDropdownWidth=!1),this.options.onlyCountries.length===1&&(this.options.initialCountry=this.options.onlyCountries[0]),this.options.separateDialCode&&(this.options.nationalMode=!1),this.options.allowDropdown&&!this.options.showFlags&&!this.options.separateDialCode&&(this.options.nationalMode=!1),this.options.useFullscreenPopup&&!this.options.dropdownContainer&&(this.options.dropdownContainer=document.body),this.isAndroid=typeof navigator<"u"?/Android/i.test(navigator.userAgent):!1,this.isRTL=!!this.telInput.closest("[dir=rtl]");let e=this.options.allowDropdown||this.options.separateDialCode;this.showSelectedCountryOnLeft=this.isRTL?!e:e,this.options.separateDialCode&&(this.isRTL?this.originalPaddingRight=this.telInput.style.paddingRight:this.originalPaddingLeft=this.telInput.style.paddingLeft),this.options.i18n={..._1,...this.options.i18n};let n=new Promise((u,l)=>{this.resolveAutoCountryPromise=u,this.rejectAutoCountryPromise=l}),r=new Promise((u,l)=>{this.resolveUtilsScriptPromise=u,this.rejectUtilsScriptPromise=l});this.promise=Promise.all([n,r]),this.selectedCountryData={},this._processCountryData(),this._generateMarkup(),this._setInitialState(),this._initListeners(),this._initRequests()}_processCountryData(){this._processAllCountries(),this._processDialCodes(),this._translateCountryNames(),this._sortCountries()}_sortCountries(){this.options.countryOrder&&(this.options.countryOrder=this.options.countryOrder.map(e=>e.toLowerCase())),this.countries.sort((e,n)=>{let{countryOrder:r}=this.options;if(r){let u=r.indexOf(e.iso2),l=r.indexOf(n.iso2),p=u>-1,y=l>-1;if(p||y)return p&&y?u-l:p?-1:1}return e.name.localeCompare(n.name)})}_addToDialCodeMap(e,n,r){n.length>this.dialCodeMaxLen&&(this.dialCodeMaxLen=n.length),this.dialCodeToIso2Map.hasOwnProperty(n)||(this.dialCodeToIso2Map[n]=[]);for(let l=0;l<this.dialCodeToIso2Map[n].length;l++)if(this.dialCodeToIso2Map[n][l]===e)return;let u=r!==void 0?r:this.dialCodeToIso2Map[n].length;this.dialCodeToIso2Map[n][u]=e}_processAllCountries(){let{onlyCountries:e,excludeCountries:n}=this.options;if(e.length){let r=e.map(u=>u.toLowerCase());this.countries=K.filter(u=>r.indexOf(u.iso2)>-1)}else if(n.length){let r=n.map(u=>u.toLowerCase());this.countries=K.filter(u=>r.indexOf(u.iso2)===-1)}else this.countries=K}_translateCountryNames(){for(let e=0;e<this.countries.length;e++){let n=this.countries[e].iso2.toLowerCase();this.options.i18n.hasOwnProperty(n)&&(this.countries[e].name=this.options.i18n[n])}}_processDialCodes(){this.dialCodes={},this.dialCodeMaxLen=0,this.dialCodeToIso2Map={};for(let e=0;e<this.countries.length;e++){let n=this.countries[e];this.dialCodes[n.dialCode]||(this.dialCodes[n.dialCode]=!0),this._addToDialCodeMap(n.iso2,n.dialCode,n.priority)}for(let e=0;e<this.countries.length;e++){let n=this.countries[e];if(n.areaCodes){let r=this.dialCodeToIso2Map[n.dialCode][0];for(let u=0;u<n.areaCodes.length;u++){let l=n.areaCodes[u];for(let p=1;p<l.length;p++){let y=n.dialCode+l.substr(0,p);this._addToDialCodeMap(r,y),this._addToDialCodeMap(n.iso2,y)}this._addToDialCodeMap(n.iso2,n.dialCode+l)}}}}_generateMarkup(){this.telInput.classList.add("iti__tel-input"),!this.telInput.hasAttribute("autocomplete")&&!(this.telInput.form&&this.telInput.form.hasAttribute("autocomplete"))&&this.telInput.setAttribute("autocomplete","off");let{allowDropdown:e,separateDialCode:n,showFlags:r,containerClass:u,hiddenInput:l,dropdownContainer:p,fixDropdownWidth:y,useFullscreenPopup:C,countrySearch:S,i18n:b}=this.options,I="iti";e&&(I+=" iti--allow-dropdown"),r&&(I+=" iti--show-flags"),u&&(I+=` ${u}`),C||(I+=" iti--inline-dropdown");let w=L("div",{class:I});if(this.telInput.parentNode?.insertBefore(w,this.telInput),e||r||n){this.countryContainer=L("div",{class:"iti__country-container"},w),this.showSelectedCountryOnLeft?this.countryContainer.style.left="0px":this.countryContainer.style.right="0px",e?(this.selectedCountry=L("button",{type:"button",class:"iti__selected-country","aria-expanded":"false","aria-label":this.options.i18n.selectedCountryAriaLabel,"aria-haspopup":"true","aria-controls":`iti-${this.id}__dropdown-content`,role:"combobox"},this.countryContainer),this.telInput.disabled&&this.selectedCountry.setAttribute("disabled","true")):this.selectedCountry=L("div",{class:"iti__selected-country"},this.countryContainer);let O=L("div",{class:"iti__selected-country-primary"},this.selectedCountry);if(this.selectedCountryInner=L("div",{class:"iti__flag"},O),this.selectedCountryA11yText=L("span",{class:"iti__a11y-text"},this.selectedCountryInner),e&&(this.dropdownArrow=L("div",{class:"iti__arrow","aria-hidden":"true"},O)),n&&(this.selectedDialCode=L("div",{class:"iti__selected-dial-code"},this.selectedCountry)),e){let M=y?"":"iti--flexible-dropdown-width";if(this.dropdownContent=L("div",{id:`iti-${this.id}__dropdown-content`,class:`iti__dropdown-content iti__hide ${M}`}),S&&(this.searchInput=L("input",{type:"text",class:"iti__search-input",placeholder:b.searchPlaceholder,role:"combobox","aria-expanded":"true","aria-label":b.searchPlaceholder,"aria-controls":`iti-${this.id}__country-listbox`,"aria-autocomplete":"list",autocomplete:"off"},this.dropdownContent),this.searchResultsA11yText=L("span",{class:"iti__a11y-text"},this.dropdownContent)),this.countryList=L("ul",{class:"iti__country-list",id:`iti-${this.id}__country-listbox`,role:"listbox","aria-label":b.countryListAriaLabel},this.dropdownContent),this._appendListItems(),S&&this._updateSearchResultsText(),p){let k="iti iti--container";C?k+=" iti--fullscreen-popup":k+=" iti--inline-dropdown",this.dropdown=L("div",{class:k}),this.dropdown.appendChild(this.dropdownContent)}else this.countryContainer.appendChild(this.dropdownContent)}}if(w.appendChild(this.telInput),this._updateInputPadding(),l){let O=this.telInput.getAttribute("name")||"",M=l(O);M.phone&&(this.hiddenInput=L("input",{type:"hidden",name:M.phone}),w.appendChild(this.hiddenInput)),M.country&&(this.hiddenInputCountry=L("input",{type:"hidden",name:M.country}),w.appendChild(this.hiddenInputCountry))}}_appendListItems(){for(let e=0;e<this.countries.length;e++){let n=this.countries[e],r=e===0?"iti__highlight":"",u=L("li",{id:`iti-${this.id}__item-${n.iso2}`,class:`iti__country ${r}`,tabindex:"-1",role:"option","data-dial-code":n.dialCode,"data-country-code":n.iso2,"aria-selected":"false"},this.countryList);n.nodeById[this.id]=u;let l="";this.options.showFlags&&(l+=`<div class='iti__flag iti__${n.iso2}'></div>`),l+=`<span class='iti__country-name'>${n.name}</span>`,l+=`<span class='iti__dial-code'>+${n.dialCode}</span>`,u.insertAdjacentHTML("beforeend",l)}}_setInitialState(e=!1){let n=this.telInput.getAttribute("value"),r=this.telInput.value,l=n&&n.charAt(0)==="+"&&(!r||r.charAt(0)!=="+")?n:r,p=this._getDialCode(l),y=l2(l),{initialCountry:C,geoIpLookup:S}=this.options,b=C==="auto"&&S;if(p&&!y)this._updateCountryFromNumber(l);else if(!b||e){let I=C?C.toLowerCase():"";I&&this._getCountryData(I,!0)?this._setCountry(I):p&&y?this._setCountry("us"):this._setCountry()}l&&this._updateValFromNumber(l)}_initListeners(){this._initTelInputListeners(),this.options.allowDropdown&&this._initDropdownListeners(),(this.hiddenInput||this.hiddenInputCountry)&&this.telInput.form&&this._initHiddenInputListener()}_initHiddenInputListener(){this._handleHiddenInputSubmit=()=>{this.hiddenInput&&(this.hiddenInput.value=this.getNumber()),this.hiddenInputCountry&&(this.hiddenInputCountry.value=this.getSelectedCountryData().iso2||"")},this.telInput.form?.addEventListener("submit",this._handleHiddenInputSubmit)}_initDropdownListeners(){this._handleLabelClick=n=>{this.dropdownContent.classList.contains("iti__hide")?this.telInput.focus():n.preventDefault()};let e=this.telInput.closest("label");e&&e.addEventListener("click",this._handleLabelClick),this._handleClickSelectedCountry=()=>{this.dropdownContent.classList.contains("iti__hide")&&!this.telInput.disabled&&!this.telInput.readOnly&&this._openDropdown()},this.selectedCountry.addEventListener("click",this._handleClickSelectedCountry),this._handleCountryContainerKeydown=n=>{this.dropdownContent.classList.contains("iti__hide")&&["ArrowUp","ArrowDown"," ","Enter"].includes(n.key)&&(n.preventDefault(),n.stopPropagation(),this._openDropdown()),n.key==="Tab"&&this._closeDropdown()},this.countryContainer.addEventListener("keydown",this._handleCountryContainerKeydown)}_initRequests(){let{utilsScript:e,initialCountry:n,geoIpLookup:r}=this.options;e&&!g.utils?g.documentReady()?g.loadUtils(e):window.addEventListener("load",()=>{g.loadUtils(e)}):this.resolveUtilsScriptPromise(),n==="auto"&&r&&!this.selectedCountryData.iso2?this._loadAutoCountry():this.resolveAutoCountryPromise()}_loadAutoCountry(){g.autoCountry?this.handleAutoCountry():g.startedLoadingAutoCountry||(g.startedLoadingAutoCountry=!0,typeof this.options.geoIpLookup=="function"&&this.options.geoIpLookup((e="")=>{let n=e.toLowerCase();n&&this._getCountryData(n,!0)?(g.autoCountry=n,setTimeout(()=>$1("handleAutoCountry"))):(this._setInitialState(!0),$1("rejectAutoCountryPromise"))},()=>{this._setInitialState(!0),$1("rejectAutoCountryPromise")}))}_openDropdownWithPlus(){this._openDropdown(),this.searchInput.value="+",this._filterCountries("",!0)}_initTelInputListeners(){let{strictMode:e,formatAsYouType:n,separateDialCode:r,formatOnDisplay:u,allowDropdown:l,countrySearch:p}=this.options,y=!1;/\p{L}/u.test(this.telInput.value)&&(y=!0),this._handleInputEvent=C=>{if(this.isAndroid&&C?.data==="+"&&r&&l&&p){let w=this.telInput.selectionStart||0,O=this.telInput.value.substring(0,w-1),M=this.telInput.value.substring(w);this.telInput.value=O+M,this._openDropdownWithPlus();return}this._updateCountryFromNumber(this.telInput.value)&&this._triggerCountryChange();let S=C?.data&&/[^+0-9]/.test(C.data),b=C?.inputType==="insertFromPaste"&&this.telInput.value;S||b&&!e?y=!0:/[^+0-9]/.test(this.telInput.value)||(y=!1);let I=C?.detail&&C.detail.isSetNumber&&!u;if(n&&!y&&!I){let w=this.telInput.selectionStart||0,M=this.telInput.value.substring(0,w).replace(/[^+0-9]/g,"").length,k=C?.inputType==="deleteContentForward",z=this._formatNumberAsYouType(),Z=K2(M,z,w,k);this.telInput.value=z,this.telInput.setSelectionRange(Z,Z)}},this.telInput.addEventListener("input",this._handleInputEvent),(e||r)&&(this._handleKeydownEvent=C=>{if(C.key&&C.key.length===1&&!C.altKey&&!C.ctrlKey&&!C.metaKey){if(r&&l&&p&&C.key==="+"){C.preventDefault(),this._openDropdownWithPlus();return}if(e){let S=this.telInput.value,I=!(S.charAt(0)==="+")&&this.telInput.selectionStart===0&&C.key==="+",w=/^[0-9]$/.test(C.key),O=r?w:I||w,M=this._getFullNumber(),k=g.utils.getCoreNumber(M,this.selectedCountryData.iso2),z=this.maxCoreNumberLength&&k.length>=this.maxCoreNumberLength,Z=S.substring(this.telInput.selectionStart,this.telInput.selectionEnd),p1=/\d/.test(Z),f1=I?!0:this._isChangingDialCode(C.key);(!O||z&&!p1&&!f1)&&C.preventDefault()}}},this.telInput.addEventListener("keydown",this._handleKeydownEvent))}_isChangingDialCode(e){let n=this.telInput.value;if(n.charAt(0)==="+"){let r=this.selectedCountryData.iso2,u=n.slice(0,this.telInput.selectionStart)+e+n.slice(this.telInput.selectionEnd),l=this._getFullNumber(u);return this._getCountryFromNumber(l)!==r}return!1}_cap(e){let n=parseInt(this.telInput.getAttribute("maxlength")||"",10);return n&&e.length>n?e.substr(0,n):e}_trigger(e,n={}){let r=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});this.telInput.dispatchEvent(r)}_openDropdown(){let{fixDropdownWidth:e,countrySearch:n}=this.options;if(e&&(this.dropdownContent.style.width=`${this.telInput.offsetWidth}px`),this.dropdownContent.classList.remove("iti__hide"),this.selectedCountry.setAttribute("aria-expanded","true"),this._setDropdownPosition(),n){let r=this.countryList.firstElementChild;r&&(this._highlightListItem(r,!1),this.countryList.scrollTop=0),this.searchInput.focus()}this._bindDropdownListeners(),this.dropdownArrow.classList.add("iti__arrow--up"),this._trigger("open:countrydropdown")}_setDropdownPosition(){if(this.options.dropdownContainer&&this.options.dropdownContainer.appendChild(this.dropdown),!this.options.useFullscreenPopup){let e=this.telInput.getBoundingClientRect(),n=this.telInput.offsetHeight;this.options.dropdownContainer&&(this.dropdown.style.top=`${e.top+n}px`,this.dropdown.style.left=`${e.left}px`,this._handleWindowScroll=()=>this._closeDropdown(),window.addEventListener("scroll",this._handleWindowScroll))}}_bindDropdownListeners(){this._handleMouseoverCountryList=u=>{let l=u.target?.closest(".iti__country");l&&this._highlightListItem(l,!1)},this.countryList.addEventListener("mouseover",this._handleMouseoverCountryList),this._handleClickCountryList=u=>{let l=u.target?.closest(".iti__country");l&&this._selectListItem(l)},this.countryList.addEventListener("click",this._handleClickCountryList);let e=!0;this._handleClickOffToClose=()=>{e||this._closeDropdown(),e=!1},document.documentElement.addEventListener("click",this._handleClickOffToClose);let n="",r=null;if(this._handleKeydownOnDropdown=u=>{["ArrowUp","ArrowDown","Enter","Escape"].includes(u.key)&&(u.preventDefault(),u.stopPropagation(),u.key==="ArrowUp"||u.key==="ArrowDown"?this._handleUpDownKey(u.key):u.key==="Enter"?this._handleEnterKey():u.key==="Escape"&&this._closeDropdown()),!this.options.countrySearch&&/^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(u.key)&&(u.stopPropagation(),r&&clearTimeout(r),n+=u.key.toLowerCase(),this._searchForCountry(n),r=setTimeout(()=>{n=""},1e3))},document.addEventListener("keydown",this._handleKeydownOnDropdown),this.options.countrySearch){let u=()=>{let p=this.searchInput.value.trim();p?this._filterCountries(p):this._filterCountries("",!0)},l=null;this._handleSearchChange=()=>{l&&clearTimeout(l),l=setTimeout(()=>{u(),l=null},100)},this.searchInput.addEventListener("input",this._handleSearchChange),this.searchInput.addEventListener("click",p=>p.stopPropagation())}}_searchForCountry(e){for(let n=0;n<this.countries.length;n++){let r=this.countries[n];if(r.name.substr(0,e.length).toLowerCase()===e){let l=r.nodeById[this.id];this._highlightListItem(l,!1),this._scrollTo(l);break}}}_filterCountries(e,n=!1){let r=!0;this.countryList.innerHTML="";let u=a2(e);for(let l=0;l<this.countries.length;l++){let p=this.countries[l],y=a2(p.name),C=p.name.split(/[^a-zA-ZÀ-ÿа-яА-Я]/).map(b=>b[0]).join("").toLowerCase(),S=`+${p.dialCode}`;if(n||y.includes(u)||S.includes(u)||p.iso2.includes(u)||C.includes(u)){let b=p.nodeById[this.id];b&&this.countryList.appendChild(b),r&&(this._highlightListItem(b,!1),r=!1)}}r&&this._highlightListItem(null,!1),this.countryList.scrollTop=0,this._updateSearchResultsText()}_updateSearchResultsText(){let{i18n:e}=this.options,n=this.countryList.childElementCount,r;n===0?r=e.zeroSearchResults:n===1?r=e.oneSearchResult:r=e.multipleSearchResults.replace("${count}",n.toString()),this.searchResultsA11yText.textContent=r}_handleUpDownKey(e){let n=e==="ArrowUp"?this.highlightedItem?.previousElementSibling:this.highlightedItem?.nextElementSibling;!n&&this.countryList.childElementCount>1&&(n=e==="ArrowUp"?this.countryList.lastElementChild:this.countryList.firstElementChild),n&&(this._scrollTo(n),this._highlightListItem(n,!1))}_handleEnterKey(){this.highlightedItem&&this._selectListItem(this.highlightedItem)}_updateValFromNumber(e){let n=e;if(this.options.formatOnDisplay&&g.utils&&this.selectedCountryData){let r=this.options.nationalMode||n.charAt(0)!=="+"&&!this.options.separateDialCode,{NATIONAL:u,INTERNATIONAL:l}=g.utils.numberFormat,p=r?u:l;n=g.utils.formatNumber(n,this.selectedCountryData.iso2,p)}n=this._beforeSetNumber(n),this.telInput.value=n}_updateCountryFromNumber(e){let n=this._getCountryFromNumber(e);return n!==null?this._setCountry(n):!1}_getCountryFromNumber(e){let n=e.indexOf("+"),r=n?e.substring(n):e,u=this.selectedCountryData.dialCode;r&&u==="1"&&r.charAt(0)!=="+"&&(r.charAt(0)!=="1"&&(r=`1${r}`),r=`+${r}`),this.options.separateDialCode&&u&&r.charAt(0)!=="+"&&(r=`+${u}${r}`);let p=this._getDialCode(r,!0),y=c1(r);if(p){let C=this.dialCodeToIso2Map[c1(p)],S=C.indexOf(this.selectedCountryData.iso2)!==-1&&y.length<=p.length-1;if(!(u==="1"&&l2(y))&&!S){for(let I=0;I<C.length;I++)if(C[I])return C[I]}}else{if(r.charAt(0)==="+"&&y.length)return"";if((!r||r==="+")&&!this.selectedCountryData.iso2)return this.defaultCountry}return null}_highlightListItem(e,n){let r=this.highlightedItem;if(r&&(r.classList.remove("iti__highlight"),r.setAttribute("aria-selected","false")),this.highlightedItem=e,this.highlightedItem){this.highlightedItem.classList.add("iti__highlight"),this.highlightedItem.setAttribute("aria-selected","true");let u=this.highlightedItem.getAttribute("id")||"";this.selectedCountry.setAttribute("aria-activedescendant",u),this.options.countrySearch&&this.searchInput.setAttribute("aria-activedescendant",u)}n&&this.highlightedItem.focus()}_getCountryData(e,n){for(let r=0;r<this.countries.length;r++)if(this.countries[r].iso2===e)return this.countries[r];if(n)return null;throw new Error(`No country data for '${e}'`)}_setCountry(e){let{separateDialCode:n,showFlags:r,i18n:u}=this.options,l=this.selectedCountryData.iso2?this.selectedCountryData:{};if(this.selectedCountryData=e?this._getCountryData(e,!1)||{}:{},this.selectedCountryData.iso2&&(this.defaultCountry=this.selectedCountryData.iso2),this.selectedCountryInner){let p="",y="";e&&r?(p=`iti__flag iti__${e}`,y=`${this.selectedCountryData.name} +${this.selectedCountryData.dialCode}`):(p="iti__flag iti__globe",y=u.noCountrySelected),this.selectedCountryInner.className=p,this.selectedCountryA11yText.textContent=y}if(this._setSelectedCountryTitleAttribute(e,n),n){let p=this.selectedCountryData.dialCode?`+${this.selectedCountryData.dialCode}`:"";this.selectedDialCode.innerHTML=p,this._updateInputPadding()}return this._updatePlaceholder(),this._updateMaxLength(),l.iso2!==e}_updateInputPadding(){if(this.selectedCountry){let n=(this.selectedCountry.offsetWidth||this._getHiddenSelectedCountryWidth())+6;this.showSelectedCountryOnLeft?this.telInput.style.paddingLeft=`${n}px`:this.telInput.style.paddingRight=`${n}px`}}_updateMaxLength(){let{strictMode:e,placeholderNumberType:n,validationNumberType:r}=this.options;if(e&&g.utils)if(this.selectedCountryData.iso2){let u=g.utils.numberType[n],l=g.utils.getExampleNumber(this.selectedCountryData.iso2,!1,u,!0),p=l;for(;g.utils.isPossibleNumber(l,this.selectedCountryData.iso2,r);)p=l,l+="0";let y=g.utils.getCoreNumber(p,this.selectedCountryData.iso2);this.maxCoreNumberLength=y.length}else this.maxCoreNumberLength=null}_setSelectedCountryTitleAttribute(e=null,n){if(!this.selectedCountry)return;let r;e&&!n?r=`${this.selectedCountryData.name}: +${this.selectedCountryData.dialCode}`:e?r=this.selectedCountryData.name:r="Unknown",this.selectedCountry.setAttribute("title",r)}_getHiddenSelectedCountryWidth(){if(this.telInput.parentNode){let e=this.telInput.parentNode.cloneNode(!1);e.style.visibility="hidden",document.body.appendChild(e);let n=this.countryContainer.cloneNode();e.appendChild(n);let r=this.selectedCountry.cloneNode(!0);n.appendChild(r);let u=r.offsetWidth;return document.body.removeChild(e),u}return 0}_updatePlaceholder(){let{autoPlaceholder:e,placeholderNumberType:n,nationalMode:r,customPlaceholder:u}=this.options,l=e==="aggressive"||!this.hadInitialPlaceholder&&e==="polite";if(g.utils&&l){let p=g.utils.numberType[n],y=this.selectedCountryData.iso2?g.utils.getExampleNumber(this.selectedCountryData.iso2,r,p):"";y=this._beforeSetNumber(y),typeof u=="function"&&(y=u(y,this.selectedCountryData)),this.telInput.setAttribute("placeholder",y)}}_selectListItem(e){let n=this._setCountry(e.getAttribute("data-country-code"));this._closeDropdown(),this._updateDialCode(e.getAttribute("data-dial-code")),this.telInput.focus(),n&&this._triggerCountryChange()}_closeDropdown(){this.dropdownContent.classList.add("iti__hide"),this.selectedCountry.setAttribute("aria-expanded","false"),this.selectedCountry.removeAttribute("aria-activedescendant"),this.highlightedItem&&this.highlightedItem.setAttribute("aria-selected","false"),this.options.countrySearch&&this.searchInput.removeAttribute("aria-activedescendant"),this.dropdownArrow.classList.remove("iti__arrow--up"),document.removeEventListener("keydown",this._handleKeydownOnDropdown),this.options.countrySearch&&this.searchInput.removeEventListener("input",this._handleSearchChange),document.documentElement.removeEventListener("click",this._handleClickOffToClose),this.countryList.removeEventListener("mouseover",this._handleMouseoverCountryList),this.countryList.removeEventListener("click",this._handleClickCountryList),this.options.dropdownContainer&&(this.options.useFullscreenPopup||window.removeEventListener("scroll",this._handleWindowScroll),this.dropdown.parentNode&&this.dropdown.parentNode.removeChild(this.dropdown)),this._trigger("close:countrydropdown")}_scrollTo(e){let n=this.countryList,r=document.documentElement.scrollTop,u=n.offsetHeight,l=n.getBoundingClientRect().top+r,p=l+u,y=e.offsetHeight,C=e.getBoundingClientRect().top+r,S=C+y,b=C-l+n.scrollTop;if(C<l)n.scrollTop=b;else if(S>p){let I=u-y;n.scrollTop=b-I}}_updateDialCode(e){let n=this.telInput.value,r=`+${e}`,u;if(n.charAt(0)==="+"){let l=this._getDialCode(n);l?u=n.replace(l,r):u=r,this.telInput.value=u}}_getDialCode(e,n){let r="";if(e.charAt(0)==="+"){let u="";for(let l=0;l<e.length;l++){let p=e.charAt(l);if(!isNaN(parseInt(p,10))){if(u+=p,n)this.dialCodeToIso2Map[u]&&(r=e.substr(0,l+1));else if(this.dialCodes[u]){r=e.substr(0,l+1);break}if(u.length===this.dialCodeMaxLen)break}}}return r}_getFullNumber(e){let n=e||this.telInput.value.trim(),{dialCode:r}=this.selectedCountryData,u,l=c1(n);return this.options.separateDialCode&&n.charAt(0)!=="+"&&r&&l?u=`+${r}`:u="",u+n}_beforeSetNumber(e){let n=e;if(this.options.separateDialCode){let r=this._getDialCode(n);if(r){r=`+${this.selectedCountryData.dialCode}`;let u=n[r.length]===" "||n[r.length]==="-"?r.length+1:r.length;n=n.substr(u)}}return this._cap(n)}_triggerCountryChange(){this._trigger("countrychange")}_formatNumberAsYouType(){let e=this._getFullNumber(),n=g.utils?g.utils.formatNumberAsYouType(e,this.selectedCountryData.iso2):e,{dialCode:r}=this.selectedCountryData;return this.options.separateDialCode&&this.telInput.value.charAt(0)!=="+"&&n.includes(`+${r}`)?(n.split(`+${r}`)[1]||"").trim():n}handleAutoCountry(){this.options.initialCountry==="auto"&&g.autoCountry&&(this.defaultCountry=g.autoCountry,this.selectedCountryData.iso2||this.selectedCountryInner.classList.contains("iti__globe")||this.setCountry(this.defaultCountry),this.resolveAutoCountryPromise())}handleUtils(){g.utils&&(this.telInput.value&&this._updateValFromNumber(this.telInput.value),this.selectedCountryData.iso2&&(this._updatePlaceholder(),this._updateMaxLength())),this.resolveUtilsScriptPromise()}destroy(){let{allowDropdown:e,separateDialCode:n}=this.options;if(e){this._closeDropdown(),this.selectedCountry.removeEventListener("click",this._handleClickSelectedCountry),this.countryContainer.removeEventListener("keydown",this._handleCountryContainerKeydown);let l=this.telInput.closest("label");l&&l.removeEventListener("click",this._handleLabelClick)}let{form:r}=this.telInput;this._handleHiddenInputSubmit&&r&&r.removeEventListener("submit",this._handleHiddenInputSubmit),this.telInput.removeEventListener("input",this._handleInputEvent),this._handleKeydownEvent&&this.telInput.removeEventListener("keydown",this._handleKeydownEvent),this.telInput.removeAttribute("data-intl-tel-input-id"),n&&(this.isRTL?this.telInput.style.paddingRight=this.originalPaddingRight:this.telInput.style.paddingLeft=this.originalPaddingLeft);let u=this.telInput.parentNode;u?.parentNode?.insertBefore(this.telInput,u),u?.parentNode?.removeChild(u),delete g.instances[this.id]}getExtension(){return g.utils?g.utils.getExtension(this._getFullNumber(),this.selectedCountryData.iso2):""}getNumber(e){if(g.utils){let{iso2:n}=this.selectedCountryData;return g.utils.formatNumber(this._getFullNumber(),n,e)}return""}getNumberType(){return g.utils?g.utils.getNumberType(this._getFullNumber(),this.selectedCountryData.iso2):-99}getSelectedCountryData(){return this.selectedCountryData}getValidationError(){if(g.utils){let{iso2:e}=this.selectedCountryData;return g.utils.getValidationError(this._getFullNumber(),e)}return-99}isValidNumber(){if(!this.selectedCountryData.iso2)return!1;let e=this._getFullNumber(),n=e.search(/\p{L}/u);if(n>-1){let r=e.substring(0,n),u=this._utilsIsPossibleNumber(r),l=this._utilsIsPossibleNumber(e);return u&&l}return this._utilsIsPossibleNumber(e)}_utilsIsPossibleNumber(e){return g.utils?g.utils.isPossibleNumber(e,this.selectedCountryData.iso2,this.options.validationNumberType):null}isValidNumberPrecise(){if(!this.selectedCountryData.iso2)return!1;let e=this._getFullNumber(),n=e.search(/\p{L}/u);if(n>-1){let r=e.substring(0,n),u=this._utilsIsValidNumber(r),l=this._utilsIsValidNumber(e);return u&&l}return this._utilsIsValidNumber(e)}_utilsIsValidNumber(e){return g.utils?g.utils.isValidNumber(e,this.selectedCountryData.iso2):null}setCountry(e){let n=e?.toLowerCase(),r=this.selectedCountryData.iso2;(e&&n!==r||!e&&r)&&(this._setCountry(n),this._updateDialCode(this.selectedCountryData.dialCode),this._triggerCountryChange())}setNumber(e){let n=this._updateCountryFromNumber(e);this._updateValFromNumber(e),n&&this._triggerCountryChange(),this._trigger("input",{isSetNumber:!0})}setPlaceholderNumberType(e){this.options.placeholderNumberType=e,this._updatePlaceholder()}setDisabled(e){this.telInput.disabled=e,e?this.selectedCountry.setAttribute("disabled","true"):this.selectedCountry.removeAttribute("disabled")}},V2=m=>!g.utils&&!g.startedLoadingUtilsScript?(g.startedLoadingUtilsScript=!0,new Promise((e,n)=>{import_INTENTIONALLY_BROKEN(/* webpackIgnore: true */ m).then(({default:r})=>{g.utils=r,$1("handleUtils"),e(!0)}).catch(()=>{$1("rejectUtilsScriptPromise"),n()})})):null,g=Object.assign((m,e)=>{let n=new b1(m,e);return n._init(),m.setAttribute("data-intl-tel-input-id",n.id.toString()),g.instances[n.id]=n,n},{defaults:h2,documentReady:()=>document.readyState==="complete",getCountryData:()=>K,getInstance:m=>{let e=m.getAttribute("data-intl-tel-input-id");return e?g.instances[e]:null},instances:{},loadUtils:V2,version:"24.5.1"}),S1=g;(function(){var m=this||self;function e(d,t){d=d.split(".");var $=m;d[0]in $||typeof $.execScript>"u"||$.execScript("var "+d[0]);for(var i;d.length&&(i=d.shift());)d.length||t===void 0?$[i]&&$[i]!==Object.prototype[i]?$=$[i]:$=$[i]={}:$[i]=t}function n(d,t){function $(){}$.prototype=t.prototype,d.ma=t.prototype,d.prototype=new $,d.prototype.constructor=d,d.sa=function(i,o,s){for(var a=Array(arguments.length-2),h=2;h<arguments.length;h++)a[h-2]=arguments[h];return t.prototype[o].apply(i,a)}}function r(d){let t=[],$=0;for(let i in d)t[$++]=d[i];return t}var u=class{constructor(d){if(l!==l)throw Error("SafeUrl is not meant to be built directly");this.g=d}toString(){return this.g.toString()}},l={};new u("about:invalid#zClosurez"),new u("about:blank");let p={};class y{constructor(){if(p!==p)throw Error("SafeStyle is not meant to be built directly")}toString(){return""}}new y;let C={};class S{constructor(){if(C!==C)throw Error("SafeStyleSheet is not meant to be built directly")}toString(){return""}}new S;let b={};class I{constructor(){var t=m.trustedTypes&&m.trustedTypes.emptyHTML||"";if(b!==b)throw Error("SafeHtml is not meant to be built directly");this.g=t}toString(){return this.g.toString()}}new I;function w(d,t){switch(this.g=d,this.l=!!t.aa,this.h=t.i,this.s=t.type,this.o=!1,this.h){case k:case z:case Z:case p1:case f1:case M:case O:this.o=!0}this.j=t.defaultValue}var O=1,M=2,k=3,z=4,Z=6,p1=16,f1=18;function p2(d,t){for(this.h=d,this.g={},d=0;d<t.length;d++){var $=t[d];this.g[$.g]=$}}function f2(d){return d=r(d.g),d.sort(function(t,$){return t.g-$.g}),d}function D(){this.h={},this.j=this.m().g,this.g=this.l=null}D.prototype.has=function(d){return P(this,d.g)},D.prototype.get=function(d,t){return c(this,d.g,t)},D.prototype.set=function(d,t){E(this,d.g,t)},D.prototype.add=function(d,t){T1(this,d.g,t)};function w1(d,t){for(var $=f2(d.m()),i=0;i<$.length;i++){var o=$[i],s=o.g;if(P(t,s)){d.g&&delete d.g[o.g];var a=o.h==11||o.h==10;if(o.l){o=A(t,s);for(var h=0;h<o.length;h++)T1(d,s,a?o[h].clone():o[h])}else o=n1(t,s),a?(a=n1(d,s))?w1(a,o):E(d,s,o.clone()):E(d,s,o)}}}D.prototype.clone=function(){var d=new this.constructor;return d!=this&&(d.h={},d.g&&(d.g={}),w1(d,this)),d};function P(d,t){return d.h[t]!=null}function n1(d,t){var $=d.h[t];if($==null)return null;if(d.l){if(!(t in d.g)){var i=d.l,o=d.j[t];if($!=null)if(o.l){for(var s=[],a=0;a<$.length;a++)s[a]=i.h(o,$[a]);$=s}else $=i.h(o,$);return d.g[t]=$}return d.g[t]}return $}function c(d,t,$){var i=n1(d,t);return d.j[t].l?i[$||0]:i}function v(d,t){if(P(d,t))d=c(d,t);else d:{if(d=d.j[t],d.j===void 0)if(t=d.s,t===Boolean)d.j=!1;else if(t===Number)d.j=0;else if(t===String)d.j=d.o?"0":"";else{d=new t;break d}d=d.j}return d}function A(d,t){return n1(d,t)||[]}function H(d,t){return d.j[t].l?P(d,t)?d.h[t].length:0:P(d,t)?1:0}function E(d,t,$){d.h[t]=$,d.g&&(d.g[t]=$)}function T1(d,t,$){d.h[t]||(d.h[t]=[]),d.h[t].push($),d.g&&delete d.g[t]}function i1(d,t){var $=[],i;for(i in t)i!=0&&$.push(new w(i,t[i]));return new p2(d,$)}function r1(){}r1.prototype.g=function(d){throw new d.h,Error("Unimplemented")},r1.prototype.h=function(d,t){if(d.h==11||d.h==10)return t instanceof D?t:this.g(d.s.prototype.m(),t);if(d.h==14)return typeof t=="string"&&L1.test(t)&&(d=Number(t),0<d)?d:t;if(!d.o)return t;if(d=d.s,d===String){if(typeof t=="number")return String(t)}else if(d===Number&&typeof t=="string"&&(t==="Infinity"||t==="-Infinity"||t==="NaN"||L1.test(t)))return Number(t);return t};var L1=/^-?[0-9]+$/;function g1(){}n(g1,r1),g1.prototype.g=function(d,t){return d=new d.h,d.l=this,d.h=t,d.g={},d};function q(){}n(q,g1),q.prototype.h=function(d,t){return d.h==8?!!t:r1.prototype.h.apply(this,arguments)},q.prototype.g=function(d,t){return q.ma.g.call(this,d,t)};function T(d,t){d!=null&&this.g.apply(this,arguments)}T.prototype.h="",T.prototype.set=function(d){this.h=""+d},T.prototype.g=function(d,t,$){if(this.h+=String(d),t!=null)for(let i=1;i<arguments.length;i++)this.h+=arguments[i];return this};function x(d){d.h=""}T.prototype.toString=function(){return this.h};function V(){D.call(this)}n(V,D);var E1=null;function _(){D.call(this)}n(_,D);var N1=null;function j(){D.call(this)}n(j,D);var A1=null;V.prototype.m=function(){var d=E1;return d||(E1=d=i1(V,{0:{name:"NumberFormat",ia:"i18n.phonenumbers.NumberFormat"},1:{name:"pattern",required:!0,i:9,type:String},2:{name:"format",required:!0,i:9,type:String},3:{name:"leading_digits_pattern",aa:!0,i:9,type:String},4:{name:"national_prefix_formatting_rule",i:9,type:String},6:{name:"national_prefix_optional_when_formatting",i:8,defaultValue:!1,type:Boolean},5:{name:"domestic_carrier_code_formatting_rule",i:9,type:String}})),d},V.m=V.prototype.m,_.prototype.m=function(){var d=N1;return d||(N1=d=i1(_,{0:{name:"PhoneNumberDesc",ia:"i18n.phonenumbers.PhoneNumberDesc"},2:{name:"national_number_pattern",i:9,type:String},9:{name:"possible_length",aa:!0,i:5,type:Number},10:{name:"possible_length_local_only",aa:!0,i:5,type:Number},6:{name:"example_number",i:9,type:String}})),d},_.m=_.prototype.m,j.prototype.m=function(){var d=A1;return d||(A1=d=i1(j,{0:{name:"PhoneMetadata",ia:"i18n.phonenumbers.PhoneMetadata"},1:{name:"general_desc",i:11,type:_},2:{name:"fixed_line",i:11,type:_},3:{name:"mobile",i:11,type:_},4:{name:"toll_free",i:11,type:_},5:{name:"premium_rate",i:11,type:_},6:{name:"shared_cost",i:11,type:_},7:{name:"personal_number",i:11,type:_},8:{name:"voip",i:11,type:_},21:{name:"pager",i:11,type:_},25:{name:"uan",i:11,type:_},27:{name:"emergency",i:11,type:_},28:{name:"voicemail",i:11,type:_},29:{name:"short_code",i:11,type:_},30:{name:"standard_rate",i:11,type:_},31:{name:"carrier_specific",i:11,type:_},33:{name:"sms_services",i:11,type:_},24:{name:"no_international_dialling",i:11,type:_},9:{name:"id",required:!0,i:9,type:String},10:{name:"country_code",i:5,type:Number},11:{name:"international_prefix",i:9,type:String},17:{name:"preferred_international_prefix",i:9,type:String},12:{name:"national_prefix",i:9,type:String},13:{name:"preferred_extn_prefix",i:9,type:String},15:{name:"national_prefix_for_parsing",i:9,type:String},16:{name:"national_prefix_transform_rule",i:9,type:String},18:{name:"same_mobile_and_fixed_line_pattern",i:8,defaultValue:!1,type:Boolean},19:{name:"number_format",aa:!0,i:11,type:V},20:{name:"intl_number_format",aa:!0,i:11,type:V},22:{name:"main_country_for_code",i:8,defaultValue:!1,type:Boolean},23:{name:"leading_digits",i:9,type:String}})),d},j.m=j.prototype.m;function F(){D.call(this)}n(F,D);var M1=null,g2={ra:0,qa:1,pa:5,oa:10,na:20};F.prototype.m=function(){var d=M1;return d||(M1=d=i1(F,{0:{name:"PhoneNumber",ia:"i18n.phonenumbers.PhoneNumber"},1:{name:"country_code",required:!0,i:5,type:Number},2:{name:"national_number",required:!0,i:4,type:Number},3:{name:"extension",i:9,type:String},4:{name:"italian_leading_zero",i:8,type:Boolean},8:{name:"number_of_leading_zeros",i:5,defaultValue:1,type:Number},5:{name:"raw_input",i:9,type:String},6:{name:"country_code_source",i:14,defaultValue:0,type:g2},7:{name:"preferred_domestic_carrier_code",i:9,type:String}})),d},F.ctor=F,F.ctor.m=F.prototype.m;var X={1:"US AG AI AS BB BM BS CA DM DO GD GU JM KN KY LC MP MS PR SX TC TT VC VG VI".split(" "),7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],800:["001"],808:["001"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],870:["001"],878:["001"],880:["BD"],881:["001"],882:["001"],883:["001"],886:["TW"],888:["001"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],979:["001"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},D1={AC:[,[,,"(?:[01589]\\d|[46])\\d{4}",,,,,,,[5,6]],[,,"6[2-467]\\d{3}",,,,"62889",,,[5]],[,,"4\\d{4}",,,,"40123",,,[5]],[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],"AC",247,"00",,,,,,,,,,[,,,,,,,,,[-1]],,,[,,,,,,,,,[-1]],[,,"(?:0[1-9]|[1589]\\d)\\d{4}",,,,"542011",,,[6]],,,[,,,,,,,,,[-1]]],AD:[,[,,"(?:1|6\\d)\\d{7}|[135-9]\\d{5}",,,,,,,[6,8,9]],[,,"[78]\\d{5}",,,,"712345",,,[6]],[,,"690\\d{6}|[356]\\d{5}",,,,"312345",,,[6,9]],[,,"180[02]\\d{4}",,,,"18001234",,,[8]],[,,"[19]\\d{5}",,,,"912345",,,[6]],[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],"AD",376,"00",,,,,,,,[[,"(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],[,"(\\d{4})(\\d{4})","$1 $2",["1"]],[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],,[,,,,,,,,,[-1]],,,[,,"1800\\d{4}",,,,,,,[8]],[,,,,,,,,,[-1]],,,[,,,,,,,,,[-1]]],AE:[,[,,"(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",,,,,,,[5,6,7,8,9,10,11,12]],[,,"[2-4679][2-8]\\d{6}",,,,"22345678",,,[8],[7]],[,,"5[024-68]\\d{7}",,,,"501234567",,,[9]],[,,"400\\d{6}|800\\d{2,9}",,,,"800123456"],[,,"900[02]\\d{5}",,,,"900234567",,,[9]],[,,"700[05]\\d{5}",,,,"700012345",,,[9]],[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],"AE",971,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],[,"(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],[,"(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],,[,,,,,,,,,[-1]],,,[,,,,,,,,,[-1]],[,,"600[25]\\d{5}",,,,"600212345",,,[9]],,,[,,,,,,,,,[-1]]],AF:[,[,,"[2-7]\\d{8}",,,,,,,[9],[7]],[,,"(?:[25][0-8]|[34][0-4]|6[0-5])[2-9]\\d{6}",,,,"234567890",,,,[7]],[,,"7\\d{8}",,,,"701234567",,,,[7]],[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],"AF",93,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{4})","$1 $2",["[1-9]"]],[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],[[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],[,,,,,,,,,[-1]],,,[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],,,[,,,,,,,,,[-1]]],AG:[,[,,"(?:268|[58]\\d\\d|900)\\d{7}",,,,,,,[10],[7]],[,,"268(?:4(?:6[0-38]|84)|56[0-2])\\d{4}",,,,"2684601234",,,,[7]],[,,"268(?:464|7(?:1[3-9]|[28]\\d|3[0246]|64|7[0-689]))\\d{4}",,,,"2684641234",,,,[7]],[,,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",,,,"8002123456"],[,,"900[2-9]\\d{6}",,,,"9002123456"],[,,,,,,,,,[-1]],[,,"52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}",,,,"5002345678"],[,,"26848[01]\\d{4}",,,,"2684801234",,,,[7]],"AG",1,"011","1",,,"([457]\\d{6})$|1","268$1",,,,,[,,"26840[69]\\d{4}",,,,"2684061234",,,,[7]],,"268",[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],,,[,,,,,,,,,[-1]]],AI:[,[,,"(?:264|[58]\\d\\d|900)\\d{7}",,,,,,,[10],[7]],[,,"264(?:292|4(?:6[12]|9[78]))\\d{4}",,,,"2644612345",,,,[7]],[,,"264(?:235|4(?:69|76)|5(?:3[6-9]|8[1-4])|7(?:29|72))\\d{4}",,,,"2642351234",,,,[7]],[,,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",,,,"8002123456"],[,,"900[2-9]\\d{6}",,,,"9002123456"],[,,,,,,,,,[-1]],[,,"52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}",,,,"5002345678"],[,,,,,,,,,[-1]],"AI",1,"011","1",,,"([2457]\\d{6})$|1","264$1",,,,,[,,"264724\\d{4}",,,,"2647241234",,,,[7]],,"264",[,,,,,,,,,[-1]],[,,,,,,,,,[-1]],,,[,,,,,,,,,[-1]]],AL:[,[,,"(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",,,,,,,[6,7,8,9],[5]],[,,"4505[0-2]\\d{3}|(?:[2358][16-9]\\d[2-9]|4410)\\d