/**
 * @license
 * Copyright 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><forge-icon></forge-icon><forge-badge slot=\"badge\"></forge-badge></forge-icon-button><forge-tooltip type=\"label\" placement=\"bottom\">Notifications</forge-tooltip></template>';
/**
 * @tag forge-app-bar-notification-button
 *
 * @property {number | string} count - The number to display in the badge.
 * @property {boolean} dot - Whether to display the dot variant of the badge or not.
 * @property {boolean} showBadge - Whether to display the badge or not.
 * @property {string} theme - The theme to apply to the badge.
 * @property {string} icon - The name of an alternative icon to display.
 *
 * @attribute {string} [count] - The number to display in the badge.
 * @attribute {boolean} [dot] - Whether to display the dot variant of the badge or not.
 * @attribute {boolean} [show-badge] - Whether to display the badge or not.
 * @attribute {string} [theme] - The theme to apply to the badge.
 * @attribute {string} [icon] - The name of an alternative icon to display.
 * @attribute {string} [aria-label] - The aria-label to apply to the button.
 * @attribute {string} [aria-labelledby] - The id of an element to use as the aria-labelledby attribute.
 */
let AppBarNotificationButtonComponent = class AppBarNotificationButtonComponent extends BaseComponent {
    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
        ];
    }
    constructor() {
        super();
        IconRegistry.define(tylIconNotifications);
        this._foundation = new AppBarNotificationButtonFoundation(new AppBarNotificationButtonAdapter(this));
    }
    initializedCallback() {
        attachLightTemplate(this, template);
    }
    connectedCallback() {
        this._foundation.initialize();
    }
    disconnectedCallback() {
        this._foundation.destroy();
    }
    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 };
