PageSourceSearch

https://www.rugsdirect.co.uk/cdn/shopifycloud/checkout-web/assets/c1/BillingAddressSelector.DB4kH3hG.js

js rugsdirect.co.uk collected 2026-09-26 07:30:01 UTC 3,240 bytes, 1 lines download raw bytes

1import{u as e,T as _,q as E,h as R,i as U}from"./esnext-vendor.B9Da21W6.js";import{C as A,a as M}from"./Choice.DSKmQsTS.js";import{k as C,l as g,aC as V,aD as q,aE as w,aF as z,m as H,P as W,Y}from"./hydrate.DZ4YTm7p.js";import{B as F}from"./BillingAddressForm.pnsu7UK8.js";import{S as N,a4 as $,b2 as j,T as G,b3 as J,b4 as T,b5 as K}from"./addresses-is-address-empty.Bn2lNY_L.js";import{A as Q}from"./AddressPresenter.BIgrto4P.js";function X(){const{i18n:a,checkout:i}=N(),t=i.addressManager.billing.value.suggestedAddress.value,r=t.address,n=t.type,m={hiddenFields:["phone","company","firstName","lastName"],multiline:!1},u=(()=>{if(n==="billing-fact")return a.translate("payment.use_order_billing_address_label");if(n==="billing")return a.translate("payment.use_location_billing_address_label");if(n==="shipping")return a.translate("payment.use_location_shipping_address_label")})();return!r||!n||!u?null:e(A,{value:n,children:e(C,{children:[e(g,{type:"strong",children:u}),e(g,{color:"subdued",children:e(Q,{...m,address:r})})]})})}const Z="billing_address_selector";function ae({renderFormOnly:a=!1}={}){const{i18n:i,source:t,checkout:r}=N(),n=$(),m=n.deliveryNext.value,u=j(m),P=V(),{billingAddress:s,shippingAddress:h,billingAddressOption:d}=G(),O=h.value,o=r.proposal.facts.billingAddress,b=r.configuration.layout.isOnePage.value,p=q(),S=w(),f=n.buyerIdentity.value?.purchasingCompany,c=n.buyerIdentity.value?.customerProfile,x=c&&!J(c)&&c.billingAddresses.length===0&&c.shippingAddresses.length===0,L=(!c||x)&&O.oneTimeUse,y=_(()=>({firstName:void 0,lastName:void 0,address1:void 0,address2:void 0,company:void 0,city:void 0,postalCode:void 0,phone:void 0,zoneCode:void 0,name:void 0,countryCode:s.fields.countryCode.peek()}),[s.fields.countryCode]),v=_(()=>h.fields.countryCode.peek(),[h.fields.countryCode]),D=E(([l])=>{l&&(d.value=l,T(t)?l==="custom"?s.value=y:l==="shipping"?s.value=p.value:l==="billing-fact"&&o&&(s.value=o):l==="custom"&&f?s.value=K({countryCode:v}):l==="custom"?s.fields.countryCode.value=v:l==="shipping"&&(s.value=p.value,S()))},[d,t,f,o,s,y,p,v,S]),B=i.translate("payment.billing_address_title");z(),R(()=>{T(t)&&P.value==="form"?s.value=y:d.value==="shipping"?s.value=p.value:d.value==="billing-fact"&&o&&(s.value=o)},[]);const k=d.value,I=_(()=>[k],[k]);return e(Y,{accessibilityRole:"group",accessibilityLabelledBy:b?void 0:"billingAddress",accessibilityLabel:b?B:void 0,children:e(C,{gap:"base",children:[b?null:e(C,{gap:"small-400",children:[e(H,{id:"billingAddress",children:B}),L?null:e(W,{color:"subdued",children:u?i.translate("payment.billing_address_description_no_shipping_address"):i.translate("payment.billing_address_description")})]}),e(U,{when:()=>!a&&P.value!=="form",fallback:e(F,{}),children:e(M,{name:Z,values:I,onChange:D,variant:"block",children:[f?e(X,{}):e(A,{value:"shipping",accessibilityLabel:i.translate("payment.same_billing_address_label"),children:e(g,{type:"strong",children:i.translate("payment.same_billing_address_label")})}),e(A,{value:"custom",selectedContent:e(F,{}),accessibilityLabel:i.translate("payment.different_billing_address_label"),children:e(g,{type:"strong",children:i.translate("payment.different_billing_address_label")})})]})})]})})}export{ae as B};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.