1import{u as e,S as n,q as i,T as t,w as a,z as s,t as r,s as o,l,C as d}from"./2c1ab0fe.GMbxnz74.js";import{o as c,b5 as p,c as u,bl as m,P as h,cp as g,L as v,bz as b,a5 as y,J as f,H as _,b as T,e as C,v as x,aq as S,B as P,bT as w,l as M,b2 as j,b3 as L,i as k,ac as D,ah as I,ay as E,I as A,U as O}from"./164ad2e3.B4L1MRYB.js";import{C as R,a as q,b as B}from"./efa0389a.ZcaEqvMP.js";import{C as H,u as z}from"./31cc568e.CVMsqQ1x.js";import{S as F,E as G,W as N,b3 as Q,ei as V,y as U}from"./4c290a1e.DMQ9xOwP.js";import{I as J}from"./55098bf1.SNyaSeYe.js";import{m as W}from"./21cc90a2.Ccyorzx_.js";import{E as $,M as Z,d as K,u as X}from"./64de7b49.yFRdciMn.js";import{u as Y,a as ee,i as ne,c as ie,m as te}from"./181d38d3.bNzFxA5T.js";import{B as ae,u as se,E as re,S as oe}from"./347b440c.-JodZrUc.js";import{B as le,D as de}from"./8d3a12c3.olyJ4AR0.js";import{g as ce,a as pe}from"./0e4087ec.LlaIPo70.js";import{S as ue}from"./8e79be58.DbjZmhsu.js";import{S as me}from"./0727407f.DihGPUji.js";import"./9f047e05.DwjCPgK0.js";import"./app.DGSHpWaV.js";import"./0a7dffce.BcNpdEJk.js";import"./5fda1420.BLaDhoyL.js";import"./60a453ce.Cg9T1Gj2.js";import"./bb728e1c.CHt2JlPY.js";import"./d5d34b3b.D0jJQL_d.js";import"./9f3d9f8c.CjcXkBep.js";import"./4aab4b34.WC8lWpKa.js";import"./a422df8c.B9fLTQ4u.js";import"./47b970b2.C6dKnXeF.js";import"./29034f35.DARWjbfB.js";import"./ac5a19ff.BchXgW63.js";function he({summary:n}){const{transitText:i,brandedPromise:t,shipmentCountText:a}=n;return i||a?e(u,{direction:"inline",gap:"small-300",alignItems:"center",children:[i?e(c,{color:"subdued",children:i}):null,t?e(ae,{brandedPromise:t}):null,i&&a?e(c,{color:"subdued",accessibilityVisibility:"hidden",children:p}):null,a?e(c,{color:"subdued",children:a}):null]}):null}function ge({selectedShippingMethod:i}){const{i18n:t}=F(),{deliveryExpectationLines:a}=se(),{cost:s,costAfterDiscounts:r,hideDiscountedTotalOnShippingSelector:o}=i,l=m({deliveryMethod:i,localDelivery:"LOCAL"===i.methodType?t.translate("shipping.local_delivery"):void 0}),d=a?.find(e=>e.deliveryStrategyHandle===i.handle),c=s&&r?e(n,{children:[p,e(oe,{cost:s,costAfterDiscounts:r,inlineDiscount:!0,preDiscountCost:o})]}):null;return e(n,{children:[e(u,{direction:"inline",gap:"small-400",children:[e(me,{methodTitle:l}),c]}),e(re,{deliveryMethod:i,deliveryExpectationLine:d,paragraphColor:"subdued"})]})}function ve({selectedShippingMethod:n,rollupOpen:i}){const{i18n:t}=F();return i?e(h,{color:"subdued",children:t.translate("shipping.shipping_method_title")}):e(u,{children:e(ge,{selectedShippingMethod:n})})}function be({shippingMethods:n,type:i,id:t,displayOnly:a=!1}){const[s]=g({type:i,id:t}),{includedMethods:r}=Y().value,o=r.size?n.map(e=>r.has(e)?ee(e):e):n,l=a?o[0]:o.find(({handle:e})=>e===s);return l?e(H.Provider,{value:!0,children:e(R,{presentation:"base",children:a?e(ve,{selectedShippingMethod:l}):e(u,{gap:"small-400",paddingBlockStart:"small-400",children:[e(ve,{selectedShippingMethod:l,rollupOpen:!0}),e(ue,{type:i,methods:o,id:t,isInSplitCartModal:!0})]})})}):null}function ye({merchandise:s,oneTimePurchaseIndex:r,oneTimePurchaseTotalCount:o}){const l=i(!1),d=i(!1),{i18n:c}=F(),p=s.length,{totalQuantity:m,firstFiveQuantity:g}=t(()=>s.reduce((e,n,i)=>{const t=n.quantity??0;return e.totalQuantity+=t,i<2&&(e.firstFiveQuantity+=t),e},{totalQuantity:0,firstFiveQuantity:0}),[s]),C=c.translate("shipping.split_shipping_merchandise_quantity_label_standard",{quantity:m});return e(f,{gridAutoFlow:"column",gridAutoColumns:"minmax(auto, max-content)",gridTemplateColumns:"minmax(auto, max-content)",gridTemplateRows:"minmax(0, 1fr)",gap:"small-100",alignItems:"center",alignContent:"center",children:[e(a,{when:d,fallback:e(n,{children:[e(u,{direction:"inline",gap:"small-300",children:s.slice(0,2).map(n=>e(Z,{merchandiseItem:n},n.stableId))}),e(v,{onClick:()=>{p>2?l.value=!0:d.value=!0},children:p>2?c.translate("shipping.split_shipping_merchandise_quantity_label_additional",{quantity:m-g}):c.translate("shipping.split_shipping_merchandise_quantity_label_standard",{quantity:m})})]}),children:e($,{merchandise:s})}),e(b,{heading:e(n,{children:[e(_,{level:1,children:C}),e(T,{blockSize:"small-500"}),e(h,{color:"subdued",children:r&&o?c.translate("shipping.split_shipping_merchandise_shipment_number",{number:r,total:o}):c.translate("order_summary.subscriptions")})]}),open:l.value,onHide:()=>l.value=!1,accessibilityLabel:C,children:[e(y,{}),e(f,{gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",gridAutoRows:"minmax(0, 1fr)",gap:"small-100",padding:"base none none none",children:e($,{merchandise:s})})]})]})}function fe({merchandise:n,oneTimePurchaseIndex:i,oneTimePurchaseTotalCount:t}){const o=C(),l=s(n.length>1),d=r(()=>x(o.value.currentDetour)),c=r(()=>l.value&&d.value);return e(a,{when:c,fallback:e($,{merchandise:n,thumbnailSize:d.value?"small":"base",merchandiseItemGap:d.value?"small-200":"base",thumbnailContentGap:d.value?"small-200":"base"}),children:e(ye,{merchandise:n,oneTimePurchaseIndex:i,oneTimePurchaseTotalCount:t})})}function _e({line:i,oneTimePurchaseIndex:t,oneTimePurchaseTotalCount:a,disableBorders:s=!1,heading:r}){const{id:o,type:l,methods:d,targetMerchandiseLines:c}=i,p=S(c??[]),{currentDetour:u}=C().value,m=x(u);return e(P,{"data-delivery-line-id":o,background:"base",colorLayer:"control",border:s?"none":"base",borderRadius:s?"none":"base",children:[r&&e(n,{children:[e(P,{padding:"base",children:e(_,{level:3,children:r})}),e(y,{accessibilityRole:"presentation"})]}),e(P,{padding:"base",children:e(f,{gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(auto, max-content) minmax(0, 1fr)",gridAutoRows:"1fr",gap:"small-100",children:[e(fe,{merchandise:p,oneTimePurchaseIndex:t,oneTimePurchaseTotalCount:a}),e(be,{shippingMethods:d,type:l,id:o,displayOnly:m})]})})]})}function Te({lines:i,heading:t,customNode:a,isSingleCard:s=!1,get
1Sequence:r,showExtendedHeading:o=!1,oneTimePurchaseTotalCount:l}){const{i18n:d}=F(),c=i.length,m=C(),h=K(),{presentsConsolidatedShipping:g}=Y().value;if(!c)return null;const v=i.map((c,u)=>{const v=Boolean(a),b=u+1!==i.length,f=s&&(v||b),_=r(c);return e(n,{children:[e(_e,{line:c,disableBorders:s,heading:(()=>{if(x(m.value.currentDetour)||h.value)return;const e=o?t:void 0;if(g)return e;const n=d.translate("shipping.split_shipping_shipment_number",{number:_});return e?`${n} ${p} ${e}`:n})(),oneTimePurchaseIndex:u+1,oneTimePurchaseTotalCount:l},c.id??G()),f&&e(y,{})]},c.id)});return a&&v.push(a),e(P,{colorLayer:"control",children:e(f,{gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(auto, max-content)",gridAutoRows:"minmax(auto, max-content)",gap:"small-200",children:e(u,s?{gap:"base",children:e(P,{overflow:"hidden",border:"base",borderRadius:"base",children:v})}:{gap:"large-200",children:v})})})}function Ce({shippingGroupLines:n,oneTimePurchaseTotalCount:i}){const{i18n:s,shop:{name:l}}=F(),{buyWithPrimeLines:d,shipsNowLines:c,shipsLaterLines:p}=t(()=>ce(n),[n]),m=t(()=>pe(n),[n]),h=t(()=>{let e=[...d,...c,...p];return m&&(e=[...e,...m.reduce((e,[,n])=>[...e,...n],[])]),e},[d,c,p,m]),g=o(e=>h.indexOf(e)+1,[h]),v=t(()=>d.length>0?s.translate("shipping.split_shipping_shipped_by_shop",{shop_name:l}):s.translate("shipping.pre_order_ships_now"),[d.length,s,l]),b=C(),y=r(()=>x(b.value.currentDetour)),f=p.length>0||!!m&&m?.length>0;return e(u,{gap:"large-200",children:[d.length>0&&e(Te,{lines:d,getSequence:g,heading:s.translate("split_shipping.shipped_by_amazon_prime"),oneTimePurchaseTotalCount:i,customNode:e(a,{when:y,children:e(P,{padding:"small-100 base",children:e(le,{})})}),isSingleCard:!0,showExtendedHeading:f}),c.length>0&&e(Te,{lines:c,getSequence:g,heading:v,oneTimePurchaseTotalCount:i,showExtendedHeading:f}),p.length>0&&e(Te,{lines:p,getSequence:g,heading:s.translate("shipping.pre_order_ships_later"),oneTimePurchaseTotalCount:i,showExtendedHeading:f}),m?.map(([n,t])=>t.length>0&&e(Te,{lines:t,getSequence:g,heading:s.translate("shipping.pre_order_ships_date",{date:s.formatDate(new Date(n),{timeZone:"UTC",month:"long",day:"numeric",year:"numeric"})}),oneTimePurchaseTotalCount:i,showExtendedHeading:f},n))]})}const xe="more-shipping-options-modal";function Se({deliveryLines:n,openAtDeliveryLineId:t,onOpen:a,onClose:s}){const{i18n:p}=F(),m=p.translate("shipping.shipping_method_title"),h=w(),g=l(),v=Y(),{total:_,presentsConsolidatedShipping:T}=v.value,C=i(!1),x=i(""),S=r(()=>{const{total:e,presentsConsolidatedShipping:n}=v.value;return n&&e?p.translate("order_summary.shipping_total_updated_label_with_price",{totalPrice:p.formatCurrency(e.amount,{currency:e.currencyCode,form:"name"})}):null}),j=l(null);d(()=>{if(!C.value)return j.current=null,void(x.value="");const e=S.value;if(!e)return void(x.value="");const n=j.current;j.current=e,n&&e!==n&&(x.value=e)});const L=xe,k=o(()=>{if(!t)return;const e=Array.from(document.getElementById(L)?.querySelectorAll("[data-delivery-line-id]")??[]).find(e=>e.dataset.deliveryLineId===t);e?.scrollIntoView({block:"start",behavior:"instant"})},[t,L]),D=e(M,{variant:"primary",inlineSize:"fill",command:"--hide",commandFor:L,onClick:async()=>{await g.current,h("moreShippingOptions",{timestamp:new Date,subEvent:"modalSave"})},children:p.translate("payment.saved_credit_cards_modal.done")});return e(b,{heading:m,onShow:()=>{j.current=S.peek(),x.value="",C.value=!0,h("moreShippingOptions",{timestamp:new Date,subEvent:"modalOpen"}),a?.()},onAfterShow:k,onHide:async()=>{C.value=!1,g.current=s(),await g.current,h("moreShippingOptions",{timestamp:new Date,subEvent:"modalClose"})},id:L,footer:T?e(P,{background:"base",children:[e(y,{}),e(P,{paddingBlock:"base",paddingInline:"large-200",children:e(u,{gap:"base",children:[_&&e(f,{gridTemplateColumns:"1fr auto",gap:"base",children:[e(c,{type:"strong",children:p.translate("order_summary.multiple_shipping_lines_label")}),e(c,{type:"strong",translate:!1,children:p.formatCurrency(_.amount,{currency:_.currencyCode})})]}),e(P,{accessibilityVisibility:"exclusive",accessibilityRole:"status",children:x.value}),D]})})]}):void 0,padding:T?"none":"base",children:T?e(P,{paddingBlockStart:"base",paddingBlockEnd:"large-200",paddingInline:"large-200",children:e(Ce,{shippingGroupLine
1s:n})}):e(u,{gap:"large-200",padding:"none none large-200 none",children:[e(Ce,{shippingGroupLines:n}),D]})})}function Pe({shopPromiseSummary:e,isPreOrder:n,formattedTimeInTransit:i,fallbackText:t}){return e?e.deliveryPromiseText:n?void 0:i??t}const we={border:"none",background:"transparent",backgroundSelected:"base"};function Me({deliveryLines:n}){const{checkout:s,i18n:l}=F(),{negotiate:d}=k(),{deliveryMacros:p}=N(),m=i(!1),h=p.value,g=i(),v=i(),{selectedMacro:b,setSelectedMacro:y}=D(),T=b?.id,C=w(),x=z(),S=r(()=>Q({checkout:s})),M=n.every(e=>1===e.methods.length),H=m.value&&!b,G=K(),$=Y(),Z=function(e,n,i){const{shop:t,i18n:a}=F(),{deliveryMacros:s}=N(),r=j(),{deliveryExpectationLines:o}=se(),l=new Map,d=s.value;if(!t.marketDrivenShippingEnabled||!d?.length)return l;const{shipsLaterLines:c}=ce(e),p=pe(e),u=Boolean(c.length||p?.length),m=d.map(n=>{const i=new Set(Object.values(n.deliveryMethodHandles)),t=e.map(e=>({line:e,method:e.methods.find(({handle:e})=>i.has(e))})).filter(ne);return{macro:n,resolvedMethods:t.map(({method:e})=>e).filter(e=>Boolean(e)),count:ie(t).length}}),h=i>0?1===i:1===(m.find(({macro:e})=>e.id===n)??m[0]).count;for(const{macro:g,resolvedMethods:v,count:b}of m){if(b>1&&g.id===n)continue;const e=L({selectedMethods:v,deliveryExpectationLines:o??[],deliveryPromiseText:g.deliveryPromisePresentmentTitle?.short}),i=te(v),t=Pe({shopPromiseSummary:e,isPreOrder:u,formattedTimeInTransit:i?r(i)??void 0:void 0,fallbackText:g.deliveryPromisePresentmentTitle?.long}),s=h&&b>1?a.translate("shipping.split_shipping_multiple_shipment_quantity_label",{quantity:b}):void 0;l.set(g.id,{...t&&{transitText:t},...e?.brandedPromise&&{brandedPromise:e.brandedPromise},...s&&{shipmentCountText:s}})}return l}(n,T,$.value.groups.length),ee=$.value.groups.length,ae=ee>0?ee:n.length,re=S.value||G.value,le=n.length>=V&&!x&&(re||ae>1),ue=v.value??le,me=o(()=>{void 0===v.value&&(v.value=le)},[v,le]),{customizationsBefore:ge,customizationsAfter:ve}=X({targeted:!0,hasMultipleDeliveryGroups:!0}).value,be=t(()=>T?[T]:[],[T]),ye=o(async([e])=>{e&&(me(),await y(e),C("deliveryMacroInteraction",{timestamp:new Date,subEvent:"delivery_macros_input_change"}))},[C,me,y]),fe=e=>{me(),g.value=e?n.find(n=>n.methods.includes(e))?.id:void 0},_e=t(()=>({groupType:W("ONE_TIME_PURCHASE"),includeDeliverySelectionGroups:!M}),[M]);if(!h?.length)return null;let Te;if(M){const[i]=h,t=Z.get(i.id),a=t&&(t.transitText||t.shipmentCountText)?e(he,{summary:t}):void 0;Te=1===ee?e(R,{...x?we:{},children:e(q,{variant:"block",name:"delivery-macros",values:[i.id],hideRadioControl:!0,children:e(B,{value:i.id,secondaryContent:0!==i.cost.amount&&e(oe,{cost:i.cost,costAfterDiscounts:i.costAfterDiscounts,styleOverrides:{freeTextLetterCase:"uppercase",costSpacing:"none"}}),details:a,children:i.title})})}):e(P,{background:"base",colorLayer:"control",border:"base",borderRadius:"base",padding:"none",children:e(de,{selectedDeliveryMethodHandles:Object.values(i.deliveryMethodHandles),deliveryLines:n,choiceListContext:!1,isSharedRate:i.isSharedRate,shipmentGroups:$.value.groups,includedMethods:$.value.includedMethods,shipmentCommandFor:xe,onShipmentClick:fe})})}else Te=e(R,{...x?we:{},children:e(q,{variant:"block",name:"delivery-macros",values:be,onChange:ye,blockFooter:e(f,{gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",children:e(E,{padding:x?"base none small-300 base":"base",borderRadius:"none none base base",onClick:fe,commandFor:xe,children:e(f,{justifyItems:x?"start":"center",justifyContent:x?"start":"center",alignItems:"center",alignContent:"center",children:e(u,{direction:"inline",gap:"small-100",children:[x&&e(A,{type:"plus",tone:"accent"}),e(c,{type:x?"generic":"strong",tone:"accent",children:l.translate("shipping.split_shipping_more_shipping_options")})]})})})}),children:h.map(i=>{const{id:t,title:a,cost:s,costAfterDiscounts:r}
1=i,o=H?void 0:Z.get(t),l=o?[a,o.transitText,o.shipmentCountText].filter(Boolean).join(", "):a;return e(B,{value:t,selectedContent:e(de,{selectedDeliveryMethodHandles:Object.values(i.deliveryMethodHandles),deliveryLines:n,isSharedRate:i.isSharedRate,macroTitle:i.title,shipmentGroups:$.value.groups,shipmentCommandFor:xe,onShipmentClick:fe,includedMethods:$.value.includedMethods}),selectedContentPadding:"none",secondaryContent:H?e(I,{inlineSize:"5ch"}):0!==s.amount&&e(oe,{cost:s,costAfterDiscounts:r,styleOverrides:{freeTextLetterCase:"uppercase",costSpacing:"none"}}),accessibilityLabel:l,children:H?e(I,{inlineSize:"12ch",children:a}):e(u,{children:[e(c,{children:a}),o?e(he,{summary:o}):null]})},t)})})});return e(J,{impressionType:"delivery_macros",impressionFeatures:h.map(({id:e})=>e),children:e(u,{gap:"base",paddingBlockStart:x||ue?"none":"small-100",children:[ue&&e(u,{direction:"inline",alignItems:"center",gap:"small-400",children:[e(A,{type:"truck"}),e(c,{color:"subdued",children:re?l.translate("shipping.split_shipping_multiple_shipment_notice"):l.translate("shipping.split_shipping_shipment_count_notice_one_time_purchase",{count:ae})})]}),e(a,{when:S,children:e(_,{level:3,children:l.translate("shipping.shipping_method_first_shipment_group_title.other")})}),e(O,{customizations:ge,options:_e}),Te,e(Se,{deliveryLines:n,openAtDeliveryLineId:g.value,onClose:()=>(m.value=!0,d({legacyFiltering:{include:["deliveryNext"]},silenceViolations:U(["deliveryNext"]),onComplete:()=>{m.value=!1}}))}),e(O,{customizations:ve,options:_e})]})})}export{we as DELIVERY_MACRO_VAULTED_STYLE_OVERRIDES,Me 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.