Built motion from commit bab6f49e.|2.6.17
[motion2.git] / server / api / setting / setting.controller.js
index 76c2c41..27bc831 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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
+var _0x474d=['undefined','limit','count','set','Content-Range','reject','save','update','name','index','map','Setting','rawAttributes','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','findAll','rows','show','params','fields','includeAll','include','find','body','addLogo','file','filename','addLogoLogin','loginLogo','preferred','defaultLogo','defaultLoginLogo','defaultFavicon','logo','existsSync','join','toLower','default_logo.svg','upperFirst','custom','root','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','getLicense','favicon','defaultPreferred','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','server/files/images/logos','default_preferred.png','default','getFavicon','default_favicon.ico','getDate','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','fast-json-patch','request-promise','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','http','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Setting,\x20%s,\x20%s','catch','sendStatus','status','end','json','offset'];(function(_0x20a099,_0x423bbe){var _0x34b3d7=function(_0x307be5){while(--_0x307be5){_0x20a099['push'](_0x20a099['shift']());}};_0x34b3d7(++_0x423bbe);}(_0x474d,0x13a));var _0xd474=function(_0x21175d,_0x402553){_0x21175d=_0x21175d-0x0;var _0x5a1e91=_0x474d[_0x21175d];return _0x5a1e91;};'use strict';var emlformat=require(_0xd474('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd474('0x1'));var rp=require(_0xd474('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd474('0x3'));var path=require(_0xd474('0x4'));var sox=require(_0xd474('0x5'));var csv=require(_0xd474('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd474('0x7'));var _=require(_0xd474('0x8'));var squel=require('squel');var crypto=require(_0xd474('0x9'));var jsforce=require(_0xd474('0xa'));var deskjs=require(_0xd474('0xb'));var toCsv=require(_0xd474('0x6'));var querystring=require(_0xd474('0xc'));var Papa=require(_0xd474('0xd'));var Redis=require(_0xd474('0xe'));var authService=require(_0xd474('0xf'));var qs=require(_0xd474('0x10'));var as=require(_0xd474('0x11'));var hardwareService=require(_0xd474('0x12'));var logger=require(_0xd474('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xd474('0x14'));var licenseUtil=require(_0xd474('0x15'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xd474('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x3dee10,_0x16fbeb,_0x1a4903,_0x1e5e7c){return new BPromise(function(_0x27aed2,_0x3c76ce){var _0x22d1e6=_0x1e5e7c||client;return _0x22d1e6[_0xd474('0x17')](_0x3dee10,_0x1a4903)[_0xd474('0x18')](function(_0x4dc10c){logger[_0xd474('0x19')]('Setting,\x20%s,\x20%s',_0x16fbeb,_0xd474('0x1a'));logger[_0xd474('0x1b')](_0xd474('0x1c'),_0x16fbeb,_0xd474('0x1a'),JSON[_0xd474('0x1d')](_0x4dc10c));if(_0x4dc10c[_0xd474('0x1e')]){if(_0x4dc10c[_0xd474('0x1e')][_0xd474('0x1f')]===0x1f4){logger[_0xd474('0x1e')]('Setting,\x20%s,\x20%s',_0x16fbeb,_0x4dc10c[_0xd474('0x1e')]['message']);return _0x3c76ce(_0x4dc10c[_0xd474('0x1e')][_0xd474('0x20')]);}logger['error']('Setting,\x20%s,\x20%s',_0x16fbeb,_0x4dc10c[_0xd474('0x1e')][_0xd474('0x20')]);return _0x27aed2(_0x4dc10c['error'][_0xd474('0x20')]);}else{logger[_0xd474('0x19')](_0xd474('0x21'),_0x16fbeb,_0xd474('0x1a'));_0x27aed2(_0x4dc10c['result'][_0xd474('0x20')]);}})[_0xd474('0x22')](function(_0x23ab82){logger[_0xd474('0x1e')]('Setting,\x20%s,\x20%s',_0x16fbeb,_0x23ab82);_0x3c76ce(_0x23ab82);});});}function respondWithStatusCode(_0x2711db,_0x526e74){_0x526e74=_0x526e74||0xcc;return function(_0x55793e){if(_0x55793e){return _0x2711db[_0xd474('0x23')](_0x526e74);}return _0x2711db[_0xd474('0x24')](_0x526e74)[_0xd474('0x25')]();};}function respondWithResult(_0x38ea0a,_0x5d890e){_0x5d890e=_0x5d890e||0xc8;return function(_0x588adf){if(_0x588adf){return _0x38ea0a['status'](_0x5d890e)[_0xd474('0x26')](_0x588adf);}};}function respondWithFilteredResult(_0x2d8766,_0x16cedd){return function(_0x4c1e5e){if(_0x4c1e5e){var _0x62dd9b=typeof _0x16cedd[_0xd474('0x27')]===_0xd474('0x28')&&typeof _0x16cedd[_0xd474('0x29')]===_0xd474('0x28');var _0x252bbf=_0x4c1e5e[_0xd474('0x2a')];var _0x5568f6=_0x62dd9b?0x0:_0x16cedd[_0xd474('0x27')];var _0x2eee10=_0x62dd9b?_0x4c1e5e[_0xd474('0x2a')]:_0x16cedd[_0xd474('0x27')]+_0x16cedd[_0xd474('0x29')];var _0x2adbc5;if(_0x2eee10>=_0x252bbf){_0x2eee10=_0x252bbf;_0x2adbc5=0xc8;}else{_0x2adbc5=0xce;}_0x2d8766[_0xd474('0x24')](_0x2adbc5);return _0x2d8766[_0xd474('0x2b')](_0xd474('0x2c'),_0x5568f6+'-'+_0x2eee10+'/'+_0x252bbf)[_0xd474('0x26')](_0x4c1e5e);}return null;};}function patchUpdates(_0x274a57){return function(_0x23259c){try{jsonpatch['apply'](_0x23259c,_0x274a57,!![]);}catch(_0x413d79){return BPromise[_0xd474('0x2d')](_0x413d79);}return _0x23259c[_0xd474('0x2e')]();};}function saveUpdates(_0x14c000,_0x178c77){return function(_0x16c929){if(_0x16c929){return _0x16c929[_0xd474('0x2f')](_0x14c000)[_0xd474('0x18')](function(_0x279f31){return _0x279f31;});}return null;};}function removeEntity(_0x2ce1f5,_0x211920){return function(_0xd72655){if(_0xd72655){return _0xd72655['destroy']()[_0xd474('0x18')](function(){_0x2ce1f5[_0xd474('0x24')](0xcc)[_0xd474('0x25')]();});}};}function handleEntityNotFound(_0x152dd0,_0x5075bf){return function(_0x18947b){if(!_0x18947b){_0x152dd0[_0xd474('0x23')](0x194);}return _0x18947b;};}function handleError(_0x7aebd9,_0x26960a){_0x26960a=_0x26960a||0x1f4;return function(_0x4a968e){logger[_0xd474('0x1e')](_0x4a968e['stack']);if(_0x4a968e['name']){delete _0x4a968e[_0xd474('0x30')];}_0x7aebd9[_0xd474('0x24')](_0x26960a)['send'](_0x4a968e);};}exports[_0xd474('0x31')]=function(_0x4f491f,_0x13b841){var _0x7827ee={},_0x9618a4={},_0x4fdb36={'count':0x0,'rows':[]};var _0x189335=_[_0xd474('0x32')](db[_0xd474('0x33')][_0xd474('0x34')],function(_0x1597fd){return{'name':_0x1597fd['fieldName'],'type':_0x1597fd['type'][_0xd474('0x35')]};});_0x9618a4[_0xd474('0x36')]=_[_0xd474('0x32')](_0x189335,_0xd474('0x30'));_0x9618a4[_0xd474('0x37')]=_[_0xd474('0x38')](_0x4f491f['query']);_0x9618a4[_0xd474('0x39')]=_[_0xd474('0x3a')](_0x9618a4[_0xd474('0x36')],_0x9618a4[_0xd474('0x37')]);_0x7827ee['attributes']=_[_0xd474('0x3a')](_0x9618a4[_0xd474('0x36')],qs['fields'](_0x4f491f[_0xd474('0x37')]['fields']));_0x7827ee[_0xd474('0x3b')]=_0x7827ee[_0xd474('0x3b')]['length']?_0x7827ee[_0xd474('0x3b')]:_0x9618a4[_0xd474('0x36')];if(!_0x4f491f[_0xd474('0x37')][_0xd474('0x3c')](_0xd474('0x3d'))){_0x7827ee[_0xd474('0x29')]=qs[_0xd474('0x29')](_0x4f491f[_0xd474('0x37')]['limit']);_0x7827ee[_0xd474('0x27')]=qs[_0xd474('0x27')](_0x4f491f[_0xd474('0x37')][_0xd474('0x27')]);}_0x7827ee['order']=qs[_0xd474('0x3e')](_0x4f491f[_0xd474('0x37')][_0xd474('0x3e')]);_0x7827ee[_0xd474('0x3f')]=qs[_0xd474('0x39')](_[_0xd474('0x40')](_0x4f491f['query'],_0x9618a4['filters']),_0x189335);if(_0x4f491f[_0xd474('0x37')][_0xd474('0x41')]){_0x7827ee['where']=_[_0xd474('0x42')](_0x7827ee[_0xd474('0x3f')],{'$or':_[_0xd474('0x32')](_0x189335,function(_0xfff3b2){if(_0xfff3b2[_0xd474('0x43')]!==_0xd474('0x44')){var _0x9fedab={};_0x9fedab[_0xfff3b2['name']]={'$like':'%'+_0x4f491f[_0xd474('0x37')][_0xd474('0x41')]+'%'};return _0x9fedab;}})});}_0x7827ee=_[_0xd474('0x42')]({},_0x7827ee,_0x4f491f[_0xd474('0x45')]);var _0x3fbfbf={'where':_0x7827ee[_0xd474('0x3f')]};return db[_0xd474('0x33')][_0xd474('0x2a')](_0x3fbfbf)[_0xd474('0x18')](function(_0x15152d){_0x4fdb36[_0xd474('0x2a')]=_0x15152d;if(_0x4f491f[_0xd474('0x37')]['includeAll']){_0x7827ee['include']=[{'all':!![]}];}return db[_0xd474('0x33')][_0xd474('0x46')](_0x7827ee);})[_0xd474('0x18')](function(_0x5dc55a){_0x4fdb36[_0xd474('0x47')]=_0x5dc55a;return _0x4fdb36;})[_0xd474('0x18')](respondWithFilteredResult(_0x13b841,_0x7827ee))['catch'](handleError(_0x13b841,null));};exports[_0xd474('0x48')]=function(_0x26fccf,_0x148e8e){var _0x2cf377={'raw':![],'where':{'id':_0x26fccf[_0xd474('0x49')]['id']}},_0x5e9354={};_0x5e9354[_0xd474('0x36')]=_[_0xd474('0x38')](db[_0xd474('0x33')]['rawAttributes']);_0x5e9354[_0xd474('0x37')]=_[_0xd474('0x38')](_0x26fccf[_0xd474('0x37')]);_0x5e9354['filters']=_[_0xd474('0x3a')](_0x5e9354['model'],_0x5e9354['query']);_0x2cf377[_0xd474('0x3b')]=_[_0xd474('0x3a')](_0x5e9354[_0xd474('0x36')],qs[_0xd474('0x4a')](_0x26fccf['query'][_0xd474('0x4a')]));_0x2cf377[_0xd474('0x3b')]=_0x2cf377[_0xd474('0x3b')]['length']?_0x2cf377[_0xd474('0x3b')]:_0x5e9354['model'];if(_0x26fccf['query'][_0xd474('0x4b')]){_0x2cf377[_0xd474('0x4c')]=[{'all':!![]}];}_0x2cf377=_[_0xd474('0x42')]({},_0x2cf377,_0x26fccf[_0xd474('0x45')]);return db['Setting'][_0xd474('0x4d')](_0x2cf377)[_0xd474('0x18')](handleEntityNotFound(_0x148e8e,null))[_0xd474('0x18')](respondWithResult(_0x148e8e,null))[_0xd474('0x22')](handleError(_0x148e8e,null));};exports['update']=function(_0x57ec20,_0x4076d2){if(_0x57ec20['body']['id']){delete _0x57ec20['body']['id'];}return db[_0xd474('0x33')][_0xd474('0x4d')]({'where':{'id':_0x57ec20['params']['id']}})[_0xd474('0x18')](handleEntityNotFound(_0x4076d2,null))[_0xd474('0x18')](saveUpdates(_0x57ec20[_0xd474('0x4e')],null))[_0xd474('0x18')](respondWithResult(_0x4076d2,null))[_0xd474('0x22')](handleError(_0x4076d2,null));};exports[_0xd474('0x4f')]=function(_0x5af094,_0x2ab921,_0x5e28bf){if(_0x5af094[_0xd474('0x50')]&&_0x5af094[_0xd474('0x50')][_0xd474('0x51')]){_0x5af094[_0xd474('0x4e')]['logo']=_0x5af094[_0xd474('0x50')][_0xd474('0x51')];}return db[_0xd474('0x33')][_0xd474('0x4d')]({'where':{'id':_0x5af094[_0xd474('0x49')]['id']}})['then'](handleEntityNotFound(_0x2ab921,null))[_0xd474('0x18')](saveUpdates(_0x5af094[_0xd474('0x4e')],null))[_0xd474('0x18')](respondWithResult(_0x2ab921,null))[_0xd474('0x22')](handleError(_0x2ab921,null));};exports[_0xd474('0x52')]=function(_0x4dbc73,_0x51fea4,_0xfd1d71){if(_0x4dbc73['file']&&_0x4dbc73['file']['filename']){_0x4dbc73[_0xd474('0x4e')][_0xd474('0x53')]=_0x4dbc73[_0xd474('0x50')]['filename'];}return db['Setting']['find']({'where':{'id':_0x4dbc73['params']['id']}})['then'](handleEntityNotFound(_0x51fea4,null))[_0xd474('0x18')](saveUpdates(_0x4dbc73[_0xd474('0x4e')],null))['then'](respondWithResult(_0x51fea4,null))[_0xd474('0x22')](handleError(_0x51fea4,null));};var utilLicense=require(_0xd474('0x15'));exports['getLogo']=function(_0x8a74c1,_0x44ca0e,_0x1201e6){var _0xd6bd04='server/files/images/logos';var _0x48d020={'custom':![]};return utilLicense['getLicense']()[_0xd474('0x18')](function(_0x48dcd2){if(_0x48dcd2){_0x48d020=_0x48dcd2;}return db[_0xd474('0x33')][_0xd474('0x4d')]({'where':{'id':_0x8a74c1[_0xd474('0x49')]['id']},'attributes':['logo','loginLogo',_0xd474('0x54'),'favicon',_0xd474('0x55'),_0xd474('0x56'),'defaultPreferred',_0xd474('0x57')],'raw':!![]});})[_0xd474('0x18')](handleEntityNotFound(_0x44ca0e,null))[_0xd474('0x18')](function(_0x99adbb){if(_0x99adbb){var _0x31cd8d=_0x99adbb[_0xd474('0x58')]&&fs[_0xd474('0x59')](path[_0xd474('0x5a')](config['root'],_0xd6bd04,_['toLower'](_0x99adbb[_0xd474('0x58')])))?path[_0xd474('0x5a')](config['root'],_0xd6bd04,_[_0xd474('0x5b')](_0x99adbb['logo'])):path[_0xd474('0x5a')](config['root'],_0xd6bd04,_[_0xd474('0x5b')](_0xd474('0x5c')));var _0x198b60='default'+_[_0xd474('0x5d')]('logo');if(_0x99adbb[_0x198b60]||!_0x48d020[_0xd474('0x5e')]){_0x31cd8d=path['join'](config[_0xd474('0x5f')],_0xd6bd04,_[_0xd474('0x5b')](_0xd474('0x5c')));}if(!fs[_0xd474('0x59')](_0x31cd8d)){throw new db[(_0xd474('0x60'))][(_0xd474('0x61'))](_[_0xd474('0x5d')](_0xd474('0x58'))+_0xd474('0x62'));}return _0x44ca0e[_0xd474('0x63')](_0x31cd8d);}})[_0xd474('0x22')](handleError(_0x44ca0e,null));};var utilLicense=require(_0xd474('0x15'));exports[_0xd474('0x64')]=function(_0x117923,_0x1cf052,_0x6376e){var _0x351cd5='server/files/images/logos';var _0x2fc205={'custom':![]};return utilLicense[_0xd474('0x65')]()[_0xd474('0x18')](function(_0x199c71){if(_0x199c71){_0x2fc205=_0x199c71;}return db[_0xd474('0x33')][_0xd474('0x4d')]({'where':{'id':_0x117923[_0xd474('0x49')]['id']},'attributes':['logo',_0xd474('0x53'),_0xd474('0x54'),_0xd474('0x66'),_0xd474('0x55'),_0xd474('0x56'),_0xd474('0x67'),_0xd474('0x57')],'raw':!![]});})[_0xd474('0x18')](handleEntityNotFound(_0x1cf052,null))[_0xd474('0x18')](function(_0x3fe4ef){if(_0x3fe4ef){var _0x28f8af=_0x3fe4ef[_0xd474('0x53')]&&fs['existsSync'](path[_0xd474('0x5a')](config['root'],_0x351cd5,_[_0xd474('0x5b')](_0x3fe4ef[_0xd474('0x53')])))?path[_0xd474('0x5a')](config['root'],_0x351cd5,_[_0xd474('0x5b')](_0x3fe4ef[_0xd474('0x53')])):path[_0xd474('0x5a')](config['root'],_0x351cd5,_[_0xd474('0x5b')](_0xd474('0x68')));var _0x20c01e='default'+_[_0xd474('0x5d')](_0xd474('0x53'));if(_0x3fe4ef[_0x20c01e]||!_0x2fc205[_0xd474('0x5e')]){_0x28f8af=path[_0xd474('0x5a')](config[_0xd474('0x5f')],_0x351cd5,_[_0xd474('0x5b')]('default_loginLogo.svg'));}if(!fs[_0xd474('0x59')](_0x28f8af)){throw new db[(_0xd474('0x60'))][(_0xd474('0x61'))](_[_0xd474('0x5d')](_0xd474('0x53'))+_0xd474('0x62'));}return _0x1cf052['download'](_0x28f8af);}})['catch'](handleError(_0x1cf052,null));};exports[_0xd474('0x69')]=function(_0x3ae888,_0x997c82){return db[_0xd474('0x33')][_0xd474('0x4d')]({'where':{'id':_0x3ae888['params']['id']},'attributes':[_0xd474('0x6a')]})['then'](respondWithResult(_0x997c82,null))[_0xd474('0x22')](handleError(_0x997c82,null));};exports[_0xd474('0x6b')]=function(_0xc97fde,_0x301c28,_0x297a8d){if(_0xc97fde['file']&&_0xc97fde[_0xd474('0x50')][_0xd474('0x51')]){_0xc97fde[_0xd474('0x4e')]['preferred']=_0xc97fde[_0xd474('0x50')][_0xd474('0x51')];}return db[_0xd474('0x33')][_0xd474('0x4d')]({'where':{'id':_0xc97fde[_0xd474('0x49')]['id']}})[_0xd474('0x18')](handleEntityNotFound(_0x301c28,null))['then'](saveUpdates(_0xc97fde[_0xd474('0x4e')],null))['then'](respondWithResult(_0x301c28,null))['catch'](handleError(_0x301c28,null));};var utilLicense=require(_0xd474('0x15'));exports[_0xd474('0x6c')]=function(_0x5759b9,_0x540062,_0x274aa9){var _0x21fecf=_0xd474('0x6d');var _0x243d1a={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x27e69c){if(_0x27e69c){_0x243d1a=_0x27e69c;}return db[_0xd474('0x33')][_0xd474('0x4d')]({'where':{'id':_0x5759b9[_0xd474('0x49')]['id']},'attributes':[_0xd474('0x58'),'loginLogo',_0xd474('0x54'),_0xd474('0x66'),_0xd474('0x55'),_0xd474('0x56'),_0xd474('0x67'),'defaultFavicon'],'raw':!![]});})[_0xd474('0x18')](handleEntityNotFound(_0x540062,null))['then'](function(_0x5eeca7){if(_0x5eeca7){var _0x56d295=_0x5eeca7[_0xd474('0x54')]&&fs[_0xd474('0x59')](path[_0xd474('0x5a')](config['root'],_0x21fecf,_[_0xd474('0x5b')](_0x5eeca7[_0xd474('0x54')])))?path['join'](config[_0xd474('0x5f')],_0x21fecf,_[_0xd474('0x5b')](_0x5eeca7[_0xd474('0x54')])):path[_0xd474('0x5a')](config[_0xd474('0x5f')],_0x21fecf,_[_0xd474('0x5b')](_0xd474('0x6e')));var _0x3fd88a=_0xd474('0x6f')+_[_0xd474('0x5d')]('preferred');if(_0x5eeca7[_0x3fd88a]||!_0x243d1a[_0xd474('0x5e')]||!_0x243d1a[_0xd474('0x54')]){_0x56d295=path[_0xd474('0x5a')](config[_0xd474('0x5f')],_0x21fecf,_['toLower'](_0xd474('0x6e')));}if(!fs[_0xd474('0x59')](_0x56d295)){throw new db[(_0xd474('0x60'))][(_0xd474('0x61'))](_[_0xd474('0x5d')](_0xd474('0x54'))+_0xd474('0x62'));}return _0x540062[_0xd474('0x63')](_0x56d295);}})[_0xd474('0x22')](handleError(_0x540062,null));};exports['addFavicon']=function(_0x578c8e,_0x1d12ed,_0x2598ad){if(_0x578c8e['file']&&_0x578c8e['file']['filename']){_0x578c8e[_0xd474('0x4e')][_0xd474('0x66')]=_0x578c8e[_0xd474('0x50')][_0xd474('0x51')];}return db[_0xd474('0x33')][_0xd474('0x4d')]({'where':{'id':_0x578c8e[_0xd474('0x49')]['id']}})['then'](handleEntityNotFound(_0x1d12ed,null))['then'](saveUpdates(_0x578c8e[_0xd474('0x4e')],null))[_0xd474('0x18')](respondWithResult(_0x1d12ed,null))[_0xd474('0x22')](handleError(_0x1d12ed,null));};var utilLicense=require(_0xd474('0x15'));exports[_0xd474('0x70')]=function(_0x4a9cc1,_0x308ba0,_0x4fd389){var _0x35253c='server/files/images/logos';var _0xab849e={'custom':![]};return utilLicense[_0xd474('0x65')]()[_0xd474('0x18')](function(_0x2a63b6){if(_0x2a63b6){_0xab849e=_0x2a63b6;}return db['Setting']['find']({'where':{'id':_0x4a9cc1[_0xd474('0x49')]['id']},'attributes':[_0xd474('0x58'),'loginLogo',_0xd474('0x54'),'favicon','defaultLogo',_0xd474('0x56'),_0xd474('0x67'),_0xd474('0x57')],'raw':!![]});})['then'](handleEntityNotFound(_0x308ba0,null))[_0xd474('0x18')](function(_0x42ff9c){if(_0x42ff9c){var _0x548217=_0x42ff9c[_0xd474('0x66')]&&fs[_0xd474('0x59')](path[_0xd474('0x5a')](config[_0xd474('0x5f')],_0x35253c,_[_0xd474('0x5b')](_0x42ff9c['favicon'])))?path[_0xd474('0x5a')](config[_0xd474('0x5f')],_0x35253c,_[_0xd474('0x5b')](_0x42ff9c[_0xd474('0x66')])):path[_0xd474('0x5a')](config['root'],_0x35253c,_['toLower'](_0xd474('0x71')));var _0x19e860=_0xd474('0x6f')+_[_0xd474('0x5d')](_0xd474('0x66'));if(_0x42ff9c[_0x19e860]||!_0xab849e[_0xd474('0x5e')]){_0x548217=path['join'](config['root'],_0x35253c,_[_0xd474('0x5b')]('default_favicon.ico'));}if(!fs[_0xd474('0x59')](_0x548217)){throw new db[(_0xd474('0x60'))][(_0xd474('0x61'))](_[_0xd474('0x5d')](_0xd474('0x66'))+'\x20not\x20found');}return _0x308ba0['download'](_0x548217);}})['catch'](handleError(_0x308ba0,null));};exports[_0xd474('0x72')]=function(_0xb06ddc,_0x1feeee){var _0x3df274={'offset':moment()[_0xd474('0x73')]()};_0x3df274[_0xd474('0x74')]=moment()[_0xd474('0x73')](_0x3df274['offset'])['format'](_0xd474('0x75'));return _0x1feeee['status'](0xc8)['send'](_0x3df274);};
\ No newline at end of file