1import{g as f,e as v,j as i,b as l,T as t,F as d,a as L,p as N,c as m,cZ as q,I as c,c_ as K,ab as w,s as b,U as G,d as V,X as _,r as W,i as X,k as T,n as g,v as Z,eY as J,br as Q,f as $,eZ as k,h as D,D as ee,_ as S,$ as ie,eX as se,eU as te}from"./index-QgM5GAdg.js";import{P as ne,b as de}from"./ProjectMetaDataCard-DqnO4xAd.js";const le=f.div` 2 height: 100%; 3 padding: 40px; 4 background-color: #f8f8f8; 5 width: 100%; 6 box-sizing: border-box; 7 @media (max-width: 768px) { 8 padding: 15px; 9 } 10`,E=f.div` 11 width: 100%; 12 padding: 24px; 13 background: #fff; 14 border-radius: 16px; 15 box-sizing: border-box; 16 border: 1px solid #ecf1f4; 17 @media (max-width: 768px) { 18 padding: 16px; 19 } 20`,oe=({user:s})=>{const n=v();return i.jsx(E,{children:i.jsxs(l,{gap:"10px",children:[i.jsx(t,{color:"#8C8CA1",type:"body",children:"REVIEWER"}),i.jsxs(d,{horizontalalign:"flex-start",verticalalign:n?"flex-start":"center",gap:"15px",children:[i.jsx(L,{url:m(s.profileImageV2)||N,size:n?"40":"100"}),i.jsxs(l,{width:"fit-content",gap:n?"5px":"12px",children:[i.jsxs("div",{children:[i.jsx(t,{color:"#4A4A68",type:"h3",children:(s==null?void 0:s.firstName)+" "+((s==null?void 0:s.lastName)??"")}),i.jsx(t,{color:"#8C8CA1",type:"body",children:"Faculty"})]}),i.jsx(q,{children:i.jsxs(l,{width:"fit-content",children:[i.jsxs(d,{gap:"8px",width:"fit-content",children:[i.jsx(c,{name:"mail",color:"var(--primary)",height:"16",width:"16"}),i.jsx(t,{color:"#8C8CA1",type:"body",children:s==null?void 0:s.email})]}),i.jsxs(d,{gap:"8px",width:"fit-content",children:[i.jsx(c,{name:"phone",color:"var(--primary)",height:"16",width:"16"}),i.jsx(t,{color:"#8C8CA1",type:"body",children:s==null?void 0:s.mobile})]})]})}),i.jsx(K,{children:i.jsxs(d,{gap:"20px",width:"fit-content",children:[i.jsxs(d,{gap:"8px",width:"fit-content",children:[i.jsx(c,{name:"mail",color:"var(--primary)",height:"24",width:"24"}),i.jsx(t,{color:"#8C8CA1",type:"body",children:s==null?void 0:s.email})]}),i.jsxs(d,{gap:"8px",width:"fit-content",children:[i.jsx(c,{name:"phone",color:"var(--primary)",height:"24",width:"24"}),i.jsx(t,{color:"#8C8CA1",type:"body",children:s==null?void 0:s.mobile})]})]})})]})]})]})})},re=({status:s})=>{const n=v();return i.jsx(l,{horizontalalign:"center",gap:"16px",children:{rejected:i.jsxs(i.Fragment,{children:[i.jsx(c,{name:"frownFace",height:n?"32":"72",width:n?"32":"72",color:"var(--primary)"}),i.jsx(t,{type:"h3",children:"Your work requires some revisions"}),i.jsx(t,{type:"body",color:"#8C8CA1",children:"Please Re-submit again after correction."})]}),approved:i.jsxs(i.Fragment,{children:[i.jsx(c,{name:"checkCircle",height:n?"32":"72",width:n?"32":"72",color:"var(--success)"}),i.jsx(t,{type:"h3",children:"Your work has been Approved!"}),i.jsx(t,{type:"body",color:"#8C8CA1",children:"Now you can publish it to showcase"})]}),submitted:i.jsxs(i.Fragment,{children:[i.jsx(c,{name:"reviewPad",height:n?"32":"72",width:n?"32":"72",color:"var(--primary)"}),i.jsx(t,{type:"h3",children:"Your work is under review!"}),i.jsx(t,{type:"body",color:"#8C8CA1",children:"You'll get a notification when it is reviewed."})]})}[s]})},ce=({feedBack:s,feedbackBy:n})=>i.jsx(E,{children:i.jsxs(l,{gap:"16px",children:[i.jsx(t,{type:"body",color:"#8C8CA1",children:"FEEDBACK"}),i.jsx(w,{disabled:!0,value:s,handleOnChange:()=>{}}),i.jsx(d,{horizontalalign:"end",children:i.jsxs(t,{type:"bodyBold",children:["By ",n]})})]})}),he=f(l)` 21 min-width: fit-content; 22 max-width: fit-content; 23 height: fit-content; 24 border-radius: 16px; 25 background: #ffff; 26 padding: 40px; 27 box-sizing: border-box; 28`,ae=({onPublish:s,onCancel:n})=>i.jsxs(he,{gap:"20px",horizontalalign:"center",children:[i.jsx(t,{type:"h3",children:"You are about to publish this work."}),i.jsx(t,{type:"body",children:'Once published, you will find it under "Work" section'}),i.jsxs(d,{gap:"20px",children:[i.jsx(b,{buttonType:"secondary",onHandleClick:()=>{n()},buttonStyle:{width:"fit-content"},children:"Cancel"}),i.jsx(b,{buttonType:"primary",onHandleClick:()=>{s()},buttonStyle:{width:"fit-content"},children:"Publish"})]})]}),be=()=>{var C,A,P,F,I;const{workId:s}=G(),n=V(),{successToast:R}=_(),[O,a]=W.useState(!1),[Y,j]=W.useState(!1),h=v(),{handleError:y}=X(),{data:e,status:z,error:p}=T({queryKey:["GetUnpubublishWorkApiKey",s],queryFn:()=>se(s),refetchOnWindowFocus:!1});p&&(y((C=p==null?void 0:p.response)==null?void 0:C.data),n(g.WorkOverviewRoute));const{data:r,status:B,error:x}=T({queryKey:["GetFacultyKey",e==null?void 0:e.reviewerId],queryFn:()=>e!=null&&e.reviewerId?te(e==null?void 0:e.reviewerId):null,refetchOnWindowFocus:!1});x&&y((A=x==null?void 0:x.response)==null?void 0:A.data);const u=Z({mutationFn:()=>J(s),onError(o){var M;j(!1),y((M=o==null?void 0:o.response)==null?void 0:M.data)}}),H=()=>{j(!1),R("Work Has been Published"),n(g.WorkOverviewRoute)};if(B==="pending"||z==="pending")return i.jsx(Q,{});const U=[{path:g.WorkOverviewRoute,name:"Unpublished"},{path:$().pathname,name:"Feedback"}];return i.jsxs(le,{children:[i.jsxs(l,{gap:h?"20px":"40px",children:[i.jsx(k,{routes:U}),e!=null&&e.reviewerId?i.jsx(i.Fragment,{children:i.jsx(re,{status:e==null?void 0:e.status})}):null,e!=null&&e.reviewerId?i.jsxs(d,{verticalalign:"top",gap:"20px",children:[i.jsx("div",{style:{flexGrow:(e==null?void 0:e.status)==="rejected"?h?"1":"0":"1"},children:i.jsx(oe,{user:r})}),(e==null?void 0:e.status)==="rejected"?i.jsx("div",{style:{flexGrow:"1"},children:i.jsx(ce,{feedbackBy:(r==null?void 0:r.firstName)+" "+((r==null?void 0:r.lastName)??""),feedBack:e==null?void 0:e.feedback})}):null]}):i.jsx(t,{type:"h3",children:"Reviewer is not assigned to this work!"}),h?i.jsxs(l,{gap:"20px",children:[e!=null&&e.reviewerId&&(e==null?void 0:e.status)==="submitted"||e!=null&&e.reviewerId&&(e==null?void 0:e.status)==="approved"&&(e==null?void 0:e.visibility)==0?i.jsx(b,{buttonType:"primary",onHandleClick:()=>{a(!0)},disabled:(e==null?void 0:e.status)==="submitted",children:"Publish Work"}):null,i.jsx(t,{type:"h2",color:"#4A4A68",children:e==null?void 0:e.title})]}):i.jsxs(d,{horizontalalign:"space-between",children:[i.jsx(t,{type:"h2",color:"#4A4A68",children:e==null?void 0:e.title}),e!=null&&e.reviewerId&&(e==null?void 0:e.status)==="submitted"||e!=null&&e.reviewerId&&(e==null?void 0:e.status)==="approved"&&(e==null?void 0:e.visibility)==0?i.jsx(b,{buttonType:"primary",onHandleClick:()=>{a(!0)},buttonStyle:{width:"fit-content"},disabled:(e==null?void 0:e.status)==="submitted",children:"Publish Work"}):null]}),i.jsx(l,{gap:h?"12px":"20px",children:(P=e==null?void 0:e.files)==null?void 0:P.map(o=>o.fileType==="image"?i.jsx("img",{src:m(o.filePathV2),width:"100%"},o.id):i.jsx("video",{controls:!0,width:"100%",children:i.jsx("source",{src:m(o.filePathV2),type:"video/mp4"})},o.id))}),i.jsxs(d,{width:"fit-content",gap:"10px",children:[i.jsx(t,{type:"bodyBold",color:"#4A4A68",children:"SUBMITTED ON:"}),i.jsx(t,{type:"body",color:"#4A4A68",children:D(e==null?void 0:e.created_at).format("DD/MM/YYYY")})]}),i.jsx(ee,{height:"2px"}),i.jsxs(l,{gap:h?"8px":"16px",children:[i.jsx(t,{color:"#8C8CA1",type:"body",children:"PROJECT DETAILS"}),i.jsxs(l,{gap:h?"4px":"8px",children:[i.jsx(ne,{title:e==null?void 0:e.title,de
28scription:e==null?void 0:e.description}),i.jsx(de,{tags:e==null?void 0:e.tags,category:((F=e==null?void 0:e.category)==null?void 0:F.name)??((I=e==null?void 0:e.workCategory)==null?void 0:I.name)})]})]})]}),i.jsx(S,{visibility:Y,children:i.jsx(ie,{onClose:()=>{H()},status:u.status==="pending"?"loading":u.status,title:u.status==="success"?"Published!":"Publishing...",subtitle:""})}),i.jsx(S,{visibility:O,children:i.jsx(ae,{onCancel:()=>{a(!1)},onPublish:()=>{u.mutate(),a(!1),j(!0)}})})]})};export{be as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.