${c}`)}catch(e){console.log("Server Error Reporting Error:",e.message)}}},6420:(e,t,r)=>{r(81630);let s=r(51348),n=r(72907),o=r(29021);async function a(e,t,r,a){if(!e.cookies?.datasquirelAuthKey?.match(/./))return null;let i=n(e.cookies.datasquirelAuthKey);if(!i)return null;let c=JSON.parse(i);if(!c.csrf_k||r&&!e.headers["x-csrf-auth"]?.match(RegExp(`${c.csrf_k}`)))return null;let l=process.env.DSQL_USER_LOGIN_KEYS_PATH;if(!l)return console.log("DSQL_USER_LOGIN_KEYS_PATH env variable not found. Please set this variable."),null;if(r&&!o.existsSync(`${l}/${c.csrf_k}`))return null;if(0==c.verification_status&&!r){let e=await s(`SELECTverification_statusFROMusersWHEREid='${c.id}'`);e&&e[0]&&1==e[0].verification_status&&t.setHeader("Set-Cookie",["user_refresh=1"])}return c?.date&&Date.now()-c.date>6048e5?null:c}e.exports=a},33364:(e,t,r)=>{let s=r(82703),n=r(72583),o=r(16570),a=r(51348),i=r(21339);async function c({dbContext:e,paradigm:t,dbFullName:r,tableName:c,data:l,tableSchema:u,identifierColumnName:p,identifierValue:d,encryptionKey:f,encryptionSalt:S}){if(!l||!Object.keys(l).length)return null;let _=!e?.match(/dsql.user/i)&&(!r||!!r.match(/^datasquirel$/)),m=_?a:i,g=Object.keys(l),h=[],y=[];for(let e=0;e<g.length;e++)try{let t=g[e],r=l[t],a=u?u?.fields?.filter(e=>e.fieldName===t):null,i=a&&a[0]?a[0]:null;if(null==r||void 0==r)continue;i?.richText&&(r=n(r,o)),i?.encrypted&&(r=s(r,f,S)),"object"==typeof r&&(r=JSON.stringify(r)),i?.pattern&&!new RegExp(i.pattern,i.patternFlags||"").test(r)&&(console.log("DSQL: Pattern not matched =>",r),r=""),"string"==typeof r&&r.match(/^null$/i)&&(r={toSqlString:function(){return"NULL"}}),"string"!=typeof r||r.match(/./i)||(r={toSqlString:function(){return"NULL"}}),h.push(`\`${t}\`=?`),"number"==typeofr?y.push(String(r)):y.push(r)}catch(e){console.log("DSQL: Error in parsing data keys in update function =>",e.message);continue}h.push(`date_updated='${Date()}'`),h.push(`date_updated_code='${Date.now()}'`);letD=`UPDATE ${c} SET ${h.join(",")} WHERE \`${p}\`=?`;returny.push(d),_?awaitm(D,y):awaitm({paradigm:t,database:r,queryString:D,queryValues:y})}e.exports=c},72907:(e,t,r)=>{let{scryptSync:s,createDecipheriv:n}=r(55511),{Buffer:o}=r(79428);e.exports=e=>{lett=n("aes-192-cbc",s(process.env.DSQL_ENCRYPTION_PASSWORD||"",process.env.DSQL_ENCRYPTION_SALT||"",24),o.alloc(16,0));try{letr=t.update(e,"hex","utf8");returnr+=t.final("utf8")}catch(e){returnnull}}},82703:(e,t,r)=>{let{scryptSync:s,createCipheriv:n}=r(55511),{Buffer:o}=r(79428),a=r(48225);e.exports=(e,t,r)=>{leti=n("aes-192-cbc",s(t||process.env.DSQL_ENCRYPTION_PASSWORD||"",r||process.env.DSQL_ENCRYPTION_SALT||"",24),o.alloc(16,0));try{lett=i.update(e,"utf8","hex");returnt+=i.final("hex")}catch(e){returna({component:"encrypt",message:e.message}),null}}},16570:e=>{e.exports={allowedTags:["b","i","em","strong","a","p","span","ul","ol","li","h1","h2","h3","h4","h5","h6","img","div","button","pre","code","br"],allowedAttributes:{a:["href"],img:["src","alt","width","height","class","style"],"*":["style","class"]}}},48225:(e,t,r)=>{lets=r(29021);e.exports=asyncfunction({user:e,message:t,component:r,noMail:n}){leto=`🚀 SERVER ERROR ===========================