1import{i as e,t}from"./jsx-runtime-DUAcabCT.js";import{t as n}from"./react-6OGjdfot.js";import{t as r}from"./createLucideIcon-CLQ5Hlf7.js";import{t as i}from"./x-DUE8bqMX.js";var a=r(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),o=e(n(),1),s=t();function c({facets:e,selected:t,onToggle:n,onClear:r,showBenefits:c=!0}){let[u,d]=(0,o.useState)(!1),f=t.sport.length+t.color.length+(c?t.benefit.length:0)>0,p=t.sport.length+t.color.length+(c?t.benefit.length:0),m=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,s.jsx)(`h2`,{className:`text-sm font-bold uppercase tracking-wider`,children:`Filtri`}),f&&(0,s.jsx)(`button`,{onClick:r,className:`text-xs text-muted-foreground hover:text-black underline`,children:`Rimuovi`})]}),f&&(0,s.jsx)(`div`,{className:`flex flex-wrap gap-1.5 mb-6`,children:[...t.sport.map(e=>[`sport`,e]),...t.color.map(e=>[`color`,e]),...c?t.benefit.map(e=>[`benefit`,e]):[]].map(([e,t])=>(0,s.jsxs)(`button`,{onClick:()=>n(e,t),className:`inline-flex items-center gap-1 bg-black text-white text-[11px] uppercase tracking-wider px-2 py-1 hover:bg-black/80`,children:[t,` `,(0,s.jsx)(i,{className:`h-3 w-3`})]},`${e}-${t}`))}),(0,s.jsx)(l,{title:`Sport`,items:e.sports,selected:t.sport,onToggle:e=>n(`sport`,e)}),e.colors.length>0&&(0,s.jsx)(l,{title:`Colore`,items:e.colors,selected:t.color,onToggle:e=>n(`color`,e),className:`border-t pt-5 mt-5`}),c&&(0,s.jsx)(l,{title:`Benefici`,items:e.benefits,selected:t.benefit,onToggle:e=>n(`benefit`,e),className:`border-t pt-5 mt-5`})]});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(`button`,{onClick:()=>d(!0),className:`lg:hidden w-full inline-flex items-center justify-center gap-2 border-2 border-black bg-white px-4 py-3 text-sm font-bold uppercase tracking-wider`,children:[(0,s.jsx)(a,{className:`h-4 w-4`}),`Filtri`,p>0&&(0,s.jsx)(`span`,{className:`ml-1 inline-flex h-5 min-w-[20px] items-center justify-center bg-black text-white text-[10px] px-1.5`,children:p})]}),(0,s.jsx)(`aside`,{className:`hidden lg:block lg:sticky lg:top-24 lg:self-start max-h-[calc(100vh-6rem)] overflow-y-auto pr-2`,children:m}),u&&(0,s.jsxs)(`div`,{className:`fixed inset-0 z-50 lg:hidden`,children:[(0,s.jsx)(`div`,{className:`absolute inset-0 bg-black/50`,onClick:()=>d(!1)}),(0,s.jsxs)(`div`,{className:`absolute inset-y-0 left-0 w-[85%] max-w-[320px] bg-white shadow-xl flex flex-col`,children:[(0,s.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-4 border-b`,children:[(0,s.jsx)(`h2`,{className:`text-sm font-bold uppercase tracking-wider`,children:`Filtri`}),(0,s.jsx)(`button`,{onClick:()=>d(!1),"aria-label":`Chiudi filtri`,className:`p-2 hover:bg-secondary`,children:(0,s.jsx)(i,{className:`h-5 w-5`})})]}),(0,s.jsx)(`div`,{className:`flex-1 overflow-y-auto px-4 py-5`,children:m}),(0,s.jsx)(`div`,{className:`border-t p-4`,children:(0,s.jsx)(`button`,{onClick:()=>d(!1),className:`w-full bg-black text-white py-3 text-sm font-bold uppercase tracking-wider`,children:`Mostra risultati`})})]})]})]})}function l({title:e,items:t,selected:n,onToggle:r,className:i=``}){return t.length===0?null:(0,s.jsxs)(`div`,{className:i,children:[(0,s.jsx)(`h3`,{className:`text-xs font-bold uppercase tracking-wider mb-3`,children:e}),(0,s.jsx)(`ul`,{className:`space-y-2`,children:t.map(([e,t])=>{let i=n.includes(e);return(0,s.jsx)(`li`,{children:(0,s.jsxs)(`label`,{className:`flex items-center gap-2 text-sm cursor-pointer group`,children:[(0,s.jsx)(`input`,{type:`checkbox`,checked:i,onChange:()=>r(e),className:`h-4 w-4 accent-black`}),(0,s.jsx)(`span`,{className:`flex-1 ${i?`text-black font-medium`:`text-foreground/80 group-hover:text-black`}`,children:e}),(0,s.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`(`,t,`)`]})]})},e)})})]})}export{c as t};
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.