import{bc as r,a7 as i,e2 as y}from"./app-BgLa5dit.js";const p={playlists(e="1"){return{key:`playlists:${e}`,url:`/ajax/playlists/curators?page=${e}`,formatData:y.convertLegacyPaginatedCollection}},searchPlaylists(e,a){let t=`/api/domain/v1/search/playlists?query=${e}`;return a&&(t+=`&filter={page:${a}}`),{key:`playlists:search:${e}${a?`:${a}`:""}`,url:t,formatData:y.convertLegacyPaginatedCollection}},playlist(e){return{key:`playlist:${e}`,url:`/ajax/playlists/${e}?query=cover,banner,owner`}},playlistsById(e){const a=e.slice().sort();return{key:`playlists:${a.join(",")}`,url:`/api/master/v2/objects?${a.map(t=>`id=${t}`).join("&")}`}},videoPlaylists(e,a){return{url:i.urlBuilder(`/api/master/v2/objects/${e}/playlists`,{query:"{permissions.value:'protected'}cover,banner",cursor:a}),key:`video:${e}:playlists${a?`:${a}`:""}`}},createPlaylist(e,a,t,l){return{url:"/ajax/playlists",key:"playlist",data:e,type:r.POST,invalidationKeys:"playlists",success:a,error:t,always:l}},updatePlaylist(e,a,t,l,s){return{url:`/ajax/v2/playlists/${e}`,key:`update:playlist:${e}`,data:a,type:r.PUT,success:t,error:l,always:s}},deletePlaylist(e,a,t,l){return{url:`/ajax/playlists/${e}`,key:`delete:playlist:${e}`,type:r.DELETE,invalidationKeys:"playlists",success:a,error:t,always:l}},playlistVideos(e){return{key:`playlist:${e}:videos`,url:`/api/master/v2/objects/${e}/videos?query={orderBy:orderindex,limit:100}`}},playlistVideosWithMetadata(e,a){return{key:`playlist:${e}:videos:metadata`,url:`/api/master/v2/objects/${e}/videos?query={orderBy:orderindex,limit:100}thumbnail,subjectPresentationAudiences{presentationId:${a}}`}},reorderVideos(e,a,t,l){return{key:"reorder:playlist",url:`/ajax/playlists/${e}/reorder`,data:a,type:r.PUT,invalidationKeys:`playlist:${e}:videos`,success:t,error:l}},removeVideo(e,a,t,l,s){return{key:"remove:playlist:video",url:`/ajax/playlists/${e}/dissociate`,data:[a],type:r.POST,invalidationKeys:[`playlist:${e}:videos`,`video:${a}:playlists`],success:t,error:l,always:s}},metadataByIds(e,a,t,l){return{key:`playlist:metadata:${e.join(",")}`,url:i.urlBuilder("/ajax/playlists/metadata",{ids:e}),success:a,error:t,always:l}},dashboard(e,a,t,l){return{key:`dashboards:${e}`,url:`/ajax/dashboards/${e}`,success:a,error:t,always:l}},dashboardWidget(e,a,t,l,s){return{key:`dashboard:${e}:widget:${a}`,url:`/ajax/dashboards/${e}/widgets/${a}`,success:t,error:l,always:s}},dashboardWidgets(e,a,t,l){return{key:`playlist:${e}:widgets`,url:`/ajax/playlists/${e}/widgets`,success:a,error:t,always:l}},deleteWidget(e,a,t,l,s,o){return{key:`dashboard:${e}:widget:${a}`,url:`/ajax/dashboards/${e}/widgets/${a}`,type:r.DELETE,invalidationKeys:`playlist:${t}:widgets`,formatData:()=>null,success:l,error:s,always:o}}};export{p as P};
//# sourceMappingURL=DUyf8veO.chunk.js.map
