Module 271849

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