Built motion from commit 459747fdfe53bbf13fbede61eeaffea1f1438f86. Version 3.0.0...
[motion-next.git] / server / api / setting / setting.controller.js
index e92b078..a3bedda 100644 (file)
@@ -1 +1 @@
-const a538_0x883b=['default_favicon.ico','defaultLoginLogo','getLogo','favicon','addLogoLogin','existsSync','files/images/logos','pick','path','default_logo.svg','length','fields','defaultPreferred','nolimit','merge','map','../../mysqldb','default_preferred.png','then','catch','keys','name','getFavicon','intersection','getLogoLogin','Content-Range','count','type','attributes','error','params','upperFirst','download','root','sequelize','addLogo','rawAttributes','lodash','offset','where','options','send','Setting','sendStatus','default','logo','json','stack','filename','includeAll','query','addFavicon','custom','defaultFavicon','include','../../components/parsers/qs','default_loginLogo.svg','status','model','VIRTUAL','key','gdpr','file','findAll','join','limit','findOne','\x20not\x20found','undefined','filter','api','getLicense','index','update','sort','addPreferred','toLower','body','defaultLogo','filters','loginLogo','preferred','securePassword','../../config/license/util'];(function(_0x1c2e00,_0x883bd9){const _0x530d45=function(_0x57c80a){while(--_0x57c80a){_0x1c2e00['push'](_0x1c2e00['shift']());}};_0x530d45(++_0x883bd9);}(a538_0x883b,0x164));const a538_0x530d=function(_0x1c2e00,_0x883bd9){_0x1c2e00=_0x1c2e00-0x0;let _0x530d45=a538_0x883b[_0x1c2e00];return _0x530d45;};const _0x1a16fd=a538_0x530d;'use strict';const path=require(_0x1a16fd('0x48')),fs=require('fs'),_=require(_0x1a16fd('0x11')),qs=require(_0x1a16fd('0x23')),logger=require('../../config/logger')(_0x1a16fd('0x32')),config=require('../../config/environment'),db=require(_0x1a16fd('0x50'))['db'],{Op,ValidationError}=require(_0x1a16fd('0xe')),utilLicense=require(_0x1a16fd('0x3f'));function respondWithResult(_0x57c80a,_0x208f27){return _0x208f27=_0x208f27||0xc8,function(_0x1d685f){const _0x284863=a538_0x530d;if(_0x1d685f)return _0x57c80a[_0x284863('0x25')](_0x208f27)[_0x284863('0x1a')](_0x1d685f);};}function respondWithFilteredResult(_0x52237b,_0x1f467f){return function(_0x51c34b){const _0x5c4f73=a538_0x530d;if(_0x51c34b){const _0x42da32=_0x51c34b[_0x5c4f73('0x6')],_0xa1b28b=_0x1f467f['offset'];let _0x13fbfa=_0x1f467f[_0x5c4f73('0x12')]+_0x1f467f[_0x5c4f73('0x2d')],_0x5c6558;return _0x13fbfa>=_0x42da32?(_0x13fbfa=_0x42da32,_0x5c6558=0xc8):_0x5c6558=0xce,_0x52237b[_0x5c4f73('0x25')](_0x5c6558),_0x52237b['set'](_0x5c4f73('0x5'),_0xa1b28b+'-'+_0x13fbfa+'/'+_0x42da32)['json'](_0x51c34b);}return null;};}function saveUpdates(_0x532c6b){return function(_0x57cbc8){const _0x31a484=a538_0x530d;if(_0x57cbc8)return _0x57cbc8[_0x31a484('0x35')](_0x532c6b)['then'](function(_0x252b36){return _0x252b36;});return null;};}function handleEntityNotFound(_0xaea25b){return function(_0x52fb07){const _0x42f0b9=a538_0x530d;return!_0x52fb07&&_0xaea25b[_0x42f0b9('0x17')](0x194),_0x52fb07;};}function handleError(_0x2f9f68,_0x554c77){return _0x554c77=_0x554c77||0x1f4,function(_0x1fa272){const _0x15a9fc=a538_0x530d;logger[_0x15a9fc('0x9')](_0x1fa272[_0x15a9fc('0x1b')]),_0x1fa272['name']&&delete _0x1fa272[_0x15a9fc('0x1')],_0x2f9f68[_0x15a9fc('0x25')](_0x554c77)[_0x15a9fc('0x15')](_0x1fa272);};}exports[_0x1a16fd('0x34')]=function(_0x5b9371,_0x378957){const _0x376f03=_0x1a16fd;let _0x427429={};const _0x48fb05={},_0x471403={'count':0x0,'rows':[]},_0x38e27c=_[_0x376f03('0x4f')](db[_0x376f03('0x16')][_0x376f03('0x10')],function(_0x5a6293){const _0x1613e3=_0x376f03;return{'name':_0x5a6293['fieldName'],'type':_0x5a6293[_0x1613e3('0x7')][_0x1613e3('0x28')]};});_0x48fb05['model']=_['map'](_0x38e27c,_0x376f03('0x1')),_0x48fb05[_0x376f03('0x1e')]=_['keys'](_0x5b9371[_0x376f03('0x1e')]),_0x48fb05[_0x376f03('0x3b')]=_[_0x376f03('0x3')](_0x48fb05['model'],_0x48fb05[_0x376f03('0x1e')]),_0x427429[_0x376f03('0x8')]=_[_0x376f03('0x3')](_0x48fb05[_0x376f03('0x26')],qs[_0x376f03('0x4b')](_0x5b9371[_0x376f03('0x1e')]['fields'])),_0x427429[_0x376f03('0x8')]=_0x427429[_0x376f03('0x8')][_0x376f03('0x4a')]?_0x427429[_0x376f03('0x8')]:_0x48fb05[_0x376f03('0x26')];typeof _0x5b9371[_0x376f03('0x1e')][_0x376f03('0x4d')]===_0x376f03('0x30')&&(_0x427429[_0x376f03('0x2d')]=qs['limit'](_0x5b9371[_0x376f03('0x1e')]['limit']),_0x427429['offset']=qs['offset'](_0x5b9371['query'][_0x376f03('0x12')]));_0x427429['order']=qs[_0x376f03('0x36')](_0x5b9371[_0x376f03('0x1e')][_0x376f03('0x36')]),_0x427429['where']=qs[_0x376f03('0x3b')](_[_0x376f03('0x47')](_0x5b9371[_0x376f03('0x1e')],_0x48fb05['filters']),_0x38e27c);_0x5b9371[_0x376f03('0x1e')][_0x376f03('0x31')]&&(_0x427429[_0x376f03('0x13')]=_['merge'](_0x427429[_0x376f03('0x13')],{[Op['or']]:_[_0x376f03('0x4f')](_0x38e27c,function(_0x4dcfdc){const _0x11e1d6=_0x376f03;if(_0x4dcfdc['type']!==_0x11e1d6('0x27')){const _0x3322a3={};return _0x3322a3[_0x4dcfdc[_0x11e1d6('0x1')]]={[Op['like']]:'%'+_0x5b9371[_0x11e1d6('0x1e')][_0x11e1d6('0x31')]+'%'},_0x3322a3;}})}));_0x427429=_['merge']({},_0x427429,_0x5b9371[_0x376f03('0x14')]);const _0x32fb0d={'where':_0x427429[_0x376f03('0x13')]};return db[_0x376f03('0x16')][_0x376f03('0x6')](_0x32fb0d)[_0x376f03('0x52')](function(_0xf80f56){const _0x3939dd=_0x376f03;return _0x471403['count']=_0xf80f56,_0x5b9371[_0x3939dd('0x1e')][_0x3939dd('0x1d')]&&(_0x427429[_0x3939dd('0x22')]=[{'all':!![]}]),db[_0x3939dd('0x16')][_0x3939dd('0x2b')](_0x427429);})['then'](function(_0x3075bb){return _0x471403['rows']=_0x3075bb,_0x471403;})[_0x376f03('0x52')](respondWithFilteredResult(_0x378957,_0x427429))[_0x376f03('0x53')](handleError(_0x378957,null));},exports['show']=function(_0x30a8ed,_0x42cb85){const _0x2679e0=_0x1a16fd;let _0x27469a={'raw':![],'where':{'id':_0x30a8ed[_0x2679e0('0xa')]['id']}};const _0x121d65={};return _0x121d65[_0x2679e0('0x26')]=_['keys'](db[_0x2679e0('0x16')]['rawAttributes']),_0x121d65['query']=_[_0x2679e0('0x0')](_0x30a8ed[_0x2679e0('0x1e')]),_0x121d65[_0x2679e0('0x3b')]=_['intersection'](_0x121d65[_0x2679e0('0x26')],_0x121d65[_0x2679e0('0x1e')]),_0x27469a['attributes']=_['intersection'](_0x121d65[_0x2679e0('0x26')],qs[_0x2679e0('0x4b')](_0x30a8ed[_0x2679e0('0x1e')][_0x2679e0('0x4b')])),_0x27469a[_0x2679e0('0x8')]=_0x27469a[_0x2679e0('0x8')][_0x2679e0('0x4a')]?_0x27469a['attributes']:_0x121d65[_0x2679e0('0x26')],_0x30a8ed[_0x2679e0('0x1e')][_0x2679e0('0x1d')]&&(_0x27469a['include']=[{'all':!![]}]),_0x27469a=_[_0x2679e0('0x4e')]({},_0x27469a,_0x30a8ed[_0x2679e0('0x14')]),db['Setting'][_0x2679e0('0x2e')](_0x27469a)['then'](handleEntityNotFound(_0x42cb85,null))[_0x2679e0('0x52')](respondWithResult(_0x42cb85,null))[_0x2679e0('0x53')](handleError(_0x42cb85,null));},exports[_0x1a16fd('0x35')]=function(_0x2b419f,_0x4a027f){const _0x4efbe5=_0x1a16fd;return _0x2b419f['body']['id']&&delete _0x2b419f[_0x4efbe5('0x39')]['id'],db[_0x4efbe5('0x16')][_0x4efbe5('0x2e')]({'where':{'id':_0x2b419f['params']['id']}})[_0x4efbe5('0x52')](handleEntityNotFound(_0x4a027f,null))['then'](saveUpdates(_0x2b419f[_0x4efbe5('0x39')],null))[_0x4efbe5('0x52')](respondWithResult(_0x4a027f,null))[_0x4efbe5('0x53')](handleError(_0x4a027f,null));},exports[_0x1a16fd('0xf')]=function(_0x339936,_0x548fa0){const _0x499653=_0x1a16fd;return _0x339936['file']&&_0x339936[_0x499653('0x2a')][_0x499653('0x1c')]&&(_0x339936['body'][_0x499653('0x19')]=_0x339936[_0x499653('0x2a')]['filename']),db[_0x499653('0x16')][_0x499653('0x2e')]({'where':{'id':_0x339936['params']['id']}})[_0x499653('0x52')](handleEntityNotFound(_0x548fa0,null))[_0x499653('0x52')](saveUpdates(_0x339936['body'],null))[_0x499653('0x52')](respondWithResult(_0x548fa0,null))[_0x499653('0x53')](handleError(_0x548fa0,null));},exports[_0x1a16fd('0x44')]=function(_0x1984ef,_0x4e961d){const _0x3eb818=_0x1a16fd;return _0x1984ef[_0x3eb818('0x2a')]&&_0x1984ef['file'][_0x3eb818('0x1c')]&&(_0x1984ef[_0x3eb818('0x39')][_0x3eb818('0x3c')]=_0x1984ef[_0x3eb818('0x2a')]['filename']),db[_0x3eb818('0x16')]['findOne']({'where':{'id':_0x1984ef[_0x3eb818('0xa')]['id']}})[_0x3eb818('0x52')](handleEntityNotFound(_0x4e961d,null))['then'](saveUpdates(_0x1984ef['body'],null))[_0x3eb818('0x52')](respondWithResult(_0x4e961d,null))[_0x3eb818('0x53')](handleError(_0x4e961d,null));},exports[_0x1a16fd('0x42')]=function(_0x423a0c,_0x4eee21){const _0x1bfc5b=_0x1a16fd,_0xa0edf2=path[_0x1bfc5b('0x2c')](config[_0x1bfc5b('0xd')],_0x1bfc5b('0x46'));let _0x24f66a={'custom':![]};return utilLicense[_0x1bfc5b('0x33')]()[_0x1bfc5b('0x52')](function(_0x43462c){const _0xc4815e=_0x1bfc5b;return _0x43462c&&(_0x24f66a=_0x43462c),db[_0xc4815e('0x16')]['findOne']({'where':{'id':_0x423a0c['params']['id']},'attributes':['logo','loginLogo',_0xc4815e('0x3d'),_0xc4815e('0x43'),'defaultLogo',_0xc4815e('0x41'),_0xc4815e('0x4c'),_0xc4815e('0x21')],'raw':!![]});})[_0x1bfc5b('0x52')](handleEntityNotFound(_0x4eee21,null))['then'](function(_0xe7134b){const _0x35fee6=_0x1bfc5b;if(_0xe7134b){let _0x131c78=_0xe7134b[_0x35fee6('0x19')]&&fs[_0x35fee6('0x45')](path[_0x35fee6('0x2c')](_0xa0edf2,_[_0x35fee6('0x38')](_0xe7134b[_0x35fee6('0x19')])))?path[_0x35fee6('0x2c')](_0xa0edf2,_[_0x35fee6('0x38')](_0xe7134b['logo'])):path[_0x35fee6('0x2c')](_0xa0edf2,_[_0x35fee6('0x38')](_0x35fee6('0x49')));const _0x5e7833='default'+_[_0x35fee6('0xb')](_0x35fee6('0x19'));(_0xe7134b[_0x5e7833]||!_0x24f66a[_0x35fee6('0x20')])&&(_0x131c78=path[_0x35fee6('0x2c')](_0xa0edf2,_[_0x35fee6('0x38')](_0x35fee6('0x49'))));if(!fs[_0x35fee6('0x45')](_0x131c78))throw new ValidationError(_[_0x35fee6('0xb')]('logo')+_0x35fee6('0x2f'));return _0x4eee21['download'](_0x131c78);}})[_0x1bfc5b('0x53')](handleError(_0x4eee21,null));},exports[_0x1a16fd('0x4')]=function(_0x13c7f2,_0x594448){const _0x243c1f=_0x1a16fd,_0xf1e268=path[_0x243c1f('0x2c')](config[_0x243c1f('0xd')],_0x243c1f('0x46'));let _0x4379fb={'custom':![]};return utilLicense[_0x243c1f('0x33')]()[_0x243c1f('0x52')](function(_0xb8cff8){const _0x45ad2b=_0x243c1f;return _0xb8cff8&&(_0x4379fb=_0xb8cff8),db[_0x45ad2b('0x16')]['findOne']({'where':{'id':_0x13c7f2[_0x45ad2b('0xa')]['id']},'attributes':[_0x45ad2b('0x19'),'loginLogo',_0x45ad2b('0x3d'),_0x45ad2b('0x43'),_0x45ad2b('0x3a'),_0x45ad2b('0x41'),_0x45ad2b('0x4c'),'defaultFavicon'],'raw':!![]});})[_0x243c1f('0x52')](handleEntityNotFound(_0x594448,null))[_0x243c1f('0x52')](function(_0xc4bfa6){const _0x171c4b=_0x243c1f;if(_0xc4bfa6){let _0x9aa09e=_0xc4bfa6[_0x171c4b('0x3c')]&&fs[_0x171c4b('0x45')](path[_0x171c4b('0x2c')](_0xf1e268,_[_0x171c4b('0x38')](_0xc4bfa6[_0x171c4b('0x3c')])))?path[_0x171c4b('0x2c')](_0xf1e268,_[_0x171c4b('0x38')](_0xc4bfa6[_0x171c4b('0x3c')])):path[_0x171c4b('0x2c')](_0xf1e268,_[_0x171c4b('0x38')](_0x171c4b('0x24')));const _0xbb13bf=_0x171c4b('0x18')+_['upperFirst']('loginLogo');(_0xc4bfa6[_0xbb13bf]||!_0x4379fb[_0x171c4b('0x20')])&&(_0x9aa09e=path[_0x171c4b('0x2c')](_0xf1e268,_[_0x171c4b('0x38')](_0x171c4b('0x24'))));if(!fs[_0x171c4b('0x45')](_0x9aa09e))throw new ValidationError(_[_0x171c4b('0xb')](_0x171c4b('0x3c'))+_0x171c4b('0x2f'));return _0x594448[_0x171c4b('0xc')](_0x9aa09e);}})[_0x243c1f('0x53')](handleError(_0x594448,null));},exports[_0x1a16fd('0x29')]=function(_0x5946a7,_0x1b3590){const _0x51e356=_0x1a16fd;return db[_0x51e356('0x16')][_0x51e356('0x2e')]({'where':{'id':_0x5946a7['params']['id']},'attributes':[_0x51e356('0x3e')]})[_0x51e356('0x52')](respondWithResult(_0x1b3590,null))[_0x51e356('0x53')](handleError(_0x1b3590,null));},exports[_0x1a16fd('0x37')]=function(_0x3109f4,_0x25658a){const _0x9b324=_0x1a16fd;return _0x3109f4['file']&&_0x3109f4[_0x9b324('0x2a')][_0x9b324('0x1c')]&&(_0x3109f4['body']['preferred']=_0x3109f4['file'][_0x9b324('0x1c')]),db[_0x9b324('0x16')][_0x9b324('0x2e')]({'where':{'id':_0x3109f4[_0x9b324('0xa')]['id']}})[_0x9b324('0x52')](handleEntityNotFound(_0x25658a,null))[_0x9b324('0x52')](saveUpdates(_0x3109f4[_0x9b324('0x39')],null))['then'](respondWithResult(_0x25658a,null))[_0x9b324('0x53')](handleError(_0x25658a,null));},exports['getPreferred']=function(_0x486dba,_0x212a2a){const _0x4b6341=_0x1a16fd,_0x4700b7=path[_0x4b6341('0x2c')](config[_0x4b6341('0xd')],_0x4b6341('0x46'));let _0x462dc4={'custom':![]};return utilLicense[_0x4b6341('0x33')]()[_0x4b6341('0x52')](function(_0x315f45){const _0x496aea=_0x4b6341;return _0x315f45&&(_0x462dc4=_0x315f45),db[_0x496aea('0x16')]['findOne']({'where':{'id':_0x486dba['params']['id']},'attributes':[_0x496aea('0x19'),_0x496aea('0x3c'),_0x496aea('0x3d'),_0x496aea('0x43'),'defaultLogo',_0x496aea('0x41'),_0x496aea('0x4c'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x212a2a,null))[_0x4b6341('0x52')](function(_0x13d16b){const _0x567252=_0x4b6341;if(_0x13d16b){let _0x548b5a=_0x13d16b[_0x567252('0x3d')]&&fs['existsSync'](path[_0x567252('0x2c')](_0x4700b7,_[_0x567252('0x38')](_0x13d16b[_0x567252('0x3d')])))?path[_0x567252('0x2c')](_0x4700b7,_[_0x567252('0x38')](_0x13d16b['preferred'])):path[_0x567252('0x2c')](_0x4700b7,_[_0x567252('0x38')](_0x567252('0x51')));const _0x8d17b=_0x567252('0x18')+_[_0x567252('0xb')](_0x567252('0x3d'));(_0x13d16b[_0x8d17b]||!_0x462dc4['custom']||!_0x462dc4[_0x567252('0x3d')])&&(_0x548b5a=path[_0x567252('0x2c')](_0x4700b7,_[_0x567252('0x38')](_0x567252('0x51'))));if(!fs[_0x567252('0x45')](_0x548b5a))throw new ValidationError(_[_0x567252('0xb')](_0x567252('0x3d'))+_0x567252('0x2f'));return _0x212a2a[_0x567252('0xc')](_0x548b5a);}})[_0x4b6341('0x53')](handleError(_0x212a2a,null));},exports[_0x1a16fd('0x1f')]=function(_0x1a5db4,_0x3980cd){const _0xb92c9b=_0x1a16fd;return _0x1a5db4[_0xb92c9b('0x2a')]&&_0x1a5db4[_0xb92c9b('0x2a')][_0xb92c9b('0x1c')]&&(_0x1a5db4[_0xb92c9b('0x39')][_0xb92c9b('0x43')]=_0x1a5db4[_0xb92c9b('0x2a')][_0xb92c9b('0x1c')]),db[_0xb92c9b('0x16')][_0xb92c9b('0x2e')]({'where':{'id':_0x1a5db4[_0xb92c9b('0xa')]['id']}})['then'](handleEntityNotFound(_0x3980cd,null))[_0xb92c9b('0x52')](saveUpdates(_0x1a5db4[_0xb92c9b('0x39')],null))[_0xb92c9b('0x52')](respondWithResult(_0x3980cd,null))[_0xb92c9b('0x53')](handleError(_0x3980cd,null));},exports[_0x1a16fd('0x2')]=function(_0xddcfb4,_0x1eedaa){const _0x36f930=_0x1a16fd,_0x27687e=path[_0x36f930('0x2c')](config['root'],'files/images/logos');let _0x505f83={'custom':![]};return utilLicense[_0x36f930('0x33')]()[_0x36f930('0x52')](function(_0x3a9be6){const _0xda727e=_0x36f930;return _0x3a9be6&&(_0x505f83=_0x3a9be6),db['Setting'][_0xda727e('0x2e')]({'where':{'id':_0xddcfb4['params']['id']},'attributes':[_0xda727e('0x19'),_0xda727e('0x3c'),_0xda727e('0x3d'),_0xda727e('0x43'),_0xda727e('0x3a'),_0xda727e('0x41'),_0xda727e('0x4c'),_0xda727e('0x21')],'raw':!![]});})['then'](handleEntityNotFound(_0x1eedaa,null))[_0x36f930('0x52')](function(_0x25cc83){const _0x2d956b=_0x36f930;if(_0x25cc83){let _0x32997f=_0x25cc83[_0x2d956b('0x43')]&&fs[_0x2d956b('0x45')](path[_0x2d956b('0x2c')](_0x27687e,_[_0x2d956b('0x38')](_0x25cc83[_0x2d956b('0x43')])))?path[_0x2d956b('0x2c')](_0x27687e,_[_0x2d956b('0x38')](_0x25cc83['favicon'])):path[_0x2d956b('0x2c')](_0x27687e,_['toLower'](_0x2d956b('0x40')));const _0x3c7ee0=_0x2d956b('0x18')+_[_0x2d956b('0xb')]('favicon');(_0x25cc83[_0x3c7ee0]||!_0x505f83[_0x2d956b('0x20')])&&(_0x32997f=path[_0x2d956b('0x2c')](_0x27687e,_['toLower'](_0x2d956b('0x40'))));if(!fs[_0x2d956b('0x45')](_0x32997f))throw new ValidationError(_[_0x2d956b('0xb')](_0x2d956b('0x43'))+_0x2d956b('0x2f'));return _0x1eedaa[_0x2d956b('0xc')](_0x32997f);}})['catch'](handleError(_0x1eedaa,null));};
\ No newline at end of file
+const a538_0x41fa=['sequelize','fields','toLower','upperFirst','preferred','filter','existsSync','findAll','default_favicon.ico','../../components/parsers/qs','download','VIRTUAL','body','loginLogo','type','count','rawAttributes','../../config/logger','limit','sort','defaultPreferred','status','intersection','set','where','addFavicon','getFavicon','default_preferred.png','getLicense','include','filename','logo','order','merge','undefined','then','query','model','offset','addLogoLogin','Setting','file','show','root','keys','default_loginLogo.svg','getLogo','default_logo.svg','params','custom','favicon','index','catch','addLogo','../../mysqldb','pick','send','name','json','nolimit','stack','\x20not\x20found','files/images/logos','options','includeAll','attributes','defaultFavicon','default','findOne','defaultLogo','addPreferred','length','fieldName','join','error','defaultLoginLogo','like','../../config/license/util','getLogoLogin','filters','Content-Range','getPreferred','map'];(function(_0x256728,_0x41fa72){const _0x14deee=function(_0x1ece47){while(--_0x1ece47){_0x256728['push'](_0x256728['shift']());}};_0x14deee(++_0x41fa72);}(a538_0x41fa,0x168));const a538_0x14de=function(_0x256728,_0x41fa72){_0x256728=_0x256728-0x0;let _0x14deee=a538_0x41fa[_0x256728];return _0x14deee;};const _0x491f0d=a538_0x14de;'use strict';const path=require('path'),fs=require('fs'),_=require('lodash'),qs=require(_0x491f0d('0x40')),logger=require(_0x491f0d('0x48'))('api'),config=require('../../config/environment'),db=require(_0x491f0d('0x1a'))['db'],{Op,ValidationError}=require(_0x491f0d('0x37')),utilLicense=require(_0x491f0d('0x31'));function respondWithResult(_0x1ece47,_0x5ce4ec){return _0x5ce4ec=_0x5ce4ec||0xc8,function(_0x540bf3){if(_0x540bf3)return _0x1ece47['status'](_0x5ce4ec)['json'](_0x540bf3);};}function respondWithFilteredResult(_0x261976,_0x1dd60a){return function(_0x903a0d){const _0x74b377=a538_0x14de;if(_0x903a0d){const _0x902cf2=_0x903a0d[_0x74b377('0x46')],_0x2bdb46=_0x1dd60a['offset'];let _0x5d15b1=_0x1dd60a[_0x74b377('0xa')]+_0x1dd60a[_0x74b377('0x49')],_0x2d842a;return _0x5d15b1>=_0x902cf2?(_0x5d15b1=_0x902cf2,_0x2d842a=0xc8):_0x2d842a=0xce,_0x261976[_0x74b377('0x4c')](_0x2d842a),_0x261976[_0x74b377('0x4e')](_0x74b377('0x34'),_0x2bdb46+'-'+_0x5d15b1+'/'+_0x902cf2)[_0x74b377('0x1e')](_0x903a0d);}return null;};}function saveUpdates(_0x294069){return function(_0x5b1521){const _0x8f37b=a538_0x14de;if(_0x5b1521)return _0x5b1521['update'](_0x294069)[_0x8f37b('0x7')](function(_0x2698da){return _0x2698da;});return null;};}function handleEntityNotFound(_0x1398e9){return function(_0x405ae7){return!_0x405ae7&&_0x1398e9['sendStatus'](0x194),_0x405ae7;};}function handleError(_0x36c40d,_0x4fa83a){return _0x4fa83a=_0x4fa83a||0x1f4,function(_0x4fe2c8){const _0x30d3b8=a538_0x14de;logger[_0x30d3b8('0x2e')](_0x4fe2c8[_0x30d3b8('0x20')]),_0x4fe2c8[_0x30d3b8('0x1d')]&&delete _0x4fe2c8[_0x30d3b8('0x1d')],_0x36c40d['status'](_0x4fa83a)[_0x30d3b8('0x1c')](_0x4fe2c8);};}exports[_0x491f0d('0x17')]=function(_0x2e4d12,_0x541266){const _0x4d2a42=_0x491f0d;let _0x193768={};const _0x1f36a9={},_0x1bb370={'count':0x0,'rows':[]},_0x2bcb84=_[_0x4d2a42('0x36')](db[_0x4d2a42('0xc')][_0x4d2a42('0x47')],function(_0x296617){const _0x46ab27=_0x4d2a42;return{'name':_0x296617[_0x46ab27('0x2c')],'type':_0x296617['type']['key']};});_0x1f36a9['model']=_[_0x4d2a42('0x36')](_0x2bcb84,'name'),_0x1f36a9[_0x4d2a42('0x8')]=_[_0x4d2a42('0x10')](_0x2e4d12[_0x4d2a42('0x8')]),_0x1f36a9['filters']=_['intersection'](_0x1f36a9[_0x4d2a42('0x9')],_0x1f36a9['query']),_0x193768[_0x4d2a42('0x25')]=_[_0x4d2a42('0x4d')](_0x1f36a9['model'],qs[_0x4d2a42('0x38')](_0x2e4d12['query']['fields'])),_0x193768[_0x4d2a42('0x25')]=_0x193768['attributes']['length']?_0x193768[_0x4d2a42('0x25')]:_0x1f36a9[_0x4d2a42('0x9')];typeof _0x2e4d12[_0x4d2a42('0x8')][_0x4d2a42('0x1f')]===_0x4d2a42('0x6')&&(_0x193768[_0x4d2a42('0x49')]=qs[_0x4d2a42('0x49')](_0x2e4d12[_0x4d2a42('0x8')][_0x4d2a42('0x49')]),_0x193768[_0x4d2a42('0xa')]=qs[_0x4d2a42('0xa')](_0x2e4d12[_0x4d2a42('0x8')][_0x4d2a42('0xa')]));_0x193768[_0x4d2a42('0x4')]=qs[_0x4d2a42('0x4a')](_0x2e4d12[_0x4d2a42('0x8')][_0x4d2a42('0x4a')]),_0x193768['where']=qs[_0x4d2a42('0x33')](_[_0x4d2a42('0x1b')](_0x2e4d12[_0x4d2a42('0x8')],_0x1f36a9[_0x4d2a42('0x33')]),_0x2bcb84);_0x2e4d12[_0x4d2a42('0x8')][_0x4d2a42('0x3c')]&&(_0x193768[_0x4d2a42('0x4f')]=_[_0x4d2a42('0x5')](_0x193768[_0x4d2a42('0x4f')],{[Op['or']]:_[_0x4d2a42('0x36')](_0x2bcb84,function(_0x32b083){const _0x1db908=_0x4d2a42;if(_0x32b083[_0x1db908('0x45')]!==_0x1db908('0x42')){const _0x5ecf63={};return _0x5ecf63[_0x32b083[_0x1db908('0x1d')]]={[Op[_0x1db908('0x30')]]:'%'+_0x2e4d12['query'][_0x1db908('0x3c')]+'%'},_0x5ecf63;}})}));_0x193768=_[_0x4d2a42('0x5')]({},_0x193768,_0x2e4d12[_0x4d2a42('0x23')]);const _0x593f0a={'where':_0x193768['where']};return db['Setting'][_0x4d2a42('0x46')](_0x593f0a)[_0x4d2a42('0x7')](function(_0x4ab506){const _0x43de25=_0x4d2a42;return _0x1bb370[_0x43de25('0x46')]=_0x4ab506,_0x2e4d12[_0x43de25('0x8')][_0x43de25('0x24')]&&(_0x193768[_0x43de25('0x1')]=[{'all':!![]}]),db['Setting'][_0x43de25('0x3e')](_0x193768);})[_0x4d2a42('0x7')](function(_0xee1b07){return _0x1bb370['rows']=_0xee1b07,_0x1bb370;})[_0x4d2a42('0x7')](respondWithFilteredResult(_0x541266,_0x193768))[_0x4d2a42('0x18')](handleError(_0x541266,null));},exports[_0x491f0d('0xe')]=function(_0x5dd5ef,_0x20adc2){const _0x518779=_0x491f0d;let _0x2d8236={'raw':![],'where':{'id':_0x5dd5ef['params']['id']}};const _0x4e3355={};return _0x4e3355['model']=_[_0x518779('0x10')](db[_0x518779('0xc')][_0x518779('0x47')]),_0x4e3355['query']=_[_0x518779('0x10')](_0x5dd5ef[_0x518779('0x8')]),_0x4e3355[_0x518779('0x33')]=_['intersection'](_0x4e3355[_0x518779('0x9')],_0x4e3355['query']),_0x2d8236[_0x518779('0x25')]=_[_0x518779('0x4d')](_0x4e3355[_0x518779('0x9')],qs[_0x518779('0x38')](_0x5dd5ef['query']['fields'])),_0x2d8236[_0x518779('0x25')]=_0x2d8236['attributes'][_0x518779('0x2b')]?_0x2d8236['attributes']:_0x4e3355[_0x518779('0x9')],_0x5dd5ef[_0x518779('0x8')][_0x518779('0x24')]&&(_0x2d8236[_0x518779('0x1')]=[{'all':!![]}]),_0x2d8236=_[_0x518779('0x5')]({},_0x2d8236,_0x5dd5ef['options']),db[_0x518779('0xc')]['findOne'](_0x2d8236)[_0x518779('0x7')](handleEntityNotFound(_0x20adc2,null))[_0x518779('0x7')](respondWithResult(_0x20adc2,null))[_0x518779('0x18')](handleError(_0x20adc2,null));},exports['update']=function(_0x306329,_0x4fd020){const _0x292777=_0x491f0d;return _0x306329[_0x292777('0x43')]['id']&&delete _0x306329[_0x292777('0x43')]['id'],db[_0x292777('0xc')][_0x292777('0x28')]({'where':{'id':_0x306329[_0x292777('0x14')]['id']}})[_0x292777('0x7')](handleEntityNotFound(_0x4fd020,null))['then'](saveUpdates(_0x306329[_0x292777('0x43')],null))[_0x292777('0x7')](respondWithResult(_0x4fd020,null))[_0x292777('0x18')](handleError(_0x4fd020,null));},exports[_0x491f0d('0x19')]=function(_0x927e9e,_0x29c73f){const _0x2b775d=_0x491f0d;return _0x927e9e['file']&&_0x927e9e[_0x2b775d('0xd')][_0x2b775d('0x2')]&&(_0x927e9e['body'][_0x2b775d('0x3')]=_0x927e9e['file']['filename']),db[_0x2b775d('0xc')][_0x2b775d('0x28')]({'where':{'id':_0x927e9e[_0x2b775d('0x14')]['id']}})[_0x2b775d('0x7')](handleEntityNotFound(_0x29c73f,null))[_0x2b775d('0x7')](saveUpdates(_0x927e9e[_0x2b775d('0x43')],null))[_0x2b775d('0x7')](respondWithResult(_0x29c73f,null))['catch'](handleError(_0x29c73f,null));},exports[_0x491f0d('0xb')]=function(_0x82b969,_0x5a9b10){const _0x3aa785=_0x491f0d;return _0x82b969[_0x3aa785('0xd')]&&_0x82b969[_0x3aa785('0xd')][_0x3aa785('0x2')]&&(_0x82b969[_0x3aa785('0x43')][_0x3aa785('0x44')]=_0x82b969[_0x3aa785('0xd')][_0x3aa785('0x2')]),db[_0x3aa785('0xc')]['findOne']({'where':{'id':_0x82b969[_0x3aa785('0x14')]['id']}})[_0x3aa785('0x7')](handleEntityNotFound(_0x5a9b10,null))[_0x3aa785('0x7')](saveUpdates(_0x82b969[_0x3aa785('0x43')],null))['then'](respondWithResult(_0x5a9b10,null))[_0x3aa785('0x18')](handleError(_0x5a9b10,null));},exports[_0x491f0d('0x12')]=function(_0x138936,_0x1e3929){const _0x575f79=_0x491f0d,_0x1fab58=path['join'](config[_0x575f79('0xf')],'files/images/logos');let _0x25e2c9={'custom':![]};return utilLicense[_0x575f79('0x0')]()['then'](function(_0x29338c){const _0xe62c2=_0x575f79;return _0x29338c&&(_0x25e2c9=_0x29338c),db['Setting'][_0xe62c2('0x28')]({'where':{'id':_0x138936[_0xe62c2('0x14')]['id']},'attributes':[_0xe62c2('0x3'),'loginLogo',_0xe62c2('0x3b'),'favicon',_0xe62c2('0x29'),_0xe62c2('0x2f'),_0xe62c2('0x4b'),'defaultFavicon'],'raw':!![]});})[_0x575f79('0x7')](handleEntityNotFound(_0x1e3929,null))[_0x575f79('0x7')](function(_0x39a9e3){const _0x245237=_0x575f79;if(_0x39a9e3){let _0x297f89=_0x39a9e3[_0x245237('0x3')]&&fs['existsSync'](path[_0x245237('0x2d')](_0x1fab58,_[_0x245237('0x39')](_0x39a9e3[_0x245237('0x3')])))?path['join'](_0x1fab58,_[_0x245237('0x39')](_0x39a9e3['logo'])):path[_0x245237('0x2d')](_0x1fab58,_['toLower'](_0x245237('0x13')));const _0x318132=_0x245237('0x27')+_[_0x245237('0x3a')](_0x245237('0x3'));(_0x39a9e3[_0x318132]||!_0x25e2c9[_0x245237('0x15')])&&(_0x297f89=path['join'](_0x1fab58,_[_0x245237('0x39')](_0x245237('0x13'))));if(!fs[_0x245237('0x3d')](_0x297f89))throw new ValidationError(_[_0x245237('0x3a')](_0x245237('0x3'))+'\x20not\x20found');return _0x1e3929['download'](_0x297f89);}})[_0x575f79('0x18')](handleError(_0x1e3929,null));},exports[_0x491f0d('0x32')]=function(_0x3c2cd8,_0xba2674){const _0x23758c=_0x491f0d,_0x36c809=path['join'](config[_0x23758c('0xf')],_0x23758c('0x22'));let _0x3cba1b={'custom':![]};return utilLicense[_0x23758c('0x0')]()[_0x23758c('0x7')](function(_0x304697){const _0x128cd2=_0x23758c;return _0x304697&&(_0x3cba1b=_0x304697),db[_0x128cd2('0xc')][_0x128cd2('0x28')]({'where':{'id':_0x3c2cd8['params']['id']},'attributes':[_0x128cd2('0x3'),_0x128cd2('0x44'),_0x128cd2('0x3b'),_0x128cd2('0x16'),'defaultLogo',_0x128cd2('0x2f'),_0x128cd2('0x4b'),_0x128cd2('0x26')],'raw':!![]});})[_0x23758c('0x7')](handleEntityNotFound(_0xba2674,null))[_0x23758c('0x7')](function(_0x1aae7a){const _0x5ee791=_0x23758c;if(_0x1aae7a){let _0x244d07=_0x1aae7a[_0x5ee791('0x44')]&&fs['existsSync'](path[_0x5ee791('0x2d')](_0x36c809,_[_0x5ee791('0x39')](_0x1aae7a[_0x5ee791('0x44')])))?path[_0x5ee791('0x2d')](_0x36c809,_[_0x5ee791('0x39')](_0x1aae7a['loginLogo'])):path['join'](_0x36c809,_[_0x5ee791('0x39')](_0x5ee791('0x11')));const _0x3a49f4='default'+_['upperFirst'](_0x5ee791('0x44'));(_0x1aae7a[_0x3a49f4]||!_0x3cba1b[_0x5ee791('0x15')])&&(_0x244d07=path[_0x5ee791('0x2d')](_0x36c809,_[_0x5ee791('0x39')](_0x5ee791('0x11'))));if(!fs['existsSync'](_0x244d07))throw new ValidationError(_[_0x5ee791('0x3a')](_0x5ee791('0x44'))+_0x5ee791('0x21'));return _0xba2674[_0x5ee791('0x41')](_0x244d07);}})[_0x23758c('0x18')](handleError(_0xba2674,null));},exports['gdpr']=function(_0x40da38,_0x3eb410){const _0x858b2=_0x491f0d;return db[_0x858b2('0xc')]['findOne']({'where':{'id':_0x40da38['params']['id']},'attributes':['securePassword']})[_0x858b2('0x7')](respondWithResult(_0x3eb410,null))[_0x858b2('0x18')](handleError(_0x3eb410,null));},exports[_0x491f0d('0x2a')]=function(_0x1a2661,_0x457722){const _0x23e6d0=_0x491f0d;return _0x1a2661[_0x23e6d0('0xd')]&&_0x1a2661[_0x23e6d0('0xd')]['filename']&&(_0x1a2661[_0x23e6d0('0x43')]['preferred']=_0x1a2661[_0x23e6d0('0xd')][_0x23e6d0('0x2')]),db[_0x23e6d0('0xc')][_0x23e6d0('0x28')]({'where':{'id':_0x1a2661[_0x23e6d0('0x14')]['id']}})[_0x23e6d0('0x7')](handleEntityNotFound(_0x457722,null))[_0x23e6d0('0x7')](saveUpdates(_0x1a2661[_0x23e6d0('0x43')],null))[_0x23e6d0('0x7')](respondWithResult(_0x457722,null))[_0x23e6d0('0x18')](handleError(_0x457722,null));},exports[_0x491f0d('0x35')]=function(_0x12a40d,_0x1452d6){const _0x77ae7d=_0x491f0d,_0x2760df=path[_0x77ae7d('0x2d')](config[_0x77ae7d('0xf')],'files/images/logos');let _0x23e595={'custom':![]};return utilLicense['getLicense']()[_0x77ae7d('0x7')](function(_0x86422d){const _0x2e5b54=_0x77ae7d;return _0x86422d&&(_0x23e595=_0x86422d),db[_0x2e5b54('0xc')][_0x2e5b54('0x28')]({'where':{'id':_0x12a40d[_0x2e5b54('0x14')]['id']},'attributes':[_0x2e5b54('0x3'),_0x2e5b54('0x44'),_0x2e5b54('0x3b'),_0x2e5b54('0x16'),_0x2e5b54('0x29'),_0x2e5b54('0x2f'),_0x2e5b54('0x4b'),_0x2e5b54('0x26')],'raw':!![]});})[_0x77ae7d('0x7')](handleEntityNotFound(_0x1452d6,null))['then'](function(_0x3411e7){const _0x3132b0=_0x77ae7d;if(_0x3411e7){let _0x5dfb0a=_0x3411e7[_0x3132b0('0x3b')]&&fs[_0x3132b0('0x3d')](path[_0x3132b0('0x2d')](_0x2760df,_[_0x3132b0('0x39')](_0x3411e7[_0x3132b0('0x3b')])))?path[_0x3132b0('0x2d')](_0x2760df,_[_0x3132b0('0x39')](_0x3411e7[_0x3132b0('0x3b')])):path[_0x3132b0('0x2d')](_0x2760df,_['toLower'](_0x3132b0('0x52')));const _0x5824a7=_0x3132b0('0x27')+_[_0x3132b0('0x3a')](_0x3132b0('0x3b'));(_0x3411e7[_0x5824a7]||!_0x23e595[_0x3132b0('0x15')]||!_0x23e595['preferred'])&&(_0x5dfb0a=path[_0x3132b0('0x2d')](_0x2760df,_['toLower']('default_preferred.png')));if(!fs[_0x3132b0('0x3d')](_0x5dfb0a))throw new ValidationError(_['upperFirst'](_0x3132b0('0x3b'))+_0x3132b0('0x21'));return _0x1452d6['download'](_0x5dfb0a);}})['catch'](handleError(_0x1452d6,null));},exports[_0x491f0d('0x50')]=function(_0x3e65ed,_0x3a2758){const _0x582bf1=_0x491f0d;return _0x3e65ed[_0x582bf1('0xd')]&&_0x3e65ed[_0x582bf1('0xd')][_0x582bf1('0x2')]&&(_0x3e65ed[_0x582bf1('0x43')][_0x582bf1('0x16')]=_0x3e65ed['file'][_0x582bf1('0x2')]),db[_0x582bf1('0xc')][_0x582bf1('0x28')]({'where':{'id':_0x3e65ed['params']['id']}})['then'](handleEntityNotFound(_0x3a2758,null))[_0x582bf1('0x7')](saveUpdates(_0x3e65ed[_0x582bf1('0x43')],null))[_0x582bf1('0x7')](respondWithResult(_0x3a2758,null))['catch'](handleError(_0x3a2758,null));},exports[_0x491f0d('0x51')]=function(_0x2070c6,_0x377abd){const _0x39e824=_0x491f0d,_0x38f55c=path[_0x39e824('0x2d')](config[_0x39e824('0xf')],'files/images/logos');let _0x5a23ee={'custom':![]};return utilLicense[_0x39e824('0x0')]()[_0x39e824('0x7')](function(_0x5cd16d){const _0x28c175=_0x39e824;return _0x5cd16d&&(_0x5a23ee=_0x5cd16d),db[_0x28c175('0xc')]['findOne']({'where':{'id':_0x2070c6['params']['id']},'attributes':['logo',_0x28c175('0x44'),'preferred',_0x28c175('0x16'),_0x28c175('0x29'),_0x28c175('0x2f'),_0x28c175('0x4b'),_0x28c175('0x26')],'raw':!![]});})['then'](handleEntityNotFound(_0x377abd,null))[_0x39e824('0x7')](function(_0x2182db){const _0x10397f=_0x39e824;if(_0x2182db){let _0x5adb65=_0x2182db[_0x10397f('0x16')]&&fs[_0x10397f('0x3d')](path['join'](_0x38f55c,_['toLower'](_0x2182db[_0x10397f('0x16')])))?path['join'](_0x38f55c,_[_0x10397f('0x39')](_0x2182db[_0x10397f('0x16')])):path['join'](_0x38f55c,_[_0x10397f('0x39')](_0x10397f('0x3f')));const _0x1434bb=_0x10397f('0x27')+_[_0x10397f('0x3a')](_0x10397f('0x16'));(_0x2182db[_0x1434bb]||!_0x5a23ee['custom'])&&(_0x5adb65=path['join'](_0x38f55c,_[_0x10397f('0x39')](_0x10397f('0x3f'))));if(!fs[_0x10397f('0x3d')](_0x5adb65))throw new ValidationError(_[_0x10397f('0x3a')](_0x10397f('0x16'))+'\x20not\x20found');return _0x377abd[_0x10397f('0x41')](_0x5adb65);}})[_0x39e824('0x18')](handleError(_0x377abd,null));};
\ No newline at end of file