import { unsafeCSS, LitElement, nothing, html } from "lit";
import { property } from "lit/decorators.js";
import { choose } from "lit/directives/choose.js";
import compentStyle from "./alert-menu-item.css.js";
import { ObcMessageMenuItemSize } from "../message-menu-item/message-menu-item.js";
import "../alert-icon/alert-icon.js";
import "../../icons/icon-alerts-shelf.js";
import "../../icons/icon-alarm-noack-iec.js";
import "../../icons/icon-warning-noack-iec.js";
import { customElement } from "../../decorator.js";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __decorateClass = (decorators, target, key, kind) => {
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
    if (decorator = decorators[i])
      result = (kind ? decorator(target, key, result) : decorator(result)) || result;
  if (kind && result) __defProp(target, key, result);
  return result;
};
var ObcAlertMenuItemStatus = /* @__PURE__ */ ((ObcAlertMenuItemStatus2) => {
  ObcAlertMenuItemStatus2["Unacknowledged"] = "unacknowledged";
  ObcAlertMenuItemStatus2["Caution"] = "caution";
  ObcAlertMenuItemStatus2["Acknowledged"] = "acknowledged";
  ObcAlertMenuItemStatus2["NoAckAlarm"] = "no-ack-alarm";
  ObcAlertMenuItemStatus2["NoAckWarning"] = "no-ack-warning";
  ObcAlertMenuItemStatus2["Rectified"] = "rectified";
  return ObcAlertMenuItemStatus2;
})(ObcAlertMenuItemStatus || {});
let ObcAlertMenuItem = class extends LitElement {
  constructor() {
    super(...arguments);
    this.hasIcon = false;
    this.shelved = false;
    this.title = "";
    this.description = "";
    this.day = "";
    this.time = "";
    this.status = "unacknowledged";
    this.open = false;
    this.size = ObcMessageMenuItemSize.SingleLine;
    this.animateIntro = false;
  }
  get primaryActionLabel() {
    return this.status === "unacknowledged" ? "ACK" : "";
  }
  get hasTrailingIcon() {
    return this.status !== "unacknowledged";
  }
  handleMessageClick() {
    this.dispatchEvent(new CustomEvent("item-click"));
    this.open = !this.open;
  }
  handleActionClick() {
    this.dispatchEvent(new CustomEvent("ack-click"));
  }
  render() {
    return html`
      <obc-message-menu-item
        .title=${this.title}
        .description=${this.description}
        .day=${this.day}
        .time=${this.time}
        .primaryActionLabel=${this.primaryActionLabel}
        .size=${this.size}
        .open=${this.open}
        .hasSecondaryIcon=${this.hasIcon}
        .isShelved=${this.shelved}
        .hasTrailingIcon=${this.hasTrailingIcon}
        enhancedIcon
        hasPrimaryIcon
        @message-click=${this.handleMessageClick}
        @primary-action-click=${this.handleActionClick}
      >
        <slot name="alert-icon" slot="primary-icon"></slot>
        <slot name="title" slot="title">${this.title}</slot>
        <slot name="description" slot="description">${this.description}</slot>
        ${this.hasIcon ? html`<slot name="icon" slot="secondary-icon"></slot>` : nothing}
        ${choose(this.status, [
      [
        "no-ack-alarm",
        () => html`<obi-alarm-noack-iec
                slot="trailing-icon"
                useCssColor
              ></obi-alarm-noack-iec>`
      ],
      [
        "no-ack-warning",
        () => html`<obi-warning-noack-iec
                slot="trailing-icon"
                useCssColor
              ></obi-warning-noack-iec>`
      ]
    ])}
      </obc-message-menu-item>
    `;
  }
};
ObcAlertMenuItem.styles = unsafeCSS(compentStyle);
__decorateClass([
  property({ type: Boolean })
], ObcAlertMenuItem.prototype, "hasIcon", 2);
__decorateClass([
  property({ type: Boolean, reflect: true })
], ObcAlertMenuItem.prototype, "shelved", 2);
__decorateClass([
  property({ type: String })
], ObcAlertMenuItem.prototype, "title", 2);
__decorateClass([
  property({ type: String })
], ObcAlertMenuItem.prototype, "description", 2);
__decorateClass([
  property({ type: String })
], ObcAlertMenuItem.prototype, "day", 2);
__decorateClass([
  property({ type: String })
], ObcAlertMenuItem.prototype, "time", 2);
__decorateClass([
  property({ type: String, reflect: true })
], ObcAlertMenuItem.prototype, "status", 2);
__decorateClass([
  property({ type: Boolean })
], ObcAlertMenuItem.prototype, "open", 2);
__decorateClass([
  property({ type: String })
], ObcAlertMenuItem.prototype, "size", 2);
__decorateClass([
  property({ type: Boolean })
], ObcAlertMenuItem.prototype, "animateIntro", 2);
ObcAlertMenuItem = __decorateClass([
  customElement("obc-alert-menu-item")
], ObcAlertMenuItem);
export {
  ObcAlertMenuItem,
  ObcAlertMenuItemStatus
};
//# sourceMappingURL=alert-menu-item.js.map
