"use strict";(()=>{vare={};e.id=3812,e.ids=[3812],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},21572:e=>{e.exports=require("nodemailer")},72583:e=>{e.exports=require("sanitize-html")},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")},70955:(e,s,a)=>{a.r(s),a.d(s,{config:()=>m,default:()=>p,routeModule:()=>v});varr={};a.r(r),a.d(r,{default:()=>_});vart=a(89947),i=a(2706),n=a(96762),d=a(96052),l=a(69842),u=a(98e3),c=a(48786),o=a(83919);asyncfunction_(e,s){if("POST"!==e.method)returns.json({msg:"Failed!"});leta=await(0,l.A)(e,s,!0);if(!a)returns.json({success:!1,msg:"Unauthorized"});letr=e.body,t=r.paradigm;if(t?.match(/database/)){lete=await(0,u.A)({dbFullName:"datasquirel",tableName:"user_users",data:(()=>{lete=Object.keys(r),s={};returne.forEach(e=>{e?.match(/paradigm|priviledge|database_access|databases|confirm/)||(s[e]=r[e])}),s.user_id=a.id,s.password=(0,o.A)({encryptionKey:process.env.DSQL_ENCRYPTION_PASSWORD||"",password:r.password}),s.user_type="database",s.email=r.email_address,s.image="/images/user-preset.png",s.image_thumbnail="/images/user-preset-thumbnail.png",deletes.email_address,s})()});s.json({success:!!e?.insertId,msg:"New User User Added",newUserId:e.insertId})}else{if(a?.email===r.email_address)returns.json({success:!1,msg:"Can't Invite yourself"});lete=await(0,c.A)("SELECT * FROM invitations WHERE invited_user_email=? AND inviting_user_id=?",[r.email_address,a.id]);if(e&&e[0])returns.json({success:!1,msg:"User Already Invited"});await(0,u.A)({dbFullName:"datasquirel",tableName:"invitations",data:{inviting_user_id:a.id,invited_user_email:r.email_address,database_access:r.database_access,priviledge:r.priviledge,db_tables_data:r.db_tables}});lett=await(0,d.default)({to:r.email_address,subject:`${a.first_name}${a.last_name} Invited you`,text:`${a.first_name}${a.last_name} has invited you to manage a datasquirel account`,html:`