import{m as u,p as o}from"./entry.17a5c52f.js";import{a}from"./js.cookie.cf83ad76.js";const i={Guest:10,Free:20,Premium:90},n=u("auth",{state:()=>({auth:{id:0,token:"",email:"",name:"",role:i.Guest,planId:0,expiry:0}}),getters:{isLogin:t=>t.auth.token!=="",isGuest:t=>t.auth.role===i.Guest,isFree:t=>t.auth.role===i.Free,isPremium:t=>t.auth.role===i.Premium,getId:t=>t.auth.id,getEmail:t=>t.auth.email,getToken:t=>t.auth.token,getRole:t=>t.auth.role,getExpiry:t=>t.auth.expiry??0},actions:{login(t){this.auth=t},setPlan(t,e,s){this.auth.planId=t,this.auth.role=e,this.auth.expiry=s},logout(){this.auth.id=0,this.auth.token="",this.auth.email="",this.auth.name="",this.auth.role=i.Guest,this.auth.planId=0,this.auth.expiry=0}},persist:{storage:{getItem:t=>{{const e=a.get(t);return e!==void 0?e:null}},setItem:(t,e)=>{const s=o();a.set(t,e,{expires:1,secure:s.public.IS_SSL,sameSite:"strict"})}}}});export{i as U,n as u};
