1import{C as u}from"./site.B0Uxz9u8.js";import"./password-strength.AqUmoxgQ.js";const e=class e extends u{constructor(){super(...arguments),this.supports=["spektrix"],this.boundOnAmountClick=this.onAmountClick.bind(this)}connect(){this.supports.includes(this.vendorValue)&&this.attachHandlers()}disconnect(){this.amountTargets.forEach(t=>{t.removeEventListener("click",this.boundOnAmountClick)})}attachHandlers(){var t;this.amountTargets.forEach(s=>{s.addEventListener("click",this.boundOnAmountClick)}),this.customInputWrapperTarget&&this.hasCustomButtonTarget&&((t=this.customButtonTarget)==null||t.addEventListener("click",this.boundOnAmountClick))}onAmountClick(t){const s=t.currentTarget;if(this.hasCustomButtonTarget&&s===this.customButtonTarget){this.handleCustomAmountSelection(s);return}this.resetButtonStates(),this.activateButton(s),this.hideCustomInput()}resetButtonStates(){var t;this.amountTargets.forEach(s=>this.resetButtonState(s)),this.customInputWrapperTarget&&this.hasCustomButtonTarget&&((t=this.customButtonTarget)==null||t.setAttribute("aria-expanded","false"),this.resetButtonState(this.customButtonTarget))}resetButtonState(t){t.classList.add("btn-default"),t.classList.remove("btn-active","donations__amount-button--active"),t.setAttribute("aria-pressed","false")}activateButton(t){t.classList.remove("btn-default"),t.classList.add("btn-active","donations__amount-button--active"),t.setAttribute("aria-pressed","true")}handleCustomAmountSelection(t){var a;this.resetButtonStates(),this.activateButton(t),this.showCustomInput();const s=(a=this.customInputWrapperTarget)==null?void 0:a.querySelector("input");s==null||s.focus()}showCustomInput(){!this.customInputWrapperTarget||!this.customButtonTarget||(this.customInputWrapperTarget.hidden=!1,this.customInputWrapperTarget.classList.remove("is-hidden"),this.customButtonTarget.setAttribute("aria-expanded","true"),this.customInputWrapperTarget.setAttribute("aria-hidden","false"))}hideCustomInput(){!this.customInputWrapperTarget||!this.customButtonTarget||(this.customInputWrapperTarget.hidden=!0,this.customButtonTarget.setAttribute("aria-expanded","false"),this.customInputWrapperTarget.setAttribute("aria-hidden","true"),this.customInputWrapperTarget.classList.add("is-hidden"))}};e.values={vendor:String},e.targets=["amount","customButton","customInputWrapper"];let i=e;export{i as default}; 2//# sourceMappingURL=donations_controller.sNYWa1oh.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.