{"version":3,"file":"HeroImage.B_rhWJc5.mjs","names":["useState","useRef","useEffect","useLayoutEffect"],"sources":["https:/framerusercontent.com/modules/hslYaB4GysCsKkJVPjf0/io7MSlTfOIVZxIKS35kJ/HeroImage.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useLayoutEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const POOL=[{src:\"https://framerusercontent.com/images/zGr08EMMlbxS1eFFd603pN0nDCo.jpg\",alt:\"Black and white photo of a smiling person with curly hair holding a phone in a kitchen, with the informed.now logo and the words news without noise\"},{src:\"https://framerusercontent.com/images/wzNtN0Se2hDbbVMEP99QqdGzBCw.jpg\",alt:\"Black and white photo of a smiling person with long dark hair holding a phone, with the informed.now logo and the words news without noise\"},{src:\"https://framerusercontent.com/images/jBgtFZkCvfgIVzVPZaHmx32iM.jpg\",alt:\"Black and white photo of a laughing person with short hair and glasses in a white shirt holding a phone, with the informed.now logo and the words news without noise\"},{src:\"https://framerusercontent.com/images/j619gDQGOWYdcC3FyWFYbzY.jpg\",alt:\"Black and white photo of a smiling person with short curly hair and round glasses holding a phone, with the informed.now logo and the words news without noise\"},{src:\"https://framerusercontent.com/images/NRi6f7BcxbCM9xIIXjpDo6DBbo.jpg\",alt:\"Black and white photo of a laughing person in a white T-shirt looking down at a phone, with the informed.now logo and the words news without noise\"},{src:\"https://framerusercontent.com/images/FeZy8SWVharbLMV0wsKDNCS4.jpg\",alt:\"Black and white photo of a smiling person in a beanie and jacket holding a travel mug and looking at a phone, with the informed.now logo and the words news without noise\"},{src:\"https://framerusercontent.com/images/i8CgOxsUqFDGRCeQqpg7aRo.jpg\",alt:\"Black and white photo of a smiling person with long dark hair and glasses sitting on a couch and holding a phone, with the informed.now logo and the words news without noise\"},{src:\"https://framerusercontent.com/images/myT5JF4U5ouh3afUHue0zei5hz4.jpg\",alt:\"Black and white photo of a smiling person in a cap, sunglasses, and a plaid shirt holding a phone outdoors, with the informed.now logo and the words news without noise\"},{src:\"https://framerusercontent.com/images/aDeU2hWCWRtvI0tClnSMfkMWUjE.jpg\",alt:\"Black and white photo of a smiling person with curly hair resting on a pillow and looking at a phone, with the informed.now logo and the words news without noise\"},{src:\"https://framerusercontent.com/images/mvlYZyW3ussqG2Pmisd6Jx9OeDM.jpg\",alt:\"Black and white photo of a person in a coat reading a phone on a crowded subway car, with the informed.now logo and the words news without noise\"},{src:\"https://framerusercontent.com/images/bjJyjOBgcEF8DX8neOX9cCSIBkA.jpg\",alt:\"Black and white photo of two people sitting close together on a couch looking at a phone, with the informed.now logo and the words news without noise\"},{src:\"https://framerusercontent.com/images/mOIFlddh2P1uQ53nhu9Va4VhIA.jpg\",alt:\"Black and white photo of a smiling person with curly hair in a T-shirt holding a phone with both hands, with the informed.now logo and the words news without noise\"},{src:\"https://framerusercontent.com/images/hll5MVOiuEsPzz6ki40DQfcl8.jpg\",alt:\"Black and white photo of Kira Shishkin, founder of informed.now, smiling in a dark blazer and a chain necklace, with the informed.now logo and the words news without noise\"},{src:\"https://framerusercontent.com/images/cqU5NoZI3t3FbEJHIxFMgxhhKGE.jpg\",alt:\"Black and white photo of Kira Shishkin, founder of informed.now, in a dark blazer and a chain necklace beside a sunlit window, with the informed.now logo and the words news without noise\"}];// Copy widths in image pixels. The picture is 560 wide on desktop and tablet,\n// so 560, 700, 840, 980, 1120 and 1680 are exact fits for 1x, 1.25x, 1.5x,\n// 1.75x, 2x and 3x screens; the steps between cover phones, where the picture\n// is the screen width minus the page margins; the last two cover zoomed-in\n// sharp screens.\nconst WIDTHS=[400,480,520,560,600,640,680,700,720,760,800,840,880,920,960,980,1e3,1040,1080,1120,1200,1280,1400,1680,1960,2240];const NOSCRIPT_WIDTH=1120;const KEY=\"__informedHero\";const copyUrl=(src,width)=>`${src}?scale-down-to=${width}`;// The image CDN only sends AVIF at any width when asked by name, and then it\n// sends it to every browser, so this URL sits behind <source type=\"image/avif\">.\nconst avifUrl=(src,width)=>`${copyUrl(src,width)}&format=avif`;const toJson=v=>JSON.stringify(v).replace(/</g,\"\\\\u003c\");// Runs as the page HTML is parsed, before the image is requested, so picking\n// the photo and its copy costs no extra download and no layout shift. One\n// photo per page load, shared by every copy of the component on that page.\n// Copies hidden by another breakpoint are skipped, so only the visible one\n// downloads. Keep in step with fit() below.\nconst inlineFit=photos=>`(function(){try{var I=${toJson(photos)},W=${toJson(WIDTHS)},w=window,i=0;if(I.length>1){var p=location.pathname,h=w.${KEY};if(!h||h.path!==p){h=w.${KEY}={path:p,i:Math.floor(Math.random()*I.length)}}i=h.i}var s=document.currentScript,b=s&&s.parentNode;if(!b)return;var r=b.getBoundingClientRect().width;if(!r)return;var n=Math.ceil(r*(w.devicePixelRatio||1)-.01),c=W[W.length-1];for(var k=0;k<W.length;k++){if(W[k]>=n){c=W[k];break}}var m=b.querySelector(\"img\"),a=b.querySelector(\"source\");if(!m||!a)return;var u=I[i].src+\"?scale-down-to=\"+c;a.setAttribute(\"srcset\",u+\"&format=avif\");m.setAttribute(\"alt\",I[i].alt);m.setAttribute(\"src\",u)}catch(e){}})()`;// Visitors and crawlers without JavaScript get one mid-size copy.\nconst useBeforePaint=typeof window===\"undefined\"?useEffect:useLayoutEffect;const escapeAttr=v=>v.replace(/&/g,\"&amp;\").replace(/\"/g,\"&quot;\").replace(/</g,\"&lt;\");const noscriptImg=photo=>`<img src=\"${escapeAttr(copyUrl(photo.src,NOSCRIPT_WIDTH))}\" alt=\"${escapeAttr(photo.alt)}\" style=\"position:absolute;inset:0;width:100%;height:100%;object-fit:cover\">`;function pickIndex(){if(POOL.length<2)return 0;if(typeof window===\"undefined\")return-1;const w=window;const path=window.location.pathname;let h=w[KEY];if(!h||h.path!==path){h=w[KEY]={path,i:Math.floor(Math.random()*POOL.length)};}return h.i;}// Same job as the inline script, for pages opened without a full page load\n// and for screens that grow or sharpen after loading (rotation, resize, zoom,\n// a window moved to a sharper display). It only ever steps up to a larger\n// copy, never down.\nfunction fit(box,photo){if(!box)return;const shown=box.getBoundingClientRect().width;if(!shown)return;const img=box.querySelector(\"img\");const source=box.querySelector(\"source\");if(!img||!source)return;const need=Math.ceil(shown*(window.devicePixelRatio||1)-.01);const width=WIDTHS.find(w=>w>=need)??WIDTHS[WIDTHS.length-1];const current=img.getAttribute(\"src\")||\"\";if(current.split(\"?\")[0]===photo.src){const has=Number((/scale-down-to=(\\d+)/.exec(current)||[])[1]);if(has>=width)return;}source.setAttribute(\"srcset\",avifUrl(photo.src,width));img.setAttribute(\"alt\",photo.alt);img.setAttribute(\"src\",copyUrl(photo.src,width));}export default function HeroImage(props){const fixed=props.image?.src?{src:props.image.src.split(\"?\")[0],alt:props.alt||props.image.alt||\"\"}:null;const[pick]=useState(pickIndex);const photo=fixed??(pick>=0?POOL[pick]:null);const ref=useRef(null);// src and srcset are never rendered by React: the inline script sets them\n// on a full page load, and fit() sets them everywhere else. That is why\n// the source and img below carry suppressHydrationWarning. The first fit\n// runs before paint, so a page opened without a full load never shows\n// the alt text in an empty box.\nuseBeforePaint(()=>{if(photo)fit(ref.current,photo);},[photo?.src,photo?.alt]);useEffect(()=>{if(!photo)return;let frame=0;const run=()=>{frame=0;fit(ref.current,photo);};const queue=()=>{if(!frame)frame=requestAnimationFrame(run);};window.addEventListener(\"resize\",queue);// A window moved to a sharper display changes pixel density with no\n// resize, so watch the density itself and re-arm after each change.\nlet density=null;const onDensity=()=>{queue();watchDensity();};const watchDensity=()=>{density?.removeEventListener?.(\"change\",onDensity);density=window.matchMedia(`(resolution: ${window.devicePixelRatio||1}dppx)`);density.addEventListener?.(\"change\",onDensity);};watchDensity();return()=>{window.removeEventListener(\"resize\",queue);density?.removeEventListener?.(\"change\",onDensity);if(frame)cancelAnimationFrame(frame);};},[photo?.src,photo?.alt]);return /*#__PURE__*/_jsxs(\"div\",{ref:ref,style:{...props.style,position:\"relative\",width:\"100%\",height:\"auto\",aspectRatio:\"3 / 2\",borderRadius:24,overflow:\"hidden\",background:\"rgba(128, 128, 128, 0.12)\"},children:[/*#__PURE__*/_jsxs(\"picture\",{style:{display:\"contents\"},children:[/*#__PURE__*/_jsx(\"source\",{type:\"image/avif\",suppressHydrationWarning:true}),/*#__PURE__*/_jsx(\"img\",{suppressHydrationWarning:true,alt:photo?.alt??\"\",decoding:\"async\",// @ts-ignore fetchpriority is a valid img attribute\nfetchpriority:\"high\",style:{display:\"block\",width:\"100%\",height:\"100%\",objectFit:\"cover\"}})]}),/*#__PURE__*/_jsx(\"script\",{dangerouslySetInnerHTML:{__html:inlineFit(fixed?[fixed]:POOL)}}),/*#__PURE__*/_jsx(\"noscript\",{dangerouslySetInnerHTML:{__html:noscriptImg(fixed??POOL[0])}})]});}HeroImage.displayName=\"Hero Image\";addPropertyControls(HeroImage,{image:{type:ControlType.ResponsiveImage,title:\"Image\",description:\"Leave empty to show the shared rotating photos. Use a 3:2 image.\"},alt:{type:ControlType.String,title:\"Alt Text\",defaultValue:\"\",hidden:props=>!props.image}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HeroImage\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HeroImage.map"],"mappings":"oNAaoW,SAAS,GAAW,CAAC,GAAG,EAAK,OAAO,EAAE,MAAO,GAAE,GAAU,IAAS,OAAY,MAAM,GAAG,IAAM,EAAE,EAAa,EAAK,EAAO,SAAS,SAAa,EAAE,EAAE,GAAoF,OAA5E,CAAC,GAAG,EAAE,OAAO,KAAM,EAAE,EAAE,GAAK,CAAC,OAAK,EAAE,KAAK,MAAM,KAAK,OAAO,EAAE,EAAK,MAAM,CAAC,GAAU,EAAE,CAAE,CAIrlB,SAAS,EAAI,EAAI,EAAM,CAAC,GAAG,CAAC,EAAI,OAAO,IAAM,EAAM,EAAI,sBAAsB,CAAC,CAAC,MAAM,GAAG,CAAC,EAAM,OAAO,IAAM,EAAI,EAAI,cAAc,KAAK,EAAQ,E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