{"version":3,"file":"FullWidthArticleImageOverride.BME9LUza.mjs","names":["useRef","useCallback"],"sources":["https:/framerusercontent.com/modules/N5c7eh4gnzfYmJxwJFYG/npggWcBIsqddRjTgX4V9/FullWidthArticleImageOverride.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useCallback,useEffect,useRef}from\"react\";function setForwardedRef(ref,value){if(typeof ref===\"function\"){ref(value);}else if(ref){ref.current=value;}}export function withFullWidthArticleImages(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const hostRef=useRef(null);const setRefs=useCallback(node=>{hostRef.current=node;setForwardedRef(ref,node);},[ref]);const applyScopedImageSizing=useCallback(()=>{const host=hostRef.current;if(!host)return;const images=host.querySelectorAll(\"img\");images.forEach(image=>{image.style.width=\"100%\";image.style.maxWidth=\"100%\";image.style.height=\"auto\";image.style.display=\"block\";const parent=image.parentElement;if(!parent)return;const parentTag=parent.tagName.toLowerCase();if(parentTag===\"figure\"||parentTag===\"picture\"){parent.style.width=\"100%\";parent.style.maxWidth=\"100%\";parent.style.display=\"block\";}const grandParent=parent.parentElement;if(parentTag===\"picture\"&&grandParent&&grandParent.tagName.toLowerCase()===\"figure\"){grandParent.style.width=\"100%\";grandParent.style.maxWidth=\"100%\";grandParent.style.display=\"block\";}});},[]);useEffect(()=>{if(typeof window===\"undefined\")return;const host=hostRef.current;if(!host)return;applyScopedImageSizing();const observer=new MutationObserver(()=>{applyScopedImageSizing();});observer.observe(host,{childList:true,subtree:true});return()=>{observer.disconnect();};},[applyScopedImageSizing]);return /*#__PURE__*/_jsx(Component,{ref:setRefs,...props});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withFullWidthArticleImages\":{\"type\":\"reactHoc\",\"name\":\"withFullWidthArticleImages\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FullWidthArticleImageOverride.map"],"mappings":"qJAAsG,SAAS,EAAgB,EAAI,EAAM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