"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react"),w=require("swiper/modules"),h=require("swiper/react"),P=require("../../utils/useSwiper/useSwiper.cjs.js"),N=require("../../utils/cn/cn.cjs.js");;/* empty css                                                                         */;/* empty css                                                                                     */;/* empty css                                                                                     */const n=require("../../src/components/ImageGallery/imageGallery.module.css"),m=require("./components/ImageGalleryPagination/ImageGalleryPagination.cjs.js"),g=require("../GalleryPagination/GalleryPagination.cjs.js"),b=require("../Label/Label.cjs.js"),v=[w.Navigation],G=({images:r,label:o,className:S,type:s="primary",paginationType:t})=>{const{activeIndex:i,handleSlideTo:d,handleSlideChange:p,onSwiperInit:j,handleSwiperResize:x,handleUserInteraction:a}=P.useSwiperWithAutoPlay(3e3),l=u.useCallback(c=>{a(),d(c)},[a,d]),y=u.useMemo(()=>t?t==="thumbnail"?e.jsx(m.ImageGalleryPagination,{images:r,activeIndex:i,onSelect:l}):e.jsx(g.GalleryPagination,{count:r.length,activeIndex:i,onSelect:l}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:n.hideOnMobile,children:e.jsx(m.ImageGalleryPagination,{images:r,activeIndex:i,onSelect:l})}),e.jsx("div",{className:n.hideOnDesktop,children:e.jsx(g.GalleryPagination,{count:r.length,activeIndex:i,onSelect:l})})]}),[r.length,i,l,t]);return e.jsxs("div",{className:N.cn(n.root,S,{[n.primary]:s==="primary",[n.secondary]:s==="secondary"}),children:[o&&e.jsx("div",{className:n.labelWrap,children:e.jsx(b.Label,{color:"black",size:"sm",children:o})}),e.jsx(h.Swiper,{onSwiper:j,onResize:x,onSlideChange:p,onTouchStart:a,onTouchEnd:a,modules:v,spaceBetween:0,slidesPerView:1,className:n.swiper,children:r.map((c,q)=>e.jsx(h.SwiperSlide,{children:e.jsx("div",{className:n.imageContainer,children:e.jsx("div",{className:n.imageWrapper,children:e.jsx("img",{src:c,alt:"product image",width:s==="primary"?600:492,height:s==="primary"?600:389,className:n.image,onClick:a})})})},q))}),y]})};exports.ImageGallery=G;
