import{u as m,R as i,j as o,o as b,ag as h,S as I}from"./app-BgLa5dit.js";import{W as A}from"./MEkA24R1.chunk.js";import{u as f}from"./CKjyFQLY.chunk.js";import{g as p,b as k,c as d}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";function x(t){const{workingList:c}=f(t.listId),[e,n]=m(t.viewModelKey),{setDisableNext:r}=i.useContext(A);i.useEffect(()=>{var s;n("subAction","addToBackboneAudiences"),(s=e==null?void 0:e.assocIds)!=null&&s.length||n("assocIds",[])},[]),i.useEffect(()=>{var s;r(!((s=e==null?void 0:e.assocIds)!=null&&s.length))},[e==null?void 0:e.assocIds]);function u(s){const a=Array.from(s.target.selectedOptions,l=>l.value);n("assocIds",a)}return o.jsxs("div",{className:"pb-3",children:[o.jsx("h2",{className:"h4",children:"Add to Backbone Audiences"}),o.jsxs("p",{className:"fw-semibold",children:["Add your video",c!=null&&c.length?"s":""," to one or more Backbone Audiences:"]}),o.jsx("select",{id:"backbone-audiences",className:"form-select ",value:(e==null?void 0:e.assocIds)??[],size:t.audiences.length,onChange:u,multiple:!0,children:t.audiences.map(s=>{var a;return o.jsx("option",{value:s.id,selected:(a=e==null?void 0:e.assocIds)==null?void 0:a.includes(s.id),children:s.name},s.id)})})]})}function K(t){const c=p(t.listId),e=b(I.getBackboneAudiences()),n=!!e.data;return o.jsx(k,{listId:t.listId,appLinks:c,currentStep:"action-details",viewModelKey:d.VIDEO_VIEW_MODEL_KEY,type:h.Video,loaded:n,children:o.jsx(x,{listId:t.listId,appLinks:c,viewModelKey:d.VIDEO_VIEW_MODEL_KEY,audiences:e.data})})}export{K as WorkbenchVideoActionsAddToBackboneAudiencesDetailsView};
//# sourceMappingURL=DsEpggWX.chunk.js.map
