{"version":3,"file":"Memberstack.Dfbl8DaT.mjs","names":["useState","__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/YyMi4K96eaVZb4gvaYJi/leOvJcFbSxhGwj6QIixv/Memberstack.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";const getMemberstack=()=>typeof window!==\"undefined\"?window.$memberstackDom:null;function useMember(){const[member,setMember]=useState(null);useEffect(()=>{const ms=getMemberstack();if(!ms)return;ms.getCurrentMember().then(res=>{setMember(res?.data||null);});},[]);return member;}export function LoginModal(){const member=useMember();return{children:member?\"Hesabım\":\"Giriş Yap\",onClick:async event=>{event.preventDefault();event.stopPropagation();const ms=getMemberstack();if(!ms)return;if(member){window.location.href=\"/account\";}else{await ms.openModal(\"LOGIN\");window.location.reload();}}};}export function SignupModal(){const member=useMember();return{children:member?\"\\xc7ıkış Yap\":\"Kayıt Ol\",onClick:async event=>{event.preventDefault();event.stopPropagation();const ms=getMemberstack();if(!ms)return;if(member){await ms.logout();window.location.reload();}else{await ms.openModal(\"SIGNUP\");}}};}export function CheckLoginState(){return{onClick:async()=>{const ms=getMemberstack();if(!ms){alert(\"Memberstack bulunamadı\");return;}const res=await ms.getCurrentMember();const member=res?.data||null;alert(member?\"LOGIN OLUNMUŞ\":\"LOGIN OLUNMAMIŞ\");}};}export function AccountName(){const member=useMember();const firstName=member?.customFields?.[\"first-name\"]||\"\";return{children:firstName?`Hoş geldin ${firstName}`:\"Hoş geldin\",style:{fontSize:24,fontWeight:600,color:\"#000000\",lineHeight:\"1.2em\"}};}export function AccountEmail(){const member=useMember();return{children:member?.auth?.email||\"Y\\xfckleniyor...\",style:{fontSize:16,fontWeight:400,color:\"#000000\",lineHeight:\"1.3em\"}};}export function AccountLogout(){return{onClick:async event=>{event.preventDefault();event.stopPropagation();const ms=getMemberstack();if(!ms)return;await ms.logout();window.location.href=\"/\";},style:{cursor:\"pointer\"}};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withLoginModal(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...LoginModal(props)});};}withLoginModal.displayName=\"LoginModal\";export function withSignupModal(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...SignupModal(props)});};}withSignupModal.displayName=\"SignupModal\";export function withCheckLoginState(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...CheckLoginState(props)});};}withCheckLoginState.displayName=\"CheckLoginState\";export function withAccountName(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...AccountName(props)});};}withAccountName.displayName=\"AccountName\";export function withAccountEmail(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...AccountEmail(props)});};}withAccountEmail.displayName=\"AccountEmail\";export function withAccountLogout(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...AccountLogout(props)});};}withAccountLogout.displayName=\"AccountLogout\";\nexport const __FramerMetadata__ = {\"exports\":{\"withLoginModal\":{\"type\":\"reactHoc\",\"name\":\"withLoginModal\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"CheckLoginState\":{\"type\":\"override\",\"name\":\"CheckLoginState\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountLogout\":{\"type\":\"reactHoc\",\"name\":\"withAccountLogout\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"AccountEmail\":{\"type\":\"override\",\"name\":\"AccountEmail\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"LoginModal\":{\"type\":\"override\",\"name\":\"LoginModal\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"SignupModal\":{\"type\":\"override\",\"name\":\"SignupModal\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"AccountLogout\":{\"type\":\"override\",\"name\":\"AccountLogout\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountName\":{\"type\":\"reactHoc\",\"name\":\"withAccountName\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"AccountName\":{\"type\":\"override\",\"name\":\"AccountName\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSignupModal\":{\"type\":\"reactHoc\",\"name\":\"withSignupModal\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCheckLoginState\":{\"type\":\"reactHoc\",\"name\":\"withCheckLoginState\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountEmail\":{\"type\":\"reactHoc\",\"name\":\"withAccountEmail\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Memberstack.map"],"mappings":"+LAAkK,SAAS,GAAW,CAAC,GAAK,CAAC,EAAO,GAAWA,EAAS,KAAK,CAA6H,OAA5H,MAAc,CAAC,IAAM,EAAG,GAAgB,CAAK,GAAU,EAAG,kBAAkB,CAAC,KAAK,GAAK,CAAC,EAAU,GAAK,MAAM,KAAK,EAAG,EAAG,EAAE,CAAC,CAAQ,EAAQ,SAAgB,GAAY,CAAC,IAAM,EAAO,GAAW,CAAC,MAAM,CAAC,SAAS,EAAO,UAAU,YAAY,QAAQ,KAAM,IAAO,CAAC,EAAM,gBAAgB,CAAC,EAAM,iBAAiB,CAAC,IAAM,EAAG,GAAgB,CAAK,IAAa,EAAQ,EAAO,SAAS,KAAK,YAAiB,MAAM,EAAG,UAAU,QAAQ,CAAC,EAAO,SAAS,QAAQ,IAAI,CAAE,SAAgB,GAAa,CAAC,IAAM,EAAO,GAAW,CAAC,MAAM,CAAC,SAAS,EAAO,YAAe,WAAW,QAAQ,KAAM,IAAO,CAAC,EAAM,gBAAgB,CAAC,EAAM,iBAAiB,CAAC,IAAM,EAAG,GAAgB,CAAK,IAAa,GAA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