"use strict";(()=>{var e={};e.id=9409,e.ids=[9409],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")},56681:e=>{e.exports=require("playwright")},34262:(e,t,a)=>{a.r(t),a.d(t,{originalPathname:()=>m,patchFetch:()=>x,requestAsyncStorage:()=>w,routeModule:()=>l,serverHooks:()=>d,staticGenerationAsyncStorage:()=>h});var o={};a.r(o),a.d(o,{POST:()=>u});var r=a(49303),i=a(88716),s=a(60670),n=a(87070),p=a(56681),c=a.n(p);async function u(e){let t;try{let a,o;let r=new AbortController;r.signal,e.signal?.addEventListener("abort",()=>{r.abort()});let{apiCall:i=!1,code:s,phone:u,countryISO:l="IN",needUser:w=!1,sender:h=!1,message:d=""}=await e.json();if(!u||u.toLowerCase().includes("n/a"))return n.NextResponse.json({error:"Incorrect phone number"},{status:400});if(h){o=(a=(t=await p.chromium.connectOverCDP("http://localhost:9222")).contexts()[0]).pages()[0],await o.goto(`https://web.whatsapp.com/send/?phone=${s}${u}&utm_campaign=wa_api_send_v2`,{waitUntil:"domcontentloaded",timeout:6e4}),await o.waitForTimeout(1e3);try{await o.waitForSelector('div[aria-placeholder="Type a message"]',{timeout:3e4}),await o.waitForTimeout(3e3);let e=await o.$('div[aria-placeholder="Type a message"]');for(let t of(e&&await e.click(),await o.waitForTimeout(1500),d.split("")))await o.keyboard.type(t),await o.waitForTimeout(function(e=50,t=300){return Math.floor(Math.random()*(t-e+1))+e}());return await o.waitForTimeout(1500),await o.keyboard.press("Enter"),await o.waitForTimeout(1500),n.NextResponse.json({isClicked:!!button})}catch(e){return n.NextResponse.json({isClicked:!1,error:!0})}}else{let e;let r={};if(i)try{let t=await fetch(`https://umnico.com/api/tools/checker?phone=+${s}${u}`),a=await t.json();console.log(a),e=a.exists,r=a}catch(e){return n.NextResponse.json({error:"Failed to process phone"},{status:500})}else t=await c().chromium.launch(),a=await t.newContext({userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119 Safari/537.36",viewport:{width:1280,height:720}}),o=await a.newPage(),await o.goto(`https://api.whatsapp.com/send/?phone=${s}${u}`,{waitUntil:"domcontentloaded",timeout:6e4}),await o.waitForTimeout(1e3),e=await o.evaluate(()=>document.querySelector("#main_block h3")?.innerText||""),await t.close();if(w)return n.NextResponse.json({username:e,status:!!e,phone:u});return n.NextResponse.json({status:!!e,phone:u,api_res:r})}}catch(e){return console.error("Failed to check:",e),n.NextResponse.json({error:"Failed to scrape"},{status:500})}finally{}}let l=new r.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/check_whatsapp/route",pathname:"/api/check_whatsapp",filename:"route",bundlePath:"app/api/check_whatsapp/route"},resolvedPagePath:"C:\\Users\\Design Collection\\OneDrive\\Desktop\\Jitendra Vishwakarma\\Next Dashboard\\web crawler for user dev\\Scrape Genius\\app\\api\\check_whatsapp\\route.js",nextConfigOutput:"",userland:o}),{requestAsyncStorage:w,staticGenerationAsyncStorage:h,serverHooks:d}=l,m="/api/check_whatsapp/route";function x(){return(0,s.patchFetch)({serverHooks:d,staticGenerationAsyncStorage:h})}}};var t=require("../../../webpack-runtime.js");t.C(e);var a=e=>t(t.s=e),o=t.X(0,[8948,5972],()=>a(34262));module.exports=o})();