Built motion from commit 5fcd269f5146f10cf3129722d518881dfac64576. Version 3.0.0...
[motion-next.git] / server / api / dashboard / dashboard.controller.js
index 91e6bf9..3929fdf 100644 (file)
@@ -1 +1 @@
-const a168_0x3e49=['pick','attrRefresh','intersection','api','update','Content-Range','fieldName','attrFontSize','attrSerie1','createdAt','stack','merge','where','set','limit','include','autoAssociation','../../mysqldb','length','name','like','attrs','Unable\x20to\x20retrieve\x20the\x20current\x20user','DashboardId','addItem','create','user','destroy','stringify','attributes','options','offset','attrReport','0.00','attrMetric','DashboardItem','fields','includeAll','getItems','https://','catch','register','attrPath','total','pie-chart','sendStatus','findAll','nolimit','json','./dashboard.socket','value','error','findOne','index','counter','attrTimezone','Dashboard','count','clone','custom','multibar-chart','VIRTUAL','lodash','HH:mm:ss','../../rediscache','iframe','widgetAttributes:\x20%s','key','body','attrSerie2','params','sort','UserProfileSection','map','send','type','attrVoiceQueues','role','keys','omit','userProfileId','undefined','updatedAt','UserProfileResource','filters','rows','then','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','order','query','CustomDashboards','get','sequelize','status','filter','rawAttributes','attrHourFormat','model'];(function(_0x2ad81d,_0x3e492f){const _0xa9bdbb=function(_0x530118){while(--_0x530118){_0x2ad81d['push'](_0x2ad81d['shift']());}};_0xa9bdbb(++_0x3e492f);}(a168_0x3e49,0x191));const a168_0xa9bd=function(_0x2ad81d,_0x3e492f){_0x2ad81d=_0x2ad81d-0x0;let _0xa9bdbb=a168_0x3e49[_0x2ad81d];return _0xa9bdbb;};const _0x148b57=a168_0xa9bd;'use strict';const _=require(_0x148b57('0x35')),qs=require('../../components/parsers/qs'),logger=require('../../config/logger')(_0x148b57('0x5c')),{getSocket}=require(_0x148b57('0x37')),socket=getSocket(),db=require(_0x148b57('0x8'))['db'],{Op}=require(_0x148b57('0x53'));require(_0x148b57('0x28'))[_0x148b57('0x20')](socket);function respondWithResult(_0x530118,_0x170d73){return _0x170d73=_0x170d73||0xc8,function(_0x44cc47){const _0x57494e=a168_0xa9bd;if(_0x44cc47)return _0x530118['status'](_0x170d73)[_0x57494e('0x27')](_0x44cc47);};}function respondWithFilteredResult(_0x2e33b4,_0x5e196b){return function(_0x5867cb){const _0x30d658=a168_0xa9bd;if(_0x5867cb){const _0x26a03d=_0x5867cb[_0x30d658('0x30')],_0x584f23=_0x5e196b[_0x30d658('0x16')];let _0x408e96=_0x5e196b[_0x30d658('0x16')]+_0x5e196b[_0x30d658('0x5')],_0x3c675d;return _0x408e96>=_0x26a03d?(_0x408e96=_0x26a03d,_0x3c675d=0xc8):_0x3c675d=0xce,_0x2e33b4[_0x30d658('0x54')](_0x3c675d),_0x2e33b4[_0x30d658('0x4')](_0x30d658('0x5e'),_0x584f23+'-'+_0x408e96+'/'+_0x26a03d)[_0x30d658('0x27')](_0x5867cb);}return null;};}function saveUpdates(_0x5ac9d9){return function(_0x181a92){const _0x2b925c=a168_0xa9bd;if(_0x181a92)return _0x181a92[_0x2b925c('0x5d')](_0x5ac9d9)[_0x2b925c('0x4d')](function(_0x1efe51){return _0x1efe51;});return null;};}function removeEntity(_0xdd99f){return function(_0x13d458){const _0x2070f7=a168_0xa9bd;if(_0x13d458)return _0x13d458[_0x2070f7('0x12')]()[_0x2070f7('0x4d')](function(){const _0x2d1f8f=_0x2070f7,_0x568ff2=_0x13d458[_0x2d1f8f('0x52')]({'plain':!![]}),_0x542525=_0x2d1f8f('0x51');return db[_0x2d1f8f('0x4a')][_0x2d1f8f('0x12')]({'where':{'type':_0x542525,'resourceId':_0x568ff2['id']}})[_0x2d1f8f('0x4d')](function(){return _0x13d458;});})['then'](function(){const _0x4ae7d3=_0x2070f7;_0xdd99f[_0x4ae7d3('0x54')](0xcc)['end']();});};}function handleEntityNotFound(_0x5cc5dc){return function(_0x42cc83){const _0xa9711a=a168_0xa9bd;return!_0x42cc83&&_0x5cc5dc[_0xa9711a('0x24')](0x194),_0x42cc83;};}function handleError(_0x5a7ef1,_0x2910e4){return _0x2910e4=_0x2910e4||0x1f4,function(_0x1c98d3){const _0x4232e0=a168_0xa9bd;logger[_0x4232e0('0x2a')](_0x1c98d3[_0x4232e0('0x1')]),_0x1c98d3['name']&&delete _0x1c98d3['name'],_0x5a7ef1[_0x4232e0('0x54')](_0x2910e4)[_0x4232e0('0x41')](_0x1c98d3);};}exports[_0x148b57('0x2c')]=function(_0x2bb4df,_0x3f02a7){const _0x20c0ea=_0x148b57;let _0xa1c349={};const _0x4fca52={},_0x11d1ae={'count':0x0,'rows':[]},_0x3e35f4=_[_0x20c0ea('0x40')](db[_0x20c0ea('0x2f')]['rawAttributes'],function(_0x51de94){const _0x18b8e2=_0x20c0ea;return{'name':_0x51de94[_0x18b8e2('0x5f')],'type':_0x51de94[_0x18b8e2('0x42')][_0x18b8e2('0x3a')]};});_0x4fca52['model']=_['map'](_0x3e35f4,_0x20c0ea('0xa')),_0x4fca52[_0x20c0ea('0x50')]=_[_0x20c0ea('0x45')](_0x2bb4df[_0x20c0ea('0x50')]),_0x4fca52[_0x20c0ea('0x4b')]=_[_0x20c0ea('0x5b')](_0x4fca52[_0x20c0ea('0x58')],_0x4fca52['query']),_0xa1c349[_0x20c0ea('0x14')]=_[_0x20c0ea('0x5b')](_0x4fca52[_0x20c0ea('0x58')],qs[_0x20c0ea('0x1b')](_0x2bb4df['query'][_0x20c0ea('0x1b')])),_0xa1c349['attributes']=_0xa1c349['attributes'][_0x20c0ea('0x9')]?_0xa1c349['attributes']:_0x4fca52[_0x20c0ea('0x58')];typeof _0x2bb4df[_0x20c0ea('0x50')][_0x20c0ea('0x26')]===_0x20c0ea('0x48')&&(_0xa1c349[_0x20c0ea('0x5')]=qs[_0x20c0ea('0x5')](_0x2bb4df[_0x20c0ea('0x50')][_0x20c0ea('0x5')]),_0xa1c349[_0x20c0ea('0x16')]=qs[_0x20c0ea('0x16')](_0x2bb4df['query'][_0x20c0ea('0x16')]));_0xa1c349['order']=qs[_0x20c0ea('0x3e')](_0x2bb4df['query'][_0x20c0ea('0x3e')]),_0xa1c349[_0x20c0ea('0x3')]=qs[_0x20c0ea('0x4b')](_[_0x20c0ea('0x59')](_0x2bb4df[_0x20c0ea('0x50')],_0x4fca52[_0x20c0ea('0x4b')]),_0x3e35f4);_0x2bb4df[_0x20c0ea('0x50')]['filter']&&(_0xa1c349[_0x20c0ea('0x3')]=_[_0x20c0ea('0x2')](_0xa1c349['where'],{[Op['or']]:_[_0x20c0ea('0x40')](_0x3e35f4,function(_0x84edbc){const _0x53f52a=_0x20c0ea;if(_0x84edbc[_0x53f52a('0x42')]!==_0x53f52a('0x34')){const _0x157d00={};return _0x157d00[_0x84edbc[_0x53f52a('0xa')]]={[Op[_0x53f52a('0xb')]]:'%'+_0x2bb4df[_0x53f52a('0x50')][_0x53f52a('0x55')]+'%'},_0x157d00;}})}));_0xa1c349=_['merge']({},_0xa1c349,_0x2bb4df['options']);const _0x30faa5={'where':_0xa1c349['where']};return db[_0x20c0ea('0x2f')][_0x20c0ea('0x30')](_0x30faa5)[_0x20c0ea('0x4d')](function(_0x3ef30a){const _0xe9631a=_0x20c0ea;return _0x11d1ae[_0xe9631a('0x30')]=_0x3ef30a,_0x2bb4df[_0xe9631a('0x50')][_0xe9631a('0x1c')]&&(_0xa1c349[_0xe9631a('0x6')]=[{'all':!![]}]),db['Dashboard'][_0xe9631a('0x25')](_0xa1c349);})[_0x20c0ea('0x4d')](function(_0x4c01c6){const _0x1bbf82=_0x20c0ea;return _0x11d1ae[_0x1bbf82('0x4c')]=_0x4c01c6,_0x11d1ae;})[_0x20c0ea('0x4d')](respondWithFilteredResult(_0x3f02a7,_0xa1c349))[_0x20c0ea('0x1f')](handleError(_0x3f02a7,null));},exports['show']=function(_0x237fbc,_0x2d72c2){const _0x329a83=_0x148b57;let _0x40791e={'raw':![],'where':{'id':_0x237fbc[_0x329a83('0x3d')]['id']}};const _0x4d99e3={};return _0x4d99e3[_0x329a83('0x58')]=_['keys'](db[_0x329a83('0x2f')]['rawAttributes']),_0x4d99e3[_0x329a83('0x50')]=_[_0x329a83('0x45')](_0x237fbc[_0x329a83('0x50')]),_0x4d99e3[_0x329a83('0x4b')]=_[_0x329a83('0x5b')](_0x4d99e3['model'],_0x4d99e3['query']),_0x40791e[_0x329a83('0x14')]=_['intersection'](_0x4d99e3['model'],qs[_0x329a83('0x1b')](_0x237fbc[_0x329a83('0x50')][_0x329a83('0x1b')])),_0x40791e[_0x329a83('0x14')]=_0x40791e[_0x329a83('0x14')]['length']?_0x40791e['attributes']:_0x4d99e3[_0x329a83('0x58')],_0x237fbc[_0x329a83('0x50')][_0x329a83('0x1c')]&&(_0x40791e['include']=[{'all':!![]}]),_0x40791e=_[_0x329a83('0x2')]({},_0x40791e,_0x237fbc['options']),db[_0x329a83('0x2f')]['findOne'](_0x40791e)['then'](handleEntityNotFound(_0x2d72c2,null))[_0x329a83('0x4d')](respondWithResult(_0x2d72c2,null))['catch'](handleError(_0x2d72c2,null));},exports['create']=function(_0x344d8b,_0x50ff36){const _0x14fe68=_0x148b57;return db[_0x14fe68('0x2f')][_0x14fe68('0x10')](_0x344d8b['body'],{})[_0x14fe68('0x4d')](function(_0xe14f2c){const _0x39fe95=_0x14fe68,_0x493347=_0x344d8b[_0x39fe95('0x11')][_0x39fe95('0x52')]({'plain':!![]});if(!_0x493347)throw new Error(_0x39fe95('0xd'));if(_0x493347['role']==='user'){const _0x48ef50=_0xe14f2c[_0x39fe95('0x52')]({'plain':!![]}),_0x21f2b1='CustomDashboards';return db[_0x39fe95('0x3f')][_0x39fe95('0x2b')]({'where':{'name':_0x21f2b1,'userProfileId':_0x493347[_0x39fe95('0x47')]},'raw':!![]})[_0x39fe95('0x4d')](function(_0x476b14){const _0x498bc7=_0x39fe95;return _0x476b14&&_0x476b14[_0x498bc7('0x7')]===0x0?db[_0x498bc7('0x4a')][_0x498bc7('0x10')]({'name':_0x48ef50[_0x498bc7('0xa')],'resourceId':_0x48ef50['id'],'type':_0x476b14[_0x498bc7('0xa')],'sectionId':_0x476b14['id']},{})[_0x498bc7('0x4d')](function(){return _0xe14f2c;}):_0xe14f2c;})[_0x39fe95('0x1f')](function(_0xb5692d){const _0x22a8e6=_0x39fe95;logger[_0x22a8e6('0x2a')](_0x22a8e6('0x4e'),_0xb5692d);throw _0xb5692d;});}return _0xe14f2c;})[_0x14fe68('0x4d')](respondWithResult(_0x50ff36,0xc9))[_0x14fe68('0x1f')](handleError(_0x50ff36,null));},exports[_0x148b57('0x31')]=function(_0x2e6c38,_0x7dc4e8){const _0x145c55=_0x148b57;let _0xb77343={'where':{'id':_0x2e6c38['params']['id']}};const _0x49783e={};return _0x49783e[_0x145c55('0x58')]=_[_0x145c55('0x45')](db[_0x145c55('0x2f')][_0x145c55('0x56')]),_0xb77343[_0x145c55('0x14')]=_[_0x145c55('0x5b')](_0x49783e[_0x145c55('0x58')],qs[_0x145c55('0x1b')](_0x2e6c38[_0x145c55('0x50')][_0x145c55('0x1b')])),_0xb77343[_0x145c55('0x14')]=_0xb77343[_0x145c55('0x14')]['length']?_0xb77343[_0x145c55('0x14')]:_0x49783e[_0x145c55('0x58')],_0x2e6c38[_0x145c55('0x50')][_0x145c55('0x1c')]&&(_0xb77343[_0x145c55('0x6')]=[{'all':!![]}]),_0xb77343=_[_0x145c55('0x2')]({},_0xb77343,_0x2e6c38['options']),db['Dashboard'][_0x145c55('0x2b')](_0xb77343)[_0x145c55('0x4d')](handleEntityNotFound(_0x7dc4e8,null))[_0x145c55('0x4d')](function(_0x57a9dc){const _0x2451ae=_0x145c55;if(_0x57a9dc){let _0x2532a0=_0x57a9dc[_0x2451ae('0x52')]({'plain':!![]});return _0x2532a0=qs['omit'](_0x2532a0,['id',_0x2451ae('0x0'),'updatedAt']),_0x2e6c38[_0x2451ae('0x3b')]=_[_0x2451ae('0x46')](_0x2e6c38[_0x2451ae('0x3b')],['id',_0x2451ae('0x0'),_0x2451ae('0x49')]),db[_0x2451ae('0x2f')][_0x2451ae('0x10')](_['merge'](_0x2532a0,_0x2e6c38['body']),{'include':_0x2e6c38[_0x2451ae('0x50')]['includeAll']?[{'all':!![]}]:undefined})[_0x2451ae('0x4d')](function(_0x2adc04){const _0x519344=_0x2451ae,_0x32aef3=_0x2e6c38[_0x519344('0x11')]['get']({'plain':!![]});if(!_0x32aef3)throw new Error(_0x519344('0xd'));if(_0x32aef3[_0x519344('0x44')]===_0x519344('0x11')){const _0x11f794=_0x2adc04[_0x519344('0x52')]({'plain':!![]}),_0x3cf302=_0x519344('0x51');return db[_0x519344('0x3f')][_0x519344('0x2b')]({'where':{'name':_0x3cf302,'userProfileId':_0x32aef3[_0x519344('0x47')]},'raw':!![]})['then'](function(_0x5c456f){const _0x826d72=_0x519344;return _0x5c456f&&_0x5c456f[_0x826d72('0x7')]===0x0?db[_0x826d72('0x4a')][_0x826d72('0x10')]({'name':_0x11f794[_0x826d72('0xa')],'resourceId':_0x11f794['id'],'type':_0x5c456f[_0x826d72('0xa')],'sectionId':_0x5c456f['id']},{})[_0x826d72('0x4d')](function(){return _0x2adc04;}):_0x2adc04;})[_0x519344('0x1f')](function(_0x48cffd){const _0x5e4a55=_0x519344;logger['error'](_0x5e4a55('0x4e'),_0x48cffd);throw _0x48cffd;});}return _0x2adc04;});}})[_0x145c55('0x4d')](respondWithResult(_0x7dc4e8,0xc9))['catch'](handleError(_0x7dc4e8,null));},exports[_0x148b57('0x5d')]=function(_0x291cce,_0x1ddef1){const _0x34863b=_0x148b57;return _0x291cce[_0x34863b('0x3b')]['id']&&delete _0x291cce[_0x34863b('0x3b')]['id'],db[_0x34863b('0x2f')]['findOne']({'where':{'id':_0x291cce[_0x34863b('0x3d')]['id']}})[_0x34863b('0x4d')](handleEntityNotFound(_0x1ddef1,null))[_0x34863b('0x4d')](saveUpdates(_0x291cce[_0x34863b('0x3b')],null))[_0x34863b('0x4d')](respondWithResult(_0x1ddef1,null))[_0x34863b('0x1f')](handleError(_0x1ddef1,null));},exports[_0x148b57('0x12')]=function(_0x1dcb15,_0xc9085b){const _0x1d55f6=_0x148b57;return db[_0x1d55f6('0x2f')][_0x1d55f6('0x2b')]({'where':{'id':_0x1dcb15[_0x1d55f6('0x3d')]['id']}})[_0x1d55f6('0x4d')](handleEntityNotFound(_0xc9085b,null))[_0x1d55f6('0x4d')](removeEntity(_0xc9085b,null))[_0x1d55f6('0x1f')](handleError(_0xc9085b,null));};function widgetAttributes(_0x2fcb1a){const _0x4125eb=_0x148b57;try{switch(_0x2fcb1a[_0x4125eb('0x42')]){case _0x4125eb('0x38'):return[{'name':'attrUrl','value':_0x2fcb1a['attrUrl']||(_0x2fcb1a['attrs']&&_0x2fcb1a[_0x4125eb('0xc')][0x0]?_0x2fcb1a[_0x4125eb('0xc')][0x0][_0x4125eb('0x29')]:undefined)||_0x4125eb('0x1e')}];case _0x4125eb('0x32'):return[{'name':_0x4125eb('0x21'),'value':_0x2fcb1a['attrPath']||(_0x2fcb1a['attrs']&&_0x2fcb1a[_0x4125eb('0xc')][0x0]?_0x2fcb1a[_0x4125eb('0xc')][0x0]['value']:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x2fcb1a[_0x4125eb('0x57')]||(_0x2fcb1a[_0x4125eb('0xc')]&&_0x2fcb1a[_0x4125eb('0xc')][0x0]?_0x2fcb1a[_0x4125eb('0xc')][0x0][_0x4125eb('0x29')]:undefined)||_0x4125eb('0x36')},{'name':_0x4125eb('0x2e'),'value':_0x2fcb1a[_0x4125eb('0x2e')]||(_0x2fcb1a['attrs']&&_0x2fcb1a[_0x4125eb('0xc')][0x1]?_0x2fcb1a[_0x4125eb('0xc')][0x1][_0x4125eb('0x29')]:undefined)||_0x4125eb('0x18')},{'name':_0x4125eb('0x60'),'value':_0x2fcb1a[_0x4125eb('0x60')]||(_0x2fcb1a['attrs']&&_0x2fcb1a[_0x4125eb('0xc')][0x2]?_0x2fcb1a[_0x4125eb('0xc')][0x2]['value']:undefined)||0xc}];case _0x4125eb('0x2d'):return[{'name':'attrMetric','value':_0x2fcb1a[_0x4125eb('0x19')]||(_0x2fcb1a[_0x4125eb('0xc')]&&_0x2fcb1a[_0x4125eb('0xc')][0x0]?_0x2fcb1a['attrs'][0x0][_0x4125eb('0x29')]:undefined)||_0x4125eb('0x22')},{'name':'attrVoiceQueues','value':_0x2fcb1a['attrVoiceQueues']||(_0x2fcb1a['attrs']&&_0x2fcb1a[_0x4125eb('0xc')][0x1]?_0x2fcb1a[_0x4125eb('0xc')][0x1][_0x4125eb('0x29')]:undefined)||[]},{'name':_0x4125eb('0x60'),'value':_0x2fcb1a[_0x4125eb('0x60')]||(_0x2fcb1a[_0x4125eb('0xc')]&&_0x2fcb1a[_0x4125eb('0xc')][0x2]?_0x2fcb1a[_0x4125eb('0xc')][0x2][_0x4125eb('0x29')]:undefined)||0x14}];case _0x4125eb('0x33'):case _0x4125eb('0x23'):return[{'name':_0x4125eb('0x61'),'value':_0x2fcb1a[_0x4125eb('0x61')]||(_0x2fcb1a[_0x4125eb('0xc')]&&_0x2fcb1a['attrs'][0x0]?_0x2fcb1a[_0x4125eb('0xc')][0x0]['value']:undefined)||'total'},{'name':_0x4125eb('0x3c'),'value':_0x2fcb1a[_0x4125eb('0x3c')]||(_0x2fcb1a[_0x4125eb('0xc')]&&_0x2fcb1a[_0x4125eb('0xc')][0x1]?_0x2fcb1a[_0x4125eb('0xc')][0x1][_0x4125eb('0x29')]:undefined)||null},{'name':'attrSerie3','value':_0x2fcb1a['attrSerie3']||(_0x2fcb1a[_0x4125eb('0xc')]&&_0x2fcb1a[_0x4125eb('0xc')][0x2]?_0x2fcb1a[_0x4125eb('0xc')][0x2][_0x4125eb('0x29')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x2fcb1a[_0x4125eb('0x43')]||(_0x2fcb1a[_0x4125eb('0xc')]&&_0x2fcb1a['attrs'][0x3]?_0x2fcb1a[_0x4125eb('0xc')][0x3][_0x4125eb('0x29')]:undefined)||[]}];case'web-report':return[{'name':'attrReport','type':_0x2fcb1a['reportType']||(_0x2fcb1a[_0x4125eb('0xc')]&&_0x2fcb1a[_0x4125eb('0xc')][0x0]?_0x2fcb1a[_0x4125eb('0xc')][0x0]['type']:undefined)||null,'value':_0x2fcb1a[_0x4125eb('0x17')]||(_0x2fcb1a[_0x4125eb('0xc')]&&_0x2fcb1a[_0x4125eb('0xc')][0x0]?_0x2fcb1a['attrs'][0x0][_0x4125eb('0x29')]:undefined)||null},{'name':_0x4125eb('0x5a'),'value':_0x2fcb1a[_0x4125eb('0x5a')]||(_0x2fcb1a[_0x4125eb('0xc')]&&_0x2fcb1a[_0x4125eb('0xc')][0x1]?_0x2fcb1a[_0x4125eb('0xc')][0x1][_0x4125eb('0x29')]:undefined)||0x0}];default:return[];}}catch(_0x2fd643){return logger[_0x4125eb('0x2a')](_0x4125eb('0x39'),JSON[_0x4125eb('0x13')](_0x2fd643)),[];}}exports[_0x148b57('0xf')]=function(_0x507d12,_0x7c4e76){const _0x42c052=_0x148b57;return _0x507d12[_0x42c052('0x3b')]['id']&&delete _0x507d12[_0x42c052('0x3b')]['id'],db[_0x42c052('0x2f')]['findOne']({'where':{'id':_0x507d12['params']['id']}})[_0x42c052('0x4d')](handleEntityNotFound(_0x7c4e76,null))[_0x42c052('0x4d')](function(_0x90c17c){const _0x208df4=_0x42c052;if(_0x90c17c)return _0x507d12['body'][_0x208df4('0xe')]=_0x90c17c['id'],_0x507d12[_0x208df4('0x3b')][_0x208df4('0xc')]=widgetAttributes(_0x507d12[_0x208df4('0x3b')]),db[_0x208df4('0x1a')][_0x208df4('0x10')](_0x507d12[_0x208df4('0x3b')]);})[_0x42c052('0x4d')](respondWithResult(_0x7c4e76,null))[_0x42c052('0x1f')](handleError(_0x7c4e76,null));},exports[_0x148b57('0x1d')]=function(_0x2b1360,_0x2cfd7c){const _0x3793e1=_0x148b57;let _0x44682f={};const _0x58ec60={};let _0x444aa4,_0x51ca0d;return db[_0x3793e1('0x2f')][_0x3793e1('0x2b')]({'where':{'id':_0x2b1360[_0x3793e1('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2cfd7c,null))[_0x3793e1('0x4d')](function(_0x4a184f){const _0x18de0f=_0x3793e1;if(_0x4a184f)return _0x444aa4=_0x4a184f,_0x58ec60[_0x18de0f('0x58')]=_[_0x18de0f('0x45')](db[_0x18de0f('0x1a')]['rawAttributes']),_0x58ec60['query']=_['keys'](_0x2b1360['query']),_0x58ec60[_0x18de0f('0x4b')]=_[_0x18de0f('0x5b')](_0x58ec60[_0x18de0f('0x58')],_0x58ec60[_0x18de0f('0x50')]),_0x44682f[_0x18de0f('0x14')]=_[_0x18de0f('0x5b')](_0x58ec60[_0x18de0f('0x58')],qs[_0x18de0f('0x1b')](_0x2b1360[_0x18de0f('0x50')]['fields'])),_0x44682f[_0x18de0f('0x14')]=_0x44682f[_0x18de0f('0x14')][_0x18de0f('0x9')]?_0x44682f['attributes']:_0x58ec60[_0x18de0f('0x58')],_0x44682f[_0x18de0f('0x4f')]=qs[_0x18de0f('0x3e')](_0x2b1360[_0x18de0f('0x50')][_0x18de0f('0x3e')]),_0x44682f[_0x18de0f('0x3')]=qs['filters'](_[_0x18de0f('0x59')](_0x2b1360[_0x18de0f('0x50')],_0x58ec60['filters'])),_0x2b1360[_0x18de0f('0x50')]['filter']&&(_0x44682f[_0x18de0f('0x3')]=_[_0x18de0f('0x2')](_0x44682f['where'],{[Op['or']]:_[_0x18de0f('0x40')](_0x44682f['attributes'],function(_0x4f1953){const _0x534f5f=_0x18de0f,_0x39af5d={};return _0x39af5d[_0x4f1953]={[Op['like']]:'%'+_0x2b1360[_0x534f5f('0x50')][_0x534f5f('0x55')]+'%'},_0x39af5d;})})),_0x44682f=_[_0x18de0f('0x2')]({},_0x44682f,_0x2b1360[_0x18de0f('0x15')]),_0x444aa4[_0x18de0f('0x1d')](_0x44682f);})[_0x3793e1('0x4d')](function(_0x51057e){const _0x248b1c=_0x3793e1;if(_0x51057e)return _0x51ca0d=_0x51057e[_0x248b1c('0x9')],typeof _0x2b1360[_0x248b1c('0x50')][_0x248b1c('0x26')]===_0x248b1c('0x48')&&(_0x44682f[_0x248b1c('0x5')]=qs[_0x248b1c('0x5')](_0x2b1360[_0x248b1c('0x50')][_0x248b1c('0x5')]),_0x44682f[_0x248b1c('0x16')]=qs[_0x248b1c('0x16')](_0x2b1360[_0x248b1c('0x50')]['offset'])),_0x444aa4[_0x248b1c('0x1d')](_0x44682f);})[_0x3793e1('0x4d')](function(_0x509b13){if(_0x509b13)return _0x509b13?{'count':_0x51ca0d,'rows':_0x509b13}:null;})[_0x3793e1('0x4d')](respondWithResult(_0x2cfd7c,null))[_0x3793e1('0x1f')](handleError(_0x2cfd7c,null));};
\ No newline at end of file
+const a168_0x2a53=['HH:mm:ss','sendStatus','where','order','model','clock','query','counter','stringify','findOne','sort','catch','attrMetric','undefined','attrs','register','get','set','create','offset','user','lodash','https://','merge','attrUrl','attributes','total','UserProfileSection','body','destroy','keys','intersection','DashboardItem','fieldName','attrReport','attrFontSize','json','createdAt','omit','update','../../components/parsers/qs','attrRefresh','limit','getItems','./dashboard.socket','clone','findAll','iframe','type','web-report','autoAssociation','../../rediscache','attrVoiceQueues','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','../../config/logger','count','reportType','multibar-chart','rawAttributes','value','userProfileId','nolimit','widgetAttributes:\x20%s','attrPath','../../mysqldb','filter','fields','include','index','map','status','params','options','name','length','pick','attrTimezone','custom','end','attrSerie3','rows','role','addItem','error','CustomDashboards','Content-Range','attrSerie2','filters','then','includeAll','updatedAt','like','attrHourFormat','Dashboard','0.00','UserProfileResource'];(function(_0x1bd12f,_0x2a53ba){const _0xfc459=function(_0x2d10c8){while(--_0x2d10c8){_0x1bd12f['push'](_0x1bd12f['shift']());}};_0xfc459(++_0x2a53ba);}(a168_0x2a53,0x158));const a168_0xfc45=function(_0x1bd12f,_0x2a53ba){_0x1bd12f=_0x1bd12f-0x0;let _0xfc459=a168_0x2a53[_0x1bd12f];return _0xfc459;};const _0x21e2e2=a168_0xfc45;'use strict';const _=require(_0x21e2e2('0x3d')),qs=require(_0x21e2e2('0x50')),logger=require(_0x21e2e2('0x5e'))('api'),{getSocket}=require(_0x21e2e2('0x5b')),socket=getSocket(),db=require(_0x21e2e2('0x8'))['db'],{Op}=require('sequelize');require(_0x21e2e2('0x54'))[_0x21e2e2('0x37')](socket);function respondWithResult(_0x2d10c8,_0x9b28b5){return _0x9b28b5=_0x9b28b5||0xc8,function(_0x3ebf5c){const _0x5a4741=a168_0xfc45;if(_0x3ebf5c)return _0x2d10c8['status'](_0x9b28b5)[_0x5a4741('0x4c')](_0x3ebf5c);};}function respondWithFilteredResult(_0x12b85f,_0x5e55ea){return function(_0x40796b){const _0x380fa7=a168_0xfc45;if(_0x40796b){const _0x5ca6f5=_0x40796b[_0x380fa7('0x5f')],_0x174e1b=_0x5e55ea[_0x380fa7('0x3b')];let _0x572164=_0x5e55ea[_0x380fa7('0x3b')]+_0x5e55ea[_0x380fa7('0x52')],_0x3bdd3f;return _0x572164>=_0x5ca6f5?(_0x572164=_0x5ca6f5,_0x3bdd3f=0xc8):_0x3bdd3f=0xce,_0x12b85f[_0x380fa7('0xe')](_0x3bdd3f),_0x12b85f[_0x380fa7('0x39')](_0x380fa7('0x1d'),_0x174e1b+'-'+_0x572164+'/'+_0x5ca6f5)[_0x380fa7('0x4c')](_0x40796b);}return null;};}function saveUpdates(_0x1ae168){return function(_0x2054a9){const _0x3a9df0=a168_0xfc45;if(_0x2054a9)return _0x2054a9[_0x3a9df0('0x4f')](_0x1ae168)[_0x3a9df0('0x20')](function(_0x3803b6){return _0x3803b6;});return null;};}function removeEntity(_0x58ffb1){return function(_0x1655fd){const _0x1fcfa3=a168_0xfc45;if(_0x1655fd)return _0x1655fd[_0x1fcfa3('0x45')]()[_0x1fcfa3('0x20')](function(){const _0x296048=_0x1fcfa3,_0x2746d6=_0x1655fd[_0x296048('0x38')]({'plain':!![]}),_0x1ef9ee=_0x296048('0x1c');return db[_0x296048('0x27')][_0x296048('0x45')]({'where':{'type':_0x1ef9ee,'resourceId':_0x2746d6['id']}})[_0x296048('0x20')](function(){return _0x1655fd;});})['then'](function(){const _0x60a06d=_0x1fcfa3;_0x58ffb1[_0x60a06d('0xe')](0xcc)[_0x60a06d('0x16')]();});};}function handleEntityNotFound(_0x922c79){return function(_0x30c44e){const _0x5d7b70=a168_0xfc45;return!_0x30c44e&&_0x922c79[_0x5d7b70('0x29')](0x194),_0x30c44e;};}function handleError(_0x20ce95,_0x521604){return _0x521604=_0x521604||0x1f4,function(_0x5b1efb){const _0x572bab=a168_0xfc45;logger[_0x572bab('0x1b')](_0x5b1efb['stack']),_0x5b1efb[_0x572bab('0x11')]&&delete _0x5b1efb[_0x572bab('0x11')],_0x20ce95[_0x572bab('0xe')](_0x521604)['send'](_0x5b1efb);};}exports[_0x21e2e2('0xc')]=function(_0x3352cf,_0x88e075){const _0x5d7235=_0x21e2e2;let _0x295ded={};const _0x5f5105={},_0x170904={'count':0x0,'rows':[]},_0x16b0ee=_[_0x5d7235('0xd')](db[_0x5d7235('0x25')][_0x5d7235('0x2')],function(_0x311d3d){const _0x233f3f=_0x5d7235;return{'name':_0x311d3d[_0x233f3f('0x49')],'type':_0x311d3d[_0x233f3f('0x58')]['key']};});_0x5f5105[_0x5d7235('0x2c')]=_[_0x5d7235('0xd')](_0x16b0ee,_0x5d7235('0x11')),_0x5f5105[_0x5d7235('0x2e')]=_[_0x5d7235('0x46')](_0x3352cf['query']),_0x5f5105[_0x5d7235('0x1f')]=_['intersection'](_0x5f5105[_0x5d7235('0x2c')],_0x5f5105['query']),_0x295ded[_0x5d7235('0x41')]=_[_0x5d7235('0x47')](_0x5f5105[_0x5d7235('0x2c')],qs[_0x5d7235('0xa')](_0x3352cf[_0x5d7235('0x2e')][_0x5d7235('0xa')])),_0x295ded['attributes']=_0x295ded[_0x5d7235('0x41')][_0x5d7235('0x12')]?_0x295ded[_0x5d7235('0x41')]:_0x5f5105[_0x5d7235('0x2c')];typeof _0x3352cf[_0x5d7235('0x2e')][_0x5d7235('0x5')]===_0x5d7235('0x35')&&(_0x295ded['limit']=qs[_0x5d7235('0x52')](_0x3352cf[_0x5d7235('0x2e')]['limit']),_0x295ded['offset']=qs[_0x5d7235('0x3b')](_0x3352cf['query'][_0x5d7235('0x3b')]));_0x295ded[_0x5d7235('0x2b')]=qs[_0x5d7235('0x32')](_0x3352cf[_0x5d7235('0x2e')][_0x5d7235('0x32')]),_0x295ded[_0x5d7235('0x2a')]=qs[_0x5d7235('0x1f')](_['pick'](_0x3352cf[_0x5d7235('0x2e')],_0x5f5105[_0x5d7235('0x1f')]),_0x16b0ee);_0x3352cf[_0x5d7235('0x2e')][_0x5d7235('0x9')]&&(_0x295ded[_0x5d7235('0x2a')]=_[_0x5d7235('0x3f')](_0x295ded[_0x5d7235('0x2a')],{[Op['or']]:_['map'](_0x16b0ee,function(_0x47b608){const _0x3cc924=_0x5d7235;if(_0x47b608['type']!=='VIRTUAL'){const _0x1945a5={};return _0x1945a5[_0x47b608[_0x3cc924('0x11')]]={[Op[_0x3cc924('0x23')]]:'%'+_0x3352cf['query']['filter']+'%'},_0x1945a5;}})}));_0x295ded=_['merge']({},_0x295ded,_0x3352cf['options']);const _0x36159b={'where':_0x295ded['where']};return db[_0x5d7235('0x25')][_0x5d7235('0x5f')](_0x36159b)[_0x5d7235('0x20')](function(_0x398ecd){const _0x3cb598=_0x5d7235;return _0x170904[_0x3cb598('0x5f')]=_0x398ecd,_0x3352cf['query'][_0x3cb598('0x21')]&&(_0x295ded[_0x3cb598('0xb')]=[{'all':!![]}]),db[_0x3cb598('0x25')][_0x3cb598('0x56')](_0x295ded);})[_0x5d7235('0x20')](function(_0x125360){const _0x10f989=_0x5d7235;return _0x170904[_0x10f989('0x18')]=_0x125360,_0x170904;})[_0x5d7235('0x20')](respondWithFilteredResult(_0x88e075,_0x295ded))[_0x5d7235('0x33')](handleError(_0x88e075,null));},exports['show']=function(_0x2319bf,_0x209aae){const _0x42f2f5=_0x21e2e2;let _0x32e791={'raw':![],'where':{'id':_0x2319bf['params']['id']}};const _0x229ee8={};return _0x229ee8[_0x42f2f5('0x2c')]=_[_0x42f2f5('0x46')](db[_0x42f2f5('0x25')][_0x42f2f5('0x2')]),_0x229ee8['query']=_[_0x42f2f5('0x46')](_0x2319bf[_0x42f2f5('0x2e')]),_0x229ee8[_0x42f2f5('0x1f')]=_[_0x42f2f5('0x47')](_0x229ee8[_0x42f2f5('0x2c')],_0x229ee8['query']),_0x32e791['attributes']=_[_0x42f2f5('0x47')](_0x229ee8[_0x42f2f5('0x2c')],qs['fields'](_0x2319bf['query'][_0x42f2f5('0xa')])),_0x32e791['attributes']=_0x32e791[_0x42f2f5('0x41')][_0x42f2f5('0x12')]?_0x32e791['attributes']:_0x229ee8[_0x42f2f5('0x2c')],_0x2319bf[_0x42f2f5('0x2e')][_0x42f2f5('0x21')]&&(_0x32e791[_0x42f2f5('0xb')]=[{'all':!![]}]),_0x32e791=_[_0x42f2f5('0x3f')]({},_0x32e791,_0x2319bf[_0x42f2f5('0x10')]),db[_0x42f2f5('0x25')][_0x42f2f5('0x31')](_0x32e791)[_0x42f2f5('0x20')](handleEntityNotFound(_0x209aae,null))[_0x42f2f5('0x20')](respondWithResult(_0x209aae,null))[_0x42f2f5('0x33')](handleError(_0x209aae,null));},exports[_0x21e2e2('0x3a')]=function(_0x350f10,_0x41ef5d){const _0x24e49f=_0x21e2e2;return db[_0x24e49f('0x25')][_0x24e49f('0x3a')](_0x350f10['body'],{})[_0x24e49f('0x20')](function(_0xba8154){const _0x43fdde=_0x24e49f,_0x3b7256=_0x350f10[_0x43fdde('0x3c')]['get']({'plain':!![]});if(!_0x3b7256)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b7256[_0x43fdde('0x19')]===_0x43fdde('0x3c')){const _0x1da810=_0xba8154['get']({'plain':!![]}),_0x45f206=_0x43fdde('0x1c');return db[_0x43fdde('0x43')][_0x43fdde('0x31')]({'where':{'name':_0x45f206,'userProfileId':_0x3b7256[_0x43fdde('0x4')]},'raw':!![]})[_0x43fdde('0x20')](function(_0x198d19){const _0x5e0e03=_0x43fdde;return _0x198d19&&_0x198d19['autoAssociation']===0x0?db[_0x5e0e03('0x27')]['create']({'name':_0x1da810[_0x5e0e03('0x11')],'resourceId':_0x1da810['id'],'type':_0x198d19[_0x5e0e03('0x11')],'sectionId':_0x198d19['id']},{})['then'](function(){return _0xba8154;}):_0xba8154;})[_0x43fdde('0x33')](function(_0x3cfa78){const _0x137c91=_0x43fdde;logger[_0x137c91('0x1b')](_0x137c91('0x5d'),_0x3cfa78);throw _0x3cfa78;});}return _0xba8154;})[_0x24e49f('0x20')](respondWithResult(_0x41ef5d,0xc9))[_0x24e49f('0x33')](handleError(_0x41ef5d,null));},exports[_0x21e2e2('0x55')]=function(_0x200f50,_0x387a44){const _0x358743=_0x21e2e2;let _0xc22611={'where':{'id':_0x200f50['params']['id']}};const _0x409a7d={};return _0x409a7d[_0x358743('0x2c')]=_['keys'](db['Dashboard'][_0x358743('0x2')]),_0xc22611[_0x358743('0x41')]=_[_0x358743('0x47')](_0x409a7d[_0x358743('0x2c')],qs[_0x358743('0xa')](_0x200f50[_0x358743('0x2e')][_0x358743('0xa')])),_0xc22611[_0x358743('0x41')]=_0xc22611[_0x358743('0x41')][_0x358743('0x12')]?_0xc22611[_0x358743('0x41')]:_0x409a7d[_0x358743('0x2c')],_0x200f50['query'][_0x358743('0x21')]&&(_0xc22611['include']=[{'all':!![]}]),_0xc22611=_[_0x358743('0x3f')]({},_0xc22611,_0x200f50['options']),db['Dashboard']['findOne'](_0xc22611)[_0x358743('0x20')](handleEntityNotFound(_0x387a44,null))['then'](function(_0x5baa35){const _0x19bd3b=_0x358743;if(_0x5baa35){let _0x13d589=_0x5baa35[_0x19bd3b('0x38')]({'plain':!![]});return _0x13d589=qs[_0x19bd3b('0x4e')](_0x13d589,['id',_0x19bd3b('0x4d'),_0x19bd3b('0x22')]),_0x200f50['body']=_[_0x19bd3b('0x4e')](_0x200f50[_0x19bd3b('0x44')],['id',_0x19bd3b('0x4d'),_0x19bd3b('0x22')]),db[_0x19bd3b('0x25')][_0x19bd3b('0x3a')](_[_0x19bd3b('0x3f')](_0x13d589,_0x200f50[_0x19bd3b('0x44')]),{'include':_0x200f50[_0x19bd3b('0x2e')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x143ebf){const _0x5d8ca4=_0x19bd3b,_0x2f1699=_0x200f50[_0x5d8ca4('0x3c')][_0x5d8ca4('0x38')]({'plain':!![]});if(!_0x2f1699)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f1699[_0x5d8ca4('0x19')]===_0x5d8ca4('0x3c')){const _0x122355=_0x143ebf[_0x5d8ca4('0x38')]({'plain':!![]}),_0x4145d8='CustomDashboards';return db[_0x5d8ca4('0x43')][_0x5d8ca4('0x31')]({'where':{'name':_0x4145d8,'userProfileId':_0x2f1699[_0x5d8ca4('0x4')]},'raw':!![]})[_0x5d8ca4('0x20')](function(_0x33ec0e){const _0xc356c9=_0x5d8ca4;return _0x33ec0e&&_0x33ec0e[_0xc356c9('0x5a')]===0x0?db[_0xc356c9('0x27')][_0xc356c9('0x3a')]({'name':_0x122355[_0xc356c9('0x11')],'resourceId':_0x122355['id'],'type':_0x33ec0e[_0xc356c9('0x11')],'sectionId':_0x33ec0e['id']},{})[_0xc356c9('0x20')](function(){return _0x143ebf;}):_0x143ebf;})['catch'](function(_0x26d64c){const _0x54c615=_0x5d8ca4;logger[_0x54c615('0x1b')](_0x54c615('0x5d'),_0x26d64c);throw _0x26d64c;});}return _0x143ebf;});}})[_0x358743('0x20')](respondWithResult(_0x387a44,0xc9))[_0x358743('0x33')](handleError(_0x387a44,null));},exports['update']=function(_0x525db4,_0x108b1d){const _0x14005f=_0x21e2e2;return _0x525db4['body']['id']&&delete _0x525db4[_0x14005f('0x44')]['id'],db['Dashboard'][_0x14005f('0x31')]({'where':{'id':_0x525db4[_0x14005f('0xf')]['id']}})[_0x14005f('0x20')](handleEntityNotFound(_0x108b1d,null))[_0x14005f('0x20')](saveUpdates(_0x525db4[_0x14005f('0x44')],null))['then'](respondWithResult(_0x108b1d,null))[_0x14005f('0x33')](handleError(_0x108b1d,null));},exports['destroy']=function(_0x4ec202,_0x2a294f){const _0x290af0=_0x21e2e2;return db[_0x290af0('0x25')]['findOne']({'where':{'id':_0x4ec202[_0x290af0('0xf')]['id']}})[_0x290af0('0x20')](handleEntityNotFound(_0x2a294f,null))[_0x290af0('0x20')](removeEntity(_0x2a294f,null))['catch'](handleError(_0x2a294f,null));};function widgetAttributes(_0xdbc58a){const _0x2d7c89=_0x21e2e2;try{switch(_0xdbc58a[_0x2d7c89('0x58')]){case _0x2d7c89('0x57'):return[{'name':'attrUrl','value':_0xdbc58a[_0x2d7c89('0x40')]||(_0xdbc58a[_0x2d7c89('0x36')]&&_0xdbc58a[_0x2d7c89('0x36')][0x0]?_0xdbc58a['attrs'][0x0][_0x2d7c89('0x3')]:undefined)||_0x2d7c89('0x3e')}];case _0x2d7c89('0x15'):return[{'name':_0x2d7c89('0x7'),'value':_0xdbc58a['attrPath']||(_0xdbc58a['attrs']&&_0xdbc58a['attrs'][0x0]?_0xdbc58a[_0x2d7c89('0x36')][0x0][_0x2d7c89('0x3')]:undefined)||''}];case _0x2d7c89('0x2d'):return[{'name':_0x2d7c89('0x24'),'value':_0xdbc58a['attrHourFormat']||(_0xdbc58a[_0x2d7c89('0x36')]&&_0xdbc58a[_0x2d7c89('0x36')][0x0]?_0xdbc58a[_0x2d7c89('0x36')][0x0][_0x2d7c89('0x3')]:undefined)||_0x2d7c89('0x28')},{'name':_0x2d7c89('0x14'),'value':_0xdbc58a[_0x2d7c89('0x14')]||(_0xdbc58a[_0x2d7c89('0x36')]&&_0xdbc58a['attrs'][0x1]?_0xdbc58a[_0x2d7c89('0x36')][0x1]['value']:undefined)||_0x2d7c89('0x26')},{'name':_0x2d7c89('0x4b'),'value':_0xdbc58a[_0x2d7c89('0x4b')]||(_0xdbc58a[_0x2d7c89('0x36')]&&_0xdbc58a[_0x2d7c89('0x36')][0x2]?_0xdbc58a['attrs'][0x2]['value']:undefined)||0xc}];case _0x2d7c89('0x2f'):return[{'name':_0x2d7c89('0x34'),'value':_0xdbc58a['attrMetric']||(_0xdbc58a[_0x2d7c89('0x36')]&&_0xdbc58a[_0x2d7c89('0x36')][0x0]?_0xdbc58a[_0x2d7c89('0x36')][0x0][_0x2d7c89('0x3')]:undefined)||_0x2d7c89('0x42')},{'name':_0x2d7c89('0x5c'),'value':_0xdbc58a[_0x2d7c89('0x5c')]||(_0xdbc58a[_0x2d7c89('0x36')]&&_0xdbc58a[_0x2d7c89('0x36')][0x1]?_0xdbc58a[_0x2d7c89('0x36')][0x1][_0x2d7c89('0x3')]:undefined)||[]},{'name':_0x2d7c89('0x4b'),'value':_0xdbc58a[_0x2d7c89('0x4b')]||(_0xdbc58a[_0x2d7c89('0x36')]&&_0xdbc58a['attrs'][0x2]?_0xdbc58a['attrs'][0x2]['value']:undefined)||0x14}];case _0x2d7c89('0x1'):case'pie-chart':return[{'name':'attrSerie1','value':_0xdbc58a['attrSerie1']||(_0xdbc58a['attrs']&&_0xdbc58a[_0x2d7c89('0x36')][0x0]?_0xdbc58a[_0x2d7c89('0x36')][0x0]['value']:undefined)||_0x2d7c89('0x42')},{'name':_0x2d7c89('0x1e'),'value':_0xdbc58a[_0x2d7c89('0x1e')]||(_0xdbc58a[_0x2d7c89('0x36')]&&_0xdbc58a[_0x2d7c89('0x36')][0x1]?_0xdbc58a[_0x2d7c89('0x36')][0x1][_0x2d7c89('0x3')]:undefined)||null},{'name':_0x2d7c89('0x17'),'value':_0xdbc58a[_0x2d7c89('0x17')]||(_0xdbc58a[_0x2d7c89('0x36')]&&_0xdbc58a[_0x2d7c89('0x36')][0x2]?_0xdbc58a['attrs'][0x2][_0x2d7c89('0x3')]:undefined)||null},{'name':'attrVoiceQueues','value':_0xdbc58a[_0x2d7c89('0x5c')]||(_0xdbc58a[_0x2d7c89('0x36')]&&_0xdbc58a[_0x2d7c89('0x36')][0x3]?_0xdbc58a['attrs'][0x3][_0x2d7c89('0x3')]:undefined)||[]}];case _0x2d7c89('0x59'):return[{'name':_0x2d7c89('0x4a'),'type':_0xdbc58a[_0x2d7c89('0x0')]||(_0xdbc58a[_0x2d7c89('0x36')]&&_0xdbc58a[_0x2d7c89('0x36')][0x0]?_0xdbc58a['attrs'][0x0][_0x2d7c89('0x58')]:undefined)||null,'value':_0xdbc58a[_0x2d7c89('0x4a')]||(_0xdbc58a[_0x2d7c89('0x36')]&&_0xdbc58a['attrs'][0x0]?_0xdbc58a['attrs'][0x0]['value']:undefined)||null},{'name':_0x2d7c89('0x51'),'value':_0xdbc58a[_0x2d7c89('0x51')]||(_0xdbc58a[_0x2d7c89('0x36')]&&_0xdbc58a[_0x2d7c89('0x36')][0x1]?_0xdbc58a[_0x2d7c89('0x36')][0x1][_0x2d7c89('0x3')]:undefined)||0x0}];default:return[];}}catch(_0xc958d6){return logger[_0x2d7c89('0x1b')](_0x2d7c89('0x6'),JSON[_0x2d7c89('0x30')](_0xc958d6)),[];}}exports[_0x21e2e2('0x1a')]=function(_0x418a17,_0x44ef2d){const _0x3f0796=_0x21e2e2;return _0x418a17[_0x3f0796('0x44')]['id']&&delete _0x418a17[_0x3f0796('0x44')]['id'],db[_0x3f0796('0x25')][_0x3f0796('0x31')]({'where':{'id':_0x418a17[_0x3f0796('0xf')]['id']}})[_0x3f0796('0x20')](handleEntityNotFound(_0x44ef2d,null))[_0x3f0796('0x20')](function(_0x487804){const _0x32acd1=_0x3f0796;if(_0x487804)return _0x418a17[_0x32acd1('0x44')]['DashboardId']=_0x487804['id'],_0x418a17[_0x32acd1('0x44')]['attrs']=widgetAttributes(_0x418a17[_0x32acd1('0x44')]),db[_0x32acd1('0x48')]['create'](_0x418a17['body']);})['then'](respondWithResult(_0x44ef2d,null))['catch'](handleError(_0x44ef2d,null));},exports['getItems']=function(_0x523eb4,_0x3db8e7){const _0x37889c=_0x21e2e2;let _0xb72fdc={};const _0x198ead={};let _0x7fd3d9,_0x20ab06;return db['Dashboard'][_0x37889c('0x31')]({'where':{'id':_0x523eb4[_0x37889c('0xf')]['id']}})['then'](handleEntityNotFound(_0x3db8e7,null))[_0x37889c('0x20')](function(_0xdbeff4){const _0x15b0cd=_0x37889c;if(_0xdbeff4)return _0x7fd3d9=_0xdbeff4,_0x198ead[_0x15b0cd('0x2c')]=_['keys'](db[_0x15b0cd('0x48')][_0x15b0cd('0x2')]),_0x198ead[_0x15b0cd('0x2e')]=_['keys'](_0x523eb4[_0x15b0cd('0x2e')]),_0x198ead[_0x15b0cd('0x1f')]=_[_0x15b0cd('0x47')](_0x198ead[_0x15b0cd('0x2c')],_0x198ead[_0x15b0cd('0x2e')]),_0xb72fdc[_0x15b0cd('0x41')]=_[_0x15b0cd('0x47')](_0x198ead[_0x15b0cd('0x2c')],qs[_0x15b0cd('0xa')](_0x523eb4[_0x15b0cd('0x2e')][_0x15b0cd('0xa')])),_0xb72fdc[_0x15b0cd('0x41')]=_0xb72fdc[_0x15b0cd('0x41')][_0x15b0cd('0x12')]?_0xb72fdc[_0x15b0cd('0x41')]:_0x198ead[_0x15b0cd('0x2c')],_0xb72fdc[_0x15b0cd('0x2b')]=qs['sort'](_0x523eb4['query']['sort']),_0xb72fdc[_0x15b0cd('0x2a')]=qs['filters'](_[_0x15b0cd('0x13')](_0x523eb4['query'],_0x198ead[_0x15b0cd('0x1f')])),_0x523eb4[_0x15b0cd('0x2e')][_0x15b0cd('0x9')]&&(_0xb72fdc['where']=_[_0x15b0cd('0x3f')](_0xb72fdc['where'],{[Op['or']]:_['map'](_0xb72fdc[_0x15b0cd('0x41')],function(_0xf39f){const _0x583cf6=_0x15b0cd,_0x3cc638={};return _0x3cc638[_0xf39f]={[Op[_0x583cf6('0x23')]]:'%'+_0x523eb4[_0x583cf6('0x2e')][_0x583cf6('0x9')]+'%'},_0x3cc638;})})),_0xb72fdc=_[_0x15b0cd('0x3f')]({},_0xb72fdc,_0x523eb4[_0x15b0cd('0x10')]),_0x7fd3d9['getItems'](_0xb72fdc);})['then'](function(_0x417f1a){const _0x28e885=_0x37889c;if(_0x417f1a)return _0x20ab06=_0x417f1a[_0x28e885('0x12')],typeof _0x523eb4[_0x28e885('0x2e')][_0x28e885('0x5')]===_0x28e885('0x35')&&(_0xb72fdc[_0x28e885('0x52')]=qs['limit'](_0x523eb4['query'][_0x28e885('0x52')]),_0xb72fdc[_0x28e885('0x3b')]=qs[_0x28e885('0x3b')](_0x523eb4['query'][_0x28e885('0x3b')])),_0x7fd3d9[_0x28e885('0x53')](_0xb72fdc);})[_0x37889c('0x20')](function(_0x169714){if(_0x169714)return _0x169714?{'count':_0x20ab06,'rows':_0x169714}:null;})[_0x37889c('0x20')](respondWithResult(_0x3db8e7,null))['catch'](handleError(_0x3db8e7,null));};
\ No newline at end of file