import { Component, Element, h, Prop, State } from "@stencil/core";
import * as tidily from "tidily";
import * as translation from "../../../translation";
export class IntergiroAuthorizationCard {
  componentWillLoad() {
    this.t = translation.create(this.element);
  }
  render() {
    const card = this.value.authorization.card;
    const descriptor = this.value.authorization.descriptor;
    return card ? ([
      h("section", null,
        h("smoothly-display", null, this.t("scheme")),
        h("smoothly-display", null, card.scheme)),
      h("section", null,
        h("smoothly-display", null, this.t("number")),
        h("smoothly-display", null, tidily.format(card.iin + "******" + card.last4, "card-number"))),
      h("section", null,
        h("smoothly-display", null, this.t("expires")),
        h("smoothly-display", null, typeof card.expires == "string" ? card.expires : tidily.format(card.expires, "card-expires"))),
      descriptor && (h("section", null,
        h("smoothly-display", null, this.t("descriptor")),
        h("smoothly-display", null, descriptor))),
    ]) : (h("p", null, "There is no card information available"));
  }
  static get is() { return "ig-authorization-card"; }
  static get encapsulation() { return "scoped"; }
  static get originalStyleUrls() { return {
    "$": ["style.css"]
  }; }
  static get styleUrls() { return {
    "$": ["style.css"]
  }; }
  static get properties() { return {
    "value": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "ModelState.Authorization | ModelState.FailedAuthorization",
        "resolved": "Authorization | FailedAuthorization",
        "references": {
          "ModelState": {
            "location": "import",
            "path": "../../../../model"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      }
    }
  }; }
  static get states() { return {
    "t": {}
  }; }
  static get elementRef() { return "element"; }
}
