import { Component, h, Prop } from "@stencil/core";
import * as isoly from "isoly";
import { Address } from "@payfunc/model";
export class IntergiroAddressDisplay {
  render() {
    var _a, _b, _c;
    const value = typeof this.value == "string" ? JSON.parse(this.value) : this.value;
    return value.countryCode == "" ? (h("address", null, (_a = value.address1) !== null && _a !== void 0 ? _a : "",
      h("br", null), (_b = value.address2) !== null && _b !== void 0 ? _b : "",
      h("br", null), (_c = value.address3) !== null && _c !== void 0 ? _c : "")) : (h("address", null,
      value.street,
      h("br", null),
      value.zipCode,
      " ",
      value.city,
      h("br", null),
      Address.DE.is(value) || (Address.General.is(value) && value.state) ? value.state + " " : [],
      isoly.CountryCode.Name.from("en", value.countryCode)));
  }
  static get is() { return "ig-address-display"; }
  static get encapsulation() { return "scoped"; }
  static get originalStyleUrls() { return {
    "$": ["style.css"]
  }; }
  static get styleUrls() { return {
    "$": ["style.css"]
  }; }
  static get properties() { return {
    "value": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string | Address",
        "resolved": "DE | DK | FI | General | NO | SE | string",
        "references": {
          "Address": {
            "location": "import",
            "path": "@payfunc/model"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "value",
      "reflect": false
    }
  }; }
}
