1import{u as e,S as n,q as i,o as t,z as o,h as a,T as s,m as r,a6 as l}from"./2c1ab0fe.Bywc2Brn.js";import{d,f as c,L as p,ct as u,br as h,cu as m,m as v,v as g,cv as _,o as y,cw as f,cx as E,t as I,cy as C,K as P,cz as T,bG as L,S,ab as b,b as O,c as D,cA as N,U as M,cB as k,cC as R}from"./164ad2e3.DHuJhR22.js";import{b as A}from"./efa0389a.BrVghuh8.js";import{F as x}from"./3ca8ef7e.DWjSQTNc.js";import{C as z}from"./a422df8c.69YDwZq9.js";import{u as H,S as B,a as U,E as w,e as j}from"./347b440c.8UmgLgUR.js";import{c as F,bd as V,b2 as q,b3 as G,c8 as $,b4 as W,c9 as Y,Z as K,v as Q,W as X}from"./9dba8418.DInoCEzY.js";import{P as Z}from"./47b970b2.CJVz388Q.js";function J(){const{i18n:i,checkout:t}=F();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 ee({displayAddInstructionsButton:n,onPress:i}){const{i18n:t,checkout:o}=F();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 ne=new Set(["DELIVERY_OPTIONS_PHONE_NUMBER_REQUIRED","DELIVERY_OPTIONS_PHONE_NUMBER_DOES_NOT_MATCH_EXPECTED_PATTERN"]),ie=new Set(["DELIVERY_OPTIONS_INSTRUCTIONS_INVALID"]),te=(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},oe={OnTop:"sqcDF",LoadingOption:"z2IIo",LoadingOptionBorderNone:"qi1py",LoadingOptionBorderFull:"pcf8k"},ae={textSize:"small",freeTextLetterCase:"uppercase"},se={};function re({id:p,type:M="ONE_TIME_PURCHASE",methods:k,loadingAdditionalShippingRates:re=!1,isInSplitCartModal:pe=!1}){const ue=v(),{i18n:he,checkout:me}=F(),ve="base",{negotiate:ge}=g(),{geolocation:_e}=_(),[ye,fe]=o(_e.country.code),{shippingAddress:Ee}=me.negotiator.parts,Ie=Y(),{deliveryExpectationLines:Ce,deliveryExpectationLinesLoading:Pe,status:Te}=H(),Le=y("Checkout::ShippingMethodDetails::RenderAfter"),Se=y("Checkout::ShippingMethodDetails::RenderExpanded"),[be]=f(M,p),Oe=E(),[De,Ne]=I({type:M,id:p,deliveryMethodType:Oe.value?"SHIPPING":void 0}),Me=t(),{setInverseGroupDeliveryMethodHandle:ke,getInverseGroupDeliveryMethodHandle:Re}=C(k,M),Ae=k.find(e=>e.handle===De),{validated:xe,value:ze,error:He}=function(e,n="ONE_TIME_PURCHASE",o){const a=V(),s=u(n,o),{i18n:r,checkout:{wallets:l}}=F();h(i(e=>{const n=te(e,ne);n&&(a.value=n)},[a]));const d=t(void 0),c=l.activeSession.value?d:a;return q(s,c,n=>{if(l.activeSession.value)return;const i=$(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:W(s,a,void 0)}}(Ae,M,p),{validated:Be,value:Ue,error:we}=function(e="ONE_TIME_PURCHASE",n){const t=V(),o=m(e,n);return h(i(e=>{const n=te(e,ie);n&&(t.value=n)},[t])),{value:o,error:t,validated:W(o,t,void 0)}}(M,p),je=me.configuration.layout.isOnePage.value,[Fe,Ve]=o(!je||void 0!==Be?.value);let qe=k;be.includes("PICKUP_POINT")&&(qe=qe.filter(e=>"PickupPointLocation"===e.pickupLocation?.type&&"PickupPointLocation"===Ae?.pickupLocation?.type&&e.pickupLocation?.handle===Ae?.pickupLocation?.handle));const Ge=qe.map(e=>Boolean(e?.deliveryPredictionEligible));a(()=>{const{phone:e}=Ee.fields,n=e.value;!xe.value&&n&&xe.onChange(n)},[]),a(()=>{const{countryCode:e}=Ee.fields,n=e.value;n&&fe(n)},[Ee]);const $e=s(()=>({state:{phone:ze,instructions:Ue},errors:{phone:He,instructions:we}}),[ze,He,Ue,we]),We=i(()=>{xe.clearError(),Be.clearError()},[xe,Be]),{optionList:{border:Ye="full"}}=P(),Ke=i(([e=""])=>{if(We(),Ne(e),Ie.value&&null==p){const n=Re(e);ke(n)}pe?Me.value=e:(ge({silenceViolations:K(["deliveryNext"])}),ue("shippingMethodSelected",{timestamp:new Date}))},[Me,We,Ne,Ie,p,pe,ge,Re,ke,ue]);a(()=>{if(!pe)return void(Me.value=void 0);const e=Me.value;e&&e!==De&&k.some(n=>n.handle===e)&&Ne(e)},[pe,k,De,Ne,Me]);const Qe=(n,i,t)=>{const o=i||t,a=Se.length>0&&!pe;return o?e(ce,{children:[e(x,{children:[i&&e(O,{children:[e(Z,{label:he.translate("shipping.shipping_line_delivery_phone_label"),countryCode:ye,prefillCountryCode:!0,...xe}),e(d,{blockSize:"small-400"}),e(ee,{displayAddInstructionsButton:t&&!Fe,onPress:()=>Ve(!0)})]}),t&&Fe&&e(O,{children:[e(R,{autoFocus:!0,maxLength:255,label:he.translate("shipping.optional_shipping_line_delivery_instructions_label"),rows:1,...Be}),e(J,{})]})]}),a&&e(le,{customizations:Se,isInModal:!1,handle:n})]}):a?e(le,{customizations:Se,handle:n,isInModal:!1,render:n=>e(ce,{children:n})}):null},Xe=p?`_${Q(p)}`:"",Ze="ONE_TIME_PURCHASE"===M?`shipping_methods${Xe}`:`${M.toLowerCase()}_shipping_methods${Xe}`,Je=Le.length>0,en=1===qe.length,nn=s(()=>De?[De]:[],[De]),tn=pe?ae:se;return e(N,{...$e,children:e("div",{className:oe.OnTop,children:e(z,{name:Ze,title:he.translate("general.choose_shipping_method"),titleHidden:!0,values:nn,onChange:Ke,hideRadioControl:en,children:[qe.map((i,t)=>{const o=Ge[t]||i.brandedPromise?.handle===X.BuyWithPrime,{showEstimatedDeliveryLabel:a}=T(i,Boolean(o),Ce,Pe,Te),{acceptsInstructions:s,cost:r,costAfterDiscounts:l,description:d,estimatedTimeInTransit:p,handle:u,hideDiscountedTotalOnShippingSelector:h,included:m,pickupLocation:v,phoneRequired:g}=i,_=Ce?.find(e=>e.deliveryStrategyHandle===u),y=L({deliveryMethod:i,localDelivery:"LOCAL"===i.methodType?he.translate("shipping.local_delivery"):void 0});return e(A,{value:u,renderSelectedContentWhenCollapsed:!0,selectedContent:Qe(u,g,s)??void 0,details:e(n,{children:[o&&e(w,{deliveryMethod:i,deliveryExpectationLine:_,paragraphColor:ve}),!o&&a&&e(j,{timeInTransit:p,minDeliveryDateTime:i?.minDeliveryDateTime,maxDeliveryDateTime:i?.maxDeliveryDateTime,title:i?.deliveryPromisePresentmentTitle?.short,paragraphColor:ve}),d&&!o&&e(c,{color:ve,children:e("bdi",{children:d})}),"PickupInStoreLocation"===v?.type&&e(de,{pickupLocation:v})]}),secondaryContent:e(U,{cost:r,costAfterDiscounts:l,included:m,styleOverrides:tn,preDiscountCost:h}),tertiaryContent:Je&&e(le,{customizations:Le,handle:u,isInModal:pe,render:n=>e(S,{padding:"small-100 none none none",gap:"small-100",children:n})}),children:e(B,{methodTitle:y})},u)}),re?e("div",{className:r([oe.LoadingOption,oe[l("LoadingOptionBorder",Ye)]]),children:e(b,{gridAutoFlow:"column",gridTemplateColumns:"minmax(auto, max-content) minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",gap:"base",alignItems:"center",alignContent:"center",children:[e(O,{children:e(D,{})}),e(c,{color:"subdued",type:"small",children:he.translate("shipping.loading_progressive_rates")}
1)]})}):null]})})})}function le({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 de({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 ce({children:n}){return e(S,{gap:"large-200",children:n})}export{re 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.