{"version":3,"file":"Redirection_Touch.Ca3pu5yP.mjs","names":["useRef","__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/SWMDnjwMP8EyX3zEbfuj/KLVmTQzCygnc8dgbZEoF/Redirection_Touch.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";// Override que redirige tras un tiempo de inactividad desde la carga de la página\nexport function RedirectOnLoad(){const timeoutRef=useRef(null);useEffect(()=>{const redirectUrl=\"https://www.planeamusica.com/landingcraneamusica2024/touch-25\";const timeoutSeconds=50;const redirect=()=>{window.location.href=redirectUrl;};const resetTimer=()=>{if(timeoutRef.current){clearTimeout(timeoutRef.current);}timeoutRef.current=window.setTimeout(redirect,timeoutSeconds*1e3);};resetTimer();window.addEventListener(\"mousemove\",resetTimer);window.addEventListener(\"keypress\",resetTimer);window.addEventListener(\"scroll\",resetTimer);window.addEventListener(\"touchstart\",resetTimer);return()=>{if(timeoutRef.current){clearTimeout(timeoutRef.current);}window.removeEventListener(\"mousemove\",resetTimer);window.removeEventListener(\"keypress\",resetTimer);window.removeEventListener(\"scroll\",resetTimer);window.removeEventListener(\"touchstart\",resetTimer);};},[]);return{};}// Override que redirige tras un tiempo de inactividad pero solo después de detectar un touch\nexport function RedirectOnTouch(){const timeoutRef=useRef(null);useEffect(()=>{const redirectUrl=\"https://www.planeamusica.com/landingcraneamusica2024/touch-25\";const timeoutSeconds=15;const redirect=()=>{window.location.href=redirectUrl;};const resetTimer=()=>{if(timeoutRef.current){clearTimeout(timeoutRef.current);}timeoutRef.current=window.setTimeout(redirect,timeoutSeconds*1e3);};// Listener para detectar el primer touch e iniciar el temporizador\nconst startTimerOnTouch=()=>{resetTimer();// Solo necesitamos este listener una vez, así que lo removemos\nwindow.removeEventListener(\"touchstart\",startTimerOnTouch);// Ahora el temporizador se reiniciará con cada touch\nwindow.addEventListener(\"touchstart\",resetTimer);};window.addEventListener(\"touchstart\",startTimerOnTouch);return()=>{if(timeoutRef.current){clearTimeout(timeoutRef.current);}window.removeEventListener(\"touchstart\",startTimerOnTouch);window.removeEventListener(\"touchstart\",resetTimer);};},[]);return{};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withRedirectOnLoad(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...RedirectOnLoad(props)});};}withRedirectOnLoad.displayName=\"RedirectOnLoad\";export function withRedirectOnTouch(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...RedirectOnTouch(props)});};}withRedirectOnTouch.displayName=\"RedirectOnTouch\";\nexport const __FramerMetadata__ = {\"exports\":{\"withRedirectOnTouch\":{\"type\":\"reactHoc\",\"name\":\"withRedirectOnTouch\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRedirectOnLoad\":{\"type\":\"reactHoc\",\"name\":\"withRedirectOnLoad\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"RedirectOnLoad\":{\"type\":\"override\",\"name\":\"RedirectOnLoad\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"RedirectOnTouch\":{\"type\":\"override\",\"name\":\"RedirectOnTouch\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Redirection_Touch.map"],"mappings":"ySACA,SAAgB,GAAgB,CAAC,IAAM,EAAWA,EAAO,MAAwyB,OAAlyB,MAAc,CAAC,IAAgH,MAAa,CAAC,EAAO,SAAS,KAAK,+DAAa,EAAO,MAAe,CAAI,EAAW,SAAS,aAAa,EAAW,SAAU,EAAW,QAAQ,EAAO,WAAW,EAAS,GAAe,IAAM,EAA2M,OAA1M,IAAa,EAAO,iBAAiB,YAAY,GAAY,EAAO,iBAAiB,WAAW,GAAY,EAAO,iBAAiB,SAAS,GAAY,EAAO,iBAAiB,aAAa,OAA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