1import{r as s,j as e,aB as G,aY as ne,bL as de,as as K,bT as ce,bx as oe,ao as ue,av as pe,b4 as me,bz as ge}from"./vendor-react-tv0DotBx.js";import{A as fe,i as he}from"./resumeFileTypes-B1GfhC9L.js";import{e as H,f as re,ac as X,ad as ye,l as xe,m as be,n as ke,p as je,b as q,u as ve,x as Se}from"./index-B9Gqyu0i.js";const t={primary:"#4A60A8",primaryDark:"#3C4F8E",primary200:"#B6C3E8",primary100:"#E4E9F5",primary50:"#EEF1F9",heading:"#1E2D4D",ink:"#0A0A0A",ink2:"#475569",ink3:"#64748B",ink4:"#94A3B8",border:"#E5E7EC",railGradient:"linear-gradient(165deg, #25335A, #0F172A)",railPeriwinkle:"#9CA8CD",pageBg:"#EEF0F4",shadowLg:"0 16px 40px rgba(26,26,26,.08)",shadowBlue:"0 2px 8px rgba(74,96,168,.20)",fontDisplay:"'Lora', Georgia, serif",fontBody:"'Inter', system-ui, sans-serif"},ie={fontFamily:t.fontBody,fontWeight:600,fontSize:14,color:t.heading,marginBottom:8,display:"block"},we={width:"100%",height:48,border:`1px solid ${t.border}`,borderRadius:10,padding:"0 15px",fontFamily:t.fontBody,fontSize:15,color:t.ink,background:"#fff",outline:"none"},V={width:"100%",height:50,border:"none",borderRadius:10,background:t.primary,color:"#fff",fontFamily:t.fontBody,fontWeight:600,fontSize:15,cursor:"pointer",boxShadow:t.shadowBlue,transition:"background .2s cubic-bezier(0.16,1,0.3,1)"},Ce={onFocus:l=>{l.currentTarget.style.borderColor=t.primary,l.currentTarget.style.boxShadow=`0 0 0 3px ${t.primary100}`},onBlur:l=>{l.currentTarget.style.borderColor=t.border,l.currentTarget.style.boxShadow="none"}},Fe="/assets/offerloop_logo2_trimmed-Dg4xqApm.png",Ee="/assets/Gmaillogopng-DvYm0ewK.png",ze="/assets/outlook_logo-BFtiwWCg.png",De="/assets/applemail-C-fTeu8C.png",$="linear-gradient(135deg, #7C97FF 0%, #5B7BF7 55%, #4863E8 100%)",Ie="linear-gradient(135deg, #6B88F5 0%, #4A69E8 55%, #3A53D6 100%)",P=({children:l})=>e.jsx("strong",{style:{color:"#3D5BE0",fontWeight:700},children:l}),M=[{key:"find-people",video:"/onboarding-bg/find-people.mp4",headline:"Find the right people",body:e.jsxs(e.Fragment,{children:["Search ",e.jsx(P,{children:"2.2 billion professionals"}),", from alumni at your school to people at your target firms, and instantly get their ",e.jsx(P,{children:"emails, LinkedIns, etc."})]})},{key:"job-board",video:"/onboarding-bg/job-board.mp4",headline:"A job board built around you",body:e.jsxs(e.Fragment,{children:["Every opening matched and scored against your resume. ",e.jsx(P,{children:"Nobody else"})," sees this exact feed: it's hand picked for you from ",e.jsx(P,{children:"500,000+ live jobs"}),"."]})},{key:"auto-apply",video:"/onboarding-bg/auto-apply.mp4",headline:"Apply on autopilot",body:e.jsxs(e.Fragment,{children:["Submits applications for you ",e.jsx(P,{children:"instantly"}),", with custom cover letters and a resume tuned to get past AI screeners to a ",e.jsx(P,{children:"real person"}),"."]})},{key:"outreach",video:"/onboarding-bg/outreach.mp4",headline:"Hyper personalized outreach",body:e.jsxs(e.Fragment,{children:["Drafted straight into ",e.jsx(P,{children:"your email account"}),"."]})},{key:"track",video:"/onboarding-bg/track.mp4",headline:"Never miss a response",body:e.jsxs(e.Fragment,{children:["Contacts, applications, and follow-ups tracked in ",e.jsx(P,{children:"one pipeline"}),", with Scout nudging your next move."]})}],Te=[{src:Ee,alt:"Gmail",style:{left:"29%",top:"48%"},delay:"0s",tilt:-8,imgSize:34},{src:ze,alt:"Outlook",style:{right:"28%",top:"44%"},delay:"1.3s",tilt:7,imgSize:48},{src:De,alt:"Apple Mail",style:{left:"35%",bottom:"18%"},delay:"2.2s",tilt:-5,imgSize:34}],Be=({onDone:l,onViewSlide:c})=>{const[i,u]=s.useState(0),o=M[i];s.useEffect(()=>c(i),[i,c]);const p=()=>i<M.length-1?u(i+1):l(!1),h=()=>i>0&&u(i-1);return s.useEffect(()=>{const a=m=>{(m.key==="ArrowRight"||m.key==="Enter"||m.key===" ")&&p(),m.key==="ArrowLeft"&&h()};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)}),e.jsxs("div",{role:"button",tabIndex:0,onClick:p,className:"min-h-screen flex flex-col",style:{background:t.pageBg,color:t.heading,cursor:"pointer",fontFamily:t.fontBody,position:"relative",overflow:"hidden"},children:[e.jsx("style",{children:` 2 @keyframes obSlideIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } } 3 .ob-slide-anim { animation: obSlideIn .45s cubic-bezier(0.16,1,0.3,1); } 4 @keyframes obVideoIn { from { opacity: 0; } to { opacity: 1; } } 5 .ob-slide-video { animation: obVideoIn .8s ease forwards; } 6 @keyframes obFloat { from { transform: translateY(-9px); } to { transform: translateY(9px); } } 7 .ob-float-chip { animation: obFloat 4.5s ease-in-out infinite alternate; } 8 @media (max-width: 640px) { .ob-float-chip { display: none; } } 9 @media (prefers-reduced-motion: reduce) { 10 .ob-slide-anim, .ob-float-chip { animation: none; } 11 .ob-slide-video { animation: none; opacity: 1; } 12 } 13 `}),e.jsx("video",{className:"ob-slide-video",src:o.video,autoPlay:!0,muted:!0,loop:!0,playsInl
13ine:!0,style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover",opacity:0,pointerEvents:"none"}},o.key),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px 36px",position:"relative",zIndex:1,background:"rgba(255,255,255,.82)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)"},children:[e.jsx("div",{style:{position:"absolute",top:"100%",left:0,right:0,height:100,background:"linear-gradient(180deg, rgba(255,255,255,.82), rgba(255,255,255,0))",pointerEvents:"none"}}),e.jsx("img",{src:Fe,alt:"Offerloop",style:{height:34}}),e.jsx("button",{type:"button",onClick:a=>{a.stopPropagation(),l(!0)},style:{background:"transparent",border:`1px solid ${t.primary200}`,color:t.primary,borderRadius:8,padding:"8px 18px",fontSize:14,fontWeight:600,cursor:"pointer",fontFamily:t.fontBody},children:"Skip"})]}),e.jsxs("div",{className:"ob-slide-anim",style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",padding:"0 24px",position:"relative",zIndex:1},children:[o.key==="outreach"&&Te.map(a=>e.jsx("span",{className:"ob-float-chip",style:{position:"absolute",animationDelay:a.delay,...a.style},children:e.jsx("span",{style:{width:64,height:64,borderRadius:18,background:"rgba(255,255,255,.94)",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 12px 32px rgba(0,0,0,.35)",transform:`rotate(${a.tilt}deg)`,overflow:"hidden"},children:e.jsx("img",{src:a.src,alt:a.alt,style:{width:a.imgSize,maxHeight:a.imgSize,objectFit:"contain"}})})},a.alt)),e.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center"},children:[e.jsx("div",{"aria-hidden":!0,style:{position:"absolute",inset:"-40px -64px",background:"rgba(255,255,255,.72)",borderRadius:56,filter:"blur(24px)",zIndex:-1,pointerEvents:"none"}}),e.jsx("h1",{style:{fontFamily:t.fontDisplay,fontWeight:600,fontSize:"clamp(32px, 5vw, 52px)",letterSpacing:"-0.02em",margin:"0 0 18px",maxWidth:640,color:"#000"},children:o.headline}),e.jsx("p",{style:{fontSize:"clamp(17px, 2.1vw, 21px)",lineHeight:1.6,fontWeight:600,color:"#000",maxWidth:480,margin:0},children:o.body})]}),e.jsx("button",{type:"button",onClick:a=>{a.stopPropagation(),p()},style:{marginTop:40,height:58,padding:"0 64px",borderRadius:14,border:"none",background:$,color:"#fff",fontFamily:t.fontBody,fontWeight:600,fontSize:17,cursor:"pointer",boxShadow:"0 10px 30px rgba(91,123,247,.4)"},onMouseEnter:a=>a.currentTarget.style.background=Ie,onMouseLeave:a=>a.currentTarget.style.background=$,children:"Continue"})]},i),e.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"0 0 44px",position:"relative",zIndex:1},children:e.jsx("div",{style:{display:"flex",gap:8},children:M.map((a,m)=>e.jsx("span",{style:{width:m===i?22:8,height:8,borderRadius:99,transition:"all .3s",background:m===i?$:t.primary200}},a.key))})})]})};function ae(l){if(!l)return"";const c=String(l).match(/\b(19|20)\d{2}\b/);return c?c[0]:""}function se(l){const c=l||{},i=c.education||{},u=c.contact||{},o=(c.name||"").trim(),p=o?o.split(/\s+/):[];return{name:o,firstName:p[0]||"",lastName:p.length>1?p.slice(1).join(" "):"",email:u.email||"",phone:u.phone||"",university:i.university||"",major:i.major||"",graduationYear:ae(i.graduation)}}const Y={name:"",firstName:"",lastName:"",email:"",phone:"",university:"",major:"",graduationYear:""};function Q(l){const c=l||{},i=c.profile||{},u=c.academics||{},o=i.firstName||"",p=i.lastName||"";return{name:[o,p].filter(Boolean).join(" "),firstName:o,lastName:p,email:i.email||"",phone:i.phone||"",university:u.university||"",major:u.major||"",graduationYear:ae(u.graduationYear)}}function Re(l,c){const i=l||Y,u=c||Y,o=p=>i[p]||u[p]||"";return{name:o("name"),firstName:o("firstName"),lastName:o("lastName"),email:o("email"),phone:o("phone"),university:o("university"),major:o("major"),graduationYear:o("graduationYear")}}const Pe=/linkedin\.com\/in\//i,Ae=({onNext:l,onBuild:c,initialLinkedinUrl:i,submitting:u})=>{const[o,p]=s.useState(null),[h,a]=s.useState(null),[m,g]=s.useState(!1),[x,y]=s.useState(i||""),[b,v]=s.useState(!1),[w,k]=s.useState(""),[C,E]=s.useState(""),[z,F]=s.useState(!1),A=s.useRef(null),T=Pe.test(x),R=!!h||T,N=async n=>{if(!he(n)){E("Please upload a PDF, DOCX, or DOC file.");return}E(""),p(n),g(!0);try{const d=new FormData;d.append("resume",n);const j=H.currentUser?await H.currentUser.getIdToken():null,B=await fetch(`${re}/api/parse-resume`,{method:"POST",headers:j?{Authorization:`Bearer ${j}`}:{},body:d}),O=await B.json();B.ok&&O.data?a(se(O.data)):a(Y)}catch{a(Y)}finally{g(!1)}},U=n=>{var j;const d=(j=n.target.files)==null?void 0:j[0];d&&N(d)},S=(n,d)=>{const j=Re(h,d);l({resumePrefill:h,linkedinPrefill:d,resolved:j,resumeFile:o,linkedinUrl:T?x.trim():"",entryPath:n})},L=async()=>
13{if(!(b||u)){if(E(""),h){if(T){v(!0),k("enriching");try{const n=await X(x.trim());S("resume",n?Q(n):null);return}catch{S("resume",null);return}finally{v(!1),k("")}}S("resume",null);return}if(T){v(!0),k("enriching");let n=Y;try{const d=await X(x.trim());d&&(n=Q(d)),k("writing");try{await ye()}catch{}}catch{}v(!1),k(""),S("linkedin",n)}}};return e.jsxs("div",{children:[e.jsxs("div",{role:"button",tabIndex:0,onClick:()=>{var n;return(n=A.current)==null?void 0:n.click()},onKeyDown:n=>{var d;return n.key==="Enter"&&((d=A.current)==null?void 0:d.click())},onDragOver:n=>{n.preventDefault(),F(!0)},onDragLeave:()=>F(!1),onDrop:n=>{var j;n.preventDefault(),F(!1);const d=(j=n.dataTransfer.files)==null?void 0:j[0];d&&N(d)},style:{border:`1.5px dashed ${z||o?t.primary:t.primary200}`,borderRadius:14,padding:26,textAlign:"center",marginBottom:14,background:t.primary50,cursor:"pointer",transition:"border-color .2s"},children:[e.jsx("span",{style:{display:"inline-flex",width:46,height:46,borderRadius:12,background:"#fff",color:t.primary,alignItems:"center",justifyContent:"center",marginBottom:12},children:m?e.jsx(G,{size:22,className:"animate-spin"}):o?e.jsx(ne,{size:22,strokeWidth:1.6}):e.jsx(de,{size:22,strokeWidth:1.6})}),o?e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{fontWeight:600,fontSize:15,color:t.heading},children:o.name}),e.jsx("div",{style:{fontSize:13,color:t.ink3,marginTop:2,display:"flex",alignItems:"center",justifyContent:"center",gap:5},children:m?"Reading your resumeâ¦":e.jsx(e.Fragment,{children:h!=null&&h.name?e.jsxs(e.Fragment,{children:[e.jsx(K,{size:13,strokeWidth:3,style:{color:t.primary}})," Parsed. Click to replace."]}):"Attached. Click to replace."})})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{fontWeight:600,fontSize:15,color:t.heading},children:["Drop your resume or ",e.jsx("span",{style:{color:t.primary},children:"browse"})]}),e.jsx("div",{style:{fontSize:13,color:t.ink3,marginTop:2},children:"PDF, DOCX or DOC"})]}),e.jsx("input",{ref:A,type:"file",accept:fe.accept,className:"hidden",onChange:U})]}),e.jsxs("div",{style:{marginBottom:24},children:[e.jsxs("label",{style:{...ie,display:"flex",alignItems:"center",gap:6},htmlFor:"ob-linkedin",children:["LinkedIn URL ",e.jsx("span",{style:{color:t.ink4,fontWeight:400},children:"(optional)"})]}),e.jsx("input",{id:"ob-linkedin",type:"url",style:we,...Ce,placeholder:"linkedin.com/in/your-handle",value:x,onChange:n=>y(n.target.value)}),x&&!T&&e.jsx("p",{style:{fontSize:12,color:"#DC2626",margin:"6px 0 0"},children:"Enter a full linkedin.com/in/⦠profile URL."})]}),C&&e.jsx("p",{style:{fontSize:12,color:"#DC2626",margin:"0 0 12px"},children:C}),e.jsx("button",{type:"button",onClick:L,disabled:!R||b||u,style:{...V,marginBottom:14,opacity:R&&!b&&!u?1:.5,cursor:R&&!b&&!u?"pointer":"default",display:"flex",alignItems:"center",justifyContent:"center"},onMouseEnter:n=>R&&!b&&!u&&(n.currentTarget.style.background=t.primaryDark),onMouseLeave:n=>n.currentTarget.style.background=t.primary,children:b||u?e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(G,{size:17,className:"animate-spin"}),w==="enriching"?"Reading your LinkedInâ¦":w==="writing"?"Writing your resumeâ¦":"Finishing upâ¦"]}):"Continue"}),e.jsx("div",{style:{textAlign:"center"},children:e.jsx("button",{type:"button",onClick:c,style:{fontWeight:600,fontSize:14,color:t.primary,background:"none",border:"none",cursor:"pointer",fontFamily:t.fontBody},children:"No resume? We'll build you one"})})]})},Le=["Education","Experience","Projects","Leadership","Skills"],J=[{key:"education",label:"Education",placeholder:"USC, Business Administration, Class of 2027. Add your GPA if you want it shown."},{key:"experience",label:"Work experience",placeholder:"Sales associate at Men's Wearhouse, summer 2024. List each job, even part time. Anything you did or are proud of."},{key:"projects",label:"Projects",placeholder:"Case competitions, class projects, a personal site. Example: microfinance analysis project with Kiva."},{key:"leadership",label:"Leadership and activities",placeholder:"Clubs, teams, volunteering. Example: events lead for a business club, intramural captain."},{key:"skills",label:"Skills and interests",placeholder:"Excel, SQL, Spanish, Figma. Interests are welcome too: chess, cooking, marathon running."}],We=({onComplete:l,submitting:c})=>{const[i,u]=s.useState({education:"",experience:"",projects:"",leadership:"",skills:""}),[o,p]=s.useState(""),[h,a]=s.useState([]),[m,g]=s.useState(null),[x,y]=s.useState(""),[b,v]=s.useState(!1),[w,k]=s.useState(!1),[C,E]=s.useState(!1),[z,F]=s.useState(""),A=Object.values(i).some(n=>n.trim()),T=()=>J.filter(n=>i[n.key].trim()).map(n=>`${n.label.toUpperCase()}: 14${i[n.key].trim()}`).join(` 15 16`),R=async()=>{const n=m?o.trim():T();if(!(!n||b)){F(""),v(!0);try{const d=await xe(n,m);g(d.resume),y(d.html),m&&(a(j=>[...j,o.trim()]),p(""))}catch(d){F(d instanceof Error&&d.message==="generation_limit_reached"?"You've used all free generations. Upload a resume instead, or edit this one after onboarding.":"Couldn't generate right now. Your details are saved, try again.")}finally{v(!1)}}},N=async()=>
16{if(!(!m||w)){F(""),k(!0);try{const n=await be(m);l(se(n.parsed))}catch{F("Couldn't save your resume. Try again."),k(!1)}}},U=async()=>{if(!(!m||C||b)){F(""),E(!0);try{const n=await ke(m);je(n,"Offerloop_Resume.pdf")}catch{F("Couldn't download the PDF. Try again.")}finally{E(!1)}}},S=b||w||c,L=m?!!o.trim():A;return e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 380px) minmax(0, 1fr)",gap:28},children:[e.jsxs("div",{children:[m?e.jsxs("div",{children:[e.jsx("label",{style:{fontWeight:600,fontSize:14,color:t.heading,display:"block",marginBottom:8},children:"Refine it"}),e.jsx("textarea",{value:o,onChange:n=>p(n.target.value),placeholder:"Example: add my SQL project from last summer, and make the club bullets stronger.",rows:5,style:{width:"100%",border:`1px solid ${t.border}`,borderRadius:10,padding:"12px 14px",fontFamily:t.fontBody,fontSize:15,color:t.ink,resize:"vertical",outline:"none"}}),h.length>0&&e.jsx("div",{style:{marginTop:10,display:"flex",flexDirection:"column",gap:6},children:h.map((n,d)=>e.jsx("div",{style:{fontSize:12.5,color:t.ink4,background:t.primary50,borderRadius:8,padding:"7px 10px"},children:n},d))})]}):e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[J.map(n=>e.jsxs("div",{children:[e.jsx("label",{style:ie,htmlFor:`builder-${n.key}`,children:n.label}),e.jsx("textarea",{id:`builder-${n.key}`,value:i[n.key],onChange:d=>u(j=>({...j,[n.key]:d.target.value})),placeholder:n.placeholder,rows:2,style:{width:"100%",border:`1px solid ${t.border}`,borderRadius:10,padding:"10px 12px",fontFamily:t.fontBody,fontSize:14,color:t.ink,resize:"vertical",outline:"none"}})]},n.key)),e.jsx("p",{style:{fontSize:12.5,color:t.ink4,margin:0,lineHeight:1.5},children:"Plain words are fine, fill in what you have. We research the places you mention and write the bullet points for you."})]}),z&&e.jsx("p",{style:{fontSize:13,color:"#DC2626",margin:"10px 0 0"},children:z}),e.jsxs("button",{type:"button",onClick:R,disabled:!L||S,style:{...V,marginTop:14,opacity:L&&!S?1:.5,cursor:L&&!S?"pointer":"default",display:"flex",alignItems:"center",justifyContent:"center",gap:8},children:[b?e.jsx(G,{size:17,className:"animate-spin"}):e.jsx(ce,{size:16,strokeWidth:1.7}),b?"Writing your resumeâ¦":m?"Refine resume":"Generate my resume"]}),m&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:N,disabled:S,style:{...V,marginTop:10,background:"#fff",color:t.primary,border:`1.5px solid ${t.primary}`,boxShadow:"none",display:"flex",alignItems:"center",justifyContent:"center",gap:8,opacity:S?.5:1,cursor:S?"default":"pointer"},children:[w||c?e.jsx(G,{size:17,className:"animate-spin"}):e.jsx(ne,{size:16,strokeWidth:1.7}),"Use this resume"]}),e.jsxs("button",{type:"button",onClick:U,disabled:C||b,style:{marginTop:10,width:"100%",background:"none",border:"none",display:"flex",alignItems:"center",justifyContent:"center",gap:7,fontFamily:t.fontBody,fontSize:13.5,fontWeight:600,color:t.ink3,padding:"6px 0",opacity:C||b?.5:1,cursor:C||b?"default":"pointer"},children:[C?e.jsx(G,{size:15,className:"animate-spin"}):e.jsx(oe,{size:15,strokeWidth:1.8}),C?"Preparing PDF...":"Download PDF"]}),e.jsx("p",{style:{fontSize:12.5,color:t.ink4,margin:"8px 0 0",textAlign:"center"},children:"Saved to your account as a PDF."})]})]}),e.jsx("div",{style:{border:`1px solid ${t.border}`,borderRadius:14,background:"#fff",minHeight:480,boxShadow:t.shadowLg,overflow:"hidden"},children:x?e.jsx("iframe",{title:"Resume preview",srcDoc:x,sandbox:"",style:{width:"100%",height:620,border:"none"}}):e.jsxs("div",{style:{padding:"36px 40px"},children:[e.jsx("div",{style:{height:22,width:180,borderRadius:6,background:t.primary100,marginBottom:6}}),e.jsx("div",{style:{height:12,width:260,borderRadius:6,background:t.primary50,marginBottom:28}}),Le.map(n=>e.jsxs("div",{style:{marginBottom:26},children:[e.jsx("div",{style:{fontFamily:t.fontDisplay,fontSize:13,letterSpacing:".08em",textTransform:"uppercase",color:t.ink4,borderBottom:`1px solid ${t.border}`,paddingBottom:5,marginBottom:12},children:n}),e.jsx("div",{style:{height:10,width:"82%",borderRadius:5,background:t.primary50,marginBottom:8}}),e.jsx("div",{style:{height:10,width:"64%",borderRadius:5,background:t.primary50}})]},n))]})})]})},Ne=({size:l=26})=>e.jsxs("svg",{viewBox:"0 0 256 193",style:{width:l,height:l*193/256},"aria-hidden":"true",children:[e.jsx("path",{fill:"#4285F4",d:"M58.182 192.05V93.14L27.507 65.077 0 49.504v125.091c0 9.658 7.825 17.455 17.455 17.455h40.727Z"}),e.jsx("path",{fill:"#34A853",d:"M197.818 192.05h40.727c9.659 0 17.455-7.826 17.455-17.455V49.505l-31.156 17.837-27.026 25.798v98.91Z"}),e.jsx("path",{fill:"#EA4335",d:"m58.182 93.14-4.174-38.647 4.174-36.989L128 69.868l69.818-52.364 4.669 34.992-4.669 40.644L128 145.504z"}
16),e.jsx("path",{fill:"#FBBC04",d:"M197.818 17.504V93.14L256 49.504V26.231c0-21.585-24.64-33.89-41.89-20.945l-16.292 12.218Z"}),e.jsx("path",{fill:"#C5221F",d:"m0 49.504 26.759 20.07L58.182 93.14V17.504L41.89 5.286C24.61-7.66 0 4.646 0 26.23v23.273Z"})]}),ee={width:52,height:52,borderRadius:12,background:"#fff",border:"1px solid rgba(15, 23, 42, 0.08)",boxShadow:"0 1px 3px rgba(15, 23, 42, 0.05)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},Oe=({onDone:l,submitting:c})=>{const[i,u]=s.useState(!1),[o,p]=s.useState(!1),h=s.useRef(null),a=s.useRef(!0);s.useEffect(()=>(a.current=!0,()=>{a.current=!1,h.current&&clearInterval(h.current)}),[]);const m=async()=>{if(!(i||o||c)){h.current&&(clearInterval(h.current),h.current=null),u(!0);try{const y=await q.startGmailOAuth("/oauth/complete");if(!y)throw new Error("no auth url");const b=window.open(y,`gmail-oauth-${Date.now()}`,"width=600,height=700,scrollbars=yes,resizable=yes");if(!b){u(!1);return}const v=window.setInterval(async()=>{if(b.closed){clearInterval(v),h.current=null;try{for(let w=0;w<3;w++){if(!a.current)return;try{if((await q.gmailStatus()).connected){if(!a.current)return;p(!0),l(!1);return}}catch{}w<2&&await new Promise(k=>setTimeout(k,1e3))}}finally{a.current&&u(!1)}}},500);h.current=v}catch{u(!1)}}},g=i||o||c,x=c||i;return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsxs("button",{type:"button",onClick:m,disabled:g,style:{display:"flex",gap:18,alignItems:"center",textAlign:"left",padding:"26px 28px",borderRadius:14,border:`2px solid ${t.primary}`,background:"rgba(74,96,168,0.05)",cursor:g?"default":"pointer",fontFamily:t.fontBody,transition:"box-shadow .15s ease, background .15s ease"},onMouseEnter:y=>{g||(y.currentTarget.style.background="rgba(74,96,168,0.09)",y.currentTarget.style.boxShadow="0 4px 16px rgba(74,96,168,0.14)")},onMouseLeave:y=>{y.currentTarget.style.background="rgba(74,96,168,0.05)",y.currentTarget.style.boxShadow="none"},children:[e.jsx("span",{style:ee,children:e.jsx(Ne,{})}),e.jsxs("span",{style:{minWidth:0},children:[e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[e.jsx("span",{style:{fontSize:17.5,fontWeight:700,color:t.heading,letterSpacing:"-0.01em"},children:o?"Gmail connected":i?"Waiting for Google...":"Connect Gmail"}),e.jsx("span",{style:{padding:"3px 10px",borderRadius:999,background:t.primary,color:"#fff",fontSize:11.5,fontWeight:600},children:"Recommended"}),o&&e.jsx(K,{size:17,style:{color:"#16A34A"}})]}),e.jsx("span",{style:{display:"block",fontSize:15,color:t.ink2,marginTop:6,lineHeight:1.6},children:"Drafts appear directly in your Gmail, ready to review and send. Works with any Gmail account, even if you signed up with a different email."})]})]}),e.jsxs("button",{type:"button",onClick:()=>l(!0),disabled:x,style:{display:"flex",gap:18,alignItems:"center",textAlign:"left",padding:"26px 28px",borderRadius:14,border:`1px solid ${t.border}`,background:"#fff",cursor:x?"default":"pointer",fontFamily:t.fontBody,transition:"box-shadow .15s ease, border-color .15s ease"},onMouseEnter:y=>{x||(y.currentTarget.style.borderColor="#C6CBD9",y.currentTarget.style.boxShadow="0 4px 14px rgba(15,23,42,0.06)")},onMouseLeave:y=>{y.currentTarget.style.borderColor=t.border,y.currentTarget.style.boxShadow="none"},children:[e.jsx("span",{style:ee,children:e.jsx(oe,{size:24,style:{color:t.ink3}})}),e.jsxs("span",{style:{minWidth:0},children:[e.jsx("span",{style:{fontSize:17.5,fontWeight:700,color:t.heading,letterSpacing:"-0.01em",display:"block"},children:c?"Finishing up...":"Skip for now"}),e.jsx("span",{style:{display:"block",fontSize:15,color:t.ink2,marginTop:6,lineHeight:1.6},children:"Your emails arrive as one-tap downloads that open in any mail app, resume attached. You can connect Gmail anytime from Settings."})]})]})]})},Ue="/assets/scout-wave-removebg-preview-DPHK8Y1h.png",_e="/assets/step-num-1-CPEBGwqm.png",Ge="/assets/step-num-2-PAmZcr_k.png",Ye="/assets/step-num-3-BOTFpCB8.png",$e="/assets/offerloop_logo2_allwhite-C2BXyaoy.png",Me=[_e,Ge,Ye],He={slides:0,source:1,builder:1,inbox:2},te=[{label:"What Offerloop does"},{label:"Your resume"},{label:"Connect your inbox",optional:!0}],qe=({onComplete:l})=>{const c=ue(),i=pe(),{completeOnboarding:u,refreshUser:o,user:p,signOut:h}=ve(),a=s.useMemo(()=>new URLSearchParams(i.search),[i.search]),m=s.useMemo(()=>a.get("returnTo")||"",[a]),[g,x]=s.useState("slides"),[y,b]=s.useState(!1),[v,w]=s.useState(null),[k,C]=s.useState(null),E=s.useRef(new Set),z=(r,f,D=!1)=>{var W;(W=H.currentUser)==null||W.getIdToken().then(I=>{fetch(`${re}/api/users/onboarding-event`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${I}`},body:JSON.stringify({event:r,step:f,skipped:D})}).catch(()=>{})}).catch(()=>{})};s.useEffect(()=>{g!=="slides"&&!E.current.has(g)&&(E.current.add(g),z("viewed",g))},[g]);const F=(r,f,D)=>{const W=r.name||(p==null?void 0:p.name)||"",I=W.trim().split(/\s+/),_=r.firstName||I[0]||"",le=r.lastName||(I.length>1?I.slice(1).join(" "):""),Z=(p==null?void 0:p.email)||r.email||"";return{isStudent:Z.toLowerCase().trim().endsWith(".edu"),profile:{fullName:W,firstName:_,lastName:le,email:Z,phone:r.phone||"",linkedinUrl:f},university:r.university||"",academics:{university:r.university||"",college:r.university||"",degree:"",major:r.major||"",graduationYear:r.graduationYear||""},careerTrack:"",careerTracks:[],careerTrackLabels:[],targetIndustries:[],goals:{careerTrack:"",careerTracks:[],targetIndustries:[]},onboarding:{completedAt:new Date().toISOString()},...D?{inboxConnectSkipped:!0}:{}}},A=()=>{let r="/home";if(m)try{let f=m;for(;f!==decodeURIComponent(f);)f=decodeURIComponent(f);!f.includes("/onboarding")&&!f.includes("/signin")&&(r=f)}
16catch{}return r},T=async(r,f,D,W)=>{if(!y){b(!0);try{z("completed",D);const I=F(r,f,W);await u(I),await new Promise(_=>setTimeout(_,300)),await o(),Se("onboarding","complete",!0);try{l(I)}catch(_){console.error("Analytics error:",_)}c(A(),{replace:!0})}catch(I){console.error("Onboarding failed:",I),ge.error("Failed to finish onboarding. Please try again."),b(!1)}}},R=r=>{z("completed","slides",r),x("source")},N=r=>{w(r),C({prefill:r.resolved,linkedinUrl:r.linkedinUrl,step:"source"}),x("inbox")},U=r=>{C({prefill:r,linkedinUrl:"",step:"resume_builder"}),x("inbox")},S=r=>{k&&(z("completed","inbox",r),T(k.prefill,k.linkedinUrl,k.step,r))},L=async()=>{g==="slides"?(await h(),c("/?signedOut=true",{replace:!0})):g==="source"?x("slides"):g==="builder"?x("source"):g==="inbox"&&x((k==null?void 0:k.step)==="resume_builder"?"builder":"source")};if(g==="slides")return e.jsx(Be,{onDone:R,onViewSlide:r=>{const f=`slides_${r+1}`;E.current.has(f)||(E.current.add(f),z("viewed",f))}});const n=He[g],d=r=>e.jsx("em",{style:{fontStyle:"italic",color:t.primary},children:r}),B={source:{headline:e.jsxs(e.Fragment,{children:["Drop your ",d("resume or LinkedIn")," to get started"]}),sub:"",footer:{hint:e.jsx(e.Fragment,{children:"Your resume powers everything here: recommended jobs, people to talk to, personalized emails, and auto-apply. No resume? We'll write you one, free."})}},builder:{headline:e.jsxs(e.Fragment,{children:["Let's build ",d("your resume")]}),sub:"Tell us what you've done. We'll turn it into a clean one-page resume, free.",footer:{mascot:150}},inbox:{headline:e.jsxs(e.Fragment,{children:["Where should ",d("your drafts")," go?"]}),sub:"Offerloop writes personalized outreach emails for you. Pick how you want to receive them.",footer:{hint:e.jsx(e.Fragment,{children:"Connect Gmail and every draft lands in your inbox, ready to send. Skip and your emails arrive as one-tap downloads that open in any mail app, resume attached."})}}}[g],O="clamp(24px, 5vw, 48px)";return e.jsxs("div",{className:"min-h-screen flex",style:{background:"#fff",fontFamily:t.fontBody},children:[e.jsx("style",{children:` 17 @keyframes obPaneIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } } 18 .ob-pane-anim { animation: obPaneIn .35s cubic-bezier(0.16,1,0.3,1); } 19 @media (prefers-reduced-motion: reduce) { .ob-pane-anim { animation: none; } } 20 `}),e.jsxs("div",{className:"hidden md:flex",style:{width:308,flexShrink:0,background:t.railGradient,color:"#fff",padding:"32px 28px",flexDirection:"column"},children:[e.jsx("img",{src:$e,alt:"Offerloop",style:{height:38,display:"block",alignSelf:"flex-start",marginBottom:36}}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:20,flex:1},children:te.map((r,f)=>{const D=f<n?"done":f===n?"current":"upcoming";return e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center",opacity:D==="done"?.6:D==="upcoming"?.5:1},children:[D==="done"?e.jsx("span",{style:{width:28,height:28,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,background:"rgba(123,143,201,.25)",color:t.railPeriwinkle},children:e.jsx(K,{size:13,strokeWidth:3})}):e.jsx("img",{src:Me[f],alt:`Step ${f+1}`,style:{width:28,height:27,flexShrink:0,display:"block"}}),e.jsxs("span",{style:{fontSize:14,fontWeight:D==="current"?600:400},children:[r.label,r.optional&&e.jsx("span",{style:{fontWeight:400,color:t.railPeriwinkle},children:" · optional"})]})]},r.label)})}),B.footer.mascot?e.jsx("img",{src:Ue,alt:"Scout",style:{alignSelf:"center",marginTop:20,width:B.footer.mascot+105,display:"block",filter:"drop-shadow(0 6px 18px rgba(0,0,0,.3))"}}):e.jsx("div",{style:{background:"rgba(255,255,255,.06)",borderRadius:12,padding:"16px 18px",fontSize:14.5,lineHeight:1.55,fontWeight:600,color:"#fff"},children:B.footer.hint})]}),e.jsxs("div",{className:"ob-pane-anim",style:{flex:1,minWidth:0,background:"#fff",padding:O,display:"flex",flexDirection:"column",justifyContent:"center",position:"relative"},children:[e.jsxs("button",{type:"button",onClick:L,style:{position:"absolute",top:24,left:O,display:"flex",alignItems:"center",gap:6,color:t.ink3,fontWeight:600,fontSize:14,background:"none",border:"none",cursor:"pointer",padding:0,fontFamily:t.fontBody},children:[e.jsx(me,{size:17,strokeWidth:1.8})," Back"]}),e.jsx("div",{className:"flex md:hidden",style:{position:"absolute",top:28,right:O,gap:5},children:te.map((r,f)=>e.jsx("span",{style:{width:18,height:4,borderRadius:99,background:f<=n?t.primary:t.primary100}},r.label))}),e.jsxs("div",{style:{paddingTop:40,width:"100%",maxWidth:g==="builder"?980:640,margin:"0 auto"},children:[e.jsx("h2",{style:{fontFamily:t.fontDisplay,fontWeight:600,fontSize:"clamp(24px, 3.2vw, 30px)",letterSpacing:"-0.02em",color:t.heading,margin:"0 0 8px",textWrap:"balance"},children:B.headline}),B.sub?e.jsx("p",{style:{fontSize:15,color:t.ink2,margin:"0 0 24px",lineHeight:1.65},children:B.sub}):e.jsx("div",{style:{height:24}}),g==="source"&&e.jsx(Ae,{onNext:N,onBuild:()=>{z("completed","source",!0),x("builder")},initialLinkedinUrl:v==null?void 0:v.linkedinUrl,submitting:y}),g==="builder"&&e.jsx(We,{onComplete:U,submitting:y}),g==="inbox"&&e.jsx(Oe,{onDone:S,submitting:y})]})]},g)]})};export{qe as OnboardingFlow};
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.