"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("react"),w=require("swiper/modules"),d=require("swiper/react"),R=require("../../utils/useSwiper/useSwiper.cjs.js"),q=require("../../utils/cn/cn.cjs.js");;/* empty css                                                                         */;/* empty css                                                                                     */;/* empty css                                                                                     */const s=require("../../src/modules/ResearchEssentialReadings/researchEssentialReadings.module.css"),C=require("../../components/Typography/Typography.cjs.js"),u=require("../../components/ProgressButton/ProgressButton.cjs.js"),N=require("./components/ReadingCard/ReadingCard.cjs.js"),v=[w.Navigation],y=({readings:r})=>{const{swiper:i,isEnd:n,isBeginning:a,setIsEnd:h,hideNav:p,handleSlideChange:g,handlePrevClick:l,handleNextClick:t,onSwiperInit:m,handleSwiperResize:S,handleSlideTo:o}=R.useSwiper();return c.useEffect(()=>{i==null||i.setProgress(0,300)},[i]),c.useEffect(()=>{r.length&&o(0)},[r,o]),e.jsx("div",{className:s.root,children:e.jsxs("div",{className:s.container,children:[e.jsxs("div",{className:s.topRow,children:[e.jsx("div",{className:s.headerWrapper,children:e.jsx("div",{className:s.header,children:e.jsx(C.Typography,{defaultVariant:"displayXs",mobileVariant:"headingLg",children:"Essential Readings"})})}),e.jsx("div",{className:q.cn(s.swiperControlsDesktop,{[s.swiperControlsHidden]:p}),children:e.jsx(u.ProgressButton,{left:{disabled:a,onClick:l},right:{disabled:n,onClick:t}})})]}),e.jsx("div",{className:s.carouselArea,children:e.jsx(d.Swiper,{onSwiper:m,onResize:S,onSlideChange:g,onReachEnd:()=>h(!0),modules:v,spaceBetween:0,slidesPerView:"auto",className:s.swiper,children:r.map((j,x)=>e.jsx(d.SwiperSlide,{className:s.swiperSlide,children:e.jsx(N.ReadingCard,{...j})},x))})}),e.jsx("div",{className:s.swiperControlsMobile,children:e.jsx(u.ProgressButton,{left:{disabled:a,onClick:l},right:{disabled:n,onClick:t}})})]})})};exports.ResearchEssentialReadings=y;
