"use strict";(()=>{vare={};e.id=2655,e.ids=[2655],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},21572:e=>{e.exports=require("nodemailer")},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}}})},47601:(e,r,t)=>{t.r(r),t.d(r,{config:()=>f,default:()=>d,routeModule:()=>m});vars={};t.r(s),t.d(s,{default:()=>p});varn=t(89947),o=t(2706),a=t(96762),i=t(2416);letl=t(29021),c=t(96052),u=t(68829);asyncfunctionp(e,r){if("GET"===e.method){lett=u({data:JSON.stringify({email:e.query.email,dateCode:Date.now()})}),s=process.env.DSQL_HOST,n=e.query.email;if(!String(n).match(/.*@.*\..*/))returnr.json({user:null,msg:"Invalid Email"});leto=e.headers["x-real-ip"]||e.headers["x-forwarded-for"]||e.connection.remoteAddress,a=process.env.DSQL_HOST||"https://datasquirel.com",p=awaitc({to:e.query.email?.toString()||process.env.DSQL_CONTACT_EMAIL,subject:"Reset Your Password",text:"Please click the link to reset your password",html:l.readFileSync("./email/send-password-reset-link.html","utf8").replace(/{{host}}/,s||"").replace(/{{ip}}/,String(o)).replace(/{{token}}/,t||""),alias:"Support"});if(await(0,i.A)(),c({to:process.env.DSQL_CONTACT_EMAIL,subject:`Password Reset Attempt for ${n}`,html:`<h1><u>${n}</u> tried to reset password</h1><p><b>${n}</b> attempted a password reset on ${a} from ${o} with a wrong password.</p>`}),!p)returnr.json({success:!1});r.json({success:!0})}}letd=(0,a.M)(s,"default"),f=(0,a.M)(s,"config"),m=newn.PagesAPIRouteModule({definition:{kind:o.A.PAGES_API,page:"/api/sendPasswordResetLink",pathname:"/api/sendPasswordResetLink",bundlePath:"",filename:""},userland:s})},2416:(e,r,t)=>{t.d(r,{A:()=>s});asyncfunctions(e){returnawaitnewPromise((r,t)=>{setTimeout(()=>{r(!0)},e||1e3)}),!0}},96052:(e,r,t)=>{t.r(r),t.d(r,{default:()=>i});vars=t(29021),n=t.n(s),o=t(21572);leta=t.n(o)().createTransport({host:process.env.DSQL_MAIL_HOST,port:465,secure:!0,auth:{user:process.env.DSQL_MAIL_EMAIL,pass:process.env.DSQL_MAIL_PASSWORD}});asyncfunctioni({to:e,subject:r,text:t,html:s,alias:o,senderName:i}){letl;if(!process.env.DSQL_MAIL_HOST||!process.env.DSQL_MAIL_EMAIL||!process.env.DSQL_MAIL_PASSWORD)returnnull;letc=(o?.match(/support/i),process.env.DSQL_MAIL_EMAIL);if(!n().existsSync("./email/index.html"))return;letu=n().readFileSync("./email/index.html","utf8").replace(/{{email_body}}/,s||"").replace(/{{issue_date}}/,Date().substring(0,24));try{lets={};s.from=`"${i||"Datasquirel"}" <${c}>`,s.sender=c,o&&(s.replyTo=c),s.to=e,s.subject=r,s.text=t,s.html=u,l=awaita.sendMail(s)}catch(e){console.log("ERROR in handleNodemailer Function =>",e.message)}returnl}},68829:(e,r,t)=>{t.r(r),t.d(r,{default:()=>o});vars=t(55511),n=t(79428);functiono({data:e,encryptionKey:r,encryptionSalt:t}){if(!e?.match(/./))returnconsole.log("Encryption string is invalid"),e;leto=r||process.env.DSQL_ENCRYPTION_PASSWORD,a=t||process.env.DSQL_ENCRYPTION_SALT,i=process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24;if(!o?.match(/.{8,}/))returnconsole.log("Encryption key is invalid"),e;if(!a?.match(/.{8,}/))returnconsole.log("Encryption salt is invalid"),e;letl=(0,s.scryptSync)(o,a,i),c=n.Buffer.alloc(16,0),u=(0,s.createCipheriv)("aes-192-cbc",l,c);try{letr=u.update(e,"utf8","hex");returnr+=u.final("hex")}catch(r){returnconsole.log("Error in encrypting =>",r.message),e}}},2706:(e,r)=>{Object.defineProperty(r,"A",{enumerable:!0,get:function(){returnt}});vart=function(e){returne.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.IMAGE="IMAGE",e}({})},89947:(e,r,t)=>{e.exports=t(75600)}};varr=require("../../webpack-api-runtime.js");r.C(e);vart=r(r.s=47601);module.exports=t})();