import{o as k,dn as S,dp as I,j as t,ar as j,e7 as n,Y as A,h as i,i as o,a3 as D,x as l}from"./app-BgLa5dit.js";import{M as y}from"./CJkmdwb7.chunk.js";import{W as C}from"./CnYYY4AA.chunk.js";import{u as N}from"./CKjyFQLY.chunk.js";import"./CTg_3F42.chunk.js";function v(){return{[n.Video]:e=>({application:o.VIDEOS,action:i.Videos.EDIT_VIDEO,args:[e.id]}),[n.Series]:e=>({application:o.SERIES,action:i.Series.EDIT_SERIES,args:[e.id]}),[`${n.Video}:${n.Audience}`]:e=>({application:o.VIDEOS,action:i.Videos.EDIT_VIDEO_AUDIENCES,args:[e==null?void 0:e.id]}),[`${n.Series}:${n.Audience}`]:e=>({application:o.SERIES,action:i.Series.EDIT_SERIES_AUDIENCES,args:[e==null?void 0:e.id]}),library:(e,a)=>({application:o.SUBJECTS,action:a==="exchange"?i.Libraries.EXCHANGE:i.Libraries.HOSTED_LIBRARIES,args:[e]})}}function w(e){const{workingList:a,removeFromWorkingList:d,clearWorkingList:m}=N(e.listId),r=!!a.length,c=k(r&&C.videosById(a));function p(){const s=t.jsxs("p",{children:["Are you sure you want to clear ",t.jsx("strong",{children:"all"})," videos in the working set?"]});l.render(s,{title:"Clear Working Set",submitButtonProps:{onClick:()=>{m(),e.closePopup()},text:"Yes, clear everything",variant:"danger"},cancelButtonProps:{variant:"outline-dark"}})}function u(s){const b=t.jsxs(t.Fragment,{children:[t.jsxs("p",{children:["Are you sure you want to remove ",t.jsx("strong",{children:s.name})," from the working set?"]}),t.jsx("p",{className:"text-secondary",children:"Note: This won't delete the video"})]});l.render(b,{title:`Remove ${s.name}`,submitButtonProps:{onClick:()=>{d(s.id),e.closePopup()},text:"Yes, remove item",variant:"danger"},cancelButtonProps:{variant:"outline-dark"}})}const h=S.getColumnSet(I.WorkbenchVideos),x=[{label:"Clear my workbench",onClick:p,className:"btn btn-link text-danger"}];function E(s){return[{label:"Remove item",onClick:()=>u(s),className:"btn btn-link text-danger"}]}const g={actions:E,appLinks:v(),extraData:{}};return t.jsxs("div",{className:"px-3",children:[t.jsx("h1",{className:"h3 pb-2",children:"Video Workbench"}),r&&!c.hasCompleted?t.jsx("div",{className:"text-center p-5",children:t.jsx(j,{as:"div",animation:"border",role:"status"})}):a!=null&&a.length?t.jsx(y,{columns:h,columnData:g,members:c.data,columnGroups:[n.Video,n.Series],children:t.jsxs("div",{className:"d-inline-flex ms-auto",children:[t.jsx(A,{appLink:{application:o.WORKBENCH,action:i.Workbench.WIZARD_REVIEW_VIDEOS,args:[e.listId]},className:"btn btn-dark px-4 me-2",children:"Apply bulk action"}),t.jsx(D,{actions:x})]})}):t.jsxs("div",{className:"text-center py-3",children:[t.jsx("h4",{className:"h4",children:"Your workbench is empty"}),t.jsx("p",{className:"text-secondary",children:"Add videos to your workbench to get started"})]})]})}export{w as VideoWorkingSetView};
//# sourceMappingURL=tPb0dGtQ.chunk.js.map
