Built motion from commit (unavailable).|2.5.1
[motion2.git] / server / api / setting / setting.controller.js
index 29fe65c..c92f210 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf424=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','jayson/promise','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','stringify','error','code','Setting,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','set','Content-Range','save','destroy','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','limit','order','sort','where','count','include','findAll','rows','show','params','keys','length','includeAll','options','find','update','body','get','readFileSync','root','server/files/templates/stun.ejs','render','join','server/files/templates/turn.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','res_rtp_asterisk.so','addLogo','file','logo','filename','loginLogo','../../config/license/util','getLicense','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','toLower','default_logo.png','default','upperFirst','custom','\x20not\x20found','download','getLogoLogin','server/files/images/logos','default_loginLogo.png','gdpr','getPreferred','favicon','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','lodash','squel','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x108c5f,_0x505e54){var _0x108ed9=function(_0x30d1ae){while(--_0x30d1ae){_0x108c5f['push'](_0x108c5f['shift']());}};_0x108ed9(++_0x505e54);}(_0xf424,0x15d));var _0x4f42=function(_0x2d4340,_0x14bd7f){_0x2d4340=_0x2d4340-0x0;var _0x5a2e9e=_0xf424[_0x2d4340];return _0x5a2e9e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4f42('0x0'));var rimraf=require(_0x4f42('0x1'));var zipdir=require(_0x4f42('0x2'));var jsonpatch=require(_0x4f42('0x3'));var rp=require('request-promise');var moment=require(_0x4f42('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4f42('0x5'));var util=require('util');var path=require(_0x4f42('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x4f42('0x7'));var squel=require(_0x4f42('0x8'));var crypto=require('crypto');var jsforce=require(_0x4f42('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x4f42('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4f42('0xb'));var authService=require(_0x4f42('0xc'));var qs=require(_0x4f42('0xd'));var as=require(_0x4f42('0xe'));var hardwareService=require(_0x4f42('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x4f42('0x10'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x4f42('0x11'));var client=jayson[_0x4f42('0x12')]['http']({'port':0x232a});function checkPasswordPattern(_0x103c65,_0x16d07a,_0xbb2b70){if(_0xbb2b70){var _0x96bd08=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x96bd08['test'](_0x16d07a)){return _0x103c65;}else{throw new db[(_0x4f42('0x13'))][(_0x4f42('0x14'))](_0x4f42('0x15'));}}else{return _0x103c65;}}function respondWithRpcPromise(_0x4c5596,_0x53cf38,_0x337884,_0x1afa15){return new BPromise(function(_0x3a0c81,_0x4ce2d4){var _0x51cf10=_0x1afa15||client;return _0x51cf10[_0x4f42('0x16')](_0x4c5596,_0x337884)[_0x4f42('0x17')](function(_0x2c5696){logger[_0x4f42('0x18')]('Setting,\x20%s,\x20%s',_0x53cf38,_0x4f42('0x19'));logger[_0x4f42('0x1a')]('Setting,\x20%s,\x20%s,\x20%s',_0x53cf38,_0x4f42('0x19'),JSON[_0x4f42('0x1b')](_0x2c5696));if(_0x2c5696[_0x4f42('0x1c')]){if(_0x2c5696[_0x4f42('0x1c')][_0x4f42('0x1d')]===0x1f4){logger['error'](_0x4f42('0x1e'),_0x53cf38,_0x2c5696['error']['message']);return _0x4ce2d4(_0x2c5696[_0x4f42('0x1c')][_0x4f42('0x1f')]);}logger[_0x4f42('0x1c')]('Setting,\x20%s,\x20%s',_0x53cf38,_0x2c5696['error']['message']);return _0x3a0c81(_0x2c5696['error'][_0x4f42('0x1f')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x53cf38,_0x4f42('0x19'));_0x3a0c81(_0x2c5696[_0x4f42('0x20')][_0x4f42('0x1f')]);}})[_0x4f42('0x21')](function(_0x523ae1){logger[_0x4f42('0x1c')](_0x4f42('0x1e'),_0x53cf38,_0x523ae1);_0x4ce2d4(_0x523ae1);});});}function respondWithStatusCode(_0x536392,_0x5d1b1d){_0x5d1b1d=_0x5d1b1d||0xcc;return function(_0x1d2d89){if(_0x1d2d89){return _0x536392[_0x4f42('0x22')](_0x5d1b1d);}return _0x536392[_0x4f42('0x23')](_0x5d1b1d)[_0x4f42('0x24')]();};}function respondWithResult(_0x756ff5,_0x31af0b){_0x31af0b=_0x31af0b||0xc8;return function(_0xd4daf0){if(_0xd4daf0){return _0x756ff5['status'](_0x31af0b)[_0x4f42('0x25')](_0xd4daf0);}};}function respondWithFilteredResult(_0x5b556d,_0x1ef797){return function(_0x18de8f){if(_0x18de8f){var _0x483d01=_0x18de8f['count'],_0x50dc1d=_0x1ef797[_0x4f42('0x26')],_0x2a75ab=_0x1ef797[_0x4f42('0x26')]+_0x1ef797['limit'],_0x5f22c6;if(_0x2a75ab>=_0x483d01){_0x2a75ab=_0x483d01;_0x5f22c6=0xc8;}else{_0x5f22c6=0xce;}_0x5b556d[_0x4f42('0x23')](_0x5f22c6);return _0x5b556d[_0x4f42('0x27')](_0x4f42('0x28'),_0x50dc1d+'-'+_0x2a75ab+'/'+_0x483d01)[_0x4f42('0x25')](_0x18de8f);}return null;};}function patchUpdates(_0xdb3c01){return function(_0x14b5d3){try{jsonpatch['apply'](_0x14b5d3,_0xdb3c01,!![]);}catch(_0x2d832d){return BPromise['reject'](_0x2d832d);}return _0x14b5d3[_0x4f42('0x29')]();};}function saveUpdates(_0x173847,_0x2fd896){return function(_0x23c463){if(_0x23c463){return _0x23c463['update'](_0x173847)[_0x4f42('0x17')](function(_0x2f849a){return _0x2f849a;});}return null;};}function removeEntity(_0x77edb7,_0x50cf0a){return function(_0x1356b4){if(_0x1356b4){return _0x1356b4[_0x4f42('0x2a')]()[_0x4f42('0x17')](function(){_0x77edb7['status'](0xcc)[_0x4f42('0x24')]();});}};}function handleEntityNotFound(_0x284d55,_0x4e0884){return function(_0x5ca6a0){if(!_0x5ca6a0){_0x284d55[_0x4f42('0x22')](0x194);}return _0x5ca6a0;};}function handleError(_0x51dd20,_0x54c545){_0x54c545=_0x54c545||0x1f4;return function(_0x3fbeca){logger[_0x4f42('0x1c')](_0x3fbeca[_0x4f42('0x2b')]);if(_0x3fbeca[_0x4f42('0x2c')]){delete _0x3fbeca[_0x4f42('0x2c')];}_0x51dd20[_0x4f42('0x23')](_0x54c545)[_0x4f42('0x2d')](_0x3fbeca);};}exports[_0x4f42('0x2e')]=function(_0x4a51a0,_0x2c9f2f){var _0x22cca4={},_0x542198={},_0x115ffa={'count':0x0,'rows':[]};var _0x4f2464=_[_0x4f42('0x2f')](db[_0x4f42('0x30')][_0x4f42('0x31')],function(_0x51059e){return{'name':_0x51059e[_0x4f42('0x32')],'type':_0x51059e[_0x4f42('0x33')][_0x4f42('0x34')]};});_0x542198['model']=_[_0x4f42('0x2f')](_0x4f2464,_0x4f42('0x2c'));_0x542198['query']=_['keys'](_0x4a51a0[_0x4f42('0x35')]);_0x542198[_0x4f42('0x36')]=_[_0x4f42('0x37')](_0x542198['model'],_0x542198[_0x4f42('0x35')]);_0x22cca4['attributes']=_[_0x4f42('0x37')](_0x542198[_0x4f42('0x38')],qs[_0x4f42('0x39')](_0x4a51a0[_0x4f42('0x35')]['fields']));_0x22cca4[_0x4f42('0x3a')]=_0x22cca4[_0x4f42('0x3a')]['length']?_0x22cca4[_0x4f42('0x3a')]:_0x542198[_0x4f42('0x38')];if(!_0x4a51a0[_0x4f42('0x35')][_0x4f42('0x3b')]('nolimit')){_0x22cca4['limit']=qs[_0x4f42('0x3c')](_0x4a51a0[_0x4f42('0x35')][_0x4f42('0x3c')]);_0x22cca4['offset']=qs['offset'](_0x4a51a0['query'][_0x4f42('0x26')]);}_0x22cca4[_0x4f42('0x3d')]=qs[_0x4f42('0x3e')](_0x4a51a0[_0x4f42('0x35')][_0x4f42('0x3e')]);_0x22cca4[_0x4f42('0x3f')]=qs['filters'](_['pick'](_0x4a51a0['query'],_0x542198[_0x4f42('0x36')]));if(_0x4a51a0[_0x4f42('0x35')]['filter']){_0x22cca4[_0x4f42('0x3f')]=_['merge'](_0x22cca4[_0x4f42('0x3f')],{'$or':_[_0x4f42('0x2f')](_0x4f2464,function(_0x2d5d51){if(_0x2d5d51[_0x4f42('0x33')]!=='VIRTUAL'){var _0x5a0ce7={};_0x5a0ce7[_0x2d5d51['name']]={'$like':'%'+_0x4a51a0[_0x4f42('0x35')]['filter']+'%'};return _0x5a0ce7;}})});}_0x22cca4=_['merge']({},_0x22cca4,_0x4a51a0['options']);var _0x4e5f75={'where':_0x22cca4['where']};return db[_0x4f42('0x30')][_0x4f42('0x40')](_0x4e5f75)['then'](function(_0x161b12){_0x115ffa[_0x4f42('0x40')]=_0x161b12;if(_0x4a51a0[_0x4f42('0x35')]['includeAll']){_0x22cca4[_0x4f42('0x41')]=[{'all':!![]}];}return db[_0x4f42('0x30')][_0x4f42('0x42')](_0x22cca4);})[_0x4f42('0x17')](function(_0x48c708){_0x115ffa[_0x4f42('0x43')]=_0x48c708;return _0x115ffa;})[_0x4f42('0x17')](respondWithFilteredResult(_0x2c9f2f,_0x22cca4))[_0x4f42('0x21')](handleError(_0x2c9f2f,null));};exports[_0x4f42('0x44')]=function(_0x2cd8be,_0x46ce68){var _0x541532={'raw':![],'where':{'id':_0x2cd8be[_0x4f42('0x45')]['id']}},_0x3553d0={};_0x3553d0[_0x4f42('0x38')]=_[_0x4f42('0x46')](db['Setting'][_0x4f42('0x31')]);_0x3553d0[_0x4f42('0x35')]=_[_0x4f42('0x46')](_0x2cd8be[_0x4f42('0x35')]);_0x3553d0[_0x4f42('0x36')]=_[_0x4f42('0x37')](_0x3553d0[_0x4f42('0x38')],_0x3553d0[_0x4f42('0x35')]);_0x541532[_0x4f42('0x3a')]=_[_0x4f42('0x37')](_0x3553d0['model'],qs[_0x4f42('0x39')](_0x2cd8be[_0x4f42('0x35')]['fields']));_0x541532[_0x4f42('0x3a')]=_0x541532[_0x4f42('0x3a')][_0x4f42('0x47')]?_0x541532['attributes']:_0x3553d0['model'];if(_0x2cd8be['query'][_0x4f42('0x48')]){_0x541532[_0x4f42('0x41')]=[{'all':!![]}];}_0x541532=_['merge']({},_0x541532,_0x2cd8be[_0x4f42('0x49')]);return db[_0x4f42('0x30')][_0x4f42('0x4a')](_0x541532)[_0x4f42('0x17')](handleEntityNotFound(_0x46ce68,null))[_0x4f42('0x17')](respondWithResult(_0x46ce68,null))[_0x4f42('0x21')](handleError(_0x46ce68,null));};exports[_0x4f42('0x4b')]=function(_0x715117,_0xfb8520,_0x4af7e5){var _0x5c5a2e;return db[_0x4f42('0x30')]['find']({'where':{'id':_0x715117[_0x4f42('0x45')]['id']}})[_0x4f42('0x17')](handleEntityNotFound(_0xfb8520,null))['then'](saveUpdates(_0x715117[_0x4f42('0x4c')],null))[_0x4f42('0x17')](function(_0x274820){if(_0x274820){_0x5c5a2e=_0x274820[_0x4f42('0x4d')]({'plain':!![]});var _0x5f2133=fs[_0x4f42('0x4e')](path['join'](config[_0x4f42('0x4f')],_0x4f42('0x50')),'utf8');var _0x57309b=ejs[_0x4f42('0x51')](_0x5f2133,_0x5c5a2e);var _0x1a4927=fs[_0x4f42('0x4e')](path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0x4f42('0x53')),_0x4f42('0x54'));var _0x5e787e=ejs[_0x4f42('0x51')](_0x1a4927,_0x5c5a2e);fs[_0x4f42('0x55')](_0x4f42('0x56'),_0x57309b);fs[_0x4f42('0x55')](_0x4f42('0x57'),_0x5e787e);return respondWithRpcPromise(_0x4f42('0x58'),_0x4f42('0x4b'),{'module':_0x4f42('0x59')});}})[_0x4f42('0x17')](function(){return respondWithRpcPromise(_0x4f42('0x58'),'update',{'module':_0x4f42('0x5a')});})['then'](function(){return _0x5c5a2e||null;})[_0x4f42('0x17')](respondWithResult(_0xfb8520,null))[_0x4f42('0x21')](handleError(_0xfb8520,null));};exports[_0x4f42('0x5b')]=function(_0x573979,_0x498bfb,_0x4207c0){if(_0x573979[_0x4f42('0x5c')]&&_0x573979[_0x4f42('0x5c')]['filename']){_0x573979[_0x4f42('0x4c')][_0x4f42('0x5d')]=_0x573979[_0x4f42('0x5c')][_0x4f42('0x5e')];}return db['Setting'][_0x4f42('0x4a')]({'where':{'id':_0x573979[_0x4f42('0x45')]['id']}})[_0x4f42('0x17')](handleEntityNotFound(_0x498bfb,null))[_0x4f42('0x17')](saveUpdates(_0x573979[_0x4f42('0x4c')],null))[_0x4f42('0x17')](respondWithResult(_0x498bfb,null))['catch'](handleError(_0x498bfb,null));};exports['addLogoLogin']=function(_0xd46172,_0x32b414,_0x4fbb7c){if(_0xd46172[_0x4f42('0x5c')]&&_0xd46172[_0x4f42('0x5c')][_0x4f42('0x5e')]){_0xd46172[_0x4f42('0x4c')][_0x4f42('0x5f')]=_0xd46172[_0x4f42('0x5c')][_0x4f42('0x5e')];}return db[_0x4f42('0x30')][_0x4f42('0x4a')]({'where':{'id':_0xd46172['params']['id']}})[_0x4f42('0x17')](handleEntityNotFound(_0x32b414,null))['then'](saveUpdates(_0xd46172[_0x4f42('0x4c')],null))[_0x4f42('0x17')](respondWithResult(_0x32b414,null))[_0x4f42('0x21')](handleError(_0x32b414,null));};var utilLicense=require(_0x4f42('0x60'));exports['getLogo']=function(_0x4584f6,_0x5bc08b,_0x255293){var _0x2795c4='server/files/images/logos';var _0x329988={'custom':![]};return utilLicense[_0x4f42('0x61')]()[_0x4f42('0x17')](function(_0x35db60){if(_0x35db60){_0x329988=_0x35db60;}return db[_0x4f42('0x30')]['find']({'where':{'id':_0x4584f6[_0x4f42('0x45')]['id']},'attributes':['logo','loginLogo',_0x4f42('0x62'),'favicon',_0x4f42('0x63'),_0x4f42('0x64'),_0x4f42('0x65'),_0x4f42('0x66')],'raw':!![]});})[_0x4f42('0x17')](handleEntityNotFound(_0x5bc08b,null))['then'](function(_0x1fa3e8){if(_0x1fa3e8){var _0x5e1858=_0x1fa3e8['logo']&&fs[_0x4f42('0x67')](path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0x2795c4,_['toLower'](_0x1fa3e8['logo'])))?path[_0x4f42('0x52')](config['root'],_0x2795c4,_[_0x4f42('0x68')](_0x1fa3e8[_0x4f42('0x5d')])):path['join'](config['root'],_0x2795c4,_[_0x4f42('0x68')](_0x4f42('0x69')));var _0x46f5fa=_0x4f42('0x6a')+_[_0x4f42('0x6b')](_0x4f42('0x5d'));if(_0x1fa3e8[_0x46f5fa]||!_0x329988[_0x4f42('0x6c')]){_0x5e1858=path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0x2795c4,_[_0x4f42('0x68')]('default_logo.png'));}if(!fs[_0x4f42('0x67')](_0x5e1858)){throw new db[(_0x4f42('0x13'))][(_0x4f42('0x14'))](_[_0x4f42('0x6b')]('logo')+_0x4f42('0x6d'));}return _0x5bc08b[_0x4f42('0x6e')](_0x5e1858);}})[_0x4f42('0x21')](handleError(_0x5bc08b,null));};var utilLicense=require(_0x4f42('0x60'));exports[_0x4f42('0x6f')]=function(_0x559cbd,_0x58562a,_0x5b1712){var _0x29b2f7=_0x4f42('0x70');var _0x472198={'custom':![]};return utilLicense[_0x4f42('0x61')]()[_0x4f42('0x17')](function(_0x58a0a7){if(_0x58a0a7){_0x472198=_0x58a0a7;}return db[_0x4f42('0x30')][_0x4f42('0x4a')]({'where':{'id':_0x559cbd[_0x4f42('0x45')]['id']},'attributes':[_0x4f42('0x5d'),'loginLogo',_0x4f42('0x62'),'favicon','defaultLogo',_0x4f42('0x64'),_0x4f42('0x65'),'defaultFavicon'],'raw':!![]});})[_0x4f42('0x17')](handleEntityNotFound(_0x58562a,null))[_0x4f42('0x17')](function(_0x447b58){if(_0x447b58){var _0x4ce19a=_0x447b58['loginLogo']&&fs[_0x4f42('0x67')](path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0x29b2f7,_[_0x4f42('0x68')](_0x447b58[_0x4f42('0x5f')])))?path['join'](config[_0x4f42('0x4f')],_0x29b2f7,_['toLower'](_0x447b58['loginLogo'])):path['join'](config['root'],_0x29b2f7,_[_0x4f42('0x68')](_0x4f42('0x71')));var _0x5d2432=_0x4f42('0x6a')+_['upperFirst'](_0x4f42('0x5f'));if(_0x447b58[_0x5d2432]||!_0x472198['custom']){_0x4ce19a=path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0x29b2f7,_['toLower'](_0x4f42('0x71')));}if(!fs[_0x4f42('0x67')](_0x4ce19a)){throw new db[(_0x4f42('0x13'))]['ValidationError'](_['upperFirst'](_0x4f42('0x5f'))+_0x4f42('0x6d'));}return _0x58562a['download'](_0x4ce19a);}})['catch'](handleError(_0x58562a,null));};exports[_0x4f42('0x72')]=function(_0x3b55a5,_0x1e6a94){return db[_0x4f42('0x30')]['find']({'where':{'id':_0x3b55a5[_0x4f42('0x45')]['id']},'attributes':['securePassword']})[_0x4f42('0x17')](respondWithResult(_0x1e6a94,null))[_0x4f42('0x21')](handleError(_0x1e6a94,null));};exports['addPreferred']=function(_0x24ef5f,_0xfa42f5,_0x204792){if(_0x24ef5f[_0x4f42('0x5c')]&&_0x24ef5f['file']['filename']){_0x24ef5f['body'][_0x4f42('0x62')]=_0x24ef5f[_0x4f42('0x5c')][_0x4f42('0x5e')];}return db[_0x4f42('0x30')][_0x4f42('0x4a')]({'where':{'id':_0x24ef5f[_0x4f42('0x45')]['id']}})[_0x4f42('0x17')](handleEntityNotFound(_0xfa42f5,null))['then'](saveUpdates(_0x24ef5f[_0x4f42('0x4c')],null))[_0x4f42('0x17')](respondWithResult(_0xfa42f5,null))[_0x4f42('0x21')](handleError(_0xfa42f5,null));};var utilLicense=require(_0x4f42('0x60'));exports[_0x4f42('0x73')]=function(_0x5b5fbc,_0x357944,_0xae8bf4){var _0x28f49d=_0x4f42('0x70');var _0x3fcc27={'custom':![]};return utilLicense[_0x4f42('0x61')]()[_0x4f42('0x17')](function(_0xacf312){if(_0xacf312){_0x3fcc27=_0xacf312;}return db['Setting'][_0x4f42('0x4a')]({'where':{'id':_0x5b5fbc['params']['id']},'attributes':[_0x4f42('0x5d'),_0x4f42('0x5f'),_0x4f42('0x62'),_0x4f42('0x74'),'defaultLogo',_0x4f42('0x64'),_0x4f42('0x65'),_0x4f42('0x66')],'raw':!![]});})['then'](handleEntityNotFound(_0x357944,null))[_0x4f42('0x17')](function(_0x4f6cf8){if(_0x4f6cf8){var _0x37c147=_0x4f6cf8[_0x4f42('0x62')]&&fs[_0x4f42('0x67')](path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0x28f49d,_['toLower'](_0x4f6cf8[_0x4f42('0x62')])))?path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0x28f49d,_[_0x4f42('0x68')](_0x4f6cf8[_0x4f42('0x62')])):path['join'](config['root'],_0x28f49d,_[_0x4f42('0x68')](_0x4f42('0x75')));var _0x4570f2=_0x4f42('0x6a')+_[_0x4f42('0x6b')](_0x4f42('0x62'));if(_0x4f6cf8[_0x4570f2]||!_0x3fcc27['custom']||!_0x3fcc27[_0x4f42('0x62')]){_0x37c147=path['join'](config[_0x4f42('0x4f')],_0x28f49d,_[_0x4f42('0x68')]('default_preferred.png'));}if(!fs[_0x4f42('0x67')](_0x37c147)){throw new db['Sequelize'][(_0x4f42('0x14'))](_[_0x4f42('0x6b')]('preferred')+_0x4f42('0x6d'));}return _0x357944['download'](_0x37c147);}})[_0x4f42('0x21')](handleError(_0x357944,null));};exports[_0x4f42('0x76')]=function(_0x1e0022,_0x295a82,_0x4dbb36){if(_0x1e0022['file']&&_0x1e0022['file'][_0x4f42('0x5e')]){_0x1e0022[_0x4f42('0x4c')][_0x4f42('0x74')]=_0x1e0022['file'][_0x4f42('0x5e')];}return db[_0x4f42('0x30')][_0x4f42('0x4a')]({'where':{'id':_0x1e0022['params']['id']}})['then'](handleEntityNotFound(_0x295a82,null))[_0x4f42('0x17')](saveUpdates(_0x1e0022[_0x4f42('0x4c')],null))[_0x4f42('0x17')](respondWithResult(_0x295a82,null))['catch'](handleError(_0x295a82,null));};var utilLicense=require('../../config/license/util');exports[_0x4f42('0x77')]=function(_0x571afe,_0x3805ed,_0x24fa3c){var _0xc5dec9=_0x4f42('0x70');var _0x26ba59={'custom':![]};return utilLicense[_0x4f42('0x61')]()[_0x4f42('0x17')](function(_0x3c1d2e){if(_0x3c1d2e){_0x26ba59=_0x3c1d2e;}return db[_0x4f42('0x30')][_0x4f42('0x4a')]({'where':{'id':_0x571afe['params']['id']},'attributes':[_0x4f42('0x5d'),_0x4f42('0x5f'),_0x4f42('0x62'),_0x4f42('0x74'),_0x4f42('0x63'),'defaultLoginLogo',_0x4f42('0x65'),'defaultFavicon'],'raw':!![]});})[_0x4f42('0x17')](handleEntityNotFound(_0x3805ed,null))[_0x4f42('0x17')](function(_0x519b8d){if(_0x519b8d){var _0x22f40a=_0x519b8d[_0x4f42('0x74')]&&fs[_0x4f42('0x67')](path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0xc5dec9,_[_0x4f42('0x68')](_0x519b8d[_0x4f42('0x74')])))?path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0xc5dec9,_[_0x4f42('0x68')](_0x519b8d[_0x4f42('0x74')])):path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0xc5dec9,_[_0x4f42('0x68')](_0x4f42('0x78')));var _0x4b05bf=_0x4f42('0x6a')+_[_0x4f42('0x6b')]('favicon');if(_0x519b8d[_0x4b05bf]||!_0x26ba59[_0x4f42('0x6c')]){_0x22f40a=path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0xc5dec9,_['toLower']('default_favicon.ico'));}if(!fs['existsSync'](_0x22f40a)){throw new db[(_0x4f42('0x13'))][(_0x4f42('0x14'))](_[_0x4f42('0x6b')](_0x4f42('0x74'))+_0x4f42('0x6d'));}return _0x3805ed[_0x4f42('0x6e')](_0x22f40a);}})[_0x4f42('0x21')](handleError(_0x3805ed,null));};
\ No newline at end of file
+var _0x1930=['set','Content-Range','apply','reject','save','update','stack','name','index','map','Setting','rawAttributes','fieldName','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filters','filter','where','VIRTUAL','merge','options','include','rows','show','params','includeAll','body','find','filename','file','loginLogo','../../config/license/util','getLogo','getLicense','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','logo','existsSync','join','root','toLower','default_logo.png','default','upperFirst','\x20not\x20found','preferred','default_loginLogo.png','custom','Sequelize','ValidationError','gdpr','addPreferred','getPreferred','favicon','default_preferred.png','download','getFavicon','server/files/images/logos','default_favicon.ico','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset'];(function(_0x1df369,_0x548e39){var _0x3d4239=function(_0x4d4f4c){while(--_0x4d4f4c){_0x1df369['push'](_0x1df369['shift']());}};_0x3d4239(++_0x548e39);}(_0x1930,0x133));var _0x0193=function(_0x2b3d1f,_0x40c8b6){_0x2b3d1f=_0x2b3d1f-0x0;var _0x187469=_0x1930[_0x2b3d1f];return _0x187469;};'use strict';var pdf=require(_0x0193('0x0'));var emlformat=require(_0x0193('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0193('0x2'));var moment=require(_0x0193('0x3'));var BPromise=require(_0x0193('0x4'));var Mustache=require(_0x0193('0x5'));var util=require(_0x0193('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0193('0x7'));var fs=require('fs');var _=require(_0x0193('0x8'));var squel=require(_0x0193('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0193('0xa'));var toCsv=require(_0x0193('0xb'));var querystring=require(_0x0193('0xc'));var Papa=require(_0x0193('0xd'));var Redis=require(_0x0193('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0193('0xf'));var as=require(_0x0193('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0193('0x11'))(_0x0193('0x12'));var utils=require(_0x0193('0x13'));var config=require(_0x0193('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0x0193('0x15'));var client=jayson[_0x0193('0x16')][_0x0193('0x17')]({'port':0x232a});function checkPasswordPattern(_0x5dd674,_0x520df2,_0x5729d4){if(_0x5729d4){var _0x55abf2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x55abf2[_0x0193('0x18')](_0x520df2)){return _0x5dd674;}else{throw new db['Sequelize']['ValidationError'](_0x0193('0x19'));}}else{return _0x5dd674;}}function respondWithRpcPromise(_0x47fefb,_0x425199,_0x4e1e16,_0x186d8b){return new BPromise(function(_0xe8776a,_0x728f20){var _0x161588=_0x186d8b||client;return _0x161588['request'](_0x47fefb,_0x4e1e16)[_0x0193('0x1a')](function(_0x12bc7c){logger[_0x0193('0x1b')](_0x0193('0x1c'),_0x425199,_0x0193('0x1d'));logger[_0x0193('0x1e')](_0x0193('0x1f'),_0x425199,_0x0193('0x1d'),JSON[_0x0193('0x20')](_0x12bc7c));if(_0x12bc7c['error']){if(_0x12bc7c[_0x0193('0x21')][_0x0193('0x22')]===0x1f4){logger[_0x0193('0x21')](_0x0193('0x1c'),_0x425199,_0x12bc7c[_0x0193('0x21')]['message']);return _0x728f20(_0x12bc7c[_0x0193('0x21')][_0x0193('0x23')]);}logger[_0x0193('0x21')](_0x0193('0x1c'),_0x425199,_0x12bc7c['error']['message']);return _0xe8776a(_0x12bc7c[_0x0193('0x21')][_0x0193('0x23')]);}else{logger[_0x0193('0x1b')]('Setting,\x20%s,\x20%s',_0x425199,_0x0193('0x1d'));_0xe8776a(_0x12bc7c[_0x0193('0x24')][_0x0193('0x23')]);}})[_0x0193('0x25')](function(_0x4d895c){logger['error'](_0x0193('0x1c'),_0x425199,_0x4d895c);_0x728f20(_0x4d895c);});});}function respondWithStatusCode(_0xf30d4,_0x32a251){_0x32a251=_0x32a251||0xcc;return function(_0x2c77c3){if(_0x2c77c3){return _0xf30d4[_0x0193('0x26')](_0x32a251);}return _0xf30d4[_0x0193('0x27')](_0x32a251)[_0x0193('0x28')]();};}function respondWithResult(_0x177816,_0x1aca5b){_0x1aca5b=_0x1aca5b||0xc8;return function(_0x28ca18){if(_0x28ca18){return _0x177816[_0x0193('0x27')](_0x1aca5b)[_0x0193('0x29')](_0x28ca18);}};}function respondWithFilteredResult(_0x4c0d4e,_0x56a261){return function(_0x182d10){if(_0x182d10){var _0x5d7a17=_0x182d10[_0x0193('0x2a')],_0x4fa21a=_0x56a261[_0x0193('0x2b')],_0x11dd37=_0x56a261['offset']+_0x56a261['limit'],_0x32a1ce;if(_0x11dd37>=_0x5d7a17){_0x11dd37=_0x5d7a17;_0x32a1ce=0xc8;}else{_0x32a1ce=0xce;}_0x4c0d4e[_0x0193('0x27')](_0x32a1ce);return _0x4c0d4e[_0x0193('0x2c')](_0x0193('0x2d'),_0x4fa21a+'-'+_0x11dd37+'/'+_0x5d7a17)[_0x0193('0x29')](_0x182d10);}return null;};}function patchUpdates(_0x3489e3){return function(_0x15f5da){try{jsonpatch[_0x0193('0x2e')](_0x15f5da,_0x3489e3,!![]);}catch(_0x4d09cc){return BPromise[_0x0193('0x2f')](_0x4d09cc);}return _0x15f5da[_0x0193('0x30')]();};}function saveUpdates(_0x553c95,_0x1aa776){return function(_0x484030){if(_0x484030){return _0x484030[_0x0193('0x31')](_0x553c95)['then'](function(_0x154f8f){return _0x154f8f;});}return null;};}function removeEntity(_0xf61ed1,_0x3e3073){return function(_0x9b30ab){if(_0x9b30ab){return _0x9b30ab['destroy']()[_0x0193('0x1a')](function(){_0xf61ed1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4db4f4,_0x1076d7){return function(_0x438f06){if(!_0x438f06){_0x4db4f4[_0x0193('0x26')](0x194);}return _0x438f06;};}function handleError(_0x3b9a60,_0x4b1218){_0x4b1218=_0x4b1218||0x1f4;return function(_0x348f94){logger[_0x0193('0x21')](_0x348f94[_0x0193('0x32')]);if(_0x348f94['name']){delete _0x348f94[_0x0193('0x33')];}_0x3b9a60['status'](_0x4b1218)['send'](_0x348f94);};}exports[_0x0193('0x34')]=function(_0x1ab688,_0xf5ba7c){var _0x3a36e8={},_0x558a4a={},_0x240a4d={'count':0x0,'rows':[]};var _0x5407da=_[_0x0193('0x35')](db[_0x0193('0x36')][_0x0193('0x37')],function(_0x50364b){return{'name':_0x50364b[_0x0193('0x38')],'type':_0x50364b['type'][_0x0193('0x39')]};});_0x558a4a[_0x0193('0x3a')]=_[_0x0193('0x35')](_0x5407da,_0x0193('0x33'));_0x558a4a['query']=_[_0x0193('0x3b')](_0x1ab688[_0x0193('0x3c')]);_0x558a4a['filters']=_[_0x0193('0x3d')](_0x558a4a[_0x0193('0x3a')],_0x558a4a['query']);_0x3a36e8['attributes']=_[_0x0193('0x3d')](_0x558a4a['model'],qs[_0x0193('0x3e')](_0x1ab688['query'][_0x0193('0x3e')]));_0x3a36e8[_0x0193('0x3f')]=_0x3a36e8[_0x0193('0x3f')][_0x0193('0x40')]?_0x3a36e8[_0x0193('0x3f')]:_0x558a4a[_0x0193('0x3a')];if(!_0x1ab688[_0x0193('0x3c')][_0x0193('0x41')](_0x0193('0x42'))){_0x3a36e8['limit']=qs[_0x0193('0x43')](_0x1ab688[_0x0193('0x3c')][_0x0193('0x43')]);_0x3a36e8[_0x0193('0x2b')]=qs[_0x0193('0x2b')](_0x1ab688[_0x0193('0x3c')][_0x0193('0x2b')]);}_0x3a36e8[_0x0193('0x44')]=qs[_0x0193('0x45')](_0x1ab688[_0x0193('0x3c')][_0x0193('0x45')]);_0x3a36e8['where']=qs['filters'](_[_0x0193('0x46')](_0x1ab688[_0x0193('0x3c')],_0x558a4a[_0x0193('0x47')]),_0x5407da);if(_0x1ab688['query'][_0x0193('0x48')]){_0x3a36e8[_0x0193('0x49')]=_['merge'](_0x3a36e8['where'],{'$or':_[_0x0193('0x35')](_0x5407da,function(_0x51e7dd){if(_0x51e7dd['type']!==_0x0193('0x4a')){var _0x24df2f={};_0x24df2f[_0x51e7dd[_0x0193('0x33')]]={'$like':'%'+_0x1ab688[_0x0193('0x3c')]['filter']+'%'};return _0x24df2f;}})});}_0x3a36e8=_[_0x0193('0x4b')]({},_0x3a36e8,_0x1ab688[_0x0193('0x4c')]);var _0x369388={'where':_0x3a36e8['where']};return db[_0x0193('0x36')][_0x0193('0x2a')](_0x369388)['then'](function(_0x2350ce){_0x240a4d['count']=_0x2350ce;if(_0x1ab688[_0x0193('0x3c')]['includeAll']){_0x3a36e8[_0x0193('0x4d')]=[{'all':!![]}];}return db[_0x0193('0x36')]['findAll'](_0x3a36e8);})[_0x0193('0x1a')](function(_0x954990){_0x240a4d[_0x0193('0x4e')]=_0x954990;return _0x240a4d;})['then'](respondWithFilteredResult(_0xf5ba7c,_0x3a36e8))[_0x0193('0x25')](handleError(_0xf5ba7c,null));};exports[_0x0193('0x4f')]=function(_0x2f86d3,_0x41525a){var _0x574579={'raw':![],'where':{'id':_0x2f86d3[_0x0193('0x50')]['id']}},_0x481486={};_0x481486[_0x0193('0x3a')]=_[_0x0193('0x3b')](db[_0x0193('0x36')][_0x0193('0x37')]);_0x481486[_0x0193('0x3c')]=_[_0x0193('0x3b')](_0x2f86d3['query']);_0x481486[_0x0193('0x47')]=_[_0x0193('0x3d')](_0x481486['model'],_0x481486[_0x0193('0x3c')]);_0x574579[_0x0193('0x3f')]=_['intersection'](_0x481486['model'],qs['fields'](_0x2f86d3['query'][_0x0193('0x3e')]));_0x574579[_0x0193('0x3f')]=_0x574579[_0x0193('0x3f')][_0x0193('0x40')]?_0x574579[_0x0193('0x3f')]:_0x481486[_0x0193('0x3a')];if(_0x2f86d3[_0x0193('0x3c')][_0x0193('0x51')]){_0x574579['include']=[{'all':!![]}];}_0x574579=_[_0x0193('0x4b')]({},_0x574579,_0x2f86d3[_0x0193('0x4c')]);return db[_0x0193('0x36')]['find'](_0x574579)[_0x0193('0x1a')](handleEntityNotFound(_0x41525a,null))['then'](respondWithResult(_0x41525a,null))[_0x0193('0x25')](handleError(_0x41525a,null));};exports[_0x0193('0x31')]=function(_0x40d00e,_0x28d3bb){if(_0x40d00e[_0x0193('0x52')]['id']){delete _0x40d00e[_0x0193('0x52')]['id'];}return db['Setting'][_0x0193('0x53')]({'where':{'id':_0x40d00e[_0x0193('0x50')]['id']}})[_0x0193('0x1a')](handleEntityNotFound(_0x28d3bb,null))['then'](saveUpdates(_0x40d00e[_0x0193('0x52')],null))[_0x0193('0x1a')](respondWithResult(_0x28d3bb,null))['catch'](handleError(_0x28d3bb,null));};exports['addLogo']=function(_0x564ad9,_0x1cf364,_0x12f630){if(_0x564ad9['file']&&_0x564ad9['file'][_0x0193('0x54')]){_0x564ad9['body']['logo']=_0x564ad9[_0x0193('0x55')][_0x0193('0x54')];}return db[_0x0193('0x36')][_0x0193('0x53')]({'where':{'id':_0x564ad9[_0x0193('0x50')]['id']}})[_0x0193('0x1a')](handleEntityNotFound(_0x1cf364,null))['then'](saveUpdates(_0x564ad9[_0x0193('0x52')],null))[_0x0193('0x1a')](respondWithResult(_0x1cf364,null))[_0x0193('0x25')](handleError(_0x1cf364,null));};exports['addLogoLogin']=function(_0x28db46,_0x298107,_0x20ae37){if(_0x28db46['file']&&_0x28db46[_0x0193('0x55')][_0x0193('0x54')]){_0x28db46[_0x0193('0x52')][_0x0193('0x56')]=_0x28db46[_0x0193('0x55')][_0x0193('0x54')];}return db[_0x0193('0x36')][_0x0193('0x53')]({'where':{'id':_0x28db46[_0x0193('0x50')]['id']}})[_0x0193('0x1a')](handleEntityNotFound(_0x298107,null))['then'](saveUpdates(_0x28db46[_0x0193('0x52')],null))[_0x0193('0x1a')](respondWithResult(_0x298107,null))[_0x0193('0x25')](handleError(_0x298107,null));};var utilLicense=require(_0x0193('0x57'));exports[_0x0193('0x58')]=function(_0x41806a,_0x3de32d,_0x221537){var _0x972571='server/files/images/logos';var _0x2ab52d={'custom':![]};return utilLicense[_0x0193('0x59')]()[_0x0193('0x1a')](function(_0x519e42){if(_0x519e42){_0x2ab52d=_0x519e42;}return db[_0x0193('0x36')][_0x0193('0x53')]({'where':{'id':_0x41806a[_0x0193('0x50')]['id']},'attributes':['logo',_0x0193('0x56'),'preferred','favicon',_0x0193('0x5a'),_0x0193('0x5b'),_0x0193('0x5c'),_0x0193('0x5d')],'raw':!![]});})[_0x0193('0x1a')](handleEntityNotFound(_0x3de32d,null))[_0x0193('0x1a')](function(_0xbcb1c8){if(_0xbcb1c8){var _0x2d3026=_0xbcb1c8[_0x0193('0x5e')]&&fs[_0x0193('0x5f')](path[_0x0193('0x60')](config[_0x0193('0x61')],_0x972571,_[_0x0193('0x62')](_0xbcb1c8[_0x0193('0x5e')])))?path['join'](config['root'],_0x972571,_[_0x0193('0x62')](_0xbcb1c8[_0x0193('0x5e')])):path['join'](config[_0x0193('0x61')],_0x972571,_[_0x0193('0x62')](_0x0193('0x63')));var _0x15d021=_0x0193('0x64')+_[_0x0193('0x65')](_0x0193('0x5e'));if(_0xbcb1c8[_0x15d021]||!_0x2ab52d['custom']){_0x2d3026=path['join'](config[_0x0193('0x61')],_0x972571,_['toLower'](_0x0193('0x63')));}if(!fs[_0x0193('0x5f')](_0x2d3026)){throw new db['Sequelize']['ValidationError'](_['upperFirst'](_0x0193('0x5e'))+_0x0193('0x66'));}return _0x3de32d['download'](_0x2d3026);}})[_0x0193('0x25')](handleError(_0x3de32d,null));};var utilLicense=require(_0x0193('0x57'));exports['getLogoLogin']=function(_0x237c65,_0xc91613,_0x21353a){var _0x2eb88f='server/files/images/logos';var _0x79fce6={'custom':![]};return utilLicense['getLicense']()[_0x0193('0x1a')](function(_0xe861eb){if(_0xe861eb){_0x79fce6=_0xe861eb;}return db[_0x0193('0x36')][_0x0193('0x53')]({'where':{'id':_0x237c65[_0x0193('0x50')]['id']},'attributes':[_0x0193('0x5e'),_0x0193('0x56'),_0x0193('0x67'),'favicon',_0x0193('0x5a'),_0x0193('0x5b'),_0x0193('0x5c'),_0x0193('0x5d')],'raw':!![]});})[_0x0193('0x1a')](handleEntityNotFound(_0xc91613,null))[_0x0193('0x1a')](function(_0x57f203){if(_0x57f203){var _0x27d4e6=_0x57f203['loginLogo']&&fs[_0x0193('0x5f')](path['join'](config['root'],_0x2eb88f,_['toLower'](_0x57f203['loginLogo'])))?path['join'](config[_0x0193('0x61')],_0x2eb88f,_[_0x0193('0x62')](_0x57f203[_0x0193('0x56')])):path[_0x0193('0x60')](config[_0x0193('0x61')],_0x2eb88f,_['toLower'](_0x0193('0x68')));var _0x4b72a3=_0x0193('0x64')+_[_0x0193('0x65')](_0x0193('0x56'));if(_0x57f203[_0x4b72a3]||!_0x79fce6[_0x0193('0x69')]){_0x27d4e6=path[_0x0193('0x60')](config[_0x0193('0x61')],_0x2eb88f,_[_0x0193('0x62')](_0x0193('0x68')));}if(!fs[_0x0193('0x5f')](_0x27d4e6)){throw new db[(_0x0193('0x6a'))][(_0x0193('0x6b'))](_[_0x0193('0x65')]('loginLogo')+_0x0193('0x66'));}return _0xc91613['download'](_0x27d4e6);}})[_0x0193('0x25')](handleError(_0xc91613,null));};exports[_0x0193('0x6c')]=function(_0x3e5c33,_0x56901d){return db['Setting'][_0x0193('0x53')]({'where':{'id':_0x3e5c33[_0x0193('0x50')]['id']},'attributes':['securePassword']})[_0x0193('0x1a')](respondWithResult(_0x56901d,null))[_0x0193('0x25')](handleError(_0x56901d,null));};exports[_0x0193('0x6d')]=function(_0x47e7bb,_0x2509f5,_0x14efaa){if(_0x47e7bb[_0x0193('0x55')]&&_0x47e7bb[_0x0193('0x55')][_0x0193('0x54')]){_0x47e7bb[_0x0193('0x52')][_0x0193('0x67')]=_0x47e7bb[_0x0193('0x55')]['filename'];}return db[_0x0193('0x36')][_0x0193('0x53')]({'where':{'id':_0x47e7bb[_0x0193('0x50')]['id']}})['then'](handleEntityNotFound(_0x2509f5,null))['then'](saveUpdates(_0x47e7bb['body'],null))[_0x0193('0x1a')](respondWithResult(_0x2509f5,null))[_0x0193('0x25')](handleError(_0x2509f5,null));};var utilLicense=require('../../config/license/util');exports[_0x0193('0x6e')]=function(_0x3758c7,_0x415aa3,_0x5c7228){var _0x24efab='server/files/images/logos';var _0x402e76={'custom':![]};return utilLicense[_0x0193('0x59')]()[_0x0193('0x1a')](function(_0x495870){if(_0x495870){_0x402e76=_0x495870;}return db['Setting'][_0x0193('0x53')]({'where':{'id':_0x3758c7[_0x0193('0x50')]['id']},'attributes':[_0x0193('0x5e'),_0x0193('0x56'),_0x0193('0x67'),_0x0193('0x6f'),_0x0193('0x5a'),_0x0193('0x5b'),'defaultPreferred',_0x0193('0x5d')],'raw':!![]});})[_0x0193('0x1a')](handleEntityNotFound(_0x415aa3,null))[_0x0193('0x1a')](function(_0x299a84){if(_0x299a84){var _0xe8a254=_0x299a84[_0x0193('0x67')]&&fs[_0x0193('0x5f')](path[_0x0193('0x60')](config[_0x0193('0x61')],_0x24efab,_[_0x0193('0x62')](_0x299a84['preferred'])))?path[_0x0193('0x60')](config['root'],_0x24efab,_[_0x0193('0x62')](_0x299a84[_0x0193('0x67')])):path[_0x0193('0x60')](config[_0x0193('0x61')],_0x24efab,_[_0x0193('0x62')]('default_preferred.png'));var _0x3da01a=_0x0193('0x64')+_[_0x0193('0x65')](_0x0193('0x67'));if(_0x299a84[_0x3da01a]||!_0x402e76[_0x0193('0x69')]||!_0x402e76[_0x0193('0x67')]){_0xe8a254=path['join'](config[_0x0193('0x61')],_0x24efab,_['toLower'](_0x0193('0x70')));}if(!fs[_0x0193('0x5f')](_0xe8a254)){throw new db[(_0x0193('0x6a'))]['ValidationError'](_[_0x0193('0x65')](_0x0193('0x67'))+_0x0193('0x66'));}return _0x415aa3[_0x0193('0x71')](_0xe8a254);}})[_0x0193('0x25')](handleError(_0x415aa3,null));};exports['addFavicon']=function(_0xf0e74,_0x387634,_0x2bb84c){if(_0xf0e74[_0x0193('0x55')]&&_0xf0e74[_0x0193('0x55')]['filename']){_0xf0e74[_0x0193('0x52')]['favicon']=_0xf0e74[_0x0193('0x55')][_0x0193('0x54')];}return db['Setting'][_0x0193('0x53')]({'where':{'id':_0xf0e74[_0x0193('0x50')]['id']}})[_0x0193('0x1a')](handleEntityNotFound(_0x387634,null))[_0x0193('0x1a')](saveUpdates(_0xf0e74[_0x0193('0x52')],null))['then'](respondWithResult(_0x387634,null))[_0x0193('0x25')](handleError(_0x387634,null));};var utilLicense=require('../../config/license/util');exports[_0x0193('0x72')]=function(_0x347290,_0x3de641,_0x1fde56){var _0xdc0fa0=_0x0193('0x73');var _0x56b5fb={'custom':![]};return utilLicense['getLicense']()[_0x0193('0x1a')](function(_0xb5875d){if(_0xb5875d){_0x56b5fb=_0xb5875d;}return db['Setting']['find']({'where':{'id':_0x347290[_0x0193('0x50')]['id']},'attributes':[_0x0193('0x5e'),'loginLogo',_0x0193('0x67'),'favicon','defaultLogo',_0x0193('0x5b'),'defaultPreferred',_0x0193('0x5d')],'raw':!![]});})[_0x0193('0x1a')](handleEntityNotFound(_0x3de641,null))['then'](function(_0x5da18a){if(_0x5da18a){var _0x4a1b5c=_0x5da18a[_0x0193('0x6f')]&&fs[_0x0193('0x5f')](path['join'](config[_0x0193('0x61')],_0xdc0fa0,_[_0x0193('0x62')](_0x5da18a['favicon'])))?path[_0x0193('0x60')](config[_0x0193('0x61')],_0xdc0fa0,_['toLower'](_0x5da18a[_0x0193('0x6f')])):path[_0x0193('0x60')](config['root'],_0xdc0fa0,_[_0x0193('0x62')](_0x0193('0x74')));var _0x34b1fc=_0x0193('0x64')+_[_0x0193('0x65')](_0x0193('0x6f'));if(_0x5da18a[_0x34b1fc]||!_0x56b5fb[_0x0193('0x69')]){_0x4a1b5c=path[_0x0193('0x60')](config['root'],_0xdc0fa0,_[_0x0193('0x62')](_0x0193('0x74')));}if(!fs[_0x0193('0x5f')](_0x4a1b5c)){throw new db['Sequelize'][(_0x0193('0x6b'))](_[_0x0193('0x65')](_0x0193('0x6f'))+_0x0193('0x66'));}return _0x3de641[_0x0193('0x71')](_0x4a1b5c);}})['catch'](handleError(_0x3de641,null));};
\ No newline at end of file