{"version":3,"file":"CarouselCustom.FRymGEsa.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/9jXJ6KDqwBiRkWnnpGtn/f05Y21Iit5G1AQ6krHED/CarouselCustom.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion}from\"framer-motion\";import{useState,startTransition,useRef}from\"react\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function Carousel(props){const{children=[],arrowColor=\"#000000\",arrowBackgroundColor=\"transparent\",showDots=true,dotColor=\"#CCCCCC\",dotActiveColor=\"#000000\",gap=20,scaleFactor=.05,startIndex=0,activeDotWidth=62}=props;const[currentIndex,setCurrentIndex]=useState(startIndex);const containerRef=useRef(null);// Ensure items is always an array and filter out null/undefined\nconst items=(Array.isArray(children)?children:[children]).filter(Boolean);const totalItems=items.length;if(totalItems===0){return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",color:\"#999\",fontSize:14},children:\"Connect components to carousel\"});}const handlePrevious=()=>{startTransition(()=>{setCurrentIndex(prev=>prev===0?totalItems-1:prev-1);});};const handleNext=()=>{startTransition(()=>{setCurrentIndex(prev=>prev===totalItems-1?0:prev+1);});};const handleDotClick=index=>{startTransition(()=>{setCurrentIndex(index);});};// Calculate styles for each item based on its position relative to current index\nconst getItemStyle=index=>{// Calculate circular offset\nlet offset=index-currentIndex;// Normalize offset to handle looping (-totalItems/2 to +totalItems/2)\nif(offset>totalItems/2){offset-=totalItems;}else if(offset<-totalItems/2){offset+=totalItems;}let rotation=0;let topDistance=0;let opacity=1;let scale=1;let horizontalOffset=0;const absOffset=Math.abs(offset);// Calculate horizontal offset\n// Each item is 60% width, gap is in pixels\n// Convert gap to percentage: gap / containerWidth * 100\n// Total offset = (60% + gap%) * offset\nconst itemWidthPercent=60;// Use a default width if ref is not available yet (SSR)\nconst containerWidth=containerRef.current?.offsetWidth||1e3;const gapPercent=gap/containerWidth*100;horizontalOffset=(itemWidthPercent+gapPercent)*offset;if(absOffset===0){// Center item\nrotation=0;topDistance=0;opacity=1;scale=1;}else if(absOffset===1){// Adjacent items\nrotation=offset>0?1.66:-1.66;topDistance=24;opacity=.9;scale=1-scaleFactor;}else if(absOffset===2){// Second items\nrotation=offset>0?4.51:-4.51;topDistance=100;opacity=.7;scale=1-scaleFactor*3;}else{// Further items - progressive increase\nconst progressiveFactor=absOffset-2;rotation=offset>0?4.51+progressiveFactor*3:-(4.51+progressiveFactor*3);topDistance=100+progressiveFactor*80;opacity=Math.max(0,.7-progressiveFactor*.2);scale=Math.max(.6,1-scaleFactor*3-progressiveFactor*scaleFactor*2);}return{transform:`translateX(${horizontalOffset}%) translateY(${topDistance}px) rotateZ(${rotation}deg) scale(${scale})`,zIndex:10-absOffset,opacity:opacity};};return /*#__PURE__*/_jsxs(\"div\",{ref:containerRef,style:{width:\"100%\",height:\"100%\",position:\"relative\",display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",overflow:\"visible\"},children:[/*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\",flex:1,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",perspective:\"1000px\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",left:0,top:0,bottom:showDots?60:0,width:\"20%\",background:\"linear-gradient(to right, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%)\",pointerEvents:\"none\",zIndex:9}}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",right:0,top:0,bottom:showDots?60:0,width:\"20%\",background:\"linear-gradient(to left, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%)\",pointerEvents:\"none\",zIndex:9}}),items.map((child,index)=>{const animationProps=getItemStyle(index);return /*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",width:\"60%\",height:\"80%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},animate:animationProps,transition:{duration:.5,ease:[.32,.72,0,1]},children:/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:child})},index);})]}),/*#__PURE__*/_jsx(\"button\",{onClick:handlePrevious,style:{position:\"absolute\",left:0,top:\"50%\",transform:\"translateY(-50%)\",background:arrowBackgroundColor,border:\"none\",cursor:\"pointer\",padding:10,zIndex:10,borderRadius:\"50%\",width:44,height:44,display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},\"aria-label\":\"Previous slide\",children:/*#__PURE__*/_jsx(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M15 18L9 12L15 6\",stroke:arrowColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})})}),/*#__PURE__*/_jsx(\"button\",{onClick:handleNext,style:{position:\"absolute\",right:0,top:\"50%\",transform:\"translateY(-50%)\",background:arrowBackgroundColor,border:\"none\",cursor:\"pointer\",padding:10,zIndex:10,borderRadius:\"50%\",width:44,height:44,display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},\"aria-label\":\"Next slide\",children:/*#__PURE__*/_jsx(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M9 18L15 12L9 6\",stroke:arrowColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})})}),showDots&&/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",gap:8,padding:\"20px 0\",zIndex:10,position:\"absolute\",bottom:0},children:items.map((_,index)=>/*#__PURE__*/_jsx(\"button\",{onClick:()=>handleDotClick(index),style:{width:index===currentIndex?activeDotWidth:8,height:8,borderRadius:index===currentIndex?4:\"50%\",border:\"none\",cursor:\"pointer\",padding:0,backgroundColor:index===currentIndex?dotActiveColor:dotColor,transition:\"background-color 0.3s ease, width 0.3s ease, border-radius 0.3s ease\"},\"aria-label\":`Go to slide ${index+1}`},index))})]});}addPropertyControls(Carousel,{children:{type:ControlType.Array,control:{type:ControlType.ComponentInstance},maxCount:20},startIndex:{type:ControlType.Number,title:\"Start Index\",defaultValue:0,min:0,step:1,displayStepper:true},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:20,min:0,max:100,step:1,unit:\"px\"},scaleFactor:{type:ControlType.Number,title:\"Scale Factor\",defaultValue:.05,min:0,max:.2,step:.01},arrowColor:{type:ControlType.Color,title:\"Arrow Color\",defaultValue:\"#000000\"},arrowBackgroundColor:{type:ControlType.Color,title:\"Arrow Background\",defaultValue:\"transparent\"},showDots:{type:ControlType.Boolean,title:\"Show Dots\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},dotColor:{type:ControlType.Color,title:\"Dot Color\",defaultValue:\"#CCCCCC\",hidden:({showDots})=>!showDots},dotActiveColor:{type:ControlType.Color,title:\"Active Dot\",defaultValue:\"#000000\",hidden:({showDots})=>!showDots},activeDotWidth:{type:ControlType.Number,title:\"Active Dot Width\",defaultValue:62,min:8,max:200,step:1,unit:\"px\",hidden:({showDots})=>!showDots}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Carousel\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CarouselCustom.map"],"mappings":"gPAGG,SAAwB,EAAS,EAAM,CAAC,GAAK,CAAC,WAAS,EAAE,CAAC,aAAW,UAAU,uBAAqB,cAAc,WAAS,GAAK,WAAS,UAAU,iBAAe,UAAU,MAAI,GAAG,cAAY,IAAI,aAAW,EAAE,iBAAe,IAAI,EAAW,CAAC,EAAa,GAAiBA,EAAS,EAAW,CAAO,EAAaC,EAAO,KAAK,CA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