{"version":3,"file":"Lightbox.8hJTd4Z6.mjs","names":["useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/6jc33DiE1MnansSRbpgY/UPgxexhPv3AxtHjmQwFc/Lightbox.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{motion,AnimatePresence}from\"framer-motion\";// Store for managing the gallery\nconst galleryStore={images:[],currentIndex:0,registerImage(image){if(!this.images.includes(image)){this.images.push(image);}},getCurrentImage(){return this.images[this.currentIndex];},goNext(){this.currentIndex=(this.currentIndex+1)%this.images.length;},goPrevious(){this.currentIndex=(this.currentIndex-1+this.images.length)%this.images.length;}};// Single image lightbox (previously `withLightbox`)\nexport function withSingle(Component){return props=>{var _props_background;const[isOpen,setIsOpen]=useState(false);const openLightbox=()=>setIsOpen(true);const closeLightbox=()=>setIsOpen(false);useEffect(()=>{if(isOpen){// Disable scrolling on all devices\ndocument.body.style.overflow=\"hidden\";document.documentElement.style.overflow=\"hidden\";}else{// Restore scrolling on all devices\ndocument.body.style.overflow=\"unset\";document.documentElement.style.overflow=\"unset\";}return()=>{// Clean up after the component unmounts\ndocument.body.style.overflow=\"unset\";document.documentElement.style.overflow=\"unset\";};},[isOpen]);const handleBackgroundClick=event=>{if(event.target.id===\"lightbox-background\"){closeLightbox();}};return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Component,{...props,onClick:openLightbox,style:{...props.style,position:\"relative\",cursor:\"pointer\"},children:/*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",backgroundColor:\"white\",opacity:0},whileHover:{opacity:.75,transition:{duration:.2}}})}),/*#__PURE__*/_jsx(AnimatePresence,{children:isOpen&&/*#__PURE__*/_jsxs(motion.div,{id:\"lightbox-background\",onClick:handleBackgroundClick,style:{position:\"fixed\",top:0,left:0,width:\"100vw\",height:\"100vh\",background:\"rgba(0, 0, 0, 0.8)\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",zIndex:1e3},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:[/*#__PURE__*/_jsx(motion.img,{src:((_props_background=props.background)===null||_props_background===void 0?void 0:_props_background.src)||\"\",style:{maxWidth:\"90vw\",maxHeight:\"90vh\",objectFit:\"contain\"},initial:{scale:.8},animate:{scale:1},exit:{scale:.8}}),/*#__PURE__*/_jsx(motion.div,{onClick:closeLightbox,style:{position:\"absolute\",top:\"20px\",right:\"20px\",width:\"30px\",height:\"30px\",cursor:\"pointer\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",background:\"white\",borderRadius:\"50%\",zIndex:1001},whileHover:{scale:1.1},children:\"✕\"})]})})]});};}// Gallery override for multiple images\nexport function withGallery(Component){return props=>{var _props_background;const[isOpen,setIsOpen]=useState(false);const[currentImage,setCurrentImage]=useState(null);const[startTouchX,setStartTouchX]=useState(0);const src=(_props_background=props.background)===null||_props_background===void 0?void 0:_props_background.src;if(src&&!galleryStore.images.includes(src)){galleryStore.registerImage(src);}const openGallery=()=>{setIsOpen(true);setCurrentImage(src);galleryStore.currentIndex=galleryStore.images.indexOf(src);};const closeGallery=()=>setIsOpen(false);const showNextImage=()=>{galleryStore.goNext();setCurrentImage(galleryStore.getCurrentImage());};const showPreviousImage=()=>{galleryStore.goPrevious();setCurrentImage(galleryStore.getCurrentImage());};const handleKeyDown=event=>{if(isOpen){if(event.key===\"ArrowRight\")showNextImage();else if(event.key===\"ArrowLeft\")showPreviousImage();else if(event.key===\"Escape\")closeGallery();}};const handleTouchStart=event=>{setStartTouchX(event.touches[0].clientX);};const handleTouchEnd=event=>{const endTouchX=event.changedTouches[0].clientX;const touchDistance=startTouchX-endTouchX;if(touchDistance>50)showNextImage()// Swipe left\n;else if(touchDistance<-50)showPreviousImage()// Swipe right\n;};useEffect(()=>{if(isOpen){document.body.style.overflow=\"hidden\";document.documentElement.style.overflow=\"hidden\";window.addEventListener(\"keydown\",handleKeyDown);}else{document.body.style.overflow=\"unset\";document.documentElement.style.overflow=\"unset\";}return()=>{window.removeEventListener(\"keydown\",handleKeyDown);document.body.style.overflow=\"unset\";document.documentElement.style.overflow=\"unset\";};},[isOpen]);return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Component,{...props,onClick:openGallery,style:{...props.style,position:\"relative\",cursor:\"pointer\"},children:/*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",backgroundColor:\"white\",opacity:0},whileHover:{opacity:.75,transition:{duration:.2}}})}),/*#__PURE__*/_jsx(AnimatePresence,{children:isOpen&&currentImage&&/*#__PURE__*/_jsxs(motion.div,{id:\"lightbox-background\",onClick:event=>event.target.id===\"lightbox-background\"&&closeGallery(),style:{position:\"fixed\",top:0,left:0,width:\"100vw\",height:\"100vh\",background:\"rgba(0, 0, 0, 0.8)\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",zIndex:1e3},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onTouchStart:handleTouchStart,onTouchEnd:handleTouchEnd,children:[/*#__PURE__*/_jsx(motion.img,{src:currentImage,style:{maxWidth:\"calc(90vw - 100px)\",maxHeight:\"90vh\",objectFit:\"contain\"},initial:{scale:.8},animate:{scale:1},exit:{scale:.8},className:\"lightbox-image\"}),/*#__PURE__*/_jsx(\"div\",{onClick:showPreviousImage,className:\"arrow-left\",style:{position:\"absolute\",top:\"50%\",left:\"30px\",transform:\"translateY(-50%)\",width:\"40px\",height:\"40px\",background:\"white\",borderRadius:\"50%\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",cursor:\"pointer\",zIndex:1001},children:/*#__PURE__*/_jsx(\"svg\",{width:\"20\",height:\"20\",viewBox:\"0 0 24 24\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M15 6L9 12L15 18\",stroke:\"black\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})})}),/*#__PURE__*/_jsx(\"div\",{onClick:showNextImage,className:\"arrow-right\",style:{position:\"absolute\",top:\"50%\",right:\"30px\",transform:\"translateY(-50%)\",width:\"40px\",height:\"40px\",background:\"white\",borderRadius:\"50%\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",cursor:\"pointer\",zIndex:1001},children:/*#__PURE__*/_jsx(\"svg\",{width:\"20\",height:\"20\",viewBox:\"0 0 24 24\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M9 6L15 12L9 18\",stroke:\"black\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})})}),/*#__PURE__*/_jsx(motion.div,{onClick:closeGallery,style:{position:\"absolute\",top:\"20px\",right:\"20px\",width:\"30px\",height:\"30px\",cursor:\"pointer\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",background:\"white\",borderRadius:\"50%\",zIndex:1001},whileHover:{scale:1.1},children:\"✕\"})]})}),/*#__PURE__*/_jsx(\"style\",{jsx:true,children:`\n                    @media (max-width: 768px) {\n                        .lightbox-image {\n                            max-width: 95vw !important; \n                            max-height: 95vh !important;\n                        }\n\n                        .arrow-left,\n                        .arrow-right {\n                            display: none; // Hide arrows on mobile\n                        }\n                    }\n                `})]});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withSingle\":{\"type\":\"reactHoc\",\"name\":\"withSingle\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withGallery\":{\"type\":\"reactHoc\",\"name\":\"withGallery\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Lightbox.map"],"mappings":"6MAMA,SAAgB,EAAY,EAAU,CAAC,MAAO,IAAO,CAAuB,GAAK,CAAC,EAAO,GAAWA,EAAS,EAAK,EAAO,CAAC,EAAa,GAAiBA,EAAS,IAAI,EAAO,CAAC,EAAY,GAAgBA,EAAS,CA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