1"use strict";(self.rspackChunkvagaro_websitebuilder_consumer=self.rspackChunkvagaro_websitebuilder_consumer||[]).push([[2012],{56312(e,t,a){a.r(t),a.d(t,{default:()=>ee});var r=a(74848),s=a(96540),n=a(75563),o=a(45964),i=a(8221),d=a(28733);class l{static async addCreditCard(e){return(await i.Ay.post(d.Yw.saveCreditCard(),e)).data}static async getPaymentMethods(e){return(await i.Ay.post(d.Yw.getPaymentMethods(),e)).data.data}static async deletePaymentMethod(e){return(await i.Ay.post(d.Yw.deletePaymentMethod(),e)).data}static async cardDataInfoPaymentMethod(e){return(await i.Ay.post(d.Yw.cardDataInfoPaymentMethod(),e)).data}static async logCreditCardDetail(e){let t=(await i.Ay.post(d.Yw.logCreditCardDetail(),e)).data.data;if(void 0===t)throw Error("No data received from the server");return t}static async saveCreditCard(e){let t=(await i.Ay.post(d.Yw.saveCreditCard(),e)).data.data;if(void 0===t)throw Error("No data received from the server");return t}static async getPaymentMethodDetails(e){let t=(await i.Ay.post(d.Yw.getPaymentMethodDetails(),e)).data.data;if(!t)throw Error("No data received from the server");return t}static async getIpAddress(){return(await i.Ay.get("https://api.ipify.org?format=json")).data.ip}static async getBankDetails(e){let t=(await i.Ay.post(d.Yw.getBankDetails(),e)).data.data;if(!t)throw Error("No data received from the server");return t}static async deleteBankDetails(e){let t=(await i.Ay.post(d.Yw.deleteBankDetails(),e)).data.data;if(!t)throw Error("No data received from the server");return t}static async replaceCardOnFile(e){let t=(await i.Ay.post(d.Yw.replaceCardOnFile(),e)).data.data;if(!t)throw Error("No data received from the server");return t}static async saveInitialccDetailLogs(e){let t=(await i.Ay.post(d.Yw.saveInitialccDetailLogs(),e)).data;if(null==t.Data||void 0===t.Data)throw Error("No data saved from server");return t.Data}}var c=a(24708),u=a(58011),p=a(72834),m=a(98767);let y={customerPaymentItem:"customerPaymentItem-FwiucL",cardTypeIcon:"cardTypeIcon-RUu9Sx",cardInfo:"cardInfo-cqgGKT"},h={visa:"fa-brands fa-cc-visa",discover:"fa-brands fa-cc-discover",amex:"fa-brands fa-cc-amex",mastercard:"fa-brands fa-cc-mastercard",default:"fa-solid fa-credit-card"};function g(e){let{creditCardType:t,size:a="36px",color:s="#0070ba"}=e,n=h[t?.toLowerCase()]||h.default;return(0,r.jsx)("i",{className:n,style:{color:s,fontSize:a},"aria-label":`${t} credit card`})}function f(e){let{customerPayment:t}=e;return(0,r.jsxs)("div",{className:y.customerPaymentItem+" vg-body-font web-body-font web-builder-font-color",children:[(0,r.jsx)("div",{className:y.cardTypeIcon,children:(0,r.jsx)(g,{creditCardType:t.creditCardType})}),(0,r.jsxs)("div",{className:y.cardInfo,children:[(0,r.jsx)("div",{className:"vg-subheading-font web-subheading-font web-builder-font-color",children:t.creditCardType}),(0,r.jsxs)("div",{className:"web-body-font web-builder-font-color",children:["Ending in ",t.creditCardNumber]})]}),(0,r.jsx)("div",{className:y.moreInfo,children:(0,r.jsx)(m.qy,{name:"chevronRight",width:13.5,height:20})})]})}var w=a(92656),C=a(54454);let b={paymentMethodHeaderSection:"paymentMethodHeaderSection-UPn63y",ccType:"ccType-regisk",headerSectionButtons:"headerSectionButtons-tk1i0R",cards:"cards-w7H0U9",cardsTitle:"cardsTitle-D8g3lp",buttonSectionDelete:"buttonSectionDelete-gy6vmJ",businessItem:"businessItem-ILBBU6",businessItemPopup:"businessItemPopup-e8yZ8E",businessImage:"businessImage-IvskgM",businessInfo:"businessInfo-q3Tig7",backButtonContainer:"backButtonContainer-FtHbqw",deleteCardList:"deleteC
1ardList-minZmT",DCgroup:"DCgroup-H8d71U",dCgroup:"DCgroup-H8d71U",deleteCardcell:"deleteCardcell-uF6BWA",DCardimg:"DCardimg-Uhm2Tj",dCardimg:"DCardimg-Uhm2Tj",DCarddetail:"DCarddetail-Q7L0i6",dCarddetail:"DCarddetail-Q7L0i6",centerScreen:"centerScreen-IIs58y",overlay:"overlay-EUfFEC",ffIconRow:"ffIconRow-YcvA7z"},v=e=>{let{cc:t,isSelected:a,ReplaceOnCard:n,IsFromDetailCall:o}=e;return(0,r.jsx)(s.Suspense,{children:(0,r.jsxs)("div",{onClick:()=>n(t,o),className:"card-RUZJhO vg-body-font web-body-font web-builder-font-color",style:{paddingLeft:"12px",paddingRight:"2px"},children:[(0,r.jsx)(g,{creditCardType:t.creditCardType}),(0,r.jsxs)("div",{style:{height:"48px",alignContent:"center",flex:1},children:[(0,r.jsx)("div",{className:"vg-subheading-font web-subheading-font web-builder-font-color",children:t.creditCardType}),(0,r.jsxs)("div",{style:{fontSize:"13px"},children:["Ending in ",t.creditCardNumber]})]}),a&&(0,r.jsx)("div",{style:{display:"flex",alignItems:"center",marginRight:"var(--spacing_4)"},children:(0,r.jsx)(m.qy,{width:24,style:{color:"green"},name:"check_circle"})})]})})};var I=a(79874),N=a(60458);function x(){return(0,N.G)(),(0,r.jsx)(s.Suspense,{fallback:(0,r.jsx)(w.A,{isLoading:!0}),children:(0,r.jsxs)("div",{className:"vg-body-font web-body-font web-builder-font-color stenciled",style:{marginTop:"var(--spacing_12)"},children:[(0,r.jsx)(C.A,{onClick:()=>{},children:"Back"}),(0,r.jsxs)("div",{className:b.paymentMethodHeaderSection,children:[(0,r.jsx)("div",{className:(0,I.A)(b.ccType,"vg-display-medium","web-display-medium","web-builder-font-color","stencil-item"),style:{width:"50%",height:"26px",marginBottom:"4px"}}),(0,r.jsx)("div",{className:(0,I.A)("web-body-font","web-builder-font-color",b.ccNumber,"stencil-item"),style:{width:"25%",height:"18px",marginBottom:"2px"}}),(0,r.jsx)("div",{className:(0,I.A)("web-body-font","web-builder-font-color",b.ccOwnerName,"stencil-item"),style:{width:"25%",height:"18px"}}),(0,r.jsxs)("div",{className:b.headerSectionButtons,children:[(0,r.jsx)("div",{className:"stencil-wrapper",children:(0,r.jsx)(m.YU,{ButtonVariant:"secondary",ButtononClick:()=>{},children:"Delete Card"})}),(0,r.jsx)("div",{className:"stencil-wrapper",children:(0,r.jsx)(m.YU,{ButtonVariant:"secondary",ButtononClick:()=>{},children:"Edit"})})]})]}),(0,r.jsxs)("div",{className:b.cards,children:[(0,r.jsx)("h3",{className:(0,I.A)(b.cardsTitle,"vg-display-small","web-display-small","web-builder-font-color"),style:{width:"90%"},children:"Businesses Using Card on File"}),[{businessName:"Bella Beauty Salon",businessImage:"https://via.placeholder.com/50x50/f0f0f0/999999?text=Business",city:"Los Angeles",stateCode:"CA"},{businessName:"Elite Fitness Center",businessImage:"https://via.placeholder.com/50x50/f0f0f0/999999?text=Business",city:"New York",stateCode:"NY"}].map((e,t)=>(0,r.jsxs)("div",{className:b.businessItem,children:[(0,r.jsx)("div",{className:b.businessImage,children:(0,r.jsx)("div",{style:{width:"68px",height:"45px"},className:"stencil-item"})}),(0,r.jsxs)("div",{className:b.businessInfo,children:[(0,r.jsx)("div",{className:"vg-subheading-font web-subheading-font web-builder-font-color stencil-item",style:{width:"75%",height:"18px",marginBottom:"4px"}}),(0,r.jsx)("div",{className:"web-body-font web-builder-font-color stencil-item",style:{width:"33%",height:"18px"}})]}),(0,r.jsx)("div",{className:(0,I.A)(b.threeDotMenu),children:(0,r.jsx)("div",{style:{width:"16px",height:"16px"},className:"stencil-item"})})]},e.businessName+" "+t))]})]})})}var S=a(80736),P=a(7974),A=a(75538);function j(e){let t,a,i,d,{cardTokenId:y,cardNumber:h,creditCard:g,customerPaymentData:f,PaymentMethods:I,onBack:N,handelAddNewCard:j,handelClose:k,isFrameLoading:D,showEditModal:M,setShowEditModal:T,BusinessesCards:B,disableCache:R,onDisableCheck:V}=e,{device:O,module:E}
1=(0,p.J)(),[U,_]=(0,s.useState)(!1),[L,F]=(0,s.useState)(!1),[q,Y]=(0,s.useState)(!1),[G,H]=(0,s.useState)(!1),[$,Z]=(0,s.useState)({title:"",description:""}),[J,z]=(0,s.useState)("Unable to Remove Card"),X=(0,s.useRef)([]),W=(0,s.useRef)(!1),K=(0,s.useRef)(null),Q=(0,s.useRef)(null),ee=(0,s.useRef)(""),{data:et,isLoading:ea}=(t={type:!1,device:O,module:E,cardWithBusiness:!0,FromBrandedApp:(0,A.IN)()??!1,cardTokenId:y,cardNumber:h,groupId:g?.sGroup},(0,o.I)({queryKey:[c.lH.paymentMethods.getPaymentMethodDetails,t,{disableCache:R}],queryFn:()=>l.getPaymentMethodDetails(t),gcTime:R?0:void 0})),er=et?.customerPayment??[],es=`${g.cFirstName} ${g.cLastName}`;B.current=er,(0,s.useEffect)(()=>{window.handleOperation="PaymentBack",window.scrollTo(0,0)},[]);let{mutate:en,isPending:eo}=(a={onSuccess:e=>{let t=e.cardReplaced;if(void 0!==t&&null!=t&&t.length>0){let e=t.filter(function(e){return -9===e.result}),a=t.filter(function(e){return -10===e.result}),r=t.filter(function(e){return 0===e.result||-1===e.result});if(e&&e.length>0||a&&a.length>0||r&&r.length>0)return void u.oR.error("Something went wrong, please try again.");
1u.oR.success("Card information updated successfully."),Y(!1),K.current=null,I(),N(),V(!0),k(!1)}else u.oR.error("Something went wrong, please try again.")},onError:()=>{u.oR.error("Failed to Remove card")}},(0,n.n)({mutationFn:e=>l.replaceCardOnFile(e),onSuccess:e=>{},onError:e=>{u.oR.error("Error replacing card on file.")},...a})),{mutate:ei,isPending:ed}=(i={onSuccess:e=>{let t=e?.responseCode;-9===t?u.oR.warning("Business is Under Maintenance. This won't take long"):1e3===t?u.oR.success("Your card has been removed."):u.oR.error("Some error occured.Please try again later."),X.current=[],_(!1),I(),N(),V(!0),k(!1)},onError:()=>{u.oR.error("Failed to delete card")}},(0,n.n)({mutationFn:e=>l.deletePaymentMethod(e),meta:{invalidateQueries:[c.lH.paymentMethods.getPaymentMethods]},onSuccess:e=>{},onError:e=>{u.oR.error("Error deleting payment method.")},...i})),{mutate:el,isPending:ec}=(d={onMutate:e=>{let{meta:t}=e;return{meta:t}},onSuccess:(e,t)=>{let{isFromMongoDB:a,isfrombusinessremove:r,merchantId:s,cardTokenId:n}=t?.meta||{};if(_(!1),1032===e.responseCode)return void u.oR.warning("Business is Under Maintenance. This won't take long");if(1001===e.responseCode)return void u.oR.error("Sorry something went wrong, please try again!");if(1e3===e.responseCode){let t=e.data,o=t.filter(e=>!0===e.existsRecord);if(0===t.length&&!0===a)void 0!==r&&!0===r?ei({userCardsDetails:[{CardTokenId:n,merchantId:s}],IsFromMongoDB:!0}):(_(!0),X.current=[{CardTokenId:n,merchantId:s}],W.current=!0);else if(t.length>=1&&o.length>0)Q.current=o,H(!0);else if(o.length<=0){let e=t.filter(e=>!1===e.existsRecord),a=Array.isArray(e)?e.map(e=>({CardTokenId:e.cardTokenId,merchantId:e.merchantId})):[];e.length>0&&(void 0!==r&&!0===r?(W.current=!1,X.current=a,F(!0),Z({title:"Remove Card from Business",description:"Are you sure you want to remove the card on file from this business?"})):(W.current=!1,X.current=a,F(!0),Z({title:"Remove Card on File",description:"Are you sure you want to remove card?"})))}}},onError:()=>{u.oR.error("Failed to fetch card data info.")}},(0,n.n)({mutationFn:e=>{let{meta:t,...a}=e;return l.cardDataInfoPaymentMethod(a)},onMutate:e=>({meta:e.meta}),...d})),eu=()=>{_(!1),X.current=[]},ep=(e,t,a,r)=>{ee.current="";let s=!1;z(r?"Unable to Remove Card":"Unable to Delete Card"),null!=et&&f.length>0&&(s=f.filter(function(e){return e.cardTokenId===a&&(void 0===e.sGroup||""===e.sGroup||null===e.sGroup)}).length>0),el({cardTokenId:a,cardNumber:t,brandedApp:(0,A.IN)()??!1,device:O,module:E,merchantId:"QX9p3jq6~mMP6js9ReeSqw==",pageNumber:1,pageSize:1e3,meta:{isFromMongoDB:s,isfrombusinessremove:r,merchantId:"QX9p3jq6~mMP6js9ReeSqw==",cardTokenId:a}})},em=async()=>{try{ei({userCardsDetails:X.current,IsFromMongoDB:W.current})}catch(e){u.oR.error("Failed to delete card")}};window.onCloseCallback=e=>{void 0!==e&&null!=e&&void 0!==e.eventType&&null!=e.eventType&&"closeFrame"==e.eventType&&window.focus()};let ey=async()=>{T(!0),j({divId:"divMyPaymentMethodsCCFrame",callfor:2,oldTokenID:g.cardTokenId??"",Mode:3})},eh=()=>{F(!1),X.current=[]},eg=e=>{let t=f.map(t=>{let a=t.cardTokenId===g.cardTokenId;return{id:"replace_card",cctoken:t.cardTokenId,show:!0,customContent:(0,r.jsx)(v,{ReplaceOnCard:eC,IsFromDetailCall:e,cc:t,isSelected:a})}}),a={id:"remove_card_from_business",show:e,customContent:(0,r.jsx)("div",{style:{display:"flex",alignItems:"center",gap:"8px",color:"var(--text_alert_default)",paddingLeft:"12px"},children:"Remove Card from Business"})};return e?[...t,a]:t},ef=e=>{if(!e)return{month:void 0,year:void 0};let t=e.split("/");if(3!==t.length)return console.warn("Unexpected date format:",e),{month:void 0,year:void 0};let[a,r,s]=t;return{month:r,year:a}},ew=(e,t)=>{ee.current=t.businessId??"","remove_card_from_business"===e.id&&ep(t.creditCardType??"",t.creditCardNumber??"",t.cardTokenId??"",!0)},eC=(e,t)=>{((e,t)=>{if(null!=y&&y.toString().trim().length>0&&null!=e&&e.toString().trim().length>0){if(y===e)return;let a=null;null!=(a=((e,t,a)=>{let r=[];if(null!=e&&""!==e&&null!=t&&""!==t&&void 0!==er&&null!=er&&er.length>0){let s=er;null!=a&&""!==a&&(s=er.filter(function(e){return e.businessId===a}));let n=f.filter(function(e){return e.cardTokenId===t}),o=f.filter(function(t){return t.cardTokenId===e});for(let i=0;i<s.length;i++){let d=s[i],l={};if(l.strBusinessID=d.businessId,l.GroupID=n[0].sGroup,l.CardTokenID=t,l.OldCardTokenID=e,l.OldGroupID=d.sGroup,l.Device=O,l.Count=o.length>0?o[0].count:0,0===i&&s.length>1&&(null==a||""===a)&&(l.Count=1),1==l.Count){let{month:e,year:t}=ef(o[0].strExpDate),a={};a.CreditcardType=o[0].creditCardType,a.CreditcardNo=o[0].creditCardNumber,a.UCCLastName=o[0].cLastName,a.UCCFirstName=o[0].cFirstName,a.UCCMiddleName=o[0].cMiddleName,a.CardTokenID=o[0].cardTokenId,a.UCCSecurityCode=o[0].cSecurityCode,a.ExpMonth=e,a.ExpYear=t,a.Device=O,a.Module=E,l.OldCCDetail
1s=a}l.NewCardTokenBusinessID="QX9p3jq6~mMP6js9ReeSqw=="==n[0].businessId?null:n[0].businessId,r.push(l)}}return r})(y,e,!0==t?ee.current??"":""))&&a.length>0&&(Y(!0),K.current=a.map(t=>({merchantId:t.strBusinessID,Count:t.Count,CardTokenID:e,OldCardTokenID:y,OldGroupID:t.OldGroupID,OldCCDetails:t.OldCCDetails,Device:O,Module:E})))}})(e.cardTokenId??"",t)},eb=e=>new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});return ea?(0,r.jsx)(x,{}):(0,r.jsx)(s.Suspense,{fallback:(0,r.jsx)(w.A,{isLoading:!0}),children:(0,r.jsxs)("div",{className:"vg-body-font web-body-font web-builder-font-color",children:[(0,r.jsx)(w.A,{isLoading:ea||ed||eo||ec||D}),(0,r.jsx)(C.A,{onClick:()=>{N(),k(!1)},children:"Back"}),(0,r.jsxs)("div",{className:`cardBg ${b.paymentMethodHeaderSection}`,children:[(0,r.jsx)("div",{className:b.ccType+" vg-display-medium web-display-medium web-builder-font-color",children:g.creditCardType}),(0,r.jsxs)("div",{className:`web-body-font web-builder-font-color ${b.ccNumber}`,children:["Ending in ",g.creditCardNumber]}),(0,r.jsx)("div",{className:`web-body-font web-builder-font-color ${b.ccOwnerName}`,children:es}),(0,r.jsxs)("div",{className:`widgetButton ${b.headerSectionButtons}`,children:[(0,r.jsx)(m.YU,{ButtonVariant:"destructive",ButtononClick:()=>ep(g.creditCardType??"",g.creditCardNumber??"",g.cardTokenId??"",!1),children:"Delete Card"}),(0,r.jsx)(m.YU,{ButtonVariant:"secondary",ButtononClick:ey,children:"Edit"})]})]}),er.length>0&&(0,r.jsx)("div",{className:`cardBg ${b.cards}`,children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h3",{className:b.cardsTitle+" vg-display-small web-display-small web-builder-font-color",children:"Businesses Using Card on File"}),er.map((e,t)=>(0,r.jsxs)("div",{className:b.businessItem,style:1===er.length?{border:"none"}:{},children:[(0,r.jsx)("div",{className:b.businessImage,children:(0,r.jsx)("img",{src:e.businessImage})}),(0,r.jsxs)("div",{className:b.businessInfo,children:[(0,r.jsx)("div",{className:"vg-subheading-font web-subheading-font web-builder-font-color",children:e.businessName}),(0,r.jsxs)("div",{className:"web-body-font web-builder-font-color",children:[e?.city," ",e?.stateCode]})]}),!(0,S.nr)(e.businessId)&&(0,r.jsx)("div",{className:b.threeDotMenu,children:(0,r.jsx)(s.Suspense,{children:(0,r.jsx)(m.IG,{Items:eg(!0),MenuButtonPosition:"vertical",MenuOpen:!0,MenuOptions:"ThreeDot",OnClick:t=>ew(t,e),OnThreeDotMenuClick:()=>{},SelectedItem:[],ThreeDotMenuOpenPosition:"Right"})})})]},e.businessName+" "+t))]})}),M&&(0,r.jsx)("div",{className:"addCardBlock",id:"divMyPaymentMethodsCCFrame"}),(0,r.jsx)(s.Suspense,{children:(0,r.jsx)(m.W_,{ButtonPrimary:"Delete",ButtonSecondary:"Cancel",PrimaryButtonVariant:"primary",SecondaryButtonVariant:"secondary",CloseButton:!0,Footer:2,FooterButton:"both",OnClickPrimary:em,OnClickSecondary:eu,PopupId:"delete-card-modal",PopupTitle:"Delete Card on File",Popupopen:U,TextDescription:"Are you sure you want to delete this card?",Size:"small",onClose:eu,BodyClass:"vg-popup-open",customClassName:"customPosition"})}),(0,r.jsx)(s.Suspense,{children:(0,r.jsx)(m.W_,{ButtonPrimary:"Remove",ButtonSecondary:"Cancel",PrimaryButtonVariant:"primary",SecondaryButtonVariant:"secondary",CloseButton:!0,Footer:2,FooterButton:"both",OnClickPrimary:em,OnClickSecondary:eh,PopupId:"remove-card-from-business-modal",PopupTitle:$.title,Popupopen:L,TextDescription:$.description,Size:"small",onClose:eh,BodyClass:"vg-popup-open",customClassName:"customPosition"})}),(0,r.jsx)(s.Suspense,{children:(0,r.jsx)(m.W_,{ButtonPrimary:"Replace",ButtonSecondary:"Cancel",PrimaryButtonVariant:"primary",SecondaryButtonVariant:"secondary",CloseButton:!0,Footer:2,FooterButton:"both",OnClickPrimary:()=>{K.current&&en(K.current),Y(!1)},OnClickSecondary:()=>Y(!1),PopupId:"remove-card-from-business-modal",PopupTitle:"Replace Card on File",Popupopen:q,TextDescription:"Are you sure you want to replace the card on file for this business?",Size:"small",onClose:()=>Y(!1),BodyClass:"vg-popup-open",customClassName:"customPosition"})}),(0,r.jsx)(s.Suspense,{children:(0,r.jsx)(m.W_,{CloseButton:!0,Footer:2,FooterButton:"none",OnClickPrimary:()=>H(!1),PopupBody:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{children:"This card is currently being used for the following appointments and/or an auto-renew membership or package."}),(0,r.jsx)("div",{className:b.buttonSectionDelete,children:(0,r.jsx)(m.IG,{CustomMenuRender:(0,r.jsx)(m.YU,{ButtonVariant:"ghost",children:"Replace Card on File"}),Items:eg(!1),MenuButtonPosition:"horizontal",MenuOpen:!0,MenuOptions:"CustomMenu",OnClick:e=>ew(e,{}),OnThreeDotMenuClick:()=>{},SelectedItem:[],ThreeDotMenuOpenPosition:"Left"})}),(0,r.jsx)("div",{className:`default-scrollbar ${b.deleteCardList}`,children:Q.current&&Q.current.map((e,t)=>{var a;return(0,r.jsx)("div",{className:b.businessItemPopup,style:Q.current?.length===1?{border:"none"}:{},children:(0,r.jsx)("div",{className:b.deleteCardcell,children:(0,r.jsxs)("div",{className:b.DCgroup,children:[(0,r.jsxs)("div",{className:b.DCardimg,children:[(0,r.jsx)("div",{id:"divDeleteCardBusinessImage",style:{cursor:"pointer"},className:"DCardimage lazy"}),(0,r.jsx)("img",{width:96,alt:"Placeholder",src:e.businessImage,"aria-label":e.businessName})]}),(0,r.jsxs)("div",{className:b.DCarddetail,children:[(0,r.jsxs)("div",{className:b.ffIconRow,children:[(0,r.jsx)("div",{className:"DCbusiness web-subheading-font",children:e.businessName}),null!=e.fullName&&""!=e.fullName&&(0,r.jsx)(P.f,{icon:"users",beakPoint:0===t?"Down":"Up",tooltipText:(a=e.fullName,` 2 <div class="tooltip-content">
3 <span>Captured by ${a??""}</span><br/> 4 </div> 5 `)})]}),(0,r.jsxs)("div",{className:"DCadress vg-body-font web-body-font",children:[e.city,", ",e.stateCode]}),null!=e.serviceType&&""!=e.serviceType&&(1==e.serviceType||2==e.serviceType)&&(0,r.jsx)("div",{className:"DCrewDate vg-body-font web-body-font","aria-label":eb(e.strStartTime),role:"banner",children:(0,r.jsx)("span",{"aria-hidden":"true",children:eb(e.strStartTime)})}),null!=e.serviceType&&""!=e.serviceType&&(3==e.serviceType||4==e.serviceType)&&(0,r.jsx)(s.Fragment,{children:null!=e.strStartTime&&""!=e.strStartTime?(0,r.jsx)("div",{className:"DCrewDate vg-body-font web-body-font","aria-label":"Renews on "+eb(e.strStartTime),role:"banner",children:(0,r.jsxs)("span",{"aria-hidden":"true",children:["Renews on ",eb(e.strStartTime)]})}):(0,r.jsx)("div",{className:"DCrewDate vg-body-font web-body-font","aria-label":"Renews after visit completed",role:"banner",children:(0,r.jsx)("span",{"aria-hidden":"true",children:"Renews after visit completed"})})}),(0,r.jsx)("div",{className:"DCservice vg-body-font web-body-font",children:e.serviceName})]})]})})},e.businessName+" "+t)})})]}),EnableBody:!0,PopupId:"unableToRemoveCardModal",PopupTitle:J,Popupopen:G,Size:"medium",onClose:()=>H(!1),BodyClass:"vg-popup-open",customClassName:"customPosition"})})]})})}var k=a(52745),D=a(84133);function M(){return(0,r.jsx)(s.Suspense,{fallback:(0,r.jsx)(w.A,{isLoading:!0}),children:(0,r.jsxs)("div",{className:"vg-body-font web-body-font web-builder-font-color stenciled",style:{marginTop:"var(--spacing_12)"},children:[(0,r.jsx)(C.A,{onClick:()=>{},children:"Back"}),(0,r.jsxs)("div",{className:b.paymentMethodHeaderSection,children:[(0,r.jsx)("div",{className:"vg-display-small web-display-small web-builder-font-color stencil-item",children:"Wells Fargo Bank"}),(0,r.jsxs)("div",{className:"vg-display-small web-display-small web-builder-font-color stencil-item",children:["Ending in ","6789"]}),(0,r.jsx)("div",{className:"vg-body-font web-body-font web-builder-font-color stencil-item",style:{color:"var(--color-text-neutral-secondary)"},children:"John Smith"}),(0,r.jsx)("div",{className:(0,I.A)(b.headerSectionButtons,"stencil-wrapper"),children:(0,r.jsx)(s.Suspense,{children:(0,r.jsx)(m.YU,{ButtonVariant:"secondary",ButtononClick:()=>{},children:"Delete"})})})]}),(0,r.jsxs)("div",{className:b.cards,children:[(0,r.jsx)("div",{className:(0,I.A)(b.cardsTitle,"vg-display-small","web-display-small","web-builder-font-color","stencil-item"),style:{width:"50%"},children:"Businesses Using Card on File"}),[{businessName:"Bella Beauty Salon",businessImage:"https://via.placeholder.com/50x50/f0f0f0/999999?text=Business",outstandingAmount:125.5,countryID:1,paidInstallment:2},{businessName:"Elite Fitness Center",businessImage:"https://via.placeholder.com/50x50/f0f0f0/999999?text=Business",outstandingAmount:89.75,countryID:1,paidInstallment:1}].map((e,t)=>(0,r.jsxs)("div",{className:b.businessItem,style:{alignItems:"center"},onClick:()=>{},children:[(0,r.jsx)("div",{className:b.businessImage,children:(0,r.jsx)("div",{style:{width:"68px",height:"45px"},className:"stencil-item"})}),(0,r.jsxs)("div",{className:b.businessInfo,children:[(0,r.jsx)("div",{className:"vg-subheading-font web-subheading-font web-builder-font-color stencil-item",children:e.businessName}),(0,r.jsx)("div",{className:"web-body-font web-builder-font-color stencil-item",children:`Outstanding Balance: ${(e.countryID,"$")}${e.outstandingAmount.toFixed(2)}`}),(0,r.jsxs)("div",{className:"web-body-font web-builder-font-color stencil-item",children:[e.paidInstallment," payment",e.paidInstallment>1?"s":""," ","remaining"]})]}),(0,r.jsx)("div",{className:b.threeDotMenu})]},`transaction-${t}`))]})]})})}function T(e){let t,a,{customerBank:i,vplUserAccountId:d,PaymentMethods:y,onBack:h}=e,{device:g,module:f,fullName:v}=(0,p.J)(),[I,N]=(0,s.useState)(!1),[x,P]=(0,s.useState)(!1),[A,j]=(0,s.useState)(),{data:T,isPending:B,error:R}=(0,k.m)("QX9p3jq6~mMP6js9ReeSqw==",g,f),V=Array.isArray(T?.vPLPayments)?T.vPLPayments.filter(e=>e&&"number"==typeof e.transactionStatus&&0===e.transactionStatus):[],{data:O,isLoading:E}=(t={accountId:d,type:0,device:g,module:f}
5,(0,o.I)({queryKey:[c.lH.paymentMethods.getBankDetails,t],queryFn:()=>l.getBankDetails(t)})),{mutate:U,isPending:_}=(a={onSuccess:()=>{N(!1),y(),u.oR.success("Bank deleted successfully."),h()},onError:()=>{u.oR.error("Sorry something went wrong, please try again!")}},(0,n.n)({mutationFn:e=>l.deleteBankDetails(e),meta:{invalidateQueries:[c.lH.paymentMethods.getPaymentMethodDetails]},onSuccess:e=>{},onError:e=>{u.oR.error("Error deleting bank details")},...a}));O&&O?.transactionDetail?.length>0&&O.transactionDetail;let L=()=>{N(!1)},F=async()=>{try{U({bankNumber:i.accountNumber,bankId:i.bankId})}catch(e){}},q=()=>{window.handleOperation="",j(void 0)};return(window.handleEventBack=q,E)?(0,r.jsx)(M,{}):A?(0,r.jsx)(s.Suspense,{fallback:(0,r.jsx)(r.Fragment,{}),children:(0,r.jsx)(D.A,{onBack:q,payment:A})}):(0,r.jsx)(s.Suspense,{fallback:(0,r.jsx)(w.A,{isLoading:!0}),children:(0,r.jsxs)("div",{className:"vg-body-font web-body-font web-builder-font-color",style:{marginTop:"var(--spacing_12)"},children:[(0,r.jsx)(w.A,{isLoading:_||B}),(0,r.jsx)(C.A,{onClick:h,children:"Back"}),(0,r.jsxs)("div",{className:b.paymentMethodHeaderSection,children:[(0,r.jsx)("div",{className:"vg-display-small web-display-small web-builder-font-color",children:i.bankName||""}),(0,r.jsxs)("div",{className:"vg-display-small web-display-small web-builder-font-color",children:["Ending in"," ",i.accountNumber&&i.accountNumber.length>4?i.accountNumber.slice(-4):i.accountNumber]}),(0,r.jsx)("div",{className:"vg-body-font web-body-font web-builder-font-color",style:{color:"var(--color-text-neutral-secondary)"},children:v||""}),(0,r.jsx)("div",{className:b.headerSectionButtons,children:(0,r.jsx)(s.Suspense,{children:(0,r.jsx)(m.YU,{ButtonVariant:"destructive",ButtononClick:()=>{let e=T?.vPLPayments||[],t=i?.bankId,a=T?.isBankAdded,r=e.filter(e=>e.bankAccount?.[0]?.bankId===t),s=r.filter(e=>1!==e.transactionStatus).length;0===r.length&&a||a&&0===s?N(!0):P(!0)},children:"Delete"})})})]}),(0,r.jsx)("div",{className:b.cards,children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:b.cardsTitle+" vg-display-small web-display-small web-builder-font-color",children:"Businesses Using Card on File"}),V.length>0?V.map((e,t)=>(0,r.jsxs)("div",{className:b.businessItem,style:{alignItems:"center"},onClick:()=>j(e),children:[(0,r.jsx)("div",{className:b.businessImage,children:(0,r.jsx)("img",{src:e.businessImage})}),(0,r.jsxs)("div",{className:b.businessInfo,children:[(0,r.jsx)("div",{className:"vg-subheading-font web-subheading-font web-builder-font-color",children:e.businessName}),(0,r.jsx)("div",{className:"web-body-font web-builder-font-color",children:`Outstanding Balance: ${(0,S.Qn)(e.countryID??1)}${(e.outstandingAmount??0).toFixed(2)}`}),(0,r.jsxs)("div",{className:"web-body-font web-builder-font-color",children:[e.paidInstallment," payment",e.paidInstallment>1?"s":""," remaining"]})]}),(0,r.jsx)("div",{className:b.threeDotMenu,children:(0,r.jsx)(s.Suspense,{children:(0,r.jsx)(m.qy,{name:"chevronRight",width:13.5,height:20})})})]},`transaction-${t}`)):(0,r.jsx)(r.Fragment,{children:"No businesses are currently using this bank account for payment."})]})}),(0,r.jsx)(s.Suspense,{fallback:(0,r.jsx)("div",{children:(0,r.jsx)(r.Fragment,{})}),children:(0,r.jsx)(m.W_,{ButtonPrimary:"Delete",ButtonSecondary:"Cancel",PrimaryButtonVariant:"primary",SecondaryButtonVariant:"secondary",CloseButton:!0,Footer:2,FooterButton:"both",OnClickPrimary:F,OnClickSecondary:L,PopupId:"delete-bank-account-modal",PopupTitle:"Delete Bank Account",Popupopen:I,TextDescription:"You will be deleting this bank account from your profile, past payments made with this account will still show in your History.",Size:"small",onClose:L,BodyClass:"vg-popup-open",customClassName:"customPosition"})}),(0,r.jsx)(s.Suspense,{fallback:(0,r.jsx)("div",{children:(0,r.jsx)(r.Fragment,{})}),children:(0,r.jsx)(m.W_,{ButtonPrimary:"OK",PrimaryButtonVariant:"primary",CloseButton:!0,Footer:2,FooterButton:"primaryButton",OnClickPrimary:()=>{P(!1)},PopupId:"UnableToDeleteBank",PopupTitle:"Unable to Delete Bank",Popupopen:x,TextDescription:"This bank account is currently being used for Vagaro Pay Later payments. To remove this bank, please pay off any outstanding payments.",Size:"small",onClose:()=>{P(!1)},BodyClass:"vg-popup-open",customClassName:"customPosition"})})]})})}let B={pageTitle:"pageTitle-rKrzdu",paymentCardsSection:"paymentCardsSection-jfbRfU",addNe
5wPaymentButton:"addNewPaymentButton-SY3bGF",vplSection:"vplSection-JEoO2r",vplSectionDescription:"vplSectionDescription-BVy6gQ",vplBankSubText:"vplBankSubText-cuvoGw",addBankAccountBtn:"addBankAccountBtn-ayjkiK",sectionTitle:"sectionTitle-B8sKsb",paymentBtnforCard:"paymentBtnforCard-WusCKg",framefullwidth:"framefullwidth-YMXuYm",addCardBlock:"addCardBlock-x_NBGN",iFramePaymentMethod:"iFramePaymentMethod-bQJI21",vplPayment:"vplPayment-K57eqK",leftPartPayment:"leftPartPayment-gL5dtQ",rightPartPayment:"rightPartPayment-eaLsPs",vplPaymentHeading:"vplPaymentHeading-fNMrB8",vplPaymentText:"vplPaymentText-I775Yf",paymentBtn:"paymentBtn-m9y8MA",paymentImg1:"paymentImg1-xnYYzE",paymentImg2:"paymentImg2-TlKbka",affirmLogo:"affirmLogo-dNvo96",ccIframeHeder:"ccIframeHeder-MCyTts",sectionAddTitle:"sectionAddTitle-MFUycF",sectionDescription:"sectionDescription-Gq4dzk",divider:"divider-Y_y6HR",dividerText:"dividerText-waq7HL"};var R=a(99060),V=a(51850),O=a(39314);let E=[{creditCardType:"Visa",creditCardNumber:"1234"},{creditCardType:"Mastercard",creditCardNumber:"5678"}],U=0;function _(){let e=U%E.length,t=E[e];return U++,(0,r.jsxs)("div",{className:(0,I.A)(y.customerPaymentItem,"vg-body-font","web-body-font","web-builder-font-color",{stenciled:!0}),children:[(0,r.jsx)("div",{className:(0,I.A)(y.cardTypeIcon,{"stencil-wrapper stencil-item":!0}),children:(0,r.jsx)(g,{creditCardType:t.creditCardType})}),(0,r.jsxs)("div",{className:y.cardInfo,children:[(0,r.jsx)("div",{className:(0,I.A)("vg-subheading-font web-subheading-font web-builder-font-color",{"stencil-item":!0}),style:{width:"60%",height:"18px",marginBottom:"4px"}}),(0,r.jsx)("div",{className:(0,I.A)("web-body-font web-builder-font-color",{"stencil-item":!0}),style:{width:"25%",height:"18px"}})]}),(0,r.jsx)("div",{className:(0,I.A)(y.moreInfo,"stencil-wrapper stencil-item"),children:(0,r.jsx)(m.qy,{name:"chevronRight",width:13.5,height:20})})]})}function L(){let e=(0,N.G)(),t=[,,].fill(null);return[,].fill(null),(0,r.jsx)(s.Suspense,{children:(0,r.jsxs)("div",{className:(0,I.A)("vg-body-font","MyaccountWrapper","web-body-font","web-builder-font-color",B.paymentMethodsPage,"stenciled"),children:[(0,r.jsx)("div",{className:(0,I.A)(B.pageTitle,"vg-display-large","web-display-large","web-builder-font-color"),children:(0,r.jsx)("span",{className:"stencil-item",children:"Payment Methods"})}),(0,r.jsx)("div",{style:{height:e?"244px":"530px",width:"100%"},className:(0,I.A)(B.vplPayment,"stencil-item")}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:B.paymentCardsSection,children:[(0,r.jsx)("div",{className:(0,I.A)(B.sectionTitle,"vg-display-small","web-display-small","web-builder-font-color"),children:(0,r.jsx)("span",{className:"stencil-item",children:"Add Payment"})}),(0,r.jsx)("div",{className:(0,I.A)(B.sectionDescription,"vg-body-font","web-body-font","web-builder-font-color"),children:(0,r.jsx)("span",{className:"stencil-item",children:"Add and manage your payment cards"})})]}),(0,r.jsx)("div",{className:B.customerPayments,children:t.map((e,t)=>(0,r.jsx)("div",{children:(0,r.jsx)(_,{})},`payment-skeleton-${t}`))}),(0,r.jsx)("div",{className:(0,I.A)(B.addNewPaymentButton,"stencil-wrapper"),children:(0,r.jsx)(m.YU,{ButtonVariant:"ghost",ButtononClick:()=>{},children:"Add New Payment"})})]}),(0,r.jsx)(O.A,{})]})})}a(58431);let F="https://js.stripe.com/v3/",q="https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js",Y={2:"pk_live_51J7mT1AcgFQRb2X3Y6oFur9C8KoXfrhkPk4ObjLZ42EbLqoqE9ucuNfjhvCSTN7u2Kivb28J9sDtZMITObZVWcsV001ghivc71",3:"pk_live_51J7VLiJqR7f357ye4TzkUKEeuIaFSTzxYdyDUUbyQsBphjdvIaCdmfMZ2jwYQZZqJoERLonClPnVQl6iVv9utjdo00nSpN7N1x",4:"pk_live_51J62dnE1KMHYsyaVTY5kHcOmax3rX9siGCvTXP8F8MQBRIe1OW0djiA4ixYwo9nhCE2qtCWdeWa5sUug5ZBXTVBH00B15Gyujl"};function G(e){return e&&e.trim()?e.replace(/\/+$/,""):window.VagaroMyAccountCoreAPI}async function H(e){let t=G(e.baseApiUrl),a=await fetch(`${t}/payment-methods/wallet`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({PaymentToken:e.secureToken,PaymentMethodType:"gpay"===e.paymentMethod?1:2,AuthorizeAmount:e.amount,Device:"Online Business Signup",SaveCard:!0,MerchantToken:e.merchantToken??"",LoginUserId:e.loginUserId??"",BillingAddress:e.billingAddress??null,IndCode:1,PaymentGatewayType:e.paymentGatewayType,CountryId:String(e.countryId),Currency:e.currency})});if(!a.ok)throw console.error("[VagaroPayment:API] Zenswipe API failed:",a.status,a.statusText),Error(`Zenswipe API failed: ${a.status} ${a.statusText}`);return await a.json()}async function $(e){let t=G(e.baseApiUrl),a=await fetch(`${t}/payment-methods/wallet/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({DomainName:e.domainName,PaymentProviderType:e.paymentProviderType,LoginUserId:e.loginUserId,MerchantTokenId:e.merchantTokenId,UserAgent:e.userAgent})});if(!a.ok)throw console.error("[VagaroPayment:API] Merchant session request failed:",a.status),Error(`Merchant session request failed: ${a.status}`);let r=await a.json();return"string"==typeof r?JSON.parse(r):r}let Z={2:{countryCode:"GB",currency:"gbp"},3:{countryCode:"CA",currency:"cad"},4:{countryCode:"AU",currency:"aud"}},J={environment:JSON.parse('{ "allowedAuthMethods": [ "PAN_ONLY", "CRYPTOGRAM_3DS" ], "allowedCardNetworks": [ "AMEX", "DISCOVER", "MASTERCARD", "VISA" ], "brandedAppAllowedBusinessIds": "407748", "BusinessId": "-1", "countryCode": "US", "currency": "USD", "environment": "PRODUCTION", "gateway": "adyen", "gatewayMerchantId": "VagaroECOM", "merchantCapabilities": [ "supports3DS", "supportsCredit", "supportsDebit" ], "merchantId": "BCR2DN4T23R4NVZC", "merchantIdentifier": "merchant.com.adyen.vagaroapplepay.Live", "merchantName": "Vagaro", "supportedAndroidVersion": 531, "supportedIOSVersion": 430, "supportedNetworks": [ "amex", "discover", "masterCard", "visa" ] }').environment,gateway:JSON.parse('{ "allowedAuthMethods": [ "PAN_ONLY", "CRYPTOGRAM_3DS" ], "allowedCardNetworks": [ "AMEX", "DISCOVER", "MASTERCARD", "VISA" ], "brandedAppAllowedBusinessIds": "407748", "BusinessId": "-1", "countryCode": "US", "currency": "USD", "environment": "PRODUCTION", "gateway": "adyen", "gatewayMerchantId": "VagaroECOM", "merchantCapabilities": [ "supports3DS", "supportsCredit", "supportsDebit" ], "merchantId": "BCR2DN4T23R4NVZC", "merchantIdentifier": "merchant.com.adyen.vagaroapplepay.Live", "merchantName": "Vagaro", "supportedAndroidVersion": 531, "supportedIOSVersion": 430, "supportedNetworks": [ "amex", "discover", "masterCard", "visa" ] }').gateway,gatewayMerchantId:JSON.parse('{ "allowedAuthMethods": [ "PAN_ONLY", "CRYPTOGRAM_3DS" ], "allowedCardNetworks": [ "AMEX", "DISCOVER", "MASTERCARD", "VISA" ], "brandedAppAllowedBusinessIds": "407748", "BusinessId": "-1", "countryCode": "US", "currency": "USD", "environment": "PRODUCTION", "gateway": "adyen", "gatewayMerchantId": "VagaroECOM", "merchantCapabilities": [ "supports3DS", "supportsCredit", "supportsDebit" ], "merchantId": "BCR2DN4T23R4NVZC", "merchantIdentifier": "merchant.com.adyen.vagaroapplepay.Live", "merchantName": "Vagaro", "supportedAndroidVersion": 531, "supportedIOSVersion": 430, "supportedNetworks": [ "amex", "discover", "masterCard", "visa" ] }').gatewayMerchantId,currency:JSON.parse('{ "allowedAuthMethods": [ "PAN_ONLY", "CRYPTOGRAM_3DS" ], "allowedCardNetworks": [ "AMEX", "DISCOVER", "MASTERCARD", "VISA" ], "brandedAppAllowedBusinessIds": "407748", "BusinessId": "-1", "countryCode": "US", "currency": "USD", "environment": "PRODUCTION", "gateway": "adyen", "gatewayMerchantId": "VagaroECOM", "merchantCapabilities": [ "supports3DS", "supportsCredit", "supportsDebit" ], "merchantId": "BCR2DN4T23R4NVZC", "merchantIdentifier": "merchant.com.adyen.vagaroapplepay.Live", "merchantName": "Vagaro", "supportedAndroidVersion": 531, "supportedIOSVersion": 430, "supportedNetworks": [ "amex", "discover", "masterCard", "visa" ] }').currency,countryCode:JSON.parse('{ "allowedAuthMethods": [ "PAN_ONLY", "CRYPTOGRAM_3DS" ], "allowedCardNetworks": [ "AMEX", "DISCOVER", "MASTERCARD", "VISA" ], "brandedAppAllowedBusinessIds": "407748", "BusinessId": "-1", "countryCode": "US", "currency": "USD", "environment": "PRODUCTION", "gateway": "adyen", "gatewayMerchantId": "VagaroECOM", "merchantCapabilities": [ "supports3DS", "supportsCredit", "supportsDebit" ], "merchantId": "BCR2DN4T23R4NVZC", "merchantIdentifier": "merchant.com.adyen.vagaroapplepay.Live", "merchantName": "Vagaro", "supportedAndroidVersion": 531, "supportedIOSVersion": 430, "supportedNetworks": [ "amex", "discover", "masterCard", "visa" ] }').countryCode,merchantName:JSON.parse('{ "allowedAuthMethods": [ "PAN_ONLY", "CRYPTOGRAM_3DS" ], "allowedCardNetworks": [ "AMEX", "DISCOVER", "MASTERCARD", "VISA" ], "brandedAppAllowedBusinessIds": "407748", "BusinessId": "-1", "countryCode": "US", "currency": "USD", "environment": "PRODUCTION", "gateway": "adyen", "gatewayMerchantId": "VagaroECOM", "merchantCapabilities": [ "supports3DS", "supportsCredit", "supportsDebit" ], "merchantId": "BCR2DN4T23R4NVZC", "merchantIdentifier": "merchant.com.adyen.vagaroapplepay.Live", "merchantName": "Vagaro", "supportedAndroidVersion": 531, "supportedIOSVersion": 430, "supportedNetworks": [ "amex", "discover", "masterCard", "visa" ] }').merchantName,merchantId:JSON.parse('{ "allowedAuthMethods": [ "PAN_ONLY", "CRYPTOGRAM_3DS" ], "allowedCardNetworks": [ "AMEX", "DISCOVER", "MASTERCARD", "VISA" ], "brandedAppAllowedBusinessIds": "407748", "BusinessId": "-1", "countryCode": "US", "currency": "USD", "environment": "PRODUCTION", "gateway": "adyen", "gatewayMerchantId": "VagaroECOM", "merchantCapabilities": [ "supports3DS", "supportsCredit", "supportsDebit" ], "merchantId": "BCR2DN4T23R4NVZC", "merchantIdentifier": "merchant.com.adyen.vagaroapplepay.Live", "merchantName": "Vagaro", "supportedAndroidVersion": 531, "supportedIOSVersion": 430, "supportedNetworks": [ "amex", "discover", "masterCard", "visa" ] }').merchantId,allowedAuthMethods:JSON.parse('{ "allowedAuthMethods": [ "PAN_ONLY", "CRYPTOGRAM_3DS" ], "allowedCardNetworks": [ "AMEX", "DISCOVER", "MASTERCARD", "VISA" ], "brandedAppAllowedBusinessIds": "407748", "BusinessId": "-1", "countryCode": "US", "currency": "USD", "environment": "PRODUCTION", "gateway": "adyen", "gatewayMerchantId": "VagaroECOM", "merchantCapabilities": [ "supports3DS", "supportsCredit", "supportsDebit" ], "merchantId": "BCR2DN4T23R4NVZC", "merchantIdentifier": "merchant.com.adyen.vagaroapplepay.Live", "merchantName": "Vagaro", "supportedAndroidVersion": 531, "supportedIOSVersion": 430, "supportedNetworks": [ "amex", "discover", "masterCard", "visa" ] }').allowedAuthMethods,allowedCardNetworks:JSON.parse('{ "allowedAuthMethods": [ "PAN_ONLY", "CRYPTOGRAM_3DS" ], "allowedCardNetworks": [ "AMEX", "DISCOVER", "MASTERCARD", "VISA" ], "brandedAppAllowedBusinessIds": "407748", "BusinessId": "-1", "countryCode": "US", "currency": "USD", "environment": "PRODUCTION", "gateway": "adyen", "gatewayMerchantId": "VagaroECOM", "merchantCapabilities": [ "supports3DS", "supportsCredit", "supportsDebit" ], "merchantId": "BCR2DN4T23R4NVZC", "merchantIdentifier": "merchant.com.adyen.vagaroapplepay.Live", "merchantName": "Vagaro", "supportedAndroidVersion": 531, "supportedIOSVersion": 430, "supportedNetworks": [ "amex", "discover", "masterCard", "visa" ] }').allowedCardNetworks,merchantIdentifier:JSON.parse('{ "allowedAuthMethods": [ "PAN_ONLY", "CRYPTOGRAM_3DS" ], "allowedCardNetworks": [ "AMEX", "DISCOVER", "MASTERCARD", "VISA" ], "brandedAppAllowedBusinessIds": "407748", "BusinessId": "-1", "countryCode": "US", "currency": "USD", "environment": "PRODUCTION", "gateway": "adyen", "gatewayMerchantId": "VagaroECOM", "merchantCapabilities": [ "supports3DS", "supportsCredit", "supportsDebit" ], "merchantId": "BCR2DN4T23R4NVZC", "merchantIdentifier": "merchant.com.adyen.vagaroapplepay.Live", "merchantName": "Vagaro", "supportedAndroidVersion": 531, "supportedIOSVersion": 430, "supportedNetworks": [ "amex", "discover", "masterCard", "visa" ] }').merchantIdentifier,supportedNetworks:JSON.parse('{ "allowedAuthMethods": [ "PAN_ONLY", "CRYPTOGRAM_3DS" ], "allowedCardNetworks": [ "AMEX", "DISCOVER", "MASTERCARD", "VISA" ], "brandedAppAllowedBusinessIds": "407748", "BusinessId": "-1", "countryCode": "US", "currency": "USD", "environment": "PRODUCTION", "gateway": "adyen", "gatewayMerchantId": "VagaroECOM", "merchantCapabilities": [ "supports3DS", "supportsCredit", "supportsDebit" ], "merchantId": "BCR2DN4T23R4NVZC", "merchantIdentifier": "merchant.com.adyen.vagaroapplepay.Live", "merchantName": "Vagaro", "supportedAndroidVersion": 531, "supportedIOSVersion": 430, "supportedNetworks": [ "amex", "discover", "masterCard", "visa" ] }').supportedNetworks,merchantCapabilities:JSON.parse('{ "allowedAuthMethods": [ "PAN_ONLY", "CRYPTOGRAM_3DS" ], "allowedCardNetworks": [ "AMEX", "DISCOVER", "MASTERCARD", "VISA" ], "brandedAppAllowedBusinessIds": "407748", "BusinessId": "-1", "countryCode": "US", "currency": "USD", "environment": "PRODUCTION", "gateway": "adyen", "gatewayMerchantId": "VagaroECOM", "merchantCapabilities": [ "supports3DS", "supportsCredit", "supportsDebit" ], "merchantId": "BCR2DN4T23R4NVZC", "merchantIdentifier": "merchant.com.adyen.vagaroapplepay.Live", "merchantName": "Vagaro", "supportedAndroidVersion": 531, "supportedIOSVersion": 430, "supportedNetworks": [ "amex", "discover", "masterCard", "visa" ] }').merchantCapabilities,applePayVersion:3,stripePublishableKey:Y,createCardToken:H,fetchMerchantSession:$,showLoader:function(e){}},z=new Map;function X(e,t){console.log("[VagaroPayment:loadScript] Loading script:",e);let a=z.get(e);if(a)return console.log("[VagaroPayment:loadScript] Script already cached:",e),a;let r=new Promise((a,r)=>{if("u"<typeof document)return void r(Error(`Cannot load script in non-browser environment: ${e}`));let s=document.querySelector(`script[src="${e}"]`);if(s){console.log("[VagaroPayment:loadScript] Script tag already in DOM:",e),"true"===s.dataset.vgLoaded?(console.log("[VagaroPayment:loadScript] Script already fully loaded:",e),a()):(console.log("[VagaroPayment:loadScript] Script in DOM but not yet loaded â waiting for onload:",e),s.addEventListener("load",()=>{console.log("[VagaroPayment:loadScript] External script finished loading:",e),a()}),s.addEventListener("error",()=>{console.error("[VagaroPayment:loadScript] External script load error:",e),z.delete(e),r(Error(`Failed to load script: ${e}`))}));return}let n=document.createElement("script");n.src=e,n.async=!0,t&&(n.crossOrigin=t),n.onload=()=>{console.log("[VagaroPayment:loadScript] Script loaded successfully:",e),n.dataset.vgLoaded="true",a()},n.onerror=()=>{console.error("[VagaroPayment:loadScript] Failed to load script:",e),z.delete(e),r(Error(`Failed to load script: ${e}`))},document.head.appendChild(n)});return z.set(e,r),r}class W{config;paymentsClient=null;stripe;stripePaymentRequest=null;stripeGPayAvailable=!1;constructor(e){if(this.config={...J,...e},this.config.countryId&&1!==this.config.countryId){const t=Z[this.config.countryId];t&&(e.countryCode&&"US"!==e.countryCode||(this.config.countryCode=t.countryCode),e.currency&&"USD"!==e.currency||(this.config.currency=t.currency))}}
5async ensureStripe(){if(this.stripe)return;await X(F);let e=this.config.stripePublishableKey?.[this.config.countryId]??Y[this.config.countryId];this.stripe=window.Stripe(e)}getOrCreateStripePaymentRequest(e){return this.stripePaymentRequest?e&&this.stripePaymentRequest.update({total:{label:this.config.merchantName,amount:Math.round(100*e)}}):this.stripePaymentRequest=this.stripe.paymentRequest({country:this.config.countryCode,currency:this.config.currency.toLowerCase(),total:{label:this.config.merchantName,amount:e?Math.round(100*e):100},requestPayerName:!0,requestPayerEmail:!0}),this.stripePaymentRequest}async ensureClient(){return this.paymentsClient||(await X("https://pay.google.com/gp/p/js/pay.js"),await X(F),this.paymentsClient=new google.payments.api.PaymentsClient({environment:this.config.environment})),this.paymentsClient}buildIsReadyToPayRequest(){return{apiVersion:2,apiVersionMinor:0,allowedPaymentMethods:[this.buildBaseCardMethod()]}}buildPaymentDataRequest(e){return{apiVersion:2,apiVersionMinor:0,allowedPaymentMethods:[this.buildTokenizedCardMethod()],transactionInfo:{totalPriceStatus:"FINAL",totalPrice:e.toFixed(2),currencyCode:this.config.currency,countryCode:this.config.countryCode},merchantInfo:{merchantName:this.config.merchantName,...this.config.merchantId?{merchantId:this.config.merchantId}:{}}}}buildBaseCardMethod(){return{type:"CARD",parameters:{allowedAuthMethods:this.config.allowedAuthMethods,allowedCardNetworks:this.config.allowedCardNetworks}}}buildTokenizedCardMethod(){return{type:"CARD",parameters:{allowedAuthMethods:this.config.allowedAuthMethods,allowedCardNetworks:this.config.allowedCardNetworks,billingAddressRequired:!0,billingAddressParameters:{format:"FULL",phoneNumberRequired:!1}},tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{gateway:this.config.gateway,gatewayMerchantId:this.config.gatewayMerchantId}}}}async checkAvailability(){try{if(1!==this.config.countryId)try{await this.ensureStripe();let e=this.getOrCreateStripePaymentRequest(),t=await e.canMakePayment();return this.stripeGPayAvailable=!!t?.googlePay,this.stripeGPayAvailable}catch(e){return console.error("[VagaroPayment:GooglePay][checkAvailability] Stripe canMakePayment failed:",e),!1}let e=await this.ensureClient(),t=this.buildIsReadyToPayRequest(),a=await e.isReadyToPay(t);return!0===a.result}catch(e){return console.error("[VagaroPayment:GooglePay][checkAvailability] failed:",e),!1}}async openStripeFlow(e){await this.ensureStripe();let t=this.getOrCreateStripePaymentRequest(e);if(!this.stripeGPayAvailable){let e=await t.canMakePayment();if(!e?.googlePay)throw console.error("[VagaroPayment:GooglePay][openStripeFlow] Google Pay not available, aborting"),Error("Google Pay not available")}return new Promise((e,a)=>{t.on("paymentmethod",t=>{try{let a={token:t.paymentMethod.id,source:"gpay",gateway:"stripe",rawPaymentData:t.paymentMethod};t.complete("success"),e(a)}catch(e){console.error("[VagaroPayment:GooglePay][openStripeFlow] error building token:",e),t.complete("fail"),a(e)}}),t.show()})}async openAdyenFlow(e){let t=await this.ensureClient();this.config.showLoader?.(!0);try{let a=this.buildPaymentDataRequest(e),r=await t.loadPaymentData(a),s=r.paymentMethodData?.tokenizationData?.token;if(!s)throw console.error("[VagaroPayment:GooglePay] Empty token returned"),Error("Google Pay returned empty token");return{token:s,source:"gpay",gateway:"adyen",rawPaymentData:r.paymentMethodData}}catch(e){if(console.error("[VagaroPayment:GooglePay] Payment failed:",e),e?.statusCode==="CANCELED"||e?.message?.includes("cancel"))throw new DOMException("User cancelled Google Pay","AbortError");throw e}finally{this.config.showLoader?.(!1)}}async open(e,t){return 1!==this.config.countryId?this.openStripeFlow(e):this.openAdyenFlow(e)}destroy(){this.paymentsClient=null,this.stripePaymentRequest=null,this.stripeGPayAvailable=!1}}class K{config;session=null;stripe;stripePaymentRequest=null;stripeApplePayAvailable=!1;constructor(e){if(this.config={...J,...e},this.config.countryId&&1!==this.config.countryId){const t=Z[this.config.countryId];t&&(e.countryCode&&"US"!==e.countryCode||(this.config.countryCode=t.countryCode),e.currency&&"USD"!==e.currency||(this.config.currency=t.currency))}}
5async ensureStripe(){if(this.stripe)return;let e=this.config.stripePublishableKey?.[this.config.countryId]??Y[this.config.countryId];await X(F),this.stripe=window.Stripe(e)}getOrCreateStripePaymentRequest(e){return this.stripePaymentRequest?e&&this.stripePaymentRequest.update({total:{label:this.config.merchantName,amount:Math.round(100*e)}}):this.stripePaymentRequest=this.stripe.paymentRequest({country:this.config.countryCode,currency:this.config.currency.toLowerCase(),total:{label:this.config.merchantName,amount:e?Math.round(100*e):100},requestPayerName:!0,requestPayerEmail:!0}),this.stripePaymentRequest}async checkAvailability(){try{if(1!==this.config.countryId)try{await this.ensureStripe();let e=this.getOrCreateStripePaymentRequest(),t=await e.canMakePayment();return this.stripeApplePayAvailable=!!t?.applePay,this.stripeApplePayAvailable}catch(e){return console.error("[VagaroPayment:ApplePay][checkAvailability] Stripe canMakePayment failed:",e),!1}await X(q,"anonymous");let e=!!window.ApplePaySession&&window.ApplePaySession.canMakePayments();return!!(window.ApplePaySession&&e)}catch(e){return console.error("[VagaroPayment:ApplePay] checkAvailability() failed:",e),!1}}async openStripeFlow(e){await this.ensureStripe();let t=this.getOrCreateStripePaymentRequest(e);if(!this.stripeApplePayAvailable){let e=await t.canMakePayment();if(!e?.applePay)throw console.error("[VagaroPayment:ApplePay][openStripeFlow] Apple Pay not available, aborting"),Error("Apple Pay not available")}return new Promise((e,a)=>{t.on("paymentmethod",t=>{try{let a={token:t.paymentMethod.id,source:"applepay",gateway:"stripe",rawPaymentData:t.paymentMethod};t.complete("success"),e(a)}catch(e){console.error("[VagaroPayment:ApplePay][openStripeFlow] error building token:",e),t.complete("fail"),a(e)}}),t.show()})}async open(e,t){return 1!==this.config.countryId?this.openStripeFlow(e):(await X(q,"anonymous"),new Promise((a,r)=>{if(!window.ApplePaySession||!window.ApplePaySession.canMakePayments())return void r(Error("Apple Pay is not available on this device/browser"));let s={countryCode:this.config.countryCode,currencyCode:this.config.currency,total:{label:this.config.merchantName,amount:e.toFixed(2)},supportedNetworks:this.config.supportedNetworks,merchantCapabilities:this.config.merchantCapabilities,requiredBillingContactFields:["postalAddress","name"]};this.session=new window.ApplePaySession(this.config.applePayVersion,s),this.session.onvalidatemerchant=async()=>{try{if(this.config.showLoader?.(!0),"function"!=typeof this.config.fetchMerchantSession)throw Error("fetchMerchantSession callback is required for Apple Pay");let e={domainName:window.location.hostname,paymentProviderType:2,loginUserId:this.config.loginUserId??"0",merchantTokenId:this.config.merchantTokenId??"",userAgent:navigator.userAgent,baseApiUrl:this.config.baseApiUrl},t=await this.config.fetchMerchantSession(e);this.session.completeMerchantValidation(JSON.parse(t?.Data))}catch(e){console.error("[VagaroPayment:ApplePay] Merchant validation failed:",e),this.config.showLoader?.(!1),this.session?.abort(),r(e)}finally{this.config.showLoader?.(!1)}},this.session.onpaymentauthorized=async e=>{try{let r=e.payment?.token,s={token:"string"==typeof r?.paymentData?r.paymentData:JSON.stringify(r?.paymentData??""),source:"applepay",rawPaymentData:e.payment};t?.onAuthorized&&await t.onAuthorized(s),this.session.completePayment(window.ApplePaySession.STATUS_SUCCESS),a(s)}catch(e){console.error("[VagaroPayment:ApplePay] Payment authorization failed:",e),this.session.completePayment(window.ApplePaySession.STATUS_FAILURE),r(e)}},this.session.oncancel=()=>{this.config.showLoader?.(!1),r(new DOMException("User cancelled Apple Pay","AbortError"))},this.session.begin()}))}destroy(){if(this.stripePaymentRequest=null,this.stripeApplePayAvailable=!1,this.session){try{this.session.abort()}catch(e){}this.session=null}}}class Q{config;providers=new Map;_status="idle";statusListeners=new Set;constructor(e){this.config={...e},X("https://cdnjs.cloudflare.com/ajax/libs/qrcodejs/1.0.0/qrcode.min.js").catch(()=>{})}get status(){return this._status}addStatusListener(e){return this.statusListeners.add(e),()=>{this.statusListeners.delete(e)}}
5setStatus(e){this._status=e,this.statusListeners.forEach(t=>t(e))}getProvider(e){let t=this.providers.get(e);if(!t){switch(e){case"gpay":t=new W(this.config);break;case"applepay":t=new K(this.config);break;default:throw console.error("[VagaroPayment:Facade] Unknown payment type:",e),Error(`Unknown payment type: ${e}`)}this.providers.set(e,t)}return t}async checkAvailability(e){this.setStatus("checking_availability");try{let t=this.getProvider(e),a=await t.checkAvailability();return this.setStatus("idle"),a}catch{return this.setStatus("idle"),!1}}async processPayment(e,t){if(!t||t<=0||!Number.isFinite(t))throw Error(`Invalid payment amount: ${t}`);if("idle"!==this._status&&"success"!==this._status&&"error"!==this._status&&"cancelled"!==this._status)throw Error("A payment is already in progress");if("function"!=typeof this.config.createCardToken)throw Error("createCardToken (Zenswipe API) callback is required in config");this.setStatus("opening_payment_sheet"),this.config.showLoader?.(!0);try{let a=this.getProvider(e);if("applepay"===e){let e=null;if(await a.open(t,{onAuthorized:async a=>{this.setStatus("creating_card_token"),e=await this.callZenswipe(a,t)}}),!e)throw Error("Zenswipe card token creation did not complete");return this.setStatus("success"),this.config.showLoader?.(!1),e}{let e=await a.open(t);this.setStatus("extracting_token"),this.setStatus("creating_card_token");let r=await this.callZenswipe(e,t);return this.setStatus("success"),this.config.showLoader?.(!1),r}}catch(e){throw this.config.showLoader?.(!1),e instanceof DOMException&&"AbortError"===e.name?this.setStatus("cancelled"):this.setStatus("error"),e}}extractBillingAddress(e){let t=e.rawPaymentData;if(t){if(1!==e.countryId&&t.billing_details){let e=t.billing_details;return{street:e?.address?.line1||"",no:e?.address?.line2||"",city:e?.address?.city||"",state:e?.address?.state||"",postal:e?.address?.postal_code||"",country:e?.address?.country||""}}if("applepay"===e.source&&t.billingContact){let e=t.billingContact;return{street:e.addressLines?.[0]||"",no:e.addressLines?.[1]||"",city:e.locality||"",state:e.administrativeArea||"",postal:e.postalCode||"",country:e.countryCode||""}}if("gpay"===e.source&&t.info.billingAddress){let e=t.info.billingAddress;return{street:e.address1||"",no:e.address2||"",city:e.locality||"",state:e.administrativeArea||"",postal:e.postalCode||"",country:e.countryCode||""}}}}async callZenswipe(e,t){let a=this.extractBillingAddress(e),r={secureToken:1!==this.config.countryId?JSON.stringify(e.rawPaymentData||{}):e.token,paymentMethod:e.source,amount:t,currency:this.config.currency??"USD",paymentGatewayType:1!==this.config.countryId?4:6,merchantToken:this.config.merchantTokenId??"",loginUserId:this.config.loginUserId??"",billingAddress:a,baseApiUrl:this.config.baseApiUrl,countryId:this.config.countryId},s=await this.config.createCardToken(r);return{paymentMethod:e.source,secureToken:e.token,rawPaymentData:e.rawPaymentData,zenswipeResponse:s}}updateConfig(e){Object.assign(this.config,e),("idle"===this._status||"success"===this._status||"error"===this._status||"cancelled"===this._status)&&(this.providers.forEach(e=>e.destroy()),this.providers.clear())}destroy(){this.providers.forEach(e=>e.destroy()),this.providers.clear(),this._status="idle",this.statusListeners.clear()}}({...J});function ee(){let e,t,a=(0,R.zy)(),i=(0,R.Zp)(),{device:d,module:y,profileData:h,myAccountSecurity:g}=(0,p.J)(),{data:C,isLoading:b,refetch:v}=(e={type:!0,device:d,module:y,merchantId:(0,A.IN)()?"QX9p3jq6~mMP6js9ReeSqw==":(0,S.db)(),appNo:(0,A.IN)()?window.BrandedAppBID:null,brandedApp:(0,A.IN)()??!1},(0,o.I)({queryKey:[c.lH.paymentMethods.getPaymentMethods,e],queryFn:()=>l.getPaymentMethods(e)})),I=0,N=C?.customerPayment;C?.customerBank;let x=C?.mTokenID,[P,k]=(0,s.useState)(null),[D,M]=(0,s.useState)(null),[O,E]=(0,s.useState)(!1),[U,_]=(0,s.useState)(!1),F=(0,s.useRef)(null),[q,Y]=(0,s.useState)(!1),G=(0,s.useRef)([]),[H,$]=(0,s.useState)(!1),[Z,J]=(0,s.useState)(!1),z=h?.countryID===1;(0,V.A)({onReset:()=>{k(null),M(null)}}),(0,s.useEffect)(()=>{window.scrollTo(0,0)},[]);let X=e=>{en(3!==e.Mode),_(!0),W(e)},W=e=>{let t=Q(e.callfor),a="Website",r=h?.countryID.toString()??"1",s={};s.ccCountryId=r,s.OldTokenID="",s.Mode=e.Mode,void 0!==e.oldTokenID&&null!=e.oldTokenID&&e.oldTokenID.toString().trim().length>0&&(s.OldTokenID=e.oldTokenID,s.Mode=3),2==e.callfor?(window.vui.loader=K,window.vui.getTypeFrameForEditCard(e.divId,380,t,es,a,r,!0,!0)):1==e.callfor&&(window.vui.loader=K,window.vui.getTypeWithoutButton(e.divId,160,t,"","",er,a,!0,r,void 0,void 0,!0))};window.onGetTokenCallback=e=>{1e3==e.data.custom_code?_(!0):(_(!1),(0,S.bG)(e.data.Message)&&u.oR.error(e.data.Message))};let K=e=>{_(e)},Q=e=>void 0!==x&&null!=x?x:"",ee=()=>{_(!0),I++;let e=(()=>{let e={};if(e.AttemptCount=3,e.EnabledUsers=0,e.BlockedIP="",void 0!==g&&null!=g&&""!=g){let t=g.split("|");e.AttemptCount=t.length>2?t[0]:3,e.EnabledUsers=t.length>2?t[1]:1,e.BlockedIP=t.length>2?t[2]:""}return e})(),t=!0;if("1"===e.EnabledUsers?t=!0:"0"===e.EnabledUsers&&(t=!1),!1==t&&(void 0!==N?.length&&N?.length>=e.AttemptCount||I>
5e.AttemptCount))return u.oR.success("Card information saved successfully"),_(!1),!1;let a="",r=F.current?.querySelector("iframe")||null;r&&(a=r.src),et({request:{userAgent:window.navigator.userAgent,iframeId:a,totalCount:e.AttemptCount},myAccountSecurityKeys:e})},{mutate:et}=(0,n.n)({mutationFn:async e=>{let{request:t,myAccountSecurityKeys:a}=e;return await l.saveInitialccDetailLogs(t)},onSuccess:(e,t)=>{let a=t.myAccountSecurityKeys.AttemptCount,r=!0;"1"===t.myAccountSecurityKeys.EnabledUsers.toString()?r=!0:"0"===t.myAccountSecurityKeys.EnabledUsers.toString()&&(r=!1),void 0!==e&&null!=e&&e>a&&!r?(u.oR.success("Card information saved successfully."),en(!1),_(!1)):(_(!1),window.vui.frame.zenswipe.submit())},onError:e=>{console.error("Mutation failed:",e),void 0!==e&&e.message.includes("Rate limit exceeded")?(u.oR.success("Card information saved successfully."),en(!1),_(!1)):(_(!1),window.vui.frame.zenswipe.submit())}}),{mutate:ea}=(t={onSuccess:e=>{e&&(u.oR.success("Card information saved successfully"),en(!1),_(!1),k(null),v())},onError:()=>{u.oR.error("Something Went To Wrong!!"),_(!1)}},(0,n.n)({mutationFn:e=>l.addCreditCard(e),onSuccess:e=>{},onError:e=>{u.oR.error("Error adding credit card")},...t})),er=e=>{if(_(!0),e&&e.data&&e.data.data&&1e3===e.data.custom_code){let t=eo(1,e.data.data);t?ea(t):_(!1)}else _(!1),(0,S.bG)(e.data.Message)&&u.oR.error(e.data.Message)},es=e=>{if(_(!0),e&&e.data&&e.data.data&&1e3===e.data.custom_code){let t=eo(2,e.data.data);t?ea(t):_(!1)}else _(!1),(0,S.bG)(e.data.Message)&&u.oR.error(e.data.Message)},en=e=>{E(e),!1===e&&F.current&&(F.current.innerHTML="")},eo=(e,t)=>{let a=[];if(null!=t&&void 0!==t.card_token&&null!==t.card_token&&""!==t.card_token.toString().trim()){let r=null;if(2==e&&(r=G.current),void 0!==r&&null!=r&&r.length>0)for(let e=0;e<r.length;e++){let s=r[e],n={};n.ccNo=t.cc_no,n.cardType=t.cc_type,n.ccCode=t.cvv,n.cardTokenId=t.card_token,n.uccFirstName=t.first_name,n.uccMiddleName=t.middle_name,n.uccLastName=t.last_name,n.checkUserExists=!1,n.removeCardOnFile=!1,n.saveCard=!0,void 0!==t.expire_month&&null!=t.expire_month&&""!=t.expire_month&&(n.expMonth=t.expire_month),void 0!==t.expire_year&&null!=t.expire_year&&""!=t.expire_year&&(n.expYear=t.expire_year),n.merchantId=s.businessId,n.groupId=s.sGroup??"",n.type=3,n.device=d,n.module=y,a.push(n),n=null,s=null}else{let e={};e.ccNo=t.cc_no,e.cardType=t.cc_type,e.ccCode=t.cvv,e.cardTokenId=t.card_token,e.uccFirstName=t.first_name,e.uccMiddleName=t.middle_name,e.uccLastName=t.last_name,e.checkUserExists=!1,e.removeCardOnFile=!1,e.saveCard=!0,void 0!==t.expire_month&&null!==t.expire_month&&""!==t.expire_month&&(e.expMonth=t.expire_month),void 0!==t.expire_year&&null!==t.expire_year&&""!==t.expire_year&&(e.expYear=t.expire_year),e.merchantId="QX9p3jq6~mMP6js9ReeSqw==",e.groupId="",e.type=P&&P.cardTokenId?3:2,e.oldCardTokenId=P?.cardTokenId??"",e.device=d,e.module=y,a.push(e),e=null}return a}};(0,s.useEffect)(()=>{a.pathname.endsWith("/paymentmethods")?k(null):a.pathname.endsWith("/paymentmethods/details")&&(a.state?k(a.state):i("/myaccount/paymentmethods"+(0,S.X_)()))},[a]);let ei=()=>{i("/myaccount/paymentmethods"+(0,S.X_)()),window.handleOperation="",k(null)};return(window.handleEventBack=ei,b)?(0,r.jsx)(L,{}):P&&P.cardTokenId&&P.creditCardNumber?(0,r.jsx)(j,{cardTokenId:P.cardTokenId,cardNumber:P.creditCardNumber,creditCard:P,customerPaymentData:N||[],PaymentMethods:v,onBack:ei,handelAddNewCard:X,SaveCreditCard:ee,handelClose:en,isFrameLoading:U,showEditModal:q,setShowEditModal:Y,BusinessesCards:G,disableCache:H,onDisableCheck:e=>$(e)}):D&&D.vplUserAccountId?(0,r.jsx)(T,{customerBank:D,vplUserAccountId:D.vplUserAccountId,PaymentMethods:v,onBack:()=>M(null)}):(0,r.jsx)(s.Suspense,{children:(0,r.jsxs)("div",{className:`vg-body-font MyaccountWrapper web-body-font web-builder-font-color ${B.paymentMethodsPage}`,children:[(0,r.jsx)(w.A,{isLoading:b||U}),(0,r.jsx)("div",{className:B.pageTitle+" vg-display-large web-display-large web-builder-font-color",children:"Payment Methods"}),z&&(0,r.jsxs)("div",{className:` ${B.vplPayment}`,onClick:()=>window.open("https://www.affirm.com/user/signup","_blank"),children:[(0,r.jsxs)("div",{className:`${B.leftPartPayment}`,children:[(0,r.jsx)("div",{className:`vg-display-large web-display-large web-builder
5-font-color ${B.vplPaymentHeading}`,children:"Vagaro Now Offers Affirm as a Payment Method"}),(0,r.jsx)("div",{className:`vg-body-font web-body-font web-text-secondary web-builder-font-color ${B.vplPaymentText}`,children:"You'll manage all new Buy Now, Pay Later payments directly on Affirmâs website. Don't worry, any current payments will still be accessible here."}),(0,r.jsx)("div",{className:`${B.affirmLogo}`,children:(0,r.jsxs)("svg",{width:"74",height:"30",viewBox:"0 0 429 171",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M28.1 156.27C22.8 156.27 20.1 153.66 20.1 149.37C20.1 141.37 29.02 138.68 45.29 136.95C45.29 147.61 38.08 156.27 28.05 156.27H28.1ZM35.1 96.3198C23.47 96.3198 10.1 101.79 2.83998 107.58L9.46998 121.58C15.29 116.25 24.7 111.69 33.19 111.69C41.26 111.69 45.72 114.39 45.72 119.83C45.72 123.48 42.77 125.33 37.19 126.06C16.33 128.76 -0.0200195 134.52 -0.0200195 150.59C-0.0200195 163.33 9.04998 171.04 23.22 171.04C33.34 171.04 42.34 165.42 46.62 158.04V169.04H65.48V122.95C65.48 103.95 52.29 96.2798 35.11 96.2798L35.1 96.3198Z"}),(0,r.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M224.39 98.3902V168.95H244.57V134.95C244.57 118.8 254.35 114.05 261.16 114.05C264.226 114.026 267.229 114.914 269.79 116.6L273.48 97.9502C270.62 96.8056 267.559 96.2511 264.48 96.3202C254.11 96.3202 247.59 100.91 243.29 110.25V98.3902H224.39Z"}),(0,r.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M367 96.3198C356.33 96.3198 348.35 102.62 344.2 108.7C340.35 100.85 332.2 96.3198 322.4 96.3198C311.74 96.3198 304.35 102.24 300.94 109.06V98.3898H281.48V168.95H301.68V132.62C301.68 119.62 308.51 113.33 314.88 113.33C320.65 113.33 325.95 117.06 325.95 126.69V168.95H346.11V132.62C346.11 119.43 352.77 113.33 359.44 113.33C364.78 113.33 370.44 117.21 370.44 126.55V168.95H390.6V120.17C390.6 104.32 379.93 96.3198 367.04 96.3198"}),(0,r.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M175.28 98.3901H157V91.2201C157 81.8801 162.33 79.2201 166.92 79.2201C170.054 79.261 173.135 80.0313 175.92 81.4701L182.14 67.2401C182.14 67.2401 175.83 63.1201 164.36 63.1201C151.47 63.1201 136.8 70.3901 136.8 93.2001V98.3901H106.25V91.2201C106.25 81.8801 111.57 79.2201 116.17 79.2201C119.309 79.2199 122.4 79.9926 125.17 81.4701L131.39 67.2401C127.68 65.0701 121.71 63.1201 113.62 63.1201C100.73 63.1201 86.0599 70.3901 86.0599 93.2001V98.3901H74.3799V113.95H86.0899V168.95H106.25V113.95H136.84V168.95H157V113.95H175.28V98.3901Z"}),(0,r.jsx)("path",{d:"M207.46 98.3901H187.32V168.92H207.46V98.3901Z"}),(0,r.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M188.06 86.4H207.79C219.3 50.21 258.35 18.4 304.79 18.4C361.27 18.4 410.08 61.4 410.08 128.34C410.252 142.08 408.364 155.769 404.48 168.95H423.63L423.82 168.29C427.047 155.241 428.639 141.842 428.56 128.4C428.56 53.75 374.16 0.0200195 304.83 0.0200195C250.37 0.0200195 201.83 37.82 188.07 86.42L188.06 86.4Z"})]})}),(0,r.jsxs)("div",{className:`${B.paymentBtn}`,children:[(0,r.jsx)(m.YU,{ButtonVariant:"secondary",IconPlacement:"suffix",children:"Learn More"}),(0,r.jsx)(m.YU,{ButtonVariant:"theme",IconPlacement:"prefix",children:"Get Started"})]})]}),(0,r.jsxs)("div",{className:`${B.rightPartPayment}`,children:[(0,r.jsx)("img",{src:"https://1a96a36bae7c8550901a-274b8a70320bb26e7a1e0ea7836ee429.ssl.cf2.rackcdn.com/Images/PriductCard.png",className:`${B.paymentImg1}`,width:"178"}),(0,r.jsx)("img",{src:"https://1a96a36bae7c8550901a-274b8a70320bb26e7a1e0ea7836ee429.ssl.cf2.rackcdn.com/Images/ghenMarCuano.png",className:`${B.paymentImg2}`,width:"142"})]})]}),N&&(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:B.paymentCardsSection,children:[(0,r.jsx)("div",{className:` ${B.sectionAddTitle} vg-display-small web-display-small web-builder-font-color`,children:"Add Payment"}),(0,r.jsx)("div",{className:` ${B.sectionDescription} vg-body-font web-body-font web-builder-font-color `,children:"Add and manage your payment cards."})]}),(0,r.jsx)("div",{className:` ${B.sectionTitle}
5 vg-display-small web-display-small web-builder-font-color`,children:"Payment Cards"}),(0,r.jsx)("div",{className:B.customerPayments,children:N.map(e=>(0,r.jsx)("div",{onClick:()=>{i("/myaccount/paymentmethods/details"+(0,S.X_)(),{state:e}),k(e),en(!1)},children:(0,r.jsx)(f,{customerPayment:e})},e.cardTokenId))}),!O&&(0,r.jsx)("div",{className:B.addNewPaymentButton,children:(0,r.jsx)(m.YU,{ButtonVariant:"ghost",ButtononClick:()=>{X({divId:"dvAddCardBlock",callfor:1,oldTokenID:"",Mode:2})},disabled:U,children:"Add New Payment"})}),(0,r.jsxs)(r.Fragment,{children:[O&&(0,r.jsx)("div",{className:B.ccIframeHeder,children:"Card Information"}),O&&(h?.userId,!1),(0,r.jsx)("div",{className:`iframe-container ${B.addCardBlock}`,children:(0,r.jsx)("div",{ref:F,id:"dvAddCardBlock"})}),O&&(0,r.jsxs)("div",{className:`${B.paymentBtnforCard}`,children:[(0,r.jsx)(m.YU,{ButtonVariant:"secondary",ButtononClick:()=>en(!1),children:"Cancel"}),(0,r.jsx)(m.YU,{ButtonVariant:"primary",ButtononClick:()=>ee(),disabled:U,children:"Save Changes"})]})]})]})]})})}}}]);
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.