import{F as A,m as O,P as n,_ as g,R as _,a1 as l,T as d,X as t,a2 as m,a0 as r,Z as P,W as V,e,Y as y,bq as E}from"./vendor-BeMjADS_.js";import{b6 as U,bF as f}from"./index-Bf5vN7WQ.js";import{_ as D}from"./address-selection.vue_vue_type_script_setup_true_lang-DjqiWx4S.js";import{u as F}from"./useCheckout-7y4nce05.js";const T={class:"flex flex-col gap-6 lg:flex-row lg:gap-8"},W={class:"lg:w-3/5"},L={class:"space-y-3 lg:w-2/5"},R={class:"flex items-center gap-3 p-3 text-sm"},X=["data-selected-payment-method-id"],Y=["data-payment-method-id"],J=A({__name:"billing-details-section",props:{disabled:{type:Boolean}},setup(i){const{allItemsAreDigital:u,availablePaymentMethods:k,availableShippingMethods:v}=U(),p=O(()=>S.value?.code===f||v.value.length===1&&v.value[0].code===f),{billingAddressEqualsShipping:c,billingAddress:C,paymentMethod:$,shipmentMethod:S,onBillingAddressChange:w,setPaymentMethod:B,isPurchaseOrderNumberEnabled:M,purchaseOrderNumber:h}=F();return(a,o)=>{const N=n("VcLabel"),x=n("VcCheckbox"),b=n("VcImage"),z=n("VcSelect"),I=n("VcInput"),q=n("VcWidget");return _(),g(q,{title:a.$t("shared.checkout.billing_details_section.title"),"prepend-icon":"cash",size:"lg","data-test-id":"checkout.payment-details-section"},{default:l(()=>[d("div",T,[d("div",W,[t(N,{required:""},{default:l(()=>[m(r(a.$t("shared.checkout.billing_details_section.labels.billing_address")),1)]),_:1}),d("div",{class:P(["grow divide-y rounded-[--vc-radius] border",{"cursor-not-allowed bg-neutral-50":i.disabled}])},[!e(u)&&!p.value?(_(),g(x,{key:0,modelValue:e(c),"onUpdate:modelValue":o[0]||(o[0]=s=>y(c)?c.value=s:null),disabled:i.disabled,name:"billingAddressEqualsShipping",class:"p-3"},{default:l(()=>[m(r(a.$t("shared.checkout.billing_details_section.labels.same_as_shipping_address")),1)]),_:1},8,["modelValue","disabled"])):V("",!0),t(e(D),{placeholder:!e(u)&&!p.value&&e(c)?a.$t("shared.checkout.shipping_details_section.links.select_address"):a.$t("shared.checkout.billing_details_section.links.select_address"),address:e(C),disabled:i.disabled,readonly:!e(u)&&!p.value&&e(c),class:"min-h-18 px-3 py-1.5",onChange:e(w)},null,8,["placeholder","address","disabled","readonly","onChange"])],2)]),d("div",L,[t(z,{"model-value":e($),label:a.$t("shared.checkout.billing_details_section.labels.payment_method"),items:e(k),disabled:i.disabled,size:"auto",required:"","test-id-dropdown":"checkout.payment-method-selector",onChange:o[1]||(o[1]=s=>e(B)(s))},{placeholder:l(()=>[d("div",R,[t(b,{class:"size-12 rounded bg-neutral-100",src:"select-payment.svg"}),m(" "+r(a.$t("common.placeholders.select_payment_method")),1)])]),selected:l(({item:s})=>[d("div",{class:"flex items-center gap-3 p-3 text-sm","data-selected-payment-method-id":s.code},[t(b,{class:"size-12 rounded",src:s.logoUrl},null,8,["src"]),m(" "+r(s.name),1)],8,X)]),item:l(({item:s})=>[t(b,{class:"size-12 rounded",src:s.logoUrl},null,8,["src"]),d("span",{"data-payment-method-id":s.code},r(s.name),9,Y)]),_:1},8,["model-value","label","items","disabled"]),t(E,{name:"slide-fade-top",mode:"in-out"},{default:l(()=>[e(M)?(_(),g(I,{key:0,modelValue:e(h),"onUpdate:modelValue":o[2]||(o[2]=s=>y(h)?h.value=s:null),modelModifiers:{trim:!0},placeholder:a.$t("common.placeholders.purchase_order_number"),disabled:i.disabled,name:"purchaseOrderNumber"},null,8,["modelValue","placeholder","disabled"])):V("",!0)]),_:1})])])]),_:1},8,["title"])}}});export{J as _};
//# sourceMappingURL=billing-details-section.vue_vue_type_script_setup_true_lang-CjBEqTlc.js.map
