import{r as t,h as i}from"./p-dfbe004d.js";import{_ as s}from"./p-8415f806.js";import"./p-fd56940f.js";import"./p-9a7a47e8.js";const e=class{constructor(i){t(this,i)}renderLogo(){return["visa","mastercard","amex","discover","diners","jcb","unionpay"].includes(this.brand)?i("sc-icon",{name:this.brand,style:{"--height":"0.63em"}}):i("sc-icon",{name:"creditcard",style:{"--height":"0.63em"}})}render(){return i("div",{class:"cc-logo",part:"base"},this.renderLogo())}};e.style=":host{display:inline-block}.cc-logo{border-radius:var(--sc-cc-border-radius, 4px);line-height:0;overflow:hidden}";const n=class{constructor(i){t(this,i)}renderBankAccountType(t){return"checking"===t?s("Checking","surecart"):"savings"===t?s("Savings","surecart"):void 0}renderExternalLink(){return!!this.externalLink&&i("sc-tooltip",{text:this.externalLinkTooltipText,type:"text"},i("sc-button",{style:{color:"var(--sc-color-gray-500)"},type:"text",size:"small",href:this.externalLink,target:"_blank"},i("sc-icon",{name:"external-link",style:{fontSize:"16px"}})))}render(){var t,s,e,n,a,o,l,r,d,c,p,v,h,u,m,y,f,g;if(null===(s=null===(t=this.paymentMethod)||void 0===t?void 0:t.bank_account)||void 0===s?void 0:s.id){const t=null===(e=this.paymentMethod)||void 0===e?void 0:e.bank_account;return i("div",{class:"payment-method",part:"bank"},i("span",null,this.renderBankAccountType(null==t?void 0:t.account_type)),"**** ",null==t?void 0:t.last4,this.renderExternalLink())}if(null===(a=null===(n=null==this?void 0:this.paymentMethod)||void 0===n?void 0:n.payment_instrument)||void 0===a?void 0:a.instrument_type){const t=null===(l=null===(o=null==this?void 0:this.paymentMethod)||void 0===o?void 0:o.payment_instrument)||void 0===l?void 0:l.instrument_type;return["applepay","bancontact","banktransfer","belfius","creditcard","directdebit","eps","giftcard","giropay","ideal","in3","kbc","klarna","mybank","paysafecard","przelewy24","sofort","Voucher"].includes(t)?i("div",{class:"payment-method",part:"instrument"},i("sc-icon",{style:{fontSize:"36px"},name:t}),i("span",{style:{textTransform:"capitalize"}},t),this.renderExternalLink()):"paypal"===t?i("div",{class:"payment-method",part:"instrument"},i("sc-icon",{style:{fontSize:"56px",lineHeight:"1",height:"28px"},name:"paypal"})):i("div",{class:"payment-method",part:"instrument"},i("sc-tag",{exportparts:"base:payment_instrument",type:"info",pill:!0},i("span",{style:{textTransform:"capitalize"}},t," ")),this.renderExternalLink())}return(null===(d=null===(r=this.paymentMethod)||void 0===r?void 0:r.card)||void 0===d?void 0:d.brand)?i("div",{class:"payment-method",part:"card"},i("sc-cc-logo",{style:{fontSize:"36px"},brand:null===(p=null===(c=this.paymentMethod)||void 0===c?void 0:c.card)||void 0===p?void 0:p.brand}),i("sc-text",{style:{whiteSpace:"nowrap",paddingRight:"6px"}},"**** ",null===(h=null===(v=this.paymentMethod)||void 0===v?void 0:v.card)||void 0===h?void 0:h.last4),this.renderExternalLink()):(null===(m=null===(u=this.paymentMethod)||void 0===u?void 0:u.paypal_account)||void 0===m?void 0:m.id)?i("div",{class:"payment-method",part:"base",style:{gap:"var(--sc-spacing-small)"}},i("sc-icon",{style:{fontSize:"56px",lineHeight:"1",height:"28px"},name:"paypal"}),this.full&&i("sc-text",{style:{"--font-size":"var(--sc-font-size-small)"},truncate:!0},null===(f=null===(y=this.paymentMethod)||void 0===y?void 0:y.paypal_account)||void 0===f?void 0:f.email),this.renderExternalLink()):null===(g=null==this?void 0:this.paymentMethod)||void 0===g?void 0:g.processor_type}};n.style=":host{display:block}.payment-method{display:flex;align-items:center;justify-content:flex-start;gap:var(--sc-spacing-x-small)}";export{e as sc_cc_logo,n as sc_payment_method}