import { Component, Event, h, Prop } from '@stencil/core';
export class ConfirmDialog {
  constructor() {
    this.dialogStyle = 'success';
    this.allowedDialogStyles = ['success', 'danger', 'warning', 'info'];
  }
  componentWillLoad() {
    this.validateDialogStyle();
  }
  componentDidUpdate() {
    this.validateDialogStyle();
  }
  render() {
    return (h("div", { class: "uiid-delete-benefit-popup" },
      h("div", { class: "my-3" },
        h("slot", null)),
      h("div", { class: "text-right" },
        h("button", { class: `uiid-confirm-delete-benefit-item btn btn-${this.dialogStyle} mr-3`, onClick: (_) => {
            var _a;
            (_a = this.accepted) === null || _a === void 0 ? void 0 : _a.emit();
          } }, this.acceptText || 'Accept'),
        h("button", { class: "btn btn-light", onClick: (_) => {
            var _a;
            (_a = this.declined) === null || _a === void 0 ? void 0 : _a.emit();
          } }, this.declineText || 'Decline'))));
  }
  validateDialogStyle() {
    if (!this.allowedDialogStyles.some((style) => style === this.dialogStyle)) {
      this.dialogStyle = 'success';
    }
  }
  static get is() { return "ap-ben-confirm-dialog"; }
  static get properties() { return {
    "titleText": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string | HTMLElement",
        "resolved": "HTMLElement | string",
        "references": {
          "HTMLElement": {
            "location": "global"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "title-text",
      "reflect": false
    },
    "acceptText": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string | undefined",
        "references": {}
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "accept-text",
      "reflect": false
    },
    "declineText": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string | undefined",
        "references": {}
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "decline-text",
      "reflect": false
    },
    "dialogStyle": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "DialogStyle",
        "resolved": "\"danger\" | \"info\" | \"success\" | \"warning\"",
        "references": {
          "DialogStyle": {
            "location": "local"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "dialog-style",
      "reflect": false,
      "defaultValue": "'success'"
    }
  }; }
  static get events() { return [{
      "method": "accepted",
      "name": "accepted",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "complexType": {
        "original": "void",
        "resolved": "void",
        "references": {}
      }
    }, {
      "method": "declined",
      "name": "declined",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "complexType": {
        "original": "void",
        "resolved": "void",
        "references": {}
      }
    }, {
      "method": "cancelled",
      "name": "cancelled",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "complexType": {
        "original": "void",
        "resolved": "void",
        "references": {}
      }
    }]; }
}
