{"version":3,"file":"ProtectedPage.DMXgPIum.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/q5ZR3UEGEpZNyewFJvnW/wZfPiC6OioLuDKg4yI5A/ProtectedPage.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{supabase}from\"https://framerusercontent.com/modules/xcIapRS8z41Gs2D6gsQG/LUyJw1KDtvTLbu4vOH7m/SupabaseClient.js\";export function withAuthGuard(Component){return props=>{const[checking,setChecking]=useState(true);useEffect(()=>{async function checkSession(){const{data}=await supabase.auth.getSession();if(!data.session){window.location.href=window.location.origin+\"/sign-up\";}else{setChecking(false);}}checkSession();const{data:listener}=supabase.auth.onAuthStateChange((event,session)=>{if(!session){window.location.href=window.location.origin+\"/sign-up\";}});return()=>{listener.subscription.unsubscribe();};},[]);if(checking){return null;}return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withAuthGuard\":{\"type\":\"reactHoc\",\"name\":\"withAuthGuard\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"4LAAyM,SAAgB,EAAc,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAS,GAAaA,EAAS,EAAI,EAA+a,OAA7a,MAAc,CAAC,eAAe,GAAc,CAAC,GAAK,CAAC,QAAM,MAAM,EAAS,KAAK,WAAW,EAAM,EAAK,QAAsE,EAAY,EAAK,EAA9E,EAAO,SAAS,KAAK,EAAO,SAAS,OAAO,UAAqC,CAAC,EAAa,EAAE,GAAK,CAAC,KAAK,GAAU,EAAS,KAAK,mBAAmB,EAAM,IAAU,CAAK,IAAS,EAAO,SAAS,KAAK,EAAO,SAAS,OAAO,WAAY,CAAC,EAAE,UAAU,CAAC,EAAS,aAAa,YAAY,CAAE,CAAE,EAAE,CAAC,CAAC,EAAK,EAAiB,KAA0B,EAAK,EAAU,CAAC,GAAG,CAAK,CAAC,CAAE,CAAE,qBAAhuB,IAAsC,IAAwH"}