Built motion from commit d1eab355.|2.6.28
[motion2.git] / server / components / realtime / agents.js
index 5c9990d..df37dbf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac1e=['faxCurrentCapacity','openchannelStatus','faxStatus','chatStatusTime','openchannelStatusTime','faxStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','value','filterAgentAttributes','lodash','jayson/promise','client','http','chatPause','faxPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','length','unavailable','voiceStatus','idle','chatStatus','mailStatus','smsStatus','whatsappStatus','request','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Agents','result','merge','catch','*pause','busy','isArray','startCase','Queue','map','findOne','getAgents','flatten','includes','getAgentIdsByStatus','resolve','User','name','fullname','mailPause','pauseType','find','globalStatus','getSortedAgentsIdsByStatus','split','fields','order','startsWith','DESC','getUpdatedSortOptions','internal','substring','indexOf','validateSortParameter','pause','toLowerCase','sortAgentsByStatus','online','lastPauseAt','address','chatCapacity','openchannelCapacity','smsCapacity','chatCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity'];(function(_0x2f0fa0,_0x574acd){var _0x33bc0d=function(_0x3b51a6){while(--_0x3b51a6){_0x2f0fa0['push'](_0x2f0fa0['shift']());}};_0x33bc0d(++_0x574acd);}(_0xac1e,0x109));var _0xeac1=function(_0x3eb634,_0x322ffe){_0x3eb634=_0x3eb634-0x0;var _0x170d17=_0xac1e[_0x3eb634];return _0x170d17;};'use strict';var _=require(_0xeac1('0x0'));var jayson=require(_0xeac1('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson['client']['http']({'port':0x232a});var routingClient=jayson[_0xeac1('0x2')][_0xeac1('0x3')]({'port':0x232c});function isAgentPaused(_0xb0e14,_0x9fe46b){var _0x1c9427=[_0xb0e14[_0xeac1('0x4')],_0xb0e14[_0xeac1('0x5')],_0xb0e14['mailPause'],_0xb0e14[_0xeac1('0x6')],_0xb0e14[_0xeac1('0x7')],_0xb0e14[_0xeac1('0x8')],_0xb0e14[_0xeac1('0x9')]];if(!_0x9fe46b)return _[_0xeac1('0xa')](_0x1c9427);var _0x285d54=_[_0xeac1('0xb')](_0x1c9427);return _0x285d54['length']>0x0&&_0x285d54[_0xeac1('0xc')]<_0x1c9427[_0xeac1('0xc')]?!![]:![];}function isIdle(_0x523066){return _0x523066==='idle'||_0x523066==='unknown'||_0x523066===_0xeac1('0xd')||_0x523066==='ringing'||_['isNil'](_0x523066);}function isAgentIdle(_0x36ca33){if(_0x36ca33[_0xeac1('0xe')]!==_0xeac1('0xf')&&_0x36ca33[_0xeac1('0x8')]){_0x36ca33[_0xeac1('0xe')]='pause';return![];}return _[_0xeac1('0xa')]([_0x36ca33[_0xeac1('0x10')],_0x36ca33['faxStatus'],_0x36ca33[_0xeac1('0x11')],_0x36ca33['openchannelStatus'],_0x36ca33[_0xeac1('0x12')],_0x36ca33['voiceStatus'],_0x36ca33[_0xeac1('0x13')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xeac1('0x14')]('Agents',{})[_0xeac1('0x15')](function(_0xd8ae6b){if(_0xd8ae6b[_0xeac1('0x16')]){throw new Error(_0xeac1('0x17'));}var _0x249185=_0xd8ae6b['result'];return routingClient[_0xeac1('0x14')](_0xeac1('0x18'),{})[_0xeac1('0x15')](function(_0x9202d1){if(_0x9202d1[_0xeac1('0x16')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x5ba25a=_0x9202d1[_0xeac1('0x19')];return _[_0xeac1('0x1a')]({},_0x249185,_0x5ba25a);});})[_0xeac1('0x1b')](function(_0x1489da){throw _0x1489da;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x3c7a6){var _0x952fc9='unknown';if(isAgentPaused(_0x3c7a6))_0x952fc9='pause';else if(isAgentPaused(_0x3c7a6,!![]))_0x952fc9=_0xeac1('0x1c');else if(isAgentIdle(_0x3c7a6))_0x952fc9=_0xeac1('0xf');else _0x952fc9=_0xeac1('0x1d');return _0x952fc9;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x1a04c7,_0x4553b7){var _0x553b99=_[_0xeac1('0x1e')](_0x1a04c7)?_0x1a04c7:[_0x1a04c7];var _0x3132b1=_[_0xeac1('0x1f')](_0x4553b7)+_0xeac1('0x20');var _0x56f36d=_[_0xeac1('0x21')](_0x553b99,function(_0x16be59){return db[_0x3132b1][_0xeac1('0x22')]({'where':{'id':_0x16be59}})[_0xeac1('0x15')](function(_0x584c09){if(!_0x584c09)return[];return _0x584c09[_0xeac1('0x23')]({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x56f36d)[_0xeac1('0x15')](function(_0x3f3dc4){var _0xa860d9=_(_0x3f3dc4)[_0xeac1('0x24')]()[_0xeac1('0x21')]('id')['uniq']()['value']();return _0xa860d9;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0xe26cab,_0x4e8969,_0x37224a){try{if(_0x4e8969[_0xeac1('0xc')]>0x0){_0xe26cab=_0xe26cab[_0xeac1('0xb')](function(_0x3c416c){return _0x4e8969[_0xeac1('0x25')](_0x3c416c['id']);});}var _0x2b1e78=_0xe26cab[_0xeac1('0xb')](function(_0x870820){var _0x1c145e=_0xeac1('0x1d');if(isAgentIdle(_0x870820)){_0x1c145e=_0xeac1('0xf');}return _0x1c145e===_0x37224a;});return _['map'](_0x2b1e78,'id');}catch(_0x5aeaa2){throw _0x5aeaa2;}}exports[_0xeac1('0x26')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0xcb2dbf,_0x406f67,_0x12dbc4){return Promise[_0xeac1('0x27')]()['then'](function(){if(_0x406f67[_0xeac1('0xc')]>0x0){_0xcb2dbf=_0xcb2dbf[_0xeac1('0xb')](function(_0x4eb741){return _0x406f67[_0xeac1('0x25')](_0x4eb741['id']);});}return _0xcb2dbf;})[_0xeac1('0x15')](function(){return db[_0xeac1('0x28')]['findAll']({'attributes':['id',_0xeac1('0x29'),_0xeac1('0x2a'),_0xeac1('0x4'),_0xeac1('0x5'),_0xeac1('0x2b'),_0xeac1('0x6'),_0xeac1('0x7'),_0xeac1('0x8'),'whatsappPause',_0xeac1('0x2c')],'where':{'id':{'$in':_[_0xeac1('0x21')](_0xcb2dbf,'id')}},'raw':!![]});})[_0xeac1('0x15')](function(_0x22a73b){return _0x22a73b['map'](function(_0x2ee522){var _0x57e077=_[_0xeac1('0x2d')](_0xcb2dbf,['id',_0x2ee522['id']]);var _0x2a1002=filterAgentAttributes(_0x57e077);_['merge'](_0x2ee522,_0x2a1002);_0x2ee522[_0xeac1('0x2e')]=getAgentStatus(_0x2ee522);return _0x2ee522;});})[_0xeac1('0x15')](function(_0x4aa719){var _0x7e905c=sortAgentsByStatus(_0x4aa719,_0x12dbc4);return _[_0xeac1('0x21')](_0x7e905c,'id');})[_0xeac1('0x1b')](function(_0x50ba2b){throw _0x50ba2b;});}exports[_0xeac1('0x2f')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x15dd72){var _0x472ae7={'fields':[],'order':null};var _0x1864ad=_0x15dd72[_0xeac1('0x30')](',');_0x472ae7[_0xeac1('0x31')]=_[_0xeac1('0xb')](_0x1864ad,function(_0x36720b){if(!_0x36720b[_0xeac1('0x25')](_0xeac1('0x2e'))){return!![];}_0x472ae7[_0xeac1('0x32')]=_[_0xeac1('0x33')](_0x36720b,'-')?_0xeac1('0x34'):'ASC';return![];});return _0x472ae7;}exports[_0xeac1('0x35')]=getUpdatedSortOptions;function validateSortParameter(_0x27f186){if(_0x27f186[_0xeac1('0x25')](_0xeac1('0x2a'))&&!_0x27f186[_0xeac1('0x25')](_0xeac1('0x36'))){var _0x20eaf1=_0x27f186[_0xeac1('0x37')](0x0,_0x27f186[_0xeac1('0x38')]('fullname'));_0x27f186+=','+_0x20eaf1+_0xeac1('0x36');}return _0x27f186;}exports[_0xeac1('0x39')]=validateSortParameter;function sortAgentsByStatus(_0x5764af,_0x1410eb){var _0x262de9=_0x5764af['sort'](function(_0x4e4f32,_0x4cc136){if(_0x4e4f32[_0xeac1('0x2e')]===_0x4cc136[_0xeac1('0x2e')]){if(_0x4e4f32[_0xeac1('0x2e')]===_0xeac1('0x3a')){if(_0x1410eb===_0xeac1('0x34')){return(_0x4e4f32[_0xeac1('0x2c')]||'')<(_0x4cc136['pauseType']||'')||_0x4e4f32['fullname']['toLowerCase']()>_0x4cc136['fullname'][_0xeac1('0x3b')]()?0x1:-0x1;}else{return(_0x4e4f32[_0xeac1('0x2c')]||'')<(_0x4cc136[_0xeac1('0x2c')]||'')||_0x4e4f32[_0xeac1('0x2a')][_0xeac1('0x3b')]()>_0x4cc136[_0xeac1('0x2a')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x1410eb===_0xeac1('0x34')){return _0x4e4f32['fullname'][_0xeac1('0x3b')]()<_0x4cc136[_0xeac1('0x2a')][_0xeac1('0x3b')]()?0x1:-0x1;}else{return _0x4e4f32[_0xeac1('0x2a')]['toLowerCase']()<_0x4cc136[_0xeac1('0x2a')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x1410eb===_0xeac1('0x34')){return _0x4e4f32[_0xeac1('0x2e')]<_0x4cc136[_0xeac1('0x2e')]?0x1:-0x1;}else{return _0x4e4f32[_0xeac1('0x2e')]<_0x4cc136[_0xeac1('0x2e')]?-0x1:0x1;}}});return _0x262de9;}exports[_0xeac1('0x3c')]=sortAgentsByStatus;function filterAgentAttributes(_0x29ee05){var _0x1671ac=['userpic',_0xeac1('0x3d'),'lastLoginAt',_0xeac1('0x3e'),_0xeac1('0x2c'),_0xeac1('0x3e'),_0xeac1('0x36'),_0xeac1('0x3f'),'chatPause','openchannelPause',_0xeac1('0x2b'),_0xeac1('0x7'),_0xeac1('0x9'),_0xeac1('0x5'),_0xeac1('0x8'),_0xeac1('0x40'),_0xeac1('0x41'),'mailCapacity',_0xeac1('0x42'),'whatsappCapacity','faxCapacity',_0xeac1('0x43'),'openchannelCurrentCapacity',_0xeac1('0x44'),_0xeac1('0x45'),_0xeac1('0x46'),_0xeac1('0x47'),_0xeac1('0x10'),_0xeac1('0x48'),_0xeac1('0x11'),_0xeac1('0x12'),'whatsappStatus',_0xeac1('0x49'),'voiceStatus',_0xeac1('0x4a'),_0xeac1('0x4b'),'mailStatusTime','smsStatusTime','whatsappStatusTime',_0xeac1('0x4c'),'voiceStatusTime','queue',_0xeac1('0x4d'),_0xeac1('0x4e'),_0xeac1('0x4f'),_0xeac1('0x50'),_0xeac1('0x51')];var _0x4be216=['chatPause',_0xeac1('0x6'),'mailPause','smsPause',_0xeac1('0x9'),_0xeac1('0x5'),'voicePause',_0xeac1('0x3d')];var _0x5691db=_(_0x29ee05)['omit'](_0x4be216)['pick'](_0x1671ac)[_0xeac1('0x52')]();return _0x5691db;}exports[_0xeac1('0x53')]=filterAgentAttributes;
\ No newline at end of file
+var _0xc4aa=['substring','indexOf','validateSortParameter','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','openchannelCapacity','smsCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','omit','pick','role','openchannelStatusTime','voiceStatusTime','chatCapacity','whatsappCapacity','smsCurrentCapacity','onhold','routealias','getRealtimeAgentsQueryFields','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','filter','length','idle','unknown','ringing','voiceStatus','every','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','error','merge','catch','getRealtimeAgents','pause','*pause','busy','isArray','startCase','Queue','map','findOne','getAgents','all','flatten','uniq','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','User','findAll','name','fullname','pauseType','globalStatus','getSortedAgentsIdsByStatus','split','fields','DESC','internal'];(function(_0x46f659,_0x3c2c9d){var _0xbf5e5c=function(_0x6ff5ea){while(--_0x6ff5ea){_0x46f659['push'](_0x46f659['shift']());}};_0xbf5e5c(++_0x3c2c9d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xc4aa[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0xac4a('0x0'));var jayson=require(_0xac4a('0x1'));var db=require(_0xac4a('0x2'))['db'];var amiClient=jayson[_0xac4a('0x3')][_0xac4a('0x4')]({'port':0x232a});var routingClient=jayson[_0xac4a('0x3')]['http']({'port':0x232c});function isAgentPaused(_0x5cda73,_0x47d4f6){var _0x2f48ed=[_0x5cda73[_0xac4a('0x5')],_0x5cda73[_0xac4a('0x6')],_0x5cda73[_0xac4a('0x7')],_0x5cda73[_0xac4a('0x8')],_0x5cda73[_0xac4a('0x9')],_0x5cda73[_0xac4a('0xa')],_0x5cda73[_0xac4a('0xb')]];if(!_0x47d4f6)return _['every'](_0x2f48ed);var _0x5b8339=_[_0xac4a('0xc')](_0x2f48ed);return _0x5b8339[_0xac4a('0xd')]>0x0&&_0x5b8339[_0xac4a('0xd')]<_0x2f48ed['length']?!![]:![];}function isIdle(_0x1d182e){return _0x1d182e===_0xac4a('0xe')||_0x1d182e===_0xac4a('0xf')||_0x1d182e==='unavailable'||_0x1d182e===_0xac4a('0x10')||_['isNil'](_0x1d182e);}function isAgentIdle(_0x2f062c){if(_0x2f062c['voiceStatus']!==_0xac4a('0xe')&&_0x2f062c[_0xac4a('0xa')]){_0x2f062c[_0xac4a('0x11')]='pause';return![];}return _[_0xac4a('0x12')]([_0x2f062c[_0xac4a('0x13')],_0x2f062c[_0xac4a('0x14')],_0x2f062c[_0xac4a('0x15')],_0x2f062c[_0xac4a('0x16')],_0x2f062c[_0xac4a('0x17')],_0x2f062c[_0xac4a('0x11')],_0x2f062c[_0xac4a('0x18')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xac4a('0x19')](_0xac4a('0x1a'),{})[_0xac4a('0x1b')](function(_0x26dbb8){if(_0x26dbb8['error']){throw new Error(_0xac4a('0x1c'));}var _0x34d797=_0x26dbb8[_0xac4a('0x1d')];return routingClient[_0xac4a('0x19')](_0xac4a('0x1a'),{})[_0xac4a('0x1b')](function(_0x28e304){if(_0x28e304[_0xac4a('0x1e')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x5ac21e=_0x28e304[_0xac4a('0x1d')];return _[_0xac4a('0x1f')]({},_0x34d797,_0x5ac21e);});})[_0xac4a('0x20')](function(_0x4d837c){throw _0x4d837c;});}exports[_0xac4a('0x21')]=getRealtimeAgents;function getAgentStatus(_0x15c223){var _0x3752e4=_0xac4a('0xf');if(isAgentPaused(_0x15c223))_0x3752e4=_0xac4a('0x22');else if(isAgentPaused(_0x15c223,!![]))_0x3752e4=_0xac4a('0x23');else if(isAgentIdle(_0x15c223))_0x3752e4=_0xac4a('0xe');else _0x3752e4=_0xac4a('0x24');return _0x3752e4;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x3d8f0a,_0x3204ad){var _0x599787=_[_0xac4a('0x25')](_0x3d8f0a)?_0x3d8f0a:[_0x3d8f0a];var _0x4169c0=_[_0xac4a('0x26')](_0x3204ad)+_0xac4a('0x27');var _0x4d2d6c=_[_0xac4a('0x28')](_0x599787,function(_0x2503d8){return db[_0x4169c0][_0xac4a('0x29')]({'where':{'id':_0x2503d8}})[_0xac4a('0x1b')](function(_0x594f36){if(!_0x594f36)return[];return _0x594f36[_0xac4a('0x2a')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xac4a('0x2b')](_0x4d2d6c)[_0xac4a('0x1b')](function(_0x3e2c69){var _0x3bc318=_(_0x3e2c69)[_0xac4a('0x2c')]()[_0xac4a('0x28')]('id')[_0xac4a('0x2d')]()[_0xac4a('0x2e')]();return _0x3bc318;});}exports[_0xac4a('0x2f')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x20202c,_0x4e17ce,_0x23b061){try{if(_0x4e17ce[_0xac4a('0xd')]>0x0){_0x20202c=_0x20202c[_0xac4a('0xc')](function(_0x2772fe){return _0x4e17ce[_0xac4a('0x30')](_0x2772fe['id']);});}var _0x4a5a9e=_0x20202c['filter'](function(_0xdb7e){var _0x7a948b=_0xac4a('0x24');if(isAgentIdle(_0xdb7e)){_0x7a948b='idle';}return _0x7a948b===_0x23b061;});return _['map'](_0x4a5a9e,'id');}catch(_0x355755){throw _0x355755;}}exports[_0xac4a('0x31')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x228629,_0x432066,_0x17118e){return Promise['resolve']()[_0xac4a('0x1b')](function(){if(_0x432066['length']>0x0){_0x228629=_0x228629[_0xac4a('0xc')](function(_0x57adcf){return _0x432066[_0xac4a('0x30')](_0x57adcf['id']);});}return _0x228629;})[_0xac4a('0x1b')](function(){return db[_0xac4a('0x32')][_0xac4a('0x33')]({'attributes':['id',_0xac4a('0x34'),_0xac4a('0x35'),_0xac4a('0x5'),_0xac4a('0x6'),_0xac4a('0x7'),_0xac4a('0x8'),_0xac4a('0x9'),_0xac4a('0xa'),_0xac4a('0xb'),_0xac4a('0x36')],'where':{'id':{'$in':_['map'](_0x228629,'id')}},'raw':!![]});})[_0xac4a('0x1b')](function(_0x1c41fb){return _0x1c41fb['map'](function(_0x2a5419){var _0x1af1c1=_['find'](_0x228629,['id',_0x2a5419['id']]);var _0x58804b=filterAgentAttributes(_0x1af1c1);_[_0xac4a('0x1f')](_0x2a5419,_0x58804b);_0x2a5419[_0xac4a('0x37')]=getAgentStatus(_0x2a5419);return _0x2a5419;});})[_0xac4a('0x1b')](function(_0x3de9e2){var _0x4f5986=sortAgentsByStatus(_0x3de9e2,_0x17118e);return _[_0xac4a('0x28')](_0x4f5986,'id');})[_0xac4a('0x20')](function(_0x4e7630){throw _0x4e7630;});}exports[_0xac4a('0x38')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x34f55c){var _0x3ea5c8={'fields':[],'order':null};var _0x5f0eb8=_0x34f55c[_0xac4a('0x39')](',');_0x3ea5c8[_0xac4a('0x3a')]=_[_0xac4a('0xc')](_0x5f0eb8,function(_0x4e0445){if(!_0x4e0445[_0xac4a('0x30')](_0xac4a('0x37'))){return!![];}_0x3ea5c8['order']=_['startsWith'](_0x4e0445,'-')?_0xac4a('0x3b'):'ASC';return![];});return _0x3ea5c8;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x5f0af0){if(!_0x5f0af0){_0x5f0af0='fullname,internal';}if(_0x5f0af0[_0xac4a('0x30')](_0xac4a('0x35'))&&!_0x5f0af0[_0xac4a('0x30')](_0xac4a('0x3c'))){var _0x2bdb21=_0x5f0af0[_0xac4a('0x3d')](0x0,_0x5f0af0[_0xac4a('0x3e')](_0xac4a('0x35')));_0x5f0af0+=','+_0x2bdb21+_0xac4a('0x3c');}return _0x5f0af0;}exports[_0xac4a('0x3f')]=validateSortParameter;function sortAgentsByStatus(_0x14f7d5,_0x1c2a87){var _0x4e4994=_0x14f7d5['sort'](function(_0x5cd24f,_0x1e1cc5){if(_0x5cd24f[_0xac4a('0x37')]===_0x1e1cc5[_0xac4a('0x37')]){if(_0x5cd24f[_0xac4a('0x37')]===_0xac4a('0x22')){if(_0x1c2a87===_0xac4a('0x3b')){return(_0x5cd24f[_0xac4a('0x36')]||'')<(_0x1e1cc5[_0xac4a('0x36')]||'')||_0x5cd24f[_0xac4a('0x35')][_0xac4a('0x40')]()>_0x1e1cc5['fullname'][_0xac4a('0x40')]()?0x1:-0x1;}else{return(_0x5cd24f[_0xac4a('0x36')]||'')<(_0x1e1cc5[_0xac4a('0x36')]||'')||_0x5cd24f[_0xac4a('0x35')][_0xac4a('0x40')]()>_0x1e1cc5['fullname'][_0xac4a('0x40')]()?-0x1:0x1;}}else{if(_0x1c2a87===_0xac4a('0x3b')){return _0x5cd24f['fullname'][_0xac4a('0x40')]()<_0x1e1cc5['fullname'][_0xac4a('0x40')]()?0x1:-0x1;}else{return _0x5cd24f[_0xac4a('0x35')][_0xac4a('0x40')]()<_0x1e1cc5[_0xac4a('0x35')][_0xac4a('0x40')]()?-0x1:0x1;}}}else{if(_0x1c2a87===_0xac4a('0x3b')){return _0x5cd24f[_0xac4a('0x37')]<_0x1e1cc5[_0xac4a('0x37')]?0x1:-0x1;}else{return _0x5cd24f[_0xac4a('0x37')]<_0x1e1cc5[_0xac4a('0x37')]?-0x1:0x1;}}});return _0x4e4994;}exports[_0xac4a('0x41')]=sortAgentsByStatus;function filterAgentAttributes(_0x3b68b3){var _0x569812=[_0xac4a('0x42'),_0xac4a('0x43'),_0xac4a('0x44'),'lastPauseAt',_0xac4a('0x36'),_0xac4a('0x45'),'internal',_0xac4a('0x46'),'chatPause',_0xac4a('0x8'),_0xac4a('0x7'),_0xac4a('0x9'),'whatsappPause','faxPause',_0xac4a('0xa'),'chatCapacity',_0xac4a('0x47'),'mailCapacity',_0xac4a('0x48'),'whatsappCapacity',_0xac4a('0x49'),_0xac4a('0x4a'),_0xac4a('0x4b'),_0xac4a('0x4c'),'smsCurrentCapacity',_0xac4a('0x4d'),_0xac4a('0x4e'),_0xac4a('0x13'),_0xac4a('0x16'),_0xac4a('0x15'),_0xac4a('0x17'),_0xac4a('0x18'),'faxStatus',_0xac4a('0x11'),_0xac4a('0x4f'),'openchannelStatusTime',_0xac4a('0x50'),_0xac4a('0x51'),_0xac4a('0x52'),_0xac4a('0x53'),'voiceStatusTime',_0xac4a('0x54'),_0xac4a('0x55'),_0xac4a('0x56'),_0xac4a('0x57'),_0xac4a('0x58'),'routealias'];var _0x179373=['chatPause',_0xac4a('0x8'),_0xac4a('0x7'),'smsPause','whatsappPause',_0xac4a('0x6'),_0xac4a('0xa'),'online'];var _0x18d29c=_(_0x3b68b3)[_0xac4a('0x59')](_0x179373)[_0xac4a('0x5a')](_0x569812)[_0xac4a('0x2e')]();return _0x18d29c;}exports['filterAgentAttributes']=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0xac4a('0x34'),_0xac4a('0x35'),_0xac4a('0x5b'),_0xac4a('0x3c'),_0xac4a('0x43'),_0xac4a('0x37'),_0xac4a('0x42'),'lastLoginAt',_0xac4a('0x36'),_0xac4a('0x45'),_0xac4a('0x6'),_0xac4a('0x5'),_0xac4a('0x7'),_0xac4a('0x8'),_0xac4a('0x9'),_0xac4a('0xa'),_0xac4a('0xb'),_0xac4a('0x13'),_0xac4a('0x14'),_0xac4a('0x15'),_0xac4a('0x16'),_0xac4a('0x17'),_0xac4a('0x11'),_0xac4a('0x18'),'chatStatusTime',_0xac4a('0x53'),'mailStatusTime',_0xac4a('0x5c'),'smsStatusTime',_0xac4a('0x5d'),'whatsappStatusTime',_0xac4a('0x5e'),'faxCapacity','mailCapacity',_0xac4a('0x47'),_0xac4a('0x48'),_0xac4a('0x5f'),_0xac4a('0x4a'),_0xac4a('0x4e'),_0xac4a('0x4c'),'openchannelCurrentCapacity',_0xac4a('0x60'),'whatsappCurrentCapacity',_0xac4a('0x57'),'phoneBarEnableAutomaticScreenRecording',_0xac4a('0x55'),_0xac4a('0x61'),_0xac4a('0x54'),_0xac4a('0x62'),_0xac4a('0x56')];}exports[_0xac4a('0x63')]=getRealtimeAgentsQueryFields;
\ No newline at end of file