1import{c as t,f as e,p as i,F as n,a,V as r,e as o,b as s,s as l,d as h,g as u,P as c,M as g,i as f,h as d,j as m,k as N,m as C,l as p,n as x,o as b}from"./89a70c1b.8CdVGPbf.js";class P{constructor({onCountryChange:t,onCallingCodeChange:e}){this.onCountryChange=t,this.onCallingCodeChange=e}reset({country:t,callingCode:e}){this.international=!1,this.missingPlus=!1,this.IDDPrefix=void 0,this.callingCode=void 0,this.digits="",this.resetNationalSignificantNumber(),this.initCountryAndCallingCode(t,e)}resetNationalSignificantNumber(){this.nationalSignificantNumber=this.getNationalDigits(),this.nationalSignificantNumberIsModified=!1,this.nationalPrefix=void 0,this.carrierCode=void 0,this.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix=void 0}update(t){for(const e of Object.keys(t))this[e]=t[e]}initCountryAndCallingCode(t,e){this.setCountry(t),this.setCallingCode(e)}setCountry(t){this.country=t,this.onCountryChange(t)}setCallingCode(t){this.callingCode=t,this.onCallingCodeChange(t,this.country)}startInternationalNumber(t,e){this.international=!0,this.initCountryAndCallingCode(t,e)}appendDigits(t){this.digits+=t}appendNationalSignificantNumberDigits(t){this.nationalSignificantNumber+=t}getNationalDigits(){return this.international?this.digits.slice((this.IDDPrefix?this.IDDPrefix.length:0)+(this.callingCode?this.callingCode.length:0)):this.digits}getDigitsWithoutInternationalPrefix(){return this.international&&this.IDDPrefix?this.digits.slice(this.IDDPrefix.length):this.digits}}const S="x",y=new RegExp(S);function F(t,e){if(e<1)return"";let i="";for(;e>1;)1&e&&(i+=t),e>>=1,t+=t;return i+t}function I(t,e){return")"===t[e]&&e++,function(t){const e=[];let i=0;for(;i<t.length;)"("===t[i]?e.push(i):")"===t[i]&&e.pop(),i++;let n=0,a="";e.push(t.length);for(const r of e)a+=t.slice(n,r),n=r+1;return a}(t.slice(0,e))}function w(t,e,{metadata:i,shouldTryNationalPrefixFormattingRule:n,getSeparatorAfterNationalPrefix:a}){if(new RegExp(`^(?:${e.pattern()})$`).test(t.nationalSignificantNumber))return function(t,e,{metadata:i,shouldTryNationalPrefixFormattingRule:n,getSeparatorAfterNationalPrefix:a}){const{nationalSignificantNumber:r,international:o,nationalPrefix:s,carrierCode:l}=t;if(n(e)){const n=T(t,e,{useNationalPrefixFormattingRule:!0,getSeparatorAfterNationalPrefix:a,metadata:i});if(n)return n}return T(t,e,{useNationalPrefixFormattingRule:!1,getSeparatorAfterNationalPrefix:a,metadata:i})}(t,e,{metadata:i,shouldTryNationalPrefixFormattingRule:n,getSeparatorAfterNationalPrefix:a})}function T(t,n,{metadata:a,useNationalPrefixFormattingRule:r,getSeparatorAfterNationalPrefix:o}){let s=e(t.nationalSignificantNumber,n,{carrierCode:t.carrierCode,useInternationalFormat:t.international,withNationalPrefix:r,metadata:a});if(r||(t.nationalPrefix?s=t.nationalPrefix+o(n)+s:t.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix&&(s=t.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix+" "+s)),function(t,e){return i(t)===e.getNationalDigits()}(s,t))return s}class E{parse(t){if(this.context=[{or:!0,instructions:[]}],this.parsePattern(t),1!==this.context.length)throw new Error("Non-finalized contexts left when pattern parse ended");const{branches:e,instructions:i}=this.context[0];if(e)return{op:"|",args:e.concat([R(i)])};if(0===i.length)throw new Error("Pattern is required");return 1===i.length?i[0]:i}startContext(t){this.context.push(t)}endContext(){this.context.pop()}getContext(){return this.context[this.context.length-1]}parsePattern(t){if(!t)throw new Error("Pattern is required");const e=t.match(M);if(!e){if(A.test(t))throw new Error(`Illegal characters found in a pattern: ${t}`);return void(this.getContext().instructions=this.getContext().instructions.concat(t.split("")))}const i=e[1],n=t.slice(0,e.index),a=t.slice(e.index+i.length);switch(i){case"(?:":n&&this.parsePattern(n),this.startContext({or:!0,instructions:[],branches:[]});break;case")":if(!this.getContext().or)throw new Error('")" operator must be preceded by "(?:" operator');if(n&&this.parsePattern(n),0===this.getContext().instructions.length)throw new Error('No instructions foun
1d after "|" operator in an "or" group');const{branches:t}=this.getContext();t.push(R(this.getContext().instructions)),this.endContext(),this.getContext().instructions.push({op:"|",args:t});break;case"|":if(!this.getContext().or)throw new Error('"|" operator can only be used inside "or" groups');if(n&&this.parsePattern(n),!this.getContext().branches){if(1!==this.context.length)throw new Error('"branches" not found in an "or" group context');this.getContext().branches=[]}this.getContext().branches.push(R(this.getContext().instructions)),this.getContext().instructions=[];break;case"[":n&&this.parsePattern(n),this.startContext({oneOfSet:!0});break;case"]":if(!this.getContext().oneOfSet)throw new Error('"]" operator must be preceded by "[" operator');this.endContext(),this.getContext().instructions.push({op:"[]",args:D(n)});break;default:throw new Error(`Unknown operator: ${i}`)}a&&this.parsePattern(a)}}function D(t){const e=[];let i=0;for(;i<t.length;){if("-"===t[i]){if(0===i||i===t.length-1)throw new Error(`Couldn't parse a one-of set pattern: ${t}`);const n=t[i-1].charCodeAt(0)+1,a=t[i+1].charCodeAt(0)-1;let r=n;for(;r<=a;)e.push(String.fromCharCode(r)),r++}else e.push(t[i]);i++}return e}const A=/[\(\)\[\]\?\:\|]/,M=new RegExp("(\\||\\(\\?\\:|\\)|\\[|\\])");function R(t){return 1===t.length?t[0]:t}class v{constructor(t){this.matchTree=(new E).parse(t)}match(t,{allowOverflow:e}={}){if(!t)throw new Error("String is required");const i=O(t.split(""),this.matchTree,!0);if(i&&i.match&&delete i.matchedChars,!i||!i.overflow||e)return i}}function O(t,e,i){if("string"==typeof e){const n=t.join("");return 0===e.indexOf(n)?t.length===e.length?{match:!0,matchedChars:t}:{partialMatch:!0}:0===n.indexOf(e)?i&&t.length>e.length?{overflow:!0}:{match:!0,matchedChars:t.slice(0,e.length)}:void 0}if(Array.isArray(e)){let n=t.slice(),a=0;for(;a<e.length;){const r=O(n,e[a],i&&a===e.length-1);if(!r)return;if(r.overflow)return r;if(!r.match){if(r.partialMatch)return{partialMatch:!0};throw new Error(`Unsupported match result:\n${JSON.stringify(r,null,2)}`)}if(n=n.slice(r.matchedChars.length),0===n.length)return a===e.length-1?{match:!0,matchedChars:t}:{partialMatch:!0};a++}return i?{overflow:!0}:{match:!0,matchedChars:t.slice(0,t.length-n.length)}}switch(e.op){case"|":let n;for(const a of e.args){const e=O(t,a,i);if(e){if(e.overflow)return e;if(e.match)return{match:!0,matchedChars:e.matchedChars};if(!e.partialMatch)throw new Error(`Unsupported match result:\n${JSON.stringify(e,null,2)}`);n=!0}}return n?{partialMatch:!0}:void 0;case"[]":for(const a of e.args)if(t[0]===a)return 1===t.length?{match:!0,matchedChars:t}:i?{overflow:!0}:{match:!0,matchedChars:[a]};return;default:throw new Error(`Unsupported instruction tree: ${e}`)}}const B=F("9",15),G=/[- ]/,W=new RegExp("["+r+"]*\\$1["+r+"]*(\\$\\d["+r+"]*)*$");class L{constructor({state:t,metadata:e}){this.metadata=e,this.resetFormat()}resetFormat(){this.chosenFormat=void 0,this.template=void 0,this.nationalNumberTemplate=void 0,this.populatedNationalNumberTemplate=void 0,this.populatedNationalNumberTemplatePosition=-1}reset(t,e){this.resetFormat(),t?(this.isNANP="1"===t.callingCode(),this.matchingFormats=t.formats(),e.nationalSignificantNumber&&this.narrowDownMatchingFormats(e)):(this.isNANP=void 0,this.matchingFormats=[])}format(e,i){if(n=i.nationalSignificantNumber,a=i.country,r=this.metadata,"IS_POSSIBLE"===t(n,a,r))for(const t of this.matchingFormats){const e=w(i,t,{metadata:this.metadata,shouldTryNationalPrefixFormattingRule:t=>this.shouldTryNationalPrefixFormattingRule(t,{international:i.international,nationalPrefix:i.nationalPrefix}),getSeparatorAfterNationalPrefix:t=>this.getSeparatorAfterNationalPrefix(t)});if(e)return this.resetFormat(),this.chosenFormat=t,this.setNationalNumberTemplate(e.replace(/\d/g,S),i),this.populatedNationalNumberTemplate=e,this.populatedNationalNumberTemplatePosition=this.template.lastIndexOf(S),e}var n,a,r;return this.formatNationalNumberWithNextDigits(e,i)}formatNationalNumberWithNextDigits(t,e){const i=this.chosenFormat,n=this.chooseFormat(e);if(n)return n===i?this.formatNextNationalNumberDigits(t):this.formatNextNationalNumberDigits(e.getNationalDigits())}narrowDownMatchingFormats({nationalSignificantNumber:t,nationalPrefix:e,international:i}){const n=t;let a=n.length-3;a<0&&(a=0),this.matchingFormats=this.matchingFormats.filter(t=>this.formatSuits(t,i,e)&&this.formatMatches(t,n,a)),this.chosenFormat&&-1===this.matchingFormats.indexOf(this.chosenFormat)&&this.resetFormat()}formatSuits(t,e,i){return!(i&&!t.usesNationalPrefix()&&!t.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!e&&!i&&t.nationalPrefixIsMandatoryWhenFormattingInNationalFormat())}formatMatches(t,e,i){const n=t.leadingDigitsPatterns().length;if(0===n)return!0;
1i=Math.min(i,n-1);const a=t.leadingDigitsPatterns()[i];if(e.length<3)try{return void 0!==new v(a).match(e,{allowOverflow:!0})}catch(r){return console.error(r),!0}return new RegExp(`^(${a})`).test(e)}getFormatFormat(t,e){return e?t.internationalFormat():t.format()}chooseFormat(t){for(const e of this.matchingFormats.slice()){if(this.chosenFormat===e)break;if(W.test(this.getFormatFormat(e,t.international))){if(this.createTemplateForFormat(e,t)){this.chosenFormat=e;break}this.matchingFormats=this.matchingFormats.filter(t=>t!==e)}}return this.chosenFormat||this.resetFormat(),this.chosenFormat}createTemplateForFormat(t,e){if(t.pattern().indexOf("|")>=0)return;const i=this.getTemplateForFormat(t,e);return i?(this.setNationalNumberTemplate(i,e),!0):void 0}getSeparatorAfterNationalPrefix(t){return this.isNANP||t&&t.nationalPrefixFormattingRule()&&G.test(t.nationalPrefixFormattingRule())?" ":""}getInternationalPrefixBeforeCountryCallingCode({IDDPrefix:t,missingPlus:e},i){return t?i&&!1===i.spacing?t:t+" ":e?"":"+"}getTemplate(t){if(!this.template)return;let e=-1,i=0;const n=t.international?this.getInternationalPrefixBeforeCountryCallingCode(t,{spacing:!1}):"";for(;i<n.length+t.getDigitsWithoutInternationalPrefix().length;)e=this.template.indexOf(S,e+1),i++;return I(this.template,e+1)}setNationalNumberTemplate(t,e){this.nationalNumberTemplate=t,this.populatedNationalNumberTemplate=t,this.populatedNationalNumberTemplatePosition=-1,e.international?this.template=this.getInternationalPrefixBeforeCountryCallingCode(e).replace(/[\d\+]/g,S)+F(S,e.callingCode.length)+" "+t:this.template=t}getTemplateForFormat(t,{nationalSignificantNumber:e,international:r,nationalPrefix:o,prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix:s}){let l=t.pattern();l=l.replace(/\[([^\[\]])*\]/g,"\\d").replace(/\d(?=[^,}][^,}])/g,"\\d");let h=B.match(l)[0];if(e.length>h.length)return;const u=new RegExp("^"+l+"$"),c=e.replace(/\d/g,"9");u.test(c)&&(h=c);let g,f=this.getFormatFormat(t,r);if(this.shouldTryNationalPrefixFormattingRule(t,{international:r,nationalPrefix:o})){const e=f.replace(n,t.nationalPrefixFormattingRule());if(i(t.nationalPrefixFormattingRule())===(o||"")+i("$1")&&(f=e,g=!0,o)){let t=
1o.length;for(;t>0;)f=f.replace(/\d/,S),t--}}let d=h.replace(new RegExp(l),f).replace(new RegExp("9","g"),S);return g||(s?d=F(S,s.length)+" "+d:o&&(d=F(S,o.length)+this.getSeparatorAfterNationalPrefix(t)+d)),r&&(d=a(d)),d}formatNextNationalNumberDigits(t){const e=function(t,e,i){for(const n of i.split("")){if(t.slice(e+1).search(y)<0)return;e=t.search(y),t=t.replace(y,n)}return[t,e]}(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,t);if(e)return this.populatedNationalNumberTemplate=e[0],this.populatedNationalNumberTemplatePosition=e[1],I(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1);this.resetFormat()}shouldTryNationalPrefixFormattingRule(t,{international:e,nationalPrefix:i}){if(t.nationalPrefixFormattingRule()){const n=t.usesNationalPrefix();if(n&&i||!n&&!e)return!0}}}const $=new RegExp("^["+r+u+"]+$","i"),K="(?:["+c+"]["+r+u+"]*|["+r+u+"]+)",U=new RegExp("[^"+r+u+"]+.*$"),H=/[^\d\[\]]/;class V{constructor({defaultCountry:t,defaultCallingCode:e,metadata:i,onNationalSignificantNumberChange:n}){this.defaultCountry=t,this.defaultCallingCode=e,this.metadata=i,this.onNationalSignificantNumberChange=n}input(t,e){const[n,a]=function(t){let[e,i]=function(t){const e=function(t){const e=t.search(K);if(e<0)return;let i;return"+"===(t=t.slice(e))[0]&&(i=!0,t=t.slice(1)),t=t.replace(U,""),i&&(t="+"+t),t}(t)||"";return"+"===e[0]?[e.slice(1),!0]:[e]}(t);return $.test(e)||(e=""),[e,i]}(t),r=i(n);let o;return a&&(e.digits||(e.startInternationalNumber(void 0,void 0),r||(o=!0))),r&&this.inputDigits(r,e),{digits:r,justLeadingPlus:o}}inputDigits(t,e){const{digits:i}=e,n=i.length<3&&i.length+t.length>=3;if(e.appendDigits(t),n&&this.extractIddPrefix(e),this.isWaitingForCountryCallingCode(e)){if(!this.extractCountryCallingCode(e))return}else e.appendNationalSignificantNumberDigits(t);e.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(e.getNationalDigits(),t=>e.update(t))}isWaitingForCountryCallingCode({international:t,callingCode:e}){return t&&!e}extractCountryCallingCode(t){const{countryCallingCode:e,number:i}=o("+"+t.getDigitsWithoutInternationalPrefix(),t.country,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);if(e)return t.setCallingCode(e),t.update({nationalSignificantNumber:i}),!0}reset(t){if(t){this.hasSelectedNumberingPlan=!0;const e=t._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=e&&H.test(e)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}extractNationalSignificantNumber(t,e){if(!this.hasSelectedNumberingPlan)return;const{nationalPrefix:i,nationalNumber:n,carrierCode:a}=s(t,this.metadata);return n!==t?(this.onExtractedNationalNumber(i,a,n,t,e),!0):void 0}extractAnotherNationalSignificantNumber(t,e,i){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(t,i);if(!this.couldPossiblyExtractAnotherNationalSignificantNumber)return;const{nationalPrefix:n,nationalNumber:a,carrierCode:r}=s(t,this.metadata);return a!==e?(this.onExtractedNationalNumber(n,r,a,t,i),!0):void 0}onExtractedNationalNumber(t,e,i,n,a){let r,o=!1;const s=n.lastIndexOf(i);if(s<0||s!==n.length-i.length)o=!0;else{const e=n.slice(0,s);e&&e!==t&&(r=e)}a({nationalPrefix:t,carrierCode:e,nationalSignificantNumber:i,nationalSignificantNumberIsModified:o,prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix:r}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}reExtractNationalSignificantNumber(t){return!!this.extractAnotherNationalSignificantNumber(t.getNationalDigits(),t.nationalSignificantNumber,e=>t.update(e))||(this.extractIddPrefix(t)||this.fixMissingPlus(t)?(this.extractCallingCodeAndNationalSignificantNumber(t),!0):void 0)}extractIddPrefix(t){const{international:e,IDDPrefix:i,digits:n,nationalSignificantNumber:a}=t;if(e||i)return;const r=l(n,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);return void 0!==r&&r!==n?(t.update({IDDPrefix:n.slice(0,n.length-r.length)}),this.startInternationalNumber(t,{country:void 0,callingCode:void 0}),!0):void 0}fixMissingPlus(t){if(!t.international){const{countryCallingCode:e}=h(t.digits,t.country,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);if(e)return t.update({missingPlus:!0}),this.startInternationalNumber(t,{country:t.country,callingCode:e}),!0}}startInternationalNumber(t,{country:e,callingCode:i}
1){t.startInternationalNumber(e,i),t.nationalSignificantNumber&&(t.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}extractCallingCodeAndNationalSignificantNumber(t){this.extractCountryCallingCode(t)&&this.extractNationalSignificantNumber(t.getNationalDigits(),e=>t.update(e))}}let Z=class{constructor(t,e){this.metadata=new g(e);const[i,n]=this.getCountryAndCallingCode(t);this.defaultCountry=i,this.defaultCallingCode=n,this.reset()}getCountryAndCallingCode(t){let e,i;return t&&(f(t)?(e=t.defaultCountry,i=t.defaultCallingCode):e=t),e&&!this.metadata.hasCountry(e)&&(e=void 0),[e,i]}input(t){const{digits:e,justLeadingPlus:i}=this.parser.input(t,this.state);if(i)this.formattedOutput="+";else if(e){let t;if(this.determineTheCountryIfNeeded(),this.state.nationalSignificantNumber&&this.formatter.narrowDownMatchingFormats(this.state),this.metadata.hasSelectedNumberingPlan()&&(t=this.formatter.format(e,this.state)),void 0===t&&this.parser.reExtractNationalSignificantNumber(this.state)){this.determineTheCountryIfNeeded();const e=this.state.getNationalDigits();e&&(t=this.formatter.format(e,this.state))}this.formattedOutput=t?this.getFullNumber(t):this.getNonFormattedNumber()}return this.formattedOutput}reset(){return this.state=new P({onCountryChange:t=>{this.country=t},onCallingCodeChange:(t,e)=>{this.metadata.selectNumberingPlan(e,t),this.formatter.reset(this.metadata.numberingPlan,this.state),this.parser.reset(this.metadata.numberingPlan)}}),this.formatter=new L({state:this.state,metadata:this.metadata}),this.parser=new V({defaultCountry:this.defaultCountry,defaultCallingCode:this.defaultCallingCode,metadata:this.metadata,state:this.state,onNationalSignificantNumberChange:()=>{this.determineTheCountryIfNeeded(),this.formatter.reset(this.metadata.numberingPlan,this.state)}}),this.state.reset({country:this.defaultCountry,callingCode:this.defaultCallingCode}),this.formattedOutput="",this}isInternational(){return this.state.international}getCallingCode(){if(this.isInternational())return this.state.callingCode}getCountryCallingCode(){return this.getCallingCode()}getCountry(){const{digits:t}=this.state;if(t)return this._getCountry()}_getCountry(){const{country:t}=this.state;return t}determineTheCountryIfNeeded(){this.state.country&&!this.isCountryCallingCodeAmbiguous()||this.determineTheCountry()}getFullNumber(t){if(this.isInternational()){const e=t=>this.formatter.getInternationalPrefixBeforeCountryCallingCode(this.state,{spacing:!!t})+t,{callingCode:i}=this.state;return e(i?t?`${i} ${t}`:i:`${this.state.getDigitsWithoutInternationalPrefix()}`)}return t}getNonFormattedNationalNumberWithPrefix(){const{nationalSignificantNumber:t,prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix:e,nationalPrefix:i}=this.state;let n=t;const a=e||i;return a&&(n=a+n),n}getNonFormattedNumber(){const{nationalSignificantNumberIsModified:t}=this.state;return this.getFullNumber(t?this.state.getNationalDigits():this.getNonFormattedNationalNumberWithPrefix())}getNonFormattedTemplate(){const t=this.getNonFormattedNumber();if(t)return t.replace(/[\+\d]/g,S)}isCountryCallingCodeAmbiguous(){const{callingCode:t}=this.state,e=this.metadata.getCountryCodesForCallingCode(t);return e&&e.length>1}determineTheCountry(){this.state.setCountry(d(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,metadata:this.metadata}))}getNumberValue(){const{digits:t,callingCode:e,country:i,nationalSignificantNumber:n}=this.state;if(t){if(this.isInternational())return e?"+"+e+n:"+"+t;if(i||e)return"+"+(i?this.metadata.countryCallingCode():e)+n}}getNumber(){const{nationalSignificantNumber:t,carrierCode:e,callingCode:i}=this.state;let n=this._getCountry();if(!t)return;if(!n&&!i)return;if(n&&n===this.defaultCountry){const e=new g(this.metadata.metadata);e.selectNumberingPlan(n);const i=e.numberingPlan.callingCode(),a=this.metadata.getCountryCodesForCallingCode(i);if(a.length>1){const e=m(t,{countries:a,metadata:this.metadata.metadata});e&&(n=e)}}const a=new N(n||i,t,this.metadata.metadata);return e&&(a.carrierCode=e),a}isPossible(){const t=this.getNumber();return!!t&&t.isPossible()}isValid(){const t=this.getNumber();return!!t&&t.isValid()}getNationalNumber(){return this.state.nationalSignificantNumber}getChars(){return(this.state.international?"+":"")+this.state.digits}getTemplate(){return this.formatter.getTemplate(this.state)||this.getNon
1FormattedTemplate()||""}};class k extends Z{constructor(t){super(t,C)}}const Y="US",J=new Map([[1,"US"],[7,"RU"],[20,"EG"],[27,"ZA"],[30,"GR"],[31,"NL"],[32,"BE"],[33,"FR"],[34,"ES"],[36,"HU"],[39,"IT"],[40,"RO"],[41,"CH"],[43,"AT"],[44,"GB"],[45,"DK"],[46,"SE"],[47,"NO"],[48,"PL"],[49,"DE"],[51,"PE"],[52,"MX"],[53,"CU"],[54,"AR"],[55,"BR"],[56,"CL"],[57,"CO"],[58,"VE"],[60,"MY"],[61,"AU"],[62,"ID"],[63,"PH"],[64,"NZ"],[65,"SG"],[66,"TH"],[81,"JP"],[82,"KR"],[84,"VN"],[86,"CN"],[90,"TR"],[91,"IN"],[92,"PK"],[93,"AF"],[94,"LK"],[95,"MM"],[98,"IR"],[211,"SS"],[212,"MA"],[213,"DZ"],[216,"TN"],[218,"LY"],[220,"GM"],[221,"SN"],[222,"MR"],[223,"ML"],[224,"GN"],[225,"CI"],[226,"BF"],[227,"NE"],[228,"TG"],[229,"BJ"],[230,"MU"],[231,"LR"],[232,"SL"],[233,"GH"],[234,"NG"],[235,"TD"],[236,"CF"],[237,"CM"],[238,"CV"],[239,"ST"],[240,"GQ"],[241,"GA"],[242,"CG"],[243,"CD"],[244,"AO"],[245,"GW"],[246,"IO"],[247,"AC"],[248,"SC"],[249,"SD"],[250,"RW"],[251,"ET"],[252,"SO"],[253,"DJ"],[254,"KE"],[255,"TZ"],[256,"UG"],[257,"BI"],[258,"MZ"],[260,"ZM"],[261,"MG"],[262,"RE"],[263,"ZW"],[264,"NA"],[265,"MW"],[266,"LS"],[267,"BW"],[268,"SZ"],[269,"KM"],[290,"SH"],[291,"ER"],[297,"AW"],[298,"FO"],[299,"GL"],[350,"GI"],[351,"PT"],[352,"LU"],[353,"IE"],[354,"IS"],[355,"AL"],[356,"MT"],[357,"CY"],[358,"FI"],[359,"BG"],[370,"LT"],[371,"LV"],[372,"EE"],[373,"MD"],[374,"AM"],[375,"BY"],[376,"AD"],[377,"MC"],[378,"SM"],[380,"UA"],[381,"RS"],[382,"ME"],[383,"XK"],[385,"HR"],[386,"SI"],[387,"BA"],[389,"MK"],[420,"CZ"],[421,"SK"],[423,"LI"],[500,"FK"],[501,"BZ"],[502,"GT"],[503,"SV"],[504,"HN"],[505,"NI"],[506,"CR"],[507,"PA"],[508,"PM"],[509,"HT"],[590,"GP"],[591,"BO"],[592,"GY"],[593,"EC"],[594,"GF"],[595,"PY"],[596,"MQ"],[597,"SR"],[598,"UY"],[599,"CW"],[670,"TL"],[672,"NF"],[673,"BN"],[674,"NR"],[675,"PG"],[676,"TO"],[677,"SB"],[678,"VU"],[679,"FJ"],[680,"PW"],[681,"WF"],[682,"CK"],[683,"NU"],[685,"WS"],[686,"KI"],[687,"NC"],[688,"TV"],[689,"PF"],[690,"TK"],[691,"FM"],[692,"MH"],[850,"KP"],[852,"HK"],[853,"MO"],[855,"KH"],[856,"LA"],[880,"BD"],[886,"TW"],[960,"MV"],[961,"LB"],[962,"JO"],[963,"SY"],[964,"IQ"],[965,"KW"],[966,"SA"],[967,"YE"],[968,"OM"],[970,"PS"],[971,"AE"],[972,"IL"],[973,"BH"],[974,"QA"],[975,"BT"],[976,"MN"],[977,"NP"],[992,"TJ"],[993,"TM"],[994,"AZ"],[995,"GE"],[996,"KG"],[998,"UZ"]]),j=/[()\-._ ]+/g;class _{constructor(t){const e=Q(t);this.regionCode=e?t:Y,this.countryCode=this.getCountryCodeFromRegionCode(t),this.formatter=new k(this.regionCode)}format(t){this.updateRegionCodeByPhoneNumber(t),this.formatter.reset();const e=function(t,e,i){let n;for(const a of t.replace(j,""))n=e.input(a);if(1===i&&n?.startsWith("+")){const[t,...e]=n.split(" ");return e.length?`${t} ${e.join("-")}`:n}return n}(t,this.formatter,this.countryCode);return e||""}updateRegionCode(t){const e=Q(t);this.regionCode=e?t:Y,this.countryCode=this.getCountryCodeFromRegionCode(this.regionCode),this.formatter=new k(this.regionCode)}getNormalizedNumber(t){try{return p(t,this.regionCode).format("E.164")}catch{return t}}getNationalNumber(t){if(!this.regionCode||q(t).length<4)return"";try{return p(t,this.regionCode).nationalNumber||""}catch{return""}}getCountryCodeFromRegionCode(t){try{return Q(t)?parseInt(x(t),10):1}catch{return 1}}updateRegionCodeByPhoneNumber(t){if(-1===t.indexOf("+")||q(t).length<1)return;const e=function(t,e=Y){let i;try{i=p(t).country}catch{}if(i)return i;const n=parseInt(x(e),10),a=q(t);let r=Math.min(3,a.length);for(;r>0;){const t=parseInt(a.slice(0,r),10);if(i=J.get(t),i)return t===n?e:i;r--}return e}(t,this.regionCode);this.updateRegionCode(e)}}function Q(t){return b(t)}function q(t){return t.replace(/\D/g,"")}export{_ as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.