import { Component, Element, h, Prop, State } from "@stencil/core";
import { Name } from "@payfunc/model";
import * as translation from "./translation";
export class PayfuncOrderCustomer {
  componentWillLoad() {
    this.t = translation.create(this.element);
  }
  render() {
    return !this.customer || Object.values(this.customer).length < 1 ? (h("p", null, this.t("There is no customer information available."))) : ([
      this.customer.name && (h("section", null,
        h("dt", null, this.t("Name")),
        h("smoothly-display", { type: "text", value: Name.get(this.customer.name) }))),
      this.customer.email && (h("section", null,
        h("dt", null, this.t("Email")),
        h("payfunc-email-addresses", { editable: false, value: this.customer.email }))),
      this.customer.phone && (h("section", null,
        h("dt", null, this.t("Phone")),
        h("payfunc-phone-numbers", { editable: false, value: this.customer.phone }))),
    ]);
  }
  static get is() { return "payfunc-order-customer"; }
  static get encapsulation() { return "scoped"; }
  static get originalStyleUrls() { return {
    "$": ["style.css"]
  }; }
  static get styleUrls() { return {
    "$": ["style.css"]
  }; }
  static get properties() { return {
    "customer": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "Customer",
        "resolved": "Customer | undefined",
        "references": {
          "Customer": {
            "location": "import",
            "path": "@payfunc/model"
          }
        }
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": ""
      }
    }
  }; }
  static get states() { return {
    "t": {}
  }; }
  static get elementRef() { return "element"; }
}
