1import{q as J,u as e,A as L,k as Q,e as Z,h as K,f as c,_ as ee,i as d,j as ie,G as B,o as te,S as ne}from"./esnext-vendor.BDPAaZdq.js";import{L as se,bU as ae,bV as oe,bW as re,bX as le,Q as pe,h as de,bY as ce,bZ as ue,v as I,R as he,bk as ge,_ as me,V as ve,X as ye,q as fe,Y as Se,U as E,a3 as x,c as f,H as z,b_ as G,P as be,ab as _e,r as ke,m as Pe,$ as R,p as De,I as Ae,o as Ee,b$ as we,aH as xe}from"./hydrate.B0xlt2dG.js";import{T as Te}from"./TransitionHeight.M5zGQYzu.js";import{u as Me,S as Ce,D as Le}from"./ShippingLines.BkfCgQnP.js";import{S as Ie}from"./ShipmentBreakdown.C6RgvF4c.js";import{O as h,bX as ze,P as T,ba as F,Q as H,az as Ge,o as Re,G as Ne,bx as Oe}from"./hooks-useReplaceShopPayInHistory.C8UL-mAH.js";import{P as Ue}from"./PendingShipping.2eopPL-C.js";import{a as V,b as W,E as $}from"./EmptyState.b83C9ddY.js";import{T as Be,h as Fe}from"./helpers-getNormalizedPaymentMethodName.B-mE5wnL.js";import{b as He,c as Ve,u as We}from"./MerchandiseModal.WyfeQS3f.js";import{u as $e,S as N}from"./hooks-usePostPurchase.BPY08f0g.js";import"./app.D1P6yWfp.js";import"./shared-permissions.BaDWlj5_.js";import"./hooks-useShopPayExternalAppContext.DyGXtar4.js";import"./Choice.BIzIW4rp.js";import"./Checkbox.CiixBh9Z.js";import"./ShippingMethodSelector.ByEQiDBW.js";import"./TextArea.C0R8_jwI.js";import"./FormLayout.CMVyKzjL.js";import"./amazon-pay-useAmazonPayPaymentLine.BXwZMsYY.js";import"./localization-index.Bo8bPuxq.js";import"./helpers-credit-card-disabled.BnSr1GsQ.js";import"./EstimatedDeliveryContent.C1e3pn_u.js";import"./hooks-useShowMobileOrderSummary.DmZ0FrVc.js";import"./PhoneField.ykPh8SPx.js";import"./hooks-useSuppressShopPayModalOnLoad.brztd70E.js";import"./SubscriptionPriceBreakdown.DYrSBpqu.js";function qe(){const{userEvents:i}=h(),t=ze();return J((n,a,r)=>{const l=t.value.defaultAttributes?.shopId||1,g={schemaId:"checkout_display_shipping_methods/1.0",payload:{eventTimestamp:a,shopId:l,apiClientId:r,promiseRetrievalTime:n}};i.monorailEvent(g)},[i,t.value.defaultAttributes?.shopId])}const q="/cdn/shopifycloud/checkout-web/assets/c1/assets/shipping.CG9i_A4v.svg",Y=()=>{const{i18n:i,checkout:t}=h(),s=t.configuration.layout.isOnePage.value,n=e(se,{href:"/information",children:i.translate("shipping.shipping_information_redirect_link")});return e($,{children:[!s&&e(V,{children:e("img",{src:q,alt:""})}),e(W,{children:i.translate("shipping.shipping_information_required_notice",{link:n})})]})},Ye=()=>{const{i18n:i,checkout:t}=h(),s=t.configuration.layout.isOnePage.value;return e($,{children:[!s&&e(V,{children:e("img",{src:q,alt:""})}),e(W,{children:i.translate("shipping_errors.shipping_method_not_available_generic.one")})]})};function Xe(){const{i18n:i}=h(),t=ae(),{allViolations:s,deliveryNext:n}=T(),a=F("deliveryNext"),r=qe(),l=L(a.peek()),[,g]=Q(),m=L(void 0),u=Z(!1),{shippingAddress:S}=H(),w=Me(g),b=oe();K(()=>{u.value=!0},[u]);const p=c(()=>{const o=t.value.shippableDeliveryLines;return o?Ge(o):[]});ee(()=>ie(()=>{if(a.value){m.current??=Date.now();return}l.current=!1;const o=m.current;if(o==null)return;const v=Date.now(),P=v-o,D=p.peek()[0]?.methods[0]?.deliveryPromiseProviderApiClientId;if(m.current=void 0,!D)return;const A=Ne(D);B(()=>{r(P,v,Number(A)),b(P,Number(A))})}),[a,b,p,r]);const _=c(()=>s.value?.some(o=>"target"in o&&o.target.startsWith("$.cart.deliveryGroups[0].deliveryAddress"))),k=c(()=>je({deliveryLoading:a.value,showLoading:l.current,hasMounted:u.value,hasFilledShippingMethods:n.value?.status==="filled"&&p.value.length>0}));return e(d,{when:()=>!k.value,fallback:e(Ue,{text:i.translate("shipping.waiting_on_rate_notice")}),children:e(d,{when:()=>!_.value,fallback:e(Je,{}),children:e(d,{when:()=>!Re(S.value),fallback:e(Y,{}),children:e(d,{when:()=>n.value?.status==="filled",fallback:e(O,{}),children:e(d,{when:()=>p.value.length>0,fallback:e(O,{}),children:e(Ce,{lines:p.value,loading:w})})})})})})}function je({deliveryLoading:i,showLoading:t,hasMounted:s,hasFilledShippingMethods:n}){return i&&t&&(s||!n)}function O(){const{deliveryNext:i,shippingAddress:t}=T(),{shippingAddress:s}=H(),n=re();return e(d,{when:()=>{const a=s.value,r=n(a);return le({deliveryNext:i.value,proposedAddress:a,negotiatedAddress:t.value,reloadStrategy:r})},fallback:e(Y,{}),children:e(Ye,{})})}function Je(){const{router:i}=h();return i.redirect("/information"),null}const U=i=>e(x,{children:i});function Di(){const{i18n:i,checkout:t}=h(),{nextPage:s,previousPage:n}=pe(),{progress:a,progressing:r}=de(),{deliveryNext:l,optionalDuties:g}=T(),m=F("deliveryNext").value,u=i.translate("shipping.shipping_method_title"),S=i.translate("shipping.duties_and_taxes_title"),w=i.translate("general.continue_to_payment_method"),b=t.configuration.layout.isOnePage.value,p=ce(),_=ue(),k=He(),o=c(()=>Oe(l.value)||k.value.showShipmentBreakdown?"small-400":"base"),v=Ve(),{customizationsBefore:P,customizationsAfter:D}=We({hasMultipleDeliveryGroups:v.value.hasMultipleDeliveryGroups,targeted:!1}).value,A=I("Checkout::Dynamic::Render","DELIVERY1"),X=I("Checkout::Dynamic::Render","DELIVERY2");$e({stage:m?N.Usable:N.Complete,id:"Shipping"}),he("shipping");const M=c(()=>l.value==null||l.value.status==="unavailable");
1ge(y=>{y.type==="success"&&y.negotiationStage==="progression"&&(p("pageSubmit",{timestamp:new Date}),_({type:"page_submit",page:"shipping"}))});const j=c(()=>!!l.value);te(()=>{j.value&&B(()=>{p("shippingMethodsFilled",{timestamp:new Date}),_({type:"shipping_methods_filled"})})});const C=c(()=>{const y=v.value.onlyDeliveryGroupType;return{groupType:y?xe(y):void 0,includeDeliverySelectionGroups:!1}});return e(ne,{children:[e(Be,{children:i.translate("shipping.title")}),e(me,{onSubmit:()=>a("shipping-page-submit"),disabled:r.value||M.value,implicitSubmit:w,children:e(ve,{section:"delivery",children:e(ye,{section:"delivery",children:e(fe,{children:[e(Se,{children:[e(E,{customizations:A,render:U}),e(x,{accessibilityLabel:u,children:e(f,{gap:o.value,children:[e(f,{gap:"small-400",children:[e(z,{autoFocus:!b,id:G,level:1,children:u}),Fe("shipping.shipping_method_notice",i)?e(be,{children:i.translate("shipping.shipping_method_notice")}):null]}),e(f,{gap:"base",children:e(_e,{children:[e(d,{when:()=>k.value.showShipmentBreakdown,children:e(Te,{children:e(Ie,{})})}),e(E,{customizations:P,options:C.value}),e(Xe,{}),e(E,{customizations:D,options:C.value})]})})]})}),e(d,{when:()=>g.value?.refuseDutiesPermitted,children:e(x,{accessibilityLabel:S,children:e(f,{gap:"large-200",children:[e(z,{id:`${G}-duties-and-taxes`,level:1,children:S}),e(Le,{})]})})}),e(E,{customizations:X,render:U})]}),e(ke,{children:[e(Pe,{children:e(R,{inlineSize:"fill",disabled:M.value,type:"submit",loading:r.value,size:"large",pixelId:"go_to_next_step",variant:"primary",children:s.label})}),n.route?e(De,{children:e(R,{href:n.route,variant:"plain",inlineSize:"fill",textDecoration:"none",pixelId:"go_to_previous_step",children:e(f,{direction:"inline",gap:"small-200",alignItems:"center",children:[e(Ae,{type:"chevron-left",size:"small"}),e(Ee,{children:n.label})]})})}):null]})]})})})}),e(we.Prefetch,{})]})}export{Di 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.