{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/LiOJ06ylhoquqDuTrpxC/Bf4Sn2TfoZtlOFK0UqbZ/AuthGuard.js"],
  "sourcesContent": ["\"use client\"// Ensure client-side rendering\n;import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{Frame,addPropertyControls,ControlType,RenderTarget}from\"framer\";import{supabase}from\"https://framerusercontent.com/modules/oBhMgUIMQDqp7WeROMlE/h697GfHe7zuqdTwmYEqg/supabase.js\";// Adjust path if needed, with .ts extension\nexport function AuthGuard(props){const[user,setUser]=React.useState(null);const[loading,setLoading]=React.useState(true);const[error,setError]=React.useState(null);const isDesignMode=RenderTarget.current()===RenderTarget.canvas;React.useEffect(()=>{if(isDesignMode){setLoading(false);return;}const checkSession=async()=>{const{data:{session}}=await supabase.auth.getSession();if(!session?.user){setError(\"Please log in to access this page.\");if(typeof window!==\"undefined\"){window.location.href=\"/account/login\"// Redirect to login page\n;}}else{setUser(session.user);}setLoading(false);};checkSession();},[isDesignMode]);if(loading){return /*#__PURE__*/_jsx(Frame,{...props,children:/*#__PURE__*/_jsx(\"div\",{children:\"Loading...\"})});}if(isDesignMode){return /*#__PURE__*/_jsx(Frame,{...props,children:/*#__PURE__*/_jsx(\"div\",{children:\"Design Mode - Protected Page\"})});}if(!user){return /*#__PURE__*/_jsx(Frame,{...props,children:/*#__PURE__*/_jsx(\"div\",{children:error||\"Redirecting to login...\"})});}return /*#__PURE__*/_jsx(Frame,{...props,style:{minWidth:\"300px\",minHeight:\"200px\",...props.style},children:props.children});}addPropertyControls(AuthGuard,{children:{type:ControlType.ComponentInstance,title:\"Protected Content\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"AuthGuard\":{\"type\":\"reactComponent\",\"name\":\"AuthGuard\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AuthGuard.map"],
  "mappings": "qKAEO,SAASA,EAAUC,EAAM,CAAC,GAAK,CAACC,EAAKC,CAAO,EAAQC,EAAS,IAAI,EAAO,CAACC,EAAQC,CAAU,EAAQF,EAAS,EAAI,EAAO,CAACG,EAAMC,CAAQ,EAAQJ,EAAS,IAAI,EAAQK,EAAaC,EAAa,QAAQ,IAAIA,EAAa,OACzI,OADsJC,EAAU,IAAI,CAAC,GAAGF,EAAa,CAACH,EAAW,EAAK,EAAE,MAAO,EAAoB,SAAS,CAAC,GAAK,CAAC,KAAK,CAAC,QAAAM,CAAO,CAAC,EAAE,MAAMC,EAAS,KAAK,WAAW,EAAMD,GAAS,KAC7XT,EAAQS,EAAQ,IAAI,GAD+WJ,EAAS,oCAAoC,EAAK,OAAOM,EAAS,MAAaA,EAAO,SAAS,KAAK,mBAChdR,EAAW,EAAK,CAAE,GAAe,CAAE,EAAE,CAACG,CAAY,CAAC,EAAKJ,EAA6BU,EAAKC,EAAM,CAAC,GAAGf,EAAM,SAAsBc,EAAK,MAAM,CAAC,SAAS,YAAY,CAAC,CAAC,CAAC,EAAMN,EAAkCM,EAAKC,EAAM,CAAC,GAAGf,EAAM,SAAsBc,EAAK,MAAM,CAAC,SAAS,8BAA8B,CAAC,CAAC,CAAC,EAAOb,EAAoJa,EAAKC,EAAM,CAAC,GAAGf,EAAM,MAAM,CAAC,SAAS,QAAQ,UAAU,QAAQ,GAAGA,EAAM,KAAK,EAAE,SAASA,EAAM,QAAQ,CAAC,EAAjOc,EAAKC,EAAM,CAAC,GAAGf,EAAM,SAAsBc,EAAK,MAAM,CAAC,SAASR,GAAO,yBAAyB,CAAC,CAAC,CAAC,CAAgI,CAACU,EAAoBjB,EAAU,CAAC,SAAS,CAAC,KAAKkB,EAAY,kBAAkB,MAAM,mBAAmB,CAAC,CAAC",
  "names": ["AuthGuard", "props", "user", "setUser", "ye", "loading", "setLoading", "error", "setError", "isDesignMode", "RenderTarget", "ue", "session", "supabase", "window", "p", "Frame", "addPropertyControls", "ControlType"]
}
