1import{c as we,a as b,u as Ce,e as I,r as l,j as e,B as g,b as O,a9 as U,bt as q,L as De,b1 as Se,E as Te,t as h,be as ke}from"./index-DNidg_Qc.js";import{l as Re,r as Ae,d as Le,i as ze,g as Ie}from"./career.functions-CPuccMWX.js";import{I as K}from"./input-70YvsUaZ.js";import{L as W}from"./label-Bhudjdxi.js";import{D as Z,a as ee,b as se,c as te,d as ae,e as Ee}from"./dialog-B1BXKzKU.js";import{A as Me,a as Fe,b as _e,c as $e,d as Be,e as Pe,f as Ve,g as Oe}from"./alert-dialog-DC8GJw9j.js";import{D as Y,a as G,b as H,e as X}from"./dropdown-menu-yu6pxx-v.js";import{T as Ue,a as qe,b as Ke,c as We}from"./tooltip-DrJV-oBy.js";import{p as Ye}from"./resume-upload-button-D77qLtgT.js";import{e as Ge,a as He}from"./export-pdf-DNGX-1_H.js";import{D as Xe}from"./DocumentPreview-Cwfop93w.js";import{M as Je}from"./MultiColumnWarningBanner-aVccz4D4.js";import{g as Qe,w as Ze,h as es,E as ss,s as ts,T as as}from"./ScoreTrend-BDulaFlo.js";import{P as rs}from"./plus-BRSyRfE3.js";import{F as re}from"./file-text-BlHcyHb-.js";import{C as ne}from"./chevron-down-CPsmHmNT.js";import{T as ns}from"./target-BIU4lc4B.js";import{M as os}from"./mail-DIM7-Uur.js";import{M as is}from"./message-square-tEJuq6-U.js";import{V as ls}from"./video-DWkt9FxH.js";import{L as cs}from"./linkedin-DeuNArME.js";import{P as ds}from"./pencil-DOsXhVyV.js";import{U as ms}from"./upload--hJlow_J.js";import{g as us,X as oe,Y as ie,B as le,f as xs,R as hs,T as ps,C as fs}from"./generateCategoricalChart-CjzfUIjV.js";import{C as gs}from"./copy-o5wQvCLO.js";import{D as J}from"./download-DvVzbS_i.js";import"./index-D324aKeF.js";import"./index-Bk7P141l.js";import"./index-D-fQwQV1.js";import"./index-CPuSwFTH.js";import"./chevron-right-BM435jai.js";import"./check-DWkmcDeA.js";import"./index-IAXwTvsN.js";import"./resume-source-hygiene-BnELtta6.js";import"./index-ctxUlhvd.js";const js=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ys=we("eye",js);var vs=us({chartName:"BarChart",GraphicalChild:le,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:oe},{axisType:"yAxis",AxisComp:ie}],formatAxisMap:xs});const bs=[{label:"ATS Scorer",to:"/tools/ats-scorer",icon:ns},{label:"Resume Tailor",to:"/tools/resume-tailor",icon:re},{label:"Cover Letter Generator",to:"/tools/cover-letter",icon:os},{label:"Interview Prep",to:"/tools/interview-prep",icon:is},{label:"Mock Interview Simulator",to:"/tools/mock-interview",icon:ls},{label:"LinkedIn Toolkit",to:"/tools/linkedin-optimizer",icon:cs}];function Ns(r){return r?new Date(r).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):" - "}function lt(){const r=b(Re),a=b(Ae),m=b(Le),c=b(ze),n=Ce(),{data:o,isLoading:j,refetch:p}=I({queryKey:["resumes-dashboard"],queryFn:()=>r()}),d=l.useMemo(()=>o?.items??[],[o]),y=b(Qe),i=l.useMemo(()=>d.map(s=>s.id),[d]),{data:f}=I({queryKey:["resume-score-histories",i],queryFn:()=>y({data:{resumeIds:i,limit:5}}),enabled:i.length>0}),u=l.useMemo(()=>{const s=new Map;return(f?.items??[]).forEach(t=>s.set(t.resumeId,t)),s},[f]),[v,x]=l.useState(null),ce=l.useMemo(()=>Ze(d),[d]),de=l.useMemo(()=>es(d),[d]),[me,ue]=l.useState(()=>typeof window>"u"?!1:window.localStorage.getItem("resumes-dupe-note-dismissed")==="1"),xe=()=>{ue(!0);try{window.localStorage.setItem("resumes-dupe-note-dismissed","1")}catch{}},[he,N]=l.useState(!1),[C,D]=l.useState(""),[S,T]=l.useState(""),[pe,E]=l.useState(!1),[k,M]=l.useState(!1),[F,_]=l.useState(!1),[R,A]=l.useState(null),[$,B]=l.useState(""),[L,z]=l.useState(null),[fe,P]=l.useState(null),[ge,je]=l.useState(""),ye=s=>{A(s.id),B(s.title)},V=async()=>{if(!R)return;const s=$.trim();if(!s){A(null);return}try{await a({data:{id:R,title:s}}),h.success("Renamed"),A(null),p()}catch(t){h.error(t instanceof Error?t.message:"Rename failed")}},ve=async()=>{if(L)try{await m({data:{id:L}}),h.success("Resume deleted"),z(null),p()}catch(s){h.error(s instanceof Error?s.message:"Delete failed")}},be=async s=>{_(!0);try{const{text:t,isMultiColumn:w}=await Ye(s);E(w),T(t),C.trim()||D(s.name.replace(/\.[^.]+$/,"")),h.success(`Loaded ${s.name}`)}catch(t){h.error(t instanceof Error?t.message:"Failed to read file")}finally{_(!1)}},Ne=async()=>{const s=C.trim()||"Untitled Resume",t=S.trim();if(t.length<30){h.error("Paste or upload your resume text first.");return}M(!0);try{await c({data:{title:s,content:t}}),h.success("Resume saved"),N(!1),D(""),T(""),p()}catch(w){h.error(w instanceof Error?w.message:"Failed to create")}finally{M(!1)}};return e.jsxs("div",{className:"container mx-auto max-w-6xl px-4 py-10",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end sm:justify-between gap-4 mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"My Resumes."}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Save versions for different roles and load them into any tool instantly."})]}),e.jsxs(g,{onClick:()=>N(!0),className:"shrink-0",children:[e.jsx(rs,{className:"size-4 mr-1.5"}),"New resume"]})]}),j?e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground py-16 justify-center",children:[e.jsx(O,{className:"size-4 animate-spin"}),"Loading your resumesâ¦"]}):d.length===0?e.jsx(U,{className:"border-dashed",children:e.jsxs(q,{className:"py-14 text-center space-y-4",children:[e.jsx(re,{className:"size-10 mx-auto text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-lg font-medium",children:"No resumes saved yet."}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Paste your resume into any tool and save it to find it here."})]}),e.jsx(De,{to:"/tools/ats-scorer",className:"inline-flex items-center gap-1.5 text-sm font-medium text-primary hover:underline",children:"Check my resume free â"})]})}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-col gap-2",children:ce.map(s=>e.jsx(U,{children:e.jsx(q,{className:"p-4 sm:p-5",children:e.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-start lg:justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[R===s.id?e.jsx("form",{onSubmit:t=>{t.preventDefault(),V()},children:e.jsx(K,{autoFocus:!0,value:$,onChange:t=>B(t.target.value),onBlur:()=>{V()},maxLength:120,className:"h-8 max-w-md"})}):e.jsx("button",{type:"button",onClick:()=>ye(s),className:"text-left font-semibold leading-snug hover:text-primary transition break-words [overflow-wrap:anywhere] block w-full",title:"Click to rename",children:s.displayTitle}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Last modified ",Ns(s.updated_at??s.created_at)]}),e.jsx(Ds,{history:u.get(s.id)}),e.jsx("div",{className:"pt-1",children:e.jsx(Ss,{expanded:v===s.id,onToggle:()=>x(t=>t===s.id?null:s.id),history:u.get(s.id)})})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0 flex-wrap lg:justify-end",children:[e.jsx(Cs,{score:u.get(s.id)?.highestScore??s.best_ats_score??null,trend:u.get(s.id)?.trend??"none",total:u.get(s.id)?.total??0}),e.jsxs(Y,{children:[e.jsx(G,{asChild:!0,children:e.jsxs(g,{size:"sm",children:["Load into tool",e.jsx(ne,{className:"size-3.5 ml-1"})]})}),e.jsx(H,{align:"end",children:bs.map(t=>e.jsxs(X,{onSelect:()=>{window.location.href=`${t.to}?loadId=${encodeURIComponent(s.id)}`},children:[e.jsx(t.icon,{className:"size-4 mr-2"}),t.label]},t.to))})]}),e.jsxs(g,{size:"sm",variant:"outline",onClick:()=>{P(s.id),je(s.displayTitle)},children:[e.jsx(ys,{className:"size-3.5 mr-1"}),"View"]}
1),e.jsxs(g,{size:"sm",variant:"outline",onClick:()=>{n({to:"/tools/resume-tailor",search:{loadId:s.id}}).catch(()=>{window.location.href=`/tools/resume-tailor?loadId=${encodeURIComponent(s.id)}`})},children:[e.jsx(ds,{className:"size-3.5 mr-1"}),"Edit"]}),e.jsxs(Y,{children:[e.jsx(G,{asChild:!0,children:e.jsx(g,{size:"sm",variant:"ghost","aria-label":"More actions",className:"text-muted-foreground hover:text-foreground",children:e.jsx(ss,{className:"size-4"})})}),e.jsx(H,{align:"end",children:e.jsxs(X,{onSelect:()=>z(s.id),className:"text-destructive focus:text-destructive",children:[e.jsx(Se,{className:"size-4 mr-2"}),"Delete"]})})]})]})]})})},s.id))}),de&&!me&&e.jsxs("button",{type:"button",onClick:xe,className:"block w-full text-left text-xs text-muted-foreground bg-muted/40 hover:bg-muted/60 rounded-md px-3 py-2 mt-4 transition-colors",children:["You have resumes with the same name - click any resume to rename it. ",e.jsx("span",{className:"underline",children:"Dismiss"})]})]}),e.jsx(Z,{open:he,onOpenChange:N,children:e.jsxs(ee,{className:"max-w-xl bg-white text-slate-900 border-slate-200",children:[e.jsxs(se,{children:[e.jsx(te,{className:"text-slate-900",children:"New resume"}),e.jsx(ae,{className:"text-slate-600",children:"Name this version and paste or upload your resume. You can re-use it across every tool."})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx(W,{htmlFor:"new-resume-name",className:"text-slate-900",children:"Resume name"}),e.jsx(K,{id:"new-resume-name",value:C,onChange:s=>D(s.target.value),placeholder:"e.g. Product Manager version, General 2026, Career Change",maxLength:120,className:"bg-white text-slate-900 border-slate-300 placeholder:text-slate-400"})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[e.jsx(W,{htmlFor:"new-resume-content",className:"text-slate-900",children:"Resume text"}),e.jsxs("label",{className:"inline-flex items-center gap-1.5 text-xs text-primary cursor-pointer hover:underline",children:[e.jsx(ms,{className:"size-3.5"}),F?"Parsingâ¦":"Upload PDF / DOCX",e.jsx("input",{type:"file",accept:".pdf,.docx,.txt,.md",className:"hidden",onChange:s=>{const t=s.target.files?.[0];t&&be(t),s.target.value=""},disabled:F})]})]}),e.jsx(Je,{show:pe,onDismiss:()=>E(!1)}),e.jsx(Te,{id:"new-resume-content",value:S,onChange:s=>T(s.target.value),rows:10,placeholder:"Paste your resume text hereâ¦",className:"font-mono text-xs bg-white text-slate-900 border-slate-300 placeholder:text-slate-400"})]})]}),e.jsxs(Ee,{children:[e.jsx(g,{variant:"ghost",onClick:()=>N(!1),disabled:k,className:"text-slate-700 hover:bg-slate-100 hover:text-slate-900",children:"Cancel"}),e.jsx(g,{onClick:Ne,disabled:k||!S.trim(),children:k?e.jsxs(e.Fragment,{children:[e.jsx(O,{className:"size-4 mr-2 animate-spin"}),"Savingâ¦"]}):"Save resume"})]})]})}),e.jsx(Me,{open:!!L,onOpenChange:s=>!s&&z(null),children:e.jsxs(Fe,{children:[e.jsxs(_e,{children:[e.jsx($e,{children:"Delete this resume?"}),e.jsx(Be,{children:"This permanently removes the saved resume and its enhancement history. This cannot be undone."})]}),e.jsxs(Pe,{children:[e.jsx(Ve,{children:"Cancel"}),e.jsx(Oe,{onClick:()=>{ve()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsx(ws,{id:fe,title:ge,onClose:()=>P(null)})]})}function ws({id:r,title:a,onClose:m}){const c=b(Ie),{data:n,isLoading:o,error:j}=I({queryKey:["resume-viewer",r],queryFn:()=>c({data:{id:r}}),enabled:!!r}),p=n?.enhanced_content??n?.original_content??"",[d,y=""]=p.split(/^\s*===FEEDBACK===\s*$/m),i=Q(d).trim(),f=Q(y).trim(),u=(a||"resume").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,60)||"resume",v=()=>{i&&navigator.clipboard.writeText(i).then(()=>h.success("Copied"),()=>h.error("Copy failed"))};return e.jsx(Z,{open:!!r,onOpenChange:x=>!x&&m(),children:e.jsxs(ee,{className:"max-w-3xl max-h-[85vh] overflow-y-auto bg-white text-slate-900 border-slate-200",children:[e.jsxs(se,{children:[e.jsx(te,{className:"text-slate-900",children:a||"Resume"}),e.jsx(ae,{className:"text-slate-600",children:"View your saved resume."})]}),o?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Loadingâ¦"}):j||!n?e.jsx("p",{className:"text-sm text-destructive",children:"Couldn't load this resume."}):!i&&!f?e.jsx("p",{className:"text-sm text-muted-foreground",children:"This resume has no saved content."}):e.jsxs("div",{className:"space-y-5",children:[i&&e.jsx(Xe,{content:i,variant:"resume"}),f&&e.jsxs("div",{children:[e.jsx("div",{className:"text-xs uppercase tracking-wider text-muted-foreground mb-1",children:"What changed"}),e.jsx("div",{className:"whitespace-pre-wrap font-sans text-sm text-slate-900 leading-relaxed bg-slate-50 rounded-lg p-4 border border-slate-200",children:f})]}),i&&e.jsxs("div",{className:"flex flex-wrap gap-2 pt-2 border-t border-slate-200",children:[e.jsxs(g,{type:"button",variant:"outline",size:"sm",onClick:v,className:"bg-white text-slate-900 border-slate-300 hover:bg-slate-50",children:[e.jsx(gs,{className:"size-4 mr-1.5"})," Copy"]}),e.jsxs(g,{type:"button",size:"sm",onClick:()=>Ge(i,`${u}.pdf`),className:"bg-sky-600 hover:bg-sky-700 text-white",children:[e.jsx(J,{className:"size-4 mr-1.5"})," Export PDF"]}),e.jsxs(g,{type:"button",size:"sm",onClick:()=>He(i,`${u}.docx`),className:"bg-sky-600 hover:bg-sky-700 text-white",children:[e.jsx(J,{className:"size-4 mr-1.5"})," Export Word"]})]})]})]})})}function Q(r){if(!r)return"";let a=r.replace(/```[\s\S]*?```/g,"");const m=/"(role|bullet|bullets|gap_keyword|gap_keywords|rationale|suggestions|feedback|original|enhanced|score|missing_keywords)"\s*:/,c=(n,o,j)=>{let p="",d=0;for(;d<n.length;){if(n[d]!==o){p+=n[d++];continue}let y=0,i=d,f=!1,u=!1,v=!1;for(;i<n.length;i++){const x=n[i];if(f)u?u=!1:x==="\\"?u=!0:x==='"'&&(f=!1);else if(x==='"')f=!0;else if(x===o)y++;else if(x===j&&(y--,y===0)){i++,v=!0;break}}if(v){const x=n.slice(d,i);if(m.test(x)){d=i;continue}}p+=n[d++]}return p};return a=c(a,"{","}"),a=c(a,"[","]"),a.replace(/\n{3,}/g,` 2 3`)}function Cs({score:r,trend:a,total:m}){const c=Math.min(m,3),n=a==="up"||a==="down"||a==="flat"?m>c?`Trend across your ${c} most recent ATS checks (of ${m} total)`:`Trend across your ${c}
3 most recent ATS checks`:m===1?"Only 1 score on record - no trend yet":r!==null?"Best ATS score on record - no trend history yet":"No ATS scores recorded for this resume yet";return e.jsxs("span",{className:"inline-flex items-center gap-1 shrink-0",children:[e.jsx(ke,{variant:"outline",className:ts(r),children:r!==null?`ATS ${r}`:"No score"}),e.jsx(Ue,{delayDuration:150,children:e.jsxs(qe,{children:[e.jsx(Ke,{asChild:!0,children:e.jsx("span",{className:"inline-flex cursor-help","aria-label":n,children:e.jsx(as,{trend:a})})}),e.jsx(We,{side:"top",className:"text-xs",children:n})]})})]})}function Ds({history:r}){const a=r?.recent?.[0];if(!a)return null;const m=!!(a.company||a.job_title),c=new Date(a.created_at).toLocaleDateString(void 0,{month:"short",day:"numeric"});return e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Last used for:"," ",e.jsx("span",{className:"text-foreground font-medium",children:m?`${a.job_title??" - "}${a.company?` at ${a.company}`:""}`:`ATS Scorer on ${c}`})]})}function Ss({expanded:r,onToggle:a,history:m}){const c=m?.recent??[];if(c.length===0)return null;const n=[...c].reverse().map(o=>({label:new Date(o.created_at).toLocaleDateString(void 0,{month:"short",day:"numeric"}),company:o.company??" - ",role:o.job_title??" - ",score:o.score,date:new Date(o.created_at).toLocaleDateString(void 0,{month:"short",day:"numeric"})}));return e.jsxs("div",{children:[e.jsxs("button",{type:"button",onClick:a,className:"text-xs font-medium text-primary hover:underline inline-flex items-center gap-1",children:[r?"Hide":"Show"," last ",c.length," score",c.length===1?"":"s",e.jsx(ne,{className:`size-3 transition-transform ${r?"rotate-180":""}`})]}),r&&e.jsx("div",{className:"mt-2 h-[140px]",children:e.jsx(hs,{width:"100%",height:"100%",children:e.jsxs(vs,{data:n,margin:{top:4,right:4,bottom:24,left:0},children:[e.jsx(oe,{dataKey:"label",fontSize:9,tick:{fill:"hsl(var(--muted-foreground))",fontSize:9},interval:0,angle:-45,textAnchor:"end",height:30,tickLine:!1,axisLine:{stroke:"hsl(var(--border))"}}),e.jsx(ie,{domain:[0,100],ticks:[0,25,50,75,100],fontSize:9,tick:{fill:"hsl(var(--muted-foreground))"},width:32}),e.jsx(ps,{wrapperStyle:{zIndex:20,maxWidth:140},allowEscapeViewBox:{x:!1,y:!1},contentStyle:{background:"hsl(var(--popover))",border:"1px solid hsl(var(--border))",borderRadius:8,fontSize:11,padding:"4px 8px",whiteSpace:"nowrap"},cursor:{fill:"hsl(var(--muted))",opacity:.3},formatter:o=>[`${o}/100`,"Score"],labelFormatter:(o,j)=>j?.[0]?.payload?.date??""}),e.jsx(le,{dataKey:"score",radius:[4,4,0,0],children:n.map((o,j)=>e.jsx(fs,{fill:o.score>=75?"#10b981":o.score>=50?"#f59e0b":"#ef4444"},j))})]})})})]})}export{lt as component};
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.