import{u as a,a as o,b as u}from"./vendor-query-BbgYCJYB.js";import{d as i,e as t}from"./index-BoGb7ncW.js";import{i as r}from"./vendor-i18n-DzUOdQ2j.js";function g(){return a({queryKey:["sessions"],queryFn:()=>t.get("/sessions").then(e=>e.data)})}function l(e){return a({queryKey:["sessions",e,"messages"],queryFn:()=>t.get(`/sessions/${encodeURIComponent(e)}/messages`).then(s=>s.data),enabled:!!e})}function q(){const e=o();return u({mutationFn:s=>t.delete(`/sessions/${encodeURIComponent(s)}`).then(n=>n.data),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]}),i.success(r.t("chat.sessionDeleted"))}})}function p(){const e=o();return u({mutationFn:({key:s,index:n})=>t.delete(`/sessions/${encodeURIComponent(s)}/messages/${n}`).then(c=>c.data),onSuccess:(s,n)=>{e.invalidateQueries({queryKey:["sessions",n.key,"messages"]}),e.invalidateQueries({queryKey:["sessions"]}),i.success(r.t("chat.messageRevoked","Message revoked"))}})}export{p as a,l as b,q as c,g as u};
