import{aJ as x,ay as A,az as P,bw as h,de as S,p as r,r as c,E as p,T as w,f as C,e as T,cr as B,L,bg as N,W as y,c3 as M,M as E,cu as j,ao as a,aF as H,bU as Q,v as R}from"./app-k0jcl5PQ.js";import{A as W}from"./BDviDDog.chunk.js";import{I as F}from"./DtZoWt5r.chunk.js";import{M as z}from"./BurIODLh.chunk.js";import{P as G}from"./Bw9otuBi.chunk.js";import{p as O}from"./DI74-Tns.chunk.js";import"./wCY37Ze3.chunk.js";import"./CG1PE8VW.chunk.js";import"./uoUaCILN.chunk.js";import"./B31bqZwo.chunk.js";import"./Nk1Ro0yw.chunk.js";const U="_printBtn_1anjz_1",D={printBtn:U},o=L.encloseNamespace("interactives.previewQuestions");function st(i){var u,v,m,I,f;const[V,l]=x.useState(!1),{experimentalInteractiveQuestions:_}=A(null),t=P(h.interactiveMetadata(i.id)),n=P(t.data?h.interactive(t.data.interactiveId):null);let s=null;t.data&&(s={id:t.data.id,interactiveId:t.data.interactiveId,name:t.data.name},(u=t.data._parentVideo)!=null&&u.id&&(s.video={id:t.data._parentVideo.id}),(v=t.data._parentClip)!=null&&v.id&&(s.clip={id:t.data._parentClip.id}));const d=[{label:o("watchInteractive"),className:"btn btn-outline-dark me-2",svg:B,button:!0,appLink:{application:T.INTERACTIVES,action:C.Interactives.VIEW_INTERACTIVE,args:[i.id,w.slugify((m=n.data)==null?void 0:m.name)]},onClick:i.closePopup,analyticsData:s,analyticsOptions:{entity:p.Interactive,actionType:c.Click,location:r.PreviewInteractiveQuestions,descriptor:S.Button}},{label:o("printAsWorksheet"),className:`btn btn-outline-dark ${D.printBtn}`,svg:G,button:!0,onClick:()=>{var e;l(!0),O(n.data,(e=t.data._isClickViewCurated)==null?void 0:e.value,()=>l(!1))},showSpinner:V,analyticsData:s,analyticsOptions:{entity:p.Interactive,actionType:c.Print,location:r.PreviewInteractiveQuestions,workflowPhase:y.Start,eventVersion:N.V2}}];if(i.showBackButton){const e=((I=t.data)==null?void 0:I._parentClip)||((f=t.data)==null?void 0:f._parentVideo);d.unshift({label:o("back"),appLink:M.getInteractiveGuidanceAppLink(e==null?void 0:e.id,j.isClip(e)?E.Clip:E.Video),className:"btn btn-link me-2",button:!0,analyticsData:s,analyticsOptions:{entity:p.Interactive,actionType:c.Click,location:r.PreviewInteractiveQuestions,workflowPhase:y.Back}})}function b(e,$,g){var k;R.trigger({application:T.INTERACTIVES,action:C.Interactives.VIEW_INTERACTIVE,args:[i.id,w.slugify((k=n.data)==null?void 0:k.name)],params:g?{t:Math.floor(g/1e3)}:null}),i.closePopup()}return a.jsx(H,{title:o("mainTitle"),closePopup:i.closePopup,showLoadingSpinner:!n.data,size:"lg",children:n.data?a.jsxs(a.Fragment,{children:[a.jsx(F,{interactive:n.data,maxHeight:z,experimentalInteractiveQuestions:_,goToTimepoint:b}),a.jsx(Q,{children:a.jsx(W,{actions:d})})]}):a.jsx(a.Fragment,{})})}export{st as PreviewQuestionsView};
//# sourceMappingURL=BW2E5xm2.chunk.js.map
