${l}`)}catch(e){console.log("Server Error Reporting Error:",e.message)}}},6420:(e,t,r)=>{r(81630);let s=r(51348),a=r(72907),n=r(29021);async function i(e,t,r,i){if(!e.cookies?.datasquirelAuthKey?.match(/./))return null;let o=a(e.cookies.datasquirelAuthKey);if(!o)return null;let l=JSON.parse(o);if(!l.csrf_k||r&&!e.headers["x-csrf-auth"]?.match(RegExp(`${l.csrf_k}`)))return null;let u=process.env.DSQL_USER_LOGIN_KEYS_PATH;if(!u)return console.log("DSQL_USER_LOGIN_KEYS_PATH env variable not found. Please set this variable."),null;if(r&&!n.existsSync(`${u}/${l.csrf_k}`))return null;if(0==l.verification_status&&!r){let e=await s(`SELECTverification_statusFROMusersWHEREid='${l.id}'`);e&&e[0]&&1==e[0].verification_status&&t.setHeader("Set-Cookie",["user_refresh=1"])}return l?.date&&Date.now()-l.date>6048e5?null:l}e.exports=i},33364:(e,t,r)=>{let s=r(82703),a=r(72583),n=r(16570),i=r(51348),o=r(21339);async function l({dbContext:e,paradigm:t,dbFullName:r,tableName:l,data:u,tableSchema:c,identifierColumnName:p,identifierValue:d,encryptionKey:S,encryptionSalt:m}){if(!u||!Object.keys(u).length)return null;let f=!e?.match(/dsql.user/i)&&(!r||!!r.match(/^datasquirel$/)),_=f?i:o,g=Object.keys(u),h=[],y=[];for(let e=0;e<g.length;e++)try{let t=g[e],r=u[t],i=c?c?.fields?.filter(e=>e.fieldName===t):null,o=i&&i[0]?i[0]:null;if(null==r||void 0==r)continue;o?.richText&&(r=a(r,n)),o?.encrypted&&(r=s(r,S,m)),"object"==typeof r&&(r=JSON.stringify(r)),o?.pattern&&!new RegExp(o.pattern,o.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 ${l} SET ${h.join(",")} WHERE \`${p}\`=?`;returny.push(d),f?await_(D,y):await_({paradigm:t,database:r,queryString:D,queryValues:y})}e.exports=l},72907:(e,t,r)=>{let{scryptSync:s,createDecipheriv:a}=r(55511),{Buffer:n}=r(79428);e.exports=e=>{lett=a("aes-192-cbc",s(process.env.DSQL_ENCRYPTION_PASSWORD||"",process.env.DSQL_ENCRYPTION_SALT||"",24),n.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:a}=r(55511),{Buffer:n}=r(79428),i=r(48225);e.exports=(e,t,r)=>{leto=a("aes-192-cbc",s(t||process.env.DSQL_ENCRYPTION_PASSWORD||"",r||process.env.DSQL_ENCRYPTION_SALT||"",24),n.alloc(16,0));try{lett=o.update(e,"utf8","hex");returnt+=o.final("hex")}catch(e){returni({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:a}){letn=`🚀 SERVER ERROR ===========================