import{o as s,s as T,k as V,S as o,j as a,h,ai as y,ar as A,f8 as O,w as l,dl as f}from"./app-BgLa5dit.js";import{O as k}from"./B-fq6xxv.chunk.js";import{S as g}from"./B9ND9p3V.chunk.js";import{S as q}from"./CJf3ETiT.chunk.js";import{P as w}from"./CY0zrGLk.chunk.js";function B(e){const m=s(T.video(e.videoId)),d=V(),r=s(o.objectClassifications(e.videoId)),b=s(o.memberBackboneClassifications(e.videoId)),t=s(w.streamablePresentation()),c=s(t.data&&o.getClassificationTree(t.data.id));async function u(n,j){const S=O.flatten(c.data),I=n.reduce((i,x)=>({...i,[x]:!0}),{}),C=S.filter(i=>I[i.id]),p=l.uniq(l.flatten(C.map(i=>i.backboneClassificationIds)));await d(o.updateObjectBackboneClassification(e.videoId,p,f.Videos)),await d(o.updateObjectClassification(e.videoId,n,t.data.id,f.Videos)),j()}const v=r.data&&b.data&&c.data&&t.data;return a.jsxs(a.Fragment,{children:[a.jsx(q,{videoId:e.videoId,activeAction:h.StreamableLearning.EDIT_VIDEO_CLASSIFICATIONS}),a.jsx(k,{object:m.data}),v?a.jsx(g,{initialValues:{classificationIds:r.data.map(n=>n.id)},presentationId:t.data.id,presentationType:y.StreamableLearning,classificationTree:c.data,saveClassifications:u}):a.jsx("div",{className:"text-center p-5",children:a.jsx(A,{as:"div",animation:"border",role:"status"})})]})}export{B as StreamableVideoClassificationsView};
//# sourceMappingURL=HDtlcSu2.chunk.js.map
