1import{u as e,S as n,s as i,q as t,x as o,m as a,T as s,v as r,W as l}from"./2c1ab0fe.GMbxnz74.js";import{b as d,P as c,L as p,ck as u,bi as h,cl as m,bT as v,i as g,cm as y,w as _,cn as f,co as E,cp as I,cq as C,a4 as P,cr as T,bl as S,c as L,J as O,B as b,S as D,cs as N,U as M,ct as k,cu as R}from"./164ad2e3.B4L1MRYB.js";import{b as x}from"./efa0389a.ZcaEqvMP.js";import{F as A}from"./31cc568e.CVMsqQ1x.js";import{C as H}from"./a422df8c.B9fLTQ4u.js";import{S as z}from"./0727407f.DihGPUji.js";import{u as B,S as U,E as w,d as j}from"./347b440c.-JodZrUc.js";import{S as q,cq as F,bo as V,bp as G,cr as W,bq as $,W as Y,cs as J,y as K,J as Q,a1 as X}from"./4c290a1e.DMQ9xOwP.js";import{P as Z}from"./47b970b2.C6dKnXeF.js";function ee(){const{i18n:i,checkout:t}=q();return t.configuration.layout.isOnePage.value?null:e(n,{children:[e(d,{blockSize:"small-400"}),e(c,{children:i.translate("shipping.shipping_line_delivery_instructions")})]})}function ne({displayAddInstructionsButton:n,onPress:i}){const{i18n:t,checkout:o}=q();return o.configuration.layout.isOnePage.value?n?e(p,{onClick:i,children:t.translate("shipping.add_delivery_instructions")}):null:e(c,{children:t.translate("shipping.shipping_line_delivery_phone")})}const ie=new Set(["DELIVERY_OPTIONS_PHONE_NUMBER_REQUIRED","DELIVERY_OPTIONS_PHONE_NUMBER_DOES_NOT_MATCH_EXPECTED_PATTERN"]),te=new Set(["DELIVERY_OPTIONS_INSTRUCTIONS_INVALID"]),oe=(e,n)=>{if("error"===e.type)for(const i of e.violations)if("UnprocessableTermViolation"===i.__typename&&n.has(i.code))return i.localizedMessage??i.nonLocalizedMessage},ae={OnTop:"sqcDF",LoadingOption:"z2IIo",LoadingOptionBorderNone:"qi1py",LoadingOptionBorderFull:"pcf8k"},se={textSize:"small",freeTextLetterCase:"uppercase"},re={};function le({id:p,type:M="ONE_TIME_PURCHASE",methods:k,loadingAdditionalShippingRates:le=!1,isInSplitCartModal:ue=!1}){const he=v(),{i18n:me,checkout:ve}=q(),ge="base",{negotiate:ye}=g(),{geolocation:_e}=y(),[fe,Ee]=o(_e.country.code),{shippingAddress:Ie}=Y(),Ce=J(),{deliveryExpectationLines:Pe,deliveryExpectationLinesLoading:Te,status:Se}=B(),Le=_("Checkout::ShippingMethodDetails::RenderAfter"),Oe=_("Checkout::ShippingMethodDetails::RenderExpanded"),[be]=f(M,p),De=E(),[Ne,Me]=I({type:M,id:p,deliveryMethodType:De.value?"SHIPPING":void 0}),ke=t(),{setInverseGroupDeliveryMethodHandle:Re,getInverseGroupDeliveryMethodHandle:xe}=C(k,M),Ae=k.find(e=>e.handle===Ne),{validated:He,value:ze,error:Be}=function(e,n="ONE_TIME_PURCHASE",o){const a=F(),s=u(n,o),{i18n:r,checkout:{wallets:l}}=q();h(i(e=>{const n=oe(e,ie);n&&(a.value=n)},[a]));const d=t(void 0),c=l.activeSession.value?d:a;return V(s,c,n=>{if(l.activeSession.value)return;const i=W(n);return e&&e.phoneRequired?i?void 0:r.translate("field_errors.shipping_line_phone_invalid"):void 0},G.InvalidDeliveryMethodPhoneNumber),{value:s,error:a,validated:$(s,a,void 0)}}(Ae,M,p),{validated:Ue,value:we,error:je}=function(e="ONE_TIME_PURCHASE",n){const t=F(),o=m(e,n);return h(i(e=>{const n=oe(e,te);n&&(t.value=n)},[t])),{value:o,error:t,validated:$(o,t,void 0)}}(M,p),qe=ve.configuration.layout.isOnePage.value,[Fe,Ve]=o(!qe||void 0!==Ue?.value);let Ge=k;be.includes("PICKUP_POINT")&&(Ge=Ge.filter(e=>"PickupPointLocation"===e.pickupLocation?.type&&"PickupPointLocation"===Ae?.pickupLocation?.type&&e.pickupLocation?.handle===Ae?.pickupLocation?.handle));const We=Ge.map(e=>Boolean(e?.deliveryPredictionEligible));a(()=>{const{phone:e}=Ie.fields,n=e.value;!He.value&&n&&He.onChange(n)},[]),a(()=>{const{countryCode:e}=Ie.fields,n=e.value;n&&Ee(n)},[Ie]);const $e=s(()=>({state:{phone:ze,instructions:we},errors:{phone:Be,instructions:je}}),[ze,Be,we,je]),Ye=i(()=>{He.clearError(),Ue.clearError()},[He,Ue]),{optionList:{border:Je="full"}}=P(),Ke=i(([e=""])=>{if(Ye(),Me(e),Ce.value&&null==p){const n=xe(e);Re(n)}ue?ke.value=e:(ye({legacyFiltering:{include:["deliveryNext"]},silenceViolations:K(["deliveryNext"])}),he("shippingMethodSelected",{timestamp:new Date}))},[ke,Ye,Me,Ce,p,ue,ye,xe,Re,he]);a(()=>{if(!ue)return void(ke.value=void 0);const e=ke.value;e&&e!==Ne&&k.some(n=>n.handle===e)&&Me(e)},[ue,k,Ne,Me,ke]);const Qe=(n,i,t)=>{const o=i||t,a=Oe.length>0&&!ue;return o?e(pe,{children:[e(A,{children:[i&&e(b,{children:[e(Z,{label:me.translate("shipping.shipping_line_delivery_phone_label"),countryCode:fe,prefillCountryCode:!0,...He}),e(d,{blockSize:"small-400"}),e(ne,{displayAddInstructionsButton:t&&!Fe,onPress:()=>Ve(!0)})]}),t&&Fe&&e(b,{children:[e(R,{autoFocus:!0,maxLength:255,label:me.translate("shipping.optional_shipping_line_delivery_instructions_label"),rows:1,...Ue}),e(ee,{})]})]}),a&&e(de,{customizations:Oe,isInModal:!1,handle:n})]}):a?e(de,{customizations:Oe,handle:n,isInModal:!1,render:n=>e(pe,{children:n})}):null},Xe=p?`_${Q(p)}`:"",Ze="ONE_TIME_PURCHASE"===M?`shipping_methods${Xe}`:`${M.toLowerCase()}_shipping_methods${Xe}`,en=Le.length>0,nn=1===Ge.length,tn=s(()=>Ne?[Ne]:[],[Ne]),on=ue?se:re;return e(N,{...$e,children:e("div",{className:ae.OnTop,children:e(H,{name:Ze,title:me.translate("general.choose_shipping_method"),titleHidden:!0,values:tn,onChange:Ke,hideRadioControl:nn,children:[Ge.map((i,t)=>{const o=We[t]||i.brandedPromise?.handle===X.BuyWithPrime,{showEstimatedDeliveryLabel:a}=T(i,Boolean(o),Pe,Te,Se),{acceptsInstructions:s,cost:r,costAfterDiscounts:l,description:d,estimatedTimeInTransit:p,handle:u,hideDiscountedTotalOnShippingSelector:h,included:m,pickupLocation:v,phoneRequired:g}=i,y=Pe?.find(e=>e.deliveryStrategyHandle===u),_=S({deliveryMethod:i,localDelivery:"LOCAL"===i.methodType?me.translate("shipping.local_delivery"):void 0});return e(x,{value:u,renderSelectedContentWhenCollapsed:!0,selectedContent:Qe(u,g,s)??void 0,details:e(n,{children:[o&&e(w,{deliveryMethod:i,deliveryExpectationLine:y,paragraphColor:ge}),!o&&a&&e(j,{timeInTransit:p,minDeliveryDateTime:i?.minDeliveryDateTime,maxDeliveryDateTime:i?.maxDeliveryDateTime,title:i?.deliveryPromisePresentmentTitle?.short,paragraphColor:ge}),d&&!o&&e(c,{color:ge,children:e("bdi",{children:d})}),"PickupInStoreLocation"===v?.type&&e(ce,{pickupLocation:v})]}),secondaryContent:e(U,{cost:r,costAfterDiscounts:l,included:m,styleOverrides:on,preDiscountCost:h}),tertiaryContent:en&&e(de,{customizations:Le,handle:u,isInModal:ue,render:n=>e(L,{padding:"small-100 none none none",gap:"small-100",children:n})}),children:e(z,{methodTitle:_})},u)}),le?e("div",{className:r([ae.LoadingOption,ae[l("LoadingOptionBorder",Je)]]),children:e(O,{gridAutoFlow:"column",gridTemplateColumns:"minmax(auto, max-content) minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",gap:"base",alignItems:"center",alignContent:"center",children:[e(b,{children:e(D,{})}),e(c,{color:"subdued",type:"small",children:me.translate("shipping.loading_progressive_rates")}
1)]})}):null]})})})}function de({customizations:n,handle:i,isInModal:t,render:o}){const a=s(()=>({handle:i,isInModal:t}),[i,t]);return e(M,{customizations:n,options:a,render:o})}function ce({pickupLocation:i}){const t=k(i.address,{hiddenFields:["firstName","lastName","phone","company","countryCode","postalCode"]});return e(n,{children:[e(c,{type:"small",children:t}),e(c,{type:"small",children:i.instructions})]})}function pe({children:n}){return e(L,{gap:"large-200",children:n})}export{le as S};
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.