How To Add Country Restrictions to Address Autocomplete

If you would like to restrict the countries that show up when using address autocomplete, you can use this snippet:

You must use 2 letter country abbreviations from the the ISO 3166-1 Alpha-2 standard:
https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2

Note: Due to Google Maps API restrictions, they only accept 5 or fewer countries.