{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/5lR2aVoqfyPZxukNQooy/2axqIVPA4foZKTIj6ZjG/siteMetadata.js"],
  "sourcesContent": ["// Generated by Framer (20dc3ed)\nexport default function metadata(params,activeLocale){return{customHTMLHeadEnd:\"<!-- Plugin: dev_66a2b3 --> \\n<script type=\\\"module\\\" id=\\\"supabase-init-script\\\">\\n  (async function() {\\n    console.log('[Supabase Init] Script starting...');\\n    let createSupabaseClient;\\n    let clientInstance = null;\\n    let initError = null;\\n\\n    window.__supabaseReady = false;\\n    window.__supabaseClient = undefined;\\n\\n    try {\\n      console.log('[Supabase Init] Importing library: https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2/dist/umd/supabase.min.js');\\n      const supabaseModule = await import(\\\"https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2/dist/umd/supabase.min.js\\\");\\n      if (typeof supabaseModule.createClient === 'function') { createSupabaseClient = supabaseModule.createClient; }\\n      else if (typeof supabaseModule.default?.createClient === 'function') { createSupabaseClient = supabaseModule.default.createClient; }\\n      else if (typeof window !== 'undefined' && typeof window.supabase?.createClient === 'function') { createSupabaseClient = window.supabase.createClient; }\\n      else { throw new Error(\\\"createClient function not found in Supabase module.\\\"); }\\n      console.log('[Supabase Init] Library loaded, createClient found.');\\n\\n      const url = \\\"https://umksglrwbeijrmynlkdo.supabase.co\\\";\\n      const key = \\\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InVta3NnbHJ3YmVpanJteW5sa2RvIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDA1NDYwMjMsImV4cCI6MjA1NjEyMjAyM30.EeFLxm_GNjCOpeJgScpwzz1EBTWyc9dt7Msv0rAx18M\\\";\\n\\n      if (!url || !key) { throw new Error(\\\"Embedded Supabase URL or Anon Key is missing in init script.\\\"); }\\n      console.log('[Supabase Init] Credentials found. Creating client...');\\n\\n      clientInstance = createSupabaseClient(url, key);\\n      console.log('[Supabase Init] Client created successfully.');\\n\\n    } catch (err) {\\n      console.error(\\\"[Supabase Init] Initialization Error:\\\", err);\\n      initError = err?.message || \\\"Unknown init error\\\";\\n      clientInstance = null;\\n    } finally {\\n      window.__supabaseClient = clientInstance;\\n      window.__supabaseReady = true; // Signal attempt complete\\n      console.log('[Supabase Init] Set window.__supabaseClient:', !!window.__supabaseClient);\\n      console.log('[Supabase Init] Set window.__supabaseReady: true');\\n      window.dispatchEvent(new CustomEvent('supabaseInitialized', { detail: { error: initError } }));\\n      console.log('[Supabase Init] Initialization script finished.');\\n    }\\n  })();\\n</script>\\n\\n<script id=\\\"framer-redirect-manager\\\">\\n  (function() {\\n    // This IIFE runs as soon as the script tag is parsed in the head\\n    console.log(\\\"[Script Manager] Manager script initializing...\\\");\\n    let authListenerUnsubscribe = null; // Store unsubscribe function\\n    let isRunningChecks = false; // Prevent concurrent checks\\n    let currentAuthCheckPromise = null; // Track ongoing getSession calls\\n\\n    // --- Core Check Logic Function ---\\n    // Encapsulates all checks that depend on auth state\\n    async function runChecks(reason = \\\"Initial Load\\\") {\\n      if (isRunningChecks) {\\n        console.log(`[Script Manager] Skipping checks (${reason}) - already running.`);\\n        return;\\n      }\\n      isRunningChecks = true;\\n      const currentPath = window.location.pathname;\\n      console.log(`[Script Manager] Running checks (${reason}) for path: ${currentPath}`);\\n      let redirected = false; // Flag for this specific check cycle\\n\\n      // Config needed inside the check\\n      const loginPath = \\\"/login\\\";\\n      const loggedInRedirectPath = \\\"/dashboard/account\\\";\\n\\n      // --- Wait for Supabase Client/Ready ---\\n      let checks = 0; const maxWaitChecks = 20; // ~5 seconds\\n      while (!window.__supabaseReady && checks < maxWaitChecks) {\\n          console.log(`[Script Manager] Waiting for Supabase ready (${reason})... check ${checks + 1}`);\\n          await new Promise(res => setTimeout(res, 250));\\n          checks++;\\n      }\\n      if (!window.__supabaseReady) {\\n           console.warn(`[Script Manager] Supabase not ready after ${maxWaitChecks} checks (${reason}).`);\\n           // Protection logic might redirect anyway if client is missing later\\n      } else {\\n           console.log(`[Script Manager] Supabase ready (${reason}).`);\\n      }\\n      // --- End Wait ---\\n\\n      // --- Get Auth State ---\\n      const client = window.__supabaseClient;\\n      let isAuthenticated = false;\\n      if (!currentAuthCheckPromise) {\\n          if (client) {\\n              console.log('[Script Manager] Getting current session state...');\\n              currentAuthCheckPromise = client.auth.getSession()\\n                .then(({ data }) => { return !!data.session; }) // Resolve with boolean\\n                .catch(e => { console.error(\\\"[Script Manager] Error getting session:\\\", e); return false; })\\n                .finally(() => { currentAuthCheckPromise = null; });\\n          } else {\\n              console.warn(\\\"[Script Manager] Supabase client not available for auth check.\\\");\\n              currentAuthCheckPromise = Promise.resolve(false);\\n          }\\n      } else { console.log('[Script Manager] Waiting for ongoing session check...'); }\\n      isAuthenticated = await currentAuthCheckPromise; // Await the result\\n      console.log('[Script Manager] Determined auth state:', isAuthenticated);\\n      // --- End Get Auth State ---\\n\\n      // --- Define simple path matcher for priority 1 check ---\\n      function matchesPathSimple(pattern, path) {\\n           const normPath = path === '/' ? '/' : path.replace(/\\\\/$/, '');\\n           const normPattern = pattern === '/' ? '/' : pattern.replace(/\\\\/$/, '');\\n           return normPath === normPattern;\\n       }\\n\\n      // --- Run Redirect Logic Sequentially ---\\n      // Priority 1: Redirect logged-in from login page\\n      if (isAuthenticated && matchesPathSimple(loginPath, currentPath)) {\\n          console.log('[Script Manager] User logged in on login page. Redirecting to:', loggedInRedirectPath);\\n          if (window.location.pathname !== loggedInRedirectPath) {\\n               window.location.replace(loggedInRedirectPath);\\n               redirected = true;\\n          } else { console.warn(\\\"[Script Manager] Avoided self-redirect loop (LoggedIn check).\\\"); }\\n      }\\n\\n      // Priority 2: Static Redirects (only if not redirected yet)\\n      if (!redirected) {\\n          console.log(\\\"[Script Manager] Checking static redirects...\\\");\\n          try {\\n              redirected = (function(currentPath) { \\n    const staticRedirects = {\\\"/dashboard\\\":\\\"/dashboard/account\\\"};\\n    const currentPathClean = currentPath === '/' ? '/' : currentPath.replace(/\\\\/$/, ''); // Use manager's currentPath\\n    console.log('[Static Redirect] Checking:', currentPathClean);\\n    if (staticRedirects.hasOwnProperty(currentPathClean)) {\\n      const targetUrl = staticRedirects[currentPathClean];\\n      if (targetUrl !== currentPath) { // Prevent self-redirect\\n           console.log('[Static Redirect] Match! Redirecting from', currentPath, 'to', targetUrl);\\n           window.location.replace(targetUrl);\\n           return true; // Redirected\\n      }\\n    }\\n    console.log('[Static Redirect] No match.');\\n    return false; // Not redirected\\n     })(currentPath);\\n              console.log(\\\"[Script Manager] Static redirect check result:\\\", redirected);\\n          } catch (e) { console.error('[Script Manager] Error in static redirect logic:', e); }\\n      }\\n\\n      // Priority 3: Auth Protection (only if not redirected yet)\\n      if (!redirected) {\\n          console.log(\\\"[Script Manager] Checking auth protection...\\\");\\n          try {\\n              // Protection code uses currentPath and the determined isAuthenticated status\\n              redirected = (function(currentPath, isAuthenticated) { \\n    // --- Protection Logic Body ---\\n    const loginPath = \\\"/login\\\";\\n    const protectedPaths = [\\\"/dashboard/*\\\",\\\"/create-account/*\\\"];\\n    console.log('[Protection Logic - Inner] Running check for:', currentPath);\\n    \\n    function matchesPath(pattern, path) {\\n        const normalizedPath = path === '/' ? '/' : path.replace(/\\\\/+$/, '');\\n        const cleanPattern = pattern.replace(/\\\\/+$/, '') || '/';\\n        if (cleanPattern.endsWith('/*')) {\\n            const basePattern = cleanPattern.slice(0, -2);\\n            return normalizedPath === basePattern || normalizedPath.startsWith(basePattern + '/');\\n        }\\n        return normalizedPath === cleanPattern;\\n    }\\n    if (matchesPath(loginPath, currentPath)) {\\n      console.log('[Protection Logic - Inner] Is login path, skip.');\\n      return false;\\n    }\\n    const isProtected = protectedPaths.some(pattern => matchesPath(pattern, currentPath));\\n    if (!isProtected) {\\n      console.log('[Protection Logic - Inner] Path not protected.');\\n      return false;\\n    }\\n    console.log('[Protection Logic - Inner] Path IS protected.');\\n    if (isAuthenticated) {\\n         console.log('[Protection Logic - Inner] User authenticated. OK.');\\n         return false;\\n    } else {\\n         console.log('[Protection Logic - Inner] User NOT authenticated. Redirecting...');\\n         const intendedDestination = currentPath + window.location.search + window.location.hash;\\n         const loginUrlWithRedirect = (loginPath.startsWith('/') ? loginPath : '/' + loginPath) + '?redirect=' + encodeURIComponent(intendedDestination);\\n         if (window.location.pathname !== loginPath) { window.location.replace(loginUrlWithRedirect); }\\n         else { console.warn(\\\"[Protection Logic - Inner] Avoided redirect loop.\\\"); }\\n         return true; // Redirect initiated\\n    }\\n    // --- End Protection Logic Body ---\\n     })(currentPath, isAuthenticated);\\n              console.log(\\\"[Script Manager] Protection logic check result:\\\", redirected);\\n          } catch (e) { console.error('[Script Manager] Error in protection logic:', e); }\\n      }\\n      // --- End Redirect Logic ---\\n\\n      console.log(\\\"[Script Manager] Checks complete for ${currentPath}. Final redirection state:\\\", redirected);\\n      isRunningChecks = false; // Release lock\\n\\n    } // --- End of runChecks function ---\\n\\n\\n    // --- Setup Auth State Listener ---\\n    // This function tries to attach the listener if the client is ready\\n    function setupAuthListener() {\\n        if (authListenerUnsubscribe) { authListenerUnsubscribe(); authListenerUnsubscribe = null; } // Clean up previous if exists\\n\\n        const client = window.__supabaseClient;\\n        // Ensure client and method exist before subscribing\\n        if (client && typeof client.auth?.onAuthStateChange === 'function') {\\n            console.log('[Script Manager] Setting up onAuthStateChange listener...');\\n            try {\\n                const { data } = client.auth.onAuthStateChange((event, session) => {\\n                    console.log('[Script Manager] <<< onAuthStateChange event:', event, 'Session:', !!session, '>>>');\\n                    // Re-run checks on sign in/out to enforce redirects immediately\\n                    if (event === 'SIGNED_OUT' || event === 'SIGNED_IN') {\\n                        // Use setTimeout to allow potential React updates triggered by the same event to settle slightly\\n                        setTimeout(() => runChecks(`Auth State Change: ${event}`), 0);\\n                    }\\n                });\\n                if (data?.subscription?.unsubscribe) {\\n                     authListenerUnsubscribe = data.subscription.unsubscribe; // Store unsubscribe function\\n                     listenerAttached = true; // Mark as attached\\n                     console.log('[Script Manager] onAuthStateChange listener attached successfully.');\\n                } else {\\n                      console.warn('[Script Manager] Failed to get unsubscribe function for auth listener.');\\n                }\\n            } catch (e) {\\n                console.error(\\\"[Script Manager] Error attaching auth listener:\\\", e);\\n            }\\n        } else if (window.__supabaseReady) {\\n             // If Supabase is marked as ready but client/method is missing, log a warning\\n             console.warn(\\\"[Script Manager] Cannot setup auth listener: Supabase client/method not available even after ready signal.\\\");\\n        } else {\\n             // If Supabase not ready yet, listener will be set up later\\n             console.log(\\\"[Script Manager] Deferring auth listener setup until Supabase is ready.\\\");\\n        }\\n    } // --- End setupAuthListener ---\\n\\n    let listenerAttached = false; // Track if listener is active\\n\\n\\n    // --- Monkey-Patch pushState & Add popstate Listener (only once) ---\\n    if (!window.__framerRedirectManagerPatched) {\\n        const originalPushState = history.pushState;\\n        history.pushState = function(...args) {\\n            const urlBefore = window.location.pathname + window.location.search;\\n            originalPushState.apply(history, args);\\n            const urlAfter = window.location.pathname + window.location.search;\\n            if (urlBefore !== urlAfter) {\\n                console.log('[Script Manager] history.pushState detected! Path changed. Running checks.');\\n                runChecks('pushState');\\n            }\\n        };\\n        window.addEventListener('popstate', () => {\\n             console.log('[Script Manager] popstate detected! Running checks.');\\n             runChecks('popstate');\\n        });\\n        window.__framerRedirectManagerPatched = true;\\n        console.log('[Script Manager] History patched and popstate listener added.');\\n    } else {\\n         console.log('[Script Manager] History already patched.');\\n    }\\n\\n\\n    // --- Initial Setup Logic ---\\n    function initializeManager() {\\n        console.log('[Script Manager] Initializing manager checks and listener setup...');\\n        runChecks('Initial Load - Ready'); // Run initial checks now\\n        setupAuthListener(); // Attempt to setup listener now that client should be ready\\n    }\\n\\n    // Run init logic only after Supabase init script signals readiness\\n    if (window.__supabaseReady) {\\n        console.log('[Script Manager] Initial load: Supabase already ready.');\\n        initializeManager();\\n    } else {\\n        console.log('[Script Manager] Initial load: Waiting for supabaseInitialized event.');\\n        window.addEventListener('supabaseInitialized', () => {\\n            console.log('[Script Manager] supabaseInitialized event received.');\\n            initializeManager();\\n        }, { once: true });\\n        // No timeout needed here, wait for the event dispatched by the init script\\n    }\\n\\n  })();\\n</script>\",description:\"Ride is a revolutionary cycling computer powered by your iPhone. Transform your rides with Real-Time Power and personalised displays. Download on the app store and get the best out of every ride.\",favicon:\"https://framerusercontent.com/assets/XlxK1O8Y05DTkhyotQWWWUCV0.png\",robots:\"max-image-preview:large\",socialImage:\"https://framerusercontent.com/assets/bihEgy3cbzmqIvVpabK3xx6zL8.png\",title:\"Ride \u2013 Know Your Power\"};}export const metadataVersion=1;\nexport const __FramerMetadata__ = {\"exports\":{\"metadataVersion\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],
  "mappings": "yCAAAA,IACe,SAARC,EAA0BC,EAAOC,EAAa,CAAC,MAAM,CAAC,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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