{"version":3,"file":"ImageCarousel.ByMJ8Pmv.mjs","names":["useMemo","useState","useRef"],"sources":["https:/framerusercontent.com/modules/k7GKzApgnsI73fZJko70/RdJQB7DcyVb5lCkmlTTh/ImageCarousel.js"],"sourcesContent":["// Automated Image Carousel with progress bar, zoom animation, and extensive customization options\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useMemo,useState,useRef,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";/**\n * Automated Image Carousel\n * \n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function ImageCarousel(props){const{image1={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Gradient 1 - Blue\"},image2={src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Gradient 2 - Purple\"},image3={src:\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\",alt:\"Gradient 3 - Orange\"},duration=3e3,showProgress=true,progressHeight=4,progressForeground=\"#000000\",progressBackground=\"#CCCCCC\",progressPosition=\"bottom\",progressPaddingLeft=0,progressPaddingRight=0,progressPaddingBottom=0,progressPaddingTop=0,enableZoom=true,zoomScale=1.1,zoomDuration=3e3}=props;const images=useMemo(()=>[image1,image2,image3],[image1,image2,image3]);const resolveImage=item=>{if(!item)return null;if(typeof item===\"string\")return{src:item};if(typeof item?.src===\"string\"&&item.src)return{src:item.src,alt:item.alt,srcSet:item.srcSet};if(typeof item?.image?.src===\"string\"&&item.image.src)return{src:item.image.src,alt:item.image.alt,srcSet:item.image.srcSet};return null;};const isStatic=useIsStaticRenderer();const[currentIndex,setCurrentIndex]=useState(0);const[progress,setProgress]=useState(0);const[isFirstImage,setIsFirstImage]=useState(true);const startTimeRef=useRef(0);const animationFrameRef=useRef();useEffect(()=>{if(isStatic)return;if(typeof window===\"undefined\")return;if(!Array.isArray(images)||images.length===0)return;startTimeRef.current=Date.now();const animate=()=>{const elapsed=Date.now()-startTimeRef.current;const newProgress=Math.min(elapsed/duration*100,100);startTransition(()=>{setProgress(newProgress);});if(elapsed>=duration){startTransition(()=>{setCurrentIndex(prev=>{const next=prev+1;if(isFirstImage){setIsFirstImage(false);}return images.length>0?next%images.length:0;});setProgress(0);});startTimeRef.current=Date.now();}animationFrameRef.current=window.requestAnimationFrame(animate);};animationFrameRef.current=window.requestAnimationFrame(animate);return()=>{if(animationFrameRef.current){window.cancelAnimationFrame(animationFrameRef.current);}};},[duration,images,isStatic]);const safeIndex=images.length>0&&Number.isFinite(currentIndex)?Math.min(images.length-1,Math.max(0,currentIndex)):0;const currentImage=images[safeIndex]||images[0];const imageData=resolveImage(currentImage)||resolveImage(images[0])||{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Default image\"};const isCanvasLike=isStatic;const slideScale=enableZoom&&!isCanvasLike?zoomScale:1;const isHorizontal=progressPosition===\"top\"||progressPosition===\"bottom\";const progressStyle=isHorizontal?{position:\"absolute\",[progressPosition]:progressPosition===\"top\"?progressPaddingTop:progressPaddingBottom,left:progressPaddingLeft,right:progressPaddingRight,height:progressHeight,width:`calc(100% - ${progressPaddingLeft+progressPaddingRight}px)`,backgroundColor:progressBackground,overflow:\"hidden\",zIndex:10}:{position:\"absolute\",[progressPosition]:progressPosition===\"left\"?progressPaddingLeft:progressPaddingRight,top:progressPaddingTop,bottom:progressPaddingBottom,width:progressHeight,height:`calc(100% - ${progressPaddingTop+progressPaddingBottom}px)`,backgroundColor:progressBackground,overflow:\"hidden\",zIndex:10};const progressBarStyle=isHorizontal?{height:\"100%\",width:`${progress}%`,backgroundColor:progressForeground}:{width:\"100%\",height:`${progress}%`,backgroundColor:progressForeground};return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",backgroundColor:\"#000\"},children:[/*#__PURE__*/_jsx(AnimatePresence,{mode:\"wait\",children:/*#__PURE__*/_jsx(motion.div,{initial:isFirstImage?{opacity:1,scale:1}:{opacity:0,scale:1},animate:{opacity:1,scale:slideScale},exit:{opacity:0},transition:{opacity:{duration:.5},scale:{duration:zoomDuration/1e3,ease:\"linear\"}},style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:/*#__PURE__*/_jsx(\"img\",{src:imageData.src,srcSet:imageData.srcSet,alt:imageData.alt||`Slide ${safeIndex+1}`,style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",display:\"block\"},draggable:false})},currentIndex)}),showProgress&&/*#__PURE__*/_jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.4},style:progressStyle,children:/*#__PURE__*/_jsx(\"div\",{style:progressBarStyle})})]});}addPropertyControls(ImageCarousel,{image1:{type:ControlType.ResponsiveImage,title:\"Image 1\"},image2:{type:ControlType.ResponsiveImage,title:\"Image 2\"},image3:{type:ControlType.ResponsiveImage,title:\"Image 3\"},duration:{type:ControlType.Number,title:\"Duration\",defaultValue:3e3,step:100,unit:\"ms\",displayStepper:true},showProgress:{type:ControlType.Boolean,title:\"Show Progress\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},progressPosition:{type:ControlType.Enum,title:\"Progress Position\",options:[\"top\",\"bottom\",\"left\",\"right\"],optionTitles:[\"Top\",\"Bottom\",\"Left\",\"Right\"],defaultValue:\"bottom\",displaySegmentedControl:true,hidden:({showProgress})=>!showProgress},progressHeight:{type:ControlType.Number,title:\"Progress Height\",defaultValue:4,min:1,max:20,step:1,unit:\"px\",hidden:({showProgress})=>!showProgress},progressPaddingLeft:{type:ControlType.Number,title:\"Padding Left\",defaultValue:0,step:1,unit:\"px\",hidden:({showProgress})=>!showProgress},progressPaddingRight:{type:ControlType.Number,title:\"Padding Right\",defaultValue:0,step:1,unit:\"px\",hidden:({showProgress})=>!showProgress},progressPaddingTop:{type:ControlType.Number,title:\"Padding Top\",defaultValue:0,step:1,unit:\"px\",hidden:({showProgress})=>!showProgress},progressPaddingBottom:{type:ControlType.Number,title:\"Padding Bottom\",defaultValue:0,step:1,unit:\"px\",hidden:({showProgress})=>!showProgress},progressForeground:{type:ControlType.Color,title:\"Progress Color\",defaultValue:\"#000000\",hidden:({showProgress})=>!showProgress},progressBackground:{type:ControlType.Color,title:\"Progress BG\",defaultValue:\"#CCCCCC\",hidden:({showProgress})=>!showProgress},enableZoom:{type:ControlType.Boolean,title:\"Enable Zoom\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},zoomScale:{type:ControlType.Number,title:\"Zoom Scale\",defaultValue:1.1,min:1,max:1.5,step:.05,hidden:({enableZoom})=>!enableZoom},zoomDuration:{type:ControlType.Number,title:\"Zoom Duration\",defaultValue:3e3,step:100,unit:\"ms\",displayStepper:true,hidden:({enableZoom})=>!enableZoom}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ImageCarousel\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ImageCarousel.map"],"mappings":"2RAMG,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,SAAO,CAAC,IAAI,sEAAsE,IAAI,oBAAoB,CAAC,SAAO,CAAC,IAAI,oEAAoE,IAAI,sBAAsB,CAAC,SAAO,CAAC,IAAI,uEAAuE,IAAI,sBAAsB,CAAC,WAAS,IAAI,eAAa,GAAK,iBAAe,EAAE,qBAAmB,UAAU,qBAAmB,UAAU,mBAAiB,SAAS,sBAAoB,EAAE,uBAAqB,EAAE,wBAAsB,EAAE,qBAAmB,EAAE,aAAW,GAAK,YAAU,IAAI,eAAa,KAAK,EAAY,E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