"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4757],{31930:function(e,s,l){l.d(s,{F:function(){return t}});var a=l(96925),c=l(95069),i=l(5466),r=l(48701);let t=e=>{let{price:s,isParent:l=!1,className:t}=e;return(0,a.jsxs)(c.y,{className:t,children:[!!s.discount&&(0,a.jsx)(i.x,{children:Intl.NumberFormat("es-ES",{style:"currency",currency:"EUR"}).format(s.rrp)}),(0,a.jsxs)(r.j,{className:"text-black",children:[l&&"Desde ",Intl.NumberFormat("es-ES",{style:"currency",currency:"EUR"}).format(s.totalInVAT)]})]})}},95307:function(e,s,l){var a=l(96925),c=l(87431),i=l(2858),r=l(77256),t=l(4154),n=l(94708),d=l(41763),o=l(51018),m=l(11708),p=l(9055),x=l(24468),u=l(53316),f=l(57251),h=l(87996),j=l(58258),v=l(5624),g=l(48071),y=l(31930),N=l(8302);s.default=e=>{var s,l,b,w;let{product:P,lqip:k,fallbackImage:I,contextCategory:B,userEmail:R,userType:E}=e;return(0,a.jsx)(r.S,{href:((e,s,l)=>{let a=B||(l?l[l.length-1].key:"producto");return"/".concat(a,"/").concat(e,"/").concat(s)})(P.urlName,P.urlRef,P.category),className:"h-[320px] p-0 sm:h-[340px] md:h-[380px] md:p-0",children:(0,a.jsxs)(t.n,{children:[!!P.price.discount&&(0,a.jsx)(n.z,{children:"-".concat(P.price.discount,"%")}),(0,a.jsx)(h.Q,{hasStock:P.isAvailable}),(0,a.jsxs)("div",{className:"absolute right-[14px] top-3 flex flex-col space-y-2 md:top-4",children:[P.tire&&(0,a.jsx)(d.h,{tire:P.tire,className:"z-10",children:(0,a.jsx)(i.qv,{className:"size-5"})}),(null===(s=P.tecdoc)||void 0===s?void 0:s.properties)&&(0,a.jsx)(o.h,{tecdocProperties:P.tecdoc.properties,className:"z-10",children:(0,a.jsx)(c.Z,{className:"size-5"})})]}),(0,a.jsx)("div",{className:"relative flex flex-col items-center justify-center p-3 md:p-5",children:(0,a.jsx)(m.q,{source:(null===(l=P.images)||void 0===l?void 0:l.length)?P.images[0]:(null===(w=P.tecdoc)||void 0===w?void 0:null===(b=w.images)||void 0===b?void 0:b.length)?P.tecdoc.images[0].url400:P.family.image?"".concat("https://fast.org.es/api").concat(u.ProductEndpoint.FamilyImage,"/").concat(P.family.image):P.brand.image?"".concat("https://fast.org.es/api").concat(u.ProductEndpoint.BrandImage,"/").concat(P.brand.image):I,alt:P.name,lqipBase64:k})}),(0,a.jsxs)("div",{className:"flex h-full flex-col justify-between p-3 pt-0 md:p-5 md:pt-1",children:[(0,a.jsx)(N.c,{title:P.name,subtitle:P.commercialRef}),P.tire&&(0,a.jsx)(p.k,{...P.tire}),(0,a.jsxs)("div",{className:"flex w-full flex-col items-center justify-between space-y-3",children:[(0,a.jsxs)("div",{className:"flex w-full flex-col",children:[(0,a.jsx)(y.F,{price:P.price,isParent:P.isParent}),(0,a.jsx)(x.D,{children:"Iva Incluido"})]}),(0,a.jsxs)("div",{className:"flex w-full justify-between space-x-3",children:[(0,a.jsx)(j.y,{reference:P.ref,urlReference:P.urlRef,packaging:P.packaging,isParent:P.isParent,children:(0,a.jsx)("div",{className:"flex h-full",children:(0,a.jsx)(f.x,{className:"self-end",isParent:P.isParent,isDisabled:!P.isAvailable,onClick:()=>{(0,g.Z)(P,E,1,"add_to_cart",R)}})})}),(0,a.jsx)(v.s,{reference:P.ref,urlReference:P.urlRef,defaultIsFav:P.isFav,isParent:P.isParent})]})]})]})]})})}},54757:function(e,s,l){l.d(s,{Products:function(){return J}});var a=l(96925),c=l(86274),i=l(33159),r=l(95379),t=l.n(r),n=l(29001),d=l.n(n),o=l(76487),m=l(8518),p=l(11913),x=l(83649),u=l(38138),f=l(83871),h=l(82587),j=l(84226),v=l(77256),g=l(4154),y=l(94708),N=l(11708),b=l(66538),w=l(24468),P=l(11644),k=l(53316),I=l(8302),B=l(4128),R=l(87996),E=l(58258),F=l(5624),C=l(48071),O=l(31930);let z=e=>{var s,l,c;let{product:i,lqip:r,fallbackImage:t,contextCategory:n,userEmail:d,userType:o}=e,{tire:m,tecdoc:p}=i;return(0,a.jsx)(v.S,{href:((e,s,l)=>{let a=n||(l?l[l.length-1].key:"producto");return"/".concat(a,"/").concat(e,"/").concat(s)})(i.urlName,i.urlRef,i.category),className:"p-0 md:p-0",children:(0,a.jsxs)(g.n,{children:[!!i.price.discount&&(0,a.jsx)(y.z,{children:"-".concat(i.price.discount,"%")}),(0,a.jsx)(R.Q,{hasStock:i.isAvailable}),(0,a.jsxs)("div",{className:"flex flex-row",children:[(0,a.jsxs)("div",{className:"relative flex flex-col items-center justify-center space-y-2 p-3 sm:p-5",children:[(0,a.jsx)(N.q,{source:(null===(s=i.images)||void 0===s?void 0:s.length)?i.images[0]:(null===(c=i.tecdoc)||void 0===c?void 0:null===(l=c.images)||void 0===l?void 0:l.length)?i.tecdoc.images[0].url400:i.family.image?"".concat("https://fast.org.es/api").concat(k.ProductEndpoint.FamilyImage,"/").concat(i.family.image):i.brand.image?"".concat("https://fast.org.es/api").concat(k.ProductEndpoint.BrandImage,"/").concat(i.brand.image):t,alt:i.name,className:"h-[162px] w-[100px] lg:w-[162px]",width:162,height:162,lqipBase64:r}),(0,a.jsx)(F.s,{reference:i.ref,urlReference:i.urlRef,defaultIsFav:i.isFav,isParent:i.isParent})]}),(0,a.jsxs)("div",{className:"grid w-full grid-cols-12 md:flex md:grid-cols-none md:flex-row",children:[(0,a.jsx)("div",{className:"relative col-span-12 flex w-full flex-row justify-between p-3 md:col-span-7 md:p-5",children:(0,a.jsxs)("div",{className:"flex w-full flex-col space-y-3",children:[(0,a.jsx)(I.c,{title:i.name,subtitle:i.commercialRef}),(0,a.jsx)("div",{className:"hidden md:block",children:(m||(null==p?void 0:p.properties))&&(0,a.jsx)(b.c,{tecdocProperties:null==p?void 0:p.properties,tire:m})})]})}),(0,a.jsx)("div",{className:"col-span-12 flex items-start justify-between p-3 pt-0 md:min-w-[240px] md:p-5",children:(0,a.jsxs)("div",{className:"flex w-full flex-col space-y-5",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)(O.F,{price:i.price,isParent:i.isParent}),(0,a.jsx)(w.D,{className:"whitespace-nowrap",children:"Iva Incluido"})]}),(0,a.jsx)("div",{className:"flex flex-row items-center justify-between",children:(0,a.jsx)(E.y,{reference:i.ref,urlReference:i.urlRef,packaging:i.packaging,isParent:i.isParent,children:(0,a.jsxs)("div",{className:"flex w-full flex-col justify-center space-y-3",children:[(0,a.jsx)(P.g,{className:"w-full"}),(0,a.jsx)(B.W,{className:"w-full self-center",isParent:i.isParent,isDisabled:!i.isAvailable,onClick:()=>{let e=document.getElementById("units");if(e){let s=+e.value;(0,C.Z)(i,o,s,"add_to_cart",d)}}})]})})})]})})]})]}),(m||(null==p?void 0:p.properties))&&(0,a.jsx)("div",{className:"block p-3 md:hidden",children:(0,a.jsx)(b.c,{tecdocProperties:null==p?void 0:p.properties,tire:m})})]})})};var S=l(81163),q=l(83092),A=l(9055),_=l(90805),D=l(45670),T=l(997),Z=l(93233),Q=l(3086);let U=e=>{var s,l,c;let{product:i,lqip:r,fallbackImage:t,contextCategory:n,userEmail:d,userType:o}=e,{tire:m}=i;return(0,a.jsx)(v.S,{href:((e,s,l)=>{let a=n||(l?l[l.length-1].key:"producto");return"/".concat(a,"/").concat(e,"/").concat(s)})(i.urlName,i.urlRef,i.category),className:"px-0 pt-0 md:px-0 md:pt-0",children:(0,a.jsxs)(g.n,{className:"grid grid-cols-12 flex-row bg-white shadow",children:[!!i.price.discount&&(0,a.jsx)(y.z,{className:"top-3 inline-block h-5 min-w-[35px] pl-2 text-[10px] md:hidden",children:"-".concat(i.price.discount,"%")}),(0,a.jsxs)("div",{className:"relative col-span-2 flex h-max max-w-20 justify-center sm:col-span-2 md:col-span-1 md:w-full",children:[(0,a.jsxs)("div",{className:"relative flex h-max flex-col items-center justify-center p-3 sm:p-3",children:[(0,a.jsx)(S.n,{className:"relative left-6 bg-neutral-500 md:hidden",isAvailable:i.isAvailable,children:(0,a.jsx)(q.Q,{className:"right-2 top-3 size-3 hover:opacity-75 md:hidden",circleClassName:"w-3 h-3",hasStock:i.isAvailable})}),(0,a.jsx)(N.q,{source:(null===(s=i.images)||void 0===s?void 0:s.length)?i.images[0]:(null===(c=i.tecdoc)||void 0===c?void 0:null===(l=c.images)||void 0===l?void 0:l.length)?i.tecdoc.images[0].url400:i.family.image?"".concat("https://fast.org.es/api").concat(k.ProductEndpoint.FamilyImage,"/").concat(i.family.image):i.brand.image?"".concat("https://fast.org.es/api").concat(k.ProductEndpoint.BrandImage,"/").concat(i.brand.image):t,alt:i.name,className:"h-[82px] sm:h-[82px] md:h-[60px] xl:h-[60px]",width:56,height:56,lqipBase64:r})]}),(0,a.jsx)("div",{className:"absolute bottom-3 right-[10px] z-10 flex size-3 leading-none",children:(0,a.jsx)(Q.T,{className:"size-4",reference:i.ref,urlReference:i.urlRef,defaultIsFav:i.isFav,isParent:i.isParent})})]}),(0,a.jsx)("div",{className:"col-span-6 flex size-full flex-col space-y-1 p-3 pl-0 sm:col-span-6 md:col-span-4",children:(0,a.jsx)(D.$,{title:i.name,subtitle:i.commercialRef,tecdoc:i.tecdoc,tire:i.tire})}),(0,a.jsx)("div",{className:"hidden w-full items-center p-1 pl-0 md:col-span-3 md:flex md:p-3",children:(0,a.jsx)(A.k,{consume:null==m?void 0:m.consume,adherence:null==m?void 0:m.adherence,noise:null==m?void 0:m.noise,summer:null==m?void 0:m.summer,winter:null==m?void 0:m.winter})}),(0,a.jsxs)("div",{className:"col-span-4 flex w-full items-center justify-end space-x-3 p-3 pl-0 md:col-span-4",children:[" ",!!i.price.discount&&(0,a.jsxs)(_.J,{className:"hidden md:flex",children:["-",i.price.discount,"%"]}),(0,a.jsx)(E.y,{reference:i.ref,urlReference:i.urlRef,packaging:i.packaging,isParent:i.isParent,children:(0,a.jsxs)("div",{className:"flex size-full flex-col justify-between space-x-5 space-y-1 md:flex-row md:items-center md:justify-end md:space-y-2 md:pb-[7px]",children:[(0,a.jsx)(Z.t,{className:"hidden md:mt-2 md:block",hasStock:i.isAvailable}),(0,a.jsxs)("div",{className:"flex flex-col items-end",children:[(0,a.jsx)(O.F,{price:i.price,isParent:i.isParent,className:"items-end [&>span:first-child]:sm:text-xs [&>span:last-child]:sm:text-sm [&>span:last-child]:md:whitespace-nowrap [&>span:last-child]:md:text-xl"}),(0,a.jsx)(w.D,{className:"flex items-end whitespace-nowrap",children:"Iva Incluido"})]}),(0,a.jsx)(T.F,{className:"w-16 self-end md:w-24 md:self-center",isParent:i.isParent,isDisabled:!i.isAvailable,onClick:()=>{(0,C.Z)(i,o,1,"add_to_cart",d)}})]})})]})]})})};var V=l(95307);let J=e=>{let{products:s,fallbackImage:l,defaultView:r,contextCategory:n,filters:v,total:g,page:y,size:N,lqip:b,className:w,salePoint:P,userEmail:k,userType:I}=e,[B,R]=(0,c.useState)(s),[E,F]=(0,c.useState)(r),C=(null==y?void 0:y.length)?parseInt(y,10):1,O=(null==N?void 0:N.length)?parseInt(N,10):24,S=t()(g/O),q=!d()(v),A=g<=1e3;(0,c.useEffect)(()=>{R(s)},[s]);let _=(0,c.useCallback)(e=>{R(s=>s.map(s=>s.ref===e?{...s,isFav:!s.isFav}:s))},[]);(0,c.useEffect)(()=>(h.vp.on("change-fav",_),()=>{h.vp.off("change-fav",_)}),[_]);let D=e=>{switch(E){case"row":return(0,a.jsx)(U,{product:e,contextCategory:n,fallbackImage:l,lqip:b,userEmail:k,userType:I});case"large":return(0,a.jsx)(z,{product:e,contextCategory:n,fallbackImage:l,lqip:b,userEmail:k,userType:I});default:return(0,a.jsx)(V.default,{product:e,contextCategory:n,fallbackImage:l,lqip:b,userEmail:k,userType:I})}};return B.length?(0,a.jsx)("section",{id:"products-list",className:(0,o.cn)("flex flex-col pb-16",w),children:(0,a.jsxs)("div",{className:"container mx-auto",children:[(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("div",{children:(0,a.jsx)("span",{children:"".concat(g," productos \xb7 P\xe1gina ").concat(C," de ").concat(S)})}),(0,a.jsx)("div",{children:(0,a.jsxs)("div",{className:"flex space-x-4",children:[(0,a.jsx)(m.y,{className:"hidden lg:flex",criteria:A?[i.ProductOrderBy.Price,i.ProductOrderBy.Name,i.ProductOrderBy.Code,i.ProductOrderBy.Stock,i.ProductOrderBy.Discounts]:[i.ProductOrderBy.Name,i.ProductOrderBy.Code]}),(0,a.jsx)(p.y,{selectedView:E,onChange:F})]})})]}),(0,a.jsxs)("div",{className:"grid grid-cols-12 gap-4",children:[q&&(0,a.jsxs)("div",{className:"col-span-3 hidden space-y-5 lg:block",children:[(0,a.jsx)(x.j,{tire:v.tire,lubricant:v.lubricant,battery:v.battery,wire:v.wire,chain:v.chain,brushes:v.brushes,properties:v.properties,brand:v.brand}),(0,a.jsx)(j.X,{salePoint:P})]}),(0,a.jsxs)("div",{className:(0,o.cn)("col-span-12 space-y-8",q&&"lg:col-span-9"),children:[(0,a.jsx)("div",{className:"grid grid-cols-12 gap-4",children:B.length?B.map(e=>(0,a.jsx)("div",{className:(0,o.cn)("col-span-12","small"===E&&"col-span-6 sm:col-span-4 xl:col-span-3","row"===E&&"h-[105px] md:h-[95px] lg:h-[84px]"),children:D(e)},e.ref)):null}),(0,a.jsx)(u.t,{currentPage:C,totalPages:S})]})]})]}),(0,a.jsxs)(f.c,{className:"lg:hidden",children:[(0,a.jsx)("div",{className:"px-5",children:(0,a.jsx)(m.y,{className:"w-full",criteria:A?[i.ProductOrderBy.Price,i.ProductOrderBy.Name,i.ProductOrderBy.Code,i.ProductOrderBy.Stock,i.ProductOrderBy.Discounts]:[i.ProductOrderBy.Name,i.ProductOrderBy.Code]})}),q&&(0,a.jsx)(x.j,{tire:v.tire,lubricant:v.lubricant,battery:v.battery,wire:v.wire,chain:v.chain,brushes:v.brushes,properties:v.properties,brand:v.brand})]})]})}):null}}}]);