{"version":3,"file":"AltFromNext.D74PCUHD.mjs","names":["__esmMin","init_npm_react_18_3_1","ce","init_jsx_runtime","c","applyAlt","CLASS","next","el","alt","imgs","img","withAltFromNext","t","className","props","Component","init_AltFromNext"],"sources":["https:/framerusercontent.com/modules/KevAE646aVsd5UUY62MJ/4FxGH4tpagfLLnqZdaIm/AltFromNext.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";// Copies the CMS alt text from the hidden text layer placed directly after\n// this image frame onto the frame's <img>, then hides that text from screen readers.\nconst CLASS=\"io-alt-from-next\";function applyAlt(){if(typeof document===\"undefined\")return;document.querySelectorAll(\".\"+CLASS).forEach(el=>{const next=el.nextElementSibling;const alt=next?.textContent?.trim();if(!alt)return;const imgs=el.querySelectorAll(\"img\");if(imgs.length)imgs.forEach(img=>img.setAttribute(\"alt\",alt));else{el.setAttribute(\"role\",\"img\");el.setAttribute(\"aria-label\",alt);}next.setAttribute(\"aria-hidden\",\"true\");});}export function withAltFromNext(Component){return props=>{useEffect(()=>{applyAlt();const t=setTimeout(applyAlt,500);return()=>clearTimeout(t);},[]);const className=[props.className,CLASS].filter(Boolean).join(\" \");return /*#__PURE__*/_jsx(Component,{...props,className:className});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withAltFromNext\":{\"type\":\"reactHoc\",\"name\":\"withAltFromNext\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AltFromNext.map"],"mappings":"A,kHAE+B,SAASK,GAAU,CAAI,OAAO,SAAW,KAAmB,SAAS,iBAAiB,IAAIC,CAAK,CAAC,CAAC,QAAQ,GAAI,CAAC,IAAMC,EAAKC,EAAG,mBAAyBC,EAAIF,GAAM,aAAa,KAAK,EAAE,GAAG,CAACE,EAAI,OAAO,IAAMC,EAAKF,EAAG,iBAAiB,KAAK,EAAKE,EAAK,OAAOA,EAAK,QAAQ,GAAKC,EAAI,aAAa,MAAMF,CAAG,CAAC,GAAOD,EAAG,aAAa,OAAO,KAAK,EAAEA,EAAG,aAAa,aAAaC,CAAG,GAAGF,EAAK,aAAa,cAAc,MAAM,CAAE,CAAC,CAAE,CAAC,SAAgBK,EAAgB,EAAU,CAAC,MAAO,IAAO,CAACV,MAAc,CAACG,EAAS,EAAE,IAAMQ,EAAE,WAAWR,EAAS,GAAG,EAAE,UAAU,aAAaQ,CAAC,CAAE,EAAE,CAAC,CAAC,EAAE,IAAMC,EAAU,CAACC,EAAM,UAAUT,CAAK,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAAE,MAAoB,gBAAKU,EAAU,CAAC,GAAGD,EAAgB,WAAS,CAAC,CAAE,CAAE,C,4CAA7sB,EAAM,kB"}