Built motion from commit 129fb4d95212661e48f0db455e75d668addbaddf. Version 3.0.0...
[motion-next.git] / server / api / dashboard / dashboard.controller.js
index 77fd6b3..f58f94d 100644 (file)
@@ -1 +1 @@
-const a168_0x2c33=['send','attrReport','https://','register','CustomDashboards','limit','type','attrFontSize','omit','catch','attrTimezone','attrSerie2','attrRefresh','userProfileId','attrPath','DashboardItem','counter','custom','./dashboard.socket','end','updatedAt','lodash','findAll','../../rediscache','fields','order','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','../../config/logger','index','map','createdAt','web-report','rawAttributes','attrSerie1','offset','filter','stack','getItems','attrs','api','fieldName','body','include','error','iframe','create','params','sequelize','reportType','keys','undefined','DashboardId','nolimit','show','model','../../components/parsers/qs','attrUrl','user','count','UserProfileSection','pie-chart','where','intersection','key','merge','attrVoiceQueues','then','HH:mm:ss','rows','filters','widgetAttributes:\x20%s','../../mysqldb','attrSerie3','role','Dashboard','set','0.00','query','destroy','attrHourFormat','get','json','total','pick','multibar-chart','options','stringify','UserProfileResource','attrMetric','addItem','Unable\x20to\x20retrieve\x20the\x20current\x20user','sort','attributes','VIRTUAL','length','findOne','includeAll','Content-Range','update','value','name'];(function(_0x390114,_0x2c33f3){const _0xd9a99b=function(_0x3330ec){while(--_0x3330ec){_0x390114['push'](_0x390114['shift']());}};_0xd9a99b(++_0x2c33f3);}(a168_0x2c33,0x143));const a168_0xd9a9=function(_0x390114,_0x2c33f3){_0x390114=_0x390114-0x0;let _0xd9a99b=a168_0x2c33[_0x390114];return _0xd9a99b;};const _0x22d097=a168_0xd9a9;'use strict';const _=require(_0x22d097('0x1')),qs=require(_0x22d097('0x23')),logger=require(_0x22d097('0x7'))(_0x22d097('0x13')),{getSocket}=require(_0x22d097('0x3')),socket=getSocket(),db=require(_0x22d097('0x33'))['db'],{Op}=require(_0x22d097('0x1b'));require(_0x22d097('0x63'))[_0x22d097('0x54')](socket);function respondWithResult(_0x3330ec,_0x44e04b){return _0x44e04b=_0x44e04b||0xc8,function(_0x2424b2){if(_0x2424b2)return _0x3330ec['status'](_0x44e04b)['json'](_0x2424b2);};}function respondWithFilteredResult(_0x280c4d,_0x2540eb){return function(_0x6ca64f){const _0x4fd31b=a168_0xd9a9;if(_0x6ca64f){const _0x1e40ff=_0x6ca64f[_0x4fd31b('0x26')],_0x2754a1=_0x2540eb[_0x4fd31b('0xe')];let _0x5ab39f=_0x2540eb[_0x4fd31b('0xe')]+_0x2540eb[_0x4fd31b('0x56')],_0x47721f;return _0x5ab39f>=_0x1e40ff?(_0x5ab39f=_0x1e40ff,_0x47721f=0xc8):_0x47721f=0xce,_0x280c4d['status'](_0x47721f),_0x280c4d[_0x4fd31b('0x37')](_0x4fd31b('0x4d'),_0x2754a1+'-'+_0x5ab39f+'/'+_0x1e40ff)[_0x4fd31b('0x3d')](_0x6ca64f);}return null;};}function saveUpdates(_0x1eec32){return function(_0x2c156c){const _0x3496bc=a168_0xd9a9;if(_0x2c156c)return _0x2c156c['update'](_0x1eec32)[_0x3496bc('0x2e')](function(_0x3ec267){return _0x3ec267;});return null;};}function removeEntity(_0x4f380e){return function(_0x53bc34){const _0x5adedc=a168_0xd9a9;if(_0x53bc34)return _0x53bc34['destroy']()[_0x5adedc('0x2e')](function(){const _0x20b970=_0x5adedc,_0x23b214=_0x53bc34['get']({'plain':!![]}),_0x1c5e2f='CustomDashboards';return db[_0x20b970('0x43')][_0x20b970('0x3a')]({'where':{'type':_0x1c5e2f,'resourceId':_0x23b214['id']}})[_0x20b970('0x2e')](function(){return _0x53bc34;});})[_0x5adedc('0x2e')](function(){const _0x2fdea2=_0x5adedc;_0x4f380e['status'](0xcc)[_0x2fdea2('0x64')]();});};}function handleEntityNotFound(_0x2c743f){return function(_0x278364){return!_0x278364&&_0x2c743f['sendStatus'](0x194),_0x278364;};}function handleError(_0x27569b,_0x3c8991){return _0x3c8991=_0x3c8991||0x1f4,function(_0x5aa3be){const _0x46ebf3=a168_0xd9a9;logger[_0x46ebf3('0x17')](_0x5aa3be[_0x46ebf3('0x10')]),_0x5aa3be[_0x46ebf3('0x50')]&&delete _0x5aa3be[_0x46ebf3('0x50')],_0x27569b['status'](_0x3c8991)[_0x46ebf3('0x51')](_0x5aa3be);};}exports[_0x22d097('0x8')]=function(_0x14c703,_0x22001e){const _0x427bc8=_0x22d097;let _0x2ed090={};const _0x1b6e11={},_0x451882={'count':0x0,'rows':[]},_0x2526fd=_[_0x427bc8('0x9')](db[_0x427bc8('0x36')][_0x427bc8('0xc')],function(_0x315e5a){const _0x195a6f=_0x427bc8;return{'name':_0x315e5a[_0x195a6f('0x14')],'type':_0x315e5a[_0x195a6f('0x57')][_0x195a6f('0x2b')]};});_0x1b6e11['model']=_[_0x427bc8('0x9')](_0x2526fd,_0x427bc8('0x50')),_0x1b6e11[_0x427bc8('0x39')]=_[_0x427bc8('0x1d')](_0x14c703[_0x427bc8('0x39')]),_0x1b6e11[_0x427bc8('0x31')]=_[_0x427bc8('0x2a')](_0x1b6e11['model'],_0x1b6e11[_0x427bc8('0x39')]),_0x2ed090[_0x427bc8('0x48')]=_[_0x427bc8('0x2a')](_0x1b6e11[_0x427bc8('0x22')],qs[_0x427bc8('0x4')](_0x14c703[_0x427bc8('0x39')][_0x427bc8('0x4')])),_0x2ed090[_0x427bc8('0x48')]=_0x2ed090['attributes'][_0x427bc8('0x4a')]?_0x2ed090[_0x427bc8('0x48')]:_0x1b6e11[_0x427bc8('0x22')];typeof _0x14c703[_0x427bc8('0x39')][_0x427bc8('0x20')]===_0x427bc8('0x1e')&&(_0x2ed090['limit']=qs['limit'](_0x14c703[_0x427bc8('0x39')][_0x427bc8('0x56')]),_0x2ed090[_0x427bc8('0xe')]=qs[_0x427bc8('0xe')](_0x14c703[_0x427bc8('0x39')][_0x427bc8('0xe')]));_0x2ed090[_0x427bc8('0x5')]=qs[_0x427bc8('0x47')](_0x14c703['query']['sort']),_0x2ed090[_0x427bc8('0x29')]=qs[_0x427bc8('0x31')](_[_0x427bc8('0x3f')](_0x14c703[_0x427bc8('0x39')],_0x1b6e11['filters']),_0x2526fd);_0x14c703[_0x427bc8('0x39')][_0x427bc8('0xf')]&&(_0x2ed090[_0x427bc8('0x29')]=_[_0x427bc8('0x2c')](_0x2ed090[_0x427bc8('0x29')],{[Op['or']]:_[_0x427bc8('0x9')](_0x2526fd,function(_0x22ceff){const _0x5fcb1e=_0x427bc8;if(_0x22ceff[_0x5fcb1e('0x57')]!==_0x5fcb1e('0x49')){const _0x59ce8a={};return _0x59ce8a[_0x22ceff['name']]={[Op['like']]:'%'+_0x14c703['query'][_0x5fcb1e('0xf')]+'%'},_0x59ce8a;}})}));_0x2ed090=_['merge']({},_0x2ed090,_0x14c703[_0x427bc8('0x41')]);const _0x4527da={'where':_0x2ed090[_0x427bc8('0x29')]};return db[_0x427bc8('0x36')][_0x427bc8('0x26')](_0x4527da)['then'](function(_0x5a052f){const _0xc870aa=_0x427bc8;return _0x451882[_0xc870aa('0x26')]=_0x5a052f,_0x14c703[_0xc870aa('0x39')][_0xc870aa('0x4c')]&&(_0x2ed090[_0xc870aa('0x16')]=[{'all':!![]}]),db[_0xc870aa('0x36')][_0xc870aa('0x2')](_0x2ed090);})[_0x427bc8('0x2e')](function(_0xbfd870){const _0x1df4f3=_0x427bc8;return _0x451882[_0x1df4f3('0x30')]=_0xbfd870,_0x451882;})[_0x427bc8('0x2e')](respondWithFilteredResult(_0x22001e,_0x2ed090))[_0x427bc8('0x5a')](handleError(_0x22001e,null));},exports[_0x22d097('0x21')]=function(_0x2f9120,_0x2a440e){const _0x120d46=_0x22d097;let _0x39e034={'raw':![],'where':{'id':_0x2f9120[_0x120d46('0x1a')]['id']}};const _0x1d99de={};return _0x1d99de[_0x120d46('0x22')]=_[_0x120d46('0x1d')](db['Dashboard'][_0x120d46('0xc')]),_0x1d99de[_0x120d46('0x39')]=_['keys'](_0x2f9120[_0x120d46('0x39')]),_0x1d99de['filters']=_['intersection'](_0x1d99de['model'],_0x1d99de[_0x120d46('0x39')]),_0x39e034[_0x120d46('0x48')]=_[_0x120d46('0x2a')](_0x1d99de[_0x120d46('0x22')],qs['fields'](_0x2f9120[_0x120d46('0x39')][_0x120d46('0x4')])),_0x39e034[_0x120d46('0x48')]=_0x39e034['attributes']['length']?_0x39e034[_0x120d46('0x48')]:_0x1d99de[_0x120d46('0x22')],_0x2f9120[_0x120d46('0x39')]['includeAll']&&(_0x39e034[_0x120d46('0x16')]=[{'all':!![]}]),_0x39e034=_[_0x120d46('0x2c')]({},_0x39e034,_0x2f9120[_0x120d46('0x41')]),db[_0x120d46('0x36')][_0x120d46('0x4b')](_0x39e034)[_0x120d46('0x2e')](handleEntityNotFound(_0x2a440e,null))[_0x120d46('0x2e')](respondWithResult(_0x2a440e,null))[_0x120d46('0x5a')](handleError(_0x2a440e,null));},exports[_0x22d097('0x19')]=function(_0x287fdf,_0x5e68a9){const _0x14858e=_0x22d097;return db[_0x14858e('0x36')][_0x14858e('0x19')](_0x287fdf[_0x14858e('0x15')],{})[_0x14858e('0x2e')](function(_0x285b02){const _0x33c192=_0x14858e,_0x3df279=_0x287fdf[_0x33c192('0x25')][_0x33c192('0x3c')]({'plain':!![]});if(!_0x3df279)throw new Error(_0x33c192('0x46'));if(_0x3df279[_0x33c192('0x35')]===_0x33c192('0x25')){const _0x5b9a19=_0x285b02[_0x33c192('0x3c')]({'plain':!![]}),_0x2e72cd=_0x33c192('0x55');return db['UserProfileSection']['findOne']({'where':{'name':_0x2e72cd,'userProfileId':_0x3df279[_0x33c192('0x5e')]},'raw':!![]})[_0x33c192('0x2e')](function(_0x1a388c){const _0x4caf50=_0x33c192;return _0x1a388c&&_0x1a388c['autoAssociation']===0x0?db[_0x4caf50('0x43')][_0x4caf50('0x19')]({'name':_0x5b9a19[_0x4caf50('0x50')],'resourceId':_0x5b9a19['id'],'type':_0x1a388c['name'],'sectionId':_0x1a388c['id']},{})['then'](function(){return _0x285b02;}):_0x285b02;})[_0x33c192('0x5a')](function(_0x5b2f99){const _0x5e6fb4=_0x33c192;logger[_0x5e6fb4('0x17')](_0x5e6fb4('0x6'),_0x5b2f99);throw _0x5b2f99;});}return _0x285b02;})[_0x14858e('0x2e')](respondWithResult(_0x5e68a9,0xc9))[_0x14858e('0x5a')](handleError(_0x5e68a9,null));},exports['clone']=function(_0x29797c,_0x1b1bb7){const _0x54838b=_0x22d097;let _0x95e3e3={'where':{'id':_0x29797c[_0x54838b('0x1a')]['id']}};const _0x13f214={};return _0x13f214[_0x54838b('0x22')]=_['keys'](db['Dashboard'][_0x54838b('0xc')]),_0x95e3e3['attributes']=_['intersection'](_0x13f214[_0x54838b('0x22')],qs['fields'](_0x29797c[_0x54838b('0x39')]['fields'])),_0x95e3e3[_0x54838b('0x48')]=_0x95e3e3[_0x54838b('0x48')]['length']?_0x95e3e3[_0x54838b('0x48')]:_0x13f214['model'],_0x29797c['query']['includeAll']&&(_0x95e3e3['include']=[{'all':!![]}]),_0x95e3e3=_[_0x54838b('0x2c')]({},_0x95e3e3,_0x29797c[_0x54838b('0x41')]),db[_0x54838b('0x36')][_0x54838b('0x4b')](_0x95e3e3)[_0x54838b('0x2e')](handleEntityNotFound(_0x1b1bb7,null))[_0x54838b('0x2e')](function(_0x129d55){const _0x46a4a1=_0x54838b;if(_0x129d55){let _0x18be8b=_0x129d55[_0x46a4a1('0x3c')]({'plain':!![]});return _0x18be8b=qs['omit'](_0x18be8b,['id',_0x46a4a1('0xa'),_0x46a4a1('0x0')]),_0x29797c[_0x46a4a1('0x15')]=_[_0x46a4a1('0x59')](_0x29797c[_0x46a4a1('0x15')],['id',_0x46a4a1('0xa'),_0x46a4a1('0x0')]),db[_0x46a4a1('0x36')][_0x46a4a1('0x19')](_[_0x46a4a1('0x2c')](_0x18be8b,_0x29797c[_0x46a4a1('0x15')]),{'include':_0x29797c[_0x46a4a1('0x39')][_0x46a4a1('0x4c')]?[{'all':!![]}]:undefined})['then'](function(_0x1f2ed1){const _0x1ac770=_0x46a4a1,_0x4029d7=_0x29797c['user']['get']({'plain':!![]});if(!_0x4029d7)throw new Error(_0x1ac770('0x46'));if(_0x4029d7['role']===_0x1ac770('0x25')){const _0x1f51e2=_0x1f2ed1['get']({'plain':!![]}),_0x2a98bb=_0x1ac770('0x55');return db[_0x1ac770('0x27')][_0x1ac770('0x4b')]({'where':{'name':_0x2a98bb,'userProfileId':_0x4029d7[_0x1ac770('0x5e')]},'raw':!![]})[_0x1ac770('0x2e')](function(_0x5d4aa4){const _0x29adbe=_0x1ac770;return _0x5d4aa4&&_0x5d4aa4['autoAssociation']===0x0?db['UserProfileResource'][_0x29adbe('0x19')]({'name':_0x1f51e2['name'],'resourceId':_0x1f51e2['id'],'type':_0x5d4aa4['name'],'sectionId':_0x5d4aa4['id']},{})['then'](function(){return _0x1f2ed1;}):_0x1f2ed1;})[_0x1ac770('0x5a')](function(_0xed6401){const _0xa5045f=_0x1ac770;logger[_0xa5045f('0x17')](_0xa5045f('0x6'),_0xed6401);throw _0xed6401;});}return _0x1f2ed1;});}})[_0x54838b('0x2e')](respondWithResult(_0x1b1bb7,0xc9))[_0x54838b('0x5a')](handleError(_0x1b1bb7,null));},exports[_0x22d097('0x4e')]=function(_0x1b5e94,_0x497a44){const _0x1013eb=_0x22d097;return _0x1b5e94[_0x1013eb('0x15')]['id']&&delete _0x1b5e94['body']['id'],db[_0x1013eb('0x36')][_0x1013eb('0x4b')]({'where':{'id':_0x1b5e94[_0x1013eb('0x1a')]['id']}})[_0x1013eb('0x2e')](handleEntityNotFound(_0x497a44,null))[_0x1013eb('0x2e')](saveUpdates(_0x1b5e94[_0x1013eb('0x15')],null))[_0x1013eb('0x2e')](respondWithResult(_0x497a44,null))[_0x1013eb('0x5a')](handleError(_0x497a44,null));},exports[_0x22d097('0x3a')]=function(_0x73e981,_0x1a5f05){const _0x48d650=_0x22d097;return db[_0x48d650('0x36')][_0x48d650('0x4b')]({'where':{'id':_0x73e981[_0x48d650('0x1a')]['id']}})[_0x48d650('0x2e')](handleEntityNotFound(_0x1a5f05,null))[_0x48d650('0x2e')](removeEntity(_0x1a5f05,null))[_0x48d650('0x5a')](handleError(_0x1a5f05,null));};function widgetAttributes(_0x12cf1c){const _0x71d852=_0x22d097;try{switch(_0x12cf1c['type']){case _0x71d852('0x18'):return[{'name':_0x71d852('0x24'),'value':_0x12cf1c['attrUrl']||(_0x12cf1c[_0x71d852('0x12')]&&_0x12cf1c[_0x71d852('0x12')][0x0]?_0x12cf1c['attrs'][0x0][_0x71d852('0x4f')]:undefined)||_0x71d852('0x53')}];case _0x71d852('0x62'):return[{'name':'attrPath','value':_0x12cf1c[_0x71d852('0x5f')]||(_0x12cf1c[_0x71d852('0x12')]&&_0x12cf1c['attrs'][0x0]?_0x12cf1c['attrs'][0x0]['value']:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x12cf1c[_0x71d852('0x3b')]||(_0x12cf1c[_0x71d852('0x12')]&&_0x12cf1c['attrs'][0x0]?_0x12cf1c[_0x71d852('0x12')][0x0]['value']:undefined)||_0x71d852('0x2f')},{'name':_0x71d852('0x5b'),'value':_0x12cf1c[_0x71d852('0x5b')]||(_0x12cf1c[_0x71d852('0x12')]&&_0x12cf1c[_0x71d852('0x12')][0x1]?_0x12cf1c['attrs'][0x1]['value']:undefined)||_0x71d852('0x38')},{'name':_0x71d852('0x58'),'value':_0x12cf1c[_0x71d852('0x58')]||(_0x12cf1c[_0x71d852('0x12')]&&_0x12cf1c['attrs'][0x2]?_0x12cf1c[_0x71d852('0x12')][0x2][_0x71d852('0x4f')]:undefined)||0xc}];case _0x71d852('0x61'):return[{'name':_0x71d852('0x44'),'value':_0x12cf1c[_0x71d852('0x44')]||(_0x12cf1c[_0x71d852('0x12')]&&_0x12cf1c[_0x71d852('0x12')][0x0]?_0x12cf1c[_0x71d852('0x12')][0x0][_0x71d852('0x4f')]:undefined)||_0x71d852('0x3e')},{'name':_0x71d852('0x2d'),'value':_0x12cf1c[_0x71d852('0x2d')]||(_0x12cf1c[_0x71d852('0x12')]&&_0x12cf1c['attrs'][0x1]?_0x12cf1c[_0x71d852('0x12')][0x1][_0x71d852('0x4f')]:undefined)||[]},{'name':_0x71d852('0x58'),'value':_0x12cf1c[_0x71d852('0x58')]||(_0x12cf1c[_0x71d852('0x12')]&&_0x12cf1c['attrs'][0x2]?_0x12cf1c[_0x71d852('0x12')][0x2][_0x71d852('0x4f')]:undefined)||0x14}];case _0x71d852('0x40'):case _0x71d852('0x28'):return[{'name':_0x71d852('0xd'),'value':_0x12cf1c[_0x71d852('0xd')]||(_0x12cf1c[_0x71d852('0x12')]&&_0x12cf1c['attrs'][0x0]?_0x12cf1c['attrs'][0x0][_0x71d852('0x4f')]:undefined)||_0x71d852('0x3e')},{'name':'attrSerie2','value':_0x12cf1c[_0x71d852('0x5c')]||(_0x12cf1c[_0x71d852('0x12')]&&_0x12cf1c[_0x71d852('0x12')][0x1]?_0x12cf1c['attrs'][0x1][_0x71d852('0x4f')]:undefined)||null},{'name':_0x71d852('0x34'),'value':_0x12cf1c['attrSerie3']||(_0x12cf1c[_0x71d852('0x12')]&&_0x12cf1c[_0x71d852('0x12')][0x2]?_0x12cf1c[_0x71d852('0x12')][0x2][_0x71d852('0x4f')]:undefined)||null},{'name':_0x71d852('0x2d'),'value':_0x12cf1c['attrVoiceQueues']||(_0x12cf1c['attrs']&&_0x12cf1c['attrs'][0x3]?_0x12cf1c[_0x71d852('0x12')][0x3][_0x71d852('0x4f')]:undefined)||[]}];case _0x71d852('0xb'):return[{'name':_0x71d852('0x52'),'type':_0x12cf1c[_0x71d852('0x1c')]||(_0x12cf1c[_0x71d852('0x12')]&&_0x12cf1c[_0x71d852('0x12')][0x0]?_0x12cf1c['attrs'][0x0][_0x71d852('0x57')]:undefined)||null,'value':_0x12cf1c[_0x71d852('0x52')]||(_0x12cf1c['attrs']&&_0x12cf1c[_0x71d852('0x12')][0x0]?_0x12cf1c[_0x71d852('0x12')][0x0]['value']:undefined)||null},{'name':_0x71d852('0x5d'),'value':_0x12cf1c[_0x71d852('0x5d')]||(_0x12cf1c[_0x71d852('0x12')]&&_0x12cf1c[_0x71d852('0x12')][0x1]?_0x12cf1c[_0x71d852('0x12')][0x1][_0x71d852('0x4f')]:undefined)||0x0}];default:return[];}}catch(_0x28fa98){return logger[_0x71d852('0x17')](_0x71d852('0x32'),JSON[_0x71d852('0x42')](_0x28fa98)),[];}}exports[_0x22d097('0x45')]=function(_0x2a2baa,_0x530c64){const _0x3d9a18=_0x22d097;return _0x2a2baa[_0x3d9a18('0x15')]['id']&&delete _0x2a2baa[_0x3d9a18('0x15')]['id'],db[_0x3d9a18('0x36')][_0x3d9a18('0x4b')]({'where':{'id':_0x2a2baa[_0x3d9a18('0x1a')]['id']}})[_0x3d9a18('0x2e')](handleEntityNotFound(_0x530c64,null))[_0x3d9a18('0x2e')](function(_0x384202){const _0x8d1ca4=_0x3d9a18;if(_0x384202)return _0x2a2baa[_0x8d1ca4('0x15')][_0x8d1ca4('0x1f')]=_0x384202['id'],_0x2a2baa[_0x8d1ca4('0x15')][_0x8d1ca4('0x12')]=widgetAttributes(_0x2a2baa[_0x8d1ca4('0x15')]),db[_0x8d1ca4('0x60')][_0x8d1ca4('0x19')](_0x2a2baa[_0x8d1ca4('0x15')]);})[_0x3d9a18('0x2e')](respondWithResult(_0x530c64,null))[_0x3d9a18('0x5a')](handleError(_0x530c64,null));},exports['getItems']=function(_0x3b04c4,_0x48f319){const _0x1707ab=_0x22d097;let _0x5d5415={};const _0x473ffa={};let _0x33f264,_0x69fbf3;return db[_0x1707ab('0x36')]['findOne']({'where':{'id':_0x3b04c4[_0x1707ab('0x1a')]['id']}})['then'](handleEntityNotFound(_0x48f319,null))['then'](function(_0x1b3e95){const _0x1620c6=_0x1707ab;if(_0x1b3e95)return _0x33f264=_0x1b3e95,_0x473ffa['model']=_[_0x1620c6('0x1d')](db[_0x1620c6('0x60')][_0x1620c6('0xc')]),_0x473ffa[_0x1620c6('0x39')]=_[_0x1620c6('0x1d')](_0x3b04c4[_0x1620c6('0x39')]),_0x473ffa[_0x1620c6('0x31')]=_[_0x1620c6('0x2a')](_0x473ffa[_0x1620c6('0x22')],_0x473ffa[_0x1620c6('0x39')]),_0x5d5415[_0x1620c6('0x48')]=_[_0x1620c6('0x2a')](_0x473ffa[_0x1620c6('0x22')],qs['fields'](_0x3b04c4[_0x1620c6('0x39')][_0x1620c6('0x4')])),_0x5d5415[_0x1620c6('0x48')]=_0x5d5415['attributes'][_0x1620c6('0x4a')]?_0x5d5415[_0x1620c6('0x48')]:_0x473ffa[_0x1620c6('0x22')],_0x5d5415[_0x1620c6('0x5')]=qs['sort'](_0x3b04c4[_0x1620c6('0x39')]['sort']),_0x5d5415[_0x1620c6('0x29')]=qs['filters'](_[_0x1620c6('0x3f')](_0x3b04c4[_0x1620c6('0x39')],_0x473ffa['filters'])),_0x3b04c4[_0x1620c6('0x39')][_0x1620c6('0xf')]&&(_0x5d5415[_0x1620c6('0x29')]=_[_0x1620c6('0x2c')](_0x5d5415[_0x1620c6('0x29')],{[Op['or']]:_['map'](_0x5d5415[_0x1620c6('0x48')],function(_0x54ff01){const _0x2c2024=_0x1620c6,_0x2dfa45={};return _0x2dfa45[_0x54ff01]={[Op['like']]:'%'+_0x3b04c4[_0x2c2024('0x39')][_0x2c2024('0xf')]+'%'},_0x2dfa45;})})),_0x5d5415=_['merge']({},_0x5d5415,_0x3b04c4['options']),_0x33f264[_0x1620c6('0x11')](_0x5d5415);})[_0x1707ab('0x2e')](function(_0x25d705){const _0x39f1b0=_0x1707ab;if(_0x25d705)return _0x69fbf3=_0x25d705[_0x39f1b0('0x4a')],typeof _0x3b04c4['query']['nolimit']==='undefined'&&(_0x5d5415[_0x39f1b0('0x56')]=qs[_0x39f1b0('0x56')](_0x3b04c4[_0x39f1b0('0x39')][_0x39f1b0('0x56')]),_0x5d5415[_0x39f1b0('0xe')]=qs[_0x39f1b0('0xe')](_0x3b04c4[_0x39f1b0('0x39')][_0x39f1b0('0xe')])),_0x33f264[_0x39f1b0('0x11')](_0x5d5415);})[_0x1707ab('0x2e')](function(_0x337f8d){if(_0x337f8d)return _0x337f8d?{'count':_0x69fbf3,'rows':_0x337f8d}:null;})[_0x1707ab('0x2e')](respondWithResult(_0x48f319,null))[_0x1707ab('0x5a')](handleError(_0x48f319,null));};
\ No newline at end of file
+const a201_0x4cbd=['Unable\x20to\x20retrieve\x20the\x20current\x20user','attrs','filter','where','status','attrUrl','nolimit','destroy','userProfileId','attrSerie3','json','filters','getItems','omit','stringify','includeAll','like','body','lodash','attrReport','createdAt','model','DashboardItem','merge','sequelize','UserProfileSection','params','pick','attributes','keys','findOne','role','attrFontSize','pie-chart','map','include','name','addItem','attrPath','query','get','register','fields','findAll','DashboardId','limit','iframe','error','UserProfileResource','options','create','order','attrRefresh','show','set','sort','value','attrVoiceQueues','autoAssociation','type','count','https://','attrMetric','counter','attrTimezone','CustomDashboards','updatedAt','undefined','widgetAttributes:\x20%s','intersection','attrHourFormat','../../components/parsers/qs','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','./dashboard.socket','fieldName','rawAttributes','then','stack','user','attrSerie2','web-report','clone','length','reportType','custom','Dashboard','key','update','offset','catch'];(function(_0x118597,_0x1dc6b1){const _0x4cbdd8=function(_0x8a9587){while(--_0x8a9587){_0x118597['push'](_0x118597['shift']());}};_0x4cbdd8(++_0x1dc6b1);}(a201_0x4cbd,0xda));const a201_0x8a95=function(_0x118597,_0x1dc6b1){_0x118597=_0x118597-0x95;let _0x4cbdd8=a201_0x4cbd[_0x118597];return _0x4cbdd8;};const a201_0x1b02c9=a201_0x8a95;'use strict';const _=require(a201_0x1b02c9(0xdb)),qs=require(a201_0x1b02c9(0xb6)),logger=require('../../config/logger')('api'),{getSocket}=require('../../rediscache'),socket=getSocket(),{db}=require('../../mysqldb'),{Op}=require(a201_0x1b02c9(0xe1));require(a201_0x1b02c9(0xb8))[a201_0x1b02c9(0x98)](socket);function respondWithResult(_0x148b45,_0x208840){return _0x208840=_0x208840||0xc8,function(_0x38f82b){const _0x1cb7b8=a201_0x8a95;if(_0x38f82b)return _0x148b45[_0x1cb7b8(0xcd)](_0x208840)['json'](_0x38f82b);};}function respondWithFilteredResult(_0x7b7a3a,_0x3de52d){return function(_0x247919){const _0x599210=a201_0x8a95;if(_0x247919){const _0x506b93=_0x247919[_0x599210(0xab)],_0x301260=_0x3de52d[_0x599210(0xc7)];let _0x45bc04=_0x3de52d[_0x599210(0xc7)]+_0x3de52d[_0x599210(0x9c)],_0x6862af;return _0x45bc04>=_0x506b93?(_0x45bc04=_0x506b93,_0x6862af=0xc8):_0x6862af=0xce,_0x7b7a3a[_0x599210(0xcd)](_0x6862af),_0x7b7a3a[_0x599210(0xa5)]('Content-Range',_0x301260+'-'+_0x45bc04+'/'+_0x506b93)[_0x599210(0xd3)](_0x247919);}return null;};}function saveUpdates(_0x28b19d){return function(_0x8702c9){const _0x2c0423=a201_0x8a95;if(_0x8702c9)return _0x8702c9['update'](_0x28b19d)[_0x2c0423(0xbb)](function(_0x1e9f4b){return _0x1e9f4b;});return null;};}function removeEntity(_0x315e3e){return function(_0x1e4ed4){const _0x362269=a201_0x8a95;if(_0x1e4ed4)return _0x1e4ed4[_0x362269(0xd0)]()[_0x362269(0xbb)](function(){const _0x406a9e=_0x362269,_0xbedb2e=_0x1e4ed4[_0x406a9e(0x97)]({'plain':!![]}),_0x2a899a=_0x406a9e(0xb0);return db['UserProfileResource'][_0x406a9e(0xd0)]({'where':{'type':_0x2a899a,'resourceId':_0xbedb2e['id']}})[_0x406a9e(0xbb)](function(){return _0x1e4ed4;});})[_0x362269(0xbb)](function(){const _0x3493d3=_0x362269;_0x315e3e[_0x3493d3(0xcd)](0xcc)['end']();});};}function handleEntityNotFound(_0x27aa47){return function(_0x5d6877){return!_0x5d6877&&_0x27aa47['sendStatus'](0x194),_0x5d6877;};}function handleError(_0x28ab37,_0x3c957f){return _0x3c957f=_0x3c957f||0x1f4,function(_0x386349){const _0xa687d7=a201_0x8a95;logger[_0xa687d7(0x9e)](_0x386349[_0xa687d7(0xbc)]),_0x386349[_0xa687d7(0xed)]&&delete _0x386349[_0xa687d7(0xed)],_0x28ab37[_0xa687d7(0xcd)](_0x3c957f)['send'](_0x386349);};}exports['index']=function(_0x188568,_0x400094){const _0x39b966=a201_0x1b02c9;let _0x2fa533={};const _0x121dac={},_0xa7badc={'count':0x0,'rows':[]},_0x41c993=_['map'](db[_0x39b966(0xc4)][_0x39b966(0xba)],function(_0x575639){const _0x50cf7e=_0x39b966;return{'name':_0x575639[_0x50cf7e(0xb9)],'type':_0x575639[_0x50cf7e(0xaa)][_0x50cf7e(0xc5)]};});_0x121dac[_0x39b966(0xde)]=_[_0x39b966(0xeb)](_0x41c993,'name'),_0x121dac[_0x39b966(0x96)]=_['keys'](_0x188568[_0x39b966(0x96)]),_0x121dac['filters']=_[_0x39b966(0xb4)](_0x121dac[_0x39b966(0xde)],_0x121dac[_0x39b966(0x96)]),_0x2fa533['attributes']=_['intersection'](_0x121dac['model'],qs[_0x39b966(0x99)](_0x188568[_0x39b966(0x96)][_0x39b966(0x99)])),_0x2fa533[_0x39b966(0xe5)]=_0x2fa533['attributes'][_0x39b966(0xc1)]?_0x2fa533[_0x39b966(0xe5)]:_0x121dac[_0x39b966(0xde)];typeof _0x188568['query'][_0x39b966(0xcf)]==='undefined'&&(_0x2fa533['limit']=qs[_0x39b966(0x9c)](_0x188568[_0x39b966(0x96)][_0x39b966(0x9c)]),_0x2fa533['offset']=qs['offset'](_0x188568[_0x39b966(0x96)][_0x39b966(0xc7)]));_0x2fa533[_0x39b966(0xa2)]=qs[_0x39b966(0xa6)](_0x188568[_0x39b966(0x96)][_0x39b966(0xa6)]),_0x2fa533[_0x39b966(0xcc)]=qs[_0x39b966(0xd4)](_[_0x39b966(0xe4)](_0x188568[_0x39b966(0x96)],_0x121dac[_0x39b966(0xd4)]),_0x41c993);_0x188568[_0x39b966(0x96)]['filter']&&(_0x2fa533[_0x39b966(0xcc)]=_['merge'](_0x2fa533[_0x39b966(0xcc)],{[Op['or']]:_[_0x39b966(0xeb)](_0x41c993,function(_0x4e8647){const _0x16b6e2=_0x39b966;if(_0x4e8647[_0x16b6e2(0xaa)]!=='VIRTUAL'){const _0x4d7221={};return _0x4d7221[_0x4e8647[_0x16b6e2(0xed)]]={[Op[_0x16b6e2(0xd9)]]:'%'+_0x188568[_0x16b6e2(0x96)][_0x16b6e2(0xcb)]+'%'},_0x4d7221;}})}));_0x2fa533=_[_0x39b966(0xe0)]({},_0x2fa533,_0x188568[_0x39b966(0xa0)]);const _0x536e70={'where':_0x2fa533[_0x39b966(0xcc)]};return db['Dashboard'][_0x39b966(0xab)](_0x536e70)['then'](function(_0x3221f7){const _0x52346d=_0x39b966;return _0xa7badc['count']=_0x3221f7,_0x188568[_0x52346d(0x96)][_0x52346d(0xd8)]&&(_0x2fa533['include']=[{'all':!![]}]),db[_0x52346d(0xc4)][_0x52346d(0x9a)](_0x2fa533);})[_0x39b966(0xbb)](function(_0x4cdb57){return _0xa7badc['rows']=_0x4cdb57,_0xa7badc;})[_0x39b966(0xbb)](respondWithFilteredResult(_0x400094,_0x2fa533))[_0x39b966(0xc8)](handleError(_0x400094,null));},exports[a201_0x1b02c9(0xa4)]=function(_0x19149f,_0x35f148){const _0x35083d=a201_0x1b02c9;let _0x504207={'raw':![],'where':{'id':_0x19149f[_0x35083d(0xe3)]['id']}};const _0x25d229={};return _0x25d229[_0x35083d(0xde)]=_[_0x35083d(0xe6)](db[_0x35083d(0xc4)]['rawAttributes']),_0x25d229[_0x35083d(0x96)]=_[_0x35083d(0xe6)](_0x19149f[_0x35083d(0x96)]),_0x25d229[_0x35083d(0xd4)]=_[_0x35083d(0xb4)](_0x25d229[_0x35083d(0xde)],_0x25d229[_0x35083d(0x96)]),_0x504207[_0x35083d(0xe5)]=_[_0x35083d(0xb4)](_0x25d229[_0x35083d(0xde)],qs[_0x35083d(0x99)](_0x19149f[_0x35083d(0x96)][_0x35083d(0x99)])),_0x504207[_0x35083d(0xe5)]=_0x504207[_0x35083d(0xe5)][_0x35083d(0xc1)]?_0x504207[_0x35083d(0xe5)]:_0x25d229['model'],_0x19149f['query'][_0x35083d(0xd8)]&&(_0x504207[_0x35083d(0xec)]=[{'all':!![]}]),_0x504207=_[_0x35083d(0xe0)]({},_0x504207,_0x19149f[_0x35083d(0xa0)]),db[_0x35083d(0xc4)][_0x35083d(0xe7)](_0x504207)[_0x35083d(0xbb)](handleEntityNotFound(_0x35f148,null))['then'](respondWithResult(_0x35f148,null))['catch'](handleError(_0x35f148,null));},exports[a201_0x1b02c9(0xa1)]=function(_0x129fbc,_0xfe39cc){const _0x4abca6=a201_0x1b02c9;return db[_0x4abca6(0xc4)][_0x4abca6(0xa1)](_0x129fbc[_0x4abca6(0xda)],{})['then'](function(_0x2e3646){const _0x552a99=_0x4abca6,_0x5f4bdb=_0x129fbc[_0x552a99(0xbd)][_0x552a99(0x97)]({'plain':!![]});if(!_0x5f4bdb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f4bdb['role']===_0x552a99(0xbd)){const _0x44929f=_0x2e3646[_0x552a99(0x97)]({'plain':!![]}),_0x5c5cb5=_0x552a99(0xb0);return db[_0x552a99(0xe2)]['findOne']({'where':{'name':_0x5c5cb5,'userProfileId':_0x5f4bdb['userProfileId']},'raw':!![]})[_0x552a99(0xbb)](function(_0x285476){const _0x5ca9e2=_0x552a99;return _0x285476&&_0x285476[_0x5ca9e2(0xa9)]===0x0?db['UserProfileResource'][_0x5ca9e2(0xa1)]({'name':_0x44929f[_0x5ca9e2(0xed)],'resourceId':_0x44929f['id'],'type':_0x285476[_0x5ca9e2(0xed)],'sectionId':_0x285476['id']},{})[_0x5ca9e2(0xbb)](function(){return _0x2e3646;}):_0x2e3646;})[_0x552a99(0xc8)](function(_0x1df078){const _0x4db056=_0x552a99;logger[_0x4db056(0x9e)]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1df078);throw _0x1df078;});}return _0x2e3646;})[_0x4abca6(0xbb)](respondWithResult(_0xfe39cc,0xc9))[_0x4abca6(0xc8)](handleError(_0xfe39cc,null));},exports[a201_0x1b02c9(0xc0)]=function(_0xb0352,_0x41582e){const _0x10562d=a201_0x1b02c9;let _0x20989d={'where':{'id':_0xb0352['params']['id']}};const _0x4afc32={};return _0x4afc32['model']=_[_0x10562d(0xe6)](db[_0x10562d(0xc4)]['rawAttributes']),_0x20989d[_0x10562d(0xe5)]=_['intersection'](_0x4afc32[_0x10562d(0xde)],qs[_0x10562d(0x99)](_0xb0352[_0x10562d(0x96)][_0x10562d(0x99)])),_0x20989d[_0x10562d(0xe5)]=_0x20989d[_0x10562d(0xe5)]['length']?_0x20989d[_0x10562d(0xe5)]:_0x4afc32['model'],_0xb0352[_0x10562d(0x96)][_0x10562d(0xd8)]&&(_0x20989d[_0x10562d(0xec)]=[{'all':!![]}]),_0x20989d=_[_0x10562d(0xe0)]({},_0x20989d,_0xb0352[_0x10562d(0xa0)]),db[_0x10562d(0xc4)][_0x10562d(0xe7)](_0x20989d)[_0x10562d(0xbb)](handleEntityNotFound(_0x41582e,null))[_0x10562d(0xbb)](function(_0x355b46){const _0x54858b=_0x10562d;if(_0x355b46){let _0xdf3b13=_0x355b46[_0x54858b(0x97)]({'plain':!![]});return _0xdf3b13=qs[_0x54858b(0xd6)](_0xdf3b13,['id','createdAt',_0x54858b(0xb1)]),_0xb0352[_0x54858b(0xda)]=_[_0x54858b(0xd6)](_0xb0352['body'],['id',_0x54858b(0xdd),'updatedAt']),db['Dashboard'][_0x54858b(0xa1)](_[_0x54858b(0xe0)](_0xdf3b13,_0xb0352[_0x54858b(0xda)]),{'include':_0xb0352[_0x54858b(0x96)][_0x54858b(0xd8)]?[{'all':!![]}]:undefined})['then'](function(_0xfa6602){const _0x50c8c8=_0x54858b,_0x5bf9ab=_0xb0352[_0x50c8c8(0xbd)]['get']({'plain':!![]});if(!_0x5bf9ab)throw new Error(_0x50c8c8(0xc9));if(_0x5bf9ab[_0x50c8c8(0xe8)]===_0x50c8c8(0xbd)){const _0x540018=_0xfa6602[_0x50c8c8(0x97)]({'plain':!![]}),_0x1b091a=_0x50c8c8(0xb0);return db['UserProfileSection'][_0x50c8c8(0xe7)]({'where':{'name':_0x1b091a,'userProfileId':_0x5bf9ab[_0x50c8c8(0xd1)]},'raw':!![]})[_0x50c8c8(0xbb)](function(_0x3c4860){const _0x49855e=_0x50c8c8;return _0x3c4860&&_0x3c4860[_0x49855e(0xa9)]===0x0?db[_0x49855e(0x9f)][_0x49855e(0xa1)]({'name':_0x540018[_0x49855e(0xed)],'resourceId':_0x540018['id'],'type':_0x3c4860[_0x49855e(0xed)],'sectionId':_0x3c4860['id']},{})['then'](function(){return _0xfa6602;}):_0xfa6602;})[_0x50c8c8(0xc8)](function(_0x2f3ffa){const _0x56c7ae=_0x50c8c8;logger[_0x56c7ae(0x9e)](_0x56c7ae(0xb7),_0x2f3ffa);throw _0x2f3ffa;});}return _0xfa6602;});}})[_0x10562d(0xbb)](respondWithResult(_0x41582e,0xc9))[_0x10562d(0xc8)](handleError(_0x41582e,null));},exports[a201_0x1b02c9(0xc6)]=function(_0x1bf02b,_0x487368){const _0x334ea8=a201_0x1b02c9;return _0x1bf02b[_0x334ea8(0xda)]['id']&&delete _0x1bf02b[_0x334ea8(0xda)]['id'],db[_0x334ea8(0xc4)]['findOne']({'where':{'id':_0x1bf02b[_0x334ea8(0xe3)]['id']}})[_0x334ea8(0xbb)](handleEntityNotFound(_0x487368,null))[_0x334ea8(0xbb)](saveUpdates(_0x1bf02b[_0x334ea8(0xda)],null))[_0x334ea8(0xbb)](respondWithResult(_0x487368,null))[_0x334ea8(0xc8)](handleError(_0x487368,null));},exports['destroy']=function(_0x5aa6df,_0x49e976){const _0x336f06=a201_0x1b02c9;return db['Dashboard'][_0x336f06(0xe7)]({'where':{'id':_0x5aa6df['params']['id']}})['then'](handleEntityNotFound(_0x49e976,null))[_0x336f06(0xbb)](removeEntity(_0x49e976,null))[_0x336f06(0xc8)](handleError(_0x49e976,null));};function widgetAttributes(_0xf22c1){const _0x18db0b=a201_0x1b02c9;try{switch(_0xf22c1[_0x18db0b(0xaa)]){case _0x18db0b(0x9d):return[{'name':_0x18db0b(0xce),'value':_0xf22c1[_0x18db0b(0xce)]||(_0xf22c1[_0x18db0b(0xca)]&&_0xf22c1[_0x18db0b(0xca)][0x0]?_0xf22c1[_0x18db0b(0xca)][0x0][_0x18db0b(0xa7)]:undefined)||_0x18db0b(0xac)}];case _0x18db0b(0xc3):return[{'name':_0x18db0b(0x95),'value':_0xf22c1[_0x18db0b(0x95)]||(_0xf22c1[_0x18db0b(0xca)]&&_0xf22c1[_0x18db0b(0xca)][0x0]?_0xf22c1[_0x18db0b(0xca)][0x0][_0x18db0b(0xa7)]:undefined)||''}];case'clock':return[{'name':_0x18db0b(0xb5),'value':_0xf22c1[_0x18db0b(0xb5)]||(_0xf22c1[_0x18db0b(0xca)]&&_0xf22c1[_0x18db0b(0xca)][0x0]?_0xf22c1[_0x18db0b(0xca)][0x0][_0x18db0b(0xa7)]:undefined)||'HH:mm:ss'},{'name':_0x18db0b(0xaf),'value':_0xf22c1[_0x18db0b(0xaf)]||(_0xf22c1[_0x18db0b(0xca)]&&_0xf22c1[_0x18db0b(0xca)][0x1]?_0xf22c1[_0x18db0b(0xca)][0x1][_0x18db0b(0xa7)]:undefined)||'0.00'},{'name':_0x18db0b(0xe9),'value':_0xf22c1['attrFontSize']||(_0xf22c1[_0x18db0b(0xca)]&&_0xf22c1[_0x18db0b(0xca)][0x2]?_0xf22c1[_0x18db0b(0xca)][0x2][_0x18db0b(0xa7)]:undefined)||0xc}];case _0x18db0b(0xae):return[{'name':_0x18db0b(0xad),'value':_0xf22c1[_0x18db0b(0xad)]||(_0xf22c1[_0x18db0b(0xca)]&&_0xf22c1['attrs'][0x0]?_0xf22c1[_0x18db0b(0xca)][0x0][_0x18db0b(0xa7)]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0xf22c1[_0x18db0b(0xa8)]||(_0xf22c1[_0x18db0b(0xca)]&&_0xf22c1[_0x18db0b(0xca)][0x1]?_0xf22c1['attrs'][0x1][_0x18db0b(0xa7)]:undefined)||[]},{'name':_0x18db0b(0xe9),'value':_0xf22c1['attrFontSize']||(_0xf22c1[_0x18db0b(0xca)]&&_0xf22c1[_0x18db0b(0xca)][0x2]?_0xf22c1[_0x18db0b(0xca)][0x2]['value']:undefined)||0x14}];case'multibar-chart':case _0x18db0b(0xea):return[{'name':'attrSerie1','value':_0xf22c1['attrSerie1']||(_0xf22c1[_0x18db0b(0xca)]&&_0xf22c1[_0x18db0b(0xca)][0x0]?_0xf22c1[_0x18db0b(0xca)][0x0]['value']:undefined)||'total'},{'name':'attrSerie2','value':_0xf22c1[_0x18db0b(0xbe)]||(_0xf22c1['attrs']&&_0xf22c1[_0x18db0b(0xca)][0x1]?_0xf22c1[_0x18db0b(0xca)][0x1]['value']:undefined)||null},{'name':_0x18db0b(0xd2),'value':_0xf22c1[_0x18db0b(0xd2)]||(_0xf22c1['attrs']&&_0xf22c1['attrs'][0x2]?_0xf22c1[_0x18db0b(0xca)][0x2]['value']:undefined)||null},{'name':_0x18db0b(0xa8),'value':_0xf22c1[_0x18db0b(0xa8)]||(_0xf22c1[_0x18db0b(0xca)]&&_0xf22c1['attrs'][0x3]?_0xf22c1[_0x18db0b(0xca)][0x3][_0x18db0b(0xa7)]:undefined)||[]}];case _0x18db0b(0xbf):return[{'name':'attrReport','type':_0xf22c1[_0x18db0b(0xc2)]||(_0xf22c1[_0x18db0b(0xca)]&&_0xf22c1[_0x18db0b(0xca)][0x0]?_0xf22c1[_0x18db0b(0xca)][0x0][_0x18db0b(0xaa)]:undefined)||null,'value':_0xf22c1[_0x18db0b(0xdc)]||(_0xf22c1['attrs']&&_0xf22c1[_0x18db0b(0xca)][0x0]?_0xf22c1[_0x18db0b(0xca)][0x0]['value']:undefined)||null},{'name':_0x18db0b(0xa3),'value':_0xf22c1[_0x18db0b(0xa3)]||(_0xf22c1['attrs']&&_0xf22c1[_0x18db0b(0xca)][0x1]?_0xf22c1[_0x18db0b(0xca)][0x1][_0x18db0b(0xa7)]:undefined)||0x0}];default:return[];}}catch(_0x52c5d7){return logger[_0x18db0b(0x9e)](_0x18db0b(0xb3),JSON[_0x18db0b(0xd7)](_0x52c5d7)),[];}}exports[a201_0x1b02c9(0xee)]=function(_0x53515c,_0x24f856){const _0x59786a=a201_0x1b02c9;return _0x53515c['body']['id']&&delete _0x53515c['body']['id'],db['Dashboard']['findOne']({'where':{'id':_0x53515c[_0x59786a(0xe3)]['id']}})['then'](handleEntityNotFound(_0x24f856,null))[_0x59786a(0xbb)](function(_0x4f516e){const _0x24b2a4=_0x59786a;if(_0x4f516e)return _0x53515c[_0x24b2a4(0xda)][_0x24b2a4(0x9b)]=_0x4f516e['id'],_0x53515c[_0x24b2a4(0xda)][_0x24b2a4(0xca)]=widgetAttributes(_0x53515c[_0x24b2a4(0xda)]),db[_0x24b2a4(0xdf)][_0x24b2a4(0xa1)](_0x53515c[_0x24b2a4(0xda)]);})['then'](respondWithResult(_0x24f856,null))[_0x59786a(0xc8)](handleError(_0x24f856,null));},exports['getItems']=function(_0x516290,_0x466289){const _0x5a47b9=a201_0x1b02c9;let _0x48ee56={};const _0x2889a4={};let _0x4fcd6a,_0xbedf52;return db[_0x5a47b9(0xc4)][_0x5a47b9(0xe7)]({'where':{'id':_0x516290[_0x5a47b9(0xe3)]['id']}})[_0x5a47b9(0xbb)](handleEntityNotFound(_0x466289,null))['then'](function(_0x2ac722){const _0x19d34f=_0x5a47b9;if(_0x2ac722)return _0x4fcd6a=_0x2ac722,_0x2889a4[_0x19d34f(0xde)]=_['keys'](db[_0x19d34f(0xdf)]['rawAttributes']),_0x2889a4[_0x19d34f(0x96)]=_[_0x19d34f(0xe6)](_0x516290[_0x19d34f(0x96)]),_0x2889a4['filters']=_[_0x19d34f(0xb4)](_0x2889a4[_0x19d34f(0xde)],_0x2889a4[_0x19d34f(0x96)]),_0x48ee56[_0x19d34f(0xe5)]=_[_0x19d34f(0xb4)](_0x2889a4[_0x19d34f(0xde)],qs['fields'](_0x516290['query'][_0x19d34f(0x99)])),_0x48ee56[_0x19d34f(0xe5)]=_0x48ee56[_0x19d34f(0xe5)][_0x19d34f(0xc1)]?_0x48ee56[_0x19d34f(0xe5)]:_0x2889a4[_0x19d34f(0xde)],_0x48ee56[_0x19d34f(0xa2)]=qs['sort'](_0x516290[_0x19d34f(0x96)][_0x19d34f(0xa6)]),_0x48ee56[_0x19d34f(0xcc)]=qs[_0x19d34f(0xd4)](_[_0x19d34f(0xe4)](_0x516290[_0x19d34f(0x96)],_0x2889a4[_0x19d34f(0xd4)])),_0x516290[_0x19d34f(0x96)][_0x19d34f(0xcb)]&&(_0x48ee56[_0x19d34f(0xcc)]=_['merge'](_0x48ee56['where'],{[Op['or']]:_[_0x19d34f(0xeb)](_0x48ee56[_0x19d34f(0xe5)],function(_0xc06f8d){const _0x3f6f4c=_0x19d34f,_0x559bb0={};return _0x559bb0[_0xc06f8d]={[Op['like']]:'%'+_0x516290['query'][_0x3f6f4c(0xcb)]+'%'},_0x559bb0;})})),_0x48ee56=_['merge']({},_0x48ee56,_0x516290[_0x19d34f(0xa0)]),_0x4fcd6a[_0x19d34f(0xd5)](_0x48ee56);})['then'](function(_0x3803de){const _0x55e838=_0x5a47b9;if(_0x3803de)return _0xbedf52=_0x3803de[_0x55e838(0xc1)],typeof _0x516290[_0x55e838(0x96)]['nolimit']===_0x55e838(0xb2)&&(_0x48ee56[_0x55e838(0x9c)]=qs[_0x55e838(0x9c)](_0x516290[_0x55e838(0x96)][_0x55e838(0x9c)]),_0x48ee56[_0x55e838(0xc7)]=qs[_0x55e838(0xc7)](_0x516290['query'][_0x55e838(0xc7)])),_0x4fcd6a[_0x55e838(0xd5)](_0x48ee56);})[_0x5a47b9(0xbb)](function(_0x33ba3){if(_0x33ba3)return _0x33ba3?{'count':_0xbedf52,'rows':_0x33ba3}:null;})[_0x5a47b9(0xbb)](respondWithResult(_0x466289,null))[_0x5a47b9(0xc8)](handleError(_0x466289,null));};
\ No newline at end of file