1import X from"./D6h6omZv.js";import A from"./DMq48tX-.js";import{A as u,d as j,o as i,T as a,a7 as o,a5 as h,$ as b,U as T,V as M,a2 as D,a3 as n,u as s,a0 as q,bk as W,K as E,L as G,eJ as J,c as R,W as I,aq as K,fp as Q,X as w,cj as Y,M as Z,fq as B,cS as ee,am as te,ab as S,cA as re,cX as se,cU as oe}from"./AOn2pwUb.js";import{_ as ie}from"./69HSWFam.js";import{_ as ae}from"./DUdVtLbH.js";import{u as V}from"./B-j-sglc.js";function le(r){const{formatCurrencyLocale:e}=V(),l=u(()=>(r.value?.appliedReductions??[]).toReversed()),c=u(()=>{let d=r.value?.withTax;return l.value.map(({amount:p,category:y,promotionId:k})=>({strikeThroughPrice:e(d+=p.absoluteWithTax),value:Math.round(p.relative*100),category:y,promotionId:k}))}),m=u(()=>c.value.map(({strikeThroughPrice:d})=>d)),t=u(()=>c.value.map(({value:d,category:p,promotionId:y})=>({value:d,category:p,promotionId:y}))),_=u(()=>e(r.value?.withTax));return{appliedReductions:l,displayReductions:c,strikeThroughPrices:m,relativeReductions:t,totalPrice:_}}const ne={class:"relative max-md:bg-white"},ce={class:"flex items-start gap-4 px-6 md:block md:px-0"},de={key:0,"aria-hidden":"true",class:"absolute left-1/2 top-11 size-[0.40625rem] -translate-x-1/2 rounded-full border border-gray-950 bg-gray-950"},ue={class:"flex min-w-0 flex-1 flex-col gap-4 md:gap-0 md:space-y-4"},me={key:0,class:"flex flex-col gap-2 md:relative md:flex-row md:items-start md:gap-3"},pe={class:"relative z-10 mt-1 hidden size-4 shrink-0 items-center justify-center md:flex"},fe={class:"min-w-0 flex-1"},he={key:0,class:"text-sm text-gray-950 md:mt-1"},ge={class:"mt-6 text-xs text-gray-75 max-md:mb-9 max-md:px-4"},xe=j({__name:"PriceHistoryContent",props:{currentPriceFormatted:{default:null},previousPriceFormatted:{default:null},originalPriceFormatted:{default:null}},setup(r){const e=r,l=u(()=>[{key:"current",label:"price.current_price",value:e.currentPriceFormatted,explanation:void 0,visible:!0},{key:"previous",label:"price.previous_lowest_price",value:e.previousPriceFormatted,explanation:"price.previous_lowest_explanation",visible:!!e.previousPriceFormatted},{key:"original",label:"price.original_price",value:e.originalPriceFormatted,explanation:"price.original_price_explanation",visible:!0}]);return(c,m)=>(i(),a("div",ne,[o("div",ce,[o("div",{class:h(["relative w-2.5 shrink-0 md:hidden",e.previousPriceFormatted?"h-[8.5rem]":"h-[3.25rem]"])},[o("span",{"aria-hidden":"true",class:h(["absolute left-1/2 top-[0.5625rem] w-[0.03125rem] -translate-x-1/2 bg-gray-950",e.previousPriceFormatted?"h-[7.625rem]":"h-[2.375rem]"])},null,2),m[0]||(m[0]=o("span",{"aria-hidden":"true",class:"absolute left-1/2 top-0.5 size-[0.90625rem] -translate-x-1/2 rounded-full border-[0.03125rem] border-gray-950 bg-red-sale"},null,-1)),e.previousPriceFormatted?(i(),a("span",de)):b("",!0),o("span",{"aria-hidden":"true",class:h(["absolute left-1/2 size-[0.40625rem] -translate-x-1/2 rounded-full border border-gray-950 bg-gray-950",e.previousPriceFormatted?"top-32":"top-11"])},null,2)],2),o("ul",ue,[(i(!0),a(T,null,M(s(l),t=>(i(),a(T,{key:t.key},[t.visible?(i(),a("li",me,[o("div",{"aria-hidden":"true",class:h(["absolute left-2 top-3 -bottom-7 hidden w-px bg-gray-400",t.key==="original"?"hidden":"hidden md:block"])},null,2),o("div",pe,[o("span",{class:h({"size-3.5 rounded-full bg-red-600":t.key==="current","size-1.5 rounded-full bg-gray-950":t.key!=="current"})},null,2)]),o("div",fe,[o("p",{class:h(["text-md max-md:text-gray-950",{"font-bold":t.key==="current"}])},[D(n(c.$t(t.label))+": ",1),o("span",{class:h({"text-red-sale font-normal md:text-red-600":t.key==="current","text-gray-75 line-through md:text-gray-600":t.key==="previous","text-gray-75 line-through md:text-gray-950":t.key==="original"})},n(t.value),3)],2),t.explanation?(i(),a("p",he,n(c.$t(t.explanation)),1)):b("",!0)])])):b("",!0)],64))),128))])]),o("p",ge," *"+n(c.$t("price.price_history_note")),1)]))}}),L=Object.assign(xe,{__name:"PriceHistoryContent"}),ye={class:"flex items-start justify-between p-4 pr-2"},ve=["aria-label"],be={class:"relative"},_e={class:"flex justify-between items-center mb-4"},Pe={class:"text-md uppercase"},we=["aria-label"],ke=j({__name:"PriceHistoryModal",props:{visible:{type:Boolean,default:!1},currentPriceFormatted:{default:null},previousPriceFormatted:{default:null},originalPriceFormatted:{default:null}},emits:["close"],setup(r,{emit:e}){const l=r,c=e,{smaller:m}=q(),t=m("md"),_=Y(),d=`price-history-title-${_}`,p=`price-history-slide-${_}`,{open:y,close:k}=W(p);E(()=>l.visible,g=>{g&&t.value&&y(),!g&&t.value&&k()}),G(()=>{l.visible&&t.value&&y()}),J(k);const v=()=>c("close");return(g,$)=>{const F=A,z=K;return i(),R(z,null,{default:I(()=>[s(t)?(i(),R(s(ae),{key:0,name:p,"slide-type":s(Q).FROM_BOTTOM,"is-rounded":!1,"mobile-height":"h-fit","header-classes":"!border-none
1!bg-white !backdrop-blur-none","hide-close-button":"","footer-classes":"hidden","render-on-interact":!1,"data-testid":"price-history-slidein","slide-class":"max-w-md w-full p-0",onClose:v},{"slide-in-header":I(()=>[o("div",ye,[o("h2",{id:d,class:"text-md text-gray-950 uppercase"},n(g.$t("price.price_history_title")),1),o("button",{class:"size-6 hover:bg-gray-100",type:"button","aria-label":g.$t("accessibility.closeModal"),onClick:v},[w(F,{class:"size-6"})],8,ve)])]),"slide-in-body":I(()=>[w(L,{"current-price-formatted":r.currentPriceFormatted,"previous-price-formatted":r.previousPriceFormatted,"original-price-formatted":r.originalPriceFormatted},null,8,["current-price-formatted","previous-price-formatted","original-price-formatted"])]),_:1},8,["slide-type"])):(i(),R(s(ie),{key:1,visible:r.visible,class:"md:!max-w-md","content-wrapper-classes":"!p-4 max-w-md w-full rounded-none",role:"dialog","aria-modal":"true","hide-close-button":"","no-min-width":"","aria-labelledby":d,"data-testid":"price-history-modal","onUpdate:visible":$[0]||($[0]=C=>C||v())},{default:I(()=>[o("div",be,[o("div",_e,[o("h2",Pe,n(g.$t("price.price_history_title")),1),o("button",{class:"p-1 hover:bg-gray-100",type:"button","aria-label":g.$t("accessibility.closeModal"),onClick:v},[w(F,{class:"size-6"})],8,we)]),w(L,{"current-price-formatted":r.currentPriceFormatted,"previous-price-formatted":r.previousPriceFormatted,"original-price-formatted":r.originalPriceFormatted},null,8,["current-price-formatted","previous-price-formatted","original-price-formatted"])])]),_:1},8,["visible"]))]),_:1})}}}),$e=Object.assign(ke,{__name:"PriceHistoryModal"}),Fe=({omnibusCase:r,lowestPriorPrice:e,currentPriceValue:l,previousPriceFormatted:c,originalPriceFormatted:m})=>!r||!m?.trim()?!1:r==="case1"||r==="case2"?e!=null:r!=="case3"||!c?.trim()||e==null||l==null?!1:Number(l)<Number(e),Ce={key:0,class:"inline-flex items-center"},Be={key:0,class:"text-[10px] md:text-xs text-gray-60 whitespace-nowrap","data-testid":"omnibus-text"},Te={class:"md:hidden"},ze={class:"max-md:hidden"},Oe=["aria-label"],Se=j({__name:"OmnibusBadge",props:{omnibusCase:{default:void 0},lowestPriorPrice:{default:null},currentPriceValue:{default:null},currentPriceFormatted:{default:null},previousPriceFormatted:{default:null},originalPriceFormatted:{default:null},iconOnly:{type:Boolean,default:!1}},setup(r){const e=r,l=Z(!1),{formatCurrencyLocale:c}=V(),m=()=>{l.value=!0},t=()=>{l.value=!1},_=u(()=>e.iconOnly&&e.omnibusCase!=="case2"&&e.omnibusCase!=="case3"?!1:Fe(e)),d=u(()=>!e.iconOnly&&e.omnibusCase==="case1"&&e.lowestPriorPrice!=null),p=u(()=>e.lowestPriorPrice!=null?c(e.lowestPriorPrice):""),y=u(()=>e.currentPriceFormatted||""),k=u(()=>e.originalPriceFormatted||"");return(v,g)=>{const $=X;return s(_)||s(d)?(i(),a("div",Ce,[s(d)?(i(),a("span",Be,[o("span",Te,n(v.$t("price.last_lowest_price"))+": "+n(s(p)),1),o("span",ze,n(v.$t("price.lowest_price"))+": "+n(s(p)),1)])):b("",!0),s(_)?(i(),a("button",{key:1,"aria-label":v.$t("price.price_history_button")||"Show price history",class:"ml-1 flex items-center text-neutral-500 hover:text-neutral-700 focus:outline-none","data-testid":"omnibus-icon",onClick:m},[w($,{class:"size-3.5 shrink-0","aria-hidden":"true"})],8,Oe)):b("",!0),w($e,{visible:s(l),"current-price-formatted":s(y),"previous-price-formatted":r.previousPriceFormatted,"original-price-formatted":s(k),onClose:t},null,8,["visible","current-price-formatted","previous-price-formatted","original-price-formatted"])])):b("",!0)}}}),N=Object.assign(Se,{__name:"OmnibusBadge"}),Ie={class:"flex flex-wrap gap-1"},Me={class:"flex items-center gap-[2px] w-full justify-end"},je={class:"w-full text-right"},Re={class:"flex items-center gap-1"},Ne={class:"flex items-center gap-1"},Ve={class:"flex items-center gap-1"},He={key:0,class:"mt-1 flex w-full items-center justify-end text-xs text-neutral-500"},Le={key:3,class:"ml-1 text-right text-xs text-gray-700 md:text-left","data-testid":"tax-info"},De=j({__name:"ProductPrice",props:{price:{},promotion:{default:void 0},promotions:{default:void 0},showTaxInfo:{type:Boolean,default:!1},showPriceFrom:{type:Boolean,default:!1},showBadges:{type:Boolean,default:!0},size:{default:B.MD},type:{default:"normal"},column:{type:Boolean,default:!1},hasNewColumnStyle:{type:Boolean,default:!1},lowestPriorPrice:{default:void 0}},setup(r){const e=r,{omnibusCase:l}=ee(),{price:c}=te(e),{displayReductions:m,strikeThroughPrices:t,relativeReductions:_,totalPrice:d}=le(c),{formatCurrencyLocale:p}=V(),y=u(()=>(t.value?.length&&t.value[0]!==t.value[t.value.length-1]?t.value[0]:null)??(e.lowestPriorPrice?p(e.lowestPriorPrice):null)),k=u(()=>t?.value?.length?t.value[t.value.length-1]:null),v=u(()=>c.value?.withTax??null),g=P=>e.promotions?.find(O=>O.id===P)??e.promotion,$=P=>oe(g(P)),F=(P,O)=>P==="promotion"?{"data-promotion-id":O??"","data-promotion-name":g(O)?.name??""}:{},z=u(()=>({omnibusCase:l.value,lowestPriorPrice:e.lowestPriorPrice,currentPriceValue:v.value,currentPriceFormatted:d.value,previousPriceFormatted:y.value,originalPriceFormatted:k.value})),C=u(()=>({"text-xl":e.size===B.XL,"text-lg":e.size===B.LG,"text-sm":e.size===B.SM,"text-md":e.size===B.MD,"text-xs":e.size===B.XS,"font-bold":e.type==="loud","font-semibold":e.type==="whisper","font-normal":e.type==="normal"}));return(P,O)=>(i(),a("div",Ie,[r.showBadges?(i(!0),a(T,{key:0},M(s(_),({value:f,category:x,promotionId:H},U)=>(i(),a("span",S({key:`${f}-badge-${x}-${U}`,class:"mr-1 inline-block rounded bg-red px-1 text-xs font-bold text-white",style:x==="promotion"&&$(H)},{ref_for:!0},F(x,H))," -"+n(f)+"% ",17))),128)):b("",!0),r.hasNewColumnStyle?(i(),a("div",{key:1,"data-testid":"price",class:h(["flex flex-col items-end gap-[2px] w-full",s(C)])},[o("div",Me,[(i(!0),a(T,null,M(s(m),(f,x)=>(i(),a("span",S({key:`${f.strikeThroughPrice}-${x}`,class:["text-xs font-normal line-through last-of-type:mr-0 whitespace-nowrap",{"text-gray-900":x===0,"text-gray-500":x>0}],"data-testid":"initialProductPrice"},{ref_for:!0},F(f.category,f.promotionId)),n(f.strikeThroughPrice),17))),128))]),o("div",je,[o("span",{class:h(["font-bold whitespace-nowrap",{"text-red":s(t).length,...s(C)}]),"data-testid":"currentPrice"},n(s(d)),3)])],2)):(i(),a("div",{key:2,class:h([{"flex-col gap-[2px]":r.column,"md:flex-col max-md:!items-end md:!items-start":s(l)==="case1","flex-row gap-2":!r.column,...s(C)},"flex md-max:flex-col items-end md:items-center"]),"data-testid":"price"},[o("div",Re,[w(N,S({"icon-only":"",class:"hidden md:inline-flex"},s(z)),null,16),o("div",{class:h(["flex items-end",{"flex-col gap-[2px]":r.column,"flex-row gap-1":!r.column}])},[o("div",Ne,[r.showPriceFrom?(i(),a(T,{key:0},[D(n(P.$t("price.starting_from")),1)],64)):b("",!0),o("span",{class:h([{"text-red":s(t).length,...s(C)},"font-bold"]),"data-testid":"currentPrice"},n(s(d)),3),w(N,S({"icon-only":"",class:"inline-flex md:hidden"},s(z)),null,16)]),o("div",Ve,[(i(!0),a(T,null,M(s(m),(f,x)=>
1(i(),a("div",S({key:`${f.strikeThroughPrice}-${x}`,class:["text-xs md:text-sm font-normal line-through last-of-type:mr-0",{"text-neutral-500":x===0&&s(t).length>1,"text-primary":x>0||s(t).length===1}],"data-testid":"initialProductPrice"},{ref_for:!0},F(f.category,f.promotionId)),n(f.strikeThroughPrice),17))),128))])],2)]),s(l)==="case1"&&e.lowestPriorPrice?(i(),a("div",He,[w(N,re(se(s(z))),null,16)])):b("",!0)],2)),r.showTaxInfo?(i(),a("div",Le,n(P.$t("price.including_vat")),1)):b("",!0)]))}}),Ge=Object.assign(De,{__name:"ProductPrice"});export{Ge as _,le 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.