import{a7 as o,a8 as i,y as l,ab as c}from"./main-CJbVOHh0.js";const n=()=>o.post("admin/franchise/clear-cache"),h=()=>o.post("admin/clear-cache"),p=i("cache",{state:()=>({loading:!1,error:null}),actions:{async clearCache(){var a,r,s,t;this.loading=!0,this.error=null;try{return((r=(a=l().user)==null?void 0:a.data)==null?void 0:r.role)==="super_admin"?await h():await n(),localStorage.clear(),c("success","","Cache cleared successfully"),window.location.reload(),!0}catch(e){return this.error=((t=(s=e.response)==null?void 0:s.data)==null?void 0:t.message)||e.message,c("error","",this.error||"Failed to clear cache"),!1}finally{this.loading=!1}}}});export{p as u};
