Built motion from commit (unavailable).|2.5.27
[motion2.git] / server / api / setting / setting.controller.js
index 0c84abe..76c2c41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2904=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','Setting','include','show','params','includeAll','options','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','find','getLogo','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default','custom','default_logo.svg','ValidationError','upperFirst','\x20not\x20found','download','getLogoLogin','server/files/images/logos','default_loginLogo.svg','Sequelize','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','now','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','request','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','end','stack','send','index','map','fieldName','type','key','model','name','query','keys','filters'];(function(_0x34fca6,_0x2dd676){var _0xdf91e6=function(_0x13ee28){while(--_0x13ee28){_0x34fca6['push'](_0x34fca6['shift']());}};_0xdf91e6(++_0x2dd676);}(_0x2904,0x137));var _0x4290=function(_0x9b2368,_0x5e5b07){_0x9b2368=_0x9b2368-0x0;var _0x253104=_0x2904[_0x9b2368];return _0x253104;};'use strict';var emlformat=require(_0x4290('0x0'));var rimraf=require(_0x4290('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4290('0x2'));var rp=require('request-promise');var moment=require(_0x4290('0x3'));var BPromise=require(_0x4290('0x4'));var Mustache=require(_0x4290('0x5'));var util=require(_0x4290('0x6'));var path=require(_0x4290('0x7'));var sox=require('sox');var csv=require(_0x4290('0x8'));var ejs=require(_0x4290('0x9'));var fs=require('fs');var fs_extra=require(_0x4290('0xa'));var _=require('lodash');var squel=require(_0x4290('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4290('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4290('0xd'));var Papa=require(_0x4290('0xe'));var Redis=require('ioredis');var authService=require(_0x4290('0xf'));var qs=require(_0x4290('0x10'));var as=require(_0x4290('0x11'));var hardwareService=require(_0x4290('0x12'));var logger=require(_0x4290('0x13'))(_0x4290('0x14'));var utils=require(_0x4290('0x15'));var config=require(_0x4290('0x16'));var licenseUtil=require(_0x4290('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x4290('0x18'));var client=jayson[_0x4290('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18223a,_0x56a496,_0x2137b3,_0x4ceefc){return new BPromise(function(_0x418062,_0x252b4e){var _0x59a02c=_0x4ceefc||client;return _0x59a02c[_0x4290('0x1a')](_0x18223a,_0x2137b3)['then'](function(_0x1c8d95){logger[_0x4290('0x1b')](_0x4290('0x1c'),_0x56a496,'request\x20sent');logger[_0x4290('0x1d')](_0x4290('0x1e'),_0x56a496,'request\x20sent',JSON[_0x4290('0x1f')](_0x1c8d95));if(_0x1c8d95[_0x4290('0x20')]){if(_0x1c8d95[_0x4290('0x20')][_0x4290('0x21')]===0x1f4){logger[_0x4290('0x20')]('Setting,\x20%s,\x20%s',_0x56a496,_0x1c8d95[_0x4290('0x20')]['message']);return _0x252b4e(_0x1c8d95[_0x4290('0x20')][_0x4290('0x22')]);}logger[_0x4290('0x20')]('Setting,\x20%s,\x20%s',_0x56a496,_0x1c8d95[_0x4290('0x20')]['message']);return _0x418062(_0x1c8d95[_0x4290('0x20')]['message']);}else{logger['info'](_0x4290('0x1c'),_0x56a496,_0x4290('0x23'));_0x418062(_0x1c8d95[_0x4290('0x24')][_0x4290('0x22')]);}})[_0x4290('0x25')](function(_0x3b178d){logger['error'](_0x4290('0x1c'),_0x56a496,_0x3b178d);_0x252b4e(_0x3b178d);});});}function respondWithStatusCode(_0x5e912a,_0x14999){_0x14999=_0x14999||0xcc;return function(_0x46d4bd){if(_0x46d4bd){return _0x5e912a[_0x4290('0x26')](_0x14999);}return _0x5e912a[_0x4290('0x27')](_0x14999)['end']();};}function respondWithResult(_0x57525b,_0x14f428){_0x14f428=_0x14f428||0xc8;return function(_0x33738b){if(_0x33738b){return _0x57525b[_0x4290('0x27')](_0x14f428)[_0x4290('0x28')](_0x33738b);}};}function respondWithFilteredResult(_0x1fcbb9,_0x2031a6){return function(_0xdd3947){if(_0xdd3947){var _0x3c4def=_0xdd3947[_0x4290('0x29')],_0x1af4b8=_0x2031a6[_0x4290('0x2a')],_0x4675a9=_0x2031a6['offset']+_0x2031a6[_0x4290('0x2b')],_0x524807;if(_0x4675a9>=_0x3c4def){_0x4675a9=_0x3c4def;_0x524807=0xc8;}else{_0x524807=0xce;}_0x1fcbb9[_0x4290('0x27')](_0x524807);return _0x1fcbb9[_0x4290('0x2c')](_0x4290('0x2d'),_0x1af4b8+'-'+_0x4675a9+'/'+_0x3c4def)['json'](_0xdd3947);}return null;};}function patchUpdates(_0x3fa5e8){return function(_0x660773){try{jsonpatch['apply'](_0x660773,_0x3fa5e8,!![]);}catch(_0x2d73ca){return BPromise[_0x4290('0x2e')](_0x2d73ca);}return _0x660773[_0x4290('0x2f')]();};}function saveUpdates(_0x2e59a6,_0x3569bd){return function(_0xd61b52){if(_0xd61b52){return _0xd61b52[_0x4290('0x30')](_0x2e59a6)[_0x4290('0x31')](function(_0x3eb106){return _0x3eb106;});}return null;};}function removeEntity(_0x21e7b7,_0x5debd4){return function(_0x7ebf46){if(_0x7ebf46){return _0x7ebf46[_0x4290('0x32')]()[_0x4290('0x31')](function(){_0x21e7b7[_0x4290('0x27')](0xcc)[_0x4290('0x33')]();});}};}function handleEntityNotFound(_0x231547,_0x194711){return function(_0x1024fb){if(!_0x1024fb){_0x231547[_0x4290('0x26')](0x194);}return _0x1024fb;};}function handleError(_0xbeccce,_0x4db49f){_0x4db49f=_0x4db49f||0x1f4;return function(_0x4c8ba4){logger[_0x4290('0x20')](_0x4c8ba4[_0x4290('0x34')]);if(_0x4c8ba4['name']){delete _0x4c8ba4['name'];}_0xbeccce[_0x4290('0x27')](_0x4db49f)[_0x4290('0x35')](_0x4c8ba4);};}exports[_0x4290('0x36')]=function(_0x306af4,_0x2c97f5){var _0x50046d={},_0x5e4e91={},_0x159dee={'count':0x0,'rows':[]};var _0x29026a=_[_0x4290('0x37')](db['Setting']['rawAttributes'],function(_0x113eb2){return{'name':_0x113eb2[_0x4290('0x38')],'type':_0x113eb2[_0x4290('0x39')][_0x4290('0x3a')]};});_0x5e4e91[_0x4290('0x3b')]=_[_0x4290('0x37')](_0x29026a,_0x4290('0x3c'));_0x5e4e91[_0x4290('0x3d')]=_[_0x4290('0x3e')](_0x306af4[_0x4290('0x3d')]);_0x5e4e91[_0x4290('0x3f')]=_[_0x4290('0x40')](_0x5e4e91[_0x4290('0x3b')],_0x5e4e91[_0x4290('0x3d')]);_0x50046d['attributes']=_[_0x4290('0x40')](_0x5e4e91[_0x4290('0x3b')],qs[_0x4290('0x41')](_0x306af4['query'][_0x4290('0x41')]));_0x50046d[_0x4290('0x42')]=_0x50046d['attributes'][_0x4290('0x43')]?_0x50046d['attributes']:_0x5e4e91[_0x4290('0x3b')];if(!_0x306af4['query'][_0x4290('0x44')](_0x4290('0x45'))){_0x50046d[_0x4290('0x2b')]=qs['limit'](_0x306af4['query'][_0x4290('0x2b')]);_0x50046d[_0x4290('0x2a')]=qs[_0x4290('0x2a')](_0x306af4[_0x4290('0x3d')][_0x4290('0x2a')]);}_0x50046d[_0x4290('0x46')]=qs['sort'](_0x306af4[_0x4290('0x3d')][_0x4290('0x47')]);_0x50046d[_0x4290('0x48')]=qs[_0x4290('0x3f')](_[_0x4290('0x49')](_0x306af4[_0x4290('0x3d')],_0x5e4e91[_0x4290('0x3f')]),_0x29026a);if(_0x306af4[_0x4290('0x3d')]['filter']){_0x50046d[_0x4290('0x48')]=_[_0x4290('0x4a')](_0x50046d[_0x4290('0x48')],{'$or':_[_0x4290('0x37')](_0x29026a,function(_0x359249){if(_0x359249[_0x4290('0x39')]!==_0x4290('0x4b')){var _0xd4273c={};_0xd4273c[_0x359249['name']]={'$like':'%'+_0x306af4[_0x4290('0x3d')][_0x4290('0x4c')]+'%'};return _0xd4273c;}})});}_0x50046d=_[_0x4290('0x4a')]({},_0x50046d,_0x306af4['options']);var _0x3f54dd={'where':_0x50046d[_0x4290('0x48')]};return db[_0x4290('0x4d')]['count'](_0x3f54dd)[_0x4290('0x31')](function(_0x26e636){_0x159dee[_0x4290('0x29')]=_0x26e636;if(_0x306af4['query']['includeAll']){_0x50046d[_0x4290('0x4e')]=[{'all':!![]}];}return db[_0x4290('0x4d')]['findAll'](_0x50046d);})[_0x4290('0x31')](function(_0x23a4d3){_0x159dee['rows']=_0x23a4d3;return _0x159dee;})[_0x4290('0x31')](respondWithFilteredResult(_0x2c97f5,_0x50046d))[_0x4290('0x25')](handleError(_0x2c97f5,null));};exports[_0x4290('0x4f')]=function(_0x4b5077,_0x13b984){var _0x2795e8={'raw':![],'where':{'id':_0x4b5077[_0x4290('0x50')]['id']}},_0xaa2195={};_0xaa2195[_0x4290('0x3b')]=_[_0x4290('0x3e')](db[_0x4290('0x4d')]['rawAttributes']);_0xaa2195[_0x4290('0x3d')]=_[_0x4290('0x3e')](_0x4b5077[_0x4290('0x3d')]);_0xaa2195[_0x4290('0x3f')]=_['intersection'](_0xaa2195[_0x4290('0x3b')],_0xaa2195[_0x4290('0x3d')]);_0x2795e8[_0x4290('0x42')]=_[_0x4290('0x40')](_0xaa2195[_0x4290('0x3b')],qs[_0x4290('0x41')](_0x4b5077[_0x4290('0x3d')][_0x4290('0x41')]));_0x2795e8[_0x4290('0x42')]=_0x2795e8['attributes']['length']?_0x2795e8['attributes']:_0xaa2195[_0x4290('0x3b')];if(_0x4b5077[_0x4290('0x3d')][_0x4290('0x51')]){_0x2795e8['include']=[{'all':!![]}];}_0x2795e8=_[_0x4290('0x4a')]({},_0x2795e8,_0x4b5077[_0x4290('0x52')]);return db[_0x4290('0x4d')]['find'](_0x2795e8)[_0x4290('0x31')](handleEntityNotFound(_0x13b984,null))['then'](respondWithResult(_0x13b984,null))[_0x4290('0x25')](handleError(_0x13b984,null));};exports[_0x4290('0x30')]=function(_0x4ce61f,_0x179a74){if(_0x4ce61f[_0x4290('0x53')]['id']){delete _0x4ce61f[_0x4290('0x53')]['id'];}return db[_0x4290('0x4d')]['find']({'where':{'id':_0x4ce61f['params']['id']}})[_0x4290('0x31')](handleEntityNotFound(_0x179a74,null))[_0x4290('0x31')](saveUpdates(_0x4ce61f[_0x4290('0x53')],null))[_0x4290('0x31')](respondWithResult(_0x179a74,null))[_0x4290('0x25')](handleError(_0x179a74,null));};exports[_0x4290('0x54')]=function(_0x4b7e50,_0x54fc77,_0x520b13){if(_0x4b7e50[_0x4290('0x55')]&&_0x4b7e50[_0x4290('0x55')][_0x4290('0x56')]){_0x4b7e50[_0x4290('0x53')][_0x4290('0x57')]=_0x4b7e50[_0x4290('0x55')]['filename'];}return db[_0x4290('0x4d')]['find']({'where':{'id':_0x4b7e50[_0x4290('0x50')]['id']}})[_0x4290('0x31')](handleEntityNotFound(_0x54fc77,null))[_0x4290('0x31')](saveUpdates(_0x4b7e50['body'],null))[_0x4290('0x31')](respondWithResult(_0x54fc77,null))['catch'](handleError(_0x54fc77,null));};exports[_0x4290('0x58')]=function(_0x4aab9f,_0x3f1728,_0x30bdf2){if(_0x4aab9f[_0x4290('0x55')]&&_0x4aab9f['file'][_0x4290('0x56')]){_0x4aab9f[_0x4290('0x53')][_0x4290('0x59')]=_0x4aab9f['file']['filename'];}return db[_0x4290('0x4d')][_0x4290('0x5a')]({'where':{'id':_0x4aab9f[_0x4290('0x50')]['id']}})[_0x4290('0x31')](handleEntityNotFound(_0x3f1728,null))[_0x4290('0x31')](saveUpdates(_0x4aab9f[_0x4290('0x53')],null))[_0x4290('0x31')](respondWithResult(_0x3f1728,null))[_0x4290('0x25')](handleError(_0x3f1728,null));};var utilLicense=require(_0x4290('0x17'));exports[_0x4290('0x5b')]=function(_0x518842,_0x485156,_0x3b3031){var _0x3b4db6='server/files/images/logos';var _0x3577b9={'custom':![]};return utilLicense[_0x4290('0x5c')]()['then'](function(_0x98abb){if(_0x98abb){_0x3577b9=_0x98abb;}return db['Setting'][_0x4290('0x5a')]({'where':{'id':_0x518842['params']['id']},'attributes':[_0x4290('0x57'),_0x4290('0x59'),_0x4290('0x5d'),_0x4290('0x5e'),_0x4290('0x5f'),_0x4290('0x60'),_0x4290('0x61'),_0x4290('0x62')],'raw':!![]});})['then'](handleEntityNotFound(_0x485156,null))[_0x4290('0x31')](function(_0x376a96){if(_0x376a96){var _0x56f869=_0x376a96[_0x4290('0x57')]&&fs[_0x4290('0x63')](path[_0x4290('0x64')](config['root'],_0x3b4db6,_[_0x4290('0x65')](_0x376a96[_0x4290('0x57')])))?path[_0x4290('0x64')](config[_0x4290('0x66')],_0x3b4db6,_[_0x4290('0x65')](_0x376a96['logo'])):path[_0x4290('0x64')](config[_0x4290('0x66')],_0x3b4db6,_[_0x4290('0x65')]('default_logo.svg'));var _0x35ad4d=_0x4290('0x67')+_['upperFirst']('logo');if(_0x376a96[_0x35ad4d]||!_0x3577b9[_0x4290('0x68')]){_0x56f869=path[_0x4290('0x64')](config[_0x4290('0x66')],_0x3b4db6,_[_0x4290('0x65')](_0x4290('0x69')));}if(!fs['existsSync'](_0x56f869)){throw new db['Sequelize'][(_0x4290('0x6a'))](_[_0x4290('0x6b')](_0x4290('0x57'))+_0x4290('0x6c'));}return _0x485156[_0x4290('0x6d')](_0x56f869);}})['catch'](handleError(_0x485156,null));};var utilLicense=require(_0x4290('0x17'));exports[_0x4290('0x6e')]=function(_0x6edae0,_0x199b3,_0x510d6d){var _0xaadb3a=_0x4290('0x6f');var _0x3d408a={'custom':![]};return utilLicense['getLicense']()[_0x4290('0x31')](function(_0xde0d5b){if(_0xde0d5b){_0x3d408a=_0xde0d5b;}return db['Setting'][_0x4290('0x5a')]({'where':{'id':_0x6edae0[_0x4290('0x50')]['id']},'attributes':[_0x4290('0x57'),_0x4290('0x59'),_0x4290('0x5d'),_0x4290('0x5e'),_0x4290('0x5f'),_0x4290('0x60'),_0x4290('0x61'),'defaultFavicon'],'raw':!![]});})[_0x4290('0x31')](handleEntityNotFound(_0x199b3,null))[_0x4290('0x31')](function(_0x1293ef){if(_0x1293ef){var _0x32cb4b=_0x1293ef['loginLogo']&&fs[_0x4290('0x63')](path[_0x4290('0x64')](config[_0x4290('0x66')],_0xaadb3a,_[_0x4290('0x65')](_0x1293ef[_0x4290('0x59')])))?path[_0x4290('0x64')](config[_0x4290('0x66')],_0xaadb3a,_[_0x4290('0x65')](_0x1293ef[_0x4290('0x59')])):path[_0x4290('0x64')](config[_0x4290('0x66')],_0xaadb3a,_['toLower'](_0x4290('0x70')));var _0x4beeac=_0x4290('0x67')+_[_0x4290('0x6b')](_0x4290('0x59'));if(_0x1293ef[_0x4beeac]||!_0x3d408a['custom']){_0x32cb4b=path[_0x4290('0x64')](config['root'],_0xaadb3a,_[_0x4290('0x65')](_0x4290('0x70')));}if(!fs[_0x4290('0x63')](_0x32cb4b)){throw new db[(_0x4290('0x71'))]['ValidationError'](_[_0x4290('0x6b')](_0x4290('0x59'))+'\x20not\x20found');}return _0x199b3[_0x4290('0x6d')](_0x32cb4b);}})[_0x4290('0x25')](handleError(_0x199b3,null));};exports[_0x4290('0x72')]=function(_0x4e34f6,_0x4abd3f){return db[_0x4290('0x4d')][_0x4290('0x5a')]({'where':{'id':_0x4e34f6[_0x4290('0x50')]['id']},'attributes':[_0x4290('0x73')]})['then'](respondWithResult(_0x4abd3f,null))[_0x4290('0x25')](handleError(_0x4abd3f,null));};exports[_0x4290('0x74')]=function(_0x4d00c0,_0xeca53e,_0xd29d06){if(_0x4d00c0[_0x4290('0x55')]&&_0x4d00c0['file'][_0x4290('0x56')]){_0x4d00c0[_0x4290('0x53')][_0x4290('0x5d')]=_0x4d00c0[_0x4290('0x55')][_0x4290('0x56')];}return db[_0x4290('0x4d')][_0x4290('0x5a')]({'where':{'id':_0x4d00c0[_0x4290('0x50')]['id']}})[_0x4290('0x31')](handleEntityNotFound(_0xeca53e,null))[_0x4290('0x31')](saveUpdates(_0x4d00c0[_0x4290('0x53')],null))[_0x4290('0x31')](respondWithResult(_0xeca53e,null))[_0x4290('0x25')](handleError(_0xeca53e,null));};var utilLicense=require(_0x4290('0x17'));exports[_0x4290('0x75')]=function(_0xb1d1c2,_0x453dac,_0x296a66){var _0x1e4314=_0x4290('0x6f');var _0x550e04={'custom':![]};return utilLicense[_0x4290('0x5c')]()['then'](function(_0x32a1c2){if(_0x32a1c2){_0x550e04=_0x32a1c2;}return db[_0x4290('0x4d')][_0x4290('0x5a')]({'where':{'id':_0xb1d1c2[_0x4290('0x50')]['id']},'attributes':[_0x4290('0x57'),'loginLogo',_0x4290('0x5d'),'favicon',_0x4290('0x5f'),_0x4290('0x60'),_0x4290('0x61'),_0x4290('0x62')],'raw':!![]});})[_0x4290('0x31')](handleEntityNotFound(_0x453dac,null))[_0x4290('0x31')](function(_0x5b96c6){if(_0x5b96c6){var _0x4273ef=_0x5b96c6[_0x4290('0x5d')]&&fs[_0x4290('0x63')](path[_0x4290('0x64')](config[_0x4290('0x66')],_0x1e4314,_[_0x4290('0x65')](_0x5b96c6[_0x4290('0x5d')])))?path[_0x4290('0x64')](config[_0x4290('0x66')],_0x1e4314,_[_0x4290('0x65')](_0x5b96c6['preferred'])):path[_0x4290('0x64')](config[_0x4290('0x66')],_0x1e4314,_[_0x4290('0x65')](_0x4290('0x76')));var _0x221a64='default'+_[_0x4290('0x6b')](_0x4290('0x5d'));if(_0x5b96c6[_0x221a64]||!_0x550e04[_0x4290('0x68')]||!_0x550e04[_0x4290('0x5d')]){_0x4273ef=path[_0x4290('0x64')](config[_0x4290('0x66')],_0x1e4314,_[_0x4290('0x65')]('default_preferred.png'));}if(!fs[_0x4290('0x63')](_0x4273ef)){throw new db['Sequelize'][(_0x4290('0x6a'))](_[_0x4290('0x6b')](_0x4290('0x5d'))+_0x4290('0x6c'));}return _0x453dac[_0x4290('0x6d')](_0x4273ef);}})[_0x4290('0x25')](handleError(_0x453dac,null));};exports[_0x4290('0x77')]=function(_0x3f23ae,_0x4c867d,_0x524dec){if(_0x3f23ae[_0x4290('0x55')]&&_0x3f23ae[_0x4290('0x55')][_0x4290('0x56')]){_0x3f23ae[_0x4290('0x53')][_0x4290('0x5e')]=_0x3f23ae['file'][_0x4290('0x56')];}return db[_0x4290('0x4d')][_0x4290('0x5a')]({'where':{'id':_0x3f23ae['params']['id']}})[_0x4290('0x31')](handleEntityNotFound(_0x4c867d,null))[_0x4290('0x31')](saveUpdates(_0x3f23ae[_0x4290('0x53')],null))[_0x4290('0x31')](respondWithResult(_0x4c867d,null))[_0x4290('0x25')](handleError(_0x4c867d,null));};var utilLicense=require(_0x4290('0x17'));exports[_0x4290('0x78')]=function(_0x3dd605,_0x2588ce,_0x4869d7){var _0x25a0d0='server/files/images/logos';var _0x4248e7={'custom':![]};return utilLicense[_0x4290('0x5c')]()[_0x4290('0x31')](function(_0x198b04){if(_0x198b04){_0x4248e7=_0x198b04;}return db[_0x4290('0x4d')][_0x4290('0x5a')]({'where':{'id':_0x3dd605['params']['id']},'attributes':[_0x4290('0x57'),_0x4290('0x59'),_0x4290('0x5d'),_0x4290('0x5e'),'defaultLogo',_0x4290('0x60'),_0x4290('0x61'),_0x4290('0x62')],'raw':!![]});})['then'](handleEntityNotFound(_0x2588ce,null))[_0x4290('0x31')](function(_0x519c78){if(_0x519c78){var _0x1bbd84=_0x519c78[_0x4290('0x5e')]&&fs[_0x4290('0x63')](path[_0x4290('0x64')](config[_0x4290('0x66')],_0x25a0d0,_[_0x4290('0x65')](_0x519c78[_0x4290('0x5e')])))?path['join'](config[_0x4290('0x66')],_0x25a0d0,_[_0x4290('0x65')](_0x519c78[_0x4290('0x5e')])):path[_0x4290('0x64')](config[_0x4290('0x66')],_0x25a0d0,_[_0x4290('0x65')](_0x4290('0x79')));var _0x5da6fb=_0x4290('0x67')+_[_0x4290('0x6b')](_0x4290('0x5e'));if(_0x519c78[_0x5da6fb]||!_0x4248e7[_0x4290('0x68')]){_0x1bbd84=path[_0x4290('0x64')](config[_0x4290('0x66')],_0x25a0d0,_[_0x4290('0x65')](_0x4290('0x79')));}if(!fs['existsSync'](_0x1bbd84)){throw new db[(_0x4290('0x71'))][(_0x4290('0x6a'))](_['upperFirst'](_0x4290('0x5e'))+_0x4290('0x6c'));}return _0x2588ce[_0x4290('0x6d')](_0x1bbd84);}})[_0x4290('0x25')](handleError(_0x2588ce,null));};exports[_0x4290('0x7a')]=function(_0x4f53f5,_0x251cd0){var _0x4924b0={'offset':moment()['utcOffset']()};_0x4924b0[_0x4290('0x7b')]=moment()['utcOffset'](_0x4924b0[_0x4290('0x2a')])['format'](_0x4290('0x7c'));return _0x251cd0[_0x4290('0x27')](0xc8)[_0x4290('0x35')](_0x4924b0);};
\ No newline at end of file
+var _0xbf83=['merge','options','Setting','count','includeAll','findAll','show','length','include','find','update','body','file','filename','logo','params','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','root','toLower','join','default_logo.svg','default','upperFirst','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','existsSync','custom','default_loginLogo.svg','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','set','apply','reject','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','filter','where','VIRTUAL'];(function(_0x54f222,_0x4a027d){var _0x18c14e=function(_0x5a5431){while(--_0x5a5431){_0x54f222['push'](_0x54f222['shift']());}};_0x18c14e(++_0x4a027d);}(_0xbf83,0x11e));var _0x3bf8=function(_0x255178,_0x1725d5){_0x255178=_0x255178-0x0;var _0x116d92=_0xbf83[_0x255178];return _0x116d92;};'use strict';var emlformat=require(_0x3bf8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3bf8('0x1'));var jsonpatch=require(_0x3bf8('0x2'));var rp=require(_0x3bf8('0x3'));var moment=require(_0x3bf8('0x4'));var BPromise=require(_0x3bf8('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3bf8('0x6'));var sox=require(_0x3bf8('0x7'));var csv=require(_0x3bf8('0x8'));var ejs=require(_0x3bf8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3bf8('0xa'));var crypto=require(_0x3bf8('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3bf8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3bf8('0xd'));var Papa=require(_0x3bf8('0xe'));var Redis=require(_0x3bf8('0xf'));var authService=require(_0x3bf8('0x10'));var qs=require(_0x3bf8('0x11'));var as=require(_0x3bf8('0x12'));var hardwareService=require(_0x3bf8('0x13'));var logger=require('../../config/logger')(_0x3bf8('0x14'));var utils=require(_0x3bf8('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3bf8('0x16'));var db=require(_0x3bf8('0x17'))['db'];var jayson=require(_0x3bf8('0x18'));var client=jayson[_0x3bf8('0x19')][_0x3bf8('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x45640d,_0x27b4e1,_0x260445,_0x1b0338){return new BPromise(function(_0xfd8a89,_0x5ada93){var _0x48c6e0=_0x1b0338||client;return _0x48c6e0[_0x3bf8('0x1b')](_0x45640d,_0x260445)[_0x3bf8('0x1c')](function(_0x45607c){logger[_0x3bf8('0x1d')]('Setting,\x20%s,\x20%s',_0x27b4e1,_0x3bf8('0x1e'));logger[_0x3bf8('0x1f')](_0x3bf8('0x20'),_0x27b4e1,_0x3bf8('0x1e'),JSON[_0x3bf8('0x21')](_0x45607c));if(_0x45607c[_0x3bf8('0x22')]){if(_0x45607c[_0x3bf8('0x22')][_0x3bf8('0x23')]===0x1f4){logger[_0x3bf8('0x22')](_0x3bf8('0x24'),_0x27b4e1,_0x45607c[_0x3bf8('0x22')]['message']);return _0x5ada93(_0x45607c[_0x3bf8('0x22')][_0x3bf8('0x25')]);}logger['error'](_0x3bf8('0x24'),_0x27b4e1,_0x45607c['error'][_0x3bf8('0x25')]);return _0xfd8a89(_0x45607c['error'][_0x3bf8('0x25')]);}else{logger[_0x3bf8('0x1d')]('Setting,\x20%s,\x20%s',_0x27b4e1,_0x3bf8('0x1e'));_0xfd8a89(_0x45607c[_0x3bf8('0x26')][_0x3bf8('0x25')]);}})[_0x3bf8('0x27')](function(_0x5169a1){logger[_0x3bf8('0x22')]('Setting,\x20%s,\x20%s',_0x27b4e1,_0x5169a1);_0x5ada93(_0x5169a1);});});}function respondWithStatusCode(_0xee1dc9,_0x583d62){_0x583d62=_0x583d62||0xcc;return function(_0x556b43){if(_0x556b43){return _0xee1dc9[_0x3bf8('0x28')](_0x583d62);}return _0xee1dc9[_0x3bf8('0x29')](_0x583d62)[_0x3bf8('0x2a')]();};}function respondWithResult(_0x29d72c,_0x3245e2){_0x3245e2=_0x3245e2||0xc8;return function(_0x2419cc){if(_0x2419cc){return _0x29d72c[_0x3bf8('0x29')](_0x3245e2)[_0x3bf8('0x2b')](_0x2419cc);}};}function respondWithFilteredResult(_0x190d87,_0xf8072b){return function(_0x143e8a){if(_0x143e8a){var _0x16767b=_0x143e8a['count'],_0x2212e0=_0xf8072b[_0x3bf8('0x2c')],_0x1a549d=_0xf8072b[_0x3bf8('0x2c')]+_0xf8072b['limit'],_0x25442d;if(_0x1a549d>=_0x16767b){_0x1a549d=_0x16767b;_0x25442d=0xc8;}else{_0x25442d=0xce;}_0x190d87[_0x3bf8('0x29')](_0x25442d);return _0x190d87[_0x3bf8('0x2d')]('Content-Range',_0x2212e0+'-'+_0x1a549d+'/'+_0x16767b)['json'](_0x143e8a);}return null;};}function patchUpdates(_0x37d6fd){return function(_0x21906f){try{jsonpatch[_0x3bf8('0x2e')](_0x21906f,_0x37d6fd,!![]);}catch(_0x4ae4b7){return BPromise[_0x3bf8('0x2f')](_0x4ae4b7);}return _0x21906f['save']();};}function saveUpdates(_0xc3586,_0x4cbac0){return function(_0x4d4f13){if(_0x4d4f13){return _0x4d4f13['update'](_0xc3586)['then'](function(_0x247489){return _0x247489;});}return null;};}function removeEntity(_0x52fb4e,_0x26ad39){return function(_0x4cf651){if(_0x4cf651){return _0x4cf651['destroy']()[_0x3bf8('0x1c')](function(){_0x52fb4e[_0x3bf8('0x29')](0xcc)[_0x3bf8('0x2a')]();});}};}function handleEntityNotFound(_0x29875b,_0x48d804){return function(_0x1aac86){if(!_0x1aac86){_0x29875b[_0x3bf8('0x28')](0x194);}return _0x1aac86;};}function handleError(_0x17f10f,_0x4f2ad9){_0x4f2ad9=_0x4f2ad9||0x1f4;return function(_0x5e4279){logger['error'](_0x5e4279['stack']);if(_0x5e4279[_0x3bf8('0x30')]){delete _0x5e4279[_0x3bf8('0x30')];}_0x17f10f[_0x3bf8('0x29')](_0x4f2ad9)['send'](_0x5e4279);};}exports[_0x3bf8('0x31')]=function(_0x243f2b,_0x5729bc){var _0x521b07={},_0x42cb0f={},_0x5d9f6c={'count':0x0,'rows':[]};var _0x156dee=_[_0x3bf8('0x32')](db['Setting'][_0x3bf8('0x33')],function(_0x49762a){return{'name':_0x49762a['fieldName'],'type':_0x49762a[_0x3bf8('0x34')][_0x3bf8('0x35')]};});_0x42cb0f[_0x3bf8('0x36')]=_['map'](_0x156dee,_0x3bf8('0x30'));_0x42cb0f[_0x3bf8('0x37')]=_[_0x3bf8('0x38')](_0x243f2b[_0x3bf8('0x37')]);_0x42cb0f[_0x3bf8('0x39')]=_[_0x3bf8('0x3a')](_0x42cb0f[_0x3bf8('0x36')],_0x42cb0f[_0x3bf8('0x37')]);_0x521b07[_0x3bf8('0x3b')]=_[_0x3bf8('0x3a')](_0x42cb0f[_0x3bf8('0x36')],qs['fields'](_0x243f2b['query'][_0x3bf8('0x3c')]));_0x521b07[_0x3bf8('0x3b')]=_0x521b07['attributes']['length']?_0x521b07[_0x3bf8('0x3b')]:_0x42cb0f[_0x3bf8('0x36')];if(!_0x243f2b[_0x3bf8('0x37')][_0x3bf8('0x3d')](_0x3bf8('0x3e'))){_0x521b07[_0x3bf8('0x3f')]=qs[_0x3bf8('0x3f')](_0x243f2b[_0x3bf8('0x37')][_0x3bf8('0x3f')]);_0x521b07['offset']=qs[_0x3bf8('0x2c')](_0x243f2b[_0x3bf8('0x37')][_0x3bf8('0x2c')]);}_0x521b07['order']=qs[_0x3bf8('0x40')](_0x243f2b[_0x3bf8('0x37')][_0x3bf8('0x40')]);_0x521b07['where']=qs[_0x3bf8('0x39')](_['pick'](_0x243f2b[_0x3bf8('0x37')],_0x42cb0f['filters']),_0x156dee);if(_0x243f2b[_0x3bf8('0x37')][_0x3bf8('0x41')]){_0x521b07[_0x3bf8('0x42')]=_['merge'](_0x521b07[_0x3bf8('0x42')],{'$or':_[_0x3bf8('0x32')](_0x156dee,function(_0x391ee8){if(_0x391ee8[_0x3bf8('0x34')]!==_0x3bf8('0x43')){var _0x1ea17f={};_0x1ea17f[_0x391ee8[_0x3bf8('0x30')]]={'$like':'%'+_0x243f2b[_0x3bf8('0x37')][_0x3bf8('0x41')]+'%'};return _0x1ea17f;}})});}_0x521b07=_[_0x3bf8('0x44')]({},_0x521b07,_0x243f2b[_0x3bf8('0x45')]);var _0x5a9d8c={'where':_0x521b07[_0x3bf8('0x42')]};return db[_0x3bf8('0x46')][_0x3bf8('0x47')](_0x5a9d8c)['then'](function(_0x2ee114){_0x5d9f6c[_0x3bf8('0x47')]=_0x2ee114;if(_0x243f2b[_0x3bf8('0x37')][_0x3bf8('0x48')]){_0x521b07['include']=[{'all':!![]}];}return db[_0x3bf8('0x46')][_0x3bf8('0x49')](_0x521b07);})[_0x3bf8('0x1c')](function(_0x1109d9){_0x5d9f6c['rows']=_0x1109d9;return _0x5d9f6c;})['then'](respondWithFilteredResult(_0x5729bc,_0x521b07))[_0x3bf8('0x27')](handleError(_0x5729bc,null));};exports[_0x3bf8('0x4a')]=function(_0x1ff860,_0x2a3b43){var _0x7e1a8d={'raw':![],'where':{'id':_0x1ff860['params']['id']}},_0x318955={};_0x318955[_0x3bf8('0x36')]=_['keys'](db[_0x3bf8('0x46')][_0x3bf8('0x33')]);_0x318955['query']=_[_0x3bf8('0x38')](_0x1ff860[_0x3bf8('0x37')]);_0x318955[_0x3bf8('0x39')]=_[_0x3bf8('0x3a')](_0x318955[_0x3bf8('0x36')],_0x318955['query']);_0x7e1a8d[_0x3bf8('0x3b')]=_[_0x3bf8('0x3a')](_0x318955[_0x3bf8('0x36')],qs[_0x3bf8('0x3c')](_0x1ff860['query']['fields']));_0x7e1a8d[_0x3bf8('0x3b')]=_0x7e1a8d[_0x3bf8('0x3b')][_0x3bf8('0x4b')]?_0x7e1a8d[_0x3bf8('0x3b')]:_0x318955[_0x3bf8('0x36')];if(_0x1ff860[_0x3bf8('0x37')][_0x3bf8('0x48')]){_0x7e1a8d[_0x3bf8('0x4c')]=[{'all':!![]}];}_0x7e1a8d=_[_0x3bf8('0x44')]({},_0x7e1a8d,_0x1ff860[_0x3bf8('0x45')]);return db[_0x3bf8('0x46')][_0x3bf8('0x4d')](_0x7e1a8d)[_0x3bf8('0x1c')](handleEntityNotFound(_0x2a3b43,null))[_0x3bf8('0x1c')](respondWithResult(_0x2a3b43,null))[_0x3bf8('0x27')](handleError(_0x2a3b43,null));};exports[_0x3bf8('0x4e')]=function(_0x5d5821,_0x119161){if(_0x5d5821[_0x3bf8('0x4f')]['id']){delete _0x5d5821['body']['id'];}return db[_0x3bf8('0x46')][_0x3bf8('0x4d')]({'where':{'id':_0x5d5821['params']['id']}})[_0x3bf8('0x1c')](handleEntityNotFound(_0x119161,null))[_0x3bf8('0x1c')](saveUpdates(_0x5d5821[_0x3bf8('0x4f')],null))['then'](respondWithResult(_0x119161,null))['catch'](handleError(_0x119161,null));};exports['addLogo']=function(_0x36db22,_0x3808c2,_0x6f32da){if(_0x36db22['file']&&_0x36db22[_0x3bf8('0x50')][_0x3bf8('0x51')]){_0x36db22['body'][_0x3bf8('0x52')]=_0x36db22[_0x3bf8('0x50')]['filename'];}return db[_0x3bf8('0x46')]['find']({'where':{'id':_0x36db22[_0x3bf8('0x53')]['id']}})[_0x3bf8('0x1c')](handleEntityNotFound(_0x3808c2,null))[_0x3bf8('0x1c')](saveUpdates(_0x36db22[_0x3bf8('0x4f')],null))[_0x3bf8('0x1c')](respondWithResult(_0x3808c2,null))['catch'](handleError(_0x3808c2,null));};exports[_0x3bf8('0x54')]=function(_0x25d81e,_0x15ad4e,_0xa89ddd){if(_0x25d81e[_0x3bf8('0x50')]&&_0x25d81e[_0x3bf8('0x50')][_0x3bf8('0x51')]){_0x25d81e[_0x3bf8('0x4f')][_0x3bf8('0x55')]=_0x25d81e['file'][_0x3bf8('0x51')];}return db['Setting']['find']({'where':{'id':_0x25d81e['params']['id']}})[_0x3bf8('0x1c')](handleEntityNotFound(_0x15ad4e,null))[_0x3bf8('0x1c')](saveUpdates(_0x25d81e[_0x3bf8('0x4f')],null))[_0x3bf8('0x1c')](respondWithResult(_0x15ad4e,null))[_0x3bf8('0x27')](handleError(_0x15ad4e,null));};var utilLicense=require(_0x3bf8('0x16'));exports[_0x3bf8('0x56')]=function(_0x52836f,_0x551568,_0x2c2ad5){var _0x46aa45=_0x3bf8('0x57');var _0x2191e5={'custom':![]};return utilLicense[_0x3bf8('0x58')]()[_0x3bf8('0x1c')](function(_0x5d193d){if(_0x5d193d){_0x2191e5=_0x5d193d;}return db[_0x3bf8('0x46')][_0x3bf8('0x4d')]({'where':{'id':_0x52836f[_0x3bf8('0x53')]['id']},'attributes':['logo','loginLogo',_0x3bf8('0x59'),_0x3bf8('0x5a'),_0x3bf8('0x5b'),_0x3bf8('0x5c'),_0x3bf8('0x5d'),_0x3bf8('0x5e')],'raw':!![]});})[_0x3bf8('0x1c')](handleEntityNotFound(_0x551568,null))[_0x3bf8('0x1c')](function(_0x506eb5){if(_0x506eb5){var _0x56ec53=_0x506eb5[_0x3bf8('0x52')]&&fs['existsSync'](path['join'](config[_0x3bf8('0x5f')],_0x46aa45,_[_0x3bf8('0x60')](_0x506eb5[_0x3bf8('0x52')])))?path[_0x3bf8('0x61')](config[_0x3bf8('0x5f')],_0x46aa45,_['toLower'](_0x506eb5[_0x3bf8('0x52')])):path[_0x3bf8('0x61')](config[_0x3bf8('0x5f')],_0x46aa45,_[_0x3bf8('0x60')](_0x3bf8('0x62')));var _0x1ab992=_0x3bf8('0x63')+_[_0x3bf8('0x64')]('logo');if(_0x506eb5[_0x1ab992]||!_0x2191e5['custom']){_0x56ec53=path[_0x3bf8('0x61')](config[_0x3bf8('0x5f')],_0x46aa45,_[_0x3bf8('0x60')]('default_logo.svg'));}if(!fs['existsSync'](_0x56ec53)){throw new db[(_0x3bf8('0x65'))][(_0x3bf8('0x66'))](_[_0x3bf8('0x64')](_0x3bf8('0x52'))+_0x3bf8('0x67'));}return _0x551568[_0x3bf8('0x68')](_0x56ec53);}})[_0x3bf8('0x27')](handleError(_0x551568,null));};var utilLicense=require(_0x3bf8('0x16'));exports[_0x3bf8('0x69')]=function(_0x326c4b,_0x50c36a,_0x1dc37b){var _0x2a6f8d='server/files/images/logos';var _0x3bae3c={'custom':![]};return utilLicense[_0x3bf8('0x58')]()['then'](function(_0x3b10d9){if(_0x3b10d9){_0x3bae3c=_0x3b10d9;}return db[_0x3bf8('0x46')]['find']({'where':{'id':_0x326c4b[_0x3bf8('0x53')]['id']},'attributes':[_0x3bf8('0x52'),'loginLogo',_0x3bf8('0x59'),_0x3bf8('0x5a'),_0x3bf8('0x5b'),_0x3bf8('0x5c'),_0x3bf8('0x5d'),_0x3bf8('0x5e')],'raw':!![]});})[_0x3bf8('0x1c')](handleEntityNotFound(_0x50c36a,null))[_0x3bf8('0x1c')](function(_0x3aef98){if(_0x3aef98){var _0x4a001e=_0x3aef98[_0x3bf8('0x55')]&&fs[_0x3bf8('0x6a')](path['join'](config[_0x3bf8('0x5f')],_0x2a6f8d,_['toLower'](_0x3aef98['loginLogo'])))?path[_0x3bf8('0x61')](config[_0x3bf8('0x5f')],_0x2a6f8d,_['toLower'](_0x3aef98['loginLogo'])):path['join'](config[_0x3bf8('0x5f')],_0x2a6f8d,_[_0x3bf8('0x60')]('default_loginLogo.svg'));var _0x3843b9=_0x3bf8('0x63')+_[_0x3bf8('0x64')](_0x3bf8('0x55'));if(_0x3aef98[_0x3843b9]||!_0x3bae3c[_0x3bf8('0x6b')]){_0x4a001e=path['join'](config[_0x3bf8('0x5f')],_0x2a6f8d,_['toLower'](_0x3bf8('0x6c')));}if(!fs[_0x3bf8('0x6a')](_0x4a001e)){throw new db[(_0x3bf8('0x65'))][(_0x3bf8('0x66'))](_[_0x3bf8('0x64')]('loginLogo')+_0x3bf8('0x67'));}return _0x50c36a[_0x3bf8('0x68')](_0x4a001e);}})[_0x3bf8('0x27')](handleError(_0x50c36a,null));};exports['gdpr']=function(_0x2b3c00,_0x35a30b){return db[_0x3bf8('0x46')][_0x3bf8('0x4d')]({'where':{'id':_0x2b3c00['params']['id']},'attributes':['securePassword']})[_0x3bf8('0x1c')](respondWithResult(_0x35a30b,null))[_0x3bf8('0x27')](handleError(_0x35a30b,null));};exports['addPreferred']=function(_0x203bc4,_0x4fc93e,_0x415e29){if(_0x203bc4['file']&&_0x203bc4[_0x3bf8('0x50')][_0x3bf8('0x51')]){_0x203bc4[_0x3bf8('0x4f')][_0x3bf8('0x59')]=_0x203bc4['file'][_0x3bf8('0x51')];}return db[_0x3bf8('0x46')][_0x3bf8('0x4d')]({'where':{'id':_0x203bc4[_0x3bf8('0x53')]['id']}})[_0x3bf8('0x1c')](handleEntityNotFound(_0x4fc93e,null))['then'](saveUpdates(_0x203bc4[_0x3bf8('0x4f')],null))[_0x3bf8('0x1c')](respondWithResult(_0x4fc93e,null))['catch'](handleError(_0x4fc93e,null));};var utilLicense=require(_0x3bf8('0x16'));exports[_0x3bf8('0x6d')]=function(_0x31e772,_0xa2a7b0,_0x145251){var _0x1a3a5e=_0x3bf8('0x57');var _0x2474c2={'custom':![]};return utilLicense[_0x3bf8('0x58')]()['then'](function(_0x52e0a7){if(_0x52e0a7){_0x2474c2=_0x52e0a7;}return db[_0x3bf8('0x46')]['find']({'where':{'id':_0x31e772[_0x3bf8('0x53')]['id']},'attributes':['logo',_0x3bf8('0x55'),_0x3bf8('0x59'),_0x3bf8('0x5a'),'defaultLogo',_0x3bf8('0x5c'),_0x3bf8('0x5d'),_0x3bf8('0x5e')],'raw':!![]});})[_0x3bf8('0x1c')](handleEntityNotFound(_0xa2a7b0,null))[_0x3bf8('0x1c')](function(_0x3846fb){if(_0x3846fb){var _0x41e05b=_0x3846fb[_0x3bf8('0x59')]&&fs[_0x3bf8('0x6a')](path[_0x3bf8('0x61')](config[_0x3bf8('0x5f')],_0x1a3a5e,_[_0x3bf8('0x60')](_0x3846fb[_0x3bf8('0x59')])))?path[_0x3bf8('0x61')](config[_0x3bf8('0x5f')],_0x1a3a5e,_['toLower'](_0x3846fb['preferred'])):path[_0x3bf8('0x61')](config[_0x3bf8('0x5f')],_0x1a3a5e,_[_0x3bf8('0x60')](_0x3bf8('0x6e')));var _0x3208b6='default'+_['upperFirst'](_0x3bf8('0x59'));if(_0x3846fb[_0x3208b6]||!_0x2474c2[_0x3bf8('0x6b')]||!_0x2474c2['preferred']){_0x41e05b=path['join'](config[_0x3bf8('0x5f')],_0x1a3a5e,_['toLower']('default_preferred.png'));}if(!fs[_0x3bf8('0x6a')](_0x41e05b)){throw new db[(_0x3bf8('0x65'))][(_0x3bf8('0x66'))](_[_0x3bf8('0x64')](_0x3bf8('0x59'))+'\x20not\x20found');}return _0xa2a7b0[_0x3bf8('0x68')](_0x41e05b);}})['catch'](handleError(_0xa2a7b0,null));};exports[_0x3bf8('0x6f')]=function(_0x1163bd,_0x64a29d,_0x5c2143){if(_0x1163bd[_0x3bf8('0x50')]&&_0x1163bd['file'][_0x3bf8('0x51')]){_0x1163bd[_0x3bf8('0x4f')]['favicon']=_0x1163bd['file'][_0x3bf8('0x51')];}return db[_0x3bf8('0x46')][_0x3bf8('0x4d')]({'where':{'id':_0x1163bd[_0x3bf8('0x53')]['id']}})[_0x3bf8('0x1c')](handleEntityNotFound(_0x64a29d,null))[_0x3bf8('0x1c')](saveUpdates(_0x1163bd[_0x3bf8('0x4f')],null))['then'](respondWithResult(_0x64a29d,null))[_0x3bf8('0x27')](handleError(_0x64a29d,null));};var utilLicense=require(_0x3bf8('0x16'));exports[_0x3bf8('0x70')]=function(_0x4d9f5f,_0x306803,_0x402057){var _0x45f1b7=_0x3bf8('0x57');var _0x23a792={'custom':![]};return utilLicense[_0x3bf8('0x58')]()[_0x3bf8('0x1c')](function(_0x1b50d4){if(_0x1b50d4){_0x23a792=_0x1b50d4;}return db[_0x3bf8('0x46')][_0x3bf8('0x4d')]({'where':{'id':_0x4d9f5f[_0x3bf8('0x53')]['id']},'attributes':['logo',_0x3bf8('0x55'),_0x3bf8('0x59'),_0x3bf8('0x5a'),_0x3bf8('0x5b'),_0x3bf8('0x5c'),_0x3bf8('0x5d'),'defaultFavicon'],'raw':!![]});})[_0x3bf8('0x1c')](handleEntityNotFound(_0x306803,null))['then'](function(_0x3ebb4a){if(_0x3ebb4a){var _0x1088d0=_0x3ebb4a[_0x3bf8('0x5a')]&&fs[_0x3bf8('0x6a')](path['join'](config[_0x3bf8('0x5f')],_0x45f1b7,_[_0x3bf8('0x60')](_0x3ebb4a[_0x3bf8('0x5a')])))?path[_0x3bf8('0x61')](config[_0x3bf8('0x5f')],_0x45f1b7,_[_0x3bf8('0x60')](_0x3ebb4a['favicon'])):path['join'](config[_0x3bf8('0x5f')],_0x45f1b7,_[_0x3bf8('0x60')](_0x3bf8('0x71')));var _0x5b1ff4='default'+_[_0x3bf8('0x64')]('favicon');if(_0x3ebb4a[_0x5b1ff4]||!_0x23a792[_0x3bf8('0x6b')]){_0x1088d0=path[_0x3bf8('0x61')](config['root'],_0x45f1b7,_[_0x3bf8('0x60')](_0x3bf8('0x71')));}if(!fs[_0x3bf8('0x6a')](_0x1088d0)){throw new db[(_0x3bf8('0x65'))][(_0x3bf8('0x66'))](_[_0x3bf8('0x64')]('favicon')+_0x3bf8('0x67'));}return _0x306803[_0x3bf8('0x68')](_0x1088d0);}})[_0x3bf8('0x27')](handleError(_0x306803,null));};exports['getDate']=function(_0x1b254f,_0x4b0b15){var _0xf3759f={'offset':moment()[_0x3bf8('0x72')]()};_0xf3759f['now']=moment()[_0x3bf8('0x72')](_0xf3759f[_0x3bf8('0x2c')])[_0x3bf8('0x73')](_0x3bf8('0x74'));return _0x4b0b15[_0x3bf8('0x29')](0xc8)[_0x3bf8('0x75')](_0xf3759f);};
\ No newline at end of file