/**
 * @license
 * Copyright 2023 Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
import{a as u,d as A}from"./chunk.BNIUTBJV.js";import{a as E}from"./chunk.E3K6KM57.js";import{y as I}from"./chunk.MZLPUI6R.js";import{d as O}from"./chunk.TEHQWMFI.js";import{a as T,d as N,l as C}from"./chunk.WHQZNZHW.js";import{a as f}from"./chunk.UWYANU5D.js";import{a as s}from"./chunk.KTGSZEAG.js";import{a as _,b as B}from"./chunk.DL7NX432.js";import{a as h,d as b,h as c,l as g}from"./chunk.LJLEPTLU.js";import{u as m}from"./chunk.4LA6HEA7.js";import{k as p}from"./chunk.J2M2MXP2.js";import{f as n}from"./chunk.MCIQXNKY.js";var r=class extends f{constructor(i){super(i)}setIcon(i){this._iconElement.name=i}initialize(){this._badgeElement=c(this._component,u.elementName),this._iconElement=c(this._component,T.elementName)}setCount(i){this._badgeElement.textContent=i!=null?String(i):""}setBadgeType(i){this._badgeElement.dot=i}setBadgeTheme(i){m(this._badgeElement,!!i,u.attributes.THEME,i)}setBadgeVisible(i){this._badgeElement.open=i}};var v=`${B}app-bar-notification-button`,x={COUNT:"count",DOT:"dot",THEME:"theme",SHOW_BADGE:"show-badge",ICON:"icon"},t={elementName:v,attributes:x};var d=class{constructor(e){this._adapter=e;this._count=0;this._dot=!1;this._showBadge=!1;this._isInitialized=!1;this._icon="notifications"}initialize(){this._adapter.initialize(),this._adapter.setCount(this._count),this._adapter.setBadgeType(this._dot),this._adapter.setBadgeTheme(this._theme),this._adapter.setBadgeVisible(this._showBadge),this._adapter.setIcon(this._icon),this._isInitialized=!0}disconnect(){this._isInitialized=!1}get icon(){return this._icon}set icon(e){this._icon!==e&&(this._icon=e,this._isInitialized&&(this._adapter.setIcon(this._icon),this._adapter.setHostAttribute(t.attributes.ICON,this._icon)))}get count(){return this._count}set count(e){this._count!==e&&(this._count=e,this._isInitialized&&(this._dot||this._adapter.setCount(this._count),typeof this._count=="string"?this._adapter.setHostAttribute(t.attributes.COUNT,this._count):e==null&&this._adapter.removeHostAttribute(t.attributes.COUNT)))}get dot(){return this._dot}set dot(e){this._dot!==e&&(this._dot=e,this._isInitialized&&(this._adapter.setBadgeType(this._dot),this._dot?this._adapter.setCount(null):this._adapter.setCount(this._count),this._adapter.toggleHostAttribute(t.attributes.DOT,this._dot)))}get theme(){return this._theme}set theme(e){this._theme!==e&&(this._theme=e,this._isInitialized&&(this._adapter.setBadgeTheme(this._theme),this._adapter.setHostAttribute(t.attributes.THEME,this._theme)))}get showBadge(){return this._showBadge}set showBadge(e){this._showBadge!==e&&(this._showBadge=e,this._isInitialized&&(this._adapter.setBadgeVisible(this._showBadge),this._adapter.setHostAttribute(t.attributes.SHOW_BADGE,this._showBadge)))}};var H='<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>',o=class extends g{constructor(){super();N.define(I),this._foundation=new d(new r(this))}static get observedAttributes(){return[t.attributes.COUNT,t.attributes.DOT,t.attributes.THEME,t.attributes.SHOW_BADGE,t.attributes.ICON]}initializedCallback(){b(this,H)}connectedCallback(){this._foundation.initialize()}attributeChangedCallback(i,S,a){switch(i){case t.attributes.COUNT:this.count=a;break;case t.attributes.DOT:this.dot=p(a);break;case t.attributes.THEME:this.theme=a;break;case t.attributes.ICON:this.icon=a;break;case t.attributes.SHOW_BADGE:this.showBadge=p(a);break}}};n([s()],o.prototype,"count",2),n([s()],o.prototype,"dot",2),n([s()],o.prototype,"theme",2),n([s()],o.prototype,"icon",2),n([s()],o.prototype,"showBadge",2),o=n([_({name:t.elementName,dependencies:[E,O,A,C]})],o);function nt(){h(o)}export{r as a,t as b,d as c,o as d,nt as e};
//# sourceMappingURL=chunk.QIGNMZRL.js.map
