{"version":3,"file":"LightboxImage.CYIU4MP8.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/GxOSyOds9oyQtZfBMuZg/1EfWITZ7iTKorP7ToALS/LightboxImage.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{createPortal}from\"react-dom\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * Lightbox Image — shows an image contained inside its box and opens it\n * full screen on click, so detailed artwork (mantra texts, diagrams) can be read.\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function LightboxImage(props){const{image={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"\"},radius=12,shadow=true,hintText=\"Kl\\xf5psa suurendamiseks\",alt=\"\",style}=props;const isStatic=useIsStaticRenderer();const[isOpen,setIsOpen]=React.useState(false);const[isZoomed,setIsZoomed]=React.useState(false);const[isHovered,setIsHovered]=React.useState(false);const[isTouch,setIsTouch]=React.useState(false);const[isMounted,setIsMounted]=React.useState(false);React.useEffect(()=>{setIsMounted(true);if(typeof window===\"undefined\"||!window.matchMedia)return;const query=window.matchMedia(\"(hover: none)\");const update=()=>setIsTouch(query.matches);update();if(typeof query.addEventListener===\"function\"){query.addEventListener(\"change\",update);return()=>query.removeEventListener(\"change\",update);}return undefined;},[]);// Escape to close.\nReact.useEffect(()=>{if(!isOpen||typeof document===\"undefined\")return;const onKeyDown=event=>{if(event.key===\"Escape\"){event.stopPropagation();setIsOpen(false);}};document.addEventListener(\"keydown\",onKeyDown);return()=>document.removeEventListener(\"keydown\",onKeyDown);},[isOpen]);// Lock body scroll while the overlay is open.\nReact.useEffect(()=>{if(!isOpen||typeof document===\"undefined\")return;const body=document.body;const previousOverflow=body.style.overflow;body.style.overflow=\"hidden\";return()=>{body.style.overflow=previousOverflow;};},[isOpen]);React.useEffect(()=>{if(!isOpen)setIsZoomed(false);},[isOpen]);const source=image?.src;const description=alt||image?.alt||\"\";const showHint=typeof hintText===\"string\"&&hintText.length>0&&(isTouch||isHovered);const open=()=>{if(isStatic||!source)return;setIsOpen(true);};const rootStyle={...style,position:\"relative\",width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",overflow:\"visible\"};const triggerStyle={position:\"relative\",display:\"flex\",height:\"100%\",maxWidth:\"100%\",padding:0,margin:0,border:\"none\",background:\"transparent\",cursor:\"zoom-in\",appearance:\"none\",WebkitTapHighlightColor:\"transparent\"};const imageStyle={display:\"block\",height:\"100%\",width:\"auto\",maxWidth:\"100%\",objectFit:\"contain\",borderRadius:radius,boxShadow:shadow?\"0px 14px 40px 0px rgba(0,0,0,0.3)\":\"none\",pointerEvents:\"none\"};const hintStyle={position:\"absolute\",left:\"50%\",bottom:12,transform:\"translateX(-50%)\",padding:\"6px 12px\",borderRadius:999,background:\"rgba(12, 12, 12, 0.62)\",backdropFilter:\"blur(6px)\",WebkitBackdropFilter:\"blur(6px)\",color:\"rgba(255, 255, 255, 0.95)\",fontSize:12,lineHeight:\"16px\",letterSpacing:\"0.01em\",whiteSpace:\"nowrap\",pointerEvents:\"none\",opacity:showHint?1:0,transition:\"opacity 0.18s ease\",maxWidth:\"calc(100% - 24px)\",overflow:\"hidden\",textOverflow:\"ellipsis\"};const overlayStyle={position:\"fixed\",inset:0,zIndex:9999,background:\"rgba(0, 0, 0, 0.92)\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",overflow:isZoomed?\"auto\":\"hidden\",padding:0,margin:0,WebkitOverflowScrolling:\"touch\"};const overlayImageStyle=isZoomed?{display:\"block\",width:\"200vw\",maxWidth:\"none\",height:\"auto\",objectFit:\"contain\",cursor:\"zoom-out\",touchAction:\"manipulation\",margin:\"auto\"}:{display:\"block\",maxWidth:\"100vw\",maxHeight:\"100vh\",width:\"auto\",height:\"auto\",objectFit:\"contain\",cursor:\"zoom-in\",touchAction:\"manipulation\",margin:\"auto\"};const closeButtonStyle={position:\"fixed\",top:16,right:16,zIndex:1,width:44,height:44,borderRadius:999,border:\"none\",background:\"rgba(255, 255, 255, 0.12)\",color:\"#ffffff\",fontSize:22,lineHeight:\"22px\",cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",appearance:\"none\",WebkitTapHighlightColor:\"transparent\"};const overlay=isOpen&&isMounted&&typeof document!==\"undefined\"&&source?/*#__PURE__*/createPortal(/*#__PURE__*/_jsxs(\"div\",{role:\"dialog\",\"aria-modal\":\"true\",\"aria-label\":description||\"Pilt\",style:overlayStyle,onClick:()=>setIsOpen(false),children:[/*#__PURE__*/_jsx(\"button\",{type:\"button\",\"aria-label\":\"Sule\",style:closeButtonStyle,onClick:event=>{event.stopPropagation();setIsOpen(false);},children:/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",children:\"\\xd7\"})}),/*#__PURE__*/_jsx(\"img\",{src:source,srcSet:isZoomed?undefined:image?.srcSet,alt:description,style:overlayImageStyle,onClick:event=>{event.stopPropagation();setIsZoomed(previous=>!previous);}})]}),document.body):null;return /*#__PURE__*/_jsxs(\"div\",{style:rootStyle,children:[/*#__PURE__*/_jsxs(\"button\",{type:\"button\",style:triggerStyle,\"aria-label\":description?description+\" — \"+(hintText||\"suurenda\"):hintText||\"Suurenda pilti\",onClick:open,onMouseEnter:()=>setIsHovered(true),onMouseLeave:()=>setIsHovered(false),onFocus:()=>setIsHovered(true),onBlur:()=>setIsHovered(false),children:[/*#__PURE__*/_jsx(\"img\",{src:source,srcSet:image?.srcSet,alt:description,style:imageStyle}),hintText?/*#__PURE__*/_jsx(\"span\",{style:hintStyle,children:hintText}):null]}),overlay]});}addPropertyControls(LightboxImage,{image:{type:ControlType.ResponsiveImage,title:\"Image\"},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:12,min:0,max:80,step:1,unit:\"px\"},shadow:{type:ControlType.Boolean,title:\"Shadow\",defaultValue:true},hintText:{type:ControlType.String,title:\"Hint\",defaultValue:\"Kl\\xf5psa suurendamiseks\",placeholder:\"Kl\\xf5psa suurendamiseks\",optional:true},alt:{type:ControlType.String,title:\"Alt\",defaultValue:\"\",placeholder:\"Pildi kirjeldus\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LightboxImage\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LightboxImage.map"],"mappings":"4NAMG,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,QAAM,CAAC,IAAI,sEAAsE,IAAI,EAAE,EAAE,SAAO,GAAG,SAAO,GAAK,WAAS,wBAA2B,MAAI,GAAG,SAAO,EAAY,EAAS,EAAoB,EAAO,CAAC,EAAO,GAAWA,EAAe,EAAK,EAAO,CAAC,EAAS,GAAaA,EAAe,EAAK,EAAO,CAAC,EAAU,GAAcA,EAAe,EAAK,EAAO,CAAC,EAAQ,GAAYA,EAAe,EAAK,EAAO,CAAC,EAAU,GAAcA,EAAe,EAAK,EAAE,MAAoB,CAAoB,GAAnB,EAAa,EAAI,EAAY,IAAS,QAAa,CAAC,EAAO,WAAW,OAAO,IAAM,EAAM,EAAO,WAAW,eAAe,EAAQ,MAAW,EAAW,EAAM,OAAO,EAAW,GAAT,EAAO,EAAK,OAAO,EAAM,kBAAmB,WAAoD,OAAxC,EAAM,iBAAiB,SAAS,CAAM,MAAY,EAAM,oBAAoB,SAAS,CAAM,CAAoB,EAAE,CAAC,CAAC,EACj2B,MAAoB,CAAC,GAAG,CAAC,GAAQ,OAAO,SAAW,IAAY,OAAO,IAAM,EAAU,GAAO,CAAI,EAAM,MAAM,WAAU,EAAM,gBAAgB,EAAE,EAAU,EAAK,EAAG,EAAiD,OAA/C,SAAS,iBAAiB,UAAU,CAAS,MAAY,SAAS,oBAAoB,UAAU,C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