1import{f as o,u as e,i as b,S as E,p as Re,k as De,h as Fe}from"./esnext-vendor.DDpcaSqU.js";import{c1 as Be,dU as Ee,q as M,az as Me,ef as ie,eg as T,l as x,L as Oe,d$ as Te,eh as xe,ei as Ue,cw as He,ak as N,k as U,ej as ze,P as V,dT as Ge,ek as Ve,cp as We,el as je,db as J,em as qe,en as $e,I as Ke,b as q,eo as Je,ep as Qe,cr as Xe,bS as Z,n as Ye,eq as ee,a0 as Ze,a8 as en}from"./hydrate.BcfGVx0L.js";import{dQ as nn,cm as tn,a5 as P,T as w,bb as H,dR as sn,dS as an,bm as R,dT as on,W as se,t as $,dz as rn,a4 as ln,dU as cn,dV as un,dt as dn,ai as pn,bk as hn,bl as vn}from"./utilities-previous.Cnwy8G2v.js";import{B as mn}from"./BillingAddressSelector.CcWBqd3Y.js";import{D as ne,u as ae,S as oe,a as re,R as yn,b as gn}from"./Middot.D2IL0UWw.js";import{u as fn,P as bn,a as kn,R as Cn,L as le,D as ce,b as ue,c as de,d as Ln}from"./components-DeliveryReviewMethods.BsNHxJXY.js";import{S as wn}from"./Section-SectionStyleOverride.CdNufRZ0.js";import{R as I,P as _n}from"./PaymentLine.HSjRrKhm.js";import{A as K}from"./utilities-stable-ref.dCtJn23l.js";import{a as Pn}from"./localization-index.C3Jg94aR.js";import{u as te}from"./hooks-useSuppressShopPayModalOnLoad.Cvo-K0z2.js";import"./app.DdDscdWN.js";import"./graphql-PaymentSessionMutation.C-nDEOnn.js";import"./shared-permissions.B59tuyWB.js";import"./hooks-useShopPayExternalAppContext.R6pnDxYu.js";import"./Choice.D9vYH2mX.js";import"./Checkbox.CdJzVizb.js";import"./BillingAddressForm.B1Xpg2b3.js";import"./FormLayout.UkTBTXMZ.js";import"./amazon-pay-useAmazonPayPaymentLine.X7jqQiq6.js";import"./PhoneField.rAEISard.js";import"./Popover.ZkMcWGfE.js";import"./EstimatedDeliveryContent.DhMNjS2y.js";import"./ShippingMethodRateLabel.D5IEFYQ5.js";import"./shipping-methods-consolidated-included.Cuff-UKu.js";import"./PaymentIcon.-ypvsmSq.js";import"./Theme-ThemeOverride.CSLUDabY.js";function An(){const{hasViolations:i,violations:t}=Be(tn);return Ee().value&&i&&!nn(t)}function Sn(){const i=M();return o(()=>{const{plan:t}=i.value;return t.greenPath.some(({id:n})=>n==="payment")})}function pe(){const i=P().buyerIdentity,{source:t}=w(),n=Me(),a=ie();return o(()=>{const s=i.value?.purchasingCompany,l=n.value;if(s){if(a.value)return"/information";if(l)return l}if(!H(t))return"/information"})}function In({showLoading:i,displayBillingAddress:t}){const n=P().buyerIdentity,{source:a,shop:{customerAccountLocationsUrl:s}}=w(),l=M(),u=ie(),r=sn();return o(()=>{const c=n.value?.purchasingCompany,y=a.type==="draftOrder",p=T(l.value.plan,"/information"),v=an(c);return i.value?!1:c&&(v||u.value)&&s&&!H(a)&&!y?!0:!r.value&&!t.value?!1:!!p})}function D({accessibilityLabel:i,href:t}){const{i18n:n}=w(),a=n.translate("review.blocks.change_link_label");return e(Oe,{href:t,accessibilityLabel:i,children:e(x,{children:a})})}const Nn=["firstName","lastName"];function Rn({hiddenFields:i,...t}){return{...t,hiddenFields:[...new Set([...i??[],...Nn])]}}function he({withWrappedAddress:i=!1,label:t}){const{i18n:n,source:a,checkout:s}=w(),l=P(),u=l.deliveryNext,r=R("deliveryNext"),c=s.proposal.facts.delivery??[],y=o(()=>on(u.value)),p=l.shippingAddress,v=R("shippingAddress"),m=o(()=>c.length>0?c[0].deliveryAddress:p.value),{shippingAddress:h,billingAddress:C}=se(),A=o(()=>u.value?.status==="unavailable"?h.value:m.value),{selectedPickupPoint:g}=Pn(),_=l.billingAddress,L=o(()=>_.value??C.value),d=P().buyerIdentity.value?.purchasingCompany,f=Te(),k=o(()=>v.value&&m.value==null),F=o(()=>H(a)?!xe({checkout:s}):!s.isShippingRequired.value),B=o(()=>F.value?L.value:A.value),O=Ue(),Q=fn({address:B}).value,S=B.value,ve=d&&F.value?n.translate("review.blocks.company_location"):n.translate("review.blocks.billing_address_title"),me=F.value?ve:n.translate("review.blocks.shipping_address_title"),ye=F.value?n.translate("review.blocks.change_billing_address_link_label"):n.translate("review.blocks.change_shipping_address_link_label"),z=d?.location;let G;if(Q)G=Q;else if(i)G={hiddenFields:["phone"],multiline:!0};else{const Y=S?.countryCode??g?.pickupLocation.address.countryCode;G=Y&&ze.includes(Y)?{hiddenFields:["phone"],multiline:!1}:{hiddenFields:["firstName","lastName","phone"],multiline:!1}}const ge={...Rn(G),multiline:!1},X=!!(z&&(r.value||S==null||$(S)||!O.value)),fe=X?z?.name:(()=>
1{if(!(S==null||$(S)||X))return n.formatName(S.firstName,S.lastName,!0)||S.firstName||S.lastName})(),be=He(g?.pickupLocation.address,{hiddenFields:["countryCode"]}),ke=g?.pickupLocation.name,Ce=n.translate("review.blocks.no_address"),Le=n.translate("pickup_point.title").toLowerCase(),we=z?s.isShippingRequired.value:!0,_e=f?.taxId.value,Pe=In({showLoading:k,displayBillingAddress:F}),Ae=pe(),Se=e(D,{href:Ae.value,accessibilityLabel:ye}),Ie=t??me,Ne=Pe.value?Se:void 0;let W=fe,j=e(Dn,{address:S,addressDetailsPresentationProps:ge,companyLocationName:z?.name,deliveryNextLoading:r.value,isOnetimeShippingAddress:O.value,noAddressLabel:Ce,showAddress:we,vatNumber:_e});return k.value?(W=e(N,{}),j=void 0):y.value&&(W=ke,j=e(Fn,{formattedAddress:be,pickupPoint:g,pickupPointLabel:Le})),e(I,{label:Ie,primaryAction:Ne,primaryContent:W,secondaryContent:j})}function Dn({address:i,addressDetailsPresentationProps:t,companyLocationName:n,deliveryNextLoading:a,isOnetimeShippingAddress:s,noAddressLabel:l,showAddress:u,vatNumber:r}){return a&&n?e(N,{}):i==null||$(i)?!u&&!r?null:e(U,{children:[u&&e(x,{size:"small",color:"subdued",children:l}),r&&e(ne,{vatNumber:r})]}):n&&!s?u?e(U,{children:e(K,{textColor:"subdued",textSize:"small",...t,address:i})}):null:e(U,{children:[e(K,{...t,address:i}),r&&e(ne,{vatNumber:r})]})}function Fn({formattedAddress:i,pickupPoint:t,pickupPointLabel:n}){if(!t)return null;const a=`${t.pickupLocation.carrierName} ${n}`;return e(U,{children:[i?e(x,{type:"address",children:i}):null,e(x,{color:"subdued",size:"small",children:a})]})}const Bn="#";function En(){const{i18n:i}=w(),{purchaseOrderNumber:t}=P(),n=R("purchaseOrderNumber"),a=o(()=>n.value&&t.value===void 0),s=i.translate("review.blocks.no_purchase_order_number_long"),l=o(()=>{const c=t.value;return c!==void 0&&c.trim()!==""?`${Bn}${c}`:void 0}),u=i.translate("review.blocks.purchase_order_number_title"),r=()=>e(D,{href:"/payment",accessibilityLabel:i.translate("review.blocks.change_purchase_order_number_label")});return e(b,{when:()=>!a.value,fallback:e(I,{label:u,primaryContent:e(N,{})}),children:e(b,{when:l,fallback:e(I,{label:u,primaryAction:r(),secondaryContent:e(V,{children:s})}),children:c=>e(I,{label:u,primaryAction:r(),primaryContent:e(bn,{children:c})})})})}function Mn(){const{i18n:i}=w(),t=pe(),a=P().buyerIdentity.value?.purchasingCompany?.location,s=Ge();if(!a)return null;const l=i.translate("company_location.location_title"),u=s.value?e(D,{href:t.value,accessibilityLabel:i.translate("contact.change_company_location_link_label")}):void 0,r=e(x,{children:a.name}),c=a.shippingAddress?e(K,{hiddenFields:Ve,address:a.shippingAddress}):e(x,{children:i.translate("review.blocks.no_address")});return e(I,{label:l,primaryAction:u,primaryContent:r,secondaryContent:c})}function On(){const{i18n:i,checkout:t}=w(),{contactInfo:n}=P(),a=R("contactInfo"),{geolocation:s}=We(),{buyerIdentity:l}=P(),u=M();kn(a.value);const r=t.proposal.facts.contactMethod?.phoneNumber,{formattedNumber:c}=te(s.country.code,r??void 0),{formattedNumber:y}=te(s.country.code,n.value?.phone),p=o(()=>a.value&&(n.value?.email??n.value?.phone)==null),v=o(()=>!p.value&&T(u.value.plan,"/information")&&!l.value?.purchasingCompany),m=o(()=>{const g=t.proposal.facts.contactMethod?.email,_=c===""?void 0:c,L=n.value?.email;return g||_||L||(y===""?void 0:y)}),h=i.translate("review.blocks.contact_method_title"),C=v.value?e(D,{href:"/information",accessibilityLabel:i.translate("review.blocks.change_contact_method_link_label")}):void 0;return e(I,{label:h,primaryAction:C,primaryContent:e(b,{when:()=>!p.value,fallback:e(N,{}),children:()=>e(Cn,{contactInfo:m.value})})})}function Tn(){const{checkout:i,i18n:t,source:n}=w(),a=M(),s=P().deliveryNext,l=R("deliveryNext"),u=n.type==="draftOrder",r=o(()=>rn(s.value)),c=je(),y=ae({deliveryLines:s.value?.status==="filled"?s.value.lines:void 0}),p=o(()=>J({checkout:i,source:n})),v=o(()=>p.value?.pickupAddress?p.value.pickupAddress:!s.value||s.value.status==="unavailable"?void 0:r.value?.map(O=>O.pickupLocation?.address).filter(O=>O!==void 0)?.[0]),m=o(()=>{if(!(!s.value||s.value.status==="unavailable"))return p.value?p.value.pickupAddressName:r.value?.find(({methodType:B})=>B==="PICK_UP")?.pickupLocation?.name}),h=o(()=>!!(r.value?.some(({methodType:B})=>B==="PICK_UP")||p.value?.pickupAddress)),C=o(()=>h.value?"/information":"/shipping"),A=o(()=>!c.value&&!u&&(!H(n)&&T(a.value.plan,C.value)||H(n)&&h.value)),g=o(()=>h.value?t.translate("review.blocks.change_delivery_method_link_label"):t.translate("review.blocks.change_shipping_method_link_label")),_=A.value?e(D,{href:C.value,accessibilityLabel:g.value}):void 0,L=t.translate("shipping.title"),d=t.translate("delivery_options.pickup"),f=h.value?d:L,k=e(xn,{showSkeleton:l.value&&!s.value,splitShippingRollupSummary:y,isLocalPickupSelected:h.value,pickupLocationName:m.value}),F=e(Un,{showSkeleton:l.value&&!s.value,splitShippingRollupSummary:y,isLocalPickupSelected:h.value,pickupAddress:v.value,pickupLocationName:m.value});return e(I,{label:f,primaryAction:_,primaryContent:k,secondaryContent:F})}function xn({showSkeleton:i,splitShippingRollupSummary:t,isLocalPickupSelected:n,pickupLocationName:a}){return i?e(N,{}):t?e(oe,{summary:t}):n?e(le,{pickupLocationName:a}):e(ce,{})}function Un({showSkeleton:i,splitShippingRollupSummary:t,isLocalPickupSelected:n,pickupAddress:a,pickupLocationName:s}){return i?e(N,{}):t?e(re,{summary:t}):n?e(ue,{address:a,pickupLocationName:s}):e(de,{})}function Hn(){const{i18n:i}=w(),{acceptPaymentVaulting:t,paymentLines:n}=se(),a=R("paymentLines"),s=R("shippingAddress"),l=M(),u=qe(),r=$e(u.value),c=ln(),y=o(()=>{const d=n.value;return d?cn(un(d,c.value)).map((f,k)=>({key:`${f.method.type}-${k+1}`,line:f})):[]}),p=o(()=>n.value?.some(d=>d.method.type==="direct")),v=o(()=>!a.value&&n.value!=null&&!s.value),m=o(()=>!n.value?.some(f=>f.method.type==="deferred")),h=o(()=>!!(t.value&&p.value)),A=o(()=>T(l.value.plan,"/payment")&&v.value).value?e(D,{href:"/payment",accessibilityLabel:i.translate("review.blocks.change_payment_method_link_label")}):void 0,g=i.translate("payment.title"),_=e(b,{when:v,fallback:e(N,{}),children:e(Re,{each:y,getKey:d=>d.key,children:({line:d})=>e(E,{children:[e(_n,{paymentLine:d,showCardBrandLabel:!0}),e(q,{blockSize:"small-400"})]})})});let L;return(m.value||h.value)&&(L=v.value?e(E,{children:[e(b,{when:m,children:e(V,{children:r})}),e(b,{when:h,children:e(U,{direction:"inline",gap:"small-400",alignItems:"center",children:[e(Ke,{type:"check",size:"small"}
1),e(V,{children:i.translate("review.blocks.payment_method_saved_company_location")})]})})]}):e(N,{})),e(I,{label:g,primaryAction:A,primaryContent:_,secondaryContent:L})}function zn(){const{checkout:i,i18n:t,source:n}=w(),{deliveryNext:a}=P(),s=Je(),l=M(),{value:u}=a,r=R("deliveryNext").value,c=ae({deliveryLines:u?.status==="filled"?u.lines:void 0}),p=dn(u).find(({method:k})=>k.methodType==="PICK_UP"),v=T(l.value.plan,"/information")?e(D,{href:"/information",accessibilityLabel:t.translate("review.blocks.change_shipping_address_link_label")}):void 0,m=T(l.value.plan,"/shipping")?e(D,{href:"/shipping",accessibilityLabel:t.translate("review.blocks.change_shipping_method_link_label")}):void 0,h=c?e(oe,{summary:c}):void 0,C=c?e(re,{summary:c}):void 0,A=p?.method.pickupLocation?.address,g=J({checkout:i,source:n})?.pickupAddressName??p?.method.pickupLocation?.name,_=e(le,{pickupLocationName:g}),L=e(ue,{address:A,pickupLocationName:g});let d,f;return r?(d=e(N,{}),f=e(N,{})):(d=h??e(ce,{}),f=C??e(de,{})),e(E,{children:[e(I,{label:t.translate("review.blocks.pickup_items_at",{count:s.value.PICK_UP||0}),primaryAction:v,primaryContent:_,secondaryContent:L}),e(b,{when:()=>s.value.SHIPPING,children:k=>e(E,{children:[e(he,{label:t.translate("review.blocks.ship_items_to",{count:k})}),e(I,{label:t.translate("shipping.title"),primaryAction:m,primaryContent:d,secondaryContent:f})]})})]})}function Gn(){const i=Qe(),{checkout:t,router:n,source:a}=w();return o(()=>{const s=J({checkout:t,source:a}),l=s&&s.lines.length===0;return(n.currentUrlMatches("/payment")||n.currentUrlMatches("/review"))&&!i.value&&!l&&t.isShippingRequired.value})}function gt({showPayment:i,showAddress:t=!0}){const{i18n:n,shop:a}=w(),s=M(),l=a.hasFlagEnabled(pn),{buyerIdentity:u}=P(),r=o(()=>s.value?.currentPage?.id==="review"),c=hn(),y=o(()=>!r.value||!c.value),p=o(()=>{if(y.value)return r.value?Z:ee}),v=o(()=>r.value&&!c.value?n.translate("review.review_title"):n.translate("review.title")),[m,h]=De(!1),C=An(),A=Gn(),g=Xe();Fe(()=>{!m&&C&&h(!0)},[C,m]);const _=Sn(),L=o(()=>u.value?.purchasingCompany!==void 0&&_.value),d=e(E,{children:[t&&e(he,{withWrappedAddress:r.value}),!t&&e(b,{when:()=>u.value?.purchasingCompany,children:e(Mn,{})}),e(b,{when:A,children:e(Tn,{})})]}),f=e(Ln,{accessibilityLabel:n.translate("review.block_title"),renderAsCard:l,children:[e(On,{}),e(b,{when:g,fallback:d,children:e(zn,{})}),i?e(Hn,{}):null,e(b,{when:()=>L.value&&r.value,children:e(En,{})})]}),k=e(b,{when:y,fallback:f,children:e(en,{children:f})});return e(Ze,{accessibilityLabel:p.value===void 0?v.value:void 0,accessibilityLabelledBy:p.value,children:[e(b,{when:r,children:e(E,{children:[e(yn,{id:Z}),vn("review.review_notice_html",n)?e(V,{children:e(gn,{})}):null,e(q,{blockSize:"large-200"})]})}),e(b,{when:()=>!r.value,children:e(Ye,{id:ee,visibility:"hidden",children:v.value})}),l?e(wn,{target:"edgeToEdgeCard",children:k}):k,m&&e(E,{children:[e(q,{blockSize:"base"}),e(mn,{})]})]})}export{gt as default};
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.