import{D as n,j as e,W as m,X as c,M as d,R as x,U as p,r as u,V as f}from"./entry.client-CV0PzNS2.js";import{I as h}from"./IndexComponent-B1C-PZU4.js";import{I as g,S as l}from"./SelectFilter-CtfMWzbP.js";import"./useQuery-_I6Fb0gn.js";import"./NoElementsFound-BYYh6uWM.js";import"./Paginator-CdCtQQNK.js";import"./Select-CiUaCRv7.js";import"./isNil-DJ_omAdg.js";import"./trim-BKnRwbL4.js";import"./useFlexiblePrefillValues-CdKhmvNK.js";import"./useFlexibleOptions-BzusANQ_.js";import"./parseQueryParams-Bd6KFXLi.js";const j=()=>{const{filters:s,sideCard:t}=n().route;return e.jsxs("div",{className:"flex flex-col justify-center items-center w-full",children:[e.jsxs("div",{className:"w-full flex flex-col lg:flex-row items-center justify-end gap-2",children:[e.jsx(g,{id:"q",className:"w-full"}),e.jsx("div",{className:"flex-1 hidden md:block"}),s&&s.categories&&e.jsx(l,{id:"categories",label:"Filtra per categoria:",changeUrl:!0,filterKey:"category"}),s&&s.types&&e.jsx(l,{id:"types",label:"Filtra per tipologia:"}),e.jsx(l,{id:"sort",label:"Ordina per:"})]}),e.jsxs("div",{className:"group/index flex flex-col-reverse md:flex-row items-stretch md:items-start justify-center",children:[e.jsx("div",{className:`flex-1 ${t?"bg-gray-100 rounded-md mt-2":""}`,children:e.jsx(h,{customRoutablesType:"course",showTopPagination:!1,className:t?"!mt-0 !grid-cols-1 md:!grid-cols-2 lg:!grid-cols-3 xl:!grid-cols-4":""})}),t&&e.jsx("div",{className:"sticky top-16 md:top-20 lg:top-28 xl:top-32 transition-all",children:e.jsx("div",{className:"w-full p-2",children:e.jsxs("div",{className:"relative w-full md:max-w-[200px] xl:max-w-[250px] lg:min-h-[100px] transition-all transform md:group-hover/index:translate-x-1 group-hover/index:scale-105",children:[e.jsx("div",{className:"bg-green-600 absolute bottom-0 md:bottom-auto md:top-0 left-0 transform translate-x-full translate-y-1/2 md:-translate-x-1/2 md:translate-y-full rotate-45 w-4 h-4"}),e.jsx(m,{variant:"transparent",elevated:!1,className:"relative w-full h-full hover:cursor-pointer !border-0 shadow-md",href:t.url,children:e.jsxs("div",{className:"h-full flex flex-row items-center md:items-stretch md:flex-col p-2 pl-4 md:p-4 bg-green-600 text-overAccent",children:[e.jsxs("div",{className:"flex-1 flex flex-col",children:[e.jsx("div",{className:"flex flex-row items-center text-md md:text-lg font-semibold text-justify mr-2 md:mr-0",children:e.jsx("span",{className:"leading-tight",children:t.title})}),t.subtitle&&e.jsx("div",{className:"hidden md:flex flex-row items-center text-sm text-overAccent opacity-70 mt-2",children:e.jsx("span",{children:e.jsx(c,{className:"!mb-0 !text-justify leading-tight",children:t.subtitle})})})]}),e.jsx("div",{className:"flex flex-row gap-1 mt-0 md:mt-4",children:e.jsx(d,{color:"white",size:"sm",icon:"fa-regular fa-cart-shopping",className:"w-full !m-0",buttonClassName:"!text-lg font-bold py-[5px]",children:t.button_label})})]})})]})})})]})]})},T=s=>{const{routable_type:t,routable:a}=s,{render:o}=x(),{components:r}=p(),i=u.useMemo(()=>({...r,"custom-":()=>e.jsx(j,{})}),[r]);return e.jsx("div",{className:"w-full",children:e.jsx(f,{initialComponents:i,children:o(t,a)})})};export{T as CoursesIndexRoute};