"use strict";(()=>{vare={};e.id=2101,e.ids=[2101],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")},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}}})},85607:(e,r,t)=>{t.r(r),t.d(r,{config:()=>f,default:()=>d,routeModule:()=>_});varn={};t.r(n),t.d(n,{default:()=>u});vars=t(89947),a=t(2706),o=t(96762),i=t(67619),c=t(69842),l=t(30944);asyncfunctionu(e,r){if("GET"!==e.method)returnr.json({msg:"Failed!"});lett=await(0,c.A)(e,r);if(!t)returnr.json({success:!1,msg:"Unauthorized"});letn=e.query.table,s=e.query.db,a=e.query.field,o=String(e.query.term),u=e.query.operator;try{lete=s?.toString()?.replace(/[^a-z0-9_]/g,""),t=`SELECT * FROM \`${e}\`.\`${n}\` WHERE LOWER(\`${a}\`) ${u?.toString()?.match(/equal/i)?"=":" LIKE "}? ORDER BY id DESC LIMIT 20`,i=[u?.toString()?.match(/equal/i)?o.toLowerCase():"%"+o.toLowerCase()+"%"],c=await(0,l.A)({database:e,queryString:t,queryValuesArray:i}),d=await(0,l.A)({database:e,queryString:t.replace(/\*/,"COUNT(id) AS count").replace(/ ORDER BY .*/,""),queryValuesArray:i});r.json({success:!0,result:c,count:d?.[0]?.count})}catch(e){(0,i.default)({component:"/api/queryEntriesSearchTerm/main-catch-error",message:e.message,user:t}),r.json({success:!1,msg:"Failed!"})}}letd=(0,o.M)(n,"default"),f=(0,o.M)(n,"config"),_=news.PagesAPIRouteModule({definition:{kind:a.A.PAGES_API,page:"/api/queryEntriesSearchTerm",pathname:"/api/queryEntriesSearchTerm",bundlePath:"",filename:""},userland:n})},69842:(e,r,t)=>{t.d(r,{A:()=>c});varn=t(48786),s=t(95969),a=t(29021),o=t.n(a),i=t(89159);asyncfunctionc(e,r,t){try{let{keyCookieName:a,csrfCookieName:c}=(0,i.A)();if(!e.cookies?.[a]?.match(/./))throwError("Request Cookies not Found!");letl=(0,s.A)({encryptedString:e.cookies[a]});if(!l)throwError("Couldn't decrypt auth cookie!");letu=JSON.parse(l);if(!u.csrf_k)throwError("No `csrf_k` present in user Object!");if(t&&!Object.keys(e.headers).find(e=>e.includes(u.csrf_k)))throwError("Deep Auth Failed. `csrf` key not found in request headers!");letd=process.env.DSQL_USER_LOGIN_KEYS_PATH;if(!d)throwError("DSQL_USER_LOGIN_KEYS_PATH env variable not found. Please set this variable.");if(t&&!o().existsSync(`${d}/${u.csrf_k}`))throwError("Key not found in Auth Keys Folder!");if(0==u.verification_status&&!t){lete=await(0,n.A)(`SELECT verification_status FROM users WHERE id='${u.id}'`);e&&e[0]&&1==e[0].verification_status&&r.setHeader("Set-Cookie",["user_refresh=1"])}if(u?.date&&Date.now()-u.date>6048e5)throwError("Key expired!");returnu}catch(e){returnconsole.log(`userAuth Error: ${e.message}`),null}}},89159:(e,r,t)=>{t.d(r,{A:()=>n});functionn(e){letr=process.env.DSQL_COOKIES_PREFIX||"dsql_",t=process.env.DSQL_COOKIES_KEY_NAME||"key",n=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",s=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",a=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),o=r;e?.userId&&(o+=`user_${e.userId}_`),a&&(o+=`${a}_`),o+=t;leti=r;e?.userId&&(i+=`user_${e.userId}_`),a&&(i+=`${a}_`),i+=n;letc=r;returne?.userId&&(c+=`user_${e.userId}_`),a&&(c+=`${a}_`),{keyCookieName:o,csrfCookieName:i,oneTimeCodeName:c+=s}}},43775:(e,r,t)=>{t.d(r,{A:()=>a});varn=t(95969);lets=/^id$|^uuid$|^date_created$|^date_created_code$|^date_created_timestamp$|^date_updated$|^date_updated_code$|^date_updated_timestamp$/;asyncfunctiona({unparsedResults:e,tableSchema:r}){lett=[];try{for(leta=0;a<e.length;a++){leto=e[a],i=Object.keys(o);for(lete=0;e<i.length;e++){lett=i[e],a=r?.fields[e];if(t?.match(s))continue;letc=o[t];("number"==typeofc||c)&&a?.encrypted&&c?.match(/./)&&(o[t]=(0,n.A)({encryptedString:c}))}t.push(o)}returnt}catch(r){returnconsole.log(