1import{T as e,bh as n,S as t,a1 as i,n as r,aJ as o,cU as a,dq as s,dr as l,ds as c,ai as d,W as u}from"./4c290a1e.C6TDJ9Fn.js";import{l as m,m as h,T as p,x as y,u as f,S as v,_ as g,N as b,v as P}from"./2c1ab0fe.GMbxnz74.js";import{cC as _,c as x,o as S,br as T,b2 as C,P as z,B as L,bt as w,ai as E,n as k}from"./164ad2e3.BbIvMjRY.js";import{g as I,p as M,T as B}from"./d5d34b3b.81uMJHYl.js";function W(){const r=e(),{value:o}=r.deliveryExpectations,a=n("deliveryExpectations").value,{value:s}=r.deliveryNext,l=n("deliveryNext").value,{shop:{asyncDeliveryPromiseExperienceEnabled:c},observability:d}=t(),u=m();return h(()=>{if(!a&&"filled"===s?.status&&"filled"===o?.status&&u.current&&(u.current(),u.current=void 0),"filled"===s?.status&&a){const e=performance.now();u.current=()=>{const n=performance.now()-e;d.histogram({name:"delivery_expectations_loading_duration",value:n})}}},[o?.status,s?.status,l,a,d]),{deliveryExpectationLines:(()=>{const e=o?.deliveryExpectationLines?.some(({brandedPromise:e})=>e?.handle===i.BuyWithPrime);if("filled"===o?.status&&(c||e))return o?.deliveryExpectationLines})(),deliveryExpectationLinesLoading:void 0===o,status:o?.status}}function D(e){if(e.length<2)return!1;const n=e.map(e=>{const n=r(e);return n?o(n):void 0}),[t]=n;return Boolean(t&&n.every(e=>e===t))}function O(e){const n=[],t=new Map;for(const i of e){const e=a(i)??i.methods[0],r=e&&o(e),s=r?t.get(r):void 0;if(s)s.push(i);else{const e=[i];r&&t.set(r,e),n.push(e)}}return n.length===e.length?e:n.map(e=>{const n=e[0];return 1===e.length&&n?n:function(e){const n=s(e.map((e,n)=>({index:n,rate:e})),A).rate,t=e.flatMap(e=>e.targetMerchandiseLines??[]),i=a(n)??n.methods[0];return{...n,methods:i&&i!==n.methods[0]?[i,...n.methods.filter(e=>e!==i)]:n.methods,targetMerchandiseLines:t.length?t:n.targetMerchandiseLines}}(e)})}function A(e){const n=a(e)??e.methods[0],t=n?.priceBreakdown?.map(({amount:e})=>e.amount);return t?.length?Math.max(...t):n?.cost.amount??0}function U(e){const n=new Map;for(const t of e){const e=t.fields.id.value,i=t.fields.deliveryMethodHandle.value;e&&i&&n.set(e,i)}return n}function $(e,n){return e.map(e=>{const t=e.id?n.get(e.id):void 0;return{line:e,method:e.methods.find(({handle:e})=>e===t)}})}function H(e,n,t=(e,n)=>o(n)){const i=n.map(({line:e,method:n},i)=>({lineIndex:i,amountCombinabilityToken:n?t(e,n):void 0,amount:n?.cost.amount})),r=new Set;return e.forEach((e,n)=>{for(const o of e.methods){const a=o.cost.amount,s=t(e,o);s&&(i.some(e=>e.lineIndex!==n&&e.amountCombinabilityToken===s&&void 0!==e.amount&&(e.amount>a||e.amount===a&&e.lineIndex<n))&&r.add(o))}}),r}function N(e){const[n]=e;if(!n)return;const t=l(e,e=>e.cost.amount,o);return{amount:e.reduce((e,n,i)=>t.has(i)?e:e+n.costAfterDiscounts.amount,0),currencyCode:n.costAfterDiscounts.currencyCode}}function j(e){const n=p(()=>I(e),[e]);return{theme:p(()=>M(n),[n])}}function F({brandedPromise:e,useCompactLogo:n}){const t=m(null),[i,r]=y(null);h(()=>{r(t.current)},[t]);const{theme:o}=j(i),a=X(o,e,t,n);return f("div",{ref:t,className:"Hlr02",children:a})}const X=(e,n,t,i)=>{if(e&&t.current){const t=q(e,n,i);if(t)return f(_,{src:t,alt:n.name,aspectRatio:"auto",className:R(n,t,i)})}return null},q=(e,n,t)=>{const i=e===B.Dark?"dark":"light";return n[`${i}Theme${t?"CompactLogoUrl":"LogoUrl"}`]||n[`${i}ThemeLogoUrl`]||n.logoUrl||""},R=(e,n,t)=>{if(((e,n)=>"shop_promise"===e.handle&&n.includes("shop_promise_2026"))(e,n))return t?"jrKZE":"TtorW"},J=void 0,K=!0,V="small400";function Z({cost:e,costAfterDiscounts:n,included:i=!1,inlineDiscount:r,preDiscountCost:o=!1,styleOverrides:a={}}){const{shop:s,i18n:l}=t(),u=!s.hasFlagEnabled(c),{textSize:m=J,shouldBold:h=K,freeTextLetterCase:p="uppercase",costSpacing:y=V}=a,g=h?"strong":void 0,{amount:b}=e,{amount:P}=n,_=u&&b>P,C=e=>e?f(S,{accessibilityVisibility:"exclusive",children:e}):null,z=({cost:e,accessibilityContext:n,isOriginalPrice:t=!1})=>{const i=0===e.amount;let o=m;return t&&(o=r?"base":"small"),f(v,i?{children:[C(n),f(S,{type:g,size:o,letterCase:p,children:l.translate("shipping.free_rate_label")})]}:{children:[C(n),f(S,{type:t?"redundant":g,color:t?"subdued":void 0,size:o,translate:!1,children:l.formatCurrency(e.amount,{currency:e.currencyCode})})]})},L=z({cost:n,accessibilityContext:_?l.translate("order_summary.price_after_discount_aria_text"):void 0});if(i&&P>0){const e=z({cost:n,accessibilityContext:l.translate("order_summary.original_price"),isOriginalPrice
1:!0}),t=f(T,{size:m,strong:h});return f(x,r?{direction:"inline",display:"inline",gap:d(y),alignItems:"baseline",children:[e,t]}:{gap:d(y),alignItems:"end",children:[e,t]})}if(o)return z({cost:e,accessibilityContext:l.translate("order_summary.original_price")});if(_){const n=z({cost:e,accessibilityContext:l.translate("order_summary.original_price"),isOriginalPrice:!0});return f(x,r?{direction:"inline",display:"inline",gap:d(y),alignItems:"baseline",children:[n,L]}:{gap:d(y),alignItems:"end",children:[n,L]})}return L}var G=(e=>(e.Sync="Sync",e.Async="Async",e))(G||{});const Q=new Map([[i.BuyWithPrime,"Sync"],["shop_promise","Async"]]);function Y({show:e,children:n,from:t={opacity:0},to:i={opacity:1},options:r={duration:500,fill:"forwards"},onStart:o,onEnd:a,animateOnShow:s=!0,animateOnHide:l=!0,unmountOnHide:c=!0}){const d=m(null),[u,p]=y(e),v=()=>{p(!1),a?.()},b={duration:500,fill:"forwards",...r};return g(()=>{if(u&&s){const e=d.current;if(e&&"function"==typeof e.animate)try{e.animate([t,i],b)}catch{}}},[u,s]),h(()=>{const n=d.current;if(e)o?.(),p(!0);else if(l&&n&&"function"==typeof n.animate)try{const e=n.animate([i,t],b);e&&(e.onfinish=v)}catch{v()}else v()},[e,l]),u||!c?f("div",{ref:d,children:n}):null}const ee=b(function({timeInTransit:e,price:n,textSize:t,paragraphColor:i}){const r=C()(e);return null===r?null:f(z,{color:i,size:t,children:[f("bdi",{children:n?`(${r})`:r}),n?` · ${n}`:null]})});function ne({title:e,price:n,textSize:t,paragraphColor:i}){return f(z,!e&&n?{color:i,children:n}:{color:i,size:t,children:[f("bdi",{children:n?`(${e})`:e}),n?` · ${n}`:null]})}const te=b(function({timeInTransit:e,title:n,price:t,textSize:i,paragraphColor:r}){return n?f(ne,{title:n,price:t,textSize:i,paragraphColor:r}):e?f(ee,{timeInTransit:e,price:t,textSize:i,paragraphColor:r}):t?f(z,{color:r,size:i,children:t}):null});function ie(e,n){const{i18n:i}=t(),{brandedPromise:r}=n||{},{deliveryPromisePresentmentTitle:o}=e,{deliveryExpectationPresentmentTitle:a}=n||{},s=o?.short||"",l=o?.long||"",c=(e,n)=>n?e?.handle?n:i.translate("delivery_promise.estimated_delivery_format",{date:n}):"",d=c(r,a?.short),u=c(r,r?.handle?a?.long:a?.short);return{shouldDisplayPlaceholderTitle:Boolean((l||s)&&!u&&!d),deliveryPromiseTitle:u,deliveryPromiseTitleShort:d,deliveryPromisePlaceholderTitle:l,deliveryPromisePlaceholderTitleShort:s}}const re={ShopPromiseWrapper:"x45Lq",WrapperHeightSmall:"m39UP",Branded:"_5XR55",Unbranded:"PWTWF"};function oe({deliveryMethod:e,deliveryExpectationLine:n,estimatedTimeInTransit:i,hideDescription:r,formatContent:o=e=>e,paragraphColor:a,size:s}){const{deliveryPromiseTitle:l,deliveryPromisePlaceholderTitleShort:c,deliveryPromisePlaceholderTitle:d,deliveryPromiseTitleShort:p,shouldDisplayPlaceholderTitle:g}=ie(e,n),[b,_]=y(Boolean(l)),S=m(g),T=m(!1),C=m(null),[E,k]=y(null),{theme:I}=j(E),{observability:M,checkout:B}=t(),{shippingAddress:W}
1=u(),D="shop_promise"===n?.brandedPromise?.handle,O=ae(I,n?.brandedPromise?.handle),A=B.configuration.layout.isOnePage.value,{short:U,long:$}=n?.deliveryExpectationPresentmentTitle||{};h(()=>{k(C.current)},[C]),h(()=>{if(!T.current&&(U||$)){T.current=!0;const e=W.value.countryCode;M.counter({name:"estimated_delivery_date_rendered",value:1,attributes:{branded:String(D),...e&&{country_code:e}}})}},[U,$,D,W,M]);const H=l||p,N=d||c,X=e.description?.trim()||void 0;return H||N||D||X&&!r?o(f(x,{children:[(H||N||D)&&f("div",{className:P({[re.ShopPromiseWrapper]:!0,[re.WrapperHeightSmall]:"small"===s}),ref:C,children:[f(Y,{show:g&&!l,options:{duration:300},onEnd:()=>_(!0),animateOnShow:!1,children:N&&i||!i?f(v,{children:c&&f(z,{color:a,size:s,children:f(w,{children:c})})}):f(te,{timeInTransit:i,textSize:A?void 0:"small",paragraphColor:a})}),f(Y,{animateOnShow:S.current,show:b,from:{opacity:0,transform:"translateX(-10px)"},to:{opacity:1,transform:"translateX(0)"},children:f("div",{className:re[O],children:f(x,{direction:"inline",gap:"small-300",alignItems:"center",children:[f(L,{display:"@media (inline-size >= small) auto, none",children:l&&f(z,{color:a,size:s,children:l})}),f(L,{display:"@media (inline-size >= small) none, auto",children:p&&f(z,{color:a,size:s,children:p})}),D&&n?.brandedPromise&&f(F,{brandedPromise:n.brandedPromise,useCompactLogo:"small"===s})]})})})]}),X&&!r?f(z,{color:a,size:s,children:f("bdi",{children:X})}):null]})):null}const ae=(e,n)=>"shop_promise"===n?e===B.Light?"Branded":"":"Unbranded";function se({deliveryExpectationLine:e,deliveryMethod:n,formatContent:i=e=>e,size:r}){const{observability:o,checkout:{identity:a}}=t(),s="shopPay"===a.current.value,{deliveryPromiseTitle:l,deliveryPromiseTitleShort:c,deliveryPromisePlaceholderTitle:d,deliveryPromisePlaceholderTitleShort:u}=ie(n,e),{deliveryExpectationLinesLoading:y}=W(),g=p(()=>l||c?{long:l,short:c,fallback:!1}:d||u?{long:d,short:u,fallback:!0}:{long:"",short:"",fallback:!1},[d,u,l,c]),b=m(y);return h(()=>{b.current&&!y&&"buy_with_prime"===n.brandedPromise?.handle&&g.fallback&&(o.log("synch_branding_delivery_content_fallback_promise_shown","Fallback delivery promise shown",{is_shop_pay:s}),o.counter({name:"membership_fallback_delivery_promise_text_shown",value:1,attributes:{is_shop_pay:s}}))},[y,n.brandedPromise?.handle,b,s,o,g.fallback]),i(f(x,{direction:"inline",gap:"none small-400",alignItems:"center",children:[y?f(E,{inlineSize:"small"}):f(v,{children:[f(k,{below:"small",children:f(z,{size:r,children:g.long})}),f(k,{above:"extraSmall",children:f(z,{size:r,children:g.short})})]}),n.brandedPromise&&f(F,{brandedPromise:n.brandedPromise,useCompactLogo:"small"===r})]}))}function le(e){const{deliveryMethod:n,deliveryExpectationLine:t}=e,i=n.brandedPromise?.handle??t?.brandedPromise?.handle;return(i?Q.get(i):G.Async)===G.Sync?f(se,{...e}):f(oe,{...e})}export{F as B,le as E,Z as S,H as a,O as b,N as c,te as d,D as i,U as p,$ as s,W as u};
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.