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

@geoapify/geocoder-autocomplete

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@geoapify/geocoder-autocomplete - npm Package Compare versions

Comparing version 1.5.1 to 2.0.0

dist/index.min.esm.js.map

20

dist/autocomplete.d.ts

@@ -20,2 +20,4 @@ export declare class GeocoderAutocomplete {

private suggestionsFilter?;
private sendGeocoderRequestAlt?;
private sendPlaceDetailsRequestAlt?;
private geocoderUrl;

@@ -47,3 +49,3 @@ private placeDetailsUrl;

clearBias(): void;
on(operation: 'select' | 'suggestions' | 'input' | 'close' | 'open', callback: (param: any) => any): void;
on(operation: 'select' | 'suggestions' | 'input' | 'close' | 'open', callback: (param: any) => void): void;
off(operation: 'select' | 'suggestions' | 'input' | 'close' | 'open', callback?: (param: any) => any): void;

@@ -54,5 +56,9 @@ once(operation: 'select' | 'suggestions' | 'input' | 'close' | 'open', callback: (param: any) => any): void;

setPostprocessHook(postprocessHookFunc?: (value: string) => string): void;
setSendGeocoderRequestFunc(sendGeocoderRequestFunc: (value: string, geocoderAutocomplete: GeocoderAutocomplete) => Promise<any>): void;
setSendPlaceDetailsRequestFunc(sendPlaceDetailsRequestFunc: (feature: any, geocoderAutocomplete: GeocoderAutocomplete) => Promise<any>): void;
isOpen(): boolean;
close(): void;
open(): void;
sendGeocoderRequest(value: string): Promise<any>;
sendPlaceDetailsRequest(feature: any): Promise<any>;
onUserInput(event: Event): boolean;

@@ -93,3 +99,7 @@ private addHouseNumberToFormatted;

skipIcons?: boolean;
/**
* @deprecated The property should not be used; it is true by default. Use the addDetails property to add details.
*/
skipDetails?: boolean;
addDetails?: boolean;
skipSelectionOnArrowKey?: boolean;

@@ -105,3 +115,3 @@ position?: GeoPosition;

}
export declare type ByCountryCodeOptions = CountyCode[];
export type ByCountryCodeOptions = CountyCode[];
export interface ByProximityOptions {

@@ -122,4 +132,4 @@ lon: number;

}
export declare type LocationType = 'country' | 'state' | 'city' | 'postcode' | 'street' | 'amenity';
export declare type SupportedLanguage = "ab" | "aa" | "af" | "ak" | "sq" | "am" | "ar" | "an" | "hy" | "as" | "av" | "ae" | "ay" | "az" | "bm" | "ba" | "eu" | "be" | "bn" | "bh" | "bi" | "bs" | "br" | "bg" | "my" | "ca" | "ch" | "ce" | "ny" | "zh" | "cv" | "kw" | "co" | "cr" | "hr" | "cs" | "da" | "dv" | "nl" | "en" | "eo" | "et" | "ee" | "fo" | "fj" | "fi" | "fr" | "ff" | "gl" | "ka" | "de" | "el" | "gn" | "gu" | "ht" | "ha" | "he" | "hz" | "hi" | "ho" | "hu" | "ia" | "id" | "ie" | "ga" | "ig" | "ik" | "io" | "is" | "it" | "iu" | "ja" | "jv" | "kl" | "kn" | "kr" | "ks" | "kk" | "km" | "ki" | "rw" | "ky" | "kv" | "kg" | "ko" | "ku" | "kj" | "la" | "lb" | "lg" | "li" | "ln" | "lo" | "lt" | "lu" | "lv" | "gv" | "mk" | "mg" | "ms" | "ml" | "mt" | "mi" | "mr" | "mh" | "mn" | "na" | "nv" | "nb" | "nd" | "ne" | "ng" | "nn" | "no" | "ii" | "nr" | "oc" | "oj" | "cu" | "om" | "or" | "os" | "pa" | "pi" | "fa" | "pl" | "ps" | "pt" | "qu" | "rm" | "rn" | "ro" | "ru" | "sa" | "sc" | "sd" | "se" | "sm" | "sg" | "sr" | "gd" | "sn" | "si" | "sk" | "sl" | "so" | "st" | "es" | "su" | "sw" | "ss" | "sv" | "ta" | "te" | "tg" | "th" | "ti" | "bo" | "tk" | "tl" | "tn" | "to" | "tr" | "ts" | "tt" | "tw" | "ty" | "ug" | "uk" | "ur" | "uz" | "ve" | "vi" | "vo" | "wa" | "cy" | "wo" | "fy" | "xh" | "yi" | "yo" | "za";
export declare type CountyCode = "none" | "auto" | "ad" | "ae" | "af" | "ag" | "ai" | "al" | "am" | "an" | "ao" | "ap" | "aq" | "ar" | "as" | "at" | "au" | "aw" | "az" | "ba" | "bb" | "bd" | "be" | "bf" | "bg" | "bh" | "bi" | "bj" | "bm" | "bn" | "bo" | "br" | "bs" | "bt" | "bv" | "bw" | "by" | "bz" | "ca" | "cc" | "cd" | "cf" | "cg" | "ch" | "ci" | "ck" | "cl" | "cm" | "cn" | "co" | "cr" | "cu" | "cv" | "cx" | "cy" | "cz" | "de" | "dj" | "dk" | "dm" | "do" | "dz" | "ec" | "ee" | "eg" | "eh" | "er" | "es" | "et" | "eu" | "fi" | "fj" | "fk" | "fm" | "fo" | "fr" | "ga" | "gb" | "gd" | "ge" | "gf" | "gh" | "gi" | "gl" | "gm" | "gn" | "gp" | "gq" | "gr" | "gs" | "gt" | "gu" | "gw" | "gy" | "hk" | "hm" | "hn" | "hr" | "ht" | "hu" | "id" | "ie" | "il" | "in" | "io" | "iq" | "ir" | "is" | "it" | "jm" | "jo" | "jp" | "ke" | "kg" | "kh" | "ki" | "km" | "kn" | "kp" | "kr" | "kw" | "ky" | "kz" | "la" | "lb" | "lc" | "li" | "lk" | "lr" | "ls" | "lt" | "lu" | "lv" | "ly" | "ma" | "mc" | "md" | "me" | "mg" | "mh" | "mk" | "ml" | "mm" | "mn" | "mo" | "mp" | "mq" | "mr" | "ms" | "mt" | "mu" | "mv" | "mw" | "mx" | "my" | "mz" | "na" | "nc" | "ne" | "nf" | "ng" | "ni" | "nl" | "no" | "np" | "nr" | "nu" | "nz" | "om" | "pa" | "pe" | "pf" | "pg" | "ph" | "pk" | "pl" | "pm" | "pr" | "ps" | "pt" | "pw" | "py" | "qa" | "re" | "ro" | "rs" | "ru" | "rw" | "sa" | "sb" | "sc" | "sd" | "se" | "sg" | "sh" | "si" | "sj" | "sk" | "sl" | "sm" | "sn" | "so" | "sr" | "st" | "sv" | "sy" | "sz" | "tc" | "td" | "tf" | "tg" | "th" | "tj" | "tk" | "tm" | "tn" | "to" | "tr" | "tt" | "tv" | "tw" | "tz" | "ua" | "ug" | "um" | "us" | "uy" | "uz" | "va" | "vc" | "ve" | "vg" | "vi" | "vn" | "vu" | "wf" | "ws" | "ye" | "yt" | "za" | "zm" | "zw";
export type LocationType = 'country' | 'state' | 'city' | 'postcode' | 'street' | 'amenity';
export type SupportedLanguage = "ab" | "aa" | "af" | "ak" | "sq" | "am" | "ar" | "an" | "hy" | "as" | "av" | "ae" | "ay" | "az" | "bm" | "ba" | "eu" | "be" | "bn" | "bh" | "bi" | "bs" | "br" | "bg" | "my" | "ca" | "ch" | "ce" | "ny" | "zh" | "cv" | "kw" | "co" | "cr" | "hr" | "cs" | "da" | "dv" | "nl" | "en" | "eo" | "et" | "ee" | "fo" | "fj" | "fi" | "fr" | "ff" | "gl" | "ka" | "de" | "el" | "gn" | "gu" | "ht" | "ha" | "he" | "hz" | "hi" | "ho" | "hu" | "ia" | "id" | "ie" | "ga" | "ig" | "ik" | "io" | "is" | "it" | "iu" | "ja" | "jv" | "kl" | "kn" | "kr" | "ks" | "kk" | "km" | "ki" | "rw" | "ky" | "kv" | "kg" | "ko" | "ku" | "kj" | "la" | "lb" | "lg" | "li" | "ln" | "lo" | "lt" | "lu" | "lv" | "gv" | "mk" | "mg" | "ms" | "ml" | "mt" | "mi" | "mr" | "mh" | "mn" | "na" | "nv" | "nb" | "nd" | "ne" | "ng" | "nn" | "no" | "ii" | "nr" | "oc" | "oj" | "cu" | "om" | "or" | "os" | "pa" | "pi" | "fa" | "pl" | "ps" | "pt" | "qu" | "rm" | "rn" | "ro" | "ru" | "sa" | "sc" | "sd" | "se" | "sm" | "sg" | "sr" | "gd" | "sn" | "si" | "sk" | "sl" | "so" | "st" | "es" | "su" | "sw" | "ss" | "sv" | "ta" | "te" | "tg" | "th" | "ti" | "bo" | "tk" | "tl" | "tn" | "to" | "tr" | "ts" | "tt" | "tw" | "ty" | "ug" | "uk" | "ur" | "uz" | "ve" | "vi" | "vo" | "wa" | "cy" | "wo" | "fy" | "xh" | "yi" | "yo" | "za";
export type CountyCode = "none" | "auto" | "ad" | "ae" | "af" | "ag" | "ai" | "al" | "am" | "an" | "ao" | "ap" | "aq" | "ar" | "as" | "at" | "au" | "aw" | "az" | "ba" | "bb" | "bd" | "be" | "bf" | "bg" | "bh" | "bi" | "bj" | "bm" | "bn" | "bo" | "br" | "bs" | "bt" | "bv" | "bw" | "by" | "bz" | "ca" | "cc" | "cd" | "cf" | "cg" | "ch" | "ci" | "ck" | "cl" | "cm" | "cn" | "co" | "cr" | "cu" | "cv" | "cx" | "cy" | "cz" | "de" | "dj" | "dk" | "dm" | "do" | "dz" | "ec" | "ee" | "eg" | "eh" | "er" | "es" | "et" | "eu" | "fi" | "fj" | "fk" | "fm" | "fo" | "fr" | "ga" | "gb" | "gd" | "ge" | "gf" | "gh" | "gi" | "gl" | "gm" | "gn" | "gp" | "gq" | "gr" | "gs" | "gt" | "gu" | "gw" | "gy" | "hk" | "hm" | "hn" | "hr" | "ht" | "hu" | "id" | "ie" | "il" | "in" | "io" | "iq" | "ir" | "is" | "it" | "jm" | "jo" | "jp" | "ke" | "kg" | "kh" | "ki" | "km" | "kn" | "kp" | "kr" | "kw" | "ky" | "kz" | "la" | "lb" | "lc" | "li" | "lk" | "lr" | "ls" | "lt" | "lu" | "lv" | "ly" | "ma" | "mc" | "md" | "me" | "mg" | "mh" | "mk" | "ml" | "mm" | "mn" | "mo" | "mp" | "mq" | "mr" | "ms" | "mt" | "mu" | "mv" | "mw" | "mx" | "my" | "mz" | "na" | "nc" | "ne" | "nf" | "ng" | "ni" | "nl" | "no" | "np" | "nr" | "nu" | "nz" | "om" | "pa" | "pe" | "pf" | "pg" | "ph" | "pk" | "pl" | "pm" | "pr" | "ps" | "pt" | "pw" | "py" | "qa" | "re" | "ro" | "rs" | "ru" | "rw" | "sa" | "sb" | "sc" | "sd" | "se" | "sg" | "sh" | "si" | "sj" | "sk" | "sl" | "sm" | "sn" | "so" | "sr" | "st" | "sv" | "sy" | "sz" | "tc" | "td" | "tf" | "tg" | "th" | "tj" | "tk" | "tm" | "tn" | "to" | "tr" | "tt" | "tv" | "tw" | "tz" | "ua" | "ug" | "um" | "us" | "uy" | "uz" | "va" | "vc" | "ve" | "vg" | "vi" | "vn" | "vu" | "wf" | "ws" | "ye" | "yt" | "za" | "zm" | "zw";

@@ -26,2 +26,4 @@ import countiesData from "./countries.json";

suggestionsFilter;
sendGeocoderRequestAlt;
sendPlaceDetailsRequestAlt;
geocoderUrl = "https://api.geoapify.com/v1/geocode/autocomplete";

@@ -192,10 +194,41 @@ placeDetailsUrl = "https://api.geoapify.com/v2/place-details";

setSuggestionsFilter(suggestionsFilterFunc) {
this.suggestionsFilter = suggestionsFilterFunc;
if (suggestionsFilterFunc && typeof suggestionsFilterFunc === 'function') {
this.suggestionsFilter = suggestionsFilterFunc;
}
else {
this.suggestionsFilter = null;
}
}
setPreprocessHook(preprocessHookFunc) {
this.preprocessHook = preprocessHookFunc;
if (preprocessHookFunc && typeof preprocessHookFunc === 'function') {
this.preprocessHook = preprocessHookFunc;
}
else {
this.preprocessHook = null;
}
}
setPostprocessHook(postprocessHookFunc) {
this.postprocessHook = postprocessHookFunc;
if (postprocessHookFunc && typeof postprocessHookFunc === 'function') {
this.postprocessHook = postprocessHookFunc;
}
else {
this.postprocessHook = null;
}
}
setSendGeocoderRequestFunc(sendGeocoderRequestFunc) {
if (sendGeocoderRequestFunc && typeof sendGeocoderRequestFunc === 'function') {
this.sendGeocoderRequestAlt = sendGeocoderRequestFunc;
}
else {
this.sendGeocoderRequestAlt = null;
}
}
setSendPlaceDetailsRequestFunc(sendPlaceDetailsRequestFunc) {
if (sendPlaceDetailsRequestFunc && typeof sendPlaceDetailsRequestFunc === 'function') {
this.sendPlaceDetailsRequestAlt = sendPlaceDetailsRequestFunc;
}
else {
this.sendPlaceDetailsRequestAlt = null;
}
}
isOpen() {

@@ -212,2 +245,42 @@ return !!this.autocompleteItemsElement;

}
sendGeocoderRequest(value) {
return new Promise((resolve, reject) => {
this.currentPromiseReject = reject;
let url = this.generateUrl(value);
fetch(url)
.then((response) => {
if (response.ok) {
response.json().then(data => resolve(data));
}
else {
response.json().then(data => reject(data));
}
});
});
}
sendPlaceDetailsRequest(feature) {
return new Promise((resolve, reject) => {
if (feature.properties.datasource?.sourcename !== 'openstreetmap' || !feature.properties.place_id) {
// only OSM data has detailed information; return the original object if the source is different from OSM
resolve(feature);
return;
}
this.currentPlaceDetailsPromiseReject = reject;
let url = this.generatePlacesUrlUrl(feature.properties.place_id);
fetch(url)
.then((response) => {
if (response.ok) {
response.json().then(data => {
if (!data.features.length) {
resolve(feature);
}
resolve(data.features[0]);
});
}
else {
response.json().then(data => reject(data));
}
});
});
}
/* Execute a function when someone writes in the text field: */

