import{u as c,a as i,b as u}from"./vendor-query-BbgYCJYB.js";import{d as a,e as l}from"./index-BoGb7ncW.js";import{i as r}from"./vendor-i18n-DzUOdQ2j.js";function y(){return c({queryKey:["skills"],queryFn:()=>l.get("/skills").then(e=>e.data)})}function q(e){return c({queryKey:["skills",e],queryFn:()=>l.get(`/skills/${e}`).then(s=>s.data),enabled:!!e})}function S(){const e=i();return u({mutationFn:s=>l.post("/skills",s).then(t=>t.data),onSuccess:()=>{e.invalidateQueries({queryKey:["skills"]}),a.success(r.t("skills.created"))}})}function f(){const e=i();return u({mutationFn:({name:s,content:t})=>l.put(`/skills/${s}`,{content:t}).then(n=>n.data),onSuccess:(s,{name:t})=>{e.invalidateQueries({queryKey:["skills"]}),e.invalidateQueries({queryKey:["skills",t]}),a.success(r.t("skills.saved"))}})}function p(){const e=i();return u({mutationFn:s=>l.delete(`/skills/${s}`).then(t=>t.data),onSuccess:()=>{e.invalidateQueries({queryKey:["skills"]}),a.success(r.t("skills.deleted"))}})}function m(){const e=i();return u({mutationFn:({name:s,enabled:t})=>l.post(`/skills/${s}/toggle`,{enabled:t}).then(n=>n.data),onSuccess:()=>{e.invalidateQueries({queryKey:["skills"]})}})}export{S as a,f as b,p as c,m as d,q as e,y as u};
