Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-international-phone

Package Overview
Dependencies
Maintainers
1
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-international-phone - npm Package Compare versions

Comparing version 1.8.8 to 2.0.0

2

build/components/PhoneInput/PhoneInput.d.ts

@@ -14,3 +14,3 @@ import './PhoneInput.style.scss';

}
export interface PhoneInputProps extends PhoneInputStyleProps, UsePhoneInputConfig {
export interface PhoneInputProps extends UsePhoneInputConfig, PhoneInputStyleProps {
/**

@@ -17,0 +17,0 @@ * @description Hide the dropdown icon. Make country selection not accessible.

interface UseHistoryStateConfig {
size?: number;
overrideLastItemDebounceMS?: number;
}

@@ -8,11 +9,11 @@ interface SetStateConfig {

*/
overrideLastHistoryItem?: boolean;
overrideLastItem?: boolean;
}
type UseHistoryStateReturn = [
string,
(v: string, config?: SetStateConfig) => void,
() => boolean,
() => boolean
];
export declare const useHistoryState: (initialValue: string, config?: UseHistoryStateConfig) => UseHistoryStateReturn;
type HistoryActionResult<T> = {
success: false;
} | {
success: true;
value: T;
};
export declare function useHistoryState<T extends Record<string, unknown> | string>(initialValue: T | (() => T), config?: UseHistoryStateConfig): readonly [T, (value: T, config?: SetStateConfig) => void, () => HistoryActionResult<T>, () => HistoryActionResult<T>];
export {};

@@ -1,8 +0,8 @@

import { CountryIso2 } from '../types';
import { UsePhoneConfig } from './usePhone';
export interface UsePhoneInputConfig extends Omit<UsePhoneConfig, 'country' | 'inputRef' | 'onCountryGuess' | 'onPhoneFormat'> {
import { CountryData, CountryIso2 } from '../types';
export declare const MASK_CHAR = ".";
export interface UsePhoneInputConfig {
/**
* @description Initial country value (iso2).
* @description Default country value (iso2).
*/
initialCountry: CountryIso2;
defaultCountry: CountryIso2;
/**

@@ -13,19 +13,63 @@ * @description phone value

/**
* @description Hide space after country dial code
* @description Array of available countries for guessing
* @default defaultCountries // full country list
*/
countries?: CountryData[];
/**
* @description Prefix for phone value.
* @default "+"
*/
prefix?: string;
/**
* @description This mask will apply on countries that does not have specified mask.
* @default "............" // 12 chars
*/
defaultMask?: string;
/**
* @description Char that renders after country dial code.
* @default " "
*/
charAfterDialCode?: string;
/**
* @description
* Save value to history if there were not any changes in provided milliseconds timeslot.
* Undo/redo (ctrl+z/ctrl+shift+z) works only with values that are saved in history.
* @default 200
*/
historySaveDebounceMS?: number;
/**
* @description Disable country guess on value change.
* @default false
*/
hideSpaceAfterDialCode?: boolean;
disableCountryGuess?: boolean;
/**
* @description Callback that calls on country change
* @params *phone* - new phone value
* @default undefined
* @description
* Disable dial code prefill on initialization.
* Dial code prefill works only when "empty" phone value have been provided.
* @default false
*/
onCountryChange?: (phone: string) => void;
disableDialCodePrefill?: boolean;
/**
* @description
* Always display the dial code.
* Dial code can't be removed/changed by keyboard events, but it can be changed by pasting another country phone value.
* @default false
*/
forceDialCode?: boolean;
/**
* @description Phone value will not include passed *dialCode* and *prefix* if set to *true*.
* @ignore
* - *disableCountryGuess* value will be ignored and set to *true*.
* - *forceDialCode* value will be ignored and set to *false*.
* @default false
*/
disableDialCodeAndPrefix?: boolean;
}
export declare const usePhoneInput: ({ initialCountry, value, prefix, countries, disableDialCodeAndPrefix, hideSpaceAfterDialCode, onCountryChange, ...restConfig }: UsePhoneInputConfig) => {
export declare const defaultConfig: Required<Omit<UsePhoneInputConfig, 'defaultCountry'>>;
export declare const usePhoneInput: ({ defaultCountry, value, countries, prefix, defaultMask, charAfterDialCode, historySaveDebounceMS, disableCountryGuess, disableDialCodePrefill, forceDialCode, disableDialCodeAndPrefix, }: UsePhoneInputConfig) => {
phone: string;
country: CountryIso2;
setCountry: (countryIso2: CountryIso2) => void;
handlePhoneValueChange: (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => string;
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
country: CountryIso2;
setCountry: (countryIso2: CountryIso2) => void;
};

@@ -8,4 +8,2 @@ export { CountrySelector } from './components/CountrySelector/CountrySelector';

export { defaultCountries } from './data/countryData';
export type { UsePhoneConfig } from './hooks/usePhone';
export { usePhone } from './hooks/usePhone';
export { usePhoneInput } from './hooks/usePhoneInput';

@@ -12,0 +10,0 @@ export { usePhoneValidation } from './hooks/usePhoneValidation';

@@ -1,1 +0,1 @@

!function(e,a){"object"==typeof exports&&"object"==typeof module?module.exports=a(require("react")):"function"==typeof define&&define.amd?define(["react"],a):"object"==typeof exports?exports["react-international-phone"]=a(require("react")):e["react-international-phone"]=a(e.react)}(this,(e=>(()=>{"use strict";var a={0:(e,a,r)=>{r.r(a)},374:(e,a,r)=>{r.r(a)},840:(e,a,r)=>{r.r(a)},481:(e,a,r)=>{r.r(a)},549:(e,a,r)=>{r.r(a)},153:function(e,a,r){var t=this&&this.__assign||function(){return t=Object.assign||function(e){for(var a,r=1,t=arguments.length;r<t;r++)for(var n in a=arguments[r])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},t.apply(this,arguments)},n=this&&this.__createBinding||(Object.create?function(e,a,r,t){void 0===t&&(t=r);var n=Object.getOwnPropertyDescriptor(a,r);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(e,t,n)}:function(e,a,r,t){void 0===t&&(t=r),e[t]=a[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:!0,value:a})}:function(e,a){e.default=a}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(a,e,r);return o(a,e),a},u=this&&this.__rest||function(e,a){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&a.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(t=Object.getOwnPropertySymbols(e);n<t.length;n++)a.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(e,t[n])&&(r[t[n]]=e[t[n]])}return r};Object.defineProperty(a,"__esModule",{value:!0}),a.CountrySelector=void 0,r(0);var l=i(r(156)),s=r(946),c=r(515),d=r(332),f=r(425),p=r(60);a.CountrySelector=function(e){var a,r,n=e.selectedCountry,o=e.onSelect,i=e.disabled,y=e.hideDropdown,h=e.countries,v=void 0===h?s.defaultCountries:h,m=e.renderButtonWrapper,b=u(e,["selectedCountry","onSelect","disabled","hideDropdown","countries","renderButtonWrapper"]),C=(0,l.useState)(!1),g=C[0],P=C[1],_=(0,l.useMemo)((function(){if(n)return(0,d.getCountry)({value:n,field:"iso2",countries:v})}),[v,n]),O=(0,l.useRef)(null);return l.default.createElement("div",{className:(0,c.buildClassNames)({addPrefix:["country-selector"],rawClassNames:[b.className]}),style:b.style,ref:O},(a={title:null==_?void 0:_.name,onClick:function(){return P((function(e){return!e}))},onMouseDown:function(e){return e.preventDefault()},onKeyDown:function(e){e.key&&["ArrowUp","ArrowDown"].includes(e.key)&&(e.preventDefault(),P(!0))},disabled:y||i,role:"combobox","aria-label":"Country selector","aria-haspopup":"listbox","aria-expanded":g},r=l.default.createElement("div",{className:(0,c.buildClassNames)({addPrefix:["country-selector-button__button-content"],rawClassNames:[b.buttonContentWrapperClassName]}),style:b.buttonContentWrapperStyle},l.default.createElement(f.FlagEmoji,{iso2:n,className:(0,c.buildClassNames)({addPrefix:["country-selector-button__flag-emoji",i&&"country-selector-button__flag-emoji--disabled"],rawClassNames:[b.flagClassName]}),style:t({visibility:n?"visible":"hidden"},b.flagStyle)}),!y&&l.default.createElement("div",{className:(0,c.buildClassNames)({addPrefix:["country-selector-button__dropdown-arrow",i&&"country-selector-button__dropdown-arrow--disabled",g&&"country-selector-button__dropdown-arrow--active"],rawClassNames:[b.dropdownArrowClassName]}),style:b.dropdownArrowStyle})),m?m({children:r,rootProps:a}):l.default.createElement("button",t({},a,{type:"button",className:(0,c.buildClassNames)({addPrefix:["country-selector-button",g&&"country-selector-button--active",i&&"country-selector-button--disabled",y&&"country-selector-button--hide-dropdown"],rawClassNames:[b.buttonClassName]}),"data-country":n,style:b.buttonStyle}),r)),l.default.createElement(p.CountrySelectorDropdown,t({show:g,countries:v,onSelect:function(e){P(!1),null==o||o(e)},selectedCountry:n,onClose:function(){P(!1)}},b.dropdownStyleProps)))}},60:function(e,a,r){var t=this&&this.__assign||function(){return t=Object.assign||function(e){for(var a,r=1,t=arguments.length;r<t;r++)for(var n in a=arguments[r])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},t.apply(this,arguments)},n=this&&this.__createBinding||(Object.create?function(e,a,r,t){void 0===t&&(t=r);var n=Object.getOwnPropertyDescriptor(a,r);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(e,t,n)}:function(e,a,r,t){void 0===t&&(t=r),e[t]=a[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:!0,value:a})}:function(e,a){e.default=a}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(a,e,r);return o(a,e),a},u=this&&this.__rest||function(e,a){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&a.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(t=Object.getOwnPropertySymbols(e);n<t.length;n++)a.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(e,t[n])&&(r[t[n]]=e[t[n]])}return r};Object.defineProperty(a,"__esModule",{value:!0}),a.CountrySelectorDropdown=void 0,r(374);var l=i(r(156)),s=r(946),c=r(515),d=r(332),f=r(425);a.CountrySelectorDropdown=function(e){var a=e.show,r=e.dialCodePrefix,n=void 0===r?"+":r,o=e.selectedCountry,i=e.countries,p=void 0===i?s.defaultCountries:i,y=e.onSelect,h=e.onClose,v=u(e,["show","dialCodePrefix","selectedCountry","countries","onSelect","onClose"]),m=(0,l.useRef)(null),b=(0,l.useRef)(),C=(0,l.useCallback)((function(e){return p.findIndex((function(a){return(0,d.parseCountry)(a).iso2===e}))}),[p]),g=(0,l.useState)(C(o)),P=g[0],_=g[1],O=function(){b.current!==o&&_(C(o))},w=(0,l.useCallback)((function(e){_(C(e.iso2)),null==y||y(e)}),[y,C]),j=function(e){var a=p.length-1;_((function(r){var t,n=(t=r,"prev"===e?t-1:"next"===e?t+1:"last"===e?a:0);return n<0?0:n>a?a:n}))},D=(0,l.useCallback)((function(){if(m.current&&void 0!==P){var e=(0,d.parseCountry)(p[P]).iso2;if(e!==b.current){var a=m.current.querySelector('[data-country="'.concat(e,'"]'));a&&((0,d.scrollToChild)(m.current,a),b.current=e)}}}),[P,p]);return(0,l.useEffect)((function(){D()}),[P,D]),(0,l.useEffect)((function(){m.current&&(a?m.current.focus():O())}),[a]),(0,l.useEffect)((function(){O()}),[o]),l.default.createElement("ul",{ref:m,role:"listbox",className:(0,c.buildClassNames)({addPrefix:["country-selector-dropdown"],rawClassNames:[v.className]}),style:t({display:a?"block":"none"},v.style),onKeyDown:function(e){if("Enter"!==e.key){if("Escape"!==e.key)return"ArrowUp"===e.key?(e.preventDefault(),void j("prev")):"ArrowDown"===e.key?(e.preventDefault(),void j("next")):"PageUp"===e.key?(e.preventDefault(),void j("first")):"PageDown"===e.key?(e.preventDefault(),void j("last")):void 0;null==h||h()}else{var a=(0,d.parseCountry)(p[P]);w(a)}},onBlur:h,tabIndex:-1,"aria-activedescendant":"".concat((0,d.parseCountry)(p[P]).iso2,"-option")},p.map((function(e,a){var r=(0,d.parseCountry)(e),t=r.iso2===o,i=a===P;return l.default.createElement("li",{key:r.iso2,"data-country":r.iso2,role:"option","aria-selected":t,"aria-label":"".concat(r.name," ").concat(n).concat(r.dialCode),id:"".concat(r.iso2,"-option"),className:(0,c.buildClassNames)({addPrefix:["country-selector-dropdown__list-item",t&&"country-selector-dropdown__list-item--selected",i&&"country-selector-dropdown__list-item--focused"],rawClassNames:[v.listItemClassName]}),onClick:function(){return w(r)},style:v.listItemStyle},l.default.createElement(f.FlagEmoji,{iso2:r.iso2,className:(0,c.buildClassNames)({addPrefix:["country-selector-dropdown__list-item-flag-emoji"],rawClassNames:[v.listItemFlagClassName]}),style:v.listItemFlagStyle}),l.default.createElement("span",{className:(0,c.buildClassNames)({addPrefix:["country-selector-dropdown__list-item-country-name"],rawClassNames:[v.listItemCountryNameClassName]}),style:v.listItemCountryNameStyle},r.name),l.default.createElement("span",{className:(0,c.buildClassNames)({addPrefix:["country-selector-dropdown__list-item-dial-code"],rawClassNames:[v.listItemDialCodeClassName]}),style:v.listItemDialCodeStyle},n,r.dialCode))})))}},7:function(e,a,r){var t=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:!0}),a.DialCodePreview=void 0,r(840);var n=t(r(156)),o=r(515);a.DialCodePreview=function(e){var a=e.dialCode,r=e.prefix,t=e.disabled,i=e.style,u=e.className;return n.default.createElement("div",{className:(0,o.buildClassNames)({addPrefix:["dial-code-preview",t&&"dial-code-preview--disabled"],rawClassNames:[u]}),style:i},"".concat(r).concat(a))}},425:function(e,a,r){var t=this&&this.__assign||function(){return t=Object.assign||function(e){for(var a,r=1,t=arguments.length;r<t;r++)for(var n in a=arguments[r])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},t.apply(this,arguments)},n=this&&this.__rest||function(e,a){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&a.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(t=Object.getOwnPropertySymbols(e);n<t.length;n++)a.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(e,t[n])&&(r[t[n]]=e[t[n]])}return r},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:!0}),a.FlagEmoji=void 0,r(481);var i=o(r(156)),u=r(515),l="abcdefghijklmnopqrstuvwxyz".split("").reduce((function(e,a,r){var n,o,i;return t(t({},e),((n={})[a]=(o=r,i=parseInt("1f1e6",16),Number(i+o).toString(16)),n))}),{});a.FlagEmoji=function(e){var a=e.iso2,r=e.size,o=void 0===r?"24px":r,s=e.protocol,c=void 0===s?"https":s,d=e.disableLazyLoading,f=e.className,p=n(e,["iso2","size","protocol","disableLazyLoading","className"]);if(!a)return i.default.createElement("img",t({width:o,height:o},p));var y=function(e){return[l[e[0]],l[e[1]]].join("-")}(a),h="".concat(c,"://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/svg/").concat(y,".svg");return i.default.createElement("img",t({className:(0,u.buildClassNames)({addPrefix:["flag-emoji"],rawClassNames:[f]}),src:h,width:o,height:o,draggable:!1,"data-country":a,loading:d?void 0:"lazy"},p))}},28:function(e,a,r){var t=this&&this.__assign||function(){return t=Object.assign||function(e){for(var a,r=1,t=arguments.length;r<t;r++)for(var n in a=arguments[r])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},t.apply(this,arguments)},n=this&&this.__createBinding||(Object.create?function(e,a,r,t){void 0===t&&(t=r);var n=Object.getOwnPropertyDescriptor(a,r);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(e,t,n)}:function(e,a,r,t){void 0===t&&(t=r),e[t]=a[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:!0,value:a})}:function(e,a){e.default=a}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(a,e,r);return o(a,e),a},u=this&&this.__rest||function(e,a){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&a.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(t=Object.getOwnPropertySymbols(e);n<t.length;n++)a.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(e,t[n])&&(r[t[n]]=e[t[n]])}return r};Object.defineProperty(a,"__esModule",{value:!0}),a.PhoneInput=void 0,r(549);var l=i(r(156)),s=r(946),c=r(882),d=r(515),f=r(332),p=r(153),y=r(7);a.PhoneInput=function(e){var a,r=e.hideDropdown,n=e.placeholder,o=e.disabled,i=e.showDisabledDialCodeAndPrefix,h=e.inputProps,v=e.onChange,m=e.style,b=e.className,C=e.inputStyle,g=e.inputClassName,P=e.countrySelectorStyleProps,_=e.dialCodePreviewStyleProps,O=e.countries,w=void 0===O?s.defaultCountries:O,j=u(e,["hideDropdown","placeholder","disabled","showDisabledDialCodeAndPrefix","inputProps","onChange","style","className","inputStyle","inputClassName","countrySelectorStyleProps","dialCodePreviewStyleProps","countries"]),D=(0,c.usePhoneInput)(t(t({},j),{countries:w,onCountryChange:function(e){null==v||v(e)}})),S=D.phone,x=D.inputRef,M=D.country,N=D.setCountry,k=D.handlePhoneValueChange,A=(0,l.useMemo)((function(){if(M)return(0,f.getCountry)({value:M,field:"iso2",countries:w})}),[w,M]),E=j.disableDialCodeAndPrefix&&i&&(null==A?void 0:A.dialCode);return l.default.createElement("div",{className:(0,d.buildClassNames)({addPrefix:["input-container"],rawClassNames:[b]}),style:m},l.default.createElement(p.CountrySelector,t({onSelect:function(e){return N(e.iso2)},selectedCountry:M,countries:w,disabled:o,hideDropdown:r},P)),E&&l.default.createElement(y.DialCodePreview,t({dialCode:A.dialCode,prefix:null!==(a=j.prefix)&&void 0!==a?a:"+",disabled:o},_)),l.default.createElement("input",t({onChange:function(e){var a=k(e);null==v||v(a)},value:S,type:"tel",ref:x,className:(0,d.buildClassNames)({addPrefix:["input",o&&"input--disabled"],rawClassNames:[g]}),placeholder:n,disabled:o,style:C},h)))}},946:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.defaultCountries=void 0,a.defaultCountries=[["Afghanistan",["asia"],"af","93"],["Albania",["europe"],"al","355"],["Algeria",["africa","north-africa"],"dz","213"],["Andorra",["europe"],"ad","376"],["Angola",["africa"],"ao","244"],["Antigua and Barbuda",["america","carribean"],"ag","1268"],["Argentina",["america","south-america"],"ar","54","(..) ........",0,["11","221","223","261","264","2652","280","2905","291","2920","2966","299","341","342","343","351","376","379","381","3833","385","387","388"]],["Armenia",["asia","ex-ussr"],"am","374",".. ......"],["Aruba",["america","carribean"],"aw","297"],["Australia",["oceania"],"au","61","(..) .... ....",0,["2","3","4","7","8","02","03","04","07","08"]],["Austria",["europe","eu-union"],"at","43"],["Azerbaijan",["asia","ex-ussr"],"az","994","(..) ... .. .."],["Bahamas",["america","carribean"],"bs","1242"],["Bahrain",["middle-east"],"bh","973"],["Bangladesh",["asia"],"bd","880"],["Barbados",["america","carribean"],"bb","1246"],["Belarus",["europe","ex-ussr"],"by","375","(..) ... .. .."],["Belgium",["europe","eu-union"],"be","32","... .. .. .."],["Belize",["america","central-america"],"bz","501"],["Benin",["africa"],"bj","229"],["Bhutan",["asia"],"bt","975"],["Bolivia",["america","south-america"],"bo","591"],["Bosnia and Herzegovina",["europe","ex-yugos"],"ba","387"],["Botswana",["africa"],"bw","267"],["Brazil",["america","south-america"],"br","55","(..) ........."],["British Indian Ocean Territory",["asia"],"io","246"],["Brunei",["asia"],"bn","673"],["Bulgaria",["europe","eu-union"],"bg","359"],["Burkina Faso",["africa"],"bf","226"],["Burundi",["africa"],"bi","257"],["Cambodia",["asia"],"kh","855"],["Cameroon",["africa"],"cm","237"],["Canada",["america","north-america"],"ca","1","(...) ...-....",1,["204","226","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde",["africa"],"cv","238"],["Caribbean Netherlands",["america","carribean"],"bq","599","",1],["Central African Republic",["africa"],"cf","236"],["Chad",["africa"],"td","235"],["Chile",["america","south-america"],"cl","56"],["China",["asia"],"cn","86","... .... ...."],["Colombia",["america","south-america"],"co","57","... ... ...."],["Comoros",["africa"],"km","269"],["Congo",["africa"],"cd","243"],["Congo",["africa"],"cg","242"],["Costa Rica",["america","central-america"],"cr","506","....-...."],["Côte d'Ivoire",["africa"],"ci","225",".. .. .. .."],["Croatia",["europe","eu-union","ex-yugos"],"hr","385"],["Cuba",["america","carribean"],"cu","53"],["Curaçao",["america","carribean"],"cw","599","",0],["Cyprus",["europe","eu-union"],"cy","357",".. ......"],["Czech Republic",["europe","eu-union"],"cz","420","... ... ..."],["Denmark",["europe","eu-union","baltic"],"dk","45",".. .. .. .."],["Djibouti",["africa"],"dj","253"],["Dominica",["america","carribean"],"dm","1767"],["Dominican Republic",["america","carribean"],"do","1","",2],["Ecuador",["america","south-america"],"ec","593"],["Egypt",["africa","north-africa"],"eg","20"],["El Salvador",["america","central-america"],"sv","503","....-...."],["Equatorial Guinea",["africa"],"gq","240"],["Eritrea",["africa"],"er","291"],["Estonia",["europe","eu-union","ex-ussr","baltic"],"ee","372",".... ......"],["Ethiopia",["africa"],"et","251"],["Fiji",["oceania"],"fj","679"],["Finland",["europe","eu-union","baltic"],"fi","358",".. ... .. .."],["France",["europe","eu-union"],"fr","33",". .. .. .. .."],["French Guiana",["america","south-america"],"gf","594"],["French Polynesia",["oceania"],"pf","689"],["Gabon",["africa"],"ga","241"],["Gambia",["africa"],"gm","220"],["Georgia",["asia","ex-ussr"],"ge","995"],["Germany",["europe","eu-union","baltic"],"de","49",".... ........"],["Ghana",["africa"],"gh","233"],["Greece",["europe","eu-union"],"gr","30"],["Grenada",["america","carribean"],"gd","1473"],["Guadeloupe",["america","carribean"],"gp","590","",0],["Guam",["oceania"],"gu","1671"],["Guatemala",["america","central-america"],"gt","502","....-...."],["Guinea",["africa"],"gn","224"],["Guinea-Bissau",["africa"],"gw","245"],["Guyana",["america","south-america"],"gy","592"],["Haiti",["america","carribean"],"ht","509","....-...."],["Honduras",["america","central-america"],"hn","504"],["Hong Kong",["asia"],"hk","852",".... ...."],["Hungary",["europe","eu-union"],"hu","36"],["Iceland",["europe"],"is","354","... ...."],["India",["asia"],"in","91",".....-....."],["Indonesia",["asia"],"id","62"],["Iran",["middle-east"],"ir","98","... ... ...."],["Iraq",["middle-east"],"iq","964"],["Ireland",["europe","eu-union"],"ie","353",".. ......."],["Israel",["middle-east"],"il","972","... ... ...."],["Italy",["europe","eu-union"],"it","39","... .......",0],["Jamaica",["america","carribean"],"jm","1876"],["Japan",["asia"],"jp","81",".. .... ...."],["Jordan",["middle-east"],"jo","962"],["Kazakhstan",["asia","ex-ussr"],"kz","7","... ...-..-..",0,["310","311","312","313","315","318","321","324","325","326","327","336","7172","73622"]],["Kenya",["africa"],"ke","254"],["Kiribati",["oceania"],"ki","686"],["Kosovo",["europe","ex-yugos"],"xk","383"],["Kuwait",["middle-east"],"kw","965"],["Kyrgyzstan",["asia","ex-ussr"],"kg","996","... ... ..."],["Laos",["asia"],"la","856"],["Latvia",["europe","eu-union","ex-ussr","baltic"],"lv","371",".. ... ..."],["Lebanon",["middle-east"],"lb","961"],["Lesotho",["africa"],"ls","266"],["Liberia",["africa"],"lr","231"],["Libya",["africa","north-africa"],"ly","218"],["Liechtenstein",["europe"],"li","423"],["Lithuania",["europe","eu-union","ex-ussr","baltic"],"lt","370"],["Luxembourg",["europe","eu-union"],"lu","352"],["Macau",["asia"],"mo","853"],["Macedonia",["europe","ex-yugos"],"mk","389"],["Madagascar",["africa"],"mg","261"],["Malawi",["africa"],"mw","265"],["Malaysia",["asia"],"my","60","..-....-...."],["Maldives",["asia"],"mv","960"],["Mali",["africa"],"ml","223"],["Malta",["europe","eu-union"],"mt","356"],["Marshall Islands",["oceania"],"mh","692"],["Martinique",["america","carribean"],"mq","596"],["Mauritania",["africa"],"mr","222"],["Mauritius",["africa"],"mu","230"],["Mexico",["america","central-america"],"mx","52","... ... ....",0,["33","55","81","229","656","664","774","998"]],["Micronesia",["oceania"],"fm","691"],["Moldova",["europe"],"md","373","(..) ..-..-.."],["Monaco",["europe"],"mc","377"],["Mongolia",["asia"],"mn","976"],["Montenegro",["europe","ex-yugos"],"me","382"],["Morocco",["africa","north-africa"],"ma","212"],["Mozambique",["africa"],"mz","258"],["Myanmar",["asia"],"mm","95"],["Namibia",["africa"],"na","264"],["Nauru",["africa"],"nr","674"],["Nepal",["asia"],"np","977"],["Netherlands",["europe","eu-union"],"nl","31",".. ........"],["New Caledonia",["oceania"],"nc","687"],["New Zealand",["oceania"],"nz","64","...-...-...."],["Nicaragua",["america","central-america"],"ni","505"],["Niger",["africa"],"ne","227"],["Nigeria",["africa"],"ng","234"],["North Korea",["asia"],"kp","850"],["Norway",["europe","baltic"],"no","47","... .. ..."],["Oman",["middle-east"],"om","968"],["Pakistan",["asia"],"pk","92","...-......."],["Palau",["oceania"],"pw","680"],["Palestine",["middle-east"],"ps","970"],["Panama",["america","central-america"],"pa","507"],["Papua New Guinea",["oceania"],"pg","675"],["Paraguay",["america","south-america"],"py","595"],["Peru",["america","south-america"],"pe","51"],["Philippines",["asia"],"ph","63",".... ......."],["Poland",["europe","eu-union","baltic"],"pl","48","...-...-..."],["Portugal",["europe","eu-union"],"pt","351"],["Puerto Rico",["america","carribean"],"pr","1","",3],["Qatar",["middle-east"],"qa","974"],["Réunion",["africa"],"re","262"],["Romania",["europe","eu-union"],"ro","40"],["Russia",["europe","asia","ex-ussr","baltic"],"ru","7","(...) ...-..-..",1],["Rwanda",["africa"],"rw","250"],["Saint Kitts and Nevis",["america","carribean"],"kn","1869"],["Saint Lucia",["america","carribean"],"lc","1758"],["Saint Vincent and the Grenadines",["america","carribean"],"vc","1784"],["Samoa",["oceania"],"ws","685"],["San Marino",["europe"],"sm","378"],["São Tomé and Príncipe",["africa"],"st","239"],["Saudi Arabia",["middle-east"],"sa","966"],["Senegal",["africa"],"sn","221"],["Serbia",["europe","ex-yugos"],"rs","381"],["Seychelles",["africa"],"sc","248"],["Sierra Leone",["africa"],"sl","232"],["Singapore",["asia"],"sg","65","....-...."],["Slovakia",["europe","eu-union"],"sk","421"],["Slovenia",["europe","eu-union","ex-yugos"],"si","386"],["Solomon Islands",["oceania"],"sb","677"],["Somalia",["africa"],"so","252"],["South Africa",["africa"],"za","27"],["South Korea",["asia"],"kr","82","... .... ...."],["South Sudan",["africa","north-africa"],"ss","211"],["Spain",["europe","eu-union"],"es","34","... ... ..."],["Sri Lanka",["asia"],"lk","94"],["Sudan",["africa"],"sd","249"],["Suriname",["america","south-america"],"sr","597"],["Swaziland",["africa"],"sz","268"],["Sweden",["europe","eu-union","baltic"],"se","46","(...) ...-..."],["Switzerland",["europe"],"ch","41",".. ... .. .."],["Syria",["middle-east"],"sy","963"],["Taiwan",["asia"],"tw","886"],["Tajikistan",["asia","ex-ussr"],"tj","992"],["Tanzania",["africa"],"tz","255"],["Thailand",["asia"],"th","66"],["Timor-Leste",["asia"],"tl","670"],["Togo",["africa"],"tg","228"],["Tonga",["oceania"],"to","676"],["Trinidad and Tobago",["america","carribean"],"tt","1868"],["Tunisia",["africa","north-africa"],"tn","216"],["Turkey",["europe"],"tr","90","... ... .. .."],["Turkmenistan",["asia","ex-ussr"],"tm","993"],["Tuvalu",["asia"],"tv","688"],["Uganda",["africa"],"ug","256"],["Ukraine",["europe","ex-ussr"],"ua","380","(..) ... .. .."],["United Arab Emirates",["middle-east"],"ae","971"],["United Kingdom",["europe","eu-union"],"gb","44",".... ......"],["United States",["america","north-america"],"us","1","(...) ...-....",0,["201","202","203","205","206","207","208","209","210","212","213","214","215","216","217","218","219","225","228","229","231","239","248","251","252","253","254","256","260","262","269","270","276","281","301","302","303","304","305","307","308","309","310","312","313","314","315","316","317","318","319","320","321","323","325","330","334","336","337","352","360","361","386","401","402","404","405","406","407","408","409","410","412","413","414","415","417","419","423","425","432","434","435","440","478","479","480","501","502","503","504","505","507","508","509","510","512","513","515","516","517","518","520","530","540","541","559","561","562","563","570","573","574","575","580","585","586","601","602","603","605","606","607","608","609","610","612","614","615","616","617","618","619","620","623","626","630","631","636","641","650","651","660","661","662","701","702","703","704","706","707","708","712","713","714","715","716","717","718","719","724","727","731","732","734","740","757","760","763","765","770","772","773","775","781","785","801","802","803","804","805","806","808","810","812","813","814","815","816","817","818","828","830","831","843","845","847","850","856","858","859","860","863","864","865","870","901","903","904","906","907","908","909","910","912","913","914","915","916","918","919","920","925","928","931","936","937","940","941","949","951","952","954","956","970","972","973","978","979","985","989"]],["Uruguay",["america","south-america"],"uy","598"],["Uzbekistan",["asia","ex-ussr"],"uz","998",".. ... .. .."],["Vanuatu",["oceania"],"vu","678"],["Vatican City",["europe"],"va","39",".. .... ....",1],["Venezuela",["america","south-america"],"ve","58"],["Vietnam",["asia"],"vn","84"],["Yemen",["middle-east"],"ye","967"],["Zambia",["africa"],"zm","260"],["Zimbabwe",["africa"],"zw","263"]]},11:function(e,a,r){var t=this&&this.__assign||function(){return t=Object.assign||function(e){for(var a,r=1,t=arguments.length;r<t;r++)for(var n in a=arguments[r])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},t.apply(this,arguments)},n=this&&this.__spreadArray||function(e,a,r){if(r||2===arguments.length)for(var t,n=0,o=a.length;n<o;n++)!t&&n in a||(t||(t=Array.prototype.slice.call(a,0,n)),t[n]=a[n]);return e.concat(t||Array.prototype.slice.call(a))};Object.defineProperty(a,"__esModule",{value:!0}),a.useHistoryState=void 0;var o=r(156),i={size:20};a.useHistoryState=function(e,a){var r=t(t({},i),a).size,u=(0,o.useState)(e),l=u[0],s=u[1],c=(0,o.useState)([e]),d=c[0],f=c[1],p=(0,o.useState)(0),y=p[0],h=p[1],v=(0,o.useCallback)((function(e,a){if(e!==l){if(null==a?void 0:a.overrideLastHistoryItem)f((function(a){return n(n([],a.slice(0,y),!0),[e],!1)}));else{var t=d.length>=r;f((function(a){return n(n([],a.slice(t?1:0,y+1),!0),[e],!1)})),t||h((function(e){return e+1}))}s(e)}}),[l,y,d.length,r]),m=(0,o.useCallback)((function(){return!(y<=0||(s(d[y-1]),h((function(e){return e-1})),0))}),[d,y]),b=(0,o.useCallback)((function(){return!(y+1>=d.length||(s(d[y+1]),h((function(e){return e+1})),0))}),[d,y]);return[l,v,m,b]}},452:function(e,a,r){var t=this&&this.__assign||function(){return t=Object.assign||function(e){for(var a,r=1,t=arguments.length;r<t;r++)for(var n in a=arguments[r])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},t.apply(this,arguments)};Object.defineProperty(a,"__esModule",{value:!0}),a.usePhone=a.defaultPhoneConfig=a.MASK_CHAR=void 0;var n=r(156),o=r(946),i=r(332),u=r(11),l=r(795);a.MASK_CHAR=".",a.defaultPhoneConfig={prefix:"+",defaultMask:"............",charAfterDialCode:" ",historySaveDebounceMS:200,disableCountryGuess:!1,disableDialCodePrefill:!1,forceDialCode:!1,disableDialCodeAndPrefix:!1,countries:o.defaultCountries},a.usePhone=function(e,r){var o=t(t({},a.defaultPhoneConfig),r),s=o.country,c=o.countries,d=o.prefix,f=o.defaultMask,p=o.charAfterDialCode,y=o.historySaveDebounceMS,h=o.disableCountryGuess,v=o.disableDialCodePrefill,m=o.forceDialCode,b=o.disableDialCodeAndPrefix,C=o.onCountryGuess,g=o.onPhoneUpdate,P=!b&&!h,_=(0,l.useTimer)(),O=(0,n.useMemo)((function(){if(s)return(0,i.getCountry)({value:s,field:"iso2",countries:c})}),[s,c]),w=function(e,r){var t,n=void 0===r?{}:r,o=n.trimNonDigitsEnd,u=n.insertDialCodeOnEmpty,l=n.forceDisableCountryGuess,s=n.forcedCountry,y=l||!P||s?void 0:(0,i.guessCountryByPartialNumber)({phone:e,countries:c,currentCountryIso2:null==O?void 0:O.iso2}),h=null!==(t=null!=s?s:null==y?void 0:y.country)&&void 0!==t?t:O;return{phone:h?(0,i.formatPhone)(e,{prefix:d,mask:h.format||f,maskChar:a.MASK_CHAR,dialCode:h.dialCode,trimNonDigitsEnd:o,charAfterDialCode:p,forceDialCode:m,insertDialCodeOnEmpty:u,disableDialCodeAndPrefix:b}):e,countryGuessResult:y,formatCountry:h}},j=(0,u.useHistoryState)(w(e,{insertDialCodeOnEmpty:!v}).phone),D=j[0],S=j[1],x=j[2],M=j[3],N=(0,n.useState)(!1),k=N[0],A=N[1],E=function(e,a){var r,t=void 0===a?{}:a,n=t.deletion,o=t.cursorPosition,u=t.insertDialCodeOnEmpty,l=t.inserted,c=t.forcedCountry,f=e,p=o;m&&!b&&O&&!(0,i.removeNonDigits)(e).startsWith(O.dialCode)&&e&&(l&&e.startsWith(d)&&e.length-(null!=o?o:0)==0?f=e:(f=D,p=0));var h=w(f,{trimNonDigitsEnd:"backward"===n,insertDialCodeOnEmpty:u||!k&&!v,forceDisableCountryGuess:m&&!!n&&(0,i.removeNonDigits)(f).length<(null!==(r=null==O?void 0:O.dialCode.length)&&void 0!==r?r:0),forcedCountry:c}),j=h.phone,x=h.countryGuessResult,M=h.formatCountry,N=_.check();return S(j,{overrideLastHistoryItem:!(!N||N>y)}),null==g||g(j,{formatCountry:M,unformattedValue:f,cursorPosition:null!=p?p:0,deletion:n}),P&&(null==x?void 0:x.country)&&x.country.name!==s&&(null==C||C(x)),k||A(!0),j};return(0,n.useEffect)((function(){k&&e===D||E(e)}),[e]),{phone:D,initialized:k,undo:x,redo:M,handleValueChange:E}}},882:function(e,a,r){var t=this&&this.__assign||function(){return t=Object.assign||function(e){for(var a,r=1,t=arguments.length;r<t;r++)for(var n in a=arguments[r])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},t.apply(this,arguments)},n=this&&this.__rest||function(e,a){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&a.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(t=Object.getOwnPropertySymbols(e);n<t.length;n++)a.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(e,t[n])&&(r[t[n]]=e[t[n]])}return r};Object.defineProperty(a,"__esModule",{value:!0}),a.usePhoneInput=void 0;var o=r(156),i=r(946),u=r(332),l=r(452);a.usePhoneInput=function(e){var a,r,s,c=e.initialCountry,d=e.value,f=void 0===d?"":d,p=e.prefix,y=void 0===p?"+":p,h=e.countries,v=void 0===h?i.defaultCountries:h,m=e.disableDialCodeAndPrefix,b=e.hideSpaceAfterDialCode,C=e.onCountryChange,g=n(e,["initialCountry","value","prefix","countries","disableDialCodeAndPrefix","hideSpaceAfterDialCode","onCountryChange"]),P=(0,o.useRef)(null),_=(0,o.useRef)({shouldFocus:!1,shouldSetCursorToEnd:!1}),O=(0,o.useState)(null!==(r=null===(a=(0,u.guessCountryByPartialNumber)({phone:f,countries:v,currentCountryIso2:c}).country)||void 0===a?void 0:a.iso2)&&void 0!==r?r:c),w=O[0],j=O[1],D=(0,o.useMemo)((function(){if(w)return(0,u.getCountry)({value:w,field:"iso2",countries:v})}),[v,w]),S=b?"":" ",x=null!==(s=null==D?void 0:D.dialCode)&&void 0!==s?s:"",M=m?(0,u.removeDialCode)({phone:f,dialCode:x,charAfterDialCode:S,prefix:y}):f,N=(0,l.usePhone)(M,t({country:w,countries:v,prefix:y,disableDialCodeAndPrefix:m,charAfterDialCode:S,onCountryGuess:function(e){var a=e.country;e.fullDialCodeMatch&&j(a.iso2)},onPhoneUpdate:function(e,a){var r,t,n=a.formatCountry,o=a.unformattedValue,i=a.cursorPosition,l=a.deletion,s=A&&!_.current.shouldSetCursorToEnd?(0,u.getCursorPosition)({cursorPositionAfterInput:i,phoneBeforeInput:k,phoneAfterInput:o,phoneAfterFormatted:e,leftOffset:g.forceDialCode?y.length+(null!==(t=null===(r=null==n?void 0:n.dialCode)||void 0===r?void 0:r.length)&&void 0!==t?t:0)+S.length:0,deletion:l}):e.length;Promise.resolve().then((function(){var e,a;null===(e=P.current)||void 0===e||e.setSelectionRange(s,s),_.current.shouldFocus&&(null===(a=P.current)||void 0===a||a.focus()),_.current={shouldFocus:!1,shouldSetCursorToEnd:!1}}))}},g)),k=N.phone,A=N.initialized,E=N.undo,I=N.redo,B=N.handleValueChange;return(0,o.useEffect)((function(){var e=P.current;if(e){var a=function(e){if(e.key){var a=e.ctrlKey,r=e.shiftKey,t="z"===e.key.toLowerCase();if(a&&t)return r?I():E()}};return e.addEventListener("keydown",a),function(){e.removeEventListener("keydown",a)}}}),[P,E,I]),{phone:k,handlePhoneValueChange:function(e){var a;e.preventDefault();var r=e.nativeEvent.inputType,t=null==r?void 0:r.startsWith("insertFrom"),n=B(e.target.value,{deletion:function(){var e;if(null!==(e=null==r?void 0:r.toLocaleLowerCase().includes("delete"))&&void 0!==e&&e)return(null==r?void 0:r.toLocaleLowerCase().includes("forward"))?"forward":"backward"}(),inserted:t,cursorPosition:null!==(a=e.target.selectionStart)&&void 0!==a?a:0});return m?(0,u.addDialCode)({phone:n,dialCode:x,charAfterDialCode:S,prefix:y}):n},inputRef:P,country:w,setCountry:function(e){var a=(0,u.getCountry)({value:e,field:"iso2",countries:v});if(a){_.current={shouldFocus:!0,shouldSetCursorToEnd:!0};var r=B(m?"":"".concat(y).concat(S).concat(a.dialCode),{forcedCountry:a});j(a.iso2),null==C||C(r)}}}}},393:(e,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.usePhoneValidation=void 0;var t=r(332);a.usePhoneValidation=function(e,a){return(0,t.validatePhone)(e,a)}},795:(e,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.useTimer=void 0;var t=r(156);a.useTimer=function(){var e=(0,t.useState)(),a=e[0],r=e[1],n=(0,t.useState)(Date.now()),o=n[0],i=n[1];return{check:function(){var e=Date.now(),t=a?e-o:void 0;return r(o),i(e),t}}}},515:function(e,a){var r=this&&this.__spreadArray||function(e,a,r){if(r||2===arguments.length)for(var t,n=0,o=a.length;n<o;n++)!t&&n in a||(t||(t=Array.prototype.slice.call(a,0,n)),t[n]=a[n]);return e.concat(t||Array.prototype.slice.call(a))};Object.defineProperty(a,"__esModule",{value:!0}),a.buildClassNames=a.classNamesWithPrefix=a.joinClasses=a.classPrefix=void 0,a.classPrefix="react-international-phone-",a.joinClasses=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return e.filter((function(e){return!!e})).join(" ").trim()},a.classNamesWithPrefix=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return a.joinClasses.apply(void 0,e).split(" ").map((function(e){return"".concat(a.classPrefix).concat(e)})).join(" ")},a.buildClassNames=function(e){var t=e.addPrefix,n=e.rawClassNames;return a.joinClasses.apply(void 0,r([a.classNamesWithPrefix.apply(void 0,t)],n,!1))}},62:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.applyMask=void 0,a.applyMask=function(e){var a=e.value,r=e.mask,t=e.maskSymbol,n=e.offset,o=void 0===n?0:n,i=e.trimNonMaskCharsLeftover,u=void 0!==i&&i;if(a.length<o)return a;for(var l=a.slice(0,o),s=a.slice(o),c=l,d=0,f=0,p=r.split("");f<p.length;f++){var y=p[f];if(d>=s.length){if(!u&&y!==t){c+=y;continue}break}y===t?(c+=s[d],d+=1):c+=y}return c}},239:function(e,a,r){var t=this&&this.__createBinding||(Object.create?function(e,a,r,t){void 0===t&&(t=r);var n=Object.getOwnPropertyDescriptor(a,r);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(e,t,n)}:function(e,a,r,t){void 0===t&&(t=r),e[t]=a[r]}),n=this&&this.__exportStar||function(e,a){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(a,r)||t(a,e,r)};Object.defineProperty(a,"__esModule",{value:!0}),n(r(62),a),n(r(939),a),n(r(222),a)},939:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.removeNonDigits=void 0,a.removeNonDigits=function(e){return e.replace(/\D/g,"")}},222:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.scrollToChild=void 0,a.scrollToChild=function(e,a){var r=e.style.display;"block"!==r&&(e.style.display="block");var t=e.getBoundingClientRect(),n=a.getBoundingClientRect(),o=n.top-t.top,i=t.bottom-n.bottom;o>=0&&i>=0||(Math.abs(o)<Math.abs(i)?e.scrollTop+=o:e.scrollTop-=i),e.style.display=r}},298:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.buildCountryData=void 0,a.buildCountryData=function(e){return[e.name,e.regions,e.iso2,e.dialCode,e.format,e.priority,e.areaCodes].filter(Boolean)}},891:(e,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getCountry=void 0;var t=r(300);a.getCountry=function(e){var a=e.value,r=e.field,n=e.countries;if(["regions","priority"].includes(r))throw new Error(function(e){return'Field "'.concat(e,'" is not supported')}(r));var o=n.find((function(e){var n=(0,t.parseCountry)(e);return a===n[r]}));if(o)return(0,t.parseCountry)(o)}},4:(e,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.guessCountryByPartialNumber=void 0;var t=r(239),n=r(891),o=r(300);a.guessCountryByPartialNumber=function(e){var a,r=e.phone,i=e.countries,u=e.currentCountryIso2,l={country:void 0,fullDialCodeMatch:!1,areaCodeMatch:void 0};if(!r)return l;var s=(0,t.removeNonDigits)(r);if(!s)return l;for(var c=l,d=function(e){var a,r,t,n,o=e.country,i=e.fullDialCodeMatch,u=e.areaCodeMatch,l=o.dialCode===(null===(a=c.country)||void 0===a?void 0:a.dialCode),s=(null!==(r=o.priority)&&void 0!==r?r:0)<(null!==(n=null===(t=c.country)||void 0===t?void 0:t.priority)&&void 0!==n?n:0);l&&!s||(c={country:o,fullDialCodeMatch:i,areaCodeMatch:u})},f=0,p=i;f<p.length;f++){var y=p[f],h=(0,o.parseCountry)(y),v=h.dialCode,m=h.areaCodes;if(s.startsWith(v)){var b=!c.country||Number(v)>=Number(c.country.dialCode);if(m)for(var C=s.substring(v.length),g=0,P=m;g<P.length;g++){var _=P[g];if(C.startsWith(_))return{country:h,fullDialCodeMatch:!0,areaCodeMatch:!0}}!b&&v!==s&&c.fullDialCodeMatch||d({country:h,fullDialCodeMatch:!0,areaCodeMatch:m?!m:void 0})}c.fullDialCodeMatch||s.length<v.length&&v.startsWith(s)&&(!c.country||Number(v)<=Number(c.country.dialCode))&&d({country:h,fullDialCodeMatch:!1})}if(u){var O=(0,n.getCountry)({value:u,field:"iso2",countries:i});c&&O&&(null===(a=c.country)||void 0===a?void 0:a.dialCode)===O.dialCode&&c.country!==O&&c.fullDialCodeMatch&&!c.areaCodeMatch&&(c.country=O)}return c}},88:function(e,a,r){var t=this&&this.__createBinding||(Object.create?function(e,a,r,t){void 0===t&&(t=r);var n=Object.getOwnPropertyDescriptor(a,r);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(e,t,n)}:function(e,a,r,t){void 0===t&&(t=r),e[t]=a[r]}),n=this&&this.__exportStar||function(e,a){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(a,r)||t(a,e,r)};Object.defineProperty(a,"__esModule",{value:!0}),n(r(298),a),n(r(891),a),n(r(4),a),n(r(300),a)},300:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.parseCountry=void 0,a.parseCountry=function(e){return{name:e[0],regions:e[1],iso2:e[2],dialCode:e[3],format:e[4],priority:e[5],areaCodes:e[6]}}},332:function(e,a,r){var t=this&&this.__createBinding||(Object.create?function(e,a,r,t){void 0===t&&(t=r);var n=Object.getOwnPropertyDescriptor(a,r);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(e,t,n)}:function(e,a,r,t){void 0===t&&(t=r),e[t]=a[r]}),n=this&&this.__exportStar||function(e,a){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(a,r)||t(a,e,r)};Object.defineProperty(a,"__esModule",{value:!0}),n(r(239),a),n(r(88),a),n(r(165),a)},820:(e,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDialCode=void 0;var t=r(214);a.addDialCode=function(e){var a=e.phone,r=e.dialCode,n=e.prefix,o=void 0===n?"+":n,i=e.charAfterDialCode,u=void 0===i?" ":i;return"".concat(o).concat(r).concat(u).concat((0,t.removeDialCode)({phone:a,dialCode:r,charAfterDialCode:u,prefix:o}))}},380:(e,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.formatPhone=void 0;var t=r(239);a.formatPhone=function(e,a){var r=!a.disableDialCodeAndPrefix&&a.forceDialCode,n=!a.disableDialCodeAndPrefix&&a.insertDialCodeOnEmpty,o=e,i=function(e){return a.trimNonDigitsEnd?e.trim():e};if(!o)return n&&!o.length||r?i("".concat(a.prefix).concat(a.dialCode).concat(a.charAfterDialCode)):i(o);if((o=(0,t.removeNonDigits)(o))===a.dialCode&&!a.disableDialCodeAndPrefix)return i("".concat(a.prefix).concat(a.dialCode).concat(a.charAfterDialCode));if(a.dialCode.startsWith(o)&&!a.disableDialCodeAndPrefix)return i(r?"".concat(a.prefix).concat(a.dialCode).concat(a.charAfterDialCode):"".concat(a.prefix).concat(o));if(!o.startsWith(a.dialCode)&&!a.disableDialCodeAndPrefix){if(r)return i("".concat(a.prefix).concat(a.dialCode).concat(a.charAfterDialCode));if(o.length<a.dialCode.length)return i("".concat(a.prefix).concat(o))}var u,l=(u=a.dialCode.length,a.disableDialCodeAndPrefix&&(u=0),{phoneLeftSide:o.slice(0,u),phoneRightSide:o.slice(u)}),s=l.phoneLeftSide,c=l.phoneRightSide;return s="".concat(a.prefix).concat(s).concat(a.charAfterDialCode),c=(0,t.applyMask)({value:c,mask:a.mask,maskSymbol:a.maskChar,trimNonMaskCharsLeftover:a.trimNonDigitsEnd}),a.disableDialCodeAndPrefix&&(s=""),i("".concat(s).concat(c))}},775:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getCursorPosition=void 0;var r=function(e){return/\d/.test(e)};a.getCursorPosition=function(e){var a=e.phoneBeforeInput,t=e.phoneAfterInput,n=e.phoneAfterFormatted,o=e.cursorPositionAfterInput,i=e.leftOffset,u=void 0===i?0:i,l=e.deletion;if(o<u)return u;if(!a)return n.length;var s="backward"===l;if(0===o&&t.length>0&&n.length>0){if(s)return 0;for(var c=0;c<n.length;c+=1)if(r(n[c]))return c;return n.length}if(t.length<a.length&&1===t.length)return n.length;var d=null;for(c=o-1;c>=0;c-=1)if(r(t[c])){d=c;break}if(null===d)return 0!==o?o:n.length;var f=0;for(c=0;c<d;c+=1)r(t[c])&&(f+=1);s&&(f-=1);var p=0,y=0;for(c=0;c<n.length&&(p+=1,r(n[c])&&(y+=1),y!==f+1);c+=1);for(;!r(n[p])&&p<n.length;)p+=1;return s&&(p+=1),p}},165:function(e,a,r){var t=this&&this.__createBinding||(Object.create?function(e,a,r,t){void 0===t&&(t=r);var n=Object.getOwnPropertyDescriptor(a,r);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(e,t,n)}:function(e,a,r,t){void 0===t&&(t=r),e[t]=a[r]}),n=this&&this.__exportStar||function(e,a){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(a,r)||t(a,e,r)};Object.defineProperty(a,"__esModule",{value:!0}),n(r(820),a),n(r(380),a),n(r(775),a),n(r(214),a),n(r(684),a)},214:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.removeDialCode=void 0,a.removeDialCode=function(e){var a=e.phone,r=e.dialCode,t=e.prefix,n=void 0===t?"+":t,o=e.charAfterDialCode,i=void 0===o?" ":o;if(!a||!r)return a;var u=a;return u.startsWith(n)&&(u=u.replace(n,"")),u.startsWith(r)?((u=u.replace(r,"")).startsWith(i)&&(u=u.replace(i,"")),u):a}},684:function(e,a,r){var t=this&&this.__assign||function(){return t=Object.assign||function(e){for(var a,r=1,t=arguments.length;r<t;r++)for(var n in a=arguments[r])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},t.apply(this,arguments)};Object.defineProperty(a,"__esModule",{value:!0}),a.validatePhone=void 0;var n=r(452),o=r(239),i=r(88);a.validatePhone=function(e,a){var r=t(t({},n.defaultPhoneConfig),a),u=r.countries,l=r.defaultMask,s=r.defaultMaskMinPhoneLength,c=void 0===s?10:s,d=r.prefix,f=r.charAfterDialCode,p=(0,i.guessCountryByPartialNumber)({phone:e,countries:u}),y=p.country,h=p.fullDialCodeMatch,v=p.areaCodeMatch;if(!y||!h)return{country:void 0,lengthMatch:!1,areaCodeMatch:v,isValid:!1};var m="".concat(d).concat(y.dialCode).concat(f);if(!e.startsWith(m))return{country:y,lengthMatch:!1,areaCodeMatch:v,isValid:!1};var b=e.substring(m.length),C=!y.format,g=C?l:y.format;if(C&&(0,o.removeNonDigits)(e).length<c)return{country:y,lengthMatch:!1,areaCodeMatch:v,isValid:!1};if(!C&&b.length!==g.length)return{country:y,lengthMatch:!1,areaCodeMatch:v,isValid:!1};for(var P=0;P<b.length;P+=1)if(b[P]!==g[P]&&g[P]!==n.MASK_CHAR)return{country:y,lengthMatch:!1,areaCodeMatch:v,isValid:!1};return{country:y,lengthMatch:!0,areaCodeMatch:v,isValid:null==v||v}}},156:a=>{a.exports=e}},r={};function t(e){var n=r[e];if(void 0!==n)return n.exports;var o=r[e]={exports:{}};return a[e].call(o.exports,o,o.exports,t),o.exports}t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{var e=n;Object.defineProperty(e,"__esModule",{value:!0}),e.validatePhone=e.parseCountry=e.buildCountryData=e.usePhoneValidation=e.usePhoneInput=e.usePhone=e.defaultCountries=e.PhoneInput=e.FlagEmoji=e.DialCodePreview=e.CountrySelectorDropdown=e.CountrySelector=void 0;var a=t(153);Object.defineProperty(e,"CountrySelector",{enumerable:!0,get:function(){return a.CountrySelector}});var r=t(60);Object.defineProperty(e,"CountrySelectorDropdown",{enumerable:!0,get:function(){return r.CountrySelectorDropdown}});var o=t(7);Object.defineProperty(e,"DialCodePreview",{enumerable:!0,get:function(){return o.DialCodePreview}});var i=t(425);Object.defineProperty(e,"FlagEmoji",{enumerable:!0,get:function(){return i.FlagEmoji}});var u=t(28);Object.defineProperty(e,"PhoneInput",{enumerable:!0,get:function(){return u.PhoneInput}});var l=t(946);Object.defineProperty(e,"defaultCountries",{enumerable:!0,get:function(){return l.defaultCountries}});var s=t(452);Object.defineProperty(e,"usePhone",{enumerable:!0,get:function(){return s.usePhone}});var c=t(882);Object.defineProperty(e,"usePhoneInput",{enumerable:!0,get:function(){return c.usePhoneInput}});var d=t(393);Object.defineProperty(e,"usePhoneValidation",{enumerable:!0,get:function(){return d.usePhoneValidation}});var f=t(332);Object.defineProperty(e,"buildCountryData",{enumerable:!0,get:function(){return f.buildCountryData}}),Object.defineProperty(e,"parseCountry",{enumerable:!0,get:function(){return f.parseCountry}}),Object.defineProperty(e,"validatePhone",{enumerable:!0,get:function(){return f.validatePhone}})})(),n})()));
!function(e,a){"object"==typeof exports&&"object"==typeof module?module.exports=a(require("react")):"function"==typeof define&&define.amd?define(["react"],a):"object"==typeof exports?exports["react-international-phone"]=a(require("react")):e["react-international-phone"]=a(e.react)}(this,(e=>(()=>{"use strict";var a={0:(e,a,r)=>{r.r(a)},374:(e,a,r)=>{r.r(a)},840:(e,a,r)=>{r.r(a)},481:(e,a,r)=>{r.r(a)},549:(e,a,r)=>{r.r(a)},153:function(e,a,r){var t=this&&this.__assign||function(){return t=Object.assign||function(e){for(var a,r=1,t=arguments.length;r<t;r++)for(var n in a=arguments[r])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},t.apply(this,arguments)},n=this&&this.__createBinding||(Object.create?function(e,a,r,t){void 0===t&&(t=r);var n=Object.getOwnPropertyDescriptor(a,r);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(e,t,n)}:function(e,a,r,t){void 0===t&&(t=r),e[t]=a[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:!0,value:a})}:function(e,a){e.default=a}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(a,e,r);return o(a,e),a},u=this&&this.__rest||function(e,a){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&a.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(t=Object.getOwnPropertySymbols(e);n<t.length;n++)a.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(e,t[n])&&(r[t[n]]=e[t[n]])}return r};Object.defineProperty(a,"__esModule",{value:!0}),a.CountrySelector=void 0,r(0);var l=i(r(156)),c=r(946),s=r(515),d=r(332),f=r(425),p=r(60);a.CountrySelector=function(e){var a,r,n=e.selectedCountry,o=e.onSelect,i=e.disabled,v=e.hideDropdown,y=e.countries,m=void 0===y?c.defaultCountries:y,h=e.renderButtonWrapper,b=u(e,["selectedCountry","onSelect","disabled","hideDropdown","countries","renderButtonWrapper"]),C=(0,l.useState)(!1),g=C[0],P=C[1],_=(0,l.useMemo)((function(){if(n)return(0,d.getCountry)({value:n,field:"iso2",countries:m})}),[m,n]),O=(0,l.useRef)(null);return l.default.createElement("div",{className:(0,s.buildClassNames)({addPrefix:["country-selector"],rawClassNames:[b.className]}),style:b.style,ref:O},(a={title:null==_?void 0:_.name,onClick:function(){return P((function(e){return!e}))},onMouseDown:function(e){return e.preventDefault()},onKeyDown:function(e){e.key&&["ArrowUp","ArrowDown"].includes(e.key)&&(e.preventDefault(),P(!0))},disabled:v||i,role:"combobox","aria-label":"Country selector","aria-haspopup":"listbox","aria-expanded":g},r=l.default.createElement("div",{className:(0,s.buildClassNames)({addPrefix:["country-selector-button__button-content"],rawClassNames:[b.buttonContentWrapperClassName]}),style:b.buttonContentWrapperStyle},l.default.createElement(f.FlagEmoji,{iso2:n,className:(0,s.buildClassNames)({addPrefix:["country-selector-button__flag-emoji",i&&"country-selector-button__flag-emoji--disabled"],rawClassNames:[b.flagClassName]}),style:t({visibility:n?"visible":"hidden"},b.flagStyle)}),!v&&l.default.createElement("div",{className:(0,s.buildClassNames)({addPrefix:["country-selector-button__dropdown-arrow",i&&"country-selector-button__dropdown-arrow--disabled",g&&"country-selector-button__dropdown-arrow--active"],rawClassNames:[b.dropdownArrowClassName]}),style:b.dropdownArrowStyle})),h?h({children:r,rootProps:a}):l.default.createElement("button",t({},a,{type:"button",className:(0,s.buildClassNames)({addPrefix:["country-selector-button",g&&"country-selector-button--active",i&&"country-selector-button--disabled",v&&"country-selector-button--hide-dropdown"],rawClassNames:[b.buttonClassName]}),"data-country":n,style:b.buttonStyle}),r)),l.default.createElement(p.CountrySelectorDropdown,t({show:g,countries:m,onSelect:function(e){P(!1),null==o||o(e)},selectedCountry:n,onClose:function(){P(!1)}},b.dropdownStyleProps)))}},60:function(e,a,r){var t=this&&this.__assign||function(){return t=Object.assign||function(e){for(var a,r=1,t=arguments.length;r<t;r++)for(var n in a=arguments[r])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},t.apply(this,arguments)},n=this&&this.__createBinding||(Object.create?function(e,a,r,t){void 0===t&&(t=r);var n=Object.getOwnPropertyDescriptor(a,r);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(e,t,n)}:function(e,a,r,t){void 0===t&&(t=r),e[t]=a[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:!0,value:a})}:function(e,a){e.default=a}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(a,e,r);return o(a,e),a},u=this&&this.__rest||function(e,a){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&a.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(t=Object.getOwnPropertySymbols(e);n<t.length;n++)a.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(e,t[n])&&(r[t[n]]=e[t[n]])}return r};Object.defineProperty(a,"__esModule",{value:!0}),a.CountrySelectorDropdown=void 0,r(374);var l=i(r(156)),c=r(946),s=r(515),d=r(332),f=r(425);a.CountrySelectorDropdown=function(e){var a=e.show,r=e.dialCodePrefix,n=void 0===r?"+":r,o=e.selectedCountry,i=e.countries,p=void 0===i?c.defaultCountries:i,v=e.onSelect,y=e.onClose,m=u(e,["show","dialCodePrefix","selectedCountry","countries","onSelect","onClose"]),h=(0,l.useRef)(null),b=(0,l.useRef)(),C=(0,l.useCallback)((function(e){return p.findIndex((function(a){return(0,d.parseCountry)(a).iso2===e}))}),[p]),g=(0,l.useState)(C(o)),P=g[0],_=g[1],O=function(){b.current!==o&&_(C(o))},w=(0,l.useCallback)((function(e){_(C(e.iso2)),null==v||v(e)}),[v,C]),j=function(e){var a=p.length-1;_((function(r){var t,n=(t=r,"prev"===e?t-1:"next"===e?t+1:"last"===e?a:0);return n<0?0:n>a?a:n}))},D=(0,l.useCallback)((function(){if(h.current&&void 0!==P){var e=(0,d.parseCountry)(p[P]).iso2;if(e!==b.current){var a=h.current.querySelector('[data-country="'.concat(e,'"]'));a&&((0,d.scrollToChild)(h.current,a),b.current=e)}}}),[P,p]);return(0,l.useEffect)((function(){D()}),[P,D]),(0,l.useEffect)((function(){h.current&&(a?h.current.focus():O())}),[a]),(0,l.useEffect)((function(){O()}),[o]),l.default.createElement("ul",{ref:h,role:"listbox",className:(0,s.buildClassNames)({addPrefix:["country-selector-dropdown"],rawClassNames:[m.className]}),style:t({display:a?"block":"none"},m.style),onKeyDown:function(e){if("Enter"!==e.key){if("Escape"!==e.key)return"ArrowUp"===e.key?(e.preventDefault(),void j("prev")):"ArrowDown"===e.key?(e.preventDefault(),void j("next")):"PageUp"===e.key?(e.preventDefault(),void j("first")):"PageDown"===e.key?(e.preventDefault(),void j("last")):void 0;null==y||y()}else{var a=(0,d.parseCountry)(p[P]);w(a)}},onBlur:y,tabIndex:-1,"aria-activedescendant":"".concat((0,d.parseCountry)(p[P]).iso2,"-option")},p.map((function(e,a){var r=(0,d.parseCountry)(e),t=r.iso2===o,i=a===P;return l.default.createElement("li",{key:r.iso2,"data-country":r.iso2,role:"option","aria-selected":t,"aria-label":"".concat(r.name," ").concat(n).concat(r.dialCode),id:"".concat(r.iso2,"-option"),className:(0,s.buildClassNames)({addPrefix:["country-selector-dropdown__list-item",t&&"country-selector-dropdown__list-item--selected",i&&"country-selector-dropdown__list-item--focused"],rawClassNames:[m.listItemClassName]}),onClick:function(){return w(r)},style:m.listItemStyle},l.default.createElement(f.FlagEmoji,{iso2:r.iso2,className:(0,s.buildClassNames)({addPrefix:["country-selector-dropdown__list-item-flag-emoji"],rawClassNames:[m.listItemFlagClassName]}),style:m.listItemFlagStyle}),l.default.createElement("span",{className:(0,s.buildClassNames)({addPrefix:["country-selector-dropdown__list-item-country-name"],rawClassNames:[m.listItemCountryNameClassName]}),style:m.listItemCountryNameStyle},r.name),l.default.createElement("span",{className:(0,s.buildClassNames)({addPrefix:["country-selector-dropdown__list-item-dial-code"],rawClassNames:[m.listItemDialCodeClassName]}),style:m.listItemDialCodeStyle},n,r.dialCode))})))}},7:function(e,a,r){var t=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:!0}),a.DialCodePreview=void 0,r(840);var n=t(r(156)),o=r(515);a.DialCodePreview=function(e){var a=e.dialCode,r=e.prefix,t=e.disabled,i=e.style,u=e.className;return n.default.createElement("div",{className:(0,o.buildClassNames)({addPrefix:["dial-code-preview",t&&"dial-code-preview--disabled"],rawClassNames:[u]}),style:i},"".concat(r).concat(a))}},425:function(e,a,r){var t=this&&this.__assign||function(){return t=Object.assign||function(e){for(var a,r=1,t=arguments.length;r<t;r++)for(var n in a=arguments[r])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},t.apply(this,arguments)},n=this&&this.__rest||function(e,a){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&a.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(t=Object.getOwnPropertySymbols(e);n<t.length;n++)a.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(e,t[n])&&(r[t[n]]=e[t[n]])}return r},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:!0}),a.FlagEmoji=void 0,r(481);var i=o(r(156)),u=r(515),l="abcdefghijklmnopqrstuvwxyz".split("").reduce((function(e,a,r){var n,o,i;return t(t({},e),((n={})[a]=(o=r,i=parseInt("1f1e6",16),Number(i+o).toString(16)),n))}),{});a.FlagEmoji=function(e){var a=e.iso2,r=e.size,o=void 0===r?"24px":r,c=e.protocol,s=void 0===c?"https":c,d=e.disableLazyLoading,f=e.className,p=n(e,["iso2","size","protocol","disableLazyLoading","className"]);if(!a)return i.default.createElement("img",t({width:o,height:o},p));var v=function(e){return[l[e[0]],l[e[1]]].join("-")}(a),y="".concat(s,"://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/svg/").concat(v,".svg");return i.default.createElement("img",t({className:(0,u.buildClassNames)({addPrefix:["flag-emoji"],rawClassNames:[f]}),src:y,width:o,height:o,draggable:!1,"data-country":a,loading:d?void 0:"lazy"},p))}},28:function(e,a,r){var t=this&&this.__assign||function(){return t=Object.assign||function(e){for(var a,r=1,t=arguments.length;r<t;r++)for(var n in a=arguments[r])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},t.apply(this,arguments)},n=this&&this.__createBinding||(Object.create?function(e,a,r,t){void 0===t&&(t=r);var n=Object.getOwnPropertyDescriptor(a,r);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(e,t,n)}:function(e,a,r,t){void 0===t&&(t=r),e[t]=a[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:!0,value:a})}:function(e,a){e.default=a}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(a,e,r);return o(a,e),a},u=this&&this.__rest||function(e,a){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&a.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(t=Object.getOwnPropertySymbols(e);n<t.length;n++)a.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(e,t[n])&&(r[t[n]]=e[t[n]])}return r};Object.defineProperty(a,"__esModule",{value:!0}),a.PhoneInput=void 0,r(549);var l=i(r(156)),c=r(946),s=r(882),d=r(515),f=r(332),p=r(153),v=r(7);a.PhoneInput=function(e){var a,r=e.hideDropdown,n=e.placeholder,o=e.disabled,i=e.showDisabledDialCodeAndPrefix,y=e.inputProps,m=e.onChange,h=e.style,b=e.className,C=e.inputStyle,g=e.inputClassName,P=e.countrySelectorStyleProps,_=e.dialCodePreviewStyleProps,O=e.value,w=e.countries,j=void 0===w?c.defaultCountries:w,D=u(e,["hideDropdown","placeholder","disabled","showDisabledDialCodeAndPrefix","inputProps","onChange","style","className","inputStyle","inputClassName","countrySelectorStyleProps","dialCodePreviewStyleProps","value","countries"]),M=(0,s.usePhoneInput)(t({value:O,countries:j},D)),S=M.phone,x=M.inputRef,N=M.country,k=M.setCountry,A=M.handlePhoneValueChange;(0,l.useEffect)((function(){S!==O&&(null==m||m(S))}),[S]);var E=(0,l.useMemo)((function(){if(N)return(0,f.getCountry)({value:N,field:"iso2",countries:j})}),[j,N]),I=D.disableDialCodeAndPrefix&&i&&(null==E?void 0:E.dialCode);return l.default.createElement("div",{className:(0,d.buildClassNames)({addPrefix:["input-container"],rawClassNames:[b]}),style:h},l.default.createElement(p.CountrySelector,t({onSelect:function(e){return k(e.iso2)},selectedCountry:N,countries:j,disabled:o,hideDropdown:r},P)),I&&l.default.createElement(v.DialCodePreview,t({dialCode:E.dialCode,prefix:null!==(a=D.prefix)&&void 0!==a?a:"+",disabled:o},_)),l.default.createElement("input",t({onChange:A,value:S,type:"tel",ref:x,className:(0,d.buildClassNames)({addPrefix:["input",o&&"input--disabled"],rawClassNames:[g]}),placeholder:n,disabled:o,style:C},y)))}},946:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.defaultCountries=void 0,a.defaultCountries=[["Afghanistan",["asia"],"af","93"],["Albania",["europe"],"al","355"],["Algeria",["africa","north-africa"],"dz","213"],["Andorra",["europe"],"ad","376"],["Angola",["africa"],"ao","244"],["Antigua and Barbuda",["america","carribean"],"ag","1268"],["Argentina",["america","south-america"],"ar","54","(..) ........",0,["11","221","223","261","264","2652","280","2905","291","2920","2966","299","341","342","343","351","376","379","381","3833","385","387","388"]],["Armenia",["asia","ex-ussr"],"am","374",".. ......"],["Aruba",["america","carribean"],"aw","297"],["Australia",["oceania"],"au","61","(..) .... ....",0,["2","3","4","7","8","02","03","04","07","08"]],["Austria",["europe","eu-union"],"at","43"],["Azerbaijan",["asia","ex-ussr"],"az","994","(..) ... .. .."],["Bahamas",["america","carribean"],"bs","1242"],["Bahrain",["middle-east"],"bh","973"],["Bangladesh",["asia"],"bd","880"],["Barbados",["america","carribean"],"bb","1246"],["Belarus",["europe","ex-ussr"],"by","375","(..) ... .. .."],["Belgium",["europe","eu-union"],"be","32","... .. .. .."],["Belize",["america","central-america"],"bz","501"],["Benin",["africa"],"bj","229"],["Bhutan",["asia"],"bt","975"],["Bolivia",["america","south-america"],"bo","591"],["Bosnia and Herzegovina",["europe","ex-yugos"],"ba","387"],["Botswana",["africa"],"bw","267"],["Brazil",["america","south-america"],"br","55","(..) ........."],["British Indian Ocean Territory",["asia"],"io","246"],["Brunei",["asia"],"bn","673"],["Bulgaria",["europe","eu-union"],"bg","359"],["Burkina Faso",["africa"],"bf","226"],["Burundi",["africa"],"bi","257"],["Cambodia",["asia"],"kh","855"],["Cameroon",["africa"],"cm","237"],["Canada",["america","north-america"],"ca","1","(...) ...-....",1,["204","226","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde",["africa"],"cv","238"],["Caribbean Netherlands",["america","carribean"],"bq","599","",1],["Central African Republic",["africa"],"cf","236"],["Chad",["africa"],"td","235"],["Chile",["america","south-america"],"cl","56"],["China",["asia"],"cn","86","... .... ...."],["Colombia",["america","south-america"],"co","57","... ... ...."],["Comoros",["africa"],"km","269"],["Congo",["africa"],"cd","243"],["Congo",["africa"],"cg","242"],["Costa Rica",["america","central-america"],"cr","506","....-...."],["Côte d'Ivoire",["africa"],"ci","225",".. .. .. .."],["Croatia",["europe","eu-union","ex-yugos"],"hr","385"],["Cuba",["america","carribean"],"cu","53"],["Curaçao",["america","carribean"],"cw","599","",0],["Cyprus",["europe","eu-union"],"cy","357",".. ......"],["Czech Republic",["europe","eu-union"],"cz","420","... ... ..."],["Denmark",["europe","eu-union","baltic"],"dk","45",".. .. .. .."],["Djibouti",["africa"],"dj","253"],["Dominica",["america","carribean"],"dm","1767"],["Dominican Republic",["america","carribean"],"do","1","",2],["Ecuador",["america","south-america"],"ec","593"],["Egypt",["africa","north-africa"],"eg","20"],["El Salvador",["america","central-america"],"sv","503","....-...."],["Equatorial Guinea",["africa"],"gq","240"],["Eritrea",["africa"],"er","291"],["Estonia",["europe","eu-union","ex-ussr","baltic"],"ee","372",".... ......"],["Ethiopia",["africa"],"et","251"],["Fiji",["oceania"],"fj","679"],["Finland",["europe","eu-union","baltic"],"fi","358",".. ... .. .."],["France",["europe","eu-union"],"fr","33",". .. .. .. .."],["French Guiana",["america","south-america"],"gf","594"],["French Polynesia",["oceania"],"pf","689"],["Gabon",["africa"],"ga","241"],["Gambia",["africa"],"gm","220"],["Georgia",["asia","ex-ussr"],"ge","995"],["Germany",["europe","eu-union","baltic"],"de","49",".... ........"],["Ghana",["africa"],"gh","233"],["Greece",["europe","eu-union"],"gr","30"],["Grenada",["america","carribean"],"gd","1473"],["Guadeloupe",["america","carribean"],"gp","590","",0],["Guam",["oceania"],"gu","1671"],["Guatemala",["america","central-america"],"gt","502","....-...."],["Guinea",["africa"],"gn","224"],["Guinea-Bissau",["africa"],"gw","245"],["Guyana",["america","south-america"],"gy","592"],["Haiti",["america","carribean"],"ht","509","....-...."],["Honduras",["america","central-america"],"hn","504"],["Hong Kong",["asia"],"hk","852",".... ...."],["Hungary",["europe","eu-union"],"hu","36"],["Iceland",["europe"],"is","354","... ...."],["India",["asia"],"in","91",".....-....."],["Indonesia",["asia"],"id","62"],["Iran",["middle-east"],"ir","98","... ... ...."],["Iraq",["middle-east"],"iq","964"],["Ireland",["europe","eu-union"],"ie","353",".. ......."],["Israel",["middle-east"],"il","972","... ... ...."],["Italy",["europe","eu-union"],"it","39","... .......",0],["Jamaica",["america","carribean"],"jm","1876"],["Japan",["asia"],"jp","81",".. .... ...."],["Jordan",["middle-east"],"jo","962"],["Kazakhstan",["asia","ex-ussr"],"kz","7","... ...-..-..",0,["310","311","312","313","315","318","321","324","325","326","327","336","7172","73622"]],["Kenya",["africa"],"ke","254"],["Kiribati",["oceania"],"ki","686"],["Kosovo",["europe","ex-yugos"],"xk","383"],["Kuwait",["middle-east"],"kw","965"],["Kyrgyzstan",["asia","ex-ussr"],"kg","996","... ... ..."],["Laos",["asia"],"la","856"],["Latvia",["europe","eu-union","ex-ussr","baltic"],"lv","371",".. ... ..."],["Lebanon",["middle-east"],"lb","961"],["Lesotho",["africa"],"ls","266"],["Liberia",["africa"],"lr","231"],["Libya",["africa","north-africa"],"ly","218"],["Liechtenstein",["europe"],"li","423"],["Lithuania",["europe","eu-union","ex-ussr","baltic"],"lt","370"],["Luxembourg",["europe","eu-union"],"lu","352"],["Macau",["asia"],"mo","853"],["Macedonia",["europe","ex-yugos"],"mk","389"],["Madagascar",["africa"],"mg","261"],["Malawi",["africa"],"mw","265"],["Malaysia",["asia"],"my","60","..-....-...."],["Maldives",["asia"],"mv","960"],["Mali",["africa"],"ml","223"],["Malta",["europe","eu-union"],"mt","356"],["Marshall Islands",["oceania"],"mh","692"],["Martinique",["america","carribean"],"mq","596"],["Mauritania",["africa"],"mr","222"],["Mauritius",["africa"],"mu","230"],["Mexico",["america","central-america"],"mx","52","... ... ....",0,["33","55","81","229","656","664","774","998"]],["Micronesia",["oceania"],"fm","691"],["Moldova",["europe"],"md","373","(..) ..-..-.."],["Monaco",["europe"],"mc","377"],["Mongolia",["asia"],"mn","976"],["Montenegro",["europe","ex-yugos"],"me","382"],["Morocco",["africa","north-africa"],"ma","212"],["Mozambique",["africa"],"mz","258"],["Myanmar",["asia"],"mm","95"],["Namibia",["africa"],"na","264"],["Nauru",["africa"],"nr","674"],["Nepal",["asia"],"np","977"],["Netherlands",["europe","eu-union"],"nl","31",".. ........"],["New Caledonia",["oceania"],"nc","687"],["New Zealand",["oceania"],"nz","64","...-...-...."],["Nicaragua",["america","central-america"],"ni","505"],["Niger",["africa"],"ne","227"],["Nigeria",["africa"],"ng","234"],["North Korea",["asia"],"kp","850"],["Norway",["europe","baltic"],"no","47","... .. ..."],["Oman",["middle-east"],"om","968"],["Pakistan",["asia"],"pk","92","...-......."],["Palau",["oceania"],"pw","680"],["Palestine",["middle-east"],"ps","970"],["Panama",["america","central-america"],"pa","507"],["Papua New Guinea",["oceania"],"pg","675"],["Paraguay",["america","south-america"],"py","595"],["Peru",["america","south-america"],"pe","51"],["Philippines",["asia"],"ph","63",".... ......."],["Poland",["europe","eu-union","baltic"],"pl","48","...-...-..."],["Portugal",["europe","eu-union"],"pt","351"],["Puerto Rico",["america","carribean"],"pr","1","",3],["Qatar",["middle-east"],"qa","974"],["Réunion",["africa"],"re","262"],["Romania",["europe","eu-union"],"ro","40"],["Russia",["europe","asia","ex-ussr","baltic"],"ru","7","(...) ...-..-..",1],["Rwanda",["africa"],"rw","250"],["Saint Kitts and Nevis",["america","carribean"],"kn","1869"],["Saint Lucia",["america","carribean"],"lc","1758"],["Saint Vincent and the Grenadines",["america","carribean"],"vc","1784"],["Samoa",["oceania"],"ws","685"],["San Marino",["europe"],"sm","378"],["São Tomé and Príncipe",["africa"],"st","239"],["Saudi Arabia",["middle-east"],"sa","966"],["Senegal",["africa"],"sn","221"],["Serbia",["europe","ex-yugos"],"rs","381"],["Seychelles",["africa"],"sc","248"],["Sierra Leone",["africa"],"sl","232"],["Singapore",["asia"],"sg","65","....-...."],["Slovakia",["europe","eu-union"],"sk","421"],["Slovenia",["europe","eu-union","ex-yugos"],"si","386"],["Solomon Islands",["oceania"],"sb","677"],["Somalia",["africa"],"so","252"],["South Africa",["africa"],"za","27"],["South Korea",["asia"],"kr","82","... .... ...."],["South Sudan",["africa","north-africa"],"ss","211"],["Spain",["europe","eu-union"],"es","34","... ... ..."],["Sri Lanka",["asia"],"lk","94"],["Sudan",["africa"],"sd","249"],["Suriname",["america","south-america"],"sr","597"],["Swaziland",["africa"],"sz","268"],["Sweden",["europe","eu-union","baltic"],"se","46","(...) ...-..."],["Switzerland",["europe"],"ch","41",".. ... .. .."],["Syria",["middle-east"],"sy","963"],["Taiwan",["asia"],"tw","886"],["Tajikistan",["asia","ex-ussr"],"tj","992"],["Tanzania",["africa"],"tz","255"],["Thailand",["asia"],"th","66"],["Timor-Leste",["asia"],"tl","670"],["Togo",["africa"],"tg","228"],["Tonga",["oceania"],"to","676"],["Trinidad and Tobago",["america","carribean"],"tt","1868"],["Tunisia",["africa","north-africa"],"tn","216"],["Turkey",["europe"],"tr","90","... ... .. .."],["Turkmenistan",["asia","ex-ussr"],"tm","993"],["Tuvalu",["asia"],"tv","688"],["Uganda",["africa"],"ug","256"],["Ukraine",["europe","ex-ussr"],"ua","380","(..) ... .. .."],["United Arab Emirates",["middle-east"],"ae","971"],["United Kingdom",["europe","eu-union"],"gb","44",".... ......"],["United States",["america","north-america"],"us","1","(...) ...-....",0,["201","202","203","205","206","207","208","209","210","212","213","214","215","216","217","218","219","225","228","229","231","239","248","251","252","253","254","256","260","262","269","270","276","281","301","302","303","304","305","307","308","309","310","312","313","314","315","316","317","318","319","320","321","323","325","330","334","336","337","352","360","361","386","401","402","404","405","406","407","408","409","410","412","413","414","415","417","419","423","425","432","434","435","440","478","479","480","501","502","503","504","505","507","508","509","510","512","513","515","516","517","518","520","530","540","541","559","561","562","563","570","573","574","575","580","585","586","601","602","603","605","606","607","608","609","610","612","614","615","616","617","618","619","620","623","626","630","631","636","641","650","651","660","661","662","701","702","703","704","706","707","708","712","713","714","715","716","717","718","719","724","727","731","732","734","740","757","760","763","765","770","772","773","775","781","785","801","802","803","804","805","806","808","810","812","813","814","815","816","817","818","828","830","831","843","845","847","850","856","858","859","860","863","864","865","870","901","903","904","906","907","908","909","910","912","913","914","915","916","918","919","920","925","928","931","936","937","940","941","949","951","952","954","956","970","972","973","978","979","985","989"]],["Uruguay",["america","south-america"],"uy","598"],["Uzbekistan",["asia","ex-ussr"],"uz","998",".. ... .. .."],["Vanuatu",["oceania"],"vu","678"],["Vatican City",["europe"],"va","39",".. .... ....",1],["Venezuela",["america","south-america"],"ve","58"],["Vietnam",["asia"],"vn","84"],["Yemen",["middle-east"],"ye","967"],["Zambia",["africa"],"zm","260"],["Zimbabwe",["africa"],"zw","263"]]},11:function(e,a,r){var t=this&&this.__assign||function(){return t=Object.assign||function(e){for(var a,r=1,t=arguments.length;r<t;r++)for(var n in a=arguments[r])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},t.apply(this,arguments)},n=this&&this.__spreadArray||function(e,a,r){if(r||2===arguments.length)for(var t,n=0,o=a.length;n<o;n++)!t&&n in a||(t||(t=Array.prototype.slice.call(a,0,n)),t[n]=a[n]);return e.concat(t||Array.prototype.slice.call(a))};Object.defineProperty(a,"__esModule",{value:!0}),a.useHistoryState=void 0;var o=r(156),i=r(795),u={size:20,overrideLastItemDebounceMS:-1};a.useHistoryState=function(e,a){var r=t(t({},u),a),l=r.size,c=r.overrideLastItemDebounceMS,s=(0,o.useState)(e),d=s[0],f=s[1],p=(0,o.useState)([d]),v=p[0],y=p[1],m=(0,o.useState)(0),h=m[0],b=m[1],C=(0,i.useTimer)(),g=(0,o.useCallback)((function(e,a){if(("object"!=typeof e||Object.entries(e).toString()!==Object.entries(d).toString())&&e!==d){var r=c>0,t=C.check(),o=!r||void 0===t||t>c;if(void 0!==(null==a?void 0:a.overrideLastItem)?a.overrideLastItem:!o)y((function(a){return n(n([],a.slice(0,h),!0),[e],!1)}));else{var i=v.length>=l;y((function(a){return n(n([],a.slice(i?1:0,h+1),!0),[e],!1)})),i||b((function(e){return e+1}))}f(e)}}),[d,C,c,h,v.length,l]),P=(0,o.useCallback)((function(){if(h<=0)return{success:!1};var e=v[h-1];return f(e),b((function(e){return e-1})),{success:!0,value:e}}),[v,h]),_=(0,o.useCallback)((function(){if(h+1>=v.length)return{success:!1};var e=v[h+1];return f(e),b((function(e){return e+1})),{success:!0,value:e}}),[v,h]);return[d,g,P,_]}},882:(e,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.usePhoneInput=a.defaultConfig=a.MASK_CHAR=void 0;var t=r(156),n=r(946),o=r(332),i=r(11);a.MASK_CHAR=".",a.defaultConfig={value:"",prefix:"+",defaultMask:"............",charAfterDialCode:" ",historySaveDebounceMS:200,disableCountryGuess:!1,disableDialCodePrefill:!1,forceDialCode:!1,disableDialCodeAndPrefix:!1,countries:n.defaultCountries},a.usePhoneInput=function(e){var r=e.defaultCountry,n=e.value,u=void 0===n?a.defaultConfig.value:n,l=e.countries,c=void 0===l?a.defaultConfig.countries:l,s=e.prefix,d=void 0===s?a.defaultConfig.prefix:s,f=e.defaultMask,p=void 0===f?a.defaultConfig.defaultMask:f,v=e.charAfterDialCode,y=void 0===v?a.defaultConfig.charAfterDialCode:v,m=e.historySaveDebounceMS,h=void 0===m?a.defaultConfig.historySaveDebounceMS:m,b=e.disableCountryGuess,C=void 0===b?a.defaultConfig.disableCountryGuess:b,g=e.disableDialCodePrefill,P=void 0===g?a.defaultConfig.disableDialCodePrefill:g,_=e.forceDialCode,O=void 0===_?a.defaultConfig.forceDialCode:_,w=e.disableDialCodeAndPrefix,j=void 0===w?a.defaultConfig.disableDialCodeAndPrefix:w,D=!j&&!C,M=(0,t.useRef)(null),S=function(e){var r,t=e.value,n=e.country,i=e.trimNonDigitsEnd,u=e.insertDialCodeOnEmpty,l=!e.forceDisableCountryGuess&&D?(0,o.guessCountryByPartialNumber)({phone:t,countries:c,currentCountryIso2:n.iso2}):void 0,s=null!==(r=null==l?void 0:l.country)&&void 0!==r?r:n;return{phone:s?(0,o.formatPhone)(t,{prefix:d,mask:s.format||p,maskChar:a.MASK_CHAR,dialCode:s.dialCode,trimNonDigitsEnd:i,charAfterDialCode:y,forceDialCode:O,insertDialCodeOnEmpty:u,disableDialCodeAndPrefix:j}):t,countryGuessResult:l,formatCountry:s}},x=function(e){Promise.resolve().then((function(){var a;null===(a=M.current)||void 0===a||a.setSelectionRange(e,e)}))},N=(0,i.useHistoryState)((function(){var e=(0,o.guessCountryByPartialNumber)({phone:u,countries:c,currentCountryIso2:r}).country||(0,o.getCountry)({value:r,field:"iso2",countries:c});e||console.error('[react-international-phone]: can not find a country with "'.concat(E,'" iso2 code'));var a=S({value:u,country:e,insertDialCodeOnEmpty:!P}).phone;return x(a.length),{phone:a,country:e.iso2}}),{overrideLastItemDebounceMS:h}),k=N[0],A=k.phone,E=k.country,I=N[1],B=N[2],z=N[3],L=(0,t.useMemo)((function(){return(0,o.getCountry)({value:E,field:"iso2",countries:c})}),[c,E]),R=(0,t.useRef)(!1),T=function(e,a){var r,t,n=void 0===a?{}:a,i=n.deletion,u=n.cursorPosition,l=n.insertDialCodeOnEmpty,c=n.inserted,s=e,f=u;O&&!j&&L&&!(0,o.removeNonDigits)(e).startsWith(L.dialCode)&&e&&(c&&e.startsWith(d)&&e.length-(null!=u?u:0)==0?s=e:(s=A,f=0));var p=S({value:s,country:L,trimNonDigitsEnd:"backward"===i,insertDialCodeOnEmpty:l,forceDisableCountryGuess:O&&!!i&&(0,o.removeNonDigits)(s).length<L.dialCode.length}),v=p.phone,m=p.countryGuessResult,h=L;D&&(null==m?void 0:m.country)&&m.country.name!==E&&m.fullDialCodeMatch&&(h=m.country);var b=(0,o.getCursorPosition)({cursorPositionAfterInput:null!=f?f:R.current?0:e.length,phoneBeforeInput:A,phoneAfterInput:e,phoneAfterFormatted:v,leftOffset:O?d.length+(null!==(t=null===(r=null==L?void 0:L.dialCode)||void 0===r?void 0:r.length)&&void 0!==t?t:0)+y.length:0,deletion:i});return I({phone:v,country:h.iso2}),x(b),R.current||(R.current=!0),v};return(0,t.useEffect)((function(){var e=M.current;if(e){var a=function(e){if(e.key){var a=e.ctrlKey,r=e.shiftKey,t="z"===e.key.toLowerCase();a&&t&&(r?z():B())}};return e.addEventListener("keydown",a),function(){e.removeEventListener("keydown",a)}}}),[M,B,z]),(0,t.useEffect)((function(){R.current&&u!==A&&T(u)}),[u]),{phone:A,country:E,setCountry:function(e){var a=(0,o.getCountry)({value:e,field:"iso2",countries:c});if(a){var r=j?"":"".concat(d).concat(a.dialCode).concat(y);I({phone:r,country:a.iso2}),Promise.resolve().then((function(){var e;null===(e=M.current)||void 0===e||e.focus()}))}},handlePhoneValueChange:function(e){var a;e.preventDefault();var r=e.nativeEvent.inputType,t=null==r?void 0:r.startsWith("insertFrom"),n=T(e.target.value,{deletion:function(){var e;if(null!==(e=null==r?void 0:r.toLocaleLowerCase().includes("delete"))&&void 0!==e&&e)return(null==r?void 0:r.toLocaleLowerCase().includes("forward"))?"forward":"backward"}(),inserted:t,cursorPosition:null!==(a=e.target.selectionStart)&&void 0!==a?a:0});return j&&L?(0,o.addDialCode)({phone:n,dialCode:L.dialCode,charAfterDialCode:y,prefix:d}):n},inputRef:M}}},393:(e,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.usePhoneValidation=void 0;var t=r(332);a.usePhoneValidation=function(e,a){return(0,t.validatePhone)(e,a)}},795:(e,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.useTimer=void 0;var t=r(156);a.useTimer=function(){var e=(0,t.useRef)(),a=(0,t.useRef)(Date.now());return{check:function(){var r=Date.now(),t=e.current?r-a.current:void 0;return e.current=a.current,a.current=r,t}}}},515:function(e,a){var r=this&&this.__spreadArray||function(e,a,r){if(r||2===arguments.length)for(var t,n=0,o=a.length;n<o;n++)!t&&n in a||(t||(t=Array.prototype.slice.call(a,0,n)),t[n]=a[n]);return e.concat(t||Array.prototype.slice.call(a))};Object.defineProperty(a,"__esModule",{value:!0}),a.buildClassNames=a.classNamesWithPrefix=a.joinClasses=a.classPrefix=void 0,a.classPrefix="react-international-phone-",a.joinClasses=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return e.filter((function(e){return!!e})).join(" ").trim()},a.classNamesWithPrefix=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return a.joinClasses.apply(void 0,e).split(" ").map((function(e){return"".concat(a.classPrefix).concat(e)})).join(" ")},a.buildClassNames=function(e){var t=e.addPrefix,n=e.rawClassNames;return a.joinClasses.apply(void 0,r([a.classNamesWithPrefix.apply(void 0,t)],n,!1))}},62:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.applyMask=void 0,a.applyMask=function(e){var a=e.value,r=e.mask,t=e.maskSymbol,n=e.offset,o=void 0===n?0:n,i=e.trimNonMaskCharsLeftover,u=void 0!==i&&i;if(a.length<o)return a;for(var l=a.slice(0,o),c=a.slice(o),s=l,d=0,f=0,p=r.split("");f<p.length;f++){var v=p[f];if(d>=c.length){if(!u&&v!==t){s+=v;continue}break}v===t?(s+=c[d],d+=1):s+=v}return s}},239:function(e,a,r){var t=this&&this.__createBinding||(Object.create?function(e,a,r,t){void 0===t&&(t=r);var n=Object.getOwnPropertyDescriptor(a,r);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(e,t,n)}:function(e,a,r,t){void 0===t&&(t=r),e[t]=a[r]}),n=this&&this.__exportStar||function(e,a){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(a,r)||t(a,e,r)};Object.defineProperty(a,"__esModule",{value:!0}),n(r(62),a),n(r(939),a),n(r(222),a)},939:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.removeNonDigits=void 0,a.removeNonDigits=function(e){return e.replace(/\D/g,"")}},222:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.scrollToChild=void 0,a.scrollToChild=function(e,a){var r=e.style.display;"block"!==r&&(e.style.display="block");var t=e.getBoundingClientRect(),n=a.getBoundingClientRect(),o=n.top-t.top,i=t.bottom-n.bottom;o>=0&&i>=0||(Math.abs(o)<Math.abs(i)?e.scrollTop+=o:e.scrollTop-=i),e.style.display=r}},298:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.buildCountryData=void 0,a.buildCountryData=function(e){return[e.name,e.regions,e.iso2,e.dialCode,e.format,e.priority,e.areaCodes].filter(Boolean)}},891:(e,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getCountry=void 0;var t=r(300);a.getCountry=function(e){var a=e.value,r=e.field,n=e.countries;if(["regions","priority"].includes(r))throw new Error(function(e){return'Field "'.concat(e,'" is not supported')}(r));var o=n.find((function(e){var n=(0,t.parseCountry)(e);return a===n[r]}));if(o)return(0,t.parseCountry)(o)}},4:(e,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.guessCountryByPartialNumber=void 0;var t=r(239),n=r(891),o=r(300);a.guessCountryByPartialNumber=function(e){var a,r=e.phone,i=e.countries,u=e.currentCountryIso2,l={country:void 0,fullDialCodeMatch:!1,areaCodeMatch:void 0};if(!r)return l;var c=(0,t.removeNonDigits)(r);if(!c)return l;for(var s=l,d=function(e){var a,r,t,n,o=e.country,i=e.fullDialCodeMatch,u=e.areaCodeMatch,l=o.dialCode===(null===(a=s.country)||void 0===a?void 0:a.dialCode),c=(null!==(r=o.priority)&&void 0!==r?r:0)<(null!==(n=null===(t=s.country)||void 0===t?void 0:t.priority)&&void 0!==n?n:0);l&&!c||(s={country:o,fullDialCodeMatch:i,areaCodeMatch:u})},f=0,p=i;f<p.length;f++){var v=p[f],y=(0,o.parseCountry)(v),m=y.dialCode,h=y.areaCodes;if(c.startsWith(m)){var b=!s.country||Number(m)>=Number(s.country.dialCode);if(h)for(var C=c.substring(m.length),g=0,P=h;g<P.length;g++){var _=P[g];if(C.startsWith(_))return{country:y,fullDialCodeMatch:!0,areaCodeMatch:!0}}!b&&m!==c&&s.fullDialCodeMatch||d({country:y,fullDialCodeMatch:!0,areaCodeMatch:h?!h:void 0})}s.fullDialCodeMatch||c.length<m.length&&m.startsWith(c)&&(!s.country||Number(m)<=Number(s.country.dialCode))&&d({country:y,fullDialCodeMatch:!1})}if(u){var O=(0,n.getCountry)({value:u,field:"iso2",countries:i});s&&O&&(null===(a=s.country)||void 0===a?void 0:a.dialCode)===O.dialCode&&s.country!==O&&s.fullDialCodeMatch&&!s.areaCodeMatch&&(s.country=O)}return s}},88:function(e,a,r){var t=this&&this.__createBinding||(Object.create?function(e,a,r,t){void 0===t&&(t=r);var n=Object.getOwnPropertyDescriptor(a,r);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(e,t,n)}:function(e,a,r,t){void 0===t&&(t=r),e[t]=a[r]}),n=this&&this.__exportStar||function(e,a){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(a,r)||t(a,e,r)};Object.defineProperty(a,"__esModule",{value:!0}),n(r(298),a),n(r(891),a),n(r(4),a),n(r(300),a)},300:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.parseCountry=void 0,a.parseCountry=function(e){return{name:e[0],regions:e[1],iso2:e[2],dialCode:e[3],format:e[4],priority:e[5],areaCodes:e[6]}}},332:function(e,a,r){var t=this&&this.__createBinding||(Object.create?function(e,a,r,t){void 0===t&&(t=r);var n=Object.getOwnPropertyDescriptor(a,r);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(e,t,n)}:function(e,a,r,t){void 0===t&&(t=r),e[t]=a[r]}),n=this&&this.__exportStar||function(e,a){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(a,r)||t(a,e,r)};Object.defineProperty(a,"__esModule",{value:!0}),n(r(239),a),n(r(88),a),n(r(165),a)},820:(e,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDialCode=void 0;var t=r(214);a.addDialCode=function(e){var a=e.phone,r=e.dialCode,n=e.prefix,o=void 0===n?"+":n,i=e.charAfterDialCode,u=void 0===i?" ":i;return"".concat(o).concat(r).concat(u).concat((0,t.removeDialCode)({phone:a,dialCode:r,charAfterDialCode:u,prefix:o}))}},380:(e,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.formatPhone=void 0;var t=r(239);a.formatPhone=function(e,a){var r=!a.disableDialCodeAndPrefix&&a.forceDialCode,n=!a.disableDialCodeAndPrefix&&a.insertDialCodeOnEmpty,o=e,i=function(e){return a.trimNonDigitsEnd?e.trim():e};if(!o)return n&&!o.length||r?i("".concat(a.prefix).concat(a.dialCode).concat(a.charAfterDialCode)):i(o);if((o=(0,t.removeNonDigits)(o))===a.dialCode&&!a.disableDialCodeAndPrefix)return i("".concat(a.prefix).concat(a.dialCode).concat(a.charAfterDialCode));if(a.dialCode.startsWith(o)&&!a.disableDialCodeAndPrefix)return i(r?"".concat(a.prefix).concat(a.dialCode).concat(a.charAfterDialCode):"".concat(a.prefix).concat(o));if(!o.startsWith(a.dialCode)&&!a.disableDialCodeAndPrefix){if(r)return i("".concat(a.prefix).concat(a.dialCode).concat(a.charAfterDialCode));if(o.length<a.dialCode.length)return i("".concat(a.prefix).concat(o))}var u,l=(u=a.dialCode.length,a.disableDialCodeAndPrefix&&(u=0),{phoneLeftSide:o.slice(0,u),phoneRightSide:o.slice(u)}),c=l.phoneLeftSide,s=l.phoneRightSide;return c="".concat(a.prefix).concat(c).concat(a.charAfterDialCode),s=(0,t.applyMask)({value:s,mask:a.mask,maskSymbol:a.maskChar,trimNonMaskCharsLeftover:a.trimNonDigitsEnd}),a.disableDialCodeAndPrefix&&(c=""),i("".concat(c).concat(s))}},775:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getCursorPosition=void 0;var r=function(e){return/\d/.test(e)};a.getCursorPosition=function(e){var a=e.phoneBeforeInput,t=e.phoneAfterInput,n=e.phoneAfterFormatted,o=e.cursorPositionAfterInput,i=e.leftOffset,u=void 0===i?0:i,l=e.deletion;if(o<u)return u;if(!a)return n.length;var c="backward"===l;if(0===o&&t.length>0&&n.length>0){if(c)return 0;for(var s=0;s<n.length;s+=1)if(r(n[s]))return s;return n.length}if(t.length<a.length&&1===t.length)return n.length;var d=null;for(s=o-1;s>=0;s-=1)if(r(t[s])){d=s;break}if(null===d)return 0!==o?o:n.length;var f=0;for(s=0;s<d;s+=1)r(t[s])&&(f+=1);c&&(f-=1);var p=0,v=0;for(s=0;s<n.length&&(p+=1,r(n[s])&&(v+=1),v!==f+1);s+=1);for(;!r(n[p])&&p<n.length;)p+=1;return c&&(p+=1),p}},165:function(e,a,r){var t=this&&this.__createBinding||(Object.create?function(e,a,r,t){void 0===t&&(t=r);var n=Object.getOwnPropertyDescriptor(a,r);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(e,t,n)}:function(e,a,r,t){void 0===t&&(t=r),e[t]=a[r]}),n=this&&this.__exportStar||function(e,a){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(a,r)||t(a,e,r)};Object.defineProperty(a,"__esModule",{value:!0}),n(r(820),a),n(r(380),a),n(r(775),a),n(r(214),a),n(r(684),a)},214:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.removeDialCode=void 0,a.removeDialCode=function(e){var a=e.phone,r=e.dialCode,t=e.prefix,n=void 0===t?"+":t,o=e.charAfterDialCode,i=void 0===o?" ":o;if(!a||!r)return a;var u=a;return u.startsWith(n)&&(u=u.replace(n,"")),u.startsWith(r)?((u=u.replace(r,"")).startsWith(i)&&(u=u.replace(i,"")),u):a}},684:function(e,a,r){var t=this&&this.__assign||function(){return t=Object.assign||function(e){for(var a,r=1,t=arguments.length;r<t;r++)for(var n in a=arguments[r])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},t.apply(this,arguments)};Object.defineProperty(a,"__esModule",{value:!0}),a.validatePhone=void 0;var n=r(882),o=r(239),i=r(88);a.validatePhone=function(e,a){var r=t(t({},n.defaultConfig),a),u=r.countries,l=r.defaultMask,c=r.defaultMaskMinPhoneLength,s=void 0===c?10:c,d=r.prefix,f=r.charAfterDialCode,p=(0,i.guessCountryByPartialNumber)({phone:e,countries:u}),v=p.country,y=p.fullDialCodeMatch,m=p.areaCodeMatch;if(!v||!y)return{country:void 0,lengthMatch:!1,areaCodeMatch:m,isValid:!1};var h="".concat(d).concat(v.dialCode).concat(f);if(!e.startsWith(h))return{country:v,lengthMatch:!1,areaCodeMatch:m,isValid:!1};var b=e.substring(h.length),C=!v.format,g=C?l:v.format;if(C&&(0,o.removeNonDigits)(e).length<s)return{country:v,lengthMatch:!1,areaCodeMatch:m,isValid:!1};if(!C&&b.length!==g.length)return{country:v,lengthMatch:!1,areaCodeMatch:m,isValid:!1};for(var P=0;P<b.length;P+=1)if(b[P]!==g[P]&&g[P]!==n.MASK_CHAR)return{country:v,lengthMatch:!1,areaCodeMatch:m,isValid:!1};return{country:v,lengthMatch:!0,areaCodeMatch:m,isValid:null==m||m}}},156:a=>{a.exports=e}},r={};function t(e){var n=r[e];if(void 0!==n)return n.exports;var o=r[e]={exports:{}};return a[e].call(o.exports,o,o.exports,t),o.exports}t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{var e=n;Object.defineProperty(e,"__esModule",{value:!0}),e.validatePhone=e.parseCountry=e.buildCountryData=e.usePhoneValidation=e.usePhoneInput=e.defaultCountries=e.PhoneInput=e.FlagEmoji=e.DialCodePreview=e.CountrySelectorDropdown=e.CountrySelector=void 0;var a=t(153);Object.defineProperty(e,"CountrySelector",{enumerable:!0,get:function(){return a.CountrySelector}});var r=t(60);Object.defineProperty(e,"CountrySelectorDropdown",{enumerable:!0,get:function(){return r.CountrySelectorDropdown}});var o=t(7);Object.defineProperty(e,"DialCodePreview",{enumerable:!0,get:function(){return o.DialCodePreview}});var i=t(425);Object.defineProperty(e,"FlagEmoji",{enumerable:!0,get:function(){return i.FlagEmoji}});var u=t(28);Object.defineProperty(e,"PhoneInput",{enumerable:!0,get:function(){return u.PhoneInput}});var l=t(946);Object.defineProperty(e,"defaultCountries",{enumerable:!0,get:function(){return l.defaultCountries}});var c=t(882);Object.defineProperty(e,"usePhoneInput",{enumerable:!0,get:function(){return c.usePhoneInput}});var s=t(393);Object.defineProperty(e,"usePhoneValidation",{enumerable:!0,get:function(){return s.usePhoneValidation}});var d=t(332);Object.defineProperty(e,"buildCountryData",{enumerable:!0,get:function(){return d.buildCountryData}}),Object.defineProperty(e,"parseCountry",{enumerable:!0,get:function(){return d.parseCountry}}),Object.defineProperty(e,"validatePhone",{enumerable:!0,get:function(){return d.validatePhone}})})(),n})()));
{
"name": "react-international-phone",
"version": "1.8.8",
"version": "2.0.0",
"description": "☎️ International phone input component for React",

@@ -5,0 +5,0 @@ "keywords": [

@@ -10,2 +10,4 @@ # react-international-phone

![downloads](https://img.shields.io/npm/dt/react-international-phone)
![Semantic Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)
[![stars](https://img.shields.io/github/stars/goveo/react-international-phone?style=social)](https://github.com/goveo/react-international-phone)

@@ -44,3 +46,3 @@ [Live demo: Storybook](https://react-international-phone-storybook.vercel.app)

<PhoneInput
initialCountry="ua"
defaultCountry="ua"
value={phone}

@@ -57,1 +59,6 @@ onChange={(phone) => setPhone(phone)}

Find the full API reference on [official documentation](https://react-international-phone-docs.vercel.app/).
## Update from v1 to v2
You can encounter some breaking changes after update from v1 to v2 <br/>
Checkout [migration document](https://react-international-phone-docs.vercel.app/docs/migration) that contains a list of breaking changes and ways to migrate.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc