"""Static lookup tables for location normalization."""

from __future__ import annotations

COUNTRY_ALIASES: dict[str, str] = {
    "us": "US",
    "usa": "US",
    "u.s.": "US",
    "u.s.a.": "US",
    "united states": "US",
    "united states of america": "US",
    "uk": "GB",
    "u.k.": "GB",
    "united kingdom": "GB",
    "great britain": "GB",
    "england": "GB",
    "scotland": "GB",
    "wales": "GB",
    "northern ireland": "GB",
    "canada": "CA",
    "ca": "CA",
    "australia": "AU",
    "au": "AU",
    "new zealand": "NZ",
    "nz": "NZ",
    "germany": "DE",
    "deutschland": "DE",
    "de": "DE",
    "france": "FR",
    "fr": "FR",
    "spain": "ES",
    "es": "ES",
    "italy": "IT",
    "it": "IT",
    "ireland": "IE",
    "ie": "IE",
    "netherlands": "NL",
    "nl": "NL",
    "switzerland": "CH",
    "ch": "CH",
    "austria": "AT",
    "at": "AT",
    "belgium": "BE",
    "be": "BE",
    "portugal": "PT",
    "pt": "PT",
    "sweden": "SE",
    "se": "SE",
    "norway": "NO",
    "no": "NO",
    "denmark": "DK",
    "dk": "DK",
    "finland": "FI",
    "fi": "FI",
    "poland": "PL",
    "pl": "PL",
    "czech republic": "CZ",
    "czechia": "CZ",
    "cz": "CZ",
    "hungary": "HU",
    "hu": "HU",
    "romania": "RO",
    "ro": "RO",
    "greece": "GR",
    "gr": "GR",
    "turkey": "TR",
    "tr": "TR",
    "russia": "RU",
    "ru": "RU",
    "ukraine": "UA",
    "ua": "UA",
    "israel": "IL",
    "il": "IL",
    "united arab emirates": "AE",
    "uae": "AE",
    "ae": "AE",
    "india": "IN",
    "in": "IN",
    "singapore": "SG",
    "sg": "SG",
    "japan": "JP",
    "jp": "JP",
    "south korea": "KR",
    "korea, republic of": "KR",
    "kr": "KR",
    "china": "CN",
    "cn": "CN",
    "hong kong": "HK",
    "hk": "HK",
    "taiwan": "TW",
    "tw": "TW",
    "mexico": "MX",
    "mx": "MX",
    "brazil": "BR",
    "br": "BR",
    "argentina": "AR",
    "ar": "AR",
    "chile": "CL",
    "cl": "CL",
    "colombia": "CO",
    "co": "CO",
    "south africa": "ZA",
    "za": "ZA",
    "nigeria": "NG",
    "ng": "NG",
    "kenya": "KE",
    "ke": "KE",
}

