"use strict";exports.id=5194,exports.ids=[5194],exports.modules={96762:(e,t)=>{Object.defineProperty(t,"M",{enumerable:!0,get:function(){returnfunctione(t,r){returnrint?t[r]:"then"int&&"function"==typeoft.then?t.then(t=>e(t,r)):"function"==typeoft&&"default"===r?t:void0}}})},96551:(e,t,r)=>{r.d(t,{A:()=>i});varn=r(9288),a=r.n(n),o=r(67619),l=r(45185);asyncfunctioni({imageSourceBase64:e,imageName:t,userId:r,mimeType:n,thumbnailSize:i,folder:s,isPrivate:u}){try{leto=Buffer.from(e,"base64"),c=i?parseInt(i.toString()):400,d=a()(o),p=a()(o),_=(0,l.A)({isPrivate:u,userId:r,folder:s});if(!_)returnnull;let{fileRootPath:f,urlRootPath:g,relativePath:m}=_,{width:S,height:h,format:y}=awaitd.metadata(),E=n||y;S&&h&&S>1800&&d.resize(1800,Math.round(1800/S*h),{fit:"cover"}),d.toFormat(E,{quality:80}),awaitd.metadata();letN=`${t}.${E}`;if(awaitd.toFile(f+N),S&&h&&S>c){lete=c/S;p.resize(c,Math.round(h*e),{fit:"cover"})}elseS&&h&&p.resize(150,Math.round(150/S*h),{fit:"cover"});p.toFormat(E,{quality:80});letA=`${t}_thumbnail.${E}`;returnawaitp.toFile(f+A),{urlPath:g+N,urlThumbnailPath:g+A,urlRelativePath:m+N,urlThumbnailRelativePath:m+A}}catch(e){returnconsole.log("Write Image to Disk error =>",e.message),(0,o.A)({component:"functions/backend/fsWriteImageToDiskFromBase64",message:e.message}),null}}},45185:(e,t,r)=>{r.d(t,{A:()=>i});varn=r(29021),a=r.n(n),o=r(33873),l=r.n(o);functioni({isPrivate:e,userId:t,folder:r,video:n,pathOnly:o}){"production".match(/production/);leti=process.env.DSQL_STATIC_SERVER_DIR;if(!i)returnconsole.log("Static File ENV not Found!"),null;lets=e?`@/${n?"videos":"media"}/${r?r+"/":""}`:n?`/videos/user-videos/user-${t}/${r?r+"/":""}`:`/images/user-images/user-${t}/${r?r+"/":""}`,u=e?`${process.env.DSQL_USER_DB_SCHEMA_PATH}/user-${t}/media/${r?r+"/":""}`:l().join(i,s);returna().existsSync(u)||o||a().mkdirSync(u,{recursive:!0}),{fileRootPath:u,urlRootPath:e?`@/media/${r?r+"/":""}`:`${process.env.DSQL_STATIC_HOST}${s}`,relativePath:s}}},98e3:(e,t,r)=>{r.d(t,{A:()=>c});varn=r(72583),a=r.n(n),o=r(92652),l=r(30802),i=r(68829),s=r(64292),u=r(52939);asyncfunctionc({dbContext:e,paradigm:t,dbFullName:r,tableName:n,data:c,tableSchema:d,duplicateColumnName:p,duplicateColumnValue:_,update:f,encryptionKey:g,encryptionSalt:m,forceLocal:S}){leth=!!S||(0,u.A)({dbContext:e,dbFullName:r}),y=h?global.DSQL_DB_CONN:global.DSQL_FULL_ACCESS_DB_CONN||global.DSQL_DB_CONN,E=h?global.DSQL_DB_CONN:global.DSQL_READ_ONLY_DB_CONN||global.DSQL_DB_CONN;if(c?.date_created_timestamp&&deletec.date_created_timestamp,c?.date_updated_timestamp&&deletec.date_updated_timestamp,c?.date_updated&&deletec.date_updated,c?.date_updated_code&&deletec.date_updated_code,c?.date_created&&deletec.date_created,c?.date_created_code&&deletec.date_created_code,p&&"string"==typeofp){lett=`SELECT * FROM ${h?"":`\`${r}\`.`}\`${n}\` WHERE \`${p}\`=?`,a=await(0,s.A)(E,t,[_]);if(a?.[0]&&!f)returnnull;if(a&&a[0]&&f)returnawait(0,l.A)({dbContext:e,dbFullName:r,tableName:n,data:c,tableSchema:d,encryptionKey:g,encryptionSalt:m,identifierColumnName:p,identifierValue:_||""})}letN=Object.keys(c),A=[],D=[];for(lete=0;e<N.length;e++)try{lett=N[e],r=c?.[t],n=d?d?.fields?.filter(e=>e.fieldName==t):null,l=n&&n[0]?n[0]:null;if(null==r||void0==r||l?.dataType?.match(/int$/i)&&"string"==typeofr&&!r?.match(/./))continue;l?.encrypted&&(r=(0,i.A)({data:r,encryptionKey:g,encryptionSalt:m}),console.log("DSQL: Encrypted value =>",r));lets=/<[^>]+>/g;(l?.richText||String(r).match(s))&&(r=a()(r,o.A)),l?.pattern&&!newRegExp(l.pattern,l.patternFlags||"").test(r)&&(console.log("DSQL: Pattern not matched =>",r),r=""),A.push("`"+t+"`"),"object"==typeofr&&(r=JSON.stringify(r)),"number"==typeofr?D.push(String(r)):D.push(r)}catch(e){console.log("DSQL: Error in parsing data keys =>",e.message);continue}c?.date_created||(A.push("`date_created`"),D.push(Date())),c?.date_created_code||(A.push("`date_created_code`"),D.push(Date.now())),c?.date_updated||(A.push("`date_updated`"),D.push(Date())),c?.date_updated_code||(A.push("`date_updated_code`"),D.push(Date.n