import { ChangeDetectionStrategy, Component, HostBinding, Input } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "./items/notification-items.component";
export class AthenaNotificationsComponent {
    constructor(_eref) {
        this._eref = _eref;
        this.items = [];
        this.isExpanded = false;
        this.isLoaded = false;
    }
    ngOnInit() { }
    get themeClass() {
        return this.isExpanded ? "active-menuitem" : "";
    }
    ngAfterViewInit() {
        setTimeout(() => {
            this.isLoaded = true;
        }, 0);
    }
    collapse() {
        if (this.isLoaded && !this._eref.nativeElement.contains(event.target)) {
            this.isExpanded = false;
        }
    }
    toggle() {
        this.isExpanded = !this.isExpanded;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: AthenaNotificationsComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.5", type: AthenaNotificationsComponent, selector: "[smz-ui-athena-notifications]", inputs: { items: "items" }, host: { listeners: { "document:click": "collapse($event)" }, properties: { "class": "this.themeClass" } }, ngImport: i0, template: `
      <a class="notification clickable" (click)="toggle()">
          <!-- <span class="username">Notificações</span>
          <i class="profile-submenu-icon pi pi-angle-down"></i> -->
          <i class="pi pi-bell"></i><span class="topbar-badge">{{ items.length }}</span>
      </a>
      <ul *ngIf="isExpanded" class="topbar-menu topbar-notification-menu-top-adjust fadeInDown topbar-menu-visible" smz-ui-athena-notification-items [items]="items"></ul>
  `, isInline: true, styles: [".notification{font-weight:700;color:var(--primary-color-text);margin-left:1rem;position:relative}.notification i{line-height:inherit;font-size:1.5rem}.topbar-notification-menu-top-adjust{margin-top:-17px!important}.topbar-badge{position:absolute;display:block;right:-5px;top:-10px;width:1rem;height:1rem;line-height:1rem;font-size:.714rem;border-radius:50%;font-weight:600;background:var(--primary-color-text);color:var(--primary-color);text-align:center}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.AthenaNotificationItemsComponent, selector: "[smz-ui-athena-notification-items]", inputs: ["items"], outputs: ["onClose"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: AthenaNotificationsComponent, decorators: [{
            type: Component,
            args: [{ selector: '[smz-ui-athena-notifications]', host: { "(document:click)": "collapse($event)" }, changeDetection: ChangeDetectionStrategy.OnPush, template: `
      <a class="notification clickable" (click)="toggle()">
          <!-- <span class="username">Notificações</span>
          <i class="profile-submenu-icon pi pi-angle-down"></i> -->
          <i class="pi pi-bell"></i><span class="topbar-badge">{{ items.length }}</span>
      </a>
      <ul *ngIf="isExpanded" class="topbar-menu topbar-notification-menu-top-adjust fadeInDown topbar-menu-visible" smz-ui-athena-notification-items [items]="items"></ul>
  `, styles: [".notification{font-weight:700;color:var(--primary-color-text);margin-left:1rem;position:relative}.notification i{line-height:inherit;font-size:1.5rem}.topbar-notification-menu-top-adjust{margin-top:-17px!important}.topbar-badge{position:absolute;display:block;right:-5px;top:-10px;width:1rem;height:1rem;line-height:1rem;font-size:.714rem;border-radius:50%;font-weight:600;background:var(--primary-color-text);color:var(--primary-color);text-align:center}\n"] }]
        }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { items: [{
                type: Input
            }], themeClass: [{
                type: HostBinding,
                args: ["class"]
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm90aWZpY2F0aW9ucy5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtc216LXVpL3NyYy9saWIvbW9kdWxlcy9zbXotbGF5b3V0cy9sYXlvdXRzL2F0aGVuYS9jb21wb25lbnRzL25vdG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