Built motion from commit d1eab355.|2.6.28
[motion2.git] / server / api / setting / setting.controller.js
index 520712d..518c8f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79fb=['util','ejs','lodash','squel','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','offset','set','Content-Range','apply','reject','save','destroy','sendStatus','stack','name','send','index','map','Setting','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','update','body','addLogo','file','logo','find','addLogoLogin','loginLogo','filename','getLogo','getLicense','preferred','favicon','defaultLogo','defaultPreferred','existsSync','join','toLower','root','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','download','server/files/images/logos','defaultLoginLogo','defaultFavicon','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','default_favicon.ico','getDate','utcOffset','now','format','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x2451ae,_0x2ff3a4){var _0x5d6db9=function(_0x1b0200){while(--_0x1b0200){_0x2451ae['push'](_0x2451ae['shift']());}};_0x5d6db9(++_0x2ff3a4);}(_0x79fb,0x78));var _0xb79f=function(_0x384aee,_0x3e54ec){_0x384aee=_0x384aee-0x0;var _0x21c109=_0x79fb[_0x384aee];return _0x21c109;};'use strict';var pdf=require(_0xb79f('0x0'));var emlformat=require(_0xb79f('0x1'));var rimraf=require(_0xb79f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb79f('0x3'));var rp=require(_0xb79f('0x4'));var moment=require(_0xb79f('0x5'));var BPromise=require(_0xb79f('0x6'));var Mustache=require(_0xb79f('0x7'));var util=require(_0xb79f('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb79f('0x9'));var fs=require('fs');var _=require(_0xb79f('0xa'));var squel=require(_0xb79f('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb79f('0xc'));var toCsv=require(_0xb79f('0xd'));var querystring=require('querystring');var Papa=require(_0xb79f('0xe'));var Redis=require('ioredis');var authService=require(_0xb79f('0xf'));var qs=require(_0xb79f('0x10'));var as=require(_0xb79f('0x11'));var hardwareService=require(_0xb79f('0x12'));var logger=require(_0xb79f('0x13'))(_0xb79f('0x14'));var utils=require(_0xb79f('0x15'));var config=require(_0xb79f('0x16'));var licenseUtil=require(_0xb79f('0x17'));var db=require(_0xb79f('0x18'))['db'];var jayson=require(_0xb79f('0x19'));var client=jayson['client'][_0xb79f('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x326c52,_0x4dab2a,_0x218629,_0x33bf6d){return new BPromise(function(_0xb8c8d5,_0x1b1b24){var _0x421552=_0x33bf6d||client;return _0x421552[_0xb79f('0x1b')](_0x326c52,_0x218629)[_0xb79f('0x1c')](function(_0x498e6b){logger['info'](_0xb79f('0x1d'),_0x4dab2a,_0xb79f('0x1e'));logger[_0xb79f('0x1f')](_0xb79f('0x20'),_0x4dab2a,_0xb79f('0x1e'),JSON[_0xb79f('0x21')](_0x498e6b));if(_0x498e6b[_0xb79f('0x22')]){if(_0x498e6b[_0xb79f('0x22')][_0xb79f('0x23')]===0x1f4){logger[_0xb79f('0x22')](_0xb79f('0x1d'),_0x4dab2a,_0x498e6b[_0xb79f('0x22')][_0xb79f('0x24')]);return _0x1b1b24(_0x498e6b[_0xb79f('0x22')][_0xb79f('0x24')]);}logger[_0xb79f('0x22')](_0xb79f('0x1d'),_0x4dab2a,_0x498e6b[_0xb79f('0x22')][_0xb79f('0x24')]);return _0xb8c8d5(_0x498e6b[_0xb79f('0x22')]['message']);}else{logger['info'](_0xb79f('0x1d'),_0x4dab2a,_0xb79f('0x1e'));_0xb8c8d5(_0x498e6b[_0xb79f('0x25')][_0xb79f('0x24')]);}})['catch'](function(_0x12f5d0){logger[_0xb79f('0x22')](_0xb79f('0x1d'),_0x4dab2a,_0x12f5d0);_0x1b1b24(_0x12f5d0);});});}function respondWithStatusCode(_0x3ff4e0,_0x24d486){_0x24d486=_0x24d486||0xcc;return function(_0x23f69b){if(_0x23f69b){return _0x3ff4e0['sendStatus'](_0x24d486);}return _0x3ff4e0[_0xb79f('0x26')](_0x24d486)[_0xb79f('0x27')]();};}function respondWithResult(_0x149872,_0x3e7be9){_0x3e7be9=_0x3e7be9||0xc8;return function(_0x3d5f4d){if(_0x3d5f4d){return _0x149872[_0xb79f('0x26')](_0x3e7be9)[_0xb79f('0x28')](_0x3d5f4d);}};}function respondWithFilteredResult(_0xd54b29,_0x465a2f){return function(_0x2cdc36){if(_0x2cdc36){var _0x1fbe14=_0x2cdc36['count'],_0x2090ef=_0x465a2f[_0xb79f('0x29')],_0x24e8bd=_0x465a2f['offset']+_0x465a2f['limit'],_0x3d2353;if(_0x24e8bd>=_0x1fbe14){_0x24e8bd=_0x1fbe14;_0x3d2353=0xc8;}else{_0x3d2353=0xce;}_0xd54b29['status'](_0x3d2353);return _0xd54b29[_0xb79f('0x2a')](_0xb79f('0x2b'),_0x2090ef+'-'+_0x24e8bd+'/'+_0x1fbe14)[_0xb79f('0x28')](_0x2cdc36);}return null;};}function patchUpdates(_0x168fe3){return function(_0x490983){try{jsonpatch[_0xb79f('0x2c')](_0x490983,_0x168fe3,!![]);}catch(_0x4ef3f3){return BPromise[_0xb79f('0x2d')](_0x4ef3f3);}return _0x490983[_0xb79f('0x2e')]();};}function saveUpdates(_0x5e324e,_0x3a8eac){return function(_0x203c3b){if(_0x203c3b){return _0x203c3b['update'](_0x5e324e)['then'](function(_0x272ffa){return _0x272ffa;});}return null;};}function removeEntity(_0xf32a0a,_0xd0246b){return function(_0xbbbb1e){if(_0xbbbb1e){return _0xbbbb1e[_0xb79f('0x2f')]()[_0xb79f('0x1c')](function(){_0xf32a0a[_0xb79f('0x26')](0xcc)[_0xb79f('0x27')]();});}};}function handleEntityNotFound(_0x238538,_0x594bd0){return function(_0x2f0337){if(!_0x2f0337){_0x238538[_0xb79f('0x30')](0x194);}return _0x2f0337;};}function handleError(_0x100ad4,_0x1a468f){_0x1a468f=_0x1a468f||0x1f4;return function(_0x4e6d7a){logger['error'](_0x4e6d7a[_0xb79f('0x31')]);if(_0x4e6d7a['name']){delete _0x4e6d7a[_0xb79f('0x32')];}_0x100ad4[_0xb79f('0x26')](_0x1a468f)[_0xb79f('0x33')](_0x4e6d7a);};}exports[_0xb79f('0x34')]=function(_0x5e031c,_0x120866){var _0x26d0cd={},_0x332f53={},_0x59f68c={'count':0x0,'rows':[]};var _0x147d34=_[_0xb79f('0x35')](db[_0xb79f('0x36')]['rawAttributes'],function(_0x2f195b){return{'name':_0x2f195b[_0xb79f('0x37')],'type':_0x2f195b['type'][_0xb79f('0x38')]};});_0x332f53['model']=_['map'](_0x147d34,_0xb79f('0x32'));_0x332f53['query']=_[_0xb79f('0x39')](_0x5e031c[_0xb79f('0x3a')]);_0x332f53[_0xb79f('0x3b')]=_[_0xb79f('0x3c')](_0x332f53[_0xb79f('0x3d')],_0x332f53[_0xb79f('0x3a')]);_0x26d0cd[_0xb79f('0x3e')]=_['intersection'](_0x332f53[_0xb79f('0x3d')],qs[_0xb79f('0x3f')](_0x5e031c[_0xb79f('0x3a')][_0xb79f('0x3f')]));_0x26d0cd['attributes']=_0x26d0cd['attributes'][_0xb79f('0x40')]?_0x26d0cd[_0xb79f('0x3e')]:_0x332f53[_0xb79f('0x3d')];if(!_0x5e031c['query'][_0xb79f('0x41')](_0xb79f('0x42'))){_0x26d0cd['limit']=qs[_0xb79f('0x43')](_0x5e031c['query']['limit']);_0x26d0cd[_0xb79f('0x29')]=qs[_0xb79f('0x29')](_0x5e031c['query'][_0xb79f('0x29')]);}_0x26d0cd[_0xb79f('0x44')]=qs['sort'](_0x5e031c['query'][_0xb79f('0x45')]);_0x26d0cd[_0xb79f('0x46')]=qs[_0xb79f('0x3b')](_[_0xb79f('0x47')](_0x5e031c[_0xb79f('0x3a')],_0x332f53['filters']),_0x147d34);if(_0x5e031c[_0xb79f('0x3a')][_0xb79f('0x48')]){_0x26d0cd[_0xb79f('0x46')]=_[_0xb79f('0x49')](_0x26d0cd[_0xb79f('0x46')],{'$or':_[_0xb79f('0x35')](_0x147d34,function(_0x2109e6){if(_0x2109e6[_0xb79f('0x4a')]!==_0xb79f('0x4b')){var _0x5ee304={};_0x5ee304[_0x2109e6[_0xb79f('0x32')]]={'$like':'%'+_0x5e031c['query'][_0xb79f('0x48')]+'%'};return _0x5ee304;}})});}_0x26d0cd=_['merge']({},_0x26d0cd,_0x5e031c[_0xb79f('0x4c')]);var _0x3c9809={'where':_0x26d0cd[_0xb79f('0x46')]};return db['Setting'][_0xb79f('0x4d')](_0x3c9809)[_0xb79f('0x1c')](function(_0x3fe1b3){_0x59f68c[_0xb79f('0x4d')]=_0x3fe1b3;if(_0x5e031c[_0xb79f('0x3a')][_0xb79f('0x4e')]){_0x26d0cd[_0xb79f('0x4f')]=[{'all':!![]}];}return db['Setting'][_0xb79f('0x50')](_0x26d0cd);})[_0xb79f('0x1c')](function(_0x1b6f71){_0x59f68c[_0xb79f('0x51')]=_0x1b6f71;return _0x59f68c;})[_0xb79f('0x1c')](respondWithFilteredResult(_0x120866,_0x26d0cd))[_0xb79f('0x52')](handleError(_0x120866,null));};exports[_0xb79f('0x53')]=function(_0x52252d,_0xaadcf8){var _0x401cad={'raw':![],'where':{'id':_0x52252d[_0xb79f('0x54')]['id']}},_0x577fc7={};_0x577fc7[_0xb79f('0x3d')]=_[_0xb79f('0x39')](db['Setting'][_0xb79f('0x55')]);_0x577fc7[_0xb79f('0x3a')]=_['keys'](_0x52252d['query']);_0x577fc7[_0xb79f('0x3b')]=_[_0xb79f('0x3c')](_0x577fc7['model'],_0x577fc7[_0xb79f('0x3a')]);_0x401cad[_0xb79f('0x3e')]=_[_0xb79f('0x3c')](_0x577fc7[_0xb79f('0x3d')],qs['fields'](_0x52252d['query'][_0xb79f('0x3f')]));_0x401cad['attributes']=_0x401cad['attributes'][_0xb79f('0x40')]?_0x401cad[_0xb79f('0x3e')]:_0x577fc7[_0xb79f('0x3d')];if(_0x52252d[_0xb79f('0x3a')][_0xb79f('0x4e')]){_0x401cad[_0xb79f('0x4f')]=[{'all':!![]}];}_0x401cad=_[_0xb79f('0x49')]({},_0x401cad,_0x52252d['options']);return db[_0xb79f('0x36')]['find'](_0x401cad)['then'](handleEntityNotFound(_0xaadcf8,null))['then'](respondWithResult(_0xaadcf8,null))[_0xb79f('0x52')](handleError(_0xaadcf8,null));};exports[_0xb79f('0x56')]=function(_0x207d8b,_0xc1a548){if(_0x207d8b['body']['id']){delete _0x207d8b[_0xb79f('0x57')]['id'];}return db[_0xb79f('0x36')]['find']({'where':{'id':_0x207d8b[_0xb79f('0x54')]['id']}})[_0xb79f('0x1c')](handleEntityNotFound(_0xc1a548,null))[_0xb79f('0x1c')](saveUpdates(_0x207d8b['body'],null))[_0xb79f('0x1c')](respondWithResult(_0xc1a548,null))['catch'](handleError(_0xc1a548,null));};exports[_0xb79f('0x58')]=function(_0x56c2b2,_0x521765,_0x139d71){if(_0x56c2b2[_0xb79f('0x59')]&&_0x56c2b2['file']['filename']){_0x56c2b2[_0xb79f('0x57')][_0xb79f('0x5a')]=_0x56c2b2[_0xb79f('0x59')]['filename'];}return db[_0xb79f('0x36')][_0xb79f('0x5b')]({'where':{'id':_0x56c2b2[_0xb79f('0x54')]['id']}})['then'](handleEntityNotFound(_0x521765,null))['then'](saveUpdates(_0x56c2b2[_0xb79f('0x57')],null))[_0xb79f('0x1c')](respondWithResult(_0x521765,null))[_0xb79f('0x52')](handleError(_0x521765,null));};exports[_0xb79f('0x5c')]=function(_0x3e0783,_0x15fb10,_0x824c47){if(_0x3e0783[_0xb79f('0x59')]&&_0x3e0783[_0xb79f('0x59')]['filename']){_0x3e0783[_0xb79f('0x57')][_0xb79f('0x5d')]=_0x3e0783['file'][_0xb79f('0x5e')];}return db['Setting'][_0xb79f('0x5b')]({'where':{'id':_0x3e0783['params']['id']}})[_0xb79f('0x1c')](handleEntityNotFound(_0x15fb10,null))[_0xb79f('0x1c')](saveUpdates(_0x3e0783[_0xb79f('0x57')],null))['then'](respondWithResult(_0x15fb10,null))['catch'](handleError(_0x15fb10,null));};var utilLicense=require('../../config/license/util');exports[_0xb79f('0x5f')]=function(_0x58bb6c,_0xf6f759,_0x1e9077){var _0x471490='server/files/images/logos';var _0x1a23b8={'custom':![]};return utilLicense[_0xb79f('0x60')]()[_0xb79f('0x1c')](function(_0x698b98){if(_0x698b98){_0x1a23b8=_0x698b98;}return db['Setting'][_0xb79f('0x5b')]({'where':{'id':_0x58bb6c[_0xb79f('0x54')]['id']},'attributes':[_0xb79f('0x5a'),_0xb79f('0x5d'),_0xb79f('0x61'),_0xb79f('0x62'),_0xb79f('0x63'),'defaultLoginLogo',_0xb79f('0x64'),'defaultFavicon'],'raw':!![]});})[_0xb79f('0x1c')](handleEntityNotFound(_0xf6f759,null))['then'](function(_0x584373){if(_0x584373){var _0x40663b=_0x584373[_0xb79f('0x5a')]&&fs[_0xb79f('0x65')](path[_0xb79f('0x66')](config['root'],_0x471490,_[_0xb79f('0x67')](_0x584373[_0xb79f('0x5a')])))?path[_0xb79f('0x66')](config['root'],_0x471490,_[_0xb79f('0x67')](_0x584373[_0xb79f('0x5a')])):path[_0xb79f('0x66')](config[_0xb79f('0x68')],_0x471490,_['toLower'](_0xb79f('0x69')));var _0x280076=_0xb79f('0x6a')+_[_0xb79f('0x6b')](_0xb79f('0x5a'));if(_0x584373[_0x280076]||!_0x1a23b8[_0xb79f('0x6c')]){_0x40663b=path[_0xb79f('0x66')](config[_0xb79f('0x68')],_0x471490,_[_0xb79f('0x67')](_0xb79f('0x69')));}if(!fs['existsSync'](_0x40663b)){throw new db[(_0xb79f('0x6d'))][(_0xb79f('0x6e'))](_[_0xb79f('0x6b')](_0xb79f('0x5a'))+_0xb79f('0x6f'));}return _0xf6f759[_0xb79f('0x70')](_0x40663b);}})[_0xb79f('0x52')](handleError(_0xf6f759,null));};var utilLicense=require('../../config/license/util');exports['getLogoLogin']=function(_0x3e1bae,_0x23dd8c,_0x501153){var _0x2f99ba=_0xb79f('0x71');var _0x2aba66={'custom':![]};return utilLicense[_0xb79f('0x60')]()[_0xb79f('0x1c')](function(_0x3e512e){if(_0x3e512e){_0x2aba66=_0x3e512e;}return db[_0xb79f('0x36')][_0xb79f('0x5b')]({'where':{'id':_0x3e1bae[_0xb79f('0x54')]['id']},'attributes':[_0xb79f('0x5a'),_0xb79f('0x5d'),'preferred','favicon',_0xb79f('0x63'),_0xb79f('0x72'),_0xb79f('0x64'),_0xb79f('0x73')],'raw':!![]});})[_0xb79f('0x1c')](handleEntityNotFound(_0x23dd8c,null))[_0xb79f('0x1c')](function(_0x481f93){if(_0x481f93){var _0x8aed8d=_0x481f93['loginLogo']&&fs[_0xb79f('0x65')](path[_0xb79f('0x66')](config['root'],_0x2f99ba,_['toLower'](_0x481f93['loginLogo'])))?path[_0xb79f('0x66')](config[_0xb79f('0x68')],_0x2f99ba,_['toLower'](_0x481f93['loginLogo'])):path['join'](config[_0xb79f('0x68')],_0x2f99ba,_['toLower'](_0xb79f('0x74')));var _0xfdf16f=_0xb79f('0x6a')+_[_0xb79f('0x6b')]('loginLogo');if(_0x481f93[_0xfdf16f]||!_0x2aba66[_0xb79f('0x6c')]){_0x8aed8d=path[_0xb79f('0x66')](config[_0xb79f('0x68')],_0x2f99ba,_['toLower'](_0xb79f('0x74')));}if(!fs[_0xb79f('0x65')](_0x8aed8d)){throw new db[(_0xb79f('0x6d'))][(_0xb79f('0x6e'))](_[_0xb79f('0x6b')](_0xb79f('0x5d'))+_0xb79f('0x6f'));}return _0x23dd8c[_0xb79f('0x70')](_0x8aed8d);}})[_0xb79f('0x52')](handleError(_0x23dd8c,null));};exports[_0xb79f('0x75')]=function(_0x18229a,_0x1e1c46){return db[_0xb79f('0x36')][_0xb79f('0x5b')]({'where':{'id':_0x18229a[_0xb79f('0x54')]['id']},'attributes':[_0xb79f('0x76')]})[_0xb79f('0x1c')](respondWithResult(_0x1e1c46,null))[_0xb79f('0x52')](handleError(_0x1e1c46,null));};exports[_0xb79f('0x77')]=function(_0x1b24bc,_0xc152b1,_0x435928){if(_0x1b24bc[_0xb79f('0x59')]&&_0x1b24bc[_0xb79f('0x59')]['filename']){_0x1b24bc['body'][_0xb79f('0x61')]=_0x1b24bc[_0xb79f('0x59')]['filename'];}return db[_0xb79f('0x36')]['find']({'where':{'id':_0x1b24bc[_0xb79f('0x54')]['id']}})[_0xb79f('0x1c')](handleEntityNotFound(_0xc152b1,null))[_0xb79f('0x1c')](saveUpdates(_0x1b24bc[_0xb79f('0x57')],null))[_0xb79f('0x1c')](respondWithResult(_0xc152b1,null))['catch'](handleError(_0xc152b1,null));};var utilLicense=require('../../config/license/util');exports[_0xb79f('0x78')]=function(_0x31e15a,_0x5a1a6f,_0x3ee289){var _0x3003cd='server/files/images/logos';var _0x159a9c={'custom':![]};return utilLicense[_0xb79f('0x60')]()[_0xb79f('0x1c')](function(_0x1538c1){if(_0x1538c1){_0x159a9c=_0x1538c1;}return db[_0xb79f('0x36')][_0xb79f('0x5b')]({'where':{'id':_0x31e15a['params']['id']},'attributes':['logo',_0xb79f('0x5d'),_0xb79f('0x61'),_0xb79f('0x62'),_0xb79f('0x63'),_0xb79f('0x72'),_0xb79f('0x64'),_0xb79f('0x73')],'raw':!![]});})[_0xb79f('0x1c')](handleEntityNotFound(_0x5a1a6f,null))[_0xb79f('0x1c')](function(_0x30edf6){if(_0x30edf6){var _0x606ef5=_0x30edf6[_0xb79f('0x61')]&&fs[_0xb79f('0x65')](path[_0xb79f('0x66')](config[_0xb79f('0x68')],_0x3003cd,_[_0xb79f('0x67')](_0x30edf6[_0xb79f('0x61')])))?path[_0xb79f('0x66')](config[_0xb79f('0x68')],_0x3003cd,_['toLower'](_0x30edf6[_0xb79f('0x61')])):path[_0xb79f('0x66')](config['root'],_0x3003cd,_[_0xb79f('0x67')](_0xb79f('0x79')));var _0x4b9f72=_0xb79f('0x6a')+_['upperFirst'](_0xb79f('0x61'));if(_0x30edf6[_0x4b9f72]||!_0x159a9c[_0xb79f('0x6c')]||!_0x159a9c['preferred']){_0x606ef5=path[_0xb79f('0x66')](config[_0xb79f('0x68')],_0x3003cd,_[_0xb79f('0x67')]('default_preferred.png'));}if(!fs['existsSync'](_0x606ef5)){throw new db['Sequelize']['ValidationError'](_[_0xb79f('0x6b')](_0xb79f('0x61'))+_0xb79f('0x6f'));}return _0x5a1a6f[_0xb79f('0x70')](_0x606ef5);}})[_0xb79f('0x52')](handleError(_0x5a1a6f,null));};exports[_0xb79f('0x7a')]=function(_0x4a32e5,_0x589094,_0x1d29aa){if(_0x4a32e5[_0xb79f('0x59')]&&_0x4a32e5[_0xb79f('0x59')][_0xb79f('0x5e')]){_0x4a32e5['body'][_0xb79f('0x62')]=_0x4a32e5['file'][_0xb79f('0x5e')];}return db[_0xb79f('0x36')]['find']({'where':{'id':_0x4a32e5[_0xb79f('0x54')]['id']}})[_0xb79f('0x1c')](handleEntityNotFound(_0x589094,null))[_0xb79f('0x1c')](saveUpdates(_0x4a32e5[_0xb79f('0x57')],null))[_0xb79f('0x1c')](respondWithResult(_0x589094,null))['catch'](handleError(_0x589094,null));};var utilLicense=require(_0xb79f('0x17'));exports['getFavicon']=function(_0x33879c,_0x49f160,_0x161d78){var _0x424269=_0xb79f('0x71');var _0x51a506={'custom':![]};return utilLicense[_0xb79f('0x60')]()[_0xb79f('0x1c')](function(_0x3bc6a4){if(_0x3bc6a4){_0x51a506=_0x3bc6a4;}return db[_0xb79f('0x36')][_0xb79f('0x5b')]({'where':{'id':_0x33879c[_0xb79f('0x54')]['id']},'attributes':[_0xb79f('0x5a'),_0xb79f('0x5d'),_0xb79f('0x61'),_0xb79f('0x62'),_0xb79f('0x63'),_0xb79f('0x72'),'defaultPreferred',_0xb79f('0x73')],'raw':!![]});})[_0xb79f('0x1c')](handleEntityNotFound(_0x49f160,null))[_0xb79f('0x1c')](function(_0x1cd5c1){if(_0x1cd5c1){var _0x4bcf63=_0x1cd5c1[_0xb79f('0x62')]&&fs[_0xb79f('0x65')](path[_0xb79f('0x66')](config[_0xb79f('0x68')],_0x424269,_['toLower'](_0x1cd5c1[_0xb79f('0x62')])))?path[_0xb79f('0x66')](config[_0xb79f('0x68')],_0x424269,_[_0xb79f('0x67')](_0x1cd5c1['favicon'])):path['join'](config['root'],_0x424269,_[_0xb79f('0x67')](_0xb79f('0x7b')));var _0x429a15='default'+_[_0xb79f('0x6b')](_0xb79f('0x62'));if(_0x1cd5c1[_0x429a15]||!_0x51a506[_0xb79f('0x6c')]){_0x4bcf63=path[_0xb79f('0x66')](config['root'],_0x424269,_[_0xb79f('0x67')](_0xb79f('0x7b')));}if(!fs[_0xb79f('0x65')](_0x4bcf63)){throw new db[(_0xb79f('0x6d'))][(_0xb79f('0x6e'))](_[_0xb79f('0x6b')](_0xb79f('0x62'))+_0xb79f('0x6f'));}return _0x49f160['download'](_0x4bcf63);}})[_0xb79f('0x52')](handleError(_0x49f160,null));};exports[_0xb79f('0x7c')]=function(_0xc67b40,_0x4d6948){var _0x2c0538={'offset':moment()[_0xb79f('0x7d')]()};_0x2c0538[_0xb79f('0x7e')]=moment()['utcOffset'](_0x2c0538[_0xb79f('0x29')])[_0xb79f('0x7f')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x4d6948['status'](0xc8)[_0xb79f('0x33')](_0x2c0538);};
\ No newline at end of file
+var _0xfa4b=['favicon','default_loginLogo.svg','securePassword','getPreferred','defaultFavicon','default_preferred.png','default','getFavicon','default_favicon.ico','ValidationError','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','stack','name','index','map','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','order','sort','where','pick','VIRTUAL','filter','merge','Setting','includeAll','include','findAll','rows','catch','show','fields','length','options','find','params','body','addLogo','file','filename','loginLogo','getLogo','getLicense','logo','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','join','root','toLower','default_logo.svg','upperFirst','custom','Sequelize','\x20not\x20found','download','getLogoLogin','server/files/images/logos','preferred'];(function(_0xf7724,_0x192e75){var _0x3383bf=function(_0x2ca8ab){while(--_0x2ca8ab){_0xf7724['push'](_0xf7724['shift']());}};_0x3383bf(++_0x192e75);}(_0xfa4b,0x175));var _0xbfa4=function(_0x4fad99,_0x4e2702){_0x4fad99=_0x4fad99-0x0;var _0x3cdd35=_0xfa4b[_0x4fad99];return _0x3cdd35;};'use strict';var emlformat=require(_0xbfa4('0x0'));var rimraf=require(_0xbfa4('0x1'));var zipdir=require(_0xbfa4('0x2'));var jsonpatch=require(_0xbfa4('0x3'));var rp=require(_0xbfa4('0x4'));var moment=require(_0xbfa4('0x5'));var BPromise=require(_0xbfa4('0x6'));var Mustache=require(_0xbfa4('0x7'));var util=require('util');var path=require(_0xbfa4('0x8'));var sox=require('sox');var csv=require(_0xbfa4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbfa4('0xa'));var _=require(_0xbfa4('0xb'));var squel=require(_0xbfa4('0xc'));var crypto=require(_0xbfa4('0xd'));var jsforce=require(_0xbfa4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbfa4('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbfa4('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbfa4('0x10'));var logger=require(_0xbfa4('0x11'))(_0xbfa4('0x12'));var utils=require('../../config/utils');var config=require(_0xbfa4('0x13'));var licenseUtil=require(_0xbfa4('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0xbfa4('0x15'));var client=jayson['client'][_0xbfa4('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x39b86e,_0x4bc4e5,_0x166ab9,_0x271f54){return new BPromise(function(_0x318138,_0xd76956){var _0x39b017=_0x271f54||client;return _0x39b017[_0xbfa4('0x17')](_0x39b86e,_0x166ab9)[_0xbfa4('0x18')](function(_0x10c1a4){logger[_0xbfa4('0x19')](_0xbfa4('0x1a'),_0x4bc4e5,_0xbfa4('0x1b'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x4bc4e5,_0xbfa4('0x1b'),JSON[_0xbfa4('0x1c')](_0x10c1a4));if(_0x10c1a4[_0xbfa4('0x1d')]){if(_0x10c1a4[_0xbfa4('0x1d')][_0xbfa4('0x1e')]===0x1f4){logger[_0xbfa4('0x1d')](_0xbfa4('0x1a'),_0x4bc4e5,_0x10c1a4[_0xbfa4('0x1d')][_0xbfa4('0x1f')]);return _0xd76956(_0x10c1a4[_0xbfa4('0x1d')][_0xbfa4('0x1f')]);}logger['error'](_0xbfa4('0x1a'),_0x4bc4e5,_0x10c1a4[_0xbfa4('0x1d')][_0xbfa4('0x1f')]);return _0x318138(_0x10c1a4[_0xbfa4('0x1d')][_0xbfa4('0x1f')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x4bc4e5,_0xbfa4('0x1b'));_0x318138(_0x10c1a4[_0xbfa4('0x20')][_0xbfa4('0x1f')]);}})['catch'](function(_0x3a38b7){logger[_0xbfa4('0x1d')](_0xbfa4('0x1a'),_0x4bc4e5,_0x3a38b7);_0xd76956(_0x3a38b7);});});}function respondWithStatusCode(_0x445946,_0x345617){_0x345617=_0x345617||0xcc;return function(_0x650703){if(_0x650703){return _0x445946[_0xbfa4('0x21')](_0x345617);}return _0x445946[_0xbfa4('0x22')](_0x345617)[_0xbfa4('0x23')]();};}function respondWithResult(_0x305d57,_0x4beaba){_0x4beaba=_0x4beaba||0xc8;return function(_0x45cf52){if(_0x45cf52){return _0x305d57[_0xbfa4('0x22')](_0x4beaba)[_0xbfa4('0x24')](_0x45cf52);}};}function respondWithFilteredResult(_0x5bf280,_0x1aec4c){return function(_0x34ef7b){if(_0x34ef7b){var _0x424a1a=typeof _0x1aec4c['offset']===_0xbfa4('0x25')&&typeof _0x1aec4c[_0xbfa4('0x26')]===_0xbfa4('0x25');var _0x125c04=_0x34ef7b[_0xbfa4('0x27')];var _0x1bff1a=_0x424a1a?0x0:_0x1aec4c['offset'];var _0x4a03fa=_0x424a1a?_0x34ef7b[_0xbfa4('0x27')]:_0x1aec4c[_0xbfa4('0x28')]+_0x1aec4c['limit'];var _0x117056;if(_0x4a03fa>=_0x125c04){_0x4a03fa=_0x125c04;_0x117056=0xc8;}else{_0x117056=0xce;}_0x5bf280[_0xbfa4('0x22')](_0x117056);return _0x5bf280[_0xbfa4('0x29')]('Content-Range',_0x1bff1a+'-'+_0x4a03fa+'/'+_0x125c04)[_0xbfa4('0x24')](_0x34ef7b);}return null;};}function patchUpdates(_0x44d0e1){return function(_0x5ab3eb){try{jsonpatch[_0xbfa4('0x2a')](_0x5ab3eb,_0x44d0e1,!![]);}catch(_0x25518c){return BPromise[_0xbfa4('0x2b')](_0x25518c);}return _0x5ab3eb[_0xbfa4('0x2c')]();};}function saveUpdates(_0x389c8a,_0x4169fb){return function(_0x4540f8){if(_0x4540f8){return _0x4540f8[_0xbfa4('0x2d')](_0x389c8a)[_0xbfa4('0x18')](function(_0x283ee7){return _0x283ee7;});}return null;};}function removeEntity(_0x1041d9,_0xa8b043){return function(_0x31e3a7){if(_0x31e3a7){return _0x31e3a7[_0xbfa4('0x2e')]()[_0xbfa4('0x18')](function(){_0x1041d9['status'](0xcc)[_0xbfa4('0x23')]();});}};}function handleEntityNotFound(_0x3906eb,_0x315e94){return function(_0xf3a3a9){if(!_0xf3a3a9){_0x3906eb[_0xbfa4('0x21')](0x194);}return _0xf3a3a9;};}function handleError(_0x25e6a3,_0x5e4536){_0x5e4536=_0x5e4536||0x1f4;return function(_0x586de0){logger[_0xbfa4('0x1d')](_0x586de0[_0xbfa4('0x2f')]);if(_0x586de0[_0xbfa4('0x30')]){delete _0x586de0[_0xbfa4('0x30')];}_0x25e6a3[_0xbfa4('0x22')](_0x5e4536)['send'](_0x586de0);};}exports[_0xbfa4('0x31')]=function(_0x3283e1,_0x23f9ef){var _0x4b984={},_0x58c308={},_0x4fe5b1={'count':0x0,'rows':[]};var _0xc8ce99=_[_0xbfa4('0x32')](db['Setting'][_0xbfa4('0x33')],function(_0x5dc1b2){return{'name':_0x5dc1b2['fieldName'],'type':_0x5dc1b2[_0xbfa4('0x34')][_0xbfa4('0x35')]};});_0x58c308['model']=_[_0xbfa4('0x32')](_0xc8ce99,_0xbfa4('0x30'));_0x58c308[_0xbfa4('0x36')]=_[_0xbfa4('0x37')](_0x3283e1[_0xbfa4('0x36')]);_0x58c308[_0xbfa4('0x38')]=_[_0xbfa4('0x39')](_0x58c308[_0xbfa4('0x3a')],_0x58c308[_0xbfa4('0x36')]);_0x4b984[_0xbfa4('0x3b')]=_[_0xbfa4('0x39')](_0x58c308['model'],qs['fields'](_0x3283e1['query']['fields']));_0x4b984[_0xbfa4('0x3b')]=_0x4b984[_0xbfa4('0x3b')]['length']?_0x4b984[_0xbfa4('0x3b')]:_0x58c308[_0xbfa4('0x3a')];if(!_0x3283e1[_0xbfa4('0x36')]['hasOwnProperty']('nolimit')){_0x4b984[_0xbfa4('0x26')]=qs['limit'](_0x3283e1[_0xbfa4('0x36')]['limit']);_0x4b984[_0xbfa4('0x28')]=qs['offset'](_0x3283e1[_0xbfa4('0x36')][_0xbfa4('0x28')]);}_0x4b984[_0xbfa4('0x3c')]=qs[_0xbfa4('0x3d')](_0x3283e1['query']['sort']);_0x4b984[_0xbfa4('0x3e')]=qs[_0xbfa4('0x38')](_[_0xbfa4('0x3f')](_0x3283e1[_0xbfa4('0x36')],_0x58c308[_0xbfa4('0x38')]),_0xc8ce99);if(_0x3283e1[_0xbfa4('0x36')]['filter']){_0x4b984[_0xbfa4('0x3e')]=_['merge'](_0x4b984[_0xbfa4('0x3e')],{'$or':_[_0xbfa4('0x32')](_0xc8ce99,function(_0x1c8f67){if(_0x1c8f67['type']!==_0xbfa4('0x40')){var _0x6d715d={};_0x6d715d[_0x1c8f67[_0xbfa4('0x30')]]={'$like':'%'+_0x3283e1['query'][_0xbfa4('0x41')]+'%'};return _0x6d715d;}})});}_0x4b984=_[_0xbfa4('0x42')]({},_0x4b984,_0x3283e1['options']);var _0x2ecde7={'where':_0x4b984[_0xbfa4('0x3e')]};return db[_0xbfa4('0x43')]['count'](_0x2ecde7)[_0xbfa4('0x18')](function(_0x3c8e3b){_0x4fe5b1[_0xbfa4('0x27')]=_0x3c8e3b;if(_0x3283e1[_0xbfa4('0x36')][_0xbfa4('0x44')]){_0x4b984[_0xbfa4('0x45')]=[{'all':!![]}];}return db[_0xbfa4('0x43')][_0xbfa4('0x46')](_0x4b984);})[_0xbfa4('0x18')](function(_0x18a826){_0x4fe5b1[_0xbfa4('0x47')]=_0x18a826;return _0x4fe5b1;})[_0xbfa4('0x18')](respondWithFilteredResult(_0x23f9ef,_0x4b984))[_0xbfa4('0x48')](handleError(_0x23f9ef,null));};exports[_0xbfa4('0x49')]=function(_0x6ea3f,_0x16e1e6){var _0x24edc8={'raw':![],'where':{'id':_0x6ea3f['params']['id']}},_0x33a58b={};_0x33a58b['model']=_[_0xbfa4('0x37')](db[_0xbfa4('0x43')][_0xbfa4('0x33')]);_0x33a58b[_0xbfa4('0x36')]=_[_0xbfa4('0x37')](_0x6ea3f[_0xbfa4('0x36')]);_0x33a58b[_0xbfa4('0x38')]=_[_0xbfa4('0x39')](_0x33a58b[_0xbfa4('0x3a')],_0x33a58b[_0xbfa4('0x36')]);_0x24edc8[_0xbfa4('0x3b')]=_['intersection'](_0x33a58b[_0xbfa4('0x3a')],qs[_0xbfa4('0x4a')](_0x6ea3f[_0xbfa4('0x36')][_0xbfa4('0x4a')]));_0x24edc8[_0xbfa4('0x3b')]=_0x24edc8[_0xbfa4('0x3b')][_0xbfa4('0x4b')]?_0x24edc8['attributes']:_0x33a58b[_0xbfa4('0x3a')];if(_0x6ea3f[_0xbfa4('0x36')]['includeAll']){_0x24edc8[_0xbfa4('0x45')]=[{'all':!![]}];}_0x24edc8=_[_0xbfa4('0x42')]({},_0x24edc8,_0x6ea3f[_0xbfa4('0x4c')]);return db['Setting'][_0xbfa4('0x4d')](_0x24edc8)['then'](handleEntityNotFound(_0x16e1e6,null))[_0xbfa4('0x18')](respondWithResult(_0x16e1e6,null))[_0xbfa4('0x48')](handleError(_0x16e1e6,null));};exports[_0xbfa4('0x2d')]=function(_0x56b695,_0x311335){if(_0x56b695['body']['id']){delete _0x56b695['body']['id'];}return db[_0xbfa4('0x43')][_0xbfa4('0x4d')]({'where':{'id':_0x56b695[_0xbfa4('0x4e')]['id']}})[_0xbfa4('0x18')](handleEntityNotFound(_0x311335,null))['then'](saveUpdates(_0x56b695[_0xbfa4('0x4f')],null))[_0xbfa4('0x18')](respondWithResult(_0x311335,null))['catch'](handleError(_0x311335,null));};exports[_0xbfa4('0x50')]=function(_0x258c31,_0x39ca27,_0x3f405b){if(_0x258c31[_0xbfa4('0x51')]&&_0x258c31[_0xbfa4('0x51')][_0xbfa4('0x52')]){_0x258c31[_0xbfa4('0x4f')]['logo']=_0x258c31[_0xbfa4('0x51')][_0xbfa4('0x52')];}return db[_0xbfa4('0x43')][_0xbfa4('0x4d')]({'where':{'id':_0x258c31[_0xbfa4('0x4e')]['id']}})[_0xbfa4('0x18')](handleEntityNotFound(_0x39ca27,null))['then'](saveUpdates(_0x258c31[_0xbfa4('0x4f')],null))[_0xbfa4('0x18')](respondWithResult(_0x39ca27,null))[_0xbfa4('0x48')](handleError(_0x39ca27,null));};exports['addLogoLogin']=function(_0x59ef1e,_0x579e7c,_0x4a7576){if(_0x59ef1e[_0xbfa4('0x51')]&&_0x59ef1e[_0xbfa4('0x51')][_0xbfa4('0x52')]){_0x59ef1e[_0xbfa4('0x4f')][_0xbfa4('0x53')]=_0x59ef1e[_0xbfa4('0x51')][_0xbfa4('0x52')];}return db[_0xbfa4('0x43')][_0xbfa4('0x4d')]({'where':{'id':_0x59ef1e[_0xbfa4('0x4e')]['id']}})[_0xbfa4('0x18')](handleEntityNotFound(_0x579e7c,null))['then'](saveUpdates(_0x59ef1e['body'],null))[_0xbfa4('0x18')](respondWithResult(_0x579e7c,null))['catch'](handleError(_0x579e7c,null));};var utilLicense=require('../../config/license/util');exports[_0xbfa4('0x54')]=function(_0x2cdd39,_0x54789e,_0xa007f2){var _0x22b647='server/files/images/logos';var _0x268018={'custom':![]};return utilLicense[_0xbfa4('0x55')]()['then'](function(_0x42d152){if(_0x42d152){_0x268018=_0x42d152;}return db[_0xbfa4('0x43')][_0xbfa4('0x4d')]({'where':{'id':_0x2cdd39[_0xbfa4('0x4e')]['id']},'attributes':[_0xbfa4('0x56'),_0xbfa4('0x53'),'preferred','favicon',_0xbfa4('0x57'),_0xbfa4('0x58'),_0xbfa4('0x59'),'defaultFavicon'],'raw':!![]});})[_0xbfa4('0x18')](handleEntityNotFound(_0x54789e,null))['then'](function(_0x38348d){if(_0x38348d){var _0x1dcf28=_0x38348d[_0xbfa4('0x56')]&&fs[_0xbfa4('0x5a')](path[_0xbfa4('0x5b')](config[_0xbfa4('0x5c')],_0x22b647,_[_0xbfa4('0x5d')](_0x38348d[_0xbfa4('0x56')])))?path[_0xbfa4('0x5b')](config['root'],_0x22b647,_['toLower'](_0x38348d[_0xbfa4('0x56')])):path[_0xbfa4('0x5b')](config[_0xbfa4('0x5c')],_0x22b647,_[_0xbfa4('0x5d')](_0xbfa4('0x5e')));var _0x312260='default'+_[_0xbfa4('0x5f')](_0xbfa4('0x56'));if(_0x38348d[_0x312260]||!_0x268018[_0xbfa4('0x60')]){_0x1dcf28=path[_0xbfa4('0x5b')](config['root'],_0x22b647,_[_0xbfa4('0x5d')](_0xbfa4('0x5e')));}if(!fs['existsSync'](_0x1dcf28)){throw new db[(_0xbfa4('0x61'))]['ValidationError'](_[_0xbfa4('0x5f')](_0xbfa4('0x56'))+_0xbfa4('0x62'));}return _0x54789e[_0xbfa4('0x63')](_0x1dcf28);}})['catch'](handleError(_0x54789e,null));};var utilLicense=require(_0xbfa4('0x14'));exports[_0xbfa4('0x64')]=function(_0x564abd,_0x53248c,_0x3b2d01){var _0x555b26=_0xbfa4('0x65');var _0x1208d9={'custom':![]};return utilLicense[_0xbfa4('0x55')]()[_0xbfa4('0x18')](function(_0x10fae8){if(_0x10fae8){_0x1208d9=_0x10fae8;}return db[_0xbfa4('0x43')][_0xbfa4('0x4d')]({'where':{'id':_0x564abd[_0xbfa4('0x4e')]['id']},'attributes':['logo',_0xbfa4('0x53'),_0xbfa4('0x66'),_0xbfa4('0x67'),_0xbfa4('0x57'),'defaultLoginLogo',_0xbfa4('0x59'),'defaultFavicon'],'raw':!![]});})[_0xbfa4('0x18')](handleEntityNotFound(_0x53248c,null))[_0xbfa4('0x18')](function(_0x13e14a){if(_0x13e14a){var _0x2c3a54=_0x13e14a[_0xbfa4('0x53')]&&fs[_0xbfa4('0x5a')](path['join'](config[_0xbfa4('0x5c')],_0x555b26,_['toLower'](_0x13e14a[_0xbfa4('0x53')])))?path[_0xbfa4('0x5b')](config[_0xbfa4('0x5c')],_0x555b26,_[_0xbfa4('0x5d')](_0x13e14a['loginLogo'])):path['join'](config[_0xbfa4('0x5c')],_0x555b26,_[_0xbfa4('0x5d')](_0xbfa4('0x68')));var _0x395e4f='default'+_[_0xbfa4('0x5f')](_0xbfa4('0x53'));if(_0x13e14a[_0x395e4f]||!_0x1208d9[_0xbfa4('0x60')]){_0x2c3a54=path[_0xbfa4('0x5b')](config[_0xbfa4('0x5c')],_0x555b26,_[_0xbfa4('0x5d')]('default_loginLogo.svg'));}if(!fs['existsSync'](_0x2c3a54)){throw new db[(_0xbfa4('0x61'))]['ValidationError'](_['upperFirst'](_0xbfa4('0x53'))+_0xbfa4('0x62'));}return _0x53248c['download'](_0x2c3a54);}})[_0xbfa4('0x48')](handleError(_0x53248c,null));};exports['gdpr']=function(_0x4756d9,_0x3d391b){return db[_0xbfa4('0x43')][_0xbfa4('0x4d')]({'where':{'id':_0x4756d9['params']['id']},'attributes':[_0xbfa4('0x69')]})[_0xbfa4('0x18')](respondWithResult(_0x3d391b,null))['catch'](handleError(_0x3d391b,null));};exports['addPreferred']=function(_0x191239,_0x1b0f3f,_0x1fa79b){if(_0x191239['file']&&_0x191239['file'][_0xbfa4('0x52')]){_0x191239[_0xbfa4('0x4f')][_0xbfa4('0x66')]=_0x191239[_0xbfa4('0x51')]['filename'];}return db[_0xbfa4('0x43')][_0xbfa4('0x4d')]({'where':{'id':_0x191239[_0xbfa4('0x4e')]['id']}})[_0xbfa4('0x18')](handleEntityNotFound(_0x1b0f3f,null))['then'](saveUpdates(_0x191239[_0xbfa4('0x4f')],null))[_0xbfa4('0x18')](respondWithResult(_0x1b0f3f,null))[_0xbfa4('0x48')](handleError(_0x1b0f3f,null));};var utilLicense=require(_0xbfa4('0x14'));exports[_0xbfa4('0x6a')]=function(_0x57cb89,_0x392408,_0x254037){var _0x3119fa=_0xbfa4('0x65');var _0x57954d={'custom':![]};return utilLicense[_0xbfa4('0x55')]()[_0xbfa4('0x18')](function(_0x5f4840){if(_0x5f4840){_0x57954d=_0x5f4840;}return db[_0xbfa4('0x43')]['find']({'where':{'id':_0x57cb89[_0xbfa4('0x4e')]['id']},'attributes':[_0xbfa4('0x56'),_0xbfa4('0x53'),_0xbfa4('0x66'),'favicon','defaultLogo',_0xbfa4('0x58'),_0xbfa4('0x59'),_0xbfa4('0x6b')],'raw':!![]});})['then'](handleEntityNotFound(_0x392408,null))['then'](function(_0x16861c){if(_0x16861c){var _0xc568de=_0x16861c['preferred']&&fs[_0xbfa4('0x5a')](path[_0xbfa4('0x5b')](config[_0xbfa4('0x5c')],_0x3119fa,_[_0xbfa4('0x5d')](_0x16861c[_0xbfa4('0x66')])))?path[_0xbfa4('0x5b')](config[_0xbfa4('0x5c')],_0x3119fa,_[_0xbfa4('0x5d')](_0x16861c[_0xbfa4('0x66')])):path['join'](config[_0xbfa4('0x5c')],_0x3119fa,_[_0xbfa4('0x5d')](_0xbfa4('0x6c')));var _0x604df8=_0xbfa4('0x6d')+_[_0xbfa4('0x5f')]('preferred');if(_0x16861c[_0x604df8]||!_0x57954d[_0xbfa4('0x60')]||!_0x57954d[_0xbfa4('0x66')]){_0xc568de=path[_0xbfa4('0x5b')](config['root'],_0x3119fa,_['toLower'](_0xbfa4('0x6c')));}if(!fs[_0xbfa4('0x5a')](_0xc568de)){throw new db['Sequelize']['ValidationError'](_[_0xbfa4('0x5f')](_0xbfa4('0x66'))+_0xbfa4('0x62'));}return _0x392408[_0xbfa4('0x63')](_0xc568de);}})[_0xbfa4('0x48')](handleError(_0x392408,null));};exports['addFavicon']=function(_0x87b31e,_0x2a6a6b,_0x4f9f09){if(_0x87b31e[_0xbfa4('0x51')]&&_0x87b31e[_0xbfa4('0x51')][_0xbfa4('0x52')]){_0x87b31e[_0xbfa4('0x4f')][_0xbfa4('0x67')]=_0x87b31e[_0xbfa4('0x51')]['filename'];}return db[_0xbfa4('0x43')][_0xbfa4('0x4d')]({'where':{'id':_0x87b31e[_0xbfa4('0x4e')]['id']}})[_0xbfa4('0x18')](handleEntityNotFound(_0x2a6a6b,null))[_0xbfa4('0x18')](saveUpdates(_0x87b31e[_0xbfa4('0x4f')],null))[_0xbfa4('0x18')](respondWithResult(_0x2a6a6b,null))[_0xbfa4('0x48')](handleError(_0x2a6a6b,null));};var utilLicense=require('../../config/license/util');exports[_0xbfa4('0x6e')]=function(_0x1733e8,_0x30a45d,_0x5a00a7){var _0x5ce9b9=_0xbfa4('0x65');var _0x21d770={'custom':![]};return utilLicense[_0xbfa4('0x55')]()[_0xbfa4('0x18')](function(_0x117172){if(_0x117172){_0x21d770=_0x117172;}return db[_0xbfa4('0x43')][_0xbfa4('0x4d')]({'where':{'id':_0x1733e8[_0xbfa4('0x4e')]['id']},'attributes':[_0xbfa4('0x56'),_0xbfa4('0x53'),_0xbfa4('0x66'),_0xbfa4('0x67'),_0xbfa4('0x57'),_0xbfa4('0x58'),_0xbfa4('0x59'),_0xbfa4('0x6b')],'raw':!![]});})[_0xbfa4('0x18')](handleEntityNotFound(_0x30a45d,null))[_0xbfa4('0x18')](function(_0x34961f){if(_0x34961f){var _0xf00c49=_0x34961f['favicon']&&fs[_0xbfa4('0x5a')](path[_0xbfa4('0x5b')](config[_0xbfa4('0x5c')],_0x5ce9b9,_[_0xbfa4('0x5d')](_0x34961f[_0xbfa4('0x67')])))?path['join'](config['root'],_0x5ce9b9,_[_0xbfa4('0x5d')](_0x34961f['favicon'])):path['join'](config['root'],_0x5ce9b9,_[_0xbfa4('0x5d')](_0xbfa4('0x6f')));var _0x5662e9=_0xbfa4('0x6d')+_[_0xbfa4('0x5f')]('favicon');if(_0x34961f[_0x5662e9]||!_0x21d770[_0xbfa4('0x60')]){_0xf00c49=path[_0xbfa4('0x5b')](config[_0xbfa4('0x5c')],_0x5ce9b9,_[_0xbfa4('0x5d')](_0xbfa4('0x6f')));}if(!fs[_0xbfa4('0x5a')](_0xf00c49)){throw new db[(_0xbfa4('0x61'))][(_0xbfa4('0x70'))](_[_0xbfa4('0x5f')](_0xbfa4('0x67'))+_0xbfa4('0x62'));}return _0x30a45d[_0xbfa4('0x63')](_0xf00c49);}})[_0xbfa4('0x48')](handleError(_0x30a45d,null));};exports[_0xbfa4('0x71')]=function(_0x34e9bb,_0x474d21){var _0x420c82={'offset':moment()[_0xbfa4('0x72')]()};_0x420c82[_0xbfa4('0x73')]=moment()[_0xbfa4('0x72')](_0x420c82[_0xbfa4('0x28')])[_0xbfa4('0x74')](_0xbfa4('0x75'));return _0x474d21[_0xbfa4('0x22')](0xc8)[_0xbfa4('0x76')](_0x420c82);};
\ No newline at end of file