/* * International Telephone Input v24.7.0 * 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=(f,e)=>{for(var n in e)I1(f,n,{get:e[n],enumerable:!0})},O2=(f,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of P2(e))!x2.call(f,a)&&a!==n&&I1(f,a,{get:()=>e[a],enumerable:!(r=D2(e,a))||r.enumerable});return f};var k2=f=>O2(I1({},"__esModule",{value:!0}),f);var z2={};R2(z2,{default:()=>W2});var o2=[["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"]],s2=[];for(let f=0;ff.replace(/\D/g,""),l2=(f="")=>f.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase(),h2=f=>{let e=p1(f);if(e.charAt(0)==="1"){let n=e.substr(1,3);return F2.indexOf(n)!==-1}return!1},K2=(f,e,n,r)=>{if(n===0&&!r)return 0;let a=0;for(let l=0;l{let r=document.createElement(f);return e&&Object.entries(e).forEach(([a,l])=>r.setAttribute(a,l)),n&&n.appendChild(r),r},$1=(f,...e)=>{let{instances:n}=m;Object.values(n).forEach(r=>r[f](...e))},b1=class{constructor(e,n={}){this.id=H2++,this.telInput=e,this.highlightedItem=null,this.options=Object.assign({},c2,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((a,l)=>{this.resolveAutoCountryPromise=a,this.rejectAutoCountryPromise=l}),r=new Promise((a,l)=>{this.resolveUtilsScriptPromise=a,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 a=r.indexOf(e.iso2),l=r.indexOf(n.iso2),p=a>-1,y=l>-1;if(p||y)return p&&y?a-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;la.toLowerCase());this.countries=K.filter(a=>r.indexOf(a.iso2)>-1)}else if(n.length){let r=n.map(a=>a.toLowerCase());this.countries=K.filter(a=>r.indexOf(a.iso2)===-1)}else this.countries=K}_translateCountryNames(){for(let e=0;e`),l+=`${n.name}`,l+=`+${n.dialCode}`,a.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=h2(l),{initialCountry:C,geoIpLookup:S}=this.options,I=C==="auto"&&S;if(p&&!y)this._updateCountryFromNumber(l);else if(!I||e){let _=C?C.toLowerCase():"";_&&this._getCountryData(_,!0)?this._setCountry(_):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{loadUtilsOnInit:e,utilsScript:n,initialCountry:r,geoIpLookup:a}=this.options;!e&&n&&(console.warn("intl-tel-input: The `utilsScript` option is deprecated and will be removed in a future release! Please use the `loadUtilsOnInit` option instead."),e=n),e&&!m.utils?(this._handlePageLoad=()=>{window.removeEventListener("load",this._handlePageLoad),m.loadUtils(e)?.catch(()=>{})},m.documentReady()?this._handlePageLoad():window.addEventListener("load",this._handlePageLoad)):this.resolveUtilsScriptPromise(),r==="auto"&&a&&!this.selectedCountryData.iso2?this._loadAutoCountry():this.resolveAutoCountryPromise()}_loadAutoCountry(){m.autoCountry?this.handleAutoCountry():m.startedLoadingAutoCountry||(m.startedLoadingAutoCountry=!0,typeof this.options.geoIpLookup=="function"&&this.options.geoIpLookup((e="")=>{let n=e.toLowerCase();n&&this._getCountryData(n,!0)?(m.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:a,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),I=C?.inputType==="insertFromPaste"&&this.telInput.value;S||I&&!e?y=!0:/[^+0-9]/.test(this.telInput.value)||(y=!1);let _=C?.detail&&C.detail.isSetNumber&&!a;if(n&&!y&&!_){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)==="+",_=!I&&this.telInput.selectionStart===0&&C.key==="+",w=/^[0-9]$/.test(C.key),O=r?w:_||w,M=S.slice(0,this.telInput.selectionStart)+C.key+S.slice(this.telInput.selectionEnd),k=this._getFullNumber(M),z=m.utils.getCoreNumber(k,this.selectedCountryData.iso2),Z=this.maxCoreNumberLength&&z.length>this.maxCoreNumberLength,n1=!1;if(I){let f1=this.selectedCountryData.iso2;n1=this._getCountryFromNumber(k)!==f1}(!O||Z&&!n1&&!_)&&C.preventDefault()}}},this.telInput.addEventListener("keydown",this._handleKeydownEvent))}_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=a=>{let l=a.target?.closest(".iti__country");l&&this._highlightListItem(l,!1)},this.countryList.addEventListener("mouseover",this._handleMouseoverCountryList),this._handleClickCountryList=a=>{let l=a.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=a=>{["ArrowUp","ArrowDown","Enter","Escape"].includes(a.key)&&(a.preventDefault(),a.stopPropagation(),a.key==="ArrowUp"||a.key==="ArrowDown"?this._handleUpDownKey(a.key):a.key==="Enter"?this._handleEnterKey():a.key==="Escape"&&this._closeDropdown()),!this.options.countrySearch&&/^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(a.key)&&(a.stopPropagation(),r&&clearTimeout(r),n+=a.key.toLowerCase(),this._searchForCountry(n),r=setTimeout(()=>{n=""},1e3))},document.addEventListener("keydown",this._handleKeydownOnDropdown),this.options.countrySearch){let a=()=>{let p=this.searchInput.value.trim();p?this._filterCountries(p):this._filterCountries("",!0)},l=null;this._handleSearchChange=()=>{l&&clearTimeout(l),l=setTimeout(()=>{a(),l=null},100)},this.searchInput.addEventListener("input",this._handleSearchChange),this.searchInput.addEventListener("click",p=>p.stopPropagation())}}_searchForCountry(e){for(let n=0;nI[0]).join("").toLowerCase(),S=`+${p.dialCode}`;if(n||y.includes(a)||S.includes(a)||p.iso2.includes(a)||C.includes(a)){let I=p.nodeById[this.id];I&&this.countryList.appendChild(I),r&&(this._highlightListItem(I,!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&&m.utils&&this.selectedCountryData){let r=this.options.nationalMode||n.charAt(0)!=="+"&&!this.options.separateDialCode,{NATIONAL:a,INTERNATIONAL:l}=m.utils.numberFormat,p=r?a:l;n=m.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,a=this.selectedCountryData.dialCode;r&&a==="1"&&r.charAt(0)!=="+"&&(r.charAt(0)!=="1"&&(r=`1${r}`),r=`+${r}`),this.options.separateDialCode&&a&&r.charAt(0)!=="+"&&(r=`+${a}${r}`);let p=this._getDialCode(r,!0),y=p1(r);if(p){let C=this.dialCodeToIso2Map[p1(p)],S=C.indexOf(this.selectedCountryData.iso2)!==-1&&y.length<=p.length-1;if(!(a==="1"&&h2(y))&&!S){for(let _=0;_p){let _=a-y;n.scrollTop=I-_}}_updateDialCode(e){let n=this.telInput.value,r=`+${e}`,a;if(n.charAt(0)==="+"){let l=this._getDialCode(n);l?a=n.replace(l,r):a=r,this.telInput.value=a}}_getDialCode(e,n){let r="";if(e.charAt(0)==="+"){let a="";for(let l=0;l-1){let r=e.substring(0,n),a=this._utilsIsPossibleNumber(r),l=this._utilsIsPossibleNumber(e);return a&&l}return this._utilsIsPossibleNumber(e)}_utilsIsPossibleNumber(e){return m.utils?m.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),a=this._utilsIsValidNumber(r),l=this._utilsIsValidNumber(e);return a&&l}return this._utilsIsValidNumber(e)}_utilsIsValidNumber(e){return m.utils?m.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=f=>{if(!m.utils&&!m.startedLoadingUtilsScript){let e;if(typeof f=="string")e=Promise.reject(new Error("INTENTIONALLY BROKEN: this build of intl-tel-input includes the utilities module inline, but it has incorrectly attempted to load the utilities separately. If you are seeing this message, something is broken!"));else if(typeof f=="function")try{if(e=f(),!(e instanceof Promise))throw new TypeError(`The function passed to loadUtils must return a promise for the utilities module, not ${typeof e}`)}catch(n){return Promise.reject(n)}else return Promise.reject(new TypeError(`The argument passed to loadUtils must be a URL string or a function that returns a promise for the utilities module, not ${typeof f}`));return m.startedLoadingUtilsScript=!0,e.then(n=>{let r=n?.default;if(!r||typeof r!="object")throw typeof f=="string"?new TypeError(`The module loaded from ${f} did not set utils as its default export.`):new TypeError("The loader function passed to loadUtils did not resolve to a module object with utils as its default export.");return m.utils=r,$1("handleUtils"),!0}).catch(n=>{throw $1("rejectUtilsScriptPromise",n),n})}return null},m=Object.assign((f,e)=>{let n=new b1(f,e);return n._init(),f.setAttribute("data-intl-tel-input-id",n.id.toString()),m.instances[n.id]=n,n},{defaults:c2,documentReady:()=>document.readyState==="complete",getCountryData:()=>K,getInstance:f=>{let e=f.getAttribute("data-intl-tel-input-id");return e?m.instances[e]:null},instances:{},loadUtils:V2,startedLoadingUtilsScript:!1,startedLoadingAutoCountry:!1,version:"24.7.0"}),S1=m;(function(){var f=this||self;function e(d,t){d=d.split(".");var $=f;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 u=Array(arguments.length-2),h=2;hd.length?!1:B(L2,d)}function B1(d){return B(b2,d)?s1(d,C2):s1(d,m1)}function G1(d){var t=B1(d.toString());x(d),d.g(t)}function U1(d){return d!=null&&(U(d,9)!=1||A(d,9)[0]!=-1)}function s1(d,t){for(var $=new L,i,o=d.length,s=0;st?2:s[s.length-1]=o&&o<=i;++o)if($=parseInt(d.substring(0,o),10),$ in X)return t.g(d.substring(o)),$;return 0}function W1(d,t,$,i,o,s){if(t.length==0)return 0;t=new L(t);var u;$!=null&&(u=c($,11)),u==null&&(u="NonMatch");var h=t.toString();if(h.length==0)u=20;else if(Q.test(h))h=h.replace(Q,""),x(t),t.g(B1(h)),u=1;else{if(h=new RegExp(u),G1(t),u=t.toString(),u.search(h)==0){h=u.match(h)[0].length;var g=u.substring(h).match(x1);g&&g[1]!=null&&0=t.h.length)throw Error("Phone number too short after IDD");if(d=j1(t,i),d!=0)return E(s,1,d),d;throw Error("Invalid country calling code")}return $!=null&&(u=v($,10),h=""+u,g=t.toString(),g.lastIndexOf(h,0)==0&&(h=new L(g.substring(h.length)),g=c($,1),g=new RegExp(v(g,2)),z1(h,$,null),h=h.toString(),!B(g,t.toString())&&B(g,h)||l1(d,t.toString(),$,-1)==3))?(i.g(h),o&&E(s,6,10),E(s,1,u),u):(E(s,1,0),0)}function z1(d,t,$){var i=d.toString(),o=i.length,s=c(t,15);if(o!=0&&s!=null&&s.length!=0){var u=new RegExp("^(?:"+s+")");if(o=u.exec(i)){s=new RegExp(v(c(t,1),2));var h=B(s,i),g=o.length-1;t=c(t,16),t==null||t.length==0||o[g]==null||o[g].length==0?(!h||B(s,i.substring(o[0].length)))&&($!=null&&0=t.length)s="";else{var u=t.indexOf(";",s);s=u!==-1?t.substring(s,u):t.substring(s)}var h=s;if(h==null?u=!0:h.length===0?u=!1:(u=S2.exec(h),h=w2.exec(h),u=u!==null||h!==null),!u||(s!=null?(s.charAt(0)==="+"&&o.g(s),s=t.indexOf("tel:"),o.g(t.substring(0<=s?s+4:0,t.indexOf(";phone-context=")))):(s=o.g,u=t??"",h=u.search(v2),0<=h?(u=u.substring(h),u=u.replace(_2,""),h=u.search(I2),0<=h&&(u=u.substring(0,h))):u="",s.call(o,u)),s=o.toString(),u=s.indexOf(";isub="),0t.h.length||(u!=null&&($=new L,o=new L(t.toString()),z1(o,u,$),d=l1(d,o.toString(),u,-1),d!=2&&d!=4&&d!=5&&(t=o,i&&0<$.toString().length&&E(s,7,$.toString()))),i=t.toString(),d=i.length,2>d))throw Error("The string supplied is too short to be a phone number");if(17{try{let $=d.replace(/[^+0-9]/g,""),i=new N2(t);t="";for(let o=0;o<$.length;o++)i.ja=M2(i,$.charAt(o)),t=i.ja;return t}catch{return d}}),e("intlTelInputUtilsTemp.formatNumber",(d,t,$)=>{try{let o=N.g(),s=W(o,d,t);var i=J(o,s,-1);return i==0||i==4?o.format(s,typeof $>"u"?0:$):d}catch{return d}}),e("intlTelInputUtilsTemp.getExampleNumber",(d,t,$,i)=>{try{let g=N.g();d:{var o=g;if(a1(d)){var s=u1(F(o,d),$);try{if(P(s,6)){var u=c(s,6),h=Z1(o,u,d,!1);break d}}catch{}}h=null}return g.format(h,i?0:t?2:1)}catch{return""}}),e("intlTelInputUtilsTemp.getExtension",(d,t)=>{try{return c(W(N.g(),d,t),3)}catch{return""}}),e("intlTelInputUtilsTemp.getNumberType",(d,t)=>{try{let u=N.g(),h=W(u,d,t);var $=K1(u,h),i=d1(u,v(h,1),$);if(i==null)var o=-1;else{var s=t1(h);o=C1(s,i)}return o}catch{return-99}}),e("intlTelInputUtilsTemp.getValidationError",(d,t)=>{if(!t)return 1;try{let $=N.g(),i=W($,d,t);return J($,i,-1)}catch($){return $.message==="Invalid country calling code"?1:3>=d.length||$.message==="Phone number too short after IDD"||$.message==="The string supplied is too short to be a phone number"?2:$.message==="The string supplied is too long to be a phone number"?3:-99}}),e("intlTelInputUtilsTemp.isValidNumber",(d,t)=>{try{let g=N.g();var $=W(g,d,t),i=K1(g,$);d=g;var o=v($,1),s=d1(d,o,i);if(s==null||i!="001"&&o!=V1(d,i))var u=!1;else{var h=t1($);u=C1(h,s)!=-1}return u}catch{return!1}}),e("intlTelInputUtilsTemp.isPossibleNumber",(d,t,$)=>{try{let i=N.g(),o=W(i,d,t);if($){let s=J(i,o,c1[$])===0;if($==="FIXED_LINE_OR_MOBILE"){let u=J(i,o,c1.MOBILE)===0,h=J(i,o,c1.FIXED_LINE)===0;return u||h||s}return s}return J(i,o,-1)===0}catch{return!1}}),e("intlTelInputUtilsTemp.getCoreNumber",(d,t)=>{try{return c(W(N.g(),d,t),2).toString()}catch{return""}}),e("intlTelInputUtilsTemp.numberFormat",{E164:0,INTERNATIONAL:1,NATIONAL:2,RFC3966:3}),e("intlTelInputUtilsTemp.numberType",c1),e("intlTelInputUtilsTemp.validationError",{IS_POSSIBLE:0,INVALID_COUNTRY_CODE:1,TOO_SHORT:2,TOO_LONG:3,IS_POSSIBLE_LOCAL_ONLY:4,INVALID_LENGTH:5})})();var j2=window.intlTelInputUtilsTemp;delete window.intlTelInputUtilsTemp;var p2=j2;S1.utils=p2;var W2=S1;return k2(z2);})(); // UMD return factoryOutput.default; }));