REGION_ALIASES: dict[str, tuple[str, str]] = {
    "al": ("Alabama", "US"),
    "alabama": ("Alabama", "US"),
    "ak": ("Alaska", "US"),
    "alaska": ("Alaska", "US"),
    "az": ("Arizona", "US"),
    "arizona": ("Arizona", "US"),
    "ar": ("Arkansas", "US"),
    "arkansas": ("Arkansas", "US"),
    "ca": ("California", "US"),
    "california": ("California", "US"),
    "co": ("Colorado", "US"),
    "colorado": ("Colorado", "US"),
    "ct": ("Connecticut", "US"),
    "connecticut": ("Connecticut", "US"),
    "de": ("Delaware", "US"),
    "delaware": ("Delaware", "US"),
    "fl": ("Florida", "US"),
    "florida": ("Florida", "US"),
    "ga": ("Georgia", "US"),
    "georgia": ("Georgia", "US"),
    "hi": ("Hawaii", "US"),
    "hawaii": ("Hawaii", "US"),
    "id": ("Idaho", "US"),
    "idaho": ("Idaho", "US"),
    "il": ("Illinois", "US"),
    "illinois": ("Illinois", "US"),
    "in": ("Indiana", "US"),
    "indiana": ("Indiana", "US"),
    "ia": ("Iowa", "US"),
    "iowa": ("Iowa", "US"),
    "ks": ("Kansas", "US"),
    "kansas": ("Kansas", "US"),
    "ky": ("Kentucky", "US"),
    "kentucky": ("Kentucky", "US"),
    "la": ("Louisiana", "US"),
    "louisiana": ("Louisiana", "US"),
    "me": ("Maine", "US"),
    "maine": ("Maine", "US"),
    "md": ("Maryland", "US"),
    "maryland": ("Maryland", "US"),
    "ma": ("Massachusetts", "US"),
    "massachusetts": ("Massachusetts", "US"),
    "mi": ("Michigan", "US"),
    "michigan": ("Michigan", "US"),
    "mn": ("Minnesota", "US"),
    "minnesota": ("Minnesota", "US"),
    "ms": ("Mississippi", "US"),
    "mississippi": ("Mississippi", "US"),
    "mo": ("Missouri", "US"),
    "missouri": ("Missouri", "US"),
    "mt": ("Montana", "US"),
    "montana": ("Montana", "US"),
    "ne": ("Nebraska", "US"),
    "nebraska": ("Nebraska", "US"),
    "nv": ("Nevada", "US"),
    "nevada": ("Nevada", "US"),
    "nh": ("New Hampshire", "US"),
    "new hampshire": ("New Hampshire", "US"),
    "nj": ("New Jersey", "US"),
    "new jersey": ("New Jersey", "US"),
    "nm": ("New Mexico", "US"),
    "new mexico": ("New Mexico", "US"),
    "ny": ("New York", "US"),
    "new york": ("New York", "US"),
    "nc": ("North Carolina", "US"),
    "north carolina": ("North Carolina", "US"),
    "nd": ("North Dakota", "US"),
    "north dakota": ("North Dakota", "US"),
    "oh": ("Ohio", "US"),
    "ohio": ("Ohio", "US"),
    "ok": ("Oklahoma", "US"),
    "oklahoma": ("Oklahoma", "US"),
    "or": ("Oregon", "US"),
    "oregon": ("Oregon", "US"),
    "pa": ("Pennsylvania", "US"),
    "pennsylvania": ("Pennsylvania", "US"),
    "ri": ("Rhode Island", "US"),
    "rhode island": ("Rhode Island", "US"),
    "sc": ("South Carolina", "US"),
    "south carolina": ("South Carolina", "US"),
    "sd": ("South Dakota", "US"),
    "south dakota": ("South Dakota", "US"),
    "tn": ("Tennessee", "US"),
    "tennessee": ("Tennessee", "US"),
    "tx": ("Texas", "US"),
    "texas": ("Texas", "US"),
    "ut": ("Utah", "US"),
    "utah": ("Utah", "US"),
    "vt": ("Vermont", "US"),
    "vermont": ("Vermont", "US"),
    "va": ("Virginia", "US"),
    "virginia": ("Virginia", "US"),
    "wa": ("Washington", "US"),
    "washington": ("Washington", "US"),
    "wv": ("West Virginia", "US"),
    "west virginia": ("West Virginia", "US"),
    "wi": ("Wisconsin", "US"),
    "wisconsin": ("Wisconsin", "US"),
    "wy": ("Wyoming", "US"),
    "wyoming": ("Wyoming", "US"),
    "dc": ("District of Columbia", "US"),
    "district of columbia": ("District of Columbia", "US"),
    "ab": ("Alberta", "CA"),
    "alberta": ("Alberta", "CA"),
    "bc": ("British Columbia", "CA"),
    "british columbia": ("British Columbia", "CA"),
    "mb": ("Manitoba", "CA"),
    "manitoba": ("Manitoba", "CA"),
    "nb": ("New Brunswick", "CA"),
    "new brunswick": ("New Brunswick", "CA"),
    "nl": ("Newfoundland and Labrador", "CA"),
    "newfoundland and labrador": ("Newfoundland and Labrador", "CA"),
    "ns": ("Nova Scotia", "CA"),
    "nova scotia": ("Nova Scotia", "CA"),
    "nt": ("Northwest Territories", "CA"),
    "northwest territories": ("Northwest Territories", "CA"),
    "nu": ("Nunavut", "CA"),
    "nunavut": ("Nunavut", "CA"),
    "on": ("Ontario", "CA"),
    "ontario": ("Ontario", "CA"),
    "pe": ("Prince Edward Island", "CA"),
    "prince edward island": ("Prince Edward Island", "CA"),
    "qc": ("Quebec", "CA"),
    "quebec": ("Quebec", "CA"),
    "sk": ("Saskatchewan", "CA"),
    "saskatchewan": ("Saskatchewan", "CA"),
    "yt": ("Yukon", "CA"),
    "yukon": ("Yukon", "CA"),
}

REMOTE_KEYWORDS: set[str] = {
    "remote",
    "anywhere",
    "distributed",
    "work from home",
    "wfh",
    "home-based",
    "telecommute",
    "telecommuting",
    "virtual",
}

CANADIAN_COUNTRY_KEYWORDS: set[str] = {
    "canada",
    "canadian",
}

CANADIAN_CURRENCY_KEYWORDS: set[str] = {
    "cad",
    "c$",
    "canadian dollar",
    "canadian dollars",
}

