PageSourceSearch

https://shop.newbelgium.com/cdn/shopifycloud/checkout-web/assets/c1/EstimatedDeliveryContent.P3UYo-F2.js

js newbelgium.com collected 2026-09-24 08:50:21 UTC 8,754 bytes, 1 lines download raw bytes

1import{A as S,h as x,T as W,k as A,u as n,S as w,_ as oe,Q as j,g as ie}from"./esnext-vendor.D7ldIee_.js";import{cs as se,k as T,l as O,bk as le,a$ as ae,P as g,B as X,bn as ce,al as de,H as G}from"./hydrate.ByRIsqvd.js";import{$ as ue,bb as V,N as k,ap as q,c$ as me,ak as B,O as he}from"./addresses-is-address-empty.-MuOhIyI.js";import{g as ye,p as pe,T as Q}from"./ShippingMethodRateLabel.DfFHFGoZ.js";function fe(){const t=ue(),{value:e}=t.deliveryExpectations,o=V("deliveryExpectations").value,{value:r}=t.deliveryNext,i=V("deliveryNext").value,{shop:{asyncDeliveryPromiseExperienceEnabled:a},observability:l}=k(),s=S();return x(()=>{if(!o&&r?.status==="filled"&&e?.status==="filled"&&s.current&&(s.current(),s.current=void 0),r?.status==="filled"&&o){const u=performance.now();s.current=()=>{const m=performance.now()-u;l.histogram({name:"delivery_expectations_loading_duration",value:m})}}},[e?.status,r?.status,i,o,l]),{deliveryExpectationLines:(()=>{const u=e?.deliveryExpectationLines?.some(({brandedPromise:c})=>c?.handle===q.BuyWithPrime);if(e?.status==="filled"&&(a||u))return e?.deliveryExpectationLines})(),deliveryExpectationLinesLoading:e===void 0,status:e?.status}}function Y(t){const e=W(()=>ye(t),[t]);return{theme:W(()=>pe(e),[e])}}const ge="Hlr02",Pe="TtorW",ve="jrKZE",$={InlineLogo:ge,Logo:Pe,LogoCompact:ve};function J({brandedPromise:t,useCompactLogo:e}){const o=S(null),[r,i]=A(null);x(()=>{i(o.current)},[o]);const{theme:a}=Y(r),l=_e(a,t,o,e);return n("div",{ref:o,className:$.InlineLogo,children:l})}const _e=(t,e,o,r)=>{if(t&&o.current){const i=be(t,e,r);if(i)return n(se,{src:i,alt:e.name,aspectRatio:"auto",className:Ee(e,i,r)})}return null},be=(t,e,o)=>{const r=t===Q.Dark?"dark":"light";return e[`${r}Theme${o?"CompactLogoUrl":"LogoUrl"}`]||e[`${r}ThemeLogoUrl`]||e.logoUrl||""},Te="shop_promise_2026",Se=(t,e)=>t.handle==="shop_promise"&&e.includes(Te),Ee=(t,e,o)=>{if(Se(t,e))return o?$.LogoCompact:$.Logo},Le=void 0,xe=!0,De="small400";function Xe({cost:t,costAfterDiscounts:e,included:o=!1,inlineDiscount:r,preDiscountCost:i=!1,styleOverrides:a={}}){const{shop:l,i18n:s}=k(),d=!l.hasFlagEnabled(me),{textSize:u=Le,shouldBold:c=xe,freeTextLetterCase:m="uppercase",costSpacing:h=De}=a,y=c?"strong":void 0,{amount:v}=t,{amount:f}=e,P=d&&v>f,I=p=>p?n(O,{accessibilityVisibility:"exclusive",children:p}):null,E=({cost:p,accessibilityContext:_,isOriginalPrice:L=!1})=>{const b=p.amount===0;let C=u;return L&&(C=r?"base":"small"),b?n(w,{children:[I(_),n(O,{type:y,size:C,letterCase:m,children:s.translate("shipping.free_rate_label")})]}):n(w,{children:[I(_),n(O,{type:L?"redundant":y,color:L?"subdued":void 0,size:C,translate:!1,children:s.formatCurrency(p.amount,{currency:p.currencyCode})})]})},D=E({cost:e,accessibilityContext:P?s.translate("order_summary.price_after_discount_aria_text"):void 0});if(o&&f>0){const p=E({cost:e,accessibilityContext:s.translate("order_summary.original_price"),isOriginalPrice:!0}),_=n(le,{size:u,strong:c});return r?n(T,{direction:"inline",display:"inline",gap:B(h),alignItems:"baseline",children:[p,_]}):n(T,{gap:B(h),alignItems:"end",children:[p,_]})}if(i)return E({cost:t,accessibilityContext:s.translate("order_summary.original_price")});if(P){const p=E({cost:t,accessibilityContext:s.translate("order_summary.original_price"),isOriginalPrice:!0});return r?n(T,{direction:"inline",display:"inline",gap:B(h),alignItems:"baseline",children:[p,D]}):n(T,{gap:B(h),alignItems:"end",children:[p,D]})}return D}var H=(t=>(t.Sync="Sync",t.Async="Async",t))(H||{});const Ce=new Map([[q.BuyWithPrime,"Sync"],["shop_promise","Async"]]);function Z({show:t,children:e,from:o={opacity:0},to:r={opacity:1},options:i={duration:500,fill:"forwards"},onStart:a,onEnd:l,animateOnShow:s=!0,animateOnHide:d=!0,unmountOnHide:u=!0}){const c=S(null),[m,h]=A(t),y=()=>{h(!1),l?.()},v={duration:500,fill:"forwards",...i};return oe(()=>{if(m&&s){const f=c.current;if(f&&typeof f.animate=="function")try{f.animate([o,r],v)}catch{}}},[m,s]),x(()=>{const f=c.current;if(t)a?.(),h(!0);else if(d&&f&&typeof f.animate=="function")try{const P=f.animate([r,o],v);P&&(P.onfinish=y)}catch{y()}else y()},[t,d]),m||!u?n("div",{ref:c,children:e}):null}const ke=j(function({timeInTransit:e,price:o,textSize:r,paragraphColor:i}){const l=ae()(e);return l===null?null:n(g,{color:i,size:r,children:o?`(${l}) · ${o}`:l})});function Ie({title:t,price:e,textSize:o,paragraphColor:r}){return!t&&e?n(g,{color:r,children:e}):n(g,{color:r,size:o,children:e?`(${t}) · ${e}`:t})}const Be=j(function({timeInTransit:e,title:o,price:r,textSize:i,paragraphColor:a}){return o?n(Ie,{title:o,price:r,textSize:i,paragraphColor:a}):e?n(ke,{timeInTransit:e,price:r,textSize:i,paragraphColor:a}):r?n(g,{color:a,size:i,children:r}):null});function ee(t,e){const{i18n:o}=k(),{brandedPromise:r}=e||{},{deliveryPromisePresentmentTitle:i}=t,{deliveryExpectationPresentmentTitle:a}=e||{},l=i?.short||"",s=i?.long||"",d=(h,y)=>y?h?.handle?y:o.translate("delivery_promise.estimated_delivery_format",{date:y}):"",u=d(r,a?.short),c=r?.handle?d(r,a?.long):d(r,a?.short);return{shouldDisplayPlaceholderTitle:!!((s||l)&&!c&&!u),deliveryPromiseTitle:c,deliveryPromiseTitleShort:u,deliveryPromisePlaceholderTitle:s,deliveryPromisePlaceholderTitleShort:l}}const Ae="x45Lq",we="m39UP",Ne="_5XR55",Ue="PWTWF",F={ShopPromiseWrapper:Ae,WrapperHeightSmall:we,Branded:Ne,Unbranded:Ue};function Oe({deliveryMethod:t,deliveryExpectationLine:e,estimatedTimeInTransit:o,hideDescription:r,formatContent:i=s=>s,paragraphColor:a,size:l}){const{deliveryPromiseTitle:s,deliveryPromisePlaceholderTitleShort:d,deliveryPromisePlaceholderTitle:u,deliveryPromiseTitleShort:c,shouldDisplayPlaceholderTitle:m}=ee(t,e),[h,y]=A(!!s),v=S(m),f=S(!1),P=S(null),[I,E]=A(null),{theme:D}=Y(I),{observability:p,checkout:_}=k(),{shippingAddress:L}=he(),b=e?.brandedPromise?.handle==="shop_promise",C=Fe(D,e?.brandedPromise?.handle),te=_.configuration.layout.isOnePage.value,{short:R,long:K}=e?.deliveryExpectationPresentmentTitle||{};x(()=>{E(P.current)},[P]),x(()=>
1{if(!f.current&&(R||K)){f.current=!0;const z=L.value.countryCode;p.counter({name:"estimated_delivery_date_rendered",value:1,attributes:{branded:String(b),...z&&{country_code:z}}})}},[R,K,b,L,p]);const M=s||c,N=u||d,U=t.description?.trim()||void 0;if(!M&&!N&&!b&&!(U&&!r))return null;const ne=()=>N&&o||!o?n(w,{children:d&&n(g,{color:a,size:l,children:n(ce,{children:d})})}):n(Be,{timeInTransit:o,textSize:te?void 0:"small",paragraphColor:a}),re=n(T,{children:[(M||N||b)&&n("div",{className:ie({[F.ShopPromiseWrapper]:!0,[F.WrapperHeightSmall]:l==="small"}),ref:P,children:[n(Z,{show:m&&!s,options:{duration:300},onEnd:()=>y(!0),animateOnShow:!1,children:ne()}),n(Z,{animateOnShow:v.current,show:h,from:{opacity:0,transform:"translateX(-10px)"},to:{opacity:1,transform:"translateX(0)"},children:n("div",{className:F[C],children:n(T,{direction:"inline",gap:"small-300",alignItems:"center",children:[n(X,{display:"@media (inline-size >= small) auto, none",children:s&&n(g,{color:a,size:l,children:s})}),n(X,{display:"@media (inline-size >= small) none, auto",children:c&&n(g,{color:a,size:l,children:c})}),b&&e?.brandedPromise&&n(J,{brandedPromise:e.brandedPromise,useCompactLogo:l==="small"})]})})})]}),U&&!r?n(g,{color:a,size:l,children:U}):null]});return i(re)}const Fe=(t,e)=>e==="shop_promise"?t===Q.Light?"Branded":"":"Unbranded";function We({deliveryExpectationLine:t,deliveryMethod:e,formatContent:o=i=>i,size:r}){const{observability:i,checkout:{identity:a}}=k(),l=a.current.value==="shopPay",{deliveryPromiseTitle:s,deliveryPromiseTitleShort:d,deliveryPromisePlaceholderTitle:u,deliveryPromisePlaceholderTitleShort:c}=ee(e,t),{deliveryExpectationLinesLoading:m}=fe(),h=W(()=>s||d?{long:s,short:d,fallback:!1}:u||c?{long:u,short:c,fallback:!0}:{long:"",short:"",fallback:!1},[u,c,s,d]),y=S(m);x(()=>{y.current&&!m&&e.brandedPromise?.handle==="buy_with_prime"&&h.fallback&&(i.log("synch_branding_delivery_content_fallback_promise_shown","Fallback delivery promise shown",{is_shop_pay:l}),i.counter({name:"membership_fallback_delivery_promise_text_shown",value:1,attributes:{is_shop_pay:l}}))},[m,e.brandedPromise?.handle,y,l,i,h.fallback]);const v=n(T,{direction:"inline",gap:"none small-400",alignItems:"center",children:[m?n(de,{inlineSize:"small"}):n(w,{children:[n(G,{below:"small",children:n(g,{size:r,children:h.long})}),n(G,{above:"extraSmall",children:n(g,{size:r,children:h.short})})]}),e.brandedPromise&&n(J,{brandedPromise:e.brandedPromise,useCompactLogo:r==="small"})]});return o(v)}function Ge(t){const{deliveryMethod:e,deliveryExpectationLine:o}=t,r=e.brandedPromise?.handle??o?.brandedPromise?.handle;return(r?Ce.get(r):H.Async)===H.Sync?n(We,{...t}):n(Oe,{...t})}export{J as B,Ge as E,Xe as S,Be as a,fe 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.