/**
 * Copyright 2019 Penn State University
 * @license Apache-2.0, see License.md for full text.
 */
import{LitElement as e,html as t,css as r}from"../../../lit/index.js";import{RadioBehaviors as o}from"../../radio-behaviors/radio-behaviors.js";class SimpleToolbarButtonGroup extends(o(e)){static get tag(){return"simple-toolbar-button-group"}static get properties(){return{...super.properties,required:{type:Boolean,attribute:"required",reflect:!0}}}constructor(){super(),this.setAttribute("role","radiogroup"),this.classList.add("group"),this.addEventListener("button-toggled",this._handleToggle)}connectedCallback(){super.connectedCallback(),this.querySelectorAll(`${this.__query}`).forEach((e=>{e.id||(e.id=this._generateUUID())})),this.selectItem(this.selection),this._updateItemData()}render(){return t`<slot></slot>`}get __allowNull(){return!this.required}get __query(){return"*[radio]:not([hidden])"}get __selected(){return"toggled"}_handleToggle(e){this.selectItem(e.detail.isToggled?e.detail.id:void 0)}}customElements.define(SimpleToolbarButtonGroup.tag,SimpleToolbarButtonGroup);export{SimpleToolbarButtonGroup};