import{aT as m,aP as p,l as g,o as C,w as M,aD as P,d_ as w,d$ as I,e0 as R,a8 as u,dm as n,j as s,E as A,a9 as c,dl as i,S as d,s as B,e1 as k,aQ as q}from"./app-BgLa5dit.js";import{P as D}from"./DUyf8veO.chunk.js";function F(e,t){switch(e){case i.Playlists:return D.playlist(t);case i.Series:return k.series(t);case i.Videos:return B.video(t);case i.Clips:case i.Interactives:return d.member(t)}}function E(e){const[t,b]=m.useState(),[h,y]=m.useState(!1),f=p(),j=g(),a=Array.isArray(e.memberId),r=Array.isArray(e.memberId)?e.memberId:[e.memberId],o=C(!a&&F(e.memberType,M.first(r))),x=P(w.SUBJECT);I(R.getClassificationFetchOptions(e.classificationId,b),[e.classificationId]);const S=()=>{y(!0),q(f,d.removeObjectsFromClassification(e.classificationId,r,e.memberType,e.closePopup,e.closePopup)),t.pinnedVideoMasterId===e.memberId&&x.updateClassification(e.classificationId,{...t,pinnedVideoMasterId:null}),j.success(`${u.toTitleCase(n.singularizeMemberType(e.memberType))} has been successfully removed`)},l=a?!!t:!!t&&!!o.data,v=a?"Bulk remove":`Remove ${u.toTitleCase(n.singularizeMemberType(e.memberType))}`,T=a&&r.length>1?n.pluralizeMemberType(e.memberType):n.singularizeMemberType(e.memberType);return s.jsx(A,{title:v,closePopup:e.closePopup,showLoadingSpinner:!l,children:l&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[a?s.jsxs("p",{children:["Are you sure you want to bulk remove ",s.jsx("strong",{children:r.length})," ",T," from ",s.jsx("strong",{children:t.name}),"?"]}):s.jsxs("p",{children:["Are you sure you want to remove ",s.jsx("strong",{children:o.data.name})," from ",s.jsx("strong",{children:t.name}),"?"]}),s.jsxs("p",{children:["This will not remove ",a?"them":"it"," from the backbone subject."]})]}),s.jsxs(c,{children:[s.jsx(c.Cancel,{onClick:e.closePopup}),s.jsx(c.Submit,{variant:"danger",onClick:S,text:"Remove",showSpinner:h})]})]})})}export{E as RemoveClassificationMemberView};
//# sourceMappingURL=B7h9-Id1.chunk.js.map
