Built motion from commit da617fac.|2.6.6
[motion2.git] / server / api / realtime / realtime.controller.js
index b71810a..d1a8265 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02f4=['catch','loggedIn','waiting','talking','paused','push','pTalking','originated','message','dialActive','Trunk','startPredictive','startProgressive','erlangCalls','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','agents','loggedInDb','available','busy','find','pick','filter','queue','length','connectedlinenum','internal','toString','getMembers','UserId','online','voiceStatus','startCase','findAll','QueueId','unknown','unavailable','ringing','chatPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','idle','pause','chatStatus','openchannelStatus','smsStatus','*pause','mail','sms','openchannel','fax','whatsapp','includes','Invalid\x20channel','toLowerCase','findOne','getAgents','uniq','value','split','fields','startsWith','DESC','ASC','sort','globalStatus','pauseType','userpic','lastLoginAt','lastPauseAt','faxPause','openchannelCapacity','smsCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','mailStatus','whatsappStatus','faxStatus','openchannelStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','routealias','resolve','query','channel','join','order','globalQueueFilter','Queue','User','fieldName','type','role','agent','raw','isEmpty','where','user','userProfileId','nolimit','UserProfile','getResources','findAndCountAll','rows','omit','globalStatusFilter','pauseTypeFilter','getQueues','key','getOptions','QueueCampaigns','all','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','undefined','limit','count','offset','status','set','Content-Range','stack','name','send','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','merge','voice','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels'];(function(_0x4cc242,_0x3cc198){var _0x19b778=function(_0x2a2698){while(--_0x2a2698){_0x4cc242['push'](_0x4cc242['shift']());}};_0x19b778(++_0x3cc198);}(_0x02f4,0x1ca));var _0x402f=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x02f4[_0x19950b];return _0x3c6b41;};'use strict';var util=require(_0x402f('0x0'));var _=require(_0x402f('0x1'));var jayson=require(_0x402f('0x2'));var qs=require(_0x402f('0x3'));var logger=require(_0x402f('0x4'))(_0x402f('0x5'));var db=require(_0x402f('0x6'))['db'];var amiClient=jayson[_0x402f('0x7')][_0x402f('0x8')]({'port':0x232a});var routingClient=jayson[_0x402f('0x7')][_0x402f('0x8')]({'port':0x232c});function respondWithFilteredResult(_0x26163b,_0x3bb076){return function(_0x32ef06){if(_0x32ef06){var _0x3a57d2=typeof _0x3bb076['offset']===_0x402f('0x9')&&typeof _0x3bb076[_0x402f('0xa')]===_0x402f('0x9');var _0x4fdf54=_0x32ef06[_0x402f('0xb')];var _0x14d149=_0x3a57d2?0x0:_0x3bb076[_0x402f('0xc')];var _0x5838a1=_0x3a57d2?_0x32ef06[_0x402f('0xb')]:_0x3bb076['offset']+_0x3bb076['limit'];var _0x47f3f5;if(_0x5838a1>=_0x4fdf54){_0x5838a1=_0x4fdf54;_0x47f3f5=0xc8;}else{_0x47f3f5=0xce;}_0x26163b[_0x402f('0xd')](_0x47f3f5);return _0x26163b[_0x402f('0xe')](_0x402f('0xf'),_0x14d149+'-'+_0x5838a1+'/'+_0x4fdf54)['json'](_0x32ef06);}return null;};}function handleError(_0x3d0b0a,_0x19e430){_0x19e430=_0x19e430||0x1f4;return function(_0x13ea2b){logger['error'](_0x13ea2b[_0x402f('0x10')]);if(_0x13ea2b[_0x402f('0x11')]){delete _0x13ea2b[_0x402f('0x11')];}_0x3d0b0a[_0x402f('0xd')](_0x19e430)[_0x402f('0x12')](_0x13ea2b);};}function getRealtimeAgents(){return new Promise(function(_0x6c35e0,_0x4bab32){return amiClient['request'](_0x402f('0x13'),{})[_0x402f('0x14')](function(_0x48e11a){if(_0x48e11a[_0x402f('0x15')])throw new Error(_0x402f('0x16'));var _0x57f749=_0x48e11a[_0x402f('0x17')];return routingClient[_0x402f('0x18')](_0x402f('0x13'),{})[_0x402f('0x14')](function(_0x397724){if(_0x397724['error'])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x123825=_0x397724[_0x402f('0x17')];return _0x6c35e0(_[_0x402f('0x19')]({},_0x57f749,_0x123825));});})['catch'](function(_0x242267){_0x4bab32(_0x242267);});});}function getRealtimeQueues(_0x55dc66,_0x6d02f4){return new Promise(function(_0x427a70,_0x599bce){var _0x1c8875=_0x6d02f4===_0x402f('0x1a')?amiClient:routingClient;return _0x1c8875[_0x402f('0x18')](_['startCase'](_0x6d02f4)+_0x402f('0x1b'),_0x55dc66)['then'](function(_0xb9bd72){if(_0xb9bd72['error'])throw new Error(util[_0x402f('0x1c')](_0x402f('0x1d'),_0x6d02f4));return _0x427a70(_0xb9bd72[_0x402f('0x17')]);})['catch'](function(_0x275650){_0x599bce(_0x275650);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x12af02,_0x4e81f2){return amiClient[_0x402f('0x18')]('VoiceQueuesChannels',{})[_0x402f('0x14')](function(_0x11809f){if(_0x11809f['error'])throw new Error(_0x402f('0x1e'));return _0x12af02(_0x11809f[_0x402f('0x17')]);})[_0x402f('0x1f')](function(_0x196be8){_0x4e81f2(_0x196be8);});});}function initializeQueues(_0x547fec,_0x88e766,_0x41a4e0,_0x56bde3){var _0x623528=[_0x402f('0x20'),'available',_0x402f('0x21'),_0x402f('0x22'),_0x402f('0x23')];if(_0x41a4e0==='voice'&&_0x56bde3==='outbound'){_0x623528[_0x402f('0x24')](_0x402f('0x25'),_0x402f('0x26'),_0x402f('0x27'),_0x402f('0x28'),'dialMethod',_0x402f('0x29'),_0x402f('0x2a'),_0x402f('0x2b'),_0x402f('0x2c'),'erlangCallToSecond',_0x402f('0x2d'),'erlangBusyFactor',_0x402f('0x2e'),_0x402f('0x2f'),_0x402f('0x30'),_0x402f('0x31'),'predictiveIntervalTotalCalls',_0x402f('0x32'),_0x402f('0x33'),_0x402f('0x34'),_0x402f('0x35'),_0x402f('0x36'));}return _0x547fec[_0x402f('0x37')](function(_0x10d8b5){var _0x290bb1=_0x10d8b5[_0x402f('0x38')]({'plain':!![]});_0x290bb1[_0x402f('0x39')]=[];_0x290bb1['paused']=0x0;_0x290bb1[_0x402f('0x3a')]=0x0;_0x290bb1['loggedIn']=0x0;_0x290bb1[_0x402f('0x3b')]=0x0;_0x290bb1[_0x402f('0x21')]=0x0;if(_0x41a4e0===_0x402f('0x1a')){_0x290bb1['talking']=0x0;_0x290bb1[_0x402f('0x3c')]=0x0;if(_0x56bde3==='outbound'){_0x290bb1['pTalking']=0x0;_0x290bb1[_0x402f('0x26')]=0x0;}}var _0x153c0f=_[_0x402f('0x3d')](_0x88e766,['id',_0x290bb1['id']]);if(_0x153c0f)_[_0x402f('0x19')](_0x290bb1,_[_0x402f('0x3e')](_0x153c0f,_0x623528));return _0x290bb1;});}function updateAgentVoiceStatus(_0x43382c,_0x2ff2ef,_0x1a5ca7){var _0x540819=_[_0x402f('0x3f')](_0x1a5ca7,[_0x402f('0x40'),_0x2ff2ef[_0x402f('0x11')]]);if(_0x540819[_0x402f('0x41')]===0x0)return _0x43382c[_0x402f('0x3c')]=!![];if(_['some'](_0x540819,[_0x402f('0x42'),_0x43382c[_0x402f('0x43')][_0x402f('0x44')]()]))return _0x43382c[_0x402f('0x22')]=!![];if(!_0x43382c[_0x402f('0x22')])return _0x43382c['busy']=!![];}function getVoiceQueueAgents(_0x58ee7a,_0xba1b90,_0x4d8b3f,_0x1ad471){var _0x239d41=_[_0x402f('0x3d')](_0xba1b90,['id',_0x58ee7a['id']]);if(!_0x239d41)return _0x58ee7a;return _0x239d41[_0x402f('0x45')]({'raw':!![]})['then'](function(_0x4e7552){for(var _0x11d001=0x0;_0x11d001<_0x4e7552[_0x402f('0x41')];_0x11d001++){var _0x226953=_['find'](_0x4d8b3f,['id',_0x4e7552[_0x11d001][_0x402f('0x46')]]);if(!_0x226953){_0x226953={'id':_0x4e7552[_0x11d001]['UserId'],'name':_0x4e7552[_0x11d001][_0x402f('0x46')],'accountcode':'','online':![]};}var _0x17976b={'id':_0x226953['id'],'name':_0x226953[_0x402f('0x11')],'internal':_0x226953['accountcode'],'online':Boolean(_0x226953[_0x402f('0x47')]),'paused':Boolean(_0x4e7552[_0x11d001]['paused'])};if(_0x226953[_0x402f('0x48')]===_0x402f('0x22'))updateAgentVoiceStatus(_0x17976b,_0x58ee7a,_0x1ad471);if(_0x17976b['online'])_0x58ee7a['loggedInDb']++;if(_0x17976b['busy'])_0x58ee7a['busy']++;if(_0x17976b[_0x402f('0x23')]&&!_0x17976b[_0x402f('0x3c')]&&!_0x17976b[_0x402f('0x22')])_0x58ee7a[_0x402f('0x23')]++;_0x58ee7a[_0x402f('0x39')]['push'](_0x17976b);}return _0x58ee7a;});}function getQueueAgents(_0x4dd2d2,_0x545251,_0x45e2d5){var _0xeede2='User'+_[_0x402f('0x49')](_0x45e2d5)+'Queue';var _0x46ffac=_0x45e2d5+'Pause';return db[_0xeede2][_0x402f('0x4a')]({'where':{[_[_0x402f('0x49')](_0x45e2d5)+_0x402f('0x4b')]:_0x4dd2d2['id']},'raw':!![]})[_0x402f('0x14')](function(_0x20024e){for(var _0x25509e=0x0;_0x25509e<_0x20024e[_0x402f('0x41')];_0x25509e++){var _0x3da75b=_[_0x402f('0x3d')](_0x545251,['id',_0x20024e[_0x25509e][_0x402f('0x46')]]);if(!_0x3da75b){_0x3da75b={'id':_0x20024e[_0x25509e][_0x402f('0x46')],'name':_0x20024e[_0x25509e][_0x402f('0x46')],'online':![],['pauseField']:![]};}var _0x42078f={'id':_0x3da75b['id'],'name':_0x3da75b[_0x402f('0x11')],'online':Boolean(_0x3da75b[_0x402f('0x47')]),'paused':Boolean(_0x3da75b[_0x46ffac])};if(_0x42078f[_0x402f('0x47')])_0x4dd2d2[_0x402f('0x3a')]++;_0x4dd2d2[_0x402f('0x39')][_0x402f('0x24')](_0x42078f);}return _0x4dd2d2;});}function isIdle(_0x1283a2){return _0x1283a2==='idle'||_0x1283a2===_0x402f('0x4c')||_0x1283a2===_0x402f('0x4d')||_0x1283a2===_0x402f('0x4e')||_['isNil'](_0x1283a2);}function isAgentPaused(_0x16ef52,_0x45e0a2){var _0x4ceb14=[_0x16ef52[_0x402f('0x4f')],_0x16ef52['faxPause'],_0x16ef52[_0x402f('0x50')],_0x16ef52[_0x402f('0x51')],_0x16ef52[_0x402f('0x52')],_0x16ef52[_0x402f('0x53')],_0x16ef52[_0x402f('0x54')]];if(!_0x45e0a2)return _[_0x402f('0x55')](_0x4ceb14);var _0x21b8c9=_[_0x402f('0x3f')](_0x4ceb14);return _0x21b8c9[_0x402f('0x41')]>0x0&&_0x21b8c9['length']<_0x4ceb14[_0x402f('0x41')]?!![]:![];}function isAgentIdle(_0x3fefdb){if(_0x3fefdb[_0x402f('0x48')]!==_0x402f('0x56')&&_0x3fefdb['voicePause']){_0x3fefdb[_0x402f('0x48')]=_0x402f('0x57');return![];}return _['every']([_0x3fefdb[_0x402f('0x58')],_0x3fefdb['faxStatus'],_0x3fefdb['mailStatus'],_0x3fefdb[_0x402f('0x59')],_0x3fefdb[_0x402f('0x5a')],_0x3fefdb[_0x402f('0x48')],_0x3fefdb['whatsappStatus']],isIdle);}function getAgentStatus(_0x414c87){var _0x3340ee=_0x402f('0x4c');if(isAgentPaused(_0x414c87))_0x3340ee=_0x402f('0x57');else if(isAgentPaused(_0x414c87,!![]))_0x3340ee=_0x402f('0x5b');else if(isAgentIdle(_0x414c87))_0x3340ee=_0x402f('0x56');else _0x3340ee=_0x402f('0x3c');return _0x3340ee;}function validateChannel(_0x1df989){var _0x5a70fc=[_0x402f('0x5c'),'chat',_0x402f('0x5d'),_0x402f('0x5e'),_0x402f('0x5f'),_0x402f('0x60'),'voice'];if(!_[_0x402f('0x61')](_0x5a70fc,_0x1df989['toLowerCase']()))throw new Error(_0x402f('0x62'));return _0x1df989[_0x402f('0x63')]();}function getFilteredAgentIds(_0x5bafae,_0x3e4191){var _0x41572c=_['isArray'](_0x5bafae)?_0x5bafae:[_0x5bafae];var _0x3705b2=_['map'](_0x41572c,function(_0x50d456){return db[_0x3e4191][_0x402f('0x64')]({'where':{'name':_0x50d456}})['then'](function(_0x32014f){if(!_0x32014f)return[];return _0x32014f[_0x402f('0x65')]({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x3705b2)[_0x402f('0x14')](function(_0x37f1aa){var _0x30ec81=_(_0x37f1aa)['flatten']()['map']('id')[_0x402f('0x66')]()[_0x402f('0x67')]();return _0x30ec81;});}function getUpdatedSortOptions(_0x4bf89f){var _0x1db964={'fields':[],'order':null};var _0x11a2a3=_0x4bf89f[_0x402f('0x68')](',');_0x1db964[_0x402f('0x69')]=_[_0x402f('0x3f')](_0x11a2a3,function(_0x562bc8){if(!_0x562bc8[_0x402f('0x61')]('globalStatus'))return!![];_0x1db964['order']=_[_0x402f('0x6a')](_0x562bc8,'-')?_0x402f('0x6b'):_0x402f('0x6c');return![];});return _0x1db964;}function orderAgentsByStatus(_0x4d3104,_0x5712e3){return _0x4d3104[_0x402f('0x6d')](function(_0x116b58,_0x107344){if(_0x116b58[_0x402f('0x6e')]===_0x107344[_0x402f('0x6e')]&&_0x116b58[_0x402f('0x6e')]===_0x402f('0x57')){if(_0x5712e3===_0x402f('0x6b'))return(_0x116b58[_0x402f('0x6f')]||'')<(_0x107344[_0x402f('0x6f')]||'')?0x1:-0x1;return _0x116b58[_0x402f('0x6f')]<_0x107344[_0x402f('0x6f')]?-0x1:0x1;}else{if(_0x5712e3===_0x402f('0x6b'))return _0x116b58[_0x402f('0x6e')]<_0x107344[_0x402f('0x6e')]?0x1:-0x1;return _0x116b58[_0x402f('0x6e')]<_0x107344['globalStatus']?-0x1:0x1;}});}exports[_0x402f('0x65')]=function(_0x1edde9,_0x3c087c){var _0x52ece3={'count':0x0,'rows':[]},_0x24343c={},_0x2d9084,_0x2d4ac4,_0x272cda,_0x468449,_0x2f21fd=[_0x402f('0x70'),_0x402f('0x47'),_0x402f('0x71'),_0x402f('0x72'),'pauseType',_0x402f('0x72'),_0x402f('0x43'),'address',_0x402f('0x4f'),'openchannelPause','mailPause','smsPause',_0x402f('0x54'),_0x402f('0x73'),_0x402f('0x53'),'chatCapacity',_0x402f('0x74'),'mailCapacity',_0x402f('0x75'),'whatsappCapacity',_0x402f('0x76'),_0x402f('0x77'),_0x402f('0x78'),'mailCurrentCapacity','smsCurrentCapacity',_0x402f('0x79'),_0x402f('0x7a'),_0x402f('0x58'),_0x402f('0x59'),_0x402f('0x7b'),'smsStatus',_0x402f('0x7c'),_0x402f('0x7d'),'voiceStatus','chatStatusTime',_0x402f('0x7e'),'mailStatusTime','smsStatusTime','whatsappStatusTime',_0x402f('0x7f'),_0x402f('0x80'),_0x402f('0x40'),_0x402f('0x81'),_0x402f('0x82'),_0x402f('0x83'),'phoneBarEnableAutomaticScreenRecording',_0x402f('0x84')],_0x53a6df=[_0x402f('0x4f'),_0x402f('0x51'),_0x402f('0x50'),'smsPause',_0x402f('0x54'),_0x402f('0x73'),_0x402f('0x53'),_0x402f('0x47')];Promise[_0x402f('0x85')]()[_0x402f('0x14')](function(){if(_0x1edde9[_0x402f('0x86')][_0x402f('0x87')])_0x2d9084=validateChannel(_0x1edde9[_0x402f('0x86')][_0x402f('0x87')]);if(!_0x1edde9[_0x402f('0x86')]['sort']||!_0x1edde9[_0x402f('0x86')][_0x402f('0x6d')]['includes'](_0x402f('0x6e')))return;var _0x4ade0b=getUpdatedSortOptions(_0x1edde9['query']['sort']);_0x1edde9[_0x402f('0x86')]['sort']=_0x4ade0b[_0x402f('0x69')][_0x402f('0x88')](',');_0x2d4ac4=_0x4ade0b[_0x402f('0x89')];})[_0x402f('0x14')](function(){if(!_0x1edde9[_0x402f('0x86')][_0x402f('0x8a')])return[];var _0x393a4c=_[_0x402f('0x49')](_0x2d9084)+_0x402f('0x8b');return getFilteredAgentIds(_0x1edde9['query'][_0x402f('0x8a')],_0x393a4c);})[_0x402f('0x14')](function(_0x9c590){var _0x2f2913=_[_0x402f('0x37')](db[_0x402f('0x8c')]['rawAttributes'],function(_0x3e3047){return{'name':_0x3e3047[_0x402f('0x8d')],'type':_0x3e3047[_0x402f('0x8e')]['key']};});_0x1edde9[_0x402f('0x86')][_0x402f('0x8f')]=_0x402f('0x90');_0x1edde9[_0x402f('0x86')][_0x402f('0x47')]=!![];_0x24343c=qs['getOptions'](_0x2f2913,_0x1edde9);_0x24343c[_0x402f('0x91')]=!![];if(!_[_0x402f('0x92')](_0x9c590)){_0x24343c[_0x402f('0x93')]=_['merge'](_0x24343c[_0x402f('0x93')],{'$and':[{'id':{'$in':_0x9c590}}]});}else if(!_['isEmpty'](_0x1edde9[_0x402f('0x86')][_0x402f('0x8a')])){return _0x52ece3;}if(_0x1edde9['user']['role']===_0x402f('0x94')){var _0x586b66={'params':{'id':_0x1edde9['user'][_0x402f('0x95')]},'query':{'section':_0x402f('0x13'),'role':'agent','online':!![],'nolimit':_0x1edde9[_0x402f('0x86')][_0x402f('0x96')],'sort':_0x1edde9[_0x402f('0x86')][_0x402f('0x6d')],'filter':_0x1edde9['query'][_0x402f('0x3f')],'raw':!![],'ids':_0x9c590}};return db[_0x402f('0x97')][_0x402f('0x98')](_0x586b66);}return db[_0x402f('0x8c')][_0x402f('0x99')](_0x24343c);})[_0x402f('0x14')](function(_0xb7e749){_0x52ece3[_0x402f('0xb')]=_0xb7e749[_0x402f('0xb')];_0x272cda=_0xb7e749[_0x402f('0x9a')];return getRealtimeAgents();})['then'](function(_0x32d589){_0x468449=_0x32d589[_0x402f('0x9a')];return _0x272cda[_0x402f('0x37')](function(_0x1f3da1){var _0x4e5262=_[_0x402f('0x3d')](_0x468449,['id',_0x1f3da1['id']]);if(_0x4e5262)_['merge'](_0x1f3da1,_['pick'](_[_0x402f('0x9b')](_0x4e5262,_0x53a6df),_0x2f21fd));_0x1f3da1[_0x402f('0x6e')]=getAgentStatus(_0x1f3da1);return _0x1f3da1;});})[_0x402f('0x14')](function(_0x20ee76){var _0x1f9ea8;if(_0x1edde9[_0x402f('0x86')][_0x402f('0x9c')]){_0x1f9ea8=_[_0x402f('0x3f')](_0x20ee76,[_0x402f('0x6e'),_0x1edde9[_0x402f('0x86')][_0x402f('0x9c')]]);if(_0x1edde9[_0x402f('0x86')]['pauseTypeFilter']){_0x1f9ea8=_['filter'](_0x1f9ea8,[_0x402f('0x6f'),_0x1edde9[_0x402f('0x86')][_0x402f('0x9d')]]);}}if(_0x1f9ea8)_0x20ee76=_0x1f9ea8;if(!_0x2d4ac4)return _0x20ee76;return orderAgentsByStatus(_0x20ee76,_0x2d4ac4);})[_0x402f('0x14')](function(_0x41a929){_0x52ece3[_0x402f('0x9a')]=_0x41a929;return _0x52ece3;})[_0x402f('0x14')](respondWithFilteredResult(_0x3c087c,_0x24343c))[_0x402f('0x1f')](handleError(_0x3c087c,null));};exports[_0x402f('0x9e')]=function(_0x2ca548,_0x44ec58){var _0x503782={'count':0x0,'rows':[]},_0x538910={},_0x20be5d,_0x50ab27,_0x1b4f50,_0x56fcec,_0x4bb80b;Promise[_0x402f('0x85')]()[_0x402f('0x14')](function(){if(_0x2ca548[_0x402f('0x86')][_0x402f('0x87')])_0x20be5d=validateChannel(_0x2ca548[_0x402f('0x86')]['channel']);var _0x29a44d=_[_0x402f('0x49')](_0x20be5d)+_0x402f('0x8b');var _0x48cd0d=_[_0x402f('0x37')](db[_0x29a44d]['rawAttributes'],function(_0x160112){return{'name':_0x160112['fieldName'],'type':_0x160112['type'][_0x402f('0x9f')]};});_0x538910=qs[_0x402f('0xa0')](_0x48cd0d,_0x2ca548);if(_0x2ca548['user'][_0x402f('0x8f')]===_0x402f('0x94')){var _0x254235={'params':{'id':_0x2ca548[_0x402f('0x94')]['userProfileId']},'query':{'section':_0x20be5d===_0x402f('0x1a')&&_0x2ca548['query']['type']==='outbound'?_0x402f('0xa1'):_[_0x402f('0x49')](_0x20be5d)+_0x402f('0x1b'),'type':_0x2ca548[_0x402f('0x86')][_0x402f('0x8e')],'nolimit':!![],'sort':_0x402f('0x11'),'filter':_0x2ca548[_0x402f('0x86')][_0x402f('0x3f')]}};return db[_0x402f('0x97')][_0x402f('0x98')](_0x254235);}return db[_0x29a44d][_0x402f('0x99')](_0x538910);})['then'](function(_0x387380){_0x503782['count']=_0x387380[_0x402f('0xb')];_0x50ab27=_0x387380[_0x402f('0x9a')];return getRealtimeQueues(_0x2ca548,_0x20be5d);})[_0x402f('0x14')](function(_0x51cf13){_0x56fcec=_0x51cf13[_0x402f('0x9a')];return getRealtimeAgents();})[_0x402f('0x14')](function(_0x2bd8f4){_0x1b4f50=_0x2bd8f4[_0x402f('0x9a')];if(_0x20be5d!=_0x402f('0x1a'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x388626){_0x4bb80b=_0x388626?_0x388626['rows']:[];return initializeQueues(_0x50ab27,_0x56fcec,_0x20be5d,_0x2ca548['query'][_0x402f('0x8e')]);})[_0x402f('0x14')](function(_0x212f20){var _0x19c602=_0x212f20['map'](function(_0x4fb59a){if(_0x20be5d===_0x402f('0x1a'))return getVoiceQueueAgents(_0x4fb59a,_0x50ab27,_0x1b4f50,_0x4bb80b);else return getQueueAgents(_0x4fb59a,_0x1b4f50,_0x20be5d);});return Promise[_0x402f('0xa2')](_0x19c602);})[_0x402f('0x14')](function(_0x3cc1c3){_0x503782[_0x402f('0x9a')]=_0x3cc1c3;return _0x503782;})[_0x402f('0x14')](respondWithFilteredResult(_0x44ec58,_0x538910))[_0x402f('0x1f')](handleError(_0x44ec58,null));};
\ No newline at end of file
+var _0x4cd8=['filter','queue','length','some','internal','toString','getMembers','UserId','voiceStatus','online','findAll','QueueId','getChannels','toLowerCase','Invalid\x20channel','getAgents','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','*pause','resolve','channel','sort','includes','globalStatus','getUpdatedSortOptions','fields','join','order','getAgentIdsByQueues','getRealtimeAgents','rows','getAgentIdsByStatus','User','type','key','role','agent','getOptions','raw','sequelize','literal','FIELD(id,','Pause','forEach','where','user','userProfileId','extraQueryConditions','assign','UserProfile','getResources','findAndCountAll','filterAgentAttributes','getAgentStatus','Status','sortAgentsByStatus','getQueues','Queue','rawAttributes','fieldName','QueueCampaigns','Queues','all','lodash','jayson/promise','../../components/realtime/agents','../../components/parsers/qs','../../config/logger','api','client','http','offset','undefined','limit','count','status','Content-Range','json','error','stack','name','send','voice','request','startCase','then','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','catch','available','waiting','talking','paused','outbound','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','map','agents','loggedInDb','loggedIn','busy','find','merge','pick'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4cd8,0x1c2));var _0x84cd=function(_0x1eb82d,_0x1e23cb){_0x1eb82d=_0x1eb82d-0x0;var _0x2c9502=_0x4cd8[_0x1eb82d];return _0x2c9502;};'use strict';var util=require('util');var _=require(_0x84cd('0x0'));var jayson=require(_0x84cd('0x1'));var rta=require(_0x84cd('0x2'));var qs=require(_0x84cd('0x3'));var utils=require('../../config/utils');var logger=require(_0x84cd('0x4'))(_0x84cd('0x5'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x84cd('0x6')][_0x84cd('0x7')]({'port':0x232a});var routingClient=jayson['client'][_0x84cd('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x1c1502,_0xb8d2fc){return function(_0x2488bd){if(_0x2488bd){var _0x18d6d2=typeof _0xb8d2fc[_0x84cd('0x8')]===_0x84cd('0x9')&&typeof _0xb8d2fc[_0x84cd('0xa')]==='undefined';var _0x520ac1=_0x2488bd[_0x84cd('0xb')];var _0x3f294f=_0x18d6d2?0x0:_0xb8d2fc[_0x84cd('0x8')];var _0x1c26bf=_0x18d6d2?_0x2488bd['count']:_0xb8d2fc[_0x84cd('0x8')]+_0xb8d2fc[_0x84cd('0xa')];var _0x36dd38;if(_0x1c26bf>=_0x520ac1){_0x1c26bf=_0x520ac1;_0x36dd38=0xc8;}else{_0x36dd38=0xce;}_0x1c1502[_0x84cd('0xc')](_0x36dd38);return _0x1c1502['set'](_0x84cd('0xd'),_0x3f294f+'-'+_0x1c26bf+'/'+_0x520ac1)[_0x84cd('0xe')](_0x2488bd);}return null;};}function handleError(_0x26bb3c,_0x5108bb){_0x5108bb=_0x5108bb||0x1f4;return function(_0x4e76c7){logger[_0x84cd('0xf')](_0x4e76c7[_0x84cd('0x10')]);if(_0x4e76c7[_0x84cd('0x11')]){delete _0x4e76c7['name'];}_0x26bb3c['status'](_0x5108bb)[_0x84cd('0x12')](_0x4e76c7);};}function getRealtimeQueues(_0x4b5458,_0x189fdf){return new Promise(function(_0x3a7c80,_0x358690){var _0x5e2efb=_0x189fdf===_0x84cd('0x13')?amiClient:routingClient;return _0x5e2efb[_0x84cd('0x14')](_[_0x84cd('0x15')](_0x189fdf)+'Queues',_0x4b5458)[_0x84cd('0x16')](function(_0x1e2707){if(_0x1e2707['error'])throw new Error(util[_0x84cd('0x17')](_0x84cd('0x18'),_0x189fdf));return _0x3a7c80(_0x1e2707[_0x84cd('0x19')]);})['catch'](function(_0x22c709){_0x358690(_0x22c709);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0xc7d6fb,_0x14dd25){return amiClient['request'](_0x84cd('0x1a'),{})[_0x84cd('0x16')](function(_0x188cff){if(_0x188cff[_0x84cd('0xf')])throw new Error(_0x84cd('0x1b'));return _0xc7d6fb(_0x188cff['result']);})[_0x84cd('0x1c')](function(_0x258bc9){_0x14dd25(_0x258bc9);});});}function initializeQueues(_0x2b1c95,_0x562e8f,_0x5835c8,_0x50610d){var _0x2b59c4=['loggedIn',_0x84cd('0x1d'),_0x84cd('0x1e'),_0x84cd('0x1f'),_0x84cd('0x20')];if(_0x5835c8===_0x84cd('0x13')&&_0x50610d===_0x84cd('0x21')){_0x2b59c4[_0x84cd('0x22')](_0x84cd('0x23'),_0x84cd('0x24'),_0x84cd('0x25'),_0x84cd('0x26'),_0x84cd('0x27'),_0x84cd('0x28'),_0x84cd('0x29'),_0x84cd('0x2a'),_0x84cd('0x2b'),_0x84cd('0x2c'),_0x84cd('0x2d'),_0x84cd('0x2e'),_0x84cd('0x2f'),'dialPredictiveIntervalMaxThreshold',_0x84cd('0x30'),_0x84cd('0x31'),'predictiveIntervalTotalCalls',_0x84cd('0x32'),_0x84cd('0x33'),_0x84cd('0x34'),'predictiveIntervalAvgHoldtime',_0x84cd('0x35'));}return _0x2b1c95[_0x84cd('0x36')](function(_0x3109ab){var _0x3028d8=_0x3109ab['get']({'plain':!![]});_0x3028d8[_0x84cd('0x37')]=[];_0x3028d8[_0x84cd('0x20')]=0x0;_0x3028d8[_0x84cd('0x38')]=0x0;_0x3028d8[_0x84cd('0x39')]=0x0;_0x3028d8[_0x84cd('0x1d')]=0x0;_0x3028d8['waiting']=0x0;if(_0x5835c8===_0x84cd('0x13')){_0x3028d8[_0x84cd('0x1f')]=0x0;_0x3028d8[_0x84cd('0x3a')]=0x0;if(_0x50610d===_0x84cd('0x21')){_0x3028d8[_0x84cd('0x23')]=0x0;_0x3028d8['originated']=0x0;}}var _0x242d21=_[_0x84cd('0x3b')](_0x562e8f,['id',_0x3028d8['id']]);if(_0x242d21)_[_0x84cd('0x3c')](_0x3028d8,_[_0x84cd('0x3d')](_0x242d21,_0x2b59c4));return _0x3028d8;});}function updateAgentVoiceStatus(_0x314e72,_0x5b00ee,_0x1b0044){var _0x36a8b4=_[_0x84cd('0x3e')](_0x1b0044,[_0x84cd('0x3f'),_0x5b00ee['name']]);if(_0x36a8b4[_0x84cd('0x40')]===0x0)return _0x314e72[_0x84cd('0x3a')]=!![];if(_[_0x84cd('0x41')](_0x36a8b4,['connectedlinenum',_0x314e72[_0x84cd('0x42')][_0x84cd('0x43')]()]))return _0x314e72[_0x84cd('0x1f')]=!![];if(!_0x314e72[_0x84cd('0x1f')])return _0x314e72[_0x84cd('0x3a')]=!![];}function getVoiceQueueAgents(_0x384616,_0x41916d,_0x4a8a5a,_0x46064c){var _0xaf42f=_[_0x84cd('0x3b')](_0x41916d,['id',_0x384616['id']]);if(!_0xaf42f)return _0x384616;return _0xaf42f[_0x84cd('0x44')]({'raw':!![]})[_0x84cd('0x16')](function(_0x52887b){for(var _0x29cc37=0x0;_0x29cc37<_0x52887b[_0x84cd('0x40')];_0x29cc37++){var _0x73fde=_['find'](_0x4a8a5a,['id',_0x52887b[_0x29cc37][_0x84cd('0x45')]]);if(!_0x73fde){_0x73fde={'id':_0x52887b[_0x29cc37]['UserId'],'name':_0x52887b[_0x29cc37][_0x84cd('0x45')],'accountcode':'','online':![]};}var _0x5dcf2c={'id':_0x73fde['id'],'name':_0x73fde[_0x84cd('0x11')],'internal':_0x73fde['accountcode'],'online':Boolean(_0x73fde['online']),'paused':Boolean(_0x52887b[_0x29cc37][_0x84cd('0x20')])};if(_0x73fde[_0x84cd('0x46')]===_0x84cd('0x1f'))updateAgentVoiceStatus(_0x5dcf2c,_0x384616,_0x46064c);if(_0x5dcf2c[_0x84cd('0x47')])_0x384616[_0x84cd('0x38')]++;if(_0x5dcf2c[_0x84cd('0x3a')])_0x384616[_0x84cd('0x3a')]++;if(_0x5dcf2c['paused']&&!_0x5dcf2c[_0x84cd('0x3a')]&&!_0x5dcf2c[_0x84cd('0x1f')])_0x384616[_0x84cd('0x20')]++;_0x384616[_0x84cd('0x37')][_0x84cd('0x22')](_0x5dcf2c);}return _0x384616;});}function getQueueAgents(_0x4cf2f1,_0x215bc7,_0x4ab5cc){var _0x511a3d='User'+_[_0x84cd('0x15')](_0x4ab5cc)+'Queue';var _0x5859f2=_0x4ab5cc+'Pause';return db[_0x511a3d][_0x84cd('0x48')]({'where':{[_[_0x84cd('0x15')](_0x4ab5cc)+_0x84cd('0x49')]:_0x4cf2f1['id']},'raw':!![]})[_0x84cd('0x16')](function(_0x2cfc5e){for(var _0x1b43bb=0x0;_0x1b43bb<_0x2cfc5e[_0x84cd('0x40')];_0x1b43bb++){var _0x244a15=_[_0x84cd('0x3b')](_0x215bc7,['id',_0x2cfc5e[_0x1b43bb][_0x84cd('0x45')]]);if(!_0x244a15){_0x244a15={'id':_0x2cfc5e[_0x1b43bb]['UserId'],'name':_0x2cfc5e[_0x1b43bb][_0x84cd('0x45')],'online':![],['pauseField']:![]};}var _0x4ef8b2={'id':_0x244a15['id'],'name':_0x244a15[_0x84cd('0x11')],'online':Boolean(_0x244a15[_0x84cd('0x47')]),'paused':Boolean(_0x244a15[_0x5859f2])};if(_0x4ef8b2['online'])_0x4cf2f1[_0x84cd('0x38')]++;_0x4cf2f1['agents'][_0x84cd('0x22')](_0x4ef8b2);}return _0x4cf2f1;});}function validateChannel(_0x15b200){var _0x408bf9=utils[_0x84cd('0x4a')]();if(!_['includes'](_0x408bf9,_0x15b200[_0x84cd('0x4b')]()))throw new Error(_0x84cd('0x4c'));return _0x15b200[_0x84cd('0x4b')]();}exports[_0x84cd('0x4d')]=function(_0x1e2e13,_0x42f8aa){var _0x3fd48e={'count':0x0,'rows':[]};var _0x8e7a2b={};var _0x1955de;var _0x6e924d;var _0x2c1eb7;var _0x64577c;var _0x52c107=utils[_0x84cd('0x4a')]();var _0x3ac7e2=_0x1e2e13[_0x84cd('0x4e')][_0x84cd('0x4f')];var _0x322b4f=_0x1e2e13['query'][_0x84cd('0x50')];var _0x49211e=_0x1e2e13['query'][_0x84cd('0x51')];var _0x66c35d=_0x322b4f===_0x84cd('0x52')||_0x322b4f===_0x84cd('0x53')?!![]:![];var _0x96b025=[];var _0x3bdc74;Promise[_0x84cd('0x54')]()[_0x84cd('0x16')](function(){if(_0x1e2e13[_0x84cd('0x4e')][_0x84cd('0x55')]){_0x1955de=validateChannel(_0x1e2e13['query']['channel']);}if(!_0x1e2e13['query'][_0x84cd('0x56')]||!_0x1e2e13['query'][_0x84cd('0x56')][_0x84cd('0x57')](_0x84cd('0x58'))){_0x1e2e13[_0x84cd('0x4e')][_0x84cd('0x56')]=rta['validateSortParameter'](_0x1e2e13[_0x84cd('0x4e')][_0x84cd('0x56')]);return;}var _0x183b54=rta[_0x84cd('0x59')](_0x1e2e13['query']['sort']);_0x1e2e13[_0x84cd('0x4e')][_0x84cd('0x56')]=_0x183b54[_0x84cd('0x5a')][_0x84cd('0x5b')](',');_0x6e924d=_0x183b54[_0x84cd('0x5c')];})[_0x84cd('0x16')](function(){if(!_0x3ac7e2){return[];}return rta[_0x84cd('0x5d')](_0x3ac7e2,_0x1955de);})['then'](function(_0x4c0a9c){_0x96b025=_0x4c0a9c;return rta[_0x84cd('0x5e')]();})['then'](function(_0x19f88c){_0x64577c=_0x19f88c[_0x84cd('0x5f')];if((!_0x322b4f||_0x66c35d)&&!_0x6e924d){return _0x96b025;}if(_0x6e924d&&!_0x322b4f){return rta['getSortedAgentsIdsByStatus'](_0x64577c,_0x96b025,_0x6e924d);}else{return rta[_0x84cd('0x60')](_0x64577c,_0x96b025,_0x322b4f);}})[_0x84cd('0x16')](function(_0x11260d){_0x96b025=_0x11260d;var _0x3843dd=![];if(_0x96b025[_0x84cd('0x40')]===0x0){if(_0x3ac7e2||_0x322b4f){_0x3843dd=!![];}if(_0x66c35d){_0x3843dd=![];}}if(_0x3843dd){return _0x3fd48e;}var _0x70e83=_[_0x84cd('0x36')](db[_0x84cd('0x61')]['rawAttributes'],function(_0x3f34a5){return{'name':_0x3f34a5['fieldName'],'type':_0x3f34a5[_0x84cd('0x62')][_0x84cd('0x63')]};});_0x1e2e13[_0x84cd('0x4e')][_0x84cd('0x64')]=_0x84cd('0x65');_0x1e2e13[_0x84cd('0x4e')]['online']=!![];_0x8e7a2b=qs[_0x84cd('0x66')](_0x70e83,_0x1e2e13);_0x8e7a2b[_0x84cd('0x67')]=!![];var _0x3f738d=[];if(_0x96b025[_0x84cd('0x40')]>0x0){_0x3f738d[_0x84cd('0x22')]({'id':{'$in':_0x96b025}});if(_0x6e924d&&!_0x322b4f){_0x3bdc74=[db[_0x84cd('0x68')][_0x84cd('0x69')](_0x84cd('0x6a')+_0x96b025+')')];_0x8e7a2b[_0x84cd('0x5c')]=_0x3bdc74;}}if(_0x66c35d){_0x52c107['forEach'](function(_0x254832){var _0x8bcad6=!![];if(_0x322b4f===_0x84cd('0x53')&&_0x1955de!==_0x254832){_0x8bcad6=![];}_0x3f738d[_0x84cd('0x22')]({[_0x254832+_0x84cd('0x6b')]:_0x8bcad6});});if(_0x49211e){_0x3f738d['push']({'pauseType':_0x49211e});}}else if(_0x322b4f){_0x52c107[_0x84cd('0x6c')](function(_0x14e51d){_0x3f738d['push']({[_0x14e51d+_0x84cd('0x6b')]:![]});});}_0x8e7a2b[_0x84cd('0x6d')]=_['merge'](_0x8e7a2b['where'],{'$and':_0x3f738d});if(_0x1e2e13[_0x84cd('0x6e')]['role']===_0x84cd('0x6e')){var _0x83ad41={'params':{'id':_0x1e2e13[_0x84cd('0x6e')][_0x84cd('0x6f')]},'query':{'section':'Agents','role':'agent','online':!![],'raw':!![],'ids':_0x96b025,'customSorting':_0x3bdc74}};if(_0x66c35d){_0x83ad41[_0x84cd('0x4e')][_0x84cd('0x70')]=_0x3f738d;}_0x83ad41['query']=Object[_0x84cd('0x71')](_0x83ad41[_0x84cd('0x4e')],_0x1e2e13[_0x84cd('0x4e')]);delete _0x83ad41[_0x84cd('0x4e')]['id'];return db[_0x84cd('0x72')][_0x84cd('0x73')](_0x83ad41);}return db[_0x84cd('0x61')][_0x84cd('0x74')](_0x8e7a2b);})['then'](function(_0x35b6e7){_0x3fd48e[_0x84cd('0xb')]=_0x35b6e7[_0x84cd('0xb')];_0x2c1eb7=_0x35b6e7[_0x84cd('0x5f')];return _0x2c1eb7[_0x84cd('0x36')](function(_0x49d85a){var _0x58fbaa=_['find'](_0x64577c,['id',_0x49d85a['id']]);if(_0x58fbaa){var _0x5d38e2=rta[_0x84cd('0x75')](_0x58fbaa);_[_0x84cd('0x3c')](_0x49d85a,_0x5d38e2);}_0x49d85a[_0x84cd('0x58')]=rta[_0x84cd('0x76')](_0x49d85a);if(_0x49d85a[_0x84cd('0x58')][_0x84cd('0x57')]('pause')){_0x52c107[_0x84cd('0x6c')](function(_0x3d0117){if(_0x49d85a[_0x3d0117+_0x84cd('0x6b')]){_0x49d85a[_0x3d0117+_0x84cd('0x77')]='pause';}});}return _0x49d85a;});})[_0x84cd('0x16')](function(_0x595843){if(!_0x6e924d||_0x3bdc74){return _0x595843;}return rta[_0x84cd('0x78')](_0x595843,_0x6e924d);})[_0x84cd('0x16')](function(_0x3ab152){_0x3fd48e[_0x84cd('0x5f')]=_0x3ab152;return _0x3fd48e;})[_0x84cd('0x16')](respondWithFilteredResult(_0x42f8aa,_0x8e7a2b))[_0x84cd('0x1c')](handleError(_0x42f8aa,null));};exports[_0x84cd('0x79')]=function(_0x54b33a,_0x7e15bf){var _0x156f35={'count':0x0,'rows':[]},_0x393660={},_0x55bd4b,_0x27600f,_0xb3035d,_0x493c69,_0x52aa2a;Promise[_0x84cd('0x54')]()['then'](function(){if(_0x54b33a[_0x84cd('0x4e')]['channel'])_0x55bd4b=validateChannel(_0x54b33a['query']['channel']);var _0x168c5b=_[_0x84cd('0x15')](_0x55bd4b)+_0x84cd('0x7a');var _0x224637=_['map'](db[_0x168c5b][_0x84cd('0x7b')],function(_0x1833b0){return{'name':_0x1833b0[_0x84cd('0x7c')],'type':_0x1833b0[_0x84cd('0x62')][_0x84cd('0x63')]};});_0x393660=qs['getOptions'](_0x224637,_0x54b33a);if(_0x54b33a[_0x84cd('0x6e')]['role']===_0x84cd('0x6e')){var _0x1334b0={'params':{'id':_0x54b33a['user'][_0x84cd('0x6f')]},'query':{'section':_0x55bd4b===_0x84cd('0x13')&&_0x54b33a[_0x84cd('0x4e')]['type']===_0x84cd('0x21')?_0x84cd('0x7d'):_[_0x84cd('0x15')](_0x55bd4b)+_0x84cd('0x7e'),'type':_0x54b33a[_0x84cd('0x4e')][_0x84cd('0x62')],'nolimit':!![],'sort':_0x84cd('0x11'),'filter':_0x54b33a[_0x84cd('0x4e')]['filter']}};return db['UserProfile'][_0x84cd('0x73')](_0x1334b0);}return db[_0x168c5b]['findAndCountAll'](_0x393660);})[_0x84cd('0x16')](function(_0x788412){_0x156f35['count']=_0x788412[_0x84cd('0xb')];_0x27600f=_0x788412[_0x84cd('0x5f')];return getRealtimeQueues(_0x54b33a,_0x55bd4b);})[_0x84cd('0x16')](function(_0x40ed63){_0x493c69=_0x40ed63[_0x84cd('0x5f')];return rta[_0x84cd('0x5e')]();})[_0x84cd('0x16')](function(_0xe15fe8){_0xb3035d=_0xe15fe8[_0x84cd('0x5f')];if(_0x55bd4b!=_0x84cd('0x13'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x3b9a8e){_0x52aa2a=_0x3b9a8e?_0x3b9a8e[_0x84cd('0x5f')]:[];return initializeQueues(_0x27600f,_0x493c69,_0x55bd4b,_0x54b33a[_0x84cd('0x4e')][_0x84cd('0x62')]);})[_0x84cd('0x16')](function(_0x34429e){var _0x1623df=_0x34429e['map'](function(_0x44315d){if(_0x55bd4b===_0x84cd('0x13'))return getVoiceQueueAgents(_0x44315d,_0x27600f,_0xb3035d,_0x52aa2a);else return getQueueAgents(_0x44315d,_0xb3035d,_0x55bd4b);});return Promise[_0x84cd('0x7f')](_0x1623df);})['then'](function(_0x3b38a1){_0x156f35[_0x84cd('0x5f')]=_0x3b38a1;return _0x156f35;})['then'](respondWithFilteredResult(_0x7e15bf,_0x393660))['catch'](handleError(_0x7e15bf,null));};
\ No newline at end of file