import{b2 as F,bc as M,p as q,aX as B,az as I,aj as O,dK as U,bN as D,L as P,T as p,f as Q,e as z,aI as G,ao as t,fp as K,c3 as W,dy as X,bw as _,v as J}from"./app-k0jcl5PQ.js";import{B as Y}from"./CCtuxSlD.chunk.js";import{I as Z}from"./DXJ2-V8v.chunk.js";import{V as $,a as ee}from"./DH1mz64H.chunk.js";import{h as te}from"./DIAJ896Y.chunk.js";import{u as ie}from"./CnmbO5oy.chunk.js";import{u as oe,V as se}from"./BUtU6IOA.chunk.js";import{u as re}from"./DDxzgH2W.chunk.js";import{u as ae}from"./DgW9Cwsn.chunk.js";import{u as ne}from"./GqZ33xmI.chunk.js";import{V as x,P as pe}from"./Ci0tHKfw.chunk.js";import"./CPXlV0fg.chunk.js";import"./BlKMjFEf.chunk.js";import"./CofWDDSQ.chunk.js";import"./DwvfEevL.chunk.js";import"./D9SGbB34.chunk.js";import"./BwBaQklX.chunk.js";import"./ByBCp1MC.chunk.js";import"./BhYYYlpK.chunk.js";import"./FGhEvk_q.chunk.js";import"./WCBjpMHJ.chunk.js";import"./DoFMWlew.chunk.js";import"./CMnqIsoM.chunk.js";import"./eerUhItV.chunk.js";import"./Cukd0Qmt.chunk.js";import"./B31bqZwo.chunk.js";import"./uoUaCILN.chunk.js";import"./f_twTV5Z.chunk.js";import"./BDeUEvb2.chunk.js";import"./Daim1zo7.chunk.js";import"./B3XH0kWB.chunk.js";import"./BRhv_AHY.chunk.js";import"./BDviDDog.chunk.js";import"./wCY37Ze3.chunk.js";import"./CIN5bTKK.chunk.js";import"./DAIetGMf.chunk.js";import"./TReHo2Ua.chunk.js";import"./Bj7bJt_4.chunk.js";import"./CGYNvpr2.chunk.js";import"./U4M4wGTR.chunk.js";import"./Bw9otuBi.chunk.js";import"./BvnABNse.chunk.js";import"./Bh7bFXwG.chunk.js";import"./DCdUbbLx.chunk.js";import"./t24_x3Gi.chunk.js";const L="shared.videoMedia",A=P.encloseNamespace(L);function et(c){var f,V,v,g;const{videoId:o,presentationSlug:s}=c,w=F(),b=M(),{commonVideoProps:j,hasCommonVideoPropsCompleted:C}=re({locationContext:q.VideoThumbnail}),k=oe({location:se.VideoItem,presentationSlug:s}),a=ne(),E=ae(),{hasPermissions:R}=B(),y=I(O.currentUser()),i=I(U.video(o));D({title:i.data?A("videoInteractivesViewPageTitle",{video:(f=i.data)==null?void 0:f.name}):""});function m(e){return _.videoInteractives(o,null,e)}function d(e){return w(m(e))}function N(e,n){if(e===1)return te(n);b.error(P.getPhrase(L,"errorInteractives"))}const{items:r,hasMore:T,isFetching:u}=ie(a.canViewInteractives?m:!1,d,N),l=A("interactivesHeading"),H=[{name:(V=i.data)==null?void 0:V.name,appLink:{...x.playVideo,args:[s,o,p.slugify((v=i.data)==null?void 0:v.name)]}},{name:l,appLink:{application:z.VIDEOS,action:Q.Videos.VIDEO_INTERACTIVES,args:[s,o,p.slugify((g=i.data)==null?void 0:g.name)]},active:!0}];function S(){var e;J.trigger({...x.playVideo,args:[s,o,p.slugify((e=i.data)==null?void 0:e.name)]},{replace:!0})}return G.useEffect(()=>{a.canViewInteractives||S()},[a.canViewInteractives]),!i.data||!(r!=null&&r.length)||!C?t.jsx(pe,{}):t.jsx($.Provider,{value:k,children:t.jsxs("div",{className:"px-3",children:[t.jsx("h1",{className:"h2 mb-2",children:l}),t.jsx("div",{className:"mb-2",children:t.jsx(Y,{breadcrumbs:H})}),t.jsx(ee,{videos:r,getVideoAppLink:(e,n)=>{var h;return W.getAppLink(e,{...n,context:X.Widget,contextId:c.videoId,includeContext:(h=y.data)==null?void 0:h.isAuthenticated},s)},hasPermissions:R,presentationAudiences:E.data,getPreviewQuestionsAppLink:e=>K.getPreviewQuestionsAppLink(e),showOwner:!0,commonVideoProps:j}),(T||u)&&t.jsx(Z,{isFetching:u,fetchNext:d})]})})}export{et as VideoInteractivesView};
//# sourceMappingURL=BS0DxDDV.chunk.js.map
