1import{u as e,S as a,k as i,T as n,w as r,H as t,q as s}from"./2c1ab0fe.Bywc2Brn.js";import{cB as l,j as o,G as c,L as d,di as p,el as u,S as m,eM as h,cv as v,f as b,eq as y,en as f,cx as g,b as _,eo as k,ep as w,a1 as C,l as j,v as A,er as N,ec as L,p as P,o as I,eN as S,d as R,af as D,ag as x,i as z,U as B,bd as F,ai as M,ao as E}from"./164ad2e3.DZSd7pLX.js";import{c as O,b9 as T,dx as q,bL as U,K,cH as G,bt as H,dy as $,dz as V,ac as Z,dT as J,ab as W,aR as X,J as Y,ag as Q,ae as ee,b8 as ae}from"./4b4bc88f.C26USmk8.js";import{C as ie}from"./b3389d5c.DbStXD7Y.js";import{R as ne,P as re}from"./e77f7fe0.ucQ926NO.js";import{D as te,u as se}from"./0e9ee714.BN1p7a14.js";import{c as le,u as oe,a as ce,R as de,b as pe,D as ue,P as me}from"./60575ca1.BY04AwPR.js";import{P as he}from"./fc21c11a.BTdpkxz4.js";import{P as ve}from"./e3e348f2.D2E-Dtt_.js";import{D as be,u as ye,a as fe,S as ge,R as _e,b as ke}from"./910cd6e2.CdoCkmtO.js";import{a as we,L as Ce,R as je}from"./03fde911.BnXW4P-d.js";import{M as Ae,S as Ne,a as Le}from"./dfca5da5.DO4nAhLG.js";import{S as Pe}from"./79974aab.DaZOEwGE.js";import{MobileOrderSummary as Ie}from"./d2e6a587.D_77Lmvs.js";import{u as Se}from"./e129c76e.pkv8K8Le.js";import{u as Re,S as De}from"./71ae3d5c.CT21Fulh.js";import{h as xe,u as ze}from"./17425706.CtaKzzog.js";import{A as Be}from"./4b1c22b7.BoKf5l9E.js";import{d as Fe}from"./24773686.CaAVXUiT.js";import{u as Me}from"./160e80e7.BpodyEzN.js";import{a as Ee}from"./22345fd4.9vcjBj8J.js";import"./d0bb51ec.-Od_3rgw.js";import"./app.DRs7v1W8.js";import"./f67abd2c.vvptRNe9.js";import"./60a453ce.Bo_pHupz.js";import"./e12db40c.J_ouQ898.js";import"./9dba8418.BzGnZlrB.js";import"./598fef4e.0s9DNJyq.js";import"./39921a74.DYnLAd5t.js";import"./ccdf3592.DMzipudw.js";import"./71b60e0a.DfPLdYsH.js";import"./1f5e7811.BFK0fqzB.js";import"./ec391382.Cdv-WKBN.js";import"./347b440c.C1_1cjnS.js";import"./9ce08e25.Olf3Esll.js";import"./7a8217fd.CFcj7rrg.js";import"./8599b02a.CvNpIvqP.js";import"./e477f96c.C6fFzpZx.js";import"./1ed8f5e3.CzhdrJHY.js";import"./7ee73f43.D11Matm5.js";import"./cb5cf153.DnU9t5IG.js";import"./cb38e5c2.BhWVCtRR.js";import"./0c0ad074.RCwQbH01.js";import"./bf513f9c.CCBvccYL.js";import"./87bfafec.CxwEzGHg.js";import"./434e3b0a.B1BBnK_d.js";import"./55098bf1.DXcUuNz_.js";import"./181d38d3.CJ-3Gmk5.js";import"./792bb671.B3OvVnSg.js";import"./dae24aab.DshQXsWO.js";import"./2495faa4.D3uf12cS.js";import"./7b0c98ea.wJBUDVvK.js";import"./945a08d6.VZGO8GHT.js";import"./78ab3dd0.hruEgq0z.js";import"./d4ea2faa.DFrX4G1p.js";import"./fe885b80.4u7Ja5rL.js";import"./f78726c8.BaX6C3hQ.js";function Oe(){const{checkout:i}=O(),n=i.negotiator.parts.shippingAddress.value,{value:r}=i.negotiator.current.fields.deliveryNext,t=i.proposal.facts.delivery??[],s=t[0],l=i.negotiator.current.fields.buyerIdentity.value?.purchasingCompany;if(!(t.length&&s?.lines?.length||i.isShippingRequired.value))return null;if(!s)return null;if(s.pickupAddress)return e(Ue,{address:s.pickupAddress??void 0,locationName:s.pickupAddressName});const o="unavailable"===r?.status?n:s.deliveryAddress,c=r&&"unavailable"!==r.status?r.lines.find(e=>"SUBSCRIPTION"!==e.type&&"available"===e.status&&!e.methods.some(({methodType:e})=>"PICK_UP"===e)):void 0;return e(a,{children:[e(qe,{shippingAddress:o??void 0,companyLocationName:l?.location.name}),e(Te,{lines:s.lines,secondaryDeliveryLine:c})]})}function Te({lines:a,secondaryDeliveryLine:i}){const{i18n:n,source:r}=O(),t=a.filter(({deliveryChange:e,isFulfilled:a})=>"REMOVED"!==e&&!a).map(a=>e(te,{line:a},a.title));return t.length?e(ne,{id:"shipping",label:n.translate("shipping.title"),primaryContent:t,secondaryContent:"paymentCollection"!==r.type&&i?e(le,{line:i}):void 0}):null}function qe({shippingAddress:a,companyLocationName:i}){const{i18n:n}=O(),r=l(a,{countryFormat:"explicit",displayName:Boolean(i)}),t=n.formatName(a?.firstName,a?.lastName,!0)||a?.firstName||a?.lastName,s=n.translate("review.blocks.no_address"),{primaryContent:d,secondaryContent:p}=i?{primaryContent:i,secondaryContent:a?r:s}:{primaryContent:a?t:s,secondaryContent:a?r:void 0},u=d?e(o,{children:d}):void 0;let m;return a&&null==r?m=e(c,{}):a&&p?m=e(o,{type:"address",children:p}):p&&(m=e(o,{children:p})),e(ne,{id:"address",label:n.translate("review.blocks.shipping_address_title"),primaryContent:u,secondaryContent:m})}function Ue({address:a,locationName:i}){const{i18n:n}=O(),r=l(a,{hiddenFields:["postalCode","countryCode","phone"]});return i&&r?e(ne,{id:"delivery",label:n.translate("review.blocks.pick_up_in_store_shipping_method_html",{location_name:i}),primaryContent:e(o,{children:r})}):null}function Ke({accessibilityLabel:a,children:i,href:n}){const{checkout:{identity:r}}=O(),{onClick:t}=Fe(),s=function({href:e,identity:a,amazonPayCheckoutAsGuest:i}){return"#contact"!==e||"amazonPay"!==a.current.value?void 0:()=>i?.()}({href:n,identity:r,amazonPayCheckoutAsGuest:t});return e(d,{href:n?`/${n}`:"/",onClick:s,accessibilityLabel:a,children:i})}const Ge=["firstName","lastName"];function He({showAdressReviewItemAction:a=!0,reviewItemLabel:n,addressPresenterProps:r}){const{i18n:t,checkout:s}=O(),o=s.negotiator.current.fields.deliveryNext,d=s.proposal.facts.delivery??[],m=s.negotiator.current.fields.shippingAddress,h=T("shippingAddress"),v=i(()=>d.length>0?d[0].deliveryAddress:m.value),b=i(()=>q(o.value)),{shippingAddress:y,billingAddress:f}=s.negotiator.parts,g=i(()=>"unavailable"===o.value?.status?y.value:v.value),{selectedPickupPoint:_}=Me(),k=i(()=>!s.isShippingRequired.value),w=i(()=>k.value?f.value:g.value),C=p(),j=s.negotiator.current.fields.buyerIdentity.value?.purchasingCompany,A=j?.location,N=u(),L=oe({address:w}).value,P=w.value,I=L??{hiddenFields:["phone"],multiline:!1,...r},S=function({hiddenFields:e,...a}){return{...a,hiddenFields:[...new Set([...e??[],...Ge])]}}
1(I),R=Boolean(A&&(null==P||U(P)||!N.value)),D=l(_?.pickupLocation.address,{hiddenFields:["countryCode"]}),x=k.value?t.translate("review.blocks.billing_address_title"):t.translate("review.blocks.shipping_address_title"),z=k.value?t.translate("review.blocks.change_billing_address_link_label"):t.translate("review.blocks.change_shipping_address_link_label"),B=e(Ke,{href:"#deliveryAddress",accessibilityLabel:z,children:t.translate("review.blocks.change_link_label")}),F=t.translate("review.blocks.no_address"),M=t.translate("pickup_point.title").toLowerCase(),E=C?.taxId.value;let K=R?A?.name:(()=>{if(null==P||U(P)||R)return;const e=I.hiddenFields??[],a=e.includes("firstName")?void 0:P.firstName,i=e.includes("lastName")?void 0:P.lastName;return t.formatName(a,i,!0)||a||i})(),G=e($e,{address:P,hasCompanyLocation:Boolean(A),noAddressLabel:F,secondaryAddressPresentationProps:S,vatNumber:E});return h.value?(K=e(c,{}),G=void 0):b.value&&(K=_?.pickupLocation.name,G=e(Ve,{formattedAddress:D,pickupPoint:_,pickupPointLabel:M})),e(ne,{label:n||x,primaryAction:a?B:void 0,primaryContent:K,secondaryContent:G})}function $e({address:a,hasCompanyLocation:i,noAddressLabel:n,secondaryAddressPresentationProps:r,vatNumber:t}
1){return null==a||U(a)?e(m,{children:[e(o,{color:"subdued",children:n}),t&&e(be,{vatNumber:t})]}):e(m,i?{children:e(Be,{...r,address:a})}:{children:[e(Be,{...r,address:a}),t&&e(be,{vatNumber:t})]})}function Ve({formattedAddress:a,pickupPoint:i,pickupPointLabel:n}){if(!i)return null;const r=`${i.pickupLocation.carrierName} ${n}`;return e(m,{children:[a?e(o,{type:"address",children:a}):null,e(o,{color:"subdued",size:"small",children:r})]})}function Ze({purchasingCompany:a}){const{i18n:i}=O(),{secondary:n}=h({address:a.location.shippingAddress??{},nameLinePosition:"inline",addressDisplayName:a.location.name});if(!K(a))return null;const r=i.translate("review.blocks.company_location"),t=e(Ke,{href:"#billingAddress",accessibilityLabel:i.translate("review.blocks.change_company_location_link_label"),children:i.translate("review.blocks.change_link_label")}),s=a.location.shippingAddress?n:i.translate("review.blocks.no_address"),l=e(o,{children:a.location.name});return e(ne,{label:r,primaryAction:t,primaryContent:l,secondaryContent:e(o,{children:s})})}function Je({companyName:a}){const{i18n:i,checkout:n}=O(),{value:r}=n.negotiator.current.fields.contactInfo,t=T("contactInfo").value,s=n.proposal.facts.contactMethod,{geolocation:l}=v(),d=n.negotiator.current.fields.buyerIdentity.value?.purchasingCompany;ce(t);const{email:p,phone:u}=r??{},{email:m,phoneNumber:h}=s??{},{formattedNumber:y}=Ee(l.country.code,h??void 0),{formattedNumber:f}=Ee(l.country.code,u),g=t&&null==(p??u),_=m||y||p||f,k=i.translate("customer_account.rollup_label");if(!_&&!t)return null;const w=a?k:i.translate("review.blocks.contact_method_title"),C=d?e(de,{contactInfo:_}):e(b,{lineClamp:1,children:e(o,{dir:"ltr",children:_})}),j=g?e(c,{}):C,A=g||d?void 0:e(Ke,{href:"#contact",accessibilityLabel:i.translate("review.blocks.change_contact_method_link_label"),children:i.translate("review.blocks.change_link_label")});return e(ne,{id:"contact",label:w,primaryAction:A,primaryContent:j})}function We(){const{i18n:a,checkout:{negotiator:i}}=O(),{value:t}=i.current.fields.deliveryNext,s=T("deliveryNext").value,l=n(()=>G(t),[t]),d=y(),p=f().value,u=g(),m=n(()=>{if(t&&"unavailable"!==t.status)return l?.find(({methodType:e})=>"PICK_UP"===e)?.pickupLocation},[t,l]),h=m?.address,v=m?.name,b=Boolean(l?.some(({methodType:e})=>"PICK_UP"===e)),k=ye({deliveryLines:s||"filled"!==t?.status?void 0:t.lines}),w=b?a.translate("local_pickup.title"):a.translate("shipping.title");if(s&&!t)return e(ne,{label:w,primaryContent:e(c,{})});const C=p||s?null:e(Ke,{href:"#shippingMethod",accessibilityLabel:b?a.translate("review.blocks.change_delivery_method_link_label"):a.translate("review.blocks.change_shipping_method_link_label"),children:a.translate("review.blocks.change_link_label")}),j=k?e(ge,{summary:k}):void 0,A=k?e(fe,{summary:k}):void 0,N=e(ne,{label:w,primaryAction:C,primaryContent:j??(b?e(Ce,{pickupLocationName:v}):e(ue,{})),secondaryContent:A??(b?e(we,{address:h,pickupLocationName:v}):e(pe,{}))}),L=e(o,{color:"subdued",children:a.translate("review.blocks.no_address")}),P=h?e(_,{maxInlineSize:"300px",children:e(Ce,{pickupLocationName:v})}):L,I=h?e(_,{maxInlineSize:"300px",children:e(we,{address:h,pickupLocationName:v})}):void 0,S=e(Ke,{href:"#deliveryAddress",accessibilityLabel:a.translate("review.blocks.change_delivery_method_link_label"),children:a.translate("review.blocks.change_link_label")}),R=a.translate("review.blocks.pickup_items_at",{count:d.value.PICK_UP||0}),D=p||s?null:e(Ke,{href:"#shippingMethod",accessibilityLabel:a.translate("review.blocks.change_shipping_method_link_label"),children:a.translate("review.blocks.change_link_label")});return e(r,{when:u,fallback:N,children:[e(ne,{label:R,primaryAction:S,primaryContent:P,secondaryContent:I}),e(r,{when:()=>d.value.SHIPPING,children:i=>e(He,{reviewItemLabel:a.translate("review.blocks.ship_items_to",{count:i}),addressPresenterProps:{hiddenFields:["phone","company","firstName","lastName"]}})}),e(ne,{label:a.translate("shipping.title"),primaryAction:D,primaryContent:j??e(ue,{}),secondaryContent:A??e(pe,{})})]})}function Xe(){const{i18n:a,checkout:{negotiator:n}}=O(),{acceptPaymentVaulting:s,paymentLines:l}=n.parts,d=T("paymentLines"),p=T("shippingAddress"),u=H(),h=k(),v=w(h.value),y=i(()=>!d.value&&null!=l.value&&!p.value),f=i(()=>{const e=l.value;return e?$(V(e,u.value)):[]}),g=i(()=>Boolean(l.value?.some(e=>"direct"===e.method.type))),j=i(()=>{const e=l.value?.some(e=>"deferred"===e.method.type);return!e}),A=i(()=>Boolean(s.value&&g.value)),N=a.translate("payment.title"),L=e(t,{each:f,children:a=>e(re,{paymentLine:a,showCardBrandLabel:!0})}),P=y.value?e(Ke,{href:"#payment",accessibilityLabel:a.translate("review.blocks.change_payment_method_link_label"),children:e(o,{children:a.translate("review.blocks.change_link_label")})}):void 0,I=e(r,{when:y,fallback:e(c,{}),children:e(m,{gap:"small-400",children:L})});let S;return(j.value||A.value)&&(S=e(_,{padding:"small-500 none none none",children:e(r,{when:y,fallback:e(c,{}),children:e(m,{gap:"small-400",children:[e(r,{when:j,children:e(b,{children:v})}),e(r,{when:A,children:e(m,{direction:"inline",gap:"small-400",alignItems:"center",children:[e(C,{type:"check",size:"small"}
1),e(b,{children:a.translate("review.blocks.payment_method_saved_company_location")})]})})]})})})),e(ne,{id:"payment",label:N,primaryAction:P,primaryContent:I,secondaryContent:S})}function Ye(){const{i18n:a,checkout:{negotiator:n}}=O(),r=n.current.fields.purchaseOrderNumber,t=i(()=>r.value?.trim()?`#${r.value}`:void 0),s=a.translate("review.blocks.no_purchase_order_number_long"),l=t.value,c=l?e(me,{children:l}):void 0,d=l?void 0:e(b,{children:s}),p=e(Ke,{accessibilityLabel:a.translate("review.blocks.change_purchase_order_number_label"),href:"#payment",children:e(o,{children:a.translate("review.blocks.change_link_label")})}),u=a.translate("review.blocks.purchase_order_number_title");return e(ne,{id:"purchaseOrder",label:u,primaryAction:p,primaryContent:c,secondaryContent:d})}function Qe(){Re({stage:De.Complete,id:"Review"});const{checkout:a,i18n:n,shop:t,source:l}=O(),o=t.hasFlagEnabled(Z),c=a.configuration.visibility.showAside,{main:{spacing:d}}=j(),{progress:p}=A(),u=s(()=>p("one-page-review-submit"),[p]),h=se(u),v=xe("review.review_notice_html",n),y=a.negotiator.current.fields.deliveryNext,f=a.negotiator.current.fields.paymentLines,_=J(),k=T("total"),w=T("paymentLines"),C=a.proposal.facts.delivery??[],E=N(),q=a.negotiator.current.fields.buyerIdentity,U=W(),K=Se(),G=g(),H=a.configuration.showContactInformation,$=L(),V=i(()=>X(y.value)||C.length>0&&C.every(e=>null!==e.pickupAddress)),ae=i(()=>a.isShippingRequired.value&&!V.value),ne=i(()=>q.value?.purchasingCompany?a.isShippingRequired.value&&!E.value:a.isShippingRequired.value),re=i(()=>Boolean(_.value&&_.value.amount>0)||f.value?.lines.some(e=>e.cost?.amount)),te=i(()=>Boolean(k.value||w.value||!_.value||re.value)),le=ze(),oe=i(()=>!q.value?.purchasingCompany||le.value),ce=Y(l),de=Q(),pe=P({base:!0,medium:!1}),ue=!de.value||(pe??!1),me=I("Checkout::Dynamic::Render","ORDER_SUMMARY4"),be=e(Le,{condition:!ue&&!o,hideDivider:!0,children:[e(Ae,{condition:ue&&!o,hideDivider:!!o||void 0,children:[e(m,{gap:"small-400",children:[e(r,{when:()=>ce,children:[e(S,{}),e(R,{blockSize:"base"})]}),e(_e,{}),e(r,{when:()=>v,children:e(b,{type:"small",color:"subdued",children:e(ke,{})})})]}),e(R,{blockSize:"large-200"}),e(aa,{renderAsCard:o,children:e(ea,{buyerIdentity:q,isOrderEditSession:ce,showContactInformation:H,showPayment:te,showShippingAddress:ae,showAddressReviewItemAction:oe,showDeliveryMethod:ne,isSplitShipAndPickup:G})})]}),o&&e(Ne,{spacing:ue?ee(d):"large-400"}),e(r,{when:U,children:e(Le,{condition:ue&&!o,children:[e(ve,{placement:"default"}),e(R,{blockSize:"base"})]})}),e(Le,{condition:ue&&!o,hideDivider:!0,children:e(D,{section:"review",children:e(x,{section:"review",children:e(m,{gap:"base",children:[o?e(Pe,{target:"card",children:e(z,{accessibilityRole:"presentation",display:c?"@media (inline-size >= medium) none, auto":void 0,children:e(Ie,{})})}):e(Ie,{}),e(m,{gap:"large-200",children:[e(r,{when:K,children:e(ie,{})}),e(r,{when:U,children:e(ve,{placement:"above-pay-button"})}),e(he,{buttonHidden:$}),e(r,{when:()=>ue,children:e(B,{customizations:me,gap:"large-200"})})]})]})})})})]});return e(M,{onSubmit:h,children:o?e(F,{children:e(z,{accessibilityRole:"presentation",containerName:"s-shell-section",children:be})}):be})}function ea({buyerIdentity:n,isOrderEditSession:t,showContactInformation:s,showPayment:l,showShippingAddress:o,showAddressReviewItemAction:c,showDeliveryMethod:d,isSplitShipAndPickup:p}){const u=i(()=>n.value?.purchasingCompany?.company?.name),m=i(()=>Boolean(n.value?.purchasingCompany)),h=i(()=>o.value&&!p.value),v=i(()=>o.value?void 0:n.value?.purchasingCompany);return e(a,{children:[s&&e(Je,{companyName:u.value}),e(a,t?{children:[e(Oe,{}),e(r,{when:l,children:e(Xe,{})}),e(r,{when:m,children:e(Ye,{})})]}:{children:[e(r,{when:h,children:e(He,{showAdressReviewItemAction:c.value})}),e(r,{when:d,children:e(We,{})}),e(r,{when:v,children:a=>e(Ze,{purchasingCompany:a})}),e(r,{when:l,children:e(Xe,{})}),e(r,{when:m,children:e(Ye,{})})]})]})}function aa({children:a,renderAsCard:i=!1}){const{i18n:n}=O(),t=ae(),s=n.translate("review.block_title"),l=e(je,{accessibilityLabel:s,renderAsCard:i,children:a}),o=e(r,{when:()=>!t.value,fallback:l,children:e(E,{children:l})});return i?e(Pe,{target:"edgeToEdgeCard",children:o}):o}export{aa as ReviewItems,Qe 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.