{"version":3,"file":"CaseStudyGallery.DisblEzQ.mjs","names":["useCallback","useMemo","useState","useRef"],"sources":["https:/framerusercontent.com/modules/tUitzH5asY5E5W72X0mS/JDTHY76qpFOSrk6a5CP8/CaseStudyGallery.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{startTransition,useCallback,useEffect,useMemo,useRef,useState}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useInView}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function CaseStudyGallery(props){const{image1=\"\",image2=\"\",image3=\"\",image4=\"\",image5=\"\",image6=\"\",autoplay=true,intervalSeconds=3,borderRadius=\"12px\",controlColor=\"#000000\",controlSurface=\"#F5F5F5\",controlFont={fontSize:\"14px\",letterSpacing:\"-0.01em\",lineHeight:\"1em\",fontWeight:600}}=props;const normalizeImageValue=useCallback(value=>{if(typeof value===\"string\")return value.trim();if(!value||typeof value!==\"object\")return\"\";const possibleSrc=value.src??value.url;return typeof possibleSrc===\"string\"?possibleSrc.trim():\"\";},[]);const safeImages=useMemo(()=>{const candidateImages=[image1,image2,image3,image4,image5,image6];const filtered=candidateImages.map(imageValue=>normalizeImageValue(imageValue)).filter(imageUrl=>imageUrl.length>0);return filtered.length>0?filtered:[\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\"];},[image1,image2,image3,image4,image5,image6,normalizeImageValue]);const[currentIndex,setCurrentIndex]=useState(0);const[timerResetKey,setTimerResetKey]=useState(0);const clampedIntervalSeconds=Math.max(1,intervalSeconds||3);const rootRef=useRef(null);const inView=useInView(rootRef,{amount:.35});const isStatic=useIsStaticRenderer();useEffect(()=>{if(currentIndex>safeImages.length-1){startTransition(()=>setCurrentIndex(0));}},[currentIndex,safeImages.length]);const goToPrevious=useCallback(()=>{startTransition(()=>{setCurrentIndex(prev=>(prev-1+safeImages.length)%safeImages.length);setTimerResetKey(prev=>prev+1);});},[safeImages.length]);const goToNext=useCallback(()=>{startTransition(()=>{setCurrentIndex(prev=>(prev+1)%safeImages.length);setTimerResetKey(prev=>prev+1);});},[safeImages.length]);useEffect(()=>{if(!autoplay||safeImages.length<=1||isStatic||!inView)return;if(typeof window===\"undefined\")return;const timerId=window.setInterval(()=>{startTransition(()=>{setCurrentIndex(prev=>(prev+1)%safeImages.length);});},clampedIntervalSeconds*1e3);return()=>window.clearInterval(timerId);},[autoplay,clampedIntervalSeconds,safeImages.length,timerResetKey,isStatic,inView]);const currentImageUrl=safeImages[currentIndex]||\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\";const currentImageAlt=`Case study slide ${currentIndex+1} of ${safeImages.length}`;return /*#__PURE__*/_jsxs(\"section\",{ref:rootRef,style:{position:\"relative\",width:\"100%\",maxWidth:900,margin:\"0 auto\",background:\"#FFFFFF\",color:\"#000000\",borderRadius,overflow:\"hidden\"},children:[/*#__PURE__*/_jsx(\"img\",{src:currentImageUrl,alt:currentImageAlt,style:{width:\"100%\",height:\"auto\",objectFit:\"contain\",display:\"block\",borderRadius,background:\"#FFFFFF\"}}),/*#__PURE__*/_jsxs(\"div\",{style:{position:\"absolute\",left:12,right:12,bottom:12,display:\"flex\",justifyContent:\"space-between\",alignItems:\"center\",pointerEvents:\"none\"},children:[/*#__PURE__*/_jsx(\"button\",{type:\"button\",\"aria-label\":\"Previous image\",onClick:goToPrevious,style:{pointerEvents:\"auto\",width:34,height:34,border:\"none\",borderRadius:999,background:controlSurface,color:controlColor,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",cursor:\"pointer\",fontFamily:controlFont.fontFamily,fontWeight:controlFont.fontWeight,fontStyle:controlFont.fontStyle,letterSpacing:controlFont.letterSpacing,lineHeight:controlFont.lineHeight,fontSize:controlFont.fontSize},children:\"←\"}),/*#__PURE__*/_jsx(\"button\",{type:\"button\",\"aria-label\":\"Next image\",onClick:goToNext,style:{pointerEvents:\"auto\",width:34,height:34,border:\"none\",borderRadius:999,background:controlSurface,color:controlColor,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",cursor:\"pointer\",fontFamily:controlFont.fontFamily,fontWeight:controlFont.fontWeight,fontStyle:controlFont.fontStyle,letterSpacing:controlFont.letterSpacing,lineHeight:controlFont.lineHeight,fontSize:controlFont.fontSize},children:\"→\"})]})]});}addPropertyControls(CaseStudyGallery,{image1:{type:ControlType.Image,title:\"Image 1\"},image2:{type:ControlType.Image,title:\"Image 2\"},image3:{type:ControlType.Image,title:\"Image 3\"},image4:{type:ControlType.Image,title:\"Image 4\"},image5:{type:ControlType.Image,title:\"Image 5\"},image6:{type:ControlType.Image,title:\"Image 6\"},autoplay:{type:ControlType.Boolean,title:\"Autoplay\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},intervalSeconds:{type:ControlType.Number,title:\"Interval\",defaultValue:3,min:1,max:20,step:.5,unit:\"s\"},borderRadius:{type:ControlType.BorderRadius,title:\"Radius\",defaultValue:\"12px\"},controlColor:{type:ControlType.Color,title:\"Control\",defaultValue:\"#000000\"},controlSurface:{type:ControlType.Color,title:\"Surface\",defaultValue:\"#F5F5F5\"},controlFont:{type:ControlType.Font,title:\"Control Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{variant:\"Semibold\",fontSize:\"14px\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CaseStudyGallery\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CaseStudyGallery.map"],"mappings":"2RAGG,SAAwB,EAAiB,EAAM,CAAC,GAAK,CAAC,SAAO,GAAG,SAAO,GAAG,SAAO,GAAG,SAAO,GAAG,SAAO,GAAG,SAAO,GAAG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