import{aX as k,az as a,bu as L,aj as f,bw as m,be as A,M as E,eb as g,ec as q,b4 as U,p as C,fb as F,jp as j,jq as K,fd as T,fe as G,bN as O,bO as H,ao as s,aZ as N,hp as _}from"./app-k0jcl5PQ.js";import{u as z}from"./CAxN5LKv.chunk.js";import{u as B}from"./DDxzgH2W.chunk.js";import{u as D}from"./DgW9Cwsn.chunk.js";import{u as X,P as Z,a as J}from"./B2qQOI1p.chunk.js";import{u as Q}from"./4IZETxJX.chunk.js";import{I as W}from"./COlNonQJ.chunk.js";import"./DIAJ896Y.chunk.js";import"./1YwtoG9U.chunk.js";import"./BZa85bFL.chunk.js";import"./BYBYoVkn.chunk.js";import"./D1WNsOm8.chunk.js";import"./U4M4wGTR.chunk.js";import"./BgZMo0y9.chunk.js";import"./BhYYYlpK.chunk.js";import"./FGhEvk_q.chunk.js";import"./WCBjpMHJ.chunk.js";import"./DoFMWlew.chunk.js";import"./CMnqIsoM.chunk.js";import"./CX9BGBTP.chunk.js";import"./uoUaCILN.chunk.js";import"./DXJ2-V8v.chunk.js";import"./DH1mz64H.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"./eerUhItV.chunk.js";import"./Cukd0Qmt.chunk.js";import"./B31bqZwo.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"./DdN4NAtQ.chunk.js";import"./CBiwFpxE.chunk.js";import"./BUtU6IOA.chunk.js";import"./DAIetGMf.chunk.js";import"./TReHo2Ua.chunk.js";import"./Bj7bJt_4.chunk.js";import"./CGYNvpr2.chunk.js";import"./Bw9otuBi.chunk.js";import"./BvnABNse.chunk.js";import"./Bh7bFXwG.chunk.js";import"./DCdUbbLx.chunk.js";import"./t24_x3Gi.chunk.js";import"./CCtuxSlD.chunk.js";import"./CPXlV0fg.chunk.js";import"./0f3cnETk.chunk.js";import"./BqNArZps.chunk.js";import"./D62ACZel.chunk.js";import"./BBUCoOir.chunk.js";import"./BrY2bcAL.chunk.js";import"./BHJbqrq4.chunk.js";import"./BAuuQuuB.chunk.js";const Y={notFound:K,forbidden:{privacy:j}};function $(e){return(e==null?void 0:e._parentClip)||(e==null?void 0:e._parentVideo)}function nt(e){var P,l,y,b;const{hasPermissions:x}=k(),d=a(L.config()),c=a(f.token()),r=a(f.currentUser()),t=a(m.sharedInteractiveMetadata(e.objectId,e.shareId)),o=a(A.getShareObject(e.shareId)),S=o.data&&(o.data.objectTypeId===E.Interactive?g.createViewKey(e.shareId,q.Share):g.createViewKey(e.objectId,q.MasterObject,e.shareId)),p=a(S),u=D(),V=a(((P=r.data)==null?void 0:P.isAuthenticated)&&U.yearGroups(r.data.customerId)),i=X(o.data),h=a(i&&t.data&&m.interactive(t.data.interactiveId)),w=a(i&&t.data&&m.videoInteractives($(t.data).id)),M=i?C.PreviewSharedInteractive:C.PlaySharedInteractive,{commonVideoProps:v,hasCommonVideoPropsCompleted:R}=B({locationContext:M}),n=F({video:t.data,context:e.queryParams.context,contextId:e.queryParams.contextId,moviesAndTv:e.queryParams.mtv,currentUser:r.data});z(t,Y),T(t,{private:j}),G({id:e.objectId,app:"interactives",shareId:e.shareId}),Q(n.videos??[]),O(H.getInteractiveMetadata({content:t.data}));const I=t.data&&d.hasCompleted&&r.hasCompleted&&(!i||h.hasCompleted)&&o.hasCompleted&&p.hasCompleted&&c.hasCompleted&&R;return i?I?s.jsx(Z,{currentUser:r.data,queryParams:e.queryParams,interactive:t.data,interactives:(l=w.data)==null?void 0:l.data,isPreviewPreventScrubbingEnabled:h.data.preventScrubbing,audiences:u.data,relatedVideos:n,canManageVideoAccess:x(N.ManageVideoAccess),commonVideoProps:v}):s.jsx(W,{}):I?s.jsx(J,{interactive:t.data,currentUser:r.data,config:d.data,audiences:u.data,yearGroups:V.data,queryParams:e.queryParams,viewKey:p.data,relatedVideos:n,shareLink:o.data,startTime:(y=e.queryParams)==null?void 0:y.t,token:c.data,collectAnonResults:!((b=r.data)!=null&&b.isAuthenticated)&&!!_.getAnonUser(e.shareId),commonVideoProps:v}):s.jsx(s.Fragment,{})}export{nt as SharedInteractiveView};
//# sourceMappingURL=GVAJTbbV.chunk.js.map
