1import{j as e,P as le,r as i,R as Gr}from"./vendor-react-C2-icIoE.js";import{s as Qs,f as Ce,k as Qe,l as Se,m as Zt,g as wr,h as qr,r as Br,u as Yr,n as Jr,p as qn,q as Bn,t as ar,v as Xr,w as Kr,x as Zs,y as dr,z as mr}from"./vendor-firebase-DABf0uoC.js";import{a7 as At,Q as ut,u as He,a8 as me,A as Rt,W as bt,H as s,a9 as zt,b as Z,e as o,d as r,f as U,r as ot,i as it,a6 as lt,aa as Ae,ab as Vt,ac as er,ad as Yn,ae as Q,af as Jn,ag as Xn,ah as en,ai as xr,aj as ct,ak as Kn,c as ir,al as Qn,am as Zn,an as eo,ao as to,ap as ro,X as lr,aq as br,L as Ft,o as so,ar as no,U as oo,V as nt}from"./index-DobVBjR2.js";import{d as tn,a as rn,P as wt,s as io}from"./Settings-COrTMQZm.js";import{H as be}from"./index-gCj3Z4WO.js";import{d as ao}from"./Share-C5hE9fAv.js";import{d as lo}from"./AccountCircle-CIATwws5.js";import{d as co}from"./RateReview-DbeDQ6Hi.js";import{d as Sr,E as sn,Q as xo}from"./QualificationsEditor-DxuQxR6E.js";import{H as jt}from"./index-We9KxOnb.js";import{GlobeComponent as Et}from"./index-DRmtDCyV.js";import{R as Er,d as po}from"./index-D8vg1VJ8.js";import{H as nn}from"./index-BfRPr508.js";import{d as uo}from"./HourglassEmpty-IVOuHLex.js";import{d as Ue,a as Qr,b as ho,c as fo}from"./WarningAmber-BPK6bOaL.js";import{d as go}from"./HomeOutlined-C17j8PNs.js";import{H as ft}from"./index-BdXIMVNw.js";import{H as Jt}from"./index-aglSFEYe.js";import{H as Zr}from"./index-CaFz3v-_.js";import{e as es,H as on,u as an,s as ln}from"./index-CoMa_brO.js";import{d as pt}from"./PersonOutline-DMRJRkNx.js";import{d as Dt}from"./HelpOutline-gh9Dz4QU.js";import{d as tr}from"./ArrowForward-DkGtvRSQ.js";import{H as mo}from"./index-osWo-0K1.js";import{i as js,W as bo,a as yo,b as cn,t as jo,f as dn}from"./workingHours-Btu_J6l2.js";import{f as wo,a as So,c as vo,h as Cr,g as ws,s as ko,n as Co,b as Ro,d as xn,e as zo,i as Io}from"./index-CdSXZuKr.js";import{C as Wo}from"./index.module-CUw7F0xb.js";import{H as Lt}from"./index-Ceaxjadk.js";import{H as Qt}from"./index-Bmdl36SW.js";import{H as yr}from"./index-B5vJJ8Wo.js";import{H as Po}from"./index-CAUfwNww.js";import{S as $o}from"./Speed-BYfW8Hsq.js";import{a as Le}from"./apiFetch-BDQbKoG9.js";import{v as Ho,d as pr,a as Tr,b as Ss,c as Do}from"./CloudUpload-Dy94VrxC.js";import{d as Rr}from"./DescriptionOutlined-Dt5vVMQi.js";import{s as Ao,H as Eo}from"./index-DBN8PK9A.js";import{f as Ke}from"./font-BdiwpCM2.js";import{d as To}from"./ChevronLeft-Baz09Iws.js";import{d as Mo}from"./ChevronRight-Co9Uhps6.js";import{m as qe,u as qt,A as pn,a as Fo,b as vs,c as _o}from"./vendor-motion-CWs-Qqgd.js";import{H as un}from"./index-BmYCSK1T.js";import{H as fr}from"./index-CR5XGa5d.js";import{H as ts}from"./index-CXYOqvWY.js";import{l as ur}from"./userHistoryLogger-DfeFx9n_.js";import{A as ks}from"./Add-D2RUDqk3.js";import{S as Cs,D as Oo}from"./Save-DKYgK3uK.js";import{W as Rs}from"./Work-BKXkRUaB.js";import{C as cr}from"./CheckCircle-CQMkcgT1.js";import{E as Lo}from"./Edit-u6bRtc2X.js";import{E as Uo}from"./Email-IuRVJ8sG.js";import{P as Vo}from"./Phone-DDvaLlro.js";import{d as rs}from"./WorkOutline-BFKHC_uS.js";import{d as Mr}from"./Add-D4fPxLp4.js";import{d as zr}from"./VideocamOutlined-CItanJZw.js";import{d as No}from"./Videocam-q5Q4t2Pj.js";import{R as hn}from"./index-CYwBXG45.js";import{d as Go}from"./StopCircle-Bre85DY6.js";import{d as zs}from"./Fullscreen-Bcl7dFay.js";import{D as qo,g as Bo}from"./demoReelCV-DR1OJxOa.js";import{H as Yo}from"./index-I41Tz2Pe.js";import{d as Jo}from"./PlayCircleOutline-BDOAlJcj.js";import{d as Xo}from"./ExpandMore-D55n5p5z.js";import{H as Ko}from"./index-Bva-k8mO.js";import{H as fn}from"./index-BVluBEg9.js";import{d as Ir}from"./VerifiedOutlined-niikVB2I.js";import{H as Qo}from"./index-VVeAOHb-.js";import{d as Zo}from"./ContactPhoneOutlined-eGpU3gvW.js";import{d as ei}from"./Edit-BGlIQ58C.js";import{d as ti}from"./DeleteOutline-BxM1uMkm.js";import{d as ri}from"./SaveOutlined-B6ZfkpPR.js";import{f as si,a as ni,h as oi,s as ii,n as ai,b as li,c as ci,g as di,d as xi}from"./index-BlI1fLeE.js";import{H as pi}from"./index-B0xMY3Od.js";import{H as ui}from"./index-Cg9WnoHU.js";import{d as hi}from"./VisibilityOutlined-BB6STSlk.js";import{h as fi}from"./index-DG1_NhnP.js";import{F as gi,R as mi}from"./RateReview-BL6BiLD7.js";import{S as bi}from"./Send-CwMDDzlP.js";import{d as yi}from"./Groups-C9qE7TvQ.js";import{H as yt}from"./index-BtTvmCO7.js";import{m as ji,C as ss,A as gn,a as wi,g as Si,b as vi,s as Is}from"./jobsPublicClient-C1LsWbIl.js";import{C as Fr,a as Ws,i as mn,g as Ht}from"./JobsKit-DyhkZwA6.js";import{W as ki,V as Ci,A as Ri,a as bn}from"./WorkOutlineRounded-BQvl6LGE.js";import{I as zi}from"./InboxOutlined-DG5HjmMY.js";import{L as yn}from"./LockOutlined-C3n8zump.js";import{H as Wr}from"./index-DJaIS5Vm.js";import{H as nr}from"./index-DYaZtv4b.js";import{A as Ii}from"./AutoAwesome-CW8r_8RH.js";import"./index-CoV_p4AD.js";import"./index-COgs6spG.js";import"./quantize-BganWWw-.js";import"./index-BM8BcnjV.js";import"./reelcvPerfLog-B6pEy2hi.js";import"./LinkedIn-Dh-Oihnx.js";import"./GitHub-CUPhzEPL.js";import"./Language-DxA54gYp.js";import"./RecordVoiceOver-C7d9sq7C.js";import"./PersonOutline-BNOSwnwt.js";import"./Close-V02vZ8jr.js";import"./index-Bh-4iXUm.js";import"./index-CNQMV33n.js";import"./signinGithub-CX6NbmNb.js";import"./signinGoogle-COiS4EPg.js";import"./linkAnonymousSignUp-iPfumbw6.js";import"./captureAttribution-DjuJqxEy.js";import"./BusinessOutlined-DS2Wqkim.js";import"./signup-km-PFbZ6.js";import"./github-BGk0ZQ1w.js";import"./index-DCenpSm_.js";import"./index-FCMvQCPZ.js";import"./MarkEmailRead-PW3Y5tLr.js";import"./LockOpen-BeEfho1L.js";import"./OpenInNew-jPjeVLV0.js";import"./Save-DXDQYn-Q.js";import"./Delete-Cha41rxH.js";import"./Chip-VMfMBsij.js";import"./Dialog-DEpYPpV3.js";import"./CheckCircleOutline-DGQT__xJ.js";import"./ChevronRight-DKGW2t6X.js";import"./Language-DZgLGE3y.js";import"./SwitchBase-BBetqhq4.js";import"./PlayArrowRounded-C5zBPPK9.js";import"./index-35MHVI6c.js";import"./DialogTitle-BlFpbRN1.js";import"./Skeleton-CbZRi9bQ.js";import"./Check-oG-49z85.js";import"./MenuItem-Bb60kVJT.js";import"./dividerClasses-Sp9gTc1P.js";const Wi=At(e.jsx("path",{d:"M18 13h-5v5c0 .55-.45 1-1 1s-1-.45-1-1v-5H6c-.55 0-1-.45-1-1s.45-1 1-1h5V6c0-.55.45-1 1-1s1 .45 1 1v5h5c.55 0 1 .45 1 1s-.45 1-1 1"}),"AddRounded"),Pi=At(e.jsx("path",{d:"M13 19V7.83l4.88 4.88c.39.39 1.03.39 1.42 0 .39-.39.39-1.02 0-1.41l-6.59-6.59a.9959.9959 0 0 0-1.41 0l-6.6 6.58c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L11 7.83V19c0 .55.45 1 1 1s1-.45 1-1"}),"ArrowUpwardRounded"),$i=At(e.jsx("path",{d:"M17 11v6.97l-5-2.14-5 2.14V5h6V3H7c-1.1 0-2 .9-2 2v16l7-3 7 3V11zm.83-2L15 6.17l1.41-1.41 1.41 1.41 3.54-3.54 1.41 1.41z"}),"BookmarkAddedOutlined"),Hi=At(e.jsx("path",{d:"M9.29 6.71c-.39.39-.39 1.02 0 1.41L13.17 12l-3.88 3.88c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0l4.59-4.59c.39-.39.39-1.02 0-1.41L10.7 6.7c-.38-.38-1.02-.38-1.41.01"}),"ChevronRightRounded"),Di=At(e.jsx("path",{d:"m14.06 9.02.92.92L5.92 19H5v-.92zM17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29m-3.6 3.19L3 17.25V21h3.75L17.81 9.94z"}),"EditOutlined"),Ai=At(e.jsx("path",{d:"M8.12 9.29 12 13.17l3.88-3.88c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41l-4.59 4.59c-.39.39-1.02.39-1.41 0L6.7 10.7a.9959.9959 0 0 1 0-1.41c.39-.38 1.03-.39 1.42 0"}),"KeyboardArrowDownRounded"),Ps=At(e.jsx("path",{d:"m14.12 4 1.83 2H20v12H4V6h4.05l1.83-2zM15 2H9L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17zm-3 7c1.65 0 3 1.35 3 3s-1.35 3-3 3-3-1.35-3-3
11.35-3 3-3m0-2c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5"}),"PhotoCameraOutlined"),Ei=At(e.jsx("path",{d:"M12 3 1 9l4 2.18v6L12 21l7-3.82v-6l2-1.09V17h2V9zm6.82 6L12 12.72 5.18 9 12 5.28zM17 15.99l-5 2.73-5-2.73v-3.72L12 15l5-2.73z"}),"SchoolOutlined"),Wt=({sx:n})=>{const t=ut(),{isDark:a}=He(),l=async()=>{try{localStorage.removeItem("hirexe_role"),await Qs(Rt),t("/")}catch(h){console.error("Logout failed:",h)}};return e.jsx(be,{title:"Logout",placement:"right",arrow:!0,children:e.jsx(me,{variant:"close",onClick:l,"aria-label":"Logout",sx:{position:"fixed",top:{xs:12,sm:16},left:{xs:12,sm:16},zIndex:1300,bgcolor:a?"rgba(0,0,0,0.55)":"rgba(255,255,255,0.6)",border:`1px solid ${a?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.08)"}`,boxShadow:a?"0 4px 12px rgba(0,0,0,0.4)":"0 4px 12px rgba(0,0,0,0.12)","& .MuiSvgIcon-root":{fontSize:"1.1rem"},...n},children:e.jsx(tn,{})})})},_r=({uid:n})=>{const[t,a]=i.useState(!0),[l,h]=i.useState(!1),{isDark:d}=He(),g=ut(),b=Ce();return i.useEffect(()=>{if(!n){console.warn("SetupCheck: no uid provided"),a(!1);return}(async()=>{try{const p=(await Qe(Se(b,"users",n,"userSettings","settings"))).data()||{};p.intakeApplicant&&!p.profileCompletion?g("/dashboard/user/application",{replace:!0}):p.profileCompletion?p.profileCompletion&&!p.approved?(h(!0),a(!1)):g("/dashboard/user/profile",{replace:!0}):g("/dashboard/user/details",{replace:!0})}catch(m){console.error("Error fetching user:",m),g("/dashboard/user/approval",{replace:!0})}})()},[n,b,g]),t?e.jsx(bt,{variant:"fullscreen"}):l?e.jsxs(e.Fragment,{children:[e.jsx(s,{sx:{position:"fixed",top:{xs:"-100px",sm:"-150px",md:"-200px",lg:"-250px"},left:{xs:"-150px",sm:"-200px",md:"-300px",lg:"-400px"},zIndex:0,pointerEvents:"none",willChange:"transform"},children:e.jsx(Et,{backgroundMode:!0})}),e.jsx(zt,{}),e.jsx(s,{sx:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:0,pointerEvents:"none",backgroundImage:d?"radial-gradient(circle at 1px 1px, rgba(255,255,255,0.04) 1px, transparent 0)":"radial-gradient(circle at 1px 1px, rgba(0,0,0,0.03) 1px, transparent 0)",backgroundSize:"40px 40px"}}),e.jsx(s,{display:"flex",justifyContent:"center",alignItems:"center",sx:{position:"relative",zIndex:1,height:"100vh",width:"100%",px:2},children:e.jsxs(Z,{sx:{width:{xs:"100%",sm:460,md:520},borderRadius:"20px",px:{xs:3,sm:4,md:5},py:{xs:4,sm:5,md:6},textAlign:"center"},children:[e.jsx(nn,{icon:uo,size:72,iconSize:32,sx:{borderRadius:"50%",mx:"auto",mb:3,"@keyframes gentlePulse":{"0%, 100%":{transform:"scale(1)",opacity:1},"50%":{transform:"scale(1.05)",opacity:.85}},animation:"gentlePulse 3s ease-in-out infinite"}}),e.jsx(o,{sx:{fontSize:{xs:"1.4rem",sm:"1.6rem",md:"1.8rem"},fontWeight:700,color:d?r.white:r.black,mb:1.5,lineHeight:1.3},children:"Profile Under Review"}),e.jsx(o,{sx:{fontSize:{xs:"0.88rem",md:"0.95rem"},color:d?"rgba(255,255,255,0.6)":"rgba(0,0,0,0.55)",mb:4,lineHeight:1.6,maxWidth:380,mx:"auto"},children:"Your profile has been submitted and is being reviewed by our team. We will notify you once it has been approved."}),e.jsx(s,{sx:{display:"flex",flexDirection:"column",gap:1.5,mb:4,px:{xs:0,sm:2}},children:[{label:"Profile completed",done:!0},{label:"Under admin review",done:!1,active:!0},{label:"Approval confirmed",done:!1}].map((m,p)=>e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[m.done?e.jsx(Ue,{sx:{fontSize:20,color:r.orange}}):e.jsx(s,{sx:{width:20,height:20,borderRadius:"50%",border:`2px solid ${m.active?r.orange:d?"rgba(255,255,255,0.15)":"rgba(0,0,0,0.12)"}`,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:m.active&&e.jsx(s,{sx:{width:8,height:8,borderRadius:"50%",backgroundColor:r.orange,"@keyframes pulse":{"0%, 100%":{opacity:1},"50%":{opacity:.4}},animation:"pulse 1.5s ease-in-out infinite"}})}),e.jsx(o,{sx:{fontSize:"0.85rem",fontWeight:m.done||m.active?500:400,color:m.done?r.orange:m.active?d?r.white:r.black:d?"rgba(255,255,255,0.35)":"rgba(0,0,0,0.3)"},children:m.label})]},p))}),e.jsxs(U,{variant:"orange",onClick:()=>g("/"),sx:{height:44,px:4,fontSize:"0.9rem",gap:1},children:[e.jsx(go,{sx:{fontSize:18}}),"Back to Home"]})]})})]}):null};_r.propTypes={uid:le.string};var ns={},Ti=it;
1Object.defineProperty(ns,"__esModule",{value:!0});var jn=ns.default=void 0,Mi=Ti(ot()),Fi=e;jn=ns.default=(0,Mi.default)((0,Fi.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8m.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z"}),"ScheduleOutlined");function _i({open:n,src:t,crop:a,zoom:l,onCropChange:h,onZoomChange:d,onCropComplete:g,onCancel:b,onConfirm:m}){const{isDark:p}=He();return e.jsxs(Lt,{open:n,onClose:b,maxWidth:"sm",fullWidth:!0,children:[e.jsx(Qt,{sx:{position:"relative",height:400,p:0},children:e.jsx(Wo,{image:t,crop:a,zoom:l,aspect:1,onCropChange:h,onZoomChange:d,onCropComplete:g})}),e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:2,px:3,py:2,borderTop:`1px solid ${p?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)"}`},children:[e.jsx(Po,{value:l,min:1,max:3,step:.1,onChange:(C,H)=>d(H),sx:{flex:1}}),e.jsx(U,{variant:"transparent",onClick:b,children:"Cancel"}),e.jsx(U,{variant:"orange",onClick:m,children:"Confirm"})]})]})}const $s=[{text:"Upload a professional profile image (click or drag & drop)"},{text:"Fill in your notice period, expected salary, and employment type"},{text:"Enter your current job title (select from suggestions or type your own)"},{text:"Select every timezone whose hours you are willing to work"},{text:"Add your internet speed and typing metrics"},{text:"Link your social profiles (LinkedIn is required)"},{text:"Click Continue once all fields are completed"}];function Hs({uid:n}){const{isDark:t,toggleDarkMode:a}=He(),l=ut(),[h,d]=i.useState(!1),[g,b]=i.useState(null),[m,p]=i.useState({x:0,y:0}),[C,H]=i.useState(1),[I,A]=i.useState(null),P=i.useRef(null),[v,V]=i.useState([]),[z,M]=i.useState(!0),[f,E]=i.useState(!1),[$,F]=i.useState(null),[D,y]=i.useState(null),[k,T]=i.useState(""),[j,L]=i.useState(null),[ee,K]=i.useState(null),[q,N]=i.useState([]),_=q.some(js),[J,ce]=i.useState(""),[oe,ve]=i.useState(""),[ie,ae]=i.useState(""),[xe,fe]=i.useState(""),[ke,G]=i.useState(""),[pe,Ee]=i.useState({open:!1,message:"",severity:"error"}),ze=(w,W="error")=>Ee({open:!0,message:w,severity:W}),Ze=()=>Ee(w=>({...w,open:!1})),[ye,Fe]=i.useState(es()),Be=Ce(),Ie=i.useRef(),[Ve,We]=i.useState("/dashboard/user/cvupload");i.useEffect(()=>{n&&Qe(Se(Be,"users",n,"userSettings","settings")).then(w=>{w.exists()&&w.data().preFilled===!0&&We("/dashboard/user/achievement")}).catch(w=>console.error("preFilled check failed:",w))},[n,Be]);const Ye=w=>{if(!w)return;P.current=w;const W=new FileReader;W.onload=()=>{b(W.result),d(!0)},W.readAsDataURL(w)},je=w=>{w.preventDefault(),Ye(w.dataTransfer.files[0])},Ne=(w,W)=>{A(W)},Je=async()=>{d(!1),E(!0);try{const w=await Ro(g,I),W=new File([w],P.current.name,{type:w.type});F(URL.createObjectURL(W));const te=await xn({target:{files:[W]}},n);F(te)}catch(w){console.error(w)}finally{E(!1),P.current=null}},ge=()=>{d(!1),P.current=null};i.useEffect(()=>{wo(n,{setNoticePeriod:y,setSalary:T,setSeeking:L,setTitle:K,setWorkingHours:N,setInternetSpeed:ve,setTypingSpeed:ae,setTypingAccuracy:fe,setSelectedImage:F,setLoading:M,setSocialLinks:Fe})},[n]),i.useEffect(()=>{let w=!0;return M(!0),So().then(W=>w&&V(W)).catch(W=>console.error("Error loading titles:",W)).finally(()=>w&&M(!1)),()=>{w=!1}},[]);const tt=async(w,W)=>{var te;Fe(de=>({...de,[w]:W}));try{const de=Se(Be,"users",n,"userData","data"),x=await Qe(de),c=an((te=x.data())==null?void 0:te.socials,w,W);await Zt(de,{socials:c},{merge:!0})}catch(de){throw console.error("handleSocialSave failed:",de),de}},De=vo({noticePeriod:D,salary:k,seeking:j,title:ee,workingHours:q,internetSpeed:oe,typingSpeed:ie,typingAccuracy:xe,selectedImage:$,linkedin:ye.linkedin}),Pe={display:"flex",alignItems:"center",gap:1.5,mb:2.5},$e={mb:1,fontSize:"0.85rem",fontWeight:500,color:t?r.grey:r.darkGrey},O=Math.round(De/20*100);return e.jsxs(e.Fragment,{children:[e.jsx(_i,{open:h,src:g,crop:m,zoom:C,onCropChange:p,onZoomChange:H,onCropComplete:Ne,onCancel:ge,onConfirm:Je}),z&&e.jsx(lt,{variant:"fullscreen",text:"Loading..."}),e.jsx(s,{sx:{position:"fixed",top:{xs:"-100px",sm:"-150px",md:"-200px",lg:"-250px"}
1,left:{xs:"-150px",sm:"-200px",md:"-300px",lg:"-400px"},zIndex:0,pointerEvents:"none",willChange:"transform"},children:e.jsx(Et,{backgroundMode:!0})}),e.jsx(zt,{}),e.jsx(s,{sx:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:0,pointerEvents:"none",backgroundImage:t?"radial-gradient(circle at 1px 1px, rgba(255,255,255,0.04) 1px, transparent 0)":"radial-gradient(circle at 1px 1px, rgba(0,0,0,0.03) 1px, transparent 0)",backgroundSize:"40px 40px"}}),e.jsxs(s,{sx:{position:"relative",zIndex:1,width:"100%",height:"100vh",backgroundColor:"transparent",overflowY:"auto",overflowX:"hidden",...Ae(t)},children:[e.jsx(s,{sx:{maxWidth:"1200px",mx:"auto",px:{xs:2,md:4},pt:3},children:e.jsxs(ft,{sx:{py:2,px:{xs:2,md:3},display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1.5,minWidth:0},children:[e.jsx(s,{sx:{width:36,height:36,minWidth:36,borderRadius:"10px",backgroundColor:t?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.05)",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(pt,{sx:{color:t?r.white:r.black,fontSize:20}})}),e.jsxs(s,{sx:{minWidth:0},children:[e.jsx(o,{variant:"h5",sx:{fontWeight:600,color:t?r.white:r.black,fontSize:{xs:"1rem",md:"1.25rem"},lineHeight:1.3,whiteSpace:"nowrap"},children:"Profile Setup"}),e.jsx(o,{sx:{color:t?r.grey:r.darkGrey,fontSize:"0.8rem",display:{xs:"none",sm:"block"}},children:"Complete your profile to get started"})]})]}),e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(be,{title:"Continue",placement:"bottom",arrow:!0,children:e.jsx("span",{style:{display:"inline-flex"},children:e.jsx(me,{variant:"filled",disabled:!(D&&k&&j&&ee&&q.length&&oe&&ie&&xe&&$),onClick:()=>{G(""),Cr(n,{noticePeriod:D,salary:k,seeking:j,title:ee,workingHours:q,internetSpeed:oe,typingSpeed:ie,typingAccuracy:xe,selectedImage:$,socialLinks:ye,setLoading:M}).then(()=>{l(Ve)}).catch(w=>{console.error(w);const W=w.message||"Something went wrong";G(W),ze(W)})},sx:{display:{xs:"inline-flex",sm:"none"},width:34,height:34,borderRadius:"8px"},children:e.jsx(tr,{sx:{fontSize:"1.1rem"}})})})}),e.jsx(U,{variant:"orange",disabled:!(D&&k&&j&&ee&&q.length&&oe&&ie&&xe&&$),onClick:()=>{G(""),Cr(n,{noticePeriod:D,salary:k,seeking:j,title:ee,workingHours:q,internetSpeed:oe,typingSpeed:ie,typingAccuracy:xe,selectedImage:$,socialLinks:ye,setLoading:M}).then(()=>{l(Ve)}).catch(w=>{console.error(w),G(w.message||"Something went wrong")})},sx:{display:{xs:"none",sm:"inline-flex"},px:3,height:36,minHeight:36,fontSize:"0.85rem"},children:"Continue"}),e.jsx(be,{title:t?"Light mode":"Dark mode",placement:"bottom",arrow:!0,children:e.jsx(me,{variant:"subtle",onClick:a,sx:{width:{xs:40,sm:24},height:{xs:40,sm:24},minWidth:0,padding:0,borderRadius:"6px"},children:t?e.jsx(Vt,{sx:{width:14,height:14}}):e.jsx(er,{sx:{width:14,height:14}})})})]})]})}),e.jsxs(s,{sx:{maxWidth:"1200px",mx:"auto",pt:3,pb:4,px:{xs:2,md:4},display:"flex",flexDirection:"column",gap:3},children:[e.jsxs(Z,{sx:{p:3},children:[e.jsxs(s,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1.5},children:[e.jsx(o,{sx:{fontSize:"0.85rem",fontWeight:500,color:t?r.white:r.black},children:"Required Information"}),e.jsxs(o,{sx:{fontSize:"0.85rem",fontWeight:600,color:r.orange},children:[O,"%"]})]}),e.jsx(s,{sx:{width:"100%",height:8,borderRadius:4,backgroundColor:t?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.08)"},children:e.jsx(s,{sx:{width:`${O}%`,height:"100%",borderRadius:4,backgroundColor:r.orange,transition:"width 0.4s ease"}})})]}),e.jsxs(Z,{sx:{p:3,display:{xs:"block",lg:"none"}},children:[e.jsxs(s,{sx:Pe,children:[e.jsx(Dt,{sx:{color:t?r.white:r.black,fontSize:24}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem"},children:"How To"})]}),e.jsx(s,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:$s.map((w,W)=>e.jsxs(s,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[e.jsx(Ue,{sx:{fontSize:18,mt:.2,color:t?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.35)"}}),e.jsx(o,{sx:{fontSize:"0.8rem",color:t?r.grey:r.darkGrey,lineHeight:1.5},children:w.text})]},W))}),(()=>{const w=ws({noticePeriod:D,salary:k,seeking:j,title:ee,workingHours:q,internetSpeed:oe,typingSpeed:ie,typingAccuracy:xe,selectedImage:$,linkedin:ye.linkedin});return w?e.jsxs(s,{sx:{mt:2,p:1.5,borderRadius:"10px",backgroundColor:t?"rgba(215, 122, 46, 0.08)":"rgba(215, 122, 46, 0.06)",border:`1px solid ${t?"rgba(215, 122, 46, 0.2)":"rgba(215, 122, 46, 0.15)"}`,borderLeftWidth:"3px",borderLeftColor:r.orange},children:[e.jsxs(o,{sx:{fontSize:"0.8rem",color:r.orange,fontWeight:600,mb:1},children:["Missing Fields (",w.length,")"]}),e.jsx(s,{sx:{display:"flex",flexDirection:"column",gap:.5},children:w.map((W,te)=>e.jsxs(o,{sx:{fontSize:"0.75rem",color:W.bold?r.orange:t?r.grey:r.darkGrey,fontWeight:W.bold?700:400,lineHeight:1.5},children:["⢠",W.text]},te))})]}):null})()]}),e.jsxs(s,{sx:{display:"flex",flexDirection:{xs:"column",lg:"row"},gap:3},children:[e.jsxs(s,{sx:{width:{xs:"100%",lg:"35%"},display:"flex",flexDirection:"column",gap:3},children:[e.jsxs(Z,{sx:{p:3},children:[e.jsxs(s,{sx:Pe,children:[e.jsx(pt,{sx:{color:t?r.white:r.black,fontSize:24}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem"},children:"Profile Photo"})]}
1),e.jsxs(s,{component:"label",sx:{display:"block",cursor:"pointer"},children:[e.jsx("input",{ref:Ie,type:"file",accept:"image/*",hidden:!0,onChange:w=>{var W;return Ye((W=w.target.files)==null?void 0:W[0])}}),e.jsx(s,{onDragOver:w=>w.preventDefault(),onDrop:je,sx:{width:"100%",aspectRatio:"1",maxWidth:"300px",mx:"auto",borderRadius:"20px",overflow:"hidden",border:`2px dashed ${t?"rgba(255,255,255,0.15)":"rgba(0,0,0,0.15)"}`,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:t?"rgba(255,255,255,0.03)":"rgba(0,0,0,0.02)",position:"relative",transition:"all 0.3s ease","&:hover":{borderColor:r.orange,backgroundColor:t?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.04)"},"&:hover svg":{color:r.orange}},children:f?e.jsx(lt,{variant:"inline",size:14}):$&&$!=="none"?e.jsx(Zr,{src:$,alt:"Upload Preview",variant:"square",sx:{width:"100%",height:"100%",borderRadius:0}}):e.jsxs(s,{sx:{textAlign:"center",p:3},children:[e.jsx(pt,{sx:{width:80,height:80,color:t?r.grey:r.darkGrey,transition:"color 0.2s ease"}}),e.jsx(o,{sx:{mt:2,fontSize:"0.85rem",color:t?r.grey:r.darkGrey},children:"Click or drag to upload"})]})})]}),e.jsx(o,{sx:{mt:2,fontSize:"0.8rem",color:t?r.grey:r.darkGrey,textAlign:"center"},children:"Upload a professional photo for your profile"})]}),e.jsx(on,{socialLinks:ye,onSave:tt,cardSx:{...Yn(t),mb:0}})]}),e.jsxs(s,{sx:{flex:1,display:"flex",flexDirection:"column",gap:3},children:[e.jsxs(s,{sx:{display:"flex",flexDirection:{xs:"column",lg:"row"},alignItems:"flex-start",gap:3},children:[e.jsxs(s,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:3},children:[e.jsxs(Z,{sx:{p:3,mb:0,flex:1},children:[e.jsxs(s,{sx:Pe,children:[e.jsx(pt,{sx:{color:t?r.white:r.black,fontSize:24}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem"},children:"Basic Information"})]}),e.jsxs(s,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[e.jsxs(s,{children:[e.jsx(o,{sx:$e,children:"Professional Title"}),e.jsx(Jt,{options:v,freeSolo:!0,fullWidth:!0,size:"small",loading:z,inputValue:J,value:ee,noOptionsText:z?"Loading...":"No options available",onInputChange:(w,W)=>{ce(W),v.some(te=>te.toLowerCase()===W.toLowerCase())||K(W)},onChange:(w,W)=>{typeof W=="string"?K(W):W&&W.inputValue?K(W.inputValue):K(W||"")},renderInput:w=>e.jsx(Q,{...w,placeholder:"Select or enter your title"})})]}),e.jsxs(s,{sx:{display:"flex",gap:2,flexDirection:{xs:"column",sm:"row"}},children:[e.jsxs(s,{sx:{flex:1,minWidth:0},children:[e.jsx(o,{sx:$e,children:"Seeking"}),e.jsx(Jt,{options:ko,value:j,onChange:(w,W)=>L(W),freeSolo:!1,fullWidth:!0,size:"small",noOptionsText:"No options",renderInput:w=>e.jsx(Q,{...w,placeholder:"Employment type",inputProps:{...w.inputProps,readOnly:!0}})})]}),e.jsxs(s,{sx:{flex:1,minWidth:0},children:[e.jsx(o,{sx:$e,children:"Notice Period"}),e.jsx(Jt,{options:Co,value:D,onChange:(w,W)=>y(W),getOptionLabel:w=>w?w.label:"",isOptionEqualToValue:(w,W)=>(w==null?void 0:w.value)===(W==null?void 0:W.value),freeSolo:!1,fullWidth:!0,size:"small",noOptionsText:"No options",ListboxProps:{sx:{maxHeight:200,overflowY:"auto",overflowX:"hidden",...Ae(t)}},renderInput:w=>e.jsx(Q,{...w,placeholder:"Select notice period",inputProps:{...w.inputProps,readOnly:!0}})})]})]}),e.jsxs(s,{children:[e.jsx(o,{sx:$e,children:"Expected Salary (CTC Monthly)"}),e.jsx(Q,{fullWidth:!0,type:"text",inputMode:"numeric",value:k,onChange:w=>{const W=w.target.value;if(/^\d*$/.test(W)){const te=Number(W);(W===""||te>=1)&&T(W)}},placeholder:"ZAR Monthly Salary"}),e.jsx(o,{sx:{mt:.75,fontSize:"0.7rem",lineHeight:1.4,color:r.orange},children:"Enter your MONTHLY salary, not your annual package."})]})]})]}),e.jsxs(Z,{sx:{p:3},children:[e.jsxs(s,{sx:Pe,children:[e.jsx($o,{sx:{color:t?r.white:r.black,fontSize:24}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem"},children:"Technical Details"})]}),e.jsxs(s,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[e.jsxs(s,{children:[e.jsxs(s,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1},children:[e.jsx(o,{sx:{...$e,mb:0},children:"Internet Speed (Mbps)"}),e.jsx(o,{component:"a",href:"https://www.speedtest.net",target:"_blank",rel:"noopener noreferrer",sx:{fontSize:"0.75rem",color:r.orange,textDecoration:"none",display:"inline-flex",alignItems:"center",minHeight:{xs:40,sm:"auto"},px:{xs:.5,sm:0},"&:hover":{textDecoration:"underline"}},children:"Test Speed"})]}),e.jsx(Q,{fullWidth:!0,type:"text",inputMode:"numeric",value:oe,onChange:w=>{const W=w.target.value;if(/^\d*$/.test(W)){const te=Number(W);(W===""||te>=1&&te<1e5)&&ve(W)}},placeholder:"e.g. 100"})]}),e.jsxs(s,{sx:{display:"flex",gap:2,flexDirection:{xs:"column",sm:"row"}},children:[e.jsxs(s,{sx:{flex:1},children:[e.jsx(o,{sx:$e,children:"Typing Speed (WPM)"}),e.jsx(Q,{fullWidth:!0,type:"text",inputMode:"numeric",value:ie,onChange:w=>{const W=w.target.value;if(/^\d*$/.test(W)){const te=Number(W);(W===""||te>=1&&te<5e3)&&ae(W)}},placeholder:"e.g. 68"})]}),e.jsxs(s,{sx:{flex:1},children:[e.jsx(o,{sx:$e,children:"Typing Accuracy (%)"}),e.jsx(Q,{fullWidth:!0,type:"text",inputMode:"numeric",value:xe,onChange:w=>{const W=w.target.value;if(/^\d*$/.test(W)){const te=Number(W);(W===""||te>=1&&te<=100)&&fe(W)}},placeholder:"e.g. 96"})]})]}),e.jsx(o,{component:"a",href:"https://monkeytype.com/",target:"_blank",rel:"noopener noreferrer",sx:{fontSize:"0.75rem",color:r.orange,textDecoration:"none",textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",minHeight:{xs:40,sm:"auto"},"&:hover":{textDecoration:"underline"}},children:"Test your typing skills on MonkeyType"})]})]})]}),e.jsxs(Z,{sx:{p:3,mb:0,width:{xs:"100%",lg:"340px"},flexShrink:0,display:{xs:"none",lg:"block"}},children:[e.jsxs(s,{sx:Pe,children:[e.jsx(Dt,{sx:{color:t?r.white:r.black,fontSize:24}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem"},children:"How To"})]}),e.jsx(s,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:$s.map((w,W)=>
1e.jsxs(s,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[e.jsx(Ue,{sx:{fontSize:18,mt:.2,color:t?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.35)"}}),e.jsx(o,{sx:{fontSize:"0.8rem",color:t?r.grey:r.darkGrey,lineHeight:1.5},children:w.text})]},W))}),(()=>{const w=ws({noticePeriod:D,salary:k,seeking:j,title:ee,workingHours:q,internetSpeed:oe,typingSpeed:ie,typingAccuracy:xe,selectedImage:$,linkedin:ye.linkedin});return w?e.jsxs(s,{sx:{mt:2,p:1.5,borderRadius:"10px",borderLeft:`3px solid ${r.orange}`,backgroundColor:t?"rgba(215, 122, 46, 0.08)":"rgba(215, 122, 46, 0.06)",border:`1px solid ${t?"rgba(215, 122, 46, 0.2)":"rgba(215, 122, 46, 0.15)"}`,borderLeftWidth:"3px",borderLeftColor:r.orange},children:[e.jsxs(o,{sx:{fontSize:"0.8rem",color:r.orange,fontWeight:600,mb:1},children:["Missing Fields (",w.length,")"]}),e.jsx(s,{sx:{display:"flex",flexDirection:"column",gap:.5},children:w.map((W,te)=>e.jsxs(o,{sx:{fontSize:"0.75rem",color:W.bold?r.orange:t?r.grey:r.darkGrey,fontWeight:W.bold?700:400,lineHeight:1.5},children:["⢠",W.text]},te))})]}):null})()]})]}),e.jsxs(Z,{sx:{p:2.5},children:[e.jsxs(s,{sx:{...Pe,mb:1.25,flexWrap:"wrap",rowGap:.25},children:[e.jsx(jn,{sx:{color:t?r.white:r.black,fontSize:20}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1rem"},children:"Working Hours"}),e.jsx(o,{sx:{...$e,mb:0,fontSize:"0.8rem"},children:bo})]}),e.jsx(o,{sx:{fontSize:"0.7rem",color:r.orange,lineHeight:1.4,mb:1.25},children:yo}),e.jsx(s,{sx:{display:"grid",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(3, 1fr)",md:"repeat(4, 1fr)"},gap:1},children:cn.map(({key:w,label:W,sastWindow:te})=>{const de=q.includes(w),x=_&&!de&&!js(w),c=()=>{x||N(S=>jo(S,w))};return e.jsxs(Z,{role:"checkbox","aria-checked":de,"aria-disabled":x,tabIndex:x?-1:0,onClick:c,onKeyDown:S=>{(S.key===" "||S.key==="Enter")&&(S.preventDefault(),c())},sx:{px:1.15,py:.75,borderRadius:"10px",display:"flex",alignItems:"center",gap:.85,cursor:x?"not-allowed":"pointer",opacity:x?.35:1,borderColor:de?`${r.orange}66`:void 0,bgcolor:de?`${r.orange}14`:void 0,"&:hover":{borderColor:de?`${r.orange}99`:void 0,bgcolor:de?`${r.orange}1F`:void 0}},children:[e.jsx(mo,{checked:de,disabled:x,tabIndex:-1,sx:{transform:"scale(0.85)"},inputProps:{"aria-label":`${W} (${te})`},onChange:c,onClick:S=>S.stopPropagation()}),e.jsxs(s,{sx:{minWidth:0},children:[e.jsx(o,{noWrap:!0,sx:{fontSize:"0.78rem",fontWeight:600,lineHeight:1.25,color:de?r.orange:t?r.white:r.black},children:W}),e.jsx(o,{noWrap:!0,sx:{fontSize:"0.66rem",lineHeight:1.25,color:t?r.grey:r.darkGrey},children:te})]})]},w)})})]}),e.jsxs(s,{sx:{mt:1},children:[ke&&e.jsx(s,{sx:{width:"100%",mb:2,p:1.5,border:`1px solid ${t?"rgba(255,255,255,0.15)":r.orange}`,borderRadius:"12px",backgroundColor:t?"rgba(255,255,255,0.05)":"#FFECEC"},children:e.jsx(o,{color:"error",sx:{fontSize:"0.875rem",textAlign:"center",color:t?r.orange:void 0},children:ke})}),e.jsx(s,{sx:{display:"flex",justifyContent:"flex-end"},children:e.jsx(U,{variant:"orange",disabled:!(D&&k&&j&&ee&&q.length&&oe&&ie&&xe&&$),onMouseDown:w=>w.preventDefault(),onClick:()=>{G(""),Cr(n,{noticePeriod:D,salary:k,seeking:j,title:ee,workingHours:q,internetSpeed:oe,typingSpeed:ie,typingAccuracy:xe,selectedImage:$,socialLinks:ye,setLoading:M}).then(()=>{l(Ve)}).catch(w=>{console.error(w);const W=w.message||"Something went wrong";G(W),ze(W)})},sx:{px:3,py:1.5},children:"Continue"})})]})]})]})]})]}),e.jsx(jt,{open:pe.open,onClose:Ze,message:pe.message,severity:pe.severity})]})}const Oi=en(),Li=`${Oi}/api/slack/message/bugs?notifKey=client_error_report`,vr=async n=>{const t=Jn({title:n.type||"Frontend Error",severity:"error",body:n.description,fields:[{label:"Page",value:n.page},{label:"UID",value:n.uid}]});return(await Xn.post(Li,t)).data};var os={},Ui=it;Object.defineProperty(os,"__esModule",{value:!0});var wn=os.default=void 0,Vi=Ui(ot()),Ni=e;wn=os.default=(0,Vi.default)((0,Ni.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M10 17l-3.5-3.5 1.41-1.41L10 14.17 15.18 9l1.41 1.41z"}),"CloudDone");const Pt=qe(s),Pr=qe(o);function Mt({text:n,speed:t=50,startDelay:a=0,...l}){const[h,d]=i.useState("");return i.useEffect(()=>{let g=0;const b=setTimeout(()=>{const m=()=>{g<n.length&&(d(n.slice(0,g+1)),g++,setTimeout(m,t))};m()},a);return()=>clearTimeout(b)},[n,t,a]),e.jsx(s,{component:"span",color:"inherit",...l,children:h})}function Gi({cvLink:n,fullName:t,photoUrl:a,socialLinks:l,title:h,yearsExperience:d,currentStatus:g,expectedSalary:b,internetSpeedDownload:m,noticePeriod:p,typingAccuracy:C,typingSpeed:H,skills:I=[],hobbies:A=[],highlights:P=[]}){const{isDark:v}=He(),[V,z]=i.useState(0),M=(P||[]).filter(K=>K&&Array.isArray(K.highlights)&&K.highlights.length>0).map(K=>({title:K.title||"Highlights",data:K.highlights})),f=M.length>0?V%M.length:0,E=Ao(I),$=v?r.white:r.black,F=v?r.grey:r.greyMid,D=qt(),y=qt(),k=qt(),T=qt(),j=qt(),L=qt();i.useEffect(()=>{(async()=>(await D.start({opacity:1,y:0,transition:{duration:.6}}),await y.start({opacity:1,y:0,transition:{duration:.6}}),await k.start({opacity:1,y:0,transition:{duration:.6}}),await T.start({opacity:1,scale:1,transition:{duration:.6}}),await j.start({opacity:1,scale:1,transition:{duration:.6}}),await L.start({opacity:1,scale:1,transition:{duration:.6}})))()},[D,y,k,T,j,L]);const ee={flex:1,minHeight:"70px",maxHeight:"70px",borderRadius:"12px",display:"flex",flexDirection:"column",alignItems:"start",justifyContent:"start",p:1};return e.jsxs(e.Fragment,{children:[e.jsxs(Z,{sx:{width:"100%",mt:0,borderRadius:"12px",display:"flex",flexDirection:"column",position:"relative",p:{xs:2,md:3}},children:[e.jsxs(s,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},alignItems:{xs:"center",sm:"flex-start"},gap:2,mb:2},children:[e.jsx(Pt,{initial:{opacity:0,y:20},animate:k,sx:{width:{xs:"100px",sm:"120px",md:"130px"},height:{xs:"100px",sm:"120px",md:"130px"},minWidth:{xs:"100px",sm:"120px",md:"130px"},borderRadius:"10px",overflow:"hidden",boxShadow:v?"0 4px 16px rgba(0,0,0,0.4)":"0 4px 16px rgba(0,0,0,0.1)"},children:e.jsx(Zr,{src:a,alt:"Profile",variant:"square",sx:{width:"100%",height:"100%",borderRadius:"10px"}})}),e.jsxs(s,{sx:{flex:1,display:"flex",flexDirection:"column",alignItems:{xs:"center",sm:"flex-start"}},children:[e.jsx(Pr,{initial:{opacity:0,y:-20},animate:D,variant:"h1",sx:{fontSize:{xs:"1.75rem",sm:"2.25rem",md:"2.5rem"},fontWeight:700,color:$,textTransform:"capitalize",mb:.5,textAlign:{xs:"center",sm:"left"},lineHeight:1.15,letterSpacing:"-0.3px"},children:e.jsx(Mt,{text:t,speed:50})}),e.jsx(Pr,{initial:{opacity:0,y:-20},animate:y,variant:"h3",sx:{fontSize:{xs:"1rem",sm:"1.15rem",md:"1.25rem"},fontWeight:500,color:v?r.grey:r.greyMid,textTransform:"capitalize",mb:1,textAlign:{xs:"center",sm:"left"},lineHeight:1.3},children:e.jsx(Mt,{text:h,speed:50,startDelay:500})})]})]}),e.jsxs(s,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:3,width:"100%"},children:[e.jsxs(Pt,{initial:{opacity:0,scale:0},animate:T,sx:{flex:{xs:"1",md:"0 0 65%"}},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1.5,mb:2,justifyContent:{xs:"center",md:"flex-start"}},children:[e.jsx(be,{title:"Skills rated from 1-5 based on proficiency level",arrow:!0,children:e.jsx(Qr,{sx:{fontSize:"0.85rem",color:v?r.greyMid:r.darkGrey,cursor:"help"}})}),e.jsx(o,{sx:{fontSize:{xs:"0.65rem",md:"0.7rem"},fontWeight:800,color:v?r.greyMid:r.darkGrey,textTransform:"uppercase",letterSpacing:"2px"},children:"Skills & Ratings"}),e.jsx(s,{sx:{flex:1,height:"1px",background:v?"linear-gradient(90deg, #333 0%, transparent 100%)":"linear-gradient(90deg, #e0e0e0 0%, transparent 100%)",maxWidth:{xs:"100px",md:"140px"}}})]}),e.jsx(s,{sx:{display:"flex",flexWrap:"wrap",gap:1,justifyContent:{xs:"center",md:"flex-start"}},children:E.map(K=>e.jsx(Eo,{name:K.name,rating:K.rating},K.name))})]}),A&&A.length>0&&e.jsxs(Pt,{initial:{opacity:0,scale:0},animate:j,sx:{flex:1},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1.5,mb:2,justifyContent:{xs:"center",md:"flex-start"}},children:[e.jsx(o,{sx:{fontSize:{xs:"0.65rem",md:"0.7rem"},fontWeight:800,color:v?r.greyMid:r.darkGrey,textTransform:"uppercase",letterSpacing:"2px"},children:"Hobbies & Interests"}),e.jsx(s,{sx:{flex:1,height:"1px",background:v?"linear-gradient(90deg, #333 0%, transparent 100%)":"linear-gradient(90deg, #e0e0e0 0%, transparent 100%)",maxWidth:{xs:"100px",md:"140px"}}})]}),e.jsx(s,{sx:{display:"flex",flexWrap:"wrap",gap:1,justifyContent:{xs:"center",md:"flex-start"}},children:A.map(K=>
1e.jsx(s,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75,pl:1.25,pr:1.25,py:.65,borderRadius:"12px",background:v?"linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(230,230,230,0.05) 100%)":"linear-gradient(135deg, rgba(0,0,0,0.08) 0%, rgba(26,26,26,0.05) 100%)",border:`1.5px solid ${v?"rgba(255,255,255,0.15)":"rgba(0,0,0,0.15)"}`,transition:"all 0.2s ease",boxShadow:v?"0 2px 8px rgba(0,0,0,0.3)":"0 2px 8px rgba(0,0,0,0.06)"},children:e.jsx(o,{sx:{fontSize:"0.7rem",fontWeight:600,color:v?r.white:r.black,lineHeight:1.4},children:K})},K))})]})]})]}),e.jsxs(s,{sx:{display:{xs:"none",sm:"none",md:"flex",lg:"none",xl:"flex"},mt:1,width:"100%",borderRadius:"20px",flexDirection:"row",alignItems:"start",justifyContent:"center",gap:2,position:"relative"},children:[e.jsx(Pt,{initial:{opacity:0,scale:0},animate:L,sx:{flex:1},children:e.jsxs(Z,{sx:ee,children:[e.jsx(o,{sx:{fontSize:Ke.b5,fontWeight:"regular",color:F,pl:1},children:"Notice Period:"}),e.jsx(o,{sx:{fontSize:Ke.b3,fontWeight:600,color:$,alignSelf:"center",mt:.5},children:e.jsx(Mt,{text:zo(p),speed:100})})]})}),e.jsx(Pt,{initial:{opacity:0,scale:0},animate:L,sx:{flex:1},children:e.jsxs(Z,{sx:ee,children:[e.jsx(o,{sx:{fontSize:Ke.b5,fontWeight:"regular",color:F,pl:1},children:"Seeking:"}),e.jsx(o,{sx:{fontSize:Ke.b3,fontWeight:600,color:$,alignSelf:"center",mt:.5},children:e.jsx(Mt,{text:g,speed:100})})]})}),e.jsx(Pt,{initial:{opacity:0,scale:0},animate:L,sx:{flex:1},children:e.jsxs(Z,{sx:ee,children:[e.jsx(o,{sx:{fontSize:Ke.b5,fontWeight:"regular",color:F,pl:1},children:"Salary:"}),e.jsx(o,{sx:{fontSize:Ke.b3,fontWeight:600,color:$,alignSelf:"center",mt:.5},children:e.jsx(Mt,{text:"R "+b,speed:100})})]})}),e.jsx(Pt,{initial:{opacity:0,scale:0},animate:L,sx:{flex:1},children:e.jsxs(Z,{sx:ee,children:[e.jsx(o,{sx:{fontSize:Ke.b5,fontWeight:"regular",color:F,pl:1},children:"Experience:"}),e.jsx(o,{sx:{fontSize:Ke.b3,fontWeight:600,color:$,alignSelf:"center",mt:.5},children:e.jsx(Mt,{text:d+" Years",speed:100})})]})})]}),M.length>0&&e.jsxs(Z,{sx:{mt:1,width:"100%",borderRadius:"12px",overflow:"hidden",pb:1},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:1,pt:1.5,pb:1},children:[e.jsx(me,{variant:"subtle",onClick:()=>z((f+M.length-1)%M.length),sx:{width:28,height:28},children:e.jsx(To,{sx:{fontSize:20}})}),e.jsx(o,{sx:{fontSize:Ke.b3,fontWeight:"bold",color:$,minWidth:"160px",textAlign:"center"},children:M[f].title}),e.jsx(me,{variant:"subtle",onClick:()=>z((f+1)%M.length),sx:{width:28,height:28},children:e.jsx(Mo,{sx:{fontSize:20}})})]}),e.jsx(s,{sx:{display:"flex",justifyContent:"center",gap:.8,mb:1.5},children:M.map((K,q)=>e.jsx(s,{onClick:()=>z(q),sx:{width:6,height:6,borderRadius:"50%",backgroundColor:q===f?r.orange:F,cursor:"pointer",transition:"all 0.2s ease",opacity:q===f?1:.4}},q))}),e.jsx(Pt,{initial:{x:100,opacity:0},animate:{x:0,opacity:1},transition:{duration:.4},sx:{width:"100%",minHeight:"180px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"start"},children:M[f].data.map((K,q)=>e.jsx(Pr,{initial:{y:-10,opacity:0},animate:{y:0,opacity:1},transition:{delay:q*.1},sx:{fontSize:Ke.b4,fontWeight:"regular",color:$,alignSelf:"flex-start",mt:.5,pl:4,pr:4,mb:.5},children:e.jsx(Mt,{text:`⢠${K}`,speed:30})},q))},f)]})]})}const Sn=()=>{var y;const{isDark:n}=He(),[t,a]=i.useState([]),[l,h]=i.useState(!0),[d,g]=i.useState(!1),[b,m]=i.useState(null),[p,C]=i.useState({}),[H,I]=i.useState(!1),[A,P]=i.useState(null),v=wr(),V=Ce(),z=(y=v.currentUser)==null?void 0:y.uid;i.useEffect(()=>{if(!z)return;(async()=>{try{h(!0);const T=Se(V,"users",z,"userData","data"),j=await Qe(T);if(j.exists()){const L=j.data();a(L.references||[])}}catch(T){console.error("Error fetching references:",T),P("Failed to load references")}finally{h(!1)}})()},[z,V]);const M=async k=>{try{g(!0);const T=Se(V,"users",z,"userData","data");await Zt(T,{references:k},{merge:!0}),a(k),P(null)}catch(T){console.error("Error saving references:",T),P("Failed to save references")}finally{g(!1)}},f=()=>{const k={referenceId:Ho(),referenceName:p.referenceName||"",priorRelationship:p.priorRelationship||"",emails:p.emails?p.emails.split(",").map(j=>j.trim()).filter(j=>j):[],phoneNumbers:p.phoneNumbers?p.phoneNumbers.split(",").map(j=>j.trim()).filter(j=>j):[],contacted:!1,followUps:"",teamworkScore:null,initiativeScore:null,overallImpressionScore:null,wouldRehire:null,additionalNotes:"",scrapedFromCV:!1,verificationStatus:"pending"},T=[...t,k];M(T),ur(z,"references_added","Reference added",{referenceName:k.referenceName},"user"),I(!1),C({})},E=k=>{m(k.referenceId),C({referenceName:k.referenceName,priorRelationship:k.priorRelationship,emails:k.emails.join(", "),phoneNumbers:k.phoneNumbers.join(", ")})},$=k=>{const T=t.map(j=>j.referenceId===k?{...j,referenceName:p.referenceName,priorRelationship:p.priorRelationship,emails:p.emails.split(",").map(L=>L.trim()).filter(L=>L),phoneNumbers:p.phoneNumbers.split(",").map(L=>L.trim()).filter(L=>L)}:j);M(T),m(null),C({})},F=k=>{const T=t.filter(j=>j.referenceId!==k);M(T)},D=()=>{m(null),I(!1),C({})};return l?e.jsx(lt,{variant:"minimal",sx:{minHeight:"auto",py:8}}):e.jsxs(s,{sx:{display:"flex",flexDirection:"column",flex:1},children:[e.jsxs(s,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3,children:[e.jsx(s,{display:"flex",alignItems:"center",gap:1.5,children:t.length>0&&e.jsx(fr,{variant:"translucent",label:`${t.length} reference${t.length!==1?"s":""} found`,sx:{height:28,"& .MuiChip-label":{px:1.5}}})}),!H&&t.length>0&&e.jsx(U,{variant:"orange",iconOnly:!0,onClick:()=>I(!0),disabled:d,children:e.jsx(ks,{sx:{fontSize:20}})})]}),A&&e.jsx(ts,{severity:"error",sx:{mb:3},onClose:()=>P(null),children:A}),e.jsx(un,{in:H,children:e.jsxs(ft,{sx:{mb:3,p:3,borderRadius:"14px"},children:[e.jsx(o,{sx:{fontSize:Ke.b1,fontWeight:600,color:n?r.white:r.black,mb:2.5},children:"Add New Reference"}),e.jsxs(s,{display:"flex",flexDirection:"column",gap:1.5,children:[e.jsx(Q,{fullWidth:!0,title:"Full Name",placeholder:"John Smith",value:p.referenceName||"",onChange:k=>C({...p,referenceName:k.target.value}),required:!0}),e.jsx(Q,{fullWidth:!0,title:"Relationship",placeholder:"e.g., Manager at Company XYZ",value:p.priorRelationship||"",onChange:k=>C({...p,priorRelationship:k.target.value})}),e.jsx(Q,{fullWidth:!0,title:"Email Addresses",placeholder:"[email protected], [email protected]",value:p.emails||"",onChange:k=>C({...p,emails:k.target.value}),helperText:"Separate multiple emails with commas",FormHelperTextProps:{sx:{color:n?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.4)",fontSize:"0.7rem",mt:.5}}}),e.jsx(Q,{fullWidth:!0,title:"Phone Numbers",placeholder:"+1-555-0123, +1-555-0456",value:p.phoneNumbers||"",onChange:k=>C({...p,phoneNumbers:k.target.value}),helperText:"Separate multiple numbers with commas",FormHelperTextProps:{sx:{color:n?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.4)",fontSize:"0.7rem",mt:.5}}}),e.jsxs(s,{display:"flex",justifyContent:"flex-end",gap:1.5,mt:1,children:[e.jsx(U,{variant:"transparent",onClick:D,disabled:d,sx:{px:2.5,fontSize:"0.8rem"},children:"Cancel"}),e.jsxs(U,{variant:"orange",onClick:f,disabled:!p.referenceName||d,sx:{px:2.5,fontSize:"0.8rem"},children:[e.jsx(Cs,{sx:{mr:.5,fontSize:16}}),d?"Saving...":"Save"]})]})]})]})}),t.length===0&&!H&&e.jsxs(s,{sx:{flex:1,minHeight:200,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",px:4,py:5,textAlign:"center",borderRadius:"14px",bgcolor:n?"rgba(255,255,255,0.02)":"rgba(0,0,0,0.02)",border:`2px dashed ${n?"rgba(255,255,255,0.15)":"rgba(0,0,0,0.15)"}`},children:[e.jsx(s,{sx:{width:80,height:80,borderRadius:"20px",bgcolor:n?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.05)",display:"flex",alignItems:"center",justifyContent:"center",mb:3},children:e.jsx(Rs,{sx:{fontSize:40,color:n?"rgba(255,255,255,0.3)":"rgba(0,0,0,0.3)"}})}),e.jsx(o,{sx:{fontSize:"1.25rem",fontWeight:600,color:n?r.white:r.black,mb:1.5},children:"No references found"}),e.jsx(o,{sx:{fontSize:"0.95rem",color:n?"rgba(255,255,255,0.5)":"rgba(0,0,0,0.5)",maxWidth:350,lineHeight:1.6,mb:3},children:"References will be automatically extracted from your CV, or you can add them manually."}),e.jsxs(U,{variant:"orange",onClick:()=>I(!0),disabled:d,sx:{px:4},children:[e.jsx(ks,{sx:{mr:.5,fontSize:20}}),"Add Reference"]})]}),e.jsx(s,{display:"flex",flexDirection:"column",gap:2,children:t.map(k=>e.jsx(s,{sx:{p:3,borderRadius:"14px",bgcolor:n?"rgba(255,255,255,0.03)":r.white,border:k.scrapedFromCV?`2px s
1olid ${r.orange}`:`1px solid ${n?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.08)"}`,boxShadow:n?"0 4px 16px rgba(0, 0, 0, 0.2)":"0 4px 16px rgba(0, 0, 0, 0.05)",transition:"all 0.2s ease","&:hover":{boxShadow:n?"0 8px 24px rgba(0, 0, 0, 0.3)":"0 8px 24px rgba(0, 0, 0, 0.1)",transform:"translateY(-2px)"}},children:b===k.referenceId?e.jsxs(s,{display:"flex",flexDirection:"column",gap:1.5,children:[e.jsx(Q,{fullWidth:!0,title:"Full Name",value:p.referenceName||"",onChange:T=>C({...p,referenceName:T.target.value})}),e.jsx(Q,{fullWidth:!0,title:"Relationship",value:p.priorRelationship||"",onChange:T=>C({...p,priorRelationship:T.target.value})}),e.jsx(Q,{fullWidth:!0,title:"Email Addresses",value:p.emails||"",onChange:T=>C({...p,emails:T.target.value})}),e.jsx(Q,{fullWidth:!0,title:"Phone Numbers",value:p.phoneNumbers||"",onChange:T=>C({...p,phoneNumbers:T.target.value})}),e.jsxs(s,{display:"flex",justifyContent:"flex-end",gap:1.5,mt:1,children:[e.jsx(U,{variant:"transparent",onClick:D,disabled:d,sx:{px:2.5,fontSize:"0.8rem"},children:"Cancel"}),e.jsxs(U,{variant:"orange",onClick:()=>$(k.referenceId),disabled:d,sx:{px:2.5,fontSize:"0.8rem"},children:[e.jsx(Cs,{sx:{mr:.5,fontSize:16}}),d?"Saving...":"Save"]})]})]}):e.jsxs(s,{children:[e.jsxs(s,{display:"flex",justifyContent:"space-between",alignItems:"flex-start",mb:2,children:[e.jsxs(s,{flex:1,children:[e.jsxs(s,{display:"flex",alignItems:"center",gap:1.5,mb:.5,children:[e.jsx(o,{sx:{fontSize:Ke.b1,fontWeight:700,color:n?r.white:r.black},children:k.referenceName}),k.scrapedFromCV&&e.jsx(fr,{variant:"orange",icon:e.jsx(cr,{sx:{fontSize:14}}),label:"From CV",sx:{height:24,"& .MuiChip-icon":{color:r.white}}})]}),k.priorRelationship&&e.jsxs(o,{sx:{fontSize:Ke.b3,color:n?"rgba(255,255,255,0.6)":"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",gap:.5},children:[e.jsx(Rs,{sx:{fontSize:16}}),k.priorRelationship]})]}),e.jsxs(s,{display:"flex",gap:.5,children:[e.jsx(be,{title:"Edit reference",arrow:!0,children:e.jsx(s,{children:e.jsx(U,{variant:"black",iconOnly:!0,onClick:()=>E(k),disabled:d,sx:{width:36,height:36,minWidth:36,minHeight:36},children:e.jsx(Lo,{sx:{fontSize:18}})})})}),e.jsx(be,{title:"Delete reference",arrow:!0,children:e.jsx(s,{children:e.jsx(U,{variant:"transparent",iconOnly:!0,onClick:()=>F(k.referenceId),disabled:d,sx:{width:36,height:36,minWidth:36,minHeight:36},children:e.jsx(Oo,{sx:{fontSize:18}})})})})]})]}),e.jsxs(s,{sx:{pt:2,borderTop:`1px solid ${n?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.06)"}`},children:[k.emails&&k.emails.length>0&&e.jsxs(s,{mb:1.5,children:[e.jsxs(s,{display:"flex",alignItems:"center",gap:.5,mb:1,children:[e.jsx(Uo,{sx:{fontSize:16,color:n?"rgba(255,255,255,0.5)":"rgba(0,0,0,0.4)"}}),e.jsx(o,{sx:{fontSize:"0.75rem",fontWeight:600,color:n?"rgba(255,255,255,0.5)":"rgba(0,0,0,0.4)",textTransform:"uppercase",letterSpacing:"0.5px"},children:"Email"})]}),e.jsx(s,{display:"flex",gap:1,flexWrap:"wrap",children:k.emails.map((T,j)=>e.jsx(fr,{variant:"translucent",label:T,sx:{height:28,fontSize:"0.8rem"}},j))})]}),k.phoneNumbers&&k.phoneNumbers.length>0&&e.jsxs(s,{children:[e.jsxs(s,{display:"flex",alignItems:"center",gap:.5,mb:1,children:[e.jsx(Vo,{sx:{fontSize:16,color:n?"rgba(255,255,255,0.5)":"rgba(0,0,0,0.4)"}}),e.jsx(o,{sx:{fontSize:"0.75rem",fontWeight:600,color:n?"rgba(255,255,255,0.5)":"rgba(0,0,0,0.4)",textTransform:"uppercase",letterSpacing:"0.5px"},children:"Phone"})]}),e.jsx(s,{display:"flex",gap:1,flexWrap:"wrap",children:k.phoneNumbers.map((T,j)=>e.jsx(fr,{variant:"translucent",label:T,sx:{height:28,fontSize:"0.8rem"}},j))})]}),(!k.emails||k.emails.length===0)&&(!k.phoneNumbers||k.phoneNumbers.length===0)&&e.jsx(o,{sx:{fontSize:Ke.b3,color:n?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.4)",fontStyle:"italic"},children:"No contact information available"})]})]})},k.referenceId))})]})},qi=({open:n,onClose:t})=>{const{isDark:a}=He();return e.jsxs(Lt,{open:n,onClose:t,maxWidth:"md",fullWidth:!0,PaperProps:{sx:{maxHeight:"85vh"}},children:[e.jsxs(s,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:4,py:3,borderBottom:`1px solid ${a?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)"}`,background:a?`linear-gradient(135deg, ${r.black} 0%, ${r.offBlack} 100%)`:`linear-gradient(135deg, ${r.white} 0%, #f5f5f5 100%)`},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:2},children:[e.jsx(s,{sx:{width:48,height:48,borderRadius:"12px",bgcolor:a?r.white:r.black,display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"none"},children:e.jsx(Sr,{sx:{color:a?r.black:r.white,fontSize:26}})}),e.jsxs(s,{children:[e.jsx(o,{sx:{fontSize:Ke.h2,fontWeight:"bold",color:a?r.white:r.black,lineHeight:1.2},children:"Professional References"}),e.jsx(o,{sx:{fontSize:Ke.b3,color:a?"rgba(255,255,255,0.6)":"rgba(0,0,0,0.5)",mt:.5},children:"Review and manage your extracted references"})]})]}),e.jsx(me,{variant:"close",onClick:t,sx:{width:44,height:44,borderRadius:"10px"},children:e.jsx(xr,{})})]}),e.jsx(Qt,{sx:{overflowX:"hidden"},children:e.jsx(s,{sx:{px:4,py:3},children:e.jsx(Sn,{})})}),e.jsx(s,{sx:{display:"flex",justifyContent:"center",alignItems:"center",px:4,py:2,borderTop:`1px solid ${a?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)"}`,bgcolor:a?r.black:r.white},children:e.jsx(o,{sx:{fontSize:Ke.b4,color:a?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.4)",textAlign:"center"},children:"You can edit or add references at any time from your dashboard"})})]})},Bi=Array.from({length:24},(n,t)=>({id:t,x:50+(Math.random()-.5)*70,size:Math.random()*3+1.5,delay:Math.random()*1.2+.4,duration:Math.random()*1.8+1.5,opacity:Math.random()*.5+.2,drift:(Math.random()-.5)*30}));function Yi({isDark:n,onComplete:t}){const a=i.useCallback(t,[]);i.useEffect(()=>{const d=setTimeout(()=>{a()},3200);return()=>clearTimeout(d)},[a]);const l=r.orange,h=n?r.white:r.black;return e.jsxs(s,{sx:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"hidden"},children:[e.jsx(qe.div,{initial:{opacity:0,scale:.4}
1,animate:{opacity:[0,.8,.4],scale:[.4,1.1,1]},transition:{duration:2,ease:"easeOut"},style:{position:"absolute",width:500,height:500,borderRadius:"50%",background:n?`radial-gradient(circle, ${l}18 0%, ${l}08 35%, transparent 65%)`:`radial-gradient(circle, ${l}14 0%, ${l}06 35%, transparent 65%)`,pointerEvents:"none"}}),e.jsx(qe.div,{initial:{opacity:.6,scale:.5},animate:{opacity:0,scale:2.2},transition:{duration:1.4,delay:.6,ease:"easeOut"},style:{position:"absolute",width:130,height:130,borderRadius:"50%",border:`1.5px solid ${l}`,pointerEvents:"none"}}),Bi.map(d=>e.jsx(qe.div,{initial:{opacity:0,y:30,x:0},animate:{opacity:[0,d.opacity,0],y:[30,-80],x:d.drift},transition:{duration:d.duration,delay:d.delay,ease:"easeOut"},style:{position:"absolute",left:`${d.x}%`,top:"55%",width:d.size,height:d.size,borderRadius:"50%",backgroundColor:n?r.white:l,pointerEvents:"none"}},d.id)),e.jsx(qe.div,{initial:{scale:.5,opacity:0},animate:{scale:1,opacity:1},transition:{duration:.6,ease:[.34,1.56,.64,1]},style:{position:"relative",zIndex:2},children:e.jsxs("svg",{width:"130",height:"130",viewBox:"0 0 130 130",children:[e.jsxs("defs",{children:[e.jsxs("filter",{id:"ring-glow",x:"-50%",y:"-50%",width:"200%",height:"200%",children:[e.jsx("feGaussianBlur",{stdDeviation:"4",result:"blur"}),e.jsx("feFlood",{floodColor:l,floodOpacity:"0.5",result:"color"}),e.jsx("feComposite",{in:"color",in2:"blur",operator:"in",result:"shadow"}),e.jsxs("feMerge",{children:[e.jsx("feMergeNode",{in:"shadow"}),e.jsx("feMergeNode",{in:"SourceGraphic"})]})]}),e.jsxs("filter",{id:"check-glow",x:"-50%",y:"-50%",width:"200%",height:"200%",children:[e.jsx("feGaussianBlur",{stdDeviation:"2",result:"blur"}),e.jsx("feFlood",{floodColor:h,floodOpacity:"0.3",result:"color"}),e.jsx("feComposite",{in:"color",in2:"blur",operator:"in",result:"shadow"}),e.jsxs("feMerge",{children:[e.jsx("feMergeNode",{in:"shadow"}),e.jsx("feMergeNode",{in:"SourceGraphic"})]})]})]}),e.jsx("circle",{cx:"65",cy:"65",r:"56",fill:"none",stroke:n?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.04)",strokeWidth:"2"}),e.jsx(qe.circle,{cx:"65",cy:"65",r:"56",fill:"none",stroke:l,strokeWidth:"2.5",strokeLinecap:"round",filter:"url(#ring-glow)",initial:{pathLength:0},animate:{pathLength:1},transition:{duration:1,ease:[.65,0,.35,1]},style:{transformOrigin:"center",rotate:"-90deg"}}),e.jsx(qe.path,{d:"M42 67 L56 81 L90 47",fill:"none",stroke:h,strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round",filter:"url(#check-glow)",initial:{pathLength:0},animate:{pathLength:1},transition:{duration:.5,delay:.8,ease:[.65,0,.35,1]}})]})}),e.jsx(qe.div,{initial:{opacity:0,y:24},animate:{opacity:1,y:0},transition:{duration:.6,delay:1.3,ease:[.25,.1,.25,1]},style:{position:"relative",zIndex:2,textAlign:"center",marginTop:28},children:e.jsx(o,{sx:{fontSize:{xs:"1.5rem",md:"1.8rem"},fontWeight:700,color:n?r.white:r.black,letterSpacing:"-0.02em"},children:"ReelCV Ready"})}),e.jsx(qe.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.5,delay:1.6,ease:[.25,.1,.25,1]},style:{position:"relative",zIndex:2,textAlign:"center",marginTop:10},children:e.jsx(o,{sx:{fontSize:{xs:"0.9rem",md:"1rem"},fontWeight:400,color:n?"rgba(255,255,255,0.5)":"rgba(0,0,0,0.45)"},children:"Your profile has been generated"})}),e.jsx(qe.div,{initial:{scaleX:0,opacity:0},animate:{scaleX:1,opacity:1},transition:{duration:.8,delay:1.9,ease:[.25,.1,.25,1]},style:{position:"relative",zIndex:2,marginTop:22,width:60,height:2,borderRadius:1,background:`linear-gradient(90deg, transparent, ${l}, transparent)`,transformOrigin:"center"}})]})}const Ji=({cvLink:n,fullName:t,photoUrl:a,socialLinks:l,title:h,experienceYears:d,currentStatus:g,expectedSalary:b,internetSpeedDownload:m,noticePeriod:p,typingAccuracy:C,typingSpeed:H,skills:I,hobbies:A,highlights:P})=>{const z=[n,t,a,l,h,d,g,b,m,p,C,H],M=L=>L!=null&&L!==""&&!(typeof L=="string"&&L.toLowerCase()==="none"),f=L=>Array.isArray(L)&&L.length>0,E=z.filter(M).length,$=[I,A,P].filter(f).length,F=E/z.length,D=$/3,y=F*.3+D*.7,k=20;return Math.round(y*(70-k)+k)},vn=(n={})=>{const t=[],a=(l,h)=>{Array.isArray(n==null?void 0:n[l])&&n[l].length>0&&t.push({title:h,highlights:n[l].map(d=>String(d).replace(/^\s*-\s*/,""))})};
1return a("careerBackgroundAndEducation","Background"),a("projectsAndProfessionalAchievements","Achievements"),a("technicalSkillsAndTools","Technical & Statistics"),t};async function Ds(n,{setCvLink:t,setPhotoUrl:a,setFullName:l,setTitle:h,setYearsExperience:d,setSocialLinks:g,setCurrentStatus:b,setExpectedSalary:m,setInternetSpeedDownload:p,setNoticePeriod:C,setTypingAccuracy:H,setTypingSpeed:I,setSkills:A,setHobbies:P,setHighlights:v,setLoading:V}){if(!n){console.warn("fetchUserDetails: no uid"),V(!1);return}const z=Ce();try{const M=await Qe(Se(z,"users",n,"userData","data"));if(!M.exists()){console.warn("fetchUserDetails: no userData/data");return}const f=M.data();f.userCV&&t(f.userCV),f.fullName&&l(f.fullName),f.photoUrl&&a(f.photoUrl),f.title&&h(f.title),f.currentStatus&&b(f.currentStatus),f.expectedSalary!=null&&m(String(f.expectedSalary)),f.internetSpeedDownload!=null&&p(String(f.internetSpeedDownload)),f.noticePeriod!=null&&C(String(f.noticePeriod)),f.typingAccuracy!=null&&H(String(f.typingAccuracy)),f.typingSpeed!=null&&I(String(f.typingSpeed)),f.yearsExperience!=null&&d(String(f.yearsExperience)),g(ln(f.socials)),A(Array.isArray(f.skills)?f.skills:[]),P(Array.isArray(f.hobbies)?f.hobbies:[]),v(vn(f.highlightGroups))}catch(M){console.error("fetchUserDetails:",M),ct({area:"user_setup",error:M,type:"cvUpload fetchUserDetails failed",severity:"warning",uid:n})}finally{V(!1)}}async function Xi(n,{cvLink:t,setLoading:a}){if(!n){console.warn("no uid"),a(!1);return}a(!0);try{if(!t||t===null)throw new Error("cv has not been uploaded")}catch(l){throw console.error("handleContinue error:",l),ct({area:"user_setup",error:l,type:"cvUpload handleContinue save failed",severity:"error",uid:n}),l}finally{a(!1)}}function Ki({cvLink:n}){const t=[];return(!n||n===null)&&t.push("⢠Cv has not been Uploaded."),t.length?e.jsxs(e.Fragment,{children:[e.jsx(o,{component:"span",sx:{fontWeight:700},children:"Missing:"}),e.jsx("br",{}),t.map((a,l)=>e.jsxs(Gr.Fragment,{children:[a,e.jsx("br",{})]},l))]}):e.jsxs(e.Fragment,{children:["All setânothingâs missing!",e.jsx("br",{}),"⢠Upload an updated cv if you would like!"]})}const Qi=[{text:"Upload your CV in PDF format by dragging & dropping or clicking to browse"},{text:"Our AI will extract your skills, experience, and career highlights"},{text:"Your ReelCV preview will be generated automatically with animations"},{text:"Review your ReelCV and click Continue to proceed to the next step"}],As=new Set;function Xt({type:n,page:t,description:a}){const l=Rt.currentUser;if(!l)return;const h=l.uid,d=`${n}|${t}`;As.has(d)||(As.add(d),vr({uid:h,type:n,page:t,description:a}))}async function Es({path:n,uid:t,retryAttempts:a=3,optional:l=!1}){let h=null;for(let d=1;d<=a;d++)try{const g=await Le(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uid:t})});if(!g.ok){const b=await g.text();throw new Error(`Genkit failed @ ${n}: ${b}`)}return await g.json(),{success:!0,path:n}}catch(g){h=g,d<a?console.warn(`[fetchWithRetry] Attempt ${d}/${a} failed for ${n}: ${g.message}`):l||Xt({type:"User Setup Process",page:"Cv Upload",description:`API Failure. Attempt ${d}. Error: ${g.message}`})}if(l)return console.warn(`[fetchWithRetry] Optional step failed, continuing: ${n}`),{success:!1,path:n,optional:!0};throw h}async function Zi(n,t=()=>{}){if(!Rt.currentUser)throw new Error("User not logged in");const a=3;try{await t({label:"Extracting CV and Socials data...",isRetry:!1,statusLabel:"Extracting CV and Socials data..."}),await Es({path:"/api/admin/user/cv/extractText",uid:n,retryAttempts:a,optional:!1}),await t({label:"Extracting CV and Socials data...",isRetry:!1,statusLabel:"â CV text extracted!"});const l=[{path:"/api/usersetup/cv/parse/tags",label:"Finding and generating skill setâ¦",optional:!1},{path:"/api/usersetup/cv/experienceYears",label:"Calculating years of experienceâ¦",optional:!1},{path:"/api/usersetup/cv/doneInformation",label:"Creating experience informationâ¦",optional:!1},{path:"/api/usersetup/cv/personalDetails",label:"Finding personal detailsâ¦",optional:!1},{path:"/api/usersetup/parse/highlights",label:"Creating Hirexe Highlightsâ¦",optional:!1},{path:"/api/usersetup/cv/extractReferences",label:"Extracting professional referencesâ¦",optional:!0},{path:"/api/usersetup/cv/extractQualifications",label:"Extracting qualificationsâ¦",optional:!0}];await t({label:"Processing profile...",isRetry:!1,statusLabel:"AI analyzing your profile..."});const h=await Promise.allSettled(l.map(async g=>{const b=await Es({path:g.path,uid:n,retryAttempts:a,optional:g.optional});return b.success?t({label:g.label,isRetry:!1,statusLabel:`â ${g.label.replace("â¦","")} complete!`}):g.optional&&t({label:g.label,isRetry:!1,statusLabel:"â Skipped (no data found)"}),b})),d=[];
1if(h.forEach((g,b)=>{const m=l[b];g.status==="rejected"&&!m.optional&&d.push({step:m,error:g.reason})}),d.length>0){const g=d.map(b=>b.step.label).join(", ");throw new Error(`Failed steps after ${a} retries: ${g}`)}await t({label:"complete",isRetry:!1,statusLabel:"Creating your profile..."})}catch(l){throw console.error("[runCvGenkitApis] ð¥ Error",l),Xt({type:"User Setup Process",page:"Cv Upload",description:"runCvGenkitApis Error: "+l.message}),l}}async function ea(n,t=()=>{}){try{await t({label:"",isRetry:!1,statusLabel:"Starting AI flow..."}),await Zi(n,t)}catch(p){throw console.error("[generateAndFetchProfile] ð¥ Genkit API error",p),p}await t({label:"final",isRetry:!1,statusLabel:"Double checking your informationâ¦"});const a=Ce(),l=Se(a,"users",n,"userData","data");let h,d;const g=6e4,b=new Promise((p,C)=>{h=qn(l,async H=>{if(!H.exists())return;const I=H.data(),A=Array.isArray(I.skills)&&I.skills.length>0;let P=!1;I.highlightGroups&&typeof I.highlightGroups=="object"&&(P=Object.values(I.highlightGroups).some(z=>Array.isArray(z)&&z.length>0));let v=!1;Array.isArray(I.doneGroups)&&(v=I.doneGroups.some(z=>z&&Array.isArray(z.doneItems)&&z.doneItems.length>0));const V=Number.isInteger(I.yearsExperience)&&I.yearsExperience>=0;A&&P&&v&&V&&(clearTimeout(d),h(),await t({label:"complete",isRetry:!1,statusLabel:"Check successful!"}),p(I))},H=>{clearTimeout(d),h(),console.error("[generateAndFetchProfile] ð¥ Firestore listener error",H),Xt({type:"User Setup Process",page:"Cv Upload",description:"Firestore DB Listener Failed. Error: "+H.message}),C(H)})}),m=new Promise((p,C)=>{d=setTimeout(()=>{h&&h(),C(new Error(`generateAndFetchProfile timed out after ${g}ms`))},g)});return Promise.race([b,m])}function Ts({uid:n}){const{isDark:t,toggleDarkMode:a}=He(),l=ut(),h=i.useRef(null),[d,g]=i.useState(!0),[b,m]=i.useState(!1),p=i.useRef(0),C=i.useRef(null),[H,I]=i.useState(0),[A,P]=i.useState(0),[v,V]=i.useState(""),[z,M]=i.useState(!1),[f,E]=i.useState(!1),[$,F]=i.useState(null),[D,y]=i.useState(null),[k,T]=i.useState(null),[j,L]=i.useState(es()),[ee,K]=i.useState(null),[q,N]=i.useState(null),[_,J]=i.useState(null),[ce,oe]=i.useState(null),[ve,ie]=i.useState(null),[ae,xe]=i.useState(null),[fe,ke]=i.useState(null),[G,pe]=i.useState(null),[Ee,ze]=i.useState(null),[Ze,ye]=i.useState(null),[Fe,Be]=i.useState(null),[Ie,Ve]=i.useState(!1),[We,Ye]=i.useState(!1),[je,Ne]=i.useState(""),[Je,ge]=i.useState(!1),[tt,De]=i.useState(!1),[Pe,$e]=i.useState({open:!1,message:"",severity:"error"}),O=(X,he="error")=>$e({open:!0,message:X,severity:he}),w=()=>$e(X=>({...X,open:!1})),W=X=>{p.current=X,I(X)},te=X=>{cancelAnimationFrame(C.current);const he=p.current,_e=X-he,Te=300,rt=performance.now(),st=dt=>{const xt=Math.min((dt-rt)/Te,1);I(Math.round(he+_e*xt)),xt<1?C.current=requestAnimationFrame(st):p.current=X};C.current=requestAnimationFrame(st)};i.useEffect(()=>()=>cancelAnimationFrame(C.current),[]),i.useEffect(()=>{Ds(n,{setCvLink:F,setPhotoUrl:T,setFullName:y,setTitle:K,setYearsExperience:N,setSocialLinks:L,setCurrentStatus:J,setExpectedSalary:oe,setInternetSpeedDownload:ie,setNoticePeriod:xe,setTypingAccuracy:ke,setTypingSpeed:pe,setSkills:ze,setHobbies:ye,setHighlights:Be,setLoading:g})},[n]);const de=Ji({cvLink:$,fullName:D,photoUrl:k,socialLinks:j,title:ee,yearsExperience:q,currentStatus:_,expectedSalary:ce,internetSpeedDownload:ve,noticePeriod:ae,typingAccuracy:fe,typingSpeed:G,skills:Ee,hobbies:Ze,highlights:Fe});i.useEffect(()=>{if(Object.entries({cvLink:$,fullName:D,photoUrl:k,title:ee,yearsExperience:q,currentStatus:_,expectedSalary:ce,internetSpeedDownload:ve,noticePeriod:ae,typingAccuracy:fe,typingSpeed:G,skills:Ee,highlights:Fe}).reduce((_e,[Te,rt])=>(Array.isArray(rt)?rt.length===0&&_e.push(Te):rt==null&&_e.push(Te),_e),[]).length===0){if(Ie&&!We&&(V("ReelCV generated successfully!"),!z&&!f)){E(!0);return}We||M(!0);return}if(!Ie){Ve(!0),g(!0),Ds(n,{setCvLink:F,setPhotoUrl:T,setFullName:y,setTitle:K,setYearsExperience:N,setSocialLinks:()=>{},setCurrentStatus:J,setExpectedSalary:oe,setInternetSpeedDownload:ie,setNoticePeriod:xe,setTypingAccuracy:ke,setTypingSpeed:pe,setSkills:ze,setHighlights:Be,setHobbies:ye,setLoading:g});return}
1d||(We||V("Missing profile data. Try again."),M(!1))},[n,$,D,k,ee,q,_,ce,ve,ae,fe,G,Ee,Fe,Ie,d,We,f,z]);const x=()=>{E(!1),M(!0)},c=async(X,he=50)=>{V("");for(const _e of X)V(Te=>Te+_e),await new Promise(Te=>setTimeout(Te,he));await new Promise(_e=>setTimeout(_e,300))},S=X=>{m(!0),W(0),P(0),V("Initialising AI..."),M(!1),E(!1),Ye(!0);try{ir(Qn,{is_bot:!1,filename:X.name||null,size_bytes:X.size||null})}catch{}const he=qr(),_e=Br(he,`users/${n}/userCV.pdf`),Te=Yr(_e,X),rt=["Extracting CV and Socials data...","Finding and generating skill setâ¦","Calculating years of experienceâ¦","Creating experience informationâ¦","Finding personal detailsâ¦","Creating Hirexe Highlightsâ¦"],st=rt.length,dt=["CV text extracted","Skills identified","Experience calculated","Work history analysed","Personal details found","Profile highlights created"];let xt=0;Te.on("state_changed",ue=>{const ht=Math.round(ue.bytesTransferred/ue.totalBytes*100);te(ht)},ue=>{console.error("PDF upload error:",ue),m(!1),V("Upload failed. Try again."),Xt({type:"User Setup Process",page:"Cv Upload",description:"Upload Failed - Error: "+ue.message})},async()=>{try{await c("Uploading CVâ¦"),P(20);const ue=await Jr(_e);await Zt(Se(Ce(),"users",n,"userData","data"),{userCV:ue},{merge:!0}),F(ue);try{ir(Zn,{is_bot:!1,filename:X.name||null,size_bytes:X.size||null})}catch{}}catch(ue){console.error("Save CV URL error:",ue),Xt({type:"User Setup Process",page:"Cv Upload",description:"Upload Failed - Error: "+ue.message}),m(!1);return}try{Ye(!0);const ue=await ea(n,async({label:ht,isRetry:gt,statusLabel:mt})=>{if(mt.startsWith("â")&&rt.includes(ht)){xt++;const Nt=70/st,u=20+Math.round(xt*Nt);P(Math.min(u,90));const R=dt[xt-1]||"Processing...";V(`â ${R} (${xt}/${st})`)}else mt.startsWith("â")||await c(mt)});T(ue.photoUrl),y(ue.fullName),K(ue.title),N(String(ue.yearsExperience)),J(ue.currentStatus),oe(ue.expectedSalary),ie(ue.internetSpeedDownload),xe(ue.noticePeriod),ke(ue.typingAccuracy),pe(ue.typingSpeed),L(ln(ue.socials)),ze(Array.isArray(ue.skills)?ue.skills:[]),ye(Array.isArray(ue.hobbies)?ue.hobbies:[]),Be(vn(ue.highlightGroups)),g(!1),Ye(!1),V("ReelCV generated successfully!"),P(100),W(100)}catch(ue){console.error("Genkit / fetch error:",ue),V("Oops, something went wrong. Try again?"),Xt({type:"User Setup Process",page:"Cv Upload",description:"Failure: "+ue.message})}finally{m(!1)}})},B=X=>{var _e;const he=(_e=X.target.files)==null?void 0:_e[0];(he==null?void 0:he.type)==="application/pdf"&&(S(he),X.target.value="")},ne=X=>{X.preventDefault();const he=X.dataTransfer.files[0];(he==null?void 0:he.type)==="application/pdf"&&S(he)},re={display:"flex",alignItems:"center",gap:1.5,mb:2.5};return e.jsxs(e.Fragment,{children:[d&&e.jsx(lt,{variant:"fullscreen",text:"Loading..."}),e.jsx("input",{ref:h,type:"file",accept:"application/pdf",hidden:!0,onChange:B}),e.jsx(s,{sx:{position:"fixed",top:{xs:"-100px",sm:"-150px",md:"-200px",lg:"-250px"},left:{xs:"-150px",sm:"-200px",md:"-300px",lg:"-400px"},zIndex:0,pointerEvents:"none",willChange:"transform"},children:e.jsx(Et,{backgroundMode:!0})}),e.jsx(zt,{}),e.jsx(s,{sx:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:0,pointerEvents:"none",backgroundImage:t?"radial-gradient(circle at 1px 1px, rgba(255,255,255,0.04) 1px, transparent 0)":"radial-gradient(circle at 1px 1px, rgba(0,0,0,0.03) 1px, transparent 0)",backgroundSize:"40px 40px"}}),e.jsxs(s,{sx:{position:"relative",zIndex:1,width:"100%",height:"100vh",backgroundColor:"transparent",overflowY:"auto",overflowX:"hidden",...Ae(t)},children:[e.jsx(s,{sx:{maxWidth:"1200px",mx:"auto",px:{xs:2,md:4},pt:3},children:e.jsxs(ft,{sx:{py:2,px:{xs:2,md:3},display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1.5,minWidth:0},children:[e.jsx(s,{sx:{width:36,height:36,minWidth:36,borderRadius:"10px",backgroundColor:t?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.05)",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(Rr,{sx:{color:t?r.white:r.black,fontSize:20}})}),e.jsxs(s,{sx:{minWidth:0},children:[e.jsx(o,{variant:"h5",sx:{fontWeight:600,color:t?r.white:r.black,fontSize:{xs:"1rem",md:"1.25rem"},lineHeight:1.3,whiteSpace:"nowrap"},children:"CV Upload"}),e.jsx(o,{sx:{color:t?r.grey:r.darkGrey,fontSize:"0.8rem",display:{xs:"none",sm:"block"}},children:"Upload your CV to generate your ReelCV"})]})]}),e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(be,{title:"Go back",placement:"bottom",arrow:!0,children:e.jsx(s,{component:"span",sx:{dis
1play:{xs:"inline-flex",sm:"none"}},children:e.jsx(me,{variant:"nav",disabled:b,onClick:()=>l(-1),sx:{width:34,height:34,borderRadius:"8px",bgcolor:t?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.05)",border:`1px solid ${t?"rgba(255,255,255,0.15)":"rgba(0,0,0,0.1)"}`},children:e.jsx(pr,{sx:{fontSize:"1.1rem"}})})})}),e.jsx(be,{title:"Continue",placement:"bottom",arrow:!0,children:e.jsx(s,{component:"span",sx:{display:{xs:"inline-flex",sm:"none"}},children:e.jsx(me,{variant:"filled",disabled:!($&&!b&&z),onClick:()=>{De(!0),ge(!0)},sx:{width:34,height:34,borderRadius:"8px"},children:e.jsx(tr,{sx:{fontSize:"1.1rem"}})})})}),e.jsx(U,{variant:"black",disabled:b,onClick:()=>l(-1),sx:{display:{xs:"none",sm:"inline-flex"},px:3,height:36,fontSize:"0.85rem"},children:"Back"}),e.jsx(U,{variant:"orange",disabled:!($&&!b&&z),onClick:()=>{De(!0),ge(!0)},sx:{display:{xs:"none",sm:"inline-flex"},px:3,height:36,fontSize:"0.85rem"},children:"Continue"}),e.jsx(be,{title:t?"Light mode":"Dark mode",placement:"bottom",arrow:!0,children:e.jsx(me,{variant:"subtle",onClick:a,sx:{width:24,height:24,minWidth:0,padding:0,borderRadius:"6px"},children:t?e.jsx(Vt,{sx:{width:14,height:14}}):e.jsx(er,{sx:{width:14,height:14}})})})]})]})}),e.jsxs(s,{sx:{maxWidth:"1200px",mx:"auto",pt:3,pb:4,px:{xs:2,md:4},display:"flex",flexDirection:"column",gap:3},children:[e.jsxs(Z,{sx:{p:3},children:[e.jsxs(s,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1.5},children:[e.jsx(o,{sx:{fontSize:"0.85rem",fontWeight:500,color:t?r.white:r.black},children:"Profile Completion"}),e.jsxs(o,{sx:{fontSize:"0.85rem",fontWeight:600,color:r.orange},children:[de,"%"]})]}),e.jsx(s,{sx:{width:"100%",height:8,borderRadius:4,backgroundColor:t?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.08)"},children:e.jsx(s,{sx:{width:`${de}%`,height:"100%",borderRadius:4,backgroundColor:r.orange,transition:"width 0.4s ease"}})})]}),e.jsxs(s,{sx:{display:"flex",flexDirection:{xs:"column",lg:"row"},alignItems:{lg:"stretch"},gap:3},children:[e.jsxs(s,{sx:{width:{xs:"100%",lg:"28%"},display:"flex",flexDirection:"column",gap:3},children:[e.jsxs(Z,{sx:{p:3},children:[e.jsxs(s,{sx:re,children:[e.jsx(Tr,{sx:{color:t?r.white:r.black,fontSize:24}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem"},children:"Upload CV"})]}),e.jsx(s,{onDragOver:X=>X.preventDefault(),onDrop:ne,onClick:()=>h.current.click(),sx:{width:"100%",minHeight:"260px",borderRadius:"16px",border:`2px dashed ${$?r.orange:t?"rgba(255,255,255,0.15)":"rgba(0,0,0,0.15)"}`,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:$?t?"rgba(215,122,46,0.08)":"rgba(215,122,46,0.05)":t?"rgba(255,255,255,0.03)":"rgba(0,0,0,0.02)",cursor:"pointer",transition:"all 0.3s ease","&:hover":{borderColor:r.orange,backgroundColor:t?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.04)"},"&:hover svg.upload-icon":{color:r.orange}},children:b?e.jsxs(e.Fragment,{children:[e.jsx(lt,{variant:"inline",sx:{color:r.orange,mb:2}}),e.jsxs(o,{sx:{fontSize:"0.9rem",color:t?r.white:r.black,fontWeight:500},children:["Uploading... ",H,"%"]})]}):$?e.jsxs(e.Fragment,{children:[e.jsx(wn,{sx:{height:60,width:60,color:r.orange,mb:2}}),e.jsx(o,{sx:{fontSize:"0.9rem",color:t?r.white:r.black,fontWeight:500},children:"CV Uploaded Successfully"}),e.jsx(o,{sx:{fontSize:"0.8rem",color:t?r.grey:r.darkGrey,mt:.5},children:"Click to re-upload"})]}):e.jsxs(e.Fragment,{children:[e.jsx(Tr,{className:"upload-icon",sx:{height:60,width:60,color:t?r.grey:r.darkGrey,transition:"color 0.2s ease",mb:2}}),e.jsx(o,{sx:{fontSize:"0.9rem",fontWeight:500,color:t?r.white:r.black},children:"Drop your CV here"}),e.jsx(o,{sx:{fontSize:"0.8rem",color:t?r.grey:r.darkGrey,mt:.5,mb:2},children:"or click to browse (PDF only)"}),e.jsx(U,{variant:"orange",sx:{px:3,fontSize:"0.8rem"},children:"Upload CV"})]})})]}),e.jsxs(Z,{sx:{p:3},children:[e.jsxs(s,{sx:re,children:[e.jsx(Kn,{sx:{color:t?r.white:r.black,fontSize:24}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem"},children:"AI Processing"}),A===100&&e.jsx(Ue,{sx:{color:r.green,fontSize:20,ml:"auto"}})]}),e.jsx(s,{sx:{width:"100%",height:8,borderRadius:4,backgroundColor:t?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.08)",mb:2},children:e.jsx(s,{sx:{width:`${A}%`,height:"100%",borderRadius:4,backgroundColor:A===100?r.green:r.orange,transition:"width 0.4s ease"}})}),e.jsx(s,{sx:{minHeight:24,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(o,{sx:{fontSize:"0.85rem",textAlign:"center",color:A===100?r.green:t?r.grey:r.darkGrey,fontWeight:A===100?500:400},children:!$&&!b?"Waiting for CV...":v})})]}),e.jsxs(Z,{sx:{p:3},children:[e.jsxs(s,{sx:re,children:[e.jsx(Dt,{sx:{color:t?r.white:r.black,fontSize:24}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem"},children:"How It Works"})]}),e.jsx(s,{sx:{display:"flex",flexDirection:"column",gap:1.2},children:Qi.map((X,he)=>
1e.jsxs(s,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[e.jsx(Ue,{sx:{fontSize:"1rem",mt:"2px",color:t?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.35)",flexShrink:0}}),e.jsx(o,{sx:{fontSize:"0.82rem",color:t?"rgba(255,255,255,0.75)":"rgba(0,0,0,0.65)",lineHeight:1.5},children:X.text})]},he))}),e.jsx(s,{sx:{mt:2,pt:2,borderTop:`1px solid ${t?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.06)"}`},children:e.jsx(o,{sx:{fontSize:"0.82rem",color:t?"rgba(255,255,255,0.75)":"rgba(0,0,0,0.65)",lineHeight:1.6},children:Ki({cvLink:$})})})]})]}),e.jsxs(s,{sx:{flex:1,display:"flex",flexDirection:"column",gap:3},children:[e.jsxs(Z,{sx:{p:3,overflow:"hidden",display:"flex",flexDirection:"column"},children:[e.jsxs(s,{sx:re,children:[e.jsx(Rr,{sx:{color:t?r.white:r.black,fontSize:24}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem"},children:"ReelCV Preview"})]}),e.jsx(s,{sx:{borderRadius:"20px",overflow:"hidden",backgroundColor:"transparent",position:"relative",minHeight:"500px",overflowY:"auto",...Ae(t)},children:e.jsx(pn,{initial:!1,mode:"wait",children:f?e.jsx(qe.div,{initial:{opacity:0}
1,animate:{opacity:1,transition:{duration:.3}},exit:{opacity:0,transition:{duration:.3}},style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",flexDirection:"column"},children:e.jsx(Yi,{isDark:t,onComplete:x})},"celebration"):z?e.jsx(qe.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0,transition:{duration:.5}},exit:{opacity:0,transition:{duration:.3}},children:e.jsx(s,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",p:1},children:e.jsx(Gi,{cvLink:$??"",fullName:D??"",photoUrl:k??"",socialLinks:j??{},title:ee??"",yearsExperience:q??"",currentStatus:_??"",expectedSalary:ce??"",internetSpeedDownload:ve??"",noticePeriod:ae??"",typingAccuracy:fe??"",typingSpeed:G??"",skills:Ee??[],hobbies:Ze??[],highlights:Fe??[]})})},"reelcv"):e.jsx(qe.div,{initial:{opacity:1},exit:{opacity:0,transition:{duration:.3}},style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",flexDirection:"column"},children:e.jsxs(s,{sx:{height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[e.jsx(Rr,{sx:{width:{xs:100,md:140},height:{xs:100,md:140},fontSize:{xs:100,md:140},color:t?"rgba(255,255,255,0.12)":"rgba(0,0,0,0.1)",mb:3}}),e.jsx(o,{sx:{fontSize:{xs:"1rem",md:"1.1rem"},fontWeight:600,color:t?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.3)",textAlign:"center",mb:1},children:"Your ReelCV Preview"}),e.jsx(o,{sx:{fontSize:"0.85rem",color:t?"rgba(255,255,255,0.25)":"rgba(0,0,0,0.2)",textAlign:"center"},children:"Upload a CV to generate your preview"})]})},"waiting")})})]}),e.jsx(Z,{sx:{p:3},children:e.jsxs(s,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",gap:{xs:2,sm:0}},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[e.jsx(Sr,{sx:{color:t?r.white:r.black,fontSize:24,flexShrink:0}}),e.jsxs(s,{children:[e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:{xs:"1rem",sm:"1.1rem"},lineHeight:1.3},children:"References"}),e.jsx(o,{sx:{fontSize:{xs:"0.75rem",sm:"0.8rem"},color:t?"rgba(255,255,255,0.55)":"rgba(0,0,0,0.45)",display:"block"},children:"View and manage professional references extracted from your CV"})]})]}),e.jsx(U,{variant:"orange",disabled:!z,onClick:()=>ge(!0),sx:{width:{xs:"100%",sm:"auto"},px:3,fontSize:"0.85rem",whiteSpace:"nowrap"},children:"View References"})]})}),e.jsxs(s,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mt:1},children:[e.jsx(U,{variant:"black",disabled:b,onClick:()=>l(-1),sx:{px:3,height:42},children:"Back"}),e.jsxs(s,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end"},children:[e.jsx(U,{variant:"orange",disabled:!($&&!b&&z),onClick:()=>{De(!0),ge(!0)},sx:{px:3,height:42},children:"Continue"}),je&&e.jsx(o,{color:"error",sx:{mt:1,fontSize:"0.875rem"},children:je})]})]})]})]})]})]}),e.jsx(qi,{open:Je,onClose:()=>{ge(!1),tt&&(De(!1),Ne(""),Xi(n,{cvLink:$,setLoading:g}).then(()=>l("/dashboard/user/background")).catch(X=>{console.error(X);const he=X.message||"Something went wrong";Ne(he),O(he)}))}}),e.jsx(jt,{open:Pe.open,onClose:w,message:Pe.message,severity:Pe.severity})]})}var is={},ta=it;Object.defineProperty(is,"__esModule",{value:!0});var kr=is.default=void 0,ra=ta(ot()),sa=e;kr=is.default=(0,ra.default)((0,sa.jsx)("path",{d:"M7 20h4c0 1.1-.9 2-2 2s-2-.9-2-2m-2-1h8v-2H5zm11.5-9.5c0 3.82-2.66 5.86-3.77 6.5H5.27c-1.11-.64-3.77-2.68-3.77-6.5C1.5 5.36 4.86 2 9 2s7.5 3.36 7.5 7.5m-2 0C14.5 6.47 12.03 4 9 4S3.5 6.47 3.5 9.5c0 2.47 1.49 3.89 2.35 4.5h6.3c.86-.61 2.35-2.03 2.35-4.5m6.87-2.13L20 8l1.37.63L22 10l.63-1.37L24 8l-1.37-.63L22 6zM19 6l.94-2.06L22 3l-2.06-.94L19 0l-.94 2.06L16 3l2.06.94z"}),"TipsAndUpdatesOutlined");const na=["Set the country for each work experience entry","Pick the work type (Remote / Hybrid / On-site / Unknown)","Review the AI-extracted qualifications below","Add anything missing, remove anything that doesn't belong","Click Continue when you're happy"],oa=["We pre-fill country from the company HQ where we can","The 'AI suggested' helper means we guessed â confirm or correct it","Empty qualifications is fine â skip if you don't have formal ones","Use Add to capture informal training (bootcamps, certifications)","You can revisit this page later from your dashboard"];function Ms({uid:n}){const{isDark:t,toggleDarkMode:a}=He(),l=ut(),[h,d]=i.useState(!0),[g,b]=i.useState(!1),[m,p]=i.useState(!1),[C,H]=i.useState([]),[I,A]=i.useState([]),[P,v]=i.useState(""),[V,z]=i.useState({open:!1,message:"",severity:"error"}),M=(F,D="error")=>z({open:!0,message:F,severity:D}),f=()=>z(F=>({...F,open:!1}));i.useEffect(()=>{if(!n){d(!1);return}(async()=>{try{const F=Ce(),D=await Bn(Se(F,"users",n,"userData","data")),y=D.exists()?D.data():{};H(Array.isArray(y.doneGroups)?y.doneGroups:[]),A(Array.isArray(y.qual
1ifications)?y.qualifications:[]),p(!1)}catch(F){console.error("Background fetch failed:",F),p(!0),ct({area:"user_setup",error:F,type:"Background fetch user data failed",severity:"warning",uid:n})}finally{d(!1)}})()},[n]);const E=async()=>{if(!n){M("User not authenticated");return}if(m){const F="We couldn't load your experience and qualifications. Please refresh the page and try again.";v(F),M(F);return}v(""),b(!0);try{const F={};if(Array.isArray(C)&&C.length>0&&(F.doneGroups=C),Array.isArray(I)&&(F.qualifications=I,F.qualificationsEditedAt=ar()),Object.keys(F).length>0){const D=Ce();await Zt(Se(D,"users",n,"userData","data"),F,{merge:!0})}ur(n,"setup_background","Completed background step (experience locations + qualifications)",{doneGroupsCount:(C==null?void 0:C.length)||0,qualificationsCount:(I==null?void 0:I.length)||0},"user"),l("/dashboard/user/achievement")}catch(F){console.error("Background save failed:",F),ct({area:"user_setup",error:F,type:"Background save failed",severity:"error",uid:n});const D=F.message||"Something went wrong";v(D),M(D)}finally{b(!1)}};if(h)return e.jsx(lt,{variant:"fullscreen",text:"Loading your background..."});const $={display:"flex",alignItems:"center",gap:1.5,mb:2};return e.jsxs(e.Fragment,{children:[e.jsx(s,{sx:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:0,pointerEvents:"none"},children:e.jsx(Et,{backgroundMode:!0})}),e.jsx(zt,{}),e.jsx(s,{sx:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:0,pointerEvents:"none",backgroundImage:t?"radial-gradient(circle at 1px 1px, rgba(255,255,255,0.04) 1px, transparent 0)":"radial-gradient(circle at 1px 1px, rgba(0,0,0,0.03) 1px, transparent 0)",backgroundSize:"40px 40px"}}),e.jsxs(s,{sx:{position:"relative",zIndex:1,width:"100%",height:"100vh",backgroundColor:"transparent",overflowY:"auto",overflowX:"hidden",...Ae(t)},children:[e.jsx(s,{sx:{maxWidth:"1200px",mx:"auto",px:{xs:2,md:4},pt:3},children:e.jsxs(ft,{sx:{py:2,px:{xs:2,md:3},display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1.5,minWidth:0},children:[e.jsx(s,{sx:{width:36,height:36,minWidth:36,borderRadius:"10px",backgroundColor:t?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.05)",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(rs,{sx:{color:t?r.white:r.black,fontSize:20}})}),e.jsxs(s,{sx:{minWidth:0},children:[e.jsx(o,{variant:"h5",sx:{fontWeight:600,color:t?r.white:r.black,fontSize:{xs:"1rem",md:"1.25rem"},lineHeight:1.3,whiteSpace:"nowrap"},children:"Your Background"}),e.jsx(o,{sx:{color:t?r.grey:r.darkGrey,fontSize:"0.8rem",display:{xs:"none",sm:"block"}},children:"Review your work experience locations and qualifications"})]})]}),e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(be,{title:"Back",placement:"bottom",arrow:!0,children:e.jsx(me,{variant:"nav",onClick:()=>l("/dashboard/user/cvupload"),sx:{display:{xs:"inline-flex",sm:"none"},width:34,height:34},children:e.jsx(pr,{sx:{fontSize:"1.1rem"}})})}),e.jsx(U,{variant:"black",onClick:()=>l("/dashboard/user/cvupload"),disabled:g,sx:{display:{xs:"none",sm:"inline-flex"},height:36,minHeight:36,fontSize:"0.85rem"},children:"Back"}),e.jsx(be,{title:"Continue",placement:"bottom",arrow:!0,children:e.jsx("span",{style:{display:"inline-flex"},children:e.jsx(me,{variant:"filled",onClick:E,disabled:g,sx:{display:{xs:"inline-flex",sm:"none"},width:34,height:34,"&.Mui-disabled":{bgcolor:t?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)",color:t?"rgba(255,255,255,0.3)":"rgba(0,0,0,0.3)"}},children:e.jsx(tr,{sx:{fontSize:"1.1rem"}})})})}),e.jsx(U,{variant:"orange",onClick:E,disabled:g,sx:{display:{xs:"none",sm:"inline-flex"},height:36,minHeight:36,fontSize:"0.85rem"},children:"Continue"}),e.jsx(be,{title:t?"Light mode":"Dark mode",placement:"bottom",arrow:!0,children:e.jsx(me,{variant:"subtle",onClick:a,sx:{width:24,height:24,minWidth:0,padding:0,borderRadius:"6px"},children:t?e.jsx(Vt,{sx:{width:14,height:14}}):e.jsx(er,{sx:{width:14,height:14}})})})]})]})}),e.jsxs(s,{sx:{maxWidth:"1200px",mx:"auto",pt:3,pb:4,px:{xs:2,md:4},display:"flex",flexDirection:{xs:"column",lg:"row"},gap:3},children:[e.jsxs(s,{sx:{width:{xs:"100%",lg:"32%"},display:"flex",flexDirection:"column",gap:3},children:[e.jsxs(Z,{sx:{p:3},children:[e.jsxs(s,{sx:$,children:[e.jsx(Dt,{sx:{color:t?r.white:r.black,fontSize:24}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem"},children:"How To"})]}),e.jsx(s,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:na.map((F,D)=>e.jsxs(s,{sx:{display:"flex",gap:1,alignItems:"flex-start"},children:[e.jsx(s,{sx:{minWidth:18,height:18,borderRadius:"50%",backgroundColor:r.orange,color:r.white,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.7rem",fontWeight:700,mt:.25},children:D+1}),e.jsx(o,{sx:{fontSize:"0.85rem",color:t?r.offWhite:r.darkGrey,lineHeight:1.5},children:F})]},D))})]}),e.jsxs(Z,{sx:{p:3},children:[e.jsxs(s,{sx:$,children:[e.jsx(kr,{sx:{color:r.orange,fontSize:24}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem"},children:"Tips"})]}),e.jsx(s,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:oa.map((F,D)=>e.jsxs(s,{sx:{display:"flex",gap:1,alignItems:"flex-start"},children:[e.jsx(s,{sx:{minWidth:6,height:6,borderRadius:"50%",backgroundColor:r.orange,mt:.85}}),e.jsx(o,{sx:{fontSize:"0.85rem",color:t?r.offWhite:r.darkGrey,lineHeight:1.5},children:F})]},D))})]})]}),e.jsxs(s,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:3},children:[e.jsx(sn,{doneGroups:C,onChange:H}),e.jsx(xo,{qualifications:I,onChange:A}),e.jsxs(s,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mt:1},children:[e.jsx(U,{variant:"black",onClick:()=>l("/dashboard/user/cvupload"),disabled:g,sx:{px:3,height:42},children:"Back"}),e.jsxs(s,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end"},children:[e.jsx(U,{variant:"orange",onClick:E,disabled:g,sx:{px:3,height:42},children:"Continue"}),P&&e.jsx(o,{sx:{mt:1,fontSize:"0.875rem",color:r.red},children:P})]})]})]})]})]}),e.jsx(jt,{open:V.open,onClose:f,message:V.message,severity:V.severity})]})}const ia=new Set(["About Me is required","Add at least one hobby","No more than 5 hobbies are allowed","Future is required","Future must be at least 400 characters","Future must be no more than 800 characters","Phone number is required","Address is required"]);let kn={};function aa(){return kn}const la=({aboutMe:n,hobbies:t,future:a})=>{const l=[n,t,a],h=l.filter(p=>p!=null&&p!==""&&!(typeof p=="string"&&p.toLowerCase()==="none"&&p.toLowerCase()==="null")).length,d=75,g=85,b=h/l.length;return Math.round(d+(g-d)*b)};async function ca(n,{setAboutMe:t,setHobbies:a,setFuture:l,setPhone:h,setAddress:d,setPhonePrefilled:g,setAddressPrefilled:b,setLoading:m}){if(!n){console.warn("fetchUserDetails: no uid"),m(!1);return}m(!0);try{const p=Ce(),C=Se(p,"users",n,"userData","data"),H=await Qe(C);let I="",A=[],P="",v="",V="";if(H.exists()){const z=H.data(),M=z.aboutMe??"";
1if(I=M==="null"?"":M,t(I),Array.isArray(z.hobbies))A=z.hobbies;else if(typeof z.hobbies=="string")try{const E=JSON.parse(z.hobbies);A=Array.isArray(E)?E:[]}catch{A=[]}a(A);const f=z.myFuture??"";P=f==="null"?"":f,l(P),v=String(z.phone??""),V=String(z.address??""),typeof h=="function"&&h(v),typeof d=="function"&&d(V),typeof g=="function"&&g(!!v.trim()),typeof b=="function"&&b(!!V.trim())}else t(""),a([]),l(""),typeof h=="function"&&h(""),typeof d=="function"&&d(""),typeof g=="function"&&g(!1),typeof b=="function"&&b(!1);kn={aboutMe:I,hobbies:A,future:P,phone:v,address:V}}catch(p){console.error("fetchUserDetails error:",p),ct({area:"user_setup",error:p,type:"personalDetails fetchUserDetails failed",severity:"warning",uid:n})}finally{m(!1)}}async function da(n,{setHobbies:t}){if(!n){console.warn("fetchUserHobbies: no uid");return}try{const a=Ce(),l=Se(a,"users",n,"userData","data"),h=await Qe(l);let d=[];if(h.exists()){const g=h.data();if(Array.isArray(g.hobbies))d=g.hobbies;else if(typeof g.hobbies=="string")try{const b=JSON.parse(g.hobbies);d=Array.isArray(b)?b:[]}catch{d=[]}t(d)}else t([])}catch(a){console.error("fetchUserHobbies error:",a),ct({area:"user_setup",error:a,type:"personalDetails fetchUserHobbies failed",severity:"warning",uid:n})}}async function xa(n,{aboutMe:t,hobbies:a,future:l,phone:h,address:d,setLoading:g}){if(!n){console.warn("handleContinue: no uid"),g(!1);return}g(!0);try{if(!(t!=null&&t.trim()))throw new Error("About Me is required");if(!Array.isArray(a)||a.length===0)throw new Error("Add at least one hobby");if(a.length>5)throw new Error("No more than 5 hobbies are allowed");if(a.forEach((v,V)=>{if(typeof v!="string"||!v.trim())throw new Error(`Hobby #${V+1} is invalid`)}),!(l!=null&&l.trim()))throw new Error("Future is required");const b=l.trim().length;if(b<400)throw new Error("Future must be at least 400 characters");if(b>800)throw new Error("Future must be no more than 800 characters");if(typeof h!="string"||!h.trim())throw new Error("Phone number is required");if(typeof d!="string"||!d.trim())throw new Error("Address is required");const m=aa(),p={},C=t.trim();C!==m.aboutMe&&(p.aboutMe=C),JSON.stringify(a)!==JSON.stringify(m.hobbies)&&(p.hobbies=a);const H=l.trim();H!==m.future&&(p.myFuture=H);const I=typeof h=="string"?h.trim():"",A=typeof d=="string"?d.trim():"";I!==(m.phone??"")&&(p.phone=I),A!==(m.address??"")&&(p.address=A),Object.keys(p).length===0&&console.log("handleContinue: no changes detected");const P=Ce();await Zt(Se(P,"users",n,"userData","data"),p,{merge:!0}),ur(n,"setup_personal_details","Completed personal details page",{hasAboutMe:!!t,hobbyCount:a==null?void 0:a.length,hasMyFuture:!!l},"user")}catch(b){throw console.error("handleContinue error:",b),ia.has(b==null?void 0:b.message)||ct({area:"user_setup",error:b,type:"personalDetails handleContinue save failed",severity:"error",uid:n}),b}finally{g(!1)}}function pa({aboutMe:n,hobbies:t,future:a,phone:l,address:h}){const d=[];return n!=null&&n.trim()||d.push("⢠About Me information is required."),t!=null&&t.length||d.push("⢠At least 3 hobbies are required."),a!=null&&a.trim()||d.push("⢠My Future information is required."),l!=null&&l.trim()||d.push("⢠Phone number is required."),h!=null&&h.trim()||d.push("⢠Address is required."),d.length?e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:"Missing:"}),e.jsx("br",{}),d.map((g,b)=>e.jsxs(Gr.Fragment,{children:[g,e.jsx("br",{})]},b))]}):e.jsx(e.Fragment,{children:"All setânothingâs missing!"})}const ua=["Write a personal bio in the About Me section (400â800 characters)","Add 3â5 personal hobbies using the tag input","Describe your future goals in the My Future section (400â800 characters)","Include personal details, not just professional goals","Click Continue once all fields are completed"],ha=["Share what you enjoy doing on weekends or in your free time","Mention hobbies that show your personality and interests","For My Future, think about where you see yourself in 6 weeks, 6 months, and 6 years","Be authentic â companies value genuine personal insights"];function Fs({uid:n}){const{isDark:t,toggleDarkMode:a}=He(),l=ut(),[h,d]=i.useState(!0),[g,b]=i.useState(""),[m,p]=i.useState([]),[C,H]=i.useState(null),[I,A]=i.useState(""),[P,v]=i.useState(""),[V,z]=i.useState(!1),[M,f]=i.useState(!1),[E,$]=i.useState(!1),[F,D]=i.useState(""),[y,k]=i.useState(""),[T,j]=i.useState(!1),[L,ee]=i.useState({open:!1,message:"",severity:"error"}),K=(G,pe="error")=>ee({open:!0,message:G,severity:pe}),q=()=>ee(G=>({...G,open:!1})),N=(C==null?void 0:C.length)??0,_=(g==null?void 0:g.length)??0,J=()=>{const G=F.trim();G&&(p(pe=>[...pe,G]),D(""),$(!1))};i.useEffect(()=>{ca(n,{setAboutMe:b,setHobbies:p,setFuture:H,setPhone:A,setAddress:v,setPhonePrefilled:z,setAddressPrefilled:f,setLoading:d})},[n]),i.useEffect(()=>{da(n,{setHobbies:p}),j(!1)},[n,T]);const ce=la({aboutMe:g,hobbies:m,future:C}),oe=Math.round((ce-75)/10*100),ve=g&&C&&Array.isArray(m)&&m.length>=3&&m.length<=5&&_>=400&&_<=800&&N>=400&&N<=800&&!!(I!=null&&I.trim())&&!!(P!=null&&P.trim()),ie=()=>{k(""),xa(n,{aboutMe:g,hobbies:m,future:C,phone:I,address:P,setLoading:d}).then(()=>l("/dashboard/user/check")).catch(G=>{j(!0),console.error(G);const pe=G.message||"Something went wrong";k(pe),K(pe)})},ae=G=>{A(G),V&&z(!1)},xe=G=>{v(G),M&&f(!1)},fe={display:"flex",alignItems:"center",gap:1.5,mb:2.5},ke={mb:1,fontSize:"0.85rem",fontWeight:500,color:t?r.grey:r.darkGrey};return e.jsxs(e.Fragment,{children:[h&&e.jsx(lt,{variant:"fullscreen",text:"Loading..."}),e.jsx(s,{sx:{position:"fixed",top:{xs:"-100px",sm:"-150px",md:"-200px",lg:"-250px"}
1,left:{xs:"-150px",sm:"-200px",md:"-300px",lg:"-400px"},zIndex:0,pointerEvents:"none",willChange:"transform"},children:e.jsx(Et,{backgroundMode:!0})}),e.jsx(zt,{}),e.jsx(s,{sx:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:0,pointerEvents:"none",backgroundImage:t?"radial-gradient(circle at 1px 1px, rgba(255,255,255,0.04) 1px, transparent 0)":"radial-gradient(circle at 1px 1px, rgba(0,0,0,0.03) 1px, transparent 0)",backgroundSize:"40px 40px"}}),e.jsxs(s,{sx:{position:"relative",zIndex:1,width:"100%",height:"100vh",backgroundColor:"transparent",overflowY:"auto",overflowX:"hidden",...Ae(t)},children:[e.jsx(s,{sx:{maxWidth:"1200px",mx:"auto",px:{xs:2,md:4},pt:3},children:e.jsxs(ft,{sx:{py:2,px:{xs:2,md:3},display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1.5,minWidth:0},children:[e.jsx(s,{sx:{width:36,height:36,minWidth:36,borderRadius:"10px",backgroundColor:t?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.05)",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(pt,{sx:{color:t?r.white:r.black,fontSize:20}})}),e.jsxs(s,{sx:{minWidth:0},children:[e.jsx(o,{variant:"h5",sx:{fontWeight:600,color:t?r.white:r.black,fontSize:{xs:"1rem",md:"1.25rem"},lineHeight:1.3,whiteSpace:"nowrap"},children:"Personal Details"}),e.jsx(o,{sx:{color:t?r.grey:r.darkGrey,fontSize:"0.8rem",display:{xs:"none",sm:"block"}},children:"Tell us more about who you are"})]})]}),e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(be,{title:"Back",placement:"bottom",arrow:!0,children:e.jsx(me,{variant:"nav",onClick:()=>l(-1),sx:{display:{xs:"inline-flex",sm:"none"},width:34,height:34},children:e.jsx(pr,{sx:{fontSize:"1.1rem"}})})}),e.jsx(U,{variant:"black",onClick:()=>l(-1),sx:{display:{xs:"none",sm:"inline-flex"},height:36,minHeight:36,fontSize:"0.85rem"},children:"Back"}),e.jsx(be,{title:"Continue",placement:"bottom",arrow:!0,children:e.jsx("span",{style:{display:"inline-flex"},children:e.jsx(me,{variant:"filled",disabled:!ve,onClick:ie,sx:{display:{xs:"inline-flex",sm:"none"},width:34,height:34,"&.Mui-disabled":{bgcolor:t?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)",color:t?"rgba(255,255,255,0.3)":"rgba(0,0,0,0.3)"}},children:e.jsx(tr,{sx:{fontSize:"1.1rem"}})})})}),e.jsx(U,{variant:"orange",disabled:!ve,onClick:ie,sx:{display:{xs:"none",sm:"inline-flex"},height:36,minHeight:36,fontSize:"0.85rem"},children:"Continue"}),e.jsx(be,{title:t?"Light mode":"Dark mode",placement:"bottom",arrow:!0,children:e.jsx(me,{variant:"subtle",onClick:a,sx:{width:24,height:24,minWidth:0,padding:0,borderRadius:"6px"},children:t?e.jsx(Vt,{sx:{width:14,height:14}}):e.jsx(er,{sx:{width:14,height:14}})})})]})]})}),e.jsxs(s,{sx:{maxWidth:"1200px",mx:"auto",pt:3,pb:4,px:{xs:2,md:4},display:"flex",flexDirection:"column",gap:3},children:[e.jsxs(Z,{sx:{p:3},children:[e.jsxs(s,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1.5},children:[e.jsx(o,{sx:{fontSize:"0.85rem",fontWeight:500,color:t?r.white:r.black},children:"Required Information"}),e.jsxs(o,{sx:{fontSize:"0.85rem",fontWeight:600,color:r.orange},children:[oe,"%"]})]}),e.jsx(s,{sx:{width:"100%",height:8,borderRadius:4,backgroundColor:t?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.08)"},children:e.jsx(s,{sx:{width:`${oe}%`,height:"100%",borderRadius:4,backgroundColor:r.orange,transition:"width 0.4s ease"}})})]}),e.jsxs(s,{sx:{display:"flex",flexDirection:{xs:"column",lg:"row"},gap:3},children:[e.jsxs(s,{sx:{width:{xs:"100%",lg:"32%"},display:"flex",flexDirection:"column",gap:3},children:[e.jsxs(Z,{sx:{p:3},children:[e.jsxs(s,{sx:fe,children:[e.jsx(Dt,{sx:{color:t?r.white:r.black,fontSize:24}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem"},children:"How To"})]}),e.jsx(s,{sx:{display:"flex",flexDirection:"column",gap:1.2},children:ua.map((G,pe)=>e.jsxs(s,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[e.jsx(Ue,{sx:{fontSize:"1rem",mt:"2px",color:t?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.35)",flexShrink:0}}),e.jsx(o,{sx:{fontSize:"0.82rem",color:t?"rgba(255,255,255,0.75)":"rgba(0,0,0,0.65)",lineHeight:1.5},children:G})]},pe))}),e.jsx(s,{sx:{mt:2,pt:2,borderTop:`1px solid ${t?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.06)"}`},children:e.jsx(o,{sx:{fontSize:"0.82rem",color:t?"rgba(255,255,255,0.75)":"rgba(0,0,0,0.65)",lineHeight:1.6},children:pa({aboutMe:g,hobbies:m,future:C,phone:I,address:P})})})]}),e.jsxs(Z,{sx:{p:3},children:[e.jsxs(s,{sx:fe,children:[e.jsx(kr,{sx:{color:t?r.white:r.black,fontSize:24}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem"},children:"Tips"})]}),e.jsx(s,{sx:{display:"flex",flexDirection:"column",gap:1.2},children:ha.map((G,pe)=>
1e.jsxs(s,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[e.jsx(Ue,{sx:{fontSize:"1rem",mt:"2px",color:t?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.35)",flexShrink:0}}),e.jsx(o,{sx:{fontSize:"0.82rem",color:t?"rgba(255,255,255,0.75)":"rgba(0,0,0,0.65)",lineHeight:1.5},children:G})]},pe))})]})]}),e.jsxs(s,{sx:{flex:1,display:"flex",flexDirection:"column",gap:3},children:[e.jsxs(Z,{sx:{p:3},children:[e.jsxs(s,{sx:fe,children:[e.jsx(pt,{sx:{color:t?r.white:r.black,fontSize:24}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem"},children:"About Me"})]}),e.jsx(o,{sx:ke,children:"Tell us more about yourself â what do you enjoy doing on the weekends?"}),e.jsx(Q,{fullWidth:!0,value:g,onChange:G=>b(G.target.value.slice(0,800)),placeholder:"Share personal details about yourself, your interests, and what makes you unique...",multiline:!0,rows:5,inputProps:{minLength:400,maxLength:800},InputProps:{sx:{"& textarea":{...Ae(t)}}}}),e.jsx(o,{variant:"caption",sx:{mt:1,display:"block",fontSize:"0.78rem",color:_<400?"#ef4444":t?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.35)"},children:_<400?`${_}/400 characters (minimum required)`:`${_}/800 characters`})]}),e.jsxs(Z,{sx:{p:3},children:[e.jsxs(s,{sx:fe,children:[e.jsx(pt,{sx:{color:t?r.white:r.black,fontSize:24}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem"},children:"Personal Hobbies"})]}),e.jsx(o,{sx:ke,children:"Add 3â5 hobbies that reflect your personality and interests"}),e.jsxs(s,{sx:{display:"flex",flexWrap:"wrap",gap:1,mb:1.5},children:[(Array.isArray(m)?m:[]).map((G,pe)=>e.jsxs(s,{sx:{display:"inline-flex",alignItems:"center",height:"36px",bgcolor:t?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.06)",color:t?r.white:r.black,px:1.5,borderRadius:"10px",border:`1px solid ${t?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.08)"}`,transition:"all 0.2s ease","&:hover":{borderColor:r.orange,bgcolor:t?"rgba(215,122,46,0.15)":"rgba(215,122,46,0.08)"},"&:hover .deleteIcon":{opacity:1,color:r.orange}},children:[e.jsx(o,{sx:{fontSize:"0.85rem",lineHeight:1,fontWeight:500},children:G}),e.jsx(xr,{className:"deleteIcon",onClick:()=>p((Array.isArray(m)?m:[]).filter((Ee,ze)=>ze!==pe)),sx:{width:14,height:14,ml:1,cursor:"pointer",color:t?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.35)",opacity:.7,transition:"color 0.2s, opacity 0.2s"}})]},pe)),m.length<5&&(E?e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx("input",{type:"text",value:F,onChange:G=>{const pe=G.target.value;pe.length<=12&&D(pe)},placeholder:"New hobby",style:{backgroundColor:t?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.06)",color:t?r.white:r.black,fontSize:"0.85rem",border:`1px solid ${t?"rgba(255,255,255,0.15)":"rgba(0,0,0,0.12)"}`,borderRadius:"10px",height:"36px",width:"120px",padding:"0 12px",outline:"none"},onBlur:()=>J(),onKeyDown:G=>{G.key==="Enter"&&(G.preventDefault(),J())}}),e.jsx(s,{onClick:()=>J(),sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"30px",height:"30px",borderRadius:"8px",cursor:"pointer",color:t?"rgba(255,255,255,0.5)":"rgba(0,0,0,0.4)","&:hover":{color:r.orange}},children:e.jsx(Mr,{sx:{height:18,width:18}})})]}):e.jsx(s,{onClick:()=>$(!0),sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",height:"36px",width:"36px",borderRadius:"10px",border:`1px dashed ${t?"rgba(255,255,255,0.15)":"rgba(0,0,0,0.15)"}`,cursor:"pointer",color:t?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.35)",transition:"all 0.2s ease","&:hover":{borderColor:r.orange,color:r.orange}},children:e.jsx(Mr,{sx:{height:18,width:18}})}))]}),e.jsx(o,{variant:"caption",sx:{fontSize:"0.78rem",color:m.length<3||m.length>5?"#ef4444":t?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.35)"},children:m.length<3?`${m.length}/3 hobbies (minimum required)`:`${m.length}/5 hobbies`})]}),e.jsxs(Z,{sx:{p:3},children:[e.jsxs(s,{sx:fe,children:[e.jsx(pt,{sx:{color:t?r.white:r.black,fontSize:24}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem"},children:"My Future"})]}),e.jsx(o,{sx:ke,children:"Where do you see yourself 6 weeks, 6 months, and 6 years from now? Why?"}),e.jsx(Q,{fullWidth:!0,value:C,onChange:G=>H(G.target.value.slice(0,800)),placeholder:"Describe your short-term and long-term goals, both personal and professional...",multiline:!0,rows:5,inputProps:{maxLength:800,inputMode:"text"},InputProps:{sx:{"& textarea":{...Ae(t)}}}}),e.jsx(o,{variant:"caption",sx:{mt:1,display:"block",fontSize:"0.78rem",color:N<400?"#ef4444":t?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.35)"},children:N<400?`${N}/400 characters (minimum required)`:`${N}/800 characters`})]}),e.jsxs(Z,{sx:{p:3},children:[e.jsxs(s,{sx:fe,children:[e.jsx(pt,{sx:{color:t?r.white:r.black,fontSize:24}}),e.jsxs(s,{sx:{minWidth:0},children:[e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem",lineHeight:1.3},children:"Contact details"}),e.jsx(o,{sx:{fontSize:{xs:"0.75rem",sm:"0.8rem"},color:t?r.offWhite:r.darkGrey},children:"Required. Used by our team to contact you â never shown on your public ReelCV."})]})]}),e.jsxs(s,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsxs(s,{children:[e.jsx(Q,{fullWidth:!0,title:"Phone *",type:"tel",value:I,onChange:G=>ae(G.target.value),placeholder:"e.g. +27 82 123 4567",inputProps:{inputMode:"tel",autoComplete:"tel"}}),I!=null&&I.trim()?V&&e.jsx(o,{sx:{mt:.5,fontSize:"0.72rem",color:t?r.offWhite:r.darkGrey,lineHeight:1.3},children:"Prefilled from your CV â please confirm"}):e.jsx(o,{sx:{mt:.5,fontSize:"0.72rem",color:"#ef4444",lineHeight:1.3},children:"Required"})]}),e.jsxs(s,{children:[e.jsx(Q,{fullWidth:!0,title:"Address *",value:P,onChange:G=>xe(G.target.value),placeholder:"e.g. 1 Long St, Cape Town, South Africa",multiline:!0,rows:2,inputProps:{autoComplete:"street-address"},InputProps:{sx:{"& textarea":{...Ae(t)}}}}),P!=null&&P.trim()?M&&e.jsx(o,{sx:{mt:.5,fontSize:"0.72rem",color:t?r.offWhite:r.darkGrey,lineHeight:1.3},children:"Prefilled from your CV â please confirm"}):e.jsx(o,{sx:{mt:.5,fontSize:"0.72rem",color:"#ef4444",lineHeight:1.3},children:"Required"})]})]})]}),e.jsxs(s,{sx:{mt:1},children:[y&&e.jsx(s,{sx:{width:"100%",mb:2,p:1.5,border:`1px solid ${t?"rgba(255,255,255,0.15)":r.orange}`,borderRadius:"12px",backgroundColor:t?"rgba(255,255,255,0.05)":"#FFECEC"},children:e.jsx(o,{color:"error",sx:{fontSize:"0.875rem",textAlign:"center",color:t?r.orange:void 0},children:y})}),e.jsx(s,{sx:{display:"flex",justifyContent:"flex-end"},children:e.jsx(U,{variant:"orange",disabled:!ve,onMouseDown:G=>G.preventDefault(),onClick:ie,sx:{px:3,py:1.5,borderRadius:"12px"},children:"Continue"})})]})]})]})]})]}),e.jsx(jt,{open:L.open,onClose:q,message:L.message,severity:L.severity})]})}var as={},fa=it;Object.defineProperty(as,"__esModule",{value:!0});var jr=as.default=void 0,ga=fa(ot()),ma=e;jr=as.default=(0,ga.default)((0,ma.jsx)("path",{d:"M19.35 10.04C18.67 6.59
115.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95C8.08 7.14 9.94 6 12 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11c1.56.1 2.78 1.41 2.78 2.96 0 1.65-1.35 3-3 3M8 13h2.55v3h2.9v-3H16l-4-4z"}),"CloudUploadOutlined");const _s=new Set;function ba({uid:n,isDark:t,videoUrl:a,setVideoUrl:l,setVideoUploading:h,setUploadProgress:d,setUploadStatusMessage:g,setLoading:b,onSwitchToCapture:m,showSnackbar:p,changeVideoRef:C}){const H=i.useRef(),[I,A]=i.useState(!1);C&&(C.current=()=>{var f;return(f=H.current)==null?void 0:f.click()});const P=f=>{A(f),h(f)},v=f=>new Promise((E,$)=>{if(f.size>209715200){$(new Error("File size must be less than 200 MB"));return}const D=URL.createObjectURL(f),y=document.createElement("video");y.preload="metadata",y.src=D,y.onloadedmetadata=()=>{URL.revokeObjectURL(D);const k=y.duration;if(k<30){$(new Error("Video must be at least 30 seconds"));return}if(k>120){$(new Error("Video must be 2 minutes or less"));return}const T=y.videoWidth,j=y.videoHeight,L=T/j;if(T<j){$(new Error("Video must be in landscape orientation"));return}if(Math.abs(L-16/9)>.01){$(new Error("Aspect ratio must be ~16â¶9 (e.g., 1280Ã720)"));return}E()},y.onerror=()=>{URL.revokeObjectURL(D),$(new Error("Could not load video metadata"))}}),V=async f=>{if(!n){console.warn("performUpload: Missing UID");return}const{currentUser:E}=wr();if(!E)throw new Error("User not authenticated");const $=await E.getIdToken(!0),F=qr(),D=Br(F,`users/${n}/proudestProfessionalAchievement_temp`);P(!0),d(0),g("Uploading video...");try{ir(eo,{is_bot:!1,filename:f.name||null,size_bytes:f.size||null,content_type:f.type||null})}catch{}try{const y={contentType:f.type,customMetadata:{originalName:f.name,uploadedAt:new Date().toISOString(),fileSize:f.size.toString()}};await new Promise((j,L)=>{const ee=Yr(D,f,y);let K=Date.now(),q=0;ee.on("state_changed",_=>{const J=Math.round(_.bytesTransferred/_.totalBytes*50);d(J),_.bytesTransferred>q&&(K=Date.now(),q=_.bytesTransferred),J%10===0&&console.log(`Upload progress: ${J}% (${_.bytesTransferred}/${_.totalBytes} bytes)`)},_=>{console.error("Upload error:",_),console.error("Error code:",_.code),console.error("Error message:",_.message),_.code==="storage/retry-limit-exceeded"?g("Upload timed out. Please check your internet connection and try again."):_.code==="storage/canceled"?g("Upload was canceled."):_.code==="storage/unknown"?g("Upload failed due to network error. Please try again."):g("Upload failed. Please try again."),L(_)},()=>{console.log("Upload completed successfully"),d(50),j()});const N=setInterval(()=>{Date.now()-K>6e4&&console.warn("Upload appears stalled, but Firebase will handle retries automatically")},1e4);ee.then(()=>clearInterval(N)).catch(()=>clearInterval(N))}),g("Video uploaded! Queuing background processing...");const k=Ce();await Xr(Kr(k,"queue"),{mode:"API",uid:n,bearer:$,method:"POST",source:"api/admin/video/conversion",status:"pending",createdAt:ar(),metadata:{videoType:"proudestProfessionalAchievement"}}),console.log("Video processing queued successfully"),d(75),g("Finalizingâ¦");const T=await Jr(D);l(T),d(100),g("Upload complete! Processing will continue in the background."),p==null||p("Upload complete! Processing will continue in the background.","success");try{ir(to,{is_bot:!1,filename:f.name||null,size_bytes:f.size||null})}catch{}}catch(y){console.error("performUpload error:",y);try{ir(ro,{is_bot:!1,filename:(f==null?void 0:f.name)||null,size_bytes:(f==null?void 0:f.size)||null,error_message:(y==null?void 0:y.message)||"unknown",error_code:(y==null?void 0:y.code)||null})}catch{}let k="Upload failed. Please try again.",T=y.message;const j=navigator.connection||navigator.mozConnection||navigator.webkitConnection;j&&(T+=` 2Connection Type: ${j.effectiveType||"unknown"}`,T+=` 3Downlink: ${j.downlink||"unknown"} Mbps`,T+=` 4RTT: ${j.rtt||"unknown"} ms`),T+=` 5Online: ${navigator.onLine}`,T+=` 6File size: ${(f.size/(1024*1024)).toFixed(2)} MB`,y.code==="storage/retry-limit-exceeded"?k=`Upload timed out due to slow or unstable connection. Please: 71. Check your internet connection 82. Try uploading a smaller/compressed video 93. Move closer to your WiFi router 104. Try again during off-peak hours`:y.message.includes("ConversionFailed")?(k="Video conversion failed. Please check your video format and try again.",y.lastResponse&&(T+=` 11Last HTTP Status: ${y.lastResponse.status} ${y.lastResponse.statusText}`),y.lastError&&(T+=` 12Last Error: ${y.lastError.message}`),y.attempts&&(T+=` 13Attempts made: ${y.attempts}`)):y.message.includes("TranscriptionFailed")?k="Video transcription failed. Please try again.":y.message.includes("File size must be less than")||y.message.includes("Video must be")?k=y.message:y.message.includes("User not authenticated")?k="Authentication failed. Please refresh and try again.":y.code==="storage/unknown"?k="Network error during upload. Please check your connection and try again.":y.code==="storage/canceled"&&(k="Upload was canceled."),g(k),p==null||p(k,"error"),d(0);try{await Zs(D),console.log("Successfully deleted temporary file")}catch(ee){console.warn("Failed to delete blob:",ee)}try{const ee=Ce(),K=Se(ee,"users",n,"userData","data");await dr(K,{"videoUrl.proudestProfessionalAchievement":mr(),"videoUrl.url":mr()}),console.log("Successfully cleared Firestore URL fields")}catch(ee){console.warn("Failed to clear Firestore URL fields:",ee)}const L=`Video Upload Error|${n}`;if(!_s.has(L)){_s.add(L);try{await vr({type:"Video Upload Error",page:`Video Upload - User (UID: ${n})`,description:`${T} 14Stack trace: 15${y.stack}`})}catch(ee){console.error("Failed to send Slack error:",ee)}}}finally{P(!1)}},z=f=>{var $;const E=($=f.target.files)==null?void 0:$[0];E&&(v(E).then(()=>V(E)).catch(F=>{console.error("File validation error:",F),g(F.message),p==null||p(F.message,"error")}),f.target.value="")},M=f=>{f.preventDefault();const E=f.dataTransfer.files[0];E&&v(E).then(()=>V(E)).catch($=>{console.error("File validation error:",$),g($.message),p==null||p($.message,"error")})};return e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"file",accept:"video/*",style:{display:"none"},ref:H,onChange:z}),e.jsx(s,{onDragOver:f=>f.preventDefault(),onDrop:M,onClick:()=>{var f;return!a&&!I&&((f=H.current)==null?void 0:f.click())},sx:{width:"100%",aspectRatio:"16 / 9",borderRadius:"12px",overflow:"hidden",border:a?`1px solid ${t?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.08)"}`:`2px dashed ${t?"rgba(255,255,255,0.2)":"rgba(0,0,0,0.15)"}`,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:t?r.offBlack:"#e5e5e5",position:"relative",curs
15or:!a&&!I?"pointer":"default",transition:"border-color 0.2s ease",...!a&&!I&&{"&:hover":{borderColor:r.orange}}},children:a?e.jsx(hn,{url:a,playing:!1,controls:!0,width:"100%",height:"100%",style:{position:"absolute",top:0,left:0},config:{file:{attributes:{style:{objectFit:"cover",width:"100%",height:"100%"}}}}}):e.jsxs(e.Fragment,{children:[e.jsx(Tr,{sx:{fontSize:{xs:40,md:64},color:t?"rgba(255,255,255,0.3)":"rgba(0,0,0,0.25)"}}),!I&&e.jsxs(e.Fragment,{children:[e.jsx(o,{sx:{fontSize:{xs:"0.8rem",sm:"0.85rem"},color:t?"rgba(255,255,255,0.5)":"rgba(0,0,0,0.45)",mt:1.5,textAlign:"center",px:2},children:"Drop your video here or click to upload"}),e.jsx(U,{variant:"black",onClick:f=>{var E;f.stopPropagation(),(E=H.current)==null||E.click()},sx:{mt:1.5,px:3,fontSize:"0.8rem"},children:"Choose File"})]}),I&&e.jsx(o,{sx:{fontSize:"0.85rem",color:t?"rgba(255,255,255,0.5)":"rgba(0,0,0,0.45)",mt:1.5},children:"Uploadingâ¦"})]})}),e.jsx(s,{sx:{mt:1}}),e.jsx(s,{sx:{display:"flex",justifyContent:"center"},children:e.jsx(o,{sx:{fontSize:"0.75rem",color:t?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.35)"},children:"Max 200 MB · 30sâ2min · Landscape 16:9"})})]})}var ls={},ya=it;Object.defineProperty(ls,"__esModule",{value:!0});var Cn=ls.default=void 0,ja=ya(ot()),Os=e;Cn=ls.default=(0,ja.default)([(0,Os.jsx)("path",{d:"M9 12c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3"},"0"),(0,Os.jsx)("path",{d:"M8 10V8H5.09C6.47 5.61 9.05 4 12 4c3.72 0 6.85 2.56 7.74 6h2.06c-.93-4.56-4.96-8-9.8-8-3.27 0-6.18 1.58-8 4.01V4H2v6zm8 4v2h2.91c-1.38 2.39-3.96 4-6.91 4-3.72 0-6.85-2.56-7.74-6H2.2c.93 4.56 4.96 8 9.8 8 3.27 0 6.18-1.58 8-4.01V20h2v-6z"},"1")],"FlipCameraAndroid");var cs={},wa=it;Object.defineProperty(cs,"__esModule",{value:!0});var Rn=cs.default=void 0,Sa=wa(ot()),va=e;Rn=cs.default=(0,Sa.default)((0,va.jsx)("path",{d:"M15 21h2v-2h-2zm4-12h2V7h-2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2zm8-6h2v-2h-2zM15 5h2V3h-2zm4 8h2v-2h-2zm0 8c1.1 0 2-.9 2-2h-2z"}),"Flip");var ds={},ka=it;Object.defineProperty(ds,"__esModule",{value:!0});var zn=ds.default=void 0,Ca=ka(ot()),Ra=e;zn=ds.default=(0,Ca.default)((0,Ra.jsx)("path",{d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5m0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"RadioButtonChecked");var xs={},za=it;Object.defineProperty(xs,"__esModule",{value:!0});var In=xs.default=void 0,Ia=za(ot()),Wa=e;In=xs.default=(0,Ia.default)((0,Wa.jsx)("path",{d:"M16.48 2.52c3.27 1.55 5.61 4.72 5.97 8.48h1.5C23.44 4.84 18.29 0 12 0l-.66.03 3.81 3.81zm-6.25-.77c-.59-.59-1.54-.59-2.12 0L1.75 8.11c-.59.59-.59 1.54 0 2.12l12.02 12.02c.59.59 1.54.59 2.12 0l6.36-6.36c.59-.59.59-1.54 0-2.12zm4.6 19.44L2.81 9.17l6.36-6.36 12.02 12.02zm-7.31.29C4.25 19.94 1.91 16.76 1.55 13H.05C.56 19.16 5.71 24 12 24l.66-.03-3.81-3.81z"}),"ScreenRotation");var ps={},Pa=it;Object.defineProperty(ps,"__esModule",{value:!0});var Wn=ps.default=void 0,$a=Pa(ot()),Ha=e;Wn=ps.default=(0,$a.default)((0,Ha.jsx)("path",{d:"M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z"}),"FullscreenExit");const Ls=new Set,St="hirexe_video_pendingConfirm",Da="hirexe_capture",Ut="pending",us="video";function hs(){return new Promise((n,t)=>{const a=indexedDB.open(Da,1);a.onupgradeneeded=()=>a.result.createObjectStore(Ut),a.onsuccess=()=>n(a.result),a.onerror=()=>t(a.error)})}async function Aa(n){const t=await hs();return new Promise((a,l)=>{const h=t.transaction(Ut,"readwrite");h.objectStore(Ut).put(n,us),h.oncomplete=()=>{t.close(),a()},h.onerror=()=>{t.close(),l(h.error)}})}async function Ea(){const n=await hs();return new Promise((t,a)=>{const h=n.transaction(Ut,"readonly").objectStore(Ut).get(us);h.onsuccess=()=>{n.close(),t(h.result||null)},h.onerror=()=>{n.close(),a(h.error)}})}async function gr(){const n=await hs();return new Promise((t,a)=>{const l=n.transaction(Ut,"readwrite");l.objectStore(Ut).delete(us),l.oncomplete=()=>{n.close(),t()},l.onerror=()=>{n.close(),a(l.error)}})}function Ta({uid:n,isDark:t,videoUrl:a,setVideoUrl:l,setVideoUploading:h,setUploadProgress:d,setUploadStatusMessage:g,setLoading:b,showSnackbar:m}){const p=ut(),[C,H]=i.useState(!1),[I,A]=i.useState(!1),[P,v]=i.useState(null),V=i.useRef(null),z=i.useRef(null),M=i.useRef(null),[f,E]=i.useState(!1),[$,F]=i.useState(!1),[D,y]=i.useState(null),[k,T]=i.useState(0),[j,L]=i.useState(!1),[ee,K]=i.useState(0),q=i.useRef(null),[N,_]=i.useState("user"),[J,ce]=i.useState(!1),[oe,ve]=i.useState(!1),ie=i.useRef(null),[ae,xe]=i.useState(!1),fe=sessionStorage.getItem(St)==="true",ke=i.useRef(!1),G=i.useRef(fe),pe=i.useRef(fe||null),[Ee,ze]=i.useState(!1),Ze=i.useRef(null),ye=O=>d(O),Fe=O=>{ve(O),h(O)},Be=O=>new Promise((w,W)=>{const te=URL.createObjectURL(O),de=document.createElement("video");de.preload="metadata",de.src=te,de.onloadedmetadata=()=>{URL.revokeObjectURL(te);const x=de.duration;if(x<30){W(new Error("Video must be at least 30 seconds"));return}if(x>120){W(new Error("Video must be 2 minutes or less"));return}const c=de.videoWidth,S=de.videoHeight,B=c/S;if(c<S){W(new Error("Video must be in landscape orientation"));return}if(Math.abs(B-16/9)>.01){W(new Error("Aspect ratio must be ~16â¶9 (e.g. 1280Ã720)"));return}w()},de.onerror=()=>
15{URL.revokeObjectURL(te),W(new Error("Could not load video metadata"))}});i.useEffect(()=>{!a&&z.current&&D&&(z.current.srcObject=D)},[D,a]),i.useEffect(()=>{a&&z.current&&(z.current.srcObject=null)},[a]);const Ie=()=>{if(ke.current||G.current||pe.current)return;const O=z.current;if(!O||O.videoWidth===0)return;const w=O.videoWidth,W=O.videoHeight,te=w/W,de=16/9,c=w>W&&Math.abs(te-de)<=.01;E(c)};i.useEffect(()=>{const O=z.current;if(!O)return;O.addEventListener("loadedmetadata",Ie),window.addEventListener("resize",Ie),window.addEventListener("orientationchange",Ie);const w=setInterval(Ie,1e3);return Ie(),()=>{O.removeEventListener("loadedmetadata",Ie),window.removeEventListener("resize",Ie),window.removeEventListener("orientationchange",Ie),clearInterval(w)}},[a,D]),i.useEffect(()=>{let O=!0;return(async()=>{try{const w=await navigator.mediaDevices.getUserMedia({video:{facingMode:N,aspectRatio:{ideal:1.7777777777777777},width:{ideal:1920},height:{ideal:1080}},audio:!0});if(!O)return;y(w),V.current=w}catch(w){console.error("Camera init failed:",w)}})(),()=>{D==null||D.getTracks().forEach(w=>w.stop()),De(),clearInterval(q.current),O=!1}},[N]),i.useEffect(()=>{const O=()=>xe(!!(document.fullscreenElement||document.webkitFullscreenElement));return document.addEventListener("fullscreenchange",O),document.addEventListener("webkitfullscreenchange",O),()=>{document.removeEventListener("fullscreenchange",O),document.removeEventListener("webkitfullscreenchange",O)}},[]),i.useEffect(()=>{sessionStorage.getItem(St)&&(async()=>{try{const O=await Ea();if(O){const w=URL.createObjectURL(O);l(w),v(O),pe.current=O,A(!0),G.current=!0}else sessionStorage.removeItem(St),G.current=!1,pe.current=null}catch(O){console.error("Failed to load pending video:",O),sessionStorage.removeItem(St),G.current=!1,pe.current=null}})()},[]);const Ve=()=>{const O=ie.current;if(!O)return;const w=O.requestFullscreen||O.webkitRequestFullscreen;w?w.call(O).catch(()=>xe(!0)):xe(!0)},We=()=>{if(document.fullscreenElement||document.webkitFullscreenElement){const w=document.exitFullscreen||document.webkitExitFullscreen;w==null||w.call(document).catch(()=>xe(!1))}else xe(!1)},Ye=()=>{if(!f){ze(!0),F(!0);return}a&&l(null),Ve(),T(3);const O=setInterval(()=>{T(w=>w<=1?(clearInterval(O),je(),0):w-1)},1e3)};Ze.current=Ye,i.useEffect(()=>{Ee&&f&&(ze(!1),F(!1))},[Ee,f]);const je=()=>{if(clearInterval(q.current),K(0),!D)return;const O=new MediaRecorder(D,{mimeType:"video/mp4"}),w=[];O.ondataavailable=te=>{te.data.size>0&&w.push(te.data)},O.onstop=async()=>{clearInterval(q.current),We();const te=new Blob(w,{type:"video/mp4"});try{await Be(te)}catch(x){console.error("Validation failed:",x),g(x.message),m==null||m(x.message,"error"),L(!1),ke.current=!1;return}const de=URL.createObjectURL(te);l(de),v(te),pe.current=te,sessionStorage.setItem(St,"true"),Aa(te).catch(x=>console.error("Failed to save pending video:",x)),A(!0),G.current=!0,L(!1),ke.current=!1},O.start(1e3),M.current=O,L(!0),ke.current=!0;const W=Date.now();q.current=setInterval(()=>{K(Math.floor((Date.now()-W)/1e3))},500)},Ne=()=>{var O;clearInterval(q.current),(O=M.current)==null||O.stop(),L(!1),ke.current=!1,We()},Je=()=>_(O=>O==="user"?"environment":"user"),ge=()=>ce(O=>!O),tt=async O=>{if(!n){console.warn("performUpload: Missing UID");return}const{currentUser:w}=wr();if(!w)throw new Error("User not authenticated");const W=await w.getIdToken(!0),te=qr(),de=Br(te,`users/${n}/proudestProfessionalAchievement_temp`);Fe(!0),ye(0),g("Uploading video...");try{await new Promise((S,B)=>{Yr(de,O,{contentType:"video/mp4",customMetadata:{uploadedAt:new Date().toISOString(),fileSize:O.size.toString()}}).on("state_changed",re=>{const X=Math.round(re.bytesTransferred/re.totalBytes*50);ye(X)},re=>{g("Uploading Failed..."),B(re)},()=>{ye(50),S()})}),g("Video uploaded! Queuing background processing...");const x=Ce();await Xr(Kr(x,"queue"),{mode:"API",uid:n,bearer:W,method:"POST",source:"api/admin/video/conversion",status:"pending",createdAt:ar(),metadata:{videoType:"proudestProfessionalAchievement"}}),console.log("Video processing queued successfully"),ye(75),g("Finalizingâ¦");const c=await Jr(de);l(c),ye(100),g("Upload complete! Processing will continue in the background."),H(!0),m==null||m("Video uploaded successfully!","success")}catch(x){console.error("performUpload error:",x),m==null||m("Upload failed. Please try again.","error");try{await Zs(de)}catch(S){console.warn("Failed to delete blob:",S)}try{const S=Ce(),B=Se(S,"users",n,"userData","data");await dr(B,{"videoUrl.proudestProfessionalAchievement":mr(),"videoUrl.url":mr()})}catch(S){console.warn("Failed to clear Firestore URL fields:",S)}const c=`Capture Video Error|${n}`;if(!Ls.has(c)){Ls.add(c);try{await vr({type:"Capture Video Error",page:`Capture Video - User (UID: ${n})`,description:`${x.message} 16Stack trace: 17${x.stack}`})}catch(S){console.error("Failed to send Slack error:",S)}}p("/error")}finally{Fe(!1)}},De=()=>{var O;if(((O=M.current)==null?void 0:O.state)==="recording"&&M.current.stop(),V.current&&V.current.getTracks().forEac
17h(w=>w.stop()),V.current=null,z.current){z.current.pause(),z.current.srcObject=null;try{z.current.load()}catch{}}y(null)},Pe={color:t?r.white:r.black,"&:hover":{color:r.orange},"&.Mui-disabled":{color:t?"rgba(255,255,255,0.2)":"rgba(0,0,0,0.2)"}},$e=ae?{color:r.white,"&:hover":{color:r.orange},"&.Mui-disabled":{color:r.grey}}:Pe;return e.jsxs(e.Fragment,{children:[e.jsxs(s,{ref:ie,sx:{position:"relative",...ae&&{position:"fixed",inset:0,zIndex:9999,bgcolor:r.black,display:"flex",flexDirection:"column",justifyContent:"center"}},children:[e.jsxs(s,{sx:{width:"100%",...!ae&&{aspectRatio:"16 / 9",borderRadius:"12px",border:`1px solid ${t?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.08)"}`},...ae&&{flex:1},overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:t?r.offBlack:"#e5e5e5",position:"relative"},children:[a&&!j?e.jsx(hn,{url:a,playing:!1,controls:!0,width:"100%",height:"100%",style:{position:"absolute",top:0,left:0},config:{file:{attributes:{style:{objectFit:"cover",width:"100%",height:"100%"}}}}},"playback"):e.jsx("video",{ref:z,autoPlay:!0,muted:!0,playsInline:!0,style:{width:"100%",height:"100%",objectFit:"cover",transform:J?"scaleX(-1)":"scaleX(1)"}},"live"),k>0&&e.jsx(s,{sx:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.5)",zIndex:2},children:e.jsxs(s,{sx:{position:"relative",display:"inline-flex"},children:[e.jsxs("svg",{width:ae?120:88,height:ae?120:88,style:{transform:"rotate(-90deg)"},children:[e.jsx("circle",{cx:ae?60:44,cy:ae?60:44,r:ae?52:38,fill:"none",stroke:"rgba(255,255,255,0.15)",strokeWidth:ae?5:4}),e.jsx("circle",{cx:ae?60:44,cy:ae?60:44,r:ae?52:38,fill:"none",stroke:r.orange,strokeWidth:ae?5:4,strokeLinecap:"round",strokeDasharray:ae?2*Math.PI*52:2*Math.PI*38,strokeDashoffset:(ae?2*Math.PI*52:2*Math.PI*38)*(1-k/3),style:{transition:"stroke-dashoffset 0.9s ease-in-out"}})]}),e.jsx(s,{sx:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(o,{sx:{fontSize:ae?"2.8rem":"2rem",fontWeight:700,color:r.white,lineHeight:1,animation:"countPop 0.4s ease-out","@keyframes countPop":{"0%":{transform:"scale(0.5)",opacity:0},"60%":{transform:"scale(1.15)"},"100%":{transform:"scale(1)",opacity:1}}},children:k},k)})]})}),j&&e.jsxs(s,{sx:{position:"absolute",top:ae?20:12,right:ae?20:12,px:1.5,py:.5,borderRadius:"8px",backgroundColor:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",gap:.75},children:[e.jsx(s,{sx:{width:8,height:8,borderRadius:"50%",backgroundColor:r.red,animation:"pulse 1.5s infinite","@keyframes pulse":{"0%, 100%":{opacity:1},"50%":{opacity:.3}}}}),e.jsxs(o,{sx:{fontSize:"0.8rem",color:r.white,fontWeight:600},children:[String(Math.floor(ee/60)).padStart(2,"0"),":",String(ee%60).padStart(2,"0")]})]})]}),e.jsxs(s,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:{xs:2,sm:3},...ae?{position:"absolute",bottom:0,left:0,right:0,py:3,pb:5,background:"linear-gradient(transparent, rgba(0,0,0,0.8))"}:{mt:2,mb:1}},children:[e.jsx(me,{onClick:()=>ae?We():Ve(),disabled:oe||j,sx:$e,children:ae?e.jsx(Wn,{sx:{fontSize:{xs:22,sm:26}}}):e.jsx(zs,{sx:{fontSize:{xs:22,sm:26}}})}),e.jsx(me,{onClick:Je,disabled:oe||j||!f,sx:$e,children:e.jsx(Cn,{sx:{fontSize:{xs:22,sm:26}}})}),e.jsx(me,{onClick:()=>j?Ne():Ye(),disabled:oe,sx:{...$e,width:{xs:48,sm:56},height:{xs:48,sm:56},border:ae?"2px solid rgba(255,255,255,0.3)":`2px solid ${t?"rgba(255,255,255,0.2)":"rgba(0,0,0,0.15)"}`,borderRadius:"50%",transition:"all 0.2s ease","&:hover":{borderColor:r.orange,color:r.orange}},children:j?e.jsx(Go,{sx:{fontSize:{xs:28,sm:34}}}):e.jsx(zn,{sx:{fontSize:{xs:28,sm:34},color:r.red}})}),e.jsx(me,{onClick:ge,disabled:oe||j||!f,sx:$e,children:e.jsx(Rn,{sx:{fontSize:{xs:22,sm:26}}})}),e.jsx(me,{sx:{visibility:"hidden"},children:e.jsx(zs,{sx:{fontSize:{xs:22,sm:26}}})})]}),e.jsx(s,{sx:{display:"flex",justifyContent:"center",...ae?{position:"absolute",bottom:12,left:0,right:0}:{mb:1}},children:e.jsx(o,{sx:{fontSize:"0.75rem",color:ae?"rgba(255,255,255,0.5)":t?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.35)"},children:j?`Recording: ${String(Math.floor(ee/60)).padStart(2,"0")}
17:${String(ee%60).padStart(2,"0")} / 02:00`:"Max 2 minutes"})})]}),e.jsx(Lt,{open:$,onClose:()=>{},fullWidth:!0,maxWidth:"xs",PaperProps:{sx:{textAlign:"center",px:{xs:.5,sm:1}}},children:e.jsxs(s,{sx:{px:{xs:3.5,sm:5},py:{xs:4,sm:5},display:"flex",flexDirection:"column",alignItems:"center"},children:[e.jsx(s,{sx:{width:{xs:72,sm:88},height:{xs:72,sm:88},borderRadius:"50%",bgcolor:t?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.04)",display:"flex",alignItems:"center",justifyContent:"center",mx:"auto",mb:3},children:e.jsx(In,{sx:{fontSize:{xs:36,sm:44},color:r.orange,animation:"rotateHint 2.5s ease-in-out infinite","@keyframes rotateHint":{"0%, 100%":{transform:"rotate(0deg)"},"25%":{transform:"rotate(-20deg)"},"75%":{transform:"rotate(20deg)"}}}})}),e.jsx(o,{sx:{fontSize:{xs:"1rem",sm:"1.1rem"},fontWeight:600,color:t?r.white:r.black,mb:1},children:"Rotate Your Device"}),e.jsx(o,{sx:{fontSize:{xs:"0.8rem",sm:"0.85rem"},color:t?"rgba(255,255,255,0.5)":"rgba(0,0,0,0.45)",lineHeight:1.6},children:"Please switch to landscape orientation (16:9) to record your video."})]})}),e.jsxs(Lt,{open:I,onClose:()=>{A(!1),G.current=!1,sessionStorage.removeItem(St),gr().catch(()=>{})},fullWidth:!0,maxWidth:"xs",PaperProps:{sx:{maxHeight:"90vh",display:"flex",flexDirection:"column"}},children:[e.jsx(Qt,{sx:{px:{xs:3,sm:3.5},pt:{xs:3.5,sm:4},pb:0},children:e.jsxs(s,{sx:{position:"relative"},children:[e.jsx(me,{variant:"close",onClick:()=>{A(!1),G.current=!1,sessionStorage.removeItem(St),gr().catch(()=>{})},sx:{position:"absolute",top:0,right:0,width:32,height:32},children:e.jsx(xr,{sx:{fontSize:18}})}),e.jsx(s,{sx:{width:56,height:56,borderRadius:"50%",bgcolor:t?"rgba(255,165,0,0.1)":"rgba(255,165,0,0.08)",display:"flex",alignItems:"center",justifyContent:"center",mx:"auto",mb:2.5},children:e.jsx(jr,{sx:{fontSize:28,color:r.orange}})}),e.jsx(o,{sx:{fontSize:{xs:"1.05rem",sm:"1.1rem"},fontWeight:600,color:t?r.white:r.black,textAlign:"center",mb:.75},children:"Ready to Upload?"}),e.jsx(o,{sx:{fontSize:"0.82rem",color:t?"rgba(255,255,255,0.5)":"rgba(0,0,0,0.45)",textAlign:"center",mb:3,lineHeight:1.5},children:"Please confirm your video covers the following:"}),e.jsx(s,{sx:{mb:1},children:["Specific metrics or statistics to quantify impact","Challenges you faced and how you overcame them","Your proudest professional achievement"].map((O,w)=>e.jsxs(s,{sx:{display:"flex",alignItems:"flex-start",gap:1.25,mb:1.25},children:[e.jsx(Ue,{sx:{fontSize:"1rem",mt:"2px",color:r.orange,flexShrink:0}}),e.jsx(o,{sx:{fontSize:"0.82rem",color:t?"rgba(255,255,255,0.75)":"rgba(0,0,0,0.65)",lineHeight:1.5},children:O})]},w))})]})}),e.jsxs(yr,{sx:{px:{xs:3,sm:3.5},pb:{xs:3,sm:3.5}},children:[e.jsx(U,{variant:"black",onClick:()=>{URL.revokeObjectURL(a),l(null),v(null),pe.current=null,A(!1),G.current=!1,sessionStorage.removeItem(St),gr().catch(()=>{})},sx:{flex:1,py:1.1,fontSize:"0.85rem"},children:"Retake"}),e.jsx(U,{variant:"orange",onClick:()=>{P&&(tt(P),v(null),pe.current=null),A(!1),G.current=!1,sessionStorage.removeItem(St),gr().catch(()=>{})},sx:{flex:1,py:1.1,fontSize:"0.85rem"},children:"Upload"})]})]})]})}
17async function Ma(){try{const n=Ce(),t=await Qe(Se(n,"users",qo,"userData","data"));return t.exists()?Bo(t.data()):""}catch(n){return console.warn("fetchExampleVideoUrl failed:",n),""}}async function Fa(n,{setVideoUrl:t,setLoading:a}){var h,d,g;if(!n){console.warn("fetchUserVideo: no uid"),a(!1);return}a(!0);const l=Ce();try{const b=Se(l,"users",n,"userData","data"),m=await Qe(b);if(!m.exists())t("");else{const p=m.data()||{},C=((d=(h=p.videoUrl)==null?void 0:h.proudestProfessionalAchievement)==null?void 0:d.url)??((g=p.videoUrl)==null?void 0:g.url)??"";t(C)}}catch(b){console.error("fetchUserVideo error:",b),ct({area:"user_setup",error:b,type:"achievementVideo fetchUserVideo failed",severity:"warning",uid:n}),t("")}finally{a(!1)}}async function Us(n,{videoUrl:t,setLoading:a}){if(!n){console.warn("handleContinue: no uid"),a(!1);return}try{if(!(t!=null&&t.trim()))throw new Error("Video is required - please upload or record a video first");a(!0),ur(n,"setup_video","Uploaded achievement video",{},"user")}catch(l){throw console.error("handleContinue error:",l),l}finally{a(!1)}}const _a=["Include specific metrics to quantify your impact (e.g., increased sales by 30%)","Describe specific challenges you faced and how you overcame them","Video must be between 30 seconds and 2 minutes","File size must be less than 200 MB","Landscape orientation in 16:9 (e.g., 1280Ã720)"],Oa=["Choose to record directly or upload a pre-recorded video","Speak about your proude
17st professional achievement","Highlight key metrics, challenges, and outcomes","Your video will be processed in the background after upload","Continue to the next step once your video is submitted"],Vs=({uid:n})=>{const{isDark:t,toggleDarkMode:a}=He(),l=ut(),[h,d]=i.useState(()=>sessionStorage.getItem("hirexe_video_showCapture")==="true"),[g,b]=i.useState(!0),[m,p]=i.useState(null),[C,H]=i.useState(!1),[I,A]=i.useState(0),[P,v]=i.useState(""),[V,z]=i.useState(""),[M,f]=i.useState({open:!1,message:"",severity:"info"}),E=i.useRef(null),[$,F]=i.useState(""),[D,y]=i.useState(!0),k=(j,L="error")=>f({open:!0,message:j,severity:L});i.useEffect(()=>{Fa(n,{setVideoUrl:p,setLoading:b})},[n]),i.useEffect(()=>{Ma().then(F)},[]),i.useEffect(()=>{sessionStorage.setItem("hirexe_video_showCapture",h.toString())},[h]);const T={display:"flex",alignItems:"center",gap:1.5,mb:2.5};return e.jsxs(e.Fragment,{children:[g&&e.jsx(lt,{variant:"fullscreen",text:"Loading..."}),e.jsx(s,{sx:{position:"fixed",top:{xs:"-100px",sm:"-150px",md:"-200px",lg:"-250px"},left:{xs:"-150px",sm:"-200px",md:"-300px",lg:"-400px"},zIndex:0,pointerEvents:"none",willChange:"transform"},children:e.jsx(Et,{backgroundMode:!0})}),e.jsx(zt,{}),e.jsx(s,{sx:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:0,pointerEvents:"none",backgroundImage:t?"radial-gradient(circle at 1px 1px, rgba(255,255,255,0.04) 1px, transparent 0)":"radial-gradient(circle at 1px 1px, rgba(0,0,0,0.03) 1px, transparent 0)",backgroundSize:"40px 40px"}}),e.jsxs(s,{sx:{position:"relative",zIndex:1,width:"100%",height:"100vh",backgroundColor:"transparent",overflowY:"auto",overflowX:"hidden",...Ae(t)},children:[e.jsx(s,{sx:{maxWidth:"1200px",mx:"auto",px:{xs:2,md:4},pt:3},children:e.jsxs(s,{sx:{py:2,px:{xs:2,md:3},borderRadius:"16px",border:`1px solid ${t?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)"}`,backgroundColor:t?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.6)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1.5,minWidth:0},children:[e.jsx(s,{sx:{width:36,height:36,minWidth:36,borderRadius:"10px",backgroundColor:t?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.05)",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(zr,{sx:{color:t?r.white:r.black,fontSize:20}})}),e.jsxs(s,{sx:{minWidth:0},children:[e.jsx(o,{variant:"h5",sx:{fontWeight:600,color:t?r.white:r.black,fontSize:{xs:"1rem",md:"1.25rem"},lineHeight:1.3,whiteSpace:"nowrap"},children:"Achievement Video"}),e.jsx(o,{sx:{color:t?r.grey:r.darkGrey,fontSize:"0.8rem",display:{xs:"none",sm:"block"}},children:"Record or upload your proudest professional achievement"})]})]}),e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(be,{title:"Go back",placement:"bottom",arrow:!0,children:e.jsx(me,{disabled:C,onClick:()=>l(-1),sx:{display:{xs:"inline-flex",sm:"none"},width:34,height:34,bgcolor:t?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.05)",color:t?r.white:r.black,border:`1px solid ${t?"rgba(255,255,255,0.15)":"rgba(0,0,0,0.1)"}`,"&:hover":{bgcolor:t?"rgba(255,255,255,0.15)":"rgba(0,0,0,0.08)"}},children:e.jsx(pr,{sx:{fontSize:"1.1rem"}})})}),e.jsx(be,{title:"Continue",placement:"bottom",arrow:!0,children:e.jsx("span",{style:{display:"inline-flex"},children:e.jsx(me,{disabled:!m||C,onClick:()=>{z(""),Us(n,{videoUrl:m,setLoading:b}).then(()=>l("/dashboard/user/personal")).catch(j=>{console.error(j),z(j.message||"Something went wrong")})},sx:{display:{xs:"inline-flex",sm:"none"},width:34,height:34,bgcolor:r.orange,color:r.white,"&:hover":{bgcolor:r.orange,opacity:.9},"&.Mui-disabled":{bgcolor:t?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)",color:t?"rgba(255,255,255,0.3)":"rgba(0,0,0,0.3)"}},children:e.jsx(tr,{sx:{fontSize:"1.1rem"}})})})}),e.jsx(U,{variant:"black",disabled:C,onMouseDown:j=>j.preventDefault(),onClick:()=>l(-1),sx:{display:{xs:"none",sm:"inline-flex"},px:3,height:36,minHeight:36,fontSize:"0.85rem"},children:"Back"}),e.jsx(U,{variant:"orange",disabled:!m||C,onClick:()=>{z(""),Us(n,{videoUrl:m,setLoading:b}).then(()=>l("/dashboard/user/personal")).catch(j=>{console.error(j),z(j.message||"Something went wrong")})},sx:{display:{xs:"none",sm:"inline-flex"},px:3,height:36,minHeight:36,fontSize:"0.85rem"},children:"Continue"}),e.jsx(be,{title:t?"Light mode":"Dark mode",placement:"bottom",arrow:!0,children:e.jsx(me,{onClick:a,sx:{width:{xs:40,sm:24},height:{xs:40,sm:24},minWidth:0,padding:0,bgcolor:"transparent",color:t?"rgba(255,255,255,0.5)":"rgba(0,0,0,0.4)","&:hover":{bgcolor:"transparent",color:r.orange}},children:t?e.jsx(Vt,{sx:{width:14,height:14}}):e.jsx(er,{sx:{width:14,height:14}})})})]})]})}),e.jsxs(s,{sx:{maxWidth:"1200px",mx:"auto",px:{xs:2,md:4},pt:3,pb:4,display:"flex",flexDirection:"column",gap:3},children:[V&&e.jsx(s,{sx:{p:1.5,border:`1px solid ${t?"rgba(255,255,255,0.15)":r.orange}`,borderRadius:"12px",backgroundColor:t?"rgba(255,255,255,0.05)":"#FFF5F0"},children:e.jsx(o,{sx:{fontSize:"0.85rem",color:t?r.orange:r.red,textAlign:"center"},children:V})}),e.jsxs(s,{sx:{display:"flex",flexDirection:{xs:"column",lg:"row"},alignItems:{lg:"flex-start"},gap:3},children:[e.jsxs(s,{sx:{display:{xs:"contents",lg:"flex"},flexDirection:"column",width:{lg:"28%"},flexShrink:{lg:0},gap:{lg:3}},children:[e.jsxs(Z,{sx:{p:3,mb:0,order:{xs:2,lg:0}},children:[e.jsxs(s,{sx:T,children:[e.jsx(No,{sx:{color:t?r.white:r.black,fontSize:24}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem"},children:"Video Method"})]}),e.jsxs(s,{sx:{display:"flex",gap:1.5},children:[e.jsxs(U,{variant:h?"transparent":"black",disabled:C,onClick:()=>d(!1),onMouseDown:j=>j.preventDefault(),sx:{flex:1,py:1.2,fontSize:"0.8rem"},children:[e.jsx(jr,{sx:{fontSize:18,mr:.75}}),"Upload"]}),e.jsxs(U,{variant:h?"black":"transparent",disabled:C,onClick:()=>d(!0),onMouseDown:j=>j.preventDefault(),sx:{flex:1,py:1.2,fontSize:"0.8rem"},children:[e.jsx(zr,{sx:{fontSize:18,mr:.75}}),"Capture"]})]})]}),(()=>{const j=C?"uploading":I===100?"success":P&&I===0?"error":m?"success":"idle",L=j==="uploading"?r.orange:j==="success"?r.green:j==="error"?"#ef4444":t?"rgba(255,255,255,0.2)":"rgba(0,0,0,0.15)";return e.jsxs(Z,{sx:{p:3,mb:0,order:{xs:4,lg:0},position:"relative"},children:[j==="success"&&e.jsx(Ue,{sx:{position:"absolute",top:16,right:16,fontSize:22,color:r.green}}),e.jsxs(s,{sx:T,children:[e.jsx(jr,{sx:{color:t?r.white:r.black,fontSize:24}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem"},children:"Upload Status"})]}),e.jsx(s,{sx:{height:6,borderRadius:3,mb:1.5,backgroundColor:t?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.06)",overflow:"hidden"},children:e.jsx(s,{sx:{height:"100%",borderRadius:3,backgroundColor:L,width:`${j==="success"?100:I}%`,transition:"background-color 0.3s ease, width 0.4s linear"}})}),e.jsx(o,{sx:{fontSize:"0.82rem",color:j==="success"?r.green:j==="error"?"#ef4444":t?"rgba(255,255,255,0.6)":"rgba(0,0,0,0.5)"},children:C?`${P} ${I}%`:P||(m?"Video has been uploaded.":"Waiting for video...")})]})})(),e.jsxs(Z,{sx:{p:3,mb:0,order:{xs:5,lg:0}},children:[e.jsxs(s,{sx:T,children:[e.jsx(Dt,{sx:{color:t?r.white:r.black,fontSize:24}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem"},children:"How It Works"})]}),Oa.map((j,L)=>
17e.jsxs(s,{sx:{display:"flex",alignItems:"flex-start",gap:1.5,mb:1},children:[e.jsx(Ue,{sx:{fontSize:"1rem",mt:"2px",color:t?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.35)",flexShrink:0}}),e.jsx(o,{sx:{fontSize:"0.82rem",color:t?"rgba(255,255,255,0.75)":"rgba(0,0,0,0.65)",lineHeight:1.5},children:j})]},L))]})]}),e.jsxs(s,{sx:{display:{xs:"contents",lg:"flex"},flexDirection:"column",flex:{lg:1},gap:{lg:3}},children:[e.jsxs(Z,{sx:{p:3,mb:0,order:{xs:1,lg:0}},children:[e.jsxs(s,{sx:T,children:[e.jsx(Qr,{sx:{color:t?r.white:r.black,fontSize:24}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem"},children:"Guidelines"})]}),e.jsxs(s,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},alignItems:"flex-start",gap:{xs:2,md:3}},children:[e.jsxs(s,{sx:{flex:1,minWidth:0},children:[e.jsx(o,{sx:{fontSize:"0.82rem",color:t?"rgba(255,255,255,0.6)":"rgba(0,0,0,0.5)",mb:2},children:"Create a video about your proudest professional achievement."}),_a.map((j,L)=>e.jsxs(s,{sx:{display:"flex",alignItems:"flex-start",gap:1.5,mb:1},children:[e.jsx(Ue,{sx:{fontSize:"1rem",mt:"2px",color:t?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.35)",flexShrink:0}}),e.jsx(o,{sx:{fontSize:"0.82rem",color:t?"rgba(255,255,255,0.75)":"rgba(0,0,0,0.65)",lineHeight:1.5},children:j})]},L))]}),$&&e.jsxs(s,{sx:{width:{xs:"100%",md:300},flexShrink:0,borderTop:{xs:`1px solid ${t?"rgba(255,255,255,0.07)":"rgba(0,0,0,0.07)"}`,md:"none"},borderLeft:{xs:"none",md:`1px solid ${t?"rgba(255,255,255,0.07)":"rgba(0,0,0,0.07)"}`},pt:{xs:2,md:0},pl:{xs:0,md:3}},children:[e.jsxs(s,{role:"button",tabIndex:0,"aria-expanded":D,onClick:()=>y(j=>!j),onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),y(L=>!L))},sx:{display:"flex",alignItems:"center",gap:1,cursor:"pointer",userSelect:"none",color:r.orange,minHeight:{xs:44,sm:32},py:{xs:.5,sm:0},"&:hover":{opacity:.85}},children:[e.jsx(Jo,{sx:{fontSize:"1.1rem",flexShrink:0}}),e.jsx(o,{sx:{fontSize:"0.8rem",fontWeight:600,color:r.orange},children:D?"Hide example video":"Not sure how? Watch an example"}),e.jsx(Xo,{sx:{fontSize:"1.1rem",ml:"auto",flexShrink:0,transition:"transform 0.25s ease",transform:D?"rotate(180deg)":"none"}})]}),e.jsx(un,{in:D,unmountOnExit:!0,children:e.jsxs(s,{sx:{mt:1.5,maxWidth:{xs:380,md:"100%"}},children:[e.jsx(Yo,{src:$,controls:!0,playsInline:!0,videoType:"setup_example",borderRadius:"10px",preload:"metadata",sx:{width:"100%"}}),e.jsx(o,{sx:{mt:1,fontSize:"0.72rem",lineHeight:1.45,color:t?r.grey:r.darkGrey},children:"How another Hirexe candidate presented their proudest professional achievement."})]})})]})]})]}),e.jsxs(Z,{sx:{p:3,mb:0,overflow:"hidden",display:"flex",flexDirection:"column",order:{xs:3,lg:0}},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:2.5},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[e.jsx(zr,{sx:{color:t?r.white:r.black,fontSize:24}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem"},children:h?"Video Capture":"Video Upload"})]}),!h&&!C&&m&&e.jsx(U,{variant:"black",onClick:()=>{var j;return(j=E.current)==null?void 0:j.call(E)},sx:{px:2,py:.6,fontSize:"0.78rem",textTransform:"none"},children:"Change Video"})]}),h?e.jsx(Ta,{uid:n,isDark:t,videoUrl:m,setVideoUrl:p,setVideoUploading:H,setUploadProgress:A,setUploadStatusMessage:v,setLoading:b,showSnackbar:k}):e.jsx(ba,{uid:n,isDark:t,videoUrl:m,setVideoUrl:p,setVideoUploading:H,setUploadProgress:A,setUploadStatusMessage:v,setLoading:b,onSwitchToCapture:()=>d(!0),showSnackbar:k,changeVideoRef:E})]})]})]})]})]}),e.jsx(jt,{open:M.open,onClose:()=>f(j=>({...j,open:!1})),message:M.message,severity:M.severity,autoHideDuration:5e3})]})},Pn=i.forwardRef(({progress:n=0,label:t="Analysing...",sublabel:a,checking:l=!0,ringSize:h=80,sx:d,...g},b)=>{const{isDark:m}=He();return e.jsxs(s,{ref:b,sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:2,px:3,py:3,borderRadius:"20px",bgcolor:m?"rgba(10,10,10,0.88)":"rgba(252,252,252,0.88)",border:`1px solid ${m?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.06)"}`,backdropFilter:"blur(24px)",WebkitBackdropFilter:"blur(24px)",boxShadow:m?"0 24px 48px rgba(0,0,0,0.5)":"0 24px 48px rgba(0,0,0,0.12)",textAlign:"center",minWidth:200,...d},...g,children:[e.jsx(Ko,{value:l?n:100,size:h,thickness:5,label:l?`${Math.round(n)}%`:"â"}),e.jsx(o,{sx:{fontSize:"0.9rem",fontWeight:700,color:m?"rgba(255,255,255,0.9)":"rgba(0,0,0,0.9)"},children:t}),a&&e.jsx(o,{sx:{fontSize:"0.78rem",color:m?"rgba(255,255,255,0.45)":"rgba(0,0,0,0.45)",lineHeight:1.5,maxWidth:240},children:a}),l&&e.jsx(s,{sx:{width:"100%",height:"2px",borderRadius:"2px",bgcolor:m?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)",overflow:"hidden"},children:e.jsx(s,{sx:{height:"100%",width:"40%",bgcolor:r.orange,borderRadius:"2px",animation:"huiHudScan 1.6s ease-in-out infinite","@keyframes huiHudScan":{"0%":{transform:"translateX(-100%)"},"100%":{transform:"translateX(350%)"}}}})})]})});Pn.displayName="HuiGlassProfileHUD";
17class vt extends Error{constructor(t,a={}){super(t),this.name="ValidationError",Object.assign(this,a)}}const La=n=>n==null||n===""||typeof n=="string"&&(n.toLowerCase()==="null"||n.toLowerCase()==="na"||n==="N/A");async function Ua(n,t,a){const l=Ce(),h=t.map((g,b)=>{const m=a.find(p=>p.index===b);return m&&m.value?{...g,jobTitle:m.value.trim()}:g}),d=Se(l,"users",n,"userData","data");return await dr(d,{doneGroups:h}),h}async function Va(n,{aboutMe:t,myFuture:a,hobbies:l}){const h=Ce(),d=Se(h,"users",n,"userData","data");await dr(d,{aboutMe:t,myFuture:a,hobbies:l})}async function Na(n,{setCheckLoading:t,setProgressMessage:a,setDynamicCheckProgressAPI:l,skipDoneInfo:h=!1,skipPersonalDetails:d=!1}){var g,b;if(!n){console.warn("handleContinue: no uid"),t(!1);return}t(!0);try{l(5),a("Starting profile checks..."),a("Checking experience information...");let m;if(h){const y=Ce();m=((await Qe(Se(y,"users",n,"userData","data"))).data()||{}).doneGroups||[]}else{const y=await Le("/api/usersetup/parse/doneInformation",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uid:n})});if(!y.ok)throw new Error("Experience check failed");m=(await y.json()).doneGroups}if(!Array.isArray(m))throw new Error("Invalid response: Missing Experience");const p=[];if(m.forEach((y,k)=>{La(y.jobTitle)&&p.push({index:k,company:y.title||`Experience ${k+1}`,startDate:y.startDate||"",endDate:y.endDate||""})}),p.length>0)throw new vt(`Missing job title${p.length>1?"s":""} in your experience`,{type:"missing_job_title",fixes:p,doneGroups:m});l(25),a("Validating experience years...");const C=await Le("/api/usersetup/parse/experienceYears",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uid:n})});if(!C.ok)throw new vt("Experience years check encountered an error. Please try again.",{type:"api_failure",failedStep:"Experience Years"});await C.json(),l(45),a("Re-checking skills list...");const H=await Le("/api/usersetup/ai/skills/recheck",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uid:n})});if(!H.ok)throw new vt("Skills check encountered an error. Please try again.",{type:"api_failure",failedStep:"Skills"});const{skills:I}=await H.json(),A=Array.isArray(I)?I.filter(y=>y.rating>=4).length:0;if(A<3)throw new vt("Not enough high-rated skills",{type:"insufficient_skills",skillCount:A});if(l(55),a("Checking core information..."),!d){const y=await Le("/api/usersetup/user/personalDetailsCheck",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uid:n})});if(y.status!==201){const k=Ce(),j=(await Qe(Se(k,"users",n,"userData","data"))).data()||{};throw new vt("Some personal details need to be updated to continue",{type:"personal_details_incomplete",aboutMe:j.aboutMe||"",myFuture:j.myFuture||"",hobbies:j.hobbies||[]})}await y.json()}l(65),a("Checking video upload...");const P=Ce();if(!((b=(g=((await Qe(Se(P,"users",n,"userData","data"))).data()||{}).videoUrl)==null?void 0:g.proudestProfessionalAchievement)==null?void 0:b.url))throw new vt("Video upload not found",{type:"video_missing"});if(l(70),a("Parsing highlights..."),!(await Le("/api/usersetup/parse/highlights",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uid:n})})).ok)throw new vt("Highlights check encountered an error. Please try again.",{type:"api_failure",failedStep:"Highlights"});l(80),a("Calculating profile rating...");const f=await Le("/api/usersetup/user/calculateProfileRating",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uid:n})});if(!f.ok)throw new vt("Profile rating check encountered an error. Please try again.",{type:"api_failure",failedStep:"Profile Rating"});await f.json(),l(90),a("Updating settingsâ¦");const E=Se(P,"users",n,"userSettings","settings");await dr(E,{profileCompletion:!0,completedAt:ar(),adminCheck:!1});const $=await Le("/api/correspondence/email",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uid:n,type:"profileComplete",customData:{sourceChannel:"website"}})});if(!$.status){const y=await $.text();throw new Error(`an error occured: ${y}`)}ur(n,"reelcv_check","Completed ReelCV check",{},"user");const{currentUser:F}=wr(),D=await F.getIdToken(!0);Xr(Kr(P,"queue"),{mode:"API",uid:n,bearer:D,method:"POST",source:"api/usersetup/user/calculateEmployabilityRating",status:"pending",createdAt:ar()}).catch(y=>console.warn("Failed to queue employability rating:",y)),l(100),a("Profile Complete! ð")}catch(m){throw console.error(m),a(m.message||"Something went wrongâ¦"),l(100),m}finally{}}var fs={},Ga=it;Object.defineProperty(fs,"__esModule",{value:!0});var $n=fs.default=void 0,qa=Ga(ot()),Ba=e;$n=fs.default=(0,qa.default)((0,Ba.jsx)("path",{d:"M12 5.99 19.53 19H4.47zM12 2 1 21h22zm1 14h-2v2h2zm0-6h-2v4h2z"}),"WarningAmberOutlined");var gs={},Ya=it;Object.defineProperty(gs,"__esModule",{value:!0});var Or=gs.default=void 0,Ja=Ya(ot()),Xa=e;Or=gs.default=(0,Ja.default)((0,Xa.jsx)("path",{d:"M7.11 8.53 5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.01 5.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03zM13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93"}),"RotateLeft");var ms={},Ka=it;Object.defineProperty(ms,"__esModule",{value:!0});var Hn=ms.default=void 0,Qa=Ka(ot()),Za=e;Hn=ms.default=(0,Qa.default)((0,Za.jsx)("path",{d:"M7 11v2h10v-2zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"RemoveCircleOutline");const Ns=new Set;function $t({type:n,page:t,description:a}){const l=Rt.currentUser;if(!l)return;const h=l.uid,d=`${n}|${t}`;Ns.has(d)||(Ns.add(d),vr({uid:h,type:n,page:t,description:a}))}const el=Array.from({length:16},(n,t)=>({id:t,x:Math.random()*100,y:50+Math.random()*50,size:Math.random()*4+2,duration:Math.random()*5+5,delay:Math.random()*4,opacity:Math.random()*.25+.15})),tl=[{text:"Scroll through your ReelCV and verify all information is correct",bold:!0},{text:"Double-click on any experience section to edit details",bold:!1}
17,{text:"Follow the provided tips to improve your profile rating",bold:!1},{text:"Click the refresh icon next to Tips to recalculate your rating",bold:!1},{text:"Achieve a rating of A or B with at least 3 orange skills to continue",bold:!1}],rl=["Justify the impact you had in each experience with specific statistics","Be specific and clarify all skills mentioned in past experience","Ensure every experience entry has a valid job title","Add more detailed experience to increase your profile rating","Your video must be uploaded and processed before continuing","To continue, your profile requires an A or B rating"];function Gs({uid:n}){var ht,gt,mt,Nt;const{isDark:t,toggleDarkMode:a}=He(),l=ut(),h=en(),[d,g]=i.useState(0),b=i.useRef(null),[m,p]=i.useState(!1),[C,H]=i.useState(!1),[I,A]=i.useState(0),[P,v]=i.useState(""),[V,z]=i.useState(!0),[M,f]=i.useState([]),[E,$]=i.useState(0),[F,D]=i.useState([]),[y,k]=i.useState(""),[T,j]=i.useState(""),[L,ee]=i.useState({open:!1,message:"",severity:"error"}),K=(u,R="error")=>ee({open:!0,message:u,severity:R}),q=()=>ee(u=>({...u,open:!1})),[N,_]=i.useState({open:!1,type:null,fixes:[],doneGroups:[],values:{}}),[J,ce]=i.useState(!1),[oe,ve]=i.useState(""),[ie,ae]=i.useState(""),[xe,fe]=i.useState("grey"),[ke,G]=i.useState(""),pe=i.useRef(null),Ee=i.useRef(null),ze=i.useRef(null),Ze=i.useRef(null),[ye,Fe]=i.useState(""),[Be,Ie]=i.useState(0),[Ve,We]=i.useState(0),[Ye,je]=i.useState(!1),[Ne,Je]=i.useState(!0),[ge,tt]=i.useState(!1),[De,Pe]=i.useState(20),[$e,O]=i.useState(.7),[w,W]=i.useState(!1),[te,de]=i.useState(0),x=u=>{if(!(u instanceof vt)){const R=u.message||"Something went wrong";j(R),K(R);return}switch(u.type){case"missing_job_title":{const R={};(u.fixes||[]).forEach(Y=>{R[Y.index]=""}),_({open:!0,type:u.type,fixes:u.fixes||[],doneGroups:u.doneGroups||[],values:R});break}case"personal_details_incomplete":{const R=u.hobbies||[],Y=R.length>=3?[...R]:[...R,...Array(3-R.length).fill("")];_({open:!0,type:u.type,values:{aboutMe:u.aboutMe||"",myFuture:u.myFuture||"",hobbies:Y}});break}case"insufficient_skills":{_({open:!0,type:u.type,skillCount:u.skillCount||0});break}case"video_missing":{_({open:!0,type:u.type});break}case"profile_rating_low":{_({open:!0,type:u.type,score:u.score||0});break}case"api_failure":{_({open:!0,type:u.type,failedStep:u.failedStep||"Unknown"});break}default:{const R=u.message||"Something went wrong";j(R),K(R)}}},c=(u=!1,R=!1)=>{H(!0),j(""),Na(n,{setCheckLoading:H,setProgressMessage:v,setDynamicCheckProgressAPI:A,skipDoneInfo:u,skipPersonalDetails:R}).then(()=>new Promise(Y=>setTimeout(Y,2500))).then(()=>l("/dashboard/user")).catch(x).finally(()=>H(!1))},S=()=>c(!1),B=async()=>{var Y,se;const{type:u,values:R}=N;if(u==="missing_job_title"){const{fixes:Re,doneGroups:Xe}=N;if(!Re.every(Ge=>{var Oe;return(Oe=R[Ge.index])==null?void 0:Oe.trim()})){K("Please fill in all required fields");return}ce(!0);try{const Ge=Re.map(Oe=>({index:Oe.index,value:R[Oe.index].trim()}));await Ua(n,Xe,Ge),_(Oe=>({...Oe,open:!1})),K("Details saved! Retrying checks...","success"),c(!0)}catch{K("Failed to save. Please try again.")}finally{ce(!1)}}else if(u==="personal_details_incomplete"){const Re=(Y=R.aboutMe)==null?void 0:Y.trim(),Xe=(se=R.myFuture)==null?void 0:se.trim(),Me=(R.hobbies||[]).map(Ge=>Ge.trim()).filter(Boolean);if(!Re){K("Please fill in the About Me section");return}if(!Xe){K("Please fill in the My Future Goals section");return}if(Me.length<3){K("Please add at least 3 hobbies");return}ce(!0);try{await Va(n,{aboutMe:Re,myFuture:Xe,hobbies:Me}),_(Ge=>({...Ge,open:!1})),K("Details saved! Retrying checks...","success"),c(!0,!0)}catch{K("Failed to save. Please try again.")}finally{ce(!1)}}},ne=(u,R)=>{_(Y=>{var Re;const se=[...((Re=Y.values)==null?void 0:Re.hobbies)||[]];return se[u]=R,{...Y,values:{...Y.values,hobbies:se}}})},re=()=>{_(u=>{var R;return{...u,values:{...u.values,hobbies:[...((R=u.values)==null?void 0:R.hobbies)||[],""]}}})},X=u=>{_(R=>{var se;const Y=(((se=R.values)==null?void 0:se.hobbies)||[]).filter((Re,Xe)=>Xe!==u);return{...R,values:{...R.values,hobbies:Y}}})};i.useEffect(()=>{je(!0)},[]),i.useEffect(()=>{const u=async()=>{var Y;try{const se=Ce(),Re=Se(se,"users",n,"userData","data"),Xe=await Qe(Re);if(Xe.exists()){const Me=Xe.data(),Ge=(Y=Me==null?void 0:Me.videoUrl)==null?void 0:Y.proudestProfessionalAchievement;Ge!=null&&Ge.url?tt(!0):tt(!1)}}catch(se){console.error("Error checking video processing status:",se),tt(!1)}};u();const R=setInterval(u,1e4);return()=>clearInterval(R)},[n]);const he=u=>{clearInterval(b.current),b.current=setInterval(()=>{g(R=>R>=u?(clearInterval(b.current),u):R+1)},50)},_e=async()=>{z(!0),f([]),ve(""),fe("grey"),k(""),D([]);try{let u;for(let we=1;we<=3&&(u=await Le("/api/usersetup/parse/highlights",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uid:n})}),!u.ok);we++)console.warn(`Highlights fetch attempt ${we} failed: ${u.status}`),we<3&&await new Promise(et=>setTimeout(et,1e3));if(!u.ok)throw $t({type:"Highlights Check Failed - parseHighlights",page:"ReelCV",description:`ReelCV parseHighlights API failed. 18Response: `+u}),j("Check failed... Please reload the page."),K("Check failed... Please reload the page."),new Error("Highlights fetch failed after 3 attempts");const{highlights:R}=await u.json();let Y;for(let we=1;we<=3&&(Y=await Le("/api/usersetup/parse/doneInformation",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uid:n})}),!Y.ok);we++)console.warn(`DoneInformation attempt ${we} failed: ${Y.status}`),we<3&&await new Promise(et=>setTimeout(et,1e3));if(!Y.ok)throw $t({type:"Done Information Check Failed - parseDoneInformation",page:"ReelCV",description:`ReelCV parseDoneInformation API failed. 19Response: `+Y}),Je(!0),j("Check Failed, please reload the page."),new Error("doneInformation fetch failed after 3 attempts");const se=await Y.json();if(!Array.isArray(se.doneGroups))throw Je(!0),j("Please add job titles to experience."),new Error("Invalid response: doneGroups is not an array");for(const we of se.doneGroups){const et=we.jobTitle;if(et==null||et===""||et.toLowerCase()==="null"||et.toLowerCase()==="na"||et==="N/A")throw Je(!0),j("Please add job titles to experience."),new Error("Validation failed: missing jobTitle in doneGroups")}let Re;for(let we=1;we<=3&&(Re=await Le("/api/usersetup/ai/skills/recheck",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uid:n})}),!Re.ok);we++)console.warn(`Skills recheck attempt ${we} failed: ${Re.status}`),we<3&&await new Promise(et=>setTimeout(et,1e3));if(!Re.ok)throw $t({type:"Skills Recheck Failed - aiSkillsRecheck",page:"ReelCV",description:`ReelCV ai/skills/recheck API failed. 20Response: `+Re}),j("Check failed... Please reload the page."),new Error("Skills recheck failed after 3 attempts");const{skills:Xe}=await Re.json(),Me=Array.isArray(Xe)?Xe.filter(we=>we.rating>=4).length:0;We(Me);let Ge;for(let we=1;we<=3&&(Ge=await Le("/api/usersetup/reelcv/check",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uid:n})}),!Ge.ok);we++)console.warn(`ReelcvCheck attempt ${we} failed: ${Ge.status}`),we<3&&await new Promise(et=>setTimeout(et,1e3));if(!Ge.ok)throw $t({type:"ReelCV Check Failed - reelcvCheck",page:"ReelCV",description:`ReelCV reelcvCheck API failed. 21Response: `+Ge}),j("Check failed... Please reload the page."),new Error("reelcvCheck fetch failed after 3 attempts");const rr=(await Ge.json()).tips||[];f(rr);let Gt;for(let we=1;we<=3&&(Gt=await Le("/api/usersetup/user/calculateProfileRating",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uid:n})}),!Gt.ok);we++)console.warn(`Profile rating attempt ${we} failed: ${Gt.status}`),we<3&&await new Promise(et=>setTimeout(et,1e3));if(!Gt.ok)throw $t({type:"Profile Rating Check Failed - calculateProfileRating",page:"ReelCV",description:`ReelCV calculateProfileRating API failed. 22Response: `+Gt}),j("Rating fetch failed... Please reload the page."),new Error("Rating fetch failed after 3 attempts");const{score:sr,summary:Gn}=await Gt.json();ae(Gn);let It;sr<40?It="F":sr<50?It="E":sr<60?It="D":sr<70?It="C":sr<80?It="B":
22It="A",ve(It),fe({A:"#00ff00",B:"#00ff00",C:"#0083ff",D:"#fc0000",E:"#fc0000",F:"#fc0000"}[It]||r.darkGrey)}catch(u){console.error("Error generating new info:",u)}finally{z(!1),p(!1),Ie(u=>u+1)}};i.useEffect(()=>(pe.current=setInterval(()=>{$(u=>(u+1)%4)},500),()=>clearInterval(pe.current)),[]),i.useEffect(()=>{(async()=>{let u;for(let Y=1;Y<=3&&(u=await Le("/api/usersetup/parse/doneInformation",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uid:n})}),!u.ok);Y++)console.warn(`DoneInformation attempt ${Y} failed: ${u.status}`),Y<3&&await new Promise(se=>setTimeout(se,1e3));if(!u.ok){$t({type:"Done Information Check Failed - parseDoneInformation",page:"ReelCV",description:`ReelCV parseDoneInformation API failed. 23Response: `+u}),Je(!0),j("Check Failed, please reload the page.");return}const R=await u.json();if(!Array.isArray(R.doneGroups)){Je(!0),j("Please add job titles to experience.");return}for(const Y of R.doneGroups){const se=Y.jobTitle;if(se==null||se===""||se.toLowerCase()==="null"||se.toLowerCase()==="na"||se==="N/A"){Je(!0),j("Please add job titles to experience.");return}Je(!1)}})()},[n]),i.useEffect(()=>(he(30),(async()=>{let u=[];try{u=(await(await Le("/api/usersetup/reelcv/check",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uid:n})})).json()).tips||[]}catch(R){console.error("Error fetching tips:",R)}finally{f(u),z(!1)}})(),()=>clearInterval(b.current)),[n]),i.useEffect(()=>{if(!V&&M.length){let u=0,R=0;return Ee.current=setInterval(()=>{const Y=M[u];R++,k(Y.slice(0,R)),R===Y.length&&(D(se=>[...se,Y]),u++,R=0,u>=M.length&&clearInterval(Ee.current))},1),()=>clearInterval(Ee.current)}},[V,M]),i.useEffect(()=>{he(30),(async()=>{try{let u;for(let Oe=1;Oe<=3&&(u=await Le("/api/usersetup/ai/skills/recheck",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uid:n})}),!u.ok);Oe++)console.warn(`Skills recheck attempt ${Oe} failed: ${u.status}`),Oe<3&&await new Promise(rr=>setTimeout(rr,1e3));if(!u.ok)throw $t({type:"Skills Recheck Failed - recheckSkills",page:"ReelCV",description:`ReelCV skills recheck API failed. 24Response: `+u}),j("Check failed... Please reload the page."),new Error("Skills recheck failed after 3 attempts");const{skills:R}=await u.json(),Y=Array.isArray(R)?R.filter(Oe=>Oe.rating>=4).length:0;We(Y);let se;for(let Oe=1;Oe<=3&&(se=await Le("/api/usersetup/user/calculateProfileRating",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uid:n})}),!se.ok);Oe++)console.warn(`Rating fetch attempt ${Oe} failed: ${se.status}`),Oe<3&&await new Promise(rr=>setTimeout(rr,1e3));if(!se.ok)throw $t({type:"Profile Rating Check Failed - calculateProfileRating",page:"ReelCV",description:`ReelCV calculateProfileRating API failed. 25Response:`+se}),j("Rating Check failed... Please reload the page."),new Error("Rating fetch failed after 3 attempts");const{score:Re,summary:Xe}=await se.json();ae(Xe);let Me;Re<40?Me="F":Re<50?Me="E":Re<60?Me="D":Re<70?Me="C":Re<80?Me="B":Me="A",ve(Me),fe({A:"#00ff00",B:"#00ff00",C:"#0083ff",D:"#fc0000",E:"#fc0000",F:"#fc0000"}[Me]||r.darkGrey)}catch(u){console.error("Error fetching profile rating:",u)}finally{p(!1)}})()},[n]),i.useEffect(()=>{if(!m&&ie){let u=0;clearInterval(ze.current),G(""),ze.current=setInterval(()=>{u++,G(ie.slice(0,u)),u>=ie.length&&clearInterval(ze.current)},30)}return()=>clearInterval(ze.current)},[m,ie]),i.useEffect(()=>{const u=Ze.current;if(!u)return;const R=()=>{const Y=u.scrollHeight-u.clientHeight;if(Y<=0)return;const se=Math.min(1,u.scrollTop/Y),Xe=30+(100-30)*se;g(Me=>Xe>Me?Xe:Me)};return u.addEventListener("scroll",R),()=>u.removeEventListener("scroll",R)},[oe]),i.useEffect(()=>{if(I===100){clearInterval(b.current);return}if(P){let u=0;clearInterval(b.current),Fe(""),b.current=setInterval(()=>{u++,Fe(P.slice(0,u)),u>=P.length&&clearInterval(b.current)},30)}return()=>clearInterval(b.current)},[P,I]);const Te=Fo(0),rt=vs(Te,[0,100],["0%","100%"]),st=vs(Te,[0,92,100],[1,1,0]),dt=i.useRef(Date.now());i.useEffect(()=>{C&&(dt.current=Date.now(),Te.set(0))},[C,Te]),i.useEffect(()=>{if(!C)return;const u=Date.now(),R=(u-dt.current)/1e3;dt.current=u,_o(Te,I,{duration:R,ease:"linear"})},[I,C,Te]),i.useEffect(()=>{if(!C){Pe(20),O(.7),W(!1),de(0);return}return Te.onChange(R=>{const Y=Math.min(100,Math.max(0,R));de(Y),Pe(Math.max(0,20-Y/100*20)),O(Y>=100?0:Math.max(0,.7-Y/90*.7))})},[C,Te]),i.useEffect(()=>{if(I===100&&C){W(!0);const u=setTimeout(()=>W(!1),800);return()=>clearTimeout(u)}},[I,C]),i.useEffect(()=>{oe===""?j(""):ge?["A","B"].includes(oe)?Ve<3?j("Your profile has to contain at least 3 orange skills to continueâ¦"):j(""):j("We require your profile to be at least an A or B to continueâ¦"):j("Your video is still being processed in the background. Please wait...")},[oe,ge]);const xt={display:"flex",alignItems:"center",gap:1.5,mb:2.5},ue=Math.round(d);return e.jsxs(e.Fragment,{children:[m&&e.jsx(lt,{variant:"fullscreen",text:"Loading..."}),C&&e.jsxs(s,{sx:{position:"fixed",inset:0,zIndex:1e4,overflowX:"hidden",overflowY:"hidden"},children:[e.jsx(s,{sx:{position:"absolute",inset:0,zIndex:0,background:t?"radial-gradient(ellipse at 50% 30%, rgba(215,122,46,0.06) 0%, transparent 60%), #0a0a0a":"radial-gradient(ellipse at 50% 30%, rgba(215,122,46,0.04) 0%, transparent 60%), #f0f0f0"},children:el.map(u=>e.jsx(qe.div,{animate:{y:[0,-160],opacity:[0,u.opacity,0]},transition:{duration:u.duration,delay:u.delay,repeat:1/0,repeatDelay:1.5,ease:"easeOut"},style:{position:"absolute",left:`${u.x}%`,top:`${u.y}%`,width:u.size,height:u.size,borderRadius:"50%",backgroundColor:t?r.orange:"rgba(0,0,0,0.2)",pointerEvents:"none"}},u.id))}),e.jsx(s,{sx:{position:"absolute",inset:0,zIndex:1,display:"flex",justifyContent:"center",pt:{xs:13,sm:14,md:15},px:{xs:1,sm:2,md:3},overflowY:"auto",overflowX:"hidden",pointerEvents:"none",touchAction:"none"},children:e.jsxs(s,{sx:{position:"relative",width:"100%",maxWidth:1e3},children:[e.jsx(Er,{uid:n,type:"view",baseUrl:h}),e.jsx(s,{sx:{position:"absolute",inset:0,backdropFilter:`blur(${De}px)`,WebkitBackdropFilter:`blur(${De}px)`,backgroundColor:t?`rgba(10,10,10,${$e})`:`rgba(240,240,240,${$e})`,transition:"backdrop-filter 0.8s ease-out, background-color 0.8s ease-out",zIndex:1,borderRadius:"10px",maskImage:`linear-gradient(to bottom, transparent ${Math.max(0,te-2)}%, black ${Math.min(100,te+3)}%, black 100%)`,WebkitMaskImage:`linear-gradient(to bottom, transparent ${Math.max(0,te-2)}%, black ${Math.min(100,te+3)}%, black 100%)`}}
25),e.jsx(qe.div,{style:{top:rt,position:"absolute",left:0,right:0,height:3,background:`linear-gradient(90deg, transparent 0%, ${r.orange}80 20%, ${r.orange} 50%, ${r.orange}80 80%, transparent 100%)`,boxShadow:`0 0 20px 8px ${r.orange}40, 0 0 60px 20px ${r.orange}20`,zIndex:3,opacity:st,pointerEvents:"none"}}),e.jsx(qe.div,{style:{top:rt,position:"absolute",left:0,right:0,height:200,marginTop:-100,background:t?"linear-gradient(180deg, transparent 0%, rgba(215,122,46,0.1) 50%, transparent 100%)":"linear-gradient(180deg, transparent 0%, rgba(215,122,46,0.08) 50%, transparent 100%)",zIndex:2,opacity:st,pointerEvents:"none"}})]})}),e.jsx(qe.div,{initial:{y:-40,opacity:0},animate:I===100?{y:-40,opacity:0}:{y:0,opacity:1},transition:{duration:.6,ease:[.25,.1,.25,1]},style:{position:"absolute",top:0,left:0,right:0,display:"flex",justifyContent:"center",zIndex:10,pointerEvents:"none"},children:e.jsx(Pn,{progress:I,label:I===100?"Profile Complete!":"Creating your profile...",sublabel:I===100?void 0:ye||"Ensuring all details have been checked...",checking:I<100,sx:{mt:{xs:2,md:4},width:{xs:"calc(100% - 32px)",sm:400,md:480}}})}),e.jsx(pn,{children:w&&e.jsx(qe.div,{initial:{opacity:0}
25,animate:{opacity:[0,.15,0]},exit:{opacity:0},transition:{duration:.6,ease:"easeInOut"},style:{position:"absolute",inset:0,backgroundColor:t?r.orange:r.white,zIndex:20,pointerEvents:"none"}})})]}),e.jsx(s,{sx:{position:"fixed",top:{xs:"-100px",sm:"-150px",md:"-200px",lg:"-250px"},left:{xs:"-150px",sm:"-200px",md:"-300px",lg:"-400px"},zIndex:0,pointerEvents:"none",willChange:"transform"},children:e.jsx(Et,{backgroundMode:!0})}),e.jsx(zt,{}),e.jsx(s,{sx:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:0,pointerEvents:"none",backgroundImage:t?"radial-gradient(circle at 1px 1px, rgba(255,255,255,0.04) 1px, transparent 0)":"radial-gradient(circle at 1px 1px, rgba(0,0,0,0.03) 1px, transparent 0)",backgroundSize:"40px 40px"}}),e.jsxs(s,{sx:{position:"relative",zIndex:1,width:"100%",height:"100vh",backgroundColor:"transparent",overflowY:"auto",overflowX:"hidden",...Ae(t)},children:[e.jsx(s,{sx:{maxWidth:"1400px",mx:"auto",px:{xs:2,md:4},pt:3},children:e.jsxs(ft,{sx:{py:2,px:{xs:2,md:3},display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1.5,minWidth:0},children:[e.jsx(s,{sx:{width:36,height:36,minWidth:36,borderRadius:"10px",backgroundColor:t?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.05)",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(Ir,{sx:{color:t?r.white:r.black,fontSize:20}})}),e.jsxs(s,{sx:{minWidth:0},children:[e.jsx(o,{variant:"h5",sx:{fontWeight:600,color:t?r.white:r.black,fontSize:{xs:"1rem",md:"1.25rem"},lineHeight:1.3,whiteSpace:"nowrap"},children:"ReelCV Check"}),e.jsx(o,{sx:{color:t?r.grey:r.darkGrey,fontSize:"0.8rem",display:{xs:"none",sm:"block"}},children:"Review and verify your profile"})]})]}),e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(be,{title:"Back",placement:"bottom",arrow:!0,children:e.jsx(me,{variant:"nav",onClick:()=>l(-1),sx:{display:{xs:"inline-flex",sm:"none"},width:34,height:34},children:e.jsx(pr,{sx:{fontSize:"1.1rem"}})})}),e.jsx(U,{variant:"black",onClick:()=>l(-1),sx:{display:{xs:"none",sm:"inline-flex"},px:3,height:36,minHeight:36,fontSize:"0.85rem"},children:"Back"}),e.jsx(be,{title:"Continue",placement:"bottom",arrow:!0,children:e.jsx("span",{style:{display:"inline-flex"},children:e.jsx(me,{variant:"filled",disabled:!1,onClick:S,sx:{display:{xs:"inline-flex",sm:"none"},width:34,height:34},children:e.jsx(tr,{sx:{fontSize:"1.1rem"}})})})}),e.jsx(U,{variant:"orange",disabled:!1,onClick:S,sx:{display:{xs:"none",sm:"inline-flex"},px:3,height:36,minHeight:36,fontSize:"0.85rem"},children:"Continue"}),e.jsx(be,{title:t?"Light mode":"Dark mode",placement:"bottom",arrow:!0,children:e.jsx(me,{variant:"default",onClick:a,sx:{width:24,height:24,minWidth:0,padding:0,borderRadius:"6px"},children:t?e.jsx(Vt,{sx:{width:14,height:14}}):e.jsx(er,{sx:{width:14,height:14}})})})]})]})}),e.jsxs(s,{sx:{maxWidth:"1400px",mx:"auto",pt:3,pb:4,px:{xs:2,md:4},display:"flex",flexDirection:"column",gap:3},children:[e.jsxs(Z,{sx:{p:3},children:[e.jsxs(s,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1.5},children:[e.jsx(o,{sx:{fontSize:"0.85rem",fontWeight:500,color:t?r.white:r.black},children:ue===100?"Profile Complete!":ue>=90?"Please edit your profile and follow the tips":"Ensuring all details have been checked..."}),e.jsxs(o,{sx:{fontSize:"0.85rem",fontWeight:600,color:r.orange},children:[ue,"%"]})]}),e.jsx(s,{sx:{width:"100%",height:8,borderRadius:4,backgroundColor:t?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.08)"},children:e.jsx(s,{sx:{width:`${ue}%`,height:"100%",borderRadius:4,backgroundColor:r.orange,transition:"width 0.4s ease"}})})]}),e.jsxs(s,{sx:{display:"flex",flexDirection:{xs:"column",lg:"row"},gap:3},children:[e.jsxs(s,{sx:{width:{xs:"100%",lg:"30%"},position:{lg:"sticky"},top:{lg:24},alignSelf:{lg:"flex-start"},display:"flex",flexDirection:"column",gap:3},children:[e.jsxs(Z,{sx:{p:3},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:2.5},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[e.jsx(Qr,{sx:{color:t?r.white:r.black,fontSize:24}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem"},children:"Profile Rating"})]}),e.jsx(be,{title:"Refresh tips & rating",placement:"top",arrow:!0,children:e.jsx(me,{variant:"default",onClick:_e,sx:{width:32,height:32},children:e.jsx(Or,{sx:{fontSize:18}})})})]}),e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:2,mb:2},children:[e.jsx(be,{arrow:!0,title:ie?e.jsx(s,{sx:{p:1.5,maxWidth:280},children:e.jsx(o,{sx:{fontSize:"0.8rem",color:r.white,lineHeight:1.5},children:ie})}):"",children:e.jsx(s,{sx:{width:48,height:48,minWidth:48,borderRadius:"50%",bgcolor:xe,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"all 0.3s ease"},children:e.jsx(o,{sx:{fontWeight:700,fontSize:"1.3rem",color:r.black,lineHeight:1},children:oe||"?"})})}),e.jsxs(s,{children:[e.jsx(o,{sx:{fontSize:"0.9rem",fontWeight:500,color:t?r.white:r.black},children:oe!==""?`Rated ${oe}`:`Loading${".".repeat(E)}`}),e.jsx(o,{sx:{fontSize:"0.78rem",color:t?"rgba(255,255,255,0.5)":"rgba(0,0,0,0.45)"},children:oe!==""?"Hover the badge for details":"Calculating profile rating"})]})]}),e.jsx(s,{sx:{minHeight:"100px",maxHeight:"140px",overflowY:"auto",...Ae(t)},children:oe===""?e.jsx(o,{sx:{fontSize:"0.82rem",color:t?"rgba(255,255,255,0.6)":"rgba(0,0,0,0.5)"},children:`Checking${".".repeat(E)}`}):e.jsx(o,{sx:{fontSize:"0.82rem",color:t?"rgba(255,255,255,0.75)":"rgba(0,0,0,0.65)",lineHeight:1.6,whiteSpace:"pre-wrap"},children:ke})})]}),e.jsxs(Z,{sx:{p:3},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:2.5},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[e.jsx(kr,{sx:{color:t?r.white:r.black,fontSize:24}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem"},children:"Tips to Improve"})]}),e.jsx(be,{title:"Refresh tips & rating",placement:"top",arrow:!0,children:e.jsx(me,{variant:"default",onClick:_e,sx:{width:32,height:32},children:e.jsx(Or,{sx:{fontSize:18}})})})]}),e.jsx(s,{sx:{minHeight:"180px",maxHeight:"300px",overflowY:"auto",...Ae(t)},children:V?e.jsx(o,{sx:{fontSize:"0.82rem",color:t?"rgba(255,255,255,0.6)":"rgba(0,0,0,0.5)"},children:`Checking${".".repeat(E)}`}):e.jsxs(s,{sx:{display:"flex",flexDirection:"column",gap:1.2},children:[F.map((u,R)=>
25e.jsxs(s,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[e.jsx(Ue,{sx:{fontSize:"1rem",mt:"2px",color:r.orange,flexShrink:0}}),e.jsx(o,{sx:{fontSize:"0.82rem",color:t?"rgba(255,255,255,0.75)":"rgba(0,0,0,0.65)",lineHeight:1.5},children:u})]},R)),y&&!F.includes(y)&&e.jsxs(s,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[e.jsx(Ue,{sx:{fontSize:"1rem",mt:"2px",color:r.orange,flexShrink:0}}),e.jsx(o,{sx:{fontSize:"0.82rem",color:t?"rgba(255,255,255,0.75)":"rgba(0,0,0,0.65)",lineHeight:1.5},children:y})]})]})})]}),e.jsxs(Z,{sx:{p:3},children:[e.jsxs(s,{sx:xt,children:[e.jsx(Dt,{sx:{color:t?r.white:r.black,fontSize:24}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem"},children:"How To"})]}),e.jsx(s,{sx:{display:"flex",flexDirection:"column",gap:1.2},children:tl.map((u,R)=>e.jsxs(s,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[e.jsx(Ue,{sx:{fontSize:"1rem",mt:"2px",color:t?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.35)",flexShrink:0}}),e.jsx(o,{sx:{fontSize:"0.82rem",color:u.bold?t?r.white:r.black:t?"rgba(255,255,255,0.75)":"rgba(0,0,0,0.65)",fontWeight:u.bold?600:400,lineHeight:1.5},children:u.text})]},R))})]}),e.jsxs(Z,{sx:{p:3},children:[e.jsxs(s,{sx:xt,children:[e.jsx(Ss,{sx:{color:t?r.white:r.black,fontSize:24}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem"},children:"Guidelines"})]}),e.jsx(s,{sx:{display:"flex",flexDirection:"column",gap:1.2},children:rl.map((u,R)=>e.jsxs(s,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[e.jsx(Ue,{sx:{fontSize:"1rem",mt:"2px",color:t?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.35)",flexShrink:0}}),e.jsx(o,{sx:{fontSize:"0.82rem",color:t?"rgba(255,255,255,0.75)":"rgba(0,0,0,0.65)",lineHeight:1.5},children:u})]},R))})]})]}),e.jsxs(s,{sx:{flex:1,minWidth:0,width:{xs:"100%",lg:"auto"},overflow:"hidden",display:"flex",flexDirection:"column",gap:3},children:[e.jsxs(Z,{sx:{p:0,overflow:"hidden"},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1.5,px:3,pt:3,pb:2},children:[e.jsx(Ir,{sx:{color:t?r.white:r.black,fontSize:24}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem"},children:"Your ReelCV"})]}),e.jsx(s,{ref:Ze,sx:{overflowY:"auto",overflowX:"auto",maxHeight:{xs:"650px",md:"800px",lg:"1200px"},...Ae(t,{horizontal:!0})},children:e.jsx(s,{sx:{display:"flex",justifyContent:"center",p:2},children:e.jsx(Z,{sx:{width:"100%",overflow:"hidden",p:2},children:e.jsx(Er,{uid:n,type:"edit"},Be)})})})]}),e.jsxs(s,{sx:{mt:1},children:[T&&e.jsx(s,{sx:{width:"100%",mb:2,p:1.5,border:`1px solid ${t?"rgba(255,255,255,0.15)":r.orange}`,borderRadius:"12px",backgroundColor:t?"rgba(255,255,255,0.05)":"#FFECEC"},children:e.jsx(o,{color:"error",sx:{fontSize:"0.875rem",textAlign:"center",color:t?r.orange:void 0},children:T})}),e.jsx(s,{sx:{display:"flex",justifyContent:"flex-end"},children:e.jsx(U,{variant:"orange",disabled:!1,onClick:S,sx:{px:3,py:1.5},children:"Continue"})})]})]})]})]})]}),e.jsxs(Lt,{open:Ye,onClose:()=>je(!1),fullWidth:!0,maxWidth:"sm",PaperProps:{sx:{maxHeight:"85vh"}},children:[e.jsx(Qt,{sx:{px:0,py:0},children:e.jsxs(s,{sx:{position:"relative",px:{xs:3,sm:3.5},pt:{xs:3.5,sm:4},pb:0},children:[e.jsx(me,{variant:"close",onClick:()=>je(!1),sx:{position:"absolute",top:14,right:14,width:32,height:32},children:e.jsx(xr,{sx:{fontSize:18}})}),e.jsx(s,{sx:{width:56,height:56,borderRadius:"50%",bgcolor:t?"rgba(255,165,0,0.1)":"rgba(255,165,0,0.08)",display:"flex",alignItems:"center",justifyContent:"center",mx:"auto",mb:2.5},children:e.jsx(Ir,{sx:{fontSize:28,color:r.orange}})}),e.jsx(o,{sx:{fontSize:{xs:"1.05rem",sm:"1.1rem"},fontWeight:600,color:t?r.white:r.black,textAlign:"center",mb:.75},children:"ReelCV Check"}),e.jsx(o,{sx:{fontSize:"0.82rem",color:t?"rgba(255,255,255,0.5)":"rgba(0,0,0,0.45)",textAlign:"center",mb:3,lineHeight:1.5},children:"Please review all the information on your ReelCV and ensure they are correct."}),e.jsxs(s,{sx:{mb:3},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1.25,mb:1.5},children:[e.jsx(Dt,{sx:{fontSize:18,color:t?r.white:r.black}}),e.jsx(o,{sx:{fontSize:"0.9rem",fontWeight:600,color:t?r.white:r.black},children:"How To Use"})]}),[{text:"Scroll through your ReelCV and ensure all details are correct",bold:!0},{text:"Double-click on experience to add or edit details",bold:!1}
25,{text:"Follow the tips to improve your ReelCV rating",bold:!1},{text:"Refresh your details by clicking the refresh icon next to Tips",bold:!1},{text:"To view these details again, hover over the information icon",bold:!1}].map((u,R)=>e.jsxs(s,{sx:{display:"flex",alignItems:"flex-start",gap:1.25,mb:1.25},children:[e.jsx(Ue,{sx:{fontSize:"1rem",mt:"2px",color:r.orange,flexShrink:0}}),e.jsx(o,{sx:{fontSize:"0.82rem",color:u.bold?t?r.white:r.black:t?"rgba(255,255,255,0.75)":"rgba(0,0,0,0.65)",fontWeight:u.bold?600:400,lineHeight:1.5},children:u.text})]},R))]}),e.jsxs(s,{sx:{mb:1},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1.25,mb:1.5},children:[e.jsx(Ss,{sx:{fontSize:18,color:t?r.white:r.black}}),e.jsx(o,{sx:{fontSize:"0.9rem",fontWeight:600,color:t?r.white:r.black},children:"Guidelines"})]}),["Justify the impact you had in your experience, including statistics","Please ensure you are specific and clarify any skills in past experience","To continue, your profile requires an A or B rating","To increase your rating, add more experience and justify skills","Ensure your video has been uploaded and processed","Your profile must contain at least 3 orange skills"].map((u,R)=>e.jsxs(s,{sx:{display:"flex",alignItems:"flex-start",gap:1.25,mb:1.25},children:[e.jsx(Ue,{sx:{fontSize:"1rem",mt:"2px",color:t?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.35)",flexShrink:0}}),e.jsx(o,{sx:{fontSize:"0.82rem",color:t?"rgba(255,255,255,0.75)":"rgba(0,0,0,0.65)",lineHeight:1.5},children:u})]},R))]})]})}),e.jsx(yr,{sx:{justifyContent:"center"},children:e.jsx(U,{variant:"orange",fullWidth:!0,onClick:()=>je(!1),sx:{py:1.1,fontSize:"0.85rem"},children:"Got It"})})]}),e.jsxs(Lt,{open:N.open,onClose:()=>!J&&_(u=>({...u,open:!1})),maxWidth:"sm",fullWidth:!0,children:[e.jsxs(fn,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[N.type==="video_missing"?e.jsx(Io,{sx:{color:r.orange,fontSize:"1.3rem"}}):N.type==="api_failure"?e.jsx(ho,{sx:{color:r.red,fontSize:"1.3rem"}}):e.jsx($n,{sx:{color:r.orange,fontSize:"1.3rem"}}),e.jsxs(o,{sx:{color:t?r.white:r.black,fontWeight:700,fontSize:"1.05rem"},children:[N.type==="missing_job_title"&&"Missing Information",N.type==="personal_details_incomplete"&&"Missing Personal Details",N.type==="insufficient_skills"&&"Insufficient Skill Ratings",N.type==="video_missing"&&"Video Not Found",N.type==="profile_rating_low"&&"Profile Rating Too Low",N.type==="api_failure"&&"Check Failed"]})]}),e.jsxs(Qt,{sx:{pt:2.5,...Ae(t)},children:[N.type==="missing_job_title"&&e.jsxs(e.Fragment,{children:[e.jsx(o,{sx:{color:t?r.offWhite:r.darkGrey,fontSize:"0.85rem",mt:2,mx:2,mb:3,lineHeight:1.6},children:(N.fixes||[]).length===1?"We found a missing detail in your experience. Please fill it in to continue:":"We found some missing details in your experience. Please fill them in to continue:"}),(N.fixes||[]).map(u=>{var R;return e.jsxs(ft,{sx:{p:2.5,mx:2,mb:2,display:"flex",flexDirection:"column",gap:1},children:[(u.startDate||u.endDate)&&e.jsxs(o,{sx:{color:t?r.grey:r.greyMid,fontSize:"0.72rem",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.5px"},children:[u.startDate,u.startDate&&u.endDate?" â ":"",u.endDate]}),e.jsx(Q,{fullWidth:!0,title:`What was your job title at "${u.company}"?`,value:((R=N.values)==null?void 0:R[u.index])||"",onChange:Y=>_(se=>({...se,values:{...se.values,[u.index]:Y.target.value}})),placeholder:"e.g. Senior Software Developer"})]},u.index)})]}),N.type==="personal_details_incomplete"&&e.jsxs(e.Fragment,{children:[e.jsx(o,{sx:{color:t?r.offWhite:r.darkGrey,fontSize:"0.85rem",mt:2,mx:2,mb:3,lineHeight:1.6},children:"Some of your personal information needs to be updated before your profile can be completed. Please review and update the following:"}),e.jsxs(ft,{sx:{p:2.5,mx:2,mb:2,display:"flex",flexDirection:"column",gap:2.5},children:[e.jsx(Q,{fullWidth:!0,title:"About Me",multiline:!0,rows:3,value:((ht=N.values)==null?void 0:ht.aboutMe)||"",onChange:u=>_(R=>({...R,values:{...R.values,aboutMe:u.target.value}})),placeholder:"Tell us about yourself and your professional background..."}),e.jsx(Q,{fullWidth:!0,title:"My Future Goals",multiline:!0,rows:3,value:((gt=N.values)==null?void 0:gt.myFuture)||"",onChange:u=>_(R=>({...R,values:{...R.values,myFuture:u.target.value}})),placeholder:"Describe your career goals and aspirations..."}),e.jsxs(s,{children:[e.jsx(o,{sx:{color:t?r.offWhite:r.darkGrey,fontSize:"0.8rem",fontWeight:500,mb:1.5},children:"Hobbies & Interests (minimum 3)"}),e.jsx(s,{sx:{display:"flex",flexDirection:"column",gap:1.5}
25,children:(((mt=N.values)==null?void 0:mt.hobbies)||[]).map((u,R)=>{var Y;return e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(Q,{fullWidth:!0,value:u,onChange:se=>ne(R,se.target.value),placeholder:`Hobby ${R+1}`}),(((Y=N.values)==null?void 0:Y.hobbies)||[]).length>3&&e.jsx(me,{variant:"danger",onClick:()=>X(R),sx:{width:32,height:32,minWidth:32},children:e.jsx(Hn,{sx:{fontSize:"1rem"}})})]},R)})}),(((Nt=N.values)==null?void 0:Nt.hobbies)||[]).length<10&&e.jsxs(U,{variant:"transparent",onClick:re,sx:{mt:1.5,fontSize:"0.8rem"},children:[e.jsx(Mr,{sx:{fontSize:"1rem",mr:.5}})," Add Hobby"]})]})]})]}),N.type==="insufficient_skills"&&e.jsxs(e.Fragment,{children:[e.jsxs(o,{sx:{color:t?r.offWhite:r.darkGrey,fontSize:"0.85rem",mt:2,mx:2,mb:3,lineHeight:1.6},children:["Your profile needs at least 3 skills rated 4 or higher (orange skills). You currently have ",N.skillCount||0,"."]}),e.jsxs(ft,{sx:{p:2.5,mx:2,display:"flex",flexDirection:"column",gap:1.5},children:[e.jsx(o,{sx:{color:t?r.white:r.black,fontSize:"0.85rem",fontWeight:600,mb:.5},children:"To improve your skill ratings:"}),["Add more detail to your experience sections describing how you used each skill","Include specific statistics and achievements for each role","Ensure your CV mentions these skills in the context of real work experience"].map((u,R)=>e.jsxs(s,{sx:{display:"flex",alignItems:"flex-start",gap:1.25},children:[e.jsx(Ue,{sx:{fontSize:"0.9rem",mt:"3px",color:r.orange,flexShrink:0}}),e.jsx(o,{sx:{color:t?r.offWhite:r.darkGrey,fontSize:"0.82rem",lineHeight:1.5},children:u})]},R))]})]}),N.type==="video_missing"&&e.jsxs(e.Fragment,{children:[e.jsx(o,{sx:{color:t?r.offWhite:r.darkGrey,fontSize:"0.85rem",mt:2,mx:2,mb:2,lineHeight:1.6},children:"We could not find an uploaded video for your profile. A video resume is required to complete your ReelCV check."}),e.jsx(o,{sx:{color:t?r.offWhite:r.darkGrey,fontSize:"0.85rem",mx:2,lineHeight:1.6},children:"Please navigate to the CV & Video Upload page to record or upload your video."})]}),N.type==="profile_rating_low"&&e.jsxs(e.Fragment,{children:[e.jsxs(o,{sx:{color:t?r.offWhite:r.darkGrey,fontSize:"0.85rem",mt:2,mx:2,mb:3,lineHeight:1.6},children:["Your profile scored ",N.score||0,"/100. A minimum score of 70 is required to continue."]}),e.jsxs(ft,{sx:{p:2.5,mx:2,display:"flex",flexDirection:"column",gap:1.5},children:[e.jsx(o,{sx:{color:t?r.white:r.black,fontSize:"0.85rem",fontWeight:600,mb:.5},children:"To improve your rating:"}),["Add more detailed experience with specific achievements and statistics","Ensure your skills are well-represented across your experience entries","Follow the tips provided in the sidebar to address specific weaknesses","Add more experience entries to demonstrate breadth and depth"].map((u,R)=>e.jsxs(s,{sx:{display:"flex",alignItems:"flex-start",gap:1.25},children:[e.jsx(Ue,{sx:{fontSize:"0.9rem",mt:"3px",color:r.orange,flexShrink:0}}),e.jsx(o,{sx:{color:t?r.offWhite:r.darkGrey,fontSize:"0.82rem",lineHeight:1.5},children:u})]},R))]})]}),N.type==="api_failure"&&e.jsxs(e.Fragment,{children:[e.jsxs(o,{sx:{color:t?r.offWhite:r.darkGrey,fontSize:"0.85rem",mt:2,mx:2,mb:2,lineHeight:1.6},children:["The ",N.failedStep||"validation"," check encountered an error. This may be a temporary issue."]}),e.jsx(o,{sx:{color:t?r.offWhite:r.darkGrey,fontSize:"0.85rem",mx:2,lineHeight:1.6},children:"Please try again. If the problem persists, reload the page."})]})]}),e.jsxs(yr,{children:[(N.type==="missing_job_title"||N.type==="personal_details_incomplete")&&e.jsxs(e.Fragment,{children:[e.jsx(U,{variant:"transparent",onClick:()=>_(u=>({...u,open:!1})),disabled:J,children:"Cancel"}),e.jsx(U,{variant:"orange",onClick:B,disabled:J,children:J?"Saving...":"Save & Continue"})]}),(N.type==="insufficient_skills"||N.type==="profile_rating_low")&&e.jsx(U,{variant:"orange",onClick:()=>_(u=>({...u,open:!1})),children:"Close & Edit Profile"}),N.type==="video_missing"&&e.jsxs(e.Fragment,{children:[e.jsx(U,{variant:"transparent",onClick:()=>_(u=>({...u,open:!1})),children:"Cancel"}),e.jsx(U,{variant:"orange",onClick:()=>{_(u=>({...u,open:!1})),l("/dashboard/user/cv")},children:"Go to Upload"})]}),N.type==="api_failure"&&e.jsxs(e.Fragment,{children:[e.jsx(U,{variant:"transparent",onClick:()=>_(u=>({...u,open:!1})),children:"Cancel"}),e.jsx(U,{variant:"orange",onClick:()=>{_(u=>({...u,open:!1})),c(!0)},children:"Retry"})]})]})]}),e.jsx(jt,{open:L.open,onClose:q,message:L.message,severity:L.severity})]})}var bs={},sl=it;Object.defineProperty(bs,"__esModule",{value:!0});var Dn=bs.default=void 0,nl=sl(ot()),ol=e;Dn=bs.default=(0,nl.default)((0,ol.jsx)("path",{d:"M7 20h4c0 1.1-.9 2-2 2s-2-.9-2-2m-2-1h8v-2H5zm11.5-9.5c0 3.82-2.66 5.86-3.77 6.5H5.27c-1.11-.64-3.77-2.68-3.77-6.5C1.5 5.36 4.86 2 9 2s7.5 3.36 7.5 7.5m4.87-2.13L20 8l1.37.63L22 10l.63-1.37L24 8l-1.37-.63L22 6zM19 6l.94-2.06L22 3l-2.06-.94L19 0l-.94 2.06L16 3l2.06.94z"}),"TipsAndUpdates");function il({open:n,src:t,crop:a,zoom:l,onCropChange:h,onZoomChange:d,onCropComplete:g,onCancel:b,onConfirm:m}){return e.jsx(pi,{open:n,src:t,crop:a,zoom:l,onCropChange:h,onZoomChange:d,onCropComplete:g,onCancel:b,onConfirm:m})}const qs="/api/public-mcp/candidate/search-visibility";function al(){const{isDark:n}=He(),[t,a]=i.useState(!0),[l,h]=i.useState(!1),[d,g]=i.useState(!1),[b,m]=i.useState({open:!1,message:"",severity:"success"});i.useEffect(()=>{let P=!0;return Le(qs,{cache:"no-store"}).then(v=>v.json()).then(v=>{P&&v&&v.ok&&a(v.visible!==!1)}).catch(()=>{}).finally(()=>{P&&h(!0)}),()=>{P=!1}},[]);const p=async P=>{g(!0),a(P);try{const v=await Le(qs,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({visible:P})}),V=await v.json().catch(()=>({}));if(!v.ok||!V.ok)throw new Error(V.error||"Could not save. Try again.");m({open:!0,severity:"success",message:P?"Companies can find your profile again (first name only).":"Companies searching from AI assistants will no longer see your profile."})}catch(v){a(!P),m({open:!0,severity:"error",message:v.message}),ct({area:"public_mcp",error:v,type:"Candidate search-visibility save failed",severity:"error",context:{next:P}})}finally{g(!1)}},C=n?r.white:r.black,H=n?r.grey:r.darkGrey,I=n?"rgba(255,255,255,0.10)":"rgba(0,0,0,0.07)",A=n?"rgba(255,255,255,0.04)":"rgba(0,0,0,0.025)";
25return e.jsxs(Z,{sx:{p:3,borderColor:I,boxShadow:n?"inset 0 1px 0 rgba(255,255,255,0.06)":"inset 0 1px 0 rgba(255,255,255,0.9)",backdropFilter:"blur(24px) saturate(180%)",WebkitBackdropFilter:"blur(24px) saturate(180%)"},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"flex-start",gap:1.5,mb:2},children:[e.jsx(s,{sx:{width:36,height:36,minWidth:36,borderRadius:"11px",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:A,border:`1px solid ${I}`},children:e.jsx(hi,{sx:{color:C,fontSize:19}})}),e.jsxs(s,{sx:{minWidth:0,flex:1},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,flexWrap:"wrap"},children:[e.jsx(o,{sx:{fontWeight:600,color:C,fontSize:"1.1rem",lineHeight:1.3},children:"Company search in AI assistants"}),l&&e.jsxs(s,{sx:{display:"inline-flex",alignItems:"center",gap:.85,px:1.1,py:.35,borderRadius:"999px",bgcolor:A,border:`1px solid ${I}`},children:[e.jsx(s,{sx:{width:7,height:7,borderRadius:"50%",bgcolor:t?r.green:r.greyMid,boxShadow:t?`0 0 0 3px ${r.green}22`:"none"}}),e.jsx(o,{sx:{fontSize:"0.72rem",fontWeight:600,color:C,lineHeight:1.2},children:t?"Visible":"Hidden"})]})]}),e.jsx(o,{sx:{fontSize:"0.8rem",color:H,mt:.25},children:"Hirexe client companies can search our talent from Claude or ChatGPT. To meet you, they ask Hirexe first."})]})]}),e.jsx(s,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"1fr 1fr"},gap:1,mb:1.5},children:[{title:"They see",text:"Your first name and profile photo, role, skills, years of experience and screening scores."},{title:"They never see",text:"Your surname, contact details, salary or employers."}].map(P=>e.jsxs(s,{sx:{px:1.75,py:1.25,borderRadius:"14px",bgcolor:A,border:`1px solid ${I}`},children:[e.jsx(o,{sx:{fontSize:"0.7rem",fontWeight:600,letterSpacing:"0.08em",textTransform:"uppercase",color:r.greyMid,mb:.35},children:P.title}),e.jsx(o,{sx:{fontSize:"0.82rem",lineHeight:1.45,color:C},children:P.text})]},P.title))}),e.jsx(ui,{label:"Show my profile in company searches (first name only)",description:t?"On: companies can find your profile, with your first name and photo but never your surname.":"Off: you are hidden from these searches. Hirexe can still put you forward for roles.",checked:t,disabled:!l||d,onChange:P=>p(P.target.checked),sx:{px:1.75,py:1.5,borderRadius:"14px",bgcolor:A,border:`1px solid ${I}`,"&:last-child":{borderBottom:`1px solid ${I}`}}}),e.jsx(jt,{open:b.open,message:b.message,severity:b.severity,onClose:()=>m({...b,open:!1})})]})}function ll({uid:n}){const{isDark:t}=He(),a=ut(),[l,h]=i.useState(!1),[d,g]=i.useState(null),[b,m]=i.useState({x:0,y:0}),[p,C]=i.useState(1),[H,I]=i.useState(null),A=i.useRef(null),[P,v]=i.useState(!0),[V,z]=i.useState(!1),[M,f]=i.useState(null),[E,$]=i.useState(!1),[F,D]=i.useState(""),[y,k]=i.useState([]),[T,j]=i.useState(null),[L,ee]=i.useState(null),[K,q]=i.useState(null),[N,_]=i.useState(""),[J,ce]=i.useState(""),[oe,ve]=i.useState(""),[ie,ae]=i.useState(""),[xe,fe]=i.useState(es()),[ke,G]=i.useState(""),[pe,Ee]=i.useState(""),[ze,Ze]=i.useState([]),ye=Ce(),Fe=i.useRef(),[Be,Ie]=i.useState(!1),[Ve,We]=i.useState(!1),[Ye,je]=i.useState({open:!1,message:"",severity:"info"}),Ne=(c,S="info")=>{je({open:!0,message:c,severity:S})},Je=()=>{je(c=>({...c,open:!1}))},ge=!!(T&&F&&L&&K&&J&&oe&&ie&&M),tt=()=>{li(n,{workStatus:E,username:F,noticePeriod:T,seeking:L,title:K,internetSpeed:J,typingSpeed:oe,typingAccuracy:ie,selectedImage:M,socialLinks:xe,phone:ke,address:pe,doneGroups:ze,setLoading:v}).then(()=>Ne("Profile settings saved successfully!","success")).catch(c=>{console.error(c),Ne(c.message||"Something went wrong","error")})},De={display:"flex",alignItems:"center",gap:1.5,mb:2.5},Pe=()=>{Ie(!0)},$e=()=>{We(!0),ci(n,{setLoading:We}).then(()=>{Ie(!1),Ne("Profile deleted successfully. Redirecting...","success"),setTimeout(()=>{a("/")},2e3)}).catch(c=>{console.error("Profile deletion error:",c),We(!1),Ne(c.message||"Failed to delete profile","error")})},O=c=>{if(!c)return;A.current=c;const S=new FileReader;S.onload=()=>{g(S.result),h(!0)},S.readAsDataURL(c)},w=c=>{c.preventDefault(),O(c.dataTransfer.files[0])},W=(c,S)=>{I(S)},te=async()=>{h(!1),z(!0);try{const c=await di(d,H),S=new File([c],A.current.name,{type:c.type});f(URL.createObjectURL(S));const B=await xi({target:{files:[S]}},n);f(B)}catch(c){console.error(c)}finally{z(!1),A.current=null}},de=()=>{h(!1),A.current=null};i.useEffect(()=>{si(n,{setWorkStatus:$,setUsername:D,setNoticePeriod:j,setSeeking:ee,setTitle:q,setInternetSpeed:ce,setTypingSpeed:ve,setTypingAccuracy:ae,setSelectedImage:f,setLoading:v,setSocialLinks:fe,setPhone:G,setAddress:Ee,setDoneGroups:Ze})},[n]),i.useEffect(()=>{let c=!0;return v(!0),ni().then(S=>c&&k(S)).catch(S=>console.error("Error loading titles:",S)).finally(()=>c&&v(!1)),()=>{c=!1}},[]);const x=async(c,S)=>{var B;fe(ne=>({...ne,[c]:S}));try{const ne=Se(ye,"users",n,"userData","data"),re=await Qe(ne),X=an((B=re.data())==null?void 0:B.socials,c,S);await Zt(ne,{socials:X},{merge:!0})}catch(ne){throw console.error("handleSocialSave failed:",ne),ne}};return e.jsxs(e.Fragment,{children:[e.jsx(il,{open:l,src:d,crop:b,zoom:p,onCropChange:m,onZoomChange:C,onCropComplete:W,onCancel:de,onConfirm:te}),P&&e.jsx(lt,{variant:"fullscreen",text:"Loading..."}),e.jsxs(Lt,{open:Be,onClose:()=>!Ve&&Ie(!1),PaperProps:{sx:{minWidth:{xs:"90%",sm:"400px"}}},children:[e.jsxs(fn,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[e.jsx(fo,{sx:{color:r.red,fontSize:28}}),"Delete Profile"]}),e.jsxs(Qt,{sx:{py:3},children:[e.jsx(o,{sx:{color:t?r.grey:r.darkGrey,fontSize:"0.95rem",lineHeight:1.6},children:"Are you sure you want to delete your profile? This action cannot be undone and will permanently remove all your data, including:"}),e.jsxs(s,{component:"ul",sx:{mt:2,pl:2,color:t?r.grey:r.darkGrey},children:[e.jsx("li",{children:"Profile information"}),e.jsx("li",{children:"Career Reel and videos"}),e.jsx("li",{children:"References and CV data"}),e.jsx("li",{children:"All account settings"})]})]}),e.jsxs(yr,{children:[e.jsx(U,{variant:"black",onClick:()=>Ie(!1),disabled:Ve,sx:{flex:1},children:"Cancel"}),e.jsx(U,{variant:"transparent",onClick:$e,disabled:Ve,sx:{flex:1,color:r.white,bgcolor:`${r.red}20`,borderColor:`${r.red}40`,"&:hover":{bgcolor:r.red,color:r.white,borderColor:r.red}},children:Ve?e.jsx(lt,{variant:"inline"}):"Delete Profile"})]})]}),e.jsx(jt,{open:Ye.open,onClose:Je,message:Ye.message,severity:Ye.severity}),e.jsxs(s,{sx:{width:"100%",minHeight:"100vh",backgroundColor:"transparent",overflowX:"hidden"},children:[e.jsx(s,{sx:{maxWidth:"1200px",mx:"auto",px:{xs:2,md:4},pt:3},children:e.jsx(Z,{sx:{py:2,px:{xs:2,md:3},borderRadius:"16px"},children:e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[e.jsx(s,{sx:{width:36,height:36,borderRadius:"10px",backgroundColor:t?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.05)",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(rn,{sx:{color:t?r.white:r.black,fontSize:20}})}),e.jsxs(s,{children:[e.jsx(o,{variant:"h5",sx:{fontWeight:600,color:t?r.white:r.black,fontSize:{xs:"1.1rem",md:"1.25rem"},lineHeight:1.3},children:"Profile Settings"}),e.jsx(o,{sx:{color:t?r.grey:r.darkGrey,fontSize:"0.8rem"},children:"Manage your profile information and preferences"})]}),e.jsx(U,{variant:"orange",startIcon:e.jsx(ri,{sx:{fontSize:18}}),disabled:!ge,onClick:tt,sx:{ml:"auto",whiteSpace:"nowrap"},children:"Save Changes"})]})})}),e.jsxs(s,{sx:{maxWidth:"1200px",mx:"auto",pt:3,pb:4,px:{xs:2,md:4}},children:[e.jsxs(Z,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},alignItems:{xs:"stretch",sm:"center"},gap:2,p:2.5,mb:2},children:[e.jsx(U,{variant:"orange",startIcon:e.jsx(ei,{sx:{fontSize:18}}),onClick:()=>{oi(n,{setLoading:v}).then(()=>{Ne("Profile update requested. Redirecting...","success"),setTimeout(()=>a("/dashboard/user"),1500)}).catch(c=>{console.error(c),Ne(c.message||"Something went wrong","error")})},children:"Make Changes"}),e.jsx(U,{variant:"transparent",startIcon:e.jsx(ti,{sx:{fontSize:18}}),onClick:Pe,sx:{ml:{sm:"auto"},color:r.red,borderColor:`${r.red}40`,"&:hover":{bgcolor:`${r.red}15`,color:r.red,borderColor:r.red}},children:"Delete Profile"})]}),e.jsxs(Z,{sx:{display:"flex",flexDirection:"column",gap:1,p:2,bgcolor:t?"rgba(215, 122, 46, 0.1)":"rgba(215, 122, 46, 0.06)",border:`1px solid ${t?"rgba(215, 122, 46, 0.25)":"rgba(215, 122, 46, 0.15)"}`,mb:3},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1,mb:.5},children:[e.jsx(Dn,{sx:{color:r.orange,fontSize:20}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"0.85rem"},children:"Tips"})]}),e.jsxs(o,{sx:{color:t?r.grey:r.darkGrey,fontSize:"0.8rem",pl:3.5},children:[e.jsx("strong",{children:"Make Changes"})," â Unlocks your profile for editing. Your profile will need to be re-approved after changes are saved."]}),e.jsxs(o,{sx:{color:t?r.grey:r.darkGrey,fontSize:"0.8rem",pl:3.5},children:[e.jsx("strong",{children:"Delete Profile"})," â Permanently removes your account and all associated data. This action cannot be undone."]}),e.jsxs(o,{sx:{color:t?r.grey:r.darkGrey,fontSize:"0.8rem",pl:3.5},children:[e.jsx("strong",{children:"Save Changes"})," â After updating any fields below, click the save button at the bottom to apply your changes."]})]}),e.jsxs(s,{sx:{display:"flex",flexDirection:{xs:"column",lg:"row"},gap:3},children:[e.jsxs(s,{sx:{width:{xs:"100%",lg:"35%"},display:"flex",flexDirection:"column",gap:3},children:[e.jsxs(Z,{sx:{p:3},children:[e.jsxs(s,{sx:De,children:[e.jsx(rs,{sx:{color:r.orange,fontSize:24}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem"},children:"Availability"})]}),e.jsxs(s,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",p:2,borderRadius:"12px",backgroundColor:t?"rgba(255,255,255,0.03)":"rgba(0,0,0,0.02)"},children:[e.jsxs(s,{children:[e.jsx(o,{sx:{fontWeight:500,color:t?r.white:r.black,fontSize:"0.95rem"},children:"Open to Work"}),e.jsx(o,{sx:{fontSize:"0.8rem",color:t?r.grey:r.darkGrey},children:"Let recruiters know you're available"})]}),e.jsx(Qo,{checked:E,onChange:c=>$(c.target.checked)})]})]}),e.jsxs(Z,{sx:{p:3},children:[e.jsxs(s,{sx:De,children:[e.jsx(pt,{sx:{color:r.orange,fontSize:24}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem"},children:"Profile Photo"})]}
25),e.jsxs(s,{component:"label",sx:{display:"block",cursor:"pointer"},children:[e.jsx("input",{ref:Fe,type:"file",accept:"image/*",hidden:!0,onChange:c=>{var S;return O((S=c.target.files)==null?void 0:S[0])}}),e.jsx(s,{onDragOver:c=>c.preventDefault(),onDrop:w,sx:{width:"100%",aspectRatio:"1",maxWidth:"300px",mx:"auto",borderRadius:"20px",overflow:"hidden",border:`2px dashed ${t?"rgba(255,255,255,0.15)":"rgba(0,0,0,0.15)"}`,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:t?"rgba(255,255,255,0.03)":"rgba(0,0,0,0.02)",position:"relative",transition:"all 0.3s ease","&:hover":{borderColor:r.orange,backgroundColor:t?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.04)"},"&:hover svg":{color:r.orange}},children:V?e.jsx(lt,{variant:"inline"}):M&&M!=="none"?e.jsx(Zr,{src:M,alt:"Profile",variant:"square",sx:{width:"100%",height:"100%",borderRadius:0,border:"none","& img":{objectFit:"cover"}}}):e.jsxs(s,{sx:{textAlign:"center",p:3},children:[e.jsx(pt,{sx:{width:80,height:80,color:t?r.grey:r.darkGrey,transition:"color 0.2s ease"}}),e.jsx(o,{sx:{mt:2,fontSize:"0.85rem",color:t?r.grey:r.darkGrey},children:"Click or drag to upload"})]})})]}),e.jsx(o,{sx:{mt:2,fontSize:"0.8rem",color:t?r.grey:r.darkGrey,textAlign:"center"},children:"Upload a professional photo for your profile"})]})]}),e.jsxs(s,{sx:{flex:1,display:"flex",flexDirection:"column",gap:3},children:[e.jsxs(s,{sx:{display:"flex",flexDirection:{xs:"column",lg:"row"},gap:3},children:[e.jsxs(Z,{sx:{p:3,flex:1},children:[e.jsxs(s,{sx:De,children:[e.jsx(pt,{sx:{color:r.orange,fontSize:24}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem"},children:"Basic Information"})]}),e.jsxs(s,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[e.jsx(Q,{fullWidth:!0,title:"Username",value:F,onChange:c=>D(c.target.value),placeholder:"Enter your username"}),e.jsxs(s,{children:[e.jsx(o,{sx:{mb:1,fontSize:"0.85rem",fontWeight:500,color:t?r.grey:r.darkGrey},children:"Professional Title"}),e.jsx(Jt,{options:y,freeSolo:!0,fullWidth:!0,loading:P,inputValue:N,value:K,noOptionsText:P?"Loading...":"No options available",onInputChange:(c,S)=>{_(S),y.some(B=>B.toLowerCase()===S.toLowerCase())||q(S)},onChange:(c,S)=>{typeof S=="string"?q(S):S&&S.inputValue?q(S.inputValue):q(S||"")},renderInput:c=>e.jsx(Q,{...c,placeholder:"Select or enter your title"})})]}),e.jsxs(s,{sx:{display:"flex",gap:2,flexDirection:{xs:"column",sm:"row"}},children:[e.jsxs(s,{sx:{flex:1},children:[e.jsx(o,{sx:{mb:1,fontSize:"0.85rem",fontWeight:500,color:t?r.grey:r.darkGrey},children:"Seeking"}),e.jsx(Jt,{options:ii,value:L,onChange:(c,S)=>ee(S),freeSolo:!0,fullWidth:!0,renderInput:c=>e.jsx(Q,{...c,placeholder:"Employment type"})})]}),e.jsxs(s,{sx:{flex:1},children:[e.jsx(o,{sx:{mb:1,fontSize:"0.85rem",fontWeight:500,color:t?r.grey:r.darkGrey},children:"Notice Period"}),e.jsx(Jt,{options:ai,value:T,onChange:(c,S)=>j(S),getOptionLabel:c=>c?c.label:"",isOptionEqualToValue:(c,S)=>(c==null?void 0:c.value)===(S==null?void 0:S.value),freeSolo:!1,fullWidth:!0,ListboxProps:{sx:{maxHeight:200,overflowY:"auto",overflowX:"hidden",...Ae(t)}},renderInput:c=>e.jsx(Q,{...c,placeholder:"Select notice period",inputProps:{...c.inputProps,readOnly:!0}})})]})]})]})]}),e.jsx(on,{socialLinks:xe,onSave:x,cardSx:{width:{xs:"100%",lg:"280px"},flexShrink:0,backgroundColor:t?"rgba(255,255,255,0.02)":"rgba(0,0,0,0.015)",border:`1px solid ${t?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.04)"}`,borderRadius:"16px",p:3}})]}),e.jsxs(Z,{sx:{p:3},children:[e.jsxs(s,{sx:De,children:[e.jsx(Do,{sx:{color:r.orange,fontSize:24}}),e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem"},children:"Technical Details"})]}),e.jsxs(s,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[e.jsxs(s,{children:[e.jsxs(s,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1},children:[e.jsx(o,{sx:{fontSize:"0.85rem",fontWeight:500,color:t?r.grey:r.darkGrey},children:"Internet Speed (Mbps)"}),e.jsx(o,{component:"a",href:"https://www.speedtest.net",target:"_blank",rel:"noopener noreferrer",sx:{fontSize:"0.75rem",color:r.orange,textDecoration:"none","&:hover":{textDecoration:"underline"}},children:"Test Speed"})]}),e.jsx(Q,{fullWidth:!0,type:"text",inputMode:"numeric",value:J,onChange:c=>{const S=c.target.value;if(/^\d*$/.test(S)){const B=Number(S);(S===""||B>=1&&B<1e5)&&ce(S)}},placeholder:"e.g. 100"})]}),e.jsxs(s,{sx:{display:"flex",gap:2,flexDirection:{xs:"column",sm:"row"}},children:[e.jsxs(s,{sx:{flex:1},children:[e.jsx(s,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1},children:e.jsx(o,{sx:{fontSize:"0.85rem",fontWeight:500,color:t?r.grey:r.darkGrey},children:"Typing Speed (WPM)"})}),e.jsx(Q,{fullWidth:!0,type:"text",inputMode:"numeric",value:oe,onChange:c=>{const S=c.target.value;if(/^\d*$/.test(S)){const B=Number(S);(S===""||B>=1&&B<5e3)&&ve(S)}},placeholder:"e.g. 68"})]}),e.jsxs(s,{sx:{flex:1},children:[e.jsx(o,{sx:{mb:1,fontSize:"0.85rem",fontWeight:500,color:t?r.grey:r.darkGrey},children:"Typing Accuracy (%)"}),e.jsx(Q,{fullWidth:!0,type:"text",inputMode:"numeric",value:ie,onChange:c=>{const S=c.target.value;if(/^\d*$/.test(S)){const B=Number(S);(S===""||B>=1&&B<=100)&&ae(S)}},placeholder:"e.g. 96"})]})]}),e.jsx(o,{component:"a",href:"https://monkeytype.com/",target:"_blank",rel:"noopener noreferrer",sx:{fontSize:"0.75rem",color:r.orange,textDecoration:"none",textAlign:"center","&:hover":{textDecoration:"underline"}},children:"Test your typing skills on MonkeyType"})]})]}),e.jsxs(Z,{sx:{p:3},children:[e.jsxs(s,{sx:De,children:[e.jsx(Zo,{sx:{color:r.orange,fontSize:24}}),e.jsxs(s,{sx:{minWidth:0},children:[e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem",lineHeight:1.3},children:"Contact Details"}),e.jsx(o,{sx:{fontSize:"0.8rem",color:t?r.grey:r.darkGrey},children:"Used by our team to contact you â never shown on your public ReelCV."})]})]}),e.jsxs(s,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx(Q,{fullWidth:!0,title:"Phone",type:"tel",value:ke,onChange:c=>G(c.target.value),placeholder:"e.g. +27 82 123 4567",inputProps:{inputMode:"tel",autoComplete:"tel"}}
25),e.jsx(Q,{fullWidth:!0,title:"Address",value:pe,onChange:c=>Ee(c.target.value),placeholder:"e.g. 1 Long St, Cape Town, South Africa",multiline:!0,rows:2,inputProps:{autoComplete:"street-address"},InputProps:{sx:{"& textarea":{...Ae(t)}}}})]})]}),e.jsxs(Z,{sx:{p:3},children:[e.jsxs(s,{sx:De,children:[e.jsx(po,{sx:{color:r.orange,fontSize:24}}),e.jsxs(s,{sx:{minWidth:0},children:[e.jsx(o,{sx:{fontWeight:600,color:t?r.white:r.black,fontSize:"1.1rem",lineHeight:1.3},children:"Experience Locations"}),e.jsx(o,{sx:{fontSize:"0.8rem",color:t?r.grey:r.darkGrey},children:"Country and work type for each role on your ReelCV."})]})]}),ze.length===0?e.jsx(o,{sx:{fontSize:"0.85rem",color:t?r.grey:r.darkGrey,fontStyle:"italic"},children:"No experience entries to edit yet."}):e.jsx(sn,{doneGroups:ze,onChange:Ze})]}),e.jsx(al,{}),e.jsx(s,{sx:{display:"flex",justifyContent:"flex-end"},children:e.jsx(U,{variant:"orange",disabled:!ge,onClick:tt,children:"Save Changes"})})]})]})]})]})]})}function cl(){const[n,t]=i.useState(null),[a,l]=i.useState(!0);if(i.useEffect(()=>{const d=Rt.currentUser;if(!d){l(!1);return}const g=Ce();Qe(Se(g,"users",d.uid)).then(b=>{if(b.exists()){const m=b.data();m.username&&t(m.username)}}).catch(b=>{console.error("Failed to fetch username:",b)}).finally(()=>{l(!1)})},[]),a)return null;if(!n)return e.jsx(lr,{to:"/login",replace:!0});const h=`${window.location.origin}/user/${n}`;return window.open(h,"_blank"),navigator.clipboard.writeText(h).catch(d=>console.error("Copy failed:",d)),e.jsx(lr,{to:"/dashboard/user/profile",replace:!0})}function dl(){const[n,t]=i.useState(null),[a,l]=i.useState(!0);if(i.useEffect(()=>{const d=Rt.currentUser;if(!d){l(!1);return}const g=Ce();Qe(Se(g,"users",d.uid)).then(b=>{if(b.exists()){const m=b.data();m.username&&t(m.username)}}).catch(b=>{console.error("Failed to fetch username:",b)}).finally(()=>{l(!1)})},[]),a)return null;if(!n)return e.jsx(lr,{to:"/login",replace:!0});const h=`${window.location.origin}/video/${n}`;return window.open(h,"_blank"),navigator.clipboard.writeText(h).catch(d=>console.error("Copy failed:",d)),e.jsx(lr,{to:"/dashboard/user/profile",replace:!0})}function xl({uid:n}){const{isDark:t}=He(),a=br("(max-width:480px)"),l=br("(max-width:768px)"),[h,d]=i.useState(!1),[g,b]=i.useState(""),[m,p]=i.useState({open:!1,message:"",severity:"success"}),C=async()=>{if(!g.trim()){p({open:!0,message:"Please write a testimonial before submitting",severity:"warning"});return}try{await fi(n,{testimonial:g,setLoading:d}),p({open:!0,message:"Thank you for your feedback!",severity:"success"}),b("")}catch(H){console.error(H),p({open:!0,message:H.message||"Something went wrong...",severity:"error"})}};return e.jsxs(s,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",minHeight:"100%",py:{xs:4,sm:6,lg:8},px:{xs:2,sm:3}},children:[e.jsxs(Z,{sx:{width:"100%",maxWidth:"560px",p:{xs:3,sm:4,lg:5},borderRadius:{xs:"20px",sm:"24px"},position:"relative",overflow:"hidden"},children:[e.jsx(gi,{sx:{position:"absolute",top:{xs:"-10px",sm:"-15px"},right:{xs:"-5px",sm:"-10px"},fontSize:{xs:120,sm:160,lg:200},color:t?"rgba(255,255,255,0.02)":"rgba(0,0,0,0.02)",transform:"rotate(180deg)",pointerEvents:"none"}}),e.jsxs(s,{sx:{display:"flex",flexDirection:"column",alignItems:"center",mb:{xs:3,sm:4},position:"relative",zIndex:1},children:[e.jsx(s,{sx:{width:{xs:52,sm:60},height:{xs:52,sm:60},borderRadius:"16px",backgroundColor:r.orange,display:"flex",alignItems:"center",justifyContent:"center",mb:2.5,boxShadow:"0 8px 24px rgba(255, 107, 0, 0.25)"},children:e.jsx(mi,{sx:{fontSize:{xs:26,sm:30},color:r.white}})}),e.jsx(o,{variant:"h2",sx:{fontWeight:700,color:t?r.white:r.black,fontSize:{xs:"1.5rem",sm:"1.75rem",lg:"2rem"},letterSpacing:"-0.02em",textAlign:"center",mb:1},children:"Share Your Experience"}),e.jsx(o,{sx:{color:t?"rgba(255,255,255,0.5)":"rgba(0,0,0,0.5)",fontSize:{xs:"0.8rem",sm:"0.85rem"},textAlign:"center",lineHeight:1.6,maxWidth:"380px"},children:"Your feedback helps us improve and shows other candidates what to expect from Hirexe."})]}),e.jsx(s,{sx:{display:"flex",flexWrap:"wrap",gap:1,justifyContent:"center",mb:{xs:3,sm:4}},children:["Shape the future","Your voice matters","Under 2 minutes"].map((H,I)=>e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:.75,px:1.5,py:.5,borderRadius:"20px",border:`1px solid ${t?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.08)"}`,backgroundColor:t?"rgba(255,255,255,0.03)":"rgba(0,0,0,0.02)"},children:[e.jsx(cr,{sx:{fontSize:13,color:r.orange}}),e.jsx(o,{sx:{color:t?"rgba(255,255,255,0.65)":"rgba(0,0,0,0.55)",fontSize:"0.72rem",fontWeight:500},children:H})]},I))}),e.jsx(Q,{multiline:!0,rows:a?5:l?6:7,fullWidth:!0,placeholder:"What has been your experience with Hirexe? Share your thoughts, suggestions, or feedback...",value:g,onChange:H=>b(H.target.value),inputProps:{maxLength:500},sx:{mb:1.5}}),e.jsxs(s,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:{xs:2.5,sm:3},flexWrap:"wrap",gap:1},children:[e.jsxs(o,{sx:{fontSize:"0.72rem",color:t?"rgba(255,255,255,0.35)":"rgba(0,0,0,0.35)",fontWeight:500},children:[g.length,"/500"]}),g.length>=50&&e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(cr,{sx:{fontSize:12,color:r.green}}),e.jsx(o,{sx:{fontSize:"0.72rem",color:r.green,fontWeight:500},children:"Ready to submit"})]})]}),e.jsx(U,{variant:"orange",disabled:h,onClick:C,sx:{width:"100%",height:{xs:"46px",sm:"50px"},fontSize:{xs:"0.85rem",sm:"0.9rem"},fontWeight:700,borderRadius:{xs:"12px",sm:"14px"},gap:1,"&:disabled":{opacity:.5,pointerEvents:"none"}},children:h?e.jsx(lt,{variant:"inline"}):e.jsxs(e.Fragment,{children:["Submit Testimonial",e.jsx(bi,{sx:{fontSize:{xs:16,sm:18}}})]})}),e.jsx(o,{sx:{mt:{xs:2,sm:2.5},fontSize:"0.68rem",color:t?"rgba(255,255,255,0.3)":"rgba(0,0,0,0.35)",textAlign:"center",lineHeight:1.6}
25,children:"By submitting, you agree that your testimonial may be featured on our website or marketing materials."})]}),e.jsx(jt,{open:m.open,onClose:()=>p({...m,open:!1}),message:m.message,severity:m.severity})]})}var ys={},pl=it;Object.defineProperty(ys,"__esModule",{value:!0});var An=ys.default=void 0,ul=pl(ot()),hl=e;An=ys.default=(0,ul.default)((0,hl.jsx)("path",{d:"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5zm-2 16-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9z"}),"VerifiedUser");const fl=[{icon:yi,text:"Include 2-3 professional references"},{icon:Ue,text:"Keep contact details current"},{icon:An,text:"Inform references before sharing"},{icon:rs,text:"Choose people who know your work"}],gl=()=>{const{isDark:n}=He();return e.jsx(s,{sx:{display:"flex",flexDirection:"column",alignItems:"center",width:"100%",minHeight:"100%",py:{xs:3,sm:4},px:{xs:2,sm:3}},children:e.jsxs(Z,{sx:{width:"100%",maxWidth:"700px",height:"95vh",p:{xs:3,sm:4},borderRadius:{xs:"20px",sm:"24px"},position:"relative",display:"flex",flexDirection:"column",overflow:"hidden"},children:[e.jsxs(s,{sx:{display:"flex",flexDirection:"column",alignItems:"center",mb:{xs:3,sm:4}},children:[e.jsx(nn,{icon:Sr,size:60,iconSize:30,sx:{mb:2.5}}),e.jsx(o,{variant:"h2",sx:{fontWeight:700,color:n?r.white:r.black,fontSize:{xs:"1.5rem",sm:"1.75rem",lg:"2rem"},letterSpacing:"-0.02em",textAlign:"center",mb:1},children:"Professional References"}),e.jsx(o,{sx:{color:n?"rgba(255,255,255,0.5)":"rgba(0,0,0,0.5)",fontSize:{xs:"0.8rem",sm:"0.85rem"},textAlign:"center",lineHeight:1.6,maxWidth:"440px"},children:"Manage your professional references. These can be extracted automatically from your CV or added manually."})]}),e.jsx(s,{sx:{display:"flex",flexWrap:"wrap",gap:1,justifyContent:"center",mb:{xs:3,sm:4}},children:fl.map((t,a)=>e.jsxs(ft,{sx:{display:"flex",alignItems:"center",gap:.75,px:1.5,py:.5,borderRadius:"20px"},children:[e.jsx(s,{sx:{color:r.orange,display:"flex",alignItems:"center","& svg":{fontSize:13}},children:e.jsx(t.icon,{})}),e.jsx(o,{sx:{color:n?"rgba(255,255,255,0.65)":"rgba(0,0,0,0.55)",fontSize:"0.72rem",fontWeight:500},children:t.text})]},a))}),e.jsx(s,{sx:{flex:1,display:"flex",flexDirection:"column",overflowY:"auto",minHeight:0,...Ae(n)},children:e.jsx(Sn,{})})]})})},ml={"@keyframes maRise":{from:{opacity:0,transform:"translateY(10px)"},to:{opacity:1,transform:"none"}},"@keyframes maPulse":{"0%":{boxShadow:"0 0 0 0 rgba(127,127,127,0.5)"},"80%, 100%":{boxShadow:"0 0 0 8px rgba(127,127,127,0)"}}},hr=n=>({text:n?r.white:r.black,muted:n?"rgba(255,255,255,0.72)":"rgba(0,0,0,0.66)",subdued:n?"rgba(255,255,255,0.5)":"rgba(0,0,0,0.48)",line:n?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.08)",ink:n?r.white:r.black,inkOn:n?r.black:r.white,rgb:n?"255,255,255":"0,0,0",green:n?"#7CF2A6":"#0a7a3a"}),Bt=(n,t=!0)=>({...mn(n,{strong:t}),...n?{}:{border:"1px solid rgba(0,0,0,0.07)"},borderRadius:"26px"}),_t=n=>({bgcolor:n?"rgba(255,255,255,0.05)":"rgba(255,255,255,0.75)",border:`1px solid ${n?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.07)"}`}),bl={in_review:{label:"In review",dot:"#f5b544",pulse:!0},approved:{label:"Approved",dot:"#00c853"},not_selected:{label:"Not selected",dot:"rgba(160,160,168,1)"},knocked_out:{label:"Not eligible",dot:"rgba(160,160,168,1)"},withdrawn:{label:"Withdrawn",dot:"rgba(160,160,168,1)"}},Lr=({status:n})=>{const{isDark:t}=He(),{text:a}=hr(t),l=bl[n]||{label:n,dot:"rgba(160,160,168,1)"};return e.jsxs(s,{component:"span",sx:{..._t(t),display:"inline-flex",alignItems:"center",gap:.8,height:30,px:1.4,borderRadius:"999px",fontSize:"0.78rem",fontWeight:700,color:a,whiteSpace:"nowrap",flexShrink:0},children:[e.jsx(s,{component:"span",sx:{width:7,height:7,borderRadius:"50%",bgcolor:l.dot,animation:l.pulse?"maPulse 1.8s ease-out infinite":"none"}}),l.label]})};Lr.propTypes={status:le.string};function En({app:n,overview:t}){const{isDark:a}=He(),{text:l,subdued:h,ink:d,inkOn:g,rgb:b,green:m}=hr(a),p=n.status==="approved",C=[{label:"Applied",state:"done",note:new Date(n.appliedAt).toLocaleDateString(void 0,{day:"numeric",month:"short"})},{label:"Recruiter review",state:p?"done":"now",note:p?"approved":"happening now"},{label:"Profile",state:t.profileDone?"done":p?"now":"next",note:t.profileDone?"complete":"before the video"},{label:"ReelCV video",state:t.videoRecorded?"done":p&&t.profileDone?"now":"next",note:t.videoRecorded?"recorded":"after approval"},{label:"Hirexe final checks",state:t.platformApproved?"done":t.videoRecorded?"now":"next",note:t.platformApproved?"you're live":"then we put you forward"}];return e.jsx(s,{component:"ol","aria-label":"Application progress",sx:{listStyle:"none",p:0,m:0,display:"grid",gridTemplateColumns:{xs:"1fr",md:"repeat(5, minmax(0, 1fr))"},gap:{xs:0,md:0}},children:C.map((H,I)=>{const A=I===C.length-1;return e.jsxs(s,{component:"li","aria-current":H.state==="now"?"step":void 0,sx:{position:"relative",display:"flex",flexDirection:{xs:"row",md:"column"},alignItems:{xs:"flex-start",md:"flex-start"},gap:{xs:1.5,md:1.25},pr:{md:1.5},pb:{xs:A?0:2,md:0}},children:[!A&&e.jsx(s,{"aria-hidden":!0,sx:{position:"absolute",borderRadius:2,bgcolor:H.state==="done"?`rgba(${b},0.55)`:`rgba(${b},0.12)`,top:{xs:30,md:14},bottom:{xs:2,md:"auto"},left:{xs:14,md:36},right:{md:8},width:{xs:2,md:"auto"},height:{xs:"auto",md:2}}}),e.jsx(s,{sx:{position:"relative",zIndex:1,width:30,height:30,borderRadius:"50%",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.76rem",fontWeight:800,...H.state==="done"?{bgcolor:d,c
25olor:g}:H.state==="now"?{bgcolor:a?"#1c1c20":"#fff",color:l,border:`2px solid ${d}`,animation:"maPulse 1.8s ease-out infinite"}:{bgcolor:a?"#151517":"#f4f4f5",color:h,border:`1.5px solid rgba(${b},0.15)`}},children:H.state==="done"?e.jsx(ss,{sx:{fontSize:17}}):I+1}),e.jsxs(s,{sx:{pt:{xs:.4,md:0}},children:[e.jsx(o,{sx:{fontWeight:800,fontSize:"0.9rem",color:H.state==="next"?h:l},children:H.label}),e.jsx(o,{sx:{fontSize:"0.76rem",fontWeight:H.state==="now"?700:500,color:H.state==="now"?m:h},children:H.note})]})]},H.label)})})}En.propTypes={app:le.shape({status:le.string,appliedAt:le.string}).isRequired,overview:le.shape({profileDone:le.bool,videoRecorded:le.bool,platformApproved:le.bool}).isRequired};function Ur({n,title:t,body:a,action:l,locked:h}){const{isDark:d}=He(),{text:g,muted:b,subdued:m,ink:p,inkOn:C}=hr(d);return e.jsxs(s,{sx:{..._t(d),display:"flex",alignItems:{xs:"flex-start",sm:"center"},gap:2,p:{xs:1.75,sm:2.25},borderRadius:"20px",flexDirection:{xs:"column",sm:"row"},opacity:h?.75:1},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1.75,flexGrow:1,minWidth:0}
25,children:[e.jsx(s,{sx:{width:42,height:42,borderRadius:"14px",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:800,...h?{bgcolor:d?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.05)",color:m}:{bgcolor:p,color:C}},children:h?e.jsx(yn,{sx:{fontSize:20}}):n}),e.jsxs(s,{sx:{minWidth:0},children:[e.jsx(o,{sx:{fontWeight:800,fontSize:"1rem",color:g},children:t}),e.jsx(o,{sx:{fontSize:"0.88rem",lineHeight:1.5,color:b},children:a})]})]}),h?e.jsx(o,{sx:{fontSize:"0.8rem",fontWeight:700,color:m,whiteSpace:"nowrap"},children:"Unlocks after your profile"}):l]})}Ur.propTypes={n:le.oneOfType([le.number,le.string]),title:le.string.isRequired,body:le.string,action:le.node,locked:le.bool};function Tn({isDark:n}){const{text:t,muted:a,subdued:l,rgb:h,green:d}=hr(n);return e.jsxs(s,{sx:{..._t(n),position:"relative",overflow:"hidden",borderRadius:"22px",p:{xs:2,sm:2.5},display:"flex",flexDirection:{xs:"column",md:"row"},alignItems:{md:"center"},gap:{xs:1.75,md:2.5},border:`1px solid rgba(${h},0.2)`,boxShadow:n?"inset 0 1px 0 rgba(255,255,255,0.1), 0 24px 60px -30px rgba(255,255,255,0.3)":"inset 0 1px 0 #fff, 0 24px 60px -30px rgba(0,0,0,0.35)"},children:[e.jsx(s,{"aria-hidden":!0,sx:{position:"absolute",top:-80,right:-60,width:240,height:240,borderRadius:"50%",background:`radial-gradient(circle, rgba(${h},${n?.1:.05}) 0%, transparent 65%)`,pointerEvents:"none"}}),e.jsxs(s,{sx:{position:"relative",flex:1,minWidth:0},children:[e.jsxs(s,{sx:{display:"inline-flex",alignItems:"center",gap:.6,height:24,px:1,mb:1,borderRadius:"999px",fontSize:"0.66rem",fontWeight:800,letterSpacing:"0.1em",textTransform:"uppercase",color:d,bgcolor:"rgba(0,200,83,0.1)",border:"1px solid rgba(0,200,83,0.3)"},children:[e.jsx(Ri,{sx:{fontSize:"13px !important"}}),"Recommended · 3 min"]}),e.jsx(o,{sx:{fontWeight:800,fontSize:{xs:"1.15rem",md:"1.25rem"},letterSpacing:"-0.02em",color:t},children:"Stand out while the recruiter reviews"}),e.jsx(o,{sx:{mt:.5,fontSize:"0.88rem",lineHeight:1.55,color:a},children:"Complete profiles are noticed first. Finish yours now and your video can start the moment you're approved."})]}),e.jsxs(s,{sx:{position:"relative",display:"flex",flexDirection:"column",alignItems:{xs:"stretch",md:"center"},gap:.5,flexShrink:0},children:[e.jsx(U,{component:Ft,to:"/dashboard/user/application/profile",endIcon:e.jsx(gn,{}),sx:{...Ht(n),borderRadius:"999px",px:3,py:1.25,fontSize:"0.95rem"},children:"Finish my profile"}),e.jsx(o,{sx:{fontSize:"0.72rem",color:l,textAlign:"center"},children:"A quick chat, no forms"})]})]})}Tn.propTypes={isDark:le.bool};const yl=()=>{const{isDark:n}=He(),t=ut(),[a,l]=i.useState(null),[h,d]=i.useState("");i.useEffect(()=>{document.title="My applications · Hirexe",ji().then(l).catch(y=>{d("We could not load your applications. Please refresh in a moment."),ct({area:"jobs",error:y,type:"My applications failed to load",severity:"error"})})},[]);const{text:g,muted:b,subdued:m,line:p,ink:C,green:H}=hr(n),I=(a==null?void 0:a.applications)||[],A=new Set(I.filter(y=>y.status!=="knocked_out").map(y=>y.jobSlug)),P=I.filter(y=>y.status!=="knocked_out"||!A.has(y.jobSlug)),v=(a==null?void 0:a.overview)||{},V=y=>y==="approved"?0:y==="in_review"?1:2,z=P.length?[...P].sort((y,k)=>V(y.status)-V(k.status))[0]:void 0,M=P.filter(y=>y!==z),f={m:0,fontSize:{xs:"1.45rem",md:"2rem"},fontWeight:800,letterSpacing:"-0.03em",lineHeight:1.12,color:g},E=(y,k,T)=>e.jsx(U,{component:Ft,to:y,startIcon:T,endIcon:e.jsx(gn,{}),sx:{...Ht(n),borderRadius:"999px",px:2.75,flexShrink:0,whiteSpace:"nowrap",width:{xs:"100%",sm:"auto"}},children:k}),$=(y,k)=>e.jsx(U,{variant:"transparent",component:Ft,to:y,sx:{..._t(n),borderRadius:"999px",px:2.5,minHeight:44,height:"auto",color:g,width:{xs:"100%",sm:"auto"}},children:k}),F=[{label:"Applications",value:P.filter(y=>y.status!=="knocked_out").length},{label:"In review",value:P.filter(y=>y.status==="in_review").length},{label:"Approved",value:P.filter(y=>y.status==="approved").length}],D=y=>y.status==="approved"?v.videoRecorded?e.jsxs(e.Fragment,{children:[e.jsx(o,{component:"h2",sx:f,children:v.platformApproved?"You're on Hirexe":"Video recorded"}),e.jsx(o,{sx:{color:b,lineHeight:1.6,maxWidth:680},children:v.platformApproved?"Your ReelCV is live and our recruiters can put you forward for this role and others.":"Our team is reviewing your ReelCV. Once it passes the final checks we put you forward for this role."})]}):e.jsxs(e.Fragment,{children:[e.jsxs(o,{component:"h2",sx:f,children:["You're through. ",v.profileDone?"Record your video.":"Two quick things left."]}),e.jsxs(s,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[!v.profileDone&&e.jsx(Ur,{n:1,title:"Finish your profile · 3 min",body:"A quick chat with our assistant.",action:E("/dashboard/user/application/profile","Finish my profile")}),e.jsx(Ur,{n:v.profileDone?1:2,locked:!v.profileDone,title:"Record your ReelCV video · 2 to 3 min",body:v.profileDone?"Somewhere quiet with good light. Talk about a result you're proud of.":"Unlocks as soon as your profile is finished.",action:e.jsx(U,{startIcon:e.jsx(Ci,{}),onClick:()=>t("/dashboard/user/achievement"),sx:{...Ht(n),borderRadius:"999px",px:2.75,flexShrink:0,width:{xs:"100%",sm:"auto"}},children:"Record now"})})]})]}):y.status==="in_review"?e.jsxs(e.Fragment,{children:[e.jsx(o,{component:"h2",sx:f,children:"A recruiter is reviewing your application"}),e.jsx(o,{sx:{color:b,lineHeight:1.6,fontSize:{xs:"0.95rem",md:"1.02rem"}},children:"We'll email you as soon as you're through."}),v.profileDone?e.jsxs(s,{sx:{..._t(n),display:"flex",alignItems:"center",gap:1.5,p:1.75,borderRadius:"18px"},children:[e.jsx(s,{sx:{width:32,height:32,borderRadius:"50%",bgcolor:"rgba(0,200,83,0.14)",border:"1px solid rgba(0,200,83,0.35)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(ss,{sx:{color:H,fontSize:19}})}),e.jsx(o,{sx:{fontWeight:700,color:g,fontSize:"0.94rem"},children:"Profile complete. Your video unlocks the moment you're approved."})]}):e.jsx(Tn,{isDark:n})]}):y.status==="knocked_out"?e.jsxs(e.Fragment,{children:[e.jsx(o,{component:"h2",sx:f,children:y.knockoutMessage||"This role needs something different"}),e.jsx(o,{sx:{color:b,lineHeight:1.6,maxWidth:680},children:"So we couldn't take this application. Finish your ReelCV and video and our team will c
25onsider you for other roles, the same as any Hirexe sign-up."}),e.jsxs(s,{sx:{display:"flex",gap:1.25,flexWrap:"wrap"},children:[E("/dashboard/user/setup","Finish my ReelCV"),$("/jobs","See other roles")]})]}):e.jsxs(e.Fragment,{children:[e.jsx(o,{component:"h2",sx:f,children:"Thank you for applying"}),e.jsx(o,{sx:{color:b,lineHeight:1.6,maxWidth:680},children:"We're sorry to say we have proceeded with another candidate for this role. Your profile stays saved, so applying to another role takes a minute."}),e.jsx(s,{children:E("/jobs","See other roles")})]});return e.jsxs(s,{sx:{...ml,position:"relative",zIndex:1,maxWidth:1120,mx:"auto",px:{xs:1.25,sm:2,md:4},pt:{xs:1.25,md:2.5},pb:"calc(48px + env(safe-area-inset-bottom))",textAlign:"left","& > .ma-top nav":{mb:{xs:2,md:3}},"@media (prefers-reduced-motion: reduce)":{"& *":{animation:"none !important"}}},children:[e.jsx(s,{className:"ma-top",children:e.jsx(Fr,{})}),e.jsxs(s,{sx:{display:"flex",alignItems:{xs:"stretch",sm:"flex-end"},justifyContent:"space-between",gap:2,mb:{xs:2,md:2.5},flexDirection:{xs:"column",sm:"row"},animation:"maRise .45s ease both"},children:[e.jsxs(s,{sx:{px:{xs:.5,sm:0}},children:[e.jsx(o,{component:"h1",sx:{m:0,fontSize:{xs:"1.75rem",md:"2.4rem"},fontWeight:800,letterSpacing:"-0.035em",color:g},children:"My applications"}),e.jsx(o,{sx:{color:m,fontSize:"0.92rem"},children:"Where each application stands, and what to do next."})]}),e.jsxs(s,{sx:{display:"flex",gap:1,alignItems:"stretch"},children:[a&&F.map(y=>e.jsxs(s,{sx:{...Bt(n,!1),borderRadius:"18px",px:{xs:1.25,sm:1.75},py:1,minWidth:{sm:92},flex:{xs:1,sm:"none"}},children:[e.jsx(o,{sx:{fontSize:{xs:"1.2rem",sm:"1.35rem"},fontWeight:800,letterSpacing:"-0.02em",color:g,lineHeight:1.2},children:y.value}),e.jsx(o,{sx:{fontSize:"0.72rem",fontWeight:600,color:m,whiteSpace:"nowrap"},children:y.label})]},y.label)),e.jsx(U,{variant:"transparent",component:Ft,to:"/jobs","aria-label":"Browse jobs",startIcon:e.jsx(ki,{}),sx:{...Bt(n,!1),borderRadius:"18px",px:2,minHeight:44,height:"auto",color:g,display:{xs:"none",sm:"inline-flex"}},children:"Browse jobs"})]})]}),h&&e.jsx(ts,{severity:"error",children:h}),!a&&!h&&e.jsx(s,{sx:{display:"flex",flexDirection:"column",gap:2},children:e.jsxs(s,{sx:{...Bt(n),p:{xs:2.25,md:4},display:"flex",flexDirection:"column",gap:2.5},children:[e.jsxs(s,{sx:{display:"flex",gap:1.5,alignItems:"center"},children:[e.jsx(yt,{variant:"rounded",width:52,height:52,sx:{borderRadius:"14px"}}),e.jsxs(s,{sx:{flex:1},children:[e.jsx(yt,{width:"40%",height:20}),e.jsx(yt,{width:"25%",height:14})]})]}),e.jsx(yt,{variant:"rounded",height:90,sx:{borderRadius:"18px"}}),e.jsx(yt,{width:"60%",height:30})]})}),a&&!z&&e.jsxs(s,{sx:{...Bt(n),p:{xs:3,md:5},display:"flex",flexDirection:"column",alignItems:{xs:"stretch",sm:"flex-start"},gap:1.5,animation:"maRise .45s ease both"},children:[e.jsx(s,{sx:{width:52,height:52,borderRadius:"16px",..._t(n),display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(zi,{sx:{color:g}})}),e.jsx(o,{sx:{fontWeight:800,fontSize:"1.25rem",color:g},children:"You haven't applied to a job yet"}),e.jsx(o,{sx:{color:b},children:"Applying takes about a minute: your CV fills in the form."}),E("/jobs","See open roles")]}),z&&e.jsxs(s,{component:"section","aria-label":`Your application for ${z.jobTitle}`,sx:{...Bt(n),p:{xs:2,sm:2.75,md:3.5},display:"flex",flexDirection:"column",gap:{xs:2.25,md:3},position:"relative",overflow:"hidden",mb:2,animation:"maRise .45s ease .05s both"},children:[e.jsx(s,{"aria-hidden":!0,sx:{position:"absolute",top:-160,right:-140,width:420,height:420,borderRadius:"50%",background:`radial-gradient(circle, ${n?"rgba(255,255,255,0.08)":"rgba(255,255,255,0.9)"} 0%, transparent 65%)`,pointerEvents:"none"}}),e.jsxs(s,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:1.5,position:"relative"},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1.5,minWidth:0},children:[e.jsx(Ws,{company:{name:"Hirexe"},size:48,radius:"14px"}),e.jsxs(s,{sx:{minWidth:0},children:[e.jsx(o,{component:z.jobSlug?Ft:"span",to:z.jobSlug?`/jobs/${z.jobSlug}`:void 0,sx:{display:"block",fontSize:{xs:"1.05rem",md:"1.2rem"},fontWeight:800,letterSpacing:"-0.015em",color:g,textDecoration:"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","&:hover":{textDecoration:z.jobSlug?"underline":"none"}},children:z.jobTitle}),e.jsxs(o,{sx:{fontSize:"0.82rem",color:m},children:["Applied ",new Date(z.appliedAt).toLocaleDateString(void 0,{day:"numeric",month:"long",year:"numeric"})]})]})]}),e.jsx(Lr,{status:z.status})]}),(z.status==="in_review"||z.status==="approved")&&e.jsx(s,{sx:{..._t(n),p:{xs:2,md:2.5},borderRadius:"20px",position:"relative"},children:e.jsx(En,{app:z,overview:v})}),e.jsx(s,{sx:{display:"flex",flexDirection:"column",gap:1.5,position:"relative"},children:D(z)})]}),M.length>0&&e.jsxs(s,{sx:{animation:"maRise .45s ease .1s both"},children:[e.jsx(o,{sx:{fontSize:"0.72rem",fontWeight:800,letterSpacing:"0.14em",color:m,mt:3,mb:1.25,px:.5},children:"OTHER APPLICATIONS"}),e.jsx(s,{sx:{...Bt(n,!1),borderRadius:"22px",overflow:"hidden"},children:M.map((y,k)=>e.jsxs(s,{component:y.jobSlug?Ft:"div",to:y.jobSlug?`/jobs/${y.jobSlug}`:void 0,sx:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:1.5,px:{xs:1.75,md:2.5},py:1.75,textDecoration:"none",borderTop:k?`1px solid ${p}`:"none",transition:"background .2s ease","&:hover":{bgcolor:n?"rgba(255,255,255,0.04)":"rgba(255,255,255,0.6)"},"&:hover .ma-chev":{transform:"translateX(2px)",color:C}},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1.5,minWidth:0},children:[e.jsx(Ws,{company:{name:"Hirexe"},size:40,radius:"12px"}),e.jsxs(s,{sx:{minWidth:0},children:[e.jsx(o,{sx:{fontWeight:700,fontSize:{xs:"0.92rem",md:"1rem"},color:g,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:y.jobTitle}),e.jsxs(o,{sx:{fontSize:"0.78rem",color:m},children:["Applied ",new Date(y.appliedAt).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"})]})]})]}),e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:.75,flexShrink:0},children:[e.jsx(Lr,{status:y.status}),y.jobSlug?e.jsx(Hi,{className:"ma-chev",sx:{color:m,transition:"transform .2s ease, color .2s ease",display:{xs:"none",sm:"block"}}}):null]})]},y.id))})]}),e.jsx(s,{sx:{display:{xs:"flex",sm:"none"},mt:2},children:$("/jobs","Browse jobs")})]})},jl=["Permanent","Contract","Remote","Compensation"],Mn=[[0,"Immediately"],[1,"1 week"],[2,"2 weeks"],[3,"3 weeks"],[4,"1 month"],[8,"2 months"],[12,"3 months"],[16,"4 months"],[-1,"1 calendar month"],[-2,"2 calendar months"],[-3,"3 calendar months"],[-4,"4 calendar months"]],Fn=n=>(Mn.find(([t])=>t===n)||[])[1]||null,wl=["expectedSalary","noticePeriod","workingHours","currentStatus","linkedin","internetSpeedDownload","typingSpeed","typingAccuracy","hobbies","phone","address","socials"],Sl=["Remote","Hybrid","On-site","Unknown"],kt=400,Ct=800,Yt=n=>{const t=String(n||"").trim().length;return t>=kt&&t<=Ct},Bs=n=>[!n.photoUrl&&"photo",!n.title&&"title",!(n.aboutConfirmed&&Yt(n.aboutMe))&&"aboutMe",!(n.whyConfirmed&&Yt(n.myFuture))&&"myFuture",!n.expectedSalary&&"expectedSalary",(n.noticePeriod===null||n.noticePeriod===void 0)&&"noticePeriod",!(n.workingHours||[]).length&&"workingHours",!n.currentStatus&&"currentStatus",!n.linkedin&&"linkedin",!n.internetSpeedDownload&&"internetSpeedDownload",!n.typingSpeed&&"typingSpeed",!n.typingAccuracy&&"typingAccuracy",(n.hobbies||[]).length<3&&"hobbies",!n.phone&&"phone",!n.address&&"address",(!n.workConfirmed||(n.workHistory||[]).some(t=>
25!t.jobTitle||!String(t.country||"").trim()||t.workType==="Unknown"))&&"workHistory",!n.educationConfirmed&&"education"].filter(Boolean);function vl(n,t){const a=(n||[]).map(l=>({referenceId:l.referenceId,referenceName:l.referenceName,priorRelationship:l.priorRelationship||"",emails:[...l.emails||[]],phoneNumbers:[...l.phoneNumbers||[]]}));return(t||[]).forEach(l=>{const h=String(l.referenceName||"").trim();if(!h)return;const d=a.find(b=>at(b.referenceName)===at(h)),g=(b,m)=>{const p=String(m||"").trim();p&&!b.some(C=>at(C)===at(p))&&b.push(p)};if(d)g(d.emails,l.email),g(d.phoneNumbers,l.phone),l.priorRelationship&&!d.priorRelationship&&(d.priorRelationship=l.priorRelationship);else{const b={referenceName:h,priorRelationship:l.priorRelationship||"",emails:[],phoneNumbers:[]};g(b.emails,l.email),g(b.phoneNumbers,l.phone),a.push(b)}}),a}const $r=n=>!!(n&&(n.github||n.instagram||n.x||(n.websites||[]).length));async function Ys(n){const t=await Le("/api/usersetup/ai/fetchJobCategory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jobTitle:n})});if(!t.ok)throw new Error("Please use a recognised job title, e.g. Executive Assistant.");const a=await t.json();return{title:a.jobTitle||n,jobCategory:a.category||""}}function kl(n){return new Promise((t,a)=>{const l=URL.createObjectURL(n),h=new Image;h.onload=()=>{const d=Math.min(h.width,h.height),g=Math.min(640,d),b=document.createElement("canvas");b.width=g,b.height=g,b.getContext("2d").drawImage(h,(h.width-d)/2,(h.height-d)/2,d,d,0,0,g,g),URL.revokeObjectURL(l),b.toBlob(m=>m?t(new File([m],"profile.jpg",{type:"image/jpeg"})):a(new Error("Could not read that photo.")),"image/jpeg",.88)},h.onerror=()=>{URL.revokeObjectURL(l),a(new Error("That file is not a photo we can read."))},h.src=l})}const Js=["Reading your answer","Checking your CV","Writing that up","Almost there"],Cl={"@keyframes pfRise":{from:{opacity:0,transform:"translateY(6px)"},to:{opacity:1,transform:"none"}},"@keyframes pfSpin":{to:{transform:"rotate(360deg)"}},"@keyframes pfShimmer":{from:{backgroundPosition:"200% 0"},to:{backgroundPosition:"-200% 0"}}},Xs=()=>({referenceName:"",priorRelationship:"",email:"",phone:""}),Hr=(n,t)=>JSON.stringify(n??null)===JSON.stringify(t??null),at=n=>String(n||"").toLowerCase().replace(/[^a-z0-9]+/g," ").trim(),Rl=/\b(change|edit|rewrite|re-?word|shorter|longer|different|update|redo|tweak|instead|another|fix|improve)\b/i,Ks=/^(yes|yep|use (it|this)|looks good|perfect|that'?s (right|great)|sure)\b/i,zl={height:"100vh","@supports (height: 100dvh)":{height:"100dvh"}},Tt=n=>({text:n?r.white:r.black,muted:n?"rgba(255,255,255,0.72)":"rgba(0,0,0,0.68)",subdued:n?"rgba(255,255,255,0.5)":"rgba(0,0,0,0.48)",line:n?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.08)",ink:n?r.white:r.black,inkOn:n?r.black:r.white}),or=n=>({...mn(n,{strong:!0}),...n?{}:{border:"1px solid rgba(0,0,0,0.07)"},borderRadius:"26px"}),Ot=n=>({bgcolor:n?"rgba(255,255,255,0.07)":"rgba(255,255,255,0.8)",border:`1px solid ${n?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.07)"}`}),Dr=(n,t)=>({expectedSalary:`Salary R${Math.round(t/1e3)}k pm`,noticePeriod:`Notice ${Fn(t)||t}`,workingHours:`Hours ${dn(t)||""}`,currentStatus:`Looking for ${t}`,linkedin:"LinkedIn added",internetSpeedDownload:`Internet ${t} Mbps`,typingSpeed:`Typing ${t} wpm`,typingAccuracy:`Accuracy ${t}%`,hobbies:`Hobbies ${Array.isArray(t)?t.join(", "):String(t||"")}`,phone:"Cell number",address:"Address",socials:"Your links",title:`Title ${t}`,aboutMe:"About me",myFuture:"My future",references:"References",workHistory:"Work history",qualifications:"Education",photo:"Profile photo"})[n]||n,Il=n=>Array.isArray(n)?n:typeof n=="string"?n.split(/[,;\n]+/).map(t=>t.trim()).filter(Boolean):n,Wl=["hobbies","workingHours"];function Kt({size:n=30,spinning:t=!1,isDark:a}){const l=a?"255,255,255":"0,0,0";return e.jsxs(s,{sx:{position:"relative",width:n,height:n,flexShrink:0},children:[t?e.jsx(s,{"aria-hidden":!0,sx:{position:"absolute",inset:-3,borderRadius:"50%",background:`conic-gradient(from 0deg, rgba(${l},0) 0deg, rgba(${l},0.35) 180deg, rgba(${l},1) 330deg, rgba(${l},0) 360deg)`,animation:"pfSpin 1s linear infinite",WebkitMask:"radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px))",mask:"radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px))"}}):null,e.jsx(s,{sx:{width:n,height:n,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:a?"rgba(255,255,255,0.1)":"rgba(255,255,255,0.95)",border:`1px solid rgba(${l},0.14)`,boxShadow:a?"inset 0 1px 0 rgba(255,255,255,0.2)":"inset 0 1px 0 #fff, 0 4px 12px -6px rgba(0,0,0,0.25)"},children:e.jsx(Ii,{sx:{color:a?r.white:r.black,fontSize:`${Math.round(n*.5)}px !important`}})})]})}Kt.propTypes={size:le.number,spinning:le.bool,isDark:le.bool};function Vr({isDark:n}){const[t,a]=i.useState(0);i.useEffect(()=>{const g=setInterval(()=>a(b=>Math.min(b+1,Js.length-1)),1400);return()=>clearInterval(g)},[]);const{subdued:l}=Tt(n),h=n?"255,255,255":"0,0,0",d={height:8,borderRadius:4,background:`linear-gradient(90deg, rgba(${h},0.06) 0%, rgba(${h},0.22) 50%, rgba(${h},0.06) 100%)`,backgroundSize:"200% 100%",animation:"pfShimmer 1.3s linear infinite"};return e.jsxs(s,{role:"status","aria-label":"The assistant is thinking",sx:{alignSelf:"flex-start",display:"flex",alignItems:"flex-end",gap:1,animation:"pfRise .25s ease both"},children:[e.jsx(Kt,{size:28,spinning:!0,isDark:n}),e.jsxs(s,{sx:{...Ot(n),width:{xs:200,sm:230},px:1.75,py:1.25,borderRadius:"20px 20px 20px 6px",display:"flex",flexDirection:"column",gap:.8},children:[e.jsxs(o,{sx:{fontSize:"0.76rem",fontWeight:700,color:l,animation:"pfRise .25s ease both"},children:[Js[t],"â¦"]},t),e.jsx(s,{sx:{...d,width:"92%"}}),e.jsx(s,{sx:{...d,width:"62%",animationDelay:".15s"}})]})]})}Vr.propTypes={isDark:le.bool};const _n=i.memo(function({messages:t,isDark:a}){const{text:l,subdued:h,ink:d,inkOn:g}=Tt(a);return t.map((b,m)=>{if(b.role==="saved")return e.jsxs(s,{sx:{alignSelf:"center",display:"flex",alignItems:"center",gap:.6,flexWrap:"wrap",justifyContent:"center",maxWidth:"100%",animation:"pfRise .3s ease both"},children:[e.jsx($i,{sx:{fontSize:15,color:a?"#7CF2A6":"#0a7a3a"}}),e.jsx(o,{sx:{fontSize:"0.72rem",fontWeight:700,color:h},children:"Saved to your profile:"}),b.items.map(C=>e.jsx(s,{component:"span",sx:{height:22,px:1,display:"inline-flex",alignItems:"center",borderRadius:"999px",fontSize:"0.72rem",fontWeight:700,color:l,bgcolor:"rgba(0,200,83,0.1)",border:"1px solid rgba(0,200,83,0.28)",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:C},C))]},m);const p=b.role==="user";return e.jsxs(s,{sx:{display:"flex",alignItems:"flex-end",gap:1,alignSelf:p?"flex-end":"flex-start",maxWidth:{xs:"88%",md:"74%"},flexDirection:p?"row-reverse":"row",animation:"pfRise .25s ease both"},children:[!p&&e.jsx(Kt,{size:28,isDark:a}),e.jsx(s,{sx:{px:1.75,py:1.1,fontSize:"0.94rem",lineHeight:1.55,whiteSpace:"pre-wrap",wordBreak:"break-word",textAlign:"left",borderRadius:p?"20px 20px 6px 20px":"20px 20px 20px 6px",...p?{bgcolor:d,c
25olor:g,fontWeight:600}:{...Ot(a),color:l}},children:b.content})]},m)})});_n.propTypes={messages:le.array.isRequired,isDark:le.bool};function On({isDark:n,busy:t,onSend:a,skipLabel:l,onSkip:h}){const[d,g]=i.useState(""),b=i.useRef(null),{text:m,subdued:p,ink:C,inkOn:H}=Tt(n),I=v=>{v&&(v.style.height="auto",v.style.height=`${Math.min(v.scrollHeight,140)}px`)};i.useEffect(()=>{I(b.current)},[d]);const A=()=>{a(d)&&g("")},P=!!d.trim()&&!t;return e.jsxs(s,{sx:{...Ot(n),display:"flex",alignItems:"flex-end",gap:1,p:"6px",pl:2,borderRadius:"24px",transition:"border-color .15s ease","&:focus-within":{borderColor:n?"rgba(255,255,255,0.3)":"rgba(0,0,0,0.22)"}},children:[e.jsx(s,{component:"textarea",ref:b,rows:1,value:d,onChange:v=>g(v.target.value),onKeyDown:v=>{v.key==="Enter"&&!v.shiftKey&&!v.nativeEvent.isComposing&&(v.preventDefault(),A())},placeholder:t?"One momentâ¦":"Type your answer","aria-label":"Your answer",enterKeyHint:"send",sx:{flex:1,minWidth:0,resize:"none",border:"none",outline:"none",bgcolor:"transparent",color:m,font:"inherit",fontSize:"0.95rem",lineHeight:1.45,py:"9px",maxHeight:140,overflowY:"auto","&::placeholder":{color:p,opacity:1},"@media (pointer: coarse)":{fontSize:"16px"}}}),l&&!t&&!d.trim()?e.jsx(s,{component:"button",type:"button",onClick:h,sx:{all:"unset",boxSizing:"border-box",flexShrink:0,height:38,px:1.75,borderRadius:"999px",cursor:"pointer",display:"flex",alignItems:"center",fontSize:"0.84rem",fontWeight:700,color:p,border:`1px solid ${n?"rgba(255,255,255,0.14)":"rgba(0,0,0,0.12)"}`,transition:"color .15s ease, background .15s ease","&:hover":{color:m,bgcolor:n?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.04)"},"&:focus-visible":{outline:`2px solid ${C}`,outlineOffset:2}},children:l}):null,e.jsx(s,{component:"button",type:"button","aria-label":"Send",onClick:A,disabled:!P,sx:{all:"unset",boxSizing:"border-box",flexShrink:0,width:38,height:38,borderRadius:"50%",cursor:P?"pointer":"default",display:"flex",alignItems:"center",justifyContent:"center",transition:"transform .15s ease, background .15s ease",bgcolor:P?C:n?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.08)",color:P?H:p,"&:active":{transform:P?"scale(0.92)":"none"},"&:focus-visible":{outline:`2px solid ${C}`,outlineOffset:2}},children:e.jsx(Pi,{sx:{fontSize:20}})})]})}On.propTypes={isDark:le.bool,busy:le.bool,onSend:le.func.isRequired,skipLabel:le.string,onSkip:le.func};function Nr({isDark:n,current:t,onDone:a,compact:l=!1}){const{text:h,muted:d,subdued:g,ink:b,rgb:m}={...Tt(n),rgb:n?"255,255,255":"0,0,0"},[p,C]=i.useState(t||""),[H,I]=i.useState(!1),[A,P]=i.useState(""),v=async V=>{var M,f;const z=(M=V.target.files)==null?void 0:M[0];if(V.target.value="",!!z){P(""),I(!0);try{const E=await kl(z);C(URL.createObjectURL(E));const $=(f=Rt.currentUser)==null?void 0:f.uid;if(!$)throw new Error("Please sign in again to add your photo.");const F=await xn({target:{files:[E]}},$);a(F)}catch(E){P(E.message||"Could not upload that photo.")}finally{I(!1)}}};return e.jsxs(s,{sx:{...Ot(n),display:"flex",alignItems:"center",gap:1.75,p:l?1.5:2,borderRadius:"22px",...l?{}:{alignSelf:"flex-start",ml:{md:4.5},width:{xs:"100%",md:"74%"},boxSizing:"border-box",animation:"pfRise .3s ease both"}},children:[e.jsxs(s,{sx:{position:"relative",width:72,height:72,borderRadius:"50%",flexShrink:0,overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:`rgba(${m},0.06)`,border:`1.5px dashed rgba(${m},0.25)`},children:[p?e.jsx(s,{component:"img",src:p,alt:"Your profile photo",sx:{width:"100%",height:"100%",objectFit:"cover"}}):e.jsx(Ps,{sx:{color:g,fontSize:28}}),H&&e.jsx(s,{"aria-hidden":!0,sx:{position:"absolute",inset:0,borderRadius:"50%",border:"2px solid transparent",borderTopColor:b,animation:"pfSpin 0.9s linear infinite"}})]}),e.jsxs(s,{sx:{minWidth:0,flex:1},children:[e.jsx(o,{sx:{fontWeight:800,color:h,fontSize:"0.92rem"},children:p?"Your profile photo":"Add your profile photo"}),e.jsx(o,{sx:{fontSize:"0.8rem",color:d,lineHeight:1.45},children:"Face and shoulders, good light, a friendly smile."}),A&&e.jsx(o,{role:"alert",sx:{fontSize:"0.78rem",color:r.red,mt:.5},children:A}),e.jsxs(Ln,{isDark:n,disabled:H,children:[e.jsx("input",{type:"file",accept:"image/*",onChange:v,disabled:H,style:{position:"absolute",inset:0,opacity:0,cursor:"pointer"},"aria-label":p?"Change photo":"Add photo"}),e.jsx(Ps,{sx:{fontSize:17}}),H?"Uploadingâ¦":p?"Change photo":"Take or choose a photo"]})]})]})}Nr.propTypes={isDark:le.bool,current:le.string,onDone:le.func.isRequired,compact:le.bool};function Ln({isDark:n,disabled:t,children:a}){return e.jsx(s,{component:"label",sx:{...Ht(n),position:"relative",overflow:"hidden",display:"inline-flex",alignItems:"center",gap:.75,mt:1,px:2,minHeight:38,borderRadius:"999px",fontSize:"0.84rem",cursor:t?"default":"pointer",opacity:t?.7:1},children:a})}Ln.propTypes={isDark:le.bool,disabled:le.bool,children:le.node};function Un({isDark:n,jobs:t}){const{text:a,subdued:l,line:h}=Tt(n);return t.map(d=>e.jsxs(s,{sx:{display:"flex",gap:1.25,alignItems:"flex-start",p:1.25,borderRadius:"14px",border:`1px solid ${h}`},children:[e.jsx(bn,{sx:{fontSize:18,color:l,mt:"2px"}}),e.jsxs(s,{sx:{minWidth:0,flex:1},children:[e.jsxs(o,{sx:{color:d.jobTitle?a:r.red,fontSize:"0.88rem",fontWeight:700},children:[d.jobTitle||"Job title missing",e.jsxs(s,{component:"span",sx:{color:l,fontWeight:500},children:[" · ",d.company||"Company"]})]}),e.jsx(o,{sx:{color:l,fontSize:"0.78rem"},children:[d.startDate&&`${d.startDate} â ${d.endDate||"now"}`,d.country||"Country?",d.workType&&d.workType!=="Unknown"?d.workType:"Remote / hybrid / on-site?"].filter(
25Boolean).join(" · ")})]})]},d.index))}function Vn({isDark:n,items:t}){const{text:a,subdued:l,line:h}=Tt(n);return t.length?t.map((d,g)=>e.jsxs(s,{sx:{display:"flex",gap:1.25,alignItems:"flex-start",p:1.25,borderRadius:"14px",border:`1px solid ${h}`},children:[e.jsx(Ei,{sx:{fontSize:18,color:l,mt:"2px"}}),e.jsxs(s,{sx:{minWidth:0,flex:1},children:[e.jsxs(o,{sx:{color:a,fontSize:"0.88rem",fontWeight:700},children:[d.qualification||"Qualification",d.fieldOfStudy?e.jsxs(s,{component:"span",sx:{color:l,fontWeight:500},children:[" · ",d.fieldOfStudy]}):null]}),e.jsx(o,{sx:{color:l,fontSize:"0.78rem"},children:[d.institution,d.country,(d.startYear||d.endYear)&&`${d.startYear||"?"} â ${d.endYear||"?"}`].filter(Boolean).join(" · ")})]})]},g)):e.jsx(o,{sx:{color:l,fontSize:"0.86rem",p:1.25,borderRadius:"14px",border:`1px dashed ${h}`},children:"No formal education listed"})}Un.propTypes={isDark:le.bool,jobs:le.array.isRequired};Vn.propTypes={isDark:le.bool,items:le.array.isRequired};const Ar=/^\s*skip\b/i,Pl=/^\s*(use (it|this)|yes|yep|sounds good|looks (good|right)|that'?s right)\b/i;function Nn({chips:n,isDark:t,disabled:a,onTap:l}){const{text:h,ink:d,inkOn:g}=Tt(t);return n.length?e.jsx(s,{role:"group","aria-label":"Quick answers",sx:{display:"flex",gap:.75,flexWrap:{xs:"nowrap",sm:"wrap"},overflowX:{xs:"auto",sm:"visible"},mx:{xs:-1.25,sm:0},px:{xs:1.25,sm:0},py:.25,"&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"},children:n.map((b,m)=>{const p=Pl.test(b);return e.jsx(s,{component:"button",type:"button",onClick:()=>l(b),disabled:a,sx:{flexShrink:0,height:38,px:1.75,borderRadius:"999px",fontFamily:"inherit",fontSize:"0.86rem",fontWeight:650,whiteSpace:"nowrap",cursor:"pointer",animation:"pfRise .25s ease both",animationDelay:`${Math.min(m,5)*35}ms`,transition:"background .15s ease, transform .15s ease, border-color .15s ease",...p?{bgcolor:d,color:g,border:"1px solid transparent",boxShadow:t?"0 6px 18px -8px rgba(255,255,255,0.45)":"0 6px 18px -8px rgba(0,0,0,0.45)"}:{color:h,background:t?"linear-gradient(180deg, rgba(255,255,255,0.11) 0%, rgba(255,255,255,0.045) 100%)":"linear-gradient(180deg, #ffffff 0%, rgba(255,255,255,0.75) 100%)",border:`1px solid ${t?"rgba(255,255,255,0.14)":"rgba(0,0,0,0.09)"}`,boxShadow:t?"inset 0 1px 0 rgba(255,255,255,0.12)":"inset 0 1px 0 #fff, 0 2px 8px -4px rgba(0,0,0,0.15)","&:hover":{borderColor:t?"rgba(255,255,255,0.3)":"rgba(0,0,0,0.2)"}},"&:active":{transform:"scale(0.96)"},"&:focus-visible":{outline:`2px solid ${d}`,outlineOffset:2},"&:disabled":{opacity:.5,cursor:"default"}},children:b},b)})}):null}Nn.propTypes={chips:le.array.isRequired,isDark:le.bool,disabled:le.bool,onTap:le.func.isRequired};const $l=()=>{const{isDark:n}=He(),[t,a]=i.useState(null),[l,h]=i.useState("assistant"),[d,g]=i.useState([]),[b,m]=i.useState([]),[p,C]=i.useState(null),[H,I]=i.useState("none"),[A,P]=i.useState(!1),v=br("(min-width:960px)"),V=br("(prefers-reduced-motion: reduce)"),[z,M]=i.useState(!1),[f,E]=i.useState(null),[$,F]=i.useState(!1),[D,y]=i.useState(""),k=i.useRef(null),T=i.useRef(!1),j=i.useRef(new Set),L=i.useRef(null),ee=i.useRef([]),K=x=>{ee.current=x,g(x)},{text:q,muted:N,subdued:_,line:J,ink:ce,inkOn:oe}=Tt(n),ve=x=>{var c,S,B,ne;return{aboutMe:x.aboutMe,myFuture:x.whyConfirmed||j.current.has("myFuture")?x.myFuture:"",references:x.references.length?x.references.map(re=>({...re,email:(re.emails||[]).join(", ")||re.email||"",phone:(re.phoneNumbers||[]).join(", ")||re.phone||""})):[Xs()],title:x.title||"",phone:x.phone||"",address:x.address||"",github:((c=x.socials)==null?void 0:c.github)||"",instagram:((S=x.socials)==null?void 0:S.instagram)||"",x:((B=x.socials)==null?void 0:B.x)||"",websites:(((ne=x.socials)==null?void 0:ne.websites)||[]).join(` 26`),workHistory:(x.workHistory||[]).map(re=>({...re})),qualifications:(x.qualifications||[]).map(re=>({...re})),expectedSalary:x.expectedSalary??"",noticePeriod:x.noticePeriod??"",workingHours:x.workingHours||[],currentStatus:x.currentStatus||"",linkedin:x.linkedin||"",internetSpeedDownload:x.internetSpeedDownload??"",typingSpeed:x.typingSpeed??"",typingAccuracy:x.typingAccuracy??"",hobbies:(x.hobbies||[]).join(", ")}},ie=({keepForm:x=!1}={})=>Si().then(({profile:c}
26)=>(L.current=c,a(c),x||E(ve(c)),c)),ae=x=>x.filter(c=>c.role==="user"||c.role==="assistant"),xe=async x=>{var c,S,B;K(x),m([]),M(!0),y("");try{const ne=await vi(ae(x)),re=L.current||{},X=ne.proposal||{},he={};if(wl.forEach(u=>{const R=Wl.includes(u)?Il(X[u]):X[u];if(!(R==null||Array.isArray(R)&&!R.length)){if(u==="socials"){if(!$r(R))return;const Y={github:R.github||void 0,instagram:R.instagram||void 0,x:R.x||void 0,websites:(R.websites||[]).length?R.websites:void 0};Hr(Y,re.socials)||(he.socials=Y);return}Hr(R,re[u])||(he[u]=R)}}),Array.isArray(X.references)&&X.references.length){const u=vl(re.references,X.references),R=Y=>(Y||[]).map(se=>[at(se.referenceName),(se.emails||[]).length,(se.phoneNumbers||[]).length]);Hr(R(u),R(re.references))||(he.references=u)}if(re.workConfirmed&&Array.isArray(X.workHistory)&&X.workHistory.length){const u=X.workHistory.filter(R=>{const Y=(re.workHistory||[]).find(se=>se.index===R.index)||{};return["country","workType","jobTitle"].some(se=>R[se]&&at(R[se])!==at(Y[se]))});u.length&&(he.workHistory=u)}const _e=((c=[...x].reverse().find(u=>u.role==="user"))==null?void 0:c.content)||"",Te=at(((S=[...x].reverse().find(u=>u.role==="assistant"))==null?void 0:S.content)||""),rt=u=>!!u&&Te.includes(at(u).slice(0,60));let st=null;Ks.test(_e.trim())&&(["aboutMe","myFuture"].forEach(u=>{!rt(X[u])||j.current.has(u)||(Yt(X[u])?(he[u]=X[u],j.current.add(u)):st||(st={k:u,n:String(X[u]).trim().length}),X[u]=null)}),rt(X.title)&&!j.current.has("title")&&(Object.assign(he,{title:X.title,...await Ys(X.title).catch(()=>({}))}),j.current.add("title"),X.title=null));let dt=[{role:"assistant",content:ne.reply}];if(Object.keys(he).length)try{await Is(he),dt=[{role:"saved",items:Object.entries(he).map(([u,R])=>Dr(u,R))},...dt],await ie().catch(()=>{})}catch(u){y(u.message||"Could not save that answer.")}K([...x,...dt]),m(ne.quickReplies||[]);const xt=((B=[...x].reverse().find(u=>u.role==="user"))==null?void 0:B.content)||"",ue=Rl.test(xt),ht=(u,R)=>{const Y=X[u];return!Y||Array.isArray(Y)&&!Y.length||(j.current.has(u)||!!R)&&(!ue||u!=="references"&&at(Y)===at(re[u]))?null:Y},gt={aboutMe:ht("aboutMe",re.aboutConfirmed),myFuture:ht("myFuture",re.whyConfirmed),references:null,title:X.title&&at(X.title)!==at(re.title)?X.title:null,workHistory:ht("workHistory",re.workConfirmed),qualifications:Array.isArray(X.qualifications)&&(!re.educationConfirmed||ue)&&!j.current.has("qualifications")?X.qualifications:null},mt=ne.widget||"none";mt==="workHistory"&&!gt.workHistory&&!re.workConfirmed&&(gt.workHistory=[]),mt==="education"&&!gt.qualifications&&!re.educationConfirmed&&(gt.qualifications=re.qualifications||[]),I(mt==="photo"&&!re.photoUrl?"photo":"none");const Nt=Object.values(gt).some(u=>u!=null);if(st){C(null),await xe([...x,...dt,{role:"user",content:`Please rewrite my ${st.k==="aboutMe"?"About me":"My future"} to between ${kt} and ${Ct} characters (it is ${st.n}).`}]);return}C(Nt?gt:null)}catch(ne){y("The assistant is unavailable right now. You can fill it in yourself instead."),ct({area:"jobs",error:ne,type:"Profile assistant turn failed",severity:"warning"})}finally{M(!1)}};i.useEffect(()=>{ie().then(x=>{T.current||(T.current=!0,(!x.profileDone||!Array.isArray(x.missing)&&Bs(x).length)&&xe([]))}).catch(x=>{y("We could not load your profile. Please refresh."),ct({area:"jobs",error:x,type:"Finish profile failed to load",severity:"error"})})},[]),i.useEffect(()=>{const x=k.current;x&&x.scrollTo({top:x.scrollHeight,behavior:V?"auto":"smooth"})},[d,z,$,p,V]);const fe=z||$,ke=x=>{const c=String(x||"").trim();return!c||fe?!1:p&&Ks.test(c)?(ze(c),!0):(C(null),xe([...ee.current,{role:"user",content:c}]),!0)},G=async(x,c)=>{const S={...x};Object.keys(S).forEach(B=>j.current.add(B)),F(!0),y("");try{S.title&&Object.assign(S,await Ys(S.title)),await Is(S);const B=await ie();C(null);const ne=[...ee.current,{role:"user",content:c||"Save that"},{role:"saved",items:Object.keys(S).filter(re=>!/Confirmed$|jobCategory/.test(re)).map(re=>Dr(re,S[re]))}];c||ne.splice(ne.length-2,1),c?xe(ne):B.profileDone?K([...ne,{role:"assistant",content:"Profile saved. Your video unlocks as soon as a recruiter approves you, or right away if you're already approved."}]):K(ne)}catch(B){y(B.message||"Could not save that."),(!B.status||B.status>=500)&&ct({area:"jobs",error:B,type:"Finish profile save failed",severity:"error"})}finally{F(!1)}}
26,pe=()=>((t==null?void 0:t.workHistory)||[]).map(x=>({...x,...Object.fromEntries(Object.entries(((p==null?void 0:p.workHistory)||[]).find(c=>c.index===x.index)||{}).filter(([,c])=>c!==null&&c!==""))})),Ee=()=>!!(p!=null&&p.workHistory)&&pe().some(x=>!String(x.country||"").trim()||!["Remote","Hybrid","On-site"].includes(x.workType)||!String(x.jobTitle||"").trim()),ze=x=>{if(!fe){if(p&&/^(use|yes|yep|sure|looks (good|right)|that'?s (right|great)|perfect)/i.test(x)){if(Ee()){C(null),xe([...ee.current,{role:"user",content:`${x}, but some jobs still need a country or whether they were remote, hybrid or on-site.`}]);return}const c=["aboutMe","myFuture"].find(B=>p[B]&&!Yt(p[B]));if(c){const B=String(p[c]).trim().length;C(null),xe([...ee.current,{role:"user",content:`Please rewrite my ${c==="aboutMe"?"About me":"My future"} to between ${kt} and ${Ct} characters (it is ${B}).`}]);return}const S={};p.aboutMe&&(S.aboutMe=p.aboutMe),p.myFuture&&(S.myFuture=p.myFuture),p.title&&(S.title=p.title),p.workHistory&&(p.workHistory.length&&(S.workHistory=p.workHistory),S.workHistoryConfirmed=!0),p.qualifications&&(S.qualifications=p.qualifications,S.educationConfirmed=!0),G(S,x);return}ke(x)}},Ze=i.useMemo(()=>{if(!t)return[];const x=new Set(Array.isArray(t.missing)?t.missing:Bs(t)),c=(...B)=>B.every(ne=>!x.has(ne)),S=t.workHistory||[];return[{label:"Profile photo",done:c("photo"),note:t.photoUrl?"added":"to do"},{label:"Professional title",done:c("title"),note:t.title||"to do"},{label:"About me",done:c("aboutMe"),note:c("aboutMe")?"done":t.aboutMe?"confirm · 400-800":"to do"},{label:"My future",done:c("myFuture"),note:c("myFuture")?"done":"6 weeks · 6 months · 6 years"},{label:"Expected salary",done:c("expectedSalary"),note:t.expectedSalary?`R${Math.round(t.expectedSalary/1e3)}k pm`:"to do"},{label:"Notice period",done:c("noticePeriod"),note:Fn(t.noticePeriod)||"to do"},{label:"Working hours",done:c("workingHours"),note:dn(t.workingHours)||"to do"},{label:"What you're after",done:c("currentStatus"),note:t.currentStatus||"to do"},{label:"LinkedIn",done:c("linkedin"),note:t.linkedin?"added":"required"},{label:"Internet and typing",done:c("internetSpeedDownload","typingSpeed","typingAccuracy"),note:t.internetSpeedDownload?`${t.internetSpeedDownload} Mbps${t.typingSpeed?` · ${t.typingSpeed} wpm`:""}${t.typingAccuracy?` · ${t.typingAccuracy}%`:""}`:"to do"},{label:"Hobbies",done:c("hobbies"),note:(t.hobbies||[]).length?`${t.hobbies.length} of 3-5`:"3 to 5"},{label:"Cell and address",done:c("phone","address"),note:c("phone","address")?"added":"to do"},{label:"Work history",done:c("workHistory"),note:c("workHistory")?`${S.length} checked`:S.length?`${S.length} to check`:"to check"},{label:"Education",done:c("education"),note:c("education")?"checked":"to check"},{label:"Other links",done:$r(t.socials),note:$r(t.socials)?"added":"optional",optional:!0},{label:"References",done:t.references.length>0,note:t.references.length?`${t.references.length} added`:"optional",optional:!0}]},[t,d]),ye=Ze.filter(x=>!x.optional),Fe=ye.filter(x=>x.done).length,Be=ye.length?Math.round(Fe/ye.length*100):0,Ie={...Cl,...zl,position:"relative",zIndex:1,maxWidth:1320,mx:"auto",boxSizing:"border-box",textAlign:"left",display:"flex",flexDirection:"column",px:{xs:1.25,sm:2,md:3},pt:{xs:1.25,md:2.5},pb:{xs:0,md:2.5},"& > .pf-top nav":{mb:{xs:1.25,md:2}},"@media (pointer: coarse)":{"& input, & textarea":{fontSize:"16px !important"}},"@media (prefers-reduced-motion: reduce)":{"& *":{animation:"none !important",transition:"none !important"}}};if(!t&&!D)return e.jsxs(s,{sx:Ie,children:[e.jsx(s,{className:"pf-top",children:e.jsx(Fr,{})}),e.jsxs(s,{sx:{flex:1,minHeight:0,display:"grid",gap:2.5,gridTemplateColumns:v?"300px minmax(0, 1fr)":"minmax(0, 1fr)",gridTemplateRows:v?"minmax(0, 1fr)":"auto minmax(0, 1fr)"},children:[e.jsxs(s,{sx:{...or(n),p:2.5,display:"flex",flexDirection:"column",gap:1.5},children:[e.jsx(yt,{width:"70%",height:26}),e.jsx(yt,{variant:"rounded",height:6,sx:{borderRadius:3,my:.5}}),v&&Array.from({length:8}).map((x,c)=>e.jsx(yt,{width:`${55+c*17%30}%`,height:14},c))]}),e.jsxs(s,{sx:{...or(n),p:2.5,display:"flex",flexDirection:"column",gap:2,borderBottomLeftRadius:{xs:0,md:26},borderBottomRightRadius:{xs:0,md:26}},children:[e.jsxs(s,{sx:{display:"flex",gap:1.25,alignItems:"center"},children:[e.jsx(Kt,{size:38,spinning:!0,isDark:n}),e.jsxs(s,{sx:{flex:1},children:[e.jsx(yt,{width:180,height:16}),e.jsx(yt,{width:230,height:12})]})]}),e.jsx(Vr,{isDark:n})]})]})]});const Ve=x=>e.jsx(o,{sx:{color:q,fontSize:"0.92rem",lineHeight:1.6,p:1.5,borderRadius:"14px",bgcolor:n?"rgba(0,0,0,0.25)":"rgba(255,255,255,0.9)",border:`1px solid ${J}`},children:x}),We=x=>e.jsx(o,{sx:{fontSize:"0.66rem",fontWeight:800,letterSpacing:"0.14em",color:_},children:x}),Ye=p&&!fe&&e.jsxs(s,{sx:{...Ot(n),alignSelf:"flex-start",ml:{md:4.5},width:{xs:"100%",md:"74%"},boxSizing:"border-box",p:{xs:1.5,sm:2},borderRadius:"22px",display:"flex",flexDirection:"column",gap:1.1,animation:"pfRise .3s ease both"},children:[p.title&&e.jsxs(e.Fragment,{children:[We("YOUR PROFESSIONAL TITLE"),Ve(p.title)]}),p.aboutMe&&e.jsxs(e.Fragment,{children:[We(`YOUR ABOUT ME · ${String(p.aboutMe).trim().length} OF ${kt}-${Ct} CHARACTERS`),Ve(p.aboutMe)]}),p.myFuture&&e.jsxs(e.Fragment,{children:[We(`MY FUTURE · ${String(p.myFuture).trim().length} OF ${kt}-${Ct} CHARACTERS`),Ve(p.myFuture)]}),p.workHistory&&e.jsxs(e.Fragment,{children:[We("YOUR WORK HISTORY"),e.jsx(Un,{isDark:n,jobs:pe()})]}
26),p.qualifications&&e.jsxs(e.Fragment,{children:[We("YOUR EDUCATION"),e.jsx(Vn,{isDark:n,items:p.qualifications})]}),p.references&&e.jsxs(e.Fragment,{children:[We("REFERENCES"),p.references.map((x,c)=>e.jsxs(s,{sx:{display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:.5,p:1.25,borderRadius:"14px",border:`1px solid ${J}`},children:[e.jsxs(o,{sx:{color:q,fontSize:"0.88rem",fontWeight:700},children:[x.referenceName,x.priorRelationship?e.jsxs(s,{component:"span",sx:{color:_,fontWeight:500},children:[" · ",x.priorRelationship]}):null]}),e.jsx(o,{sx:{color:x.email||x.phone?N:_,fontSize:"0.84rem"},children:x.email||x.phone||"no contact yet"})]},c))]}),e.jsxs(s,{sx:{display:"flex",gap:1,flexWrap:"wrap",mt:.25},children:[Ee()?e.jsx(o,{sx:{alignSelf:"center",fontSize:"0.84rem",color:N},children:"Tell me the country and whether each job was remote, hybrid or on-site."}):e.jsx(U,{disabled:$,startIcon:e.jsx(cr,{}),onClick:()=>ze(p.workHistory||p.qualifications?"Looks right":"Use it"),sx:{...Ht(n),borderRadius:"999px",px:2.25},children:p.workHistory||p.qualifications?"Looks right":"Use this"}),e.jsx(U,{variant:"transparent",startIcon:e.jsx(Di,{}),onClick:()=>{E(x=>({...x,...p.aboutMe?{aboutMe:p.aboutMe}:{},...p.myFuture?{myFuture:p.myFuture}:{},...p.title?{title:p.title}:{},...p.qualifications?{qualifications:p.qualifications.map(c=>({...c}))}:{}})),h("form")},sx:{borderRadius:"999px",minHeight:44,height:"auto",color:q},children:"Edit it myself"})]})]}),je=x=>c=>E(S=>({...S,[x]:c.target.value})),Ne=(x,c)=>S=>E(B=>({...B,references:B.references.map((ne,re)=>re===x?{...ne,[c]:S.target.value}:ne)})),Je=x=>E(c=>{const S=c.workingHours.includes(x);if(x==="any"||x==="sast_only")return{...c,workingHours:S?[]:[x]};const B=c.workingHours.filter(ne=>ne!=="any"&&ne!=="sast_only"&&ne!==x);return{...c,workingHours:S?B:[...B,x]}}),ge=(x,c)=>e.jsxs(s,{sx:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:1,mb:.75},children:[e.jsx(o,{sx:{fontSize:"0.84rem",fontWeight:800,color:q},children:x}),c&&e.jsx(o,{sx:{fontSize:"0.72rem",color:_,textAlign:"right"},children:c})]}),tt=()=>{const x=[[!String(f.linkedin||"").trim(),"Add your LinkedIn profile link. Recruiters need it, so it can't be skipped."],[!String(f.title||"").trim(),"Add your professional title."],[f.aboutMe.trim()&&!Yt(f.aboutMe),`About me needs ${kt} to ${Ct} characters.`],[f.myFuture.trim()&&!Yt(f.myFuture),`My future needs ${kt} to ${Ct} characters.`]].find(([c])=>c);if(x){y(x[1]);return}G({aboutMe:f.aboutMe,myFuture:f.myFuture,title:f.title,references:f.references.filter(c=>String(c.referenceName||"").trim()).map(c=>({...c,emails:c.email,phoneNumbers:c.phone})),expectedSalary:f.expectedSalary===""?null:f.expectedSalary,noticePeriod:f.noticePeriod===""?null:Number(f.noticePeriod),workingHours:f.workingHours,currentStatus:f.currentStatus||null,linkedin:f.linkedin,socials:{github:f.github,instagram:f.instagram,x:f.x,websites:f.websites.split(/[\n,]+/).map(c=>c.trim()).filter(Boolean)},internetSpeedDownload:f.internetSpeedDownload===""?null:f.internetSpeedDownload,typingSpeed:f.typingSpeed===""?null:f.typingSpeed,typingAccuracy:f.typingAccuracy===""?null:f.typingAccuracy,hobbies:f.hobbies.split(",").map(c=>c.trim()).filter(Boolean),phone:f.phone,address:f.address,...f.workHistory.length?{workHistory:f.workHistory.map(({index:c,country:S,workType:B,jobTitle:ne})=>({index:c,country:S,workType:B,jobTitle:ne}))}:{},workHistoryConfirmed:!0,qualifications:f.qualifications,educationConfirmed:!0})},De=(x,c)=>S=>E(B=>({...B,workHistory:B.workHistory.map((ne,re)=>re===x?{...ne,[c]:S.target.value}:ne)})),Pe=(x,c)=>S=>E(B=>({...B,qualifications:B.qualifications.map((ne,re)=>re===x?{...ne,[c]:S.target.value}:ne)})),$e=x=>e.jsx(s,{sx:{width:20,height:20,borderRadius:"50%",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",transition:"background .3s ease",...x?{bgcolor:ce}:{border:`1.5px dashed ${n?"rgba(255,255,255,0.3)":"rgba(0,0,0,0.25)"}`}},children:x?e.jsx(ss,{sx:{color:oe,fontSize:"13px !important"}}):null}),O=e.jsx(s,{sx:{height:6,borderRadius:3,bgcolor:n?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.08)",overflow:"hidden"},children:e.jsx(s,{sx:{height:"100%",width:`${Be}%`,bgcolor:ce,borderRadius:3,transition:"width .6s cubic-bezier(.2,.8,.2,1)"}})}),w=e.jsxs(s,{component:"ul",sx:{listStyle:"none",p:0,m:0},children:[Ze.map(x=>
26e.jsxs(s,{component:"li",sx:{display:"flex",alignItems:"center",gap:1.1,py:.8,borderBottom:`1px solid ${J}`},children:[$e(x.done),e.jsx(o,{sx:{flexGrow:1,fontWeight:700,fontSize:"0.84rem",color:x.done?q:N},children:x.label}),e.jsx(o,{sx:{fontSize:"0.72rem",color:_,textAlign:"right",maxWidth:130,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:x.note})]},x.label)),e.jsxs(s,{component:"li",sx:{display:"flex",alignItems:"center",gap:1.1,py:.8},children:[e.jsx(s,{sx:{width:20,height:20,borderRadius:"50%",bgcolor:n?"rgba(255,255,255,0.07)":"rgba(0,0,0,0.05)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(yn,{sx:{color:_,fontSize:12}})}),e.jsx(o,{sx:{flexGrow:1,fontWeight:700,fontSize:"0.84rem",color:_},children:"ReelCV video"}),e.jsx(o,{sx:{fontSize:"0.72rem",color:_},children:"after approval"})]})]}),W=e.jsx(s,{role:"group","aria-label":"How to fill it in",sx:{display:"grid",gridTemplateColumns:"1fr 1fr",p:"3px",gap:"3px",borderRadius:"999px",border:`1px solid ${J}`,bgcolor:n?"rgba(255,255,255,0.04)":"rgba(0,0,0,0.03)"},children:[["assistant","With the assistant"],["form","Fill it in myself"]].map(([x,c])=>e.jsx(s,{component:"button",type:"button","aria-pressed":l===x,onClick:()=>{h(x),P(!1)},sx:{height:36,px:1,borderRadius:"999px",border:"none",cursor:"pointer",fontFamily:"inherit",fontWeight:700,fontSize:"0.8rem",whiteSpace:"nowrap",transition:"background .2s ease",bgcolor:l===x?ce:"transparent",color:l===x?oe:N},children:c},x))}),te=v?e.jsxs(s,{component:"aside",sx:{...or(n),p:2.5,display:"flex",flexDirection:"column",gap:2,minHeight:0,overflowY:"auto",...Ae(n)},children:[e.jsxs(s,{children:[e.jsx(o,{component:"h1",sx:{m:0,fontSize:"1.45rem",fontWeight:800,letterSpacing:"-0.025em",color:q},children:"Finish your profile"}),e.jsx(o,{sx:{mt:.5,fontSize:"0.84rem",lineHeight:1.5,color:N},children:"About 3 minutes. You'll need it before you can record your video."})]}),e.jsxs(s,{children:[e.jsxs(s,{sx:{display:"flex",justifyContent:"space-between",alignItems:"baseline",mb:.75},children:[e.jsx(o,{sx:{fontWeight:800,color:q,fontSize:"0.9rem"},children:Be===100?"All done":`${ye.length-Fe} left`}),e.jsxs(o,{sx:{fontWeight:800,fontSize:"0.9rem",color:q},children:[Be,"%"]})]}),O]}),w,e.jsx(s,{sx:{mt:"auto"},children:W})]}):e.jsxs(s,{component:"aside",sx:{...or(n),borderRadius:"22px",p:1.5,display:"flex",flexDirection:"column",gap:1.25,flexShrink:0},children:[e.jsxs(s,{component:"button",type:"button","aria-expanded":A,onClick:()=>P(x=>!x),sx:{all:"unset",cursor:"pointer",display:"flex",flexDirection:"column",gap:.9,px:.5},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(o,{component:"h1",sx:{m:0,flex:1,fontSize:"1rem",fontWeight:800,letterSpacing:"-0.015em",color:q},children:"Finish your profile"}),e.jsxs(o,{sx:{fontSize:"0.78rem",fontWeight:700,color:N,whiteSpace:"nowrap"},children:[Fe," of ",ye.length]}),e.jsxs(s,{sx:{display:"inline-flex",alignItems:"center",gap:.25,fontSize:"0.76rem",fontWeight:700,color:_,whiteSpace:"nowrap"},children:[A?"Hide":"What's left",e.jsx(Ai,{sx:{fontSize:18,transition:"transform .2s ease",transform:A?"rotate(180deg)":"none"}})]})]}),O]}),A&&e.jsx(s,{sx:{maxHeight:"34vh",overflowY:"auto",overscrollBehavior:"contain",px:.5},children:w}),W]}),de=(t==null?void 0:t.profileDone)&&e.jsxs(s,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1.25,px:{xs:1.75,md:2.5},py:1.25,borderBottom:`1px solid ${J}`,bgcolor:"rgba(0,200,83,0.07)"},children:[e.jsx(cr,{sx:{color:n?"#7CF2A6":"#0a7a3a",fontSize:20}}),e.jsx(o,{sx:{flex:"1 1 200px",fontWeight:700,color:q,fontSize:"0.86rem"},children:"Profile saved. Your video unlocks once a recruiter approves you."}),e.jsx(U,{component:Ft,to:"/dashboard/user/application",sx:{...Ht(n),borderRadius:"999px",px:2,minHeight:36,py:.5,fontSize:"0.8rem"},children:"My application"})]});return e.jsxs(s,{sx:Ie,children:[e.jsx(s,{className:"pf-top",children:e.jsx(Fr,{})}),e.jsxs(s,{sx:v?{flex:1,minHeight:0,display:"grid",gridTemplateColumns:"300px minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",gap:2.5}:{flex:1,minHeight:0,display:"flex",flexDirection:"column",gap:1.25},children:[te,e.jsxs(s,{component:"section","aria-label":l==="assistant"?"Profile assistant":"Your profile",sx:{...or(n),flex:1,minHeight:0,display:"flex",flexDirection:"column",overflow:"hidden",...v?{}:{borderBottomLeftRadius:0,borderBottomRightRadius:0,borderBottom:"none"}},children:[de,l==="assistant"?e.jsxs(e.Fragment,{children:[e.jsxs(s,{sx:{px:{xs:1.75,md:2.5},py:{xs:1.25,md:1.5},display:"flex",alignItems:"center",gap:1.25,borderBottom:`1px solid ${J}`},children:[e.jsx(Kt,{size:v?38:32,spinning:z,isDark:n}),e.jsxs(s,{sx:{flex:1,minWidth:0},children:[e.jsx(o,{sx:{fontWeight:800,color:q,fontSize:{xs:"0.92rem",md:"1rem"}},children:"Your profile assistant"}),e.jsxs(o,{sx:{display:"flex",alignItems:"center",gap:.75,fontSize:"0.74rem",color:_,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[e.jsx(s,{component:"span",sx:{width:6,height:6,flexShrink:0,borderRadius:"50%",bgcolor:z?ce:"#00c853"}}),e.jsx(s,{component:"span",sx:{minWidth:0,color:"inherit",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:z?"Thinkingâ¦":v?"Hirexe assistant · you approve what gets saved":"You approve what gets saved"})]})]}),v&&e.jsxs(s,{sx:{...Ot(n),display:"flex",alignItems:"center",gap:.6,px:1.25,height:30,borderRadius:"999px"},children:[e.jsxs(o,{sx:{fontSize:"0.76rem",fontWeight:800,color:q},children:[Fe," of ",ye.length]}),e.jsx(o,{sx:{fontSize:"0.74rem",color:_},children:"done"})]})]}),e.jsxs(s,{ref:k,role:"log","aria-live":"polite",sx:{flex:1,minHeight:0,px:{xs:1.5,md:3},py:{xs:1.75,md:2.5},display:"flex",flexDirection:"column",gap:1.25,overflowY:"auto",overscrollBehavior:"contain",WebkitOverflowScrolling:"touch",...Ae(n)},children:[d.length===0&&!z&&(t==null?void 0:t.profileDone)&&e.jsxs(s,{sx:{m:"auto",maxWidth:400,textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:1.25,py:4},children:[e.jsx(Kt,{size:52,isDark:n}),e.jsx(o,{sx:{fontWeight:800,fontSize:"1.1rem",color:q},children:"Your profile is complete"}),e.jsx(o,{sx:{fontSize:"0.9rem",lineHeight:1.6,color:N},children:'Want to change something? Tell me below, or pick "Fill it in myself".'}),e.jsx(U,{onClick:()=>ke("I'd like to update my profile"),sx:{...Ht(n),borderRadius:"999px",px:2.5},children:"Update my profile"})]}),e.jsx(_n,{messages:d,isDark:n}),Ye,H==="photo"&&!fe&&e.jsx(Nr,{isDark:n,current:t.photoUrl,onDone:async()=>{I("none"),await ie().catch(()=>{}),xe([...ee.current,{role:"saved",items:[Dr("photo")]},{role:"user",content:"I've added my photo."}])}}),fe&&e.jsx(Vr,{isDark:n})]}),e.jsxs(s,{sx:{px:{xs:1.25,md:2}
26,pt:1.25,pb:{xs:"calc(10px + env(safe-area-inset-bottom))",md:2},borderTop:`1px solid ${J}`,display:"flex",flexDirection:"column",gap:1},children:[!fe&&e.jsx(Nn,{chips:b.filter(x=>!Ar.test(x)),isDark:n,disabled:$,onTap:ze}),e.jsx(On,{isDark:n,busy:fe,onSend:ke,skipLabel:b.find(x=>Ar.test(x))||null,onSkip:()=>ze(b.find(x=>Ar.test(x)))})]})]}):e.jsx(s,{sx:{flex:1,minHeight:0,overflowY:"auto",overscrollBehavior:"contain",...Ae(n)},children:e.jsxs(s,{sx:{maxWidth:760,p:{xs:2,md:3.25},pb:{xs:"calc(20px + env(safe-area-inset-bottom))",md:3.25},display:"flex",flexDirection:"column",gap:2.25},children:[e.jsxs(s,{children:[e.jsx(o,{component:"h2",sx:{m:0,fontSize:"1.2rem",fontWeight:800,color:q},children:"Your profile"}),e.jsx(o,{sx:{fontSize:"0.84rem",color:_},children:"Recruiters read this first, next to your video."})]}),e.jsx(Nr,{compact:!0,isDark:n,current:t.photoUrl,onDone:()=>ie({keepForm:!0}).catch(()=>{})}),e.jsxs(s,{children:[ge("Professional title","required · e.g. Executive Assistant"),e.jsx(Q,{value:f.title,onChange:je("title"),placeholder:"Your job title",inputProps:{"aria-label":"Professional title"},fullWidth:!0})]}),e.jsxs(s,{children:[ge("About me",`${f.aboutMe.trim().length} / ${kt}-${Ct} characters`),e.jsx(Q,{multiline:!0,minRows:4,value:f.aboutMe,onChange:je("aboutMe"),placeholder:"Two or three sentences about how you work and what you're good at.",inputProps:{"aria-label":"About me"},fullWidth:!0})]}),e.jsxs(s,{children:[ge("My future",`${f.myFuture.trim().length} / ${kt}-${Ct} characters`),e.jsx(Q,{multiline:!0,minRows:4,value:f.myFuture,onChange:je("myFuture"),placeholder:"Where do you see yourself in 6 weeks, 6 months and 6 years, and why?",inputProps:{"aria-label":"My future"},fullWidth:!0})]}),e.jsxs(s,{sx:{display:"grid",gap:2,gridTemplateColumns:{xs:"1fr",sm:"1fr 2fr"}},children:[e.jsxs(s,{children:[ge("Cell","required"),e.jsx(Q,{value:f.phone,onChange:je("phone"),type:"tel",placeholder:"+27 82 000 0000",inputProps:{"aria-label":"Cell",inputMode:"tel"},fullWidth:!0})]}),e.jsxs(s,{children:[ge("Address","required"),e.jsx(Q,{value:f.address,onChange:je("address"),placeholder:"Street, suburb, city",inputProps:{"aria-label":"Address"},fullWidth:!0})]})]}),e.jsxs(s,{sx:{display:"grid",gap:2,gridTemplateColumns:{xs:"1fr",sm:"1fr 1fr"}},children:[e.jsxs(s,{children:[ge("Expected salary","rand per month, CTC"),e.jsx(Q,{value:f.expectedSalary,onChange:x=>E(c=>({...c,expectedSalary:x.target.value.replace(/[^\d]/g,"")})),placeholder:"e.g. 35000",inputProps:{inputMode:"numeric","aria-label":"Expected salary"},fullWidth:!0})]}),e.jsxs(s,{children:[ge("Notice period"),e.jsxs(Wr,{value:f.noticePeriod,onChange:je("noticePeriod"),displayEmpty:!0,inputProps:{"aria-label":"Notice period"},children:[e.jsx(nr,{value:"",children:"Choose"}),Mn.map(([x,c])=>e.jsx(nr,{value:x,children:c},x))]})]}),e.jsxs(s,{children:[ge("What you're after"),e.jsxs(Wr,{value:f.currentStatus,onChange:je("currentStatus"),displayEmpty:!0,inputProps:{"aria-label":"What you're after"},children:[e.jsx(nr,{value:"",children:"Choose"}),jl.map(x=>e.jsx(nr,{value:x,children:x},x))]})]}),e.jsxs(s,{children:[ge("LinkedIn","required"),e.jsx(Q,{value:f.linkedin,onChange:je("linkedin"),placeholder:"linkedin.com/in/you",inputProps:{"aria-label":"LinkedIn"},fullWidth:!0})]})]}),e.jsxs(s,{children:[ge("Hours you can work","pick all that apply"),e.jsx(s,{sx:{display:"flex",gap:.75,flexWrap:"wrap"},children:cn.map(x=>{const c=f.workingHours.includes(x.key);return e.jsx(s,{component:"button",type:"button","aria-pressed":c,onClick:()=>Je(x.key),title:x.sastWindow,sx:{height:36,px:1.5,borderRadius:"999px",fontFamily:"inherit",fontSize:"0.8rem",fontWeight:700,cursor:"pointer",transition:"background .15s ease",...c?{border:"none",bgcolor:ce,color:oe}:{...Ot(n),color:N}},children:x.label},x.key)})})]}),e.jsx(s,{sx:{display:"grid",gap:2,gridTemplateColumns:{xs:"1fr 1fr",sm:"repeat(3, 1fr)"}},children:[["internetSpeedDownload","Internet (Mbps)","speedtest.net"],["typingSpeed","Typing (wpm)","monkeytype.com"],["typingAccuracy","Accuracy (%)",""]].map(([x,c,S])=>e.jsxs(s,{children:[ge(c,S),e.jsx(Q,{value:f[x],onChange:B=>E(ne=>({...ne,[x]:B.target.value.replace(/[^\d]/g,"")})),inputProps:{inputMode:"numeric","aria-label":c},fullWidth:!0})]},x))}),e.jsxs(s,{children:[ge("Other links","optional"),e.jsxs(s,{sx:{display:"grid",gap:1.25,gridTemplateColumns:{xs:"1fr",sm:"1fr 1fr"}},children:[e.jsx(Q,{value:f.github,onChange:je("github"),placeholder:"github.com/you",inputProps:{"aria-label":"GitHub"},fullWidth:!0}),e.jsx(Q,{value:f.instagram,onChange:je("instagram"),placeholder:"instagram.com/you",inputProps:{"aria-label":"Instagram"},fullWidth:!0}),e.jsx(Q,{value:f.x,onChange:je("x"),placeholder:"x.com/you",inputProps:{"aria-label":"X"},fullWidth:!0}),e.jsx(Q,{value:f.websites,onChange:je("websites"),placeholder:"Website or portfolio (one per line)",multiline:!0,minRows:1,inputProps:{"aria-label":"Websites"},fullWidth:!0})]})]}),e.jsxs(s,{children:[ge("Work history","from your CV · check country, type and title"),e.jsxs(s,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[f.workHistory.length===0&&e.jsx(o,{sx:{fontSize:"0.84rem",color:_},children:"No jobs were read from your CV."}),f.workHistory.map((x,c)=>e.jsxs(s,{sx:{p:1.5,borderRadius:"18px",border:`1px solid ${J}`,display:"grid",gridTemplateColumns:{xs:"1fr",sm:"1.3fr 1fr 1fr"},gap:1.25,alignItems:"center"},children:[e.jsxs(s,{sx:{gridColumn:"1 / -1",display:"flex",alignItems:"center",gap:1},children:[e.jsx(bn,{sx:{fontSize:17,color:_}}),e.jsxs(o,{sx:{fontSize:"0.86rem",fontWeight:800,color:q},children:[x.company||"Company",e.jsx(s,{component:"span",sx:{color:_,fontWeight:500},children:x.startDate?` · ${x.startDate} â ${x.endDate||"now"}`:""})]})]}),e.jsx(Q,{value:x.jobTitle,onChange:De(c,"jobTitle"),placeholder:"Job title",inputProps:{"aria-label":`Job title at ${x.company}`},fullWidth:!0}),e.jsx(Q,{value:x.country,onChange:De(c,"country"),placeholder:"Country",inputProps:{"aria-label":`Country for ${x.company}`},fullWidth:!0}),e.jsx(Wr,{value:x.workType||"Unknown",onChange:De(c,"workType"),inputProps:{"aria-label":`Work type at ${x.company}`},children:Sl.map(S=>e.jsx(nr,{value:S,children:S==="Unknown"?"Remote / hybrid / on-site?":S},S))})]},x.index))]})]}),e.jsxs(s,{children:[ge("Education","leave empty if none"),e.jsx(s,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:f.qualifications.map((x,c)=>e.jsxs(s,{sx:{position:"relative",p:1.5,pr:{xs:1.5,sm:5.5},borderRadius:"18px",border:`1px solid ${J}`,display:"grid",gridTemplateColumns:{xs:"1fr 1fr",sm:"1.2fr 1.2fr 1fr"},gap:1.25},children:[e.jsx(s,{sx:{gridColumn:{xs:"1 / -1",sm:"auto"}},children:e.jsx(Q,{value:x.qualification,onChange:Pe(c,"qualification"),placeholder:"Qualification, e.g. BCom",inputProps:{"aria-label":`Qualification ${c+1}`},fullWidth:!0})}),e.jsx(s,{sx:{gridColumn:{xs:"1 / -1",sm:"auto"}},children:e.jsx(Q,{value:x.institution,onChange:Pe(c,"institution"),placeholder:"Institution",inputProps:{"aria-label":`Institution ${c+1}`},fullWidth:!0})}),e.jsx(s,{sx:{gridColumn:{xs:"1 / -1",sm:"auto"}},children:e.jsx(Q,{value:x.fieldOfStudy,onChange:Pe(c,"fieldOfStudy"),placeholder:"Field of study",inputProps:{"aria-label":`Field of study ${c+1}`},fullWidth:!0})}),e.jsx(Q,{value:x.country,onChange:Pe(c,"country"),placeholder:"Country",inputProps:{"aria-label":`Country ${c+1}`},fullWidth:!0}),e.jsx(Q,{value:x.startYear??"",onChange:Pe(c,"startYear"),placeholder:"Start year",inputProps:{inputMode:"numeric","aria-label":`Start year ${c+1}`},fullWidth:!0}),e.jsx(Q,{value:x.endYear??"",onChange:Pe(c,"endYear"),placeholder:"End year",inputProps:{inputMode:"numeric","aria-label":`End year ${c+1}`},fullWidth:!0}),e.jsx(s,{component:"button",type:"button","aria-label":`Remove qualification ${c+1}`,onClick:()=>E(S=>({...S,qualifications:S.qualifications.filter((B,ne)=>ne!==c)})),sx:{all:"unset",cursor:"pointer",position:{sm:"absolute"}
26,top:12,right:10,width:34,height:34,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",color:_,"&:hover":{color:q,bgcolor:n?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.05)"}},children:e.jsx(wi,{sx:{fontSize:18}})})]},c))}),e.jsx(U,{variant:"transparent",startIcon:e.jsx(Wi,{}),onClick:()=>E(x=>({...x,qualifications:[...x.qualifications,{institution:"",qualification:"",fieldOfStudy:"",country:"",startYear:"",endYear:""}]})),sx:{mt:1.25,borderRadius:"999px",minHeight:40,height:"auto",color:q},children:"Add a qualification"})]}),e.jsxs(s,{children:[ge("Hobbies","3 to 5, separated by commas"),e.jsx(Q,{value:f.hobbies,onChange:je("hobbies"),placeholder:"e.g. Hiking, Reading, Padel",inputProps:{"aria-label":"Hobbies"},fullWidth:!0})]}),e.jsxs(s,{children:[ge("References","optional · we only contact them with your OK"),e.jsx(s,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:f.references.map((x,c)=>e.jsxs(s,{sx:{p:1.5,borderRadius:"18px",border:`1px solid ${J}`,display:"grid",gridTemplateColumns:{xs:"1fr",sm:"1fr 1fr"},gap:1.25},children:[e.jsx(Q,{value:x.referenceName,onChange:Ne(c,"referenceName"),placeholder:"Name",inputProps:{"aria-label":`Reference ${c+1} name`},fullWidth:!0}),e.jsx(Q,{value:x.priorRelationship,onChange:Ne(c,"priorRelationship"),placeholder:"Relationship, e.g. former CEO",inputProps:{"aria-label":`Reference ${c+1} relationship`},fullWidth:!0}),e.jsx(Q,{value:x.email,onChange:Ne(c,"email"),placeholder:"Email(s), separated by commas",inputProps:{"aria-label":`Reference ${c+1} email`},fullWidth:!0}),e.jsx(Q,{value:x.phone,onChange:Ne(c,"phone"),placeholder:"Cell(s), separated by commas",type:"tel",inputProps:{"aria-label":`Reference ${c+1} cell`},fullWidth:!0})]},x.referenceId||c))}),f.references.length<3&&e.jsx(U,{variant:"transparent",onClick:()=>E(x=>({...x,references:[...x.references,Xs()]})),sx:{mt:1.25,borderRadius:"999px",minHeight:40,height:"auto",color:q},children:"+ Add a reference"})]}),e.jsx(U,{disabled:$,onClick:tt,sx:{...Ht(n),alignSelf:{xs:"stretch",sm:"flex-start"},borderRadius:"999px",px:4,py:1.25},children:$?"Savingâ¦":"Save my profile"})]})}),D&&e.jsx(s,{sx:{p:1.5},children:e.jsx(ts,{severity:"error",onClose:()=>y(""),children:D})})]})]})]})};function Zd(){const{isDark:n,toggleDarkMode:t}=He(),a=ut(),l=so(),h=Rt.currentUser,d=l.pathname.split("/").pop(),g=d==="details",b=d==="cvupload",m=d==="background",p=d==="personal",C=d==="achievement",H=d==="check",I=d==="setup",A=l.pathname.startsWith("/dashboard/user/application"),P=l.pathname.startsWith("/dashboard/user/application/profile"),[v,V]=i.useState(window.innerWidth<1e3),[z,M]=i.useState(!0),[f,E]=i.useState(!1),[$,F]=i.useState(null),[D,y]=i.useState({open:!1,message:"",severity:"success"}),k=i.useRef(null),T=i.useRef(null),j=Ce(),L=d==="profile";i.useEffect(()=>{const J=()=>{const ce=window.innerWidth<1e3;V(ce),ce||M(!0)};return window.addEventListener("resize",J),J(),()=>window.removeEventListener("resize",J)},[]),i.useEffect(()=>{const J=T.current,ce=k.current;J&&(J.style.transform="translateX(0px)"),ce&&(ce.scrollTop=0)},[l.pathname]),i.useEffect(()=>{const J=k.current,ce=T.current;if(!J||!ce)return;let oe=!1;const ve=()=>{oe||(oe=!0,requestAnimationFrame(()=>{const ie=J.scrollHeight-J.clientHeight;if(ie>0){const ae=J.scrollTop/ie,xe=window.innerWidth,fe=Math.min(xe*.95,1500),ke=xe>=1200?400:xe>=900?300:xe>=600?200:150,G=Math.max(0,xe-fe+2*ke);ce.style.transform=`translateX(${ae*G}px)`}oe=!1}))};return J.addEventListener("scroll",ve,{passive:!0}),()=>J.removeEventListener("scroll",ve)},[]),i.useEffect(()=>{if(!L||!h)return;(async()=>{try{const ce=await Qe(Se(j,"users",h.uid));ce.exists()&&F(ce.data().username)}catch(ce){console.error("Failed to fetch username:",ce)}})()},[L,h,j]);const ee=()=>{if(!$){y({open:!0,message:"Unable to share profile. Username not found.",severity:"error"});return}const J=`${window.location.origin}/user/${$}`;window.open(J,"_blank"),navigator.clipboard.writeText(J).then(()=>{y({open:!0,message:"Profile link copied to clipboard!",severity:"success"})}).catch(ce=>{console.error("Clipboard write failed:",ce),y({open:!0,message:"Profile opened in new tab",severity:"info"})})},K=async()=>{try{localStorage.removeItem("hirexe_role"),await Qs(Rt),a("/")}catch(J){console.error("Logout failed:",J)}
26},q=[{title:null,items:[{label:"My Profile",icon:e.jsx(lo,{}),tab:"profile"}]},{title:"Profile",items:[{label:"Settings",icon:e.jsx(rn,{}),tab:"settings"},{label:"References",icon:e.jsx(Sr,{}),tab:"references"}]}],N={label:"Testimonials",icon:e.jsx(co,{}),tab:"testimonials"},_=J=>{v&&E(!1),a(`/dashboard/user/${J}`)};return g?e.jsxs(wt,{children:[e.jsx(i.Suspense,{fallback:e.jsx(bt,{variant:"fullscreen"}),children:e.jsx(Hs,{uid:h.uid})}),e.jsx(Wt,{})]}):b?e.jsxs(wt,{children:[e.jsx(i.Suspense,{fallback:e.jsx(bt,{variant:"fullscreen"}),children:e.jsx(Ts,{uid:h.uid})}),e.jsx(Wt,{})]}):m?e.jsxs(wt,{children:[e.jsx(i.Suspense,{fallback:e.jsx(bt,{variant:"fullscreen"}),children:e.jsx(Ms,{uid:h.uid})}),e.jsx(Wt,{})]}):p?e.jsxs(wt,{children:[e.jsx(i.Suspense,{fallback:e.jsx(bt,{variant:"fullscreen"}),children:e.jsx(Fs,{uid:h.uid})}),e.jsx(Wt,{})]}):C?e.jsxs(wt,{children:[e.jsx(i.Suspense,{fallback:e.jsx(bt,{variant:"fullscreen"}),children:e.jsx(Vs,{uid:h.uid})}),e.jsx(Wt,{})]}):H?e.jsxs(wt,{children:[e.jsx(i.Suspense,{fallback:e.jsx(bt,{variant:"fullscreen"}),children:e.jsx(Gs,{uid:h.uid})}),e.jsx(Wt,{})]}):A?e.jsxs(wt,{children:[e.jsx(zt,{}),e.jsx(i.Suspense,{fallback:e.jsx(bt,{variant:"fullscreen"}),children:P?e.jsx($l,{}):e.jsx(yl,{})}),e.jsx(Wt,{})]}):I?e.jsxs(wt,{children:[e.jsx(i.Suspense,{fallback:e.jsx(bt,{variant:"fullscreen"}),children:e.jsx(_r,{uid:h.uid})}),e.jsx(Wt,{})]}):e.jsxs(wt,{children:[e.jsx(s,{ref:T,sx:{position:"fixed",top:{xs:"-100px",sm:"-150px",md:"-200px",lg:"-250px"},left:{xs:"-150px",sm:"-200px",md:"-300px",lg:"-400px"},zIndex:0,pointerEvents:"none",willChange:"transform",backfaceVisibility:"hidden"},children:e.jsx(Et,{backgroundMode:!0,scrollContainerRef:k})}),e.jsx(zt,{}),e.jsx(s,{sx:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:0,pointerEvents:"none",willChange:"transform",backfaceVisibility:"hidden",backgroundImage:n?"radial-gradient(circle at 1px 1px, rgba(255,255,255,0.04) 1px, transparent 0)":"radial-gradient(circle at 1px 1px, rgba(0,0,0,0.03) 1px, transparent 0)",backgroundSize:"40px 40px"}}),e.jsxs(s,{display:"flex",height:"100vh",justifyContent:v?"start":"center",alignItems:v?"start":"center",mb:v?10:0,flexDirection:v?"column":"row",sx:{position:"relative",zIndex:1,isolation:"isolate",transform:"translateZ(0)",backfaceVisibility:"hidden"},children:[v&&e.jsx(me,{onClick:()=>E(J=>!J),sx:{position:"fixed",top:12,right:12,zIndex:1200,color:n?r.white:r.black,fontSize:30,bgcolor:n?"rgba(0,0,0,0.6)":"rgba(255,255,255,0.6)",border:`1px solid ${n?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)"}`,boxShadow:n?"0 4px 12px rgba(0,0,0,0.4)":"0 4px 12px rgba(0,0,0,0.15)"},children:f?e.jsx(xr,{}):e.jsx(no,{})}),v&&f&&e.jsx(s,{onClick:()=>E(!1),sx:{position:"fixed",inset:0,zIndex:1050,bgcolor:"rgba(0,0,0,0.4)"}}),(!v||f)&&e.jsxs(Z,{sx:{position:v?"fixed":"relative",top:v?"7vh":0,right:v?"8px":"auto",width:z?"90px":"250px",height:v?"85vh":"98vh",bgcolor:n?"rgba(0,0,0,0.6)":"rgba(255,255,255,0.15)",borderRadius:"20px",p:1,display:"flex",flexDirection:"column",gap:"10px",alignItems:"center",border:`1px solid ${n?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)"}`,boxShadow:n?"0 8px 32px rgba(0,0,0,0.3)":"0 8px 32px rgba(0,0,0,0.05)",zIndex:1100,ml:v?0:1.5,mt:v?0:1,pt:1,overflowY:"auto",overflowX:"hidden",scrollbarWidth:"none",msOverflowStyle:"none","&::-webkit-scrollbar":{display:"none"},"&:hover":{bgcolor:n?"rgba(0,0,0,0.6)":"rgba(255,255,255,0.15)"}},children:[q.map(({title:J,items:ce})=>e.jsxs(Gr.Fragment,{children:[J&&e.jsx(o,{variant:"body2",sx:{width:"100%",px:0,mt:1,mb:-.5,color:n?r.white:r.black,fontWeight:"bold",fontSize:"0.75rem"},children:J}),ce.map(({label:oe,icon:ve,tab:ie})=>e.jsx(be,{title:z&&!v?oe:"",placement:"right",arrow:!0,slotProps:{tooltip:{sx:{fontSize:"0.95rem",fontWeight:600,px:2.5,py:1.25,borderRadius:"12px"}}},children:e.jsxs(U,{variant:"black",onClick:()=>_(ie),sx:{width:"100%",height:50,minHeight:50,flexShrink:0,fontFamily:io.button.font,fontSize:"0.8rem",px:z?0:2,justifyContent:z?"center":"flex-start","& .MuiSvgIcon-root":{fontSize:"1.5rem",width:"1.5rem",height:"1.5rem"},...d===ie&&{bgcolor:r.orange+" !important",color:r.white+" !important",borderColor:r.orange},"&:hover":{bgcolor:r.orange+" !important",color:r.white,borderColor:r.orange,transform:"none"}},children:[ve,!z&&oe]})},ie))]},J||"main-menu")),e.jsxs(s,{sx:{mt:"auto",pt:1,flexShrink:0,display:"flex",gap:"6px",flexDirection:"column",width:"100%"},children:[e.jsxs(s,{sx:{display:"flex",gap:"6px",width:"100%"},children:[e.jsx(be,{title:N.label,placement:"top",arrow:!0,children:e.jsx(U,{variant:"black",iconOnly:!0,onClick:()=>_(N.tab),sx:{flex:1,height:38,minHeight:38,borderRadius:"10px","& .MuiSvgIcon-root":{fontSize:"1.1rem"}},children:N.icon})}),e.jsx(be,{title:n?"Light Mode":"Dark Mode",placement:"top",arrow:!0,children:e.jsx(U,{variant:"black",iconOnly:!0,onClick:t,sx:{flex:1,height:38,minHeight:38,borderRadius:"10px","& .MuiSvgIcon-root":{fontSize:"1.1rem",transition:"transform 0.3s ease"},"&:hover .MuiSvgIcon-root":{transform:"rotate(180deg)"}},children:e.jsx(Vt,{})})})]}),e.jsx(be,{title:"Logout",placement:"right",arrow:!0,children:e.jsx(U,{variant:"orange",iconOnly:!0,onClick:K,sx:{width:"100%",height:38,minHeight:38,borderRadius:"10px","& .MuiSvgIcon-root":{fontSize:"1.1rem"}},children:e.jsx(tn,{})})})]})]}),e.jsx(i.Suspense,{fallback:e.jsx(bt,{variant:"fullscreen"}),children:e.jsx(s,{ref:k,flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"start",height:v?"calc(100vh - 6vh - 20px)":"100vh",sx:{width:"100%",overflowY:"auto",overflowX:"hidden",mt:v?"6vh":0,p:0,...Ae(n)},children:e.jsxs(oo,{children:[e.jsx(nt,{path:"profile",element:e.jsx(Z,{sx:{width:"100%",maxWidth:"1000px",borderRadius:"25px",p:2,mt:2,mb:2},children:e.jsx(Er,{uid:h.uid,type:"view"})})}),e.jsx(nt,{path:"settings",element:e.jsx(ll,{uid:h.uid})}),e.jsx(nt,{path:"references",element:e.jsx(gl,{})}),e.jsx(nt,{path:"testimonials",element:e.jsx(xl,{uid:h.uid})}),e.jsx(nt,{path:"reelcv",element:e.jsx(cl,{})}),e.jsx(nt,{path:"video",element:e.jsx(dl,{})}),e.jsx(nt,{path:"setup",element:e.jsx(_r,{uid:h.uid})}),e.jsx(nt,{path:"details",element:e.jsx(Hs,{uid:h.uid})}),e.jsx(nt,{path:"cvupload",element:e.jsx(Ts,{uid:h.uid})}),e.jsx(nt,{path:"background",element:e.jsx(Ms,{uid:h.uid})}),e.jsx(nt,{path:"personal",element:e.jsx(Fs,{uid:h.uid})}),e.jsx(nt,{path:"achievement",element:e.jsx(Vs,{uid:h.uid})}),e.jsx(nt,{path:"check",element:e.jsx(Gs,{uid:h.uid})}),e.jsx(nt,{path:"*",element:e.jsx(lr,{to:"setup",replace:!0})})]})})})]}),L&&e.jsx(be,{title:"Share Profile",placement:"left",children:e.jsx(U,{variant:"black",iconOnly:!0,onClick:ee,sx:{position:"fixed",bottom:32,right:32,width:56,height:56,minWidth:"unset",borderRadius:"50%",zIndex:1e3},children:e.jsx(ao,{})})}),e.jsx(jt,{open:D.open,onClose:()=>y({...D,open:!1}),message:D.message,severity:D.severity})]})}export{Zd 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.