1import{_ as e,d as t,n,r,s as i,t as a}from"./registry-BClMXjSj.js";import{t as o}from"./recaptcha-v2-challenge-hQCwoF14.js";import{t as s}from"./const-element-DZ_2STjZ.js";import{t as c}from"./render-tag-D9LZGhou.js";import{t as l}from"./text-input-CrDI2Z-O.js";import{t as u}from"./underlay-DxpbTTWu.js";import{t as d}from"./submit-button-Dl2BTmQ6.js";import{t as f}from"./post-form-BSm50vWq.js";var p=r(),m=e(s()),h=e(i()),g=e(n()),_=a(),v=e(t()),y=`re`,b=(0,p.t)(y),x=(0,m.default)(`g`,null,2).e(`path`,{style:`fill:#1A1A1A`,d:`M240.705,297.282l-14.059-134.547c-2.092-20.021,13.61-37.449,33.74-37.449h0.76c20.116,0,35.813,17.405,33.743,37.414l-13.92,134.561c-1.058,10.224-9.673,17.993-19.951,17.993h-0.365C250.383,315.255,241.772,307.497,240.705,297.282z M229.68,365.293v-0.625c0-17.094,13.858-30.952,30.952-30.952h0.625c17.094,0,30.952,13.858,30.952,30.952v0.625c0,17.094-13.858,30.952-30.952,30.952h-0.625C243.538,396.245,229.68,382.387,229.68,365.293z`},0).e(`path`,{style:`fill:#FFBC00`,d:`M260.766,0C116.749,0,0,116.749,0,260.766s116.749,260.766,260.766,260.766s260.766-116.749,260.766-260.766S404.783,0,260.766,0z M260.766,475.679c-118.693,0-214.913-96.22-214.913-214.913c0-118.693,96.22-214.913,214.913-214.913c118.693,0,214.913,96.22,214.913,214.913C475.679,379.459,379.459,475.679,260.766,475.679z`},0);(0,_.r)(y,()=>b);var S={};b._=(0,g.default)(function(e,t,n,r,i,a){t.be(`svg`,{width:e.width||`50px`,height:e.height||`50px`,class:(0,h.default)(e.class),version:`1.1`,x:`0px`,y:`0px`,viewBox:`0 0 521.532 521.532`,id:`Icon`},`0`,r,null,0),t.n(x,r),t.ee()},{t:y,i:!0},S),b.Component=(0,v.default)(S,b._);var C=e(c()),w=`Rb`,T=(0,p.t)(w),E=(0,m.default)(`div`,{class:`billing-recovery-banner__copy`},2).e(`strong`,null,1).t(`We couldnât process your monthly gift.`).e(`span`,null,1).t(`Please update your payment method to keep your support active.`),D=(0,m.default)(`form`,{action:`/stripe/billing-recovery`,method:`post`,target:`_blank`,rel:`noopener`},1).e(`button`,{type:`submit`,class:`billing-recovery-banner__button`},1).t(`Update payment method`);(0,_.r)(w,()=>T);var O={onCreate(){this.refreshSequence=0,this.state={visible:!1}},onMount(){this.refresh=this.refresh.bind(this),this.hide=this.hide.bind(this),this.handlePageShow=this.handlePageShow.bind(this),this.handleVisibilityChange=this.handleVisibilityChange.bind(this),document.addEventListener(`updateHeaderWithLoginInfo`,this.refresh),document.addEventListener(`memberLogout`,this.hide),window.addEventListener(`pageshow`,this.handlePageShow),document.addEventListener(`visibilitychange`,this.handleVisibilityChange),this.refresh()},onDestroy(){this.refreshSequence+=1,document.removeEventListener(`updateHeaderWithLoginInfo`,this.refresh),document.removeEventListener(`memberLogout`,this.hide),window.removeEventListener(`pageshow`,this.handlePageShow),document.removeEventListener(`visibilitychange`,this.handleVisibilityChange)},hide(){this.refreshSequence+=1,this.state.visible=!1},handlePageShow(e){e.persisted&&this.refresh()},handleVisibilityChange(){document.visibilityState===`visible`&&this.refresh()},hasAuthenticatedMember(){if(window.Member===void 0)return!1;let e=window.Member.getMemberFromCookie();return!!(e.email&&e.sessionKey)},async refresh(){let e=++this.refreshSequence;if(!this.hasAuthenticatedMember()){this.state.visible=!1;return}try{let t=await fetch(`/stripe/billing-recovery/status`,{credentials:`same-origin`,headers:{Accept:`application/json`}});if(e!==this.refreshSequence)return;if(!t.ok){this.state.visible=!1;return}let n=await t.json();if(e!==this.refreshSequence)return;this.state.visible=n.show===!0}catch(t){if(e!==this.refreshSequence)return;this.state.visible=!1,typeof elasticApm<`u`&&(typeof elasticApm.addLabels==`function`&&elasticApm.addLabels({billingRecoveryOperation:`check_status`}),typeof elasticApm.captureError==`function`&&elasticApm.captureError(t))}}};T._=(0,g.default)(function(e,t,n,r,i,a){i.visible&&(t.be(`aside`,{role:`alert`,"aria-label":`Monthly gift payment notice`,class:`billing-recovery-banner`},`0`,r,null,0),t.be(`div`,{class:`billing-recovery-banner__content`},`1`,r,null,1),t.be(`div`,{class:`billing-recovery-banner__message`},`2`,r,null,1),t.be(`span`,{"aria-hidden":`true`,class:`billing-recovery-banner__icon`},`3`,r,null,0),(0,C.default)(b,{width:`20px`,height:`20px`},t,n,`4`),t.ee(),t.n(E,r),t.ee(),t.n(D,r),t.ee(),t.ee())},{t:w},O),T.Component=(0,v.default)(O,T._);var k=`zi`,A=(0,p.t)(k),j=(0,m.default)(`p`,{class:`receiveText`},1).t(`Receive the latest news, updates, and contribution opportunities from the ACLJ.`),M=(0,m.default)(`p`,{class:`errorText`},1).t(`Please complete the security challenge.`);(0,_.r)(k,()=>A);var N={onCreate(e){this.state={visible:e.visible||!1,reveal:!1,formType:e.formType||`login`,formIsSubmitting:!1,showingResetRecaptchaV2:!1}},onMount(){this.showLoginForm=this.showLoginForm.bind(this),this.showRegisterForm=this.showRegisterForm.bind(this),document.addEventListener(`showLoginForm`,this.showLoginForm),document.addEventListener(`showRegisterForm`,this.showRegisterForm)},onDestroy(){document.removeEventListener(`showLoginForm`,this.showLoginForm),document.removeEventListener(`showRegisterForm`,this.showRegisterForm)},showLoginForm(){this.state.formType=`login`,this.reveal()},showRegisterForm(){this.state.formType=`register`,this.reveal()},onInput(e){e.visible&&this.reveal(),this.state.formType=e.formType||this.state.formType||`login`},outsideClick(e){e.target!==void 0&&e.target!==null&&e.target.getAttribute(`id`)===`Login-Reg
1ister-Modal`&&this.dismiss()},reveal(){this.state.visible||(this.state.visible=!0,this.once(`update`,()=>{setTimeout(()=>{this.state.reveal=!0},10)}))},dismiss(){this.state.reveal=!1,this.state.showingResetRecaptchaV2=!1,this.once(`update`,()=>{setTimeout(()=>{this.state.visible=!1,this.state.formType=`login`},333)})},switchForms(e){if(!0&e!==null){this.state.formType=e;return}let t=this.state.formType;if(t===`login`){this.state.formType=`register`;return}if(t===`register`){this.state.formType=`login`;return}},response(e){e.success&&(this.emit(`loginRegisterSuccess`),this.dismiss(),this.state.formIsSubmitting=!1),document.dispatchEvent(new CustomEvent(`updateHeaderWithLoginInfo`))},submitting(){this.state.formIsSubmitting=!0},error(e){if(this.state.formIsSubmitting=!1,e.errors!==void 0&&e.errors.length>0){let t=e.errors[0];document.dispatchEvent(new CustomEvent(`showErrorAlert`,{detail:t}))}else document.dispatchEvent(new CustomEvent(`showErrorAlert`,{detail:`An unknown error occurred. Please try again.`}))},resetPassword(){let e=document.getElementById(`loginEmailInput`),t=e.value.trim(),n=document.getElementById(`loginRegisterTimestamp`).value;if(t===``){document.dispatchEvent(new CustomEvent(`showErrorAlert`,{detail:`Please enter your email address.`}));return}if(e.value=t,!e.checkValidity()){document.dispatchEvent(new CustomEvent(`showErrorAlert`,{detail:`Please use the format [email protected]`}));return}ReCaptcha.gRecordAction(`passwordReset`,e=>{this.submitPasswordReset(t,n,{recaptchaV3Token:e})})},submitPasswordReset(e,t,n){fetch(`/generate-reset`,{method:`POST`,headers:{"Content-Type":`application/json`,"X-Requested-With":`XMLHttpRequest`},body:JSON.stringify({email:e,timestamp:t,...n})}).then(function(e){return e.json()}).then(function(n){if(n.needsV2Validation){this.state.showingResetRecaptchaV2=!0;let n=this.el.querySelector(`#ReCaptchaChallenge-password-reset-request`);ReCaptcha.getV2Token(n,n=>{if(!n){this.state.showingResetRecaptchaV2=!1,document.dispatchEvent(new CustomEvent(`showErrorAlert`,{detail:`Unable to load the security challenge. Please try again.`}));return}this.state.showingResetRecaptchaV2=!1,this.submitPasswordReset(e,t,{recaptchaV2Token:n})});return}if(this.state.showingResetRecaptchaV2=!1,n.success)document.dispatchEvent(new CustomEvent(`showSuccessAlert`,{detail:`Success! An email has been sent to help you reset your password.`}));else{let e=n.errors?.[0]||`Unable to request a password reset. Please try again.`;document.dispatchEvent(new CustomEvent(`showErrorAlert`,{detail:e}))}this.emit(`response`,n)}.bind(this)).catch(function(e){this.state.showingResetRecaptchaV2=!1,document.dispatchEvent(new CustomEvent(`showErrorAlert`,{detail:e.message}))}.bind(this))}};A._=(0,g.default)(function(e,t,n,r,i,a){if(i.visible){t.be(`div`,{class:(0,h.default)(i.reveal&&`modal-visible`),id:`Login-Register-Modal`},`0`,r,null,1,{onclick:n.d(`click`,`outsideClick`,!1)}),t.be(`div`,{class:(0,h.default)([`modal-container`,i.reveal&&`modal-visible`])},`1`,r,null,1),t.be(`div`,{class:`form-tabs flex fill`},`2`,r,null,1),t.be(`div`,{class:(0,h.default)([`login-tab flex fill jc`,{selected:i.formType===`login`}])},`3`,r,null,1,{onclick:n.d(`click`,`switchForms`,!1,[`login`])}),t.t(`Login`,r),t.ee(),t.be(`div`,{class:(0,h.default)([`register-tab flex fill jc`,{selected:i.formType===`register`}])},`4`,r,null,1,{onclick:n.d(`click`,`switchForms`,!1,[`register`])}),t.t(`Register`,r),t.ee(),t.ee(),t.be(`div`,{class:`form-container`},`5`,r,null,1);{t.be(`p`,{class:`dismiss-button`},`6`,r,null,1,{onclick:n.d(`click`,`dismiss`,!1)}),t.t(`Ã`,r),t.ee();let e=i.formType==`login`?`Login`:`Register`;t.be(`h3`,null,`7`,r,null,0),t.t(e,r),t.ee(),(0,C.default)(f,{action:`/gh3j456`,formType:i.formType,renderBody:t=>{t.be(`div`,{class:`flex fill jcsa fdc`},`9`,r,null,1),(0,C.default)(l,{hidden:!0,name:`timestamp`,value:t.global.timestamp,id:`loginRegisterTimestamp`},t,n,`10`),t.global.topicTag!==void 0&&t.global.topicTag!==null&&(0,C.default)(l,{hidden:!0,name:`entryTopic`,value:t.global.topicTag},t,n,`11`),i.formType===`register`?((0,C.default)(l,{name:`firstName`,placeholder:`First Name`,autocomplete:`given-name`,id:`registerFirstNameInput`},t,n,`12`),(0,C.default)(l,{name:`lastName`,placeholder:`Last Name`,autocomplete:`family-name`,id:`registerLastNameInput`},t,n,`13`),(0,C.default)(l,{name:`email`,placeholder:`Email`,autocomplete:`email`,inputmode:`email`,id:`registerEmailInput`},t,n,`14`),(0,C.default)(l,{type:`password`,name:`password`,placeholder:`Password`,id:`registerPasswordInput`},t,n,`15`)):i.formType===`login`&&((0,C.default)(l,{type:`email`,name:`email`,placeholder:`Email`,autocomplete:`email`,inputmode:`email`,id:`loginEmailInput`},t,n,`16`),(0,C.default)(l,{type:`password`,name:`password`,placeholder:`Password`,id:`loginPasswordInput`},t,n,`17`)),t.ee();let a=e;i.formIsSubmitting&&(a=i.formType===`login`?`Logging In`:`Registering`),(0,C.default)(d,{disabled:i.formIsSubmitting,submitting:i.formIsSubmitting,renderBody:e=>{e.t(a,r)}},t,n,`18`),i.formType===`register`&&t.n(j,r),i.formType===`login`&&(t.be(`a`,{preventSPA:``,class:`passwordReset flex jc`},`20`,r,null,0,{onclick:n.d(`click`,`resetPassword`,!1)}),t.t(`Forgot password? Click here to reset it.`,r),t.ee(),t.be(`div`,{style:`padding-top: 20px`,class:(0,h.default)([`errorRecaptchaContainer`,{prominent:i.showingResetRecaptchaV2}])},`21`,r,null,1),(0,C.default)(o,{itemId:`password-reset-request`},t,n,`22`),i.showingResetRecaptchaV2&&t.n(M,r),t.ee(),(0,C.default)(u,{class:{visible:i.showingResetRecaptchaV2}},t,n,`24`))}},t,n,`8`,[[`response`,`response`,!1],[`submit`,`submitting`,!1],[`failure`,`error`,!1]])}t.ee(),t.ee(),t.ee()}},{t:k},N),A.Component=(0,v.default)(N,A._);export{T as n,b as r,A as t};
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.