/*!
 * Copyright (c) what3words http://what3words.com
 */
var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s)
        if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
            t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import { DEFAULTS } from "../../../lib/constants";
import { t } from "../../../lib/translation";
import { h } from "@stencil/core";
const c = "what3words-autosuggest";
export const W3wSuggestion = (_a) => {
    var { opt } = _a, props = __rest(_a, ["opt"]);
    const { country, distanceToFocusKm, nearestPlace = "", words, language, } = opt;
    return (h("div", Object.assign({}, props), h("div", { class: `${c}-address`, "data-testid": "address" }, h("what3words-symbol", { size: DEFAULTS.iconSize, color: DEFAULTS.iconColor }), h("div", { class: `${c}-words`, "data-testid": "words" }, words)), h("div", { class: `${c}-nearest-place`, "data-testid": "nearest-place" }, country.toLowerCase() === "zz" ? (h("div", { class: `${c}-flag ${c}-flag-${country.toLowerCase()}`, "data-testid": "flag" })) : null, h("div", { class: `${c}-nearest-place-text`, "data-testid": "nearest-place-text" }, nearestPlace && (h("div", null, t("nearest_place", {
        param: nearestPlace,
        language,
        strict: false,
    }))), distanceToFocusKm ? (h("div", { class: `${c}-nearest-place-distance`, "data-testid": "nearest-place-distance" }, distanceToFocusKm, " km")) : null))));
};
