"use strict";(self.webpackChunk_surecart_surecart=self.webpackChunk_surecart_surecart||[]).push([[6756],{6756:function(t,e,n){n.r(e),n.d(e,{sc_button_group:function(){return a}});var o=n(3029),u=n(2901),s=n(1346),a=function(){return(0,u.A)((function t(e){(0,o.A)(this,t),(0,s.r)(this,e),this.label=void 0,this.separate=void 0}),[{key:"findButton",value:function(t){return["sc-button"].includes(t.tagName.toLowerCase())?t:t.querySelector(["sc-button"].join(","))}},{key:"handleFocus",value:function(t){var e=this.findButton(t.target);null==e||e.classList.add("sc-button-group__button--focus")}},{key:"handleBlur",value:function(t){var e=this.findButton(t.target);null==e||e.classList.remove("sc-button-group__button--focus")}},{key:"handleMouseOver",value:function(t){var e=this.findButton(t.target);null==e||e.classList.add("sc-button-group__button--hover")}},{key:"handleMouseOut",value:function(t){var e=this.findButton(t.target);null==e||e.classList.remove("sc-button-group__button--hover")}},{key:"handleSlotChange",value:function(){var t=this;if(!this.separate){var e=this.el.shadowRoot.querySelector("slot").assignedElements({flatten:!0});e.forEach((function(n){var o=t.el.shadowRoot.querySelector("slot").assignedNodes().indexOf(n),u=t.findButton(n);null===u&&t.separate||(u.classList.add("sc-button-group__button"),u.classList.toggle("sc-button-group__button--first",0===o),u.classList.toggle("sc-button-group__button--inner",o>0&&o<e.length-1),u.classList.toggle("sc-button-group__button--last",o===e.length-1))}))}}},{key:"render",value:function(){var t=this;return(0,s.h)("sc-form-control",{key:"f919642c282c7a6efe674321c25964e917909d17",part:"base",class:{"button-group":!0,"button-group--separate":this.separate},role:"group","aria-label":this.label,onFocusout:function(e){return t.handleBlur(e)},onFocusin:function(e){return t.handleFocus(e)},onMouseOver:function(e){return t.handleMouseOver(e)},onMouseOut:function(e){return t.handleMouseOut(e)},label:this.label},(0,s.h)("slot",{key:"ed7e141319513481169a5dba1fbe890938b5e9d1",onSlotchange:function(){return t.handleSlotChange()}}))}},{key:"el",get:function(){return(0,s.a)(this)}}])}();a.style=":host{display:inline-block;--gap:var(--sc-spacing-small)}.button-group{display:flex;flex-wrap:wrap}.button-group--separate{gap:var(--gap)}"}}]);