import { Component, Element, h, Prop, State } from "@stencil/core";
import * as translation from "../../translation";
export class IntergiroAuthorizationHistoryError {
  componentWillLoad() {
    this.t = translation.create(this.element);
  }
  render() {
    return ("error" in this.history && [
      h("smoothly-display", null, this.t("error")),
      h("smoothly-display", null, this.history.error.status + " " + this.history.error.type),
      this.history.error.header && h("smoothly-display", null, this.history.error.header),
      this.history.error.body && h("smoothly-display", null, this.history.error.body),
      this.history.error.error && h("smoothly-display", null, this.history.error.error),
      h("details", null,
        h("summary", null, this.t("details")),
        Object.entries(this.history.error).map(value => [
          h("content", null,
            h("smoothly-display", { type: "text", value: value[0] + ": " }),
            h("section", null, typeof value[1] == "object" ? (Object.entries(value[1]).map(value => (h("smoothly-display", { type: "text", value: value[0] + ": " + value[1] })))) : (h("smoothly-display", { type: "text", value: value[1].toString() })))),
        ])),
    ]);
  }
  static get is() { return "ig-authorization-history-error"; }
  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"; }
}
