"use strict";(()=>{var e={};e.id=6638,e.ids=[6638],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")},39491:e=>{e.exports=require("assert")},6113:e=>{e.exports=require("crypto")},82361:e=>{e.exports=require("events")},57147:e=>{e.exports=require("fs")},13685:e=>{e.exports=require("http")},85158:e=>{e.exports=require("http2")},95687:e=>{e.exports=require("https")},22037:e=>{e.exports=require("os")},71017:e=>{e.exports=require("path")},12781:e=>{e.exports=require("stream")},76224:e=>{e.exports=require("tty")},57310:e=>{e.exports=require("url")},73837:e=>{e.exports=require("util")},59796:e=>{e.exports=require("zlib")},33528:(e,s,t)=>{t.r(s),t.d(s,{originalPathname:()=>b,patchFetch:()=>c,requestAsyncStorage:()=>d,routeModule:()=>_,serverHooks:()=>g,staticGenerationAsyncStorage:()=>l});var r={};t.r(r),t.d(r,{POST:()=>o});var a=t(49303),n=t(88716),i=t(60670),u=t(24263),p=t(87070);async function o(e){try{let{gst:s,name:t}=await e.json();if(!s)return p.NextResponse.json({error:"gst is required"},{status:400});let r={};if("first"===t){let e=(await u.Z.get(`https://app.signalx.ai/apps/gst-verification/gstin-overview/${s}`)).data,a=e=>{let s=new Date(e),t=String(s.getDate()).padStart(2,"0"),r=String(s.getMonth()+1).padStart(2,"0"),a=s.getFullYear();return`${t}/${r}/${a}`},n=e?.filings.length?e?.filings.map(e=>({date:a(e.date_of_filing),due_month:e.tax_period})).filter(e=>e):[],i=a(e.effective_date_of_reg);r={business_legalname:e?.legal_business_name,business_tradename:e?.trade_name,business_address:e?.principal_place_of_business,business_reg_status:e?.gstin_uin_status,business_reg_date:i,business_owner:e?.mbr||[],business_gst:e?.gstin,business_pan:e?.pan||"",business_pincode:e?.pincode||"",business_turnover:e?.aggreTurnOver||"",business_type:e?.constitution_of_business||"",business_rtx:n,business_other_gst:e?.related||[],source:t}}else if("second"===t){let e=(await u.Z.get(`https://csv.vedartsolutionapps.com/app/search_by_gstin?gstin=${s}`)).data.result.data,a=e?.pradr.addr,n=e.lstupdt.split("/"),i=`${n[2]}-${n[1]}-${n[0]}`,p=["Dec","Jan","Feb","Mar","Apr","May","June","July","Aug","Sep","Oct","Nov"][new Date(i).getMonth()];r={business_legalname:e?.lgnm,business_tradename:e?.tradeNam,business_address:`${a.bno}, ${a.bnm}, ${a.st}, ${a.locality}, ${a.loc}, ${a.stcd}, ${a.pncd}`,business_reg_status:e?.sts,business_reg_date:e?.rgdt,business_owner:[],business_gst:e?.gstin,business_pan:"",business_pincode:a.pncd,business_turnover:"",business_type:e?.ctb||"",business_rtx:[{date:e.lstupdt,due_month:p}],business_other_gst:[],source:t}}else if("third"===t){let e=(await u.Z.get(`https://gst.jamku.app/api/gstin/${s}?apiKeySelf=RXLMDMZXQLR`)).data.data,a=e?.returns.length?e?.returns.map(e=>({date:e.dof,due_month:e.taxp})).filter(e=>e):[];r={business_legalname:e?.lgnm,business_tradename:e?.tradeName,business_address:e?.adr,business_reg_status:e?.sts,business_reg_date:e?.rgdt,business_owner:e?.mbr,business_gst:e?.gstin,business_pan:e?.pan,business_pincode:e?.pincode,business_turnover:e?.aggreTurnOver,business_type:e?.ctb,business_rtx:a,business_other_gst:e?.related,source:t}}else if("four"===t){let e=(await u.Z.post("https://api.bulkpe.in/api/checkGST",{gstIn:s})).data.result;r={business_legalname:e?.trade_name.value,business_tradename:e?.legal_name.value,business_address:e?.state_jurisdiction.value,business_reg_status:e?.status.value,business_reg_date:e?.registration_date.value,business_owner:e?.mbr||[],business_gst:e?.gstin.value,business_pan:e?.pan,business_pincode:e?.pincode,business_turnover:e?.aggreTurnOver,business_type:e?.constitution.value,business_rtx:[],business_other_gst:[],source:t}}if(r.business_tradename)return p.NextResponse.json({status:!0,data:r})}catch(e){return p.NextResponse.json({status:!1},{status:500})}}let _=new a.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/gst_detail_scraper/route",pathname:"/api/gst_detail_scraper",filename:"route",bundlePath:"app/api/gst_detail_scraper/route"},resolvedPagePath:"C:\\Users\\Design Collection\\OneDrive\\Desktop\\Jitendra Vishwakarma\\Next Dashboard\\web crawler for user dev\\Scrape Genius\\app\\api\\gst_detail_scraper\\route.js",nextConfigOutput:"",userland:r}),{requestAsyncStorage:d,staticGenerationAsyncStorage:l,serverHooks:g}=_,b="/api/gst_detail_scraper/route";function c(){return(0,i.patchFetch)({serverHooks:g,staticGenerationAsyncStorage:l})}}};var s=require("../../../webpack-runtime.js");s.C(e);var t=e=>s(s.s=e),r=s.X(0,[8948,5972,6577,1053,8552],()=>t(33528));module.exports=r})();