Loading
function(e,t,n){"use strict";n.d(t,{A:()=>j,L:()=>H});var r=n(627968),i=n(64700),s=n(503698),a=n.n(s),o=n(997101),l=n(311907),u=n(827734),c=n(397927),d=n(821189),_=n(821891),f=n(953689),p=n(531260),h=n(695998),m=n(94420),E=n(937008),g=n(156312),A=n(800471),I=n(104745),T=n(222707),S=n(421094),y=n(216641),v=n(615405),N=n(79387),C=n(67480),R=n(45938),O=n(927578),b=n(242874),D=n(735164),L=n(778307),w=n(75825),M=n(218075),P=n(446929),x=n(344159),k=n(285719),U=n(299301),G=n(788868),F=n(818348),V=n(985018),B=n(814304);let H=e=>{let{selectedPlanId:t,paymentSources:n,priceOptions:r,trialId:s,metadata:a,currencies:o,onCurrencyChange:u,isTrial:c=!1}=e,d=(0,m.t4)(e=>e.selectedSkuId),{isEmbeddedIAP:_,activeSubscription:f,defaultPlanId:I,isPremium:T,startedPaymentFlowWithPaymentSourcesRef:S,inReverseTrial:v,hasPaymentSources:N,enablePremiumBrandRefresh:b,premiumBrandRefreshBackgroundClassName:D,isPremiumGroupPurchase:L,isEligibleForDiscount:w,displayCurrency:M}=(0,g.P5)(),{isGift:P,giftRecipient:k,selectedGiftStyle:U}=(0,E.Pv)(),F=d??"",B=(0,l.bG)([C.A],()=>C.A.get(F),[F]),H=B?.eligiblePaymentGateways,j=(0,A.vT)({isTrial:c,isGift:P,selectedSkuId:d,startedPaymentFlowWithPaymentSources:S.current}),{subscriptionPlan:Y,purchaseDisabled:W,checkoutInvoicePreview:K,invoiceSummaryTypeWithPreview:$,proratedInvoicePreview:z,renewalInvoicePreview:q,discountInvoicePreview:Z,subscriptionPeriodEnd:X}=(0,h.P)({selectedPlanId:t,priceOptions:r,trialId:s,metadata:a,isInOneStepSubscriptionCheckout:j,isTrial:c}),Q=P&&(0,R.Ik)(k),J=r.paymentSourceId,ee=(0,y.g)(n,J),{hasEntitlements:et,entitlements:en}=(0,x.X)(Y.id,P),er=(0,O.J$)(r.paymentSourceId),ei=(0,p.A)({forceFetch:!1,excludeReverseTrial:!1,excludeReverseTrialFromCountdown:!0}),es=!j&&(ei.isFractionalPremiumActive||v)&&G.JM.has(t),ea=i.useMemo(()=>(0,O.Tm)({skuId:d,isPremium:T,defaultPlanId:I}),[d,I,T]),eo=i.useMemo(()=>({label:V.intl.string(V.t["/AAR02"]),selectedCurrency:r.currency??M,currencies:o,onChange:u}),[r.currency,M,o,u]),el=i.useMemo(()=>et&&null==J?V.intl.format(V.t["2wPRSF"],{months:en.length}):null,[et,J,en]);return{disabled:W,activeSubscription:f,subscriptionPeriodEnd:X,plan:Y,premiumPlanOptions:ea,checkoutInvoicePreview:K,invoiceSummaryTypeWithPreview:$,discountInvoicePreview:Z,renewalInvoicePreview:q,proratedInvoicePreview:z,isGift:P,isEmbeddedIAP:_,paymentSourceType:ee,giftRecipient:k,selectedGiftStyle:U,isInOneStepSubscriptionCheckout:j,shouldAllowPlanSelect:j&&!L,hasPaymentSources:N,paymentSourceId:J,eligiblePaymentGateways:H,inReverseTrial:v,fractionalPremiumInfo:ei,showFractionalPremiumBannerInInvoiceSummary:es,isPrepaid:er,isCustomGift:Q,enablePremiumBrandRefresh:b,premiumBrandRefreshBackgroundClassName:D,isPremiumGroupPurchase:L,isEligibleForDiscount:w,hasEntitlements:et,entitlements:en,currencyDropdownProps:eo,paymentSourceOptionalWarningCopy:el}};function j(e){let{selectedPlanId:t,planGroup:n,paymentSources:s,priceOptions:l,currencies:p,onCurrencyChange:h,handlePaymentSourceAdd:m,setHasAcceptedTerms:E,legalTermsNodeRef:g,hasLegalTermsFlash:A,trialId:y,trialFooterMessageOverride:C,reviewWarningMessage:R,metadata:x,hideSubscriptionDetails:G,referralTrialOfferId:j,isTrial:Y=!1,isDiscount:W=!1,handleClose:K}=e,{disabled:$,isEmbeddedIAP:z,paymentSourceType:q,giftRecipient:Z,selectedGiftStyle:X,subscriptionPeriodEnd:Q,premiumPlanOptions:J,shouldAllowPlanSelect:ee,hasPaymentSources:et,paymentSourceId:en,eligiblePaymentGateways:er,inReverseTrial:ei,fractionalPremiumInfo:es,plan:ea,isGift:eo,invoiceSummaryTypeWithPreview:el,checkoutInvoicePreview:eu,renewalInvoicePreview:ec,showFractionalPremiumBannerInInvoiceSummary:ed,isPrepaid:e_,isCustomGift:ef,enablePremiumBrandRefresh:ep,premiumBrandRefreshBackgroundClassName:eh,isPremiumGroupPurchase:em,hasEntitlements:eE,currencyDropdownProps:eg,paymentSourceOptionalWarningCopy:eA}=H({selectedPlanId:t,paymentSources:s,priceOptions:l,trialId:y,metadata:x,isTrial:Y,currencies:p,onCurrencyChange:h}),eI=i.useMemo(()=>(0,O.l6)(l,eu?.checkoutContext?.available_plans),[l,eu]);if(null!=el&&el.type===U.N$.LOADING)return(0,r.jsx)("div",{className:B.zp,children:(0,r.jsx)(c.y$y,{})});let eT=(0,r.jsx)(U.eb,{invoiceSummaryTypeWithPreview:el,priceOptions:l,trialFooterMessageOverride:C,hideSubscriptionDetails:G,referralTrialOfferId:j,isTrial:Y,inReverseTrial:ei,fractionalPremiumInfo:es,plan:ea,showFractionalPremiumBanner:ed,isPrepaid:e_,isCustomGift:ef,enablePremiumBrandRefresh:ep,premiumBrandRefreshBackgroundClassName:eh}),eS=o.M.EEA_COUNTRIES.has(v.A.ipCountryCodeWithFallback),ey=V.intl.formatToPlainString(V.t["sBpy9/"],{planName:ea.name});eo&&!ef?ey=V.intl.string(V.t.J5a0eb):eo&&ef?ey="":(0,O.ys)(ea.id)&&(ey=O.Ay.getBillingReviewSubheader(null,ea));let ev=null!=er&&er.length>0&&(en===N.B||null===q)&&et?M.fU.SELECT_PAYMENT_METHOD:void 0;return(0,r.jsxs)("div",{children:[(0,r.jsx)(M.je,{paymentRestrictionBannerType:ev}),null!=R&&(0,r.jsxs)("div",{className:B.Je,children:[(0,r.jsx)(c.mir,{size:"custom",color:u.A.unsafe_rawColors.YELLOW_300.css,width:20,height:20}),(0,r.jsx)(c.Text,{className:B.CJ,variant:"text-sm/normal",children:R})]}),em&&(0,r.jsx)("div",{className:B.Ni,children:(0,r.jsx)(c.wx6,{type:"info",children:(0,r.jsx)(c.Text,{variant:"text-sm/medium",children:(0,T.Nn)()})})}),ee&&(0,r.jsxs)("div",{children:[(0,r.jsx)(I.P,{planSkuId:ea?.skuId,referralTrialOfferId:j}),(0,r.jsx)(P.$p,{disabled:$,planOptions:J,selectedPlanId:t,planGroup:n,subscriptionPeriodEnd:Q,showTotal:!1,priceOptions:eI,handleClose:K}),(0,r.jsx)(D.pK,{})]}),!Y&&""!==ey&&(0,r.jsx)(c.Heading,{variant:"heading-md/semibold",className:B.wx,children:ey}),ef&&null!=X&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(w.A,{defaultAnimationState:b.oA.LOOP,giftStyle:X,shouldAnimate:!0,className:B.Os}),(0,r.jsx)(k.Z,{giftRecipient:Z})]}),eT,(0,r.jsxs)("div",{className:B.LC,children:[(0,r.jsx)(S.K,{label:V.intl.string(Y?V.t["YH7B+D"]:V.t["mmDvV+"]),handlePaymentSourceAdd:m,isTrial:Y,isDiscount:W,disabled:$,hasEntitlements:eE,eligiblePaymentGateways:er,shouldUseUnifiedCheckoutUI:!1,paymentSourceDropdownClassName:a()({[B.E4]:ep}),paymentSourceDropdownPrependOption:eE&&!Y?{label:V.intl.string(V.t.IGU7El),value:null}:null}),null!=eA?(0,r.jsx)("div",{className:B.QN,children:eA}):null,W?null:(0,r.jsx)(d.f,{currencies:eg.currencies,className:B.p2,children:(0,r.jsx)(d.A,{...eg})})]}),(0,r.jsx)(L.A,{isActive:A,ref:g,children:(0,r.jsx)(f.A,{onChange:E,forceShow:!0,finePrint:C??(0,r.jsx)(_.A,{hide:Y||W,subscriptionPlan:ea,renewalInvoice:ec,isGift:eo,paymentSourceType:q,isEmbeddedIAP:z,basePrice:(0,O.y8)(ea.id,!1,eo,eI)}),showPricingLink:ea.currency!==F.Yr.USD,showWithdrawalWaiver:eS,disabled:$,isTrial:Y&&null==C,isDiscount:W,subscriptionPlan:ea,isGift:eo})})]})}}