1import{q as Q,u as e,A as L,k as X,e as K,h as Z,f as c,_ as ee,i as d,j as ie,G as F,p as te,S as ne}from"./esnext-vendor.D7ldIee_.js";import{L as se,bC as ae,bD as oe,bE as re,bF as le,N as pe,bG as de,bH as ce,s as I,X as ue,O as he,Q as ge,o as me,R as ve,U as E,$ as w,k as f,n as z,bI as G,P as ye,a9 as fe,p as Se,j as be,Y as R,m as _e,I as ke,l as De,bJ as Pe,ay as Ae}from"./hydrate.ByRIsqvd.js";import{T as Ee}from"./TransitionHeight.C0wKTnZA.js";import{u as Te,S as we,D as xe}from"./ShippingLines.C3cNVVcP.js";import{S as Me}from"./ShipmentBreakdown.BCHd0lNF.js";import{N as h,aT as Ce,$ as x,bb as U,O as H,aF as Le,l as Ie,B as ze,a0 as Ge,ad as Re,bi as Ne,bI as Oe}from"./addresses-is-address-empty.-MuOhIyI.js";import{P as Be}from"./PendingShipping.TwutGJMj.js";import{a as $,b as W,E as j}from"./IncentiveBadge.D66zssvS.js";import{T as Fe}from"./stopwatch.wWgdKLTI.js";import{b as Ue,c as He,u as $e}from"./MerchandiseModal.QhgBWo-v.js";import{u as We,S as N}from"./components-RedirectionNotice.module.CqgkZHXB.js";import{h as je}from"./localization-index.DBksi22x.js";import"./app.A60-IfPs.js";import"./constants.DowbVE6J.js";import"./hooks-useReplaceShopPayInHistory.Cz4PqGkk.js";import"./Choice.Dywz6_Fr.js";import"./hooks-useUnauthenticatedErrorModal.CzvtLqeY.js";import"./Checkbox.Cby2hWUV.js";import"./ShippingMethodSelector.KipCTTDv.js";import"./TextArea.wcLwM1i3.js";import"./ShippingMethodRateLabel.DfFHFGoZ.js";import"./EstimatedDeliveryContent.P3UYo-F2.js";import"./PhoneField.BapDvZfY.js";import"./hooks-useSuppressShopPayModalOnLoad.CI5bzdLE.js";import"./SubscriptionPriceBreakdown.0rp4tSej.js";function qe(){const{userEvents:i}=h(),t=Ce();return Q((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",J=()=>{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(j,{children:[!s&&e($,{children:e("img",{src:q,alt:""})}),e(W,{children:i.translate("shipping.shipping_information_required_notice",{link:n})})]})},Je=()=>{const{i18n:i,checkout:t}=h(),s=t.configuration.layout.isOnePage.value;return e(j,{children:[!s&&e($,{children:e("img",{src:q,alt:""})}),e(W,{children:i.translate("shipping_errors.shipping_method_not_available_generic.one")})]})};function Ve(){const{i18n:i}=h(),t=ae(),{allViolations:s,deliveryNext:n}=x(),a=U("deliveryNext"),r=qe(),l=L(a.peek()),[,g]=X(),m=L(void 0),u=K(!1),{shippingAddress:S}=H(),T=Te(g),b=oe();Z(()=>{u.value=!0},[u]);const p=c(()=>{const o=t.value.shippableDeliveryLines;return o?Le(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(),D=v-o,P=p.peek()[0]?.methods[0]?.deliveryPromiseProviderApiClientId;if(m.current=void 0,!P)return;const A=ze(P);F(()=>{r(D,v,Number(A)),b(D,Number(A))})}),[a,b,p,r]);const _=c(()=>s.value?.some(o=>"target"in o&&o.target.startsWith("$.cart.deliveryGroups[0].deliveryAddress"))),k=c(()=>Ye({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(Be,{text:i.translate("shipping.waiting_on_rate_notice")}),children:e(d,{when:()=>!_.value,fallback:e(Qe,{}),children:e(d,{when:()=>!Ie(S.value),fallback:e(J,{}),children:e(d,{when:()=>n.value?.status==="filled",fallback:e(O,{}),children:e(d,{when:()=>p.value.length>0,fallback:e(O,{}),children:e(we,{lines:p.value,loading:T})})})})})})}function Ye({deliveryLoading:i,showLoading:t,hasMounted:s,hasFilledShippingMethods:n}){return i&&t&&(s||!n)}function O(){const{deliveryNext:i,shippingAddress:t}=x(),{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(J,{}),children:e(Je,{})})}function Qe(){const{router:i}=h();return i.redirect("/information"),null}const B=i=>e(w,{children:i});function ki(){const{i18n:i,checkout:t}=h(),{nextPage:s,previousPage:n}=pe(),{progress:a,progressing:r}=Ge(),{deliveryNext:l,optionalDuties:g}=x(),m=U("deliveryNext").value,u=i.translate("shipping.shipping_method_title"),S=i.translate("shipping.duties_and_taxes_title"),T=i.translate("general.continue_to_payment_method"),b=t.configuration.layout.isOnePage.value,p=de(),_=ce(),k=Ue(),o=c(()=>Oe(l.value)||k.value.showShipmentBreakdown?"small-400":"base"),v=He(),{
1customizationsBefore:D,customizationsAfter:P}=$e({hasMultipleDeliveryGroups:v.value.hasMultipleDeliveryGroups,targeted:!1}).value,A=I("Checkout::Dynamic::Render","DELIVERY1"),V=I("Checkout::Dynamic::Render","DELIVERY2");We({stage:m?N.Usable:N.Complete,id:"Shipping"}),Re("shipping");const M=c(()=>l.value==null||l.value.status==="unavailable");Ne(y=>{y.type==="success"&&y.negotiationStage==="progression"&&(p("pageSubmit",{timestamp:new Date}),_({type:"page_submit",page:"shipping"}))});const Y=c(()=>!!l.value);te(()=>{Y.value&&F(()=>{p("shippingMethodsFilled",{timestamp:new Date}),_({type:"shipping_methods_filled"})})});const C=c(()=>{const y=v.value.onlyDeliveryGroupType;return{groupType:y?Ae(y):void 0,includeDeliverySelectionGroups:!1}});return e(ne,{children:[e(Fe,{children:i.translate("shipping.title")}),e(ue,{onSubmit:()=>a("shipping-page-submit"),disabled:r.value||M.value,implicitSubmit:T,children:e(he,{section:"delivery",children:e(ge,{section:"delivery",children:e(me,{children:[e(ve,{children:[e(E,{customizations:A,render:B}),e(w,{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}),je("shipping.shipping_method_notice",i)?e(ye,{children:i.translate("shipping.shipping_method_notice")}):null]}),e(f,{gap:"base",children:e(fe,{children:[e(d,{when:()=>k.value.showShipmentBreakdown,children:e(Ee,{children:e(Me,{})})}),e(E,{customizations:D,options:C.value}),e(Ve,{}),e(E,{customizations:P,options:C.value})]})})]})}),e(d,{when:()=>g.value?.refuseDutiesPermitted,children:e(w,{accessibilityLabel:S,children:e(f,{gap:"large-200",children:[e(z,{id:`${G}-duties-and-taxes`,level:1,children:S}),e(xe,{})]})})}),e(E,{customizations:V,render:B})]}),e(Se,{children:[e(be,{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(_e,{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(ke,{type:"chevron-left",size:"small"}),e(De,{children:n.label})]})})}):null]})]})})})}),e(Pe.Prefetch,{})]})}export{ki 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.