Module 6151

1,778 characters · in e6e0e333a5d139ad.js, 0395269527efd3ad.js
Dependencies
Required by (2)
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(e,t,n){n.d(t,{a:()=>g,v:()=>N}),n(321073);var l=n(627968),r=n(64700),a=n(355522),i=n(37766),s=n(637956),u=n(885574),o=n(691885),c=n(834730),d=n(939249),m=n(661531),x=n(866665),f=n(46054),p=n(812745),h=n(327105),v=n(375708),j=n(643892);let g="new_payment_source_id";function N(e){let{value:t,options:n,onChange:N,onNew:b,noticeMessage:E,newPaymentMethodOptionLabel:T,disabled:A=!1,error:S}=e,C=r.useMemo(()=>{let e=n.map(e=>{let t=null!=e.icon?e.icon===p.Be.BANK?(0,l.jsx)(a.M,{className:j.s7}):e.icon===p.Be.GIFT_CARD?(0,l.jsx)(i._,{className:j.s7}):e.icon===p.Be.PIX?(0,l.jsx)(s.W,{className:j.s7}):(0,l.jsx)("img",{src:(0,p.Nj)(e.icon),alt:"",className:j.s7}):void 0,n=null!=e.tooltipText?(0,l.jsx)(x.m,{text:e.tooltipText,asContainer:!0,children:(0,l.jsx)(u.m,{size:"xs",color:m.A.colors.TEXT_MUTED})}):void 0;return{id:e.id,value:e.id,label:e.label,leading:t,trailing:n,description:e.description,disabled:e.disabled}});return e.push({id:g,value:g,label:T??v.intl.string(h.default.rNF29q),leading:void 0,description:void 0}),e},[n,T]),I=r.useCallback(e=>{e===g?b():null!=e&&N(e)},[b,N]),y=(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(o.l,{label:v.intl.string(v.t["u+Cw58"]),hideLabel:!0,placeholder:v.intl.string(h.default.rNF29q),value:t,options:C,onSelectionChange:I,selectionMode:"single",disabled:A||0===n.length,errorMessage:S,fullWidth:!0,variant:"unsupported_payment_modal_card"}),null!=E?(0,l.jsxs)("div",{className:j.T4,children:[(0,l.jsx)(u.m,{size:"xs",color:m.A.colors.TEXT_FEEDBACK_INFO}),(0,l.jsx)(c.E,{variant:"text-xs/normal",color:"text-feedback-info",children:"string"==typeof E?f.A.parse(E,!1,{allowLinks:!0}):E})]}):null]});return 0!==n.length||A?y:(0,l.jsx)(d.D,{onClick:b,"aria-label":v.intl.string(h.default.rNF29q),className:j.OV,children:y})}}