"use strict";(()=>{var e={};e.id=4727,e.ids=[4727],e.modules={39908:e=>{e.exports=require("@moduletrace/datasquirel/dist/users/user-auth")},75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},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")},27310:(e,r,t)=>{t.r(r),t.d(r,{config:()=>p,default:()=>c,routeModule:()=>m});var a={};t.r(a),t.d(a,{config:()=>u,default:()=>d});var s=t(89947),o=t(2706),i=t(96762),l=t(69842),n=t(33170);let u={api:{responseLimit:"1mb",bodyParser:{sizeLimit:"200mb"}}};async function d(e,r){if("POST"!==e.method)return r.json({msg:"Failed!"});let t=await (0,l.A)(e,r,!0);if(!t)return r.json({success:!1,msg:"Unauthorized"});let{paradigm:a,dbName:s,tableName:o,payload:i}=e.body;try{let e=await (0,n.A)({dbName:s,paradigm:a,payload:i,tableName:o,userId:t.id,payloadType:"base64"});if(!e)return r.json({success:!1,msg:"Operation Failed!"});r.json({success:!0,msg:"Success!",data:e?.tableData})}catch(e){r.json({success:!1,msg:e.message})}}let c=(0,i.M)(a,"default"),p=(0,i.M)(a,"config"),m=new s.PagesAPIRouteModule({definition:{kind:o.A.PAGES_API,page:"/api/exportTableData",pathname:"/api/exportTableData",bundlePath:"",filename:""},userland:a})},33170:(e,r,t)=>{t.d(r,{A:()=>i});var a=t(98e3),s=t(67619),o=t(48786);async function i({paradigm:e,userId:r,dbName:t,tableName:i,payload:l,payloadType:n}){let u={};try{let s=`${process.env.DSQL_USER_DB_PREFIX}${r}_${t.replace(/ /g,"")}`;switch(e){case"export":let d=await (0,o.A)(`SELECT * FROM \`${s}\`.\`${i}\``);u.tableData=d;break;case"import":let c="base64"==n?Buffer.from(l,"base64").toString():l,p="object"===n?l:JSON.parse(c);for(let e=0;e