PageSourceSearch

https://www.geniusmesh.com/assets/ConfirmInterviewSlots-BfPnXehz.js

js geniusmesh.com collected 2026-09-29 07:40:31 UTC 19,171 bytes, 1 lines download raw bytes

1import{r as c,j as e,e as W,i as d,ap as Q,aQ as ie,c1 as oe,aR as ae,e1 as le,V as ce,B as z,I as de,ej as me,dD as xe,cw as pe,eB as ue,eC as he,aY as ne,aD as ge}from"./vendor-CPFPxuAM.js";import{A as re,x as fe,u as be,aY as je}from"./landing-pages-BJ63sDjk.js";import{u as ye,t as Ne}from"./tick-UQDJ2Yy3.js";import{N as G}from"./index-hOS39ZS3.js";function we(y,N=400){const[s,w]=c.useState(y),f=c.useRef();return c.useEffect(()=>(f.current&&clearTimeout(f.current),f.current=setTimeout(()=>w(y),N),()=>clearTimeout(f.current)),[y,N]),s}const ve=({open:y,handleOpen:N,interviewData:s,onConfirm:w,redirectionUrl:f})=>{const[p,I]=c.useState(null),[C,F]=c.useState(!1),v=c.useMemo(()=>{var u;if(!s)return[];const n=(u=s==null?void 0:s.application)==null?void 0:u.proposedInterviewSlots;return!n||typeof n!="object"?[]:Object.entries(n).map(([m,o])=>{var b;return{id:o.id||m,date:o.dateSlot?o.dateSlot.split(" ")[0]+" "+o.dateSlot.split(" ")[1]+" "+o.dateSlot.split(" ")[2]:"N/A",time:o.title||((b=o.dateSlot)==null?void 0:b.split(" ").slice(3).join(" "))||"N/A",fullDateSlot:o.dateSlot,interviewFormat:o.interviewFormat,start_date:o.start_date,end_date:o.end_date,...o}})},[s]),g=c.useMemo(()=>{var u;const n=(u=s==null?void 0:s.application)==null?void 0:u.proposedInterviewSlots;if(n){const m=Object.values(n)[0];return(m==null?void 0:m.interviewFormat)||"Online"}return(s==null?void 0:s.format)||"Online"},[s]),E=c.useMemo(()=>{const n=g.toLowerCase();return n==="video"||n==="online"?"Virtual":n==="phone"?"Phone":n.includes("in-person")||n.includes("in person")?"In-person":g},[g]),M=async()=>{var n,u,m,o,b,B,V,A,k,H;if(p===null){z.error("Please select a time slot");return}try{F(!0);const l=v.filter(r=>r.id===p);if(l.length===0){z.error("Invalid slots selected"),F(!1);return}const P=(u=(n=s==null?void 0:s.application)==null?void 0:n.applicant)==null?void 0:u._id,i=s==null?void 0:s.postedByName,j=((m=s==null?void 0:s.application)==null?void 0:m.hiringTeamEmails)||"",L=new URLSearchParams(window.location.search),_=window.location.search;let O=L.get("interview-request")==="true";O||(O=/interview-request[%=]*true/i.test(_));const R=(o=s==null?void 0:s.application)==null?void 0:o.proposedInterviewSlots,T=R&&typeof R=="object"?Object.values(R)[0]:null,q=(T==null?void 0:T.isAdminRequest)===!0||((b=s==null?void 0:s.application)==null?void 0:b.adminInterview)==="true";console.log("isAdminRequest from proposedSlots or adminInterview:",q,s);const Y=q?re.CANDIDATE.POST_CONFIRM_ADMIN_INTERVIEW:re.CANDIDATE.POST_CONFIRM_INTERVIEW;let S;if(O){const r=g.toLowerCase(),x=r==="online"||r==="video"?"Online":r==="phone"?"Phone":"In-Person";S={jobId:s==null?void 0:s.job_id,applicantId:P,interviewFormat:x,employerEmail:j||i||"",confirmedInterviewSlots:l.map(a=>({id:a.id,title:a.title,interviewFormat:a.interviewFormat||x,start_date:a.start_date,end_date:a.end_date,allDay:a.allDay||!1,dateSlot:a.dateSlot,...x==="Online"&&(a!=null&&a.meetingLink)?{meetingLink:a.meetingLink}:{},...x==="Phone"&&(a!=null&&a.phoneNumber)?{phoneNumber:a.phoneNumber}:{},...x==="In-Person"&&(a!=null&&a.meetingAddress)?{meetingAddress:a.meetingAddress}:{}}))}}else S={jobId:s==null?void 0:s.job_id,applicantId:P,interviewFormat:g.toLowerCase()==="online"?"video":g.toLowerCase(),employerEmail:j||i||"",confirmedInterviewSlots:l.map(r=>{const x=g.toLowerCase(),a=x==="online"||x==="video"?"Online":x==="phone"?"Phone":"In-Person";return{id:r.id,title:r.title,interviewFormat:r.interviewFormat,start_date:r.start_date,end_date:r.end_date,allDay:r.allDay||!1,dateSlot:r.dateSlot,...a==="Online"&&(r!=null&&r.meetingLink)?{meetingLink:r.meetingLink}:{},...a==="Phone"&&(r!=null&&r.phoneNumber)?{phoneNumber:r.phoneNumber}:{},...a==="In-Person"&&(r!=null&&r.meetingAddress)?{meetingAddress:r.meetingAddress}:{}}}),redirectionUrl:f||""};console.log("Confirming interview with payload:",S),await fe(Y,S)&&(w&&w(l),I([]),N())}catch(l){console.error("Error confirming interview:",l);const P=((V=(B=l==null?void 0:l.response)==null?void 0:B.data)==null?void 0:V.message)||((H=(k=(A=l==null?void 0:l.response)==null?void 0:A.data)==null?void 0:k.error)==null?void 0:H.message)||(l==null?void 0:l.message)||"Failed to confirm interview slots";z.error(P),F(!1)}finally{F(!1)}};return e.jsxs(W.Dialog,{open:y,handler:N,size:"lg",className:"rounded-3xl shadow-none overflow-hidden",children:[e.jsxs(W.DialogHeader,{className:"relative flex flex-col items-center pt-8 pb-4",children:[e.jsx(W.IconButton,{variant:"text",color:"blue-gray",onClick:N,className:"!absolute top-4 right-4",children:e.jsx(d,{icon:Q,className:"h-5 w-5"})}),e.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Select Interview Time"}),e.jsx("p",{className:"text-sm font-normal text-gray-600 mt-2",children:"Please select one preferred time slot from the options below."})]}),e.jsxs(W.DialogBody,{className:"grid grid-cols-1 md:grid-cols-2 gap-8 px-8 pb-10",children:[e.jsxs("div",{className:"bg-[#F8FAFF] rounded-2xl p-6 border border-[#
1E9EEF4]",children:[e.jsx("h3",{className:"text-lg font-bold text-gray-900 mb-6",children:"Opportunity Details"}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 flex items-center justify-center rounded-lg bg-white shadow-sm border border-[#E9EEF4] text-[#2DCDC0]",children:e.jsx(d,{icon:ie,className:"h-4 w-4"})}),e.jsx("span",{className:"font-bold text-gray-900 text-sm",children:"Role"})]}),e.jsx("span",{className:"text-gray-600 text-sm",children:(s==null?void 0:s.job_title)||"Senior Product Manager"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 flex items-center justify-center rounded-lg bg-white shadow-sm border border-[#E9EEF4] text-[#2DCDC0]",children:e.jsx(d,{icon:oe,className:"h-4 w-4"})}),e.jsx("span",{className:"font-bold text-gray-900 text-sm",children:"Company"})]}),e.jsx("span",{className:"text-gray-600 text-sm",children:(s==null?void 0:s.org_name)||"Confidential"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 flex items-center justify-center rounded-lg bg-white shadow-sm border border-[#E9EEF4] text-[#2DCDC0]",children:e.jsx(d,{icon:g.toLowerCase()==="phone"?ae:le,className:"h-4 w-4"})}),e.jsx("span",{className:"font-bold text-gray-900 text-sm",children:"Interview Format"})]}),e.jsx("span",{className:"text-gray-600 text-sm",children:E})]})]})]}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("h3",{className:"text-lg font-bold text-gray-900 mb-4",children:"Slot Options"}),e.jsx("div",{className:"space-y-3 flex-grow",children:v.map(n=>e.jsxs("div",{onClick:()=>{I(p===n.id?null:n.id)},className:`flex items-center gap-4 p-4 rounded-xl border cursor-pointer transition-all duration-200 ${p===n.id?"bg-[rgba(244,247,255,1)] border-[#2DCDC0]":"bg-white border-gray-200 hover:border-gray-300"}`,children:[e.jsx("div",{className:`w-6 h-6 rounded-full border-2 flex items-center justify-center transition-all duration-200 ${p===n.id?"border-[rgba(45,205,192,1)]":"border-gray-300"}`,children:p===n.id&&e.jsx("div",{className:"w-3 h-3 rounded-full bg-[rgba(45,205,192,1)]"})}),e.jsxs("span",{className:`text-sm font-medium ${p===n.id?"text-gray-900":"text-gray-700"}`,children:[n.date," · ",n.time," ","(EST)"]})]},n.id))}),e.jsxs("div",{className:"flex gap-4 mt-8",children:[e.jsxs("button",{onClick:M,disabled:p===null||C,className:`flex-1 py-3 px-4 rounded-xl font-bold text-sm transition-all duration-200 flex items-center justify-center gap-2 ${p!==null&&!C?"bg-[#2DCDC0] text-white hover:bg-[#25b5a8]":"bg-gray-100 text-gray-400 cursor-not-allowed"}`,children:[C&&e.jsx(d,{icon:ce,className:"animate-spin"}),C?"Confirming...":"Confirm Selected Slot"]}),e.jsx("button",{onClick:N,disabled:C,className:"px-6 py-3 rounded-xl border border-gray-200 text-gray-700 font-bold text-sm hover:bg-gray-50 transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed",children:"Cancel"})]})]})]})]})},Ee=({onBack:y})=>{var S,D,r,x,a,J,K,Z,$,ee,se,te;const{user:N}=be(),[s]=de(),[w,f]=c.useState(""),[p,I]=c.useState(!1),[C,F]=c.useState(null),[X,v]=c.useState(1),[g]=c.useState(10),[E,M]=c.useState(""),[n,u]=c.useState(""),[m,o]=c.useState(""),[b,B]=c.useState(!1),[V,A]=c.useState(!1),k=s.get("applicantId"),H=we(w,500),l=ye({page:X,limit:g,search:H,applicantId:k,requestedOnStart:E,requestedOnEnd:n,interviewFormat:m},{enabled:!!k}),P=l.isLoading,i=l.error,j=l.data,L=!!(((S=i==null?void 0:i.response)==null?void 0:S.status)===404&&((J=(a=(x=(r=(D=i==null?void 0:i.response)==null?void 0:D.data)==null?void 0:r.error)==null?void 0:x.message)==null?void 0:a.toLowerCase)!=null&&J.call(a).includes("no requested interviews")||(ee=($=(Z=(K=i==null?void 0:i.response)==null?void 0:K.data)==null?void 0:Z.message)==null?void 0:$.toLowerCase)!=null&&ee.call($).includes("no requested interviews"))),_=L?[]:(j==null?void 0:j.interviews)||[];L||j!=null&&j.pagination;const O=()=>{f(""),M(""),u(""),o(""),v(1)},R=t=>{F(t),I(!0)},T=t=>{console.log("Interview confirmed with slots:",t),z.success("Interview slots confirmed successfully!"),I(!1),l.refetch(),A(!0)},q=t=>t?t.toLowerCase()==="online"?"Virtual":t:"Online",Y=[{name:"Company & Position",selector:t=>t.org_name,sortable:!0,width:"25%",cell:t=>{var h;return e.jsxs("div",{className:"flex items-center space-x-3 py-2",children:[e.jsx("div",{className:"w-10 h-10 bg-[#2DCDC0] rounded-lg flex items-center justify-center text-white font-semibold text-sm",children:((h=t.org_name||t.company_name)==null?void 0:h.split(" ").map(U=>U[0]).join("").substring(0,2))||"N/A"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-gray-900",children:t.job_title||"N/A"}),e.jsx("p",{className:"text-sm text-gray-500",children:t.org_name||t.company_name||"N/A"})]})]})}},{name:"Interview Format",selector:t=>q(t.interviewFormat),sortable:!0,width:"15%",cell:t=>{var h;return e.jsx("div",{className:"py-2",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(d,{icon:((h=t.interviewFormat)==null?void 0:h.toLowerCase())==="phone"?ae:le,className:"w-4 h-4 text-[#2DCDC0]"}),e.jsx("span",{className:"font-medium text-gray-900",children:q(t.interviewFormat)})]})})}},{name:"Proposed Slots",selector:t=>{var h;
1return(h=t.application)==null?void 0:h.proposedInterviewSlots},sortable:!1,width:"20%",cell:t=>{var h,U;return e.jsx("div",{className:"py-2",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(d,{icon:ne,className:"w-4 h-4 text-[#2DCDC0]"}),e.jsxs("span",{className:"font-medium text-gray-900",children:[Object.keys(((h=t.application)==null?void 0:h.proposedInterviewSlots)||{}).length||0," ","Slot",Object.keys(((U=t.application)==null?void 0:U.proposedInterviewSlots)||{}).length!==1?"s":""]})]})})}},{name:"Status",selector:t=>"Awaiting Confirmation",sortable:!1,width:"15%",cell:t=>e.jsx("div",{className:"py-2",children:e.jsx("span",{className:"inline-flex items-center px-3 py-1 bg-blue-100 text-blue-700 rounded-full text-xs font-medium",children:"Awaiting Confirmation"})})},{name:"Actions",selector:t=>t._id||t.id,sortable:!1,width:"15%",cell:t=>e.jsx("div",{className:"py-2",children:e.jsxs("button",{onClick:()=>R(t),className:"bg-[#2DCDC0] text-white px-4 py-2 rounded-lg text-xs font-medium hover:bg-[#25b5a8] transition-colors flex items-center gap-2",children:[e.jsx(d,{icon:ge,className:"w-3 h-3"}),"Select Time"]})})}];return P?e.jsxs("div",{className:"min-h-screen bg-gray-50 flex flex-col",children:[e.jsx(G,{}),e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"inline-block animate-spin rounded-full h-12 w-12 border-b-2 border-[#2DCDC0]"}),e.jsx("p",{className:"mt-4 text-gray-600",children:"Loading interview requests..."})]})})]}):i&&!L?e.jsxs("div",{className:"min-h-screen bg-gray-50 flex flex-col",children:[e.jsx(G,{}),e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsxs("div",{className:"text-center max-w-md",children:[e.jsx("div",{className:"w-16 h-16 mx-auto mb-4 bg-red-50 rounded-full flex items-center justify-center",children:e.jsx(d,{icon:me,className:"w-8 h-8 text-red-500"})}),e.jsx("p",{className:"text-red-600 font-medium",children:((te=(se=i==null?void 0:i.response)==null?void 0:se.data)==null?void 0:te.message)||(i==null?void 0:i.message)||"Failed to load interview requests"}),e.jsx("button",{onClick:()=>window.location.reload(),className:"mt-4 px-6 py-2 bg-[#2DCDC0] text-white rounded-lg hover:bg-[#25b5a8] transition-all",children:"Try Again"})]})})]}):e.jsxs(e.Fragment,{children:[e.jsx(je,{title:"Confirm Interview Slots | GeniusMesh Executive Recruitment",description:"Select and confirm your preferred interview time slots with potential employers on the GeniusMesh platform.",noindex:!0}),e.jsxs("div",{className:"min-h-screen bg-gray-50 flex flex-col",children:[e.jsx(G,{}),e.jsxs("div",{className:"lg:px-28 md:px-20 px-4 py-6 sm:py-8 flex-1",children:[e.jsxs("div",{className:"mb-8",children:[y&&e.jsxs("button",{onClick:y,className:"flex items-center gap-2 text-[#2DCDC0] hover:text-[#25b5a8] mb-4 font-medium",children:[e.jsx(d,{icon:xe,className:"w-4 h-4"}),"Back"]}),e.jsx("h1",{className:"text-3xl font-bold text-gray-900 mb-2",children:"Confirm Interview Slots"}),e.jsx("p",{className:"text-gray-600",children:"Review and confirm your interview request time slots"})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-4 sm:p-6 mb-6",children:[e.jsxs("div",{className:"flex flex-col lg:flex-row gap-4 lg:gap-6 items-stretch lg:items-end justify-between",children:[e.jsx("div",{className:"flex-1",children:e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:e.jsx(d,{icon:pe,className:"w-4 h-4 text-gray-400"})}),e.jsx("input",{type:"text",value:w,onChange:t=>{f(t.target.value),v(1)},placeholder:"Search by company or position...",className:"w-full lg:w-96 pl-10 pr-4 py-2.5 sm:py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-[#2DCDC0] focus:border-[#2DCDC0] transition-colors text-sm"})]})}),e.jsxs("button",{onClick:()=>B(!b),className:`flex items-center space-x-2 px-4 py-3 rounded-lg font-medium transition-all duration-200 text-xs ${b?"bg-[#2DCDC0] text-white":"bg-white border border-gray-300 text-gray-700 hover:bg-gray-50"}`,children:[e.jsx(d,{icon:ue,className:"w-4 h-4"}),e.jsx("span",{children:"Filters"})]}),e.jsxs("button",{onClick:O,className:"flex items-center space-x-2 bg-white border border-gray-300 text-gray-700 px-4 py-3 rounded-lg font-medium hover:bg-gray-50 transition-colors text-xs",children:[e.jsx(d,{icon:Q,className:"w-4 h-4"}),e.jsx("span",{children:"Clear"})]})]}),b&&e.jsx("div",{className:"mt-6 pt-6 border-t border-gray-200",children:e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Start Date"}),e.jsx("input",{type:"date",value:E,onChange:t=>{M(t.target.value),v(1)},max:n||void 0,className:"w-full border border-gray-300 rounded-lg px-4 py-3 text-sm focus:ring-2 focus:ring-[#2DCDC0] focu
1s:border-[#2DCDC0]"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"End Date"}),e.jsx("input",{type:"date",value:n,onChange:t=>{u(t.target.value),v(1)},min:E||void 0,className:"w-full border border-gray-300 rounded-lg px-4 py-3 text-sm focus:ring-2 focus:ring-[#2DCDC0] focus:border-[#2DCDC0]"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Interview Format"}),e.jsxs("select",{value:m,onChange:t=>{o(t.target.value),v(1)},className:"w-full border border-gray-300 rounded-lg px-4 py-3 text-sm focus:ring-2 focus:ring-[#2DCDC0] focus:border-[#2DCDC0]",children:[e.jsx("option",{value:"",children:"All Formats"}),e.jsx("option",{value:"video",children:"Video"}),e.jsx("option",{value:"phone",children:"Phone"}),e.jsx("option",{value:"in-person",children:"In Person"})]})]})]})})]}),e.jsx("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 overflow-x-auto",children:e.jsx("div",{className:"min-w-[720px] md:min-w-0",children:_.length>0?e.jsx(he,{columns:Y,data:_,pagination:!0,paginationServer:!0,highlightOnHover:!0,responsive:!0,paginationComponent:()=>e.jsx("div",{className:"flex flex-col sm:flex-row gap-2 sm:gap-0 sm:justify-between sm:items-center px-4 sm:px-6 py-3 sm:py-4 bg-gray-50 border-t border-gray-200",children:e.jsxs("span",{className:"text-xs sm:text-sm text-gray-600",children:["Showing ",_.length," interview request",_.length!==1?"s":""]})}),customStyles:{headRow:{style:{backgroundColor:"#f9fafb",minHeight:"56px",borderBottom:"1px solid #e5e7eb"}},headCells:{style:{fontSize:"13px",fontWeight:"600",textAlign:"left",paddingLeft:"16px",paddingRight:"16px",color:"#374151",textTransform:"none",whiteSpace:"nowrap"}},rows:{style:{minHeight:"72px",borderBottom:"1px solid #f3f4f6","&:hover":{backgroundColor:"#f9fafb"}}},cells:{style:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"12px",paddingBottom:"12px"}}}}):e.jsx("div",{className:"p-12",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"w-16 h-16 mx-auto mb-4 bg-gray-50 rounded-full flex items-center justify-center",children:e.jsx(d,{icon:ne,className:"w-8 h-8 text-gray-400"})}),e.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"No Interview Requests Found"}),e.jsx("p",{className:"text-sm text-gray-600",children:w||E||n||m?"No interview requests match your search criteria":"You don't have any pending interview requests at this time"})]})})})})]}),e.jsx(ve,{open:p,handleOpen:()=>I(!1),interviewData:C,onConfirm:T,redirectionUrl:""}),V&&e.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100] bg-black bg-opacity-50",onClick:()=>{A(!1),window.location.replace("/signup/executive")},children:e.jsxs("div",{className:"bg-white rounded-2xl p-12 flex flex-col items-center max-w-lg shadow-2xl relative",onClick:t=>t.stopPropagation(),children:[e.jsx("button",{onClick:()=>{A(!1),window.location.replace("/signup/executive")},className:"absolute top-6 right-6 text-gray-400 hover:text-gray-600 transition-colors",children:e.jsx(d,{icon:Q,className:"h-6 w-6"})}),e.jsx("div",{className:"mb-6",children:e.jsx("img",{src:Ne,alt:"Success",className:"h-16 w-16"})}),e.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-4 text-center",children:"Slot selected successfully"}),e.jsx("p",{className:"text-base text-gray-600 text-center leading-relaxed",children:"We'll notify you once the interview is confirmed with meeting details."})]})})]})]})};export{Ee 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.