import{ao as e,L as v,aP as b,at as F,aJ as k,az as h,aj as g,f0 as I,aF as S,bU as p,o as y,W as E,r as P,E as U,p as D}from"./app-k0jcl5PQ.js";import{u as A}from"./CLC2sKlT.chunk.js";import"./DTRakM4e.chunk.js";const T="_selected_4hhei_1",B={selected:T},$="interactives.feedbackChoices",l=v.encloseNamespace($);function x(c){const{title:t,description:s,value:i,className:d,onClick:n,selected:o}=c,r=i?b.Interactives.FeedbackOptions.FEEDBACK:b.Interactives.FeedbackOptions.NO_FEEDBACK;return e.jsxs(F,{onClick:()=>n(i),className:`
        text-center
        cursor-pointer
        p-3
        border
        rounded-3
        ${d}
        ${o?"border-info":"border"}
        ${o?B.selected:""}
      `,children:[e.jsx("img",{src:r,className:"img-fluid my-3"}),e.jsx("h2",{className:"h3",children:t}),e.jsx("p",{children:s})]})}function L(c){const{feedback:t,setFeedback:s}=c;return e.jsxs("div",{className:"d-flex mb-3",children:[e.jsx(x,{title:l("feedbackTitle"),description:l("feedbackDescription"),value:!0,onClick:s,selected:t===!0,className:"flex-fill w-50 me-2"}),e.jsx(x,{title:l("noFeedbackTitle"),description:l("noFeedbackDescription"),value:!1,onClick:s,selected:t===!1,className:"flex-fill w-50 ms-2"})]})}const _="shared.makeClipInteractive",C=v.encloseNamespace(_);function z(c){var u,m,f;const{clipId:t,closePopup:s}=c,[i,d]=k.useState(!1),[n,o]=k.useState(null),r=h(g.currentUser()),a=h(I.clip(t)),{createInteractive:j}=A({feedback:n,setShowSpinner:d,closePopup:s,name:(u=a.data)==null?void 0:u.name,duration:a.data?(a.data.endTime-a.data.startTime)*1e3:null,objectId:(m=a.data)==null?void 0:m.id,currentUser:r.data,baseAnalyticsData:{clip:{id:t,name:(f=a.data)==null?void 0:f.name}}});function N(){y.logUserAction({clip:{id:t}},{location:D.NewInteractive,entity:U.Interactive,actionType:P.Create,workflowPhase:E.Discard}),s()}const w=!a.data||!r.data;return e.jsxs(S,{title:C("title"),closePopup:s,showLoadingSpinner:w,size:"lg",children:[e.jsx(L,{feedback:n,setFeedback:o}),e.jsxs(p,{children:[e.jsx(p.Cancel,{onClick:N}),e.jsx(p.Submit,{variant:"dark",onClick:j,text:C("continue"),showSpinner:i,disabled:typeof n!="boolean"})]})]})}export{z as NewClipInteractiveView};
//# sourceMappingURL=DNyI-hpZ.chunk.js.map
