import { Component, h, Prop } from "@stencil/core";
import { ModelState } from "../../../model";
export class IntergiroAuthorizationDetails {
  constructor() {
    this.abbreviated = false;
  }
  render() {
    var _a;
    let result;
    switch (this.opened) {
      case "amount":
        result = (h("ig-authorization-amount", { state: ModelState.Authorization.is(this.state) ? this.state : undefined, "settlement-currency": (_a = this.merchant) === null || _a === void 0 ? void 0 : _a.currency, "cost-plus": this.costPlus }));
        break;
      case "number":
        result = (h("ig-number-details", { number: this.state.authorization.number, identifier: this.state.authorization.id, reference: ModelState.Authorization.is(this.state) ? this.state.authorization.reference : undefined }));
        break;
      case "card":
        result = h("ig-authorization-card", { value: this.state });
        break;
      case "merchant":
        result = (h("ig-merchant-table", { class: "table", abbrivated: true, merchants: this.merchant ? [this.merchant] : [] }));
        break;
      case "history":
        result = h("ig-authorization-history", { state: this.state });
        break;
      default:
        return "";
    }
    return h("td", { colSpan: this.abbreviated ? 7 : 8 }, result);
  }
  static get is() { return "ig-authorization-details"; }
  static get encapsulation() { return "scoped"; }
  static get originalStyleUrls() { return {
    "$": ["style.css"]
  }; }
  static get styleUrls() { return {
    "$": ["style.css"]
  }; }
  static get properties() { return {
    "state": {
      "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": ""
      }
    },
    "opened": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "opened",
      "reflect": false
    },
    "merchant": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "Merchant",
        "resolved": "Merchant | undefined",
        "references": {
          "Merchant": {
            "location": "import",
            "path": "@payfunc/model-acquirer"
          }
        }
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": ""
      }
    },
    "costPlus": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean | undefined",
        "references": {}
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "cost-plus",
      "reflect": false
    },
    "abbreviated": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "abbreviated",
      "reflect": false,
      "defaultValue": "false"
    }
  }; }
}
