1import{A as ro,C as Di,D as so,K as lo,a as Ai,b as Et,c as xi,d as Bt,e as Ti,f as zi,g as Pe,h as Oi,i as wi,j as Ut,k as Ni,l as Pt,m as Zn,o as eo,p as ye,q as to,r as io,s as no,u as qi,w as Mi,x as oo,y as ao,z as kt}from"./chunk-E7MNK3JB.js";import{b as Gi}from"./chunk-YGYPLREX.js";import"./chunk-YZTCXSLZ.js";import"./chunk-XEGMZC7D.js";import"./chunk-V4NBUW4M.js";import{a as Kn,c as Xn,d as Jn}from"./chunk-M7MSD22N.js";import{$a as Be,$e as dt,$f as Fn,A as pt,Ac as G,Ad as pi,Ae as ui,Af as Tn,Ag as Ei,B as Zi,Bd as de,Bg as rt,Cb as sn,Cc as te,Cf as On,Ch as bt,D as Ue,Da as ii,Db as ke,Dc as li,Dd as hn,Df as Ci,Dg as Bn,Dh as $n,E,Ea as P,Eb as ze,Ef as Ee,Eg as st,Fa as y,Fg as Un,Ga as d,Gb as ue,Gc as je,Hc as Ne,Hd as _n,I,Id as _e,J as b,Jd as Ce,Je as Ct,Jf as vi,Jg as Pi,Ka as me,L as Jt,La as W,Lg as kn,Ma as H,Md as it,N as J,Nd as nt,O as ne,Od as Gt,Of as $,Pa as ae,Pc as ie,Pd as Cn,Pg as zn,Qa as on,Qc as Me,Qd as mi,Qe as Ye,Qg as qn,R as B,Ra as mt,Rf as wn,Rg as jn,Sd as ve,Se as yn,Sf as Nn,Sg as Wn,T as en,Ta as ni,Tb as k,Td as be,Tf as Mn,Tg as Hn,Ua as u,Uc as un,Ue as Ft,Uf as Si,Va as v,Vf as Dn,Wa as A,Wb as ut,Wc as wt,X as Xe,Xa as q,Xb as N,Xc as Nt,Xe as In,Ye as bn,Za as Le,Zb as tt,Zc as Mt,Ze as En,Zf as yi,_ as o,_a as Ve,_c as di,_e as fi,_f as Gn,aa as Zt,ab as j,ac as V,b as Qi,bb as oi,bd as fn,be as Z,c as Ot,cb as ki,da as S,db as ai,dc as ce,de as vn,eb as Ie,ef as Qt,eg as Rn,f as $i,fa as O,fb as R,g as K,ga as tn,gc as ln,hc as dn,hg as Ii,ib as c,ic as ft,ig as bi,j as Ze,jb as f,je as gt,jh as Yn,k as Ki,ka as M,kb as T,kc as fe,kd as ci,ke as ht,kf as Pn,kg as St,kh as Qn,lb as w,le as ot,lg as yt,ma as ei,me as _t,nb as an,nc as cn,nf as gi,o as Q,oa as p,oc as U,oe as De,of as hi,p as Xi,pa as nn,pe as We,pf as Se,qa as m,qc as ee,qe as Ge,qf as vt,qh as It,r as et,rc as pn,rd as x,re as He,rf as Rt,sa as ti,sb as ri,sc as mn,t as xe,ta as Te,tc as qe,td as se,tg as Ln,u as Ji,ua as Oe,ud as le,ug as Vt,v as Xt,va as g,vb as rn,vd as Je,w as Yt,wa as a,wc as we,wd as Dt,wf as Lt,wg as at,x as F,xa as r,xd as gn,xf as An,xg as Vn,ya as h,yc as oe,yd as Y,yf as xn,zb as si,zc as ge,zd as he,ze as Sn,zf as _i}from"./chunk-H3TG5NXB.js";import{a as L,b as pe,h as Kt}from"./chunk-Y4LTQPCL.js";var co=(()=>{class t{constructor(e,n){this.donorInvitationSvc=e,this.router=n}resolve(e){let n=e.paramMap.get("invitationId");return this.donorInvitationSvc.getInvitation(n).pipe(et(1),Q(i=>{let s=i;throw this.router.navigate(["/notFound"],{skipLocationChange:!0}),s}))}static{this.\u0275fac=function(n){return new(n||t)(Ue(Bt),Ue(ee))}}static{this.\u0275prov=pt({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Bo=["otpVerifyRef"];function Uo(t,l){if(t&1&&(a(0,"strong"),u(1),r()),t&2){let e=d(2);o(),v(e.invitation.email)}}function ko(t,l){if(t&1&&(a(0,"strong"),u(1),r()),t&2){let e=d(2);o(),v(e.invitation.phone)}}function zo(t,l){if(t&1){let e=P();a(0,"div",3),u(1),c(2,"translate"),h(3,"br"),p(4,Uo,2,1,"strong")(5,ko,2,1,"strong"),r(),a(6,"app-sign-up-form",4),y("submitForm",function(i){I(e);let s=d();return b(s.acceptInvitation(i))})("existingContactCheckSignInClick",function(i){I(e);let s=d();return b(s.onExistingContactCheckSignInClick(i))})("submitOtpRegistration",function(i){I(e);let s=d();return b(s.acceptInvitationForOTP(i))}),r()}if(t&2){let e=d();o(),A(" ",f(2,11,"FINANCE.LABELS.ACCEPT_INVITATION_NEW_USER")),o(3),m(e.invitation.email?4:e.invitation.phone?5:-1),o(2),g("isNewUserFromAcceptingInvitation",!0)("isCreatingAccountWithPassword",e.isLoading())("isCreatingAccountWithOtp",e.isCreatingAccountWithOtp())("firstName",e.invitation.firstName)("lastName",e.invitation.lastName)("email",e.invitation.email)("phoneNumber",e.invitation.phone)("showSignInButton",!1)("preventExistingContactCheckSignIn",!0)}}function qo(t,l){if(t&1){let e=P();a(0,"div",7),h(1,"span",8),c(2,"translate"),a(3,"a",9),y("click",function(){I(e);let i=d(2);return b(i.startOver())}),u(4),c(5,"translate"),r(),u(6,". "),r()}t&2&&(o(),g("innerHTML",f(2,2,"MESSAGE.SESSION_EXPIRED"),Xe),o(3),v(f(5,4,"LABEL.START_OVER")))}function jo(t,l){if(t&1){let e=P();a(0,"app-contact-otp-verify",5,0),y("confirm",function(i){I(e);let s=d();return b(s.onOtpConfirmed(i))})("resend",function(){I(e);let i=d();return b(i.resendRegistrationCode())}),a(2,"div",6),p(3,qo,7,6,"div",7),r()(),h(4,"app-need-help")}if(t&2){let e=d();g("verifying",e.isValidatingOtp())("username",e.otpUsername())("showResendMessage",!e.shouldStartOver())("errorMessage",e.errorMessage())("actionButtonLabel","LABEL.CREATE_ACCOUNT")("disableActionButton",e.shouldStartOver()),o(3),m(e.shouldStartOver()?3:-1)}}var po=(()=>{class t{constructor(e,n,i,s,_,C,D,X){this.confirmationSvc=e,this.donorInvitationSvc=n,this.loginSvc=i,this.notifySvc=s,this.publicLinkSvc=_,this.translateSvc=C,this.publicSvc=D,this.sessionSvc=X,this.userChoseSignIn=new ne,this.isLoading=B(!1),this.isVerifyingOtp=B(!1),this.isCreatingAccountWithOtp=B(!1),this.otpUsername=B(""),this.isValidatingOtp=B(!1),this.errorMessage=B(null),this.shouldStartOver=B(!1)}
1hasPhoneMismatch(e){if(!dt(e)||!dt(this.invitation.phone))return!1;let n=e.replace(/\D/g,"").slice(-10),i=this.invitation.phone.replace(/\D/g,"").slice(-10);return n!==i}formatPhone(e){let n=e?.replace(/\D/g,"")??"";return n.length!==10?e??"":`(${n.slice(0,3)}) ${n.slice(3,6)}-${n.slice(6)}`}acceptInvitation(e){if(!(dt(e.phone)&&!e.email)&&e.email!==this.invitation.email){this.notifySvc.errorBanner({title:"LABEL.ERROR",message:"FINANCE.ERRORS.ACCEPTING_INVITATION_EMAIL_MISMATCH",interpolatedParams:{email:this.invitation.email}}),this.isLoading.set(!1);return}if(this.hasPhoneMismatch(e.phone)){this.confirmPhoneChangeAndSubmit(e,()=>this.submitAcceptInvitation(e),()=>this.isLoading.set(!1));return}this.submitAcceptInvitation(e)}confirmPhoneChangeAndSubmit(e,n,i){this.confirmationSvc.confirm({header:this.translateSvc.instant("FINANCE.LABELS.PHONE_NUMBER_CHANGED"),message:this.translateSvc.instant("FINANCE.MESSAGES.PHONE_NUMBER_CHANGED_CONFIRM",{invitationPhone:this.formatPhone(this.invitation.phone),newPhone:this.formatPhone(e.phone)}),accept:()=>n(),reject:()=>i()})}submitAcceptInvitation(e){let n=dt(e.phone)&&!e.email;this.isLoading.set(!0);let i={firstName:e.firstName,lastName:e.lastName,email:e.email,phone:e.phone,password:e.password,recaptcha:e.recaptcha};this.donorInvitationSvc.acceptInvitationNewUser(this.invitation.id,i).subscribe({next:()=>{this.isLoading.set(!1),this.invitation.invitationType==="ManagedDonor"&&this.notifySvc.toast({title:"FINANCE.LABELS.CONGRATULATIONS",message:"FINANCE.MESSAGES.MANAGED_ACCOUNT_INVITATION_ACCEPTED"});let s=n?e.phone:e.email;this.loginSvc.login(s,e.password).then(()=>{let _=e.enableMfa?this.publicLinkSvc.launchMfaWizard():this.publicLinkSvc.userAccount();this.publicLinkSvc.navigate(_)})},error:s=>{this.isLoading.set(!1);let _=s;_.name==="ConflictError"&&_.message?this.notifySvc.errorBanner({title:"FINANCE.ERRORS.ACCEPTING_INVITATION",message:_.message}):this.notifySvc.errorBanner({title:"LABEL.ERROR",message:"FINANCE.ERRORS.ACCEPTING_INVITATION"})}})}acceptInvitationForOTP(e){this.user=e;let n=dt(e.phone)?e.phone:e.email||this.invitation.email;if(this.otpUsername.set(n),!(dt(e.phone)&&!e.email)&&e.email&&e.email!==this.invitation.email){this.notifySvc.errorBanner({title:"LABEL.ERROR",message:"FINANCE.ERRORS.ACCEPTING_INVITATION_EMAIL_MISMATCH",interpolatedParams:{email:this.invitation.email}}),this.isCreatingAccountWithOtp.set(!1);return}if(this.hasPhoneMismatch(e.phone)){this.confirmPhoneChangeAndSubmit(e,()=>this.sendContactOtp(e),()=>this.isCreatingAccountWithOtp.set(!1));return}this.sendContactOtp(e)}submitAcceptInvitationForOTP(e,n){let i={firstName:e.firstName,lastName:e.lastName,email:e.email,phone:e.phone,verificationCode:n,password:e.password,recaptcha:e.recaptcha};this.isValidatingOtp.set(!0),this.errorMessage.set(null),this.donorInvitationSvc.acceptInvitationNewUser(this.invitation.id,i).subscribe({next:s=>{this.login(s)},error:s=>{this.isCreatingAccountWithOtp.set(!1),this.isValidatingOtp.set(!1),this.handleHttpErrorResponse(s)}})}onExistingContactCheckSignInClick(e){this.userChoseSignIn.emit(e)}getRedirectPath(){return(this.user.enableMfa?this.publicLinkSvc.launchMfaWizard():this.publicLinkSvc.userAccount()).join("/")}sendContactOtp(e){let n=e.email?.trim()||e.phone?.trim();if(!n)return;let i={contact:n,firstName:e.firstName,lastName:e.lastName,address:e.address};this.isCreatingAccountWithOtp.set(!0),this.publicSvc.sendContactRegistrationOtp(i).pipe(F(()=>{this.isVerifyingOtp.set(!0),this.errorMessage.set(null)}),Q(s=>{let _=s;return this.notifySvc.errorBanner({title:"LABEL.ERROR",message:_.message}),K(null)}),xe(()=>{this.isCreatingAccountWithOtp.set(!1)})).subscribe()}onOtpConfirmed(e){this.submitAcceptInvitationForOTP(this.user,e)}login(e){this.loginSvc.loginWithToken(e,this.getRedirectPath()??void 0).then(()=>{this.invitation.invitationType==="ManagedDonor"&&this.notifySvc.toast({title:"FINANCE.LABELS.CONGRATULATIONS",message:"FINANCE.MESSAGES.MANAGED_ACCOUNT_INVITATION_ACCEPTED"}),this.isValidatingOtp.set(!1)}).catch(n=>{this.isValidatingOtp.set(!1),this.handleHttpErrorResponse(n)})}resendRegistrationCode(){let e=this.user.email??this.user.phone;this.errorMessage.set(null),this.sessionSvc.resendContactRegistrationOtp(e).subscribe({next:()=>{this.notifySvc.toast({title:"LABEL.CODE_RESENT",message:"MESSAGE.CODE_RESENT_SUCCESSFULLY"})},error:n=>{this.handleHttpErrorResponse(n)}})}handleHttpErrorResponse(e){let n=e.error??{},i=null;switch(e.status){case 0:i="MESSAGE.UNABLE_TO_REACH_SERVER";break;case 400:i="ERROR.INVALID_VERIFICATION_CODE",this.otpVerifyRef.setInvalidCodeError();break;case 401:i="ERROR.LOADING_PROFILE";break;case 409:if(n.messages?.some(s=>s.includes("failed to send"))){this.otpVerifyRef.setUnableToSendError();return}if(n.messages?.some(s=>s.includes("Invalid verification code")))i="ERROR.INVALID_VERIFICATION_CODE",this.otpVerifyRef.setInvalidCodeError();else{this.notifySvc.errorBanner({title:"FINANCE.ERRORS.ACCEPTING_INVITATION",message:e.message});return}break;case 404:this.shouldStartOver.set(!0);return;case 429:i="MESSAGE.RESEND_CODE_TOO_MANY_ATTEMPTS";break;case 501:i="ERROR.RESENDING_CODE";break}i?this.errorMessage.set(this.translateSvc.instant(i)):(this.notifySvc.errorBanner({title:"LABEL.ERROR",message:"FINANCE.ERRORS.ACCEPTING_INVITATION"}),this.errorMessage.set(null))}startOver(){this.shouldStartOver.set(!1),this.isValidatingOtp.set(!1),this.isVerifyingOtp.set(!1),this.isCreatingAccountWithOtp.set(!1)}redirectUrl(){return(this.user.enableMfa?this.publicLinkSvc.launchMfaWizard():this.publicLinkSvc.userAccount()).join("/")}static{this.\u0275fac=function(n){return new(n||t)(S(ci),S(Bt),S(Me),S(te),S(ie),S(oe),S(Ye),S(je))}}static{this.\u0275cmp=O({type:t,selectors:[["app-accept-donor-invite-new-user"]],viewQuery:function(n,i){if
1(n&1&&me(Bo,5),n&2){let s;W(s=H())&&(i.otpVerifyRef=s.first)}},inputs:{invitation:"invitation"},outputs:{userChoseSignIn:"userChoseSignIn"},decls:5,vars:4,consts:[["otpVerifyRef",""],["id","accept_invitation_card",1,"with-shadow","no-footer-padding",3,"header"],["confirmBtnLabel","LABEL.YES","cancelBtnLabel","LABEL.NO"],[1,"mb-1.5","accept-invitation-subheader"],["existingContactCheckMessage","FINANCE.MESSAGES.ACCEPT_INVITATION_EMAIL_EXISTS",3,"submitForm","existingContactCheckSignInClick","submitOtpRegistration","isNewUserFromAcceptingInvitation","isCreatingAccountWithPassword","isCreatingAccountWithOtp","firstName","lastName","email","phoneNumber","showSignInButton","preventExistingContactCheckSignIn"],[3,"confirm","resend","verifying","username","showResendMessage","errorMessage","actionButtonLabel","disableActionButton"],["footer-message",""],[1,"mt-1"],[3,"innerHTML"],["id","startOverLink","tabindex","-1",1,"hyperlink--primary",3,"click"]],template:function(n,i){n&1&&(a(0,"app-card",1),c(1,"translate"),p(2,zo,7,13)(3,jo,5,7),r(),h(4,"app-confirm-dialog",2)),n&2&&(g("header",f(1,2,"FINANCE.LABELS.ACCEPT_INVITATION")),o(2),m(i.isVerifyingOtp()?3:2))},dependencies:[$,Xn,Bn,Wn,Ei,G],styles:["#accept_invitation_card[_ngcontent-%COMP%]{width:100%;max-width:23.75rem;margin-left:auto;margin-right:auto}.accept-invitation-subheader[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-weight:700}[_nghost-%COMP%] .p-card-body{padding:0 1rem 1rem}"]})}}return t})();function Wo(t,l){if(t&1&&(a(0,"strong"),u(1),r()),t&2){let e=d(2);o(),v(e.invitation.email)}}function Ho(t,l){if(t&1&&(a(0,"strong"),u(1),r()),t&2){let e=d(2);o(),v(e.invitation.phone)}}function Yo(t,l){if(t&1&&(a(0,"div",3),p(1,Wo,2,1,"strong")(2,Ho,2,1,"strong"),r()),t&2){let e=d();o(),m(e.invitation.email?1:e.invitation.phone?2:-1)}}function Qo(t,l){if(t&1){let e=P();a(0,"app-public-login-form",5,0),y("codeRequested",function(){I(e);let i=d();return b(i.useOTPVerification())})("loginSuccess",function(i){I(e);let s=d();return b(s.acceptInvitation(i))}),r()}if(t&2){let e=d();g("emailAddress",e.loginWithEmail||e.invitation.email)("redirectAfterRequestingCode",!1)("overrideLoginEvent",!1)("isLoggingIn",e.isLoading)("errorMessage",e.errorMessage)("showEmailOrPhoneInput",!1)}}function $o(t,l){if(t&1){let e=P();a(0,"app-contact-otp-sign-in",6),y("verifyFinished",function(i){I(e);let s=d();return b(s.acceptInvitationWithOtp(i))}),r(),a(1,"div",7)(2,"button",8),c(3,"translate"),y("click",function(){I(e);let i=d();return b(i.usePasswordVerification())}),r()()}if(t&2){let e=d();g("username",e.loginWithEmail||e.invitation.email),o(2),g("label",j(f(3,3,"LABEL.USE_PASSWORD_INSTEAD")))}}var mo=(()=>{class t{constructor(e,n,i,s){this.donorInvitationSvc=e,this.notifySvc=n,this.publicLinkSvc=i,this.translate=s,this.loginWithEmail=null,this.isLoading=!1,this.errorMessage=null,this.isVerifyingOtp=!1}acceptInvitation(e){if(this.isLoading=!0,this.errorMessage=null,e&&e!==this.invitation.email){this.notifySvc.errorBanner({title:"LABEL.ERROR",message:"FINANCE.ERRORS.ACCEPTING_INVITATION"}),this.isLoading=!1;return}this.donorInvitationSvc.acceptInvitationExistingUser(this.invitation.id,e).subscribe({next:()=>{this.invitation.invitationType==="ManagedDonor"&&this.notifySvc.toast({title:"FINANCE.LABELS.CONGRATULATIONS",message:"FINANCE.MESSAGES.MANAGED_ACCOUNT_INVITATION_ACCEPTED"}),this.publicLinkSvc.navigate(this.publicLinkSvc.userAccount())},error:n=>{this.isLoading=!1,n.name==="BadRequestError"&&n.message?n.message==="AUTHENTICATION-FAILED"?this.errorMessage=this.translate.instant("ERROR.INVALID_CREDENTIALS"):n.message==="USER-LOCKED-OUT"&&(this.errorMessage=this.translate.instant("MESSAGE.STAFF_USER_LOCKED")):n.name==="ConflictError"&&n.message?this.notifySvc.errorBanner({title:"FINANCE.ERRORS.ACCEPTING_INVITATION",message:n.message}):this.notifySvc.errorBanner({title:"LABEL.ERROR",message:"FINANCE.ERRORS.ACCEPTING_INVITATION"})}})}acceptInvitationWithOtp(e){if(!e)return;let n=this.loginWithEmail||this.invitation.email;this.acceptInvitation(n)}usePasswordVerification(){this.isVerifyingOtp=!1}useOTPVerification(){this.isVerifyingOtp=!0}static{this.\u0275fac=function(n){return new(n||t)(S(Bt),S(te),S(ie),S(oe))}}static{this.\u0275cmp=O({type:t,selectors:[["app-accept-donor-invite-existing-user"]],inputs:{invitation:"invitation",loginWithEmail:"loginWithEmail"},decls:8,vars:8,consts:[["publicLoginForm",""],["id","accept_invitation_existing_user_card",1,"with-shadow","no-footer-padding",3,"header"],[1,"mb-1","accept-invitation-subheader"],[1,"mt-0.5"],[3,"emailAddress","redirectAfterRequesting
1Code","overrideLoginEvent","isLoggingIn","errorMessage","showEmailOrPhoneInput"],[3,"codeRequested","loginSuccess","emailAddress","redirectAfterRequestingCode","overrideLoginEvent","isLoggingIn","errorMessage","showEmailOrPhoneInput"],[3,"verifyFinished","username"],[1,"w-full","text-center"],["id","return_btn","pButton","","type","button",1,"p-button","p-button-sm","p-button-text","mobile-btn","mt-0.5",3,"click","label"]],template:function(n,i){n&1&&(a(0,"app-card",1),c(1,"translate"),a(2,"div",2),u(3),c(4,"translate"),p(5,Yo,3,1,"div",3),r(),p(6,Qo,2,6,"app-public-login-form",4)(7,$o,4,5),r()),n&2&&(g("header",f(1,4,"FINANCE.LABELS.ACCEPT_INVITATION")),o(3),A(" ",f(4,6,"FINANCE.LABELS.ACCEPT_INVITATION_EXISTING_USER")," "),o(2),m(i.isVerifyingOtp?-1:5),o(),m(i.isVerifyingOtp?7:6))},dependencies:[$,Hn,Un,Z,G],styles:["#accept_invitation_existing_user_card[_ngcontent-%COMP%]{width:100%;max-width:23.75rem;margin-left:auto;margin-right:auto}.accept-invitation-subheader[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-weight:700}[_nghost-%COMP%] .p-card-body{padding:0 1rem 1rem}"]})}}return t})();function Ko(t,l){if(t&1){let e=P();a(0,"app-accept-donor-invite-new-user",2),y("userChoseSignIn",function(i){I(e);let s=d();return b(s.showSignInFormInstead(i))}),r()}if(t&2){let e=d();g("invitation",e.invitation)}}function Xo(t,l){if(t&1&&h(0,"app-accept-donor-invite-existing-user",1),t&2){let e=d();g("invitation",e.invitation)("loginWithEmail",e.loginWithEmail)}}var uo=(()=>{class t{constructor(e,n,i){this.loginSvc=e,this.route=n,this.sessionSvc=i,this.forceShowLoginForm=!1,this.loginWithEmail=null}ngOnInit(){this.invitation=this.route.snapshot.data.invitation,this.sessionSvc.isAuthenticated()&&this.loginSvc.logOut()}showSignInFormInstead(e){this.forceShowLoginForm=!0,this.loginWithEmail=e}static{this.\u0275fac=function(n){return new(n||t)(S(Me),S(U),S(je))}}static{this.\u0275cmp=O({type:t,selectors:[["app-accept-donor-invite-view"]],decls:2,vars:1,consts:[[3,"invitation"],[3,"invitation","loginWithEmail"],[3,"userChoseSignIn","invitation"]],template:function(n,i){n&1&&p(0,Ko,1,1,"app-accept-donor-invite-new-user",0)(1,Xo,1,2,"app-accept-donor-invite-existing-user",1),n&2&&m(!i.forceShowLoginForm&&i.invitation.associatedUserType!=="Account"?0:1)},dependencies:[po,mo],encapsulation:2})}}return t})();var Jo=t=>({orgName:t});function Zo(t,l){if(t&1&&(a(0,"app-card",0)(1,"div",1)(2,"div",2),h(3,"i",3),r(),a(4,"div",2)(5,"div",4),u(6),c(7,"translate"),r(),a(8,"div",5),u(9),r()()()()),t&2){let e=d();o(3),ni(e.icon),o(3),v(T(7,4,"FINANCE.LABELS.GIFTS_ATTRIBUTED_TO",R(7,Jo,e.parentOrgName))),o(3),v(e.associatedOrgName)}}var qt=(()=>{class t{constructor(e,n){this.activatedRoute=e,this.associatedOrgQueryParamSvc=n,this.showCard=!1}ngOnInit(){if(this.fund?.isParentFund){this.associatedOrgName=this.orgName,this.parentOrgName=this.fund.orgName,this.showCard=!0,this.icon="icon-mitre";return}this.associatedOrgQueryParamSvc.handleQueryParams(this.activatedRoute,this.fund?.associatedOrganizationSelection).subscribe(e=>{this.associatedOrgBasedOnExternalId=e,this.associatedOrgName=this.associatedOrgBasedOnExternalId?.displayNameAndLocation,this.showCard=this.associatedOrgBasedOnExternalId&&this.associatedOrgQueryParamSvc.getGivingQueryParams()?.locked}),this.parentOrgName=this.orgName,this.icon="icon-parish"}static{this.\u0275fac=function(n){return new(n||t)(S(U),S(Et))}}static{this.\u0275cmp=O({type:t,selectors:[["app-associated-org-name-card"]],inputs:{fund:"fund",orgName:"orgName"},decls:1,vars:1,consts:[["id","associated_org_card"],[1,"flex","flex-full-width","justify-content-left","new-olg-container"],[1,"flex","flex-column","container"],["id","icon_parish_mitre"],["id","org_name"],["id","associated_org_name_location",1,"font-bold"]],template:function(n,i){n&1&&p(0,Zo,10,9,"app-card",0),n&2&&m(i.showCard?0:-1)},dependencies:[$,G],styles:["#associated_org_card[_ngcontent-%COMP%]{padding-bottom:1rem}"]})}}return t})();var fo=(()=>{class t{constructor(e,n){this.activatedRoute=e,this.associatedOrgQueryParamSvc=n,this.gift={},this.giveModalVisible=!1}ngOnInit(){let e=this.activatedRoute.snapshot;for(;!e.data.organization&&e.parent;)e=e.parent;for(this.org=e.data.organization,e=this.activatedRoute.snapshot;!e.data.fund&&e.parent;)e=e.parent;this.orgName=this.org.name,this.fund=e.data.fund,this.gift.fund=this.fund,this.gift.orgName=this.fund.orgName,this.fundAssociatedOrgSelection=this.fund.associatedOrganizationSelection,this.associatedOrgQueryParamSvc.handleQueryParams(this.activatedRoute,this.fund.associatedOrganizationSelection).subscribe()}
1showGiveModal(){this.giveModalVisible=!0}hideGiveModal(){this.giveModalVisible=!1}static{this.\u0275fac=function(n){return new(n||t)(S(U),S(Et))}}static{this.\u0275cmp=O({type:t,selectors:[["app-fund-view"]],decls:6,vars:4,consts:[[1,"flex","flex-full-width","justify-content-center","new-olg-container"],[1,"flex","flex-column","w-full","align-items-center","container"],[3,"orgName","fund"],[3,"showGiveModal"],["type","Add","modalTitle","LABEL.CONFIGURE_GIFT","buttonLabel","LABEL.CONTINUE",3,"modalCanceled","gift","visible"]],template:function(n,i){n&1&&(a(0,"div")(1,"div",0)(2,"div",1),h(3,"app-associated-org-name-card",2),a(4,"app-fund-detail",3),y("showGiveModal",function(){return i.showGiveModal()}),r()()(),a(5,"app-configure-gift-modal",4),y("modalCanceled",function(){return i.hideGiveModal()}),r()()),n&2&&(o(3),g("orgName",i.orgName)("fund",i.fund),o(2),g("gift",i.gift)("visible",i.giveModalVisible))},dependencies:[qt,so,kt],styles:["app-fund-detail[_ngcontent-%COMP%]{max-width:52rem;width:100%}"]})}}return t})();var ta=t=>({"flex-column":t}),ia=()=>({size:1,offset:8,showPledgeCircle:!1}),Fi=t=>({giftCount:t}),na=()=>({size:2,offset:16,showPledgeCircle:!1}),oa=(t,l)=>l.id;function aa(t,l){t&1&&(a(0,"div",3)(1,"h5"),u(2),c(3,"translate"),r()()),t&2&&(o(2),v(f(3,1,"ERROR.ORGANIZATION_DOES_NOT_SUPPORT_OLG")))}function ra(t,l){if(t&1&&(a(0,"div"),h(1,"app-associated-org-name-card",9),r()),t&2){let e=d();o(),g("orgName",e.org.name)("fund",e.fundForCard)}}function sa(t,l){t&1&&(a(0,"div",10)(1,"h5"),u(2),c(3,"translate"),r()()),t&2&&(o(2),v(f(3,1,"MESSAGE.NO_FUNDS_FOUND_PUBLIC")))}function la(t,l){t&1&&(a(0,"span",30),h(1,"i",32),r())}function da(t,l){if(t&1&&(a(0,"div",29),p(1,la,2,0,"span",30),h(2,"advanced-image",31),r()),t&2){let e=d(4);o(),m(e.featuredFund.allowOnlinePledges?1:-1),o(),g("cldImg",e.cloudinary.fundImage(e.featuredFund,Ie(2,ia)))}}function ca(t,l){t&1&&(h(0,"app-lozenge",20),c(1,"translate")),t&2&&g("label",f(1,1,"FINANCE.LABELS.CREDIT_CARD_ONLY"))}function pa(t,l){t&1&&(h(0,"app-lozenge",21),c(1,"translate")),t&2&&g("label",f(1,1,"FINANCE.LABELS.BANK_ACCOUNT_ONLY"))}function ma(t,l){if(t&1&&(h(0,"app-display-field",22),c(1,"date")),t&2){let e=d(4);g("value",T(1,2,e.featuredFund.endDate,"longDate"))("inline",!0)}}function ua(t,l){if(t&1&&(h(0,"app-display-field",23),c(1,"wholeDollar")),t&2){let e=d(4);g("value",f(1,2,e.featuredFund.campaignGoal))("inline",!0)}}function fa(t,l){if(t&1&&(h(0,"div",34),c(1,"translate")),t&2){let e=d(5);g("innerHTML",j(T(1,2,"MESSAGE.YOU_HAVE_SCHEDULED_GIFT",R(5,Fi,e.featuredFund.donorGiftCount))),Xe)}}function ga(t,l){if(t&1&&(h(0,"div",34),c(1,"translate")),t&2){let e=d(5);g("innerHTML",j(T(1,2,"MESSAGE.YOU_HAVE_SCHEDULED_GIFTS",R(5,Fi,e.featuredFund.donorGiftCount))),Xe)}}function ha(t,l){if(t&1&&(a(0,"div",25)(1,"i",33),u(2,"event_available"),r(),p(3,fa,2,7,"div",34),p(4,ga,2,7,"div",34),r()),t&2){let e=d(4);o(3),m(e.featuredFund.donorGiftCount===1?3:-1),o(),m(e.featuredFund.donorGiftCount!==1?4:-1)}}function _a(t,l){if(t&1){let e=P();a(0,"button",35),y("click",function(){I(e);let i=d(4);return b(i.onPledgeBtnClick(i.featuredFund))}),r()}if(t&2){let e=d(4);mt("p-button-outlined",!e.getFeaturedFundPledgeCTA())("flex-full-width",!e.featuredFund.allowOnlineGifts)("p-button-lg",e.isMobile()),g("label",e.getPledgeBtnLabel(e.featuredFund))}}function Ca(t,l){if(t&1){let e=P();a(0,"button",36),y("click",function(){I(e);let i=d(4);return b(i.onGiveBtnClick(i.featuredFund))}),r()}if(t&2){let e=d(4);mt("p-button-outlined",e.featuredFund.allowOnlineGifts)("flex-full-width",!e.featuredFund.allowOnlineGifts)("p-button-lg",e.isMobile()),g("label",e.getGiveBtnLabel(e.featuredFund))}}function va(t,l){if(t&1){let e=P();a(0,"div",12)(1,"app-card",14),y("click",function(i){I(e);let s=d(3);return b(s.goToFundDetail(i,s.featuredFund))}),M(2,da,3,3,"ng-template",null,0,w),a(4,"div",15)(5,"div")(6,"div",16)(7,"div",17)(8,"div",18),h(9,"app-lozenge",19),c(10,"translate"),p(11,ca,2,3,"app-lozenge",20),p(12,pa,2,3,"app-lozenge",21),r(),a(13,"h4"),u(14),r()(),p(15,ma,2,5,"app-display-field",22),p(16,ua,2,4,"app-display-field",23),h(17,"div",24),r(),p(18,ha,5,2,"div",25),a(19,"div")(20,"div",26),p(21,_a,1,7,"button",27),p(22,Ca,1,7,"button",28),r()()()()()()}if(t&2){let e=d(3);o(9),g("label",f(10,13,"FINANCE.LABELS.FEATURED_FUND")),o(2),m(e.featuredFund.acceptsCreditCard&&!e.featuredFund.acceptsAch?11:-1),o(),m(e.featuredFund.acceptsAch&&!e.featuredFund.acceptsCreditCard?12:-1),o(2),v(e.featuredFund.name),o(),m(e.featuredFund.endDate?15:-1),o(),m(e.featuredFund.isCampaign&&e.featuredFund.c
1ampaignVisibleToPublic?16:-1),o(),g("innerHTML",e.getFundDescription(e.featuredFund),Xe),o(),m(e.featuredFund.donorGiftCount>0?18:-1),o(),mt("mt-3",e.featuredFund.donorGiftCount===0),o(),g("ngClass",R(15,ta,e.isMobile())),o(),m(e.featuredFund.allowOnlinePledges?21:-1),o(),m(e.featuredFund.allowOnlineGifts?22:-1)}}function Sa(t,l){t&1&&(a(0,"span",30),h(1,"i",32),r())}function ya(t,l){if(t&1&&(a(0,"div",41)(1,"div",42),p(2,Sa,2,0,"span",30),h(3,"advanced-image",43),r()()),t&2){let e=d().$implicit,n=d(3);o(2),m(e.allowOnlinePledges?2:-1),o(),g("cldImg",n.cloudinary.fundImage(e,Ie(2,na)))}}function Ia(t,l){t&1&&(h(0,"app-lozenge",20),c(1,"translate")),t&2&&g("label",f(1,1,"FINANCE.LABELS.CREDIT_CARD_ONLY"))}function ba(t,l){t&1&&(h(0,"app-lozenge",21),c(1,"translate")),t&2&&g("label",f(1,1,"FINANCE.LABELS.BANK_ACCOUNT_ONLY"))}function Ea(t,l){if(t&1&&(h(0,"app-display-field",22),c(1,"date")),t&2){let e=d().$implicit;g("value",T(1,2,e.endDate,"longDate"))("inline",!0)}}function Pa(t,l){if(t&1&&(h(0,"app-display-field",23),c(1,"wholeDollar")),t&2){let e=d().$implicit;g("value",f(1,2,e.campaignGoal))("inline",!0)}}function Aa(t,l){if(t&1&&(h(0,"app-alert",48),c(1,"translate")),t&2){let e=d(3).$implicit;g("header",null)("message",T(1,2,"MESSAGE.YOU_HAVE_SCHEDULED_GIFT",R(5,Fi,e.donorGiftCount)))}}function xa(t,l){if(t&1&&(h(0,"app-alert",48),c(1,"translate")),t&2){let e=d(3).$implicit;g("header",null)("message",T(1,2,"MESSAGE.YOU_HAVE_SCHEDULED_GIFTS",R(5,Fi,e.donorGiftCount)))}}function Ta(t,l){if(t&1&&(p(0,Aa,2,7,"app-alert",48),p(1,xa,2,7,"app-alert",48)),t&2){let e=d(2).$implicit;m(e.donorGiftCount===1?0:-1),o(),m(e.donorGiftCount!==1?1:-1)}}function Oa(t,l){if(t&1){let e=P();a(0,"button",49),y("click",function(){I(e);let i=d(2).$implicit,s=d(3);return b(s.onPledgeBtnClick(i))}),r()}if(t&2){let e=d(2).$implicit,n=d(3);mt("p-button-lg",n.isMobile()),g("label",n.getPledgeBtnLabel(e))}}function wa(t,l){if(t&1){let e=P();a(0,"button",50),y("click",function(){I(e);let i=d(2).$implicit,s=d(3);return b(s.onGiveBtnClick(i))}),r()}if(t&2){let e=d(2).$implicit,n=d(3);mt("p-button-lg",n.isMobile()),g("label",n.getGiveBtnLabel(e))}}function Na(t,l){if(t&1&&(a(0,"div",44),p(1,Ta,2,2),a(2,"div",45),p(3,Oa,1,3,"button",46),p(4,wa,1,3,"button",47),r()()),t&2){let e=d().$implicit;o(),m(e.donorGiftCount>0?1:-1),o(2),m(e.allowOnlinePledges?3:-1),o(),m(e.allowOnlineGifts?4:-1)}}function Ma(t,l){if(t&1){let e=P();a(0,"app-card",37),y("click",function(i){let s=I(e).$implicit,_=d(3);return b(_.goToFundDetail(i,s))}),M(1,ya,4,3,"ng-template",null,0,w),a(3,"div",38)(4,"div",39),p(5,Ia,2,3,"app-lozenge",20),p(6,ba,2,3,"app-lozenge",21),r(),a(7,"h5",40),u(8),r(),p(9,Ea,2,5,"app-display-field",22),p(10,Pa,2,4,"app-display-field",23),h(11,"div",24),r(),M(12,Na,5,3,"ng-template",null,1,w),r()}if(t&2){let e=l.$implicit,n=d(3);ni(e.isParentFund?"fund-card parent-formatting with-shadow":"fund-card with-shadow"),o(5),m(e.acceptsCreditCard&&!e.acceptsAch?5:-1),o(),m(e.acceptsAch&&!e.acceptsCreditCard?6:-1),o(2),v(e.name),o(),m(e.endDate?9:-1),o(),m(e.isCampaign&&e.campaignVisibleToPublic?10:-1),o(),g("innerHTML",n.getFundDescription(e),Xe)}}function Da(t,l){if(t&1&&(a(0,"div",11),p(1,va,23,17,"div",12),Te(2,Ma,14,8,"app-card",13,oa),r()),t&2){let e=d(2);o(),m(e.featuredFund&&!e.isLoading?1:-1),o(),Oe(e.funds)}}function Ga(t,l){if(t&1&&(a(0,"div",7),p(1,sa,4,3,"div",10),p(2,Da,4,1,"div",11),r()),t&2){let e=d();o(),m((!e.funds||!e.funds.length)&&!e.isLoading?1:-1),o(),m(e.funds&&e.funds.length&&!e.isLoading?2:-1)}}var go=(()=>{class t{constructor(e,n,i,s,_,C,D,X,re,Re,Ke,Ht){this.activePublicTenantSvc=e,this.associatedOrgQueryParamSvc=n,this.destroyRef=i,this.myPledgeSvc=s,this.publicFundsSvc=_,this.publicLinkSvc=C,this.publicRegistrationSvc=D,this.route=X,this.router=re,this.seoSvc=Re,this.cloudinary=Ke,this.translate=Ht,this.breakpointSvc=E(tt),this.profileSvc=E(Ne),this.isMobile=this.breakpointSvc.underWideTablet,this.donorPledges=[],this.gift={},this.giveAgainBtnLabel="FINANCE.LABELS.GIVE_AGAIN",this.giveModalVisible=!1,this.giveNowBtnLabel="FINANCE.LABELS.GIVE_NOW",this.isLoading=!1,this.olgIsEnabled=!1,this.pledgeAgainBtnLabel="FINANCE.LABELS.PLEDGE_AGAIN",this.pledgeToGiveBtnLabel="FINANCE.LABELS.PLEDGE_TO_GIVE",this.show
1FundEnding=!1,this.showPledgeIconColumn=!1,this.suspendedReRegistrations$=this.profileSvc.activeUser$.pipe(Xt(Tt=>Tt?this.publicRegistrationSvc.getSuspendedReRegistrations():K([])),Ze(Tt=>Tt),N(this.destroyRef))}ngOnInit(){this.org=this.activePublicTenantSvc.getActiveTenant(),this.seoSvc.updateTitle(`${this.org.name} - ${this.org.address.city}, ${this.org.address.state} | Online Giving`),this.seoSvc.updateDescription(`${this.org.name} - ${this.org.address.line1}, ${this.org.address.city}, ${this.org.address.state} ${this.org.address.zip}`),this.myPledgeSvc.clearPledge(),this.loadFunds(),this.reloadPageDetailsOnUserSignOut(),this.handleQueryParamsChanges()}reloadPageDetailsOnUserSignOut(){this.router.events.pipe(F(e=>{e instanceof cn&&this.donorPledges?.length&&this.loadFunds()}),N(this.destroyRef)).subscribe()}loadFunds(){let e=this.route.snapshot;for(;!e.data.donorPledges&&e.parent;)e=e.parent;e.data.donorPledges?this.donorPledges=e.data.donorPledges:this.donorPledges=[],e.data.donorGifts?this.donorGifts=e.data.donorGifts:this.donorGifts=[],this.org.onlineGivingEnabled===!0&&(this.isLoading=!0,this.olgIsEnabled=!0,this.publicFundsSvc.getAllPublicFunds().subscribe(n=>{this.funds=n,this.funds.forEach(i=>{let s=this.donorGifts.filter(_=>_.fundId===i.id);i.donorGiftCount=s.length}),this.fundItems=n.map(i=>({record:i})),this.featuredFund=n.find(i=>i.isFeatured),this.showFundEnding=n.some(i=>i.endDate!==null),this.showPledgeIconColumn=n.some(i=>i.allowOnlinePledges),this.setFundForCard(),this.isLoading=!1}))}showGiveModal(e){this.gift={fund:e,orgName:e.orgName},this.associatedOrgQueryParamSvc.handleQueryParams(this.route,e.associatedOrganizationSelection).pipe(N(this.destroyRef)).subscribe(()=>{this.giveModalVisible=!0})}onGiveBtnClick(e){this.showGiveModal(e)}onPledgeBtnClick(e){e.orgNumber===this.org.number?this.publicLinkSvc.navigate(this.publicLinkSvc.pledgeSetup(e.url)):this.publicLinkSvc.navigate(this.publicLinkSvc.parentPledgeSetup(e.url,e.orgTenantId))}hideGiveModal(){this.giveModalVisible=!1}goToFundDetail(e,n){if(e.target.className.search("give-now-btn")!==-1||e.target.parentElement.className.search("give-now-btn")!==-1){e.stopPropagation();return}n.orgNumber===this.org.number?this.publicLinkSvc.navigate(this.publicLinkSvc.fund(n.url)):this.publicLinkSvc.navigate(this.publicLinkSvc.parentFund(n.url,n.orgTenantId))}getFundDescription(e){if(!e.description)return"";let i=e.description.slice(0,1e3);return i.length>225?`${i.replaceAll(/<[^>]*>/g,"").slice(0,225)}...`:i}getPledgeBtnLabel(e){let n=this.donorPledges.find(i=>i.fundId===e.id&&(i.status==="Scheduled"||i.status==="InProgress"));return n?(e.donorPledgedTotalAmount=n.totalAmount,this.translate.instant(this.pledgeAgainBtnLabel)):this.translate.instant(this.pledgeToGiveBtnLabel)}getGiveBtnLabel(e){return e.donorGiftCount>0?this.translate.instant(this.giveAgainBtnLabel):this.translate.instant(this.giveNowBtnLabel)}getFeaturedFundPledgeCTA(){return!this.donorPledges.find(n=>n.fundId===this.featuredFund.id&&(n.status==="Scheduled"||n.status==="InProgress"))}handleQueryParamsChanges(){this.route.queryParams.pipe(N(this.destroyRef)).subscribe(()=>{this.funds?.length&&this.setFundForCard()})}setFundForCard(){let e=this.route.snapshot.queryParams;e?.locked?.toLowerCase()==="true"&&e?.externalId&&this.funds?.length?this.fundForCard=this.featuredFund||this.funds.find(i=>i.associatedOrganizationSelection&&i.associatedOrganizationSelection!=="Hidden")||this.funds[0]:this.funds?.length&&(this.fundForCard=this.featuredFund||this.funds[0])}static{this.\u0275fac=function(n){return new(n||t)(S(fe),S(Et),S(J),S(ye),S(Ut),S(ie),S(Gi),S(U),S(ee),S(yn),S(Ct),S(oe))}}static{this.\u0275cmp=O({type:t,selectors:[["app-funds-view-component"]],decls:9,vars:10,consts:[["header",""],["footer",""],[1,"new-layout-container-funds"],[1,"flex","justify-content-center"],[1,"flex","flex-full-width","justify-content-center"],[1,"flex","flex-column","container"],[3,"buttonPosition","suspendedReRegistrations","upcomingContributions"],["id","funds_container",1,"grid"],["type","Add","modalTitle","LABEL.CONFIGURE_GIFT","buttonLabel","LABEL.CONTINUE",3,"modalCanceled","gift","visible"],[3,"orgName","fund"],["id","fund_zero_state",1,"flex","justify-content-center"],["id","new_funds_list",1,"grid","three-column"],[1,"flex","justify-content-center","featured-fund-container","span-all"],[3,"class"],["
1id","featured_fund_card",1,"flex","justify-content-center","fund-card","featured","with-shadow","flex","justify-content-center","cursor-pointer",3,"click"],[1,"flex","flex-column","flex-wrap","fund-card-content"],[1,"flex-full-width","featured-fund-details"],[1,"flex","flex-column","mb-0.5","gap-0.5"],[1,"flex","gap-0.5"],["icon","star","palette","primary",3,"label"],["icon","credit_card","palette","blue",3,"label"],["icon","account_balance","palette","blue",3,"label"],["id","fundEndDate","label","LABEL.FUND_ENDING",3,"value","inline"],["id","campaignGoal","label","LABEL.CAMPAIGN_GOAL",3,"value","inline"],[1,"fund-description","text-break",3,"innerHTML"],["id","gift_info",1,"flex","align-items-center","gift-info","mb-1"],[1,"flex","justify-content-space-between","gap-1",3,"ngClass"],["pButton","","id","pledgeButton",1,"p-button","w-full","give-now-btn",3,"label","p-button-outlined","flex-full-width","p-button-lg"],["pButton","","id","giveButton",1,"p-button","w-full","give-now-btn",3,"label","p-button-outlined","flex-full-width","p-button-lg"],[1,"app-card-header","fund-card-header-image","p-0"],["aria-hidden","true",1,"pledge-indicator"],[1,"fund-image",3,"cldImg"],[1,"icon","icon-pledge"],[1,"material-icons","mr-0.5"],[3,"innerHTML"],["pButton","","id","pledgeButton",1,"p-button","w-full","give-now-btn",3,"click","label"],["pButton","","id","giveButton",1,"p-button","w-full","give-now-btn",3,"click","label"],[3,"click"],[1,"fund-card-content"],[1,"flex","gap-0.5","mb-0.5"],[1,"pb-0.5"],[1,"p-0"],[1,"fund-card-header-image"],[1,"fund-image","img:max-w-full",3,"cldImg"],[1,"app-card-footer"],[1,"flex","flex-column","gap-1"],["pButton","","id","pledgeButton",1,"p-button","p-button-outlined","w-full","give-now-btn",3,"p-button-lg","label"],["pButton","","id","giveButton",1,"p-button","p-button-outlined","w-full","give-now-btn",3,"p-button-lg","label"],["icon","calendar_clock","severity","primary",1,"mb-1",3,"header","message"],["pButton","","id","pledgeButton",1,"p-button","p-button-outlined","w-full","give-now-btn",3,"click","label"],["pButton","","id","giveButton",1,"p-button","p-button-outlined","w-full","give-now-btn",3,"click","label"]],template:function(n,i){n&1&&(a(0,"div",2),p(1,aa,4,3,"div",3),a(2,"div",4)(3,"div",5),p(4,ra,2,2,"div"),h(5,"app-suspended-gifts-alert",6),c(6,"async"),p(7,Ga,3,2,"div",7),r()()(),a(8,"app-configure-gift-modal",8),y("modalCanceled",function(){return i.hideGiveModal()}),r()),n&2&&(o(),m(i.olgIsEnabled?-1:1),o(3),m(i.olgIsEnabled&&!i.isLoading&&i.funds&&i.funds.length?4:-1),o(),g("buttonPosition",i.isMobile()?"bottom":"right")("suspendedReRegistrations",f(6,8,i.suspendedReRegistrations$))("upcomingContributions",i.donorGifts),o(2),m(i.olgIsEnabled?7:-1),o(),g("gift",i.gift)("visible",i.giveModalVisible))},dependencies:[qt,Di,$,yt,St,Vt,Ln,si,Z,Lt,kt,ke,ze,G,Qn],styles:["#funds_container[_ngcontent-%COMP%]{max-width:66rem}[_nghost-%COMP%] app-card.fund-card .p-card, [_nghost-%COMP%] #featured_fund_card .p-card{overflow:visible}[_nghost-%COMP%] app-card.fund-card .p-card-header, [_nghost-%COMP%] #featured_fund_card .p-card-header{position:relative;overflow:visible;padding:0}[_nghost-%COMP%] .fund-card-header-image{position:relative;overflow:hidden}[_nghost-%COMP%] .fund-card-header-image .pledge-indicator{position:absolute;top:0;left:0;z-index:2;display:flex;width:2.75rem;height:2.75rem;border-radius:0 0 100%;background-color:var(--surface-0);color:var(--primary-color)}[_nghost-%COMP%] .fund-card-header-image .pledge-indicator .icon-pledge, [_nghost-%COMP%] .fund-card-header-image .pledge-indicator .icon-pledge:before{font-size:1.5rem;color:var(--primary-color);margin-top:8px;margin-left:4px}[_nghost-%COMP%] #loading_spinner i{font-size:5.5rem;color:var(--surface-0)}[_nghost-%COMP%] .show-small{margin-bottom:1rem}[_nghost-%COMP%] .show-small cl-image{height:4.063rem;width:auto}[_nghost-%COMP%] .show-small cl-image #org_logo{padding-right:1.5rem}[_nghost-%COMP%] .fund-description{padding-top:.5rem;line-height:normal;overflow:hidden;text-overflow:ellipsis}[_nghost-%COMP%] .featured-fund-container #featured_fund_card, [_nghost-%COMP%] .featured-fund-container .fund-card{width:100%!important}[_nghost-%COMP%] .featured-fund-container #featured_fund_card .p-card.featured, [_nghost-%COMP%] .featured-fund-container .featured{border:solid .125rem var(--primary-color);border-radius:var(--border-radius);overflow:hidden;padding-bottom:0;width:100%;display:flex}[_nghost-%COMP%] .featured-fund-container #featured_fund_card .p-card.featured .fund-card-header-image img, [_nghost-%COMP%] .featured-fund-container #featured_fund_card .p-card.featured .p-card-header img, [_nghost-%COMP%] .featured-fund-container .featured .fund-card-header-image img, [_nghost-%COMP%] .featured-fund-container .featured .p-card-header img{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius)}[_nghost-%COMP%] .featured-fund-container .p-card-header{height:100%;width:100%}[_nghost-%COMP%] .featured-fund-container .p-card-header img{display:block;height:100%;width:100%}[_nghost-%COMP%] .featured-fund-container .p-card-body{align-items:flex-start}@supports (container-type: inline-size){@container content-container (min-width: 960px){[_nghost-%COMP%] .featured-fund-container .featured{max-width:100%}[_nghost-%COMP%] .featured-fund-container .fund-description{padding-bottom:2rem}}}@supports not (container: content-container){@media(min-width:960px){[_nghost-%COMP%] .featured-fund-container .featured{max-width:100%}[_nghost-%COMP%] .featured-fund-container .fund-description{padding-bottom:2rem}}}@supports (container-type: inline-size){@container content-container (min-width: 1280px){[_nghost-%COMP%] .featured-fund-container .featured{flex-direction:row}[_nghost-%COMP%] .featured-fund-container .featured .fund-card-header-image img, [_nghost-%COMP%] .featured-fund-container .featured .p-card-header img{border-radius:var(--border-radius) 0 0 var(--border-radius)}[_nghost-%COMP%] .featured-fund-container .p-card-header{max-width:38rem}[_nghost-%COMP%] .featured-fund-container .p-card-header img{max-width:38rem}[_nghost-%COMP%] .featured-fund-container .featured-fund-details{height:10.2rem}[_nghost-%COMP%] .featured-fund-container .fund-description{height:6rem}}}@supports not (container: content-container){@media(min-width:1280px){[_nghost-%COMP%] .featured-fund-container .featured{flex-direction:row}[_nghost-%COMP%] .featured-fund-container .featured .fund-card-header-image img, [_nghost-%COMP%] .featured-fund-container .featured .p-card-header img{border-radius:var(--border-radius) 0 0 var(--border-radius)}[_nghost-%COMP%] .featured-fund-container .p-card-header{max-width:38rem}[_nghost-%COMP%] .featured-fund-container .p-card-header img{max-width:38rem}[_nghost-%COMP%] .featured-fund-container .featured-fund-details{height:10.2rem}[_nghost-%COMP%] .featured-fund-container .fund-description{height:6rem}}}[_nghost-%COMP%] .funds-table{justify-self:center;max-width:66rem}[_nghost-%COMP%] .funds-table app-card{cursor:unset}[_nghost-%COMP%] .funds-table p-table tr:hover{cursor:pointer;background-color:var(--surface-hover)}[_nghost-%COMP%] .funds-table .p-card-body{padding:0}[_nghost-%COMP%] .funds-table .table-give-now-btn{border-color:var(--text-color);background-color:transparent;font-weight:700;min-width:11rem;margin-right:.5rem;width:100%}[_nghost-%COMP%] .funds-table .table-give-now-btn:focus{border-color:var(--button_inactive_text_color)}[_nghost-%COMP%] .funds-table .table-give-now-btn:enabled:not(:focus):hover{border-color:var(--button_inactive_text_color);box-shadow:0 0 .25rem 0 var(--button_hover_shadow_color)}[_nghost-%COMP%] .funds-table .table-give-now-btn:enabled:not(:focus):hover .p-button-text{color:var(--button_inactive_text_color)}@supports (container-type: inline-size){@container content-container (min-width: 600px){[_nghost-%COMP%] .funds-table p-table td:last-of-type{display:flex;flex-direction:row-reverse}}}@supports not (container: content-container){@media(min-width:600px){[_nghost-%COMP%] .funds-table p-table td:last-of-type{display:flex;flex-direction:row-reverse}}}@supports (container-type: inline-size){@container content-container (min-width: 960px){[_nghost-%COMP%] .funds-table{width:43rem}[_nghost-%COMP%] .funds-table .fund-list-buttons{max-width:30rem;flex-flow:column wrap}}}@supports not (container: content-container){@media(min-width:960px){[_nghost-%COMP%] .funds-table{width:43rem}[_nghost-%COMP%] .funds-table .fund-list-buttons{max-width:30rem;flex-flow:column wrap}}}@supports (container-type: inline-size){@container content-container (min-width: 1280px){[_nghost-%COMP%] .funds-table .fund-list-buttons{width:30rem}}}@supports not (container: content-container){@media(min-width:1280px){[_nghost-%COMP%] .funds-table .fund-list-buttons{width:30rem}}}[_nghost-%COMP%] #new_funds_list{justify-content:center}[_nghost-%COMP%] #new_funds_list app-card{cursor:pointer;padding:0}[_nghost-%COMP%] #new_funds_list .fund-card{margin:0;height:100%;min-width:unset;width:100%}[_nghost-%COMP%] #new_funds_list .fund-card .p-card-body{height:100%}[_nghost-%COMP%] #new_funds_list .fund-card .p-card-content{justify-content:flex-start;padding:0}[_nghost-%COMP%] #new_funds_list .fund-card:hover{box-shadow:var(--shadow-dark)}[_nghost-%COMP%] #new_funds_list .fund-card .p-card-header{padding:0}[_nghost-%COMP%] #new_funds_list .fund-card img{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius)}[_nghost-%COMP%] #new_funds_list .parent-formatting{border:.125rem solid var(--giving_parent_fund_border_color);border-radius:.375rem}app-suspended-gifts-alert[_ngcontent-%COMP%]{margin-bottom:1rem}"]})}}return t})();var Fa=["passwordCaptchaRef"],Ra=t=>({frequency:t}),La=t=>({name:t}),Va=()=>["../.."],Ba=t=>({contributionType:t});function Ua(t,l){if(t&1&&(a(0,"h3",8),u(1),c(2,"translate"),r()),t&2){let e=d();o(),v(T(2,1,"MESSAGE.THANK_YOU",R(4,La,e.userFirstName)))}}function ka(t,l){t&1&&(a(0,"h3",8),u(1),c(2,"translate"),r()),t&2&&(o(),v(f(2,1,"FINANCE.LABELS.THANK_YOU")))}function za(t,l){t&1&&(a(0,"h6",10),u(1),c(2,"translate"),r()),t&2&&(o(),v(f(2,1,"MESSAGE.GIFT_PROCESSED")))}function qa(t,l){t&1&&(a(0,"h6",10),u(1),c(2,"translate"),r()),t&2&&(o(),v(f(2,1,"MESSAGE.GIFT_HAS_BEEN_SCHEDULED")))}function ja(t,l){if(t&1&&(a(0,"div",11)(1,"div",8),h(2,"span",24),r()()),t&2){let e=d();o(2),g("innerHTML",e.giftSubmission.fundCustomConfirmationPageMessage,Xe)}}function Wa(t,l){if(t&1&&(a(0,"div",18),u(1),c(2,"translate"),r()),t&2){let e=d();o(),q("",f(2,2,"LABEL.CONFIRMATION")," #: ",e.giftSubmission.confirmationNumber)}}function Ha(t,l){if(t&1&&(a(0,"div",19),u(1),c(2,"translate"),c(3,"date"),r()),t&2){let e=d();o(),q(" ",f(2,2,"LABEL.SCHEDULED"),": ",T(3,4,e.giftSubmission.scheduledDate,"MM/dd
1/yyyy")," ")}}function Ya(t,l){if(t&1&&(a(0,"div",20)(1,"div"),u(2),c(3,"translate"),r(),a(4,"div"),u(5),r()()),t&2){let e=d();o(2),A("",f(3,2,"FINANCE.LABELS.ASSOCIATED_WITH"),": "),o(3),v(e.giftSubmission.attributedToAssociatedOrganization)}}function Qa(t,l){if(t&1&&(a(0,"div",21)(1,"div",25),u(2),c(3,"translate"),r(),a(4,"div",25),u(5),c(6,"currency"),r()()),t&2){let e=d();o(2),v(f(3,2,"LABEL.PROCESSING_FEE_DONATION")),o(3),v(f(6,4,e.giftSubmission.feeOffsetAmount))}}function $a(t,l){t&1&&(a(0,"div",26),h(1,"button",27),c(2,"translate"),r()),t&2&&(o(),g("label",j(f(2,3,"LABEL.BACK_TO_FUNDS_LIST")))("routerLink",Ie(5,Va)))}function Ka(t,l){t&1&&h(0,"span",38)}function Xa(t,l){t&1&&h(0,"span",39)}function Ja(t,l){if(t&1&&(p(0,Ka,1,0,"span",38),p(1,Xa,1,0,"span",39)),t&2){let e=l;m(e.errors!=null&&e.errors.minlength&&e.touched?0:-1),o(),m(e.errors&&!e.errors.minlength&&e.errors.pattern&&e.touched?1:-1)}}function Za(t,l){if(t&1&&p(0,Ja,2,2),t&2){let e,n=d(3);m((e=n.giftConfirmationForm.get("password"))?0:-1,e)}}function er(t,l){if(t&1){let e=P();a(0,"app-contact-otp-code-button",40),y("buttonClick",function(){I(e);let i=d(3);return b(i.sendContactOtp())}),r()}if(t&2){let e=d(3);g("isLoading",e.isSendingOtp())("disabled",e.giftConfirmationForm.value.password)("contactType",e.getContactType())}}function tr(t,l){if(t&1){let e=P();a(0,"form",30),y("ngSubmit",function(){I(e);let i=ae(14);return b(i==null?null:i.execute())}),a(1,"div",31),u(2),c(3,"translate"),c(4,"translate"),r(),a(5,"div",32),u(6),r(),a(7,"app-password-input",33),M(8,Za,1,1,"ng-template",null,1,w),r(),p(10,er,1,3,"app-contact-otp-code-button",34),h(11,"app-form-submit-button",35),a(12,"div",36)(13,"re-captcha",37,2),y("resolved",function(i){I(e);let s=d(2);return b(i&&s.convertGuestToCredentialedUser())}),r()()()}if(t&2){let e=d(2);g("formGroup",e.giftConfirmationForm),o(2),A(" ",T(4,12,"MESSAGE.NEXT_TIME_SIGN_IN",R(15,Ba,f(3,10,"WORD.GIFTS")))," "),o(4),A(" ",e.displayUsername()," "),o(),g("minlength",7)("required",!0),o(3),m(e.displayOtpOption()?10:-1),o(),g("form",e.giftConfirmationForm)("isLoading",e.isCreatingAccount())("disabled",!e.giftConfirmationForm.valid||e.isCreatingAccount()),o(2),g("siteKey",e.reCaptchaSiteKey)}}function ir(t,l){if(t&1){let e=P();a(0,"app-contact-otp-registration",41),y("verifyFinished",function(i){I(e);let s=d(2);return b(s.onOtpVerificationFinished(i))}),r()}if(t&2){let e=d(2);g("username",e.guestGiftSubmission.email??e.guestGiftSubmission.phone)("redirectUrl",e.redirectUrl)}}function nr(t,l){if(t&1&&(a(0,"app-card",23),c(1,"translate"),p(2,tr,15,17,"form",28)(3,ir,1,2,"app-contact-otp-registration",29),r()),t&2){let e=d();g("header",f(1,2,"LABEL.CREATE_AN_ACCOUNT")),o(2),m(e.isValidatingOtp()?3:2)}}var ho=(()=>{class t{constructor(){this.showCreateAccountCard=B(!1),this.isCreatingAccount=B(!1),this.displayOtpOption=B(!1),this.isSendingOtp=B(!1),this.isValidatingOtp=B(!1),this.destroyRef=E(J),this.activePublicTenantSvc=E(fe),this.myGiftsSvc=E(Pe),this.notificationSvc=E(te),this.profileSvc=E(Ne),this.publicLinkSvc=E(ie),this.publicLoginSvc=E(Me),this.configSvc=E(we),this.publicSvc=E(Ye),this.route=E(U),this.sessionSvc=E(je)}ngOnInit(){let e=this.activePublicTenantSvc.getActiveTenant();this.displayOtpOption.set(e?.enableEmailOtpForLogin===!0),this.redirectUrl=this.publicLinkSvc.userAccount().join("/"),this.reCaptchaSiteKey=this.configSvc.get("reCaptchaSiteKey"),this.giftSubmission=this.route.snapshot.data.giftSubmission;let n=this.giftSubmission;this.giftAmount=n.feeOffsetAmount>0?n.amount-n.feeOffsetAmount:n.amount,this.profileSvc.activeProfile$.pipe(N(this.destroyRef)).subscribe(i=>{this.userFirstName=i?i.firstName:""}),this.guestGiftSubmission=this.myGiftsSvc.getGuestGiftSubmission(),!this.isAuthenticated()&&this.guestGiftSubmission?.contactExists===!1&&(this.showCreateAccountCard.set(!0),this.buildForm())}isAuthenticated(){return this.sessionSvc.isAuthenticated()}convertGuestToCredentialedUser(){this.isCreatingAccount.set(!0);let e=this.giftConfirmationForm.get("password").value,n=this.buildCreateUserCommand(e);n.recaptcha=this.giftConfirmationForm.get("passwordCaptcha").value;let i=n.email??n.phone;this.publicSvc.createUser(n).pipe(F(()=>{this.isCreatingAccount.set(!1),this.publicLoginSvc.login(i,n.password,this.redirectUrl)}),Q(s=>(this.isCreatingAccount.set(!1),this.notificationSvc.errorBanner({title:"LABEL.ERROR",message:s.message}),K(null)))).subscribe()}onOtpVerificationFinished(e){e&&this.showCreateAccountCard.set(!1)}buildCreateUserCommand(e){return{email:this.guestGiftSubmission.email,password:e,firstName:this.guestGiftSubmission.firstName,lastName:this.guestGiftSubmission.lastName,phone:this.guestGiftSubmission.phone,address:{line1:this.guestGiftSubmission.address1,line2:this.guestGiftSubmission.address2,city:this.guestGiftSubmission.city,state:this.guestGiftSubmission.state,zip:this.guestGiftSubmission.zip},recaptcha:null,enableMfa:!1}}buildForm(){this.giftConfirmationForm=new Dt({password:new he("",[x.required,x.minLength(7),x.pattern(k.PASSWORD_REQUIREMENT)]),passwordCaptcha:new he(null)})}getContactType(){return this.guestGiftSubmission.email?k.CONTACT_TYPE.EMAIL:this.guestGiftSubmission.phone?k.CONTACT_TYPE.PHONE:""}
1displayUsername(){let e=String(this.guestGiftSubmission.email??this.guestGiftSubmission.phone).trim();if(!dt(e))return e;let n=e.replaceAll(/\D/g,""),i=n.length===bn+1&&n.startsWith("1")?n.slice(1):n;return En(i)}sendContactOtp(){this.isSendingOtp.set(!0);let e=this.buildCreateUserCommand(null);if(e.email&&e.phone){this.isSendingOtp.set(!1),this.notificationSvc.errorBanner({title:"ERROR.CREATING_ACCOUNT",message:"ERROR.EMAIL_AND_PHONE_ACCOUNT_CREATION"});return}this.isSendingOtp.set(!0);let n={contact:e.email??e.phone,firstName:e.firstName,lastName:e.lastName,address:e.address};this.publicSvc.sendContactRegistrationOtp(n).pipe(F(()=>{this.isValidatingOtp.set(!0)}),Q(i=>(this.notificationSvc.errorBanner({title:"LABEL.ERROR",message:i.message}),K(null))),xe(()=>{this.isSendingOtp.set(!1)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=O({type:t,selectors:[["app-gift-confirmation"]],viewQuery:function(n,i){if(n&1&&me(Fa,5),n&2){let s;W(s=H())&&(i.passwordCaptchaRef=s.first)}},decls:47,vars:28,consts:[["footer",""],["errors",""],["passwordCaptchaRef","reCaptcha"],[1,"flex","flex-full-width","justify-content-center","flex-column"],["id","gift_confirmation_card",1,"slim"],[1,"flex","justify-content-center","align-items-center"],["icon","check_circle","severity","success","size","3xl"],[1,"flex","flex-row-wrap","justify-content-center","px-1"],[1,"text-center"],[1,"flex","flex-row-wrap","justify-content-center","px-1","pt-0.25"],[1,"text-center","color-secondary"],[1,"flex","flex-full-width","justify-content-center","px-1","pt-1"],[1,"flex","flex-row-wrap","align-items-center","py-1.5","px-0.5"],["id","gift_confirmation_details"],[1,"flex","justify-content-space-between"],[1,"color-secondary","font-bold"],[1,"color-secondary","flex","flex-row-wrap","mt-0.5"],[1,"flex-full-width"],[1,"gift-confirmation-number","color-secondary","flex-full-width"],[1,"color-secondary","flex-full-width"],[1,"color-secondary"],[1,"flex","justify-content-space-between","mt-0.5"],[1,"flex","justify-content-flex-end"],["id","create_account_card",1,"slim","mt-1",3,"header"],[3,"innerHTML"],[1,"font-bold"],[1,"app-card-footer","flex","justify-content-center","flex-row-wrap"],["pButton","","id","return_to_fund_btn",1,"p-button","p-button-outlined","p-button-plain",3,"label","routerLink"],[1,"flex","flex-column",3,"formGroup"],[3,"username","redirectUrl"],[1,"flex","flex-column",3,"ngSubmit","formGroup"],[1,"mb-1"],[1,"font-bold","mb-1"],["formControlName","password","label","LABEL.CREATE_PASSWORD","inputId","password","autocomplete","new-password",1,"flex-full-width",3,"minlength","required"],[1,"mb-1",3,"isLoading","disabled","contactType"],["buttonId","convert_account_button","buttonClasses","w-full p-button-lg","label","LABEL.CONTINUE",3,"form","isLoading","disabled"],[1,"flex","justify-content-center","recaptcha-badge","pt-1"],["formControlName","passwordCaptcha","id","passwordCaptcha","size","invisible","badge","inline",3,"resolved","siteKey"],["translate","ERROR.PASSWORD_MIN_LENGTH"],["translate","ERROR.PASSWORD_BAD_FORMAT"],[1,"mb-1",3,"buttonClick","isLoading","disabled","contactType"],[3,"verifyFinished","username","redirectUrl"]],template:function(n,i){n&1&&(h(0,"app-header-image"),a(1,"div",3)(2,"app-card",4)(3,"div")(4,"div",5),h(5,"app-icon",6),r(),a(6,"div",7),p(7,Ua,3,6,"h3",8)(8,ka,3,3,"h3",8),r(),a(9,"div",9),p(10,za,3,3,"h6",10)(11,qa,3,3,"h6",10),r(),p(12,ja,3,1,"div",11),h(13,"hr"),a(14,"div")(15,"div",12)(16,"div",13)(17,"div",14)(18,"h5"),u(19),r(),a(20,"h5"),u(21),c(22,"currency"),r()(),a(23,"div",15),u(24),r(),a(25,"div",15),u(26),r(),a(27,"div",16)(28,"div",17),u(29),c(30,"givingFrequencies"),c(31,"translate"),r(),p(32,Wa,3,4,"div",18)(33,Ha,4,7,"div",19),p(34,Ya,6,4,"div",20),r(),p(35,Qa,7,6,"div",21),r()()(),h(36,"hr"),a(37,"div",22)(38,"h4"),u(39),c(40,"translate"),a(41,"span"),u(42),c(43,"currency"),r()()()(),M(44,$a,3,6,"ng-template",null,0,w),r(),p(46,nr,4,4,"app-card",23),r()),n&2&&(o(7),m(i.userFirstName.length>0?7:8),o(3),m(i.giftSubmission.confirmationNumber!==null?10:11),o(2),m(i.giftSubmission.fundUseCustomConfirmationPageMessage?12:-1),o(7),v(i.giftSubmission.fundName),o(2),v(f(22,15,i.giftAmount)),o(3),v(i.giftSubmission.organizationName),o(2),q("",i.giftSubmission.organizationAddress.city,", ",i.giftSubmission.organizationAddress.state),o(3),v(T(31,19,"FINANCE.LABELS.FREQUENCY_GIFT",R(26,Ra,f(30,17,i.giftSubmission.giftFrequency))
1)),o(3),m(i.giftSubmission.confirmationNumber?32:33),o(2),m(i.giftSubmission.attributedToAssociatedOrganization?34:-1),o(),m(i.giftSubmission.feeOffsetAmount>0?35:-1),o(4),A("",f(40,22,"LABEL.TOTAL"),": "),o(3),v(f(43,24,i.giftSubmission.amount)),o(4),m(i.showCreateAccountCard()?46:-1))},dependencies:[Kn,$,vt,Z,pn,ve,de,se,le,it,nt,be,Ce,_e,at,Se,ge,rt,Ee,We,De,He,Ge,st,ue,ze,bt,G],styles:["#gift_confirmation_details[_ngcontent-%COMP%]{flex-grow:10}"]})}}return t})();var xt=(function(t){return t.Summary="summary",t.UpdateGift="update-gift",t.Confirmation="confirmation",t})(xt||{}),Wt=(function(t){return t.Fail="Fail",t.InProgress="InProgress",t.Success="Success",t})(Wt||{});var $e=(()=>{class t{constructor(e,n,i,s){this.location=e,this.publicLinkSvc=n,this.router=i,this.translateSvc=s,this.giftIncreaseProcessInfo=new Ot(this.initializeGiftIncreaseProcessInfo()),this.giftIncreaseProcessInfo$=this.giftIncreaseProcessInfo.asObservable()}get tenantId(){return this.publicLinkSvc.getCurrentTenantId()}navigateToPage(e){let n=this.giftIncreaseProcessInfo.getValue().fundDetail.url;this.tenantId&&n?e==="fundDetail"?this.router.navigate(this.publicLinkSvc.fund(n)):this.router.navigate(this.publicLinkSvc.fundList(this.tenantId)):this.location.back()}setDonorId(e){this.giftIncreaseProcessInfo.next(pe(L({},this.giftIncreaseProcessInfo.getValue()),{donorId:e}))}setFundDetail(e){this.giftIncreaseProcessInfo.next(pe(L({},this.giftIncreaseProcessInfo.getValue()),{fundDetail:e}))}setNextStep(e){this.giftIncreaseProcessInfo.next(pe(L({},this.giftIncreaseProcessInfo.getValue()),{step:e}))}setSelectedContribution(e){this.giftIncreaseProcessInfo.next(pe(L({},this.giftIncreaseProcessInfo.getValue()),{selectedContribution:e}))}setStatus(e){this.giftIncreaseProcessInfo.next(pe(L({},this.giftIncreaseProcessInfo.getValue()),{status:e}))}setTitle(e){this.giftIncreaseProcessInfo.next(pe(L({},this.giftIncreaseProcessInfo.getValue()),{title:e}))}setUpcomingContributions(e){this.giftIncreaseProcessInfo.next(pe(L({},this.giftIncreaseProcessInfo.getValue()),{upcomingContributions:e}))}setUserDetail(e){this.giftIncreaseProcessInfo.next(pe(L({},this.giftIncreaseProcessInfo.getValue()),{userDetail:e}))}initializeGiftIncreaseProcessInfo(){return{donorId:null,fundDetail:null,selectedContribution:null,status:Wt.InProgress,step:xt.Summary,title:this.translateSvc.instant("LABEL.GIFT_INCREASE_OPTIONS"),upcomingContributions:[],userDetail:null}}static{this.\u0275fac=function(n){return new(n||t)(Ue(rn),Ue(ie),Ue(ee),Ue(oe))}}static{this.\u0275prov=pt({token:t,factory:t.\u0275fac})}}return t})();var ar=t=>({fundName:t});function rr(t,l){if(t&1&&(a(0,"p",6),u(1),c(2,"translate"),r()),t&2){let e=d(2);o(),A(" ",T(2,1,"FINANCE.MESSAGES.GIFT_INCREASE_CAMPAIGN_THANKS",R(4,ar,e.fundDetail.name))," ")}}function sr(t,l){if(t&1&&(a(0,"strong",9),u(1),r()),t&2){let e=d(3);o(),v(e.fundDetail.name)}}function lr(t,l){if(t&1&&(a(0,"strong",10),u(1),c(2,"currency"),r()),t&2){let e=d(4);o(),v(T(2,1,e.submittedContribution.amount,"USD"))}}function dr(t,l){t&1&&(a(0,"strong"),u(1),c(2,"translate"),r()),t&2&&(o(),v(f(2,1,"LABEL.RECURRING_FREQUENCIES.ONETIME")))}function cr(t,l){if(t&1&&(a(0,"strong"),u(1),r()),t&2){let e=d(4);o(),v(e.submittedContribution.giftFrequency)}}function pr(t,l){if(t&1&&(a(0,"strong"),u(1),c(2,"date"),r()),t&2){let e=d(5);o(),v(T(2,1,e.submittedContribution==null?null:e.submittedContribution.pledgeStartDate,"MM/dd/yyyy"))}}function mr(t,l){if(t&1&&p(0,pr,3,4,"strong"),t&2){let e=d(4);m(e.submittedContribution!=null&&e.submittedContribution.pledgeStartDate?0:-1)}}function ur(t,l){if(t&1&&(a(0,"strong"),u(1),c(2,"date"),r()),t&2){let e=d(5);o(),v(T(2,1,e.submittedContribution==null?null:e.submittedContribution.scheduledDate,"MM/dd/yyyy"))}}function fr(t,l){if(t&1&&p(0,ur,3,4,"strong"),t&2){let e=d(4);m(e.submittedContribution!=null&&e.submittedContribution.scheduledDate?0:-1)}}function gr(t,l){if(t&1&&(a(0,"strong"),u(1),c(2,"translate"),r(),a(3,"strong",12),u(4),c(5,"currency"),r()),t&2){let e=d(4);o(),A("",f(2,2,"FINANCE.LABELS.PLEDGE_TOTAL_BREAKDOWN"),":"),o(3),v(T(5,4,e.submittedContribution.pledgeTotalAmount,"USD"))}}function hr(t,l){if(t&1&&(a(0,"section",7)(1,"div",8),p(2,sr,2,1,"strong",9),p(3,lr,3,4,"strong",10),r(),a(4,"div")(5,"span"),u(6),c(7,"translate"),r(),p(8,dr,3,3,"strong")(9,cr,2,1,"strong"),r(),a(10,"div")(11,"span"),u(12),c(13,"translate"),r(),p(14,mr,1,1)(15,fr,1,1
1),r()(),a(16,"section",11)(17,"strong"),u(18),c(19,"translate"),r(),a(20,"strong",12),u(21),c(22,"currency"),r(),p(23,gr,6,7),r()),t&2){let e=d(2),n=d();o(2),m(e.fundDetail?2:-1),o(),m(n.submittedContribution.amount?3:-1),o(3),A("",f(7,9,"FINANCE.LABELS.GIFT_FREQUENCY")," "),o(2),m(n.submittedContribution.giftFrequency==="OneTime"?8:9),o(4),A("",f(13,11,"FINANCE.LABELS.NEXT_GIFT_DATE")," "),o(2),m(n.isPledge?14:15),o(4),v(f(19,13,"FINANCE.LABELS.GIFT_TOTAL")),o(3),v(T(22,15,n.submittedContribution.amount,"USD")),o(2),m(n.isPledge?23:-1)}}function _r(t,l){if(t&1&&(a(0,"section",3),h(1,"app-icon",4),a(2,"strong",5),u(3),c(4,"translate"),r(),p(5,rr,3,6,"p",6),r(),p(6,hr,24,18)),t&2){let e=d(),n=d();o(3),A(" ",f(4,3,"FINANCE.MESSAGES.GIFT_INCREASE_THANK_YOU")," "),o(2),m(e.fundDetail?5:-1),o(),m(n.submittedContribution?6:-1)}}function Cr(t,l){if(t&1){let e=P();a(0,"section",0),p(1,_r,7,5),a(2,"section",1)(3,"button",2),c(4,"translate"),y("click",function(){I(e);let i=d();return b(i.onViewFunds())}),r()()()}t&2&&(o(),m(l.status==="Success"?1:-1),o(2),g("label",f(4,2,"LABEL.VIEW_FUNDS")))}var _o=(()=>{class t{constructor(e,n,i){this.contributionPublicSvc=e,this.giftIncreaseSvc=n,this.notifySvc=i,this.giftIncreaseProcessInfo$=this.giftIncreaseSvc.giftIncreaseProcessInfo$.pipe(F(s=>{this.getSelectedContributionUpdates(s.selectedContribution.id)}),Q(()=>K(null))),this.isPledge=!1}onViewFunds(){this.giftIncreaseSvc.navigateToPage("fundList")}getSelectedContributionUpdates(e){this.contributionPublicSvc.getUpcomingContributions().pipe(F(n=>{let i=n.find(s=>s.id===e);i&&(this.submittedContribution=i,this.submittedContribution?.pledgeId&&(this.isPledge=!0))}),Q(n=>{throw this.notifySvc.toast({title:"LABEL.ERROR",message:"FINANCE.ERRORS.GIFT_INCREASE_CONFIRMATION_FAILURE",severity:"error"}),n}),et(1)).subscribe()}static{this.\u0275fac=function(n){return new(n||t)(S(xi),S($e),S(te))}}static{this.\u0275cmp=O({type:t,selectors:[["app-gift-increase-confirmation"]],decls:2,vars:3,consts:[["id","gift_increase_confirmation"],[1,"grid","mt-1"],["pButton","","id","view_funds_list","type","button",1,"p-button",3,"click","label"],[1,"border-bottom-solid","text-center","pb-1","mb-1"],["icon","check_circle","severity","success","size","4xl",1,"block"],[1,"font-size-1.5"],[1,"mb-0"],[1,"border-bottom-solid","mb-1","pb-1"],[1,"grid","gap-0","template-cols-1-auto","mb-1"],[1,"font-size-1.5","mr-1"],[1,"font-size-1.5","ml-auto"],[1,"border-bottom-solid","grid","row-gap-0","template-cols-1-auto","mb-2","pb-1"],[1,"ml-auto"]],template:function(n,i){if(n&1&&(p(0,Cr,5,4,"section",0),c(1,"async")),n&2){let s;m((s=f(1,1,i.giftIncreaseProcessInfo$))?0:-1,s)}},dependencies:[vt,Z,ke,ue,ze,G],encapsulation:2})}}return t})();var vr=()=>({size:36,offset:16,showPledgeCircle:!1});function Sr(t,l){if(t&1&&(a(0,"section",0),h(1,"advanced-image",1),a(2,"strong",2),u(3),r(),a(4,"p",3),u(5),c(6,"translate"),r()()),t&2){let e=l,n=d();o(),g("cldImg",n.cloudinary.fundImage(e.fundDetail,Ie(5,vr))),o(2),v(e.fundDetail.name),o(2),v(f(6,3,"FINANCE.MESSAGES.GIFT_INCREASE_WILLINGNESS"))}}var Ri=(()=>{class t{constructor(e,n){this.cloudinary=e,this.giftIncreaseSvc=n,this.giftIncreaseProcessInfo$=this.giftIncreaseSvc.giftIncreaseProcessInfo$}static{this.\u0275fac=function(n){return new(n||t)(S(Ct),S($e))}}static{this.\u0275cmp=O({type:t,selectors:[["app-gift-increase-fund-header"]],decls:2,vars:3,consts:[["id","gift_increase_options_header"],["id","fund_image",1,"img:max-w-full",3,"cldImg"],[1,"block","font-size-1.125"],[1,"my-0.5"]],template:function(n,i){if(n&1&&(p(0,Sr,7,6,"section",0),c(1,"async")),n&2){let s;m((s=f(1,1,i.giftIncreaseProcessInfo$))?0:-1,s)}},dependencies:[yt,St,ke,G],encapsulation:2})}}return t})();function yr(t,l){t&1&&(u(0),c(1,"translate")),t&2&&A(" ",f(1,1,"LABEL.RECURRING_FREQUENCIES.ONETIME")," ")}function Ir(t,l){if(t&1&&u(0),t&2){let e=d(2);A(" ",e.upcomingContribution.giftFrequency," ")}}function br(t,l){if(t&1&&(a(0,"span"),u(1),c(2,"date"),r()),t&2){let e=d(3);o(),v(T(2,1,e.upcomingContribution==null?null:e.upcomingContribution.pledgeStartDate,"MM/dd
1/yyyy"))}}function Er(t,l){if(t&1&&(a(0,"span"),u(1),c(2,"date"),r()),t&2){let e=d(3);o(),A(" - ",T(2,1,e.upcomingContribution==null?null:e.upcomingContribution.pledgeEndDate,"MM/dd/yyyy"))}}function Pr(t,l){if(t&1&&(p(0,br,3,4,"span"),p(1,Er,3,4,"span")),t&2){let e=d(2);m(e.upcomingContribution!=null&&e.upcomingContribution.pledgeStartDate?0:-1),o(),m(e.upcomingContribution!=null&&e.upcomingContribution.pledgeEndDate?1:-1)}}function Ar(t,l){if(t&1&&(a(0,"span"),u(1),c(2,"date"),r()),t&2){let e=d(3);o(),v(T(2,1,e.upcomingContribution==null?null:e.upcomingContribution.scheduledDate,"MM/dd/yyyy"))}}function xr(t,l){t&1&&(a(0,"span"),u(1),c(2,"translate"),r()),t&2&&(o(),A(" - ",f(2,1,"FINANCE.LABELS.NO_END_DATE")))}function Tr(t,l){if(t&1&&(p(0,Ar,3,4,"span"),p(1,xr,3,3,"span")),t&2){let e=d(2);m(e.upcomingContribution!=null&&e.upcomingContribution.scheduledDate?0:-1),o(),m(e.upcomingContribution!=null&&e.upcomingContribution.scheduledDate&&e.upcomingContribution.giftType==="Recurring"?1:-1)}}function Or(t,l){t&1&&(h(0,"app-icon",3),c(1,"translate")),t&2&&g("cursorPointer",!0)("icon","icon-pledge")("size","md")("tight",!0)("tooltip",f(1,5,"LABEL.PLEDGE"))}function wr(t,l){if(t&1&&(a(0,"span",4),u(1),c(2,"currency"),r()),t&2){let e=d(2);o(),A(" ",T(2,1,e.upcomingContribution.amount,"USD")," ")}}function Nr(t,l){if(t&1&&(a(0,"section",1)(1,"section")(2,"div"),p(3,yr,2,3)(4,Ir,1,1),r(),a(5,"div"),p(6,Pr,2,2)(7,Tr,2,2),r()(),a(8,"section",2),p(9,Or,2,7,"app-icon",3),p(10,wr,3,4,"span",4),h(11,"app-icon",5),r()()),t&2){let e=d();mt("activated",e.isActive)("interactive",e.isInteractive),o(3),m(e.upcomingContribution.giftFrequency==="OneTime"?3:4),o(3),m(e.upcomingContribution!=null&&e.upcomingContribution.pledgeId?6:e.upcomingContribution!=null&&e.upcomingContribution.scheduledDate?7:-1),o(3),m(e.upcomingContribution!=null&&e.upcomingContribution.pledgeId?9:-1),o(),m(e.upcomingContribution.amount?10:-1),o(),g("icon",e.icon)("size",e.iconSize)("tight",!0)}}var Li=(()=>{class t{constructor(){this.icon="chevron_right",this.iconSize="lg",this.isActive=!1,this.isInteractive=!0,this.upcomingContribution=null}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=O({type:t,selectors:[["app-gift-increase-match-stick"]],inputs:{icon:"icon",iconSize:"iconSize",isActive:"isActive",isInteractive:"isInteractive",upcomingContribution:"upcomingContribution"},decls:1,vars:1,consts:[[1,"grid","gap-0","template-cols-1-auto-auto","align-items-center","border-solid","border-radius-2","no-select","p-1","mb-1",3,"activated","interactive"],[1,"grid","gap-0","template-cols-1-auto-auto","align-items-center","border-solid","border-radius-2","no-select","p-1","mb-1"],[1,"flex","align-items-center","ml-auto"],[1,"mr-0.5",3,"cursorPointer","icon","size","tight","tooltip"],[1,"font-size-1.5"],[3,"icon","size","tight"]],template:function(n,i){n&1&&p(0,Nr,12,11,"section",0),n&2&&m(i.upcomingContribution?0:-1)},dependencies:[vt,ue,ze,G],styles:[".activated[_ngcontent-%COMP%], .interactive[_ngcontent-%COMP%]:active{border-color:var(--primary-color);box-shadow:inset 0 0 0 .125rem var(--primary-color)}.interactive[_ngcontent-%COMP%]:hover{cursor:pointer;border-color:var(--text-color)}"]})}}return t})();var Mr=t=>({$implicit:t}),Dr=(t,l)=>l.id;function Gr(t,l){t&1&&ii(0)}function Fr(t,l){if(t&1&&M(0,Gr,1,0,"ng-container",5),t&2){let e=d();d();let n=ae(9);g("ngTemplateOutlet",n)("ngTemplateOutletContext",R(2,Mr,e.increasableGifts))}}function Rr(t,l){t&1&&ii(0)}function Lr(t,l){if(t&1&&M(0,Rr,1,0,"ng-container",6),t&2){d(2);let e=ae(11);g("ngTemplateOutlet",e)}}function Vr(t,l){if(t&1&&p(0,Fr,1,4,"ng-container")(1,Lr,1,1,"ng-container"),t&2){let e=l;m(e.giftIncreaseProcessInfo.donorId&&e.increasableGifts.length>0?0:1)}}function Br(t,l){t&1&&ii(0)}function Ur(t,l){if(t&1&&M(0,Br,1,0,"ng-container",6),t&2){d();let e=ae(7);g("ngTemplateOutlet",e)}}function kr(t,l){t&1&&h(0,"app-loading-spinner",4)}function zr(t,l){if(t&1){let e=P();h(0,"app-affirmation",7),c(1,"translate"),a(2,"section",8)(3,"button",9),c(4,"translate"),y("click",function(){I(e);let i=d();return b(i.onFundDetail())}),r()()}t&2&&(g("message",f(1,2,"ERROR.GENERIC")),o(3),g("label",f(4,4,"LABEL.CANCEL")))}function qr(t,l){if(t&1){let e=P();a(0,"app-gift-increase-match-stick",12),y("click",function(){let i=I(e).$implicit,s=d(2);return b(s.onGiftClick(i))}),r()}if(t&2){let e=l.$implicit;g("upcomingContribution",e)}}function jr(t,l){if(t&1){let e=P();a(0,"strong",10),u(1),c(2,"translate"),r(),Te(3,qr,1,1,"app-gift-increase-match-stick",11,Dr),a(5,"section",8)(6,"button",9),c(7,"translate"),y("click",function(){I(e);let i=d();return b(i.onFundDetail())}),r()()}if(t&2){let e=l.$implicit;o(),v(f(2,2,"FINANCE.LABELS.SELECT_AN_ACTIVE_GIFT")),o(2),Oe(e),o(3),g("label",f(7,4,"LABEL.CANCEL"))}}function Wr(t,l){if(t&1){let e=P();a(0,"strong"),u(1),c(2,"translate"),r(),a(3,"section",8)(4,"button",13),c(5,"translate"),y("click",function(){I(e);let i=d();return b(i.onFundDetail())}),r()()}t&2&&(o(),v(f(2,2,"FINANCE.MESSAGES.NO_ACTIVE_GIFTS_TO_INCREASE")),o(3),g("label",f(5,4,"LABEL.GIVE_NOW")))}var Co=(()=>{class t{constructor(e,n,i){this.contributionPublicSvc=e,this.giftIncreaseSvc=n,this.notifySvc=i,this.giftIncreaseSummary$=this.giftIncreaseSvc.giftIncreaseProcessInfo$.pipe(Xi(s=>this.setupGiftIncreaseSummary(s)),et(1)),this.isLoading=!0,this.isError=!1}onFundDetail(){this.giftIncreaseSvc.navigateToPage("fundDetail")}onGiftClick(e){this.giftIncreaseSvc.setSelectedContribution(e),this.giftIncreaseSvc.setNextStep(xt.UpdateGift)}getIncreasableGifts(e){return e.some(i=>i.pledgeId)?e.filter(i=>i.pledgeId&&i.isIntendedToFulfillPledge&&i.pledgeTotalAmount>0):e}setupGiftIncreaseSummary(e){return this.contributionPublicSvc.getUpcomingContributions().pipe(F(()=>{this.isLoading=!0}),Ze(n=>{let i=e.fundDetail.id,s=n.filter(C=>!C.managed&&C.giftStatus==="Scheduled"&&i===C.fundId),_=this.getIncreasableGifts(s);return this.giftIncreaseSvc.setUpcomingContributions(n),this.isError=!1,{giftIncreaseProcessInfo:e,increasableGifts:_}}),Q(()=>(this.isError=!0,this.notifySvc.toast({title:"LABEL.ERROR",message:"FINANCE.ERRORS.GIFT_INCREASE_SUMMARY_FAILURE",severity:"error"}),K(null))),xe(()=>{this.isLoading=!1}))}static{this.\u0275fac=function(n){return new(n||t)(S(xi),S($e),S(te))}}static{this.\u0275cmp=O({type:t,selectors:[["app-gift-increase-summary"]],decls:12,vars:3,consts:[["error",""],["hasGifts",""],["noGifts",""],["id","gift_increase_summary"],[1,"my-1"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[4,"ngTemplateOutlet"],["severity","error",1,"mb-1",3,"message"],[1,"grid","gap-1","mt-1"],["pButton","","id","cancel_button",1,"p-button","p-button-link","justify-self-center",3,"click","label"],[1,"block","mb-0.5"],[3,"upcomingContribution"],[3,"click","upcomingContribution"],["pButton","","id","give_now_button",1,"w-full",3,"click","label"]],template:function(n,i){if
1(n&1&&(a(0,"section",3),h(1,"app-gift-increase-fund-header"),p(2,Vr,2,1),c(3,"async"),nn(4,Ur,1,1,"ng-container")(5,kr,1,0,"app-loading-spinner",4),r(),M(6,zr,5,6,"ng-template",null,0,w)(8,jr,8,6,"ng-template",null,1,w)(10,Wr,6,6,"ng-template",null,2,w)),n&2){let s;o(2),m((s=f(3,1,i.giftIncreaseSummary$))?2:i.isError?4:5,s)}},dependencies:[Ri,sn,Pn,Rn,Z,Li,ke,G],encapsulation:2})}}return t})();var Yr=t=>({amount:t});function Qr(t,l){t&1&&(u(0),c(1,"translate")),t&2&&A(" ",f(1,1,"FINANCE.LABELS.YOUR_ACTIVE_PLEDGE")," ")}function $r(t,l){t&1&&(u(0),c(1,"translate")),t&2&&A(" ",f(1,1,"FINANCE.LABELS.YOUR_ACTIVE_GIFT")," ")}function Kr(t,l){if(t&1&&(a(0,"strong",15),p(1,Qr,2,3)(2,$r,2,3),r(),h(3,"app-gift-increase-match-stick",16)),t&2){let e=d();o(),m(e.selectedContribution.pledgeId?1:2),o(2),g("isActive",!0)("isInteractive",!1)("upcomingContribution",e.selectedContribution)}}function Xr(t,l){t&1&&(a(0,"i",17),u(1,"attach_money"),r())}function Jr(t,l){t&1&&h(0,"span",18)}function Zr(t,l){if(t&1&&p(0,Jr,1,0,"span",18),t&2){let e=d();m(e.giftIncreaseFormGroup.invalid&&(e.giftIncreaseFormGroup.controls.dollarAmountInput.dirty||e.giftIncreaseFormGroup.controls.dollarAmountInput.touched)&&(e.giftIncreaseFormGroup.controls.dollarAmountInput!=null&&e.giftIncreaseFormGroup.controls.dollarAmountInput.errors)?0:-1)}}function es(t,l){t&1&&(a(0,"i",17),u(1,"percent"),r())}function ts(t,l){t&1&&h(0,"span",19)}function is(t,l){if(t&1&&p(0,ts,1,0,"span",19),t&2){let e=d();m(e.giftIncreaseFormGroup.invalid&&(e.giftIncreaseFormGroup.controls.percentAmountInput.dirty||e.giftIncreaseFormGroup.controls.percentAmountInput.touched)&&(e.giftIncreaseFormGroup.controls.percentAmountInput!=null&&e.giftIncreaseFormGroup.controls.percentAmountInput.errors)?0:-1)}}function ns(t,l){t&1&&(a(0,"i",17),u(1,"attach_money"),r())}function os(t,l){t&1&&h(0,"span",21)}function as(t,l){if(t&1&&p(0,os,1,0,"span",21),t&2){let e=d(2);m(e.giftIncreaseFormGroup.invalid&&(e.giftIncreaseFormGroup.controls.dollarConfirmAmountInput!=null&&e.giftIncreaseFormGroup.controls.dollarConfirmAmountInput.errors)?0:-1)}}function rs(t,l){if(t&1&&(a(0,"section",8)(1,"app-input-group",20),M(2,ns,2,0,"ng-template",null,0,w)(4,as,1,1,"ng-template",null,1,w),r()()),t&2){let e=d();o(),g("disabled",!e.canSubmit)}}function ss(t,l){if(t&1&&(a(0,"span"),u(1),r()),t&2){let e=d(3);o(),A("(x ",e.calculatedAmount.pledge.installmentCount,")")}}function ls(t,l){if(t&1&&(a(0,"div",24)(1,"strong"),u(2),c(3,"translate"),r(),a(4,"strong"),u(5),c(6,"currency"),r()()),t&2){let e=d(3);o(2),v(f(3,2,"FINANCE.LABELS.YOUR_LAST_INSTALLMENT_AMOUNT")),o(3),v(T(6,4,e.calculatedAmount.pledge.lastInstallmentAmount,"USD"))}}function ds(t,l){if(t&1&&(a(0,"div",22),h(1,"app-icon",23),a(2,"span"),u(3),c(4,"currency"),c(5,"translate"),r()(),a(6,"div",24)(7,"strong"),u(8),c(9,"translate"),r(),a(10,"span"),u(11),c(12,"currency"),r()(),a(13,"div",25)(14,"strong"),u(15),c(16,"translate"),r(),a(17,"span"),u(18),c(19,"currency"),r()(),a(20,"div",24)(21,"strong"),u(22),c(23,"translate"),p(24,ss,2,1,"span"),r(),a(25,"strong"),u(26),c(27,"currency"),r()(),p(28,ls,7,7,"div",24),a(29,"div",24)(30,"strong"),u(31),c(32,"translate"),r(),a(33,"strong"),u(34),c(35,"currency"),r()()),t&2){let e=d(2);o(),g("icon","icon-pledge")("size","md")("tight",!0),o(2),v(T(5,17,"FINANCE.MESSAGES.GIFT_FULFILLING_PLEDGE",R(40,Yr,T(4,14,e.calculatedAmount.pledge.currentPledgeAmount,"USD")))),o(5),v(f(9,20,"FINANCE.LABELS.YOUR_CURRENT_GIFT")),o(3),v(T(12,22,e.calculatedAmount.pledge.currentAmount,"USD")),o(4),v(f(16,25,"FINANCE.LABELS.INCREASE")),o(3),v(T(19,27,e.calculatedAmount.increaseByAmount,"USD")),o(4),A("",f(23,30,"FINANCE.LABELS.YOUR_NEW_GIFT_AMOUNT")," "),o(2),m(e.calculatedAmount.pledge.installmentCount>0?24:-1),o(2),v(T(27,32,e.calculatedAmount.pledge.installmentAmount,"USD")),o(2),m(e.calculatedAmount.pledge.lastInstallmentAmount>0?28:-1),o(3),v(f(32,35,"FINANCE.LABELS.YOUR_NEW_PLEDGE_TOTAL")),o(3),v(T(35,37,e.calculatedAmount.pledge.newPledgeAmount,"USD"))}}function cs(t,l){if(t&1&&(a(0,"div",24)(1,"strong"),u(2),c(3,"translate"),r(),a(4,"span"),u(5),c(6,"currency"),r()(),a(7,"div",25)(8,"strong"),u(9),c(10,"translate"),r(),a(11,"span"),u(12),c(13,"currency"),r()(),a(14,"div",24)(15,"strong"),u(16),c(17,"translate"),r(),a(18,"strong"),u(19),c(20,"currency"),r()()),t&2){let e=d(2);o(2),v(f(3,6,"FINANCE.LABELS.YOUR_CURRENT_GIFT")),o(3),v(T(6,8,e.calculatedAmount.gift.currentAmount,"USD")),o(4),v(f(10,11,"FINANCE.LABELS.INCREASE")),o(3),v(T(13,13,e.calculatedAmount.increaseByAmount,"USD")),o(4),v(f(17,16,"FINANCE.LABELS.YOUR_NEW_GIFT_AMOUNT")),o(3),v(T(20,18,e.calculatedAmount.gift.newAmount,"USD"))}}function ps(t,l){if(t&1&&p(0,ds,36,42)(1,cs,21,21),t&2){let e=d();m(e.selectedContribution.pledgeId?0:1)}}function ms(t,l){t&1&&h(0,"strong",10)}var vo=(()=>{class t{constructor(e,n,i,s){this.giftIncreaseSvc=e,this.giftSubmissionSvc=n,this.myPledgeSvc=i,this.notifySvc=s,this.calculatedAmount={increaseByAmount:0,gift:{currentAmount:0,newAmount:0},pledge:{currentAmount:0,currentPledgeAmount:0,installmentCount:0,installmentAmount:0,lastInstallmentAmount:0,newAmount:0,newPledgeAmount:0}},this.canSubmit=!0,this.donorId="",this.isLoading=!1,this.isPledge=!1,this.isToConfirmAmount=!1,this.percentInputType="Whole",this.dollarIncreaseLimit=1e3}ngOnInit(){this.giftIncreaseFormGroup=new Je({dollarAmountInput:new Y(null,[x.required,x.min(1),x.max(1e6),x.pattern(k.MONEY_PATTERN)]),dollarConfirmAmountInput:new Y,percentAmountInput:new Y(null,[x.required,x.min(.01),x.max(1e6),x.pattern(k.MONEY_PATTERN)])}),this.giftIncreaseSvc.giftIncreaseProcessInfo$.pipe(F(e=>{this.donorId=e.donorId,this.selectedContribution=e.selectedContribution,this.calculatedAmount.gift.currentAmount=this.selectedContribution.amount,this.calculatedAmount.gift.newAmount=this.calculatedAmount.gift.currentAmount,this.selectedContribution?.pledgeId&&(this.isPledge=!0,this.calculatedAmount.pledge.currentAmount=this.selectedContribution.amount,this.calculatedAmount.pledge.currentPledgeAmount=this.selectedContribution.pledgeTotalAmount)}),Q(()=>(this.canSubmit=!1,K(null))),et(1)).subscribe()}onCalculateDollarAmountInput(e){this.isPledge?this.calculatePledgeDollarAmount(e):this.calculateGiftDollarAmount(e)}onCalculatePercentAmountInput(e){this.isPledge?this.calculatePledgePercentAmount(e):this.calculateGiftPercentAmount(e)}onCancel(){this.giftIncreaseSvc.navigateToPage("fundDetail")}onInputKeyDown(e){(e.key==="ArrowUp"||e.key==="ArrowDown")&&e.preventDefault()}onPrevious(){this.giftIncreaseSvc.setSelectedContribution(null),this.giftIncreaseSvc.setNextStep(xt.Summary)}onSubmit(){this.canSubmit&&this.giftIncreaseFormGroup.valid&&(this.isLoading=!0,this.submitGift())}calculateGiftDollarAmount(e){let n=+e;this.calculatedAmount.increaseByAmount=+n.toFixed(2),this.calculatedAmount.gift.newAmount=+(this.calculatedAmount.gift.currentAmount+this.calculatedAmount.increaseByAmount).toFixed(2);let i=this.getPercentIncreasedBy(this.calculatedAmount.gift.currentAmount,this.calculatedAmount.gift.newAmount);this.IsAmountConfirmationRequired(this.calculatedAmount.increaseByAmount),this.giftIncreaseFormGroup.get("percentAmountInput")?.setValue(i)}calculateGiftPercentAmount(e){let n=+e/100;this.calculatedAmount.increaseByAmount=+(this.calculatedAmount.gift.currentAmount*n).toFixed(2),this.calculatedAmount.gift.newAmount=+(this.calculatedAmount.gift.currentAmount+this.calculatedAmount.increaseByAmount).toFixed(2),this.IsAmountConfirmationRequired(this.calculatedAmount.increaseByAmount),this.giftIncreaseFormGroup.get("dollarAmountInput")?.setValue(this.calculatedAmount.increaseByAmount.toFixed(2))}calculatePledgeDollarAmount(e){let n=+e;this.calculatedAmount.increaseByAmount=+n.toFixed(2),this.calculatedAmount.pledge.newAmount=+(this.calculatedAmount.pledge.currentAmount+this.calculatedAmount.increaseByAmount).toFixed(2);let i=this.getPercentIncreasedBy(this.calculatedAmount.pledge.currentAmount,this.calculatedAmount.pledge.newAmount);this.calculateNewTotalPledgeAmount(this.calculatedAmount.pledge.newAmount,this.selectedContribution),this.IsAmountConfirmationRequired(this.calculatedAmount.increaseByAmount),this.giftIncreaseFormGroup.get("percentAmountInput")?.setValue(i)}calculatePledgePercentAmount(e){let i=+e/100;this.calculatedAmount.increaseByAmount=+(this.calculatedAmount.pledge.currentAmount*i).toFixed(2),this.calculatedAmount.pledge.newAmount=+(this.calculatedAmount.pledge.currentAmount+this.calculatedAmount.increaseByAmount).toFixed(2),this.calculateNewTotalPledgeAmount(this.calculatedAmount.pledge.newAmount,this.selectedContribution),this.IsAmountConfirmationRequired(this.calculatedAmount.increaseByAmount),this.giftIncreaseFormGroup.get("dollarAmountInput")?.setValue(this.calculatedAmount.increaseByAmount.toFixed(2))}calculateNewTotalPledgeAmount(e,n){let i=n.giftFrequency,s=new Date(n?.pledgeEndDate),_=new Date(n?.pledgeStartDate);i&&e&&_&&s?this.myPledgeSvc.getInstallmentPlanByInstallmentAmount(i,e,_,s).subscribe({next:C=>{let D=n?.pledgeGivenAmount??0;
1this.calculatedAmount.pledge.installmentCount=C.installmentCount,this.calculatedAmount.pledge.installmentAmount=C.installmentAmount,this.calculatedAmount.pledge.newPledgeAmount=C.totalAmount+D,C.lastInstallmentAmount!==C.installmentAmount?this.calculatedAmount.pledge.lastInstallmentAmount=C.lastInstallmentAmount:this.calculatedAmount.pledge.lastInstallmentAmount=0},error:()=>{this.canSubmit=!1}}):this.canSubmit=!1}getPercentIncreasedBy(e,n){let i=(n-e)/e*100;return i<1?(this.percentInputType="Decimal",+i.toFixed(2)):(this.percentInputType="Whole",Math.round(i))}IsAmountConfirmationRequired(e){e>=this.dollarIncreaseLimit?(this.isToConfirmAmount=!0,this.giftIncreaseFormGroup.get("dollarConfirmAmountInput").setValidators([x.required,Vn.validateEqual("dollarAmountInput")]),this.giftIncreaseFormGroup.get("dollarConfirmAmountInput").updateValueAndValidity()):(this.isToConfirmAmount=!1,this.giftIncreaseFormGroup.get("dollarConfirmAmountInput")?.setValue(null),this.giftIncreaseFormGroup.get("dollarConfirmAmountInput").setValidators([]),this.giftIncreaseFormGroup.get("dollarConfirmAmountInput").updateValueAndValidity())}submitGift(){let e=!1,n=0,i=null;if(this.isPledge?(e=!0,n=this.calculatedAmount.pledge.newAmount,i=new Date(this.selectedContribution?.pledgeEndDate)):n=this.calculatedAmount.gift.newAmount,n<=this.selectedContribution.amount){this.canSubmit=!1,this.notifySvc.toast({title:"LABEL.ERROR",message:"FINANCE.ERRORS.GIFT_INCREASE_INCORRECT_AMOUNT_FAILURE",severity:"error"});return}let s={id:this.selectedContribution.id,amount:n,feeOffsetAmount:this.selectedContribution?.feeOffsetAmount,paymentMethodId:this.selectedContribution.paymentMethod.id,scheduledDate:new Date(this.selectedContribution?.scheduledDate),pledgeEndDate:i,giftFrequency:this.selectedContribution.giftFrequency,note:this.selectedContribution.note,canUpdatePledgeTotalAmount:e,fundId:this.selectedContribution.fundId,attributedToAssociatedOrganizationId:this.selectedContribution?.organizationAssociatedToId},_={donorId:this.donorId,gift:s,isRequestDonorGiftIncrease:!0,tenantId:this.giftIncreaseSvc.tenantId,paymentMethod:this.selectedContribution.paymentMethod};this.giftSubmissionSvc.updateGift(_).subscribe({next:()=>{this.giftIncreaseSvc.setNextStep(xt.Confirmation),this.giftIncreaseSvc.setStatus(Wt.Success),this.giftIncreaseSvc.setTitle(""),this.notifySvc.toast({title:"LABEL.SUCCESS",message:"FINANCE.MESSAGES.GIFT_INCREASE_AMOUNT_SUCCESSFULLY"})},error:()=>{this.canSubmit=!1,this.isLoading=!1,this.giftIncreaseSvc.setStatus(Wt.Fail),this.notifySvc.toast({title:"LABEL.ERROR",message:"FINANCE.ERRORS.GIFT_INCREASE_AMOUNT_FAILURE",severity:"error"})}})}static{this.\u0275fac=function(n){return new(n||t)(S($e),S(Pt),S(ye),S(te))}}static{this.\u0275cmp=O({type:t,selectors:[["app-gift-increase-update-gift"]],decls:30,vars:24,consts:[["prepend",""],["errors",""],["id","gift_increase_update_gift"],[3,"ngSubmit","formGroup"],["id","edit_gift_amount",1,"grid","row-gap-0","tab:template-cols-auto-1-auto","align-items-center","mb-1.5"],["appNumericOnly","Decimal","formControlName","dollarAmountInput","inputId","dollar_amount_input","label","FINANCE.LABELS.DOLLAR_INCREASE","type","number",3,"inputChange","keydown","disabled"],["align","center",1,"color-secondary"],["formControlName","percentAmountInput","inputId","percent_amount_increase","label","FINANCE.LABELS.PERCENT_INCREASE","type","number",3,"inputChange","keydown","appNumericOnly","disabled"],[1,"mb-1.5"],[1,"infobox","mb-1"],["translate","FINANCE.ERRORS.GIFT_INCREASE_CALCULATION_FAILURE"],[1,"grid","gap-1","mt-1"],["buttonId","update_button","buttonClasses","w-full","type","submit",1,"w-full",3,"disabled","isLoading","label","loadingLabel"],["pButton","","id","previous_button","type","button",1,"p-button","p-button-outlined",3,"click","label"],["pButton","","type","button",1,"p-button","p-button-link","justify-self-center",3,"click","label"],[1,"block","mb-0.5"],[3,"isActive","isInteractive","upcomingContribution"],[1,"material-icons","no-select"],["translate","FINANCE.ERRORS.DOLLAR_AMOUNT_REQUIRED"],["translate","FINANCE.ERRORS.PERCENT_AMOUNT_REQUIRED"],["appNumericOnly","Decimal","formControlName","dollarConfirmAmountInput","inputId","dollar_confirm_amount_input","label","LABEL.GIFT_AMOUNT_CONFIRM","type","number",3,"disabled"],["translate","FINANCE.ERRORS.CONFIRM_GIFT_DOLLAR_AMOUNT"],[1,"mb-1"],[1,"mr-0.5",3,"icon","size","tight"],[1,"grid","tab:template-cols-1-auto"],[1,"grid","tab:template-cols-1-auto","border-bottom-solid","pb-0.5","mb-0.5"]],template:function(n,i){n&1&&(a(0,"section",2),h(1,"app-gift-increase-fund-header"),p(2,Kr,4,4),a(3,"form",3),y("ngSubmit",function(){return i.onSubmit()}),a(4,"section",4)(5,"app-input-group",5),y("inputChange",function(_){return i.onCalculateDollarAmountInput(_)})("keydown",function(_){return i.onInputKeyDown(_)}),M(6,Xr,2,0,"ng-template",null,0,w)(8,Zr,1,1,"ng-template",null,1,w),r(),a(10,"p-divider",6),u(11),c(12,"translate"),r(),a(13,"a
1pp-input-group",7),y("inputChange",function(_){return i.onCalculatePercentAmountInput(_)})("keydown",function(_){return i.onInputKeyDown(_)}),M(14,es,2,0,"ng-template",null,0,w)(16,is,1,1,"ng-template",null,1,w),r()(),p(18,rs,6,1,"section",8),a(19,"section",9),p(20,ps,2,1)(21,ms,1,0,"strong",10),r(),a(22,"section",11),h(23,"app-loading-button",12),c(24,"translate"),c(25,"translate"),a(26,"button",13),c(27,"translate"),y("click",function(){return i.onPrevious()}),r(),a(28,"button",14),c(29,"translate"),y("click",function(){return i.onCancel()}),r()()()()),n&2&&(o(2),m(i.selectedContribution?2:-1),o(),g("formGroup",i.giftIncreaseFormGroup),o(2),g("disabled",!i.canSubmit),o(6),v(f(12,14,"LABEL.OR")),o(2),g("appNumericOnly",i.percentInputType)("disabled",!i.canSubmit),o(5),m(i.isToConfirmAmount?18:-1),o(2),m(i.canSubmit?20:21),o(3),g("disabled",!i.canSubmit||i.giftIncreaseFormGroup.invalid)("isLoading",i.isLoading)("label",f(24,16,"LABEL.UPDATE_GIFT"))("loadingLabel",f(25,18,"LABEL.UPDATING")),o(3),g("label",f(27,20,"LABEL.PREVIOUS")),o(2),g("label",f(29,22,"LABEL.CANCEL")))},dependencies:[Ri,Li,ve,de,se,le,be,Ce,_e,_i,Si,Se,bi,Ii,vt,ge,An,Z,ue,G],styles:["[_nghost-%COMP%] app-input-group .input-wrapper{margin:0!important}"]})}}return t})();function us(t,l){t&1&&h(0,"app-gift-increase-confirmation")}function fs(t,l){t&1&&h(0,"app-gift-increase-update-gift")}function gs(t,l){t&1&&h(0,"app-gift-increase-summary")}function hs(t,l){if(t&1&&(h(0,"app-suspended-gifts-alert",0),a(1,"app-card",1),p(2,us,1,0,"app-gift-increase-confirmation")(3,fs,1,0,"app-gift-increase-update-gift")(4,gs,1,0,"app-gift-increase-summary"),r()),t&2){let e,n=l,i=d();g("buttonPosition",i.isMobile()?"bottom":"right")("suspendedReRegistrations",i.suspendedReRegistrations)("upcomingContributions",n.upcomingContributions),o(),g("header",n.title),o(),m((e=n.step)==="confirmation"?2:e==="update-gift"?3:4)}}var So=(()=>{class t{constructor(e,n){this.giftIncreaseSvc=e,this.publicRegistrationSvc=n,this.breakpointSvc=E(tt),this.destroyRef=E(J),this.giftIncreaseProcessInfo$=this.giftIncreaseSvc.giftIncreaseProcessInfo$,this.isMobile=this.breakpointSvc.underWideTablet,this.suspendedReRegistrations=[]}ngOnInit(){this.fund&&this.giftIncreaseSvc.setFundDetail(this.fund),this.donorId&&this.user&&(this.giftIncreaseSvc.setDonorId(this.donorId),this.giftIncreaseSvc.setUserDetail(this.user)),this.loadSuspendedReRegistrations()}loadSuspendedReRegistrations(){this.publicRegistrationSvc.getSuspendedReRegistrations().pipe(N(this.destroyRef)).subscribe({next:e=>{this.suspendedReRegistrations=e}})}static{this.\u0275fac=function(n){return new(n||t)(S($e),S(Gi))}}static{this.\u0275cmp=O({type:t,selectors:[["app-gift-increase"]],inputs:{donorId:"donorId",fund:"fund",user:"user"},features:[ai([$e])],decls:2,vars:3,consts:[[1,"mb-1",3,"buttonPosition","suspendedReRegistrations","upcomingContributions"],[1,"w-full","max-w-33","mx-auto",3,"header"]],template:function(n,i){if(n&1&&(p(0,hs,5,5),c(1,"async")),n&2){let s;m((s=f(1,1,i.giftIncreaseProcessInfo$))?0:-1,s)}},dependencies:[Di,$,_o,vo,Co,ke],encapsulation:2})}}return t})();var yo=(()=>{class t{constructor(e,n,i){this.activatedRoute=e,this.activePublicTenantSvc=n,this.profileSvc=i}ngOnInit(){let e=this.activatedRoute.snapshot;this.fund=e.data?.fund,this.user=this.profileSvc.getUserDetail(),this.activePublicTenantSvc.activeTenant.pipe(F(n=>{let i=n.number,s=this.user.memberships.find(_=>_.number===i&&_.isDonor);s&&(this.donorId=s.id)}),et(1)).subscribe()}static{this.\u0275fac=function(n){return new(n||t)(S(U),S(fe),S(Ne))}}static{this.\u0275cmp=O({type:t,selectors:[["app-gift-increase-view"]],decls:1,vars:3,consts:[[3,"donorId","fund","user"]],template:function(n,i){n&1&&h(0,"app-gift-increase",0),n&2&&g("donorId",i.donorId)("fund",i.fund)("user",i.user)},dependencies:[So],encapsulation:2})}}return t})();var _s=["existingContactCheck"],Cs=["passwordCaptchaRef"],vs=["otpRegistrationRef"],Wi=t=>({field:t});function Ss(t,l){t&1&&h(0,"span",29)}function ys(t,l){if(t&1&&p(0,Ss,1,0,"span",29),t&2){let e=l;
1m(e.errors&&!e.errors.required&&e.errors.pattern&&e.invalid&&e.touched?0:-1)}}function Is(t,l){if(t&1&&p(0,ys,1,1),t&2){let e,n=d(2);m((e=n.guestContactInfoForm.get("email"))?0:-1,e)}}function bs(t,l){if(t&1){let e=P();a(0,"app-email-input",28),y("inputBlur",function(){I(e);let i=d();return b(i.checkContact())}),M(1,Is,1,1,"ng-template",null,1,w),r()}}function Es(t,l){if(t&1){let e=P();a(0,"app-email-or-phone-input",30),y("controlBlur",function(){I(e);let i=d();return b(i.checkContact())}),r()}if(t&2){let e=d();g("errors",e.guestContactInfoForm.controls.emailOrPhone.errors)}}function Ps(t,l){t&1&&h(0,"app-phone-input",11)}function As(t,l){t&1&&(h(0,"span",31),c(1,"translate")),t&2&&g("translateParams",R(3,Wi,f(1,1,"DIRECTORY.LABELS.STREET_ADDRESS")))}function xs(t,l){if(t&1&&p(0,As,2,5,"span",31),t&2){let e=l;m(e.invalid&&e.touched?0:-1)}}function Ts(t,l){if(t&1&&p(0,xs,1,1),t&2){let e,n=d();m((e=n.guestContactInfoForm.get("address1"))?0:-1,e)}}function Os(t,l){t&1&&(h(0,"span",31),c(1,"translate")),t&2&&g("translateParams",R(3,Wi,f(1,1,"LABEL.CITY")))}function ws(t,l){if(t&1&&p(0,Os,2,5,"span",31),t&2){let e=l;m(e.invalid&&e.touched?0:-1)}}function Ns(t,l){if(t&1&&p(0,ws,1,1),t&2){let e,n=d();m((e=n.guestContactInfoForm.get("city"))?0:-1,e)}}function Ms(t,l){t&1&&(h(0,"span",32),c(1,"translate")),t&2&&g("translateParams",R(3,Wi,f(1,1,"LABEL.STATE")))}function Ds(t,l){if(t&1&&p(0,Ms,2,5,"span",32),t&2){let e=l;m(e.invalid&&e.touched?0:-1)}}function Gs(t,l){t&1&&h(0,"span",33)}function Fs(t,l){t&1&&h(0,"span",34)}function Rs(t,l){if(t&1&&(p(0,Gs,1,0,"span",33),p(1,Fs,1,0,"span",34)),t&2){let e=l;m(e.errors&&(e.errors.minlength||e.errors.maxlength)&&!e.errors.pattern&&e.touched?0:-1),o(),m(e.errors&&e.errors.pattern&&e.touched?1:-1)}}function Ls(t,l){if(t&1&&p(0,Rs,2,2),t&2){let e,n=d();m((e=n.guestContactInfoForm.get("zip"))?0:-1,e)}}function Vs(t,l){t&1&&h(0,"span",41)}function Bs(t,l){t&1&&h(0,"span",42)}function Us(t,l){if(t&1&&(p(0,Vs,1,0,"span",41),p(1,Bs,1,0,"span",42)),t&2){let e=l;m(e.errors!=null&&e.errors.minlength&&e.touched?0:-1),o(),m(e.errors&&!e.errors.minlength&&e.errors.pattern&&e.touched?1:-1)}}function ks(t,l){if(t&1&&p(0,Us,2,2),t&2){let e,n=d(3);m((e=n.guestContactInfoForm.get("password"))?0:-1,e)}}function zs(t,l){if(t&1){let e=P();a(0,"app-contact-otp-code-button",43),y("buttonClick",function(){I(e);let i=d(3);return b(i.sendContactOtp())}),r()}if(t&2){let e=d(3);g("isLoading",e.isSendingOtp())("disabled",!e.isFormValidExceptPassword)("contactType",e.getContactType())}}function qs(t,l){if(t&1&&(a(0,"div",36)(1,"div",37),u(2),c(3,"translate"),r(),a(4,"div",38),u(5),c(6,"translate"),r()(),a(7,"app-password-input",39),M(8,ks,1,1,"ng-template",null,1,w),r(),p(10,zs,1,3,"app-contact-otp-code-button",40)),t&2){let e=d(2);o(2),A(" ",f(3,4,e.myGifts().gifts[0].isFutureGift?"LABEL.CREATE_AN_ACCOUNT_FOR_FUTURE_GIFT":"LABEL.CREATE_AN_ACCOUNT_FOR_RECURRING_GIFT")," "),o(3),A(" ",f(6,6,"MESSAGE.CREATE_ACCOUNT_FOR_FUTURE_OR_RECURRING_GIFT")," "),o(2),g("minlength",7),o(3),m(e.displayOtpOption()?10:-1)}}function js(t,l){if(t&1){let e=P();a(0,"app-contact-otp-registration",44,2),y("verifyFinished",function(i){I(e);let s=d(2);return b(i?s.onCreateAccountSucceeded():s.onCreateAccountFailed())}),r()}if(t&2){let e=d(2);g("hideCreateAccountButton",!0)("username",e.guestContactInfoForm.value.emailOrPhone)}}function Ws(t,l){if(t&1&&(a(0,"div",22),p(1,qs,11,8)(2,js,2,2,"app-contact-otp-registration",35),r()),t&2){let e=d();o(),m(e.isValidatingOtp()?2:1)}}function Hs(t,l){if(t&1){let e=P();a(0,"app-form-submit-button",45),Be("isLoadingChange",function(i){I(e);let s=d();return Ve(s.isCreatingAccount,i)||(s.isCreatingAccount=i),b(i)}),r()}if(t&2){let e=d();g("form",e.guestContactInfoForm),Le("isLoading",e.isCreatingAccount),g("disabled",!e.guestContactInfoForm.valid||!e.isOtpRegistrationValid()||e.contactExists())}}function Ys(t,l){if(t&1&&h(0,"app-form-submit-button",26),t&2){let e=d();g("form",e.guestContactInfoForm)("disabled",!e.guestContactInfoForm.valid)}}function Qs(t,l){if(t&1){let e=P();a(0,"div",27)(1,"re-captcha",46,3),y("resolved",function(i){I(e);let s=d();return b(i&&s.onContinue())}),r()()}if(t&2){let e=d();o(),g("siteKey",e.reCaptchaSiteKey)}}var Vi=(()=>{class t{constructor(){this.accountCreationMode="create-now",this.canceled=new ne,this.continued=new ne,this.myGifts=B(null),this.showAccountCreation=an(()=>
1{if(this.accountCreationMode==="defer")return!1;let n=this.myGifts()?.gifts?.at(-1);return n?.frequency!=="oneTime"||n?.isFutureGift}),this.isCreatingAccount=B(!1),this.isSendingOtp=B(!1),this.isValidatingOtp=B(!1),this.displayOtpOption=B(!1),this.contactExists=B(!1),this.activePublicTenantSvc=E(fe),this.configSvc=E(we),this.destroyRef=E(J),this.myGiftsSvc=E(Pe),this.notificationSvc=E(te),this.publicLoginSvc=E(Me),this.publicSvc=E(Ye)}ngOnInit(){this.reCaptchaSiteKey=this.configSvc.get("reCaptchaSiteKey");let e=this.activePublicTenantSvc.getActiveTenant();this.displayOtpOption.set(e?.enableEmailOtpForLogin===!0),this.myGifts.set(this.myGiftsSvc.getGifts()),this.buildForm(),this.myGiftsSvc.myGifts.pipe(F(n=>{this.myGifts.set(L({},n)),this.updatePasswordValidators()}),N(this.destroyRef)).subscribe()}get isFormValidExceptPassword(){return Object.keys(this.guestContactInfoForm.controls).filter(e=>e!=="password").every(e=>this.guestContactInfoForm.controls[e].valid)&&!this.guestContactInfoForm.controls.password.value}checkContact(){let e=null;if(this.displayOtpOption())e=this.guestContactInfoForm.get("emailOrPhone").value,fi(e)?this.existingContactCheck.checkEmail(e):this.existingContactCheck.checkPhone(e);else{let n=this.guestContactInfoForm.get("email").value;this.existingContactCheck.checkEmail(n)}}isOtpRegistrationValid(){return this.isValidatingOtp()?this.otpRegistrationRef?.isValid()??!1:!0}onContinue(){if(!this.isValidatingOtp()){if(this.accountCreationMode==="defer"){this.guestContactInfoForm.markAllAsTouched(),this.guestContactInfoForm.valid&&(this.syncToContactData(),this.continued.emit());return}this.showAccountCreation()&&!this.contactExists()?(this.isCreatingAccount.set(!0),this.createAccountWithPassword()):(this.guestContactInfoForm.markAllAsTouched(),this.guestContactInfoForm.valid&&(this.syncToContactData(),this.continued.emit()))}}onsubmit(){if(this.accountCreationMode==="defer"){this.onContinue();return}if(this.isValidatingOtp()){this.isCreatingAccount.set(!0),this.otpRegistrationRef.confirmRegistration();return}this.passwordCaptchaRef?.execute()}sendContactOtp(){this.syncToContactData();let e=this.contactData.email??this.contactData.phone;if(!e)return;this.isSendingOtp.set(!0);let n={contact:e,firstName:this.contactData.firstName,lastName:this.contactData.lastName,address:{line1:this.contactData.address1,line2:this.contactData.address2,city:this.contactData.city,state:this.contactData.state,zip:this.contactData.zip}};this.publicSvc.sendContactRegistrationOtp(n).pipe(F(()=>{this.isValidatingOtp.set(!0),this.updatePasswordValidators()}),Q(i=>(this.notificationSvc.errorBanner({title:"LABEL.ERROR",message:i.message}),K(null))),xe(()=>{this.isSendingOtp.set(!1)})).subscribe()}createAccountWithPassword(){let e=this.buildCreateUserCommand();e.recaptcha=this.guestContactInfoForm.get("passwordCaptcha").value;let n=e.email??e.phone;this.createAccount(e,()=>$i(this.publicLoginSvc.login(n,e.password,null)))}onCreateAccountSucceeded(){this.isValidatingOtp.set(!1),this.isCreatingAccount.set(!1),this.syncToContactData(),this.passwordCaptchaRef?.execute(),this.continued.emit()}onCreateAccountFailed(){this.isCreatingAccount.set(!1)}buildForm(){let e=this.displayOtpOption()?[x.required]:[],n=this.displayOtpOption()?[]:[x.required,x.pattern(k.EMAIL)];this.guestContactInfoForm=new Dt({email:new he(this.contactData?.email,n),emailOrPhone:new he(null,e),password:new he(""),firstName:new he(this.contactData?.firstName,[x.required,x.maxLength(200)]),lastName:new he(this.contactData?.lastName,[x.required,x.maxLength(200)]),phone:new he(this.contactData?.phone),address1:new he(this.contactData?.address1,x.required),address2:new he(this.contactData?.address2),city:new he(this.contactData?.city,x.required),state:new he(this.contactData?.state,x.required),zip:new he(this.contactData?.zip,[x.required,x.minLength(5),x.maxLength(5),x.pattern("[0-9]+")]),passwordCaptcha:new he(null)}),this.updatePasswordValidators()}updatePasswordValidators(){let e=this.guestContactInfoForm.get("password");if(this.showAccountCreation()&&!this.isValidatingOtp()){let n=[x.required,x.minLength(7),x.pattern(k.PASSWORD_REQUIREMENT)];e.setValidators(n)}else e.clearValidators();e.updateValueAndValidity()}buildCreateUserCommand(){return this.syncToContactData(),{email:this.contactData.email,password:this.guestContactInfoForm.value.password,firstName:this.contactData.firstName,lastName:this.contactData.lastName,phone:this.contactData.phone,address:{line1:this.contactData.address1,line2:this.contactData.address2,city:this.contactData.city,state:this.contactData.state,zip:this.contactData.zip},enableMfa:!1,recaptcha:null}}createAccount(e,n){this.isCreatingAccount.set(!0),this.publicSvc.createUser(e).pipe(Xt(()=>n()),Q(i=>(ft(i)?(this.contactExists.set(!0),this.notificationSvc.toast({title:"MESSAGE.ACCOUNT_ALREADY_EXISTS",severity:"warn"})):this.notificationSvc.errorBanner({title:"LABEL.ERROR",message:i.message}),K(null))),xe(()=>{this.isCreatingAccount.set(!1),this.passwordCaptchaRef?.reset()})).subscribe()}syncToContactData(){let e=this.guestContactInfoForm.value;this.displayOtpOption()?fi(e.emailOrPhone)?(this.contactData.email=e.emailOrPhone,this.contactData.phone=null):(this.contactData.phone=e.emailOrPhone,this.contactData.email=null):(this.contactData.email=e.email,this.contactData.phone=e.phone),this.contactData.firstName=e.firstName,this.contactData.lastName=e.lastName,this.contactData.address1=e.address1,this.contactData.address2=e.address2,this.contactData.city=e.city,this.contactData.state=e.state,this.contactData.zip=e.zip,this.contactData.contactExists=this.contactExists()}
1getContactType(){if(this.displayOtpOption()){let e=this.guestContactInfoForm.get("emailOrPhone").value;return fi(String(e??""))?k.CONTACT_TYPE.EMAIL:k.CONTACT_TYPE.PHONE}return k.CONTACT_TYPE.EMAIL}onContactExists(e){this.contactExists.set(e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=O({type:t,selectors:[["app-guest-contact-info"]],viewQuery:function(n,i){if(n&1&&me(_s,5)(Cs,5)(vs,5),n&2){let s;W(s=H())&&(i.existingContactCheck=s.first),W(s=H())&&(i.passwordCaptchaRef=s.first),W(s=H())&&(i.otpRegistrationRef=s.first)}},inputs:{contactData:"contactData",accountCreationMode:"accountCreationMode"},outputs:{canceled:"canceled",continued:"continued"},decls:37,vars:26,consts:[["existingContactCheck",""],["errors",""],["otpRegistrationRef",""],["passwordCaptchaRef","reCaptcha"],[3,"ngSubmit","formGroup"],["id","contact_info",1,"flex","flex-row-wrap","justify-content-space-between"],["formControlName","email","autofocus","",1,"flex-full-width"],["inputId","email_or_phone","formControlName","emailOrPhone","label","LABEL.EMAIL_OR_PHONE","autocomplete","username",1,"flex-full-width",3,"errors"],[1,"w-full",3,"contactExists","contactType"],["inputId","first_name","formControlName","firstName","label","LABEL.FIRST_NAME","maxlength","200","autocomplete","given-name",1,"flex-half-width",3,"required"],["inputId","last_name","formControlName","lastName","label","LABEL.LAST_NAME","maxlength","200","autocomplete","family-name",1,"flex-half-width",3,"required"],["formControlName","phone","inputId","phone","label","LABEL.PHONE_OPTIONAL",1,"flex-full-width"],["id","payment_address_info",1,"flex","flex-row-wrap","justify-content-space-between","mb-0.5"],[1,"flex-full-width","subtitle","font-bold"],["inputId","address_line_1","formControlName","address1","label","LABEL.ADDRESS1","autocomplete","billing address-line1",1,"flex-half-width",3,"required"],["inputId","address_line_2","formControlName","address2","autocomplete","billing address-line2","label","LABEL.ADDRESS2",1,"flex-half-width"],["inputId","city","formControlName","city","label","LABEL.CITY","autocomplete","billing address-level2",1,"flex-one-third-width",3,"required"],[1,"flex-one-third-width"],["variant","in",1,"state-field"],["hubStateDropdown","","inputId","state","formControlName","state","autocomplete","billing address-level1",3,"includeEmptyOption"],["for","state"],["inputId","zip","formControlName","zip","label","LABEL.ZIP","autocomplete","billing postal-code",1,"zip-field","flex-one-third-width",3,"minLength","maxLength","required"],[1,"panel-small","mb-1"],[1,"app-card-footer","grid","two-column"],["id","cancel_button","pButton","","type","button",1,"p-button-outlined","p-button-plain","w-full",3,"click","label"],["buttonId","create_account_button","buttonClasses","w-full","label","LABEL.CREATE_ACCOUNT","loadingLabel","LABEL.CREATING_ACCOUNT",3,"form","isLoading","disabled"],["buttonId","continue_button","buttonClasses","w-full","label","LABEL.CONTINUE",3,"form","disabled"],[1,"flex","justify-content-center","recaptcha-badge","pt-1"],["formControlName","email","autofocus","",1,"flex-full-width",3,"inputBlur"],["translate","ERROR.EMAIL_INVALID"],["inputId","email_or_phone","formControlName","emailOrPhone","label","LABEL.EMAIL_OR_PHONE","autocomplete","username",1,"flex-full-width",3,"controlBlur","errors"],["translate","DIRECTORY.ERRORS.FIELD_IS_REQUIRED",3,"translateParams"],["translate","DIRECTORY.ERRORS.FIELD_IS_REQUIRED",1,"p-error",3,"translateParams"],["translate","ERROR.ZIPCODE_LENGTH"],["translate","ERROR.ZIPCODE_PATTERN"],[3,"hideCreateAccountButton","username"],[1,"flex-full-width","text-selection"],[1,"font-bold"],[1,"mb-1"],["formControlName","password","label","LABEL.CREATE_PASSWORD","inputId","password","autocomplete","new-password",1,"flex-full-width",3,"minlength"],[3,"isLoading","disabled","contactType"],["translate","ERROR.PASSWORD_MIN_LENGTH"],["translate","ERROR.PASSWORD_BAD_FORMAT"],[3,"buttonClick","isLoading","disabled","contactType"],[3,"verifyFinished","hideCreateAccountButton","username"],["buttonId","create_account_button","buttonClasse
1s","w-full","label","LABEL.CREATE_ACCOUNT","loadingLabel","LABEL.CREATING_ACCOUNT",3,"isLoadingChange","form","isLoading","disabled"],["formControlName","passwordCaptcha","id","passwordCaptcha","size","invisible","badge","inline",3,"resolved","siteKey"]],template:function(n,i){if(n&1&&(a(0,"form",4),y("ngSubmit",function(){return i.onsubmit()}),a(1,"div",5),p(2,bs,3,0,"app-email-input",6)(3,Es,1,1,"app-email-or-phone-input",7),a(4,"app-existing-contact-check-inline",8,0),y("contactExists",function(_){return i.onContactExists(_)}),r(),h(6,"app-text-input",9)(7,"app-text-input",10),p(8,Ps,1,0,"app-phone-input",11),r(),a(9,"div",12)(10,"div",13),u(11),c(12,"translate"),r(),a(13,"app-text-input",14),M(14,Ts,1,1,"ng-template",null,1,w),r(),h(16,"app-text-input",15),a(17,"app-text-input",16),M(18,Ns,1,1,"ng-template",null,1,w),r(),a(20,"div",17)(21,"p-floatlabel",18),h(22,"p-autoComplete",19),a(23,"label",20),u(24),c(25,"translate"),r(),p(26,Ds,1,1),r()(),a(27,"app-text-input",21),M(28,Ls,1,1,"ng-template",null,1,w),r()(),p(30,Ws,3,1,"div",22),a(31,"div",23)(32,"button",24),c(33,"translate"),y("click",function(){return i.canceled.emit()}),r(),p(34,Hs,1,3,"app-form-submit-button",25)(35,Ys,1,2,"app-form-submit-button",26),r(),p(36,Qs,3,1,"div",27),r()),n&2){let s;g("formGroup",i.guestContactInfoForm),o(2),m(i.displayOtpOption()?3:2),o(2),g("contactType",i.getContactType()),o(2),g("required",!0),o(),g("required",!0),o(),m(i.displayOtpOption()?-1:8),o(3),v(f(12,20,"LABEL.ADDRESS")),o(2),g("required",!0),o(4),g("required",!0),o(5),g("includeEmptyOption",!0),o(2),v(f(25,22,"LABEL.STATE")),o(2),m((s=i.guestContactInfoForm.get("state"))?26:-1,s),o(),g("minLength",5)("maxLength",5)("required",!0),o(3),m(i.showAccountCreation()&&!i.contactExists()?30:-1),o(2),g("label",j(f(33,24,"LABEL.CANCEL"))),o(2),m(i.showAccountCreation()?34:35),o(2),m(i.accountCreationMode==="create-now"?36:-1)}},dependencies:[Rt,ve,de,se,le,it,nt,Gt,be,Ce,_e,On,jn,Se,qn,ge,kn,zn,Ci,Yn,Nn,wn,Mn,at,rt,st,Z,Ee,We,De,He,Ge,G],encapsulation:2})}}return t})();var Ks=["captchaRef"],Xs=["otpRegistrationRef"],Yi=()=>({standalone:!0}),Js=t=>({contributionType:t}),Zs=t=>({contactType:t});function el(t,l){if(t&1){let e=P();a(0,"p-floatlabel",6)(1,"p-select",32),y("onChange",function(){I(e);let i=d();return b(i.onBankAccountTypeChanged())}),Be("ngModelChange",function(i){I(e);let s=d();return Ve(s.selectedBankAccountType,i)||(s.selectedBankAccountType=i),b(i)}),r(),a(2,"label",33),u(3),c(4,"translate"),r()()}if(t&2){let e=d();o(),g("options",e.bankAccountTypes),Le("ngModel",e.selectedBankAccountType),g("ngModelOptions",Ie(7,Yi))("required",e.selectedPaymentType===e.PaymentType.Bank),o(2),v(f(4,5,"LABEL.BANK_ACCOUNT_TYPE"))}}function tl(t,l){t&1&&h(0,"span",34)}function il(t,l){if(t&1&&p(0,tl,1,0,"span",34),t&2){let e=l;m(e.errors!=null&&e.errors.routingNumber&&e.touched?0:-1)}}function nl(t,l){if(t&1&&p(0,il,1,1),t&2){let e,n=d(2);m((e=n.form.get("routingNumber"))?0:-1,e)}}function ol(t,l){if(t&1&&(a(0,"app-text-input",9),M(1,nl,1,1,"ng-template",null,1,w),r()),t&2){let e=d();g("maxLength",9)("required",e.selectedPaymentType===e.PaymentType.Bank)}}function al(t,l){if(t&1){let e=P();a(0,"app-text-input",35),y("controlFocus",function(){I(e);let i=d();return b(i.prepopulateCardholderName())}),r()}if(t&2){let e=d();g("maxlength",250)("required",e.selectedPaymentType===e.PaymentType.CreditCard)}}function rl(t,l){t&1&&(a(0,"p",17),u(1),c(2,"translate"),r()),t&2&&(o(),A(" ",f(2,1,"FINANCE.MESSAGES.GOOGLE_PAY_SELECT_PAYMENT_METHOD")," "))}function sl(t,l){t&1&&(a(0,"p",17),u(1),c(2,"translate"),r()),t&2&&(o(),A(" ",f(2,1,"FINANCE.MESSAGES.APPLE_PAY_SELECT_PAYMENT_METHOD")," "))}function ll(t,l){t&1&&h(0,"p",22)}function dl(t,l){t&1&&h(0,"span",41)}function cl(t,l){if(t&1&&p(0,dl,1,0,"span",41),t&2){let e=l;m(e.errors&&e.errors.custom?0:-1)}}function pl(t,l){if(t&1){let e=P();a(0,"p-floatlabel",6)(1,"p-select",36),y("onChange",function(){I(e);let i=d();return b(i.expirationValidation())}),r(),a(2,"label",37),u(3),c(4,"translate"),r(),a(5,"div",38),p(6,cl,1,1),r()(),a(7,"p-floatlabel",6)(8,"p-select",39),y("onChange",function(){I(e);let i=d();return b(i.expirationValidation())}),r(),a(9,"label",40),u(10),c(11,"translate"),r()()}if(t&2){let e,n=d();o(),g("options",n.expirationMonths)("required",n.selectedPaymentType===n.PaymentType.Credit
1Card),o(2),v(f(4,7,"LABEL.EXPIRATION_MONTH")),o(3),m((e=n.form.get("expireMonth"))?6:-1,e),o(2),g("options",n.expirationYears)("required",n.selectedPaymentType===n.PaymentType.CreditCard),o(2),v(f(11,9,"LABEL.EXPIRATION_YEAR"))}}function ml(t,l){if(t&1){let e=P();a(0,"div",23)(1,"div",42)(2,"p-checkbox",43),y("onChange",function(){I(e);let i=d();return b(i.setFeeOffsetCreditCard())}),r(),a(3,"label",44),u(4),r()()()}if(t&2){let e=d();o(2),g("binary",!0),o(2),v(e.ccOffsetLabel)}}function ul(t,l){if(t&1){let e=P();a(0,"div",24)(1,"div",42)(2,"p-checkbox",45),y("onChange",function(){I(e);let i=d();return b(i.setFeeOffsetAch())}),r(),a(3,"label",46),u(4),r()()()}if(t&2){let e=d();o(2),g("binary",!0),o(2),v(e.achOffsetLabel)}}function fl(t,l){t&1&&h(0,"span",56)}function gl(t,l){t&1&&h(0,"span",57)}function hl(t,l){if(t&1&&(p(0,fl,1,0,"span",56),p(1,gl,1,0,"span",57)),t&2){let e=l;m(e.errors!=null&&e.errors.minlength&&e.touched?0:-1),o(),m(e.errors&&!e.errors.minlength&&e.errors.pattern&&e.touched?1:-1)}}function _l(t,l){if(t&1&&p(0,hl,2,2),t&2){let e,n=d(4);m((e=n.form.get("password"))?0:-1,e)}}function Cl(t,l){if(t&1){let e=P();a(0,"app-contact-otp-code-button",58),y("buttonClick",function(){I(e);let i=d(4);return b(i.sendContactOtp())}),u(1),c(2,"translate"),c(3,"translate"),r()}if(t&2){let e=d(4);g("isLoading",e.isSendingOtp())("contactType",e.getContactType())("disabled",e.form.value.password),o(),A(" ",T(3,6,"MESSAGE.WE_CAN_SEND_A_CODE",R(9,Zs,f(2,4,e.getContactTypeTranslationKey())))," ")}}function vl(t,l){if(t&1&&(a(0,"div",51)(1,"div",52),u(2),c(3,"translate"),r(),a(4,"div",53),u(5),c(6,"translate"),c(7,"translate"),r()(),a(8,"app-password-input",54),M(9,_l,1,1,"ng-template",null,1,w),r(),p(11,Cl,4,11,"app-contact-otp-code-button",55)),t&2){let e=d(3);o(2),A(" ",f(3,4,"LABEL.CREATE_AN_ACCOUNT_FOR_FUTURE_GIFT")," "),o(3),A(" ",T(7,8,"MESSAGE.NEXT_TIME_SIGN_IN",R(11,Js,f(6,6,"WORD.GIFTS")))," "),o(3),g("minlength",7),o(3),m(e.displayOtpOption()?11:-1)}}function Sl(t,l){if(t&1){let e=P();a(0,"app-contact-otp-registration",59,2),y("verifyFinished",function(i){I(e);let s=d(3);return b(i?s.onOtpRegistrationSucceeded():s.onOtpRegistrationFailed())}),r()}if(t&2){let e=d(3);g("hideCreateAccountButton",!0)("username",e.giftSubmission.email??e.giftSubmission.phone)}}function yl(t,l){if(t&1&&(a(0,"div",49),p(1,vl,12,13)(2,Sl,2,2,"app-contact-otp-registration",50),r()),t&2){let e=d(2);o(),m(e.isValidatingOtp()?2:1)}}function Il(t,l){if(t&1){let e=P();a(0,"div",25)(1,"div",42)(2,"p-checkbox",47),Be("ngModelChange",function(i){I(e);let s=d();return Ve(s.saveContributionMethod,i)||(s.saveContributionMethod=i),b(i)}),y("onChange",function(){I(e);let i=d();return b(i.onSaveContributionMethodChanged())}),r(),a(3,"label",48),u(4),c(5,"translate"),r()(),p(6,yl,3,1,"div",49),r()}if(t&2){let e=d();o(2),Le("ngModel",e.saveContributionMethod),g("ngModelOptions",Ie(7,Yi))("binary",!0),o(2),v(f(5,5,"LABEL.SAVE_THIS_CONTRIBUTION_METHOD")),o(2),m(e.saveContributionMethod?6:-1)}}function bl(t,l){if(t&1&&(a(0,"div",27)(1,"i",60),u(2,"error"),r(),a(3,"span"),u(4),c(5,"translate"),r()()),t&2){let e=d();o(4),q("",f(5,2,e.errorTitle?e.errorTitle:"ERROR.PROCESSING_GIFT"),": ",e.errorMsg)}}var Io=(()=>{class t{constructor(){this.PaymentType=V,this.acceptsBankAndCc=!0,this.acctNumValid=!1,this.googleGuestGiftsOnly=!1,this.appleGuestGiftsOnly=!1,this.bankAccountTypes=[],this.cardNumValid=!1,this.googlePayValid=!1,this.googlePayInitialized=!1,this.applePayValid=!1,this.applePayInitialized=!1,this.applePayUnavailable=!1,this.expirationMonths=k.MONTHS,this.expirationYears=[],this.selectedBankAccountType="DDA",this.selectedPaymentType=V.Bank,this.validExpirationDate=!0,this.isSendingOtp=B(!1),this.isValidatingOtp=B(!1),this.displayOtpOption=B(!1),this.saveContributionMethod=!1,this.accountCreatedViaOtp=!1,this._showPaymentProcessing=!1,this.showPaymentProcessingChanged=new ne,this.backClicked=new ne,this.destroyRef=E(J),this.feeOffsetSvc=E(Oi),this.giftSubmissionSvc=E(Pt),this.linkSvc=E(ie),this.myGiftsSvc=E(Pe),this.notifySvc=E(te),this.psIframeSvc=E(di),this.nuveiApplePaySvc=E(un),this.publicSvc=E(Ye),this.publicLoginSvc=E(Me),this.route=E(U),this.router=E(ee),this.translate=E(oe),this.paymentMethodUtilitySvc=E(wt),this.telemetrySvc=E(li),this.pwaGiftSubmitTelemetry=E(Nt),this.themeColorsSvc=E(Mt),this.activePublicTenantSvc=E(fe),this.configSvc=E(we),this.fb=E(mi),this.userPaymentMethodSvc=E(Ft),this.translateSelectItems=E(fn)}get showPaymentProcessing(){return this._showPaymentProcessing}set showPaymentProcessing(e){this._showPaymentProcessing=e,this.showPaymentProcessingChanged.emit(e)}get applePayButtonMinHeight(){return this.applePayUnavailable?"0":"50px"}ngOnInit(){this.bankAccountTypes=this.translateSelectItems.getFinanceBankAccountTypes();let e=this.activePublicTenantSvc.getActiveTenant();this.displayOtpOption.set(e?.enableEmailOtpForLogin===!0),this.myGiftsSvc.clearGuestGiftSubmission(),this.fund=ce.getParentSnapshotData("fund",this.route.
1snapshot),this.organization=ce.getParentSnapshotData("organization",this.route.snapshot),this.myGifts=this.myGiftsSvc.getGifts(),this.reCaptchaSiteKey=this.configSvc.get("reCaptchaSiteKey");let n=new Date().getFullYear();for(let s=0;s<10;s++)this.expirationYears.push({label:n,value:n}),n++;this.paymentTypes=this.displayAcceptedPaymentTypes(this.fund.acceptsAch,this.fund.acceptsCreditCard),this.acceptsBankAndCc=this.paymentTypes.length<2,this.buildForm(),this.updateFormValidators(),this.psIframeSvc.achValidateResult.pipe(N(this.destroyRef)).subscribe(s=>this.onValidateAchResult(s)),this.psIframeSvc.ccValidateResult.pipe(N(this.destroyRef)).subscribe(s=>this.onValidateCardNumberResult(s)),this.psIframeSvc.saleResult.pipe(N(this.destroyRef)).subscribe(s=>this.onSaleResult(s)),this.psIframeSvc.googlePayIframeInitialized.pipe(N(this.destroyRef)).subscribe(()=>this.onGooglePayIframeInitialized()),this.psIframeSvc.googlePayReady.pipe(N(this.destroyRef)).subscribe(s=>this.onGooglePayReady(s)),this.psIframeSvc.googlePayMetadata.pipe(N(this.destroyRef)).subscribe(s=>this.onGooglePayMetadata(s)),this.psIframeSvc.googlePayError.pipe(N(this.destroyRef)).subscribe(s=>this.onGooglePayError(s)),this.psIframeSvc.googlePayCanceled.pipe(N(this.destroyRef)).subscribe(s=>this.onGooglePayCanceled(s)),this.psIframeSvc.applePayIframeInitialized.pipe(N(this.destroyRef)).subscribe(()=>this.onApplePayIframeInitialized()),this.psIframeSvc.applePayReady.pipe(N(this.destroyRef)).subscribe(s=>this.onApplePayReady(s)),this.psIframeSvc.applePayMetadata.pipe(N(this.destroyRef)).subscribe(s=>this.onApplePayMetadata(s)),this.psIframeSvc.applePayError.pipe(N(this.destroyRef)).subscribe(s=>this.onApplePayError(s)),this.psIframeSvc.applePayCanceled.pipe(N(this.destroyRef)).subscribe(()=>this.onApplePayCanceled()),queueMicrotask(()=>this.initializePaymentServiceIframe()),this.syncShowOffsetOption();let i=this.giftSubmission.gifts[0];this.myGiftsSvc.myGifts.pipe(F(s=>{this.myGifts=s;let _=this.giftSubmission.gifts[0];i&&_&&(i.amount!==_.amount||i.frequency!==_.frequency||i.scheduledDate?.toString()!==_.scheduledDate?.toString())&&(i=_,this.showAchOffsetOption?this.feeOffsetSvc.calculateOffset(this.fund.givingAchOffset,this.fund.givingAchOffsetAmount,_):this.showCcOffsetOption&&this.feeOffsetSvc.calculateOffset(this.fund.givingCreditCardOffset,this.fund.givingCreditCardOffsetAmount,_),queueMicrotask(()=>this.reinitializePaymentServices()))}),N(this.destroyRef)).subscribe()}ngOnDestroy(){this.psIframeSvc.terminateIframe()}initializePaymentServiceIframe(){this.googleGuestGiftsOnly=this.selectedPaymentType===V.GooglePay,this.appleGuestGiftsOnly=this.selectedPaymentType===V.ApplePay,this.psIframeSvc.initializeIframe(this.fund.merchantId,this.selectedPaymentType,this.themeColorsSvc.primary500,this.fund?.acceptsAmex??!1,!0)}onGooglePayIframeInitialized(){!this.googlePayInitialized&&this.selectedPaymentType===V.GooglePay&&this.myGifts?.gifts?.[0]?.amount&&(this.psIframeSvc.initializeGooglePay({amount:Number(this.myGifts.gifts[0].amount)}),this.googlePayInitialized=!0)}onGooglePayReady(e){e.ready?this.googlePayValid=!1:this.handleError("ERROR.PROCESSING_GIFT",e.error||this.translate.instant("ERROR.GOOGLE_PAY_NOT_AVAILABLE"))}onGooglePayMetadata(e){e?.paymentMethod?(this.googlePayValid=!0,this.giftSubmission.lastFour=e.cardLastFour,this.giftSubmission.paymentType=e.cardNetwork??"",this.giftSubmission.googlePayMetadata=e):(this.googlePayValid=!1,console.warn("Invalid Google Pay metadata received"))}onGooglePayError(e){this.handleError("ERROR.PROCESSING_GIFT",e.error||this.translate.instant("ERROR.GOOGLE_PAY_PAYMENT_FAILED"))}onGooglePayCanceled(e){this.googlePayValid=!1,this.showPaymentProcessing=!1}onApplePayIframeInitialized(){if(!this.applePayInitialized&&this.selectedPaymentType===V.ApplePay&&this.myGifts?.gifts?.[0]?.amount){let e=Number(this.myGifts.gifts[0].amount);this.psIframeSvc.initializeApplePay({amount:e}),this.applePayInitialized=!0}}onApplePayReady(e){e.ready?(this.applePayValid=!1,this.applePayUnavailable=!1,this.applePayMerchantSiteId=e.merchantSiteId,this.applePayEnv=e.env,this.mountNuveiApplePayButton()):(console.warn("[GuestGiftApplePay] iframe reported Apple Pay not ready",e),this.applePayValid=!1,this.applePayUnavailable=!0)}onApplePayMetadata(e){e?.paymentMethod?(this.applePayValid=!0,this.giftSubmission.lastFour=e.cardLastFour,this.giftSubmission.paymentType=e.cardNetwork??"",this.giftSubmission.applePayMetadata=e):this.applePayValid=!1}onApplePayError(e){this.handleError("ERROR.PROCESSING_GIFT",e.error||this.translate.instant("ERROR.APP
1LE_PAY_PAYMENT_FAILED"))}onApplePayCanceled(){this.applePayValid=!1,this.showPaymentProcessing=!1}mountNuveiApplePayButton(){return Kt(this,null,function*(){let e=Number(this.myGifts?.gifts?.[0]?.amount);if(!e&&e!==0)return;if(this.applePayUnavailable=!1,!this.applePayMerchantSiteId||!this.applePayEnv){console.warn("[GuestGiftApplePay] missing merchant configuration from iframe applePayReady",{merchantSiteId:this.applePayMerchantSiteId,env:this.applePayEnv}),this.applePayValid=!1,this.applePayUnavailable=!0;return}let n=this.activePublicTenantSvc.getActiveTenant()?.name??"Organization";try{yield this.nuveiApplePaySvc.mountButton("hub_apple_pay_button",{merchantSiteId:this.applePayMerchantSiteId,env:this.applePayEnv,amount:e,merchantName:n,transactionIntent:"immediate",onMobileToken:(i,s)=>{try{this.applyHubApplePayToken(i),this.psIframeSvc.acceptApplePayToken(i,i.paymentMethod),s(!0)}catch(_){this.applePayValid=!1,s(!1),this.handleError("ERROR.PROCESSING_GIFT",_?.message||this.translate.instant("ERROR.APPLE_PAY_TOKEN_HANDOFF_FAILED"))}},onCancel:()=>{this.onApplePayCanceled()},onError:i=>{this.handleError("ERROR.PROCESSING_GIFT",i)},onUnavailable:i=>{console.warn("[GuestGiftApplePay] Apple Pay unavailable",i),this.applePayValid=!1,this.applePayUnavailable=!0}})}catch(i){console.error("[GuestGiftApplePay] Apple Pay button failed to mount",i),this.applePayValid=!1,this.applePayUnavailable=!0}})}applyHubApplePayToken(e){let n=this.nuveiApplePaySvc.extractApplePayMetadata(e);this.applePayValid=!0,this.giftSubmission.lastFour=n.cardLastFour,this.giftSubmission.paymentType=n.cardNetwork,this.giftSubmission.applePayMetadata=pe(L({},n),{paymentMethod:"ApplePay"})}onSaleResult(e){if(this.pwaGiftSubmitTelemetry.logStep("guest.sale_result",{approvalIndicator:e.approvalIndicator??"",saleApproved:String(e.approvalIndicator==="A"||e.approvalIndicator==="P")}),e.approvalIndicator==="A"||e.approvalIndicator==="P"){if(this.giftSubmission.createCredentialedUser)this.createCredentialedUser(e),this.myGiftsSvc.clearGifts();else if(this.saveContributionMethod&&this.accountCreatedViaOtp){this.savePaymentMethodToWallet(e.paymentServicesId);return}else this.myGiftsSvc.clearGifts(),this.myGiftsSvc.setGuestGiftSubmission(this.giftSubmission),this.router.navigate(this.linkSvc.giftConfirmation(this.giftId));this.showPaymentProcessing=!1}else this.handleError("ERROR.PROCESSING_GIFT",this.getDonorSaleErrorMessage(e))}onValidateAchResult(e){e.valid?(this.acctNumValid=!0,this.giftSubmission.lastFour=e.lastFour):this.acctNumValid=!1}onValidateCardNumberResult(e){e.valid?(this.cardNumValid=!0,this.giftSubmission.lastFour=e.lastFour,this.giftSubmission.bin=e.bin,this.giftSubmission.paymentType=e.cardType):this.cardNumValid=!1}expirationValidation(){let e=!0,n=this.form.get("expireMonth"),i=this.form.get("expireYear");n.updateValueAndValidity(),i.updateValueAndValidity(),n.value&&i.value&&(e=this.paymentMethodUtilitySvc.expirationValidation(n.value,i.value)),e?this.validExpirationDate=!0:(n.setErrors(pe(L({},n.errors),{custom:!0})),i.setErrors(pe(L({},i.errors),{custom:!0})),this.validExpirationDate=!1)}validateCustomFormElements(){return this.syncToGiftSubmission(),this.selectedPaymentType===V.GooglePay?this.googlePayValid:this.selectedPaymentType===V.ApplePay?this.applePayValid:(this.psIframeSvc.validateIframe(),this.selectedPaymentType===V.CreditCard&&this.expirationValidation(),this.validateSaleRequest()?this.paymentMethodIsValid():!1)}paymentMethodIsValid(){return this.selectedPaymentType===V.CreditCard&&this.cardNumValid&&this.validExpirationDate||this.selectedPaymentType===V.Bank&&this.acctNumValid||this.selectedPaymentType===V.GooglePay&&this.googlePayValid||this.selectedPaymentType===V.ApplePay&&this.applePayValid}onCaptchaResolved(e){e&&this.createGiftSubmission()}executeCaptcha(){this.pwaGiftSubmitTelemetry.logStep("guest.captcha_execute",{tenant:this.organization?.tenantId??""}),this.captchaRef?this.captchaRef.execute():this.pwaGiftSubmitTelemetry.logStep("guest.captcha_missing_ref")}createGiftSubmission(){this.isValidatingOtp()||(this.pwaGiftSubmitTelemetry.startCorrelation("guest"),this.syncToGiftSubmission(),this.prepareGiftForSubmission(),this.pwaGiftSubmitTelemetry.logStep("guest.createGiftSubmission_enter",{formValid:String(this.form.valid),paymentMethodValid:String(this.paymentMethodIsValid()),paymentType:String(this.selectedPaymentType??"")}),this.showPaymentProcessing=!0,this.form.valid&&this.paymentMethodIsValid()?(this.pwaGiftSubmitTelemetry.logStep("guest.submitGuestGift_start"),this.submitGuestGift().pipe(Q(e=>this.handleGiftSubmissionError(e))).subscribe()):(this.pwaGiftSubmitTelemetry.logStep("guest.createGiftSubmission_validation_failed"),this.showPaymentProcessing=!1,this.captchaRef?.reset()))}onSubmit(){if(this.isValidatingOtp()){this.pwaGiftSubmitTelemetry.logStep("guest.branch_otp"),this.showPaymentProcessing=!0,this.otpRegistrationRef.confirmRegistration();return}this.executeCaptcha()}onOtpRegistrationSucceeded(){this.accountCreatedViaOtp=!0,this.giftSubmission.createCredentialedUser=!1,this.isValidatingOtp.set(!1),this.updatePasswordValidators(),this.executeCaptcha()}onOtpRegistrationFailed(){this.showPaymentProcessing=!1}submitGuestGift(){return this.giftSubmissionSvc.postGuestGiftSubmission(this.organization.tenantId,this.giftSubmission).pipe(F(e=>{let n=e[0];
1if(this.convertUserToken=n.convertUserToken,this.giftId=n.giftId,this.transactionId=n.transactionID,this.pwaGiftSubmitTelemetry.logStep("guest.submitGuestGift_http_next",{hasTransactionId:String(!!this.transactionId),giftId:this.giftId??""}),!this.transactionId){this.handleError("ERROR.PROCESSING_GIFT",this.translate.instant("ERROR.UNABLE_TO_INITIALIZE_PAYMENT"));return}this.submitSaleRequest(n)}))}canSubmitForm(){return this.organization.products.find(e=>e.name===ut.OnlineGiving).status==="Live"}getTooltipMessage(){if(!this.canSubmitForm())return this.translate.instant("FINANCE.MESSAGES.GIFTS_DISABLED_ONBOARDING")}prepopulateCardholderName(){let e=this.form.get("cardholderName");!e.value&&this.giftSubmission.firstName&&this.giftSubmission.lastName&&e.setValue(`${this.giftSubmission.firstName} ${this.giftSubmission.lastName}`)}setFeeOffsetCreditCard(){this.form.get("creditCardOffsetEnabled").value?this.feeOffsetSvc.calculateOffset(this.fund.givingCreditCardOffset,this.fund.givingCreditCardOffsetAmount,this.giftSubmission.gifts[0],!0):this.feeOffsetSvc.zeroOffset(this.giftSubmission.gifts[0],!0)}setFeeOffsetAch(){this.form.get("achOffsetEnabled").value?this.feeOffsetSvc.calculateOffset(this.fund.givingAchOffset,this.fund.givingAchOffsetAmount,this.giftSubmission.gifts[0],!0):this.feeOffsetSvc.zeroOffset(this.giftSubmission.gifts[0],!0)}resetPaymentInfo(e){e!=null&&(this.selectedPaymentType=e),this.acctNumValid=!1,this.cardNumValid=!1,this.googlePayValid=!1,this.googlePayInitialized=!1,this.applePayValid=!1,this.applePayInitialized=!1,this.applePayUnavailable=!1,this.nuveiApplePaySvc.clearButton("hub_apple_pay_button"),this.form.patchValue({routingNumber:null,cardholderName:null,expireMonth:null,expireYear:null}),this.giftSubmission.googlePayMetadata=void 0,this.giftSubmission.applePayMetadata=void 0,this.googleGuestGiftsOnly=this.selectedPaymentType===V.GooglePay,this.appleGuestGiftsOnly=this.selectedPaymentType===V.ApplePay,this.psIframeSvc.resetIframe(this.selectedPaymentType,this.fund?.acceptsAmex??!1),this.syncShowOffsetOption(),this.updateFormValidators()}onBankAccountTypeChanged(){this.acctNumValid=!1,this.googlePayValid=!1,this.googlePayInitialized=!1,this.applePayValid=!1,this.applePayInitialized=!1,this.applePayUnavailable=!1,this.psIframeSvc.resetIframe(this.selectedPaymentType,this.fund?.acceptsAmex??!1),this.syncShowOffsetOption(),this.updateFormValidators()}reinitializePaymentServices(){this.googlePayInitialized=!1,this.applePayInitialized=!1,this.applePayUnavailable=!1,this.psIframeSvc.resetIframe(this.selectedPaymentType,this.fund?.acceptsAmex??!1)}syncShowOffsetOption(){let e=this.selectedPaymentType===V.CreditCard,n=this.selectedPaymentType===V.Bank;this.showCcOffsetOption=this.feeOffsetSvc.syncShowCcOffsetOptionForDonor(e,this.fund),this.showAchOffsetOption=this.feeOffsetSvc.syncShowAchOffsetOptionForDonor(n,this.fund),this.giftSubmission.gifts[0].creditCardOffsetEnabled=!1,this.giftSubmission.gifts[0].achOffsetEnabled=!1,this.form?.patchValue({creditCardOffsetEnabled:!1,achOffsetEnabled:!1}),this.showAchOffsetOption?(this.initAchOffsetOption(),this.setFeeOffsetAch()):this.showCcOffsetOption&&(this.initCcOffsetOption(),this.setFeeOffsetCreditCard())}get showSaveContributionMethod(){let e=this.myGifts?.gifts?.[0];return e?.frequency==="oneTime"&&!e?.isFutureGift}onSaveContributionMethodChanged(){this.giftSubmission.createCredentialedUser=this.saveContributionMethod,this.updatePasswordValidators()}updatePasswordValidators(){let e=this.form.get("password");this.saveContributionMethod&&!this.isValidatingOtp()&&!this.accountCreatedViaOtp?e.
1setValidators([x.required,x.minLength(7),x.pattern(k.PASSWORD_REQUIREMENT)]):e.clearValidators(),e.updateValueAndValidity()}sendContactOtp(){let e=this.buildCreateUserCommand(),n=e.email??e.phone;if(!n)return;this.isSendingOtp.set(!0);let i={contact:n,firstName:e.firstName,lastName:e.lastName,address:e.address};this.publicSvc.sendContactRegistrationOtp(i).pipe(F(()=>{this.isValidatingOtp.set(!0),this.updatePasswordValidators()}),Q(s=>(this.notifySvc.errorBanner({title:"LABEL.ERROR",message:this.getUnknownErrorMessage(s)}),K(null))),xe(()=>{this.isSendingOtp.set(!1)})).subscribe()}isOtpRegistrationValid(){return this.isValidatingOtp()?this.otpRegistrationRef?.isValid()??!1:!0}buildCreateUserCommand(){return{email:this.giftSubmission.email,password:null,firstName:this.giftSubmission.firstName,lastName:this.giftSubmission.lastName,phone:this.giftSubmission.phone,address:{line1:this.giftSubmission.address1,line2:this.giftSubmission.address2,city:this.giftSubmission.city,state:this.giftSubmission.state,zip:this.giftSubmission.zip},recaptcha:"",enableMfa:!1}}createCredentialedUser(e){let n=this.giftSubmission.email?.trim(),i=this.giftSubmission.phone?.trim(),s=pe(L(L({},n?{email:n}:{}),i?{phone:i}:{}),{password:this.giftSubmission.password,convertUserToken:this.convertUserToken,giftIds:[this.giftId]});this.selectedPaymentType===V.GooglePay?s.googlePayPaymentDetails={paymentServicesId:e.paymentServicesId,lastFour:this.giftSubmission.lastFour,cardNetworkRaw:this.giftSubmission.paymentType,isInNuveiVault:e?.isInNuveiVault??!1}:this.selectedPaymentType===V.ApplePay?s.applePayPaymentDetails={paymentServicesId:e.paymentServicesId,lastFour:this.giftSubmission.lastFour,cardNetworkRaw:this.giftSubmission.paymentType,isInNuveiVault:e?.isInNuveiVault??!1}:this.paymentMethodUtilitySvc.isAch(this.giftSubmission.paymentType)?s.achPaymentDetails={paymentServicesId:e.paymentServicesId,routingNumber:this.giftSubmission.routingNumber,lastFour:this.giftSubmission.lastFour,paymentType:this.giftSubmission.paymentType,isInNuveiVault:e?.isInNuveiVault??!1}:this.paymentMethodUtilitySvc.isCc(this.giftSubmission.paymentType)&&(s.cCPaymentDetails={paymentServicesId:e.paymentServicesId,bin:this.giftSubmission.bin,cardholderName:this.giftSubmission.cardholderName,lastFour:this.giftSubmission.lastFour,expirationMonth:this.giftSubmission.expirationMonth,expirationYear:this.giftSubmission.expirationYear,paymentType:this.giftSubmission.paymentType,isInNuveiVault:e?.isInNuveiVault??!1});let _=`/${this.organization.tenantId}/funds/confirmations/${this.giftId}`;this.publicSvc.convertUser(s).subscribe({next:()=>{let C=s.email??s.phone;this.publicLoginSvc.login(C,this.giftSubmission.password,_)},error:()=>{this.notifySvc.errorBanner({title:"ERROR.CREATING_ACCOUNT",message:"ERROR.CONVERTING_USER"}),this.router.navigateByUrl(_)}})}savePaymentMethodToWallet(e){let n=()=>{this.router.navigate(this.linkSvc.giftConfirmation(this.giftId)).finally(()=>{this.myGiftsSvc.clearGifts(),this.showPaymentProcessing=!1})};if(this.selectedPaymentType===V.GooglePay||this.selectedPaymentType===V.ApplePay){n();return}if(this.paymentMethodUtilitySvc.isCc(this.giftSubmission.paymentType)){let i={bin:this.giftSubmission.bin,cardHolderName:this.giftSubmission.cardholderName,cardNumberLastFour:this.giftSubmission.lastFour,cardType:this.giftSubmission.paymentType,expirationMonth:Number(this.giftSubmission.expirationMonth),expirationYear:Number(this.giftSubmission.expirationYear),paymentServicesId:e};this.userPaymentMethodSvc.addCreditCard(i).subscribe({next:()=>n(),error:()=>{this.notifySvc.errorBanner({title:"ERROR.ADDING_NEW_CREDIT_CARD",message:"ERROR.SAVING_PAYMENT_METHOD"}),n()}})}else if(this.paymentMethodUtilitySvc.isAch(this.giftSubmission.paymentType)){let i={lastFour:this.giftSubmission.lastFour,routingNumber:this.giftSubmission.routingNumber,paymentServicesId:e,accountType:this.giftSubmission.paymentType};this.userPaymentMethodSvc.addBankAccount(i).subscribe({next:()=>n(),error:()=>{this.notifySvc.errorBanner({title:"ERROR.ADDING_NEW_BANK_ACCOUNT",message:"ERROR.SAVING_PAYMENT_METHOD"}),n()}})}else n()}handleGiftSubmissionError(e){if(this.pwaGiftSubmitTelemetry.logError("guest.handleGiftSubmissionError",e),ft(e))this.accountCreatedViaOtp=!0,this.giftSubmission.createCredentialedUser=!1,this.showPaymentProcessing=!1,this.captchaRef?.reset(),this.notifySvc.toast({title:"MESSAGE.ACCOUNT_ALREADY_EXISTS",severity:"warn"});else{let n=this.getUnknownErrorMessage(e);this.handleError("ERROR.PROCESSING_GIFT",n)}return K(null)}getDonorSaleErrorMessage(e){return e.friendlyDescription||this.translate.instant("ERROR.PAYMENT_NOT_PROCESSED")}handleError(e,n){this.showPaymentProcessing=!1,this.errorTitle=e,this.errorMsg=n,this.captchaRef?.reset()}getUnknownErrorMessage(e){return e instanceof Error?e.message:typeof e=="string"?e:e==null?this.translate.instant("ERROR.UNKNOWN_ERROR"):JSON.stringify(e)}prepareGiftForSubmission(){if((this.selectedPaymentType===V.ApplePay||this.accountCreatedViaOtp||this.isValidatingOtp())&&(this.giftSubmission.createCredentialedUser=!1),this.selectedPaymentType===V.Bank&&(this.giftSubmission.paymentType=this.selectedBankAccountType==="SAV"?"Savings":"Checking"),this.form.get("creditCardOffsetEnabled").value||this.form.get("achOffsetEnabled").value)this.giftSubmission.gifts[0].amount=this.giftSubmission.gifts[0].totalAmount;else if(this.giftSubmission.gifts[0].feeOffsetAmount>0){let e={component:"GuestGiftInfoComponent",gift:JSON.stringify(this.giftSubmission.gifts[0]),formValue:JSON.stringify(this.form.value)};this.telemetrySvc.trackEvent("FeeOffsetEvent",e),this.giftSubmission.gifts[0].feeOffsetAmount=0}}validateSaleRequest(){if(this.selectedPaymentType===V.GooglePay)return this.googlePayValid;if(this.selectedPaymentType===V.ApplePay)return this.applePayValid;let e=this.selectedPaymentType===V.CreditCard?this.psIframeSvc.validateCreditCardSale(this.getCredit
1CardSaleRequest()):this.psIframeSvc.validateAchSale(this.getAchSaleRequest());return e?.valid?!0:(this.handleError("ERROR.PROCESSING_FORM_PAYMENT",e?.messages?.join(" ")??""),!1)}displayAcceptedPaymentTypes(e,n){let i=[],s=this.organization.merchantsInfo.some(_=>_.merchantId===this.fund.merchantId&&_.provider.toUpperCase()==="NUVEI");return e&&i.push({label:this.translate.instant("LABEL.BANK"),value:V.Bank}),n&&i.push({label:this.translate.instant("LABEL.CREDIT_CARD"),value:V.CreditCard}),s&&(i.push({label:this.translate.instant("LABEL.GOOGLE_PAY"),value:V.GooglePay}),i.push({label:this.translate.instant("LABEL.APPLE_PAY"),value:V.ApplePay})),!e&&n&&(this.selectedPaymentType=V.CreditCard),i}submitSaleRequest(e){this.pwaGiftSubmitTelemetry.logStep("guest.submitSaleRequest_start",{psInitialized:String(this.psIframeSvc.initialized),paymentType:String(this.selectedPaymentType??""),transactionId:e?.transactionID??""}),this.psIframeSvc.submitSaleRequest({transactionID:e.transactionID,callbackURL:e.callbackURL,merchantId:this.fund.merchantId,amount:Number(this.giftSubmission.gifts[0].amount),email:this.giftSubmission.email,firstName:this.giftSubmission.firstName,lastName:this.giftSubmission.lastName,address1:this.giftSubmission.address1??"",address2:this.giftSubmission.address2??"",city:this.giftSubmission.city??"",state:this.giftSubmission.state??"",zip:this.giftSubmission.zip??"",cardholderName:this.giftSubmission.cardholderName,expirationMonth:Number(this.giftSubmission.expirationMonth),expirationYear:Number(this.giftSubmission.expirationYear),routingNumber:this.giftSubmission.routingNumber,type:this.selectedBankAccountType,paymentType:this.giftSubmission.paymentType,saveToWallet:this.giftSubmission.createCredentialedUser||this.saveContributionMethod&&this.accountCreatedViaOtp,createCredentialedUser:this.giftSubmission.createCredentialedUser})}getCreditCardSaleRequest(e,n){return{merchantId:this.fund.merchantId,orderNumber:e,amount:Number(this.giftSubmission.gifts[0].amount),cardholderName:this.giftSubmission.cardholderName,email:this.giftSubmission.email,address1:this.giftSubmission.address1,address2:this.giftSubmission.address2,city:this.giftSubmission.city,state:this.giftSubmission.state,zip:this.giftSubmission.zip,country:"",expirationMonth:Number(this.giftSubmission.expirationMonth),expirationYear:Number(this.giftSubmission.expirationYear),webhook:n,saveToWallet:this.giftSubmission.createCredentialedUser||this.saveContributionMethod&&this.accountCreatedViaOtp,validateCvv:!0,firstName:this.giftSubmission.firstName,lastName:this.giftSubmission.lastName}}getAchSaleRequest(e,n){return{merchantId:this.fund.merchantId,orderNumber:e,amount:Number(this.giftSubmission.gifts[0].amount),firstName:this.giftSubmission.firstName,lastName:this.giftSubmission.lastName,email:this.giftSubmission.email,address1:this.giftSubmission.address1,address2:this.giftSubmission.address2,city:this.giftSubmission.city,state:this.giftSubmission.state,zip:this.giftSubmission.zip,country:"",type:this.selectedBankAccountType,routingNumber:this.giftSubmission.routingNumber,webhook:n,saveToWallet:this.giftSubmission.createCredentialedUser||this.saveContributionMethod&&this.accountCreatedViaOtp}}buildForm(){this.form=this.fb.group({routingNumber:[""],cardholderName:[""],expireMonth:[""],expireYear:[""],creditCardOffsetEnabled:[!1],achOffsetEnabled:[!1],password:[""],reCaptcha:[""],createUserOtpReCaptcha:[null]})}updateFormValidators(){let e=this.form.get("routingNumber"),n=this.form.get("cardholderName"),i=this.form.get("expireMonth"),s=this.form.get("expireYear");e.clearValidators(),n.clearValidators(),i.clearValidators(),s.clearValidators(),this.selectedPaymentType===V.Bank?e.setValidators(x.required):this.selectedPaymentType===V.CreditCard&&(n.setValidators([x.required,x.maxLength(250)]),i.setValidators(x.required),s.setValidators(x.required)),e.updateValueAndValidity(),n.updateValueAndValidity(),i.updateValueAndValidity(),s.updateValueAndValidity()}syncToGiftSubmission(){let e=this.form.value;if(this.selectedPaymentType===V.Bank){let n=e.routingNumber;this.giftSubmission.routingNumber=typeof n=="string"?n.replaceAll(/\s/g,""):n}else this.giftSubmission.routingNumber=null;this.giftSubmission.cardholderName=e.cardholderName,this.giftSubmission.expirationMonth=e.expireMonth,this.giftSubmission.expirationYear=e.expireYear,this.giftSubmission.reCaptcha=e.reCaptcha,this.saveContributionMethod&&(this.giftSubmission.password=e.password)}initCcOffsetOption(){let e=this.feeOffsetSvc.formatOffsetAmount(this.fund.givingCreditCardOffset,this.fund.givingCreditCardOffsetAmount);this.ccOffsetLabel=this.translate.instant("FINANCE.MESSAGES.FEE_OFFSET_DONOR_OPTION",{offsetAmount:e})}initAchOffsetOption(){let e=this.feeOffsetSvc.formatOffsetAmount(this.fund.givingAchOffset,this.fund.givingAchOffsetAmount);this.achOffsetLabel=this.translate.instant("FINANCE.MESSAGES.FEE_OFFSET_DONOR_OPTION",{offsetAmount:e})}getContactType(){return this.giftSubmission.email?k.CONTACT_TYPE.EMAIL:this.giftSubmission.phone?k.CONTACT_TYPE.PHONE:""}getContactTypeTranslationKey(){if(this.giftSubmission.email)return"WORD.EMAIL";if(this.giftSubmission.phone)return"WORD.PHONE"}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=O({type:t,selectors:[["app-guest-gift-payment-info"]],viewQuery:function(n,i){if
vendor: 4,383 bytes, line 1
1(n&1&&me(Ks,5)(Xs,5),n&2){let s;W(s=H())&&(i.captchaRef=s.first),W(s=H())&&(i.otpRegistrationRef=s.first)}},inputs:{giftSubmission:"giftSubmission"},outputs:{showPaymentProcessingChanged:"showPaymentProcessingChanged",backClicked:"backClicked"},decls:39,vars:37,consts:[["captchaRef","reCaptcha"],["errors",""],["otpRegistrationRef",""],["novalidate","",3,"ngSubmit","formGroup"],["id","payment_info",1,"flex","flex-row-wrap","justify-content-space-between"],[1,"flex","flex-full-width","flex-row-wrap","justify-content-space-between"],["variant","in",1,"flex-half-width"],["inputId","payment_type",3,"onChange","ngModelChange","options","ngModel","ngModelOptions","required","disabled"],["for","payment_type"],["inputId","routing_number","formControlName","routingNumber","label","LABEL.ROUTING_NUMBER","routingNumber","",1,"flex-half-width",3,"maxLength","required"],["id","account_number_container",1,"form-field-i-frame","flex-half-width",3,"hidden"],["id","account_number"],["inputId","cardholder_name","formControlName","cardholderName","label","LABEL.NAME_ON_CARD","autocomplete","cc-name",1,"flex-full-width",3,"maxlength","required"],["id","credit_card_number_container",1,"form-field-i-frame","flex-full-width",3,"hidden"],["id","card_number"],["id","google_pay_container",1,"flex-full-width",3,"hidden"],[1,"flex","flex-column"],[1,"font-size-sm","mb-2","color-secondary"],["id","google_pay_button",1,"form-field-i-frame"],["id","apple_pay_container",1,"flex-full-width",3,"hidden"],["id","apple_pay_button","aria-hidden","true",1,"form-field-i-frame","mb-2","hidden","h-0","min-h-0","position-absolute","overflow-hidden"],["id","hub_apple_pay_button",1,"form-field-i-frame","mb-2","overflow-hidden"],["translate","MESSAGE.APPLE_PAY_UNAVAILABLE",1,"text-center","my-0"],[1,"credict-card-offset-div"],[1,"ach-offset-div"],[1,"mt-0.5","mb-1.5"],[1,"app-card-footer","grid","two-column"],[1,"error-box","flex","align-items-center","m-0"],["id","back_button","pButton","","type","button",1,"p-button-outlined","p-button-plain","w-full",3,"click","label"],["buttonId","submit_your_gift_button","buttonClasses","w-full","label","LABEL.SUBMIT_YOUR_GIFT","loadingLabel","LABEL.SUBMITTING_GIFT","tooltipPosition","bottom",3,"isLoadingChange","form","externalValidateFn","isLoading","disabled","pTooltip"],[1,"flex","justify-content-center","recaptcha-badge","pt-1"],["formControlName","reCaptcha","id","reCaptcha","size","invisible","badge","inline",3,"resolved","siteKey"],["inputId","bank_account_type",3,"onChange","ngModelChange","options","ngModel","ngModelOptions","required"],["for","bank_account_type"],["translate","ERROR.INVALID_ROUTING_NUMBER"],["inputId","cardholder_name","formControlName","cardholderName","label","LABEL.NAME_ON_CARD","autocomplete","cc-name",1,"flex-full-width",3,"controlFocus","maxlength","required"],["formControlName","expireMonth","inputId","expiration_month",3,"onChange","options","required"],["for","expiration_month"],[1,"p-message","p-messages-error"],["formControlName","expireYear","inputId","expiration_year",3,"onChange","options","required"],["for","expiration_year"],["translate","ERROR.INVALID_EXPIRATION_DATE"],[1,"checkbox-wrapper"],["id","guest_gift_info_credit_card_offset","formControlName","creditCardOffsetEnabled","inputId","guest_gift_info_credit_card_offset_input",3,"onChange","binary"],["for","guest_gift_info_credit_card_offset_input"],["id","guest_gift_info_ach_offset","formControlName","achOffsetEnabled","inputId","guest_gift_info_ach_offset_input",3,"onChange","binary"],["for","guest_gift_info_ach_offset_input"],["id","save_contribution_method","inputId","save_contribution_method_input",3,"ngModelChange","onChange","ngModel","ngModelOptions","binary"],["for","save_contribution_method_input"],[1,"create-account-container","p-1","mt-0.5"],[3,"hideCreateAccountButton","username"],[1,"flex-full-width"],[1,"font-bold"],[1,"mb-1"],["formControlName","password","label","LABEL.CREATE_PASSWORD","inputId","save_contribution_password","autocomplete","new-password",1,"flex-full-width",3,"minlength"],[3,"isLoading","contactType","disabled"],["translate","ERROR.PASSWORD_MIN_LENGTH"],["translate","ERROR.PASSWORD_BAD_FORMAT"],[3,"buttonClick","isLoading","contactType","disabled"],[3,"verifyFinished","hideCreateAccountButton","username"],[1,"material-icons","error-icon","cursor-default"]],template:function(n,i){if
1(n&1){let s=P();a(0,"form",3),y("ngSubmit",function(){return i.onSubmit()}),a(1,"div",4)(2,"div",5)(3,"p-floatlabel",6)(4,"p-select",7),y("onChange",function(C){return i.resetPaymentInfo(C.value)}),Be("ngModelChange",function(C){return I(s),Ve(i.selectedPaymentType,C)||(i.selectedPaymentType=C),b(C)}),r(),a(5,"label",8),u(6),c(7,"translate"),r()(),p(8,el,5,8,"p-floatlabel",6),r(),a(9,"div",5),p(10,ol,3,2,"app-text-input",9),a(11,"div",10),h(12,"div",11),r(),p(13,al,1,2,"app-text-input",12),r(),a(14,"div",13),h(15,"div",14),r(),a(16,"div",15)(17,"div",16),p(18,rl,3,3,"p",17),h(19,"div",18),r()(),a(20,"div",19)(21,"div",16),p(22,sl,3,3,"p",17),h(23,"div",20)(24,"div",21),p(25,ll,1,0,"p",22),r()(),a(26,"div",5),p(27,pl,12,11),r(),p(28,ml,5,2,"div",23),p(29,ul,5,2,"div",24),r(),p(30,Il,7,8,"div",25),a(31,"div",26),p(32,bl,6,4,"div",27),a(33,"button",28),c(34,"translate"),y("click",function(){return i.backClicked.emit()}),r(),a(35,"app-form-submit-button",29),Be("isLoadingChange",function(C){return I(s),Ve(i.showPaymentProcessing,C)||(i.showPaymentProcessing=C),b(C)}),r()(),a(36,"div",30)(37,"re-captcha",31,0),y("resolved",function(C){return C&&i.createGiftSubmission()}),r()()()}n&2&&(g("formGroup",i.form),o(4),g("options",i.paymentTypes),Le("ngModel",i.selectedPaymentType),g("ngModelOptions",Ie(36,Yi))("required",!0)("disabled",i.acceptsBankAndCc),o(2),v(f(7,32,"LABEL.PAYMENT_TYPE")),o(2),m(i.selectedPaymentType===i.PaymentType.Bank?8:-1),o(2),m(i.selectedPaymentType===i.PaymentType.Bank?10:-1),o(),g("hidden",i.selectedPaymentType!==i.PaymentType.Bank),o(2),m(i.selectedPaymentType===i.PaymentType.CreditCard?13:-1),o(),g("hidden",i.selectedPaymentType!==i.PaymentType.CreditCard),o(2),g("hidden",i.selectedPaymentType!==i.PaymentType.GooglePay),o(2),m(i.selectedPaymentType===i.PaymentType.GooglePay&&!i.googlePayValid&&i.googlePayInitialized?18:-1),o(2),g("hidden",i.selectedPaymentType!==i.PaymentType.ApplePay),o(2),m(i.selectedPaymentType===i.PaymentType.ApplePay&&i.applePayInitialized&&!i.applePayUnavailable&&!i.applePayValid?22:-1),o(2),on("min-height",i.applePayButtonMinHeight),o(),m(i.applePayUnavailable?25:-1),o(2),m(i.selectedPaymentType===i.PaymentType.CreditCard?27:-1),o(),m(i.showCcOffsetOption?28:-1),o(),m(i.showAchOffsetOption?29:-1),o(),m(i.showSaveContributionMethod&&!i.giftSubmission.contactExists?30:-1),o(2),m(i.errorMsg?32:-1),o(),g("label",j(f(34,34,"LABEL.BACK"))),o(2),g("form",i.form)("externalValidateFn",i.validateCustomFormElements.bind(i)),Le("isLoading",i.showPaymentProcessing),g("disabled",!i.canSubmitForm()||!i.form.valid||!i.isOtpRegistrationValid()||i.isSendingOtp()||!i.paymentMethodIsValid())("pTooltip",i.getTooltipMessage()),o(2),g("siteKey",i.reCaptchaSiteKey))},dependencies:[Rt,ve,de,se,le,it,nt,Gt,pi,be,Ce,_e,hi,gi,Ci,Se,Gn,ge,ht,gt,at,rt,st,Z,Ee,_t,ot,We,De,He,Ge,G],styles:["app-email-input[_ngcontent-%COMP%], #save_payment_info_true[_ngcontent-%COMP%]{margin-bottom:1.25rem}#payment_info[_ngcontent-%COMP%]{container-type:inline-size;container-name:ps-cc-cvv-host}#ccNumDiv[_ngcontent-%COMP%], #credit_card_number_container[_ngcontent-%COMP%]{height:9.75rem}#ccNumDiv[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], #credit_card_number_container[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{height:100%}@supports (container-type: inline-size){@container ps-cc-cvv-host (min-width: 450.02px){#ccNumDiv[_ngcontent-%COMP%], #credit_card_number_container[_ngcontent-%COMP%]{height:4.875rem}}}.error-box[_ngcontent-%COMP%]{grid-column-end:span 1;max-width:none}@media screen and (width>=600px){.error-box[_ngcontent-%COMP%]{grid-column-end:span 2}}.form-field-i-frame[_ngcontent-%COMP%]{height:4.875rem;overflow:visible}.form-field-i-frame[_ngcontent-%COMP%] > div#card_number[_ngcontent-%COMP%]{height:100%;overflow:visible}.form-field-i-frame[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{height:100%}.subtitle[_ngcontent-%COMP%]{margin:1rem 0}.text-selection[_ngcontent-%COMP%]{padding:1rem}.create-account-container[_ngcontent-%COMP%]{border:1px solid rgba(0,0,0,.12);border-radius:3px;margin-bottom:2rem}"]})}}return t})();function El(t,l){t&1&&(a(0,"h3"),u(1),c(2,"translate"),r()),t&2&&(o(),v(f(2,1,"LABEL.YOUR_INFO")))}function Pl(t,l){t&1&&(a(0,"h3"),u(1),c(2,"translate"),r()),t&2&&(o(),v(f(2,1,"LABEL.PAYMENT_INFO")))}function Al(t,l){if(t&1&&(a(0,"div",6),p(1,El,3,3,"h3")(2,Pl,3,3,"h3"),r()),t&2){let e=d();o(),m(e.currentStep===1?1:2)}}function xl(t,l){if(t&1){let e=P();a(0,"app-guest-contact-info",7),y("canceled",function(){I(e);let i=d();return b(i.cancel())})("continued",function(){I(e);let i=d();return b(i.continueToPayment())}),r()}if(t&2){let e=d();g("contactData",e.giftSubmission)}}function Tl(t,l){if(t&1){let e=P();a(0,"app-guest-gift-payment-info",8),y("showPaymentProcessingChanged",function(i){I(e);let s=d();return b(s.onPaymentProcessingChanged(i))})("backClicked",function(){I(e);let i=d();return b(i.goBackToInfo())}),r()}if(t&2){let e=d();g("giftSubmission",e.giftSubmission)}}var bo=(()=>{class t{constructor(){this.canceled=new ne,this.paymentProcessingChanged=new ne,this.currentStep=1,this.paymentIsProcessing=!1,this.destroyRef=E(J),this.myGiftsSvc=E(Pe)}ngOnInit(){this.giftSubmission={},this.myGifts=this.myGiftsSvc.getGifts(),this.giftSubmission.gifts=this.myGifts.gifts,this.myGiftsSvc.myGifts.pipe(F(e=>{this.myGifts=e,this.giftSubmission.gifts=e?.gifts??[],this.currentStep===2&&e?.hasFutureGifts&&this.goBackToInfo()}),N(this.destroyRef)).subscribe()}continueToPayment(){this.currentStep=2}goBackToInfo(){this.currentStep=1}onPaymentProcessingChanged(e){this.paymentIsProcessing=e,this.paymentProcessingChanged.emit(e)}cancel(){this.canceled.emit()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=O({type:t,selectors:[["app-guest-gift-info"]],outputs:{canceled:"canceled",paymentProcessingChanged:"paymentProcessingChanged"},decls:7,vars:3,consts:[["header",""],["id","gift_info_form"],["id","guest_gift_info_card",1,"gift-info-card","with-shadow"],["accountCreationMode","create-now",3,"contactData"],[3,"giftSubmission"],["headerMessage","LABEL.PROCESSING","message","MESSAGE.GIFT_PROCESSING",3,"isVisible"],[1,"app-card-header","flex","flex-column"],["accountCreationMode","create-now",3,"canceled","continued","contactData"],[3,"showPaymentProcessingChanged","backCl
1icked","giftSubmission"]],template:function(n,i){n&1&&(a(0,"div",1)(1,"app-card",2),M(2,Al,3,1,"ng-template",null,0,w),p(4,xl,1,1,"app-guest-contact-info",3),p(5,Tl,1,1,"app-guest-gift-payment-info",4),r()(),h(6,"app-spinner-modal",5)),n&2&&(o(4),m(i.currentStep===1?4:-1),o(),m(i.currentStep===2?5:-1),o(),g("isVisible",i.paymentIsProcessing))},dependencies:[$,Vi,Io,It,G],styles:["[_nghost-%COMP%] .zip-field .p-error{bottom:-1.375rem!important}"],data:{animation:[Sn()]}})}}return t})();var Ol=["addDonorPaymentMethod"],wl=["donorPaymentMethodDropdown"],Nl=["inlineAddPaymentMethod"],Ml=["captchaRef"],Dl=t=>({amount:t});function Gl(t,l){t&1&&(h(0,"app-alert",8),c(1,"translate")),t&2&&g("message",j(f(1,3,"FINANCE.MESSAGES.FUND_ACCEPTS_CC_EXCLUSIVELY")))("header",null)}function Fl(t,l){t&1&&(h(0,"app-alert",9),c(1,"translate")),t&2&&g("message",j(f(1,3,"FINANCE.MESSAGES.FUND_ACCEPTS_ACH_EXCLUSIVELY")))("header",null)}function Rl(t,l){t&1&&h(0,"span",20)}function Ll(t,l){if(t&1&&p(0,Rl,1,0,"span",20),t&2){let e=d();m(e.giftInfoForm&&e.giftInfoForm.controls.paymentMethod.errors&&e.giftInfoForm.controls.paymentMethod.errors.amexEnabled?0:-1)}}function Vl(t,l){if(t&1){let e=P();a(0,"div",12)(1,"p-checkbox",21),y("onChange",function(){I(e);let i=d();return b(i.setFeeOffset())}),r(),a(2,"label",22),u(3),r()()}if(t&2){let e=d();o(),g("binary",!0),o(2),v(e.offsetLabel)}}function Bl(t,l){if(t&1&&(a(0,"span")(1,"strong"),u(2),c(3,"translate"),r(),u(4),r()),t&2){let e=d();o(2),A("",f(3,2,"LABEL.EXPIRATION_DATE"),":"),o(2),A(" ",e.selectedPaymentMethodPreview==null?null:e.selectedPaymentMethodPreview.expiration)}}function Ul(t,l){if(t&1){let e=P();a(0,"div",12)(1,"p-checkbox",24),y("onChange",function(){I(e);let i=d(2);return b(i.setFeeOffset())}),r(),a(2,"label",25),u(3),r()()}if(t&2){let e=d(2);o(),g("binary",!0),o(2),v(e.inlineOffsetLabel)}}function kl(t,l){if(t&1){let e=P();a(0,"app-add-donor-payment-method",23,5),y("paymentMethodAdded",function(i){I(e);let s=d();return b(s.onInlinePaymentMethodAdded(i))})("selectedPaymentTypeChange",function(){I(e);let i=d();return b(i.onInlinePaymentTypeChange())}),r(),p(2,Ul,4,2,"div",12)}if(t&2){let e=d();g("isFormFullWidth",!0)("showCvvInput",!0),o(2),m(e.showInlineOffsetOption?2:-1)}}function zl(t,l){if(t&1&&(h(0,"app-alert",15),c(1,"translate")),t&2){let e=d();g("header",j(f(1,4,"ERROR.PROCESSING_GIFT")))("message",j(e.errorMsg))}}function ql(t,l){if(t&1){let e=P();a(0,"button",28),c(1,"translate"),y("click",function(){I(e);let i=d(2);return b(i.inlineAddPaymentMethod.addPaymentMethod())}),r()}if(t&2){let e=d(2);g("label",j(f(1,4,"LABEL.SUBMIT_YOUR_GIFT")))("disabled",!e.inlineAddPaymentMethod||e.inlineAddPaymentMethod.disableSubmitButton())("loading",(e.inlineAddPaymentMethod==null?null:e.inlineAddPaymentMethod.isButtonLoading())??!1)}}function jl(t,l){if(t&1&&(h(0,"app-form-submit-button",27),c(1,"currency"),c(2,"translate")),t&2){let e=d(2);g("form",e.giftInfoForm)("label",T(2,7,"FINANCE.LABELS.GIVE_WITH_AMOUNT",R(10,Dl,f(1,5,e.gift.totalAmount))))("isLoading",e.showPaymentProcessing)("disabled",e.isDisabled())("pTooltip",e.getTooltipMessage())}}function Wl(t,l){if(t&1&&p(0,ql,2,6,"button",26)(1,jl,3,12,"app-form-submit-button",27),t&2){let e=d();m(e.showAddPaymentForm?0:1)}}var Eo=(()=>{class t{constructor(){this.activeFundDetailSvc=E(Ai),this.cdr=E(ri,{optional:!0}),this.configSvc=E(we),this.destroyRef=E(J),this.feeOffsetSvc=E(Oi),this.giftSubmissionSvc=E(Pt),this.injector=E(Jt),this.linkSvc=E(ie),this.myGiftsSvc=E(Pe),this.paymentMethodUtilitySvc=E(wt),this.paymentServicesIframeSvc=E(di),this.profileSvc=E(Ne),this.route=E(U),this.router=E(ee),this.telemetrySvc=E(li),this.pwaGiftSubmitTelemetry=E(Nt),this.themeColorsSvc=E(Mt),this.translateSvc=E(oe),this.userPaymentMethodSvc=E(Ft),this.cvvStatus={required:!1,iframeInitialized:!1,valid:!1},this.publicIframeInputColor=this.themeColorsSvc.primary500,this.selectedPaymentMethod=null,this.selectedPaymentMethodPreview=null,this.nuveiPaymentMethodDetails=null,this.showInlineOffsetOption=!1,this.inlineOffsetLabel="",this.showAddPaymentForm=!1,this.isNuveiMerchant=this.activeFundDetailSvc.isNuveiMerchant,this.activeUserId=null}ngOnInit(){this.reCaptchaSiteKey=this.configSvc.get("reCaptchaSiteKey"),this.fund=ce.getParentSnapshotData("fund",this.route.
1snapshot),this.organization=ce.getParentSnapshotData("organization",this.route.snapshot),this.profileSvc.activeProfile$.pipe(F(e=>{e&&(this.activeUserId=e.id,this.nuveiPaymentMethodDetails={firstName:e.firstName,lastName:e.lastName,email:e.email})}),N(this.destroyRef)).subscribe(),this.initGift(),this.initForm(),this.syncShowOffsetOption()}ngAfterViewInit(){this.giftInfoForm.controls.paymentMethod.setValidators([x.required,this.validateCardType.bind(this)])}setFeeOffset(){this.giftInfoForm.controls.offsetEnabled.value?this.isSelectedPaymentCc()?this.setFeeOffsetCreditCard():this.isSelectedPaymentAch()&&this.setFeeOffsetAch():this.feeOffsetSvc.zeroOffset(this.gift,!0)}onInlinePaymentTypeChange(){this.giftInfoForm.controls.offsetEnabled.setValue(!1),this.refreshInlineOffsetOption(),this.setFeeOffset()}isSelectedPaymentCc(){return this.showAddPaymentForm?this.inlineAddPaymentMethod?.selectedPaymentType==="CC":this.paymentMethodUtilitySvc.isCc(this.giftInfoForm.value.paymentMethod?.accountType)}isSelectedPaymentAch(){return this.showAddPaymentForm?this.inlineAddPaymentMethod?.selectedPaymentType==="ACH":this.paymentMethodUtilitySvc.isAch(this.giftInfoForm.value.paymentMethod?.accountType)}refreshInlineOffsetOption(){if(!this.showAddPaymentForm){this.showInlineOffsetOption=!1,this.inlineOffsetLabel="";return}if(this.isSelectedPaymentCc()){this.showInlineOffsetOption=this.feeOffsetSvc.syncShowCcOffsetOptionForDonor(!0,this.fund),this.inlineOffsetLabel=this.showInlineOffsetOption?this.translateSvc.instant("FINANCE.MESSAGES.FEE_OFFSET_DONOR_OPTION",{offsetAmount:this.feeOffsetSvc.formatOffsetAmount(this.fund.givingCreditCardOffset,this.fund.givingCreditCardOffsetAmount)}):"";return}if(this.isSelectedPaymentAch()){this.showInlineOffsetOption=this.feeOffsetSvc.syncShowAchOffsetOptionForDonor(!0,this.fund),this.inlineOffsetLabel=this.showInlineOffsetOption?this.translateSvc.instant("FINANCE.MESSAGES.FEE_OFFSET_DONOR_OPTION",{offsetAmount:this.feeOffsetSvc.formatOffsetAmount(this.fund.givingAchOffset,this.fund.givingAchOffsetAmount)}):"";return}this.showInlineOffsetOption=!1,this.inlineOffsetLabel=""}setFeeOffsetCreditCard(){this.feeOffsetSvc.calculateOffset(this.fund.givingCreditCardOffset,this.fund.givingCreditCardOffsetAmount,this.gift,!0)}setFeeOffsetAch(){this.feeOffsetSvc.calculateOffset(this.fund.givingAchOffset,this.fund.givingAchOffsetAmount,this.gift,!0)}onGiftFormSubmit(){if(this.pwaGiftSubmitTelemetry.logStep("user.captcha_execute",{tenant:this.organization?.tenantId??""}),!this.captchaRef){this.pwaGiftSubmitTelemetry.logStep("user.captcha_missing_ref");return}this.captchaRef.execute()}handleGiftSubmission(){if(this.pwaGiftSubmitTelemetry.startCorrelation("user"),this.pwaGiftSubmitTelemetry.logStep("user.handleGiftSubmission_enter",{tenant:this.organization?.tenantId??"",hasRecaptchaToken:String(!!this.giftInfoForm.controls.recaptchaReactive.value)}),this.showPaymentProcessing=!0,this.errorMsg=null,this.inlineAddedPaymentMethodId){this.pwaGiftSubmitTelemetry.logStep("user.branch_inline_payment"),this.submitGift();return}if(this.verifyCvvBeforeSubmit()){this.pwaGiftSubmitTelemetry.logStep("user.branch_cvv");return}let n=this.giftInfoForm.controls.paymentMethod.value;if(this.paymentMethodUtilitySvc.isAch(n?.accountType)&&!n.isInNuveiVault&&this.isNuveiMerchant()){this.pwaGiftSubmitTelemetry.logStep("user.branch_ach_migrate",{paymentMethodId:n?.id??""}),this.migrateAchToNuveiVault(n.id);return}this.pwaGiftSubmitTelemetry.logStep("user.branch_submitGift_direct"),this.submitGift()}submitGift(){let e=this.inlineAddedPaymentMethodId??this.giftInfoForm.controls.paymentMethod.value?.id,n=L({},this.gift),i=this.giftInfoForm.controls.recaptchaReactive.value;if(this.giftInfoForm.controls.offsetEnabled.value)n.amount=this.gift.totalAmount;else if(this.gift.feeOffsetAmount>0){let s={component:"UserGiftInfoComponent",gift:JSON.stringify(this.gift),formValue:JSON.stringify(this.giftInfoForm.value)};this.telemetrySvc.trackEvent("FeeOffsetEvent",s),n.feeOffsetAmount=0}this.pwaGiftSubmitTelemetry.logStep("user.submitGift_start",{tenant:this.organization.tenantId,hasPaymentMethodId:String(!!e),hasRecaptchaToken:String(!!i),amount:String(n?.amount??"")}),this.giftSubmissionSvc.postUserGiftSubmission(this.organization.tenantId,e,i,[n]).subscribe({next:s=>{if(this.pwaGiftSubmitTelemetry.logStep("user.submitGift_http_next",{isSubmitted:String(!!s?.[0]?.isSubmitted)}),s[0].isSubmitted){this.pwaGiftSubmitTelemetry.logStep("user.submitGift_complete_navigate",{giftId:s[0].giftId??""}
1),this.profileSvc.loadProfile().catch(()=>{}).then(()=>this.router.navigate(this.linkSvc.giftConfirmation(s[0].giftId))).finally(()=>{this.myGiftsSvc.clearGifts(),this.showPaymentProcessing=!1});return}this.errorMsg=s[0].errorMessage,this.showPaymentProcessing=!1},error:s=>{let _=s;this.pwaGiftSubmitTelemetry.logError("user.submitGift_http_error",_),this.errorMsg=_.message||this.translateSvc.instant("ERROR.GENERIC"),this.showPaymentProcessing=!1}})}isDisabled(){let e=this.organization.products.find(s=>s.name===ut.OnlineGiving).status==="Live",n=!!this.nuveiPaymentMethodDetails,i=this.cvvStatus.required&&!this.cvvStatus.valid;return!e||!n||i}getTooltipMessage(){if(this.isDisabled())return this.translateSvc.instant("FINANCE.MESSAGES.GIFTS_DISABLED_ONBOARDING")}validateCardType(e){if(e){let n=e.value;if(n?.accountType&&!this.fund?.acceptsAmex&&n.accountType==="AmericanExpress")return{amexEnabled:!0}}return null}syncShowOffsetOption(){let e=this.giftInfoForm.value.paymentMethod;if(!e)return;this.giftInfoForm.controls.offsetEnabled.setValue(!1),this.resetCvvRequired();let n=this.paymentMethodUtilitySvc.isCc(e.accountType),i=this.paymentMethodUtilitySvc.isAch(e.accountType);n&&(this.showOffsetOption=this.feeOffsetSvc.syncShowCcOffsetOptionForDonor(n,this.fund),this.checkIfCvvIsRequired(e)),i&&(this.showOffsetOption=this.feeOffsetSvc.syncShowAchOffsetOptionForDonor(i,this.fund)),this.showOffsetOption&&i?this.initAchOffsetOption():this.showOffsetOption&&n&&this.initCcOffsetOption(),this.setFeeOffset()}initGift(){this.myGiftsSvc.myGifts.pipe(F(e=>{let n=this.gift;this.gifts=e.gifts,this.gift=this.gifts[0],n&&this.gift&&n.amount!==this.gift.amount&&this.giftInfoForm.controls.offsetEnabled.value&&this.setFeeOffset()}),N(this.destroyRef)).subscribe()}initForm(){this.giftInfoForm=new Je({paymentMethod:new Y(null),offsetEnabled:new Y(!1),recaptchaReactive:new Y(null)})}initCcOffsetOption(){let e=this.fund.givingCreditCardOffset,n=this.fund.givingCreditCardOffsetAmount,i=this.feeOffsetSvc.formatOffsetAmount(e,n);this.offsetLabel=this.translateSvc.instant("FINANCE.MESSAGES.FEE_OFFSET_DONOR_OPTION",{offsetAmount:i})}initAchOffsetOption(){let e=this.fund.givingAchOffset,n=this.fund.givingAchOffsetAmount,i=this.feeOffsetSvc.formatOffsetAmount(e,n);this.offsetLabel=this.translateSvc.instant("FINANCE.MESSAGES.FEE_OFFSET_DONOR_OPTION",{offsetAmount:i})}initCvvIframe(){return Kt(this,null,function*(){this.cvvStatus.iframeInitialized||(yield this.paymentServicesIframeSvc.initializeIframe(this.fund.merchantId,V.Cvv,this.publicIframeInputColor,!1,!1,this.selectedPaymentMethod?.accountType),this.cvvStatus.iframeInitialized=!0,this.paymentServicesIframeSvc.cvvValidateResult.pipe(F(e=>{this.cvvStatus.valid=e.valid}),N(this.destroyRef)).subscribe(),this.paymentServicesIframeSvc.cvvCopyResult.pipe(F(e=>{this.pwaGiftSubmitTelemetry.logStep("user.cvv_copy_result",{success:String(!!e.success)}),e.success?(this.cvvStatus.required=!1,this.migrateCcToNuveiVault()):(this.errorMsg=this.translateSvc.instant("ERROR.CVV_VERIFICATION_FAILED"),this.showPaymentProcessing=!1)}),N(this.destroyRef)).subscribe())})}checkIfCvvIsRequired(e){this.isNuveiMerchant()&&!e.isInNuveiVault?(this.cvvStatus.iframeInitialized&&this.selectedPaymentMethod?.accountType!==e.accountType&&this.resetCvvIframe(),this.cvvStatus.required=!0,this.selectedPaymentMethod=e,this.selectedPaymentMethodPreview={cardholderName:e?.cardholderName,expiration:e?.expiration,lastFour:e?.lastFour,type:e?.accountType},this.initCvvIframe()):this.resetCvvRequired()}resetCvvIframe(){this.cvvStatus.iframeInitialized&&(this.paymentServicesIframeSvc.terminateIframe(),this.cvvStatus.iframeInitialized=!1,this.cvvStatus.valid=!1)}resetCvvRequired(){this.resetCvvIframe(),this.cvvStatus.required=!1,this.selectedPaymentMethod=null,this.selectedPaymentMethodPreview=null}verifyCvvBeforeSubmit(){if(this.cvvStatus.required){if(!this.selectedPaymentMethod?.paymentServicesId)return this.pwaGiftSubmitTelemetry.logStep("user.cvv_missing_paymentServicesId"),this.errorMsg=this.translateSvc.instant("ERROR.GENERIC"),this.showPaymentProcessing=!1,!0;this.pwaGiftSubmitTelemetry.logStep("user.cvv_copy_started");let e=pe(L({},this.nuveiPaymentMethodDetails),{cardHolderName:this.giftInfoForm.value.paymentMethod?.cardholderName});return this.paymentServicesIframeSvc.copyPaymentMethodFromPayaToNuveiVault(this.selectedPaymentMethod.paymentServicesId,e),!0}return!1}migrateCcToNuveiVault(){let e=this.giftInfoForm.controls.paymentMethod.value?.id,n=[this.fund.merchantId];this.userPaymentMethodSvc.migrateToNuveiVault(e,n,!1).subscribe({next:()=>{this.submitGift()},error:i=>{this.telemetrySvc.trackEvent("migrateToNuveiVault_IsInNuveiVaultFailedInHubApiForCC",{component:"UserGiftInfoComponent",paymentMethodId:e,merchantIds:n.join(","),orgNumber:this.organization.number??"",userId:this.activeUserId??"",email:this.nuveiPaymentMethodDetails?.email??"",fix:"Update flag with: PATCH /api/v1/users/{userId}/wallet/{paymentMethodId}/migrateToNuveiVault"}),this.submitGift()}})}migrateAchToNuveiVault(e){if(!this.nuveiPaymentMethodDetails?.firstName||!this.nuveiPaymentMethodDetails?.lastName){this.errorMsg=this.translateSvc.instant("ERROR.GENERIC"),this.showPaymentProcessing=!1;return}let n=[this.fund.merchantId];this.pwaGiftSubmitTelemetry.logStep("user.ach_migrate_started",{paymentMethodId:e}),this.userPaymentMethodSvc.migrateToNuveiVault(e,n,!1,this.nuveiPaymentMethodDetails.firstName,this.nuveiPaymentMethodDetails.lastName,this.nuveiPaymentMethodDetails.email).subscribe({next:()=>{this.pwaGiftSubmitTelemetry.logStep("user.ach_migrate_success"),this.submitGift()},error:i=>{if(this.pwaGiftSubmitTelemetry.logError("user.ach_migrate_error",i,{paymentMethodId:e}),i instanceof ln){this.submitGift();return}this.telemetrySvc.trackEvent("migrateToNuveiVault_MigrationFailed_ACH",{component:"UserGiftInfoComponent",paymentMethodId:e,merchantIds:n.join(","),orgNumber:this.organization.number??"",userId:this.activeUserId??"",email:this.nuveiPaymentMethodDetails?.email??""}),this.errorMsg=this.translateSvc.instant("ERROR.GENERIC"),this.showPaymentProcessing=!1}})}onPaymentMethodsLoaded(e){e||(this.showAddPaymentForm=!0,Zt(()=>{this.inlineAddPaymentMethod?.filterPaymentMethods(this.getAcceptedPaymentTypes()),this.refreshInlineOffsetOption(),this.cdr?.detectChanges()},{injector:this.injector}))}onInlinePaymentMethodAdded(e){this.inlineAddedPaymentMethodId=e.id,this.captchaRef.execute()}cancel(){this.router.navigate(this.linkSvc.fundList())}getAcceptedPaymentTypes(){let e=[];return this.fund.acceptsAch&&e.push("ACH"),this.fund.acceptsCreditCard&&e.push("CC"),e}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=O({type:t,selectors:[["app-user-gift-info"]],viewQuery:function(n,i){if
1(n&1&&me(Ol,7)(wl,7)(Nl,5)(Ml,5),n&2){let s;W(s=H())&&(i.addDonorPaymentMethod=s.first),W(s=H())&&(i.donorPaymentMethodDropdown=s.first),W(s=H())&&(i.inlineAddPaymentMethod=s.first),W(s=H())&&(i.captchaRef=s.first)}},decls:32,vars:30,consts:[["donorPaymentMethodDropdown",""],["errors",""],["footer",""],["captchaRef","reCaptcha"],["addDonorPaymentMethod",""],["inlineAddPaymentMethod",""],["novalidate","","id","giftInfoForm",3,"ngSubmit","formGroup"],[1,"gift-info-card",3,"header","subheader"],["icon","credit_card","severity","info",1,"mb-0.75",3,"header","message"],["icon","account_balance","severity","info",1,"mb-0.75",3,"header","message"],[3,"hidden"],["id","user_gift_info_payment_method_dropdown","formControlName","paymentMethod","label","LABEL.PAYMENT",1,"flex","flex-full-width",3,"controlChange","paymentMethodsLoaded","acceptsAch","acceptsCreditCard","fundIsNuvei","addModal"],[1,"checkbox-wrapper","mb-1.25"],[1,"grid","gap-0.5","tab:template-cols-1-1","border-solid","border-radius-5","-mb-1","p-1"],["id","cvv_verification",1,"cvv-iframe"],["severity","error",3,"header","message"],[1,"flex","justify-content-center","recaptcha-badge","pt-1",3,"hidden"],["formControlName","recaptchaReactive","id","reCaptcha","name","reCaptcha","size","invisible","badge","inline",3,"resolved","siteKey"],["headerMessage","LABEL.PROCESSING","message","MESSAGE.GIFT_PROCESSING",3,"isVisible"],[3,"paymentMethodAdded","cancelled"],["translate","FINANCE.ERRORS.AMEX_NOT_ACCEPTED"],["id","user_gift_info_offset","inputId","user_gift_info_offset_input","formControlName","offsetEnabled",3,"onChange","binary"],["for","user_gift_info_offset_input"],[3,"paymentMethodAdded","selectedPaymentTypeChange","isFormFullWidth","showCvvInput"],["id","user_gift_info_inline_offset","inputId","user_gift_info_inline_offset_input","formControlName","offsetEnabled",3,"onChange","binary"],["for","user_gift_info_inline_offset_input"],["pButton","","id","add_payment_method_button","type","button",1,"p-button","mobile-btn","w-full",3,"label","disabled","loading"],["id","complete_button","buttonClasses","p-button mobile-btn w-full","loadingLabel","LABEL.SUBMITTING_GIFT","tooltipPosition","bottom",3,"form","label","isLoading","disabled","pTooltip"],["pButton","","id","add_payment_method_button","type","button",1,"p-button","mobile-btn","w-full",3,"click","label","disabled","loading"]],template:function(n,i){if(n&1){let s=P();a(0,"form",6),y("ngSubmit",function(){return i.onGiftFormSubmit()}),a(1,"app-card",7),c(2,"translate"),c(3,"translate"),p(4,Gl,2,5,"app-alert",8),p(5,Fl,2,5,"app-alert",9),a(6,"div",10)(7,"app-donor-payment-method-dropdown",11,0),y("controlChange",function(){return i.syncShowOffsetOption()})("paymentMethodsLoaded",function(C){return i.onPaymentMethodsLoaded(C)}),M(9,Ll,1,1,"ng-template",null,1,w),r(),p(11,Vl,4,2,"div",12),a(12,"section",10),c(13,"translate"),a(14,"section",13)(15,"div")(16,"p"),u(17),c(18,"translate"),r(),p(19,Bl,5,4,"span"),r(),a(20,"div"),h(21,"div",14),r()()()(),p(22,kl,3,3),p(23,zl,2,6,"app-alert",15),M(24,Wl,2,1,"ng-template",null,2,w),r(),a(26,"div",16)(27,"re-captcha",17,3),y("resolved",function(C){return C&&i.handleGiftSubmission()}),r()(),h(29,"app-spinner-modal",18),a(30,"app-add-donor-payment-method-modal",19,4),y("paymentMethodAdded",function(C){I(s);let D=ae(8);return b(D.onPaymentMethodAdded(C))})("cancelled",function(){I(s);let C=ae(8);return b(C.onAddPaymentMethodCancelled())}),r()()}if(n&2){let s=ae(31);g("formGroup",i.giftInfoForm),o(),g("header",j(f(2,22,"LABEL.GIFT_INFO")))("subheader",j(f(3,24,"MESSAGE.COMPLETE_GIFT"))),o(3),m(!i.showAddPaymentForm&&i.fund.acceptsCreditCard&&!i.fund.acceptsAch?4:-1),o(),m(!i.showAddPaymentForm&&i.fund.acceptsAch&&!i.fund.acceptsCreditCard?5:-1),o(),g("hidden",i.showAddPaymentForm),o(),g("acceptsAch",i.fund.acceptsAch)("acceptsCreditCard",i.fund.acceptsCreditCard)("fundIsNuvei",i.isNuveiMerchant())("addModal",s),o(4),m(i.showOffsetOption?11:-1),o(),g("hidden",!i.cvvStatus.required||i.giftInfoForm.controls.paymentMethod.invalid),ei("aria-label",f(13,26,"FINANCE.LABELS.CVV_VERIFICATION")),o(5),v(f(18,28,"FINANCE.MESSAGES.ENTER_CVV_FOR_SELECTED_PAYMENT_METHOD")),o(2),m(i.selectedPaymentMethodPreview!=null&&i.selectedPaymentMethodPreview.expiration?19:-1),o(3),m(i.showAddPaymentForm?22:-1),o(),m(i.errorMsg?23:-1),o(3),g("hidden",i.showAddPaymentForm),o(),g("siteKey",i.reCaptchaSiteKey),o(2),g("isVisible",i.showPaymentProcessing)}},dependencies:[vn,Z,ht,gt,$n,Dn,yi,Lt,Se,Pi,de,se,le,Ee,$,Ce,_e,Ge,De,It,ot,ge,ue,G],styles:["[_nghost-%COMP%] #user_gift_info_payment_method_dropdown, [_nghost-%COMP%] #payment_method_wrapper{width:100%}.cvv-iframe[_ngcontent-%COMP%]{height:4.75rem}"]})}}return t})();var Hl=()=>({size:2,offset:16}),Yl=t=>({frequency:t});function Ql(t,l){t&1&&(a(0,"div",1)(1,"h2"),u(2),c(3,"translate"),r()()),t&2&&(o(2),v(f(3,1,"ERROR.ORGANIZATION_DOES_NOT_SUPPORT_OLG")))}function $l(t,l){t&1&&(h(0,"app-lozenge",13),c(1,"translate")),t&2&&g("label",f(1,1,"FINANCE.LABELS.CREDIT_CARD_ONLY"))}
1function Kl(t,l){t&1&&(h(0,"app-lozenge",14),c(1,"translate")),t&2&&g("label",f(1,1,"FINANCE.LABELS.BANK_ACCOUNT_ONLY"))}function Xl(t,l){if(t&1&&(a(0,"div",22),u(1),c(2,"translate"),r()),t&2){let e=d().$implicit;o(),q(" ",f(2,2,"LABEL.NOTES"),": ",e.note," ")}}function Jl(t,l){if(t&1&&(a(0,"div")(1,"div",24)(2,"div"),u(3),c(4,"translate"),r(),a(5,"div"),u(6),c(7,"currency"),r()()()),t&2){let e=d().$implicit;o(),g("@fadeIn",void 0),o(2),v(f(4,3,"LABEL.PROCESSING_FEE_DONATION")),o(3),v(f(7,5,e.feeOffsetAmount))}}function Zl(t,l){if(t&1){let e=P();a(0,"div"),h(1,"advanced-image",11),a(2,"div",12),u(3),r(),p(4,$l,2,3,"app-lozenge",13),p(5,Kl,2,3,"app-lozenge",14),a(6,"div",15)(7,"h5"),u(8),c(9,"translate"),r(),a(10,"div",16)(11,"div")(12,"div",17),u(13),c(14,"givingFrequencies"),c(15,"translate"),r(),a(16,"div",18),u(17),c(18,"translate"),c(19,"date"),r()(),a(20,"div",19)(21,"button",20),c(22,"translate"),c(23,"translate"),y("click",function(){let i=I(e).$implicit,s=d(2);return b(s.showEditGiftModal(i))}),a(24,"i",21),u(25,"edit"),r()(),a(26,"button",20),c(27,"translate"),c(28,"translate"),y("click",function(){let i=I(e).$implicit,s=d(2);return b(s.showDeleteGiftModal(i))}),a(29,"i",21),u(30,"delete"),r()()()(),p(31,Xl,3,4,"div",22),h(32,"hr"),a(33,"div")(34,"div",23)(35,"div"),u(36),c(37,"translate"),r(),a(38,"div"),u(39),c(40,"currency"),r()()(),p(41,Jl,8,7,"div"),r()()}if(t&2){let e=l.$implicit,n=d(2);o(),g("cldImg",n.cloudinary.fundImage(e.fund,Ie(44,Hl))),o(2),v(e.fund.name),o(),m(e.fund.acceptsCreditCard&&!e.fund.acceptsAch?4:-1),o(),m(e.fund.acceptsAch&&!e.fund.acceptsCreditCard?5:-1),o(3),v(f(9,20,"FINANCE.LABELS.YOUR_GIFT")),o(5),v(T(15,24,"FINANCE.LABELS.FREQUENCY_GIFT",R(45,Yl,f(14,22,e.frequency)))),o(4),q("",f(18,27,e.isFutureGift?"LABEL.SCHEDULED":"LABEL.DATE"),": ",T(19,29,e.scheduledDate,"MM/dd/yyyy")),o(4),g("pTooltip",ki("",f(22,32,"LABEL.EDIT")," ",f(23,34,"LABEL.GIFT")))("showDelay",500),o(5),g("pTooltip",ki("",f(27,36,"LABEL.DELETE")," ",f(28,38,"LABEL.GIFT")))("showDelay",500),o(5),m(e.note?31:-1),o(5),A("",f(37,40,"LABEL.GIFT_AMOUNT"),":"),o(3),v(f(40,42,e.amount)),o(2),m(e.feeOffsetAmount?41:-1)}}function ed(t,l){if(t&1){let e=P();a(0,"app-guest-gift-info",25),y("canceled",function(){I(e);let i=d(2);return b(i.cancel())})("paymentProcessingChanged",function(i){I(e);let s=d(2);return b(s.paymentIsProcessing=i)}),r()}}function td(t,l){t&1&&h(0,"app-user-gift-info")}function id(t,l){if(t&1&&(a(0,"div",2)(1,"div",5)(2,"app-card",6)(3,"div",7),Te(4,Zl,42,47,"div",null,ti),a(6,"div",8)(7,"h4"),u(8),c(9,"translate"),a(10,"span",9),u(11),c(12,"currency"),r()()()()()(),a(13,"div",10),p(14,ed,1,0,"app-guest-gift-info")(15,td,1,0,"app-user-gift-info"),r()()),t&2){let e=d();o(4),Oe(e.myGifts.gifts),o(4),A("",f(9,3,"LABEL.TOTAL"),": "),o(3),v(f(12,5,e.myGifts.totalAmount)),o(3),m(!e.isAuthenticated()||e.paymentIsProcessing?14:15)}}var Po=(()=>{class t{constructor(e,n,i,s,_,C,D,X,re,Re){this.cloudinary=e,this.confirmationSvc=n,this.linkSvc=i,this.myGiftsSvc=s,this.route=_,this.router=C,this.sessionSvc=D,this.translateSvc=X,this.giftSubmissionSvc=re,this.profileSvc=Re,this.breakpointSvc=E(tt),this.destroyRef=E(J),this.isMobile=this.breakpointSvc.underWideTablet,this.editModalVisible=!1,this.giftToEdit={},this.olgIsEnabled=!1,this.paymentIsProcessing=!1}ngOnInit(){this.org=ce.getParentSnapshotData("organization",this.route.snapshot),this.olgIsEnabled=this.org.onlineGivingEnabled,this.profileSvc.activeProfile$.pipe(N(this.destroyRef)).subscribe(e=>{this.userFirstName=e?e.firstName:""}),this.myGiftsSvc.myGifts.pipe(N(this.destroyRef)).subscribe(e=>this.myGifts=e)}isAuthenticated(){return this.sessionSvc.isAuthenticated()}hasGifts(){return this.myGifts?.gifts?.length>0}showEditGiftModal(e){this.editModalVisible=!0,this.giftToEdit=e}hideEditModal(){this.editModalVisible=!1}showDeleteGiftModal(e){let n=this.translateSvc.instant("LABEL.DELETE_GIFT"),i=this.translateSvc.instant("MESSAGE.CONFIRM_GIFT_DELETE");this.confirmationSvc.confirm({header:n,message:i,accept:()=>{this.myGiftsSvc.removeGift(e),this.myGiftsSvc.hasGifts()||this.router.navigate([".."],{relativeTo:this.route})}})}cancel(){this.router.navigate(this.linkSvc.fundList())}static{this.\u0275fac=function(n){return new(n||t)(S(Ct),S(ci),S(ie),S(Pe),S(U),S(ee),S(je),S(oe),S(Pt),S(Ne))}}static{this.\u0275cmp=O({type:t,selectors:[["app-gift-info-view"]],decls:5,vars:4,consts:[[1,"flex","justify-content-center","new-olg-container","new-layout-container"],[1,"card-container"],[1,"w-full","flex","flex-row-reverse","justify-content-center","flex-wrap","content-container"],["modalTitle","LABEL.EDIT_GIFT","type","Edit","buttonLabel","LABEL.UPDATE_MY_GIFT",3,"modalCanceled","gift","visible"],["confirmBtnLabel","LABEL.CONFIRM_DELETE_GIFT","severity","danger"],["id","gift_review_container"],["id","gift_review_card",1,"h-auto","gift-review-card"],["id","gifts_container",1,"gift-list"],[1,"gift-total-container","flex","justify-content-flex-end","mt-1"],["
1id","gift_total"],["id","gift_info_container"],[1,"fund-image","img:max-w-full",3,"cldImg"],[1,"p-card-subtitle"],["icon","credit_card","palette","blue",1,"flex","mt-0.5",3,"label"],["icon","account_balance","palette","blue",1,"flex","mt-0.5",3,"label"],[1,"gift-list-item","flex","flex-column","flex-full-width","mt-1.5"],[1,"flex","justify-content-space-between","mt-0.25"],[1,"gift-type"],[1,"gift-scheduled-date"],[1,"flex","gap-0.25","-mr-0.5"],["pButton","","type","button","tooltipPosition","bottom",1,"p-button-rounded","p-button-text","p-button-icon-only","p-button-plain",3,"click","pTooltip","showDelay"],[1,"material-icons"],[1,"align-items-center","mt-0.25"],[1,"flex","justify-content-space-between"],[1,"gift-fee-offset","flex","justify-content-space-between"],[3,"canceled","paymentProcessingChanged"]],template:function(n,i){n&1&&(a(0,"div",0),p(1,Ql,4,3,"div",1),p(2,id,16,7,"div",2),r(),a(3,"app-configure-gift-modal",3),y("modalCanceled",function(){return i.hideEditModal()}),r(),h(4,"app-confirm-dialog",4)),n&2&&(o(),m(i.olgIsEnabled?-1:1),o(),m(i.olgIsEnabled&&i.hasGifts()?2:-1),o(),g("gift",i.giftToEdit)("visible",i.editModalVisible))},dependencies:[$,yt,St,Vt,Z,_t,ot,bo,Eo,kt,Ei,ue,ze,bt,G],styles:[".new-layout-container[_ngcontent-%COMP%] #info_container[_ngcontent-%COMP%], .new-layout-container[_ngcontent-%COMP%] #gift_info_container[_ngcontent-%COMP%]{width:100%}@supports (container-type: inline-size){@container content-container (min-width: 960px){.new-layout-container[_ngcontent-%COMP%] #info_container[_ngcontent-%COMP%], .new-layout-container[_ngcontent-%COMP%] #gift_info_container[_ngcontent-%COMP%]{flex:1 1 30rem;max-width:30.5rem}}}@supports not (container: content-container){@media(min-width:960px){.new-layout-container[_ngcontent-%COMP%] #info_container[_ngcontent-%COMP%], .new-layout-container[_ngcontent-%COMP%] #gift_info_container[_ngcontent-%COMP%]{flex:1 1 30rem;max-width:30.5rem}}}.new-layout-container[_ngcontent-%COMP%] #review_container[_ngcontent-%COMP%], .new-layout-container[_ngcontent-%COMP%] #gift_review_container[_ngcontent-%COMP%]{margin-bottom:1.5rem;width:100%}@supports (container-type: inline-size){@container content-container (min-width: 960px){.new-layout-container[_ngcontent-%COMP%] #review_container[_ngcontent-%COMP%], .new-layout-container[_ngcontent-%COMP%] #gift_review_container[_ngcontent-%COMP%]{margin-left:1.5rem;width:20rem}}}@supports not (container: content-container){@media(min-width:960px){.new-layout-container[_ngcontent-%COMP%] #review_container[_ngcontent-%COMP%], .new-layout-container[_ngcontent-%COMP%] #gift_review_container[_ngcontent-%COMP%]{margin-left:1.5rem;width:20rem}}}"],data:{animation:[ui()]}})}}return t})();var nd=["passwordCaptchaRef"],od=t=>({contributionType:t});function ad(t,l){if(t&1&&(a(0,"div",17),u(1),c(2,"translate"),r()),t&2){let e=d();o(),q("",f(2,2,"FINANCE.LABELS.PLEDGE_DEPOSIT_DATE"),": ",e.pledge.depositDate)}}function rd(t,l){if(t&1&&(a(0,"div",17),u(1),c(2,"translate"),r()),t&2){let e=d();o(),q(" ",f(2,2,"FINANCE.LABELS.PLEDGE_INSTALLMENTS_STARTING_ON"),": ",e.pledge.startDate)}}function sd(t,l){if(t&1&&(a(0,"div",17),u(1),c(2,"translate"),r()),t&2){let e=d();o(),q(" ",f(2,2,"FINANCE.LABELS.PLEDGE_INSTALLMENT_CONFIRMATION")," #: ",e.pledge.installmentConfirmation)}}function ld(t,l){if(t&1&&(a(0,"div",17),u(1),c(2,"translate"),r()),t&2){let e=d();o(),q(" ",f(2,2,"FINANCE.LABELS.PLEDGE_DEPOSIT_CONFIRMATION")," #: ",e.pledge.depositConfirmation)}}function dd(t,l){if(t&1&&(a(0,"div",18)(1,"div"),u(2),c(3,"translate"),r(),a(4,"div"),u(5),r()()),t&2){let e=d();o(2),A("",f(3,2,"FINANCE.LABELS.ASSOCIATED_WITH"),": "),o(3),v(e.pledge.attributedToAssociatedOrganization)}}function cd(t,l){if(t&1&&(a(0,"div",20)(1,"div",28),u(2),c(3,"translate"),r(),a(4,"div",29),u(5),c(6,"currency"),r()()),t&2){let e=d();o(2),A("",f(3,2,"FINANCE.LABELS.PLEDGE_DEPOSIT_AMOUNT"),":"),o(3),v(f(6,4,e.pledge.depositAmount))}}function pd(t,l){if(t&1&&(a(0,"div",20)(1,"div",34),u(2),c(3,"translate"),r(),a(4,"div",35),u(5),c(6,"currency"),r()()),t&2){let e=d(2);o(2),A("",f(3,2,"FINANCE.LABELS.PLEDGE_DEPOSIT_AMOUNT"),":"),o(3),v(f(6,4,e.pledge.depositAmount))}}function md(t,l){if(t&1&&(a(0,"div",20)(1,"div",36),u(2),c(3,"translate"),r(),a(4,"div",37),u(5),c(6,"currency"),r()()),t&2){let e=d(2);o(2),A("",f(3,2,"FINANCE.LABELS.PLEDGE_INSTALLMENT"),":"),o(3),v(f(6,4,e.pledge.
1installmentAmount))}}function ud(t,l){if(t&1&&(a(0,"div"),h(1,"hr",30),a(2,"div",20)(3,"div",31),u(4),c(5,"translate"),r()(),p(6,pd,7,6,"div",20),p(7,md,7,6,"div",20),a(8,"div",24)(9,"div",32),u(10),c(11,"translate"),r(),a(12,"div",33),u(13),c(14,"currency"),r()()()),t&2){let e=d();o(4),A("",f(5,5,"FINANCE.LABELS.PROCESSED_TODAY")," "),o(2),m(e.pledge.depositConfirmation?6:-1),o(),m(e.pledge.installmentConfirmation?7:-1),o(3),A("",f(11,7,"FINANCE.LABELS.PLEDGE_PROCESSED_TOTAL"),": "),o(3),v(f(14,9,e.totalProcessedToday))}}function fd(t,l){if(t&1&&(a(0,"div",39)(1,"span"),h(2,"i",40),r(),a(3,"span"),u(4),r()()),t&2){let e=l.$implicit;o(4),v(e)}}function gd(t,l){if(t&1&&(a(0,"div")(1,"div",38),u(2),c(3,"translate"),r(),Te(4,fd,5,1,"div",39,ti),r()),t&2){let e=d();o(2),A(" ",f(3,1,"FINANCE.LABELS.ADDITIONAL_PLEDGE_OPTIONS")," "),o(2),Oe(e.pledge.pledgeOptionQuestions)}}function hd(t,l){if(t&1){let e=P();a(0,"div",41)(1,"div",42),u(2),c(3,"translate"),r(),a(4,"div",43)(5,"button",44),c(6,"translate"),y("click",function(){I(e);let i=d();return b(i.goToFundList())}),r()()()}t&2&&(o(2),A(" *",f(3,3,"FINANCE.MESSAGES.PLEDGE_INSTALLMENT_REMAINDER_POTENTIAL")," "),o(3),g("label",j(f(6,5,"LABEL.BACK_TO_FUNDS_LIST"))))}function _d(t,l){t&1&&h(0,"span",54)}function Cd(t,l){t&1&&h(0,"span",55)}function vd(t,l){if(t&1&&(p(0,_d,1,0,"span",54),p(1,Cd,1,0,"span",55)),t&2){let e=l;m(e.errors!=null&&e.errors.minlength&&e.touched?0:-1),o(),m(e.errors&&!e.errors.minlength&&e.errors.pattern&&e.touched?1:-1)}}function Sd(t,l){if(t&1&&p(0,vd,2,2),t&2){let e,n=d(3);m((e=n.form.get("password"))?0:-1,e)}}function yd(t,l){if(t&1){let e=P();a(0,"app-contact-otp-code-button",56),y("buttonClick",function(){I(e);let i=d(3);return b(i.sendContactOtp())}),r()}if(t&2){let e=d(3);g("isLoading",e.isSendingOtp())("disabled",e.form.value.password)("contactType",e.getContactType())}}function Id(t,l){if(t&1){let e=P();a(0,"form",47),y("ngSubmit",function(){I(e);let i=ae(14);return b(i==null?null:i.execute())}),a(1,"div",48),u(2),c(3,"translate"),c(4,"translate"),r(),a(5,"div",38),u(6),r(),a(7,"app-password-input",49),M(8,Sd,1,1,"ng-template",null,1,w),r(),p(10,yd,1,3,"app-contact-otp-code-button",50),h(11,"app-form-submit-button",51),a(12,"div",52)(13,"re-captcha",53,2),y("resolved",function(i){I(e);let s=d(2);return b(i&&s.convertGuestToCredentialedUser())}),r()()()}if(t&2){let e=d(2);g("formGroup",e.form),o(2),A(" ",T(4,12,"MESSAGE.NEXT_TIME_SIGN_IN",R(15,od,f(3,10,"WORD.PLEDGES")))," "),o(4),A(" ",e.guestPledgeSubmission.email," "),o(),g("minlength",7)("required",!0),o(3),m(e.displayContactOtpOption()?10:-1),o(),g("form",e.form)("isLoading",e.isCreatingAccount())("disabled",!e.form.valid||e.isCreatingAccount()),o(2),g("siteKey",e.reCaptchaSiteKey)}}function bd(t,l){if(t&1){let e=P();a(0,"app-contact-otp-registration",57),y("verifyFinished",function(i){I(e);let s=d(2);return b(s.onOtpCreateAccountFinished(i))}),r()}if(t&2){let e=d(2);g("username",e.guestPledgeSubmission.email??e.guestPledgeSubmission.phone)("redirectUrl",e.redirectUrl)}}function Ed(t,l){if(t&1&&(a(0,"app-card",27),c(1,"translate"),p(2,Id,15,17,"form",45)(3,bd,1,2,"app-contact-otp-registration",46),r()),t&2){let e=d();g("header",f(1,2,"LABEL.CREATE_AN_ACCOUNT")),o(2),m(e.isValidatingOtp()?3:2)}}var Ao=(()=>{class t{constructor(e,n,i,s,_,C,D,X,re,Re,Ke){this.activeTenant=e,this.configSvc=n,this.fb=i,this.notificationSvc=s,this.pledgeSvc=_,this.publicLinkSvc=C,this.publicLoginSvc=D,this.publicSvc=X,this.route=re,this.router=Re,this.sessionSvc=Ke,this.totalProcessedToday=0,this.installmentCount=0,this.showCreateAccountCard=B(!1),this.isCreatingAccount=B(!1),this.displayContactOtpOption=B(!1),this.isSendingOtp=B(!1),this.isValidatingOtp=B(!1)}ngOnInit(){if(this.reCaptchaSiteKey=this.configSvc.get("reCaptchaSiteKey"),this.pledge=this.route.snapshot.data.pledgeSubmission,this.org=this.activeTenant.getActiveTenant(),this.fund=this.route.snapshot.parent.data.fund,this.totalProcessedToday+=this.pledge.depositConfirmation?this.pledge.depositAmount:0,this.totalProcessedToday+=this.pledge.installmentConfirmation?this.pledge.installmentAmount:0,this.installmentCount=Math.max(this.pledge.installmentCount,1),this.guestPledgeSubmission=this.pledgeSvc.getGuestPledgeSubmission(),this.guestPledgeSubmission&&!this.guestPledgeSubmission.createCredentialedUser&&this.guestPledgeSubmission.contactExists===!1&&!this.sessionSvc.isAuthenticated()){this.showCreateAccountCard.set(!0),this.buildForm();let e=this.activeTenant.getActiveTenant();this.displayContactOtpOption.set(e?.enableEmailOtpForLogin===!0),this.redirectUrl=this.publicLinkSvc.userAccount().join("/")}}goToFundList(){this.pledgeSvc.clearPledge(),this.router.navigate(this.publicLinkSvc.fundList())}convertGuestToCredentialedUser(){this.isCreatingAccount.set(!0);
1let e=this.form.get("password").value,n=this.buildCreateUserCommand(e);n.recaptcha=this.passwordCaptcha;let i=n.email??n.phone;this.publicSvc.createUser(n).pipe(Q(s=>(this.isCreatingAccount.set(!1),ft(s)?(this.showCreateAccountCard.set(!1),this.notificationSvc.toast({title:"MESSAGE.ACCOUNT_ALREADY_EXISTS",severity:"warn"})):this.notificationSvc.errorBanner({title:"LABEL.ERROR",message:s.message}),K(null)))).subscribe(s=>{s!==null&&(this.isCreatingAccount.set(!1),this.publicLoginSvc.login(i,n.password,this.redirectUrl))})}buildCreateUserCommand(e){return{email:this.guestPledgeSubmission.email,password:e,firstName:this.guestPledgeSubmission.firstName,lastName:this.guestPledgeSubmission.lastName,phone:this.guestPledgeSubmission.phone,address:{line1:this.guestPledgeSubmission.address1,line2:this.guestPledgeSubmission.address2,city:this.guestPledgeSubmission.city,state:this.guestPledgeSubmission.state,zip:this.guestPledgeSubmission.zip},recaptcha:null,enableMfa:!1}}buildForm(){this.form=this.fb.group({password:["",[x.required,x.minLength(7),x.pattern(k.PASSWORD_REQUIREMENT)]]})}getContactType(){if(this.guestPledgeSubmission.email)return k.CONTACT_TYPE.EMAIL;if(this.guestPledgeSubmission.phone)return k.CONTACT_TYPE.PHONE}onOtpCreateAccountFinished(e){e&&this.showCreateAccountCard.set(!1)}sendContactOtp(){this.isSendingOtp.set(!0);let e=this.buildCreateUserCommand(null);if(e.email&&e.phone){this.isSendingOtp.set(!1),this.notificationSvc.errorBanner({title:"ERROR.CREATING_ACCOUNT",message:"ERROR.EMAIL_AND_PHONE_ACCOUNT_CREATION"});return}this.isSendingOtp.set(!0);let n={contact:e.email??e.phone,firstName:e.firstName,lastName:e.lastName,address:e.address};this.publicSvc.sendContactRegistrationOtp(n).pipe(F(()=>{this.isValidatingOtp.set(!0)}),Q(i=>(this.notificationSvc.errorBanner({title:"LABEL.ERROR",message:i.message}),K(null))),xe(()=>{this.isSendingOtp.set(!1)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)(S(fe),S(we),S(mi),S(te),S(ye),S(ie),S(Me),S(Ye),S(U),S(ee),S(je))}}static{this.\u0275cmp=O({type:t,selectors:[["app-pledge-confirmation"]],viewQuery:function(n,i){if(n&1&&me(nd,5),n&2){let s;W(s=H())&&(i.passwordCaptchaRef=s.first)}},decls:57,vars:38,consts:[["footer",""],["errors",""],["passwordCaptchaRef","reCaptcha"],[1,"flex","flex-full-width","justify-content-center","flex-column","align-items-center"],["id","pledge_confirmation_card",1,"narrow","with-shadow","new-olg-container","tight"],["id","confirm_container",1,"flex","flex-full-width","justify-content-center"],["id","confirm_msg",1,"flex","flex-two-thirds-width","justify-content-center","align-items-center"],[3,"innerHTML"],[1,"pledge-summary","flex","flex-row-wrap","ml-0","pl-0"],[1,"over-phone","text-right"],[1,"material-icons","check-circle","success-icon"],[1,"pledge-info"],[1,"header-text","flex","justify-content-space-between"],[1,"fund-name"],[1,"org-name","color-secondary","font-bold"],[1,"org-city-state","color-secondary","font-size-sm"],[1,"color-secondary","margin-top-half-rem","flex","flex-row-wrap"],[1,"pledge-type","flex-full-width"],[1,"gift-association-org","color-secondary"],[1,"w-16"],[1,"flex","justify-content-space-between"],["id","payment_amount_label",1,"font-bold"],["id","payment_installment_label"],["id","payment_installment_amount"],[1,"font-bold","flex","justify-content-space-between"],["id","pledge_total_amount_label"],["id","pledge_total_amount"],["id","create_account_card",1,"narrow","with-shadow","new-olg-container","tight","mt-1",3,"header"],["id","payment_deposit_label"],["id","payment_deposit_amount"],[1,"my-0.5"],["id","processed_today_label",1,"font-bold"],["id","today_total_amount_label"],["id","today_total_processed"],["id","today_deposit_label"],["id","today_deposit_amount"],["id","today_installment_label"],["id","today_installment_amount"],[1,"font-bold","mb-1"],[1,"grid","two-column","grid-setting"],[1,"icon-wizard_step_complete"],[1,"app-card-footer"],[1,"remainder"],[1,"flex","justify-content-center","flex-row-wrap"],["id","return_to_fund_btn","pButton","",1,"p-button",3,"click","label"],[1,"flex","flex-column",3,"formGroup"],[3,"username","redirectUrl"],[1,"flex","flex-column",3,"ngSubmit","formGroup"],[1,"mb-1"],["formControlName","password","label","LABEL.CREATE_PASSWORD","inputId","password","autocomplete","new-password",1,"flex-full-width",3,"minlength","required"],[1,"mb-1",3,"isLoading","disabled","contactType"],["buttonId","convert_account_button","buttonClasse
1s","w-full p-button-lg","label","LABEL.CONTINUE",3,"form","isLoading","disabled"],[1,"flex","justify-content-center","recaptcha-badge","pt-1"],["formControlName","passwordCaptcha","id","passwordCaptcha","size","invisible","badge","inline",3,"resolved","siteKey"],["translate","ERROR.PASSWORD_MIN_LENGTH"],["translate","ERROR.PASSWORD_BAD_FORMAT"],[1,"mb-1",3,"buttonClick","isLoading","disabled","contactType"],[3,"verifyFinished","username","redirectUrl"]],template:function(n,i){n&1&&(a(0,"div",3)(1,"app-card",4)(2,"div")(3,"div",5)(4,"div",6),h(5,"span",7),c(6,"translate"),r()(),h(7,"hr"),a(8,"div",8)(9,"div",9)(10,"i",10),u(11,"check_circle"),r()(),a(12,"div",11)(13,"div",12)(14,"h5",13),u(15),r()(),a(16,"div",14),u(17),r(),a(18,"div",15),u(19),r(),a(20,"div",16)(21,"div",17),u(22),c(23,"translate"),c(24,"givingFrequencies"),r(),p(25,ad,3,4,"div",17),p(26,rd,3,4,"div",17),r(),a(27,"div",16),p(28,sd,3,4,"div",17),p(29,ld,3,4,"div",17),p(30,dd,6,4,"div",18),r()(),a(31,"div",19)(32,"div",20)(33,"div",21),u(34),c(35,"translate"),r()(),p(36,cd,7,6,"div",20),a(37,"div",20)(38,"div",22),u(39),c(40,"translate"),r(),a(41,"div",23),u(42),c(43,"currency"),r()(),a(44,"div",24)(45,"div",25),u(46),c(47,"translate"),r(),a(48,"div",26),u(49),c(50,"currency"),r()(),p(51,ud,15,11,"div"),r()(),h(52,"hr"),p(53,gd,6,3,"div"),r(),M(54,hd,7,7,"ng-template",null,0,w),r(),p(56,Ed,4,4,"app-card",27),r()),n&2&&(o(5),g("innerHTML",f(6,22,"FINANCE.MESSAGES.PLEDGE_ACCEPTED"),Xe),o(10),v(i.fund.name),o(2),v(i.pledge.organizationName),o(2),q("",i.pledge.organizationAddress.city,", ",i.pledge.organizationAddress.state),o(3),q("",f(23,24,"FINANCE.LABELS.PLEDGE")," | ",f(24,26,i.pledge.frequency)),o(3),m(!i.pledge.depositConfirmation&&i.pledge.depositDate?25:-1),o(),m(i.pledge.installmentConfirmation?-1:26),o(2),m(i.pledge.installmentConfirmation?28:-1),o(),m(i.pledge.depositConfirmation?29:-1),o(),m(i.pledge.attributedToAssociatedOrganization?30:-1),o(4),v(f(35,28,"FINANCE.LABELS.YOUR_PLEDGE")),o(2),m(i.pledge.depositAmount?36:-1),o(3),A("",f(40,30,"FINANCE.LABELS.PLEDGE_INSTALLMENTS_LABEL"),": "),o(3),q("",i.installmentCount," x ",f(43,32,i.pledge.installmentAmount)),o(4),A("",f(47,34,"FINANCE.LABELS.PLEDGE_TOTAL_BREAKDOWN"),": "),o(3),v(f(50,36,i.pledge.totalAmount)),o(2),m(i.pledge.installmentConfirmation||i.pledge.depositConfirmation?51:-1),o(2),m(i.pledge.pledgeOptionQuestions.length>0?53:-1),o(3),m(i.showCreateAccountCard()?56:-1))},dependencies:[$,Z,ve,de,se,le,it,nt,be,Ce,_e,at,Se,ge,rt,Ee,We,De,He,Ge,st,ue,bt,G],styles:["#pledge_confirmation_card[_ngcontent-%COMP%], #create_account_card[_ngcontent-%COMP%]{max-width:60rem;width:100%}.success-icon[_ngcontent-%COMP%]{margin-right:1.5rem;font-size:5rem;color:var(--success-color)}.margin-top-half-rem[_ngcontent-%COMP%]{margin-top:.5rem}.pledge-summary[_ngcontent-%COMP%]{padding:1.5rem .5rem}@supports (container-type: inline-size){@container content-container (min-width: 600px){.pledge-info[_ngcontent-%COMP%]{width:23rem}}}@supports not (container: content-container){@media(min-width:600px){.pledge-info[_ngcontent-%COMP%]{width:23rem}}}.pledge-amounts[_ngcontent-%COMP%]{width:100%}@supports (container-type: inline-size){@container content-container (min-width: 600px){.pledge-amounts[_ngcontent-%COMP%]{width:16rem}}}@supports not (container: content-container){@media(min-width:600px){.pledge-amounts[_ngcontent-%COMP%]{width:16rem}}}#confirm_msg[_ngcontent-%COMP%]{padding:0 2rem}.remainder[_ngcontent-%COMP%]{padding-bottom:1rem;font-size:.875rem}.icon-wizard_step_complete[_ngcontent-%COMP%]{font-size:1rem;line-height:1;color:var(--success-color)}@supports (container-type: inline-size){@container content-container (min-width: 600px){.icon-wizard_step_complete[_ngcontent-%COMP%]{font-size:1.25rem}}}@supports not (container: content-container){@media(min-width:600px){.icon-wizard_step_complete[_ngcontent-%COMP%]{font-size:1.25rem}}}.grid-setting[_ngcontent-%COMP%]{gap:.5rem;width:fit-content;grid-template-columns:min-content auto}"]})}}return t})();var xo=(()=>{class t{constructor(e){this.publicFundsService=e}getDesignationName(e,n,i){if(n.designationOptions&&n.designationOptions.length>0){let s=n.designationOptions.find(_=>_.value===e);if(s)return s.label||""}if(i&&i.length>0){let s=i.find(_=>_.value===e);if(s)return s.label}return""}getDesignationAmount(e,n){if(!e||!n)return 0;let i=n.calculateInstallmentsByTotalAmount?n.totalAmount:n.installmentAmount;return!i||!e.percentage?0:i*e.percentage/100}isDesignationReady(e,n){if(!e.donorPledgeDesignations||e.donorPledgeDesignations.length===0)return!1;let i=e.designationOptions||n||[];return i.length===0?!1:e.donorPledgeDesignations.every(_=>_.designationId?i.some(D=>D.value===_.designationId):!1)}loadDesignations(e){return this.publicFundsService.getDesignations(e).pipe(Q(()=>K([])))}getBaseAmountForCalculations(e){return e.calculateInstallmentsByTotalAmount===!1?e.installmentAmount||0:e.totalAmount||0}getDisplayAmount(e){return this.getBaseAmountForCalculations(e)}getGeneralFundAmount(e){let n=this.getBaseAmountForCalculations(e),i=this.getTotalDesignationAmount(e);return Math.max(0,n-i)}getTotalDesignationAmount(e){return!e.donorPledgeDesignations||e.donorPledgeDesignations.length===0?0:e.donorPledgeDesignations.reduce((n,i)=>{let s=this.getDesignationAmount(i,e);return n+s},0)}recalculateDesignationAmounts(e){return e}getPledgeHash(e){let n={totalAmount:e.totalAmount,installmentAmount:e.installmentAmount,installmentCount:e.installmentCount,startDate:e.startDate,endD
1ate:e.endDate,frequency:e.frequency,designationCount:e.donorPledgeDesignations?.length||0,designationIds:e.donorPledgeDesignations?.map(i=>i.designationId).sort((i,s)=>i.localeCompare(s)).join(",")||"",designationAmounts:e.donorPledgeDesignations?.map(i=>this.getDesignationAmount(i,e)).sort((i,s)=>i-s).join(",")||"",totalAmountRounded:Math.round((e.totalAmount||0)*100)/100,installmentAmountRounded:Math.round((e.installmentAmount||0)*100)/100,designationAmountsRounded:e.donorPledgeDesignations?.map(i=>Math.round((this.getDesignationAmount(i,e)||0)*100)/100).sort((i,s)=>i-s).join(",")||"",calculateInstallmentsByTotalAmount:e.calculateInstallmentsByTotalAmount};return JSON.stringify(n)}hasPledgeChanged(e,n){return this.getPledgeHash(e)!==n}processDesignationOptions(e,n,i){let _=e.filter(D=>D.status==="Active").map(D=>({value:D.id,label:D.name})),C=L({},n);return n&&_.length>0&&(C.designationOptions=_),{designationOptions:_,updatedPledge:C}}shouldLoadDesignations(e,n,i){return e.donorPledgeDesignations&&e.donorPledgeDesignations.length>0&&n.length===0&&!!i}createExtendedPledge(e){return L({},e)}updatePledgeWithDesignationOptions(e,n){let i=L({},e);return i.designationOptions=n,i}static{this.\u0275fac=function(n){return new(n||t)(Ue(Ut))}}static{this.\u0275prov=pt({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Pd=()=>({size:2,offset:16}),Ui=(t,l)=>l.designationId;function Ad(t,l){if(t&1&&h(0,"advanced-image",4),t&2){let e=d(2);g("cldImg",e.cloudinary.fundImage(e.fund,Ie(1,Pd)))}}function xd(t,l){t&1&&(h(0,"app-lozenge",6),c(1,"translate")),t&2&&g("label",f(1,1,"FINANCE.LABELS.CREDIT_CARD_ONLY"))}function Td(t,l){t&1&&(h(0,"app-lozenge",7),c(1,"translate")),t&2&&g("label",f(1,1,"FINANCE.LABELS.BANK_ACCOUNT_ONLY"))}function Od(t,l){t&1&&(a(0,"span"),u(1,"*"),r())}function wd(t,l){if(t&1&&(a(0,"div"),u(1),c(2,"translate"),c(3,"date"),r()),t&2){let e=d(2);o(),q("",f(2,2,"FINANCE.LABELS.ENDING_ON"),": ",T(3,4,e.pledge.endDate,"MM/dd/yyyy"))}}function Nd(t,l){t&1&&(a(0,"div",11),u(1),c(2,"translate"),r()),t&2&&(o(),v(f(2,1,"FINANCE.MESSAGES.PLEDGE_INSTALLMENT_REMAINDER")))}function Md(t,l){if(t&1){let e=P();a(0,"div",12)(1,"a",15),y("click",function(){I(e);let i=d(2);return b(i.goToPledgeSetup())}),u(2),c(3,"translate"),r(),u(4," | "),a(5,"a",16),y("click",function(){I(e);let i=d(2);return b(i.goToFundList())}),u(6),c(7,"translate"),r()()}t&2&&(o(2),A(" ",f(3,2,"LABEL.EDIT")," "),o(4),A(" ",f(7,4,"LABEL.DELETE")," "))}function Dd(t,l){if(t&1&&(a(0,"div",19),u(1),r()),t&2){let e=d().$implicit,n=d(3);o(),v(n.getDesignationName(e.designationId))}}function Gd(t,l){if(t&1&&(a(0,"div"),p(1,Dd,2,1,"div",19),r()),t&2){let e=l.$implicit;o(),m(e.designationId&&e.percentage?1:-1)}}function Fd(t,l){if(t&1&&(a(0,"div"),u(1),c(2,"currency"),r()),t&2){let e=d().$implicit,n=d(3);o(),v(f(2,1,n.getDesignationAmount(e)))}}function Rd(t,l){if(t&1&&p(0,Fd,3,3,"div"),t&2){let e=l.$implicit;m(e.designationId&&e.percentage?0:-1)}}function Ld(t,l){if(t&1&&(a(0,"div",13)(1,"div",17),u(2),c(3,"translate"),r(),a(4,"div",18)(5,"div",10),Te(6,Gd,2,1,"div",null,Ui),a(8,"div")(9,"div",19),u(10),c(11,"translate"),r()()(),a(12,"div",20),Te(13,Rd,1,1,null,null,Ui),a(15,"div"),u(16),c(17,"currency"),r()()()()),t&2){let e=d(2);o(2),v(f(3,3,"LABEL.DESIGNATIONS")),o(4),Oe(e.pledge.donorPledgeDesignations),o(4),v(f(11,5,"LABEL.PLEDGE_GENERAL_FUND")),o(3),Oe(e.pledge.donorPledgeDesignations),o(3),v(f(17,7,e.getGeneralFundAmount()))}}function Vd(t,l){if(t&1&&(a(0,"div",14),h(1,"p-divider"),a(2,"div",21)(3,"div",10)(4,"div",22),u(5),c(6,"translate"),r(),a(7,"div"),u(8),c(9,"translate"),r(),a(10,"div"),u(11),c(12,"translate"),r()(),a(13,"div",20)(14,"div",23),u(15),c(16,"currency"),r(),a(17,"div",24),u(18),c(19,"currency"),r(),a(20,"div",25),u(21),c(22,"currency"),r()()()()),t&2){let e=d(2);o(5),A("",f(6,6,"FINANCE.LABELS.PLEDGE_TOTAL_BREAKDOWN"),":"),o(3),A("",f(9,8,"FINANCE.LABELS.DEPOSIT"),":"),o(3),A("",f(12,10,"FINANCE.LABELS.PLEDGE_BALANCE"),":"),o(4),v(f(16,12,e.getDisplayAmount())),o(3),v(f(19,14,e.pledge.depositAmount||0)),o(3),v(f(22,16,e.getDisplayAmount()-e.pledge.depositAmount||0))}}function Bd(t,l){if(t&1&&(a(0,"app-card",0)(1,"div",2)(2,"div",3),p(3,Ad,1,2,"advanced-image",4),a(4,"div",5),u(5),r(),p(6,xd,2,3,"app-lozenge",6),p(7,Td,2,3,"app-lozenge",7),a(8,"div",8)(9,"h5"),u(10),c(11,"translate"),r(),a(12,"h5"),u(13),c(14,"currency"),r()(),a(15,"div",9)(16,"div",10)(17,"div"),u(18),c(19,"translate"),c(20,"givingFrequencies"),r(),a(21,"div"),u(22),c(23,"currency"),p(24,Od,2,0,"span"),r(),a(25,"div"),u(26),c(27,"translate"),c(28,"date"),r(),p(29,wd,4,7,"div"),p(30,Nd,3,3,"div",11),r(),p(31,Md,8,6,"div",12),r()(),p(32,Ld,18,9,"div",13),p(33,Vd,23,18,"div",14),r()()),t&2){let e=d();o(3),m(e.isMobile?-1:3),o(2),v(e.fund.name),o(),m(e.fund.acceptsCreditCard&&!e.fund.acceptsAch?6:-1),o(),m(e.fund.acceptsAch&&!e.fund.acceptsCreditCard?7:-1),o(3),v(f(11,18,"FINANCE.LABELS.YOUR_PLEDGE")),o(3),v(f(14,20,e.getDisplayAmount())),o(5),q("",f(19,22,"FINANCE.LABELS.PLEDGE")," | ",f(20,24,e.pledge.frequency)," "),o(4),q("",e.pledge.
1installmentCount||0," x ",f(23,26,e.pledge.installmentAmount||0)),o(2),m(e.showStar?24:-1),o(2),q("",f(27,28,"FINANCE.LABELS.STARTING_ON"),": ",T(28,30,e.pledge.startDate,"MM/dd/yyyy")),o(3),m(e.pledge.frequency!=="oneTime"?29:-1),o(),m(e.showStar?30:-1),o(),m(e.showNavigationLinks?31:-1),o(),m(e.pledge.donorPledgeDesignations&&e.pledge.donorPledgeDesignations.length>0&&e.isDesignationReady()?32:-1),o(),m(e.pledge.includesDeposit?33:-1)}}function Ud(t,l){t&1&&(a(0,"span"),u(1,"*"),r())}function kd(t,l){if(t&1&&(a(0,"div"),u(1),c(2,"translate"),c(3,"date"),r()),t&2){let e=d(2);o(),q("",f(2,2,"FINANCE.LABELS.PLEDGE_LAST_INSTALLMENT"),": ",T(3,4,e.pledge.endDate,"MM/dd/yyyy"))}}function zd(t,l){t&1&&(a(0,"div",28),u(1),c(2,"translate"),r()),t&2&&(o(),v(f(2,1,"FINANCE.MESSAGES.PLEDGE_INSTALLMENT_REMAINDER")))}function qd(t,l){if(t&1){let e=P();a(0,"div",12)(1,"a",15),y("click",function(){I(e);let i=d(2);return b(i.goToPledgeSetup())}),u(2),c(3,"translate"),r(),u(4," | "),a(5,"a",16),y("click",function(){I(e);let i=d(2);return b(i.goToFundList())}),u(6),c(7,"translate"),r()()}t&2&&(o(2),A(" ",f(3,2,"LABEL.EDIT")," "),o(4),A(" ",f(7,4,"LABEL.DELETE")," "))}function jd(t,l){if(t&1&&(a(0,"div"),u(1),r()),t&2){let e=d().$implicit,n=d(3);o(),A("",n.getDesignationName(e.designationId),":")}}function Wd(t,l){if(t&1&&(a(0,"div"),p(1,jd,2,1,"div"),r()),t&2){let e=l.$implicit;o(),m(e.designationId&&e.percentage?1:-1)}}function Hd(t,l){if(t&1&&(a(0,"div"),u(1),c(2,"currency"),r()),t&2){let e=d().$implicit,n=d(3);o(),v(f(2,1,n.getDesignationAmount(e)))}}function Yd(t,l){if(t&1&&p(0,Hd,3,3,"div"),t&2){let e=l.$implicit;m(e.designationId&&e.percentage?0:-1)}}function Qd(t,l){if(t&1&&(a(0,"div",13)(1,"div",30),u(2),c(3,"translate"),r(),a(4,"div",18)(5,"div",10),Te(6,Wd,2,1,"div",null,Ui),a(8,"div",31)(9,"div"),u(10),c(11,"translate"),r()()(),a(12,"div",20),Te(13,Yd,1,1,null,null,Ui),a(15,"div"),u(16),c(17,"currency"),r()()()()),t&2){let e=d(2);o(2),v(f(3,3,"LABEL.DESIGNATIONS")),o(4),Oe(e.pledge.donorPledgeDesignations),o(4),A("",f(11,5,"LABEL.PLEDGE_GENERAL_FUND"),":"),o(3),Oe(e.pledge.donorPledgeDesignations),o(3),v(f(17,7,e.getGeneralFundAmount()))}}function $d(t,l){if(t&1&&(a(0,"div",29),h(1,"p-divider"),a(2,"div",18)(3,"div",10)(4,"div",22),u(5),c(6,"translate"),r(),a(7,"div"),u(8),c(9,"translate"),r(),a(10,"div"),u(11),c(12,"translate"),r()(),a(13,"div",20)(14,"div",23),u(15),c(16,"currency"),r(),a(17,"div",24),u(18),c(19,"currency"),r(),a(20,"div",25),u(21),c(22,"currency"),r()()()()),t&2){let e=d(2);o(5),A("",f(6,6,"FINANCE.LABELS.PLEDGE_TOTAL_BREAKDOWN"),":"),o(3),A("",f(9,8,"FINANCE.LABELS.PLEDGE_DEPOSIT_AMOUNT"),":"),o(3),A("",f(12,10,"FINANCE.LABELS.PLEDGE_BALANCE"),":"),o(4),v(f(16,12,e.getDisplayAmount())),o(3),v(f(19,14,e.pledge.depositAmount||0)),o(3),v(f(22,16,e.getDisplayAmount()-e.pledge.depositAmount||0))}}function Kd(t,l){if(t&1&&(a(0,"div",1)(1,"div",3)(2,"div",26)(3,"h6",27),u(4),c(5,"translate"),r(),a(6,"h6"),u(7),c(8,"currency"),r()(),a(9,"div",18)(10,"div",10)(11,"div"),u(12),c(13,"givingFrequencies"),c(14,"translate"),r(),a(15,"div"),u(16),c(17,"currency"),p(18,Ud,2,0,"span"),r(),a(19,"div"),u(20),c(21,"translate"),c(22,"date"),r(),p(23,kd,4,7,"div"),p(24,zd,3,3,"div",28),r(),p(25,qd,8,6,"div",12),r()(),p(26,Qd,18,9,"div",13),p(27,$d,23,18,"div",29),r()),t&2){let e=d();o(4),v(f(5,14,"FINANCE.LABELS.YOUR_PLEDGE")),o(3),v(f(8,16,e.getDisplayAmount())),o(5),q("",f(13,18,e.pledge.frequency)," ",f(14,20,"FINANCE.LABELS.PLEDGE")),o(4),q("",e.pledge.installmentCount||0," x ",f(17,22,e.pledge.installmentAmount||0)),o(2),m(e.showStar?18:-1),o(2),q("",f(21,24,"FINANCE.LABELS.PLEDGE_FIRST_INSTALLMENT"),": ",T(22,26,e.pledge.startDate,"MM/dd/yyyy")),o(3),m(e.pledge.frequency!=="oneTime"?23:-1),o(),m(e.showStar?24:-1),o(),m(e.showNavigationLinks?25:-1),o(),m(e.pledge.donorPledgeDesignations&&e.pledge.donorPledgeDesignations.length>0&&e.isDesignationReady()?26:-1),o(),m(e.pledge.includesDeposit?27:-1)}}var lt=(()=>{class t{constructor(){this.isMobile=!1,this.showNavigationLinks=!1,this.showStar=!1,this.designationOptions=[],this.pledge={},this.lastPledgeHash="",this.cdr=E(ri),this.cloudinary=E(Ct),this.destroyRef=E(J),this.myPledgeSvc=E(ye),this.pledgeSummaryCardService=E(xo),this.publicLinkSvc=E(ie),this.route=E(U),this.router=E(ee)}
1ngOnInit(){this.fund=this.route.snapshot.parent.parent.data.fund,this.myPledgeSvc.pledge.pipe(N(this.destroyRef)).subscribe(e=>{e&&this.pledgeSummaryCardService.hasPledgeChanged(e,this.lastPledgeHash)&&(this.lastPledgeHash=this.pledgeSummaryCardService.getPledgeHash(e),this.pledge=this.pledgeSummaryCardService.createExtendedPledge(e),this.pledge.designationOptions&&this.pledge.designationOptions.length>0?this.designationOptions=this.pledge.designationOptions:this.pledgeSummaryCardService.shouldLoadDesignations(this.pledge,this.designationOptions,this.fund?.id||"")&&this.loadDesignations(this.fund.id),this.pledge=this.pledgeSummaryCardService.recalculateDesignationAmounts(this.pledge),this.cdr.detectChanges())})}getDesignationName(e){return this.pledgeSummaryCardService.getDesignationName(e,this.pledge,this.designationOptions)}getDisplayAmount(){return this.pledgeSummaryCardService.getDisplayAmount(this.pledge)}getGeneralFundAmount(){return this.pledgeSummaryCardService.getGeneralFundAmount(this.pledge)}getDesignationAmount(e){return this.pledgeSummaryCardService.getDesignationAmount(e,this.pledge)}goToFundList(){this.myPledgeSvc.clearPledge(),this.router.navigate(this.publicLinkSvc.fundList())}goToPledgeSetup(){this.router.navigate(this.publicLinkSvc.pledgeSetup(this.fund.url))}isDesignationReady(){return this.pledgeSummaryCardService.isDesignationReady(this.pledge,this.designationOptions)}loadDesignations(e){this.pledgeSummaryCardService.loadDesignations(e).subscribe(n=>{let i=this.pledgeSummaryCardService.processDesignationOptions(n,this.pledge,this.designationOptions);if(this.designationOptions=i.designationOptions,this.pledge=i.updatedPledge,this.pledge&&this.designationOptions.length>0){let s=this.pledgeSummaryCardService.updatePledgeWithDesignationOptions(this.pledge,this.designationOptions);this.myPledgeSvc.changePledge(s)}this.cdr.detectChanges()})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=O({type:t,selectors:[["app-pledge-summary-card"]],inputs:{isMobile:"isMobile",showNavigationLinks:"showNavigationLinks",showStar:"showStar"},decls:2,vars:1,consts:[["id","pledge_review_card",1,"h-auto"],["id","pledge_review_mobile_card",1,"infobox"],["id","pledge_container"],[1,"flex","flex-column","flex-full-width"],[1,"fund-image","img:max-w-full",3,"cldImg"],[1,"p-card-subtitle"],["icon","credit_card","palette","blue",1,"flex","mt-0.5",3,"label"],["icon","account_balance","palette","blue",1,"flex","mt-0.5",3,"label"],[1,"flex","justify-content-space-between","mt-1.5"],[1,"flex","justify-content-space-between","mt-0.25"],[1,"flex-column"],[1,"font-size-sm","pt-1"],[1,"link"],[1,"mt-1"],["id","deposit_container"],[1,"pledge-edit","text-clickable","primary-color",3,"click"],[1,"pledge-delete","text-clickable","primary-color",3,"click"],[1,"font-size-sm","font-weight-semibold","secondary-color","font-bold","mb-0.5"],[1,"flex","justify-content-space-between"],[1,"truncate-text","max-w-12"],[1,"flex-column","text-right"],[1,"flex","justify-content-space-between","infobox"],[1,"font-bold"],[1,"pledge-total","font-bold"],[1,"pledge-deposit"],[1,"pledge-balance"],[1,"header-text","flex","justify-content-space-between","font-bold"],[1,"truncate-text"],[1,"font-size-sm"],["id","deposit_container_mobile"],[1,"font-size-sm","font-weight-semibold","secondary-color","mb-1"],[1,"mt-0.5"]],template:function(n,i){n&1&&p(0,Bd,34,33,"app-card",0)(1,Kd,28,29,"div",1),n&2&&m(i.isMobile?1:0)},dependencies:[$,yt,St,Vt,bi,Ii,ue,ze,bt,G],styles:["[_nghost-%COMP%]{position:sticky}#pledge_review_card[_ngcontent-%COMP%]{position:sticky;top:calc(var(--hub_public_menu_height) + 1rem)}"]})}}return t})();var Xd=["captchaRef"],Jd=["paymentInfoForm"],Zd=["paymentMethodInput"],ec=["otpRegistrationRef"],tc=()=>({standalone:!0}),ic=t=>({contributionType:t}),nc=t=>({contactType:t});function oc(t,l){if(t&1){let e=P();a(0,"div",9)(1,"div",19)(2,"p-checkbox",20),Be("ngModelChange",function(i){I(e);let s=d();return Ve(s.saveContributionMethod,i)||(s.saveContributionMethod=i),b(i)}),y("onChange",function(){I(e);let i=d();return b(i.onSaveContributionMethodChanged())}),r(),a(3,"label",21),u(4),c(5,"translate"),r()()()}if(t&2){let e=d();o(2),Le("ngModel",e.saveContributionMethod),g("ngModelOptions",Ie(6,tc))("binary",!0),o(2),v(f(5,4,"LABEL.SAVE_THIS_CONTRIBUTION_METHOD"))}}function ac(t,l){t&1&&h(0,"span",28)}function rc(t,l){t&1&&h(0,"span",29)}function sc(t,l){if(t&1&&(p(0,ac,1,0,"span",28),p(1,rc,1,0,"span",29)),t&2){d();let e=ae(9);m(e.errors&&e.errors.minlength&&e.touched?0:-1),o(),m(e.errors&&!e.errors.minlength&&e.errors.pattern&&e.touched?1:-1)}}function lc(t,l){if(t&1){let e=P();a(0,"app-contact-otp-code-button",30),y("buttonClick",function(){I(e);let i=d(3);return b(i.sendContactOtp())}),u(1),c(2,"translate"),c(3,"translate"),r()}if(t&2){let e=d(3),n=ae(1);g("isLoading",e.isSendingOtp())("contactType",e.getContactType())("disabled",n.value.password),o(),A(" ",T(3,6,"MESSAGE.WE_CAN_SEND_A_CODE",R(9,nc,f(2,4,e.getContactTypeTranslationKey())))," ")}}function dc(t,l){if(t&1){let e=P();a(0,"div",23)(1,"div",24),u(2),c(3,"translate"),r(),a(4,"div",25),u(5),c(6,"translate"),c(7,"translate"),r()(),a(8,"app-password-input",26,3),Be("ngModelChange",function(i){I(e);let s=d(2);return Ve(s.guestPledgeSubmission.password,i)||(s.guestPledgeSubmission.password=i),b(i)}),M(10,sc,2,2,"ng-template",null,4,w),r(),p(12,lc,4,11,"app-contact-otp-code-button",27)}if(t&2){let e=d(2);o(2),A(" ",f(3,7,"LABEL.CREATE_AN_ACCOUNT_FOR_FUTURE_GIFT")," "),o(3),A(" ",T(7,11,"MESSAGE.NEXT_TIME_SIGN_IN",R(14,ic,f(6,9,"WORD.PLEDGES")))," "),o(3),Le("ngModel",e.guestPledgeSubmission.password),g("minlength",7)("pattern",e.passwordPattern)("required",e.guestPledgeSubmission.createCredentialedUser&&!e.isValidatingOtp()),o(4),m(e.dis
1playContactOtpOption?12:-1)}}function cc(t,l){if(t&1){let e=P();a(0,"app-contact-otp-registration",31,5),y("verifyFinished",function(i){I(e);let s=d(2);return b(i?s.onOtpRegistrationSucceeded():s.onOtpRegistrationFailed())}),r()}if(t&2){let e=d(2);g("hideCreateAccountButton",!0)("username",e.guestPledgeSubmission.email??e.guestPledgeSubmission.phone)}}function pc(t,l){if(t&1&&(a(0,"div",10),p(1,dc,13,16)(2,cc,2,2,"app-contact-otp-registration",22),r()),t&2){let e=d();o(),m(e.isValidatingOtp()?2:1)}}function mc(t,l){if(t&1){let e=P();a(0,"app-textarea",32),Be("ngModelChange",function(i){I(e);let s=d();return Ve(s.guestPledgeSubmission.pledge.note,i)||(s.guestPledgeSubmission.pledge.note=i),b(i)}),r()}if(t&2){let e=d();Le("ngModel",e.guestPledgeSubmission.pledge.note),g("maxlength",1e3)("label",e.noteLabel)("placeholder",e.notePlaceholder)}}function uc(t,l){if(t&1&&(a(0,"div",12),h(1,"app-pledge-summary-card",33),r()),t&2){let e=d();o(),g("isMobile",e.isMobile)("showStar",e.showStar)}}function fc(t,l){if(t&1&&(a(0,"div",14)(1,"i",34),u(2,"error"),r(),a(3,"span"),u(4),c(5,"translate"),r()()),t&2){let e=d();o(4),q("",f(5,2,e.errorTitle?e.errorTitle:"ERROR.PROCESSING_GIFT"),": ",e.errorMsg)}}var To=(()=>{class t{get showPaymentProcessing(){return this._showPaymentProcessing}set showPaymentProcessing(e){this._showPaymentProcessing=e,this.showPaymentProcessingChanged.emit(e)}constructor(e,n,i,s,_,C,D,X,re,Re,Ke,Ht,Tt,Lo){this.activePublicTenantSvc=e,this.configSvc=n,this.myPledgeSvc=i,this.notifySvc=s,this.paymentMethodUtilitySvc=_,this.pledgeService=C,this.publicSvc=D,this.publicLoginSvc=X,this.route=re,this.router=Re,this.translate=Ke,this.themeColorsSvc=Ht,this.userPaymentMethodSvc=Tt,this.pwaGiftSubmitTelemetry=Lo,this.isLoginRequired=!1,this.showStar=!1,this.isMobile=!1,this.backClicked=new ne,this.showPaymentProcessingChanged=new ne,this.isNuveiMerchant=!1,this.passwordPattern=k.PASSWORD_REQUIREMENT,this.accountAlreadyCreated=!1,this.giftProcessed=0,this.isInNuveiVault=!1,this.displayContactOtpOption=!1,this.useOtp=!1,this.saveContributionMethod=!1,this.isSendingOtp=B(!1),this.isValidatingOtp=B(!1),this.shouldSaveToWallet=!1,this._showPaymentProcessing=!1,this.publicIframeInputColor=this.themeColorsSvc.primary500}ngOnInit(){let e=this.activePublicTenantSvc.getActiveTenant();this.displayContactOtpOption=e?.enableEmailOtpForLogin===!0,this.reCaptchaSiteKey=this.configSvc.get("reCaptchaSiteKey"),this.fund=ce.getParentSnapshotData("fund",this.route.snapshot),this.organization=ce.getParentSnapshotData("organization",this.route.snapshot),this.isNuveiMerchant=this.organization.merchantsInfo.some(n=>n.merchantId===this.fund.merchantId&&n.provider.toUpperCase()==="NUVEI"),this.address={line1:this.guestPledgeSubmission.address1??"",line2:this.guestPledgeSubmission.address2??"",city:this.guestPledgeSubmission.city??"",state:this.guestPledgeSubmission.state??"",zip:this.guestPledgeSubmission.zip??""},this.initNote()}onSaleResult(e){this.pwaGiftSubmitTelemetry.logStep("pledge_guest.sale_result",{approvalIndicator:e.approvalIndicator??"",saleApproved:String(e.approvalIndicator==="A"||e.approvalIndicator==="P")}),e.approvalIndicator==="A"||e.approvalIndicator==="P"?(this.paymentServicesId||(this.paymentServicesId=e.paymentServicesId),this.isInNuveiVault=e.isInNuveiVault??!1):this.handleError("ERROR.CREATING_PLEDGE",e.friendlyDescription),this.giftProcessed++,this.navigate()}onTokenizeResult(e){this.paymentServicesId||(this.paymentServicesId=e.id),this.isInNuveiVault=e?.isInNuveiVault??!1,this.giftProcessed++,this.navigate()}onGooglePayMetadata(e){e?.paymentMethod&&(this.guestPledgeSubmission.googlePayMetadata=e,this.guestPledgeSubmission.paymentMethodInfo=this.guestPledgeSubmission.paymentMethodInfo||{},this.guestPledgeSubmission.paymentMethodInfo.lastFour=e.cardLastFour,this.guestPledgeSubmission.paymentMethodInfo.accountType=e.cardNetwork??"")}onApplePayMetadata(e){e?.paymentMethod&&(this.guestPledgeSubmission.applePayMetadata=e,this.guestPledgeSubmission.paymentMethodInfo=this.guestPledgeSubmission.paymentMethodInfo||{},this.guestPledgeSubmission.paymentMethodInfo.lastFour=e.cardLastFour,this.guestPledgeSubmission.paymentMethodInfo.accountType=e.cardNetwork??"")}validateCustomFormElements(){return this.paymentMethodInput.validatePaymentMethod()}onSaveContributionMethodChanged(){this.isLoginRequired||(this.guestPledgeSubmission.createCredentialedUser=this.saveContributionMethod,this.saveContributionMethod||(this.guestPledgeSubmission.password=null,this.useOtp=!1,this.isValidatingOtp.set(!1))),this.shouldSaveToWallet=!1}onSubmit(){this.pwaGiftSubmitTelemetry.logStep("pledge_guest.onSubmit",{tenant:this.guestPledgeSubmission?.pledge?.organizationTenant??"",isValidatingOtp:String(this.isValidatingOtp())}
1),this.isValidatingOtp()&&!this.accountAlreadyCreated?(this.showPaymentProcessing=!0,this.otpRegistrationRef.confirmRegistration()):this.captchaRef.execute()}buildCreateUserCommand(){return{email:this.guestPledgeSubmission.email,password:null,firstName:this.guestPledgeSubmission.firstName,lastName:this.guestPledgeSubmission.lastName,phone:this.guestPledgeSubmission.phone,address:{line1:this.guestPledgeSubmission.address1,line2:this.guestPledgeSubmission.address2,city:this.guestPledgeSubmission.city,state:this.guestPledgeSubmission.state,zip:this.guestPledgeSubmission.zip},recaptcha:"",enableMfa:!1}}sendContactOtp(){let e=this.buildCreateUserCommand(),n=e.email??e.phone;if(!n)return;this.isSendingOtp.set(!0);let i={contact:n,firstName:e.firstName,lastName:e.lastName,address:e.address};this.publicSvc.sendContactRegistrationOtp(i).pipe(F(()=>{this.isValidatingOtp.set(!0)}),Q(s=>(this.notifySvc.errorBanner({title:"LABEL.ERROR",message:this.getUnknownErrorMessage(s)}),K(null))),xe(()=>{this.isSendingOtp.set(!1)})).subscribe()}isOtpRegistrationValid(){return this.isValidatingOtp()?this.otpRegistrationRef?.isValid()??!1:!0}onOtpRegistrationSucceeded(){this.accountAlreadyCreated=!0,this.shouldSaveToWallet=this.saveContributionMethod,this.isValidatingOtp.set(!1),this.guestPledgeSubmission.createCredentialedUser=!1,this.captchaRef.execute()}onOtpRegistrationFailed(){this.showPaymentProcessing=!1}createGiftSubmission(){this.pwaGiftSubmitTelemetry.startCorrelation("pledge_guest"),this.pwaGiftSubmitTelemetry.logStep("pledge_guest.createGiftSubmission_enter",{formValid:String(this.paymentInfoForm.valid)}),this.paymentInfoForm.valid?(this.showPaymentProcessing=!0,this.guestPledgeSubmission.skipConfirmationEmail=!1,this.guestPledgeSubmission.pledge.note=this.paymentInfoForm.controls.note?.value,this.guestPledgeSubmission.address1=this.address.line1,this.guestPledgeSubmission.address2=this.address.line2,this.guestPledgeSubmission.city=this.address.city,this.guestPledgeSubmission.state=this.address.state,this.guestPledgeSubmission.zip=this.address.zip,this.pledgeService.createPledgeForGuest(this.guestPledgeSubmission).pipe(F(e=>{this.myPledgeSvc.setGuestPledgeSubmission(this.guestPledgeSubmission),this.giftResults=e.giftResults,this.pledgeId=e.id,this.convertUserToken=this.giftResults.filter(i=>i.convertUserToken!==null).map(i=>i.convertUserToken)[0],this.pwaGiftSubmitTelemetry.logStep("pledge_guest.createPledge_http_next",{pledgeId:this.pledgeId??"",giftResultCount:String(this.giftResults?.length??0)});let n=!1;for(let i of this.giftResults)n&&!i.transactionID?this.giftProcessed++:(this.pwaGiftSubmitTelemetry.logStep("pledge_guest.handlePayment_start",{hasTransactionId:String(!!i.transactionID),amount:String(i.amount??"")}),this.paymentMethodInput.handlePayment(this.getPSSaleRequest(i.amount,i.transactionID,i.callbackURL)),n=!0)}),Q(e=>{if(this.pwaGiftSubmitTelemetry.logError("pledge_guest.error",e),ft(e))this.accountAlreadyCreated=!0,this.guestPledgeSubmission.createCredentialedUser=!1,this.showPaymentProcessing=!1,this.captchaRef?.reset(),this.notifySvc.toast({title:"MESSAGE.ACCOUNT_ALREADY_EXISTS",severity:"warn"});else{let n=this.getUnknownErrorMessage(e);this.handleError("ERROR.CREATING_PLEDGE",n||this.translate.instant("FINANCE.ERRORS.CONTACT_SUPPORT"))}return K(null)})).subscribe()):this.captchaRef&&this.captchaRef.reset()}canSubmitForm(){return this.organization.products.find(e=>e.name===ut.OnlineGiving).status==="Live"}getTooltipMessage(){if(!this.canSubmitForm())return this.translate.instant("FINANCE.MESSAGES.GIFTS_DISABLED_ONBOARDING")}createCredentialedUser(){let e=this.giftResults.map(C=>C.giftId),n=this.useOtp||!this.guestPledgeSubmission.password,i=this.guestPledgeSubmission.email?.trim(),s=this.guestPledgeSubmission.phone?.trim(),_=pe(L(L({},i?{email:i}:{}),s?{phone:s}:{}),{password:this.guestPledgeSubmission.password,convertUserToken:this.convertUserToken,giftIds:e});(this.isLoginRequired||this.saveContributionMethod||this.shouldSaveToWallet)&&(this.guestPledgeSubmission.googlePayMetadata?_.googlePayPaymentDetails={paymentServicesId:this.paymentServicesId,lastFour:this.guestPledgeSubmission.paymentMethodInfo.lastFour,cardNetwork
1Raw:this.guestPledgeSubmission.paymentMethodInfo.accountType,isInNuveiVault:this.isInNuveiVault}:this.guestPledgeSubmission.applePayMetadata?_.applePayPaymentDetails={paymentServicesId:this.paymentServicesId,lastFour:this.guestPledgeSubmission.paymentMethodInfo.lastFour,cardNetworkRaw:this.guestPledgeSubmission.paymentMethodInfo.accountType,isInNuveiVault:this.isInNuveiVault}:this.paymentMethodUtilitySvc.isAch(this.guestPledgeSubmission.paymentMethodInfo.accountType)?_.achPaymentDetails={paymentServicesId:this.paymentServicesId,routingNumber:this.guestPledgeSubmission.paymentMethodInfo.routingNumber,lastFour:this.guestPledgeSubmission.paymentMethodInfo.lastFour,paymentType:this.guestPledgeSubmission.paymentMethodInfo.accountType,isInNuveiVault:this.isInNuveiVault}:this.paymentMethodUtilitySvc.isCc(this.guestPledgeSubmission.paymentMethodInfo.accountType)&&(_.cCPaymentDetails={paymentServicesId:this.paymentServicesId,bin:this.guestPledgeSubmission.paymentMethodInfo.bin,cardholderName:this.guestPledgeSubmission.paymentMethodInfo.cardholderName,lastFour:this.guestPledgeSubmission.paymentMethodInfo.lastFour,expirationMonth:this.guestPledgeSubmission.paymentMethodInfo.expirationMonth,expirationYear:this.guestPledgeSubmission.paymentMethodInfo.expirationYear,paymentType:this.guestPledgeSubmission.paymentMethodInfo.accountType,isInNuveiVault:this.isInNuveiVault})),this.publicSvc.convertUser(_).subscribe({next:()=>{this.accountAlreadyCreated=!0,n?this.navigate():this.loginAndNavigateToConfirmation()},error:C=>{this.accountAlreadyCreated=!0,dn(C)?!n&&this.guestPledgeSubmission.password?this.loginAndNavigateToConfirmation():(this.showPaymentProcessing=!1,this.navigateToConfirmation()):(this.showPaymentProcessing=!1,this.notifySvc.errorBanner({title:"ERROR.CREATING_ACCOUNT",message:"ERROR.CONVERTING_USER"}),this.navigateToConfirmation())}})}getPSSaleRequest(e,n,i){return{merchantId:this.fund.merchantId,orderNumber:n,transactionID:n,amount:Number(e),cardholderName:this.guestPledgeSubmission.paymentMethodInfo.cardholderName,email:this.guestPledgeSubmission.email,address1:this.address.line1,address2:this.address.line2,city:this.address.city,state:this.address.state,zip:this.address.zip,country:"",expirationMonth:this.guestPledgeSubmission.paymentMethodInfo.expirationMonth,expirationYear:this.guestPledgeSubmission.paymentMethodInfo.expirationYear,webhook:i,callbackURL:i,saveToWallet:this.isLoginRequired||this.saveContributionMethod||this.shouldSaveToWallet,validateCvv:!0,firstName:this.guestPledgeSubmission.firstName,lastName:this.guestPledgeSubmission.lastName,type:this.guestPledgeSubmission.paymentMethodInfo.bankAccountType,paymentType:this.guestPledgeSubmission.paymentMethodInfo.accountType,routingNumber:this.guestPledgeSubmission.paymentMethodInfo.routingNumber}}loginAndNavigateToConfirmation(){let e=this.guestPledgeSubmission.email??this.guestPledgeSubmission.phone;this.publicLoginSvc.login(e,this.guestPledgeSubmission.password).then(()=>{this.navigateToConfirmation()}).catch(()=>{this.navigateToConfirmation()})}handleError(e,n){this.showPaymentProcessing=!1,this.errorTitle=e,this.errorMsg=n,this.captchaRef&&this.captchaRef.reset()}getUnknownErrorMessage(e){return e instanceof Error?e.message:typeof e=="string"?e:e!=null&&typeof e=="object"&&"message"in e&&typeof e.message=="string"?e.message:e==null?this.translate.instant("ERROR.UNKNOWN_ERROR"):JSON.stringify(e)}initNote(){this.fundNotesEnabled=this.fund?.notesEnabled,this.noteLabel=this.fund?.notesLabel,this.notePlaceholder=this.fund?.notesPlaceholder}navigate(){this.giftResults.length===this.giftProcessed&&(this.convertUserToken&&!this.accountAlreadyCreated?this.createCredentialedUser():this.shouldSaveToWallet&&this.paymentServicesId?(this.shouldSaveToWallet=!1,this.savePaymentMethodToWallet()):(this.showPaymentProcessing=!1,this.navigateToConfirmation()))}navigateToConfirmation(){this.fund.isParentFund?this.router.navigateByUrl(`${this.organization.tenantId}/funds/${this.fund.orgTenantId}/${this.fund.url}/pledge/${this.pledgeId}/confirmation`):this.router.navigateByUrl(`${this.organization.tenantId}/funds/${this.fund.url}/pledge/${this.pledgeId}/confirmation`)}savePaymentMethodToWallet(){let e=this.guestPledgeSubmission.paymentMethodInfo;if(this.paymentMethodUtilitySvc.isCc(e.accountType)){let n={bin:e.bin,cardHolderName:e.cardholderName,cardNumberLastFour:e.lastFour,cardType:e.accountType,expirationMonth:Number(e.expirationMonth),expirationYear:Number(e.expirationYear),paymentServicesId:this.paymentServicesId};this.userPaymentMethodSvc.addCreditCard(n).subscribe({next:()=>{this.showPaymentProcessing=!1,this.navigateToConfirmation()},error:()=>{this.notifySvc.errorBanner({title:"ERROR.ADDING_NEW_CREDIT_CARD",message:"ERROR.SAVING_PAYMENT_METHOD"}),this.showPaymentProcessing=!1,this.navigateToConfirmation()}})}else if(this.paymentMethodUtilitySvc.isAch(e.accountType)){let n={lastFour:e.lastFour,routingNumber:e.routingNumber,paymentServicesId:this.paymentServicesId,accountType:e.accountType};this.userPaymentMethodSvc.addBankAccount(n).subscribe({next:()=>{this.showPaymentProcessing=!1,this.navigateToConfirmation()},error:()=>{this.notifySvc.errorBanner({title:"ERROR.ADDING_NEW_BANK_ACCOUNT",message:"ERROR.SAVING_PAYMENT_METHOD"}),this.showPaymentProcessing=!1,this.navigateToConfirmation()}})}else this.showPaymentProcessing=!1,this.navigateToConfirmation()}
1getContactType(){if(this.guestPledgeSubmission.email)return k.CONTACT_TYPE.EMAIL;if(this.guestPledgeSubmission.phone)return k.CONTACT_TYPE.PHONE}getContactTypeTranslationKey(){if(this.guestPledgeSubmission.email)return"WORD.EMAIL";if(this.guestPledgeSubmission.phone)return"WORD.PHONE"}static{this.\u0275fac=function(n){return new(n||t)(S(fe),S(we),S(ye),S(te),S(wt),S(Ti),S(Ye),S(Me),S(U),S(ee),S(oe),S(Mt),S(Ft),S(Nt))}}static{this.\u0275cmp=O({type:t,selectors:[["app-pledge-guest-gift-payment-info"]],viewQuery:function(n,i){if(n&1&&me(Xd,5)(Jd,7)(Zd,5)(ec,5),n&2){let s;W(s=H())&&(i.captchaRef=s.first),W(s=H())&&(i.paymentInfoForm=s.first),W(s=H())&&(i.paymentMethodInput=s.first),W(s=H())&&(i.otpRegistrationRef=s.first)}},inputs:{guestPledgeSubmission:"guestPledgeSubmission",isLoginRequired:"isLoginRequired",showStar:"showStar",isMobile:"isMobile"},outputs:{backClicked:"backClicked",showPaymentProcessingChanged:"showPaymentProcessingChanged"},decls:18,vars:29,consts:[["paymentInfoForm","ngForm"],["paymentMethodInput",""],["captchaRef","reCaptcha","reCaptcha","ngModel"],["password","ngModel"],["errors",""],["otpRegistrationRef",""],["id","pledge_payment_info_form","novalidate","",3,"ngSubmit"],["name","paymentMethod",3,"ngModelChange","saleResult","tokenizeResult","applePayMetadataEvent","googlePayMetadataEvent","ngModel","acceptsAch","acceptsCc","acceptsAmex","acceptsApplePay","acceptsGooglePay","validateCvv","borderColor","merchantId","firstName","lastName","applePayAmount","googlePayAmount"],["id","save_payment_info_container",1,"flex","flex-column"],[1,"mt-0.5","mb-1.5"],[1,"create-account-container","p-1","mt-0.5"],["name","note","inputId","giftNote","textareaHeight","10rem",1,"mb-1",3,"ngModel","maxlength","label","placeholder"],["id","review_container"],[1,"app-card-footer","grid","two-column"],[1,"error-box","flex","align-items-center","m-0"],["id","back_btn","pButton","","type","button",1,"p-button-outlined","p-button-plain","w-full",3,"click","label"],["buttonId","submit_your_gift_button","buttonClasses","w-full","label","LABEL.SUBMIT_YOUR_GIFT","loadingLabel","LABEL.SUBMITTING_GIFT","tooltipPosition","bottom",3,"form","externalValidateFn","isLoading","disabled","pTooltip"],[1,"flex","justify-content-center","recaptcha-badge","pt-1"],["id","reCaptcha","name","reCaptcha","size","invisible","badge","inline",3,"resolved","ngModelChange","siteKey","ngModel"],[1,"checkbox-wrapper"],["id","save_contribution_method","inputId","save_contribution_method_pledge_input",3,"ngModelChange","onChange","ngModel","ngModelOptions","binary"],["for","save_contribution_method_pledge_input"],[3,"hideCreateAccountButton","username"],[1,"flex-full-width"],[1,"font-bold"],[1,"mb-1"],["label","LABEL.CREATE_PASSWORD","inputId","password","name","password","autocomplete","new-password",1,"flex-full-width",3,"ngModelChange","ngModel","minlength","pattern","required"],[3,"isLoading","contactType","disabled"],["translate","ERROR.PASSWORD_MIN_LENGTH"],["translate","ERROR.PASSWORD_BAD_FORMAT"],[3,"buttonClick","isLoading","contactType","disabled"],[3,"verifyFinished","hideCreateAccountButton","username"],["name","note","inputId","giftNote","textareaHeight","10rem",1,"mb-1",3,"ngModelChange","ngModel","maxlength","label","placeholder"],[3,"isMobile","showStar"],[1,"material-icons","error-icon","cursor-default"]],template:function(n,i){if(n&1){let s=P();a(0,"form",6,0),y("ngSubmit",function(){return i.onSubmit()}),a(2,"app-donor-payment-method-input",7,1),Be("ngModelChange",function(C){return I(s),Ve(i.guestPledgeSubmission.paymentMethodInfo,C)||(i.guestPledgeSubmission.paymentMethodInfo=C),b(C)}),y("saleResult",function(C){return i.onSaleResult(C)})("tokenizeResult",function(C){return i.onTokenizeResult(C)})("applePayMetadataEvent",function(C){return i.onApplePayMetadata(C)})("googlePayMetadataEvent",function(C){return i.onGooglePayMetadata(C)}),r(),a(4,"div",8),p(5,oc,6,7,"div",9),p(6,pc,3,1,"div",10),r(),p(7,mc,1,4,"app-textarea",11),p(8,uc,2,2,"div",12),a(9,"div",13),p(10,fc,6,4,"div",14),a(11,"button",15),c(12,"translate"),y("click",function(){return i.backClicked.emit
1()}),r(),h(13,"app-form-submit-button",16),r(),a(14,"div",17)(15,"re-captcha",18,2),y("resolved",function(C){return C&&i.createGiftSubmission()}),Be("ngModelChange",function(C){return I(s),Ve(i.guestPledgeSubmission.reCaptcha,C)||(i.guestPledgeSubmission.reCaptcha=C),b(C)}),r()()()}if(n&2){let s=ae(1);o(2),Le("ngModel",i.guestPledgeSubmission.paymentMethodInfo),g("acceptsAch",i.fund.acceptsAch)("acceptsCc",i.fund.acceptsCreditCard)("acceptsAmex",i.fund.acceptsAmex)("acceptsApplePay",i.isNuveiMerchant)("acceptsGooglePay",i.isNuveiMerchant)("validateCvv",!0)("borderColor",i.publicIframeInputColor)("merchantId",i.fund.merchantId)("firstName",i.guestPledgeSubmission.firstName)("lastName",i.guestPledgeSubmission.lastName)("applePayAmount",i.guestPledgeSubmission.pledge==null?null:i.guestPledgeSubmission.pledge.installmentAmount)("googlePayAmount",i.guestPledgeSubmission.pledge==null?null:i.guestPledgeSubmission.pledge.installmentAmount),o(3),m(!i.isLoginRequired&&!i.guestPledgeSubmission.contactExists?5:-1),o(),m(i.guestPledgeSubmission.createCredentialedUser&&!i.guestPledgeSubmission.contactExists?6:-1),o(),m(i.fundNotesEnabled?7:-1),o(),m(i.isMobile?8:-1),o(2),m(i.errorMsg?10:-1),o(),g("label",j(f(12,27,"LABEL.BACK"))),o(2),g("form",s.form)("externalValidateFn",i.validateCustomFormElements.bind(i))("isLoading",i.showPaymentProcessing)("disabled",!i.canSubmitForm()||!s.valid||i.isSendingOtp()||!i.isOtpRegistrationValid())("pTooltip",i.getTooltipMessage()),o(2),g("siteKey",i.reCaptchaSiteKey),Le("ngModel",i.guestPledgeSubmission.reCaptcha)}},dependencies:[ve,de,se,le,it,nt,Gt,Cn,pi,gn,Fn,ht,gt,at,ge,rt,st,We,De,He,Ge,vi,lt,Z,Ee,_t,ot,G],styles:["app-email-input[_ngcontent-%COMP%], #save_payment_info_true[_ngcontent-%COMP%]{margin-bottom:1.25rem}#payment_info[_ngcontent-%COMP%]{container-type:inline-size;container-name:ps-cc-cvv-host}#ccNumDiv[_ngcontent-%COMP%], #credit_card_number_container[_ngcontent-%COMP%]{height:9.75rem}#ccNumDiv[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], #credit_card_number_container[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{height:100%}@supports (container-type: inline-size){@container ps-cc-cvv-host (min-width: 450.02px){#ccNumDiv[_ngcontent-%COMP%], #credit_card_number_container[_ngcontent-%COMP%]{height:4.875rem}}}.error-box[_ngcontent-%COMP%]{grid-column-end:span 1;max-width:none}@media screen and (width>=600px){.error-box[_ngcontent-%COMP%]{grid-column-end:span 2}}.form-field-i-frame[_ngcontent-%COMP%]{height:4.875rem;overflow:visible}.form-field-i-frame[_ngcontent-%COMP%] > div#card_number[_ngcontent-%COMP%]{height:100%;overflow:visible}.form-field-i-frame[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{height:100%}.subtitle[_ngcontent-%COMP%]{margin:1rem 0}.text-selection[_ngcontent-%COMP%]{padding:1rem}.create-account-container[_ngcontent-%COMP%]{border:1px solid rgba(0,0,0,.12);border-radius:3px;margin-bottom:2rem}[_nghost-%COMP%] .zip-field .p-error{bottom:-1.375rem!important}"]})}}return t})();function gc(t,l){t&1&&(a(0,"h3"),u(1),c(2,"translate"),r()),t&2&&(o(),v(f(2,1,"LABEL.YOUR_INFO")))}function hc(t,l){t&1&&(a(0,"h3"),u(1),c(2,"translate"),r()),t&2&&(o(),v(f(2,1,"LABEL.PAYMENT_INFO")))}function _c(t,l){if(t&1&&(a(0,"div",6),p(1,gc,3,3,"h3")(2,hc,3,3,"h3"),r()),t&2){let e=d();o(),m(e.currentStep===1?1:2)}}function Cc(t,l){if(t&1){let e=P();a(0,"app-guest-contact-info",7),y("canceled",function(){I(e);let i=d();return b(i.cancel())})("continued",function(){I(e);let i=d();return b(i.continueToPayment())}),r()}if(t&2){let e=d();g("contactData",e.guestPledgeSubmission)("accountCreationMode","create-now")}}function vc(t,l){if(t&1){let e=P();a(0,"app-pledge-guest-gift-payment-info",8),y("canceled",function(){I(e);let i=d();return b(i.cancel())})("backClicked",function(){I(e);let i=d();return b(i.goBackToInfo())})("showPaymentProcessingChanged",function(i){I(e);let s=d();return b(s.onPaymentProcessingChanged(i))}),r()}if(t&2){let e=d();g("guestPledgeSubmission",e.guestPledgeSubmission)("isLoginRequired",e.isLoginRequired)("showStar",e.showStar)("isMobile",e.isMobile)}}var Oo=(()=>{class t{constructor(){this.isLoginRequired=!1,this.pledge={},this.showStar=!1,this.isMobile=!1,this.canceled=new ne,this.paymentProcessingChanged=new ne,this.currentStep=1,this.paymentIsProcessing=!1,this.doesPledgeStartInFuture=!1,this.myPledge=E(ye),this.route=E(U)}
1ngOnInit(){let e=ce.getParentSnapshotData("fund",this.route.snapshot),n=ce.getParentSnapshotData("organization",this.route.snapshot);this.guestPledgeSubmission={},this.guestPledgeSubmission.pledge=this.myPledge.getPledge(),this.guestPledgeSubmission.pledge.organizationTenant=n.tenantId,this.guestPledgeSubmission.pledge.fundId=e.id,this.doesPledgeStartInFuture=this.myPledge.doesPledgeStartInFuture(),this.isLoginRequired=this.doesPledgeStartInFuture||this.guestPledgeSubmission.pledge.frequency!=="oneTime",this.guestPledgeSubmission.createCredentialedUser=this.isLoginRequired}continueToPayment(){this.currentStep=2}goBackToInfo(){this.currentStep=1}onPaymentProcessingChanged(e){this.paymentIsProcessing=e,this.paymentProcessingChanged.emit(e)}cancel(){this.canceled.emit()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=O({type:t,selectors:[["app-pledge-guest-gift-info"]],inputs:{isLoginRequired:"isLoginRequired",pledge:"pledge",showStar:"showStar",isMobile:"isMobile"},outputs:{canceled:"canceled",paymentProcessingChanged:"paymentProcessingChanged"},decls:7,vars:3,consts:[["header",""],["id","gift_info_form"],["id","pledge_guest_gift_info_card",1,"gift-info-card","with-shadow"],[3,"contactData","accountCreationMode"],[3,"guestPledgeSubmission","isLoginRequired","showStar","isMobile"],["headerMessage","LABEL.PROCESSING","message","MESSAGE.GIFT_PROCESSING",3,"isVisible"],[1,"app-card-header","flex","flex-column"],[3,"canceled","continued","contactData","accountCreationMode"],[3,"canceled","backClicked","showPaymentProcessingChanged","guestPledgeSubmission","isLoginRequired","showStar","isMobile"]],template:function(n,i){n&1&&(a(0,"div",1)(1,"app-card",2),M(2,_c,3,1,"ng-template",null,0,w),p(4,Cc,1,2,"app-guest-contact-info",3),p(5,vc,1,4,"app-pledge-guest-gift-payment-info",4),r()(),h(6,"app-spinner-modal",5)),n&2&&(o(4),m(i.currentStep===1?4:-1),o(),m(i.currentStep===2?5:-1),o(),g("isVisible",i.paymentIsProcessing))},dependencies:[$,Vi,To,It,G],styles:["app-email-input[_ngcontent-%COMP%], #save_payment_info_true[_ngcontent-%COMP%]{margin-bottom:1.25rem}#payment_info[_ngcontent-%COMP%]{container-type:inline-size;container-name:ps-cc-cvv-host}#ccNumDiv[_ngcontent-%COMP%], #credit_card_number_container[_ngcontent-%COMP%]{height:9.75rem}#ccNumDiv[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], #credit_card_number_container[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{height:100%}@supports (container-type: inline-size){@container ps-cc-cvv-host (min-width: 450.02px){#ccNumDiv[_ngcontent-%COMP%], #credit_card_number_container[_ngcontent-%COMP%]{height:4.875rem}}}.error-box[_ngcontent-%COMP%]{grid-column-end:span 1;max-width:none}@media screen and (width>=600px){.error-box[_ngcontent-%COMP%]{grid-column-end:span 2}}.form-field-i-frame[_ngcontent-%COMP%]{height:4.875rem;overflow:visible}.form-field-i-frame[_ngcontent-%COMP%] > div#card_number[_ngcontent-%COMP%]{height:100%;overflow:visible}.form-field-i-frame[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{height:100%}.subtitle[_ngcontent-%COMP%]{margin:1rem 0}.text-selection[_ngcontent-%COMP%]{padding:1rem}.create-account-container[_ngcontent-%COMP%]{border:1px solid rgba(0,0,0,.12);border-radius:3px;margin-bottom:2rem}[_nghost-%COMP%] .zip-field .p-error{bottom:-1.375rem!important}"]})}}return t})();var Sc=["addDonorPaymentMethod"],yc=["donorPaymentMethodDropdown"],Ic=t=>({amount:t});function bc(t,l){t&1&&(h(0,"app-alert",7),c(1,"translate")),t&2&&g("message",j(f(1,3,"FINANCE.MESSAGES.FUND_ACCEPTS_CC_EXCLUSIVELY")))("header",null)}function Ec(t,l){t&1&&(h(0,"app-alert",8),c(1,"translate")),t&2&&g("message",j(f(1,3,"FINANCE.MESSAGES.FUND_ACCEPTS_ACH_EXCLUSIVELY")))("header",null)}function Pc(t,l){t&1&&h(0,"span",18)}function Ac(t,l){if(t&1&&p(0,Pc,1,0,"span",18),t&2){let e=d();m(e.giftInfoForm&&e.giftInfoForm.controls.paymentMethod.errors&&e.giftInfoForm.controls.paymentMethod.errors.amexEnabled?0:-1)}}function xc(t,l){if(t&1&&h(0,"app-textarea",11),t&2){let e=d();g("maxLength",1e3)("label",e.noteLabel)("placeholder",e.notePlaceholder)}}function Tc(t,l){if(t&1&&(a(0,"div",12),h(1,"app-pledge-summary-card",19),r()),t&2){let e=d();o(),g("isMobile",e.isMobile)("showStar",e.showStar)}}function Oc(t,l){if(t&1&&(a(0,"div",13)(1,"i",20),u(2,"error"),r(),a(3,"span"),u(4),c(5,"translate"),r()()),t&2){let e=d();o(4),q("",f(5,2,"ERROR.PROCESSING_GIFT"),": ",e.errorMsg)}}function wc(t,l){if(t&1&&(h(0,"app-form-submit-button",21),c(1,"currency"),c(2,"translate")),t&2){let e=d();g("form",e.giftInfoForm)("label",T(2,7,"FINANCE.LABELS.PLEDGE_WITH_AMOUNT",R(10,Ic,f(1,5,e.pledge.totalAmount))))("isLoading",e.showPaymentProcessing)("disabled",!e.canSubmitForm(
1))("pTooltip",e.getTooltipMessage())}}var wo=(()=>{class t{constructor(){this.submitClick=new ne,this.isMobile=!1,this.pledge={},this.showStar=!1,this.activeFundDetailSvc=E(Ai),this.configSvc=E(we),this.destroyRef=E(J),this.myGiftsSvc=E(Pe),this.profileSvc=E(Ne),this.route=E(U),this.translateSvc=E(oe),this.isNuveiMerchant=this.activeFundDetailSvc.isNuveiMerchant}ngOnInit(){this.reCaptchaSiteKey=this.configSvc.get("reCaptchaSiteKey"),this.fund=ce.getParentSnapshotData("fund",this.route.snapshot),this.organization=ce.getParentSnapshotData("organization",this.route.snapshot),this.profileSvc.activeProfile$.pipe(F(e=>{this.userFirstName=e?e.firstName:""}),N(this.destroyRef)).subscribe(),this.initGift(),this.initForm(),this.initNote()}ngAfterViewInit(){this.giftInfoForm.controls.paymentMethod.setValidators([x.required,this.validateCardType.bind(this)])}submitGift(){this.showPaymentProcessing=!0,this.errorMsg=null;let e=this.giftInfoForm.value,n=L({},this.gift),i=this.giftInfoForm.controls.recaptchaReactive.value;e.note&&(n.note=e.note);let s=e.paymentMethod.id;this.submitClick.emit({paymentMethodId:s,gift:n,recaptchaReactive:i}),event.preventDefault()}canSubmitForm(){return this.organization.products.find(e=>e.name===ut.OnlineGiving).status==="Live"}getTooltipMessage(){if(!this.canSubmitForm())return this.translateSvc.instant("FINANCE.MESSAGES.GIFTS_DISABLED_ONBOARDING")}validateCardType(e){if(e){let n=e.value;if(n?.accountType&&!this.fund.acceptsAmex&&n.accountType==="AmericanExpress")return{amexEnabled:!0}}return null}initGift(){this.myGiftsSvc.myGifts.pipe(F(e=>{this.gifts=e.gifts,this.gift=this.gifts[0]}),N(this.destroyRef)).subscribe()}initForm(){this.giftInfoForm=new Je({paymentMethod:new Y(null),note:new Y(null),recaptchaReactive:new Y(null)})}initNote(){this.fundNotesEnabled=this.fund?.notesEnabled,this.noteLabel=this.fund?.notesLabel,this.notePlaceholder=this.fund?.notesPlaceholder}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=O({type:t,selectors:[["app-pledge-user-gift-info"]],viewQuery:function(n,i){if(n&1&&me(Sc,7)(yc,7),n&2){let s;W(s=H())&&(i.addDonorPaymentMethod=s.first),W(s=H())&&(i.donorPaymentMethodDropdown=s.first)}},inputs:{errorMsg:"errorMsg",showPaymentProcessing:"showPaymentProcessing",isMobile:"isMobile",pledge:"pledge",showStar:"showStar"},outputs:{submitClick:"submitClick"},decls:22,vars:18,consts:[["donorPaymentMethodDropdown",""],["errors",""],["footer",""],["captchaRef","reCaptcha"],["addDonorPaymentMethod",""],["novalidate","","id","giftInfoForm",3,"ngSubmit","formGroup"],[1,"gift-info-card",3,"header","subheader"],["icon","credit_card","severity","info",1,"mb-0.75",3,"header","message"],["icon","account_balance","severity","info",1,"mb-0.75",3,"header","message"],[1,"flex","flex-row-wrap","justify-content-center"],["id","user_gift_info_payment_method_dropdown","formControlName","paymentMethod","label","LABEL.PAYMENT",1,"flex","justify-content-center",3,"acceptsAch","acceptsCreditCard","fundIsNuvei","addModal"],["inputId","giftNote","formControlName","note","textareaHeight","10rem",1,"w-full","mb-1",3,"maxLength","label","placeholder"],["id","review_container"],[1,"error-box","flex","align-items-center"],[1,"flex","justify-content-center","recaptcha-badge","pt-1"],["formControlName","recaptchaReactive","id","reCaptcha","name","reCaptcha","size","invisible","badge","inline",3,"resolved","siteKey"],["headerMessage","LABEL.PROCESSING","message","MESSAGE.GIFT_PROCESSING",3,"isVisible"],[3,"paymentMethodAdded","cancelled"],["translate","FINANCE.ERRORS.AMEX_NOT_ACCEPTED"],[3,"isMobile","showStar"],[1,"material-icons","error-icon","cursor-default"],["id","complete_button","buttonClasses","p-button mobile-btn w-full","loadingLabel","LABEL.SUBMITTING_GIFT","tooltipPosition","bottom",3,"form","label","isLoading","disabled","pTooltip"]],template:function(n,i){if(n&1){let s=P();a(0,"form",5),y("ngSubmit",function(){I(s);let C=ae(18);return b(C.execute())}),a(1,"app-card",6),c(2,"translate"),c(3,"translate"),p(4,bc,2,5,"app-alert",7),p(5,Ec,2,5,"app-alert",8),a(6,"div",9)(7,"app-donor-payment-method-dropdown",10,0),M(9,Ac,1,1,"ng-template",null,1,w),r(),p(11,xc,1,3,"app-textarea",11),r(),p(12,Tc,2,2,"div",12),p(13,Oc,6,4,"div",13),M(14,wc,3,12,"ng-template",null,2,w),r(),a(16,"div",14)(17,"re-captcha",15,3),y("resolved",function(C){return C&&i.submitGift()}),r()(),h(19,"app-spinner-modal",16),a(20,"app-add-donor-payment-method-modal",17,4),y("paymentMethodAdded",function(C){I(s);let D=ae(8);return b(D.onPaymentMethodAdded(C))})("cancelled",function(){I(s);let C=ae(8);return b(C.onAddPaymentMethodCancelled())}),r()()}if(n&2){let s=ae(21);
1g("formGroup",i.giftInfoForm),o(),g("header",f(2,14,"LABEL.GIFT_INFO"))("subheader",f(3,16,"MESSAGE.COMPLETE_GIFT")),o(3),m(i.fund.acceptsCreditCard&&!i.fund.acceptsAch?4:-1),o(),m(i.fund.acceptsAch&&!i.fund.acceptsCreditCard?5:-1),o(2),g("acceptsAch",i.fund.acceptsAch)("acceptsCreditCard",i.fund.acceptsCreditCard)("fundIsNuvei",i.isNuveiMerchant())("addModal",s),o(4),m(i.fundNotesEnabled?11:-1),o(),m(i.isMobile?12:-1),o(),m(i.errorMsg?13:-1),o(4),g("siteKey",i.reCaptchaSiteKey),o(2),g("isVisible",i.showPaymentProcessing)}},dependencies:[ve,de,se,le,be,Ce,_e,$,Lt,Pi,Se,ge,vi,lt,Ee,_t,ot,We,De,He,Ge,It,yi,ue,G],styles:["[_nghost-%COMP%] #user_gift_info_payment_method_dropdown, [_nghost-%COMP%] #payment_method_wrapper{width:100%}"]})}}return t})();function Nc(t,l){if(t&1&&(a(0,"div",2),h(1,"app-pledge-summary-card",6),r()),t&2){let e=d(2);o(),g("isMobile",e.isMobile())("showNavigationLinks",!0)}}function Mc(t,l){if(t&1){let e=P();a(0,"app-pledge-guest-gift-info",7),y("canceled",function(){I(e);let i=d(2);return b(i.cancel())})("paymentProcessingChanged",function(i){I(e);let s=d(2);return b(s.paymentIsProcessing=i)}),r()}if(t&2){let e=d(2);g("isLoginRequired",e.isLoginRequired)("pledge",e.pledge)("showStar",e.showStar)("isMobile",e.isMobile())}}function Dc(t,l){if(t&1){let e=P();a(0,"app-pledge-user-gift-info",8),y("submitClick",function(i){I(e);let s=d(2);return b(s.createPledgeForUserWithPaymentInfo(i))}),r()}if(t&2){let e=d(2);g("pledge",e.pledge)("showStar",e.showStar)("isMobile",e.isMobile())("errorMsg",e.errorMsg)("showPaymentProcessing",e.showPaymentProcessing)}}function Gc(t,l){if(t&1&&(a(0,"div",1),p(1,Nc,2,2,"div",2),a(2,"div",3),p(3,Mc,1,4,"app-pledge-guest-gift-info",4)(4,Dc,1,5,"app-pledge-user-gift-info",5),r()()),t&2){let e=d();o(),m(e.isMobile()?-1:1),o(2),m(!e.isAuthenticated()||e.paymentIsProcessing?3:4)}}var No=(()=>{class t{constructor(e,n,i,s,_,C,D,X,re,Re,Ke){this.myPledgeSvc=e,this.route=n,this.router=i,this.sessionSvc=s,this.pledgeService=_,this.notify=C,this.myGiftsSvc=D,this.profileSvc=X,this.publicLinkSvc=re,this.translate=Re,this.profileGiftSvc=Ke,this.breakpointSvc=E(tt),this.destroyRef=E(J),this.isMobile=this.breakpointSvc.underTablet,this.gift={},this.paymentIsProcessing=!1,this.showPaymentProcessing=!1,this.isLoginRequired=!1,this.isPledgeCreating=!1,this.showStar=!1,this.allowPhysicalInstallments=!1}ngOnInit(){this.org=ce.getParentSnapshotData("organization",this.route.snapshot),this.fund=this.route.snapshot.parent.data.fund,this.profileSvc.activeProfile$.pipe(N(this.destroyRef)).subscribe(e=>{this.userFirstName=e?e.firstName:""}),this.myPledgeSvc.pledge.pipe(N(this.destroyRef)).subscribe(e=>{this.pledge=e,this.gift.amount=this.pledge.lastInstallmentAmount,this.gift.fund=this.fund,this.gift.frequency=this.pledge.frequency,this.myGiftsSvc.addGift(this.gift),this.isLoginRequired=this.pledge.installmentCount>1||this.pledge.frequency!=="oneTime"||this.myPledgeSvc.doesPledgeStartInFuture(),this.showStar=this.pledge.lastInstallmentAmount>0&&this.pledge.installmentAmount!==this.pledge.lastInstallmentAmount})}isAuthenticated(){return this.sessionSvc.isAuthenticated()}hasPledge(){return this.myPledgeSvc.hasPledge()}cancel(){this.myPledgeSvc.clearPledge(),this.router.navigate(this.publicLinkSvc.fundList())}createPledgeForUserWithPaymentInfo(e){let n=e.recaptchaReactive;this.pledge=this.myPledgeSvc.getPledge(),this.showPaymentProcessing=!0,this.pledge.organizationTenant=this.org.tenantId,this.pledge.fundId=this.fund.id,this.pledge.paymentMethodId=e.paymentMethodId,this.pledge.note=e.gift?.note,this.sessionSvc.isAuthenticated()&&this.pledgeService.createPledgeForCurrentUser(this.pledge,n).subscribe({next:i=>{this.pledge.confirmationNumber=i.confirmationNumber,this.myPledgeSvc.changePledge(this.pledge),this.profileGiftSvc.clearPledges(),this.profileGiftSvc.markPledgesDirty(),this.profileGiftSvc.triggerReloadPledges(),this.fund.isParentFund?this.publicLinkSvc.navigate(this.publicLinkSvc.parentPledgeSetupConfirmation(this.fund.url,this.fund.orgTenantId,i.id)):this.publicLinkSvc.navigate(this.publicLinkSvc.pledgeSetupConfirmation(this.fund.url,i.id)),this.showPaymentProcessing=!1},error:i=>{this.notify.errorBanner({title:"ERROR.CREATING_PLEDGE",message:i.validationMessage||i.message||this.translate.instant("FINANCE.ERRORS.CONTACT_SUPPORT")}),this.errorMsg=i.message,this.showPaymentProcessing=!1}})}goToFundList(){this.myPledgeSvc.clearPledge(),this.router.navigate(this.publicLinkSvc.fundList())}goToPledgeSetup(){this.router.navigate(this.publicLinkSvc.pledgeSetup(this.fund.url))}static{this.\u0275fac=function(n){return new(n||t)(S(ye),S(U),S(ee),S(je),S(Ti),S(te),S(Pe),S(Ne),S(ie),S(oe),S(no))}}static{this.\u0275cmp=O({type:t,selectors:[["app-pledge-gift-info-view"]],decls:2,vars:1,consts:[[1,"flex","justify-content-center","new-olg-container","new-layout-container"],[1,"w-full","flex","flex-row-reverse","justify-content-center","flex-wrap","content-container"],["id","review_container"],["id","info_container"],[3,"isLoginRequired","pledge","showStar","isMobile"],[3,"pledge","showStar","isMobile","errorMsg","showPaymentProcessing"],[3,"isMobile","showNavigationLinks"],[3,"canceled","paymentProcessingChanged","isLoginRequired","pledge","showStar","isMobile"],[3,"submitClick","pledge","showStar","isMobile","errorMsg","showPaymentProcessing"]],template:function(n,i){n&1&&(a(0,"div",0),p(1,Gc,5,2,"div",1),r()),n&2&&(o(),m(i.hasPledge()?1:-1))},dependencies:[lt,Oo,wo],styles:[".new-layout-container[_ngcontent-%COMP%] #info_container[_ngcontent-%COMP%], .new-layout-container[_ngcontent-%COMP%] #gift_info_container[_ngcontent-%COMP%]{width:100%}@supports (container-type: inline-size){@container content-container (min-width: 960px){.new-layout-container[_ngcontent-%COMP%] #info_container[_ngcontent-%COMP%], .new-layout-container[_ngcontent-%COMP%] #gift_info_container[_ngcontent-%COMP%]{flex:1 1 30rem;max-width:30.5rem}}}@supports not (container: content-container){@media(min-width:960px){.new-layout-container[_ngcontent-%COMP%] #info_container[_ngcontent-%COMP%], .new-layout-container[_ngcontent-%COMP%] #gift_info_container[_ngcontent-%COMP%]{flex:1 1 30rem;max-width:30.5rem}}}.new-layout-container[_ngcontent-%COMP%] #review_container[_ngcontent-%COMP%], .new-layout-container[_ngcontent-%COMP%] #gift_review_container[_ngcontent-%COMP%]{margin-bottom:1.5rem;width:100%}@supports (container-type: inline-size){@container content-container (min-width: 960px){.new-layout-container[_ngcontent-%COMP%] #review_container[_ngcontent-%COMP%], .new-layout-container[_ngcontent-%COMP%] #gift_review_container[_ngcontent-%COMP%]{margin-left:1.5rem;width:20rem}}}@supports not (container: content-container){@media(min-width:960px){.new-layout-container[_ngcontent-%COMP%] #review_container[_ngcontent-%COMP%], .new-layout-container[_ngcontent-%COMP%] #gift_review_container[_ngcontent-%COMP%]{margin-left:1.5rem;width:20rem}}}"],data:{animation:[ui()]}})}}return t})();var Mo=(()=>{class t{constructor(e){this.publicFundSvc=e,this.endOfMonth=!1}addDesignation(e){let n=new Je({designation_dropdown:new Y("",{validators:[x.required]}),percentage_input:new Y(null,{validators:[x.required,x.min(1),x.max(100)]}),percentage_value:new Y(0)});n.id=`designation_${Date.now()}_${this.generateSecureRandomId()}`,e.push(n)}removeDesignation(e,n,i){e.removeAt(n);let s=i;i===n||i>=e.length?s=-1:i>n&&s--;let _=e.length>0;return{newLastModifiedIndex:s,isDesignations:_}}getDesignationValues(e){return!e||e.length===0?[]:e.controls.map(i=>({designationId:i.get("designation_dropdown")?.value||"",percentage:i.get("percentage_input")?.value||0})).filter(i=>i.designationId&&i.designationId!=="")}
1getDesignationName(e,n){return n.find(s=>s.value===e)?.label||""}getAvailableDesignationsForIndex(e,n,i){if(!n)return[];let s=this.getSelectedDesignationIds(i),_=i.at(e)?.get("designation_dropdown")?.value;return n.filter(C=>C.value===_?!0:!s.includes(C.value))}getSelectedDesignationIds(e){return!e||e.length===0?[]:e.controls.map(n=>n.get("designation_dropdown")?.value).filter(n=>n&&n!=="")}getTotalDesignationAmount(e){return!e||e.length===0?0:e.controls.reduce((n,i)=>{let s=i.get("percentage_value")?.value||0;return n+s},0)}getTotalPercentage(e){return!e||e.length===0?0:e.controls.reduce((n,i)=>{let s=i.get("percentage_input")?.value||0;return n+s},0)}getGeneralFundAmount(e,n,i,s){let _=0;i&&e?_=e:!i&&n&&(_=n);let C=this.getTotalDesignationAmount(s);return Math.max(0,_-C)}autoAdjustPercentages(e,n){if(this.shouldAutoAdjustPercentages(e)){if(this.shouldAdjustSinglePercentage(n,e)){this.autoAdjustSinglePercentage(e,n);return}this.adjustAllPercentagesProportionally(e)}}autoAdjustSinglePercentage(e,n){if(!e||e.length===0||n<0||n>=e.length||this.getTotalPercentage(e)<=100)return;let s=0;e.controls.forEach((D,X)=>{if(X!==n){let re=D.get("percentage_input")?.value||0;s+=re}});let _=Math.max(1,100-s),C=e.at(n);C.get("percentage_input")?.setValue(_,{emitEvent:!1}),C.get("percentage_input")?.markAsTouched()}depositBeforeStartDate(){return e=>{let n=e.controls.startDate,i=e.controls.depositDate;if(e.controls.includesDeposit.value===!0){let s=qe.fromJSDate(n.value).startOf("day").toJSDate(),_=qe.fromJSDate(i.value).startOf("day").toJSDate();i.value?_>s?i.setErrors({outsideRange:!0}):i.setErrors(null):i.setErrors({required:!0})}else i.setErrors(null);return{}}}startDateBeforeEndDate(){return e=>{let n=e.controls.frequency.value!=="oneTime",i=e.controls.startDate,s=e.controls.endDate;return n&&i.value&&s.value&&i.value>s.value?i.setErrors({afterEndDate:!0}):i.setErrors(null),n&&i.value>s.value?s.setErrors({beforeStartDate:!0}):s.setErrors(null),{}}}shouldShowAlertAfterDesignation(e,n,i){if(!n||n.length===0||this.getTotalPercentage(n)<=100)return!1;if(i>=0&&i<n.length){let C=n.at(i),D=C?.get("designation_dropdown")?.value,X=C?.get("percentage_input")?.value>0;if(D&&X)return e===i}let _=-1;for(let C=0;C<n.length;C++){let D=n.at(C),X=D?.get("percentage_input")?.value||0,re=D?.get("designation_dropdown")?.value;X>0&&re&&(_=C)}return e===_}showRedSlider(e,n,i){if(this.getTotalPercentage(n)<=100)return this.clearPercentageOverflowErrors(n),!1;if(this.shouldShowRedSliderForLastModified(e,n,i))return!0;let _=this.findLastDesignationWithValue(n);return _>=0&&this.setPercentageOverflowError(n.at(_)),e===_}hasValidDesignationValues(e){let n=e.get("designation_dropdown")?.value,i=e.get("percentage_input")?.value;return!!(n&&i>0)}isDesignationValid(e){let n=e.get("designation_dropdown")?.value,i=e.get("percentage_input")?.value&&e.get("percentage_input")?.value>0;return!!(n&&i)}hasDesignationChanges(e,n){let i=n.donorPledgeDesignations||[];if(e.length!==i.length)return!0;for(let s=0;s<e.length;s++){let _=e[s],C=i[s];if(!C||_.designationId!==C.designationId||_.percentage!==C.percentage)return!0}return!1}hasNonDesignationChanges(e,n){return e.frequency!==n.frequency||e.startDate!==n.startDate||e.endDate!==n.endDate||e.totalAmount!==n.totalAmount||e.installmentAmount!==n.installmentAmount||e.includesDeposit!==n.includesDeposit||e.depositAmount!==n.depositAmount||e.depositDate!==n.depositDate}hasValidFormValues(e,n){return e?n?!!(e.totalAmount&&e.totalAmount>0):!!(e.installmentAmount&&e.installmentAmount>0):!1}getPledgeOptionIds(e,n){return e.pledgeOptionsArray.map((s,_)=>s?n[_].pledgeOptionId:null).filter(s=>s!==null)}shouldCallAPI(e,n){let i=n?!e.controls.totalAmount.invalid||e.controls.totalAmount.errors?.minInstallment:!e.controls.installmentAmount.invalid,s=!e.controls.frequency.invalid&&!e.controls.startDate.invalid;return e.controls.frequency.value!=="oneTime"&&(s=s&&!e.controls.endDate.invali
1d),!!i&&s}updatePledgeInfo(e,n,i,s,_,C){return e.calculateInstallmentsByTotalAmount=s,e.installmentAmount=n.installmentAmount,e.totalAmount=n.totalAmount,e.installmentCount=n.installmentCount,e.lastInstallmentAmount=n.lastInstallmentAmount,e.frequency=i.frequency,e.startDate=i.startDate,e.endDate=i.endDate?i.endDate:null,e.includesDeposit=i.includesDeposit,e.depositAmount=i.depositAmount,e.depositDate=i.depositDate?i.depositDate:null,e.localStartDate=qe.fromJSDate(e.startDate).toFormat("MM/dd/yyyy"),e.endDate?e.localEndDate=qe.fromJSDate(e.endDate).toFormat("MM/dd/yyyy"):e.localEndDate=void 0,e.pledgeOptionIds=this.getPledgeOptionIds(i,C),e.attributeToAssociatedOrganizationId=_.attributeToAssociatedOrganizationId,e.giftParam=_.giftParam,e.includesDeposit&&e.depositDate&&(e.localDepositDate=qe.fromJSDate(e.depositDate).toFormat("MM/dd/yyyy")),e}clearInstallmentCalculations(e,n){let i=L({},e);return i.installmentCount=void 0,n&&(i.installmentAmount=void 0),i.lastInstallmentAmount=void 0,i.calculateInstallmentsByTotalAmount=n,i}getDesignations(e){return this.publicFundSvc.getDesignations(e).pipe(Ze(n=>n.filter(s=>s.status==="Active").map(s=>({value:s.id,label:s.name}))))}loadData(e){return this.publicFundSvc.getAvailablePledgeOptionsForPublicFund(e)}getDesignationPercentageValue(e){let n=e.get("percentage_value")?.value;return typeof n=="number"?n:0}getDesignationDropdownValue(e){let n=e.get("designation_dropdown")?.value;return typeof n=="string"?n:""}getDesignationPercentageInputValue(e){let n=e.get("percentage_input")?.value;return typeof n=="number"?n:0}calculateAndSetPercentageValue(e,n,i,s,_){let C=0;_&&i?C=i:!_&&s&&(C=s);let D=C*n/100;e.get("percentage_value")?.setValue(D,{emitEvent:!1})}recalculateAllDesignationValues(e,n,i,s){e.controls.forEach(_=>{let C=_.get("percentage_input")?.value;C&&this.calculateAndSetPercentageValue(_,C,n,i,s)})}populateDesignationsFromPledge(e,n,i){if(e.donorPledgeDesignations&&e.donorPledgeDesignations.length>0){if(!n||n.length===0)return{isDesignations:!1};for(;i.length>0;)i.removeAt(0);return e.donorPledgeDesignations.forEach(s=>{let _=new Je({designation_dropdown:new Y(s.designationId,{validators:[x.required]}),percentage_input:new Y(s.percentage,{validators:[x.required,x.min(1),x.max(100)]}),percentage_value:new Y(0)});i.push(_)}),{isDesignations:!0}}return{isDesignations:!1}}handleEndOfMonthLogic(e,n,i){let s=e.startDate?.getDate(),_=n.find(C=>C===e.frequency);return s&&s>27&&_?(this.setEndOfMonthDate(e,i),this.endOfMonth=!0,{endOfMonth:!0,endDateCalendarView:"month"}):(this.resetEndDate(e,i),this.endOfMonth=!1,{endOfMonth:!1,endDateCalendarView:"date"})}handleDepositLogic(e,n){e||(n.controls.depositAmount.setValue(null,{emitEvent:!1}),n.controls.depositDate.setValue(null,{emitEvent:!1}),n.controls.depositAmount.clearValidators())}shouldUpdatePledge(e,n,i,s){return(e||n||i)&&s}createUpdatedPledge(e,n,i,s){let _=L({},e);if(_.donorPledgeDesignations=n,_.calculateInstallmentsByTotalAmount=i,i){let C=s.get("totalAmount")?.value;_.totalAmount=C>0?C:null}else{let C=s.get("installmentAmount")?.value;_.installmentAmount=C>0?C:null}return _}adjustAllPercentagesProportionally(e){let i=100/this.getTotalPercentage(e),s=this.calculateAdjustedPercentages(e,i),_=this.fineTunePercentagesToExactTotal(s);this.applyAdjustedPercentagesToForm(e,_)}applyAdjustedPercentagesToForm(e,n){e.controls.forEach((i,s)=>{n[s]>0&&(i.get("percentage_input")?.setValue(n[s],{emitEvent:!1}),i.get("percentage_input")?.markAsTouched())})}calculateAdjustedPercentages(e,n){let i=[];return e.controls.forEach((s,_)=>{let C=s.get("percentage_input")?.value||0;if(C>0){let D=Math.round(C*n*100)/100;D=Math.max(1,Math.min(100,D)),i[_]=D}else i[_]=0}),i}fineTunePercentagesToExactTotal(e){let i=100-e.reduce((s,_)=>s+_,0);if(Math.abs(i)>.001){let s=this.findLargestPercentageIndex(e);s>
1=0&&(e[s]=Math.round((e[s]+i)*100)/100,e[s]=Math.max(1,Math.min(100,e[s])))}return e}findLargestPercentageIndex(e){let n=-1,i=0;return e.forEach((s,_)=>{s>i&&(i=s,n=_)}),n}shouldAutoAdjustPercentages(e){return!e||e.length===0?!1:this.getTotalPercentage(e)>100}shouldAdjustSinglePercentage(e,n){return e>=0&&e<n.length}clearPercentageOverflowErrors(e){e.controls.forEach(n=>{let i=n.get("percentage_input");if(i?.errors?.percentageOverflow){let s=L({},i.errors);delete s.percentageOverflow,Object.keys(s).length===0?i.setErrors(null):i.setErrors(s)}})}shouldShowRedSliderForLastModified(e,n,i){if(i<0||i>=n.length)return!1;let s=n.at(i),_=s?.get("designation_dropdown")?.value,C=s?.get("percentage_input")?.value>0;return _&&C?(this.setPercentageOverflowError(s),e===i):!1}findLastDesignationWithValue(e){let n=-1;for(let i=0;i<e.length;i++){let s=e.at(i),_=s?.get("percentage_input")?.value||0,C=s?.get("designation_dropdown")?.value;_>0&&C&&(n=i)}return n}setPercentageOverflowError(e){let n=e.get("percentage_input");n&&(n.setErrors({percentageOverflow:!0}),n.markAsTouched())}setEndOfMonthDate(e,n){if(e.endDate&&!this.endOfMonth){let i=new Date(e.endDate.getFullYear(),e.endDate.getMonth()+1,0);n.controls.endDate.setValue(i,{emitEvent:!1}),n.controls.endDate.markAsUntouched(),n.controls.endDate.clearValidators()}}resetEndDate(e,n){let i=e.endDate?new Date(e.endDate):null;n.controls.endDate.setValue(i,{emitEvent:!1}),n.controls.endDate.markAsUntouched(),n.controls.endDate.clearValidators()}generateSecureRandomId(){let e=new Uint32Array(1);return crypto.getRandomValues(e),e[0].toString(36)}static{this.\u0275fac=function(n){return new(n||t)(Ue(Ut))}}static{this.\u0275prov=pt({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Rc=(t,l)=>l.pledgeOptionId;function Lc(t,l){t&1&&(a(0,"i",25),u(1,"attach_money"),r())}function Vc(t,l){t&1&&h(0,"span",26)}function Bc(t,l){t&1&&h(0,"span",27)}function Uc(t,l){t&1&&h(0,"span",28)}function kc(t,l){t&1&&h(0,"span",29)}function zc(t,l){if(t&1&&(p(0,Vc,1,0,"span",26),p(1,Bc,1,0,"span",27),p(2,Uc,1,0,"span",28),p(3,kc,1,0,"span",29)),t&2){let e=d(3);m(e.pledgeCalculatorForm.controls.totalAmount.errors!=null&&e.pledgeCalculatorForm.controls.totalAmount.errors.min&&!(e.pledgeCalculatorForm.controls.totalAmount.errors!=null&&e.pledgeCalculatorForm.controls.totalAmount.errors.pattern)?0:-1),o(),m(e.pledgeCalculatorForm.controls.totalAmount.errors!=null&&e.pledgeCalculatorForm.controls.totalAmount.errors.pattern?1:-1),o(),m(e.pledgeCalculatorForm.controls.totalAmount.errors!=null&&e.pledgeCalculatorForm.controls.totalAmount.errors.minInstallment&&!(e.pledgeCalculatorForm.controls.depositAmount.errors!=null&&e.pledgeCalculatorForm.controls.depositAmount.errors.max)?2:-1),o(),m(e.pledgeCalculatorForm.controls.totalAmount.errors!=null&&e.pledgeCalculatorForm.controls.totalAmount.errors.minInstallment&&(e.pledgeCalculatorForm.controls.depositAmount.errors!=null&&e.pledgeCalculatorForm.controls.depositAmount.errors.max)?3:-1)}}function qc(t,l){if(t&1&&p(0,zc,4,4),t&2){let e=d(2);m(e.pledgeCalculatorForm.invalid&&e.pledgeCalculatorForm.controls.totalAmount.touched?0:-1)}}function jc(t,l){t&1&&(a(0,"app-input-group",9),M(1,Lc,2,0,"ng-template",null,2,w)(3,qc,1,1,"ng-template",null,1,w),r()),t&2&&g("appMin",1)}function Wc(t,l){t&1&&(a(0,"i",25),u(1,"attach_money"),r())}function Hc(t,l){t&1&&h(0,"span",26)}function Yc(t,l){t&1&&h(0,"span",27)}function Qc(t,l){if(t&1&&(p(0,Hc,1,0,"span",26),p(1,Yc,1,0,"span",27)),t&2){let e=d(3);m(e.pledgeCalculatorForm.controls.installmentAmount.errors!=null&&e.pledgeCalculatorForm.controls.installmentAmount.errors.min&&!(e.pledgeCalculatorForm.controls.installmentAmount.errors!=null&&e.pledgeCalculatorForm.controls.installmentAmount.errors.pattern)?0:-1),o(),m(e.pledgeCalculatorForm.controls.installmentAmount.errors!=null&&e.pledgeCalculatorForm.controls.installmentAmount.errors.pattern?1:-1)}}function $c(t,l){if(t&1&&p(0,Qc,2,2),t&2){let e=d(2);m(e.pledgeCalculatorForm.invalid&&e.pledgeCalculatorForm.controls.installmentAmount.touched?0:-1)}}function Kc(t,l){t&1&&(a(0,"app-input-group",10),M(1,Wc,2,0,"ng-template",null,2,w)(3,$c,1,1,"ng-template",null,1,w),r()),t&2&&g("appMin",1)}function Xc(t,l){if(t&1){let e=P();a(0,"app-dynamic-pledge-designation",30),c(1,"translate"),c(2,"translate"),c(3,"translate"),y("designationValuesChange",function(i){I(e);let s=d();return b(s.onDesignationValuesChange(i))})("isValidDesignations",function(i){I(e);let s=d();return b(s.onDesignationValidationChange(i))}),r()}if(t&2){let e,n=d();g("header",!0)("footer",!0)("headerText",f(1,8,"LABEL.PLEDGE_DESIGNATION"))("firstLine",f(2,10,"LABEL.PLEDGE_DESIGNATIONS_FIRST_LINE_IN_DONOR_PLEDGE"))("secondLine",f(3,12,"LABEL.PLEDGE_DESIGNATIONS_SECOND_LINE_IN_DONOR_PLEDGE"))("designationOptions",n.designationOptions)("donorPledgeDesignations",n.pledge==null?null:n.pledge.donorPledgeDesignations)("pledgeAmount",n.calculateInstallmentsByTotalAmount?(e=n.pledgeCalculatorForm.get("totalAmount"))==null?null:e.value:(e=n.pledgeCalculatorForm.get("installmentAmount"))==null?null:e.value)}}
1function Jc(t,l){t&1&&(a(0,"i",25),u(1,"attach_money"),r())}function Zc(t,l){t&1&&h(0,"span",26)}function ep(t,l){t&1&&h(0,"span",29)}function tp(t,l){t&1&&h(0,"span",27)}function ip(t,l){if(t&1&&(p(0,Zc,1,0,"span",26),p(1,ep,1,0,"span",29),p(2,tp,1,0,"span",27)),t&2){let e=d(4);m(e.pledgeCalculatorForm.controls.depositAmount.errors!=null&&e.pledgeCalculatorForm.controls.depositAmount.errors.min&&!(e.pledgeCalculatorForm.controls.depositAmount.errors!=null&&e.pledgeCalculatorForm.controls.depositAmount.errors.pattern)?0:-1),o(),m(e.pledgeCalculatorForm.controls.depositAmount.errors!=null&&e.pledgeCalculatorForm.controls.depositAmount.errors.max?1:-1),o(),m(e.pledgeCalculatorForm.controls.depositAmount.errors!=null&&e.pledgeCalculatorForm.controls.depositAmount.errors.pattern?2:-1)}}function np(t,l){if(t&1&&p(0,ip,3,3),t&2){let e=d(3);m(e.pledgeCalculatorForm.invalid&&e.pledgeCalculatorForm.controls.depositAmount.touched?0:-1)}}function op(t,l){t&1&&(a(0,"app-input-group",34),M(1,Jc,2,0,"ng-template",null,2,w)(3,np,1,1,"ng-template",null,1,w),r()),t&2&&g("appMin",1)}function ap(t,l){t&1&&h(0,"span",36)}function rp(t,l){if(t&1&&p(0,ap,1,0,"span",36),t&2){let e=d(4);m(e.pledgeCalculatorForm.controls.depositDate.errors!=null&&e.pledgeCalculatorForm.controls.depositDate.errors.outsideRange?0:-1)}}function sp(t,l){if(t&1&&p(0,rp,1,1),t&2){let e=d(3);m(e.pledgeCalculatorForm.invalid&&e.pledgeCalculatorForm.controls.depositDate.touched?0:-1)}}function lp(t,l){if(t&1&&(a(0,"app-calendar",35),M(1,sp,1,1,"ng-template",null,1,w),r()),t&2){let e=d(2);g("includeTime",!0)("label","FINANCE.LABELS.PLEDGE_DEPOSIT_DATE")("minDate",e.minStartDate)("readonlyInput",!0)("showIcon",!0)}}function dp(t,l){if(t&1&&(a(0,"div",12)(1,"div",14),u(2),c(3,"translate"),r(),a(4,"div"),u(5),c(6,"translate"),r(),a(7,"div",31),h(8,"p-checkbox",32),a(9,"label",33),u(10),c(11,"translate"),r()(),p(12,op,5,1,"app-input-group",34),p(13,lp,3,5,"app-calendar",35),r()),t&2){let e=d();o(2),A(" ",f(3,6,"FINANCE.LABELS.PLEDGE_INITIAL_DEPOSIT")),o(3),A(" ",f(6,8,"FINANCE.MESSAGES.PLEDGE_DEPOSIT_TEXT")," "),o(3),g("binary",!0),o(2),v(f(11,10,"FINANCE.LABELS.PLEDGE_GIVE_DEPOSIT")),o(2),m(e.pledgeCalculatorForm.controls.includesDeposit.value?12:-1),o(),m(e.pledgeCalculatorForm.controls.includesDeposit.value?13:-1)}}function cp(t,l){if(t&1&&(a(0,"span",37),u(1),r()),t&2){let e=l.$implicit;g("id",e.value),o(),v(e.label)}}function pp(t,l){t&1&&h(0,"span",38)}function mp(t,l){if(t&1&&p(0,pp,1,0,"span",38),t&2){let e=d(2);m(e.pledgeCalculatorForm.controls.startDate.errors!=null&&e.pledgeCalculatorForm.controls.startDate.errors.afterEndDate?0:-1)}}function up(t,l){if(t&1&&p(0,mp,1,1),t&2){let e=d();m(e.pledgeCalculatorForm.invalid&&e.pledgeCalculatorForm.controls.startDate.touched?0:-1)}}function fp(t,l){t&1&&h(0,"span",38)}function gp(t,l){if(t&1&&p(0,fp,1,0,"span",38),t&2){let e=d(3);m(e.pledgeCalculatorForm.controls.endDate.errors!=null&&e.pledgeCalculatorForm.controls.endDate.errors.beforeStartDate?0:-1)}}function hp(t,l){if(t&1&&p(0,gp,1,1),t&2){let e=d(2);m(e.pledgeCalculatorForm.invalid&&e.pledgeCalculatorForm.controls.endDate.touched?0:-1)}}function _p(t,l){if(t&1&&(a(0,"app-calendar",20),M(1,hp,1,1,"ng-template",null,1,w),r()),t&2){let e=d();g("calendarView",e.endDateCalendarView)("endOfMonth",e.endOfMonth)("includeTime",!0)("label","FINANCE.LABELS.PLEDGE_LAST_INSTALLMENT_DATE")("maxDate",e.maxEndDate)("minDate",e.minStartDate)("readonlyInput",!0)("showIcon",!0)}}function Cp(t,l){if(t&1&&(a(0,"div",31),h(1,"p-checkbox",41),a(2,"label",42),u(3),r()()),t&2){let e=l.$implicit,n=l.$index;o(),g("id",oi("pledge_option_",n))("inputId",oi("pledge_option_",n,"_input"))("binary",!0)("formControlName",n),o(),g("for",oi("pledge_option_",n,"_input")),o(),v(e.question)}}function vp(t,l){if(t&1&&(a(0,"div"),h(1,"hr"),a(2,"div",39),u(3),c(4,"translate"),r(),a(5,"div",40),Te(6,Cp,4,9,"div",31,Rc),r()()),t&2){let e=d();o(3),v(f(4,1,"FINANCE.LABELS.ADDITIONAL_OPTIONS")),o(3),Oe(e.pledgeOptions)}}function Sp(t,l){if(t&1&&(a(0,"div",21),h(1,"app-pledge-summary-card",43),r()),t&2){let e=d();o(),g("isMobile",e.isMobile)("showStar",e.showStar)}}var Do=(()=>{class t{constructor(e,n,i,s,_,C,D,X,re){this.activePublicTenantSvc=e,this.fundAllowedGiftFrequenciesSvc=n,this.notifySvc=i,this.pledgeCalculatorFormService=s,this.pledgeSvc=_,this.publicLinkSvc=C,this.route=D,this.router=X,this.translate=re,this.attributeToOrgStateIsValid=!0,this.isMobile=!1,this.maxEndDate=new Date,this.pledge={},this.showStar=!1,this.changedTabs=new ne,this.pledgeUpdated=new ne,this.calculateInstallmentsByTotalAmount=!0,this.depositsEnabled=!0,this.designations=[],this.designationOptions=[],this.includeDeposit=!1,this.isDesignations=!1,this.isContinue=!1,this.lastModifiedDesignationIndex=-1,this.minimumNumberOfTransactions=0,this.designationTrackByFn=(Re,Ke)=>Ke.id||`designation_${Re}`,this.minStartDate=new Date,this.placeHolder=this.translate.instant("LABEL.SELECT_AN_OPTION"),this.pledgeFrequencyOptions=[],this.pledgeOptions=[],this.selectedFrequency="",this.endDateCalendarView="date",this.endOfMonth=!1,this.previousFrequency="",this.endOfMonthFrequencies=["monthly","twiceYearly","quarterly"],this.attributeToOrgStateIsValidSubject=ne
1w Ot(!1),this.attributeToOrgStateIsValid$=this.attributeToOrgStateIsValidSubject.asObservable(),this.isLoadingSubject=new Ot(!1),this.isLoading$=this.isLoadingSubject.asObservable(),this.designationValiditySubject=new Ot(!0),this.designationValidity$=this.designationValiditySubject.asObservable(),this.reinitializeFormSubject=new Qi,this.destroyRef=E(J),this.isDesignationsLoading=!1,this.loadedFundId=null,this.destroyRef.onDestroy(()=>{this.pledgeCalculatorForm.reset(),this.isContinue||this.pledgeSvc.clearPledge()})}ngOnChanges(e){e.attributeToOrgStateIsValid&&this.attributeToOrgStateIsValidSubject.next(e.attributeToOrgStateIsValid.currentValue)}ngOnInit(){this.fund=this.route.snapshot.parent.parent.data.fund,this.org=this.activePublicTenantSvc.getActiveTenant(),this.isContinue=!1,this.attributeToOrgStateIsValidSubject.next(this.attributeToOrgStateIsValid);let e=this.pledgeSvc.getPledge();e?.donorPledgeDesignations?.length>0&&(this.pledge=e),this.initForm(),this.loadData(),this.pledge?.donorPledgeDesignations?.length>0&&(globalThis.setTimeout(()=>{this.ensurePledgeDataIsCurrent()},100),this.designationOptions&&this.designationOptions.length>0&&this.ensurePledgeDataIsCurrent())}addPledgeOptionsToFormArray(){let e=this.pledgeCalculatorForm.controls.pledgeOptionsArray;this.pledgeOptions.forEach(()=>{e.push(new Y(!1))})}cancel(){this.pledgeSvc.clearPledge(),this.pledgeCalculatorForm.reset(),this.router.navigate(this.publicLinkSvc.fundList())}continue(){this.isContinue=!0;let e=L({},this.pledge);this.designationOptions&&this.designationOptions.length>0&&(e.designationOptions=this.designationOptions),e.calculateInstallmentsByTotalAmount=this.calculateInstallmentsByTotalAmount,this.pledgeSvc.changePledge(e),this.fund.isParentFund?this.router.navigate(this.publicLinkSvc.pledgeToParentFund(this.fund.orgTenantId,this.fund.url)):this.router.navigate(this.publicLinkSvc.pledgeToFund(this.fund.url))}depositBeforeStartDate(){return this.pledgeCalculatorFormService.depositBeforeStartDate()}getDesignationName(e){return this.pledgeCalculatorFormService.getDesignationName(e,this.designationOptions)}getPledgeOptionIds(e){return this.pledgeCalculatorFormService.getPledgeOptionIds(e,this.pledgeOptions)}initForm(){this.reinitializeFormSubject.next(),this.designationValiditySubject.next(!0);let e=this.calculateInstallmentsByTotalAmount&&this.pledge.totalAmount>0?this.pledge.totalAmount:null,n=!this.calculateInstallmentsByTotalAmount&&this.pledge.installmentAmount>0?this.pledge.installmentAmount:null,i=this.pledge.totalAmount>0||this.pledge.installmentAmount>0,s=i?this.pledge.startDate:null,_=i?this.pledge.endDate:null;this.pledgeFrequencyOptions=this.fundAllowedGiftFrequenciesSvc.setAllowedFrequencyDropDownOptions(this.fund.fundAllowedGiftFrequencies),this.getDesignations(this.fund.id),this.pledgeFrequencyOptions.length===1?(this.selectedFrequency=this.pledgeFrequencyOptions[0].value,this.placeHolder=""):(this.selectedFrequency="",this.placeHolder=this.translate.instant("LABEL.SELECT_AN_OPTION")),this.pledgeCalculatorForm=new Je({frequency:new Y(this.selectedFrequency,{validators:[x.required]}),totalAmount:new Y(e,{validators:[x.pattern(k.MONEY_PATTERN),x.min(1),Qt(()=>this.calculateInstallmentsByTotalAmount,x.required)]}),installmentAmount:new Y(n,{validators:[x.pattern(k.MONEY_PATTERN),x.min(1),Qt(()=>!this.calculateInstallmentsByTotalAmount,x.required)]}),startDate:new Y(s,{validators:[x.required]}),endDate:new Y(_),includesDeposit:new Y(this.pledge.includesDeposit,{updateOn:"change"}),depositAmount:new Y(this.pledge.depositAmount||null,{validators:[x.pattern(k.MONEY_PATTERN),x.min(1),Qt(()=>this.includeDeposit,x.required)]}),depositDate:new Y(this.pledge.depositDate,{validators:[Qt(()=>this.includeDeposit,x.required)]}),pledgeOptionsArray:new hn([])}),this.pledgeCalculatorForm.controls.frequency.value===k.GIFT_FREQUENCIES.find(C=>C.value==="oneTime").value&&(this.maxEndDate=this.pledge.startDate),this.previousFrequency=this.pledgeCalculatorForm.controls.frequency.value||"",this.updateEndDateValidators(),this.pledgeCalculatorForm.valueChanges.pipe(F(C=>{let D=this.pledgeCalculatorForm.controls.frequency.value||"";C.frequency!==this.previousFrequency&&(this.previousFrequency=D,this.updateEndDateValidators());let X=this.pledgeCalculatorFormService.handleEndOfMonthLogic(C,this.endOfMonthFrequencies,this.pledgeCalculatorForm);this.endOfMonth=X.endOfMonth,this.endDateCalendarView=X.endDateCalendarView,this.pledgeCalculatorForm.controls.frequency.value!=="oneTime"&&this.updateEndDateValidators(),this.includeDeposit=this.pledgeCalculatorForm.controls.includesDeposit.value,this.pledgeCalculatorFormService.handleDepositLogic(this.includeDeposit,this.pledgeCalculatorForm),this.shouldCallAPI()&&this.recalculate();let re=this.pledge.donorPledgeDesignations||[],Re=this.pledgeCalculatorFormService.hasDesignationChanges(re,this.pledge),Ke=this.hasValidFormValues(C),Ht=this.calculateInstallmentsByTotalAmount?this.pledge.totalAmount!==(this.pledgeCalculatorForm.get("totalAmount")?.value||0):this.pledge.installmentAmount!==(this.pledgeCalculatorForm.get("installmentAmount")?.value||0);if(this.pledgeCalculatorFormService.shouldUpdatePledge(Re,Ht,this.hasNonDesignationChanges(C),Ke)){let Tt=this.pledgeCalculatorFormService.createUpdatedPledge(this.pledge,re,this.calculateInstallmentsByTotalAmount,this.pledgeCalculatorForm);this.pledgeSvc.changePledge(Tt)}}),N(this.destroyRef),Yt(this.reinitializeFormSubject)).subscribe(),this.pledgeCalculatorFormIsValid$=this.pledgeCalculatorForm.statusChanges.pipe(Ji(this.pledgeCalculatorForm.status),F(C=>{C.toUpperCase()==="INVALID"&&!this.shouldCallAPI()&&!this.isContinue&&this.clearInstallmentCalculations(this.pledge)}),Ze(C=>C.toUpperCase()==="VALID"),N(this.destroyRef),Yt(this.reinitializeFormSubject)),this.canSubmitForm$=Ki([this.attributeToOrgStateIsValid$,this.pledgeCalculatorFormIsValid$,this.isLoading$,this.designationValidity$]).pipe(Ze(([C,D,X,re])=>D&&!X&&C&&re),N(this.destroyRef),Yt(this.reinitializeFormSubject)),this.formSubmitIsDisabled$=this.canSubmitForm$.pipe(Ze(C=>!C),N(this.destroyRef),Yt(this.reinitializeFormSubject))}loadData(){this.pledgeCalculatorFormService.loadData(this.fund.id).subscribe({next:e=>{this.pledgeOptions=e.data,this.addPledgeOptionsToFormArray()},error:e=>{throw this.notifySvc.errorBanner({title:"LABEL.ERROR",message:"FINANCE.ERRORS.LOADING_ADDITIONAL_PLEDGE_OPTIONS"}),e}})}onDesignationValuesChange(e){let n=this.pledgeCalculatorFormService.getDesignationValues(e),i=L({},this.pledge);i.donorPledgeDesignations=n,i.calculateInstallmentsByTotalAmount=this.calculateInstallmentsByTotalAmount,this.designationOptions&&this.designationOptions.length>0&&(i.designationOptions=this.designationOptions),this.pledge=i,this.pledgeSvc.changePledge(i)}onDesignationValidationChange(e){this.designationValiditySubject.next(e)}recalculate(){let e=this.pledgeCalculatorForm.value,n={},i=e.endDate;e.frequency===k.GIFT_FREQUENCIES.find(s=>s.value==="oneTime").value&&(i=e.startDate),this.isLoadingSubject.next(!0),this.calculateInstallmentsByTotalAmount?this.pledgeSvc.getInstallmentPlanByTotalAmount(e.frequency,e.totalAmount,e.startDate,i,e.includesDeposit?e.depositAmount:0).subscribe({next:s=>{s.installmentAmount<1?this.pledgeCalculatorForm.controls.totalAmount.setErrors({minInstallment:!0}):this.pledgeCalculatorForm.controls.totalAmount.setErrors(null),this.pledgeCalculatorForm.controls.depositAmount.value>=s.totalAmount?this.pledgeCalculatorForm.controls.depositAmount.setErrors({max:!0}):this.pledgeCalculatorForm.controls.depositAmount.setErrors(null),this.updatePledgeInfo(n,s,e),this.isLoadingSubject.next(!1)},error:s=>{this.notifySvc.errorBanner({title:"LABEL.ERROR",message:s.validationMessage||s.message||this.translate.instant("FINANCE.ERRORS.CONTACT_SUPPORT")}),this.isLoadingSubject.next(!1)}}):this.pledgeSvc.getInstallmentPlanByInstallmentAmount(e.frequency,e.installmentAmount,e.startDate,i,e.includesDeposit?e.depositAmount:0).subscribe({next:s=>{this.updatePledgeInfo(n,s,e),this.isLoadingSubject.next(!1)},error:s=>{this.notifySvc.errorBanner({title:"LABEL.ERROR",message:s.validationMessage||s.message||this.translate.instant("FINANCE.ERRORS.CONTACT_SUPPORT")}),this.isLoadingSubject.next(!1)}})}
1startDateBeforeEndDate(){return this.pledgeCalculatorFormService.startDateBeforeEndDate()}switchToInstallmentTab(){this.calculateInstallmentsByTotalAmount=!1,this.changedTabs.emit(),this.pledge.installmentAmount&&this.pledge.installmentAmount>0&&this.pledgeCalculatorForm.get("installmentAmount")?.setValue(this.pledge.installmentAmount),this.shouldCallAPI()&&this.recalculate()}switchToTotalTab(){this.calculateInstallmentsByTotalAmount=!0,this.changedTabs.emit(),this.pledge.totalAmount&&this.pledge.totalAmount>0&&this.pledgeCalculatorForm.get("totalAmount")?.setValue(this.pledge.totalAmount),this.shouldCallAPI()&&this.recalculate()}updateDisplayedSummaryValues(e){this.isContinue||(this.pledge.frequency=e.controls.frequency.value,this.pledge.startDate=e.controls.startDate.value,this.pledge.endDate=e.controls.endDate.value,this.pledge.calculateInstallmentsByTotalAmount=this.calculateInstallmentsByTotalAmount,this.calculateInstallmentsByTotalAmount?this.pledge.totalAmount=e.controls.totalAmount.value>0?e.controls.totalAmount.value:null:this.pledge.installmentAmount=e.controls.installmentAmount.value>0?e.controls.installmentAmount.value:null,this.pledgeSvc.changePledge(this.pledge))}updateForm(e){this.pledge=e,this.initForm()}getDesignationPercentageValue(e){let n=e.get("percentage_value")?.value;return typeof n=="number"?n:0}getDesignationDropdownValue(e){let n=e.get("designation_dropdown")?.value;return typeof n=="string"?n:""}getDesignationPercentageInputValue(e){let n=e.get("percentage_input")?.value;return typeof n=="number"?n:0}hasValidDesignationValues(e){let n=this.getDesignationDropdownValue(e),i=this.getDesignationPercentageInputValue(e);return!!n&&i>0}clearInstallmentCalculations(e){e.installmentCount=void 0,this.calculateInstallmentsByTotalAmount&&(e.installmentAmount=void 0),e.lastInstallmentAmount=void 0,e.calculateInstallmentsByTotalAmount=this.calculateInstallmentsByTotalAmount,this.pledgeSvc.changePledge(e)}ensurePledgeDataIsCurrent(){if(this.pledge?.donorPledgeDesignations?.length>0){let e=L({},this.pledge);e.donorPledgeDesignations=this.pledge.donorPledgeDesignations||[],e.calculateInstallmentsByTotalAmount=this.calculateInstallmentsByTotalAmount,this.designationOptions&&this.designationOptions.length>0&&(e.designationOptions=this.designationOptions),e.donorPledgeDesignations.length>0&&this.pledgeSvc.changePledge(e)}}getDesignations(e){this.isDesignationsLoading||this.loadedFundId===e&&this.designationOptions.length>0||(this.isDesignationsLoading=!0,this.pledgeCalculatorFormService.getDesignations(e).subscribe({next:n=>{this.designationOptions=n,this.loadedFundId=e,this.isDesignationsLoading=!1},error:()=>{this.isDesignationsLoading=!1}}))}hasNonDesignationChanges(e){return this.pledgeCalculatorFormService.hasNonDesignationChanges(e,this.pledge)}hasValidFormValues(e){return this.pledgeCalculatorFormService.hasValidFormValues(e,this.calculateInstallmentsByTotalAmount)}updateEndDateValidators(){let e=this.pledgeCalculatorForm.controls.frequency.value,n=this.pledgeCalculatorForm.controls.endDate;e===k.GIFT_FREQUENCIES.find(s=>s.value==="oneTime")?.value?n.clearValidators():n.setValidators([x.required]),n.updateValueAndValidity({emitEvent:!1})}shouldCallAPI(){let e=this.pledgeCalculatorFormService.shouldCallAPI(this.pledgeCalculatorForm,this.calculateInstallmentsByTotalAmount);return this.updateDisplayedSummaryValues(this.pledgeCalculatorForm),e}updatePledgeInfo(e,n,i){e.calculateInstallmentsByTotalAmount=this.calculateInstallmentsByTotalAmount,e.donorPledgeDesignations=this.pledge.donorPledgeDesignations||[],e.installmentAmount=n.installmentAmount,e.totalAmount=n.totalAmount,e.installmentCount=n.installmentCount,e.lastInstallmentAmount=n.lastInstallmentAmount,e.frequency=i.frequency,e.startDate=i.startDate,e.endDate=i.endDate?i.endDate:null,e.includesDeposit=i.includesDeposit,e.depositAmount=i.depositAmount,e.depositDate=i.depositDate?i.depositDate:null,e.localStartDate=qe.fromJSDate(e.startDate).toFormat("MM/dd/yyyy"),e.endDate&&(e.localEndDate=qe.fromJSDate(e.endDate).toFormat("MM/dd/yyyy")),e.pledgeOptionIds=this.getPledgeOptionIds(i),e.attributeToAssociatedOrganizationId=this.pledge.attributeToAssociatedOrganizationId,e.giftParam=this.pledge.giftParam,e.includesDeposit&&e.depositDate&&(e.localDepositDate=qe.fromJSDate(e.depositDate).toFormat("MM/dd/yyyy")),this.pledgeSvc.changePledge(e)}static{this.\u0275fac=function(n){return new(n||t)(S(fe),S(wi),S(te),S(Mo),S(ye),S(ie),S(U),S(ee),S(oe))}}static{this.\u0275cmp=O({type:t,selectors:[["app-pledge-calculator-form"]],inputs:{attributeToOrgStateIsValid:"attributeToOrgStateIsValid",isMobile:"isMobile",maxEndDate:"maxEndDate",pledge:"pledge",showStar:"showStar"},outputs:{changedTabs:"changedTabs",pledgeUpdated:"pledgeUpdated"},features:[en],decls:38,vars:40,consts:[["item",""],["errors",""],["prepend",""],["id","calculatorForm",3,"formGroup"],["id","tabHeaders",1,"flex","flex-full-width"],["id","totalForm",1,"font-bold","flex","flex-column","flex-half-width",3,"click","ngClass"],[1,"text-center"],["id","installmentForm",1,"font-bold","flex","flex-column","flex-half-width",3,"click","ngClass"],["
1id","formComponents"],["appNumericOnly","Decimal","formControlName","totalAmount","inputId","totalAmount","label","FINANCE.LABELS.PLEDGE_TOTAL_AMOUNT","type","number",3,"appMin"],["appNumericOnly","Decimal","formControlName","installmentAmount","inputId","installmentAmount","label","FINANCE.LABELS.PLEDGE_INSTALLMENT_AMOUNT","type","number",3,"appMin"],[3,"header","footer","headerText","firstLine","secondLine","designationOptions","donorPledgeDesignations","pledgeAmount"],["id","deposit_div"],["id","installment_div"],[1,"section-header"],["variant","in"],["appendTo","body","formControlName","frequency","id","frequency",3,"options"],["for","frequency","translate","LABEL.FREQUENCY"],["appendTo","body","formControlName","startDate","inputId","startDate",3,"includeTime","label","maxDate","minDate","readonlyInput","showIcon"],[1,"pb-1",3,"inputDate","frequency"],["appendTo","body","formControlName","endDate","inputId","endDate",3,"calendarView","endOfMonth","includeTime","label","maxDate","minDate","readonlyInput","showIcon"],["id","pledge_review_container"],[1,"app-card-footer","mobile-footer-buttons","flex","align-items-center","justify-content-center"],["pButton","","id","cancel_button","type","button",1,"p-button","p-button-outlined","p-button-plain","w-full","mobile-btn",3,"click","label"],["buttonClasses","p-button w-full mobile-btn","buttonId","continue_button","label","LABEL.CONTINUE","loadingLabel","LABEL.PROCESSING",1,"w-full",3,"disabled","form","isLoading","submit"],[1,"material-icons","no-select"],["translate","ERROR.INVALID_AMOUNT_LARGER_THAN_ONE"],["translate","ERROR.INVALID_AMOUNT"],["translate","ERROR.INVALID_INSTALLMENT_AMOUNT"],["translate","ERROR.DEPOSIT_AMOUNT_FULFILLS_PLEDGE"],[3,"designationValuesChange","isValidDesignations","header","footer","headerText","firstLine","secondLine","designationOptions","donorPledgeDesignations","pledgeAmount"],[1,"checkbox-wrapper"],["formControlName","includesDeposit","id","includesDeposit","inputId","includes_deposit_input",3,"binary"],["for","includes_deposit_input"],["appNumericOnly","Decimal","formControlName","depositAmount","inputId","depositAmount","label","FINANCE.LABELS.PLEDGE_DEPOSIT_AMOUNT","type","number",3,"appMin"],["appendTo","body","formControlName","depositDate","inputId","depositDate",3,"includeTime","label","minDate","readonlyInput","showIcon"],["translate","ERROR.DEPOSIT_DATE_PAST_PLEDGE_START"],[3,"id"],["translate","FINANCE.ERRORS.PLEDGE_END_DATE_BEFORE_START_DATE"],["id","additional_pledge_options_title",1,"font-bold"],["formArrayName","pledgeOptionsArray","id","fund_pledge_options",1,"flex","flex-column","gap-0.5","pt-1"],[3,"id","inputId","binary","formControlName"],[3,"for"],[3,"isMobile","showStar"]],template:function(n,i){n&1&&(a(0,"form",3)(1,"div",4)(2,"div",5),y("click",function(){return i.switchToTotalTab()}),a(3,"div",6),u(4),c(5,"translate"),r()(),a(6,"div",7),y("click",function(){return i.switchToInstallmentTab()}),a(7,"div",6),u(8),c(9,"translate"),r()()(),a(10,"div",8),p(11,jc,5,1,"app-input-group",9)(12,Kc,5,1,"app-input-group",10),p(13,Xc,4,14,"app-dynamic-pledge-designation",11),p(14,dp,14,12,"div",12),h(15,"hr"),a(16,"div",13)(17,"div",14),u(18),c(19,"translate"),r(),a(20,"p-floatlabel",15)(21,"p-select",16),M(22,cp,2,2,"ng-template",null,0,w),r(),h(24,"label",17),r(),a(25,"app-calendar",18),M(26,up,1,1,"ng-template",null,1,w),r(),h(28,"app-end-of-month-date-check",19),p(29,_p,3,8,"app-calendar",20),r(),p(30,vp,8,3,"div"),r(),p(31,Sp,2,2,"div",21),a(32,"div",22)(33,"button",23),c(34,"translate"),y("click",function(){return i.cancel()}),r(),h(35,"app-form-submit-button",24),c(36,"async"),c(37,"async"),r()()),n&2&&(g("formGroup",i.pledgeCalculatorForm),o(2),g("ngClass",i.calculateInstallmentsByTotalAmount?"mock-active-tab":"mock-tab"),o(2),v(f(5,28,"FINANCE.LABELS.PLEDGE_TOTAL")),o(2),g("ngClass",i.calculateInstallmentsByTotalAmount?"mock-tab":"mock-active-tab"),o(2),v(f(9,30,"FINANCE.LABELS.PLEDGE_INSTALLMENTS_HEADER")),o(3),m(i.calculateInstallmentsByTotalAmount?11:12),o(2),m(i.designationOptions&&i.designationOptions.length>0?13:-1),o(),m(i.depositsEnabled?14:-1),o(4),A(" ",f(19,32,"FINANCE.LABELS.PLEDGE_INSTALLMENT_SETTINGS")),o(3),g("options",i.pledgeFrequencyOptions),ei("placeholder",i.placeHolder||null),o(4),g("includeTime",!0)("label","FINANCE.LABELS.PLEDGE_FIRST_INSTALLMENT_DATE")("maxDate",i.maxEndDate)("minDate",i.pledgeCalculatorForm.controls.depositDate.value)("readonlyInput",!0)("showIcon",!0),o(3),g("inputDate",i.pledgeCalculatorForm.value.startDate)("frequency",i.pledgeCalculatorForm.value.frequency),o(),m(i.pledgeCalculatorForm.controls.frequency.value!=="oneTime"?29:-1),o(),m(i.pledgeOptions&&i.pledgeOptions.length>0?30:-1),o(),m(i.isMobile?31:-1),o(2),g("label",j(f(34,34,"LABEL.CANCEL"))),o(2),g("disabled",f(36,36,i.formSubmitIsDisabled$))("form",i.pledgeCalculatorForm)("isLoading",f(37,38,i.isLoading$))("submit",i.continue.bind(i)))},dependencies:[Rt,ve,de,se,le,be,Ce,_e,_n,si,_i,Si,Se,xn,ge,ro,ht,gt,Tn,hi,gi,ao,lt,Z,Ee,ke,G],styles:[".mock-active-tab[_ngcontent-%COMP%]{padding:.5rem 0;background-color:#5d009d12;border-bottom:thick solid var(--primary-color);color:var(--primary-color);margin-bottom:1rem;height:3.375rem;justify-content:center}.mock-tab[_ngcontent-%COMP%]{padding:.5rem 0;border-bottom:var(--text-color);border-bottom-style:solid;border-bottom-width:thin;margin-bottom:1rem;cursor:pointer;height:3.375rem;justify-content:center}[id$=cancel-button][_ngcontent-%COMP%]{margin:.5rem .25rem}@supports (container-type: inline-size){@container content-container (min-width: 600px){[id$=cancel-button][_ngcontent-%COMP%]{margin:.5rem 1rem .5rem 0}}}@supports not (container: content-container){@media(min-width:600px){[id$=cancel-button][_ngcontent-%COMP%]{margin:.5rem 1rem .5rem 0}}}.first-form-input[_ngcontent-%COMP%]{margin-top:1rem}.section-header[_ngcontent-%COMP%]{font-weight:700;font-size:1rem;padding-bottom:.5rem}p-checkbox[_ngcontent-%COMP%]{margin:.75rem 0}#pledge_review_container[_ngcontent-%COMP%]{margin-bottom:1rem}"]})}}return t})();var yp=["attributeToAssociatedOrganizationDropdown"],Ip=["pledgenator"],bp=t=>({orgName:t});function Ep(t,l){if(t&1&&(a(0,"div",6),h(1,"app-pledge-summary-card",14),r()),t&2){let e=d();o(),g("isMobile",e.isMobile())("showStar",e.showStar)}}function Pp(t,l){if(t&1){let e=P();a(0,"div",10),h(1,"hr"),a(2,"form",15)(3,"app-associated-organizations-dropdown",16,1),y("dropdownCtrlBlur",function(){I(e);let i=d();return b(i.onAssociatedOrgDropdownEvent())})("dropdownCtrlChange",function(){I(e);let i=d();return b(i.onAssociatedOrgDropdownEvent())}),r()(),h(5,"hr"),r()}if(t&2){let e=d();o(2),g("formGroup",e.form)}}function Ap(t,l){if(t&1&&(a(0,"div",11)(1,"div"),u(2),c(3,"translate"),r(),a(4,"div",17),u(5),r(),h(6,"hr"),r()),t&2){let e=d();o(2),v(T(3,2,"FINANCE.LABELS.GIFT_ATTRIBUTED_TO",R(5,bp,e.fund.orgName))),o(3),v(e.assocOrgName)}}var Go=(()=>{class t{constructor(e,n,i,s,_,C,D,X){this.activePublicTenantSvc=e,this.associatedOrgQueryParamSvc=n,this.fundAllowedGiftFrequenciesSvc=i,this.pledgeSvc=s,this.route=_,this.router=C,this.associatedOrganizationsDropdownSvc=D,this.utilityService=X,this.destroyRef=E(J),this.injector=E(Jt),this.breakpointSvc=E(tt),this.isMobile=this.breakpointSvc.underTablet,this.showStar=!1,this.frequency="weekly",this.pledge={},this.attributeToOrgStateIsValid=!0,this.givingQueryParams=null,this.associatedOrgBasedOnExternalId=null,this.showLockedInOrgDisplay=!1,this.showAssociatedOrgDropdown=!1}ngOnInit(){this.orgName=this.activePublicTenantSvc.getActiveTenant().name,this.fund=this.route.
1snapshot.parent.data.fund,this.associatedOrganizationsDropdownSvc.setFund(this.fund),this.fund.endDate&&(this.maxEndDate=qe.fromJSDate(new Date(this.fund.endDate)).startOf("day").toJSDate()),this.fund.allowOnlinePledges||this.router.navigate(["/notFound"],{skipLocationChange:!0}),this.pledgeSvc.pledge.pipe(N(this.destroyRef)).subscribe(e=>{if(e){this.pledge=e,!(e.startDate||e.endDate)&&(e.totalAmount>0||e.installmentAmount>0)&&this.defaultDates(),this.showStar=e.lastInstallmentAmount>0&&e.installmentAmount!==e.lastInstallmentAmount;let n=this.fundAllowedGiftFrequenciesSvc.setAllowedFrequencyDropDownOptions(this.fund.fundAllowedGiftFrequencies)}}),this.initForm()}initForm(){this.form=new Dt({attributeToAssociatedOrganizationId:new he(this.pledge.attributeToAssociatedOrganizationId)}),this.associatedOrgQueryParamSvc.handleQueryParams(this.route,this.fund.associatedOrganizationSelection).subscribe(e=>{this.associatedOrgBasedOnExternalId=e,this.setAssociatedOrgCtrlVisibility()}),this.showAssociatedOrgDropdown&&Zt(()=>{this.associatedOrgDropdown.dropdownElement.applyFocus()},{injector:this.injector})}setAssociatedOrgCtrlVisibility(){this.givingQueryParams=this.associatedOrgQueryParamSvc.getGivingQueryParams(),this.fund.associatedOrganizationSelection!=="Hidden"?(this.givingQueryParams&&this.givingQueryParams.giftParam&&(this.pledge.giftParam=this.givingQueryParams.giftParam),this.fund.isParentFund?(this.showLockedInOrgDisplay=!0,this.assocOrgName=this.fund.associatedOrganizationName,this.form.controls.attributeToAssociatedOrganizationId.setValue(this.fund.associatedOrganizationId),this.pledge.attributeToAssociatedOrganizationId=this.fund.associatedOrganizationId):this.associatedOrgBasedOnExternalId&&this.givingQueryParams&&this.givingQueryParams.locked?(this.showLockedInOrgDisplay=!0,this.pledge.attributeToAssociatedOrganizationId=this.associatedOrgBasedOnExternalId.id,this.assocOrgName=this.associatedOrgBasedOnExternalId.displayNameAndLocation):(this.showAssociatedOrgDropdown=!0,this.fund.associatedOrganizationSelection==="Required"?this.form.controls.attributeToAssociatedOrganizationId.setValidators(x.required):this.form.controls.attributeToAssociatedOrganizationId.clearValidators(),this.form.controls.attributeToAssociatedOrganizationId.updateValueAndValidity(),this.associatedOrgBasedOnExternalId&&!this.pledge.attributeToAssociatedOrganizationId&&(this.form.controls.attributeToAssociatedOrganizationId.setValue(this.associatedOrgBasedOnExternalId.id),this.assocOrgName=this.associatedOrgBasedOnExternalId.displayNameAndLocation)),this.pledgeSvc.changePledge(this.pledge)):(this.showAssociatedOrgDropdown=!1,this.showLockedInOrgDisplay=!1)}onAssociatedOrgDropdownEvent(){this.form.controls.attributeToAssociatedOrganizationId.value?(this.attributeToOrgStateIsValid=!0,this.pledge=this.pledgeSvc.getPledge(),this.pledge.attributeToAssociatedOrganizationId=this.form.controls.attributeToAssociatedOrganizationId.value,this.pledgeSvc.changePledge(this.pledge)):this.attributeToOrgStateIsValid=this.fund.associatedOrganizationSelection!=="Required"}defaultDates(){let e=new Date,n;this.fund.campaignEndDate&&this.utilityService.convertToLuxonDateTime(this.fund.campaignEndDate)>=this.utilityService.convertToLuxonDateTime(e)?n=new Date(this.fund.campaignEndDate):this.fund.endDate&&this.utilityService.convertToLuxonDateTime(this.fund.endDate)>this.utilityService.convertToLuxonDateTime(e)?n=new Date(this.fund.endDate):n=null,this.pledge.startDate=e,this.pledge.endDate=n}pledgeChanged(){this.pledge=this.pledgeSvc.getPledge(),this.pledgenator.updateForm(this.pledge)}switchTabs(){this.showStar=!1,this.pledgenator.updateForm(this.pledge)}static{this.\u0275fac=function(n){return new(n||t)(S(fe),S(Et),S(wi),S(ye),S(U),S(ee),S(Mi),S(In))}}static{this.\u0275cmp=O({type:t,selectors:[["app-pledge-setup-view"]],viewQuery:function(n,i){if(n&1&&me(yp,5)(Ip,7),n&2){let s;W(s=H())&&(i.associatedOrgDropdown=s.first),W(s=H())&&(i.pledgenator=s.first)}},features:[ai([Mi])],decls:21,vars:23,consts:[["pledgenator",""],["attributeToAssociatedOrganizationDropdown",""],[1,"flex","justify-content-center","layout-container"],[1,"flex","flex-column","container"],[3,"orgName","fund"],[1,"w-full","flex","flex-row-reverse","justify-content-center","flex-wrap","content-container"],["id","pledge_review_container"],["id","pledge_calculator_container"],["id","pledge_calculator_card",1,"h-auto","gift-review-card",3,"header"],[1,"mb-1"],[1,"flex-full-width","associated-org-container","mb-1"],[1,"flex-full-width","associated-org-container"],[1,"mb-1","font-bold"],["
1id","pledgeInstallmentForm",3,"changedTabs","pledgeUpdated","attributeToOrgStateIsValid","pledge","showStar","maxEndDate","isMobile"],[3,"isMobile","showStar"],["novalidate","","id","select_org_form",3,"formGroup"],["formControlName","attributeToAssociatedOrganizationId",3,"dropdownCtrlBlur","dropdownCtrlChange"],[1,"font-bold"]],template:function(n,i){n&1&&(a(0,"div",2)(1,"div",3),h(2,"app-associated-org-name-card",4),a(3,"div",5),p(4,Ep,2,2,"div",6),a(5,"div",7)(6,"app-card",8),c(7,"translate"),a(8,"div",9),u(9),c(10,"translate"),r(),p(11,Pp,6,1,"div",10),p(12,Ap,7,7,"div",11),a(13,"div",9),u(14),c(15,"translate"),r(),a(16,"div",12),u(17),c(18,"translate"),r(),a(19,"app-pledge-calculator-form",13,0),y("changedTabs",function(){return i.switchTabs()})("pledgeUpdated",function(){return i.pledgeChanged()}),r()()()()()()),n&2&&(o(2),g("orgName",i.orgName)("fund",i.fund),o(2),m(i.isMobile()?-1:4),o(2),g("header",j(f(7,15,"FINANCE.LABELS.PLEDGE_SETUP"))),o(3),A(" ",f(10,17,"FINANCE.MESSAGES.PLEDGE_SETUP_INSTRUCTION")," "),o(2),m(i.showAssociatedOrgDropdown?11:-1),o(),m(i.showLockedInOrgDisplay?12:-1),o(2),A(" ",f(15,19,"FINANCE.MESSAGES.PLEDGE_SETUP_INSTRUCTION_SECOND_PARAGRAPH")," "),o(3),A("",f(18,21,"FINANCE.MESSAGES.CALCULATE_YOUR_PLEDGE_BY"),":"),o(2),g("attributeToOrgStateIsValid",i.attributeToOrgStateIsValid)("pledge",i.pledge)("showStar",i.showStar)("maxEndDate",i.maxEndDate)("isMobile",i.isMobile()))},dependencies:[qt,lt,$,ve,de,se,le,be,Ce,_e,oo,Se,Do,G],styles:["#pledge_review_container[_ngcontent-%COMP%]{margin-bottom:1rem;width:100%}@supports (container-type: inline-size){@container content-container (min-width: 960px){#pledge_review_container[_ngcontent-%COMP%]{margin-left:1.5rem;width:20rem}}}@supports not (container: content-container){@media(min-width:960px){#pledge_review_container[_ngcontent-%COMP%]{margin-left:1.5rem;width:20rem}}}#pledge_calculator_container[_ngcontent-%COMP%]{flex:1 1 30rem;max-width:100%}@supports (container-type: inline-size){@container content-container (min-width: 960px){#pledge_calculator_container[_ngcontent-%COMP%]{max-width:41.75rem}}}@supports not (container: content-container){@media(min-width:960px){#pledge_calculator_container[_ngcontent-%COMP%]{max-width:41.75rem}}}"]})}}return t})();var Fo=[{path:"",resolve:{donorPledges:zi,donorGifts:qi},runGuardsAndResolvers:"always",component:fo,data:{titleKey:"LABEL.FUND_DETAILS"}},{path:"giftIncrease",component:yo,canActivate:[Jn],data:{titleKey:"LABEL.GIFT_INCREASE_OPTIONS"},resolve:{fund:Ni}},{path:"give",component:Po,canActivate:[eo],data:{titleKey:"LABEL.GIFT_INFO"}},{path:"pledge",children:[{path:"",component:Go,data:{titleKey:"LABEL.PLEDGE"}},{path:"give",component:No,canActivate:[to],data:{titleKey:"LABEL.GIFT_INFO"}},{path:":pledgeId/confirmation",component:Ao,data:{titleKey:"LABEL.CONFIRMATION"},resolve:{pledgeSubmission:io}}]}],Ro=[{path:"funds",children:[{path:"",resolve:{donorPledges:zi,donorGifts:qi},runGuardsAndResolvers:"always",component:go,data:{titleKey:"LABEL.FUNDS"}},{path:":fundUrl",resolve:{fund:Ni},children:Fo},{path:"confirmations/:giftId",component:ho,data:{titleKey:"LABEL.CONFIRMATION"},resolve:{giftSubmission:Zn}},{path:":orgTenantId/:fundUrl",resolve:{fund:Ni},children:Fo}]},{path:"invitations/accept/:invitationId",component:uo,resolve:{invitation:co},data:{hideTopbarNav:!0,titleKey:"FINANCE.LABELS.ACCEPT_INVITATION"}}];var e1=(()=>{class t{static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275mod=tn({type:t})}static{this.\u0275inj=Zi({imports:[lo,mn.forChild(Ro)]})}}return t})();export{mo as AcceptDonorInviteExistingUserComponent,po as AcceptDonorInviteNewUserComponent,uo as AcceptDonorInviteViewComponent,qt as AssociatedOrgNameCardComponent,co as DonorInvitationResolver,e1 as FinancePublicModule,fo as FundViewComponent,go as FundsViewComponent,ho as GiftConfirmationViewComponent,So as GiftIncreaseComponent,_o as GiftIncreaseConfirmationComponent,Ri as GiftIncreaseFundHeaderComponent,Li as GiftIncreaseMatchStickComponent,Wt as GiftIncreaseStatus,xt as GiftIncreaseSteps,Co as GiftIncreaseSummaryComponent,vo as GiftIncreaseUpdateGiftComponent,yo as GiftIncreaseViewComponent,Po as GiftInfoViewComponent,Vi as GuestContactInfoComponent,bo as GuestGiftInfoComponent,Io as GuestGiftPaymentInfoComponent,Do as PledgeCalculatorFormComponent,Mo as PledgeCalculatorFormService,Ao as PledgeConfirmationComponent,No as PledgeGiftInfoViewComponent,Oo as PledgeGuestGiftInfoComponent,To as PledgeGuestGiftPaymentInfoComponent,Go as PledgeSetupViewComponent,lt as PledgeSummaryCardComponent,wo as PledgeUserGiftInfoComponent,Eo as UserGiftInfoComponent};
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.