{"version":3,"file":"Simple_Slideshow.BzRos8QU.mjs","names":["useRef","useState","__esmMin","window","init_npm_react_18_3_1","de","init_ssg_sandbox_shims","init_jsx_runtime","c","ce","_e","addPropertyControls","ControlType","RenderTarget","init_framer_DKWANagr","SwiperCenteredSlider","containerRef","hydrated","setHydrated","isBrowser","swiper","updateChildWidths","child","slide","isCanvas","slides","index","init_Simple_Slideshow"],"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":"A,+MAIG,SAAgBe,EAAqB,CAAC,UAAQ,CAAC,IAAMC,EAAahB,EAAO,IAAI,EAAO,CAACiB,EAASC,GAAajB,EAAS,EAAK,EAAg2B,OAA91BQ,MAAc,CAAIU,GAAUD,EAAY,EAAI,CAAE,EAAE,CAAC,CAAC,EAAET,MAAc,CAAC,GAAG,CAACQ,GAAU,CAACE,GAAW,CAAChB,EAAO,OAAO,OAAO,IAAMiB,EAAO,IAAIjB,EAAO,OAAO,UAAU,CAAC,eAAe,GAAK,cAAc,OAAO,aAAa,GAAG,KAAK,GAAK,SAAS,IAAe,CAAC,MAAM,KAAK,qBAAqB,EAAI,EAAE,cAAc,EAAI,CAAC,EAAQkB,MAAsB,CAA2D,SAAlC,iBAAiB,eAAwB,CAAC,CAAC,QAAQ,GAAO,CAAC,IAAMC,EAAMC,EAAM,kBAAqBD,GAAO,OAAO,OAAOA,EAAM,MAAM,CAAC,MAAM,qBAAqB,SAAS,QAAQ,SAAS,OAAO,CAAC,CAAG,CAAC,EAAEF,E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