import { Component, Element, h, Prop, State } from "@stencil/core";
import * as translation from "../../translation";
export class IntergiroAuthorizationHistoryCreate {
  componentWillLoad() {
    this.t = translation.create(this.element);
  }
  render() {
    var _a;
    return (this.history.type == "create" && [
      h("section", null,
        h("smoothly-display", null, this.t("status")),
        h("smoothly-display", null, this.t(this.history.status))),
      h("section", null,
        h("smoothly-display", null, this.t("merchant")),
        h("smoothly-display", null, this.history.merchant)),
      h("section", null,
        h("smoothly-display", null, this.t("number")),
        h("smoothly-display", null, this.history.number)),
      this.history.status != "success" && [
        this.history.rule && (h("section", null,
          h("smoothly-display", null, this.t("rules")),
          this.history.rule.map(r => (h("smoothly-display", null, r))))),
        this.history.card && (h("section", null,
          h("smoothly-display", null, this.t("card")),
          h("smoothly-display", null, this.history.card.scheme + " " + ((_a = this.history.card.type) !== null && _a !== void 0 ? _a : "")),
          h("smoothly-display", { type: "card-number", value: this.history.card.iin + "******" + this.history.card.last4 }),
          this.history.card.csc && (h("smoothly-display", { type: "text", value: "CSC " + this.history.card.csc })),
          h("smoothly-display", { type: "card-expires", value: this.history.card.expires }))),
        this.history.descriptor && (h("section", null,
          h("smoothly-display", null, this.t("descriptor")),
          h("smoothly-display", null, this.history.descriptor))),
        this.history.recurring && (h("section", null,
          h("smoothly-display", null, this.t("recurring")),
          h("smoothly-display", null, typeof this.history.recurring == "string" ? this.history.recurring : this.history.recurring.type))),
      ],
      this.history.status == "fail" && [
        this.history.verification && (h("section", null,
          h("smoothly-display", null, this.t("verification")),
          h("smoothly-display", null, this.history.verification))),
      ],
      h("ig-authorization-history-error", { history: this.history }),
    ]);
  }
  static get is() { return "ig-authorization-history-create"; }
  static get encapsulation() { return "scoped"; }
  static get originalStyleUrls() { return {
    "$": ["style.css"]
  }; }
  static get styleUrls() { return {
    "$": ["style.css"]
  }; }
  static get properties() { return {
    "history": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "Authorization.History",
        "resolved": "Fail | Pending | Settlement | Success",
        "references": {
          "Authorization": {
            "location": "import",
            "path": "@payfunc/model-acquirer"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      }
    }
  }; }
  static get states() { return {
    "t": {}
  }; }
  static get elementRef() { return "element"; }
}
