"use strict";(()=>{vare={};e.id=3e3,e.ids=[3e3],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")},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}}})},47389:(e,r,t)=>{t.r(r),t.d(r,{config:()=>E,default:()=>D,routeModule:()=>y});vars={};t.r(s),t.d(s,{default:()=>_});varn=t(89947),a=t(2706),i=t(96762),o=t(51348),l=t.n(o),c=t(77538),u=t.n(c),d=t(6420),p=t.n(d),f=t(51926),S=t.n(f);letm=t(29021);asyncfunction_(e,r){if("POST"!==e.method)returnr.json({msg:"Failed!"});lett=awaitp()(e,r,!0);if(!t)returnr.json({success:!1,msg:"Unauthorized"});let{id:s,db_slug:n,db_full_name:a}=e.body;if(!a.match(`user_${t.id}_`))throwError("Database doesn't belong to user");awaitS()(`DROP DATABASE \`${a}\``),awaitl()("DELETE FROM user_databases WHERE id = ?",[s]),awaitl()("DELETE FROM user_users WHERE user_id = ? AND `database` = ?",[t.id,n]);try{lete;lets=`${process.env.DSQL_USER_DB_SCHEMA_PATH}/user-${t.id}/main.json`,n=JSON.parse(m.readFileSync(s,"utf8")),i=n.filter((r,t)=>{if(r.dbFullName===a)returne=t,!0});if(i[0].childDatabase){lete=n.filter(e=>e.dbFullName===i[0].childDatabaseDbFullName)[0],r=e.childrenDatabases?.findIndex(e=>e.dbFullName===i[0].childDatabaseDbFullName);e.childrenDatabases&&"number"==typeofr&&e.childrenDatabases.splice(r,1)}n.splice(e,1),m.writeFileSync(`${s}`,JSON.stringify(n),"utf8"),r.json({success:!0})}catch(e){u()({component:"/api/deleteUserDatabase/main-catch-error",message:e.message,user:t}),r.json({success:!1,msg:"File Updates Failed"})}}letD=(0,i.M)(s,"default"),E=(0,i.M)(s,"config"),y=newn.PagesAPIRouteModule({definition:{kind:a.A.PAGES_API,page:"/api/deleteUserDatabase",pathname:"/api/deleteUserDatabase",bundlePath:"",filename:""},userland:s})},77538:(e,r,t)=>{lets=t(29021),{IncomingMessage:n}=t(81630);e.exports=asyncfunction({user:e,message:r,component:t,noMail:n,req:a}){leti=newDate,o=(()=>{if(!a)returnnull;try{lete=a.headers["x-forwarded-for"],r=a.headers["x-real-ip"],t=a.headers["cf-connecting-ip"],s=Array.isArray(e)?e[0]:e?.split(",")[0],n=t||s||r||a.socket.remoteAddress;if(!n)returnnull;returnString(n)}catch(e){returnnull}})();try{letn=`🚀 SERVER ERROR ===========================