intl-tel-input 29.0.0 → 29.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/js/data.js +1 -1
- package/dist/js/data.min.js +1 -1
- package/dist/js/intlTelInput.js +2 -2
- package/dist/js/intlTelInput.min.js +2 -2
- package/dist/js/intlTelInput.mjs +1 -1
- package/dist/js/intlTelInputWithUtils.js +86 -138
- package/dist/js/intlTelInputWithUtils.min.js +2 -2
- package/dist/js/intlTelInputWithUtils.mjs +85 -137
- package/dist/js/utils.js +32 -32
- package/package.json +1 -1
package/dist/js/data.js
CHANGED
package/dist/js/data.min.js
CHANGED
package/dist/js/intlTelInput.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* International Telephone Input v29.0.
|
|
2
|
+
* International Telephone Input v29.0.1
|
|
3
3
|
* git+https://github.com/jackocnr/intl-tel-input.git
|
|
4
4
|
* Licensed under the MIT license
|
|
5
5
|
*/
|
|
@@ -4856,7 +4856,7 @@ var _factory = (() => {
|
|
|
4856
4856
|
attachUtils,
|
|
4857
4857
|
startedLoadingUtils: false,
|
|
4858
4858
|
startedLoadingAutoCountry: false,
|
|
4859
|
-
version: "29.0.
|
|
4859
|
+
version: "29.0.1",
|
|
4860
4860
|
NUMBER_FORMAT,
|
|
4861
4861
|
NUMBER_TYPE,
|
|
4862
4862
|
VALIDATION_ERROR,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* International Telephone Input v29.0.
|
|
2
|
+
* International Telephone Input v29.0.1
|
|
3
3
|
* git+https://github.com/jackocnr/intl-tel-input.git
|
|
4
4
|
* Licensed under the MIT license
|
|
5
5
|
*/
|
|
6
|
-
"use strict";var _factory=(()=>{var Z=Object.defineProperty;var Pt=Object.getOwnPropertyDescriptor;var xt=Object.getOwnPropertyNames;var Ht=Object.prototype.hasOwnProperty;var kt=(n,t)=>{for(var e in t)Z(n,e,{get:t[e],enumerable:!0})},Ut=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of xt(t))!Ht.call(n,s)&&s!==e&&Z(n,s,{get:()=>t[s],enumerable:!(i=Pt(t,s))||i.enumerable});return n};var Ft=n=>Ut(Z({},"__esModule",{value:!0}),n);var te={};kt(te,{COUNTRY_SELECTOR_MODE:()=>h,Iti:()=>j,NUMBER_FORMAT:()=>g,NUMBER_TYPE:()=>M,PLACEHOLDER_POLICY:()=>_,VALIDATION_ERROR:()=>z,default:()=>Zt});var Wt=[["af","93",0,null,"0"],["ax","358",1,["18","4"],"0"],["al","355",0,null,"0"],["dz","213",0,null,"0"],["as","1",5,["684"],"1"],["ad","376"],["ao","244"],["ai","1",6,["264"],"1"],["ag","1",7,["268"],"1"],["ar","54",0,null,"0"],["am","374",0,null,"0"],["aw","297"],["ac","247"],["au","61",0,["4"],"0"],["at","43",0,null,"0"],["az","994",0,null,"0"],["bs","1",8,["242"],"1"],["bh","973"],["bd","880",0,null,"0"],["bb","1",9,["246"],"1"],["by","375",0,null,"8"],["be","32",0,null,"0"],["bz","501"],["bj","229"],["bm","1",10,["441"],"1"],["bt","975"],["bo","591",0,null,"0"],["ba","387",0,null,"0"],["bw","267"],["br","55",0,null,"0"],["io","246"],["vg","1",11,["284"],"1"],["bn","673"],["bg","359",0,null,"0"],["bf","226"],["bi","257"],["kh","855",0,null,"0"],["cm","237"],["ca","1",1,["204","226","236","249","250","257","263","289","306","343","354","365","367","368","382","403","416","418","428","431","437","438","450","468","474","506","514","519","548","579","581","584","587","604","613","639","647","672","683","705","709","742","753","778","780","782","807","819","825","867","873","879","902","905","942"],"1"],["cv","238"],["bq","599",1,["3","4","7"]],["ky","1",12,["345"],"1"],["cf","236"],["td","235"],["cl","56"],["cn","86",0,null,"0"],["cx","61",2,["4","89164"],"0"],["cc","61",1,["4","89162"],"0"],["co","57",0,null,"0"],["km","269"],["cg","242"],["cd","243",0,null,"0"],["ck","682"],["cr","506"],["ci","225"],["hr","385",0,null,"0"],["cu","53",0,null,"0"],["cw","599",0],["cy","357"],["cz","420"],["dk","45"],["dj","253"],["dm","1",13,["767"],"1"],["do","1",2,["809","829","849"],"1"],["ec","593",0,null,"0"],["eg","20",0,null,"0"],["sv","503"],["gq","240"],["er","291",0,null,"0"],["ee","372"],["sz","268"],["et","251",0,null,"0"],["fk","500"],["fo","298"],["fj","679"],["fi","358",0,["4"],"0"],["fr","33",0,null,"0"],["gf","594",0,null,"0"],["pf","689"],["ga","241"],["gm","220"],["ge","995",0,null,"0"],["de","49",0,null,"0"],["gh","233",0,null,"0"],["gi","350"],["gr","30"],["gl","299"],["gd","1",14,["473"],"1"],["gp","590",0,null,"0"],["gu","1",15,["671"],"1"],["gt","502"],["gg","44",1,["1481","7781","7839","7911"],"0"],["gn","224"],["gw","245"],["gy","592"],["ht","509"],["hn","504"],["hk","852"],["hu","36",0,null,"06"],["is","354"],["in","91",0,null,"0"],["id","62",0,null,"0"],["ir","98",0,null,"0"],["iq","964",0,null,"0"],["ie","353",0,null,"0"],["im","44",2,["1624","74576","7524","7624","7924"],"0"],["il","972",0,null,"0"],["it","39",0,["3"]],["jm","1",4,["658","876"],"1"],["jp","81",0,null,"0"],["je","44",3,["1534","7509","7700","7797","7829","7937"],"0"],["jo","962",0,null,"0"],["kz","7",1,["33","7"],"8"],["ke","254",0,null,"0"],["ki","686",0,null,"0"],["xk","383",0,null,"0"],["kw","965"],["kg","996",0,null,"0"],["la","856",0,null,"0"],["lv","371"],["lb","961",0,null,"0"],["ls","266"],["lr","231",0,null,"0"],["ly","218",0,null,"0"],["li","423",0,null,"0"],["lt","370",0,null,"0"],["lu","352"],["mo","853"],["mg","261",0,null,"0"],["mw","265",0,null,"0"],["my","60",0,null,"0"],["mv","960"],["ml","223"],["mt","356"],["mh","692",0,null,"1"],["mq","596",0,null,"0"],["mr","222"],["mu","230"],["yt","262",1,["269","639"],"0"],["mx","52"],["fm","691"],["md","373",0,null,"0"],["mc","377",0,null,"0"],["mn","976",0,null,"0"],["me","382",0,null,"0"],["ms","1",16,["664"],"1"],["ma","212",0,["6","7"],"0"],["mz","258"],["mm","95",0,null,"0"],["na","264",0,null,"0"],["nr","674"],["np","977",0,null,"0"],["nl","31",0,null,"0"],["nc","687"],["nz","64",0,null,"0"],["ni","505"],["ne","227"],["ng","234",0,null,"0"],["nu","683"],["nf","672"],["kp","850",0,null,"0"],["mk","389",0,null,"0"],["mp","1",17,["670"],"1"],["no","47",0,["4","9"]],["om","968"],["pk","92",0,null,"0"],["pw","680"],["ps","970",0,null,"0"],["pa","507"],["pg","675"],["py","595",0,null,"0"],["pe","51",0,null,"0"],["ph","63",0,null,"0"],["pl","48"],["pt","351"],["pr","1",3,["787","939"],"1"],["qa","974"],["re","262",0,null,"0"],["ro","40",0,null,"0"],["ru","7",0,["33"],"8"],["rw","250",0,null,"0"],["ws","685"],["sm","378"],["st","239"],["sa","966",0,null,"0"],["sn","221"],["rs","381",0,null,"0"],["sc","248"],["sl","232",0,null,"0"],["sg","65"],["sx","1",21,["721"],"1"],["sk","421",0,null,"0"],["si","386",0,null,"0"],["sb","677"],["so","252",0,null,"0"],["za","27",0,null,"0"],["kr","82",0,null,"0"],["ss","211",0,null,"0"],["es","34"],["lk","94",0,null,"0"],["bl","590",1,null,"0"],["sh","290"],["kn","1",18,["869"],"1"],["lc","1",19,["758"],"1"],["mf","590",2,null,"0"],["pm","508",0,null,"0"],["vc","1",20,["784"],"1"],["sd","249",0,null,"0"],["sr","597"],["sj","47",1,["4","79","9"]],["se","46",0,null,"0"],["ch","41",0,null,"0"],["sy","963",0,null,"0"],["tw","886",0,null,"0"],["tj","992"],["tz","255",0,null,"0"],["th","66",0,null,"0"],["tl","670"],["tg","228"],["tk","690"],["to","676"],["tt","1",22,["868"],"1"],["tn","216"],["tr","90",0,null,"0"],["tm","993",0,null,"8"],["tc","1",23,["649"],"1"],["tv","688"],["vi","1",24,["340"],"1"],["ug","256",0,null,"0"],["ua","380",0,null,"0"],["ae","971",0,null,"0"],["gb","44",0,null,"0"],["us","1",0,null,"1"],["uy","598",0,null,"0"],["uz","998"],["vu","678"],["va","39",1,["06698","3"]],["ve","58",0,null,"0"],["vn","84",0,null,"0"],["wf","681"],["eh","212",1,["5288","5289","6","7"],"0"],["ye","967",0,null,"0"],["zm","260",0,null,"0"],["zw","263",0,null,"0"]],tt=[];for(let n of Wt)tt.push({name:"",iso2:n[0],dialCode:n[1],priority:n[2]||0,areaCodes:n[3]||null,nationalPrefix:n[4]||null});var Bt=new Set(tt.map(n=>n.iso2)),x=n=>Bt.has(n),k=tt;var S={OPEN_COUNTRY_SELECTOR:"open:countryselector",CLOSE_COUNTRY_SELECTOR:"close:countryselector",COUNTRY_CHANGE:"countrychange",INPUT:"input",STRICT_REJECT:"strict:reject"},c={HIDE:"iti__hide",V_HIDE:"iti__v-hide",ARROW_UP:"iti__arrow--up",GLOBE:"iti__globe",FLAG:"iti__flag",LOADING:"iti__loading",COUNTRY_ITEM:"iti__country",HIGHLIGHT:"iti__highlight",STRICT_REJECT_ANIMATION:"iti__strict-reject-animation"},b={ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",SPACE:" ",ENTER:"Enter",ESC:"Escape",TAB:"Tab"},et={PASTE:"insertFromPaste",DELETE_FORWARD:"deleteContentForward"},v={ALPHA_UNICODE:/\p{L}/u,NON_PLUS_NUMERIC:/[^+0-9]/,NON_PLUS_NUMERIC_GLOBAL:/[^+0-9]/g,HIDDEN_SEARCH_CHAR:/^[a-zA-ZÀ-ÿа-яА-Я ]$/},it={SEARCH_DEBOUNCE_MS:100,HIDDEN_SEARCH_RESET_MS:1e3,NEXT_TICK:0},O={NARROW_VIEWPORT_WIDTH:500,FALLBACK_SELECTED_COUNTRY_WITH_DIAL_WIDTH:78,FALLBACK_SELECTED_COUNTRY_NO_DIAL_WIDTH:42,INPUT_PADDING_EXTRA_LEFT:6,DROPDOWN_MARGIN:3,FALLBACK_DROPDOWN_HEIGHT:200},V={PLUS:"+",NANP:"1"},Y={ISO2:"gb",DIAL_CODE:"44",MOBILE_PREFIX:"7",MOBILE_CORE_LENGTH:10},dt={ISO2:"us",DIAL_CODE:"1"},_={AGGRESSIVE:"AGGRESSIVE",POLITE:"POLITE",OFF:"OFF"},G=["OFF","DROPDOWN","FULLSCREEN","AUTO"],jt=["E164","INTERNATIONAL","NATIONAL","RFC3966"],U=["FIXED_LINE","MOBILE","FIXED_LINE_OR_MOBILE","TOLL_FREE","PREMIUM_RATE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL","UNKNOWN"],$t=["IS_POSSIBLE","INVALID_COUNTRY_CODE","TOO_SHORT","TOO_LONG","IS_POSSIBLE_LOCAL_ONLY","INVALID_LENGTH"],K=n=>Object.fromEntries(n.map(t=>[t,t])),g=K(jt),M=K(U),z=K($t),h=K(G),R={ISO2:"iso2",DIAL_CODE:"dialCode",INSTANCE_ID:"intlTelInputId"},p={EXPANDED:"aria-expanded",LABEL:"aria-label",SELECTED:"aria-selected",ACTIVE_DESCENDANT:"aria-activedescendant",HASPOPUP:"aria-haspopup",CONTROLS:"aria-controls",HIDDEN:"aria-hidden",AUTOCOMPLETE:"aria-autocomplete",MODAL:"aria-modal"};var Vt={selectedCountryAriaLabel:"Change country for phone number, currently selected ${countryName} (${dialCode})",noCountrySelected:"Select country for phone number",countryListAriaLabel:"List of countries",searchPlaceholder:"Search",clearSearchAriaLabel:"Clear search",searchEmptyState:"No results found",searchSummaryAria(n){return n===0?"No results found":n===1?"1 result found":`${n} results found`}},ht=Vt;var nt=n=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(n).matches,mt=()=>nt(`(max-width: ${O.NARROW_VIEWPORT_WIDTH}px)`),Yt=()=>{if(typeof navigator<"u"&&typeof window<"u"){let n=nt("(max-height: 600px)"),t=nt("(pointer: coarse)");if(mt()||t&&n)return h.FULLSCREEN}return h.DROPDOWN},J={countrySelectorMode:h.AUTO,allowedNumberTypes:[M.MOBILE,M.FIXED_LINE],allowNumberExtensions:!1,allowPhonewords:!1,containerClass:"",countryNameLocale:"en",countryNameOverrides:{},countryOrder:null,countrySearch:!0,customPlaceholder:null,dropdownAlwaysOpen:!1,dropdownParent:null,excludeCountries:null,matchDropdownWidth:!0,formatAsYouType:!0,hiddenInputs:null,uiTranslations:{},initialCountry:"",initialCountryLookup:null,loadUtils:null,numberDisplayFormat:g.INTERNATIONAL,onlyCountries:null,placeholderNumberPolicy:_.POLITE,placeholderNumberType:M.MOBILE,searchInputClass:"",separateDialCode:!0,strictRejectAnimation:!0,showFlags:!0,strictMode:!0},Et=n=>JSON.stringify(n),st=n=>!!n&&typeof n=="object"&&!Array.isArray(n),Gt=n=>typeof n=="function",Kt=n=>{if(!n||typeof n!="object")return!1;let t=n;return t.nodeType===1&&typeof t.tagName=="string"&&typeof t.appendChild=="function"},pt=new Set(Object.values(_)),X=n=>{console.warn(`[intl-tel-input] ${n}`)},T=(n,t,e)=>{X(`Option '${n}' must be ${t}; got ${Et(e)}. Ignoring.`)},ft=(n,t)=>{let e="an array of iso2 country code strings";if(!Array.isArray(t))return T(n,e,t),!1;let i=[];for(let s of t){if(typeof s!="string")return T(n,e,t),!1;let o=s.toLowerCase();x(o)?i.push(s):X(`Invalid iso2 code in '${n}': '${s}'. Skipping.`)}return i},yt=n=>{if(n===void 0)return{};if(!st(n)){let e=`The second argument must be an options object; got ${Et(n)}. Using defaults.`;return X(e),{}}let t={};for(let[e,i]of Object.entries(n)){if(!Object.hasOwn(J,e)){X(`Unknown option '${e}'. Ignoring.`);continue}switch(e){case"allowNumberExtensions":case"allowPhonewords":case"countrySearch":case"dropdownAlwaysOpen":case"matchDropdownWidth":case"formatAsYouType":case"showFlags":case"separateDialCode":case"strictMode":case"strictRejectAnimation":if(typeof i!="boolean"){T(e,"a boolean",i);break}t[e]=i;break;case"countrySelectorMode":if(typeof i!="string"||!G.includes(i)){T("countrySelectorMode",`one of ${G.map(s=>`"${s}"`).join(", ")}`,i);break}t[e]=i;break;case"numberDisplayFormat":if(typeof i!="string"||i===g.RFC3966||!(i===g.E164||i===g.INTERNATIONAL||i===g.NATIONAL)){T("numberDisplayFormat",'one of "E164", "INTERNATIONAL", "NATIONAL"',i);break}t[e]=i;break;case"placeholderNumberPolicy":if(typeof i!="string"||!pt.has(i)){let s=Array.from(pt).join(", ");T("placeholderNumberPolicy",`one of ${s}`,i);break}t[e]=i;break;case"containerClass":case"searchInputClass":case"countryNameLocale":if(typeof i!="string"){T(e,"a string",i);break}t[e]=i;break;case"countryOrder":{if(i===null)t[e]=i;else{let s=ft(e,i);s!==!1&&(t[e]=s)}break}case"customPlaceholder":case"hiddenInputs":case"initialCountryLookup":case"loadUtils":if(i!==null&&!Gt(i)){T(e,"a function or null",i);break}t[e]=i;break;case"dropdownParent":if(i!==null&&!Kt(i)){T("dropdownParent","an HTMLElement or null",i);break}t[e]=i;break;case"excludeCountries":case"onlyCountries":{if(i===null)t[e]=i;else{let s=ft(e,i);s!==!1&&(t[e]=s)}break}case"uiTranslations":if(i&&!st(i)){T("uiTranslations","an object",i);break}t[e]=i;break;case"countryNameOverrides":if(i&&!st(i)){T("countryNameOverrides","an object",i);break}t[e]=i;break;case"initialCountry":{if(typeof i!="string"){T("initialCountry","a string",i);break}let s=i.toLowerCase();if(s&&!x(s)){T("initialCountry","a valid iso2 country code",i);break}t[e]=i;break}case"placeholderNumberType":if(typeof i!="string"||!U.includes(i)){let s=U.join(", ");T("placeholderNumberType",`one of ${s}`,i);break}t[e]=i;break;case"allowedNumberTypes":if(i!==null){if(!Array.isArray(i)){T("allowedNumberTypes","an array of number types or null",i);break}let s=!0;for(let o of i)if(typeof o!="string"||!U.includes(o)){let r=U.join(", ");T("allowedNumberTypes",`an array of valid number types (${r})`,o),s=!1;break}s&&(t[e]=i)}else t[e]=null;break}}return t},Ct=n=>{n.initialCountry&&(n.initialCountry=n.initialCountry.toLowerCase()),n.onlyCountries?.length&&(n.onlyCountries=n.onlyCountries.map(t=>t.toLowerCase())),n.excludeCountries?.length&&(n.excludeCountries=n.excludeCountries.map(t=>t.toLowerCase())),n.countryOrder&&(n.countryOrder=n.countryOrder.map(t=>t.toLowerCase()))},gt=n=>{n.countrySelectorMode===h.AUTO&&(n.countrySelectorMode=Yt()),n.dropdownAlwaysOpen&&(n.countrySelectorMode=h.DROPDOWN),n.countrySelectorMode===h.FULLSCREEN?n.matchDropdownWidth=!1:mt()&&(n.matchDropdownWidth=!0),n.onlyCountries?.length===1&&(n.initialCountry=n.onlyCountries[0]),n.separateDialCode&&n.numberDisplayFormat===g.NATIONAL&&(n.numberDisplayFormat=g.INTERNATIONAL),n.countrySelectorMode!==h.OFF&&!n.showFlags&&!n.separateDialCode&&n.numberDisplayFormat===g.NATIONAL&&(n.numberDisplayFormat=g.INTERNATIONAL),n.uiTranslations={...ht,...n.uiTranslations}};var D=n=>n.replace(/\D/g,""),ot=(n="")=>n.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase();var q=n=>Object.keys(n).filter(t=>!!n[t]).join(" "),f=(n,t,e)=>{let i=document.createElement(n);return t&&Object.entries(t).forEach(([s,o])=>i.setAttribute(s,o)),e&&e.appendChild(i),i};var zt="http://www.w3.org/2000/svg",$=([n,t,e])=>{let i=document.createElementNS(zt,n);if(t)for(let s in t)i.setAttribute(s,String(t[s]));if(e)for(let s of e)i.appendChild($(s));return i},It=()=>$(["svg",{class:"iti__search-icon-svg",width:14,height:14,viewBox:"0 0 24 24",focusable:"false",[p.HIDDEN]:"true"},[["circle",{cx:11,cy:11,r:7}],["line",{x1:21,y1:21,x2:16.65,y2:16.65}]]]),bt=n=>{let t=`iti-${n}-clear-mask`;return $(["svg",{class:"iti__search-clear-svg",width:12,height:12,viewBox:"0 0 16 16",[p.HIDDEN]:"true",focusable:"false"},[["mask",{id:t,maskUnits:"userSpaceOnUse"},[["rect",{width:16,height:16,fill:"white"}],["path",{d:"M5.2 5.2 L10.8 10.8 M10.8 5.2 L5.2 10.8",stroke:"black","stroke-linecap":"round",class:"iti__search-clear-x"}]]],["circle",{cx:8,cy:8,r:8,class:"iti__search-clear-bg",mask:`url(#${t})`}]]])},Tt=()=>$(["svg",{class:"iti__country-check-svg",width:14,height:14,viewBox:"0 0 16 16",fill:"currentColor",focusable:"false",[p.HIDDEN]:"true"},[["path",{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"}]]]),rt=()=>$(["svg",{width:256,height:256,viewBox:"0 0 512 512",class:"iti__globe-svg"},[["path",{d:"M508 213a240 240 0 0 0-449-87l-2 5-2 5c-8 14-13 30-17 46a65 65 0 0 1 56 4c16-10 35-19 56-27l9-3c-6 23-10 48-10 74h-16l4 6c3 4 5 8 6 13h6c0 22 3 44 8 65l2 10-25-10-4 5 12 18 9 3 6 2 8 3 9 26 1 2 16-7h1l-5-13-1-2c24 6 49 9 75 10v26l11 10 7 7v-30l1-13c22 0 44-3 65-8l10-2-21 48-1 1a317 317 0 0 1-14 23l-21 5h-2c6 16 7 33 1 50a240 240 0 0 0 211-265m-401-56-11 6c19-44 54-79 98-98-11 20-21 44-29 69-21 6-40 15-58 23m154 182v4c-29-1-57-6-81-13-7-25-12-52-13-81h94zm0-109h-94c1-29 6-56 13-81 24-7 52-12 81-13zm0-112c-22 1-44 4-65 8l-10 2 12-30 9-17 1-2a332 332 0 0 1 13-23c13-4 26-6 40-7zm187 69 6 4c4 12 6 25 6 38v1h-68c-1-26-4-51-10-74l48 20 1 1 14 8zm-14-44 10 20c-20-11-43-21-68-29-8-25-18-49-29-69 37 16 67 44 87 78M279 49h1c13 1 27 3 39 7l14 23 1 2a343 343 0 0 1 12 26l2 5 6 16c-23-6-48-9-74-10h-1zm0 87h1c29 1 56 6 81 13 7 24 12 51 12 80v1h-94zm2 207h-2v-94h95c-1 29-6 56-13 81-24 7-51 12-80 13m86 60-20 10c11-20 21-43 29-68 25-8 48-18 68-29-16 37-43 67-77 87m87-115-7 5-16 9-2 1a337 337 0 0 1-47 21c6-24 9-49 10-75h68c0 13-2 27-6 39"}],["path",{d:"m261 428-2-2-22-21a40 40 0 0 0-32-11h-1a37 37 0 0 0-18 8l-1 1-4 2-2 2-5 4c-9-3-36-31-47-44s-32-45-34-55l3-2a151 151 0 0 0 11-9v-1a39 39 0 0 0 5-48l-3-3-11-19-3-4-5-7h-1l-3-3-4-3-5-2a35 35 0 0 0-16-3h-5c-4 1-14 5-24 11l-4 2-4 3-4 2c-9 8-17 17-18 27a380 380 0 0 0 212 259h3c12 0 25-10 36-21l10-12 6-11a39 39 0 0 0-8-40"}]]]);var lt=n=>ot(n).replace(/[^\p{L}]+/gu," ").trim(),Lt=n=>{let t=new Map;for(let e of n){let i=lt(e.name),s=i.split(" ").filter(Boolean),o=s.map(r=>r[0]||"").join("");t.set(e.iso2,{normalisedName:i,words:s,initials:o,dialCodePlus:`+${e.dialCode}`})}return t},At=(n,t,e)=>{let i=ot(e),s=lt(e),o=i!==""&&s==="",r=[],l=[],a=[],d=[],E=[],y=[],C=[];for(let I of n){let m=t.get(I.iso2);I.iso2===i?r.push(I):!o&&m.normalisedName.startsWith(s)?l.push(I):!o&&m.normalisedName.includes(s)?a.push(I):i===I.dialCode||i===m.dialCodePlus?d.push(I):m.dialCodePlus.includes(i)?E.push(I):m.initials.includes(i)&&y.push(I)}let N=s.split(" ").filter(Boolean);if(N.length>1&&r.length===0&&l.length===0&&a.length===0){let I=new Set([...d.map(m=>m.iso2),...E.map(m=>m.iso2),...y.map(m=>m.iso2)]);for(let m of n){if(I.has(m.iso2))continue;let L=t.get(m.iso2);N.some(w=>L.words.some(P=>P.startsWith(w)))&&C.push(m)}}let A=(I,m)=>I.priority-m.priority;return[...r,...l,...a,...d.sort(A),...E.sort(A),...y,...C]},Nt=(n,t,e)=>{let i=lt(e);for(let s of n){let{normalisedName:o}=t.get(s.iso2);if(o.startsWith(i))return s}return null};var F=class n{#t;static toAscii(t){return t?t.replace(/[٠-٩]/g,e=>String.fromCharCode(48+(e.charCodeAt(0)-1632))).replace(/[۰-۹]/g,e=>String.fromCharCode(48+(e.charCodeAt(0)-1776))):""}constructor(t){t&&this.#i(t)}#i(t){/[٠-٩]/.test(t)?this.#t="arabic-indic":/[۰-۹]/.test(t)?this.#t="persian":this.#t="ascii"}denormalise(t){if(!this.#t||this.#t==="ascii")return t;let e=this.#t==="arabic-indic"?1632:1776;return t.replace(/[0-9]/g,i=>String.fromCharCode(e+Number(i)))}normalise(t){return t?(this.#i(t),this.#t==="ascii"?t:n.toAscii(t)):""}isAscii(){return!this.#t||this.#t==="ascii"}};var St=typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("anchor-name: --x"),W=class n{#t;#i;#A;#E="";#b;#N;#S=null;#D;#m;#e;#u;#y;#o;#s;#f;#a;#T;#n;#c;#l;#d;#W;#r;#C=null;#h=null;#w=new Map;#O=null;#H;telInputEl;hadInitialPlaceholder;constructor(t,e,i){t.dataset[R.INSTANCE_ID]=i.toString(),this.telInputEl=t,this.#t=e,this.#i=i,this.hadInitialPlaceholder=!!t.getAttribute("placeholder"),this.#A=!!this.telInputEl.closest("[dir=rtl]"),this.#E=this.telInputEl.style.paddingLeft}static validateInput(t){let e=t?.tagName;if(!(!!t&&typeof t=="object"&&e==="INPUT"&&typeof t.setAttribute=="function")){let s=Object.prototype.toString.call(t);throw new TypeError(`The first argument must be an HTMLInputElement, not ${s}`)}}buildMarkup(t,e){this.#b=t,this.#N=e,this.telInputEl.classList.add("iti__tel-input"),this.telInputEl.hasAttribute("type")||this.telInputEl.setAttribute("type","tel"),this.telInputEl.hasAttribute("autocomplete")||this.telInputEl.setAttribute("autocomplete","tel"),this.telInputEl.hasAttribute("inputmode")||this.telInputEl.setAttribute("inputmode","tel");let i=this.#B();this.#j(i),i.appendChild(this.telInputEl),this.#tt(),this.#st(),this.#et(i),this.ensureDropdownWidthSet()}#B(){let{countrySelectorMode:t,showFlags:e,containerClass:i}=this.#t,s=q({iti:!0,"iti--input-container":!0,"iti--has-country-selector":t!==h.OFF,"iti--show-flags":e,"iti--inline-country-selector":t!==h.FULLSCREEN,[i]:!!i}),o=f("div",{class:s});return this.#A&&o.setAttribute("dir","ltr"),this.telInputEl.before(o),o}#j(t){let{countrySelectorMode:e,separateDialCode:i,showFlags:s}=this.#t,o=e!==h.OFF;if(!o&&!s&&!i)return;this.#m=f("div",{class:`iti__country-container ${c.V_HIDE}`},t),o?(this.#e=f("button",{type:"button",class:"iti__selected-country",[p.EXPANDED]:"false",[p.LABEL]:this.#t.uiTranslations.noCountrySelected,[p.HASPOPUP]:"dialog",[p.CONTROLS]:`iti-${this.#i}__country-selector`},this.#m),this.telInputEl.disabled&&this.#e.setAttribute("disabled","true")):this.#e=f("div",{class:"iti__selected-country"},this.#m);let r=f("div",{class:"iti__selected-country-primary"},this.#e);this.#u=f("div",{class:c.FLAG},r),o&&(this.#o=f("div",{class:"iti__arrow",[p.HIDDEN]:"true"},r)),i&&(this.#y=f("div",{class:"iti__selected-dial-code"},this.#e)),o&&this.#Q()}ensureDropdownWidthSet(){let{matchDropdownWidth:t,countrySelectorMode:e}=this.#t;if(e===h.OFF||!t||this.#s.style.width)return;let i=this.telInputEl.offsetWidth;i>0&&(this.#s.style.width=`${i}px`)}#Q(){let{matchDropdownWidth:t,countrySelectorMode:e,countrySearch:i,uiTranslations:s,containerClass:o}=this.#t,r=e===h.FULLSCREEN,l=this.#$(),a=t?"":"iti--flexible-dropdown-width";if(this.#s=f("div",{id:`iti-${this.#i}__country-selector`,class:`iti__country-selector ${c.HIDE} ${a}`,role:"dialog",[p.MODAL]:"true"}),this.#A&&this.#s.setAttribute("dir","rtl"),i&&this.#Z(),this.#n=f("ul",{class:"iti__country-list",id:`iti-${this.#i}__country-listbox`,role:"listbox",[p.LABEL]:s.countryListAriaLabel},this.#s),this.#it(),i&&this.#Y(),r||(this.#D=this.#ot(),i&&(this.#s.style.height=`${this.#D}px`)),l){let d=q({iti:!0,"iti--detached-country-selector":!0,"iti--fullscreen-popup":r,"iti--inline-country-selector":!r,[o]:!!o});this.#r=f("div",{class:d}),this.#r.appendChild(this.#s),r||this.#x()}else this.#m.appendChild(this.#s)}#$(){let{countrySelectorMode:t,dropdownParent:e}=this.#t;return t===h.FULLSCREEN?document.body:t===h.DROPDOWN?e:null}#Z(){let{uiTranslations:t,searchInputClass:e}=this.#t,i=f("div",{class:"iti__search-input-wrapper"},this.#s);this.#f=f("span",{class:"iti__search-icon",[p.HIDDEN]:"true"},i),this.#f.appendChild(It()),this.#a=f("input",{id:`iti-${this.#i}__search-input`,type:"search",class:`iti__search-input ${e}`,placeholder:t.searchPlaceholder,role:"combobox",[p.EXPANDED]:"true",[p.LABEL]:t.searchPlaceholder,[p.CONTROLS]:`iti-${this.#i}__country-listbox`,[p.AUTOCOMPLETE]:"list",autocomplete:"off"},i),this.#T=f("button",{type:"button",class:`iti__search-clear ${c.HIDE}`,[p.LABEL]:t.clearSearchAriaLabel,tabindex:"-1"},i),this.#T.appendChild(bt(this.#i)),this.#W=f("span",{class:"iti__a11y-text"},this.#s),this.#d=f("div",{class:`iti__no-results ${c.HIDE}`,[p.HIDDEN]:"true"},this.#s),this.#d.textContent=t.searchEmptyState??null}#tt(){this.#m&&(this.#k(),this.#m.classList.remove(c.V_HIDE))}#et(t){let{hiddenInputs:e}=this.#t;if(!e)return;let i=this.telInputEl.getAttribute("name")||"",s=e(i);if(s.phone){let o=this.telInputEl.form?.querySelector(`input[name="${s.phone}"]`);o?this.#c=o:(this.#c=f("input",{type:"hidden",name:s.phone}),t.appendChild(this.#c))}if(s.country){let o=this.telInputEl.form?.querySelector(`input[name="${s.country}"]`);o?this.#l=o:(this.#l=f("input",{type:"hidden",name:s.country}),t.appendChild(this.#l))}}#it(){let t=document.createDocumentFragment();for(let e=0;e<this.#b.length;e++){let i=this.#b[e],s=q({[c.COUNTRY_ITEM]:!0}),o=f("li",{id:`iti-${this.#i}__item-${i.iso2}`,class:s,tabindex:"-1",role:"option",[p.SELECTED]:"false"});o.dataset[R.DIAL_CODE]=i.dialCode,o.dataset[R.ISO2]=i.iso2,this.#w.set(i.iso2,o),this.#t.showFlags&&f("div",{class:`${c.FLAG} iti__${i.iso2}`},o);let r=f("span",{class:"iti__country-name"},o);r.textContent=`${i.name} `;let l=f("span",{class:"iti__dial-code"},r);this.#A&&l.setAttribute("dir","ltr"),l.textContent=`(+${i.dialCode})`,t.appendChild(o)}this.#n.appendChild(t)}#k(){if(this.#e){let t=this.#t.separateDialCode?O.FALLBACK_SELECTED_COUNTRY_WITH_DIAL_WIDTH:O.FALLBACK_SELECTED_COUNTRY_NO_DIAL_WIDTH,i=(this.#e.offsetWidth||this.#nt()||t)+O.INPUT_PADDING_EXTRA_LEFT;this.telInputEl.style.paddingLeft=`${i}px`}}#st(){!this.#e||typeof ResizeObserver>"u"||(this.#H=new ResizeObserver(()=>{this.#e?.offsetWidth&&this.#k()}),this.#H.observe(this.#e))}static#V(){let t;try{t=window.top.document.body}catch{t=document.body}return t}#nt(){if(!this.telInputEl.parentNode)return 0;let t=n.#V(),e=this.telInputEl.parentNode.cloneNode(!1);e.style.visibility="hidden",t.appendChild(e);let i=this.#m.cloneNode();e.appendChild(i);let s=this.#e.cloneNode(!0);i.appendChild(s);let o=s.offsetWidth;return t.removeChild(e),o}#ot(){let t=n.#V();this.#s.classList.remove(c.HIDE);let e=f("div",{class:"iti iti--inline-country-selector"});e.appendChild(this.#s),e.style.visibility="hidden",t.appendChild(e);let i=this.#s.offsetHeight;return t.removeChild(e),e.style.visibility="",this.#s.classList.add(c.HIDE),i>0?i:O.FALLBACK_DROPDOWN_HEIGHT}#Y(){let{uiTranslations:t}=this.#t,e=this.#n.childElementCount;this.#W.textContent=t.searchSummaryAria(e)}#M(t){let e;if(t==="")e=this.#b;else{let i=F.toAscii(t);e=At(this.#b,this.#N,i)}this.#X(e)}prefillSearchWithPlus(){this.#a.value="+",this.#a.focus(),this.#M("")}#U(){let t=this.#a.value.trim();this.#M(t),this.#a.value?this.#T.classList.remove(c.HIDE):this.#T.classList.add(c.HIDE)}#p(){this.#S&&clearTimeout(this.#S),this.#S=setTimeout(()=>{this.#U(),this.#S=null},it.SEARCH_DEBOUNCE_MS)}#v(){this.#a.value="",this.#a.focus(),this.#U()}#P(t){let e=this.#n,i=e.getBoundingClientRect(),s=t.getBoundingClientRect(),o=s.top-i.top+e.scrollTop;s.top<i.top?e.scrollTop=o:s.bottom>i.bottom&&(e.scrollTop=o-i.height+s.height)}#L(t,e=!0){if(this.#h?.classList.remove(c.HIGHLIGHT),t){if(t.classList.add(c.HIGHLIGHT),this.#t.countrySearch){let i=t.getAttribute("id")||"";this.#a.setAttribute(p.ACTIVE_DESCENDANT,i)}e&&this.#P(t),this.#h=t}else this.#h=null}bindHiddenInputSubmitListener(t,e,i){let s=this.telInputEl.form;!s||!this.#c&&!this.#l||s.addEventListener("submit",()=>{this.#c&&(this.#c.value=e()),this.#l&&(this.#l.value=i())},{signal:t})}bindAllInitialCountrySelectorListeners(t,e,i){let s=this.telInputEl.closest("label");s&&s.addEventListener("click",o=>{this.isCountrySelectorOpen()?o.preventDefault():this.telInputEl.focus()},{signal:t}),this.#e.addEventListener("click",()=>{!this.isCountrySelectorOpen()&&!this.telInputEl.disabled&&!this.telInputEl.readOnly&&e()},{signal:t}),this.#m.addEventListener("keydown",o=>{let r=[b.ARROW_UP,b.ARROW_DOWN,b.SPACE,b.ENTER];!this.isCountrySelectorOpen()&&r.includes(o.key)&&(o.preventDefault(),o.stopPropagation(),e()),o.key===b.TAB&&i()},{signal:t})}openCountrySelector(t,e){let{countrySearch:i,dropdownAlwaysOpen:s}=this.#t;if(this.#O=new AbortController,this.ensureDropdownWidthSet(),this.#r)this.#J();else{let r=this.#I(),l=this.telInputEl.offsetHeight+O.DROPDOWN_MARGIN;r?this.#s.style.top=`${l}px`:this.#s.style.bottom=`${l}px`}this.#s.classList.remove(c.HIDE),this.#e.setAttribute(p.EXPANDED,"true");let o=this.#C??this.#n.firstElementChild;o&&this.#L(o),i&&!s&&this.#a.focus(),this.#t.countrySelectorMode===h.FULLSCREEN&&this.#r&&window.visualViewport&&window.visualViewport.addEventListener("resize",()=>{this.#q(),this.#h&&this.#P(this.#h)},{signal:this.#O.signal}),this.#o.classList.add(c.ARROW_UP),this.#G(t,e)}#G(t,e){let i=this.#O.signal;this.#rt(i),this.#g(i,t),this.#t.dropdownAlwaysOpen||this.#K(i,e),this.#F(i,t,e),this.#t.countrySearch&&this.#lt(i),this.#t.countrySelectorMode===h.DROPDOWN&&this.#t.dropdownParent&&!St&&document.addEventListener("scroll",e,{signal:i,capture:!0,passive:!0})}#rt(t){this.#n.addEventListener("mouseover",e=>{let i=e.target?.closest(`.${c.COUNTRY_ITEM}`);i&&this.#L(i,!1)},{signal:t})}#g(t,e){this.#n.addEventListener("click",i=>{let s=i.target?.closest(`.${c.COUNTRY_ITEM}`);s&&e(s)},{signal:t})}#K(t,e){setTimeout(()=>{document.documentElement.addEventListener("click",i=>{this.#s.contains(i.target)||e()},{signal:t})},0)}#F(t,e,i){let s="",o=null,r=l=>{[b.ARROW_UP,b.ARROW_DOWN,b.ENTER,b.ESC].includes(l.key)&&(l.preventDefault(),l.stopPropagation(),l.key===b.ARROW_UP||l.key===b.ARROW_DOWN?this.#z(l.key):l.key===b.ENTER&&!l.isComposing?e(this.#h):l.key===b.ESC&&(i(),this.#e.focus())),!this.#t.countrySearch&&v.HIDDEN_SEARCH_CHAR.test(l.key)&&(l.stopPropagation(),o&&clearTimeout(o),s+=l.key.toLowerCase(),this.#R(s),o=setTimeout(()=>{s=""},it.HIDDEN_SEARCH_RESET_MS))};this.#e?.addEventListener("keydown",r,{signal:t}),this.#s?.addEventListener("keydown",r,{signal:t})}#lt(t){this.#a.addEventListener("input",()=>this.#p(),{signal:t}),this.#T.addEventListener("click",()=>this.#v(),{signal:t})}#R(t){let e=Nt(this.#b,this.#N,t);if(e){let i=this.#w.get(e.iso2);this.#L(i)}}#z(t){let e=t===b.ARROW_UP?this.#h?.previousElementSibling:this.#h?.nextElementSibling;!e&&this.#n.childElementCount>1&&(e=t===b.ARROW_UP?this.#n.lastElementChild:this.#n.firstElementChild),e&&this.#L(e)}#_(t){if(this.#C&&this.#C.dataset[R.ISO2]!==t&&(this.#C.setAttribute(p.SELECTED,"false"),this.#C.querySelector(".iti__country-check")?.remove(),this.#C=null),t&&!this.#C){let e=this.#n.querySelector(`[data-iso2="${t}"]`);e&&(e.setAttribute(p.SELECTED,"true"),f("span",{class:"iti__country-check",[p.HIDDEN]:"true"},e).appendChild(Tt()),this.#C=e,this.#t.dropdownAlwaysOpen&&this.#L(e))}}#X(t){this.#n.replaceChildren();let e=!0;for(let i of t){let s=this.#w.get(i.iso2);s&&(this.#n.appendChild(s),e&&(this.#L(s,!1),e=!1))}e?(this.#L(null),this.#d&&this.#d.classList.remove(c.HIDE)):this.#d&&this.#d.classList.add(c.HIDE),this.#n.scrollTop=0,this.#Y()}closeCountrySelector(){let{countrySearch:t}=this.#t;this.#O.abort(),this.#O=null,this.#s.classList.add(c.HIDE),this.#e.setAttribute(p.EXPANDED,"false"),t&&(this.#a.removeAttribute(p.ACTIVE_DESCENDANT),this.#a.value="",this.#U(),this.#h&&(this.#h.classList.remove(c.HIGHLIGHT),this.#h=null)),this.#o.classList.remove(c.ARROW_UP),this.#r?(this.#r.remove(),this.#r.style.top="",this.#r.style.bottom="",this.#r.style.paddingLeft="",this.#r.style.paddingRight=""):(this.#s.style.top="",this.#s.style.bottom="")}#I(){if(this.#t.dropdownAlwaysOpen)return!0;let t=this.telInputEl.getBoundingClientRect(),e=t.top,i=window.innerHeight-t.bottom;return i>=this.#D||i>=e}#J(){let t=this.#t.countrySelectorMode===h.FULLSCREEN,e=this.#$();if(t){if(window.innerWidth>=O.NARROW_VIEWPORT_WIDTH){let i=this.telInputEl.getBoundingClientRect();this.#r.style.paddingLeft=`${i.left}px`,this.#r.style.paddingRight=`${window.innerWidth-i.right}px`}}else if(!St){let i=this.telInputEl.getBoundingClientRect();this.#r.style.left=`${i.left}px`,this.#I()?this.#r.style.top=`${i.bottom+O.DROPDOWN_MARGIN}px`:(this.#r.style.top="unset",this.#r.style.bottom=`${window.innerHeight-i.top+O.DROPDOWN_MARGIN}px`)}e.appendChild(this.#r)}#x(){let t=`--iti-anchor-${this.#i}`,e=getComputedStyle(this.telInputEl).anchorName;this.telInputEl.style.anchorName=e&&e!=="none"?`${e}, ${t}`:t,this.#r.style.positionAnchor=t}#q(){let t=window.visualViewport;if(!t||!this.#r)return;let e=window.innerHeight-t.height;this.#r.style.bottom=`${e}px`}isCountrySelectorOpen(){return!this.#s.classList.contains(c.HIDE)}setLoading(t){this.#u.classList.toggle(c.LOADING,t)}playStrictRejectAnimation(){if(!this.#t.strictRejectAnimation)return;let t=this.telInputEl.parentElement;t&&(t.classList.remove(c.STRICT_REJECT_ANIMATION),t.offsetWidth,t.classList.add(c.STRICT_REJECT_ANIMATION),t.addEventListener("animationend",()=>t.classList.remove(c.STRICT_REJECT_ANIMATION),{once:!0}))}isLoading(){return this.#u.classList.contains(c.LOADING)}setDisabled(t){this.telInputEl.disabled=t,this.#e&&(t?this.#e.setAttribute("disabled","true"):this.#e.removeAttribute("disabled"))}setReadonly(t){this.telInputEl.readOnly=t,this.#e&&(t?this.#e.setAttribute("disabled","true"):this.#e.removeAttribute("disabled"))}setSelectedCountry(t){let{countrySelectorMode:e,showFlags:i,separateDialCode:s,uiTranslations:o}=this.#t,r=t?.name,l=t?.dialCode,a=t?.iso2??"";if(e!==h.OFF&&this.#_(a),this.#e){let d=a&&i?`${c.FLAG} iti__${a}`:`${c.FLAG} ${c.GLOBE}`,E,y,C=null;a?(y=r,E=o.selectedCountryAriaLabel.replace("${countryName}",r).replace("${dialCode}",`+${l}`),i||(C=rt())):(y=o.noCountrySelected,E=o.noCountrySelected,C=rt()),this.#u.className=d,this.#e.setAttribute("title",y),this.#e.setAttribute(p.LABEL,E),C?this.#u.replaceChildren(C):this.#u.replaceChildren()}if(s){let d=l?`+${l}`:"";this.#y.textContent=d,this.#k()}}destroy(){this.telInputEl.iti=void 0,delete this.telInputEl.dataset[R.INSTANCE_ID],this.#H?.disconnect(),this.telInputEl.style.paddingLeft=this.#E;let t=this.telInputEl.parentNode;t&&(t.before(this.telInputEl),t.remove()),this.#w.clear()}};var Ot=n=>{let{onlyCountries:t,excludeCountries:e}=n;return t?.length?k.filter(i=>t.includes(i.iso2)):e?.length?k.filter(i=>!e.includes(i.iso2)):[...k]},vt=(n,t)=>{let{countryNameLocale:e,countryNameOverrides:i}=t,s;try{typeof Intl<"u"&&typeof Intl.DisplayNames=="function"?s=new Intl.DisplayNames(e,{type:"region"}):s=null}catch(o){console.error(o),s=null}for(let o of n)o.name=i[o.iso2]||s?.of(o.iso2.toUpperCase())||""},Rt=n=>{let t=new Set,e=0,i={},s=(r,l)=>{if(!r||!l)return;l.length>e&&(e=l.length),Object.hasOwn(i,l)||(i[l]=[]);let a=i[l];a.includes(r)||a.push(r)},o=[...n].sort((r,l)=>r.priority-l.priority);for(let r of o){t.has(r.dialCode)||t.add(r.dialCode);for(let l=1;l<r.dialCode.length;l++){let a=r.dialCode.substring(0,l);s(r.iso2,a)}if(s(r.iso2,r.dialCode),r.areaCodes){let l=i[r.dialCode][0];for(let a of r.areaCodes){for(let d=1;d<a.length;d++){let E=a.substring(0,d),y=r.dialCode+E;s(l,y),s(r.iso2,y)}s(r.iso2,r.dialCode+a)}}}return{dialCodes:t,dialCodeMaxLength:e,dialCodeToIso2Map:i}},_t=(n,t)=>{let{countryOrder:e}=t;n.sort((i,s)=>{if(e){let o=e.indexOf(i.iso2),r=e.indexOf(s.iso2),l=o>-1,a=r>-1;if(l||a)return l&&a?o-r:l?-1:1}return i.name.localeCompare(s.name)})};var Xt=new Set(["800","808","870","881","882","883","888","979"]),at=n=>{let t=D(n).slice(0,3);return n.startsWith("+")&&Xt.has(t)};var ut=(n,t,e,i)=>{if(!e||!t)return n;let s=`+${i.dialCode}`,o=n[s.length]===" "||n[s.length]==="-"?s.length+1:s.length;return n.substring(o)},Dt=(n,t,e,i,s)=>{let o=e?e.formatNumberAsYouType(n,i?.iso2):n,r=i?.dialCode;return s&&t.charAt(0)!=="+"&&o.includes(`+${r}`)?(o.split(`+${r}`)[1]||"").trim():o};var wt=(n,t,e,i)=>{if(e===0&&!i)return 0;let s=0;for(let o=0;o<t.length;o++){if(/[+0-9]/.test(t[o])&&s++,s===n&&!i)return o+1;if(i&&s===n+1)return o}return t.length};var Jt=new Set(["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"]),ct=n=>{let t=D(n);if(t.startsWith(V.NANP)&&t.length>=4){let e=t.substring(1,4);return Jt.has(e)}return!1};var qt=0,B=n=>{if(!u.utils)throw new Error(`intlTelInput.utils is required for ${n}(). See: https://intl-tel-input.com/docs/utils`)},Mt=()=>{let n,t;return{promise:new Promise((i,s)=>{n=i,t=s}),resolve:n,reject:t}},j=class n{id;promise;#t;#i;#A;#E;#b;#N;#S;#D;#m;#e=null;#u=null;#y;#o=!0;#s;#f;#a=!1;#T=null;#n;#c;constructor(t,e={}){this.id=qt++,W.validateInput(t);let i=yt(e);this.#i={...J,...i},Ct(this.#i),gt(this.#i),this.#t=new W(t,this.#i,this.id),this.#A=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),this.#f=new F(t.value),this.promise=this.#W(this.#i),this.#E=Ot(this.#i);let{dialCodes:s,dialCodeMaxLength:o,dialCodeToIso2Map:r}=Rt(this.#E);this.#S=s,this.#b=o,this.#N=r,this.#D=new Map(this.#E.map(l=>[l.iso2,l])),this.#r()}#l(){let t=this.#t.telInputEl.value.trim();return this.#f.normalise(t)}#d(t){this.#t.telInputEl.value=this.#f.denormalise(t)}#W(t){let{initialCountry:e,initialCountryLookup:i,loadUtils:s}=t,o=!e&&!!i,r=!!s&&!u.utils;return o&&(this.#n=Mt()),r&&(this.#c=Mt()),Promise.all([this.#n?.promise,this.#c?.promise]).then(()=>{})}#r(){this.#s=new AbortController,this.#C(),this.#t.buildMarkup(this.#E,this.#m),this.#h(),this.#w(),this.#O(),this.#i.dropdownAlwaysOpen&&this.openCountrySelector()}#C(){vt(this.#E,this.#i),_t(this.#E,this.#i),this.#m=Lt(this.#E)}#h(t=!1){let e=this.#t.telInputEl.getAttribute("value"),i=this.#f.normalise(e??""),s=this.#l(),r=i&&i.startsWith("+")&&(!s||!s.startsWith("+"))?i:s,l=this.#_(r),a=ct(r),{initialCountry:d,initialCountryLookup:E}=this.#i,y=!d&&!!E,C=y&&u.autoCountry?u.autoCountry:d,N=y&&!t&&!u.autoCountry,A=x(C);l?a?A?this.#g(C):N||this.#g(dt.ISO2):(A&&this.#g(C),this.#P(r)):A?this.#g(C):N||this.#g(""),r&&this.#v(r)}#w(){this.#Q(),this.#i.countrySelectorMode!==h.OFF&&this.#t.bindAllInitialCountrySelectorListeners(this.#s.signal,()=>this.openCountrySelector(),()=>this.#R()),this.#t.bindHiddenInputSubmitListener(this.#s.signal,()=>this.getNumber(),()=>this.#e?.iso2||"")}#O(){if(this.#c){let{loadUtils:t}=this.#i,e=()=>{u.attachUtils(t).catch(()=>{})};u.documentReady()?e():window.addEventListener("load",e,{signal:this.#s.signal})}this.#n&&(this.#e?this.#n.resolve():this.#H())}async#H(){if(u.autoCountry){this.#q();return}if(this.#t.setLoading(!0),!u.startedLoadingAutoCountry&&(u.startedLoadingAutoCountry=!0,typeof this.#i.initialCountryLookup=="function")){let t;try{let e=await Promise.race([this.#i.initialCountryLookup(),new Promise((s,o)=>{t=setTimeout(()=>o(new Error("intl-tel-input: initialCountryLookup timed out after 10s")),1e4)})]),i=typeof e=="string"?e.toLowerCase():"";if(!x(i)){u.startedLoadingAutoCountry=!1,n.forEachInstance("handleAutoCountryFailure");return}u.autoCountry=i,setTimeout(()=>n.forEachInstance("handleAutoCountryLoaded"))}catch{u.startedLoadingAutoCountry=!1,n.forEachInstance("handleAutoCountryFailure")}finally{t!==void 0&&clearTimeout(t)}}}#B(){this.openCountrySelector(),this.#t.prefillSearchWithPlus()}#j(t){let e=this.#t.telInputEl.selectionStart||0,i=t.substring(0,e-1),s=t.substring(e);return this.#d(i+s),e-1}#Q(){this.#it(),this.#st(),this.#nt()}#$(t){this.#j(t),this.#B()}#Z(t,e){let i=this.#j(t);this.#t.telInputEl.setSelectionRange(i,i),this.#t.playStrictRejectAnimation(),this.#p(S.STRICT_REJECT,{source:"key",rejectedInput:e,reason:"invalid"})}#tt(t,e){let i=this.#t.telInputEl.selectionStart||0,o=t.substring(0,i).replace(v.NON_PLUS_NUMERIC_GLOBAL,"").length,r=this.#I(),l=Dt(r,t,u.utils,this.#e,this.#i.separateDialCode),a=wt(o,l,i,e);this.#d(l),this.#t.telInputEl.setSelectionRange(a,a)}#et(t){if(t.startsWith("+")&&this.#e&&this.#_(t)){let e=ut(t,!0,!0,this.#e);this.#d(e)}}#it(){this.#a=v.ALPHA_UNICODE.test(this.#l()),this.#t.telInputEl.addEventListener("input",this.#k,{signal:this.#s.signal})}#k=t=>{let{strictMode:e,formatAsYouType:i,separateDialCode:s,countrySelectorMode:o,countrySearch:r}=this.#i,l=t?.detail;if(l?.isCountryChange)return;let a=this.#l(),d=t?.inputType===et.PASTE,E=e&&d;if(this.#A&&!d&&t?.data==="+"&&s&&o!==h.OFF&&r){this.#$(a);return}if(this.#A&&!d&&e&&(t?.data===" "||t?.data==="-"||t?.data===".")){this.#Z(a,t.data);return}if(E){if(this.#Y())return;a=this.#l()}this.#P(a)&&this.#x(),!E&&t?.data&&v.NON_PLUS_NUMERIC.test(t.data)||d&&a&&!e?this.#a=!0:v.NON_PLUS_NUMERIC.test(a)||(this.#a=!1),i&&!this.#a&&!l?.isSetNumber&&this.#f.isAscii()&&this.#tt(a,t?.inputType===et.DELETE_FORWARD),s&&this.#et(a)};#st(){let{strictMode:t,separateDialCode:e}=this.#i;!t&&!e||this.#t.telInputEl.addEventListener("keydown",this.#V,{signal:this.#s.signal})}#V=t=>{let{strictMode:e,separateDialCode:i,countrySelectorMode:s,countrySearch:o}=this.#i;if(!t.key||t.key.length!==1||t.altKey||t.ctrlKey||t.metaKey)return;if(i&&s!==h.OFF&&o&&t.key==="+"){t.preventDefault(),this.#B();return}if(!e)return;let r=this.#l(),a=!r.startsWith("+")&&this.#t.telInputEl.selectionStart===0&&t.key==="+",d=this.#f.normalise(t.key),E=/^[0-9]$/.test(d),y=i?E:a||E,C=this.#t.telInputEl,N=C.selectionStart,A=C.selectionEnd,I=r.slice(0,N??void 0),m=r.slice(A??void 0),L=I+d+m,w=this.#X(L),P=!1;u.utils&&this.#u&&(P=u.utils.getCoreNumber(w,this.#e?.iso2).length>this.#u);let Q=this.#G(w)!==null;(!y||P&&!Q&&!a)&&(this.#t.playStrictRejectAnimation(),this.#p(S.STRICT_REJECT,{source:"key",rejectedInput:t.key,reason:y?"max-length":"invalid"}),t.preventDefault())};#nt(){this.#i.strictMode&&this.#t.telInputEl.addEventListener("paste",this.#ot,{signal:this.#s.signal})}#ot=t=>{let e=this.#t.telInputEl,i=this.#l();this.#T={pastedRaw:t.clipboardData?.getData("text")??"",value:i,selectionStart:e.selectionStart??i.length,selectionEnd:e.selectionEnd??i.length}};#Y(){let t=this.#t.telInputEl,e=this.#T;if(this.#T=null,!e)return!1;let i=e.pastedRaw,s=e.value,o=e.selectionStart,r=e.selectionEnd,l=s.slice(0,o),a=s.slice(r),d=this.#e?.iso2,E=this.#f.normalise(i),y=o===0&&r>0,C=!s.startsWith("+")||y,N=E.replace(v.NON_PLUS_NUMERIC_GLOBAL,""),A=N.startsWith("+"),I=N.replace(/\+/g,""),m=A&&C?`+${I}`:I,L=l+m+a,w=m!==E?"invalid":null;if(L.length>30)return this.#t.playStrictRejectAnimation(),this.#p(S.STRICT_REJECT,{source:"paste",rejectedInput:i,reason:"max-length"}),this.#M(e),!0;if(L.length>5&&u.utils){let H=u.utils.getCoreNumber(L,d);for(;H.length===0&&L.length>0;)L=L.slice(0,-1),H=u.utils.getCoreNumber(L,d);if(!H)return this.#t.playStrictRejectAnimation(),this.#p(S.STRICT_REJECT,{source:"paste",rejectedInput:i,reason:"max-length"}),this.#M(e),!0;if(this.#u&&H.length>this.#u)if(r===s.length){let Q=H.length-this.#u;L=L.slice(0,L.length-Q),w="max-length"}else return this.#t.playStrictRejectAnimation(),this.#p(S.STRICT_REJECT,{source:"paste",rejectedInput:i,reason:"max-length"}),this.#M(e),!0}this.#d(L);let P=o+m.length;return t.setSelectionRange(P,P),w&&(E.length>0&&m.length===0&&this.#t.playStrictRejectAnimation(),this.#p(S.STRICT_REJECT,{source:"paste",rejectedInput:i,reason:w})),!1}#M(t){this.#d(t.value),this.#t.telInputEl.setSelectionRange(t.selectionStart,t.selectionEnd)}#U(t){let e=Number(this.#t.telInputEl.getAttribute("maxlength"));return e&&t.length>e?t.substring(0,e):t}#p(t,e={}){let i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e});this.#t.telInputEl.dispatchEvent(i)}openCountrySelector(){this.#t.isCountrySelectorOpen()||(this.#t.openCountrySelector(t=>this.#lt(t),()=>this.#R()),this.#p(S.OPEN_COUNTRY_SELECTOR))}#v(t){let{numberDisplayFormat:e,separateDialCode:i}=this.#i,s=t;if(u.utils&&this.#e){let o=at(t),r=!s.startsWith("+")&&!i,l=e===g.NATIONAL&&!o||r,a;l?a=g.NATIONAL:e===g.E164&&!o?a=g.E164:a=g.INTERNATIONAL,s=u.utils.formatNumber(s,this.#e?.iso2,a)}s=this.#J(s),this.#d(s)}#P(t){let e=this.#G(t);return e!==null?this.#g(e):!1}#L(t){let e=this.#e?.dialCode,i=this.#e?.nationalPrefix;if(t.startsWith("+")||!e)return t;let r=i&&t.startsWith(i)&&!this.#i.separateDialCode?t.substring(1):t;return`+${e}${r}`}#G(t){let e=t.indexOf("+"),i=e>0?t.substring(e):t,s=this.#e?.iso2;i=this.#L(i);let o=this.#_(i,!0),r=D(i);if(o){let l=D(o),a=this.#N[l];return a.length===1?a[0]===s?null:a[0]:this.#rt(a,l,r)}else if(i.startsWith("+")&&r.length){let l=this.#e?.dialCode||"";return l&&l.startsWith(r)?null:""}else if((!i||i==="+")&&!s&&this.#y)return this.#y;return null}#rt(t,e,i){let s=this.#e?.iso2,o=this.#e?.dialCode;if(!s&&this.#y&&t.includes(this.#y))return this.#y;if(o===V.NANP&&ct(i))return null;let l=this.#e?.areaCodes,a=this.#e?.priority;if(l){let N=l.map(A=>`${o}${A}`);for(let A of N)if(i.startsWith(A))return null}let E=l&&!(a===0)&&i.length>e.length,y=s&&t.includes(s)&&!E,C=s===t[0];return!y&&!C?t[0]:null}#g(t){let e=this.#e?.iso2||"";return this.#e=t?this.#D.get(t):null,this.#e&&(this.#y=this.#e.iso2),this.#t.setSelectedCountry(this.#e),this.#F(),this.#K(),e!==t}#K(){let{strictMode:t,placeholderNumberType:e,allowedNumberTypes:i}=this.#i;if(!t||!u.utils)return;let s=this.#e?.iso2;if(!s){this.#u=null;return}let o=u.utils.getExampleNumber(s,e,g.E164),r=o;for(;u.utils.isValidNumber(o,s,i);)r=o,o+="0";let l=u.utils.getCoreNumber(r,s);this.#u=l.length,s==="by"&&(this.#u=l.length+1)}#F(){let{placeholderNumberPolicy:t,placeholderNumberType:e,numberDisplayFormat:i,customPlaceholder:s}=this.#i,o=t===_.AGGRESSIVE||!this.#t.hadInitialPlaceholder&&t===_.POLITE;if(!u.utils||!o)return;let r=this.#e?u.utils.getExampleNumber(this.#e.iso2,e,i):"";r=this.#J(r),typeof s=="function"&&(r=s(r,this.#e)),this.#t.telInputEl.setAttribute("placeholder",r)}#lt(t){if(!t)return;let e=t.dataset[R.ISO2],i=this.#g(e);this.#R();let s=t.dataset[R.DIAL_CODE];this.#z(s);let o=this.#l();this.#v(o),this.#t.telInputEl.focus(),i&&(this.#x(),this.#p(S.INPUT,{isCountryChange:!0}))}closeCountrySelector(){this.#R()}#R(t){!this.#t.isCountrySelectorOpen()||this.#i.dropdownAlwaysOpen&&!t||(this.#t.closeCountrySelector(),this.#p(S.CLOSE_COUNTRY_SELECTOR))}#z(t){let e=this.#l();if(!e.startsWith("+"))return;let i=`+${t}`,s=this.#_(e),o;s?o=e.replace(s,i):o=i,this.#d(o)}#_(t,e){if(!t.startsWith("+"))return"";let i="",s="",o=!1;for(let r=0;r<t.length;r++){let l=t.charAt(r);if(!/[0-9]/.test(l))continue;if(s+=l,!!!this.#N[s])break;if(this.#S.has(s)){if(i=t.substring(0,r+1),o=!0,!e)break}else e&&o&&(i=t.substring(0,r+1));if(s.length===this.#b)break}return i}#X(t){let e=this.#e?.dialCode,i=D(t);return(this.#i.separateDialCode&&!t.startsWith("+")&&e&&i?`+${e}`:"")+t}#I(){let t=this.#l();return this.#X(t)}#J(t){let e=!!this.#_(t),i=ut(t,e,this.#i.separateDialCode,this.#e);return this.#U(i)}#x(){this.#p(S.COUNTRY_CHANGE,this.#e??null)}#q(){if(!this.#n||!u.autoCountry)return;if(!this.#o){this.#n.resolve();return}let t=document.activeElement===this.#t.telInputEl,e=!!this.#l();this.#t.isLoading()&&!(t&&e)?this.setSelectedCountry(u.autoCountry):this.#y=u.autoCountry,this.#t.setLoading(!1),this.#n.resolve()}#ut(){if(!this.#o){this.#n?.reject();return}this.#h(!0),this.#t.setLoading(!1),this.#n?.reject()}#ct(){if(!this.#o){this.#c?.resolve();return}if(!u.utils){this.#c?.resolve();return}let t=this.#l(),e=document.activeElement===this.#t.telInputEl;t&&!e&&this.#v(t),this.#e&&(this.#F(),this.#K()),this.#c?.resolve()}#dt(t){if(!this.#o){this.#c?.reject(t);return}this.#c?.reject(t)}destroy(){this.#o&&(this.#o=!1,this.#i.countrySelectorMode!==h.OFF&&this.#R(!0),this.#s.abort(),this.#t.destroy(),u.instances.delete(String(this.id)))}isActive(){return this.#o}getExtension(){return this.#o?(B("getExtension"),u.utils.getExtension(this.#I(),this.#e?.iso2)):""}getNumber(t){if(!this.#o)return"";B("getNumber");let e=this.#e?.iso2,i=this.#I(),s=u.utils.formatNumber(i,e,t);return this.#f.denormalise(s)}getNumberType(){return this.#o?(B("getNumberType"),u.utils.getNumberType(this.#I(),this.#e?.iso2)):null}getSelectedCountry(){return this.#e??null}getValidationError(){if(!this.#o)return null;B("getValidationError");let t=this.#e?.iso2;return u.utils.getValidationError(this.#I(),t)}isValidNumber(){if(!this.#o)return null;B("isValidNumber");let t=this.#e?.dialCode,e=this.#e?.iso2,i=this.#I(),s=u.utils.getCoreNumber(i,e);if(s){if(t===Y.DIAL_CODE&&s[0]===Y.MOBILE_PREFIX&&s.length!==Y.MOBILE_CORE_LENGTH)return!1;if(!v.ALPHA_UNICODE.test(i)&&t){let r=i.startsWith("+")?i.slice(1+t.length):i,l=D(r).length;if(s.length>l)return!1}}return this.#at("possible")}isValidNumberPrecise(){return this.#o?(B("isValidNumberPrecise"),this.#at("precise")):null}#at(t){let{allowNumberExtensions:e,allowPhonewords:i,allowedNumberTypes:s}=this.#i,o=this.#e?.iso2,r=this.#I();return!this.#e&&!at(r)||!(t==="precise"?u.utils.isValidNumberPrecise:u.utils.isValidNumber)(r,o,s)?!1:v.ALPHA_UNICODE.test(r)?!!u.utils.getExtension(r,o)?e:i:!0}setSelectedCountry(t){if(!this.#o)return;let e=t?.toLowerCase();if(!x(e))throw new Error(`Invalid iso2 code: '${e}'`);let i=this.#e?.iso2;if(!(t&&e!==i||!t&&i))return;this.#g(e),this.#z(this.#e?.dialCode||"");let o=this.#l();this.#v(o),this.#x(),this.#p(S.INPUT,{isCountryChange:!0})}setNumber(t){if(!this.#o)return;let e=this.#f.normalise(t),i=this.#P(e);this.#v(e),i&&this.#x(),this.#p(S.INPUT,{isSetNumber:!0})}setPlaceholderNumberType(t){this.#o&&(this.#i.placeholderNumberType=t,this.#F())}setDisabled(t){this.#o&&this.#t.setDisabled(t)}setReadonly(t){this.#o&&this.#t.setReadonly(t)}static forEachInstance(t,...e){let i=[...u.instances.values()],s=e[0];i.forEach(o=>{if(o instanceof n)switch(t){case"handleUtilsLoaded":o.#ct();break;case"handleUtilsFailure":o.#dt(s);break;case"handleAutoCountryLoaded":o.#q();break;case"handleAutoCountryFailure":o.#ut();break}})}},Qt=async n=>{if(u.utils||u.startedLoadingUtils)return null;if(typeof n!="function")throw new TypeError(`The argument passed to attachUtils must be a function that returns a promise for the utils module, not ${typeof n}`);u.startedLoadingUtils=!0;try{let e=(await n())?.default;if(!e||typeof e!="object")throw new TypeError("The loader function passed to attachUtils did not resolve to a module object with utils as its default export.");return u.utils=e,j.forEachInstance("handleUtilsLoaded"),!0}catch(t){throw j.forEachInstance("handleUtilsFailure",t),t}},u=Object.assign((n,t)=>{let e=new j(n,t);return u.instances.set(String(e.id),e),n.iti=e,e},{defaults:J,documentReady:()=>document.readyState==="complete",getAllCountries:()=>k,getInstance:n=>{let t=n.dataset[R.INSTANCE_ID];return t?u.instances.get(t)??null:null},instances:new Map,attachUtils:Qt,startedLoadingUtils:!1,startedLoadingAutoCountry:!1,version:"29.0.0",NUMBER_FORMAT:g,NUMBER_TYPE:M,VALIDATION_ERROR:z,PLACEHOLDER_POLICY:_,COUNTRY_SELECTOR_MODE:h}),Zt=u;return Ft(te);})();
|
|
6
|
+
"use strict";var _factory=(()=>{var Z=Object.defineProperty;var Pt=Object.getOwnPropertyDescriptor;var xt=Object.getOwnPropertyNames;var Ht=Object.prototype.hasOwnProperty;var kt=(n,t)=>{for(var e in t)Z(n,e,{get:t[e],enumerable:!0})},Ut=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of xt(t))!Ht.call(n,s)&&s!==e&&Z(n,s,{get:()=>t[s],enumerable:!(i=Pt(t,s))||i.enumerable});return n};var Ft=n=>Ut(Z({},"__esModule",{value:!0}),n);var te={};kt(te,{COUNTRY_SELECTOR_MODE:()=>h,Iti:()=>j,NUMBER_FORMAT:()=>g,NUMBER_TYPE:()=>M,PLACEHOLDER_POLICY:()=>_,VALIDATION_ERROR:()=>z,default:()=>Zt});var Wt=[["af","93",0,null,"0"],["ax","358",1,["18","4"],"0"],["al","355",0,null,"0"],["dz","213",0,null,"0"],["as","1",5,["684"],"1"],["ad","376"],["ao","244"],["ai","1",6,["264"],"1"],["ag","1",7,["268"],"1"],["ar","54",0,null,"0"],["am","374",0,null,"0"],["aw","297"],["ac","247"],["au","61",0,["4"],"0"],["at","43",0,null,"0"],["az","994",0,null,"0"],["bs","1",8,["242"],"1"],["bh","973"],["bd","880",0,null,"0"],["bb","1",9,["246"],"1"],["by","375",0,null,"8"],["be","32",0,null,"0"],["bz","501"],["bj","229"],["bm","1",10,["441"],"1"],["bt","975"],["bo","591",0,null,"0"],["ba","387",0,null,"0"],["bw","267"],["br","55",0,null,"0"],["io","246"],["vg","1",11,["284"],"1"],["bn","673"],["bg","359",0,null,"0"],["bf","226"],["bi","257"],["kh","855",0,null,"0"],["cm","237"],["ca","1",1,["204","226","236","249","250","257","263","289","306","343","354","365","367","368","382","403","416","418","428","431","437","438","450","468","474","506","514","519","548","579","581","584","587","604","613","639","647","672","683","705","709","742","753","778","780","782","807","819","825","867","873","879","902","905","942"],"1"],["cv","238"],["bq","599",1,["3","4","7"]],["ky","1",12,["345"],"1"],["cf","236"],["td","235"],["cl","56"],["cn","86",0,null,"0"],["cx","61",2,["4","89164"],"0"],["cc","61",1,["4","89162"],"0"],["co","57",0,null,"0"],["km","269"],["cg","242"],["cd","243",0,null,"0"],["ck","682"],["cr","506"],["ci","225"],["hr","385",0,null,"0"],["cu","53",0,null,"0"],["cw","599",0],["cy","357"],["cz","420"],["dk","45"],["dj","253"],["dm","1",13,["767"],"1"],["do","1",2,["809","829","849"],"1"],["ec","593",0,null,"0"],["eg","20",0,null,"0"],["sv","503"],["gq","240"],["er","291",0,null,"0"],["ee","372"],["sz","268"],["et","251",0,null,"0"],["fk","500"],["fo","298"],["fj","679"],["fi","358",0,["4"],"0"],["fr","33",0,null,"0"],["gf","594",0,null,"0"],["pf","689"],["ga","241"],["gm","220"],["ge","995",0,null,"0"],["de","49",0,null,"0"],["gh","233",0,null,"0"],["gi","350"],["gr","30"],["gl","299"],["gd","1",14,["473"],"1"],["gp","590",0,null,"0"],["gu","1",15,["671"],"1"],["gt","502"],["gg","44",1,["1481","7781","7839","7911"],"0"],["gn","224"],["gw","245"],["gy","592"],["ht","509"],["hn","504"],["hk","852"],["hu","36",0,null,"06"],["is","354"],["in","91",0,null,"0"],["id","62",0,null,"0"],["ir","98",0,null,"0"],["iq","964",0,null,"0"],["ie","353",0,null,"0"],["im","44",2,["1624","74576","7524","7624","7924"],"0"],["il","972",0,null,"0"],["it","39",0,["3"]],["jm","1",4,["658","876"],"1"],["jp","81",0,null,"0"],["je","44",3,["1534","7509","7700","7797","7829","7937"],"0"],["jo","962",0,null,"0"],["kz","7",1,["33","7"],"8"],["ke","254",0,null,"0"],["ki","686",0,null,"0"],["xk","383",0,null,"0"],["kw","965"],["kg","996",0,null,"0"],["la","856",0,null,"0"],["lv","371"],["lb","961",0,null,"0"],["ls","266"],["lr","231",0,null,"0"],["ly","218",0,null,"0"],["li","423",0,null,"0"],["lt","370",0,null,"0"],["lu","352"],["mo","853"],["mg","261",0,null,"0"],["mw","265",0,null,"0"],["my","60",0,null,"0"],["mv","960"],["ml","223"],["mt","356"],["mh","692",0,null,"1"],["mq","596",0,null,"0"],["mr","222"],["mu","230"],["yt","262",1,["269","639"],"0"],["mx","52"],["fm","691"],["md","373",0,null,"0"],["mc","377",0,null,"0"],["mn","976",0,null,"0"],["me","382",0,null,"0"],["ms","1",16,["664"],"1"],["ma","212",0,["6","7"],"0"],["mz","258"],["mm","95",0,null,"0"],["na","264",0,null,"0"],["nr","674"],["np","977",0,null,"0"],["nl","31",0,null,"0"],["nc","687"],["nz","64",0,null,"0"],["ni","505"],["ne","227"],["ng","234",0,null,"0"],["nu","683"],["nf","672"],["kp","850",0,null,"0"],["mk","389",0,null,"0"],["mp","1",17,["670"],"1"],["no","47",0,["4","9"]],["om","968"],["pk","92",0,null,"0"],["pw","680"],["ps","970",0,null,"0"],["pa","507"],["pg","675"],["py","595",0,null,"0"],["pe","51",0,null,"0"],["ph","63",0,null,"0"],["pl","48"],["pt","351"],["pr","1",3,["787","939"],"1"],["qa","974"],["re","262",0,null,"0"],["ro","40",0,null,"0"],["ru","7",0,["33"],"8"],["rw","250",0,null,"0"],["ws","685"],["sm","378"],["st","239"],["sa","966",0,null,"0"],["sn","221"],["rs","381",0,null,"0"],["sc","248"],["sl","232",0,null,"0"],["sg","65"],["sx","1",21,["721"],"1"],["sk","421",0,null,"0"],["si","386",0,null,"0"],["sb","677"],["so","252",0,null,"0"],["za","27",0,null,"0"],["kr","82",0,null,"0"],["ss","211",0,null,"0"],["es","34"],["lk","94",0,null,"0"],["bl","590",1,null,"0"],["sh","290"],["kn","1",18,["869"],"1"],["lc","1",19,["758"],"1"],["mf","590",2,null,"0"],["pm","508",0,null,"0"],["vc","1",20,["784"],"1"],["sd","249",0,null,"0"],["sr","597"],["sj","47",1,["4","79","9"]],["se","46",0,null,"0"],["ch","41",0,null,"0"],["sy","963",0,null,"0"],["tw","886",0,null,"0"],["tj","992"],["tz","255",0,null,"0"],["th","66",0,null,"0"],["tl","670"],["tg","228"],["tk","690"],["to","676"],["tt","1",22,["868"],"1"],["tn","216"],["tr","90",0,null,"0"],["tm","993",0,null,"8"],["tc","1",23,["649"],"1"],["tv","688"],["vi","1",24,["340"],"1"],["ug","256",0,null,"0"],["ua","380",0,null,"0"],["ae","971",0,null,"0"],["gb","44",0,null,"0"],["us","1",0,null,"1"],["uy","598",0,null,"0"],["uz","998"],["vu","678"],["va","39",1,["06698","3"]],["ve","58",0,null,"0"],["vn","84",0,null,"0"],["wf","681"],["eh","212",1,["5288","5289","6","7"],"0"],["ye","967",0,null,"0"],["zm","260",0,null,"0"],["zw","263",0,null,"0"]],tt=[];for(let n of Wt)tt.push({name:"",iso2:n[0],dialCode:n[1],priority:n[2]||0,areaCodes:n[3]||null,nationalPrefix:n[4]||null});var Bt=new Set(tt.map(n=>n.iso2)),x=n=>Bt.has(n),k=tt;var S={OPEN_COUNTRY_SELECTOR:"open:countryselector",CLOSE_COUNTRY_SELECTOR:"close:countryselector",COUNTRY_CHANGE:"countrychange",INPUT:"input",STRICT_REJECT:"strict:reject"},c={HIDE:"iti__hide",V_HIDE:"iti__v-hide",ARROW_UP:"iti__arrow--up",GLOBE:"iti__globe",FLAG:"iti__flag",LOADING:"iti__loading",COUNTRY_ITEM:"iti__country",HIGHLIGHT:"iti__highlight",STRICT_REJECT_ANIMATION:"iti__strict-reject-animation"},b={ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",SPACE:" ",ENTER:"Enter",ESC:"Escape",TAB:"Tab"},et={PASTE:"insertFromPaste",DELETE_FORWARD:"deleteContentForward"},v={ALPHA_UNICODE:/\p{L}/u,NON_PLUS_NUMERIC:/[^+0-9]/,NON_PLUS_NUMERIC_GLOBAL:/[^+0-9]/g,HIDDEN_SEARCH_CHAR:/^[a-zA-ZÀ-ÿа-яА-Я ]$/},it={SEARCH_DEBOUNCE_MS:100,HIDDEN_SEARCH_RESET_MS:1e3,NEXT_TICK:0},O={NARROW_VIEWPORT_WIDTH:500,FALLBACK_SELECTED_COUNTRY_WITH_DIAL_WIDTH:78,FALLBACK_SELECTED_COUNTRY_NO_DIAL_WIDTH:42,INPUT_PADDING_EXTRA_LEFT:6,DROPDOWN_MARGIN:3,FALLBACK_DROPDOWN_HEIGHT:200},V={PLUS:"+",NANP:"1"},Y={ISO2:"gb",DIAL_CODE:"44",MOBILE_PREFIX:"7",MOBILE_CORE_LENGTH:10},dt={ISO2:"us",DIAL_CODE:"1"},_={AGGRESSIVE:"AGGRESSIVE",POLITE:"POLITE",OFF:"OFF"},G=["OFF","DROPDOWN","FULLSCREEN","AUTO"],jt=["E164","INTERNATIONAL","NATIONAL","RFC3966"],U=["FIXED_LINE","MOBILE","FIXED_LINE_OR_MOBILE","TOLL_FREE","PREMIUM_RATE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL","UNKNOWN"],$t=["IS_POSSIBLE","INVALID_COUNTRY_CODE","TOO_SHORT","TOO_LONG","IS_POSSIBLE_LOCAL_ONLY","INVALID_LENGTH"],K=n=>Object.fromEntries(n.map(t=>[t,t])),g=K(jt),M=K(U),z=K($t),h=K(G),R={ISO2:"iso2",DIAL_CODE:"dialCode",INSTANCE_ID:"intlTelInputId"},p={EXPANDED:"aria-expanded",LABEL:"aria-label",SELECTED:"aria-selected",ACTIVE_DESCENDANT:"aria-activedescendant",HASPOPUP:"aria-haspopup",CONTROLS:"aria-controls",HIDDEN:"aria-hidden",AUTOCOMPLETE:"aria-autocomplete",MODAL:"aria-modal"};var Vt={selectedCountryAriaLabel:"Change country for phone number, currently selected ${countryName} (${dialCode})",noCountrySelected:"Select country for phone number",countryListAriaLabel:"List of countries",searchPlaceholder:"Search",clearSearchAriaLabel:"Clear search",searchEmptyState:"No results found",searchSummaryAria(n){return n===0?"No results found":n===1?"1 result found":`${n} results found`}},ht=Vt;var nt=n=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(n).matches,mt=()=>nt(`(max-width: ${O.NARROW_VIEWPORT_WIDTH}px)`),Yt=()=>{if(typeof navigator<"u"&&typeof window<"u"){let n=nt("(max-height: 600px)"),t=nt("(pointer: coarse)");if(mt()||t&&n)return h.FULLSCREEN}return h.DROPDOWN},J={countrySelectorMode:h.AUTO,allowedNumberTypes:[M.MOBILE,M.FIXED_LINE],allowNumberExtensions:!1,allowPhonewords:!1,containerClass:"",countryNameLocale:"en",countryNameOverrides:{},countryOrder:null,countrySearch:!0,customPlaceholder:null,dropdownAlwaysOpen:!1,dropdownParent:null,excludeCountries:null,matchDropdownWidth:!0,formatAsYouType:!0,hiddenInputs:null,uiTranslations:{},initialCountry:"",initialCountryLookup:null,loadUtils:null,numberDisplayFormat:g.INTERNATIONAL,onlyCountries:null,placeholderNumberPolicy:_.POLITE,placeholderNumberType:M.MOBILE,searchInputClass:"",separateDialCode:!0,strictRejectAnimation:!0,showFlags:!0,strictMode:!0},Et=n=>JSON.stringify(n),st=n=>!!n&&typeof n=="object"&&!Array.isArray(n),Gt=n=>typeof n=="function",Kt=n=>{if(!n||typeof n!="object")return!1;let t=n;return t.nodeType===1&&typeof t.tagName=="string"&&typeof t.appendChild=="function"},pt=new Set(Object.values(_)),X=n=>{console.warn(`[intl-tel-input] ${n}`)},T=(n,t,e)=>{X(`Option '${n}' must be ${t}; got ${Et(e)}. Ignoring.`)},ft=(n,t)=>{let e="an array of iso2 country code strings";if(!Array.isArray(t))return T(n,e,t),!1;let i=[];for(let s of t){if(typeof s!="string")return T(n,e,t),!1;let o=s.toLowerCase();x(o)?i.push(s):X(`Invalid iso2 code in '${n}': '${s}'. Skipping.`)}return i},yt=n=>{if(n===void 0)return{};if(!st(n)){let e=`The second argument must be an options object; got ${Et(n)}. Using defaults.`;return X(e),{}}let t={};for(let[e,i]of Object.entries(n)){if(!Object.hasOwn(J,e)){X(`Unknown option '${e}'. Ignoring.`);continue}switch(e){case"allowNumberExtensions":case"allowPhonewords":case"countrySearch":case"dropdownAlwaysOpen":case"matchDropdownWidth":case"formatAsYouType":case"showFlags":case"separateDialCode":case"strictMode":case"strictRejectAnimation":if(typeof i!="boolean"){T(e,"a boolean",i);break}t[e]=i;break;case"countrySelectorMode":if(typeof i!="string"||!G.includes(i)){T("countrySelectorMode",`one of ${G.map(s=>`"${s}"`).join(", ")}`,i);break}t[e]=i;break;case"numberDisplayFormat":if(typeof i!="string"||i===g.RFC3966||!(i===g.E164||i===g.INTERNATIONAL||i===g.NATIONAL)){T("numberDisplayFormat",'one of "E164", "INTERNATIONAL", "NATIONAL"',i);break}t[e]=i;break;case"placeholderNumberPolicy":if(typeof i!="string"||!pt.has(i)){let s=Array.from(pt).join(", ");T("placeholderNumberPolicy",`one of ${s}`,i);break}t[e]=i;break;case"containerClass":case"searchInputClass":case"countryNameLocale":if(typeof i!="string"){T(e,"a string",i);break}t[e]=i;break;case"countryOrder":{if(i===null)t[e]=i;else{let s=ft(e,i);s!==!1&&(t[e]=s)}break}case"customPlaceholder":case"hiddenInputs":case"initialCountryLookup":case"loadUtils":if(i!==null&&!Gt(i)){T(e,"a function or null",i);break}t[e]=i;break;case"dropdownParent":if(i!==null&&!Kt(i)){T("dropdownParent","an HTMLElement or null",i);break}t[e]=i;break;case"excludeCountries":case"onlyCountries":{if(i===null)t[e]=i;else{let s=ft(e,i);s!==!1&&(t[e]=s)}break}case"uiTranslations":if(i&&!st(i)){T("uiTranslations","an object",i);break}t[e]=i;break;case"countryNameOverrides":if(i&&!st(i)){T("countryNameOverrides","an object",i);break}t[e]=i;break;case"initialCountry":{if(typeof i!="string"){T("initialCountry","a string",i);break}let s=i.toLowerCase();if(s&&!x(s)){T("initialCountry","a valid iso2 country code",i);break}t[e]=i;break}case"placeholderNumberType":if(typeof i!="string"||!U.includes(i)){let s=U.join(", ");T("placeholderNumberType",`one of ${s}`,i);break}t[e]=i;break;case"allowedNumberTypes":if(i!==null){if(!Array.isArray(i)){T("allowedNumberTypes","an array of number types or null",i);break}let s=!0;for(let o of i)if(typeof o!="string"||!U.includes(o)){let r=U.join(", ");T("allowedNumberTypes",`an array of valid number types (${r})`,o),s=!1;break}s&&(t[e]=i)}else t[e]=null;break}}return t},Ct=n=>{n.initialCountry&&(n.initialCountry=n.initialCountry.toLowerCase()),n.onlyCountries?.length&&(n.onlyCountries=n.onlyCountries.map(t=>t.toLowerCase())),n.excludeCountries?.length&&(n.excludeCountries=n.excludeCountries.map(t=>t.toLowerCase())),n.countryOrder&&(n.countryOrder=n.countryOrder.map(t=>t.toLowerCase()))},gt=n=>{n.countrySelectorMode===h.AUTO&&(n.countrySelectorMode=Yt()),n.dropdownAlwaysOpen&&(n.countrySelectorMode=h.DROPDOWN),n.countrySelectorMode===h.FULLSCREEN?n.matchDropdownWidth=!1:mt()&&(n.matchDropdownWidth=!0),n.onlyCountries?.length===1&&(n.initialCountry=n.onlyCountries[0]),n.separateDialCode&&n.numberDisplayFormat===g.NATIONAL&&(n.numberDisplayFormat=g.INTERNATIONAL),n.countrySelectorMode!==h.OFF&&!n.showFlags&&!n.separateDialCode&&n.numberDisplayFormat===g.NATIONAL&&(n.numberDisplayFormat=g.INTERNATIONAL),n.uiTranslations={...ht,...n.uiTranslations}};var D=n=>n.replace(/\D/g,""),ot=(n="")=>n.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase();var q=n=>Object.keys(n).filter(t=>!!n[t]).join(" "),f=(n,t,e)=>{let i=document.createElement(n);return t&&Object.entries(t).forEach(([s,o])=>i.setAttribute(s,o)),e&&e.appendChild(i),i};var zt="http://www.w3.org/2000/svg",$=([n,t,e])=>{let i=document.createElementNS(zt,n);if(t)for(let s in t)i.setAttribute(s,String(t[s]));if(e)for(let s of e)i.appendChild($(s));return i},It=()=>$(["svg",{class:"iti__search-icon-svg",width:14,height:14,viewBox:"0 0 24 24",focusable:"false",[p.HIDDEN]:"true"},[["circle",{cx:11,cy:11,r:7}],["line",{x1:21,y1:21,x2:16.65,y2:16.65}]]]),bt=n=>{let t=`iti-${n}-clear-mask`;return $(["svg",{class:"iti__search-clear-svg",width:12,height:12,viewBox:"0 0 16 16",[p.HIDDEN]:"true",focusable:"false"},[["mask",{id:t,maskUnits:"userSpaceOnUse"},[["rect",{width:16,height:16,fill:"white"}],["path",{d:"M5.2 5.2 L10.8 10.8 M10.8 5.2 L5.2 10.8",stroke:"black","stroke-linecap":"round",class:"iti__search-clear-x"}]]],["circle",{cx:8,cy:8,r:8,class:"iti__search-clear-bg",mask:`url(#${t})`}]]])},Tt=()=>$(["svg",{class:"iti__country-check-svg",width:14,height:14,viewBox:"0 0 16 16",fill:"currentColor",focusable:"false",[p.HIDDEN]:"true"},[["path",{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"}]]]),rt=()=>$(["svg",{width:256,height:256,viewBox:"0 0 512 512",class:"iti__globe-svg"},[["path",{d:"M508 213a240 240 0 0 0-449-87l-2 5-2 5c-8 14-13 30-17 46a65 65 0 0 1 56 4c16-10 35-19 56-27l9-3c-6 23-10 48-10 74h-16l4 6c3 4 5 8 6 13h6c0 22 3 44 8 65l2 10-25-10-4 5 12 18 9 3 6 2 8 3 9 26 1 2 16-7h1l-5-13-1-2c24 6 49 9 75 10v26l11 10 7 7v-30l1-13c22 0 44-3 65-8l10-2-21 48-1 1a317 317 0 0 1-14 23l-21 5h-2c6 16 7 33 1 50a240 240 0 0 0 211-265m-401-56-11 6c19-44 54-79 98-98-11 20-21 44-29 69-21 6-40 15-58 23m154 182v4c-29-1-57-6-81-13-7-25-12-52-13-81h94zm0-109h-94c1-29 6-56 13-81 24-7 52-12 81-13zm0-112c-22 1-44 4-65 8l-10 2 12-30 9-17 1-2a332 332 0 0 1 13-23c13-4 26-6 40-7zm187 69 6 4c4 12 6 25 6 38v1h-68c-1-26-4-51-10-74l48 20 1 1 14 8zm-14-44 10 20c-20-11-43-21-68-29-8-25-18-49-29-69 37 16 67 44 87 78M279 49h1c13 1 27 3 39 7l14 23 1 2a343 343 0 0 1 12 26l2 5 6 16c-23-6-48-9-74-10h-1zm0 87h1c29 1 56 6 81 13 7 24 12 51 12 80v1h-94zm2 207h-2v-94h95c-1 29-6 56-13 81-24 7-51 12-80 13m86 60-20 10c11-20 21-43 29-68 25-8 48-18 68-29-16 37-43 67-77 87m87-115-7 5-16 9-2 1a337 337 0 0 1-47 21c6-24 9-49 10-75h68c0 13-2 27-6 39"}],["path",{d:"m261 428-2-2-22-21a40 40 0 0 0-32-11h-1a37 37 0 0 0-18 8l-1 1-4 2-2 2-5 4c-9-3-36-31-47-44s-32-45-34-55l3-2a151 151 0 0 0 11-9v-1a39 39 0 0 0 5-48l-3-3-11-19-3-4-5-7h-1l-3-3-4-3-5-2a35 35 0 0 0-16-3h-5c-4 1-14 5-24 11l-4 2-4 3-4 2c-9 8-17 17-18 27a380 380 0 0 0 212 259h3c12 0 25-10 36-21l10-12 6-11a39 39 0 0 0-8-40"}]]]);var lt=n=>ot(n).replace(/[^\p{L}]+/gu," ").trim(),Lt=n=>{let t=new Map;for(let e of n){let i=lt(e.name),s=i.split(" ").filter(Boolean),o=s.map(r=>r[0]||"").join("");t.set(e.iso2,{normalisedName:i,words:s,initials:o,dialCodePlus:`+${e.dialCode}`})}return t},At=(n,t,e)=>{let i=ot(e),s=lt(e),o=i!==""&&s==="",r=[],l=[],a=[],d=[],E=[],y=[],C=[];for(let I of n){let m=t.get(I.iso2);I.iso2===i?r.push(I):!o&&m.normalisedName.startsWith(s)?l.push(I):!o&&m.normalisedName.includes(s)?a.push(I):i===I.dialCode||i===m.dialCodePlus?d.push(I):m.dialCodePlus.includes(i)?E.push(I):m.initials.includes(i)&&y.push(I)}let N=s.split(" ").filter(Boolean);if(N.length>1&&r.length===0&&l.length===0&&a.length===0){let I=new Set([...d.map(m=>m.iso2),...E.map(m=>m.iso2),...y.map(m=>m.iso2)]);for(let m of n){if(I.has(m.iso2))continue;let L=t.get(m.iso2);N.some(w=>L.words.some(P=>P.startsWith(w)))&&C.push(m)}}let A=(I,m)=>I.priority-m.priority;return[...r,...l,...a,...d.sort(A),...E.sort(A),...y,...C]},Nt=(n,t,e)=>{let i=lt(e);for(let s of n){let{normalisedName:o}=t.get(s.iso2);if(o.startsWith(i))return s}return null};var F=class n{#t;static toAscii(t){return t?t.replace(/[٠-٩]/g,e=>String.fromCharCode(48+(e.charCodeAt(0)-1632))).replace(/[۰-۹]/g,e=>String.fromCharCode(48+(e.charCodeAt(0)-1776))):""}constructor(t){t&&this.#i(t)}#i(t){/[٠-٩]/.test(t)?this.#t="arabic-indic":/[۰-۹]/.test(t)?this.#t="persian":this.#t="ascii"}denormalise(t){if(!this.#t||this.#t==="ascii")return t;let e=this.#t==="arabic-indic"?1632:1776;return t.replace(/[0-9]/g,i=>String.fromCharCode(e+Number(i)))}normalise(t){return t?(this.#i(t),this.#t==="ascii"?t:n.toAscii(t)):""}isAscii(){return!this.#t||this.#t==="ascii"}};var St=typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("anchor-name: --x"),W=class n{#t;#i;#A;#E="";#b;#N;#S=null;#D;#m;#e;#u;#y;#o;#s;#f;#a;#T;#n;#c;#l;#d;#W;#r;#C=null;#h=null;#w=new Map;#O=null;#H;telInputEl;hadInitialPlaceholder;constructor(t,e,i){t.dataset[R.INSTANCE_ID]=i.toString(),this.telInputEl=t,this.#t=e,this.#i=i,this.hadInitialPlaceholder=!!t.getAttribute("placeholder"),this.#A=!!this.telInputEl.closest("[dir=rtl]"),this.#E=this.telInputEl.style.paddingLeft}static validateInput(t){let e=t?.tagName;if(!(!!t&&typeof t=="object"&&e==="INPUT"&&typeof t.setAttribute=="function")){let s=Object.prototype.toString.call(t);throw new TypeError(`The first argument must be an HTMLInputElement, not ${s}`)}}buildMarkup(t,e){this.#b=t,this.#N=e,this.telInputEl.classList.add("iti__tel-input"),this.telInputEl.hasAttribute("type")||this.telInputEl.setAttribute("type","tel"),this.telInputEl.hasAttribute("autocomplete")||this.telInputEl.setAttribute("autocomplete","tel"),this.telInputEl.hasAttribute("inputmode")||this.telInputEl.setAttribute("inputmode","tel");let i=this.#B();this.#j(i),i.appendChild(this.telInputEl),this.#tt(),this.#st(),this.#et(i),this.ensureDropdownWidthSet()}#B(){let{countrySelectorMode:t,showFlags:e,containerClass:i}=this.#t,s=q({iti:!0,"iti--input-container":!0,"iti--has-country-selector":t!==h.OFF,"iti--show-flags":e,"iti--inline-country-selector":t!==h.FULLSCREEN,[i]:!!i}),o=f("div",{class:s});return this.#A&&o.setAttribute("dir","ltr"),this.telInputEl.before(o),o}#j(t){let{countrySelectorMode:e,separateDialCode:i,showFlags:s}=this.#t,o=e!==h.OFF;if(!o&&!s&&!i)return;this.#m=f("div",{class:`iti__country-container ${c.V_HIDE}`},t),o?(this.#e=f("button",{type:"button",class:"iti__selected-country",[p.EXPANDED]:"false",[p.LABEL]:this.#t.uiTranslations.noCountrySelected,[p.HASPOPUP]:"dialog",[p.CONTROLS]:`iti-${this.#i}__country-selector`},this.#m),this.telInputEl.disabled&&this.#e.setAttribute("disabled","true")):this.#e=f("div",{class:"iti__selected-country"},this.#m);let r=f("div",{class:"iti__selected-country-primary"},this.#e);this.#u=f("div",{class:c.FLAG},r),o&&(this.#o=f("div",{class:"iti__arrow",[p.HIDDEN]:"true"},r)),i&&(this.#y=f("div",{class:"iti__selected-dial-code"},this.#e)),o&&this.#Q()}ensureDropdownWidthSet(){let{matchDropdownWidth:t,countrySelectorMode:e}=this.#t;if(e===h.OFF||!t||this.#s.style.width)return;let i=this.telInputEl.offsetWidth;i>0&&(this.#s.style.width=`${i}px`)}#Q(){let{matchDropdownWidth:t,countrySelectorMode:e,countrySearch:i,uiTranslations:s,containerClass:o}=this.#t,r=e===h.FULLSCREEN,l=this.#$(),a=t?"":"iti--flexible-dropdown-width";if(this.#s=f("div",{id:`iti-${this.#i}__country-selector`,class:`iti__country-selector ${c.HIDE} ${a}`,role:"dialog",[p.MODAL]:"true"}),this.#A&&this.#s.setAttribute("dir","rtl"),i&&this.#Z(),this.#n=f("ul",{class:"iti__country-list",id:`iti-${this.#i}__country-listbox`,role:"listbox",[p.LABEL]:s.countryListAriaLabel},this.#s),this.#it(),i&&this.#Y(),r||(this.#D=this.#ot(),i&&(this.#s.style.height=`${this.#D}px`)),l){let d=q({iti:!0,"iti--detached-country-selector":!0,"iti--fullscreen-popup":r,"iti--inline-country-selector":!r,[o]:!!o});this.#r=f("div",{class:d}),this.#r.appendChild(this.#s),r||this.#x()}else this.#m.appendChild(this.#s)}#$(){let{countrySelectorMode:t,dropdownParent:e}=this.#t;return t===h.FULLSCREEN?document.body:t===h.DROPDOWN?e:null}#Z(){let{uiTranslations:t,searchInputClass:e}=this.#t,i=f("div",{class:"iti__search-input-wrapper"},this.#s);this.#f=f("span",{class:"iti__search-icon",[p.HIDDEN]:"true"},i),this.#f.appendChild(It()),this.#a=f("input",{id:`iti-${this.#i}__search-input`,type:"search",class:`iti__search-input ${e}`,placeholder:t.searchPlaceholder,role:"combobox",[p.EXPANDED]:"true",[p.LABEL]:t.searchPlaceholder,[p.CONTROLS]:`iti-${this.#i}__country-listbox`,[p.AUTOCOMPLETE]:"list",autocomplete:"off"},i),this.#T=f("button",{type:"button",class:`iti__search-clear ${c.HIDE}`,[p.LABEL]:t.clearSearchAriaLabel,tabindex:"-1"},i),this.#T.appendChild(bt(this.#i)),this.#W=f("span",{class:"iti__a11y-text"},this.#s),this.#d=f("div",{class:`iti__no-results ${c.HIDE}`,[p.HIDDEN]:"true"},this.#s),this.#d.textContent=t.searchEmptyState??null}#tt(){this.#m&&(this.#k(),this.#m.classList.remove(c.V_HIDE))}#et(t){let{hiddenInputs:e}=this.#t;if(!e)return;let i=this.telInputEl.getAttribute("name")||"",s=e(i);if(s.phone){let o=this.telInputEl.form?.querySelector(`input[name="${s.phone}"]`);o?this.#c=o:(this.#c=f("input",{type:"hidden",name:s.phone}),t.appendChild(this.#c))}if(s.country){let o=this.telInputEl.form?.querySelector(`input[name="${s.country}"]`);o?this.#l=o:(this.#l=f("input",{type:"hidden",name:s.country}),t.appendChild(this.#l))}}#it(){let t=document.createDocumentFragment();for(let e=0;e<this.#b.length;e++){let i=this.#b[e],s=q({[c.COUNTRY_ITEM]:!0}),o=f("li",{id:`iti-${this.#i}__item-${i.iso2}`,class:s,tabindex:"-1",role:"option",[p.SELECTED]:"false"});o.dataset[R.DIAL_CODE]=i.dialCode,o.dataset[R.ISO2]=i.iso2,this.#w.set(i.iso2,o),this.#t.showFlags&&f("div",{class:`${c.FLAG} iti__${i.iso2}`},o);let r=f("span",{class:"iti__country-name"},o);r.textContent=`${i.name} `;let l=f("span",{class:"iti__dial-code"},r);this.#A&&l.setAttribute("dir","ltr"),l.textContent=`(+${i.dialCode})`,t.appendChild(o)}this.#n.appendChild(t)}#k(){if(this.#e){let t=this.#t.separateDialCode?O.FALLBACK_SELECTED_COUNTRY_WITH_DIAL_WIDTH:O.FALLBACK_SELECTED_COUNTRY_NO_DIAL_WIDTH,i=(this.#e.offsetWidth||this.#nt()||t)+O.INPUT_PADDING_EXTRA_LEFT;this.telInputEl.style.paddingLeft=`${i}px`}}#st(){!this.#e||typeof ResizeObserver>"u"||(this.#H=new ResizeObserver(()=>{this.#e?.offsetWidth&&this.#k()}),this.#H.observe(this.#e))}static#V(){let t;try{t=window.top.document.body}catch{t=document.body}return t}#nt(){if(!this.telInputEl.parentNode)return 0;let t=n.#V(),e=this.telInputEl.parentNode.cloneNode(!1);e.style.visibility="hidden",t.appendChild(e);let i=this.#m.cloneNode();e.appendChild(i);let s=this.#e.cloneNode(!0);i.appendChild(s);let o=s.offsetWidth;return t.removeChild(e),o}#ot(){let t=n.#V();this.#s.classList.remove(c.HIDE);let e=f("div",{class:"iti iti--inline-country-selector"});e.appendChild(this.#s),e.style.visibility="hidden",t.appendChild(e);let i=this.#s.offsetHeight;return t.removeChild(e),e.style.visibility="",this.#s.classList.add(c.HIDE),i>0?i:O.FALLBACK_DROPDOWN_HEIGHT}#Y(){let{uiTranslations:t}=this.#t,e=this.#n.childElementCount;this.#W.textContent=t.searchSummaryAria(e)}#M(t){let e;if(t==="")e=this.#b;else{let i=F.toAscii(t);e=At(this.#b,this.#N,i)}this.#X(e)}prefillSearchWithPlus(){this.#a.value="+",this.#a.focus(),this.#M("")}#U(){let t=this.#a.value.trim();this.#M(t),this.#a.value?this.#T.classList.remove(c.HIDE):this.#T.classList.add(c.HIDE)}#p(){this.#S&&clearTimeout(this.#S),this.#S=setTimeout(()=>{this.#U(),this.#S=null},it.SEARCH_DEBOUNCE_MS)}#v(){this.#a.value="",this.#a.focus(),this.#U()}#P(t){let e=this.#n,i=e.getBoundingClientRect(),s=t.getBoundingClientRect(),o=s.top-i.top+e.scrollTop;s.top<i.top?e.scrollTop=o:s.bottom>i.bottom&&(e.scrollTop=o-i.height+s.height)}#L(t,e=!0){if(this.#h?.classList.remove(c.HIGHLIGHT),t){if(t.classList.add(c.HIGHLIGHT),this.#t.countrySearch){let i=t.getAttribute("id")||"";this.#a.setAttribute(p.ACTIVE_DESCENDANT,i)}e&&this.#P(t),this.#h=t}else this.#h=null}bindHiddenInputSubmitListener(t,e,i){let s=this.telInputEl.form;!s||!this.#c&&!this.#l||s.addEventListener("submit",()=>{this.#c&&(this.#c.value=e()),this.#l&&(this.#l.value=i())},{signal:t})}bindAllInitialCountrySelectorListeners(t,e,i){let s=this.telInputEl.closest("label");s&&s.addEventListener("click",o=>{this.isCountrySelectorOpen()?o.preventDefault():this.telInputEl.focus()},{signal:t}),this.#e.addEventListener("click",()=>{!this.isCountrySelectorOpen()&&!this.telInputEl.disabled&&!this.telInputEl.readOnly&&e()},{signal:t}),this.#m.addEventListener("keydown",o=>{let r=[b.ARROW_UP,b.ARROW_DOWN,b.SPACE,b.ENTER];!this.isCountrySelectorOpen()&&r.includes(o.key)&&(o.preventDefault(),o.stopPropagation(),e()),o.key===b.TAB&&i()},{signal:t})}openCountrySelector(t,e){let{countrySearch:i,dropdownAlwaysOpen:s}=this.#t;if(this.#O=new AbortController,this.ensureDropdownWidthSet(),this.#r)this.#J();else{let r=this.#I(),l=this.telInputEl.offsetHeight+O.DROPDOWN_MARGIN;r?this.#s.style.top=`${l}px`:this.#s.style.bottom=`${l}px`}this.#s.classList.remove(c.HIDE),this.#e.setAttribute(p.EXPANDED,"true");let o=this.#C??this.#n.firstElementChild;o&&this.#L(o),i&&!s&&this.#a.focus(),this.#t.countrySelectorMode===h.FULLSCREEN&&this.#r&&window.visualViewport&&window.visualViewport.addEventListener("resize",()=>{this.#q(),this.#h&&this.#P(this.#h)},{signal:this.#O.signal}),this.#o.classList.add(c.ARROW_UP),this.#G(t,e)}#G(t,e){let i=this.#O.signal;this.#rt(i),this.#g(i,t),this.#t.dropdownAlwaysOpen||this.#K(i,e),this.#F(i,t,e),this.#t.countrySearch&&this.#lt(i),this.#t.countrySelectorMode===h.DROPDOWN&&this.#t.dropdownParent&&!St&&document.addEventListener("scroll",e,{signal:i,capture:!0,passive:!0})}#rt(t){this.#n.addEventListener("mouseover",e=>{let i=e.target?.closest(`.${c.COUNTRY_ITEM}`);i&&this.#L(i,!1)},{signal:t})}#g(t,e){this.#n.addEventListener("click",i=>{let s=i.target?.closest(`.${c.COUNTRY_ITEM}`);s&&e(s)},{signal:t})}#K(t,e){setTimeout(()=>{document.documentElement.addEventListener("click",i=>{this.#s.contains(i.target)||e()},{signal:t})},0)}#F(t,e,i){let s="",o=null,r=l=>{[b.ARROW_UP,b.ARROW_DOWN,b.ENTER,b.ESC].includes(l.key)&&(l.preventDefault(),l.stopPropagation(),l.key===b.ARROW_UP||l.key===b.ARROW_DOWN?this.#z(l.key):l.key===b.ENTER&&!l.isComposing?e(this.#h):l.key===b.ESC&&(i(),this.#e.focus())),!this.#t.countrySearch&&v.HIDDEN_SEARCH_CHAR.test(l.key)&&(l.stopPropagation(),o&&clearTimeout(o),s+=l.key.toLowerCase(),this.#R(s),o=setTimeout(()=>{s=""},it.HIDDEN_SEARCH_RESET_MS))};this.#e?.addEventListener("keydown",r,{signal:t}),this.#s?.addEventListener("keydown",r,{signal:t})}#lt(t){this.#a.addEventListener("input",()=>this.#p(),{signal:t}),this.#T.addEventListener("click",()=>this.#v(),{signal:t})}#R(t){let e=Nt(this.#b,this.#N,t);if(e){let i=this.#w.get(e.iso2);this.#L(i)}}#z(t){let e=t===b.ARROW_UP?this.#h?.previousElementSibling:this.#h?.nextElementSibling;!e&&this.#n.childElementCount>1&&(e=t===b.ARROW_UP?this.#n.lastElementChild:this.#n.firstElementChild),e&&this.#L(e)}#_(t){if(this.#C&&this.#C.dataset[R.ISO2]!==t&&(this.#C.setAttribute(p.SELECTED,"false"),this.#C.querySelector(".iti__country-check")?.remove(),this.#C=null),t&&!this.#C){let e=this.#n.querySelector(`[data-iso2="${t}"]`);e&&(e.setAttribute(p.SELECTED,"true"),f("span",{class:"iti__country-check",[p.HIDDEN]:"true"},e).appendChild(Tt()),this.#C=e,this.#t.dropdownAlwaysOpen&&this.#L(e))}}#X(t){this.#n.replaceChildren();let e=!0;for(let i of t){let s=this.#w.get(i.iso2);s&&(this.#n.appendChild(s),e&&(this.#L(s,!1),e=!1))}e?(this.#L(null),this.#d&&this.#d.classList.remove(c.HIDE)):this.#d&&this.#d.classList.add(c.HIDE),this.#n.scrollTop=0,this.#Y()}closeCountrySelector(){let{countrySearch:t}=this.#t;this.#O.abort(),this.#O=null,this.#s.classList.add(c.HIDE),this.#e.setAttribute(p.EXPANDED,"false"),t&&(this.#a.removeAttribute(p.ACTIVE_DESCENDANT),this.#a.value="",this.#U(),this.#h&&(this.#h.classList.remove(c.HIGHLIGHT),this.#h=null)),this.#o.classList.remove(c.ARROW_UP),this.#r?(this.#r.remove(),this.#r.style.top="",this.#r.style.bottom="",this.#r.style.paddingLeft="",this.#r.style.paddingRight=""):(this.#s.style.top="",this.#s.style.bottom="")}#I(){if(this.#t.dropdownAlwaysOpen)return!0;let t=this.telInputEl.getBoundingClientRect(),e=t.top,i=window.innerHeight-t.bottom;return i>=this.#D||i>=e}#J(){let t=this.#t.countrySelectorMode===h.FULLSCREEN,e=this.#$();if(t){if(window.innerWidth>=O.NARROW_VIEWPORT_WIDTH){let i=this.telInputEl.getBoundingClientRect();this.#r.style.paddingLeft=`${i.left}px`,this.#r.style.paddingRight=`${window.innerWidth-i.right}px`}}else if(!St){let i=this.telInputEl.getBoundingClientRect();this.#r.style.left=`${i.left}px`,this.#I()?this.#r.style.top=`${i.bottom+O.DROPDOWN_MARGIN}px`:(this.#r.style.top="unset",this.#r.style.bottom=`${window.innerHeight-i.top+O.DROPDOWN_MARGIN}px`)}e.appendChild(this.#r)}#x(){let t=`--iti-anchor-${this.#i}`,e=getComputedStyle(this.telInputEl).anchorName;this.telInputEl.style.anchorName=e&&e!=="none"?`${e}, ${t}`:t,this.#r.style.positionAnchor=t}#q(){let t=window.visualViewport;if(!t||!this.#r)return;let e=window.innerHeight-t.height;this.#r.style.bottom=`${e}px`}isCountrySelectorOpen(){return!this.#s.classList.contains(c.HIDE)}setLoading(t){this.#u.classList.toggle(c.LOADING,t)}playStrictRejectAnimation(){if(!this.#t.strictRejectAnimation)return;let t=this.telInputEl.parentElement;t&&(t.classList.remove(c.STRICT_REJECT_ANIMATION),t.offsetWidth,t.classList.add(c.STRICT_REJECT_ANIMATION),t.addEventListener("animationend",()=>t.classList.remove(c.STRICT_REJECT_ANIMATION),{once:!0}))}isLoading(){return this.#u.classList.contains(c.LOADING)}setDisabled(t){this.telInputEl.disabled=t,this.#e&&(t?this.#e.setAttribute("disabled","true"):this.#e.removeAttribute("disabled"))}setReadonly(t){this.telInputEl.readOnly=t,this.#e&&(t?this.#e.setAttribute("disabled","true"):this.#e.removeAttribute("disabled"))}setSelectedCountry(t){let{countrySelectorMode:e,showFlags:i,separateDialCode:s,uiTranslations:o}=this.#t,r=t?.name,l=t?.dialCode,a=t?.iso2??"";if(e!==h.OFF&&this.#_(a),this.#e){let d=a&&i?`${c.FLAG} iti__${a}`:`${c.FLAG} ${c.GLOBE}`,E,y,C=null;a?(y=r,E=o.selectedCountryAriaLabel.replace("${countryName}",r).replace("${dialCode}",`+${l}`),i||(C=rt())):(y=o.noCountrySelected,E=o.noCountrySelected,C=rt()),this.#u.className=d,this.#e.setAttribute("title",y),this.#e.setAttribute(p.LABEL,E),C?this.#u.replaceChildren(C):this.#u.replaceChildren()}if(s){let d=l?`+${l}`:"";this.#y.textContent=d,this.#k()}}destroy(){this.telInputEl.iti=void 0,delete this.telInputEl.dataset[R.INSTANCE_ID],this.#H?.disconnect(),this.telInputEl.style.paddingLeft=this.#E;let t=this.telInputEl.parentNode;t&&(t.before(this.telInputEl),t.remove()),this.#w.clear()}};var Ot=n=>{let{onlyCountries:t,excludeCountries:e}=n;return t?.length?k.filter(i=>t.includes(i.iso2)):e?.length?k.filter(i=>!e.includes(i.iso2)):[...k]},vt=(n,t)=>{let{countryNameLocale:e,countryNameOverrides:i}=t,s;try{typeof Intl<"u"&&typeof Intl.DisplayNames=="function"?s=new Intl.DisplayNames(e,{type:"region"}):s=null}catch(o){console.error(o),s=null}for(let o of n)o.name=i[o.iso2]||s?.of(o.iso2.toUpperCase())||""},Rt=n=>{let t=new Set,e=0,i={},s=(r,l)=>{if(!r||!l)return;l.length>e&&(e=l.length),Object.hasOwn(i,l)||(i[l]=[]);let a=i[l];a.includes(r)||a.push(r)},o=[...n].sort((r,l)=>r.priority-l.priority);for(let r of o){t.has(r.dialCode)||t.add(r.dialCode);for(let l=1;l<r.dialCode.length;l++){let a=r.dialCode.substring(0,l);s(r.iso2,a)}if(s(r.iso2,r.dialCode),r.areaCodes){let l=i[r.dialCode][0];for(let a of r.areaCodes){for(let d=1;d<a.length;d++){let E=a.substring(0,d),y=r.dialCode+E;s(l,y),s(r.iso2,y)}s(r.iso2,r.dialCode+a)}}}return{dialCodes:t,dialCodeMaxLength:e,dialCodeToIso2Map:i}},_t=(n,t)=>{let{countryOrder:e}=t;n.sort((i,s)=>{if(e){let o=e.indexOf(i.iso2),r=e.indexOf(s.iso2),l=o>-1,a=r>-1;if(l||a)return l&&a?o-r:l?-1:1}return i.name.localeCompare(s.name)})};var Xt=new Set(["800","808","870","881","882","883","888","979"]),at=n=>{let t=D(n).slice(0,3);return n.startsWith("+")&&Xt.has(t)};var ut=(n,t,e,i)=>{if(!e||!t)return n;let s=`+${i.dialCode}`,o=n[s.length]===" "||n[s.length]==="-"?s.length+1:s.length;return n.substring(o)},Dt=(n,t,e,i,s)=>{let o=e?e.formatNumberAsYouType(n,i?.iso2):n,r=i?.dialCode;return s&&t.charAt(0)!=="+"&&o.includes(`+${r}`)?(o.split(`+${r}`)[1]||"").trim():o};var wt=(n,t,e,i)=>{if(e===0&&!i)return 0;let s=0;for(let o=0;o<t.length;o++){if(/[+0-9]/.test(t[o])&&s++,s===n&&!i)return o+1;if(i&&s===n+1)return o}return t.length};var Jt=new Set(["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"]),ct=n=>{let t=D(n);if(t.startsWith(V.NANP)&&t.length>=4){let e=t.substring(1,4);return Jt.has(e)}return!1};var qt=0,B=n=>{if(!u.utils)throw new Error(`intlTelInput.utils is required for ${n}(). See: https://intl-tel-input.com/docs/utils`)},Mt=()=>{let n,t;return{promise:new Promise((i,s)=>{n=i,t=s}),resolve:n,reject:t}},j=class n{id;promise;#t;#i;#A;#E;#b;#N;#S;#D;#m;#e=null;#u=null;#y;#o=!0;#s;#f;#a=!1;#T=null;#n;#c;constructor(t,e={}){this.id=qt++,W.validateInput(t);let i=yt(e);this.#i={...J,...i},Ct(this.#i),gt(this.#i),this.#t=new W(t,this.#i,this.id),this.#A=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),this.#f=new F(t.value),this.promise=this.#W(this.#i),this.#E=Ot(this.#i);let{dialCodes:s,dialCodeMaxLength:o,dialCodeToIso2Map:r}=Rt(this.#E);this.#S=s,this.#b=o,this.#N=r,this.#D=new Map(this.#E.map(l=>[l.iso2,l])),this.#r()}#l(){let t=this.#t.telInputEl.value.trim();return this.#f.normalise(t)}#d(t){this.#t.telInputEl.value=this.#f.denormalise(t)}#W(t){let{initialCountry:e,initialCountryLookup:i,loadUtils:s}=t,o=!e&&!!i,r=!!s&&!u.utils;return o&&(this.#n=Mt()),r&&(this.#c=Mt()),Promise.all([this.#n?.promise,this.#c?.promise]).then(()=>{})}#r(){this.#s=new AbortController,this.#C(),this.#t.buildMarkup(this.#E,this.#m),this.#h(),this.#w(),this.#O(),this.#i.dropdownAlwaysOpen&&this.openCountrySelector()}#C(){vt(this.#E,this.#i),_t(this.#E,this.#i),this.#m=Lt(this.#E)}#h(t=!1){let e=this.#t.telInputEl.getAttribute("value"),i=this.#f.normalise(e??""),s=this.#l(),r=i&&i.startsWith("+")&&(!s||!s.startsWith("+"))?i:s,l=this.#_(r),a=ct(r),{initialCountry:d,initialCountryLookup:E}=this.#i,y=!d&&!!E,C=y&&u.autoCountry?u.autoCountry:d,N=y&&!t&&!u.autoCountry,A=x(C);l?a?A?this.#g(C):N||this.#g(dt.ISO2):(A&&this.#g(C),this.#P(r)):A?this.#g(C):N||this.#g(""),r&&this.#v(r)}#w(){this.#Q(),this.#i.countrySelectorMode!==h.OFF&&this.#t.bindAllInitialCountrySelectorListeners(this.#s.signal,()=>this.openCountrySelector(),()=>this.#R()),this.#t.bindHiddenInputSubmitListener(this.#s.signal,()=>this.getNumber(),()=>this.#e?.iso2||"")}#O(){if(this.#c){let{loadUtils:t}=this.#i,e=()=>{u.attachUtils(t).catch(()=>{})};u.documentReady()?e():window.addEventListener("load",e,{signal:this.#s.signal})}this.#n&&(this.#e?this.#n.resolve():this.#H())}async#H(){if(u.autoCountry){this.#q();return}if(this.#t.setLoading(!0),!u.startedLoadingAutoCountry&&(u.startedLoadingAutoCountry=!0,typeof this.#i.initialCountryLookup=="function")){let t;try{let e=await Promise.race([this.#i.initialCountryLookup(),new Promise((s,o)=>{t=setTimeout(()=>o(new Error("intl-tel-input: initialCountryLookup timed out after 10s")),1e4)})]),i=typeof e=="string"?e.toLowerCase():"";if(!x(i)){u.startedLoadingAutoCountry=!1,n.forEachInstance("handleAutoCountryFailure");return}u.autoCountry=i,setTimeout(()=>n.forEachInstance("handleAutoCountryLoaded"))}catch{u.startedLoadingAutoCountry=!1,n.forEachInstance("handleAutoCountryFailure")}finally{t!==void 0&&clearTimeout(t)}}}#B(){this.openCountrySelector(),this.#t.prefillSearchWithPlus()}#j(t){let e=this.#t.telInputEl.selectionStart||0,i=t.substring(0,e-1),s=t.substring(e);return this.#d(i+s),e-1}#Q(){this.#it(),this.#st(),this.#nt()}#$(t){this.#j(t),this.#B()}#Z(t,e){let i=this.#j(t);this.#t.telInputEl.setSelectionRange(i,i),this.#t.playStrictRejectAnimation(),this.#p(S.STRICT_REJECT,{source:"key",rejectedInput:e,reason:"invalid"})}#tt(t,e){let i=this.#t.telInputEl.selectionStart||0,o=t.substring(0,i).replace(v.NON_PLUS_NUMERIC_GLOBAL,"").length,r=this.#I(),l=Dt(r,t,u.utils,this.#e,this.#i.separateDialCode),a=wt(o,l,i,e);this.#d(l),this.#t.telInputEl.setSelectionRange(a,a)}#et(t){if(t.startsWith("+")&&this.#e&&this.#_(t)){let e=ut(t,!0,!0,this.#e);this.#d(e)}}#it(){this.#a=v.ALPHA_UNICODE.test(this.#l()),this.#t.telInputEl.addEventListener("input",this.#k,{signal:this.#s.signal})}#k=t=>{let{strictMode:e,formatAsYouType:i,separateDialCode:s,countrySelectorMode:o,countrySearch:r}=this.#i,l=t?.detail;if(l?.isCountryChange)return;let a=this.#l(),d=t?.inputType===et.PASTE,E=e&&d;if(this.#A&&!d&&t?.data==="+"&&s&&o!==h.OFF&&r){this.#$(a);return}if(this.#A&&!d&&e&&(t?.data===" "||t?.data==="-"||t?.data===".")){this.#Z(a,t.data);return}if(E){if(this.#Y())return;a=this.#l()}this.#P(a)&&this.#x(),!E&&t?.data&&v.NON_PLUS_NUMERIC.test(t.data)||d&&a&&!e?this.#a=!0:v.NON_PLUS_NUMERIC.test(a)||(this.#a=!1),i&&!this.#a&&!l?.isSetNumber&&this.#f.isAscii()&&this.#tt(a,t?.inputType===et.DELETE_FORWARD),s&&this.#et(a)};#st(){let{strictMode:t,separateDialCode:e}=this.#i;!t&&!e||this.#t.telInputEl.addEventListener("keydown",this.#V,{signal:this.#s.signal})}#V=t=>{let{strictMode:e,separateDialCode:i,countrySelectorMode:s,countrySearch:o}=this.#i;if(!t.key||t.key.length!==1||t.altKey||t.ctrlKey||t.metaKey)return;if(i&&s!==h.OFF&&o&&t.key==="+"){t.preventDefault(),this.#B();return}if(!e)return;let r=this.#l(),a=!r.startsWith("+")&&this.#t.telInputEl.selectionStart===0&&t.key==="+",d=this.#f.normalise(t.key),E=/^[0-9]$/.test(d),y=i?E:a||E,C=this.#t.telInputEl,N=C.selectionStart,A=C.selectionEnd,I=r.slice(0,N??void 0),m=r.slice(A??void 0),L=I+d+m,w=this.#X(L),P=!1;u.utils&&this.#u&&(P=u.utils.getCoreNumber(w,this.#e?.iso2).length>this.#u);let Q=this.#G(w)!==null;(!y||P&&!Q&&!a)&&(this.#t.playStrictRejectAnimation(),this.#p(S.STRICT_REJECT,{source:"key",rejectedInput:t.key,reason:y?"max-length":"invalid"}),t.preventDefault())};#nt(){this.#i.strictMode&&this.#t.telInputEl.addEventListener("paste",this.#ot,{signal:this.#s.signal})}#ot=t=>{let e=this.#t.telInputEl,i=this.#l();this.#T={pastedRaw:t.clipboardData?.getData("text")??"",value:i,selectionStart:e.selectionStart??i.length,selectionEnd:e.selectionEnd??i.length}};#Y(){let t=this.#t.telInputEl,e=this.#T;if(this.#T=null,!e)return!1;let i=e.pastedRaw,s=e.value,o=e.selectionStart,r=e.selectionEnd,l=s.slice(0,o),a=s.slice(r),d=this.#e?.iso2,E=this.#f.normalise(i),y=o===0&&r>0,C=!s.startsWith("+")||y,N=E.replace(v.NON_PLUS_NUMERIC_GLOBAL,""),A=N.startsWith("+"),I=N.replace(/\+/g,""),m=A&&C?`+${I}`:I,L=l+m+a,w=m!==E?"invalid":null;if(L.length>30)return this.#t.playStrictRejectAnimation(),this.#p(S.STRICT_REJECT,{source:"paste",rejectedInput:i,reason:"max-length"}),this.#M(e),!0;if(L.length>5&&u.utils){let H=u.utils.getCoreNumber(L,d);for(;H.length===0&&L.length>0;)L=L.slice(0,-1),H=u.utils.getCoreNumber(L,d);if(!H)return this.#t.playStrictRejectAnimation(),this.#p(S.STRICT_REJECT,{source:"paste",rejectedInput:i,reason:"max-length"}),this.#M(e),!0;if(this.#u&&H.length>this.#u)if(r===s.length){let Q=H.length-this.#u;L=L.slice(0,L.length-Q),w="max-length"}else return this.#t.playStrictRejectAnimation(),this.#p(S.STRICT_REJECT,{source:"paste",rejectedInput:i,reason:"max-length"}),this.#M(e),!0}this.#d(L);let P=o+m.length;return t.setSelectionRange(P,P),w&&(E.length>0&&m.length===0&&this.#t.playStrictRejectAnimation(),this.#p(S.STRICT_REJECT,{source:"paste",rejectedInput:i,reason:w})),!1}#M(t){this.#d(t.value),this.#t.telInputEl.setSelectionRange(t.selectionStart,t.selectionEnd)}#U(t){let e=Number(this.#t.telInputEl.getAttribute("maxlength"));return e&&t.length>e?t.substring(0,e):t}#p(t,e={}){let i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e});this.#t.telInputEl.dispatchEvent(i)}openCountrySelector(){this.#t.isCountrySelectorOpen()||(this.#t.openCountrySelector(t=>this.#lt(t),()=>this.#R()),this.#p(S.OPEN_COUNTRY_SELECTOR))}#v(t){let{numberDisplayFormat:e,separateDialCode:i}=this.#i,s=t;if(u.utils&&this.#e){let o=at(t),r=!s.startsWith("+")&&!i,l=e===g.NATIONAL&&!o||r,a;l?a=g.NATIONAL:e===g.E164&&!o?a=g.E164:a=g.INTERNATIONAL,s=u.utils.formatNumber(s,this.#e?.iso2,a)}s=this.#J(s),this.#d(s)}#P(t){let e=this.#G(t);return e!==null?this.#g(e):!1}#L(t){let e=this.#e?.dialCode,i=this.#e?.nationalPrefix;if(t.startsWith("+")||!e)return t;let r=i&&t.startsWith(i)&&!this.#i.separateDialCode?t.substring(1):t;return`+${e}${r}`}#G(t){let e=t.indexOf("+"),i=e>0?t.substring(e):t,s=this.#e?.iso2;i=this.#L(i);let o=this.#_(i,!0),r=D(i);if(o){let l=D(o),a=this.#N[l];return a.length===1?a[0]===s?null:a[0]:this.#rt(a,l,r)}else if(i.startsWith("+")&&r.length){let l=this.#e?.dialCode||"";return l&&l.startsWith(r)?null:""}else if((!i||i==="+")&&!s&&this.#y)return this.#y;return null}#rt(t,e,i){let s=this.#e?.iso2,o=this.#e?.dialCode;if(!s&&this.#y&&t.includes(this.#y))return this.#y;if(o===V.NANP&&ct(i))return null;let l=this.#e?.areaCodes,a=this.#e?.priority;if(l){let N=l.map(A=>`${o}${A}`);for(let A of N)if(i.startsWith(A))return null}let E=l&&!(a===0)&&i.length>e.length,y=s&&t.includes(s)&&!E,C=s===t[0];return!y&&!C?t[0]:null}#g(t){let e=this.#e?.iso2||"";return this.#e=t?this.#D.get(t):null,this.#e&&(this.#y=this.#e.iso2),this.#t.setSelectedCountry(this.#e),this.#F(),this.#K(),e!==t}#K(){let{strictMode:t,placeholderNumberType:e,allowedNumberTypes:i}=this.#i;if(!t||!u.utils)return;let s=this.#e?.iso2;if(!s){this.#u=null;return}let o=u.utils.getExampleNumber(s,e,g.E164),r=o;for(;u.utils.isValidNumber(o,s,i);)r=o,o+="0";let l=u.utils.getCoreNumber(r,s);this.#u=l.length,s==="by"&&(this.#u=l.length+1)}#F(){let{placeholderNumberPolicy:t,placeholderNumberType:e,numberDisplayFormat:i,customPlaceholder:s}=this.#i,o=t===_.AGGRESSIVE||!this.#t.hadInitialPlaceholder&&t===_.POLITE;if(!u.utils||!o)return;let r=this.#e?u.utils.getExampleNumber(this.#e.iso2,e,i):"";r=this.#J(r),typeof s=="function"&&(r=s(r,this.#e)),this.#t.telInputEl.setAttribute("placeholder",r)}#lt(t){if(!t)return;let e=t.dataset[R.ISO2],i=this.#g(e);this.#R();let s=t.dataset[R.DIAL_CODE];this.#z(s);let o=this.#l();this.#v(o),this.#t.telInputEl.focus(),i&&(this.#x(),this.#p(S.INPUT,{isCountryChange:!0}))}closeCountrySelector(){this.#R()}#R(t){!this.#t.isCountrySelectorOpen()||this.#i.dropdownAlwaysOpen&&!t||(this.#t.closeCountrySelector(),this.#p(S.CLOSE_COUNTRY_SELECTOR))}#z(t){let e=this.#l();if(!e.startsWith("+"))return;let i=`+${t}`,s=this.#_(e),o;s?o=e.replace(s,i):o=i,this.#d(o)}#_(t,e){if(!t.startsWith("+"))return"";let i="",s="",o=!1;for(let r=0;r<t.length;r++){let l=t.charAt(r);if(!/[0-9]/.test(l))continue;if(s+=l,!!!this.#N[s])break;if(this.#S.has(s)){if(i=t.substring(0,r+1),o=!0,!e)break}else e&&o&&(i=t.substring(0,r+1));if(s.length===this.#b)break}return i}#X(t){let e=this.#e?.dialCode,i=D(t);return(this.#i.separateDialCode&&!t.startsWith("+")&&e&&i?`+${e}`:"")+t}#I(){let t=this.#l();return this.#X(t)}#J(t){let e=!!this.#_(t),i=ut(t,e,this.#i.separateDialCode,this.#e);return this.#U(i)}#x(){this.#p(S.COUNTRY_CHANGE,this.#e??null)}#q(){if(!this.#n||!u.autoCountry)return;if(!this.#o){this.#n.resolve();return}let t=document.activeElement===this.#t.telInputEl,e=!!this.#l();this.#t.isLoading()&&!(t&&e)?this.setSelectedCountry(u.autoCountry):this.#y=u.autoCountry,this.#t.setLoading(!1),this.#n.resolve()}#ut(){if(!this.#o){this.#n?.reject();return}this.#h(!0),this.#t.setLoading(!1),this.#n?.reject()}#ct(){if(!this.#o){this.#c?.resolve();return}if(!u.utils){this.#c?.resolve();return}let t=this.#l(),e=document.activeElement===this.#t.telInputEl;t&&!e&&this.#v(t),this.#e&&(this.#F(),this.#K()),this.#c?.resolve()}#dt(t){if(!this.#o){this.#c?.reject(t);return}this.#c?.reject(t)}destroy(){this.#o&&(this.#o=!1,this.#i.countrySelectorMode!==h.OFF&&this.#R(!0),this.#s.abort(),this.#t.destroy(),u.instances.delete(String(this.id)))}isActive(){return this.#o}getExtension(){return this.#o?(B("getExtension"),u.utils.getExtension(this.#I(),this.#e?.iso2)):""}getNumber(t){if(!this.#o)return"";B("getNumber");let e=this.#e?.iso2,i=this.#I(),s=u.utils.formatNumber(i,e,t);return this.#f.denormalise(s)}getNumberType(){return this.#o?(B("getNumberType"),u.utils.getNumberType(this.#I(),this.#e?.iso2)):null}getSelectedCountry(){return this.#e??null}getValidationError(){if(!this.#o)return null;B("getValidationError");let t=this.#e?.iso2;return u.utils.getValidationError(this.#I(),t)}isValidNumber(){if(!this.#o)return null;B("isValidNumber");let t=this.#e?.dialCode,e=this.#e?.iso2,i=this.#I(),s=u.utils.getCoreNumber(i,e);if(s){if(t===Y.DIAL_CODE&&s[0]===Y.MOBILE_PREFIX&&s.length!==Y.MOBILE_CORE_LENGTH)return!1;if(!v.ALPHA_UNICODE.test(i)&&t){let r=i.startsWith("+")?i.slice(1+t.length):i,l=D(r).length;if(s.length>l)return!1}}return this.#at("possible")}isValidNumberPrecise(){return this.#o?(B("isValidNumberPrecise"),this.#at("precise")):null}#at(t){let{allowNumberExtensions:e,allowPhonewords:i,allowedNumberTypes:s}=this.#i,o=this.#e?.iso2,r=this.#I();return!this.#e&&!at(r)||!(t==="precise"?u.utils.isValidNumberPrecise:u.utils.isValidNumber)(r,o,s)?!1:v.ALPHA_UNICODE.test(r)?!!u.utils.getExtension(r,o)?e:i:!0}setSelectedCountry(t){if(!this.#o)return;let e=t?.toLowerCase();if(!x(e))throw new Error(`Invalid iso2 code: '${e}'`);let i=this.#e?.iso2;if(!(t&&e!==i||!t&&i))return;this.#g(e),this.#z(this.#e?.dialCode||"");let o=this.#l();this.#v(o),this.#x(),this.#p(S.INPUT,{isCountryChange:!0})}setNumber(t){if(!this.#o)return;let e=this.#f.normalise(t),i=this.#P(e);this.#v(e),i&&this.#x(),this.#p(S.INPUT,{isSetNumber:!0})}setPlaceholderNumberType(t){this.#o&&(this.#i.placeholderNumberType=t,this.#F())}setDisabled(t){this.#o&&this.#t.setDisabled(t)}setReadonly(t){this.#o&&this.#t.setReadonly(t)}static forEachInstance(t,...e){let i=[...u.instances.values()],s=e[0];i.forEach(o=>{if(o instanceof n)switch(t){case"handleUtilsLoaded":o.#ct();break;case"handleUtilsFailure":o.#dt(s);break;case"handleAutoCountryLoaded":o.#q();break;case"handleAutoCountryFailure":o.#ut();break}})}},Qt=async n=>{if(u.utils||u.startedLoadingUtils)return null;if(typeof n!="function")throw new TypeError(`The argument passed to attachUtils must be a function that returns a promise for the utils module, not ${typeof n}`);u.startedLoadingUtils=!0;try{let e=(await n())?.default;if(!e||typeof e!="object")throw new TypeError("The loader function passed to attachUtils did not resolve to a module object with utils as its default export.");return u.utils=e,j.forEachInstance("handleUtilsLoaded"),!0}catch(t){throw j.forEachInstance("handleUtilsFailure",t),t}},u=Object.assign((n,t)=>{let e=new j(n,t);return u.instances.set(String(e.id),e),n.iti=e,e},{defaults:J,documentReady:()=>document.readyState==="complete",getAllCountries:()=>k,getInstance:n=>{let t=n.dataset[R.INSTANCE_ID];return t?u.instances.get(t)??null:null},instances:new Map,attachUtils:Qt,startedLoadingUtils:!1,startedLoadingAutoCountry:!1,version:"29.0.1",NUMBER_FORMAT:g,NUMBER_TYPE:M,VALIDATION_ERROR:z,PLACEHOLDER_POLICY:_,COUNTRY_SELECTOR_MODE:h}),Zt=u;return Ft(te);})();
|
|
7
7
|
var intlTelInput = _factory.default;
|
package/dist/js/intlTelInput.mjs
CHANGED