1import{u as e,o as a,w as t,S as r,T as i,h as s,z as n,p as o,q as l,k as d}from"./2c1ab0fe.Bywc2Brn.js";import{da as c,L as u,S as p,a1 as m,j as h,b,R as f,o as g,U as v,i as j,aa as y,a9 as S,bx as C,d as P,db as _,dc as R,aM as k,dd as A,de as I,ab as D,f as M,df as w,dg as N,G as E,dh as T,di as x,d0 as z,s as F,dj as L,dk as V,r as O,bT as G,al as B,dl as U}from"./164ad2e3.CZ86Jn5i.js";import{b as H,c as K,d as W,G as $}from"./f3fe2775.CHppPYrI.js";import{c as q,aM as J,cD as Q,b5 as Y,cE as X,W as Z,a5 as ee,b8 as ae,af as te,cF as re,cG as ie,cH as se,cI as ne,u as oe}from"./9dba8418.ogFVeXB5.js";import{u as le,R as de,M as ce,a as ue,b as pe,i as me,O as he,c as be}from"./f8706cb6.mPiOoqgF.js";import{K as fe}from"./dfc03c53.XWrUp_Mu.js";import{W as ge,P as ve,g as je,a as ye}from"./c10167e6.CSnsiKJv.js";import{e as Se,V as Ce,B as Pe}from"./86720dbb.uEJkn5aN.js";import{a as _e}from"./f692f62f.RtrT6cYJ.js";import{DeliveryAddressEdit as Re}from"./91811554.BoasJVig.js";import{b as ke,C as Ae}from"./efa0389a.DH9Ee_M-.js";import{C as Ie}from"./a422df8c.B9kUsb7g.js";import{C as De}from"./74835653.CVh949GJ.js";import{P as Me}from"./47b970b2.Dz-jBj6A.js";import{V as we,u as Ne,P as Ee,I as Te,a as xe,b as ze,S as Fe,L as Le}from"./dffdfb34.CdA0NMZv.js";import{C as Ve}from"./4b1c22b7.Ds2WGmWm.js";import{m as Oe}from"./21cc90a2.DHzOO82q.js";import{u as Ge}from"./64de7b49.ChWquPX6.js";import{h as Be}from"./17425706.Dglbz84O.js";import"./d0bb51ec.DFDQ8Mc_.js";import"./app.DWJ9FfA1.js";import"./f67abd2c.LtwWKIr5.js";import"./60a453ce.CcyvSWbx.js";import"./e12db40c.B9ahJFAB.js";import"./ac5a19ff.BZSGZdnW.js";import"./598fef4e.DSAd8e9l.js";import"./e77f7fe0.Bb-t4Dg5.js";import"./22345fd4.gEtcWjYq.js";import"./cc6ff67d.b-RPC7-m.js";import"./08a3b809.amBLe9xd.js";import"./d25d1b95.BebpfFB8.js";import"./bf513f9c.wW-N-9yS.js";import"./e39bc11c.BD41VQ04.js";import"./7a8217fd.D7XvILAP.js";import"./8599b02a.BwMQ3GGP.js";import"./cf29e63b.B0ZvKJTY.js";import"./0e9ee714.DmfOTS-o.js";import"./39921a74.BtGvlOAG.js";import"./e3e348f2.Krefqpnj.js";import"./71ae3d5c.D0Y3V6pk.js";import"./ccdf3592.DDsFqWmj.js";import"./2bac2c53.BWpgDRdR.js";import"./71b60e0a.DfPLdYsH.js";import"./24773686.BN3rGjti.js";import"./1f5e7811.BSn0CeW0.js";import"./ec391382.DNiaG7XB.js";import"./dfca5da5.BykJKV0N.js";import"./dae24aab.DshQXsWO.js";import"./79974aab.DreO813u.js";import"./2495faa4.apuslPn9.js";import"./0e67bd3b.BMmt4RQK.js";import"./a25deb9a.DoQth6Ve.js";import"./01973ac7.Cify3x0P.js";import"./58314944.jAbgQ7x6.js";import"./945a08d6.2aVG8xpL.js";import"./7bc8057b.Dqf7vuj_.js";import"./f1968089.CXll6zGd.js";import"./2b89a178.BqCt8Ycn.js";import"./b684bff6.rsXToKYt.js";import"./064f6ac1.CarL-NVS.js";import"./6fb6f9d8.aZwr-amY.js";import"./cb38e5c2.BfOFT2qH.js";import"./1444e6bd.nTYcj6dN.js";import"./cb5cf153.DqAeiWvs.js";import"./55098bf1.BfKJQGMW.js";import"./ed9f2238.Bp09ppK6.js";import"./78ab3dd0.bWleYB9t.js";import"./910cd6e2.DGTOobnp.js";import"./347b440c.Drqv7G4C.js";import"./9ce08e25.B1j_T_wC.js";import"./181d38d3.SlPAvY4z.js";import"./792bb671.B3OvVnSg.js";import"./d6447d9e.CtKH1LYl.js";import"./f49d4216.j73Ti3Uf.js";import"./f51e663e.G3kBqFIi.js";import"./8e79be58.6QYgGZuO.js";import"./3ca8ef7e.C60WvJE8.js";import"./90e26f5f.DBQ68JUp.js";import"./31cc568e.95lmLO5k.js";import"./65f3d4da.Bb3QiqCm.js";import"./2fdb3dd3.DjsPYeNf.js";import"./ca5e9c49.GLwCPRLK.js";
1import"./f3e117aa.2SdjXTsf.js";import"./1d34c07e.h4dJAaCz.js";import"./7b0c98ea.B7Ow199P.js";import"./434e3b0a.B1BBnK_d.js";import"./50130ded.BLdnzqo5.js";import"./b9c0319a.Bdfa0_Zv.js";import"./17e57de1.B_nQLFIZ.js";import"./9babe369.D342A3FZ.js";import"./a9fa9fda.BVLUAUfd.js";import"./ca3e798e.Dc9DtEXz.js";import"./0b8657b8.IYwAcXyW.js";import"./d22d2b80.C1CVQuhE.js";function Ue({openRedeemablesModal:a,includeStoreCredit:t=!0}){const{checkout:r,i18n:i}=q(),s=H(),n=K(s),o=W(),{canApplyGiftCards:l}=c(),{value:d}=J(),f=d?.amount||0,g=t&&r.configuration.visibility.showStoreCreditRedemption.value&&0===o.value.length&&n.value;if(!g&&!l||0===f)return null;let v="";return v=l&&g?i.translate("payment.gift_card_store_credit.add_label"):l?i.translate("payment.gift_card_wrapper.add_label"):i.translate("payment.store_credit.add_label"),e(b,{padding:"none small-100",children:e(u,{onClick:a,textDecoration:"none",children:e(p,{direction:"inline",gap:"small-100",alignItems:"center",children:[e(m,{type:"plus",size:"base"}),e(h,{children:v})]})})})}const He={VALIDATION_ERROR:"Please check your information and try again",SHIPPING_UNAVAILABLE:"Shipping is not available to this address",DISCOUNT_INVALID:"This discount code is not valid",INVENTORY_INSUFFICIENT:"Some items in your cart are no longer available",PAYMENT_METHOD_UNSUPPORTED:"This payment method is not supported",GENERAL_ERROR:"An error occurred. Please try again"};function Ke({errors:a,onDismiss:t,autoFocus:r}){if(0===a.length)return null;const i=a.map(e=>We(e));return e(S,{tone:"critical",errorType:y.CheckoutError,onDismiss:t,autoFocus:r,children:1===i.length?e(h,{children:i[0]}):e(p,{gap:"small-200",children:a.map(a=>e(h,{children:We(a)},`${a.code}-${a.message}`))})})}function We(e){return e.message||He[e.code]}function $e(){const{checkout:a}=q(),t=a.configuration.addressSettings.nonBillingAddressSettings.value,{shippingAddress:r}=a.negotiator.parts,[n]=ue()??[],o=i(()=>Q(),[]);return s(()=>{n&&(o.company.value=n)},[o.company,n]),n?e(b,{children:[e(b,{padding:"small-400"}),e(De,{address:r,addressErrors:o,addressType:"shipping",addressSettings:t,editDisabled:!1})]}):null}function qe({errorSignal:a,isRequired:t,validatePhoneField:r}){const{i18n:i,checkout:{negotiator:s}}=q(),{shippingAddress:l}=s.parts,d=l.value,c=Y(l.fields.phone,a,r),[u,p]=n(!1);if(o(()=>{a.value&&p(!0)}),!u)return null;const m=i.translate("contact.phone_label"),h=i.translate("contact.optional_phone_label");return e(b,{children:[e(b,{padding:"small-400"}),e(Me,{name:"phone",countryCode:d.countryCode||"",label:t?m:h,hideCountries:!0,required:t,autocomplete:"shipping tel-national",autoFocus:!0,...c})]})}function Je(){const{hasError:a}=C(X),{i18n:t,observability:r}=q(),{isSdkAvailable:i,hasPaymentSheetErrorSignal:s,onClick:n,walletName:o}=Qe();return i?a?null:e(b,{children:e(u,{onClick:()=>{try{n()}catch(e){s.value=!0,r.error(new Ye(`Error on changing buyer shipping address for wallet ${o}. Details: ${e}`,{cause:e}))}},children:e(p,{direction:"inline",alignItems:"center",children:[e(m,{type:"arrow-up-right",size:"small"}),e(P,{display:"inline",inlineSize:"small-200"}),e(h,{children:t.translate("shipping.add_address")})]})})}):null}const Qe=()=>{const e=_().value?Z.BuyWithPrime:Z.AmazonPay,{inMemoryAmazonPayParts:{hasPaymentSheetError:a,sdkStatus:t}}=ee(),r=R(e),i=l(()=>{if(t.value.status!==k.Available)throw new Ye(`SDK is not available for wallet ${e}`);(e===Z.BuyWithPrime?t.value.sdk.buywithprime:t.value.sdk.Pay).changeShippingAddress({amazonCheckoutSessionId:r.value})},[t,r,e]);return{isSdkAvailable:t.value.status===k.Available,hasPaymentSheetErrorSignal:a,onClick:i,walletName:e}};class Ye extends Error{constructor(){super(...arguments),this.name="ChangeAddressLinkError"}}const Xe=["1"];function Ze(){const{formattedAddress:a,address:{firstName:t,lastName:r,phone:i,countryCode:s}}=A(["phone","firstName","lastName","company"]),{errorMessages:n,loading:o}=function(){const e=w();return{errorMessages:N(),loading:!e.value}}(),l=n.length>0,{errorSignal:d,validatePhoneField:c,isPhoneRequired:u}=pe({loading:o,phone:i,countryCode:s});return e(p,{gap:"base",children:[l&&e(I,{}),e(Ie,{name:"restricted_address_edit",titleHidden:!0,values:Xe,hideRadioControl:!0,children:e(ke,{value:Xe[0],children:e(D,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",gap:"base",alignItems:"start",alignContent:"start",children:e(p,{alignItems:"start",borderRadius:"base",children:e(b,{borderRadius:"base",children:[e(b,{padding:"none",children:[e(M,{children:[t," ",r]}
1),e(M,{color:"subdued",children:a})]}),e($e,{}),e(qe,{errorSignal:d,isRequired:u,validatePhoneField:c})]})})})})}),e(Je,{})]})}function ea({children:a}){const{i18n:t}=q(),r=t.translate("taxes.tax_details");return e("section",{"aria-label":r,children:e(p,{direction:"block",gap:"small-200",children:[e(h,{color:"subdued",children:r}),a]})})}function aa({vatNumber:a,edit:t,loading:r}){const{i18n:i}=q();return r?e(E,{inlineSize:"large",size:"base"}):e(T,{accessibilityLabel:i.translate("taxes.vat_number.vaulted",{number:a}),graphic:"check-circle",removable:!0,onRemove:t,children:i.translate("taxes.vat_number.vaulted",{number:a})})}function ta({onAddressDelegation:a}){const{embed:t,i18n:r}=q();return"amazon"===t?.embedder?e(u,{textDecoration:"none",onClick:a,children:e(h,{tone:"accent",children:r.translate("embed.shipping.shipping_options")})}):e(_e,{onClick:a,textLabel:r.translate("contact.new_address_label")})}const ra=new Set(["guest","customerAccount","businessCustomer","sdkCartHints","shopPay"]);function ia(){return B(),null}function sa(){const a=function(){const{checkout:{negotiator:e}}=q(),{context:a}=e;return d(()=>{const e=a.cachedMembershipViolations.value?.some(e=>"buy_with_prime"===e.handle);return e?"bwp_membership_violation":null})}();return a.value?e(na,{errorMessagesType:a.value}):null}function na({errorMessagesType:a}){const{i18n:t}=q();return"bwp_membership_violation"===a?e(S,{errorType:y.PaymentError,tone:"warning",children:t.translate("shipping.prime_not_available.default")},"shop-pay-buy-with-prime-shipping-error"):null}const oa=a=>e(j,{padding:"small-400 none",children:a}),la={DefaultVaultedPaymentRollupContent:function({usesSharedVaultedSelector:i,hasPersistentRedeemablesManagement:s=!1,msiExpandedSlot:n,onSelectedPaymentMethodChange:o}){const{checkout:l}=q(),{paymentLines:d}=l.negotiator.parts,c=d.value.some(e=>"direct"===e.method.type),u=f().value,m=g("purchase.checkout.payment-method-list.render-before"),h=g("purchase.checkout.payment-method-list.render-after"),y=le(),S=a(!1),C=!s,P=(a,t)=>t?y(e(j,{children:a})):a;return e(r,{children:[e(p,{gap:"base",children:[s?null:e(ce,{includeStoreCredit:C,openRedeemablesModal:()=>S.value=!0}),e(ge,{children:[e(v,{customizations:m,render:P}),i?e(fe,{msiSlot:n,onSelectedPaymentMethodChange:o}):e(ve,{renderVaultingAgreementInline:!0}),!s&&e($,{}),e(Ue,{includeStoreCredit:C,openRedeemablesModal:()=>S.value=!0}),e(de,{includeStoreCredit:C,open:S.value,onClose:()=>S.value=!1}),e(v,{customizations:h,render:P}),e(t,{when:l.configuration.visibility.showPurchaseOrderNumberField,children:e(Se,{showHeading:!1})})]})]}),u&&!c&&e(b,{padding:"large-100 none",border:"none",children:e(Ce,{})})]})},VaultedBillingAddressRollupContent:function({renderInlineSelector:a=!1}){const{checkout:{identity:t}}=q();if(a){const a=je({identity:t});return e(a,{renderFormOnly:!0})}return e(Pe,{})},DefaultVaultedDeliveryAddressRollupContent:function({embedderErrors:a,onDismissEmbedderErrors:t,showMissingAddressField:r,onAddressDelegation:i,onFirstNamePersisted:s,vatIdFieldMode:n}){const{checkout:o}=q(),l=o.identity.current.value,d=me(o.configuration,l),c=g("Checkout::DeliveryAddress::RenderBefore"),u=g("purchase.checkout.delivery-address.render-after"),m=!w().value,h=x(),f=function({identitySource:a,restrictedAddressLoading:t,onFirstNamePersisted:r}){return"amazonPay"===a||"buyWithPrime"===a?e(t?E:Ze,{}):ra.has(a)?e(Re,{onFirstNamePersisted:r}):e(he,{})}({identitySource:l,restrictedAddressLoading:m,onFirstNamePersisted:s}),j=r?null:d?e(p,{gap:"large-200",children:[e(he,{}),e(ta,{onAddressDelegation:i})]}):f;return e(p,{direction:"block",gap:"base",children:[a.length>0&&e(b,{children:e(z,{target:"cart.deliveryGroups[0].deliveryAddress",children:e(Ke,{errors:a,onDismiss:t,autoFocus:!0})})}),e(v,{customizations:c}),j,e(v,{customizations:u}),h&&e(ea,{children:"vaulted"===n.status?e(aa,{vatNumber:h.taxId.value,edit:n.focus,loading:h.taxId.loading}):e(we,{taxId:h.taxId,applied:h.applied,inputRef:n.inputRef})})]})},VaultedLocalPickupOptionsRollupContent:function({onShowModal:a}){const{shop:t,checkout:{negotiator:i}}=q(),{deliveryNext:s}=i.current.fields,{progressing:n}=F(),o=ae("deliveryNext"),l=te(),{value:c,loading:u}=L().value,{value:m,loading:h}=V().value,b=Boolean(c||m),f=u||h,g=l.value&&!n.value&&(o.value||f),v=re(),j=d(()=>ie(s.value)??[]),y=d(()=>t.shipPickupInOneOrderEnabled?v.value&&se(v.value):j.value[0]),S=y.value?.pickupLocation?[y.value]:[],[C]=O({type:v.value?.type,deliveryMethodType:"PICK_UP"}),P=Ne({deliveryMethodType:"PICK_UP",mode:"deliveryMethodScoped"}),_=P.value.merchandiseLines.length>0,R=d(()=>P.value.merchandiseLines),{hasViolations:k}=G(ne);let A;return A=g?e(Ee,{hideText:!0,singleItem:!0}):b?_?e(r,{children:[e(Te,{bannerType:"pickup",merchandiseLines:R}),e(ia,{})]}):e(xe,{onShowModal:a,showLocationButton:!1}):e(p,{gap:"small-200",children:[k&&e(ze,{}),e(Fe,{}),e(Le,{methods:S,selectedDeliveryMethodHandle:C})]}),e(Ve.Provider,{value:!0,children:e(Ae,{presentation:"base",children:A})})},VaultedPaymentOptionsRollupContent:function({ineligibilityReason:a}){return e(ye,{ineligibilityReason:a})},VaultedShippingMethodsRollupContent:function({singleDeliveryGroup:a}){const{i18n:t}=q(),{hasMultipleDeliveryGroups:s,onlyDeliveryGroupType:n}=a.value,{customizationsBefore:o,customizationsAfter:l,customizationsForRollupReveal:d}=Ge({hasMultipleDeliveryGroups:s,targeted:!1,shouldHandleRollup:!0}).value,c=d.length>0,u=i(()=>({groupType:n&&Oe(n),includeDeliverySelectionGroups:!1}),[n]),{uiStateSignal:m}=oe(U);
1return e(r,{children:[c?e(v,{customizations:o,options:u,render:oa}):null,"error"===m.value.status?null:e(p,{gap:"base",padding:c?"small-300 none":void 0,children:[e(sa,{}),Be("shipping.shipping_method_notice",t)?e(M,{children:t.translate("shipping.shipping_method_notice")}):null,e(be,{})]}),c?e(v,{customizations:l,options:u,render:oa}):null]})}};export{la as vaultedRollupContents};
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.