PageSourceSearch

https://hiremindpro.com/_next/static/chunks/5658.d24893be518e782f.js

js hiremindpro.com collected 2026-10-02 01:32:34 UTC 5,059 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5658],{25658:function(e,t,r){r.r(t),r.d(t,{default:function(){return o}});var a=r(57437),n=r(542),s=r.n(n),i=r(2265),l=r(75738);function o(){let[e,t]=(0,i.useState)([]),[r,n]=(0,i.useState)(!1),[o,c]=(0,i.useState)(!1),d=async()=>{n(!0);let e=await fetch("/api/account/attachments").then(e=>e.json()).catch(()=>({}));t(((null==e?void 0:e.rows)||[]).map(e=>({id:e.id,name:e.name,resumeDocxUrl:e.resumeDocxUrl,resumePdfUrl:e.resumePdfUrl,active:!!e.active})).filter(e=>!!(e.resumeDocxUrl||e.resumePdfUrl))),n(!1)};(0,i.useEffect)(()=>{d()},[]);let u=async e=>{c(!0);try{let t=await (0,l.FH)(e),r=await fetch("/api/account/resume",{method:"POST",headers:l.Lr,body:t}),a=await r.json();if(!r.ok){alert((null==a?void 0:a.error)||"Upload failed");return}let n=null==a?void 0:a.url;if(!n){alert("Upload did not return a URL");return}let s=e.name.replace(/\.(pdf|docx?|PDF|DOCX?)$/,""),i=/\.pdf$/i.test(e.name),o={name:s,active:!0};i?o.resumePdfUrl=n:o.resumeDocxUrl=n;let c=await fetch("/api/account/attachments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)}),u=await c.json();if(!c.ok||!(null==u?void 0:u.ok)){alert((null==u?void 0:u.error)||"Save failed");return}await d()}finally{c(!1)}},m=async r=>{let a=e.find(e=>e.id===r);if(a){t(e=>e.map(e=>e.id===r?{...e,active:!0}:{...e,active:!1}));try{let e=await fetch("/api/account/attachments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:r,name:a.name,resumeDocxUrl:a.resumeDocxUrl,resumePdfUrl:a.resumePdfUrl,active:!0})}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error((null==t?void 0:t.error)||"Failed");try{let e="string"==typeof(null==t?void 0:t.resumeText)?t.resumeText:"";if(e){let t=e.slice(0,1e3);console.log("[Resume parsing] Active preset:",a.name),console.log("[Resume parsing] Characters:",e.length),console.log("[Resume parsing] Preview (first 1000 chars):\n",t)}else console.log("[Resume parsing] No text extracted for",a.name)}catch(e){}}catch(e){t(e=>e.map(e=>e.id===r?{...e,active:!1}:e)),alert("Failed to set active resume")}}},h=async e=>{if(!confirm("Delete this resume?"))return;let t=await fetch("/api/account/attachments?id=".concat(e),{method:"DELETE"}).then(e=>e.json());if(!(null==t?void 0:t.ok)){alert((null==t?void 0:t.error)||"Delete failed");return}d()};return(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsx)("div",{className:s().toolbar,children:(0,a.jsxs)("label",{className:"inline-flex items-center gap-2 ".concat(o?"opacity-60 cursor-progress":""),children:[(0,a.jsx)("input",{type:"file",accept:".pdf,.doc,.docx",className:"hidden",onChange:e=>{var t;let r=null===(t=e.target.files)||void 0===t?void 0:t[0];r&&(u(r),e.currentTarget.value="")}}),(0,a.jsx)("span",{className:"cursor-pointer rounded bg-green-600 hover:bg-green-700 px-4 py-2 text-white text-sm font-medium",children:o?"Uploading…":"Upload resume"}),(0,a.jsx)("span",{className:"text-xs text-gray-500 dark:text-ink-400",children:"PDF, DOC, or DOCX"})]})}),(0,a.jsxs)("div",{className:s().panel,children:[(0,a.jsx)("h2",{className:s().panelHeading,children:"Your resumes"}),(0,a.jsx)("p",{className:s().panelDescription,children:"Choose the resume that tells the right story for your next opportunity."}),r?(0,a.jsx)("div",{className:"text-sm text-gray-500 dark:text-ink-400",children:"Loading…"}):0===e.length?(0,a.jsxs)("div",{className:s().empty,children:[(0,a.jsx)("strong",{children:"Your experience deserves a great introduction."}),(0,a.jsx)("p",{children:"Upload a PDF, DOC, or DOCX resume to get started."})]}):(0,a.jsx)("ul",{className:"space-y-2",children:e.map(e=>(0,a.jsxs)("li",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-ink-100 p-4 dark:border-ink-700",children:[(0,a.jsx)("input",{type:"radio",checked:e.active,onChange:()=>m(e.id)}),(0,a.jsx)("span",{className:"flex-1 truncate",children:e.name}),e.resumePdfUrl?(0,a.jsx)("a",{href:e.resumePdfUrl,target:"_blank",className:"text-xs text-brand-600",children:"Preview"}):null,e.resumeDocxUrl?(0,a.jsx)("a",{href:e.resumeDocxUrl,target:"_blank",className:"text-xs text-brand-600",children:"Download"}):null,(0,a.jsx)("button",{onClick:()=>h(e.id),className:"text-xs text-red-600 hover:text-red-800",children:"Delete"})]},e.id))})]}),(0,a.jsx)("div",{className:"text-xs text-gray-500 mt-3 dark:text-ink-400",children:"The active resume will be used for answer generation in interview mode."})]})}},75738:function(e,t,r){async function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.size>15728640)throw Error("File too large (15 MB max)");let r=await new Promise((t,r)=>{let a=new FileReader;a.onerror=()=>r(a.error||Error("read_failed")),a.onload=()=>{let e=String(a.result||"");t(e.slice(e.indexOf(",")+1))},a.readAsDataURL(e)});return JSON.stringify({...t,filename:e.name,mime:e.type||"application/octet-stream",dataBase64:r})}r.d(t,{FH:function(){return a},Lr:function(){return n}});let n={"Content-Type":"application/json"}}}]);

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.