"use strict";(()=>{var e={};e.id=9214,e.ids=[9214],e.modules={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")},57147:e=>{e.exports=require("fs")},71017:e=>{e.exports=require("path")},49053:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>y,patchFetch:()=>h,requestAsyncStorage:()=>m,routeModule:()=>w,serverHooks:()=>v,staticGenerationAsyncStorage:()=>f});var a={};r.r(a),r.d(a,{POST:()=>g});var s=r(49303),i=r(88716),n=r(60670),o=r(87070),u=r(57147),d=r.n(u),p=r(71017),l=r.n(p);let c=(e,t,r)=>{try{let a=t.replace(/[^a-zA-Z0-9]/g,"_").toLowerCase(),s=r.replace(/[^a-zA-Z0-9]/g,"_").toLowerCase(),i=l().join(l().resolve(process.cwd(),".."),"data",s),n=l().join(i,`${a}.json`);d().existsSync(i)||d().mkdirSync(i,{recursive:!0});let o=[],u=d().existsSync(n),p="website_data"===s;if(u){let t=d().readFileSync(n,"utf-8");if(t.trim().length>0&&(o=JSON.parse(t)),p){if(o.length===e.length)return{updated:!1,message:"Length is same, no update needed."};return d().writeFileSync(n,JSON.stringify(e,null,2)),{updated:!0,message:"Data updated successfully (website_data)."}}return d().writeFileSync(n,JSON.stringify(e,null,2)),{updated:!0,message:"Data overwritten in non-website_data folder."}}return d().writeFileSync(n,JSON.stringify(e,null,2)),{updated:!0,message:"New file created."}}catch(e){return console.error("❌ Error writing file:",e.message),{updated:!1,message:"Error occurred during file write."}}};async function g(e){let{data:t,fileName:r,folderName:a}=await e.json();if(!Array.isArray(t))return o.NextResponse.json({error:"Data must be an array."},{status:400});let s=c(t,r,a);return o.NextResponse.json({message:s.message})}let w=new s.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/save_website_data/route",pathname:"/api/save_website_data",filename:"route",bundlePath:"app/api/save_website_data/route"},resolvedPagePath:"C:\\Users\\Design Collection\\OneDrive\\Desktop\\Jitendra Vishwakarma\\Next Dashboard\\web crawler for user dev\\Scrape Genius\\app\\api\\save_website_data\\route.js",nextConfigOutput:"",userland:a}),{requestAsyncStorage:m,staticGenerationAsyncStorage:f,serverHooks:v}=w,y="/api/save_website_data/route";function h(){return(0,n.patchFetch)({serverHooks:v,staticGenerationAsyncStorage:f})}}};var t=require("../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),a=t.X(0,[8948,5972],()=>r(49053));module.exports=a})();