1import{q as j,p as S,o as W,Q as V,d as s,c as n,b as o,a as x,j as k,F as d,r as D,z as F,h as E,x as a,l as h,t as c,n as z,i as H,f as b,m as L,y as I}from"./BiSZ_CVW.js";const M={class:"w-full py-6 lg:pl-[100px] bg-[#F8F8F8]"},P={class:"w-full max-w-[1440px] mx-auto py-2 pb-6 pl-4 lg:px-0 bg-[#F8F8F8]"},U={class:"flex flex-col text-center items-center bg-white shadow-box rounded-xl p-3 lg:p-4 w-full -mt-10 z-10 relative"},$={key:0,class:"absolute -top-[30px] left-1/2 -translate-x-1/2 bg-[#1E8FD9] text-white w-fit rounded-[8px] h-[23px] px-2 py-1 text-[11px] font-semibold"},q={class:"w-full"},K={class:"text-md font-bold text-black mb-2 line-clamp-2 min-h-[3rem]"},G={class:"w-full flex gap-2 items-center justify-center min-h-[1.8rem] my-2"},Z={key:0},Q={class:"font-semibold text-black text-sm mt-1"},R={class:"font-semibold text-gray-600 text-sm -mt-0.5 line-through"},T={key:1},J={class:"font-semibold text-black text-sm mt-1"},O={class:"flex justify-between items-center mb-4"},X={class:"flex gap-2 py-3 px-4 rounded-full bg-white shadow-md"},Y={class:"flex gap-2"},ot={__name:"HotDeals",async setup(v){let g,y;const i=L(0),u=L(null),{data:C,error:tt}=([g,y]=j(()=>S("/api/products/sale","$W_nmZGAZNz")),g=await g,y(),g),f=I(()=>C.value?.products||null),N=()=>{u.value.scrollBy({left:200,behavior:"smooth"}),i.value<f.value.length-1&&i.value++},A=()=>{u.value.scrollBy({left:-200,behavior:"smooth"}),i.value>0&&i.value--},B=e=>{let l=e.productName.replace(/\s+/g,"-").toLowerCase();if((e.category==="iPhone"||e.category==="FelújÃtott készülékek")&&e.storage){const p=e.storage.toLowerCase().replace(/\s+/g,"-");l+=`-${p}`}const m=`/termek/${l}`;let r={};return e.category==="KiegészÃtÅk"?r={id:e.id||void 0}:e.category==="Apple Watch"?r={size:e.attributes?.find(t=>t.name==="Watch_Méret")?.value||void 0,condition:e.condition||void 0,color:e.color||void 0,id:e.id||void 0}:r={storage:e.storage||void 0,condition:e.condition||void 0,color:(e.category==="iPhone"||e.category==="FelújÃtott készülékek")&&e.color||void 0,id:e.id||void 0},{path:m,query:r}};W(()=>{const e=u.value;e&&e.addEventListener("scroll",w)}),V(()=>{const e=u.value;e&&e.removeEventListener("scroll",w)});const w=()=>{const e=u.value;if(!e||!f.value)return;const l=e.scrollLeft,p=226+16,t=Math.round(l/p);i.value=Math.min(t,f.value.length-1)};return(e,l)=>{const m=k,r=k,p=H;return s(),n("div",M,[o("div",P,[l[3]||(l[3]=o("h2",{class:"text-[#022B45] font-bold text-xl lg:text-2xl bricolage-grotesque-custom"}," Legforróbb ajánlatok ",-1)),x(m,{src:"underline-b.svg",class:"mb-6 w-[190px] lg:w-[228px]",alt:"underline"}),o("div",{ref_key:"scrollContainer",ref:u,class:"w-full flex items-center overflow-x-scroll no-scrollbar gap-4"},[(s(!0),n(d,null,D(b(f),(t,_)=>(s(),F(p,{to:B(t),key:t.id,class:"w-[226px] lg:w-[305px] flex-shrink-0 flex flex-col items-center mb-8"},{default:E(()=>[x(r,{class:"w-[180px] lg:w-[230px] z-1 rounded-xl shadow-md",src:t.coverImage,loading:"lazy",decoding:"async",alt:"product image"},null,8,["src"]),o("div",U,[t.priceData.sale_price&&t.priceData.price?(s(),n("span",$," AKCIà ")):a("",!0),o("div",q,[o("p",K,[t.productName||t.storage&&t.storage!=="N/A"||t.color?(s(),n(d,{key:0},[h(c(t.productName?t.productName:"")+" ",1),t.storage&&t.storage!=="N/A"?(s(),n(d,{key:0},[h(c(t.storage),1)],64)):a("",!0),t.color?(s(),n(d,{key:1},[h(", "+c(t.color),1)],64)):a("",!0),t.condition?(s(),n(d,{key:2},[h(", "+c(t.condition),1)],64)):a("",!0)],64)):a("",!0)]),l[1]||(l[1]=o("p",{class:"font-semibold text-gray-600 text-xs"},"Garancia: 1 év ⢠KiszállÃtás: 2-4 nap",-1)),o("div",G,[t.infos.battery?(s(),F(m,{key:0,src:"battery-full.svg",class:"h-5",alt:"battery"})):a("",!0),t.infos.battery?(s(),n("p",{key:1,class:z(["font-semibold text-xs","text-gray-600"])}," Akku: "+c(t.infos.battery)+"% ",1)):a("",!0)]),t.priceData.sale_price&&t.priceData.price?(s(),n("div",Z,[o("p",Q,c(t.priceData.sale_price.toLocaleString("hu-HU"))+" Ft-tól ",1),o("p",R,c(t.priceData.price.toLocaleString("hu-HU"))+" Ft ",1)])):a("",!0),!t.priceData.sale_price&&t.priceData.price?(s(),n("div",T,[l[0]||(l[0]=o("p",{class:"text-sm invisible mt-[-2px]"}
1," Placeholder ",-1)),o("p",J,c(t.priceData.price.toLocaleString("hu-HU"))+" Ft-tól ",1)])):a("",!0),l[2]||(l[2]=o("button",{class:"mt-4 text-blue-500 border border-blue-500 font-semibold rounded-full py-1 px-4"},"Vásárlás",-1))])])]),_:2},1032,["to"]))),128))],512),o("div",O,[o("div",X,[(s(!0),n(d,null,D(b(f),(t,_)=>(s(),n("div",{key:_,class:z(["h-1.5 rounded-full",_===b(i)?"bg-[#F68B46] w-12":"bg-[#D9D9D9] w-1.5"])},null,2))),128))]),o("div",Y,[o("button",{onClick:A,title:"change",class:"flex items-center justify-center h-12 w-12 bg-white rounded-full cursor-pointer shadow-md"},[x(r,{src:"arrow-left1.svg",class:"h-6",alt:"left"})]),o("button",{onClick:N,title:"change",class:"flex items-center justify-center h-12 w-12 bg-white rounded-full cursor-pointer shadow-md"},[x(r,{src:"arrow-right.svg",class:"h-6",alt:"right"})])])])])])}}};export{ot 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.