import{r as a,m as s}from"./index.lP_uh0LI.js";const o=`${s.knowledge}course/manage/`;function n(r){return a({url:o,method:"get",params:r})}function u(r){return a({url:o,method:"post",data:r})}function d(r){return a({url:o+r.uuid+"/",method:"patch",data:r})}const l=async(r,e)=>{try{const t=await a({url:r,method:"get",params:e});if(t&&t.success&&t.data&&t.data.results.length)return t.data.results}catch(t){console.error(t)}return[]},i=async r=>{try{const e=await a({url:`${o}${r}/content/`,method:"get"});if(e&&e.success&&e.data&&e.data.length)return e.data}catch(e){console.error(e)}return[]},h=async r=>{try{const e=await a({url:`${s.knowledge}course/chapter/manage/`,method:"post",data:r});if(e)return e.success}catch(e){console.error(e)}return!1},g=async(r,e)=>{try{const t=await a({url:`${s.knowledge}course/chapter/manage/${e}/`,method:"patch",data:r});if(t)return t.success}catch(t){console.error(t)}return!1},m=async r=>{try{const e=await a({url:`${s.knowledge}course/chapter/manage/${r}/`,method:"delete"});if(e)return e.success}catch(e){console.error(e)}return!1},p=async r=>{try{const e=await a({url:`${s.knowledge}course/period/manage/${r}/`,method:"get"});if(e&&e.success&&e.data)return e.data}catch(e){console.error(e)}},f=async r=>{try{const e=await a({url:`${s.knowledge}course/period/manage/`,method:"post",data:r});if(e)return e.success}catch(e){console.error(e)}return!1},y=async(r,e)=>{try{const t=await a({url:`${s.knowledge}course/period/manage/${e}/`,method:"patch",data:r});if(t)return t.success}catch(t){console.error(t)}return!1},w=async r=>{try{const e=await a({url:`${s.knowledge}course/period/manage/${r}/`,method:"delete"});if(e)return e.success}catch(e){console.error(e)}return!1},$=async r=>{try{const e=await a({url:`${s.knowledge}course/manage/drag/`,method:"post",data:r});if(e)return e.success}catch(e){console.error(e)}return!1},D=async r=>{try{const e=await a({url:`${s.knowledge}course/manage/${r}/get_period_nums/`,method:"get"});if(e&&e.success)return e.data}catch(e){console.error(e)}return 0};export{u as A,n as G,d as U,p as a,f as b,D as c,g as d,h as e,l as f,i as g,m as h,w as i,$ as s,y as u};
