"use strict";(()=>{vare={};e.id=2735,e.ids=[2735],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")},81630:e=>{e.exports=require("http")},33873:e=>{e.exports=require("path")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){returnfunctione(r,t){returntinr?r[t]:"then"inr&&"function"==typeofr.then?r.then(r=>e(r,t)):"function"==typeofr&&"default"===t?r:void0}}})},21734:(e,r,t)=>{t.r(r),t.d(r,{config:()=>y,default:()=>m,routeModule:()=>$});vars={};t.r(s),t.d(s,{default:()=>R});vari=t(89947),n=t(2706),a=t(96762),o=t(51348),u=t.n(o),l=t(83743),c=t.n(l),d=t(77538),E=t.n(d),_=t(6420),S=t.n(_);letf=t(29021),p=t(33873);asyncfunctionR(e,r){if("POST"!==e.method)returnr.json({msg:"Failed!"});lett=awaitS()(e,r,!0);if(!t)returnr.json({success:!1,msg:"Unauthorized"});"production".match(/prod/i);try{awaitu()(`DELETE FROM users WHERE id='${t.id}'`),awaitu()(`DELETE FROM user_users WHERE invited_user_id='${t.id}' OR user_id='${t.id}'`),awaitu()(`DELETE FROM delegated_user_tables WHERE delegated_user_id='${t.id}' OR root_user_id='${t.id}'`),awaitu()(`DELETE FROM user_databases WHERE user_id='${t.id}'`),awaitu()(`DELETE FROM user_database_tables WHERE user_id='${t.id}'`),awaitu()(`DELETE FROM user_media WHERE user_id='${t.id}'`),awaitu()(`DELETE FROM delegated_users WHERE user_id='${t.id}' OR delegated_user_id='${t.id}'`),awaitu()(`DELETE FROM unsubscribes WHERE user_id='${t.id}'`),awaitu()(`DELETE FROM notifications WHERE user_id='${t.id}'`),awaitu()(`DELETE FROM api_keys WHERE user_id='${t.id}'`),awaitu()(`DELETE FROM invitations WHERE inviting_user_id='${t.id}' OR invited_user_email='${t.email}'`);lete=awaitu()("SELECT * FROM mariadb_users WHERE user_id = ?",[t.id]);for(letr=0;r<e.length;r++){let{username:t,host:s}=e[r];awaitu()(`DROP USER IF EXISTS '${t}'@'${s}'`)}lets=awaitu()(`SHOW databases LIKE 'datasquirel_user_${t.id}_%'`);for(lete=0;e<s.length;e++){letr=s[e],t=Object.values(r);awaitu()(`DROP database IF EXISTS ${t}`)}leti=`${process.env.DSQL_USER_DB_SCHEMA_PATH}/user-${t.id}/main.json`;f.existsSync(i)&&f.unlinkSync(i);letn=process.env.DSQL_STATIC_SERVER_DIR;if(!n)throwconsole.log("Static File ENV not Found!"),Error("No Static Path!");leta=p.join(n,`images/user-images/user-${t.id}`);f.existsSync(a)&&c()({rootFolderPath:a}),r.json({success:!0})}catch(e){E()({component:"/api/addApiKey/catch-error",message:e.message,user:t}),r.json({success:!1,msg:"User could not be deleted!"})}}letm=(0,a.M)(s,"default"),y=(0,a.M)(s,"config"),$=newi.PagesAPIRouteModule({definition:{kind:n.A.PAGES_API,page:"/api/deleteUser",pathname:"/api/deleteUser",bundlePath:"",filename:""},userland:s})},83743:(e,r,t)=>{lets=t(29021);e.exports=function({rootFolderPath:e}){try{returnfunctione(r){try{lett=s.readdirSync(r);for(leti=0;i<t.length;i++){letn=t[i];n?.match(/\..{2,5}$/)?s.unlinkSync(`${r}/${n}`):e(`${r}/${n}`)}s.rmdirSync(`${r}`)}catch(e){try{s.unlinkSync(r)}catch(e){}}}(e),s.rmSync(`${e}`,{recursive:!0,force:!0}),!0}catch(e){returnconsole.log("ERROR in deleteFolderRecursively.js function =>",e.message),!1}}},77538:(e,r,t)=>{lets=t(29021),{IncomingMessage:i}=t(81630);e.exports=asyncfunction({user:e,message:r,component:t,noMail:i,req:n}){leta=newDate,o=(()=>{if(!n)returnnull;try{lete=n.headers["x-forwarded-for"],r=n.headers["x-real-ip"],t=n.headers["cf-connecting-ip"],s=Array.isArray(e)?e[0]:e?.split(",")[0],i=t||s||r||n.socket.remoteAddress;if(!i)returnnull;returnString(i)}catch(e){returnnull}})();try{leti=`🚀 SERVER ERROR ===========================