import{aI as m,az as x,n as p,c4 as f,bc as g,ao as e,aF as S,L as A,aq as r,bU as c,m as j,cj as C,A as T,o as L,W as k,E as b,p as w,r as E,v as H,T as I,f as v,e as R}from"./app-k0jcl5PQ.js";const i="playlists.copyPlaylist",n=A.encloseNamespace(i);function q(s){const[u,o]=m.useState(!1),a=x(p.getPlaylist(s.id)),y=f(),l=g();function d(t){o(!1),l.success({type:T.Success,heading:C.Success,message:n("success",{name:a.data.name,escapeText:!0})}),L.logUserAction({id:t.id,originalPlaylistId:s.id,name:t.name},{actionType:E.Copy,location:w.Popup,entity:b.Playlist,workflowPhase:k.Complete}),H.trigger({application:R.PLAYLISTS,action:v.Playlists.PLAYLIST,args:[null,t.id,I.slugify(t.name)]}),s.closePopup()}function P(){o(!1),l.error(n("error",{name:a.data.name,escapeText:!0})),s.closePopup()}function h(){o(!0),j(y,p.copyPlaylist(s.id,d,P))}return e.jsxs(S,{title:n("title"),closePopup:s.closePopup,showLoadingSpinner:!a.data,children:[e.jsx("p",{children:e.jsx(r,{namespace:i,phrase:"body1"})}),e.jsx("p",{children:e.jsx(r,{namespace:i,phrase:"body2",options:{name:a.data.name}})}),e.jsxs(c,{children:[e.jsx(c.Cancel,{onClick:s.closePopup}),e.jsx(c.Submit,{variant:"dark",text:n("copy"),onClick:h,showSpinner:u})]})]})}export{q as CopyPlaylistView};
//# sourceMappingURL=RaAbW_Up.chunk.js.map
