1import{u as e,e as Z,i as ee,S as T,q as P,T as G,h as se,k as te,p as re,f as L}from"./esnext-vendor.D7ldIee_.js";import{dr as ne,L as w,k as A,I as W,l as D,B as S,cP as ae,s as R,U as M,$ as H,D as K,W as $,bP as ie,b as oe,ds as de,dt as le,a2 as z,du as ce,dv as ue,G as pe,P as B,dw as q,dx as me,al as Y,dy as he,dz as ge,cH as ye,dA as ve,dB as fe,ch as Ae,bM as be,ay as Se,dC as Ce}from"./hydrate.ByRIsqvd.js";import{h as Pe,i as Ee,j as De,G as Me,k as ke,l as _e,m as Le}from"./useAddressMutationsWithNegotiation.Bu1iJp6d.js";import{N as y,aS as Re,O as x,dA as Ne,bl as Ie,dB as Be,ap as I,ab as Te,$ as we,a0 as xe,bb as Fe,am as ze,dC as Oe,dD as Ve,dE as Ue,dF as Ge,aj as We,ac as He,M as Ke}from"./addresses-is-address-empty.-MuOhIyI.js";import{b as $e,R as qe,M as Ye,c as je,d as Je,i as Qe,O as j,e as Xe}from"./OnePage.JtsOe4gf.js";import{K as Ze}from"./KnownBuyerPaymentMethodSelector.pZHguwcE.js";import{W as es,P as ss,g as ts,a as rs}from"./PaymentOptionSelector.LuuQe4at.js";import{b as ns,V as as,j as is,k as os,M as ds,l as ls}from"./components-PaymentMethodProgressionHost.BgOpCmhs.js";import{c as cs}from"./hooks-useCanChangeCompanyLocation.Bk004VMP.js";import{u as us}from"./shipping-methods-grouping.DDWlTvqo.js";import{C as ps,b as ms}from"./Choice.Dywz6_Fr.js";import{C as hs}from"./IncentiveBadge.D66zssvS.js";import{C as gs}from"./BillingAddressForm.DHpCPcqC.js";import{P as ys}from"./PhoneField.BapDvZfY.js";import{V as vs,a as fs,b as As,I as bs,c as Ss,d as Cs,S as Ps,L as Es}from"./components-DeliveryTransition.BjmsXjx9.js";import{C as Ds,h as Ms}from"./localization-index.DBksi22x.js";import{u as ks}from"./MerchandiseModal.QhgBWo-v.js";import"./app.A60-IfPs.js";import"./constants.DowbVE6J.js";import"./hooks-useReplaceShopPayInHistory.Cz4PqGkk.js";import"./PaymentIcon.Ddd-WnG2.js";import"./PaymentLine.DhO8cHCS.js";import"./hooks-useUnauthenticatedErrorModal.CzvtLqeY.js";import"./Theme-ThemeOverride.4AonMthy.js";import"./hooks-useUpdateCheckoutAddress.4zyjtqEx.js";import"./utilities-shopCashMoney.B9eyOzz9.js";import"./payment-usePaymentExemptionReason.Q4GfCwuW.js";import"./shop-pay-ProgressIntercepts.wTCQvlrM.js";import"./shop-pay-normalizeBuyerDetails.BcEhgoK7.js";import"./context-CheckoutSheetProtocolClient.CNLSBD5p.js";import"./hooks-useShopPayProgressIntercepts.CnlV9rdf.js";import"./checkout-updaters-helpers.DKDxNKY0.js";import"./Popover.BNecjV8x.js";import"./StickyPayButton-StickyPayButton.module.DrkNxyTx.js";import"./Switch.aKF4dNrP.js";import"./hooks-useWalletsTimeout.DIL_pXhM.js";import"./components-RedirectionNotice.module.CqgkZHXB.js";import"./graphql-PaymentSessionMutation.CK_JkOwG.js";import"./useShopPayButtonClassName.DeL41vx0.js";import"./shared-shop-theme.BJKdwdMa.js";import"./hooks-useShouldRevealCustomization.C_GYHzzt.js";import"./hooks-payment-button.D5UAY6lK.js";import"./Section.DIJn7eYY.js";import"./Section-SectionStyleOverride.Dli5IR65.js";import"./ChangeCompanyLocationLink.Ba8IeUdU.js";import"./PaymentErrorBanner.BNtKSHks.js";import"./hooks-useGeneralPaymentErrorMessage.CXe06B2R.js";import"./hooks-usePreselectSpi.B308gMMr.js";import"./hooks-useAvailableShopPromotionDiscounts.DRFdQEEP.js";import"./ShopPayLogo.Dh-KQvuu.js";import"./mobile-checkout-sdk-MobileCheckoutSdkClient.CVSnUTrf.js";import"./ImpressionEventCapture.CIEEzh6Z.js";import"./Middot.BwhErQgI.js";import"./EstimatedDeliveryContent.P3UYo-F2.js";import"./ShippingMethodRateLabel.DfFHFGoZ.js";import"./shipping-methods-consolidated-included.CmQthVU7.js";import"./ShippingLines.C3cNVVcP.js";import"./PendingShipping.TwutGJMj.js";import"./ShipmentBreakdown.BCHd0lNF.js";import"./ShippingMethodSelector.KipCTTDv.js";import"./TextArea.wcLwM1i3.js";import"./SubscriptionPriceBreakdown.0rp4tSej.js";import"./shop-pay-installments-monorail.cv2DVyY3.js";import"./Monorail-monorailMetric-wallets.C3kHkAxp.js";import"./StockProblems-StockProblemsLineItemList.Di56mnXD.js";import"./TransitionHeight.C0wKTnZA.js";import"./hooks-usePaypalRowEffects.DBASzAIo.js";import"./BillingAddressSelector.CyVrY0kP.js";import"./hooks-useStableHostMethodsReferences.C4W1cetV.js";import"./Checkbox.Cby2hWUV.js";import"./hooks-useSuppressShopPayModalOnLoad.CI5bzdLE.js";import"./models-ShopPayBuyerDetails.model.CahX79UU.js";import"./hooks-useForceShopPayUrl.MIxsBkT_.js";import"./MarketsProDisclaimer.wV7aMZTc.js";import"./AutocompleteField-hooks.YzxHOgXJ.js";function _s({openRedeemablesModal:s,includeStoreCredit:r=!0}){const{checkout:n,i18n:t}
1=y(),a=Pe(),o=Ee(a),c=De(),{canApplyGiftCards:i}=ne(),{value:u}=Re(),p=u?.amount||0,d=r&&n.configuration.visibility.showStoreCreditRedemption.value&&c.value.length===0&&o.value;if(!d&&!i||p===0)return null;let l="";return i&&d?l=t.translate("payment.gift_card_store_credit.add_label"):i?l=t.translate("payment.gift_card_wrapper.add_label"):l=t.translate("payment.store_credit.add_label"),e(S,{padding:"none small-100",children:e(w,{onClick:s,textDecoration:"none",children:e(A,{direction:"inline",gap:"small-100",alignItems:"center",children:[e(W,{type:"plus",size:"base"}),e(D,{children:l})]})})})}function Ls({usesSharedVaultedSelector:s,hasPersistentRedeemablesManagement:r=!1,msiExpandedSlot:n,onSelectedPaymentMethodChange:t}){const{checkout:a}=y(),{paymentLines:o}=x(),c=o.value.some(f=>f.method.type==="direct"),i=ae().value,u=R("purchase.checkout.payment-method-list.render-before"),p=R("purchase.checkout.payment-method-list.render-after"),d=$e(),l=Z(!1),C=!r,g=(f,k)=>k?d(e(H,{children:f})):f;return e(T,{children:[e(A,{gap:"base",children:[r?null:e(Ye,{includeStoreCredit:C,openRedeemablesModal:()=>l.value=!0}),e(es,{children:[e(M,{customizations:u,render:g}),s?e(Ze,{msiSlot:n,onSelectedPaymentMethodChange:t}):e(ss,{}),!r&&e(Me,{}),e(_s,{includeStoreCredit:C,openRedeemablesModal:()=>l.value=!0}),e(qe,{includeStoreCredit:C,open:l.value,onClose:()=>l.value=!1}),e(M,{customizations:p,render:g}),e(ee,{when:a.configuration.visibility.showPurchaseOrderNumberField,children:e(ns,{showHeading:!1})})]})]}),i&&!c&&e(S,{padding:"large-100 none",border:"none",children:e(as,{})})]})}function Rs({renderInlineSelector:s=!1}){const{checkout:{identity:r}}=y();if(s){const n=ts({identity:r});return e(n,{renderFormOnly:!0})}return e(is,{})}function Ns({onFirstNamePersisted:s}={}){const{checkout:r,i18n:n}=y(),t=r.addressManager.shipping.value,{isMissingPhone:a}=ke(),{isMissingFirstName:o}=_e(),c=a||o,i=Le("shipping"),u=cs(),p=Is({identity:r.identity,i18n:n}),{crossBorderGate:d,shouldGateCrossBorder:l}=us(),C=c?e(ds,{onFirstNamePersisted:s}):null,g=P(m=>i.selectAddress(m.id,{source:"delivery-address-edit"}),[i]),E=P((m,v)=>{const h=m.address.countryCode;h&&l(h)?d(v):v()},[l,d]),f=P(m=>i.createAddress({...m,selectAddress:!1}),[i]),k=P(async(m,v)=>{const h=await v();if(h){const b=h.address.countryCode;b&&l(b)?d(()=>{i.selectAddress(h.id,{source:"delivery-address-edit-create"})}):i.selectAddress(h.id,{source:"delivery-address-edit-create"})}return h},[i,l,d]),N=P(async(m,v)=>{const h=m.address.countryCode;return h&&l(h)?(d(()=>{v()}),{id:m.id,address:m.address}):v()},[l,d]),_=P(async(m,v)=>{const h=t.addresses.value,b=t.selectedAddress.value,Q=h.filter(X=>X.id!==m),F=(b?.id===m?Q[0]:b)?.address.countryCode;return F&&l(F)?(d(()=>{v()},{dismissible:!1}),!1):v()},[t.addresses,t.selectedAddress,l,d]);return e(os,{addressType:"shipping",addresses:t.addresses.value,immutableAddresses:t.immutableAddresses.value,immutableAddressSections:t.immutableAddressSections.value,addressesTitle:t.addressesTitle,selectedAddress:t.selectedAddress.value,onSelectAddress:g,onBeforeSelectAddress:E,onCreateAddress:f,onBeforeCreateAddress:k,onUpdateAddress:i.updateAddress,onBeforeUpdateAddress:N,onDeleteAddress:i.deleteAddress,onBeforeDeleteAddress:_,addressErrorsSignal:t.errors.fields,canCreateAddress:t.canCreateAddress.value,canUpdateAddress:t.canUpdateAddress.value,canDeleteAddress:t.canDeleteAddress.value,canSetDefaultAddress:t.canSetDefaultAddress.value,onSetDefault:t.setDefaultAddress,errorBannerMessage:t.errors.banner,canChangeCompanyLocation:u.value,getAddressDisplayName:t.getAddressDisplayName,modalSubtitle:p,selectedAddressDetails:C})}function Is({identity:s,i18n:r}){if(s.current.value==="businessCustomer")return r.translate("shipping.address_form.one_time_address_subtitle")}const Bs={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_ER
1ROR:"An error occurred. Please try again"};function Ts({errors:s,onDismiss:r,autoFocus:n}){if(s.length===0)return null;const t=s.map(a=>O(a));return e($,{tone:"critical",errorType:K.CheckoutError,onDismiss:r,autoFocus:n,children:t.length===1?e(D,{children:t[0]}):e(A,{gap:"small-200",children:s.map(a=>e(D,{children:O(a)},`${a.code}-${a.message}`))})})}function O(s){return s.message||Bs[s.code]}function ws(){const{checkout:s}=y(),r=s.configuration.addressSettings.nonBillingAddressSettings.value,{shippingAddress:n}=x(),[t]=je()??[],a=G(()=>Ne(),[]);return se(()=>{t&&(a.company.value=t)},[a.company,t]),t?e(S,{children:[e(S,{padding:"small-400"}),e(gs,{address:n,addressErrors:a,addressType:"shipping",addressSettings:r,editDisabled:!1})]}):null}function xs({errorSignal:s,isRequired:r,validatePhoneField:n}){const{i18n:t}=y(),{shippingAddress:a}=x(),o=a.value,c=Ie(a.fields.phone,s,n),[i,u]=te(!1);if(re(()=>{s.value&&u(!0)}),!i)return null;const p=t.translate("contact.phone_label"),d=t.translate("contact.optional_phone_label");return e(S,{children:[e(S,{padding:"small-400"}),e(ys,{name:"phone",countryCode:o.countryCode||"",label:r?p:d,hideCountries:!0,required:r,autocomplete:"shipping tel-national",autoFocus:!0,...c})]})}function Fs(){const{hasError:s}=ie(Be),{i18n:r,observability:n}=y(),{isSdkAvailable:t,hasPaymentSheetErrorSignal:a,onClick:o,walletName:c}=zs();return!t||s?null:e(S,{children:e(w,{onClick:()=>{try{o()}catch(u){a.value=!0,n.error(new J(`Error on changing buyer shipping address for wallet ${c}. Details: ${u}`,{cause:u}))}},children:e(A,{direction:"inline",alignItems:"center",children:[e(W,{type:"arrow-up-right",size:"small"}),e(oe,{display:"inline",inlineSize:"small-200"}),e(D,{children:r.translate("shipping.add_address")})]})})})}const zs=()=>{const r=de().value?I.BuyWithPrime:I.AmazonPay,{inMemoryAmazonPayParts:{hasPaymentSheetError:n,sdkStatus:t}}=Te(),a=le(r),o=P(()=>
1{if(t.value.status!==z.Available)throw new J(`SDK is not available for wallet ${r}`);(r===I.BuyWithPrime?t.value.sdk.buywithprime:t.value.sdk.Pay).changeShippingAddress({amazonCheckoutSessionId:a.value})},[t,a,r]);return{isSdkAvailable:t.value.status===z.Available,hasPaymentSheetErrorSignal:n,onClick:o,walletName:r}};class J extends Error{constructor(){super(...arguments),this.name="ChangeAddressLinkError"}}const V=["1"];function Os(){const{formattedAddress:s,address:{firstName:r,lastName:n,phone:t,countryCode:a}}=ce(["phone","firstName","lastName","company"]),{errorMessages:o,loading:c}=Vs(),i=o.length>0,{errorSignal:u,validatePhoneField:p,isPhoneRequired:d}=Je({loading:c,phone:t,countryCode:a});return e(A,{gap:"base",children:[i&&e(ue,{}),e(hs,{name:"restricted_address_edit",titleHidden:!0,values:V,hideRadioControl:!0,children:e(ps,{value:V[0],children:e(pe,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",gap:"base",alignItems:"start",alignContent:"start",children:e(A,{alignItems:"start",borderRadius:"base",children:e(S,{borderRadius:"base",children:[e(S,{padding:"none",children:[e(B,{children:[r," ",n]}),e(B,{color:"subdued",children:s})]}),e(ws,{}),e(xs,{errorSignal:u,isRequired:d,validatePhoneField:p})]})})})})}),e(Fs,{})]})}function Vs(){const s=q();return{errorMessages:me(),loading:!s.value}}function Us({children:s}){const{i18n:r}=y(),n=r.translate("taxes.tax_details");return e("section",{"aria-label":n,children:e(A,{direction:"block",gap:"small-200",children:[e(D,{color:"subdued",children:n}),s]})})}function Gs({vatNumber:s,edit:r,loading:n}){const{i18n:t}=y();return n?e(Y,{inlineSize:"large",size:"base"}):e(he,{accessibilityLabel:t.translate("taxes.vat_number.vaulted",{number:s}),graphic:"check-circle",removable:!0,onRemove:r,children:t.translate("taxes.vat_number.vaulted",{number:s})})}function Ws({embedderErrors:s,onDismissEmbedderErrors:r,showMissingAddressField:n,onAddressDelegation:t,onFirstNamePersisted:a,vatIdFieldMode:o}){const{checkout:c}=y(),i=c.identity.current.value,u=Qe(c.configuration,i),p=R("Checkout::DeliveryAddress::RenderBefore"),d=R("purchase.checkout.delivery-address.render-after"),C=!q().value,g=ge(),E=$s({identitySource:i,restrictedAddressLoading:C,onFirstNamePersisted:a}),f=n?null:u?e(A,{gap:"large-200",children:[e(j,{}),e(Hs,{onAddressDelegation:t})]}):E;return e(A,{direction:"block",gap:"base",children:[s.length>0&&e(S,{children:e(ye,{target:"cart.deliveryGroups[0].deliveryAddress",children:e(Ts,{errors:s,onDismiss:r,autoFocus:!0})})}),e(M,{customizations:p}),f,e(M,{customizations:d}),g&&e(Us,{children:o.status==="vaulted"?e(Gs,{vatNumber:g.taxId.value,edit:o.focus,loading:g.taxId.loading}):e(vs,{taxId:g.taxId,applied:g.applied,inputRef:o.inputRef})})]})}function Hs({onAddressDelegation:s}){const{embed:r,i18n:n}=y();return r?.embedder==="amazon"?e(w,{textDecoration:"none",onClick:s,children:e(D,{tone:"accent",children:n.translate("embed.shipping.shipping_options")})}):e(ls,{onClick:s,textLabel:n.translate("contact.new_address_label")})}const Ks=new Set(["guest","customerAccount","businessCustomer","sdkCartHints","shopPay"]);function $s({identitySource:s,restrictedAddressLoading:r,onFirstNamePersisted:n}){return s==="amazonPay"||s==="buyWithPrime"?r?e(Y,{}):e(Os,{}):Ks.has(s)?e(Ns,{onFirstNamePersisted:n}):e(j,{})}function qs({onShowModal:s}){const{shop:r}=y(),{deliveryNext:n}=we(),{progressing:t}=xe(),a=Fe("deliveryNext"),o=ze(),{value:c,loading:i}=ve().value,{value:u,loading:p}=fe().value,d=!!(c||u),l=i||p,C=o.value&&!t.value&&(a.value||l),g=Oe(),E=L(()=>Ve(n.value)??[]),f=L(()=>r.shipPickupInOneOrderEnabled?g.value&&Ue(g.value):E.value[0]),k=f.value?.pickupLocation?[f.value]:[],[N]=Ae({type:g.value?.type,deliveryMethodType:"PICK_UP"}),_=fs({deliveryMethodType:"PICK_UP",mode:"deliveryMethodScoped"}),m=_.value.merchandiseLines.length>0,v=L(()=>_.value.merchandiseLines),{hasViolations:h}=be(Ge);let b;return C?b=e(As,{hideText:!0,singleItem:!0}):d?b=m?e(T,{children:[e(bs,{bannerType:"pickup",merchandiseLines:v}),e(Ys,{})]}):e(Ss,{onShowModal:s,showLocationButton:!1}):b=e(A,{gap:"small-200",children:[h&&e(Cs,{}),e(Ps,{}),e(Es,{methods:k,selectedDeliveryMethodHandle:N})]}),e(Ds.Provider,{value:!0,children:e(ms,{presentation:"base",children:b})})}function Ys(){return We(),null}function js({ineligibilityReason:s}){return e(rs,{ineligibilityReason:s})}function Js(){const{context:s}=He();return L(()=>s.cachedMembershipViolations.value?.some(n=>n.handle==="buy_with_prime")?"bwp_membership_violation":null)}function Qs(){const s=Js();return s.value?e(Xs,{errorMessagesType:s.value}):null}function Xs({errorMessagesType:s}){const{i18n:r}=y();return s==="bwp_membership_violation"?e($,{errorType:K.PaymentError,tone:"warning",children:r.translate("shipping.prime_not_available.default")},"shop-pay-buy-with-prime-shipping-error"):Zs()}function Zs(s){return null}const U=s=>e(H,{padding:"small-400 none",children:s});function et({singleDeliveryGroup:s}){const{i18n:r}=y(),{hasMultipleDeliveryGroups:n,onlyDeliveryGroupType:t}=s.value,{customizationsBefore:a,customizationsAfter:o,customizationsForRollupReveal:c}=ks({hasMultipleDeliveryGroups:n,targeted:!1,shouldHandleRollup:!0}).value,i=c.length>0,u=G(()=>({groupType:t&&Se(t),includeDeliverySelectionGroups:!1}),[t]),{uiStateSignal:p}=Ke(Ce);return e(T,{children:[i?e(M,{customizations:a,options:u,render:U}):null,p.value.status==="error"?null:e(A,{gap:"base",padding:i?"small-300 none":void 0,children:[e(Qs,{}),Ms("shipping.shipping_method_notice",r)?e(B,{children:r.translate("shipping.shipping_method_notice")}):null,e(Xe,{})]}),i?e(M,{customizations:o,options:u,render:U}):null]})}const Pr={DefaultVaultedPaymentRollupContent:Ls,VaultedBillingAddressRollupContent:Rs,DefaultVaultedDeliveryAddressRollupContent:Ws,VaultedLocalPickupOptionsRollupContent:qs,VaultedPaymentOptionsRollupContent:js,
1VaultedShippingMethodsRollupContent:et};export{Pr 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.