(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7783],{9712:(e,t,a)=>{"use strict";a.d(t,{$:()=>s});var n=a(95155),r=a(29300),i=a.n(r),o=a(71980),l=a.n(o);let s=e=>{let{children:t,variant:a="primary",size:r="base",withIcon:o=!1,fill:s=!1,className:d,...c}=e,p=i()(l().button,l()[a],l()[r],{[l().withIcon]:o,[l().fill]:s},d);return(0,n.jsx)("button",{className:p,...c,children:t})}},10187:(e,t,a)=>{"use strict";a.d(t,{j:()=>o,y:()=>i});var n=a(23915),r=a(16203);let i=0===(0,n.Dk)().length?(0,n.Wp)({apiKey:"AIzaSyArzhmSuVQNCvq60YIBINwemRcnqoO0E08",appId:"1:260774426049:web:997394d794ae66c8392b40",authDomain:"canyon-ranch-app.firebaseapp.com",measurementId:"G-6VPD0953GG",messagingSenderId:"260774426049",projectId:"canyon-ranch-app",storageBucket:"canyon-ranch-app.firebasestorage.ap"}):(0,n.Sx)(),o=(0,r.xI)(i)},15906:e=>{e.exports={paymentButton:"styles_paymentButton__RJ6QY"}},18934:(e,t,a)=>{"use strict";a.d(t,{CardProvider:()=>l,f:()=>s});var n=a(95155),r=a(12115),i=a(97255);let o=(0,r.createContext)(void 0),l=e=>{let{children:t}=e,{cards:a,loading:l,refetchCards:s}=(0,i.QZ)(),[d,c]=(0,r.useState)([]),[p,f]=(0,r.useState)(!1),[g,h]=(0,r.useState)(!1),[m,u]=(0,r.useState)(null);(0,r.useEffect)(()=>{a.length>0&&c(a)},[a]);let x=async()=>{try{await s()}catch(e){throw Error("Error refetching card details")}};return(0,n.jsx)(o.Provider,{value:{cardDetails:d,isCardAdded:p,loading:l,refetchCardDetails:x,selectedCardId:m,setIsCardAdded:f,setSelectedCardId:u,setShowCardInputs:h,showCardInputs:g,updateCardDetails:e=>{c(t=>t.map(t=>t.id===e.id?e:t))}},children:t})};function s(){let e=(0,r.useContext)(o);if(!e)throw Error("useCardContext must be used within a CardProvider");return e}},20836:(e,t,a)=>{"use strict";a.d(t,{$:()=>i});let n={lg:1280,md:900,sm:600,xl:1440,xs:400,xxl:1920},r=e=>"@media (min-width: ".concat(e,"px)"),i={lg:r(n.lg),md:r(n.md),sm:r(n.sm),xl:r(n.xl),xs:r(n.xs),xxl:r(n.xxl)}},22137:(e,t,a)=>{"use strict";a.d(t,{s:()=>l});var n=a(95155),r=a(45766),i=a(95780),o=a.n(i);let l=e=>{let{children:t}=e,{isMobile:a}=(0,r.l)();return a?null:(0,n.jsx)("h2",{className:o().pageTitle,children:t})}},34594:e=>{e.exports={container:"styles_container__xgjMf",header:"styles_header__WfYlp"}},43404:(e,t,a)=>{"use strict";a.d(t,{s:()=>o});var n=a(12115),r=a(86864),i=a(10187);let o=()=>{let[e,t]=(0,n.useState)(null);return(0,n.useEffect)(()=>{(0,r.TT)().then(e=>{e&&t((0,r.P5)(i.y))}).catch(e=>{throw Error("Analytics initialization failed:",e)})},[]),{logAnalyticsEvent:(t,a)=>{if(!e)return;let{error:n,...i}=a,o={success:+!n,...i};try{(0,r.$s)(e,t,o)}catch(e){throw Error("Error logging event")}}}}},45521:(e,t,a)=>{"use strict";a.d(t,{N:()=>n,b:()=>r});let n=[{cardType:"AX",label:"American Express",value:"/icons/cards/americanExpress.svg"},{cardType:"DS",label:"Discover",value:"/icons/cards/discoverCard.svg"},{cardType:"MC",label:"Mastercard",value:"/icons/cards/masterCard.svg"},{cardType:"VS",label:"Visa",value:"/icons/cards/visa.svg"}];var r=function(e){return e.VS="visa",e.MC="mc",e.AX="amex",e.DS="discover",e}({})},45766:(e,t,a)=>{"use strict";a.d(t,{G:()=>r,l:()=>o});var n=a(12115),r=function(e){return e.XXL="2xl",e.XL2="1xl",e.XL="xl",e.LG="lg",e.MD="md",e.SM="sm",e}({});let i=()=>{let e=window.innerWidth;if(e>=1536)return"2xl";if(e>=1440)return"1xl";if(e>=1280)return"xl";if(e>=1024)return"lg";if(e>=768)return"md";else return"sm"},o=()=>{let[e,t]=(0,n.useState)(i());(0,n.useEffect)(()=>{let e=()=>{t(i())};return window.addEventListener("resize",e),t(i()),()=>{window.removeEventListener("resize",e)}},[]);let a="sm"===e,r=["sm"].includes(e),o=["sm","md"].includes(e),l=["md","lg"].includes(e),s=["sm","md","lg"].includes(e),d=["md","lg"].includes(e);return{isDesktop:["xl","1xl"].includes(e),isLongDesktop:["1xl","2xl"].includes(e),isMediumScreen:o,isMobile:a,isMobileOrTablet:s,isSmallScreen:r,isTablet:l,isTabletOrDesktop:d,screenSize:e}}},56401:(e,t,a)=>{Promise.resolve().then(a.bind(a,86199))},60523:(e,t,a)=>{"use strict";a.d(t,{J:()=>n});let n={alerts:{error:{background:"#E5381A",text:"#971903"},success:{background:"#E2F1E0",text:"#285B45"},warning:{background:"#F2C540",text:"#F2C540"}},bgColor:{neutral:{default:"#5c5451",neutralBase:"#fbfbfb"}},black:"#000",borders:{primary:"#e0dedc"},divider:{light:"#E1DEDB"},link:{primary:"#a64e26"},location:{las_vegas:"#937458",lenox:"#222445",tucson:"#583D52",woodside:"#24412A"},neutrals:{background:"#E0DDDA",grayscale1:"#F5F5F5",grayscale2:"#D7D7D7",grayscale3:"#AEAEAE",grayscale4:"#868686",grayscale5:"#5D5D5D",grayscale6:"#353535",grayscale7:"#262020",grayscaleBackground:"#C4C4C4",grayscaleWhite:"#FFFFFF",selected:"#C1BAB6"},primary:{cream:"#F7EDE9",dark:"#B04E21",darker:"#813918",light:"#EFDCD3",medium:"#D0957A"},secondary:{background:{lightest:"#FBF8F5"},dark:"#F4551F"},textColor:{brand:{alpha:"#121110",dark:"#6A2F14",hover:"#9B451D"},default:"#353535",primary:{darkTheme:"#FEFDFC"}},white:"#fff",whiteOptical:"#fcfbfa"}},63102:(e,t,a)=>{"use strict";a.d(t,{a:()=>r,s:()=>n});let n={body:16,heading1:74,heading2:59,heading3:39,heading4:32,heading5:26},r={cg:"var(--font-cormorant-garamond)",pn:"var(--font-proxima-nova)"}},71980:e=>{e.exports={button:"styles_button__YaZn_",primary:"styles_primary__EzVYn",secondary:"styles_secondary__v0qOY",destructive:"styles_destructive__VSkC6",ghost:"styles_ghost__mui3d",text:"styles_text__sHIRI","neutral-text":"styles_neutral-text__i_68_",xl:"styles_xl__vqNgs",lg:"styles_lg__6wvoS",base:"styles_base__Wg2dz",sm:"styles_sm__gSr_X",withIcon:"styles_withIcon__b3o4j",fill:"styles_fill__nunXW"}},83075:(e,t,a)=>{"use strict";a.d(t,{W:()=>n});var n=function(e){return e.WARNING="warning",e.EXPIRED="expired",e}({})},86199:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>R});var n=a(95155),r=a(70802),i=a(22137),o=a(12115),l=a(14676),s=a(57489),d=a(58587),c=a(25702),p=a(59922),f=a(66766),g=a(35695),h=a(18934),m=a(45766),u=a(30662),x=a(85189),y=a(44987),C=a(63102);let b={CloseButton:(0,y.Ay)(u.Ay).withConfig({componentId:"sc-ae1e223a-0"})(["&&{padding:0;margin:0;border:none;background:none;font-size:16px;}"]),DrawerPopup:(0,y.Ay)(x.A).withConfig({componentId:"sc-ae1e223a-1"})(["height:200px;font-family:",";"],C.a.cg),HeaderContainer:y.Ay.div.withConfig({componentId:"sc-ae1e223a-2"})(["display:flex;justify-content:space-between;align-items:center;font-family:",";font-size:24px;font-weight:100;"],C.a.cg),ListItem:(0,y.Ay)(c.A.Item).withConfig({componentId:"sc-ae1e223a-3"})(["border-bottom:none;cursor:pointer;font-family:",";font-size:17px;text-transform:uppercase;font-weight:600;"],C.a.pn)},w=[{icon:"/icons/cards/creditCard.svg",key:"credit-card",label:"Credit Card",route:"payment/addcard"}],v=e=>{let{visible:t,onClose:a}=e,{setShowCardInputs:r}=(0,h.f)(),{screenSize:i}=(0,m.l)(),o=[m.G.XXL,m.G.XL,m.G.LG].includes(i),l=(0,g.useRouter)(),s=e=>{e&&(r(!0),l.push("".concat(e,"?method=credit-card")))},u=(0,n.jsxs)(b.HeaderContainer,{children:[(0,n.jsx)("span",{children:"Choose Payment Method"}),(0,n.jsx)(b.CloseButton,{onClick:a,children:(0,n.jsx)(d.A,{})})]}),x=()=>(0,n.jsx)(c.A,{dataSource:w,itemLayout:"horizontal",renderItem:e=>(0,n.jsx)(b.ListItem,{onClick:()=>s(e.route),children:(0,n.jsx)(c.A.Item.Meta,{avatar:(0,n.jsx)(f.default,{alt:e.label,height:30,src:e.icon,width:30}),title:e.label})})}),y=(0,n.jsx)(p.A,{closable:!1,footer:null,open:t,title:u,children:(0,n.jsx)(x,{})}),C=(0,n.jsx)(b.DrawerPopup,{closable:!1,height:200,open:t,placement:"bottom",title:u,children:(0,n.jsx)(x,{})});return o?y:C};var j=a(9712),A=a(15906),I=a.n(A);let D=()=>{let[e,t]=(0,o.useState)(!1),{isMobile:a}=(0,m.l)(),r=()=>{t(!0)};return(0,n.jsxs)(n.Fragment,{children:[a?(0,n.jsx)("div",{className:I().paymentButton,children:(0,n.jsxs)(j.$,{fill:!0,onClick:r,children:[(0,n.jsx)(s.g,{icon:l.faPlus}),"Add Payment Method"]})}):(0,n.jsxs)(j.$,{onClick:r,children:[(0,n.jsx)(s.g,{icon:l.faPlus}),"Add Payment Method"]}),e&&(0,n.jsx)(v,{onClose:()=>t(!1),visible:e})]})};var _=a(82343),k=a(43038),E=a(97255),S=a(60523);let F={AcknowledgeButton:(0,y.Ay)(u.Ay).withConfig({componentId:"sc-f95bfaba-0"})(["align-items:center;border-color:",";display:flex;justify-content:center;width:282px;"],S.J.primary.dark),AcknowledgeButtonContainer:y.Ay.div.withConfig({componentId:"sc-f95bfaba-1"})(["display:flex;justify-content:center;padding:16px;"]),BoldText:y.Ay.span.withConfig({componentId:"sc-f95bfaba-2"})(["font-weight:bold;"]),CancelButton:(0,y.Ay)(u.Ay).withConfig({componentId:"sc-f95bfaba-3"})(["border-color:",";"],S.J.primary.dark),CustomStyledModal:(0,y.Ay)(p.A).withConfig({componentId:"sc-f95bfaba-4"})(["display:flex;justify-content:center;.ant-modal-content{width:328px !important;height:236px !important;}"]),DeleteButton:(0,y.Ay)(u.Ay).withConfig({componentId:"sc-f95bfaba-5"})(["background:",";margin-bottom:8px;color:",";"],S.J.alerts.error.text,S.J.primary.light),DeleteCardModalContent:y.Ay.div.withConfig({componentId:"sc-f95bfaba-6"})(["display:block;margin-top:16px;text-align:left;"]),DeleteCardParagraphLarge:y.Ay.p.withConfig({componentId:"sc-f95bfaba-7"})(["font-size:24px;margin-bottom:10px;width:286px;"]),DeleteCardParagraphSmall:y.Ay.p.withConfig({componentId:"sc-f95bfaba-8"})(["font-size:20px;margin:0px;"]),Icon:(0,y.Ay)(s.g).withConfig({componentId:"sc-f95bfaba-9"})(["display:block;margin:0 auto;color:#971903;font-size:24px;"]),InfoIcon:(0,y.Ay)(s.g).withConfig({componentId:"sc-f95bfaba-10"})(["display:block;margin:0 auto;color:#285b45;font-size:24px;margin-bottom:16px;"]),StyledDeletModal:(0,y.Ay)(p.A).withConfig({componentId:"sc-f95bfaba-11"})(["display:flex;justify-content:center;align-items:center;@media (max-width:600px){.ant-modal-content{width:328px !important;height:339px !important;}}"])},T=e=>{var t;let{cardId:a,isOpen:r,onClose:i}=e,{cardDetails:s,refetchCardDetails:d}=(0,h.f)(),{deleteCard:c}=(0,E.V6)(),[p,f]=(0,o.useState)(!1),[g,m]=(0,o.useState)(null),u=null===(t=s.find(e=>e.id===a))||void 0===t?void 0:t.last4digits,x=async()=>{try{await c(a);let e=s.find(e=>e.id===a);e&&m({cardType:e.cardType,last4Digits:e.last4digits}),f(!0)}catch(e){throw Error("Failed to send delete card")}finally{i()}};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(F.StyledDeletModal,{closable:!1,footer:[(0,n.jsxs)("div",{children:[(0,n.jsx)(F.DeleteButton,{block:!0,onClick:x,children:"Delete Card"},"delete"),(0,n.jsx)(F.CancelButton,{block:!0,onClick:i,children:"Keep it"})]},"fo ter-buttons")],onCancel:i,open:r,style:{maxWidth:"300px"},children:(0,n.jsxs)(F.DeleteCardModalContent,{children:[(0,n.jsx)(F.Icon,{icon:l.faCreditCard}),(0,n.jsxs)(F.DeleteCardParagraphLarge,{children:["Delete card ending with ",(0,n.jsx)(F.BoldText,{children:u}),"?"]}),(0,n.jsx)(F.DeleteCardParagraphSmall,{children:"Upon confirming, this card won’t be available."})]})}),g&&(0,n.jsx)(F.CustomStyledModal,{closable:!1,footer:[(0,n.jsx)(F.AcknowledgeButtonContainer,{children:(0,n.jsx)(F.AcknowledgeButton,{onClick:()=>{f(!1),d()},children:"OK"},"acknowledge")},"acknowledge-container")],maskClosable:!1,onCancel:()=>f(!1),open:p,children:(0,n.jsxs)(F.DeleteCardModalContent,{children:[(0,n.jsx)(F.InfoIcon,{icon:l.faCircleCheck}),(0,n.jsx)(F.BoldText,{children:g.cardType})," card ending in",(0,n.jsx)(F.BoldText,{children:g.last4Digits})," has been deleted from payment methods."]})})]})};var B=a(45521);let M={BoldText:y.Ay.span.withConfig({componentId:"sc-1332a45c-0"})(["font-weight:700;text-transform:uppercase;margin-right:6px;"]),CenteredContent:y.Ay.div.withConfig({componentId:"sc-1332a45c-1"})(["display:flex;justify-content:center;align-items:center;"]),CenteredFooter:y.Ay.div.withConfig({componentId:"sc-1332a45c-2"})(["display:flex;justify-content:center;"]),CenteredModalContent:y.Ay.div.withConfig({componentId:"sc-1332a45c-3"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:20px;"]),DeleteCardText:y.Ay.p.withConfig({componentId:"sc-1332a45c-4"})(["color:",";margin-left:4px;font-size:22px;line-height:29px;font-family:",";"],S.J.alerts.error.text,C.a.cg),DeleteModalWrapper:y.Ay.div.withConfig({componentId:"sc-1332a45c-5"})(["@media (max-width:600px){display:flex;justify-content:center;align-items:center;}"]),FooterButton:(0,y.Ay)(u.Ay).withConfig({componentId:"sc-1332a45c-6"})(["color:",";display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;border:1px solid ",";width:280px;height:44px;"],S.J.primary.dark,S.J.primary.dark),MenuText:y.Ay.p.withConfig({componentId:"sc-1332a45c-7"})(["font-size:20px;line-height:29px;font-family:",";"],C.a.cg),ModalText:y.Ay.p.withConfig({componentId:"sc-1332a45c-8"})(["@media (max-width:600px){height:48px;}"]),StyledButton:(0,y.Ay)(u.Ay).withConfig({componentId:"sc-1332a45c-9"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;border:none;background-color:transparent;box-shadow:none;&:hover,&:focus,&:active{background-color:#f4f2f1 !important;color:"," !important;}&::after{box-shadow:none;}&.ant-btn-clicked:after{animation:none;}"],S.J.neutrals.grayscale6),StyledDivider:y.Ay.div.withConfig({componentId:"sc-1332a45c-10"})(["width:156px;height:1px;border:1px solid #1a1a1a1a;margin-left:10px;"]),StyledMenuItem:y.Ay.div.withConfig({componentId:"sc-1332a45c-11"})(["width:174px;height:60px;display:flex;gap:1rem;align-items:center;padding-left:10px;justify-content:flex-start;@media (max-width:600px){height:44px;}"]),StyledModal:(0,y.Ay)(p.A).withConfig({componentId:"sc-1332a45c-12"})(["width:328px !important;height:224px !important;"])},z=e=>{let{cardId:t}=e,a=(0,g.useRouter)(),{cardDetails:r,updateCardDetails:i,refetchCardDetails:d,setSelectedCardId:c}=(0,h.f)(),{changeDefaultPayment:p}=(0,E.F8)(),[f,m]=(0,o.useState)(!1),[u,x]=(0,o.useState)(!1),[y,C]=(0,o.useState)(!1),[b,w]=(0,o.useState)(),[v,j]=(0,o.useState)(),[A,I]=(0,o.useState)(""),D=e=>{w(e),m(!0)},S=async e=>{C(!0);try{await p(e);let a=r.map(t=>t.id===e?{...t,isDefault:!0}:{...t,isDefault:!1});a.forEach(e=>i(e)),d();let n=a.find(t=>t.id===e);if(n){var t;let e=null===(t=B.N.find(e=>e.cardType===n.cardType))||void 0===t?void 0:t.label;j(e),I(n.last4digits)}}catch(e){throw x(!1),Error("failed to make card default")}finally{C(!1)}},F=r.some(e=>e.id===t&&e.isDefault),z=[{key:"isEdit",label:(0,n.jsxs)(M.StyledMenuItem,{children:[(0,n.jsx)(s.g,{icon:l.faPencil,size:"lg"}),(0,n.jsx)(M.MenuText,{children:"Edit Details"})]})},...F?[]:[{key:"isDefault",label:(0,n.jsxs)(M.StyledMenuItem,{children:[(0,n.jsx)(s.g,{icon:l.faCreditCardFront,size:"lg"}),(0,n.jsx)(M.MenuText,{children:"Make Default"})]})},{key:"delete",label:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(M.StyledDivider,{}),(0,n.jsxs)(M.StyledMenuItem,{children:[(0,n.jsx)(s.g,{icon:l.faTrashXmark,size:"lg",style:{color:"#971804"}}),(0,n.jsx)(M.DeleteCardText,{children:"Delete"})]})]})}]];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(_.A,{menu:{items:z,onClick:e=>{let n,{key:i}=e;switch(i){case"isEdit":c(t),a.push("/account/payment/addcard?cardId=".concat(t));break;case"isDefault":(n=r.find(e=>e.id===t))&&(x(!0),S(n.id));break;case"delete":(n=r.find(e=>e.id===t))&&D(n.id)}}},placement:"bottomLeft",children:(0,n.jsx)(M.StyledButton,{children:(0,n.jsx)(s.g,{height:24,icon:l.faEllipsisVertical,size:"xl",width:24})})}),(0,n.jsx)(M.DeleteModalWrapper,{children:(0,n.jsx)(T,{cardId:null!=b?b:0,isOpen:f,onClose:()=>{m(!1)}})}),(0,n.jsx)(M.StyledModal,{closable:!1,footer:y?null:(0,n.jsx)(M.CenteredFooter,{children:(0,n.jsx)(M.FooterButton,{onClick:()=>{x(!1),I("")},children:"OK"},"ok")}),open:u,children:y?(0,n.jsx)(M.CenteredContent,{children:(0,n.jsx)(k.A,{size:"large"})}):(0,n.jsxs)(M.CenteredModalContent,{children:[(0,n.jsx)(s.g,{icon:l.faCircleCheck,size:"2xl",style:{color:"#285b45"}}),(0,n.jsxs)(M.ModalText,{children:[(0,n.jsxs)(M.BoldText,{children:[v," ",A]}),"has become your default payment method"]})]})})]})};var P=a(20836);let N={CardContainer:y.Ay.div.withConfig({componentId:"sc-d3a9e8cb-0"})(["display:flex;align-items:center;border-radius:8px;","{justify-content:space-between;padding:1rem 2rem;}"],P.$.lg),CardDetails:y.Ay.div.withConfig({componentId:"sc-d3a9e8cb-1"})(["display:flex;align-items:center;flex-grow:1;"]),CardImage:y.Ay.img.withConfig({componentId:"sc-d3a9e8cb-2"})(["width:48px;height:32px;object-fit:contain;"]),CardImageWrapper:y.Ay.div.withConfig({componentId:"sc-d3a9e8cb-3"})(["margin-right:1rem;align-items:center;display:flex;gap:20px;background-color:#f7f5f2;border:1px solid #e0ddda;border-radius:4px;width:85px;height:55px;justify-content:center;"]),CardNumber:y.Ay.span.withConfig({componentId:"sc-d3a9e8cb-4"})(["font-size:17px;font-weight:600;margin-left:0.5rem;font-family:",";"],C.a.pn),Container:y.Ay.div.withConfig({componentId:"sc-d3a9e8cb-5"})(["font-family:",";margin-top:2rem;display:flex;flex-direction:column;gap:1rem;height:70vh;","{margin-top:0;}"],C.a.cg,P.$.lg),DefaultTag:y.Ay.span.withConfig({componentId:"sc-d3a9e8cb-6"})(["background-color:#fbfbfb;border:1px solid #d7d7d7;color:",";font-size:15px;font-weight:400;font-family:",";padding:0.25rem 0.5rem;border-radius:4px;margin-left:3rem;width:72px;height:28px;text-align:center;"],S.J.textColor.brand.alpha,C.a.pn),EditButtonWrapper:y.Ay.div.withConfig({componentId:"sc-d3a9e8cb-7"})(["","{display:block;}"],P.$.lg)},W=()=>{let{cardDetails:e,loading:t}=(0,h.f)();return(0,n.jsx)(N.Container,{children:t?(0,n.jsx)(r.A,{active:!0}):e.map(e=>(0,n.jsxs)(N.CardContainer,{children:[(0,n.jsx)(N.CardImageWrapper,{children:B.N.map(t=>t.cardType===e.cardType&&(0,n.jsx)(N.CardImage,{alt:e.cardType,src:t.value},t.cardType))}),(0,n.jsxs)(N.CardDetails,{children:[(0,n.jsx)(f.default,{alt:"card",height:24,src:"/icons/cards/circles.svg",width:24}),(0,n.jsx)(N.CardNumber,{children:e.last4digits}),e.isDefault&&(0,n.jsx)(N.DefaultTag,{children:"Default"})]}),(0,n.jsx)(N.EditButtonWrapper,{children:(0,n.jsx)(z,{cardId:e.id})})]},e.id))})},L={Container:y.Ay.div.withConfig({componentId:"sc-67c1cd59-0"})(["font-family:",";display:flex;flex-direction:column;justify-content:center;align-items:center;height:72vh;text-align:center;"],C.a.cg),Description:y.Ay.p.withConfig({componentId:"sc-67c1cd59-1"})(["font-size:24px;color:#353535;font-weight:500;margin:10px 0 0;"]),Divider:y.Ay.div.withConfig({componentId:"sc-67c1cd59-2"})(["width:100%;max-width:300px;height:1px;background-color:#ddd;margin:20px 0;"]),StyledIcon:(0,y.Ay)(s.g).withConfig({componentId:"sc-67c1cd59-3"})(["color:#ccc;margin-top:20px;margin-bottom:10px;"]),SubHeading:y.Ay.p.withConfig({componentId:"sc-67c1cd59-4"})(["font-size:21px;font-weight:400;color:#353535;margin:24px;"]),Title:y.Ay.h1.withConfig({componentId:"sc-67c1cd59-5"})(["font-weight:500;font-size:18px;margin:0;"])},X=()=>(0,n.jsxs)(L.Container,{children:[(0,n.jsx)(L.StyledIcon,{icon:l.faCreditCard,size:"8x"}),(0,n.jsx)(L.Description,{children:"No payment methods linked to your account"}),(0,n.jsx)(L.Divider,{}),(0,n.jsx)(L.SubHeading,{children:"Please add a payment method in order to complete your purchases."})]});var G=a(34594),J=a.n(G);let R=()=>{let{cardDetails:e,loading:t}=(0,h.f)();return t?(0,n.jsx)(r.A,{active:!0}):(0,n.jsxs)("div",{className:J().container,children:[(0,n.jsxs)("div",{className:J().header,children:[(0,n.jsx)(i.s,{children:"Payment"}),(0,n.jsx)(D,{})]}),e.length?(0,n.jsx)(W,{}):(0,n.jsx)(X,{})]})}},95780:e=>{e.exports={pageTitle:"styles_pageTitle__mBK6f"}},97255:(e,t,a)=>{"use strict";a.d(t,{F8:()=>c,Gi:()=>f,QZ:()=>l,V6:()=>d,WS:()=>s,Yr:()=>p});var n=a(12115),r=a(83075),i=a(41709),o=a(43404);let l=()=>{let{data:e,loading:t,error:a,refetch:n}=(0,i.OKY)(),r=async()=>{try{await n()}catch(e){throw Error("Error refetching cards")}};return{cards:(null==e?void 0:e.getCardDetails.data)||[],error:a,loading:t,refetchCards:r}},s=()=>{let{logAnalyticsEvent:e}=(0,o.s)(),[t,{loading:a,error:n}]=(0,i.DqI)();return{changePaymentDetails:async(a,n)=>{let r=!1,i=null;try{let{data:e}=await t({variables:{billingAddress:n,cardId:a}});return(null==e?void 0:e.changePaymentDetails.success)||(r=!0,i=(null==e?void 0:e.changePaymentDetails.message)||"Failed to change default card details"),e}catch(e){throw r=!0,i=e instanceof Error?e.message:"Failed to change default card details",Error()}finally{e("web_appts_update_card",{error:r,error_msg:i})}},error:n,loading:a}},d=()=>{let{logAnalyticsEvent:e}=(0,o.s)(),[t,{loading:a,error:n}]=(0,i.sWk)();return{deleteCard:async a=>{let n=!1,r=null;try{let{data:e}=await t({variables:{cardId:a}});return(null==e?void 0:e.deleteCard.success)||(n=!0,r=(null==e?void 0:e.deleteCard.message)||"Failed to delete card data"),e}catch(e){throw n=!0,r=e instanceof Error?e.message:"Failed to delete card data",Error("Failed to delete card")}finally{e("web_appts_delete_card",{error:n,error_msg:r})}},mutationError:n,mutationLoading:a}},c=()=>{let{logAnalyticsEvent:e}=(0,o.s)(),[t,{loading:a,error:n}]=(0,i.yHQ)();return{changeDefaultPayment:async a=>{let n=!1,r=null;try{let{data:e}=await t({variables:{cardId:a}});return(null==e?void 0:e.changeDefaultPayment.success)||(n=!0,r=(null==e?void 0:e.changeDefaultPayment.message)||"Failed to change default card payment"),e}catch(e){throw n=!0,r=e instanceof Error?e.message:"Failed to change default card payment",Error("Failed to change default payment")}finally{e("web_appts_default_card",{error:n,error_msg:r})}},mutationError:n,mutationLoading:a}},p=()=>{let{logAnalyticsEvent:e}=(0,o.s)(),[t,{loading:a,error:n}]=(0,i.t3y)({awaitRefetchQueries:!0,refetchQueries:[{query:i.ekE}]});return{error:n,loading:a,sendCardData:async(a,n,r,i)=>{let o=!1,l=null;try{let{data:e}=await t({variables:{billingAddress:i,isDefault:r,paymentKey:n,sessionToken:a}});return(null==e?void 0:e.sendCardData.success)||(o=!0,l=(null==e?void 0:e.sendCardData.message)||"Failed to send card data"),e}catch(e){throw o=!0,l=e instanceof Error?e.message:"Failed to send card data",Error("Failed to send card data")}finally{e("web_appts_add_card",{error:o,error_msg:l})}}}},f=()=>{let[e,t]=(0,n.useState)(""),[a,o]=(0,n.useState)(null),{data:l,loading:s,refetch:d}=(0,i.cNZ)({variables:{styles:"input{border-radius:0px;border-color:#D7D7D7;padding:30px}"}});(0,n.useEffect)(()=>{let e,a;return clearTimeout(e),clearTimeout(a),e=setTimeout(()=>{t(r.W.WARNING)},15e5),a=setTimeout(()=>{let e="Session expired.";t(r.W.EXPIRED),o(e),console.error(e)},174e4),()=>{clearTimeout(e),clearTimeout(a)}},[l,174e4,15e5]),(0,n.useEffect)(()=>{let e;return l&&"Session expired."===a&&(e=setTimeout(()=>{console.clear()},5e3)),()=>{clearTimeout(e)}},[l,a]);let{iframeHtml:c,sessionKey:p}=(null==l?void 0:l.getIframe.data)||{};return{error:a,expiryStatus:e,iframeHtml:c,loading:s,refetch:d,sessionKey:p,setExpiryStatus:t}}}},e=>{var t=t=>e(e.s=t);e.O(0,[5307,7268,2213,1286,1794,3704,1137,7489,4666,189,2725,8815,685,3063,9983,662,485,5293,9922,4987,6922,2778,6031,2343,9584,5518,9604,1709,8441,1684,7358],()=>t(56401)),_N_E=e.O()}]);