@@ -241,18 +314,12 @@ onUserInput(event) {

/* Create a new promise and send geocoding request */
const promise = new Promise((resolve, reject) => {
this.currentPromiseReject = reject;
if (this.preprocessHook && typeof this.preprocessHook === 'function') {
currentValue = this.preprocessHook(currentValue);
}
let url = this.generateUrl(currentValue);
fetch(url)
.then((response) => {
if (response.ok) {
response.json().then(data => resolve(data));
}
else {
response.json().then(data => reject(data));
}
});
});
if (this.preprocessHook && typeof this.preprocessHook === 'function') {
currentValue = this.preprocessHook(currentValue);
}
let promise;
if (this.sendGeocoderRequestAlt) {
promise = this.sendGeocoderRequestAlt(currentValue, this);
}
else {
promise = this.sendGeocoderRequest(currentValue);
}
promise.then((data) => {

@@ -571,26 +638,15 @@ if (data.features && data.features.length &&

}
if (this.options.skipDetails || !feature || feature.properties.nonVerifiedParts?.length) {
if (!this.options.addDetails || !feature || feature.properties.nonVerifiedParts?.length) {
this.changeCallbacks.forEach(callback => callback(feature));
}
else {
const promise = new Promise((resolve, reject) => {
this.currentPlaceDetailsPromiseReject = reject;
let url = this.generatePlacesUrlUrl(feature.properties.place_id);
fetch(url)
.then((response) => {
if (response.ok) {
response.json().then(data => resolve(data));
}
else {
response.json().then(data => reject(data));
}
});
});
promise.then((data) => {
if (!data.features.length) {
this.changeCallbacks.forEach(callback => callback(feature));
return;
}
const placeDetails = data.features[0];
this.changeCallbacks.forEach(callback => callback(placeDetails));
let promise;
if (this.sendPlaceDetailsRequestAlt) {
promise = this.sendPlaceDetailsRequestAlt(feature, this);
}
else {
promise = this.sendPlaceDetailsRequest(feature);
}
promise.then((detailesFeature) => {
this.changeCallbacks.forEach(callback => callback(detailesFeature));
this.currentPlaceDetailsPromiseReject = null;

@@ -600,2 +656,4 @@ }, (err) => {

console.log(err);
this.changeCallbacks.forEach(callback => callback(feature));
this.currentPlaceDetailsPromiseReject = null;
}

@@ -602,0 +660,0 @@ });

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

var e=[{code:"AD",emoji:"🇦🇩",unicode:"U+1F1E6 U+1F1E9",name:"Andorra",title:"flag for Andorra",dialCode:"+376"},{code:"AE",emoji:"🇦🇪",unicode:"U+1F1E6 U+1F1EA",name:"United Arab Emirates",title:"flag for United Arab Emirates",dialCode:"+971"},{code:"AF",emoji:"🇦🇫",unicode:"U+1F1E6 U+1F1EB",name:"Afghanistan",title:"flag for Afghanistan",dialCode:"+93"},{code:"AG",emoji:"🇦🇬",unicode:"U+1F1E6 U+1F1EC",name:"Antigua and Barbuda",title:"flag for Antigua and Barbuda",dialCode:"+1268"},{code:"AI",emoji:"🇦🇮",unicode:"U+1F1E6 U+1F1EE",name:"Anguilla",title:"flag for Anguilla",dialCode:"+1 264"},{code:"AL",emoji:"🇦🇱",unicode:"U+1F1E6 U+1F1F1",name:"Albania",title:"flag for Albania",dialCode:"+355"},{code:"AM",emoji:"🇦🇲",unicode:"U+1F1E6 U+1F1F2",name:"Armenia",title:"flag for Armenia",dialCode:"+374"},{code:"AO",emoji:"🇦🇴",unicode:"U+1F1E6 U+1F1F4",name:"Angola",title:"flag for Angola",dialCode:"+244"},{code:"AQ",emoji:"🇦🇶",unicode:"U+1F1E6 U+1F1F6",name:"Antarctica",title:"flag for Antarctica",dialCode:null},{code:"AR",emoji:"🇦🇷",unicode:"U+1F1E6 U+1F1F7",name:"Argentina",title:"flag for Argentina",dialCode:"+54"},{code:"AS",emoji:"🇦🇸",unicode:"U+1F1E6 U+1F1F8",name:"American Samoa",title:"flag for American Samoa",dialCode:"+1 684"},{code:"AT",emoji:"🇦🇹",unicode:"U+1F1E6 U+1F1F9",name:"Austria",title:"flag for Austria",dialCode:"+43"},{code:"AU",emoji:"🇦🇺",unicode:"U+1F1E6 U+1F1FA",name:"Australia",title:"flag for Australia",dialCode:"+61"},{code:"AW",emoji:"🇦🇼",unicode:"U+1F1E6 U+1F1FC",name:"Aruba",title:"flag for Aruba",dialCode:"+297"},{code:"AX",emoji:"🇦🇽",unicode:"U+1F1E6 U+1F1FD",name:"Åland Islands",title:"flag for Åland Islands",dialCode:""},{code:"AZ",emoji:"🇦🇿",unicode:"U+1F1E6 U+1F1FF",name:"Azerbaijan",title:"flag for Azerbaijan",dialCode:"+994"},{code:"BA",emoji:"🇧🇦",unicode:"U+1F1E7 U+1F1E6",name:"Bosnia and Herzegovina",title:"flag for Bosnia and Herzegovina",dialCode:"+387"},{code:"BB",emoji:"🇧🇧",unicode:"U+1F1E7 U+1F1E7",name:"Barbados",title:"flag for Barbados",dialCode:"+1 246"},{code:"BD",emoji:"🇧🇩",unicode:"U+1F1E7 U+1F1E9",name:"Bangladesh",title:"flag for Bangladesh",dialCode:"+880"},{code:"BE",emoji:"🇧🇪",unicode:"U+1F1E7 U+1F1EA",name:"Belgium",title:"flag for Belgium",dialCode:"+32"},{code:"BF",emoji:"🇧🇫",unicode:"U+1F1E7 U+1F1EB",name:"Burkina Faso",title:"flag for Burkina Faso",dialCode:"+226"},{code:"BG",emoji:"🇧🇬",unicode:"U+1F1E7 U+1F1EC",name:"Bulgaria",title:"flag for Bulgaria",dialCode:"+359"},{code:"BH",emoji:"🇧🇭",unicode:"U+1F1E7 U+1F1ED",name:"Bahrain",title:"flag for Bahrain",dialCode:"+973"},{code:"BI",emoji:"🇧🇮",unicode:"U+1F1E7 U+1F1EE",name:"Burundi",title:"flag for Burundi",dialCode:"+257"},{code:"BJ",emoji:"🇧🇯",unicode:"U+1F1E7 U+1F1EF",name:"Benin",title:"flag for Benin",dialCode:"+229"},{code:"BL",emoji:"🇧🇱",unicode:"U+1F1E7 U+1F1F1",name:"Saint Barthélemy",title:"flag for Saint Barthélemy",dialCode:"+590"},{code:"BM",emoji:"🇧🇲",unicode:"U+1F1E7 U+1F1F2",name:"Bermuda",title:"flag for Bermuda",dialCode:"+1 441"},{code:"BN",emoji:"🇧🇳",unicode:"U+1F1E7 U+1F1F3",name:"Brunei Darussalam",title:"flag for Brunei Darussalam",dialCode:"+673"},{code:"BO",emoji:"🇧🇴",unicode:"U+1F1E7 U+1F1F4",name:"Bolivia",title:"flag for Bolivia",dialCode:"+591"},{code:"BQ",emoji:"🇧🇶",unicode:"U+1F1E7 U+1F1F6",name:"Bonaire, Sint Eustatius and Saba",title:"flag for Bonaire, Sint Eustatius and Saba"},{code:"BR",emoji:"🇧🇷",unicode:"U+1F1E7 U+1F1F7",name:"Brazil",title:"flag for Brazil",dialCode:"+55"},{code:"BS",emoji:"🇧🇸",unicode:"U+1F1E7 U+1F1F8",name:"Bahamas",title:"flag for Bahamas",dialCode:"+1 242"},{code:"BT",emoji:"🇧🇹",unicode:"U+1F1E7 U+1F1F9",name:"Bhutan",title:"flag for Bhutan",dialCode:"+975"},{code:"BV",emoji:"🇧🇻",unicode:"U+1F1E7 U+1F1FB",name:"Bouvet Island",title:"flag for Bouvet Island"},{code:"BW",emoji:"🇧🇼",unicode:"U+1F1E7 U+1F1FC",name:"Botswana",title:"flag for Botswana",dialCode:"+267"},{code:"BY",emoji:"🇧🇾",unicode:"U+1F1E7 U+1F1FE",name:"Belarus",title:"flag for Belarus",dialCode:"+375"},{code:"BZ",emoji:"🇧🇿",unicode:"U+1F1E7 U+1F1FF",name:"Belize",title:"flag for Belize",dialCode:"+501"},{code:"CA",emoji:"🇨🇦",unicode:"U+1F1E8 U+1F1E6",name:"Canada",title:"flag for Canada",dialCode:"+1"},{code:"CC",emoji:"🇨🇨",unicode:"U+1F1E8 U+1F1E8",name:"Cocos (Keeling) Islands",title:"flag for Cocos (Keeling) Islands",dialCode:"+61"},{code:"CD",emoji:"🇨🇩",unicode:"U+1F1E8 U+1F1E9",name:"Congo",title:"flag for Congo",dialCode:"+243"},{code:"CF",emoji:"🇨🇫",unicode:"U+1F1E8 U+1F1EB",name:"Central African Republic",title:"flag for Central African Republic",dialCode:"+236"},{code:"CG",emoji:"🇨🇬",unicode:"U+1F1E8 U+1F1EC",name:"Congo",title:"flag for Congo",dialCode:"+242"},{code:"CH",emoji:"🇨🇭",unicode:"U+1F1E8 U+1F1ED",name:"Switzerland",title:"flag for Switzerland",dialCode:"+41"},{code:"CI",emoji:"🇨🇮",unicode:"U+1F1E8 U+1F1EE",name:"Côte D'Ivoire",title:"flag for Côte D'Ivoire",dialCode:"+225"},{code:"CK",emoji:"🇨🇰",unicode:"U+1F1E8 U+1F1F0",name:"Cook Islands",title:"flag for Cook Islands",dialCode:"+682"},{code:"CL",emoji:"🇨🇱",unicode:"U+1F1E8 U+1F1F1",name:"Chile",title:"flag for Chile",dialCode:"+56"},{code:"CM",emoji:"🇨🇲",unicode:"U+1F1E8 U+1F1F2",name:"Cameroon",title:"flag for Cameroon",dialCode:"+237"},{code:"CN",emoji:"🇨🇳",unicode:"U+1F1E8 U+1F1F3",name:"China",title:"flag for China",dialCode:"+86"},{code:"CO",emoji:"🇨🇴",unicode:"U+1F1E8 U+1F1F4",name:"Colombia",title:"flag for Colombia",dialCode:"+57"},{code:"CR",emoji:"🇨🇷",unicode:"U+1F1E8 U+1F1F7",name:"Costa Rica",title:"flag for Costa Rica",dialCode:"+506"},{code:"CU",emoji:"🇨🇺",unicode:"U+1F1E8 U+1F1FA",name:"Cuba",title:"flag for Cuba",dialCode:"+53"},{code:"CV",emoji:"🇨🇻",unicode:"U+1F1E8 U+1F1FB",name:"Cape Verde",title:"flag for Cape Verde",dialCode:"+238"},{code:"CW",emoji:"🇨🇼",unicode:"U+1F1E8 U+1F1FC",name:"Curaçao",title:"flag for Curaçao"},{code:"CX",emoji:"🇨🇽",unicode:"U+1F1E8 U+1F1FD",name:"Christmas Island",title:"flag for Christmas Island",dialCode:"+61"},{code:"CY",emoji:"🇨🇾",unicode:"U+1F1E8 U+1F1FE",name:"Cyprus",title:"flag for Cyprus",dialCode:"+537"},{code:"CZ",emoji:"🇨🇿",unicode:"U+1F1E8 U+1F1FF",name:"Czech Republic",title:"flag for Czech Republic",dialCode:"+420"},{code:"DE",emoji:"🇩🇪",unicode:"U+1F1E9 U+1F1EA",name:"Germany",title:"flag for Germany",dialCode:"+49"},{code:"DJ",emoji:"🇩🇯",unicode:"U+1F1E9 U+1F1EF",name:"Djibouti",title:"flag for Djibouti",dialCode:"+253"},{code:"DK",emoji:"🇩🇰",unicode:"U+1F1E9 U+1F1F0",name:"Denmark",title:"flag for Denmark",dialCode:"+45"},{code:"DM",emoji:"🇩🇲",unicode:"U+1F1E9 U+1F1F2",name:"Dominica",title:"flag for Dominica",dialCode:"+1 767"},{code:"DO",emoji:"🇩🇴",unicode:"U+1F1E9 U+1F1F4",name:"Dominican Republic",title:"flag for Dominican Republic",dialCode:"+1 849"},{code:"DZ",emoji:"🇩🇿",unicode:"U+1F1E9 U+1F1FF",name:"Algeria",title:"flag for Algeria",dialCode:"+213"},{code:"EC",emoji:"🇪🇨",unicode:"U+1F1EA U+1F1E8",name:"Ecuador",title:"flag for Ecuador",dialCode:"+593"},{code:"EE",emoji:"🇪🇪",unicode:"U+1F1EA U+1F1EA",name:"Estonia",title:"flag for Estonia",dialCode:"+372"},{code:"EG",emoji:"🇪🇬",unicode:"U+1F1EA U+1F1EC",name:"Egypt",title:"flag for Egypt",dialCode:"+20"},{code:"EH",emoji:"🇪🇭",unicode:"U+1F1EA U+1F1ED",name:"Western Sahara",title:"flag for Western Sahara"},{code:"ER",emoji:"🇪🇷",unicode:"U+1F1EA U+1F1F7",name:"Eritrea",title:"flag for Eritrea",dialCode:"+291"},{code:"ES",emoji:"🇪🇸",unicode:"U+1F1EA U+1F1F8",name:"Spain",title:"flag for Spain",dialCode:"+34"},{code:"ET",emoji:"🇪🇹",unicode:"U+1F1EA U+1F1F9",name:"Ethiopia",title:"flag for Ethiopia",dialCode:"+251"},{code:"EU",emoji:"🇪🇺",unicode:"U+1F1EA U+1F1FA",name:"European Union",title:"flag for European Union"},{code:"FI",emoji:"🇫🇮",unicode:"U+1F1EB U+1F1EE",name:"Finland",title:"flag for Finland",dialCode:"+358"},{code:"FJ",emoji:"🇫🇯",unicode:"U+1F1EB U+1F1EF",name:"Fiji",title:"flag for Fiji",dialCode:"+679"},{code:"FK",emoji:"🇫🇰",unicode:"U+1F1EB U+1F1F0",name:"Falkland Islands (Malvinas)",title:"flag for Falkland Islands (Malvinas)",dialCode:"+500"},{code:"FM",emoji:"🇫🇲",unicode:"U+1F1EB U+1F1F2",name:"Micronesia",title:"flag for Micronesia",dialCode:"+691"},{code:"FO",emoji:"🇫🇴",unicode:"U+1F1EB U+1F1F4",name:"Faroe Islands",title:"flag for Faroe Islands",dialCode:"+298"},{code:"FR",emoji:"🇫🇷",unicode:"U+1F1EB U+1F1F7",name:"France",title:"flag for France",dialCode:"+33"},{code:"GA",emoji:"🇬🇦",unicode:"U+1F1EC U+1F1E6",name:"Gabon",title:"flag for Gabon",dialCode:"+241"},{code:"GB",emoji:"🇬🇧",unicode:"U+1F1EC U+1F1E7",name:"United Kingdom",title:"flag for United Kingdom",dialCode:"+44"},{code:"GD",emoji:"🇬🇩",unicode:"U+1F1EC U+1F1E9",name:"Grenada",title:"flag for Grenada",dialCode:"+1 473"},{code:"GE",emoji:"🇬🇪",unicode:"U+1F1EC U+1F1EA",name:"Georgia",title:"flag for Georgia",dialCode:"+995"},{code:"GF",emoji:"🇬🇫",unicode:"U+1F1EC U+1F1EB",name:"French Guiana",title:"flag for French Guiana",dialCode:"+594"},{code:"GG",emoji:"🇬🇬",unicode:"U+1F1EC U+1F1EC",name:"Guernsey",title:"flag for Guernsey",dialCode:"+44"},{code:"GH",emoji:"🇬🇭",unicode:"U+1F1EC U+1F1ED",name:"Ghana",title:"flag for Ghana",dialCode:"+233"},{code:"GI",emoji:"🇬🇮",unicode:"U+1F1EC U+1F1EE",name:"Gibraltar",title:"flag for Gibraltar",dialCode:"+350"},{code:"GL",emoji:"🇬🇱",unicode:"U+1F1EC U+1F1F1",name:"Greenland",title:"flag for Greenland",dialCode:"+299"},{code:"GM",emoji:"🇬🇲",unicode:"U+1F1EC U+1F1F2",name:"Gambia",title:"flag for Gambia",dialCode:"+220"},{code:"GN",emoji:"🇬🇳",unicode:"U+1F1EC U+1F1F3",name:"Guinea",title:"flag for Guinea",dialCode:"+224"},{code:"GP",emoji:"🇬🇵",unicode:"U+1F1EC U+1F1F5",name:"Guadeloupe",title:"flag for Guadeloupe",dialCode:"+590"},{code:"GQ",emoji:"🇬🇶",unicode:"U+1F1EC U+1F1F6",name:"Equatorial Guinea",title:"flag for Equatorial Guinea",dialCode:"+240"},{code:"GR",emoji:"🇬🇷",unicode:"U+1F1EC U+1F1F7",name:"Greece",title:"flag for Greece",dialCode:"+30"},{code:"GS",emoji:"🇬🇸",unicode:"U+1F1EC U+1F1F8",name:"South Georgia",title:"flag for South Georgia",dialCode:"+500"},{code:"GT",emoji:"🇬🇹",unicode:"U+1F1EC U+1F1F9",name:"Guatemala",title:"flag for Guatemala",dialCode:"+502"},{code:"GU",emoji:"🇬🇺",unicode:"U+1F1EC U+1F1FA",name:"Guam",title:"flag for Guam",dialCode:"+1 671"},{code:"GW",emoji:"🇬🇼",unicode:"U+1F1EC U+1F1FC",name:"Guinea-Bissau",title:"flag for Guinea-Bissau",dialCode:"+245"},{code:"GY",emoji:"🇬🇾",unicode:"U+1F1EC U+1F1FE",name:"Guyana",title:"flag for Guyana",dialCode:"+595"},{code:"HK",emoji:"🇭🇰",unicode:"U+1F1ED U+1F1F0",name:"Hong Kong",title:"flag for Hong Kong",dialCode:"+852"},{code:"HM",emoji:"🇭🇲",unicode:"U+1F1ED U+1F1F2",name:"Heard Island and Mcdonald Islands",title:"flag for Heard Island and Mcdonald Islands"},{code:"HN",emoji:"🇭🇳",unicode:"U+1F1ED U+1F1F3",name:"Honduras",title:"flag for Honduras",dialCode:"+504"},{code:"HR",emoji:"🇭🇷",unicode:"U+1F1ED U+1F1F7",name:"Croatia",title:"flag for Croatia",dialCode:"+385"},{code:"HT",emoji:"🇭🇹",unicode:"U+1F1ED U+1F1F9",name:"Haiti",title:"flag for Haiti",dialCode:"+509"},{code:"HU",emoji:"🇭🇺",unicode:"U+1F1ED U+1F1FA",name:"Hungary",title:"flag for Hungary",dialCode:"+36"},{code:"ID",emoji:"🇮🇩",unicode:"U+1F1EE U+1F1E9",name:"Indonesia",title:"flag for Indonesia",dialCode:"+62"},{code:"IE",emoji:"🇮🇪",unicode:"U+1F1EE U+1F1EA",name:"Ireland",title:"flag for Ireland",dialCode:"+353"},{code:"IL",emoji:"🇮🇱",unicode:"U+1F1EE U+1F1F1",name:"Israel",title:"flag for Israel",dialCode:"+972"},{code:"IM",emoji:"🇮🇲",unicode:"U+1F1EE U+1F1F2",name:"Isle of Man",title:"flag for Isle of Man",dialCode:"+44"},{code:"IN",emoji:"🇮🇳",unicode:"U+1F1EE U+1F1F3",name:"India",title:"flag for India",dialCode:"+91"},{code:"IO",emoji:"🇮🇴",unicode:"U+1F1EE U+1F1F4",name:"British Indian Ocean Territory",title:"flag for British Indian Ocean Territory",dialCode:"+246"},{code:"IQ",emoji:"🇮🇶",unicode:"U+1F1EE U+1F1F6",name:"Iraq",title:"flag for Iraq",dialCode:"+964"},{code:"IR",emoji:"🇮🇷",unicode:"U+1F1EE U+1F1F7",name:"Iran",title:"flag for Iran",dialCode:"+98"},{code:"IS",emoji:"🇮🇸",unicode:"U+1F1EE U+1F1F8",name:"Iceland",title:"flag for Iceland",dialCode:"+354"},{code:"IT",emoji:"🇮🇹",unicode:"U+1F1EE U+1F1F9",name:"Italy",title:"flag for Italy",dialCode:"+39"},{code:"JE",emoji:"🇯🇪",unicode:"U+1F1EF U+1F1EA",name:"Jersey",title:"flag for Jersey",dialCode:"+44"},{code:"JM",emoji:"🇯🇲",unicode:"U+1F1EF U+1F1F2",name:"Jamaica",title:"flag for Jamaica",dialCode:"+1 876"},{code:"JO",emoji:"🇯🇴",unicode:"U+1F1EF U+1F1F4",name:"Jordan",title:"flag for Jordan",dialCode:"+962"},{code:"JP",emoji:"🇯🇵",unicode:"U+1F1EF U+1F1F5",name:"Japan",title:"flag for Japan",dialCode:"+81"},{code:"KE",emoji:"🇰🇪",unicode:"U+1F1F0 U+1F1EA",name:"Kenya",title:"flag for Kenya",dialCode:"+254"},{code:"KG",emoji:"🇰🇬",unicode:"U+1F1F0 U+1F1EC",name:"Kyrgyzstan",title:"flag for Kyrgyzstan",dialCode:"+996"},{code:"KH",emoji:"🇰🇭",unicode:"U+1F1F0 U+1F1ED",name:"Cambodia",title:"flag for Cambodia",dialCode:"+855"},{code:"KI",emoji:"🇰🇮",unicode:"U+1F1F0 U+1F1EE",name:"Kiribati",title:"flag for Kiribati",dialCode:"+686"},{code:"KM",emoji:"🇰🇲",unicode:"U+1F1F0 U+1F1F2",name:"Comoros",title:"flag for Comoros",dialCode:"+269"},{code:"KN",emoji:"🇰🇳",unicode:"U+1F1F0 U+1F1F3",name:"Saint Kitts and Nevis",title:"flag for Saint Kitts and Nevis",dialCode:"+1 869"},{code:"KP",emoji:"🇰🇵",unicode:"U+1F1F0 U+1F1F5",name:"North Korea",title:"flag for North Korea",dialCode:"+850"},{code:"KR",emoji:"🇰🇷",unicode:"U+1F1F0 U+1F1F7",name:"South Korea",title:"flag for South Korea",dialCode:"+82"},{code:"KW",emoji:"🇰🇼",unicode:"U+1F1F0 U+1F1FC",name:"Kuwait",title:"flag for Kuwait",dialCode:"+965"},{code:"KY",emoji:"🇰🇾",unicode:"U+1F1F0 U+1F1FE",name:"Cayman Islands",title:"flag for Cayman Islands",dialCode:"+ 345"},{code:"KZ",emoji:"🇰🇿",unicode:"U+1F1F0 U+1F1FF",name:"Kazakhstan",title:"flag for Kazakhstan",dialCode:"+7 7"},{code:"LA",emoji:"🇱🇦",unicode:"U+1F1F1 U+1F1E6",name:"Lao People's Democratic Republic",title:"flag for Lao People's Democratic Republic",dialCode:"+856"},{code:"LB",emoji:"🇱🇧",unicode:"U+1F1F1 U+1F1E7",name:"Lebanon",title:"flag for Lebanon",dialCode:"+961"},{code:"LC",emoji:"🇱🇨",unicode:"U+1F1F1 U+1F1E8",name:"Saint Lucia",title:"flag for Saint Lucia",dialCode:"+1 758"},{code:"LI",emoji:"🇱🇮",unicode:"U+1F1F1 U+1F1EE",name:"Liechtenstein",title:"flag for Liechtenstein",dialCode:"+423"},{code:"LK",emoji:"🇱🇰",unicode:"U+1F1F1 U+1F1F0",name:"Sri Lanka",title:"flag for Sri Lanka",dialCode:"+94"},{code:"LR",emoji:"🇱🇷",unicode:"U+1F1F1 U+1F1F7",name:"Liberia",title:"flag for Liberia",dialCode:"+231"},{code:"LS",emoji:"🇱🇸",unicode:"U+1F1F1 U+1F1F8",name:"Lesotho",title:"flag for Lesotho",dialCode:"+266"},{code:"LT",emoji:"🇱🇹",unicode:"U+1F1F1 U+1F1F9",name:"Lithuania",title:"flag for Lithuania",dialCode:"+370"},{code:"LU",emoji:"🇱🇺",unicode:"U+1F1F1 U+1F1FA",name:"Luxembourg",title:"flag for Luxembourg",dialCode:"+352"},{code:"LV",emoji:"🇱🇻",unicode:"U+1F1F1 U+1F1FB",name:"Latvia",title:"flag for Latvia",dialCode:"+371"},{code:"LY",emoji:"🇱🇾",unicode:"U+1F1F1 U+1F1FE",name:"Libya",title:"flag for Libya",dialCode:"+218"},{code:"MA",emoji:"🇲🇦",unicode:"U+1F1F2 U+1F1E6",name:"Morocco",title:"flag for Morocco",dialCode:"+212"},{code:"MC",emoji:"🇲🇨",unicode:"U+1F1F2 U+1F1E8",name:"Monaco",title:"flag for Monaco",dialCode:"+377"},{code:"MD",emoji:"🇲🇩",unicode:"U+1F1F2 U+1F1E9",name:"Moldova",title:"flag for Moldova",dialCode:"+373"},{code:"ME",emoji:"🇲🇪",unicode:"U+1F1F2 U+1F1EA",name:"Montenegro",title:"flag for Montenegro",dialCode:"+382"},{code:"MF",emoji:"🇲🇫",unicode:"U+1F1F2 U+1F1EB",name:"Saint Martin (French Part)",title:"flag for Saint Martin (French Part)",dialCode:"+590"},{code:"MG",emoji:"🇲🇬",unicode:"U+1F1F2 U+1F1EC",name:"Madagascar",title:"flag for Madagascar",dialCode:"+261"},{code:"MH",emoji:"🇲🇭",unicode:"U+1F1F2 U+1F1ED",name:"Marshall Islands",title:"flag for Marshall Islands",dialCode:"+692"},{code:"MK",emoji:"🇲🇰",unicode:"U+1F1F2 U+1F1F0",name:"Macedonia",title:"flag for Macedonia",dialCode:"+389"},{code:"ML",emoji:"🇲🇱",unicode:"U+1F1F2 U+1F1F1",name:"Mali",title:"flag for Mali",dialCode:"+223"},{code:"MM",emoji:"🇲🇲",unicode:"U+1F1F2 U+1F1F2",name:"Myanmar",title:"flag for Myanmar",dialCode:"+95"},{code:"MN",emoji:"🇲🇳",unicode:"U+1F1F2 U+1F1F3",name:"Mongolia",title:"flag for Mongolia",dialCode:"+976"},{code:"MO",emoji:"🇲🇴",unicode:"U+1F1F2 U+1F1F4",name:"Macao",title:"flag for Macao",dialCode:"+853"},{code:"MP",emoji:"🇲🇵",unicode:"U+1F1F2 U+1F1F5",name:"Northern Mariana Islands",title:"flag for Northern Mariana Islands",dialCode:"+1 670"},{code:"MQ",emoji:"🇲🇶",unicode:"U+1F1F2 U+1F1F6",name:"Martinique",title:"flag for Martinique",dialCode:"+596"},{code:"MR",emoji:"🇲🇷",unicode:"U+1F1F2 U+1F1F7",name:"Mauritania",title:"flag for Mauritania",dialCode:"+222"},{code:"MS",emoji:"🇲🇸",unicode:"U+1F1F2 U+1F1F8",name:"Montserrat",title:"flag for Montserrat",dialCode:"+1664"},{code:"MT",emoji:"🇲🇹",unicode:"U+1F1F2 U+1F1F9",name:"Malta",title:"flag for Malta",dialCode:"+356"},{code:"MU",emoji:"🇲🇺",unicode:"U+1F1F2 U+1F1FA",name:"Mauritius",title:"flag for Mauritius",dialCode:"+230"},{code:"MV",emoji:"🇲🇻",unicode:"U+1F1F2 U+1F1FB",name:"Maldives",title:"flag for Maldives",dialCode:"+960"},{code:"MW",emoji:"🇲🇼",unicode:"U+1F1F2 U+1F1FC",name:"Malawi",title:"flag for Malawi",dialCode:"+265"},{code:"MX",emoji:"🇲🇽",unicode:"U+1F1F2 U+1F1FD",name:"Mexico",title:"flag for Mexico",dialCode:"+52"},{code:"MY",emoji:"🇲🇾",unicode:"U+1F1F2 U+1F1FE",name:"Malaysia",title:"flag for Malaysia",dialCode:"+60"},{code:"MZ",emoji:"🇲🇿",unicode:"U+1F1F2 U+1F1FF",name:"Mozambique",title:"flag for Mozambique",dialCode:"+258"},{code:"NA",emoji:"🇳🇦",unicode:"U+1F1F3 U+1F1E6",name:"Namibia",title:"flag for Namibia",dialCode:"+264"},{code:"NC",emoji:"🇳🇨",unicode:"U+1F1F3 U+1F1E8",name:"New Caledonia",title:"flag for New Caledonia",dialCode:"+687"},{code:"NE",emoji:"🇳🇪",unicode:"U+1F1F3 U+1F1EA",name:"Niger",title:"flag for Niger",dialCode:"+227"},{code:"NF",emoji:"🇳🇫",unicode:"U+1F1F3 U+1F1EB",name:"Norfolk Island",title:"flag for Norfolk Island",dialCode:"+672"},{code:"NG",emoji:"🇳🇬",unicode:"U+1F1F3 U+1F1EC",name:"Nigeria",title:"flag for Nigeria",dialCode:"+234"},{code:"NI",emoji:"🇳🇮",unicode:"U+1F1F3 U+1F1EE",name:"Nicaragua",title:"flag for Nicaragua",dialCode:"+505"},{code:"NL",emoji:"🇳🇱",unicode:"U+1F1F3 U+1F1F1",name:"Netherlands",title:"flag for Netherlands",dialCode:"+31"},{code:"NO",emoji:"🇳🇴",unicode:"U+1F1F3 U+1F1F4",name:"Norway",title:"flag for Norway",dialCode:"+47"},{code:"NP",emoji:"🇳🇵",unicode:"U+1F1F3 U+1F1F5",name:"Nepal",title:"flag for Nepal",dialCode:"+977"},{code:"NR",emoji:"🇳🇷",unicode:"U+1F1F3 U+1F1F7",name:"Nauru",title:"flag for Nauru",dialCode:"+674"},{code:"NU",emoji:"🇳🇺",unicode:"U+1F1F3 U+1F1FA",name:"Niue",title:"flag for Niue",dialCode:"+683"},{code:"NZ",emoji:"🇳🇿",unicode:"U+1F1F3 U+1F1FF",name:"New Zealand",title:"flag for New Zealand",dialCode:"+64"},{code:"OM",emoji:"🇴🇲",unicode:"U+1F1F4 U+1F1F2",name:"Oman",title:"flag for Oman",dialCode:"+968"},{code:"PA",emoji:"🇵🇦",unicode:"U+1F1F5 U+1F1E6",name:"Panama",title:"flag for Panama",dialCode:"+507"},{code:"PE",emoji:"🇵🇪",unicode:"U+1F1F5 U+1F1EA",name:"Peru",title:"flag for Peru",dialCode:"+51"},{code:"PF",emoji:"🇵🇫",unicode:"U+1F1F5 U+1F1EB",name:"French Polynesia",title:"flag for French Polynesia",dialCode:"+689"},{code:"PG",emoji:"🇵🇬",unicode:"U+1F1F5 U+1F1EC",name:"Papua New Guinea",title:"flag for Papua New Guinea",dialCode:"+675"},{code:"PH",emoji:"🇵🇭",unicode:"U+1F1F5 U+1F1ED",name:"Philippines",title:"flag for Philippines",dialCode:"+63"},{code:"PK",emoji:"🇵🇰",unicode:"U+1F1F5 U+1F1F0",name:"Pakistan",title:"flag for Pakistan",dialCode:"+92"},{code:"PL",emoji:"🇵🇱",unicode:"U+1F1F5 U+1F1F1",name:"Poland",title:"flag for Poland",dialCode:"+48"},{code:"PM",emoji:"🇵🇲",unicode:"U+1F1F5 U+1F1F2",name:"Saint Pierre and Miquelon",title:"flag for Saint Pierre and Miquelon",dialCode:"+508"},{code:"PN",emoji:"🇵🇳",unicode:"U+1F1F5 U+1F1F3",name:"Pitcairn",title:"flag for Pitcairn",dialCode:"+872"},{code:"PR",emoji:"🇵🇷",unicode:"U+1F1F5 U+1F1F7",name:"Puerto Rico",title:"flag for Puerto Rico",dialCode:"+1 939"},{code:"PS",emoji:"🇵🇸",unicode:"U+1F1F5 U+1F1F8",name:"Palestinian Territory",title:"flag for Palestinian Territory",dialCode:"+970"},{code:"PT",emoji:"🇵🇹",unicode:"U+1F1F5 U+1F1F9",name:"Portugal",title:"flag for Portugal",dialCode:"+351"},{code:"PW",emoji:"🇵🇼",unicode:"U+1F1F5 U+1F1FC",name:"Palau",title:"flag for Palau",dialCode:"+680"},{code:"PY",emoji:"🇵🇾",unicode:"U+1F1F5 U+1F1FE",name:"Paraguay",title:"flag for Paraguay",dialCode:"+595"},{code:"QA",emoji:"🇶🇦",unicode:"U+1F1F6 U+1F1E6",name:"Qatar",title:"flag for Qatar",dialCode:"+974"},{code:"RE",emoji:"🇷🇪",unicode:"U+1F1F7 U+1F1EA",name:"Réunion",title:"flag for Réunion",dialCode:"+262"},{code:"RO",emoji:"🇷🇴",unicode:"U+1F1F7 U+1F1F4",name:"Romania",title:"flag for Romania",dialCode:"+40"},{code:"RS",emoji:"🇷🇸",unicode:"U+1F1F7 U+1F1F8",name:"Serbia",title:"flag for Serbia",dialCode:"+381"},{code:"RU",emoji:"🇷🇺",unicode:"U+1F1F7 U+1F1FA",name:"Russia",title:"flag for Russia",dialCode:"+7"},{code:"RW",emoji:"🇷🇼",unicode:"U+1F1F7 U+1F1FC",name:"Rwanda",title:"flag for Rwanda",dialCode:"+250"},{code:"SA",emoji:"🇸🇦",unicode:"U+1F1F8 U+1F1E6",name:"Saudi Arabia",title:"flag for Saudi Arabia",dialCode:"+966"},{code:"SB",emoji:"🇸🇧",unicode:"U+1F1F8 U+1F1E7",name:"Solomon Islands",title:"flag for Solomon Islands",dialCode:"+677"},{code:"SC",emoji:"🇸🇨",unicode:"U+1F1F8 U+1F1E8",name:"Seychelles",title:"flag for Seychelles",dialCode:"+248"},{code:"SD",emoji:"🇸🇩",unicode:"U+1F1F8 U+1F1E9",name:"Sudan",title:"flag for Sudan",dialCode:"+249"},{code:"SE",emoji:"🇸🇪",unicode:"U+1F1F8 U+1F1EA",name:"Sweden",title:"flag for Sweden",dialCode:"+46"},{code:"SG",emoji:"🇸🇬",unicode:"U+1F1F8 U+1F1EC",name:"Singapore",title:"flag for Singapore",dialCode:"+65"},{code:"SH",emoji:"🇸🇭",unicode:"U+1F1F8 U+1F1ED",name:"Saint Helena, Ascension and Tristan Da Cunha",title:"flag for Saint Helena, Ascension and Tristan Da Cunha",dialCode:"+290"},{code:"SI",emoji:"🇸🇮",unicode:"U+1F1F8 U+1F1EE",name:"Slovenia",title:"flag for Slovenia",dialCode:"+386"},{code:"SJ",emoji:"🇸🇯",unicode:"U+1F1F8 U+1F1EF",name:"Svalbard and Jan Mayen",title:"flag for Svalbard and Jan Mayen",dialCode:"+47"},{code:"SK",emoji:"🇸🇰",unicode:"U+1F1F8 U+1F1F0",name:"Slovakia",title:"flag for Slovakia",dialCode:"+421"},{code:"SL",emoji:"🇸🇱",unicode:"U+1F1F8 U+1F1F1",name:"Sierra Leone",title:"flag for Sierra Leone",dialCode:"+232"},{code:"SM",emoji:"🇸🇲",unicode:"U+1F1F8 U+1F1F2",name:"San Marino",title:"flag for San Marino",dialCode:"+378"},{code:"SN",emoji:"🇸🇳",unicode:"U+1F1F8 U+1F1F3",name:"Senegal",title:"flag for Senegal",dialCode:"+221"},{code:"SO",emoji:"🇸🇴",unicode:"U+1F1F8 U+1F1F4",name:"Somalia",title:"flag for Somalia",dialCode:"+252"},{code:"SR",emoji:"🇸🇷",unicode:"U+1F1F8 U+1F1F7",name:"Suriname",title:"flag for Suriname",dialCode:"+597"},{code:"SS",emoji:"🇸🇸",unicode:"U+1F1F8 U+1F1F8",name:"South Sudan",title:"flag for South Sudan"},{code:"ST",emoji:"🇸🇹",unicode:"U+1F1F8 U+1F1F9",name:"Sao Tome and Principe",title:"flag for Sao Tome and Principe",dialCode:"+239"},{code:"SV",emoji:"🇸🇻",unicode:"U+1F1F8 U+1F1FB",name:"El Salvador",title:"flag for El Salvador",dialCode:"+503"},{code:"SX",emoji:"🇸🇽",unicode:"U+1F1F8 U+1F1FD",name:"Sint Maarten (Dutch Part)",title:"flag for Sint Maarten (Dutch Part)"},{code:"SY",emoji:"🇸🇾",unicode:"U+1F1F8 U+1F1FE",name:"Syrian Arab Republic",title:"flag for Syrian Arab Republic",dialCode:"+963"},{code:"SZ",emoji:"🇸🇿",unicode:"U+1F1F8 U+1F1FF",name:"Swaziland",title:"flag for Swaziland",dialCode:"+268"},{code:"TC",emoji:"🇹🇨",unicode:"U+1F1F9 U+1F1E8",name:"Turks and Caicos Islands",title:"flag for Turks and Caicos Islands",dialCode:"+1 649"},{code:"TD",emoji:"🇹🇩",unicode:"U+1F1F9 U+1F1E9",name:"Chad",title:"flag for Chad",dialCode:"+235"},{code:"TF",emoji:"🇹🇫",unicode:"U+1F1F9 U+1F1EB",name:"French Southern Territories",title:"flag for French Southern Territories"},{code:"TG",emoji:"🇹🇬",unicode:"U+1F1F9 U+1F1EC",name:"Togo",title:"flag for Togo",dialCode:"+228"},{code:"TH",emoji:"🇹🇭",unicode:"U+1F1F9 U+1F1ED",name:"Thailand",title:"flag for Thailand",dialCode:"+66"},{code:"TJ",emoji:"🇹🇯",unicode:"U+1F1F9 U+1F1EF",name:"Tajikistan",title:"flag for Tajikistan",dialCode:"+992"},{code:"TK",emoji:"🇹🇰",unicode:"U+1F1F9 U+1F1F0",name:"Tokelau",title:"flag for Tokelau",dialCode:"+690"},{code:"TL",emoji:"🇹🇱",unicode:"U+1F1F9 U+1F1F1",name:"Timor-Leste",title:"flag for Timor-Leste",dialCode:"+670"},{code:"TM",emoji:"🇹🇲",unicode:"U+1F1F9 U+1F1F2",name:"Turkmenistan",title:"flag for Turkmenistan",dialCode:"+993"},{code:"TN",emoji:"🇹🇳",unicode:"U+1F1F9 U+1F1F3",name:"Tunisia",title:"flag for Tunisia",dialCode:"+216"},{code:"TO",emoji:"🇹🇴",unicode:"U+1F1F9 U+1F1F4",name:"Tonga",title:"flag for Tonga",dialCode:"+676"},{code:"TR",emoji:"🇹🇷",unicode:"U+1F1F9 U+1F1F7",name:"Turkey",title:"flag for Turkey",dialCode:"+90"},{code:"TT",emoji:"🇹🇹",unicode:"U+1F1F9 U+1F1F9",name:"Trinidad and Tobago",title:"flag for Trinidad and Tobago",dialCode:"+1 868"},{code:"TV",emoji:"🇹🇻",unicode:"U+1F1F9 U+1F1FB",name:"Tuvalu",title:"flag for Tuvalu",dialCode:"+688"},{code:"TW",emoji:"🇹🇼",unicode:"U+1F1F9 U+1F1FC",name:"Taiwan",title:"flag for Taiwan",dialCode:"+886"},{code:"TZ",emoji:"🇹🇿",unicode:"U+1F1F9 U+1F1FF",name:"Tanzania",title:"flag for Tanzania",dialCode:"+255"},{code:"UA",emoji:"🇺🇦",unicode:"U+1F1FA U+1F1E6",name:"Ukraine",title:"flag for Ukraine",dialCode:"+380"},{code:"UG",emoji:"🇺🇬",unicode:"U+1F1FA U+1F1EC",name:"Uganda",title:"flag for Uganda",dialCode:"+256"},{code:"UM",emoji:"🇺🇲",unicode:"U+1F1FA U+1F1F2",name:"United States Minor Outlying Islands",title:"flag for United States Minor Outlying Islands"},{code:"US",emoji:"🇺🇸",unicode:"U+1F1FA U+1F1F8",name:"United States",title:"flag for United States",dialCode:"+1"},{code:"UY",emoji:"🇺🇾",unicode:"U+1F1FA U+1F1FE",name:"Uruguay",title:"flag for Uruguay",dialCode:"+598"},{code:"UZ",emoji:"🇺🇿",unicode:"U+1F1FA U+1F1FF",name:"Uzbekistan",title:"flag for Uzbekistan",dialCode:"+998"},{code:"VA",emoji:"🇻🇦",unicode:"U+1F1FB U+1F1E6",name:"Vatican City",title:"flag for Vatican City",dialCode:"+379"},{code:"VC",emoji:"🇻🇨",unicode:"U+1F1FB U+1F1E8",name:"Saint Vincent and The Grenadines",title:"flag for Saint Vincent and The Grenadines",dialCode:"+1 784"},{code:"VE",emoji:"🇻🇪",unicode:"U+1F1FB U+1F1EA",name:"Venezuela",title:"flag for Venezuela",dialCode:"+58"},{code:"VG",emoji:"🇻🇬",unicode:"U+1F1FB U+1F1EC",name:"Virgin Islands, British",title:"flag for Virgin Islands, British",dialCode:"+1 284"},{code:"VI",emoji:"🇻🇮",unicode:"U+1F1FB U+1F1EE",name:"Virgin Islands, U.S.",title:"flag for Virgin Islands, U.S.",dialCode:"+1 340"},{code:"VN",emoji:"🇻🇳",unicode:"U+1F1FB U+1F1F3",name:"Viet Nam",title:"flag for Viet Nam",dialCode:"+84"},{code:"VU",emoji:"🇻🇺",unicode:"U+1F1FB U+1F1FA",name:"Vanuatu",title:"flag for Vanuatu",dialCode:"+678"},{code:"WF",emoji:"🇼🇫",unicode:"U+1F1FC U+1F1EB",name:"Wallis and Futuna",title:"flag for Wallis and Futuna",dialCode:"+681"},{code:"WS",emoji:"🇼🇸",unicode:"U+1F1FC U+1F1F8",name:"Samoa",title:"flag for Samoa",dialCode:"+685"},{code:"XK",emoji:"🇽🇰",unicode:"U+1F1FD U+1F1F0",name:"Kosovo",title:"flag for Kosovo",dialCode:"+383"},{code:"YE",emoji:"🇾🇪",unicode:"U+1F1FE U+1F1EA",name:"Yemen",title:"flag for Yemen",dialCode:"+967"},{code:"YT",emoji:"🇾🇹",unicode:"U+1F1FE U+1F1F9",name:"Mayotte",title:"flag for Mayotte",dialCode:"+262"},{code:"ZA",emoji:"🇿🇦",unicode:"U+1F1FF U+1F1E6",name:"South Africa",title:"flag for South Africa",dialCode:"+27"},{code:"ZM",emoji:"🇿🇲",unicode:"U+1F1FF U+1F1F2",name:"Zambia",title:"flag for Zambia",dialCode:"+260"},{code:"ZW",emoji:"🇿🇼",unicode:"U+1F1FF U+1F1FC",name:"Zimbabwe",title:"flag for Zimbabwe",dialCode:"+263"}];class i{container;apiKey;inputElement;inputClearButton;autocompleteItemsElement=null;focusedItemIndex;currentItems;currentPromiseReject;currentPlaceDetailsPromiseReject;currentTimeout;changeCallbacks=[];suggestionsChangeCallbacks=[];inputCallbacks=[];openCallbacks=[];closeCallbacks=[];preprocessHook;postprocessHook;suggestionsFilter;geocoderUrl="https://api.geoapify.com/v1/geocode/autocomplete";placeDetailsUrl="https://api.geoapify.com/v2/place-details";options={limit:5,debounceDelay:100};BY_COUNTRYCODE="countrycode";BY_RECT="rect";BY_CIRCLE="circle";BY_PROXIMITY="proximity";BY_PLACE="place";constructor(e,i,o){this.container=e,this.apiKey=i,this.options=o?{...this.options,...o}:this.options,this.options.filter=this.options.filter||{},this.options.bias=this.options.bias||{},this.options.countryCodes&&this.addFilterByCountry(this.options.countryCodes),this.options.position&&this.addBiasByProximity(this.options.position),this.inputElement=document.createElement("input"),this.inputElement.classList.add("geoapify-autocomplete-input"),this.inputElement.setAttribute("type","text"),this.inputElement.setAttribute("placeholder",this.options.placeholder||"Enter an address here"),this.container.appendChild(this.inputElement),this.inputClearButton=document.createElement("div"),this.inputClearButton.classList.add("geoapify-close-button"),this.addIcon(this.inputClearButton,"close"),this.inputClearButton.addEventListener("click",this.clearFieldAndNotify.bind(this),!1),this.container.appendChild(this.inputClearButton),this.inputElement.addEventListener("input",this.onUserInput.bind(this),!1),this.inputElement.addEventListener("keydown",this.onUserKeyPress.bind(this),!1),document.addEventListener("click",(e=>{e.target!==this.inputElement?this.closeDropDownList():this.autocompleteItemsElement||this.openDropdownAgain()}))}setType(e){this.options.type=e}setLang(e){this.options.lang=e}setCountryCodes(e){console.warn("WARNING! Obsolete function called. Function setCountryCodes() has been deprecated, please use the new addFilterByCountry() function instead!"),this.options.countryCodes=e}setPosition(e){console.warn("WARNING! Obsolete function called. Function setPosition() has been deprecated, please use the new addBiasByProximity() function instead!"),this.options.position=e}setLimit(e){this.options.limit=e}setValue(e){e?this.inputClearButton.classList.add("visible"):this.inputClearButton.classList.remove("visible"),this.inputElement.value=e}getValue(){return this.inputElement.value}addFilterByCountry(e){this.options.filter[this.BY_COUNTRYCODE]=e}addFilterByCircle(e){this.options.filter[this.BY_CIRCLE]=e}addFilterByRect(e){this.options.filter[this.BY_RECT]=e}addFilterByPlace(e){this.options.filter[this.BY_PLACE]=e}clearFilters(){this.options.filter={}}addBiasByCountry(e){this.options.bias[this.BY_COUNTRYCODE]=e}addBiasByCircle(e){this.options.bias[this.BY_CIRCLE]=e}addBiasByRect(e){this.options.bias[this.BY_RECT]=e}addBiasByProximity(e){this.options.bias[this.BY_PROXIMITY]=e}clearBias(){this.options.bias={}}on(e,i){"select"===e&&this.changeCallbacks.indexOf(i)<0&&this.changeCallbacks.push(i),"suggestions"===e&&this.suggestionsChangeCallbacks.indexOf(i)<0&&this.suggestionsChangeCallbacks.push(i),"input"===e&&this.inputCallbacks.indexOf(i)<0&&this.inputCallbacks.push(i),"close"===e&&this.closeCallbacks.indexOf(i)<0&&this.closeCallbacks.push(i),"open"===e&&this.openCallbacks.indexOf(i)<0&&this.openCallbacks.push(i)}off(e,i){"select"===e&&this.changeCallbacks.indexOf(i)>=0?this.changeCallbacks.splice(this.changeCallbacks.indexOf(i),1):"select"!==e||i||(this.changeCallbacks=[]),"suggestions"===e&&this.suggestionsChangeCallbacks.indexOf(i)>=0?this.suggestionsChangeCallbacks.splice(this.suggestionsChangeCallbacks.indexOf(i),1):"suggestions"!==e||i||(this.suggestionsChangeCallbacks=[]),"input"===e&&this.inputCallbacks.indexOf(i)>=0?this.inputCallbacks.splice(this.inputCallbacks.indexOf(i),1):"input"!==e||i||(this.inputCallbacks=[]),"close"===e&&this.closeCallbacks.indexOf(i)>=0?this.closeCallbacks.splice(this.closeCallbacks.indexOf(i),1):"close"!==e||i||(this.closeCallbacks=[]),"open"===e&&this.openCallbacks.indexOf(i)>=0?this.openCallbacks.splice(this.openCallbacks.indexOf(i),1):"open"!==e||i||(this.openCallbacks=[])}once(e,i){this.on(e,i);const o=this,a=()=>{o.off(e,i),o.off(e,a)};this.on(e,a)}setSuggestionsFilter(e){this.suggestionsFilter=e}setPreprocessHook(e){this.preprocessHook=e}setPostprocessHook(e){this.postprocessHook=e}isOpen(){return!!this.autocompleteItemsElement}close(){this.closeDropDownList()}open(){this.isOpen()||this.openDropdownAgain()}onUserInput(e){let i=this.inputElement.value,o=this.inputElement.value;if(this.inputCallbacks.forEach((e=>e(i))),this.closeDropDownList(),this.focusedItemIndex=-1,this.currentPromiseReject&&(this.currentPromiseReject({canceled:!0}),this.currentPromiseReject=null),this.currentTimeout&&(window.clearTimeout(this.currentTimeout),this.currentTimeout=null),!i)return this.inputClearButton.classList.remove("visible"),!1;this.inputClearButton.classList.add("visible"),this.currentTimeout=window.setTimeout((()=>{new Promise(((e,o)=>{this.currentPromiseReject=o,this.preprocessHook&&"function"==typeof this.preprocessHook&&(i=this.preprocessHook(i));let a=this.generateUrl(i);fetch(a).then((i=>{i.ok?i.json().then((i=>e(i))):i.json().then((e=>o(e)))}))})).then((i=>{i.features&&i.features.length&&i?.query?.parsed&&(this.options.allowNonVerifiedHouseNumber||this.options.allowNonVerifiedStreet)&&this.extendByNonVerifiedValues(i.features,i?.query?.parsed),this.currentItems=i.features,this.currentItems&&this.currentItems.length&&this.suggestionsFilter&&"function"==typeof this.suggestionsFilter&&(this.currentItems=this.suggestionsFilter(this.currentItems)),this.notifySuggestions(this.currentItems),this.currentItems.length&&(this.autocompleteItemsElement=document.createElement("div"),this.autocompleteItemsElement.setAttribute("class","geoapify-autocomplete-items"),this.notifyOpened(),this.container.appendChild(this.autocompleteItemsElement),this.currentItems.forEach(((i,a)=>{const t=document.createElement("div");if(t.classList.add("geoapify-autocomplete-item"),!this.options.skipIcons){const e=document.createElement("span");e.classList.add("icon"),this.addFeatureIcon(e,i.properties.result_type,i.properties.country_code),t.appendChild(e)}const n=document.createElement("span");if(n.classList.add("address"),this.postprocessHook&&"function"==typeof this.postprocessHook){const e=this.postprocessHook(i);n.innerHTML=this.getStyledAddressSingleValue(e,o)}else n.innerHTML=this.getStyledAddress(i.properties,o);t.appendChild(n),t.addEventListener("click",(i=>{e.stopPropagation(),this.setValueAndNotify(this.currentItems[a])})),this.autocompleteItemsElement.appendChild(t)})))}),(e=>{e.canceled||console.log(e)}))}),this.options.debounceDelay)}addHouseNumberToFormatted(e,i,o){const a={"{{{road}}} {{{house_number}}}":["af","ai","al","ao","ar","at","aw","ax","ba","be","bg","bi","bo","bq","br","bs","bt","bv","bw","cf","ch","cl","cm","co","cr","cu","cv","cw","cy","cz","de","dk","do","ec","ee","eh","er","et","fi","fo","gd","ge","gl","gq","gr","gt","gw","hn","hr","ht","hu","id","il","ir","is","jo","ki","km","kp","kw","lc","li","lr","lt","lv","ly","me","mk","ml","mn","mo","mx","ni","nl","no","np","pa","pe","pl","ps","pt","pw","py","qa","ro","rs","ru","sb","sd","se","si","sj","sk","so","sr","ss","st","sv","sx","sz","td","tj","tl","tr","um","uz","uy","vc","ve","vu","ws"],"{{{house_number}}} {{{road}}}":["ad","ae","ag","am","as","au","az","bb","bd","bf","bh","bl","bm","bz","ca","cc","ci","ck","cn","cx","dj","dm","dz","eg","fj","fk","fm","fr","ga","gb","gf","gg","gh","gi","gm","gn","gp","gs","gu","gy","hk","hm","ie","im","io","iq","je","jm","jp","ke","kh","kn","kr","ky","lb","lk","ls","lu","ma","mc","mf","mh","mg","mm","mp","ms","mt","mq","mv","mw","my","na","nc","ne","nf","ng","nr","nu","nz","om","pf","pg","ph","pk","pm","pr","re","rw","sa","sc","sg","sh","sl","sn","tc","tf","th","tk","tn","to","tt","tv","tw","tz","ug","us","vg","vi","wf","yt","za","zm","zw"],"{{{road}}}, {{{house_number}}}":["by","es","it","kg","kz","md","mz","sm","sy","ua","va"],"{{{house_number}}}, {{{road}}}":["bj","bn","cd","cg","in","la","mr","mu","tg","tm","vn","ye"]},t=Object.keys(a).find((i=>a[i].indexOf(e.country_code)>=0))||"{{{road}}} {{{house_number}}}";if(i){e.street=i.replace(/(^\w|\s\w|[-]\w)/g,(e=>e.toUpperCase())),e.housenumber=o;const a=t.replace("{{{road}}}",e.street).replace("{{{house_number}}}",o);e.address_line1=a,e.address_line2=e.formatted,e.formatted=a+", "+e.formatted}else{e.housenumber=o;const i=t.replace("{{{road}}}",e.street).replace("{{{house_number}}}",o);e.address_line1=e.address_line1.replace(e.street,i),e.formatted=e.formatted.replace(e.street,i)}}extendByNonVerifiedValues(e,i){e.forEach((e=>{i.housenumber&&this.options.allowNonVerifiedHouseNumber&&"match_by_street"===e.properties.rank.match_type?(this.addHouseNumberToFormatted(e.properties,null,i.housenumber),e.properties.nonVerifiedParts=["housenumber"]):i.street&&i.housenumber&&this.options.allowNonVerifiedStreet&&("match_by_city_or_disrict"===e.properties.rank.match_type||"match_by_postcode"===e.properties.rank.match_type)?(this.addHouseNumberToFormatted(e.properties,i.street,i.housenumber),e.properties.nonVerifiedParts=["housenumber","street"]):i.street&&this.options.allowNonVerifiedStreet&&("match_by_city_or_disrict"===e.properties.rank.match_type||"match_by_postcode"===e.properties.rank.match_type)&&(e.properties.street=i.street.replace(/(^\w|\s\w|[-]\w)/g,(e=>e.toUpperCase())),e.properties.address_line1=e.properties.street,e.properties.address_line2=e.properties.formatted,e.properties.formatted=e.properties.street+", "+e.properties.formatted,e.properties.nonVerifiedParts=["street"])}))}getStyledAddressSingleValue(e,i){let o=e;const a=(o||"").toLowerCase().indexOf(i.toLowerCase());return a>=0&&(o=o.substring(0,a)+`<strong>${o.substring(a,a+i.length)}</strong>`+o.substring(a+i.length)),`<span class="main-part">${o}</span>`}getStyledAddress(e,i){let o,a;const t=e.formatted.split(",").map((e=>e.trim()));if(e.name)o=t[0],a=t.slice(1).join(", ");else{const e=Math.min(2,Math.max(t.length-2,1));o=t.slice(0,e).join(", "),a=t.slice(e).join(", ")}if(e.nonVerifiedParts&&e.nonVerifiedParts.length)e.nonVerifiedParts.forEach((i=>{o=o.replace(e[i],`<span class="non-verified">${e[i]}</span>`)}));else{const e=o.toLowerCase().indexOf(i.toLowerCase());e>=0&&(o=o.substring(0,e)+`<strong>${o.substring(e,e+i.length)}</strong>`+o.substring(e+i.length))}return`<span class="main-part">${o}</span><span class="secondary-part">${a}</span>`}onUserKeyPress(e){if(this.autocompleteItemsElement){const i=this.autocompleteItemsElement.getElementsByTagName("div");"ArrowDown"===e.code?(e.preventDefault(),this.focusedItemIndex++,this.focusedItemIndex>=i.length&&(this.focusedItemIndex=0),this.setActive(i,this.focusedItemIndex)):"ArrowUp"===e.code?(e.preventDefault(),this.focusedItemIndex--,this.focusedItemIndex<0&&(this.focusedItemIndex=i.length-1),this.setActive(i,this.focusedItemIndex)):"Enter"===e.code?(e.preventDefault(),this.focusedItemIndex>-1&&(this.options.skipSelectionOnArrowKey?this.setValueAndNotify(this.currentItems[this.focusedItemIndex]):this.closeDropDownList())):"Escape"===e.code&&this.closeDropDownList()}else"ArrowDown"==e.code&&this.openDropdownAgain()}setActive(e,i){if(!e||!e.length)return!1;for(var o=0;o<e.length;o++)e[o].classList.remove("active");e[i].classList.add("active"),this.options.skipSelectionOnArrowKey||(this.inputElement.value=this.postprocessHook&&"function"==typeof this.postprocessHook?this.postprocessHook(this.currentItems[i]):this.currentItems[i].properties.formatted,this.notifyValueSelected(this.currentItems[i]))}setValueAndNotify(e){this.inputElement.value=this.postprocessHook&&"function"==typeof this.postprocessHook?this.postprocessHook(e):e.properties.formatted,this.notifyValueSelected(e),this.closeDropDownList()}clearFieldAndNotify(e){e.stopPropagation(),this.inputElement.value="",this.inputClearButton.classList.remove("visible"),this.currentPromiseReject&&(this.currentPromiseReject({canceled:!0}),this.currentPromiseReject=null),this.currentTimeout&&(window.clearTimeout(this.currentTimeout),this.currentTimeout=null),this.closeDropDownList(),this.notifyValueSelected(null)}closeDropDownList(){this.autocompleteItemsElement&&(this.container.removeChild(this.autocompleteItemsElement),this.autocompleteItemsElement=null,this.notifyClosed())}addIcon(e,i){const o={close:{path:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z",viewbox:"0 0 24 24"},"map-marker":{path:"M172.268 501.67C26.97 291.031 0 269.413 0 192 0 85.961 85.961 0 192 0s192 85.961 192 192c0 77.413-26.97 99.031-172.268 309.67-9.535 13.774-29.93 13.773-39.464 0zM192 272c44.183 0 80-35.817 80-80s-35.817-80-80-80-80 35.817-80 80 35.817 80 80 80z",viewbox:"0 0 384 512"},road:{path:"M573.19 402.67l-139.79-320C428.43 71.29 417.6 64 405.68 64h-97.59l2.45 23.16c.5 4.72-3.21 8.84-7.96 8.84h-29.16c-4.75 0-8.46-4.12-7.96-8.84L267.91 64h-97.59c-11.93 0-22.76 7.29-27.73 18.67L2.8 402.67C-6.45 423.86 8.31 448 30.54 448h196.84l10.31-97.68c.86-8.14 7.72-14.32 15.91-14.32h68.8c8.19 0 15.05 6.18 15.91 14.32L348.62 448h196.84c22.23 0 36.99-24.14 27.73-45.33zM260.4 135.16a8 8 0 0 1 7.96-7.16h39.29c4.09 0 7.53 3.09 7.96 7.16l4.6 43.58c.75 7.09-4.81 13.26-11.93 13.26h-40.54c-7.13 0-12.68-6.17-11.93-13.26l4.59-43.58zM315.64 304h-55.29c-9.5 0-16.91-8.23-15.91-17.68l5.07-48c.86-8.14 7.72-14.32 15.91-14.32h45.15c8.19 0 15.05 6.18 15.91 14.32l5.07 48c1 9.45-6.41 17.68-15.91 17.68z",viewbox:"0 0 576 512"},city:{path:"M616 192H480V24c0-13.26-10.74-24-24-24H312c-13.26 0-24 10.74-24 24v72h-64V16c0-8.84-7.16-16-16-16h-16c-8.84 0-16 7.16-16 16v80h-64V16c0-8.84-7.16-16-16-16H80c-8.84 0-16 7.16-16 16v80H24c-13.26 0-24 10.74-24 24v360c0 17.67 14.33 32 32 32h576c17.67 0 32-14.33 32-32V216c0-13.26-10.75-24-24-24zM128 404c0 6.63-5.37 12-12 12H76c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm0-96c0 6.63-5.37 12-12 12H76c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm0-96c0 6.63-5.37 12-12 12H76c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm128 192c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm0-96c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm0-96c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm160 96c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm0-96c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm0-96c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12V76c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm160 288c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm0-96c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40z",viewbox:"0 0 640 512"}};var a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttribute("viewBox",o[i].viewbox),a.setAttribute("height","24");var t=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttribute("d",o[i].path),t.setAttribute("fill","currentColor"),a.appendChild(t),e.appendChild(a)}addFeatureIcon(i,o,a){const t={unknown:"map-marker",amenity:"map-marker",building:"map-marker",street:"road",suburb:"city",district:"city",postcode:"city",city:"city",county:"city",state:"city"},n=e.find((e=>a&&e.code.toLowerCase()===a.toLowerCase()));if("country"===o&&n){i.classList.add("emoji");const e=document.createElement("span");e.innerText=n.emoji,i.appendChild(e)}else this.addIcon(i,t[o]?t[o]:"map-marker")}notifyValueSelected(e){this.currentPlaceDetailsPromiseReject&&(this.currentPlaceDetailsPromiseReject({canceled:!0}),this.currentPlaceDetailsPromiseReject=null),this.options.skipDetails||!e||e.properties.nonVerifiedParts?.length?this.changeCallbacks.forEach((i=>i(e))):new Promise(((i,o)=>{this.currentPlaceDetailsPromiseReject=o;let a=this.generatePlacesUrlUrl(e.properties.place_id);fetch(a).then((e=>{e.ok?e.json().then((e=>i(e))):e.json().then((e=>o(e)))}))})).then((i=>{if(!i.features.length)return void this.changeCallbacks.forEach((i=>i(e)));const o=i.features[0];this.changeCallbacks.forEach((e=>e(o))),this.currentPlaceDetailsPromiseReject=null}),(e=>{e.canceled||console.log(e)}))}notifySuggestions(e){this.suggestionsChangeCallbacks.forEach((i=>i(e)))}notifyOpened(){this.openCallbacks.forEach((e=>e(!0)))}notifyClosed(){this.closeCallbacks.forEach((e=>e(!1)))}openDropdownAgain(){const e=document.createEvent("Event");e.initEvent("input",!0,!0),this.inputElement.dispatchEvent(e)}generatePlacesUrlUrl(e){let i=`${this.placeDetailsUrl}?id=${e}&apiKey=${this.apiKey}`;return this.options.lang&&(i+=`&lang=${this.options.lang}`),i}generateUrl(e){let i=`${this.geocoderUrl}?text=${encodeURIComponent(e)}&apiKey=${this.apiKey}`;this.options.type&&(i+=`&type=${this.options.type}`),this.options.limit&&(i+=`&limit=${this.options.limit}`),this.options.lang&&(i+=`&lang=${this.options.lang}`);const o=[],a=this.options.filter[this.BY_COUNTRYCODE],t=this.options.filter[this.BY_CIRCLE],n=this.options.filter[this.BY_RECT],d=this.options.filter[this.BY_PLACE];a&&a.length&&o.push(`countrycode:${a.join(",").toLowerCase()}`),t&&this.isLatitude(t.lat)&&this.isLongitude(t.lon)&&t.radiusMeters>0&&o.push(`circle:${t.lon},${t.lat},${t.radiusMeters}`),n&&this.isLatitude(n.lat1)&&this.isLongitude(n.lon1)&&this.isLatitude(n.lat2)&&this.isLongitude(n.lon2)&&o.push(`rect:${n.lon1},${n.lat1},${n.lon2},${n.lat2}`),d&&o.push(`place:${d}`),i+=o.length?`&filter=${o.join("|")}`:"";const l=[],s=this.options.bias[this.BY_COUNTRYCODE],c=this.options.bias[this.BY_CIRCLE],r=this.options.bias[this.BY_RECT],F=this.options.bias[this.BY_PROXIMITY];return s&&s.length&&l.push(`countrycode:${s.join(",").toLowerCase()}`),c&&this.isLatitude(c.lat)&&this.isLongitude(c.lon)&&c.radiusMeters>0&&l.push(`circle:${c.lon},${c.lat},${c.radiusMeters}`),r&&this.isLatitude(r.lat1)&&this.isLongitude(r.lon1)&&this.isLatitude(r.lat2)&&this.isLongitude(r.lon2)&&l.push(`rect:${r.lon1},${r.lat1},${r.lon2},${r.lat2}`),F&&this.isLatitude(F.lat)&&this.isLongitude(F.lon)&&l.push(`proximity:${F.lon},${F.lat}`),i+=l.length?`&bias=${l.join("|")}`:"",i}isLatitude(e){return""!==e&&null!==e&&isFinite(e)&&Math.abs(e)<=90}isLongitude(e){return""!==e&&null!==e&&isFinite(e)&&Math.abs(e)<=180}}export{i as GeocoderAutocomplete};
var e=[{code:"AD",emoji:"🇦🇩",unicode:"U+1F1E6 U+1F1E9",name:"Andorra",title:"flag for Andorra",dialCode:"+376"},{code:"AE",emoji:"🇦🇪",unicode:"U+1F1E6 U+1F1EA",name:"United Arab Emirates",title:"flag for United Arab Emirates",dialCode:"+971"},{code:"AF",emoji:"🇦🇫",unicode:"U+1F1E6 U+1F1EB",name:"Afghanistan",title:"flag for Afghanistan",dialCode:"+93"},{code:"AG",emoji:"🇦🇬",unicode:"U+1F1E6 U+1F1EC",name:"Antigua and Barbuda",title:"flag for Antigua and Barbuda",dialCode:"+1268"},{code:"AI",emoji:"🇦🇮",unicode:"U+1F1E6 U+1F1EE",name:"Anguilla",title:"flag for Anguilla",dialCode:"+1 264"},{code:"AL",emoji:"🇦🇱",unicode:"U+1F1E6 U+1F1F1",name:"Albania",title:"flag for Albania",dialCode:"+355"},{code:"AM",emoji:"🇦🇲",unicode:"U+1F1E6 U+1F1F2",name:"Armenia",title:"flag for Armenia",dialCode:"+374"},{code:"AO",emoji:"🇦🇴",unicode:"U+1F1E6 U+1F1F4",name:"Angola",title:"flag for Angola",dialCode:"+244"},{code:"AQ",emoji:"🇦🇶",unicode:"U+1F1E6 U+1F1F6",name:"Antarctica",title:"flag for Antarctica",dialCode:null},{code:"AR",emoji:"🇦🇷",unicode:"U+1F1E6 U+1F1F7",name:"Argentina",title:"flag for Argentina",dialCode:"+54"},{code:"AS",emoji:"🇦🇸",unicode:"U+1F1E6 U+1F1F8",name:"American Samoa",title:"flag for American Samoa",dialCode:"+1 684"},{code:"AT",emoji:"🇦🇹",unicode:"U+1F1E6 U+1F1F9",name:"Austria",title:"flag for Austria",dialCode:"+43"},{code:"AU",emoji:"🇦🇺",unicode:"U+1F1E6 U+1F1FA",name:"Australia",title:"flag for Australia",dialCode:"+61"},{code:"AW",emoji:"🇦🇼",unicode:"U+1F1E6 U+1F1FC",name:"Aruba",title:"flag for Aruba",dialCode:"+297"},{code:"AX",emoji:"🇦🇽",unicode:"U+1F1E6 U+1F1FD",name:"Åland Islands",title:"flag for Åland Islands",dialCode:""},{code:"AZ",emoji:"🇦🇿",unicode:"U+1F1E6 U+1F1FF",name:"Azerbaijan",title:"flag for Azerbaijan",dialCode:"+994"},{code:"BA",emoji:"🇧🇦",unicode:"U+1F1E7 U+1F1E6",name:"Bosnia and Herzegovina",title:"flag for Bosnia and Herzegovina",dialCode:"+387"},{code:"BB",emoji:"🇧🇧",unicode:"U+1F1E7 U+1F1E7",name:"Barbados",title:"flag for Barbados",dialCode:"+1 246"},{code:"BD",emoji:"🇧🇩",unicode:"U+1F1E7 U+1F1E9",name:"Bangladesh",title:"flag for Bangladesh",dialCode:"+880"},{code:"BE",emoji:"🇧🇪",unicode:"U+1F1E7 U+1F1EA",name:"Belgium",title:"flag for Belgium",dialCode:"+32"},{code:"BF",emoji:"🇧🇫",unicode:"U+1F1E7 U+1F1EB",name:"Burkina Faso",title:"flag for Burkina Faso",dialCode:"+226"},{code:"BG",emoji:"🇧🇬",unicode:"U+1F1E7 U+1F1EC",name:"Bulgaria",title:"flag for Bulgaria",dialCode:"+359"},{code:"BH",emoji:"🇧🇭",unicode:"U+1F1E7 U+1F1ED",name:"Bahrain",title:"flag for Bahrain",dialCode:"+973"},{code:"BI",emoji:"🇧🇮",unicode:"U+1F1E7 U+1F1EE",name:"Burundi",title:"flag for Burundi",dialCode:"+257"},{code:"BJ",emoji:"🇧🇯",unicode:"U+1F1E7 U+1F1EF",name:"Benin",title:"flag for Benin",dialCode:"+229"},{code:"BL",emoji:"🇧🇱",unicode:"U+1F1E7 U+1F1F1",name:"Saint Barthélemy",title:"flag for Saint Barthélemy",dialCode:"+590"},{code:"BM",emoji:"🇧🇲",unicode:"U+1F1E7 U+1F1F2",name:"Bermuda",title:"flag for Bermuda",dialCode:"+1 441"},{code:"BN",emoji:"🇧🇳",unicode:"U+1F1E7 U+1F1F3",name:"Brunei Darussalam",title:"flag for Brunei Darussalam",dialCode:"+673"},{code:"BO",emoji:"🇧🇴",unicode:"U+1F1E7 U+1F1F4",name:"Bolivia",title:"flag for Bolivia",dialCode:"+591"},{code:"BQ",emoji:"🇧🇶",unicode:"U+1F1E7 U+1F1F6",name:"Bonaire, Sint Eustatius and Saba",title:"flag for Bonaire, Sint Eustatius and Saba"},{code:"BR",emoji:"🇧🇷",unicode:"U+1F1E7 U+1F1F7",name:"Brazil",title:"flag for Brazil",dialCode:"+55"},{code:"BS",emoji:"🇧🇸",unicode:"U+1F1E7 U+1F1F8",name:"Bahamas",title:"flag for Bahamas",dialCode:"+1 242"},{code:"BT",emoji:"🇧🇹",unicode:"U+1F1E7 U+1F1F9",name:"Bhutan",title:"flag for Bhutan",dialCode:"+975"},{code:"BV",emoji:"🇧🇻",unicode:"U+1F1E7 U+1F1FB",name:"Bouvet Island",title:"flag for Bouvet Island"},{code:"BW",emoji:"🇧🇼",unicode:"U+1F1E7 U+1F1FC",name:"Botswana",title:"flag for Botswana",dialCode:"+267"},{code:"BY",emoji:"🇧🇾",unicode:"U+1F1E7 U+1F1FE",name:"Belarus",title:"flag for Belarus",dialCode:"+375"},{code:"BZ",emoji:"🇧🇿",unicode:"U+1F1E7 U+1F1FF",name:"Belize",title:"flag for Belize",dialCode:"+501"},{code:"CA",emoji:"🇨🇦",unicode:"U+1F1E8 U+1F1E6",name:"Canada",title:"flag for Canada",dialCode:"+1"},{code:"CC",emoji:"🇨🇨",unicode:"U+1F1E8 U+1F1E8",name:"Cocos (Keeling) Islands",title:"flag for Cocos (Keeling) Islands",dialCode:"+61"},{code:"CD",emoji:"🇨🇩",unicode:"U+1F1E8 U+1F1E9",name:"Congo",title:"flag for Congo",dialCode:"+243"},{code:"CF",emoji:"🇨🇫",unicode:"U+1F1E8 U+1F1EB",name:"Central African Republic",title:"flag for Central African Republic",dialCode:"+236"},{code:"CG",emoji:"🇨🇬",unicode:"U+1F1E8 U+1F1EC",name:"Congo",title:"flag for Congo",dialCode:"+242"},{code:"CH",emoji:"🇨🇭",unicode:"U+1F1E8 U+1F1ED",name:"Switzerland",title:"flag for Switzerland",dialCode:"+41"},{code:"CI",emoji:"🇨🇮",unicode:"U+1F1E8 U+1F1EE",name:"Côte D'Ivoire",title:"flag for Côte D'Ivoire",dialCode:"+225"},{code:"CK",emoji:"🇨🇰",unicode:"U+1F1E8 U+1F1F0",name:"Cook Islands",title:"flag for Cook Islands",dialCode:"+682"},{code:"CL",emoji:"🇨🇱",unicode:"U+1F1E8 U+1F1F1",name:"Chile",title:"flag for Chile",dialCode:"+56"},{code:"CM",emoji:"🇨🇲",unicode:"U+1F1E8 U+1F1F2",name:"Cameroon",title:"flag for Cameroon",dialCode:"+237"},{code:"CN",emoji:"🇨🇳",unicode:"U+1F1E8 U+1F1F3",name:"China",title:"flag for China",dialCode:"+86"},{code:"CO",emoji:"🇨🇴",unicode:"U+1F1E8 U+1F1F4",name:"Colombia",title:"flag for Colombia",dialCode:"+57"},{code:"CR",emoji:"🇨🇷",unicode:"U+1F1E8 U+1F1F7",name:"Costa Rica",title:"flag for Costa Rica",dialCode:"+506"},{code:"CU",emoji:"🇨🇺",unicode:"U+1F1E8 U+1F1FA",name:"Cuba",title:"flag for Cuba",dialCode:"+53"},{code:"CV",emoji:"🇨🇻",unicode:"U+1F1E8 U+1F1FB",name:"Cape Verde",title:"flag for Cape Verde",dialCode:"+238"},{code:"CW",emoji:"🇨🇼",unicode:"U+1F1E8 U+1F1FC",name:"Curaçao",title:"flag for Curaçao"},{code:"CX",emoji:"🇨🇽",unicode:"U+1F1E8 U+1F1FD",name:"Christmas Island",title:"flag for Christmas Island",dialCode:"+61"},{code:"CY",emoji:"🇨🇾",unicode:"U+1F1E8 U+1F1FE",name:"Cyprus",title:"flag for Cyprus",dialCode:"+537"},{code:"CZ",emoji:"🇨🇿",unicode:"U+1F1E8 U+1F1FF",name:"Czech Republic",title:"flag for Czech Republic",dialCode:"+420"},{code:"DE",emoji:"🇩🇪",unicode:"U+1F1E9 U+1F1EA",name:"Germany",title:"flag for Germany",dialCode:"+49"},{code:"DJ",emoji:"🇩🇯",unicode:"U+1F1E9 U+1F1EF",name:"Djibouti",title:"flag for Djibouti",dialCode:"+253"},{code:"DK",emoji:"🇩🇰",unicode:"U+1F1E9 U+1F1F0",name:"Denmark",title:"flag for Denmark",dialCode:"+45"},{code:"DM",emoji:"🇩🇲",unicode:"U+1F1E9 U+1F1F2",name:"Dominica",title:"flag for Dominica",dialCode:"+1 767"},{code:"DO",emoji:"🇩🇴",unicode:"U+1F1E9 U+1F1F4",name:"Dominican Republic",title:"flag for Dominican Republic",dialCode:"+1 849"},{code:"DZ",emoji:"🇩🇿",unicode:"U+1F1E9 U+1F1FF",name:"Algeria",title:"flag for Algeria",dialCode:"+213"},{code:"EC",emoji:"🇪🇨",unicode:"U+1F1EA U+1F1E8",name:"Ecuador",title:"flag for Ecuador",dialCode:"+593"},{code:"EE",emoji:"🇪🇪",unicode:"U+1F1EA U+1F1EA",name:"Estonia",title:"flag for Estonia",dialCode:"+372"},{code:"EG",emoji:"🇪🇬",unicode:"U+1F1EA U+1F1EC",name:"Egypt",title:"flag for Egypt",dialCode:"+20"},{code:"EH",emoji:"🇪🇭",unicode:"U+1F1EA U+1F1ED",name:"Western Sahara",title:"flag for Western Sahara"},{code:"ER",emoji:"🇪🇷",unicode:"U+1F1EA U+1F1F7",name:"Eritrea",title:"flag for Eritrea",dialCode:"+291"},{code:"ES",emoji:"🇪🇸",unicode:"U+1F1EA U+1F1F8",name:"Spain",title:"flag for Spain",dialCode:"+34"},{code:"ET",emoji:"🇪🇹",unicode:"U+1F1EA U+1F1F9",name:"Ethiopia",title:"flag for Ethiopia",dialCode:"+251"},{code:"EU",emoji:"🇪🇺",unicode:"U+1F1EA U+1F1FA",name:"European Union",title:"flag for European Union"},{code:"FI",emoji:"🇫🇮",unicode:"U+1F1EB U+1F1EE",name:"Finland",title:"flag for Finland",dialCode:"+358"},{code:"FJ",emoji:"🇫🇯",unicode:"U+1F1EB U+1F1EF",name:"Fiji",title:"flag for Fiji",dialCode:"+679"},{code:"FK",emoji:"🇫🇰",unicode:"U+1F1EB U+1F1F0",name:"Falkland Islands (Malvinas)",title:"flag for Falkland Islands (Malvinas)",dialCode:"+500"},{code:"FM",emoji:"🇫🇲",unicode:"U+1F1EB U+1F1F2",name:"Micronesia",title:"flag for Micronesia",dialCode:"+691"},{code:"FO",emoji:"🇫🇴",unicode:"U+1F1EB U+1F1F4",name:"Faroe Islands",title:"flag for Faroe Islands",dialCode:"+298"},{code:"FR",emoji:"🇫🇷",unicode:"U+1F1EB U+1F1F7",name:"France",title:"flag for France",dialCode:"+33"},{code:"GA",emoji:"🇬🇦",unicode:"U+1F1EC U+1F1E6",name:"Gabon",title:"flag for Gabon",dialCode:"+241"},{code:"GB",emoji:"🇬🇧",unicode:"U+1F1EC U+1F1E7",name:"United Kingdom",title:"flag for United Kingdom",dialCode:"+44"},{code:"GD",emoji:"🇬🇩",unicode:"U+1F1EC U+1F1E9",name:"Grenada",title:"flag for Grenada",dialCode:"+1 473"},{code:"GE",emoji:"🇬🇪",unicode:"U+1F1EC U+1F1EA",name:"Georgia",title:"flag for Georgia",dialCode:"+995"},{code:"GF",emoji:"🇬🇫",unicode:"U+1F1EC U+1F1EB",name:"French Guiana",title:"flag for French Guiana",dialCode:"+594"},{code:"GG",emoji:"🇬🇬",unicode:"U+1F1EC U+1F1EC",name:"Guernsey",title:"flag for Guernsey",dialCode:"+44"},{code:"GH",emoji:"🇬🇭",unicode:"U+1F1EC U+1F1ED",name:"Ghana",title:"flag for Ghana",dialCode:"+233"},{code:"GI",emoji:"🇬🇮",unicode:"U+1F1EC U+1F1EE",name:"Gibraltar",title:"flag for Gibraltar",dialCode:"+350"},{code:"GL",emoji:"🇬🇱",unicode:"U+1F1EC U+1F1F1",name:"Greenland",title:"flag for Greenland",dialCode:"+299"},{code:"GM",emoji:"🇬🇲",unicode:"U+1F1EC U+1F1F2",name:"Gambia",title:"flag for Gambia",dialCode:"+220"},{code:"GN",emoji:"🇬🇳",unicode:"U+1F1EC U+1F1F3",name:"Guinea",title:"flag for Guinea",dialCode:"+224"},{code:"GP",emoji:"🇬🇵",unicode:"U+1F1EC U+1F1F5",name:"Guadeloupe",title:"flag for Guadeloupe",dialCode:"+590"},{code:"GQ",emoji:"🇬🇶",unicode:"U+1F1EC U+1F1F6",name:"Equatorial Guinea",title:"flag for Equatorial Guinea",dialCode:"+240"},{code:"GR",emoji:"🇬🇷",unicode:"U+1F1EC U+1F1F7",name:"Greece",title:"flag for Greece",dialCode:"+30"},{code:"GS",emoji:"🇬🇸",unicode:"U+1F1EC U+1F1F8",name:"South Georgia",title:"flag for South Georgia",dialCode:"+500"},{code:"GT",emoji:"🇬🇹",unicode:"U+1F1EC U+1F1F9",name:"Guatemala",title:"flag for Guatemala",dialCode:"+502"},{code:"GU",emoji:"🇬🇺",unicode:"U+1F1EC U+1F1FA",name:"Guam",title:"flag for Guam",dialCode:"+1 671"},{code:"GW",emoji:"🇬🇼",unicode:"U+1F1EC U+1F1FC",name:"Guinea-Bissau",title:"flag for Guinea-Bissau",dialCode:"+245"},{code:"GY",emoji:"🇬🇾",unicode:"U+1F1EC U+1F1FE",name:"Guyana",title:"flag for Guyana",dialCode:"+595"},{code:"HK",emoji:"🇭🇰",unicode:"U+1F1ED U+1F1F0",name:"Hong Kong",title:"flag for Hong Kong",dialCode:"+852"},{code:"HM",emoji:"🇭🇲",unicode:"U+1F1ED U+1F1F2",name:"Heard Island and Mcdonald Islands",title:"flag for Heard Island and Mcdonald Islands"},{code:"HN",emoji:"🇭🇳",unicode:"U+1F1ED U+1F1F3",name:"Honduras",title:"flag for Honduras",dialCode:"+504"},{code:"HR",emoji:"🇭🇷",unicode:"U+1F1ED U+1F1F7",name:"Croatia",title:"flag for Croatia",dialCode:"+385"},{code:"HT",emoji:"🇭🇹",unicode:"U+1F1ED U+1F1F9",name:"Haiti",title:"flag for Haiti",dialCode:"+509"},{code:"HU",emoji:"🇭🇺",unicode:"U+1F1ED U+1F1FA",name:"Hungary",title:"flag for Hungary",dialCode:"+36"},{code:"ID",emoji:"🇮🇩",unicode:"U+1F1EE U+1F1E9",name:"Indonesia",title:"flag for Indonesia",dialCode:"+62"},{code:"IE",emoji:"🇮🇪",unicode:"U+1F1EE U+1F1EA",name:"Ireland",title:"flag for Ireland",dialCode:"+353"},{code:"IL",emoji:"🇮🇱",unicode:"U+1F1EE U+1F1F1",name:"Israel",title:"flag for Israel",dialCode:"+972"},{code:"IM",emoji:"🇮🇲",unicode:"U+1F1EE U+1F1F2",name:"Isle of Man",title:"flag for Isle of Man",dialCode:"+44"},{code:"IN",emoji:"🇮🇳",unicode:"U+1F1EE U+1F1F3",name:"India",title:"flag for India",dialCode:"+91"},{code:"IO",emoji:"🇮🇴",unicode:"U+1F1EE U+1F1F4",name:"British Indian Ocean Territory",title:"flag for British Indian Ocean Territory",dialCode:"+246"},{code:"IQ",emoji:"🇮🇶",unicode:"U+1F1EE U+1F1F6",name:"Iraq",title:"flag for Iraq",dialCode:"+964"},{code:"IR",emoji:"🇮🇷",unicode:"U+1F1EE U+1F1F7",name:"Iran",title:"flag for Iran",dialCode:"+98"},{code:"IS",emoji:"🇮🇸",unicode:"U+1F1EE U+1F1F8",name:"Iceland",title:"flag for Iceland",dialCode:"+354"},{code:"IT",emoji:"🇮🇹",unicode:"U+1F1EE U+1F1F9",name:"Italy",title:"flag for Italy",dialCode:"+39"},{code:"JE",emoji:"🇯🇪",unicode:"U+1F1EF U+1F1EA",name:"Jersey",title:"flag for Jersey",dialCode:"+44"},{code:"JM",emoji:"🇯🇲",unicode:"U+1F1EF U+1F1F2",name:"Jamaica",title:"flag for Jamaica",dialCode:"+1 876"},{code:"JO",emoji:"🇯🇴",unicode:"U+1F1EF U+1F1F4",name:"Jordan",title:"flag for Jordan",dialCode:"+962"},{code:"JP",emoji:"🇯🇵",unicode:"U+1F1EF U+1F1F5",name:"Japan",title:"flag for Japan",dialCode:"+81"},{code:"KE",emoji:"🇰🇪",unicode:"U+1F1F0 U+1F1EA",name:"Kenya",title:"flag for Kenya",dialCode:"+254"},{code:"KG",emoji:"🇰🇬",unicode:"U+1F1F0 U+1F1EC",name:"Kyrgyzstan",title:"flag for Kyrgyzstan",dialCode:"+996"},{code:"KH",emoji:"🇰🇭",unicode:"U+1F1F0 U+1F1ED",name:"Cambodia",title:"flag for Cambodia",dialCode:"+855"},{code:"KI",emoji:"🇰🇮",unicode:"U+1F1F0 U+1F1EE",name:"Kiribati",title:"flag for Kiribati",dialCode:"+686"},{code:"KM",emoji:"🇰🇲",unicode:"U+1F1F0 U+1F1F2",name:"Comoros",title:"flag for Comoros",dialCode:"+269"},{code:"KN",emoji:"🇰🇳",unicode:"U+1F1F0 U+1F1F3",name:"Saint Kitts and Nevis",title:"flag for Saint Kitts and Nevis",dialCode:"+1 869"},{code:"KP",emoji:"🇰🇵",unicode:"U+1F1F0 U+1F1F5",name:"North Korea",title:"flag for North Korea",dialCode:"+850"},{code:"KR",emoji:"🇰🇷",unicode:"U+1F1F0 U+1F1F7",name:"South Korea",title:"flag for South Korea",dialCode:"+82"},{code:"KW",emoji:"🇰🇼",unicode:"U+1F1F0 U+1F1FC",name:"Kuwait",title:"flag for Kuwait",dialCode:"+965"},{code:"KY",emoji:"🇰🇾",unicode:"U+1F1F0 U+1F1FE",name:"Cayman Islands",title:"flag for Cayman Islands",dialCode:"+ 345"},{code:"KZ",emoji:"🇰🇿",unicode:"U+1F1F0 U+1F1FF",name:"Kazakhstan",title:"flag for Kazakhstan",dialCode:"+7 7"},{code:"LA",emoji:"🇱🇦",unicode:"U+1F1F1 U+1F1E6",name:"Lao People's Democratic Republic",title:"flag for Lao People's Democratic Republic",dialCode:"+856"},{code:"LB",emoji:"🇱🇧",unicode:"U+1F1F1 U+1F1E7",name:"Lebanon",title:"flag for Lebanon",dialCode:"+961"},{code:"LC",emoji:"🇱🇨",unicode:"U+1F1F1 U+1F1E8",name:"Saint Lucia",title:"flag for Saint Lucia",dialCode:"+1 758"},{code:"LI",emoji:"🇱🇮",unicode:"U+1F1F1 U+1F1EE",name:"Liechtenstein",title:"flag for Liechtenstein",dialCode:"+423"},{code:"LK",emoji:"🇱🇰",unicode:"U+1F1F1 U+1F1F0",name:"Sri Lanka",title:"flag for Sri Lanka",dialCode:"+94"},{code:"LR",emoji:"🇱🇷",unicode:"U+1F1F1 U+1F1F7",name:"Liberia",title:"flag for Liberia",dialCode:"+231"},{code:"LS",emoji:"🇱🇸",unicode:"U+1F1F1 U+1F1F8",name:"Lesotho",title:"flag for Lesotho",dialCode:"+266"},{code:"LT",emoji:"🇱🇹",unicode:"U+1F1F1 U+1F1F9",name:"Lithuania",title:"flag for Lithuania",dialCode:"+370"},{code:"LU",emoji:"🇱🇺",unicode:"U+1F1F1 U+1F1FA",name:"Luxembourg",title:"flag for Luxembourg",dialCode:"+352"},{code:"LV",emoji:"🇱🇻",unicode:"U+1F1F1 U+1F1FB",name:"Latvia",title:"flag for Latvia",dialCode:"+371"},{code:"LY",emoji:"🇱🇾",unicode:"U+1F1F1 U+1F1FE",name:"Libya",title:"flag for Libya",dialCode:"+218"},{code:"MA",emoji:"🇲🇦",unicode:"U+1F1F2 U+1F1E6",name:"Morocco",title:"flag for Morocco",dialCode:"+212"},{code:"MC",emoji:"🇲🇨",unicode:"U+1F1F2 U+1F1E8",name:"Monaco",title:"flag for Monaco",dialCode:"+377"},{code:"MD",emoji:"🇲🇩",unicode:"U+1F1F2 U+1F1E9",name:"Moldova",title:"flag for Moldova",dialCode:"+373"},{code:"ME",emoji:"🇲🇪",unicode:"U+1F1F2 U+1F1EA",name:"Montenegro",title:"flag for Montenegro",dialCode:"+382"},{code:"MF",emoji:"🇲🇫",unicode:"U+1F1F2 U+1F1EB",name:"Saint Martin (French Part)",title:"flag for Saint Martin (French Part)",dialCode:"+590"},{code:"MG",emoji:"🇲🇬",unicode:"U+1F1F2 U+1F1EC",name:"Madagascar",title:"flag for Madagascar",dialCode:"+261"},{code:"MH",emoji:"🇲🇭",unicode:"U+1F1F2 U+1F1ED",name:"Marshall Islands",title:"flag for Marshall Islands",dialCode:"+692"},{code:"MK",emoji:"🇲🇰",unicode:"U+1F1F2 U+1F1F0",name:"Macedonia",title:"flag for Macedonia",dialCode:"+389"},{code:"ML",emoji:"🇲🇱",unicode:"U+1F1F2 U+1F1F1",name:"Mali",title:"flag for Mali",dialCode:"+223"},{code:"MM",emoji:"🇲🇲",unicode:"U+1F1F2 U+1F1F2",name:"Myanmar",title:"flag for Myanmar",dialCode:"+95"},{code:"MN",emoji:"🇲🇳",unicode:"U+1F1F2 U+1F1F3",name:"Mongolia",title:"flag for Mongolia",dialCode:"+976"},{code:"MO",emoji:"🇲🇴",unicode:"U+1F1F2 U+1F1F4",name:"Macao",title:"flag for Macao",dialCode:"+853"},{code:"MP",emoji:"🇲🇵",unicode:"U+1F1F2 U+1F1F5",name:"Northern Mariana Islands",title:"flag for Northern Mariana Islands",dialCode:"+1 670"},{code:"MQ",emoji:"🇲🇶",unicode:"U+1F1F2 U+1F1F6",name:"Martinique",title:"flag for Martinique",dialCode:"+596"},{code:"MR",emoji:"🇲🇷",unicode:"U+1F1F2 U+1F1F7",name:"Mauritania",title:"flag for Mauritania",dialCode:"+222"},{code:"MS",emoji:"🇲🇸",unicode:"U+1F1F2 U+1F1F8",name:"Montserrat",title:"flag for Montserrat",dialCode:"+1664"},{code:"MT",emoji:"🇲🇹",unicode:"U+1F1F2 U+1F1F9",name:"Malta",title:"flag for Malta",dialCode:"+356"},{code:"MU",emoji:"🇲🇺",unicode:"U+1F1F2 U+1F1FA",name:"Mauritius",title:"flag for Mauritius",dialCode:"+230"},{code:"MV",emoji:"🇲🇻",unicode:"U+1F1F2 U+1F1FB",name:"Maldives",title:"flag for Maldives",dialCode:"+960"},{code:"MW",emoji:"🇲🇼",unicode:"U+1F1F2 U+1F1FC",name:"Malawi",title:"flag for Malawi",dialCode:"+265"},{code:"MX",emoji:"🇲🇽",unicode:"U+1F1F2 U+1F1FD",name:"Mexico",title:"flag for Mexico",dialCode:"+52"},{code:"MY",emoji:"🇲🇾",unicode:"U+1F1F2 U+1F1FE",name:"Malaysia",title:"flag for Malaysia",dialCode:"+60"},{code:"MZ",emoji:"🇲🇿",unicode:"U+1F1F2 U+1F1FF",name:"Mozambique",title:"flag for Mozambique",dialCode:"+258"},{code:"NA",emoji:"🇳🇦",unicode:"U+1F1F3 U+1F1E6",name:"Namibia",title:"flag for Namibia",dialCode:"+264"},{code:"NC",emoji:"🇳🇨",unicode:"U+1F1F3 U+1F1E8",name:"New Caledonia",title:"flag for New Caledonia",dialCode:"+687"},{code:"NE",emoji:"🇳🇪",unicode:"U+1F1F3 U+1F1EA",name:"Niger",title:"flag for Niger",dialCode:"+227"},{code:"NF",emoji:"🇳🇫",unicode:"U+1F1F3 U+1F1EB",name:"Norfolk Island",title:"flag for Norfolk Island",dialCode:"+672"},{code:"NG",emoji:"🇳🇬",unicode:"U+1F1F3 U+1F1EC",name:"Nigeria",title:"flag for Nigeria",dialCode:"+234"},{code:"NI",emoji:"🇳🇮",unicode:"U+1F1F3 U+1F1EE",name:"Nicaragua",title:"flag for Nicaragua",dialCode:"+505"},{code:"NL",emoji:"🇳🇱",unicode:"U+1F1F3 U+1F1F1",name:"Netherlands",title:"flag for Netherlands",dialCode:"+31"},{code:"NO",emoji:"🇳🇴",unicode:"U+1F1F3 U+1F1F4",name:"Norway",title:"flag for Norway",dialCode:"+47"},{code:"NP",emoji:"🇳🇵",unicode:"U+1F1F3 U+1F1F5",name:"Nepal",title:"flag for Nepal",dialCode:"+977"},{code:"NR",emoji:"🇳🇷",unicode:"U+1F1F3 U+1F1F7",name:"Nauru",title:"flag for Nauru",dialCode:"+674"},{code:"NU",emoji:"🇳🇺",unicode:"U+1F1F3 U+1F1FA",name:"Niue",title:"flag for Niue",dialCode:"+683"},{code:"NZ",emoji:"🇳🇿",unicode:"U+1F1F3 U+1F1FF",name:"New Zealand",title:"flag for New Zealand",dialCode:"+64"},{code:"OM",emoji:"🇴🇲",unicode:"U+1F1F4 U+1F1F2",name:"Oman",title:"flag for Oman",dialCode:"+968"},{code:"PA",emoji:"🇵🇦",unicode:"U+1F1F5 U+1F1E6",name:"Panama",title:"flag for Panama",dialCode:"+507"},{code:"PE",emoji:"🇵🇪",unicode:"U+1F1F5 U+1F1EA",name:"Peru",title:"flag for Peru",dialCode:"+51"},{code:"PF",emoji:"🇵🇫",unicode:"U+1F1F5 U+1F1EB",name:"French Polynesia",title:"flag for French Polynesia",dialCode:"+689"},{code:"PG",emoji:"🇵🇬",unicode:"U+1F1F5 U+1F1EC",name:"Papua New Guinea",title:"flag for Papua New Guinea",dialCode:"+675"},{code:"PH",emoji:"🇵🇭",unicode:"U+1F1F5 U+1F1ED",name:"Philippines",title:"flag for Philippines",dialCode:"+63"},{code:"PK",emoji:"🇵🇰",unicode:"U+1F1F5 U+1F1F0",name:"Pakistan",title:"flag for Pakistan",dialCode:"+92"},{code:"PL",emoji:"🇵🇱",unicode:"U+1F1F5 U+1F1F1",name:"Poland",title:"flag for Poland",dialCode:"+48"},{code:"PM",emoji:"🇵🇲",unicode:"U+1F1F5 U+1F1F2",name:"Saint Pierre and Miquelon",title:"flag for Saint Pierre and Miquelon",dialCode:"+508"},{code:"PN",emoji:"🇵🇳",unicode:"U+1F1F5 U+1F1F3",name:"Pitcairn",title:"flag for Pitcairn",dialCode:"+872"},{code:"PR",emoji:"🇵🇷",unicode:"U+1F1F5 U+1F1F7",name:"Puerto Rico",title:"flag for Puerto Rico",dialCode:"+1 939"},{code:"PS",emoji:"🇵🇸",unicode:"U+1F1F5 U+1F1F8",name:"Palestinian Territory",title:"flag for Palestinian Territory",dialCode:"+970"},{code:"PT",emoji:"🇵🇹",unicode:"U+1F1F5 U+1F1F9",name:"Portugal",title:"flag for Portugal",dialCode:"+351"},{code:"PW",emoji:"🇵🇼",unicode:"U+1F1F5 U+1F1FC",name:"Palau",title:"flag for Palau",dialCode:"+680"},{code:"PY",emoji:"🇵🇾",unicode:"U+1F1F5 U+1F1FE",name:"Paraguay",title:"flag for Paraguay",dialCode:"+595"},{code:"QA",emoji:"🇶🇦",unicode:"U+1F1F6 U+1F1E6",name:"Qatar",title:"flag for Qatar",dialCode:"+974"},{code:"RE",emoji:"🇷🇪",unicode:"U+1F1F7 U+1F1EA",name:"Réunion",title:"flag for Réunion",dialCode:"+262"},{code:"RO",emoji:"🇷🇴",unicode:"U+1F1F7 U+1F1F4",name:"Romania",title:"flag for Romania",dialCode:"+40"},{code:"RS",emoji:"🇷🇸",unicode:"U+1F1F7 U+1F1F8",name:"Serbia",title:"flag for Serbia",dialCode:"+381"},{code:"RU",emoji:"🇷🇺",unicode:"U+1F1F7 U+1F1FA",name:"Russia",title:"flag for Russia",dialCode:"+7"},{code:"RW",emoji:"🇷🇼",unicode:"U+1F1F7 U+1F1FC",name:"Rwanda",title:"flag for Rwanda",dialCode:"+250"},{code:"SA",emoji:"🇸🇦",unicode:"U+1F1F8 U+1F1E6",name:"Saudi Arabia",title:"flag for Saudi Arabia",dialCode:"+966"},{code:"SB",emoji:"🇸🇧",unicode:"U+1F1F8 U+1F1E7",name:"Solomon Islands",title:"flag for Solomon Islands",dialCode:"+677"},{code:"SC",emoji:"🇸🇨",unicode:"U+1F1F8 U+1F1E8",name:"Seychelles",title:"flag for Seychelles",dialCode:"+248"},{code:"SD",emoji:"🇸🇩",unicode:"U+1F1F8 U+1F1E9",name:"Sudan",title:"flag for Sudan",dialCode:"+249"},{code:"SE",emoji:"🇸🇪",unicode:"U+1F1F8 U+1F1EA",name:"Sweden",title:"flag for Sweden",dialCode:"+46"},{code:"SG",emoji:"🇸🇬",unicode:"U+1F1F8 U+1F1EC",name:"Singapore",title:"flag for Singapore",dialCode:"+65"},{code:"SH",emoji:"🇸🇭",unicode:"U+1F1F8 U+1F1ED",name:"Saint Helena, Ascension and Tristan Da Cunha",title:"flag for Saint Helena, Ascension and Tristan Da Cunha",dialCode:"+290"},{code:"SI",emoji:"🇸🇮",unicode:"U+1F1F8 U+1F1EE",name:"Slovenia",title:"flag for Slovenia",dialCode:"+386"},{code:"SJ",emoji:"🇸🇯",unicode:"U+1F1F8 U+1F1EF",name:"Svalbard and Jan Mayen",title:"flag for Svalbard and Jan Mayen",dialCode:"+47"},{code:"SK",emoji:"🇸🇰",unicode:"U+1F1F8 U+1F1F0",name:"Slovakia",title:"flag for Slovakia",dialCode:"+421"},{code:"SL",emoji:"🇸🇱",unicode:"U+1F1F8 U+1F1F1",name:"Sierra Leone",title:"flag for Sierra Leone",dialCode:"+232"},{code:"SM",emoji:"🇸🇲",unicode:"U+1F1F8 U+1F1F2",name:"San Marino",title:"flag for San Marino",dialCode:"+378"},{code:"SN",emoji:"🇸🇳",unicode:"U+1F1F8 U+1F1F3",name:"Senegal",title:"flag for Senegal",dialCode:"+221"},{code:"SO",emoji:"🇸🇴",unicode:"U+1F1F8 U+1F1F4",name:"Somalia",title:"flag for Somalia",dialCode:"+252"},{code:"SR",emoji:"🇸🇷",unicode:"U+1F1F8 U+1F1F7",name:"Suriname",title:"flag for Suriname",dialCode:"+597"},{code:"SS",emoji:"🇸🇸",unicode:"U+1F1F8 U+1F1F8",name:"South Sudan",title:"flag for South Sudan"},{code:"ST",emoji:"🇸🇹",unicode:"U+1F1F8 U+1F1F9",name:"Sao Tome and Principe",title:"flag for Sao Tome and Principe",dialCode:"+239"},{code:"SV",emoji:"🇸🇻",unicode:"U+1F1F8 U+1F1FB",name:"El Salvador",title:"flag for El Salvador",dialCode:"+503"},{code:"SX",emoji:"🇸🇽",unicode:"U+1F1F8 U+1F1FD",name:"Sint Maarten (Dutch Part)",title:"flag for Sint Maarten (Dutch Part)"},{code:"SY",emoji:"🇸🇾",unicode:"U+1F1F8 U+1F1FE",name:"Syrian Arab Republic",title:"flag for Syrian Arab Republic",dialCode:"+963"},{code:"SZ",emoji:"🇸🇿",unicode:"U+1F1F8 U+1F1FF",name:"Swaziland",title:"flag for Swaziland",dialCode:"+268"},{code:"TC",emoji:"🇹🇨",unicode:"U+1F1F9 U+1F1E8",name:"Turks and Caicos Islands",title:"flag for Turks and Caicos Islands",dialCode:"+1 649"},{code:"TD",emoji:"🇹🇩",unicode:"U+1F1F9 U+1F1E9",name:"Chad",title:"flag for Chad",dialCode:"+235"},{code:"TF",emoji:"🇹🇫",unicode:"U+1F1F9 U+1F1EB",name:"French Southern Territories",title:"flag for French Southern Territories"},{code:"TG",emoji:"🇹🇬",unicode:"U+1F1F9 U+1F1EC",name:"Togo",title:"flag for Togo",dialCode:"+228"},{code:"TH",emoji:"🇹🇭",unicode:"U+1F1F9 U+1F1ED",name:"Thailand",title:"flag for Thailand",dialCode:"+66"},{code:"TJ",emoji:"🇹🇯",unicode:"U+1F1F9 U+1F1EF",name:"Tajikistan",title:"flag for Tajikistan",dialCode:"+992"},{code:"TK",emoji:"🇹🇰",unicode:"U+1F1F9 U+1F1F0",name:"Tokelau",title:"flag for Tokelau",dialCode:"+690"},{code:"TL",emoji:"🇹🇱",unicode:"U+1F1F9 U+1F1F1",name:"Timor-Leste",title:"flag for Timor-Leste",dialCode:"+670"},{code:"TM",emoji:"🇹🇲",unicode:"U+1F1F9 U+1F1F2",name:"Turkmenistan",title:"flag for Turkmenistan",dialCode:"+993"},{code:"TN",emoji:"🇹🇳",unicode:"U+1F1F9 U+1F1F3",name:"Tunisia",title:"flag for Tunisia",dialCode:"+216"},{code:"TO",emoji:"🇹🇴",unicode:"U+1F1F9 U+1F1F4",name:"Tonga",title:"flag for Tonga",dialCode:"+676"},{code:"TR",emoji:"🇹🇷",unicode:"U+1F1F9 U+1F1F7",name:"Turkey",title:"flag for Turkey",dialCode:"+90"},{code:"TT",emoji:"🇹🇹",unicode:"U+1F1F9 U+1F1F9",name:"Trinidad and Tobago",title:"flag for Trinidad and Tobago",dialCode:"+1 868"},{code:"TV",emoji:"🇹🇻",unicode:"U+1F1F9 U+1F1FB",name:"Tuvalu",title:"flag for Tuvalu",dialCode:"+688"},{code:"TW",emoji:"🇹🇼",unicode:"U+1F1F9 U+1F1FC",name:"Taiwan",title:"flag for Taiwan",dialCode:"+886"},{code:"TZ",emoji:"🇹🇿",unicode:"U+1F1F9 U+1F1FF",name:"Tanzania",title:"flag for Tanzania",dialCode:"+255"},{code:"UA",emoji:"🇺🇦",unicode:"U+1F1FA U+1F1E6",name:"Ukraine",title:"flag for Ukraine",dialCode:"+380"},{code:"UG",emoji:"🇺🇬",unicode:"U+1F1FA U+1F1EC",name:"Uganda",title:"flag for Uganda",dialCode:"+256"},{code:"UM",emoji:"🇺🇲",unicode:"U+1F1FA U+1F1F2",name:"United States Minor Outlying Islands",title:"flag for United States Minor Outlying Islands"},{code:"US",emoji:"🇺🇸",unicode:"U+1F1FA U+1F1F8",name:"United States",title:"flag for United States",dialCode:"+1"},{code:"UY",emoji:"🇺🇾",unicode:"U+1F1FA U+1F1FE",name:"Uruguay",title:"flag for Uruguay",dialCode:"+598"},{code:"UZ",emoji:"🇺🇿",unicode:"U+1F1FA U+1F1FF",name:"Uzbekistan",title:"flag for Uzbekistan",dialCode:"+998"},{code:"VA",emoji:"🇻🇦",unicode:"U+1F1FB U+1F1E6",name:"Vatican City",title:"flag for Vatican City",dialCode:"+379"},{code:"VC",emoji:"🇻🇨",unicode:"U+1F1FB U+1F1E8",name:"Saint Vincent and The Grenadines",title:"flag for Saint Vincent and The Grenadines",dialCode:"+1 784"},{code:"VE",emoji:"🇻🇪",unicode:"U+1F1FB U+1F1EA",name:"Venezuela",title:"flag for Venezuela",dialCode:"+58"},{code:"VG",emoji:"🇻🇬",unicode:"U+1F1FB U+1F1EC",name:"Virgin Islands, British",title:"flag for Virgin Islands, British",dialCode:"+1 284"},{code:"VI",emoji:"🇻🇮",unicode:"U+1F1FB U+1F1EE",name:"Virgin Islands, U.S.",title:"flag for Virgin Islands, U.S.",dialCode:"+1 340"},{code:"VN",emoji:"🇻🇳",unicode:"U+1F1FB U+1F1F3",name:"Viet Nam",title:"flag for Viet Nam",dialCode:"+84"},{code:"VU",emoji:"🇻🇺",unicode:"U+1F1FB U+1F1FA",name:"Vanuatu",title:"flag for Vanuatu",dialCode:"+678"},{code:"WF",emoji:"🇼🇫",unicode:"U+1F1FC U+1F1EB",name:"Wallis and Futuna",title:"flag for Wallis and Futuna",dialCode:"+681"},{code:"WS",emoji:"🇼🇸",unicode:"U+1F1FC U+1F1F8",name:"Samoa",title:"flag for Samoa",dialCode:"+685"},{code:"XK",emoji:"🇽🇰",unicode:"U+1F1FD U+1F1F0",name:"Kosovo",title:"flag for Kosovo",dialCode:"+383"},{code:"YE",emoji:"🇾🇪",unicode:"U+1F1FE U+1F1EA",name:"Yemen",title:"flag for Yemen",dialCode:"+967"},{code:"YT",emoji:"🇾🇹",unicode:"U+1F1FE U+1F1F9",name:"Mayotte",title:"flag for Mayotte",dialCode:"+262"},{code:"ZA",emoji:"🇿🇦",unicode:"U+1F1FF U+1F1E6",name:"South Africa",title:"flag for South Africa",dialCode:"+27"},{code:"ZM",emoji:"🇿🇲",unicode:"U+1F1FF U+1F1F2",name:"Zambia",title:"flag for Zambia",dialCode:"+260"},{code:"ZW",emoji:"🇿🇼",unicode:"U+1F1FF U+1F1FC",name:"Zimbabwe",title:"flag for Zimbabwe",dialCode:"+263"}];class i{container;apiKey;inputElement;inputClearButton;autocompleteItemsElement=null;focusedItemIndex;currentItems;currentPromiseReject;currentPlaceDetailsPromiseReject;currentTimeout;changeCallbacks=[];suggestionsChangeCallbacks=[];inputCallbacks=[];openCallbacks=[];closeCallbacks=[];preprocessHook;postprocessHook;suggestionsFilter;sendGeocoderRequestAlt;sendPlaceDetailsRequestAlt;geocoderUrl="https://api.geoapify.com/v1/geocode/autocomplete";placeDetailsUrl="https://api.geoapify.com/v2/place-details";options={limit:5,debounceDelay:100};BY_COUNTRYCODE="countrycode";BY_RECT="rect";BY_CIRCLE="circle";BY_PROXIMITY="proximity";BY_PLACE="place";constructor(e,i,o){this.container=e,this.apiKey=i,this.options=o?{...this.options,...o}:this.options,this.options.filter=this.options.filter||{},this.options.bias=this.options.bias||{},this.options.countryCodes&&this.addFilterByCountry(this.options.countryCodes),this.options.position&&this.addBiasByProximity(this.options.position),this.inputElement=document.createElement("input"),this.inputElement.classList.add("geoapify-autocomplete-input"),this.inputElement.setAttribute("type","text"),this.inputElement.setAttribute("placeholder",this.options.placeholder||"Enter an address here"),this.container.appendChild(this.inputElement),this.inputClearButton=document.createElement("div"),this.inputClearButton.classList.add("geoapify-close-button"),this.addIcon(this.inputClearButton,"close"),this.inputClearButton.addEventListener("click",this.clearFieldAndNotify.bind(this),!1),this.container.appendChild(this.inputClearButton),this.inputElement.addEventListener("input",this.onUserInput.bind(this),!1),this.inputElement.addEventListener("keydown",this.onUserKeyPress.bind(this),!1),document.addEventListener("click",(e=>{e.target!==this.inputElement?this.closeDropDownList():this.autocompleteItemsElement||this.openDropdownAgain()}))}setType(e){this.options.type=e}setLang(e){this.options.lang=e}setCountryCodes(e){console.warn("WARNING! Obsolete function called. Function setCountryCodes() has been deprecated, please use the new addFilterByCountry() function instead!"),this.options.countryCodes=e}setPosition(e){console.warn("WARNING! Obsolete function called. Function setPosition() has been deprecated, please use the new addBiasByProximity() function instead!"),this.options.position=e}setLimit(e){this.options.limit=e}setValue(e){e?this.inputClearButton.classList.add("visible"):this.inputClearButton.classList.remove("visible"),this.inputElement.value=e}getValue(){return this.inputElement.value}addFilterByCountry(e){this.options.filter[this.BY_COUNTRYCODE]=e}addFilterByCircle(e){this.options.filter[this.BY_CIRCLE]=e}addFilterByRect(e){this.options.filter[this.BY_RECT]=e}addFilterByPlace(e){this.options.filter[this.BY_PLACE]=e}clearFilters(){this.options.filter={}}addBiasByCountry(e){this.options.bias[this.BY_COUNTRYCODE]=e}addBiasByCircle(e){this.options.bias[this.BY_CIRCLE]=e}addBiasByRect(e){this.options.bias[this.BY_RECT]=e}addBiasByProximity(e){this.options.bias[this.BY_PROXIMITY]=e}clearBias(){this.options.bias={}}on(e,i){"select"===e&&this.changeCallbacks.indexOf(i)<0&&this.changeCallbacks.push(i),"suggestions"===e&&this.suggestionsChangeCallbacks.indexOf(i)<0&&this.suggestionsChangeCallbacks.push(i),"input"===e&&this.inputCallbacks.indexOf(i)<0&&this.inputCallbacks.push(i),"close"===e&&this.closeCallbacks.indexOf(i)<0&&this.closeCallbacks.push(i),"open"===e&&this.openCallbacks.indexOf(i)<0&&this.openCallbacks.push(i)}off(e,i){"select"===e&&this.changeCallbacks.indexOf(i)>=0?this.changeCallbacks.splice(this.changeCallbacks.indexOf(i),1):"select"!==e||i||(this.changeCallbacks=[]),"suggestions"===e&&this.suggestionsChangeCallbacks.indexOf(i)>=0?this.suggestionsChangeCallbacks.splice(this.suggestionsChangeCallbacks.indexOf(i),1):"suggestions"!==e||i||(this.suggestionsChangeCallbacks=[]),"input"===e&&this.inputCallbacks.indexOf(i)>=0?this.inputCallbacks.splice(this.inputCallbacks.indexOf(i),1):"input"!==e||i||(this.inputCallbacks=[]),"close"===e&&this.closeCallbacks.indexOf(i)>=0?this.closeCallbacks.splice(this.closeCallbacks.indexOf(i),1):"close"!==e||i||(this.closeCallbacks=[]),"open"===e&&this.openCallbacks.indexOf(i)>=0?this.openCallbacks.splice(this.openCallbacks.indexOf(i),1):"open"!==e||i||(this.openCallbacks=[])}once(e,i){this.on(e,i);const o=this,a=()=>{o.off(e,i),o.off(e,a)};this.on(e,a)}setSuggestionsFilter(e){this.suggestionsFilter=e&&"function"==typeof e?e:null}setPreprocessHook(e){this.preprocessHook=e&&"function"==typeof e?e:null}setPostprocessHook(e){this.postprocessHook=e&&"function"==typeof e?e:null}setSendGeocoderRequestFunc(e){this.sendGeocoderRequestAlt=e&&"function"==typeof e?e:null}setSendPlaceDetailsRequestFunc(e){this.sendPlaceDetailsRequestAlt=e&&"function"==typeof e?e:null}isOpen(){return!!this.autocompleteItemsElement}close(){this.closeDropDownList()}open(){this.isOpen()||this.openDropdownAgain()}sendGeocoderRequest(e){return new Promise(((i,o)=>{this.currentPromiseReject=o;let a=this.generateUrl(e);fetch(a).then((e=>{e.ok?e.json().then((e=>i(e))):e.json().then((e=>o(e)))}))}))}sendPlaceDetailsRequest(e){return new Promise(((i,o)=>{if("openstreetmap"!==e.properties.datasource?.sourcename||!e.properties.place_id)return void i(e);this.currentPlaceDetailsPromiseReject=o;let a=this.generatePlacesUrlUrl(e.properties.place_id);fetch(a).then((a=>{a.ok?a.json().then((o=>{o.features.length||i(e),i(o.features[0])})):a.json().then((e=>o(e)))}))}))}onUserInput(e){let i=this.inputElement.value,o=this.inputElement.value;if(this.inputCallbacks.forEach((e=>e(i))),this.closeDropDownList(),this.focusedItemIndex=-1,this.currentPromiseReject&&(this.currentPromiseReject({canceled:!0}),this.currentPromiseReject=null),this.currentTimeout&&(window.clearTimeout(this.currentTimeout),this.currentTimeout=null),!i)return this.inputClearButton.classList.remove("visible"),!1;this.inputClearButton.classList.add("visible"),this.currentTimeout=window.setTimeout((()=>{let a;this.preprocessHook&&"function"==typeof this.preprocessHook&&(i=this.preprocessHook(i)),a=this.sendGeocoderRequestAlt?this.sendGeocoderRequestAlt(i,this):this.sendGeocoderRequest(i),a.then((i=>{i.features&&i.features.length&&i?.query?.parsed&&(this.options.allowNonVerifiedHouseNumber||this.options.allowNonVerifiedStreet)&&this.extendByNonVerifiedValues(i.features,i?.query?.parsed),this.currentItems=i.features,this.currentItems&&this.currentItems.length&&this.suggestionsFilter&&"function"==typeof this.suggestionsFilter&&(this.currentItems=this.suggestionsFilter(this.currentItems)),this.notifySuggestions(this.currentItems),this.currentItems.length&&(this.autocompleteItemsElement=document.createElement("div"),this.autocompleteItemsElement.setAttribute("class","geoapify-autocomplete-items"),this.notifyOpened(),this.container.appendChild(this.autocompleteItemsElement),this.currentItems.forEach(((i,a)=>{const t=document.createElement("div");if(t.classList.add("geoapify-autocomplete-item"),!this.options.skipIcons){const e=document.createElement("span");e.classList.add("icon"),this.addFeatureIcon(e,i.properties.result_type,i.properties.country_code),t.appendChild(e)}const n=document.createElement("span");if(n.classList.add("address"),this.postprocessHook&&"function"==typeof this.postprocessHook){const e=this.postprocessHook(i);n.innerHTML=this.getStyledAddressSingleValue(e,o)}else n.innerHTML=this.getStyledAddress(i.properties,o);t.appendChild(n),t.addEventListener("click",(i=>{e.stopPropagation(),this.setValueAndNotify(this.currentItems[a])})),this.autocompleteItemsElement.appendChild(t)})))}),(e=>{e.canceled||console.log(e)}))}),this.options.debounceDelay)}addHouseNumberToFormatted(e,i,o){const a={"{{{road}}} {{{house_number}}}":["af","ai","al","ao","ar","at","aw","ax","ba","be","bg","bi","bo","bq","br","bs","bt","bv","bw","cf","ch","cl","cm","co","cr","cu","cv","cw","cy","cz","de","dk","do","ec","ee","eh","er","et","fi","fo","gd","ge","gl","gq","gr","gt","gw","hn","hr","ht","hu","id","il","ir","is","jo","ki","km","kp","kw","lc","li","lr","lt","lv","ly","me","mk","ml","mn","mo","mx","ni","nl","no","np","pa","pe","pl","ps","pt","pw","py","qa","ro","rs","ru","sb","sd","se","si","sj","sk","so","sr","ss","st","sv","sx","sz","td","tj","tl","tr","um","uz","uy","vc","ve","vu","ws"],"{{{house_number}}} {{{road}}}":["ad","ae","ag","am","as","au","az","bb","bd","bf","bh","bl","bm","bz","ca","cc","ci","ck","cn","cx","dj","dm","dz","eg","fj","fk","fm","fr","ga","gb","gf","gg","gh","gi","gm","gn","gp","gs","gu","gy","hk","hm","ie","im","io","iq","je","jm","jp","ke","kh","kn","kr","ky","lb","lk","ls","lu","ma","mc","mf","mh","mg","mm","mp","ms","mt","mq","mv","mw","my","na","nc","ne","nf","ng","nr","nu","nz","om","pf","pg","ph","pk","pm","pr","re","rw","sa","sc","sg","sh","sl","sn","tc","tf","th","tk","tn","to","tt","tv","tw","tz","ug","us","vg","vi","wf","yt","za","zm","zw"],"{{{road}}}, {{{house_number}}}":["by","es","it","kg","kz","md","mz","sm","sy","ua","va"],"{{{house_number}}}, {{{road}}}":["bj","bn","cd","cg","in","la","mr","mu","tg","tm","vn","ye"]},t=Object.keys(a).find((i=>a[i].indexOf(e.country_code)>=0))||"{{{road}}} {{{house_number}}}";if(i){e.street=i.replace(/(^\w|\s\w|[-]\w)/g,(e=>e.toUpperCase())),e.housenumber=o;const a=t.replace("{{{road}}}",e.street).replace("{{{house_number}}}",o);e.address_line1=a,e.address_line2=e.formatted,e.formatted=a+", "+e.formatted}else{e.housenumber=o;const i=t.replace("{{{road}}}",e.street).replace("{{{house_number}}}",o);e.address_line1=e.address_line1.replace(e.street,i),e.formatted=e.formatted.replace(e.street,i)}}extendByNonVerifiedValues(e,i){e.forEach((e=>{i.housenumber&&this.options.allowNonVerifiedHouseNumber&&"match_by_street"===e.properties.rank.match_type?(this.addHouseNumberToFormatted(e.properties,null,i.housenumber),e.properties.nonVerifiedParts=["housenumber"]):i.street&&i.housenumber&&this.options.allowNonVerifiedStreet&&("match_by_city_or_disrict"===e.properties.rank.match_type||"match_by_postcode"===e.properties.rank.match_type)?(this.addHouseNumberToFormatted(e.properties,i.street,i.housenumber),e.properties.nonVerifiedParts=["housenumber","street"]):i.street&&this.options.allowNonVerifiedStreet&&("match_by_city_or_disrict"===e.properties.rank.match_type||"match_by_postcode"===e.properties.rank.match_type)&&(e.properties.street=i.street.replace(/(^\w|\s\w|[-]\w)/g,(e=>e.toUpperCase())),e.properties.address_line1=e.properties.street,e.properties.address_line2=e.properties.formatted,e.properties.formatted=e.properties.street+", "+e.properties.formatted,e.properties.nonVerifiedParts=["street"])}))}getStyledAddressSingleValue(e,i){let o=e;const a=(o||"").toLowerCase().indexOf(i.toLowerCase());return a>=0&&(o=o.substring(0,a)+`<strong>${o.substring(a,a+i.length)}</strong>`+o.substring(a+i.length)),`<span class="main-part">${o}</span>`}getStyledAddress(e,i){let o,a;const t=e.formatted.split(",").map((e=>e.trim()));if(e.name)o=t[0],a=t.slice(1).join(", ");else{const e=Math.min(2,Math.max(t.length-2,1));o=t.slice(0,e).join(", "),a=t.slice(e).join(", ")}if(e.nonVerifiedParts&&e.nonVerifiedParts.length)e.nonVerifiedParts.forEach((i=>{o=o.replace(e[i],`<span class="non-verified">${e[i]}</span>`)}));else{const e=o.toLowerCase().indexOf(i.toLowerCase());e>=0&&(o=o.substring(0,e)+`<strong>${o.substring(e,e+i.length)}</strong>`+o.substring(e+i.length))}return`<span class="main-part">${o}</span><span class="secondary-part">${a}</span>`}onUserKeyPress(e){if(this.autocompleteItemsElement){const i=this.autocompleteItemsElement.getElementsByTagName("div");"ArrowDown"===e.code?(e.preventDefault(),this.focusedItemIndex++,this.focusedItemIndex>=i.length&&(this.focusedItemIndex=0),this.setActive(i,this.focusedItemIndex)):"ArrowUp"===e.code?(e.preventDefault(),this.focusedItemIndex--,this.focusedItemIndex<0&&(this.focusedItemIndex=i.length-1),this.setActive(i,this.focusedItemIndex)):"Enter"===e.code?(e.preventDefault(),this.focusedItemIndex>-1&&(this.options.skipSelectionOnArrowKey?this.setValueAndNotify(this.currentItems[this.focusedItemIndex]):this.closeDropDownList())):"Escape"===e.code&&this.closeDropDownList()}else"ArrowDown"==e.code&&this.openDropdownAgain()}setActive(e,i){if(!e||!e.length)return!1;for(var o=0;o<e.length;o++)e[o].classList.remove("active");e[i].classList.add("active"),this.options.skipSelectionOnArrowKey||(this.inputElement.value=this.postprocessHook&&"function"==typeof this.postprocessHook?this.postprocessHook(this.currentItems[i]):this.currentItems[i].properties.formatted,this.notifyValueSelected(this.currentItems[i]))}setValueAndNotify(e){this.inputElement.value=this.postprocessHook&&"function"==typeof this.postprocessHook?this.postprocessHook(e):e.properties.formatted,this.notifyValueSelected(e),this.closeDropDownList()}clearFieldAndNotify(e){e.stopPropagation(),this.inputElement.value="",this.inputClearButton.classList.remove("visible"),this.currentPromiseReject&&(this.currentPromiseReject({canceled:!0}),this.currentPromiseReject=null),this.currentTimeout&&(window.clearTimeout(this.currentTimeout),this.currentTimeout=null),this.closeDropDownList(),this.notifyValueSelected(null)}closeDropDownList(){this.autocompleteItemsElement&&(this.container.removeChild(this.autocompleteItemsElement),this.autocompleteItemsElement=null,this.notifyClosed())}addIcon(e,i){const o={close:{path:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z",viewbox:"0 0 24 24"},"map-marker":{path:"M172.268 501.67C26.97 291.031 0 269.413 0 192 0 85.961 85.961 0 192 0s192 85.961 192 192c0 77.413-26.97 99.031-172.268 309.67-9.535 13.774-29.93 13.773-39.464 0zM192 272c44.183 0 80-35.817 80-80s-35.817-80-80-80-80 35.817-80 80 35.817 80 80 80z",viewbox:"0 0 384 512"},road:{path:"M573.19 402.67l-139.79-320C428.43 71.29 417.6 64 405.68 64h-97.59l2.45 23.16c.5 4.72-3.21 8.84-7.96 8.84h-29.16c-4.75 0-8.46-4.12-7.96-8.84L267.91 64h-97.59c-11.93 0-22.76 7.29-27.73 18.67L2.8 402.67C-6.45 423.86 8.31 448 30.54 448h196.84l10.31-97.68c.86-8.14 7.72-14.32 15.91-14.32h68.8c8.19 0 15.05 6.18 15.91 14.32L348.62 448h196.84c22.23 0 36.99-24.14 27.73-45.33zM260.4 135.16a8 8 0 0 1 7.96-7.16h39.29c4.09 0 7.53 3.09 7.96 7.16l4.6 43.58c.75 7.09-4.81 13.26-11.93 13.26h-40.54c-7.13 0-12.68-6.17-11.93-13.26l4.59-43.58zM315.64 304h-55.29c-9.5 0-16.91-8.23-15.91-17.68l5.07-48c.86-8.14 7.72-14.32 15.91-14.32h45.15c8.19 0 15.05 6.18 15.91 14.32l5.07 48c1 9.45-6.41 17.68-15.91 17.68z",viewbox:"0 0 576 512"},city:{path:"M616 192H480V24c0-13.26-10.74-24-24-24H312c-13.26 0-24 10.74-24 24v72h-64V16c0-8.84-7.16-16-16-16h-16c-8.84 0-16 7.16-16 16v80h-64V16c0-8.84-7.16-16-16-16H80c-8.84 0-16 7.16-16 16v80H24c-13.26 0-24 10.74-24 24v360c0 17.67 14.33 32 32 32h576c17.67 0 32-14.33 32-32V216c0-13.26-10.75-24-24-24zM128 404c0 6.63-5.37 12-12 12H76c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm0-96c0 6.63-5.37 12-12 12H76c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm0-96c0 6.63-5.37 12-12 12H76c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm128 192c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm0-96c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm0-96c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm160 96c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm0-96c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm0-96c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12V76c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm160 288c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm0-96c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40z",viewbox:"0 0 640 512"}};var a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttribute("viewBox",o[i].viewbox),a.setAttribute("height","24");var t=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttribute("d",o[i].path),t.setAttribute("fill","currentColor"),a.appendChild(t),e.appendChild(a)}addFeatureIcon(i,o,a){const t={unknown:"map-marker",amenity:"map-marker",building:"map-marker",street:"road",suburb:"city",district:"city",postcode:"city",city:"city",county:"city",state:"city"},n=e.find((e=>a&&e.code.toLowerCase()===a.toLowerCase()));if("country"===o&&n){i.classList.add("emoji");const e=document.createElement("span");e.innerText=n.emoji,i.appendChild(e)}else this.addIcon(i,t[o]?t[o]:"map-marker")}notifyValueSelected(e){if(this.currentPlaceDetailsPromiseReject&&(this.currentPlaceDetailsPromiseReject({canceled:!0}),this.currentPlaceDetailsPromiseReject=null),this.options.addDetails&&e&&!e.properties.nonVerifiedParts?.length){let i;i=this.sendPlaceDetailsRequestAlt?this.sendPlaceDetailsRequestAlt(e,this):this.sendPlaceDetailsRequest(e),i.then((e=>{this.changeCallbacks.forEach((i=>i(e))),this.currentPlaceDetailsPromiseReject=null}),(i=>{i.canceled||(console.log(i),this.changeCallbacks.forEach((i=>i(e))),this.currentPlaceDetailsPromiseReject=null)}))}else this.changeCallbacks.forEach((i=>i(e)))}notifySuggestions(e){this.suggestionsChangeCallbacks.forEach((i=>i(e)))}notifyOpened(){this.openCallbacks.forEach((e=>e(!0)))}notifyClosed(){this.closeCallbacks.forEach((e=>e(!1)))}openDropdownAgain(){const e=document.createEvent("Event");e.initEvent("input",!0,!0),this.inputElement.dispatchEvent(e)}generatePlacesUrlUrl(e){let i=`${this.placeDetailsUrl}?id=${e}&apiKey=${this.apiKey}`;return this.options.lang&&(i+=`&lang=${this.options.lang}`),i}generateUrl(e){let i=`${this.geocoderUrl}?text=${encodeURIComponent(e)}&apiKey=${this.apiKey}`;this.options.type&&(i+=`&type=${this.options.type}`),this.options.limit&&(i+=`&limit=${this.options.limit}`),this.options.lang&&(i+=`&lang=${this.options.lang}`);const o=[],a=this.options.filter[this.BY_COUNTRYCODE],t=this.options.filter[this.BY_CIRCLE],n=this.options.filter[this.BY_RECT],d=this.options.filter[this.BY_PLACE];a&&a.length&&o.push(`countrycode:${a.join(",").toLowerCase()}`),t&&this.isLatitude(t.lat)&&this.isLongitude(t.lon)&&t.radiusMeters>0&&o.push(`circle:${t.lon},${t.lat},${t.radiusMeters}`),n&&this.isLatitude(n.lat1)&&this.isLongitude(n.lon1)&&this.isLatitude(n.lat2)&&this.isLongitude(n.lon2)&&o.push(`rect:${n.lon1},${n.lat1},${n.lon2},${n.lat2}`),d&&o.push(`place:${d}`),i+=o.length?`&filter=${o.join("|")}`:"";const l=[],s=this.options.bias[this.BY_COUNTRYCODE],c=this.options.bias[this.BY_CIRCLE],r=this.options.bias[this.BY_RECT],F=this.options.bias[this.BY_PROXIMITY];return s&&s.length&&l.push(`countrycode:${s.join(",").toLowerCase()}`),c&&this.isLatitude(c.lat)&&this.isLongitude(c.lon)&&c.radiusMeters>0&&l.push(`circle:${c.lon},${c.lat},${c.radiusMeters}`),r&&this.isLatitude(r.lat1)&&this.isLongitude(r.lon1)&&this.isLatitude(r.lat2)&&this.isLongitude(r.lon2)&&l.push(`rect:${r.lon1},${r.lat1},${r.lon2},${r.lat2}`),F&&this.isLatitude(F.lat)&&this.isLongitude(F.lon)&&l.push(`proximity:${F.lon},${F.lat}`),i+=l.length?`&bias=${l.join("|")}`:"",i}isLatitude(e){return""!==e&&null!==e&&isFinite(e)&&Math.abs(e)<=90}isLongitude(e){return""!==e&&null!==e&&isFinite(e)&&Math.abs(e)<=180}}export{i as GeocoderAutocomplete};
//# sourceMappingURL=index.min.esm.js.map

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

!function(e,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i((e="undefined"!=typeof globalThis?globalThis:e||self).autocomplete={})}(this,(function(e){"use strict";var i=[{code:"AD",emoji:"🇦🇩",unicode:"U+1F1E6 U+1F1E9",name:"Andorra",title:"flag for Andorra",dialCode:"+376"},{code:"AE",emoji:"🇦🇪",unicode:"U+1F1E6 U+1F1EA",name:"United Arab Emirates",title:"flag for United Arab Emirates",dialCode:"+971"},{code:"AF",emoji:"🇦🇫",unicode:"U+1F1E6 U+1F1EB",name:"Afghanistan",title:"flag for Afghanistan",dialCode:"+93"},{code:"AG",emoji:"🇦🇬",unicode:"U+1F1E6 U+1F1EC",name:"Antigua and Barbuda",title:"flag for Antigua and Barbuda",dialCode:"+1268"},{code:"AI",emoji:"🇦🇮",unicode:"U+1F1E6 U+1F1EE",name:"Anguilla",title:"flag for Anguilla",dialCode:"+1 264"},{code:"AL",emoji:"🇦🇱",unicode:"U+1F1E6 U+1F1F1",name:"Albania",title:"flag for Albania",dialCode:"+355"},{code:"AM",emoji:"🇦🇲",unicode:"U+1F1E6 U+1F1F2",name:"Armenia",title:"flag for Armenia",dialCode:"+374"},{code:"AO",emoji:"🇦🇴",unicode:"U+1F1E6 U+1F1F4",name:"Angola",title:"flag for Angola",dialCode:"+244"},{code:"AQ",emoji:"🇦🇶",unicode:"U+1F1E6 U+1F1F6",name:"Antarctica",title:"flag for Antarctica",dialCode:null},{code:"AR",emoji:"🇦🇷",unicode:"U+1F1E6 U+1F1F7",name:"Argentina",title:"flag for Argentina",dialCode:"+54"},{code:"AS",emoji:"🇦🇸",unicode:"U+1F1E6 U+1F1F8",name:"American Samoa",title:"flag for American Samoa",dialCode:"+1 684"},{code:"AT",emoji:"🇦🇹",unicode:"U+1F1E6 U+1F1F9",name:"Austria",title:"flag for Austria",dialCode:"+43"},{code:"AU",emoji:"🇦🇺",unicode:"U+1F1E6 U+1F1FA",name:"Australia",title:"flag for Australia",dialCode:"+61"},{code:"AW",emoji:"🇦🇼",unicode:"U+1F1E6 U+1F1FC",name:"Aruba",title:"flag for Aruba",dialCode:"+297"},{code:"AX",emoji:"🇦🇽",unicode:"U+1F1E6 U+1F1FD",name:"Åland Islands",title:"flag for Åland Islands",dialCode:""},{code:"AZ",emoji:"🇦🇿",unicode:"U+1F1E6 U+1F1FF",name:"Azerbaijan",title:"flag for Azerbaijan",dialCode:"+994"},{code:"BA",emoji:"🇧🇦",unicode:"U+1F1E7 U+1F1E6",name:"Bosnia and Herzegovina",title:"flag for Bosnia and Herzegovina",dialCode:"+387"},{code:"BB",emoji:"🇧🇧",unicode:"U+1F1E7 U+1F1E7",name:"Barbados",title:"flag for Barbados",dialCode:"+1 246"},{code:"BD",emoji:"🇧🇩",unicode:"U+1F1E7 U+1F1E9",name:"Bangladesh",title:"flag for Bangladesh",dialCode:"+880"},{code:"BE",emoji:"🇧🇪",unicode:"U+1F1E7 U+1F1EA",name:"Belgium",title:"flag for Belgium",dialCode:"+32"},{code:"BF",emoji:"🇧🇫",unicode:"U+1F1E7 U+1F1EB",name:"Burkina Faso",title:"flag for Burkina Faso",dialCode:"+226"},{code:"BG",emoji:"🇧🇬",unicode:"U+1F1E7 U+1F1EC",name:"Bulgaria",title:"flag for Bulgaria",dialCode:"+359"},{code:"BH",emoji:"🇧🇭",unicode:"U+1F1E7 U+1F1ED",name:"Bahrain",title:"flag for Bahrain",dialCode:"+973"},{code:"BI",emoji:"🇧🇮",unicode:"U+1F1E7 U+1F1EE",name:"Burundi",title:"flag for Burundi",dialCode:"+257"},{code:"BJ",emoji:"🇧🇯",unicode:"U+1F1E7 U+1F1EF",name:"Benin",title:"flag for Benin",dialCode:"+229"},{code:"BL",emoji:"🇧🇱",unicode:"U+1F1E7 U+1F1F1",name:"Saint Barthélemy",title:"flag for Saint Barthélemy",dialCode:"+590"},{code:"BM",emoji:"🇧🇲",unicode:"U+1F1E7 U+1F1F2",name:"Bermuda",title:"flag for Bermuda",dialCode:"+1 441"},{code:"BN",emoji:"🇧🇳",unicode:"U+1F1E7 U+1F1F3",name:"Brunei Darussalam",title:"flag for Brunei Darussalam",dialCode:"+673"},{code:"BO",emoji:"🇧🇴",unicode:"U+1F1E7 U+1F1F4",name:"Bolivia",title:"flag for Bolivia",dialCode:"+591"},{code:"BQ",emoji:"🇧🇶",unicode:"U+1F1E7 U+1F1F6",name:"Bonaire, Sint Eustatius and Saba",title:"flag for Bonaire, Sint Eustatius and Saba"},{code:"BR",emoji:"🇧🇷",unicode:"U+1F1E7 U+1F1F7",name:"Brazil",title:"flag for Brazil",dialCode:"+55"},{code:"BS",emoji:"🇧🇸",unicode:"U+1F1E7 U+1F1F8",name:"Bahamas",title:"flag for Bahamas",dialCode:"+1 242"},{code:"BT",emoji:"🇧🇹",unicode:"U+1F1E7 U+1F1F9",name:"Bhutan",title:"flag for Bhutan",dialCode:"+975"},{code:"BV",emoji:"🇧🇻",unicode:"U+1F1E7 U+1F1FB",name:"Bouvet Island",title:"flag for Bouvet Island"},{code:"BW",emoji:"🇧🇼",unicode:"U+1F1E7 U+1F1FC",name:"Botswana",title:"flag for Botswana",dialCode:"+267"},{code:"BY",emoji:"🇧🇾",unicode:"U+1F1E7 U+1F1FE",name:"Belarus",title:"flag for Belarus",dialCode:"+375"},{code:"BZ",emoji:"🇧🇿",unicode:"U+1F1E7 U+1F1FF",name:"Belize",title:"flag for Belize",dialCode:"+501"},{code:"CA",emoji:"🇨🇦",unicode:"U+1F1E8 U+1F1E6",name:"Canada",title:"flag for Canada",dialCode:"+1"},{code:"CC",emoji:"🇨🇨",unicode:"U+1F1E8 U+1F1E8",name:"Cocos (Keeling) Islands",title:"flag for Cocos (Keeling) Islands",dialCode:"+61"},{code:"CD",emoji:"🇨🇩",unicode:"U+1F1E8 U+1F1E9",name:"Congo",title:"flag for Congo",dialCode:"+243"},{code:"CF",emoji:"🇨🇫",unicode:"U+1F1E8 U+1F1EB",name:"Central African Republic",title:"flag for Central African Republic",dialCode:"+236"},{code:"CG",emoji:"🇨🇬",unicode:"U+1F1E8 U+1F1EC",name:"Congo",title:"flag for Congo",dialCode:"+242"},{code:"CH",emoji:"🇨🇭",unicode:"U+1F1E8 U+1F1ED",name:"Switzerland",title:"flag for Switzerland",dialCode:"+41"},{code:"CI",emoji:"🇨🇮",unicode:"U+1F1E8 U+1F1EE",name:"Côte D'Ivoire",title:"flag for Côte D'Ivoire",dialCode:"+225"},{code:"CK",emoji:"🇨🇰",unicode:"U+1F1E8 U+1F1F0",name:"Cook Islands",title:"flag for Cook Islands",dialCode:"+682"},{code:"CL",emoji:"🇨🇱",unicode:"U+1F1E8 U+1F1F1",name:"Chile",title:"flag for Chile",dialCode:"+56"},{code:"CM",emoji:"🇨🇲",unicode:"U+1F1E8 U+1F1F2",name:"Cameroon",title:"flag for Cameroon",dialCode:"+237"},{code:"CN",emoji:"🇨🇳",unicode:"U+1F1E8 U+1F1F3",name:"China",title:"flag for China",dialCode:"+86"},{code:"CO",emoji:"🇨🇴",unicode:"U+1F1E8 U+1F1F4",name:"Colombia",title:"flag for Colombia",dialCode:"+57"},{code:"CR",emoji:"🇨🇷",unicode:"U+1F1E8 U+1F1F7",name:"Costa Rica",title:"flag for Costa Rica",dialCode:"+506"},{code:"CU",emoji:"🇨🇺",unicode:"U+1F1E8 U+1F1FA",name:"Cuba",title:"flag for Cuba",dialCode:"+53"},{code:"CV",emoji:"🇨🇻",unicode:"U+1F1E8 U+1F1FB",name:"Cape Verde",title:"flag for Cape Verde",dialCode:"+238"},{code:"CW",emoji:"🇨🇼",unicode:"U+1F1E8 U+1F1FC",name:"Curaçao",title:"flag for Curaçao"},{code:"CX",emoji:"🇨🇽",unicode:"U+1F1E8 U+1F1FD",name:"Christmas Island",title:"flag for Christmas Island",dialCode:"+61"},{code:"CY",emoji:"🇨🇾",unicode:"U+1F1E8 U+1F1FE",name:"Cyprus",title:"flag for Cyprus",dialCode:"+537"},{code:"CZ",emoji:"🇨🇿",unicode:"U+1F1E8 U+1F1FF",name:"Czech Republic",title:"flag for Czech Republic",dialCode:"+420"},{code:"DE",emoji:"🇩🇪",unicode:"U+1F1E9 U+1F1EA",name:"Germany",title:"flag for Germany",dialCode:"+49"},{code:"DJ",emoji:"🇩🇯",unicode:"U+1F1E9 U+1F1EF",name:"Djibouti",title:"flag for Djibouti",dialCode:"+253"},{code:"DK",emoji:"🇩🇰",unicode:"U+1F1E9 U+1F1F0",name:"Denmark",title:"flag for Denmark",dialCode:"+45"},{code:"DM",emoji:"🇩🇲",unicode:"U+1F1E9 U+1F1F2",name:"Dominica",title:"flag for Dominica",dialCode:"+1 767"},{code:"DO",emoji:"🇩🇴",unicode:"U+1F1E9 U+1F1F4",name:"Dominican Republic",title:"flag for Dominican Republic",dialCode:"+1 849"},{code:"DZ",emoji:"🇩🇿",unicode:"U+1F1E9 U+1F1FF",name:"Algeria",title:"flag for Algeria",dialCode:"+213"},{code:"EC",emoji:"🇪🇨",unicode:"U+1F1EA U+1F1E8",name:"Ecuador",title:"flag for Ecuador",dialCode:"+593"},{code:"EE",emoji:"🇪🇪",unicode:"U+1F1EA U+1F1EA",name:"Estonia",title:"flag for Estonia",dialCode:"+372"},{code:"EG",emoji:"🇪🇬",unicode:"U+1F1EA U+1F1EC",name:"Egypt",title:"flag for Egypt",dialCode:"+20"},{code:"EH",emoji:"🇪🇭",unicode:"U+1F1EA U+1F1ED",name:"Western Sahara",title:"flag for Western Sahara"},{code:"ER",emoji:"🇪🇷",unicode:"U+1F1EA U+1F1F7",name:"Eritrea",title:"flag for Eritrea",dialCode:"+291"},{code:"ES",emoji:"🇪🇸",unicode:"U+1F1EA U+1F1F8",name:"Spain",title:"flag for Spain",dialCode:"+34"},{code:"ET",emoji:"🇪🇹",unicode:"U+1F1EA U+1F1F9",name:"Ethiopia",title:"flag for Ethiopia",dialCode:"+251"},{code:"EU",emoji:"🇪🇺",unicode:"U+1F1EA U+1F1FA",name:"European Union",title:"flag for European Union"},{code:"FI",emoji:"🇫🇮",unicode:"U+1F1EB U+1F1EE",name:"Finland",title:"flag for Finland",dialCode:"+358"},{code:"FJ",emoji:"🇫🇯",unicode:"U+1F1EB U+1F1EF",name:"Fiji",title:"flag for Fiji",dialCode:"+679"},{code:"FK",emoji:"🇫🇰",unicode:"U+1F1EB U+1F1F0",name:"Falkland Islands (Malvinas)",title:"flag for Falkland Islands (Malvinas)",dialCode:"+500"},{code:"FM",emoji:"🇫🇲",unicode:"U+1F1EB U+1F1F2",name:"Micronesia",title:"flag for Micronesia",dialCode:"+691"},{code:"FO",emoji:"🇫🇴",unicode:"U+1F1EB U+1F1F4",name:"Faroe Islands",title:"flag for Faroe Islands",dialCode:"+298"},{code:"FR",emoji:"🇫🇷",unicode:"U+1F1EB U+1F1F7",name:"France",title:"flag for France",dialCode:"+33"},{code:"GA",emoji:"🇬🇦",unicode:"U+1F1EC U+1F1E6",name:"Gabon",title:"flag for Gabon",dialCode:"+241"},{code:"GB",emoji:"🇬🇧",unicode:"U+1F1EC U+1F1E7",name:"United Kingdom",title:"flag for United Kingdom",dialCode:"+44"},{code:"GD",emoji:"🇬🇩",unicode:"U+1F1EC U+1F1E9",name:"Grenada",title:"flag for Grenada",dialCode:"+1 473"},{code:"GE",emoji:"🇬🇪",unicode:"U+1F1EC U+1F1EA",name:"Georgia",title:"flag for Georgia",dialCode:"+995"},{code:"GF",emoji:"🇬🇫",unicode:"U+1F1EC U+1F1EB",name:"French Guiana",title:"flag for French Guiana",dialCode:"+594"},{code:"GG",emoji:"🇬🇬",unicode:"U+1F1EC U+1F1EC",name:"Guernsey",title:"flag for Guernsey",dialCode:"+44"},{code:"GH",emoji:"🇬🇭",unicode:"U+1F1EC U+1F1ED",name:"Ghana",title:"flag for Ghana",dialCode:"+233"},{code:"GI",emoji:"🇬🇮",unicode:"U+1F1EC U+1F1EE",name:"Gibraltar",title:"flag for Gibraltar",dialCode:"+350"},{code:"GL",emoji:"🇬🇱",unicode:"U+1F1EC U+1F1F1",name:"Greenland",title:"flag for Greenland",dialCode:"+299"},{code:"GM",emoji:"🇬🇲",unicode:"U+1F1EC U+1F1F2",name:"Gambia",title:"flag for Gambia",dialCode:"+220"},{code:"GN",emoji:"🇬🇳",unicode:"U+1F1EC U+1F1F3",name:"Guinea",title:"flag for Guinea",dialCode:"+224"},{code:"GP",emoji:"🇬🇵",unicode:"U+1F1EC U+1F1F5",name:"Guadeloupe",title:"flag for Guadeloupe",dialCode:"+590"},{code:"GQ",emoji:"🇬🇶",unicode:"U+1F1EC U+1F1F6",name:"Equatorial Guinea",title:"flag for Equatorial Guinea",dialCode:"+240"},{code:"GR",emoji:"🇬🇷",unicode:"U+1F1EC U+1F1F7",name:"Greece",title:"flag for Greece",dialCode:"+30"},{code:"GS",emoji:"🇬🇸",unicode:"U+1F1EC U+1F1F8",name:"South Georgia",title:"flag for South Georgia",dialCode:"+500"},{code:"GT",emoji:"🇬🇹",unicode:"U+1F1EC U+1F1F9",name:"Guatemala",title:"flag for Guatemala",dialCode:"+502"},{code:"GU",emoji:"🇬🇺",unicode:"U+1F1EC U+1F1FA",name:"Guam",title:"flag for Guam",dialCode:"+1 671"},{code:"GW",emoji:"🇬🇼",unicode:"U+1F1EC U+1F1FC",name:"Guinea-Bissau",title:"flag for Guinea-Bissau",dialCode:"+245"},{code:"GY",emoji:"🇬🇾",unicode:"U+1F1EC U+1F1FE",name:"Guyana",title:"flag for Guyana",dialCode:"+595"},{code:"HK",emoji:"🇭🇰",unicode:"U+1F1ED U+1F1F0",name:"Hong Kong",title:"flag for Hong Kong",dialCode:"+852"},{code:"HM",emoji:"🇭🇲",unicode:"U+1F1ED U+1F1F2",name:"Heard Island and Mcdonald Islands",title:"flag for Heard Island and Mcdonald Islands"},{code:"HN",emoji:"🇭🇳",unicode:"U+1F1ED U+1F1F3",name:"Honduras",title:"flag for Honduras",dialCode:"+504"},{code:"HR",emoji:"🇭🇷",unicode:"U+1F1ED U+1F1F7",name:"Croatia",title:"flag for Croatia",dialCode:"+385"},{code:"HT",emoji:"🇭🇹",unicode:"U+1F1ED U+1F1F9",name:"Haiti",title:"flag for Haiti",dialCode:"+509"},{code:"HU",emoji:"🇭🇺",unicode:"U+1F1ED U+1F1FA",name:"Hungary",title:"flag for Hungary",dialCode:"+36"},{code:"ID",emoji:"🇮🇩",unicode:"U+1F1EE U+1F1E9",name:"Indonesia",title:"flag for Indonesia",dialCode:"+62"},{code:"IE",emoji:"🇮🇪",unicode:"U+1F1EE U+1F1EA",name:"Ireland",title:"flag for Ireland",dialCode:"+353"},{code:"IL",emoji:"🇮🇱",unicode:"U+1F1EE U+1F1F1",name:"Israel",title:"flag for Israel",dialCode:"+972"},{code:"IM",emoji:"🇮🇲",unicode:"U+1F1EE U+1F1F2",name:"Isle of Man",title:"flag for Isle of Man",dialCode:"+44"},{code:"IN",emoji:"🇮🇳",unicode:"U+1F1EE U+1F1F3",name:"India",title:"flag for India",dialCode:"+91"},{code:"IO",emoji:"🇮🇴",unicode:"U+1F1EE U+1F1F4",name:"British Indian Ocean Territory",title:"flag for British Indian Ocean Territory",dialCode:"+246"},{code:"IQ",emoji:"🇮🇶",unicode:"U+1F1EE U+1F1F6",name:"Iraq",title:"flag for Iraq",dialCode:"+964"},{code:"IR",emoji:"🇮🇷",unicode:"U+1F1EE U+1F1F7",name:"Iran",title:"flag for Iran",dialCode:"+98"},{code:"IS",emoji:"🇮🇸",unicode:"U+1F1EE U+1F1F8",name:"Iceland",title:"flag for Iceland",dialCode:"+354"},{code:"IT",emoji:"🇮🇹",unicode:"U+1F1EE U+1F1F9",name:"Italy",title:"flag for Italy",dialCode:"+39"},{code:"JE",emoji:"🇯🇪",unicode:"U+1F1EF U+1F1EA",name:"Jersey",title:"flag for Jersey",dialCode:"+44"},{code:"JM",emoji:"🇯🇲",unicode:"U+1F1EF U+1F1F2",name:"Jamaica",title:"flag for Jamaica",dialCode:"+1 876"},{code:"JO",emoji:"🇯🇴",unicode:"U+1F1EF U+1F1F4",name:"Jordan",title:"flag for Jordan",dialCode:"+962"},{code:"JP",emoji:"🇯🇵",unicode:"U+1F1EF U+1F1F5",name:"Japan",title:"flag for Japan",dialCode:"+81"},{code:"KE",emoji:"🇰🇪",unicode:"U+1F1F0 U+1F1EA",name:"Kenya",title:"flag for Kenya",dialCode:"+254"},{code:"KG",emoji:"🇰🇬",unicode:"U+1F1F0 U+1F1EC",name:"Kyrgyzstan",title:"flag for Kyrgyzstan",dialCode:"+996"},{code:"KH",emoji:"🇰🇭",unicode:"U+1F1F0 U+1F1ED",name:"Cambodia",title:"flag for Cambodia",dialCode:"+855"},{code:"KI",emoji:"🇰🇮",unicode:"U+1F1F0 U+1F1EE",name:"Kiribati",title:"flag for Kiribati",dialCode:"+686"},{code:"KM",emoji:"🇰🇲",unicode:"U+1F1F0 U+1F1F2",name:"Comoros",title:"flag for Comoros",dialCode:"+269"},{code:"KN",emoji:"🇰🇳",unicode:"U+1F1F0 U+1F1F3",name:"Saint Kitts and Nevis",title:"flag for Saint Kitts and Nevis",dialCode:"+1 869"},{code:"KP",emoji:"🇰🇵",unicode:"U+1F1F0 U+1F1F5",name:"North Korea",title:"flag for North Korea",dialCode:"+850"},{code:"KR",emoji:"🇰🇷",unicode:"U+1F1F0 U+1F1F7",name:"South Korea",title:"flag for South Korea",dialCode:"+82"},{code:"KW",emoji:"🇰🇼",unicode:"U+1F1F0 U+1F1FC",name:"Kuwait",title:"flag for Kuwait",dialCode:"+965"},{code:"KY",emoji:"🇰🇾",unicode:"U+1F1F0 U+1F1FE",name:"Cayman Islands",title:"flag for Cayman Islands",dialCode:"+ 345"},{code:"KZ",emoji:"🇰🇿",unicode:"U+1F1F0 U+1F1FF",name:"Kazakhstan",title:"flag for Kazakhstan",dialCode:"+7 7"},{code:"LA",emoji:"🇱🇦",unicode:"U+1F1F1 U+1F1E6",name:"Lao People's Democratic Republic",title:"flag for Lao People's Democratic Republic",dialCode:"+856"},{code:"LB",emoji:"🇱🇧",unicode:"U+1F1F1 U+1F1E7",name:"Lebanon",title:"flag for Lebanon",dialCode:"+961"},{code:"LC",emoji:"🇱🇨",unicode:"U+1F1F1 U+1F1E8",name:"Saint Lucia",title:"flag for Saint Lucia",dialCode:"+1 758"},{code:"LI",emoji:"🇱🇮",unicode:"U+1F1F1 U+1F1EE",name:"Liechtenstein",title:"flag for Liechtenstein",dialCode:"+423"},{code:"LK",emoji:"🇱🇰",unicode:"U+1F1F1 U+1F1F0",name:"Sri Lanka",title:"flag for Sri Lanka",dialCode:"+94"},{code:"LR",emoji:"🇱🇷",unicode:"U+1F1F1 U+1F1F7",name:"Liberia",title:"flag for Liberia",dialCode:"+231"},{code:"LS",emoji:"🇱🇸",unicode:"U+1F1F1 U+1F1F8",name:"Lesotho",title:"flag for Lesotho",dialCode:"+266"},{code:"LT",emoji:"🇱🇹",unicode:"U+1F1F1 U+1F1F9",name:"Lithuania",title:"flag for Lithuania",dialCode:"+370"},{code:"LU",emoji:"🇱🇺",unicode:"U+1F1F1 U+1F1FA",name:"Luxembourg",title:"flag for Luxembourg",dialCode:"+352"},{code:"LV",emoji:"🇱🇻",unicode:"U+1F1F1 U+1F1FB",name:"Latvia",title:"flag for Latvia",dialCode:"+371"},{code:"LY",emoji:"🇱🇾",unicode:"U+1F1F1 U+1F1FE",name:"Libya",title:"flag for Libya",dialCode:"+218"},{code:"MA",emoji:"🇲🇦",unicode:"U+1F1F2 U+1F1E6",name:"Morocco",title:"flag for Morocco",dialCode:"+212"},{code:"MC",emoji:"🇲🇨",unicode:"U+1F1F2 U+1F1E8",name:"Monaco",title:"flag for Monaco",dialCode:"+377"},{code:"MD",emoji:"🇲🇩",unicode:"U+1F1F2 U+1F1E9",name:"Moldova",title:"flag for Moldova",dialCode:"+373"},{code:"ME",emoji:"🇲🇪",unicode:"U+1F1F2 U+1F1EA",name:"Montenegro",title:"flag for Montenegro",dialCode:"+382"},{code:"MF",emoji:"🇲🇫",unicode:"U+1F1F2 U+1F1EB",name:"Saint Martin (French Part)",title:"flag for Saint Martin (French Part)",dialCode:"+590"},{code:"MG",emoji:"🇲🇬",unicode:"U+1F1F2 U+1F1EC",name:"Madagascar",title:"flag for Madagascar",dialCode:"+261"},{code:"MH",emoji:"🇲🇭",unicode:"U+1F1F2 U+1F1ED",name:"Marshall Islands",title:"flag for Marshall Islands",dialCode:"+692"},{code:"MK",emoji:"🇲🇰",unicode:"U+1F1F2 U+1F1F0",name:"Macedonia",title:"flag for Macedonia",dialCode:"+389"},{code:"ML",emoji:"🇲🇱",unicode:"U+1F1F2 U+1F1F1",name:"Mali",title:"flag for Mali",dialCode:"+223"},{code:"MM",emoji:"🇲🇲",unicode:"U+1F1F2 U+1F1F2",name:"Myanmar",title:"flag for Myanmar",dialCode:"+95"},{code:"MN",emoji:"🇲🇳",unicode:"U+1F1F2 U+1F1F3",name:"Mongolia",title:"flag for Mongolia",dialCode:"+976"},{code:"MO",emoji:"🇲🇴",unicode:"U+1F1F2 U+1F1F4",name:"Macao",title:"flag for Macao",dialCode:"+853"},{code:"MP",emoji:"🇲🇵",unicode:"U+1F1F2 U+1F1F5",name:"Northern Mariana Islands",title:"flag for Northern Mariana Islands",dialCode:"+1 670"},{code:"MQ",emoji:"🇲🇶",unicode:"U+1F1F2 U+1F1F6",name:"Martinique",title:"flag for Martinique",dialCode:"+596"},{code:"MR",emoji:"🇲🇷",unicode:"U+1F1F2 U+1F1F7",name:"Mauritania",title:"flag for Mauritania",dialCode:"+222"},{code:"MS",emoji:"🇲🇸",unicode:"U+1F1F2 U+1F1F8",name:"Montserrat",title:"flag for Montserrat",dialCode:"+1664"},{code:"MT",emoji:"🇲🇹",unicode:"U+1F1F2 U+1F1F9",name:"Malta",title:"flag for Malta",dialCode:"+356"},{code:"MU",emoji:"🇲🇺",unicode:"U+1F1F2 U+1F1FA",name:"Mauritius",title:"flag for Mauritius",dialCode:"+230"},{code:"MV",emoji:"🇲🇻",unicode:"U+1F1F2 U+1F1FB",name:"Maldives",title:"flag for Maldives",dialCode:"+960"},{code:"MW",emoji:"🇲🇼",unicode:"U+1F1F2 U+1F1FC",name:"Malawi",title:"flag for Malawi",dialCode:"+265"},{code:"MX",emoji:"🇲🇽",unicode:"U+1F1F2 U+1F1FD",name:"Mexico",title:"flag for Mexico",dialCode:"+52"},{code:"MY",emoji:"🇲🇾",unicode:"U+1F1F2 U+1F1FE",name:"Malaysia",title:"flag for Malaysia",dialCode:"+60"},{code:"MZ",emoji:"🇲🇿",unicode:"U+1F1F2 U+1F1FF",name:"Mozambique",title:"flag for Mozambique",dialCode:"+258"},{code:"NA",emoji:"🇳🇦",unicode:"U+1F1F3 U+1F1E6",name:"Namibia",title:"flag for Namibia",dialCode:"+264"},{code:"NC",emoji:"🇳🇨",unicode:"U+1F1F3 U+1F1E8",name:"New Caledonia",title:"flag for New Caledonia",dialCode:"+687"},{code:"NE",emoji:"🇳🇪",unicode:"U+1F1F3 U+1F1EA",name:"Niger",title:"flag for Niger",dialCode:"+227"},{code:"NF",emoji:"🇳🇫",unicode:"U+1F1F3 U+1F1EB",name:"Norfolk Island",title:"flag for Norfolk Island",dialCode:"+672"},{code:"NG",emoji:"🇳🇬",unicode:"U+1F1F3 U+1F1EC",name:"Nigeria",title:"flag for Nigeria",dialCode:"+234"},{code:"NI",emoji:"🇳🇮",unicode:"U+1F1F3 U+1F1EE",name:"Nicaragua",title:"flag for Nicaragua",dialCode:"+505"},{code:"NL",emoji:"🇳🇱",unicode:"U+1F1F3 U+1F1F1",name:"Netherlands",title:"flag for Netherlands",dialCode:"+31"},{code:"NO",emoji:"🇳🇴",unicode:"U+1F1F3 U+1F1F4",name:"Norway",title:"flag for Norway",dialCode:"+47"},{code:"NP",emoji:"🇳🇵",unicode:"U+1F1F3 U+1F1F5",name:"Nepal",title:"flag for Nepal",dialCode:"+977"},{code:"NR",emoji:"🇳🇷",unicode:"U+1F1F3 U+1F1F7",name:"Nauru",title:"flag for Nauru",dialCode:"+674"},{code:"NU",emoji:"🇳🇺",unicode:"U+1F1F3 U+1F1FA",name:"Niue",title:"flag for Niue",dialCode:"+683"},{code:"NZ",emoji:"🇳🇿",unicode:"U+1F1F3 U+1F1FF",name:"New Zealand",title:"flag for New Zealand",dialCode:"+64"},{code:"OM",emoji:"🇴🇲",unicode:"U+1F1F4 U+1F1F2",name:"Oman",title:"flag for Oman",dialCode:"+968"},{code:"PA",emoji:"🇵🇦",unicode:"U+1F1F5 U+1F1E6",name:"Panama",title:"flag for Panama",dialCode:"+507"},{code:"PE",emoji:"🇵🇪",unicode:"U+1F1F5 U+1F1EA",name:"Peru",title:"flag for Peru",dialCode:"+51"},{code:"PF",emoji:"🇵🇫",unicode:"U+1F1F5 U+1F1EB",name:"French Polynesia",title:"flag for French Polynesia",dialCode:"+689"},{code:"PG",emoji:"🇵🇬",unicode:"U+1F1F5 U+1F1EC",name:"Papua New Guinea",title:"flag for Papua New Guinea",dialCode:"+675"},{code:"PH",emoji:"🇵🇭",unicode:"U+1F1F5 U+1F1ED",name:"Philippines",title:"flag for Philippines",dialCode:"+63"},{code:"PK",emoji:"🇵🇰",unicode:"U+1F1F5 U+1F1F0",name:"Pakistan",title:"flag for Pakistan",dialCode:"+92"},{code:"PL",emoji:"🇵🇱",unicode:"U+1F1F5 U+1F1F1",name:"Poland",title:"flag for Poland",dialCode:"+48"},{code:"PM",emoji:"🇵🇲",unicode:"U+1F1F5 U+1F1F2",name:"Saint Pierre and Miquelon",title:"flag for Saint Pierre and Miquelon",dialCode:"+508"},{code:"PN",emoji:"🇵🇳",unicode:"U+1F1F5 U+1F1F3",name:"Pitcairn",title:"flag for Pitcairn",dialCode:"+872"},{code:"PR",emoji:"🇵🇷",unicode:"U+1F1F5 U+1F1F7",name:"Puerto Rico",title:"flag for Puerto Rico",dialCode:"+1 939"},{code:"PS",emoji:"🇵🇸",unicode:"U+1F1F5 U+1F1F8",name:"Palestinian Territory",title:"flag for Palestinian Territory",dialCode:"+970"},{code:"PT",emoji:"🇵🇹",unicode:"U+1F1F5 U+1F1F9",name:"Portugal",title:"flag for Portugal",dialCode:"+351"},{code:"PW",emoji:"🇵🇼",unicode:"U+1F1F5 U+1F1FC",name:"Palau",title:"flag for Palau",dialCode:"+680"},{code:"PY",emoji:"🇵🇾",unicode:"U+1F1F5 U+1F1FE",name:"Paraguay",title:"flag for Paraguay",dialCode:"+595"},{code:"QA",emoji:"🇶🇦",unicode:"U+1F1F6 U+1F1E6",name:"Qatar",title:"flag for Qatar",dialCode:"+974"},{code:"RE",emoji:"🇷🇪",unicode:"U+1F1F7 U+1F1EA",name:"Réunion",title:"flag for Réunion",dialCode:"+262"},{code:"RO",emoji:"🇷🇴",unicode:"U+1F1F7 U+1F1F4",name:"Romania",title:"flag for Romania",dialCode:"+40"},{code:"RS",emoji:"🇷🇸",unicode:"U+1F1F7 U+1F1F8",name:"Serbia",title:"flag for Serbia",dialCode:"+381"},{code:"RU",emoji:"🇷🇺",unicode:"U+1F1F7 U+1F1FA",name:"Russia",title:"flag for Russia",dialCode:"+7"},{code:"RW",emoji:"🇷🇼",unicode:"U+1F1F7 U+1F1FC",name:"Rwanda",title:"flag for Rwanda",dialCode:"+250"},{code:"SA",emoji:"🇸🇦",unicode:"U+1F1F8 U+1F1E6",name:"Saudi Arabia",title:"flag for Saudi Arabia",dialCode:"+966"},{code:"SB",emoji:"🇸🇧",unicode:"U+1F1F8 U+1F1E7",name:"Solomon Islands",title:"flag for Solomon Islands",dialCode:"+677"},{code:"SC",emoji:"🇸🇨",unicode:"U+1F1F8 U+1F1E8",name:"Seychelles",title:"flag for Seychelles",dialCode:"+248"},{code:"SD",emoji:"🇸🇩",unicode:"U+1F1F8 U+1F1E9",name:"Sudan",title:"flag for Sudan",dialCode:"+249"},{code:"SE",emoji:"🇸🇪",unicode:"U+1F1F8 U+1F1EA",name:"Sweden",title:"flag for Sweden",dialCode:"+46"},{code:"SG",emoji:"🇸🇬",unicode:"U+1F1F8 U+1F1EC",name:"Singapore",title:"flag for Singapore",dialCode:"+65"},{code:"SH",emoji:"🇸🇭",unicode:"U+1F1F8 U+1F1ED",name:"Saint Helena, Ascension and Tristan Da Cunha",title:"flag for Saint Helena, Ascension and Tristan Da Cunha",dialCode:"+290"},{code:"SI",emoji:"🇸🇮",unicode:"U+1F1F8 U+1F1EE",name:"Slovenia",title:"flag for Slovenia",dialCode:"+386"},{code:"SJ",emoji:"🇸🇯",unicode:"U+1F1F8 U+1F1EF",name:"Svalbard and Jan Mayen",title:"flag for Svalbard and Jan Mayen",dialCode:"+47"},{code:"SK",emoji:"🇸🇰",unicode:"U+1F1F8 U+1F1F0",name:"Slovakia",title:"flag for Slovakia",dialCode:"+421"},{code:"SL",emoji:"🇸🇱",unicode:"U+1F1F8 U+1F1F1",name:"Sierra Leone",title:"flag for Sierra Leone",dialCode:"+232"},{code:"SM",emoji:"🇸🇲",unicode:"U+1F1F8 U+1F1F2",name:"San Marino",title:"flag for San Marino",dialCode:"+378"},{code:"SN",emoji:"🇸🇳",unicode:"U+1F1F8 U+1F1F3",name:"Senegal",title:"flag for Senegal",dialCode:"+221"},{code:"SO",emoji:"🇸🇴",unicode:"U+1F1F8 U+1F1F4",name:"Somalia",title:"flag for Somalia",dialCode:"+252"},{code:"SR",emoji:"🇸🇷",unicode:"U+1F1F8 U+1F1F7",name:"Suriname",title:"flag for Suriname",dialCode:"+597"},{code:"SS",emoji:"🇸🇸",unicode:"U+1F1F8 U+1F1F8",name:"South Sudan",title:"flag for South Sudan"},{code:"ST",emoji:"🇸🇹",unicode:"U+1F1F8 U+1F1F9",name:"Sao Tome and Principe",title:"flag for Sao Tome and Principe",dialCode:"+239"},{code:"SV",emoji:"🇸🇻",unicode:"U+1F1F8 U+1F1FB",name:"El Salvador",title:"flag for El Salvador",dialCode:"+503"},{code:"SX",emoji:"🇸🇽",unicode:"U+1F1F8 U+1F1FD",name:"Sint Maarten (Dutch Part)",title:"flag for Sint Maarten (Dutch Part)"},{code:"SY",emoji:"🇸🇾",unicode:"U+1F1F8 U+1F1FE",name:"Syrian Arab Republic",title:"flag for Syrian Arab Republic",dialCode:"+963"},{code:"SZ",emoji:"🇸🇿",unicode:"U+1F1F8 U+1F1FF",name:"Swaziland",title:"flag for Swaziland",dialCode:"+268"},{code:"TC",emoji:"🇹🇨",unicode:"U+1F1F9 U+1F1E8",name:"Turks and Caicos Islands",title:"flag for Turks and Caicos Islands",dialCode:"+1 649"},{code:"TD",emoji:"🇹🇩",unicode:"U+1F1F9 U+1F1E9",name:"Chad",title:"flag for Chad",dialCode:"+235"},{code:"TF",emoji:"🇹🇫",unicode:"U+1F1F9 U+1F1EB",name:"French Southern Territories",title:"flag for French Southern Territories"},{code:"TG",emoji:"🇹🇬",unicode:"U+1F1F9 U+1F1EC",name:"Togo",title:"flag for Togo",dialCode:"+228"},{code:"TH",emoji:"🇹🇭",unicode:"U+1F1F9 U+1F1ED",name:"Thailand",title:"flag for Thailand",dialCode:"+66"},{code:"TJ",emoji:"🇹🇯",unicode:"U+1F1F9 U+1F1EF",name:"Tajikistan",title:"flag for Tajikistan",dialCode:"+992"},{code:"TK",emoji:"🇹🇰",unicode:"U+1F1F9 U+1F1F0",name:"Tokelau",title:"flag for Tokelau",dialCode:"+690"},{code:"TL",emoji:"🇹🇱",unicode:"U+1F1F9 U+1F1F1",name:"Timor-Leste",title:"flag for Timor-Leste",dialCode:"+670"},{code:"TM",emoji:"🇹🇲",unicode:"U+1F1F9 U+1F1F2",name:"Turkmenistan",title:"flag for Turkmenistan",dialCode:"+993"},{code:"TN",emoji:"🇹🇳",unicode:"U+1F1F9 U+1F1F3",name:"Tunisia",title:"flag for Tunisia",dialCode:"+216"},{code:"TO",emoji:"🇹🇴",unicode:"U+1F1F9 U+1F1F4",name:"Tonga",title:"flag for Tonga",dialCode:"+676"},{code:"TR",emoji:"🇹🇷",unicode:"U+1F1F9 U+1F1F7",name:"Turkey",title:"flag for Turkey",dialCode:"+90"},{code:"TT",emoji:"🇹🇹",unicode:"U+1F1F9 U+1F1F9",name:"Trinidad and Tobago",title:"flag for Trinidad and Tobago",dialCode:"+1 868"},{code:"TV",emoji:"🇹🇻",unicode:"U+1F1F9 U+1F1FB",name:"Tuvalu",title:"flag for Tuvalu",dialCode:"+688"},{code:"TW",emoji:"🇹🇼",unicode:"U+1F1F9 U+1F1FC",name:"Taiwan",title:"flag for Taiwan",dialCode:"+886"},{code:"TZ",emoji:"🇹🇿",unicode:"U+1F1F9 U+1F1FF",name:"Tanzania",title:"flag for Tanzania",dialCode:"+255"},{code:"UA",emoji:"🇺🇦",unicode:"U+1F1FA U+1F1E6",name:"Ukraine",title:"flag for Ukraine",dialCode:"+380"},{code:"UG",emoji:"🇺🇬",unicode:"U+1F1FA U+1F1EC",name:"Uganda",title:"flag for Uganda",dialCode:"+256"},{code:"UM",emoji:"🇺🇲",unicode:"U+1F1FA U+1F1F2",name:"United States Minor Outlying Islands",title:"flag for United States Minor Outlying Islands"},{code:"US",emoji:"🇺🇸",unicode:"U+1F1FA U+1F1F8",name:"United States",title:"flag for United States",dialCode:"+1"},{code:"UY",emoji:"🇺🇾",unicode:"U+1F1FA U+1F1FE",name:"Uruguay",title:"flag for Uruguay",dialCode:"+598"},{code:"UZ",emoji:"🇺🇿",unicode:"U+1F1FA U+1F1FF",name:"Uzbekistan",title:"flag for Uzbekistan",dialCode:"+998"},{code:"VA",emoji:"🇻🇦",unicode:"U+1F1FB U+1F1E6",name:"Vatican City",title:"flag for Vatican City",dialCode:"+379"},{code:"VC",emoji:"🇻🇨",unicode:"U+1F1FB U+1F1E8",name:"Saint Vincent and The Grenadines",title:"flag for Saint Vincent and The Grenadines",dialCode:"+1 784"},{code:"VE",emoji:"🇻🇪",unicode:"U+1F1FB U+1F1EA",name:"Venezuela",title:"flag for Venezuela",dialCode:"+58"},{code:"VG",emoji:"🇻🇬",unicode:"U+1F1FB U+1F1EC",name:"Virgin Islands, British",title:"flag for Virgin Islands, British",dialCode:"+1 284"},{code:"VI",emoji:"🇻🇮",unicode:"U+1F1FB U+1F1EE",name:"Virgin Islands, U.S.",title:"flag for Virgin Islands, U.S.",dialCode:"+1 340"},{code:"VN",emoji:"🇻🇳",unicode:"U+1F1FB U+1F1F3",name:"Viet Nam",title:"flag for Viet Nam",dialCode:"+84"},{code:"VU",emoji:"🇻🇺",unicode:"U+1F1FB U+1F1FA",name:"Vanuatu",title:"flag for Vanuatu",dialCode:"+678"},{code:"WF",emoji:"🇼🇫",unicode:"U+1F1FC U+1F1EB",name:"Wallis and Futuna",title:"flag for Wallis and Futuna",dialCode:"+681"},{code:"WS",emoji:"🇼🇸",unicode:"U+1F1FC U+1F1F8",name:"Samoa",title:"flag for Samoa",dialCode:"+685"},{code:"XK",emoji:"🇽🇰",unicode:"U+1F1FD U+1F1F0",name:"Kosovo",title:"flag for Kosovo",dialCode:"+383"},{code:"YE",emoji:"🇾🇪",unicode:"U+1F1FE U+1F1EA",name:"Yemen",title:"flag for Yemen",dialCode:"+967"},{code:"YT",emoji:"🇾🇹",unicode:"U+1F1FE U+1F1F9",name:"Mayotte",title:"flag for Mayotte",dialCode:"+262"},{code:"ZA",emoji:"🇿🇦",unicode:"U+1F1FF U+1F1E6",name:"South Africa",title:"flag for South Africa",dialCode:"+27"},{code:"ZM",emoji:"🇿🇲",unicode:"U+1F1FF U+1F1F2",name:"Zambia",title:"flag for Zambia",dialCode:"+260"},{code:"ZW",emoji:"🇿🇼",unicode:"U+1F1FF U+1F1FC",name:"Zimbabwe",title:"flag for Zimbabwe",dialCode:"+263"}];e.GeocoderAutocomplete=class{container;apiKey;inputElement;inputClearButton;autocompleteItemsElement=null;focusedItemIndex;currentItems;currentPromiseReject;currentPlaceDetailsPromiseReject;currentTimeout;changeCallbacks=[];suggestionsChangeCallbacks=[];inputCallbacks=[];openCallbacks=[];closeCallbacks=[];preprocessHook;postprocessHook;suggestionsFilter;geocoderUrl="https://api.geoapify.com/v1/geocode/autocomplete";placeDetailsUrl="https://api.geoapify.com/v2/place-details";options={limit:5,debounceDelay:100};BY_COUNTRYCODE="countrycode";BY_RECT="rect";BY_CIRCLE="circle";BY_PROXIMITY="proximity";BY_PLACE="place";constructor(e,i,o){this.container=e,this.apiKey=i,this.options=o?{...this.options,...o}:this.options,this.options.filter=this.options.filter||{},this.options.bias=this.options.bias||{},this.options.countryCodes&&this.addFilterByCountry(this.options.countryCodes),this.options.position&&this.addBiasByProximity(this.options.position),this.inputElement=document.createElement("input"),this.inputElement.classList.add("geoapify-autocomplete-input"),this.inputElement.setAttribute("type","text"),this.inputElement.setAttribute("placeholder",this.options.placeholder||"Enter an address here"),this.container.appendChild(this.inputElement),this.inputClearButton=document.createElement("div"),this.inputClearButton.classList.add("geoapify-close-button"),this.addIcon(this.inputClearButton,"close"),this.inputClearButton.addEventListener("click",this.clearFieldAndNotify.bind(this),!1),this.container.appendChild(this.inputClearButton),this.inputElement.addEventListener("input",this.onUserInput.bind(this),!1),this.inputElement.addEventListener("keydown",this.onUserKeyPress.bind(this),!1),document.addEventListener("click",(e=>{e.target!==this.inputElement?this.closeDropDownList():this.autocompleteItemsElement||this.openDropdownAgain()}))}setType(e){this.options.type=e}setLang(e){this.options.lang=e}setCountryCodes(e){console.warn("WARNING! Obsolete function called. Function setCountryCodes() has been deprecated, please use the new addFilterByCountry() function instead!"),this.options.countryCodes=e}setPosition(e){console.warn("WARNING! Obsolete function called. Function setPosition() has been deprecated, please use the new addBiasByProximity() function instead!"),this.options.position=e}setLimit(e){this.options.limit=e}setValue(e){e?this.inputClearButton.classList.add("visible"):this.inputClearButton.classList.remove("visible"),this.inputElement.value=e}getValue(){return this.inputElement.value}addFilterByCountry(e){this.options.filter[this.BY_COUNTRYCODE]=e}addFilterByCircle(e){this.options.filter[this.BY_CIRCLE]=e}addFilterByRect(e){this.options.filter[this.BY_RECT]=e}addFilterByPlace(e){this.options.filter[this.BY_PLACE]=e}clearFilters(){this.options.filter={}}addBiasByCountry(e){this.options.bias[this.BY_COUNTRYCODE]=e}addBiasByCircle(e){this.options.bias[this.BY_CIRCLE]=e}addBiasByRect(e){this.options.bias[this.BY_RECT]=e}addBiasByProximity(e){this.options.bias[this.BY_PROXIMITY]=e}clearBias(){this.options.bias={}}on(e,i){"select"===e&&this.changeCallbacks.indexOf(i)<0&&this.changeCallbacks.push(i),"suggestions"===e&&this.suggestionsChangeCallbacks.indexOf(i)<0&&this.suggestionsChangeCallbacks.push(i),"input"===e&&this.inputCallbacks.indexOf(i)<0&&this.inputCallbacks.push(i),"close"===e&&this.closeCallbacks.indexOf(i)<0&&this.closeCallbacks.push(i),"open"===e&&this.openCallbacks.indexOf(i)<0&&this.openCallbacks.push(i)}off(e,i){"select"===e&&this.changeCallbacks.indexOf(i)>=0?this.changeCallbacks.splice(this.changeCallbacks.indexOf(i),1):"select"!==e||i||(this.changeCallbacks=[]),"suggestions"===e&&this.suggestionsChangeCallbacks.indexOf(i)>=0?this.suggestionsChangeCallbacks.splice(this.suggestionsChangeCallbacks.indexOf(i),1):"suggestions"!==e||i||(this.suggestionsChangeCallbacks=[]),"input"===e&&this.inputCallbacks.indexOf(i)>=0?this.inputCallbacks.splice(this.inputCallbacks.indexOf(i),1):"input"!==e||i||(this.inputCallbacks=[]),"close"===e&&this.closeCallbacks.indexOf(i)>=0?this.closeCallbacks.splice(this.closeCallbacks.indexOf(i),1):"close"!==e||i||(this.closeCallbacks=[]),"open"===e&&this.openCallbacks.indexOf(i)>=0?this.openCallbacks.splice(this.openCallbacks.indexOf(i),1):"open"!==e||i||(this.openCallbacks=[])}once(e,i){this.on(e,i);const o=this,a=()=>{o.off(e,i),o.off(e,a)};this.on(e,a)}setSuggestionsFilter(e){this.suggestionsFilter=e}setPreprocessHook(e){this.preprocessHook=e}setPostprocessHook(e){this.postprocessHook=e}isOpen(){return!!this.autocompleteItemsElement}close(){this.closeDropDownList()}open(){this.isOpen()||this.openDropdownAgain()}onUserInput(e){let i=this.inputElement.value,o=this.inputElement.value;if(this.inputCallbacks.forEach((e=>e(i))),this.closeDropDownList(),this.focusedItemIndex=-1,this.currentPromiseReject&&(this.currentPromiseReject({canceled:!0}),this.currentPromiseReject=null),this.currentTimeout&&(window.clearTimeout(this.currentTimeout),this.currentTimeout=null),!i)return this.inputClearButton.classList.remove("visible"),!1;this.inputClearButton.classList.add("visible"),this.currentTimeout=window.setTimeout((()=>{new Promise(((e,o)=>{this.currentPromiseReject=o,this.preprocessHook&&"function"==typeof this.preprocessHook&&(i=this.preprocessHook(i));let a=this.generateUrl(i);fetch(a).then((i=>{i.ok?i.json().then((i=>e(i))):i.json().then((e=>o(e)))}))})).then((i=>{i.features&&i.features.length&&i?.query?.parsed&&(this.options.allowNonVerifiedHouseNumber||this.options.allowNonVerifiedStreet)&&this.extendByNonVerifiedValues(i.features,i?.query?.parsed),this.currentItems=i.features,this.currentItems&&this.currentItems.length&&this.suggestionsFilter&&"function"==typeof this.suggestionsFilter&&(this.currentItems=this.suggestionsFilter(this.currentItems)),this.notifySuggestions(this.currentItems),this.currentItems.length&&(this.autocompleteItemsElement=document.createElement("div"),this.autocompleteItemsElement.setAttribute("class","geoapify-autocomplete-items"),this.notifyOpened(),this.container.appendChild(this.autocompleteItemsElement),this.currentItems.forEach(((i,a)=>{const t=document.createElement("div");if(t.classList.add("geoapify-autocomplete-item"),!this.options.skipIcons){const e=document.createElement("span");e.classList.add("icon"),this.addFeatureIcon(e,i.properties.result_type,i.properties.country_code),t.appendChild(e)}const n=document.createElement("span");if(n.classList.add("address"),this.postprocessHook&&"function"==typeof this.postprocessHook){const e=this.postprocessHook(i);n.innerHTML=this.getStyledAddressSingleValue(e,o)}else n.innerHTML=this.getStyledAddress(i.properties,o);t.appendChild(n),t.addEventListener("click",(i=>{e.stopPropagation(),this.setValueAndNotify(this.currentItems[a])})),this.autocompleteItemsElement.appendChild(t)})))}),(e=>{e.canceled||console.log(e)}))}),this.options.debounceDelay)}addHouseNumberToFormatted(e,i,o){const a={"{{{road}}} {{{house_number}}}":["af","ai","al","ao","ar","at","aw","ax","ba","be","bg","bi","bo","bq","br","bs","bt","bv","bw","cf","ch","cl","cm","co","cr","cu","cv","cw","cy","cz","de","dk","do","ec","ee","eh","er","et","fi","fo","gd","ge","gl","gq","gr","gt","gw","hn","hr","ht","hu","id","il","ir","is","jo","ki","km","kp","kw","lc","li","lr","lt","lv","ly","me","mk","ml","mn","mo","mx","ni","nl","no","np","pa","pe","pl","ps","pt","pw","py","qa","ro","rs","ru","sb","sd","se","si","sj","sk","so","sr","ss","st","sv","sx","sz","td","tj","tl","tr","um","uz","uy","vc","ve","vu","ws"],"{{{house_number}}} {{{road}}}":["ad","ae","ag","am","as","au","az","bb","bd","bf","bh","bl","bm","bz","ca","cc","ci","ck","cn","cx","dj","dm","dz","eg","fj","fk","fm","fr","ga","gb","gf","gg","gh","gi","gm","gn","gp","gs","gu","gy","hk","hm","ie","im","io","iq","je","jm","jp","ke","kh","kn","kr","ky","lb","lk","ls","lu","ma","mc","mf","mh","mg","mm","mp","ms","mt","mq","mv","mw","my","na","nc","ne","nf","ng","nr","nu","nz","om","pf","pg","ph","pk","pm","pr","re","rw","sa","sc","sg","sh","sl","sn","tc","tf","th","tk","tn","to","tt","tv","tw","tz","ug","us","vg","vi","wf","yt","za","zm","zw"],"{{{road}}}, {{{house_number}}}":["by","es","it","kg","kz","md","mz","sm","sy","ua","va"],"{{{house_number}}}, {{{road}}}":["bj","bn","cd","cg","in","la","mr","mu","tg","tm","vn","ye"]},t=Object.keys(a).find((i=>a[i].indexOf(e.country_code)>=0))||"{{{road}}} {{{house_number}}}";if(i){e.street=i.replace(/(^\w|\s\w|[-]\w)/g,(e=>e.toUpperCase())),e.housenumber=o;const a=t.replace("{{{road}}}",e.street).replace("{{{house_number}}}",o);e.address_line1=a,e.address_line2=e.formatted,e.formatted=a+", "+e.formatted}else{e.housenumber=o;const i=t.replace("{{{road}}}",e.street).replace("{{{house_number}}}",o);e.address_line1=e.address_line1.replace(e.street,i),e.formatted=e.formatted.replace(e.street,i)}}extendByNonVerifiedValues(e,i){e.forEach((e=>{i.housenumber&&this.options.allowNonVerifiedHouseNumber&&"match_by_street"===e.properties.rank.match_type?(this.addHouseNumberToFormatted(e.properties,null,i.housenumber),e.properties.nonVerifiedParts=["housenumber"]):i.street&&i.housenumber&&this.options.allowNonVerifiedStreet&&("match_by_city_or_disrict"===e.properties.rank.match_type||"match_by_postcode"===e.properties.rank.match_type)?(this.addHouseNumberToFormatted(e.properties,i.street,i.housenumber),e.properties.nonVerifiedParts=["housenumber","street"]):i.street&&this.options.allowNonVerifiedStreet&&("match_by_city_or_disrict"===e.properties.rank.match_type||"match_by_postcode"===e.properties.rank.match_type)&&(e.properties.street=i.street.replace(/(^\w|\s\w|[-]\w)/g,(e=>e.toUpperCase())),e.properties.address_line1=e.properties.street,e.properties.address_line2=e.properties.formatted,e.properties.formatted=e.properties.street+", "+e.properties.formatted,e.properties.nonVerifiedParts=["street"])}))}getStyledAddressSingleValue(e,i){let o=e;const a=(o||"").toLowerCase().indexOf(i.toLowerCase());return a>=0&&(o=o.substring(0,a)+`<strong>${o.substring(a,a+i.length)}</strong>`+o.substring(a+i.length)),`<span class="main-part">${o}</span>`}getStyledAddress(e,i){let o,a;const t=e.formatted.split(",").map((e=>e.trim()));if(e.name)o=t[0],a=t.slice(1).join(", ");else{const e=Math.min(2,Math.max(t.length-2,1));o=t.slice(0,e).join(", "),a=t.slice(e).join(", ")}if(e.nonVerifiedParts&&e.nonVerifiedParts.length)e.nonVerifiedParts.forEach((i=>{o=o.replace(e[i],`<span class="non-verified">${e[i]}</span>`)}));else{const e=o.toLowerCase().indexOf(i.toLowerCase());e>=0&&(o=o.substring(0,e)+`<strong>${o.substring(e,e+i.length)}</strong>`+o.substring(e+i.length))}return`<span class="main-part">${o}</span><span class="secondary-part">${a}</span>`}onUserKeyPress(e){if(this.autocompleteItemsElement){const i=this.autocompleteItemsElement.getElementsByTagName("div");"ArrowDown"===e.code?(e.preventDefault(),this.focusedItemIndex++,this.focusedItemIndex>=i.length&&(this.focusedItemIndex=0),this.setActive(i,this.focusedItemIndex)):"ArrowUp"===e.code?(e.preventDefault(),this.focusedItemIndex--,this.focusedItemIndex<0&&(this.focusedItemIndex=i.length-1),this.setActive(i,this.focusedItemIndex)):"Enter"===e.code?(e.preventDefault(),this.focusedItemIndex>-1&&(this.options.skipSelectionOnArrowKey?this.setValueAndNotify(this.currentItems[this.focusedItemIndex]):this.closeDropDownList())):"Escape"===e.code&&this.closeDropDownList()}else"ArrowDown"==e.code&&this.openDropdownAgain()}setActive(e,i){if(!e||!e.length)return!1;for(var o=0;o<e.length;o++)e[o].classList.remove("active");e[i].classList.add("active"),this.options.skipSelectionOnArrowKey||(this.inputElement.value=this.postprocessHook&&"function"==typeof this.postprocessHook?this.postprocessHook(this.currentItems[i]):this.currentItems[i].properties.formatted,this.notifyValueSelected(this.currentItems[i]))}setValueAndNotify(e){this.inputElement.value=this.postprocessHook&&"function"==typeof this.postprocessHook?this.postprocessHook(e):e.properties.formatted,this.notifyValueSelected(e),this.closeDropDownList()}clearFieldAndNotify(e){e.stopPropagation(),this.inputElement.value="",this.inputClearButton.classList.remove("visible"),this.currentPromiseReject&&(this.currentPromiseReject({canceled:!0}),this.currentPromiseReject=null),this.currentTimeout&&(window.clearTimeout(this.currentTimeout),this.currentTimeout=null),this.closeDropDownList(),this.notifyValueSelected(null)}closeDropDownList(){this.autocompleteItemsElement&&(this.container.removeChild(this.autocompleteItemsElement),this.autocompleteItemsElement=null,this.notifyClosed())}addIcon(e,i){const o={close:{path:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z",viewbox:"0 0 24 24"},"map-marker":{path:"M172.268 501.67C26.97 291.031 0 269.413 0 192 0 85.961 85.961 0 192 0s192 85.961 192 192c0 77.413-26.97 99.031-172.268 309.67-9.535 13.774-29.93 13.773-39.464 0zM192 272c44.183 0 80-35.817 80-80s-35.817-80-80-80-80 35.817-80 80 35.817 80 80 80z",viewbox:"0 0 384 512"},road:{path:"M573.19 402.67l-139.79-320C428.43 71.29 417.6 64 405.68 64h-97.59l2.45 23.16c.5 4.72-3.21 8.84-7.96 8.84h-29.16c-4.75 0-8.46-4.12-7.96-8.84L267.91 64h-97.59c-11.93 0-22.76 7.29-27.73 18.67L2.8 402.67C-6.45 423.86 8.31 448 30.54 448h196.84l10.31-97.68c.86-8.14 7.72-14.32 15.91-14.32h68.8c8.19 0 15.05 6.18 15.91 14.32L348.62 448h196.84c22.23 0 36.99-24.14 27.73-45.33zM260.4 135.16a8 8 0 0 1 7.96-7.16h39.29c4.09 0 7.53 3.09 7.96 7.16l4.6 43.58c.75 7.09-4.81 13.26-11.93 13.26h-40.54c-7.13 0-12.68-6.17-11.93-13.26l4.59-43.58zM315.64 304h-55.29c-9.5 0-16.91-8.23-15.91-17.68l5.07-48c.86-8.14 7.72-14.32 15.91-14.32h45.15c8.19 0 15.05 6.18 15.91 14.32l5.07 48c1 9.45-6.41 17.68-15.91 17.68z",viewbox:"0 0 576 512"},city:{path:"M616 192H480V24c0-13.26-10.74-24-24-24H312c-13.26 0-24 10.74-24 24v72h-64V16c0-8.84-7.16-16-16-16h-16c-8.84 0-16 7.16-16 16v80h-64V16c0-8.84-7.16-16-16-16H80c-8.84 0-16 7.16-16 16v80H24c-13.26 0-24 10.74-24 24v360c0 17.67 14.33 32 32 32h576c17.67 0 32-14.33 32-32V216c0-13.26-10.75-24-24-24zM128 404c0 6.63-5.37 12-12 12H76c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm0-96c0 6.63-5.37 12-12 12H76c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm0-96c0 6.63-5.37 12-12 12H76c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm128 192c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm0-96c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm0-96c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm160 96c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm0-96c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm0-96c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12V76c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm160 288c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm0-96c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40z",viewbox:"0 0 640 512"}};var a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttribute("viewBox",o[i].viewbox),a.setAttribute("height","24");var t=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttribute("d",o[i].path),t.setAttribute("fill","currentColor"),a.appendChild(t),e.appendChild(a)}addFeatureIcon(e,o,a){const t={unknown:"map-marker",amenity:"map-marker",building:"map-marker",street:"road",suburb:"city",district:"city",postcode:"city",city:"city",county:"city",state:"city"},n=i.find((e=>a&&e.code.toLowerCase()===a.toLowerCase()));if("country"===o&&n){e.classList.add("emoji");const i=document.createElement("span");i.innerText=n.emoji,e.appendChild(i)}else this.addIcon(e,t[o]?t[o]:"map-marker")}notifyValueSelected(e){this.currentPlaceDetailsPromiseReject&&(this.currentPlaceDetailsPromiseReject({canceled:!0}),this.currentPlaceDetailsPromiseReject=null),this.options.skipDetails||!e||e.properties.nonVerifiedParts?.length?this.changeCallbacks.forEach((i=>i(e))):new Promise(((i,o)=>{this.currentPlaceDetailsPromiseReject=o;let a=this.generatePlacesUrlUrl(e.properties.place_id);fetch(a).then((e=>{e.ok?e.json().then((e=>i(e))):e.json().then((e=>o(e)))}))})).then((i=>{if(!i.features.length)return void this.changeCallbacks.forEach((i=>i(e)));const o=i.features[0];this.changeCallbacks.forEach((e=>e(o))),this.currentPlaceDetailsPromiseReject=null}),(e=>{e.canceled||console.log(e)}))}notifySuggestions(e){this.suggestionsChangeCallbacks.forEach((i=>i(e)))}notifyOpened(){this.openCallbacks.forEach((e=>e(!0)))}notifyClosed(){this.closeCallbacks.forEach((e=>e(!1)))}openDropdownAgain(){const e=document.createEvent("Event");e.initEvent("input",!0,!0),this.inputElement.dispatchEvent(e)}generatePlacesUrlUrl(e){let i=`${this.placeDetailsUrl}?id=${e}&apiKey=${this.apiKey}`;return this.options.lang&&(i+=`&lang=${this.options.lang}`),i}generateUrl(e){let i=`${this.geocoderUrl}?text=${encodeURIComponent(e)}&apiKey=${this.apiKey}`;this.options.type&&(i+=`&type=${this.options.type}`),this.options.limit&&(i+=`&limit=${this.options.limit}`),this.options.lang&&(i+=`&lang=${this.options.lang}`);const o=[],a=this.options.filter[this.BY_COUNTRYCODE],t=this.options.filter[this.BY_CIRCLE],n=this.options.filter[this.BY_RECT],d=this.options.filter[this.BY_PLACE];a&&a.length&&o.push(`countrycode:${a.join(",").toLowerCase()}`),t&&this.isLatitude(t.lat)&&this.isLongitude(t.lon)&&t.radiusMeters>0&&o.push(`circle:${t.lon},${t.lat},${t.radiusMeters}`),n&&this.isLatitude(n.lat1)&&this.isLongitude(n.lon1)&&this.isLatitude(n.lat2)&&this.isLongitude(n.lon2)&&o.push(`rect:${n.lon1},${n.lat1},${n.lon2},${n.lat2}`),d&&o.push(`place:${d}`),i+=o.length?`&filter=${o.join("|")}`:"";const l=[],s=this.options.bias[this.BY_COUNTRYCODE],c=this.options.bias[this.BY_CIRCLE],r=this.options.bias[this.BY_RECT],F=this.options.bias[this.BY_PROXIMITY];return s&&s.length&&l.push(`countrycode:${s.join(",").toLowerCase()}`),c&&this.isLatitude(c.lat)&&this.isLongitude(c.lon)&&c.radiusMeters>0&&l.push(`circle:${c.lon},${c.lat},${c.radiusMeters}`),r&&this.isLatitude(r.lat1)&&this.isLongitude(r.lon1)&&this.isLatitude(r.lat2)&&this.isLongitude(r.lon2)&&l.push(`rect:${r.lon1},${r.lat1},${r.lon2},${r.lat2}`),F&&this.isLatitude(F.lat)&&this.isLongitude(F.lon)&&l.push(`proximity:${F.lon},${F.lat}`),i+=l.length?`&bias=${l.join("|")}`:"",i}isLatitude(e){return""!==e&&null!==e&&isFinite(e)&&Math.abs(e)<=90}isLongitude(e){return""!==e&&null!==e&&isFinite(e)&&Math.abs(e)<=180}},Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i((e="undefined"!=typeof globalThis?globalThis:e||self).autocomplete={})}(this,(function(e){"use strict";var i=[{code:"AD",emoji:"🇦🇩",unicode:"U+1F1E6 U+1F1E9",name:"Andorra",title:"flag for Andorra",dialCode:"+376"},{code:"AE",emoji:"🇦🇪",unicode:"U+1F1E6 U+1F1EA",name:"United Arab Emirates",title:"flag for United Arab Emirates",dialCode:"+971"},{code:"AF",emoji:"🇦🇫",unicode:"U+1F1E6 U+1F1EB",name:"Afghanistan",title:"flag for Afghanistan",dialCode:"+93"},{code:"AG",emoji:"🇦🇬",unicode:"U+1F1E6 U+1F1EC",name:"Antigua and Barbuda",title:"flag for Antigua and Barbuda",dialCode:"+1268"},{code:"AI",emoji:"🇦🇮",unicode:"U+1F1E6 U+1F1EE",name:"Anguilla",title:"flag for Anguilla",dialCode:"+1 264"},{code:"AL",emoji:"🇦🇱",unicode:"U+1F1E6 U+1F1F1",name:"Albania",title:"flag for Albania",dialCode:"+355"},{code:"AM",emoji:"🇦🇲",unicode:"U+1F1E6 U+1F1F2",name:"Armenia",title:"flag for Armenia",dialCode:"+374"},{code:"AO",emoji:"🇦🇴",unicode:"U+1F1E6 U+1F1F4",name:"Angola",title:"flag for Angola",dialCode:"+244"},{code:"AQ",emoji:"🇦🇶",unicode:"U+1F1E6 U+1F1F6",name:"Antarctica",title:"flag for Antarctica",dialCode:null},{code:"AR",emoji:"🇦🇷",unicode:"U+1F1E6 U+1F1F7",name:"Argentina",title:"flag for Argentina",dialCode:"+54"},{code:"AS",emoji:"🇦🇸",unicode:"U+1F1E6 U+1F1F8",name:"American Samoa",title:"flag for American Samoa",dialCode:"+1 684"},{code:"AT",emoji:"🇦🇹",unicode:"U+1F1E6 U+1F1F9",name:"Austria",title:"flag for Austria",dialCode:"+43"},{code:"AU",emoji:"🇦🇺",unicode:"U+1F1E6 U+1F1FA",name:"Australia",title:"flag for Australia",dialCode:"+61"},{code:"AW",emoji:"🇦🇼",unicode:"U+1F1E6 U+1F1FC",name:"Aruba",title:"flag for Aruba",dialCode:"+297"},{code:"AX",emoji:"🇦🇽",unicode:"U+1F1E6 U+1F1FD",name:"Åland Islands",title:"flag for Åland Islands",dialCode:""},{code:"AZ",emoji:"🇦🇿",unicode:"U+1F1E6 U+1F1FF",name:"Azerbaijan",title:"flag for Azerbaijan",dialCode:"+994"},{code:"BA",emoji:"🇧🇦",unicode:"U+1F1E7 U+1F1E6",name:"Bosnia and Herzegovina",title:"flag for Bosnia and Herzegovina",dialCode:"+387"},{code:"BB",emoji:"🇧🇧",unicode:"U+1F1E7 U+1F1E7",name:"Barbados",title:"flag for Barbados",dialCode:"+1 246"},{code:"BD",emoji:"🇧🇩",unicode:"U+1F1E7 U+1F1E9",name:"Bangladesh",title:"flag for Bangladesh",dialCode:"+880"},{code:"BE",emoji:"🇧🇪",unicode:"U+1F1E7 U+1F1EA",name:"Belgium",title:"flag for Belgium",dialCode:"+32"},{code:"BF",emoji:"🇧🇫",unicode:"U+1F1E7 U+1F1EB",name:"Burkina Faso",title:"flag for Burkina Faso",dialCode:"+226"},{code:"BG",emoji:"🇧🇬",unicode:"U+1F1E7 U+1F1EC",name:"Bulgaria",title:"flag for Bulgaria",dialCode:"+359"},{code:"BH",emoji:"🇧🇭",unicode:"U+1F1E7 U+1F1ED",name:"Bahrain",title:"flag for Bahrain",dialCode:"+973"},{code:"BI",emoji:"🇧🇮",unicode:"U+1F1E7 U+1F1EE",name:"Burundi",title:"flag for Burundi",dialCode:"+257"},{code:"BJ",emoji:"🇧🇯",unicode:"U+1F1E7 U+1F1EF",name:"Benin",title:"flag for Benin",dialCode:"+229"},{code:"BL",emoji:"🇧🇱",unicode:"U+1F1E7 U+1F1F1",name:"Saint Barthélemy",title:"flag for Saint Barthélemy",dialCode:"+590"},{code:"BM",emoji:"🇧🇲",unicode:"U+1F1E7 U+1F1F2",name:"Bermuda",title:"flag for Bermuda",dialCode:"+1 441"},{code:"BN",emoji:"🇧🇳",unicode:"U+1F1E7 U+1F1F3",name:"Brunei Darussalam",title:"flag for Brunei Darussalam",dialCode:"+673"},{code:"BO",emoji:"🇧🇴",unicode:"U+1F1E7 U+1F1F4",name:"Bolivia",title:"flag for Bolivia",dialCode:"+591"},{code:"BQ",emoji:"🇧🇶",unicode:"U+1F1E7 U+1F1F6",name:"Bonaire, Sint Eustatius and Saba",title:"flag for Bonaire, Sint Eustatius and Saba"},{code:"BR",emoji:"🇧🇷",unicode:"U+1F1E7 U+1F1F7",name:"Brazil",title:"flag for Brazil",dialCode:"+55"},{code:"BS",emoji:"🇧🇸",unicode:"U+1F1E7 U+1F1F8",name:"Bahamas",title:"flag for Bahamas",dialCode:"+1 242"},{code:"BT",emoji:"🇧🇹",unicode:"U+1F1E7 U+1F1F9",name:"Bhutan",title:"flag for Bhutan",dialCode:"+975"},{code:"BV",emoji:"🇧🇻",unicode:"U+1F1E7 U+1F1FB",name:"Bouvet Island",title:"flag for Bouvet Island"},{code:"BW",emoji:"🇧🇼",unicode:"U+1F1E7 U+1F1FC",name:"Botswana",title:"flag for Botswana",dialCode:"+267"},{code:"BY",emoji:"🇧🇾",unicode:"U+1F1E7 U+1F1FE",name:"Belarus",title:"flag for Belarus",dialCode:"+375"},{code:"BZ",emoji:"🇧🇿",unicode:"U+1F1E7 U+1F1FF",name:"Belize",title:"flag for Belize",dialCode:"+501"},{code:"CA",emoji:"🇨🇦",unicode:"U+1F1E8 U+1F1E6",name:"Canada",title:"flag for Canada",dialCode:"+1"},{code:"CC",emoji:"🇨🇨",unicode:"U+1F1E8 U+1F1E8",name:"Cocos (Keeling) Islands",title:"flag for Cocos (Keeling) Islands",dialCode:"+61"},{code:"CD",emoji:"🇨🇩",unicode:"U+1F1E8 U+1F1E9",name:"Congo",title:"flag for Congo",dialCode:"+243"},{code:"CF",emoji:"🇨🇫",unicode:"U+1F1E8 U+1F1EB",name:"Central African Republic",title:"flag for Central African Republic",dialCode:"+236"},{code:"CG",emoji:"🇨🇬",unicode:"U+1F1E8 U+1F1EC",name:"Congo",title:"flag for Congo",dialCode:"+242"},{code:"CH",emoji:"🇨🇭",unicode:"U+1F1E8 U+1F1ED",name:"Switzerland",title:"flag for Switzerland",dialCode:"+41"},{code:"CI",emoji:"🇨🇮",unicode:"U+1F1E8 U+1F1EE",name:"Côte D'Ivoire",title:"flag for Côte D'Ivoire",dialCode:"+225"},{code:"CK",emoji:"🇨🇰",unicode:"U+1F1E8 U+1F1F0",name:"Cook Islands",title:"flag for Cook Islands",dialCode:"+682"},{code:"CL",emoji:"🇨🇱",unicode:"U+1F1E8 U+1F1F1",name:"Chile",title:"flag for Chile",dialCode:"+56"},{code:"CM",emoji:"🇨🇲",unicode:"U+1F1E8 U+1F1F2",name:"Cameroon",title:"flag for Cameroon",dialCode:"+237"},{code:"CN",emoji:"🇨🇳",unicode:"U+1F1E8 U+1F1F3",name:"China",title:"flag for China",dialCode:"+86"},{code:"CO",emoji:"🇨🇴",unicode:"U+1F1E8 U+1F1F4",name:"Colombia",title:"flag for Colombia",dialCode:"+57"},{code:"CR",emoji:"🇨🇷",unicode:"U+1F1E8 U+1F1F7",name:"Costa Rica",title:"flag for Costa Rica",dialCode:"+506"},{code:"CU",emoji:"🇨🇺",unicode:"U+1F1E8 U+1F1FA",name:"Cuba",title:"flag for Cuba",dialCode:"+53"},{code:"CV",emoji:"🇨🇻",unicode:"U+1F1E8 U+1F1FB",name:"Cape Verde",title:"flag for Cape Verde",dialCode:"+238"},{code:"CW",emoji:"🇨🇼",unicode:"U+1F1E8 U+1F1FC",name:"Curaçao",title:"flag for Curaçao"},{code:"CX",emoji:"🇨🇽",unicode:"U+1F1E8 U+1F1FD",name:"Christmas Island",title:"flag for Christmas Island",dialCode:"+61"},{code:"CY",emoji:"🇨🇾",unicode:"U+1F1E8 U+1F1FE",name:"Cyprus",title:"flag for Cyprus",dialCode:"+537"},{code:"CZ",emoji:"🇨🇿",unicode:"U+1F1E8 U+1F1FF",name:"Czech Republic",title:"flag for Czech Republic",dialCode:"+420"},{code:"DE",emoji:"🇩🇪",unicode:"U+1F1E9 U+1F1EA",name:"Germany",title:"flag for Germany",dialCode:"+49"},{code:"DJ",emoji:"🇩🇯",unicode:"U+1F1E9 U+1F1EF",name:"Djibouti",title:"flag for Djibouti",dialCode:"+253"},{code:"DK",emoji:"🇩🇰",unicode:"U+1F1E9 U+1F1F0",name:"Denmark",title:"flag for Denmark",dialCode:"+45"},{code:"DM",emoji:"🇩🇲",unicode:"U+1F1E9 U+1F1F2",name:"Dominica",title:"flag for Dominica",dialCode:"+1 767"},{code:"DO",emoji:"🇩🇴",unicode:"U+1F1E9 U+1F1F4",name:"Dominican Republic",title:"flag for Dominican Republic",dialCode:"+1 849"},{code:"DZ",emoji:"🇩🇿",unicode:"U+1F1E9 U+1F1FF",name:"Algeria",title:"flag for Algeria",dialCode:"+213"},{code:"EC",emoji:"🇪🇨",unicode:"U+1F1EA U+1F1E8",name:"Ecuador",title:"flag for Ecuador",dialCode:"+593"},{code:"EE",emoji:"🇪🇪",unicode:"U+1F1EA U+1F1EA",name:"Estonia",title:"flag for Estonia",dialCode:"+372"},{code:"EG",emoji:"🇪🇬",unicode:"U+1F1EA U+1F1EC",name:"Egypt",title:"flag for Egypt",dialCode:"+20"},{code:"EH",emoji:"🇪🇭",unicode:"U+1F1EA U+1F1ED",name:"Western Sahara",title:"flag for Western Sahara"},{code:"ER",emoji:"🇪🇷",unicode:"U+1F1EA U+1F1F7",name:"Eritrea",title:"flag for Eritrea",dialCode:"+291"},{code:"ES",emoji:"🇪🇸",unicode:"U+1F1EA U+1F1F8",name:"Spain",title:"flag for Spain",dialCode:"+34"},{code:"ET",emoji:"🇪🇹",unicode:"U+1F1EA U+1F1F9",name:"Ethiopia",title:"flag for Ethiopia",dialCode:"+251"},{code:"EU",emoji:"🇪🇺",unicode:"U+1F1EA U+1F1FA",name:"European Union",title:"flag for European Union"},{code:"FI",emoji:"🇫🇮",unicode:"U+1F1EB U+1F1EE",name:"Finland",title:"flag for Finland",dialCode:"+358"},{code:"FJ",emoji:"🇫🇯",unicode:"U+1F1EB U+1F1EF",name:"Fiji",title:"flag for Fiji",dialCode:"+679"},{code:"FK",emoji:"🇫🇰",unicode:"U+1F1EB U+1F1F0",name:"Falkland Islands (Malvinas)",title:"flag for Falkland Islands (Malvinas)",dialCode:"+500"},{code:"FM",emoji:"🇫🇲",unicode:"U+1F1EB U+1F1F2",name:"Micronesia",title:"flag for Micronesia",dialCode:"+691"},{code:"FO",emoji:"🇫🇴",unicode:"U+1F1EB U+1F1F4",name:"Faroe Islands",title:"flag for Faroe Islands",dialCode:"+298"},{code:"FR",emoji:"🇫🇷",unicode:"U+1F1EB U+1F1F7",name:"France",title:"flag for France",dialCode:"+33"},{code:"GA",emoji:"🇬🇦",unicode:"U+1F1EC U+1F1E6",name:"Gabon",title:"flag for Gabon",dialCode:"+241"},{code:"GB",emoji:"🇬🇧",unicode:"U+1F1EC U+1F1E7",name:"United Kingdom",title:"flag for United Kingdom",dialCode:"+44"},{code:"GD",emoji:"🇬🇩",unicode:"U+1F1EC U+1F1E9",name:"Grenada",title:"flag for Grenada",dialCode:"+1 473"},{code:"GE",emoji:"🇬🇪",unicode:"U+1F1EC U+1F1EA",name:"Georgia",title:"flag for Georgia",dialCode:"+995"},{code:"GF",emoji:"🇬🇫",unicode:"U+1F1EC U+1F1EB",name:"French Guiana",title:"flag for French Guiana",dialCode:"+594"},{code:"GG",emoji:"🇬🇬",unicode:"U+1F1EC U+1F1EC",name:"Guernsey",title:"flag for Guernsey",dialCode:"+44"},{code:"GH",emoji:"🇬🇭",unicode:"U+1F1EC U+1F1ED",name:"Ghana",title:"flag for Ghana",dialCode:"+233"},{code:"GI",emoji:"🇬🇮",unicode:"U+1F1EC U+1F1EE",name:"Gibraltar",title:"flag for Gibraltar",dialCode:"+350"},{code:"GL",emoji:"🇬🇱",unicode:"U+1F1EC U+1F1F1",name:"Greenland",title:"flag for Greenland",dialCode:"+299"},{code:"GM",emoji:"🇬🇲",unicode:"U+1F1EC U+1F1F2",name:"Gambia",title:"flag for Gambia",dialCode:"+220"},{code:"GN",emoji:"🇬🇳",unicode:"U+1F1EC U+1F1F3",name:"Guinea",title:"flag for Guinea",dialCode:"+224"},{code:"GP",emoji:"🇬🇵",unicode:"U+1F1EC U+1F1F5",name:"Guadeloupe",title:"flag for Guadeloupe",dialCode:"+590"},{code:"GQ",emoji:"🇬🇶",unicode:"U+1F1EC U+1F1F6",name:"Equatorial Guinea",title:"flag for Equatorial Guinea",dialCode:"+240"},{code:"GR",emoji:"🇬🇷",unicode:"U+1F1EC U+1F1F7",name:"Greece",title:"flag for Greece",dialCode:"+30"},{code:"GS",emoji:"🇬🇸",unicode:"U+1F1EC U+1F1F8",name:"South Georgia",title:"flag for South Georgia",dialCode:"+500"},{code:"GT",emoji:"🇬🇹",unicode:"U+1F1EC U+1F1F9",name:"Guatemala",title:"flag for Guatemala",dialCode:"+502"},{code:"GU",emoji:"🇬🇺",unicode:"U+1F1EC U+1F1FA",name:"Guam",title:"flag for Guam",dialCode:"+1 671"},{code:"GW",emoji:"🇬🇼",unicode:"U+1F1EC U+1F1FC",name:"Guinea-Bissau",title:"flag for Guinea-Bissau",dialCode:"+245"},{code:"GY",emoji:"🇬🇾",unicode:"U+1F1EC U+1F1FE",name:"Guyana",title:"flag for Guyana",dialCode:"+595"},{code:"HK",emoji:"🇭🇰",unicode:"U+1F1ED U+1F1F0",name:"Hong Kong",title:"flag for Hong Kong",dialCode:"+852"},{code:"HM",emoji:"🇭🇲",unicode:"U+1F1ED U+1F1F2",name:"Heard Island and Mcdonald Islands",title:"flag for Heard Island and Mcdonald Islands"},{code:"HN",emoji:"🇭🇳",unicode:"U+1F1ED U+1F1F3",name:"Honduras",title:"flag for Honduras",dialCode:"+504"},{code:"HR",emoji:"🇭🇷",unicode:"U+1F1ED U+1F1F7",name:"Croatia",title:"flag for Croatia",dialCode:"+385"},{code:"HT",emoji:"🇭🇹",unicode:"U+1F1ED U+1F1F9",name:"Haiti",title:"flag for Haiti",dialCode:"+509"},{code:"HU",emoji:"🇭🇺",unicode:"U+1F1ED U+1F1FA",name:"Hungary",title:"flag for Hungary",dialCode:"+36"},{code:"ID",emoji:"🇮🇩",unicode:"U+1F1EE U+1F1E9",name:"Indonesia",title:"flag for Indonesia",dialCode:"+62"},{code:"IE",emoji:"🇮🇪",unicode:"U+1F1EE U+1F1EA",name:"Ireland",title:"flag for Ireland",dialCode:"+353"},{code:"IL",emoji:"🇮🇱",unicode:"U+1F1EE U+1F1F1",name:"Israel",title:"flag for Israel",dialCode:"+972"},{code:"IM",emoji:"🇮🇲",unicode:"U+1F1EE U+1F1F2",name:"Isle of Man",title:"flag for Isle of Man",dialCode:"+44"},{code:"IN",emoji:"🇮🇳",unicode:"U+1F1EE U+1F1F3",name:"India",title:"flag for India",dialCode:"+91"},{code:"IO",emoji:"🇮🇴",unicode:"U+1F1EE U+1F1F4",name:"British Indian Ocean Territory",title:"flag for British Indian Ocean Territory",dialCode:"+246"},{code:"IQ",emoji:"🇮🇶",unicode:"U+1F1EE U+1F1F6",name:"Iraq",title:"flag for Iraq",dialCode:"+964"},{code:"IR",emoji:"🇮🇷",unicode:"U+1F1EE U+1F1F7",name:"Iran",title:"flag for Iran",dialCode:"+98"},{code:"IS",emoji:"🇮🇸",unicode:"U+1F1EE U+1F1F8",name:"Iceland",title:"flag for Iceland",dialCode:"+354"},{code:"IT",emoji:"🇮🇹",unicode:"U+1F1EE U+1F1F9",name:"Italy",title:"flag for Italy",dialCode:"+39"},{code:"JE",emoji:"🇯🇪",unicode:"U+1F1EF U+1F1EA",name:"Jersey",title:"flag for Jersey",dialCode:"+44"},{code:"JM",emoji:"🇯🇲",unicode:"U+1F1EF U+1F1F2",name:"Jamaica",title:"flag for Jamaica",dialCode:"+1 876"},{code:"JO",emoji:"🇯🇴",unicode:"U+1F1EF U+1F1F4",name:"Jordan",title:"flag for Jordan",dialCode:"+962"},{code:"JP",emoji:"🇯🇵",unicode:"U+1F1EF U+1F1F5",name:"Japan",title:"flag for Japan",dialCode:"+81"},{code:"KE",emoji:"🇰🇪",unicode:"U+1F1F0 U+1F1EA",name:"Kenya",title:"flag for Kenya",dialCode:"+254"},{code:"KG",emoji:"🇰🇬",unicode:"U+1F1F0 U+1F1EC",name:"Kyrgyzstan",title:"flag for Kyrgyzstan",dialCode:"+996"},{code:"KH",emoji:"🇰🇭",unicode:"U+1F1F0 U+1F1ED",name:"Cambodia",title:"flag for Cambodia",dialCode:"+855"},{code:"KI",emoji:"🇰🇮",unicode:"U+1F1F0 U+1F1EE",name:"Kiribati",title:"flag for Kiribati",dialCode:"+686"},{code:"KM",emoji:"🇰🇲",unicode:"U+1F1F0 U+1F1F2",name:"Comoros",title:"flag for Comoros",dialCode:"+269"},{code:"KN",emoji:"🇰🇳",unicode:"U+1F1F0 U+1F1F3",name:"Saint Kitts and Nevis",title:"flag for Saint Kitts and Nevis",dialCode:"+1 869"},{code:"KP",emoji:"🇰🇵",unicode:"U+1F1F0 U+1F1F5",name:"North Korea",title:"flag for North Korea",dialCode:"+850"},{code:"KR",emoji:"🇰🇷",unicode:"U+1F1F0 U+1F1F7",name:"South Korea",title:"flag for South Korea",dialCode:"+82"},{code:"KW",emoji:"🇰🇼",unicode:"U+1F1F0 U+1F1FC",name:"Kuwait",title:"flag for Kuwait",dialCode:"+965"},{code:"KY",emoji:"🇰🇾",unicode:"U+1F1F0 U+1F1FE",name:"Cayman Islands",title:"flag for Cayman Islands",dialCode:"+ 345"},{code:"KZ",emoji:"🇰🇿",unicode:"U+1F1F0 U+1F1FF",name:"Kazakhstan",title:"flag for Kazakhstan",dialCode:"+7 7"},{code:"LA",emoji:"🇱🇦",unicode:"U+1F1F1 U+1F1E6",name:"Lao People's Democratic Republic",title:"flag for Lao People's Democratic Republic",dialCode:"+856"},{code:"LB",emoji:"🇱🇧",unicode:"U+1F1F1 U+1F1E7",name:"Lebanon",title:"flag for Lebanon",dialCode:"+961"},{code:"LC",emoji:"🇱🇨",unicode:"U+1F1F1 U+1F1E8",name:"Saint Lucia",title:"flag for Saint Lucia",dialCode:"+1 758"},{code:"LI",emoji:"🇱🇮",unicode:"U+1F1F1 U+1F1EE",name:"Liechtenstein",title:"flag for Liechtenstein",dialCode:"+423"},{code:"LK",emoji:"🇱🇰",unicode:"U+1F1F1 U+1F1F0",name:"Sri Lanka",title:"flag for Sri Lanka",dialCode:"+94"},{code:"LR",emoji:"🇱🇷",unicode:"U+1F1F1 U+1F1F7",name:"Liberia",title:"flag for Liberia",dialCode:"+231"},{code:"LS",emoji:"🇱🇸",unicode:"U+1F1F1 U+1F1F8",name:"Lesotho",title:"flag for Lesotho",dialCode:"+266"},{code:"LT",emoji:"🇱🇹",unicode:"U+1F1F1 U+1F1F9",name:"Lithuania",title:"flag for Lithuania",dialCode:"+370"},{code:"LU",emoji:"🇱🇺",unicode:"U+1F1F1 U+1F1FA",name:"Luxembourg",title:"flag for Luxembourg",dialCode:"+352"},{code:"LV",emoji:"🇱🇻",unicode:"U+1F1F1 U+1F1FB",name:"Latvia",title:"flag for Latvia",dialCode:"+371"},{code:"LY",emoji:"🇱🇾",unicode:"U+1F1F1 U+1F1FE",name:"Libya",title:"flag for Libya",dialCode:"+218"},{code:"MA",emoji:"🇲🇦",unicode:"U+1F1F2 U+1F1E6",name:"Morocco",title:"flag for Morocco",dialCode:"+212"},{code:"MC",emoji:"🇲🇨",unicode:"U+1F1F2 U+1F1E8",name:"Monaco",title:"flag for Monaco",dialCode:"+377"},{code:"MD",emoji:"🇲🇩",unicode:"U+1F1F2 U+1F1E9",name:"Moldova",title:"flag for Moldova",dialCode:"+373"},{code:"ME",emoji:"🇲🇪",unicode:"U+1F1F2 U+1F1EA",name:"Montenegro",title:"flag for Montenegro",dialCode:"+382"},{code:"MF",emoji:"🇲🇫",unicode:"U+1F1F2 U+1F1EB",name:"Saint Martin (French Part)",title:"flag for Saint Martin (French Part)",dialCode:"+590"},{code:"MG",emoji:"🇲🇬",unicode:"U+1F1F2 U+1F1EC",name:"Madagascar",title:"flag for Madagascar",dialCode:"+261"},{code:"MH",emoji:"🇲🇭",unicode:"U+1F1F2 U+1F1ED",name:"Marshall Islands",title:"flag for Marshall Islands",dialCode:"+692"},{code:"MK",emoji:"🇲🇰",unicode:"U+1F1F2 U+1F1F0",name:"Macedonia",title:"flag for Macedonia",dialCode:"+389"},{code:"ML",emoji:"🇲🇱",unicode:"U+1F1F2 U+1F1F1",name:"Mali",title:"flag for Mali",dialCode:"+223"},{code:"MM",emoji:"🇲🇲",unicode:"U+1F1F2 U+1F1F2",name:"Myanmar",title:"flag for Myanmar",dialCode:"+95"},{code:"MN",emoji:"🇲🇳",unicode:"U+1F1F2 U+1F1F3",name:"Mongolia",title:"flag for Mongolia",dialCode:"+976"},{code:"MO",emoji:"🇲🇴",unicode:"U+1F1F2 U+1F1F4",name:"Macao",title:"flag for Macao",dialCode:"+853"},{code:"MP",emoji:"🇲🇵",unicode:"U+1F1F2 U+1F1F5",name:"Northern Mariana Islands",title:"flag for Northern Mariana Islands",dialCode:"+1 670"},{code:"MQ",emoji:"🇲🇶",unicode:"U+1F1F2 U+1F1F6",name:"Martinique",title:"flag for Martinique",dialCode:"+596"},{code:"MR",emoji:"🇲🇷",unicode:"U+1F1F2 U+1F1F7",name:"Mauritania",title:"flag for Mauritania",dialCode:"+222"},{code:"MS",emoji:"🇲🇸",unicode:"U+1F1F2 U+1F1F8",name:"Montserrat",title:"flag for Montserrat",dialCode:"+1664"},{code:"MT",emoji:"🇲🇹",unicode:"U+1F1F2 U+1F1F9",name:"Malta",title:"flag for Malta",dialCode:"+356"},{code:"MU",emoji:"🇲🇺",unicode:"U+1F1F2 U+1F1FA",name:"Mauritius",title:"flag for Mauritius",dialCode:"+230"},{code:"MV",emoji:"🇲🇻",unicode:"U+1F1F2 U+1F1FB",name:"Maldives",title:"flag for Maldives",dialCode:"+960"},{code:"MW",emoji:"🇲🇼",unicode:"U+1F1F2 U+1F1FC",name:"Malawi",title:"flag for Malawi",dialCode:"+265"},{code:"MX",emoji:"🇲🇽",unicode:"U+1F1F2 U+1F1FD",name:"Mexico",title:"flag for Mexico",dialCode:"+52"},{code:"MY",emoji:"🇲🇾",unicode:"U+1F1F2 U+1F1FE",name:"Malaysia",title:"flag for Malaysia",dialCode:"+60"},{code:"MZ",emoji:"🇲🇿",unicode:"U+1F1F2 U+1F1FF",name:"Mozambique",title:"flag for Mozambique",dialCode:"+258"},{code:"NA",emoji:"🇳🇦",unicode:"U+1F1F3 U+1F1E6",name:"Namibia",title:"flag for Namibia",dialCode:"+264"},{code:"NC",emoji:"🇳🇨",unicode:"U+1F1F3 U+1F1E8",name:"New Caledonia",title:"flag for New Caledonia",dialCode:"+687"},{code:"NE",emoji:"🇳🇪",unicode:"U+1F1F3 U+1F1EA",name:"Niger",title:"flag for Niger",dialCode:"+227"},{code:"NF",emoji:"🇳🇫",unicode:"U+1F1F3 U+1F1EB",name:"Norfolk Island",title:"flag for Norfolk Island",dialCode:"+672"},{code:"NG",emoji:"🇳🇬",unicode:"U+1F1F3 U+1F1EC",name:"Nigeria",title:"flag for Nigeria",dialCode:"+234"},{code:"NI",emoji:"🇳🇮",unicode:"U+1F1F3 U+1F1EE",name:"Nicaragua",title:"flag for Nicaragua",dialCode:"+505"},{code:"NL",emoji:"🇳🇱",unicode:"U+1F1F3 U+1F1F1",name:"Netherlands",title:"flag for Netherlands",dialCode:"+31"},{code:"NO",emoji:"🇳🇴",unicode:"U+1F1F3 U+1F1F4",name:"Norway",title:"flag for Norway",dialCode:"+47"},{code:"NP",emoji:"🇳🇵",unicode:"U+1F1F3 U+1F1F5",name:"Nepal",title:"flag for Nepal",dialCode:"+977"},{code:"NR",emoji:"🇳🇷",unicode:"U+1F1F3 U+1F1F7",name:"Nauru",title:"flag for Nauru",dialCode:"+674"},{code:"NU",emoji:"🇳🇺",unicode:"U+1F1F3 U+1F1FA",name:"Niue",title:"flag for Niue",dialCode:"+683"},{code:"NZ",emoji:"🇳🇿",unicode:"U+1F1F3 U+1F1FF",name:"New Zealand",title:"flag for New Zealand",dialCode:"+64"},{code:"OM",emoji:"🇴🇲",unicode:"U+1F1F4 U+1F1F2",name:"Oman",title:"flag for Oman",dialCode:"+968"},{code:"PA",emoji:"🇵🇦",unicode:"U+1F1F5 U+1F1E6",name:"Panama",title:"flag for Panama",dialCode:"+507"},{code:"PE",emoji:"🇵🇪",unicode:"U+1F1F5 U+1F1EA",name:"Peru",title:"flag for Peru",dialCode:"+51"},{code:"PF",emoji:"🇵🇫",unicode:"U+1F1F5 U+1F1EB",name:"French Polynesia",title:"flag for French Polynesia",dialCode:"+689"},{code:"PG",emoji:"🇵🇬",unicode:"U+1F1F5 U+1F1EC",name:"Papua New Guinea",title:"flag for Papua New Guinea",dialCode:"+675"},{code:"PH",emoji:"🇵🇭",unicode:"U+1F1F5 U+1F1ED",name:"Philippines",title:"flag for Philippines",dialCode:"+63"},{code:"PK",emoji:"🇵🇰",unicode:"U+1F1F5 U+1F1F0",name:"Pakistan",title:"flag for Pakistan",dialCode:"+92"},{code:"PL",emoji:"🇵🇱",unicode:"U+1F1F5 U+1F1F1",name:"Poland",title:"flag for Poland",dialCode:"+48"},{code:"PM",emoji:"🇵🇲",unicode:"U+1F1F5 U+1F1F2",name:"Saint Pierre and Miquelon",title:"flag for Saint Pierre and Miquelon",dialCode:"+508"},{code:"PN",emoji:"🇵🇳",unicode:"U+1F1F5 U+1F1F3",name:"Pitcairn",title:"flag for Pitcairn",dialCode:"+872"},{code:"PR",emoji:"🇵🇷",unicode:"U+1F1F5 U+1F1F7",name:"Puerto Rico",title:"flag for Puerto Rico",dialCode:"+1 939"},{code:"PS",emoji:"🇵🇸",unicode:"U+1F1F5 U+1F1F8",name:"Palestinian Territory",title:"flag for Palestinian Territory",dialCode:"+970"},{code:"PT",emoji:"🇵🇹",unicode:"U+1F1F5 U+1F1F9",name:"Portugal",title:"flag for Portugal",dialCode:"+351"},{code:"PW",emoji:"🇵🇼",unicode:"U+1F1F5 U+1F1FC",name:"Palau",title:"flag for Palau",dialCode:"+680"},{code:"PY",emoji:"🇵🇾",unicode:"U+1F1F5 U+1F1FE",name:"Paraguay",title:"flag for Paraguay",dialCode:"+595"},{code:"QA",emoji:"🇶🇦",unicode:"U+1F1F6 U+1F1E6",name:"Qatar",title:"flag for Qatar",dialCode:"+974"},{code:"RE",emoji:"🇷🇪",unicode:"U+1F1F7 U+1F1EA",name:"Réunion",title:"flag for Réunion",dialCode:"+262"},{code:"RO",emoji:"🇷🇴",unicode:"U+1F1F7 U+1F1F4",name:"Romania",title:"flag for Romania",dialCode:"+40"},{code:"RS",emoji:"🇷🇸",unicode:"U+1F1F7 U+1F1F8",name:"Serbia",title:"flag for Serbia",dialCode:"+381"},{code:"RU",emoji:"🇷🇺",unicode:"U+1F1F7 U+1F1FA",name:"Russia",title:"flag for Russia",dialCode:"+7"},{code:"RW",emoji:"🇷🇼",unicode:"U+1F1F7 U+1F1FC",name:"Rwanda",title:"flag for Rwanda",dialCode:"+250"},{code:"SA",emoji:"🇸🇦",unicode:"U+1F1F8 U+1F1E6",name:"Saudi Arabia",title:"flag for Saudi Arabia",dialCode:"+966"},{code:"SB",emoji:"🇸🇧",unicode:"U+1F1F8 U+1F1E7",name:"Solomon Islands",title:"flag for Solomon Islands",dialCode:"+677"},{code:"SC",emoji:"🇸🇨",unicode:"U+1F1F8 U+1F1E8",name:"Seychelles",title:"flag for Seychelles",dialCode:"+248"},{code:"SD",emoji:"🇸🇩",unicode:"U+1F1F8 U+1F1E9",name:"Sudan",title:"flag for Sudan",dialCode:"+249"},{code:"SE",emoji:"🇸🇪",unicode:"U+1F1F8 U+1F1EA",name:"Sweden",title:"flag for Sweden",dialCode:"+46"},{code:"SG",emoji:"🇸🇬",unicode:"U+1F1F8 U+1F1EC",name:"Singapore",title:"flag for Singapore",dialCode:"+65"},{code:"SH",emoji:"🇸🇭",unicode:"U+1F1F8 U+1F1ED",name:"Saint Helena, Ascension and Tristan Da Cunha",title:"flag for Saint Helena, Ascension and Tristan Da Cunha",dialCode:"+290"},{code:"SI",emoji:"🇸🇮",unicode:"U+1F1F8 U+1F1EE",name:"Slovenia",title:"flag for Slovenia",dialCode:"+386"},{code:"SJ",emoji:"🇸🇯",unicode:"U+1F1F8 U+1F1EF",name:"Svalbard and Jan Mayen",title:"flag for Svalbard and Jan Mayen",dialCode:"+47"},{code:"SK",emoji:"🇸🇰",unicode:"U+1F1F8 U+1F1F0",name:"Slovakia",title:"flag for Slovakia",dialCode:"+421"},{code:"SL",emoji:"🇸🇱",unicode:"U+1F1F8 U+1F1F1",name:"Sierra Leone",title:"flag for Sierra Leone",dialCode:"+232"},{code:"SM",emoji:"🇸🇲",unicode:"U+1F1F8 U+1F1F2",name:"San Marino",title:"flag for San Marino",dialCode:"+378"},{code:"SN",emoji:"🇸🇳",unicode:"U+1F1F8 U+1F1F3",name:"Senegal",title:"flag for Senegal",dialCode:"+221"},{code:"SO",emoji:"🇸🇴",unicode:"U+1F1F8 U+1F1F4",name:"Somalia",title:"flag for Somalia",dialCode:"+252"},{code:"SR",emoji:"🇸🇷",unicode:"U+1F1F8 U+1F1F7",name:"Suriname",title:"flag for Suriname",dialCode:"+597"},{code:"SS",emoji:"🇸🇸",unicode:"U+1F1F8 U+1F1F8",name:"South Sudan",title:"flag for South Sudan"},{code:"ST",emoji:"🇸🇹",unicode:"U+1F1F8 U+1F1F9",name:"Sao Tome and Principe",title:"flag for Sao Tome and Principe",dialCode:"+239"},{code:"SV",emoji:"🇸🇻",unicode:"U+1F1F8 U+1F1FB",name:"El Salvador",title:"flag for El Salvador",dialCode:"+503"},{code:"SX",emoji:"🇸🇽",unicode:"U+1F1F8 U+1F1FD",name:"Sint Maarten (Dutch Part)",title:"flag for Sint Maarten (Dutch Part)"},{code:"SY",emoji:"🇸🇾",unicode:"U+1F1F8 U+1F1FE",name:"Syrian Arab Republic",title:"flag for Syrian Arab Republic",dialCode:"+963"},{code:"SZ",emoji:"🇸🇿",unicode:"U+1F1F8 U+1F1FF",name:"Swaziland",title:"flag for Swaziland",dialCode:"+268"},{code:"TC",emoji:"🇹🇨",unicode:"U+1F1F9 U+1F1E8",name:"Turks and Caicos Islands",title:"flag for Turks and Caicos Islands",dialCode:"+1 649"},{code:"TD",emoji:"🇹🇩",unicode:"U+1F1F9 U+1F1E9",name:"Chad",title:"flag for Chad",dialCode:"+235"},{code:"TF",emoji:"🇹🇫",unicode:"U+1F1F9 U+1F1EB",name:"French Southern Territories",title:"flag for French Southern Territories"},{code:"TG",emoji:"🇹🇬",unicode:"U+1F1F9 U+1F1EC",name:"Togo",title:"flag for Togo",dialCode:"+228"},{code:"TH",emoji:"🇹🇭",unicode:"U+1F1F9 U+1F1ED",name:"Thailand",title:"flag for Thailand",dialCode:"+66"},{code:"TJ",emoji:"🇹🇯",unicode:"U+1F1F9 U+1F1EF",name:"Tajikistan",title:"flag for Tajikistan",dialCode:"+992"},{code:"TK",emoji:"🇹🇰",unicode:"U+1F1F9 U+1F1F0",name:"Tokelau",title:"flag for Tokelau",dialCode:"+690"},{code:"TL",emoji:"🇹🇱",unicode:"U+1F1F9 U+1F1F1",name:"Timor-Leste",title:"flag for Timor-Leste",dialCode:"+670"},{code:"TM",emoji:"🇹🇲",unicode:"U+1F1F9 U+1F1F2",name:"Turkmenistan",title:"flag for Turkmenistan",dialCode:"+993"},{code:"TN",emoji:"🇹🇳",unicode:"U+1F1F9 U+1F1F3",name:"Tunisia",title:"flag for Tunisia",dialCode:"+216"},{code:"TO",emoji:"🇹🇴",unicode:"U+1F1F9 U+1F1F4",name:"Tonga",title:"flag for Tonga",dialCode:"+676"},{code:"TR",emoji:"🇹🇷",unicode:"U+1F1F9 U+1F1F7",name:"Turkey",title:"flag for Turkey",dialCode:"+90"},{code:"TT",emoji:"🇹🇹",unicode:"U+1F1F9 U+1F1F9",name:"Trinidad and Tobago",title:"flag for Trinidad and Tobago",dialCode:"+1 868"},{code:"TV",emoji:"🇹🇻",unicode:"U+1F1F9 U+1F1FB",name:"Tuvalu",title:"flag for Tuvalu",dialCode:"+688"},{code:"TW",emoji:"🇹🇼",unicode:"U+1F1F9 U+1F1FC",name:"Taiwan",title:"flag for Taiwan",dialCode:"+886"},{code:"TZ",emoji:"🇹🇿",unicode:"U+1F1F9 U+1F1FF",name:"Tanzania",title:"flag for Tanzania",dialCode:"+255"},{code:"UA",emoji:"🇺🇦",unicode:"U+1F1FA U+1F1E6",name:"Ukraine",title:"flag for Ukraine",dialCode:"+380"},{code:"UG",emoji:"🇺🇬",unicode:"U+1F1FA U+1F1EC",name:"Uganda",title:"flag for Uganda",dialCode:"+256"},{code:"UM",emoji:"🇺🇲",unicode:"U+1F1FA U+1F1F2",name:"United States Minor Outlying Islands",title:"flag for United States Minor Outlying Islands"},{code:"US",emoji:"🇺🇸",unicode:"U+1F1FA U+1F1F8",name:"United States",title:"flag for United States",dialCode:"+1"},{code:"UY",emoji:"🇺🇾",unicode:"U+1F1FA U+1F1FE",name:"Uruguay",title:"flag for Uruguay",dialCode:"+598"},{code:"UZ",emoji:"🇺🇿",unicode:"U+1F1FA U+1F1FF",name:"Uzbekistan",title:"flag for Uzbekistan",dialCode:"+998"},{code:"VA",emoji:"🇻🇦",unicode:"U+1F1FB U+1F1E6",name:"Vatican City",title:"flag for Vatican City",dialCode:"+379"},{code:"VC",emoji:"🇻🇨",unicode:"U+1F1FB U+1F1E8",name:"Saint Vincent and The Grenadines",title:"flag for Saint Vincent and The Grenadines",dialCode:"+1 784"},{code:"VE",emoji:"🇻🇪",unicode:"U+1F1FB U+1F1EA",name:"Venezuela",title:"flag for Venezuela",dialCode:"+58"},{code:"VG",emoji:"🇻🇬",unicode:"U+1F1FB U+1F1EC",name:"Virgin Islands, British",title:"flag for Virgin Islands, British",dialCode:"+1 284"},{code:"VI",emoji:"🇻🇮",unicode:"U+1F1FB U+1F1EE",name:"Virgin Islands, U.S.",title:"flag for Virgin Islands, U.S.",dialCode:"+1 340"},{code:"VN",emoji:"🇻🇳",unicode:"U+1F1FB U+1F1F3",name:"Viet Nam",title:"flag for Viet Nam",dialCode:"+84"},{code:"VU",emoji:"🇻🇺",unicode:"U+1F1FB U+1F1FA",name:"Vanuatu",title:"flag for Vanuatu",dialCode:"+678"},{code:"WF",emoji:"🇼🇫",unicode:"U+1F1FC U+1F1EB",name:"Wallis and Futuna",title:"flag for Wallis and Futuna",dialCode:"+681"},{code:"WS",emoji:"🇼🇸",unicode:"U+1F1FC U+1F1F8",name:"Samoa",title:"flag for Samoa",dialCode:"+685"},{code:"XK",emoji:"🇽🇰",unicode:"U+1F1FD U+1F1F0",name:"Kosovo",title:"flag for Kosovo",dialCode:"+383"},{code:"YE",emoji:"🇾🇪",unicode:"U+1F1FE U+1F1EA",name:"Yemen",title:"flag for Yemen",dialCode:"+967"},{code:"YT",emoji:"🇾🇹",unicode:"U+1F1FE U+1F1F9",name:"Mayotte",title:"flag for Mayotte",dialCode:"+262"},{code:"ZA",emoji:"🇿🇦",unicode:"U+1F1FF U+1F1E6",name:"South Africa",title:"flag for South Africa",dialCode:"+27"},{code:"ZM",emoji:"🇿🇲",unicode:"U+1F1FF U+1F1F2",name:"Zambia",title:"flag for Zambia",dialCode:"+260"},{code:"ZW",emoji:"🇿🇼",unicode:"U+1F1FF U+1F1FC",name:"Zimbabwe",title:"flag for Zimbabwe",dialCode:"+263"}];e.GeocoderAutocomplete=class{container;apiKey;inputElement;inputClearButton;autocompleteItemsElement=null;focusedItemIndex;currentItems;currentPromiseReject;currentPlaceDetailsPromiseReject;currentTimeout;changeCallbacks=[];suggestionsChangeCallbacks=[];inputCallbacks=[];openCallbacks=[];closeCallbacks=[];preprocessHook;postprocessHook;suggestionsFilter;sendGeocoderRequestAlt;sendPlaceDetailsRequestAlt;geocoderUrl="https://api.geoapify.com/v1/geocode/autocomplete";placeDetailsUrl="https://api.geoapify.com/v2/place-details";options={limit:5,debounceDelay:100};BY_COUNTRYCODE="countrycode";BY_RECT="rect";BY_CIRCLE="circle";BY_PROXIMITY="proximity";BY_PLACE="place";constructor(e,i,o){this.container=e,this.apiKey=i,this.options=o?{...this.options,...o}:this.options,this.options.filter=this.options.filter||{},this.options.bias=this.options.bias||{},this.options.countryCodes&&this.addFilterByCountry(this.options.countryCodes),this.options.position&&this.addBiasByProximity(this.options.position),this.inputElement=document.createElement("input"),this.inputElement.classList.add("geoapify-autocomplete-input"),this.inputElement.setAttribute("type","text"),this.inputElement.setAttribute("placeholder",this.options.placeholder||"Enter an address here"),this.container.appendChild(this.inputElement),this.inputClearButton=document.createElement("div"),this.inputClearButton.classList.add("geoapify-close-button"),this.addIcon(this.inputClearButton,"close"),this.inputClearButton.addEventListener("click",this.clearFieldAndNotify.bind(this),!1),this.container.appendChild(this.inputClearButton),this.inputElement.addEventListener("input",this.onUserInput.bind(this),!1),this.inputElement.addEventListener("keydown",this.onUserKeyPress.bind(this),!1),document.addEventListener("click",(e=>{e.target!==this.inputElement?this.closeDropDownList():this.autocompleteItemsElement||this.openDropdownAgain()}))}setType(e){this.options.type=e}setLang(e){this.options.lang=e}setCountryCodes(e){console.warn("WARNING! Obsolete function called. Function setCountryCodes() has been deprecated, please use the new addFilterByCountry() function instead!"),this.options.countryCodes=e}setPosition(e){console.warn("WARNING! Obsolete function called. Function setPosition() has been deprecated, please use the new addBiasByProximity() function instead!"),this.options.position=e}setLimit(e){this.options.limit=e}setValue(e){e?this.inputClearButton.classList.add("visible"):this.inputClearButton.classList.remove("visible"),this.inputElement.value=e}getValue(){return this.inputElement.value}addFilterByCountry(e){this.options.filter[this.BY_COUNTRYCODE]=e}addFilterByCircle(e){this.options.filter[this.BY_CIRCLE]=e}addFilterByRect(e){this.options.filter[this.BY_RECT]=e}addFilterByPlace(e){this.options.filter[this.BY_PLACE]=e}clearFilters(){this.options.filter={}}addBiasByCountry(e){this.options.bias[this.BY_COUNTRYCODE]=e}addBiasByCircle(e){this.options.bias[this.BY_CIRCLE]=e}addBiasByRect(e){this.options.bias[this.BY_RECT]=e}addBiasByProximity(e){this.options.bias[this.BY_PROXIMITY]=e}clearBias(){this.options.bias={}}on(e,i){"select"===e&&this.changeCallbacks.indexOf(i)<0&&this.changeCallbacks.push(i),"suggestions"===e&&this.suggestionsChangeCallbacks.indexOf(i)<0&&this.suggestionsChangeCallbacks.push(i),"input"===e&&this.inputCallbacks.indexOf(i)<0&&this.inputCallbacks.push(i),"close"===e&&this.closeCallbacks.indexOf(i)<0&&this.closeCallbacks.push(i),"open"===e&&this.openCallbacks.indexOf(i)<0&&this.openCallbacks.push(i)}off(e,i){"select"===e&&this.changeCallbacks.indexOf(i)>=0?this.changeCallbacks.splice(this.changeCallbacks.indexOf(i),1):"select"!==e||i||(this.changeCallbacks=[]),"suggestions"===e&&this.suggestionsChangeCallbacks.indexOf(i)>=0?this.suggestionsChangeCallbacks.splice(this.suggestionsChangeCallbacks.indexOf(i),1):"suggestions"!==e||i||(this.suggestionsChangeCallbacks=[]),"input"===e&&this.inputCallbacks.indexOf(i)>=0?this.inputCallbacks.splice(this.inputCallbacks.indexOf(i),1):"input"!==e||i||(this.inputCallbacks=[]),"close"===e&&this.closeCallbacks.indexOf(i)>=0?this.closeCallbacks.splice(this.closeCallbacks.indexOf(i),1):"close"!==e||i||(this.closeCallbacks=[]),"open"===e&&this.openCallbacks.indexOf(i)>=0?this.openCallbacks.splice(this.openCallbacks.indexOf(i),1):"open"!==e||i||(this.openCallbacks=[])}once(e,i){this.on(e,i);const o=this,a=()=>{o.off(e,i),o.off(e,a)};this.on(e,a)}setSuggestionsFilter(e){this.suggestionsFilter=e&&"function"==typeof e?e:null}setPreprocessHook(e){this.preprocessHook=e&&"function"==typeof e?e:null}setPostprocessHook(e){this.postprocessHook=e&&"function"==typeof e?e:null}setSendGeocoderRequestFunc(e){this.sendGeocoderRequestAlt=e&&"function"==typeof e?e:null}setSendPlaceDetailsRequestFunc(e){this.sendPlaceDetailsRequestAlt=e&&"function"==typeof e?e:null}isOpen(){return!!this.autocompleteItemsElement}close(){this.closeDropDownList()}open(){this.isOpen()||this.openDropdownAgain()}sendGeocoderRequest(e){return new Promise(((i,o)=>{this.currentPromiseReject=o;let a=this.generateUrl(e);fetch(a).then((e=>{e.ok?e.json().then((e=>i(e))):e.json().then((e=>o(e)))}))}))}sendPlaceDetailsRequest(e){return new Promise(((i,o)=>{if("openstreetmap"!==e.properties.datasource?.sourcename||!e.properties.place_id)return void i(e);this.currentPlaceDetailsPromiseReject=o;let a=this.generatePlacesUrlUrl(e.properties.place_id);fetch(a).then((a=>{a.ok?a.json().then((o=>{o.features.length||i(e),i(o.features[0])})):a.json().then((e=>o(e)))}))}))}onUserInput(e){let i=this.inputElement.value,o=this.inputElement.value;if(this.inputCallbacks.forEach((e=>e(i))),this.closeDropDownList(),this.focusedItemIndex=-1,this.currentPromiseReject&&(this.currentPromiseReject({canceled:!0}),this.currentPromiseReject=null),this.currentTimeout&&(window.clearTimeout(this.currentTimeout),this.currentTimeout=null),!i)return this.inputClearButton.classList.remove("visible"),!1;this.inputClearButton.classList.add("visible"),this.currentTimeout=window.setTimeout((()=>{let a;this.preprocessHook&&"function"==typeof this.preprocessHook&&(i=this.preprocessHook(i)),a=this.sendGeocoderRequestAlt?this.sendGeocoderRequestAlt(i,this):this.sendGeocoderRequest(i),a.then((i=>{i.features&&i.features.length&&i?.query?.parsed&&(this.options.allowNonVerifiedHouseNumber||this.options.allowNonVerifiedStreet)&&this.extendByNonVerifiedValues(i.features,i?.query?.parsed),this.currentItems=i.features,this.currentItems&&this.currentItems.length&&this.suggestionsFilter&&"function"==typeof this.suggestionsFilter&&(this.currentItems=this.suggestionsFilter(this.currentItems)),this.notifySuggestions(this.currentItems),this.currentItems.length&&(this.autocompleteItemsElement=document.createElement("div"),this.autocompleteItemsElement.setAttribute("class","geoapify-autocomplete-items"),this.notifyOpened(),this.container.appendChild(this.autocompleteItemsElement),this.currentItems.forEach(((i,a)=>{const t=document.createElement("div");if(t.classList.add("geoapify-autocomplete-item"),!this.options.skipIcons){const e=document.createElement("span");e.classList.add("icon"),this.addFeatureIcon(e,i.properties.result_type,i.properties.country_code),t.appendChild(e)}const n=document.createElement("span");if(n.classList.add("address"),this.postprocessHook&&"function"==typeof this.postprocessHook){const e=this.postprocessHook(i);n.innerHTML=this.getStyledAddressSingleValue(e,o)}else n.innerHTML=this.getStyledAddress(i.properties,o);t.appendChild(n),t.addEventListener("click",(i=>{e.stopPropagation(),this.setValueAndNotify(this.currentItems[a])})),this.autocompleteItemsElement.appendChild(t)})))}),(e=>{e.canceled||console.log(e)}))}),this.options.debounceDelay)}addHouseNumberToFormatted(e,i,o){const a={"{{{road}}} {{{house_number}}}":["af","ai","al","ao","ar","at","aw","ax","ba","be","bg","bi","bo","bq","br","bs","bt","bv","bw","cf","ch","cl","cm","co","cr","cu","cv","cw","cy","cz","de","dk","do","ec","ee","eh","er","et","fi","fo","gd","ge","gl","gq","gr","gt","gw","hn","hr","ht","hu","id","il","ir","is","jo","ki","km","kp","kw","lc","li","lr","lt","lv","ly","me","mk","ml","mn","mo","mx","ni","nl","no","np","pa","pe","pl","ps","pt","pw","py","qa","ro","rs","ru","sb","sd","se","si","sj","sk","so","sr","ss","st","sv","sx","sz","td","tj","tl","tr","um","uz","uy","vc","ve","vu","ws"],"{{{house_number}}} {{{road}}}":["ad","ae","ag","am","as","au","az","bb","bd","bf","bh","bl","bm","bz","ca","cc","ci","ck","cn","cx","dj","dm","dz","eg","fj","fk","fm","fr","ga","gb","gf","gg","gh","gi","gm","gn","gp","gs","gu","gy","hk","hm","ie","im","io","iq","je","jm","jp","ke","kh","kn","kr","ky","lb","lk","ls","lu","ma","mc","mf","mh","mg","mm","mp","ms","mt","mq","mv","mw","my","na","nc","ne","nf","ng","nr","nu","nz","om","pf","pg","ph","pk","pm","pr","re","rw","sa","sc","sg","sh","sl","sn","tc","tf","th","tk","tn","to","tt","tv","tw","tz","ug","us","vg","vi","wf","yt","za","zm","zw"],"{{{road}}}, {{{house_number}}}":["by","es","it","kg","kz","md","mz","sm","sy","ua","va"],"{{{house_number}}}, {{{road}}}":["bj","bn","cd","cg","in","la","mr","mu","tg","tm","vn","ye"]},t=Object.keys(a).find((i=>a[i].indexOf(e.country_code)>=0))||"{{{road}}} {{{house_number}}}";if(i){e.street=i.replace(/(^\w|\s\w|[-]\w)/g,(e=>e.toUpperCase())),e.housenumber=o;const a=t.replace("{{{road}}}",e.street).replace("{{{house_number}}}",o);e.address_line1=a,e.address_line2=e.formatted,e.formatted=a+", "+e.formatted}else{e.housenumber=o;const i=t.replace("{{{road}}}",e.street).replace("{{{house_number}}}",o);e.address_line1=e.address_line1.replace(e.street,i),e.formatted=e.formatted.replace(e.street,i)}}extendByNonVerifiedValues(e,i){e.forEach((e=>{i.housenumber&&this.options.allowNonVerifiedHouseNumber&&"match_by_street"===e.properties.rank.match_type?(this.addHouseNumberToFormatted(e.properties,null,i.housenumber),e.properties.nonVerifiedParts=["housenumber"]):i.street&&i.housenumber&&this.options.allowNonVerifiedStreet&&("match_by_city_or_disrict"===e.properties.rank.match_type||"match_by_postcode"===e.properties.rank.match_type)?(this.addHouseNumberToFormatted(e.properties,i.street,i.housenumber),e.properties.nonVerifiedParts=["housenumber","street"]):i.street&&this.options.allowNonVerifiedStreet&&("match_by_city_or_disrict"===e.properties.rank.match_type||"match_by_postcode"===e.properties.rank.match_type)&&(e.properties.street=i.street.replace(/(^\w|\s\w|[-]\w)/g,(e=>e.toUpperCase())),e.properties.address_line1=e.properties.street,e.properties.address_line2=e.properties.formatted,e.properties.formatted=e.properties.street+", "+e.properties.formatted,e.properties.nonVerifiedParts=["street"])}))}getStyledAddressSingleValue(e,i){let o=e;const a=(o||"").toLowerCase().indexOf(i.toLowerCase());return a>=0&&(o=o.substring(0,a)+`<strong>${o.substring(a,a+i.length)}</strong>`+o.substring(a+i.length)),`<span class="main-part">${o}</span>`}getStyledAddress(e,i){let o,a;const t=e.formatted.split(",").map((e=>e.trim()));if(e.name)o=t[0],a=t.slice(1).join(", ");else{const e=Math.min(2,Math.max(t.length-2,1));o=t.slice(0,e).join(", "),a=t.slice(e).join(", ")}if(e.nonVerifiedParts&&e.nonVerifiedParts.length)e.nonVerifiedParts.forEach((i=>{o=o.replace(e[i],`<span class="non-verified">${e[i]}</span>`)}));else{const e=o.toLowerCase().indexOf(i.toLowerCase());e>=0&&(o=o.substring(0,e)+`<strong>${o.substring(e,e+i.length)}</strong>`+o.substring(e+i.length))}return`<span class="main-part">${o}</span><span class="secondary-part">${a}</span>`}onUserKeyPress(e){if(this.autocompleteItemsElement){const i=this.autocompleteItemsElement.getElementsByTagName("div");"ArrowDown"===e.code?(e.preventDefault(),this.focusedItemIndex++,this.focusedItemIndex>=i.length&&(this.focusedItemIndex=0),this.setActive(i,this.focusedItemIndex)):"ArrowUp"===e.code?(e.preventDefault(),this.focusedItemIndex--,this.focusedItemIndex<0&&(this.focusedItemIndex=i.length-1),this.setActive(i,this.focusedItemIndex)):"Enter"===e.code?(e.preventDefault(),this.focusedItemIndex>-1&&(this.options.skipSelectionOnArrowKey?this.setValueAndNotify(this.currentItems[this.focusedItemIndex]):this.closeDropDownList())):"Escape"===e.code&&this.closeDropDownList()}else"ArrowDown"==e.code&&this.openDropdownAgain()}setActive(e,i){if(!e||!e.length)return!1;for(var o=0;o<e.length;o++)e[o].classList.remove("active");e[i].classList.add("active"),this.options.skipSelectionOnArrowKey||(this.inputElement.value=this.postprocessHook&&"function"==typeof this.postprocessHook?this.postprocessHook(this.currentItems[i]):this.currentItems[i].properties.formatted,this.notifyValueSelected(this.currentItems[i]))}setValueAndNotify(e){this.inputElement.value=this.postprocessHook&&"function"==typeof this.postprocessHook?this.postprocessHook(e):e.properties.formatted,this.notifyValueSelected(e),this.closeDropDownList()}clearFieldAndNotify(e){e.stopPropagation(),this.inputElement.value="",this.inputClearButton.classList.remove("visible"),this.currentPromiseReject&&(this.currentPromiseReject({canceled:!0}),this.currentPromiseReject=null),this.currentTimeout&&(window.clearTimeout(this.currentTimeout),this.currentTimeout=null),this.closeDropDownList(),this.notifyValueSelected(null)}closeDropDownList(){this.autocompleteItemsElement&&(this.container.removeChild(this.autocompleteItemsElement),this.autocompleteItemsElement=null,this.notifyClosed())}addIcon(e,i){const o={close:{path:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z",viewbox:"0 0 24 24"},"map-marker":{path:"M172.268 501.67C26.97 291.031 0 269.413 0 192 0 85.961 85.961 0 192 0s192 85.961 192 192c0 77.413-26.97 99.031-172.268 309.67-9.535 13.774-29.93 13.773-39.464 0zM192 272c44.183 0 80-35.817 80-80s-35.817-80-80-80-80 35.817-80 80 35.817 80 80 80z",viewbox:"0 0 384 512"},road:{path:"M573.19 402.67l-139.79-320C428.43 71.29 417.6 64 405.68 64h-97.59l2.45 23.16c.5 4.72-3.21 8.84-7.96 8.84h-29.16c-4.75 0-8.46-4.12-7.96-8.84L267.91 64h-97.59c-11.93 0-22.76 7.29-27.73 18.67L2.8 402.67C-6.45 423.86 8.31 448 30.54 448h196.84l10.31-97.68c.86-8.14 7.72-14.32 15.91-14.32h68.8c8.19 0 15.05 6.18 15.91 14.32L348.62 448h196.84c22.23 0 36.99-24.14 27.73-45.33zM260.4 135.16a8 8 0 0 1 7.96-7.16h39.29c4.09 0 7.53 3.09 7.96 7.16l4.6 43.58c.75 7.09-4.81 13.26-11.93 13.26h-40.54c-7.13 0-12.68-6.17-11.93-13.26l4.59-43.58zM315.64 304h-55.29c-9.5 0-16.91-8.23-15.91-17.68l5.07-48c.86-8.14 7.72-14.32 15.91-14.32h45.15c8.19 0 15.05 6.18 15.91 14.32l5.07 48c1 9.45-6.41 17.68-15.91 17.68z",viewbox:"0 0 576 512"},city:{path:"M616 192H480V24c0-13.26-10.74-24-24-24H312c-13.26 0-24 10.74-24 24v72h-64V16c0-8.84-7.16-16-16-16h-16c-8.84 0-16 7.16-16 16v80h-64V16c0-8.84-7.16-16-16-16H80c-8.84 0-16 7.16-16 16v80H24c-13.26 0-24 10.74-24 24v360c0 17.67 14.33 32 32 32h576c17.67 0 32-14.33 32-32V216c0-13.26-10.75-24-24-24zM128 404c0 6.63-5.37 12-12 12H76c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm0-96c0 6.63-5.37 12-12 12H76c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm0-96c0 6.63-5.37 12-12 12H76c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm128 192c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm0-96c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm0-96c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm160 96c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm0-96c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm0-96c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12V76c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm160 288c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40zm0-96c0 6.63-5.37 12-12 12h-40c-6.63 0-12-5.37-12-12v-40c0-6.63 5.37-12 12-12h40c6.63 0 12 5.37 12 12v40z",viewbox:"0 0 640 512"}};var a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttribute("viewBox",o[i].viewbox),a.setAttribute("height","24");var t=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttribute("d",o[i].path),t.setAttribute("fill","currentColor"),a.appendChild(t),e.appendChild(a)}addFeatureIcon(e,o,a){const t={unknown:"map-marker",amenity:"map-marker",building:"map-marker",street:"road",suburb:"city",district:"city",postcode:"city",city:"city",county:"city",state:"city"},n=i.find((e=>a&&e.code.toLowerCase()===a.toLowerCase()));if("country"===o&&n){e.classList.add("emoji");const i=document.createElement("span");i.innerText=n.emoji,e.appendChild(i)}else this.addIcon(e,t[o]?t[o]:"map-marker")}notifyValueSelected(e){if(this.currentPlaceDetailsPromiseReject&&(this.currentPlaceDetailsPromiseReject({canceled:!0}),this.currentPlaceDetailsPromiseReject=null),this.options.addDetails&&e&&!e.properties.nonVerifiedParts?.length){let i;i=this.sendPlaceDetailsRequestAlt?this.sendPlaceDetailsRequestAlt(e,this):this.sendPlaceDetailsRequest(e),i.then((e=>{this.changeCallbacks.forEach((i=>i(e))),this.currentPlaceDetailsPromiseReject=null}),(i=>{i.canceled||(console.log(i),this.changeCallbacks.forEach((i=>i(e))),this.currentPlaceDetailsPromiseReject=null)}))}else this.changeCallbacks.forEach((i=>i(e)))}notifySuggestions(e){this.suggestionsChangeCallbacks.forEach((i=>i(e)))}notifyOpened(){this.openCallbacks.forEach((e=>e(!0)))}notifyClosed(){this.closeCallbacks.forEach((e=>e(!1)))}openDropdownAgain(){const e=document.createEvent("Event");e.initEvent("input",!0,!0),this.inputElement.dispatchEvent(e)}generatePlacesUrlUrl(e){let i=`${this.placeDetailsUrl}?id=${e}&apiKey=${this.apiKey}`;return this.options.lang&&(i+=`&lang=${this.options.lang}`),i}generateUrl(e){let i=`${this.geocoderUrl}?text=${encodeURIComponent(e)}&apiKey=${this.apiKey}`;this.options.type&&(i+=`&type=${this.options.type}`),this.options.limit&&(i+=`&limit=${this.options.limit}`),this.options.lang&&(i+=`&lang=${this.options.lang}`);const o=[],a=this.options.filter[this.BY_COUNTRYCODE],t=this.options.filter[this.BY_CIRCLE],n=this.options.filter[this.BY_RECT],d=this.options.filter[this.BY_PLACE];a&&a.length&&o.push(`countrycode:${a.join(",").toLowerCase()}`),t&&this.isLatitude(t.lat)&&this.isLongitude(t.lon)&&t.radiusMeters>0&&o.push(`circle:${t.lon},${t.lat},${t.radiusMeters}`),n&&this.isLatitude(n.lat1)&&this.isLongitude(n.lon1)&&this.isLatitude(n.lat2)&&this.isLongitude(n.lon2)&&o.push(`rect:${n.lon1},${n.lat1},${n.lon2},${n.lat2}`),d&&o.push(`place:${d}`),i+=o.length?`&filter=${o.join("|")}`:"";const l=[],s=this.options.bias[this.BY_COUNTRYCODE],c=this.options.bias[this.BY_CIRCLE],r=this.options.bias[this.BY_RECT],F=this.options.bias[this.BY_PROXIMITY];return s&&s.length&&l.push(`countrycode:${s.join(",").toLowerCase()}`),c&&this.isLatitude(c.lat)&&this.isLongitude(c.lon)&&c.radiusMeters>0&&l.push(`circle:${c.lon},${c.lat},${c.radiusMeters}`),r&&this.isLatitude(r.lat1)&&this.isLongitude(r.lon1)&&this.isLatitude(r.lat2)&&this.isLongitude(r.lon2)&&l.push(`rect:${r.lon1},${r.lat1},${r.lon2},${r.lat2}`),F&&this.isLatitude(F.lat)&&this.isLongitude(F.lon)&&l.push(`proximity:${F.lon},${F.lat}`),i+=l.length?`&bias=${l.join("|")}`:"",i}isLatitude(e){return""!==e&&null!==e&&isFinite(e)&&Math.abs(e)<=90}isLongitude(e){return""!==e&&null!==e&&isFinite(e)&&Math.abs(e)<=180}}}));
//# sourceMappingURL=index.min.js.map
{
"name": "@geoapify/geocoder-autocomplete",
"version": "1.5.1",
"version": "2.0.0",
"description": "Geocoder autocomplete field",

@@ -13,3 +13,3 @@ "main": "dist/index.js",

"build-all": "npm run build && npm run build-minimized",
"build-minimized": "rollup -c",
"build-minimized": "rollup -c rollup-config.mjs",
"build-css-minimized": "postcss -o styles/minimal.min.css styles/minimal.css"

@@ -47,16 +47,15 @@ },

"devDependencies": {
"@rollup/plugin-commonjs": "^21.0.1",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.1.3",
"@rollup/plugin-typescript": "^8.3.0",
"cssnano": "^5.0.17",
"@rollup/plugin-commonjs": "^25.0.4",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.2.1",
"@rollup/plugin-typescript": "^11.1.3",
"cssnano": "^6.0.1",
"postcss": "^8.4.6",
"postcss-cli": "^9.1.0",
"postcss-import": "^14.0.2",
"rollup": "^2.67.2",
"postcss-cli": "^10.1.0",
"postcss-import": "^15.1.0",
"rollup": "^3.29.2",
"rollup-plugin-terser": "^7.0.2",
"tslib": "^2.3.1",
"typescript": "^4.5.5"
},
"dependencies": {}
"typescript": "^5.2.2"
}
}
# Geoapify Geocoder Autocomplete
Geoapify Geocoder Autocomplete is a JavaScript(TypeScript) library that provides autocomplete functionality for the [Geoapify Geocoding API](https://www.geoapify.com/geocoding-api/):
* adds an input field to a given container;
* makes calls to Geocoding API on user input;
* shows place suggestions in a dropdown list;
* notifies on suggestions change;
* makes a call to Place Details API to get more information and geometry on user selection if is not skipped;
* notifies on selection change. Returns [Geocoding API](https://apidocs.geoapify.com/docs/geocoding/) object or [Place Details API object](https://apidocs.geoapify.com/docs/place-details/) depending on options set.
The library makes a call to [Geoapify Place Details API](https://apidocs.geoapify.com/docs/place-details/) on user select events. The API lets to get detailed information about the place selected as well as place category and place geometry (building polygon or region boundary). Note, that the Place Details API call costs an additional 'geocoding & places' request. Use the `skipDetails` option to switch the functionality off.
The Geoapify Geocoder Autocomplete is a JavaScript (TypeScript) library designed to enhance web applications and HTML pages by adding advanced **address autocomplete** functionality and **address autofill** input fields. It harnesses the power of the [Geoapify Geocoding API](https://www.geoapify.com/geocoding-api/) to provide accurate and efficient address search capabilities, making it an essential tool for enhancing the geolocation services of web-based applications.
You can also:
* specify a location type - **country**, **state**, **city**, **postcode**, **street**, **amenity**;
* filter results by country, circle or boundary box
* prioritize search by a location, boundary box, circle, and countries
* select a language for search results;
* change result number shown in the dropdown list.
![Geocoder Autocomplete](https://github.com/geoapify/geocoder-autocomplete/blob/9b46b3e458d18b45e2957298e8833f830ed6252a/img/address-autocomplete-example.png?raw=true)
## [Live demo](https://apidocs.geoapify.com/playground/geocoding/#autocomplete)
* **Customizable Address Input**: Easily embed address input fields within your web application by adding them to provided HTML containers (e.g., `DIV` elements), allowing for flexible integration and styling.
* **API Integration Flexibility**: By default, the library seamlessly connects to the [Geoapify Address Autocomplete API](https://www.geoapify.com/address-autocomplete/) to retrieve address suggestions. However, developers have the freedom to integrate and combine other third-party Address Search APIs, allowing for extensive customization and the incorporation of multiple data sources.
* **Search Customization**: Tailor your address search with precision by adding filters and bias parameters. This level of customization empowers developers to fine-tune search queries, ensuring more accurate and relevant address suggestions for users.
* **Structured Address Forms**: Utilize the type parameter to craft address input forms that enable users to enter structured addresses, including postal codes, cities, countries, address lines, and more.
* **Place Details Integration**: Optionally, the library can call the [Geoapify Place Details API](https://www.geoapify.com/place-details-api/), providing users with detailed city and building boundaries as part of the search results. This enhances location context and visualization for a richer user experience.
* **Customizable Look-and-Feel**: Tailor the appearance of the address input and autocomplete suggestions effortlessly. The library offers four distinct styles for both light and dark themes, providing design flexibility. Moreover, developers can further fine-tune the visual aspects using CSS classes to achieve a seamless integration with their application's aesthetics.
* **Zero Dependencies**: The library is intentionally built with zero external dependencies. This means that it operates independently and does not rely on external libraries or packages.
## [JSFiddle demo](https://jsfiddle.net/Geoapify/jsgw53z8/)
## Add Geocoder Autocomplete to your project or webpage
##### STEP 0. Get an API key from Geoapify
You will need an API key to execute Geoapify Geocoding requests.
Register and get an API key for Free on [myprojects.geoapify.com](https://myprojects.geoapify.com/).
Geoapify has a [Freemium pricing model](https://www.geoapify.com/pricing/). You can start for Free and extend when you need it.
## [Playground](https://apidocs.geoapify.com/playground/geocoding/#autocomplete)
## [JSFiddle demo: Address Field + Map](https://jsfiddle.net/Geoapify/jsgw53z8/)
## [JSFiddle demo: Address Form 1](https://jsfiddle.net/Geoapify/t0eg541k/)
## [JSFiddle demo: Address Form 2](https://jsfiddle.net/Geoapify/stgek5wf/)
##### STEP 1. Add the Geocoder Autocomplete package
## Getting Geoapify API key
In case you decide to use Geoapify API to search addresses, you'll need to obtain an API key.
* **Option 1**. Install the Geocoder Autocomplete package with NPM or Yarn project manager:
Register for free and obtain your API key at [myprojects.geoapify.com](https://myprojects.geoapify.com/). Geoapify offers a flexible [Freemium pricing model](https://www.geoapify.com/pricing/) that allows you to begin using our services at no cost and seamlessly scale your usage as your needs grow.
## Installation
Start enhancing your web applications today with `@geoapify/geocoder-autocomplete`:
### Option 1
Install the Geocoder Autocomplete package with NPM or Yarn project manager:
```

@@ -37,4 +36,4 @@ npm install @geoapify/geocoder-autocomplete

```
* **Option 2**. Refer to the Geocoder Autocomplete library as a UMD module (for CMS websites, including WordPress):
### Option 2
Refer to the Geocoder Autocomplete library as a UMD module (for CMS websites, including WordPress):
```html

@@ -56,8 +55,13 @@ <html>

```https://unpkg.com/@geoapify/geocoder-autocomplete@^1/styles/minimal.css```
##### STEP 2. Add a container element to webpage
The autocomplete input will be added into the container element and will take the element full width:
## Using `@geoapify/geocoder-autocomplete` in your project
Follow the steps below to seamlessly integrate `@geoapify/geocoder-autocomplete` into your project.
### STEP 1. Prepare your webpage
Incorporate a container element into your webpage where the autocomplete input will be seamlessly integrated, utilizing the full width of the specified element:
```html
<div id="autocomplete" class="autocomplete-container"></div>
```
The container element must have `position: absolute;` or `position: relative;`
The container element must have `position: absolute` or `position: relative`
```css

@@ -68,3 +72,3 @@ .autocomplete-container {

```
##### STEP 3. Initialize the autocomplete field
### STEP 2. Initialize the autocomplete field

@@ -104,4 +108,3 @@ * **Option 1**. Import the Geocoder Autocomplete types when you use it as a module:

```
##### STEP 4. Choose Geoapify autocomplete styles:
### STEP 3. Add the Autocomplete Input styles:
We provide several Themes within the library:

@@ -119,6 +122,20 @@ * `minimal` and `round-borders` - for webpages with light background color

```
## Geoapify Geocoder options
#### GeocoderAutocompleteOptions
## Transitioning from 1.x: Replacing `skipDetails` with `addDetails`
When transitioning from the 1.x version of the library to the 2.x version, it's important to note that the `skipDetails` option has been replaced by the `addDetails` option. This change enhances the clarity of the parameter, as it now explicitly indicates whether you want to include or exclude additional details in the search results. To maintain compatibility with the updated version, make sure to adjust your code accordingly by using the `addDetails` option when needed for your address search functionality.
So, if you require place details in your search results, you should set the `addDetails` option to `true`.
## Documentation
Below, you'll find `@geoapify/geocoder-autocomplete`'s detailed documentation, usage examples, advanced features, and more. You'll find the information you need to seamlessly integrate address autocomplete and enhance your web-based geolocation services and user experiences.
### Creation
| Option | Type | Description |
| ------ | ------ | ------ |
| constructor | `GeocoderAutocomplete(<HTMLElement> el, <String> geoapifyApiKey, <GeocoderAutocompleteOptions> options?)` | `GeocoderAutocomplete(document.getElementById('autocomplete'), 'sdf45dfg68879fhsdgs346dfhdj', { lang: 'it' }`
### GeocoderAutocompleteOptions
| Option | Type | Description |
| ------ | ------ | ------ |
| type | `country`, `state`, `city`, `postcode`, `street`, `amenity` | Type of the location |

@@ -130,3 +147,3 @@ | lang | LanguageCode | Results language |

| skipIcons | boolean | Don't add icons to suggestions |
| skipDetails | boolean | Skip Place Details API call on selection change |
| addDetails | boolean | Call Place Details API on selection change to get the place details. For example, opening hours or boundary |
| skipSelectionOnArrowKey | boolean | Don't choose the location with the arrow keys |

@@ -191,3 +208,2 @@ | filter | FilterOptions | Filter places by country, boundary, circle, place |

```
#### CountyCode

@@ -201,4 +217,42 @@

#### Set option with API
The library provides an API that allows to set **Geoapify Geocoder options** during runtime:
### Methods
Here's a description of the API methods:
| Method | Description |
|-----------------------------------------|---------------------------------------------------------------------|
| `setType(type: 'country' or 'state' or 'city' or 'postcode' or 'street' or 'amenity'): void` | Sets the type of location for address suggestions. |
| `setLang(lang: SupportedLanguage): void` | Sets the language for address suggestions. |
| `setCountryCodes(codes: CountyCode[]): void` | Sets specific country codes to filter address suggestions. |
| `setPosition(position: GeoPosition = {lat: number; lon: number}): void` | Sets the geographic position to influence suggestions based on proximity.|
| `setLimit(limit: number): void` | Sets the maximum number of suggestions to display. |
| `setValue(value: string): void` | Sets the value of the input field programmatically. |
| `getValue(): string` | Retrieves the current value of the input field. |
| `addFilterByCountry(codes: CountyCode[]): void` | Adds a filter to include or exclude suggestions based on specific country codes. |
| `addFilterByCircle(filterByCircle: ByCircleOptions = {lon: number; lat: number; radiusMeters: number }): void` | Adds a circular filter to include or exclude suggestions within a specified geographic area. |
| `addFilterByRect(filterByRect: ByRectOptions = { lon1: number; lat1: number; lon2: number; lat2: number}): void` | Adds a rectangular filter to include or exclude suggestions within a specified geographic area. |
| `addFilterByPlace(filterByPlace: string): void` | Adds a filter to include or exclude suggestions based on a specific place or location. |
| `clearFilters(): void` | Clears all previously added filters. |
| `addBiasByCountry(codes: CountyCode[]): void` | Adds a bias to prioritize suggestions from specific countries. |
| `addBiasByCircle(biasByCircle: ByCircleOptions = {lon: number; lat: number; radiusMeters: number }): void` | Adds a circular bias to prioritize suggestions within a specified geographic area. |
| `addBiasByRect(biasByRect: ByRectOptions = { lon1: number; lat1: number; lon2: number; lat2: number}): void` | Adds a rectangular bias to prioritize suggestions within a specified geographic area. |
| `addBiasByProximity(biasByProximity: ByProximityOptions = { lon: number; lat: number }): void` | Adds a bias based on proximity to a specific location. |
| `clearBias(): void` | Clears all previously added biases. |
| `setSuggestionsFilter(suggestionsFilterFunc?: (suggestions: GeoJSON.Feature[]) => GeoJSON.Feature[]): void` | Sets a custom filter function for suggestions. |
| `setPreprocessHook(preprocessHookFunc?: (value: string) => string): void` | Sets a preprocessing hook to modify the input value before sending a request. |
| `setPostprocessHook(postprocessHookFunc?: (value: string) => string): void` | Sets a post-processing hook to modify the suggestion values after retrieval. |
| `isOpen(): boolean` | Checks if the suggestions dropdown is currently open. |
| `close(): void` | Manually closes the suggestions dropdown. |
| `open(): void` | Manually opens the suggestions dropdown. |
| `sendGeocoderRequest(value: string): Promise<GeoJSON.FeatureCollection>` | Sends a geocoder request based on the provided value and returns a Promise with the response in [GeoJSON FeatureCollection](https://en.wikipedia.org/wiki/GeoJSON) format containing suggestions. |
| `sendPlaceDetailsRequest(feature: GeoJSON.Feature): Promise<GeoJSON.Feature>` | Sends a place details request based on the provided [GeoJSON feature](https://en.wikipedia.org/wiki/GeoJSON) and returns a Promise with the response in GeoJSON Feature format containing place details. |
| `setSendGeocoderRequestFunc(sendGeocoderRequestFunc: (value: string, geocoderAutocomplete: GeocoderAutocomplete) => Promise<GeoJSON.FeatureCollection>): void` | Sets a custom function to send geocoder requests. |
| `setSendPlaceDetailsRequestFunc(sendPlaceDetailsRequestFunc: (feature: GeoJSON.Feature, geocoderAutocomplete: GeocoderAutocomplete) => Promise<GeoJSON.Feature>): void` | Sets a custom function to send place details requests. |
| `on(operation: 'select' or 'suggestions' or 'input' or 'close' or 'open', callback: (param: any) => void): void` | Attaches event listeners to various operations such as selection, suggestions, input changes, and dropdown open/close. |
| `off(operation: 'select' or 'suggestions' or 'input' or 'close' or 'open', callback?: (param: any) => void): void` | Detaches previously attached event listeners. |
| `once(operation: 'select' or 'suggestions' or 'input' or 'close' or 'open', callback: (param: any) => void): void` | Attaches a one-time event listener that triggers only once for the specified operation. |
#### Example. Setting Geocoder options
The library offers a flexible API that enables the dynamic configuration of Geoapify Geocoder options at runtime:
```javascript

@@ -214,3 +268,2 @@ const autocomplete = new GeocoderAutocomplete(...);

// set filter

@@ -229,3 +282,9 @@ autocomplete.addFilterByCountry(codes);

autocomplete.clearBias();
```
#### Example. Close and open the suggestions dropdown automatically
You can also interact with the suggestions dropdown through the API, allowing you to check its current state and toggle the open/close state as needed:
```javascript
// get and change dropdown list state

@@ -237,7 +296,6 @@ autocomplete.isOpen();

#### Setting and getting display value
You can also set initial value or change display value:
#### Example. Setting and getting the display value
You have the ability to retrieve the current value or modify the displayed value:
```javascript
const autocomplete = new GeocoderAutocomplete(...);
autocomplete.setValue(value);

@@ -248,8 +306,10 @@

## Hooks and suggestions filter
By adding preprocessing and post-processing hooks and suggestions filter you can change the entered/displayed values and suggestions list:
* **Preprocess Hook** - you can modify the text to search. For example, if you expect that the user enters a street name you can add a city or postcode to search streets in the city.
* **Postprocess Hook** - you can modify the text that will be displayed in the input field and suggestions list. For example, you can show only a street name.
* **Suggestions Filter** - allows filtering some suggestions. It lets to avoid duplicated results when you modify the address with a post-process hook. For example, suggestions may contain several addresses with the same street name, they will be duplicated when not the whole address but only the street name is shown.
#### Example. Hooks and suggestions filter
Through the inclusion of preprocessing and post-processing hooks, as well as a suggestions filter, you modify both the entered values before sending the request and the received suggestions list:
* **Preprocess Hook** - Empower your address search by modifying the input text dynamically. For instance, when expecting a street name, you can enhance the search by adding a city or postcode to find streets within that specific location.
* **Postprocess Hook** - Tailor the displayed text in both the input field and suggestions list to match your desired format. For example, you can choose to display only the street name, offering a cleaner and more user-friendly presentation.
* **Suggestions Filter** - Efficiently manage and filter suggestions to prevent duplication or remove unnecessary items. This feature is particularly useful when applying a post-process hook, ensuring that suggestions with identical street names are intelligently handled and presented without redundancy.
```javascript

@@ -294,6 +354,82 @@

```
## Geocoder Autocomplete events
You can add event listeners to the Geocoder Autocomplete:
#### Example. Overwrite send request method
The library provides the flexibility to override default API methods, with Geoapify API being the default choice, for searching addresses. This allows you to seamlessly integrate custom or third-party address search services, offering you the freedom to tailor the geocoding functionality to your specific needs.
Here is an example of how you can override the default API methods to integrate custom or third-party address search services:
```javascript
autocomplete.setSendGeocoderRequestFunc((value: string, geocoderAutocomplete: GeocoderAutocomplete) => {
if (/* check here if you can geocode the value */) {
...
return new Promise((resolve, reject) => {
resolve({
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
...
"formatted": address
},
"geometry": {
"type": "Point",
"coordinates": [lon, lat]
}
}
]
})
});
}
// You can call the default search method this way
return geocoderAutocomplete.sendGeocoderRequest(value);
});
autocomplete.setSendPlaceDetailsRequestFunc((feature: any, geocoderAutocomplete: GeocoderAutocomplete) => {
if (/* you have details for the place */) {
...
return new Promise((resolve, reject) => {
resolve({
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
...
"formatted": address
},
"geometry": { ... }
}
]
})
});
}
// You can call the default place details method this way
return geocoderAutocomplete.sendPlaceDetailsRequest(feature);
});
```
### Events
`@geoapify/geocoder-autocomplete` provides a set of event handling functions—on, off, and once. These functions allow you to attach, detach, and manage event listeners for various user interactions and changes within the library.
| Event Name | Description |
|---------------|------------------------------------------------------------------------------------------------------------------------|
| `select` | Triggered when a suggestion is selected from the dropdown. Useful for capturing and responding to user selections. |
| `suggestions` | Fired when suggestions are provided, allowing access to the list of suggestions for customization or interaction. |
| `input` | Occurs whenever the input field value changes, providing real-time feedback on user input for dynamic adjustments. |
| `close` | Triggered when the suggestions dropdown is closed, enabling actions to be performed when the dropdown closes. |
| `open` | Fired when the suggestions dropdown is opened, offering an opportunity to respond to dropdown opening events. |
These events offer flexibility and customization options for creating tailored interactions and user experiences in your application.
#### Example. Geocoder Autocomplete events
You have the option to attach event listeners to the Geocoder Autocomplete:
```javascript
autocomplete.on('select', (location) => {

@@ -340,13 +476,44 @@ // check selected location here

## Working with non-verified values
If you are considering using the Geocoder Autocomplete library to collect postal addresses, it is best to make it more tolerant and allow adding non-verified address parts - house numbers and streets.
For example, it may occur that new streets or houses are not yet included in the databases. Therefore, restricting customer addresses will not be a proper strategy.
To allow users to add non-verified address parts, use the allowNonVerifiedHouseNumber and allowNonVerifiedStreet parameters.
## Styling
### How does it work?
The API returns a parsed address, the found address, and a match type as results. Using this data, the library extends the result by adding missing values, such as house numbers.
The non-verified part has a "non-verified" class which makes the text red by default.
The GPS coordinates of the results will point to the actual results and should be adjusted by the user if necessary.
We offer a variety of built-in themes within the library, catering to different webpage styles:
In addition, the result object is extended by the list of non-verified properties. For example:
1. **Minimal Theme**: Designed for webpages with a light background color.
2. **Round Borders Theme**: Tailored for webpages with a light background color, featuring rounded borders.
3. **Minimal Dark Theme**: Ideal for webpages with a dark background color.
4. **Round Borders Dark Theme**: Specifically crafted for webpages with a dark background color, incorporating rounded borders.
These themes offer versatile styling options to seamlessly integrate the address autocomplete component into various webpage designs.
Moreover, if you prefer to have complete control over the styling, you have the opportunity to customize the component yourself. Below are the CSS classes used for styling:
| Class Name | Description |
| ---------------------------------------------- | -------------------------------------------------------------- |
| `.geoapify-autocomplete-input` | Styles the input element. |
| `.geoapify-autocomplete-items` | Styles the dropdown list. |
| `.geoapify-autocomplete-items .active` | Styles the selected item in the dropdown list. |
| `.geoapify-autocomplete-item` | Styles the individual dropdown list items. |
| `.geoapify-autocomplete-item.icon` | Styles the icon within the dropdown list items. |
| `.geoapify-autocomplete-item.text` | Styles the text within the dropdown list items. |
| `.geoapify-close-button` | Styles the clear button. |
| `.geoapify-autocomplete-items .main-part .non-verified` | Styles a portion of the street address that could not be verified by the Geocoder. |
## Working with non-verified address components
When utilizing the Geocoder Autocomplete library to gather postal addresses, it's often advantageous to adopt a more permissive approach, allowing for the inclusion of non-verified address components such as house numbers and streets.
In real-world scenarios, it's possible that newly constructed streets or houses may not yet be included in existing databases. Restricting users from entering such addresses may not align with your objectives.
To accommodate users and enable the inclusion of non-verified address parts, you can leverage the `allowNonVerifiedHouseNumber` and `allowNonVerifiedStreet` parameters. These settings empower users to contribute address details that may not yet be officially validated, fostering flexibility and completeness in your address data collection process.
### How it works
The library operates by utilizing the API to retrieve essential address details, including the parsed address, the located address, and a match type as results. Using this information as a foundation, the library enhances the result by filling in missing values, such as house numbers, to provide a more complete and user-friendly address representation.
Notably, non-verified address components are denoted with a "non-verified" class, making them visually distinct by default, often highlighted in red to indicate their provisional or unverified status.
It's essential to note that the GPS coordinates associated with the results correspond to the actual locations. Users have the flexibility to adjust these coordinates as needed to ensure accuracy.
Furthermore, the result object is expanded to include a list of non-verified properties. For instance:
```json

@@ -368,19 +535,8 @@ {

## Styling
We provide several Themes within the library:
* `minimal` and `round-borders` - for webpages with light background color
* `minimal-dark` and `round-borders-dark` for webpages with dark background color.
This extended result object provides transparency by clearly indicating which address components are non-verified, allowing for informed decision-making and customization based on the level of validation required for your specific use case.
However, you have also opportunity to style the component by yourself. Here are the classes used:
| Name | Description |
| ------ | ------ |
| `.geoapify-autocomplete-input ` | The input element |
| `.geoapify-autocomplete-items` | The dropdown list |
| `.geoapify-autocomplete-items .active` | Selected item in the dropdown list |
| `.geoapify-autocomplete-item` | The dropdown list item|
| `.geoapify-autocomplete-item.icon` | The dropdown list item icon |
| `.geoapify-autocomplete-item.text` | The dropdown list item text |
| `.geoapify-close-button` | The clear button |
| `.geoapify-autocomplete-items .main-part .non-verified` | A portion of the street address could not be verified by Geocoder |
## License
This library is open-source and released under the MIT License.
### Find more Geoapify APIs, Playgrounds and code samples on [apidocs.geoapify.com](https://apidocs.geoapify.com).
## Contributions and Support
We welcome contributions from the developer community. If you encounter any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request on [GitHub](https://github.com/geoapify/geocoder-autocomplete).
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