1import{r as o,j as e}from"./router-C3G0N1zd.js";import{u as E,A as b}from"./embla-BcYiPipL.js";import{b as c}from"./index-BHtoZQHS.js";import{B as j,a as I,C as A}from"./button-fzhn_NoD.js";import{I as p}from"./image-1Pz6vk_v.js";const C=o.createContext(null);function f(){const t=o.useContext(C);if(!t)throw new Error("useCarousel must be used within a <Carousel />");return t}function N({orientation:t="horizontal",opts:r,setApi:l,plugins:a,className:i,children:u,...d}){const[k,s]=E({...r,axis:t==="horizontal"?"x":"y"},a),[z,S]=o.useState(!1),[P,D]=o.useState(!1),x=o.useCallback(n=>{n&&(S(n.canScrollPrev()),D(n.canScrollNext()))},[]),m=o.useCallback(()=>{s==null||s.scrollPrev()},[s]),h=o.useCallback(()=>{s==null||s.scrollNext()},[s]),R=o.useCallback(n=>{n.key==="ArrowLeft"?(n.preventDefault(),m()):n.key==="ArrowRight"&&(n.preventDefault(),h())},[m,h]);return o.useEffect(()=>{!s||!l||l(s)},[s,l]),o.useEffect(()=>{if(s)return x(s),s.on("reInit",x),s.on("select",x),()=>{s==null||s.off("select",x)}},[s,x]),e.jsx(C.Provider,{value:{carouselRef:k,api:s,opts:r,orientation:t||((r==null?void 0:r.axis)==="y"?"vertical":"horizontal"),scrollPrev:m,scrollNext:h,canScrollPrev:z,canScrollNext:P},children:e.jsx("div",{onKeyDownCapture:R,className:c("relative",i),role:"region","aria-roledescription":"carousel","data-slot":"carousel",...d,children:u})})}function v({className:t,...r}){const{carouselRef:l,orientation:a}=f();return e.jsx("div",{ref:l,className:"overflow-hidden","data-slot":"carousel-content",children:e.jsx("div",{className:c("flex",a==="horizontal"?"-ml-4":"-mt-4 flex-col",t),...r})})}function g({className:t,...r}){const{orientation:l}=f();return e.jsx("div",{role:"group","aria-roledescription":"slide","data-slot":"carousel-item",className:c("min-w-0 shrink-0 grow-0 basis-full ",l==="horizontal"?"pl-4":"pt-4",t),...r})}function w({className:t,variant:r="ghost",size:l="icon",...a}){const{orientation:i,scrollPrev:u,canScrollPrev:d}=f();return e.jsxs(j,{"data-slot":"carousel-previous",variant:r,size:l,className:c("absolute size-9 rounded-full cursor-pointer opacity-70 ",i==="horizontal"?"top-1/2 left-1 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!d,onClick:u,...a,children:[e.jsx(I,{className:"size-8 ",strokeWidth:3}),e.jsx("span",{className:"sr-only",children:"Previous slide"})]})}function y({className:t,variant:r="ghost",size:l="default",...a}){const{orientation:i,scrollNext:u,canScrollNext:d}=f();return e.jsxs(j,{"data-slot":"carousel-next",variant:r,size:l,className:c("absolute size-9 rounded-full cursor-pointer opacity-70 ",i==="horizontal"?"top-1/2 right-1 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!d,onClick:u,...a,children:[e.jsx(A,{className:"size-8 ",strokeWidth:3}),e.jsx("span",{className:"sr-only",children:"Next slide"})]})}function $({posts:t,isHome:r=!1}){return e.jsxs(N,{opts:{loop:!0},className:"max-w-screen",plugins:[b({delay:6e3})],children:[e.jsx(v,{children:t.map((l,a)=>e.jsx(g,{children:e.jsx("div",{className:c("rounded-2xl flex aspect-16/9 items-center justify-center my-2.5 mx-1.5 shadow-md shadow-black/30",r&&"rounded-xl"),children:e.jsx("a",{href:l.link,title:l.titre,target:"_blank",rel:"noopener noreferrer",children:e.jsx(p,{src:{src:`https://images2.fibladi.com/H500/${l.image.split(".")[0]}.webp`},altReal:l.titre,className:c("w-full border border-neutral-300 aspect-16/9 rounded-2xl object-cover brightness-100 transition-[filter] duration-300 group-hover:brightness-75",r&&"rounded-xl"),fill:!0})})})},a))}),e.jsx(w,{}),e.jsx(y,{})]})}function H({posts:t}){return e.jsxs(N,{plugins:[b({delay:6e3})],opts:{loop:!0},className:"max-w-screen px-8",children:[e.jsx(v,{children:[...t,...t].map((r,l)=>e.jsx(g,{className:"md:basis-1/2 lg:basis-1/3",children:e.jsx("div",{className:"flex aspect-16/9 rounded-2xl items-center justify-center m-2.5 mt-0 shadow-md shadow-black/30",children:e.jsx("a",{href:r.link,target:"_blank",rel:"noopener noreferrer",children:e.jsx(p,{src:{src:`https://images2.fibladi.com/H500/${r.image.split(".")[0]}.webp`},altReal:r.titre,className:"w-full border-neutral-500 border-y-1 aspect-16/9 rounded-2xl object-cover brightness-100 transition-[filter] duration-300 group-hover:brightness-75",fill:!0})})})},l))}),e.jsx(w,{className:"-left-1"}),e.jsx(y,{className:"-right-1"})]})}
1export{$ as C,H as a};
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.