import{LitElement as t,html as e,css as i}from"../../../lit/index.js";class a11yCarouselButton extends t{static get styles(){return[i`
        :host {
          display: inline;
          background-color: transparent;
          border: 1px solid black;
          padding: 2px 5px;
          margin: 15px 2px;
          text-align: center;
        }
        :host([hidden]) {
          display: none !important;
        }
        :host([disabled]) {
          opacity: 0.5;
        }
        @media print {
          :host {
            display: none !important;
          }
        }
      `]}render(){return e` <slot></slot> `}static get properties(){return{active:{type:Boolean,attribute:"active",reflect:!0},buttonType:{type:String,attribute:"button-type",reflect:!0},controls:{type:String,attribute:"controls",reflect:!0},disabled:{type:Boolean,attribute:"disabled",reflect:!0},hidden:{type:Boolean,attribute:"hidden",reflect:!0}}}static get tag(){return"a11y-carousel-button"}constructor(){super(),this.tabindex=0,this.setAttribute("role","button"),this.setAttribute("tabindex",0),this.addEventListener("click",this._handleClick),this.addEventListener("keydown",this._handleClick),this.active=!1,this.hidden=!1,this.disabled=!1}disconnectedCallback(){this.removeEventListener("click",this._handleClick),this.removeEventListener("keydown",this._handleClick),super.disconnectedCallback&&super.disconnectedCallback()}updated(t){super.updated&&super.updated(t),t.forEach(((t,e)=>{["controls","active"].includes(e)&&(this.disabled=!this.controls||this.active)}))}_handleClick(t){"keydown"===t.type&&" "!==t.key&&"Enter"!==t.key&&"Spacebar"!==t.key||this.disabled||(t.preventDefault(),this.dispatchEvent(new CustomEvent("select-carousel-item",{bubbles:!0,cancelable:!0,composed:!0,detail:this})))}}customElements.define(a11yCarouselButton.tag,a11yCarouselButton);export{a11yCarouselButton};