{"version":3,"file":"Lightbox.DUl2TOpu.mjs","names":["useRef","useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/1MhU0TxQwpKNko8ma5Oo/gCj3jEOX8AhrCb1tVksQ/Lightbox.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useRef,useEffect,useState}from\"react\";export function withLightboxEffect(Component){return props=>{const ref=useRef(null);const[lightboxSrc,setLightboxSrc]=useState(null);useEffect(()=>{if(ref.current){const images=ref.current.querySelectorAll(\".framer-image\");images.forEach(img=>{const htmlImg=img;htmlImg.style.cursor=\"pointer\";htmlImg.addEventListener(\"click\",()=>{setLightboxSrc(htmlImg.src);});console.log(img.src);});}},[]);const closeLightbox=()=>{setLightboxSrc(null);};function forceDownload(url){const filename=`${document.title||\"image\"}.png`;fetch(url).then(response=>response.blob()).then(blob=>{const blobUrl=URL.createObjectURL(blob);const link=document.createElement(\"a\");link.href=blobUrl;link.download=filename;document.body.appendChild(link);link.click();link.remove();URL.revokeObjectURL(blobUrl);}).catch(err=>{console.error(\"Download failed:\",err);});}return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"div\",{ref:ref,children:/*#__PURE__*/_jsx(Component,{...props})}),lightboxSrc&&/*#__PURE__*/_jsxs(\"div\",{style:{position:\"fixed\",top:0,left:0,width:\"100vw\",height:\"100vh\",backgroundColor:\"rgba(0, 0, 0, 0.8)\",display:\"flex\",flexDirection:\"column\",justifyContent:\"center\",alignItems:\"center\",zIndex:9999,gap:\"16px\"},onClick:closeLightbox,children:[/*#__PURE__*/_jsx(\"img\",{src:lightboxSrc,style:{maxWidth:\"80%\",maxHeight:\"80%\",objectFit:\"contain\",backgroundColor:\"white\",padding:\"8px\"},onClick:e=>e.stopPropagation()}),/*#__PURE__*/_jsx(\"div\",{onClick:e=>e.stopPropagation(),children:/*#__PURE__*/_jsx(\"button\",{onClick:e=>{e.stopPropagation();forceDownload(lightboxSrc);},style:{cursor:\"pointer\",padding:\"10px 24px\",backgroundColor:\"#fff\",borderRadius:\"48px\",textDecoration:\"none\",fontWeight:\"bold\",color:\"#08292F\",fontFamily:\"Inter\",border:\"none\"},children:\"Download image\"})})]})]});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withLightboxEffect\":{\"type\":\"reactHoc\",\"name\":\"withLightboxEffect\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Lightbox.map"],"mappings":"yIAA4H,SAAgB,EAAmB,EAAU,CAAC,MAAO,IAAO,CAAC,IAAM,EAAIA,EAAO,KAAK,CAAM,CAAC,EAAY,GAAgBC,EAAS,KAAK,CAAC,MAAc,CAAI,EAAI,SAAsB,EAAI,QAAQ,iBAAiB,gBAAgB,CAAQ,QAAQ,GAAK,CAAC,IAAM,EAAQ,EAAI,EAAQ,MAAM,OAAO,UAAU,EAAQ,iBAAiB,YAAY,CAAC,EAAe,EAAQ,IAAI,EAAG,CAAC,QAAQ,IAAI,EAAI,IAAI,EAAG,EAAI,EAAE,CAAC,CAAC,IAAM,MAAkB,CAAC,EAAe,KAAK,EAAG,SAAS,EAAc,EAAI,CAAC,IAAM,EAAS,GAAG,SAAS,OAAO,QAAQ,MAAM,MAAM,EAAI,CAAC,KAAK,GAAU,EAAS,MAAM,CAAC,CAAC,KAAK,GAAM,CAAC,IAAM,EAAQ,IAAI,gBAAgB,EAAK,CAAO,EAAK,SAAS,cAAc,IAAI,CAAC,EAAK,KAAK,EAAQ,EAAK,SAAS,EAAS,SAAS,KAAK,YAAY,EAAK,CAAC,EAAK,OAAO,CAAC,EAAK,QAAQ,CAAC,IAAI,gBAAgB,EAAQ,EAAG,CAAC,MAAM,GAAK,CAAC,QAAQ,MAAM,mBAAmB,EAAI,EAAG,CAAE,OAAoB,EAAMC,EAAU,CAAC,SAAS,CAAc,EAAK,MAAM,CAAK,MAAI,SAAsB,EAAK,EAAU,CAAC,GAAG,EAAM,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