{"version":3,"file":"Flicker_loop.DlOjTHrr.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/7HsvO0R4DQ7sE6EvR1aS/tq0py9i8bDoGd83tLNVp/Flicker_loop.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{RenderTarget}from\"framer\";// Define the 5 distinct flicker cycles\nconst flickerVariants={flicker1:{opacity:[0,1,0,1,.3,1,.8,1],filter:[\"brightness(1)\",\"brightness(2)\",\"brightness(1)\",\"brightness(1.5)\",\"brightness(1)\"],transition:{duration:.6,ease:\"linear\"}},flicker2:{opacity:[0,0,1,0,1],filter:[\"brightness(1)\",\"brightness(0.5)\",\"brightness(2.5)\",\"brightness(1)\"],transition:{duration:.5,ease:\"linear\"}},flicker3:{opacity:[.2,1,.4,1,.5,1],filter:[\"brightness(1)\",\"brightness(1.8)\",\"brightness(1)\",\"brightness(2.2)\",\"brightness(1)\"],transition:{duration:.3,ease:\"linear\"}},flicker4:{opacity:[0,.1,1,.8,1],filter:[\"brightness(1)\",\"brightness(3)\",\"brightness(1)\"],transition:{duration:.8,ease:\"linear\"}},flicker5:{opacity:[0,1,.3,.9,1],filter:[\"brightness(1)\",\"brightness(0.8)\",\"brightness(2)\",\"brightness(1)\"],transition:{duration:.5,ease:\"linear\"}}};export function withElectricFlicker(Component){return props=>{// Check if we are currently on the Framer design canvas\nconst isCanvas=RenderTarget.current()===RenderTarget.canvas;// If on the canvas, return the component normally without the complex hooks and animation states\nif(isCanvas){return /*#__PURE__*/_jsx(Component,{...props});}// --- Everything below this line only runs in Preview or Live ---\n// Start at -1 so it stays in the initial state during the setup delay\nconst[cycle,setCycle]=useState(-1);useEffect(()=>{// Adjust this initial delay as needed (e.g., 1000ms = 1 seconds)\nconst initialDelay=900;const timeout=setTimeout(()=>{// Trigger the first flicker immediately after the delay\nsetCycle(0);// Then start cycling every 3 seconds\nconst interval=setInterval(()=>{setCycle(prev=>(prev+1)%5);},2e3);return()=>clearInterval(interval);},initialDelay);return()=>clearTimeout(timeout);},[]);// Determine variant: if cycle is -1, stay on initial state.\nconst currentVariantName=cycle===-1?\"initial\":`flicker${cycle+1}`;return /*#__PURE__*/_jsx(Component,{...props,initial:{opacity:0,filter:\"brightness(1)\"},animate:currentVariantName,variants:flickerVariants,viewport:{once:true,margin:\"-50px\"}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withElectricFlicker\":{\"type\":\"reactHoc\",\"name\":\"withElectricFlicker\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Flicker_loop.map"],"mappings":"0KACgxB,SAAgB,EAAoB,EAAU,CAAC,MAAO,IAAO,CAE70B,GADe,EAAa,SAAS,GAAG,EAAa,OACxC,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAM,CAAC,CAE3D,GAAK,CAAC,EAAM,GAAUA,EAAS,GAAG,CAAC,MAAc,CAC1B,IAAM,EAAQ,eAAe,CACpD,EAAS,EAAE,CACX,IAAM,EAAS,gBAAgB,CAAC,EAAS,IAAO,EAAK,GAAG,EAAE,EAAG,IAAI,CAAC,UAAU,cAAc,EAAS,EAFhF,IAEgG,CAAC,UAAU,aAAa,EAAQ,EAAG,EAAE,CAAC,CACzJ,IAAM,EAAmB,IAAQ,GAAG,UAAU,UAAU,EAAM,IAAI,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAM,QAAQ,CAAC,QAAQ,EAAE,OAAO,gBAAgB,CAAC,QAAQ,EAAmB,SAAS,EAAgB,SAAS,CAAC,KAAK,GAAK,OAAO,QAAQ,CAAC,CAAC,qBATxM,IAAsC,IAAiC,CAC5G,EAAgB,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,gBAAgB,gBAAgB,gBAAgB,kBAAkB,gBAAgB,CAAC,WAAW,CAAC,SAAS,GAAG,KAAK,SAAS,CAAC,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