Built motion from commit 10af8726.|2.6.34
[motion2.git] / server / components / realtime / agents.js
index 399b92c..0f01fcb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4afb=['isArray','Queue','map','findOne','then','all','uniq','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','findAll','name','fullname','smsPause','voicePause','pauseType','find','globalStatus','getSortedAgentsIdsByStatus','split','fields','startsWith','DESC','getUpdatedSortOptions','internal','indexOf','validateSortParameter','sort','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','faxPause','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','mailStatus','whatsappStatus','openchannelStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','lodash','jayson/promise','client','http','chatPause','mailPause','openchannelPause','whatsappPause','filter','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','pause','every','chatStatus','faxStatus','openchannelStatus','smsStatus','request','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','merge','catch','getRealtimeAgents','busy','getAgentStatus'];(function(_0x9729d7,_0x1b79a8){var _0x3c4ac6=function(_0x401ba6){while(--_0x401ba6){_0x9729d7['push'](_0x9729d7['shift']());}};_0x3c4ac6(++_0x1b79a8);}(_0x4afb,0x164));var _0xb4af=function(_0x5ce52e,_0x5741a9){_0x5ce52e=_0x5ce52e-0x0;var _0x196dfa=_0x4afb[_0x5ce52e];return _0x196dfa;};'use strict';var _=require(_0xb4af('0x0'));var jayson=require(_0xb4af('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xb4af('0x2')][_0xb4af('0x3')]({'port':0x232a});var routingClient=jayson[_0xb4af('0x2')]['http']({'port':0x232c});function isAgentPaused(_0x1992d8,_0x1c94b0){var _0x217579=[_0x1992d8[_0xb4af('0x4')],_0x1992d8['faxPause'],_0x1992d8[_0xb4af('0x5')],_0x1992d8[_0xb4af('0x6')],_0x1992d8['smsPause'],_0x1992d8['voicePause'],_0x1992d8[_0xb4af('0x7')]];if(!_0x1c94b0)return _['every'](_0x217579);var _0xa8da8=_[_0xb4af('0x8')](_0x217579);return _0xa8da8[_0xb4af('0x9')]>0x0&&_0xa8da8[_0xb4af('0x9')]<_0x217579['length']?!![]:![];}function isIdle(_0x5a6a31){return _0x5a6a31===_0xb4af('0xa')||_0x5a6a31===_0xb4af('0xb')||_0x5a6a31===_0xb4af('0xc')||_0x5a6a31===_0xb4af('0xd')||_[_0xb4af('0xe')](_0x5a6a31);}function isAgentIdle(_0x358ef6){if(_0x358ef6[_0xb4af('0xf')]!==_0xb4af('0xa')&&_0x358ef6['voicePause']){_0x358ef6[_0xb4af('0xf')]=_0xb4af('0x10');return![];}return _[_0xb4af('0x11')]([_0x358ef6[_0xb4af('0x12')],_0x358ef6[_0xb4af('0x13')],_0x358ef6['mailStatus'],_0x358ef6[_0xb4af('0x14')],_0x358ef6[_0xb4af('0x15')],_0x358ef6['voiceStatus'],_0x358ef6['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient[_0xb4af('0x16')](_0xb4af('0x17'),{})['then'](function(_0x2018a0){if(_0x2018a0['error']){throw new Error(_0xb4af('0x18'));}var _0x377280=_0x2018a0['result'];return routingClient[_0xb4af('0x16')](_0xb4af('0x17'),{})['then'](function(_0x19840a){if(_0x19840a['error']){throw new Error(_0xb4af('0x19'));}var _0x12f928=_0x19840a[_0xb4af('0x1a')];return _[_0xb4af('0x1b')]({},_0x377280,_0x12f928);});})[_0xb4af('0x1c')](function(_0xe94753){throw _0xe94753;});}exports[_0xb4af('0x1d')]=getRealtimeAgents;function getAgentStatus(_0x914a82){var _0x7da709='unknown';if(isAgentPaused(_0x914a82))_0x7da709=_0xb4af('0x10');else if(isAgentPaused(_0x914a82,!![]))_0x7da709='*pause';else if(isAgentIdle(_0x914a82))_0x7da709=_0xb4af('0xa');else _0x7da709=_0xb4af('0x1e');return _0x7da709;}exports[_0xb4af('0x1f')]=getAgentStatus;function getAgentIdsByQueues(_0x5bbc03,_0x47e056){var _0x299824=_[_0xb4af('0x20')](_0x5bbc03)?_0x5bbc03:[_0x5bbc03];var _0x2c119f=_['startCase'](_0x47e056)+_0xb4af('0x21');var _0x44ec54=_[_0xb4af('0x22')](_0x299824,function(_0x2862ce){return db[_0x2c119f][_0xb4af('0x23')]({'where':{'id':_0x2862ce}})[_0xb4af('0x24')](function(_0x200714){if(!_0x200714)return[];return _0x200714['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0xb4af('0x25')](_0x44ec54)[_0xb4af('0x24')](function(_0x58bcec){var _0x3c1050=_(_0x58bcec)['flatten']()['map']('id')[_0xb4af('0x26')]()[_0xb4af('0x27')]();return _0x3c1050;});}exports[_0xb4af('0x28')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x399bd4,_0x1fad34,_0x2b069f){try{if(_0x1fad34[_0xb4af('0x9')]>0x0){_0x399bd4=_0x399bd4[_0xb4af('0x8')](function(_0xa0c002){return _0x1fad34[_0xb4af('0x29')](_0xa0c002['id']);});}var _0x401c21=_0x399bd4['filter'](function(_0x2a541e){var _0x28088f=_0xb4af('0x1e');if(isAgentIdle(_0x2a541e)){_0x28088f=_0xb4af('0xa');}return _0x28088f===_0x2b069f;});return _[_0xb4af('0x22')](_0x401c21,'id');}catch(_0x3d4c65){throw _0x3d4c65;}}exports[_0xb4af('0x2a')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x1472be,_0x5eb64b,_0x299730){return Promise[_0xb4af('0x2b')]()[_0xb4af('0x24')](function(){if(_0x5eb64b[_0xb4af('0x9')]>0x0){_0x1472be=_0x1472be[_0xb4af('0x8')](function(_0x3d90bc){return _0x5eb64b['includes'](_0x3d90bc['id']);});}return _0x1472be;})[_0xb4af('0x24')](function(){return db['User'][_0xb4af('0x2c')]({'attributes':['id',_0xb4af('0x2d'),_0xb4af('0x2e'),_0xb4af('0x4'),'faxPause',_0xb4af('0x5'),_0xb4af('0x6'),_0xb4af('0x2f'),_0xb4af('0x30'),_0xb4af('0x7'),_0xb4af('0x31')],'where':{'id':{'$in':_[_0xb4af('0x22')](_0x1472be,'id')}},'raw':!![]});})['then'](function(_0xe1e0ce){return _0xe1e0ce[_0xb4af('0x22')](function(_0x2e47f9){var _0x3b8271=_[_0xb4af('0x32')](_0x1472be,['id',_0x2e47f9['id']]);var _0x1d7713=filterAgentAttributes(_0x3b8271);_[_0xb4af('0x1b')](_0x2e47f9,_0x1d7713);_0x2e47f9[_0xb4af('0x33')]=getAgentStatus(_0x2e47f9);return _0x2e47f9;});})[_0xb4af('0x24')](function(_0x29c04f){var _0x2040c7=sortAgentsByStatus(_0x29c04f,_0x299730);return _[_0xb4af('0x22')](_0x2040c7,'id');})[_0xb4af('0x1c')](function(_0x2e204d){throw _0x2e204d;});}exports[_0xb4af('0x34')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x515fc0){var _0xe3db16={'fields':[],'order':null};var _0x5ecb0a=_0x515fc0[_0xb4af('0x35')](',');_0xe3db16[_0xb4af('0x36')]=_[_0xb4af('0x8')](_0x5ecb0a,function(_0x36858f){if(!_0x36858f[_0xb4af('0x29')](_0xb4af('0x33'))){return!![];}_0xe3db16['order']=_[_0xb4af('0x37')](_0x36858f,'-')?_0xb4af('0x38'):'ASC';return![];});return _0xe3db16;}exports[_0xb4af('0x39')]=getUpdatedSortOptions;function validateSortParameter(_0x3d907c){if(_0x3d907c[_0xb4af('0x29')](_0xb4af('0x2e'))&&!_0x3d907c['includes'](_0xb4af('0x3a'))){var _0x4211aa=_0x3d907c['substring'](0x0,_0x3d907c[_0xb4af('0x3b')](_0xb4af('0x2e')));_0x3d907c+=','+_0x4211aa+_0xb4af('0x3a');}return _0x3d907c;}exports[_0xb4af('0x3c')]=validateSortParameter;function sortAgentsByStatus(_0x2fe6d4,_0x13ac28){var _0x3073c8=_0x2fe6d4[_0xb4af('0x3d')](function(_0x4daf80,_0xcc6cfb){if(_0x4daf80[_0xb4af('0x33')]===_0xcc6cfb[_0xb4af('0x33')]){if(_0x4daf80[_0xb4af('0x33')]===_0xb4af('0x10')){if(_0x13ac28==='DESC'){return(_0x4daf80[_0xb4af('0x31')]||'')<(_0xcc6cfb['pauseType']||'')||_0x4daf80[_0xb4af('0x2e')][_0xb4af('0x3e')]()>_0xcc6cfb['fullname'][_0xb4af('0x3e')]()?0x1:-0x1;}else{return(_0x4daf80['pauseType']||'')<(_0xcc6cfb[_0xb4af('0x31')]||'')||_0x4daf80[_0xb4af('0x2e')]['toLowerCase']()>_0xcc6cfb[_0xb4af('0x2e')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x13ac28==='DESC'){return _0x4daf80[_0xb4af('0x2e')]['toLowerCase']()<_0xcc6cfb[_0xb4af('0x2e')][_0xb4af('0x3e')]()?0x1:-0x1;}else{return _0x4daf80[_0xb4af('0x2e')][_0xb4af('0x3e')]()<_0xcc6cfb[_0xb4af('0x2e')][_0xb4af('0x3e')]()?-0x1:0x1;}}}else{if(_0x13ac28===_0xb4af('0x38')){return _0x4daf80[_0xb4af('0x33')]<_0xcc6cfb[_0xb4af('0x33')]?0x1:-0x1;}else{return _0x4daf80[_0xb4af('0x33')]<_0xcc6cfb[_0xb4af('0x33')]?-0x1:0x1;}}});return _0x3073c8;}exports[_0xb4af('0x3f')]=sortAgentsByStatus;function filterAgentAttributes(_0x2d39a5){var _0x22f234=[_0xb4af('0x40'),_0xb4af('0x41'),_0xb4af('0x42'),_0xb4af('0x43'),_0xb4af('0x31'),_0xb4af('0x43'),'internal',_0xb4af('0x44'),_0xb4af('0x4'),_0xb4af('0x6'),'mailPause','smsPause','whatsappPause',_0xb4af('0x45'),_0xb4af('0x30'),_0xb4af('0x46'),_0xb4af('0x47'),_0xb4af('0x48'),_0xb4af('0x49'),_0xb4af('0x4a'),_0xb4af('0x4b'),_0xb4af('0x4c'),_0xb4af('0x4d'),_0xb4af('0x4e'),_0xb4af('0x4f'),_0xb4af('0x50'),_0xb4af('0x51'),_0xb4af('0x12'),_0xb4af('0x14'),_0xb4af('0x52'),_0xb4af('0x15'),_0xb4af('0x53'),_0xb4af('0x13'),_0xb4af('0xf'),'chatStatusTime',_0xb4af('0x54'),'mailStatusTime',_0xb4af('0x55'),_0xb4af('0x56'),_0xb4af('0x57'),_0xb4af('0x58'),_0xb4af('0x59'),_0xb4af('0x5a'),_0xb4af('0x5b'),_0xb4af('0x5c'),_0xb4af('0x5d'),_0xb4af('0x5e')];var _0x1c4087=['chatPause',_0xb4af('0x6'),_0xb4af('0x5'),_0xb4af('0x2f'),_0xb4af('0x7'),_0xb4af('0x45'),_0xb4af('0x30'),_0xb4af('0x41')];var _0x57bac0=_(_0x2d39a5)[_0xb4af('0x5f')](_0x1c4087)[_0xb4af('0x60')](_0x22f234)[_0xb4af('0x27')]();return _0x57bac0;}exports['filterAgentAttributes']=filterAgentAttributes;
\ No newline at end of file
+var _0x57c3=['isNil','voiceStatus','pause','chatStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','error','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','busy','isArray','startCase','Queue','map','findOne','getAgents','all','then','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','User','findAll','name','fullname','mailPause','pauseType','globalStatus','getSortedAgentsIdsByStatus','split','fields','order','startsWith','DESC','ASC','getUpdatedSortOptions','fullname,internal','substring','indexOf','sort','toLowerCase','sortAgentsByStatus','userpic','lastLoginAt','lastPauseAt','internal','address','chatPause','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','mailStatus','faxStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','online','omit','pick','filterAgentAttributes','role','openchannelCurrentCapacity','destconnectedlinenum','onhold','screenrecording','getRealtimeAgentsQueryFields','lodash','jayson/promise','../../mysqldb','http','faxPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','length','idle','unknown','unavailable','ringing'];(function(_0x199d4f,_0x49ede1){var _0x202d75=function(_0x3e56d9){while(--_0x3e56d9){_0x199d4f['push'](_0x199d4f['shift']());}};_0x202d75(++_0x49ede1);}(_0x57c3,0xc2));var _0x357c=function(_0x536e07,_0x182822){_0x536e07=_0x536e07-0x0;var _0x19d915=_0x57c3[_0x536e07];return _0x19d915;};'use strict';var _=require(_0x357c('0x0'));var jayson=require(_0x357c('0x1'));var db=require(_0x357c('0x2'))['db'];var amiClient=jayson['client']['http']({'port':0x232a});var routingClient=jayson['client'][_0x357c('0x3')]({'port':0x232c});function isAgentPaused(_0x1b6624,_0x2aef77){var _0x1ecca6=[_0x1b6624['chatPause'],_0x1b6624[_0x357c('0x4')],_0x1b6624['mailPause'],_0x1b6624[_0x357c('0x5')],_0x1b6624[_0x357c('0x6')],_0x1b6624[_0x357c('0x7')],_0x1b6624[_0x357c('0x8')]];if(!_0x2aef77)return _[_0x357c('0x9')](_0x1ecca6);var _0x1e4977=_[_0x357c('0xa')](_0x1ecca6);return _0x1e4977['length']>0x0&&_0x1e4977[_0x357c('0xb')]<_0x1ecca6[_0x357c('0xb')]?!![]:![];}function isIdle(_0x214216){return _0x214216===_0x357c('0xc')||_0x214216===_0x357c('0xd')||_0x214216===_0x357c('0xe')||_0x214216===_0x357c('0xf')||_[_0x357c('0x10')](_0x214216);}function isAgentIdle(_0xd4399f){if(_0xd4399f[_0x357c('0x11')]!==_0x357c('0xc')&&_0xd4399f[_0x357c('0x7')]){_0xd4399f['voiceStatus']=_0x357c('0x12');return![];}return _[_0x357c('0x9')]([_0xd4399f[_0x357c('0x13')],_0xd4399f['faxStatus'],_0xd4399f['mailStatus'],_0xd4399f[_0x357c('0x14')],_0xd4399f[_0x357c('0x15')],_0xd4399f[_0x357c('0x11')],_0xd4399f[_0x357c('0x16')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x357c('0x17')](_0x357c('0x18'),{})['then'](function(_0x25de41){if(_0x25de41[_0x357c('0x19')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x590f6d=_0x25de41[_0x357c('0x1a')];return routingClient[_0x357c('0x17')](_0x357c('0x18'),{})['then'](function(_0x21d0f9){if(_0x21d0f9[_0x357c('0x19')]){throw new Error(_0x357c('0x1b'));}var _0x34b058=_0x21d0f9[_0x357c('0x1a')];return _[_0x357c('0x1c')]({},_0x590f6d,_0x34b058);});})[_0x357c('0x1d')](function(_0x25622d){throw _0x25622d;});}exports[_0x357c('0x1e')]=getRealtimeAgents;function getAgentStatus(_0x5da9b1){var _0x147b66=_0x357c('0xd');if(isAgentPaused(_0x5da9b1))_0x147b66='pause';else if(isAgentPaused(_0x5da9b1,!![]))_0x147b66='*pause';else if(isAgentIdle(_0x5da9b1))_0x147b66=_0x357c('0xc');else _0x147b66=_0x357c('0x1f');return _0x147b66;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x437762,_0x1e6c7f){var _0x5e7f32=_[_0x357c('0x20')](_0x437762)?_0x437762:[_0x437762];var _0x336b14=_[_0x357c('0x21')](_0x1e6c7f)+_0x357c('0x22');var _0x324bff=_[_0x357c('0x23')](_0x5e7f32,function(_0x328dfc){return db[_0x336b14][_0x357c('0x24')]({'where':{'id':_0x328dfc}})['then'](function(_0x563fee){if(!_0x563fee)return[];return _0x563fee[_0x357c('0x25')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x357c('0x26')](_0x324bff)[_0x357c('0x27')](function(_0x1c5c51){var _0x22fbff=_(_0x1c5c51)['flatten']()[_0x357c('0x23')]('id')['uniq']()[_0x357c('0x28')]();return _0x22fbff;});}exports[_0x357c('0x29')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x95e7b5,_0x5f4a8a,_0x11dc9c){try{if(_0x5f4a8a[_0x357c('0xb')]>0x0){_0x95e7b5=_0x95e7b5[_0x357c('0xa')](function(_0x42a97a){return _0x5f4a8a[_0x357c('0x2a')](_0x42a97a['id']);});}var _0x3125be=_0x95e7b5[_0x357c('0xa')](function(_0x1ea128){var _0x542bc1=_0x357c('0x1f');if(isAgentIdle(_0x1ea128)){_0x542bc1=_0x357c('0xc');}return _0x542bc1===_0x11dc9c;});return _[_0x357c('0x23')](_0x3125be,'id');}catch(_0x4e9ea0){throw _0x4e9ea0;}}exports[_0x357c('0x2b')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x51b7f4,_0x396740,_0x859a04){return Promise[_0x357c('0x2c')]()[_0x357c('0x27')](function(){if(_0x396740[_0x357c('0xb')]>0x0){_0x51b7f4=_0x51b7f4[_0x357c('0xa')](function(_0x3122b1){return _0x396740[_0x357c('0x2a')](_0x3122b1['id']);});}return _0x51b7f4;})[_0x357c('0x27')](function(){return db[_0x357c('0x2d')][_0x357c('0x2e')]({'attributes':['id',_0x357c('0x2f'),_0x357c('0x30'),'chatPause',_0x357c('0x4'),_0x357c('0x31'),'openchannelPause',_0x357c('0x6'),_0x357c('0x7'),_0x357c('0x8'),_0x357c('0x32')],'where':{'id':{'$in':_[_0x357c('0x23')](_0x51b7f4,'id')}},'raw':!![]});})[_0x357c('0x27')](function(_0x4e4294){return _0x4e4294[_0x357c('0x23')](function(_0x3f20a3){var _0x2e5f02=_['find'](_0x51b7f4,['id',_0x3f20a3['id']]);var _0x102170=filterAgentAttributes(_0x2e5f02);_[_0x357c('0x1c')](_0x3f20a3,_0x102170);_0x3f20a3[_0x357c('0x33')]=getAgentStatus(_0x3f20a3);return _0x3f20a3;});})['then'](function(_0x5115c9){var _0x2f0984=sortAgentsByStatus(_0x5115c9,_0x859a04);return _[_0x357c('0x23')](_0x2f0984,'id');})[_0x357c('0x1d')](function(_0x572c07){throw _0x572c07;});}exports[_0x357c('0x34')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x4c62cd){var _0x426365={'fields':[],'order':null};var _0x123fc8=_0x4c62cd[_0x357c('0x35')](',');_0x426365[_0x357c('0x36')]=_[_0x357c('0xa')](_0x123fc8,function(_0x48ede7){if(!_0x48ede7[_0x357c('0x2a')](_0x357c('0x33'))){return!![];}_0x426365[_0x357c('0x37')]=_[_0x357c('0x38')](_0x48ede7,'-')?_0x357c('0x39'):_0x357c('0x3a');return![];});return _0x426365;}exports[_0x357c('0x3b')]=getUpdatedSortOptions;function validateSortParameter(_0x14596c){if(!_0x14596c){_0x14596c=_0x357c('0x3c');}if(_0x14596c['includes'](_0x357c('0x30'))&&!_0x14596c[_0x357c('0x2a')]('internal')){var _0x23d3de=_0x14596c[_0x357c('0x3d')](0x0,_0x14596c[_0x357c('0x3e')](_0x357c('0x30')));_0x14596c+=','+_0x23d3de+'internal';}return _0x14596c;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x43ae61,_0x1a94a1){var _0xee2bd4=_0x43ae61[_0x357c('0x3f')](function(_0x5ad4a9,_0x3b08be){if(_0x5ad4a9[_0x357c('0x33')]===_0x3b08be['globalStatus']){if(_0x5ad4a9[_0x357c('0x33')]===_0x357c('0x12')){if(_0x1a94a1==='DESC'){return(_0x5ad4a9[_0x357c('0x32')]||'')<(_0x3b08be[_0x357c('0x32')]||'')||_0x5ad4a9['fullname'][_0x357c('0x40')]()>_0x3b08be[_0x357c('0x30')]['toLowerCase']()?0x1:-0x1;}else{return(_0x5ad4a9[_0x357c('0x32')]||'')<(_0x3b08be[_0x357c('0x32')]||'')||_0x5ad4a9[_0x357c('0x30')][_0x357c('0x40')]()>_0x3b08be[_0x357c('0x30')][_0x357c('0x40')]()?-0x1:0x1;}}else{if(_0x1a94a1===_0x357c('0x39')){return _0x5ad4a9[_0x357c('0x30')][_0x357c('0x40')]()<_0x3b08be[_0x357c('0x30')][_0x357c('0x40')]()?0x1:-0x1;}else{return _0x5ad4a9[_0x357c('0x30')]['toLowerCase']()<_0x3b08be[_0x357c('0x30')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x1a94a1===_0x357c('0x39')){return _0x5ad4a9['globalStatus']<_0x3b08be[_0x357c('0x33')]?0x1:-0x1;}else{return _0x5ad4a9[_0x357c('0x33')]<_0x3b08be[_0x357c('0x33')]?-0x1:0x1;}}});return _0xee2bd4;}exports[_0x357c('0x41')]=sortAgentsByStatus;function filterAgentAttributes(_0x4a8185){var _0x521a20=[_0x357c('0x42'),'online',_0x357c('0x43'),'lastPauseAt','pauseType',_0x357c('0x44'),_0x357c('0x45'),_0x357c('0x46'),_0x357c('0x47'),_0x357c('0x5'),_0x357c('0x31'),'smsPause',_0x357c('0x8'),'faxPause',_0x357c('0x7'),_0x357c('0x48'),_0x357c('0x49'),_0x357c('0x4a'),_0x357c('0x4b'),_0x357c('0x4c'),_0x357c('0x4d'),_0x357c('0x4e'),'openchannelCurrentCapacity',_0x357c('0x4f'),_0x357c('0x50'),_0x357c('0x51'),_0x357c('0x52'),_0x357c('0x13'),'openchannelStatus',_0x357c('0x53'),_0x357c('0x15'),'whatsappStatus',_0x357c('0x54'),_0x357c('0x11'),_0x357c('0x55'),_0x357c('0x56'),_0x357c('0x57'),_0x357c('0x58'),_0x357c('0x59'),_0x357c('0x5a'),_0x357c('0x5b'),_0x357c('0x5c'),'destconnectedlinenum','screenrecording',_0x357c('0x5d'),_0x357c('0x5e')];var _0x6b2ca7=[_0x357c('0x47'),_0x357c('0x5'),'mailPause',_0x357c('0x6'),_0x357c('0x8'),'faxPause',_0x357c('0x7'),_0x357c('0x5f')];var _0x2adc87=_(_0x4a8185)[_0x357c('0x60')](_0x6b2ca7)[_0x357c('0x61')](_0x521a20)['value']();return _0x2adc87;}exports[_0x357c('0x62')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0x357c('0x2f'),'fullname',_0x357c('0x63'),_0x357c('0x45'),'online',_0x357c('0x33'),_0x357c('0x42'),_0x357c('0x43'),_0x357c('0x32'),_0x357c('0x44'),_0x357c('0x4'),'chatPause','mailPause',_0x357c('0x5'),_0x357c('0x6'),_0x357c('0x7'),_0x357c('0x8'),_0x357c('0x13'),_0x357c('0x54'),'mailStatus',_0x357c('0x14'),_0x357c('0x15'),_0x357c('0x11'),_0x357c('0x16'),_0x357c('0x55'),_0x357c('0x5a'),_0x357c('0x57'),_0x357c('0x56'),_0x357c('0x58'),_0x357c('0x5b'),_0x357c('0x59'),_0x357c('0x48'),_0x357c('0x4d'),_0x357c('0x4a'),_0x357c('0x49'),_0x357c('0x4b'),'whatsappCapacity',_0x357c('0x4e'),_0x357c('0x52'),'mailCurrentCapacity',_0x357c('0x64'),_0x357c('0x50'),_0x357c('0x51'),_0x357c('0x5d'),_0x357c('0x5e'),_0x357c('0x65'),_0x357c('0x66'),_0x357c('0x5c'),_0x357c('0x67')];}exports[_0x357c('0x68')]=getRealtimeAgentsQueryFields;
\ No newline at end of file