"use strict";(()=>{var e={};e.id=3462,e.ids=[3462],e.modules={76102:e=>{e.exports=require("@moduletrace/datasquirel/dist/client")},39383:e=>{e.exports=require("@moduletrace/datasquirel/dist/package-shared/actions/users/user-auth")},65967:e=>{e.exports=require("@moduletrace/datasquirel/dist/package-shared/utils/ejson")},93726:e=>{e.exports=require("@moduletrace/datasquirel/dist/package-shared/utils/numberfy")},30889:e=>{e.exports=require("@moduletrace/datasquirel/dist/package-shared/utils/slugify")},75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},9973:e=>{e.exports=require("serverless-mysql")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){return function e(r,s){return s in r?r[s]:"then"in r&&"function"==typeof r.then?r.then(r=>e(r,s)):"function"==typeof r&&"default"===s?r:void 0}}})},22792:(e,r,s)=>{s.r(r),s.d(r,{config:()=>S,default:()=>D,routeModule:()=>d});var o={};s.r(o),s.d(o,{default:()=>u});var t=s(89947),_=s(2706),n=s(96762),a=s(48786),i=s(69842);async function u(e,r){if("POST"!==e.method)return r.json({msg:"Failed!"});let{user:s}=await (0,i.A)(e,r,!0);if(!s)return r.json({success:!1,msg:"Unauthorized"});let o=e.body,{user_type:t,user_id:_,email:n,invited_user_id:u}=o;await (0,a.A)("DELETE FROM user_users WHERE id=?",[o.id]),t?.match(/admin/i)&&(await (0,a.A)("DELETE FROM invitations WHERE inviting_user_id=? AND invited_user_email=?",[s.id,n]),await (0,a.A)("DELETE FROM delegated_user_tables WHERE delegated_user_id=? AND root_user_id=?",[u,s.id])),r.json({success:!0,msg:"User Deleted!"})}let D=(0,n.M)(o,"default"),S=(0,n.M)(o,"config"),d=new t.PagesAPIRouteModule({definition:{kind:_.A.PAGES_API,page:"/api/deleteUserUser",pathname:"/api/deleteUserUser",bundlePath:"",filename:""},userland:o})},55153:(e,r,s)=>{s.d(r,{On:()=>t.a,_n:()=>n}),s(76102);var o=s(65967),t=s.n(o);s(30889);var _=s(93726);let n=s.n(_)()},69842:(e,r,s)=>{s.d(r,{A:()=>n});var o=s(39383),t=s.n(o),_=s(55153);async function n(e,r,s,o){let n=t()({req:e,level:s?"deep":void 0}),a={DSQL_REMOTE_SQL_HOST:process.env.DSQL_REMOTE_SQL_HOST,DSQL_SU_USER_ID:process.env.DSQL_SU_USER_ID,DSQL_HOST_ENV:process.env.DSQL_HOST_ENV,DSQL_HOST:process.env.DSQL_HOST,DSQL_STATIC_HOST:process.env.DSQL_STATIC_HOST,DSQL_GOOGLE_CLIENT_ID:process.env.DSQL_GOOGLE_CLIENT_ID,DSQL_TINY_MCE_API_KEY:process.env.DSQL_TINY_MCE_API_KEY};return o&&n.payload?.id&&(0,_._n)(process.env.DSQL_SU_USER_ID)!==n.payload.id?{user:null,appData:a}:{user:n.payload,appData:a}}},48786:(e,r,s)=>{s.d(r,{A:()=>t});var o=s(7447);async function t(...e){let r=(0,o.A)();try{if(!r)throw Error("No Connection provided to DB_HANDLER function!");let s=await r.query(...e);return JSON.parse(JSON.stringify(s))}catch(e){return console.log("DB Error =>",e),{success:!1,error:e.message}}finally{await r?.end()}}},7447:(e,r,s)=>{s.d(r,{A:()=>_});var o=s(9973),t=s.n(o);function _(e){return global.DSQL_USE_LOCAL||e?.local?global.DSQL_DB_CONN||t()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_USERNAME,password:process.env.DSQL_DB_PASSWORD,database:e?.noDb?void 0:process.env.DSQL_DB_NAME,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}}):e?.ro?global.DSQL_READ_ONLY_DB_CONN||t()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_READ_ONLY_USERNAME,password:process.env.DSQL_DB_READ_ONLY_PASSWORD,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}}):e?.fa?global.DSQL_FULL_ACCESS_DB_CONN||t()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_FULL_ACCESS_USERNAME,password:process.env.DSQL_DB_FULL_ACCESS_PASSWORD,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}}):global.DSQL_DB_CONN||t()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_USERNAME,password:process.env.DSQL_DB_PASSWORD,database:e?.noDb?void 0:process.env.DSQL_DB_NAME,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}})}},2706:(e,r)=>{Object.defineProperty(r,"A",{enumerable:!0,get:function(){return s}});var s=function(e){return e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.IMAGE="IMAGE",e}({})},89947:(e,r,s)=>{e.exports=s(75600)}};var r=require("../../webpack-api-runtime.js");r.C(e);var s=r(r.s=22792);module.exports=s})();