Build 555975stable
Module 271849
6,720 characters · in 6c84c70b226fa2cf.jsDependencies
Lazily required by (0)none
Requires (47)
Lazily requires (0)none
Source Raw
function(e,t,n){n.d(t,{A:()=>X,L:()=>J});var l=n(627968),r=n(64700),i=n(503698),a=n.n(i),s=n(997101),o=n(17928),u=n(661531),c=n(289873),d=n(885574),p=n(834730),m=n(683071),h=n(534514),A=n(821891),C=n(953689),E=n(546605),y=n(531260),P=n(364995),S=n(31823),_=n(426398),f=n(463376),I=n(473617),T=n(571878),N=n(995835),v=n(937008),g=n(349786),x=n(800471),R=n(71867),M=n(222707),b=n(421094),L=n(216641),j=n(615405),O=n(67480),w=n(45938),D=n(428262),U=n(242874),k=n(881489),G=n(735164),Y=n(778307),F=n(165191),B=n(218075),W=n(361597),H=n(344159),V=n(285719),K=n(299301),Z=n(788868),q=n(818348),z=n(375708),$=n(814304);let J=e=>{let{selectedPlanId:t,paymentSources:n,trialId:l,metadata:i,isTrial:a=!1}=e,{selectedSkuId:s,priceOptions:u,activeSubscription:c,defaultPlanId:d,startedPaymentFlowWithPaymentSources:p}=(0,T.t4)(e=>({selectedSkuId:e.selectedSkuId,priceOptions:e.checkoutPriceOptions,activeSubscription:e.activeSubscription,defaultPlanId:e.defaultPlanId,startedPaymentFlowWithPaymentSources:e.startedPaymentFlowWithPaymentSources})),{hasPaymentSources:m}=(0,_.jm)(),{isEmbeddedIAP:h}=(0,S.V)(),{isPremium:A,isPremiumGroupPurchase:C,isEligibleForDiscount:N}=(0,f.i)(),{checkoutPaymentSources:g}=(0,P.t)(),{isGift:R,giftRecipient:M,selectedGiftStyle:b}=(0,v.Pv)(),j=(0,k.ds)()&&!R,U=s??"",G=(0,o.bG)([O.A],()=>O.A.get(U),[U]),Y=G?.eligiblePaymentGateways,F=(0,x.vT)({isTrial:a,isGift:R,selectedSkuId:s,startedPaymentFlowWithPaymentSources:p}),{subscriptionPlan:B,purchaseDisabled:W,checkoutInvoicePreview:V,invoiceSummaryTypeWithPreview:K,proratedInvoicePreview:q,renewalInvoicePreview:$,subscriptionPeriodEnd:J}=(0,I.V)({selectedPlanId:t,priceOptions:u,trialId:l,metadata:i,isTrial:a}),X=R&&(0,w.Ik)(M),Q=u.paymentSourceId,ee=(0,L.g)(n,Q),et=(0,E.vg)("PremiumSubscriptionReview")?g?.find(e=>e.id===Q)?.relocationCountry??null:null,{hasEntitlements:en,entitlements:el}=(0,H.X)(B.id,R),er=(0,D.J$)(u.paymentSourceId),ei=(0,y.A)({forceFetch:!1,excludeReverseTrial:!1,excludeReverseTrialFromCountdown:!0}),ea=!F&&(ei.isFractionalPremiumActive||j)&&Z.JM.has(t),es=r.useMemo(()=>(0,D.Tm)({skuId:s,isPremium:A,defaultPlanId:d}),[s,d,A]),eo=r.useMemo(()=>en&&null==Q?z.intl.format(z.t["2wPRSF"],{months:el.length}):null,[en,Q,el]);return{disabled:W,activeSubscription:c,subscriptionPeriodEnd:J,plan:B,premiumPlanOptions:es,checkoutInvoicePreview:V,invoiceSummaryTypeWithPreview:K,renewalInvoicePreview:$,proratedInvoicePreview:q,isGift:R,isEmbeddedIAP:h,paymentSourceType:ee,giftRecipient:M,selectedGiftStyle:b,isInOneStepSubscriptionCheckout:F,shouldAllowPlanSelect:F&&!C,hasPaymentSources:m,paymentSourceId:Q,eligiblePaymentGateways:Y,inReverseTrial:j,fractionalPremiumInfo:ei,showFractionalPremiumBannerInInvoiceSummary:ea,isPrepaid:er,isCustomGift:X,isPremium:A,isPremiumGroupPurchase:C,isEligibleForDiscount:N,hasEntitlements:en,entitlements:el,paymentSourceOptionalWarningCopy:eo,selectedSourceRelocationCountry:et}};function X(e){let{selectedPlanId:t,planGroup:n,paymentSources:i,handlePaymentSourceAdd:o,setHasAcceptedTerms:E,legalTermsNodeRef:y,hasLegalTermsFlash:P,trialId:S,trialFooterMessageOverride:_,reviewWarningMessage:f,metadata:I,hideSubscriptionDetails:v,referralTrialOfferId:x,isTrial:L=!1,isDiscount:O=!1,handleClose:w}=e,{disabled:k,isEmbeddedIAP:H,paymentSourceType:Z,giftRecipient:X,selectedGiftStyle:Q,subscriptionPeriodEnd:ee,premiumPlanOptions:et,shouldAllowPlanSelect:en,hasPaymentSources:el,paymentSourceId:er,eligiblePaymentGateways:ei,inReverseTrial:ea,fractionalPremiumInfo:es,plan:eo,isGift:eu,invoiceSummaryTypeWithPreview:ec,checkoutInvoicePreview:ed,renewalInvoicePreview:ep,showFractionalPremiumBannerInInvoiceSummary:em,isPrepaid:eh,isCustomGift:eA,isPremium:eC,isPremiumGroupPurchase:eE,hasEntitlements:ey,paymentSourceOptionalWarningCopy:eP,selectedSourceRelocationCountry:eS}=J({selectedPlanId:t,paymentSources:i,trialId:S,metadata:I,isTrial:L}),e_=(0,T.t4)(e=>e.checkoutPriceOptions),ef=r.useMemo(()=>(0,D.l6)(e_,ed?.checkoutContext?.available_plans),[e_,ed]),eI=(0,N.I)({skuId:eo?.skuId,isGift:eu,className:$.Gw});if(null!=ec&&ec.type===K.N$.LOADING)return(0,l.jsx)("div",{className:$.zp,children:(0,l.jsx)(c.y,{})});let eT=(0,l.jsx)(K.eb,{invoiceSummaryTypeWithPreview:ec,priceOptions:e_,trialFooterMessageOverride:_,hideSubscriptionDetails:v,referralTrialOfferId:x,isTrial:L,inReverseTrial:ea,fractionalPremiumInfo:es,plan:eo,showFractionalPremiumBanner:em,isPrepaid:eh,isCustomGift:eA,enablePremiumBrandRefresh:eC}),eN=s.M.EEA_COUNTRIES.has(j.A.ipCountryCodeWithFallback),ev=z.intl.formatToPlainString(z.t["sBpy9/"],{planName:eo.name});eu&&!eA?ev=z.intl.string(z.t.J5a0eb):eu&&eA?ev="":(0,D.ys)(eo.id)&&(ev=D.Ay.getBillingReviewSubheader(null,eo));let eg=null!=ei&&ei.length>0&&(null==er||null===Z)&&el?B.fU.SELECT_PAYMENT_METHOD:void 0;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(g.k,{location:"PremiumSubscriptionReview",paymentSourceId:er}),(0,l.jsxs)("div",{children:[(0,l.jsx)(B.je,{paymentRestrictionBannerType:eg}),null!=f&&(0,l.jsxs)("div",{className:$.Je,children:[(0,l.jsx)(d.m,{size:"custom",color:u.A.unsafe_rawColors.YELLOW_300.css,width:20,height:20}),(0,l.jsx)(p.E,{className:$.CJ,variant:"text-sm/normal",children:f})]}),eE&&(0,l.jsx)("div",{className:$.Ni,children:(0,l.jsx)(m.w,{type:"info",children:(0,l.jsx)(p.E,{variant:"text-sm/medium",children:(0,M.Nn)()})})}),eI,en&&(0,l.jsxs)("div",{children:[(0,l.jsx)(R.P,{planSkuId:eo?.skuId,referralTrialOfferId:x}),(0,l.jsx)(W.$p,{disabled:k,planOptions:et,selectedPlanId:t,planGroup:n,subscriptionPeriodEnd:ee,showTotal:!1,priceOptions:ef,handleClose:w}),(0,l.jsx)(G.pK,{})]}),!L&&""!==ev&&(0,l.jsx)(h.D,{variant:"heading-md/semibold",className:$.wx,children:ev}),eA&&null!=Q&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(F.A,{defaultAnimationState:U.oA.LOOP,giftStyle:Q,shouldAnimate:!0,className:$.Os}),(0,l.jsx)(V.Z,{giftRecipient:X})]}),eT,(0,l.jsxs)("div",{className:$.LC,children:[(0,l.jsx)(b.K,{label:z.intl.string(L?z.t["YH7B+D"]:z.t["mmDvV+"]),handlePaymentSourceAdd:o,isTrial:L,isDiscount:O,disabled:k,hasEntitlements:ey,eligiblePaymentGateways:ei,shouldUseUnifiedCheckoutUI:!1,paymentSourceDropdownClassName:a()({[$.E4]:eC}),paymentSourceDropdownPrependOption:ey&&!L?{label:z.intl.string(z.t.IGU7El),value:null}:null}),null!=eP?(0,l.jsx)("div",{className:$.QN,children:eP}):null]}),(0,l.jsx)(Y.A,{isActive:P,ref:y,children:(0,l.jsx)(C.A,{onChange:E,forceShow:!0,finePrint:_??(0,l.jsx)(A.A,{hide:L||O,subscriptionPlan:eo,renewalInvoice:ep,isGift:eu,paymentSourceType:Z,isEmbeddedIAP:H,basePrice:(0,D.y8)(eo.id,!1,eu,ef),willRelocateStoreCountry:null!=eS}),showPricingLink:eo.currency!==q.Yr.USD,showWithdrawalWaiver:eN,disabled:k,isTrial:L&&null==_,isDiscount:O,subscriptionPlan:eo,isGift:eu})})]})]})}}