import{aT as c,o as v,aD as S,d_ as j,d$ as x,e0 as T,a8 as y,gp as o,j as s,E as g,a9 as a,go as n,S as u,s as P,e1 as w}from"./app-BgLa5dit.js";import{P as R}from"./DUyf8veO.chunk.js";function f(e,t){switch(e){case n.Playlists:return R.playlist(t);case n.Series:return w.series(t);case n.Videos:return P.video(t);case n.Clips:return u.member(t);case n.Interactives:return u.member(t)}}function q(e){const[t,l]=c.useState(),[m,d]=c.useState(!1),i=v(f(e.memberType,e.memberId)),b=S(j.SUBJECT);x(T.getAudienceFetchOptions(e.audienceId,l),[e.audienceId]);const h=()=>{d(!0),b.removeObjectsFromAudience(e.audienceId,[e.memberId],e.memberType,null,null,e.closePopup,e.closePopup)},r=!!t&&!!i.data,p=`Remove ${y.toTitleCase(o.singularizeMemberType(e.memberType))}`;return s.jsx(g,{title:p,closePopup:e.closePopup,showLoadingSpinner:!r,children:r&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsxs("p",{children:["Are you sure you want to remove ",s.jsx("strong",{children:i.data.name})," from ",s.jsx("strong",{children:t.name}),"?"]}),s.jsx("p",{children:"This will not remove it from the backbone level."})]}),s.jsxs(a,{children:[s.jsx(a.Cancel,{onClick:e.closePopup}),s.jsx(a.Submit,{variant:"danger",onClick:h,text:`Yes, remove this ${o.singularizeMemberType(e.memberType)}`,showSpinner:m})]})]})})}export{q as RemoveAudienceMemberView};
//# sourceMappingURL=CgLcOqKA.chunk.js.map
