"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("./query-assigned-elements-8EurZY45.js"),o=require("./tslib.es6-CHeFCc6E.js"),c=require("./ripple-handlers-C7an-EE1.js"),d=require("./aria-property-Dl2ZKBbP.js"),l=require("./property-DYTC_2-m.js"),v=require("./state-C3HoXfoa.js"),h=require("./event-options-DD382x85.js"),b=require("./query-Dv2F3m_t.js"),R=require("./if-defined-CZCqOAYs.js"),m=require("./mwc-icon-button.css-BzElD_JI.js");/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class t extends s.s{constructor(){super(...arguments),this.disabled=!1,this.icon="",this.shouldRenderRipple=!1,this.rippleHandlers=new c.RippleHandlers(()=>(this.shouldRenderRipple=!0,this.ripple))}renderRipple(){return this.shouldRenderRipple?s.x`
            <mwc-ripple
                .disabled="${this.disabled}"
                unbounded>
            </mwc-ripple>`:""}focus(){const e=this.buttonElement;e&&(this.rippleHandlers.startFocus(),e.focus())}blur(){const e=this.buttonElement;e&&(this.rippleHandlers.endFocus(),e.blur())}render(){return s.x`<button
        class="mdc-icon-button mdc-icon-button--display-flex"
        aria-label="${this.ariaLabel||this.icon}"
        aria-haspopup="${R.l(this.ariaHasPopup)}"
        ?disabled="${this.disabled}"
        @focus="${this.handleRippleFocus}"
        @blur="${this.handleRippleBlur}"
        @mousedown="${this.handleRippleMouseDown}"
        @mouseenter="${this.handleRippleMouseEnter}"
        @mouseleave="${this.handleRippleMouseLeave}"
        @touchstart="${this.handleRippleTouchStart}"
        @touchend="${this.handleRippleDeactivate}"
        @touchcancel="${this.handleRippleDeactivate}"
    >${this.renderRipple()}
    ${this.icon?s.x`<i class="material-icons">${this.icon}</i>`:""}
    <span
      ><slot></slot
    ></span>
  </button>`}handleRippleMouseDown(e){const r=()=>{window.removeEventListener("mouseup",r),this.handleRippleDeactivate()};window.addEventListener("mouseup",r),this.rippleHandlers.startPress(e)}handleRippleTouchStart(e){this.rippleHandlers.startPress(e)}handleRippleDeactivate(){this.rippleHandlers.endPress()}handleRippleMouseEnter(){this.rippleHandlers.startHover()}handleRippleMouseLeave(){this.rippleHandlers.endHover()}handleRippleFocus(){this.rippleHandlers.startFocus()}handleRippleBlur(){this.rippleHandlers.endFocus()}}o.__decorate([l.n({type:Boolean,reflect:!0})],t.prototype,"disabled",void 0);o.__decorate([l.n({type:String})],t.prototype,"icon",void 0);o.__decorate([d.ariaProperty,l.n({type:String,attribute:"aria-label"})],t.prototype,"ariaLabel",void 0);o.__decorate([d.ariaProperty,l.n({type:String,attribute:"aria-haspopup"})],t.prototype,"ariaHasPopup",void 0);o.__decorate([b.i("button")],t.prototype,"buttonElement",void 0);o.__decorate([c.e("mwc-ripple")],t.prototype,"ripple",void 0);o.__decorate([v.t()],t.prototype,"shouldRenderRipple",void 0);o.__decorate([h.e({passive:!0})],t.prototype,"handleRippleMouseDown",null);o.__decorate([h.e({passive:!0})],t.prototype,"handleRippleTouchStart",null);const _=':host{color:var(--mdc-theme-text-icon-on-background)}:host .mdc-icon-button{cursor:var(--cv-icon-button-cursor, pointer)}:host .mdc-icon-button:active,:host .mdc-icon-button:focus{font-variation-settings:"FILL" 1}';var y=Object.getOwnPropertyDescriptor,f=(n,e,r,p)=>{for(var i=p>1?void 0:p?y(e,r):e,a=n.length-1,u;a>=0;a--)(u=n[a])&&(i=u(i)||i);return i};exports.CovalentIconButton=class extends t{};exports.CovalentIconButton.styles=[m.styles,s.i`${s.r(_)}`];exports.CovalentIconButton=f([s.e("cv-icon-button")],exports.CovalentIconButton);const H=exports.CovalentIconButton;exports.default=H;