CANADIAN_BENEFIT_KEYWORDS: set[str] = {
    "rrsp",
    "tfsa",
    "resp",
    "dpsp",
    "cpp",
    "ei benefit",
}

CANADIAN_COMPLIANCE_KEYWORDS: set[str] = {
    "canada labour code",
    "sin number",
    "social insurance number",
    "ohip",
    "msp",
    "ramq",
}

CANADIAN_POSTAL_RE_PATTERN = r"[A-Za-z]\d[A-Za-z]\s?\d[A-Za-z]\d"

PROVINCE_KEYWORDS: dict[str, str] = {
    "ontario": "Ontario",
    "british columbia": "British Columbia",
    "alberta": "Alberta",
    "quebec": "Quebec",
    "manitoba": "Manitoba",
    "saskatchewan": "Saskatchewan",
    "nova scotia": "Nova Scotia",
    "new brunswick": "New Brunswick",
    "newfoundland": "Newfoundland and Labrador",
    "prince edward island": "Prince Edward Island",
    "northwest territories": "Northwest Territories",
    "nunavut": "Nunavut",
    "yukon": "Yukon",
}

CANADIAN_CITIES: dict[str, str] = {
    "toronto": "ON",
    "vancouver": "BC",
    "montreal": "QC",
    "montréal": "QC",
    "calgary": "AB",
    "edmonton": "AB",
    "ottawa": "ON",
    "winnipeg": "MB",
    "quebec city": "QC",
    "québec city": "QC",
    "hamilton": "ON",
    "kitchener": "ON",
    "waterloo": "ON",
    "london": "ON",
    "victoria": "BC",
    "halifax": "NS",
    "saskatoon": "SK",
    "regina": "SK",
    "st. john's": "NL",
    "st john's": "NL",
    "fredericton": "NB",
    "charlottetown": "PE",
    "whitehorse": "YT",
    "yellowknife": "NT",
    "iqaluit": "NU",
    "mississauga": "ON",
    "brampton": "ON",
    "surrey": "BC",
    "burnaby": "BC",
    "richmond": "BC",
    "markham": "ON",
    "vaughan": "ON",
    "oakville": "ON",
    "burlington": "ON",
    "oshawa": "ON",
    "barrie": "ON",
    "guelph": "ON",
    "kingston": "ON",
    "thunder bay": "ON",
    "sudbury": "ON",
    "windsor": "ON",
    "kelowna": "BC",
    "nanaimo": "BC",
    "kamloops": "BC",
    "laval": "QC",
    "gatineau": "QC",
    "longueuil": "QC",
    "lévis": "QC",
    "levis": "QC",
    "sherbrooke": "QC",
    "trois-rivières": "QC",
    "trois rivieres": "QC",
    "moncton": "NB",
    "saint john": "NB",
    "darthmouth": "NS",
    "red deer": "AB",
    "lethbridge": "AB",
    "medicine hat": "AB",
    "abbotsford": "BC",
    "coquitlam": "BC",
    "chilliwack": "BC",
    "sarnia": "ON",
    "peterborough": "ON",
    "whitby": "ON",
    "ajax": "ON",
    "niagara falls": "ON",
}

US_CITIES: dict[str, str] = {
    "san francisco": "CA",
    "los angeles": "CA",
    "san diego": "CA",
    "san jose": "CA",
    "sacramento": "CA",
    "oakland": "CA",
    "fresno": "CA",
    "long beach": "CA",
    "bakersfield": "CA",
    "redwood city": "CA",
    "mountain view": "CA",
    "irvine": "CA",
    "palo alto": "CA",
    "el segundo": "CA",
    "sunnyvale": "CA",
    "torrance": "CA",
    "south san francisco": "CA",
    "alameda": "CA",
    "menlo park": "CA",
    "burlingame": "CA",
    "santa clara": "CA",
    "berkeley": "CA",
    "santa monica": "CA",
    "san mateo": "CA",
    "concord": "CA",
    "bay area": "CA",
    "malibu": "CA",
    "emeryville": "CA",
    "beverly hills": "CA",
    "moreno valley": "CA",
    "san ramon": "CA",
    "cupertino": "CA",
    "pasadena": "CA",
    "anaheim": "CA",
    "santa barbara": "CA",
    "carlsbad": "CA",
    "walnut creek": "CA",
    "new york": "NY",
    "denver": "CO",
    "boulder": "CO",
    "colorado springs": "CO",
    "fort collins": "CO",
    "wilmington": "DE",
    "dover": "DE",
    "newark": "DE",
    "chicago": "IL",
    "springfield": "IL",
    "aurora": "IL",
    "naperville": "IL",
    "indianapolis": "IN",
    "fort wayne": "IN",
    "evansville": "IN",
    "south bend": "IN",
}
