"use strict";exports.id=13,exports.ids=[13],exports.modules={64451:(T,e,E)=>{E.d(e,{L:()=>A});var t=E(53236),L=E(23734),i=E.n(L),N=E(92795),o=E(93334);let A={session:{strategy:"jwt"},pages:{signIn:"/login"},providers:[(0,t.Z)({name:"credentials",credentials:{email:{label:"Email",type:"email"},password:{label:"Password",type:"password"}},async authorize(T){if(!T?.email||!T?.password)return null;await (0,o.X)(N._);let e=await N._.user.findUnique({where:{email:T.email.toLowerCase()}});if(!e||!await i().compare(T.password,e.password))return null;if(!e.emailVerified)throw Error("EMAIL_NOT_VERIFIED");return{id:e.id,email:e.email,name:e.name??void 0}}})],callbacks:{jwt:async({token:T,user:e})=>(e&&(T.id=e.id),T),session:async({session:T,token:e})=>(T.user&&e.id&&(T.user.id=e.id),T)}}},93334:(T,e,E)=>{E.d(e,{X:()=>N});let t=globalThis,L=[`
  CREATE TABLE IF NOT EXISTS "User" (
      "id" TEXT NOT NULL,
      "email" TEXT NOT NULL,
      "password" TEXT NOT NULL,
      "name" TEXT,
      "firstName" TEXT,
      "lastName" TEXT,
      "photoUrl" TEXT,
      "emailVerified" TIMESTAMP(3),
      "verificationToken" TEXT,
      "verificationTokenExpiry" TIMESTAMP(3),
      "aiProvider" TEXT NOT NULL DEFAULT 'gemini',
      "aiModel" TEXT,
      "aiOpenaiKey" TEXT,
      "aiAnthropicKey" TEXT,
      "aiGeminiKey" TEXT,
      "aiMistralKey" TEXT,
      "aiGroqKey" TEXT,
      "aiDeepseekKey" TEXT,
      "aiXaiKey" TEXT,
      "aiCohereKey" TEXT,
      "aiPerplexityKey" TEXT,
      "aiOllamaKey" TEXT,
      "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
      "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
      CONSTRAINT "User_pkey" PRIMARY KEY ("id")
  )
  `,'ALTER TABLE "User" ADD COLUMN IF NOT EXISTS "name" TEXT','ALTER TABLE "User" ADD COLUMN IF NOT EXISTS "firstName" TEXT','ALTER TABLE "User" ADD COLUMN IF NOT EXISTS "lastName" TEXT','ALTER TABLE "User" ADD COLUMN IF NOT EXISTS "photoUrl" TEXT','ALTER TABLE "User" ADD COLUMN IF NOT EXISTS "emailVerified" TIMESTAMP(3)','ALTER TABLE "User" ADD COLUMN IF NOT EXISTS "verificationToken" TEXT','ALTER TABLE "User" ADD COLUMN IF NOT EXISTS "verificationTokenExpiry" TIMESTAMP(3)','ALTER TABLE "User" ADD COLUMN IF NOT EXISTS "aiProvider" TEXT DEFAULT \'gemini\'','ALTER TABLE "User" ADD COLUMN IF NOT EXISTS "aiModel" TEXT','ALTER TABLE "User" ADD COLUMN IF NOT EXISTS "aiOpenaiKey" TEXT','ALTER TABLE "User" ADD COLUMN IF NOT EXISTS "aiAnthropicKey" TEXT','ALTER TABLE "User" ADD COLUMN IF NOT EXISTS "aiGeminiKey" TEXT','ALTER TABLE "User" ADD COLUMN IF NOT EXISTS "aiMistralKey" TEXT','ALTER TABLE "User" ADD COLUMN IF NOT EXISTS "aiGroqKey" TEXT','ALTER TABLE "User" ADD COLUMN IF NOT EXISTS "aiDeepseekKey" TEXT','ALTER TABLE "User" ADD COLUMN IF NOT EXISTS "aiXaiKey" TEXT','ALTER TABLE "User" ADD COLUMN IF NOT EXISTS "aiCohereKey" TEXT','ALTER TABLE "User" ADD COLUMN IF NOT EXISTS "aiPerplexityKey" TEXT','ALTER TABLE "User" ADD COLUMN IF NOT EXISTS "aiOllamaKey" TEXT','ALTER TABLE "User" ADD COLUMN IF NOT EXISTS "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP','ALTER TABLE "User" ADD COLUMN IF NOT EXISTS "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP','CREATE UNIQUE INDEX IF NOT EXISTS "User_email_key" ON "User"("email")',`
  CREATE TABLE IF NOT EXISTS "Profile" (
      "id" TEXT NOT NULL,
      "userId" TEXT NOT NULL,
      "fullName" TEXT NOT NULL DEFAULT '',
      "email" TEXT NOT NULL DEFAULT '',
      "phone" TEXT NOT NULL DEFAULT '',
      "location" TEXT NOT NULL DEFAULT '',
      "linkedinUrl" TEXT NOT NULL DEFAULT '',
      "websiteUrl" TEXT NOT NULL DEFAULT '',
      "summary" TEXT NOT NULL DEFAULT '',
      "skills" JSONB NOT NULL DEFAULT '[]',
      "experience" JSONB NOT NULL DEFAULT '[]',
      "education" JSONB NOT NULL DEFAULT '[]',
      "certifications" JSONB NOT NULL DEFAULT '[]',
      "projects" JSONB NOT NULL DEFAULT '[]',
      "languages" JSONB NOT NULL DEFAULT '[]',
      "atsScore" INTEGER,
      "lastAnalysis" TEXT,
      "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
      "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
      CONSTRAINT "Profile_pkey" PRIMARY KEY ("id")
  )
  `,'ALTER TABLE "Profile" ADD COLUMN IF NOT EXISTS "fullName" TEXT NOT NULL DEFAULT \'\'','ALTER TABLE "Profile" ADD COLUMN IF NOT EXISTS "email" TEXT NOT NULL DEFAULT \'\'','ALTER TABLE "Profile" ADD COLUMN IF NOT EXISTS "phone" TEXT NOT NULL DEFAULT \'\'','ALTER TABLE "Profile" ADD COLUMN IF NOT EXISTS "location" TEXT NOT NULL DEFAULT \'\'','ALTER TABLE "Profile" ADD COLUMN IF NOT EXISTS "linkedinUrl" TEXT NOT NULL DEFAULT \'\'','ALTER TABLE "Profile" ADD COLUMN IF NOT EXISTS "websiteUrl" TEXT NOT NULL DEFAULT \'\'','ALTER TABLE "Profile" ADD COLUMN IF NOT EXISTS "summary" TEXT NOT NULL DEFAULT \'\'','ALTER TABLE "Profile" ADD COLUMN IF NOT EXISTS "skills" JSONB NOT NULL DEFAULT \'[]\'','ALTER TABLE "Profile" ADD COLUMN IF NOT EXISTS "experience" JSONB NOT NULL DEFAULT \'[]\'','ALTER TABLE "Profile" ADD COLUMN IF NOT EXISTS "education" JSONB NOT NULL DEFAULT \'[]\'','ALTER TABLE "Profile" ADD COLUMN IF NOT EXISTS "certifications" JSONB NOT NULL DEFAULT \'[]\'','ALTER TABLE "Profile" ADD COLUMN IF NOT EXISTS "projects" JSONB NOT NULL DEFAULT \'[]\'','ALTER TABLE "Profile" ADD COLUMN IF NOT EXISTS "languages" JSONB NOT NULL DEFAULT \'[]\'','ALTER TABLE "Profile" ADD COLUMN IF NOT EXISTS "atsScore" INTEGER','ALTER TABLE "Profile" ADD COLUMN IF NOT EXISTS "lastAnalysis" TEXT','ALTER TABLE "Profile" ADD COLUMN IF NOT EXISTS "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP','ALTER TABLE "Profile" ADD COLUMN IF NOT EXISTS "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP','ALTER TABLE "Profile" DROP COLUMN IF EXISTS "targetTitle"','CREATE UNIQUE INDEX IF NOT EXISTS "Profile_userId_key" ON "Profile"("userId")',`
  CREATE TABLE IF NOT EXISTS "JobListing" (
      "id" TEXT NOT NULL,
      "userId" TEXT NOT NULL,
      "url" TEXT NOT NULL,
      "title" TEXT NOT NULL DEFAULT '',
      "company" TEXT NOT NULL DEFAULT '',
      "location" TEXT NOT NULL DEFAULT '',
      "rawContent" TEXT NOT NULL DEFAULT '',
      "description" TEXT NOT NULL DEFAULT '',
      "fitScore" INTEGER,
      "fitAnalysis" TEXT,
      "tailoredCvHtml" TEXT,
      "coverLetterHtml" TEXT,
      "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
      "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
      CONSTRAINT "JobListing_pkey" PRIMARY KEY ("id")
  )
  `,'ALTER TABLE "JobListing" ADD COLUMN IF NOT EXISTS "title" TEXT NOT NULL DEFAULT \'\'','ALTER TABLE "JobListing" ADD COLUMN IF NOT EXISTS "company" TEXT NOT NULL DEFAULT \'\'','ALTER TABLE "JobListing" ADD COLUMN IF NOT EXISTS "location" TEXT NOT NULL DEFAULT \'\'','ALTER TABLE "JobListing" ADD COLUMN IF NOT EXISTS "rawContent" TEXT NOT NULL DEFAULT \'\'','ALTER TABLE "JobListing" ADD COLUMN IF NOT EXISTS "description" TEXT NOT NULL DEFAULT \'\'','ALTER TABLE "JobListing" ADD COLUMN IF NOT EXISTS "fitScore" INTEGER','ALTER TABLE "JobListing" ADD COLUMN IF NOT EXISTS "fitAnalysis" TEXT','ALTER TABLE "JobListing" ADD COLUMN IF NOT EXISTS "tailoredCvHtml" TEXT','ALTER TABLE "JobListing" ADD COLUMN IF NOT EXISTS "coverLetterHtml" TEXT','ALTER TABLE "JobListing" ADD COLUMN IF NOT EXISTS "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP','ALTER TABLE "JobListing" ADD COLUMN IF NOT EXISTS "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP',`
  CREATE TABLE IF NOT EXISTS "PromptTemplate" (
      "id" TEXT NOT NULL,
      "key" TEXT NOT NULL,
      "label" TEXT NOT NULL,
      "description" TEXT NOT NULL DEFAULT '',
      "defaultContent" TEXT NOT NULL,
      "activeContent" TEXT NOT NULL,
      "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
      "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
      CONSTRAINT "PromptTemplate_pkey" PRIMARY KEY ("id")
  )
  `,'ALTER TABLE "PromptTemplate" ADD COLUMN IF NOT EXISTS "key" TEXT NOT NULL DEFAULT \'\'','ALTER TABLE "PromptTemplate" ADD COLUMN IF NOT EXISTS "label" TEXT NOT NULL DEFAULT \'\'','ALTER TABLE "PromptTemplate" ADD COLUMN IF NOT EXISTS "description" TEXT NOT NULL DEFAULT \'\'','ALTER TABLE "PromptTemplate" ADD COLUMN IF NOT EXISTS "defaultContent" TEXT NOT NULL DEFAULT \'\'','ALTER TABLE "PromptTemplate" ADD COLUMN IF NOT EXISTS "activeContent" TEXT NOT NULL DEFAULT \'\'','ALTER TABLE "PromptTemplate" ADD COLUMN IF NOT EXISTS "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP','ALTER TABLE "PromptTemplate" ADD COLUMN IF NOT EXISTS "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP','CREATE UNIQUE INDEX IF NOT EXISTS "PromptTemplate_key_key" ON "PromptTemplate"("key")',`
  CREATE TABLE IF NOT EXISTS "PromptTemplateVersion" (
      "id" TEXT NOT NULL,
      "promptKey" TEXT NOT NULL,
      "version" INTEGER NOT NULL,
      "content" TEXT NOT NULL,
      "updatedBy" TEXT,
      "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
      CONSTRAINT "PromptTemplateVersion_pkey" PRIMARY KEY ("id")
  )
  `,'ALTER TABLE "PromptTemplateVersion" ADD COLUMN IF NOT EXISTS "promptKey" TEXT NOT NULL DEFAULT \'\'','ALTER TABLE "PromptTemplateVersion" ADD COLUMN IF NOT EXISTS "version" INTEGER NOT NULL DEFAULT 1','ALTER TABLE "PromptTemplateVersion" ADD COLUMN IF NOT EXISTS "content" TEXT NOT NULL DEFAULT \'\'','ALTER TABLE "PromptTemplateVersion" ADD COLUMN IF NOT EXISTS "updatedBy" TEXT','ALTER TABLE "PromptTemplateVersion" ADD COLUMN IF NOT EXISTS "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP','CREATE INDEX IF NOT EXISTS "PromptTemplateVersion_promptKey_version_idx" ON "PromptTemplateVersion"("promptKey", "version")',`
  DO $$
  BEGIN
      IF NOT EXISTS (
          SELECT 1 FROM pg_constraint WHERE conname = 'Profile_userId_fkey'
      ) THEN
          ALTER TABLE "Profile"
              ADD CONSTRAINT "Profile_userId_fkey"
              FOREIGN KEY ("userId") REFERENCES "User"("id")
              ON DELETE CASCADE ON UPDATE CASCADE;
      END IF;
  END $$;
  `,`
  DO $$
  BEGIN
      IF NOT EXISTS (
          SELECT 1 FROM pg_constraint WHERE conname = 'JobListing_userId_fkey'
      ) THEN
          ALTER TABLE "JobListing"
              ADD CONSTRAINT "JobListing_userId_fkey"
              FOREIGN KEY ("userId") REFERENCES "User"("id")
              ON DELETE CASCADE ON UPDATE CASCADE;
      END IF;
  END $$;
  `,`
  DO $$
  BEGIN
      IF NOT EXISTS (
          SELECT 1 FROM pg_constraint WHERE conname = 'PromptTemplateVersion_promptKey_fkey'
      ) THEN
          ALTER TABLE "PromptTemplateVersion"
              ADD CONSTRAINT "PromptTemplateVersion_promptKey_fkey"
              FOREIGN KEY ("promptKey") REFERENCES "PromptTemplate"("key")
              ON DELETE CASCADE ON UPDATE CASCADE;
      END IF;
  END $$;
  `];async function i(T){for(let e of L)await T.$executeRawUnsafe(e)}async function N(T){"true"!==String(process.env.LOCAL_DEV_MODE||"").toLowerCase()&&(t.hyremeSchemaReady||(t.hyremeSchemaReady=i(T).catch(T=>{throw t.hyremeSchemaReady=void 0,T})),await t.hyremeSchemaReady)}},80887:(T,e,E)=>{E.d(e,{B:()=>t});function t(T){return(T||"").toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"").slice(0,50)||"file"}},3086:(T,e,E)=>{E.d(e,{D:()=>I});let t="#4c3dc2",L="#111827",i="#4c3dc2",N="#111827",o=`107.957 257.779 m
108.063 255.782 108.113 253.778 108.113 251.767 c
108.113 228.332 100.962 206.612 88.7739 188.764 c
79.652 175.414 67.7251 164.211 53.8621 156.066 c
54.604 189.896 68.3539 220.453 90.1941 242.742 c
95.6347 248.292 101.584 253.331 107.95 257.779 c
223.228 271.172 m
222.345 264.829 221.885 258.348 221.885 251.76 c
221.885 222.731 230.76 195.814 245.888 173.655 c
259.411 153.853 277.952 137.871 299.637 127.606 c
294.669 102.874 282.644 80.7649 265.792 63.5797 c
243.323 40.6564 212.276 26.4771 177.986 26.4771 c
143.696 26.4771 112.649 40.6564 90.18 63.5797 c
73.3282 80.7721 61.2953 102.888 56.3351 127.628 c
78.0057 137.893 96.5321 153.867 110.049 173.662 c
125.184 195.814 134.051 222.738 134.051 251.767 c
134.051 258.348 133.592 264.829 132.716 271.165 c
146.741 276.773 162.01 279.851 177.986 279.851 c
193.962 279.851 209.202 276.773 223.221 271.18 c
223.228 271.172 l
286.501 214.808 m
286.636 214.556 l
296.104 197.155 301.672 177.237 302.138 156.044 c
288.261 164.19 276.313 175.392 267.184 188.764 c
254.988 206.619 247.845 228.332 247.845 251.767 c
247.845 253.792 247.901 255.811 248.007 257.808 c
254.395 253.353 260.351 248.307 265.806 242.742 c
273.903 234.488 280.884 225.088 286.501 214.808 c
178 0 m
219.455 0 256.988 17.142 284.156 44.859 c
311.323 72.576 328.126 110.861 328.126 153.153 c
328.126 180.719 320.989 206.576 308.497 228.923 c
306.815 232.34 305.466 235.987 304.505 239.822 c
303.424 244.119 302.859 248.638 302.859 253.317 c
302.859 268.282 308.801 281.834 318.417 291.645 c
328.034 301.456 341.31 307.518 355.986 307.518 c
355.986 333.995 l
334.146 333.995 314.376 324.963 300.068 310.365 c
288.819 298.889 280.955 283.975 278.093 267.309 c
270.427 274.308 262.054 280.515 253.102 285.806 c
258.429 302.58 267.586 317.588 279.528 329.764 c
299.093 349.731 326.133 362.073 355.993 362.073 c
355.993 388.55 l
318.968 388.55 285.442 373.239 261.178 348.477 c
247.117 334.132 236.165 316.615 229.446 297.08 c
219.963 300.605 210.029 303.186 199.77 304.707 c
210.184 335.747 229.269 362.707 254.084 382.61 c
282.128 405.101 317.52 418.523 356 418.523 c
356 445 l
311.507 445 270.554 429.458 238.066 403.407 c
211.428 382.047 190.506 353.588 178 320.811 c
165.494 353.588 144.565 382.047 117.934 403.407 c
85.4459 429.458 44.4859 445 0 445 c
0 418.523 l
38.48 418.523 73.8723 405.108 101.916 382.61 c
126.731 362.714 145.809 335.747 156.23 304.707 c
145.964 303.186 136.037 300.598 126.554 297.073 c
119.828 316.622 108.876 334.139 94.8151 348.484 c
70.5514 373.239 37.0245 388.557 0 388.557 c
0 362.08 l
29.8598 362.08 56.9004 349.739 76.4654 329.771 c
88.4065 317.596 97.5707 302.573 102.898 285.791 c
93.939 280.5 85.5661 274.286 77.9068 267.287 c
75.0522 283.968 67.1739 298.897 55.9253 310.373 c
41.6172 324.97 21.8473 334.002 0.00706574 334.002 c
0.00706574 307.525 l
14.6755 307.525 27.9591 301.456 37.5756 291.652 c
47.192 281.841 53.1343 268.289 53.1343 253.324 c
53.1343 248.653 52.562 244.133 51.488 239.829 c
50.4494 235.692 48.9655 231.77 47.0931 228.13 c
34.8765 205.971 27.9026 180.402 27.9026 153.161 c
27.9026 110.868 44.7049 72.576 71.8727 44.8662 c
99.0122 17.142 136.545 0 178 0 c
h`;function A(T,e,E,t="regular"){let L=String(T||"").replace(/\s+/g," ").trim();if(!L)return[];let i=L.split(" "),N=[],o="";for(let T of i){let L=o?`${o} ${T}`:T;(function(T,e,E="regular"){let t=0;for(let e of T)" "===e?t+=.28:"ilI.,:;!|".includes(e)?t+=.24:"mwMW@%&".includes(e)?t+=.88:"ABCDEFGHJKLMNOPQRSTUVWXYZ".includes(e)?t+=.66:t+=.54;return t*e*("bold"===E?1.02:1)})(L,E,t)<=e||!o?o=L:(N.push(o),o=T)}return o&&N.push(o),N}function r(T){let e=T.replace("#",""),E=Number.parseInt(3===e.length?e.split("").map(T=>T+T).join(""):e,16);return[(E>>16&255)/255,(E>>8&255)/255,(255&E)/255]}function l(T){let[e,E,t]=r(T);return`${e.toFixed(3)} ${E.toFixed(3)} ${t.toFixed(3)} rg`}function n(T,e,E,t,L=1){let i=792-e;return`q
${function(T){let[e,E,t]=r(T);return`${e.toFixed(3)} ${E.toFixed(3)} ${t.toFixed(3)} RG`}(t)}
${L.toFixed(2)} w
${T.toFixed(2)} ${i.toFixed(2)} m
${E.toFixed(2)} ${i.toFixed(2)} l
S
Q`}function a(T,e,E,t){let L=792-e,i=.5522847498*E;return["q",l(t),`${(T+E).toFixed(2)} ${L.toFixed(2)} m`,`${(T+E).toFixed(2)} ${(L+i).toFixed(2)} ${(T+i).toFixed(2)} ${(L+E).toFixed(2)} ${T.toFixed(2)} ${(L+E).toFixed(2)} c`,`${(T-i).toFixed(2)} ${(L+E).toFixed(2)} ${(T-E).toFixed(2)} ${(L+i).toFixed(2)} ${(T-E).toFixed(2)} ${L.toFixed(2)} c`,`${(T-E).toFixed(2)} ${(L-i).toFixed(2)} ${(T-i).toFixed(2)} ${(L-E).toFixed(2)} ${T.toFixed(2)} ${(L-E).toFixed(2)} c`,`${(T+i).toFixed(2)} ${(L-E).toFixed(2)} ${(T+E).toFixed(2)} ${(L-i).toFixed(2)} ${(T+E).toFixed(2)} ${L.toFixed(2)} c`,"f","Q"].join("\n")}function U(T,e,E,t){let i=t?.size??12,N=t?.font??"F1",o=t?.color?l(t.color):l(L);return`BT
${o}
/${N} ${i.toFixed(2)} Tf
1 0 0 1 ${T.toFixed(2)} ${(792-e).toFixed(2)} Tm
(${E.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")}) Tj
ET`}function O(T,e,E){return[T,E?"Present":e].filter(Boolean).join(" – ")}function S(T){return T.filter(T=>!!T)}function I(T){let e=[],E=-1,r=0,I=()=>{E+=1,e.push([]),e[E].push(`q
/G1 gs
${l(i)}
1.11742 0 0 -1.11742 107.10 644.63 cm
${o}
f
Q`),r=72},s=T=>{r+T<=720||I()},D=(T,t)=>{let L=t?.x??72,i=t?.size??12,N=t?.lineHeight??18;for(let o of(s(T.length*N+(t?.marginBottom??0)),T))e[E].push(U(L,r,o,{size:i,color:t?.color,font:t?.font})),r+=N;r+=t?.marginBottom??0},F=(T,e)=>{let E=e?.x??72,t=e?.width??468,L=e?.size??12;D(A(T,t,L,e?.font==="F2"?"bold":"regular"),{x:E,size:L,lineHeight:e?.lineHeight,color:e?.color,font:e?.font,marginBottom:e?.marginBottom})},c=T=>{s(30),e[E].push(U(72,r,T,{size:12,font:"F2",color:i})),r+=18,e[E].push(n(72,r-5,540,N,1)),r+=8},p=(T,e,E)=>{for(let t of T)F(t,{x:e,width:E,size:12,lineHeight:18,font:"F1",marginBottom:18});T.length&&(r-=18)},X=(T,L,N,o=!1)=>{let l=(N??[]).reduce((T,e)=>T+Math.max(1,A(e,432,12).length),0);s(18*(1+L.length+l)+18);let n=o?108:72,O=n-18;o&&e[E].push(a(O+2.5,r-6,2.5,t)),e[E].push(U(n,r,T,{size:12,font:"F2",color:i})),r+=18;for(let T of L.filter(Boolean))F(T,{x:108,width:432,size:12,lineHeight:18,font:"F1"});N?.length&&p(N,108,432),r+=6};for(let t of(I(),T.fullName&&D(A(T.fullName,468,18,"bold"),{size:18,lineHeight:22,font:"F2",color:i}),e[E].push(n(72,r-5,540,N,1)),r+=8,[T.email,T.phone,T.location,T.linkedinUrl,T.websiteUrl].filter(Boolean)))F(t,{marginBottom:0});r+=6,T.summary&&(c("PROFESSIONAL SUMMARY"),F(T.summary,{marginBottom:18}));let d=function(T){let e={top:"Top Skills",hard:"Hard Skills",soft:"Soft Skills"},E=["top","hard","soft"].map(E=>({label:e[E],names:(T.skills??[]).filter(T=>T?.name&&(T.group??"hard")===E).map(T=>T.name)})).filter(T=>T.names.length>0);if(!E.length){let e=(T.skills??[]).map(T=>T.name).filter(Boolean);return e.length?[e.join(", ")]:[]}return E.map(T=>`${T.label}: ${T.names.join(", ")}`)}(T);if(d.length){c("SKILLS");for(let T=0;T<d.length;T+=1)F(d[T],{marginBottom:T===d.length-1?18:0})}if(T.experience?.length){for(let e of(c("EXPERIENCE"),T.experience))X(e.title||"",[S([e.company,e.location]).join(", "),O(e.startDate,e.endDate,e.current)].filter(T=>!!T),e.bullets||[],!0);r+=12}if(T.education?.length){for(let e of(c("EDUCATION"),T.education))X(e.degree||"",[S([e.school,e.location]).join(", "),O(e.startDate,e.endDate),e.gpa?`GPA: ${e.gpa}`:""].filter(T=>!!T),void 0,!0);r+=12}if(T.certifications?.length){for(let e of(c("CERTIFICATIONS"),T.certifications))X(e.name||"",S([e.issuer,e.date]),void 0,!0);r+=12}if(T.projects?.length){for(let e of(c("PROJECTS"),T.projects))X(e.name||"",S([e.link]),[e.description,...e.bullets||[]].filter(T=>!!T),!0);r+=12}T.languages?.length&&(c("LANGUAGES"),(T=>{for(let i of T){let T=A(i,420,12);s(18*T.length),e[E].push(a(110.5,r-6,2.5,t));for(let t=0;t<T.length;t+=1)e[E].push(U(120,r,T[t],{size:12,font:"F1",color:L})),r+=18}})(T.languages.map(T=>`${T.name}${T.proficiency?` (${T.proficiency})`:""}`).filter(Boolean)));let R=[],m=T=>(R.push(T),R.length),M=m("<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica >>"),f=m("<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica-Bold >>"),C=m("<< /Type /ExtGState /ca 0.10 /CA 0.10 >>"),u=R.length+1;R.push("");let P=R.length+1;R.push(`<< /Type /Catalog /Pages ${u} 0 R >>`);let B=[];for(let T of e){let e=T.join("\n"),E=m(`<< /Length ${Buffer.byteLength(e,"utf8")} >>
stream
${e}
endstream`),t=m(`<< /Type /Page /Parent ${u} 0 R /MediaBox [0 0 612 792] /Resources << /Font << /F1 ${M} 0 R /F2 ${f} 0 R >> /ExtGState << /G1 ${C} 0 R >> >> /Contents ${E} 0 R >>`);B.push(t)}R[u-1]=`<< /Type /Pages /Kids [${B.map(T=>`${T} 0 R`).join(" ")}] /Count ${B.length} >>`;let g="%PDF-1.4\n%\xe2\xe3\xcf\xd3\n",y=[0];for(let T=0;T<R.length;T+=1)y.push(Buffer.byteLength(g,"utf8")),g+=`${T+1} 0 obj
${R[T]}
endobj
`;let $=Buffer.byteLength(g,"utf8");g+=`xref
0 ${R.length+1}
0000000000 65535 f 
`;for(let T=1;T<y.length;T+=1)g+=`${String(y[T]).padStart(10,"0")} 00000 n 
`;return g+=`trailer
<< /Size ${R.length+1} /Root ${P} 0 R >>
startxref
${$}
%%EOF`,Buffer.from(g,"binary")}}};