"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:"92417f50ee6590ac0827f9202634ca82145f2918",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:"73e89d0eab17bc101e501eab499e0f8f7acae885",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)}"}}]);