import{u,j as t,Y as W,h as E,i as j,o as c,aP as w,ag as m,aR as C,aQ as I,S as A,g as L}from"./app-BgLa5dit.js";import{W as x}from"./D8ca7W7r.chunk.js";import{W as V}from"./CZyx6Aii.chunk.js";import{W as a,a as v,g as M,b as _,c as d}from"./BwfkiyJS.chunk.js";import{W as y}from"./CPx1XrU-.chunk.js";import{W as S}from"./CnYYY4AA.chunk.js";import{u as T}from"./CKjyFQLY.chunk.js";import"./B3eOBVf8.chunk.js";import"./3nM7jLnE.chunk.js";import"./CPXlV0fg.chunk.js";import"./MEkA24R1.chunk.js";import"./DJ0pq8J_.chunk.js";import"./C53kfXmd.chunk.js";import"./CG7zbly5.chunk.js";function D(e){const[i]=u(e.viewModelKey);return a.useSetWorkbenchConfirmationCallback(e.onConfirmClick,e.viewModelKey),t.jsxs(t.Fragment,{children:[t.jsxs(V,{children:[t.jsx("p",{className:"fw-semibold mb-1",children:"Add to the following backbone audiences:"}),t.jsx("ul",{className:"mb-0",children:i.assocIds.map(o=>t.jsx("li",{children:t.jsx(W,{appLink:{application:j.SUBJECTS,action:E.Subjects.EDIT_LEVEL,args:[o]},openInNewTab:!0,children:e.audiences.find(s=>s.id.toString()===o.toString()).name})},o))})]}),t.jsxs("div",{className:"my-3",children:[t.jsx("h3",{className:"h6 mt-2",children:e.objects.length?`The above changes will be applied to the selected ${e.objects.length} videos:`:"The above changes will be applied to the selected 1 video:"}),t.jsx(x,{items:e.objects,rowHeight:v,getComponent:o=>a.getItemComponent(o,e.type)})]})]})}function Q(e){const{workingList:i}=T(e.listId),[o]=u(d.VIDEO_VIEW_MODEL_KEY),s=c(C.currentUser()),b=c(A.getBackboneAudiences()),h=w(),n=M(e.listId),l=c(S.videosById(i)),p=a.useCreateJobErrorAlert();function k(r){L.trigger({...n.wizardActionStatus.polling,params:{jobId:r.id}})}function f(){if(!o)return;const r=a.getCreateJobRequestData(o,i,s.data.id);I(h,y.createJob(r,k,p))}const g=!!s.data&&!!l.data;return t.jsx(_,{listId:e.listId,appLinks:n,currentStep:"confirmation",viewModelKey:d.VIDEO_VIEW_MODEL_KEY,type:m.Video,loaded:g,children:t.jsx(D,{type:m.Video,objects:l.data,appLinks:n,viewModelKey:d.VIDEO_VIEW_MODEL_KEY,audiences:b.data,onConfirmClick:f})})}export{Q as WorkbenchVideoAddToBackboneAudiencesConfirmationView};
//# sourceMappingURL=B1m83Uw2.chunk.js.map
