"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:"26d009715ed44a80dde820f8bfe3b80d47b78bd4",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:"4e335b691136e8323a2126180daa27761b1a1afa",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)}"}}]);