1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7636],{32427:function(e,t,r){r.r(t),r.d(t,{default:function(){return x}});var n=r(26705),i=r(20955),o=r(52679),l=r(37948),s=r(61718),a=r(69571),d=r(53226),c=r(2913),u=r(29420),m=r(26982),f=r(95518);let p={INBOX:"inbox",ARCHIVE:"archive",ACCEPTED_INTERVIEW:"accepted_interview",SCHEDULED_INTERVIEW:"scheduled_interview",PRE_INTERVIEW:"pre_interview"};p.INBOX,p.ARCHIVE,p.ACCEPTED_INTERVIEW,p.SCHEDULED_INTERVIEW,p.PRE_INTERVIEW;var h=r(71424),v=r(70782),g=r(17219),w=r(17765);r(78331),r(15979),r(13939);var x=e=>{let{isOpen:t,onClose:r,participantId:x,chatId:I,profileId:y,socket:E}=e,[D,C]=(0,i.useState)(!1),[b,R]=(0,i.useState)(g.H),[k,N]=(0,i.useState)(""),[j,S]=(0,i.useState)(""),[L,W]=(0,i.useState)(!1),{createOrUpdate:T,getById:A,getByChatId:F,getByGuestId:_,createReportIssue:H}=(0,m.d)({onSuccess:e=>{},onError:e=>{console.error("Error:",e)}}),{data:P}=v.S.profile.getOrCreateCreatorProfile.useQuery({profileId:y}),{updateChatStatus:V}=(0,f.R)(),{data:M,isLoading:q,error:U}=F(I),z=y===(null==M?void 0:M.interviewerId);(null==M?void 0:M.scheduledAt)&&new Date(M.scheduledAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}),(0,i.useEffect)(()=>{M&&(C(M.isCompleted||!1),R(e=>e.map(e=>{let t=!1;switch(e.type){case"review":t=M.isMatch;break;case"preInterview":t=M.preInterviewDone;break;case"releaseForm":t=M.releaseFormSigned;break;case"recordingDate":t=M.isRecordingDateComplete;break;case"confirmComplete":t=M.confirmedComplete;break;case"estimatedRelease":t=!!M.estimatedRelease,M.estimatedRelease&&S(new Date(M.estimatedRelease).toISOString().split("T")[0]);break;case"episodeLink":t=!!M.episodeLink}return{...e,isCompleted:t}})))},[M]);let B=b.findIndex(e=>!e.isCompleted),O=async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!I||!z){console.error("Chat ID is required or user is not authorized");return}if(B<b.length-1){let t=b[B],r={chatId:I,...e?{["review"===t.type?"isMatch":"preInterview"===t.type?"preInterviewDone":"releaseForm"===t.type?"releaseFormSigned":"isCompleted"]:!0}:{["review"===t.type?"isMatch":"preInterview"===t.type?"preInterviewDone":"releaseForm"===t.type?"releaseFormSigned":"confirmComplete"===t.type?"confirmedComplete":"isCompleted"]:!0}};if("estimatedRelease"!==t.type)try{await T.mutateAsync(r),"review"!==t.type||e||await V(I,p.ACCEPTED_INTERVIEW,"add"),"preInterview"!==t.type||e||await V(I,p.PRE_INTERVIEW,"add"),R(e=>e.map((e,t)=>t===B&&t<b.length-1?{...e,isCompleted:!0}:e))}catch(e){console.error("Error updating step:",e)}}},X=async(e,t)=>{if(!I||!z){console.error("Chat ID is required or user is not authorized");return}if(!e){console.error("Recording date is required");return}let r=new Date(e);try{if(await T.mutateAsync({chatId:I,recordingDate:r,isRecordingDateComplete:!0,...t&&{interviewRecordingLink:t}}),E&&I&&y){let e=r.toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}),n="\uD83C\uDFA5 Recording scheduled for ".concat(e,"\n\n\uD83D\uDD17 Interview Recording Link: ").concat(t||"Not provided");E.emit("send_message",{chatId:I,senderId:y,content:n})}R(e=>e.map((e,t)=>"recordingDate"===e.type?{...e,isCompleted:!0}:e))}catch(e){console.error("Error setting recording date:",e)}},Y=async(e,t)=>{if(!I||!z){console.error("Chat ID is required or user is not authorized");return}if(!e){console.error("Pre-interview date is required");return}let r=new Date(e);console.log("interviewLink",t);try{if(await T.mutateAsync({chatId:I,preInterviewDate:r,preInterviewDone:!0,...t&&{preInterviewLink:t}}),E&&I&&y){let e=r.toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}),n="Pre-interview scheduled for ".concat(e,"\n\n\uD83D\uDD17 Interview Link: ").concat(t||(null==P?void 0:P.preInterviewCalendarLink)||"Not provided");E.emit("send_message",{chatId:I,senderId:y,content:n})}R(e=>e.map((e,t)=>"preInterview"===e.type?{...e,isCompleted:!0}:e))}catch(e){console.error("Error setting pre-interview date:",e)}},Z=e=>{if(!I||!z){console.error("Chat ID is required or user is not authorized");return}if(!e){console.error("Episode link is required");return}T.mutate({chatId:I,episodeLink:e},{onSuccess:()=>{O(),E.emit("send_message",{chatId:I,senderId:y,content:"\uD83D\uDCFA Episode Link: ".concat(e)})},onError:e=>{console.error("Error setting episode link:",e)}})},G=e=>{if(!I||!z){console.error("Chat ID is required or user is not authorized");return}if(!e){console.error("Estimated release date is required");return}let t=new Date(e);T.mutate({chatId:I,estimatedRelease:t},{onSuccess:()=>{R(e=>e.map((e,t)=>"estimatedRelease"===e.type?{...e,isCompleted:!0}:e)),O()},onError:e=>{console.error("Error setting estimated release date:",e)}})},K=async e=>{if(!I||!z){console.error("Chat ID is required or user is not authorized");return}if(!e){console.error("Release form link is required");return}try{await T.mutateAsync({chatId:I,releaseFormSigned:!0}),E&&I&&y&&E.emit("send_message",{chatId:I,senderId:y,content:"\uD83D\uDCDD Release Form Link: ".concat(e)}),R(e=>e.map((e,t)=>"releaseForm"===e.type?{...e,isCompleted:!0}:e))}catch(e){console.error("Error setting release form link:",e)}},Q=e=>{if(!I||!z||!(null==M?void 0:M.id)){console.error("Chat ID is required or user is not authorized");return}H.mutate({message:e,interviewProcessId:null==M?void 0:M.id,profileId:y})},J=()=>{if(!I||!z){console.error("Chat ID is required or user is not authorized");return}T.mutate({chatId:I,isCanceled:!1,isRejected:!1,isCompleted:!1,preInterviewDone:!1,releaseFormSigned:!1,isRecordingDateComplete:!1,confirmedComplete:!1,estimatedRelease:void 0,episodeLink:void 0}),R(g.H)},$=async()=>
1{if(I&&b.every(e=>e.isCompleted)){W(!0);try{await V(I,p.ACCEPTED_INTERVIEW,"remove"),await V(I,p.SCHEDULED_INTERVIEW,"add"),await T.mutateAsync({chatId:I,isScheduled:!0}),h.Am.success("Interview scheduled successfully"),r()}catch(e){console.error("Error scheduling interview:",e),h.Am.error("Failed to schedule interview")}finally{W(!1)}}},ee=async()=>{if(I&&z){W(!0);try{await T.mutateAsync({chatId:I,isCanceled:!0}),h.Am.success("Interview cancelled"),r()}catch(e){console.error("Error cancelling interview:",e),h.Am.error("Failed to cancel interview")}finally{W(!1)}}};return(0,n.jsx)(o.R,{isOpen:t,onClose:r,size:"2xl",scrollBehavior:"inside",children:(0,n.jsxs)(l.A,{children:[(0,n.jsx)(s.k,{className:"flex flex-col gap-1",children:"Next Steps"}),(0,n.jsx)(a.I,{children:q?(0,n.jsxs)("div",{className:"animate-pulse space-y-4",children:[(0,n.jsx)("div",{className:"h-4 w-3/4 rounded bg-default-200"}),(0,n.jsx)("div",{className:"space-y-3",children:[void 0,void 0,void 0].map((e,t)=>(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("div",{className:"h-6 w-6 rounded-full bg-default-200"}),(0,n.jsx)("div",{className:"h-4 flex-1 rounded bg-default-200"})]},t))})]}):(0,n.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,n.jsx)("div",{className:"flex max-h-[400px] flex-col gap-3 overflow-y-auto pr-2",children:b.map((e,t)=>{var r;return(0,n.jsx)(w.Z,{step:e,index:t,isCurrentStep:t===B,onStepAction:z?O:void 0,onDateTimeSubmit:X,onEpisodeLinkSubmit:Z,onEstimatedReleaseSubmit:G,onPreInterviewSubmit:Y,onReleaseFormSubmit:K,recordingDateTime:(null==M?void 0:null===(r=M.recordingDate)||void 0===r?void 0:r.toISOString())||null,episodeLink:k,estimatedReleaseDate:j,isRejected:(null==M?void 0:M.isRejected)||!1,isCanceled:(null==M?void 0:M.isCanceled)||!1,isInterviewer:z,creatorProfile:P||null,reportIssue:Q,startAgain:J},t)})}),(0,n.jsxs)("div",{className:"max-h-[150px] overflow-y-auto pr-2 scrollbar-thin scrollbar-thumb-default-400 scrollbar-track-transparent hover:scrollbar-thumb-default-500",children:[(null==M?void 0:M.preInterviewDate)&&(0,n.jsxs)("div",{className:"mt-2",children:[(0,n.jsxs)("p",{className:"font-inter text-sm text-foreground",children:["Pre-interview: ",(0,n.jsx)("span",{className:"font-medium text-default-600",children:new Date(M.preInterviewDate).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0})})]}),M.preInterviewLink&&(0,n.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,n.jsx)("p",{className:"font-inter text-sm whitespace-nowrap text-foreground",children:"Pre-interview Link:"}),(0,n.jsx)("a",{href:M.preInterviewLink,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:text-primary/80 underline max-w-[200px] truncate inline-block",title:M.preInterviewLink,children:M.preInterviewLink})]})]}),(null==M?void 0:M.recordingDate)&&(0,n.jsxs)("div",{className:"mt-2",children:[(0,n.jsxs)("p",{className:"font-inter text-sm text-foreground",children:["Recording Date: ",(0,n.jsx)("span",{className:"font-medium text-default-600",children:new Date(M.recordingDate).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0})})]}),M.interviewRecordingLink&&(0,n.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,n.jsx)("p",{className:"font-inter text-sm whitespace-nowrap text-foreground",children:"Recording Link:"}),(0,n.jsx)("a",{href:M.interviewRecordingLink,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:text-primary/80 underline max-w-[200px] truncate inline-block",title:M.interviewRecordingLink,children:M.interviewRecordingLink})]})]}),(null==M?void 0:M.estimatedRelease)&&(0,n.jsx)("div",{className:"mt-2",children:(0,n.jsxs)("p",{className:"font-inter text-sm text-foreground",children:["Estimated Release: ",(0,n.jsx)("span",{className:"font-medium text-default-600",children:new Date(M.estimatedRelease).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]})}),(null==M?void 0:M.episodeLink)&&(0,n.jsx)("div",{className:"mt-2",children:(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("p",{className:"font-inter text-sm whitespace-nowrap text-foreground",children:"Episode Link:"}),(0,n.jsx)("a",{href:M.episodeLink,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:text-primary/80 underline max-w-[200px] truncate inline-block",title:M.episodeLink,children:M.episodeLink})]})}),(null==M?void 0:M.releaseFormSigned)&&(null==P?void 0:P.interviewReleaseFormUrl)&&(0,n.jsx)("div",{className:"mt-2",children:(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("p",{className:"font-inter text-sm whitespace-nowrap text-foreground",children:"Release Form:"}),(0,n.jsx)("a",{href:P.interviewReleaseFormUrl,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:text-primary/80 underline max-w-[200px] truncate inline-block",title:P.interviewReleaseFormUrl,children:P.interviewReleaseFormUrl})]})})]}),(null==M?void 0:M.isCanceled)&&(0,n.jsx)("div",{className:"font-inter text-sm font-semibold text-danger",children:"Interview has been Canceled"}),!(null==M?void 0:M.isRejected)&&!(null==M?void 0:M.isCanceled)&&z&&(0,n.jsx)(d.K,{radius:"full",isSelected:D,onValueChange:e=>{C(e),I&&(T.mutate({chatId:I,isCompleted:e}),V(I,"completed",e?"add":"remove"))},classNames:{label:"font-inter text-sm text-foreground"},children:"Complete interview"})]})}),(0,n.jsxs)(c.R,{children:[(0,n.jsx)(u.A,{color:"danger",variant:"light",onPress:r,children:"Close"}),!(null==M?void 0:M.isRejected)&&!(null==M?void 0:M.isCanceled)&&z&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(u.A,{color:"danger",variant:"bordered",onPress:ee,isLoading:L,children:"Cancel Interview"}),(0,n.jsx)(u.A,{color:"primary",onPress:$,isLoading:L,isDisabled:!b.every(e=>e.isCompleted),children:"Schedule"})]})]})]})})}},90272:function(e,t,r){r.d(t,{z:function(){return i},G:function(){return l}});var n=r(75676);function i(e,t){let r=o(e,t,"left"),n=o(e,t,"top"),i=t.offsetWidth,l=t.offsetHeight,s=e.scrollLeft,a=e.scrollTop,{borderTopWidth:d,borderLeftWidth:c}=getComputedStyle(e),u=e.scrollLeft+parseInt(c,10),m=e.scrollTop+parseInt(d,10),f=u+e.clientWidth,p=m+e.clientHeight;r<=s?s=r-parseInt(c,10):r+i>f&&(s+=r+i-f),n<=m?a=n-parseInt(d,10):n+l>p&&(a+=n+l-p),e.scrollLeft=s,e.scrollTop=a}function o(e,t,r){let n="left"===r?"offsetLeft":"offsetTop",i=0;for(;t.offsetParent&&(i+=t[n],t.offsetParent!==e);){if(t.offsetParent.contains(e)){i-=e[n];break}t=t.offsetParent}return i}function l(e,t){if(document.contains(e)){let a=document.scrollingElement||document.documentElement;if("hidden"===window.getComputedStyle(a).overflow)for(let t of function(e,t){let r=[];for(;e&&e!==document.documentElement;)(0,n.a)(e,void 0)&&r.push(e),e=e.parentElement;return r}(e))i(t,e);else{var r,o,l,s;let{left:n,top:i}=e.getBoundingClientRect();null==e||null===(r=e.scrollIntoView)||void 0===r||r.call(e,{block:"nearest"});let{left:a,top:d}=e.getBoundingClientRect();(Math.abs(n-a)>1||Math.abs(i-d)>1)&&(null==t||null===(l=t.containingElement)||void 0===l||null===(o=l.scrollIntoView)||void 0===o||o.call(l,{block:"center",inline:"center"}),null===(s=e.scrollIntoView)||void 0===s||s.call(e,{block:"nearest"}))}}}},86477:function(e,t,r){r.d(t,{z:function(){return o}});var n=r(34837),i=r(20955);function o(e,t,r,o){let l=(0,n.i)(r),s=null==r;(0,i.useEffect)(()=>
1{if(s||!e.current)return;let r=e.current;return r.addEventListener(t,l,o),()=>{r.removeEventListener(t,l,o)}},[e,t,o,s,l])}},35712:function(e,t,r){r.d(t,{Z:function(){return c}});let n=e=>"object"==typeof e&&null!=e&&1===e.nodeType,i=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,o=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let r=getComputedStyle(e,null);return i(r.overflowY,t)||i(r.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},l=(e,t,r,n,i,o,l,s)=>o<e&&l>t||o>e&&l<t?0:o<=e&&s<=r||l>=t&&s>=r?o-e-n:l>t&&s<r||o<e&&s>r?l-t+i:0,s=e=>{let t=e.parentElement;return null==t?e.getRootNode().host||null:t},a=(e,t)=>{var r,i,a,d;if("undefined"==typeof document)return[];let{scrollMode:c,block:u,inline:m,boundary:f,skipOverflowHiddenElements:p}=t,h="function"==typeof f?f:e=>e!==f;if(!n(e))throw TypeError("Invalid target");let v=document.scrollingElement||document.documentElement,g=[],w=e;for(;n(w)&&h(w);){if((w=s(w))===v){g.push(w);break}null!=w&&w===document.body&&o(w)&&!o(document.documentElement)||null!=w&&o(w,p)&&g.push(w)}let x=null!=(i=null==(r=window.visualViewport)?void 0:r.width)?i:innerWidth,I=null!=(d=null==(a=window.visualViewport)?void 0:a.height)?d:innerHeight,{scrollX:y,scrollY:E}=window,{height:D,width:C,top:b,right:R,bottom:k,left:N}=e.getBoundingClientRect(),{top:j,right:S,bottom:L,left:W}=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}}
1)(e),T="start"===u||"nearest"===u?b-j:"end"===u?k+L:b+D/2-j+L,A="center"===m?N+C/2-W+S:"end"===m?R+S:N-W,F=[];for(let e=0;e<g.length;e++){let t=g[e],{height:r,width:n,top:i,right:o,bottom:s,left:a}=t.getBoundingClientRect();if("if-needed"===c&&b>=0&&N>=0&&k<=I&&R<=x&&b>=i&&k<=s&&N>=a&&R<=o)break;let d=getComputedStyle(t),f=parseInt(d.borderLeftWidth,10),p=parseInt(d.borderTopWidth,10),h=parseInt(d.borderRightWidth,10),w=parseInt(d.borderBottomWidth,10),j=0,S=0,L="offsetWidth"in t?t.offsetWidth-t.clientWidth-f-h:0,W="offsetHeight"in t?t.offsetHeight-t.clientHeight-p-w:0,_="offsetWidth"in t?0===t.offsetWidth?0:n/t.offsetWidth:0,H="offsetHeight"in t?0===t.offsetHeight?0:r/t.offsetHeight:0;if(v===t)j="start"===u?T:"end"===u?T-I:"nearest"===u?l(E,E+I,I,p,w,E+T,E+T+D,D):T-I/2,S="start"===m?A:"center"===m?A-x/2:"end"===m?A-x:l(y,y+x,x,f,h,y+A,y+A+C,C),j=Math.max(0,j+E),S=Math.max(0,S+y);else{j="start"===u?T-i-p:"end"===u?T-s+w+W:"nearest"===u?l(i,s,r,p,w+W,T,T+D,D):T-(i+r/2)+W/2,S="start"===m?A-a-f:"center"===m?A-(a+n/2)+L/2:"end"===m?A-o+h+L:l(a,o,n,f,h+L,A,A+C,C);let{scrollLeft:e,scrollTop:d}=t;j=0===H?0:Math.max(0,Math.min(d+j/H,t.scrollHeight-r/H+W)),S=0===_?0:Math.max(0,Math.min(e+S/_,t.scrollWidth-n/_+L)),T+=d-j,A+=e-S}F.push({el:t,top:j,left:S})}return F},d=e=>!1===e?{block:"end",inline:"nearest"}:e===Object(e)&&0!==Object.keys(e).length?e:{block:"start",inline:"nearest"};function c(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;if("object"==typeof t&&"function"==typeof t.behavior)return t.behavior(a(e,t));let r="boolean"==typeof t||null==t?void 0:t.behavior;for(let{el:n,top:i,left:o}of a(e,d(t)))n.scroll({top:i,left:o,behavior:r})}}}]);
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.