import { Component, h, Prop } from "@stencil/core";
export class CustomerOrders {
  getCustomCssVariables() {
    var _a, _b, _c, _d, _e, _f;
    const result = {};
    if (this.cosmetic && (typeof this.cosmetic == "object" || ((_a = this.cosmetic) === null || _a === void 0 ? void 0 : _a.length) > 0)) {
      const cosmetic = typeof this.cosmetic == "string" && this.cosmetic.length > 0 ? JSON.parse(this.cosmetic) : this.cosmetic;
      Object.entries({
        "--smoothly-font-family": (_b = cosmetic === null || cosmetic === void 0 ? void 0 : cosmetic.fontFamily) !== null && _b !== void 0 ? _b : cosmetic === null || cosmetic === void 0 ? void 0 : cosmetic.font_family,
        "--smoothly-light-color": (_c = cosmetic === null || cosmetic === void 0 ? void 0 : cosmetic.header) === null || _c === void 0 ? void 0 : _c.background,
        "--smoothly-light-contrast": (_d = cosmetic === null || cosmetic === void 0 ? void 0 : cosmetic.header) === null || _d === void 0 ? void 0 : _d.color,
        "--smoothly-dark-shade": (_e = cosmetic === null || cosmetic === void 0 ? void 0 : cosmetic.body) === null || _e === void 0 ? void 0 : _e.background,
        "--smoothly-default-shade": (_f = cosmetic === null || cosmetic === void 0 ? void 0 : cosmetic.body) === null || _f === void 0 ? void 0 : _f.background,
      }).forEach(([key, value]) => {
        value && (result[key] = value);
      });
    }
    return result;
  }
  render() {
    return (h("ig-orders", { display: true, orders: this.orders, receipt: this.receipt, embedded: this.component, style: this.getCustomCssVariables() }));
  }
  static get is() { return "customer-orders"; }
  static get encapsulation() { return "scoped"; }
  static get originalStyleUrls() { return {
    "$": ["style.css"]
  }; }
  static get styleUrls() { return {
    "$": ["style.css"]
  }; }
  static get properties() { return {
    "orders": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "Order[]",
        "resolved": "Order[]",
        "references": {
          "Order": {
            "location": "import",
            "path": "@payfunc/model"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      }
    },
    "receipt": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean | undefined",
        "references": {}
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "receipt",
      "reflect": false
    },
    "component": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "\"app\" | \"order\"",
        "resolved": "\"app\" | \"order\" | undefined",
        "references": {}
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "component",
      "reflect": true
    },
    "cosmetic": {
      "type": "string",
      "mutable": true,
      "complexType": {
        "original": "| string\n\t\t| {\n\t\t\t\tfontFamily?: string\n\t\t\t\theader?: { background?: string; color?: string }\n\t\t\t\tbody?: { background?: string; color?: string }\n\t\t\t\tsuccess?: { background?: string; color?: string }\n\t\t  }",
        "resolved": "string | undefined | { fontFamily?: string | undefined; header?: { background?: string | undefined; color?: string | undefined; } | undefined; body?: { background?: string | undefined; color?: string | undefined; } | undefined; success?: { background?: string | undefined; color?: string | undefined; } | undefined; }",
        "references": {}
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "cosmetic",
      "reflect": false
    }
  }; }
}
