Build 533169stable
Module 156312
6,498 characters · in no known chunkDependencies
Required by (78)
1105434645350524629261572694949105397491102957149346155301159176174705211528226151226846246681254326271849312649331611331617335425340034349786362111367160367921369280373856380083412463427675440612446929462309473106480800482132503516546042582658617745623020632638653813674223674619684477695998735305742810750343758655763795785205800132800471806677808574810809822426836308838462841247881677891197908419919301921925924076939665941667941673948409957489975189984742
Lazily required by (0)none
Requires (46)
Lazily requires (0)none
Source Raw
function(e,t,n){"use strict";n.d(t,{P5:()=>X,PaymentContextProvider:()=>J,Qv:()=>Z});var r=n(627968),i=n(64700),s=n(342393),a=n(989349),o=n.n(a),l=n(835245),u=n(311907),c=n(444927),d=n(10716),_=n(795816),f=n(933958),p=n(688810),h=n(627363),m=n(20015),E=n(86379),g=n(531260),A=n(446044),I=n(669874),T=n(364995),S=n(94420),y=n(181447),v=n(881489),N=n(573359),C=n(422936),R=n(234419),O=n(253932),b=n(293700),D=n(67480),L=n(328968),w=n(786300),M=n(927578),P=n(728458),x=n(795791),k=n(543027),U=n(853398),G=n(121005),F=n(369827),V=n(552574),B=n(935630),H=n(988023),j=n(289333),Y=n(252293),W=n(615310),K=n(87952),$=n(652215),z=n(788868),q=n(106451);let[Z,X,Q]=(0,w.A)();function J(e){let{stepConfigs:t,breadcrumbs:n,...i}=e;return(0,r.jsx)(W.mz,{stepConfigs:t,breadcrumbs:n,children:(0,r.jsx)(y.P,{children:(0,r.jsx)(ee,{...i})})})}function ee(e){let{loadId:t,discoverySessionId:n,activeSubscription:a,unifiedCheckoutFlow:y,shouldCrashOnUnhandledError:w=!0,onUnhandledError:X,skuIDs:Q,isGift:J=!1,children:ee,defaultPlanId:et,purchaseType:en=$.VVm.SUBSCRIPTION,applicationId:er,referralCode:ei,paymentGateway:es,excludeSubscriptionPlansBySKU:ea=!1,excludeSKUPurchasePreviews:eo=!1,wasTier2PremiumBeforePurchase:el=!1,referralTrialOfferId:eu}=e,ec=(0,K.A)(),ed=(0,E.Hp)(),e_=(0,G.A)(),ef=Q[0],ep=(0,u.bG)([D.A],()=>D.A.get(ef),[ef]),eh=ep?.eligiblePaymentGateways,{paymentSources:em,hasPaymentSources:eE,paymentSourceId:eg,setPaymentSourceId:eA,hasFetchedPaymentSources:eI}=(0,F.A)({isGift:J,activeSubscription:a,eligiblePaymentGateways:eh}),eT=i.useRef(eE),eS=(0,S.t4)(e=>{let{checkoutInvoicePreview:t}=e;return t}),{hasFetchedSubscriptionPlans:ey,priceOptions:ev,setCurrency:eN,currencyLoading:eC,currencies:eR,displayCurrency:eO}=(0,U.A)({activeSubscription:a,skuIDs:Q,paymentSourceId:eg,isGift:J,excludeSubscriptionPlansBySKU:ea,checkoutInvoicePreview:eS}),eb=(0,j.A)(),[eD,eL]=i.useState(!1),ew=(0,W.bB)(),[eM,eP]=(0,H.A)(ew),{paymentError:ex,paymentAuthenticationState:ek}=(0,V.A)(),{purchaseError:eU,purchaseErrorBlockRef:eG,setPurchaseError:eF}=(0,B.A)(),eV=(0,c.A)(()=>{let e=t??(0,l.A)();return P.A.addBreadcrumb({message:`Checkout session ID: ${e}`}),{loadId:e,discoverySessionId:n,startTime:Date.now()}}),eB=(0,S.t4)(e=>e.selectedSkuId),eH=(0,S.t4)(e=>e.selectedPlanId),[ej,eY]=(0,u.yK)([b.A],()=>[b.A.purchaseTokenAuthState,b.A.purchaseTokenHash]),[eW,eK]=i.useState(null),[e$,ez]=i.useState(null),[eq,eZ]=i.useState(null),[eX,eQ]=i.useState(null),[eJ,e0]=i.useState(null),[e1,e2]=i.useState(void 0),[e3,e6]=i.useState([]),[e4,e5]=i.useState([]),e7=i.useMemo(()=>null==eH||(0,M.ys)(eH),[eH]),e8=i.useRef(null!=a?a.planId:null);i.useEffect(()=>{null==e8.current&&null!=a&&(e8.current=a.planId)},[a]);let{endsAt:e9}=(0,g.A)({forceFetch:!1,excludeReverseTrial:!0}),te=i.useRef(e9.isSame(o()(0))?null:e9);i.useEffect(()=>{null!=te.current||e9.isSame(o()(0))||(te.current=e9)},[e9]);let tt=i.useMemo(()=>({paymentSourceId:eg,paymentGateway:es,loadId:t}),[eg,es,t]);(0,k.A)(ef,tt);let tn=i.useMemo(()=>Q.filter(e=>!z.oz.includes(e)),[JSON.stringify(Q)]),{previewErrorsById:tr}=(0,Y.A)({applicationId:er??z.tv,skuIDs:tn,currentPaymentSourceId:eg,isGift:J,excludeSKUPurchasePreviews:eo,loadId:eV.loadId,currency:ev.loaded?ev.currency:void 0}),ti=null!=eB?tr[eB]:null,[ts,ta]=i.useState(ti),{paymentSourceRecords:to,hasCheckoutContextForSession:tl}=(0,T.Fy)(),{data:tu}=(0,h.YY)(er),tc=O.Q_.useSetting(),td=(0,u.bG)([d.A],()=>d.A.getFetchState());i.useEffect(()=>{null!=tu&&(0,m.n)(tu,$.gfo.EMBEDDED)&&tc&&null==td&&(0,_.SE)()},[tu,tc,td]);let t_=null!=tu&&(0,m.n)(tu,$.gfo.EMBEDDED)&&(0,m.n)(tu,$.gfo.EMBEDDED_IAP),tf=(0,u.bG)([f.Ay],()=>Array.from(f.Ay.getSelfEmbeddedActivities().values()).find(e=>{let{applicationId:t}=e;return t===er})),tp=tf?.compositeInstanceId,th=(0,u.bG)([L.A],()=>null!=eB?L.A.getForSKU(eB):null,[eB]),tm=(0,v.ds)()&&!J,tE=e7,{isDisplayingWowMomentConfirmation:tg}=(0,u.cf)([N.A],()=>({isDisplayingWowMomentConfirmation:N.A.isDisplayingWowMomentConfirmation})),tA=tE?q.Ot:void 0,{enabled:tI}=(0,A.Y)({location:"PaymentContext"}),tT=(0,x.$w)(),tS=i.useMemo(()=>null!=eH&&eH===z.gD.PREMIUM_GROUP_MONTH,[eH]),ty=(0,R.V)(eu??void 0),tv=!tS&&!J&&null!=ty&&null!=eB&&z.TP[ty.trial_id].skus.includes(eB),tN=(0,C.O)(),tC=tN?.discount?.plan_ids.some(e=>z.hd[e].skuId===eB),tR=!!(!tS&&!J&&null!=tN&&null!=eB&&tC),tO=null!=eg&&null!=em[eg]?em[eg]?.type:null,tb=i.useMemo(()=>({payment_source_id:eg,payment_gateway:es,payment_source_type:tO,checkout_flow:y}),[eg,es,tO,y]),tD=(0,p.Db)();return(0,r.jsx)(Z.Provider,{value:{stripe:ec,unifiedCheckoutFlow:y,paymentElementsEnabled:tI,contextMetadata:eV,blockedPayments:ed,activeSubscription:a,hasFetchedSubscriptions:e_,hasFetchedSubscriptionPlans:ey,updatedSubscription:eX,setUpdatedSubscription:eQ,subscriptionMetadataRequest:eJ,setSubscriptionMetadataRequest:e0,hasFetchedPaymentSources:eI,paymentSources:em,hasPaymentSources:eE,paymentSourceId:eg,setPaymentSourceId:eA,priceOptions:ev,setCurrency:eN,currencyLoading:eC,currencies:eR,displayCurrency:eO,...eb,hasAcceptedTerms:eD,setHasAcceptedTerms:eL,purchaseState:eM,setPurchaseState:eP,paymentAuthenticationState:ek,paymentError:ex,purchaseError:eU,setPurchaseError:eF,purchasePreviewError:ts,setPurchasePreviewError:ta,purchaseErrorBlockRef:eG,purchaseTokenAuthState:ej,purchaseTokenHash:eY,bodyNode:eW,setBodyNode:eK,footerNode:e$,setFooterNode:ez,modalOverlayNode:eq,setModalOverlayNode:eZ,selectedStoreListing:th,readySlideId:e1,setReadySlideId:e2,defaultPlanId:et,isPremium:e7,isGift:J,startingFractionalPremiumEndsAtRef:te,startedPaymentFlowWithPaymentSourcesRef:eT,startingPremiumSubscriptionPlanIdRef:e8,defaultFetchableSkuIds:tn,checkoutPaymentSources:to,hasCheckoutContextLoaded:tl,application:tu,purchaseType:en,isEmbeddedIAP:t_,activitySessionId:tp,devShelfFetchState:td,entitlementsGranted:e3,setEntitlementsGranted:e6,appliedUserDiscounts:e4,setAppliedUserDiscounts:e5,referralCode:ei,inReverseTrial:tm,enablePremiumBrandRefresh:tE,isDisplayingWowMomentConfirmation:tg,premiumBrandRefreshBackgroundClassName:tA,wasTier2PremiumBeforePurchase:el,customCheckoutFlow:tT,isPremiumGroupPurchase:tS,isEligibleForTrial:tv,isEligibleForDiscount:tR,userTrialOffer:ty,referralTrialOfferId:eu,discountOffer:tN},children:(0,r.jsx)(s.Elements,{options:$.XL8,stripe:ec,children:(0,r.jsx)(I.j,{shouldRethrowError:w,locationStack:tD,onUnhandledError:X,loadId:eV.loadId,selectedSkuId:eB??null,selectedPlanId:eH??null,isGift:J,purchaseType:en,additionalAnalyticsData:tb,children:ee})})})}}