import{b2 as M,bc as T,p as q,aX as B,az as C,aj as O,dK as U,bN as D,L as P,T as p,f as z,e as G,aI as K,ao as t,c3 as W,dy as X,f0 as _,v as J}from"./app-k0jcl5PQ.js";import{B as Q}from"./CCtuxSlD.chunk.js";import{I as Y}from"./DXJ2-V8v.chunk.js";import{V as Z,a as $}from"./DH1mz64H.chunk.js";import{h as ee}from"./DIAJ896Y.chunk.js";import{u as te}from"./CnmbO5oy.chunk.js";import{u as ie,V as oe}from"./BUtU6IOA.chunk.js";import{u as se}from"./DDxzgH2W.chunk.js";import{u as re}from"./DgW9Cwsn.chunk.js";import{u as ae}from"./GqZ33xmI.chunk.js";import{V as A,P as ne}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",v=P.encloseNamespace(L);function $e(m){var f,V,h,g;const{videoId:o,presentationSlug:s}=m,I=M(),j=T(),{commonVideoProps:b,hasCommonVideoPropsCompleted:w}=se({locationContext:q.VideoThumbnail}),k=re(),{hasPermissions:y}=B(),R=ie({location:oe.VideoItem,presentationSlug:s}),a=ae(),E=C(O.currentUser()),i=C(U.video(o));D({title:i.data?v("clipViewPageTitle",{video:(f=i.data)==null?void 0:f.name}):""});function c(e){return _.videoClips(o,null,e)}function d(e){return I(c(e))}function N(e,n){if(e===1)return ee(n);j.error(P.getPhrase(L,"errorClips"))}const{items:r,hasMore:S,isFetching:u}=te(a.canViewClips?c:!1,d,N),l=v("clipHeading"),F=[{name:(V=i.data)==null?void 0:V.name,appLink:{...A.playVideo,args:[s,o,p.slugify((h=i.data)==null?void 0:h.name)]}},{name:l,appLink:{application:G.VIDEOS,action:z.Videos.VIDEO_CLIPS,args:[s,o,p.slugify((g=i.data)==null?void 0:g.name)]},active:!0}];function H(){var e;J.trigger({...A.playVideo,args:[s,o,p.slugify((e=i.data)==null?void 0:e.name)]},{replace:!0})}return K.useEffect(()=>{a.canViewClips||H()},[a.canViewClips]),!i.data||!(r!=null&&r.length)||!w?t.jsx(ne,{}):t.jsx(Z.Provider,{value:R,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(Q,{breadcrumbs:F})}),t.jsx($,{videos:r,getVideoAppLink:(e,n)=>{var x;return W.getAppLink(e,{...n,context:X.Widget,contextId:m.videoId,includeContext:(x=E.data)==null?void 0:x.isAuthenticated},s)},hasPermissions:y,presentationAudiences:k.data,showOwner:!0,commonVideoProps:b}),(S||u)&&t.jsx(Y,{isFetching:u,fetchNext:d})]})})}export{$e as VideoClipsView};
//# sourceMappingURL=DTRA2Qf-.chunk.js.map
