(function(factory){if(typeof module==='object'&&module.exports){module.exports=factory()}else{window.intlTelInput=factory()}}(()=>{var factoryOutput=(()=>{var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all) __defProp(target,name,{get:all[name],enumerable:!0})};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from==="object"||typeof from==="function"){for(let key of __getOwnPropNames(from)) if(!__hasOwnProp.call(to,key)&&key!==except) __defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})} return to};var __toCommonJS=(mod)=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var intl_tel_input_exports={};__export(intl_tel_input_exports,{Iti:()=>Iti,default:()=>intl_tel_input_default});var rawCountryData=[["af","93"],["ax","358",1],["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,null,"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"],"0"],["cc","61",1,["89162"],"0"],["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"],"0"],["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"],"0"],["il","972"],["it","39",0],["jm","1",4,["876","658"]],["jp","81"],["je","44",3,["1534","7509","7700","7797","7829","7937"],"0"],["jo","962"],["kz","7",1,["33","7"],"8"],["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"],"0"],["mx","52"],["fm","691"],["md","373"],["mc","377"],["mn","976"],["me","382"],["ms","1",16,["664"]],["ma","212",0,null,"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,null,"0"],["ro","40"],["ru","7",0,null,"8"],["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,null,"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"],"0"],["ye","967"],["zm","260"],["zw","263"]];var allCountries=[];for(let i=0;is.replace(/\D/g,"");var normaliseString=(s="")=>s.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase();var isRegionlessNanp=(number)=>{const numeric=getNumeric(number);if(numeric.charAt(0)==="1"){const areaCode=numeric.substr(1,3);return regionlessNanpNumbers.includes(areaCode)} return!1};var translateCursorPosition=(relevantChars,formattedValue,prevCaretPos,isDeleteForwards)=>{if(prevCaretPos===0&&!isDeleteForwards){return 0} let count=0;for(let i=0;i{const el=document.createElement(name);if(attrs){Object.entries(attrs).forEach(([key,value])=>el.setAttribute(key,value))} if(container){container.appendChild(el)} return el};var forEachInstance=(method,...args)=>{const{instances}=intlTelInput;Object.values(instances).forEach((instance)=>instance[method](...args))};var Iti=class{constructor(input,customOptions={}){this.id=id++;this.telInput=input;this.highlightedItem=null;this.options=Object.assign({},defaults,customOptions);this.hadInitialPlaceholder=Boolean(input.getAttribute("placeholder"))} _init(){if(this.options.useFullscreenPopup){this.options.fixDropdownWidth=!1} if(this.options.onlyCountries.length===1){this.options.initialCountry=this.options.onlyCountries[0]} if(this.options.separateDialCode){this.options.nationalMode=!1} if(this.options.allowDropdown&&!this.options.showFlags&&!this.options.separateDialCode){this.options.nationalMode=!1} if(this.options.useFullscreenPopup&&!this.options.dropdownContainer){this.options.dropdownContainer=document.body} this.isAndroid=typeof navigator!=="undefined"?/Android/i.test(navigator.userAgent):!1;this.isRTL=!!this.telInput.closest("[dir=rtl]");const showOnDefaultSide=this.options.allowDropdown||this.options.separateDialCode;this.showSelectedCountryOnLeft=this.isRTL?!showOnDefaultSide:showOnDefaultSide;if(this.options.separateDialCode){if(this.isRTL){this.originalPaddingRight=this.telInput.style.paddingRight}else{this.originalPaddingLeft=this.telInput.style.paddingLeft}} this.options.i18n={...en_default,...this.options.i18n};const autoCountryPromise=new Promise((resolve,reject)=>{this.resolveAutoCountryPromise=resolve;this.rejectAutoCountryPromise=reject});const utilsScriptPromise=new Promise((resolve,reject)=>{this.resolveUtilsScriptPromise=resolve;this.rejectUtilsScriptPromise=reject});this.promise=Promise.all([autoCountryPromise,utilsScriptPromise]);this.selectedCountryData={};this._processCountryData();this._generateMarkup();this._setInitialState();this._initListeners();this._initRequests()} _processCountryData(){this._processAllCountries();this._processDialCodes();this._translateCountryNames();this._sortCountries()} _sortCountries(){if(this.options.countryOrder){this.options.countryOrder=this.options.countryOrder.map((country)=>country.toLowerCase())} this.countries.sort((a,b)=>{const{countryOrder}=this.options;if(countryOrder){const aIndex=countryOrder.indexOf(a.iso2);const bIndex=countryOrder.indexOf(b.iso2);const aIndexExists=aIndex>-1;const bIndexExists=bIndex>-1;if(aIndexExists||bIndexExists){if(aIndexExists&&bIndexExists){return aIndex-bIndex} return aIndexExists?-1:1}} return a.name.localeCompare(b.name)})} _addToDialCodeMap(iso2,dialCode,priority){if(dialCode.length>this.dialCodeMaxLen){this.dialCodeMaxLen=dialCode.length} if(!this.dialCodeToIso2Map.hasOwnProperty(dialCode)){this.dialCodeToIso2Map[dialCode]=[]} for(let i=0;icountry.toLowerCase());this.countries=data_default.filter((country)=>lowerCaseOnlyCountries.includes(country.iso2))}else if(excludeCountries.length){const lowerCaseExcludeCountries=excludeCountries.map((country)=>country.toLowerCase());this.countries=data_default.filter((country)=>!lowerCaseExcludeCountries.includes(country.iso2))}else{this.countries=data_default}} _translateCountryNames(){for(let i=0;i`} content+=`${c.name}`;content+=`+${c.dialCode}`;listItem.insertAdjacentHTML("beforeend",content)}} _setInitialState(overrideAutoCountry=!1){const attributeValue=this.telInput.getAttribute("value");const inputValue=this.telInput.value;const useAttribute=attributeValue&&attributeValue.charAt(0)==="+"&&(!inputValue||inputValue.charAt(0)!=="+");const val=useAttribute?attributeValue:inputValue;const dialCode=this._getDialCode(val);const isRegionlessNanpNumber=isRegionlessNanp(val);const{initialCountry,geoIpLookup}=this.options;const isAutoCountry=initialCountry==="auto"&&geoIpLookup;if(dialCode&&!isRegionlessNanpNumber){this._updateCountryFromNumber(val)}else if(!isAutoCountry||overrideAutoCountry){const lowerInitialCountry=initialCountry?initialCountry.toLowerCase():"";const isValidInitialCountry=lowerInitialCountry&&this._getCountryData(lowerInitialCountry,!0);if(isValidInitialCountry){this._setCountry(lowerInitialCountry)}else{if(dialCode&&isRegionlessNanpNumber){this._setCountry("us")}else{this._setCountry()}}} if(val){this._updateValFromNumber(val)}} _initListeners(){this._initTelInputListeners();if(this.options.allowDropdown){this._initDropdownListeners()} if((this.hiddenInput||this.hiddenInputCountry)&&this.telInput.form){this._initHiddenInputListener()}} _initHiddenInputListener(){this._handleHiddenInputSubmit=()=>{if(this.hiddenInput){this.hiddenInput.value=this.getNumber()} if(this.hiddenInputCountry){this.hiddenInputCountry.value=this.getSelectedCountryData().iso2||""}};this.telInput.form?.addEventListener("submit",this._handleHiddenInputSubmit)} _initDropdownListeners(){this._handleLabelClick=(e)=>{if(this.dropdownContent.classList.contains("iti__hide")){this.telInput.focus()}else{e.preventDefault()}};const label=this.telInput.closest("label");if(label){label.addEventListener("click",this._handleLabelClick)} this._handleClickSelectedCountry=()=>{if(this.dropdownContent.classList.contains("iti__hide")&&!this.telInput.disabled&&!this.telInput.readOnly){this._openDropdown()}};this.selectedCountry.addEventListener("click",this._handleClickSelectedCountry);this._handleCountryContainerKeydown=(e)=>{const isDropdownHidden=this.dropdownContent.classList.contains("iti__hide");if(isDropdownHidden&&["ArrowUp","ArrowDown"," ","Enter"].includes(e.key)){e.preventDefault();e.stopPropagation();this._openDropdown()} if(e.key==="Tab"){this._closeDropdown()}};this.countryContainer.addEventListener("keydown",this._handleCountryContainerKeydown)} _initRequests(){let{loadUtils,initialCountry,geoIpLookup}=this.options;if(loadUtils&&!intlTelInput.utils){this._handlePageLoad=()=>{window.removeEventListener("load",this._handlePageLoad);intlTelInput.attachUtils(loadUtils)?.catch(()=>{})};if(intlTelInput.documentReady()){this._handlePageLoad()}else{window.addEventListener("load",this._handlePageLoad)}}else{this.resolveUtilsScriptPromise()} const isAutoCountry=initialCountry==="auto"&&geoIpLookup;if(isAutoCountry&&!this.selectedCountryData.iso2){this._loadAutoCountry()}else{this.resolveAutoCountryPromise()}} _loadAutoCountry(){if(intlTelInput.autoCountry){this.handleAutoCountry()}else if(!intlTelInput.startedLoadingAutoCountry){intlTelInput.startedLoadingAutoCountry=!0;if(typeof this.options.geoIpLookup==="function"){this.options.geoIpLookup((iso2="")=>{const iso2Lower=iso2.toLowerCase();const isValidIso2=iso2Lower&&this._getCountryData(iso2Lower,!0);if(isValidIso2){intlTelInput.autoCountry=iso2Lower;setTimeout(()=>forEachInstance("handleAutoCountry"))}else{this._setInitialState(!0);forEachInstance("rejectAutoCountryPromise")}},()=>{this._setInitialState(!0);forEachInstance("rejectAutoCountryPromise")})}}} _openDropdownWithPlus(){this._openDropdown();this.searchInput.value="+";this._filterCountries("",!0)} _initTelInputListeners(){const{strictMode,formatAsYouType,separateDialCode,formatOnDisplay,allowDropdown,countrySearch}=this.options;let userOverrideFormatting=!1;if(/\p{L}/u.test(this.telInput.value)){userOverrideFormatting=!0} this._handleInputEvent=(e)=>{if(this.isAndroid&&e?.data==="+"&&separateDialCode&&allowDropdown&&countrySearch){const currentCaretPos=this.telInput.selectionStart||0;const valueBeforeCaret=this.telInput.value.substring(0,currentCaretPos-1);const valueAfterCaret=this.telInput.value.substring(currentCaretPos);this.telInput.value=valueBeforeCaret+valueAfterCaret;this._openDropdownWithPlus();return} if(this._updateCountryFromNumber(this.telInput.value)){this._triggerCountryChange()} const isFormattingChar=e?.data&&/[^+0-9]/.test(e.data);const isPaste=e?.inputType==="insertFromPaste"&&this.telInput.value;if(isFormattingChar||isPaste&&!strictMode){userOverrideFormatting=!0}else if(!/[^+0-9]/.test(this.telInput.value)){userOverrideFormatting=!1} const disableFormatOnSetNumber=e?.detail&&e.detail.isSetNumber&&!formatOnDisplay;if(formatAsYouType&&!userOverrideFormatting&&!disableFormatOnSetNumber){const currentCaretPos=this.telInput.selectionStart||0;const valueBeforeCaret=this.telInput.value.substring(0,currentCaretPos);const relevantCharsBeforeCaret=valueBeforeCaret.replace(/[^+0-9]/g,"").length;const isDeleteForwards=e?.inputType==="deleteContentForward";const formattedValue=this._formatNumberAsYouType();const newCaretPos=translateCursorPosition(relevantCharsBeforeCaret,formattedValue,currentCaretPos,isDeleteForwards);this.telInput.value=formattedValue;this.telInput.setSelectionRange(newCaretPos,newCaretPos)}};this.telInput.addEventListener("input",this._handleInputEvent);if(strictMode||separateDialCode){this._handleKeydownEvent=(e)=>{if(e.key&&e.key.length===1&&!e.altKey&&!e.ctrlKey&&!e.metaKey){if(separateDialCode&&allowDropdown&&countrySearch&&e.key==="+"){e.preventDefault();this._openDropdownWithPlus();return} if(strictMode){const value=this.telInput.value;const alreadyHasPlus=value.charAt(0)==="+";const isInitialPlus=!alreadyHasPlus&&this.telInput.selectionStart===0&&e.key==="+";const isNumeric=/^[0-9]$/.test(e.key);const isAllowedChar=separateDialCode?isNumeric:isInitialPlus||isNumeric;const newValue=value.slice(0,this.telInput.selectionStart)+e.key+value.slice(this.telInput.selectionEnd);const newFullNumber=this._getFullNumber(newValue);const coreNumber=intlTelInput.utils.getCoreNumber(newFullNumber,this.selectedCountryData.iso2);const hasExceededMaxLength=this.maxCoreNumberLength&&coreNumber.length>this.maxCoreNumberLength;let isChangingDialCode=!1;if(alreadyHasPlus){const currentCountry=this.selectedCountryData.iso2;const newCountry=this._getCountryFromNumber(newFullNumber);isChangingDialCode=newCountry!==currentCountry} if(!isAllowedChar||hasExceededMaxLength&&!isChangingDialCode&&!isInitialPlus){e.preventDefault()}}}};this.telInput.addEventListener("keydown",this._handleKeydownEvent)}} _cap(number){const max=parseInt(this.telInput.getAttribute("maxlength")||"",10);return max&&number.length>max?number.substr(0,max):number} _trigger(name,detailProps={}){const e=new CustomEvent(name,{bubbles:!0,cancelable:!0,detail:detailProps});this.telInput.dispatchEvent(e)} _openDropdown(){const{fixDropdownWidth,countrySearch}=this.options;if(fixDropdownWidth){this.dropdownContent.style.width=`${this.telInput.offsetWidth}px`} this.dropdownContent.classList.remove("iti__hide");this.selectedCountry.setAttribute("aria-expanded","true");this._setDropdownPosition();if(countrySearch){const firstCountryItem=this.countryList.firstElementChild;if(firstCountryItem){this._highlightListItem(firstCountryItem,!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)} if(!this.options.useFullscreenPopup){const inputPosRelativeToVP=this.telInput.getBoundingClientRect();const inputHeight=this.telInput.offsetHeight;if(this.options.dropdownContainer){this.dropdown.style.top=`${inputPosRelativeToVP.top + inputHeight}px`;this.dropdown.style.left=`${inputPosRelativeToVP.left}px`;this._handleWindowScroll=()=>this._closeDropdown();window.addEventListener("scroll",this._handleWindowScroll)}}} _bindDropdownListeners(){this._handleMouseoverCountryList=(e)=>{const listItem=e.target?.closest(".iti__country");if(listItem){this._highlightListItem(listItem,!1)}};this.countryList.addEventListener("mouseover",this._handleMouseoverCountryList);this._handleClickCountryList=(e)=>{const listItem=e.target?.closest(".iti__country");if(listItem){this._selectListItem(listItem)}};this.countryList.addEventListener("click",this._handleClickCountryList);let isOpening=!0;this._handleClickOffToClose=()=>{if(!isOpening){this._closeDropdown()} isOpening=!1};document.documentElement.addEventListener("click",this._handleClickOffToClose);let query="";let queryTimer=null;this._handleKeydownOnDropdown=(e)=>{if(["ArrowUp","ArrowDown","Enter","Escape"].includes(e.key)){e.preventDefault();e.stopPropagation();if(e.key==="ArrowUp"||e.key==="ArrowDown"){this._handleUpDownKey(e.key)}else if(e.key==="Enter"){this._handleEnterKey()}else if(e.key==="Escape"){this._closeDropdown()}} if(!this.options.countrySearch&&/^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(e.key)){e.stopPropagation();if(queryTimer){clearTimeout(queryTimer)} query+=e.key.toLowerCase();this._searchForCountry(query);queryTimer=setTimeout(()=>{query=""},1e3)}};document.addEventListener("keydown",this._handleKeydownOnDropdown);if(this.options.countrySearch){const doFilter=()=>{const inputQuery=this.searchInput.value.trim();if(inputQuery){this._filterCountries(inputQuery)}else{this._filterCountries("",!0)}};let keyupTimer=null;this._handleSearchChange=()=>{if(keyupTimer){clearTimeout(keyupTimer)} keyupTimer=setTimeout(()=>{doFilter();keyupTimer=null},100)};this.searchInput.addEventListener("input",this._handleSearchChange);this.searchInput.addEventListener("click",(e)=>e.stopPropagation())}} _searchForCountry(query){for(let i=0;iword[0]).join("").toLowerCase();const fullDialCode=`+${c.dialCode}`;if(isReset||normalisedCountryName.includes(normalisedQuery)||fullDialCode.includes(normalisedQuery)||c.iso2.includes(normalisedQuery)||countryInitials.includes(normalisedQuery)){const listItem=c.nodeById[this.id];if(listItem){this.countryList.appendChild(listItem)} if(noCountriesAddedYet){this._highlightListItem(listItem,!1);noCountriesAddedYet=!1}}} if(noCountriesAddedYet){this._highlightListItem(null,!1)} this.countryList.scrollTop=0;this._updateSearchResultsText()} _updateSearchResultsText(){const{i18n}=this.options;const count=this.countryList.childElementCount;let searchText;if(count===0){searchText=i18n.zeroSearchResults}else if(count===1){searchText=i18n.oneSearchResult}else{searchText=i18n.multipleSearchResults.replace("${count}",count.toString())} this.searchResultsA11yText.textContent=searchText} _handleUpDownKey(key){let next=key==="ArrowUp"?this.highlightedItem?.previousElementSibling:this.highlightedItem?.nextElementSibling;if(!next&&this.countryList.childElementCount>1){next=key==="ArrowUp"?this.countryList.lastElementChild:this.countryList.firstElementChild} if(next){this._scrollTo(next);this._highlightListItem(next,!1)}} _handleEnterKey(){if(this.highlightedItem){this._selectListItem(this.highlightedItem)}} _updateValFromNumber(fullNumber){let number=fullNumber;if(this.options.formatOnDisplay&&intlTelInput.utils&&this.selectedCountryData){const useNational=this.options.nationalMode||number.charAt(0)!=="+"&&!this.options.separateDialCode;const{NATIONAL,INTERNATIONAL}=intlTelInput.utils.numberFormat;const format=useNational?NATIONAL:INTERNATIONAL;number=intlTelInput.utils.formatNumber(number,this.selectedCountryData.iso2,format)} number=this._beforeSetNumber(number);this.telInput.value=number} _updateCountryFromNumber(fullNumber){const iso2=this._getCountryFromNumber(fullNumber);if(iso2!==null){return this._setCountry(iso2)} return!1} _ensureHasDialCode(number){const{dialCode,nationalPrefix}=this.selectedCountryData;const alreadyHasPlus=number.charAt(0)==="+";if(alreadyHasPlus||!dialCode){return number} const hasPrefix=nationalPrefix&&number.charAt(0)===nationalPrefix&&!this.options.separateDialCode;const cleanNumber=hasPrefix?number.substring(1):number;return`+${dialCode}${cleanNumber}`} _getCountryFromNumber(fullNumber){const plusIndex=fullNumber.indexOf("+");let number=plusIndex?fullNumber.substring(plusIndex):fullNumber;const selectedIso2=this.selectedCountryData.iso2;const selectedDialCode=this.selectedCountryData.dialCode;number=this._ensureHasDialCode(number);const dialCodeMatch=this._getDialCode(number,!0);const numeric=getNumeric(number);if(dialCodeMatch){const dialCodeMatchNumeric=getNumeric(dialCodeMatch);const iso2Codes=this.dialCodeToIso2Map[dialCodeMatchNumeric];if(!selectedIso2&&this.defaultCountry&&iso2Codes.includes(this.defaultCountry)){return this.defaultCountry} const alreadySelected=selectedIso2&&iso2Codes.includes(selectedIso2)&&(numeric.length===dialCodeMatchNumeric.length||!this.selectedCountryData.areaCodes);const isRegionlessNanpNumber=selectedDialCode==="1"&&isRegionlessNanp(numeric);if(!isRegionlessNanpNumber&&!alreadySelected){for(let j=0;jcontainerBottom){const heightDifference=containerHeight-elementHeight;container.scrollTop=newScrollTop-heightDifference}} _updateDialCode(newDialCodeBare){const inputVal=this.telInput.value;const newDialCode=`+${newDialCodeBare}`;let newNumber;if(inputVal.charAt(0)==="+"){const prevDialCode=this._getDialCode(inputVal);if(prevDialCode){newNumber=inputVal.replace(prevDialCode,newDialCode)}else{newNumber=newDialCode} this.telInput.value=newNumber}} _getDialCode(number,includeAreaCode){let dialCode="";if(number.charAt(0)==="+"){let numericChars="";for(let i=0;i-1){const beforeAlphaChar=val.substring(0,alphaCharPosition);const beforeAlphaIsValid=this._utilsIsPossibleNumber(beforeAlphaChar);const isValid=this._utilsIsPossibleNumber(val);return beforeAlphaIsValid&&isValid} return this._utilsIsPossibleNumber(val)} _utilsIsPossibleNumber(val){return intlTelInput.utils?intlTelInput.utils.isPossibleNumber(val,this.selectedCountryData.iso2,this.options.validationNumberTypes):null} isValidNumberPrecise(){if(!this.selectedCountryData.iso2){return!1} const val=this._getFullNumber();const alphaCharPosition=val.search(/\p{L}/u);if(alphaCharPosition>-1){const beforeAlphaChar=val.substring(0,alphaCharPosition);const beforeAlphaIsValid=this._utilsIsValidNumber(beforeAlphaChar);const isValid=this._utilsIsValidNumber(val);return beforeAlphaIsValid&&isValid} return this._utilsIsValidNumber(val)} _utilsIsValidNumber(val){return intlTelInput.utils?intlTelInput.utils.isValidNumber(val,this.selectedCountryData.iso2,this.options.validationNumberTypes):null} setCountry(iso2){const iso2Lower=iso2?.toLowerCase();const currentCountry=this.selectedCountryData.iso2;const isCountryChange=iso2&&iso2Lower!==currentCountry||!iso2&¤tCountry;if(isCountryChange){this._setCountry(iso2Lower);this._updateDialCode(this.selectedCountryData.dialCode);this._triggerCountryChange()}} setNumber(number){const countryChanged=this._updateCountryFromNumber(number);this._updateValFromNumber(number);if(countryChanged){this._triggerCountryChange()} this._trigger("input",{isSetNumber:!0})} setPlaceholderNumberType(type){this.options.placeholderNumberType=type;this._updatePlaceholder()} setDisabled(disabled){this.telInput.disabled=disabled;if(disabled){this.selectedCountry.setAttribute("disabled","true")}else{this.selectedCountry.removeAttribute("disabled")}}};var attachUtils=(source)=>{if(!intlTelInput.utils&&!intlTelInput.startedLoadingUtilsScript){let loadCall;if(typeof source==="function"){try{loadCall=Promise.resolve(source())}catch(error){return Promise.reject(error)}}else{return Promise.reject(new TypeError(`The argument passed to attachUtils must be a function that returns a promise for the utilities module, not ${typeof source}`))} intlTelInput.startedLoadingUtilsScript=!0;return loadCall.then((module)=>{const utils=module?.default;if(!utils||typeof utils!=="object"){throw new TypeError("The loader function passed to attachUtils did not resolve to a module object with utils as its default export.")} intlTelInput.utils=utils;forEachInstance("handleUtils");return!0}).catch((error)=>{forEachInstance("rejectUtilsScriptPromise",error);throw error})} return null};var intlTelInput=Object.assign((input,options)=>{const iti=new Iti(input,options);iti._init();input.setAttribute("data-intl-tel-input-id",iti.id.toString());intlTelInput.instances[iti.id]=iti;return iti},{defaults,documentReady:()=>document.readyState==="complete",getCountryData:()=>data_default,getInstance:(input)=>{const id2=input.getAttribute("data-intl-tel-input-id");return id2?intlTelInput.instances[id2]:null},instances:{},attachUtils,startedLoadingUtilsScript:!1,startedLoadingAutoCountry:!1,version:"25.3.0"});var intl_tel_input_default=intlTelInput;return __toCommonJS(intl_tel_input_exports)})();return factoryOutput.default}))