"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),g=require("react"),m=require("swiper/modules"),d=require("swiper/react"),j=require("../../utils/useSwiper/useSwiper.cjs.js"),q=require("../../utils/cn/cn.cjs.js");;/* empty css                                                                         */;/* empty css                                                                                     */;/* empty css                                                                                     */const x=require("../GalleryPagination/GalleryPagination.cjs.js"),i=require("../../src/components/AdvancedGallery/advancedGallery.module.css"),y=require("../Label/Label.cjs.js"),v=require("./components/VideoSlide/VideoSlide.cjs.js"),w=require("./components/ImageGalleryPagination/ImageGalleryPagination.cjs.js"),P=[m.Navigation],_=({items:r,label:l,className:u})=>{const{activeIndex:s,handleSlideTo:c,handleSlideChange:S,onSwiperInit:h,handleSwiperResize:p,handleUserInteraction:n}=j.useSwiperWithAutoPlay(5e3),o=g.useCallback(a=>{n(),c(a)},[n,c]);return e.jsxs("div",{className:q.cn(i.root,u),children:[l&&e.jsx("div",{className:i.labelWrap,children:e.jsx(y.Label,{color:"black",size:"sm",children:l})}),e.jsx(d.Swiper,{onSwiper:h,onResize:p,onSlideChange:S,onTouchStart:n,onTouchEnd:n,modules:P,spaceBetween:0,slidesPerView:1,className:i.swiper,children:r.map((a,t)=>e.jsxs(d.SwiperSlide,{children:[a.mediaType==="image"&&e.jsx("div",{className:i.imageWrapper,children:e.jsx("img",{src:a.url,alt:"product image",className:i.image,onClick:n})}),a.mediaType==="video"&&e.jsx(v.VideoSlide,{item:a,isActive:s===t,onClick:n})]},t))}),e.jsx("div",{className:i.hideOnMobile,children:e.jsx(w.ImageGalleryPagination,{items:r,activeIndex:s,onSelect:o})}),e.jsx("div",{className:i.hideOnDesktop,children:e.jsx(x.GalleryPagination,{count:r.length,activeIndex:s,onSelect:o})})]})};exports.AdvancedGallery=_;
