{"version":3,"file":"Simple_Slideshow.CBKi6B3F.mjs","names":[],"sources":["https:/framerusercontent.com/modules/oJnwsseQ5Qa3HYMJ9iHf/8PDS31VUJuniqIoPWgFD/Simple_Slideshow.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";const isBrowser=typeof window!==\"undefined\";const isCanvas=RenderTarget.current()===RenderTarget.canvas;/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n * @framerDisableUnlink\n */export function SwiperCenteredSlider({slides}){const containerRef=useRef(null);const[hydrated,setHydrated]=useState(false);useEffect(()=>{if(isBrowser)setHydrated(true);},[]);useEffect(()=>{if(!hydrated||!isBrowser||!window.Swiper)return;const swiper=new window.Swiper(\".swiper\",{centeredSlides:true,slidesPerView:\"auto\",spaceBetween:12,loop:true,autoplay:isCanvas?false:{delay:2500,disableOnInteraction:true},simulateTouch:true});const updateChildWidths=()=>{const slideEls=document.querySelectorAll(\".swiper-slide\");slideEls.forEach(slide=>{const child=slide.firstElementChild;if(child){Object.assign(child.style,{width:\"calc(100vw - 80px)\",minWidth:\"296px\",maxWidth:\"400px\"});}});swiper.update();};updateChildWidths();window.addEventListener(\"resize\",updateChildWidths);return()=>window.removeEventListener(\"resize\",updateChildWidths);},[hydrated]);if(isCanvas){return /*#__PURE__*/_jsx(\"div\",{style:{padding:40,textAlign:\"center\",color:\"#999\"},children:\"Canvas Preview: Slider\"});}return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{overflow:\"visible\"},children:/*#__PURE__*/_jsx(\"div\",{className:\"swiper\",style:{overflow:\"visible\"},children:/*#__PURE__*/_jsx(\"div\",{className:\"swiper-wrapper\",style:{display:\"flex\",alignItems:\"center\"},children:slides.map((slide,index)=>/*#__PURE__*/_jsx(\"div\",{className:\"swiper-slide\",style:{flexShrink:1,display:\"flex\",justifyContent:\"flex-start\",overflow:\"visible\"},children:slide},index))})})});}SwiperCenteredSlider.defaultProps={slides:[]};addPropertyControls(SwiperCenteredSlider,{slides:{type:ControlType.Array,title:\"Slides\",control:{type:ControlType.ComponentInstance},maxCount:10}});\nexport const __FramerMetadata__ = {\"exports\":{\"SwiperCenteredSlider\":{\"type\":\"reactComponent\",\"name\":\"SwiperCenteredSlider\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Simple_Slideshow.map"],"mappings":"4UAIG,SAAgB,EAAqB,CAAC,SAAO,CAAC,CAAC,IAAM,EAAa,EAAO,KAAK,CAAM,CAAC,EAAS,EAAY,CAAC,GAAS,EAAM,CAA+1B,MAA91B,GAAU,IAAI,CAAC,AAAG,GAAU,GAAY,EAAK,AAAE,EAAC,CAAE,EAAC,CAAC,EAAU,IAAI,CAAC,IAAI,IAAW,IAAY,EAAO,OAAO,OAAO,IAAM,EAAO,IAAI,EAAO,OAAO,UAAU,CAAC,gBAAe,EAAK,cAAc,OAAO,aAAa,GAAG,MAAK,EAAK,SAAS,GAAS,EAAM,CAAC,MAAM,KAAK,sBAAqB,CAAK,EAAC,eAAc,CAAK,GAAQ,EAAkB,IAAI,CAAC,IAAM,EAAS,SAAS,iBAAiB,gBAAgB,CAAsK,AAArK,EAAS,QAAQ,GAAO,CAAC,IAAM,EAAM,EAAM,kBAAkB,AAAG,GAAO,OAAO,OAAO,EAAM,MAAM,CAAC,MAAM,qBAAqB,SAAS,QAAQ,SAAS,OAAQ,EAAC,AAAG,EAAC,CAAC,EAAO,QAAQ,AAAE,EAAyE,MAAxE,IAAmB,CAAC,EAAO,iBAAiB,SAAS,EAAkB,CAAO,IAAI,EAAO,oBAAoB,SAAS,EAAkB,AAAE,EAAC,CAAC,CAAS,EAAC,CAAI,EAA8B,EAAK,MAAM,CAAC,MAAM,CAAC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