import{a as e,g as t,s as n,t as r}from"./api-Duu96wkE.js";import{G as i}from"./index-DyQEyT-0.js";function a(n){return e({queryKey:[`training`,`programs`,n],queryFn:async()=>{let e=await r.get(`/training-programs`,{params:n}),t=e.data.meta;return{programs:e.data.data,meta:t}},placeholderData:t})}function o(t){return e({queryKey:[`training`,`programs`,t],queryFn:async()=>(await r.get(`/training-programs/${t}`)).data.data,enabled:!!t})}function s(t){return e({queryKey:[`applicants`,t,`training`],queryFn:async()=>(await r.get(`/applicants/${t}/training`)).data.data,enabled:!!t})}function c(e){let t=n();return i({mutationFn:e,onSuccess:()=>{t.invalidateQueries({queryKey:[`training`]}),t.invalidateQueries({queryKey:[`applicants`]})}})}function l(){return c(e=>r.post(`/training-programs`,e))}function u(){return c(({programId:e,applicantId:t})=>r.post(`/training-programs/${e}/enrol`,{applicant_id:t}))}function d(){return c(({id:e,status:t})=>r.post(`/training-programs/${e}/status`,{status:t}))}function f(){return c(({id:e,...t})=>r.post(`/training-participants/${e}/outcome`,t))}function p(){return c(e=>r.post(`/training-participants/${e}/certificate`))}export{d as a,a as c,p as i,l as n,f as o,u as r,o as s,s as t};