import{u as T,R as r,j as s,b7 as x,dt as g,f7 as E,F as S,o as b,S as j,ai as W,ag as C}from"./app-BgLa5dit.js";import{W as P}from"./MEkA24R1.chunk.js";import{S as V}from"./DA_td-Zr.chunk.js";import{u as k}from"./CKjyFQLY.chunk.js";import{W as L,g as y,b as D,c as h}from"./BwfkiyJS.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";const I="workbench.addToClassification";function _(t){var c,f,m;const{workingList:i}=k(),[e,n]=T(t.viewModelKey),{setDisableNext:o}=r.useContext(P),l=a=>{const p=a.id;p&&n("assocIds",[p])};r.useEffect(()=>{var a;n("subAction","addToClassification"),(a=e==null?void 0:e.assocIds)!=null&&a.length?n("assocIds",e.assocIds):n("assocIds",[])},[]),r.useEffect(()=>{var a;o(!((a=e==null?void 0:e.assocIds)!=null&&a.length))},[e==null?void 0:e.assocIds]),r.useEffect(()=>{t.currentPresentationId&&n("presentationId",t.currentPresentationId)},[t.currentPresentationId]);const u=!((c=e==null?void 0:e.assocIds)!=null&&c.length),d=!!t.currentPresentationId&&!!((m=(f=t.classificationTree)==null?void 0:f.children)!=null&&m.length);return t.loaded?s.jsxs("div",{className:"pb-3",children:[s.jsx("h2",{className:"h4",children:s.jsx(x,{namespace:I,phrase:"heading"})}),s.jsx("p",{className:"fw-semibold",children:"Select a presentation to view its topics:"}),s.jsx("div",{className:"w-100 pb-3",children:s.jsx(g,{presentations:t.presentations,currentPresentationId:t.currentPresentationId,setCurrentPresentation:a=>t.setCurrentPresentationId(a.id)})}),s.jsx("p",{className:"fw-semibold",children:s.jsx(x,{namespace:I,phrase:"contextVideo",options:{smartCount:i==null?void 0:i.length}})}),s.jsx("div",{className:"form-control h-auto py-2",children:d?s.jsx(E,{label:S.getPhrase(I,"treeTitle"),tree:t.classificationTree,selectedIds:e==null?void 0:e.assocIds,hideCollapseBtn:u,onSelect:l,getSelectedItemAppLink:a=>L.getClassificationAppLink(e==null?void 0:e.presentationId,a),openSelectionsInNewTab:!0,multiSelect:!1}):s.jsx("p",{children:"This presentation has no topics."})})]}):s.jsx(V,{})}function H(t){var d,c;const i=y(t.listId),e=b(j.presentations(W.Subject)),[n]=T(h.VIDEO_VIEW_MODEL_KEY),[o,l]=r.useState((n==null?void 0:n.presentationId)||((c=(d=e.data)==null?void 0:d[0])==null?void 0:c.id)),u=b(o&&j.getClassificationTree(o));return s.jsx(D,{appLinks:i,currentStep:"action-details",viewModelKey:h.VIDEO_VIEW_MODEL_KEY,type:C.Video,loaded:!!e.data,listId:t.listId,children:s.jsx(_,{appLinks:i,viewModelKey:h.VIDEO_VIEW_MODEL_KEY,classificationTree:u.data,loaded:!!e.data,presentations:e==null?void 0:e.data,currentPresentationId:o,setCurrentPresentationId:l})})}export{H as WorkbenchVideoActionsAddToClassificationDetailsView};
//# sourceMappingURL=DAjL_0Df.chunk.js.map
