"use strict";(()=>{var T={};T.id=5409,T.ids=[5409],T.modules={20399:T=>{T.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:T=>{T.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},84770:T=>{T.exports=require("crypto")},92048:T=>{T.exports=require("fs")},19801:T=>{T.exports=require("os")},55315:T=>{T.exports=require("path")},92761:T=>{T.exports=require("node:async_hooks")},17718:T=>{T.exports=require("node:child_process")},6005:T=>{T.exports=require("node:crypto")},15673:T=>{T.exports=require("node:events")},87561:T=>{T.exports=require("node:fs")},93977:T=>{T.exports=require("node:fs/promises")},70612:T=>{T.exports=require("node:os")},49411:T=>{T.exports=require("node:path")},97742:T=>{T.exports=require("node:process")},25997:T=>{T.exports=require("node:tty")},47261:T=>{T.exports=require("node:util")},586:(T,e,E)=>{E.r(e),E.d(e,{originalPathname:()=>M,patchFetch:()=>F,requestAsyncStorage:()=>p,routeModule:()=>l,serverHooks:()=>R,staticGenerationAsyncStorage:()=>X});var L={};E.r(L),E.d(L,{POST:()=>D,dynamic:()=>n});var N=E(49790),r=E(60540),t=E(82273),i=E(19096),A=E(23734),a=E.n(A),o=E(84770),s=E.n(o),U=E(92795),O=E(93334);let n="force-dynamic";function I(T){return"string"!=typeof T?"":T.trim().slice(0,60)}async function S(T,e,E){}async function D(T){try{await (0,O.X)(U._);let e=await T.json(),E=I(e.firstName),L=I(e.lastName),N="string"==typeof e.email?e.email.trim().toLowerCase():"",r="string"==typeof e.password?e.password:"";if(!E&&!e.name)return i.NextResponse.json({error:"First name is required."},{status:400});if(!("string"==typeof N&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(N)&&N.length<=200))return i.NextResponse.json({error:"Please enter a valid email address."},{status:400});if(r.length<8)return i.NextResponse.json({error:"Password must be at least 8 characters."},{status:400});let t=I(e.name),A=E||t.split(" ")[0]||"",o=L||t.split(" ").slice(1).join(" ")||"",n=[A,o].filter(Boolean).join(" ").trim()||null,D=await a().hash(r,10),l=s().randomBytes(32).toString("hex"),p=new Date(Date.now()+864e5),X="true"===String(process.env.REQUIRE_EMAIL_VERIFICATION||"").toLowerCase(),R="true"===String(process.env.SKIP_EMAIL_VERIFICATION||"").toLowerCase()||!X,M=await U._.user.findUnique({where:{email:N},include:{profile:!0}}),F=M;if(M){if(!(!M.emailVerified||!M.profile||!M.firstName||!M.password))return i.NextResponse.json({error:"An account with this email already exists. Please sign in or use Forgot password."},{status:409});F=await U._.user.update({where:{id:M.id},data:{password:D,name:n,firstName:A||null,lastName:o||null,emailVerified:R?new Date:M.emailVerified,verificationToken:R?null:l,verificationTokenExpiry:R?null:p},include:{profile:!0}})}else F=await U._.user.create({data:{email:N,password:D,name:n,firstName:A||null,lastName:o||null,emailVerified:R?new Date:null,verificationToken:R?null:l,verificationTokenExpiry:R?null:p},include:{profile:!0}});if(F.profile?F.profile.email&&F.profile.fullName||await U._.profile.update({where:{userId:F.id},data:{email:F.profile.email||F.email,fullName:F.profile.fullName||n||""}}):await U._.profile.create({data:{userId:F.id,email:F.email,fullName:n||""}}),!R){let T=(process.env.NEXTAUTH_URL||"").replace(/\/$/,""),e=`${T}/verify-email?token=${encodeURIComponent(l)}`;await S(N,A,e)}return i.NextResponse.json({ok:!0,email:N,autoActivated:R})}catch(T){return console.error("signup error",T),i.NextResponse.json({error:"Signup failed. Please try again."},{status:500})}}let l=new N.AppRouteRouteModule({definition:{kind:r.x.APP_ROUTE,page:"/api/signup/route",pathname:"/api/signup",filename:"route",bundlePath:"app/api/signup/route"},resolvedPagePath:"/Users/andrasgyenes/Desktop/MrQuery 2026/HyreMe/Archive/hyreme-app/app/api/signup/route.ts",nextConfigOutput:"standalone",userland:L}),{requestAsyncStorage:p,staticGenerationAsyncStorage:X,serverHooks:R}=l,M="/api/signup/route";function F(){return(0,t.patchFetch)({serverHooks:R,staticGenerationAsyncStorage:X})}},93334:(T,e,E)=>{E.d(e,{X:()=>t});let L=globalThis,N=[`
  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 r(T){for(let e of N)await T.$executeRawUnsafe(e)}async function t(T){"true"!==String(process.env.LOCAL_DEV_MODE||"").toLowerCase()&&(L.hyremeSchemaReady||(L.hyremeSchemaReady=r(T).catch(T=>{throw L.hyremeSchemaReady=void 0,T})),await L.hyremeSchemaReady)}}};var e=require("../../../webpack-runtime.js");e.C(T);var E=T=>e(e.s=T),L=e.X(0,[9085,400,8664,2795],()=>E(586));module.exports=L})();