import{R as I,d$ as E,dk as N,j as S,h as t,i as n,e7 as c,fd as g,dl as r,dm as R,fb as F,S as v,e0 as C}from"./app-BgLa5dit.js";import{u as U}from"./8Im-OACs.chunk.js";import{E as V,C as Y}from"./7ILDX1zd.chunk.js";import"./g56uS58q.chunk.js";import"./B5-QmNlz.chunk.js";import"./CPYC3VpT.chunk.js";import"./CJkmdwb7.chunk.js";import"./CTg_3F42.chunk.js";const w={[r.Clips]:{matrixObjectType:c.Clip,appChannel:n.CLIPS,editAction:t.Clips.EDIT_CLIP_CLASSIFICATIONS,audienceAction:t.Clips.EDIT_CLIP_AUDIENCES},[r.Series]:{matrixObjectType:c.Series,appChannel:n.SERIES,editAction:t.Series.EDIT_SERIES,audienceAction:t.Series.EDIT_SERIES_AUDIENCES},[r.Playlists]:{matrixObjectType:c.Playlist,appChannel:n.PLAYLISTS,editAction:t.Playlists.EDIT_PLAYLIST,audienceAction:t.Playlists.EDIT_PLAYLIST_AUDIENCES},[r.Interactives]:{matrixObjectType:c.Interactive,appChannel:n.INTERACTIVES,editAction:t.Interactives.EDIT_INTERACTIVE_CLASSIFICATIONS,audienceAction:t.Interactives.EDIT_INTERACTIVE_AUDIENCES}};function K(u){const{presentationId:p,classificationId:s,memberType:a}=u,i=w[a],[m,A]=I.useState(),[o,d]=I.useState(),[b,f]=I.useState();E(C.getPresentationFetchOptions(p,A),[]),E(C.getClassificationFetchOptions(s,d),[s]),E(C.getAudiencesFetchOptions(p,f),[s]);const h=N();function l(e){return v.classificationMembers(s,a,p,e)}function T(e){h(l(e))}const{items:x,isFetching:j,hasMore:_,nextCursor:y}=U(l,T);if(!i)return S.jsx(S.Fragment,{});function O(e){return[R.buildMemberAction({actionName:"remove",application:n.SUBJECTS,action:t.Subjects,subjectId:s,ownerType:F.Classification,memberType:a,memberId:e.id})]}const P={[i.matrixObjectType]:e=>({application:i.appChannel,action:i.editAction,args:[e.id]}),[`${i.matrixObjectType}:${c.Audience}`]:e=>({application:i.appChannel,action:i.audienceAction,args:[e==null?void 0:e.id]})};function D(e){Y.exportMembers(e,a,o==null?void 0:o.name)}return S.jsx(V,{classificationId:s,memberType:a,presentation:m,classification:o,audiences:b,items:x,isFetching:j,hasMore:_,nextCursor:y,fetchNext:T,columnActions:O,appLinks:P,getTabs:(e,L,M)=>g.getEditClassificationTabs(n.SUBJECTS,e,L,M),onExport:D})}export{K as EditClassificationMembersView};
//# sourceMappingURL=CZxRgkGQ.chunk.js.map
