import{cz as t,t as d}from"./index-c62ac197.js";import{A as l}from"./ApiService-2b99757f.js";async function m(s,e,o,u,n,i,c){return(await t.apiV10CourseAddCoursePost(s,e,o,u,n,i,c)).data}async function w(s){return(await t.apiV10CourseGetCoursePost()).data}async function U(s){return(await t.apiV10CourseGetCourseByIdIdGet(s)).data}async function v(s,e,o,u,n,i,c,p,r){return(await t.apiV10CourseUpdateCourseCourseIdPost(s,e,o,u,n,i,c,p,r)).data}async function y(s){return(await t.apiV10CourseDeleteCourseCourseIdPost(s)).data}async function I(s,e){return(await t.apiV10CourseAddCourseSectionCourseIdPost(s,e)).data}async function V(s,e){var p;const o=new FormData;o.append("Title",e.title),e.duration&&o.append("Duration",e.duration),e.videoUrl&&o.append("VideoUrl",e.videoUrl),e.description&&o.append("Description",e.description);const u=/(?:https?:\/\/)?(?:www\.|player\.)?vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/(?:[^\/]*)\videos\/|album\/(?:\d+)\/video\/|video\/|)(\d+)(?:[a-zA-Z0-9_\-]+)?/i,n=e.videoUrl.match(u),i=n?n[1]:(p=e.videoUrl.match(/(\d+)/))==null?void 0:p[1];return i&&o.append("videoId",i),e.resources&&e.resources.length>0&&e.resources.forEach((r,a)=>{r.title&&o.append(`Resources[${a}].Title`,r.title),r.resourceUrl&&o.append(`Resources[${a}].ResourceUrl`,r.resourceUrl),r.resourceFile instanceof File&&o.append(`Resources[${a}].ResourceFile`,r.resourceFile),r.resourceId&&o.append(`Resources[${a}].ResourceId`,r.resourceId)}),(await l.fetchData({url:`${d.apiBaseUrl}/api/v1.0/Course/AddCourseMaterial/${s}`,method:"POST",headers:{"Content-Type":"multipart/form-data"},data:o})).data}async function h(s,e){return(await t.apiV10CourseUpdateCourseSectionSectionIdPost(s,e)).data}async function R(s){return(await t.apiV10CourseDeleteCourseSectionSectionIdPost(s)).data}async function D(s,e){var p;const o=new FormData;o.append("Title",e.title),e.duration&&o.append("Duration",e.duration),e.videoUrl&&o.append("VideoUrl",e.videoUrl),e.description&&o.append("Description",e.description);const u=/(?:https?:\/\/)?(?:www\.|player\.)?vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/(?:[^\/]*)\videos\/|album\/(?:\d+)\/video\/|video\/|)(\d+)(?:[a-zA-Z0-9_\-]+)?/i,n=e.videoUrl.match(u),i=n?n[1]:(p=e.videoUrl.match(/(\d+)/))==null?void 0:p[1];return i&&o.append("videoId",i),e.resources&&e.resources.length>0&&e.resources.forEach((r,a)=>{r.title&&o.append(`Resources[${a}].Title`,r.title),r.resourceUrl&&o.append(`Resources[${a}].ResourceUrl`,r.resourceUrl),r.resourceFile instanceof File&&o.append(`Resources[${a}].ResourceFile`,r.resourceFile),r.resourceId&&o.append(`Resources[${a}].ResourceId`,r.resourceId)}),(await l.fetchData({url:`${d.apiBaseUrl}/api/v1.0/Course/UpdateCourseMaterial/${s}`,method:"POST",headers:{"Content-Type":"multipart/form-data"},data:o})).data}async function P(s){return(await t.apiV10CourseDeleteCourseMaterialMaterialIdPost(s)).data}async function S(s){return(await t.apiV10CourseGetVimeoDetailVideoIdGet(s)).data}async function A(s){return(await t.apiV10CourseReorderCourseSectionsPost(s)).data}async function O(s){return(await t.apiV10CourseReorderCourseMaterialsPost(s)).data}async function $(s){return(await t.apiV10CourseGetCourseOptionsCourseIdGet(s)).data}async function G(s,e){return(await t.apiV10CourseAddCourseOptionCourseIdPost(s,e)).data}async function F(s,e){return(await t.apiV10CourseUpdateCourseOptionOptionIdPost(s,e)).data}async function M(s){return(await t.apiV10CourseDeleteCourseOptionsOptionIdPost(s)).data}export{w as a,v as b,m as c,y as d,U as e,$ as f,S as g,R as h,P as i,I as j,V as k,D as l,h as m,A as n,O as o,G as p,F as q,M as r};
