{"version":3,"file":"AuthRedirectSimple.ajBeDqNe.mjs","names":["useState","createClient","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","window","_e","p","ce","init_framer_CaDWdxiz","addPropertyControls","ControlType","z","init_dist","AuthRedirect","dashboardUrl","DASHBOARD_URL","status","setStatus","supabase","getSupabase","settled","finish","hasSession","listener","event","session","data","timeout","containerStyle","loginUrl","init_AuthRedirectSimple","init_jsx_runtime"],"sources":["https:/framerusercontent.com/modules/sf7dw8SYYwNYK26QN10I/gYcz0jUi9w6zQH48TAq1/AuthRedirectSimple.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";// @ts-ignore\nimport{createClient}from\"@supabase/supabase-js\";const getSupabase=()=>{if(typeof window===\"undefined\")return null;if(!window.__shortlistedSupabase){window.__shortlistedSupabase=createClient(\"https://lmdqrsmubmornufnvjxc.supabase.co\",\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImxtZHFyc211Ym1vcm51Zm52anhjIiwicm9sZSI6ImFub24iLCJpYXQiOjE3ODE5NjUwNzAsImV4cCI6MjA5NzU0MTA3MH0.1Q8S5f5P0tltXuNkxvYFWCUhfAwUDXwGNls_tJYHCWA\");}return window.__shortlistedSupabase;};/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */// Hardcoded rather than left as a configurable prop — there's no\n// legitimate reason this redirect target should ever be anything other\n// than /app, and leaving it overridable is what caused a stray Framer\n// instance setting to silently misroute this page to /dashboard, a page\n// that has never existed in this project.\nconst DASHBOARD_URL=\"/app\";export default function AuthRedirect({loginUrl=\"/login\"}){const dashboardUrl=DASHBOARD_URL;const[status,setStatus]=useState(\"checking\");useEffect(()=>{const supabase=getSupabase();if(!supabase)return;let settled=false;const finish=hasSession=>{if(settled)return;settled=true;if(hasSession){window.location.href=dashboardUrl;}else{setStatus(\"failed\");}};// Supabase's client auto-detects the access_token in the URL hash\n// (detectSessionInUrl is on by default) and fires SIGNED_IN once it\n// has finished establishing the session from the confirmation link.\nconst{data:listener}=supabase.auth.onAuthStateChange((event,session)=>{if(event===\"SIGNED_IN\"&&session){finish(true);}});// Also check directly, in case the session was already established\n// by the time this component mounted (e.g. on a fast reload).\nsupabase.auth.getSession().then(({data})=>{if(data&&data.session)finish(true);});// Fallback: if nothing happened within a few seconds, the link was\n// probably invalid, expired, or already used.\nconst timeout=setTimeout(()=>finish(false),6e3);return()=>{clearTimeout(timeout);if(listener&&listener.subscription){listener.subscription.unsubscribe();}};},[dashboardUrl]);const containerStyle={width:\"100%\",maxWidth:420,margin:\"0 auto\",padding:\"80px 24px\",textAlign:\"center\",fontFamily:'-apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif'};if(status===\"failed\"){return /*#__PURE__*/_jsxs(\"div\",{style:containerStyle,children:[/*#__PURE__*/_jsx(\"div\",{style:{fontSize:22,fontWeight:700,color:\"#111827\",marginBottom:12},children:\"This link isn't working\"}),/*#__PURE__*/_jsx(\"div\",{style:{fontSize:15,color:\"#6B7280\",marginBottom:24,lineHeight:1.6},children:\"It may have expired or already been used. Try logging in directly instead.\"}),/*#__PURE__*/_jsx(\"a\",{href:loginUrl,style:{color:\"#2563EB\",textDecoration:\"none\",fontWeight:500},children:\"Go to login →\"})]});}return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:/*#__PURE__*/_jsx(\"div\",{style:{fontSize:15,color:\"#6B7280\"},children:\"Confirming your account...\"})});}addPropertyControls(AuthRedirect,{loginUrl:{type:ControlType.String,title:\"Login URL\",defaultValue:\"/login\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AuthRedirect\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AuthRed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