Module 736339

3,970 characters · in c3ade72e57cd6e6c.js
Dependencies
Required by (3)
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(e,t,n){n.d(t,{Ay:()=>_,O7:()=>A,gS:()=>I});var l=n(627968),a=n(64700),r=n(503698),i=n.n(r),s=n(284009),u=n.n(s),o=n(17928),c=n(834730),d=n(939249),m=n(150934),p=n(937008),f=n(97352),g=n(252424),v=n(428262),x=n(580630),b=n(788868),h=n(375708),y=n(672305);let A=(e,t)=>{let n=e.interval===b.WT.YEAR?h.t.ECT4A5:h.t.v9QeON;return h.intl.format(n,{price:(0,x.$g)(t.amount,t.currency)})},I=(e,t,n)=>{let{userLocale:l,isEligibleForBOGOPromotion:a,shouldShowSavingsPercent:r,isGift:i,planId:s,savingsPercent:u}=n,o=null!=e&&(e.planId===s||null!=t&&e.planId===t.id);return a?i||s!==b.gD.PREMIUM_MONTH_TIER_2?null:{type:"badge",textBadgeVariant:"eyebrow",text:h.intl.string(h.t.iQTfWx)}:null==t||t.interval===b.WT.YEAR&&null!=e||r&&!o?null!=t&&t.interval===b.WT.YEAR&&null!=e?h.intl.string(h.t["122kWB"]):r&&!o&&null!=u?{type:"badge",textBadgeVariant:"eyebrow",text:h.intl.format(h.t.IAybsG,{discount:(0,g.l9)(l,u/100)})}:null:null};function _(e){let{userLocale:t,premiumSubscription:n,planId:r,selectPlan:s,selected:g,priceOptions:_,isPrepaid:P,isCustomGift:T,shouldShowUpdatedPaymentModal:E,discountInfo:j,isEligibleForDiscount:N,isEligibleForBOGOPromotion:R,isEligibleForTrial:M,isCurrentPlan:S,disabled:L}=e,{isGift:k}=(0,p.Pv)(),{discountOffer:C,discountAmountOff:D,applicablePlan:U}=j,O=(0,o.bG)([f.A],()=>f.A.get(r));u()(null!=O,"Missing subscriptionPlan");let w=(0,v.L_)({planId:r,isGift:k,priceOptions:_,subscriptionPlan:O}),G=(0,v.y8)(r,!1,k,_),B=null!=w&&!E,W=a.useCallback(()=>{let e=I(n,O,{userLocale:t,isEligibleForBOGOPromotion:R,shouldShowSavingsPercent:B,isGift:k,planId:r,savingsPercent:w});return"string"==typeof e?(0,l.jsxs)("span",{className:y.IS,children:["(",e,")"]}):null!=e&&"badge"===e.type?(0,l.jsx)(c.E,{tag:"span",variant:e.textBadgeVariant,color:"always-white",className:y.kP,children:e.text}):null},[t,R,O,n,B,k,r,w]),F=(0,v.m6)(O.id),Y=a.useMemo(()=>(0,v.D8)(O.interval,k,P,O.intervalCount,T,F),[O.interval,O.intervalCount,k,P,T,F]),H=null!=U&&r===U,V=()=>{L||s(r)},K=E?h.intl.format(h.t.hXcaLT,{price:N&&null!=D&&H?(0,x.$g)(G.amount-D,G.currency):M?(0,x.$g)(0,G.currency,{minimumFractionDigits:0,maximumFractionDigits:0}):(0,x.$g)(G.amount,G.currency)}):(0,x.$g)(G.amount,G.currency);return(0,l.jsxs)(d.D,{role:"radio","aria-checked":g,tabIndex:g?0:-1,focusProps:{offset:{left:-4,right:-4,top:0,bottom:0}},onClick:V,className:i()(y.G_,{[y.vW]:T&&g,[y.Gb]:T}),children:[(0,l.jsxs)("div",{className:i()(y.XM,{[y.PA]:L}),children:[(0,l.jsxs)("div",{className:y.l,children:[!T&&(0,l.jsx)("div",{className:y.E2,children:(0,l.jsx)(m.S,{checked:g,value:g,label:"",description:"",onChange:V})}),(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:i()(y.Gl,{[y.h4]:g||T,[y.ox]:E&&(g||T)}),children:[Y,T&&W()]}),T&&(0,l.jsx)("div",{className:y._R,children:h.intl.format(h.t.ori2Jm,{currencyAmount:(0,x.$g)(G.amount,G.currency)})})]}),S&&(0,l.jsxs)("span",{className:y.bq,children:["(",h.intl.string(h.t.ymSxhy),")"]}),!T&&W()]}),E?(0,l.jsx)("div",{className:i()({[y.kb]:g}),children:K}):(0,l.jsx)("div",{className:i()({[y.h4]:g||T}),children:K})]}),E&&(0,l.jsx)("div",{className:y.hB,children:(0,l.jsx)(c.E,{variant:"text-md/normal",color:g?"text-default":"interactive-text-default",className:i()(y.Ub,{[y.sw]:N||M}),children:((e,t)=>{let{price:n,isEligibleForDiscount:l,isEligibleForTrial:a,discountAmountOff:r,discountOffer:i,isDiscountApplicableToPlan:s,savingsPercent:u}=t;return l&&null!=r&&s?e.interval===b.WT.YEAR?h.intl.format(h.t["EQmTl+"],{numYears:i?.discount.userUsageLimit??b.OJ,regularPrice:(0,x.$g)(n.amount,n.currency)}):h.intl.format(h.t["VeE/4E"],{numMonths:i?.discount.userUsageLimit??b.OJ,discountedPrice:(0,x.$g)(n.amount-r,n.currency),regularPrice:(0,x.$g)(n.amount,n.currency)}):a?A(e,n):e.interval===b.WT.YEAR?h.intl.formatToPlainString(h.t.rtLTJP,{percent:u??""}):null})(O,{price:G,isEligibleForDiscount:N,isEligibleForTrial:M,discountAmountOff:D,discountOffer:C,isDiscountApplicableToPlan:H,savingsPercent:w})})})]})}}