Module 699595

765 characters · in 3d3b05863accbf32.js
Dependencies
Required by (2)
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(e,t,n){"use strict";n.d(t,{W:()=>o});var l=n(64700),i=n(543767),s=n(410516),r=n(211159),a=n(463376);let o=e=>{let t,{priceOptions:n,trialId:o,metadata:u,discountInvoicePreview:c}=e,{isEligibleForDiscount:d,discountOffer:m}=(0,a.i)(),h=(0,s.YJ)(m),p=!0===n.loaded,f=null!=c,[g,E]=(0,i.YV)({items:null!=h?[{planId:h,quantity:1}]:[],renewal:!1,preventFetch:f||!d||null==h||!p,trialId:o,paymentSourceId:n.paymentSourceId,currency:n.currency,metadata:u}),A=f?c:g,C=l.useMemo(()=>{let e=d?A??null:null;return{discountOffer:m,applicablePlan:h,discountInvoicePreview:e,discountAmountOff:null!=h?(0,s.pg)(e,h):null,discountInvoiceError:E}},[m,h,A,E,d]);return t=(0,r.t4)(e=>{let{setPremiumDiscountInfo:t}=e;return t}),l.useEffect(()=>(t(C),()=>{t(s.TI)}),[C,t]),C}}