{"version":3,"file":"TextGLitCH.AIsnWFut.mjs","names":["useRef","useState","__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/gBto0Kqbb9aY9E12PHlC/GwHPWtRFqe5O5edqAUi2/TextGLitCH.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";function randomizeCase(text){return text.split(\"\").map(ch=>{if(!/[a-zA-Z]/.test(ch))return ch;return Math.random()>.5?ch.toUpperCase():ch.toLowerCase();}).join(\"\");}export function RandomCaseText(){const baseTextRef=useRef(\"\");const timerRef=useRef(null);const[displayText,setDisplayText]=useState(null);const[snapStyle,setSnapStyle]=useState(null);useEffect(()=>{if(!baseTextRef.current)return;const tick=()=>{setDisplayText(randomizeCase(baseTextRef.current));timerRef.current=window.setTimeout(tick,60+Math.random()*600);};timerRef.current=window.setTimeout(tick,200);return()=>{if(timerRef.current)window.clearTimeout(timerRef.current);timerRef.current=null;};},[baseTextRef.current?1:0]);return{...displayText!==null?{text:displayText}:{},...snapStyle?{style:snapStyle}:{},ref:node=>{if(!node)return;// Baseline-Text einmalig holen\nif(!baseTextRef.current){const t=(node.textContent||\"\").trim();if(t){baseTextRef.current=t;setDisplayText(t);}}// Styles einmalig “einfrieren”, damit BG/Padding bleibt\nif(!snapStyle){const cs=window.getComputedStyle(node);setSnapStyle({backgroundColor:cs.backgroundColor,paddingTop:cs.paddingTop,paddingRight:cs.paddingRight,paddingBottom:cs.paddingBottom,paddingLeft:cs.paddingLeft,borderRadius:cs.borderRadius,boxSizing:\"border-box\"});}}};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withRandomCaseText(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...RandomCaseText(props)});};}withRandomCaseText.displayName=\"RandomCaseText\";\nexport const __FramerMetadata__ = {\"exports\":{\"RandomCaseText\":{\"type\":\"override\",\"name\":\"RandomCaseText\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRandomCaseText\":{\"type\":\"reactHoc\",\"name\":\"withRandomCaseText\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TextGLitCH.map"],"mappings":"sMAAwF,SAAS,EAAc,EAAK,CAAC,OAAO,EAAK,MAAM,GAAG,CAAC,IAAI,GAAS,WAAW,KAAK,EAAG,CAAkB,KAAK,QAAQ,CAAC,GAAG,EAAG,aAAa,CAAC,EAAG,aAAa,CAA5D,EAA+D,CAAC,KAAK,GAAG,CAAE,SAAgB,GAAgB,CAAC,IAAM,EAAYA,EAAO,GAAG,CAAO,EAASA,EAAO,KAAK,CAAM,CAAC,EAAY,GAAgBC,EAAS,KAAK,CAAM,CAAC,EAAU,GAAcA,EAAS,KAAK,CAAyV,OAAxV,MAAc,CAAC,GAAG,CAAC,EAAY,QAAQ,OAAO,IAAM,MAAS,CAAC,EAAe,EAAc,EAAY,QAAQ,CAAC,CAAC,EAAS,QAAQ,EAAO,WAAW,EAAK,GAAG,KAAK,QAAQ,CAAC,IAAI,EAAgD,MAA7C,GAAS,QAAQ,EAAO,WAAW,EAAK,IAAI,KAAW,CAAI,EAAS,SAAQ,EAAO,aAAa,EAAS,QAAQ,CAAC,EAAS,QAAQ,OAAS,CAAC,EAAY,QAAQ,EAAE,EAAE,CAAC,CAAO,CAAC,GAAG,IAAc,KAAwB,EAAE,CAArB,CAAC,KAAK,EAAY,CAAI,GAAG,EAAU,CAAC,MAAM,EAAU,CAAC,EAAE,CAAC,IAAI,GAAM,CAAK,KACj3B,IAAG,CAAC,EAAY,QAAQ,CAAC,IAAM,GAAG,EAAK,aAAa,IAAI,MAAM,CAAI,IAAG,EAAY,QAAQ,EAAE,EAAe,EAAE,EAC5G,GAAG,CAAC,EAAU,CAAC,IAAM,EAAG,EAAO,iBAAiB,EAAK,CAAC,EAAa,CAAC,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