{"version":3,"file":"EqualHeightOverride.YYa_FcfY.mjs","names":["__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/JP3hEdbYNMJu4jeieFHP/roIr5kytltqmk1GFOKvq/EqualHeightOverride.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";const GROUP=\"__framer_eqh_card__\";let mo=null;let moRoot=null;let scheduled=false;let stabilizeTimer=null;function getCards(){return Array.from(document.getElementsByClassName(GROUP));}function equalize(){const cards=getCards();if(cards.length<2)return;// reset first to measure natural heights\nfor(const el of cards){el.style.height=\"auto\";el.style.minHeight=\"0px\";}const max=Math.max(...cards.map(el=>el.getBoundingClientRect().height));const h=`${Math.ceil(max)}px`;for(const el of cards){// minHeight is less likely to be overridden by framer than height\nel.style.minHeight=h;el.style.alignSelf=\"stretch\";}}function scheduleEqualize(){if(scheduled)return;scheduled=true;requestAnimationFrame(()=>{requestAnimationFrame(()=>{scheduled=false;equalize();});});}function setObserverRoot(){const cards=getCards();const first=cards[0];if(!first)return document.documentElement;// scope observation as tightly as we can:\n// observe the nearest parent container that holds the moving/cloned ticker items.\n// start with the immediate parent, fall back safely.\nreturn first.parentElement??document.documentElement;}function ensureObservers(){// (re)pick a scoped root whenever cards exist\nconst nextRoot=setObserverRoot();// if we already have an observer on the right root, do nothing\nif(mo&&moRoot===nextRoot)return;// tear down any old observer\nif(mo){try{mo.disconnect();}catch{}mo=null;moRoot=null;}// create mutation observer, scoped to the ticker container instead of the whole document\nmo=new MutationObserver(()=>scheduleEqualize());moRoot=nextRoot;mo.observe(moRoot,{childList:true,subtree:true});// keep resize handler simple\nwindow.addEventListener(\"resize\",scheduleEqualize);// fonts can reflow text after load\nconst fontsReady=document.fonts?.ready;if(fontsReady?.then){fontsReady.then(()=>scheduleEqualize()).catch(()=>{});}// optional performance win: stop observing after things “settle”\n// (ticker clones typically happen right after mount)\nif(stabilizeTimer)window.clearTimeout(stabilizeTimer);stabilizeTimer=window.setTimeout(()=>{if(mo){try{mo.disconnect();}catch{}mo=null;moRoot=null;}},2e3);}export function equalHeightTickerCard(){React.useEffect(()=>{// try immediately, and again shortly after mount to catch ticker clones\nensureObservers();scheduleEqualize();const t=window.setTimeout(()=>{ensureObservers();scheduleEqualize();},150);return()=>{window.clearTimeout(t);// do not remove resize listener here because this override runs per instance\n// and removing it would break other instances. leaving it is fine.\n};},[]);return{className:GROUP};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withequalHeightTickerCard(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...equalHeightTickerCard(props)});};}withequalHeightTickerCard.displayName=\"equalHeightTickerCard\";\nexport const __FramerMetadata__ = {\"exports\":{\"equalHeightTickerCard\":{\"type\":\"override\",\"name\":\"equalHeightTickerCard\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withequalHeightTickerCard\":{\"type\":\"reactHoc\",\"name\":\"withequalHeightTickerCard\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./EqualHeightOverride.map"],"mappings":"wLAAiL,SAAS,GAAU,CAAC,OAAO,MAAM,KAAK,SAAS,uBAAuB,EAAM,CAAC,CAAE,SAAS,GAAU,CAAC,IAAM,EAAM,GAAU,CAAC,GAAG,EAAM,OAAO,EAAE,OAC7T,IAAI,IAAM,KAAM,EAAO,EAAG,MAAM,OAAO,OAAO,EAAG,MAAM,UAAU,MAAO,IAAM,EAAI,KAAK,IAAI,GAAG,EAAM,IAAI,GAAI,EAAG,uBAAuB,CAAC,OAAO,CAAC,CAAO,EAAE,GAAG,KAAK,KAAK,EAAI,CAAC,IAAI,IAAI,IAAM,KAAM,EAC9L,EAAG,MAAM,UAAU,EAAE,EAAG,MAAM,UAAU,UAAY,SAAS,GAAkB,CAAI,IAAiB,EAAU,GAAK,0BAA0B,CA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