{"version":3,"file":"ArticlePhotoViewer.KQaCRE_b.mjs","names":["React.useRef","React.useCallback"],"sources":["https:/framerusercontent.com/modules/MtWb3NwnPtIrv4puazRF/AulYcU5s0BXKg8qWwjU1/ArticlePhotoViewer.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 * Photo enlargement behavior for existing canvas-native article photographs.\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function ArticlePhotoViewer({imageNames=\"Instant article photograph roaming|Instant article photograph printsPhoto\",style}){const dialog=React.useRef(null);const photo=React.useRef(null);const closeButton=React.useRef(null);const trigger=React.useRef(null);const restoreOverflow=React.useRef(null);const isStatic=useIsStaticRenderer();const cleanup=React.useCallback(()=>{restoreOverflow.current?.();restoreOverflow.current=null;trigger.current?.focus({preventScroll:true});trigger.current=null;},[]);const dismiss=React.useCallback(()=>{dialog.current?.close();// Restore before another opening can capture the locked scroll state.\ncleanup();},[cleanup]);React.useEffect(()=>{if(isStatic||typeof document===\"undefined\")return;const names=new Set(imageNames.split(\"|\").map(n=>n.trim()).filter(Boolean));function open(event){if(!(event.target instanceof Element))return;const button=event.target.closest(\"button[data-framer-name]\");if(!button||!names.has(button.dataset.framerName||\"\"))return;if(!button.closest('[data-framer-name=\"Resource Editorial Main\"]'))return;const source=button.querySelector(\"img\");const viewer=dialog.current;if(!source||!viewer||!photo.current||viewer.open)return;event.preventDefault();trigger.current=button;photo.current.src=source.src;photo.current.srcset=source.srcset;photo.current.sizes=\"(max-width: 1000px) 90vw, 960px\";photo.current.alt=source.alt;const previous=document.documentElement.style.overflow;document.documentElement.style.overflow=\"hidden\";restoreOverflow.current=()=>{document.documentElement.style.overflow=previous;};viewer.showModal();closeButton.current?.focus({preventScroll:true});}document.addEventListener(\"click\",open);return()=>{document.removeEventListener(\"click\",open);dialog.current?.close();cleanup();};},[imageNames,isStatic,cleanup]);return /*#__PURE__*/_jsxs(\"div\",{style:{...style,position:\"relative\",width:1,height:1},children:[/*#__PURE__*/_jsx(\"style\",{children:`\n            dialog.summit-article-photo-viewer { position:fixed; inset:0; width:100%; height:100%; height:100dvh; max-width:none; max-height:none; margin:0; padding:72px 20px 24px; border:0; background:transparent; box-sizing:border-box; overflow:hidden; color:white; }\n            dialog.summit-article-photo-viewer::backdrop { background:rgba(0,0,0,.92); }\n            .summit-article-photo-viewer .photo-stage { width:100%; height:100%; display:flex; align-items:center; justify-content:center; }\n            .summit-article-photo-viewer img { display:block; width:auto; height:auto; max-width:min(960px,100%); max-height:100%; object-fit:contain; }\n            .summit-article-photo-viewer button { position:absolute; top:16px; right:20px; min-height:44px; border:1px solid rgba(255,255,255,.8); padding:12px 20px; background:#19191a; color:white; font:400 14px/1.2 Syne,sans-serif; cursor:pointer; }\n            .summit-article-photo-viewer button:focus-visible { outline:2px solid white; outline-offset:4px; }\n            @media(max-height:450px){ dialog.summit-article-photo-viewer { padding:64px 20px 16px; } }\n        `}),!isStatic&&/*#__PURE__*/_jsxs(\"dialog\",{ref:dialog,className:\"summit-article-photo-viewer\",\"aria-label\":\"Enlarged photograph\",onClose:()=>{if(!dialog.current?.open)cleanup();},onCancel:e=>{e.preventDefault();dismiss();},onClick:e=>{if(e.target===e.currentTarget)dismiss();},children:[/*#__PURE__*/_jsx(\"button\",{ref:closeButton,type:\"button\",\"aria-label\":\"Close enlarged photograph\",onClick:dismiss,children:\"Close\"}),/*#__PURE__*/_jsx(\"div\",{className:\"photo-stage\",onClick:e=>{if(e.target===e.currentTarget)dismiss();},children:/*#__PURE__*/_jsx(\"img\",{ref:photo,alt:\"\",\"data-article-enlarged-photo\":true,draggable:false})})]})]});}addPropertyControls(ArticlePhotoViewer,{imageNames:{type:ControlType.String,title:\"Photo layers\",defaultValue:\"Instant article photograph roaming|Instant article photograph printsPhoto\",description:\"Exact canvas layer names, separated by |.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ArticlePhotoViewer\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ArticlePhotoViewer.map"],"mappings":"uMAIG,SAAwB,EAAmB,CAAC,aAAW,4EAA4E,SAAO,CAAC,IAAM,EAAOA,EAAa,IAAI,EAAQ,EAAMA,EAAa,IAAI,EAAQ,EAAYA,EAAa,IAAI,EAAQ,EAAQA,EAAa,IAAI,EAAQ,EAAgBA,EAAa,IAAI,EAAQ,EAAS,EAAoB,EAAQ,EAAQC,MAAsB,CAAC,EAAgB,UAAU,EAAE,EAAgB,QAAQ,KAAK,EAAQ,SAAS,MAAM,CAAC,cAAc,EAAI,CAAC,EAAE,EAAQ,QAAQ,IAAK,EAAE,CAAC,CAAC,EAAQ,EAAQA,MAAsB,CAAC,EAAO,SAAS,MAAM,EAClkB,EAAQ,CAAE,EAAE,CAAC,CAAO,CAAC,EAA0nC,OAAxnC,MAAoB,CAAC,GAAG,GAAU,OAAO,SAAW,IAAY,OAAO,IAAM,EAAM,IAAI,IAAI,EAAW,MAAM,GAAG,CAAC,CAAC,IAAI,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,OAAO,CAAC,EAAE,SAAS,EAAK,EAAM,CAAC,GAAG,EAAE,EAAM,kBAAkB,SAAS,OAAO,IAAM,EAAO,EAAM,OAAO,QAAQ,0BAA0B,EAA+D,GAA1D,CAAC,GAAQ,CAAC,EAAM,IAAI,EAAO,QAAQ,YAAY,EAAE,GAAY,CAAC,EAAO,QAAQ,8CAA8C,EAAE,OAAO,IAAM,EAAO,EAAO,cAAc,KAAK,EAAQ,EAAO,EAAO,QAAQ,GAAG,CAAC,GAAQ,CAAC,GAAQ,CAAC,EAAM,SAAS,EAAO,KAAK,OAAO,EAAM,eAAe,EAAE,EAAQ,QAAQ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