"use strict";(()=>{var e={};e.id=3560,e.ids=[3560],e.modules={85890:e=>{e.exports=require("better-sqlite3")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},61282:e=>{e.exports=require("child_process")},84770:e=>{e.exports=require("crypto")},92048:e=>{e.exports=require("fs")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},21764:e=>{e.exports=require("util")},88026:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>v,patchFetch:()=>j,requestAsyncStorage:()=>x,routeModule:()=>c,serverHooks:()=>g,staticGenerationAsyncStorage:()=>h});var o={};r.r(o),r.d(o,{GET:()=>m});var s=r(49303),i=r(88716),n=r(60670),a=r(87070),u=r(94925),p=r(30721),d=r(46155),f=r(32253),l=r(39798);async function m(e,{params:t}){try{if(!(0,d.m$)(t.id))return a.NextResponse.json({error:"Invalid worktree ID format"},{status:400});let{searchParams:r}=new URL(e.url),o=r.get("commit"),s=r.get("file");if(!o||!l.S.test(o))return a.NextResponse.json({error:"Invalid commit hash format"},{status:400});if(!s)return a.NextResponse.json({error:"Invalid file path"},{status:400});let i=(0,u.getDbInstance)(),n=(0,p.gU)(i,t.id);if(!n)return a.NextResponse.json({error:"Worktree not found"},{status:404});if(!(0,d.jj)(s,n.path))return a.NextResponse.json({error:"Invalid file path"},{status:400});let m=await (0,f.$o)(n.path,o,s);if(null===m)return a.NextResponse.json({error:"Commit not found"},{status:404});return a.NextResponse.json({diff:m},{status:200})}catch(e){return(0,f.Vt)(e,"GET /api/worktrees/:id/git/diff")}}let c=new s.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/worktrees/[id]/git/diff/route",pathname:"/api/worktrees/[id]/git/diff",filename:"route",bundlePath:"app/api/worktrees/[id]/git/diff/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/worktrees/[id]/git/diff/route.ts",nextConfigOutput:"",userland:o}),{requestAsyncStorage:x,staticGenerationAsyncStorage:h,serverHooks:g}=c,v="/api/worktrees/[id]/git/diff/route";function j(){return(0,n.patchFetch)({serverHooks:g,staticGenerationAsyncStorage:h})}}};var t=require("../../../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),o=t.X(0,[8948,5972,3895,4925,721,9922],()=>r(88026));module.exports=o})();