{"version":3,"file":"EditorialImage.CWjdPwGF.mjs","names":["React.useRef","React.useState"],"sources":["https:/framerusercontent.com/modules/nu9zAVFpjDr3N9Bym5dR/Ph6bz0IjkulK3ykPDVNv/EditorialImage.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function EditorialImage(props){const{image,altText=\"\",decorative=false,parallax=200,noizeVisible=true,noizeOpacity=.5,style}=props;const ref=React.useRef(null);const[offset,setOffset]=React.useState(0);const isStatic=useIsStaticRenderer();React.useEffect(()=>{if(isStatic||typeof window===\"undefined\")return;const update=()=>{if(!ref.current)return;const rect=ref.current.getBoundingClientRect(),vh=window.innerHeight;const progress=Math.max(0,Math.min(1,(vh-rect.top)/(vh+rect.height)));setOffset(parallax-progress*parallax);};window.addEventListener(\"scroll\",update,{passive:true});window.addEventListener(\"resize\",update);update();return()=>{window.removeEventListener(\"scroll\",update);window.removeEventListener(\"resize\",update);};},[parallax,isStatic]);const moving={height:isStatic?\"100%\":`calc(100% + ${parallax}px)`,transform:isStatic?\"translateY(0px)\":`translateY(${-offset}px)`};return /*#__PURE__*/_jsxs(\"div\",{ref:ref,style:{overflow:\"hidden\",position:\"relative\",backgroundColor:\"#ffffff\",width:\"100%\",height:\"100%\",...style},children:[image?.src&&/*#__PURE__*/_jsx(\"img\",{src:image.src,srcSet:image.srcSet,sizes:\"100vw\",alt:decorative?\"\":altText||image.alt||\"\",style:{width:\"100%\",...moving,objectFit:\"cover\",display:\"block\"}}),noizeVisible&&/*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":\"true\",style:{position:\"absolute\",top:0,left:0,width:\"100%\",...moving,backgroundImage:\"url(https://framerusercontent.com/images/hfyi67pKwBIagdce3cECqq02Do.png)\",backgroundRepeat:\"repeat\",backgroundSize:\"100px 100px\",opacity:noizeOpacity,pointerEvents:\"none\",zIndex:1,mixBlendMode:\"overlay\"}})]});}addPropertyControls(EditorialImage,{image:{type:ControlType.ResponsiveImage},altText:{type:ControlType.String,defaultValue:\"\"},decorative:{type:ControlType.Boolean,defaultValue:false},parallax:{type:ControlType.Number,defaultValue:200,min:0,max:500,step:10},noizeVisible:{type:ControlType.Boolean,defaultValue:true},noizeOpacity:{type:ControlType.Number,defaultValue:.5,min:0,max:1,step:.1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"EditorialImage\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./EditorialImage.map"],"mappings":"qNAGG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,QAAM,UAAQ,GAAG,aAAW,GAAM,WAAS,IAAI,eAAa,GAAK,eAAa,GAAG,SAAO,EAAY,EAAIA,EAAa,IAAI,EAAO,CAAC,EAAO,GAAWC,EAAe,CAAC,EAAQ,EAAS,EAAoB,EAAE,MAAoB,CAAC,GAAG,GAAiB,IAAS,OAAY,OAAO,IAAM,MAAW,CAAC,GAAG,CAAC,EAAI,QAAQ,OAAO,IAAM,EAAK,EAAI,QAAQ,sBAAsB,EAAE,EAAG,EAAO,YAAkB,EAAS,KAAK,IAAI,EAAE,KAAK,IAAI,GAAG,EAAG,EAAK,MAAM,EAAG,EAAK,OAAO,CAAC,EAAE,EAAU,EAAS,EAAS,CAAQ,CAAE,EAA4G,OAA1G,EAAO,iBAAiB,SAAS,EAAO,CAAC,QAAQ,EAAI,CAAC,EAAE,EAAO,iBAAiB,SAAS,CAAM,EAAE,EAAO,MAAY,CAAC,EAAO,oBAAoB,SAAS,CAAM,EAAE,EAAO,oBAAoB,SAAS,CAAM,CAAE,CAAE,EAAE,CAAC,EAAS,CAAQ,CAAC,EAAE,IA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