'use strict';
import { emptyUuid } from '../constants/constants.js';
import { setLocalStorage, getLocalStorage, removeLocalStorage } from '../local-storage/local-storage.js';
import { publicImages } from '../constants/public-files.js';
import { fileExtensionsWithoutDot } from '../../base-repo/app-constants/internal-system-constants.js';
import { getSessionStorage, setSessionStorage, removeSessionStorage } from './session-storage.js';

var __defProp=Object['defineProperty'],__name=(_0x845dff,_0x4f742e)=>__defProp(_0x845dff,'name',{'value':_0x4f742e,'configurable':!![]});const loginStateKey='LoginState',afterLoginRedirectUrlKey='AfterLoginRedirectUrl';function isLoggedIn(){return getLoginState()['loggedIn'];}__name(isLoggedIn,'isLoggedIn');function setLoginState(_0x468a28){setLocalStorage(loginStateKey,_0x468a28);}__name(setLoginState,'setLoginState');function getLoginState(){return getLocalStorage(loginStateKey)??getEmptyLoginState();}__name(getLoginState,'getLoginState');function removeLoginState(){removeLocalStorage(loginStateKey);}__name(removeLoginState,'removeLoginState');function getAfterLoginRedirectUrl(){return getSessionStorage(afterLoginRedirectUrlKey);}__name(getAfterLoginRedirectUrl,'getAfterLoginRedirectUrl');function setAfterLoginRedirectUrl(){const _0x472872=(window['location']['pathname']+window['location']['search'])['slice'](0x7e7+0x7a*-0x47+0x14c*0x14);setSessionStorage(afterLoginRedirectUrlKey,_0x472872);}__name(setAfterLoginRedirectUrl,'setAfterLoginRedirectUrl');function removeAfterLoginRedirectUrl(){removeSessionStorage(afterLoginRedirectUrlKey);}__name(removeAfterLoginRedirectUrl,'removeAfterLoginRedirectUrl');function getEmptyLoginState(){const _0x2d8901={'email':'','loggedIn':![],'displayName':'','userId':emptyUuid,'imageUrl':'/'+publicImages['user']+'/'+emptyUuid+'.'+fileExtensionsWithoutDot['webp']};return _0x2d8901;}__name(getEmptyLoginState,'getEmptyLoginState');

export { getAfterLoginRedirectUrl, getLoginState, isLoggedIn, removeAfterLoginRedirectUrl, removeLoginState, setAfterLoginRedirectUrl, setLoginState };
