PageSourceSearch

https://avua.com/assets/ExtendedSmartHire-Cs054AoF.js

js avua.com collected 2026-09-24 12:55:02 UTC 28,153 bytes, 2 lines download raw bytes

1import{j as e,i as z,u as $,aq as X,t as te,c as O,h as x,x as ge,hN as xe,hO as ee,hP as ne,N as F,hQ as oe,a2 as ue,a as fe,Q as ve,a3 as we,hR as he,hS as ye,hT as be,hU as Ne}from"./index-B9q78oLf.js";import{e as je}from"./Warning-COO-bZia.js";import{y as ae}from"./dashboard-BaS_FCEE.js";import{I as Ie}from"./InterviewLoadErrorModal-COYRuCX5.js";function Ee({handleNext:s=()=>{},handleBack:u=()=>{},hideBack:a=!1}){return e.jsxs("div",{className:" bg-[#FFFFFF] fixed bottom-0 right-0 left-0",children:[e.jsx("div",{className:"w-full h-[6px] bg-[#F7F3FF] flex",children:e.jsx("div",{className:`${a?"flex-[0.5]":"flex-[1]"} bg-gradient-to-r from-[#864EFF] to-[#502F99]`})}),e.jsxs("div",{className:"flex xs:flex-col md:flex-row md:justify-between md:items-center xs:px-[20px] xs:py-[25px] md:px-[80px] md:py-[25px] xs:gap-[10px]",children:[e.jsxs("div",{className:"",children:[e.jsx("span",{className:"text-[#7B7B7B]",children:"Need help?"})," ",e.jsx("span",{className:"text-[#7B7B7B]",children:"email: [email protected]"})]}),e.jsxs("div",{className:"flex xs:flex-col md:flex-row md:items-center md:gap-[40px] xs:gap-[20px]",children:[e.jsx("div",{className:"flex px-[50px] md:py-[20px] justify-center",children:!a&&e.jsx("button",{onClick:()=>{u()},className:"text-[#2B1845] font-[500] font-poppins leading-[19.2px] text-center",children:"Back"})}),e.jsx("div",{children:e.jsx("div",{className:"flex py-[20px] px-[50px] rounded-[50px] bg-gradient-to-r from-[#6B3BAB] to-[#2B1845] items-center justify-center cursor-pointer",onClick:()=>{s()},children:e.jsx("span",{className:"text-[#ffff] font-poppins font-[500] text-[16px] leading-[19.2px] ",children:"Continue"})})})]})]})]})}function Ae({name:s,setName:u,designation:a,uniqueId:A,companyName:S}){return e.jsx("div",{className:"flex justify-center items-center overflow-scroll mt-[130px] scrollbar-none",children:e.jsxs("div",{className:"flex flex-col justify-center items-center px-[30px] w-[720px]",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"text-[#2B1845] font-[500] md:text-[35px] text-[24px] mb-2",children:"AI interview for the role:"}),e.jsxs("p",{className:"text-[#2B1845] font-[500] md:text-[32px] text-[22px] mt-2 mb-[25px]",children:[a," at ",S]})]}),e.jsxs("div",{className:"w-full",children:[A?e.jsx(e.Fragment,{}):e.jsx("h1",{className:"mt-[40px] text-[#1B1B1B] text-[23px] font-[400] leading-[27.6px] font-poppins",children:"The interview is intended for"}),e.jsx("h1",{className:"text-[#1B1B1B] text-[23px] font-[400] leading-[27.6px] font-poppins mt-[20px]",children:"Name"}),e.jsx("input",{disabled:!A,value:s,className:"w-full outline-none border-[1px] border-[#D9D9D9] px-[16px] py-[14px] mt-[20px] rounded-[10px] font-poppins text-[18px] leading-[27px] font-[400] text-[#A2A2A2]",type:"text",placeholder:"",onChange:E=>u(E.target.value)})]})]})})}function Re({email:s,setEmail:u,uniqueId:a}){return e.jsx("div",{className:"flex flex-col justify-center items-center  px-[30px] w-full",children:e.jsxs("div",{className:"md:w-[660px] w-full ",children:[e.jsx("h1",{className:"text-[#1B1B1B] text-[23px] font-[400] leading-[27.6px] font-poppins mt-[40px]",children:"Email"}),e.jsx("input",{className:"md:w-[660px] w-full outline-none border-[1px] border-[#D9D9D9] px-[16px] py-[14px] mt-[20px] rounded-[10px] font-poppins text-[18px] leading-[27px] font-[400] text-[#A2A2A2]",value:s,disabled:!a,type:"text",placeholder:"",onChange:A=>u(A.target.value)})]})})}const Se=()=>{const s=()=>{const u="https://avua.com";window.location.href=u};return e.jsx("div",{className:"fixed inset-0 flex items-center justify-center bg-[#f8f9fe] ",children:e.jsx("div",{className:"flex flex-col items-center justify-center h-screen bg-gray-100 text-center px-4 w-full",children:e.jsxs("div",{className:"",children:[e.jsx("div",{className:"flex items-center justify-center mb-[10px] mx-auto bg-gray-200 rounded-full text-xl font-bold text-gray-700",children:e.jsx("img",{src:z.avuaSmartHire.aiAlertCircle,alt:""})}),e.jsx("h2",{className:"font-bold md:text-[44px] text-[23px] text-[#2b1845] mb-[20px]",children:"Oops! This Interview Is No Longer Available"}),e.jsx("p",{className:"md:text-[23px] text-[16px] text-[#1b1b1b] mb-[30px] ",children:"This interview has been closed by the employer and is no longer available."}),e.jsx("button",{className:"md:px-10 px-5 py-5  bg-gradient-to-r from-[#6b3bab] to-[#2b1845] text-[16px] font-semibold text-[#ffffff] rounded-full shadow-md",onClick:s,children:"Go to Home"})]})})})},De=()=>{const s=()=>{const u="https://avua.com";window.location.href=u};return e.jsx("div",{className:"fixed inset-0 flex items-center justify-center bg-[#f8f9fe]",children:e.jsx("div",{className:"flex flex-col items-center justify-center h-screen bg-gray-100 text-center px-4 w-full",children:e.jsxs("div",{className:"",children:[e.jsx("div",{className:"flex items-center justify-center mb-[10px] mx-auto bg-gray-200 rounded-full text-xl font-bold text-gray-700",children:e.jsx("img",{src:z.avuaSmartHire.aiAlertCircle,alt:""})}),e.jsx("h2",{className:"font-bold md:text-[44px] text-[23px] text-[#2b1845] mb-[20px]",children:"No Attempts Remaining"}),e.jsx("p",{className:"md:text-[23px] text-[16px] text-[#1b1b1b] mb-[30px]",children:"You have used all your available interview attempts for this position."}),e.jsx("button",{className:"md:px-10 px-5 py-5 bg-gradient-to-r from-[#6b3bab] to-[#2b1845] text-[16px] font-semibold text-[#ffffff] rounded-full shadow-md",onClick:s,children:"Exit"})]})})})},ke=()=>{const s=$(),u={background:"-webkit-linear-gradient(left, #864EFF, #502F99)",WebkitBackgroun
1dClip:"text",WebkitTextFillColor:"transparent",display:"inline-block"};return e.jsxs("div",{className:"fixed inset-0 flex items-center justify-center bg-[#f8f9fe]",children:[e.jsx("div",{className:"absolute top-6 left-6 text-2xl font-bold text-[#502F99]"}),e.jsx("div",{className:"flex absolute inset-0 justify-center items-center",children:e.jsxs("div",{className:"flex justify-center items-center flex-col gap-[31px]",children:[e.jsx("img",{src:je,className:"w-[247.57px] h-[159.73px] "}),e.jsxs("div",{className:"flex flex-col gap-[15px] justify-center items-center",children:[e.jsx("h1",{className:"font-[500] md:text-[35px] text-[27px] leading-[42px] text-[#1B1B1B] font-poppins",children:"Something Went Wrong !"}),e.jsx("button",{style:u,className:" md:px-[50px] px-[20px] py-[20px] rounded-l-full rounded-r-full  border-[1px] border-[#864EFF] font-poppins font-[500] text-[16px] leading-[19.2px] ",onClick:()=>{s("/")},children:"Go to home"})]})]})})]})},_e=()=>{const s=$();return e.jsx("div",{className:"fixed inset-0 flex items-center justify-center bg-[#f8f9fe]",children:e.jsxs("div",{className:"flex flex-col items-center justify-center h-screen bg-gray-100 px-[30px]",children:[e.jsx("img",{className:"h-[163px]",src:X.page_not_found.page_404}),e.jsxs("div",{className:"text-center mt-[31px] xl:mx-[400px]",children:[e.jsx("h1",{className:"text-[30px] font-poppins font-[500] text-gray-800 mb-[15px]",children:"Oops! Page Not Found"}),e.jsx("p",{className:"text-[18px] font-poppins font-[400] mb-[15px] text-[#424242]",children:"The page you are looking for might have been removed, had its name changed, or is temporarily unavailable."}),e.jsx("div",{children:e.jsx("button",{onClick:()=>s("/"),children:e.jsx("img",{src:X?.page_not_found?.go_home})})})]})]})})},Ce=({userDataPassToOTPModal:s,companyDetails:u,showToast:a=()=>{},onClose:A=()=>{}})=>{const S=$(),E=te(),b=[O.useRef(),O.useRef(),O.useRef(),O.useRef(),O.useRef(),O.useRef()],[D,P]=x.useState(!1),[B,R]=x.useState(30),[U,_]=x.useState(!1),[v,k]=x.useState(["","","","","",""]),h=()=>{k(["","","","","",""]),b[0].current.focus()},p=d=>{d.preventDefault();const m=d.clipboardData.getData("text").replace(/\D/g,"").split("").slice(0,6);k(m),b[m.length-1]?.current?.focus()},V=(d,o)=>{const m=d.target.value.replace(/\D/g,""),C=[...v];C[o]=m,k(C),m&&o<5?b[o+1]?.current?.focus():!m&&o>0&&b[o-1]?.current?.focus()},N=(d,o)=>{if(d.key==="Backspace")if(v[o]!==""){const m=[...v];m[o]="",k(m),d.preventDefault()}else o>0&&(b[o-1]?.current?.focus(),d.preventDefault())},G=async()=>{const d=s.token,o={email:s.email,"interview-id":s.interviewId,"full-name":s.name};try{const m=await ae(d,o);m&&m.msg==="success"&&(a("Verification code sent","success"),h(),j())}catch(m){console.log(m)}},j=()=>{P(!0),R(30);const d=setInterval(()=>{R(o=>o<=1?(clearInterval(d),P(!1),0):o-1)},1e3)},J=async()=>{_(!0);const d=localStorage.getItem("userAcknowledgmentData"),o=d?JSON.parse(d):{},m=o.interviewType||"regular",C=localStorage.getItem("pendingConversationalReferenceId");if(m==="conversational"){try{const w=s.token;if(!w){a("Failed to get authentication token","error");return}const I=await ee(w,{otp:v.join(""),interview_id:o.interviewId});if(I?.msg==="success"){const y=I.data.jwt_token;try{const l=await ne(y,o.interviewId);if(console.log("=== CONVERSATIONAL INTERVIEW API RESPONSE (By Interview ID) ==="),console.log("Full response:",l),console.log("Interview data:",l?.data),l?.msg==="success"){const r=l?.data?.interview_room_id,g=l?.data,T={token:y,roomId:r,companyName:o.companyName||"Unknown",interviewPositions:o.interviewPositions||"Unknown",interviewType:"conversational",jobDescription:g.job_description,experienceLevel:g.experience_level,language:g.interview_language,technicalRatio:g.weightage?.technical,culturalFit:g.cultural_fit};console.log("Storing in localStorage (userAcknowledgmentData):",T),localStorage.setItem("userAcknowledgmentData",JSON.stringify(T)),E(F({token:y,isAuthenticated:!0,userType:"applicant"}));const M=g?.company?.name||o.companyName||"Unknown";S(`/interview-prep?room_id=${r}&token=${y}
1`,{state:{jobTitle:g?.job_title?.title||o.interviewPositions,jobDescription:g?.job_description,experienceLevel:g?.experience_level,language:g?.interview_language,technicalRatio:g?.weightage?.technical,culturalFit:g?.cultural_fit,name:s.name,email:s.email,companyName:M,interviewType:"conversational"}})}}catch(l){console.error("Error fetching room ID for conversational interview:",l),a("Failed to initialize interview","error")}}}catch(w){w?.response?.data?.msg==="invalid otp"&&(h(),a("Incorrect OTP","error")),console.log(w)}finally{_(!1)}return}try{const w=await ee(s.token,{otp:v.join(""),interview_id:o.interviewId});if(w?.msg==="success"){const I=w.data.jwt_token;if(C)try{const l=await oe(C,I);if(console.log("=== CONVERSATIONAL INTERVIEW API RESPONSE (Pending Reference) ==="),console.log("Full response:",l),console.log("Interview data:",l?.data),l?.msg==="success"){const r=l.data,g={token:I,roomId:r.interview_room_id,companyName:r.company?.name||"Unknown",interviewPositions:r.job_title?.title||"Unknown",interviewType:"conversational",jobDescription:r.job_description,experienceLevel:r.experience_level,language:r.interview_language,technicalRatio:r.weightage?.technical,culturalFit:r.cultural_fit};console.log("Storing in localStorage (userAcknowledgmentData):",g),localStorage.setItem("userAcknowledgmentData",JSON.stringify(g)),localStorage.removeItem("pendingConversationalReferenceId"),E(F({token:I,isAuthenticated:!0,userType:"applicant"})),S(`/interview-prep?room_id=${r.interview_room_id}&token=${I}`,{state:{jobTitle:r.job_title?.title,jobDescription:r.job_description,experienceLevel:r.experience_level,language:r.interview_language,technicalRatio:r.weightage?.technical,culturalFit:r.cultural_fit,name:s.name,email:s.email,companyName:r.company?.name||"Unknown",interviewType:"conversational"}});return}}catch(l){console.error("Conversational API also failed:",l),localStorage.removeItem("pendingConversationalReferenceId"),a("This interview is no longer available","error");return}const y=u?.company?.name||"Unknown Company";E(F({token:I,isAuthenticated:!0,userType:"applicant"})),S(`/interview-prep?room_id=${s.roomId}&token=${I}`,{state:{jobTitle:u?.job_title?.title,name:s.name,email:s.email,companyName:y,interviewType:"regular"}})}}catch(w){w?.response?.data?.msg==="invalid otp"&&(h(),a("Incorrect OTP","error")),console.log(w)}finally{_(!1)}};return e.jsx("div",{className:"fixed inset-0 backdrop-blur-md flex justify-center items-center shadow-lg z-[60] ",children:e.jsxs(ge.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.3,ease:"easeOut"},className:"bg-white p-8 rounded-2xl shadow-lg max-w-[496px] w-full flex flex-col gap-[20px] m-[20px] relative",children:[e.jsx("div",{onClick:()=>{h(),A()},className:"absolute top-2 right-2 flex items-center justify-center w-[40px] h-[40px] hover:bg-[#F3F3F3] hover:cursor-pointer hover:rounded-[15px] hover:shadow-[0_0_10px_0px_rgba(0,0,0,0.1)]",children:"X"}),e.jsx("div",{className:"flex justify-center",children:e.jsxs("h2",{className:"md:text-[24px] font-medium text-[#502F99] text-[18px]  ",children:["Verify email address"," "]})}),e.jsx("div",{className:" flex justify-center",children:e.jsxs("h3",{className:"text-[16px] font-[400] font-poppins text-[#7B7B7B] text-center",children:["Enter the 6-digit verification code sent to"," ",s.email]})}),e.jsxs("div",{className:"flex flex-col gap-[15px] ",children:[e.jsx("div",{className:"flex   justify-evenly  items-center gap-2",children:b.map((d,o)=>e.jsx("div",{className:"flex",children:e.jsx("input",{className:" flex justify-center md:w-[50px] w-[40px] md:pl-[20px] pl-[15px] md:h-[50px] h-[40px] border-[1px] border-[#D9D9D9] bg-[#ffffff] font-poppins rounded-[15px] items-center",type:"text",maxLength:1,ref:d,onInput:m=>V(m,o),onKeyDown:m=>N(m,o),value:v[o],onPaste:o===0?p:null})},o))}),e.jsx("div",{className:"flex gap-[20px] justify-center  ",children:e.jsxs("h1",{onClick:()=>{D||G()},className:`font-poppins font-[400] text-[14px] cursor-pointer flex items-center gap-[5px] ${D?"text-[#9CA3AF]":"text-[#6b6b6b]"}`,children:[e.jsx("span",{children:D?`Resend OTP in ${B}s`:"Resend OTP"}),e.jsx(xe,{size:18})]})})]}),e.jsx("div",{className:"flex flex-col justify-center items-start px-4",children:e.jsx("button",{className:`font-poppins font-[500] text-[16px] h-[59px] text-[#F8F9FE] py-2 px-4 roun
1ded ${v.every(d=>d.match(/^\d$/))&&v.length===6?"bg-gradient-to-r from-[#6B3BAB] to-[#2B1845]":"bg-[#d9d9d9] text-[#ffffff]"} rounded-l-full rounded-r-full w-full md:px-[40px]`,disabled:!v.every(d=>d.match(/^\d$/))||v.length!==6,onClick:J,children:U?"Verifying...":"Verify and Continue"})})]})})};function Pe(){const[s,u]=x.useState(0),[a,A]=x.useState(null),[S,E]=x.useState(!1),[b,D]=x.useState(null),P=ue(),B=new URLSearchParams(P.search),R=B.get("token"),U=B.get("interview_id"),_=$(),v=te();let k=!0;const{uniqueId:h}=fe(),[p,V]=x.useState({}),[N,G]=x.useState(""),[j,J]=x.useState(""),[d,o]=x.useState(""),[m,C]=x.useState(""),[w,I]=x.useState({}),[y,l]=x.useState({interviewNotAvailable:!1,somethingWentWrong:!1,pageNotFound:!1,emailVerifyModal:!1,interviewLoadError:!1,noMoreTries:!1}),[r,g]=x.useState({isOpen:!1,isRetrying:!1,errorMessage:"Failed to load interview details. Please try again.",retryFunction:null}),[T,M]=x.useState({isVisible:!1,message:"",type:"success"}),L=(n,t="success")=>{M({isVisible:!0,message:n,type:t})},ie=()=>{M(n=>({...n,isVisible:!1}))},se=(n,t)=>{console.log("🚨 [ERROR MODAL] Showing error modal with message:",n),g({isOpen:!0,isRetrying:!1,errorMessage:n,retryFunction:t}),L(n,"error")},Y=()=>{console.log("🧹 [ERROR MODAL] Closing error modal"),g({isOpen:!1,isRetrying:!1,errorMessage:"Failed to load interview details. Please try again.",retryFunction:null})},le=async()=>{if(r.retryFunction){console.log("🔄 [RETRY] User clicked retry button"),g(n=>({...n,isRetrying:!0}));try{await r.retryFunction(),Y(),L("Interview loaded successfully","success")}catch(n){console.log("❌ [RETRY FAILED]",n),L("Retry failed. Please check your connection.","error"),g(t=>({...t,isRetrying:!1}))}}},re=()=>{console.log("⬅️ [USER ACTION] User clicked go back"),Y(),_(-1)};function ce(n){let t=n.replace(/-/g,"+").replace(/_/g,"/");for(;t.length%4;)t+="=";return atob(t)}const de=async()=>{console.log("🚀 [PAGE LOAD] fetchCandidateDetails started - uniqueId:",h);try{if(E(!0),h)try{const n=ce(h);console.log("🔍 [DECODE] Decoded reference ID:",n),await Q(n)}catch(n){console.log("❌ [ERROR] ERROR FETCHING INTERVIEWER DETAILS:",n)}else{let n=null,t=null;try{const i=await he(R,U);i.msg==="success"&&(n=i.data,t="regular")}catch(i){console.log("Regular API failed, trying conversational API:",i);try{const c=await ne(R,U);c.msg==="success"&&(n=c.data,t="conversational")}catch(c){throw console.log("Both APIs failed:",c),c}}n&&t&&(console.log("ExtendedSmartHire - Fetched candidateData:",n),console.log("ExtendedSmartHire - job_description structure:",n.job_description),console.log("ExtendedSmartHire - job_description type:",typeof n.job_description),D(t),v(F({token:R,isAuthenticated:!0,userType:"applicant"})),A(n))}}catch(n){n?.response?.status===402||n?.response?.data?.msg?.error==="insufficient credits"?l(t=>({...t,interviewNotAvailable:!0})):n?.response?.data?.msg?.error==="invalid interview"?l(t=>({...t,interviewNotAvailable:!0}
1)):n?.response?.data?.msg?.invalid_request==="interview no longer exists"?l(t=>({...t,interviewNotAvailable:!0})):l(t=>({...t,pageNotFound:!0})),console.log(n,"ERROR FETCHING")}finally{E(!1)}},Q=async n=>{let t=null,i=null;try{console.log("📡 [API CALL #1] Calling getInterviewerDetails()"),console.log("   Endpoint: /ai-interview/external/v1/candidate/interview/{referenceId}"),console.log("   Params: referenceId =",n);const c=await ye(n);c.msg==="success"&&(console.log("✅ [API SUCCESS] getInterviewerDetails() succeeded - REGULAR INTERVIEW"),console.log("   Response:",c.data),t=c.data,i="regular")}catch(c){console.log("❌ [API FAILED] getInterviewerDetails() FAILED - Likely a CONVERSATIONAL interview"),console.log("   Error Status:",c?.response?.status),console.log("   Error Message:",c?.response?.data?.msg),console.log("   Error Details:",c?.message),console.log("🔄 [ATTEMPTING CONVERSATIONAL API] Calling getConvInterviewerDetails() without token"),console.log("   Endpoint: /ai-interview/external/v1/conv/candidate/interview/{referenceId}"),console.log("   Params: referenceId =",n);try{const f=await oe(n,null);if(f.msg==="success"){console.log("✅ [CONVERSATIONAL API SUCCESS] Got full interview data"),console.log("   Response:",f.data),i="conversational",t=f.data,console.log("🎯 [DETECTED] This is a CONVERSATIONAL interview"),D("conversational"),V(t),console.log("💾 [STORING DATA] Saving conversational interview data in localStorage"),localStorage.setItem("pendingConversationalReferenceId",n),localStorage.setItem("conversationalInterviewData",JSON.stringify(t)),console.log("✅ [READY] Conversational interview data loaded - User can enter name/email");return}}catch(f){console.log("❌ [CONVERSATIONAL API ALSO FAILED]"),console.log("   Error Status:",f?.response?.status),console.log("   Error Message:",f?.response?.data?.msg),console.log("   Error Details:",f?.message),console.log("🚨 [CRITICAL] Both Regular and Conversational APIs failed"),console.log("   Regular API Error:",c?.response?.data?.msg),console.log("   Conversational API Error:",f?.response?.data?.msg);const K="Unable to load interview. Please check the interview link and your internet connection.",W=async()=>(console.log("🔄 [RETRY STARTED] Re-attempting to fetch interview details"),Q(n));console.log("📋 [SHOWING ERROR MODAL] Displaying error dialog with retry button"),se(K,W);return}}t&&i&&(console.log("📦 [DATA LOADED] Regular interview data loaded successfully"),console.log("   Interview Type:",i),console.log("   Company:",t.company?.name),console.log("   Job Title:",t.job_title?.title),console.log("   Interview ID:",t.interview_id),D(i),V(t),localStorage.removeItem("pendingConversationalReferenceId"),console.log("🧹 [CLEANUP] Cleared any pending conversational reference ID from localStorage"))};x.useEffect(()=>{k&&(k=!1,de())},[]);const me=n=>{const t=["10minutemail.com","mailinator.com","guerrillamail.com","temp-mail.org","trash-mail.com","sharklasers.com","yopmail.com","getnada.com","tempmail.net","throwawaymail.com","emailondeck.com","fakeinbox.com","mintemail.com","dispostable.com","burnermail.io","tempmail.win","maildrop.cc","mohmal.com","tempail.com","tempmailo.com","tempinbox.com","inboxbear.com","fakemailgenerator.com","tempemail.net","dropmail.me","mytrashmail.com","tempmailgenix.com","tempmail.plus","anonaddy.com","33mail.com","cock.li","tutamail.com","disroot.org"],i=n.split("@")[1]?.toLowerCase();return!!t.includes(i)},Z=async(n,t,i,c,f)=>{console.log("📧 [OTP SEND] sendVerifyEmailOtp() called"),console.log("   Token:",n?"✅ Present":"❌ NULL (Conversational Interview)"),console.log("   Room ID:",t?"✅ Present":"❌ NULL (will fetch later)"),console.log("   Email:",f),console.log("   Interview ID:",i),I({token:n,name:c,email:f,interviewId:i,roomId:t});const W={email:f,interview_id:i,"full-name":c};try{console.log("📡 [API CALL #3] Calling sendOtpToMail()"),console.log("   Endpoint: /ai-interview/external/v1/email/verify-and-send-otp"),console.log("   Query Params:",W);const H=await ae(n,W);H&&H.msg==="success"&&(console.log("✅ [API SUCCESS] sendOtpToMail() - OTP sent to",f),L("Verification code sent","success"))}catch(H){console.log("❌ [API ERROR] sendOtpToMail() failed:",H?.message)}},pe=async()=>
1{if(console.log("🔘 [USER ACTION] Next button clicked - handleNext() started"),console.log("   Name:",N),console.log("   Email:",j),console.log("   Interview Type:",b||"❓ NOT YET DETECTED"),m)return;const n=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;if(h){if(console.log("✅ [VALIDATION] Direct link interview - uniqueId present:",h),!N.trim())return o("Name is required.");if(N.length<3)return o("Name must be at least 3 characters long.");if(N.length>100)return o("Name must be less than 100 characters long.");if(!j.trim())return o("Email is required.");if(!n.test(j))return o("Please enter a valid email address.");if(me(j))return o("Invalid/Temporary email not allowed");console.log("✅ [VALIDATION] All validations passed");try{if(E(!0),b==="conversational"){console.log("🎯 [PATH] CONVERSATIONAL INTERVIEW PATH SELECTED"),console.log("📡 [API CALL] Calling getInitiateConvInterview()"),console.log("   Endpoint: /ai-interview/external/v1/conv/candidate/initiate-interview"),console.log("   Payload: {interview_id, full_name, email}");const i=(await be({interview_id:p?.interview_id,full_name:N,email:j}))?.data?.jwt_token;console.log("✅ [API SUCCESS] getInitiateConvInterview() succeeded"),console.log("   JWT Token:",i?i.substring(0,20)+"...":"❌ NULL"),v(F({token:i,isAuthenticated:!0,userType:"applicant"})),await Z(i,null,p?.interview_id,N,j);const c={token:i,interviewId:p?.interview_id,companyName:p?.company?.name||"Unknown",interviewPositions:p?.job_title?.title||"Unknown",interviewType:"conversational"};console.log("💾 [STORE] Storing temporary data in localStorage (userAcknowledgmentData):",c),localStorage.setItem("userAcknowledgmentData",JSON.stringify(c)),console.log("🔓 [MODAL] Opening OTP verification modal"),l(f=>({...f,emailVerifyModal:!0}))}else{console.log("🎯 [PATH] REGULAR INTERVIEW PATH SELECTED"),console.log("📡 [API CALL #2] Calling getInitiateInterview()"),console.log("   Endpoint: /ai-interview/external/v1/candidate/initiate-interview"),console.log("   Payload: {interview_id, full_name, email}");const t=await Ne({interview_id:p?.interview_id,full_name:N,email:j});if(t?.msg==="success"){console.log("✅ [API SUCCESS] getInitiateInterview() succeeded"),console.log("   JWT Token:",t?.data?.jwt_token?.substring(0,20)+"..."),console.log("   Room ID:",t?.data?.interview_room_id),await Z(t?.data?.jwt_token,t?.data?.interview_room_id,p?.interview_id,N,j),console.log("🔓 [MODAL] Opening OTP verification modal"),l(c=>({...c,emailVerifyModal:!0}));const i={token:t?.data?.jwt_token,roomId:t?.data?.interview_room_id,interviewId:p?.interview_id,companyName:p?.company?.name||"Unknown",interviewPositions:p?.job_title?.title||"Unknown",interviewType:"regular",jobDescription:p?.job_description,experienceLevel:p?.experience_level,language:p?.interview_language,technicalRatio:p?.weightage?.technical};console.log("💾 [STORE] Storing interview data in localStorage (userAcknowledgmentData):",i),localStorage.setItem("userAcknowledgmentData",JSON.stringify(i))}}}catch(t){if(console.log("❌ [ERROR] Exception caught in handleNext()"),console.log("   Error:",t?.message),console.log("   Response Status:",t?.response?.status),console.log("   Response Data:",t?.response?.data),t?.response?.data?.msg?.error)switch(console.log("   Error Type: API returned error -",t.response.data.msg.error),t.response.data.msg.error){case"no more tries left":l(i=>({...i,noMoreTries:!0}));break;case"interview no longer exists":o("Oops! This interview link is no longer available."),l(i=>({...i,interviewNotAvailable:!0}));break;case"insufficient credits":o("Oops! This interview link is no longer available."),l(i=>({...i,interviewNotAvailable:!0}));break;default:o("An unexpected error occurred. Please try again.")}
1else if(t?.response?.data?.msg?.invalid_request){console.log("   Error Type: Invalid request"),o("Please provide valid details.");return}else{console.log("   Error Type: Unknown"),o("Failed to initiate interview. Please try again.");return}}finally{console.log("⏹️ [FINALLY] handleNext() cleanup - setting loading to false"),E(!1)}}else{console.log("ExtendedSmartHire - candidateDetail:",a);const t=a?.company?.name||p?.company?.name||"Unknown Company",i={jobTitle:a?.job_title?.title,jobDescription:a?.job_description,experienceLevel:a?.experience_level,language:a?.interview_language,technicalRatio:a?.weightage?.technical,culturalFit:a?.cultural_fit,name:a?.full_name,email:a?.email,companyName:t,interviewType:b};console.log("ExtendedSmartHire - navigating to interview-prep with state:",i),console.log("[DEBUG culturalFit] ExtendedSmartHire → interview-prep:",i.culturalFit);const c={token:R,roomId:a?.interview_room_id,companyName:a?.company?.name||"Unknown Company",interviewPositions:a?.job_title?.title||"Unknown",interviewType:b,jobDescription:a?.job_description,experienceLevel:a?.experience_level,language:a?.interview_language,technicalRatio:a?.weightage?.technical,culturalFit:a?.cultural_fit};console.log("ExtendedSmartHire - Storing in localStorage (userAcknowledgmentData):",c),localStorage.setItem("userAcknowledgmentData",JSON.stringify(c)),_(`/interview-prep?room_id=${a?.interview_room_id}&token=${R}`,{state:i})}},q=()=>s===0?{component:e.jsxs(e.Fragment,{children:[e.jsx(Ae,{name:N||a?.full_name,designation:a?.job_title?.title||p?.job_title?.title,uniqueId:h,setName:G,companyName:a?.company?.name||p?.company?.name||"Unknown Company"}),e.jsxs("div",{className:"mb-[300px] md:mb-0",children:[e.jsx(Re,{email:j||a?.email,uniqueId:h,setEmail:J}),(m||d)&&e.jsx("p",{className:"text-red text-center mt-2",children:m||d})]})]}),onNext:pe,onBack:()=>null}:e.jsx(e.Fragment,{});return e.jsxs(e.Fragment,{children:[e.jsx(ve,{message:T.message,type:T.type,isVisible:T.isVisible,onClose:ie}),S&&e.jsx("div",{className:"fixed bottom-0 top-0 w-full flex justify-center items-center",children:e.jsx(we,{height:"100",width:"300",color:"#6F3EB2",ariaLabel:"tail-spin-loading",radius:"1",wrapperClass:"",visible:!0})}),e.jsxs("div",{className:"flex flex-col justify-between",children:[e.jsx("div",{className:"absolute top-[20px] xs:left-[20px] md:left-[50px] z-50",children:e.jsx("img",{className:"h-[28px]",src:z.CommonHeader.avua_header_logo})}),q().component,e.jsx(Ee,{hideBack:s===0,handleNext:q()?.onNext,handleBack:q()?.onBack}
1)]}),y.interviewNotAvailable&&e.jsx(Se,{}),y.noMoreTries&&e.jsx(De,{}),y.somethingWentWrong&&e.jsx(ke,{}),y.pageNotFound&&e.jsx(_e,{}),y.emailVerifyModal&&e.jsx(Ce,{userDataPassToOTPModal:w,companyDetails:p,showToast:L,onClose:()=>{l(n=>({...n,emailVerifyModal:!1}))}}),e.jsx(Ie,{isOpen:r.isOpen,onRetry:le,onCancel:re,isLoading:r.isRetrying,errorMessage:r.errorMessage})]})}export{Pe as default};
2//# sourceMappingURL=ExtendedSmartHire-Cs054AoF.js.map

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.