1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ecfaf317-9d1a-48ff-9afb-4217141e0fd8",e._sentryDebugIdIdentifier="sentry-dbid-ecfaf317-9d1a-48ff-9afb-4217141e0fd8")}()}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6154],{312:(e,t,l)=>{"use strict";l.r(t),l.d(t,{__N_SSP:()=>eh,default:()=>ev});var a=l(37876),r=l(14232),i=l(10553),n=l(89099),s=l(91703),o=l(88643),u=l(58018),c=l(61422),d=l(92558),p=l(45818),m=l(30077),h=l(32978),v=l(68464),f=l(79890),g=l(15039),x=l.n(g),y=l(51211),b=l(7747),C=l(88566),j=l(59727),N=l.n(j),S=l(44035),k=l(61280);let A=e=>(0,k.A)(null!=e?e:0).replace(/\.00$/,""),P=e=>{var t,l,a,r;return(null==e||null==(t=e.recurring)?void 0:t.interval)===C.UX?{cents:Math.ceil((null!=(a=e.unit_amount)?a:0)/12),interval:C.Lp}:{cents:null!=(r=null==e?void 0:e.unit_amount)?r:0,interval:null==e||null==(l=e.recurring)?void 0:l.interval}},_=e=>{var t,l,i;let{selectedPrice:n,setSelectedPrice:s,show:o=!0,onClose:u,trialCampaignDays:c,eligiblePrices:d,productName:p}=e,m=(0,r.useRef)(null),h=1===d.length,v=h?null==(t=d[0].recurring)?void 0:t.interval:void 0,f=(e,t,l)=>{let{cents:r,interval:i}=P(e);return(0,a.jsxs)("div",{className:"flex items-end gap-x-1",children:[(0,a.jsx)("p",{className:t,children:A(r)}),i&&(0,a.jsx)("p",{className:l,children:"/ ".concat(i)})]})};return(0,a.jsx)(b.zD,{show:o,onClose:u,clickOutsideToClose:!0,title:"Try point.me for free!",titleSize:"2xl",initialFocusRef:m,children:(0,a.jsxs)("div",{className:"space-y-8",children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("h3",{children:"What you get"}),(0,a.jsxs)("div",{className:"text-xs space-y-1.5",children:[(0,a.jsxs)("p",{children:["Try point.meâs Standard membership free"," ",(0,a.jsxs)("strong",{children:["for"," ",365===c?"1 year":"".concat(c," ").concat(N()("days",c)),"!"]})]}),(0,a.jsx)(S.A,{})]})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("h3",{children:"After your free trial"}),(0,a.jsxs)("p",{className:"text-xs",children:["When your free trial ends, youâll be charged for ",h?"the ":"your chosen ",(0,a.jsxs)("span",{className:"font-bold text-primary-600",children:[v?"".concat(v,"ly "):"",p,"."]})]}),h&&(0,a.jsxs)("div",{className:"border border-gray4 rounded-xl p-8 flex flex-col gap-y-4","data-testid":"plan-single",children:[(0,a.jsx)("h4",{className:"text-lg",children:p}),f(d[0],"heading-5xl relative top-0.5","text-2xl"),(null==(l=d[0].recurring)?void 0:l.interval)===C.UX&&(null==(i=d[0])?void 0:i.unit_amount)&&(0,a.jsxs)("p",{className:"text-gray2",children:["(billed as ",A(d[0].unit_amount)," annually)"]})]}),d.length>1&&(0,a.jsx)("div",{className:"grid sm:grid-cols-2 gap-5",children:null==d?void 0:d.map((e,t)=>{var l,r,i;return(0,a.jsxs)("button",{type:"button",onClick:()=>s(e),"data-testid":"plan-".concat(t),className:x()({"relative border rounded-lg px-6 pt-9 pb-7 flex flex-col items-center sm:items-start":!0,"border-gray4":n.id!==e.id,"border-primary-500":n.id===e.id}),children:[(0,a.jsx)(y.A,{className:x()({"absolute top-2.5 right-2.5 w-6 h-6":!0,"text-gray4":n.id!==e.id,"text-primary-500":n.id===e.id})}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(null==(l=e.recurring)?void 0:l.interval)===C.UX&&(0,a.jsx)("p",{className:"absolute top-3 mt-0 py-0.5 px-1.5 bg-primary-600 text-white text-2xs font-bold antialiased rounded-sm",children:"Save 10%"}),(0,a.jsxs)("p",{className:"font-display capitalize",children:[null==(r=e.recurring)?void 0:r.interval,"ly"]}),f(e,"font-display text-lg font-bold","text-gray2"),(null==(i=e.recurring)?void 0:i.interval)===C.UX&&e.unit_amount&&(0,a.jsxs)("p",{className:"text-gray2",children:["(billed as ",A(e.unit_amount)," annually)"]})]})]},e.id)})})]}),(0,a.jsx)(b.$n,{onClick:u,className:"mt-4",fullWidth:!0,ref:m,children:"Start your ".concat(365===c?"1 year":"".concat(c,"-day")," free trial!")})]})})};var w=l(10341),T=l(21891),E=l(25927),I=l(35957);let U=e=>{let{attribution:t,quote:l,imageSrc:r,imageAlt:i}=e;return(0,a.jsxs)("article",{className:"flex gap-3",children:[!!r&&(0,a.jsx)("img",{src:r,alt:null!=i?i:t,className:"mt-0.5 rounded-full w-12 h-12"}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("q",{className:"italic",children:l}),(0,a.jsxs)("span",{children:["- ",t]})]})]})};U.displayName="SocialProof";var D=l(36843);let R=e=>{var t;let{product:l,className:r,unitPrice:i,annualEnabled:n,isDetailUpdating:s,handleToggleChange:o,showDiscount:u,annualSavingsPercent:c,showSavingsCopy:d}=e;return(0,a.jsxs)("div",{"data-testid":"recurring-plan-toggle",className:x()("flex items-center space-x-4",r),children:[(0,a.jsx)(b.lM,{enabled:n,setEnabled:o,isDetailUpdating:s}),(0,a.jsx)("div",{className:"text-gray2",children:d&&void 0!==c?(0,a.jsx)(a.Fragment,{children:n?"You're saving ".concat(c,"% compared to monthly billing"):"Save ".concat(c,"% when you switch to annual billing")}):(0,a.jsxs)(a.Fragment,{children:[n?"Billed annually at $".concat(i):"Monthly billing",n&&u&&(0,a.jsxs)(a.Fragment,{children:[" ",(0,a.jsx)("span",{className:"text-gray2",children:"(".concat(null==l||null==(t=l.metadata)?void 0:t.annualDiscount,")")})]})]})})]})};var O=l(97442),M=l(88471),L=l(36037),F=l(90755),W=l(28004);let V=/self-serve/;var q=l(90189),X=l(6440),H=l(76865);let B=e=>{let{offer:t,onClaim:l,isClaiming:r,className:i}=e,{trackEvent:n}=(0,L.A)();if(!t)return null;let{entry:s,kind:o,arm:u}=t;if("coupon"===o&&!l)return null;
1let c=()=>{n(H.A.checkoutUpsellClicked,{[H.q.offerKind]:o,[H.q.upsellArm]:u})},d="coupon"===o?()=>{c(),null==l||l(u)}:"featureSpotlight"===o?c:void 0;return(0,a.jsx)(q.Ay,{className:i,layout:"stacked",backgroundColor:s.backgroundColor,iconSlug:s.iconSlug,icon:s.icon,...(0,X.A)(s,o),buttonText:s.buttonText,buttonHref:"featureSpotlight"===o?s.redirectUrl:void 0,buttonOpensNewTab:"featureSpotlight"===o,buttonDisabled:r,onButtonClick:d})};B.displayName="CheckoutUpsell";var K=l(29852),G=l(56557);let Y=e=>{var t,l,i,n,s,c,d,p,m,f,g,y,b;let{selectedProduct:j,selectedPrice:S,stripePromoCode:_,setStripePromoCode:w,changeSelectedPrice:q,hidePlanEditOptions:X=!1,hideToggleField:Y=!1,hideCouponField:J=!1,couponValue:Z,setCouponValue:z,errorMessage:$,hasCouponApplied:Q,setHasCouponApplied:ee,onDetailChange:et,onCouponUpdate:el,isDetailUpdating:ea,setIsDetailUpdating:er,invoiceDetails:ei,referCoupon:en,hasFreeTrial:es=!1,trialCampaignDays:eo,isUserReady:eu=!0,isTrialSettled:ec}=e,{t:ed}=(0,u.A)(o.A),{socialProof:ep}=(()=>{let e=(0,r.useRef)(!1),[t,l]=(0,r.useState)([]);return(0,r.useEffect)(()=>{e.current||t.length>0||(e.current=!0,(async()=>{try{var e;let{data:t}=await v.W.get("/api/contentful/checkout-social-proof"),[a]=t;l(null!=(e=a.quotesCollection.items)?e:[])}catch(e){console.error("useCheckoutSocialProof failed to request quotes",e)}})())},[t]),{socialProof:t}})(),{trackEvent:em}=(0,L.A)(),{experimentAnnualToggleCopy:eh}=(0,K.Ay)(),{offer:ev}=(e=>{let{priceId:t,productName:l,priceFlags:a,isPromoApplied:i,hasFreeTrial:n,isTrialSettled:s}=e,[o,u]=(0,r.useState)(new Map),{getAnonymousId:c}=(0,L.A)(),{isDefaultCobrand:d}=(0,F.v)(),{isUnauthenticated:p,isSessionLoading:m,latestActivePlan:f}=(0,W.A)(),[g]=(0,h.useCookies)(["trialCampaign"]),x=!!g.trialCampaign&&!s,y=d&&l===C.KB&&!!(null==a?void 0:a.match(V))&&!i&&!n&&!(null==f?void 0:f.cancelledAt),b=!!t&&y&&!x&&!m;return(0,r.useEffect)(()=>{if(!t||!b||o.has(t))return;let e=new AbortController;return(async()=>{let l=p?await c():void 0;if(!e.signal.aborted)try{let{data:a}=await v.W.post("/api/checkout/upsell-offer",{priceId:t,...l&&{anonymousId:l}},{signal:e.signal});if(e.signal.aborted)return;u(e=>new Map(e).set(t,a.offer))}catch(t){if(e.signal.aborted)return;console.error("useCheckoutUpsellOffer failed to resolve the checkout upsell offer",t)}})(),()=>e.abort()},[t,b,p,c,o]),{offer:t&&o.get(t)||null}})({priceId:null==S?void 0:S.id,productName:null==j||null==(t=j.product)?void 0:t.name,priceFlags:null==S||null==(l=S.metadata)?void 0:l.flags,isPromoApplied:Q||!!_,hasFreeTrial:es,isTrialSettled:ec}),{claim:ef,isClaiming:eg}=(e=>{let{priceId:t,onClaimed:l}=e,[a,i]=(0,r.useState)(!1),{getAnonymousId:n}=(0,L.A)(),{isUnauthenticated:s}=(0,W.A)();return{claim:async()=>{if(t&&!a){i(!0);try{let e=s?await n():void 0,{data:a}=await v.W.post("/api/checkout/upsell-mint",{priceId:t,...e&&{anonymousId:e}});l(a)}catch(e){console.error("useCheckoutUpsellClaim failed to claim the checkout upsell",e)}finally{i(!1)}}},isClaiming:a}})({priceId:null==S?void 0:S.id,onClaimed:e=>{let{code:t,target:l}=e,a=S&&{price:S,product:j};q(l.price,l.product),eI(l.price.id,t,l.product.product.id,a)}}),[ex,ey]=(0,r.useState)((null==S||null==(i=S.recurring)?void 0:i.interval)===C.UX),[eb,eC]=(0,r.useState)(!1),[ej,eN]=(0,r.useState)(""),[eS,ek]=(0,r.useState)(""),[eA,eP]=(0,r.useState)({}),e_=null==(s=(0,r.useRef)(S).current)||null==(n=s.metadata)?void 0:n.priceTestGroup,ew=e_?j.prices.data.find(e=>{var t,l;return(null==(t=e.recurring)?void 0:t.interval)===C.Lp&&(null==(l=e.metadata)?void 0:l.priceTestGroup)===e_}):j.prices.data.find(e=>{var t,l,a;return(null==(t=e.recurring)?void 0:t.interval)===C.Lp&&(null==(a=e.metadata)||null==(l=a.flags)?void 0:l.match(/default/))}),eT=e_?j.prices.data.find(e=>{var t,l;return(null==(t=e.recurring)?void 0:t.interval)===C.UX&&(null==(l=e.metadata)?void 0:l.priceTestGroup)===e_}):j.prices.data.find(e=>{var t,l,a;return(null==(t=e.recurring)?void 0:t.interval)===C.UX&&(null==(a=e.metadata)||null==(l=a.flags)?void 0:l.match(/default/))}),eE=(0,G.Ay)((null==eT?void 0:eT.unit_amount)!=null?eT.unit_amount/100:void 0,(null==ew?void 0:e
1w.unit_amount)!=null?ew.unit_amount/100:void 0);if((0,r.useEffect)(()=>{en&&eC(!0)},[en]),(0,r.useEffect)(()=>{var e;ey((null==S||null==(e=S.recurring)?void 0:e.interval)===C.UX)},[S]),!j)return null;let eI=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ej,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:j.product.id,a=arguments.length>3?arguments[3]:void 0;er(!0),eP({}),(0,D.A)({couponValue:t,productId:l,priceId:e}).then(l=>{let{couponId:r,promoCode:i,notice:n,messageType:s}=l;if(er(!1),"success"===s&&r&&i)z(r),w(i),ee(!0),ek(t),el(r,i,e);else{var o;z(""),w(void 0),ee(!1),ek(""),a&&q(a.price,a.product),el(null,null,null!=(o=null==a?void 0:a.price.id)?o:e)}eP({notice:"internal_error"===s?$:n,type:s})})},eU=I.tx[j.product.name]===C.iW,eD=async()=>{var e;q(ex?ew:eT);let t=ex?ew:eT;if(!(null==t?void 0:t.id))return eP("We had trouble toggling that option. Please try again.");(e=>{var t;let l=null==S||null==(t=S.recurring)?void 0:t.interval;if(!eU||!l||!e)return;let a=j.product.name;em(H.A.checkoutBillingIntervalToggled,{[H.q.fromPlan]:(0,I.YI)(a,l),[H.q.toPlan]:(0,I.YI)(a,e)})})(null==(e=t.recurring)?void 0:e.interval),ej&&eu?eI(null==t?void 0:t.id):et(null==t?void 0:t.id)},eR=(null==S||null==(c=S.recurring)?void 0:c.interval)===C.UX||(null==S||null==(d=S.recurring)?void 0:d.interval)===C.Lp,eO=!!eh&&void 0!==eE,{cents:eM,interval:eL}=eO?{cents:null!=(b=null==S?void 0:S.unit_amount)?b:0,interval:null==S||null==(p=S.recurring)?void 0:p.interval}:P(S),eF=(null==S?void 0:S.type)?"recurring"===S.type?eL:"one_time"===S.type&&j.product.name===C.ov?ed("starter_pass_period_label"):void 0:"",eW=e=>(0,a.jsxs)(a.Fragment,{children:[A(eM),eF&&(0,a.jsx)("p",{className:x()("pl-0.5 inline font-display text-base",e),children:"/ ".concat(eF)})]}),eV=ei?ei.total-ei.tax:void 0,eq="Premium Plan"===j.product.name&&(null==S||null==(m=S.recurring)?void 0:m.interval)===C.UX;return(0,a.jsxs)("article",{className:"rounded-2xl bg-white shadow flex flex-col mb-4",children:[(0,a.jsx)("h2",{className:"bg-primary-600 text-white text-base font-display font-bold antialiased pt-5 pb-4 px-6 rounded-t-2xl",children:"Your subscription"}),(0,a.jsxs)("div",{className:"p-6 flex flex-col gap-4 divide-y divide-gray4",children:[(0,a.jsxs)("section",{children:[(0,a.jsx)("h3",{className:"font-display font-bold text-lg pb-2",children:j.product.name}),(0,a.jsxs)("div",{className:x()({"text-4xl/tight font-display font-semibold":!es,"heading-4xl":es}),children:[!es&&S?eW("text-gray2"):null,es&&(0,a.jsxs)(a.Fragment,{children:["Free trial",(0,a.jsxs)("p",{className:"pl-0.5 inline font-display text-base",children:["(",365===eo?"1 year":"".concat(eo," ").concat(N()("days",eo)),")"]})]})]}),!X&&(0,a.jsxs)(a.Fragment,{children:[es&&eo&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{children:["Once your free trial ends you will be charged on"," ",(0,a.jsx)("strong",{children:(0,E.rC)(eo)}),":"]}),(0,a.jsx)("div",{className:"heading-4xl pt-2 pb-1",children:eW()}),!eO&&(null==S||null==(f=S.recurring)?void 0:f.interval)===C.UX&&(null==S?void 0:S.unit_amount)&&(0,a.jsxs)("div",{className:"text-gray2",children:["(billed as ",A(S.unit_amount)," annually)"]})]}),eq&&S.unit_amount&&(0,a.jsx)("div",{children:(0,a.jsxs)("p",{className:"text-gray2",children:["Billed annually at ",A(S.unit_amount)]})}),eT&&ew&&eR&&!Y&&(0,a.jsx)(R,{className:"mt-2",annualEnabled:ex,product:j.product,isDetailUpdating:ea,handleToggleChange:eD,unitPrice:(null==S?void 0:S.unit_amount)?S.unit_amount/100:null,showDiscount:void 0===e_,annualSavingsPercent:eE,showSavingsCopy:eh}),(0,a.jsx)("p",{className:"mt-1 text-xs text-gray3",children:"Plus estimated sales tax"})]}),!X&&!J&&(0,a.jsxs)("div",{className:"pt-4",children:[(0,a.jsx)("h3",{className:"sr-only",children:"Coupon information"}),!eb&&!_&&(0,a.jsx)("button",{type:"button","data-testid":"showCouponButton",onClick:()=>eC(!0),disabled:!eu,className:"text-sm text-primary-600 font-semibold disabled:opacity-50",children:"Add promo code"}),eb&&(0,a.jsx)(T.A,{priceId:null==S?void 0:S.id,couponValue:Z,appliedCode:eS,hasCouponApplied:Q,isDetailUpdating:ea,referCoupon:en,couponTmpValue:ej,setCouponTmpValue:eN,message:eA,doCouponValidation:eI,isUserReady:eu})]}),!X&&(0,a.jsx)(B,{className:"mt-4",offer:ev,onClaim:ef,isClaiming:eg})]}),_&&(0,a.jsxs)("section",{className:"pt-4 grid grid-cols-3 gap-4",children:[(0,a.jsx)("h3",{className:"sr-only",children:"Line by line"}),(0,a.jsx)("div",{className:"col-span-2",children:"Subtotal"}),(0,a.jsx)("div",{className:"text-right",children:ei?(0,k.A)(ei.subtotal):(0,k.A)(null==S?void 0:S.unit_amount)}),(0,a.jsxs)("div",{className:"text-primary-600 col-span-2",children:["Promo applied:",(0,a.jsx)("br",{}),_.code,(null==(g=(0,M.fe)(_))?void 0:g.percent_off)&&(0,a.jsxs)(a.Fragment,{children:["\xa0 (",null==(y=(0,M.fe)(_))?void 0:y.percent_off,"% off)"]})]}),(0,a.jsxs)("div",{className:"text-primary-600 text-right",children:["â",(0,k.A)(ei&&void 0!==eV?ei.subtotal-eV:S&&_?(0,O._M)((0,M.fe)(_),S):"")]}),(0,a.jsx)("div",{className:"font-display font-bold col-span-2",children:"Total:"}),(0,a.jsx)("div",{className:"font-display font-bold text-right",children:(()=>
1{if(void 0!==eV)return(0,k.A)(eV);if(!S||!_)return"";let e=(0,O.N9)((0,M.fe)(_),S);return(0,k.A)(e)})()})]}),ep.length>0&&(0,a.jsxs)("section",{className:"pt-4 flex flex-col gap-5",children:[(0,a.jsx)("h3",{className:"font-display font-bold text-base",children:"Hear from real point.me members"}),ep.map(e=>(0,a.jsx)(U,{attribution:e.attribution,quote:e.quote,imageSrc:e.headshot.url,imageAlt:e.headshot.description},e.sys.id))]})]})]})};var J=l(39742),Z=l(19834),z=l(37785);let $=e=>{var t,l,i;let{stripeOptions:n,stripePromise:o,errorMessage:u,successPath:c,stripeReference:d,setStripeReference:p,isDetailUpdating:m,csList:h,isPaymentSubmitting:v,setIsPaymentSubmitting:f,selectedProduct:g,selectedPrice:x,couponValue:y,promoCode:b,trialCampaign:C,customerHasAddress:j,customerAddress:N,callUpdateCustomerAddress:S,createPaymentIntentExplicitly:k,callStartCheckout:A,isUngated:P}=e,_=(0,s.kH)(e=>e.user),[w,T]=(0,r.useState)({firstName:(null==_||null==(t=_.me)?void 0:t.first_name)||"",lastName:(null==_||null==(l=_.me)?void 0:l.last_name)||"",...!(null==_||null==(i=_.me)?void 0:i.has_basic_plan)&&z.w6}),[E,I]=(0,r.useState)(),U=h.length>0?h[h.length-1]:void 0,D=U?n:{mode:"setup",currency:"usd",appearance:n.appearance};return(0,a.jsx)(J.S8,{stripe:o,options:D,children:(0,a.jsx)(Z.A,{errorMessage:u,successPath:c,stripeReference:d,setStripeReference:p,isDetailUpdating:m,isPaymentSubmitting:v,setIsPaymentSubmitting:f,initialValues:w,setInitialValues:T,selectedProduct:g,selectedPrice:x,couponValue:y,promoCode:b,trialCampaign:C,customerHasAddress:j,customerAddress:N,callUpdate
1CustomerAddress:S,createPaymentIntentExplicitly:k,callStartCheckout:A,isUngated:P,hasClientSecret:!!U,checkoutEmail:E,setCheckoutEmail:I})},U||"setup")};var Q=l(24833);let ee=(0,l(4241).c)("pk_live_51JjqW5HU1yruTVu8Vw71ipfuKfTRKLTG0Uu5wGUYgc3Er4Lfhcuqgz3PRi0gopNuM5wZthzyPttqqJdoyjuGt06a00LdXM2ShI"),{t:et}=(0,u.A)(o.A),el=et("stripe_subscription_creation_error"),ea=e=>{let{selectedProduct:t,selectedPrice:l,stripePromoCode:r,setStripePromoCode:i,changeSelectedPrice:n,couponValue:s,setCouponValue:o,hasCouponApplied:u,setHasCouponApplied:c,authError:d,subscriptionBlock:p,stripeOptions:m,successPath:h,stripeReference:v,setStripeReference:f,onDetailChange:g,isDetailUpdating:x,setIsDetailUpdating:y,csList:b,invoiceDetails:C,onCouponUpdate:j,setIsSubmitting:N,isSubmitting:S,referCoupon:k,trialCampaign:A,stripeCustomerId:P,customerHasAddress:_,customerAddress:T,callUpdateCustomerAddress:E,createPaymentIntentExplicitly:I,callStartCheckout:U,isUngated:D,isUserReady:R,isTrialSettled:O}=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"col-span-5 md:col-span-4",children:[(0,a.jsx)("a",{href:"/our-services",children:(0,a.jsxs)("button",{type:"button",className:"text-xs text-gray2 flex items-center space-x-0.5 mb-4 group",children:[(0,a.jsx)(w.A,{className:"w-4 h-4 mb-0.5"}),(0,a.jsx)("span",{className:"group-hover:underline",children:"Back to plans"})]})}),t&&l&&(0,a.jsx)(Y,{selectedProduct:t,selectedPrice:l,stripePromoCode:r,setStripePromoCode:i,changeSelectedPrice:n,hidePlanEditOptions:S,hideToggleField:!!(null==A?void 0:A.limitToSubscriptionPlan),hideCouponField:!!A,couponValue:s,setCouponValue:o,errorMessage:el,hasCouponApplied:u,setHasCouponApplied:c,onDetailChange:g,onCouponUpdate:j,isDetailUpdating:x,setIsDetailUpdating:y,invoiceDetails:C,referCoupon:k,hasFreeTrial:!!A,trialCampaignDays:null==A?void 0:A.trialDays,isUserReady:R,isTrialSettled:O}),!t&&(0,a.jsxs)("div",{className:"text-error-saturated",children:["No plan selected. Go back to our ",(0,a.jsx)("a",{href:"/our-services",children:"Services & pricing"})," to select your plan."]})]}),(0,a.jsxs)("div",{className:"col-span-7 col-start-6 md:col-span-8 md:col-start-5",children:[!p&&(!t||!P&&!D||_&&!v&&!(A&&m.clientSecret))&&(0,a.jsxs)("div",{className:"bg-white py-8 px-4 sm:px-10 shadow rounded-lg",children:[(0,a.jsx)("div",{className:"uppercase font-display text-gray2 text-xs",children:"\xa0"}),(0,a.jsx)("h1",{children:"Loading..."})]}),t&&l&&(P||D)&&(v||!_||!!A&&!!m.clientSecret)&&(0,a.jsx)($,{stripeOptions:m,stripePromise:ee,errorMessage:el,successPath:h,stripeReference:v,setStripeReference:f,isDetailUpdating:x,csList:b,isPaymentSubmitting:S,setIsPaymentSubmitting:N,selectedProduct:t,selectedPrice:l,couponValue:s,promoCode:r,trialCampaign:A,customerHasAddress:_,customerAddress:T,callUpdateCustomerAddress:E,createPaymentIntentExplicitly:I,callStartCheckout:U,isUngated:D}),p?(0,a.jsx)(Q.A,{block:p}):d&&(0,a.jsx)("div",{className:"mt-4 text-xs text-error-saturated",children:d})]})]})};var er=l(57249),ei=l(31284),en=l(7873),es=l(49952),eo=l(79780),eu=l(78442),ec=l(8345),ed=l(56173);let{t:ep}=(0,u.A)(o.A),em=ep("stripe_subscription_creation_error");var eh=!0;let ev=(0,d.Z)((0,en.A)(e=>{var t,l,o,u,d,g;let{selectedProduct:x,initSelectedPrice:y}=e,b=(0,n.useRouter)(),{callbackUrl:j}=b.query,N="/onboarding/get-started?sessionId=success".concat(j?"&callbackUrl=".concat(encodeURIComponent(j)):""),S=(0,s.kH)(e=>e.user),k=(0,s.j_)(e=>e.checkoutOnEmailStep),[A,P]=(0,r.useState)(x),[w,T]=(0,r.useState)(y),[E,I]=(0,r.useState)(!1),[U,D]=(0,r.useState)(""),[R,O]=(0,r.useState)(),[M,F]=(0,r.useState)(),[V,q]=(0,r.useState)(),[X,H]=(0,r.useState)(),[B,G]=(0,r.useState)(),[Y,J]=(0,r.useState)(!1),[Z,z]=(0,r.useState)(!1),{handleSendDataToDataLayer:$}=(0,f.A)(),{status:Q}=(0,i.useSession)(),{releaseUngatedCheckout:ee}=(0,K.Ay)(),{isUnauthenticated:et}=(0,W.A)(),el=!!ee&&et;(0,c.A)(S);let[en]=(0,h.useCookies)(["mbsy","coupon","trialCampaign","utmContent"]),{stripeOptions:es,stripeReference:ep,stripeCustomerId:eh,customerHasAddress:ev,customerAddress:ef,isDetailUpdating:eg,csList:ex,isPaymentSubmitting:ey,authError:eb,subscriptionBlock:eC,invoiceDetails:ej,setStripeReference:eN,setIsDetailUpdating:eS,setIsPaymentSubmitting:ek,callCreateCustomer:eA,callUpdate
1CustomerAddress:eP,createPaymentIntentExplicitly:e_,callStartCheckout:ew,handleToggleUpdate:eT,handleCouponUpdate:eE,callCreateSetupIntent:eI}=(e=>{let{selectedProduct:t,selectedPrice:l,couponValue:a,stripePromoCode:i,trialCampaign:n,mbsyCookie:o,errorMessage:u,isUngated:c}=e,d=(0,s.kH)(e=>e.user),{handleSendDataToDataLayer:p}=(0,f.A)(),m=(()=>{let e=(0,r.useRef)(void 0);return(0,r.useCallback)(t=>{var l;return(null==(l=e.current)?void 0:l.signature)!==t&&(e.current={signature:t,token:"".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,12))}),e.current.token},[])})(),[h]=(0,ec.A)(["ah_visitor_id","trialCampaign"]),{getAnonymousId:g}=(0,L.A)(),[x,y]=(0,r.useState)(""),[b,C]=(0,r.useState)(),[j,N]=(0,r.useState)(null),[S,k]=(0,r.useState)(!1),[A,P]=(0,r.useState)(null),[_,w]=(0,r.useState)(!1),[T,E]=(0,r.useState)([]),[I,U]=(0,r.useState)(!1),[D,R]=(0,r.useState)(),[O,M]=(0,r.useState)(),[F,W]=(0,r.useState)(),V=(0,r.useRef)(0),q=(0,r.useRef)(0),X=(0,r.useCallback)(()=>{q.current+=1,w(!0)},[]),H=(0,r.useCallback)(()=>{q.current=Math.max(0,q.current-1),0===q.current&&w(!1)},[]),B=(0,r.useRef)(void 0),K=(0,r.useCallback)(async e=>{var l,a;let{priceId:r,couponIdParam:i,promoCodeParam:n,abortController:s,customerId:c,skipLoadingState:g=!1}=e,x=c||j;if(!x)return(0,ei.A)("No customer ID available for payment intent creation",{userEmail:null==d?void 0:d.email,selectedProduct:null==t||null==(l=t.product)?void 0:l.name}),"error";g||X();let b=++V.current;M(void 0);try{let{data:e}=await v.W.post("/api/stripe/create-payment-intent",{customerId:x,selectedPriceId:r,coupon:i,promoCode:n,mbsy:o,attemptToken:m("".concat(r,":").concat(null!=i?i:"",":").concat(null!=(a=null==n?void 0:n.id)?a:"")),ahVisitorId:h.ah_visitor_id},{...s&&{signal:s.signal}});if(b!==V.current)return"ok";let{result:l,notice:c,clientSecret:g,stripeReference:j,invoiceDetails:N}=e;if("OK"===l){if(!g)return(0,ei.A)("Missing client secret from payment intent creation",{userEmail:null==d?void 0:d.email,customerId:x,priceId:r}),R(u),"error";return y(g),C(j),W(N),p({eventType:f.Z.COMPLETE_PAYMENT,selectedProduct:t,priceId:r,couponIdParam:i,promoCodeParam:n,hasTrialCampaign:!1}),E(e=>[...e,g]),"ok"}return"ERROR"===l&&R(c),"error"}catch(a){if(null==s?void 0:s.signal.aborted)return"error";if(b!==V.current)return"ok";let e=(0,ed.R)(a);if(e)return M(e),"blocked";let t=v.j.from(a),l=null==t?void 0:t.data;return R((null==t?void 0:t.status)===401?"Authentication Error. Login again!":(null==l?void 0:l.notice)||u),(0,ei.A)("Error hitting stripe/create-customer-payment-intent",{error:l,userEmail:null==d?void 0:d.email,user:JSON.stringify(d)}),"error"}finally{g||H()}},[o,p,t,j,d,u,m,h,X,H]);(0,r.useEffect)(()=>{B.current=K},[K]);let G=(0,r.useCallback)(async e=>{w(!0),await v.W.post("/api/stripe/create-customer",{},{...e&&{signal:e.signal}}).then(async e=>{let{data:t}=e,{result:r,customerId:s,hasAddress:o,address:c,notice:p}=t;if("OK"===r){if(!s)return(0,ei.A)("Failed to create or update customer - no customer ID returned",{userEmail:null==d?void 0:d.email}),w(!1),R(u);if(N(s),k(!!o),c&&P(c),o&&(null==l?void 0:l.id)&&!n&&!h.trialCampaign){var m;let e=await (null==(m=B.current)?void 0:m.call(B,{priceId:l.id,couponIdParam:a,promoCodeParam:i,customerId:s}));"ok"!==e&&"blocked"!==e&&(k(!1),R("We had trouble processing your information. Please verify your address and try again."))}else w(!1)}if("ERROR"===r)return w(!1),R(p)}).catch(()=>{null!=e&&e.signal.aborted||(console.error("Failed to create or update customer"),w(!1),R(u))})},[null==l?void 0:l.id,n,h.trialCampaign,a,i,u,null==d?void 0:d.email]),Y=(0,r.useCallback)(async e=>{if(!j)return!1;try{let{data:t}=await v.W.post("/api/stripe/update-customer-address",{customerId:j,...e}),{result:l,notice:a}=t;if("OK"===l)return k(!0),P(e),!0;return R(a),!1}catch(e){return R(u),!1}},[j,u]),J=(0,r.useCallback)(async()=>{(null==l?void 0:l.id)&&j&&!n&&!h.trialCampaign&&await K({priceId:l.id,couponIdParam:a,promoCodeParam:i,skipLoadingState:!0})},[null==l?void 0:l.id,j,K,a,i,n,h.trialCampaign]),Z=(0,r.useCallback)(async e=>{var t,r;let{email:n,address:s}=e;if(!(null==l?void 0:l.id))return!1;X();let c=++V.current,d=null!=(t=await g())?t:void 0;try{let{data:e}=await v.W.post("/api/checkout/start-checkout",{email:n,address:s,priceId:l.id,coupon:a,promoCode:i,mbsy:o,attemptToken:m("".concat(l.id,":").concat(null!=a?a:"",":").concat(null!=(r=null==i?void 0:i.id)?r:"")),ahVisitorId:h.ah_visitor_id,anonymousId:d});if(c!==V.current)return!1;
1let{result:t,clientSecret:p,stripeReference:f,invoiceDetails:g,notice:x}=e;if("OK"===t&&p)return y(p),C(f),W(g),P(s),k(!0),E(e=>[...e,p]),!0;return R(x||u),!1}catch(e){return c===V.current&&R(u),!1}finally{H()}},[null==l?void 0:l.id,a,i,o,m,h,u,X,H,g]),z=(0,r.useCallback)(async e=>{var t,l;let{priceId:a,couponIdParam:r,promoCodeParam:i}=e;if(!b)return!1;X();let n=++V.current,s=null!=(t=await g())?t:void 0;try{let{data:e}=await v.W.post("/api/checkout/update-checkout",{stripeReference:b,selectedPriceId:a,coupon:r,promoCode:i,mbsy:o,attemptToken:m("".concat(a,":").concat(null!=r?r:"",":").concat(null!=(l=null==i?void 0:i.id)?l:"")),ahVisitorId:h.ah_visitor_id,anonymousId:s});if(n!==V.current)return!1;let{result:t,notice:c,clientSecret:d,stripeReference:p,invoiceDetails:f}=e;if("OK"===t&&d&&p)return y(d),C(p),W(f),E(e=>[...e,d]),!0;return R(c||u),!1}catch(l){if(n!==V.current)return!1;let e=v.j.from(l),t=null==e?void 0:e.data;return R((null==t?void 0:t.notice)||u),(0,ei.A)("Error hitting checkout/update-checkout",{error:t,userEmail:null==d?void 0:d.email}),!1}finally{H()}},[b,o,m,h,u,null==d?void 0:d.email,X,H,g]),$=(0,r.useCallback)(async e=>{if(n){p({eventType:f.Z.COMPLETE_PAYMENT,selectedProduct:t,priceId:e,trialCampaignCode:n.trialCode,trialCampaignId:n.id,hasTrialCampaign:!0}),w(!1);return}S&&await K({priceId:e,couponIdParam:a,promoCodeParam:i})},[n,S,K,a,i,p,t]),Q=(0,r.useCallback)(async(e,l,a)=>{if(n){p({eventType:f.Z.COMPLETE_PAYMENT,selectedProduct:t,priceId:a,trialCampaignCode:n.trialCode,trialCampaignId:n.id,hasTrialCampaign:!0}),w(!1);return}return c&&b?z({priceId:a,couponIdParam:e,promoCodeParam:l}):S?K({priceId:a,couponIdParam:e,promoCodeParam:l}):void 0},[n,S,K,p,t,c,b,z]),ee=(0,r.useCallback)(async()=>{w(!0);try{let{data:e}=await v.W.post("/api/stripe/setup-intent",{}),{clientSecret:t}=e;y(t),E([t]),w(!1)}catch(e){R(u),(0,ei.A)("Error hitting stripe/setup-intent",{error:e,userEmail:null==d?void 0:d.email,user:JSON.stringify(d)})}},[u,d]),et=(0,r.useMemo)(()=>({clientSecret:x,appearance:{theme:"stripe",variables:{colorPrimary:eu.A}},loader:"always",fields:{billingDetails:{name:"never",email:"never",phone:"never",address:{country:"never",line1:"never",line2:"never",city:"never",state:"never",postalCode:"auto"}}}}),[x]);return{clientSecret:x,stripeReference:b,stripeCustomerId:j,customerHasAddress:S,customerAddress:A,isDetailUpdating:_,csList:T,isPaymentSubmitting:I,authError:D,subscriptionBlock:O,stripeOptions:et,invoiceDetails:F,setStripeReference:C,setIsDetailUpdating:w,setIsPaymentSubmitting:U,callCreateCustomer:G,callUpdateCustomerAddress:Y,createPaymentIntentExplicitly:J,callStartCheckout:Z,callUpdateCheckout:z,handleToggleUpdate:$,handleCouponUpdate:Q,callCreateSetupIntent:ee}})({selectedProduct:A,selectedPrice:w,couponValue:U,stripePromoCode:R,trialCampaign:V,mbsyCookie:en.mbsy,errorMessage:em,isUngated:el});(0,r.useEffect)(()=>{(null==en?void 0:en.mbsy)&&v.W.post("/api/users/validate-ambassador-code",{ambassadorCode:null==en?void 0:en.mbsy}).then(e=>{let{data:t}=e;"OK"===t.status&&F(t.notice)}),(null==en?void 0:en.coupon)&&F(en.coupon)},[en]);let eU=(e,t)=>{var l,a;if(T(e),t)return void P(t);if((null==A||null==(l=A.product)?void 0:l.id)!==(null==x||null==(a=x.product)?void 0:a.id))return;let r={pathname:"/onboarding/checkout",query:{...b.query,selectedPrice:e.id}};b.replace(r,r,{scroll:!1,shallow:!0})},eD=(e,t)=>{eU(e),((e,t)=>{$({eventType:f.Z.COMPLETE_PAYMENT,selectedProduct:A,priceId:e,trialCampaignCode:t.trialCode,trialCampaignId:t.id,hasTrialCampaign:!0})})(e.id,t)};return((0,r.useEffect)(()=>{var e;en.trialCampaign&&!(V||B)&&(null==S||null==(e=S.me)?void 0:e.uuid)&&v.W.post("/api/trial-campaigns/validate",{trialCode:en.trialCampaign,utmContent:en.utmContent}).then(e=>{var t,l,a,r,i,n,s,o;let{data:u}=e,{result:c,trialCampaign:d,errorType:p}=u;if("OK"===c){let e=d.limitToSubscriptionPlan?null==A||null==(l=A.prices)||null==(t=l.data)?void 0:t.find(e=>e.id===d.limitToSubscriptionPlan.externalId):null==A||null==(r=A.prices)||null==(a=r.data)?void 0:a.find(e=>{var t,l,a;return(null==(t=e.recurring)?void 0:t.interval)===C.Lp&&(null==(a=e.metadata)||null==(l=a.flags)?void 0:l.match(/default/))});if(!e)return void G("wrong_plan");let s=d.limitToSubscriptionPlan?[e]:(null!=(n=null==A||null==(i=A.prices)?void 0:i.data)?n:[]).filter(e=>{var t,l;return null==(l=e.metadata)||null==(t=l.flags)?void 0:t.match(/default/)}).sort((e,t)=>
1e.unit_amount-t.unit_amount);eD(e,d),q(d),H(s),(null==d?void 0:d.partnerSource)&&(null==d?void 0:d.partnerSource)==="clear-free"||J(!0),eI()}else{if(G(p),document.cookie="trialCampaign=; Path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT;",document.cookie="utmContent=; Path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT;",!w){let e=null==A||null==(o=A.prices)||null==(s=o.data)?void 0:s.find(e=>{var t,l,a;return(null==(t=e.recurring)?void 0:t.interval)===C.Lp&&(null==(a=e.metadata)||null==(l=a.flags)?void 0:l.match(/default/))});e&&eU(e)}z(!0)}}).catch(e=>{(0,ei.A)(e,{message:"failed to validate trial ".concat(en.trialCampaign)}),G("system_error")})},[en.trialCampaign,null==S||null==(t=S.me)?void 0:t.uuid,w,null==A||null==(l=A.prices)?void 0:l.data,V,B]),(0,r.useEffect)(()=>{var e;if("authenticated"!==Q||eh||!(null==S||null==(e=S.me)?void 0:e.uuid))return;let t=new AbortController;return eA(t),()=>{t.abort()}},[Q,null==S||null==(o=S.me)?void 0:o.uuid,eh,eA]),b.isReady)?(0,a.jsxs)("div",{className:"maxWidthXLargePage my-10",children:[(0,a.jsx)("div",{className:"sm:grid sm:grid-cols-12 gap-x-6 mb-8",children:(0,a.jsx)("div",{className:"col-span-10 col-start-2",children:(0,a.jsx)(p.A,{currentStep:k?0:ev?2:1})})}),Y&&V&&(0,a.jsx)(_,{selectedPrice:w,setSelectedPrice:e=>eD(e,V),show:Y,onClose:()=>J(!1),trialCampaignDays:V.trialDays,eligiblePrices:X,productName:null==A||null==(u=A.product)?void 0:u.name}),Z&&(0,a.jsx)(er.A,{show:Z,onClose:()=>z(!1)}),(0,a.jsx)("div",{className:"sm:grid sm:grid-cols-12 gap-x-6 min-h-screen",children:(null==S||null==(d=S.me)?void 0:d.errorStatus)?(0,a.jsx)("div",{className:"col-span-10 col-start-2",children:(0,a.jsx)(m.A,{heading:"Oops, we are having trouble loading your account",content:"Please logout and back in. If you run into the same issue,",hyperlink:{text:"let us know.",link:eo.ey},isError:!0})}):(0,a.jsx)(ea,{isTrialSettled:!!V||!!B||el,selectedProduct:A,selectedPrice:w,stripePromoCode:R,setStripePromoCode:O,changeSelectedPrice:eU,couponValue:U,setCouponValue:D,hasCouponApplied:E,setHasCouponApplied:I,authError:eb,subscriptionBlock:eC,stripeOptions:es,successPath:N,stripeReference:ep,setStripeReference:eN,onDetailChange:eT,isDetailUpdating:eg,setIsDetailUpdating:eS,csList:ex,invoiceDetails:ej,onCouponUpdate:eE,setIsSubmitting:ek,isSubmitting:ey,referCoupon:M,trialCampaign:V,stripeCustomerId:eh,customerHasAddress:ev,customerAddress:ef,callUpdateCustomerAddress:eP,createPaymentIntentExplicitly:e_,callStartCheckout:ew,isUngated:el,isUserReady:!!(null==S||null==(g=S.me)?void 0:g.uuid)||el})})]}):null},es.Bd.checkout),{pageTitle:"Complete signup"})},30077:(e,t,l)=>{"use strict";l.d(t,{A:()=>o});var a=l(37876),r=l(48230),i=l.n(r),n=l(14232),s=l(31284);let o=e=>{let{heading:t,content:l,hyperlink:r,bullets:o,cobrandMessage:u,isError:c=!1}=e;return(0,n.useEffect)(()=>{c&&(0,s.A)("unhandled error landing user in oops page",{heading:t})},[t,c]),(0,a.jsxs)("div",{className:"flex flex-col md:flex-row items-center justify-center space-y-8 space-x-16 mt-20",children:[(0,a.jsx)("div",{className:"max-w-2xs",children:(0,a.jsx)("img",{src:"https://frontend-assets.point.me/pointer-illustrations/pointer-no-results.png",alt:"Pointer dog hiding under airplane seat"})}),(0,a.jsxs)("div",{className:"flex flex-col items-start",children:[(0,a.jsx)("h2",{className:"heading-2xl md:heading-4xl mb-4",children:t}),(0,a.jsxs)("div",{className:"richTextFormatting text-lg whitespace-pre-wrap",children:[(0,a.jsx)("div",{className:"flex items-center",children:(0,a.jsxs)("p",{children:[l," ",r&&(0,a.jsx)(i(),{href:r.link,className:"hover:text-primary-500",passHref:!0,children:r.text})]})}),u&&(0,a.jsx)("div",{className:"flex items-center",children:(0,a.jsxs)("p",{children:[u.text," ",u.hyperText&&u.hyperTextLink&&(0,a.jsx)(i(),{href:u.hyperTextLink,className:"hover:text-primary-500",passHref:!0,children:u.hyperText})]})}),(0,a.jsx)("ul",{children:o&&o.map(e=>(0,a.jsx)("li",{children:e.point},e.key))})]})]})]})}},30292:(e,t,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/onboarding/checkout",function(){return l(312)}])},45818:(e,t,l)=>{"use strict";l.d(t,{A:()=>n});var a=l(37876),r=l(95532);let i=["Create account","Billing address","Payment details"],n=e=>{let{currentStep:t,finalStep:l=!1}=e;return(0,a.jsx)(r.A,{steps:i,currentStep:l?i.length:t})}},61422:(e,t,l)=>{"use strict";l.d(t,{A:()=>s});var a=l(14232),r=l(8345),i=l(68464),n=l(91703);let s=e=>{let[t,l]=(0,r.A)(["pid","mbsy"]);(null==t?void 0:t.pid)==="[object Object]"&&l("pid","");let[s,o]=(0,a.useState)(!1),u=(0,n.kH)(e=>e.setUserTouch);(0,a.useEffect)(()=>{var l,a;if(e&&!s&&(null==t?void 0:t.pid)&&(null==e||null==(l=e.me)?void 0:l.uuid)&&!(null==e||null==(a=e.me)?void 0:a.affiliateId)){let e=null==t?void 0:t.pid;i.W.post("/api/users/associate-affiliate",{affiliate:e,type:null}).then(()=>{u(new Date().getTime())}),o(!0)}},[t,s,u,e])}},78442:(e,t,l)=>{"use strict";l.d(t,{A:()=>r,N:()=>a});let a={amex:"#8B6FFE",default:"#8B6FFE"},r=a.default}},e=>{e.O(0,[6701,9311,8230,4587,7666,4205,2451,3105,106,4342,9742,7365,9386,440,878,1446,754,1203,1905,6197,8307,9834,4544,636,6593,8792],()=>e(e.s=30292)),_N_E=e.O()}]); 2//# sourceMappingURL=checkout-6594cbb332b59bfc.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.