Loading
function(e,t,n){"use strict";n.d(t,{A:()=>x,j:()=>C});var l=n(627968),i=n(64700),s=n(192308),r=n(349288),a=n(683071),o=n(308528),u=n(913122),c=n(136857),d=n(211083),m=n(655857),h=n(211159),p=n(834981),f=n(975571),g=n(166532),E=n(652215),A=n(375708);function C(e){let{planError:t}=e,{paymentError:n}=(0,d.o)(),{dropdownCurrencies:a}=(0,m.Jn)(),{purchaseError:C,purchasePreviewError:x}=(0,h.t4)(e=>({purchaseError:e.purchaseError,purchasePreviewError:e.purchasePreviewError})),I=null;null!=x?I=x:null!=n&&null==(0,g.ou)(n)?I=n:null!=C?I=C:null!=t&&(I=t);let _=(0,p.vx)(),S=i.useCallback(()=>{(0,s.closeAllModals)(),o.A.openPrivateChannel({recipientIds:_})},[_]),y=a.length>1,v=null!=I?I.message:"";if(null!=I&&I instanceof u.Ey&&(I.code===c.tG.CARD_DECLINED&&y&&(v+=` ${A.intl.string(A.t.iWvwQS)}`),I.code===c.tG.INVALID_GIFT_REDEMPTION_FRAUD_REJECTED&&(v=A.intl.string(A.t.ypuSd8)),I.code===E.t02.BILLING_NON_REFUNDABLE_PAYMENT_SOURCE&&(v=A.intl.string(A.t.mXMmWE)),I.code===c.tG.INVALID_CURRENCY_FOR_PAYMENT_SOURCE&&(v=A.intl.string(A.t.mC1Fjz)),(I.code===c.tG.BILLING_SPENDING_LIMIT_REACHED||I.code===c.tG.BILLING_SPENDING_LIMIT_WILL_EXCEED)&&(v=A.intl.format(A.t["mv/fF2"],{guardianHook:(e,t)=>_.length>0?(0,l.jsx)(r.Anchor,{onClick:S,children:e},t):(0,l.jsx)(i.Fragment,{children:e},t)})),I.code===c.tG.INVALID_BILLING_ADDRESS)){let e=A.intl.format(A.t.BPDKoA,{helpdeskArticle:f.A.getArticleURL(E.MVz.BILLING).concat(E.bNI.INVALID_BILLING_ADDRESS)});v=(0,l.jsxs)(l.Fragment,{children:[A.intl.string(A.t["yVIm/G"])," ",e]})}return{error:I,errorMessage:v}}function x(e){let{planError:t,purchaseErrorBlockRef:n,className:i}=e,{error:s,errorMessage:r}=C({planError:t});return null==s?null:(0,l.jsx)("div",{ref:n,className:i,children:(0,l.jsx)(a.w,{type:"critical",children:r})})}}