import{o as u,u as O,R as _,aP as w,l as D,j as b,ag as m,aO as g,aR as U,h as J,i as v,h0 as x,aI as H,aQ as K,g as T}from"./app-BgLa5dit.js";import{a as B}from"./CTNq1KmP.chunk.js";import{u as M}from"./PpGk0l1b.chunk.js";import{g as N,W as r,b as z,c as k,B as q}from"./BwfkiyJS.chunk.js";import{W as o}from"./CPx1XrU-.chunk.js";import{u as F}from"./CKjyFQLY.chunk.js";import"./BxYybc33.chunk.js";import"./DkDkjje4.chunk.js";import"./MEkA24R1.chunk.js";import"./8Im-OACs.chunk.js";import"./g56uS58q.chunk.js";import"./vyqb6V0P.chunk.js";import"./B3eOBVf8.chunk.js";import"./3nM7jLnE.chunk.js";import"./CPXlV0fg.chunk.js";import"./DJ0pq8J_.chunk.js";import"./C53kfXmd.chunk.js";import"./CG7zbly5.chunk.js";function me(t){const p=u(U.currentUser()),{workingList:a,workingLists:h,createWorkingList:I}=F(t.listId),[e,A]=O(k.VIDEO_VIEW_MODEL_KEY),[f,E]=_.useState(!1),i=N(t.listId),n=u(o.getJob(t.jobId)),c=u(o.getJobSummary(t.jobId));M(n);const W=w(),C=D(),L=r.useCreateJobErrorAlert();function S(){const s=r.getCreateJobRequestData(e,a,p.data.id);K(W,o.createJob(s,R,L))}function R(s){T.trigger({...i.wizardActionStatus.polling,params:{jobId:s.id}})}function V(s){const y=`Errors from ${h.find(d=>d.id===t.listId).name}`,j=I(y,s.map(d=>d.id));E(!0),C.success({type:H.Success,heading:x.Success,message:"Successfully create a new workbench from the list of errors.",appLink:{application:v.WORKBENCH,action:J.Workbench.WORKBENCH,args:[j.id]},appLinkText:"Open workbench",appLinkClassName:"info-link"})}const l=!!(e&&p.data&&n.data&&c.data);return b.jsx(z,{appLinks:i,listId:t.listId,currentStep:"status",type:m.Video,viewModelKey:k.VIDEO_VIEW_MODEL_KEY,loaded:l,preventNavLock:!0,disableAppLinks:!0,children:l&&b.jsx(B,{job:n.data,summary:c.data,objectCount:a==null?void 0:a.length,objectType:m.Video,finishAppLink:i.workbench,imageCdnUrl:ClickView.Config.Urls.ImageAPI,successImageUrl:g.Wizard.WIZARD_SUCCESS,failedImageUrl:g.Wizard.WIZARD_ERROR,navLockId:q,actionSucceededMessage:r.getSuccessMessage(e==null?void 0:e.subAction,m.Video,c.data.totalSucceeded),actionVerb:r.mapSubActionToVerb(e==null?void 0:e.subAction),onFinish:()=>A({}),onClickTryAgain:S,getResultsRequest:o.getJobResults,preventLoggingAnalytics:!0,getErrorListItem:r.getErrorListItem,errorActionButton:!f&&{onClick:V,text:"Save errored videos as a new workbench"}})})}export{me as WorkbenchActionStatusCompleteView};
//# sourceMappingURL=Bfa656KJ.chunk.js.map
