{"version":3,"file":"Recursive_Slider.BfMC6Orb.mjs","names":["useRef","useState","useMemo"],"sources":["https:/framerusercontent.com/modules/UKED3NckmBxcM3nnEEHy/an9989YzVWgQkuHRBqvc/Recursive_Slider.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useRef,useEffect,useMemo}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";/**\n * RECURSIVE MULTI-MODE CAROUSEL\n * * Mode: Edge-to-Edge\n * - 100% width, starts at Slide 1 (Middle Set).\n * * Mode: Gapped (Precision Logic)\n * - Height-driven width via Aspect Ratio.\n * - Starts at Slide 2 (Middle Set) centered.\n * - Includes Side Padding and Gaps.\n */export default function RecursiveMultiMode(props){const{slides=[],layoutMode,aspectRatio,desktopMaxWidth,mobileMaxWidth,gap,trackPadding,arrowPadding,arrowSize,arrowBg,arrowHoverBg,arrowColor}=props;const scrollRef=useRef(null);const[selectedImg,setSelectedImg]=useState(null);// 1. Filter and Triple slides for Recursive Loop\nconst validSlides=useMemo(()=>slides.filter(slide=>slide!==null),[slides]);const displaySlides=useMemo(()=>{if(validSlides.length===0)return[];return[...validSlides,...validSlides,...validSlides];},[validSlides]);const isEdge=layoutMode===\"edge\";// 2. Initial Scroll Positioning\nuseEffect(()=>{if(scrollRef.current&&validSlides.length>0){const container=scrollRef.current;// Small timeout to ensure Framer layout engine has finished\nconst timer=setTimeout(()=>{const items=container.querySelectorAll(\".carousel-item\");// Edge: Start at Slide 1 of middle set | Gapped: Start at Slide 2 of middle set\nconst startIndex=isEdge?validSlides.length:validSlides.length+1;const target=items[startIndex];if(target){const offset=target.offsetLeft-container.offsetWidth/2+target.offsetWidth/2;container.scrollLeft=offset;}},100);return()=>clearTimeout(timer);}},[layoutMode,validSlides.length,aspectRatio,props.height]);const scroll=dir=>{if(scrollRef.current){const container=scrollRef.current;// Scroll by roughly one slide width\nconst moveAmount=isEdge?container.offsetWidth:container.offsetWidth*.8;container.scrollBy({left:dir===\"left\"?-moveAmount:moveAmount,behavior:\"smooth\"});}};return /*#__PURE__*/_jsxs(\"div\",{style:containerStyle,children:[/*#__PURE__*/_jsxs(\"div\",{style:{...navOverlayStyle,padding:`0 ${arrowPadding}px`},children:[/*#__PURE__*/_jsx(DiamondArrow,{direction:\"left\",onClick:()=>scroll(\"left\"),...props}),/*#__PURE__*/_jsx(DiamondArrow,{direction:\"right\",onClick:()=>scroll(\"right\"),...props})]}),/*#__PURE__*/_jsx(\"div\",{style:{...trackStyle,gap:isEdge?0:gap,paddingLeft:isEdge?0:trackPadding,paddingRight:isEdge?0:trackPadding},ref:scrollRef,className:\"framer-hide-scrollbar\",children:displaySlides.length>0?displaySlides.map((content,i)=>/*#__PURE__*/_jsx(motion.div,{className:\"carousel-item\",style:{...itemStyle,height:\"100%\",// Use 100% for edge, or the height-driven aspect ratio for gapped\n    width:isEdge?\"100%\":\"auto\",minWidth:isEdge?\"100%\":\"auto\",aspectRatio:isEdge?\"unset\":`${aspectRatio} / 1`,maxWidth:isEdge?\"100%\":`var(--max-w-perc)`},onClick:()=>setSelectedImg(content),children:/*#__PURE__*/_jsx(\"div\",{className:\"content-container\",children:content})},i)):/*#__PURE__*/_jsx(\"div\",{style:emptyStateStyle,children:\"Connect Frames in Sidebar\"})}),/*#__PURE__*/_jsx(AnimatePresence,{children:selectedImg&&/*#__PURE__*/_jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},style:lightboxBackdrop,onClick:()=>setSelectedImg(null),children:/*#__PURE__*/_jsx(motion.div,{initial:{scale:.9},animate:{scale:1},style:{width:\"90vw\",height:\"80vh\",display:\"flex\"},children:/*#__PURE__*/_jsx(\"div\",{className:\"content-container\",children:selectedImg})})})}),/*#__PURE__*/_jsx(\"style\",{children:`\n                :root { --max-w-perc: ${desktopMaxWidth}vw; }\n                @media (max-width: 810px) { :root { --max-w-perc: ${mobileMaxWidth}vw; } }\n\n                .framer-hide-scrollbar::-webkit-scrollbar { display: none; }\n                .framer-hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }\n                \n                .carousel-item { \n                    flex-shrink: 0; \n                    scroll-snap-align: center; \n                    cursor: zoom-in; \n                    position: relative;\n                }\n\n                .content-container { \n                    width: 100%; \n                    height: 100%; \n                    display: flex; \n                    overflow: hidden; \n                    pointer-events: none; \n                }\n\n                /* FORCE VISIBILITY: Ensures the component dropped in expands to fill the 16:10 box */\n                .content-container > * { \n                    width: 100% !important; \n                    height: 100% !important; \n                    border-radius: 0px !important;\n                    flex-shrink: 0 !important;\n                }\n\n                .content-container img { \n                    width: 100%; \n                    height: 100%; \n                    object-fit: cover; \n                }\n            `})]});}function DiamondArrow({direction,onClick,arrowSize,arrowBg,arrowHoverBg,arrowColor}){return /*#__PURE__*/_jsxs(motion.button,{onClick:e=>{e.stopPropagation();onClick();},initial:\"rest\",whileHover:\"hover\",whileTap:{scale:.9},style:{width:arrowSize,height:arrowSize,backgroundColor:\"transparent\",border:\"none\",cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",position:\"relative\",pointerEvents:\"auto\",padding:0},children:[/*#__PURE__*/_jsx(motion.div,{variants:{rest:{rotate:45,backgroundColor:arrowBg},hover:{rotate:0,backgroundColor:arrowHoverBg}},transition:{type:\"spring\",stiffness:400,damping:25},style:{position:\"absolute\",inset:0,zIndex:1}}),/*#__PURE__*/_jsx(\"span\",{style:{zIndex:2,color:arrowColor,fontSize:arrowSize*.4},children:direction===\"left\"?\"←\":\"→\"})]});}const containerStyle={width:\"100%\",height:\"100%\",position:\"relative\",overflow:\"hidden\"};const navOverlayStyle={position:\"absolute\",top:0,left:0,right:0,bottom:0,display:\"flex\",justifyContent:\"space-between\",alignItems:\"center\",zIndex:5,pointerEvents:\"none\"};const trackStyle={display:\"flex\",overflowX:\"auto\",scrollSnapType:\"x mandatory\",height:\"100%\"};const emptyStateStyle={width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",background:\"#f0f0f0\",color:\"#999\"};const itemStyle={position:\"relative\"};const lightboxBackdrop={position:\"fixed\",top:0,left:0,width:\"100vw\",height:\"100vh\",backgroundColor:\"rgba(0,0,0,0.95)\",zIndex:9999,display:\"flex\",justifyContent:\"center\",alignItems:\"center\",cursor:\"zoom-out\"};addPropertyControls(RecursiveMultiMode,{layoutMode:{type:ControlType.Enum,options:[\"edge\",\"gapped\"],optionTitles:[\"Edge-to-Edge\",\"Gapped\"],defaultValue:\"edge\"},slides:{type:ControlType.Array,control:{type:ControlType.ComponentInstance},title:\"Slides\"},aspectRatio:{type:ControlType.Number,defaultValue:1.6,title:\"Aspect Ratio\",hidden:props=>props.layoutMode===\"edge\"},trackPadding:{type:ControlType.Number,defaultValue:40,title:\"Side Padding\",hidden:props=>props.layoutMode===\"edge\"},gap:{type:ControlType.Number,defaultValue:20,title:\"Slide Gap\",hidden:props=>props.layoutMode===\"edge\"},desktopMaxWidth:{type:ControlType.Number,defaultValue:70,title:\"D-Max Width %\",hidden:props=>props.layoutMode===\"edge\"},mobileMaxWidth:{type:ControlType.Number,defaultValue:60,title:\"M-Max Width %\",hidden:props=>props.layoutMode===\"edge\"},arrowPadding:{type:ControlType.Number,defaultValue:20,title:\"Arrow Edge Dist.\"},arrowSize:{type:ControlType.Number,defaultValue:44},arrowBg:{type:ControlType.Color,defaultValue:\"#ffffff\"},arrowHoverBg:{type:ControlType.Color,defaultValue:\"#f3f3f3\"},arrowColor:{type:ControlType.Color,defaultValue:\"#000000\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RecursiveMultiMode\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Recursive_Slider.map"],"mappings":"8PAQG,SAAwB,EAAmB,EAAM,CAAC,GAAK,CAAC,SAAO,CAAC,EAAE,aAAW,cAAY,kBAAgB,iBAAe,MAAI,eAAa,eAA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