Module 274971

3,276 characters · in 39b15c6418aa214d.js
Dependencies
Source Raw
function(e,t,n){n.d(t,{E:()=>S,T:()=>g});var l=n(627968),r=n(64700),i=n(503698),a=n.n(i),s=n(683071),o=n(289873),u=n(725836);n(321073);var c=n(546605),d=n(426398),p=n(900730),m=n(211159);n(209143);var h=n(921925),A=n(525723);n(661531),n(897831);var E=n(375708),C=n(848584),y=n(327105),_=n(312867);let S=e=>{let{className:t}=e;return(0,l.jsx)("div",{className:a()(_.g4,t),children:(0,l.jsx)(o.y,{type:o.y.Type.PULSING_ELLIPSIS,itemClassName:_.Je})})},P=e=>null!=e&&"object"==typeof e&&"message"in e&&"type"in e?(0,l.jsx)(s.w,{type:e.type,hidden:e.hidden,children:e.message},e.key):(0,l.jsx)(r.Fragment,{children:e.directContent},e.key),I=e=>null==e||""===e,f=e=>{let{children:t}=e,{errorMessage:n,warningMessage:i,richNotices:a}=(()=>{let e,{errorMessage:t}=(0,h.e)({}),n=(e=(0,m.t4)(e=>e.selectedSkuId),(0,A.vw)({skuId:e})?E.intl.format(E.t.fsOXXO,{}):null),i=function(){let e=(0,c.vg)("StatefulCheckoutStoreRelocationNotice"),t=(0,m.t4)(e=>e.paymentSourceId),n=(0,d.kc)(),{relocationCountry:i,relocationCurrencyCode:a,willForfeitGiftCardBalance:s}=r.useMemo(()=>{let e=null!=t?n.find(e=>e.id===t):null;return{relocationCountry:e?.relocationCountry??null,relocationCurrencyCode:e?.relocationCurrencyCode??null,willForfeitGiftCardBalance:e?.willForfeitGiftCardBalance??!1}},[n,t]);return r.useMemo(()=>e&&null!=i?{directContent:(0,l.jsx)(p.c,{relocationCountry:i,relocationCurrencyCode:a,willForfeitGiftCardBalance:s}),key:"store-relocation-notice"}:null,[e,i,a,s])}();return{errorMessage:t,warningMessage:n,richNotices:r.useMemo(()=>{let e=[];return null!=i&&e.push(i),e},[i])}})(),o=r.useRef(null);return r.useEffect(()=>{I(n)||null==o.current||o.current.scrollIntoView({behavior:"smooth"})},[n]),r.useMemo(()=>I(n)&&I(i)&&!(a.length>0)&&null==t?null:(0,l.jsxs)("div",{ref:o,className:_.dD,children:[I(n)?null:(0,l.jsx)(s.w,{type:"critical",children:n}),I(i)?null:(0,l.jsx)(s.w,{type:"warning",children:i}),a.map(P),t]}),[n,i,a,t])},T=e=>r.useMemo(()=>null==e?null:Array.isArray(e)?0===e.length?null:(0,l.jsx)(l.Fragment,{children:e.map(e=>P(e))}):null!=e?P(e):null,[e]),N=e=>{let{upperInlineNoticeProps:t,shouldShowGlobalNotices:n}=e,i=T(t);return r.useMemo(()=>null!=i||n?n?null!=i?(0,l.jsx)(f,{children:i}):(0,l.jsx)(f,{}):(0,l.jsx)("div",{className:_.dD,children:i}):null,[n,i])},g=e=>{let{upperInlineNoticeProps:t,planSelectContent:n,purchaseItemContent:r,subscriptionDetailsContent:i,isStepLoading:s,paymentMethodContent:o,invoiceSummaryContent:c,promotionalNoticeContent:d,legalContent:p,invoiceTotalDueLabel:m=E.intl.string(y.default.R0cZsM),invoiceTotalDueValue:h,shouldShowGlobalNotices:A,footerInlineNoticeProps:P,className:I}=e,f=T(P);return s?(0,l.jsx)(S,{className:I}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:a()(I,{[_.pg]:null==c}),children:[(0,l.jsx)(N,{upperInlineNoticeProps:t,shouldShowGlobalNotices:A}),n,null!=n&&null!=r&&(0,l.jsx)("div",{className:_.ls}),r,null!=i&&(0,l.jsx)("div",{className:_.P3,children:i}),(0,l.jsx)("div",{className:_.Jv,children:o}),null!=c&&(0,l.jsx)("div",{className:_.ZF,children:c})]}),(0,l.jsxs)(u.bx,{children:[null!=m&&null!=h&&(0,l.jsx)(C.Qf,{className:_.NR,label:m,value:h}),null!=d?(0,l.jsx)("div",{className:_.uh,children:d}):null,p,null!=f?(0,l.jsx)("div",{className:_.Uu,children:f}):null]})]})}}