{"version":3,"file":"Fetch_priority.Bmc3ZxZM.mjs","names":["useRef","useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/6gneVunHBmfXyCNFA7F7/h7Sj42GFhnTcFpfjFtsR/Fetch_priority.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";// First-screen images only: tells the browser to fetch them ahead of everything else.\nexport function withFetchPriority(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,background:{...props.background,fetchPriority:\"high\"}});};}// Images that start off screen but must be ready soon (later slides): fetched\n// straight away, but behind the ones the visitor can already see.\nexport function withLowFetchPriority(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,background:{...props.background,fetchPriority:\"low\"}});};}// Below-the-fold images: defers the download until the image is about to scroll into view.\nexport function withLazyLoading(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,background:{...props.background,loading:\"lazy\"}});};}// Entrance for the homepage slideshow, in two steps:\n// 1. the slide strip moves in 24px from the left with a fade (0.4s), matching\n//    the section's original appear effect;\n// 2. once the strip has settled, the dots fade in on the spot (no movement).\nconst REVEAL_EASE=\"cubic-bezier(0.12, 0.23, 0.5, 1)\";const REVEAL_MAX_WAIT_MS=2500;// The slideshow starts on its 4th slide, so the three slides before it are part\n// of the server-rendered page and can show to the left of centre straight away.\n// The dots are re-ordered to match, so the first dot is still the starting slide.\nconst LEADING_SLIDES=3;const STRIP=\".kl-slideshow-reveal .framer-slideshow > div:first-child\";const DOTS=\".kl-slideshow-reveal .framer--slideshow-controls\";const REVEAL_CSS=`\n.kl-slideshow-reveal{width:100%}\n${STRIP}{opacity:0;transform:translateX(-24px);transition:opacity .4s ${REVEAL_EASE},transform .4s ${REVEAL_EASE};animation:kl-slideshow-failsafe .4s 6s forwards}\n${DOTS}{opacity:0;transition:opacity .3s ease-out .4s;animation:kl-slideshow-failsafe .3s 6.4s forwards}\n.kl-slideshow-reveal:is([data-ready=\"true\"],[data-early=\"true\"]) .framer-slideshow > div:first-child{opacity:1;transform:none;animation:none}\n.kl-slideshow-reveal:is([data-ready=\"true\"],[data-early=\"true\"]) .framer--slideshow-controls{opacity:1;animation:none}\n${DOTS} > div:last-child > button{padding-inline:4px !important}\n${DOTS} > div:last-child > button:nth-child(-n+${LEADING_SLIDES}){order:1}\n@keyframes kl-slideshow-failsafe{to{opacity:1;transform:none}}\n@media (prefers-reduced-motion:reduce){${STRIP}{transform:none;transition:opacity .2s linear}${DOTS}{transition:opacity .2s linear .2s}}\n`;// Runs while the page is still being read, before any of the site's JavaScript:\n// reveals the slideshow as soon as the slides inside the viewport are decoded.\nconst EARLY_REVEAL_SCRIPT=`(function(){var w=document.currentScript&&document.currentScript.previousElementSibling;if(!w||!w.querySelectorAll)return;var done=false;function go(){if(done)return;done=true;w.setAttribute(\"data-early\",\"true\")}var cap=setTimeout(go,${REVEAL_MAX_WAIT_MS});var vw=window.innerWidth;var imgs=[].slice.call(w.querySelectorAll(\"img\")).filter(function(i){var r=i.getBoundingClientRect();return r.width>0&&r.right>0&&r.left<vw});Promise.all(imgs.map(function(i){return i.decode?i.decode().catch(function(){}):null})).then(function(){clearTimeout(cap);requestAnimationFrame(go);setTimeout(go,120)})})()`;// Fallback for when the early script cannot run (arriving from another page of\n// the site): the slideshow only builds its looping copies (including the slides left of\n// centre) once it runs in the browser, so those slides used to pop in late.\n// so this waits until it has settled and every slide inside the viewport is\n// downloaded and decoded, then plays the entrance.\nexport function withSlideshowReveal(Component){return props=>{const wrapper=useRef(null);const[ready,setReady]=useState(false);useEffect(()=>{const root=wrapper.current;if(!root){setReady(true);return;}let cancelled=false;const reveal=()=>{if(!cancelled)setReady(true);};// Never keep the slideshow hidden for long, e.g. on a slow connection.\nconst cap=window.setTimeout(reveal,REVEAL_MAX_WAIT_MS);const nextFrame=()=>new Promise(resolve=>requestAnimationFrame(()=>resolve()));const list=()=>root.querySelector(\".framer-slideshow ul\");const slideCountAtMount=list()?.children.length??0;const run=async()=>{// 1. Wait for the slideshow to add its looping copies.\nwhile(!cancelled){const el=list();if(el&&(el.children.length>slideCountAtMount||!el.style.transform.includes(\"calc(\")))break;await nextFrame();}// 2. Wait for it to stop moving into its start position.\nlet previousLeft=NaN;let stillFrames=0;while(!cancelled&&stillFrames<2){const left=list()?.getBoundingClientRect().left??0;stillFrames=left===previousLeft?stillFrames+1:0;previousLeft=left;await nextFrame();}if(cancelled)return;// 3. Wait for every slide inside the viewport to be decoded.\nconst viewportWidth=window.innerWidth;const inView=Array.from(root.querySelectorAll(\"img\")).filter(img=>{const rect=img.getBoundingClientRect();return rect.width>0&&rect.right>0&&rect.left<viewportWidth;});await Promise.all(inView.map(img=>img.decode().catch(()=>undefined)));await nextFrame();reveal();};run();return()=>{cancelled=true;window.clearTimeout(cap);};},[]);return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{dangerouslySetInnerHTML:{__html:REVEAL_CSS}}),/*#__PURE__*/_jsx(\"noscript\",{children:/*#__PURE__*/_jsx(\"style\",{dangerouslySetInnerHTML:{__html:`${STRIP},${DOTS}{opacity:1;transform:none;animation:none}`}})}),/*#__PURE__*/_jsx(\"div\",{ref:wrapper,className:\"kl-slideshow-reveal\",\"data-ready\":ready?\"true\":\"false\",children:/*#__PURE__*/_jsx(Component,{...props})}),/*#__PURE__*/_jsx(\"script\",{dangerouslySetInnerHTML:{__html:EARLY_REVEAL_SCRIPT}})]});};}// Kept as a pass-through so existing assignments keep working. The previous version\n// preloaded ten full-size originals (~4.6 MB) that the slideshow never displays.\nexport function withPreloadedSlideshow(Component){return props=>/*#__PURE__*/_jsx(Component,{...props});}\nexport const __FramerMetadata__ = {\"exports\":{\"withFetchPriority\":{\"type\":\"reactHoc\",\"name\":\"withFetchPriority\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSlideshowReveal\":{\"type\":\"reactHoc\",\"name\":\"withSlideshowReveal\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPreloadedSlideshow\":{\"type\":\"reactHoc\",\"name\":\"withPreloadedSlideshow\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withLowFetchPriority\":{\"type\":\"reactHoc\",\"name\":\"withLowFetchPriority\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withLazyLoading\":{\"type\":\"reactHoc\",\"name\":\"withLazyLoading\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Fetch_priority.map"],"mappings":"4JACA,SAAgB,EAAkB,EAAU,CAAC,MAAO,IAA4B,EAAK,EAAU,CAAC,GAAG,EAAM,WAAW,CAAC,GAAG,EAAM,WAAW,cAAc,MAAM,CAAC,CAAC,CAAI,CAEnK,SAAgB,EAAqB,EAAU,CAAC,MAAO,IAA4B,EAAK,EAAU,CAAC,GAAG,EAAM,WAAW,CAAC,GAAG,EAAM,WAAW,cAAc,KAAK,CAAC,CAAC,CAAI,CACrK,SAAgB,EAAgB,EAAU,CAAC,MAAO,IAA4B,EAAK,EAAU,CAAC,GAAG,EAAM,WAAW,CAAC,GAAG,EAAM,WAAW,QAAQ,MAAM,CAAC,CAAC,CAAI,CAwB3J,SAAgB,EAAoB,EAAU,CAAC,MAAO,IAAO,CAAC,IAAM,EAAQA,EAAO,IAAI,EAAO,CAAC,EAAM,GAAUC,EAAS,EAAK,EAIqP,OAJnP,MAAc,CAAC,IAAM,EAAK,EAAQ,QAAQ,GAAG,CAAC,EAAK,CAAC,EAAS,EAAI,EAAE,MAAO,CAAC,IAAI,EAAU,GAAY,MAAW,CAAK,GAAU,EAAS,EAAI,CAAE,EACvQ,EAAI,EAAO,WAAW,EAAO,CAAkB,EAAQ,MAAc,IAAI,QAAQ,GAAS,0BAA0B,EAAQ,CAAC,CAAC,EAAQ,MAAS,EAAK,cAAc,sBAAsB,EAAQ,EAAkB,EAAK,CAAC,EAAE,SAAS,QAAQ,EAGsE,OAAN,SAH3C,CACtQ,KAAM,CAAC,GAAU,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