/**
 * @license
 * Copyright 2023 Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
import { __decorate } from "tslib";
import { attachLightTemplate, coerceBoolean, CustomElement, FoundationProperty } from '@tylertech/forge-core';
import { tylIconNotifications } from '@tylertech/tyler-icons/standard';
import { BadgeComponent } from '../../badge';
import { BaseComponent } from '../../core/base/base-component';
import { IconComponent, IconRegistry } from '../../icon';
import { IconButtonComponent } from '../../icon-button';
import { TooltipComponent } from '../../tooltip';
import { AppBarNotificationButtonAdapter } from './app-bar-notification-button-adapter';
import { APP_BAR_NOTIFICATION_BUTTON_CONSTANTS } from './app-bar-notification-button-constants';
import { AppBarNotificationButtonFoundation } from './app-bar-notification-button-foundation';
const template = '<template><forge-icon-button class=\"forge-icon-button--with-badge\"><button type=\"button\" aria-label=\"Show notifications\"><forge-icon></forge-icon></button><forge-tooltip delay=\"500\" position=\"bottom\">Notifications</forge-tooltip><forge-badge positioned app-bar-context></forge-badge></forge-icon-button></template>';
/**
 * The web component class behind the `<forge-app-bar-notification-button>` custom element.
 *
 * @tag forge-app-bar-notification-button
 */
let AppBarNotificationButtonComponent = class AppBarNotificationButtonComponent extends BaseComponent {
    constructor() {
        super();
        IconRegistry.define(tylIconNotifications);
        this._foundation = new AppBarNotificationButtonFoundation(new AppBarNotificationButtonAdapter(this));
    }
    static get observedAttributes() {
        return [
            APP_BAR_NOTIFICATION_BUTTON_CONSTANTS.attributes.COUNT,
            APP_BAR_NOTIFICATION_BUTTON_CONSTANTS.attributes.DOT,
            APP_BAR_NOTIFICATION_BUTTON_CONSTANTS.attributes.THEME,
            APP_BAR_NOTIFICATION_BUTTON_CONSTANTS.attributes.SHOW_BADGE,
            APP_BAR_NOTIFICATION_BUTTON_CONSTANTS.attributes.ICON
        ];
    }
    initializedCallback() {
        attachLightTemplate(this, template);
    }
    connectedCallback() {
        this._foundation.initialize();
    }
    attributeChangedCallback(name, oldValue, newValue) {
        switch (name) {
            case APP_BAR_NOTIFICATION_BUTTON_CONSTANTS.attributes.COUNT:
                this.count = newValue;
                break;
            case APP_BAR_NOTIFICATION_BUTTON_CONSTANTS.attributes.DOT:
                this.dot = coerceBoolean(newValue);
                break;
            case APP_BAR_NOTIFICATION_BUTTON_CONSTANTS.attributes.THEME:
                this.theme = newValue;
                break;
            case APP_BAR_NOTIFICATION_BUTTON_CONSTANTS.attributes.ICON:
                this.icon = newValue;
                break;
            case APP_BAR_NOTIFICATION_BUTTON_CONSTANTS.attributes.SHOW_BADGE:
                this.showBadge = coerceBoolean(newValue);
                break;
        }
    }
};
__decorate([
    FoundationProperty()
], AppBarNotificationButtonComponent.prototype, "count", void 0);
__decorate([
    FoundationProperty()
], AppBarNotificationButtonComponent.prototype, "dot", void 0);
__decorate([
    FoundationProperty()
], AppBarNotificationButtonComponent.prototype, "theme", void 0);
__decorate([
    FoundationProperty()
], AppBarNotificationButtonComponent.prototype, "icon", void 0);
__decorate([
    FoundationProperty()
], AppBarNotificationButtonComponent.prototype, "showBadge", void 0);
AppBarNotificationButtonComponent = __decorate([
    CustomElement({
        name: APP_BAR_NOTIFICATION_BUTTON_CONSTANTS.elementName,
        dependencies: [
            IconButtonComponent,
            TooltipComponent,
            BadgeComponent,
            IconComponent
        ]
    })
], AppBarNotificationButtonComponent);
export { AppBarNotificationButtonComponent };
