"use strict";(()=>{vare={};e.id=9664,e.ids=[9664],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},9973:e=>{e.exports=require("serverless-mysql")},79428:e=>{e.exports=require("buffer")},55511:e=>{e.exports=require("crypto")},29021:e=>{e.exports=require("fs")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){returnfunctione(r,s){returnsinr?r[s]:"then"inr&&"function"==typeofr.then?r.then(r=>e(r,s)):"function"==typeofr&&"default"===s?r:void0}}})},75461:(e,r,s)=>{s.r(r),s.d(r,{config:()=>p,default:()=>S,routeModule:()=>d});varo={};s.r(o),s.d(o,{default:()=>l});varn=s(89947),t=s(2706),_=s(96762),a=s(48786),c=s(87369),i=s(29021),u=s.n(i);asyncfunctionl(e,r){if("POST"!==e.method)returnr.json({success:!1,msg:"Wrong Method"});lets=await(0,c.A)(e);if(!s?.logged_in_status)returnr.json({success:!1,log:"No Logs"});leto=e.body.user,n=o?.id.toString().replace(/[^0-9]/g,"").replace(/\//g,""),t=`${process.env.DSQL_USER_DB_SCHEMA_PATH}/user-${n}`,_=[];!functione({originArray:r,rootPath:s}){leto=u().readdirSync(s);for(letn=0;n<o.length;n++){lett=o[n];if(t?.match(/\..{2,5}$/))r.push({name:t,type:"file",root:s});else{leto={name:t,type:"folder",root:s,content:[]};e({originArray:o.content,rootPath:`${s}/${t}`}),r.push(o)}}}({originArray:_,rootPath:t});leti=await(0,a.A)(`SHOW databases LIKE 'datasquirel_user_${o.id}_%'`);r.json({success:!0,data:_,databases:i.map(e=>Object.values(e)[0])})}letS=(0,_.M)(o,"default"),p=(0,_.M)(o,"config"),d=newn.PagesAPIRouteModule({definition:{kind:t.A.PAGES_API,page:"/api/admin/getUserData",pathname:"/api/admin/getUserData",bundlePath:"",filename:""},userland:o})},87369:(e,r,s)=>{s.d(r,{A:()=>t});varo=s(95969),n=s(89159);asyncfunctiont(e){let{keyCookieName:r,csrfCookieName:s}=(0,n.A)(),t=`${r}_su`;if(!e.cookies?.[t])returnconsole.log("No auth key cookie found"),null;let_=(0,o.A)({encryptedString:e.cookies[t]});if(!_)returnconsole.log("No user payload found"),null;leta=JSON.parse(_);returna.password!==process.env.DSQL_USER_KEY?(console.log("Invalid password"),null):a.authKey!==process.env.DSQL_SPECIAL_KEY?(console.log("Invalid auth key"),null):a}},89159:(e,r,s)=>{s.d(r,{A:()=>o});functiono(e){letr=process.env.DSQL_COOKIES_PREFIX||"dsql_",s=process.env.DSQL_COOKIES_KEY_NAME||"key",o=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",n=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",t=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),_=r;e?.userId&&(_+=`user_${e.userId}_`),t&&(_+=`${t}_`),_+=s;leta=r;e?.userId&&(a+=`user_${e.userId}_`),t&&(a+=`${t}_`),a+=o;letc=r;returne?.userId&&(c+=`user_${e.userId}_`),t&&(c+=`${t}_`),{keyCookieName:_,csrfCookieName:a,oneTimeCodeName:c+=n}}},95969:(e,r,s)=>{s.d(r,{A:()=>_});varo=s(55511),n=s(79428),t=s(31542);function_({encryptedString:e,encryptionKey:r,encryptionSalt:s}){if(!e?.match(/./))returnconsole.log("Encrypted string is invalid"),e;let{key:_,salt:a,keyLen:c,algorithm:i,bufferAllocSize:u}=(0,t.A)({encryptionKey:r});if(!_?.match(/.{8,}/))returnconsole.log("Decrption key is invalid"),e;if(!a?.match(/.{8,}/))returnconsole.log("Decrption salt is invalid"),e;letl=(0,o.scryptSync)(_,a,c),S=n.Buffer.alloc(u,0),p=(0,o.createDecipheriv)(i,l,S);try{letr=p.update(e,"hex","utf8");returnr+=p.final("utf8")}catch(r){returnconsole.log("Error in decrypting =>",r.message),e}}},48786:(e,r,s)=>{s.d(r,{A:()=>n});varo=s(7447);asyncfunctionn(...e){letr=(0,o.A)();try{if(!r)throwError("No Connection provided to DB_HANDLER function!");lets=awaitr.query(...e);returnJSON.parse(JSON.stringify(s))}catch(e){returnconsole.log("DB Error =>",e),{success:!1,error:e.message}}finally{awaitr?.end()}}},7447:(e,r,s)=>{s.d(r,{A:()=>t});varo=s(9973),n=s.n(o);functiont(e){returnglobal.DSQL_USE_LOCAL||e?.local?global.DSQL_DB_CONN||n()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_USERNAME,password:process.env.DSQL_DB_PASSWORD,database:e?.noDb?void0:process.env.DSQL_DB_NAME,port:process.env.DSQL_